@progressive-development/pd-spa-helper 0.3.62 → 0.3.64
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/src/defaultpage/default-confirm-popup.d.ts +4 -1
- package/dist/src/defaultpage/default-confirm-popup.js +26 -8
- package/dist/src/defaultpage/default-confirm-popup.js.map +1 -1
- package/dist/src/defaultpage/default-wizard-step.d.ts +1 -0
- package/dist/src/defaultpage/default-wizard-step.js +4 -0
- package/dist/src/defaultpage/default-wizard-step.js.map +1 -1
- package/dist/src/defaultpage/default-wizard.d.ts +6 -0
- package/dist/src/defaultpage/default-wizard.js +118 -1
- package/dist/src/defaultpage/default-wizard.js.map +1 -1
- package/dist/src/generated/locale-wrapper/de-wrapper.d.ts +11 -0
- package/dist/src/generated/locales/be.d.ts +11 -0
- package/dist/src/generated/locales/be.js +11 -0
- package/dist/src/generated/locales/be.js.map +1 -1
- package/dist/src/generated/locales/de.d.ts +11 -0
- package/dist/src/generated/locales/de.js +11 -0
- package/dist/src/generated/locales/de.js.map +1 -1
- package/dist/src/generated/locales/en.d.ts +11 -0
- package/dist/src/generated/locales/en.js +11 -0
- package/dist/src/generated/locales/en.js.map +1 -1
- package/dist/src/model/spa-model.d.ts +1 -0
- package/dist/src/model/spa-model.js +1 -0
- package/dist/src/model/spa-model.js.map +1 -1
- package/dist/src/popup/wizard-close-popup.d.ts +10 -0
- package/dist/src/popup/wizard-close-popup.js +49 -0
- package/dist/src/popup/wizard-close-popup.js.map +1 -0
- package/dist/src/popup/wizard-reload-popup.d.ts +13 -0
- package/dist/src/popup/wizard-reload-popup.js +63 -0
- package/dist/src/popup/wizard-reload-popup.js.map +1 -0
- package/dist/src/tmpown/pd-loading-state.js +2 -1
- package/dist/src/tmpown/pd-loading-state.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/defaultpage/default-confirm-popup.ts +22 -13
- package/src/defaultpage/default-wizard-step.ts +5 -0
- package/src/defaultpage/default-wizard.ts +143 -1
- package/src/generated/locales/be.ts +11 -0
- package/src/generated/locales/de.ts +11 -0
- package/src/generated/locales/en.ts +12 -1
- package/src/model/spa-model.ts +2 -0
- package/src/popup/wizard-close-popup.ts +52 -0
- package/src/popup/wizard-reload-popup.ts +69 -0
- package/src/tmpown/pd-loading-state.ts +2 -1
- package/xliff/be.xlf +45 -0
- package/xliff/de.xlf +33 -0
- package/xliff/en.xlf +45 -0
|
@@ -7,10 +7,13 @@ export declare const STORE_EVENT_NAME = "store";
|
|
|
7
7
|
export type PopupType = "info" | "help" | "warn" | "error";
|
|
8
8
|
export declare abstract class DefaultConfirmPopup extends LitElement {
|
|
9
9
|
abstract _popupTitle: string;
|
|
10
|
-
abstract _singleButton: boolean;
|
|
11
10
|
abstract _type?: PopupType;
|
|
11
|
+
abstract _singleButton: boolean;
|
|
12
|
+
okButtonText: string;
|
|
13
|
+
cancelButtonText: string;
|
|
12
14
|
static styles: CSSResultGroup;
|
|
13
15
|
render(): import("lit").TemplateResult<1>;
|
|
16
|
+
private _generateButtons;
|
|
14
17
|
protected _handleButtonClick(e: CustomEvent): void;
|
|
15
18
|
abstract _renderContent(): HTMLTemplateResult;
|
|
16
19
|
}
|
|
@@ -1,27 +1,39 @@
|
|
|
1
|
+
import { __decorate } from "tslib";
|
|
1
2
|
import { html, LitElement, css } from "lit";
|
|
3
|
+
import { property } from "lit/decorators.js";
|
|
2
4
|
import '@progressive-development/pd-dialog/pd-popup-dialog.js';
|
|
3
5
|
export const KEY_ABORT = "1";
|
|
4
6
|
export const ABORT_EVENT_NAME = "close-popup";
|
|
5
7
|
export const KEY_STORE = "2";
|
|
6
8
|
export const STORE_EVENT_NAME = "store";
|
|
7
|
-
const CONFIRM_BUTTONS = [
|
|
8
|
-
{ key: KEY_ABORT, name: "Cancel" },
|
|
9
|
-
{ key: KEY_STORE, name: "Ok", primary: true }
|
|
10
|
-
];
|
|
11
|
-
const SINGLE_BUTTON = [
|
|
12
|
-
{ key: KEY_STORE, name: "Ok", primary: true }
|
|
13
|
-
];
|
|
14
9
|
export class DefaultConfirmPopup extends LitElement {
|
|
10
|
+
constructor() {
|
|
11
|
+
super(...arguments);
|
|
12
|
+
this.okButtonText = "Ok";
|
|
13
|
+
this.cancelButtonText = "Cancel";
|
|
14
|
+
}
|
|
15
15
|
render() {
|
|
16
|
+
const buttons = this._generateButtons();
|
|
16
17
|
return html `
|
|
17
18
|
<pd-popup-dialog @submit-button-clicked="${this._handleButtonClick}"
|
|
18
|
-
title="${this._popupTitle}" .buttons="${
|
|
19
|
+
title="${this._popupTitle}" .buttons="${buttons}" type="${this._type}">
|
|
19
20
|
|
|
20
21
|
${this._renderContent()}
|
|
21
22
|
|
|
22
23
|
</pd-popup-dialog>
|
|
23
24
|
`;
|
|
24
25
|
}
|
|
26
|
+
_generateButtons() {
|
|
27
|
+
if (this._singleButton) {
|
|
28
|
+
return [
|
|
29
|
+
{ key: KEY_STORE, name: this.okButtonText, primary: true },
|
|
30
|
+
];
|
|
31
|
+
}
|
|
32
|
+
return [
|
|
33
|
+
{ key: KEY_ABORT, name: this.cancelButtonText },
|
|
34
|
+
{ key: KEY_STORE, name: this.okButtonText, primary: true },
|
|
35
|
+
];
|
|
36
|
+
}
|
|
25
37
|
_handleButtonClick(e) {
|
|
26
38
|
this.dispatchEvent(new CustomEvent(e.detail.button === KEY_STORE ? STORE_EVENT_NAME : ABORT_EVENT_NAME));
|
|
27
39
|
}
|
|
@@ -36,4 +48,10 @@ DefaultConfirmPopup.styles = [
|
|
|
36
48
|
}
|
|
37
49
|
`
|
|
38
50
|
];
|
|
51
|
+
__decorate([
|
|
52
|
+
property({ type: String })
|
|
53
|
+
], DefaultConfirmPopup.prototype, "okButtonText", void 0);
|
|
54
|
+
__decorate([
|
|
55
|
+
property({ type: String })
|
|
56
|
+
], DefaultConfirmPopup.prototype, "cancelButtonText", void 0);
|
|
39
57
|
//# sourceMappingURL=default-confirm-popup.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"default-confirm-popup.js","sourceRoot":"","sources":["../../../src/defaultpage/default-confirm-popup.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,GAAG,EAAsC,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"default-confirm-popup.js","sourceRoot":"","sources":["../../../src/defaultpage/default-confirm-popup.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,GAAG,EAAsC,MAAM,KAAK,CAAC;AAChF,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAE7C,OAAO,uDAAuD,CAAC;AAE/D,MAAM,CAAC,MAAM,SAAS,GAAG,GAAG,CAAC;AAC7B,MAAM,CAAC,MAAM,gBAAgB,GAAG,aAAa,CAAC;AAE9C,MAAM,CAAC,MAAM,SAAS,GAAG,GAAG,CAAC;AAC7B,MAAM,CAAC,MAAM,gBAAgB,GAAG,OAAO,CAAC;AAIxC,MAAM,OAAgB,mBAAoB,SAAQ,UAAU;IAA5D;;QASE,iBAAY,GAAW,IAAI,CAAC;QAG5B,qBAAgB,GAAW,QAAQ,CAAC;IAgDtC,CAAC;IAlCC,MAAM;QACJ,MAAM,OAAO,GAAG,IAAI,CAAC,gBAAgB,EAAE,CAAC;QACxC,OAAO,IAAI,CAAA;iDACkC,IAAI,CAAC,kBAAkB;iBACvD,IAAI,CAAC,WAAW,eAAe,OAAO,WAAW,IAAI,CAAC,KAAK;;UAElE,IAAI,CAAC,cAAc,EAAE;;;KAG1B,CAAC;IACJ,CAAC;IAEO,gBAAgB;QACtB,IAAI,IAAI,CAAC,aAAa,EAAE;YACtB,OAAO;gBACL,EAAE,GAAG,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,CAAC,YAAY,EAAE,OAAO,EAAE,IAAI,EAAE;aAC3D,CAAC;SACH;QACD,OAAO;YACL,EAAE,GAAG,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,CAAC,gBAAgB,EAAE;YAC/C,EAAE,GAAG,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,CAAC,YAAY,EAAE,OAAO,EAAE,IAAI,EAAE;SAC3D,CAAC;IACJ,CAAC;IAES,kBAAkB,CAAC,CAAc;QACzC,IAAI,CAAC,aAAa,CAChB,IAAI,WAAW,CACb,CAAC,CAAC,MAAM,CAAC,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC,CAAC,gBAAgB,CACpE,CACF,CAAC;IACJ,CAAC;;AAzCM,0BAAM,GAAG;IACd,GAAG,CAAA;;;;;;;KAOF;CACgB,CAAC;AAfpB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;yDACC;AAG5B;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;6DACS","sourcesContent":["import { html, LitElement, css, CSSResultGroup, HTMLTemplateResult } from \"lit\";\nimport { property } from \"lit/decorators.js\";\n\nimport '@progressive-development/pd-dialog/pd-popup-dialog.js';\n\nexport const KEY_ABORT = \"1\";\nexport const ABORT_EVENT_NAME = \"close-popup\";\n\nexport const KEY_STORE = \"2\";\nexport const STORE_EVENT_NAME = \"store\";\n\nexport type PopupType = \"info\" | \"help\" | \"warn\" | \"error\";\n\nexport abstract class DefaultConfirmPopup extends LitElement {\n\n abstract _popupTitle: string;\n\n abstract _type?: PopupType;\n\n abstract _singleButton: boolean;\n\n @property({ type: String }) \n okButtonText: string = \"Ok\";\n\n @property({ type: String }) \n cancelButtonText: string = \"Cancel\"; \n \n \n static styles = [ \n css`\n :host {\n --pd-popup-max-width: 600px;\n --pd-popup-header-height: 50px;\n --pd-popup-header-font-size: 1em;\n --pd-popup-header-col: var(--app-primary-dark-col);\n }\n `\n ] as CSSResultGroup;\n\n render() { \n const buttons = this._generateButtons();\n return html`\n <pd-popup-dialog @submit-button-clicked=\"${this._handleButtonClick}\"\n title=\"${this._popupTitle}\" .buttons=\"${buttons}\" type=\"${this._type}\">\n \n ${this._renderContent()}\n\n </pd-popup-dialog>\n `;\n }\n\n private _generateButtons() {\n if (this._singleButton) {\n return [\n { key: KEY_STORE, name: this.okButtonText, primary: true },\n ];\n }\n return [\n { key: KEY_ABORT, name: this.cancelButtonText },\n { key: KEY_STORE, name: this.okButtonText, primary: true },\n ];\n }\n\n protected _handleButtonClick(e: CustomEvent) {\n this.dispatchEvent(\n new CustomEvent(\n e.detail.button === KEY_STORE ? STORE_EVENT_NAME : ABORT_EVENT_NAME\n )\n );\n }\n\n abstract _renderContent(): HTMLTemplateResult; \n\n}"]}
|
|
@@ -21,6 +21,7 @@ export declare abstract class DefaultWizardStep<T, F> extends LitElement {
|
|
|
21
21
|
* @returns preparedOrder - with (e.g. prices) changes triggered by step update.
|
|
22
22
|
*/
|
|
23
23
|
protected _prepareOrderAfterStepUpdate(updatedOrder: T): T;
|
|
24
|
+
reloadFromOrder(reloadedOrder: T): void;
|
|
24
25
|
abstract setFormData(currentOrder: T, formData: F): T;
|
|
25
26
|
abstract _initWithValidation(): boolean;
|
|
26
27
|
}
|
|
@@ -67,6 +67,10 @@ export class DefaultWizardStep extends LitElement {
|
|
|
67
67
|
_prepareOrderAfterStepUpdate(updatedOrder) {
|
|
68
68
|
return updatedOrder;
|
|
69
69
|
}
|
|
70
|
+
// eslint-disable-next-line class-methods-use-this
|
|
71
|
+
reloadFromOrder(reloadedOrder) {
|
|
72
|
+
// do nothing
|
|
73
|
+
}
|
|
70
74
|
}
|
|
71
75
|
__decorate([
|
|
72
76
|
property({ type: Number })
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"default-wizard-step.js","sourceRoot":"","sources":["../../../src/defaultpage/default-wizard-step.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;AACjC,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAG7C;;GAEG;AACH,MAAM,OAAgB,iBAAwB,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EAAE,KAAK,EAAE,IAAI,EAAC,CAAC;oDACf","sourcesContent":["import { LitElement } from \"lit\";\nimport { property } from \"lit/decorators.js\";\n\n\n/**\n * TODO: Move inside pd-wizard.\n */\nexport abstract class DefaultWizardStep<T, F> extends LitElement {\n\n @property({type: Number})\n stepNumber: number = 0;\n\n @property({type: Boolean})\n withRequiredInfo: boolean = false;\n\n @property({type: String, state: true})\n _errorMsg: string = \"\";\n\n abstract _formId:string;\n\n private _elRef: any;\n\n\n firstUpdated() {\n this._formInit(this.shadowRoot?.getElementById(this._formId));\n\n // first validation if form is already filled (edit)\n if (this._initWithValidation()) {\n const detail = {\n errorMap: new Map()\n }\n this.shadowRoot?.getElementById(this._formId)?.dispatchEvent(\n new CustomEvent(\"validate-form\", {detail})\n );\n }\n }\n\n _formInit(elRef: any) {\n // add validation event listener\n this.addEventListener('validate-form', this._validateForm);\n this._elRef = elRef;\n }\n\n _validateForm(e: any) {\n\n // vaidate required fields => dispatch event down \n if (e.detail && !e.detail.singleElement) {\n\n if (this._elRef) {\n this._elRef.dispatchEvent(\n new CustomEvent('validate-form', {\n detail: e.detail,\n })\n );\n }\n\n // no error found TODO: Clear bei Fehler noch übernehmen, da keine Daten für nicht validierte Wizard Schritte verbleiben sollten\n if (e.detail.errorMap.size === 0 && this.setFormData) {\n try {\n const preparedOrder = this.setFormData(\n e.detail.currentOrder,\n e.detail.formData\n );\n if (preparedOrder) {\n e.detail.preparedOrder = this._prepareOrderAfterStepUpdate(preparedOrder);\n this._errorMsg = \"\";\n } else {\n e.detail.errorMap.set('validation-error', 'test');\n }\n } catch (error: any) { \n e.detail.errorMap.set('validation-error', error.message);\n this._errorMsg = error.message;\n }\n } \n } \n }\n\n /**\n * Prepare the order (trigger side-effets) after update from order step.\n * Used to reset the tax after heating (house age) oder contact (business), but could use for anything else.\n * \n * The default implementation just returns the updated order to prevent all clients from implementing the method.\n * \n * @param updatedOrder order with updates from step.\n * @returns preparedOrder - with (e.g. prices) changes triggered by step update.\n */\n // eslint-disable-next-line class-methods-use-this \n protected _prepareOrderAfterStepUpdate(updatedOrder: T): T {\n return updatedOrder;\n }\n\n // eslint-disable-next-line class-methods-use-this\n reloadFromOrder(reloadedOrder: T): void {\n // do nothing\n }\n \n abstract setFormData(currentOrder: T, formData: F): T;\n\n abstract _initWithValidation(): boolean;\n \n}"]}
|
|
@@ -14,10 +14,16 @@ export declare abstract class DefaultWizard<T> extends DefaultViewPage {
|
|
|
14
14
|
}>;
|
|
15
15
|
_currentOrderStep: number;
|
|
16
16
|
_orderFormData?: T;
|
|
17
|
+
_withLocalStorageId?: string;
|
|
17
18
|
render(): import("lit").TemplateResult<1>;
|
|
19
|
+
private getWizardStorage;
|
|
20
|
+
protected _reloadFromStorage(): void;
|
|
21
|
+
protected _doStorageUpdate(): void;
|
|
22
|
+
protected _removeFromStorage(): void;
|
|
18
23
|
_nextStep(e: CustomEvent): void;
|
|
19
24
|
_previousStep(): void;
|
|
20
25
|
_goToStep(e: any): void;
|
|
26
|
+
_closeWizardRequest(): void;
|
|
21
27
|
abstract _closeWizard(): void;
|
|
22
28
|
abstract _renderSteps(): HTMLTemplateResult;
|
|
23
29
|
abstract _renderLogo(): HTMLTemplateResult;
|
|
@@ -1,9 +1,15 @@
|
|
|
1
1
|
import { __decorate } from "tslib";
|
|
2
2
|
import { html } from "lit";
|
|
3
3
|
import { property } from "lit/decorators.js";
|
|
4
|
+
import { msg } from "@lit/localize";
|
|
4
5
|
import '@progressive-development/pd-dialog/pd-popup-dialog.js';
|
|
5
6
|
import '@progressive-development/pd-wizard/pd-wizard.js';
|
|
6
7
|
import { DefaultViewPage } from "./default-view-page.js";
|
|
8
|
+
import { RUNNING_WIZARD_STORAGE_ELEMENTS } from "../model/spa-model.js";
|
|
9
|
+
import { WizardReloadPopup } from "../popup/wizard-reload-popup.js";
|
|
10
|
+
import { WizardClosePopup } from "../popup/wizard-close-popup.js";
|
|
11
|
+
import { ABORT_EVENT_NAME, STORE_EVENT_NAME } from "./default-confirm-popup.js";
|
|
12
|
+
import { DefaultWizardStep } from "./default-wizard-step.js";
|
|
7
13
|
/**
|
|
8
14
|
* TODO: Move inside pd-wizard.
|
|
9
15
|
*/
|
|
@@ -24,18 +30,88 @@ export class DefaultWizard extends DefaultViewPage {
|
|
|
24
30
|
@previous-step="${this._previousStep}"
|
|
25
31
|
@submit-wizard="${this._nextStep}"
|
|
26
32
|
@go-to="${this._goToStep}"
|
|
27
|
-
@close-wizard="${this.
|
|
33
|
+
@close-wizard="${this._closeWizardRequest}"
|
|
34
|
+
@wizard-step-update="${this._doStorageUpdate}"
|
|
28
35
|
>
|
|
29
36
|
${this._renderLogo()}
|
|
30
37
|
${this._renderSteps()}
|
|
31
38
|
</pd-wizard>
|
|
32
39
|
`;
|
|
33
40
|
}
|
|
41
|
+
// eslint-disable-next-line class-methods-use-this
|
|
42
|
+
getWizardStorage() {
|
|
43
|
+
const storageEl = localStorage.getItem(RUNNING_WIZARD_STORAGE_ELEMENTS);
|
|
44
|
+
return storageEl ? JSON.parse(storageEl) : {};
|
|
45
|
+
}
|
|
46
|
+
_reloadFromStorage() {
|
|
47
|
+
var _a;
|
|
48
|
+
if (this._withLocalStorageId) {
|
|
49
|
+
// Laden
|
|
50
|
+
const storageEl = this.getWizardStorage()[this._withLocalStorageId];
|
|
51
|
+
if (storageEl && storageEl.orderFormData) {
|
|
52
|
+
const popup = new WizardReloadPopup();
|
|
53
|
+
popup.reloadItem = storageEl;
|
|
54
|
+
popup.okButtonText = msg("Fortsetzen", { id: "spaH.wizard.reload.popup.ok" });
|
|
55
|
+
popup.cancelButtonText = msg("Verwerfen", { id: "spaH.wizard.reload.popup.cancel" });
|
|
56
|
+
popup.addEventListener(ABORT_EVENT_NAME, () => {
|
|
57
|
+
var _a;
|
|
58
|
+
this._removeFromStorage();
|
|
59
|
+
(_a = this.shadowRoot) === null || _a === void 0 ? void 0 : _a.removeChild(popup);
|
|
60
|
+
});
|
|
61
|
+
popup.addEventListener(STORE_EVENT_NAME, () => {
|
|
62
|
+
var _a, _b;
|
|
63
|
+
console.debug(`Reload storage element from ${storageEl.timestamp}`);
|
|
64
|
+
this._orderFormData = storageEl.orderFormData;
|
|
65
|
+
this._currentOrderStep = storageEl.wizardStep;
|
|
66
|
+
(_a = this.shadowRoot) === null || _a === void 0 ? void 0 : _a.removeChild(popup);
|
|
67
|
+
const slot = (_b = this.shadowRoot) === null || _b === void 0 ? void 0 : _b.querySelector('slot');
|
|
68
|
+
if (!slot)
|
|
69
|
+
return;
|
|
70
|
+
// Hole alle zugewiesenen Elemente
|
|
71
|
+
const allElements = slot.assignedElements({ flatten: true });
|
|
72
|
+
// Filtere nur die Elemente, die Instanzen von DefaultWizardStep sind
|
|
73
|
+
const stepElements = allElements.filter((el) => el instanceof DefaultWizardStep &&
|
|
74
|
+
typeof el.slot === 'string' &&
|
|
75
|
+
el.slot.startsWith('step-'));
|
|
76
|
+
// Führe die gewünschte Methode für jedes gefilterte Element aus
|
|
77
|
+
stepElements.forEach((step) => {
|
|
78
|
+
var _a;
|
|
79
|
+
(_a = step.reloadFromOrder) === null || _a === void 0 ? void 0 : _a.call(step, this._orderFormData);
|
|
80
|
+
});
|
|
81
|
+
});
|
|
82
|
+
(_a = this.shadowRoot) === null || _a === void 0 ? void 0 : _a.appendChild(popup);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
_doStorageUpdate() {
|
|
87
|
+
if (this._withLocalStorageId) {
|
|
88
|
+
const storageWizard = this.getWizardStorage();
|
|
89
|
+
storageWizard[this._withLocalStorageId] = {
|
|
90
|
+
orderFormData: this._orderFormData,
|
|
91
|
+
wizardStep: this._currentOrderStep,
|
|
92
|
+
timestamp: new Date().toUTCString(),
|
|
93
|
+
};
|
|
94
|
+
localStorage.setItem(RUNNING_WIZARD_STORAGE_ELEMENTS, JSON.stringify(storageWizard));
|
|
95
|
+
console.debug(`Update wizard local storage for key ${this._withLocalStorageId}`);
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
_removeFromStorage() {
|
|
99
|
+
if (this._withLocalStorageId) {
|
|
100
|
+
// remote storage element
|
|
101
|
+
const storageWizard = this.getWizardStorage();
|
|
102
|
+
delete storageWizard[this._withLocalStorageId];
|
|
103
|
+
localStorage.setItem(RUNNING_WIZARD_STORAGE_ELEMENTS, JSON.stringify(storageWizard));
|
|
104
|
+
console.debug(`Remove wizard local storage for key ${this._withLocalStorageId}`);
|
|
105
|
+
}
|
|
106
|
+
}
|
|
34
107
|
_nextStep(e) {
|
|
35
108
|
var _a;
|
|
36
109
|
const setNextStep = () => {
|
|
37
110
|
if (this._currentOrderStep < this._wizardSteps.length) {
|
|
38
111
|
this._currentOrderStep += 1;
|
|
112
|
+
if (this._withLocalStorageId) {
|
|
113
|
+
this._doStorageUpdate();
|
|
114
|
+
}
|
|
39
115
|
if (!this.panelWizard) {
|
|
40
116
|
DefaultWizard._timeOutScroll();
|
|
41
117
|
}
|
|
@@ -86,6 +162,44 @@ export class DefaultWizard extends DefaultViewPage {
|
|
|
86
162
|
}
|
|
87
163
|
}
|
|
88
164
|
}
|
|
165
|
+
_closeWizardRequest() {
|
|
166
|
+
var _a, _b;
|
|
167
|
+
if (this._withLocalStorageId) {
|
|
168
|
+
const popup = new WizardClosePopup();
|
|
169
|
+
popup.withStorage = true;
|
|
170
|
+
popup.okButtonText = msg("Speichern", { id: "spaH.wizard.storage.close.popup.ok" });
|
|
171
|
+
popup.cancelButtonText = msg("Verwerfen", { id: "spaH.wizard.storage.close.popup.cancel" });
|
|
172
|
+
popup.addEventListener(ABORT_EVENT_NAME, () => {
|
|
173
|
+
var _a;
|
|
174
|
+
this._removeFromStorage();
|
|
175
|
+
(_a = this.shadowRoot) === null || _a === void 0 ? void 0 : _a.removeChild(popup);
|
|
176
|
+
this._closeWizard();
|
|
177
|
+
});
|
|
178
|
+
popup.addEventListener(STORE_EVENT_NAME, () => {
|
|
179
|
+
var _a;
|
|
180
|
+
this._doStorageUpdate();
|
|
181
|
+
(_a = this.shadowRoot) === null || _a === void 0 ? void 0 : _a.removeChild(popup);
|
|
182
|
+
this._closeWizard();
|
|
183
|
+
});
|
|
184
|
+
(_a = this.shadowRoot) === null || _a === void 0 ? void 0 : _a.appendChild(popup);
|
|
185
|
+
}
|
|
186
|
+
else {
|
|
187
|
+
const popup = new WizardClosePopup();
|
|
188
|
+
popup.withStorage = false;
|
|
189
|
+
popup.okButtonText = msg("Schließen", { id: "spaH.wizard.close.popup.ok" });
|
|
190
|
+
popup.cancelButtonText = msg("Abbrechen", { id: "spaH.wizard.close.popup.cancel" });
|
|
191
|
+
popup.addEventListener(ABORT_EVENT_NAME, () => {
|
|
192
|
+
var _a;
|
|
193
|
+
(_a = this.shadowRoot) === null || _a === void 0 ? void 0 : _a.removeChild(popup);
|
|
194
|
+
});
|
|
195
|
+
popup.addEventListener(STORE_EVENT_NAME, () => {
|
|
196
|
+
var _a;
|
|
197
|
+
(_a = this.shadowRoot) === null || _a === void 0 ? void 0 : _a.removeChild(popup);
|
|
198
|
+
this._closeWizard();
|
|
199
|
+
});
|
|
200
|
+
(_b = this.shadowRoot) === null || _b === void 0 ? void 0 : _b.appendChild(popup);
|
|
201
|
+
}
|
|
202
|
+
}
|
|
89
203
|
static _timeOutScroll() {
|
|
90
204
|
window.setTimeout(() => {
|
|
91
205
|
window.scrollTo({
|
|
@@ -105,4 +219,7 @@ __decorate([
|
|
|
105
219
|
__decorate([
|
|
106
220
|
property({ type: Object, state: true })
|
|
107
221
|
], DefaultWizard.prototype, "_orderFormData", void 0);
|
|
222
|
+
__decorate([
|
|
223
|
+
property({ type: String, state: true })
|
|
224
|
+
], DefaultWizard.prototype, "_withLocalStorageId", void 0);
|
|
108
225
|
//# sourceMappingURL=default-wizard.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"default-wizard.js","sourceRoot":"","sources":["../../../src/defaultpage/default-wizard.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAsB,MAAM,KAAK,CAA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Q;aACnB,CAAC,CAAC;QACL,CAAC,EAAE,GAAG,CAAC,CAAC;IACV,CAAC;CAEF;AA/GC;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;mDAKpC;AAGH;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;wDACV;AAG9B;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;qDACrB","sourcesContent":["import { html, HTMLTemplateResult } from \"lit\";\nimport { property } from \"lit/decorators.js\";\n\nimport '@progressive-development/pd-dialog/pd-popup-dialog.js';\nimport '@progressive-development/pd-wizard/pd-wizard.js';\n\nimport { DefaultViewPage } from \"./default-view-page.js\";\n\n/**\n * TODO: Move inside pd-wizard.\n */\nexport abstract class DefaultWizard<T> extends DefaultViewPage {\n \n protected panelWizard:boolean = false;\n\n @property({ type: Array, state: true })\n abstract _wizardSteps: Array<{\n title: string, \n name: string,\n key: string\n }>; \n\n @property({ type: Number, state: true })\n _currentOrderStep: number = 1;\n\n @property({ type: Object, state: true })\n _orderFormData?: T;\n\n\n render() {\n return html`\n <pd-wizard \n id=\"wizardId\"\n ?panelWizard=\"${this.panelWizard}\"\n currentNumber=\"${this._currentOrderStep}\"\n .wizardSteps=\"${this._wizardSteps}\" \n @next-step=\"${this._nextStep}\"\n @previous-step=\"${this._previousStep}\"\n @submit-wizard=\"${this._nextStep}\"\n @go-to=\"${this._goToStep}\"\n @close-wizard=\"${this._closeWizard}\"\n >\n ${this._renderLogo()}\n ${this._renderSteps()}\n </pd-wizard>\n `;\n }\n\n _nextStep(e:CustomEvent) {\n const setNextStep = () => {\n if (this._currentOrderStep < this._wizardSteps.length) {\n this._currentOrderStep += 1;\n if (!this.panelWizard) {\n DefaultWizard._timeOutScroll();\n }\n }\n };\n\n const detail:any = {\n errorMap: new Map(),\n formData: {},\n currentOrder: this._orderFormData,\n };\n\n const curentStepEl:any = this.shadowRoot?.getElementById(\n `wiz${this._currentOrderStep}Id`\n );\n\n /**\n * Trigger validate event. After that, detail members prepared by \n * event process and can handle synchronously.\n */\n curentStepEl.dispatchEvent(new CustomEvent('validate-form', { detail }));\n\n if (detail.errorMap.size === 0) {\n if (detail.preparedOrder) {\n this._orderFormData = detail.preparedOrder;\n }\n if (this._wizardSteps.length === this._currentOrderStep) {\n // Now submit wizard\n e.detail.submited = true;\n this._submitWizard();\n } else {\n setNextStep();\n }\n } else {\n console.log('Validation rejected: ', detail);\n }\n }\n\n _previousStep() {\n if (this._currentOrderStep > 1) {\n this._currentOrderStep -= 1;\n if (!this.panelWizard) {\n DefaultWizard._timeOutScroll();\n } \n }\n }\n\n _goToStep(e: any) {\n const stepNr = e.detail.step;\n if (stepNr > 0 && stepNr <= this._wizardSteps.length) {\n this._currentOrderStep = Number(stepNr);\n if (!this.panelWizard) {\n DefaultWizard._timeOutScroll();\n }\n }\n }\n\n abstract _closeWizard(): void;\n\n abstract _renderSteps(): HTMLTemplateResult;\n\n abstract _renderLogo(): HTMLTemplateResult; \n\n abstract _submitWizard():void; \n\n static _timeOutScroll() {\n window.setTimeout(() => {\n window.scrollTo({\n top: 0,\n left: 0,\n behavior: 'smooth',\n });\n }, 100);\n }\n\n}"]}
|
|
1
|
+
{"version":3,"file":"default-wizard.js","sourceRoot":"","sources":["../../../src/defaultpage/default-wizard.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAsB,MAAM,KAAK,CAAC;AAC/C,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAE,GAAG,EAAE,MAAM,eAAe,CAAC;AAEpC,OAAO,uDAAuD,CAAC;AAC/D,OAAO,iDAAiD,CAAC;AAEzD,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,+BAA+B,EAAE,MAAM,uBAAuB,CAAC;AACxE,O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,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;qDACrB;AAGnB;IADC,QAAQ,CAAC,EAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;0DACV","sourcesContent":["import { html, HTMLTemplateResult } from \"lit\";\nimport { property } from \"lit/decorators.js\";\nimport { msg } from \"@lit/localize\";\n\nimport '@progressive-development/pd-dialog/pd-popup-dialog.js';\nimport '@progressive-development/pd-wizard/pd-wizard.js';\n\nimport { DefaultViewPage } from \"./default-view-page.js\";\nimport { RUNNING_WIZARD_STORAGE_ELEMENTS } from \"../model/spa-model.js\";\nimport { WizardReloadPopup } from \"../popup/wizard-reload-popup.js\";\nimport { WizardClosePopup } from \"../popup/wizard-close-popup.js\";\nimport { ABORT_EVENT_NAME, STORE_EVENT_NAME } from \"./default-confirm-popup.js\";\nimport { DefaultWizardStep } from \"./default-wizard-step.js\";\n\n\n/**\n * TODO: Move inside pd-wizard.\n */\nexport abstract class DefaultWizard<T> extends DefaultViewPage {\n \n protected panelWizard:boolean = false;\n\n @property({ type: Array, state: true })\n abstract _wizardSteps: Array<{\n title: string, \n name: string,\n key: string\n }>; \n\n @property({ type: Number, state: true })\n _currentOrderStep: number = 1;\n\n @property({ type: Object, state: true })\n _orderFormData?: T;\n\n @property({type: String, state: true })\n _withLocalStorageId?: string;\n\n\n render() {\n return html`\n <pd-wizard \n id=\"wizardId\"\n ?panelWizard=\"${this.panelWizard}\"\n currentNumber=\"${this._currentOrderStep}\"\n .wizardSteps=\"${this._wizardSteps}\" \n @next-step=\"${this._nextStep}\"\n @previous-step=\"${this._previousStep}\"\n @submit-wizard=\"${this._nextStep}\"\n @go-to=\"${this._goToStep}\"\n @close-wizard=\"${this._closeWizardRequest}\"\n @wizard-step-update=\"${this._doStorageUpdate}\"\n >\n ${this._renderLogo()}\n ${this._renderSteps()}\n </pd-wizard>\n `;\n }\n\n // eslint-disable-next-line class-methods-use-this\n private getWizardStorage():Record<string, {\n orderFormData?: T,\n timestamp: string,\n wizardStep: number,\n }> {\n const storageEl = localStorage.getItem(RUNNING_WIZARD_STORAGE_ELEMENTS);\n return storageEl ? JSON.parse(storageEl) : {};\n }\n\n protected _reloadFromStorage() {\n\n if(this._withLocalStorageId) {\n // Laden\n const storageEl = this.getWizardStorage()[this._withLocalStorageId];\n if (storageEl && storageEl.orderFormData) {\n\n const popup = new WizardReloadPopup();\n popup.reloadItem = storageEl;\n popup.okButtonText = msg(\"Fortsetzen\", {id: \"spaH.wizard.reload.popup.ok\"});\n popup.cancelButtonText = msg(\"Verwerfen\", {id: \"spaH.wizard.reload.popup.cancel\"});\n\n popup.addEventListener(ABORT_EVENT_NAME, () => {\n this._removeFromStorage()\n this.shadowRoot?.removeChild(popup);\n });\n\n popup.addEventListener(STORE_EVENT_NAME, () => {\n console.debug(`Reload storage element from ${storageEl.timestamp}`);\n this._orderFormData = storageEl.orderFormData;\n this._currentOrderStep = storageEl.wizardStep;\n this.shadowRoot?.removeChild(popup);\n\n const slot = this.shadowRoot?.querySelector('slot');\n if (!slot) return; \n // Hole alle zugewiesenen Elemente\n const allElements = slot.assignedElements({ flatten: true });\n\n // Filtere nur die Elemente, die Instanzen von DefaultWizardStep sind\n const stepElements = allElements.filter(\n (el): el is DefaultWizardStep<any, any> =>\n el instanceof DefaultWizardStep &&\n typeof el.slot === 'string' &&\n el.slot.startsWith('step-')\n );\n\n // Führe die gewünschte Methode für jedes gefilterte Element aus\n stepElements.forEach((step) => {\n step.reloadFromOrder?.(this._orderFormData);\n });\n\n });\n\n this.shadowRoot?.appendChild(popup); \n } \n }\n }\n\n protected _doStorageUpdate() {\n if (this._withLocalStorageId) {\n const storageWizard = this.getWizardStorage();\n storageWizard[this._withLocalStorageId] = {\n orderFormData: this._orderFormData,\n wizardStep: this._currentOrderStep,\n timestamp: new Date().toUTCString(),\n }\n localStorage.setItem(RUNNING_WIZARD_STORAGE_ELEMENTS, JSON.stringify(storageWizard));\n console.debug(`Update wizard local storage for key ${this._withLocalStorageId}`);\n }\n }\n\n protected _removeFromStorage() {\n if (this._withLocalStorageId) {\n // remote storage element\n const storageWizard = this.getWizardStorage();\n delete storageWizard[this._withLocalStorageId];\n localStorage.setItem(\n RUNNING_WIZARD_STORAGE_ELEMENTS, \n JSON.stringify(storageWizard)\n );\n console.debug(`Remove wizard local storage for key ${this._withLocalStorageId}`);\n }\n }\n\n _nextStep(e:CustomEvent) {\n const setNextStep = () => {\n if (this._currentOrderStep < this._wizardSteps.length) {\n this._currentOrderStep += 1;\n\n if (this._withLocalStorageId) {\n this._doStorageUpdate();\n }\n \n if (!this.panelWizard) {\n DefaultWizard._timeOutScroll();\n }\n }\n };\n\n const detail:any = {\n errorMap: new Map(),\n formData: {},\n currentOrder: this._orderFormData,\n };\n\n const curentStepEl:any = this.shadowRoot?.getElementById(\n `wiz${this._currentOrderStep}Id`\n );\n\n /**\n * Trigger validate event. After that, detail members prepared by \n * event process and can handle synchronously.\n */\n curentStepEl.dispatchEvent(new CustomEvent('validate-form', { detail }));\n\n if (detail.errorMap.size === 0) {\n if (detail.preparedOrder) {\n this._orderFormData = detail.preparedOrder;\n }\n if (this._wizardSteps.length === this._currentOrderStep) {\n // Now submit wizard\n e.detail.submited = true;\n this._submitWizard();\n } else {\n setNextStep();\n }\n } else {\n console.log('Validation rejected: ', detail);\n }\n }\n\n _previousStep() {\n if (this._currentOrderStep > 1) {\n this._currentOrderStep -= 1;\n if (!this.panelWizard) {\n DefaultWizard._timeOutScroll();\n } \n }\n }\n\n _goToStep(e: any) {\n const stepNr = e.detail.step;\n if (stepNr > 0 && stepNr <= this._wizardSteps.length) {\n this._currentOrderStep = Number(stepNr);\n if (!this.panelWizard) {\n DefaultWizard._timeOutScroll();\n }\n }\n }\n\n _closeWizardRequest(): void {\n\n if (this._withLocalStorageId) {\n const popup = new WizardClosePopup();\n popup.withStorage = true;\n popup.okButtonText = msg(\"Speichern\", {id: \"spaH.wizard.storage.close.popup.ok\"});\n popup.cancelButtonText = msg(\"Verwerfen\", {id: \"spaH.wizard.storage.close.popup.cancel\"});\n \n popup.addEventListener(ABORT_EVENT_NAME, () => {\n this._removeFromStorage()\n this.shadowRoot?.removeChild(popup);\n this._closeWizard();\n });\n \n popup.addEventListener(STORE_EVENT_NAME, () => {\n this._doStorageUpdate();\n this.shadowRoot?.removeChild(popup);\n this._closeWizard();\n });\n\n this.shadowRoot?.appendChild(popup);\n\n } else {\n\n const popup = new WizardClosePopup();\n popup.withStorage = false;\n popup.okButtonText = msg(\"Schließen\", {id: \"spaH.wizard.close.popup.ok\"});\n popup.cancelButtonText = msg(\"Abbrechen\", {id: \"spaH.wizard.close.popup.cancel\"});\n\n popup.addEventListener(ABORT_EVENT_NAME, () => {\n this.shadowRoot?.removeChild(popup);\n });\n \n popup.addEventListener(STORE_EVENT_NAME, () => {\n this.shadowRoot?.removeChild(popup);\n this._closeWizard();\n });\n\n this.shadowRoot?.appendChild(popup);\n }\n }\n\n abstract _closeWizard(): void;\n\n abstract _renderSteps(): HTMLTemplateResult;\n\n abstract _renderLogo(): HTMLTemplateResult; \n\n abstract _submitWizard():void; \n\n static _timeOutScroll() {\n window.setTimeout(() => {\n window.scrollTo({\n top: 0,\n left: 0,\n behavior: 'smooth',\n });\n }, 100);\n }\n\n}"]}
|
|
@@ -1,4 +1,15 @@
|
|
|
1
1
|
export declare const templates: {
|
|
2
2
|
'spaH.loadingstate.syncState': string;
|
|
3
3
|
'spaH.loadingstate.pleaseWait': string;
|
|
4
|
+
'spaH.wizard.reload.popup.title': string;
|
|
5
|
+
'spaH.wizard.reload.popup.content': string;
|
|
6
|
+
'spaH.wizard.close.popup.title': string;
|
|
7
|
+
'spaH.wizard.close.popup.storage.content': string;
|
|
8
|
+
'spaH.wizard.reload.popup.noStorage.content': string;
|
|
9
|
+
'spaH.wizard.reload.popup.ok': string;
|
|
10
|
+
'spaH.wizard.reload.popup.cancel': string;
|
|
11
|
+
'spaH.wizard.storage.close.popup.ok': string;
|
|
12
|
+
'spaH.wizard.storage.close.popup.cancel': string;
|
|
13
|
+
'spaH.wizard.close.popup.ok': string;
|
|
14
|
+
'spaH.wizard.close.popup.cancel': string;
|
|
4
15
|
};
|
|
@@ -1,4 +1,15 @@
|
|
|
1
1
|
export declare const templates: {
|
|
2
2
|
'spaH.loadingstate.pleaseWait': string;
|
|
3
3
|
'spaH.loadingstate.syncState': string;
|
|
4
|
+
'spaH.wizard.close.popup.cancel': string;
|
|
5
|
+
'spaH.wizard.close.popup.ok': string;
|
|
6
|
+
'spaH.wizard.close.popup.storage.content': string;
|
|
7
|
+
'spaH.wizard.close.popup.title': string;
|
|
8
|
+
'spaH.wizard.reload.popup.cancel': string;
|
|
9
|
+
'spaH.wizard.reload.popup.content': string;
|
|
10
|
+
'spaH.wizard.reload.popup.noStorage.content': string;
|
|
11
|
+
'spaH.wizard.reload.popup.ok': string;
|
|
12
|
+
'spaH.wizard.reload.popup.title': string;
|
|
13
|
+
'spaH.wizard.storage.close.popup.cancel': string;
|
|
14
|
+
'spaH.wizard.storage.close.popup.ok': string;
|
|
4
15
|
};
|
|
@@ -5,5 +5,16 @@
|
|
|
5
5
|
export const templates = {
|
|
6
6
|
'spaH.loadingstate.pleaseWait': `Gegevens worden geladen`,
|
|
7
7
|
'spaH.loadingstate.syncState': `Gegevens worden gesynchroniseerd`,
|
|
8
|
+
'spaH.wizard.close.popup.cancel': `Annuleren`,
|
|
9
|
+
'spaH.wizard.close.popup.ok': `Sluiten`,
|
|
10
|
+
'spaH.wizard.close.popup.storage.content': `De huidige invoer kan worden opgeslagen voor later bewerken of worden verwijderd. Welke actie wilt u uitvoeren?`,
|
|
11
|
+
'spaH.wizard.close.popup.title': `Bewerking annuleren`,
|
|
12
|
+
'spaH.wizard.reload.popup.cancel': `Verwijderen`,
|
|
13
|
+
'spaH.wizard.reload.popup.content': `Er zijn al gegevens opgeslagen voor dit formulier. Wilt u doorgaan met bewerken of een nieuwe invoer starten? Bij een nieuwe invoer worden de bestaande gegevens verwijderd.`,
|
|
14
|
+
'spaH.wizard.reload.popup.noStorage.content': `De huidige invoer gaat onherroepelijk verloren na het sluiten. Toch sluiten?`,
|
|
15
|
+
'spaH.wizard.reload.popup.ok': `Doorgaan`,
|
|
16
|
+
'spaH.wizard.reload.popup.title': `Doorgaan met bewerken?`,
|
|
17
|
+
'spaH.wizard.storage.close.popup.cancel': `Verwijderen`,
|
|
18
|
+
'spaH.wizard.storage.close.popup.ok': `Opslaan`,
|
|
8
19
|
};
|
|
9
20
|
//# sourceMappingURL=be.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"be.js","sourceRoot":"","sources":["../../../../src/generated/locales/be.ts"],"names":[],"mappings":"AACI,mCAAmC;AACnC,gDAAgD;AAKhD,4CAA4C;AAC5C,uDAAuD;AAEvD,MAAM,CAAC,MAAM,SAAS,GAAG;IACvB,8BAA8B,EAAE,yBAAyB;IAC/D,6BAA6B,EAAE,kCAAkC;
|
|
1
|
+
{"version":3,"file":"be.js","sourceRoot":"","sources":["../../../../src/generated/locales/be.ts"],"names":[],"mappings":"AACI,mCAAmC;AACnC,gDAAgD;AAKhD,4CAA4C;AAC5C,uDAAuD;AAEvD,MAAM,CAAC,MAAM,SAAS,GAAG;IACvB,8BAA8B,EAAE,yBAAyB;IAC/D,6BAA6B,EAAE,kCAAkC;IACjE,gCAAgC,EAAE,WAAW;IAC7C,4BAA4B,EAAE,SAAS;IACvC,yCAAyC,EAAE,iHAAiH;IAC5J,+BAA+B,EAAE,qBAAqB;IACtD,iCAAiC,EAAE,aAAa;IAChD,kCAAkC,EAAE,8KAA8K;IAClN,4CAA4C,EAAE,8EAA8E;IAC5H,6BAA6B,EAAE,UAAU;IACzC,gCAAgC,EAAE,wBAAwB;IAC1D,wCAAwC,EAAE,aAAa;IACvD,oCAAoC,EAAE,SAAS;CAC1C,CAAC","sourcesContent":["\n // Do not modify this file by hand!\n // Re-generate this file by running lit-localize\n\n \n \n\n /* eslint-disable no-irregular-whitespace */\n /* eslint-disable @typescript-eslint/no-explicit-any */\n\n export const templates = {\n 'spaH.loadingstate.pleaseWait': `Gegevens worden geladen`,\n'spaH.loadingstate.syncState': `Gegevens worden gesynchroniseerd`,\n'spaH.wizard.close.popup.cancel': `Annuleren`,\n'spaH.wizard.close.popup.ok': `Sluiten`,\n'spaH.wizard.close.popup.storage.content': `De huidige invoer kan worden opgeslagen voor later bewerken of worden verwijderd. Welke actie wilt u uitvoeren?`,\n'spaH.wizard.close.popup.title': `Bewerking annuleren`,\n'spaH.wizard.reload.popup.cancel': `Verwijderen`,\n'spaH.wizard.reload.popup.content': `Er zijn al gegevens opgeslagen voor dit formulier. Wilt u doorgaan met bewerken of een nieuwe invoer starten? Bij een nieuwe invoer worden de bestaande gegevens verwijderd.`,\n'spaH.wizard.reload.popup.noStorage.content': `De huidige invoer gaat onherroepelijk verloren na het sluiten. Toch sluiten?`,\n'spaH.wizard.reload.popup.ok': `Doorgaan`,\n'spaH.wizard.reload.popup.title': `Doorgaan met bewerken?`,\n'spaH.wizard.storage.close.popup.cancel': `Verwijderen`,\n'spaH.wizard.storage.close.popup.ok': `Opslaan`,\n };\n "]}
|
|
@@ -1,4 +1,15 @@
|
|
|
1
1
|
export declare const templates: {
|
|
2
2
|
'spaH.loadingstate.syncState': string;
|
|
3
3
|
'spaH.loadingstate.pleaseWait': string;
|
|
4
|
+
'spaH.wizard.reload.popup.title': string;
|
|
5
|
+
'spaH.wizard.reload.popup.content': string;
|
|
6
|
+
'spaH.wizard.close.popup.title': string;
|
|
7
|
+
'spaH.wizard.close.popup.storage.content': string;
|
|
8
|
+
'spaH.wizard.reload.popup.noStorage.content': string;
|
|
9
|
+
'spaH.wizard.reload.popup.ok': string;
|
|
10
|
+
'spaH.wizard.reload.popup.cancel': string;
|
|
11
|
+
'spaH.wizard.storage.close.popup.ok': string;
|
|
12
|
+
'spaH.wizard.storage.close.popup.cancel': string;
|
|
13
|
+
'spaH.wizard.close.popup.ok': string;
|
|
14
|
+
'spaH.wizard.close.popup.cancel': string;
|
|
4
15
|
};
|
|
@@ -5,5 +5,16 @@
|
|
|
5
5
|
export const templates = {
|
|
6
6
|
'spaH.loadingstate.syncState': `Daten werden synchronisiert`,
|
|
7
7
|
'spaH.loadingstate.pleaseWait': `Bitte warten, Daten werden geladen`,
|
|
8
|
+
'spaH.wizard.reload.popup.title': `Bearbeitung fortsetzen?`,
|
|
9
|
+
'spaH.wizard.reload.popup.content': `Für dieses Formular wurden bereits Daten gespeichert. Soll die Bearbeitung fortgesetzt, oder eine neue Dateneingabe gestartet werden? Bei einer neuen Eingabe werden die bisherigen Daten verworfen.`,
|
|
10
|
+
'spaH.wizard.close.popup.title': `Bearbeitung abbrechen`,
|
|
11
|
+
'spaH.wizard.close.popup.storage.content': `Die aktuellen Eingaben können für eine spätere Bearbeitung gespeichert oder verworfen werden. Welche Aktion soll ausgeführt werden?`,
|
|
12
|
+
'spaH.wizard.reload.popup.noStorage.content': `Die aktuellen Eingaben gehen nach dem Schließen unwiderruflich verloren. Dennoch schließen?`,
|
|
13
|
+
'spaH.wizard.reload.popup.ok': `Fortsetzen`,
|
|
14
|
+
'spaH.wizard.reload.popup.cancel': `Verwerfen`,
|
|
15
|
+
'spaH.wizard.storage.close.popup.ok': `Speichern`,
|
|
16
|
+
'spaH.wizard.storage.close.popup.cancel': `Verwerfen`,
|
|
17
|
+
'spaH.wizard.close.popup.ok': `Schließen`,
|
|
18
|
+
'spaH.wizard.close.popup.cancel': `Abbrechen`,
|
|
8
19
|
};
|
|
9
20
|
//# sourceMappingURL=de.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"de.js","sourceRoot":"","sources":["../../../../src/generated/locales/de.ts"],"names":[],"mappings":"AACI,mCAAmC;AACnC,gDAAgD;AAKhD,4CAA4C;AAC5C,uDAAuD;AAEvD,MAAM,CAAC,MAAM,SAAS,GAAG;IACvB,6BAA6B,EAAE,6BAA6B;IAClE,8BAA8B,EAAE,oCAAoC;
|
|
1
|
+
{"version":3,"file":"de.js","sourceRoot":"","sources":["../../../../src/generated/locales/de.ts"],"names":[],"mappings":"AACI,mCAAmC;AACnC,gDAAgD;AAKhD,4CAA4C;AAC5C,uDAAuD;AAEvD,MAAM,CAAC,MAAM,SAAS,GAAG;IACvB,6BAA6B,EAAE,6BAA6B;IAClE,8BAA8B,EAAE,oCAAoC;IACpE,gCAAgC,EAAE,yBAAyB;IAC3D,kCAAkC,EAAE,sMAAsM;IAC1O,+BAA+B,EAAE,uBAAuB;IACxD,yCAAyC,EAAE,qIAAqI;IAChL,4CAA4C,EAAE,6FAA6F;IAC3I,6BAA6B,EAAE,YAAY;IAC3C,iCAAiC,EAAE,WAAW;IAC9C,oCAAoC,EAAE,WAAW;IACjD,wCAAwC,EAAE,WAAW;IACrD,4BAA4B,EAAE,WAAW;IACzC,gCAAgC,EAAE,WAAW;CACxC,CAAC","sourcesContent":["\n // Do not modify this file by hand!\n // Re-generate this file by running lit-localize\n\n \n \n\n /* eslint-disable no-irregular-whitespace */\n /* eslint-disable @typescript-eslint/no-explicit-any */\n\n export const templates = {\n 'spaH.loadingstate.syncState': `Daten werden synchronisiert`,\n'spaH.loadingstate.pleaseWait': `Bitte warten, Daten werden geladen`,\n'spaH.wizard.reload.popup.title': `Bearbeitung fortsetzen?`,\n'spaH.wizard.reload.popup.content': `Für dieses Formular wurden bereits Daten gespeichert. Soll die Bearbeitung fortgesetzt, oder eine neue Dateneingabe gestartet werden? Bei einer neuen Eingabe werden die bisherigen Daten verworfen.`,\n'spaH.wizard.close.popup.title': `Bearbeitung abbrechen`,\n'spaH.wizard.close.popup.storage.content': `Die aktuellen Eingaben können für eine spätere Bearbeitung gespeichert oder verworfen werden. Welche Aktion soll ausgeführt werden?`,\n'spaH.wizard.reload.popup.noStorage.content': `Die aktuellen Eingaben gehen nach dem Schließen unwiderruflich verloren. Dennoch schließen?`,\n'spaH.wizard.reload.popup.ok': `Fortsetzen`,\n'spaH.wizard.reload.popup.cancel': `Verwerfen`,\n'spaH.wizard.storage.close.popup.ok': `Speichern`,\n'spaH.wizard.storage.close.popup.cancel': `Verwerfen`,\n'spaH.wizard.close.popup.ok': `Schließen`,\n'spaH.wizard.close.popup.cancel': `Abbrechen`,\n };\n "]}
|
|
@@ -1,4 +1,15 @@
|
|
|
1
1
|
export declare const templates: {
|
|
2
|
+
'spaH.wizard.close.popup.cancel': string;
|
|
3
|
+
'spaH.wizard.close.popup.ok': string;
|
|
4
|
+
'spaH.wizard.close.popup.storage.content': string;
|
|
5
|
+
'spaH.wizard.close.popup.title': string;
|
|
6
|
+
'spaH.wizard.reload.popup.cancel': string;
|
|
7
|
+
'spaH.wizard.reload.popup.content': string;
|
|
8
|
+
'spaH.wizard.reload.popup.noStorage.content': string;
|
|
9
|
+
'spaH.wizard.reload.popup.ok': string;
|
|
10
|
+
'spaH.wizard.reload.popup.title': string;
|
|
11
|
+
'spaH.wizard.storage.close.popup.cancel': string;
|
|
12
|
+
'spaH.wizard.storage.close.popup.ok': string;
|
|
2
13
|
'spaH.loadingstate.syncState': string;
|
|
3
14
|
'spaH.loadingstate.pleaseWait': string;
|
|
4
15
|
};
|
|
@@ -3,6 +3,17 @@
|
|
|
3
3
|
/* eslint-disable no-irregular-whitespace */
|
|
4
4
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
5
5
|
export const templates = {
|
|
6
|
+
'spaH.wizard.close.popup.cancel': `Cancel`,
|
|
7
|
+
'spaH.wizard.close.popup.ok': `Close`,
|
|
8
|
+
'spaH.wizard.close.popup.storage.content': `The current inputs can be saved for later editing or discarded. Which action should be taken?`,
|
|
9
|
+
'spaH.wizard.close.popup.title': `Cancel editing`,
|
|
10
|
+
'spaH.wizard.reload.popup.cancel': `Discard`,
|
|
11
|
+
'spaH.wizard.reload.popup.content': `Data has already been saved for this form. Would you like to continue editing or start a new entry? Starting a new entry will discard the existing data.`,
|
|
12
|
+
'spaH.wizard.reload.popup.noStorage.content': `The current inputs will be permanently lost after closing. Close anyway?`,
|
|
13
|
+
'spaH.wizard.reload.popup.ok': `Continue`,
|
|
14
|
+
'spaH.wizard.reload.popup.title': `Continue editing?`,
|
|
15
|
+
'spaH.wizard.storage.close.popup.cancel': `Discard`,
|
|
16
|
+
'spaH.wizard.storage.close.popup.ok': `Save`,
|
|
6
17
|
'spaH.loadingstate.syncState': `Daten werden synchronisiert`,
|
|
7
18
|
'spaH.loadingstate.pleaseWait': `Bitte warten, Daten werden geladen`,
|
|
8
19
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"en.js","sourceRoot":"","sources":["../../../../src/generated/locales/en.ts"],"names":[],"mappings":"AACI,mCAAmC;AACnC,gDAAgD;AAKhD,4CAA4C;AAC5C,uDAAuD;AAEvD,MAAM,CAAC,MAAM,SAAS,GAAG;IACvB,6BAA6B,EAAE,6BAA6B;
|
|
1
|
+
{"version":3,"file":"en.js","sourceRoot":"","sources":["../../../../src/generated/locales/en.ts"],"names":[],"mappings":"AACI,mCAAmC;AACnC,gDAAgD;AAKhD,4CAA4C;AAC5C,uDAAuD;AAEvD,MAAM,CAAC,MAAM,SAAS,GAAG;IACvB,gCAAgC,EAAE,QAAQ;IAChD,4BAA4B,EAAE,OAAO;IACrC,yCAAyC,EAAE,+FAA+F;IAC1I,+BAA+B,EAAE,gBAAgB;IACjD,iCAAiC,EAAE,SAAS;IAC5C,kCAAkC,EAAE,0JAA0J;IAC9L,4CAA4C,EAAE,0EAA0E;IACxH,6BAA6B,EAAE,UAAU;IACzC,gCAAgC,EAAE,mBAAmB;IACrD,wCAAwC,EAAE,SAAS;IACnD,oCAAoC,EAAE,MAAM;IAC5C,6BAA6B,EAAE,6BAA6B;IAC5D,8BAA8B,EAAE,oCAAoC;CAC/D,CAAC","sourcesContent":["\n // Do not modify this file by hand!\n // Re-generate this file by running lit-localize\n\n \n \n\n /* eslint-disable no-irregular-whitespace */\n /* eslint-disable @typescript-eslint/no-explicit-any */\n\n export const templates = {\n 'spaH.wizard.close.popup.cancel': `Cancel`,\n'spaH.wizard.close.popup.ok': `Close`,\n'spaH.wizard.close.popup.storage.content': `The current inputs can be saved for later editing or discarded. Which action should be taken?`,\n'spaH.wizard.close.popup.title': `Cancel editing`,\n'spaH.wizard.reload.popup.cancel': `Discard`,\n'spaH.wizard.reload.popup.content': `Data has already been saved for this form. Would you like to continue editing or start a new entry? Starting a new entry will discard the existing data.`,\n'spaH.wizard.reload.popup.noStorage.content': `The current inputs will be permanently lost after closing. Close anyway?`,\n'spaH.wizard.reload.popup.ok': `Continue`,\n'spaH.wizard.reload.popup.title': `Continue editing?`,\n'spaH.wizard.storage.close.popup.cancel': `Discard`,\n'spaH.wizard.storage.close.popup.ok': `Save`,\n'spaH.loadingstate.syncState': `Daten werden synchronisiert`,\n'spaH.loadingstate.pleaseWait': `Bitte warten, Daten werden geladen`,\n };\n "]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"spa-model.js","sourceRoot":"","sources":["../../../src/model/spa-model.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,cAAc,GAAG,cAAc,CAAC","sourcesContent":["export const APP_CONF_EVENT = \"get-app-conf\";\n\nexport interface LoadingSubTask {\n actionKey: string\n completed: boolean,\n loadingTxt: string, \n}\n\nexport interface LoadingState {\n creation?: Date,\n isLoading: boolean,\n actionKey: string\n modal?: boolean,\n smallBackground?: boolean,\n loadingTxt?: string,\n subTask?: LoadingSubTask[],\n}\n\n"]}
|
|
1
|
+
{"version":3,"file":"spa-model.js","sourceRoot":"","sources":["../../../src/model/spa-model.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,cAAc,GAAG,cAAc,CAAC;AAE7C,MAAM,CAAC,MAAM,+BAA+B,GAAG,6BAA6B,CAAC","sourcesContent":["export const APP_CONF_EVENT = \"get-app-conf\";\n\nexport const RUNNING_WIZARD_STORAGE_ELEMENTS = \"pd.spa.local.wizard.storage\";\n\nexport interface LoadingSubTask {\n actionKey: string\n completed: boolean,\n loadingTxt: string, \n}\n\nexport interface LoadingState {\n creation?: Date,\n isLoading: boolean,\n actionKey: string\n modal?: boolean,\n smallBackground?: boolean,\n loadingTxt?: string,\n subTask?: LoadingSubTask[],\n}\n\n"]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { CSSResultGroup } from "lit";
|
|
2
|
+
import { DefaultConfirmPopup, PopupType } from "../defaultpage/default-confirm-popup.js";
|
|
3
|
+
export declare class WizardClosePopup extends DefaultConfirmPopup {
|
|
4
|
+
_singleButton: boolean;
|
|
5
|
+
_type: PopupType;
|
|
6
|
+
_popupTitle: string;
|
|
7
|
+
withStorage: boolean;
|
|
8
|
+
static styles: CSSResultGroup;
|
|
9
|
+
_renderContent(): import("lit").TemplateResult<1>;
|
|
10
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { __decorate } from "tslib";
|
|
2
|
+
import { html, css } from "lit";
|
|
3
|
+
import { customElement, property } from "lit/decorators.js";
|
|
4
|
+
import { msg } from "@lit/localize";
|
|
5
|
+
import { DefaultConfirmPopup } from "../defaultpage/default-confirm-popup.js";
|
|
6
|
+
let WizardClosePopup = class WizardClosePopup extends DefaultConfirmPopup {
|
|
7
|
+
constructor() {
|
|
8
|
+
super(...arguments);
|
|
9
|
+
this._singleButton = false;
|
|
10
|
+
this._type = "warn";
|
|
11
|
+
this._popupTitle = msg("Bearbeitung abbrechen", { id: "spaH.wizard.close.popup.title" });
|
|
12
|
+
this.withStorage = false;
|
|
13
|
+
}
|
|
14
|
+
// eslint-disable-next-line class-methods-use-this
|
|
15
|
+
_renderContent() {
|
|
16
|
+
return html `
|
|
17
|
+
<div class="popup-content" slot="content">
|
|
18
|
+
<p>
|
|
19
|
+
${this.withStorage ?
|
|
20
|
+
msg("Die aktuellen Eingaben können für eine spätere Bearbeitung gespeichert oder verworfen werden. Welche Aktion soll ausgeführt werden?", { id: "spaH.wizard.close.popup.storage.content" })
|
|
21
|
+
: msg("Die aktuellen Eingaben gehen nach dem Schließen unwiderruflich verloren. Dennoch schließen?", { id: "spaH.wizard.reload.popup.noStorage.content" })}
|
|
22
|
+
</p>
|
|
23
|
+
</div>
|
|
24
|
+
`;
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
WizardClosePopup.styles = [
|
|
28
|
+
DefaultConfirmPopup.styles,
|
|
29
|
+
css `
|
|
30
|
+
|
|
31
|
+
:host {
|
|
32
|
+
--pd-popup-max-width: 80%;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.popup-content {
|
|
36
|
+
display: flex;
|
|
37
|
+
flex-direction: column;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
`
|
|
41
|
+
];
|
|
42
|
+
__decorate([
|
|
43
|
+
property({ type: Boolean })
|
|
44
|
+
], WizardClosePopup.prototype, "withStorage", void 0);
|
|
45
|
+
WizardClosePopup = __decorate([
|
|
46
|
+
customElement('wizard-close-popup')
|
|
47
|
+
], WizardClosePopup);
|
|
48
|
+
export { WizardClosePopup };
|
|
49
|
+
//# sourceMappingURL=wizard-close-popup.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wizard-close-popup.js","sourceRoot":"","sources":["../../../src/popup/wizard-close-popup.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,GAAG,EAAkB,MAAM,KAAK,CAAC;AAChD,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,EAAE,GAAG,EAAE,MAAM,eAAe,CAAC;AAEpC,OAAO,EAAE,mBAAmB,EAAa,MAAM,yCAAyC,CAAC;AAIlF,IAAM,gBAAgB,GAAtB,MAAM,gBAAiB,SAAQ,mBAAmB;IAAlD;;QAEL,kBAAa,GAAG,KAAK,CAAC;QAEtB,UAAK,GAAc,MAAM,CAAC;QAE1B,gBAAW,GAAG,GAAG,CAAC,uBAAuB,EAAE,EAAC,EAAE,EAAE,+BAA+B,EAAC,CAAC,CAAC;QAIlF,gBAAW,GAAY,KAAK,CAAC;IAiC/B,CAAC;IAdC,kDAAkD;IAClD,cAAc;QACZ,OAAO,IAAI,CAAA;;;YAGH,IAAI,CAAC,WAAW,CAAC,CAAC;YAClB,GAAG,CAAC,qIAAqI,EAAE,EAAC,EAAE,EAAE,yCAAyC,EAAC,CAAC;YAC1L,CAAC,CAAC,GAAG,CAAC,6FAA6F,EAAE,EAAC,EAAE,EAAE,4CAA4C,EAAC,CAC1J;;;KAGL,CAAC;IACJ,CAAC;;AA7BM,uBAAM,GAAG;IACd,mBAAmB,CAAC,MAAM;IAC1B,GAAG,CAAA;;;;;;;;;;;KAWF;CACgB,CAAC;AAhBpB;IADC,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAC,CAAC;qDACG;AAVlB,gBAAgB;IAD5B,aAAa,CAAC,oBAAoB,CAAC;GACvB,gBAAgB,CA2C5B;SA3CY,gBAAgB","sourcesContent":["import { html, css, CSSResultGroup } from \"lit\";\nimport { customElement, property } from \"lit/decorators.js\";\nimport { msg } from \"@lit/localize\";\n\nimport { DefaultConfirmPopup, PopupType } from \"../defaultpage/default-confirm-popup.js\";\n\n\n@customElement('wizard-close-popup')\nexport class WizardClosePopup extends DefaultConfirmPopup {\n\n _singleButton = false;\n\n _type: PopupType = \"warn\";\n\n _popupTitle = msg(\"Bearbeitung abbrechen\", {id: \"spaH.wizard.close.popup.title\"});\n\n\n @property({type: Boolean})\n withStorage: boolean = false; \n\n static styles = [ \n DefaultConfirmPopup.styles,\n css`\n\n :host {\n --pd-popup-max-width: 80%;\n }\n\n .popup-content {\n display: flex;\n flex-direction: column;\n }\n\n `\n ] as CSSResultGroup;\n \n\n // eslint-disable-next-line class-methods-use-this\n _renderContent() { \n return html`\n <div class=\"popup-content\" slot=\"content\">\n <p>\n ${this.withStorage ? \n msg(\"Die aktuellen Eingaben können für eine spätere Bearbeitung gespeichert oder verworfen werden. Welche Aktion soll ausgeführt werden?\", {id: \"spaH.wizard.close.popup.storage.content\"})\n : msg(\"Die aktuellen Eingaben gehen nach dem Schließen unwiderruflich verloren. Dennoch schließen?\", {id: \"spaH.wizard.reload.popup.noStorage.content\"})\n }\n </p>\n </div> \n `;\n }\n\n}\n"]}
|