@progressive-development/pd-wizard 0.5.7 → 0.6.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.
@@ -0,0 +1,14 @@
1
+ /**
2
+ * The locale code that templates in this source code are written in.
3
+ */
4
+ export declare const sourceLocale = "dev";
5
+ /**
6
+ * The other locale codes that this application is localized into. Sorted
7
+ * lexicographically.
8
+ */
9
+ export declare const targetLocales: readonly ["be", "de", "en"];
10
+ /**
11
+ * All valid project locale codes. Sorted lexicographically.
12
+ */
13
+ export declare const allLocales: readonly ["be", "de", "dev", "en"];
14
+ //# sourceMappingURL=locale-codes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"locale-codes.d.ts","sourceRoot":"","sources":["../../src/generated/locale-codes.ts"],"names":[],"mappings":"AAGA;;GAEG;AACH,eAAO,MAAM,YAAY,QAAQ,CAAC;AAElC;;;GAGG;AACH,eAAO,MAAM,aAAa,6BAA8B,CAAC;AAEzD;;GAEG;AACH,eAAO,MAAM,UAAU,oCAAqC,CAAC"}
@@ -0,0 +1,6 @@
1
+ export declare const templates: {
2
+ "pd.wizard.button.back": string;
3
+ "pd.wizard.button.next": string;
4
+ "pd.wizard.button.send": string;
5
+ };
6
+ //# sourceMappingURL=be.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"be.d.ts","sourceRoot":"","sources":["../../../src/generated/locales/be.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,SAAS;;;;CAIrB,CAAC"}
@@ -0,0 +1,6 @@
1
+ export declare const templates: {
2
+ "pd.wizard.button.back": string;
3
+ "pd.wizard.button.next": string;
4
+ "pd.wizard.button.send": string;
5
+ };
6
+ //# sourceMappingURL=de.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"de.d.ts","sourceRoot":"","sources":["../../../src/generated/locales/de.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,SAAS;;;;CAIrB,CAAC"}
@@ -0,0 +1,6 @@
1
+ export declare const templates: {
2
+ "pd.wizard.button.back": string;
3
+ "pd.wizard.button.next": string;
4
+ "pd.wizard.button.send": string;
5
+ };
6
+ //# sourceMappingURL=en.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"en.d.ts","sourceRoot":"","sources":["../../../src/generated/locales/en.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,SAAS;;;;CAIrB,CAAC"}
@@ -0,0 +1,6 @@
1
+ export { PdWizard } from './pd-wizard.js';
2
+ export type { PdWizardStep } from './types.js';
3
+ export { templates as beTemplates } from './generated/locales/be.js';
4
+ export { templates as deTemplates } from './generated/locales/de.js';
5
+ export { templates as enTemplates } from './generated/locales/en.js';
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAE1C,YAAY,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAE/C,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,4 +1,4 @@
1
- import { PdWizard } from "./src/PdWizard.js";
1
+ import { PdWizard } from "./pd-wizard.js";
2
2
  import { templates } from "./locales/be.js";
3
3
  import { templates as templates2 } from "./locales/de.js";
4
4
  import { templates as templates3 } from "./locales/en.js";
@@ -0,0 +1,2 @@
1
+ export * from '../generated/locales/be'
2
+ export {}
@@ -0,0 +1,2 @@
1
+ export * from '../generated/locales/de'
2
+ export {}
@@ -0,0 +1,2 @@
1
+ export * from '../generated/locales/en'
2
+ export {}
@@ -0,0 +1,27 @@
1
+ import { LitElement, CSSResultGroup } from 'lit';
2
+ import { PdWizardStep } from './types';
3
+ /**
4
+ * @tag pd-steps
5
+ * @summary Fortschrittsanzeige in Kreis- oder Tab-Optik
6
+ *
7
+ * @fires go-to - wenn ein abgeschlossener Schritt erneut geklickt wird
8
+ */
9
+ export declare class PdSteps extends LitElement {
10
+ /**
11
+ * Schritte mit Namen
12
+ */
13
+ steps: PdWizardStep[];
14
+ /**
15
+ * Der aktuell sichtbare Schritt (1-basiert)
16
+ */
17
+ currentStepNr: number;
18
+ /**
19
+ * Darstellungsmodus: `circle` oder `tab` (aktuell beide gleich)
20
+ */
21
+ styleTyp: "circle" | "tab";
22
+ static styles: CSSResultGroup;
23
+ render(): import('lit-html').TemplateResult<1>;
24
+ private _renderCircle;
25
+ private _stepClicked;
26
+ }
27
+ //# sourceMappingURL=pd-steps.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pd-steps.d.ts","sourceRoot":"","sources":["../src/pd-steps.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAa,UAAU,EAAE,cAAc,EAAE,MAAM,KAAK,CAAC;AAO5D,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAEvC;;;;;GAKG;AACH,qBACa,OAAQ,SAAQ,UAAU;IACrC;;OAEG;IAEH,KAAK,EAAE,YAAY,EAAE,CAAM;IAE3B;;OAEG;IAEH,aAAa,SAAO;IAEpB;;OAEG;IAEH,QAAQ,EAAE,QAAQ,GAAG,KAAK,CAAY;IAEtC,OAAgB,MAAM,EAAE,cAAc,CA2GpC;IAEO,MAAM;IAIf,OAAO,CAAC,aAAa;IAyCrB,OAAO,CAAC,YAAY;CAcrB"}
@@ -0,0 +1,197 @@
1
+ import { css, LitElement, html } from "lit";
2
+ import { property, customElement } from "lit/decorators.js";
3
+ import { PdColorStyles, PdFontStyles } from "@progressive-development/pd-shared-styles";
4
+ var __defProp = Object.defineProperty;
5
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
6
+ var __decorateClass = (decorators, target, key, kind) => {
7
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
8
+ for (var i = decorators.length - 1, decorator; i >= 0; i--)
9
+ if (decorator = decorators[i])
10
+ result = (kind ? decorator(target, key, result) : decorator(result)) || result;
11
+ if (kind && result) __defProp(target, key, result);
12
+ return result;
13
+ };
14
+ let PdSteps = class extends LitElement {
15
+ constructor() {
16
+ super(...arguments);
17
+ this.steps = [];
18
+ this.currentStepNr = -99;
19
+ this.styleTyp = "circle";
20
+ }
21
+ render() {
22
+ return this._renderCircle();
23
+ }
24
+ _renderCircle() {
25
+ return html`
26
+ <div class="parent ${this.styleTyp}">
27
+ ${this.styleTyp === "circle" ? html`<hr />` : ""}
28
+ ${this.steps.map((st, index) => {
29
+ const stepNr = index + 1;
30
+ const isCurrent = this.currentStepNr === stepNr;
31
+ const isPassed = this.currentStepNr > stepNr;
32
+ const classNames = [
33
+ "step",
34
+ this.styleTyp,
35
+ isCurrent ? "current" : isPassed ? "passed" : ""
36
+ ].join(" ");
37
+ const nrClassNames = [
38
+ "step-nr",
39
+ isCurrent ? "current" : isPassed ? "passed" : ""
40
+ ].join(" ");
41
+ const nameClassNames = [
42
+ "step-name",
43
+ isCurrent ? "current" : isPassed ? "passed" : ""
44
+ ].join(" ");
45
+ return html`
46
+ <div class="step-container">
47
+ <div
48
+ class="${classNames}"
49
+ data-step="${stepNr}"
50
+ @click=${this._stepClicked}
51
+ >
52
+ <span class="${nrClassNames}">${stepNr}</span>
53
+ </div>
54
+ <span class="${nameClassNames}">${st.name}</span>
55
+ </div>
56
+ `;
57
+ })}
58
+ </div>
59
+ `;
60
+ }
61
+ _stepClicked(e) {
62
+ const stepStr = e.currentTarget.dataset.step;
63
+ const step = Number(stepStr);
64
+ if (!isNaN(step) && step < this.currentStepNr) {
65
+ this.dispatchEvent(
66
+ new CustomEvent("go-to", {
67
+ detail: { step },
68
+ bubbles: true,
69
+ composed: true
70
+ })
71
+ );
72
+ }
73
+ }
74
+ };
75
+ PdSteps.styles = [
76
+ PdColorStyles,
77
+ PdFontStyles,
78
+ css`
79
+ :host {
80
+ --circle-size: var(--pd-step-circle-size, 40px);
81
+ display: block;
82
+ background-color: var(--pd-steps-bg-color, var(--pd-default-col));
83
+ padding-top: var(--pd-step-padding-top, 0.5em);
84
+ padding-bottom: calc(var(--pd-step-name-font-size, 1em) * 2.5);
85
+ }
86
+
87
+ .parent {
88
+ display: flex;
89
+ flex-flow: row nowrap;
90
+ align-items: center;
91
+ position: relative;
92
+ }
93
+
94
+ .step-container {
95
+ display: flex;
96
+ flex-direction: column;
97
+ align-items: center;
98
+ text-align: center;
99
+ z-index: 51;
100
+ width: 100%;
101
+ position: relative;
102
+ }
103
+
104
+ .step.circle {
105
+ width: var(--circle-size);
106
+ height: var(--circle-size);
107
+ border-radius: 50%;
108
+ border: solid var(--pd-step-circle-border-size, 2px)
109
+ var(--pd-step-circle-border-color, white);
110
+ background-color: var(--pd-step-circle-bg-color, var(--pd-default-col));
111
+ display: flex;
112
+ justify-content: center;
113
+ align-items: center;
114
+ position: relative;
115
+ z-index: 51; /* Ensure the circle is above the hr line */
116
+ }
117
+
118
+ /* Dynamische Schriftgröße der Nummer */
119
+ .step-nr {
120
+ font-family: var(--pd-default-font-title-family);
121
+ font-weight: bold;
122
+ color: var(--pd-step-circle-nr-color, white);
123
+ font-size: calc(var(--circle-size) / 1.8);
124
+ position: absolute;
125
+ pointer-events: none;
126
+ }
127
+
128
+ hr {
129
+ background-color: var(--pd-step-hr-color, white);
130
+ height: 2px;
131
+ position: absolute;
132
+ top: 50%;
133
+ left: 0;
134
+ width: 100%;
135
+ z-index: 50;
136
+ border-style: none;
137
+ border-width: 0;
138
+ margin: 0;
139
+ }
140
+
141
+ .step-name {
142
+ font-family: var(--pd-default-font-title-family);
143
+ color: var(--pd-step-name-color, white);
144
+ font-size: var(--pd-step-name-font-size, 1em);
145
+ font-weight: bold;
146
+ position: absolute;
147
+ top: calc(
148
+ var(--circle-size) + (var(--pd-step-name-font-size, 1em) / 2)
149
+ );
150
+ }
151
+
152
+ .current {
153
+ color: var(--pd-step-color-current, var(--pd-default-hover-col));
154
+ }
155
+
156
+ .step.circle.current {
157
+ border-color: var(--pd-step-color-current, var(--pd-default-hover-col));
158
+ }
159
+
160
+ .passed {
161
+ color: var(--pd-step-color-passed, var(--pd-default-dark-col));
162
+ }
163
+
164
+ .step.circle.passed {
165
+ border-color: var(
166
+ --pd-step-color-passed,
167
+ var(--pd-default-success-col)
168
+ );
169
+ background-color: var(--pd-default-success-light-col);
170
+ cursor: pointer;
171
+ }
172
+
173
+ @media (max-width: 700px) {
174
+ :host {
175
+ --circle-size: 30px;
176
+ }
177
+ .step-name {
178
+ font-size: 0.9em;
179
+ }
180
+ }
181
+ `
182
+ ];
183
+ __decorateClass([
184
+ property({ type: Array })
185
+ ], PdSteps.prototype, "steps", 2);
186
+ __decorateClass([
187
+ property({ type: Number })
188
+ ], PdSteps.prototype, "currentStepNr", 2);
189
+ __decorateClass([
190
+ property({ type: String })
191
+ ], PdSteps.prototype, "styleTyp", 2);
192
+ PdSteps = __decorateClass([
193
+ customElement("pd-steps")
194
+ ], PdSteps);
195
+ export {
196
+ PdSteps
197
+ };
@@ -0,0 +1,42 @@
1
+ import { LitElement, CSSResultGroup } from 'lit';
2
+ import { PdWizardStep } from './types.js';
3
+ /**
4
+ * A multi-step wizard UI component.
5
+ *
6
+ * @fires next-step - Fired when the "Weiter" button is clicked
7
+ * @fires previous-step - Fired when the "Zurück" button is clicked
8
+ * @fires submit-wizard - Fired when the wizard is submitted; can modify the `submited` flag in the detail object
9
+ * @fires close-wizard - Fired when the wizard is closed
10
+ *
11
+ * @slot slotLogo - The slot for the logo in the title area
12
+ * @slot step-1 - Content for step 1
13
+ * @slot step-2 - Content for step 2
14
+ * @slot step-3 - Content for step 3
15
+ * @slot step-4 - Content for step 4
16
+ * @slot step-5 - Content for step 5
17
+ */
18
+ export declare class PdWizard extends LitElement {
19
+ /**
20
+ * Current step number (1-based index)
21
+ */
22
+ currentNumber: number;
23
+ /**
24
+ * List of wizard step definitions
25
+ */
26
+ wizardSteps: PdWizardStep[];
27
+ /**
28
+ * If true, renders the wizard in panel style (reduced header)
29
+ */
30
+ panelWizard: boolean;
31
+ /**
32
+ * Internal state to disable submit button after submission
33
+ */
34
+ private _submited;
35
+ static styles: CSSResultGroup;
36
+ protected render(): import('lit-html').TemplateResult<1>;
37
+ private _previousStep;
38
+ private _nextStep;
39
+ private _submit;
40
+ private _closeWizard;
41
+ }
42
+ //# sourceMappingURL=pd-wizard.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pd-wizard.d.ts","sourceRoot":"","sources":["../src/pd-wizard.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,UAAU,EAAa,cAAc,EAAE,MAAM,KAAK,CAAC;AAK5D,OAAO,0CAA0C,CAAC;AAClD,OAAO,6CAA6C,CAAC;AAOrD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAE/C,OAAO,eAAe,CAAC;AAEvB;;;;;;;;;;;;;;GAcG;AACH,qBAEa,QAAS,SAAQ,UAAU;IACtC;;OAEG;IAEH,aAAa,SAAO;IAEpB;;OAEG;IAEH,WAAW,EAAE,YAAY,EAAE,CAAM;IAEjC;;OAEG;IAEH,WAAW,UAAS;IAEpB;;OAEG;IAEH,OAAO,CAAC,SAAS,CAAS;IAE1B,OAAgB,MAAM,EAAE,cAAc,CAwJpC;IAEF,SAAS,CAAC,MAAM;IAwFhB,OAAO,CAAC,aAAa;IAIrB,OAAO,CAAC,SAAS;IAIjB,OAAO,CAAC,OAAO;IAMf,OAAO,CAAC,YAAY;CAGrB"}
package/dist/pd-wizard.js CHANGED
@@ -1,4 +1,287 @@
1
- import { PdWizard } from "./src/PdWizard.js";
2
- if (!customElements.get("pd-wizard")) {
3
- window.customElements.define("pd-wizard", PdWizard);
4
- }
1
+ import { css, LitElement, html } from "lit";
2
+ import { property, state, customElement } from "lit/decorators.js";
3
+ import { localized, msg } from "@lit/localize";
4
+ import { pdIcons } from "@progressive-development/pd-icon";
5
+ import "@progressive-development/pd-icon/pd-icon";
6
+ import "@progressive-development/pd-forms/pd-button";
7
+ import { PdColorStyles, PdFontStyles } from "@progressive-development/pd-shared-styles";
8
+ import "./pd-steps.js";
9
+ var __defProp = Object.defineProperty;
10
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
11
+ var __decorateClass = (decorators, target, key, kind) => {
12
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
13
+ for (var i = decorators.length - 1, decorator; i >= 0; i--)
14
+ if (decorator = decorators[i])
15
+ result = (kind ? decorator(target, key, result) : decorator(result)) || result;
16
+ if (kind && result) __defProp(target, key, result);
17
+ return result;
18
+ };
19
+ let PdWizard = class extends LitElement {
20
+ constructor() {
21
+ super(...arguments);
22
+ this.currentNumber = -99;
23
+ this.wizardSteps = [];
24
+ this.panelWizard = false;
25
+ this._submited = false;
26
+ }
27
+ render() {
28
+ if (!this.wizardSteps.length) return html``;
29
+ const currentStep = this.wizardSteps[this.currentNumber - 1];
30
+ return html`
31
+ <div class="wiz-header">
32
+ ${this.panelWizard ? html`
33
+ <div class="wiz-panel-h">
34
+ <h1>${(currentStep == null ? void 0 : currentStep.title) ?? "No-Title"}</h1>
35
+ <pd-icon
36
+ class="panel-close-icon"
37
+ title="Close"
38
+ activeIcon
39
+ icon="${pdIcons.ICON_XCLOSE}"
40
+ @click="${this._closeWizard}"
41
+ ></pd-icon>
42
+ </div>
43
+ ` : html`
44
+ <div class="wiz-title">
45
+ <slot name="slotLogo"></slot>
46
+ <span class="title">${(currentStep == null ? void 0 : currentStep.title) ?? "No-Title"}</span>
47
+ <pd-icon
48
+ class="close"
49
+ icon="${pdIcons.ICON_CLOSE}"
50
+ @click="${this._closeWizard}"
51
+ ></pd-icon>
52
+ </div>
53
+ `}
54
+
55
+ <div class="wiz-breadcrumbs">
56
+ <pd-steps
57
+ .steps="${this.wizardSteps}"
58
+ .currentStepNr="${this.currentNumber}"
59
+ ></pd-steps>
60
+ </div>
61
+ </div>
62
+
63
+ <div class="wiz-content">
64
+ <div class="wiz-content-inner">
65
+ ${[1, 2, 3, 4, 5].map(
66
+ (i) => html`
67
+ <div style="${this.currentNumber === i ? "" : "display:none"}">
68
+ <slot name="step-${i}"></slot>
69
+ </div>
70
+ `
71
+ )}
72
+ </div>
73
+ </div>
74
+
75
+ <div class="wiz-buttons">
76
+ ${this.currentNumber >= 1 && this.wizardSteps.length ? html`
77
+ <pd-button
78
+ @button-clicked="${this._previousStep}"
79
+ text="${msg("Zurück", { id: "pd.wizard.button.back" })}"
80
+ style="visibility: ${this.currentNumber === 1 ? "hidden" : "visible"}"
81
+ ></pd-button>
82
+
83
+ ${this.currentNumber !== this.wizardSteps.length && (currentStep == null ? void 0 : currentStep.next) !== false ? html`
84
+ <pd-button
85
+ @button-clicked="${this._nextStep}"
86
+ text="${msg("Weiter", { id: "pd.wizard.button.next" })}"
87
+ ></pd-button>
88
+ ` : ""}
89
+ ${this.currentNumber === this.wizardSteps.length ? html`
90
+ <pd-button
91
+ primary
92
+ ?disabled="${this._submited}"
93
+ @button-clicked="${this._submit}"
94
+ text="${msg("Absenden", { id: "pd.wizard.button.send" })}"
95
+ ></pd-button>
96
+ ` : ""}
97
+ ` : ""}
98
+ </div>
99
+ `;
100
+ }
101
+ _previousStep() {
102
+ this.dispatchEvent(new CustomEvent("previous-step"));
103
+ }
104
+ _nextStep() {
105
+ this.dispatchEvent(new CustomEvent("next-step"));
106
+ }
107
+ _submit() {
108
+ const detail = { submited: false };
109
+ this.dispatchEvent(new CustomEvent("submit-wizard", { detail }));
110
+ this._submited = detail.submited;
111
+ }
112
+ _closeWizard() {
113
+ this.dispatchEvent(new CustomEvent("close-wizard"));
114
+ }
115
+ };
116
+ PdWizard.styles = [
117
+ PdColorStyles,
118
+ PdFontStyles,
119
+ css`
120
+ :host {
121
+ /* These values are used more than onnce and dfined here for short access */
122
+ --my-height: var(--pd-wizard-title-height, 110px);
123
+ --my-header-font-color: var(
124
+ --pd-wizard-header-font-col,
125
+ var(--pd-default-bg-col)
126
+ );
127
+ --my-header-bg-col: var(
128
+ --pd-wizard-header-bg-col,
129
+ var(--pd-default-col)
130
+ );
131
+
132
+ display: flex;
133
+ flex-direction: column;
134
+ height: 100%;
135
+ }
136
+
137
+ .wiz-header {
138
+ flex-grow: 0;
139
+ }
140
+
141
+ .wiz-title {
142
+ position: relative;
143
+ text-align: center;
144
+ background-color: var(--my-header-bg-col);
145
+ height: var(---my-height);
146
+ padding-left: var(--pd-wizard-title-padding-left, 0);
147
+ color: var(--my-header-font-color);
148
+ }
149
+
150
+ :host(.top-rounded) .wiz-title {
151
+ border-top-left-radius: var(--pd-wizard-top-borderradius, 5px);
152
+ border-top-right-radius: var(--pd-wizard-top-borderradius, 5px);
153
+ }
154
+
155
+ .title {
156
+ font-family: var(--pd-default-font-title-family);
157
+ font-size: var(--pd-wizard-header-font-size, 2em);
158
+ font-weight: bolder;
159
+ line-height: var(--my-height);
160
+ }
161
+
162
+ /* The Close Icon */
163
+ .close {
164
+ position: absolute;
165
+ top: 6px;
166
+ right: 6px;
167
+
168
+ cursor: pointer;
169
+
170
+ --pd-icon-size: 2em;
171
+ --pd-icon-stroke-col-active: var(--pd-default-col);
172
+ --pd-icon-col-active: white;
173
+ }
174
+
175
+ .close:hover,
176
+ .close:focus {
177
+ color: var(--pd-default-hover-col);
178
+ --pd-icon-stroke-col: var(--pd-default-hover-col);
179
+ }
180
+
181
+ .wiz-content {
182
+ display: flex;
183
+ justify-content: var(--pd-wizard-justify-content, center);
184
+ flex-grow: 1;
185
+
186
+ background-color: var(
187
+ --pd-wizard-content-bg-col,
188
+ var(--pd-default-bg-col)
189
+ );
190
+ padding: var(--pd-wizard-content-padding, 1em);
191
+ overflow-y: var(--pd-wizard-content-scroll, auto);
192
+ }
193
+
194
+ .wiz-content-inner {
195
+ background-color: var(
196
+ --pd-wizard-content-inner-bg-col,
197
+ var(--pd-default-bg-col)
198
+ );
199
+ max-width: var(--pd-wizard-content-max-width, 1024px);
200
+ width: var(--pd-wizard-content-width, 75%);
201
+ }
202
+
203
+ .wiz-buttons {
204
+ display: flex;
205
+ justify-content: var(--pd-wizard-justify-buttons, space-around);
206
+ flex-grow: 0;
207
+ padding: 1em;
208
+
209
+ background: linear-gradient(
210
+ to top,
211
+ var(--pd-wizard-buttons-bg-col1, var(--pd-default-light-col)) 0%,
212
+ var(--pd-wizard-buttons-bg-col2, var(--pd-default-disabled-light-col))
213
+ 100%
214
+ );
215
+ }
216
+
217
+ :host(.bottom-rounded) .wiz-buttons {
218
+ border-bottom-left-radius: var(--pd-wizard-bottom-borderradius, 5px);
219
+ border-bottom-right-radius: var(--pd-wizard-bottom-borderradius, 5px);
220
+ }
221
+
222
+ /*
223
+ * CSS for panel wizard
224
+ */
225
+ .wiz-panel-h {
226
+ padding: var(--pd-wizard-header-panel-padding, 0);
227
+ display: flex;
228
+ align-items: center;
229
+ justify-content: center;
230
+ background-color: var(
231
+ --pd-wizard-header-panel-bg-col,
232
+ var(--pd-default-col)
233
+ );
234
+ position: relative;
235
+ }
236
+
237
+ .wiz-panel-h h1 {
238
+ color: var(--pd-wizard-header-panel-title-col, white);
239
+ padding: 0;
240
+ margin: 0.8em 0 0.5em 0;
241
+ font-size: var(--pd-wizard-header-font-size, 1.2em);
242
+ font-family: var(--pd-default-font-title-family);
243
+ }
244
+
245
+ .panel-close-icon {
246
+ --pd-icon-size: 2em;
247
+ --pd-icon-stroke-col-active: var(--pd-default-col);
248
+ --pd-icon-col-active: white;
249
+ cursor: pointer;
250
+ position: absolute;
251
+ right: 0px;
252
+ top: 0px;
253
+ }
254
+
255
+ /* Size Elements for small width */
256
+ @media (max-width: 700px) {
257
+ .close {
258
+ font-size: 0.7rem;
259
+ --pd-icon-size: 1.2rem;
260
+ top: 3px;
261
+ right: 3px;
262
+ }
263
+ .title {
264
+ margin-left: 50px;
265
+ }
266
+ }
267
+ `
268
+ ];
269
+ __decorateClass([
270
+ property({ type: Number })
271
+ ], PdWizard.prototype, "currentNumber", 2);
272
+ __decorateClass([
273
+ property({ type: Array })
274
+ ], PdWizard.prototype, "wizardSteps", 2);
275
+ __decorateClass([
276
+ property({ type: Boolean })
277
+ ], PdWizard.prototype, "panelWizard", 2);
278
+ __decorateClass([
279
+ state()
280
+ ], PdWizard.prototype, "_submited", 2);
281
+ PdWizard = __decorateClass([
282
+ customElement("pd-wizard"),
283
+ localized()
284
+ ], PdWizard);
285
+ export {
286
+ PdWizard
287
+ };
@@ -0,0 +1,42 @@
1
+ import { StoryObj } from '@storybook/web-components';
2
+ declare const meta: {
3
+ title: string;
4
+ component: string;
5
+ tags: string[];
6
+ render: ({ steps, currentStepNr, styleTyp }: import('@storybook/web-components').Args) => import('lit-html').TemplateResult<1>;
7
+ argTypes: {
8
+ steps: {
9
+ control: "object";
10
+ };
11
+ currentStepNr: {
12
+ control: {
13
+ type: "number";
14
+ min: number;
15
+ max: number;
16
+ };
17
+ };
18
+ styleTyp: {
19
+ control: "select";
20
+ options: string[];
21
+ };
22
+ };
23
+ };
24
+ export default meta;
25
+ type Story = StoryObj;
26
+ /**
27
+ * Standard-Zustand mit mehreren Schritten und aktuellem Schritt
28
+ */
29
+ export declare const DefaultSteps: Story;
30
+ /**
31
+ * Variante mit anderem Layout-Stil (tab), nur zwei Schritte
32
+ */
33
+ export declare const TabSteps: Story;
34
+ /**
35
+ * Zeigt die erste Stufe als aktiv
36
+ */
37
+ export declare const FirstStepActive: Story;
38
+ /**
39
+ * Zeigt alle Schritte als "abgeschlossen"
40
+ */
41
+ export declare const AllStepsPassed: Story;
42
+ //# sourceMappingURL=steps.stories.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"steps.stories.d.ts","sourceRoot":"","sources":["../../src/stories/steps.stories.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAQ,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAEhE,OAAO,gBAAgB,CAAC;AAExB,QAAA,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;CAuBM,CAAC;AAEjB,eAAe,IAAI,CAAC;AAEpB,KAAK,KAAK,GAAG,QAAQ,CAAC;AAEtB;;GAEG;AACH,eAAO,MAAM,YAAY,EAAE,KAW1B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,QAAQ,EAAE,KAMtB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,eAAe,EAAE,KAU7B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,cAAc,EAAE,KAM5B,CAAC"}
@@ -0,0 +1,12 @@
1
+ import { Meta, StoryObj } from '@storybook/web-components';
2
+ import { PdWizardStep } from '../types.js';
3
+ type WizardArgs = {
4
+ wizardSteps: PdWizardStep[];
5
+ currentNumber: number;
6
+ };
7
+ declare const meta: Meta<WizardArgs>;
8
+ export default meta;
9
+ type Story = StoryObj<WizardArgs>;
10
+ export declare const Wizard: Story;
11
+ export declare const WizardPanel: Story;
12
+ //# sourceMappingURL=wizard.stories.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"wizard.stories.d.ts","sourceRoot":"","sources":["../../src/stories/wizard.stories.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAEhE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAEhD,OAAO,iBAAiB,CAAC;AAEzB,KAAK,UAAU,GAAG;IAChB,WAAW,EAAE,YAAY,EAAE,CAAC;IAC5B,aAAa,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,UAAU,CA2B1B,CAAC;AAEF,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,UAAU,CAAC,CAAC;AAElC,eAAO,MAAM,MAAM,EAAE,KAUpB,CAAC;AAEF,eAAO,MAAM,WAAW,EAAE,KAkEzB,CAAC"}
@@ -0,0 +1,27 @@
1
+ /**
2
+ * Typdefinitionen für die PdWizard-Komponente
3
+ * @license Copyright (c) 2021 PD Progressive Development UG. All rights reserved.
4
+ */
5
+ /**
6
+ * Repräsentiert einen einzelnen Schritt im Wizard.
7
+ */
8
+ export interface PdWizardStep {
9
+ /**
10
+ * Interner Name oder Schlüssel des Schritts (optional).
11
+ */
12
+ name?: string;
13
+ /**
14
+ * Titel, der im Wizard-Kopfbereich angezeigt wird.
15
+ */
16
+ title: string;
17
+ /**
18
+ * Optional: Gibt an, ob ein „Weiter“-Button für diesen Schritt angezeigt werden soll.
19
+ * Wenn `false`, wird kein Button angezeigt. Standard ist `true`.
20
+ */
21
+ next?: boolean;
22
+ /**
23
+ * Beliebige zusätzliche Daten für den Schritt.
24
+ */
25
+ [key: string]: unknown;
26
+ }
27
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;;OAGG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;IAEf;;OAEG;IACH,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB"}
package/package.json CHANGED
@@ -1,11 +1,12 @@
1
1
  {
2
2
  "name": "@progressive-development/pd-wizard",
3
+ "version": "0.6.0",
3
4
  "description": "Webcomponent pd-wizard following open-wc recommendations",
4
5
  "author": "PD Progressive Development",
5
6
  "license": "SEE LICENSE IN LICENSE",
6
- "version": "0.5.7",
7
7
  "main": "./dist/index.js",
8
8
  "module": "./dist/index.js",
9
+ "types": "./dist/index.d.ts",
9
10
  "exports": {
10
11
  ".": "./dist/index.js",
11
12
  "./pd-wizard": "./dist/pd-wizard.js",
@@ -20,70 +21,53 @@
20
21
  "LICENSE"
21
22
  ],
22
23
  "scripts": {
23
- "analyze": "cem analyze --litelement",
24
+ "analyze": "cem analyze --litelement --exclude dist,demo",
24
25
  "start": "vite",
25
26
  "build": "vite build",
26
27
  "preview": "vite preview",
27
- "lint": "eslint --ext .js,.html . --ignore-path .gitignore && prettier \"**/*.{js,html}\" --check --ignore-path .gitignore",
28
- "format": "eslint --ext .js,.html . --fix --ignore-path .gitignore && prettier \"**/*.{js,html}\" --write --ignore-path .gitignore",
28
+ "clean": "rm -rf dist",
29
+ "lint": "eslint --ext .ts,.html src --ignore-path .gitignore && prettier \"**/*.ts\" --check --ignore-path .gitignore",
30
+ "format": "eslint --ext .ts,.html src --fix --ignore-path .gitignore && prettier \"**/*.ts\" --write --ignore-path .gitignore",
29
31
  "test": "vitest run --coverage",
30
32
  "test:watch": "vitest --watch",
33
+ "check": "npm run lint && npm run build",
34
+ "prepublishOnly": "npm run clean && npm run check",
31
35
  "localizeExtract": "lit-localize extract",
32
36
  "localizeBuild": "lit-localize build",
33
37
  "storybook": "storybook dev -p 6006",
34
38
  "build-storybook": "storybook build"
35
39
  },
36
40
  "dependencies": {
37
- "@lit/localize": "^0.11.4",
38
- "@progressive-development/pd-forms": "^0.5.7",
39
- "@progressive-development/pd-icon": "^0.5.0",
40
- "@progressive-development/pd-shared-styles": "0.1.1",
41
- "lit": "^2.8.0"
41
+ "@lit/localize": "^0.12.2",
42
+ "@progressive-development/pd-forms": "^0.6.0",
43
+ "@progressive-development/pd-icon": "^0.6.1",
44
+ "@progressive-development/pd-shared-styles": "^0.2.1",
45
+ "lit": "^3.3.0"
42
46
  },
43
47
  "devDependencies": {
44
- "@chromatic-com/storybook": "^1.3.4",
48
+ "@chromatic-com/storybook": "^1.9.0",
45
49
  "@custom-elements-manifest/analyzer": "^0.4.17",
46
50
  "@lit/localize-tools": "^0.6.10",
47
- "@storybook/addon-essentials": "^8.0.10",
48
- "@storybook/addon-links": "^8.0.10",
51
+ "@storybook/addon-essentials": "^8.6.14",
52
+ "@storybook/addon-links": "^8.6.14",
49
53
  "@storybook/blocks": "^8.0.10",
50
- "@storybook/test": "^8.0.10",
54
+ "@storybook/test": "^8.6.14",
51
55
  "@storybook/web-components": "^8.0.10",
52
- "@storybook/web-components-vite": "^8.0.10",
53
- "eslint": "^7.32.0",
54
- "eslint-config-prettier": "^8.10.0",
56
+ "@storybook/web-components-vite": "^8.6.14",
57
+ "@typescript-eslint/eslint-plugin": "^8.32.1",
58
+ "@typescript-eslint/parser": "^8.32.1",
59
+ "eslint": "^8.57.1",
60
+ "eslint-config-prettier": "^9.1.0",
55
61
  "eslint-plugin-storybook": "^0.8.0",
56
- "husky": "^4.3.8",
57
- "lint-staged": "^10.5.4",
58
- "prettier": "^2.8.8",
59
- "rollup-plugin-visualizer": "^5.13.1",
60
- "storybook": "^8.0.10",
61
- "vite": "^5.4.11",
62
- "vitest": "^2.1.8"
62
+ "prettier": "^3.5.3",
63
+ "rollup-plugin-visualizer": "^5.14.0",
64
+ "storybook": "^8.6.14",
65
+ "typescript": "^5.8.3",
66
+ "vite": "^5.4.19",
67
+ "vite-plugin-dts": "^4.5.4",
68
+ "vitest": "^2.1.9"
63
69
  },
64
70
  "customElements": "custom-elements.json",
65
- "eslintConfig": {
66
- "extends": [
67
- "@open-wc",
68
- "prettier",
69
- "plugin:storybook/recommended"
70
- ]
71
- },
72
- "prettier": {
73
- "singleQuote": true,
74
- "arrowParens": "avoid"
75
- },
76
- "husky": {
77
- "hooks": {
78
- "pre-commit": "lint-staged"
79
- }
80
- },
81
- "lint-staged": {
82
- "*.js": [
83
- "eslint --fix",
84
- "prettier --write"
85
- ]
86
- },
87
71
  "keywords": [
88
72
  "pd",
89
73
  "progressive",
@@ -1,190 +0,0 @@
1
- import { LitElement, css, html } from "lit";
2
- import { PDColorStyles, PDFontStyles } from "@progressive-development/pd-shared-styles";
3
- /**
4
- * @license
5
- * Copyright (c) 2021 PD Progressive Development UG. All rights reserved.
6
- */
7
- class PdSteps extends LitElement {
8
- /**
9
- * Fired when `step` (when not current) clicked.
10
- * @event step-clicked
11
- */
12
- static get styles() {
13
- return [
14
- PDColorStyles,
15
- PDFontStyles,
16
- css`
17
- :host {
18
-
19
- --circle-size: var(--pd-step-circle-size, 40px);
20
-
21
- display: block;
22
- background-color: var(--pd-steps-bg-color, var(--pd-default-col));
23
-
24
- padding-top: 0.5em;
25
- /* needed for the absolut step name */
26
- padding-bottom: calc(var(--pd-step-name-font-size, 1em) * 2.5);
27
- }
28
-
29
- .parent {
30
- display: flex;
31
- flex-flow: row nowrap;
32
- align-items: center;
33
- position: relative;
34
- }
35
-
36
- .step-container {
37
- display: flex;
38
- flex-direction: column;
39
- align-items: center;
40
- text-align: center;
41
- z-index: 51;
42
- width: 100%;
43
- position: relative;
44
- }
45
-
46
- /* Kreis-Styling */
47
- .step.circle {
48
- width: var(--circle-size);
49
- height: var(--circle-size);
50
- border-radius: 50%;
51
- border: solid var(--pd-step-circle-border-size, 2px) var(--pd-step-circle-border-color, white);
52
- background-color: var(--pd-step-circle-bg-color, var(--pd-default-col));
53
- display: flex;
54
- justify-content: center;
55
- align-items: center;
56
- position: relative;
57
- z-index: 51; /* Ensure the circle is above the hr line */
58
- }
59
-
60
- /* Dynamische Schriftgröße der Nummer */
61
- .step-nr {
62
- font-family: var(--pd-default-font-title-family);
63
- font-weight: bold;
64
- color: var(--pd-step-circle-nr-color, white);
65
- font-size: calc(var(--circle-size) / 1.8);
66
- // line-height: 1;
67
- position: absolute;
68
- pointer-events: none;
69
- }
70
-
71
- /* Linien-Styling */
72
- hr {
73
- background-color: var(--pd-step-hr-color, white);
74
- height: 2px;
75
- position: absolute;
76
- top: 50%;
77
- left: 0;
78
- width: 100%;
79
- z-index: 50; /* Make sure the hr is under the circle */
80
- border-style: none;
81
- border-width: 0em;
82
- margin:0;
83
- }
84
-
85
- /* Schritt-Name Styling */
86
- .step-name {
87
- font-family: var(--pd-default-font-title-family);
88
- color: var(--pd-step-name-color, white);
89
- font-size: var(--pd-step-name-font-size, 1em);
90
- font-weight: bold;
91
- position: absolute;
92
- top: calc(var(--circle-size) + (var(--pd-step-name-font-size, 1em) / 2));
93
- }
94
-
95
- .current {
96
- color: var(--pd-step-color-current, var(--pd-default-hover-col));
97
- }
98
- .step.circle.current {
99
- border: solid var(--pd-step-circle-border-size, 2px) var(--pd-step-color-current, var(--pd-default-hover-col));
100
- }
101
-
102
- .passed {
103
- color: var(--pd-step-color-passed, var(--pd-default-dark-col));
104
- }
105
- .step.circle.passed {
106
- border: solid var(--pd-step-circle-border-size, 2px) var(--pd-step-color-passed, var(--pd-default-success-col));
107
- background-color: var(--pd-default-success-light-col);
108
- cursor: pointer;
109
- }
110
-
111
- /* Dynamische Anpassung für kleine Bildschirme */
112
- @media (max-width: 700px) {
113
- :host {
114
- --circle-size: 30px;
115
- }
116
- .step-name {
117
- font-size: 0.9em;
118
- }
119
- }
120
-
121
- `
122
- ];
123
- }
124
- static get properties() {
125
- return {
126
- /**
127
- * The steps for this component
128
- */
129
- steps: { type: Array },
130
- currentStepNr: { type: Number },
131
- styleTyp: { type: String }
132
- };
133
- }
134
- constructor() {
135
- super();
136
- this.steps = [];
137
- this.currentStepNr = -99;
138
- this.styleTyp = "circle";
139
- }
140
- render() {
141
- switch (this.styleTyp) {
142
- case "circle":
143
- return this._renderCircle();
144
- case "tab":
145
- return this._renderCircle();
146
- default:
147
- return "";
148
- }
149
- }
150
- _renderCircle() {
151
- return html`
152
- <div class="parent ${this.styleTyp}">
153
- ${this.styleTyp === "circle" ? html`<hr />` : ""}
154
- ${this.steps.map((st, index) => {
155
- let pClass = "";
156
- if (this.currentStepNr > index) {
157
- pClass = this.currentStepNr === index + 1 ? "current" : "passed";
158
- }
159
- return html`
160
- <div class="step-container">
161
- <div
162
- class="step ${this.styleTyp} ${pClass}"
163
- data-step="${index + 1}"
164
- @click="${this._stepClicked}"
165
- >
166
- <span class="step-nr ${pClass}">${index + 1}</span>
167
- </div>
168
- <span class="step-name ${pClass}">${st.name}</span>
169
- </div>
170
- `;
171
- })}
172
- </div>
173
- `;
174
- }
175
- _stepClicked(e) {
176
- const stepNr = e.target.dataset.step;
177
- if (stepNr < this.currentStepNr) {
178
- this.dispatchEvent(
179
- new CustomEvent("go-to", {
180
- detail: {
181
- step: stepNr
182
- },
183
- bubbles: true,
184
- composed: true
185
- })
186
- );
187
- }
188
- }
189
- }
190
- window.customElements.define("pd-steps", PdSteps);
@@ -1,279 +0,0 @@
1
- import { LitElement, css, html } from "lit";
2
- import { updateWhenLocaleChanges, msg } from "@lit/localize";
3
- import { ICON_XCLOSE, ICON_CLOSE } from "@progressive-development/pd-icon";
4
- import "@progressive-development/pd-icon/pd-icon";
5
- import "@progressive-development/pd-forms/pd-button";
6
- import { PDColorStyles, PDFontStyles } from "@progressive-development/pd-shared-styles";
7
- import "./PdSteps.js";
8
- /**
9
- * @license
10
- * Copyright (c) 2021 PD Progressive Development UG. All rights reserved.
11
- */
12
- class PdWizard extends LitElement {
13
- /**
14
- * Fired when next step clicked
15
- * @event next-step
16
- */
17
- /**
18
- * Fired when previous step clicked
19
- * @event previous-step
20
- */
21
- /**
22
- * Fired when wizard submited
23
- * @event submit-wizard
24
- */
25
- /**
26
- * Fired when wizard submited
27
- * @event close-wizard
28
- */
29
- static get styles() {
30
- return [
31
- PDColorStyles,
32
- PDFontStyles,
33
- css`
34
- :host {
35
-
36
- /* These values are used more than onnce and dfined here for short access */
37
- --my-height: var(--pd-wizard-title-height, 110px);
38
- --my-header-font-color: var(--pd-wizard-header-font-col, var(--pd-default-bg-col));
39
- --my-header-bg-col: var(--pd-wizard-header-bg-col, var(--pd-default-col));
40
-
41
- display: flex;
42
- flex-direction: column;
43
- height: 100%;
44
- }
45
-
46
- .wiz-header {
47
- flex-grow: 0;
48
- }
49
-
50
- .wiz-title {
51
- position: relative;
52
- text-align: center;
53
- background-color: var(--my-header-bg-col);
54
- height: var(---my-height);
55
- padding-left: var(--pd-wizard-title-padding-left, 0);
56
- color: var(--my-header-font-color);
57
- }
58
-
59
- :host(.top-rounded) .wiz-title {
60
- border-top-left-radius: var(--pd-wizard-top-borderradius, 5px);
61
- border-top-right-radius: var(--pd-wizard-top-borderradius, 5px);
62
- }
63
-
64
- .title {
65
- font-family: var(--pd-default-font-title-family);
66
- font-size: var(--pd-wizard-header-font-size, 2em);
67
- font-weight: bolder;
68
- line-height: var(--my-height);
69
- }
70
-
71
- /* The Close Icon */
72
- .close {
73
- position: absolute;
74
- top: 6px;
75
- right: 6px;
76
-
77
- cursor: pointer;
78
-
79
- --pd-icon-size: 2em;
80
- --pd-icon-stroke-col-active: var(--pd-default-col);
81
- --pd-icon-col-active: white;
82
- }
83
-
84
- .close:hover,
85
- .close:focus {
86
- color: var(--pd-default-hover-col);
87
- --pd-icon-stroke-col: var(--pd-default-hover-col);
88
- }
89
-
90
- .wiz-content {
91
- display: flex;
92
- justify-content: var(--pd-wizard-justify-content, center);
93
- flex-grow: 1;
94
-
95
- background-color: var(--pd-wizard-content-bg-col, var(--pd-default-bg-col));
96
- padding: var(--pd-wizard-content-padding, 1em);
97
- overflow-y: var(--pd-wizard-content-scroll, auto);
98
- }
99
-
100
- .wiz-content-inner {
101
- background-color: var(--pd-wizard-content-inner-bg-col, var(--pd-default-bg-col));
102
- max-width: var(--pd-wizard-content-max-width, 1024px);
103
- width: var(--pd-wizard-content-width, 75%);
104
- }
105
-
106
- .wiz-buttons {
107
- display: flex;
108
- justify-content: var(--pd-wizard-justify-buttons, space-around);
109
- flex-grow: 0;
110
- padding: 1em;
111
-
112
- background: linear-gradient(to top,
113
- var(--pd-wizard-buttons-bg-col1, var(--pd-default-light-col)) 0%,
114
- var(--pd-wizard-buttons-bg-col2, var(--pd-default-disabled-light-col)) 100%);
115
- }
116
-
117
- :host(.bottom-rounded) .wiz-buttons {
118
- border-bottom-left-radius: var(--pd-wizard-bottom-borderradius, 5px);
119
- border-bottom-right-radius: var(--pd-wizard-bottom-borderradius, 5px);
120
- }
121
-
122
- /*
123
- * CSS for panel wizard
124
- */
125
- .wiz-panel-h {
126
- padding: var(--pd-wizard-header-panel-padding, 0);
127
- display: flex;
128
- align-items: center;
129
- justify-content: center;
130
- background-color: var(--pd-wizard-header-panel-bg-col, var(--pd-default-col));
131
- position: relative;
132
- }
133
-
134
- .wiz-panel-h h1 {
135
- color: var(--pd-wizard-header-panel-title-col, white);
136
- padding: 0;
137
- margin: 0.8em 0 0.5em 0;
138
- font-size: var(--pd-wizard-header-font-size, 1.2em);
139
- font-family: var(--pd-default-font-title-family);
140
- }
141
-
142
- .panel-close-icon {
143
- --pd-icon-size: 2em;
144
- --pd-icon-stroke-col-active: var(--pd-default-col);
145
- --pd-icon-col-active: white;
146
- cursor: pointer;
147
- position: absolute;
148
- right: 0px;
149
- top: 0px;
150
- }
151
-
152
-
153
- /* Size Elements for small width */
154
- @media (max-width: 700px) {
155
- .close {
156
- font-size: 0.7rem;
157
- --pd-icon-size: 1.2rem;
158
- top: 3px;
159
- right: 3px;
160
- }
161
- .title {
162
- margin-left: 50px;
163
- }
164
- }
165
-
166
- `
167
- ];
168
- }
169
- static get properties() {
170
- return {
171
- currentNumber: { type: Number },
172
- wizardSteps: { Array },
173
- logo: { type: Object },
174
- panelWizard: { type: Boolean },
175
- _submited: { type: Boolean, state: true }
176
- };
177
- }
178
- constructor() {
179
- super();
180
- updateWhenLocaleChanges(this);
181
- this.currentNumber = -99;
182
- this.wizardSteps = [];
183
- this.panelWizard = false;
184
- this._submited = false;
185
- }
186
- render() {
187
- if (this.wizardSteps && this.wizardSteps.length > 0) {
188
- return html`
189
-
190
- <div class="wiz-header">
191
-
192
- ${this.panelWizard ? html`
193
- <div class="wiz-panel-h">
194
- <h1>${this.currentNumber >= 1 && this.wizardSteps ? this.wizardSteps[this.currentNumber - 1].title : "No-Title"}</h1>
195
- <pd-icon class="panel-close-icon"
196
- title="Close" activeIcon icon="${ICON_XCLOSE}" @click="${this._closeWizard}"></pd-icon>
197
- </div>
198
- ` : html`
199
- <div class="wiz-title">
200
- <slot name="slotLogo"></slot>
201
- <span class="title"
202
- >${this.currentNumber >= 1 && this.wizardSteps ? this.wizardSteps[this.currentNumber - 1].title : "No-Title"}</span
203
- >
204
- <pd-icon class="close" icon="${ICON_CLOSE}" @click="${this._closeWizard}"></pd-icon>
205
- </div>
206
- `}
207
-
208
- <div class="wiz-breadcrumbs">
209
- <pd-steps
210
- .steps="${this.wizardSteps}"
211
- currentStepNr="${this.currentNumber}"
212
- ></pd-steps>
213
- </div>
214
-
215
- </div>
216
-
217
- <div class="wiz-content">
218
-
219
- <div class="wiz-content-inner">
220
- <div style="${this.currentNumber === 1 ? "" : "display:none"}">
221
- <slot name="step-1"></slot>
222
- </div>
223
- <div style="${this.currentNumber === 2 ? "" : "display:none"}">
224
- <slot name="step-2"></slot>
225
- </div>
226
- <div style="${this.currentNumber === 3 ? "" : "display:none"}">
227
- <slot name="step-3"></slot>
228
- </div>
229
- <div style="${this.currentNumber === 4 ? "" : "display:none"}">
230
- <slot name="step-4"></slot>
231
- </div>
232
- <div style="${this.currentNumber === 5 ? "" : "display:none"}">
233
- <slot name="step-5"></slot>
234
- </div>
235
- </div>
236
-
237
- </div>
238
-
239
- <div class="wiz-buttons">
240
- ${this.currentNumber >= 1 && this.wizardSteps ? html`
241
- <pd-button
242
- @button-clicked="${this._previousStep}"
243
- text="${msg("Zurück", { id: "pd.wizard.button.back" })}"
244
- style="visibility: ${this.currentNumber === 1 ? "hidden" : "visible"};"
245
- ></pd-button>
246
- ${this.currentNumber !== this.wizardSteps.length && this.wizardSteps[this.currentNumber - 1].next !== false ? html`<pd-button
247
- @button-clicked="${this._nextStep}"
248
- text="${msg("Weiter", { id: "pd.wizard.button.next" })}"
249
- ></pd-button>` : ""}
250
- ${this.currentNumber === this.wizardSteps.length ? html`<pd-button
251
- primary
252
- ?disabled="${this._submited}"
253
- @button-clicked="${this._submit}"
254
- text="${msg("Absenden", { id: "pd.wizard.button.send" })}"
255
- ></pd-button>` : ""}
256
- ` : ""}
257
- </div>
258
- `;
259
- }
260
- return "";
261
- }
262
- _previousStep() {
263
- this.dispatchEvent(new CustomEvent("previous-step"));
264
- }
265
- _nextStep() {
266
- this.dispatchEvent(new CustomEvent("next-step"));
267
- }
268
- _submit() {
269
- const detail = { submited: false };
270
- this.dispatchEvent(new CustomEvent("submit-wizard", { detail }));
271
- this._submited = detail.submited;
272
- }
273
- _closeWizard() {
274
- this.dispatchEvent(new CustomEvent("close-wizard"));
275
- }
276
- }
277
- export {
278
- PdWizard
279
- };