@mrfylke/contact-form 0.1.10 → 0.1.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (166) hide show
  1. package/README.md +393 -2
  2. package/lib/ContactFormRoot.d.ts +11 -1
  3. package/lib/ContactFormRoot.d.ts.map +1 -1
  4. package/lib/ContactFormRoot.js +2 -2
  5. package/lib/commoneEvents.d.ts +1 -1
  6. package/lib/commoneEvents.d.ts.map +1 -1
  7. package/lib/components/form/date-selector.d.ts.map +1 -1
  8. package/lib/components/form/date-selector.js +5 -4
  9. package/lib/components/form/departure-time-field.d.ts +16 -0
  10. package/lib/components/form/departure-time-field.d.ts.map +1 -0
  11. package/lib/components/form/departure-time-field.js +28 -0
  12. package/lib/components/form/description-modal.d.ts.map +1 -1
  13. package/lib/components/form/description-modal.js +2 -1
  14. package/lib/components/form/file-input.d.ts.map +1 -1
  15. package/lib/components/form/file-input.js +2 -1
  16. package/lib/components/form/index.d.ts +1 -0
  17. package/lib/components/form/index.d.ts.map +1 -1
  18. package/lib/components/form/index.js +3 -1
  19. package/lib/components/form/input.d.ts.map +1 -1
  20. package/lib/components/form/input.js +2 -1
  21. package/lib/components/form/searchable-select/utils.js +6 -1
  22. package/lib/components/index.d.ts +1 -1
  23. package/lib/components/index.d.ts.map +1 -1
  24. package/lib/components/index.js +2 -1
  25. package/lib/contact.module.css +9 -0
  26. package/lib/error-content/error-content.d.ts.map +1 -1
  27. package/lib/error-content/error-content.js +2 -1
  28. package/lib/group-travel/index.d.ts.map +1 -1
  29. package/lib/group-travel/index.js +3 -1
  30. package/lib/index.d.ts +16 -4
  31. package/lib/index.d.ts.map +1 -1
  32. package/lib/index.js +41 -1
  33. package/lib/journey-info/index.d.ts.map +1 -1
  34. package/lib/journey-info/index.js +14 -8
  35. package/lib/journey-info/journeyInfoStateMachine.d.ts +8 -8
  36. package/lib/layouts/contact-page-layout.d.ts +2 -2
  37. package/lib/layouts/contact-page-layout.d.ts.map +1 -1
  38. package/lib/layouts/contact-page-layout.js +29 -20
  39. package/lib/layouts/container.module.css +1 -1
  40. package/lib/layouts/layout.module.css +23 -2
  41. package/lib/lines/use-departures.d.ts +12 -0
  42. package/lib/lines/use-departures.d.ts.map +1 -0
  43. package/lib/lines/use-departures.js +35 -0
  44. package/lib/lines/use-lines.d.ts +5 -6
  45. package/lib/lines/use-lines.d.ts.map +1 -1
  46. package/lib/lines/use-lines.js +75 -42
  47. package/lib/lost-property/LostPropertyForm.d.ts +10 -0
  48. package/lib/lost-property/LostPropertyForm.d.ts.map +1 -0
  49. package/lib/lost-property/LostPropertyForm.js +65 -0
  50. package/lib/lost-property/LostPropertyMachine.d.ts +116 -0
  51. package/lib/lost-property/LostPropertyMachine.d.ts.map +1 -0
  52. package/lib/lost-property/LostPropertyMachine.js +187 -0
  53. package/lib/lost-property/index.d.ts.map +1 -1
  54. package/lib/lost-property/index.js +27 -3
  55. package/lib/means-of-transport/forms/delayForm.d.ts.map +1 -1
  56. package/lib/means-of-transport/forms/delayForm.js +26 -18
  57. package/lib/means-of-transport/forms/driverForm.d.ts.map +1 -1
  58. package/lib/means-of-transport/forms/driverForm.js +26 -18
  59. package/lib/means-of-transport/forms/injuryForm.d.ts.map +1 -1
  60. package/lib/means-of-transport/forms/injuryForm.js +26 -18
  61. package/lib/means-of-transport/forms/serviceOfferingForm.d.ts.map +1 -1
  62. package/lib/means-of-transport/forms/serviceOfferingForm.js +10 -10
  63. package/lib/means-of-transport/forms/stopForm.d.ts.map +1 -1
  64. package/lib/means-of-transport/forms/stopForm.js +13 -12
  65. package/lib/means-of-transport/forms/transportationForm.d.ts.map +1 -1
  66. package/lib/means-of-transport/forms/transportationForm.js +26 -18
  67. package/lib/means-of-transport/index.d.ts.map +1 -1
  68. package/lib/means-of-transport/index.js +13 -4
  69. package/lib/means-of-transport/means-of-transport-form-machine.d.ts +10 -8
  70. package/lib/means-of-transport/means-of-transport-form-machine.d.ts.map +1 -1
  71. package/lib/means-of-transport/means-of-transport-form-machine.js +6 -1
  72. package/lib/modules/config/types.d.ts +56 -1
  73. package/lib/modules/config/types.d.ts.map +1 -1
  74. package/lib/refund/events.d.ts +1 -1
  75. package/lib/refund/events.d.ts.map +1 -1
  76. package/lib/refund/forms/refund-and-travel-guarantee/index.d.ts.map +1 -1
  77. package/lib/refund/forms/refund-and-travel-guarantee/index.js +7 -5
  78. package/lib/refund/forms/refund-and-travel-guarantee/refundCarForm.d.ts.map +1 -1
  79. package/lib/refund/forms/refund-and-travel-guarantee/refundCarForm.js +39 -29
  80. package/lib/refund/forms/refund-and-travel-guarantee/refundTaxiForm.d.ts.map +1 -1
  81. package/lib/refund/forms/refund-and-travel-guarantee/refundTaxiForm.js +37 -28
  82. package/lib/refund/forms/refund-ticket/appTicketRefund.d.ts.map +1 -1
  83. package/lib/refund/forms/refund-ticket/appTicketRefund.js +46 -25
  84. package/lib/refund/forms/refund-ticket/index.d.ts.map +1 -1
  85. package/lib/refund/forms/refund-ticket/index.js +9 -6
  86. package/lib/refund/forms/refund-ticket/otherTicketRefund.d.ts.map +1 -1
  87. package/lib/refund/forms/refund-ticket/otherTicketRefund.js +56 -30
  88. package/lib/refund/forms/residualValueOnTravelCard/index.d.ts.map +1 -1
  89. package/lib/refund/forms/residualValueOnTravelCard/index.js +5 -3
  90. package/lib/refund/index.d.ts.map +1 -1
  91. package/lib/refund/index.js +39 -6
  92. package/lib/refund/refundFormMachine.d.ts +37 -13
  93. package/lib/refund/refundFormMachine.d.ts.map +1 -1
  94. package/lib/refund/refundFormMachine.js +107 -11
  95. package/lib/server/journey-planner/index.d.ts.map +1 -1
  96. package/lib/server/journey-planner/index.js +15 -6
  97. package/lib/server/journey-planner/validators.d.ts +2 -0
  98. package/lib/server/journey-planner/validators.d.ts.map +1 -1
  99. package/lib/server/journey-planner/validators.js +1 -0
  100. package/lib/success-content/success-content.d.ts.map +1 -1
  101. package/lib/success-content/success-content.js +2 -1
  102. package/lib/test-utils/setup.d.ts +2 -0
  103. package/lib/test-utils/setup.d.ts.map +1 -0
  104. package/lib/test-utils/setup.js +3 -0
  105. package/lib/ticket-control/events.d.ts +1 -1
  106. package/lib/ticket-control/events.d.ts.map +1 -1
  107. package/lib/ticket-control/forms/feeComplaintForm.d.ts.map +1 -1
  108. package/lib/ticket-control/forms/feeComplaintForm.js +39 -36
  109. package/lib/ticket-control/forms/feedbackForm.d.ts.map +1 -1
  110. package/lib/ticket-control/forms/feedbackForm.js +26 -14
  111. package/lib/ticket-control/forms/postponePayment.d.ts.map +1 -1
  112. package/lib/ticket-control/forms/postponePayment.js +8 -7
  113. package/lib/ticket-control/index.d.ts.map +1 -1
  114. package/lib/ticket-control/index.js +23 -8
  115. package/lib/ticket-control/ticket-control-form-machine.d.ts +19 -11
  116. package/lib/ticket-control/ticket-control-form-machine.d.ts.map +1 -1
  117. package/lib/ticket-control/ticket-control-form-machine.js +25 -5
  118. package/lib/ticketing/forms/app/appAccountForm.d.ts.map +1 -1
  119. package/lib/ticketing/forms/app/appAccountForm.js +9 -8
  120. package/lib/ticketing/forms/app/appTicketingForm.d.ts.map +1 -1
  121. package/lib/ticketing/forms/app/appTicketingForm.js +13 -12
  122. package/lib/ticketing/forms/app/appTravelSuggestionForm.d.ts.map +1 -1
  123. package/lib/ticketing/forms/app/appTravelSuggestionForm.js +6 -5
  124. package/lib/ticketing/forms/app/index.d.ts.map +1 -1
  125. package/lib/ticketing/forms/app/index.js +2 -1
  126. package/lib/ticketing/forms/priceAndTicketTypesForm.d.ts.map +1 -1
  127. package/lib/ticketing/forms/priceAndTicketTypesForm.js +6 -5
  128. package/lib/ticketing/forms/travel-card/index.d.ts.map +1 -1
  129. package/lib/ticketing/forms/travel-card/index.js +2 -1
  130. package/lib/ticketing/forms/travel-card/orderTravelCard.d.ts.map +1 -1
  131. package/lib/ticketing/forms/travel-card/orderTravelCard.js +2 -2
  132. package/lib/ticketing/forms/travel-card/travelCardQuestionForm.d.ts.map +1 -1
  133. package/lib/ticketing/forms/travel-card/travelCardQuestionForm.js +9 -8
  134. package/lib/ticketing/forms/webshop/index.d.ts.map +1 -1
  135. package/lib/ticketing/forms/webshop/index.js +2 -1
  136. package/lib/ticketing/forms/webshop/webshopAccountForm.d.ts.map +1 -1
  137. package/lib/ticketing/forms/webshop/webshopAccountForm.js +9 -8
  138. package/lib/ticketing/forms/webshop/webshopTicketingForm.d.ts.map +1 -1
  139. package/lib/ticketing/forms/webshop/webshopTicketingForm.js +12 -11
  140. package/lib/ticketing/index.d.ts.map +1 -1
  141. package/lib/ticketing/index.js +21 -6
  142. package/lib/ticketing/ticketingStateMachine.d.ts +12 -12
  143. package/lib/translations/index.d.ts +1 -1
  144. package/lib/translations/index.d.ts.map +1 -1
  145. package/lib/translations/index.js +2 -1
  146. package/lib/translations/merge-overrides.d.ts.map +1 -1
  147. package/lib/translations/merge-overrides.js +8 -1
  148. package/lib/translations/pages/contact.d.ts +61 -0
  149. package/lib/translations/pages/contact.d.ts.map +1 -1
  150. package/lib/translations/pages/contact.js +64 -2
  151. package/lib/translations/translations-context.d.ts +2 -0
  152. package/lib/translations/translations-context.d.ts.map +1 -1
  153. package/lib/translations/translations-context.js +39 -0
  154. package/lib/types/submit-payloads.d.ts +40 -11
  155. package/lib/types/submit-payloads.d.ts.map +1 -1
  156. package/lib/types/submit-payloads.js +1 -1
  157. package/lib/types.d.ts +1 -1
  158. package/lib/types.d.ts.map +1 -1
  159. package/lib/url-form-type.d.ts +6 -0
  160. package/lib/url-form-type.d.ts.map +1 -0
  161. package/lib/url-form-type.js +21 -0
  162. package/lib/utils.d.ts.map +1 -1
  163. package/lib/utils.js +10 -0
  164. package/lib/validation/validationRules.d.ts.map +1 -1
  165. package/lib/validation/validationRules.js +31 -0
  166. package/package.json +11 -3
@@ -7,45 +7,53 @@ const components_1 = require("../../components");
7
7
  const translations_1 = require("../../translations");
8
8
  const typography_1 = require("../../components/typography");
9
9
  const DelayForm = ({ 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.delay.description), children: (0, jsx_runtime_1.jsx)(typography_1.Typo.p, { textType: "body__m", children: t(translations_1.PageText.Contact.modeOfTransport.delay.info) }) }), (0, jsx_runtime_1.jsxs)(components_1.Fieldset, { title: t(translations_1.PageText.Contact.modeOfTransport.delay.about.title), children: [(0, jsx_runtime_1.jsx)(typography_1.Typo.p, { textType: "body__m", children: t(translations_1.PageText.Contact.modeOfTransport.delay.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.delay.description), children: (0, jsx_runtime_1.jsx)(typography_1.Typo.p, { textType: "body__m", children: t(PageText.Contact.modeOfTransport.delay.info) }) }), (0, jsx_runtime_1.jsxs)(components_1.Fieldset, { title: t(PageText.Contact.modeOfTransport.delay.about.title), children: [(0, jsx_runtime_1.jsx)(typography_1.Typo.p, { textType: "body__m", children: t(PageText.Contact.modeOfTransport.delay.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, { id: "feedback", description: t(translations_1.PageText.Contact.input.feedback.description), 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, { id: "feedback", description: t(PageText.Contact.input.feedback.description), 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 DelayForm = ({ 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 DelayForm = ({ 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":"driverForm.d.ts","sourceRoot":"","sources":["../../../src/means-of-transport/forms/driverForm.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,4BAA4B,EAAE,MAAM,oCAAoC,CAAC;AAIlF,OAAO,EAAE,0BAA0B,EAAE,MAAM,WAAW,CAAC;AAiBvD,KAAK,eAAe,GAAG;IACrB,KAAK,EAAE;QAAE,OAAO,EAAE,4BAA4B,CAAA;KAAE,CAAC;IACjD,IAAI,EAAE,CAAC,KAAK,EAAE,OAAO,0BAA0B,KAAK,IAAI,CAAC;CAC1D,CAAC;AAEF,eAAO,MAAM,UAAU,GAAI,iBAAiB,eAAe,4CAyQ1D,CAAC;AAEF,eAAe,UAAU,CAAC"}
1
+ {"version":3,"file":"driverForm.d.ts","sourceRoot":"","sources":["../../../src/means-of-transport/forms/driverForm.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,4BAA4B,EAAE,MAAM,oCAAoC,CAAC;AAIlF,OAAO,EAAE,0BAA0B,EAAE,MAAM,WAAW,CAAC;AAiBvD,KAAK,eAAe,GAAG;IACrB,KAAK,EAAE;QAAE,OAAO,EAAE,4BAA4B,CAAA;KAAE,CAAC;IACjD,IAAI,EAAE,CAAC,KAAK,EAAE,OAAO,0BAA0B,KAAK,IAAI,CAAC;CAC1D,CAAC;AAEF,eAAO,MAAM,UAAU,GAAI,iBAAiB,eAAe,4CAkR1D,CAAC;AAEF,eAAe,UAAU,CAAC"}
@@ -7,45 +7,53 @@ const components_1 = require("../../components");
7
7
  const translations_1 = require("../../translations");
8
8
  const typography_1 = require("../../components/typography");
9
9
  const DriverForm = ({ 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.driver.description), children: (0, jsx_runtime_1.jsx)(typography_1.Typo.p, { textType: "body__m", children: t(translations_1.PageText.Contact.modeOfTransport.driver.info) }) }), (0, jsx_runtime_1.jsxs)(components_1.Fieldset, { title: t(translations_1.PageText.Contact.modeOfTransport.driver.about.title), children: [(0, jsx_runtime_1.jsx)(typography_1.Typo.p, { textType: "body__m", children: t(translations_1.PageText.Contact.modeOfTransport.driver.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.driver.description), children: (0, jsx_runtime_1.jsx)(typography_1.Typo.p, { textType: "body__m", children: t(PageText.Contact.modeOfTransport.driver.info) }) }), (0, jsx_runtime_1.jsxs)(components_1.Fieldset, { title: t(PageText.Contact.modeOfTransport.driver.about.title), children: [(0, jsx_runtime_1.jsx)(typography_1.Typo.p, { textType: "body__m", children: t(PageText.Contact.modeOfTransport.driver.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, { id: "feedback", description: t(translations_1.PageText.Contact.input.feedback.description), 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, { id: "feedback", description: t(PageText.Contact.input.feedback.description), 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 DriverForm = ({ 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 DriverForm = ({ 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":"injuryForm.d.ts","sourceRoot":"","sources":["../../../src/means-of-transport/forms/injuryForm.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,4BAA4B,EAAE,MAAM,oCAAoC,CAAC;AAIlF,OAAO,EAAE,0BAA0B,EAAE,MAAM,WAAW,CAAC;AAiBvD,KAAK,eAAe,GAAG;IACrB,KAAK,EAAE;QAAE,OAAO,EAAE,4BAA4B,CAAA;KAAE,CAAC;IACjD,IAAI,EAAE,CAAC,KAAK,EAAE,OAAO,0BAA0B,KAAK,IAAI,CAAC;CAC1D,CAAC;AAEF,eAAO,MAAM,UAAU,GAAI,iBAAiB,eAAe,4CAwQ1D,CAAC;AAEF,eAAe,UAAU,CAAC"}
1
+ {"version":3,"file":"injuryForm.d.ts","sourceRoot":"","sources":["../../../src/means-of-transport/forms/injuryForm.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,4BAA4B,EAAE,MAAM,oCAAoC,CAAC;AAIlF,OAAO,EAAE,0BAA0B,EAAE,MAAM,WAAW,CAAC;AAiBvD,KAAK,eAAe,GAAG;IACrB,KAAK,EAAE;QAAE,OAAO,EAAE,4BAA4B,CAAA;KAAE,CAAC;IACjD,IAAI,EAAE,CAAC,KAAK,EAAE,OAAO,0BAA0B,KAAK,IAAI,CAAC;CAC1D,CAAC;AAEF,eAAO,MAAM,UAAU,GAAI,iBAAiB,eAAe,4CAiR1D,CAAC;AAEF,eAAe,UAAU,CAAC"}
@@ -7,45 +7,53 @@ const components_1 = require("../../components");
7
7
  const translations_1 = require("../../translations");
8
8
  const typography_1 = require("../../components/typography");
9
9
  const InjuryForm = ({ 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.injury.description), children: (0, jsx_runtime_1.jsx)(typography_1.Typo.p, { textType: "body__m", children: t(translations_1.PageText.Contact.modeOfTransport.injury.info) }) }), (0, jsx_runtime_1.jsxs)(components_1.Fieldset, { title: t(translations_1.PageText.Contact.modeOfTransport.injury.about.title), children: [(0, jsx_runtime_1.jsx)(typography_1.Typo.p, { textType: "body__m", children: t(translations_1.PageText.Contact.modeOfTransport.injury.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.injury.description), children: (0, jsx_runtime_1.jsx)(typography_1.Typo.p, { textType: "body__m", children: t(PageText.Contact.modeOfTransport.injury.info) }) }), (0, jsx_runtime_1.jsxs)(components_1.Fieldset, { title: t(PageText.Contact.modeOfTransport.injury.about.title), children: [(0, jsx_runtime_1.jsx)(typography_1.Typo.p, { textType: "body__m", children: t(PageText.Contact.modeOfTransport.injury.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, { id: "feedback", description: t(translations_1.PageText.Contact.input.feedback.description), 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, { id: "feedback", description: t(PageText.Contact.input.feedback.description), 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 InjuryForm = ({ 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 InjuryForm = ({ 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":"serviceOfferingForm.d.ts","sourceRoot":"","sources":["../../../src/means-of-transport/forms/serviceOfferingForm.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,4BAA4B,EAAE,MAAM,oCAAoC,CAAC;AAIlF,OAAO,EAAE,0BAA0B,EAAE,MAAM,WAAW,CAAC;AAcvD,KAAK,wBAAwB,GAAG;IAC9B,KAAK,EAAE;QAAE,OAAO,EAAE,4BAA4B,CAAA;KAAE,CAAC;IACjD,IAAI,EAAE,CAAC,KAAK,EAAE,OAAO,0BAA0B,KAAK,IAAI,CAAC;CAC1D,CAAC;AAEF,eAAO,MAAM,mBAAmB,GAAI,kBAGjC,wBAAwB,4CAmM1B,CAAC;AAEF,eAAe,mBAAmB,CAAC"}
1
+ {"version":3,"file":"serviceOfferingForm.d.ts","sourceRoot":"","sources":["../../../src/means-of-transport/forms/serviceOfferingForm.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,4BAA4B,EAAE,MAAM,oCAAoC,CAAC;AAIlF,OAAO,EAAE,0BAA0B,EAAE,MAAM,WAAW,CAAC;AAcvD,KAAK,wBAAwB,GAAG;IAC9B,KAAK,EAAE;QAAE,OAAO,EAAE,4BAA4B,CAAA;KAAE,CAAC;IACjD,IAAI,EAAE,CAAC,KAAK,EAAE,OAAO,0BAA0B,KAAK,IAAI,CAAC;CAC1D,CAAC;AAEF,eAAO,MAAM,mBAAmB,GAAI,kBAGjC,wBAAwB,4CA+L1B,CAAC;AAEF,eAAe,mBAAmB,CAAC"}
@@ -7,21 +7,21 @@ const components_1 = require("../../components");
7
7
  const translations_1 = require("../../translations");
8
8
  const typography_1 = require("../../components/typography");
9
9
  const ServiceOfferingForm = ({ state, send, }) => {
10
+ const PageText = (0, translations_1.usePageText)();
10
11
  const { t } = (0, translations_1.useTranslation)();
11
12
  const transportModeOptions = (0, use_lines_1.useTransportModeOptions)();
12
13
  const { getLinesByMode } = (0, use_lines_1.useLines)();
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.serviceOffering.description), children: (0, jsx_runtime_1.jsx)(typography_1.Typo.p, { textType: "body__m", children: t(translations_1.PageText.Contact.modeOfTransport.serviceOffering.info) }) }), (0, jsx_runtime_1.jsxs)(components_1.Fieldset, { title: t(translations_1.PageText.Contact.modeOfTransport.serviceOffering.about.title), children: [(0, jsx_runtime_1.jsx)(typography_1.Typo.p, { textType: "body__m", children: t(translations_1.PageText.Contact.modeOfTransport.serviceOffering.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.serviceOffering.description), children: (0, jsx_runtime_1.jsx)(typography_1.Typo.p, { textType: "body__m", children: t(PageText.Contact.modeOfTransport.serviceOffering.info) }) }), (0, jsx_runtime_1.jsxs)(components_1.Fieldset, { title: t(PageText.Contact.modeOfTransport.serviceOffering.about.title), children: [(0, jsx_runtime_1.jsx)(typography_1.Typo.p, { textType: "body__m", children: t(PageText.Contact.modeOfTransport.serviceOffering.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
- }, isRequired: true, error: state.context?.errorMessages['line']?.[0] &&
24
- t(state.context?.errorMessages['line']?.[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, { id: "feedback", description: t(translations_1.PageText.Contact.input.feedback.description), value: state.context.feedback || '', onChange: (e) => send({
24
+ } })] }), (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, { id: "feedback", description: t(PageText.Contact.input.feedback.description), value: state.context.feedback || '', onChange: (e) => send({
25
25
  type: 'ON_INPUT_CHANGE',
26
26
  inputName: 'feedback',
27
27
  value: e.target.value,
@@ -30,7 +30,7 @@ const ServiceOfferingForm = ({ state, send, }) => {
30
30
  : undefined, fileInputProps: {
31
31
  id: 'attachments',
32
32
  name: 'attachments',
33
- iconLabel: t(translations_1.PageText.Contact.input.feedback.attachment.generic),
33
+ iconLabel: t(PageText.Contact.input.feedback.attachment.generic),
34
34
  onChange: (files) => {
35
35
  send({
36
36
  type: 'ON_INPUT_CHANGE',
@@ -38,23 +38,23 @@ const ServiceOfferingForm = ({ state, send, }) => {
38
38
  value: files,
39
39
  });
40
40
  },
41
- } }) }), (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({
41
+ } }) }), (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({
42
42
  type: 'ON_INPUT_CHANGE',
43
43
  inputName: 'isResponseWanted',
44
44
  value: true,
45
- }) }), (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({
45
+ }) }), (0, jsx_runtime_1.jsx)(components_1.Radio, { label: t(PageText.Contact.input.wantedResponse.options.no), checked: state.context.isResponseWanted === false, onChange: () => send({
46
46
  type: 'ON_INPUT_CHANGE',
47
47
  inputName: 'isResponseWanted',
48
48
  value: false,
49
- }) })] }), 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({
49
+ }) })] }), 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({
50
50
  type: 'ON_INPUT_CHANGE',
51
51
  inputName: 'firstName',
52
52
  value: e.target.value,
53
- }) }), (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({
53
+ }) }), (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({
54
54
  type: 'ON_INPUT_CHANGE',
55
55
  inputName: 'lastName',
56
56
  value: e.target.value,
57
- }) }), (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({
57
+ }) }), (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({
58
58
  type: 'ON_INPUT_CHANGE',
59
59
  inputName: 'email',
60
60
  value: e.target.value,
@@ -1 +1 @@
1
- {"version":3,"file":"stopForm.d.ts","sourceRoot":"","sources":["../../../src/means-of-transport/forms/stopForm.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,4BAA4B,EAAE,MAAM,oCAAoC,CAAC;AAIlF,OAAO,EAAE,0BAA0B,EAAE,MAAM,WAAW,CAAC;AAgBvD,KAAK,aAAa,GAAG;IACnB,KAAK,EAAE;QAAE,OAAO,EAAE,4BAA4B,CAAA;KAAE,CAAC;IACjD,IAAI,EAAE,CAAC,KAAK,EAAE,OAAO,0BAA0B,KAAK,IAAI,CAAC;CAC1D,CAAC;AAEF,eAAO,MAAM,QAAQ,GAAI,iBAAiB,aAAa,4CAiOtD,CAAC;AAEF,eAAe,QAAQ,CAAC"}
1
+ {"version":3,"file":"stopForm.d.ts","sourceRoot":"","sources":["../../../src/means-of-transport/forms/stopForm.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,4BAA4B,EAAE,MAAM,oCAAoC,CAAC;AAIlF,OAAO,EAAE,0BAA0B,EAAE,MAAM,WAAW,CAAC;AAgBvD,KAAK,aAAa,GAAG;IACnB,KAAK,EAAE;QAAE,OAAO,EAAE,4BAA4B,CAAA;KAAE,CAAC;IACjD,IAAI,EAAE,CAAC,KAAK,EAAE,OAAO,0BAA0B,KAAK,IAAI,CAAC;CAC1D,CAAC;AAEF,eAAO,MAAM,QAAQ,GAAI,iBAAiB,aAAa,4CAkOtD,CAAC;AAEF,eAAe,QAAQ,CAAC"}
@@ -7,33 +7,34 @@ const components_1 = require("../../components");
7
7
  const translations_1 = require("../../translations");
8
8
  const typography_1 = require("../../components/typography");
9
9
  const StopForm = ({ 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.stop.description), children: (0, jsx_runtime_1.jsx)(typography_1.Typo.p, { textType: "body__m", children: t(translations_1.PageText.Contact.modeOfTransport.stop.info) }) }), (0, jsx_runtime_1.jsxs)(components_1.Fieldset, { title: t(translations_1.PageText.Contact.modeOfTransport.stop.about.title), children: [(0, jsx_runtime_1.jsx)(typography_1.Typo.p, { textType: "body__m", children: t(translations_1.PageText.Contact.modeOfTransport.stop.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.stop.description), children: (0, jsx_runtime_1.jsx)(typography_1.Typo.p, { textType: "body__m", children: t(PageText.Contact.modeOfTransport.stop.info) }) }), (0, jsx_runtime_1.jsxs)(components_1.Fieldset, { title: t(PageText.Contact.modeOfTransport.stop.about.title), children: [(0, jsx_runtime_1.jsx)(typography_1.Typo.p, { textType: "body__m", children: t(PageText.Contact.modeOfTransport.stop.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: "stop", label: t(translations_1.PageText.Contact.input.stop.label), value: state.context.stop, isDisabled: !state.context.line, onChange: (value) => {
25
+ t(state.context?.errorMessages['line']?.[0]) }), (0, jsx_runtime_1.jsx)(components_1.SearchableSelect, { id: "stop", label: t(PageText.Contact.input.stop.label), value: state.context.stop, isDisabled: !state.context.line, onChange: (value) => {
25
26
  send({
26
27
  type: 'ON_INPUT_CHANGE',
27
28
  inputName: 'stop',
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['stop']?.[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['stop']?.[0]
31
32
  ? t(state.context?.errorMessages['stop']?.[0])
32
- : 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({
33
+ : 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({
33
34
  type: 'ON_INPUT_CHANGE',
34
35
  inputName: 'date',
35
36
  value: date,
36
- }) })] }), (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, { id: "feedback", description: t(translations_1.PageText.Contact.input.feedback.description), value: state.context.feedback || '', onChange: (e) => send({
37
+ }) })] }), (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, { id: "feedback", description: t(PageText.Contact.input.feedback.description), value: state.context.feedback || '', onChange: (e) => send({
37
38
  type: 'ON_INPUT_CHANGE',
38
39
  inputName: 'feedback',
39
40
  value: e.target.value,
@@ -42,7 +43,7 @@ const StopForm = ({ state, send }) => {
42
43
  : undefined, fileInputProps: {
43
44
  id: 'attachments',
44
45
  name: 'attachments',
45
- iconLabel: t(translations_1.PageText.Contact.input.feedback.attachment.generic),
46
+ iconLabel: t(PageText.Contact.input.feedback.attachment.generic),
46
47
  onChange: (files) => {
47
48
  send({
48
49
  type: 'ON_INPUT_CHANGE',
@@ -50,23 +51,23 @@ const StopForm = ({ state, send }) => {
50
51
  value: files,
51
52
  });
52
53
  },
53
- } }) }), (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({
54
+ } }) }), (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({
54
55
  type: 'ON_INPUT_CHANGE',
55
56
  inputName: 'isResponseWanted',
56
57
  value: true,
57
- }) }), (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({
58
+ }) }), (0, jsx_runtime_1.jsx)(components_1.Radio, { label: t(PageText.Contact.input.wantedResponse.options.no), checked: state.context.isResponseWanted === false, onChange: () => send({
58
59
  type: 'ON_INPUT_CHANGE',
59
60
  inputName: 'isResponseWanted',
60
61
  value: false,
61
- }) })] }), 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({
62
+ }) })] }), 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({
62
63
  type: 'ON_INPUT_CHANGE',
63
64
  inputName: 'firstName',
64
65
  value: e.target.value,
65
- }) }), (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({
66
+ }) }), (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({
66
67
  type: 'ON_INPUT_CHANGE',
67
68
  inputName: 'lastName',
68
69
  value: e.target.value,
69
- }) }), (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({
70
+ }) }), (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({
70
71
  type: 'ON_INPUT_CHANGE',
71
72
  inputName: 'email',
72
73
  value: e.target.value,
@@ -1 +1 @@
1
- {"version":3,"file":"transportationForm.d.ts","sourceRoot":"","sources":["../../../src/means-of-transport/forms/transportationForm.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,4BAA4B,EAAE,MAAM,oCAAoC,CAAC;AAKlF,OAAO,EAAE,0BAA0B,EAAE,MAAM,WAAW,CAAC;AAevD,KAAK,uBAAuB,GAAG;IAC7B,KAAK,EAAE;QAAE,OAAO,EAAE,4BAA4B,CAAA;KAAE,CAAC;IACjD,IAAI,EAAE,CAAC,KAAK,EAAE,OAAO,0BAA0B,KAAK,IAAI,CAAC;CAC1D,CAAC;AAEF,eAAO,MAAM,kBAAkB,GAAI,kBAGhC,uBAAuB,4CA6QzB,CAAC;AAEF,eAAe,kBAAkB,CAAC"}
1
+ {"version":3,"file":"transportationForm.d.ts","sourceRoot":"","sources":["../../../src/means-of-transport/forms/transportationForm.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,4BAA4B,EAAE,MAAM,oCAAoC,CAAC;AAKlF,OAAO,EAAE,0BAA0B,EAAE,MAAM,WAAW,CAAC;AAevD,KAAK,uBAAuB,GAAG;IAC7B,KAAK,EAAE;QAAE,OAAO,EAAE,4BAA4B,CAAA;KAAE,CAAC;IACjD,IAAI,EAAE,CAAC,KAAK,EAAE,OAAO,0BAA0B,KAAK,IAAI,CAAC;CAC1D,CAAC;AAEF,eAAO,MAAM,kBAAkB,GAAI,kBAGhC,uBAAuB,4CAsRzB,CAAC;AAEF,eAAe,kBAAkB,CAAC"}