@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,435 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ticketingStateMachine = exports.TravelCardForm = exports.WebshopForm = exports.AppForm = exports.FormCategory = void 0;
|
|
4
|
+
exports.createTicketingStateMachine = createTicketingStateMachine;
|
|
5
|
+
const xstate_1 = require("xstate");
|
|
6
|
+
const events_1 = require("./events");
|
|
7
|
+
const validation_1 = require("../validation");
|
|
8
|
+
const utils_1 = require("../utils");
|
|
9
|
+
var FormCategory;
|
|
10
|
+
(function (FormCategory) {
|
|
11
|
+
FormCategory["PriceAndTicketTypes"] = "priceAndTicketTypes";
|
|
12
|
+
FormCategory["App"] = "app";
|
|
13
|
+
FormCategory["Webshop"] = "webshop";
|
|
14
|
+
FormCategory["TravelCard"] = "travelCard";
|
|
15
|
+
})(FormCategory || (exports.FormCategory = FormCategory = {}));
|
|
16
|
+
var AppForm;
|
|
17
|
+
(function (AppForm) {
|
|
18
|
+
AppForm["AppTicketing"] = "appTicketing";
|
|
19
|
+
AppForm["AppTravelSuggestion"] = "appTravelSuggestion";
|
|
20
|
+
AppForm["AppAccount"] = "appAccount";
|
|
21
|
+
})(AppForm || (exports.AppForm = AppForm = {}));
|
|
22
|
+
var WebshopForm;
|
|
23
|
+
(function (WebshopForm) {
|
|
24
|
+
WebshopForm["WebshopTicketing"] = "webshopTicketing";
|
|
25
|
+
WebshopForm["WebshopAccount"] = "webshopAccount";
|
|
26
|
+
})(WebshopForm || (exports.WebshopForm = WebshopForm = {}));
|
|
27
|
+
var TravelCardForm;
|
|
28
|
+
(function (TravelCardForm) {
|
|
29
|
+
TravelCardForm["OrderTravelCard"] = "orderTravelCard";
|
|
30
|
+
TravelCardForm["TravelCardQuestion"] = "travelCardQuestion";
|
|
31
|
+
})(TravelCardForm || (exports.TravelCardForm = TravelCardForm = {}));
|
|
32
|
+
var FormType;
|
|
33
|
+
(function (FormType) {
|
|
34
|
+
FormType["PriceAndTicketTypes"] = "priceAndTicketTypes";
|
|
35
|
+
FormType["AppTicketing"] = "appTicketing";
|
|
36
|
+
FormType["AppTravelSuggestion"] = "appTravelSuggestion";
|
|
37
|
+
FormType["AppAccount"] = "appAccount";
|
|
38
|
+
FormType["WebshopTicketing"] = "webshopTicketing";
|
|
39
|
+
FormType["WebshopAccount"] = "webshopAccount";
|
|
40
|
+
FormType["TravelCardQuestion"] = "travelCardQuestion";
|
|
41
|
+
FormType["OrderTravelCard"] = "orderTravelCard";
|
|
42
|
+
})(FormType || (FormType = {}));
|
|
43
|
+
const setInputsToValidate = (context) => {
|
|
44
|
+
const { formType, firstName, lastName, email, phoneNumber, question, orderId, customerNumber, travelCardNumber, } = context;
|
|
45
|
+
const commonFields = {
|
|
46
|
+
formType,
|
|
47
|
+
question,
|
|
48
|
+
firstName,
|
|
49
|
+
lastName,
|
|
50
|
+
email,
|
|
51
|
+
};
|
|
52
|
+
switch (formType) {
|
|
53
|
+
case FormType.PriceAndTicketTypes:
|
|
54
|
+
return {
|
|
55
|
+
...commonFields,
|
|
56
|
+
};
|
|
57
|
+
case FormType.AppTicketing:
|
|
58
|
+
return {
|
|
59
|
+
...commonFields,
|
|
60
|
+
orderId,
|
|
61
|
+
phoneNumber,
|
|
62
|
+
...(customerNumber && { customerNumber }),
|
|
63
|
+
};
|
|
64
|
+
case FormType.AppTravelSuggestion:
|
|
65
|
+
return {
|
|
66
|
+
...commonFields,
|
|
67
|
+
};
|
|
68
|
+
case FormType.AppAccount:
|
|
69
|
+
return {
|
|
70
|
+
...commonFields,
|
|
71
|
+
customerNumber,
|
|
72
|
+
phoneNumber,
|
|
73
|
+
};
|
|
74
|
+
case FormType.TravelCardQuestion:
|
|
75
|
+
return {
|
|
76
|
+
...commonFields,
|
|
77
|
+
travelCardNumber,
|
|
78
|
+
phoneNumber,
|
|
79
|
+
};
|
|
80
|
+
case FormType.WebshopTicketing:
|
|
81
|
+
return {
|
|
82
|
+
...commonFields,
|
|
83
|
+
...(customerNumber && { customerNumber }),
|
|
84
|
+
orderId,
|
|
85
|
+
phoneNumber,
|
|
86
|
+
};
|
|
87
|
+
case FormType.WebshopAccount:
|
|
88
|
+
return {
|
|
89
|
+
...commonFields,
|
|
90
|
+
...(customerNumber && { customerNumber }),
|
|
91
|
+
phoneNumber,
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
};
|
|
95
|
+
function createTicketingStateMachine(onSubmit, paths) {
|
|
96
|
+
const successPath = paths?.successPath ?? '/contact/success';
|
|
97
|
+
const errorPath = paths?.errorPath ?? '/contact/error';
|
|
98
|
+
return (0, xstate_1.setup)({
|
|
99
|
+
types: {
|
|
100
|
+
context: {},
|
|
101
|
+
events: events_1.ticketingFormEvents,
|
|
102
|
+
},
|
|
103
|
+
guards: {
|
|
104
|
+
isFormValid: ({ context }) => {
|
|
105
|
+
const inputsToValidate = setInputsToValidate(context);
|
|
106
|
+
const errors = (0, validation_1.commonInputValidator)(inputsToValidate);
|
|
107
|
+
return Object.keys(errors).length === 0;
|
|
108
|
+
},
|
|
109
|
+
isPriceAndTicketTypes: ({ event }) => event.type === 'SELECT_FORM_CATEGORY' &&
|
|
110
|
+
event.formCategory === FormCategory.PriceAndTicketTypes,
|
|
111
|
+
isApp: ({ event }) => event.type === 'SELECT_FORM_CATEGORY' &&
|
|
112
|
+
event.formCategory === FormCategory.App,
|
|
113
|
+
isTravelCard: ({ event }) => event.type === 'SELECT_FORM_CATEGORY' &&
|
|
114
|
+
event.formCategory === FormCategory.TravelCard,
|
|
115
|
+
isWebshop: ({ event }) => event.type === 'SELECT_FORM_CATEGORY' &&
|
|
116
|
+
event.formCategory === FormCategory.Webshop,
|
|
117
|
+
isAppAccount: ({ event }) => event.type === 'SELECT_APP_FORM' && event.appForm === AppForm.AppAccount,
|
|
118
|
+
isAppTicketing: ({ event }) => event.type === 'SELECT_APP_FORM' &&
|
|
119
|
+
event.appForm === AppForm.AppTicketing,
|
|
120
|
+
isAppTravelSuggestion: ({ event }) => event.type === 'SELECT_APP_FORM' &&
|
|
121
|
+
event.appForm === AppForm.AppTravelSuggestion,
|
|
122
|
+
isWebshopTicketing: ({ event }) => event.type === 'SELECT_WEBSHOP_FORM' &&
|
|
123
|
+
event.webshopForm === WebshopForm.WebshopTicketing,
|
|
124
|
+
isWebshopAccount: ({ event }) => event.type === 'SELECT_WEBSHOP_FORM' &&
|
|
125
|
+
event.webshopForm === WebshopForm.WebshopAccount,
|
|
126
|
+
isTravelCardQuestion: ({ event }) => event.type === 'SELECT_TRAVELCARD_FORM' &&
|
|
127
|
+
event.travelCardForm === TravelCardForm.TravelCardQuestion,
|
|
128
|
+
isOrderTravelCard: ({ event }) => event.type === 'SELECT_TRAVELCARD_FORM' &&
|
|
129
|
+
event.travelCardForm === TravelCardForm.OrderTravelCard,
|
|
130
|
+
},
|
|
131
|
+
actions: {
|
|
132
|
+
navigateToErrorPage: () => {
|
|
133
|
+
window.location.href = errorPath;
|
|
134
|
+
},
|
|
135
|
+
navigateToSuccessPage: () => {
|
|
136
|
+
window.location.href = successPath;
|
|
137
|
+
},
|
|
138
|
+
setFormTypeToUndefined: (0, xstate_1.assign)({
|
|
139
|
+
formType: () => undefined,
|
|
140
|
+
}),
|
|
141
|
+
clearValidationErrors: (0, xstate_1.assign)({ errorMessages: {} }),
|
|
142
|
+
setValidationErrors: (0, xstate_1.assign)(({ context, event }) => {
|
|
143
|
+
if (event.type === 'SUBMIT') {
|
|
144
|
+
const inputsToValidate = setInputsToValidate(context);
|
|
145
|
+
const errors = (0, validation_1.commonInputValidator)(inputsToValidate);
|
|
146
|
+
return {
|
|
147
|
+
firstIncorrectErrorMessage: (0, utils_1.findFirstErrorMessage)(event.orderedFormFieldNames, errors),
|
|
148
|
+
errorMessages: { ...errors },
|
|
149
|
+
};
|
|
150
|
+
}
|
|
151
|
+
return context;
|
|
152
|
+
}),
|
|
153
|
+
scrollToFirstErrorMessage: (0, xstate_1.assign)(({ context }) => {
|
|
154
|
+
(0, utils_1.scrollToFirstErrorMessage)(context.firstIncorrectErrorMessage);
|
|
155
|
+
return context;
|
|
156
|
+
}),
|
|
157
|
+
setSubmissionError: (0, xstate_1.assign)({
|
|
158
|
+
hasSubmissionError: () => true,
|
|
159
|
+
}),
|
|
160
|
+
clearSubmissionError: (0, xstate_1.assign)({
|
|
161
|
+
hasSubmissionError: () => undefined,
|
|
162
|
+
}),
|
|
163
|
+
onInputChange: (0, xstate_1.assign)(({ context, event }) => {
|
|
164
|
+
if (event.type === 'ON_INPUT_CHANGE') {
|
|
165
|
+
const { inputName, value } = event;
|
|
166
|
+
context.errorMessages[inputName] = [];
|
|
167
|
+
if (inputName === 'isInitialAgreementChecked' && !value) {
|
|
168
|
+
return {
|
|
169
|
+
...context,
|
|
170
|
+
isInitialAgreementChecked: false,
|
|
171
|
+
formType: undefined,
|
|
172
|
+
hasSubmissionError: undefined,
|
|
173
|
+
};
|
|
174
|
+
}
|
|
175
|
+
if (inputName === 'hasInternationalBankAccount') {
|
|
176
|
+
const updatedContext = (0, utils_1.setBankAccountStatusAndResetBankInformation)(context, value);
|
|
177
|
+
return {
|
|
178
|
+
...updatedContext,
|
|
179
|
+
hasSubmissionError: undefined,
|
|
180
|
+
};
|
|
181
|
+
}
|
|
182
|
+
return {
|
|
183
|
+
...context,
|
|
184
|
+
[inputName]: value,
|
|
185
|
+
hasSubmissionError: undefined,
|
|
186
|
+
};
|
|
187
|
+
}
|
|
188
|
+
return context;
|
|
189
|
+
}),
|
|
190
|
+
},
|
|
191
|
+
actors: {
|
|
192
|
+
submit: (0, xstate_1.fromPromise)(async ({ input: actorInput }) => {
|
|
193
|
+
const base64EncodedAttachments = await (0, utils_1.convertFilesToBase64)(actorInput.attachments || []);
|
|
194
|
+
const state = {
|
|
195
|
+
...actorInput,
|
|
196
|
+
attachments: base64EncodedAttachments,
|
|
197
|
+
};
|
|
198
|
+
const response = await onSubmit('ticketing', state);
|
|
199
|
+
if (!response.ok) {
|
|
200
|
+
throw new Error('Failed to call API');
|
|
201
|
+
}
|
|
202
|
+
return response.ok;
|
|
203
|
+
}),
|
|
204
|
+
},
|
|
205
|
+
}).createMachine({
|
|
206
|
+
id: 'ticketingStateMachine',
|
|
207
|
+
initial: 'editing',
|
|
208
|
+
context: {
|
|
209
|
+
hasInternationalBankAccount: false,
|
|
210
|
+
isInitialAgreementChecked: false,
|
|
211
|
+
showInputTravelCardNumber: true,
|
|
212
|
+
errorMessages: {},
|
|
213
|
+
},
|
|
214
|
+
on: {
|
|
215
|
+
ON_INPUT_CHANGE: {
|
|
216
|
+
actions: 'onInputChange',
|
|
217
|
+
},
|
|
218
|
+
SELECT_FORM_CATEGORY: {
|
|
219
|
+
target: '#formCategoryHandler',
|
|
220
|
+
},
|
|
221
|
+
SELECT_APP_FORM: {
|
|
222
|
+
target: '#appFormHandler',
|
|
223
|
+
},
|
|
224
|
+
SELECT_WEBSHOP_FORM: {
|
|
225
|
+
target: '#webshopFormHandler',
|
|
226
|
+
},
|
|
227
|
+
SELECT_TRAVELCARD_FORM: {
|
|
228
|
+
target: '#travelCardFormHandler',
|
|
229
|
+
},
|
|
230
|
+
SUBMIT: { target: '#validating' },
|
|
231
|
+
},
|
|
232
|
+
states: {
|
|
233
|
+
formCategoryHandler: {
|
|
234
|
+
id: 'formCategoryHandler',
|
|
235
|
+
always: [
|
|
236
|
+
{
|
|
237
|
+
guard: 'isPriceAndTicketTypes',
|
|
238
|
+
target: `#${FormCategory.PriceAndTicketTypes}`,
|
|
239
|
+
},
|
|
240
|
+
{
|
|
241
|
+
guard: 'isApp',
|
|
242
|
+
target: `#${FormCategory.App}`,
|
|
243
|
+
},
|
|
244
|
+
{
|
|
245
|
+
guard: 'isTravelCard',
|
|
246
|
+
target: `#${FormCategory.TravelCard}`,
|
|
247
|
+
},
|
|
248
|
+
{
|
|
249
|
+
guard: 'isWebshop',
|
|
250
|
+
target: `#${FormCategory.Webshop}`,
|
|
251
|
+
},
|
|
252
|
+
],
|
|
253
|
+
},
|
|
254
|
+
appFormHandler: {
|
|
255
|
+
id: 'appFormHandler',
|
|
256
|
+
always: [
|
|
257
|
+
{
|
|
258
|
+
guard: 'isAppAccount',
|
|
259
|
+
target: `#${AppForm.AppAccount}`,
|
|
260
|
+
},
|
|
261
|
+
{
|
|
262
|
+
guard: 'isAppTicketing',
|
|
263
|
+
target: `#${AppForm.AppTicketing}`,
|
|
264
|
+
},
|
|
265
|
+
{
|
|
266
|
+
guard: 'isAppTravelSuggestion',
|
|
267
|
+
target: `#${AppForm.AppTravelSuggestion}`,
|
|
268
|
+
},
|
|
269
|
+
],
|
|
270
|
+
},
|
|
271
|
+
webshopFormHandler: {
|
|
272
|
+
id: 'webshopFormHandler',
|
|
273
|
+
always: [
|
|
274
|
+
{
|
|
275
|
+
guard: 'isWebshopTicketing',
|
|
276
|
+
target: `#${WebshopForm.WebshopTicketing}`,
|
|
277
|
+
},
|
|
278
|
+
{
|
|
279
|
+
guard: 'isWebshopAccount',
|
|
280
|
+
target: `#${WebshopForm.WebshopAccount}`,
|
|
281
|
+
},
|
|
282
|
+
],
|
|
283
|
+
},
|
|
284
|
+
travelCardFormHandler: {
|
|
285
|
+
id: 'travelCardFormHandler',
|
|
286
|
+
always: [
|
|
287
|
+
{
|
|
288
|
+
guard: 'isTravelCardQuestion',
|
|
289
|
+
target: `#${TravelCardForm.TravelCardQuestion}`,
|
|
290
|
+
},
|
|
291
|
+
{
|
|
292
|
+
guard: 'isOrderTravelCard',
|
|
293
|
+
target: `#${TravelCardForm.OrderTravelCard}`,
|
|
294
|
+
},
|
|
295
|
+
],
|
|
296
|
+
},
|
|
297
|
+
editing: {
|
|
298
|
+
initial: 'selectFormCategory',
|
|
299
|
+
states: {
|
|
300
|
+
selectFormCategory: {},
|
|
301
|
+
priceAndTicketTypes: {
|
|
302
|
+
id: 'priceAndTicketTypes',
|
|
303
|
+
entry: (0, xstate_1.assign)({
|
|
304
|
+
formType: () => FormType.PriceAndTicketTypes,
|
|
305
|
+
}),
|
|
306
|
+
exit: 'clearValidationErrors',
|
|
307
|
+
},
|
|
308
|
+
app: {
|
|
309
|
+
id: 'app',
|
|
310
|
+
initial: 'selectAppForm',
|
|
311
|
+
entry: 'setFormTypeToUndefined',
|
|
312
|
+
exit: 'clearValidationErrors',
|
|
313
|
+
states: {
|
|
314
|
+
selectAppForm: {},
|
|
315
|
+
appAccount: {
|
|
316
|
+
id: 'appAccount',
|
|
317
|
+
entry: (0, xstate_1.assign)({
|
|
318
|
+
formType: () => FormType.AppAccount,
|
|
319
|
+
}),
|
|
320
|
+
},
|
|
321
|
+
appTicketing: {
|
|
322
|
+
id: 'appTicketing',
|
|
323
|
+
entry: (0, xstate_1.assign)({
|
|
324
|
+
formType: () => FormType.AppTicketing,
|
|
325
|
+
}),
|
|
326
|
+
},
|
|
327
|
+
appTravelSuggestion: {
|
|
328
|
+
id: 'appTravelSuggestion',
|
|
329
|
+
entry: (0, xstate_1.assign)({
|
|
330
|
+
formType: () => FormType.AppTravelSuggestion,
|
|
331
|
+
}),
|
|
332
|
+
},
|
|
333
|
+
},
|
|
334
|
+
},
|
|
335
|
+
travelCard: {
|
|
336
|
+
id: 'travelCard',
|
|
337
|
+
initial: 'selectTravelCardForm',
|
|
338
|
+
entry: 'setFormTypeToUndefined',
|
|
339
|
+
exit: 'clearValidationErrors',
|
|
340
|
+
states: {
|
|
341
|
+
selectTravelCardForm: {},
|
|
342
|
+
travelCardQuestion: {
|
|
343
|
+
id: 'travelCardQuestion',
|
|
344
|
+
entry: (0, xstate_1.assign)({
|
|
345
|
+
formType: () => FormType.TravelCardQuestion,
|
|
346
|
+
}),
|
|
347
|
+
},
|
|
348
|
+
orderTravelCard: {
|
|
349
|
+
id: 'orderTravelCard',
|
|
350
|
+
entry: (0, xstate_1.assign)({
|
|
351
|
+
formType: () => FormType.OrderTravelCard,
|
|
352
|
+
}),
|
|
353
|
+
},
|
|
354
|
+
},
|
|
355
|
+
},
|
|
356
|
+
webshop: {
|
|
357
|
+
id: 'webshop',
|
|
358
|
+
initial: 'selectWebshopForm',
|
|
359
|
+
entry: 'setFormTypeToUndefined',
|
|
360
|
+
exit: 'clearValidationErrors',
|
|
361
|
+
states: {
|
|
362
|
+
selectWebshopForm: {},
|
|
363
|
+
webshopTicketing: {
|
|
364
|
+
id: 'webshopTicketing',
|
|
365
|
+
entry: (0, xstate_1.assign)({
|
|
366
|
+
formType: () => FormType.WebshopTicketing,
|
|
367
|
+
}),
|
|
368
|
+
},
|
|
369
|
+
webshopAccount: {
|
|
370
|
+
id: 'webshopAccount',
|
|
371
|
+
entry: (0, xstate_1.assign)({
|
|
372
|
+
formType: () => FormType.WebshopAccount,
|
|
373
|
+
}),
|
|
374
|
+
},
|
|
375
|
+
},
|
|
376
|
+
},
|
|
377
|
+
history: {
|
|
378
|
+
type: 'history',
|
|
379
|
+
history: 'deep',
|
|
380
|
+
},
|
|
381
|
+
},
|
|
382
|
+
},
|
|
383
|
+
validating: {
|
|
384
|
+
id: 'validating',
|
|
385
|
+
always: [
|
|
386
|
+
{
|
|
387
|
+
guard: 'isFormValid',
|
|
388
|
+
target: '#submitting',
|
|
389
|
+
},
|
|
390
|
+
{
|
|
391
|
+
actions: ['setValidationErrors', 'scrollToFirstErrorMessage'],
|
|
392
|
+
target: 'editing.history',
|
|
393
|
+
},
|
|
394
|
+
],
|
|
395
|
+
},
|
|
396
|
+
submitting: {
|
|
397
|
+
id: 'submitting',
|
|
398
|
+
invoke: {
|
|
399
|
+
src: 'submit',
|
|
400
|
+
input: ({ context }) => ({
|
|
401
|
+
formType: context.formType,
|
|
402
|
+
attachments: context.attachments,
|
|
403
|
+
firstName: context.firstName,
|
|
404
|
+
lastName: context.lastName,
|
|
405
|
+
email: context.email,
|
|
406
|
+
phoneNumber: context.phoneNumber,
|
|
407
|
+
address: context.address,
|
|
408
|
+
question: context.question,
|
|
409
|
+
orderId: context.orderId,
|
|
410
|
+
customerNumber: context.customerNumber,
|
|
411
|
+
travelCardNumber: context.travelCardNumber,
|
|
412
|
+
ticketType: context.ticketType,
|
|
413
|
+
}),
|
|
414
|
+
onDone: {
|
|
415
|
+
target: 'success',
|
|
416
|
+
},
|
|
417
|
+
onError: {
|
|
418
|
+
target: 'editing.history',
|
|
419
|
+
actions: 'setSubmissionError',
|
|
420
|
+
},
|
|
421
|
+
},
|
|
422
|
+
},
|
|
423
|
+
success: {
|
|
424
|
+
entry: 'navigateToSuccessPage',
|
|
425
|
+
type: 'final',
|
|
426
|
+
},
|
|
427
|
+
},
|
|
428
|
+
});
|
|
429
|
+
}
|
|
430
|
+
exports.ticketingStateMachine = createTicketingStateMachine(async (data) => {
|
|
431
|
+
return fetch('/api/contact/ticketing', {
|
|
432
|
+
method: 'POST',
|
|
433
|
+
body: JSON.stringify(data),
|
|
434
|
+
});
|
|
435
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.test.d.ts","sourceRoot":"","sources":["../../../src/translations/__tests__/utils.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const vitest_1 = require("vitest");
|
|
4
|
+
const utils_1 = require("../utils");
|
|
5
|
+
const commons_1 = require("../commons");
|
|
6
|
+
(0, vitest_1.describe)('orgSpecificTranslations', () => {
|
|
7
|
+
(0, vitest_1.test)('should override specific fields when specifying one org', () => {
|
|
8
|
+
const TitlesInternal = {
|
|
9
|
+
title: (0, commons_1.translation)('A', 'A', 'A'),
|
|
10
|
+
};
|
|
11
|
+
const Titles = (0, utils_1.orgSpecificTranslations)(TitlesInternal, {
|
|
12
|
+
nfk: {
|
|
13
|
+
title: (0, commons_1.translation)('B', 'B', 'B'),
|
|
14
|
+
},
|
|
15
|
+
}, 'nfk');
|
|
16
|
+
(0, vitest_1.expect)(Titles.title.no).toEqual('B');
|
|
17
|
+
});
|
|
18
|
+
(0, vitest_1.test)('should override specific fields for multiple orgs', () => {
|
|
19
|
+
const TitlesInternal = {
|
|
20
|
+
title: (0, commons_1.translation)('A', 'A', 'A'),
|
|
21
|
+
};
|
|
22
|
+
const overrides = {
|
|
23
|
+
nfk: {
|
|
24
|
+
title: (0, commons_1.translation)('B', 'B', 'B'),
|
|
25
|
+
},
|
|
26
|
+
fram: {
|
|
27
|
+
title: (0, commons_1.translation)('C', 'C', 'C'),
|
|
28
|
+
},
|
|
29
|
+
};
|
|
30
|
+
const TitlesNfk = (0, utils_1.orgSpecificTranslations)(TitlesInternal, overrides, 'nfk');
|
|
31
|
+
const TitlesFram = (0, utils_1.orgSpecificTranslations)(TitlesInternal, overrides, 'fram');
|
|
32
|
+
(0, vitest_1.expect)(TitlesNfk.title.no).toEqual('B');
|
|
33
|
+
(0, vitest_1.expect)(TitlesFram.title.no).toEqual('C');
|
|
34
|
+
});
|
|
35
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/translations/common/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,MAAM,EAAC,MAAM,UAAU,CAAC;AAChC,OAAO,EAAC,MAAM,EAAC,MAAM,UAAU,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Layout = exports.Titles = void 0;
|
|
4
|
+
var titles_1 = require("./titles");
|
|
5
|
+
Object.defineProperty(exports, "Titles", { enumerable: true, get: function () { return titles_1.Titles; } });
|
|
6
|
+
var layout_1 = require("./layout");
|
|
7
|
+
Object.defineProperty(exports, "Layout", { enumerable: true, get: function () { return layout_1.Layout; } });
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare const Layout: {
|
|
2
|
+
homeLink: (name: string) => import("../../translations/commons").TranslatedString;
|
|
3
|
+
contactLink: import("../../translations/commons").TranslatedString;
|
|
4
|
+
meta: {
|
|
5
|
+
defaultDescription: import("../../translations/commons").TranslatedString;
|
|
6
|
+
};
|
|
7
|
+
};
|
|
8
|
+
//# sourceMappingURL=layout.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"layout.d.ts","sourceRoot":"","sources":["../../../src/translations/common/layout.ts"],"names":[],"mappings":"AAkBA,eAAO,MAAM,MAAM;qBAdE,MAAM;;;;;CA4DzB,CAAC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Layout = void 0;
|
|
4
|
+
const commons_1 = require("../../translations/commons");
|
|
5
|
+
const utils_1 = require("../utils");
|
|
6
|
+
const LayoutInternal = {
|
|
7
|
+
homeLink: (name) => (0, commons_1.translation)(`Gå til ${name}`, `Go to ${name}`, `Gå til ${name}`),
|
|
8
|
+
contactLink: (0, commons_1.translation)('Kontaktskjema', 'Contact form', 'Kontaktskjema'),
|
|
9
|
+
meta: {
|
|
10
|
+
defaultDescription: (0, commons_1.translation)('Finn rutetider, holdeplasser og tilbud for buss, trikk, båt og tog i Trøndelag med reiseplanleggeren.', 'Find timetables, stops and offers for bus, tram, boat and train in Trøndelag with the travel planner.', 'Finn rutetider, haldeplassar og tilbod for buss, trikk, båt og tog i Trøndelag med reiseplanleggaren.'),
|
|
11
|
+
},
|
|
12
|
+
};
|
|
13
|
+
exports.Layout = (0, utils_1.orgSpecificTranslations)(LayoutInternal, {
|
|
14
|
+
nfk: {
|
|
15
|
+
meta: {
|
|
16
|
+
defaultDescription: (0, commons_1.translation)('Finn rutetider, holdeplasser og tilbud for buss, båt og tog i Nordland med reiseplanleggeren.', 'Find timetables, stops and offers for bus, boat and train in Nordland with the travel planner.', 'Finn rutetider, haldeplassar og tilbod for buss, båt og tog i Nordland med reiseplanleggaren.'),
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
fram: {
|
|
20
|
+
meta: {
|
|
21
|
+
defaultDescription: (0, commons_1.translation)('Finn rutetider, holdeplasser, kaier og tilbud for buss, hurtigbåt og ferge i Møre og Romsdal med reiseplanleggeren.', 'Find timetables, stops and offers for bus, boat and ferry in Møre og Romsdal with the travel planner.', 'Finn rutetider, haldeplassar, kaier og tilbod for buss, hurtigbåt og ferje i Møre og Romsdal med reiseplanleggaren.'),
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
troms: {
|
|
25
|
+
meta: {
|
|
26
|
+
defaultDescription: (0, commons_1.translation)('Finn rutetider, holdeplasser, kaier og tilbud for buss, hurtigbåt og ferge i Troms med reiseplanleggeren.', 'Find timetables, stops and offers for bus, boat and ferry in Troms with the travel planner.', 'Finn rutetider, haldeplassar, kaier og tilbod for buss, hurtigbåt og ferje i Troms med reiseplanleggaren.'),
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
vkt: {
|
|
30
|
+
meta: {
|
|
31
|
+
defaultDescription: (0, commons_1.translation)('Finn rutetider, holdeplasser, kaier og tilbud for buss, hurtigbåt og ferge i Vestfold med reiseplanleggeren.', 'Find timetables, stops and offers for bus, boat and ferry in Vestfold with the travel planner.', 'Finn rutetider, haldeplassar, kaier og tilbod for buss, hurtigbåt og ferje i Vestfold med reiseplanleggaren.'),
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
farte: {
|
|
35
|
+
meta: {
|
|
36
|
+
defaultDescription: (0, commons_1.translation)('Finn rutetider, holdeplasser, kaier og tilbud for buss, hurtigbåt og ferge i Telemark med reiseplanleggeren.', 'Find timetables, stops and offers for bus, boat and ferry in Telemark with the travel planner.', 'Finn rutetider, haldeplassar, kaier og tilbod for buss, hurtigbåt og ferje i Telemark med reiseplanleggaren.'),
|
|
37
|
+
},
|
|
38
|
+
},
|
|
39
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"titles.d.ts","sourceRoot":"","sources":["../../../src/translations/common/titles.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,MAAM;;CA4BjB,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Titles = void 0;
|
|
4
|
+
const commons_1 = require("../../translations/commons");
|
|
5
|
+
const utils_1 = require("../utils");
|
|
6
|
+
const TitlesInternal = {
|
|
7
|
+
siteTitle: (0, commons_1.translation)('AtB Reisesøk', 'AtB Travel Search', 'AtB Reisesøk'),
|
|
8
|
+
};
|
|
9
|
+
exports.Titles = (0, utils_1.orgSpecificTranslations)(TitlesInternal, {
|
|
10
|
+
nfk: {
|
|
11
|
+
siteTitle: (0, commons_1.translation)('Reis Reisesøk', 'Reis Travel Search', 'Reis Reisesøk'),
|
|
12
|
+
},
|
|
13
|
+
fram: {
|
|
14
|
+
siteTitle: (0, commons_1.translation)('FRAM Reiseplanlegger', 'FRAM Travel Search', 'FRAM Reiseplanleggar'),
|
|
15
|
+
},
|
|
16
|
+
troms: {
|
|
17
|
+
siteTitle: (0, commons_1.translation)('Svipper Reisesøk', 'Svipper Travel Search', 'Svipper Reisesøk'),
|
|
18
|
+
},
|
|
19
|
+
vkt: {
|
|
20
|
+
siteTitle: (0, commons_1.translation)('Vestfold Kollektivtrafikk Reisesøk', 'Vestfold Kollektivtrafikk Travel Search', 'Vestfold Kollektivtrafikk Reisesøk'),
|
|
21
|
+
},
|
|
22
|
+
farte: {
|
|
23
|
+
siteTitle: (0, commons_1.translation)('Farte Reisesøk', 'Farte Travel Search', 'Farte Reisesøk'),
|
|
24
|
+
},
|
|
25
|
+
});
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { TFunc } from '@leile/lobo-t';
|
|
2
|
+
import type { Translatable } from '@leile/lobo-t';
|
|
3
|
+
export declare enum Language {
|
|
4
|
+
Norwegian = "no",
|
|
5
|
+
English = "en-US",
|
|
6
|
+
Nynorsk = "nn"
|
|
7
|
+
}
|
|
8
|
+
export declare const appLanguages: readonly Language[];
|
|
9
|
+
export declare const DEFAULT_LANGUAGE = Language.Norwegian;
|
|
10
|
+
export declare const DEFAULT_LANGUAGE_STRING = "no";
|
|
11
|
+
export declare const FALLBACK_LANGUAGE = Language.English;
|
|
12
|
+
export type TranslatedString = Translatable<typeof Language, string>;
|
|
13
|
+
export type TranslateFunction = TFunc<typeof Language>;
|
|
14
|
+
export declare function translation(norwegian: string, english: string, nynorsk: string): TranslatedString;
|
|
15
|
+
export declare function isTranslatedString(a: any): a is TranslatedString;
|
|
16
|
+
export type LocalizedString = {
|
|
17
|
+
lang: 'nob' | 'eng' | 'nno';
|
|
18
|
+
value: string;
|
|
19
|
+
};
|
|
20
|
+
export declare function convertLocalizedString(language: Language, localizedStrings: LocalizedString[]): string | undefined;
|
|
21
|
+
//# sourceMappingURL=commons.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"commons.d.ts","sourceRoot":"","sources":["../../src/translations/commons.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,KAAK,EAAC,MAAM,eAAe,CAAC;AAEpC,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,eAAe,CAAC;AAEhD,oBAAY,QAAQ;IAChB,SAAS,OAAO;IAChB,OAAO,UAAU;IACjB,OAAO,OAAO;CACjB;AAED,eAAO,MAAM,YAAY,EAAE,SAAS,QAAQ,EAIlC,CAAC;AAEX,eAAO,MAAM,gBAAgB,qBAAqB,CAAC;AACnD,eAAO,MAAM,uBAAuB,OAAO,CAAC;AAC5C,eAAO,MAAM,iBAAiB,mBAAmB,CAAC;AAClD,MAAM,MAAM,gBAAgB,GAAG,YAAY,CAAC,OAAO,QAAQ,EAAE,MAAM,CAAC,CAAC;AAErE,MAAM,MAAM,iBAAiB,GAAG,KAAK,CAAC,OAAO,QAAQ,CAAC,CAAC;AAEvD,wBAAgB,WAAW,CACvB,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,MAAM,GAChB,gBAAgB,CAMlB;AAED,wBAAgB,kBAAkB,CAAC,CAAC,EAAE,GAAG,GAAG,CAAC,IAAI,gBAAgB,CAEhE;AAED,MAAM,MAAM,eAAe,GAAG;IAC1B,IAAI,EAAE,KAAK,GAAG,KAAK,GAAG,KAAK,CAAC;IAC5B,KAAK,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,wBAAgB,sBAAsB,CAClC,QAAQ,EAAE,QAAQ,EAClB,gBAAgB,EAAE,eAAe,EAAE,GACpC,MAAM,GAAG,SAAS,CASpB"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FALLBACK_LANGUAGE = exports.DEFAULT_LANGUAGE_STRING = exports.DEFAULT_LANGUAGE = exports.appLanguages = exports.Language = void 0;
|
|
4
|
+
exports.translation = translation;
|
|
5
|
+
exports.isTranslatedString = isTranslatedString;
|
|
6
|
+
exports.convertLocalizedString = convertLocalizedString;
|
|
7
|
+
var Language;
|
|
8
|
+
(function (Language) {
|
|
9
|
+
Language["Norwegian"] = "no";
|
|
10
|
+
Language["English"] = "en-US";
|
|
11
|
+
Language["Nynorsk"] = "nn";
|
|
12
|
+
})(Language || (exports.Language = Language = {}));
|
|
13
|
+
exports.appLanguages = [
|
|
14
|
+
Language.Norwegian,
|
|
15
|
+
Language.English,
|
|
16
|
+
Language.Nynorsk,
|
|
17
|
+
];
|
|
18
|
+
exports.DEFAULT_LANGUAGE = Language.Norwegian;
|
|
19
|
+
exports.DEFAULT_LANGUAGE_STRING = 'no';
|
|
20
|
+
exports.FALLBACK_LANGUAGE = Language.English;
|
|
21
|
+
function translation(norwegian, english, nynorsk) {
|
|
22
|
+
return {
|
|
23
|
+
[Language.Norwegian]: norwegian,
|
|
24
|
+
[Language.English]: english,
|
|
25
|
+
[Language.Nynorsk]: nynorsk,
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
function isTranslatedString(a) {
|
|
29
|
+
return typeof a[Language.Norwegian] !== 'undefined';
|
|
30
|
+
}
|
|
31
|
+
function convertLocalizedString(language, localizedStrings) {
|
|
32
|
+
const messageLanguages = {
|
|
33
|
+
nob: 'no',
|
|
34
|
+
eng: 'en-US',
|
|
35
|
+
nno: 'nn',
|
|
36
|
+
};
|
|
37
|
+
return localizedStrings.find((ls) => messageLanguages[ls.lang] === language)
|
|
38
|
+
?.value;
|
|
39
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"clear-button.d.ts","sourceRoot":"","sources":["../../../src/translations/components/clear-button.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,WAAW;;CAEvB,CAAC"}
|