@progressive-development/pd-spa-helper 0.3.61 → 0.3.63
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.d.ts +6 -0
- package/dist/src/defaultpage/default-wizard.js +103 -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/service-provider/firebase/auth.js +18 -1
- package/dist/src/service-provider/firebase/auth.js.map +1 -1
- 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.ts +123 -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/service-provider/firebase/auth.ts +20 -2
- 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}"]}
|
|
@@ -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,14 @@
|
|
|
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";
|
|
7
12
|
/**
|
|
8
13
|
* TODO: Move inside pd-wizard.
|
|
9
14
|
*/
|
|
@@ -24,18 +29,74 @@ export class DefaultWizard extends DefaultViewPage {
|
|
|
24
29
|
@previous-step="${this._previousStep}"
|
|
25
30
|
@submit-wizard="${this._nextStep}"
|
|
26
31
|
@go-to="${this._goToStep}"
|
|
27
|
-
@close-wizard="${this.
|
|
32
|
+
@close-wizard="${this._closeWizardRequest}"
|
|
33
|
+
@wizard-step-update="${this._doStorageUpdate}"
|
|
28
34
|
>
|
|
29
35
|
${this._renderLogo()}
|
|
30
36
|
${this._renderSteps()}
|
|
31
37
|
</pd-wizard>
|
|
32
38
|
`;
|
|
33
39
|
}
|
|
40
|
+
// eslint-disable-next-line class-methods-use-this
|
|
41
|
+
getWizardStorage() {
|
|
42
|
+
const storageEl = localStorage.getItem(RUNNING_WIZARD_STORAGE_ELEMENTS);
|
|
43
|
+
return storageEl ? JSON.parse(storageEl) : {};
|
|
44
|
+
}
|
|
45
|
+
_reloadFromStorage() {
|
|
46
|
+
var _a;
|
|
47
|
+
if (this._withLocalStorageId) {
|
|
48
|
+
// Laden
|
|
49
|
+
const storageEl = this.getWizardStorage()[this._withLocalStorageId];
|
|
50
|
+
if (storageEl) {
|
|
51
|
+
const popup = new WizardReloadPopup();
|
|
52
|
+
popup.reloadItem = storageEl;
|
|
53
|
+
popup.okButtonText = msg("Fortsetzen", { id: "spaH.wizard.reload.popup.ok" });
|
|
54
|
+
popup.cancelButtonText = msg("Verwerfen", { id: "spaH.wizard.reload.popup.cancel" });
|
|
55
|
+
popup.addEventListener(ABORT_EVENT_NAME, () => {
|
|
56
|
+
var _a;
|
|
57
|
+
this._removeFromStorage();
|
|
58
|
+
(_a = this.shadowRoot) === null || _a === void 0 ? void 0 : _a.removeChild(popup);
|
|
59
|
+
});
|
|
60
|
+
popup.addEventListener(STORE_EVENT_NAME, () => {
|
|
61
|
+
var _a;
|
|
62
|
+
console.debug(`Reload storage element from ${storageEl.timestamp}`);
|
|
63
|
+
this._orderFormData = storageEl.orderFormData;
|
|
64
|
+
this._currentOrderStep = storageEl.wizardStep;
|
|
65
|
+
(_a = this.shadowRoot) === null || _a === void 0 ? void 0 : _a.removeChild(popup);
|
|
66
|
+
});
|
|
67
|
+
(_a = this.shadowRoot) === null || _a === void 0 ? void 0 : _a.appendChild(popup);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
_doStorageUpdate() {
|
|
72
|
+
if (this._withLocalStorageId) {
|
|
73
|
+
const storageWizard = this.getWizardStorage();
|
|
74
|
+
storageWizard[this._withLocalStorageId] = {
|
|
75
|
+
orderFormData: this._orderFormData,
|
|
76
|
+
wizardStep: this._currentOrderStep,
|
|
77
|
+
timestamp: new Date().toUTCString(),
|
|
78
|
+
};
|
|
79
|
+
localStorage.setItem(RUNNING_WIZARD_STORAGE_ELEMENTS, JSON.stringify(storageWizard));
|
|
80
|
+
console.debug(`Update wizard local storage for key ${this._withLocalStorageId}`);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
_removeFromStorage() {
|
|
84
|
+
if (this._withLocalStorageId) {
|
|
85
|
+
// remote storage element
|
|
86
|
+
const storageWizard = this.getWizardStorage();
|
|
87
|
+
delete storageWizard[this._withLocalStorageId];
|
|
88
|
+
localStorage.setItem(RUNNING_WIZARD_STORAGE_ELEMENTS, JSON.stringify(storageWizard));
|
|
89
|
+
console.debug(`Remove wizard local storage for key ${this._withLocalStorageId}`);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
34
92
|
_nextStep(e) {
|
|
35
93
|
var _a;
|
|
36
94
|
const setNextStep = () => {
|
|
37
95
|
if (this._currentOrderStep < this._wizardSteps.length) {
|
|
38
96
|
this._currentOrderStep += 1;
|
|
97
|
+
if (this._withLocalStorageId) {
|
|
98
|
+
this._doStorageUpdate();
|
|
99
|
+
}
|
|
39
100
|
if (!this.panelWizard) {
|
|
40
101
|
DefaultWizard._timeOutScroll();
|
|
41
102
|
}
|
|
@@ -86,6 +147,44 @@ export class DefaultWizard extends DefaultViewPage {
|
|
|
86
147
|
}
|
|
87
148
|
}
|
|
88
149
|
}
|
|
150
|
+
_closeWizardRequest() {
|
|
151
|
+
var _a, _b;
|
|
152
|
+
if (this._withLocalStorageId) {
|
|
153
|
+
const popup = new WizardClosePopup();
|
|
154
|
+
popup.withStorage = true;
|
|
155
|
+
popup.okButtonText = msg("Speichern", { id: "spaH.wizard.storage.close.popup.ok" });
|
|
156
|
+
popup.cancelButtonText = msg("Verwerfen", { id: "spaH.wizard.storage.close.popup.cancel" });
|
|
157
|
+
popup.addEventListener(ABORT_EVENT_NAME, () => {
|
|
158
|
+
var _a;
|
|
159
|
+
this._removeFromStorage();
|
|
160
|
+
(_a = this.shadowRoot) === null || _a === void 0 ? void 0 : _a.removeChild(popup);
|
|
161
|
+
this._closeWizard();
|
|
162
|
+
});
|
|
163
|
+
popup.addEventListener(STORE_EVENT_NAME, () => {
|
|
164
|
+
var _a;
|
|
165
|
+
this._doStorageUpdate();
|
|
166
|
+
(_a = this.shadowRoot) === null || _a === void 0 ? void 0 : _a.removeChild(popup);
|
|
167
|
+
this._closeWizard();
|
|
168
|
+
});
|
|
169
|
+
(_a = this.shadowRoot) === null || _a === void 0 ? void 0 : _a.appendChild(popup);
|
|
170
|
+
}
|
|
171
|
+
else {
|
|
172
|
+
const popup = new WizardClosePopup();
|
|
173
|
+
popup.withStorage = false;
|
|
174
|
+
popup.okButtonText = msg("Schließen", { id: "spaH.wizard.close.popup.ok" });
|
|
175
|
+
popup.cancelButtonText = msg("Abbrechen", { id: "spaH.wizard.close.popup.cancel" });
|
|
176
|
+
popup.addEventListener(ABORT_EVENT_NAME, () => {
|
|
177
|
+
var _a;
|
|
178
|
+
(_a = this.shadowRoot) === null || _a === void 0 ? void 0 : _a.removeChild(popup);
|
|
179
|
+
});
|
|
180
|
+
popup.addEventListener(STORE_EVENT_NAME, () => {
|
|
181
|
+
var _a;
|
|
182
|
+
(_a = this.shadowRoot) === null || _a === void 0 ? void 0 : _a.removeChild(popup);
|
|
183
|
+
this._closeWizard();
|
|
184
|
+
});
|
|
185
|
+
(_b = this.shadowRoot) === null || _b === void 0 ? void 0 : _b.appendChild(popup);
|
|
186
|
+
}
|
|
187
|
+
}
|
|
89
188
|
static _timeOutScroll() {
|
|
90
189
|
window.setTimeout(() => {
|
|
91
190
|
window.scrollTo({
|
|
@@ -105,4 +204,7 @@ __decorate([
|
|
|
105
204
|
__decorate([
|
|
106
205
|
property({ type: Object, state: true })
|
|
107
206
|
], DefaultWizard.prototype, "_orderFormData", void 0);
|
|
207
|
+
__decorate([
|
|
208
|
+
property({ type: String, state: true })
|
|
209
|
+
], DefaultWizard.prototype, "_withLocalStorageId", void 0);
|
|
108
210
|
//# 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,CAAC;AAC/C,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAE7C,OAAO,uDAAuD,CAAC;AAC/D,OAAO,iDAAiD,CAAC;AAEzD,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAEzD;;GAEG;AACH,MAAM,OAAgB,aAAiB,SAAQ,eAAe;IAA9D;;QAEY,gBAAW,GAAW,KAAK,CAAC;QAUtC,sBAAiB,GAAW,CAAC,CAAC;IAwGhC,CAAC;IAlGC,MAAM;QACJ,OAAO,IAAI,CAAA;;;wBAGS,IAAI,CAAC,WAAW;yBACf,IAAI,CAAC,iBAAiB;wBACvB,IAAI,CAAC,YAAY;sBACnB,IAAI,CAAC,SAAS;0BAC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,OAAO,CAAC,GAAG,CAAC,uBAAuB,EAAE,MAAM,CAAC,CAAC;SAC9C;IACH,CAAC;IAED,aAAa;QACX,IAAI,IAAI,CAAC,iBAAiB,GAAG,CAAC,EAAE;YAC9B,IAAI,CAAC,iBAAiB,IAAI,CAAC,CAAC;YAC5B,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE;gBACrB,aAAa,CAAC,cAAc,EAAE,CAAC;aAChC;SACF;IACH,CAAC;IAED,SAAS,CAAC,CAAM;QACd,MAAM,MAAM,GAAG,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC;QAC7B,IAAI,MAAM,GAAG,CAAC,IAAI,MAAM,IAAI,IAAI,CAAC,YAAY,CAAC,MAAM,EAAE;YACpD,IAAI,CAAC,iBAAiB,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC;YACxC,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE;gBACrB,aAAa,CAAC,cAAc,EAAE,CAAC;aAChC;SACF;IACH,CAAC;IAUD,MAAM,CAAC,cAAc;QACnB,MAAM,CAAC,UAAU,CAAC,GAAG,EAAE;YACrB,MAAM,CAAC,QAAQ,CAAC;gBACd,GAAG,EAAE,CAAC;gBACN,IAAI,EAAE,CAAC;gBACP,QAAQ,EAAE,QAAQ;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,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AACpE,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAClE,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAGhF;;GAEG;AACH,MAAM,OAAgB,aAAiB,SAAQ,eAAe;IAA9D;;QAEY,gBAAW,GAAW,KAAK,CAAC;QAUtC,sBAAiB,GAAW,CAAC,CAAC;IA4NhC,CAAC;IAnNC,MAAM;QACJ,OAAO,IAAI,CAAA;;;wBAGS,IAAI,CAAC,WAAW;yBACf,IAAI,CAAC,iBAAiB;wBACvB,IAAI,CAAC,YAAY;sBACnB,IAAI,CAAC,SAAS;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E,KAAK,EAAE,IAAI,EAAE,CAAC;wDACV;AAG9B;IADC,QAAQ,CAAC,EAAE,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\";\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) {\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\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"]}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { CSSResultGroup } from "lit";
|
|
2
|
+
import { DefaultConfirmPopup, PopupType } from "../defaultpage/default-confirm-popup.js";
|
|
3
|
+
export declare class WizardReloadPopup extends DefaultConfirmPopup {
|
|
4
|
+
_singleButton: boolean;
|
|
5
|
+
_type: PopupType;
|
|
6
|
+
_popupTitle: string;
|
|
7
|
+
reloadItem: {
|
|
8
|
+
timestamp: string;
|
|
9
|
+
wizardStep: number;
|
|
10
|
+
};
|
|
11
|
+
static styles: CSSResultGroup;
|
|
12
|
+
_renderContent(): import("lit").TemplateResult<1>;
|
|
13
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
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 WizardReloadPopup = class WizardReloadPopup extends DefaultConfirmPopup {
|
|
7
|
+
constructor() {
|
|
8
|
+
super(...arguments);
|
|
9
|
+
this._singleButton = false;
|
|
10
|
+
this._type = "info";
|
|
11
|
+
this._popupTitle = msg("Bearbeitung fortsetzen?", { id: "spaH.wizard.reload.popup.title" });
|
|
12
|
+
}
|
|
13
|
+
// eslint-disable-next-line class-methods-use-this
|
|
14
|
+
_renderContent() {
|
|
15
|
+
return html `
|
|
16
|
+
<div class="popup-content" slot="content">
|
|
17
|
+
<p>
|
|
18
|
+
${msg("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.", { id: "spaH.wizard.reload.popup.content" })}
|
|
19
|
+
</p>
|
|
20
|
+
<div class="last-modified">
|
|
21
|
+
Letzte Bearbeitung: <span>${this.reloadItem.timestamp}</span>
|
|
22
|
+
</div>
|
|
23
|
+
</div>
|
|
24
|
+
`;
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
WizardReloadPopup.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
|
+
.last-modified {
|
|
41
|
+
color: #555;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.last-modified span {
|
|
45
|
+
font-weight: bold;
|
|
46
|
+
color: #000;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.last-modified::before {
|
|
50
|
+
content: '🕒';
|
|
51
|
+
margin-right: 6px;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
`
|
|
55
|
+
];
|
|
56
|
+
__decorate([
|
|
57
|
+
property({ type: Object })
|
|
58
|
+
], WizardReloadPopup.prototype, "reloadItem", void 0);
|
|
59
|
+
WizardReloadPopup = __decorate([
|
|
60
|
+
customElement('wizard-reload-popup')
|
|
61
|
+
], WizardReloadPopup);
|
|
62
|
+
export { WizardReloadPopup };
|
|
63
|
+
//# sourceMappingURL=wizard-reload-popup.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wizard-reload-popup.js","sourceRoot":"","sources":["../../../src/popup/wizard-reload-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,iBAAiB,GAAvB,MAAM,iBAAkB,SAAQ,mBAAmB;IAAnD;;QAEL,kBAAa,GAAG,KAAK,CAAC;QAEtB,UAAK,GAAc,MAAM,CAAC;QAE1B,gBAAW,GAAG,GAAG,CAAC,yBAAyB,EAAE,EAAC,EAAE,EAAE,gCAAgC,EAAC,CAAC,CAAC;IAsDvF,CAAC;IAdC,kDAAkD;IAClD,cAAc;QACZ,OAAO,IAAI,CAAA;;;YAGH,GAAG,CAAC,sMAAsM,EAAE,EAAC,EAAE,EAAE,kCAAkC,EAAC,CAAC;;;sCAG3N,IAAI,CAAC,UAAU,CAAC,SAAS;;;KAG1D,CAAC;IACJ,CAAC;;AA3CM,wBAAM,GAAG;IACd,mBAAmB,CAAC,MAAM;IAC1B,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;KAyBF;CACgB,CAAC;AAjCpB;IADC,QAAQ,CAAC,EAAC,IAAI,EAAE,MAAM,EAAC,CAAC;qDAIxB;AAbU,iBAAiB;IAD7B,aAAa,CAAC,qBAAqB,CAAC;GACxB,iBAAiB,CA4D7B;SA5DY,iBAAiB","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-reload-popup')\nexport class WizardReloadPopup extends DefaultConfirmPopup {\n\n _singleButton = false;\n\n _type: PopupType = \"info\";\n\n _popupTitle = msg(\"Bearbeitung fortsetzen?\", {id: \"spaH.wizard.reload.popup.title\"});\n\n\n @property({type: Object})\n reloadItem!: { \n timestamp: string,\n wizardStep: number,\n }\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 .last-modified {\n color: #555;\n }\n\n .last-modified span {\n font-weight: bold;\n color: #000;\n }\n\n .last-modified::before {\n content: '🕒';\n margin-right: 6px;\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 ${msg(\"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.\", {id: \"spaH.wizard.reload.popup.content\"})} \n </p>\n <div class=\"last-modified\">\n Letzte Bearbeitung: <span>${this.reloadItem.timestamp}</span>\n </div>\n </div> \n `;\n }\n\n}\n"]}
|