@progressive-development/pd-spa-helper 0.3.102 → 0.3.104
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/index.js +72 -0
- package/dist/node_modules/@firebase/app/dist/esm/index.esm2017.js +749 -0
- package/dist/node_modules/@firebase/auth/dist/esm2017/index-68602d24.js +6265 -0
- package/dist/node_modules/@firebase/component/dist/esm/index.esm2017.js +341 -0
- package/dist/node_modules/@firebase/firestore/dist/index.esm2017.js +10250 -0
- package/dist/node_modules/@firebase/functions/dist/index.esm2017.js +513 -0
- package/dist/node_modules/@firebase/installations/dist/esm/index.esm2017.js +863 -0
- package/dist/node_modules/@firebase/logger/dist/esm/index.esm2017.js +122 -0
- package/dist/node_modules/@firebase/messaging/dist/esm/index.esm2017.js +1019 -0
- package/dist/node_modules/@firebase/storage/dist/index.esm2017.js +2042 -0
- package/dist/node_modules/@firebase/util/dist/index.esm2017.js +931 -0
- package/dist/node_modules/@firebase/webchannel-wrapper/dist/bloom-blob/esm/bloom_blob_es2018.js +417 -0
- package/dist/node_modules/@firebase/webchannel-wrapper/dist/webchannel-blob/esm/webchannel_blob_es2018.js +2155 -0
- package/dist/node_modules/@lit/reactive-element/decorators/custom-element.js +14 -0
- package/dist/node_modules/@lit/reactive-element/decorators/property.js +20 -0
- package/dist/node_modules/@lit/reactive-element/decorators/query-assigned-elements.js +7 -0
- package/dist/node_modules/@progressive-development/pd-dialog/pd-popup-dialog.js +5 -0
- package/dist/node_modules/@progressive-development/pd-dialog/pd-popup.js +2 -0
- package/dist/node_modules/@progressive-development/pd-dialog/src/PdPopup.js +113 -0
- package/dist/node_modules/@progressive-development/pd-dialog/src/PdPopupDialog.js +189 -0
- package/dist/node_modules/@progressive-development/pd-forms/pd-button.js +2 -0
- package/dist/node_modules/@progressive-development/pd-forms/pd-form-container.js +2 -0
- package/dist/node_modules/@progressive-development/pd-forms/pd-form-row.js +2 -0
- package/dist/node_modules/@progressive-development/pd-forms/pd-hover-box.js +2 -0
- package/dist/node_modules/@progressive-development/pd-forms/pd-input.js +2 -0
- package/dist/node_modules/@progressive-development/pd-forms/src/PdBaseInputElement.js +86 -0
- package/dist/node_modules/@progressive-development/pd-forms/src/PdBaseUi.js +34 -0
- package/dist/node_modules/@progressive-development/pd-forms/src/PdBaseUiInput.js +227 -0
- package/dist/node_modules/@progressive-development/pd-forms/src/PdButton.js +194 -0
- package/dist/node_modules/@progressive-development/pd-forms/src/PdFormContainer.js +167 -0
- package/dist/node_modules/@progressive-development/pd-forms/src/PdFormRow.js +92 -0
- package/dist/node_modules/@progressive-development/pd-forms/src/PdHoverBox.js +108 -0
- package/dist/node_modules/@progressive-development/pd-forms/src/PdInput.js +79 -0
- package/dist/node_modules/@progressive-development/pd-forms/src/generated/locale/be.js +11 -0
- package/dist/node_modules/@progressive-development/pd-forms/src/generated/locale/en.js +11 -0
- package/dist/node_modules/@progressive-development/pd-forms/src/shared-input-field-styles.js +152 -0
- package/dist/node_modules/@progressive-development/pd-forms/src/shared-input-styles.js +64 -0
- package/dist/node_modules/@progressive-development/pd-icon/pd-icon.js +4 -0
- package/dist/node_modules/@progressive-development/pd-icon/src/PdIcon.js +596 -0
- package/dist/node_modules/@progressive-development/pd-order/dist/locales/be.js +15 -0
- package/dist/node_modules/@progressive-development/pd-order/dist/locales/de.js +15 -0
- package/dist/node_modules/@progressive-development/pd-order/dist/locales/en.js +15 -0
- package/dist/node_modules/@progressive-development/pd-order/dist/node_modules/@progressive-development/pd-contact/pd-contact.js +2 -0
- package/dist/node_modules/@progressive-development/pd-order/dist/node_modules/@progressive-development/pd-contact/src/PdContact.js +567 -0
- package/dist/node_modules/@progressive-development/pd-order/dist/node_modules/@progressive-development/pd-content/pd-collapse.js +2 -0
- package/dist/node_modules/@progressive-development/pd-order/dist/node_modules/@progressive-development/pd-content/pd-edit-content.js +2 -0
- package/dist/node_modules/@progressive-development/pd-order/dist/node_modules/@progressive-development/pd-content/src/PdCollapse.js +136 -0
- package/dist/node_modules/@progressive-development/pd-order/dist/node_modules/@progressive-development/pd-content/src/PdEditContent.js +224 -0
- package/dist/node_modules/@progressive-development/pd-order/dist/node_modules/@progressive-development/pd-dialog/pd-popup.js +2 -0
- package/dist/node_modules/@progressive-development/pd-order/dist/node_modules/@progressive-development/pd-dialog/src/PdPopup.js +113 -0
- package/dist/node_modules/@progressive-development/pd-order/dist/node_modules/@progressive-development/pd-forms/pd-checkbox.js +2 -0
- package/dist/node_modules/@progressive-development/pd-order/dist/node_modules/@progressive-development/pd-forms/pd-form-container.js +2 -0
- package/dist/node_modules/@progressive-development/pd-order/dist/node_modules/@progressive-development/pd-forms/pd-form-row.js +2 -0
- package/dist/node_modules/@progressive-development/pd-order/dist/node_modules/@progressive-development/pd-forms/pd-hover-box.js +2 -0
- package/dist/node_modules/@progressive-development/pd-order/dist/node_modules/@progressive-development/pd-forms/pd-input.js +2 -0
- package/dist/node_modules/@progressive-development/pd-order/dist/node_modules/@progressive-development/pd-forms/pd-radio-group.js +2 -0
- package/dist/node_modules/@progressive-development/pd-order/dist/node_modules/@progressive-development/pd-forms/src/PdBaseInputElement.js +86 -0
- package/dist/node_modules/@progressive-development/pd-order/dist/node_modules/@progressive-development/pd-forms/src/PdBaseUi.js +34 -0
- package/dist/node_modules/@progressive-development/pd-order/dist/node_modules/@progressive-development/pd-forms/src/PdBaseUiInput.js +229 -0
- package/dist/node_modules/@progressive-development/pd-order/dist/node_modules/@progressive-development/pd-forms/src/PdCheckbox.js +230 -0
- package/dist/node_modules/@progressive-development/pd-order/dist/node_modules/@progressive-development/pd-forms/src/PdFormContainer.js +167 -0
- package/dist/node_modules/@progressive-development/pd-order/dist/node_modules/@progressive-development/pd-forms/src/PdFormRow.js +92 -0
- package/dist/node_modules/@progressive-development/pd-order/dist/node_modules/@progressive-development/pd-forms/src/PdHoverBox.js +108 -0
- package/dist/node_modules/@progressive-development/pd-order/dist/node_modules/@progressive-development/pd-forms/src/PdInput.js +79 -0
- package/dist/node_modules/@progressive-development/pd-order/dist/node_modules/@progressive-development/pd-forms/src/PdRadioGroup.js +72 -0
- package/dist/node_modules/@progressive-development/pd-order/dist/node_modules/@progressive-development/pd-forms/src/shared-input-field-styles.js +152 -0
- package/dist/node_modules/@progressive-development/pd-order/dist/node_modules/@progressive-development/pd-forms/src/shared-input-styles.js +64 -0
- package/dist/node_modules/@progressive-development/pd-order/dist/node_modules/@progressive-development/pd-icon/pd-icon.js +4 -0
- package/dist/node_modules/@progressive-development/pd-order/dist/node_modules/@progressive-development/pd-icon/src/PdIcon.js +596 -0
- package/dist/node_modules/@progressive-development/pd-order/dist/node_modules/@progressive-development/pd-price/pd-pricetable.js +2 -0
- package/dist/node_modules/@progressive-development/pd-order/dist/node_modules/@progressive-development/pd-price/src/PdPricetable.js +149 -0
- package/dist/node_modules/@progressive-development/pd-order/dist/node_modules/fecha/lib/fecha.js +200 -0
- package/dist/node_modules/@progressive-development/pd-order/dist/node_modules/lit/node_modules/lit-html/directive.js +27 -0
- package/dist/node_modules/@progressive-development/pd-order/dist/node_modules/lit/node_modules/lit-html/directives/class-map.js +36 -0
- package/dist/node_modules/@progressive-development/pd-order/dist/node_modules/lit/node_modules/lit-html/lit-html.js +242 -0
- package/dist/node_modules/@progressive-development/pd-order/dist/pd-order-contacts.js +2 -0
- package/dist/node_modules/@progressive-development/pd-order/dist/pd-order-summary.js +2 -0
- package/dist/node_modules/@progressive-development/pd-order/dist/src/PdOrderContacts.js +192 -0
- package/dist/node_modules/@progressive-development/pd-order/dist/src/PdOrderSummary.js +243 -0
- package/dist/node_modules/@progressive-development/pd-page/pd-footer.js +2 -0
- package/dist/node_modules/@progressive-development/pd-page/pd-menu.js +2 -0
- package/dist/node_modules/@progressive-development/pd-page/src/PdFooter.js +141 -0
- package/dist/node_modules/@progressive-development/pd-page/src/PdMenu.js +450 -0
- package/dist/node_modules/@progressive-development/pd-shared-styles/src/shared-color-styles.js +30 -0
- package/dist/node_modules/@progressive-development/pd-shared-styles/src/shared-font-styles.js +32 -0
- package/dist/node_modules/@progressive-development/pd-wizard/pd-wizard.js +2 -0
- package/dist/node_modules/@progressive-development/pd-wizard/src/PdSteps.js +191 -0
- package/dist/node_modules/@progressive-development/pd-wizard/src/PdWizard.js +280 -0
- package/dist/node_modules/firebase/app/dist/esm/index.esm.js +35 -0
- package/dist/node_modules/idb/build/index.js +81 -0
- package/dist/node_modules/idb/build/wrap-idb-value.js +148 -0
- package/dist/node_modules/lit/node_modules/lit-html/directive.js +27 -0
- package/dist/node_modules/lit/node_modules/lit-html/directives/class-map.js +36 -0
- package/dist/node_modules/lit/node_modules/lit-html/lit-html.js +242 -0
- package/dist/node_modules/lit-element-router/lit-element-router.js +131 -0
- package/dist/node_modules/lit-element-router/utility/router-utility.js +36 -0
- package/dist/node_modules/mini-rx-store/index.esm.js +458 -0
- package/dist/node_modules/pwa-helpers/media-query.js +17 -0
- package/dist/node_modules/rxjs/dist/esm5/internal/Observable.js +100 -0
- package/dist/node_modules/rxjs/dist/esm5/internal/Subscriber.js +147 -0
- package/dist/node_modules/rxjs/dist/esm5/internal/Subscription.js +139 -0
- package/dist/node_modules/rxjs/dist/esm5/internal/config.js +10 -0
- package/dist/node_modules/rxjs/dist/esm5/internal/observable/innerFrom.js +159 -0
- package/dist/node_modules/rxjs/dist/esm5/internal/operators/OperatorSubscriber.js +52 -0
- package/dist/node_modules/rxjs/dist/esm5/internal/operators/catchError.js +28 -0
- package/dist/node_modules/rxjs/dist/esm5/internal/operators/distinctUntilChanged.js +27 -0
- package/dist/node_modules/rxjs/dist/esm5/internal/operators/filter.js +13 -0
- package/dist/node_modules/rxjs/dist/esm5/internal/operators/map.js +13 -0
- package/dist/node_modules/rxjs/dist/esm5/internal/operators/observeOn.js +26 -0
- package/dist/node_modules/rxjs/dist/esm5/internal/operators/tap.js +36 -0
- package/dist/node_modules/rxjs/dist/esm5/internal/operators/withLatestFrom.js +43 -0
- package/dist/node_modules/rxjs/dist/esm5/internal/scheduler/timeoutProvider.js +18 -0
- package/dist/node_modules/rxjs/dist/esm5/internal/symbol/iterator.js +11 -0
- package/dist/node_modules/rxjs/dist/esm5/internal/symbol/observable.js +6 -0
- package/dist/node_modules/rxjs/dist/esm5/internal/util/UnsubscriptionError.js +14 -0
- package/dist/node_modules/rxjs/dist/esm5/internal/util/args.js +10 -0
- package/dist/node_modules/rxjs/dist/esm5/internal/util/arrRemove.js +9 -0
- package/dist/node_modules/rxjs/dist/esm5/internal/util/createErrorClass.js +13 -0
- package/dist/node_modules/rxjs/dist/esm5/internal/util/errorContext.js +8 -0
- package/dist/node_modules/rxjs/dist/esm5/internal/util/executeSchedule.js +23 -0
- package/dist/node_modules/rxjs/dist/esm5/internal/util/identity.js +6 -0
- package/dist/node_modules/rxjs/dist/esm5/internal/util/isArrayLike.js +6 -0
- package/dist/node_modules/rxjs/dist/esm5/internal/util/isAsyncIterable.js +7 -0
- package/dist/node_modules/rxjs/dist/esm5/internal/util/isFunction.js +6 -0
- package/dist/node_modules/rxjs/dist/esm5/internal/util/isInteropObservable.js +8 -0
- package/dist/node_modules/rxjs/dist/esm5/internal/util/isIterable.js +8 -0
- package/dist/node_modules/rxjs/dist/esm5/internal/util/isPromise.js +7 -0
- package/dist/node_modules/rxjs/dist/esm5/internal/util/isReadableStreamLike.js +46 -0
- package/dist/node_modules/rxjs/dist/esm5/internal/util/lift.js +22 -0
- package/dist/node_modules/rxjs/dist/esm5/internal/util/noop.js +5 -0
- package/dist/node_modules/rxjs/dist/esm5/internal/util/pipe.js +17 -0
- package/dist/node_modules/rxjs/dist/esm5/internal/util/reportUnhandledError.js +11 -0
- package/dist/node_modules/rxjs/dist/esm5/internal/util/throwUnobservableError.js +6 -0
- package/dist/node_modules/tslib/tslib.es6.js +240 -0
- package/dist/pd-panel-viewer.js +189 -0
- package/dist/pd-panel.js +51 -0
- package/dist/src/PdSpaHelper.js +319 -402
- package/dist/src/defaultpage/default-confirm-popup.js +61 -41
- package/dist/src/defaultpage/default-dialog-popup.js +74 -60
- package/dist/src/defaultpage/default-login.js +31 -20
- package/dist/src/defaultpage/default-popup.js +13 -10
- package/dist/src/defaultpage/default-step-address.js +52 -42
- package/dist/src/defaultpage/default-step-summary.js +58 -49
- package/dist/src/defaultpage/default-view-page.js +31 -23
- package/dist/src/defaultpage/default-wizard-step.js +119 -111
- package/dist/src/defaultpage/default-wizard.js +199 -195
- package/dist/src/generated/locale-wrapper/be-wrapper.js +14 -11
- package/dist/src/generated/locale-wrapper/de-wrapper.js +12 -9
- package/dist/src/generated/locale-wrapper/en-wrapper.js +14 -11
- package/dist/src/generated/locales/be.js +17 -19
- package/dist/src/generated/locales/de.js +17 -19
- package/dist/src/generated/locales/en.js +17 -19
- package/dist/src/helper/helper-utils.js +29 -24
- package/dist/src/model/spa-model.js +6 -3
- package/dist/src/popup/wizard-close-popup.js +37 -27
- package/dist/src/popup/wizard-reload-popup.js +35 -23
- package/dist/src/router/AppMain.js +23 -12
- package/dist/src/service-provider/firebase/auth.js +50 -73
- package/dist/src/service-provider/firebase/firestorage-client.js +194 -243
- package/dist/src/service-provider/firebase/firestore-client.js +19 -25
- package/dist/src/service-provider/firebase/functions-client.js +27 -59
- package/dist/src/service-provider/firebase/messagingFirebaseClient.js +60 -59
- package/dist/src/service-provider/mock/auth.js +54 -54
- package/dist/src/service-provider/mock/function-client.js +28 -27
- package/dist/src/service-provider/mock/storage-client.js +86 -92
- package/dist/src/service-provider/service-provider-impl.js +206 -211
- package/dist/src/service-provider/service-provider-model.js +1 -2
- package/dist/src/store/indexDB.js +133 -180
- package/dist/src/store/mini-rx.store.js +36 -38
- package/dist/src/store/spa-app-actions.js +27 -14
- package/dist/src/store/spa-app-effects.js +60 -40
- package/dist/src/store/spa-app-reducer.js +42 -33
- package/dist/src/store/spa-app-selector.js +31 -15
- package/dist/src/tmpown/pd-loading-state.js +49 -39
- package/dist/src/tmpown/pd-login.js +76 -67
- package/dist/src/tmpown/pd-toast.js +74 -65
- package/package.json +21 -18
- package/.editorconfig +0 -29
- package/.storybook/main.ts +0 -14
- package/.storybook/preview.ts +0 -15
- package/demo/index.html +0 -29
- package/dist/src/InitApplicationData.d.ts +0 -3
- package/dist/src/InitApplicationData.js +0 -8
- package/dist/src/InitApplicationData.js.map +0 -1
- package/dist/src/PdSpaHelper.d.ts +0 -93
- package/dist/src/PdSpaHelper.js.map +0 -1
- package/dist/src/defaultpage/default-confirm-popup.d.ts +0 -19
- package/dist/src/defaultpage/default-confirm-popup.js.map +0 -1
- package/dist/src/defaultpage/default-dialog-popup.d.ts +0 -16
- package/dist/src/defaultpage/default-dialog-popup.js.map +0 -1
- package/dist/src/defaultpage/default-login.d.ts +0 -8
- package/dist/src/defaultpage/default-login.js.map +0 -1
- package/dist/src/defaultpage/default-popup.d.ts +0 -7
- package/dist/src/defaultpage/default-popup.js.map +0 -1
- package/dist/src/defaultpage/default-step-address.d.ts +0 -19
- package/dist/src/defaultpage/default-step-address.js.map +0 -1
- package/dist/src/defaultpage/default-step-summary.d.ts +0 -30
- package/dist/src/defaultpage/default-step-summary.js.map +0 -1
- package/dist/src/defaultpage/default-view-page.d.ts +0 -9
- package/dist/src/defaultpage/default-view-page.js.map +0 -1
- package/dist/src/defaultpage/default-wizard-step.d.ts +0 -34
- package/dist/src/defaultpage/default-wizard-step.js.map +0 -1
- package/dist/src/defaultpage/default-wizard.d.ts +0 -33
- package/dist/src/defaultpage/default-wizard.js.map +0 -1
- package/dist/src/firebase/auth.d.ts +0 -4
- package/dist/src/firebase/auth.js +0 -28
- package/dist/src/firebase/auth.js.map +0 -1
- package/dist/src/firebase/firestore-client.d.ts +0 -9
- package/dist/src/firebase/firestore-client.js +0 -19
- package/dist/src/firebase/firestore-client.js.map +0 -1
- package/dist/src/firebase/functions-client.d.ts +0 -34
- package/dist/src/firebase/functions-client.js +0 -70
- package/dist/src/firebase/functions-client.js.map +0 -1
- package/dist/src/generated/locale-codes.d.ts +0 -13
- package/dist/src/generated/locale-codes.js +0 -25
- package/dist/src/generated/locale-codes.js.map +0 -1
- package/dist/src/generated/locale-wrapper/be-wrapper.d.ts +0 -1
- package/dist/src/generated/locale-wrapper/be-wrapper.js.map +0 -1
- package/dist/src/generated/locale-wrapper/de-wrapper.d.ts +0 -15
- package/dist/src/generated/locale-wrapper/de-wrapper.js.map +0 -1
- package/dist/src/generated/locale-wrapper/en-wrapper.d.ts +0 -1
- package/dist/src/generated/locale-wrapper/en-wrapper.js.map +0 -1
- package/dist/src/generated/locales/be.d.ts +0 -15
- package/dist/src/generated/locales/be.js.map +0 -1
- package/dist/src/generated/locales/de.d.ts +0 -15
- package/dist/src/generated/locales/de.js.map +0 -1
- package/dist/src/generated/locales/en.d.ts +0 -15
- package/dist/src/generated/locales/en.js.map +0 -1
- package/dist/src/helper/helper-utils.d.ts +0 -5
- package/dist/src/helper/helper-utils.js.map +0 -1
- package/dist/src/index.d.ts +0 -22
- package/dist/src/index.js +0 -33
- package/dist/src/index.js.map +0 -1
- package/dist/src/model/spa-model.d.ts +0 -16
- package/dist/src/model/spa-model.js.map +0 -1
- package/dist/src/pd-spa-helper.d.ts +0 -0
- package/dist/src/pd-spa-helper.js +0 -5
- package/dist/src/pd-spa-helper.js.map +0 -1
- package/dist/src/popup/wizard-close-popup.d.ts +0 -10
- package/dist/src/popup/wizard-close-popup.js.map +0 -1
- package/dist/src/popup/wizard-reload-popup.d.ts +0 -13
- package/dist/src/popup/wizard-reload-popup.js.map +0 -1
- package/dist/src/router/AppMain.d.ts +0 -6
- package/dist/src/router/AppMain.js.map +0 -1
- package/dist/src/service-call-controller2.d.ts +0 -16
- package/dist/src/service-call-controller2.js +0 -43
- package/dist/src/service-call-controller2.js.map +0 -1
- package/dist/src/service-provider/firebase/auth.d.ts +0 -14
- package/dist/src/service-provider/firebase/auth.js.map +0 -1
- package/dist/src/service-provider/firebase/firestorage-client.d.ts +0 -20
- package/dist/src/service-provider/firebase/firestorage-client.js.map +0 -1
- package/dist/src/service-provider/firebase/firestore-client.d.ts +0 -11
- package/dist/src/service-provider/firebase/firestore-client.js.map +0 -1
- package/dist/src/service-provider/firebase/functions-client.d.ts +0 -9
- package/dist/src/service-provider/firebase/functions-client.js.map +0 -1
- package/dist/src/service-provider/firebase/messagingFirebaseClient.d.ts +0 -8
- package/dist/src/service-provider/firebase/messagingFirebaseClient.js.map +0 -1
- package/dist/src/service-provider/mock/auth.d.ts +0 -5
- package/dist/src/service-provider/mock/auth.js.map +0 -1
- package/dist/src/service-provider/mock/function-client.d.ts +0 -8
- package/dist/src/service-provider/mock/function-client.js.map +0 -1
- package/dist/src/service-provider/mock/storage-client.d.ts +0 -10
- package/dist/src/service-provider/mock/storage-client.js.map +0 -1
- package/dist/src/service-provider/service-provider-impl.d.ts +0 -21
- package/dist/src/service-provider/service-provider-impl.js.map +0 -1
- package/dist/src/service-provider/service-provider-model.d.ts +0 -136
- package/dist/src/service-provider/service-provider-model.js.map +0 -1
- package/dist/src/store/indexDB.d.ts +0 -27
- package/dist/src/store/indexDB.js.map +0 -1
- package/dist/src/store/mini-rx.store.d.ts +0 -4
- package/dist/src/store/mini-rx.store.js.map +0 -1
- package/dist/src/store/spa-app-actions.d.ts +0 -104
- package/dist/src/store/spa-app-actions.js.map +0 -1
- package/dist/src/store/spa-app-effects.d.ts +0 -23
- package/dist/src/store/spa-app-effects.js.map +0 -1
- package/dist/src/store/spa-app-reducer.d.ts +0 -9
- package/dist/src/store/spa-app-reducer.js.map +0 -1
- package/dist/src/store/spa-app-selector.d.ts +0 -6
- package/dist/src/store/spa-app-selector.js.map +0 -1
- package/dist/src/stories/Button.d.ts +0 -27
- package/dist/src/stories/Button.js +0 -20
- package/dist/src/stories/Button.js.map +0 -1
- package/dist/src/stories/Button.stories.d.ts +0 -9
- package/dist/src/stories/Button.stories.js +0 -41
- package/dist/src/stories/Button.stories.js.map +0 -1
- package/dist/src/stories/Header.d.ts +0 -12
- package/dist/src/stories/Header.js +0 -44
- package/dist/src/stories/Header.js.map +0 -1
- package/dist/src/stories/Header.stories.d.ts +0 -7
- package/dist/src/stories/Header.stories.js +0 -17
- package/dist/src/stories/Header.stories.js.map +0 -1
- package/dist/src/stories/Page.d.ts +0 -12
- package/dist/src/stories/Page.js +0 -61
- package/dist/src/stories/Page.js.map +0 -1
- package/dist/src/stories/Page.stories.d.ts +0 -7
- package/dist/src/stories/Page.stories.js +0 -19
- package/dist/src/stories/Page.stories.js.map +0 -1
- package/dist/src/stories/pd-loading-state.stories.d.ts +0 -30
- package/dist/src/stories/pd-loading-state.stories.js +0 -153
- package/dist/src/stories/pd-loading-state.stories.js.map +0 -1
- package/dist/src/stories/pd-toast.stories.d.ts +0 -23
- package/dist/src/stories/pd-toast.stories.js +0 -34
- package/dist/src/stories/pd-toast.stories.js.map +0 -1
- package/dist/src/tmpown/pd-loading-state.d.ts +0 -9
- package/dist/src/tmpown/pd-loading-state.js.map +0 -1
- package/dist/src/tmpown/pd-login.d.ts +0 -14
- package/dist/src/tmpown/pd-login.js.map +0 -1
- package/dist/src/tmpown/pd-panel-viewer.d.ts +0 -18
- package/dist/src/tmpown/pd-panel-viewer.js +0 -188
- package/dist/src/tmpown/pd-panel-viewer.js.map +0 -1
- package/dist/src/tmpown/pd-panel.d.ts +0 -5
- package/dist/src/tmpown/pd-panel.js +0 -41
- package/dist/src/tmpown/pd-panel.js.map +0 -1
- package/dist/src/tmpown/pd-toast.d.ts +0 -12
- package/dist/src/tmpown/pd-toast.js.map +0 -1
- package/dist/stories/index.stories.d.ts +0 -33
- package/dist/stories/index.stories.js +0 -37
- package/dist/stories/index.stories.js.map +0 -1
- package/dist/test/pd-spa-helper.test.d.ts +0 -1
- package/dist/test/pd-spa-helper.test.js +0 -22
- package/dist/test/pd-spa-helper.test.js.map +0 -1
- package/dist/tsconfig.tsbuildinfo +0 -1
- package/index.d.ts +0 -15
- package/lit-localize.json +0 -15
- package/pd-spa-helper.iml +0 -9
- package/src/PdSpaHelper.ts +0 -619
- package/src/defaultpage/default-confirm-popup.ts +0 -78
- package/src/defaultpage/default-dialog-popup.ts +0 -105
- package/src/defaultpage/default-login.ts +0 -41
- package/src/defaultpage/default-popup.ts +0 -26
- package/src/defaultpage/default-step-address.ts +0 -57
- package/src/defaultpage/default-step-summary.ts +0 -88
- package/src/defaultpage/default-view-page.ts +0 -58
- package/src/defaultpage/default-wizard-step.ts +0 -142
- package/src/defaultpage/default-wizard.ts +0 -273
- package/src/generated/locale-codes.ts +0 -27
- package/src/generated/locale-wrapper/be-wrapper.ts +0 -13
- package/src/generated/locale-wrapper/de-wrapper.ts +0 -11
- package/src/generated/locale-wrapper/en-wrapper.ts +0 -13
- package/src/generated/locales/be.ts +0 -26
- package/src/generated/locales/de.ts +0 -26
- package/src/generated/locales/en.ts +0 -26
- package/src/helper/helper-utils.ts +0 -35
- package/src/index.ts +0 -66
- package/src/model/spa-model.ts +0 -20
- package/src/pd-spa-helper.ts +0 -3
- package/src/popup/wizard-close-popup.ts +0 -52
- package/src/popup/wizard-reload-popup.ts +0 -69
- package/src/router/AppMain.ts +0 -10
- package/src/service-call-controller2.ts +0 -68
- package/src/service-provider/firebase/auth.ts +0 -89
- package/src/service-provider/firebase/firestorage-client.ts +0 -327
- package/src/service-provider/firebase/firestore-client.ts +0 -40
- package/src/service-provider/firebase/functions-client.ts +0 -73
- package/src/service-provider/firebase/messagingFirebaseClient.ts +0 -102
- package/src/service-provider/mock/auth.ts +0 -86
- package/src/service-provider/mock/function-client.ts +0 -42
- package/src/service-provider/mock/storage-client.ts +0 -149
- package/src/service-provider/service-provider-impl.ts +0 -286
- package/src/service-provider/service-provider-model.ts +0 -163
- package/src/store/indexDB.ts +0 -244
- package/src/store/mini-rx.store.ts +0 -48
- package/src/store/spa-app-actions.ts +0 -36
- package/src/store/spa-app-effects.ts +0 -73
- package/src/store/spa-app-reducer.ts +0 -86
- package/src/store/spa-app-selector.ts +0 -41
- package/src/stories/pd-loading-state.stories.ts +0 -168
- package/src/stories/pd-toast.stories.ts +0 -43
- package/src/tmpown/pd-loading-state.ts +0 -177
- package/src/tmpown/pd-login.ts +0 -131
- package/src/tmpown/pd-panel-viewer.ts +0 -193
- package/src/tmpown/pd-panel.ts +0 -43
- package/src/tmpown/pd-toast.ts +0 -118
- package/test/pd-spa-helper.test.ts +0 -26
- package/tsconfig.json +0 -22
- package/web-dev-server.config.mjs +0 -27
- package/web-test-runner.config.mjs +0 -41
- package/xliff/be.xlf +0 -60
- package/xliff/de.xlf +0 -46
- package/xliff/en.xlf +0 -58
|
@@ -0,0 +1,567 @@
|
|
|
1
|
+
import { LitElement, css, html } from "lit";
|
|
2
|
+
import "../../../../../../pd-shared-styles/src/shared-color-styles.js";
|
|
3
|
+
import { PDFontStyles } from "../../../../../../pd-shared-styles/src/shared-font-styles.js";
|
|
4
|
+
import "../../pd-icon/pd-icon.js";
|
|
5
|
+
import "../../pd-forms/pd-checkbox.js";
|
|
6
|
+
import "../../pd-forms/pd-form-container.js";
|
|
7
|
+
import "../../pd-forms/pd-form-row.js";
|
|
8
|
+
import "../../pd-forms/pd-input.js";
|
|
9
|
+
import "../../pd-forms/pd-radio-group.js";
|
|
10
|
+
/**
|
|
11
|
+
* @license
|
|
12
|
+
* Copyright (c) 2021 PD Progressive Development UG. All rights reserved.
|
|
13
|
+
*/
|
|
14
|
+
const countryPrefixes = {
|
|
15
|
+
de: "+49",
|
|
16
|
+
// Deutschland
|
|
17
|
+
be: "+32",
|
|
18
|
+
// Belgien
|
|
19
|
+
nl: "+31",
|
|
20
|
+
// Niederland
|
|
21
|
+
fr: "+33",
|
|
22
|
+
// Frankreich
|
|
23
|
+
es: "+34"
|
|
24
|
+
// Spanien
|
|
25
|
+
};
|
|
26
|
+
function transformPhone(phone, country) {
|
|
27
|
+
if (!phone || typeof phone !== "string") {
|
|
28
|
+
return "";
|
|
29
|
+
}
|
|
30
|
+
const countryPrefix = countryPrefixes[country];
|
|
31
|
+
if (!countryPrefix) {
|
|
32
|
+
throw new Error(`Unbekanntes Land: ${country}`);
|
|
33
|
+
}
|
|
34
|
+
const cleanedPhone = phone.replace(/\s+/g, "").replace(/[^0-9+]/g, "");
|
|
35
|
+
if (cleanedPhone.startsWith("+")) {
|
|
36
|
+
return cleanedPhone;
|
|
37
|
+
}
|
|
38
|
+
if (cleanedPhone.startsWith("0")) {
|
|
39
|
+
return countryPrefix + cleanedPhone.slice(1);
|
|
40
|
+
}
|
|
41
|
+
return "";
|
|
42
|
+
}
|
|
43
|
+
class PdContact extends LitElement {
|
|
44
|
+
static get styles() {
|
|
45
|
+
return [
|
|
46
|
+
PDFontStyles,
|
|
47
|
+
css`
|
|
48
|
+
:host {
|
|
49
|
+
display: block;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.contact {
|
|
53
|
+
display: flex;
|
|
54
|
+
flex-direction: column;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
address {
|
|
58
|
+
color: var(--pd-contact-address-col, var(--pd-default-font-content-col));
|
|
59
|
+
line-height: 1.8;
|
|
60
|
+
font-style: normal;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
dl {
|
|
64
|
+
margin: 0;
|
|
65
|
+
padding: 0;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
dt {
|
|
69
|
+
font-weight: bold;
|
|
70
|
+
padding-top: 10px;
|
|
71
|
+
color: var(--pd-contact-address-title-col, var(--pd-default-font-title-col));
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
dd {
|
|
75
|
+
font-weight: 400;
|
|
76
|
+
font-size: 1em;
|
|
77
|
+
margin: 0;
|
|
78
|
+
padding: 0;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
dd.larger {
|
|
82
|
+
padding-top: 3px;
|
|
83
|
+
padding-bottom: 5px;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.contact-form {
|
|
87
|
+
--row-padding-top: 10px;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
.link-icon {
|
|
91
|
+
--pd-icon-bg-col-active: #859900;
|
|
92
|
+
--pd-icon-bg-col-hover: #859900;
|
|
93
|
+
--pd-icon-size: 14px;
|
|
94
|
+
--pd-icon-stroke-col-active: white;
|
|
95
|
+
--pd-icon-col-active: white;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
.link-item {
|
|
99
|
+
display: flex;
|
|
100
|
+
align-items: center;
|
|
101
|
+
text-decoration: none;
|
|
102
|
+
color: var(--pd-default-font-link-col, inherit);
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
.link-item:hover {
|
|
106
|
+
color: var(--pd-default-font-link-col-hover, #451A46) ;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
`
|
|
110
|
+
];
|
|
111
|
+
}
|
|
112
|
+
static get properties() {
|
|
113
|
+
return {
|
|
114
|
+
addressTitle: { type: String },
|
|
115
|
+
addressRef: { type: String },
|
|
116
|
+
/**
|
|
117
|
+
* show (true) or not (false) tel number as link
|
|
118
|
+
*/
|
|
119
|
+
phoneMailLink: { type: Boolean },
|
|
120
|
+
/**
|
|
121
|
+
* summary (true) or view (false) contact data
|
|
122
|
+
*/
|
|
123
|
+
summary: { type: Boolean },
|
|
124
|
+
/**
|
|
125
|
+
* List with required contact fields, if not set use default (previous existing values to be consitent during update)
|
|
126
|
+
*/
|
|
127
|
+
requiredFields: { type: Array },
|
|
128
|
+
contact: { type: Object },
|
|
129
|
+
match: { type: Object },
|
|
130
|
+
/**
|
|
131
|
+
* address type, business (true) or private (false), refactor, ist state internal? => _business, state:true
|
|
132
|
+
*/
|
|
133
|
+
_business: { type: Boolean, state: true },
|
|
134
|
+
_errorMap: { type: Object }
|
|
135
|
+
};
|
|
136
|
+
}
|
|
137
|
+
constructor() {
|
|
138
|
+
super();
|
|
139
|
+
this.addressTitle = "Adres";
|
|
140
|
+
this.requiredFields = [];
|
|
141
|
+
this.summary = false;
|
|
142
|
+
this.match = {};
|
|
143
|
+
this._business = false;
|
|
144
|
+
this._errorMap = /* @__PURE__ */ new Map();
|
|
145
|
+
}
|
|
146
|
+
update(changedProperties) {
|
|
147
|
+
if (changedProperties.has("contact") && this.contact) {
|
|
148
|
+
this._business = this.contact.business;
|
|
149
|
+
}
|
|
150
|
+
super.update(changedProperties);
|
|
151
|
+
}
|
|
152
|
+
connectedCallback() {
|
|
153
|
+
super.connectedCallback();
|
|
154
|
+
this.addEventListener("validate-form", this._validateForm);
|
|
155
|
+
}
|
|
156
|
+
disconnectedCallback() {
|
|
157
|
+
super.connectedCallback();
|
|
158
|
+
this.removeEventListener("validate-form", this._validateForm);
|
|
159
|
+
}
|
|
160
|
+
firstUpdated() {
|
|
161
|
+
var _a, _b;
|
|
162
|
+
this.addEventListener("key-pressed", (e) => {
|
|
163
|
+
this._errorMap.set(e.detail.name, "");
|
|
164
|
+
super.requestUpdate();
|
|
165
|
+
});
|
|
166
|
+
if (this.contact) {
|
|
167
|
+
const detail = {
|
|
168
|
+
errorMap: /* @__PURE__ */ new Map()
|
|
169
|
+
};
|
|
170
|
+
(_b = (_a = this.shadowRoot) == null ? void 0 : _a.getElementById("contactContainerId")) == null ? void 0 : _b.dispatchEvent(
|
|
171
|
+
new CustomEvent("validate-form", { detail })
|
|
172
|
+
);
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
render() {
|
|
176
|
+
return html`
|
|
177
|
+
<div class="contact">
|
|
178
|
+
${this.summary ? this._renderViewContact() : this._renderEditContact()}
|
|
179
|
+
</div>
|
|
180
|
+
`;
|
|
181
|
+
}
|
|
182
|
+
_renderEditContact() {
|
|
183
|
+
return html`
|
|
184
|
+
<pd-form-container id="contactContainerId" requiredFieldInfo>
|
|
185
|
+
<pd-form-row id="testFormId">
|
|
186
|
+
<pd-radio-group
|
|
187
|
+
class="quarter3"
|
|
188
|
+
label="Type"
|
|
189
|
+
required
|
|
190
|
+
value="${this._getRadioValue()}"
|
|
191
|
+
@field-change="${this._switchAddressType}"
|
|
192
|
+
style="--group-gap: 20px;"
|
|
193
|
+
>
|
|
194
|
+
<pd-checkbox value="${this.contact ? !this.contact.business : true}" valueName="private"
|
|
195
|
+
>Particulier</pd-checkbox
|
|
196
|
+
>
|
|
197
|
+
<pd-checkbox valueName="business" value="${this.contact ? this.contact.business : false}">Onderneming</pd-checkbox>
|
|
198
|
+
</pd-radio-group>
|
|
199
|
+
</pd-form-row>
|
|
200
|
+
|
|
201
|
+
${this._business ? html`
|
|
202
|
+
<pd-form-row class="contact-form">
|
|
203
|
+
<pd-input
|
|
204
|
+
id="compNameId"
|
|
205
|
+
class="quarter3"
|
|
206
|
+
label="Naam onderneming"
|
|
207
|
+
?required="${this._isRequired("companyName")}"
|
|
208
|
+
value="${this.contact ? this.contact.companyName : ""}"
|
|
209
|
+
valueName="companyName"
|
|
210
|
+
autoCompleteName="organization"
|
|
211
|
+
></pd-input>
|
|
212
|
+
</pd-form-row>
|
|
213
|
+
<pd-form-row class="contact-form">
|
|
214
|
+
<pd-input
|
|
215
|
+
id="vatId"
|
|
216
|
+
class="quarter3"
|
|
217
|
+
label="Ondernemingsnr"
|
|
218
|
+
?required="${this._isRequired("vatNr")}"
|
|
219
|
+
field-type="vat"
|
|
220
|
+
valueName="vatNr"
|
|
221
|
+
value="${this.contact ? this.contact.vatNr : ""}"
|
|
222
|
+
autoCompleteName="vat"
|
|
223
|
+
></pd-input>
|
|
224
|
+
</pd-form-row>
|
|
225
|
+
` : html`
|
|
226
|
+
<pd-form-row class="contact-form">
|
|
227
|
+
<pd-input
|
|
228
|
+
id="firstNameId"
|
|
229
|
+
class="quarter3"
|
|
230
|
+
label="Voornaam"
|
|
231
|
+
valueName="firstName"
|
|
232
|
+
value="${this.contact ? this.contact.firstName : ""}"
|
|
233
|
+
autoCompleteName="given-name"
|
|
234
|
+
?required="${this._isRequired("firstName")}"
|
|
235
|
+
></pd-input>
|
|
236
|
+
</pd-form-row>
|
|
237
|
+
<pd-form-row class="contact-form">
|
|
238
|
+
<pd-input
|
|
239
|
+
id="lastNameId"
|
|
240
|
+
class="quarter3"
|
|
241
|
+
label="Naam"
|
|
242
|
+
valueName="lastName"
|
|
243
|
+
value="${this.contact ? this.contact.lastName : ""}"
|
|
244
|
+
autoCompleteName="family-name"
|
|
245
|
+
?required="${this._isRequired("lastName")}"
|
|
246
|
+
></pd-input>
|
|
247
|
+
</pd-form-row>
|
|
248
|
+
`}
|
|
249
|
+
<pd-form-row class="contact-form">
|
|
250
|
+
<pd-input
|
|
251
|
+
id="streetId"
|
|
252
|
+
class="quarter2"
|
|
253
|
+
label="Straat"
|
|
254
|
+
valueName="street"
|
|
255
|
+
value="${this.contact ? this.contact.street : ""}"
|
|
256
|
+
autoCompleteName="street-address"
|
|
257
|
+
?required="${this._isRequired("street")}"
|
|
258
|
+
></pd-input>
|
|
259
|
+
<pd-input
|
|
260
|
+
id="streetNrId"
|
|
261
|
+
class="quarter1"
|
|
262
|
+
label="Nr"
|
|
263
|
+
valueName="streetNr"
|
|
264
|
+
value="${this.contact ? this.contact.streetNr : ""}"
|
|
265
|
+
?required="${this._isRequired("streetNr")}"
|
|
266
|
+
></pd-input>
|
|
267
|
+
</pd-form-row>
|
|
268
|
+
<pd-form-row class="contact-form">
|
|
269
|
+
${this.match && this.match.zip ? html`
|
|
270
|
+
<pd-input
|
|
271
|
+
readonly
|
|
272
|
+
id="zipId"
|
|
273
|
+
class="quarter1"
|
|
274
|
+
label="Postcode"
|
|
275
|
+
valueName="zip"
|
|
276
|
+
value="${this.match ? this.match.zip || "" : ""}"
|
|
277
|
+
></pd-input>
|
|
278
|
+
` : html`
|
|
279
|
+
<pd-input
|
|
280
|
+
id="zipId"
|
|
281
|
+
class="quarter1"
|
|
282
|
+
label="Postcode"
|
|
283
|
+
field-type="number"
|
|
284
|
+
valueName="zip"
|
|
285
|
+
value="${this.contact ? this.contact.zip : ""}"
|
|
286
|
+
autoCompleteName="postal-code"
|
|
287
|
+
?required="${this._isRequired("zip")}"
|
|
288
|
+
></pd-input>
|
|
289
|
+
`}
|
|
290
|
+
<pd-input
|
|
291
|
+
id="cityId"
|
|
292
|
+
class="quarter2"
|
|
293
|
+
label="Plaats"
|
|
294
|
+
valueName="city"
|
|
295
|
+
value="${this.contact ? this.contact.city : ""}"
|
|
296
|
+
autoCompleteName="locality"
|
|
297
|
+
?required="${this._isRequired("city")}"
|
|
298
|
+
></pd-input>
|
|
299
|
+
</pd-form-row>
|
|
300
|
+
<pd-form-row class="contact-form">
|
|
301
|
+
<pd-input
|
|
302
|
+
class="quarter3"
|
|
303
|
+
id="additionalHintId"
|
|
304
|
+
label="Extra informatie"
|
|
305
|
+
value="${this.contact ? this.contact.additionalHint : ""}"
|
|
306
|
+
></pd-input>
|
|
307
|
+
</pd-form-row>
|
|
308
|
+
<pd-form-row class="contact-form">
|
|
309
|
+
<pd-input
|
|
310
|
+
id="phoneId"
|
|
311
|
+
class="quarter3"
|
|
312
|
+
label="Telefoon"
|
|
313
|
+
name="phone"
|
|
314
|
+
valueName="phone1"
|
|
315
|
+
value="${this.contact ? this.contact.phone1 : ""}"
|
|
316
|
+
field-type="phone"
|
|
317
|
+
autoCompleteName="tel"
|
|
318
|
+
?required="${this._isRequired("phone1")}"
|
|
319
|
+
></pd-input>
|
|
320
|
+
</pd-form-row>
|
|
321
|
+
<pd-form-row class="contact-form">
|
|
322
|
+
<pd-input
|
|
323
|
+
id="mailId"
|
|
324
|
+
class="quarter3"
|
|
325
|
+
label="E-mail"
|
|
326
|
+
field-type="mail"
|
|
327
|
+
valueName="email"
|
|
328
|
+
value="${this.contact ? this.contact.email : ""}"
|
|
329
|
+
autoCompleteName="email"
|
|
330
|
+
?required="${this._isRequired("email")}"
|
|
331
|
+
></pd-input>
|
|
332
|
+
</pd-form-row>
|
|
333
|
+
</pd-form-container>
|
|
334
|
+
`;
|
|
335
|
+
}
|
|
336
|
+
_getRadioValue() {
|
|
337
|
+
if (this.contact) {
|
|
338
|
+
return this.contact.business ? "business" : "private";
|
|
339
|
+
}
|
|
340
|
+
return "private";
|
|
341
|
+
}
|
|
342
|
+
_renderViewContact() {
|
|
343
|
+
if (!this.contact) {
|
|
344
|
+
return html`<p>Contact undefined</p>`;
|
|
345
|
+
}
|
|
346
|
+
const trPhoneNr = transformPhone(this.contact.phone1, this.contact.country || "be");
|
|
347
|
+
return html`
|
|
348
|
+
<address>
|
|
349
|
+
<dl>
|
|
350
|
+
<dt>${this.addressTitle}</dt>
|
|
351
|
+
${this.contact ? html`
|
|
352
|
+
<dd>${this.contact.companyName}</dd>
|
|
353
|
+
<dd>${this.contact.vatNr}</dd>
|
|
354
|
+
<dd>${this._getFullName()}</dd>
|
|
355
|
+
<dd>${this._getFullStreet()}</dd>
|
|
356
|
+
<dd>${this._getFullLocation()}</dd>
|
|
357
|
+
${this.contact.additionalHint ? html`<dd>${this.contact.additionalHint}</dd>` : ""}
|
|
358
|
+
<dd>${this.contact.country}</dd>
|
|
359
|
+
|
|
360
|
+
${this.contact.phone1 ? html`
|
|
361
|
+
<dd class="larger">${this.phoneMailLink && trPhoneNr ? html`
|
|
362
|
+
<a href="${`tel:${trPhoneNr}`}"
|
|
363
|
+
aria-label="${`Phone call: ${this.contact.phone1}`}"
|
|
364
|
+
class="link-item">
|
|
365
|
+
<span style="margin-right: 8px;">${this.contact.phone1}</span>
|
|
366
|
+
<pd-icon activeIcon icon="phoneIcon" class="round link-icon"></pd-icon>
|
|
367
|
+
</a>
|
|
368
|
+
` : this.contact.phone1}</dd>
|
|
369
|
+
` : ""}
|
|
370
|
+
|
|
371
|
+
${this.contact.email ? html`
|
|
372
|
+
<dd class="larger">${this.phoneMailLink ? html`
|
|
373
|
+
<a href="${`mailto:${this.contact.email}`}"
|
|
374
|
+
aria-label="${`Send mail: ${this.contact.email}`}"
|
|
375
|
+
class="link-item">
|
|
376
|
+
<span style="margin-right: 8px;">${this.contact.email}</span>
|
|
377
|
+
<pd-icon activeIcon icon="mailIcon" class="round link-icon"></pd-icon>
|
|
378
|
+
</a>
|
|
379
|
+
` : this.contact.email}</dd>
|
|
380
|
+
` : ""}
|
|
381
|
+
|
|
382
|
+
${this.contact.btw ? html`<dt>BTW</dt>
|
|
383
|
+
<dd>${this.contact.btw}</dd>` : ""}
|
|
384
|
+
${this.contact.kbc ? html`<dt>Bankgegevens</dt>
|
|
385
|
+
<dd>${this.contact.kbc}</dd>
|
|
386
|
+
<dd>${this.contact.bank}</dd>` : ""}
|
|
387
|
+
` : html`${this.addressRef || "--"}`}
|
|
388
|
+
</dl>
|
|
389
|
+
</address>
|
|
390
|
+
`;
|
|
391
|
+
}
|
|
392
|
+
_switchAddressType(e) {
|
|
393
|
+
this._business = e.detail.name === "business";
|
|
394
|
+
}
|
|
395
|
+
_isRequired(field) {
|
|
396
|
+
return this.requiredFields && this.requiredFields.length > 0 ? this.requiredFields.includes(field) : false;
|
|
397
|
+
}
|
|
398
|
+
/*
|
|
399
|
+
validateInput() {
|
|
400
|
+
const matchForValidate = this.match || {};
|
|
401
|
+
|
|
402
|
+
const companyName = this.business
|
|
403
|
+
? this.shadowRoot.getElementById('compNameId').value
|
|
404
|
+
: undefined;
|
|
405
|
+
const vatNr = this.business
|
|
406
|
+
? this.shadowRoot.getElementById('vatId').value
|
|
407
|
+
: undefined;
|
|
408
|
+
const firstName = this.business
|
|
409
|
+
? undefined
|
|
410
|
+
: this.shadowRoot.getElementById('firstNameId').value;
|
|
411
|
+
const lastName = this.business
|
|
412
|
+
? undefined
|
|
413
|
+
: this.shadowRoot.getElementById('lastNameId').value;
|
|
414
|
+
const street = this.shadowRoot.getElementById('streetId').value;
|
|
415
|
+
const streetNr = this.shadowRoot.getElementById('streetNrId').value;
|
|
416
|
+
const additionalHint =
|
|
417
|
+
this.shadowRoot.getElementById('additionalHintId').value;
|
|
418
|
+
const zip = this.shadowRoot.getElementById('zipId').value;
|
|
419
|
+
const city = this.shadowRoot.getElementById('cityId').value;
|
|
420
|
+
const phone1 = this.shadowRoot.getElementById('phoneId').value;
|
|
421
|
+
const email = this.shadowRoot.getElementById('mailId').value;
|
|
422
|
+
|
|
423
|
+
const newErrorMap = new Map();
|
|
424
|
+
|
|
425
|
+
const reqFieldFunc = (field, key, type, mustMatch) => {
|
|
426
|
+
if (!field || field === '') {
|
|
427
|
+
newErrorMap.set(
|
|
428
|
+
key,
|
|
429
|
+
type !== 'phone'
|
|
430
|
+
? 'Vul dit veld in.'
|
|
431
|
+
: 'Vul dit veld in. Gebruik +32 494 667085.'
|
|
432
|
+
);
|
|
433
|
+
} else if (mustMatch && field !== mustMatch) {
|
|
434
|
+
newErrorMap.set(key, `Not match ${mustMatch}`);
|
|
435
|
+
} else {
|
|
436
|
+
switch (type) {
|
|
437
|
+
case 'vat':
|
|
438
|
+
// eslint-disable-next-line no-restricted-globals
|
|
439
|
+
if (!newErrorMap.has(key) && !PdContact._vatIsValid(field)) {
|
|
440
|
+
newErrorMap.set(key, 'Formaat BE0123456789 vereist');
|
|
441
|
+
}
|
|
442
|
+
break;
|
|
443
|
+
case 'number':
|
|
444
|
+
// eslint-disable-next-line no-restricted-globals
|
|
445
|
+
if (!newErrorMap.has(key) && isNaN(field)) {
|
|
446
|
+
newErrorMap.set(key, 'Alleen nummers toegestaan');
|
|
447
|
+
}
|
|
448
|
+
break;
|
|
449
|
+
case 'mail':
|
|
450
|
+
if (!newErrorMap.has(key) && !PdContact._mailIsValid(field)) {
|
|
451
|
+
newErrorMap.set(key, 'Ongeldig e-mailadres');
|
|
452
|
+
}
|
|
453
|
+
break;
|
|
454
|
+
case 'phone':
|
|
455
|
+
if (!newErrorMap.has(key) && !PdContact._phoneIsValid(field)) {
|
|
456
|
+
newErrorMap.set(
|
|
457
|
+
key,
|
|
458
|
+
'Ongeldig telefoonnummer, gebruik +32 494 667085.'
|
|
459
|
+
);
|
|
460
|
+
}
|
|
461
|
+
break;
|
|
462
|
+
default:
|
|
463
|
+
console.warn('Undefined field: ', type);
|
|
464
|
+
}
|
|
465
|
+
}
|
|
466
|
+
};
|
|
467
|
+
|
|
468
|
+
if (this.business) {
|
|
469
|
+
reqFieldFunc(companyName, 'companyName');
|
|
470
|
+
reqFieldFunc(vatNr, 'vatNr', 'vat');
|
|
471
|
+
} else {
|
|
472
|
+
reqFieldFunc(firstName, 'firstName');
|
|
473
|
+
reqFieldFunc(lastName, 'lastName');
|
|
474
|
+
}
|
|
475
|
+
reqFieldFunc(street, 'street');
|
|
476
|
+
reqFieldFunc(streetNr, 'streetNr');
|
|
477
|
+
reqFieldFunc(zip, 'zip', 'number', matchForValidate.zip);
|
|
478
|
+
reqFieldFunc(city, 'city');
|
|
479
|
+
reqFieldFunc(phone1, 'phone1', 'phone');
|
|
480
|
+
reqFieldFunc(email, 'email', 'mail');
|
|
481
|
+
this._errorMap = newErrorMap;
|
|
482
|
+
|
|
483
|
+
return new Promise((resolve, reject) => {
|
|
484
|
+
if (newErrorMap.size > 0) {
|
|
485
|
+
reject();
|
|
486
|
+
} else {
|
|
487
|
+
this.contact = {
|
|
488
|
+
business: this.business,
|
|
489
|
+
companyName,
|
|
490
|
+
vatNr,
|
|
491
|
+
firstName,
|
|
492
|
+
lastName,
|
|
493
|
+
street,
|
|
494
|
+
streetNr,
|
|
495
|
+
additionalHint,
|
|
496
|
+
zip,
|
|
497
|
+
city,
|
|
498
|
+
phone1,
|
|
499
|
+
email,
|
|
500
|
+
};
|
|
501
|
+
resolve(this.contact);
|
|
502
|
+
}
|
|
503
|
+
});
|
|
504
|
+
}
|
|
505
|
+
*/
|
|
506
|
+
_validateForm(e) {
|
|
507
|
+
if (e.detail && !e.detail.singleElement) {
|
|
508
|
+
this.shadowRoot.getElementById("contactContainerId").dispatchEvent(
|
|
509
|
+
new CustomEvent("validate-form", {
|
|
510
|
+
detail: e.detail
|
|
511
|
+
})
|
|
512
|
+
);
|
|
513
|
+
if (e.detail.errorMap.size === 0 && e.detail.formData) {
|
|
514
|
+
e.detail.formData[this.id] = this._setFormData();
|
|
515
|
+
}
|
|
516
|
+
}
|
|
517
|
+
}
|
|
518
|
+
_setFormData() {
|
|
519
|
+
const companyName = this._business ? this.shadowRoot.getElementById("compNameId").value : void 0;
|
|
520
|
+
const vatNr = this._business ? this.shadowRoot.getElementById("vatId").value : void 0;
|
|
521
|
+
const firstName = this._business ? void 0 : this.shadowRoot.getElementById("firstNameId").value;
|
|
522
|
+
const lastName = this._business ? void 0 : this.shadowRoot.getElementById("lastNameId").value;
|
|
523
|
+
const street = this.shadowRoot.getElementById("streetId").value;
|
|
524
|
+
const streetNr = this.shadowRoot.getElementById("streetNrId").value;
|
|
525
|
+
const additionalHint = this.shadowRoot.getElementById("additionalHintId").value;
|
|
526
|
+
const zip = this.shadowRoot.getElementById("zipId").value;
|
|
527
|
+
const city = this.shadowRoot.getElementById("cityId").value;
|
|
528
|
+
const phone1 = this.shadowRoot.getElementById("phoneId").value;
|
|
529
|
+
const email = this.shadowRoot.getElementById("mailId").value;
|
|
530
|
+
return {
|
|
531
|
+
business: this._business,
|
|
532
|
+
companyName,
|
|
533
|
+
vatNr,
|
|
534
|
+
firstName,
|
|
535
|
+
lastName,
|
|
536
|
+
street,
|
|
537
|
+
streetNr,
|
|
538
|
+
additionalHint,
|
|
539
|
+
zip,
|
|
540
|
+
city,
|
|
541
|
+
phone1,
|
|
542
|
+
email
|
|
543
|
+
};
|
|
544
|
+
}
|
|
545
|
+
_getFullName() {
|
|
546
|
+
return PdContact._getFullVal(this.contact.firstName, this.contact.lastName);
|
|
547
|
+
}
|
|
548
|
+
_getFullStreet() {
|
|
549
|
+
return PdContact._getFullVal(this.contact.street, this.contact.streetNr);
|
|
550
|
+
}
|
|
551
|
+
_getFullLocation() {
|
|
552
|
+
return PdContact._getFullVal(this.contact.zip, this.contact.city);
|
|
553
|
+
}
|
|
554
|
+
static _getFullVal(val1, val2, elseStr) {
|
|
555
|
+
let fullVal = "";
|
|
556
|
+
if (val1) {
|
|
557
|
+
fullVal += val1;
|
|
558
|
+
}
|
|
559
|
+
if (val2) {
|
|
560
|
+
fullVal += ` ${val2}`;
|
|
561
|
+
}
|
|
562
|
+
return fullVal.length === 0 ? elseStr : fullVal;
|
|
563
|
+
}
|
|
564
|
+
}
|
|
565
|
+
export {
|
|
566
|
+
PdContact
|
|
567
|
+
};
|