@progressive-development/pd-wizard 0.1.83 → 0.5.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/dist/index.js +10 -0
- package/dist/locales/be.js +8 -0
- package/dist/locales/de.js +8 -0
- package/dist/locales/en.js +8 -0
- package/dist/pd-wizard.js +4 -0
- package/{src → dist/src}/PdSteps.js +22 -38
- package/{src → dist/src}/PdWizard.js +45 -77
- package/package.json +48 -37
- package/.editorconfig +0 -29
- package/.storybook/main.js +0 -13
- package/.storybook/preview-head.html +0 -35
- package/.storybook/preview.js +0 -14
- package/demo/index.html +0 -29
- package/index.js +0 -5
- package/lit-localize.json +0 -18
- package/pd-wizard.js +0 -3
- package/src/generated/locale-codes.js +0 -27
- package/src/generated/locales/be.js +0 -16
- package/src/generated/locales/de.js +0 -16
- package/src/generated/locales/en.js +0 -16
- package/src/stories/index.stories.js +0 -44
- package/src/stories/steps.stories.js +0 -32
- package/src/stories/wizard.stories.js +0 -171
- package/test/pd-wizard.test.js +0 -34
- package/web-dev-server.config.mjs +0 -27
- package/web-test-runner.config.mjs +0 -41
- package/xliff/be.xlf +0 -19
- package/xliff/de.xlf +0 -16
- package/xliff/en.xlf +0 -19
package/dist/index.js
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { PdWizard } from "./src/PdWizard.js";
|
|
2
|
+
import { templates } from "./locales/be.js";
|
|
3
|
+
import { templates as templates2 } from "./locales/de.js";
|
|
4
|
+
import { templates as templates3 } from "./locales/en.js";
|
|
5
|
+
export {
|
|
6
|
+
PdWizard,
|
|
7
|
+
templates as beTemplates,
|
|
8
|
+
templates2 as deTemplates,
|
|
9
|
+
templates3 as enTemplates
|
|
10
|
+
};
|
|
@@ -1,28 +1,18 @@
|
|
|
1
|
-
|
|
1
|
+
import { LitElement, css, html } from "lit";
|
|
2
|
+
import { PDColorStyles, PDFontStyles } from "@progressive-development/pd-shared-styles";
|
|
2
3
|
/**
|
|
3
4
|
* @license
|
|
4
5
|
* Copyright (c) 2021 PD Progressive Development UG. All rights reserved.
|
|
5
6
|
*/
|
|
6
|
-
|
|
7
|
-
import { LitElement, html, css } from 'lit';
|
|
8
|
-
|
|
9
|
-
import { PDColorStyles, PDFontStyles } from '@progressive-development/pd-shared-styles';
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* An example element.
|
|
13
|
-
*
|
|
14
|
-
* @slot - This element has a slot
|
|
15
|
-
* @csspart button - The button
|
|
16
|
-
*/
|
|
17
7
|
class PdSteps extends LitElement {
|
|
18
8
|
/**
|
|
19
9
|
* Fired when `step` (when not current) clicked.
|
|
20
10
|
* @event step-clicked
|
|
21
11
|
*/
|
|
22
|
-
|
|
23
12
|
static get styles() {
|
|
24
13
|
return [
|
|
25
|
-
PDColorStyles,
|
|
14
|
+
PDColorStyles,
|
|
15
|
+
PDFontStyles,
|
|
26
16
|
css`
|
|
27
17
|
:host {
|
|
28
18
|
|
|
@@ -128,9 +118,9 @@ class PdSteps extends LitElement {
|
|
|
128
118
|
}
|
|
129
119
|
}
|
|
130
120
|
|
|
131
|
-
`
|
|
121
|
+
`
|
|
122
|
+
];
|
|
132
123
|
}
|
|
133
|
-
|
|
134
124
|
static get properties() {
|
|
135
125
|
return {
|
|
136
126
|
/**
|
|
@@ -138,39 +128,35 @@ class PdSteps extends LitElement {
|
|
|
138
128
|
*/
|
|
139
129
|
steps: { type: Array },
|
|
140
130
|
currentStepNr: { type: Number },
|
|
141
|
-
styleTyp: { type: String }
|
|
131
|
+
styleTyp: { type: String }
|
|
142
132
|
};
|
|
143
133
|
}
|
|
144
|
-
|
|
145
134
|
constructor() {
|
|
146
135
|
super();
|
|
147
136
|
this.steps = [];
|
|
148
137
|
this.currentStepNr = -99;
|
|
149
|
-
this.styleTyp =
|
|
138
|
+
this.styleTyp = "circle";
|
|
150
139
|
}
|
|
151
|
-
|
|
152
140
|
render() {
|
|
153
141
|
switch (this.styleTyp) {
|
|
154
|
-
|
|
155
|
-
case 'circle':
|
|
142
|
+
case "circle":
|
|
156
143
|
return this._renderCircle();
|
|
157
|
-
case
|
|
144
|
+
case "tab":
|
|
158
145
|
return this._renderCircle();
|
|
159
146
|
default:
|
|
160
|
-
return
|
|
147
|
+
return "";
|
|
161
148
|
}
|
|
162
149
|
}
|
|
163
|
-
|
|
164
150
|
_renderCircle() {
|
|
165
151
|
return html`
|
|
166
152
|
<div class="parent ${this.styleTyp}">
|
|
167
|
-
${this.styleTyp ===
|
|
153
|
+
${this.styleTyp === "circle" ? html`<hr />` : ""}
|
|
168
154
|
${this.steps.map((st, index) => {
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
155
|
+
let pClass = "";
|
|
156
|
+
if (this.currentStepNr > index) {
|
|
157
|
+
pClass = this.currentStepNr === index + 1 ? "current" : "passed";
|
|
158
|
+
}
|
|
159
|
+
return html`
|
|
174
160
|
<div class="step-container">
|
|
175
161
|
<div
|
|
176
162
|
class="step ${this.styleTyp} ${pClass}"
|
|
@@ -182,25 +168,23 @@ class PdSteps extends LitElement {
|
|
|
182
168
|
<span class="step-name ${pClass}">${st.name}</span>
|
|
183
169
|
</div>
|
|
184
170
|
`;
|
|
185
|
-
|
|
171
|
+
})}
|
|
186
172
|
</div>
|
|
187
173
|
`;
|
|
188
174
|
}
|
|
189
|
-
|
|
190
175
|
_stepClicked(e) {
|
|
191
176
|
const stepNr = e.target.dataset.step;
|
|
192
177
|
if (stepNr < this.currentStepNr) {
|
|
193
178
|
this.dispatchEvent(
|
|
194
|
-
new CustomEvent(
|
|
179
|
+
new CustomEvent("go-to", {
|
|
195
180
|
detail: {
|
|
196
|
-
step: stepNr
|
|
181
|
+
step: stepNr
|
|
197
182
|
},
|
|
198
183
|
bubbles: true,
|
|
199
|
-
composed: true
|
|
184
|
+
composed: true
|
|
200
185
|
})
|
|
201
186
|
);
|
|
202
187
|
}
|
|
203
188
|
}
|
|
204
189
|
}
|
|
205
|
-
|
|
206
|
-
window.customElements.define('pd-steps', PdSteps);
|
|
190
|
+
window.customElements.define("pd-steps", PdSteps);
|
|
@@ -1,38 +1,23 @@
|
|
|
1
|
-
|
|
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";
|
|
2
8
|
/**
|
|
3
9
|
* @license
|
|
4
10
|
* Copyright (c) 2021 PD Progressive Development UG. All rights reserved.
|
|
5
11
|
*/
|
|
6
|
-
|
|
7
|
-
import { LitElement, html, css } from 'lit';
|
|
8
|
-
import { msg, updateWhenLocaleChanges } from '@lit/localize';
|
|
9
|
-
|
|
10
|
-
import { ICON_CLOSE as CLOSEICON, ICON_XCLOSE } from '@progressive-development/pd-icon/src/PdIcon.js';
|
|
11
|
-
|
|
12
|
-
import '@progressive-development/pd-icon/pd-icon.js';
|
|
13
|
-
import '@progressive-development/pd-forms/pd-button.js';
|
|
14
|
-
|
|
15
|
-
import { PDColorStyles, PDFontStyles } from '@progressive-development/pd-shared-styles';
|
|
16
|
-
|
|
17
|
-
import './PdSteps.js';
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* An example element.
|
|
21
|
-
*
|
|
22
|
-
* @slot - This element has a slot
|
|
23
|
-
* @csspart button - The button
|
|
24
|
-
*/
|
|
25
|
-
export class PdWizard extends LitElement {
|
|
12
|
+
class PdWizard extends LitElement {
|
|
26
13
|
/**
|
|
27
14
|
* Fired when next step clicked
|
|
28
15
|
* @event next-step
|
|
29
16
|
*/
|
|
30
|
-
|
|
31
17
|
/**
|
|
32
18
|
* Fired when previous step clicked
|
|
33
19
|
* @event previous-step
|
|
34
20
|
*/
|
|
35
|
-
|
|
36
21
|
/**
|
|
37
22
|
* Fired when wizard submited
|
|
38
23
|
* @event submit-wizard
|
|
@@ -41,10 +26,10 @@ export class PdWizard extends LitElement {
|
|
|
41
26
|
* Fired when wizard submited
|
|
42
27
|
* @event close-wizard
|
|
43
28
|
*/
|
|
44
|
-
|
|
45
29
|
static get styles() {
|
|
46
30
|
return [
|
|
47
|
-
PDColorStyles,
|
|
31
|
+
PDColorStyles,
|
|
32
|
+
PDFontStyles,
|
|
48
33
|
css`
|
|
49
34
|
:host {
|
|
50
35
|
|
|
@@ -178,28 +163,26 @@ export class PdWizard extends LitElement {
|
|
|
178
163
|
}
|
|
179
164
|
}
|
|
180
165
|
|
|
181
|
-
`
|
|
166
|
+
`
|
|
167
|
+
];
|
|
182
168
|
}
|
|
183
|
-
|
|
184
169
|
static get properties() {
|
|
185
170
|
return {
|
|
186
171
|
currentNumber: { type: Number },
|
|
187
172
|
wizardSteps: { Array },
|
|
188
|
-
logo: { type: Object },
|
|
189
|
-
panelWizard: { type: Boolean },
|
|
190
|
-
_submited: { type: Boolean, state: true }
|
|
173
|
+
logo: { type: Object },
|
|
174
|
+
panelWizard: { type: Boolean },
|
|
175
|
+
_submited: { type: Boolean, state: true }
|
|
191
176
|
};
|
|
192
177
|
}
|
|
193
|
-
|
|
194
178
|
constructor() {
|
|
195
179
|
super();
|
|
196
180
|
updateWhenLocaleChanges(this);
|
|
197
181
|
this.currentNumber = -99;
|
|
198
|
-
this.wizardSteps = [];
|
|
199
|
-
this.panelWizard = false;
|
|
200
|
-
this._submited = false;
|
|
182
|
+
this.wizardSteps = [];
|
|
183
|
+
this.panelWizard = false;
|
|
184
|
+
this._submited = false;
|
|
201
185
|
}
|
|
202
|
-
|
|
203
186
|
render() {
|
|
204
187
|
if (this.wizardSteps && this.wizardSteps.length > 0) {
|
|
205
188
|
return html`
|
|
@@ -208,9 +191,7 @@ export class PdWizard extends LitElement {
|
|
|
208
191
|
|
|
209
192
|
${this.panelWizard ? html`
|
|
210
193
|
<div class="wiz-panel-h">
|
|
211
|
-
<h1>${this.currentNumber >= 1 && this.wizardSteps
|
|
212
|
-
? this.wizardSteps[this.currentNumber - 1].title
|
|
213
|
-
: 'No-Title'}</h1>
|
|
194
|
+
<h1>${this.currentNumber >= 1 && this.wizardSteps ? this.wizardSteps[this.currentNumber - 1].title : "No-Title"}</h1>
|
|
214
195
|
<pd-icon class="panel-close-icon"
|
|
215
196
|
title="Close" activeIcon icon="${ICON_XCLOSE}" @click="${this._closeWizard}"></pd-icon>
|
|
216
197
|
</div>
|
|
@@ -218,11 +199,9 @@ export class PdWizard extends LitElement {
|
|
|
218
199
|
<div class="wiz-title">
|
|
219
200
|
<slot name="slotLogo"></slot>
|
|
220
201
|
<span class="title"
|
|
221
|
-
>${this.currentNumber >= 1 && this.wizardSteps
|
|
222
|
-
? this.wizardSteps[this.currentNumber - 1].title
|
|
223
|
-
: 'No-Title'}</span
|
|
202
|
+
>${this.currentNumber >= 1 && this.wizardSteps ? this.wizardSteps[this.currentNumber - 1].title : "No-Title"}</span
|
|
224
203
|
>
|
|
225
|
-
<pd-icon class="close" icon="${
|
|
204
|
+
<pd-icon class="close" icon="${ICON_CLOSE}" @click="${this._closeWizard}"></pd-icon>
|
|
226
205
|
</div>
|
|
227
206
|
`}
|
|
228
207
|
|
|
@@ -238,19 +217,19 @@ export class PdWizard extends LitElement {
|
|
|
238
217
|
<div class="wiz-content">
|
|
239
218
|
|
|
240
219
|
<div class="wiz-content-inner">
|
|
241
|
-
<div style="${this.currentNumber === 1 ?
|
|
220
|
+
<div style="${this.currentNumber === 1 ? "" : "display:none"}">
|
|
242
221
|
<slot name="step-1"></slot>
|
|
243
222
|
</div>
|
|
244
|
-
<div style="${this.currentNumber === 2 ?
|
|
223
|
+
<div style="${this.currentNumber === 2 ? "" : "display:none"}">
|
|
245
224
|
<slot name="step-2"></slot>
|
|
246
225
|
</div>
|
|
247
|
-
<div style="${this.currentNumber === 3 ?
|
|
226
|
+
<div style="${this.currentNumber === 3 ? "" : "display:none"}">
|
|
248
227
|
<slot name="step-3"></slot>
|
|
249
228
|
</div>
|
|
250
|
-
<div style="${this.currentNumber === 4 ?
|
|
229
|
+
<div style="${this.currentNumber === 4 ? "" : "display:none"}">
|
|
251
230
|
<slot name="step-4"></slot>
|
|
252
231
|
</div>
|
|
253
|
-
<div style="${this.currentNumber === 5 ?
|
|
232
|
+
<div style="${this.currentNumber === 5 ? "" : "display:none"}">
|
|
254
233
|
<slot name="step-5"></slot>
|
|
255
234
|
</div>
|
|
256
235
|
</div>
|
|
@@ -258,54 +237,43 @@ export class PdWizard extends LitElement {
|
|
|
258
237
|
</div>
|
|
259
238
|
|
|
260
239
|
<div class="wiz-buttons">
|
|
261
|
-
${this.currentNumber >= 1 && this.wizardSteps
|
|
262
|
-
? html`
|
|
240
|
+
${this.currentNumber >= 1 && this.wizardSteps ? html`
|
|
263
241
|
<pd-button
|
|
264
242
|
@button-clicked="${this._previousStep}"
|
|
265
|
-
text="${msg(
|
|
266
|
-
style="visibility: ${this.currentNumber === 1
|
|
267
|
-
? 'hidden'
|
|
268
|
-
: 'visible'};"
|
|
243
|
+
text="${msg("Zurück", { id: "pd.wizard.button.back" })}"
|
|
244
|
+
style="visibility: ${this.currentNumber === 1 ? "hidden" : "visible"};"
|
|
269
245
|
></pd-button>
|
|
270
|
-
${this.currentNumber !== this.wizardSteps.length &&
|
|
271
|
-
this.wizardSteps[this.currentNumber - 1].next !== false
|
|
272
|
-
? html`<pd-button
|
|
246
|
+
${this.currentNumber !== this.wizardSteps.length && this.wizardSteps[this.currentNumber - 1].next !== false ? html`<pd-button
|
|
273
247
|
@button-clicked="${this._nextStep}"
|
|
274
|
-
text="${msg(
|
|
275
|
-
></pd-button>`
|
|
276
|
-
|
|
277
|
-
${this.currentNumber === this.wizardSteps.length
|
|
278
|
-
? html`<pd-button
|
|
248
|
+
text="${msg("Weiter", { id: "pd.wizard.button.next" })}"
|
|
249
|
+
></pd-button>` : ""}
|
|
250
|
+
${this.currentNumber === this.wizardSteps.length ? html`<pd-button
|
|
279
251
|
primary
|
|
280
252
|
?disabled="${this._submited}"
|
|
281
253
|
@button-clicked="${this._submit}"
|
|
282
|
-
text="${msg(
|
|
283
|
-
></pd-button>`
|
|
284
|
-
|
|
285
|
-
`
|
|
286
|
-
: ''}
|
|
254
|
+
text="${msg("Absenden", { id: "pd.wizard.button.send" })}"
|
|
255
|
+
></pd-button>` : ""}
|
|
256
|
+
` : ""}
|
|
287
257
|
</div>
|
|
288
258
|
`;
|
|
289
259
|
}
|
|
290
|
-
return
|
|
260
|
+
return "";
|
|
291
261
|
}
|
|
292
|
-
|
|
293
262
|
_previousStep() {
|
|
294
|
-
this.dispatchEvent(new CustomEvent(
|
|
263
|
+
this.dispatchEvent(new CustomEvent("previous-step"));
|
|
295
264
|
}
|
|
296
|
-
|
|
297
265
|
_nextStep() {
|
|
298
|
-
this.dispatchEvent(new CustomEvent(
|
|
266
|
+
this.dispatchEvent(new CustomEvent("next-step"));
|
|
299
267
|
}
|
|
300
|
-
|
|
301
268
|
_submit() {
|
|
302
|
-
const detail = {submited: false};
|
|
303
|
-
this.dispatchEvent(new CustomEvent(
|
|
269
|
+
const detail = { submited: false };
|
|
270
|
+
this.dispatchEvent(new CustomEvent("submit-wizard", { detail }));
|
|
304
271
|
this._submited = detail.submited;
|
|
305
272
|
}
|
|
306
|
-
|
|
307
273
|
_closeWizard() {
|
|
308
|
-
|
|
309
|
-
this.dispatchEvent(new CustomEvent('close-wizard'));
|
|
274
|
+
this.dispatchEvent(new CustomEvent("close-wizard"));
|
|
310
275
|
}
|
|
311
276
|
}
|
|
277
|
+
export {
|
|
278
|
+
PdWizard
|
|
279
|
+
};
|
package/package.json
CHANGED
|
@@ -1,62 +1,65 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@progressive-development/pd-wizard",
|
|
3
|
-
"description": "Webcomponent pd-wizard following open-wc recommendations",
|
|
4
|
-
"license": "SEE LICENSE IN LICENSE",
|
|
3
|
+
"description": "Webcomponent pd-wizard following open-wc recommendations",
|
|
5
4
|
"author": "PD Progressive Development",
|
|
6
|
-
"
|
|
7
|
-
|
|
5
|
+
"license": "SEE LICENSE IN LICENSE",
|
|
6
|
+
"version": "0.5.0",
|
|
7
|
+
"main": "./dist/index.js",
|
|
8
|
+
"module": "./dist/index.js",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": "./dist/index.js",
|
|
11
|
+
"./pd-wizard": "./dist/pd-wizard.js",
|
|
12
|
+
"./locales/be": "./dist/locales/be.js",
|
|
13
|
+
"./locales/de": "./dist/locales/de.js",
|
|
14
|
+
"./locales/en": "./dist/locales/en.js"
|
|
8
15
|
},
|
|
9
|
-
"
|
|
10
|
-
"
|
|
11
|
-
"
|
|
12
|
-
"
|
|
13
|
-
"
|
|
14
|
-
"order",
|
|
15
|
-
"steps"
|
|
16
|
+
"files": [
|
|
17
|
+
"dist/",
|
|
18
|
+
"package.json",
|
|
19
|
+
"README.md",
|
|
20
|
+
"LICENSE"
|
|
16
21
|
],
|
|
17
|
-
"version": "0.1.83",
|
|
18
|
-
"main": "index.js",
|
|
19
|
-
"module": "index.js",
|
|
20
22
|
"scripts": {
|
|
21
23
|
"analyze": "cem analyze --litelement",
|
|
22
|
-
"start": "
|
|
23
|
-
"
|
|
24
|
-
"
|
|
25
|
-
"
|
|
26
|
-
"
|
|
24
|
+
"start": "vite",
|
|
25
|
+
"build": "vite build",
|
|
26
|
+
"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",
|
|
29
|
+
"test": "vitest run --coverage",
|
|
30
|
+
"test:watch": "vitest --watch",
|
|
27
31
|
"localizeExtract": "lit-localize extract",
|
|
28
32
|
"localizeBuild": "lit-localize build",
|
|
29
33
|
"storybook": "storybook dev -p 6006",
|
|
30
34
|
"build-storybook": "storybook build"
|
|
31
35
|
},
|
|
32
36
|
"dependencies": {
|
|
33
|
-
"@lit/localize": "^0.
|
|
34
|
-
"@progressive-development/pd-forms": "^0.
|
|
35
|
-
"@progressive-development/pd-icon": "^0.
|
|
37
|
+
"@lit/localize": "^0.12.2",
|
|
38
|
+
"@progressive-development/pd-forms": "^0.5.0",
|
|
39
|
+
"@progressive-development/pd-icon": "^0.5.0",
|
|
36
40
|
"@progressive-development/pd-shared-styles": "0.1.1",
|
|
37
41
|
"lit": "^2.8.0"
|
|
38
42
|
},
|
|
39
43
|
"devDependencies": {
|
|
44
|
+
"@chromatic-com/storybook": "^1.3.4",
|
|
40
45
|
"@custom-elements-manifest/analyzer": "^0.4.17",
|
|
41
|
-
"@lit/localize-tools": "^0.
|
|
42
|
-
"@
|
|
43
|
-
"@
|
|
44
|
-
"@storybook/
|
|
45
|
-
"@storybook/
|
|
46
|
-
"@storybook/
|
|
47
|
-
"@storybook/web-components": "^
|
|
48
|
-
"@storybook/web-components-vite": "^7.6.4",
|
|
49
|
-
"@web/dev-server": "^0.1.38",
|
|
50
|
-
"@web/test-runner": "^0.13.31",
|
|
46
|
+
"@lit/localize-tools": "^0.7.2",
|
|
47
|
+
"@storybook/addon-essentials": "^8.0.10",
|
|
48
|
+
"@storybook/addon-links": "^8.0.10",
|
|
49
|
+
"@storybook/blocks": "^8.0.10",
|
|
50
|
+
"@storybook/test": "^8.0.10",
|
|
51
|
+
"@storybook/web-components": "^8.0.10",
|
|
52
|
+
"@storybook/web-components-vite": "^8.0.10",
|
|
51
53
|
"eslint": "^7.32.0",
|
|
52
54
|
"eslint-config-prettier": "^8.10.0",
|
|
53
|
-
"eslint-plugin-storybook": "^0.
|
|
55
|
+
"eslint-plugin-storybook": "^0.8.0",
|
|
54
56
|
"husky": "^4.3.8",
|
|
55
57
|
"lint-staged": "^10.5.4",
|
|
56
58
|
"prettier": "^2.8.8",
|
|
57
|
-
"
|
|
58
|
-
"
|
|
59
|
-
"
|
|
59
|
+
"rollup-plugin-visualizer": "^5.13.1",
|
|
60
|
+
"storybook": "^8.0.10",
|
|
61
|
+
"vite": "^5.4.11",
|
|
62
|
+
"vitest": "^2.1.8"
|
|
60
63
|
},
|
|
61
64
|
"customElements": "custom-elements.json",
|
|
62
65
|
"eslintConfig": {
|
|
@@ -80,5 +83,13 @@
|
|
|
80
83
|
"eslint --fix",
|
|
81
84
|
"prettier --write"
|
|
82
85
|
]
|
|
83
|
-
}
|
|
86
|
+
},
|
|
87
|
+
"keywords": [
|
|
88
|
+
"pd",
|
|
89
|
+
"progressive",
|
|
90
|
+
"development",
|
|
91
|
+
"wizard",
|
|
92
|
+
"order",
|
|
93
|
+
"steps"
|
|
94
|
+
]
|
|
84
95
|
}
|
package/.editorconfig
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
# EditorConfig helps developers define and maintain consistent
|
|
2
|
-
# coding styles between different editors and IDEs
|
|
3
|
-
# editorconfig.org
|
|
4
|
-
|
|
5
|
-
root = true
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
[*]
|
|
9
|
-
|
|
10
|
-
# Change these settings to your own preference
|
|
11
|
-
indent_style = space
|
|
12
|
-
indent_size = 2
|
|
13
|
-
|
|
14
|
-
# We recommend you to keep these unchanged
|
|
15
|
-
end_of_line = lf
|
|
16
|
-
charset = utf-8
|
|
17
|
-
trim_trailing_whitespace = true
|
|
18
|
-
insert_final_newline = true
|
|
19
|
-
|
|
20
|
-
[*.md]
|
|
21
|
-
trim_trailing_whitespace = false
|
|
22
|
-
|
|
23
|
-
[*.json]
|
|
24
|
-
indent_size = 2
|
|
25
|
-
|
|
26
|
-
[*.{html,js,md}]
|
|
27
|
-
block_comment_start = /**
|
|
28
|
-
block_comment = *
|
|
29
|
-
block_comment_end = */
|
package/.storybook/main.js
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/** @type { import('@storybook/web-components-vite').StorybookConfig } */
|
|
2
|
-
const config = {
|
|
3
|
-
stories: ['../src/**/*.mdx', '../src/**/*.stories.@(js|jsx|mjs|ts|tsx)'],
|
|
4
|
-
addons: ['@storybook/addon-links', '@storybook/addon-essentials'],
|
|
5
|
-
framework: {
|
|
6
|
-
name: '@storybook/web-components-vite',
|
|
7
|
-
options: {},
|
|
8
|
-
},
|
|
9
|
-
docs: {
|
|
10
|
-
autodocs: 'tag',
|
|
11
|
-
},
|
|
12
|
-
};
|
|
13
|
-
export default config;
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
<!-- .storybook/preview-head.html -->
|
|
3
|
-
|
|
4
|
-
<!-- Pull in static files served from your Static directory or the internet -->
|
|
5
|
-
<!-- Example: `main.js|ts` is configured with staticDirs: ['../public'] and your font is located in the `fonts` directory inside your `public` directory -->
|
|
6
|
-
<link rel="preconnect" href="https://fonts.gstatic.com">
|
|
7
|
-
<link href="https://fonts.googleapis.com/css2?family=Montserrat:wght@300;400&family=Oswald:wght@700&display=swap" rel="stylesheet">
|
|
8
|
-
|
|
9
|
-
<script>
|
|
10
|
-
// Redux assumes `process.env.NODE_ENV` exists in the ES module build.
|
|
11
|
-
// https://github.com/reactjs/redux/issues/2907
|
|
12
|
-
window.process = { env: { NODE_ENV: 'dev' } };
|
|
13
|
-
</script>
|
|
14
|
-
|
|
15
|
-
<style>
|
|
16
|
-
|
|
17
|
-
html,
|
|
18
|
-
body {
|
|
19
|
-
padding: 0;
|
|
20
|
-
margin: 0;
|
|
21
|
-
min-height: 100%;
|
|
22
|
-
height: 100%; /* !!! works only with both, height/min-height */
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
/* storybook internal, sets root to 100% height => only then wizard flex grow works here in story book #root, in older version*/
|
|
26
|
-
#root-inner, #storybook-root {
|
|
27
|
-
height: 100%;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
/* storybook internal, sets padding to 0 */
|
|
31
|
-
.sb-show-main.sb-main-padded {
|
|
32
|
-
padding: 0;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
</style>
|
package/.storybook/preview.js
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/** @type { import('@storybook/web-components').Preview } */
|
|
2
|
-
const preview = {
|
|
3
|
-
parameters: {
|
|
4
|
-
actions: { argTypesRegex: '^on[A-Z].*' },
|
|
5
|
-
controls: {
|
|
6
|
-
matchers: {
|
|
7
|
-
color: /(background|color)$/i,
|
|
8
|
-
date: /Date$/i,
|
|
9
|
-
},
|
|
10
|
-
},
|
|
11
|
-
},
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
export default preview;
|
package/demo/index.html
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
<!doctype html>
|
|
2
|
-
<html lang="en-GB">
|
|
3
|
-
<head>
|
|
4
|
-
<meta charset="utf-8">
|
|
5
|
-
<style>
|
|
6
|
-
body {
|
|
7
|
-
background: #fafafa;
|
|
8
|
-
}
|
|
9
|
-
</style>
|
|
10
|
-
</head>
|
|
11
|
-
<body>
|
|
12
|
-
<div id="demo"></div>
|
|
13
|
-
|
|
14
|
-
<script type="module">
|
|
15
|
-
import { html, render } from 'lit';
|
|
16
|
-
import '../pd-wizard.js';
|
|
17
|
-
|
|
18
|
-
const title = 'Hello owc World!';
|
|
19
|
-
render(
|
|
20
|
-
html`
|
|
21
|
-
<pd-wizard .title=${title}>
|
|
22
|
-
some light-dom
|
|
23
|
-
</pd-wizard>
|
|
24
|
-
`,
|
|
25
|
-
document.querySelector('#demo')
|
|
26
|
-
);
|
|
27
|
-
</script>
|
|
28
|
-
</body>
|
|
29
|
-
</html>
|
package/index.js
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
export { PdWizard } from './src/PdWizard.js';
|
|
2
|
-
|
|
3
|
-
export { templates as beTemplates } from './src/generated/locales/be.js';
|
|
4
|
-
export { templates as deTemplates } from './src/generated/locales/de.js';
|
|
5
|
-
export { templates as enTemplates } from './src/generated/locales/en.js';
|
package/lit-localize.json
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "https://raw.githubusercontent.com/lit/lit/main/packages/localize-tools/config.schema.json",
|
|
3
|
-
"sourceLocale": "dev",
|
|
4
|
-
"targetLocales": ["de", "en", "be"],
|
|
5
|
-
"inputFiles": [
|
|
6
|
-
"src/**/*.js"
|
|
7
|
-
],
|
|
8
|
-
"output": {
|
|
9
|
-
"mode": "runtime",
|
|
10
|
-
"localeCodesModule": "src/generated/locale-codes.js",
|
|
11
|
-
"outputDir": "src/generated/locales"
|
|
12
|
-
|
|
13
|
-
},
|
|
14
|
-
"interchange": {
|
|
15
|
-
"format": "xliff",
|
|
16
|
-
"xliffDir": "./xliff/"
|
|
17
|
-
}
|
|
18
|
-
}
|
package/pd-wizard.js
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
// Do not modify this file by hand!
|
|
2
|
-
// Re-generate this file by running lit-localize.
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* The locale code that templates in this source code are written in.
|
|
6
|
-
*/
|
|
7
|
-
export const sourceLocale = `dev`;
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* The other locale codes that this application is localized into. Sorted
|
|
11
|
-
* lexicographically.
|
|
12
|
-
*/
|
|
13
|
-
export const targetLocales = [
|
|
14
|
-
`be`,
|
|
15
|
-
`de`,
|
|
16
|
-
`en`,
|
|
17
|
-
];
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* All valid project locale codes. Sorted lexicographically.
|
|
21
|
-
*/
|
|
22
|
-
export const allLocales = [
|
|
23
|
-
`be`,
|
|
24
|
-
`de`,
|
|
25
|
-
`dev`,
|
|
26
|
-
`en`,
|
|
27
|
-
];
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
// Do not modify this file by hand!
|
|
3
|
-
// Re-generate this file by running lit-localize
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
/* eslint-disable no-irregular-whitespace */
|
|
9
|
-
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
10
|
-
|
|
11
|
-
export const templates = {
|
|
12
|
-
'pd.wizard.button.back': `Terug`,
|
|
13
|
-
'pd.wizard.button.next': `Volgende`,
|
|
14
|
-
'pd.wizard.button.send': `Verzenden`,
|
|
15
|
-
};
|
|
16
|
-
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
// Do not modify this file by hand!
|
|
3
|
-
// Re-generate this file by running lit-localize
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
/* eslint-disable no-irregular-whitespace */
|
|
9
|
-
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
10
|
-
|
|
11
|
-
export const templates = {
|
|
12
|
-
'pd.wizard.button.back': `Zurück`,
|
|
13
|
-
'pd.wizard.button.next': `Weiter`,
|
|
14
|
-
'pd.wizard.button.send': `Absenden`,
|
|
15
|
-
};
|
|
16
|
-
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
// Do not modify this file by hand!
|
|
3
|
-
// Re-generate this file by running lit-localize
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
/* eslint-disable no-irregular-whitespace */
|
|
9
|
-
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
10
|
-
|
|
11
|
-
export const templates = {
|
|
12
|
-
'pd.wizard.button.back': `Back`,
|
|
13
|
-
'pd.wizard.button.next': `Next`,
|
|
14
|
-
'pd.wizard.button.send': `Submit`,
|
|
15
|
-
};
|
|
16
|
-
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import { html } from 'lit';
|
|
2
|
-
import '../../pd-wizard.js';
|
|
3
|
-
|
|
4
|
-
export default {
|
|
5
|
-
title: 'PdWizard',
|
|
6
|
-
component: 'pd-wizard',
|
|
7
|
-
argTypes: {
|
|
8
|
-
title: { control: 'text' },
|
|
9
|
-
counter: { control: 'number' },
|
|
10
|
-
textColor: { control: 'color' },
|
|
11
|
-
},
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
function Template({ title = 'Hello world', counter = 5, textColor, slot }) {
|
|
15
|
-
return html`
|
|
16
|
-
<pd-wizard
|
|
17
|
-
style="--pd-wizard-text-color: ${textColor || 'black'}"
|
|
18
|
-
.title=${title}
|
|
19
|
-
.counter=${counter}
|
|
20
|
-
>
|
|
21
|
-
${slot}
|
|
22
|
-
</pd-wizard>
|
|
23
|
-
`;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
export const Regular = Template.bind({});
|
|
27
|
-
|
|
28
|
-
export const CustomTitle = Template.bind({});
|
|
29
|
-
CustomTitle.args = {
|
|
30
|
-
title: 'My title',
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
export const CustomCounter = Template.bind({});
|
|
34
|
-
CustomCounter.args = {
|
|
35
|
-
counter: 123456,
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
export const SlottedContent = Template.bind({});
|
|
39
|
-
SlottedContent.args = {
|
|
40
|
-
slot: html`<p>Slotted content</p>`,
|
|
41
|
-
};
|
|
42
|
-
SlottedContent.argTypes = {
|
|
43
|
-
slot: { table: { disable: true } },
|
|
44
|
-
};
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { html } from 'lit';
|
|
2
|
-
import '../PdSteps.js';
|
|
3
|
-
|
|
4
|
-
export default {
|
|
5
|
-
title: 'Squi-Components/UI/Steps',
|
|
6
|
-
component: 'squi-steps',
|
|
7
|
-
argTypes: {
|
|
8
|
-
|
|
9
|
-
},
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
function StepsTemplate({ steps, currentStepNr, styleTyp }) {
|
|
13
|
-
return html`
|
|
14
|
-
<squi-steps currentStepNr="${currentStepNr}" .steps="${steps}" styleTyp=${styleTyp}>
|
|
15
|
-
</squi-steps>
|
|
16
|
-
`;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export const CircleNumber = StepsTemplate.bind({});
|
|
20
|
-
CircleNumber.args = {
|
|
21
|
-
steps: [{name: 'Step 1'}, {name: 'Step 2'}, {name: 'Step 3'}, {name: 'Step 4'}],
|
|
22
|
-
currentStepNr: 2,
|
|
23
|
-
styleTyp: 'circle'
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
export const TabStyle = StepsTemplate.bind({});
|
|
27
|
-
TabStyle.args = {
|
|
28
|
-
steps: [{name: 'Repair'}, {name: 'Billing'}],
|
|
29
|
-
currentStepNr: 1,
|
|
30
|
-
styleTyp: 'tab'
|
|
31
|
-
};
|
|
32
|
-
|
|
@@ -1,171 +0,0 @@
|
|
|
1
|
-
import { html } from 'lit';
|
|
2
|
-
import '../../pd-wizard.js';
|
|
3
|
-
|
|
4
|
-
export default {
|
|
5
|
-
title: 'PdWizard/Wizard',
|
|
6
|
-
component: 'pd-wizard',
|
|
7
|
-
argTypes: {},
|
|
8
|
-
};
|
|
9
|
-
|
|
10
|
-
function WizardTemplate({ wizardSteps, currentNumber }) {
|
|
11
|
-
|
|
12
|
-
let currentNr = currentNumber;
|
|
13
|
-
|
|
14
|
-
return html`
|
|
15
|
-
<pd-wizard
|
|
16
|
-
id="wizardId"
|
|
17
|
-
.wizardSteps="${wizardSteps}"
|
|
18
|
-
class="small-size_"
|
|
19
|
-
currentNumber="${currentNr}"
|
|
20
|
-
@previous-step="${() => {currentNr -= 1; console.log("Hier hin");}}"
|
|
21
|
-
@next-step="${() => {currentNr -= 1; console.log("Hier hin");}}"
|
|
22
|
-
>
|
|
23
|
-
<div slot="step-1">
|
|
24
|
-
<h2>Das ist ein Titel 1</h2>
|
|
25
|
-
<p>Hier steht etwtwas Text. In der Regel aber kommt direkt eine Form.</p>
|
|
26
|
-
</div>
|
|
27
|
-
<div slot="step-2">
|
|
28
|
-
<h2>Das ist ein Titel 2</h2>
|
|
29
|
-
<p>Hier steht etwtwas Text. In der Regel aber kommt direkt eine Form. Das ist jetzt ein löanger Text um zu gucken wie es so aussieht. er sollte schön umbrechen und mittig das ganze platzieren.</p>
|
|
30
|
-
<h2>Das ist ein Titel 2</h2>
|
|
31
|
-
<p>Hier steht etwtwas Text. In der Regel aber kommt direkt eine Form. Das ist jetzt ein löanger Text um zu gucken wie es so aussieht. er sollte schön umbrechen und mittig das ganze platzieren.</p>
|
|
32
|
-
<h2>Das ist ein Titel 2</h2>
|
|
33
|
-
<p>Hier steht etwtwas Text. In der Regel aber kommt direkt eine Form. Das ist jetzt ein löanger Text um zu gucken wie es so aussieht. er sollte schön umbrechen und mittig das ganze platzieren.</p>
|
|
34
|
-
<h2>Das ist ein Titel 2</h2>
|
|
35
|
-
<p>Hier steht etwtwas Text. In der Regel aber kommt direkt eine Form. Das ist jetzt ein löanger Text um zu gucken wie es so aussieht. er sollte schön umbrechen und mittig das ganze platzieren.</p>
|
|
36
|
-
<h2>Das ist ein Titel 2</h2>
|
|
37
|
-
<p>Hier steht etwtwas Text. In der Regel aber kommt direkt eine Form. Das ist jetzt ein löanger Text um zu gucken wie es so aussieht. er sollte schön umbrechen und mittig das ganze platzieren.</p>
|
|
38
|
-
<h2>Das ist ein Titel 2</h2>
|
|
39
|
-
<p>Hier steht etwtwas Text. In der Regel aber kommt direkt eine Form. Das ist jetzt ein löanger Text um zu gucken wie es so aussieht. er sollte schön umbrechen und mittig das ganze platzieren.</p>
|
|
40
|
-
<h2>Das ist ein Titel 2</h2>
|
|
41
|
-
<p>Hier steht etwtwas Text. In der Regel aber kommt direkt eine Form. Das ist jetzt ein löanger Text um zu gucken wie es so aussieht. er sollte schön umbrechen und mittig das ganze platzieren.</p>
|
|
42
|
-
<h2>Das ist ein Titel 2</h2>
|
|
43
|
-
<p>Hier steht etwtwas Text. In der Regel aber kommt direkt eine Form. Das ist jetzt ein löanger Text um zu gucken wie es so aussieht. er sollte schön umbrechen und mittig das ganze platzieren.</p>
|
|
44
|
-
</div>
|
|
45
|
-
<div slot="step-3">Test 3</div>
|
|
46
|
-
<div slot="step-4">Test 4</div>
|
|
47
|
-
</pd-wizard>
|
|
48
|
-
`;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
function WizardPanelTemplate({ wizardSteps, currentNumber }) {
|
|
52
|
-
|
|
53
|
-
let currentNr = currentNumber;
|
|
54
|
-
|
|
55
|
-
return html`
|
|
56
|
-
|
|
57
|
-
<style>
|
|
58
|
-
:host {
|
|
59
|
-
display: block;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
:host {
|
|
63
|
-
display: block;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
/* The Modal (background) */
|
|
67
|
-
.modal {
|
|
68
|
-
position: fixed; /* Stay in place */
|
|
69
|
-
left: 0;
|
|
70
|
-
top: 0;
|
|
71
|
-
z-index: 100; /* Sit on top */
|
|
72
|
-
|
|
73
|
-
display: flex;
|
|
74
|
-
align-items: center;
|
|
75
|
-
justify-content: center;
|
|
76
|
-
|
|
77
|
-
width: 100%; /* Full width */
|
|
78
|
-
height: 100%; /* Full height */
|
|
79
|
-
overflow: hidden;
|
|
80
|
-
/* RGBA Wert muss hier verwendet werden #AFC1D2 to rgba for opacity */
|
|
81
|
-
background-color: var(--pd-modal-panel-bg-rgba, rgba(175, 193, 210, 0.8));
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
.content {
|
|
85
|
-
background-color: var(--pd-modal-panel-content-bg-col, var(--pd-default-bg-col, #edf7fd));
|
|
86
|
-
border: 2px solid var(--pd-modal-panel-content-border-col, var(--pd-default-col, #067394));
|
|
87
|
-
border-radius: 5px;
|
|
88
|
-
|
|
89
|
-
height: var(--pd-modal-panel-content-height, auto);
|
|
90
|
-
height: var(--pd-modal-panel-content-min-height, auto);
|
|
91
|
-
max-height: var(--pd-modal-panel-content-max-height, auto);
|
|
92
|
-
min-width: var(--pd-modal-panel-content-min-width, auto);
|
|
93
|
-
padding: var(--pd-modal-panel-content-padding, 0);
|
|
94
|
-
margin: var(--pd-modal-panel-content-margin, 1em);
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
.event-details-panel {
|
|
98
|
-
--pd-modal-panel-content-bg-col: white;
|
|
99
|
-
--pd-modal-panel-content-max-height: 90%;
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
.event-wizard-panel {
|
|
103
|
-
--pd-modal-panel-content-min-width: 60%;
|
|
104
|
-
--pd-modal-panel-content-min-height: 45em;
|
|
105
|
-
--pd-steps-padding-top: 0px;
|
|
106
|
-
}
|
|
107
|
-
</style>
|
|
108
|
-
|
|
109
|
-
<div id="modalId" class="modal event-wizard-panel">
|
|
110
|
-
<div class="content">
|
|
111
|
-
|
|
112
|
-
<pd-wizard
|
|
113
|
-
id="wizardId"
|
|
114
|
-
panelWizard
|
|
115
|
-
.wizardSteps="${wizardSteps}"
|
|
116
|
-
currentNumber="${currentNr}"
|
|
117
|
-
@previous-step="${() => {currentNr -= 1; console.log("Hier hin");}}"
|
|
118
|
-
@next-step="${() => {currentNr -= 1; console.log("Hier hin");}}"
|
|
119
|
-
>
|
|
120
|
-
<div slot="step-1">
|
|
121
|
-
<h2>Das ist ein Titel 1</h2>
|
|
122
|
-
<p>Hier steht etwtwas Text. In der Regel aber kommt direkt eine Form.</p>
|
|
123
|
-
</div>
|
|
124
|
-
<div slot="step-2">
|
|
125
|
-
<h2>Das ist ein Titel 2</h2>
|
|
126
|
-
<p>Hier steht etwtwas Text. In der Regel aber kommt direkt eine Form. Das ist jetzt ein löanger Text um zu gucken wie es so aussieht. er sollte schön umbrechen und mittig das ganze platzieren.</p>
|
|
127
|
-
<h2>Das ist ein Titel 2</h2>
|
|
128
|
-
<p>Hier steht etwtwas Text. In der Regel aber kommt direkt eine Form. Das ist jetzt ein löanger Text um zu gucken wie es so aussieht. er sollte schön umbrechen und mittig das ganze platzieren.</p>
|
|
129
|
-
<h2>Das ist ein Titel 2</h2>
|
|
130
|
-
<p>Hier steht etwtwas Text. In der Regel aber kommt direkt eine Form. Das ist jetzt ein löanger Text um zu gucken wie es so aussieht. er sollte schön umbrechen und mittig das ganze platzieren.</p>
|
|
131
|
-
<h2>Das ist ein Titel 2</h2>
|
|
132
|
-
<p>Hier steht etwtwas Text. In der Regel aber kommt direkt eine Form. Das ist jetzt ein löanger Text um zu gucken wie es so aussieht. er sollte schön umbrechen und mittig das ganze platzieren.</p>
|
|
133
|
-
<h2>Das ist ein Titel 2</h2>
|
|
134
|
-
<p>Hier steht etwtwas Text. In der Regel aber kommt direkt eine Form. Das ist jetzt ein löanger Text um zu gucken wie es so aussieht. er sollte schön umbrechen und mittig das ganze platzieren.</p>
|
|
135
|
-
<h2>Das ist ein Titel 2</h2>
|
|
136
|
-
<p>Hier steht etwtwas Text. In der Regel aber kommt direkt eine Form. Das ist jetzt ein löanger Text um zu gucken wie es so aussieht. er sollte schön umbrechen und mittig das ganze platzieren.</p>
|
|
137
|
-
<h2>Das ist ein Titel 2</h2>
|
|
138
|
-
<p>Hier steht etwtwas Text. In der Regel aber kommt direkt eine Form. Das ist jetzt ein löanger Text um zu gucken wie es so aussieht. er sollte schön umbrechen und mittig das ganze platzieren.</p>
|
|
139
|
-
<h2>Das ist ein Titel 2</h2>
|
|
140
|
-
<p>Hier steht etwtwas Text. In der Regel aber kommt direkt eine Form. Das ist jetzt ein löanger Text um zu gucken wie es so aussieht. er sollte schön umbrechen und mittig das ganze platzieren.</p>
|
|
141
|
-
</div>
|
|
142
|
-
<div slot="step-3">Test 3</div>
|
|
143
|
-
<div slot="step-4">Test 4</div>
|
|
144
|
-
</pd-wizard>
|
|
145
|
-
|
|
146
|
-
</div>
|
|
147
|
-
</div>
|
|
148
|
-
`;
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
export const Wizard = WizardTemplate.bind({});
|
|
152
|
-
Wizard.args = {
|
|
153
|
-
wizardSteps: [
|
|
154
|
-
{ title: 'Step 1', name: 'Step 1' },
|
|
155
|
-
{ title: 'Maintenance Bronze', name: 'Step 2' },
|
|
156
|
-
{ title: 'Step 3', name: 'Step 3' },
|
|
157
|
-
{ title: 'Step 4', name: 'Step 4' },
|
|
158
|
-
],
|
|
159
|
-
currentNumber: 2,
|
|
160
|
-
};
|
|
161
|
-
|
|
162
|
-
export const WizardPanel = WizardPanelTemplate.bind({});
|
|
163
|
-
WizardPanel.args = {
|
|
164
|
-
wizardSteps: [
|
|
165
|
-
{ title: 'Step 1', name: 'Step 1' },
|
|
166
|
-
{ title: 'Maintenance Bronze', name: 'Step 2' },
|
|
167
|
-
{ title: 'Step 3', name: 'Step 3' },
|
|
168
|
-
{ title: 'Step 4', name: 'Step 4' },
|
|
169
|
-
],
|
|
170
|
-
currentNumber: 2,
|
|
171
|
-
};
|
package/test/pd-wizard.test.js
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { html } from 'lit';
|
|
2
|
-
import { fixture, expect } from '@open-wc/testing';
|
|
3
|
-
|
|
4
|
-
import '../pd-wizard.js';
|
|
5
|
-
|
|
6
|
-
describe('PdWizard', () => {
|
|
7
|
-
it('has a default title "Hey there" and counter 5', async () => {
|
|
8
|
-
const el = await fixture(html`<pd-wizard></pd-wizard>`);
|
|
9
|
-
|
|
10
|
-
expect(el.title).to.equal('Hey there');
|
|
11
|
-
expect(el.counter).to.equal(5);
|
|
12
|
-
});
|
|
13
|
-
|
|
14
|
-
it('increases the counter on button click', async () => {
|
|
15
|
-
const el = await fixture(html`<pd-wizard></pd-wizard>`);
|
|
16
|
-
el.shadowRoot.querySelector('button').click();
|
|
17
|
-
|
|
18
|
-
expect(el.counter).to.equal(6);
|
|
19
|
-
});
|
|
20
|
-
|
|
21
|
-
it('can override the title via attribute', async () => {
|
|
22
|
-
const el = await fixture(
|
|
23
|
-
html`<pd-wizard title="attribute title"></pd-wizard>`
|
|
24
|
-
);
|
|
25
|
-
|
|
26
|
-
expect(el.title).to.equal('attribute title');
|
|
27
|
-
});
|
|
28
|
-
|
|
29
|
-
it('passes the a11y audit', async () => {
|
|
30
|
-
const el = await fixture(html`<pd-wizard></pd-wizard>`);
|
|
31
|
-
|
|
32
|
-
await expect(el).shadowDom.to.be.accessible();
|
|
33
|
-
});
|
|
34
|
-
});
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
// import { hmrPlugin, presets } from '@open-wc/dev-server-hmr';
|
|
2
|
-
|
|
3
|
-
/** Use Hot Module replacement by adding --hmr to the start command */
|
|
4
|
-
const hmr = process.argv.includes('--hmr');
|
|
5
|
-
|
|
6
|
-
export default /** @type {import('@web/dev-server').DevServerConfig} */ ({
|
|
7
|
-
open: '/demo/',
|
|
8
|
-
/** Use regular watch mode if HMR is not enabled. */
|
|
9
|
-
watch: !hmr,
|
|
10
|
-
/** Resolve bare module imports */
|
|
11
|
-
nodeResolve: {
|
|
12
|
-
exportConditions: ['browser', 'development'],
|
|
13
|
-
},
|
|
14
|
-
|
|
15
|
-
/** Compile JS for older browsers. Requires @web/dev-server-esbuild plugin */
|
|
16
|
-
// esbuildTarget: 'auto'
|
|
17
|
-
|
|
18
|
-
/** Set appIndex to enable SPA routing */
|
|
19
|
-
// appIndex: 'demo/index.html',
|
|
20
|
-
|
|
21
|
-
plugins: [
|
|
22
|
-
/** Use Hot Module Replacement by uncommenting. Requires @open-wc/dev-server-hmr plugin */
|
|
23
|
-
// hmr && hmrPlugin({ exclude: ['**/*/node_modules/**/*'], presets: [presets.litElement] }),
|
|
24
|
-
],
|
|
25
|
-
|
|
26
|
-
// See documentation for all available options
|
|
27
|
-
});
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
// import { playwrightLauncher } from '@web/test-runner-playwright';
|
|
2
|
-
|
|
3
|
-
const filteredLogs = ['Running in dev mode', 'lit-html is in dev mode'];
|
|
4
|
-
|
|
5
|
-
export default /** @type {import("@web/test-runner").TestRunnerConfig} */ ({
|
|
6
|
-
/** Test files to run */
|
|
7
|
-
files: 'test/**/*.test.js',
|
|
8
|
-
|
|
9
|
-
/** Resolve bare module imports */
|
|
10
|
-
nodeResolve: {
|
|
11
|
-
exportConditions: ['browser', 'development'],
|
|
12
|
-
},
|
|
13
|
-
|
|
14
|
-
/** Filter out lit dev mode logs */
|
|
15
|
-
filterBrowserLogs(log) {
|
|
16
|
-
for (const arg of log.args) {
|
|
17
|
-
if (typeof arg === 'string' && filteredLogs.some(l => arg.includes(l))) {
|
|
18
|
-
return false;
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
return true;
|
|
22
|
-
},
|
|
23
|
-
|
|
24
|
-
/** Compile JS for older browsers. Requires @web/dev-server-esbuild plugin */
|
|
25
|
-
// esbuildTarget: 'auto',
|
|
26
|
-
|
|
27
|
-
/** Amount of browsers to run concurrently */
|
|
28
|
-
// concurrentBrowsers: 2,
|
|
29
|
-
|
|
30
|
-
/** Amount of test files per browser to test concurrently */
|
|
31
|
-
// concurrency: 1,
|
|
32
|
-
|
|
33
|
-
/** Browsers to run tests on */
|
|
34
|
-
// browsers: [
|
|
35
|
-
// playwrightLauncher({ product: 'chromium' }),
|
|
36
|
-
// playwrightLauncher({ product: 'firefox' }),
|
|
37
|
-
// playwrightLauncher({ product: 'webkit' }),
|
|
38
|
-
// ],
|
|
39
|
-
|
|
40
|
-
// See documentation for all available options
|
|
41
|
-
});
|
package/xliff/be.xlf
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
-
<xliff version="1.2" xmlns="urn:oasis:names:tc:xliff:document:1.2">
|
|
3
|
-
<file target-language="be" source-language="de" original="lit-localize-inputs" datatype="plaintext">
|
|
4
|
-
<body>
|
|
5
|
-
<trans-unit id="pd.wizard.button.back">
|
|
6
|
-
<source>Zurück</source>
|
|
7
|
-
<target>Terug</target>
|
|
8
|
-
</trans-unit>
|
|
9
|
-
<trans-unit id="pd.wizard.button.next">
|
|
10
|
-
<source>Weiter</source>
|
|
11
|
-
<target>Volgende</target>
|
|
12
|
-
</trans-unit>
|
|
13
|
-
<trans-unit id="pd.wizard.button.send">
|
|
14
|
-
<source>Absenden</source>
|
|
15
|
-
<target>Verzenden</target>
|
|
16
|
-
</trans-unit>
|
|
17
|
-
</body>
|
|
18
|
-
</file>
|
|
19
|
-
</xliff>
|
package/xliff/de.xlf
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
-
<xliff version="1.2" xmlns="urn:oasis:names:tc:xliff:document:1.2">
|
|
3
|
-
<file target-language="de" source-language="dev" original="lit-localize-inputs" datatype="plaintext">
|
|
4
|
-
<body>
|
|
5
|
-
<trans-unit id="pd.wizard.button.back">
|
|
6
|
-
<source>Zurück</source>
|
|
7
|
-
</trans-unit>
|
|
8
|
-
<trans-unit id="pd.wizard.button.next">
|
|
9
|
-
<source>Weiter</source>
|
|
10
|
-
</trans-unit>
|
|
11
|
-
<trans-unit id="pd.wizard.button.send">
|
|
12
|
-
<source>Absenden</source>
|
|
13
|
-
</trans-unit>
|
|
14
|
-
</body>
|
|
15
|
-
</file>
|
|
16
|
-
</xliff>
|
package/xliff/en.xlf
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
-
<xliff version="1.2" xmlns="urn:oasis:names:tc:xliff:document:1.2">
|
|
3
|
-
<file target-language="en" source-language="de" original="lit-localize-inputs" datatype="plaintext">
|
|
4
|
-
<body>
|
|
5
|
-
<trans-unit id="pd.wizard.button.back">
|
|
6
|
-
<source>Zurück</source>
|
|
7
|
-
<target>Back</target>
|
|
8
|
-
</trans-unit>
|
|
9
|
-
<trans-unit id="pd.wizard.button.next">
|
|
10
|
-
<source>Weiter</source>
|
|
11
|
-
<target>Next</target>
|
|
12
|
-
</trans-unit>
|
|
13
|
-
<trans-unit id="pd.wizard.button.send">
|
|
14
|
-
<source>Absenden</source>
|
|
15
|
-
<target>Submit</target>
|
|
16
|
-
</trans-unit>
|
|
17
|
-
</body>
|
|
18
|
-
</file>
|
|
19
|
-
</xliff>
|