@progressive-development/pd-spa-helper 0.8.10-a → 0.8.10-c
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/defaultpage/default-confirm-popup.d.ts.map +1 -1
- package/dist/defaultpage/default-confirm-popup.js +1 -8
- package/dist/defaultpage/default-dialog-popup.d.ts +6 -4
- package/dist/defaultpage/default-dialog-popup.d.ts.map +1 -1
- package/dist/defaultpage/default-dialog-popup.js +36 -39
- package/dist/defaultpage/default-login.js +1 -1
- package/dist/defaultpage/default-popup.d.ts.map +1 -1
- package/dist/defaultpage/default-popup.js +3 -1
- package/dist/defaultpage/default-step-address.d.ts +7 -17
- package/dist/defaultpage/default-step-address.d.ts.map +1 -1
- package/dist/defaultpage/default-step-address.js +21 -18
- package/dist/defaultpage/default-step-summary.d.ts +3 -5
- package/dist/defaultpage/default-step-summary.d.ts.map +1 -1
- package/dist/defaultpage/default-step-summary.js +9 -15
- package/dist/defaultpage/default-wizard.d.ts +11 -7
- package/dist/defaultpage/default-wizard.d.ts.map +1 -1
- package/dist/defaultpage/default-wizard.js +113 -110
- package/dist/defaultpage/pd-default-wizard-step.d.ts +58 -0
- package/dist/defaultpage/pd-default-wizard-step.d.ts.map +1 -0
- package/dist/defaultpage/pd-default-wizard-step.js +140 -0
- package/dist/generated/locale-wrapper/be-wrapper.d.ts +6 -1
- package/dist/generated/locale-wrapper/be-wrapper.d.ts.map +1 -1
- package/dist/generated/locale-wrapper/de-wrapper.d.ts +7 -2
- package/dist/generated/locale-wrapper/de-wrapper.d.ts.map +1 -1
- package/dist/generated/locale-wrapper/en-wrapper.d.ts +6 -1
- package/dist/generated/locale-wrapper/en-wrapper.d.ts.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -2
- package/dist/model/spa-model.d.ts +0 -1
- package/dist/model/spa-model.d.ts.map +1 -1
- package/dist/model/spa-model.js +0 -2
- package/dist/service-provider/mock/auth.d.ts.map +1 -1
- package/dist/service-provider/mock/auth.js +2 -1
- package/dist/stories/address-new.stories.d.ts +2 -3
- package/dist/stories/address-new.stories.d.ts.map +1 -1
- package/dist/stories/default-confirm-popup.stories.d.ts +24 -0
- package/dist/stories/default-confirm-popup.stories.d.ts.map +1 -0
- package/dist/stories/default-dialog-popup.stories.d.ts +23 -0
- package/dist/stories/default-dialog-popup.stories.d.ts.map +1 -0
- package/dist/stories/default-login.stories.d.ts +10 -0
- package/dist/stories/default-login.stories.d.ts.map +1 -0
- package/dist/stories/default-popup.stories.d.ts +9 -0
- package/dist/stories/default-popup.stories.d.ts.map +1 -0
- package/dist/stories/test-impls/address-test.d.ts +0 -1
- package/dist/stories/test-impls/address-test.d.ts.map +1 -1
- package/dist/stories/test-impls/test-pages/test-wizard-step.d.ts +17 -0
- package/dist/stories/test-impls/test-pages/test-wizard-step.d.ts.map +1 -0
- package/dist/stories/test-impls/test-pages/test-wizard.d.ts +16 -0
- package/dist/stories/test-impls/test-pages/test-wizard.d.ts.map +1 -0
- package/dist/stories/test-impls/test-popups/default-confirm-popup-test-error.d.ts +8 -0
- package/dist/stories/test-impls/test-popups/default-confirm-popup-test-error.d.ts.map +1 -0
- package/dist/stories/test-impls/test-popups/default-confirm-popup-test-info.d.ts +8 -0
- package/dist/stories/test-impls/test-popups/default-confirm-popup-test-info.d.ts.map +1 -0
- package/dist/stories/test-impls/test-popups/default-confirm-popup-test-warn.d.ts +8 -0
- package/dist/stories/test-impls/test-popups/default-confirm-popup-test-warn.d.ts.map +1 -0
- package/dist/stories/test-impls/test-popups/default-dialog-popup-test.d.ts +13 -0
- package/dist/stories/test-impls/test-popups/default-dialog-popup-test.d.ts.map +1 -0
- package/dist/stories/test-impls/test-popups/default-popup-test.d.ts +5 -0
- package/dist/stories/test-impls/test-popups/default-popup-test.d.ts.map +1 -0
- package/dist/stories/test-wizard-step.stories.d.ts +11 -0
- package/dist/stories/test-wizard-step.stories.d.ts.map +1 -0
- package/dist/stories/test-wizard.stories.d.ts +9 -0
- package/dist/stories/test-wizard.stories.d.ts.map +1 -0
- package/dist/tmpown/pd-login.d.ts +2 -0
- package/dist/tmpown/pd-login.d.ts.map +1 -1
- package/dist/tmpown/pd-login.js +71 -51
- package/package.json +9 -9
- package/dist/defaultpage/default-wizard-step.d.ts +0 -35
- package/dist/defaultpage/default-wizard-step.d.ts.map +0 -1
- package/dist/defaultpage/default-wizard-step.js +0 -121
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { html } from "lit";
|
|
2
|
-
import {
|
|
2
|
+
import { state } from "lit/decorators.js";
|
|
3
3
|
import { msg } from "@lit/localize";
|
|
4
4
|
import "@progressive-development/pd-dialog/pd-popup-dialog";
|
|
5
5
|
import "@progressive-development/pd-wizard/pd-wizard";
|
|
6
6
|
import { DefaultViewPage } from "./default-view-page.js";
|
|
7
|
-
import { RUNNING_WIZARD_STORAGE_ELEMENTS } from "../model/spa-model.js";
|
|
8
7
|
import { WizardReloadPopup } from "../popup/wizard-reload-popup.js";
|
|
9
8
|
import { WizardClosePopup } from "../popup/wizard-close-popup.js";
|
|
10
9
|
import { ABORT_EVENT_NAME, STORE_EVENT_NAME } from "./default-confirm-popup.js";
|
|
@@ -18,6 +17,7 @@ var __decorateClass = (decorators, target, key, kind) => {
|
|
|
18
17
|
if (result) __defProp(target, key, result);
|
|
19
18
|
return result;
|
|
20
19
|
};
|
|
20
|
+
const RUNNING_WIZARD_STORAGE_ELEMENTS = "pd.spa.local.wizard.storage";
|
|
21
21
|
const wizzardLogger = createLogger("PdDefaultWizard");
|
|
22
22
|
const _DefaultWizard = class _DefaultWizard2 extends DefaultViewPage {
|
|
23
23
|
constructor() {
|
|
@@ -26,6 +26,12 @@ const _DefaultWizard = class _DefaultWizard2 extends DefaultViewPage {
|
|
|
26
26
|
this._roundedBorder = false;
|
|
27
27
|
this._currentOrderStep = 1;
|
|
28
28
|
}
|
|
29
|
+
update(changedProps) {
|
|
30
|
+
if (changedProps.has("_withLocalStorageId") && this._withLocalStorageId) {
|
|
31
|
+
this._reloadFromStorage(this._withLocalStorageId);
|
|
32
|
+
}
|
|
33
|
+
super.update(changedProps);
|
|
34
|
+
}
|
|
29
35
|
render() {
|
|
30
36
|
return html`
|
|
31
37
|
<pd-wizard
|
|
@@ -45,97 +51,6 @@ const _DefaultWizard = class _DefaultWizard2 extends DefaultViewPage {
|
|
|
45
51
|
</pd-wizard>
|
|
46
52
|
`;
|
|
47
53
|
}
|
|
48
|
-
// eslint-disable-next-line class-methods-use-this
|
|
49
|
-
getWizardStorage() {
|
|
50
|
-
const storageEl = localStorage.getItem(RUNNING_WIZARD_STORAGE_ELEMENTS);
|
|
51
|
-
return storageEl ? JSON.parse(storageEl) : {};
|
|
52
|
-
}
|
|
53
|
-
_reloadFromStorage(storageKey) {
|
|
54
|
-
var _a;
|
|
55
|
-
wizzardLogger.debug(`call _reloadFromStorage ${storageKey}`);
|
|
56
|
-
if (storageKey) {
|
|
57
|
-
const storageEl = this.getWizardStorage()[storageKey];
|
|
58
|
-
wizzardLogger.debug("reload storageEl", storageEl);
|
|
59
|
-
if (storageEl && storageEl.orderFormData !== void 0) {
|
|
60
|
-
const popup = new WizardReloadPopup();
|
|
61
|
-
popup.reloadItem = storageEl;
|
|
62
|
-
popup.okButtonText = msg("Fortsetzen", {
|
|
63
|
-
id: "spaH.wizard.reload.popup.ok"
|
|
64
|
-
});
|
|
65
|
-
popup.cancelButtonText = msg("Verwerfen", {
|
|
66
|
-
id: "spaH.wizard.reload.popup.cancel"
|
|
67
|
-
});
|
|
68
|
-
popup.addEventListener(ABORT_EVENT_NAME, () => {
|
|
69
|
-
var _a2;
|
|
70
|
-
this._removeFromStorage();
|
|
71
|
-
(_a2 = this.shadowRoot) == null ? void 0 : _a2.removeChild(popup);
|
|
72
|
-
});
|
|
73
|
-
popup.addEventListener(STORE_EVENT_NAME, () => {
|
|
74
|
-
var _a2, _b;
|
|
75
|
-
wizzardLogger.debug(
|
|
76
|
-
`Reload storage element from ${storageEl.timestamp}`
|
|
77
|
-
);
|
|
78
|
-
this._orderFormData = storageEl.orderFormData;
|
|
79
|
-
this._currentOrderStep = storageEl.wizardStep;
|
|
80
|
-
(_a2 = this.shadowRoot) == null ? void 0 : _a2.removeChild(popup);
|
|
81
|
-
for (let stepNr = 1; stepNr <= this._wizardSteps.length; stepNr += 1) {
|
|
82
|
-
const stepId = `wiz${stepNr}Id`;
|
|
83
|
-
const stepElement = (_b = this.shadowRoot) == null ? void 0 : _b.getElementById(
|
|
84
|
-
stepId
|
|
85
|
-
);
|
|
86
|
-
if (stepElement && typeof stepElement.reloadFromOrder === "function") {
|
|
87
|
-
stepElement.reloadFromOrder(this._orderFormData);
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
});
|
|
91
|
-
(_a = this.shadowRoot) == null ? void 0 : _a.appendChild(popup);
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
_doStorageEventUpdate(event) {
|
|
96
|
-
if (event.detail) {
|
|
97
|
-
wizzardLogger.debug(
|
|
98
|
-
"event detail set, store prepared data: ",
|
|
99
|
-
event.detail
|
|
100
|
-
);
|
|
101
|
-
const preparedOrder = {
|
|
102
|
-
...this._orderFormData || {},
|
|
103
|
-
...event.detail
|
|
104
|
-
};
|
|
105
|
-
this._doStorageUpdate(preparedOrder);
|
|
106
|
-
}
|
|
107
|
-
event.stopPropagation();
|
|
108
|
-
}
|
|
109
|
-
_doStorageUpdate(preparedOrderForm) {
|
|
110
|
-
if (this._withLocalStorageId) {
|
|
111
|
-
const storageWizard = this.getWizardStorage();
|
|
112
|
-
storageWizard[this._withLocalStorageId] = {
|
|
113
|
-
orderFormData: preparedOrderForm || this._orderFormData,
|
|
114
|
-
wizardStep: this._currentOrderStep,
|
|
115
|
-
timestamp: (/* @__PURE__ */ new Date()).toUTCString()
|
|
116
|
-
};
|
|
117
|
-
localStorage.setItem(
|
|
118
|
-
RUNNING_WIZARD_STORAGE_ELEMENTS,
|
|
119
|
-
JSON.stringify(storageWizard)
|
|
120
|
-
);
|
|
121
|
-
wizzardLogger.debug(
|
|
122
|
-
`Update wizard local storage for key ${this._withLocalStorageId}`
|
|
123
|
-
);
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
_removeFromStorage() {
|
|
127
|
-
if (this._withLocalStorageId) {
|
|
128
|
-
const storageWizard = this.getWizardStorage();
|
|
129
|
-
delete storageWizard[this._withLocalStorageId];
|
|
130
|
-
localStorage.setItem(
|
|
131
|
-
RUNNING_WIZARD_STORAGE_ELEMENTS,
|
|
132
|
-
JSON.stringify(storageWizard)
|
|
133
|
-
);
|
|
134
|
-
wizzardLogger.debug(
|
|
135
|
-
`Remove wizard local storage for key ${this._withLocalStorageId}`
|
|
136
|
-
);
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
54
|
_nextStep(e) {
|
|
140
55
|
var _a;
|
|
141
56
|
const setNextStep = () => {
|
|
@@ -149,36 +64,29 @@ const _DefaultWizard = class _DefaultWizard2 extends DefaultViewPage {
|
|
|
149
64
|
}
|
|
150
65
|
}
|
|
151
66
|
};
|
|
152
|
-
const detail = {
|
|
153
|
-
errorMap: /* @__PURE__ */ new Map(),
|
|
154
|
-
formData: {},
|
|
155
|
-
currentOrder: this._orderFormData
|
|
156
|
-
};
|
|
157
67
|
const curentStepEl = (_a = this.shadowRoot) == null ? void 0 : _a.getElementById(
|
|
158
68
|
`wiz${this._currentOrderStep}Id`
|
|
159
69
|
);
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
if (detail.preparedOrder) {
|
|
163
|
-
this._orderFormData = detail.preparedOrder;
|
|
164
|
-
}
|
|
70
|
+
if (curentStepEl == null ? void 0 : curentStepEl.valid) {
|
|
71
|
+
this._orderFormData = curentStepEl.setFormData(this._orderFormData);
|
|
165
72
|
if (this._wizardSteps.length === this._currentOrderStep) {
|
|
166
|
-
e.detail.submited = true;
|
|
167
73
|
this._submitWizard();
|
|
168
74
|
} else {
|
|
169
75
|
setNextStep();
|
|
170
76
|
}
|
|
171
77
|
} else {
|
|
172
|
-
|
|
78
|
+
curentStepEl == null ? void 0 : curentStepEl.triggerValidate();
|
|
173
79
|
}
|
|
80
|
+
e.stopPropagation();
|
|
174
81
|
}
|
|
175
|
-
_previousStep() {
|
|
82
|
+
_previousStep(e) {
|
|
176
83
|
if (this._currentOrderStep > 1) {
|
|
177
84
|
this._currentOrderStep -= 1;
|
|
178
85
|
if (!this.panelWizard) {
|
|
179
86
|
_DefaultWizard2._timeOutScroll();
|
|
180
87
|
}
|
|
181
88
|
}
|
|
89
|
+
e.stopPropagation();
|
|
182
90
|
}
|
|
183
91
|
_goToStep(e) {
|
|
184
92
|
const stepNr = e.detail.step;
|
|
@@ -188,6 +96,7 @@ const _DefaultWizard = class _DefaultWizard2 extends DefaultViewPage {
|
|
|
188
96
|
_DefaultWizard2._timeOutScroll();
|
|
189
97
|
}
|
|
190
98
|
}
|
|
99
|
+
e.stopPropagation();
|
|
191
100
|
}
|
|
192
101
|
_closeWizardRequest() {
|
|
193
102
|
var _a, _b;
|
|
@@ -233,6 +142,100 @@ const _DefaultWizard = class _DefaultWizard2 extends DefaultViewPage {
|
|
|
233
142
|
(_b = this.shadowRoot) == null ? void 0 : _b.appendChild(popup);
|
|
234
143
|
}
|
|
235
144
|
}
|
|
145
|
+
_reloadFromStorage(storageKey) {
|
|
146
|
+
var _a;
|
|
147
|
+
wizzardLogger.debug(`call _reloadFromStorage ${storageKey}`);
|
|
148
|
+
if (storageKey) {
|
|
149
|
+
const storageEl = this.getWizardStorage()[storageKey];
|
|
150
|
+
wizzardLogger.debug("reload storageEl", storageEl);
|
|
151
|
+
if (storageEl && storageEl.orderFormData !== void 0) {
|
|
152
|
+
const popup = new WizardReloadPopup();
|
|
153
|
+
popup.reloadItem = storageEl;
|
|
154
|
+
popup.okButtonText = msg("Fortsetzen", {
|
|
155
|
+
id: "spaH.wizard.reload.popup.ok"
|
|
156
|
+
});
|
|
157
|
+
popup.cancelButtonText = msg("Verwerfen", {
|
|
158
|
+
id: "spaH.wizard.reload.popup.cancel"
|
|
159
|
+
});
|
|
160
|
+
popup.addEventListener(ABORT_EVENT_NAME, () => {
|
|
161
|
+
var _a2;
|
|
162
|
+
this._removeFromStorage();
|
|
163
|
+
(_a2 = this.shadowRoot) == null ? void 0 : _a2.removeChild(popup);
|
|
164
|
+
});
|
|
165
|
+
popup.addEventListener(STORE_EVENT_NAME, () => {
|
|
166
|
+
var _a2, _b;
|
|
167
|
+
wizzardLogger.debug(
|
|
168
|
+
`Reload storage element from ${storageEl.timestamp}`
|
|
169
|
+
);
|
|
170
|
+
this._orderFormData = storageEl.orderFormData;
|
|
171
|
+
this._currentOrderStep = storageEl.wizardStep;
|
|
172
|
+
(_a2 = this.shadowRoot) == null ? void 0 : _a2.removeChild(popup);
|
|
173
|
+
for (let stepNr = 1; stepNr <= this._wizardSteps.length; stepNr += 1) {
|
|
174
|
+
const stepId = `wiz${stepNr}Id`;
|
|
175
|
+
const stepElement = (_b = this.shadowRoot) == null ? void 0 : _b.getElementById(stepId);
|
|
176
|
+
if (stepElement && typeof stepElement.reloadFromOrder === "function") {
|
|
177
|
+
stepElement.reloadFromOrder(this._orderFormData);
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
});
|
|
181
|
+
(_a = this.shadowRoot) == null ? void 0 : _a.appendChild(popup);
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
_doStorageUpdate(preparedOrderForm) {
|
|
186
|
+
if (this._withLocalStorageId) {
|
|
187
|
+
const storageWizard = this.getWizardStorage();
|
|
188
|
+
storageWizard[this._withLocalStorageId] = {
|
|
189
|
+
orderFormData: preparedOrderForm || this._orderFormData,
|
|
190
|
+
wizardStep: this._currentOrderStep,
|
|
191
|
+
timestamp: (/* @__PURE__ */ new Date()).toUTCString()
|
|
192
|
+
};
|
|
193
|
+
localStorage.setItem(
|
|
194
|
+
RUNNING_WIZARD_STORAGE_ELEMENTS,
|
|
195
|
+
JSON.stringify(storageWizard)
|
|
196
|
+
);
|
|
197
|
+
wizzardLogger.debug(
|
|
198
|
+
`Update wizard local storage for key ${this._withLocalStorageId}`
|
|
199
|
+
);
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
_removeFromStorage() {
|
|
203
|
+
if (this._withLocalStorageId) {
|
|
204
|
+
const storageWizard = this.getWizardStorage();
|
|
205
|
+
delete storageWizard[this._withLocalStorageId];
|
|
206
|
+
localStorage.setItem(
|
|
207
|
+
RUNNING_WIZARD_STORAGE_ELEMENTS,
|
|
208
|
+
JSON.stringify(storageWizard)
|
|
209
|
+
);
|
|
210
|
+
wizzardLogger.debug(
|
|
211
|
+
`Remove wizard local storage for key ${this._withLocalStorageId}`
|
|
212
|
+
);
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
getWizardStorage() {
|
|
216
|
+
const storageEl = localStorage.getItem(RUNNING_WIZARD_STORAGE_ELEMENTS);
|
|
217
|
+
return storageEl ? JSON.parse(storageEl) : {};
|
|
218
|
+
}
|
|
219
|
+
/**
|
|
220
|
+
* Updates internal storage on storage update events.
|
|
221
|
+
*/
|
|
222
|
+
_doStorageEventUpdate(event) {
|
|
223
|
+
if (!this._withLocalStorageId) {
|
|
224
|
+
return;
|
|
225
|
+
}
|
|
226
|
+
if (event.detail) {
|
|
227
|
+
wizzardLogger.debug(
|
|
228
|
+
"event detail set, store prepared data: ",
|
|
229
|
+
event.detail
|
|
230
|
+
);
|
|
231
|
+
const preparedOrder = {
|
|
232
|
+
...this._orderFormData || {},
|
|
233
|
+
...event.detail
|
|
234
|
+
};
|
|
235
|
+
this._doStorageUpdate(preparedOrder);
|
|
236
|
+
}
|
|
237
|
+
event.stopPropagation();
|
|
238
|
+
}
|
|
236
239
|
static _timeOutScroll() {
|
|
237
240
|
window.setTimeout(() => {
|
|
238
241
|
window.scrollTo({
|
|
@@ -244,16 +247,16 @@ const _DefaultWizard = class _DefaultWizard2 extends DefaultViewPage {
|
|
|
244
247
|
}
|
|
245
248
|
};
|
|
246
249
|
__decorateClass([
|
|
247
|
-
|
|
250
|
+
state()
|
|
248
251
|
], _DefaultWizard.prototype, "_wizardSteps");
|
|
249
252
|
__decorateClass([
|
|
250
|
-
|
|
253
|
+
state()
|
|
251
254
|
], _DefaultWizard.prototype, "_currentOrderStep");
|
|
252
255
|
__decorateClass([
|
|
253
|
-
|
|
256
|
+
state()
|
|
254
257
|
], _DefaultWizard.prototype, "_orderFormData");
|
|
255
258
|
__decorateClass([
|
|
256
|
-
|
|
259
|
+
state()
|
|
257
260
|
], _DefaultWizard.prototype, "_withLocalStorageId");
|
|
258
261
|
let DefaultWizard = _DefaultWizard;
|
|
259
262
|
export {
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { LitElement, TemplateResult } from 'lit';
|
|
2
|
+
/**
|
|
3
|
+
* Could use as abstract class for own (default) steps for pd-wizard.
|
|
4
|
+
*
|
|
5
|
+
* Contains generics for the OrderFormData (T) and the specific FormData (F) for this Step.
|
|
6
|
+
*/
|
|
7
|
+
export declare abstract class PdDefaultWizardStep<T, F> extends LitElement {
|
|
8
|
+
stepTitle: string;
|
|
9
|
+
stepNumber: number;
|
|
10
|
+
withRequiredInfo: boolean;
|
|
11
|
+
withAutoTrim: boolean;
|
|
12
|
+
protected _errorMsg: string;
|
|
13
|
+
protected _validForm: boolean;
|
|
14
|
+
protected _formElement: {
|
|
15
|
+
triggerValidate: () => Promise<boolean>;
|
|
16
|
+
valid: boolean;
|
|
17
|
+
getValues: () => F;
|
|
18
|
+
};
|
|
19
|
+
render(): TemplateResult<1>;
|
|
20
|
+
get valid(): boolean;
|
|
21
|
+
triggerValidate(): Promise<boolean>;
|
|
22
|
+
setFormData(currentOrder: T): T;
|
|
23
|
+
protected _getTitle(): string;
|
|
24
|
+
protected abstract _renderFormContent(): TemplateResult;
|
|
25
|
+
/**
|
|
26
|
+
* Prepare the order (trigger side-effets) after update from order step.
|
|
27
|
+
* Used to reset the tax after heating (house age) oder contact (business), but could use for anything else.
|
|
28
|
+
*
|
|
29
|
+
* The default implementation just returns the updated order to prevent all clients from implementing the method.
|
|
30
|
+
*
|
|
31
|
+
* @param updatedOrder order with updates from step.
|
|
32
|
+
* @returns preparedOrder - with (e.g. prices) changes triggered by step update.
|
|
33
|
+
*/
|
|
34
|
+
protected _prepareOrderAfterStepUpdate(updatedOrder: T): T;
|
|
35
|
+
/**
|
|
36
|
+
* Returns the prepared data from the form inputs.
|
|
37
|
+
*
|
|
38
|
+
* Is called by setFormData, so the implementing client also haave to override
|
|
39
|
+
* _prepareDataFromForm.
|
|
40
|
+
*
|
|
41
|
+
* @returns preparaed data object from Form
|
|
42
|
+
*/
|
|
43
|
+
protected _prepareDataFromForm(): F;
|
|
44
|
+
protected _isValidFormData(): boolean;
|
|
45
|
+
/**
|
|
46
|
+
* Call from wizard.
|
|
47
|
+
*
|
|
48
|
+
* @param reloadedOrder
|
|
49
|
+
*/
|
|
50
|
+
reloadFromOrder(reloadedOrder: T): void;
|
|
51
|
+
/**
|
|
52
|
+
* Called to hold the current value from form (for aborting order processes).
|
|
53
|
+
* Do not fit perfect in the new form tyle, rethink about it....
|
|
54
|
+
*/
|
|
55
|
+
protected _doInputChange(): void;
|
|
56
|
+
_validateForm(e: any): void;
|
|
57
|
+
}
|
|
58
|
+
//# sourceMappingURL=pd-default-wizard-step.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pd-default-wizard-step.d.ts","sourceRoot":"","sources":["../../src/defaultpage/pd-default-wizard-step.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,UAAU,EAAE,cAAc,EAAE,MAAM,KAAK,CAAC;AAMvD;;;;GAIG;AACH,8BAAsB,mBAAmB,CAAC,CAAC,EAAE,CAAC,CAAE,SAAQ,UAAU;IAEhE,SAAS,EAAE,MAAM,CAAY;IAG7B,UAAU,EAAE,MAAM,CAAK;IAGvB,gBAAgB,EAAE,OAAO,CAAS;IAGlC,YAAY,EAAE,OAAO,CAAQ;IAG7B,SAAS,CAAC,SAAS,EAAE,MAAM,CAAM;IAGjC,SAAS,CAAC,UAAU,EAAE,OAAO,CAAS;IAGtC,SAAS,CAAC,YAAY,EAAG;QACvB,eAAe,EAAE,MAAM,OAAO,CAAC,OAAO,CAAC,CAAC;QACxC,KAAK,EAAE,OAAO,CAAC;QACf,SAAS,EAAE,MAAM,CAAC,CAAC;KACpB,CAAC;IAEO,MAAM;IAgBf,IAAW,KAAK,YAEf;IAEY,eAAe,IAAI,OAAO,CAAC,OAAO,CAAC;IAIzC,WAAW,CAAC,YAAY,EAAE,CAAC,GAAG,CAAC;IAQtC,SAAS,CAAC,SAAS,IAAI,MAAM;IAI7B,SAAS,CAAC,QAAQ,CAAC,kBAAkB,IAAI,cAAc;IAEvD;;;;;;;;OAQG;IAEH,SAAS,CAAC,4BAA4B,CAAC,YAAY,EAAE,CAAC,GAAG,CAAC;IAI1D;;;;;;;OAOG;IACH,SAAS,CAAC,oBAAoB,IAAI,CAAC;IAQnC,SAAS,CAAC,gBAAgB,IAAI,OAAO;IAKrC;;;;OAIG;IAEH,eAAe,CAAC,aAAa,EAAE,CAAC,GAAG,IAAI;IAIvC;;;OAGG;IACH,SAAS,CAAC,cAAc;IAgBxB,aAAa,CAAC,CAAC,EAAE,GAAG;CAwCrB"}
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
import { LitElement, html } from "lit";
|
|
2
|
+
import { property, state, query } from "lit/decorators.js";
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __decorateClass = (decorators, target, key, kind) => {
|
|
5
|
+
var result = void 0;
|
|
6
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
7
|
+
if (decorator = decorators[i])
|
|
8
|
+
result = decorator(target, key, result) || result;
|
|
9
|
+
if (result) __defProp(target, key, result);
|
|
10
|
+
return result;
|
|
11
|
+
};
|
|
12
|
+
const DELAY_TIME = 3e3;
|
|
13
|
+
let timeoutInputRef;
|
|
14
|
+
class PdDefaultWizardStep extends LitElement {
|
|
15
|
+
constructor() {
|
|
16
|
+
super(...arguments);
|
|
17
|
+
this.stepTitle = "Step 1";
|
|
18
|
+
this.stepNumber = 0;
|
|
19
|
+
this.withRequiredInfo = false;
|
|
20
|
+
this.withAutoTrim = true;
|
|
21
|
+
this._errorMsg = "";
|
|
22
|
+
this._validForm = false;
|
|
23
|
+
}
|
|
24
|
+
render() {
|
|
25
|
+
return html`
|
|
26
|
+
<h3 class="wizard-h">${this._getTitle()}</h3>
|
|
27
|
+
|
|
28
|
+
<pd-form-container
|
|
29
|
+
id="stepFormContainerId"
|
|
30
|
+
class="form-container"
|
|
31
|
+
commonError="${this._errorMsg}"
|
|
32
|
+
?autoTrimm="${this.withAutoTrim}"
|
|
33
|
+
?requiredFieldInfo="${this.withRequiredInfo}"
|
|
34
|
+
>
|
|
35
|
+
${this._renderFormContent()}
|
|
36
|
+
</pd-form-container>
|
|
37
|
+
`;
|
|
38
|
+
}
|
|
39
|
+
get valid() {
|
|
40
|
+
var _a;
|
|
41
|
+
return ((_a = this._formElement) == null ? void 0 : _a.valid) && this._isValidFormData();
|
|
42
|
+
}
|
|
43
|
+
async triggerValidate() {
|
|
44
|
+
var _a;
|
|
45
|
+
return (_a = this._formElement) == null ? void 0 : _a.triggerValidate();
|
|
46
|
+
}
|
|
47
|
+
setFormData(currentOrder) {
|
|
48
|
+
return {
|
|
49
|
+
...currentOrder,
|
|
50
|
+
...this._prepareDataFromForm()
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
// could be overwritten in implementing classes (to avoid property set)
|
|
54
|
+
_getTitle() {
|
|
55
|
+
return this.stepTitle;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Prepare the order (trigger side-effets) after update from order step.
|
|
59
|
+
* Used to reset the tax after heating (house age) oder contact (business), but could use for anything else.
|
|
60
|
+
*
|
|
61
|
+
* The default implementation just returns the updated order to prevent all clients from implementing the method.
|
|
62
|
+
*
|
|
63
|
+
* @param updatedOrder order with updates from step.
|
|
64
|
+
* @returns preparedOrder - with (e.g. prices) changes triggered by step update.
|
|
65
|
+
*/
|
|
66
|
+
// eslint-disable-next-line class-methods-use-this
|
|
67
|
+
_prepareOrderAfterStepUpdate(updatedOrder) {
|
|
68
|
+
return updatedOrder;
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Returns the prepared data from the form inputs.
|
|
72
|
+
*
|
|
73
|
+
* Is called by setFormData, so the implementing client also haave to override
|
|
74
|
+
* _prepareDataFromForm.
|
|
75
|
+
*
|
|
76
|
+
* @returns preparaed data object from Form
|
|
77
|
+
*/
|
|
78
|
+
_prepareDataFromForm() {
|
|
79
|
+
var _a, _b;
|
|
80
|
+
if (!((_a = this._formElement) == null ? void 0 : _a.valid)) {
|
|
81
|
+
throw new Error("Invalid form, prepare not possible");
|
|
82
|
+
}
|
|
83
|
+
return (_b = this._formElement) == null ? void 0 : _b.getValues();
|
|
84
|
+
}
|
|
85
|
+
_isValidFormData() {
|
|
86
|
+
return true;
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Call from wizard.
|
|
90
|
+
*
|
|
91
|
+
* @param reloadedOrder
|
|
92
|
+
*/
|
|
93
|
+
// eslint-disable-next-line class-methods-use-this
|
|
94
|
+
reloadFromOrder(reloadedOrder) {
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Called to hold the current value from form (for aborting order processes).
|
|
98
|
+
* Do not fit perfect in the new form tyle, rethink about it....
|
|
99
|
+
*/
|
|
100
|
+
_doInputChange() {
|
|
101
|
+
if (timeoutInputRef) {
|
|
102
|
+
window.clearTimeout(timeoutInputRef);
|
|
103
|
+
}
|
|
104
|
+
timeoutInputRef = window.setTimeout(() => {
|
|
105
|
+
this.dispatchEvent(
|
|
106
|
+
new CustomEvent("wizard-step-update", {
|
|
107
|
+
detail: this._prepareDataFromForm(),
|
|
108
|
+
bubbles: true,
|
|
109
|
+
composed: true
|
|
110
|
+
})
|
|
111
|
+
);
|
|
112
|
+
}, DELAY_TIME);
|
|
113
|
+
}
|
|
114
|
+
_validateForm(e) {
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
__decorateClass([
|
|
118
|
+
property({ type: String })
|
|
119
|
+
], PdDefaultWizardStep.prototype, "stepTitle");
|
|
120
|
+
__decorateClass([
|
|
121
|
+
property({ type: Number })
|
|
122
|
+
], PdDefaultWizardStep.prototype, "stepNumber");
|
|
123
|
+
__decorateClass([
|
|
124
|
+
property({ type: Boolean })
|
|
125
|
+
], PdDefaultWizardStep.prototype, "withRequiredInfo");
|
|
126
|
+
__decorateClass([
|
|
127
|
+
property({ type: Boolean })
|
|
128
|
+
], PdDefaultWizardStep.prototype, "withAutoTrim");
|
|
129
|
+
__decorateClass([
|
|
130
|
+
state()
|
|
131
|
+
], PdDefaultWizardStep.prototype, "_errorMsg");
|
|
132
|
+
__decorateClass([
|
|
133
|
+
state()
|
|
134
|
+
], PdDefaultWizardStep.prototype, "_validForm");
|
|
135
|
+
__decorateClass([
|
|
136
|
+
query("#stepFormContainerId")
|
|
137
|
+
], PdDefaultWizardStep.prototype, "_formElement");
|
|
138
|
+
export {
|
|
139
|
+
PdDefaultWizardStep
|
|
140
|
+
};
|
|
@@ -1,11 +1,16 @@
|
|
|
1
1
|
export declare const templates: {
|
|
2
|
+
"pd.form.field.checkRequired": string;
|
|
2
3
|
"pd.form.field.invalid.mail": string;
|
|
3
4
|
"pd.form.field.invalid.number": string;
|
|
4
5
|
"pd.form.field.invalid.phone": string;
|
|
5
6
|
"pd.form.field.invalid.vat": string;
|
|
7
|
+
"pd.form.field.rangeRequired": string;
|
|
6
8
|
"pd.form.field.required": string;
|
|
7
|
-
"pd.form.
|
|
9
|
+
"pd.form.field.selectRequired": string;
|
|
10
|
+
"pd.form.required.missing": string;
|
|
8
11
|
"pd.form.required.valid": string;
|
|
12
|
+
s512f37f2dba563ec: import('@lit/localize').StrResult;
|
|
13
|
+
s8a355eeb33f58c5f: import('@lit/localize').StrResult;
|
|
9
14
|
"pd.moreInfo.less": string;
|
|
10
15
|
"pd.moreInfo.more": string;
|
|
11
16
|
"pd.contactus.address.email": string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"be-wrapper.d.ts","sourceRoot":"","sources":["../../../src/generated/locale-wrapper/be-wrapper.ts"],"names":[],"mappings":"AAUA,eAAO,MAAM,SAAS
|
|
1
|
+
{"version":3,"file":"be-wrapper.d.ts","sourceRoot":"","sources":["../../../src/generated/locale-wrapper/be-wrapper.ts"],"names":[],"mappings":"AAUA,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAQrB,CAAC"}
|
|
@@ -1,11 +1,16 @@
|
|
|
1
1
|
export declare const templates: {
|
|
2
|
-
"pd.form.required.valid": string;
|
|
3
|
-
"pd.form.required.info": string;
|
|
4
2
|
"pd.form.field.required": string;
|
|
3
|
+
"pd.form.field.selectRequired": string;
|
|
4
|
+
"pd.form.field.checkRequired": string;
|
|
5
|
+
"pd.form.field.rangeRequired": string;
|
|
5
6
|
"pd.form.field.invalid.mail": string;
|
|
6
7
|
"pd.form.field.invalid.phone": string;
|
|
7
8
|
"pd.form.field.invalid.vat": string;
|
|
8
9
|
"pd.form.field.invalid.number": string;
|
|
10
|
+
"pd.form.required.valid": string;
|
|
11
|
+
"pd.form.required.missing": string;
|
|
12
|
+
s8a355eeb33f58c5f: import('@lit/localize').StrResult;
|
|
13
|
+
s512f37f2dba563ec: import('@lit/localize').StrResult;
|
|
9
14
|
"pd.moreInfo.more": string;
|
|
10
15
|
"pd.moreInfo.less": string;
|
|
11
16
|
"pd.contactus.title": string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"de-wrapper.d.ts","sourceRoot":"","sources":["../../../src/generated/locale-wrapper/de-wrapper.ts"],"names":[],"mappings":"AAUA,eAAO,MAAM,SAAS
|
|
1
|
+
{"version":3,"file":"de-wrapper.d.ts","sourceRoot":"","sources":["../../../src/generated/locale-wrapper/de-wrapper.ts"],"names":[],"mappings":"AAUA,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAQrB,CAAC"}
|
|
@@ -1,11 +1,16 @@
|
|
|
1
1
|
export declare const templates: {
|
|
2
|
+
"pd.form.field.checkRequired": string;
|
|
2
3
|
"pd.form.field.invalid.mail": string;
|
|
3
4
|
"pd.form.field.invalid.number": string;
|
|
4
5
|
"pd.form.field.invalid.phone": string;
|
|
5
6
|
"pd.form.field.invalid.vat": string;
|
|
7
|
+
"pd.form.field.rangeRequired": string;
|
|
6
8
|
"pd.form.field.required": string;
|
|
7
|
-
"pd.form.
|
|
9
|
+
"pd.form.field.selectRequired": string;
|
|
10
|
+
"pd.form.required.missing": string;
|
|
8
11
|
"pd.form.required.valid": string;
|
|
12
|
+
s512f37f2dba563ec: import('@lit/localize').StrResult;
|
|
13
|
+
s8a355eeb33f58c5f: import('@lit/localize').StrResult;
|
|
9
14
|
"pd.moreInfo.less": string;
|
|
10
15
|
"pd.moreInfo.more": string;
|
|
11
16
|
"pd.contactus.address.email": string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"en-wrapper.d.ts","sourceRoot":"","sources":["../../../src/generated/locale-wrapper/en-wrapper.ts"],"names":[],"mappings":"AAUA,eAAO,MAAM,SAAS
|
|
1
|
+
{"version":3,"file":"en-wrapper.d.ts","sourceRoot":"","sources":["../../../src/generated/locale-wrapper/en-wrapper.ts"],"names":[],"mappings":"AAUA,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAQrB,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -14,7 +14,7 @@ export type { PopupType } from './defaultpage/default-confirm-popup.js';
|
|
|
14
14
|
export { DefaultDialogPopup } from './defaultpage/default-dialog-popup.js';
|
|
15
15
|
export { DefaultPopup } from './defaultpage/default-popup.js';
|
|
16
16
|
export { DefaultWizard } from './defaultpage/default-wizard.js';
|
|
17
|
-
export {
|
|
17
|
+
export { PdDefaultWizardStep } from './defaultpage/pd-default-wizard-step.js';
|
|
18
18
|
export { DefaultStepAddress } from './defaultpage/default-step-address.js';
|
|
19
19
|
export { createLogger, defaultLogger } from './helper/logger.js';
|
|
20
20
|
export { DefaultStepSummary } from './defaultpage/default-step-summary.js';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,KAAK,CAAC;AAErC,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAE1D,OAAO,KAAK,UAAU,MAAM,8CAA8C,CAAC;AAC3E,OAAO,KAAK,WAAW,MAAM,sBAAsB,CAAC;AAEpD,OAAO,KAAK,gBAAgB,MAAM,oCAAoC,CAAC;AACvE,OAAO,KAAK,YAAY,MAAM,yBAAyB,CAAC;AACxD,OAAO,KAAK,YAAY,MAAM,yBAAyB,CAAC;AACxD,OAAO,KAAK,aAAa,MAAM,0BAA0B,CAAC;AAC1D,OAAO,KAAK,cAAc,MAAM,2BAA2B,CAAC;AAC5D,OAAO,KAAK,YAAY,MAAM,yBAAyB,CAAC;AAExD,OAAO,EAAE,eAAe,EAAE,MAAM,oCAAoC,CAAC;AAErE,OAAO,EACL,mBAAmB,EACnB,gBAAgB,EAChB,gBAAgB,GACjB,MAAM,wCAAwC,CAAC;AAChD,YAAY,EAAE,SAAS,EAAE,MAAM,wCAAwC,CAAC;AAExE,OAAO,EAAE,kBAAkB,EAAE,MAAM,uCAAuC,CAAC;AAE3E,OAAO,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAC;AAE9D,OAAO,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAEhE,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,KAAK,CAAC;AAErC,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAE1D,OAAO,KAAK,UAAU,MAAM,8CAA8C,CAAC;AAC3E,OAAO,KAAK,WAAW,MAAM,sBAAsB,CAAC;AAEpD,OAAO,KAAK,gBAAgB,MAAM,oCAAoC,CAAC;AACvE,OAAO,KAAK,YAAY,MAAM,yBAAyB,CAAC;AACxD,OAAO,KAAK,YAAY,MAAM,yBAAyB,CAAC;AACxD,OAAO,KAAK,aAAa,MAAM,0BAA0B,CAAC;AAC1D,OAAO,KAAK,cAAc,MAAM,2BAA2B,CAAC;AAC5D,OAAO,KAAK,YAAY,MAAM,yBAAyB,CAAC;AAExD,OAAO,EAAE,eAAe,EAAE,MAAM,oCAAoC,CAAC;AAErE,OAAO,EACL,mBAAmB,EACnB,gBAAgB,EAChB,gBAAgB,GACjB,MAAM,wCAAwC,CAAC;AAChD,YAAY,EAAE,SAAS,EAAE,MAAM,wCAAwC,CAAC;AAExE,OAAO,EAAE,kBAAkB,EAAE,MAAM,uCAAuC,CAAC;AAE3E,OAAO,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAC;AAE9D,OAAO,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAEhE,OAAO,EAAE,mBAAmB,EAAE,MAAM,yCAAyC,CAAC;AAE9E,OAAO,EAAE,kBAAkB,EAAE,MAAM,uCAAuC,CAAC;AAE3E,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAEjE,OAAO,EAAE,kBAAkB,EAAE,MAAM,uCAAuC,CAAC;AAC3E,YAAY,EAAE,SAAS,EAAE,MAAM,uCAAuC,CAAC;AAEvE,OAAO,EACL,SAAS,EACT,UAAU,EACV,OAAO,EACP,mBAAmB,EACnB,gBAAgB,EAChB,UAAU,EACV,YAAY,EACZ,UAAU,EACV,kBAAkB,EAClB,cAAc,EACd,uBAAuB,EACvB,0BAA0B,EAC1B,gCAAgC,EAChC,MAAM,EACN,gBAAgB,EAChB,cAAc,GACf,MAAM,6CAA6C,CAAC;AAErD,OAAO,EAAE,4BAA4B,EAAE,MAAM,8BAA8B,CAAC;AAE5E,OAAO,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAC;AACnD,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAE7D,OAAO,KAAK,QAAQ,MAAM,4BAA4B,CAAC;AACvD,OAAO,KAAK,UAAU,MAAM,6BAA6B,CAAC;AAE1D,OAAO,KAAK,IAAI,MAAM,oBAAoB,CAAC;AAE3C,OAAO,EAAE,SAAS,IAAI,UAAU,EAAE,MAAM,0CAA0C,CAAC;AACnF,OAAO,EAAE,SAAS,IAAI,UAAU,EAAE,MAAM,0CAA0C,CAAC;AACnF,OAAO,EAAE,SAAS,IAAI,UAAU,EAAE,MAAM,0CAA0C,CAAC;AAEnF,eAAO,MAAM,kBAAkB,GAC7B,SAAS,GAAG,EACZ,KAAK,MAAM,GAAG,cAAc,EAC5B,WAAW,OAAO,EAClB,SAAS,OAAO,SAajB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -12,7 +12,7 @@ import { ABORT_EVENT_NAME, DefaultConfirmPopup, STORE_EVENT_NAME } from "./defau
|
|
|
12
12
|
import { DefaultDialogPopup } from "./defaultpage/default-dialog-popup.js";
|
|
13
13
|
import { DefaultPopup } from "./defaultpage/default-popup.js";
|
|
14
14
|
import { DefaultWizard } from "./defaultpage/default-wizard.js";
|
|
15
|
-
import {
|
|
15
|
+
import { PdDefaultWizardStep } from "./defaultpage/pd-default-wizard-step.js";
|
|
16
16
|
import { DefaultStepAddress } from "./defaultpage/default-step-address.js";
|
|
17
17
|
import { createLogger, defaultLogger } from "./helper/logger.js";
|
|
18
18
|
import { DefaultStepSummary } from "./defaultpage/default-step-summary.js";
|
|
@@ -48,7 +48,7 @@ export {
|
|
|
48
48
|
DefaultStepSummary,
|
|
49
49
|
DefaultViewPage,
|
|
50
50
|
DefaultWizard,
|
|
51
|
-
|
|
51
|
+
PdDefaultWizardStep,
|
|
52
52
|
PdSpaHelper,
|
|
53
53
|
STORE_EVENT_NAME,
|
|
54
54
|
activateCollectionListener,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"spa-model.d.ts","sourceRoot":"","sources":["../../src/model/spa-model.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,cAAc,iBAAiB,CAAC;AAE7C,eAAO,MAAM
|
|
1
|
+
{"version":3,"file":"spa-model.d.ts","sourceRoot":"","sources":["../../src/model/spa-model.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,cAAc,iBAAiB,CAAC;AAE7C,eAAO,MAAM,KAAK,UAAU,CAAC;AAE7B,MAAM,WAAW,OAAO;IACtB,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,aAAa,EAAE,OAAO,CAAC;IACvB,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CAC7B;AAED,MAAM,WAAW,cAAc;IAC7B,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,OAAO,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,EAAE,IAAI,CAAC;IAChB,SAAS,EAAE,OAAO,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE,cAAc,EAAE,CAAC;CAC5B"}
|
package/dist/model/spa-model.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../../../src/service-provider/mock/auth.ts"],"names":[],"mappings":"AAmBA,eAAO,MAAM,UAAU,QAAa,OAAO,CAAC,OAAO,CAOlD,CAAC;AAEF,eAAO,MAAM,mBAAmB,QAAO,OAMtC,CAAC;AAEF,eAAO,MAAM,eAAe,QAAO,OAMpB,CAAC;AAGhB,eAAO,MAAM,oBAAoB,GAAI,UAAU,CAAC,IAAI,EAAE,GAAG,KAAK,IAAI,SAMjE,CAAC;AAEF,eAAO,MAAM,SAAS,GACpB,MAAM,MAAM,EACZ,KAAK,MAAM,KACV,OAAO,CAAC,OAAO,
|
|
1
|
+
{"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../../../src/service-provider/mock/auth.ts"],"names":[],"mappings":"AAmBA,eAAO,MAAM,UAAU,QAAa,OAAO,CAAC,OAAO,CAOlD,CAAC;AAEF,eAAO,MAAM,mBAAmB,QAAO,OAMtC,CAAC;AAEF,eAAO,MAAM,eAAe,QAAO,OAMpB,CAAC;AAGhB,eAAO,MAAM,oBAAoB,GAAI,UAAU,CAAC,IAAI,EAAE,GAAG,KAAK,IAAI,SAMjE,CAAC;AAEF,eAAO,MAAM,SAAS,GACpB,MAAM,MAAM,EACZ,KAAK,MAAM,KACV,OAAO,CAAC,OAAO,CA2BjB,CAAC"}
|
|
@@ -35,6 +35,7 @@ const authStateChangedMock = (callback) => {
|
|
|
35
35
|
};
|
|
36
36
|
const loginMock = async (user, sec) => {
|
|
37
37
|
console.log("MOCK: do authentication for user: ", user);
|
|
38
|
+
await new Promise((resolve) => setTimeout(resolve, 2e3));
|
|
38
39
|
let valid = false;
|
|
39
40
|
if (user === HARDCODED_USER && sec === HARDCODED_PWD) {
|
|
40
41
|
{
|
|
@@ -48,7 +49,7 @@ const loginMock = async (user, sec) => {
|
|
|
48
49
|
if (callbackLogin) {
|
|
49
50
|
callbackLogin(userMock);
|
|
50
51
|
}
|
|
51
|
-
return
|
|
52
|
+
return user;
|
|
52
53
|
}
|
|
53
54
|
const err = new Error("Invalid login");
|
|
54
55
|
const error = err;
|