@progressive-development/pd-order 0.9.2 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -2
- package/README.md +31 -57
- package/dist/pd-order-contacts/PdOrderContacts.d.ts +18 -14
- package/dist/pd-order-contacts/PdOrderContacts.d.ts.map +1 -1
- package/dist/pd-order-contacts/PdOrderContacts.js +6 -6
- package/dist/pd-order-contacts/pd-order-contacts.stories.d.ts +64 -16
- package/dist/pd-order-contacts/pd-order-contacts.stories.d.ts.map +1 -1
- package/dist/pd-order-summary/PdOrderSummary.d.ts +16 -16
- package/dist/pd-order-summary/PdOrderSummary.d.ts.map +1 -1
- package/dist/pd-order-summary/PdOrderSummary.js +4 -5
- package/dist/pd-order-summary/pd-order-summary.stories.d.ts +58 -12
- package/dist/pd-order-summary/pd-order-summary.stories.d.ts.map +1 -1
- package/package.json +11 -8
package/LICENSE
CHANGED
|
@@ -1,2 +1,21 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2021-present PD Progressive Development UG
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,76 +1,50 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @progressive-development/pd-order
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
[](https://www.npmjs.com/package/@progressive-development/pd-order)
|
|
4
|
+
[](LICENSE)
|
|
5
|
+
|
|
6
|
+
Order flow components for multi-address management and order summaries.
|
|
7
|
+
|
|
8
|
+
## Features
|
|
9
|
+
|
|
10
|
+
- **Lit 3 & TypeScript** – Modern, type-safe web components
|
|
11
|
+
- **Accessible** – WCAG 2.1 compliant, keyboard navigation, ARIA support
|
|
12
|
+
- **Themeable** – CSS Custom Properties for easy customization
|
|
13
|
+
- **Localized** – Built-in i18n support (EN, DE, BE)
|
|
14
|
+
- **Lightweight** – No heavy dependencies, tree-shakeable
|
|
15
|
+
- **Framework-agnostic** – Works with React, Vue, Angular, or vanilla JS
|
|
16
|
+
- **Multi-Address Management** – Handle customer, billing, property, and manager addresses with smart fallbacks
|
|
17
|
+
- **Property Owner Scenarios** – Specialized fields for landlord workflows with conditional address sections
|
|
18
|
+
- **Dual Display Modes** – Switch between full edit form and compact summary view
|
|
19
|
+
- **Order Summary with Terms** – Price table integration, tax display, and legal consent checkbox with modal
|
|
4
20
|
|
|
5
21
|
## Installation
|
|
6
22
|
|
|
7
23
|
```bash
|
|
8
|
-
npm
|
|
24
|
+
npm install @progressive-development/pd-order
|
|
9
25
|
```
|
|
10
26
|
|
|
11
|
-
##
|
|
27
|
+
## Quick Start
|
|
12
28
|
|
|
13
29
|
```html
|
|
14
30
|
<script type="module">
|
|
15
|
-
import '
|
|
31
|
+
import '@progressive-development/pd-order';
|
|
16
32
|
</script>
|
|
17
33
|
|
|
18
|
-
<pd-order></pd-order>
|
|
34
|
+
<pd-order-contacts></pd-order-contacts>
|
|
19
35
|
```
|
|
20
36
|
|
|
21
|
-
##
|
|
37
|
+
## Components
|
|
22
38
|
|
|
23
|
-
|
|
39
|
+
| Component | Description |
|
|
40
|
+
|-----------|-------------|
|
|
41
|
+
| `<pd-order-contacts>` | Multi-address contact management |
|
|
42
|
+
| `<pd-order-summary>` | Order overview with pricing and terms |
|
|
24
43
|
|
|
25
|
-
|
|
26
|
-
npm run lint
|
|
27
|
-
```
|
|
28
|
-
|
|
29
|
-
To automatically fix linting and formatting errors, run
|
|
30
|
-
|
|
31
|
-
```bash
|
|
32
|
-
npm run format
|
|
33
|
-
```
|
|
44
|
+
## Documentation
|
|
34
45
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
To execute a single test run:
|
|
38
|
-
|
|
39
|
-
```bash
|
|
40
|
-
npm run test
|
|
41
|
-
```
|
|
42
|
-
|
|
43
|
-
To run the tests in interactive watch mode run:
|
|
44
|
-
|
|
45
|
-
```bash
|
|
46
|
-
npm run test:watch
|
|
47
|
-
```
|
|
46
|
+
📖 **Full documentation:** [pd-components.web.app](https://pd-components.web.app/)
|
|
48
47
|
|
|
49
|
-
##
|
|
50
|
-
|
|
51
|
-
To run a local instance of Storybook for your component, run
|
|
52
|
-
|
|
53
|
-
```bash
|
|
54
|
-
npm run storybook
|
|
55
|
-
```
|
|
56
|
-
|
|
57
|
-
To build a production version of Storybook, run
|
|
58
|
-
|
|
59
|
-
```bash
|
|
60
|
-
npm run storybook:build
|
|
61
|
-
```
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
## Tooling configs
|
|
65
|
-
|
|
66
|
-
For most of the tools, the configuration is in the `package.json` to minimize the amount of files in your project.
|
|
67
|
-
|
|
68
|
-
If you customize the configuration a lot, you can consider moving them to individual files.
|
|
69
|
-
|
|
70
|
-
## Local Demo with `web-dev-server`
|
|
71
|
-
|
|
72
|
-
```bash
|
|
73
|
-
npm start
|
|
74
|
-
```
|
|
48
|
+
## License
|
|
75
49
|
|
|
76
|
-
|
|
50
|
+
MIT © [PD Progressive Development UG](https://progressive-development.com)
|
|
@@ -1,37 +1,41 @@
|
|
|
1
1
|
import { LitElement, CSSResultGroup, PropertyValues } from 'lit';
|
|
2
2
|
import { PdContactData, PdContactMatch } from '@progressive-development/pd-contact';
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
5
|
-
* Supports optional billing address, property owner info and admin contact.
|
|
4
|
+
* Order contact management with multiple address sections.
|
|
6
5
|
*
|
|
7
|
-
* @fires validate-form - Triggers validation of embedded contact components.
|
|
8
|
-
* @slot - General slot
|
|
9
6
|
* @tagname pd-order-contacts
|
|
7
|
+
* @summary Multi-contact form with order, billing, admin, and property addresses.
|
|
8
|
+
*
|
|
9
|
+
* @event validate-form - Fired during contact validation.
|
|
10
10
|
*/
|
|
11
11
|
export declare class PdOrderContacts extends LitElement {
|
|
12
|
-
/**
|
|
12
|
+
/** Show read-only summary mode */
|
|
13
13
|
summary: boolean;
|
|
14
|
-
/**
|
|
14
|
+
/** Section title overrides for contact headers */
|
|
15
15
|
contactTitle: Record<string, string>;
|
|
16
|
-
/**
|
|
16
|
+
/** Required field names per contact (e.g., ['street', 'zip']) */
|
|
17
17
|
requiredFields: string[];
|
|
18
|
-
/**
|
|
18
|
+
/** Primary order contact data */
|
|
19
19
|
orderContact?: PdContactData;
|
|
20
|
-
/**
|
|
20
|
+
/** Optional separate billing address */
|
|
21
21
|
billingContact?: PdContactData;
|
|
22
|
-
/**
|
|
22
|
+
/** Optional admin/management contact */
|
|
23
23
|
adminContact?: PdContactData;
|
|
24
|
-
/**
|
|
24
|
+
/** Property address if different from order address */
|
|
25
25
|
propertyContact?: PdContactData;
|
|
26
|
-
/**
|
|
26
|
+
/** Enable billing address option */
|
|
27
27
|
withPayment: boolean;
|
|
28
|
-
/**
|
|
28
|
+
/** Enable property owner/landlord options */
|
|
29
29
|
withPropertyOwner: boolean;
|
|
30
|
+
/** Enable property date field */
|
|
30
31
|
withPropertyDate: boolean;
|
|
31
|
-
/**
|
|
32
|
+
/** Optional field validation/mapping configuration */
|
|
32
33
|
match?: PdContactMatch;
|
|
34
|
+
/** @ignore */
|
|
33
35
|
private _ownBillingContact;
|
|
36
|
+
/** @ignore */
|
|
34
37
|
private _ownAdminContact;
|
|
38
|
+
/** @ignore */
|
|
35
39
|
private _isPropertyOwner;
|
|
36
40
|
static styles: CSSResultGroup;
|
|
37
41
|
update(changedProps: PropertyValues<this>): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PdOrderContacts.d.ts","sourceRoot":"","sources":["../../src/pd-order-contacts/PdOrderContacts.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EAIV,cAAc,EACd,cAAc,EACf,MAAM,KAAK,CAAC;AAIb,OAAO,uDAAuD,CAAC;AAC/D,OAAO,iDAAiD,CAAC;AACzD,OAAO,gDAAgD,CAAC;AACxD,OAAO,+CAA+C,CAAC;AAIvD,OAAO,EAEL,aAAa,EACb,cAAc,EACf,MAAM,qCAAqC,CAAC;AAE7C;;;;;;;GAOG;AACH,qBACa,eAAgB,SAAQ,UAAU;IAC7C,
|
|
1
|
+
{"version":3,"file":"PdOrderContacts.d.ts","sourceRoot":"","sources":["../../src/pd-order-contacts/PdOrderContacts.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EAIV,cAAc,EACd,cAAc,EACf,MAAM,KAAK,CAAC;AAIb,OAAO,uDAAuD,CAAC;AAC/D,OAAO,iDAAiD,CAAC;AACzD,OAAO,gDAAgD,CAAC;AACxD,OAAO,+CAA+C,CAAC;AAIvD,OAAO,EAEL,aAAa,EACb,cAAc,EACf,MAAM,qCAAqC,CAAC;AAE7C;;;;;;;GAOG;AACH,qBACa,eAAgB,SAAQ,UAAU;IAC7C,kCAAkC;IAElC,OAAO,UAAS;IAEhB,kDAAkD;IAElD,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAM;IAE1C,iEAAiE;IAEjE,cAAc,EAAE,MAAM,EAAE,CAAM;IAE9B,iCAAiC;IAEjC,YAAY,CAAC,EAAE,aAAa,CAAC;IAE7B,wCAAwC;IAExC,cAAc,CAAC,EAAE,aAAa,CAAC;IAE/B,wCAAwC;IAExC,YAAY,CAAC,EAAE,aAAa,CAAC;IAE7B,uDAAuD;IAEvD,eAAe,CAAC,EAAE,aAAa,CAAC;IAEhC,oCAAoC;IAEpC,WAAW,UAAS;IAEpB,6CAA6C;IAE7C,iBAAiB,UAAS;IAE1B,iCAAiC;IAEjC,gBAAgB,UAAS;IAEzB,sDAAsD;IAEtD,KAAK,CAAC,EAAE,cAAc,CAAC;IAEvB,cAAc;IAEd,OAAO,CAAC,kBAAkB,CAAS;IAEnC,cAAc;IAEd,OAAO,CAAC,gBAAgB,CAAS;IAEjC,cAAc;IAEd,OAAO,CAAC,gBAAgB,CAAS;IAEjC,OAAgB,MAAM,EAAE,cAAc,CA+CpC;IAEO,MAAM,CAAC,YAAY,EAAE,cAAc,CAAC,IAAI,CAAC,GAAG,IAAI;IAazD,SAAS,CAAC,MAAM;IAIhB,OAAO,CAAC,mBAAmB;IAiK3B,OAAO,CAAC,cAAc;IA+CtB,IAAI,KAAK,IAAI,OAAO,CASnB;IAEY,eAAe,IAAI,OAAO,CAAC,OAAO,CAAC;IAkCzC,SAAS;IAWhB,OAAO,CAAC,eAAe;CAoBxB"}
|
|
@@ -325,12 +325,12 @@ PdOrderContacts.styles = [
|
|
|
325
325
|
}
|
|
326
326
|
|
|
327
327
|
.property-owner-box {
|
|
328
|
-
border: 2px solid
|
|
329
|
-
border-radius:
|
|
330
|
-
padding:
|
|
331
|
-
margin:
|
|
332
|
-
background-color:
|
|
333
|
-
box-shadow:
|
|
328
|
+
border: 2px solid var(--pd-default-col);
|
|
329
|
+
border-radius: var(--pd-radius-lg);
|
|
330
|
+
padding: var(--pd-spacing-lg);
|
|
331
|
+
margin: var(--pd-spacing-lg) 0;
|
|
332
|
+
background-color: var(--pd-default-bg-light-col);
|
|
333
|
+
box-shadow: var(--pd-shadow-md);
|
|
334
334
|
}
|
|
335
335
|
`
|
|
336
336
|
];
|
|
@@ -1,17 +1,65 @@
|
|
|
1
|
-
import { Meta,
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/web-components-vite';
|
|
2
|
+
import { PdContactData } from '@progressive-development/pd-contact';
|
|
3
|
+
/**
|
|
4
|
+
* Story arguments interface for pd-order-contacts component.
|
|
5
|
+
* Maps to the component's public API for multi-contact order forms.
|
|
6
|
+
*/
|
|
7
|
+
interface PdOrderContactsArgs {
|
|
8
|
+
/** Show read-only summary mode */
|
|
9
|
+
summary: boolean;
|
|
10
|
+
/** Enable billing address option */
|
|
11
|
+
withPayment: boolean;
|
|
12
|
+
/** Enable property owner/landlord options */
|
|
13
|
+
withPropertyOwner: boolean;
|
|
14
|
+
/** Enable property date field */
|
|
15
|
+
withPropertyDate: boolean;
|
|
16
|
+
/** Required field names per contact */
|
|
17
|
+
requiredFields: string[];
|
|
18
|
+
/** Primary order contact data */
|
|
19
|
+
orderContact?: PdContactData;
|
|
20
|
+
/** Optional billing contact data */
|
|
21
|
+
billingContact?: PdContactData;
|
|
22
|
+
/** Optional admin contact data */
|
|
23
|
+
adminContact?: PdContactData;
|
|
24
|
+
/** Optional property address data */
|
|
25
|
+
propertyContact?: PdContactData;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* ## pd-order-contacts
|
|
29
|
+
*
|
|
30
|
+
* Multi-contact management component for order workflows with collapsible
|
|
31
|
+
* address sections for order, billing, property, and admin contacts.
|
|
32
|
+
*
|
|
33
|
+
* ### Features
|
|
34
|
+
* - Primary order contact form (always visible)
|
|
35
|
+
* - Optional billing address section with toggle
|
|
36
|
+
* - Optional property owner section with landlord checkbox
|
|
37
|
+
* - Optional property date field
|
|
38
|
+
* - Admin/management contact for property owners
|
|
39
|
+
* - Summary mode for read-only display of all contacts
|
|
40
|
+
* - Form validation with required field support across all contacts
|
|
41
|
+
* - Collapsible sections via pd-collapse-group
|
|
42
|
+
*
|
|
43
|
+
* ### Form Methods
|
|
44
|
+
* - `triggerValidate()` — validates all visible contacts, opens first invalid section
|
|
45
|
+
* - `getValues()` — returns all visible contact data
|
|
46
|
+
* - `valid` — getter for current validation state
|
|
47
|
+
*/
|
|
48
|
+
declare const meta: Meta<PdOrderContactsArgs>;
|
|
49
|
+
export default meta;
|
|
50
|
+
type Story = StoryObj<PdOrderContactsArgs>;
|
|
51
|
+
/** Default empty order contacts form with a single address section. Interactive via Controls panel. */
|
|
52
|
+
export declare const Default: Story;
|
|
53
|
+
/** Form with pre-populated order contact data. */
|
|
54
|
+
export declare const Prepopulated: Story;
|
|
55
|
+
/** Form with billing address section enabled — shows toggle to add separate billing address. */
|
|
56
|
+
export declare const WithBilling: Story;
|
|
57
|
+
/** Form with property owner section — includes landlord checkbox, property address, and admin contact. */
|
|
58
|
+
export declare const WithPropertyOwner: Story;
|
|
59
|
+
/** All features enabled with pre-populated data across all contact sections. */
|
|
60
|
+
export declare const FullyConfigured: Story;
|
|
61
|
+
/** Read-only summary showing all configured contacts side by side. */
|
|
62
|
+
export declare const SummaryMode: Story;
|
|
63
|
+
/** Form with all fields marked as required — triggers validation on submit. */
|
|
64
|
+
export declare const RequiredFields: Story;
|
|
17
65
|
//# sourceMappingURL=pd-order-contacts.stories.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pd-order-contacts.stories.d.ts","sourceRoot":"","sources":["../../src/pd-order-contacts/pd-order-contacts.stories.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"pd-order-contacts.stories.d.ts","sourceRoot":"","sources":["../../src/pd-order-contacts/pd-order-contacts.stories.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,gCAAgC,CAAC;AAGrE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qCAAqC,CAAC;AACzE,OAAO,6CAA6C,CAAC;AAGrD,OAAO,wBAAwB,CAAC;AAMhC;;;GAGG;AACH,UAAU,mBAAmB;IAC3B,kCAAkC;IAClC,OAAO,EAAE,OAAO,CAAC;IACjB,oCAAoC;IACpC,WAAW,EAAE,OAAO,CAAC;IACrB,6CAA6C;IAC7C,iBAAiB,EAAE,OAAO,CAAC;IAC3B,iCAAiC;IACjC,gBAAgB,EAAE,OAAO,CAAC;IAC1B,uCAAuC;IACvC,cAAc,EAAE,MAAM,EAAE,CAAC;IACzB,iCAAiC;IACjC,YAAY,CAAC,EAAE,aAAa,CAAC;IAC7B,oCAAoC;IACpC,cAAc,CAAC,EAAE,aAAa,CAAC;IAC/B,kCAAkC;IAClC,YAAY,CAAC,EAAE,aAAa,CAAC;IAC7B,qCAAqC;IACrC,eAAe,CAAC,EAAE,aAAa,CAAC;CACjC;AA0FD;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,mBAAmB,CAkGnC,CAAC;AAEF,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,mBAAmB,CAAC,CAAC;AAM3C,uGAAuG;AACvG,eAAO,MAAM,OAAO,EAAE,KAAU,CAAC;AAMjC,kDAAkD;AAClD,eAAO,MAAM,YAAY,EAAE,KAI1B,CAAC;AAMF,gGAAgG;AAChG,eAAO,MAAM,WAAW,EAAE,KAKzB,CAAC;AAMF,0GAA0G;AAC1G,eAAO,MAAM,iBAAiB,EAAE,KAc/B,CAAC;AAMF,gFAAgF;AAChF,eAAO,MAAM,eAAe,EAAE,KAkB7B,CAAC;AAMF,sEAAsE;AACtE,eAAO,MAAM,WAAW,EAAE,KA8CzB,CAAC;AAMF,+EAA+E;AAC/E,eAAO,MAAM,cAAc,EAAE,KAI5B,CAAC"}
|
|
@@ -1,31 +1,31 @@
|
|
|
1
1
|
import { LitElement, CSSResultGroup, TemplateResult } from 'lit';
|
|
2
2
|
import { PdOrderStep } from '../types.js';
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
4
|
+
* Order summary component displaying steps, pricing, and agreement.
|
|
5
5
|
*
|
|
6
|
-
* @fires go-to - Wird ausgelöst, wenn der Benutzer "edit-content" aktiviert
|
|
7
|
-
* @slot legal - Slot für die AGB-Inhalte
|
|
8
6
|
* @tagname pd-order-summary
|
|
7
|
+
* @summary Order summary with steps, pricing, and terms agreement.
|
|
8
|
+
*
|
|
9
|
+
* @event go-to - Fired when user clicks edit on a step. Detail: `{ step }`.
|
|
10
|
+
*
|
|
11
|
+
* @slot legal - Terms and conditions content.
|
|
12
|
+
* @slot [stepKey] - Named slots for custom step content.
|
|
13
|
+
*
|
|
14
|
+
* @cssprop --pd-order-summary-payment-bg-col - Payment section background. Default: `var(--pd-default-light-col)`.
|
|
9
15
|
*/
|
|
10
16
|
export declare class PdOrderSummary extends LitElement {
|
|
11
|
-
/**
|
|
12
|
-
* Die Liste der Bestellschritte (z.B. Buchung, Kontaktdaten, etc.),
|
|
13
|
-
* wie sie in der Zusammenfassung gerendert werden.
|
|
14
|
-
*/
|
|
17
|
+
/** Order steps to display in summary (e.g., booking, contacts) */
|
|
15
18
|
orderSteps: PdOrderStep[];
|
|
16
|
-
/**
|
|
17
|
-
* Gibt an, ob ein Zahlungsabschnitt mit Preisdetails angezeigt werden soll.
|
|
18
|
-
*/
|
|
19
|
+
/** Show payment/pricing section */
|
|
19
20
|
withPayment: boolean;
|
|
20
|
-
/**
|
|
21
|
-
* Gibt an, ob eine Checkbox zur Zustimmung zu den AGB angezeigt und validiert werden soll.
|
|
22
|
-
*/
|
|
21
|
+
/** Show terms agreement checkbox with validation */
|
|
23
22
|
withAgreement: boolean;
|
|
24
|
-
/**
|
|
25
|
-
* Die vollständigen Bestelldaten inklusive Postleitzahl, Kontakten und Preisinformationen.
|
|
26
|
-
*/
|
|
23
|
+
/** Complete order data including zip, contacts, and pricing */
|
|
27
24
|
order?: any;
|
|
25
|
+
/** @ignore */
|
|
28
26
|
private _agreeForm;
|
|
27
|
+
/** @ignore */
|
|
28
|
+
private _agreePopup;
|
|
29
29
|
static styles: CSSResultGroup;
|
|
30
30
|
firstUpdated(): void;
|
|
31
31
|
render(): TemplateResult<1>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PdOrderSummary.d.ts","sourceRoot":"","sources":["../../src/pd-order-summary/PdOrderSummary.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAa,cAAc,EAAE,cAAc,EAAE,MAAM,KAAK,CAAC;AAI5E,OAAO,qDAAqD,CAAC;AAC7D,OAAO,+CAA+C,CAAC;AACvD,OAAO,+CAA+C,CAAC;AAEvD,OAAO,iDAAiD,CAAC;AACzD,OAAO,6CAA6C,CAAC;
|
|
1
|
+
{"version":3,"file":"PdOrderSummary.d.ts","sourceRoot":"","sources":["../../src/pd-order-summary/PdOrderSummary.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAa,cAAc,EAAE,cAAc,EAAE,MAAM,KAAK,CAAC;AAI5E,OAAO,qDAAqD,CAAC;AAC7D,OAAO,+CAA+C,CAAC;AACvD,OAAO,+CAA+C,CAAC;AAEvD,OAAO,iDAAiD,CAAC;AACzD,OAAO,6CAA6C,CAAC;AAErD,OAAO,qDAAqD,CAAC;AAE7D,OAAO,EAAsB,WAAW,EAAE,MAAM,aAAa,CAAC;AAE9D,OAAO,2CAA2C,CAAC;AAGnD;;;;;;;;;;;;GAYG;AACH,qBACa,cAAe,SAAQ,UAAU;IAC5C,kEAAkE;IAElE,UAAU,EAAE,WAAW,EAAE,CAAM;IAE/B,mCAAmC;IAEnC,WAAW,UAAS;IAEpB,oDAAoD;IAEpD,aAAa,UAAS;IAEtB,+DAA+D;IAE/D,KAAK,CAAC,EAAE,GAAG,CAAC;IAEZ,cAAc;IAEd,OAAO,CAAC,UAAU,CAAmB;IAErC,cAAc;IAEd,OAAO,CAAC,WAAW,CAAW;IAE9B,OAAgB,MAAM,EAAE,cAAc,CAmDpC;IAEO,YAAY,IAAI,IAAI;IAYpB,MAAM;IAyDf,IAAI,KAAK,YAER;IAEY,eAAe,IAAI,OAAO,CAAC,OAAO,CAAC;IA6BhD,SAAS,CAAC,oBAAoB,CAC5B,IAAI,EAAE,WAAW,EACjB,KAAK,EAAE,MAAM,GACZ,cAAc;IAkBjB,SAAS,CAAC,6BAA6B,CACrC,IAAI,EAAE,WAAW,EACjB,KAAK,EAAE,MAAM,GACZ,cAAc,GAAG,IAAI;IAUxB,SAAS,CAAC,mBAAmB,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,WAAW;IAoB9D,OAAO,CAAC,uBAAuB;CAIhC"}
|
|
@@ -40,7 +40,6 @@ let PdOrderSummary = class extends LitElement {
|
|
|
40
40
|
render() {
|
|
41
41
|
if (!this.order) return html`<p>No order is set</p>`;
|
|
42
42
|
return html`
|
|
43
|
-
<h3>${msg("Übersicht", { id: "pd.order.summary.title" })}</h3>
|
|
44
43
|
<div class="edit-summary-container">
|
|
45
44
|
${this.orderSteps.map(
|
|
46
45
|
(step, index) => this._mapOrderStepSummary(step, index)
|
|
@@ -162,10 +161,7 @@ let PdOrderSummary = class extends LitElement {
|
|
|
162
161
|
}
|
|
163
162
|
_openTermsAndConditions(e) {
|
|
164
163
|
e.stopPropagation();
|
|
165
|
-
|
|
166
|
-
"agreePopupId"
|
|
167
|
-
);
|
|
168
|
-
popup?.showPopup();
|
|
164
|
+
this._agreePopup?.showPopup();
|
|
169
165
|
}
|
|
170
166
|
};
|
|
171
167
|
PdOrderSummary.styles = [
|
|
@@ -235,6 +231,9 @@ __decorateClass([
|
|
|
235
231
|
__decorateClass([
|
|
236
232
|
query("#submitSummaryFormId")
|
|
237
233
|
], PdOrderSummary.prototype, "_agreeForm", 2);
|
|
234
|
+
__decorateClass([
|
|
235
|
+
query("#agreePopupId")
|
|
236
|
+
], PdOrderSummary.prototype, "_agreePopup", 2);
|
|
238
237
|
PdOrderSummary = __decorateClass([
|
|
239
238
|
localized()
|
|
240
239
|
], PdOrderSummary);
|
|
@@ -1,13 +1,59 @@
|
|
|
1
|
-
import { Meta,
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/web-components-vite';
|
|
2
|
+
import { PdContactData } from '@progressive-development/pd-contact';
|
|
3
|
+
import { PdOrderStep } from '../types.js';
|
|
4
|
+
/**
|
|
5
|
+
* Story arguments interface for pd-order-summary component.
|
|
6
|
+
* Maps to the component's public API for order summary display.
|
|
7
|
+
*/
|
|
8
|
+
interface PdOrderSummaryArgs {
|
|
9
|
+
/** Show payment/pricing section */
|
|
10
|
+
withPayment: boolean;
|
|
11
|
+
/** Show terms agreement checkbox with validation */
|
|
12
|
+
withAgreement: boolean;
|
|
13
|
+
/** Order steps to display in summary */
|
|
14
|
+
orderSteps: PdOrderStep[];
|
|
15
|
+
/** Primary order contact data */
|
|
16
|
+
orderContact: PdContactData;
|
|
17
|
+
/** Optional billing contact data */
|
|
18
|
+
billingContact?: PdContactData;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* ## pd-order-summary
|
|
22
|
+
*
|
|
23
|
+
* Order summary component that displays configurable steps, pricing information,
|
|
24
|
+
* and an optional terms-and-conditions agreement.
|
|
25
|
+
*
|
|
26
|
+
* ### Features
|
|
27
|
+
* - Configurable order steps with edit-content integration
|
|
28
|
+
* - Automatic contact summary rendering for "contacts" step key
|
|
29
|
+
* - Price table with tax calculation via pd-pricetable
|
|
30
|
+
* - Terms and conditions agreement checkbox with popup
|
|
31
|
+
* - Named slots for custom step content and legal text
|
|
32
|
+
* - Fires `go-to` event when user clicks edit on a step
|
|
33
|
+
*
|
|
34
|
+
* ### Slots
|
|
35
|
+
* - `legal` — Terms and conditions content (shown in popup)
|
|
36
|
+
* - `[stepKey]` — Named slots for custom step content
|
|
37
|
+
*
|
|
38
|
+
* ### Usage Note
|
|
39
|
+
* Stories use `pd-order-summary-test` (a test wrapper that extends PdOrderSummary)
|
|
40
|
+
* to provide a concrete implementation for demo purposes.
|
|
41
|
+
*/
|
|
42
|
+
declare const meta: Meta<PdOrderSummaryArgs>;
|
|
43
|
+
export default meta;
|
|
44
|
+
type Story = StoryObj<PdOrderSummaryArgs>;
|
|
45
|
+
/** Default order summary with payment and agreement enabled. Interactive via Controls panel. */
|
|
46
|
+
export declare const Default: Story;
|
|
47
|
+
/** Order summary showing separate billing contact alongside order contact. */
|
|
48
|
+
export declare const WithBillingContact: Story;
|
|
49
|
+
/** Order summary without the pricing/payment section — for non-billable orders. */
|
|
50
|
+
export declare const WithoutPayment: Story;
|
|
51
|
+
/** Order summary without the terms agreement checkbox — when agreement is handled elsewhere. */
|
|
52
|
+
export declare const WithoutAgreement: Story;
|
|
53
|
+
/** Minimal order summary without payment and agreement — just the order steps and contacts. */
|
|
54
|
+
export declare const Minimal: Story;
|
|
55
|
+
/** All summary configurations side by side for comparison. */
|
|
56
|
+
export declare const AllConfigurations: Story;
|
|
57
|
+
/** CSS Custom Properties — Branded and Redesigned payment section variants. */
|
|
58
|
+
export declare const CustomStyling: Story;
|
|
13
59
|
//# sourceMappingURL=pd-order-summary.stories.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pd-order-summary.stories.d.ts","sourceRoot":"","sources":["../../src/pd-order-summary/pd-order-summary.stories.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"pd-order-summary.stories.d.ts","sourceRoot":"","sources":["../../src/pd-order-summary/pd-order-summary.stories.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,gCAAgC,CAAC;AAGrE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qCAAqC,CAAC;AACzE,OAAO,6CAA6C,CAAC;AAErD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAG/C,OAAO,sCAAsC,CAAC;AAM9C;;;GAGG;AACH,UAAU,kBAAkB;IAC1B,mCAAmC;IACnC,WAAW,EAAE,OAAO,CAAC;IACrB,oDAAoD;IACpD,aAAa,EAAE,OAAO,CAAC;IACvB,wCAAwC;IACxC,UAAU,EAAE,WAAW,EAAE,CAAC;IAC1B,iCAAiC;IACjC,YAAY,EAAE,aAAa,CAAC;IAC5B,oCAAoC;IACpC,cAAc,CAAC,EAAE,aAAa,CAAC;CAChC;AA4FD;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,kBAAkB,CAiGlC,CAAC;AAEF,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,kBAAkB,CAAC,CAAC;AAM1C,gGAAgG;AAChG,eAAO,MAAM,OAAO,EAAE,KAAU,CAAC;AAMjC,8EAA8E;AAC9E,eAAO,MAAM,kBAAkB,EAAE,KAIhC,CAAC;AAMF,mFAAmF;AACnF,eAAO,MAAM,cAAc,EAAE,KAI5B,CAAC;AAMF,gGAAgG;AAChG,eAAO,MAAM,gBAAgB,EAAE,KAI9B,CAAC;AAMF,+FAA+F;AAC/F,eAAO,MAAM,OAAO,EAAE,KAYrB,CAAC;AAMF,8DAA8D;AAC9D,eAAO,MAAM,iBAAiB,EAAE,KAqD/B,CAAC;AAMF,+EAA+E;AAC/E,eAAO,MAAM,aAAa,EAAE,KAwE3B,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@progressive-development/pd-order",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "1.0.0",
|
|
4
4
|
"description": "Progressive Development Order Component",
|
|
5
5
|
"author": "PD Progressive Development",
|
|
6
|
-
"license": "
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"publishConfig": {
|
|
8
|
+
"access": "public"
|
|
9
|
+
},
|
|
7
10
|
"main": "./dist/index.js",
|
|
8
11
|
"module": "./dist/index.js",
|
|
9
12
|
"type": "module",
|
|
@@ -27,12 +30,12 @@
|
|
|
27
30
|
"@lit/localize": "^0.12.2",
|
|
28
31
|
"fecha": "^4.2.3",
|
|
29
32
|
"tslib": "^2.8.1",
|
|
30
|
-
"@progressive-development/pd-shared-styles": "0.3.
|
|
31
|
-
"@progressive-development/pd-
|
|
32
|
-
"@progressive-development/pd-
|
|
33
|
-
"@progressive-development/pd-forms": "0.
|
|
34
|
-
"@progressive-development/pd-dialog": "0.
|
|
35
|
-
"@progressive-development/pd-
|
|
33
|
+
"@progressive-development/pd-shared-styles": "0.3.1",
|
|
34
|
+
"@progressive-development/pd-contact": "1.0.0",
|
|
35
|
+
"@progressive-development/pd-content": "1.0.0",
|
|
36
|
+
"@progressive-development/pd-forms": "1.0.0",
|
|
37
|
+
"@progressive-development/pd-dialog": "1.0.0",
|
|
38
|
+
"@progressive-development/pd-price": "1.0.0"
|
|
36
39
|
},
|
|
37
40
|
"customElements": "custom-elements.json",
|
|
38
41
|
"keywords": [
|