@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
package/package.json
CHANGED
|
@@ -3,7 +3,6 @@ import { property } from "lit/decorators.js";
|
|
|
3
3
|
|
|
4
4
|
import '@progressive-development/pd-dialog/pd-popup-dialog.js';
|
|
5
5
|
|
|
6
|
-
|
|
7
6
|
export const KEY_ABORT = "1";
|
|
8
7
|
export const ABORT_EVENT_NAME = "close-popup";
|
|
9
8
|
|
|
@@ -12,24 +11,21 @@ export const STORE_EVENT_NAME = "store";
|
|
|
12
11
|
|
|
13
12
|
export type PopupType = "info" | "help" | "warn" | "error";
|
|
14
13
|
|
|
15
|
-
const CONFIRM_BUTTONS = [
|
|
16
|
-
{key: KEY_ABORT, name: "Cancel"},
|
|
17
|
-
{key: KEY_STORE, name: "Ok", primary: true}
|
|
18
|
-
];
|
|
19
|
-
|
|
20
|
-
const SINGLE_BUTTON = [
|
|
21
|
-
{key: KEY_STORE, name: "Ok", primary: true}
|
|
22
|
-
];
|
|
23
|
-
|
|
24
14
|
export abstract class DefaultConfirmPopup extends LitElement {
|
|
25
15
|
|
|
26
16
|
abstract _popupTitle: string;
|
|
27
17
|
|
|
18
|
+
abstract _type?: PopupType;
|
|
19
|
+
|
|
28
20
|
abstract _singleButton: boolean;
|
|
29
21
|
|
|
30
|
-
|
|
31
|
-
|
|
22
|
+
@property({ type: String })
|
|
23
|
+
okButtonText: string = "Ok";
|
|
32
24
|
|
|
25
|
+
@property({ type: String })
|
|
26
|
+
cancelButtonText: string = "Cancel";
|
|
27
|
+
|
|
28
|
+
|
|
33
29
|
static styles = [
|
|
34
30
|
css`
|
|
35
31
|
:host {
|
|
@@ -42,9 +38,10 @@ export abstract class DefaultConfirmPopup extends LitElement {
|
|
|
42
38
|
] as CSSResultGroup;
|
|
43
39
|
|
|
44
40
|
render() {
|
|
41
|
+
const buttons = this._generateButtons();
|
|
45
42
|
return html`
|
|
46
43
|
<pd-popup-dialog @submit-button-clicked="${this._handleButtonClick}"
|
|
47
|
-
title="${this._popupTitle}" .buttons="${
|
|
44
|
+
title="${this._popupTitle}" .buttons="${buttons}" type="${this._type}">
|
|
48
45
|
|
|
49
46
|
${this._renderContent()}
|
|
50
47
|
|
|
@@ -52,6 +49,18 @@ export abstract class DefaultConfirmPopup extends LitElement {
|
|
|
52
49
|
`;
|
|
53
50
|
}
|
|
54
51
|
|
|
52
|
+
private _generateButtons() {
|
|
53
|
+
if (this._singleButton) {
|
|
54
|
+
return [
|
|
55
|
+
{ key: KEY_STORE, name: this.okButtonText, primary: true },
|
|
56
|
+
];
|
|
57
|
+
}
|
|
58
|
+
return [
|
|
59
|
+
{ key: KEY_ABORT, name: this.cancelButtonText },
|
|
60
|
+
{ key: KEY_STORE, name: this.okButtonText, primary: true },
|
|
61
|
+
];
|
|
62
|
+
}
|
|
63
|
+
|
|
55
64
|
protected _handleButtonClick(e: CustomEvent) {
|
|
56
65
|
this.dispatchEvent(
|
|
57
66
|
new CustomEvent(
|
|
@@ -88,6 +88,11 @@ export abstract class DefaultWizardStep<T, F> extends LitElement {
|
|
|
88
88
|
protected _prepareOrderAfterStepUpdate(updatedOrder: T): T {
|
|
89
89
|
return updatedOrder;
|
|
90
90
|
}
|
|
91
|
+
|
|
92
|
+
// eslint-disable-next-line class-methods-use-this
|
|
93
|
+
reloadFromOrder(reloadedOrder: T): void {
|
|
94
|
+
// do nothing
|
|
95
|
+
}
|
|
91
96
|
|
|
92
97
|
abstract setFormData(currentOrder: T, formData: F): T;
|
|
93
98
|
|
|
@@ -1,10 +1,17 @@
|
|
|
1
1
|
import { html, HTMLTemplateResult } from "lit";
|
|
2
2
|
import { property } from "lit/decorators.js";
|
|
3
|
+
import { msg } from "@lit/localize";
|
|
3
4
|
|
|
4
5
|
import '@progressive-development/pd-dialog/pd-popup-dialog.js';
|
|
5
6
|
import '@progressive-development/pd-wizard/pd-wizard.js';
|
|
6
7
|
|
|
7
8
|
import { DefaultViewPage } from "./default-view-page.js";
|
|
9
|
+
import { RUNNING_WIZARD_STORAGE_ELEMENTS } from "../model/spa-model.js";
|
|
10
|
+
import { WizardReloadPopup } from "../popup/wizard-reload-popup.js";
|
|
11
|
+
import { WizardClosePopup } from "../popup/wizard-close-popup.js";
|
|
12
|
+
import { ABORT_EVENT_NAME, STORE_EVENT_NAME } from "./default-confirm-popup.js";
|
|
13
|
+
import { DefaultWizardStep } from "./default-wizard-step.js";
|
|
14
|
+
|
|
8
15
|
|
|
9
16
|
/**
|
|
10
17
|
* TODO: Move inside pd-wizard.
|
|
@@ -26,6 +33,9 @@ export abstract class DefaultWizard<T> extends DefaultViewPage {
|
|
|
26
33
|
@property({ type: Object, state: true })
|
|
27
34
|
_orderFormData?: T;
|
|
28
35
|
|
|
36
|
+
@property({type: String, state: true })
|
|
37
|
+
_withLocalStorageId?: string;
|
|
38
|
+
|
|
29
39
|
|
|
30
40
|
render() {
|
|
31
41
|
return html`
|
|
@@ -38,7 +48,8 @@ export abstract class DefaultWizard<T> extends DefaultViewPage {
|
|
|
38
48
|
@previous-step="${this._previousStep}"
|
|
39
49
|
@submit-wizard="${this._nextStep}"
|
|
40
50
|
@go-to="${this._goToStep}"
|
|
41
|
-
@close-wizard="${this.
|
|
51
|
+
@close-wizard="${this._closeWizardRequest}"
|
|
52
|
+
@wizard-step-update="${this._doStorageUpdate}"
|
|
42
53
|
>
|
|
43
54
|
${this._renderLogo()}
|
|
44
55
|
${this._renderSteps()}
|
|
@@ -46,10 +57,99 @@ export abstract class DefaultWizard<T> extends DefaultViewPage {
|
|
|
46
57
|
`;
|
|
47
58
|
}
|
|
48
59
|
|
|
60
|
+
// eslint-disable-next-line class-methods-use-this
|
|
61
|
+
private getWizardStorage():Record<string, {
|
|
62
|
+
orderFormData?: T,
|
|
63
|
+
timestamp: string,
|
|
64
|
+
wizardStep: number,
|
|
65
|
+
}> {
|
|
66
|
+
const storageEl = localStorage.getItem(RUNNING_WIZARD_STORAGE_ELEMENTS);
|
|
67
|
+
return storageEl ? JSON.parse(storageEl) : {};
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
protected _reloadFromStorage() {
|
|
71
|
+
|
|
72
|
+
if(this._withLocalStorageId) {
|
|
73
|
+
// Laden
|
|
74
|
+
const storageEl = this.getWizardStorage()[this._withLocalStorageId];
|
|
75
|
+
if (storageEl && storageEl.orderFormData) {
|
|
76
|
+
|
|
77
|
+
const popup = new WizardReloadPopup();
|
|
78
|
+
popup.reloadItem = storageEl;
|
|
79
|
+
popup.okButtonText = msg("Fortsetzen", {id: "spaH.wizard.reload.popup.ok"});
|
|
80
|
+
popup.cancelButtonText = msg("Verwerfen", {id: "spaH.wizard.reload.popup.cancel"});
|
|
81
|
+
|
|
82
|
+
popup.addEventListener(ABORT_EVENT_NAME, () => {
|
|
83
|
+
this._removeFromStorage()
|
|
84
|
+
this.shadowRoot?.removeChild(popup);
|
|
85
|
+
});
|
|
86
|
+
|
|
87
|
+
popup.addEventListener(STORE_EVENT_NAME, () => {
|
|
88
|
+
console.debug(`Reload storage element from ${storageEl.timestamp}`);
|
|
89
|
+
this._orderFormData = storageEl.orderFormData;
|
|
90
|
+
this._currentOrderStep = storageEl.wizardStep;
|
|
91
|
+
this.shadowRoot?.removeChild(popup);
|
|
92
|
+
|
|
93
|
+
const slot = this.shadowRoot?.querySelector('slot');
|
|
94
|
+
if (!slot) return;
|
|
95
|
+
// Hole alle zugewiesenen Elemente
|
|
96
|
+
const allElements = slot.assignedElements({ flatten: true });
|
|
97
|
+
|
|
98
|
+
// Filtere nur die Elemente, die Instanzen von DefaultWizardStep sind
|
|
99
|
+
const stepElements = allElements.filter(
|
|
100
|
+
(el): el is DefaultWizardStep<any, any> =>
|
|
101
|
+
el instanceof DefaultWizardStep &&
|
|
102
|
+
typeof el.slot === 'string' &&
|
|
103
|
+
el.slot.startsWith('step-')
|
|
104
|
+
);
|
|
105
|
+
|
|
106
|
+
// Führe die gewünschte Methode für jedes gefilterte Element aus
|
|
107
|
+
stepElements.forEach((step) => {
|
|
108
|
+
step.reloadFromOrder?.(this._orderFormData);
|
|
109
|
+
});
|
|
110
|
+
|
|
111
|
+
});
|
|
112
|
+
|
|
113
|
+
this.shadowRoot?.appendChild(popup);
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
protected _doStorageUpdate() {
|
|
119
|
+
if (this._withLocalStorageId) {
|
|
120
|
+
const storageWizard = this.getWizardStorage();
|
|
121
|
+
storageWizard[this._withLocalStorageId] = {
|
|
122
|
+
orderFormData: this._orderFormData,
|
|
123
|
+
wizardStep: this._currentOrderStep,
|
|
124
|
+
timestamp: new Date().toUTCString(),
|
|
125
|
+
}
|
|
126
|
+
localStorage.setItem(RUNNING_WIZARD_STORAGE_ELEMENTS, JSON.stringify(storageWizard));
|
|
127
|
+
console.debug(`Update wizard local storage for key ${this._withLocalStorageId}`);
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
protected _removeFromStorage() {
|
|
132
|
+
if (this._withLocalStorageId) {
|
|
133
|
+
// remote storage element
|
|
134
|
+
const storageWizard = this.getWizardStorage();
|
|
135
|
+
delete storageWizard[this._withLocalStorageId];
|
|
136
|
+
localStorage.setItem(
|
|
137
|
+
RUNNING_WIZARD_STORAGE_ELEMENTS,
|
|
138
|
+
JSON.stringify(storageWizard)
|
|
139
|
+
);
|
|
140
|
+
console.debug(`Remove wizard local storage for key ${this._withLocalStorageId}`);
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
|
|
49
144
|
_nextStep(e:CustomEvent) {
|
|
50
145
|
const setNextStep = () => {
|
|
51
146
|
if (this._currentOrderStep < this._wizardSteps.length) {
|
|
52
147
|
this._currentOrderStep += 1;
|
|
148
|
+
|
|
149
|
+
if (this._withLocalStorageId) {
|
|
150
|
+
this._doStorageUpdate();
|
|
151
|
+
}
|
|
152
|
+
|
|
53
153
|
if (!this.panelWizard) {
|
|
54
154
|
DefaultWizard._timeOutScroll();
|
|
55
155
|
}
|
|
@@ -107,6 +207,48 @@ export abstract class DefaultWizard<T> extends DefaultViewPage {
|
|
|
107
207
|
}
|
|
108
208
|
}
|
|
109
209
|
|
|
210
|
+
_closeWizardRequest(): void {
|
|
211
|
+
|
|
212
|
+
if (this._withLocalStorageId) {
|
|
213
|
+
const popup = new WizardClosePopup();
|
|
214
|
+
popup.withStorage = true;
|
|
215
|
+
popup.okButtonText = msg("Speichern", {id: "spaH.wizard.storage.close.popup.ok"});
|
|
216
|
+
popup.cancelButtonText = msg("Verwerfen", {id: "spaH.wizard.storage.close.popup.cancel"});
|
|
217
|
+
|
|
218
|
+
popup.addEventListener(ABORT_EVENT_NAME, () => {
|
|
219
|
+
this._removeFromStorage()
|
|
220
|
+
this.shadowRoot?.removeChild(popup);
|
|
221
|
+
this._closeWizard();
|
|
222
|
+
});
|
|
223
|
+
|
|
224
|
+
popup.addEventListener(STORE_EVENT_NAME, () => {
|
|
225
|
+
this._doStorageUpdate();
|
|
226
|
+
this.shadowRoot?.removeChild(popup);
|
|
227
|
+
this._closeWizard();
|
|
228
|
+
});
|
|
229
|
+
|
|
230
|
+
this.shadowRoot?.appendChild(popup);
|
|
231
|
+
|
|
232
|
+
} else {
|
|
233
|
+
|
|
234
|
+
const popup = new WizardClosePopup();
|
|
235
|
+
popup.withStorage = false;
|
|
236
|
+
popup.okButtonText = msg("Schließen", {id: "spaH.wizard.close.popup.ok"});
|
|
237
|
+
popup.cancelButtonText = msg("Abbrechen", {id: "spaH.wizard.close.popup.cancel"});
|
|
238
|
+
|
|
239
|
+
popup.addEventListener(ABORT_EVENT_NAME, () => {
|
|
240
|
+
this.shadowRoot?.removeChild(popup);
|
|
241
|
+
});
|
|
242
|
+
|
|
243
|
+
popup.addEventListener(STORE_EVENT_NAME, () => {
|
|
244
|
+
this.shadowRoot?.removeChild(popup);
|
|
245
|
+
this._closeWizard();
|
|
246
|
+
});
|
|
247
|
+
|
|
248
|
+
this.shadowRoot?.appendChild(popup);
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
|
|
110
252
|
abstract _closeWizard(): void;
|
|
111
253
|
|
|
112
254
|
abstract _renderSteps(): HTMLTemplateResult;
|
|
@@ -11,5 +11,16 @@
|
|
|
11
11
|
export const templates = {
|
|
12
12
|
'spaH.loadingstate.pleaseWait': `Gegevens worden geladen`,
|
|
13
13
|
'spaH.loadingstate.syncState': `Gegevens worden gesynchroniseerd`,
|
|
14
|
+
'spaH.wizard.close.popup.cancel': `Annuleren`,
|
|
15
|
+
'spaH.wizard.close.popup.ok': `Sluiten`,
|
|
16
|
+
'spaH.wizard.close.popup.storage.content': `De huidige invoer kan worden opgeslagen voor later bewerken of worden verwijderd. Welke actie wilt u uitvoeren?`,
|
|
17
|
+
'spaH.wizard.close.popup.title': `Bewerking annuleren`,
|
|
18
|
+
'spaH.wizard.reload.popup.cancel': `Verwijderen`,
|
|
19
|
+
'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.`,
|
|
20
|
+
'spaH.wizard.reload.popup.noStorage.content': `De huidige invoer gaat onherroepelijk verloren na het sluiten. Toch sluiten?`,
|
|
21
|
+
'spaH.wizard.reload.popup.ok': `Doorgaan`,
|
|
22
|
+
'spaH.wizard.reload.popup.title': `Doorgaan met bewerken?`,
|
|
23
|
+
'spaH.wizard.storage.close.popup.cancel': `Verwijderen`,
|
|
24
|
+
'spaH.wizard.storage.close.popup.ok': `Opslaan`,
|
|
14
25
|
};
|
|
15
26
|
|
|
@@ -11,5 +11,16 @@
|
|
|
11
11
|
export const templates = {
|
|
12
12
|
'spaH.loadingstate.syncState': `Daten werden synchronisiert`,
|
|
13
13
|
'spaH.loadingstate.pleaseWait': `Bitte warten, Daten werden geladen`,
|
|
14
|
+
'spaH.wizard.reload.popup.title': `Bearbeitung fortsetzen?`,
|
|
15
|
+
'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.`,
|
|
16
|
+
'spaH.wizard.close.popup.title': `Bearbeitung abbrechen`,
|
|
17
|
+
'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?`,
|
|
18
|
+
'spaH.wizard.reload.popup.noStorage.content': `Die aktuellen Eingaben gehen nach dem Schließen unwiderruflich verloren. Dennoch schließen?`,
|
|
19
|
+
'spaH.wizard.reload.popup.ok': `Fortsetzen`,
|
|
20
|
+
'spaH.wizard.reload.popup.cancel': `Verwerfen`,
|
|
21
|
+
'spaH.wizard.storage.close.popup.ok': `Speichern`,
|
|
22
|
+
'spaH.wizard.storage.close.popup.cancel': `Verwerfen`,
|
|
23
|
+
'spaH.wizard.close.popup.ok': `Schließen`,
|
|
24
|
+
'spaH.wizard.close.popup.cancel': `Abbrechen`,
|
|
14
25
|
};
|
|
15
26
|
|
|
@@ -9,7 +9,18 @@
|
|
|
9
9
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
10
10
|
|
|
11
11
|
export const templates = {
|
|
12
|
-
'spaH.
|
|
12
|
+
'spaH.wizard.close.popup.cancel': `Cancel`,
|
|
13
|
+
'spaH.wizard.close.popup.ok': `Close`,
|
|
14
|
+
'spaH.wizard.close.popup.storage.content': `The current inputs can be saved for later editing or discarded. Which action should be taken?`,
|
|
15
|
+
'spaH.wizard.close.popup.title': `Cancel editing`,
|
|
16
|
+
'spaH.wizard.reload.popup.cancel': `Discard`,
|
|
17
|
+
'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.`,
|
|
18
|
+
'spaH.wizard.reload.popup.noStorage.content': `The current inputs will be permanently lost after closing. Close anyway?`,
|
|
19
|
+
'spaH.wizard.reload.popup.ok': `Continue`,
|
|
20
|
+
'spaH.wizard.reload.popup.title': `Continue editing?`,
|
|
21
|
+
'spaH.wizard.storage.close.popup.cancel': `Discard`,
|
|
22
|
+
'spaH.wizard.storage.close.popup.ok': `Save`,
|
|
23
|
+
'spaH.loadingstate.syncState': `Daten werden synchronisiert`,
|
|
13
24
|
'spaH.loadingstate.pleaseWait': `Bitte warten, Daten werden geladen`,
|
|
14
25
|
};
|
|
15
26
|
|
package/src/model/spa-model.ts
CHANGED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { html, css, CSSResultGroup } from "lit";
|
|
2
|
+
import { customElement, property } from "lit/decorators.js";
|
|
3
|
+
import { msg } from "@lit/localize";
|
|
4
|
+
|
|
5
|
+
import { DefaultConfirmPopup, PopupType } from "../defaultpage/default-confirm-popup.js";
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
@customElement('wizard-close-popup')
|
|
9
|
+
export class WizardClosePopup extends DefaultConfirmPopup {
|
|
10
|
+
|
|
11
|
+
_singleButton = false;
|
|
12
|
+
|
|
13
|
+
_type: PopupType = "warn";
|
|
14
|
+
|
|
15
|
+
_popupTitle = msg("Bearbeitung abbrechen", {id: "spaH.wizard.close.popup.title"});
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
@property({type: Boolean})
|
|
19
|
+
withStorage: boolean = false;
|
|
20
|
+
|
|
21
|
+
static styles = [
|
|
22
|
+
DefaultConfirmPopup.styles,
|
|
23
|
+
css`
|
|
24
|
+
|
|
25
|
+
:host {
|
|
26
|
+
--pd-popup-max-width: 80%;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.popup-content {
|
|
30
|
+
display: flex;
|
|
31
|
+
flex-direction: column;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
`
|
|
35
|
+
] as CSSResultGroup;
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
// eslint-disable-next-line class-methods-use-this
|
|
39
|
+
_renderContent() {
|
|
40
|
+
return html`
|
|
41
|
+
<div class="popup-content" slot="content">
|
|
42
|
+
<p>
|
|
43
|
+
${this.withStorage ?
|
|
44
|
+
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"})
|
|
45
|
+
: msg("Die aktuellen Eingaben gehen nach dem Schließen unwiderruflich verloren. Dennoch schließen?", {id: "spaH.wizard.reload.popup.noStorage.content"})
|
|
46
|
+
}
|
|
47
|
+
</p>
|
|
48
|
+
</div>
|
|
49
|
+
`;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { html, css, CSSResultGroup } from "lit";
|
|
2
|
+
import { customElement, property } from "lit/decorators.js";
|
|
3
|
+
import { msg } from "@lit/localize";
|
|
4
|
+
|
|
5
|
+
import { DefaultConfirmPopup, PopupType } from "../defaultpage/default-confirm-popup.js";
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
@customElement('wizard-reload-popup')
|
|
9
|
+
export class WizardReloadPopup extends DefaultConfirmPopup {
|
|
10
|
+
|
|
11
|
+
_singleButton = false;
|
|
12
|
+
|
|
13
|
+
_type: PopupType = "info";
|
|
14
|
+
|
|
15
|
+
_popupTitle = msg("Bearbeitung fortsetzen?", {id: "spaH.wizard.reload.popup.title"});
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
@property({type: Object})
|
|
19
|
+
reloadItem!: {
|
|
20
|
+
timestamp: string,
|
|
21
|
+
wizardStep: number,
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
static styles = [
|
|
25
|
+
DefaultConfirmPopup.styles,
|
|
26
|
+
css`
|
|
27
|
+
|
|
28
|
+
:host {
|
|
29
|
+
--pd-popup-max-width: 80%;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.popup-content {
|
|
33
|
+
display: flex;
|
|
34
|
+
flex-direction: column;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.last-modified {
|
|
38
|
+
color: #555;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.last-modified span {
|
|
42
|
+
font-weight: bold;
|
|
43
|
+
color: #000;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.last-modified::before {
|
|
47
|
+
content: '🕒';
|
|
48
|
+
margin-right: 6px;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
`
|
|
52
|
+
] as CSSResultGroup;
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
// eslint-disable-next-line class-methods-use-this
|
|
56
|
+
_renderContent() {
|
|
57
|
+
return html`
|
|
58
|
+
<div class="popup-content" slot="content">
|
|
59
|
+
<p>
|
|
60
|
+
${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"})}
|
|
61
|
+
</p>
|
|
62
|
+
<div class="last-modified">
|
|
63
|
+
Letzte Bearbeitung: <span>${this.reloadItem.timestamp}</span>
|
|
64
|
+
</div>
|
|
65
|
+
</div>
|
|
66
|
+
`;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { LitElement, html, css, CSSResultGroup } from 'lit';
|
|
2
2
|
import { customElement, property } from 'lit/decorators.js';
|
|
3
|
-
import { msg } from '@lit/localize';
|
|
3
|
+
import { localized, msg } from '@lit/localize';
|
|
4
4
|
import { classMap } from 'lit/directives/class-map.js';
|
|
5
5
|
|
|
6
6
|
import '@progressive-development/pd-icon/pd-icon.js';
|
|
@@ -8,6 +8,7 @@ import '@progressive-development/pd-icon/pd-icon.js';
|
|
|
8
8
|
import {LoadingState} from '../model/spa-model.js';
|
|
9
9
|
|
|
10
10
|
|
|
11
|
+
@localized()
|
|
11
12
|
@customElement('pd-loading-state')
|
|
12
13
|
export class PdLoadingState extends LitElement {
|
|
13
14
|
|
package/xliff/be.xlf
CHANGED
|
@@ -10,6 +10,51 @@
|
|
|
10
10
|
<source>Bitte warten, Daten werden geladen</source>
|
|
11
11
|
<target>Gegevens worden geladen</target>
|
|
12
12
|
</trans-unit>
|
|
13
|
+
<trans-unit id="spaH.wizard.reload.popup.title">
|
|
14
|
+
<source>Bearbeitung fortsetzen?</source>
|
|
15
|
+
<target>Doorgaan met bewerken?</target>
|
|
16
|
+
</trans-unit>
|
|
17
|
+
<trans-unit id="spaH.wizard.reload.popup.content">
|
|
18
|
+
<source>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.</source>
|
|
19
|
+
<target>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.</target>
|
|
20
|
+
</trans-unit>
|
|
21
|
+
<trans-unit id="spaH.wizard.close.popup.title">
|
|
22
|
+
<source>Bearbeitung abbrechen</source>
|
|
23
|
+
<target>Bewerking annuleren</target>
|
|
24
|
+
</trans-unit>
|
|
25
|
+
<trans-unit id="spaH.wizard.close.popup.storage.content">
|
|
26
|
+
<source>Die aktuellen Eingaben können für eine spätere Bearbeitung gespeichert oder verworfen werden. Welche Aktion soll ausgeführt werden?</source>
|
|
27
|
+
<target>De huidige invoer kan worden opgeslagen voor later bewerken of worden verwijderd. Welke actie wilt u uitvoeren?</target>
|
|
28
|
+
</trans-unit>
|
|
29
|
+
<trans-unit id="spaH.wizard.reload.popup.noStorage.content">
|
|
30
|
+
<source>Die aktuellen Eingaben gehen nach dem Schließen unwiderruflich verloren. Dennoch schließen?</source>
|
|
31
|
+
<target>De huidige invoer gaat onherroepelijk verloren na het sluiten. Toch sluiten?</target>
|
|
32
|
+
</trans-unit>
|
|
33
|
+
<trans-unit id="spaH.wizard.reload.popup.ok">
|
|
34
|
+
<source>Fortsetzen</source>
|
|
35
|
+
<target>Doorgaan</target>
|
|
36
|
+
</trans-unit>
|
|
37
|
+
<trans-unit id="spaH.wizard.reload.popup.cancel">
|
|
38
|
+
<source>Verwerfen</source>
|
|
39
|
+
<target>Verwijderen</target>
|
|
40
|
+
</trans-unit>
|
|
41
|
+
<trans-unit id="spaH.wizard.storage.close.popup.ok">
|
|
42
|
+
<source>Speichern</source>
|
|
43
|
+
<target>Opslaan</target>
|
|
44
|
+
</trans-unit>
|
|
45
|
+
<trans-unit id="spaH.wizard.storage.close.popup.cancel">
|
|
46
|
+
<source>Verwerfen</source>
|
|
47
|
+
<target>Verwijderen</target>
|
|
48
|
+
</trans-unit>
|
|
49
|
+
<trans-unit id="spaH.wizard.close.popup.ok">
|
|
50
|
+
<source>Schließen</source>
|
|
51
|
+
<target>Sluiten</target>
|
|
52
|
+
</trans-unit>
|
|
53
|
+
<trans-unit id="spaH.wizard.close.popup.cancel">
|
|
54
|
+
<source>Abbrechen</source>
|
|
55
|
+
<target>Annuleren</target>
|
|
56
|
+
</trans-unit>
|
|
57
|
+
|
|
13
58
|
</body>
|
|
14
59
|
</file>
|
|
15
60
|
</xliff>
|
package/xliff/de.xlf
CHANGED
|
@@ -8,6 +8,39 @@
|
|
|
8
8
|
<trans-unit id="spaH.loadingstate.pleaseWait">
|
|
9
9
|
<source>Bitte warten, Daten werden geladen</source>
|
|
10
10
|
</trans-unit>
|
|
11
|
+
<trans-unit id="spaH.wizard.reload.popup.title">
|
|
12
|
+
<source>Bearbeitung fortsetzen?</source>
|
|
13
|
+
</trans-unit>
|
|
14
|
+
<trans-unit id="spaH.wizard.reload.popup.content">
|
|
15
|
+
<source>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.</source>
|
|
16
|
+
</trans-unit>
|
|
17
|
+
<trans-unit id="spaH.wizard.close.popup.title">
|
|
18
|
+
<source>Bearbeitung abbrechen</source>
|
|
19
|
+
</trans-unit>
|
|
20
|
+
<trans-unit id="spaH.wizard.close.popup.storage.content">
|
|
21
|
+
<source>Die aktuellen Eingaben können für eine spätere Bearbeitung gespeichert oder verworfen werden. Welche Aktion soll ausgeführt werden?</source>
|
|
22
|
+
</trans-unit>
|
|
23
|
+
<trans-unit id="spaH.wizard.reload.popup.noStorage.content">
|
|
24
|
+
<source>Die aktuellen Eingaben gehen nach dem Schließen unwiderruflich verloren. Dennoch schließen?</source>
|
|
25
|
+
</trans-unit>
|
|
26
|
+
<trans-unit id="spaH.wizard.reload.popup.ok">
|
|
27
|
+
<source>Fortsetzen</source>
|
|
28
|
+
</trans-unit>
|
|
29
|
+
<trans-unit id="spaH.wizard.reload.popup.cancel">
|
|
30
|
+
<source>Verwerfen</source>
|
|
31
|
+
</trans-unit>
|
|
32
|
+
<trans-unit id="spaH.wizard.storage.close.popup.ok">
|
|
33
|
+
<source>Speichern</source>
|
|
34
|
+
</trans-unit>
|
|
35
|
+
<trans-unit id="spaH.wizard.storage.close.popup.cancel">
|
|
36
|
+
<source>Verwerfen</source>
|
|
37
|
+
</trans-unit>
|
|
38
|
+
<trans-unit id="spaH.wizard.close.popup.ok">
|
|
39
|
+
<source>Schließen</source>
|
|
40
|
+
</trans-unit>
|
|
41
|
+
<trans-unit id="spaH.wizard.close.popup.cancel">
|
|
42
|
+
<source>Abbrechen</source>
|
|
43
|
+
</trans-unit>
|
|
11
44
|
</body>
|
|
12
45
|
</file>
|
|
13
46
|
</xliff>
|
package/xliff/en.xlf
CHANGED
|
@@ -8,6 +8,51 @@
|
|
|
8
8
|
<trans-unit id="spaH.loadingstate.pleaseWait">
|
|
9
9
|
<source>Bitte warten, Daten werden geladen</source>
|
|
10
10
|
</trans-unit>
|
|
11
|
+
<trans-unit id="spaH.wizard.reload.popup.title">
|
|
12
|
+
<source>Bearbeitung fortsetzen?</source>
|
|
13
|
+
<target>Continue editing?</target>
|
|
14
|
+
</trans-unit>
|
|
15
|
+
<trans-unit id="spaH.wizard.reload.popup.content">
|
|
16
|
+
<source>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.</source>
|
|
17
|
+
<target>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.</target>
|
|
18
|
+
</trans-unit>
|
|
19
|
+
<trans-unit id="spaH.wizard.close.popup.title">
|
|
20
|
+
<source>Bearbeitung abbrechen</source>
|
|
21
|
+
<target>Cancel editing</target>
|
|
22
|
+
</trans-unit>
|
|
23
|
+
<trans-unit id="spaH.wizard.close.popup.storage.content">
|
|
24
|
+
<source>Die aktuellen Eingaben können für eine spätere Bearbeitung gespeichert oder verworfen werden. Welche Aktion soll ausgeführt werden?</source>
|
|
25
|
+
<target>The current inputs can be saved for later editing or discarded. Which action should be taken?</target>
|
|
26
|
+
</trans-unit>
|
|
27
|
+
<trans-unit id="spaH.wizard.reload.popup.noStorage.content">
|
|
28
|
+
<source>Die aktuellen Eingaben gehen nach dem Schließen unwiderruflich verloren. Dennoch schließen?</source>
|
|
29
|
+
<target>The current inputs will be permanently lost after closing. Close anyway?</target>
|
|
30
|
+
</trans-unit>
|
|
31
|
+
<trans-unit id="spaH.wizard.reload.popup.ok">
|
|
32
|
+
<source>Fortsetzen</source>
|
|
33
|
+
<target>Continue</target>
|
|
34
|
+
</trans-unit>
|
|
35
|
+
<trans-unit id="spaH.wizard.reload.popup.cancel">
|
|
36
|
+
<source>Verwerfen</source>
|
|
37
|
+
<target>Discard</target>
|
|
38
|
+
</trans-unit>
|
|
39
|
+
<trans-unit id="spaH.wizard.storage.close.popup.ok">
|
|
40
|
+
<source>Speichern</source>
|
|
41
|
+
<target>Save</target>
|
|
42
|
+
</trans-unit>
|
|
43
|
+
<trans-unit id="spaH.wizard.storage.close.popup.cancel">
|
|
44
|
+
<source>Verwerfen</source>
|
|
45
|
+
<target>Discard</target>
|
|
46
|
+
</trans-unit>
|
|
47
|
+
<trans-unit id="spaH.wizard.close.popup.ok">
|
|
48
|
+
<source>Schließen</source>
|
|
49
|
+
<target>Close</target>
|
|
50
|
+
</trans-unit>
|
|
51
|
+
<trans-unit id="spaH.wizard.close.popup.cancel">
|
|
52
|
+
<source>Abbrechen</source>
|
|
53
|
+
<target>Cancel</target>
|
|
54
|
+
</trans-unit>
|
|
55
|
+
|
|
11
56
|
</body>
|
|
12
57
|
</file>
|
|
13
58
|
</xliff>
|