@mrfylke/contact-form 0.1.10 → 0.1.21
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/README.md +393 -2
- package/lib/ContactFormRoot.d.ts +11 -1
- package/lib/ContactFormRoot.d.ts.map +1 -1
- package/lib/ContactFormRoot.js +2 -2
- package/lib/commoneEvents.d.ts +1 -1
- package/lib/commoneEvents.d.ts.map +1 -1
- package/lib/components/form/date-selector.d.ts.map +1 -1
- package/lib/components/form/date-selector.js +5 -4
- package/lib/components/form/departure-time-field.d.ts +16 -0
- package/lib/components/form/departure-time-field.d.ts.map +1 -0
- package/lib/components/form/departure-time-field.js +28 -0
- package/lib/components/form/description-modal.d.ts.map +1 -1
- package/lib/components/form/description-modal.js +2 -1
- package/lib/components/form/file-input.d.ts.map +1 -1
- package/lib/components/form/file-input.js +2 -1
- package/lib/components/form/index.d.ts +1 -0
- package/lib/components/form/index.d.ts.map +1 -1
- package/lib/components/form/index.js +3 -1
- package/lib/components/form/input.d.ts.map +1 -1
- package/lib/components/form/input.js +2 -1
- package/lib/components/form/searchable-select/utils.js +6 -1
- package/lib/components/index.d.ts +1 -1
- package/lib/components/index.d.ts.map +1 -1
- package/lib/components/index.js +2 -1
- package/lib/contact.module.css +9 -0
- package/lib/error-content/error-content.d.ts.map +1 -1
- package/lib/error-content/error-content.js +2 -1
- package/lib/group-travel/index.d.ts.map +1 -1
- package/lib/group-travel/index.js +3 -1
- package/lib/index.d.ts +16 -4
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +41 -1
- package/lib/journey-info/index.d.ts.map +1 -1
- package/lib/journey-info/index.js +14 -8
- package/lib/journey-info/journeyInfoStateMachine.d.ts +8 -8
- package/lib/layouts/contact-page-layout.d.ts +2 -2
- package/lib/layouts/contact-page-layout.d.ts.map +1 -1
- package/lib/layouts/contact-page-layout.js +29 -20
- package/lib/layouts/container.module.css +1 -1
- package/lib/layouts/layout.module.css +23 -2
- package/lib/lines/use-departures.d.ts +12 -0
- package/lib/lines/use-departures.d.ts.map +1 -0
- package/lib/lines/use-departures.js +35 -0
- package/lib/lines/use-lines.d.ts +5 -6
- package/lib/lines/use-lines.d.ts.map +1 -1
- package/lib/lines/use-lines.js +75 -42
- package/lib/lost-property/LostPropertyForm.d.ts +10 -0
- package/lib/lost-property/LostPropertyForm.d.ts.map +1 -0
- package/lib/lost-property/LostPropertyForm.js +65 -0
- package/lib/lost-property/LostPropertyMachine.d.ts +116 -0
- package/lib/lost-property/LostPropertyMachine.d.ts.map +1 -0
- package/lib/lost-property/LostPropertyMachine.js +187 -0
- package/lib/lost-property/index.d.ts.map +1 -1
- package/lib/lost-property/index.js +27 -3
- package/lib/means-of-transport/forms/delayForm.d.ts.map +1 -1
- package/lib/means-of-transport/forms/delayForm.js +26 -18
- package/lib/means-of-transport/forms/driverForm.d.ts.map +1 -1
- package/lib/means-of-transport/forms/driverForm.js +26 -18
- package/lib/means-of-transport/forms/injuryForm.d.ts.map +1 -1
- package/lib/means-of-transport/forms/injuryForm.js +26 -18
- package/lib/means-of-transport/forms/serviceOfferingForm.d.ts.map +1 -1
- package/lib/means-of-transport/forms/serviceOfferingForm.js +10 -10
- package/lib/means-of-transport/forms/stopForm.d.ts.map +1 -1
- package/lib/means-of-transport/forms/stopForm.js +13 -12
- package/lib/means-of-transport/forms/transportationForm.d.ts.map +1 -1
- package/lib/means-of-transport/forms/transportationForm.js +26 -18
- package/lib/means-of-transport/index.d.ts.map +1 -1
- package/lib/means-of-transport/index.js +13 -4
- package/lib/means-of-transport/means-of-transport-form-machine.d.ts +10 -8
- package/lib/means-of-transport/means-of-transport-form-machine.d.ts.map +1 -1
- package/lib/means-of-transport/means-of-transport-form-machine.js +6 -1
- package/lib/modules/config/types.d.ts +56 -1
- package/lib/modules/config/types.d.ts.map +1 -1
- package/lib/refund/events.d.ts +1 -1
- package/lib/refund/events.d.ts.map +1 -1
- package/lib/refund/forms/refund-and-travel-guarantee/index.d.ts.map +1 -1
- package/lib/refund/forms/refund-and-travel-guarantee/index.js +7 -5
- package/lib/refund/forms/refund-and-travel-guarantee/refundCarForm.d.ts.map +1 -1
- package/lib/refund/forms/refund-and-travel-guarantee/refundCarForm.js +39 -29
- package/lib/refund/forms/refund-and-travel-guarantee/refundTaxiForm.d.ts.map +1 -1
- package/lib/refund/forms/refund-and-travel-guarantee/refundTaxiForm.js +37 -28
- package/lib/refund/forms/refund-ticket/appTicketRefund.d.ts.map +1 -1
- package/lib/refund/forms/refund-ticket/appTicketRefund.js +46 -25
- package/lib/refund/forms/refund-ticket/index.d.ts.map +1 -1
- package/lib/refund/forms/refund-ticket/index.js +9 -6
- package/lib/refund/forms/refund-ticket/otherTicketRefund.d.ts.map +1 -1
- package/lib/refund/forms/refund-ticket/otherTicketRefund.js +56 -30
- package/lib/refund/forms/residualValueOnTravelCard/index.d.ts.map +1 -1
- package/lib/refund/forms/residualValueOnTravelCard/index.js +5 -3
- package/lib/refund/index.d.ts.map +1 -1
- package/lib/refund/index.js +39 -6
- package/lib/refund/refundFormMachine.d.ts +37 -13
- package/lib/refund/refundFormMachine.d.ts.map +1 -1
- package/lib/refund/refundFormMachine.js +107 -11
- package/lib/server/journey-planner/index.d.ts.map +1 -1
- package/lib/server/journey-planner/index.js +15 -6
- package/lib/server/journey-planner/validators.d.ts +2 -0
- package/lib/server/journey-planner/validators.d.ts.map +1 -1
- package/lib/server/journey-planner/validators.js +1 -0
- package/lib/success-content/success-content.d.ts.map +1 -1
- package/lib/success-content/success-content.js +2 -1
- package/lib/test-utils/setup.d.ts +2 -0
- package/lib/test-utils/setup.d.ts.map +1 -0
- package/lib/test-utils/setup.js +3 -0
- package/lib/ticket-control/events.d.ts +1 -1
- package/lib/ticket-control/events.d.ts.map +1 -1
- package/lib/ticket-control/forms/feeComplaintForm.d.ts.map +1 -1
- package/lib/ticket-control/forms/feeComplaintForm.js +39 -36
- package/lib/ticket-control/forms/feedbackForm.d.ts.map +1 -1
- package/lib/ticket-control/forms/feedbackForm.js +26 -14
- package/lib/ticket-control/forms/postponePayment.d.ts.map +1 -1
- package/lib/ticket-control/forms/postponePayment.js +8 -7
- package/lib/ticket-control/index.d.ts.map +1 -1
- package/lib/ticket-control/index.js +23 -8
- package/lib/ticket-control/ticket-control-form-machine.d.ts +19 -11
- package/lib/ticket-control/ticket-control-form-machine.d.ts.map +1 -1
- package/lib/ticket-control/ticket-control-form-machine.js +25 -5
- package/lib/ticketing/forms/app/appAccountForm.d.ts.map +1 -1
- package/lib/ticketing/forms/app/appAccountForm.js +9 -8
- package/lib/ticketing/forms/app/appTicketingForm.d.ts.map +1 -1
- package/lib/ticketing/forms/app/appTicketingForm.js +13 -12
- package/lib/ticketing/forms/app/appTravelSuggestionForm.d.ts.map +1 -1
- package/lib/ticketing/forms/app/appTravelSuggestionForm.js +6 -5
- package/lib/ticketing/forms/app/index.d.ts.map +1 -1
- package/lib/ticketing/forms/app/index.js +2 -1
- package/lib/ticketing/forms/priceAndTicketTypesForm.d.ts.map +1 -1
- package/lib/ticketing/forms/priceAndTicketTypesForm.js +6 -5
- package/lib/ticketing/forms/travel-card/index.d.ts.map +1 -1
- package/lib/ticketing/forms/travel-card/index.js +2 -1
- package/lib/ticketing/forms/travel-card/orderTravelCard.d.ts.map +1 -1
- package/lib/ticketing/forms/travel-card/orderTravelCard.js +2 -2
- package/lib/ticketing/forms/travel-card/travelCardQuestionForm.d.ts.map +1 -1
- package/lib/ticketing/forms/travel-card/travelCardQuestionForm.js +9 -8
- package/lib/ticketing/forms/webshop/index.d.ts.map +1 -1
- package/lib/ticketing/forms/webshop/index.js +2 -1
- package/lib/ticketing/forms/webshop/webshopAccountForm.d.ts.map +1 -1
- package/lib/ticketing/forms/webshop/webshopAccountForm.js +9 -8
- package/lib/ticketing/forms/webshop/webshopTicketingForm.d.ts.map +1 -1
- package/lib/ticketing/forms/webshop/webshopTicketingForm.js +12 -11
- package/lib/ticketing/index.d.ts.map +1 -1
- package/lib/ticketing/index.js +21 -6
- package/lib/ticketing/ticketingStateMachine.d.ts +12 -12
- package/lib/translations/index.d.ts +1 -1
- package/lib/translations/index.d.ts.map +1 -1
- package/lib/translations/index.js +2 -1
- package/lib/translations/merge-overrides.d.ts.map +1 -1
- package/lib/translations/merge-overrides.js +8 -1
- package/lib/translations/pages/contact.d.ts +61 -0
- package/lib/translations/pages/contact.d.ts.map +1 -1
- package/lib/translations/pages/contact.js +64 -2
- package/lib/translations/translations-context.d.ts +2 -0
- package/lib/translations/translations-context.d.ts.map +1 -1
- package/lib/translations/translations-context.js +39 -0
- package/lib/types/submit-payloads.d.ts +40 -11
- package/lib/types/submit-payloads.d.ts.map +1 -1
- package/lib/types/submit-payloads.js +1 -1
- package/lib/types.d.ts +1 -1
- package/lib/types.d.ts.map +1 -1
- package/lib/url-form-type.d.ts +6 -0
- package/lib/url-form-type.d.ts.map +1 -0
- package/lib/url-form-type.js +21 -0
- package/lib/utils.d.ts.map +1 -1
- package/lib/utils.js +10 -0
- package/lib/validation/validationRules.d.ts.map +1 -1
- package/lib/validation/validationRules.js +31 -0
- package/package.json +11 -3
|
@@ -6,11 +6,15 @@ const translations_1 = require("../../../translations");
|
|
|
6
6
|
const components_1 = require("../../../components");
|
|
7
7
|
const checkbox_1 = require("../../../components/checkbox");
|
|
8
8
|
const types_1 = require("../../../types");
|
|
9
|
+
const context_1 = require("../../../modules/config/context");
|
|
10
|
+
const use_lines_1 = require("../../../lines/use-lines");
|
|
9
11
|
const RefundSection = ({ state, send }) => {
|
|
12
|
+
const PageText = (0, translations_1.usePageText)();
|
|
10
13
|
const { t } = (0, translations_1.useTranslation)();
|
|
11
|
-
const
|
|
14
|
+
const { features } = (0, context_1.useContactFormConfig)();
|
|
15
|
+
const ticketTypeOptions = PageText.Contact.input.ticketType.options.filter((option) => option.id == types_1.TicketTypeId.SingleTicket ||
|
|
12
16
|
option.id == types_1.TicketTypeId.PeriodTicket);
|
|
13
|
-
return ((0, jsx_runtime_1.jsxs)(components_1.Fieldset, { title: t(
|
|
17
|
+
return ((0, jsx_runtime_1.jsxs)(components_1.Fieldset, { title: t(PageText.Contact.ticketing.refund.otherTicketRefund.label), children: [state.context.includeOtherTicketTypeSelector && ((0, jsx_runtime_1.jsx)(components_1.Select, { id: "ticketType", label: t(PageText.Contact.input.ticketType.labelRefund), value: state.context.ticketType, valueToId: (option) => option.id, valueToText: (option) => t(option.name), onChange: (value) => {
|
|
14
18
|
if (!value)
|
|
15
19
|
return;
|
|
16
20
|
send({
|
|
@@ -18,33 +22,23 @@ const RefundSection = ({ state, send }) => {
|
|
|
18
22
|
inputName: 'ticketType',
|
|
19
23
|
value: value,
|
|
20
24
|
});
|
|
21
|
-
}, placeholder: t(
|
|
25
|
+
}, placeholder: t(PageText.Contact.input.ticketType.optionLabelRefund), options: ticketTypeOptions, isRequired: true, error: state.context?.errorMessages['ticketType']?.[0]
|
|
22
26
|
? t(state.context?.errorMessages['ticketType'][0])
|
|
23
|
-
: undefined }), (0, jsx_runtime_1.jsx)(components_1.Input, { id: "orderId", label: t(
|
|
27
|
+
: undefined })), (0, jsx_runtime_1.jsx)(components_1.Input, { id: "orderId", label: t(PageText.Contact.input.orderId.label(false)), type: "text", name: "orderId", value: state.context.orderId || '', isRequired: true, errorMessage: state.context?.errorMessages['orderId']?.[0], onChange: (e) => send({
|
|
24
28
|
type: 'ON_INPUT_CHANGE',
|
|
25
29
|
inputName: 'orderId',
|
|
26
30
|
value: e.target.value,
|
|
27
|
-
}),
|
|
28
|
-
description: t(translations_1.PageText.Contact.input.orderId.description),
|
|
29
|
-
instruction: t(translations_1.PageText.Contact.input.orderId.instruction),
|
|
30
|
-
bulletPoints: translations_1.PageText.Contact.input.orderId.descriptionBulletPoints.map((bulletPoint) => t(bulletPoint)),
|
|
31
|
-
} }), state.context.ticketType?.id === types_1.TicketTypeId.PeriodTicket && ((0, jsx_runtime_1.jsx)(components_1.Input, { id: "travelCardNumber", label: t(translations_1.PageText.Contact.input.travelCardNumber.label), type: "text", name: "travelCardNumber", value: state.context.travelCardNumber || '', modalContent: {
|
|
32
|
-
description: t(translations_1.PageText.Contact.input.travelCardNumber.info),
|
|
33
|
-
}, isRequired: true, errorMessage: state.context.errorMessages['travelCardNumber']?.[0], onChange: (e) => send({
|
|
31
|
+
}) }), (0, jsx_runtime_1.jsx)(components_1.Input, { id: "travelCardNumber", label: t(PageText.Contact.input.travelCardNumber.label), type: "text", name: "travelCardNumber", value: state.context.travelCardNumber || '', errorMessage: state.context.errorMessages['travelCardNumber']?.[0], onChange: (e) => send({
|
|
34
32
|
type: 'ON_INPUT_CHANGE',
|
|
35
33
|
inputName: 'travelCardNumber',
|
|
36
34
|
value: e.target.value,
|
|
37
|
-
}) })
|
|
38
|
-
type: 'ON_INPUT_CHANGE',
|
|
39
|
-
inputName: 'amount',
|
|
40
|
-
value: e.target.value,
|
|
41
|
-
}) }), (0, jsx_runtime_1.jsx)(components_1.Textarea, { id: "refundReason", description: t(translations_1.PageText.Contact.input.refundReason.question), value: state.context.refundReason || '', isRequired: true, onChange: (e) => send({
|
|
35
|
+
}) }), (0, jsx_runtime_1.jsx)(components_1.Textarea, { id: "refundReason", description: t(PageText.Contact.input.refundReason.question), value: state.context.refundReason || '', isRequired: true, onChange: (e) => send({
|
|
42
36
|
type: 'ON_INPUT_CHANGE',
|
|
43
37
|
inputName: 'refundReason',
|
|
44
38
|
value: e.target.value,
|
|
45
39
|
}), error: state.context.errorMessages['refundReason']?.[0]
|
|
46
40
|
? t(state.context.errorMessages['refundReason']?.[0])
|
|
47
|
-
: undefined }), (0, jsx_runtime_1.jsx)(components_1.FileInput, { id: "attachments", label: t(
|
|
41
|
+
: undefined }), features?.enableFileUploads && ((0, jsx_runtime_1.jsx)(components_1.FileInput, { id: "attachments", label: t(PageText.Contact.refund.refundTaxi.taxiReceipt.info), iconLabel: t(PageText.Contact.input.feedback.attachment.receipt), name: "attachments", onChange: (files) => {
|
|
48
42
|
send({
|
|
49
43
|
type: 'ON_INPUT_CHANGE',
|
|
50
44
|
inputName: 'attachments',
|
|
@@ -52,58 +46,90 @@ const RefundSection = ({ state, send }) => {
|
|
|
52
46
|
});
|
|
53
47
|
}, errorMessage: state.context?.errorMessages['attachments']?.[0]
|
|
54
48
|
? t(state.context?.errorMessages['attachments']?.[0])
|
|
55
|
-
: undefined })] }));
|
|
49
|
+
: undefined }))] }));
|
|
56
50
|
};
|
|
57
51
|
const AboutYouSection = ({ state, send }) => {
|
|
52
|
+
const PageText = (0, translations_1.usePageText)();
|
|
58
53
|
const { t } = (0, translations_1.useTranslation)();
|
|
59
|
-
return ((0, jsx_runtime_1.jsxs)(components_1.Fieldset, { title: t(
|
|
54
|
+
return ((0, jsx_runtime_1.jsxs)(components_1.Fieldset, { title: t(PageText.Contact.aboutYouInfo.title), children: [(0, jsx_runtime_1.jsx)(components_1.Input, { id: "firstName", label: t(PageText.Contact.input.firstName.label), type: "text", autoComplete: "given-name additional-name", name: "firstName", value: state.context.firstName || '', isRequired: true, errorMessage: state.context?.errorMessages['firstName']?.[0], onChange: (e) => send({
|
|
60
55
|
type: 'ON_INPUT_CHANGE',
|
|
61
56
|
inputName: 'firstName',
|
|
62
57
|
value: e.target.value,
|
|
63
|
-
}) }), (0, jsx_runtime_1.jsx)(components_1.Input, { id: "lastName", label: t(
|
|
58
|
+
}) }), (0, jsx_runtime_1.jsx)(components_1.Input, { id: "lastName", label: t(PageText.Contact.input.lastName.label), type: "text", autoComplete: "family-name", name: "lastName", value: state.context.lastName || '', isRequired: true, errorMessage: state.context?.errorMessages['lastName']?.[0], onChange: (e) => send({
|
|
64
59
|
type: 'ON_INPUT_CHANGE',
|
|
65
60
|
inputName: 'lastName',
|
|
66
61
|
value: e.target.value,
|
|
67
|
-
}) }), (0, jsx_runtime_1.jsx)(components_1.Input, { id: "address", label: t(
|
|
62
|
+
}) }), (0, jsx_runtime_1.jsx)(components_1.Input, { id: "address", label: t(PageText.Contact.input.address.label), type: "text", autoComplete: "street-address", name: "address", value: state.context.address || '', isRequired: true, errorMessage: state.context?.errorMessages['address']?.[0], onChange: (e) => send({
|
|
68
63
|
type: 'ON_INPUT_CHANGE',
|
|
69
64
|
inputName: 'address',
|
|
70
65
|
value: e.target.value,
|
|
71
|
-
}) }), (0, jsx_runtime_1.jsx)(components_1.Input, { id: "postalCode", label: t(
|
|
66
|
+
}) }), (0, jsx_runtime_1.jsx)(components_1.Input, { id: "postalCode", label: t(PageText.Contact.input.postalCode.label), type: "text", autoComplete: "postal-code", name: "postalCode", value: state.context.postalCode || '', isRequired: true, errorMessage: state.context?.errorMessages['postalCode']?.[0], onChange: (e) => send({
|
|
72
67
|
type: 'ON_INPUT_CHANGE',
|
|
73
68
|
inputName: 'postalCode',
|
|
74
69
|
value: e.target.value,
|
|
75
|
-
}) }), (0, jsx_runtime_1.jsx)(components_1.Input, { id: "city", label: t(
|
|
70
|
+
}) }), (0, jsx_runtime_1.jsx)(components_1.Input, { id: "city", label: t(PageText.Contact.input.city.label), type: "text", name: "city", value: state.context.city || '', isRequired: true, errorMessage: state.context?.errorMessages['city']?.[0], onChange: (e) => send({
|
|
76
71
|
type: 'ON_INPUT_CHANGE',
|
|
77
72
|
inputName: 'city',
|
|
78
73
|
value: e.target.value,
|
|
79
|
-
}) }), (0, jsx_runtime_1.jsx)(components_1.Input, { id: "email", label: t(
|
|
74
|
+
}) }), (0, jsx_runtime_1.jsx)(components_1.Input, { id: "email", label: t(PageText.Contact.input.email.label), type: "email", autoComplete: "email", name: "email", value: state.context.email || '', isRequired: true, errorMessage: state.context?.errorMessages['email']?.[0], onChange: (e) => send({
|
|
80
75
|
type: 'ON_INPUT_CHANGE',
|
|
81
76
|
inputName: 'email',
|
|
82
77
|
value: e.target.value,
|
|
83
|
-
}) }), (0, jsx_runtime_1.jsx)(components_1.Input, { id: "phoneNumber", label: t(
|
|
78
|
+
}) }), (0, jsx_runtime_1.jsx)(components_1.Input, { id: "phoneNumber", label: t(PageText.Contact.input.phoneNumber.label), type: "tel", name: "phoneNumber", value: state.context.phoneNumber || '', isRequired: true, errorMessage: state.context?.errorMessages['phoneNumber']?.[0], onChange: (e) => send({
|
|
84
79
|
type: 'ON_INPUT_CHANGE',
|
|
85
80
|
inputName: 'phoneNumber',
|
|
86
81
|
value: e.target.value,
|
|
87
|
-
}) }), (0, jsx_runtime_1.jsx)(components_1.Input, { id: "bankAccountNumber", label: t(
|
|
82
|
+
}) }), (0, jsx_runtime_1.jsx)(components_1.Input, { id: "bankAccountNumber", label: t(PageText.Contact.input.bankInformation.bankAccountNumber.label), placeholder: t(PageText.Contact.input.bankInformation.bankAccountNumber.placeholder), type: "text", name: "bankAccountNumber", value: state.context.bankAccountNumber || '', disabled: state.context.hasInternationalBankAccount, isRequired: true, errorMessage: state.context?.errorMessages['bankAccountNumber']?.[0], onChange: (e) => send({
|
|
88
83
|
type: 'ON_INPUT_CHANGE',
|
|
89
84
|
inputName: 'bankAccountNumber',
|
|
90
85
|
value: e.target.value,
|
|
91
|
-
}) }), (0, jsx_runtime_1.jsx)(checkbox_1.Checkbox, { label: t(
|
|
86
|
+
}) }), (0, jsx_runtime_1.jsx)(checkbox_1.Checkbox, { label: t(PageText.Contact.input.bankInformation.checkbox), checked: state.context.hasInternationalBankAccount, onChange: () => send({
|
|
92
87
|
type: 'ON_INPUT_CHANGE',
|
|
93
88
|
inputName: 'hasInternationalBankAccount',
|
|
94
89
|
value: !state.context.hasInternationalBankAccount,
|
|
95
|
-
}) }), state.context.hasInternationalBankAccount && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(components_1.Input, { id: "IBAN", label: t(
|
|
90
|
+
}) }), state.context.hasInternationalBankAccount && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(components_1.Input, { id: "IBAN", label: t(PageText.Contact.input.bankInformation.IBAN.label), type: "string", name: "IBAN", value: state.context.IBAN || '', isRequired: true, errorMessage: state.context?.errorMessages['IBAN']?.[0], onChange: (e) => send({
|
|
96
91
|
type: 'ON_INPUT_CHANGE',
|
|
97
92
|
inputName: 'IBAN',
|
|
98
93
|
value: e.target.value,
|
|
99
|
-
}) }), (0, jsx_runtime_1.jsx)(components_1.Input, { id: "SWIFT", label: t(
|
|
94
|
+
}) }), (0, jsx_runtime_1.jsx)(components_1.Input, { id: "SWIFT", label: t(PageText.Contact.input.bankInformation.SWIFT.label), type: "string", name: "SWIFT", value: state.context.SWIFT || '', isRequired: true, errorMessage: state.context?.errorMessages['SWIFT']?.[0], onChange: (e) => send({
|
|
100
95
|
type: 'ON_INPUT_CHANGE',
|
|
101
96
|
inputName: 'SWIFT',
|
|
102
97
|
value: e.target.value,
|
|
103
98
|
}) })] }))] }));
|
|
104
99
|
};
|
|
100
|
+
const DepartureSection = ({ state, send }) => {
|
|
101
|
+
const PageText = (0, translations_1.usePageText)();
|
|
102
|
+
const { t } = (0, translations_1.useTranslation)();
|
|
103
|
+
const { getLinesByMode, getQuaysByLine } = (0, use_lines_1.useLines)();
|
|
104
|
+
const transportModeOptions = (0, use_lines_1.useTransportModeOptions)();
|
|
105
|
+
return ((0, jsx_runtime_1.jsxs)(components_1.Fieldset, { title: t(PageText.Contact.refund.refundTaxi.aboutYourTrip.title), children: [(0, jsx_runtime_1.jsx)(components_1.Select, { id: "transportMode", label: t(PageText.Contact.input.transportMode.label), value: state.context.transportMode || '', onChange: (value) => send({
|
|
106
|
+
type: 'ON_TRANSPORTMODE_CHANGE',
|
|
107
|
+
value: value,
|
|
108
|
+
}), isRequired: true, error: state.context?.errorMessages['transportMode']?.[0]
|
|
109
|
+
? t(state.context?.errorMessages['transportMode']?.[0])
|
|
110
|
+
: undefined, valueToId: (val) => val, valueToText: (val) => t(PageText.Contact.input.transportMode.modes[val]), options: transportModeOptions, placeholder: t(PageText.Contact.input.transportMode.optionLabel) }), (0, jsx_runtime_1.jsx)(components_1.SearchableSelect, { id: "line", label: t(PageText.Contact.input.line.label), value: state.context.line, placeholder: t(PageText.Contact.input.line.optionLabel), isDisabled: !state.context.transportMode, options: (0, components_1.getLineOptions)(getLinesByMode(state.context.transportMode)), onChange: (value) => {
|
|
111
|
+
send({ type: 'ON_LINE_CHANGE', value });
|
|
112
|
+
}, isRequired: true, error: state.context?.errorMessages['line']?.[0] &&
|
|
113
|
+
t(state.context?.errorMessages['line']?.[0]) }), (0, jsx_runtime_1.jsx)(components_1.SearchableSelect, { id: "fromStop", label: t(PageText.Contact.input.fromStop.label), value: state.context.fromStop, isDisabled: !state.context.line, onChange: (value) => send({ type: 'ON_INPUT_CHANGE', inputName: 'fromStop', value }), options: (0, components_1.getStopOptions)(getQuaysByLine(state.context.line?.id ?? '')), placeholder: t(PageText.Contact.input.fromStop.optionLabel), isRequired: true, error: state.context?.errorMessages['fromStop']?.[0]
|
|
114
|
+
? t(state.context?.errorMessages['fromStop']?.[0])
|
|
115
|
+
: undefined }), (0, jsx_runtime_1.jsx)(components_1.SearchableSelect, { id: "toStop", label: t(PageText.Contact.input.toStop.label), value: state.context.toStop, isDisabled: !state.context.line, onChange: (value) => send({ type: 'ON_INPUT_CHANGE', inputName: 'toStop', value }), options: (0, components_1.getStopOptions)(getQuaysByLine(state.context.line?.id ?? '')), placeholder: t(PageText.Contact.input.toStop.optionLabel), isRequired: true, error: state.context?.errorMessages['toStop']?.[0]
|
|
116
|
+
? t(state.context?.errorMessages['toStop']?.[0])
|
|
117
|
+
: undefined }), (0, jsx_runtime_1.jsx)(components_1.DateSelector, { id: "date", label: t(PageText.Contact.input.date.label), isRequired: true, value: state.context.date, onChange: (date) => send({ type: 'ON_INPUT_CHANGE', inputName: 'date', value: date }), errorMessage: state.context?.errorMessages['date']?.[0] }), (0, jsx_runtime_1.jsx)(components_1.DepartureTimeField, { date: state.context.date, lineId: state.context.line?.id, fromStopId: state.context.fromStop?.id, toStopId: state.context.toStop?.id, selectedTripId: state.context.tripId, plannedDepartureTime: state.context.plannedDepartureTime, onChange: (time, tripId) => {
|
|
118
|
+
send({
|
|
119
|
+
type: 'ON_INPUT_CHANGE',
|
|
120
|
+
inputName: 'plannedDepartureTime',
|
|
121
|
+
value: time,
|
|
122
|
+
});
|
|
123
|
+
send({
|
|
124
|
+
type: 'ON_INPUT_CHANGE',
|
|
125
|
+
inputName: 'tripId',
|
|
126
|
+
value: tripId,
|
|
127
|
+
});
|
|
128
|
+
}, isRequired: true, errorMessage: state.context.errorMessages['plannedDepartureTime']?.[0] })] }));
|
|
129
|
+
};
|
|
105
130
|
const OtherTicketRefund = ({ state, send }) => {
|
|
106
|
-
|
|
131
|
+
const { features } = (0, context_1.useContactFormConfig)();
|
|
132
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(RefundSection, { state: state, send: send }), (0, jsx_runtime_1.jsx)(AboutYouSection, { state: state, send: send }), features?.includeRefundDepartureInfo && ((0, jsx_runtime_1.jsx)(DepartureSection, { state: state, send: send }))] }));
|
|
107
133
|
};
|
|
108
134
|
exports.OtherTicketRefund = OtherTicketRefund;
|
|
109
135
|
exports.default = exports.OtherTicketRefund;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/refund/forms/residualValueOnTravelCard/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/refund/forms/residualValueOnTravelCard/index.tsx"],"names":[],"mappings":"AAMA,eAAO,MAAM,yBAAyB,GAAI,MAAE,4CAyC3C,CAAC"}
|
|
@@ -5,15 +5,17 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.ResidualValueOnTravelCard = void 0;
|
|
7
7
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
+
const contact_module_css_1 = __importDefault(require("../../../contact.module.css"));
|
|
8
9
|
const link_1 = __importDefault(require("next/link"));
|
|
9
10
|
const typography_1 = require("../../../components/typography");
|
|
10
11
|
const translations_1 = require("../../../translations");
|
|
11
12
|
const components_1 = require("../../../components");
|
|
12
13
|
const ResidualValueOnTravelCard = ({}) => {
|
|
14
|
+
const PageText = (0, translations_1.usePageText)();
|
|
13
15
|
const { t } = (0, translations_1.useTranslation)();
|
|
14
|
-
return ((0, jsx_runtime_1.jsxs)(components_1.Fieldset, { title: t(
|
|
15
|
-
.monthlyPayoutDetails) }), (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)(typography_1.Typo.p, { textType: "body__m__strong", children: t(
|
|
16
|
-
.automatedProcessNotice.note) }), (0, jsx_runtime_1.jsx)(typography_1.Typo.p, { textType: "body__m", children: t(
|
|
16
|
+
return ((0, jsx_runtime_1.jsxs)(components_1.Fieldset, { title: t(PageText.Contact.refund.residualValueOnTravelCard.title), children: [(0, jsx_runtime_1.jsx)(typography_1.Typo.p, { textType: "body__m", children: (0, jsx_runtime_1.jsx)(link_1.default, { className: contact_module_css_1.default.link, href: t(PageText.Contact.refund.residualValueOnTravelCard.link.href), target: "_blank", rel: "noopener noreferrer", children: t(PageText.Contact.refund.residualValueOnTravelCard.link.text) }) }), (0, jsx_runtime_1.jsx)(typography_1.Typo.p, { textType: "body__m", children: t(PageText.Contact.refund.residualValueOnTravelCard
|
|
17
|
+
.monthlyPayoutDetails) }), (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)(typography_1.Typo.p, { textType: "body__m__strong", children: t(PageText.Contact.refund.residualValueOnTravelCard
|
|
18
|
+
.automatedProcessNotice.note) }), (0, jsx_runtime_1.jsx)(typography_1.Typo.p, { textType: "body__m", children: t(PageText.Contact.refund.residualValueOnTravelCard
|
|
17
19
|
.automatedProcessNotice.text) })] })] }));
|
|
18
20
|
};
|
|
19
21
|
exports.ResidualValueOnTravelCard = ResidualValueOnTravelCard;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/refund/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/refund/index.tsx"],"names":[],"mappings":"AAgBA,QAAA,MAAM,aAAa,+CA+HlB,CAAC;AAEF,eAAe,aAAa,CAAC"}
|
package/lib/refund/index.js
CHANGED
|
@@ -8,6 +8,7 @@ const react_1 = require("@xstate/react");
|
|
|
8
8
|
const react_2 = require("react");
|
|
9
9
|
const config_1 = require("../modules/config");
|
|
10
10
|
const refundFormMachine_1 = require("./refundFormMachine");
|
|
11
|
+
const url_form_type_1 = require("../url-form-type");
|
|
11
12
|
const contact_module_css_1 = __importDefault(require("../contact.module.css"));
|
|
12
13
|
const components_1 = require("../components");
|
|
13
14
|
const refund_and_travel_guarantee_1 = __importDefault(require("./forms/refund-and-travel-guarantee"));
|
|
@@ -18,9 +19,11 @@ const translations_1 = require("../translations");
|
|
|
18
19
|
const button_1 = require("../components/button");
|
|
19
20
|
const error_message_1 = __importDefault(require("../components/error-message/error-message"));
|
|
20
21
|
const RefundContent = () => {
|
|
22
|
+
const PageText = (0, translations_1.usePageText)();
|
|
21
23
|
const { t } = (0, translations_1.useTranslation)();
|
|
22
24
|
const apiConfig = (0, config_1.useApiConfig)();
|
|
23
|
-
const { formSchemaOverrides, layout } = (0, config_1.useContactFormConfig)();
|
|
25
|
+
const { formSchemaOverrides, layout, features } = (0, config_1.useContactFormConfig)();
|
|
26
|
+
const customFormRenderers = formSchemaOverrides?.refund?.customFormRenderers;
|
|
24
27
|
const successPath = layout?.successPath ??
|
|
25
28
|
(layout?.basePath ? `${layout.basePath}/success` : '/contact/success');
|
|
26
29
|
const errorPath = layout?.errorPath ??
|
|
@@ -28,7 +31,15 @@ const RefundContent = () => {
|
|
|
28
31
|
const machine = (0, react_2.useMemo)(() => (0, refundFormMachine_1.createRefundStateMachine)(apiConfig.onSubmit, {
|
|
29
32
|
successPath,
|
|
30
33
|
errorPath,
|
|
31
|
-
|
|
34
|
+
includeOtherTicketTypeSelector: features?.includeOtherTicketTypeSelector !== false,
|
|
35
|
+
includeRefundDepartureInfo: features?.includeRefundDepartureInfo === true,
|
|
36
|
+
}), [
|
|
37
|
+
apiConfig.onSubmit,
|
|
38
|
+
successPath,
|
|
39
|
+
errorPath,
|
|
40
|
+
features?.includeOtherTicketTypeSelector,
|
|
41
|
+
features?.includeRefundDepartureInfo,
|
|
42
|
+
]);
|
|
32
43
|
const [state, send] = (0, react_1.useMachine)(machine);
|
|
33
44
|
const displaySubmitButton = state.context.formType &&
|
|
34
45
|
state.context.formType !== 'residualValueOnTravelCard';
|
|
@@ -40,13 +51,35 @@ const RefundContent = () => {
|
|
|
40
51
|
return allCategories;
|
|
41
52
|
return allCategories.filter((category) => override.includes(category));
|
|
42
53
|
}, [formSchemaOverrides]);
|
|
54
|
+
const enabledFormCategoriesRef = (0, react_2.useRef)(enabledFormCategories);
|
|
55
|
+
(0, react_2.useEffect)(() => {
|
|
56
|
+
const { type, agreed } = (0, url_form_type_1.readFormTypeParam)(enabledFormCategoriesRef.current);
|
|
57
|
+
if (type) {
|
|
58
|
+
send({
|
|
59
|
+
type: 'SELECT_FORM_CATEGORY',
|
|
60
|
+
formCategory: type,
|
|
61
|
+
});
|
|
62
|
+
if (agreed && type !== 'residualValueOnTravelCard') {
|
|
63
|
+
send({
|
|
64
|
+
type: 'ON_INPUT_CHANGE',
|
|
65
|
+
inputName: 'isInitialAgreementChecked',
|
|
66
|
+
value: true,
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}, [send]);
|
|
43
71
|
const onSubmit = async (e) => {
|
|
44
72
|
e.preventDefault();
|
|
45
73
|
send({ type: 'SUBMIT', orderedFormFieldNames: (0, utils_1.findOrderFormFields)(e) });
|
|
46
74
|
};
|
|
47
|
-
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(
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
75
|
+
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(PageText.Contact.refund.title), children: (0, jsx_runtime_1.jsx)("ul", { className: contact_module_css_1.default.form_options__list, children: enabledFormCategories.map((formCategory) => ((0, jsx_runtime_1.jsx)("li", { children: (0, jsx_runtime_1.jsx)(components_1.Radio, { label: t(PageText.Contact.refund[formCategory].description), checked: state.matches({ editing: formCategory }), onChange: () => {
|
|
76
|
+
(0, url_form_type_1.setFormTypeParam)(formCategory);
|
|
77
|
+
send({
|
|
78
|
+
type: 'SELECT_FORM_CATEGORY',
|
|
79
|
+
formCategory: formCategory,
|
|
80
|
+
});
|
|
81
|
+
} }) }, formCategory))) }) }), state.matches({ editing: 'refundOfTicket' }) && ((0, jsx_runtime_1.jsx)(refund_ticket_1.default, { state: state, send: send })), state.matches({ editing: 'refundAndTravelGuarantee' }) && ((0, jsx_runtime_1.jsx)(refund_and_travel_guarantee_1.default, { state: state, send: send })), state.matches({ editing: 'residualValueOnTravelCard' }) &&
|
|
82
|
+
(customFormRenderers?.residualValueOnTravelCard ? (customFormRenderers.residualValueOnTravelCard(state, send)) : ((0, jsx_runtime_1.jsx)(residualValueOnTravelCard_1.ResidualValueOnTravelCard, {}))), state.matches({ editing: 'ticketBoughtOnBus' }) &&
|
|
83
|
+
customFormRenderers?.ticketBoughtOnBus?.(state, send), state.context.hasSubmissionError && ((0, jsx_runtime_1.jsx)(error_message_1.default, { message: t(PageText.Contact.error.info), id: "submission-error" })), displaySubmitButton && ((0, jsx_runtime_1.jsx)(button_1.Button, { title: t(PageText.Contact.submit), mode: 'interactive_0--bordered', buttonProps: { type: 'submit' }, state: state.matches('submitting') ? 'loading' : undefined, className: contact_module_css_1.default.submitButton }))] }));
|
|
51
84
|
};
|
|
52
85
|
exports.default = RefundContent;
|
|
@@ -5,7 +5,8 @@ import type { FormSchemaName } from '../modules/config/types';
|
|
|
5
5
|
export declare enum FormCategory {
|
|
6
6
|
RefundOfTicket = "refundOfTicket",
|
|
7
7
|
RefundAndTravelGuarantee = "refundAndTravelGuarantee",
|
|
8
|
-
ResidualValueOnTravelCard = "residualValueOnTravelCard"
|
|
8
|
+
ResidualValueOnTravelCard = "residualValueOnTravelCard",
|
|
9
|
+
TicketBoughtOnBus = "ticketBoughtOnBus"
|
|
9
10
|
}
|
|
10
11
|
export declare enum RefundTicketForm {
|
|
11
12
|
AppTicketRefund = "appTicketRefund",
|
|
@@ -20,7 +21,10 @@ export declare enum FormType {
|
|
|
20
21
|
RefundCar = "refundCar",
|
|
21
22
|
AppTicketRefund = "appTicketRefund",
|
|
22
23
|
OtherTicketRefund = "otherTicketRefund",
|
|
23
|
-
ResidualValueOnTravelCard = "residualValueOnTravelCard"
|
|
24
|
+
ResidualValueOnTravelCard = "residualValueOnTravelCard",
|
|
25
|
+
TicketBoughtOnBus = "ticketBoughtOnBus",
|
|
26
|
+
TravelMoneyRefund = "travelMoneyRefund",
|
|
27
|
+
WebshopTicketRefund = "webshopTicketRefund"
|
|
24
28
|
}
|
|
25
29
|
type SubmitInput = {
|
|
26
30
|
firstName?: string;
|
|
@@ -41,6 +45,7 @@ type SubmitInput = {
|
|
|
41
45
|
toStop?: string;
|
|
42
46
|
date?: string;
|
|
43
47
|
plannedDepartureTime?: string;
|
|
48
|
+
tripId?: string;
|
|
44
49
|
kilometersDriven?: string;
|
|
45
50
|
fromAddress?: string;
|
|
46
51
|
toAddress?: string;
|
|
@@ -52,6 +57,7 @@ type SubmitInput = {
|
|
|
52
57
|
travelCardNumber?: string;
|
|
53
58
|
refundReason?: string;
|
|
54
59
|
purchasePlatform?: string;
|
|
60
|
+
bankCardDetails?: string;
|
|
55
61
|
};
|
|
56
62
|
export type RefundContextProps = {
|
|
57
63
|
formType?: FormType;
|
|
@@ -73,6 +79,7 @@ export type RefundContextProps = {
|
|
|
73
79
|
toStop?: Line['quays'][0] | undefined;
|
|
74
80
|
date?: string;
|
|
75
81
|
plannedDepartureTime?: string;
|
|
82
|
+
tripId?: string;
|
|
76
83
|
kilometersDriven?: string;
|
|
77
84
|
fromAddress?: string;
|
|
78
85
|
toAddress?: string;
|
|
@@ -84,8 +91,11 @@ export type RefundContextProps = {
|
|
|
84
91
|
travelCardNumber?: string;
|
|
85
92
|
refundReason?: string;
|
|
86
93
|
purchasePlatform?: PurchasePlatformType | undefined;
|
|
94
|
+
bankCardDetails?: string;
|
|
87
95
|
isInitialAgreementChecked: boolean;
|
|
88
96
|
hasInternationalBankAccount: boolean;
|
|
97
|
+
includeOtherTicketTypeSelector: boolean;
|
|
98
|
+
includeRefundDepartureInfo: boolean;
|
|
89
99
|
errorMessages: InputErrorMessages;
|
|
90
100
|
firstIncorrectErrorMessage?: string;
|
|
91
101
|
hasSubmissionError?: boolean;
|
|
@@ -93,10 +103,12 @@ export type RefundContextProps = {
|
|
|
93
103
|
export type MachinePaths = {
|
|
94
104
|
successPath: string;
|
|
95
105
|
errorPath: string;
|
|
106
|
+
includeOtherTicketTypeSelector?: boolean;
|
|
107
|
+
includeRefundDepartureInfo?: boolean;
|
|
96
108
|
};
|
|
97
|
-
export declare function createRefundStateMachine(onSubmit: (schemaName: FormSchemaName, state: Record<string, unknown>) => Promise<Response>, paths?: MachinePaths): import("xstate").StateMachine<RefundContextProps, {
|
|
109
|
+
export declare function createRefundStateMachine(onSubmit: (schemaName: FormSchemaName, state: Record<string, unknown>) => Promise<Response>, paths?: Partial<MachinePaths>): import("xstate").StateMachine<RefundContextProps, {
|
|
98
110
|
type: "ON_INPUT_CHANGE";
|
|
99
|
-
inputName: "formType" | "kilometersDriven" | "fromAddress" | "toAddress" | "amount" | "reasonForTransportFailure" | "orderId" | "customerNumber" | "ticketType" | "travelCardNumber" | "refundReason" | "firstName" | "lastName" | "address" | "postalCode" | "city" | "email" | "phoneNumber" | "bankAccountNumber" | "IBAN" | "SWIFT" | "fromStop" | "toStop" | "date" | "plannedDepartureTime" | "feedback" | "attachments" | "isInitialAgreementChecked" | "hasInternationalBankAccount" | "showInputTravelCardNumber";
|
|
111
|
+
inputName: "formType" | "kilometersDriven" | "fromAddress" | "toAddress" | "amount" | "reasonForTransportFailure" | "orderId" | "customerNumber" | "ticketType" | "travelCardNumber" | "refundReason" | "firstName" | "lastName" | "address" | "postalCode" | "city" | "email" | "phoneNumber" | "bankAccountNumber" | "IBAN" | "SWIFT" | "fromStop" | "toStop" | "date" | "plannedDepartureTime" | "tripId" | "feedback" | "attachments" | "isInitialAgreementChecked" | "hasInternationalBankAccount" | "showInputTravelCardNumber" | "bankCardDetails";
|
|
100
112
|
value: string | boolean | ReasonForTransportFailure | TicketType | Line["quays"][0] | File[] | undefined;
|
|
101
113
|
} | {
|
|
102
114
|
type: "SELECT_FORM_CATEGORY";
|
|
@@ -126,6 +138,9 @@ export declare function createRefundStateMachine(onSubmit: (schemaName: FormSche
|
|
|
126
138
|
logic: import("xstate").PromiseActorLogic<true, SubmitInput, import("xstate").EventObject>;
|
|
127
139
|
id: string | undefined;
|
|
128
140
|
}, {
|
|
141
|
+
type: "onInputChange";
|
|
142
|
+
params: unknown;
|
|
143
|
+
} | {
|
|
129
144
|
type: "navigateToErrorPage";
|
|
130
145
|
params: unknown;
|
|
131
146
|
} | {
|
|
@@ -152,9 +167,6 @@ export declare function createRefundStateMachine(onSubmit: (schemaName: FormSche
|
|
|
152
167
|
} | {
|
|
153
168
|
type: "clearSubmissionError";
|
|
154
169
|
params: unknown;
|
|
155
|
-
} | {
|
|
156
|
-
type: "onInputChange";
|
|
157
|
-
params: unknown;
|
|
158
170
|
} | {
|
|
159
171
|
type: "onTransportModeChange";
|
|
160
172
|
params: unknown;
|
|
@@ -176,6 +188,9 @@ export declare function createRefundStateMachine(onSubmit: (schemaName: FormSche
|
|
|
176
188
|
} | {
|
|
177
189
|
type: "isResidualValueOnTravelCard";
|
|
178
190
|
params: unknown;
|
|
191
|
+
} | {
|
|
192
|
+
type: "isTicketBoughtOnBus";
|
|
193
|
+
params: unknown;
|
|
179
194
|
} | {
|
|
180
195
|
type: "isAppTicketRefund";
|
|
181
196
|
params: unknown;
|
|
@@ -189,7 +204,7 @@ export declare function createRefundStateMachine(onSubmit: (schemaName: FormSche
|
|
|
189
204
|
type: "isRefundTaxi";
|
|
190
205
|
params: unknown;
|
|
191
206
|
}, never, "success" | "formCategoryHandler" | "refundTicketFormHandler" | "refundAndTravelGuaranteeFormHandler" | "validating" | "submitting" | {
|
|
192
|
-
editing: "residualValueOnTravelCard" | "selectFormCategory" | {
|
|
207
|
+
editing: "ticketBoughtOnBus" | "residualValueOnTravelCard" | "selectFormCategory" | {
|
|
193
208
|
refundOfTicket: "appTicketRefund" | "otherTicketRefund" | "selectRefundOfTicketForm";
|
|
194
209
|
} | {
|
|
195
210
|
refundAndTravelGuarantee: "refundTaxi" | "refundCar" | "selectRefundAndTravelGuaranteeForm";
|
|
@@ -236,6 +251,9 @@ export declare function createRefundStateMachine(onSubmit: (schemaName: FormSche
|
|
|
236
251
|
readonly residualValueOnTravelCard: {
|
|
237
252
|
id: "residualValueOnTravelCard";
|
|
238
253
|
};
|
|
254
|
+
readonly ticketBoughtOnBus: {
|
|
255
|
+
id: "ticketBoughtOnBus";
|
|
256
|
+
};
|
|
239
257
|
readonly history: {};
|
|
240
258
|
};
|
|
241
259
|
};
|
|
@@ -250,7 +268,7 @@ export declare function createRefundStateMachine(onSubmit: (schemaName: FormSche
|
|
|
250
268
|
}>;
|
|
251
269
|
export declare const refundStateMachine: import("xstate").StateMachine<RefundContextProps, {
|
|
252
270
|
type: "ON_INPUT_CHANGE";
|
|
253
|
-
inputName: "formType" | "kilometersDriven" | "fromAddress" | "toAddress" | "amount" | "reasonForTransportFailure" | "orderId" | "customerNumber" | "ticketType" | "travelCardNumber" | "refundReason" | "firstName" | "lastName" | "address" | "postalCode" | "city" | "email" | "phoneNumber" | "bankAccountNumber" | "IBAN" | "SWIFT" | "fromStop" | "toStop" | "date" | "plannedDepartureTime" | "feedback" | "attachments" | "isInitialAgreementChecked" | "hasInternationalBankAccount" | "showInputTravelCardNumber";
|
|
271
|
+
inputName: "formType" | "kilometersDriven" | "fromAddress" | "toAddress" | "amount" | "reasonForTransportFailure" | "orderId" | "customerNumber" | "ticketType" | "travelCardNumber" | "refundReason" | "firstName" | "lastName" | "address" | "postalCode" | "city" | "email" | "phoneNumber" | "bankAccountNumber" | "IBAN" | "SWIFT" | "fromStop" | "toStop" | "date" | "plannedDepartureTime" | "tripId" | "feedback" | "attachments" | "isInitialAgreementChecked" | "hasInternationalBankAccount" | "showInputTravelCardNumber" | "bankCardDetails";
|
|
254
272
|
value: string | boolean | ReasonForTransportFailure | TicketType | Line["quays"][0] | File[] | undefined;
|
|
255
273
|
} | {
|
|
256
274
|
type: "SELECT_FORM_CATEGORY";
|
|
@@ -280,6 +298,9 @@ export declare const refundStateMachine: import("xstate").StateMachine<RefundCon
|
|
|
280
298
|
logic: import("xstate").PromiseActorLogic<true, SubmitInput, import("xstate").EventObject>;
|
|
281
299
|
id: string | undefined;
|
|
282
300
|
}, {
|
|
301
|
+
type: "onInputChange";
|
|
302
|
+
params: unknown;
|
|
303
|
+
} | {
|
|
283
304
|
type: "navigateToErrorPage";
|
|
284
305
|
params: unknown;
|
|
285
306
|
} | {
|
|
@@ -306,9 +327,6 @@ export declare const refundStateMachine: import("xstate").StateMachine<RefundCon
|
|
|
306
327
|
} | {
|
|
307
328
|
type: "clearSubmissionError";
|
|
308
329
|
params: unknown;
|
|
309
|
-
} | {
|
|
310
|
-
type: "onInputChange";
|
|
311
|
-
params: unknown;
|
|
312
330
|
} | {
|
|
313
331
|
type: "onTransportModeChange";
|
|
314
332
|
params: unknown;
|
|
@@ -330,6 +348,9 @@ export declare const refundStateMachine: import("xstate").StateMachine<RefundCon
|
|
|
330
348
|
} | {
|
|
331
349
|
type: "isResidualValueOnTravelCard";
|
|
332
350
|
params: unknown;
|
|
351
|
+
} | {
|
|
352
|
+
type: "isTicketBoughtOnBus";
|
|
353
|
+
params: unknown;
|
|
333
354
|
} | {
|
|
334
355
|
type: "isAppTicketRefund";
|
|
335
356
|
params: unknown;
|
|
@@ -343,7 +364,7 @@ export declare const refundStateMachine: import("xstate").StateMachine<RefundCon
|
|
|
343
364
|
type: "isRefundTaxi";
|
|
344
365
|
params: unknown;
|
|
345
366
|
}, never, "success" | "formCategoryHandler" | "refundTicketFormHandler" | "refundAndTravelGuaranteeFormHandler" | "validating" | "submitting" | {
|
|
346
|
-
editing: "residualValueOnTravelCard" | "selectFormCategory" | {
|
|
367
|
+
editing: "ticketBoughtOnBus" | "residualValueOnTravelCard" | "selectFormCategory" | {
|
|
347
368
|
refundOfTicket: "appTicketRefund" | "otherTicketRefund" | "selectRefundOfTicketForm";
|
|
348
369
|
} | {
|
|
349
370
|
refundAndTravelGuarantee: "refundTaxi" | "refundCar" | "selectRefundAndTravelGuaranteeForm";
|
|
@@ -390,6 +411,9 @@ export declare const refundStateMachine: import("xstate").StateMachine<RefundCon
|
|
|
390
411
|
readonly residualValueOnTravelCard: {
|
|
391
412
|
id: "residualValueOnTravelCard";
|
|
392
413
|
};
|
|
414
|
+
readonly ticketBoughtOnBus: {
|
|
415
|
+
id: "ticketBoughtOnBus";
|
|
416
|
+
};
|
|
393
417
|
readonly history: {};
|
|
394
418
|
};
|
|
395
419
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"refundFormMachine.d.ts","sourceRoot":"","sources":["../../src/refund/refundFormMachine.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,oBAAoB,EACpB,iBAAiB,EACjB,yBAAyB,EACzB,UAAU,
|
|
1
|
+
{"version":3,"file":"refundFormMachine.d.ts","sourceRoot":"","sources":["../../src/refund/refundFormMachine.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,oBAAoB,EACpB,iBAAiB,EACjB,yBAAyB,EACzB,UAAU,EACX,MAAM,UAAU,CAAC;AAElB,OAAO,EAAE,IAAI,EAAE,MAAM,sCAAsC,CAAC;AAC5D,OAAO,EAAwB,kBAAkB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