@progressive-development/pd-wizard 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 +33 -57
- package/dist/default-step-address/DefaultStepAddress.d.ts +26 -0
- package/dist/default-step-address/DefaultStepAddress.d.ts.map +1 -0
- package/dist/default-step-address/DefaultStepAddress.js +66 -0
- package/dist/default-step-address/default-step-address.d.ts +2 -0
- package/dist/default-step-address/default-step-address.d.ts.map +1 -0
- package/dist/default-step-address.d.ts +2 -0
- package/dist/default-step-address.js +1 -0
- package/dist/default-step-summary/DefaultStepSummary.d.ts +58 -0
- package/dist/default-step-summary/DefaultStepSummary.d.ts.map +1 -0
- package/dist/default-step-summary/DefaultStepSummary.js +77 -0
- package/dist/default-step-summary/default-step-summary.d.ts +3 -0
- package/dist/default-step-summary/default-step-summary.d.ts.map +1 -0
- package/dist/default-step-summary.d.ts +2 -0
- package/dist/default-step-summary.js +1 -0
- package/dist/default-wizard/DefaultWizard.d.ts +57 -0
- package/dist/default-wizard/DefaultWizard.d.ts.map +1 -0
- package/dist/default-wizard/DefaultWizard.js +270 -0
- package/dist/default-wizard/default-wizard.d.ts +3 -0
- package/dist/default-wizard/default-wizard.d.ts.map +1 -0
- package/dist/default-wizard.d.ts +2 -0
- package/dist/default-wizard.js +1 -0
- package/dist/generated/locales/be.d.ts +17 -0
- package/dist/generated/locales/be.d.ts.map +1 -1
- package/dist/generated/locales/de.d.ts +17 -0
- package/dist/generated/locales/de.d.ts.map +1 -1
- package/dist/generated/locales/en.d.ts +17 -0
- package/dist/generated/locales/en.d.ts.map +1 -1
- package/dist/index.d.ts +10 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +8 -0
- package/dist/locales/be.js +20 -1
- package/dist/locales/de.js +20 -1
- package/dist/locales/en.js +20 -1
- package/dist/pd-components/pd-content/dist/pd-notice-box/PdNoticeBox.js +224 -0
- package/dist/pd-components/pd-content/dist/pd-notice-box/pd-notice-box.js +8 -0
- package/dist/pd-default-wizard-step/PdDefaultWizardStep.d.ts +85 -0
- package/dist/pd-default-wizard-step/PdDefaultWizardStep.d.ts.map +1 -0
- package/dist/pd-default-wizard-step/PdDefaultWizardStep.js +167 -0
- package/dist/pd-default-wizard-step/pd-default-wizard-step.d.ts +2 -0
- package/dist/pd-default-wizard-step/pd-default-wizard-step.d.ts.map +1 -0
- package/dist/pd-default-wizard-step.d.ts +2 -0
- package/dist/pd-default-wizard-step.js +1 -0
- package/dist/pd-utils/dist/date-helper.js +35 -0
- package/dist/pd-utils/dist/locale-format.js +6 -0
- package/dist/pd-wizard/PdWizard.d.ts +36 -23
- package/dist/pd-wizard/PdWizard.d.ts.map +1 -1
- package/dist/pd-wizard/PdWizard.js +91 -142
- package/dist/pd-wizard/pd-steps/PdSteps.d.ts +26 -10
- package/dist/pd-wizard/pd-steps/PdSteps.d.ts.map +1 -1
- package/dist/pd-wizard/pd-steps/PdSteps.js +126 -59
- package/dist/pd-wizard/pd-steps/pd-steps.stories.d.ts +45 -37
- package/dist/pd-wizard/pd-steps/pd-steps.stories.d.ts.map +1 -1
- package/dist/pd-wizard/pd-wizard.stories.d.ts +46 -7
- package/dist/pd-wizard/pd-wizard.stories.d.ts.map +1 -1
- package/dist/wizard-close-popup/WizardClosePopup.d.ts +12 -0
- package/dist/wizard-close-popup/WizardClosePopup.d.ts.map +1 -0
- package/dist/wizard-close-popup/WizardClosePopup.js +56 -0
- package/dist/wizard-close-popup/wizard-close-popup.d.ts +2 -0
- package/dist/wizard-close-popup/wizard-close-popup.d.ts.map +1 -0
- package/dist/wizard-close-popup/wizard-close-popup.stories.d.ts +39 -0
- package/dist/wizard-close-popup/wizard-close-popup.stories.d.ts.map +1 -0
- package/dist/wizard-close-popup.d.ts +2 -0
- package/dist/wizard-close-popup.js +1 -0
- package/dist/wizard-reload-popup/WizardReloadPopup.d.ts +19 -0
- package/dist/wizard-reload-popup/WizardReloadPopup.d.ts.map +1 -0
- package/dist/wizard-reload-popup/WizardReloadPopup.js +88 -0
- package/dist/wizard-reload-popup/wizard-reload-popup.d.ts +3 -0
- package/dist/wizard-reload-popup/wizard-reload-popup.d.ts.map +1 -0
- package/dist/wizard-reload-popup/wizard-reload-popup.stories.d.ts +42 -0
- package/dist/wizard-reload-popup/wizard-reload-popup.stories.d.ts.map +1 -0
- package/dist/wizard-reload-popup.d.ts +2 -0
- package/dist/wizard-reload-popup.js +1 -0
- package/package.json +18 -5
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,52 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @progressive-development/pd-wizard
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
[](https://www.npmjs.com/package/@progressive-development/pd-wizard)
|
|
4
|
+
[](LICENSE)
|
|
5
|
+
|
|
6
|
+
Multi-step wizard component for guided workflows and forms.
|
|
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
|
+
- **Event-Driven Navigation** – Back/Next/Submit events for external validation between steps
|
|
17
|
+
- **Clickable Progress Indicator** – Visual step tracker with navigation to completed steps only
|
|
18
|
+
- **Flexible Styling** – CSS Custom Properties and CSS Parts for full control
|
|
19
|
+
- **Flexible Step Configuration** – Up to 6 steps with dynamic titles and optional next-button control
|
|
4
20
|
|
|
5
21
|
## Installation
|
|
6
22
|
|
|
7
23
|
```bash
|
|
8
|
-
npm
|
|
24
|
+
npm install @progressive-development/pd-wizard
|
|
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-wizard';
|
|
16
32
|
</script>
|
|
17
33
|
|
|
18
|
-
<pd-wizard
|
|
34
|
+
<pd-wizard .wizardSteps=${steps}>
|
|
35
|
+
<div slot="step-1">Step 1 content</div>
|
|
36
|
+
<div slot="step-2">Step 2 content</div>
|
|
37
|
+
</pd-wizard>
|
|
19
38
|
```
|
|
20
39
|
|
|
21
|
-
##
|
|
40
|
+
## Components
|
|
22
41
|
|
|
23
|
-
|
|
42
|
+
| Component | Description |
|
|
43
|
+
|-----------|-------------|
|
|
44
|
+
| `<pd-wizard>` | Multi-step wizard container |
|
|
24
45
|
|
|
25
|
-
|
|
26
|
-
npm run lint
|
|
27
|
-
```
|
|
28
|
-
|
|
29
|
-
To automatically fix linting and formatting errors, run
|
|
30
|
-
|
|
31
|
-
```bash
|
|
32
|
-
npm run format
|
|
33
|
-
```
|
|
46
|
+
## Documentation
|
|
34
47
|
|
|
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
|
-
```
|
|
48
|
+
📖 **Full documentation:** [pd-components.web.app](https://pd-components.web.app/)
|
|
48
49
|
|
|
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
|
-
```
|
|
50
|
+
## License
|
|
75
51
|
|
|
76
|
-
|
|
52
|
+
MIT © [PD Progressive Development UG](https://progressive-development.com)
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { PdOrderContactData } from '@progressive-development/pd-order';
|
|
2
|
+
import { PdDefaultWizardStep } from '../pd-default-wizard-step/PdDefaultWizardStep.js';
|
|
3
|
+
/**
|
|
4
|
+
* Abstract base class for address wizard steps.
|
|
5
|
+
*
|
|
6
|
+
* @typeParam T - The complete order/wizard form data type
|
|
7
|
+
*/
|
|
8
|
+
export declare abstract class DefaultStepAddress<T> extends PdDefaultWizardStep<T, unknown> {
|
|
9
|
+
/** Match object for address auto-complete */
|
|
10
|
+
match?: unknown;
|
|
11
|
+
/** Contact data to display/edit */
|
|
12
|
+
contacts?: PdOrderContactData;
|
|
13
|
+
/** Show payment fields */
|
|
14
|
+
withPayment: boolean;
|
|
15
|
+
/** Show property owner fields */
|
|
16
|
+
withPropertyOwner: boolean;
|
|
17
|
+
/** Show property date field */
|
|
18
|
+
withPropertyDate: boolean;
|
|
19
|
+
/** List of required field names */
|
|
20
|
+
requiredFields: string[];
|
|
21
|
+
/** Optional info text displayed above the form */
|
|
22
|
+
abstract _addressInfo?: string;
|
|
23
|
+
render(): import('lit').TemplateResult<1>;
|
|
24
|
+
_renderFormContent(): import('lit').TemplateResult<1>;
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=DefaultStepAddress.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DefaultStepAddress.d.ts","sourceRoot":"","sources":["../../src/default-step-address/DefaultStepAddress.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAKH,OAAO,qDAAqD,CAAC;AAC7D,OAAO,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAC;AAEvE,OAAO,EAAE,mBAAmB,EAAE,MAAM,kDAAkD,CAAC;AAEvF;;;;GAIG;AACH,8BAAsB,kBAAkB,CAAC,CAAC,CAAE,SAAQ,mBAAmB,CACrE,CAAC,EACD,OAAO,CACR;IAKC,6CAA6C;IAE7C,KAAK,CAAC,EAAE,OAAO,CAAC;IAEhB,mCAAmC;IAEnC,QAAQ,CAAC,EAAE,kBAAkB,CAAC;IAE9B,0BAA0B;IAE1B,WAAW,EAAE,OAAO,CAAS;IAE7B,iCAAiC;IAEjC,iBAAiB,EAAE,OAAO,CAAS;IAEnC,+BAA+B;IAE/B,gBAAgB,EAAE,OAAO,CAAS;IAElC,mCAAmC;IAEnC,cAAc,EAAE,MAAM,EAAE,CAAM;IAM9B,kDAAkD;IAClD,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC;IAMtB,MAAM;IAIf,kBAAkB;CAiBnB"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { html } from 'lit';
|
|
2
|
+
import { property } from 'lit/decorators.js';
|
|
3
|
+
import '@progressive-development/pd-order/pd-order-contacts';
|
|
4
|
+
import { PdDefaultWizardStep } from '../pd-default-wizard-step/PdDefaultWizardStep.js';
|
|
5
|
+
|
|
6
|
+
var __defProp = Object.defineProperty;
|
|
7
|
+
var __decorateClass = (decorators, target, key, kind) => {
|
|
8
|
+
var result = void 0 ;
|
|
9
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
10
|
+
if (decorator = decorators[i])
|
|
11
|
+
result = (decorator(target, key, result) ) || result;
|
|
12
|
+
if (result) __defProp(target, key, result);
|
|
13
|
+
return result;
|
|
14
|
+
};
|
|
15
|
+
class DefaultStepAddress extends PdDefaultWizardStep {
|
|
16
|
+
constructor() {
|
|
17
|
+
super(...arguments);
|
|
18
|
+
this.withPayment = false;
|
|
19
|
+
this.withPropertyOwner = false;
|
|
20
|
+
this.withPropertyDate = false;
|
|
21
|
+
this.requiredFields = [];
|
|
22
|
+
}
|
|
23
|
+
// ---------------------------------------------------------------------------
|
|
24
|
+
// Render
|
|
25
|
+
// ---------------------------------------------------------------------------
|
|
26
|
+
render() {
|
|
27
|
+
return this._renderFormContent();
|
|
28
|
+
}
|
|
29
|
+
_renderFormContent() {
|
|
30
|
+
return html`
|
|
31
|
+
${this._addressInfo ? html`<p>${this._addressInfo}</p>` : ""}
|
|
32
|
+
<pd-order-contacts
|
|
33
|
+
id="stepFormContainerId"
|
|
34
|
+
?withPayment="${this.withPayment}"
|
|
35
|
+
?withPropertyOwner="${this.withPropertyOwner}"
|
|
36
|
+
?withPropertyDate="${this.withPropertyDate}"
|
|
37
|
+
.match="${this.match}"
|
|
38
|
+
.orderContact="${this.contacts?.orderContact}"
|
|
39
|
+
.billingContact="${this.contacts?.billingContact}"
|
|
40
|
+
.adminContact="${this.contacts?.adminContact}"
|
|
41
|
+
.propertyContact="${this.contacts?.propertyContact}"
|
|
42
|
+
.requiredFields="${this.requiredFields}"
|
|
43
|
+
></pd-order-contacts>
|
|
44
|
+
`;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
__decorateClass([
|
|
48
|
+
property({ type: Object })
|
|
49
|
+
], DefaultStepAddress.prototype, "match");
|
|
50
|
+
__decorateClass([
|
|
51
|
+
property({ type: Object })
|
|
52
|
+
], DefaultStepAddress.prototype, "contacts");
|
|
53
|
+
__decorateClass([
|
|
54
|
+
property({ type: Boolean })
|
|
55
|
+
], DefaultStepAddress.prototype, "withPayment");
|
|
56
|
+
__decorateClass([
|
|
57
|
+
property({ type: Boolean })
|
|
58
|
+
], DefaultStepAddress.prototype, "withPropertyOwner");
|
|
59
|
+
__decorateClass([
|
|
60
|
+
property({ type: Boolean })
|
|
61
|
+
], DefaultStepAddress.prototype, "withPropertyDate");
|
|
62
|
+
__decorateClass([
|
|
63
|
+
property({ type: Array })
|
|
64
|
+
], DefaultStepAddress.prototype, "requiredFields");
|
|
65
|
+
|
|
66
|
+
export { DefaultStepAddress };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"default-step-address.d.ts","sourceRoot":"","sources":["../../src/default-step-address/default-step-address.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { DefaultStepAddress } from './default-step-address/DefaultStepAddress.js';
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { HTMLTemplateResult, CSSResultGroup, PropertyValues } from 'lit';
|
|
2
|
+
import { PdDefaultWizardStep } from '../pd-default-wizard-step/PdDefaultWizardStep.js';
|
|
3
|
+
/** Step data for the order summary */
|
|
4
|
+
export interface OrderStep {
|
|
5
|
+
/** Unique step key */
|
|
6
|
+
key: string;
|
|
7
|
+
/** Display name for the step */
|
|
8
|
+
name: string;
|
|
9
|
+
/** Step data entries */
|
|
10
|
+
data?: Array<{
|
|
11
|
+
/** Entry label */
|
|
12
|
+
name: string;
|
|
13
|
+
/** Entry value */
|
|
14
|
+
val?: string;
|
|
15
|
+
}>;
|
|
16
|
+
}
|
|
17
|
+
/** Wizard step configuration (re-exported from DefaultWizard) */
|
|
18
|
+
export interface WizardStepConfig {
|
|
19
|
+
/** Step title */
|
|
20
|
+
title: string;
|
|
21
|
+
/** Step name */
|
|
22
|
+
name: string;
|
|
23
|
+
/** Unique step key */
|
|
24
|
+
key: string;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Abstract base class for wizard summary steps.
|
|
28
|
+
*
|
|
29
|
+
* @typeParam T - The complete order/wizard form data type
|
|
30
|
+
*/
|
|
31
|
+
export declare abstract class DefaultStepSummary<T> extends PdDefaultWizardStep<T, unknown> {
|
|
32
|
+
/** Show payment summary */
|
|
33
|
+
withPayment: boolean;
|
|
34
|
+
/** Order data to display in summary */
|
|
35
|
+
orderForSummary?: T;
|
|
36
|
+
/** Wizard step configurations */
|
|
37
|
+
wizardSteps: Array<WizardStepConfig>;
|
|
38
|
+
/** Prepared order steps for display */
|
|
39
|
+
_orderSteps: OrderStep[];
|
|
40
|
+
/** Whether to show agreement checkbox */
|
|
41
|
+
abstract _withAgreement: boolean;
|
|
42
|
+
static styles: CSSResultGroup;
|
|
43
|
+
update(changedProps: PropertyValues): void;
|
|
44
|
+
render(): import('lit').TemplateResult<1>;
|
|
45
|
+
/** Render the summary component */
|
|
46
|
+
renderSummary(): import('lit').TemplateResult<1>;
|
|
47
|
+
/**
|
|
48
|
+
* Prepare order steps for display.
|
|
49
|
+
* Must be implemented by subclass.
|
|
50
|
+
*/
|
|
51
|
+
abstract _prepareOrderSteps(): OrderStep[];
|
|
52
|
+
/**
|
|
53
|
+
* Get the terms and conditions content.
|
|
54
|
+
* Must be implemented if _withAgreement is true.
|
|
55
|
+
*/
|
|
56
|
+
abstract _getConditions(): HTMLTemplateResult;
|
|
57
|
+
}
|
|
58
|
+
//# sourceMappingURL=DefaultStepSummary.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DefaultStepSummary.d.ts","sourceRoot":"","sources":["../../src/default-step-summary/DefaultStepSummary.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AAEH,OAAO,EACL,kBAAkB,EAGlB,cAAc,EACd,cAAc,EACf,MAAM,KAAK,CAAC;AAGb,OAAO,oDAAoD,CAAC;AAE5D,OAAO,EAAE,mBAAmB,EAAE,MAAM,kDAAkD,CAAC;AAMvF,sCAAsC;AACtC,MAAM,WAAW,SAAS;IACxB,sBAAsB;IACtB,GAAG,EAAE,MAAM,CAAC;IACZ,gCAAgC;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,wBAAwB;IACxB,IAAI,CAAC,EAAE,KAAK,CAAC;QACX,kBAAkB;QAClB,IAAI,EAAE,MAAM,CAAC;QACb,kBAAkB;QAClB,GAAG,CAAC,EAAE,MAAM,CAAC;KACd,CAAC,CAAC;CACJ;AAED,iEAAiE;AACjE,MAAM,WAAW,gBAAgB;IAC/B,iBAAiB;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,gBAAgB;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,sBAAsB;IACtB,GAAG,EAAE,MAAM,CAAC;CACb;AAMD;;;;GAIG;AACH,8BAAsB,kBAAkB,CAAC,CAAC,CAAE,SAAQ,mBAAmB,CACrE,CAAC,EACD,OAAO,CACR;IAKC,2BAA2B;IAE3B,WAAW,EAAE,OAAO,CAAS;IAE7B,uCAAuC;IAEvC,eAAe,CAAC,EAAE,CAAC,CAAC;IAEpB,iCAAiC;IAEjC,WAAW,EAAE,KAAK,CAAC,gBAAgB,CAAC,CAAM;IAM1C,uCAAuC;IAEvC,WAAW,EAAE,SAAS,EAAE,CAAM;IAM9B,yCAAyC;IACzC,QAAQ,CAAC,cAAc,EAAE,OAAO,CAAC;IAMjC,MAAM,CAAC,MAAM,EAMR,cAAc,CAAC;IAMpB,MAAM,CAAC,YAAY,EAAE,cAAc;IAW1B,MAAM;IAIf,mCAAmC;IACnC,aAAa;IAoBb;;;OAGG;IACH,QAAQ,CAAC,kBAAkB,IAAI,SAAS,EAAE;IAE1C;;;OAGG;IACH,QAAQ,CAAC,cAAc,IAAI,kBAAkB;CAC9C"}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { css, html } from 'lit';
|
|
2
|
+
import { property, state } from 'lit/decorators.js';
|
|
3
|
+
import '@progressive-development/pd-order/pd-order-summary';
|
|
4
|
+
import { PdDefaultWizardStep } from '../pd-default-wizard-step/PdDefaultWizardStep.js';
|
|
5
|
+
|
|
6
|
+
var __defProp = Object.defineProperty;
|
|
7
|
+
var __decorateClass = (decorators, target, key, kind) => {
|
|
8
|
+
var result = void 0 ;
|
|
9
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
10
|
+
if (decorator = decorators[i])
|
|
11
|
+
result = (decorator(target, key, result) ) || result;
|
|
12
|
+
if (result) __defProp(target, key, result);
|
|
13
|
+
return result;
|
|
14
|
+
};
|
|
15
|
+
class DefaultStepSummary extends PdDefaultWizardStep {
|
|
16
|
+
constructor() {
|
|
17
|
+
super(...arguments);
|
|
18
|
+
this.withPayment = false;
|
|
19
|
+
this.wizardSteps = [];
|
|
20
|
+
this._orderSteps = [];
|
|
21
|
+
}
|
|
22
|
+
static {
|
|
23
|
+
// ---------------------------------------------------------------------------
|
|
24
|
+
// Styles
|
|
25
|
+
// ---------------------------------------------------------------------------
|
|
26
|
+
this.styles = [
|
|
27
|
+
css`
|
|
28
|
+
pd-order-summary {
|
|
29
|
+
padding-bottom: 1.3em;
|
|
30
|
+
}
|
|
31
|
+
`
|
|
32
|
+
];
|
|
33
|
+
}
|
|
34
|
+
// ---------------------------------------------------------------------------
|
|
35
|
+
// Lifecycle
|
|
36
|
+
// ---------------------------------------------------------------------------
|
|
37
|
+
update(changedProps) {
|
|
38
|
+
if (changedProps.has("orderForSummary") && this.orderForSummary) {
|
|
39
|
+
this._orderSteps = this._prepareOrderSteps();
|
|
40
|
+
}
|
|
41
|
+
super.update(changedProps);
|
|
42
|
+
}
|
|
43
|
+
// ---------------------------------------------------------------------------
|
|
44
|
+
// Render
|
|
45
|
+
// ---------------------------------------------------------------------------
|
|
46
|
+
render() {
|
|
47
|
+
return this.renderSummary();
|
|
48
|
+
}
|
|
49
|
+
/** Render the summary component */
|
|
50
|
+
renderSummary() {
|
|
51
|
+
return html`
|
|
52
|
+
<pd-order-summary
|
|
53
|
+
id="stepFormContainerId"
|
|
54
|
+
?withPayment="${this.withPayment}"
|
|
55
|
+
.order="${this.orderForSummary}"
|
|
56
|
+
?withAgreement="${this._withAgreement}"
|
|
57
|
+
.orderSteps="${this._orderSteps}"
|
|
58
|
+
>
|
|
59
|
+
${this._withAgreement ? html`<span slot="legal">${this._getConditions()}</span>` : ""}
|
|
60
|
+
</pd-order-summary>
|
|
61
|
+
`;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
__decorateClass([
|
|
65
|
+
property({ type: Boolean })
|
|
66
|
+
], DefaultStepSummary.prototype, "withPayment");
|
|
67
|
+
__decorateClass([
|
|
68
|
+
property({ type: Object })
|
|
69
|
+
], DefaultStepSummary.prototype, "orderForSummary");
|
|
70
|
+
__decorateClass([
|
|
71
|
+
property({ type: Array })
|
|
72
|
+
], DefaultStepSummary.prototype, "wizardSteps");
|
|
73
|
+
__decorateClass([
|
|
74
|
+
state()
|
|
75
|
+
], DefaultStepSummary.prototype, "_orderSteps");
|
|
76
|
+
|
|
77
|
+
export { DefaultStepSummary };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"default-step-summary.d.ts","sourceRoot":"","sources":["../../src/default-step-summary/default-step-summary.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,YAAY,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { DefaultStepSummary } from './default-step-summary/DefaultStepSummary.js';
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { LitElement, HTMLTemplateResult, PropertyValues, CSSResultGroup } from 'lit';
|
|
2
|
+
/** Wizard step definition */
|
|
3
|
+
export interface WizardStep {
|
|
4
|
+
/** Step title displayed in header */
|
|
5
|
+
title: string;
|
|
6
|
+
/** Step name for display */
|
|
7
|
+
name: string;
|
|
8
|
+
/** Unique step key */
|
|
9
|
+
key: string;
|
|
10
|
+
}
|
|
11
|
+
/** Optional logger interface for debugging */
|
|
12
|
+
export interface WizardLogger {
|
|
13
|
+
debug: (message: string, ...args: unknown[]) => void;
|
|
14
|
+
error: (message: string, ...args: unknown[]) => void;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Abstract base class for wizard implementations.
|
|
18
|
+
*
|
|
19
|
+
* @typeParam T - The form data type collected across all steps
|
|
20
|
+
*/
|
|
21
|
+
export declare abstract class DefaultWizard<T> extends LitElement {
|
|
22
|
+
/** Optional logger for debugging */
|
|
23
|
+
protected _logger?: WizardLogger;
|
|
24
|
+
/** Scroll to top of page after step change. Set to `false` when used inside a modal. */
|
|
25
|
+
protected _scrollToTopOnStepChange: boolean;
|
|
26
|
+
/** Wizard step definitions - must be set by subclass */
|
|
27
|
+
abstract _wizardSteps: Array<WizardStep>;
|
|
28
|
+
/** Current step number (1-based) */
|
|
29
|
+
_currentOrderStep: number;
|
|
30
|
+
/** Collected form data */
|
|
31
|
+
_orderFormData?: T;
|
|
32
|
+
/** LocalStorage key for persistence (undefined = no persistence) */
|
|
33
|
+
_withLocalStorageId?: string;
|
|
34
|
+
static styles: CSSResultGroup;
|
|
35
|
+
update(changedProps: PropertyValues<this>): void;
|
|
36
|
+
render(): import('lit').TemplateResult<1>;
|
|
37
|
+
/** Close the wizard (e.g., navigate back) */
|
|
38
|
+
protected abstract _closeWizard(): void;
|
|
39
|
+
/** Render the wizard steps */
|
|
40
|
+
protected abstract _renderSteps(): HTMLTemplateResult;
|
|
41
|
+
/** Submit the completed wizard */
|
|
42
|
+
protected abstract _submitWizard(): void;
|
|
43
|
+
protected _nextStep(e: CustomEvent): void;
|
|
44
|
+
protected _previousStep(e: CustomEvent): void;
|
|
45
|
+
protected _goToStep(e: CustomEvent<{
|
|
46
|
+
step: number;
|
|
47
|
+
}>): void;
|
|
48
|
+
/** Scroll to top of page after step change. Disabled when `_scrollToTopOnStepChange` is false. */
|
|
49
|
+
protected _scrollToTop(): void;
|
|
50
|
+
protected _closeWizardRequest(): void;
|
|
51
|
+
protected _reloadFromStorage(storageKey: string): void;
|
|
52
|
+
protected _doStorageUpdate(preparedOrderForm?: T): void;
|
|
53
|
+
protected _removeFromStorage(): void;
|
|
54
|
+
private getWizardStorage;
|
|
55
|
+
private _doStorageEventUpdate;
|
|
56
|
+
}
|
|
57
|
+
//# sourceMappingURL=DefaultWizard.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DefaultWizard.d.ts","sourceRoot":"","sources":["../../src/default-wizard/DefaultWizard.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4CG;AAEH,OAAO,EAEL,UAAU,EACV,kBAAkB,EAClB,cAAc,EAEd,cAAc,EACf,MAAM,KAAK,CAAC;AAIb,OAAO,oDAAoD,CAAC;AAM5D,OAAO,2BAA2B,CAAC;AAuBnC,6BAA6B;AAC7B,MAAM,WAAW,UAAU;IACzB,qCAAqC;IACrC,KAAK,EAAE,MAAM,CAAC;IACd,4BAA4B;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,sBAAsB;IACtB,GAAG,EAAE,MAAM,CAAC;CACb;AAED,8CAA8C;AAC9C,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,IAAI,CAAC;IACrD,KAAK,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,IAAI,CAAC;CACtD;AAMD;;;;GAIG;AACH,8BAAsB,aAAa,CAAC,CAAC,CAAE,SAAQ,UAAU;IAKvD,oCAAoC;IACpC,SAAS,CAAC,OAAO,CAAC,EAAE,YAAY,CAAC;IAEjC,wFAAwF;IACxF,SAAS,CAAC,wBAAwB,EAAE,OAAO,CAAQ;IAMnD,wDAAwD;IAExD,QAAQ,CAAC,YAAY,EAAE,KAAK,CAAC,UAAU,CAAC,CAAC;IAEzC,oCAAoC;IAEpC,iBAAiB,EAAE,MAAM,CAAK;IAE9B,0BAA0B;IAE1B,cAAc,CAAC,EAAE,CAAC,CAAC;IAEnB,oEAAoE;IAEpE,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAM7B,MAAM,CAAC,MAAM,EAIR,cAAc,CAAC;IAMX,MAAM,CAAC,YAAY,EAAE,cAAc,CAAC,IAAI,CAAC,GAAG,IAAI;IAWzD,MAAM;IAsBN,6CAA6C;IAC7C,SAAS,CAAC,QAAQ,CAAC,YAAY,IAAI,IAAI;IAEvC,8BAA8B;IAC9B,SAAS,CAAC,QAAQ,CAAC,YAAY,IAAI,kBAAkB;IAErD,kCAAkC;IAClC,SAAS,CAAC,QAAQ,CAAC,aAAa,IAAI,IAAI;IAMxC,SAAS,CAAC,SAAS,CAAC,CAAC,EAAE,WAAW;IAgClC,SAAS,CAAC,aAAa,CAAC,CAAC,EAAE,WAAW;IAQtC,SAAS,CAAC,SAAS,CAAC,CAAC,EAAE,WAAW,CAAC;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC;IAapD,kGAAkG;IAClG,SAAS,CAAC,YAAY;IAetB,SAAS,CAAC,mBAAmB,IAAI,IAAI;IAkDrC,SAAS,CAAC,kBAAkB,CAAC,UAAU,EAAE,MAAM;IAoD/C,SAAS,CAAC,gBAAgB,CAAC,iBAAiB,CAAC,EAAE,CAAC;IAkBhD,SAAS,CAAC,kBAAkB;IAc5B,OAAO,CAAC,gBAAgB;IAYxB,OAAO,CAAC,qBAAqB;CAmB9B"}
|