@progressive-development/pd-order 0.7.11 → 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.
Files changed (41) hide show
  1. package/LICENSE +21 -2
  2. package/README.md +31 -57
  3. package/dist/generated/locales/be.d.ts +2 -1
  4. package/dist/generated/locales/be.d.ts.map +1 -1
  5. package/dist/generated/locales/de.d.ts +2 -1
  6. package/dist/generated/locales/de.d.ts.map +1 -1
  7. package/dist/generated/locales/en.d.ts +2 -1
  8. package/dist/generated/locales/en.d.ts.map +1 -1
  9. package/dist/index.d.ts +2 -2
  10. package/dist/index.d.ts.map +1 -1
  11. package/dist/index.js +7 -12
  12. package/dist/locales/be.js +4 -6
  13. package/dist/locales/de.js +4 -7
  14. package/dist/locales/en.js +4 -6
  15. package/dist/pd-order-contacts/PdOrderContacts.d.ts +50 -0
  16. package/dist/pd-order-contacts/PdOrderContacts.d.ts.map +1 -0
  17. package/dist/pd-order-contacts/PdOrderContacts.js +383 -0
  18. package/dist/pd-order-contacts/pd-order-contacts.d.ts +3 -0
  19. package/dist/pd-order-contacts/pd-order-contacts.d.ts.map +1 -0
  20. package/dist/pd-order-contacts/pd-order-contacts.stories.d.ts +65 -0
  21. package/dist/pd-order-contacts/pd-order-contacts.stories.d.ts.map +1 -0
  22. package/dist/pd-order-contacts.d.ts +2 -45
  23. package/dist/pd-order-contacts.js +6 -387
  24. package/dist/pd-order-summary/PdOrderSummary.d.ts +39 -0
  25. package/dist/pd-order-summary/PdOrderSummary.d.ts.map +1 -0
  26. package/dist/pd-order-summary/PdOrderSummary.js +241 -0
  27. package/dist/pd-order-summary/pd-order-summary.d.ts +3 -0
  28. package/dist/pd-order-summary/pd-order-summary.d.ts.map +1 -0
  29. package/dist/pd-order-summary/pd-order-summary.stories.d.ts +59 -0
  30. package/dist/pd-order-summary/pd-order-summary.stories.d.ts.map +1 -0
  31. package/dist/pd-order-summary.d.ts +2 -38
  32. package/dist/pd-order-summary.js +6 -248
  33. package/dist/stories/test-impl/test-summary.d.ts +1 -1
  34. package/dist/stories/test-impl/test-summary.d.ts.map +1 -1
  35. package/package.json +34 -52
  36. package/dist/pd-order-contacts.d.ts.map +0 -1
  37. package/dist/pd-order-summary.d.ts.map +0 -1
  38. package/dist/stories/pd-order-contacts.stories.d.ts +0 -17
  39. package/dist/stories/pd-order-contacts.stories.d.ts.map +0 -1
  40. package/dist/stories/pd-order-summary.stories.d.ts +0 -13
  41. package/dist/stories/pd-order-summary.stories.d.ts.map +0 -1
package/LICENSE CHANGED
@@ -1,2 +1,21 @@
1
- No License, all rights reserved
2
- @2021 - PD Progressive Development UG
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
- # \<pd-order>
1
+ # @progressive-development/pd-order
2
2
 
3
- This webcomponent follows the [open-wc](https://github.com/open-wc/open-wc) recommendation.
3
+ [![npm version](https://img.shields.io/npm/v/@progressive-development/pd-order.svg)](https://www.npmjs.com/package/@progressive-development/pd-order)
4
+ [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](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 i pd-order
24
+ npm install @progressive-development/pd-order
9
25
  ```
10
26
 
11
- ## Usage
27
+ ## Quick Start
12
28
 
13
29
  ```html
14
30
  <script type="module">
15
- import 'pd-order/pd-order.js';
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
- ## Linting and formatting
37
+ ## Components
22
38
 
23
- To scan the project for linting and formatting errors, run
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
- ```bash
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
- ## Testing with Web Test Runner
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
- ## Demoing with Storybook
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
- To run a local development server that serves the basic demo located in `demo/index.html`
50
+ MIT © [PD Progressive Development UG](https://progressive-development.com)
@@ -2,7 +2,8 @@ export declare const templates: {
2
2
  "pd.order.contacts.billingContact.inputHeader": string;
3
3
  "pd.order.contacts.orderContact.inputHeader": string;
4
4
  "pd.order.contacts.propertyContact.checkBox": string;
5
- "pd.order.summary.agree.link": import('lit-html').TemplateResult<1>;
5
+ "pd.order.summary.agree.link1": string;
6
+ "pd.order.summary.agree.link2": string;
6
7
  "pd.order.summary.agree.required": string;
7
8
  "pd.order.summary.billing": string;
8
9
  "pd.order.summary.title": string;
@@ -1 +1 @@
1
- {"version":3,"file":"be.d.ts","sourceRoot":"","sources":["../../../src/generated/locales/be.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;CAqBrB,CAAC"}
1
+ {"version":3,"file":"be.d.ts","sourceRoot":"","sources":["../../../src/generated/locales/be.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;CAqBrB,CAAC"}
@@ -17,6 +17,7 @@ export declare const templates: {
17
17
  "pd.order.summary.title": string;
18
18
  "pd.order.summary.billing": string;
19
19
  "pd.order.summary.agree.required": string;
20
- "pd.order.summary.agree.link": import('lit-html').TemplateResult<1>;
20
+ "pd.order.summary.agree.link1": string;
21
+ "pd.order.summary.agree.link2": string;
21
22
  };
22
23
  //# sourceMappingURL=de.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"de.d.ts","sourceRoot":"","sources":["../../../src/generated/locales/de.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;CAsBrB,CAAC"}
1
+ {"version":3,"file":"de.d.ts","sourceRoot":"","sources":["../../../src/generated/locales/de.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;CAqBrB,CAAC"}
@@ -2,7 +2,8 @@ export declare const templates: {
2
2
  "pd.order.contacts.billingContact.inputHeader": string;
3
3
  "pd.order.contacts.orderContact.inputHeader": string;
4
4
  "pd.order.contacts.propertyContact.checkBox": string;
5
- "pd.order.summary.agree.link": import('lit-html').TemplateResult<1>;
5
+ "pd.order.summary.agree.link1": string;
6
+ "pd.order.summary.agree.link2": string;
6
7
  "pd.order.summary.agree.required": string;
7
8
  "pd.order.summary.billing": string;
8
9
  "pd.order.summary.title": string;
@@ -1 +1 @@
1
- {"version":3,"file":"en.d.ts","sourceRoot":"","sources":["../../../src/generated/locales/en.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;CAqBrB,CAAC"}
1
+ {"version":3,"file":"en.d.ts","sourceRoot":"","sources":["../../../src/generated/locales/en.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;CAqBrB,CAAC"}
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- export { PdOrderContacts } from './pd-order-contacts.js';
2
- export { PdOrderSummary } from './pd-order-summary.js';
1
+ export { PdOrderContacts } from './pd-order-contacts/pd-order-contacts.js';
2
+ export { PdOrderSummary } from './pd-order-summary/pd-order-summary.js';
3
3
  export type { PdOrderContactData, PdOrderStep } from './types.js';
4
4
  export { templates as beTemplates } from './generated/locales/be.js';
5
5
  export { templates as deTemplates } from './generated/locales/de.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAEvD,YAAY,EAAE,kBAAkB,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAElE,OAAO,EAAE,SAAS,IAAI,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACrE,OAAO,EAAE,SAAS,IAAI,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACrE,OAAO,EAAE,SAAS,IAAI,WAAW,EAAE,MAAM,2BAA2B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,0CAA0C,CAAC;AAC3E,OAAO,EAAE,cAAc,EAAE,MAAM,wCAAwC,CAAC;AAExE,YAAY,EAAE,kBAAkB,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAElE,OAAO,EAAE,SAAS,IAAI,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACrE,OAAO,EAAE,SAAS,IAAI,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACrE,OAAO,EAAE,SAAS,IAAI,WAAW,EAAE,MAAM,2BAA2B,CAAC"}
package/dist/index.js CHANGED
@@ -1,12 +1,7 @@
1
- import { PdOrderContacts } from "./pd-order-contacts.js";
2
- import { PdOrderSummary } from "./pd-order-summary.js";
3
- import { templates } from "./locales/be.js";
4
- import { templates as templates2 } from "./locales/de.js";
5
- import { templates as templates3 } from "./locales/en.js";
6
- export {
7
- PdOrderContacts,
8
- PdOrderSummary,
9
- templates as beTemplates,
10
- templates2 as deTemplates,
11
- templates3 as enTemplates
12
- };
1
+ import './pd-order-contacts.js';
2
+ import './pd-order-summary.js';
3
+ export { templates as beTemplates } from './locales/be.js';
4
+ export { templates as deTemplates } from './locales/de.js';
5
+ export { templates as enTemplates } from './locales/en.js';
6
+ export { PdOrderContacts } from './pd-order-contacts/PdOrderContacts.js';
7
+ export { PdOrderSummary } from './pd-order-summary/PdOrderSummary.js';
@@ -1,10 +1,9 @@
1
- import { html } from "lit";
2
1
  const templates = {
3
2
  "pd.order.contacts.billingContact.inputHeader": `Facturatieadres`,
4
3
  "pd.order.contacts.orderContact.inputHeader": `Adres`,
5
4
  "pd.order.contacts.propertyContact.checkBox": `Is de klant een verhuurder?`,
6
- "pd.order.summary.agree.link": html`Ga akkoord met onze
7
- <a @click="${0}" @keypress="${1}">algemene voorwaarden</a>.`,
5
+ "pd.order.summary.agree.link1": `Ik aanvaard de`,
6
+ "pd.order.summary.agree.link2": `Algemene voorwaarden`,
8
7
  "pd.order.summary.agree.required": `Ga akkoord met de algemene voorwaarden om verder te gaan.`,
9
8
  "pd.order.summary.billing": `Factuur`,
10
9
  "pd.order.summary.title": `Overzicht`,
@@ -21,6 +20,5 @@ const templates = {
21
20
  se1b4ea2cbb1f9bb4: `Immobilie`,
22
21
  s3be4da85df39b1c2: `Verwaltung`
23
22
  };
24
- export {
25
- templates
26
- };
23
+
24
+ export { templates };
@@ -1,4 +1,3 @@
1
- import { html } from "lit";
2
1
  const templates = {
3
2
  "pd.order.contacts.orderContact.inputHeader": `Adresse`,
4
3
  "pd.order.contacts.billingContact.inputHeader": `Rechnungsadresse (optional)`,
@@ -18,10 +17,8 @@ const templates = {
18
17
  "pd.order.summary.title": `Übersicht`,
19
18
  "pd.order.summary.billing": `Rechnung`,
20
19
  "pd.order.summary.agree.required": `Bitte stimmen Sie den Allgemeinen Geschäftsbedingungen zu, um fortzufahren.`,
21
- "pd.order.summary.agree.link": html`Stimmen Sie unseren
22
- <a @click="${0}" @keypress="${1}">Allgemeinen Geschäftsbedingungen</a>
23
- zu`
24
- };
25
- export {
26
- templates
20
+ "pd.order.summary.agree.link1": `Ich akzeptiere die`,
21
+ "pd.order.summary.agree.link2": `Allgemeinen Geschäftsbedingungen`
27
22
  };
23
+
24
+ export { templates };
@@ -1,10 +1,9 @@
1
- import { html } from "lit";
2
1
  const templates = {
3
2
  "pd.order.contacts.billingContact.inputHeader": `Billing Address`,
4
3
  "pd.order.contacts.orderContact.inputHeader": `Address`,
5
4
  "pd.order.contacts.propertyContact.checkBox": `Is the customer a landlord?`,
6
- "pd.order.summary.agree.link": html`Agree to our
7
- <a @click="${0}" @keypress="${1}">terms and conditions</a>.`,
5
+ "pd.order.summary.agree.link1": `I accept the`,
6
+ "pd.order.summary.agree.link2": `Terms and Conditions`,
8
7
  "pd.order.summary.agree.required": `Please agree to the terms and conditions to proceed.`,
9
8
  "pd.order.summary.billing": `Invoice`,
10
9
  "pd.order.summary.title": `Overview`,
@@ -21,6 +20,5 @@ const templates = {
21
20
  se1b4ea2cbb1f9bb4: `Immobilie`,
22
21
  s3be4da85df39b1c2: `Verwaltung`
23
22
  };
24
- export {
25
- templates
26
- };
23
+
24
+ export { templates };
@@ -0,0 +1,50 @@
1
+ import { LitElement, CSSResultGroup, PropertyValues } from 'lit';
2
+ import { PdContactData, PdContactMatch } from '@progressive-development/pd-contact';
3
+ /**
4
+ * Order contact management with multiple address sections.
5
+ *
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
+ */
11
+ export declare class PdOrderContacts extends LitElement {
12
+ /** Show read-only summary mode */
13
+ summary: boolean;
14
+ /** Section title overrides for contact headers */
15
+ contactTitle: Record<string, string>;
16
+ /** Required field names per contact (e.g., ['street', 'zip']) */
17
+ requiredFields: string[];
18
+ /** Primary order contact data */
19
+ orderContact?: PdContactData;
20
+ /** Optional separate billing address */
21
+ billingContact?: PdContactData;
22
+ /** Optional admin/management contact */
23
+ adminContact?: PdContactData;
24
+ /** Property address if different from order address */
25
+ propertyContact?: PdContactData;
26
+ /** Enable billing address option */
27
+ withPayment: boolean;
28
+ /** Enable property owner/landlord options */
29
+ withPropertyOwner: boolean;
30
+ /** Enable property date field */
31
+ withPropertyDate: boolean;
32
+ /** Optional field validation/mapping configuration */
33
+ match?: PdContactMatch;
34
+ /** @ignore */
35
+ private _ownBillingContact;
36
+ /** @ignore */
37
+ private _ownAdminContact;
38
+ /** @ignore */
39
+ private _isPropertyOwner;
40
+ static styles: CSSResultGroup;
41
+ update(changedProps: PropertyValues<this>): void;
42
+ protected render(): import('lit').TemplateResult<1>;
43
+ private _renderEditContacts;
44
+ private _renderSummary;
45
+ get valid(): boolean;
46
+ triggerValidate(): Promise<boolean>;
47
+ getValues(): any;
48
+ private _getCollapseMap;
49
+ }
50
+ //# sourceMappingURL=PdOrderContacts.d.ts.map
@@ -0,0 +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,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"}