@progressive-development/pd-spa-helper 0.7.6 → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/PdSpaHelper.d.ts +13 -18
- package/dist/PdSpaHelper.d.ts.map +1 -1
- package/dist/_virtual/_commonjsHelpers.js +6 -0
- package/dist/_virtual/hammer.js +4 -0
- package/dist/defaultpage/default-confirm-popup.d.ts.map +1 -1
- package/dist/defaultpage/default-dialog-popup.d.ts.map +1 -1
- package/dist/defaultpage/default-login.d.ts.map +1 -1
- package/dist/defaultpage/default-popup.d.ts.map +1 -1
- package/dist/defaultpage/default-step-address.d.ts.map +1 -1
- package/dist/defaultpage/default-step-summary.d.ts.map +1 -1
- package/dist/defaultpage/default-view-page.d.ts.map +1 -1
- package/dist/defaultpage/default-wizard-step.d.ts.map +1 -1
- package/dist/defaultpage/default-wizard.d.ts.map +1 -1
- package/dist/generated/locale-codes.d.ts.map +1 -1
- package/dist/generated/locale-wrapper/be-wrapper.d.ts +54 -13
- package/dist/generated/locale-wrapper/be-wrapper.d.ts.map +1 -1
- package/dist/generated/locale-wrapper/de-wrapper.d.ts +54 -13
- package/dist/generated/locale-wrapper/de-wrapper.d.ts.map +1 -1
- package/dist/generated/locale-wrapper/en-wrapper.d.ts +54 -13
- package/dist/generated/locale-wrapper/en-wrapper.d.ts.map +1 -1
- package/dist/generated/locales/be.d.ts +13 -13
- package/dist/generated/locales/be.d.ts.map +1 -1
- package/dist/generated/locales/de.d.ts +13 -13
- package/dist/generated/locales/de.d.ts.map +1 -1
- package/dist/generated/locales/en.d.ts +13 -13
- package/dist/generated/locales/en.d.ts.map +1 -1
- package/dist/helper/blob-helper.d.ts +3 -0
- package/dist/helper/blob-helper.d.ts.map +1 -0
- package/dist/helper/date-helper.d.ts +27 -0
- package/dist/helper/date-helper.d.ts.map +1 -0
- package/dist/helper/locale-format.d.ts +4 -0
- package/dist/helper/locale-format.d.ts.map +1 -0
- package/dist/helper/number-helper.d.ts +2 -0
- package/dist/helper/number-helper.d.ts.map +1 -0
- package/dist/helper/offline-watcher-helper.d.ts +3 -0
- package/dist/helper/offline-watcher-helper.d.ts.map +1 -0
- package/dist/helper/price-helper.d.ts +5 -0
- package/dist/helper/price-helper.d.ts.map +1 -0
- package/dist/helper/refresh-id-token.d.ts.map +1 -1
- package/dist/helper/text-helper.d.ts +3 -0
- package/dist/helper/text-helper.d.ts.map +1 -0
- package/dist/index.d.ts +8 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +23 -11
- package/dist/model/spa-model.d.ts +1 -0
- package/dist/model/spa-model.d.ts.map +1 -1
- package/dist/node_modules/@progressive-development/pd-content/dist/locales/be.js +7 -0
- package/dist/node_modules/@progressive-development/pd-content/dist/locales/de.js +7 -0
- package/dist/node_modules/@progressive-development/pd-content/dist/locales/en.js +7 -0
- package/dist/{src/router/AppMain.js → node_modules/@progressive-development/pd-content/dist/pd-box-view.js} +18 -7
- package/dist/node_modules/@progressive-development/pd-content/dist/pd-collapse.js +152 -0
- package/dist/node_modules/@progressive-development/pd-content/dist/pd-edit-content.js +225 -0
- package/dist/node_modules/@progressive-development/pd-content/dist/pd-more-info.js +84 -0
- package/dist/{pd-panel-viewer.js → node_modules/@progressive-development/pd-content/dist/pd-panel-viewer.js} +95 -75
- package/dist/{pd-panel.js → node_modules/@progressive-development/pd-content/dist/pd-panel.js} +21 -21
- package/dist/node_modules/@progressive-development/pd-content/dist/pd-resize-content.js +64 -0
- package/dist/node_modules/@progressive-development/pd-shared-styles/{src/shared-color-styles.js → dist/src/pd-color-styles.js} +13 -14
- package/dist/node_modules/@progressive-development/pd-shared-styles/dist/src/pd-font-styles.js +25 -0
- package/dist/node_modules/hammerjs/hammer.js +1797 -0
- package/dist/node_modules/universal-router/path-to-regexp.js +260 -0
- package/dist/node_modules/universal-router/universal-router.js +135 -0
- package/dist/popup/wizard-close-popup.d.ts.map +1 -1
- package/dist/popup/wizard-reload-popup.d.ts.map +1 -1
- package/dist/router/PdRouterService.d.ts +28 -0
- package/dist/router/PdRouterService.d.ts.map +1 -0
- package/dist/router/rout-types.d.ts +17 -0
- package/dist/router/rout-types.d.ts.map +1 -0
- package/dist/service-provider/firebase/auth.d.ts +2 -2
- package/dist/service-provider/firebase/auth.d.ts.map +1 -1
- package/dist/service-provider/firebase/firestorage-client.d.ts.map +1 -1
- package/dist/service-provider/firebase/firestore-client.d.ts +1 -1
- package/dist/service-provider/firebase/firestore-client.d.ts.map +1 -1
- package/dist/service-provider/firebase/functions-client.d.ts.map +1 -1
- package/dist/service-provider/firebase/messagingFirebaseClient.d.ts.map +1 -1
- package/dist/service-provider/mock/auth.d.ts +1 -1
- package/dist/service-provider/mock/auth.d.ts.map +1 -1
- package/dist/service-provider/mock/function-client.d.ts +1 -3
- package/dist/service-provider/mock/function-client.d.ts.map +1 -1
- package/dist/service-provider/mock/storage-client.d.ts.map +1 -1
- package/dist/service-provider/service-provider-impl.d.ts +2 -4
- package/dist/service-provider/service-provider-impl.d.ts.map +1 -1
- package/dist/service-provider/service-provider-model.d.ts +7 -8
- package/dist/service-provider/service-provider-model.d.ts.map +1 -1
- package/dist/src/PdSpaHelper.js +190 -189
- package/dist/src/defaultpage/default-confirm-popup.js +7 -7
- package/dist/src/defaultpage/default-dialog-popup.js +16 -18
- package/dist/src/defaultpage/default-login.js +4 -6
- package/dist/src/defaultpage/default-popup.js +1 -3
- package/dist/src/defaultpage/default-step-address.js +5 -7
- package/dist/src/defaultpage/default-step-summary.js +8 -6
- package/dist/src/defaultpage/default-view-page.js +0 -2
- package/dist/src/defaultpage/default-wizard-step.js +6 -8
- package/dist/src/defaultpage/default-wizard.js +34 -14
- package/dist/src/generated/locale-wrapper/be-wrapper.js +18 -11
- package/dist/src/generated/locale-wrapper/de-wrapper.js +18 -11
- package/dist/src/generated/locale-wrapper/en-wrapper.js +18 -11
- package/dist/src/helper/blob-helper.js +37 -0
- package/dist/src/helper/date-helper.js +137 -0
- package/dist/src/helper/locale-format.js +19 -0
- package/dist/src/helper/number-helper.js +14 -0
- package/dist/src/helper/{helper-utils.js → offline-watcher-helper.js} +1 -17
- package/dist/src/helper/price-helper.js +25 -0
- package/dist/src/helper/refresh-id-token.js +3 -1
- package/dist/src/helper/text-helper.js +6 -0
- package/dist/src/model/spa-model.js +3 -1
- package/dist/src/popup/wizard-close-popup.js +11 -5
- package/dist/src/popup/wizard-reload-popup.js +9 -6
- package/dist/src/router/PdRouterService.js +112 -0
- package/dist/src/service-provider/firebase/firestorage-client.js +33 -12
- package/dist/src/service-provider/firebase/firestore-client.js +7 -5
- package/dist/src/service-provider/firebase/functions-client.js +11 -9
- package/dist/src/service-provider/firebase/messagingFirebaseClient.js +9 -10
- package/dist/src/service-provider/mock/storage-client.js +21 -9
- package/dist/src/service-provider/service-provider-impl.js +19 -18
- package/dist/src/store/spa-app-actions.js +32 -8
- package/dist/src/store/spa-app-effects.js +19 -15
- package/dist/src/store/spa-app-reducer.js +5 -9
- package/dist/src/tmpown/pd-loading-state.js +60 -43
- package/dist/src/tmpown/pd-login.js +58 -45
- package/dist/src/tmpown/pd-toast.js +23 -20
- package/dist/store/indexDB.d.ts.map +1 -1
- package/dist/store/mini-rx.store.d.ts.map +1 -1
- package/dist/store/spa-app-actions.d.ts +2 -2
- package/dist/store/spa-app-actions.d.ts.map +1 -1
- package/dist/store/spa-app-effects.d.ts +2 -2
- package/dist/store/spa-app-effects.d.ts.map +1 -1
- package/dist/store/spa-app-reducer.d.ts.map +1 -1
- package/dist/store/spa-app-selector.d.ts.map +1 -1
- package/dist/stories/address-edit.stories.d.ts +1 -1
- package/dist/stories/address-edit.stories.d.ts.map +1 -1
- package/dist/stories/address-new.stories.d.ts +1 -1
- package/dist/stories/address-new.stories.d.ts.map +1 -1
- package/dist/stories/pd-loading-state.stories.d.ts +1 -1
- package/dist/stories/pd-loading-state.stories.d.ts.map +1 -1
- package/dist/stories/pd-toast.stories.d.ts +1 -1
- package/dist/stories/pd-toast.stories.d.ts.map +1 -1
- package/dist/stories/routing.stories.d.ts +24 -0
- package/dist/stories/routing.stories.d.ts.map +1 -0
- package/dist/stories/test-impls/test-mock-app.d.ts +15 -0
- package/dist/stories/test-impls/test-mock-app.d.ts.map +1 -0
- package/dist/stories/test-impls/test-pages/test-home-page.d.ts +7 -0
- package/dist/stories/test-impls/test-pages/test-home-page.d.ts.map +1 -0
- package/dist/stories/test-impls/test-pages/test-not-found-page.d.ts +5 -0
- package/dist/stories/test-impls/test-pages/test-not-found-page.d.ts.map +1 -0
- package/dist/tmpown/pd-loading-state.d.ts.map +1 -1
- package/dist/tmpown/pd-login.d.ts.map +1 -1
- package/dist/tmpown/pd-toast.d.ts.map +1 -1
- package/package.json +36 -73
- package/dist/helper/helper-utils.d.ts +0 -6
- package/dist/helper/helper-utils.d.ts.map +0 -1
- package/dist/node_modules/@progressive-development/pd-shared-styles/src/shared-font-styles.js +0 -32
- package/dist/pd-icon-panel-button.d.ts +0 -2
- package/dist/pd-icon-panel-button.js +0 -231
- package/dist/pd-panel-viewer.d.ts +0 -2
- package/dist/pd-panel.d.ts +0 -2
- package/dist/pd-tab.d.ts +0 -2
- package/dist/pd-tab.js +0 -146
- package/dist/router/AppMain.d.ts +0 -7
- package/dist/router/AppMain.d.ts.map +0 -1
- package/dist/service-call-controller2.d.ts +0 -17
- package/dist/service-call-controller2.d.ts.map +0 -1
- package/dist/stories/pd-icon-button.stories.d.ts +0 -30
- package/dist/stories/pd-icon-button.stories.d.ts.map +0 -1
- package/dist/tmpown/pd-icon-panel-button.d.ts +0 -17
- package/dist/tmpown/pd-icon-panel-button.d.ts.map +0 -1
- package/dist/tmpown/pd-panel-viewer.d.ts +0 -17
- package/dist/tmpown/pd-panel-viewer.d.ts.map +0 -1
- package/dist/tmpown/pd-panel.d.ts +0 -6
- package/dist/tmpown/pd-panel.d.ts.map +0 -1
- package/dist/tmpown/pd-tab.d.ts +0 -19
- package/dist/tmpown/pd-tab.d.ts.map +0 -1
- package/dist/tmpown/pd-tab.stories.d.ts +0 -23
- package/dist/tmpown/pd-tab.stories.d.ts.map +0 -1
|
@@ -23,17 +23,20 @@ const _DefaultDialogPopup = class _DefaultDialogPopup extends LitElement {
|
|
|
23
23
|
}
|
|
24
24
|
render() {
|
|
25
25
|
return html`
|
|
26
|
-
<pd-popup-dialog
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
26
|
+
<pd-popup-dialog
|
|
27
|
+
@submit-button-clicked="${this._handleButtonClick}"
|
|
28
|
+
title="${this._popupTitle}"
|
|
29
|
+
.buttons="${this._dialogButtons}"
|
|
30
|
+
>
|
|
31
|
+
<pd-form-container
|
|
32
|
+
slot="content"
|
|
33
|
+
id="formContainerId"
|
|
34
|
+
?requiredFieldInfo="${this._requiredFieldInfo}"
|
|
30
35
|
commonError="${this._validationError || ""}"
|
|
31
|
-
@field-change="${this._checkFormData}"
|
|
32
|
-
|
|
36
|
+
@field-change="${this._checkFormData}"
|
|
37
|
+
>
|
|
33
38
|
${this._renderContent()}
|
|
34
|
-
|
|
35
39
|
</pd-form-container>
|
|
36
|
-
|
|
37
40
|
</pd-popup-dialog>
|
|
38
41
|
`;
|
|
39
42
|
}
|
|
@@ -47,12 +50,9 @@ const _DefaultDialogPopup = class _DefaultDialogPopup extends LitElement {
|
|
|
47
50
|
disabled: true
|
|
48
51
|
}
|
|
49
52
|
];
|
|
50
|
-
newEvent = new CustomEvent(
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
detail: this._formData
|
|
54
|
-
}
|
|
55
|
-
);
|
|
53
|
+
newEvent = new CustomEvent(STORE_EVENT_NAME, {
|
|
54
|
+
detail: this._formData
|
|
55
|
+
});
|
|
56
56
|
} else {
|
|
57
57
|
newEvent = new CustomEvent(ABORT_EVENT_NAME);
|
|
58
58
|
}
|
|
@@ -72,9 +72,7 @@ const _DefaultDialogPopup = class _DefaultDialogPopup extends LitElement {
|
|
|
72
72
|
const detail = {
|
|
73
73
|
errorMap: /* @__PURE__ */ new Map()
|
|
74
74
|
};
|
|
75
|
-
(_b = (_a = this.shadowRoot) == null ? void 0 : _a.getElementById("formContainerId")) == null ? void 0 : _b.dispatchEvent(
|
|
76
|
-
new CustomEvent("validate-form", { detail })
|
|
77
|
-
);
|
|
75
|
+
(_b = (_a = this.shadowRoot) == null ? void 0 : _a.getElementById("formContainerId")) == null ? void 0 : _b.dispatchEvent(new CustomEvent("validate-form", { detail }));
|
|
78
76
|
this._dialogButtons[1].disabled = this._isValidFormData();
|
|
79
77
|
}
|
|
80
78
|
};
|
|
@@ -85,7 +83,7 @@ _DefaultDialogPopup.styles = [
|
|
|
85
83
|
--pd-popup-header-height: 50px;
|
|
86
84
|
--pd-popup-header-font-size: 1em;
|
|
87
85
|
--pd-popup-header-col: var(--app-primary-dark-col);
|
|
88
|
-
|
|
86
|
+
|
|
89
87
|
--pd-button-width: var(--pd-dialog-popup-button-width, 100px);
|
|
90
88
|
--pd-button-height: 35px;
|
|
91
89
|
--pd-button-font-size: 0.8rem;
|
|
@@ -23,20 +23,18 @@ let DefaultLogin = class extends DefaultViewPage {
|
|
|
23
23
|
super.update(changedProperties);
|
|
24
24
|
}
|
|
25
25
|
render() {
|
|
26
|
-
return html`
|
|
27
|
-
<pd-login></pd-login>
|
|
28
|
-
`;
|
|
26
|
+
return html` <pd-login></pd-login> `;
|
|
29
27
|
}
|
|
30
28
|
};
|
|
31
29
|
DefaultLogin.styles = [
|
|
32
|
-
css`
|
|
30
|
+
css`
|
|
33
31
|
:host {
|
|
34
32
|
padding-top: 3em;
|
|
35
33
|
display: flex;
|
|
36
34
|
align-items: center;
|
|
37
35
|
justify-content: center;
|
|
38
|
-
}
|
|
39
|
-
|
|
36
|
+
}
|
|
37
|
+
`
|
|
40
38
|
];
|
|
41
39
|
DefaultLogin = __decorateClass([
|
|
42
40
|
customElement("default-login")
|
|
@@ -3,9 +3,7 @@ import "@progressive-development/pd-dialog/pd-popup";
|
|
|
3
3
|
const _DefaultPopup = class _DefaultPopup extends LitElement {
|
|
4
4
|
render() {
|
|
5
5
|
return html`
|
|
6
|
-
<pd-popup id="pdPopupId">
|
|
7
|
-
${this._renderContent()}
|
|
8
|
-
</pd-popup>
|
|
6
|
+
<pd-popup id="pdPopupId"> ${this._renderContent()} </pd-popup>
|
|
9
7
|
`;
|
|
10
8
|
}
|
|
11
9
|
};
|
|
@@ -23,16 +23,14 @@ class DefaultStepAddress extends DefaultWizardStep {
|
|
|
23
23
|
var _a, _b, _c, _d;
|
|
24
24
|
console.log("render default step: ", this.withPropertyDate);
|
|
25
25
|
return html`
|
|
26
|
-
${this._addressInfo ? html`
|
|
27
|
-
<
|
|
28
|
-
` : ""}
|
|
29
|
-
<pd-order-contacts
|
|
26
|
+
${this._addressInfo ? html` <p>${this._addressInfo}</p> ` : ""}
|
|
27
|
+
<pd-order-contacts
|
|
30
28
|
id="${this._formId}"
|
|
31
|
-
?withPayment="${this.withPayment}"
|
|
32
|
-
?withPropertyOwner="${this.withPropertyOwner}"
|
|
29
|
+
?withPayment="${this.withPayment}"
|
|
30
|
+
?withPropertyOwner="${this.withPropertyOwner}"
|
|
33
31
|
?withPropertyDate="${this.withPropertyDate}"
|
|
34
32
|
.match="${this.match}"
|
|
35
|
-
.orderContact="${(_a = this.contacts) == null ? void 0 : _a.orderContact}"
|
|
33
|
+
.orderContact="${(_a = this.contacts) == null ? void 0 : _a.orderContact}"
|
|
36
34
|
.billingContact="${(_b = this.contacts) == null ? void 0 : _b.billingContact}"
|
|
37
35
|
.adminContact="${(_c = this.contacts) == null ? void 0 : _c.adminContact}"
|
|
38
36
|
.propertyContact="${(_d = this.contacts) == null ? void 0 : _d.propertyContact}"
|
|
@@ -27,12 +27,14 @@ const _DefaultStepSummary = class _DefaultStepSummary extends DefaultWizardStep
|
|
|
27
27
|
}
|
|
28
28
|
render() {
|
|
29
29
|
return html`
|
|
30
|
-
<pd-order-summary
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
30
|
+
<pd-order-summary
|
|
31
|
+
id="${this._formId}"
|
|
32
|
+
?withPayment="${this.withPayment}"
|
|
33
|
+
.order="${this.orderForSummary}"
|
|
34
|
+
?withAgreement="${this._withAgreement}"
|
|
35
|
+
.orderSteps="${this._orderSteps}"
|
|
36
|
+
>
|
|
37
|
+
${this._withAgreement ? html`<span slot="legal">${this._getConditions()}</span>` : ""}
|
|
36
38
|
</pd-order-summary>
|
|
37
39
|
`;
|
|
38
40
|
}
|
|
@@ -23,7 +23,6 @@ let DefaultViewPage = class extends LitElement {
|
|
|
23
23
|
};
|
|
24
24
|
DefaultViewPage.styles = [
|
|
25
25
|
css`
|
|
26
|
-
|
|
27
26
|
:host {
|
|
28
27
|
min-height: 100%;
|
|
29
28
|
}
|
|
@@ -55,7 +54,6 @@ DefaultViewPage.styles = [
|
|
|
55
54
|
.no-top-padding {
|
|
56
55
|
padding-top: 0;
|
|
57
56
|
}
|
|
58
|
-
|
|
59
57
|
`
|
|
60
58
|
];
|
|
61
59
|
__decorateClass([
|
|
@@ -25,9 +25,7 @@ class DefaultWizardStep extends LitElement {
|
|
|
25
25
|
const detail = {
|
|
26
26
|
errorMap: /* @__PURE__ */ new Map()
|
|
27
27
|
};
|
|
28
|
-
(_c = (_b = this.shadowRoot) == null ? void 0 : _b.getElementById(this._formId)) == null ? void 0 : _c.dispatchEvent(
|
|
29
|
-
new CustomEvent("validate-form", { detail })
|
|
30
|
-
);
|
|
28
|
+
(_c = (_b = this.shadowRoot) == null ? void 0 : _b.getElementById(this._formId)) == null ? void 0 : _c.dispatchEvent(new CustomEvent("validate-form", { detail }));
|
|
31
29
|
}
|
|
32
30
|
}
|
|
33
31
|
_formInit(elRef) {
|
|
@@ -65,13 +63,13 @@ class DefaultWizardStep extends LitElement {
|
|
|
65
63
|
/**
|
|
66
64
|
* Prepare the order (trigger side-effets) after update from order step.
|
|
67
65
|
* Used to reset the tax after heating (house age) oder contact (business), but could use for anything else.
|
|
68
|
-
*
|
|
66
|
+
*
|
|
69
67
|
* The default implementation just returns the updated order to prevent all clients from implementing the method.
|
|
70
|
-
*
|
|
68
|
+
*
|
|
71
69
|
* @param updatedOrder order with updates from step.
|
|
72
70
|
* @returns preparedOrder - with (e.g. prices) changes triggered by step update.
|
|
73
71
|
*/
|
|
74
|
-
// eslint-disable-next-line class-methods-use-this
|
|
72
|
+
// eslint-disable-next-line class-methods-use-this
|
|
75
73
|
_prepareOrderAfterStepUpdate(updatedOrder) {
|
|
76
74
|
return updatedOrder;
|
|
77
75
|
}
|
|
@@ -104,8 +102,8 @@ class DefaultWizardStep extends LitElement {
|
|
|
104
102
|
}
|
|
105
103
|
/**
|
|
106
104
|
* Call from wizard.
|
|
107
|
-
*
|
|
108
|
-
* @param reloadedOrder
|
|
105
|
+
*
|
|
106
|
+
* @param reloadedOrder
|
|
109
107
|
*/
|
|
110
108
|
// eslint-disable-next-line class-methods-use-this
|
|
111
109
|
reloadFromOrder(reloadedOrder) {
|
|
@@ -26,12 +26,12 @@ const _DefaultWizard = class _DefaultWizard2 extends DefaultViewPage {
|
|
|
26
26
|
}
|
|
27
27
|
render() {
|
|
28
28
|
return html`
|
|
29
|
-
<pd-wizard
|
|
29
|
+
<pd-wizard
|
|
30
30
|
id="wizardId"
|
|
31
31
|
class="${this._roundedBorder ? "top-rounded bottom-rounded" : ""}"
|
|
32
32
|
?panelWizard="${this.panelWizard}"
|
|
33
33
|
currentNumber="${this._currentOrderStep}"
|
|
34
|
-
.wizardSteps="${this._wizardSteps}"
|
|
34
|
+
.wizardSteps="${this._wizardSteps}"
|
|
35
35
|
@next-step="${this._nextStep}"
|
|
36
36
|
@previous-step="${this._previousStep}"
|
|
37
37
|
@submit-wizard="${this._nextStep}"
|
|
@@ -39,8 +39,7 @@ const _DefaultWizard = class _DefaultWizard2 extends DefaultViewPage {
|
|
|
39
39
|
@close-wizard="${this._closeWizardRequest}"
|
|
40
40
|
@wizard-step-update="${this._doStorageEventUpdate}"
|
|
41
41
|
>
|
|
42
|
-
${this._renderLogo()}
|
|
43
|
-
${this._renderSteps()}
|
|
42
|
+
${this._renderLogo()} ${this._renderSteps()}
|
|
44
43
|
</pd-wizard>
|
|
45
44
|
`;
|
|
46
45
|
}
|
|
@@ -58,8 +57,12 @@ const _DefaultWizard = class _DefaultWizard2 extends DefaultViewPage {
|
|
|
58
57
|
if (storageEl && storageEl.orderFormData !== void 0) {
|
|
59
58
|
const popup = new WizardReloadPopup();
|
|
60
59
|
popup.reloadItem = storageEl;
|
|
61
|
-
popup.okButtonText = msg("Fortsetzen", {
|
|
62
|
-
|
|
60
|
+
popup.okButtonText = msg("Fortsetzen", {
|
|
61
|
+
id: "spaH.wizard.reload.popup.ok"
|
|
62
|
+
});
|
|
63
|
+
popup.cancelButtonText = msg("Verwerfen", {
|
|
64
|
+
id: "spaH.wizard.reload.popup.cancel"
|
|
65
|
+
});
|
|
63
66
|
popup.addEventListener(ABORT_EVENT_NAME, () => {
|
|
64
67
|
var _a2;
|
|
65
68
|
this._removeFromStorage();
|
|
@@ -73,7 +76,9 @@ const _DefaultWizard = class _DefaultWizard2 extends DefaultViewPage {
|
|
|
73
76
|
(_a2 = this.shadowRoot) == null ? void 0 : _a2.removeChild(popup);
|
|
74
77
|
for (let stepNr = 1; stepNr <= this._wizardSteps.length; stepNr += 1) {
|
|
75
78
|
const stepId = `wiz${stepNr}Id`;
|
|
76
|
-
const stepElement = (_b = this.shadowRoot) == null ? void 0 : _b.getElementById(
|
|
79
|
+
const stepElement = (_b = this.shadowRoot) == null ? void 0 : _b.getElementById(
|
|
80
|
+
stepId
|
|
81
|
+
);
|
|
77
82
|
if (stepElement && typeof stepElement.reloadFromOrder === "function") {
|
|
78
83
|
stepElement.reloadFromOrder(this._orderFormData);
|
|
79
84
|
}
|
|
@@ -102,8 +107,13 @@ const _DefaultWizard = class _DefaultWizard2 extends DefaultViewPage {
|
|
|
102
107
|
wizardStep: this._currentOrderStep,
|
|
103
108
|
timestamp: (/* @__PURE__ */ new Date()).toUTCString()
|
|
104
109
|
};
|
|
105
|
-
localStorage.setItem(
|
|
106
|
-
|
|
110
|
+
localStorage.setItem(
|
|
111
|
+
RUNNING_WIZARD_STORAGE_ELEMENTS,
|
|
112
|
+
JSON.stringify(storageWizard)
|
|
113
|
+
);
|
|
114
|
+
console.debug(
|
|
115
|
+
`Update wizard local storage for key ${this._withLocalStorageId}`
|
|
116
|
+
);
|
|
107
117
|
}
|
|
108
118
|
}
|
|
109
119
|
_removeFromStorage() {
|
|
@@ -114,7 +124,9 @@ const _DefaultWizard = class _DefaultWizard2 extends DefaultViewPage {
|
|
|
114
124
|
RUNNING_WIZARD_STORAGE_ELEMENTS,
|
|
115
125
|
JSON.stringify(storageWizard)
|
|
116
126
|
);
|
|
117
|
-
console.debug(
|
|
127
|
+
console.debug(
|
|
128
|
+
`Remove wizard local storage for key ${this._withLocalStorageId}`
|
|
129
|
+
);
|
|
118
130
|
}
|
|
119
131
|
}
|
|
120
132
|
_nextStep(e) {
|
|
@@ -175,8 +187,12 @@ const _DefaultWizard = class _DefaultWizard2 extends DefaultViewPage {
|
|
|
175
187
|
if (this._withLocalStorageId) {
|
|
176
188
|
const popup = new WizardClosePopup();
|
|
177
189
|
popup.withStorage = true;
|
|
178
|
-
popup.okButtonText = msg("Speichern", {
|
|
179
|
-
|
|
190
|
+
popup.okButtonText = msg("Speichern", {
|
|
191
|
+
id: "spaH.wizard.storage.close.popup.ok"
|
|
192
|
+
});
|
|
193
|
+
popup.cancelButtonText = msg("Verwerfen", {
|
|
194
|
+
id: "spaH.wizard.storage.close.popup.cancel"
|
|
195
|
+
});
|
|
180
196
|
popup.addEventListener(ABORT_EVENT_NAME, () => {
|
|
181
197
|
var _a2;
|
|
182
198
|
this._removeFromStorage();
|
|
@@ -192,8 +208,12 @@ const _DefaultWizard = class _DefaultWizard2 extends DefaultViewPage {
|
|
|
192
208
|
} else {
|
|
193
209
|
const popup = new WizardClosePopup();
|
|
194
210
|
popup.withStorage = false;
|
|
195
|
-
popup.okButtonText = msg("Schließen", {
|
|
196
|
-
|
|
211
|
+
popup.okButtonText = msg("Schließen", {
|
|
212
|
+
id: "spaH.wizard.close.popup.ok"
|
|
213
|
+
});
|
|
214
|
+
popup.cancelButtonText = msg("Abbrechen", {
|
|
215
|
+
id: "spaH.wizard.close.popup.cancel"
|
|
216
|
+
});
|
|
197
217
|
popup.addEventListener(ABORT_EVENT_NAME, () => {
|
|
198
218
|
var _a2;
|
|
199
219
|
(_a2 = this.shadowRoot) == null ? void 0 : _a2.removeChild(popup);
|
|
@@ -1,16 +1,23 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
1
|
+
import { beTemplates as beTemplates$2 } from "@progressive-development/pd-wizard";
|
|
2
|
+
import { beTemplates as beTemplates$1 } from "@progressive-development/pd-page";
|
|
3
|
+
import "../../../node_modules/@progressive-development/pd-content/dist/pd-box-view.js";
|
|
4
|
+
import "../../../node_modules/@progressive-development/pd-content/dist/pd-collapse.js";
|
|
5
|
+
import "../../../node_modules/@progressive-development/pd-content/dist/pd-edit-content.js";
|
|
6
|
+
import "../../../node_modules/@progressive-development/pd-content/dist/pd-more-info.js";
|
|
7
|
+
import "../../../node_modules/@progressive-development/pd-content/dist/pd-resize-content.js";
|
|
8
|
+
import { templates as templates$1 } from "../../../node_modules/@progressive-development/pd-content/dist/locales/be.js";
|
|
9
|
+
import { beTemplates } from "@progressive-development/pd-forms";
|
|
10
|
+
import { beTemplates as beTemplates$3 } from "@progressive-development/pd-order";
|
|
11
|
+
import { beTemplates as beTemplates$4 } from "@progressive-development/pd-dialog";
|
|
12
|
+
import { templates as templates$2 } from "../locales/be.js";
|
|
7
13
|
const templates = {
|
|
8
|
-
...templates$6,
|
|
9
|
-
...templates$5,
|
|
10
|
-
...templates$4,
|
|
11
|
-
...templates$3,
|
|
12
14
|
...templates$2,
|
|
13
|
-
...
|
|
15
|
+
...beTemplates$4,
|
|
16
|
+
...beTemplates$3,
|
|
17
|
+
...beTemplates$2,
|
|
18
|
+
...beTemplates$1,
|
|
19
|
+
...templates$1,
|
|
20
|
+
...beTemplates
|
|
14
21
|
};
|
|
15
22
|
export {
|
|
16
23
|
templates
|
|
@@ -1,16 +1,23 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
1
|
+
import { deTemplates as deTemplates$2 } from "@progressive-development/pd-wizard";
|
|
2
|
+
import { deTemplates as deTemplates$1 } from "@progressive-development/pd-page";
|
|
3
|
+
import "../../../node_modules/@progressive-development/pd-content/dist/pd-box-view.js";
|
|
4
|
+
import "../../../node_modules/@progressive-development/pd-content/dist/pd-collapse.js";
|
|
5
|
+
import "../../../node_modules/@progressive-development/pd-content/dist/pd-edit-content.js";
|
|
6
|
+
import "../../../node_modules/@progressive-development/pd-content/dist/pd-more-info.js";
|
|
7
|
+
import "../../../node_modules/@progressive-development/pd-content/dist/pd-resize-content.js";
|
|
8
|
+
import { templates as templates$1 } from "../../../node_modules/@progressive-development/pd-content/dist/locales/de.js";
|
|
9
|
+
import { deTemplates } from "@progressive-development/pd-forms";
|
|
10
|
+
import { deTemplates as deTemplates$3 } from "@progressive-development/pd-order";
|
|
11
|
+
import { deTemplates as deTemplates$4 } from "@progressive-development/pd-dialog";
|
|
12
|
+
import { templates as templates$2 } from "../locales/de.js";
|
|
7
13
|
const templates = {
|
|
8
|
-
...templates$6,
|
|
9
|
-
...templates$5,
|
|
10
|
-
...templates$4,
|
|
11
|
-
...templates$3,
|
|
12
14
|
...templates$2,
|
|
13
|
-
...
|
|
15
|
+
...deTemplates$4,
|
|
16
|
+
...deTemplates$3,
|
|
17
|
+
...deTemplates$2,
|
|
18
|
+
...deTemplates$1,
|
|
19
|
+
...templates$1,
|
|
20
|
+
...deTemplates
|
|
14
21
|
};
|
|
15
22
|
export {
|
|
16
23
|
templates
|
|
@@ -1,16 +1,23 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
1
|
+
import { enTemplates as enTemplates$2 } from "@progressive-development/pd-wizard";
|
|
2
|
+
import { enTemplates as enTemplates$1 } from "@progressive-development/pd-page";
|
|
3
|
+
import "../../../node_modules/@progressive-development/pd-content/dist/pd-box-view.js";
|
|
4
|
+
import "../../../node_modules/@progressive-development/pd-content/dist/pd-collapse.js";
|
|
5
|
+
import "../../../node_modules/@progressive-development/pd-content/dist/pd-edit-content.js";
|
|
6
|
+
import "../../../node_modules/@progressive-development/pd-content/dist/pd-more-info.js";
|
|
7
|
+
import "../../../node_modules/@progressive-development/pd-content/dist/pd-resize-content.js";
|
|
8
|
+
import { templates as templates$1 } from "../../../node_modules/@progressive-development/pd-content/dist/locales/en.js";
|
|
9
|
+
import { enTemplates } from "@progressive-development/pd-forms";
|
|
10
|
+
import { enTemplates as enTemplates$3 } from "@progressive-development/pd-order";
|
|
11
|
+
import { enTemplates as enTemplates$4 } from "@progressive-development/pd-dialog";
|
|
12
|
+
import { templates as templates$2 } from "../locales/en.js";
|
|
7
13
|
const templates = {
|
|
8
|
-
...templates$6,
|
|
9
|
-
...templates$5,
|
|
10
|
-
...templates$4,
|
|
11
|
-
...templates$3,
|
|
12
14
|
...templates$2,
|
|
13
|
-
...
|
|
15
|
+
...enTemplates$4,
|
|
16
|
+
...enTemplates$3,
|
|
17
|
+
...enTemplates$2,
|
|
18
|
+
...enTemplates$1,
|
|
19
|
+
...templates$1,
|
|
20
|
+
...enTemplates
|
|
14
21
|
};
|
|
15
22
|
export {
|
|
16
23
|
templates
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
function arrayBufferToBase64(buffer) {
|
|
2
|
+
let binary = "";
|
|
3
|
+
const bytes = [].slice.call(new Uint8Array(buffer));
|
|
4
|
+
bytes.forEach((b) => binary += String.fromCharCode(b));
|
|
5
|
+
return window.btoa(binary);
|
|
6
|
+
}
|
|
7
|
+
const blobToBase64 = async (blob, type, otherType) => {
|
|
8
|
+
let base64Flag = "";
|
|
9
|
+
if (type === "png") {
|
|
10
|
+
base64Flag = "data:image/png;base64,";
|
|
11
|
+
} else if (type === "pdf") {
|
|
12
|
+
base64Flag = "data:application/pdf;base64,";
|
|
13
|
+
} else if (type === "image") {
|
|
14
|
+
base64Flag = `data:${otherType};base64,`;
|
|
15
|
+
}
|
|
16
|
+
const imageStr = arrayBufferToBase64(await blob.arrayBuffer());
|
|
17
|
+
return base64Flag + imageStr;
|
|
18
|
+
};
|
|
19
|
+
function cleanBase64(fileContent) {
|
|
20
|
+
if (fileContent.startsWith("data:")) {
|
|
21
|
+
return fileContent.replace(/^data:.*;base64,/, "");
|
|
22
|
+
}
|
|
23
|
+
return fileContent;
|
|
24
|
+
}
|
|
25
|
+
function base64ToUint8Array(base64) {
|
|
26
|
+
const binaryString = atob(cleanBase64(base64));
|
|
27
|
+
const len = binaryString.length;
|
|
28
|
+
const bytes = new Uint8Array(len);
|
|
29
|
+
for (let i = 0; i < len; i += 1) {
|
|
30
|
+
bytes[i] = binaryString.charCodeAt(i);
|
|
31
|
+
}
|
|
32
|
+
return bytes;
|
|
33
|
+
}
|
|
34
|
+
export {
|
|
35
|
+
base64ToUint8Array,
|
|
36
|
+
blobToBase64
|
|
37
|
+
};
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
import { parse } from "date-fns";
|
|
2
|
+
import { UNDEF } from "../model/spa-model.js";
|
|
3
|
+
import { getCurrentFormatLocale, getCurrentTimeZone } from "./locale-format.js";
|
|
4
|
+
const calculateDueWeeks = (billingDate, dueDate) => {
|
|
5
|
+
const billingDateObj = typeof billingDate === "string" ? new Date(billingDate) : billingDate;
|
|
6
|
+
const dueDateObj = typeof dueDate === "string" ? new Date(dueDate) : dueDate;
|
|
7
|
+
const MS_PER_WEEK = 1e3 * 60 * 60 * 24 * 7;
|
|
8
|
+
const diffInMs = dueDateObj.getTime() - billingDateObj.getTime();
|
|
9
|
+
const weeks = Math.round(diffInMs / MS_PER_WEEK);
|
|
10
|
+
if (weeks >= 1 && weeks <= 4) {
|
|
11
|
+
return weeks.toString();
|
|
12
|
+
}
|
|
13
|
+
return UNDEF;
|
|
14
|
+
};
|
|
15
|
+
const minutesToIndustrialHours = (minutes) => {
|
|
16
|
+
if (typeof minutes !== "number" || isNaN(minutes) || minutes <= 0) {
|
|
17
|
+
return 0;
|
|
18
|
+
}
|
|
19
|
+
return Math.round(minutes / 60 * 100) / 100;
|
|
20
|
+
};
|
|
21
|
+
const industrialHoursToMinutes = (hours) => {
|
|
22
|
+
if (typeof hours !== "number" || isNaN(hours) || hours <= 0) {
|
|
23
|
+
return 0;
|
|
24
|
+
}
|
|
25
|
+
return Math.round(hours * 60);
|
|
26
|
+
};
|
|
27
|
+
const calculateDurationInMinutes = (start, end) => {
|
|
28
|
+
if (!start || !end) return 0;
|
|
29
|
+
const startDate = typeof start === "string" ? new Date(start) : start;
|
|
30
|
+
const endDate = typeof end === "string" ? new Date(end) : end;
|
|
31
|
+
return (endDate.getTime() - startDate.getTime()) / (1e3 * 60);
|
|
32
|
+
};
|
|
33
|
+
const formatToTime = (date, emptyResult) => {
|
|
34
|
+
let resultStr = emptyResult !== void 0 ? emptyResult : "--";
|
|
35
|
+
try {
|
|
36
|
+
if (date !== void 0 && date !== null) {
|
|
37
|
+
const usedDate = typeof date === "string" || typeof date === "number" ? new Date(date) : date;
|
|
38
|
+
resultStr = usedDate.toLocaleTimeString(getCurrentFormatLocale(), {
|
|
39
|
+
hour: "2-digit",
|
|
40
|
+
minute: "2-digit",
|
|
41
|
+
timeZone: getCurrentTimeZone()
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
} catch (error) {
|
|
45
|
+
console.error("Failed calll", date, error);
|
|
46
|
+
}
|
|
47
|
+
return resultStr;
|
|
48
|
+
};
|
|
49
|
+
const formatShortDate = (date, withTime) => {
|
|
50
|
+
let resultStr = "--";
|
|
51
|
+
if (date) {
|
|
52
|
+
const usedDate = typeof date === "string" || typeof date === "number" ? new Date(date) : date;
|
|
53
|
+
resultStr = usedDate.toLocaleDateString(
|
|
54
|
+
getCurrentFormatLocale(),
|
|
55
|
+
withTime ? {
|
|
56
|
+
day: "2-digit",
|
|
57
|
+
month: "2-digit",
|
|
58
|
+
year: "numeric",
|
|
59
|
+
hour: "2-digit",
|
|
60
|
+
minute: "2-digit",
|
|
61
|
+
timeZone: getCurrentTimeZone()
|
|
62
|
+
} : {
|
|
63
|
+
day: "2-digit",
|
|
64
|
+
month: "2-digit",
|
|
65
|
+
year: "numeric",
|
|
66
|
+
timeZone: getCurrentTimeZone()
|
|
67
|
+
}
|
|
68
|
+
);
|
|
69
|
+
}
|
|
70
|
+
return resultStr;
|
|
71
|
+
};
|
|
72
|
+
function toISODateTime(dateObj, timeStr) {
|
|
73
|
+
const [hours, minutes] = timeStr.split(":").map(Number);
|
|
74
|
+
const newDate = new Date(dateObj);
|
|
75
|
+
newDate.setHours(hours, minutes, 0, 0);
|
|
76
|
+
return newDate.toISOString();
|
|
77
|
+
}
|
|
78
|
+
function formatDateTime(date, withTime) {
|
|
79
|
+
let resultStr = "--";
|
|
80
|
+
if (date) {
|
|
81
|
+
const usedDate = typeof date === "string" || typeof date === "number" ? new Date(date) : date;
|
|
82
|
+
resultStr = usedDate.toLocaleDateString(
|
|
83
|
+
getCurrentFormatLocale(),
|
|
84
|
+
withTime ? {
|
|
85
|
+
weekday: "long",
|
|
86
|
+
year: "numeric",
|
|
87
|
+
month: "long",
|
|
88
|
+
day: "numeric",
|
|
89
|
+
hour: "2-digit",
|
|
90
|
+
minute: "2-digit",
|
|
91
|
+
timeZone: getCurrentTimeZone()
|
|
92
|
+
} : {
|
|
93
|
+
weekday: "long",
|
|
94
|
+
year: "numeric",
|
|
95
|
+
month: "long",
|
|
96
|
+
day: "numeric",
|
|
97
|
+
timeZone: getCurrentTimeZone()
|
|
98
|
+
}
|
|
99
|
+
);
|
|
100
|
+
}
|
|
101
|
+
return resultStr;
|
|
102
|
+
}
|
|
103
|
+
const formatMonth = (date, withYear) => {
|
|
104
|
+
let resultStr = "--";
|
|
105
|
+
if (date) {
|
|
106
|
+
const usedDate = typeof date === "string" || typeof date === "number" ? new Date(date) : date;
|
|
107
|
+
resultStr = usedDate.toLocaleDateString(
|
|
108
|
+
getCurrentFormatLocale(),
|
|
109
|
+
withYear ? {
|
|
110
|
+
month: "long",
|
|
111
|
+
year: "numeric",
|
|
112
|
+
timeZone: getCurrentTimeZone()
|
|
113
|
+
} : {
|
|
114
|
+
month: "long",
|
|
115
|
+
timeZone: getCurrentTimeZone()
|
|
116
|
+
}
|
|
117
|
+
);
|
|
118
|
+
}
|
|
119
|
+
return resultStr;
|
|
120
|
+
};
|
|
121
|
+
const dateFormatWithoutTime = "dd/MM/yyyy";
|
|
122
|
+
const getUTCFromDatepickerString = (dateString) => {
|
|
123
|
+
const parsedDate = parse(dateString, dateFormatWithoutTime, /* @__PURE__ */ new Date());
|
|
124
|
+
return parsedDate.toUTCString();
|
|
125
|
+
};
|
|
126
|
+
export {
|
|
127
|
+
calculateDueWeeks,
|
|
128
|
+
calculateDurationInMinutes,
|
|
129
|
+
formatDateTime,
|
|
130
|
+
formatMonth,
|
|
131
|
+
formatShortDate,
|
|
132
|
+
formatToTime,
|
|
133
|
+
getUTCFromDatepickerString,
|
|
134
|
+
industrialHoursToMinutes,
|
|
135
|
+
minutesToIndustrialHours,
|
|
136
|
+
toISODateTime
|
|
137
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
const settingsMap = {
|
|
2
|
+
be: { locale: "nl-BE", timeZone: "Europe/Brussels" },
|
|
3
|
+
en: { locale: "en-GB", timeZone: "Europe/London" },
|
|
4
|
+
de: { locale: "de-DE", timeZone: "Europe/Berlin" }
|
|
5
|
+
};
|
|
6
|
+
let currentLocale = "de-DE";
|
|
7
|
+
let currentTimeZone = "Europe/Berlin";
|
|
8
|
+
const getCurrentFormatLocale = () => currentLocale;
|
|
9
|
+
const getCurrentTimeZone = () => currentTimeZone;
|
|
10
|
+
const setCurrentFormatLocale = (localeKey) => {
|
|
11
|
+
const settings = settingsMap[localeKey] ?? settingsMap["de"];
|
|
12
|
+
currentLocale = settings.locale;
|
|
13
|
+
currentTimeZone = settings.timeZone;
|
|
14
|
+
};
|
|
15
|
+
export {
|
|
16
|
+
getCurrentFormatLocale,
|
|
17
|
+
getCurrentTimeZone,
|
|
18
|
+
setCurrentFormatLocale
|
|
19
|
+
};
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import { pdStore } from "../store/mini-rx.store.js";
|
|
2
2
|
import { updateInternetOffline } from "../store/spa-app-actions.js";
|
|
3
|
-
const isEmpty = (field) => !field || field === "";
|
|
4
|
-
const isBlank = (field) => !field || isEmpty(field.trim());
|
|
5
3
|
const handleOnlineEvent = () => pdStore().dispatch(updateInternetOffline(false));
|
|
6
4
|
const handleOfflineEvent = () => pdStore().dispatch(updateInternetOffline(true));
|
|
7
5
|
const deactivateOfflineWatcher = () => {
|
|
@@ -15,21 +13,7 @@ const activateOfflineWatcher = (firstCall) => {
|
|
|
15
13
|
pdStore().dispatch(updateInternetOffline(navigator.onLine === false));
|
|
16
14
|
}
|
|
17
15
|
};
|
|
18
|
-
const isValidNumber = (value) => {
|
|
19
|
-
if (!value) {
|
|
20
|
-
return false;
|
|
21
|
-
}
|
|
22
|
-
try {
|
|
23
|
-
const numberValue = Number(value);
|
|
24
|
-
return !Number.isNaN(numberValue);
|
|
25
|
-
} catch (e) {
|
|
26
|
-
return false;
|
|
27
|
-
}
|
|
28
|
-
};
|
|
29
16
|
export {
|
|
30
17
|
activateOfflineWatcher,
|
|
31
|
-
deactivateOfflineWatcher
|
|
32
|
-
isBlank,
|
|
33
|
-
isEmpty,
|
|
34
|
-
isValidNumber
|
|
18
|
+
deactivateOfflineWatcher
|
|
35
19
|
};
|