@mrfylke/contact-form 0.1.3
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/lib/ContactFormRoot.d.ts +37 -0
- package/lib/ContactFormRoot.d.ts.map +1 -0
- package/lib/ContactFormRoot.js +53 -0
- package/lib/commoneEvents.d.ts +16 -0
- package/lib/commoneEvents.d.ts.map +1 -0
- package/lib/commoneEvents.js +4 -0
- package/lib/components/button/button.d.ts +17 -0
- package/lib/components/button/button.d.ts.map +1 -0
- package/lib/components/button/button.js +15 -0
- package/lib/components/button/button.module.css +399 -0
- package/lib/components/button/index.d.ts +5 -0
- package/lib/components/button/index.d.ts.map +1 -0
- package/lib/components/button/index.js +10 -0
- package/lib/components/button/link.d.ts +27 -0
- package/lib/components/button/link.d.ts.map +1 -0
- package/lib/components/button/link.js +19 -0
- package/lib/components/button/utils.d.ts +69 -0
- package/lib/components/button/utils.d.ts.map +1 -0
- package/lib/components/button/utils.js +33 -0
- package/lib/components/checkbox/checkbox.d.ts +13 -0
- package/lib/components/checkbox/checkbox.d.ts.map +1 -0
- package/lib/components/checkbox/checkbox.js +23 -0
- package/lib/components/checkbox/checkbox.module.css +96 -0
- package/lib/components/checkbox/index.d.ts +3 -0
- package/lib/components/checkbox/index.d.ts.map +1 -0
- package/lib/components/checkbox/index.js +8 -0
- package/lib/components/error-message/error-message.d.ts +6 -0
- package/lib/components/error-message/error-message.d.ts.map +1 -0
- package/lib/components/error-message/error-message.js +13 -0
- package/lib/components/error-message/error-message.module.css +6 -0
- package/lib/components/error-message/index.d.ts +3 -0
- package/lib/components/error-message/index.d.ts.map +1 -0
- package/lib/components/error-message/index.js +8 -0
- package/lib/components/external-link-page.d.ts +14 -0
- package/lib/components/external-link-page.d.ts.map +1 -0
- package/lib/components/external-link-page.js +27 -0
- package/lib/components/external-link-page.module.css +29 -0
- package/lib/components/form/date-selector.d.ts +11 -0
- package/lib/components/form/date-selector.d.ts.map +1 -0
- package/lib/components/form/date-selector.js +21 -0
- package/lib/components/form/description-modal.d.ts +13 -0
- package/lib/components/form/description-modal.d.ts.map +1 -0
- package/lib/components/form/description-modal.js +43 -0
- package/lib/components/form/field-wrapper-with-error/index.d.ts +8 -0
- package/lib/components/form/field-wrapper-with-error/index.d.ts.map +1 -0
- package/lib/components/form/field-wrapper-with-error/index.js +12 -0
- package/lib/components/form/fieldset/fieldset.module.css +26 -0
- package/lib/components/form/fieldset/index.d.ts +8 -0
- package/lib/components/form/fieldset/index.d.ts.map +1 -0
- package/lib/components/form/fieldset/index.js +17 -0
- package/lib/components/form/file-input.d.ts +10 -0
- package/lib/components/form/file-input.d.ts.map +1 -0
- package/lib/components/form/file-input.js +68 -0
- package/lib/components/form/form-component-label/form-component-label.module.css +10 -0
- package/lib/components/form/form-component-label/index.d.ts +9 -0
- package/lib/components/form/form-component-label/index.d.ts.map +1 -0
- package/lib/components/form/form-component-label/index.js +18 -0
- package/lib/components/form/form.module.css +573 -0
- package/lib/components/form/index.d.ts +11 -0
- package/lib/components/form/index.d.ts.map +1 -0
- package/lib/components/form/index.js +28 -0
- package/lib/components/form/input.d.ts +17 -0
- package/lib/components/form/input.d.ts.map +1 -0
- package/lib/components/form/input.js +42 -0
- package/lib/components/form/radio.d.ts +7 -0
- package/lib/components/form/radio.d.ts.map +1 -0
- package/lib/components/form/radio.js +14 -0
- package/lib/components/form/searchable-select/index.d.ts +3 -0
- package/lib/components/form/searchable-select/index.d.ts.map +1 -0
- package/lib/components/form/searchable-select/index.js +11 -0
- package/lib/components/form/searchable-select/searchable-select.d.ts +18 -0
- package/lib/components/form/searchable-select/searchable-select.d.ts.map +1 -0
- package/lib/components/form/searchable-select/searchable-select.js +55 -0
- package/lib/components/form/searchable-select/utils.d.ts +5 -0
- package/lib/components/form/searchable-select/utils.d.ts.map +1 -0
- package/lib/components/form/searchable-select/utils.js +19 -0
- package/lib/components/form/select.d.ts +15 -0
- package/lib/components/form/select.d.ts.map +1 -0
- package/lib/components/form/select.js +22 -0
- package/lib/components/form/textarea.d.ts +11 -0
- package/lib/components/form/textarea.d.ts.map +1 -0
- package/lib/components/form/textarea.js +17 -0
- package/lib/components/form/time-selector.d.ts +11 -0
- package/lib/components/form/time-selector.d.ts.map +1 -0
- package/lib/components/form/time-selector.js +22 -0
- package/lib/components/icon/checkbox-icon.d.ts +14 -0
- package/lib/components/icon/checkbox-icon.d.ts.map +1 -0
- package/lib/components/icon/checkbox-icon.js +18 -0
- package/lib/components/icon/color-icon.d.ts +17 -0
- package/lib/components/icon/color-icon.d.ts.map +1 -0
- package/lib/components/icon/color-icon.js +27 -0
- package/lib/components/icon/generated-icons.d.ts +1797 -0
- package/lib/components/icon/generated-icons.d.ts.map +1 -0
- package/lib/components/icon/generated-icons.js +1782 -0
- package/lib/components/icon/icon-wrapper.d.ts +30 -0
- package/lib/components/icon/icon-wrapper.d.ts.map +1 -0
- package/lib/components/icon/icon-wrapper.js +39 -0
- package/lib/components/icon/illustration.d.ts +7 -0
- package/lib/components/icon/illustration.d.ts.map +1 -0
- package/lib/components/icon/illustration.js +25 -0
- package/lib/components/icon/image.d.ts +7 -0
- package/lib/components/icon/image.d.ts.map +1 -0
- package/lib/components/icon/image.js +26 -0
- package/lib/components/icon/index.d.ts +6 -0
- package/lib/components/icon/index.d.ts.map +1 -0
- package/lib/components/icon/index.js +20 -0
- package/lib/components/icon/mono-icon-new.d.ts +32 -0
- package/lib/components/icon/mono-icon-new.d.ts.map +1 -0
- package/lib/components/icon/mono-icon-new.js +43 -0
- package/lib/components/icon/mono-icon.d.ts +29 -0
- package/lib/components/icon/mono-icon.d.ts.map +1 -0
- package/lib/components/icon/mono-icon.js +39 -0
- package/lib/components/icon/utils.d.ts +3 -0
- package/lib/components/icon/utils.d.ts.map +1 -0
- package/lib/components/icon/utils.js +12 -0
- package/lib/components/index.d.ts +3 -0
- package/lib/components/index.d.ts.map +1 -0
- package/lib/components/index.js +18 -0
- package/lib/components/loading/index.d.ts +15 -0
- package/lib/components/loading/index.d.ts.map +1 -0
- package/lib/components/loading/index.js +19 -0
- package/lib/components/loading/loading.module.css +17 -0
- package/lib/components/section-card/index.d.ts +2 -0
- package/lib/components/section-card/index.d.ts.map +1 -0
- package/lib/components/section-card/index.js +8 -0
- package/lib/components/section-card/section-card.d.ts +7 -0
- package/lib/components/section-card/section-card.d.ts.map +1 -0
- package/lib/components/section-card/section-card.js +14 -0
- package/lib/components/section-card/section-card.module.css +15 -0
- package/lib/components/typography/index.d.ts +19 -0
- package/lib/components/typography/index.d.ts.map +1 -0
- package/lib/components/typography/index.js +27 -0
- package/lib/components/typography/utils.d.ts +2 -0
- package/lib/components/typography/utils.d.ts.map +1 -0
- package/lib/components/typography/utils.js +4 -0
- package/lib/contact.module.css +76 -0
- package/lib/error-content/error-content.d.ts +2 -0
- package/lib/error-content/error-content.d.ts.map +1 -0
- package/lib/error-content/error-content.js +19 -0
- package/lib/error-content/error-content.module.css +11 -0
- package/lib/group-travel/index.d.ts +2 -0
- package/lib/group-travel/index.d.ts.map +1 -0
- package/lib/group-travel/index.js +15 -0
- package/lib/index.d.ts +25 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +73 -0
- package/lib/journey-info/events.d.ts +14 -0
- package/lib/journey-info/events.d.ts.map +1 -0
- package/lib/journey-info/events.js +5 -0
- package/lib/journey-info/index.d.ts +2 -0
- package/lib/journey-info/index.d.ts.map +1 -0
- package/lib/journey-info/index.js +66 -0
- package/lib/journey-info/journeyInfoStateMachine.d.ts +179 -0
- package/lib/journey-info/journeyInfoStateMachine.d.ts.map +1 -0
- package/lib/journey-info/journeyInfoStateMachine.js +160 -0
- package/lib/layouts/contact-form-container.d.ts +10 -0
- package/lib/layouts/contact-form-container.d.ts.map +1 -0
- package/lib/layouts/contact-form-container.js +12 -0
- package/lib/layouts/contact-form-footer.d.ts +5 -0
- package/lib/layouts/contact-form-footer.d.ts.map +1 -0
- package/lib/layouts/contact-form-footer.js +59 -0
- package/lib/layouts/contact-form-header.d.ts +9 -0
- package/lib/layouts/contact-form-header.d.ts.map +1 -0
- package/lib/layouts/contact-form-header.js +45 -0
- package/lib/layouts/contact-page-layout.d.ts +24 -0
- package/lib/layouts/contact-page-layout.d.ts.map +1 -0
- package/lib/layouts/contact-page-layout.js +104 -0
- package/lib/layouts/container.module.css +15 -0
- package/lib/layouts/footer.module.css +109 -0
- package/lib/layouts/header.module.css +39 -0
- package/lib/layouts/index.d.ts +3 -0
- package/lib/layouts/index.d.ts.map +1 -0
- package/lib/layouts/index.js +11 -0
- package/lib/layouts/layout.module.css +80 -0
- package/lib/lines/use-lines.d.ts +25 -0
- package/lib/lines/use-lines.d.ts.map +1 -0
- package/lib/lines/use-lines.js +77 -0
- package/lib/lost-property/index.d.ts +2 -0
- package/lib/lost-property/index.d.ts.map +1 -0
- package/lib/lost-property/index.js +11 -0
- package/lib/means-of-transport/events.d.ts +17 -0
- package/lib/means-of-transport/events.d.ts.map +1 -0
- package/lib/means-of-transport/events.js +5 -0
- package/lib/means-of-transport/forms/delayForm.d.ts +11 -0
- package/lib/means-of-transport/forms/delayForm.d.ts.map +1 -0
- package/lib/means-of-transport/forms/delayForm.js +88 -0
- package/lib/means-of-transport/forms/driverForm.d.ts +11 -0
- package/lib/means-of-transport/forms/driverForm.d.ts.map +1 -0
- package/lib/means-of-transport/forms/driverForm.js +88 -0
- package/lib/means-of-transport/forms/index.d.ts +7 -0
- package/lib/means-of-transport/forms/index.d.ts.map +1 -0
- package/lib/means-of-transport/forms/index.js +18 -0
- package/lib/means-of-transport/forms/injuryForm.d.ts +11 -0
- package/lib/means-of-transport/forms/injuryForm.d.ts.map +1 -0
- package/lib/means-of-transport/forms/injuryForm.js +88 -0
- package/lib/means-of-transport/forms/serviceOfferingForm.d.ts +11 -0
- package/lib/means-of-transport/forms/serviceOfferingForm.d.ts.map +1 -0
- package/lib/means-of-transport/forms/serviceOfferingForm.js +64 -0
- package/lib/means-of-transport/forms/stopForm.d.ts +11 -0
- package/lib/means-of-transport/forms/stopForm.d.ts.map +1 -0
- package/lib/means-of-transport/forms/stopForm.js +76 -0
- package/lib/means-of-transport/forms/transportationForm.d.ts +11 -0
- package/lib/means-of-transport/forms/transportationForm.d.ts.map +1 -0
- package/lib/means-of-transport/forms/transportationForm.js +88 -0
- package/lib/means-of-transport/index.d.ts +3 -0
- package/lib/means-of-transport/index.d.ts.map +1 -0
- package/lib/means-of-transport/index.js +47 -0
- package/lib/means-of-transport/means-of-transport-form-machine.d.ts +291 -0
- package/lib/means-of-transport/means-of-transport-form-machine.d.ts.map +1 -0
- package/lib/means-of-transport/means-of-transport-form-machine.js +287 -0
- package/lib/modules/api-browser/index.d.ts +8 -0
- package/lib/modules/api-browser/index.d.ts.map +1 -0
- package/lib/modules/api-browser/index.js +54 -0
- package/lib/modules/api-server/external-client.d.ts +22 -0
- package/lib/modules/api-server/external-client.d.ts.map +1 -0
- package/lib/modules/api-server/external-client.js +86 -0
- package/lib/modules/api-server/index.d.ts +9 -0
- package/lib/modules/api-server/index.d.ts.map +1 -0
- package/lib/modules/api-server/index.js +24 -0
- package/lib/modules/api-server/requesters/graphql-requester.d.ts +6 -0
- package/lib/modules/api-server/requesters/graphql-requester.d.ts.map +1 -0
- package/lib/modules/api-server/requesters/graphql-requester.js +63 -0
- package/lib/modules/api-server/requesters/http-requester.d.ts +3 -0
- package/lib/modules/api-server/requesters/http-requester.d.ts.map +1 -0
- package/lib/modules/api-server/requesters/http-requester.js +110 -0
- package/lib/modules/api-server/requesters/types.d.ts +37 -0
- package/lib/modules/api-server/requesters/types.d.ts.map +1 -0
- package/lib/modules/api-server/requesters/types.js +34 -0
- package/lib/modules/api-server/requesters/utils.d.ts +17 -0
- package/lib/modules/api-server/requesters/utils.d.ts.map +1 -0
- package/lib/modules/api-server/requesters/utils.js +75 -0
- package/lib/modules/config/context.d.ts +54 -0
- package/lib/modules/config/context.d.ts.map +1 -0
- package/lib/modules/config/context.js +112 -0
- package/lib/modules/config/index.d.ts +4 -0
- package/lib/modules/config/index.d.ts.map +1 -0
- package/lib/modules/config/index.js +19 -0
- package/lib/modules/config/theme-adapter.d.ts +20 -0
- package/lib/modules/config/theme-adapter.d.ts.map +1 -0
- package/lib/modules/config/theme-adapter.js +56 -0
- package/lib/modules/config/types.d.ts +348 -0
- package/lib/modules/config/types.d.ts.map +1 -0
- package/lib/modules/config/types.js +6 -0
- package/lib/modules/cookies/constants.d.ts +4 -0
- package/lib/modules/cookies/constants.d.ts.map +1 -0
- package/lib/modules/cookies/constants.js +6 -0
- package/lib/modules/cookies/cookies-context.d.ts +17 -0
- package/lib/modules/cookies/cookies-context.d.ts.map +1 -0
- package/lib/modules/cookies/cookies-context.js +61 -0
- package/lib/modules/cookies/index.d.ts +15 -0
- package/lib/modules/cookies/index.d.ts.map +1 -0
- package/lib/modules/cookies/index.js +22 -0
- package/lib/modules/firebase/analytics.d.ts +3 -0
- package/lib/modules/firebase/analytics.d.ts.map +1 -0
- package/lib/modules/firebase/analytics.js +40 -0
- package/lib/modules/firebase/firebase.d.ts +4 -0
- package/lib/modules/firebase/firebase.d.ts.map +1 -0
- package/lib/modules/firebase/firebase.js +19 -0
- package/lib/modules/firebase/index.d.ts +5 -0
- package/lib/modules/firebase/index.d.ts.map +1 -0
- package/lib/modules/firebase/index.js +25 -0
- package/lib/modules/firebase/preassigned-fare-products.d.ts +8 -0
- package/lib/modules/firebase/preassigned-fare-products.d.ts.map +1 -0
- package/lib/modules/firebase/preassigned-fare-products.js +35 -0
- package/lib/modules/firebase/tariff-zones.d.ts +17 -0
- package/lib/modules/firebase/tariff-zones.d.ts.map +1 -0
- package/lib/modules/firebase/tariff-zones.js +32 -0
- package/lib/modules/firebase/transport-mode-filter.d.ts +27 -0
- package/lib/modules/firebase/transport-mode-filter.d.ts.map +1 -0
- package/lib/modules/firebase/transport-mode-filter.js +27 -0
- package/lib/modules/firebase/types.d.ts +19 -0
- package/lib/modules/firebase/types.d.ts.map +1 -0
- package/lib/modules/firebase/types.js +15 -0
- package/lib/modules/graphql-types/index.d.ts +1998 -0
- package/lib/modules/graphql-types/index.d.ts.map +1 -0
- package/lib/modules/graphql-types/index.js +442 -0
- package/lib/modules/graphql-types/journeyplanner-types_v3.generated.d.ts +2419 -0
- package/lib/modules/graphql-types/journeyplanner-types_v3.generated.d.ts.map +1 -0
- package/lib/modules/graphql-types/journeyplanner-types_v3.generated.js +524 -0
- package/lib/modules/logging/index.d.ts +6 -0
- package/lib/modules/logging/index.d.ts.map +1 -0
- package/lib/modules/logging/index.js +13 -0
- package/lib/modules/logging/log-api-response.d.ts +15 -0
- package/lib/modules/logging/log-api-response.d.ts.map +1 -0
- package/lib/modules/logging/log-api-response.js +52 -0
- package/lib/modules/logging/log-page-access.d.ts +20 -0
- package/lib/modules/logging/log-page-access.d.ts.map +1 -0
- package/lib/modules/logging/log-page-access.js +60 -0
- package/lib/modules/logging/logger.d.ts +3 -0
- package/lib/modules/logging/logger.d.ts.map +1 -0
- package/lib/modules/logging/logger.js +32 -0
- package/lib/modules/logging/timer.d.ts +6 -0
- package/lib/modules/logging/timer.d.ts.map +1 -0
- package/lib/modules/logging/timer.js +13 -0
- package/lib/modules/logging/with-access-logging.d.ts +5 -0
- package/lib/modules/logging/with-access-logging.d.ts.map +1 -0
- package/lib/modules/logging/with-access-logging.js +20 -0
- package/lib/modules/org-data/compat-layer.d.ts +8 -0
- package/lib/modules/org-data/compat-layer.d.ts.map +1 -0
- package/lib/modules/org-data/compat-layer.js +8 -0
- package/lib/modules/org-data/index.d.ts +12 -0
- package/lib/modules/org-data/index.d.ts.map +1 -0
- package/lib/modules/org-data/index.js +27 -0
- package/lib/modules/theme/index.d.ts +3 -0
- package/lib/modules/theme/index.d.ts.map +1 -0
- package/lib/modules/theme/index.js +9 -0
- package/lib/modules/theme/theme-context.d.ts +43 -0
- package/lib/modules/theme/theme-context.d.ts.map +1 -0
- package/lib/modules/theme/theme-context.js +73 -0
- package/lib/modules/transport-mode/filter/filter.d.ts +9 -0
- package/lib/modules/transport-mode/filter/filter.d.ts.map +1 -0
- package/lib/modules/transport-mode/filter/filter.js +64 -0
- package/lib/modules/transport-mode/filter/filter.module.css +98 -0
- package/lib/modules/transport-mode/filter/index.d.ts +3 -0
- package/lib/modules/transport-mode/filter/index.d.ts.map +1 -0
- package/lib/modules/transport-mode/filter/index.js +11 -0
- package/lib/modules/transport-mode/filter/types.d.ts +2 -0
- package/lib/modules/transport-mode/filter/types.d.ts.map +1 -0
- package/lib/modules/transport-mode/filter/types.js +2 -0
- package/lib/modules/transport-mode/filter/utils.d.ts +9 -0
- package/lib/modules/transport-mode/filter/utils.d.ts.map +1 -0
- package/lib/modules/transport-mode/filter/utils.js +21 -0
- package/lib/modules/transport-mode/icon/icon.module.css +33 -0
- package/lib/modules/transport-mode/icon/index.d.ts +29 -0
- package/lib/modules/transport-mode/icon/index.d.ts.map +1 -0
- package/lib/modules/transport-mode/icon/index.js +116 -0
- package/lib/modules/transport-mode/icon/transport-icon-new.d.ts +28 -0
- package/lib/modules/transport-mode/icon/transport-icon-new.d.ts.map +1 -0
- package/lib/modules/transport-mode/icon/transport-icon-new.js +114 -0
- package/lib/modules/transport-mode/index.d.ts +5 -0
- package/lib/modules/transport-mode/index.d.ts.map +1 -0
- package/lib/modules/transport-mode/index.js +29 -0
- package/lib/modules/transport-mode/types.d.ts +10 -0
- package/lib/modules/transport-mode/types.d.ts.map +1 -0
- package/lib/modules/transport-mode/types.js +141 -0
- package/lib/modules/transport-mode/utils.d.ts +9 -0
- package/lib/modules/transport-mode/utils.d.ts.map +1 -0
- package/lib/modules/transport-mode/utils.js +53 -0
- package/lib/refund/events.d.ts +32 -0
- package/lib/refund/events.d.ts.map +1 -0
- package/lib/refund/events.js +5 -0
- package/lib/refund/forms/refund-and-travel-guarantee/index.d.ts +10 -0
- package/lib/refund/forms/refund-and-travel-guarantee/index.d.ts.map +1 -0
- package/lib/refund/forms/refund-and-travel-guarantee/index.js +37 -0
- package/lib/refund/forms/refund-and-travel-guarantee/refundCarForm.d.ts +11 -0
- package/lib/refund/forms/refund-and-travel-guarantee/refundCarForm.d.ts.map +1 -0
- package/lib/refund/forms/refund-and-travel-guarantee/refundCarForm.js +133 -0
- package/lib/refund/forms/refund-and-travel-guarantee/refundTaxiForm.d.ts +11 -0
- package/lib/refund/forms/refund-and-travel-guarantee/refundTaxiForm.d.ts.map +1 -0
- package/lib/refund/forms/refund-and-travel-guarantee/refundTaxiForm.js +133 -0
- package/lib/refund/forms/refund-ticket/appTicketRefund.d.ts +12 -0
- package/lib/refund/forms/refund-ticket/appTicketRefund.d.ts.map +1 -0
- package/lib/refund/forms/refund-ticket/appTicketRefund.js +82 -0
- package/lib/refund/forms/refund-ticket/index.d.ts +10 -0
- package/lib/refund/forms/refund-ticket/index.d.ts.map +1 -0
- package/lib/refund/forms/refund-ticket/index.js +38 -0
- package/lib/refund/forms/refund-ticket/otherTicketRefund.d.ts +11 -0
- package/lib/refund/forms/refund-ticket/otherTicketRefund.d.ts.map +1 -0
- package/lib/refund/forms/refund-ticket/otherTicketRefund.js +109 -0
- package/lib/refund/forms/residualValueOnTravelCard/index.d.ts +2 -0
- package/lib/refund/forms/residualValueOnTravelCard/index.d.ts.map +1 -0
- package/lib/refund/forms/residualValueOnTravelCard/index.js +19 -0
- package/lib/refund/index.d.ts +3 -0
- package/lib/refund/index.d.ts.map +1 -0
- package/lib/refund/index.js +50 -0
- package/lib/refund/refundFormMachine.d.ts +406 -0
- package/lib/refund/refundFormMachine.d.ts.map +1 -0
- package/lib/refund/refundFormMachine.js +404 -0
- package/lib/server/contact/index.d.ts +11 -0
- package/lib/server/contact/index.d.ts.map +1 -0
- package/lib/server/contact/index.js +47 -0
- package/lib/server/index.d.ts +9 -0
- package/lib/server/index.d.ts.map +1 -0
- package/lib/server/index.js +14 -0
- package/lib/server/journey-planner/authority.d.ts +26 -0
- package/lib/server/journey-planner/authority.d.ts.map +1 -0
- package/lib/server/journey-planner/authority.js +48 -0
- package/lib/server/journey-planner/entur-client.d.ts +7 -0
- package/lib/server/journey-planner/entur-client.d.ts.map +1 -0
- package/lib/server/journey-planner/entur-client.js +46 -0
- package/lib/server/journey-planner/index.d.ts +11 -0
- package/lib/server/journey-planner/index.d.ts.map +1 -0
- package/lib/server/journey-planner/index.js +63 -0
- package/lib/server/journey-planner/journey-gql/lines.generated.d.ts +25 -0
- package/lib/server/journey-planner/journey-gql/lines.generated.d.ts.map +1 -0
- package/lib/server/journey-planner/journey-gql/lines.generated.js +30 -0
- package/lib/server/journey-planner/validators.d.ts +25 -0
- package/lib/server/journey-planner/validators.d.ts.map +1 -0
- package/lib/server/journey-planner/validators.js +17 -0
- package/lib/server/types.d.ts +5 -0
- package/lib/server/types.d.ts.map +1 -0
- package/lib/server/types.js +2 -0
- package/lib/success-content/success-content.d.ts +2 -0
- package/lib/success-content/success-content.d.ts.map +1 -0
- package/lib/success-content/success-content.js +19 -0
- package/lib/success-content/success-content.module.css +11 -0
- package/lib/ticket-control/events.d.ts +16 -0
- package/lib/ticket-control/events.d.ts.map +1 -0
- package/lib/ticket-control/events.js +5 -0
- package/lib/ticket-control/forms/feeComplaintForm.d.ts +11 -0
- package/lib/ticket-control/forms/feeComplaintForm.d.ts.map +1 -0
- package/lib/ticket-control/forms/feeComplaintForm.js +130 -0
- package/lib/ticket-control/forms/feedbackForm.d.ts +11 -0
- package/lib/ticket-control/forms/feedbackForm.d.ts.map +1 -0
- package/lib/ticket-control/forms/feedbackForm.js +75 -0
- package/lib/ticket-control/forms/postponePayment.d.ts +11 -0
- package/lib/ticket-control/forms/postponePayment.d.ts.map +1 -0
- package/lib/ticket-control/forms/postponePayment.js +37 -0
- package/lib/ticket-control/index.d.ts +3 -0
- package/lib/ticket-control/index.d.ts.map +1 -0
- package/lib/ticket-control/index.js +53 -0
- package/lib/ticket-control/ticket-control-form-machine.d.ts +277 -0
- package/lib/ticket-control/ticket-control-form-machine.d.ts.map +1 -0
- package/lib/ticket-control/ticket-control-form-machine.js +262 -0
- package/lib/ticketing/events.d.ts +28 -0
- package/lib/ticketing/events.d.ts.map +1 -0
- package/lib/ticketing/events.js +5 -0
- package/lib/ticketing/forms/app/appAccountForm.d.ts +11 -0
- package/lib/ticketing/forms/app/appAccountForm.d.ts.map +1 -0
- package/lib/ticketing/forms/app/appAccountForm.js +51 -0
- package/lib/ticketing/forms/app/appTicketingForm.d.ts +11 -0
- package/lib/ticketing/forms/app/appTicketingForm.d.ts.map +1 -0
- package/lib/ticketing/forms/app/appTicketingForm.js +59 -0
- package/lib/ticketing/forms/app/appTravelSuggestionForm.d.ts +11 -0
- package/lib/ticketing/forms/app/appTravelSuggestionForm.d.ts.map +1 -0
- package/lib/ticketing/forms/app/appTravelSuggestionForm.js +41 -0
- package/lib/ticketing/forms/app/index.d.ts +10 -0
- package/lib/ticketing/forms/app/index.d.ts.map +1 -0
- package/lib/ticketing/forms/app/index.js +23 -0
- package/lib/ticketing/forms/priceAndTicketTypesForm.d.ts +11 -0
- package/lib/ticketing/forms/priceAndTicketTypesForm.d.ts.map +1 -0
- package/lib/ticketing/forms/priceAndTicketTypesForm.js +41 -0
- package/lib/ticketing/forms/travel-card/index.d.ts +10 -0
- package/lib/ticketing/forms/travel-card/index.d.ts.map +1 -0
- package/lib/ticketing/forms/travel-card/index.js +24 -0
- package/lib/ticketing/forms/travel-card/orderTravelCard.d.ts +3 -0
- package/lib/ticketing/forms/travel-card/orderTravelCard.d.ts.map +1 -0
- package/lib/ticketing/forms/travel-card/orderTravelCard.js +21 -0
- package/lib/ticketing/forms/travel-card/travelCardQuestionForm.d.ts +11 -0
- package/lib/ticketing/forms/travel-card/travelCardQuestionForm.d.ts.map +1 -0
- package/lib/ticketing/forms/travel-card/travelCardQuestionForm.js +52 -0
- package/lib/ticketing/forms/webshop/index.d.ts +10 -0
- package/lib/ticketing/forms/webshop/index.d.ts.map +1 -0
- package/lib/ticketing/forms/webshop/index.js +22 -0
- package/lib/ticketing/forms/webshop/webshopAccountForm.d.ts +11 -0
- package/lib/ticketing/forms/webshop/webshopAccountForm.d.ts.map +1 -0
- package/lib/ticketing/forms/webshop/webshopAccountForm.js +51 -0
- package/lib/ticketing/forms/webshop/webshopTicketingForm.d.ts +11 -0
- package/lib/ticketing/forms/webshop/webshopTicketingForm.d.ts.map +1 -0
- package/lib/ticketing/forms/webshop/webshopTicketingForm.js +58 -0
- package/lib/ticketing/index.d.ts +3 -0
- package/lib/ticketing/index.d.ts.map +1 -0
- package/lib/ticketing/index.js +52 -0
- package/lib/ticketing/ticketingStateMachine.d.ts +438 -0
- package/lib/ticketing/ticketingStateMachine.d.ts.map +1 -0
- package/lib/ticketing/ticketingStateMachine.js +435 -0
- package/lib/translations/__tests__/utils.test.d.ts +2 -0
- package/lib/translations/__tests__/utils.test.d.ts.map +1 -0
- package/lib/translations/__tests__/utils.test.js +35 -0
- package/lib/translations/common/index.d.ts +3 -0
- package/lib/translations/common/index.d.ts.map +1 -0
- package/lib/translations/common/index.js +7 -0
- package/lib/translations/common/layout.d.ts +8 -0
- package/lib/translations/common/layout.d.ts.map +1 -0
- package/lib/translations/common/layout.js +39 -0
- package/lib/translations/common/titles.d.ts +4 -0
- package/lib/translations/common/titles.d.ts.map +1 -0
- package/lib/translations/common/titles.js +25 -0
- package/lib/translations/commons.d.ts +21 -0
- package/lib/translations/commons.d.ts.map +1 -0
- package/lib/translations/commons.js +39 -0
- package/lib/translations/components/clear-button.d.ts +4 -0
- package/lib/translations/components/clear-button.d.ts.map +1 -0
- package/lib/translations/components/clear-button.js +7 -0
- package/lib/translations/components/departure-date-selector.d.ts +8 -0
- package/lib/translations/components/departure-date-selector.d.ts.map +1 -0
- package/lib/translations/components/departure-date-selector.js +11 -0
- package/lib/translations/components/departure-time.d.ts +8 -0
- package/lib/translations/components/departure-time.d.ts.map +1 -0
- package/lib/translations/components/departure-time.js +11 -0
- package/lib/translations/components/empty-search.d.ts +18 -0
- package/lib/translations/components/empty-search.d.ts.map +1 -0
- package/lib/translations/components/empty-search.js +21 -0
- package/lib/translations/components/geolocation-button.d.ts +10 -0
- package/lib/translations/components/geolocation-button.d.ts.map +1 -0
- package/lib/translations/components/geolocation-button.js +13 -0
- package/lib/translations/components/index.d.ts +14 -0
- package/lib/translations/components/index.d.ts.map +1 -0
- package/lib/translations/components/index.js +29 -0
- package/lib/translations/components/loading.d.ts +4 -0
- package/lib/translations/components/loading.d.ts.map +1 -0
- package/lib/translations/components/loading.js +7 -0
- package/lib/translations/components/map.d.ts +19 -0
- package/lib/translations/components/map.d.ts.map +1 -0
- package/lib/translations/components/map.js +22 -0
- package/lib/translations/components/search.d.ts +9 -0
- package/lib/translations/components/search.d.ts.map +1 -0
- package/lib/translations/components/search.js +12 -0
- package/lib/translations/components/swap-button.d.ts +4 -0
- package/lib/translations/components/swap-button.d.ts.map +1 -0
- package/lib/translations/components/swap-button.js +7 -0
- package/lib/translations/components/tab-link.d.ts +5 -0
- package/lib/translations/components/tab-link.d.ts.map +1 -0
- package/lib/translations/components/tab-link.js +8 -0
- package/lib/translations/components/transport-mode-filter.d.ts +6 -0
- package/lib/translations/components/transport-mode-filter.d.ts.map +1 -0
- package/lib/translations/components/transport-mode-filter.js +9 -0
- package/lib/translations/components/transport-mode.d.ts +3 -0
- package/lib/translations/components/transport-mode.d.ts.map +1 -0
- package/lib/translations/components/transport-mode.js +28 -0
- package/lib/translations/components/venue-icon.d.ts +9 -0
- package/lib/translations/components/venue-icon.d.ts.map +1 -0
- package/lib/translations/components/venue-icon.js +12 -0
- package/lib/translations/dictionary.d.ts +33 -0
- package/lib/translations/dictionary.d.ts.map +1 -0
- package/lib/translations/dictionary.js +59 -0
- package/lib/translations/index.d.ts +16 -0
- package/lib/translations/index.d.ts.map +1 -0
- package/lib/translations/index.js +65 -0
- package/lib/translations/json-to-override.d.ts +19 -0
- package/lib/translations/json-to-override.d.ts.map +1 -0
- package/lib/translations/json-to-override.js +61 -0
- package/lib/translations/language-context.d.ts +37 -0
- package/lib/translations/language-context.d.ts.map +1 -0
- package/lib/translations/language-context.js +98 -0
- package/lib/translations/load-org-translations.d.ts +19 -0
- package/lib/translations/load-org-translations.d.ts.map +1 -0
- package/lib/translations/load-org-translations.js +23 -0
- package/lib/translations/merge-overrides.d.ts +28 -0
- package/lib/translations/merge-overrides.d.ts.map +1 -0
- package/lib/translations/merge-overrides.js +126 -0
- package/lib/translations/modules/index.d.ts +4 -0
- package/lib/translations/modules/index.d.ts.map +1 -0
- package/lib/translations/modules/index.js +9 -0
- package/lib/translations/modules/layout.d.ts +73 -0
- package/lib/translations/modules/layout.d.ts.map +1 -0
- package/lib/translations/modules/layout.js +106 -0
- package/lib/translations/modules/search-time.d.ts +8 -0
- package/lib/translations/modules/search-time.d.ts.map +1 -0
- package/lib/translations/modules/search-time.js +11 -0
- package/lib/translations/modules/situation.d.ts +8 -0
- package/lib/translations/modules/situation.d.ts.map +1 -0
- package/lib/translations/modules/situation.js +11 -0
- package/lib/translations/pages/assistant.d.ts +2 -0
- package/lib/translations/pages/assistant.d.ts.map +1 -0
- package/lib/translations/pages/assistant.js +303 -0
- package/lib/translations/pages/contact.d.ts +589 -0
- package/lib/translations/pages/contact.d.ts.map +1 -0
- package/lib/translations/pages/contact.js +679 -0
- package/lib/translations/pages/departures.d.ts +64 -0
- package/lib/translations/pages/departures.d.ts.map +1 -0
- package/lib/translations/pages/departures.js +75 -0
- package/lib/translations/pages/error.d.ts +8 -0
- package/lib/translations/pages/error.d.ts.map +1 -0
- package/lib/translations/pages/error.js +11 -0
- package/lib/translations/pages/index.d.ts +4 -0
- package/lib/translations/pages/index.d.ts.map +1 -0
- package/lib/translations/pages/index.js +9 -0
- package/lib/translations/server/endpoints.d.ts +67 -0
- package/lib/translations/server/endpoints.d.ts.map +1 -0
- package/lib/translations/server/endpoints.js +146 -0
- package/lib/translations/server/index.d.ts +2 -0
- package/lib/translations/server/index.d.ts.map +1 -0
- package/lib/translations/server/index.js +5 -0
- package/lib/translations/translations-context.d.ts +10 -0
- package/lib/translations/translations-context.d.ts.map +1 -0
- package/lib/translations/translations-context.js +20 -0
- package/lib/translations/types.d.ts +41 -0
- package/lib/translations/types.d.ts.map +1 -0
- package/lib/translations/types.js +24 -0
- package/lib/translations/utils.d.ts +16 -0
- package/lib/translations/utils.d.ts.map +1 -0
- package/lib/translations/utils.js +56 -0
- package/lib/types/submit-payloads.d.ts +119 -0
- package/lib/types/submit-payloads.d.ts.map +1 -0
- package/lib/types/submit-payloads.js +7 -0
- package/lib/types.d.ts +20 -0
- package/lib/types.d.ts.map +1 -0
- package/lib/types.js +12 -0
- package/lib/utils/color.d.ts +2 -0
- package/lib/utils/color.d.ts.map +1 -0
- package/lib/utils/color.js +50 -0
- package/lib/utils/css.d.ts +3 -0
- package/lib/utils/css.d.ts.map +1 -0
- package/lib/utils/css.js +15 -0
- package/lib/utils/date.d.ts +4 -0
- package/lib/utils/date.d.ts.map +1 -0
- package/lib/utils/date.js +21 -0
- package/lib/utils/enum-from-string.d.ts +4 -0
- package/lib/utils/enum-from-string.d.ts.map +1 -0
- package/lib/utils/enum-from-string.js +9 -0
- package/lib/utils/env.d.ts +10 -0
- package/lib/utils/env.d.ts.map +1 -0
- package/lib/utils/env.js +49 -0
- package/lib/utils/only-uniques.d.ts +3 -0
- package/lib/utils/only-uniques.d.ts.map +1 -0
- package/lib/utils/only-uniques.js +7 -0
- package/lib/utils/org-theme-definitions.d.ts +5 -0
- package/lib/utils/org-theme-definitions.d.ts.map +1 -0
- package/lib/utils/org-theme-definitions.js +13 -0
- package/lib/utils/presence.d.ts +2 -0
- package/lib/utils/presence.d.ts.map +1 -0
- package/lib/utils/presence.js +5 -0
- package/lib/utils/reference-data.d.ts +15 -0
- package/lib/utils/reference-data.d.ts.map +1 -0
- package/lib/utils/reference-data.js +15 -0
- package/lib/utils/use-client-width.d.ts +2 -0
- package/lib/utils/use-client-width.d.ts.map +1 -0
- package/lib/utils/use-client-width.js +18 -0
- package/lib/utils/use-debounce.d.ts +3 -0
- package/lib/utils/use-debounce.d.ts.map +1 -0
- package/lib/utils/use-debounce.js +14 -0
- package/lib/utils/use-interval.d.ts +2 -0
- package/lib/utils/use-interval.d.ts.map +1 -0
- package/lib/utils/use-interval.js +22 -0
- package/lib/utils/use-localstorage.d.ts +2 -0
- package/lib/utils/use-localstorage.d.ts.map +1 -0
- package/lib/utils/use-localstorage.js +40 -0
- package/lib/utils/use-now.d.ts +2 -0
- package/lib/utils/use-now.d.ts.map +1 -0
- package/lib/utils/use-now.js +13 -0
- package/lib/utils/user-media-query.d.ts +2 -0
- package/lib/utils/user-media-query.d.ts.map +1 -0
- package/lib/utils/user-media-query.js +36 -0
- package/lib/utils.d.ts +19 -0
- package/lib/utils.d.ts.map +1 -0
- package/lib/utils.js +126 -0
- package/lib/validation/commonInputValidator.d.ts +7 -0
- package/lib/validation/commonInputValidator.d.ts.map +1 -0
- package/lib/validation/commonInputValidator.js +28 -0
- package/lib/validation/index.d.ts +2 -0
- package/lib/validation/index.d.ts.map +1 -0
- package/lib/validation/index.js +8 -0
- package/lib/validation/validationRules.d.ts +11 -0
- package/lib/validation/validationRules.d.ts.map +1 -0
- package/lib/validation/validationRules.js +372 -0
- package/package.json +99 -0
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.default = useMediaQuery;
|
|
4
|
+
const react_1 = require("react");
|
|
5
|
+
function useMediaQuery(mediaQuery) {
|
|
6
|
+
const [isMatched, setMatched] = (0, react_1.useState)(() => {
|
|
7
|
+
if (!hasWindow())
|
|
8
|
+
return false;
|
|
9
|
+
return Boolean(window.matchMedia(mediaQuery).matches);
|
|
10
|
+
});
|
|
11
|
+
(0, react_1.useEffect)(() => {
|
|
12
|
+
if (!hasWindow())
|
|
13
|
+
return;
|
|
14
|
+
const mediaQueryList = window.matchMedia(mediaQuery);
|
|
15
|
+
const documentChangeHandler = () => setMatched(Boolean(mediaQueryList.matches));
|
|
16
|
+
listenTo(mediaQueryList, documentChangeHandler);
|
|
17
|
+
documentChangeHandler();
|
|
18
|
+
return () => removeListener(mediaQueryList, documentChangeHandler);
|
|
19
|
+
}, [mediaQuery]);
|
|
20
|
+
return isMatched;
|
|
21
|
+
}
|
|
22
|
+
function hasWindow() {
|
|
23
|
+
return typeof window !== 'undefined';
|
|
24
|
+
}
|
|
25
|
+
function listenTo(matcher, cb) {
|
|
26
|
+
if ('addEventListener' in matcher) {
|
|
27
|
+
return matcher.addEventListener('change', cb);
|
|
28
|
+
}
|
|
29
|
+
return matcher.addListener(cb);
|
|
30
|
+
}
|
|
31
|
+
function removeListener(matcher, cb) {
|
|
32
|
+
if ('removeEventListener' in matcher) {
|
|
33
|
+
return matcher.removeEventListener('change', cb);
|
|
34
|
+
}
|
|
35
|
+
return matcher.removeListener(cb);
|
|
36
|
+
}
|
package/lib/utils.d.ts
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { TransportModeType } from './types';
|
|
2
|
+
import { Line } from '.';
|
|
3
|
+
import { FormEvent } from 'react';
|
|
4
|
+
import { InputErrorMessages } from './validation';
|
|
5
|
+
import { TranslatedString } from "./translations";
|
|
6
|
+
export declare const getContactPageTitle: (subtitle?: TranslatedString) => TranslatedString[];
|
|
7
|
+
export declare const shouldShowContactPage: () => boolean;
|
|
8
|
+
export declare const convertFilesToBase64: (attachments: File[]) => Promise<{
|
|
9
|
+
filename: string;
|
|
10
|
+
body: string;
|
|
11
|
+
}[]>;
|
|
12
|
+
export declare const setTransportModeAndResetLineAndStops: (context: any, transporMode: TransportModeType) => any;
|
|
13
|
+
export declare const setLineAndResetStops: (context: any, line: Line | undefined) => any;
|
|
14
|
+
export declare const setBankAccountStatusAndResetBankInformation: (context: any, hasInternationalBankAccount: boolean) => any;
|
|
15
|
+
export declare const findOrderFormFields: (e: FormEvent<HTMLFormElement>) => string[];
|
|
16
|
+
export declare const scrollToFirstErrorMessage: (id: string | undefined) => void;
|
|
17
|
+
export declare const findFirstErrorMessage: (formFields: string[] | undefined, errors: InputErrorMessages) => string | undefined;
|
|
18
|
+
export declare function getLineName(line: Line | undefined): string | undefined;
|
|
19
|
+
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,iBAAiB,EAAC,MAAM,SAAS,CAAC;AAC1C,OAAO,EAAC,IAAI,EAAC,MAAM,GAAG,CAAC;AACvB,OAAO,EAAC,SAAS,EAAC,MAAM,OAAO,CAAC;AAChC,OAAO,EAAC,kBAAkB,EAAC,MAAM,cAAc,CAAC;AAChD,OAAO,EAAW,gBAAgB,EAAC,MAAM,gBAAgB,CAAC;AAE1D,eAAO,MAAM,mBAAmB,GAC5B,WAAW,gBAAgB,KAC5B,gBAAgB,EAIlB,CAAC;AAEF,eAAO,MAAM,qBAAqB,QAAO,OAExC,CAAC;AAEF,eAAO,MAAM,oBAAoB,GAC7B,aAAa,IAAI,EAAE,KACpB,OAAO,CAAC;IAAE,QAAQ,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,EAAE,CAsB9C,CAAC;AAEF,eAAO,MAAM,oCAAoC,GAC7C,SAAS,GAAG,EACZ,cAAc,iBAAiB,QAgBlC,CAAC;AAEF,eAAO,MAAM,oBAAoB,GAAI,SAAS,GAAG,EAAE,MAAM,IAAI,GAAG,SAAS,QAaxE,CAAC;AAEF,eAAO,MAAM,2CAA2C,GACpD,SAAS,GAAG,EACZ,6BAA6B,OAAO,QAUvC,CAAC;AAYF,eAAO,MAAM,mBAAmB,GAAI,GAAG,SAAS,CAAC,eAAe,CAAC,KAAG,MAAM,EAOhC,CAAC;AAE3C,eAAO,MAAM,yBAAyB,GAAI,IAAI,MAAM,GAAG,SAAS,KAAG,IA4BlE,CAAC;AAEF,eAAO,MAAM,qBAAqB,GAC9B,YAAY,MAAM,EAAE,GAAG,SAAS,EAChC,QAAQ,kBAAkB,KAC3B,MAAM,GAAG,SAQX,CAAC;AAEF,wBAAgB,WAAW,CAAC,IAAI,EAAE,IAAI,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,CAEtE"}
|
package/lib/utils.js
ADDED
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.findFirstErrorMessage = exports.scrollToFirstErrorMessage = exports.findOrderFormFields = exports.setBankAccountStatusAndResetBankInformation = exports.setLineAndResetStops = exports.setTransportModeAndResetLineAndStops = exports.convertFilesToBase64 = exports.shouldShowContactPage = exports.getContactPageTitle = void 0;
|
|
4
|
+
exports.getLineName = getLineName;
|
|
5
|
+
const translations_1 = require("./translations");
|
|
6
|
+
const getContactPageTitle = (subtitle) => {
|
|
7
|
+
return subtitle
|
|
8
|
+
? [subtitle, translations_1.PageText.Contact.pageTitle]
|
|
9
|
+
: [translations_1.PageText.Contact.pageTitle];
|
|
10
|
+
};
|
|
11
|
+
exports.getContactPageTitle = getContactPageTitle;
|
|
12
|
+
const shouldShowContactPage = () => {
|
|
13
|
+
return !!process.env.NEXT_PUBLIC_CONTACT_API_URL;
|
|
14
|
+
};
|
|
15
|
+
exports.shouldShowContactPage = shouldShowContactPage;
|
|
16
|
+
const convertFilesToBase64 = (attachments) => {
|
|
17
|
+
const filePromises = attachments.map((file) => {
|
|
18
|
+
return new Promise((resolve, reject) => {
|
|
19
|
+
const reader = new FileReader();
|
|
20
|
+
reader.onloadend = () => {
|
|
21
|
+
const result = reader.result;
|
|
22
|
+
if (typeof result === 'string') {
|
|
23
|
+
resolve({ filename: file.name, body: result });
|
|
24
|
+
}
|
|
25
|
+
else {
|
|
26
|
+
reject(new Error('File conversion failed'));
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
reader.onerror = reject;
|
|
30
|
+
reader.readAsDataURL(file);
|
|
31
|
+
});
|
|
32
|
+
});
|
|
33
|
+
return Promise.all(filePromises);
|
|
34
|
+
};
|
|
35
|
+
exports.convertFilesToBase64 = convertFilesToBase64;
|
|
36
|
+
const setTransportModeAndResetLineAndStops = (context, transporMode) => {
|
|
37
|
+
return {
|
|
38
|
+
...context,
|
|
39
|
+
transportMode: transporMode,
|
|
40
|
+
line: undefined,
|
|
41
|
+
fromStop: undefined,
|
|
42
|
+
toStop: undefined,
|
|
43
|
+
errorMessages: {
|
|
44
|
+
...context.errorMessages,
|
|
45
|
+
transportMode: [],
|
|
46
|
+
line: [],
|
|
47
|
+
fromStop: [],
|
|
48
|
+
toStop: [],
|
|
49
|
+
},
|
|
50
|
+
};
|
|
51
|
+
};
|
|
52
|
+
exports.setTransportModeAndResetLineAndStops = setTransportModeAndResetLineAndStops;
|
|
53
|
+
const setLineAndResetStops = (context, line) => {
|
|
54
|
+
return {
|
|
55
|
+
...context,
|
|
56
|
+
line: line,
|
|
57
|
+
fromStop: undefined,
|
|
58
|
+
toStop: undefined,
|
|
59
|
+
errorMessages: {
|
|
60
|
+
...context.errorMessages,
|
|
61
|
+
line: [],
|
|
62
|
+
fromStop: [],
|
|
63
|
+
toStop: [],
|
|
64
|
+
},
|
|
65
|
+
};
|
|
66
|
+
};
|
|
67
|
+
exports.setLineAndResetStops = setLineAndResetStops;
|
|
68
|
+
const setBankAccountStatusAndResetBankInformation = (context, hasInternationalBankAccount) => {
|
|
69
|
+
return {
|
|
70
|
+
...context,
|
|
71
|
+
hasInternationalBankAccount: hasInternationalBankAccount,
|
|
72
|
+
bankAccountNumber: undefined,
|
|
73
|
+
IBAN: undefined,
|
|
74
|
+
SWIFT: undefined,
|
|
75
|
+
errorMessages: { ...context.errorMessages, bankAccountNumber: [] },
|
|
76
|
+
};
|
|
77
|
+
};
|
|
78
|
+
exports.setBankAccountStatusAndResetBankInformation = setBankAccountStatusAndResetBankInformation;
|
|
79
|
+
const formFieldsPrefixes = [
|
|
80
|
+
'input__',
|
|
81
|
+
'textarea__',
|
|
82
|
+
'select__',
|
|
83
|
+
'searchable_select__',
|
|
84
|
+
'date_selector__',
|
|
85
|
+
'time_selector__',
|
|
86
|
+
'file_input__',
|
|
87
|
+
];
|
|
88
|
+
const findOrderFormFields = (e) => Array.from(e.currentTarget.elements)
|
|
89
|
+
.filter((el) => el instanceof HTMLElement &&
|
|
90
|
+
formFieldsPrefixes.some((prefix) => el.id.startsWith(prefix)))
|
|
91
|
+
.map((el) => el.id.split('__')[1]);
|
|
92
|
+
exports.findOrderFormFields = findOrderFormFields;
|
|
93
|
+
const scrollToFirstErrorMessage = (id) => {
|
|
94
|
+
if (!id)
|
|
95
|
+
return;
|
|
96
|
+
const match = formFieldsPrefixes
|
|
97
|
+
.map((prefix) => ({
|
|
98
|
+
prefix,
|
|
99
|
+
element: document.getElementById(`${prefix}${id}`),
|
|
100
|
+
}))
|
|
101
|
+
.find((item) => item.element !== null);
|
|
102
|
+
const element = match?.element;
|
|
103
|
+
const prefix = match?.prefix;
|
|
104
|
+
// The <input> for FileInput is hidden (display: none), so it can't receive focus.
|
|
105
|
+
// Instead, we need to focus the corresponding <label> using its `for` attribute.
|
|
106
|
+
const labelElement = document.querySelector(`label[for=${prefix}${id}]`);
|
|
107
|
+
const scrollTarget = labelElement ?? element;
|
|
108
|
+
if (scrollTarget) {
|
|
109
|
+
scrollTarget.scrollIntoView({ behavior: 'smooth', block: 'center' });
|
|
110
|
+
scrollTarget.focus();
|
|
111
|
+
}
|
|
112
|
+
};
|
|
113
|
+
exports.scrollToFirstErrorMessage = scrollToFirstErrorMessage;
|
|
114
|
+
const findFirstErrorMessage = (formFields, errors) => {
|
|
115
|
+
if (!formFields)
|
|
116
|
+
return undefined;
|
|
117
|
+
for (const field of formFields) {
|
|
118
|
+
if (errors[field]) {
|
|
119
|
+
return field;
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
};
|
|
123
|
+
exports.findFirstErrorMessage = findFirstErrorMessage;
|
|
124
|
+
function getLineName(line) {
|
|
125
|
+
return line ? `${line.publicCode} - ${line.name}` : undefined;
|
|
126
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { TranslatedString } from '../translations';
|
|
2
|
+
export type InputErrorMessages = {
|
|
3
|
+
[key: string]: TranslatedString[];
|
|
4
|
+
};
|
|
5
|
+
export declare const commonInputValidator: (context: any) => InputErrorMessages;
|
|
6
|
+
export default commonInputValidator;
|
|
7
|
+
//# sourceMappingURL=commonInputValidator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"commonInputValidator.d.ts","sourceRoot":"","sources":["../../src/validation/commonInputValidator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,gBAAgB,EAAC,MAAM,iBAAiB,CAAC;AAGjD,MAAM,MAAM,kBAAkB,GAAG;IAC7B,CAAC,GAAG,EAAE,MAAM,GAAG,gBAAgB,EAAE,CAAC;CACrC,CAAC;AAEF,eAAO,MAAM,oBAAoB,GAAI,SAAS,GAAG,KAAG,kBAiBnD,CAAC;AAaF,eAAe,oBAAoB,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.commonInputValidator = void 0;
|
|
4
|
+
const validationRules_1 = require("./validationRules");
|
|
5
|
+
const commonInputValidator = (context) => {
|
|
6
|
+
const inputErrorMessages = {};
|
|
7
|
+
Object.keys(context).forEach((inputName) => {
|
|
8
|
+
const rules = validationRules_1.validationRules[inputName];
|
|
9
|
+
if (!rules)
|
|
10
|
+
return;
|
|
11
|
+
for (const { validate, errorMessage } of rules) {
|
|
12
|
+
const isValid = validate(context[inputName]);
|
|
13
|
+
if (!isValid) {
|
|
14
|
+
addErrorMessage(inputName, errorMessage, inputErrorMessages);
|
|
15
|
+
return; // Stop the loop after the first error is found
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
return inputErrorMessages;
|
|
20
|
+
};
|
|
21
|
+
exports.commonInputValidator = commonInputValidator;
|
|
22
|
+
function addErrorMessage(inputName, errorMessage, inputErrorMessages) {
|
|
23
|
+
if (!inputErrorMessages[inputName]) {
|
|
24
|
+
inputErrorMessages[inputName] = [];
|
|
25
|
+
}
|
|
26
|
+
inputErrorMessages[inputName].push(errorMessage);
|
|
27
|
+
}
|
|
28
|
+
exports.default = exports.commonInputValidator;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/validation/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,OAAO,IAAI,oBAAoB,EAC/B,KAAK,kBAAkB,GAC1B,MAAM,wBAAwB,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.commonInputValidator = void 0;
|
|
7
|
+
var commonInputValidator_1 = require("./commonInputValidator");
|
|
8
|
+
Object.defineProperty(exports, "commonInputValidator", { enumerable: true, get: function () { return __importDefault(commonInputValidator_1).default; } });
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { TranslatedString } from '../translations';
|
|
2
|
+
type ValidationRule = {
|
|
3
|
+
validate: (value: any) => boolean;
|
|
4
|
+
errorMessage: TranslatedString;
|
|
5
|
+
};
|
|
6
|
+
type ValidationRulesMap = {
|
|
7
|
+
[inputName: string]: ValidationRule[];
|
|
8
|
+
};
|
|
9
|
+
export declare const validationRules: ValidationRulesMap;
|
|
10
|
+
export {};
|
|
11
|
+
//# sourceMappingURL=validationRules.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validationRules.d.ts","sourceRoot":"","sources":["../../src/validation/validationRules.ts"],"names":[],"mappings":"AAAA,OAAO,EAAW,gBAAgB,EAAC,MAAM,iBAAiB,CAAC;AAmD3D,KAAK,cAAc,GAAG;IAClB,QAAQ,EAAE,CAAC,KAAK,EAAE,GAAG,KAAK,OAAO,CAAC;IAClC,YAAY,EAAE,gBAAgB,CAAC;CAClC,CAAC;AAyVF,KAAK,kBAAkB,GAAG;IAAE,CAAC,SAAS,EAAE,MAAM,GAAG,cAAc,EAAE,CAAA;CAAE,CAAC;AAEpE,eAAO,MAAM,eAAe,EAAE,kBAsC7B,CAAC"}
|
|
@@ -0,0 +1,372 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.validationRules = void 0;
|
|
4
|
+
const translations_1 = require("../translations");
|
|
5
|
+
const isDefined = (value) => value !== undefined;
|
|
6
|
+
const removeWhitespace = (value) => {
|
|
7
|
+
if (value == null)
|
|
8
|
+
return '';
|
|
9
|
+
return value.replace(/\s+/g, '');
|
|
10
|
+
};
|
|
11
|
+
const isNonEmptyString = (value) => removeWhitespace(value) !== '';
|
|
12
|
+
const isDigitsOnly = (value) => {
|
|
13
|
+
if (value == null)
|
|
14
|
+
return false;
|
|
15
|
+
return /^\d+$/.test(value);
|
|
16
|
+
};
|
|
17
|
+
const hasExpectedLength = (...expectedLengths) => (value) => expectedLengths.includes(value?.length ?? 0);
|
|
18
|
+
const hasExpectedLengthRange = (min, max) => (value) => !!value?.length && value?.length >= min && value?.length <= max;
|
|
19
|
+
const isValidBankAccount = (value) => {
|
|
20
|
+
if (value == null)
|
|
21
|
+
return false;
|
|
22
|
+
if (value.includes('.')) {
|
|
23
|
+
if (value[4] !== '.' && value[8] !== '.')
|
|
24
|
+
return false;
|
|
25
|
+
}
|
|
26
|
+
const cleaned = removeWhitespace(value.replace(/\./g, ''));
|
|
27
|
+
if (!isDigitsOnly(cleaned))
|
|
28
|
+
return false;
|
|
29
|
+
return hasExpectedLength(11)(cleaned);
|
|
30
|
+
};
|
|
31
|
+
const containsAtLeastOneLetter = (value) => {
|
|
32
|
+
if (value == null)
|
|
33
|
+
return false;
|
|
34
|
+
return /[a-zA-ZæøåÆØÅ]/.test(value);
|
|
35
|
+
};
|
|
36
|
+
// phone number can optionally start with [+] and must consist of [0-9]. Whitespaces are ignored.
|
|
37
|
+
const isValidMobilNumber = (value) => {
|
|
38
|
+
if (value == null)
|
|
39
|
+
return false;
|
|
40
|
+
return /^[+]?\d+$/.test(removeWhitespace(value));
|
|
41
|
+
};
|
|
42
|
+
const rulesFirstName = [
|
|
43
|
+
{
|
|
44
|
+
validate: isNonEmptyString,
|
|
45
|
+
errorMessage: translations_1.PageText.Contact.input.firstName.errorMessages.empty,
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
validate: containsAtLeastOneLetter,
|
|
49
|
+
errorMessage: translations_1.PageText.Contact.input.firstName.errorMessages.empty,
|
|
50
|
+
},
|
|
51
|
+
];
|
|
52
|
+
const rulesLastName = [
|
|
53
|
+
{
|
|
54
|
+
validate: isNonEmptyString,
|
|
55
|
+
errorMessage: translations_1.PageText.Contact.input.lastName.errorMessages.empty,
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
validate: containsAtLeastOneLetter,
|
|
59
|
+
errorMessage: translations_1.PageText.Contact.input.lastName.errorMessages.empty,
|
|
60
|
+
},
|
|
61
|
+
];
|
|
62
|
+
const rulesEmail = [
|
|
63
|
+
{
|
|
64
|
+
validate: isNonEmptyString,
|
|
65
|
+
errorMessage: translations_1.PageText.Contact.input.email.errorMessages.empty,
|
|
66
|
+
},
|
|
67
|
+
];
|
|
68
|
+
const rulesAddress = [
|
|
69
|
+
{
|
|
70
|
+
validate: isNonEmptyString,
|
|
71
|
+
errorMessage: translations_1.PageText.Contact.input.address.errorMessages.empty,
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
validate: containsAtLeastOneLetter,
|
|
75
|
+
errorMessage: translations_1.PageText.Contact.input.address.errorMessages.empty,
|
|
76
|
+
},
|
|
77
|
+
];
|
|
78
|
+
const rulesPostalCode = [
|
|
79
|
+
{
|
|
80
|
+
validate: isNonEmptyString,
|
|
81
|
+
errorMessage: translations_1.PageText.Contact.input.postalCode.errorMessages.empty,
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
validate: hasExpectedLength(4),
|
|
85
|
+
errorMessage: translations_1.PageText.Contact.input.postalCode.errorMessages.invalidFormat,
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
validate: isDigitsOnly,
|
|
89
|
+
errorMessage: translations_1.PageText.Contact.input.postalCode.errorMessages.invalidFormat,
|
|
90
|
+
},
|
|
91
|
+
];
|
|
92
|
+
const rulesCity = [
|
|
93
|
+
{
|
|
94
|
+
validate: isNonEmptyString,
|
|
95
|
+
errorMessage: translations_1.PageText.Contact.input.city.errorMessages.empty,
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
validate: containsAtLeastOneLetter,
|
|
99
|
+
errorMessage: translations_1.PageText.Contact.input.city.errorMessages.empty,
|
|
100
|
+
},
|
|
101
|
+
];
|
|
102
|
+
const rulesPhoneNumber = [
|
|
103
|
+
{
|
|
104
|
+
validate: isNonEmptyString,
|
|
105
|
+
errorMessage: translations_1.PageText.Contact.input.phoneNumber.errorMessages.empty,
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
validate: isValidMobilNumber,
|
|
109
|
+
errorMessage: translations_1.PageText.Contact.input.phoneNumber.errorMessages.invalidFormat,
|
|
110
|
+
},
|
|
111
|
+
];
|
|
112
|
+
const rulesBankAccountNumber = [
|
|
113
|
+
{
|
|
114
|
+
validate: isNonEmptyString,
|
|
115
|
+
errorMessage: translations_1.PageText.Contact.input.bankInformation.bankAccountNumber.errorMessages
|
|
116
|
+
.empty,
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
validate: isValidBankAccount,
|
|
120
|
+
errorMessage: translations_1.PageText.Contact.input.bankInformation.bankAccountNumber.errorMessages
|
|
121
|
+
.invalidFormat,
|
|
122
|
+
},
|
|
123
|
+
];
|
|
124
|
+
const rulesIBAN = [
|
|
125
|
+
{
|
|
126
|
+
validate: isNonEmptyString,
|
|
127
|
+
errorMessage: translations_1.PageText.Contact.input.bankInformation.IBAN.errorMessages.empty,
|
|
128
|
+
},
|
|
129
|
+
];
|
|
130
|
+
const rulesSWIFT = [
|
|
131
|
+
{
|
|
132
|
+
validate: isNonEmptyString,
|
|
133
|
+
errorMessage: translations_1.PageText.Contact.input.bankInformation.SWIFT.errorMessages.empty,
|
|
134
|
+
},
|
|
135
|
+
];
|
|
136
|
+
const rulesTransportMode = [
|
|
137
|
+
{
|
|
138
|
+
validate: (_transportMode) => isDefined(_transportMode),
|
|
139
|
+
errorMessage: translations_1.PageText.Contact.input.transportMode.errorMessages.empty,
|
|
140
|
+
},
|
|
141
|
+
];
|
|
142
|
+
const rulesLine = [
|
|
143
|
+
{
|
|
144
|
+
validate: (_line) => isDefined(_line),
|
|
145
|
+
errorMessage: translations_1.PageText.Contact.input.line.errorMessages.empty,
|
|
146
|
+
},
|
|
147
|
+
];
|
|
148
|
+
const rulesFromStop = [
|
|
149
|
+
{
|
|
150
|
+
validate: (_fromStop) => isDefined(_fromStop),
|
|
151
|
+
errorMessage: translations_1.PageText.Contact.input.fromStop.errorMessages.empty,
|
|
152
|
+
},
|
|
153
|
+
];
|
|
154
|
+
const rulesToStop = [
|
|
155
|
+
{
|
|
156
|
+
validate: (_toStop) => isDefined(_toStop),
|
|
157
|
+
errorMessage: translations_1.PageText.Contact.input.toStop.errorMessages.empty,
|
|
158
|
+
},
|
|
159
|
+
];
|
|
160
|
+
const rulesStop = [
|
|
161
|
+
{
|
|
162
|
+
validate: (_stop) => isDefined(_stop),
|
|
163
|
+
errorMessage: translations_1.PageText.Contact.input.stop.errorMessages.empty,
|
|
164
|
+
},
|
|
165
|
+
];
|
|
166
|
+
const rulesDate = [
|
|
167
|
+
{
|
|
168
|
+
validate: isNonEmptyString,
|
|
169
|
+
errorMessage: translations_1.PageText.Contact.input.date.errorMessages.empty,
|
|
170
|
+
},
|
|
171
|
+
];
|
|
172
|
+
const rulesDateOfTicketControl = [
|
|
173
|
+
{
|
|
174
|
+
validate: isNonEmptyString,
|
|
175
|
+
errorMessage: translations_1.PageText.Contact.input.date.ticketControl.errorMessages.empty,
|
|
176
|
+
},
|
|
177
|
+
];
|
|
178
|
+
const rulesTimeOfTicketControl = [
|
|
179
|
+
{
|
|
180
|
+
validate: isNonEmptyString,
|
|
181
|
+
errorMessage: translations_1.PageText.Contact.input.time.ticketControl.errorMessages.empty,
|
|
182
|
+
},
|
|
183
|
+
];
|
|
184
|
+
const rulesPlannedDepartureTime = [
|
|
185
|
+
{
|
|
186
|
+
validate: isNonEmptyString,
|
|
187
|
+
errorMessage: translations_1.PageText.Contact.input.plannedDepartureTime.errorMessages.empty,
|
|
188
|
+
},
|
|
189
|
+
];
|
|
190
|
+
const rulesReasonForTransportFailure = [
|
|
191
|
+
{
|
|
192
|
+
validate: (_reasonForTransportFailure) => isDefined(_reasonForTransportFailure),
|
|
193
|
+
errorMessage: translations_1.PageText.Contact.input.reasonForTransportFailure.errorMessages.empty,
|
|
194
|
+
},
|
|
195
|
+
];
|
|
196
|
+
const rulesFeeNumber = [
|
|
197
|
+
{
|
|
198
|
+
validate: isNonEmptyString,
|
|
199
|
+
errorMessage: translations_1.PageText.Contact.input.feeNumber.errorMessages.empty,
|
|
200
|
+
},
|
|
201
|
+
{
|
|
202
|
+
validate: hasExpectedLength(4),
|
|
203
|
+
errorMessage: translations_1.PageText.Contact.input.feeNumber.errorMessages.invalidFormat,
|
|
204
|
+
},
|
|
205
|
+
];
|
|
206
|
+
const rulesInvoiceNumber = [
|
|
207
|
+
{
|
|
208
|
+
validate: isNonEmptyString,
|
|
209
|
+
errorMessage: translations_1.PageText.Contact.input.invoiceNumber.errorMessages.empty,
|
|
210
|
+
},
|
|
211
|
+
];
|
|
212
|
+
const rulesFeedback = [
|
|
213
|
+
{
|
|
214
|
+
validate: isNonEmptyString,
|
|
215
|
+
errorMessage: translations_1.PageText.Contact.input.feedback.errorMessages.empty,
|
|
216
|
+
},
|
|
217
|
+
];
|
|
218
|
+
const rulesKilometersDriven = [
|
|
219
|
+
{
|
|
220
|
+
validate: isNonEmptyString,
|
|
221
|
+
errorMessage: translations_1.PageText.Contact.input.kilometersDriven.errorMessages.empty,
|
|
222
|
+
},
|
|
223
|
+
];
|
|
224
|
+
const rulesFromAddress = [
|
|
225
|
+
{
|
|
226
|
+
validate: isNonEmptyString,
|
|
227
|
+
errorMessage: translations_1.PageText.Contact.input.fromAddress.errorMessages.empty,
|
|
228
|
+
},
|
|
229
|
+
];
|
|
230
|
+
const rulesToAddress = [
|
|
231
|
+
{
|
|
232
|
+
validate: isNonEmptyString,
|
|
233
|
+
errorMessage: translations_1.PageText.Contact.input.toAddress.errorMessages.empty,
|
|
234
|
+
},
|
|
235
|
+
];
|
|
236
|
+
const rulesQuestion = [
|
|
237
|
+
{
|
|
238
|
+
validate: isNonEmptyString,
|
|
239
|
+
errorMessage: translations_1.PageText.Contact.input.question.errorMessages.empty,
|
|
240
|
+
},
|
|
241
|
+
];
|
|
242
|
+
const rulesOrderId = [
|
|
243
|
+
{
|
|
244
|
+
validate: isNonEmptyString,
|
|
245
|
+
errorMessage: translations_1.PageText.Contact.input.orderId.errorMessages.empty,
|
|
246
|
+
},
|
|
247
|
+
{
|
|
248
|
+
validate: (_orderId) => {
|
|
249
|
+
if (_orderId.includes(','))
|
|
250
|
+
return true; // Possibly multiple orderIds. If so, skip to next rule.
|
|
251
|
+
const cleanedOrderId = removeWhitespace(_orderId);
|
|
252
|
+
return hasExpectedLength(6, 8)(cleanedOrderId);
|
|
253
|
+
},
|
|
254
|
+
errorMessage: translations_1.PageText.Contact.input.orderId.errorMessages.invalidFormat.singleId,
|
|
255
|
+
},
|
|
256
|
+
{
|
|
257
|
+
validate: (_orderIdsString) => {
|
|
258
|
+
const orderIds = removeWhitespace(_orderIdsString).split(',');
|
|
259
|
+
return orderIds.every((orderId) => hasExpectedLength(6, 8)(orderId));
|
|
260
|
+
},
|
|
261
|
+
errorMessage: translations_1.PageText.Contact.input.orderId.errorMessages.invalidFormat.multipleIds,
|
|
262
|
+
},
|
|
263
|
+
];
|
|
264
|
+
const rulesRefundReason = [
|
|
265
|
+
{
|
|
266
|
+
validate: isNonEmptyString,
|
|
267
|
+
errorMessage: translations_1.PageText.Contact.input.refundReason.errorMessages.empty,
|
|
268
|
+
},
|
|
269
|
+
];
|
|
270
|
+
const rulesAmount = [
|
|
271
|
+
{
|
|
272
|
+
validate: isNonEmptyString,
|
|
273
|
+
errorMessage: translations_1.PageText.Contact.input.amount.errorMessages.empty,
|
|
274
|
+
},
|
|
275
|
+
];
|
|
276
|
+
const rulesTicketType = [
|
|
277
|
+
{
|
|
278
|
+
validate: (_ticketType) => isDefined(_ticketType),
|
|
279
|
+
errorMessage: translations_1.PageText.Contact.input.ticketType.errorMessages.empty,
|
|
280
|
+
},
|
|
281
|
+
];
|
|
282
|
+
const rulesAPurchasePlatform = [
|
|
283
|
+
{
|
|
284
|
+
validate: isNonEmptyString,
|
|
285
|
+
errorMessage: translations_1.PageText.Contact.input.purchasePlatform.errorMessages.empty,
|
|
286
|
+
},
|
|
287
|
+
];
|
|
288
|
+
const rulesAttachments = [
|
|
289
|
+
{
|
|
290
|
+
validate: (_fileInput) => isDefined(_fileInput),
|
|
291
|
+
errorMessage: translations_1.PageText.Contact.components.fileinput.errorMessages.empty,
|
|
292
|
+
},
|
|
293
|
+
];
|
|
294
|
+
const rulesAppPhoneNumber = [
|
|
295
|
+
{
|
|
296
|
+
validate: isNonEmptyString,
|
|
297
|
+
errorMessage: translations_1.PageText.Contact.input.appPhoneNumber.errorMessages.empty,
|
|
298
|
+
},
|
|
299
|
+
];
|
|
300
|
+
const rulesCustomerNumber = [
|
|
301
|
+
{
|
|
302
|
+
validate: isNonEmptyString,
|
|
303
|
+
errorMessage: translations_1.PageText.Contact.input.customerNumber.errorMessages.empty,
|
|
304
|
+
},
|
|
305
|
+
{
|
|
306
|
+
validate: isDigitsOnly,
|
|
307
|
+
errorMessage: translations_1.PageText.Contact.input.customerNumber.errorMessages.invalidFormat,
|
|
308
|
+
},
|
|
309
|
+
{
|
|
310
|
+
validate: hasExpectedLengthRange(7, 8),
|
|
311
|
+
errorMessage: translations_1.PageText.Contact.input.customerNumber.errorMessages.invalidFormat,
|
|
312
|
+
},
|
|
313
|
+
];
|
|
314
|
+
const rulesTravelCardNumber = [
|
|
315
|
+
{
|
|
316
|
+
validate: isNonEmptyString,
|
|
317
|
+
errorMessage: translations_1.PageText.Contact.input.travelCardNumber.errorMessages.empty,
|
|
318
|
+
},
|
|
319
|
+
{
|
|
320
|
+
validate: hasExpectedLength(9),
|
|
321
|
+
errorMessage: translations_1.PageText.Contact.input.travelCardNumber.errorMessages.invalidFormat,
|
|
322
|
+
},
|
|
323
|
+
{
|
|
324
|
+
validate: isDigitsOnly,
|
|
325
|
+
errorMessage: translations_1.PageText.Contact.input.travelCardNumber.errorMessages.invalidFormat,
|
|
326
|
+
},
|
|
327
|
+
];
|
|
328
|
+
const rulesIsResponseWanted = [
|
|
329
|
+
{
|
|
330
|
+
validate: (_isResponseWanted) => isDefined(_isResponseWanted),
|
|
331
|
+
errorMessage: translations_1.PageText.Contact.input.wantedResponse.errorMessages.undefined,
|
|
332
|
+
},
|
|
333
|
+
];
|
|
334
|
+
exports.validationRules = {
|
|
335
|
+
firstName: rulesFirstName,
|
|
336
|
+
lastName: rulesLastName,
|
|
337
|
+
email: rulesEmail,
|
|
338
|
+
address: rulesAddress,
|
|
339
|
+
postalCode: rulesPostalCode,
|
|
340
|
+
city: rulesCity,
|
|
341
|
+
phoneNumber: rulesPhoneNumber,
|
|
342
|
+
bankAccountNumber: rulesBankAccountNumber,
|
|
343
|
+
IBAN: rulesIBAN,
|
|
344
|
+
SWIFT: rulesSWIFT,
|
|
345
|
+
transportMode: rulesTransportMode,
|
|
346
|
+
line: rulesLine,
|
|
347
|
+
fromStop: rulesFromStop,
|
|
348
|
+
toStop: rulesToStop,
|
|
349
|
+
stop: rulesStop,
|
|
350
|
+
date: rulesDate,
|
|
351
|
+
dateOfTicketControl: rulesDateOfTicketControl,
|
|
352
|
+
timeOfTicketControl: rulesTimeOfTicketControl,
|
|
353
|
+
plannedDepartureTime: rulesPlannedDepartureTime,
|
|
354
|
+
reasonForTransportFailure: rulesReasonForTransportFailure,
|
|
355
|
+
feeNumber: rulesFeeNumber,
|
|
356
|
+
invoiceNumber: rulesInvoiceNumber,
|
|
357
|
+
feedback: rulesFeedback,
|
|
358
|
+
kilometersDriven: rulesKilometersDriven,
|
|
359
|
+
fromAddress: rulesFromAddress,
|
|
360
|
+
toAddress: rulesToAddress,
|
|
361
|
+
question: rulesQuestion,
|
|
362
|
+
orderId: rulesOrderId,
|
|
363
|
+
refundReason: rulesRefundReason,
|
|
364
|
+
amount: rulesAmount,
|
|
365
|
+
ticketType: rulesTicketType,
|
|
366
|
+
purchasePlatform: rulesAPurchasePlatform,
|
|
367
|
+
attachments: rulesAttachments,
|
|
368
|
+
appPhoneNumber: rulesAppPhoneNumber,
|
|
369
|
+
customerNumber: rulesCustomerNumber,
|
|
370
|
+
travelCardNumber: rulesTravelCardNumber,
|
|
371
|
+
isResponseWanted: rulesIsResponseWanted,
|
|
372
|
+
};
|