@mrfylke/contact-form 0.1.32 → 0.1.34

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.
Files changed (124) hide show
  1. package/README.md +0 -22
  2. package/lib/commoneEvents.d.ts +1 -1
  3. package/lib/commoneEvents.d.ts.map +1 -1
  4. package/lib/components/form/date-selector.d.ts +4 -1
  5. package/lib/components/form/date-selector.d.ts.map +1 -1
  6. package/lib/components/form/date-selector.js +2 -2
  7. package/lib/components/form/file-input.js +1 -1
  8. package/lib/components/form/form.module.css +0 -74
  9. package/lib/components/form/input.d.ts +2 -6
  10. package/lib/components/form/input.d.ts.map +1 -1
  11. package/lib/components/form/input.js +7 -22
  12. package/lib/components/form/textarea.d.ts +3 -2
  13. package/lib/components/form/textarea.d.ts.map +1 -1
  14. package/lib/components/form/textarea.js +6 -4
  15. package/lib/components/form/time-selector.d.ts.map +1 -1
  16. package/lib/components/form/time-selector.js +1 -1
  17. package/lib/index.d.ts +1 -1
  18. package/lib/index.d.ts.map +1 -1
  19. package/lib/journey-info/journeyInfoStateMachine.d.ts +2 -2
  20. package/lib/layouts/contact-pages.d.ts.map +1 -1
  21. package/lib/layouts/contact-pages.js +7 -2
  22. package/lib/lines/use-lines.d.ts +1 -0
  23. package/lib/lines/use-lines.d.ts.map +1 -1
  24. package/lib/lines/use-lines.js +1 -0
  25. package/lib/lost-property/LostPropertyForm.d.ts +6 -0
  26. package/lib/lost-property/LostPropertyForm.d.ts.map +1 -1
  27. package/lib/lost-property/LostPropertyForm.js +54 -12
  28. package/lib/lost-property/LostPropertyMachine.d.ts +5 -4
  29. package/lib/lost-property/LostPropertyMachine.d.ts.map +1 -1
  30. package/lib/lost-property/LostPropertyMachine.js +5 -1
  31. package/lib/lost-property/index.d.ts.map +1 -1
  32. package/lib/lost-property/index.js +40 -3
  33. package/lib/means-of-transport/forms/injuryForm.d.ts.map +1 -1
  34. package/lib/means-of-transport/forms/injuryForm.js +1 -1
  35. package/lib/means-of-transport/means-of-transport-form-machine.d.ts +2 -2
  36. package/lib/modules/api-browser/index.d.ts +1 -1
  37. package/lib/modules/api-browser/index.d.ts.map +1 -1
  38. package/lib/modules/api-browser/index.js +5 -1
  39. package/lib/modules/config/context.d.ts.map +1 -1
  40. package/lib/modules/config/context.js +1 -4
  41. package/lib/modules/config/theme-adapter.d.ts.map +1 -1
  42. package/lib/modules/config/theme-adapter.js +2 -0
  43. package/lib/modules/config/types.d.ts +53 -8
  44. package/lib/modules/config/types.d.ts.map +1 -1
  45. package/lib/modules/transport-mode/utils.d.ts +2 -2
  46. package/lib/modules/transport-mode/utils.d.ts.map +1 -1
  47. package/lib/refund/events.d.ts +3 -3
  48. package/lib/refund/events.d.ts.map +1 -1
  49. package/lib/refund/forms/refund-and-travel-guarantee/index.d.ts.map +1 -1
  50. package/lib/refund/forms/refund-and-travel-guarantee/index.js +10 -3
  51. package/lib/refund/forms/refund-and-travel-guarantee/pre-purchased-ticket-refund-form/index.d.ts +11 -0
  52. package/lib/refund/forms/refund-and-travel-guarantee/pre-purchased-ticket-refund-form/index.d.ts.map +1 -0
  53. package/lib/refund/forms/refund-and-travel-guarantee/pre-purchased-ticket-refund-form/index.js +159 -0
  54. package/lib/refund/forms/refund-and-travel-guarantee/pre-purchased-ticket-refund-form/pre-purchased-ticket-refund-form.module.css +73 -0
  55. package/lib/refund/forms/refund-and-travel-guarantee/refundCarForm.d.ts.map +1 -1
  56. package/lib/refund/forms/refund-and-travel-guarantee/refundCarForm.js +2 -2
  57. package/lib/refund/forms/refund-and-travel-guarantee/refundTaxiForm.d.ts.map +1 -1
  58. package/lib/refund/forms/refund-and-travel-guarantee/refundTaxiForm.js +2 -2
  59. package/lib/refund/forms/refund-ticket/appTicketRefund.d.ts.map +1 -1
  60. package/lib/refund/forms/refund-ticket/appTicketRefund.js +13 -15
  61. package/lib/refund/forms/refund-ticket/otherTicketRefund.d.ts.map +1 -1
  62. package/lib/refund/forms/refund-ticket/otherTicketRefund.js +16 -13
  63. package/lib/refund/index.d.ts.map +1 -1
  64. package/lib/refund/index.js +6 -4
  65. package/lib/refund/refundFormMachine.d.ts +49 -13
  66. package/lib/refund/refundFormMachine.d.ts.map +1 -1
  67. package/lib/refund/refundFormMachine.js +75 -9
  68. package/lib/server/journey-planner/entur-client.d.ts +2 -1
  69. package/lib/server/journey-planner/entur-client.d.ts.map +1 -1
  70. package/lib/ticket-control/forms/feeComplaintForm.js +4 -10
  71. package/lib/ticket-control/forms/postponePayment.d.ts.map +1 -1
  72. package/lib/ticket-control/forms/postponePayment.js +2 -6
  73. package/lib/ticket-control/ticket-control-form-machine.d.ts +2 -2
  74. package/lib/ticketing/forms/app/appAccountForm.d.ts.map +1 -1
  75. package/lib/ticketing/forms/app/appAccountForm.js +1 -3
  76. package/lib/ticketing/forms/app/appTicketingForm.d.ts.map +1 -1
  77. package/lib/ticketing/forms/app/appTicketingForm.js +2 -8
  78. package/lib/ticketing/forms/app/appTravelSuggestionForm.d.ts.map +1 -1
  79. package/lib/ticketing/forms/app/appTravelSuggestionForm.js +5 -1
  80. package/lib/ticketing/forms/priceAndTicketTypesForm.d.ts.map +1 -1
  81. package/lib/ticketing/forms/priceAndTicketTypesForm.js +5 -1
  82. package/lib/ticketing/forms/travel-card/travelCardQuestionForm.d.ts.map +1 -1
  83. package/lib/ticketing/forms/travel-card/travelCardQuestionForm.js +5 -8
  84. package/lib/ticketing/forms/webshop/webshopAccountForm.d.ts.map +1 -1
  85. package/lib/ticketing/forms/webshop/webshopAccountForm.js +1 -3
  86. package/lib/ticketing/forms/webshop/webshopTicketingForm.d.ts.map +1 -1
  87. package/lib/ticketing/forms/webshop/webshopTicketingForm.js +2 -7
  88. package/lib/ticketing/index.d.ts.map +1 -1
  89. package/lib/ticketing/index.js +8 -2
  90. package/lib/ticketing/ticketingStateMachine.d.ts +4 -2
  91. package/lib/ticketing/ticketingStateMachine.d.ts.map +1 -1
  92. package/lib/ticketing/ticketingStateMachine.js +4 -1
  93. package/lib/translations/commons.d.ts +1 -1
  94. package/lib/translations/commons.d.ts.map +1 -1
  95. package/lib/translations/commons.js +3 -1
  96. package/lib/translations/language-context.d.ts +2 -2
  97. package/lib/translations/language-context.d.ts.map +1 -1
  98. package/lib/translations/language-context.js +1 -1
  99. package/lib/translations/pages/contact.d.ts +46 -18
  100. package/lib/translations/pages/contact.d.ts.map +1 -1
  101. package/lib/translations/pages/contact.js +53 -26
  102. package/lib/translations/translations-context.d.ts +11 -4
  103. package/lib/translations/translations-context.d.ts.map +1 -1
  104. package/lib/translations/translations-context.js +18 -11
  105. package/lib/translations/types.d.ts +10 -5
  106. package/lib/translations/types.d.ts.map +1 -1
  107. package/lib/types/submit-payloads.d.ts +12 -0
  108. package/lib/types/submit-payloads.d.ts.map +1 -1
  109. package/lib/types.d.ts +1 -1
  110. package/lib/types.d.ts.map +1 -1
  111. package/lib/utils/rich-text.d.ts +2 -2
  112. package/lib/utils/rich-text.js +8 -3
  113. package/lib/utils.d.ts +56 -3
  114. package/lib/utils.d.ts.map +1 -1
  115. package/lib/validation/commonInputValidator.d.ts +1 -1
  116. package/lib/validation/commonInputValidator.d.ts.map +1 -1
  117. package/lib/validation/commonInputValidator.js +3 -3
  118. package/lib/validation/validationRules.d.ts +2 -0
  119. package/lib/validation/validationRules.d.ts.map +1 -1
  120. package/lib/validation/validationRules.js +28 -2
  121. package/package.json +12 -6
  122. package/lib/components/form/description-modal.d.ts +0 -13
  123. package/lib/components/form/description-modal.d.ts.map +0 -1
  124. package/lib/components/form/description-modal.js +0 -44
@@ -0,0 +1,159 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.PrePurchasedTicketRefundForm = void 0;
7
+ const jsx_runtime_1 = require("react/jsx-runtime");
8
+ const react_1 = require("react");
9
+ const date_1 = require("@internationalized/date");
10
+ const react_aria_components_1 = require("react-aria-components");
11
+ const use_lines_1 = require("../../../../lines/use-lines");
12
+ const use_departures_1 = require("../../../../lines/use-departures");
13
+ const components_1 = require("../../../../components");
14
+ const button_1 = require("../../../../components/button");
15
+ const icon_1 = require("../../../../components/icon");
16
+ const typography_1 = require("../../../../components/typography");
17
+ const checkbox_1 = require("../../../../components/checkbox");
18
+ const error_message_1 = require("../../../../components/error-message");
19
+ const pre_purchased_ticket_refund_form_module_css_1 = __importDefault(require("./pre-purchased-ticket-refund-form.module.css"));
20
+ const translations_1 = require("../../../../translations");
21
+ const config_1 = require("../../../../modules/config");
22
+ const PrePurchasedTicketRefundForm = ({ state, send, }) => {
23
+ const { t } = (0, translations_1.useTranslation)();
24
+ const PageText = (0, translations_1.usePageText)();
25
+ const { features } = (0, config_1.useContactFormConfig)();
26
+ const { getLinesByMode, getQuaysByLine } = (0, use_lines_1.useLines)();
27
+ const [draft, setDraft] = (0, react_1.useState)({});
28
+ // Same locale and format as the DateSelector's segments.
29
+ const { locale } = (0, react_aria_components_1.useLocale)();
30
+ const dateFormatter = new date_1.DateFormatter(locale, {
31
+ year: 'numeric',
32
+ month: '2-digit',
33
+ day: '2-digit',
34
+ timeZone: 'Europe/Oslo',
35
+ });
36
+ const departures = state.context.prePurchasedTicketDelayedDepartures ?? [];
37
+ const quayOptions = (0, components_1.getStopOptions)(getQuaysByLine(draft.line?.id ?? ''));
38
+ const texts = PageText.Contact.refund.prePurchasedTicketRefund;
39
+ const delayedDeparturesError = state.context?.errorMessages['prePurchasedTicketDelayedDepartures']?.[0];
40
+ // Claims must be sent within two months; allow from the 1st two months
41
+ // back for some buffer.
42
+ const latestDate = (0, date_1.today)('Europe/Oslo');
43
+ const earliestDate = latestDate.subtract({ months: 2 }).set({ day: 1 });
44
+ const isDraftComplete = !!draft.line &&
45
+ !!draft.fromStop &&
46
+ !!draft.toStop &&
47
+ !!draft.date &&
48
+ draft.date >= earliestDate.toString() &&
49
+ draft.date <= latestDate.toString() &&
50
+ !!draft.plannedDepartureTime;
51
+ const addDraft = () => {
52
+ if (!isDraftComplete)
53
+ return;
54
+ const departure = draft;
55
+ const isDuplicate = departures.some((d) => d.line.id === departure.line.id &&
56
+ d.date === departure.date &&
57
+ d.plannedDepartureTime === departure.plannedDepartureTime &&
58
+ d.fromStop.id === departure.fromStop.id &&
59
+ d.toStop.id === departure.toStop.id);
60
+ if (!isDuplicate) {
61
+ send({
62
+ type: 'ON_INPUT_CHANGE',
63
+ inputName: 'prePurchasedTicketDelayedDepartures',
64
+ // Kept sorted first to last, so the table and payload read in order.
65
+ value: [...departures, departure].sort((a, b) => `${a.date} ${a.plannedDepartureTime}`.localeCompare(`${b.date} ${b.plannedDepartureTime}`)),
66
+ });
67
+ }
68
+ // Keep line and stops; the next delayed departure is usually the same trip.
69
+ setDraft({
70
+ line: draft.line,
71
+ fromStop: draft.fromStop,
72
+ toStop: draft.toStop,
73
+ });
74
+ };
75
+ return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)(components_1.Fieldset, { title: t(texts.aboutYourTicket.title), children: [(0, jsx_runtime_1.jsx)(typography_1.Typo.p, { textType: "body__m", children: t(texts.info) }), (0, jsx_runtime_1.jsx)(components_1.Input, { id: "orderId", label: t(PageText.Contact.input.orderId.label(true)), type: "text", name: "orderId", value: state.context.orderId || '', isRequired: true, errorMessage: state.context?.errorMessages['orderId']?.[0], onChange: (e) => send({
76
+ type: 'ON_INPUT_CHANGE',
77
+ inputName: 'orderId',
78
+ value: e.target.value,
79
+ }), description: t(PageText.Contact.input.orderId.description) }), (0, jsx_runtime_1.jsx)(components_1.Textarea, { id: "refundReason", label: t(PageText.Contact.input.refundReason.question), value: state.context.refundReason || '', isRequired: true, onChange: (e) => send({
80
+ type: 'ON_INPUT_CHANGE',
81
+ inputName: 'refundReason',
82
+ value: e.target.value,
83
+ }), error: state.context.errorMessages['refundReason']?.[0]
84
+ ? t(state.context.errorMessages['refundReason']?.[0])
85
+ : undefined })] }), (0, jsx_runtime_1.jsxs)(components_1.Fieldset, { title: t(texts.delayedDepartures.title), children: [(0, jsx_runtime_1.jsx)(typography_1.Typo.p, { textType: "body__m", children: t(texts.delayedDepartures.info) }), (0, jsx_runtime_1.jsx)(components_1.SearchableSelect, { id: "delayedDepartureLine", label: t(PageText.Contact.input.line.label), value: draft.line, placeholder: t(PageText.Contact.input.line.optionLabel), options: (0, components_1.getLineOptions)(getLinesByMode('expressboat')), onChange: (value) =>
86
+ // Stops and departures belong to the line; keep only the date.
87
+ setDraft({ line: value, date: draft.date }) }), (0, jsx_runtime_1.jsx)(components_1.SearchableSelect, { id: "delayedDepartureFromStop", label: t(PageText.Contact.input.fromStop.label), value: draft.fromStop, isDisabled: !draft.line, onChange: (value) => setDraft({
88
+ ...draft,
89
+ fromStop: value,
90
+ plannedDepartureTime: undefined,
91
+ tripId: undefined,
92
+ }), options: quayOptions, placeholder: t(PageText.Contact.input.fromStop.optionLabel) }), (0, jsx_runtime_1.jsx)(components_1.SearchableSelect, { id: "delayedDepartureToStop", label: t(PageText.Contact.input.toStop.label), value: draft.toStop, isDisabled: !draft.line, onChange: (value) => setDraft({
93
+ ...draft,
94
+ toStop: value,
95
+ plannedDepartureTime: undefined,
96
+ tripId: undefined,
97
+ }), options: quayOptions, placeholder: t(PageText.Contact.input.toStop.optionLabel) }), (0, jsx_runtime_1.jsx)(components_1.DateSelector, { id: "delayedDepartureDate", label: t(PageText.Contact.input.date.label), value: draft.date, minValue: earliestDate, maxValue: latestDate, onChange: (date) => setDraft({
98
+ ...draft,
99
+ date,
100
+ plannedDepartureTime: undefined,
101
+ tripId: undefined,
102
+ }) }), (0, jsx_runtime_1.jsx)(components_1.DepartureTimeField, { id: "delayedDeparturePlannedDepartureTime", date: draft.date, lineId: draft.line?.id, fromStopId: draft.fromStop?.id, toStopId: draft.toStop?.id, selectedTripId: draft.tripId, plannedDepartureTime: draft.plannedDepartureTime, onChange: (plannedDepartureTime, tripId) => setDraft({ ...draft, plannedDepartureTime, tripId }) }), (0, jsx_runtime_1.jsx)(button_1.Button, { title: t(texts.delayedDepartures.add), mode: "interactive_0--bordered", disabled: !isDraftComplete, onClick: addDraft,
103
+ // `input__` prefix lets a validation error scroll to this field.
104
+ buttonProps: { id: 'input__prePurchasedTicketDelayedDepartures' } }), departures.length > 0 && ((0, jsx_runtime_1.jsxs)("table", { className: pre_purchased_ticket_refund_form_module_css_1.default.departuresTable, children: [(0, jsx_runtime_1.jsx)("thead", { children: (0, jsx_runtime_1.jsxs)("tr", { children: [(0, jsx_runtime_1.jsx)("th", { children: (0, jsx_runtime_1.jsx)(typography_1.Typo.span, { textType: "body__s__strong", children: t(texts.delayedDepartures.columns.line) }) }), (0, jsx_runtime_1.jsx)("th", { children: (0, jsx_runtime_1.jsx)(typography_1.Typo.span, { textType: "body__s__strong", children: t(texts.delayedDepartures.columns.fromStop) }) }), (0, jsx_runtime_1.jsx)("th", { children: (0, jsx_runtime_1.jsx)(typography_1.Typo.span, { textType: "body__s__strong", children: t(texts.delayedDepartures.columns.toStop) }) }), (0, jsx_runtime_1.jsx)("th", { children: (0, jsx_runtime_1.jsx)(typography_1.Typo.span, { textType: "body__s__strong", children: t(texts.delayedDepartures.columns.date) }) }), (0, jsx_runtime_1.jsx)("th", { children: (0, jsx_runtime_1.jsx)(typography_1.Typo.span, { textType: "body__s__strong", children: t(texts.delayedDepartures.columns.time) }) }), (0, jsx_runtime_1.jsx)("th", { className: pre_purchased_ticket_refund_form_module_css_1.default.removeCell, children: (0, jsx_runtime_1.jsx)("span", { className: pre_purchased_ticket_refund_form_module_css_1.default.visuallyHidden, children: t(texts.delayedDepartures.remove) }) })] }) }), (0, jsx_runtime_1.jsx)("tbody", { children: departures.map((d, index) => ((0, jsx_runtime_1.jsxs)("tr", { children: [(0, jsx_runtime_1.jsx)("td", { children: (0, jsx_runtime_1.jsx)(typography_1.Typo.span, { textType: "body__m", children: d.line.publicCode ?? d.line.name }) }), (0, jsx_runtime_1.jsx)("td", { children: (0, jsx_runtime_1.jsx)(typography_1.Typo.span, { textType: "body__m", children: d.fromStop.name }) }), (0, jsx_runtime_1.jsx)("td", { children: (0, jsx_runtime_1.jsx)(typography_1.Typo.span, { textType: "body__m", children: d.toStop.name }) }), (0, jsx_runtime_1.jsx)("td", { children: (0, jsx_runtime_1.jsx)(typography_1.Typo.span, { textType: "body__m", children: dateFormatter.format((0, date_1.parseDate)(d.date).toDate('Europe/Oslo')) }) }), (0, jsx_runtime_1.jsx)("td", { children: (0, jsx_runtime_1.jsx)(typography_1.Typo.span, { textType: "body__m", children: (0, use_departures_1.formatDepartureTime)(d.plannedDepartureTime) }) }), (0, jsx_runtime_1.jsx)("td", { className: pre_purchased_ticket_refund_form_module_css_1.default.removeCell, children: (0, jsx_runtime_1.jsx)(button_1.Button, { mode: "transparent", className: pre_purchased_ticket_refund_form_module_css_1.default.removeButton, title: t(texts.delayedDepartures.removeLabel), icon: { left: (0, jsx_runtime_1.jsx)(icon_1.MonoIcon, { icon: "actions/Delete" }) }, buttonProps: {
105
+ 'aria-label': t(texts.delayedDepartures.remove),
106
+ }, onClick: () => send({
107
+ type: 'ON_INPUT_CHANGE',
108
+ inputName: 'prePurchasedTicketDelayedDepartures',
109
+ value: departures.filter((_, i) => i !== index),
110
+ }) }) })] }, index))) })] })), delayedDeparturesError && ((0, jsx_runtime_1.jsx)(error_message_1.ErrorMessage, { message: t(delayedDeparturesError), id: "error-prePurchasedTicketDelayedDepartures" }))] }), (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({
111
+ type: 'ON_INPUT_CHANGE',
112
+ inputName: 'firstName',
113
+ value: e.target.value,
114
+ }) }), (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({
115
+ type: 'ON_INPUT_CHANGE',
116
+ inputName: 'lastName',
117
+ value: e.target.value,
118
+ }) }), (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({
119
+ type: 'ON_INPUT_CHANGE',
120
+ inputName: 'address',
121
+ value: e.target.value,
122
+ }) }), (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({
123
+ type: 'ON_INPUT_CHANGE',
124
+ inputName: 'postalCode',
125
+ value: e.target.value,
126
+ }) }), (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({
127
+ type: 'ON_INPUT_CHANGE',
128
+ inputName: 'city',
129
+ value: e.target.value,
130
+ }) }), (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({
131
+ type: 'ON_INPUT_CHANGE',
132
+ inputName: 'email',
133
+ value: e.target.value,
134
+ }) }), (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({
135
+ type: 'ON_INPUT_CHANGE',
136
+ inputName: 'phoneNumber',
137
+ value: e.target.value,
138
+ }) }), (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
139
+ .placeholder), type: "text", name: "bankAccountNumber", value: state.context.bankAccountNumber || '', disabled: state.context.hasInternationalBankAccount, isRequired: true, errorMessage: state.context?.errorMessages['bankAccountNumber']?.[0], onChange: (e) => send({
140
+ type: 'ON_INPUT_CHANGE',
141
+ inputName: 'bankAccountNumber',
142
+ value: e.target.value,
143
+ }) }), features?.enableInternationalBankAccountInTravelGuarantee !==
144
+ false && ((0, jsx_runtime_1.jsx)(checkbox_1.Checkbox, { label: t(PageText.Contact.input.bankInformation.checkbox), checked: state.context.hasInternationalBankAccount, onChange: () => send({
145
+ type: 'ON_INPUT_CHANGE',
146
+ inputName: 'hasInternationalBankAccount',
147
+ value: !state.context.hasInternationalBankAccount,
148
+ }) })), 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), description: t(PageText.Contact.input.bankInformation.IBAN.description), type: "string", name: "IBAN", value: state.context.IBAN || '', isRequired: true, errorMessage: state.context?.errorMessages['IBAN']?.[0], onChange: (e) => send({
149
+ type: 'ON_INPUT_CHANGE',
150
+ inputName: 'IBAN',
151
+ value: e.target.value,
152
+ }) }), (0, jsx_runtime_1.jsx)(components_1.Input, { id: "SWIFT", label: t(PageText.Contact.input.bankInformation.SWIFT.label), description: t(PageText.Contact.input.bankInformation.SWIFT.description), type: "string", name: "SWIFT", value: state.context.SWIFT || '', isRequired: true, errorMessage: state.context?.errorMessages['SWIFT']?.[0], onChange: (e) => send({
153
+ type: 'ON_INPUT_CHANGE',
154
+ inputName: 'SWIFT',
155
+ value: e.target.value,
156
+ }) })] }))] })] }));
157
+ };
158
+ exports.PrePurchasedTicketRefundForm = PrePurchasedTicketRefundForm;
159
+ exports.default = exports.PrePurchasedTicketRefundForm;
@@ -0,0 +1,73 @@
1
+ .departuresTable {
2
+ width: 100%;
3
+ /* separate, not collapse: border-radius has no effect on collapsed tables. */
4
+ border-collapse: separate;
5
+ border-spacing: 0;
6
+ border: token('border.width.slim') solid
7
+ token('color.interactive.2.outline.background');
8
+ border-radius: token('border.radius.small');
9
+ }
10
+
11
+ .departuresTable th,
12
+ .departuresTable td {
13
+ padding: token('spacing.xSmall') token('spacing.small');
14
+ text-align: left;
15
+ vertical-align: middle;
16
+ border-right: token('border.width.slim') solid
17
+ token('color.interactive.2.outline.background');
18
+ border-bottom: token('border.width.slim') solid
19
+ token('color.interactive.2.outline.background');
20
+ }
21
+
22
+ /* The table's own border is the outer frame. */
23
+ .departuresTable tr > :last-child {
24
+ border-right: none;
25
+ }
26
+
27
+ .departuresTable tbody tr:last-child > * {
28
+ border-bottom: none;
29
+ }
30
+
31
+ /* Keep the header background inside the rounded corners. */
32
+ .departuresTable thead th:first-child {
33
+ border-top-left-radius: token('border.radius.small');
34
+ }
35
+
36
+ .departuresTable thead th:last-child {
37
+ border-top-right-radius: token('border.radius.small');
38
+ }
39
+
40
+ .departuresTable thead {
41
+ background-color: token('color.background.neutral.1.background');
42
+ }
43
+
44
+ .removeCell {
45
+ width: 1%;
46
+ text-align: right;
47
+ }
48
+
49
+ .removeButton {
50
+ border-radius: token('border.radius.small');
51
+ }
52
+
53
+ /* Scoped to the table to outrank Button's own transparent :hover color. */
54
+ .departuresTable .removeButton:hover {
55
+ background-color: token('color.interactive.2.hover.background');
56
+ color: token('color.interactive.2.hover.foreground.primary');
57
+ }
58
+
59
+ @media (max-width: 600px) {
60
+ /* Icon only on small screens; the title is Button's last child. */
61
+ .removeButton > :last-child {
62
+ display: none;
63
+ }
64
+ }
65
+
66
+ .visuallyHidden {
67
+ position: absolute;
68
+ width: 1px;
69
+ height: 1px;
70
+ overflow: hidden;
71
+ clip-path: inset(50%);
72
+ white-space: nowrap;
73
+ }
@@ -1 +1 @@
1
- {"version":3,"file":"refundCarForm.d.ts","sourceRoot":"","sources":["../../../../src/refund/forms/refund-and-travel-guarantee/refundCarForm.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAiB7D,KAAK,kBAAkB,GAAG;IACxB,KAAK,EAAE;QAAE,OAAO,EAAE,kBAAkB,CAAA;KAAE,CAAC;IACvC,IAAI,EAAE,CAAC,KAAK,EAAE,OAAO,gBAAgB,KAAK,IAAI,CAAC;CAChD,CAAC;AAEF,eAAO,MAAM,aAAa,GAAI,iBAAiB,kBAAkB,gCAodhE,CAAC;AAEF,eAAe,aAAa,CAAC"}
1
+ {"version":3,"file":"refundCarForm.d.ts","sourceRoot":"","sources":["../../../../src/refund/forms/refund-and-travel-guarantee/refundCarForm.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAiB7D,KAAK,kBAAkB,GAAG;IACxB,KAAK,EAAE;QAAE,OAAO,EAAE,kBAAkB,CAAA;KAAE,CAAC;IACvC,IAAI,EAAE,CAAC,KAAK,EAAE,OAAO,gBAAgB,KAAK,IAAI,CAAC;CAChD,CAAC;AAEF,eAAO,MAAM,aAAa,GAAI,iBAAiB,kBAAkB,gCA0dhE,CAAC;AAEF,eAAe,aAAa,CAAC"}
@@ -132,11 +132,11 @@ const RefundCarForm = ({ state, send }) => {
132
132
  type: 'ON_INPUT_CHANGE',
133
133
  inputName: 'hasInternationalBankAccount',
134
134
  value: !state.context.hasInternationalBankAccount,
135
- }) })), 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({
135
+ }) })), 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), description: t(PageText.Contact.input.bankInformation.IBAN.description), type: "string", name: "IBAN", value: state.context.IBAN || '', isRequired: true, errorMessage: state.context?.errorMessages['IBAN']?.[0], onChange: (e) => send({
136
136
  type: 'ON_INPUT_CHANGE',
137
137
  inputName: 'IBAN',
138
138
  value: e.target.value,
139
- }) }), (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({
139
+ }) }), (0, jsx_runtime_1.jsx)(components_1.Input, { id: "SWIFT", label: t(PageText.Contact.input.bankInformation.SWIFT.label), description: t(PageText.Contact.input.bankInformation.SWIFT.description), type: "string", name: "SWIFT", value: state.context.SWIFT || '', isRequired: true, errorMessage: state.context?.errorMessages['SWIFT']?.[0], onChange: (e) => send({
140
140
  type: 'ON_INPUT_CHANGE',
141
141
  inputName: 'SWIFT',
142
142
  value: e.target.value,
@@ -1 +1 @@
1
- {"version":3,"file":"refundTaxiForm.d.ts","sourceRoot":"","sources":["../../../../src/refund/forms/refund-and-travel-guarantee/refundTaxiForm.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAiB7D,KAAK,mBAAmB,GAAG;IACzB,KAAK,EAAE;QAAE,OAAO,EAAE,kBAAkB,CAAA;KAAE,CAAC;IACvC,IAAI,EAAE,CAAC,KAAK,EAAE,OAAO,gBAAgB,KAAK,IAAI,CAAC;CAChD,CAAC;AAEF,eAAO,MAAM,cAAc,GAAI,iBAAiB,mBAAmB,gCA2blE,CAAC;AAEF,eAAe,cAAc,CAAC"}
1
+ {"version":3,"file":"refundTaxiForm.d.ts","sourceRoot":"","sources":["../../../../src/refund/forms/refund-and-travel-guarantee/refundTaxiForm.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAiB7D,KAAK,mBAAmB,GAAG;IACzB,KAAK,EAAE;QAAE,OAAO,EAAE,kBAAkB,CAAA;KAAE,CAAC;IACvC,IAAI,EAAE,CAAC,KAAK,EAAE,OAAO,gBAAgB,KAAK,IAAI,CAAC;CAChD,CAAC;AAEF,eAAO,MAAM,cAAc,GAAI,iBAAiB,mBAAmB,gCAiclE,CAAC;AAEF,eAAe,cAAc,CAAC"}
@@ -131,11 +131,11 @@ const RefundTaxiForm = ({ state, send }) => {
131
131
  type: 'ON_INPUT_CHANGE',
132
132
  inputName: 'hasInternationalBankAccount',
133
133
  value: !state.context.hasInternationalBankAccount,
134
- }) })), 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({
134
+ }) })), 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), description: t(PageText.Contact.input.bankInformation.IBAN.description), type: "string", name: "IBAN", value: state.context.IBAN || '', isRequired: true, errorMessage: state.context?.errorMessages['IBAN']?.[0], onChange: (e) => send({
135
135
  type: 'ON_INPUT_CHANGE',
136
136
  inputName: 'IBAN',
137
137
  value: e.target.value,
138
- }) }), (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({
138
+ }) }), (0, jsx_runtime_1.jsx)(components_1.Input, { id: "SWIFT", label: t(PageText.Contact.input.bankInformation.SWIFT.label), description: t(PageText.Contact.input.bankInformation.SWIFT.description), type: "string", name: "SWIFT", value: state.context.SWIFT || '', isRequired: true, errorMessage: state.context?.errorMessages['SWIFT']?.[0], onChange: (e) => send({
139
139
  type: 'ON_INPUT_CHANGE',
140
140
  inputName: 'SWIFT',
141
141
  value: e.target.value,
@@ -1 +1 @@
1
- {"version":3,"file":"appTicketRefund.d.ts","sourceRoot":"","sources":["../../../../src/refund/forms/refund-ticket/appTicketRefund.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAkBhD,KAAK,oBAAoB,GAAG;IAC1B,KAAK,EAAE;QAAE,OAAO,EAAE,kBAAkB,CAAA;KAAE,CAAC;IACvC,IAAI,EAAE,CAAC,KAAK,EAAE,OAAO,gBAAgB,KAAK,IAAI,CAAC;CAChD,CAAC;AAEF,eAAO,MAAM,eAAe,GAAI,iBAAiB,oBAAoB,gCA8HpE,CAAC;AAqQF,MAAM,CAAC,OAAO,UAAU,sBAAsB,CAAC,EAC7C,KAAK,EACL,IAAI,GACL,EAAE,oBAAoB,+BAWtB"}
1
+ {"version":3,"file":"appTicketRefund.d.ts","sourceRoot":"","sources":["../../../../src/refund/forms/refund-ticket/appTicketRefund.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,kBAAkB,EACnB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAkBhD,KAAK,oBAAoB,GAAG;IAC1B,KAAK,EAAE;QAAE,OAAO,EAAE,kBAAkB,CAAA;KAAE,CAAC;IACvC,IAAI,EAAE,CAAC,KAAK,EAAE,OAAO,gBAAgB,KAAK,IAAI,CAAC;CAChD,CAAC;AAEF,eAAO,MAAM,eAAe,GAAI,iBAAiB,oBAAoB,gCA6HpE,CAAC;AAqQF,MAAM,CAAC,OAAO,UAAU,sBAAsB,CAAC,EAC7C,KAAK,EACL,IAAI,GACL,EAAE,oBAAoB,+BAWtB"}
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.AppTicketRefund = void 0;
4
4
  exports.default = AppTicketRefundContent;
5
5
  const jsx_runtime_1 = require("react/jsx-runtime");
6
+ const refundFormMachine_1 = require("../../refundFormMachine");
6
7
  const components_1 = require("../../../components");
7
8
  const translations_1 = require("../../../translations");
8
9
  const context_1 = require("../../../modules/config/context");
@@ -12,20 +13,8 @@ const AppTicketRefund = ({ state, send }) => {
12
13
  const { t } = (0, translations_1.useTranslation)();
13
14
  const { features, formSchemaOverrides } = (0, context_1.useContactFormConfig)();
14
15
  const includeCustomerNumberAndPurchasePlatform = features?.includeCustomerNumberAndPurchasePlatformInAppTicketRefund;
15
- return ((0, jsx_runtime_1.jsxs)(components_1.Fieldset, { title: t(PageText.Contact.ticketing.refund.appTicketRefund.label), children: [includeCustomerNumberAndPurchasePlatform && ((0, jsx_runtime_1.jsx)(components_1.Input, { id: "customerNumber", label: t(PageText.Contact.input.customerNumber.label), type: "text", name: "customerNumber", value: state.context.customerNumber || '', isRequired: true, errorMessage: state.context?.errorMessages['customerNumber']?.[0], onChange: (e) => send({
16
- type: 'ON_INPUT_CHANGE',
17
- inputName: 'customerNumber',
18
- value: e.target.value,
19
- }), modalContent: {
20
- description: t(PageText.Contact.input.customerNumber.description),
21
- } })), (0, jsx_runtime_1.jsx)(components_1.Input, { id: "orderId", label: t(PageText.Contact.input.orderId.label(true)), type: "text", name: "orderId", value: state.context.orderId || '', isRequired: true, errorMessage: state.context?.errorMessages['orderId']?.[0], onChange: (e) => send({
22
- type: 'ON_INPUT_CHANGE',
23
- inputName: 'orderId',
24
- value: e.target.value,
25
- }), modalContent: {
26
- description: t(PageText.Contact.input.orderId.description),
27
- bulletPoints: PageText.Contact.input.orderId.descriptionBulletPoints.map((bulletPoint) => t(bulletPoint)),
28
- } }), includeCustomerNumberAndPurchasePlatform && ((0, jsx_runtime_1.jsx)(components_1.Select, { id: "purchasePlatform", label: t(PageText.Contact.input.purchasePlatform.label), value: state.context.purchasePlatform || '', onChange: (value) => send({
16
+ const areOrderIdAndCustomerNumberRelevant = (0, refundFormMachine_1.hasOrderIdAndCustomerNumber)(state.context.purchasePlatform);
17
+ return ((0, jsx_runtime_1.jsxs)(components_1.Fieldset, { title: t(PageText.Contact.ticketing.refund.appTicketRefund.label), children: [includeCustomerNumberAndPurchasePlatform && ((0, jsx_runtime_1.jsx)(components_1.Select, { id: "purchasePlatform", label: t(PageText.Contact.input.purchasePlatform.label), value: state.context.purchasePlatform || '', onChange: (value) => send({
29
18
  type: 'ON_PURCHASE_PLATFORM_CHANGE',
30
19
  value: value,
31
20
  }), isRequired: true, error: state.context?.errorMessages['purchasePlatform']?.[0]
@@ -35,7 +24,16 @@ const AppTicketRefund = ({ state, send }) => {
35
24
  'enturWeb',
36
25
  'framApp',
37
26
  'framWeb',
38
- ], placeholder: t(PageText.Contact.input.purchasePlatform.optionLabel) })), (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({
27
+ ], placeholder: t(PageText.Contact.input.purchasePlatform.optionLabel) })), areOrderIdAndCustomerNumberRelevant &&
28
+ includeCustomerNumberAndPurchasePlatform && ((0, jsx_runtime_1.jsx)(components_1.Input, { id: "customerNumber", label: t(PageText.Contact.input.customerNumber.label), type: "text", name: "customerNumber", value: state.context.customerNumber || '', isRequired: true, errorMessage: state.context?.errorMessages['customerNumber']?.[0], onChange: (e) => send({
29
+ type: 'ON_INPUT_CHANGE',
30
+ inputName: 'customerNumber',
31
+ value: e.target.value,
32
+ }), description: t(PageText.Contact.input.customerNumber.description) })), areOrderIdAndCustomerNumberRelevant && ((0, jsx_runtime_1.jsx)(components_1.Input, { id: "orderId", label: t(PageText.Contact.input.orderId.label(true)), type: "text", name: "orderId", value: state.context.orderId || '', isRequired: true, errorMessage: state.context?.errorMessages['orderId']?.[0], onChange: (e) => send({
33
+ type: 'ON_INPUT_CHANGE',
34
+ inputName: 'orderId',
35
+ value: e.target.value,
36
+ }), description: t(PageText.Contact.input.orderId.description) })), (0, jsx_runtime_1.jsx)(components_1.Textarea, { id: "refundReason", label: t(PageText.Contact.input.refundReason.question), description: t(PageText.Contact.input.refundReason.description), value: state.context.refundReason || '', isRequired: true, onChange: (e) => send({
39
37
  type: 'ON_INPUT_CHANGE',
40
38
  inputName: 'refundReason',
41
39
  value: e.target.value,
@@ -1 +1 @@
1
- {"version":3,"file":"otherTicketRefund.d.ts","sourceRoot":"","sources":["../../../../src/refund/forms/refund-ticket/otherTicketRefund.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAahD,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAO7D,KAAK,sBAAsB,GAAG;IAC5B,KAAK,EAAE;QAAE,OAAO,EAAE,kBAAkB,CAAA;KAAE,CAAC;IACvC,IAAI,EAAE,CAAC,KAAK,EAAE,OAAO,gBAAgB,KAAK,IAAI,CAAC;CAChD,CAAC;AAqeF,eAAO,MAAM,iBAAiB,GAAI,iBAAiB,sBAAsB,gCAWxE,CAAC;AAEF,eAAe,iBAAiB,CAAC"}
1
+ {"version":3,"file":"otherTicketRefund.d.ts","sourceRoot":"","sources":["../../../../src/refund/forms/refund-ticket/otherTicketRefund.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAahD,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAO7D,KAAK,sBAAsB,GAAG;IAC5B,KAAK,EAAE;QAAE,OAAO,EAAE,kBAAkB,CAAA;KAAE,CAAC;IACvC,IAAI,EAAE,CAAC,KAAK,EAAE,OAAO,gBAAgB,KAAK,IAAI,CAAC;CAChD,CAAC;AA8fF,eAAO,MAAM,iBAAiB,GAAI,iBAAiB,sBAAsB,gCAWxE,CAAC;AAEF,eAAe,iBAAiB,CAAC"}
@@ -28,27 +28,21 @@ const RefundSection = ({ state, send }) => {
28
28
  type: 'ON_INPUT_CHANGE',
29
29
  inputName: 'orderId',
30
30
  value: e.target.value,
31
- }), modalContent: {
32
- description: t(PageText.Contact.input.orderId.description),
33
- instruction: t(PageText.Contact.input.orderId.instruction),
34
- bulletPoints: PageText.Contact.input.orderId.descriptionBulletPoints.map((bulletPoint) => t(bulletPoint)),
35
- } })), showTravelCardNumber && ((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 || '', isRequired: true, errorMessage: state.context.errorMessages['travelCardNumber']?.[0], onChange: (e) => send({
31
+ }), description: t(PageText.Contact.input.orderId.description) })), showTravelCardNumber && ((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 || '', isRequired: true, errorMessage: state.context.errorMessages['travelCardNumber']?.[0], onChange: (e) => send({
36
32
  type: 'ON_INPUT_CHANGE',
37
33
  inputName: 'travelCardNumber',
38
34
  value: e.target.value,
39
- }), modalContent: {
40
- description: t(PageText.Contact.input.travelCardNumber.info),
41
- } })), features?.includeAmountInOtherTicketRefund && ((0, jsx_runtime_1.jsx)(components_1.Input, { id: "amount", label: t(PageText.Contact.input.amount.info), type: "text", name: "amount", value: state.context.amount || '', isRequired: true, errorMessage: state.context?.errorMessages['amount']?.[0], onChange: (e) => send({
35
+ }), description: t(PageText.Contact.input.travelCardNumber.info) })), features?.includeAmountInOtherTicketRefund && ((0, jsx_runtime_1.jsx)(components_1.Input, { id: "amount", label: t(PageText.Contact.input.amount.info), type: "text", name: "amount", value: state.context.amount || '', isRequired: true, errorMessage: state.context?.errorMessages['amount']?.[0], onChange: (e) => send({
42
36
  type: 'ON_INPUT_CHANGE',
43
37
  inputName: 'amount',
44
38
  value: e.target.value,
45
- }) })), (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({
39
+ }) })), (0, jsx_runtime_1.jsx)(components_1.Textarea, { id: "refundReason", label: t(PageText.Contact.input.refundReason.question), value: state.context.refundReason || '', isRequired: true, onChange: (e) => send({
46
40
  type: 'ON_INPUT_CHANGE',
47
41
  inputName: 'refundReason',
48
42
  value: e.target.value,
49
43
  }), error: state.context.errorMessages['refundReason']?.[0]
50
44
  ? t(state.context.errorMessages['refundReason']?.[0])
51
- : 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", isRequired: features?.enableRequiredAttachmentInOtherTicketRefund, onChange: (files) => {
45
+ : undefined }), features?.enableReceiptAttachmentInOtherTicketRefund !== false && ((0, jsx_runtime_1.jsx)(components_1.FileInput, { id: "attachments", label: t(PageText.Contact.refund.otherTicketRefund.receipt.info), iconLabel: t(PageText.Contact.input.feedback.attachment.receipt), name: "attachments", isRequired: features?.enableRequiredReceiptAttachmentInOtherTicketRefund, onChange: (files) => {
52
46
  send({
53
47
  type: 'ON_INPUT_CHANGE',
54
48
  inputName: 'attachments',
@@ -61,6 +55,7 @@ const RefundSection = ({ state, send }) => {
61
55
  const AboutYouSection = ({ state, send }) => {
62
56
  const PageText = (0, translations_1.usePageText)();
63
57
  const { t } = (0, translations_1.useTranslation)();
58
+ const { features } = (0, context_1.useContactFormConfig)();
64
59
  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({
65
60
  type: 'ON_INPUT_CHANGE',
66
61
  inputName: 'firstName',
@@ -97,15 +92,23 @@ const AboutYouSection = ({ state, send }) => {
97
92
  type: 'ON_INPUT_CHANGE',
98
93
  inputName: 'hasInternationalBankAccount',
99
94
  value: !state.context.hasInternationalBankAccount,
100
- }) }), 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({
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(PageText.Contact.input.bankInformation.IBAN.label), description: t(PageText.Contact.input.bankInformation.IBAN.description), type: "string", name: "IBAN", value: state.context.IBAN || '', isRequired: true, errorMessage: state.context?.errorMessages['IBAN']?.[0], onChange: (e) => send({
101
96
  type: 'ON_INPUT_CHANGE',
102
97
  inputName: 'IBAN',
103
98
  value: e.target.value,
104
- }) }), (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({
99
+ }) }), (0, jsx_runtime_1.jsx)(components_1.Input, { id: "SWIFT", label: t(PageText.Contact.input.bankInformation.SWIFT.label), description: t(PageText.Contact.input.bankInformation.SWIFT.description), type: "string", name: "SWIFT", value: state.context.SWIFT || '', isRequired: true, errorMessage: state.context?.errorMessages['SWIFT']?.[0], onChange: (e) => send({
105
100
  type: 'ON_INPUT_CHANGE',
106
101
  inputName: 'SWIFT',
107
102
  value: e.target.value,
108
- }) })] }))] }));
103
+ }) })] })), features?.enableIdentificationAttachmentInOtherTicketRefund && ((0, jsx_runtime_1.jsx)(components_1.FileInput, { id: "identificationAttachments", label: t(PageText.Contact.input.identificationAttachments.label), iconLabel: t(PageText.Contact.input.feedback.attachment.generic), name: "identificationAttachments", isRequired: true, onChange: (files) => {
104
+ send({
105
+ type: 'ON_INPUT_CHANGE',
106
+ inputName: 'identificationAttachments',
107
+ value: files,
108
+ });
109
+ }, errorMessage: state.context?.errorMessages['identificationAttachments']?.[0]
110
+ ? t(state.context?.errorMessages['identificationAttachments']?.[0])
111
+ : undefined }))] }));
109
112
  };
110
113
  const DepartureSection = ({ state, send }) => {
111
114
  const PageText = (0, translations_1.usePageText)();
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/refund/index.tsx"],"names":[],"mappings":"AAgBA,QAAA,MAAM,aAAa,mCAiJlB,CAAC;AAEF,eAAe,aAAa,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/refund/index.tsx"],"names":[],"mappings":"AAgBA,QAAA,MAAM,aAAa,mCAqJlB,CAAC;AAEF,eAAe,aAAa,CAAC"}
@@ -38,8 +38,9 @@ const RefundContent = () => {
38
38
  includeOrderIdInOtherTicketRefund: features?.includeOrderIdInOtherTicketRefund === true,
39
39
  includeAmountInOtherTicketRefund: features?.includeAmountInOtherTicketRefund === true,
40
40
  includeAmountInRefundTaxi: features?.includeAmountInRefundTaxi !== false,
41
- enableFileUploads: features?.enableFileUploads === true,
42
- enableRequiredAttachmentInOtherTicketRefund: features?.enableRequiredAttachmentInOtherTicketRefund === true,
41
+ enableReceiptAttachmentInOtherTicketRefund: features?.enableReceiptAttachmentInOtherTicketRefund !== false,
42
+ enableRequiredReceiptAttachmentInOtherTicketRefund: features?.enableRequiredReceiptAttachmentInOtherTicketRefund === true,
43
+ enableIdentificationAttachmentInOtherTicketRefund: features?.enableIdentificationAttachmentInOtherTicketRefund === true,
43
44
  }), [
44
45
  apiConfig.onSubmit,
45
46
  successPath,
@@ -50,8 +51,9 @@ const RefundContent = () => {
50
51
  features?.includeOrderIdInOtherTicketRefund,
51
52
  features?.includeAmountInOtherTicketRefund,
52
53
  features?.includeAmountInRefundTaxi,
53
- features?.enableFileUploads,
54
- features?.enableRequiredAttachmentInOtherTicketRefund,
54
+ features?.enableReceiptAttachmentInOtherTicketRefund,
55
+ features?.enableRequiredReceiptAttachmentInOtherTicketRefund,
56
+ features?.enableIdentificationAttachmentInOtherTicketRefund,
55
57
  ]);
56
58
  const [state, send] = (0, react_1.useMachine)(machine);
57
59
  const displaySubmitButton = state.context.formType &&