@mrfylke/contact-form 0.1.11 → 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.
Files changed (157) hide show
  1. package/README.md +393 -2
  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.map +1 -1
  5. package/lib/components/form/date-selector.js +5 -4
  6. package/lib/components/form/departure-time-field.d.ts +16 -0
  7. package/lib/components/form/departure-time-field.d.ts.map +1 -0
  8. package/lib/components/form/departure-time-field.js +28 -0
  9. package/lib/components/form/description-modal.d.ts.map +1 -1
  10. package/lib/components/form/description-modal.js +2 -1
  11. package/lib/components/form/file-input.d.ts.map +1 -1
  12. package/lib/components/form/file-input.js +2 -1
  13. package/lib/components/form/index.d.ts +1 -0
  14. package/lib/components/form/index.d.ts.map +1 -1
  15. package/lib/components/form/index.js +3 -1
  16. package/lib/components/form/input.d.ts.map +1 -1
  17. package/lib/components/form/input.js +2 -1
  18. package/lib/components/form/searchable-select/utils.js +6 -1
  19. package/lib/components/index.d.ts +1 -1
  20. package/lib/components/index.d.ts.map +1 -1
  21. package/lib/components/index.js +2 -1
  22. package/lib/contact.module.css +9 -0
  23. package/lib/error-content/error-content.d.ts.map +1 -1
  24. package/lib/error-content/error-content.js +2 -1
  25. package/lib/group-travel/index.d.ts.map +1 -1
  26. package/lib/group-travel/index.js +3 -1
  27. package/lib/index.d.ts +16 -4
  28. package/lib/index.d.ts.map +1 -1
  29. package/lib/index.js +41 -1
  30. package/lib/journey-info/index.d.ts.map +1 -1
  31. package/lib/journey-info/index.js +13 -7
  32. package/lib/journey-info/journeyInfoStateMachine.d.ts +8 -8
  33. package/lib/layouts/contact-page-layout.d.ts +2 -2
  34. package/lib/layouts/contact-page-layout.d.ts.map +1 -1
  35. package/lib/layouts/contact-page-layout.js +19 -16
  36. package/lib/layouts/container.module.css +1 -1
  37. package/lib/layouts/layout.module.css +23 -2
  38. package/lib/lines/use-departures.d.ts +12 -0
  39. package/lib/lines/use-departures.d.ts.map +1 -0
  40. package/lib/lines/use-departures.js +35 -0
  41. package/lib/lines/use-lines.d.ts +4 -3
  42. package/lib/lines/use-lines.d.ts.map +1 -1
  43. package/lib/lines/use-lines.js +43 -10
  44. package/lib/lost-property/LostPropertyForm.d.ts +10 -0
  45. package/lib/lost-property/LostPropertyForm.d.ts.map +1 -0
  46. package/lib/lost-property/LostPropertyForm.js +65 -0
  47. package/lib/lost-property/LostPropertyMachine.d.ts +116 -0
  48. package/lib/lost-property/LostPropertyMachine.d.ts.map +1 -0
  49. package/lib/lost-property/LostPropertyMachine.js +187 -0
  50. package/lib/lost-property/index.d.ts.map +1 -1
  51. package/lib/lost-property/index.js +27 -3
  52. package/lib/means-of-transport/forms/delayForm.d.ts.map +1 -1
  53. package/lib/means-of-transport/forms/delayForm.js +26 -18
  54. package/lib/means-of-transport/forms/driverForm.d.ts.map +1 -1
  55. package/lib/means-of-transport/forms/driverForm.js +26 -18
  56. package/lib/means-of-transport/forms/injuryForm.d.ts.map +1 -1
  57. package/lib/means-of-transport/forms/injuryForm.js +26 -18
  58. package/lib/means-of-transport/forms/serviceOfferingForm.d.ts.map +1 -1
  59. package/lib/means-of-transport/forms/serviceOfferingForm.js +10 -9
  60. package/lib/means-of-transport/forms/stopForm.d.ts.map +1 -1
  61. package/lib/means-of-transport/forms/stopForm.js +13 -12
  62. package/lib/means-of-transport/forms/transportationForm.d.ts.map +1 -1
  63. package/lib/means-of-transport/forms/transportationForm.js +26 -18
  64. package/lib/means-of-transport/index.d.ts.map +1 -1
  65. package/lib/means-of-transport/index.js +13 -4
  66. package/lib/means-of-transport/means-of-transport-form-machine.d.ts +10 -8
  67. package/lib/means-of-transport/means-of-transport-form-machine.d.ts.map +1 -1
  68. package/lib/means-of-transport/means-of-transport-form-machine.js +6 -0
  69. package/lib/modules/config/types.d.ts +48 -1
  70. package/lib/modules/config/types.d.ts.map +1 -1
  71. package/lib/refund/events.d.ts +1 -1
  72. package/lib/refund/events.d.ts.map +1 -1
  73. package/lib/refund/forms/refund-and-travel-guarantee/index.d.ts.map +1 -1
  74. package/lib/refund/forms/refund-and-travel-guarantee/index.js +2 -2
  75. package/lib/refund/forms/refund-and-travel-guarantee/refundCarForm.d.ts.map +1 -1
  76. package/lib/refund/forms/refund-and-travel-guarantee/refundCarForm.js +15 -8
  77. package/lib/refund/forms/refund-and-travel-guarantee/refundTaxiForm.d.ts.map +1 -1
  78. package/lib/refund/forms/refund-and-travel-guarantee/refundTaxiForm.js +15 -8
  79. package/lib/refund/forms/refund-ticket/appTicketRefund.d.ts.map +1 -1
  80. package/lib/refund/forms/refund-ticket/appTicketRefund.js +46 -11
  81. package/lib/refund/forms/refund-ticket/index.d.ts.map +1 -1
  82. package/lib/refund/forms/refund-ticket/index.js +8 -7
  83. package/lib/refund/forms/refund-ticket/otherTicketRefund.d.ts.map +1 -1
  84. package/lib/refund/forms/refund-ticket/otherTicketRefund.js +53 -19
  85. package/lib/refund/forms/residualValueOnTravelCard/index.d.ts.map +1 -1
  86. package/lib/refund/forms/residualValueOnTravelCard/index.js +5 -3
  87. package/lib/refund/index.d.ts.map +1 -1
  88. package/lib/refund/index.js +39 -6
  89. package/lib/refund/refundFormMachine.d.ts +37 -13
  90. package/lib/refund/refundFormMachine.d.ts.map +1 -1
  91. package/lib/refund/refundFormMachine.js +96 -3
  92. package/lib/server/journey-planner/index.d.ts.map +1 -1
  93. package/lib/server/journey-planner/index.js +15 -6
  94. package/lib/server/journey-planner/validators.d.ts +2 -0
  95. package/lib/server/journey-planner/validators.d.ts.map +1 -1
  96. package/lib/server/journey-planner/validators.js +1 -0
  97. package/lib/success-content/success-content.d.ts.map +1 -1
  98. package/lib/success-content/success-content.js +2 -1
  99. package/lib/ticket-control/events.d.ts +1 -1
  100. package/lib/ticket-control/events.d.ts.map +1 -1
  101. package/lib/ticket-control/forms/feeComplaintForm.d.ts.map +1 -1
  102. package/lib/ticket-control/forms/feeComplaintForm.js +28 -25
  103. package/lib/ticket-control/forms/feedbackForm.d.ts.map +1 -1
  104. package/lib/ticket-control/forms/feedbackForm.js +22 -14
  105. package/lib/ticket-control/forms/postponePayment.d.ts.map +1 -1
  106. package/lib/ticket-control/forms/postponePayment.js +8 -7
  107. package/lib/ticket-control/index.d.ts.map +1 -1
  108. package/lib/ticket-control/index.js +15 -6
  109. package/lib/ticket-control/ticket-control-form-machine.d.ts +14 -10
  110. package/lib/ticket-control/ticket-control-form-machine.d.ts.map +1 -1
  111. package/lib/ticket-control/ticket-control-form-machine.js +17 -2
  112. package/lib/ticketing/forms/app/appAccountForm.d.ts.map +1 -1
  113. package/lib/ticketing/forms/app/appAccountForm.js +9 -8
  114. package/lib/ticketing/forms/app/appTicketingForm.d.ts.map +1 -1
  115. package/lib/ticketing/forms/app/appTicketingForm.js +13 -12
  116. package/lib/ticketing/forms/app/appTravelSuggestionForm.d.ts.map +1 -1
  117. package/lib/ticketing/forms/app/appTravelSuggestionForm.js +6 -5
  118. package/lib/ticketing/forms/app/index.d.ts.map +1 -1
  119. package/lib/ticketing/forms/app/index.js +2 -1
  120. package/lib/ticketing/forms/priceAndTicketTypesForm.d.ts.map +1 -1
  121. package/lib/ticketing/forms/priceAndTicketTypesForm.js +6 -5
  122. package/lib/ticketing/forms/travel-card/index.d.ts.map +1 -1
  123. package/lib/ticketing/forms/travel-card/index.js +2 -1
  124. package/lib/ticketing/forms/travel-card/orderTravelCard.d.ts.map +1 -1
  125. package/lib/ticketing/forms/travel-card/orderTravelCard.js +2 -2
  126. package/lib/ticketing/forms/travel-card/travelCardQuestionForm.d.ts.map +1 -1
  127. package/lib/ticketing/forms/travel-card/travelCardQuestionForm.js +9 -8
  128. package/lib/ticketing/forms/webshop/index.d.ts.map +1 -1
  129. package/lib/ticketing/forms/webshop/index.js +2 -1
  130. package/lib/ticketing/forms/webshop/webshopAccountForm.d.ts.map +1 -1
  131. package/lib/ticketing/forms/webshop/webshopAccountForm.js +9 -8
  132. package/lib/ticketing/forms/webshop/webshopTicketingForm.d.ts.map +1 -1
  133. package/lib/ticketing/forms/webshop/webshopTicketingForm.js +12 -11
  134. package/lib/ticketing/index.d.ts.map +1 -1
  135. package/lib/ticketing/index.js +21 -6
  136. package/lib/ticketing/ticketingStateMachine.d.ts +12 -12
  137. package/lib/translations/index.d.ts +1 -1
  138. package/lib/translations/index.d.ts.map +1 -1
  139. package/lib/translations/index.js +2 -1
  140. package/lib/translations/pages/contact.d.ts +46 -0
  141. package/lib/translations/pages/contact.d.ts.map +1 -1
  142. package/lib/translations/pages/contact.js +50 -2
  143. package/lib/translations/translations-context.d.ts +2 -0
  144. package/lib/translations/translations-context.d.ts.map +1 -1
  145. package/lib/translations/translations-context.js +39 -0
  146. package/lib/types/submit-payloads.d.ts +19 -0
  147. package/lib/types/submit-payloads.d.ts.map +1 -1
  148. package/lib/types.d.ts +1 -1
  149. package/lib/types.d.ts.map +1 -1
  150. package/lib/url-form-type.d.ts +6 -0
  151. package/lib/url-form-type.d.ts.map +1 -0
  152. package/lib/url-form-type.js +21 -0
  153. package/lib/utils.d.ts.map +1 -1
  154. package/lib/utils.js +10 -0
  155. package/lib/validation/validationRules.d.ts.map +1 -1
  156. package/lib/validation/validationRules.js +7 -0
  157. package/package.json +1 -2
@@ -7,45 +7,53 @@ const use_lines_1 = require("../../lines/use-lines");
7
7
  const typography_1 = require("../../components/typography");
8
8
  const components_1 = require("../../components");
9
9
  const TransportationForm = ({ state, send, }) => {
10
+ const PageText = (0, translations_1.usePageText)();
10
11
  const { t } = (0, translations_1.useTranslation)();
11
12
  const { getLinesByMode, getQuaysByLine } = (0, use_lines_1.useLines)();
12
13
  const transportModeOptions = (0, use_lines_1.useTransportModeOptions)();
13
- return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(components_1.Fieldset, { title: t(translations_1.PageText.Contact.modeOfTransport.transportation.description), children: (0, jsx_runtime_1.jsx)(typography_1.Typo.p, { textType: "body__m", children: t(translations_1.PageText.Contact.modeOfTransport.transportation.info) }) }), (0, jsx_runtime_1.jsxs)(components_1.Fieldset, { title: t(translations_1.PageText.Contact.modeOfTransport.transportation.about.title), children: [(0, jsx_runtime_1.jsx)(typography_1.Typo.p, { textType: "body__m", children: t(translations_1.PageText.Contact.modeOfTransport.transportation.about.description) }), (0, jsx_runtime_1.jsx)(components_1.Select, { id: "transportMode", label: t(translations_1.PageText.Contact.input.transportMode.label), value: state.context.transportMode || '', onChange: (value) => send({
14
+ return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(components_1.Fieldset, { title: t(PageText.Contact.modeOfTransport.transportation.description), children: (0, jsx_runtime_1.jsx)(typography_1.Typo.p, { textType: "body__m", children: t(PageText.Contact.modeOfTransport.transportation.info) }) }), (0, jsx_runtime_1.jsxs)(components_1.Fieldset, { title: t(PageText.Contact.modeOfTransport.transportation.about.title), children: [(0, jsx_runtime_1.jsx)(typography_1.Typo.p, { textType: "body__m", children: t(PageText.Contact.modeOfTransport.transportation.about.description) }), (0, jsx_runtime_1.jsx)(components_1.Select, { id: "transportMode", label: t(PageText.Contact.input.transportMode.label), value: state.context.transportMode || '', onChange: (value) => send({
14
15
  type: 'ON_TRANSPORTMODE_CHANGE',
15
16
  value: value,
16
17
  }), isRequired: true, error: state.context?.errorMessages['transportMode']?.[0]
17
18
  ? t(state.context?.errorMessages['transportMode']?.[0])
18
- : undefined, valueToId: (val) => val, valueToText: (val) => t(translations_1.PageText.Contact.input.transportMode.modes[val]), options: transportModeOptions, placeholder: t(translations_1.PageText.Contact.input.transportMode.optionLabel) }), (0, jsx_runtime_1.jsx)(components_1.SearchableSelect, { id: "line", label: t(translations_1.PageText.Contact.input.line.label), value: state.context.line, placeholder: t(translations_1.PageText.Contact.input.line.optionLabel), isDisabled: !state.context.transportMode, options: (0, components_1.getLineOptions)(getLinesByMode(state.context.transportMode)), onChange: (value) => {
19
+ : 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) => {
19
20
  send({
20
21
  type: 'ON_LINE_CHANGE',
21
22
  value: value,
22
23
  });
23
24
  }, isRequired: true, error: state.context?.errorMessages['line']?.[0] &&
24
- t(state.context?.errorMessages['line']?.[0]) }), (0, jsx_runtime_1.jsx)(components_1.SearchableSelect, { id: "fromStop", label: t(translations_1.PageText.Contact.input.fromStop.label), value: state.context.fromStop, isDisabled: !state.context.line, onChange: (value) => {
25
+ 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) => {
25
26
  send({
26
27
  type: 'ON_INPUT_CHANGE',
27
28
  inputName: 'fromStop',
28
29
  value: value,
29
30
  });
30
- }, options: (0, components_1.getStopOptions)(getQuaysByLine(state.context.line?.id ?? '')), placeholder: t(translations_1.PageText.Contact.input.fromStop.optionLabel), isRequired: true, error: state.context?.errorMessages['fromStop']?.[0]
31
+ }, 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]
31
32
  ? t(state.context?.errorMessages['fromStop']?.[0])
32
- : undefined }), (0, jsx_runtime_1.jsx)(components_1.SearchableSelect, { id: "toStop", label: t(translations_1.PageText.Contact.input.toStop.label), value: state.context.toStop, isDisabled: !state.context.line, onChange: (value) => {
33
+ : 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) => {
33
34
  send({
34
35
  type: 'ON_INPUT_CHANGE',
35
36
  inputName: 'toStop',
36
37
  value: value,
37
38
  });
38
- }, placeholder: t(translations_1.PageText.Contact.input.toStop.optionLabel), options: (0, components_1.getStopOptions)(getQuaysByLine(state.context.line?.id ?? '')), isRequired: true, error: state.context?.errorMessages['toStop']?.[0]
39
+ }, placeholder: t(PageText.Contact.input.toStop.optionLabel), options: (0, components_1.getStopOptions)(getQuaysByLine(state.context.line?.id ?? '')), isRequired: true, error: state.context?.errorMessages['toStop']?.[0]
39
40
  ? t(state.context?.errorMessages['toStop']?.[0])
40
- : undefined }), (0, jsx_runtime_1.jsx)(components_1.DateSelector, { id: "date", label: t(translations_1.PageText.Contact.input.date.label), isRequired: true, value: state.context.date, onChange: (date) => send({
41
+ : 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({
41
42
  type: 'ON_INPUT_CHANGE',
42
43
  inputName: 'date',
43
44
  value: date,
44
- }), errorMessage: state.context?.errorMessages['date']?.[0] }), (0, jsx_runtime_1.jsx)(components_1.TimeSelector, { id: "plannedDepartureTime", isRequired: true, label: t(translations_1.PageText.Contact.input.plannedDepartureTime.label), value: state.context.plannedDepartureTime, onChange: (time) => send({
45
- type: 'ON_INPUT_CHANGE',
46
- inputName: 'plannedDepartureTime',
47
- value: time,
48
- }), errorMessage: state.context?.errorMessages['plannedDepartureTime']?.[0] })] }), (0, jsx_runtime_1.jsx)(components_1.Fieldset, { title: t(translations_1.PageText.Contact.input.feedback.title), isRequired: true, children: (0, jsx_runtime_1.jsx)(components_1.Textarea, { description: t(translations_1.PageText.Contact.input.feedback.description), id: "feedback", value: state.context.feedback || '', onChange: (e) => send({
45
+ }), 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) => {
46
+ send({
47
+ type: 'ON_INPUT_CHANGE',
48
+ inputName: 'plannedDepartureTime',
49
+ value: time,
50
+ });
51
+ send({
52
+ type: 'ON_INPUT_CHANGE',
53
+ inputName: 'tripId',
54
+ value: tripId,
55
+ });
56
+ }, isRequired: true, errorMessage: state.context?.errorMessages['plannedDepartureTime']?.[0] })] }), (0, jsx_runtime_1.jsx)(components_1.Fieldset, { title: t(PageText.Contact.input.feedback.title), isRequired: true, children: (0, jsx_runtime_1.jsx)(components_1.Textarea, { description: t(PageText.Contact.input.feedback.description), id: "feedback", value: state.context.feedback || '', onChange: (e) => send({
49
57
  type: 'ON_INPUT_CHANGE',
50
58
  inputName: 'feedback',
51
59
  value: e.target.value,
@@ -54,7 +62,7 @@ const TransportationForm = ({ state, send, }) => {
54
62
  : undefined, fileInputProps: {
55
63
  id: 'attachments',
56
64
  name: 'attachments',
57
- iconLabel: t(translations_1.PageText.Contact.input.feedback.attachment.generic),
65
+ iconLabel: t(PageText.Contact.input.feedback.attachment.generic),
58
66
  onChange: (files) => {
59
67
  send({
60
68
  type: 'ON_INPUT_CHANGE',
@@ -62,23 +70,23 @@ const TransportationForm = ({ state, send, }) => {
62
70
  value: files,
63
71
  });
64
72
  },
65
- } }) }), (0, jsx_runtime_1.jsxs)(components_1.Fieldset, { title: t(translations_1.PageText.Contact.aboutYouInfo.optionalTitle), isRequired: true, children: [(0, jsx_runtime_1.jsxs)(components_1.FieldWrapperWithError, { errorMessage: state.context?.errorMessages['isResponseWanted']?.[0], children: [(0, jsx_runtime_1.jsx)(components_1.Radio, { label: t(translations_1.PageText.Contact.input.wantedResponse.options.yes), checked: state.context.isResponseWanted === true, onChange: () => send({
73
+ } }) }), (0, jsx_runtime_1.jsxs)(components_1.Fieldset, { title: t(PageText.Contact.aboutYouInfo.optionalTitle), isRequired: true, children: [(0, jsx_runtime_1.jsxs)(components_1.FieldWrapperWithError, { errorMessage: state.context?.errorMessages['isResponseWanted']?.[0], children: [(0, jsx_runtime_1.jsx)(components_1.Radio, { label: t(PageText.Contact.input.wantedResponse.options.yes), checked: state.context.isResponseWanted === true, onChange: () => send({
66
74
  type: 'ON_INPUT_CHANGE',
67
75
  inputName: 'isResponseWanted',
68
76
  value: true,
69
- }) }), (0, jsx_runtime_1.jsx)(components_1.Radio, { label: t(translations_1.PageText.Contact.input.wantedResponse.options.no), checked: state.context.isResponseWanted === false, onChange: () => send({
77
+ }) }), (0, jsx_runtime_1.jsx)(components_1.Radio, { label: t(PageText.Contact.input.wantedResponse.options.no), checked: state.context.isResponseWanted === false, onChange: () => send({
70
78
  type: 'ON_INPUT_CHANGE',
71
79
  inputName: 'isResponseWanted',
72
80
  value: false,
73
- }) })] }), state.context.isResponseWanted && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(components_1.Input, { id: "firstName", label: t(translations_1.PageText.Contact.input.firstName.label), type: "text", name: "firstName", isRequired: true, value: state.context.firstName || '', errorMessage: state.context?.errorMessages['firstName']?.[0], onChange: (e) => send({
81
+ }) })] }), state.context.isResponseWanted && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(components_1.Input, { id: "firstName", label: t(PageText.Contact.input.firstName.label), type: "text", name: "firstName", isRequired: true, value: state.context.firstName || '', errorMessage: state.context?.errorMessages['firstName']?.[0], onChange: (e) => send({
74
82
  type: 'ON_INPUT_CHANGE',
75
83
  inputName: 'firstName',
76
84
  value: e.target.value,
77
- }) }), (0, jsx_runtime_1.jsx)(components_1.Input, { id: "lastName", label: t(translations_1.PageText.Contact.input.lastName.label), type: "text", name: "lastName", isRequired: true, value: state.context.lastName || '', errorMessage: state.context?.errorMessages['lastName']?.[0], onChange: (e) => send({
85
+ }) }), (0, jsx_runtime_1.jsx)(components_1.Input, { id: "lastName", label: t(PageText.Contact.input.lastName.label), type: "text", name: "lastName", isRequired: true, value: state.context.lastName || '', errorMessage: state.context?.errorMessages['lastName']?.[0], onChange: (e) => send({
78
86
  type: 'ON_INPUT_CHANGE',
79
87
  inputName: 'lastName',
80
88
  value: e.target.value,
81
- }) }), (0, jsx_runtime_1.jsx)(components_1.Input, { id: "email", label: t(translations_1.PageText.Contact.input.email.label), type: "email", name: "email", isRequired: true, value: state.context.email || '', errorMessage: state.context?.errorMessages['email']?.[0], onChange: (e) => send({
89
+ }) }), (0, jsx_runtime_1.jsx)(components_1.Input, { id: "email", label: t(PageText.Contact.input.email.label), type: "email", name: "email", isRequired: true, value: state.context.email || '', errorMessage: state.context?.errorMessages['email']?.[0], onChange: (e) => send({
82
90
  type: 'ON_INPUT_CHANGE',
83
91
  inputName: 'email',
84
92
  value: e.target.value,
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/means-of-transport/index.tsx"],"names":[],"mappings":"AAuBA,QAAA,MAAM,uBAAuB,+CA4F5B,CAAC;AAEF,eAAe,uBAAuB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/means-of-transport/index.tsx"],"names":[],"mappings":"AAwBA,QAAA,MAAM,uBAAuB,+CAoG5B,CAAC;AAEF,eAAe,uBAAuB,CAAC"}
@@ -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 means_of_transport_form_machine_1 = require("./means-of-transport-form-machine");
11
+ const url_form_type_1 = require("../url-form-type");
11
12
  const forms_1 = require("./forms");
12
13
  const button_1 = require("../components/button");
13
14
  const translations_1 = require("../translations");
@@ -16,6 +17,7 @@ const contact_module_css_1 = __importDefault(require("../contact.module.css"));
16
17
  const utils_1 = require("../utils");
17
18
  const error_message_1 = __importDefault(require("../components/error-message/error-message"));
18
19
  const MeansOfTransportContent = () => {
20
+ const PageText = (0, translations_1.usePageText)();
19
21
  const { t } = (0, translations_1.useTranslation)();
20
22
  const apiConfig = (0, config_1.useApiConfig)();
21
23
  const { formSchemaOverrides, layout } = (0, config_1.useContactFormConfig)();
@@ -37,13 +39,20 @@ const MeansOfTransportContent = () => {
37
39
  return allTypes;
38
40
  return allTypes.filter((type) => override.includes(type));
39
41
  }, [formSchemaOverrides]);
42
+ const enabledFormTypesRef = (0, react_2.useRef)(enabledFormTypes);
43
+ (0, react_2.useEffect)(() => {
44
+ const { type } = (0, url_form_type_1.readFormTypeParam)(enabledFormTypesRef.current);
45
+ if (type) {
46
+ send({ type: 'SELECT_FORM_TYPE', formType: type });
47
+ }
48
+ }, [send]);
40
49
  const onSubmit = async (e) => {
41
50
  e.preventDefault();
42
51
  send({ type: 'SUBMIT', orderedFormFieldNames: (0, utils_1.findOrderFormFields)(e) });
43
52
  };
44
- return ((0, jsx_runtime_1.jsxs)("form", { onSubmit: onSubmit, className: contact_module_css_1.default.form, children: [(0, jsx_runtime_1.jsx)(components_1.Fieldset, { title: t(translations_1.PageText.Contact.modeOfTransport.title), children: (0, jsx_runtime_1.jsx)("ul", { className: contact_module_css_1.default.form_options__list, children: enabledFormTypes.map((formType) => ((0, jsx_runtime_1.jsx)("li", { children: (0, jsx_runtime_1.jsx)(components_1.Radio, { label: t(translations_1.PageText.Contact.modeOfTransport[formType].description), checked: state.matches({ editing: formType }), onChange: () => send({
45
- type: 'SELECT_FORM_TYPE',
46
- formType: formType,
47
- }) }) }, formType))) }) }), state.matches({ editing: 'driver' }) && ((0, jsx_runtime_1.jsx)(forms_1.DriverForm, { state: state, send: send })), state.matches({ editing: 'transportation' }) && ((0, jsx_runtime_1.jsx)(forms_1.TransportationForm, { state: state, send: send })), state.matches({ editing: 'delay' }) && ((0, jsx_runtime_1.jsx)(forms_1.DelayForm, { state: state, send: send })), state.matches({ editing: 'stop' }) && ((0, jsx_runtime_1.jsx)(forms_1.StopForm, { state: state, send: send })), state.matches({ editing: 'serviceOffering' }) && ((0, jsx_runtime_1.jsx)(forms_1.ServiceOfferingForm, { state: state, send: send })), state.matches({ editing: 'injury' }) && ((0, jsx_runtime_1.jsx)(forms_1.InjuryForm, { state: state, send: send })), state.context.hasSubmissionError && ((0, jsx_runtime_1.jsx)(error_message_1.default, { message: t(translations_1.PageText.Contact.error.info), id: "submission-error" })), displaySubmitButton && ((0, jsx_runtime_1.jsx)(button_1.Button, { title: t(translations_1.PageText.Contact.submit), mode: 'interactive_0--bordered', buttonProps: { type: 'submit' }, state: state.matches('submitting') ? 'loading' : undefined, className: contact_module_css_1.default.submitButton }))] }));
53
+ 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.modeOfTransport.title), children: (0, jsx_runtime_1.jsx)("ul", { className: contact_module_css_1.default.form_options__list, children: enabledFormTypes.map((formType) => ((0, jsx_runtime_1.jsx)("li", { children: (0, jsx_runtime_1.jsx)(components_1.Radio, { label: t(PageText.Contact.modeOfTransport[formType].description), checked: state.matches({ editing: formType }), onChange: () => {
54
+ (0, url_form_type_1.setFormTypeParam)(formType);
55
+ send({ type: 'SELECT_FORM_TYPE', formType: formType });
56
+ } }) }, formType))) }) }), state.matches({ editing: 'driver' }) && ((0, jsx_runtime_1.jsx)(forms_1.DriverForm, { state: state, send: send })), state.matches({ editing: 'transportation' }) && ((0, jsx_runtime_1.jsx)(forms_1.TransportationForm, { state: state, send: send })), state.matches({ editing: 'delay' }) && ((0, jsx_runtime_1.jsx)(forms_1.DelayForm, { state: state, send: send })), state.matches({ editing: 'stop' }) && ((0, jsx_runtime_1.jsx)(forms_1.StopForm, { state: state, send: send })), state.matches({ editing: 'serviceOffering' }) && ((0, jsx_runtime_1.jsx)(forms_1.ServiceOfferingForm, { state: state, send: send })), state.matches({ editing: 'injury' }) && ((0, jsx_runtime_1.jsx)(forms_1.InjuryForm, { state: state, send: 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 }))] }));
48
57
  };
49
58
  exports.default = MeansOfTransportContent;
@@ -19,6 +19,7 @@ type SubmitInput = {
19
19
  stop?: string;
20
20
  date?: string;
21
21
  departureTime?: string;
22
+ tripId?: string;
22
23
  feedback?: string;
23
24
  attachments?: File[];
24
25
  firstName?: string;
@@ -35,6 +36,7 @@ export type MeansOfTransportContextProps = {
35
36
  stop?: Line['quays'][0];
36
37
  date?: string;
37
38
  plannedDepartureTime?: string;
39
+ tripId?: string;
38
40
  feedback?: string;
39
41
  attachments?: File[];
40
42
  firstName?: string;
@@ -63,7 +65,7 @@ export declare function createMeansOfTransportFormMachine(onSubmit: (schemaName:
63
65
  type: "VALIDATE";
64
66
  } | {
65
67
  type: "ON_INPUT_CHANGE";
66
- inputName: "address" | "attachments" | "bankAccountNumber" | "city" | "date" | "email" | "firstName" | "feedback" | "IBAN" | "lastName" | "phoneNumber" | "postalCode" | "SWIFT" | "toStop" | "fromStop" | "plannedDepartureTime";
68
+ inputName: "address" | "attachments" | "bankAccountNumber" | "city" | "date" | "email" | "firstName" | "feedback" | "IBAN" | "lastName" | "phoneNumber" | "postalCode" | "SWIFT" | "toStop" | "fromStop" | "plannedDepartureTime" | "tripId";
67
69
  value: any;
68
70
  } | {
69
71
  type: "ON_TRANSPORTMODE_CHANGE";
@@ -78,6 +80,9 @@ export declare function createMeansOfTransportFormMachine(onSubmit: (schemaName:
78
80
  logic: import("xstate").PromiseActorLogic<true, SubmitInput, import("xstate").EventObject>;
79
81
  id: string | undefined;
80
82
  }, {
83
+ type: "onInputChange";
84
+ params: unknown;
85
+ } | {
81
86
  type: "navigateToErrorPage";
82
87
  params: unknown;
83
88
  } | {
@@ -98,9 +103,6 @@ export declare function createMeansOfTransportFormMachine(onSubmit: (schemaName:
98
103
  } | {
99
104
  type: "clearSubmissionError";
100
105
  params: unknown;
101
- } | {
102
- type: "onInputChange";
103
- params: unknown;
104
106
  } | {
105
107
  type: "onTransportModeChange";
106
108
  params: unknown;
@@ -182,7 +184,7 @@ export declare const meansOfTransportFormMachine: import("xstate").StateMachine<
182
184
  type: "VALIDATE";
183
185
  } | {
184
186
  type: "ON_INPUT_CHANGE";
185
- inputName: "address" | "attachments" | "bankAccountNumber" | "city" | "date" | "email" | "firstName" | "feedback" | "IBAN" | "lastName" | "phoneNumber" | "postalCode" | "SWIFT" | "toStop" | "fromStop" | "plannedDepartureTime";
187
+ inputName: "address" | "attachments" | "bankAccountNumber" | "city" | "date" | "email" | "firstName" | "feedback" | "IBAN" | "lastName" | "phoneNumber" | "postalCode" | "SWIFT" | "toStop" | "fromStop" | "plannedDepartureTime" | "tripId";
186
188
  value: any;
187
189
  } | {
188
190
  type: "ON_TRANSPORTMODE_CHANGE";
@@ -197,6 +199,9 @@ export declare const meansOfTransportFormMachine: import("xstate").StateMachine<
197
199
  logic: import("xstate").PromiseActorLogic<true, SubmitInput, import("xstate").EventObject>;
198
200
  id: string | undefined;
199
201
  }, {
202
+ type: "onInputChange";
203
+ params: unknown;
204
+ } | {
200
205
  type: "navigateToErrorPage";
201
206
  params: unknown;
202
207
  } | {
@@ -217,9 +222,6 @@ export declare const meansOfTransportFormMachine: import("xstate").StateMachine<
217
222
  } | {
218
223
  type: "clearSubmissionError";
219
224
  params: unknown;
220
- } | {
221
- type: "onInputChange";
222
- params: unknown;
223
225
  } | {
224
226
  type: "onTransportModeChange";
225
227
  params: unknown;
@@ -1 +1 @@
1
- {"version":3,"file":"means-of-transport-form-machine.d.ts","sourceRoot":"","sources":["../../src/means-of-transport/means-of-transport-form-machine.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC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AAC,EAAE,MAAM,CAAC;IACd,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,IAAI,EAAE,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,aAAa,EAAE,kBAAkB,CAAC;IAClC,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,kBAAkB,CAAC,EAAE,OAAO,CAAC;CAC9B,CAAC;AA6FF,MAAM,MAAM,YAAY,GAAG;IAAE,WAAW,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,CAAC;AAEtE,wBAAgB,iCAAiC,CAC/C,QAAQ,EAAE,CACR,UAAU,EAAE,cAAc,EAC1B,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAC3B,OAAO,CAAC,QAAQ,CAAC,EACtB,KAAK,CAAC,EAAE,YAAY;;;8BAvJpB,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0Xd;AAED,eAAO,MAAM,2BAA2B;;;8BA5XtC,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAmYd,CAAC"}
1
+ {"version":3,"file":"means-of-transport-form-machine.d.ts","sourceRoot":"","sources":["../../src/means-of-transport/means-of-transport-form-machine.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAE7C,OAAO,EAAE,IA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IACxB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,IAAI,EAAE,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,aAAa,EAAE,kBAAkB,CAAC;IAClC,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,kBAAkB,CAAC,EAAE,OAAO,CAAC;CAC9B,CAAC;AA6FF,MAAM,MAAM,YAAY,GAAG;IAAE,WAAW,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,CAAC;AAEtE,wBAAgB,iCAAiC,CAC/C,QAAQ,EAAE,CACR,UAAU,EAAE,cAAc,EAC1B,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAC3B,OAAO,CAAC,QAAQ,CAAC,EACtB,KAAK,CAAC,EAAE,YAAY;;;8BAzJpB,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmYd;AAED,eAAO,MAAM,2BAA2B;;;8BArYtC,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA4Yd,CAAC"}
@@ -135,9 +135,14 @@ function createMeansOfTransportFormMachine(onSubmit, paths) {
135
135
  if (event.type === 'ON_INPUT_CHANGE') {
136
136
  const { inputName, value } = event;
137
137
  context.errorMessages[inputName] = [];
138
+ const clearsDeparture = inputName === 'fromStop' || inputName === 'date';
138
139
  return {
139
140
  ...context,
140
141
  [inputName]: value,
142
+ ...(clearsDeparture && {
143
+ plannedDepartureTime: undefined,
144
+ tripId: undefined,
145
+ }),
141
146
  hasSubmissionError: undefined,
142
147
  };
143
148
  }
@@ -263,6 +268,7 @@ function createMeansOfTransportFormMachine(onSubmit, paths) {
263
268
  stop: context.stop?.name,
264
269
  date: context.date,
265
270
  departureTime: context.plannedDepartureTime,
271
+ tripId: context.tripId,
266
272
  feedback: context.feedback,
267
273
  firstName: context.firstName,
268
274
  lastName: context.lastName,
@@ -3,7 +3,9 @@
3
3
  * These types define the contract between the package and consuming applications.
4
4
  */
5
5
  import React from 'react';
6
+ import type { Line } from '../../server/journey-planner/validators';
6
7
  import type { ContactFormTranslationsOverride } from '../../translations/types';
8
+ import type { TransportModeType } from '../../types';
7
9
  /**
8
10
  * Icon component type - consumers provide components that render icons
9
11
  */
@@ -156,7 +158,7 @@ export type TypographyConfig = {
156
158
  * Form schema names that identify different form types.
157
159
  * Consumers can use this to route submissions to different endpoints or handle them differently.
158
160
  */
159
- export type FormSchemaName = 'ticketControl' | 'refund' | 'meansOfTransport' | 'ticketing' | 'journeyInfo';
161
+ export type FormSchemaName = 'ticketControl' | 'refund' | 'meansOfTransport' | 'ticketing' | 'journeyInfo' | 'lostProperty';
160
162
  /**
161
163
  * API configuration
162
164
  */
@@ -166,6 +168,7 @@ export type ApiConfig = {
166
168
  submitForm: string;
167
169
  uploadFile?: string;
168
170
  lines?: string;
171
+ departures?: string;
169
172
  };
170
173
  /**
171
174
  * Submit callback that receives the schema name and form state.
@@ -186,6 +189,8 @@ export type OrgConfig = {
186
189
  authorityId?: string;
187
190
  /** URL for the travel search / journey planner link shown in journey-info form. Default: '/' */
188
191
  travelSearchHref?: string;
192
+ /** URL for the contact/opening-hours page linked from the journey-info form. */
193
+ contactHref?: string;
189
194
  logo?: {
190
195
  src: string;
191
196
  srcDark?: string;
@@ -241,6 +246,17 @@ export type PagesOverrides = {
241
246
  */
242
247
  externalUrlByPageId?: Record<string, string>;
243
248
  };
249
+ /**
250
+ * Host-provided line filters applied by useLines after standard package filters.
251
+ */
252
+ export type LineFilterConfig = {
253
+ /**
254
+ * Optional host-provided predicate applied after the package's standard
255
+ * transport mode filtering in useLines(). Use this for org-specific line
256
+ * restrictions that should affect every consumer of useLines in the app.
257
+ */
258
+ additionalPredicate?: (line: Line, transportMode: TransportModeType) => boolean;
259
+ };
244
260
  /**
245
261
  * Form schema overrides for XState-driven form flows.
246
262
  * Each area can specify which form types/categories are enabled (all others are hidden).
@@ -255,6 +271,7 @@ export type FormSchemaOverrides = {
255
271
  };
256
272
  refund?: {
257
273
  enabledFormCategories?: string[];
274
+ customFormRenderers?: Record<string, (state: unknown, send: unknown) => React.ReactNode>;
258
275
  };
259
276
  ticketing?: {
260
277
  enabledFormCategories?: string[];
@@ -296,7 +313,37 @@ export type ContactFormConfig = {
296
313
  * When false, bank account fields are hidden and not validated.
297
314
  */
298
315
  includeBankAccountFields?: boolean;
316
+ /**
317
+ * Include the ticket type selector (Enkeltbillett/Periodebillett) in the
318
+ * "other ticket refund" form (otherTicketRefund). Default: true.
319
+ * When false, the ticket type dropdown is hidden and not validated.
320
+ * Set to false for orgs where the "other ticket" is a travel card (e.g. Innlandskort).
321
+ */
322
+ includeOtherTicketTypeSelector?: boolean;
323
+ /**
324
+ * Include the customer number field in the fee complaint form when
325
+ * "app ticket" storage mode is selected. Default: true.
326
+ * When false, only the phone number (appPhoneNumber) is shown and validated —
327
+ * useful for orgs using Entur-appen where customers don't have a customer number.
328
+ */
329
+ includeCustomerNumberInFeeComplaint?: boolean;
330
+ /**
331
+ * Include bestillingstransport (on-demand/flexible transport) as a transport mode option.
332
+ * Default: false.
333
+ * When true, bestillingstransport is added to transport mode dropdowns and uses the
334
+ * same Entur line/stop queries as bus.
335
+ */
336
+ includeBestillingstransport?: boolean;
337
+ /**
338
+ * Include departure info fields (transport mode, line, from stop, date, departure time)
339
+ * in the ticket refund forms (appTicketRefund and otherTicketRefund).
340
+ * Default: false.
341
+ * When true, a departure section is shown and validated in those forms.
342
+ */
343
+ includeRefundDepartureInfo?: boolean;
299
344
  };
345
+ /** Optional host-provided filters for line lookups. */
346
+ lineFilters?: LineFilterConfig;
300
347
  /** Optional layout config: basePath, backLinkDefault, successPath, errorPath */
301
348
  layout?: LayoutConfig;
302
349
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/modules/config/types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAE,+BAA+B,EAAE,MAAM,0BAA0B,CAAC;AAEhF;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG,CAAC,KAAK,EAAE;IAClC,IAAI,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAC;IACpC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;CAC7B,KAAK,KAAK,CAAC,YAAY,CAAC;AAEzB;;GAEG;AACH,MAAM,MAAM,QAAQ,GAChB,wBAAwB,GACxB,yBAAyB,GACzB,0BAA0B,GAC1B,yBAAyB,GACzB,4BAA4B,GAC5B,0BAA0B,GAC1B,yBAAyB,GACzB,0BAA0B,GAC1B,0BAA0B,GAC1B,4BAA4B,GAC5B,eAAe,GACf,eAAe,GACf,aAAa,GACb,sBAAsB,GACtB,kBAAkB,CAAC;AAEvB;;GAEG;AACH,MAAM,MAAM,OAAO,GAAG;KACnB,GAAG,IAAI,QAAQ,GAAG,aAAa;CACjC,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG;IAC1B,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE;QACV,OAAO,E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EF,uDAAuD;IACvD,WAAW,CAAC,EAAE,gBAAgB,CAAC;IAE/B,gFAAgF;IAChF,MAAM,CAAC,EAAE,YAAY,CAAC;IAEtB;;;OAGG;IACH,YAAY,EAAE,+BAA+B,CAAC;IAE9C;;;OAGG;IACH,cAAc,CAAC,EAAE,cAAc,CAAC;IAEhC;;;;OAIG;IACH,mBAAmB,CAAC,EAAE,mBAAmB,CAAC;CAC3C,CAAC;AAEF;;;GAGG;AACH,MAAM,MAAM,WAAW,CAAC,CAAC,IAAI;KAC1B,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,SAAS,MAAM,GAAG,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAChE,CAAC"}
@@ -3,7 +3,7 @@ import { PurchasePlatformType, ReasonForTransportFailure, TicketType, TransportM
3
3
  import { Line } from '..';
4
4
  type RefundSpecificFormEvents = {
5
5
  type: 'ON_INPUT_CHANGE';
6
- 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';
6
+ 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';
7
7
  value: string | boolean | ReasonForTransportFailure | TicketType | Line['quays'][0] | File[] | undefined;
8
8
  } | {
9
9
  type: 'SELECT_FORM_CATEGORY';
@@ -1 +1 @@
1
- {"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../src/refund/events.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EACZ,wBAAwB,EACxB,gBAAgB,EACjB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,oBAAoB,EACpB,yBAAyB,EACzB,UAAU,EACV,iBAAiB,EAClB,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,IAAI,EAAE,MAAM,IAAI,CAAC;AAE1B,KAAK,wBAAwB,GACzB;IACE,IAAI,EAAE,iBAAiB,CAAC;IACxB,SAAS,EACL,UAAU,GACV,kBAAkB,GAClB,aAAa,GACb,WAAW,GACX,QAAQ,GACR,2BAA2B,GAC3B,SAAS,GACT,gBAAgB,GAChB,YAAY,GACZ,kBAAkB,GAClB,cAAc,GACd,WAAW,GACX,UAAU,GACV,SAAS,GACT,YAAY,GACZ,MAAM,GACN,OAAO,GACP,aAAa,GACb,mBAAmB,GACnB,MAAM,GACN,OAAO,GACP,UAAU,GACV,QAAQ,GACR,MAAM,GACN,sBAAsB,GACtB,UAAU,GACV,aAAa,GACb,2BAA2B,GAC3B,6BAA6B,GAC7B,2BAA2B,CAAC;IAChC,KAAK,EACD,MAAM,GACN,OAAO,GACP,yBAAyB,GACzB,UAAU,GACV,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,GAChB,IAAI,EAAE,GACN,SAAS,CAAC;CACf,GACD;IACE,IAAI,EAAE,sBAAsB,CAAC;IAC7B,YAAY,EAAE,YAAY,CAAC;CAC5B,GACD;IACE,IAAI,EAAE,2BAA2B,CAAC;IAClC,gBAAgB,EAAE,gBAAgB,CAAC;CACpC,GACD;IACE,IAAI,EAAE,yCAAyC,CAAC;IAChD,wBAAwB,EAAE,wBAAwB,CAAC;CACpD,GACD;IACE,IAAI,EAAE,yBAAyB,CAAC;IAChC,KAAK,EAAE,iBAAiB,CAAC;CAC1B,GACD;IACE,IAAI,EAAE,gBAAgB,CAAC;IACvB,KAAK,EAAE,IAAI,GAAG,SAAS,CAAC;CACzB,GACD;IACE,IAAI,EAAE,6BAA6B,CAAC;IACpC,KAAK,EAAE,oBAAoB,GAAG,SAAS,CAAC;CACzC,GACD;IACE,IAAI,EAAE,QAAQ,CAAC;IACf,qBAAqB,EAAE,MAAM,EAAE,CAAC;CACjC,CAAC;AAEN,eAAO,MAAM,gBAAgB,EAAS,wBAAwB,CAAC"}
1
+ {"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../src/refund/events.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EACZ,wBAAwB,EACxB,gBAAgB,EACjB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,oBAAoB,EACpB,yBAAyB,EACzB,UAAU,EACV,iBAAiB,EAClB,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,IAAI,EAAE,MAAM,IAAI,CAAC;AAE1B,KAAK,wBAAwB,GACzB;IACE,IAAI,EAAE,iBAAiB,CAAC;IACxB,SAAS,EACL,UAAU,GACV,kBAAkB,GAClB,aAAa,GACb,WAAW,GACX,QAAQ,GACR,2BAA2B,GAC3B,SAAS,GACT,gBAAgB,GAChB,YAAY,GACZ,kBAAkB,GAClB,cAAc,GACd,WAAW,GACX,UAAU,GACV,SAAS,GACT,YAAY,GACZ,MAAM,GACN,OAAO,GACP,aAAa,GACb,mBAAmB,GACnB,MAAM,GACN,OAAO,GACP,UAAU,GACV,QAAQ,GACR,MAAM,GACN,sBAAsB,GACtB,QAAQ,GACR,UAAU,GACV,aAAa,GACb,2BAA2B,GAC3B,6BAA6B,GAC7B,2BAA2B,GAC3B,iBAAiB,CAAC;IACtB,KAAK,EACD,MAAM,GACN,OAAO,GACP,yBAAyB,GACzB,UAAU,GACV,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,GAChB,IAAI,EAAE,GACN,SAAS,CAAC;CACf,GACD;IACE,IAAI,EAAE,sBAAsB,CAAC;IAC7B,YAAY,EAAE,YAAY,CAAC;CAC5B,GACD;IACE,IAAI,EAAE,2BAA2B,CAAC;IAClC,gBAAgB,EAAE,gBAAgB,CAAC;CACpC,GACD;IACE,IAAI,EAAE,yCAAyC,CAAC;IAChD,wBAAwB,EAAE,wBAAwB,CAAC;CACpD,GACD;IACE,IAAI,EAAE,yBAAyB,CAAC;IAChC,KAAK,EAAE,iBAAiB,CAAC;CAC1B,GACD;IACE,IAAI,EAAE,gBAAgB,CAAC;IACvB,KAAK,EAAE,IAAI,GAAG,SAAS,CAAC;CACzB,GACD;IACE,IAAI,EAAE,6BAA6B,CAAC;IACpC,KAAK,EAAE,oBAAoB,GAAG,SAAS,CAAC;CACzC,GACD;IACE,IAAI,EAAE,QAAQ,CAAC;IACf,qBAAqB,EAAE,MAAM,EAAE,CAAC;CACjC,CAAC;AAEN,eAAO,MAAM,gBAAgB,EAAS,wBAAwB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/refund/forms/refund-and-travel-guarantee/index.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AACnC,OAAO,EAEL,kBAAkB,EACnB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAUhD,KAAK,kCAAkC,GAAG;IACxC,KAAK,EAAE,SAAS,CAAC,OAAO,kBAAkB,CAAC,CAAC;IAC5C,IAAI,EAAE,CAAC,KAAK,EAAE,OAAO,gBAAgB,KAAK,IAAI,CAAC;CAChD,CAAC;AAEF,eAAO,MAAM,6BAA6B,GAAI,kBAG3C,kCAAkC,4CA+GpC,CAAC;AAEF,eAAe,6BAA6B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/refund/forms/refund-and-travel-guarantee/index.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AACnC,OAAO,EAEL,kBAAkB,EACnB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAUhD,KAAK,kCAAkC,GAAG;IACxC,KAAK,EAAE,SAAS,CAAC,OAAO,kBAAkB,CAAC,CAAC;IAC5C,IAAI,EAAE,CAAC,KAAK,EAAE,OAAO,gBAAgB,KAAK,IAAI,CAAC;CAChD,CAAC;AAEF,eAAO,MAAM,6BAA6B,GAAI,kBAG3C,kCAAkC,4CAkHpC,CAAC;AAEF,eAAe,6BAA6B,CAAC"}
@@ -23,8 +23,8 @@ const RefundAndTravelGuaranteeForms = ({ state, send, }) => {
23
23
  const displayRefundCarForm = state.context.isInitialAgreementChecked &&
24
24
  state.context.formType === 'refundCar';
25
25
  return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)(components_1.Fieldset, { title: t(PageText.Contact.refund.agreement.title), children: [(0, jsx_runtime_1.jsx)(typography_1.Typo.p, { textType: "body__m", children: t(PageText.Contact.refund.agreement.delayedRefundText) }), (0, jsx_runtime_1.jsx)(typography_1.Typo.p, { textType: "body__m", children: t(PageText.Contact.refund.agreement.ticketRefundText) }), (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)(typography_1.Typo.p, { textType: "heading__m", children: t(PageText.Contact.refund.agreement.travelGuaranteeExceptions.label) }), (0, jsx_runtime_1.jsx)("ul", { className: contact_module_css_1.default.rules__list, children: PageText.Contact.refund.agreement.travelGuaranteeExceptions.exceptions.map((exception, index) => ((0, jsx_runtime_1.jsxs)("li", { children: [(0, jsx_runtime_1.jsx)(typography_1.Typo.p, { textType: "body__m", children: t(exception.text) }), exception.examples.length > 0 && ((0, jsx_runtime_1.jsx)("ul", { className: contact_module_css_1.default.rules__list, children: exception.examples.map((example, exampleIndex) => ((0, jsx_runtime_1.jsx)("li", { children: (0, jsx_runtime_1.jsx)(typography_1.Typo.p, { textType: "body__m", children: t(example) }) }, exampleIndex))) }))] }, index))) })] }), (0, jsx_runtime_1.jsxs)(typography_1.Typo.p, { textType: "body__m", children: [t(PageText.Contact.refund.agreement.travelGuaranteeExceptions
26
- .exclusion), ' ', (0, jsx_runtime_1.jsx)(link_1.default, { href: t(PageText.Contact.refund.agreement.travelGuaranteeExceptions.link
27
- .href), children: t(PageText.Contact.refund.agreement.travelGuaranteeExceptions.link
26
+ .exclusion), ' ', (0, jsx_runtime_1.jsx)(link_1.default, { className: contact_module_css_1.default.link, href: t(PageText.Contact.refund.agreement.travelGuaranteeExceptions.link
27
+ .href), target: "_blank", rel: "noopener noreferrer", children: t(PageText.Contact.refund.agreement.travelGuaranteeExceptions.link
28
28
  .text) })] }), (0, jsx_runtime_1.jsx)(checkbox_1.Checkbox, { label: t(PageText.Contact.ticketControl.feeComplaint.firstAgreement.checkbox), checked: state.context.isInitialAgreementChecked, onChange: () => send({
29
29
  type: 'ON_INPUT_CHANGE',
30
30
  inputName: 'isInitialAgreementChecked',
@@ -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,4CAochE,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;AAgB7D,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,4CA8chE,CAAC;AAEF,eAAe,aAAa,CAAC"}
@@ -5,12 +5,11 @@ const jsx_runtime_1 = require("react/jsx-runtime");
5
5
  const use_lines_1 = require("../../../lines/use-lines");
6
6
  const components_1 = require("../../../components");
7
7
  const translations_1 = require("../../../translations");
8
- const translations_context_1 = require("../../../translations/translations-context");
9
8
  const typography_1 = require("../../../components/typography");
10
9
  const checkbox_1 = require("../../../components/checkbox");
11
10
  const RefundCarForm = ({ state, send }) => {
12
11
  const { t } = (0, translations_1.useTranslation)();
13
- const { PageText } = (0, translations_context_1.useMergedTranslations)();
12
+ const PageText = (0, translations_1.usePageText)();
14
13
  const { getLinesByMode, getQuaysByLine } = (0, use_lines_1.useLines)();
15
14
  const transportModeOptions = (0, use_lines_1.useTransportModeOptions)();
16
15
  return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)(components_1.Fieldset, { title: t(PageText.Contact.refund.refundCar.aboutTheCarTrip.title), children: [(0, jsx_runtime_1.jsx)(typography_1.Typo.p, { textType: "body__m", children: t(PageText.Contact.refund.refundCar.info) }), (0, jsx_runtime_1.jsx)(components_1.Input, { id: "kilometersDriven", label: t(PageText.Contact.input.kilometersDriven.label), type: "text", name: "kilometersDriven", value: state.context.kilometersDriven || '', isRequired: true, errorMessage: state.context?.errorMessages['kilometersDriven']?.[0] || undefined, onChange: (e) => send({
@@ -56,11 +55,18 @@ const RefundCarForm = ({ state, send }) => {
56
55
  type: 'ON_INPUT_CHANGE',
57
56
  inputName: 'date',
58
57
  value: date,
59
- }), errorMessage: state.context?.errorMessages['date']?.[0] }), (0, jsx_runtime_1.jsx)(components_1.TimeSelector, { id: "plannedDepartureTime", isRequired: true, label: t(PageText.Contact.input.plannedDepartureTime.label), value: state.context.plannedDepartureTime, onChange: (time) => send({
60
- type: 'ON_INPUT_CHANGE',
61
- inputName: 'plannedDepartureTime',
62
- value: time,
63
- }), errorMessage: state.context?.errorMessages['plannedDepartureTime']?.[0] }), (0, jsx_runtime_1.jsx)(components_1.Select, { id: "reasonForTransportFailure", label: t(PageText.Contact.input.reasonForTransportFailure.label), value: state.context.reasonForTransportFailure, disabled: !state.context.line, onChange: (value) => {
58
+ }), 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) => {
59
+ send({
60
+ type: 'ON_INPUT_CHANGE',
61
+ inputName: 'plannedDepartureTime',
62
+ value: time,
63
+ });
64
+ send({
65
+ type: 'ON_INPUT_CHANGE',
66
+ inputName: 'tripId',
67
+ value: tripId,
68
+ });
69
+ }, isRequired: true, errorMessage: state.context?.errorMessages['plannedDepartureTime']?.[0] }), (0, jsx_runtime_1.jsx)(components_1.Select, { id: "reasonForTransportFailure", label: t(PageText.Contact.input.reasonForTransportFailure.label), value: state.context.reasonForTransportFailure, disabled: !state.context.line, onChange: (value) => {
64
70
  if (!value)
65
71
  return;
66
72
  send({
@@ -77,7 +83,8 @@ const RefundCarForm = ({ state, send }) => {
77
83
  }), fileInputProps: {
78
84
  id: 'attachments',
79
85
  name: 'attachments',
80
- iconLabel: t(PageText.Contact.input.feedback.attachment.generic),
86
+ iconLabel: t(PageText.Contact.refund.refundAndTravelGuarantee
87
+ .feedbackAttachmentLabel),
81
88
  onChange: (files) => {
82
89
  send({
83
90
  type: 'ON_INPUT_CHANGE',
@@ -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,4CA2alE,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;AAgB7D,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,4CAqblE,CAAC;AAEF,eAAe,cAAc,CAAC"}
@@ -5,11 +5,10 @@ const jsx_runtime_1 = require("react/jsx-runtime");
5
5
  const use_lines_1 = require("../../../lines/use-lines");
6
6
  const components_1 = require("../../../components");
7
7
  const translations_1 = require("../../../translations");
8
- const translations_context_1 = require("../../../translations/translations-context");
9
8
  const checkbox_1 = require("../../../components/checkbox");
10
9
  const RefundTaxiForm = ({ state, send }) => {
11
10
  const { t } = (0, translations_1.useTranslation)();
12
- const { PageText } = (0, translations_context_1.useMergedTranslations)();
11
+ const PageText = (0, translations_1.usePageText)();
13
12
  const { getLinesByMode, getQuaysByLine } = (0, use_lines_1.useLines)();
14
13
  const transportModeOptions = (0, use_lines_1.useTransportModeOptions)();
15
14
  return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)(components_1.Fieldset, { title: t(PageText.Contact.refund.refundTaxi.taxiReceipt.title), children: [(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({
@@ -55,11 +54,18 @@ const RefundTaxiForm = ({ state, send }) => {
55
54
  type: 'ON_INPUT_CHANGE',
56
55
  inputName: 'date',
57
56
  value: date,
58
- }), errorMessage: state.context?.errorMessages['date']?.[0] }), (0, jsx_runtime_1.jsx)(components_1.TimeSelector, { id: "plannedDepartureTime", isRequired: true, label: t(PageText.Contact.input.plannedDepartureTime.label), value: state.context.plannedDepartureTime, onChange: (time) => send({
59
- type: 'ON_INPUT_CHANGE',
60
- inputName: 'plannedDepartureTime',
61
- value: time,
62
- }), errorMessage: state.context?.errorMessages['plannedDepartureTime']?.[0] }), (0, jsx_runtime_1.jsx)(components_1.Select, { id: "reasonForTransportFailure", label: t(PageText.Contact.input.reasonForTransportFailure.label), value: state.context.reasonForTransportFailure, disabled: !state.context.line, onChange: (value) => {
57
+ }), 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) => {
58
+ send({
59
+ type: 'ON_INPUT_CHANGE',
60
+ inputName: 'plannedDepartureTime',
61
+ value: time,
62
+ });
63
+ send({
64
+ type: 'ON_INPUT_CHANGE',
65
+ inputName: 'tripId',
66
+ value: tripId,
67
+ });
68
+ }, isRequired: true, errorMessage: state.context?.errorMessages['plannedDepartureTime']?.[0] }), (0, jsx_runtime_1.jsx)(components_1.Select, { id: "reasonForTransportFailure", label: t(PageText.Contact.input.reasonForTransportFailure.label), value: state.context.reasonForTransportFailure, disabled: !state.context.line, onChange: (value) => {
63
69
  if (!value)
64
70
  return;
65
71
  send({
@@ -75,7 +81,8 @@ const RefundTaxiForm = ({ state, send }) => {
75
81
  value: e.target.value,
76
82
  }), fileInputProps: {
77
83
  id: 'attachments',
78
- iconLabel: t(PageText.Contact.input.feedback.attachment.generic),
84
+ iconLabel: t(PageText.Contact.refund.refundAndTravelGuarantee
85
+ .feedbackAttachmentLabel),
79
86
  name: 'attachments',
80
87
  onChange: (files) => {
81
88
  send({
@@ -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;AAIhD,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,4CAwDpE,CAAC;AAkIF,MAAM,CAAC,OAAO,UAAU,sBAAsB,CAAC,EAC7C,KAAK,EACL,IAAI,GACL,EAAE,oBAAoB,2CAOtB"}
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,4CAyDpE,CAAC;AAqQF,MAAM,CAAC,OAAO,UAAU,sBAAsB,CAAC,EAC7C,KAAK,EACL,IAAI,GACL,EAAE,oBAAoB,2CAWtB"}