@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,53 @@
|
|
|
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
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
7
|
+
const translations_1 = require("../translations");
|
|
8
|
+
const react_1 = require("@xstate/react");
|
|
9
|
+
const react_2 = require("react");
|
|
10
|
+
const config_1 = require("../modules/config");
|
|
11
|
+
const ticket_control_form_machine_1 = require("./ticket-control-form-machine");
|
|
12
|
+
const contact_module_css_1 = __importDefault(require("../contact.module.css"));
|
|
13
|
+
const button_1 = require("../components/button");
|
|
14
|
+
const feeComplaintForm_1 = __importDefault(require("./forms/feeComplaintForm"));
|
|
15
|
+
const feedbackForm_1 = __importDefault(require("./forms/feedbackForm"));
|
|
16
|
+
const postponePayment_1 = __importDefault(require("./forms/postponePayment"));
|
|
17
|
+
const components_1 = require("../components");
|
|
18
|
+
const utils_1 = require("../utils");
|
|
19
|
+
const error_message_1 = __importDefault(require("../components/error-message/error-message"));
|
|
20
|
+
const TicketControlPageContent = () => {
|
|
21
|
+
const { t } = (0, translations_1.useTranslation)();
|
|
22
|
+
const apiConfig = (0, config_1.useApiConfig)();
|
|
23
|
+
const { formSchemaOverrides, layout } = (0, config_1.useContactFormConfig)();
|
|
24
|
+
const successPath = layout?.successPath ?? (layout?.basePath ? `${layout.basePath}/success` : '/contact/success');
|
|
25
|
+
const errorPath = layout?.errorPath ?? (layout?.basePath ? `${layout.basePath}/error` : '/contact/error');
|
|
26
|
+
const machine = (0, react_2.useMemo)(() => (0, ticket_control_form_machine_1.createTicketControlFormMachine)(apiConfig.onSubmit, {
|
|
27
|
+
successPath,
|
|
28
|
+
errorPath,
|
|
29
|
+
}), [apiConfig.onSubmit, successPath, errorPath]);
|
|
30
|
+
const [state, send] = (0, react_1.useMachine)(machine);
|
|
31
|
+
const displaySubmitButton = (state.context.formType === 'feeComplaint' &&
|
|
32
|
+
state.context.agreesSecondAgreement) ||
|
|
33
|
+
(state.context.formType && state.context.formType !== 'feeComplaint');
|
|
34
|
+
// Filter form types based on overrides
|
|
35
|
+
const enabledFormTypes = (0, react_2.useMemo)(() => {
|
|
36
|
+
const allTypes = Object.values(ticket_control_form_machine_1.FormType);
|
|
37
|
+
const override = formSchemaOverrides?.ticketControl?.enabledFormTypes;
|
|
38
|
+
if (!override)
|
|
39
|
+
return allTypes;
|
|
40
|
+
return allTypes.filter((type) => override.includes(type));
|
|
41
|
+
}, [formSchemaOverrides]);
|
|
42
|
+
const onSubmit = async (e) => {
|
|
43
|
+
e.preventDefault();
|
|
44
|
+
send({ type: 'SUBMIT', orderedFormFieldNames: (0, utils_1.findOrderFormFields)(e) });
|
|
45
|
+
};
|
|
46
|
+
return ((0, jsx_runtime_1.jsxs)("form", { onSubmit: onSubmit, className: contact_module_css_1.default.form, children: [(0, jsx_runtime_1.jsx)(components_1.Fieldset, { title: t(translations_1.PageText.Contact.ticketControl.title), children: (0, jsx_runtime_1.jsx)("ul", { className: contact_module_css_1.default.form_options__list, children: enabledFormTypes.map((formType) => ((0, jsx_runtime_1.jsx)("li", { children: (0, jsx_runtime_1.jsx)(components_1.Radio, { label: t(translations_1.PageText.Contact.ticketControl[formType].description), checked: state.matches({ editing: formType }), onChange: () => {
|
|
47
|
+
send({
|
|
48
|
+
type: 'SELECT_FORM_TYPE',
|
|
49
|
+
formType: formType,
|
|
50
|
+
});
|
|
51
|
+
} }) }, formType))) }) }), state.matches({ editing: 'feeComplaint' }) && ((0, jsx_runtime_1.jsx)(feeComplaintForm_1.default, { state: state, send: send })), state.matches({ editing: 'feedback' }) && ((0, jsx_runtime_1.jsx)(feedbackForm_1.default, { state: state, send: send })), state.matches({ editing: 'postponePayment' }) && ((0, jsx_runtime_1.jsx)(postponePayment_1.default, { state: state, send: send })), state.context.hasSubmissionError && ((0, jsx_runtime_1.jsx)(error_message_1.default, { message: t(translations_1.PageText.Contact.error.info), id: "submission-error" })), displaySubmitButton && ((0, jsx_runtime_1.jsx)(button_1.Button, { title: t(translations_1.PageText.Contact.submit), mode: 'interactive_0--bordered', buttonProps: { type: 'submit' }, state: state.matches('submitting') ? 'loading' : undefined, className: contact_module_css_1.default.submitButton }))] }));
|
|
52
|
+
};
|
|
53
|
+
exports.default = TicketControlPageContent;
|
|
@@ -0,0 +1,277 @@
|
|
|
1
|
+
import { Line } from '../server/journey-planner/validators';
|
|
2
|
+
import { InputErrorMessages } from '../validation';
|
|
3
|
+
import { TransportModeType } from '../types';
|
|
4
|
+
import type { FormSchemaName } from '../modules/config/types';
|
|
5
|
+
export declare enum FormType {
|
|
6
|
+
FeeComplaint = "feeComplaint",
|
|
7
|
+
Feedback = "feedback",
|
|
8
|
+
PostponePayment = "postponePayment"
|
|
9
|
+
}
|
|
10
|
+
type SubmitInput = {
|
|
11
|
+
feeNumber?: string;
|
|
12
|
+
appPhoneNumber?: string;
|
|
13
|
+
customerNumber?: string;
|
|
14
|
+
travelCardNumber?: string;
|
|
15
|
+
firstName?: string;
|
|
16
|
+
lastName?: string;
|
|
17
|
+
address?: string;
|
|
18
|
+
postalCode?: string;
|
|
19
|
+
city?: string;
|
|
20
|
+
email?: string;
|
|
21
|
+
phoneNumber?: string;
|
|
22
|
+
bankAccountNumber?: string;
|
|
23
|
+
IBAN?: string;
|
|
24
|
+
SWIFT?: string;
|
|
25
|
+
attachments?: File[];
|
|
26
|
+
transportMode?: string;
|
|
27
|
+
lineName?: string;
|
|
28
|
+
fromStop?: string;
|
|
29
|
+
toStop?: string;
|
|
30
|
+
dateOfTicketControl?: string;
|
|
31
|
+
timeOfTicketControl?: string;
|
|
32
|
+
feedback?: string;
|
|
33
|
+
invoiceNumber?: string;
|
|
34
|
+
};
|
|
35
|
+
export type TicketControlContextProps = {
|
|
36
|
+
feeNumber?: string;
|
|
37
|
+
appPhoneNumber?: string;
|
|
38
|
+
customerNumber?: string;
|
|
39
|
+
travelCardNumber?: string;
|
|
40
|
+
firstName?: string;
|
|
41
|
+
lastName?: string;
|
|
42
|
+
address?: string;
|
|
43
|
+
postalCode?: string;
|
|
44
|
+
city?: string;
|
|
45
|
+
email?: string;
|
|
46
|
+
phoneNumber?: string;
|
|
47
|
+
bankAccountNumber?: string;
|
|
48
|
+
IBAN?: string;
|
|
49
|
+
SWIFT?: string;
|
|
50
|
+
attachments?: File[];
|
|
51
|
+
transportMode?: TransportModeType | undefined;
|
|
52
|
+
line?: Line | undefined;
|
|
53
|
+
fromStop?: Line['quays'][0] | undefined;
|
|
54
|
+
toStop?: Line['quays'][0] | undefined;
|
|
55
|
+
dateOfTicketControl?: string;
|
|
56
|
+
timeOfTicketControl?: string;
|
|
57
|
+
feedback?: string;
|
|
58
|
+
invoiceNumber?: string;
|
|
59
|
+
formType?: FormType;
|
|
60
|
+
agreesFirstAgreement: boolean;
|
|
61
|
+
agreesSecondAgreement: boolean;
|
|
62
|
+
isAppTicketStorageMode: boolean;
|
|
63
|
+
hasInternationalBankAccount: boolean;
|
|
64
|
+
errorMessages: InputErrorMessages;
|
|
65
|
+
firstErrorMessage?: string;
|
|
66
|
+
hasSubmissionError?: boolean;
|
|
67
|
+
};
|
|
68
|
+
export type MachinePaths = {
|
|
69
|
+
successPath: string;
|
|
70
|
+
errorPath: string;
|
|
71
|
+
};
|
|
72
|
+
export declare function createTicketControlFormMachine(onSubmit: (schemaName: FormSchemaName, state: Record<string, unknown>) => Promise<Response>, paths?: MachinePaths): import("xstate").StateMachine<TicketControlContextProps, {
|
|
73
|
+
type: "VALIDATE";
|
|
74
|
+
} | {
|
|
75
|
+
type: "ON_INPUT_CHANGE";
|
|
76
|
+
inputName: "address" | "attachments" | "bankAccountNumber" | "city" | "date" | "email" | "firstName" | "feedback" | "IBAN" | "lastName" | "phoneNumber" | "postalCode" | "SWIFT" | "toStop" | "fromStop" | "plannedDepartureTime";
|
|
77
|
+
value: any;
|
|
78
|
+
} | {
|
|
79
|
+
type: "ON_TRANSPORTMODE_CHANGE";
|
|
80
|
+
value: TransportModeType;
|
|
81
|
+
} | {
|
|
82
|
+
type: "ON_LINE_CHANGE";
|
|
83
|
+
value: Line | undefined;
|
|
84
|
+
} | {
|
|
85
|
+
type: "ON_INPUT_CHANGE";
|
|
86
|
+
inputName: "formType" | "feeNumber" | "invoiceNumber" | "appPhoneNumber" | "customerNumber" | "travelCardNumber" | "isAppTicketStorageMode" | "agreesFirstAgreement" | "agreesSecondAgreement" | "hasInternationalBankAccount" | "dateOfTicketControl" | "timeOfTicketControl";
|
|
87
|
+
value: string | boolean;
|
|
88
|
+
} | {
|
|
89
|
+
type: "SELECT_FORM_TYPE";
|
|
90
|
+
formType: FormType;
|
|
91
|
+
} | {
|
|
92
|
+
type: "SUBMIT";
|
|
93
|
+
orderedFormFieldNames: string[];
|
|
94
|
+
}, {
|
|
95
|
+
[x: string]: import("xstate").ActorRefFromLogic<import("xstate").PromiseActorLogic<true, SubmitInput, import("xstate").EventObject>> | undefined;
|
|
96
|
+
}, {
|
|
97
|
+
src: "submit";
|
|
98
|
+
logic: import("xstate").PromiseActorLogic<true, SubmitInput, import("xstate").EventObject>;
|
|
99
|
+
id: string | undefined;
|
|
100
|
+
}, {
|
|
101
|
+
type: "navigateToErrorPage";
|
|
102
|
+
params: unknown;
|
|
103
|
+
} | {
|
|
104
|
+
type: "navigateToSuccessPage";
|
|
105
|
+
params: unknown;
|
|
106
|
+
} | {
|
|
107
|
+
type: "clearValidationErrors";
|
|
108
|
+
params: unknown;
|
|
109
|
+
} | {
|
|
110
|
+
type: "setValidationErrors";
|
|
111
|
+
params: unknown;
|
|
112
|
+
} | {
|
|
113
|
+
type: "scrollToFirstErrorMessage";
|
|
114
|
+
params: unknown;
|
|
115
|
+
} | {
|
|
116
|
+
type: "setSubmissionError";
|
|
117
|
+
params: unknown;
|
|
118
|
+
} | {
|
|
119
|
+
type: "clearSubmissionError";
|
|
120
|
+
params: unknown;
|
|
121
|
+
} | {
|
|
122
|
+
type: "onInputChange";
|
|
123
|
+
params: unknown;
|
|
124
|
+
} | {
|
|
125
|
+
type: "onTransportModeChange";
|
|
126
|
+
params: unknown;
|
|
127
|
+
} | {
|
|
128
|
+
type: "onLineChange";
|
|
129
|
+
params: unknown;
|
|
130
|
+
}, {
|
|
131
|
+
type: "isFormValid";
|
|
132
|
+
params: unknown;
|
|
133
|
+
} | {
|
|
134
|
+
type: "isFeeComplaintForm";
|
|
135
|
+
params: unknown;
|
|
136
|
+
} | {
|
|
137
|
+
type: "isFeedbackForm";
|
|
138
|
+
params: unknown;
|
|
139
|
+
} | {
|
|
140
|
+
type: "isPostponePaymentForm";
|
|
141
|
+
params: unknown;
|
|
142
|
+
}, never, "success" | "validating" | "submitting" | "formHandler" | {
|
|
143
|
+
editing: "feeComplaint" | "postponePayment" | "feedback" | "selectFormType";
|
|
144
|
+
}, string, import("xstate").NonReducibleUnknown, import("xstate").NonReducibleUnknown, import("xstate").EventObject, import("xstate").MetaObject, {
|
|
145
|
+
id: "ticketControlForm";
|
|
146
|
+
states: {
|
|
147
|
+
readonly formHandler: {
|
|
148
|
+
id: "formTypeHandler";
|
|
149
|
+
};
|
|
150
|
+
readonly editing: {
|
|
151
|
+
states: {
|
|
152
|
+
readonly selectFormType: {};
|
|
153
|
+
readonly feeComplaint: {
|
|
154
|
+
id: "feeComplaint";
|
|
155
|
+
};
|
|
156
|
+
readonly feedback: {
|
|
157
|
+
id: "feedback";
|
|
158
|
+
};
|
|
159
|
+
readonly postponePayment: {
|
|
160
|
+
id: "postponePayment";
|
|
161
|
+
};
|
|
162
|
+
readonly history: {};
|
|
163
|
+
};
|
|
164
|
+
};
|
|
165
|
+
readonly validating: {
|
|
166
|
+
id: "validating";
|
|
167
|
+
};
|
|
168
|
+
readonly submitting: {
|
|
169
|
+
id: "submitting";
|
|
170
|
+
};
|
|
171
|
+
readonly success: {};
|
|
172
|
+
};
|
|
173
|
+
}>;
|
|
174
|
+
export declare const ticketControlFormMachine: import("xstate").StateMachine<TicketControlContextProps, {
|
|
175
|
+
type: "VALIDATE";
|
|
176
|
+
} | {
|
|
177
|
+
type: "ON_INPUT_CHANGE";
|
|
178
|
+
inputName: "address" | "attachments" | "bankAccountNumber" | "city" | "date" | "email" | "firstName" | "feedback" | "IBAN" | "lastName" | "phoneNumber" | "postalCode" | "SWIFT" | "toStop" | "fromStop" | "plannedDepartureTime";
|
|
179
|
+
value: any;
|
|
180
|
+
} | {
|
|
181
|
+
type: "ON_TRANSPORTMODE_CHANGE";
|
|
182
|
+
value: TransportModeType;
|
|
183
|
+
} | {
|
|
184
|
+
type: "ON_LINE_CHANGE";
|
|
185
|
+
value: Line | undefined;
|
|
186
|
+
} | {
|
|
187
|
+
type: "ON_INPUT_CHANGE";
|
|
188
|
+
inputName: "formType" | "feeNumber" | "invoiceNumber" | "appPhoneNumber" | "customerNumber" | "travelCardNumber" | "isAppTicketStorageMode" | "agreesFirstAgreement" | "agreesSecondAgreement" | "hasInternationalBankAccount" | "dateOfTicketControl" | "timeOfTicketControl";
|
|
189
|
+
value: string | boolean;
|
|
190
|
+
} | {
|
|
191
|
+
type: "SELECT_FORM_TYPE";
|
|
192
|
+
formType: FormType;
|
|
193
|
+
} | {
|
|
194
|
+
type: "SUBMIT";
|
|
195
|
+
orderedFormFieldNames: string[];
|
|
196
|
+
}, {
|
|
197
|
+
[x: string]: import("xstate").ActorRefFromLogic<import("xstate").PromiseActorLogic<true, SubmitInput, import("xstate").EventObject>> | undefined;
|
|
198
|
+
}, {
|
|
199
|
+
src: "submit";
|
|
200
|
+
logic: import("xstate").PromiseActorLogic<true, SubmitInput, import("xstate").EventObject>;
|
|
201
|
+
id: string | undefined;
|
|
202
|
+
}, {
|
|
203
|
+
type: "navigateToErrorPage";
|
|
204
|
+
params: unknown;
|
|
205
|
+
} | {
|
|
206
|
+
type: "navigateToSuccessPage";
|
|
207
|
+
params: unknown;
|
|
208
|
+
} | {
|
|
209
|
+
type: "clearValidationErrors";
|
|
210
|
+
params: unknown;
|
|
211
|
+
} | {
|
|
212
|
+
type: "setValidationErrors";
|
|
213
|
+
params: unknown;
|
|
214
|
+
} | {
|
|
215
|
+
type: "scrollToFirstErrorMessage";
|
|
216
|
+
params: unknown;
|
|
217
|
+
} | {
|
|
218
|
+
type: "setSubmissionError";
|
|
219
|
+
params: unknown;
|
|
220
|
+
} | {
|
|
221
|
+
type: "clearSubmissionError";
|
|
222
|
+
params: unknown;
|
|
223
|
+
} | {
|
|
224
|
+
type: "onInputChange";
|
|
225
|
+
params: unknown;
|
|
226
|
+
} | {
|
|
227
|
+
type: "onTransportModeChange";
|
|
228
|
+
params: unknown;
|
|
229
|
+
} | {
|
|
230
|
+
type: "onLineChange";
|
|
231
|
+
params: unknown;
|
|
232
|
+
}, {
|
|
233
|
+
type: "isFormValid";
|
|
234
|
+
params: unknown;
|
|
235
|
+
} | {
|
|
236
|
+
type: "isFeeComplaintForm";
|
|
237
|
+
params: unknown;
|
|
238
|
+
} | {
|
|
239
|
+
type: "isFeedbackForm";
|
|
240
|
+
params: unknown;
|
|
241
|
+
} | {
|
|
242
|
+
type: "isPostponePaymentForm";
|
|
243
|
+
params: unknown;
|
|
244
|
+
}, never, "success" | "validating" | "submitting" | "formHandler" | {
|
|
245
|
+
editing: "feeComplaint" | "postponePayment" | "feedback" | "selectFormType";
|
|
246
|
+
}, string, import("xstate").NonReducibleUnknown, import("xstate").NonReducibleUnknown, import("xstate").EventObject, import("xstate").MetaObject, {
|
|
247
|
+
id: "ticketControlForm";
|
|
248
|
+
states: {
|
|
249
|
+
readonly formHandler: {
|
|
250
|
+
id: "formTypeHandler";
|
|
251
|
+
};
|
|
252
|
+
readonly editing: {
|
|
253
|
+
states: {
|
|
254
|
+
readonly selectFormType: {};
|
|
255
|
+
readonly feeComplaint: {
|
|
256
|
+
id: "feeComplaint";
|
|
257
|
+
};
|
|
258
|
+
readonly feedback: {
|
|
259
|
+
id: "feedback";
|
|
260
|
+
};
|
|
261
|
+
readonly postponePayment: {
|
|
262
|
+
id: "postponePayment";
|
|
263
|
+
};
|
|
264
|
+
readonly history: {};
|
|
265
|
+
};
|
|
266
|
+
};
|
|
267
|
+
readonly validating: {
|
|
268
|
+
id: "validating";
|
|
269
|
+
};
|
|
270
|
+
readonly submitting: {
|
|
271
|
+
id: "submitting";
|
|
272
|
+
};
|
|
273
|
+
readonly success: {};
|
|
274
|
+
};
|
|
275
|
+
}>;
|
|
276
|
+
export {};
|
|
277
|
+
//# sourceMappingURL=ticket-control-form-machine.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ticket-control-form-machine.d.ts","sourceRoot":"","sources":["../../src/ticket-control/ticket-control-form-machine.ts"],"names":[],"mappings":"AAWA,OAAO,EAAC,IAAI,EAAC,MAAM,sCAAsC,CAAC;AAC1D,OAAO,EAAuB,kBAAkB,EAAC,MAAM,eAAe,CAAC;AACvE,OAAO,EAAC,iBAAiB,EAAC,MAAM,UAAU,CAAC;AAC3C,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,yBAAyB,CAAC;AAE5D,oBAAY,QAAQ;IAChB,YAAY,iBAAiB;IAC7B,QAAQ,aAAa;IACrB,eAAe,oBAAoB;CACtC;AAED,KAAK,WAAW,GAAG;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,IAAI,EAAE,CAAC;IACrB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,aAAa,CAAC,EAAE,MAAM,CAAC;CAC1B,CAAC;AAEF,MAAM,MAAM,yBAAyB,GAAG;IACpC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,IAAI,EAAE,CAAC;IACrB,aAAa,CAAC,EAAE,iBAAiB,GAAG,SAAS,CAAC;IAC9C,IAAI,CAAC,EAAE,IAAI,GAAG,SAAS,CAAC;IACxB,QAAQ,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC;IACxC,MAAM,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC;IACtC,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,aAAa,CAAC,EAAE,MAAM,CAAC;IAEvB,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB,oBAAoB,EAAE,OAAO,CAAC;IAC9B,qBAAqB,EAAE,OAAO,CAAC;IAC/B,sBAAsB,EAAE,OAAO,CAAC;IAChC,2BAA2B,EAAE,OAAO,CAAC;IACrC,aAAa,EAAE,kBAAkB,CAAC;IAClC,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,kBAAkB,CAAC,EAAE,OAAO,CAAC;CAChC,CAAC;AA2EF,MAAM,MAAM,YAAY,GAAG;IAAE,WAAW,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,CAAC;AAEtE,wBAAgB,8BAA8B,CAC1C,QAAQ,EAAE,CAAC,UAAU,EAAE,cAAc,EAAE,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,OAAO,CAAC,QAAQ,CAAC,EAC3F,KAAK,CAAC,EAAE,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsOvB;AAED,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAOpC,CAAC"}
|
|
@@ -0,0 +1,262 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ticketControlFormMachine = exports.FormType = void 0;
|
|
4
|
+
exports.createTicketControlFormMachine = createTicketControlFormMachine;
|
|
5
|
+
const xstate_1 = require("xstate");
|
|
6
|
+
const events_1 = require("./events");
|
|
7
|
+
const utils_1 = require("../utils");
|
|
8
|
+
const validation_1 = require("../validation");
|
|
9
|
+
var FormType;
|
|
10
|
+
(function (FormType) {
|
|
11
|
+
FormType["FeeComplaint"] = "feeComplaint";
|
|
12
|
+
FormType["Feedback"] = "feedback";
|
|
13
|
+
FormType["PostponePayment"] = "postponePayment";
|
|
14
|
+
})(FormType || (exports.FormType = FormType = {}));
|
|
15
|
+
const disagreeAgreements = (context) => {
|
|
16
|
+
return {
|
|
17
|
+
...context,
|
|
18
|
+
agreesFirstAgreement: false,
|
|
19
|
+
agreesSecondAgreement: false,
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
const setInputsToValidate = (context) => {
|
|
23
|
+
// Destructure the needed fields from context
|
|
24
|
+
const { formType, firstName, lastName, email, feeNumber, feedback, phoneNumber, invoiceNumber, appPhoneNumber, customerNumber, travelCardNumber, address, postalCode, city, hasInternationalBankAccount, bankAccountNumber, IBAN, SWIFT, transportMode, line, dateOfTicketControl, timeOfTicketControl, isAppTicketStorageMode, } = context;
|
|
25
|
+
switch (formType) {
|
|
26
|
+
case FormType.FeeComplaint:
|
|
27
|
+
return {
|
|
28
|
+
feeNumber,
|
|
29
|
+
feedback,
|
|
30
|
+
firstName,
|
|
31
|
+
lastName,
|
|
32
|
+
email,
|
|
33
|
+
address,
|
|
34
|
+
postalCode,
|
|
35
|
+
city,
|
|
36
|
+
phoneNumber,
|
|
37
|
+
...(isAppTicketStorageMode
|
|
38
|
+
? { appPhoneNumber, customerNumber }
|
|
39
|
+
: { travelCardNumber }),
|
|
40
|
+
...(hasInternationalBankAccount
|
|
41
|
+
? { IBAN, SWIFT }
|
|
42
|
+
: { bankAccountNumber }),
|
|
43
|
+
};
|
|
44
|
+
case FormType.Feedback:
|
|
45
|
+
return {
|
|
46
|
+
transportMode,
|
|
47
|
+
line,
|
|
48
|
+
dateOfTicketControl,
|
|
49
|
+
timeOfTicketControl,
|
|
50
|
+
feedback,
|
|
51
|
+
firstName,
|
|
52
|
+
lastName,
|
|
53
|
+
email,
|
|
54
|
+
};
|
|
55
|
+
case FormType.PostponePayment:
|
|
56
|
+
return { feeNumber, invoiceNumber, firstName, lastName, email };
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
function createTicketControlFormMachine(onSubmit, paths) {
|
|
60
|
+
const successPath = paths?.successPath ?? '/contact/success';
|
|
61
|
+
const errorPath = paths?.errorPath ?? '/contact/error';
|
|
62
|
+
return (0, xstate_1.setup)({
|
|
63
|
+
types: {
|
|
64
|
+
context: {},
|
|
65
|
+
events: events_1.ticketControlFormEvents,
|
|
66
|
+
},
|
|
67
|
+
guards: {
|
|
68
|
+
isFormValid: ({ context }) => {
|
|
69
|
+
const inputsToValidate = setInputsToValidate(context);
|
|
70
|
+
const errors = (0, validation_1.commonInputValidator)(inputsToValidate);
|
|
71
|
+
return Object.keys(errors).length === 0;
|
|
72
|
+
},
|
|
73
|
+
isFeeComplaintForm: ({ event }) => event.type === 'SELECT_FORM_TYPE' &&
|
|
74
|
+
event.formType === FormType.FeeComplaint,
|
|
75
|
+
isFeedbackForm: ({ event }) => event.type === 'SELECT_FORM_TYPE' && event.formType === FormType.Feedback,
|
|
76
|
+
isPostponePaymentForm: ({ event }) => event.type === 'SELECT_FORM_TYPE' &&
|
|
77
|
+
event.formType === FormType.PostponePayment,
|
|
78
|
+
},
|
|
79
|
+
actions: {
|
|
80
|
+
navigateToErrorPage: () => {
|
|
81
|
+
window.location.href = errorPath;
|
|
82
|
+
},
|
|
83
|
+
navigateToSuccessPage: () => {
|
|
84
|
+
window.location.href = successPath;
|
|
85
|
+
},
|
|
86
|
+
clearValidationErrors: (0, xstate_1.assign)({ errorMessages: {} }),
|
|
87
|
+
setValidationErrors: (0, xstate_1.assign)(({ context, event }) => {
|
|
88
|
+
if (event.type === 'SUBMIT') {
|
|
89
|
+
const inputsToValidate = setInputsToValidate(context);
|
|
90
|
+
const errors = (0, validation_1.commonInputValidator)(inputsToValidate);
|
|
91
|
+
return {
|
|
92
|
+
firstErrorMessage: (0, utils_1.findFirstErrorMessage)(event.orderedFormFieldNames, errors),
|
|
93
|
+
errorMessages: { ...errors },
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
return context;
|
|
97
|
+
}),
|
|
98
|
+
scrollToFirstErrorMessage: (0, xstate_1.assign)(({ context }) => {
|
|
99
|
+
(0, utils_1.scrollToFirstErrorMessage)(context.firstErrorMessage);
|
|
100
|
+
return context;
|
|
101
|
+
}),
|
|
102
|
+
setSubmissionError: (0, xstate_1.assign)({
|
|
103
|
+
hasSubmissionError: () => true,
|
|
104
|
+
}),
|
|
105
|
+
clearSubmissionError: (0, xstate_1.assign)({
|
|
106
|
+
hasSubmissionError: () => undefined,
|
|
107
|
+
}),
|
|
108
|
+
onInputChange: (0, xstate_1.assign)(({ context, event }) => {
|
|
109
|
+
if (event.type === 'ON_INPUT_CHANGE') {
|
|
110
|
+
const { inputName, value } = event;
|
|
111
|
+
context.errorMessages[inputName] = [];
|
|
112
|
+
// Set both agreements to false if agreesFirstAgreement is set to false.
|
|
113
|
+
if (inputName === 'agreesFirstAgreement' && !value)
|
|
114
|
+
return {
|
|
115
|
+
...disagreeAgreements(context),
|
|
116
|
+
hasSubmissionError: undefined,
|
|
117
|
+
};
|
|
118
|
+
if (inputName === 'hasInternationalBankAccount') {
|
|
119
|
+
const updatedContext = (0, utils_1.setBankAccountStatusAndResetBankInformation)(context, value);
|
|
120
|
+
return {
|
|
121
|
+
...updatedContext,
|
|
122
|
+
hasSubmissionError: undefined,
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
return { ...context, [inputName]: value, hasSubmissionError: undefined };
|
|
126
|
+
}
|
|
127
|
+
return context;
|
|
128
|
+
}),
|
|
129
|
+
onTransportModeChange: (0, xstate_1.assign)(({ context, event }) => {
|
|
130
|
+
if (event.type === 'ON_TRANSPORTMODE_CHANGE')
|
|
131
|
+
return (0, utils_1.setTransportModeAndResetLineAndStops)(context, event.value);
|
|
132
|
+
return context;
|
|
133
|
+
}),
|
|
134
|
+
onLineChange: (0, xstate_1.assign)(({ context, event }) => {
|
|
135
|
+
if (event.type === 'ON_LINE_CHANGE')
|
|
136
|
+
return (0, utils_1.setLineAndResetStops)(context, event.value);
|
|
137
|
+
return context;
|
|
138
|
+
}),
|
|
139
|
+
},
|
|
140
|
+
actors: {
|
|
141
|
+
submit: (0, xstate_1.fromPromise)(async ({ input }) => {
|
|
142
|
+
const base64EncodedAttachments = await (0, utils_1.convertFilesToBase64)(input.attachments || []);
|
|
143
|
+
const state = {
|
|
144
|
+
...input,
|
|
145
|
+
attachments: base64EncodedAttachments,
|
|
146
|
+
};
|
|
147
|
+
const response = await onSubmit('ticketControl', state);
|
|
148
|
+
if (!response.ok)
|
|
149
|
+
throw new Error('Failed to call API');
|
|
150
|
+
return response.ok;
|
|
151
|
+
}),
|
|
152
|
+
},
|
|
153
|
+
}).createMachine({
|
|
154
|
+
id: 'ticketControlForm',
|
|
155
|
+
initial: 'editing',
|
|
156
|
+
context: {
|
|
157
|
+
agreesFirstAgreement: false,
|
|
158
|
+
agreesSecondAgreement: false,
|
|
159
|
+
hasInternationalBankAccount: false,
|
|
160
|
+
isAppTicketStorageMode: true,
|
|
161
|
+
errorMessages: {},
|
|
162
|
+
},
|
|
163
|
+
on: {
|
|
164
|
+
ON_INPUT_CHANGE: { actions: 'onInputChange' },
|
|
165
|
+
SELECT_FORM_TYPE: { target: '#formTypeHandler' },
|
|
166
|
+
SUBMIT: { target: '#validating' },
|
|
167
|
+
},
|
|
168
|
+
states: {
|
|
169
|
+
formHandler: {
|
|
170
|
+
id: 'formTypeHandler',
|
|
171
|
+
always: [
|
|
172
|
+
{ guard: 'isFeeComplaintForm', target: `#${FormType.FeeComplaint}` },
|
|
173
|
+
{ guard: 'isFeedbackForm', target: `#${FormType.Feedback}` },
|
|
174
|
+
{
|
|
175
|
+
guard: 'isPostponePaymentForm',
|
|
176
|
+
target: `#${FormType.PostponePayment}`,
|
|
177
|
+
},
|
|
178
|
+
],
|
|
179
|
+
},
|
|
180
|
+
editing: {
|
|
181
|
+
initial: 'selectFormType',
|
|
182
|
+
on: {
|
|
183
|
+
ON_INPUT_CHANGE: { actions: 'onInputChange' },
|
|
184
|
+
ON_TRANSPORTMODE_CHANGE: { actions: 'onTransportModeChange' },
|
|
185
|
+
ON_LINE_CHANGE: { actions: 'onLineChange' },
|
|
186
|
+
},
|
|
187
|
+
states: {
|
|
188
|
+
selectFormType: {},
|
|
189
|
+
feeComplaint: {
|
|
190
|
+
id: 'feeComplaint',
|
|
191
|
+
entry: (0, xstate_1.assign)({ formType: () => FormType.FeeComplaint }),
|
|
192
|
+
exit: 'clearValidationErrors',
|
|
193
|
+
},
|
|
194
|
+
feedback: {
|
|
195
|
+
id: 'feedback',
|
|
196
|
+
entry: (0, xstate_1.assign)({ formType: () => FormType.Feedback }),
|
|
197
|
+
exit: 'clearValidationErrors',
|
|
198
|
+
},
|
|
199
|
+
postponePayment: {
|
|
200
|
+
id: 'postponePayment',
|
|
201
|
+
entry: (0, xstate_1.assign)({ formType: () => FormType.PostponePayment }),
|
|
202
|
+
exit: 'clearValidationErrors',
|
|
203
|
+
},
|
|
204
|
+
history: { type: 'history', history: 'deep' },
|
|
205
|
+
},
|
|
206
|
+
},
|
|
207
|
+
validating: {
|
|
208
|
+
id: 'validating',
|
|
209
|
+
always: [
|
|
210
|
+
{ guard: 'isFormValid', target: '#submitting' },
|
|
211
|
+
{
|
|
212
|
+
actions: ['setValidationErrors', 'scrollToFirstErrorMessage'],
|
|
213
|
+
target: 'editing.history',
|
|
214
|
+
},
|
|
215
|
+
],
|
|
216
|
+
},
|
|
217
|
+
submitting: {
|
|
218
|
+
id: 'submitting',
|
|
219
|
+
invoke: {
|
|
220
|
+
src: 'submit',
|
|
221
|
+
input: ({ context }) => ({
|
|
222
|
+
feeNumber: context.feeNumber,
|
|
223
|
+
appPhoneNumber: context.appPhoneNumber,
|
|
224
|
+
customerNumber: context.customerNumber,
|
|
225
|
+
travelCardNumber: context.travelCardNumber,
|
|
226
|
+
firstName: context.firstName,
|
|
227
|
+
lastName: context.lastName,
|
|
228
|
+
address: context.address,
|
|
229
|
+
postalCode: context.postalCode,
|
|
230
|
+
city: context.city,
|
|
231
|
+
email: context.email,
|
|
232
|
+
phoneNumber: context.phoneNumber,
|
|
233
|
+
bankAccountNumber: context.bankAccountNumber,
|
|
234
|
+
IBAN: context.IBAN,
|
|
235
|
+
SWIFT: context.SWIFT,
|
|
236
|
+
feedback: context.feedback,
|
|
237
|
+
transportMode: context.transportMode,
|
|
238
|
+
lineName: (0, utils_1.getLineName)(context.line),
|
|
239
|
+
fromStop: context.fromStop?.name,
|
|
240
|
+
toStop: context.toStop?.name,
|
|
241
|
+
dateOfTicketControl: context.dateOfTicketControl,
|
|
242
|
+
timeOfTicketControl: context.timeOfTicketControl,
|
|
243
|
+
invoiceNumber: context.invoiceNumber,
|
|
244
|
+
attachments: context.attachments,
|
|
245
|
+
}),
|
|
246
|
+
onDone: { target: 'success' },
|
|
247
|
+
onError: {
|
|
248
|
+
target: 'editing.history',
|
|
249
|
+
actions: 'setSubmissionError',
|
|
250
|
+
},
|
|
251
|
+
},
|
|
252
|
+
},
|
|
253
|
+
success: { entry: 'navigateToSuccessPage', type: 'final' },
|
|
254
|
+
},
|
|
255
|
+
});
|
|
256
|
+
}
|
|
257
|
+
exports.ticketControlFormMachine = createTicketControlFormMachine(async (data) => {
|
|
258
|
+
return fetch('/api/contact/ticket-control', {
|
|
259
|
+
method: 'POST',
|
|
260
|
+
body: JSON.stringify(data),
|
|
261
|
+
});
|
|
262
|
+
});
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { commonEvents } from '../commoneEvents';
|
|
2
|
+
import { AppForm, FormCategory, WebshopForm, TravelCardForm } from './ticketingStateMachine';
|
|
3
|
+
declare const ticketingSpecificFormEvents: {
|
|
4
|
+
type: "ON_INPUT_CHANGE";
|
|
5
|
+
inputName: "question" | "orderId" | "customerNumber" | "travelCardNumber" | "refundReason" | "amount" | "isInitialAgreementChecked" | "hasInternationalBankAccount" | "showInputTravelCardNumber";
|
|
6
|
+
value: string | boolean;
|
|
7
|
+
} | {
|
|
8
|
+
type: "ON_SET_STATE";
|
|
9
|
+
target: FormCategory;
|
|
10
|
+
} | {
|
|
11
|
+
type: "SELECT_FORM_CATEGORY";
|
|
12
|
+
formCategory: FormCategory;
|
|
13
|
+
} | {
|
|
14
|
+
type: "SELECT_APP_FORM";
|
|
15
|
+
appForm: AppForm;
|
|
16
|
+
} | {
|
|
17
|
+
type: "SELECT_WEBSHOP_FORM";
|
|
18
|
+
webshopForm: WebshopForm;
|
|
19
|
+
} | {
|
|
20
|
+
type: "SELECT_TRAVELCARD_FORM";
|
|
21
|
+
travelCardForm: TravelCardForm;
|
|
22
|
+
} | {
|
|
23
|
+
type: "SUBMIT";
|
|
24
|
+
orderedFormFieldNames: string[];
|
|
25
|
+
};
|
|
26
|
+
export declare const ticketingFormEvents: typeof commonEvents | typeof ticketingSpecificFormEvents;
|
|
27
|
+
export {};
|
|
28
|
+
//# sourceMappingURL=events.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../src/ticketing/events.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,YAAY,EAAC,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EACH,OAAO,EACP,YAAY,EACZ,WAAW,EACX,cAAc,EACjB,MAAM,yBAAyB,CAAC;AAEjC,QAAA,MAAM,2BAA2B,EAC3B;IACF,IAAI,EAAE,iBAAiB,CAAC;IACxB,SAAS,EACH,UAAU,GACV,SAAS,GACT,gBAAgB,GAChB,kBAAkB,GAClB,cAAc,GACd,QAAQ,GACR,2BAA2B,GAC3B,6BAA6B,GAC7B,2BAA2B,CAAC;IAClC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC;CAC3B,GACK;IACF,IAAI,EAAE,cAAc,CAAC;IACrB,MAAM,EAAE,YAAY,CAAC;CACxB,GACK;IACF,IAAI,EAAE,sBAAsB,CAAC;IAC7B,YAAY,EAAE,YAAY,CAAC;CAC9B,GACK;IACF,IAAI,EAAE,iBAAiB,CAAC;IACxB,OAAO,EAAE,OAAO,CAAC;CACpB,GACK;IACF,IAAI,EAAE,qBAAqB,CAAC;IAC5B,WAAW,EAAE,WAAW,CAAC;CAC5B,GACK;IACF,IAAI,EAAE,wBAAwB,CAAC;IAC/B,cAAc,EAAE,cAAc,CAAC;CAClC,GACK;IACF,IAAI,EAAE,QAAQ,CAAC;IACf,qBAAqB,EAAE,MAAM,EAAE,CAAC;CACnC,CAAC;AAEF,eAAO,MAAM,mBAAmB,EAC1B,OAAO,YAAY,GACnB,OAAO,2BAA2B,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ticketingFormEvents } from '../../events';
|
|
2
|
+
import { TicketingContextType } from '../../ticketingStateMachine';
|
|
3
|
+
type AppAccountFormProps = {
|
|
4
|
+
state: {
|
|
5
|
+
context: TicketingContextType;
|
|
6
|
+
};
|
|
7
|
+
send: (event: typeof ticketingFormEvents) => void;
|
|
8
|
+
};
|
|
9
|
+
export declare const AppAccountForm: ({ state, send }: AppAccountFormProps) => import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export default AppAccountForm;
|
|
11
|
+
//# sourceMappingURL=appAccountForm.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"appAccountForm.d.ts","sourceRoot":"","sources":["../../../../src/ticketing/forms/app/appAccountForm.tsx"],"names":[],"mappings":"AACA,OAAO,EAAC,mBAAmB,EAAC,MAAM,cAAc,CAAC;AACjD,OAAO,EAAC,oBAAoB,EAAC,MAAM,6BAA6B,CAAC;AAGjE,KAAK,mBAAmB,GAAG;IACvB,KAAK,EAAE;QAAE,OAAO,EAAE,oBAAoB,CAAA;KAAE,CAAC;IACzC,IAAI,EAAE,CAAC,KAAK,EAAE,OAAO,mBAAmB,KAAK,IAAI,CAAC;CACrD,CAAC;AAEF,eAAO,MAAM,cAAc,GAAI,iBAAe,mBAAmB,4CA+HhE,CAAC;AAEF,eAAe,cAAc,CAAC"}
|