@mrfylke/contact-form 0.1.10 → 0.1.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +393 -2
- package/lib/ContactFormRoot.d.ts +11 -1
- package/lib/ContactFormRoot.d.ts.map +1 -1
- package/lib/ContactFormRoot.js +2 -2
- package/lib/commoneEvents.d.ts +1 -1
- package/lib/commoneEvents.d.ts.map +1 -1
- package/lib/components/form/date-selector.d.ts.map +1 -1
- package/lib/components/form/date-selector.js +5 -4
- package/lib/components/form/departure-time-field.d.ts +16 -0
- package/lib/components/form/departure-time-field.d.ts.map +1 -0
- package/lib/components/form/departure-time-field.js +28 -0
- package/lib/components/form/description-modal.d.ts.map +1 -1
- package/lib/components/form/description-modal.js +2 -1
- package/lib/components/form/file-input.d.ts.map +1 -1
- package/lib/components/form/file-input.js +2 -1
- package/lib/components/form/index.d.ts +1 -0
- package/lib/components/form/index.d.ts.map +1 -1
- package/lib/components/form/index.js +3 -1
- package/lib/components/form/input.d.ts.map +1 -1
- package/lib/components/form/input.js +2 -1
- package/lib/components/form/searchable-select/utils.js +6 -1
- package/lib/components/index.d.ts +1 -1
- package/lib/components/index.d.ts.map +1 -1
- package/lib/components/index.js +2 -1
- package/lib/contact.module.css +9 -0
- package/lib/error-content/error-content.d.ts.map +1 -1
- package/lib/error-content/error-content.js +2 -1
- package/lib/group-travel/index.d.ts.map +1 -1
- package/lib/group-travel/index.js +3 -1
- package/lib/index.d.ts +16 -4
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +41 -1
- package/lib/journey-info/index.d.ts.map +1 -1
- package/lib/journey-info/index.js +14 -8
- package/lib/journey-info/journeyInfoStateMachine.d.ts +8 -8
- package/lib/layouts/contact-page-layout.d.ts +2 -2
- package/lib/layouts/contact-page-layout.d.ts.map +1 -1
- package/lib/layouts/contact-page-layout.js +29 -20
- package/lib/layouts/container.module.css +1 -1
- package/lib/layouts/layout.module.css +23 -2
- package/lib/lines/use-departures.d.ts +12 -0
- package/lib/lines/use-departures.d.ts.map +1 -0
- package/lib/lines/use-departures.js +35 -0
- package/lib/lines/use-lines.d.ts +5 -6
- package/lib/lines/use-lines.d.ts.map +1 -1
- package/lib/lines/use-lines.js +75 -42
- package/lib/lost-property/LostPropertyForm.d.ts +10 -0
- package/lib/lost-property/LostPropertyForm.d.ts.map +1 -0
- package/lib/lost-property/LostPropertyForm.js +65 -0
- package/lib/lost-property/LostPropertyMachine.d.ts +116 -0
- package/lib/lost-property/LostPropertyMachine.d.ts.map +1 -0
- package/lib/lost-property/LostPropertyMachine.js +187 -0
- package/lib/lost-property/index.d.ts.map +1 -1
- package/lib/lost-property/index.js +27 -3
- package/lib/means-of-transport/forms/delayForm.d.ts.map +1 -1
- package/lib/means-of-transport/forms/delayForm.js +26 -18
- package/lib/means-of-transport/forms/driverForm.d.ts.map +1 -1
- package/lib/means-of-transport/forms/driverForm.js +26 -18
- package/lib/means-of-transport/forms/injuryForm.d.ts.map +1 -1
- package/lib/means-of-transport/forms/injuryForm.js +26 -18
- package/lib/means-of-transport/forms/serviceOfferingForm.d.ts.map +1 -1
- package/lib/means-of-transport/forms/serviceOfferingForm.js +10 -10
- package/lib/means-of-transport/forms/stopForm.d.ts.map +1 -1
- package/lib/means-of-transport/forms/stopForm.js +13 -12
- package/lib/means-of-transport/forms/transportationForm.d.ts.map +1 -1
- package/lib/means-of-transport/forms/transportationForm.js +26 -18
- package/lib/means-of-transport/index.d.ts.map +1 -1
- package/lib/means-of-transport/index.js +13 -4
- package/lib/means-of-transport/means-of-transport-form-machine.d.ts +10 -8
- package/lib/means-of-transport/means-of-transport-form-machine.d.ts.map +1 -1
- package/lib/means-of-transport/means-of-transport-form-machine.js +6 -1
- package/lib/modules/config/types.d.ts +56 -1
- package/lib/modules/config/types.d.ts.map +1 -1
- package/lib/refund/events.d.ts +1 -1
- package/lib/refund/events.d.ts.map +1 -1
- package/lib/refund/forms/refund-and-travel-guarantee/index.d.ts.map +1 -1
- package/lib/refund/forms/refund-and-travel-guarantee/index.js +7 -5
- package/lib/refund/forms/refund-and-travel-guarantee/refundCarForm.d.ts.map +1 -1
- package/lib/refund/forms/refund-and-travel-guarantee/refundCarForm.js +39 -29
- package/lib/refund/forms/refund-and-travel-guarantee/refundTaxiForm.d.ts.map +1 -1
- package/lib/refund/forms/refund-and-travel-guarantee/refundTaxiForm.js +37 -28
- package/lib/refund/forms/refund-ticket/appTicketRefund.d.ts.map +1 -1
- package/lib/refund/forms/refund-ticket/appTicketRefund.js +46 -25
- package/lib/refund/forms/refund-ticket/index.d.ts.map +1 -1
- package/lib/refund/forms/refund-ticket/index.js +9 -6
- package/lib/refund/forms/refund-ticket/otherTicketRefund.d.ts.map +1 -1
- package/lib/refund/forms/refund-ticket/otherTicketRefund.js +56 -30
- package/lib/refund/forms/residualValueOnTravelCard/index.d.ts.map +1 -1
- package/lib/refund/forms/residualValueOnTravelCard/index.js +5 -3
- package/lib/refund/index.d.ts.map +1 -1
- package/lib/refund/index.js +39 -6
- package/lib/refund/refundFormMachine.d.ts +37 -13
- package/lib/refund/refundFormMachine.d.ts.map +1 -1
- package/lib/refund/refundFormMachine.js +107 -11
- package/lib/server/journey-planner/index.d.ts.map +1 -1
- package/lib/server/journey-planner/index.js +15 -6
- package/lib/server/journey-planner/validators.d.ts +2 -0
- package/lib/server/journey-planner/validators.d.ts.map +1 -1
- package/lib/server/journey-planner/validators.js +1 -0
- package/lib/success-content/success-content.d.ts.map +1 -1
- package/lib/success-content/success-content.js +2 -1
- package/lib/test-utils/setup.d.ts +2 -0
- package/lib/test-utils/setup.d.ts.map +1 -0
- package/lib/test-utils/setup.js +3 -0
- package/lib/ticket-control/events.d.ts +1 -1
- package/lib/ticket-control/events.d.ts.map +1 -1
- package/lib/ticket-control/forms/feeComplaintForm.d.ts.map +1 -1
- package/lib/ticket-control/forms/feeComplaintForm.js +39 -36
- package/lib/ticket-control/forms/feedbackForm.d.ts.map +1 -1
- package/lib/ticket-control/forms/feedbackForm.js +26 -14
- package/lib/ticket-control/forms/postponePayment.d.ts.map +1 -1
- package/lib/ticket-control/forms/postponePayment.js +8 -7
- package/lib/ticket-control/index.d.ts.map +1 -1
- package/lib/ticket-control/index.js +23 -8
- package/lib/ticket-control/ticket-control-form-machine.d.ts +19 -11
- package/lib/ticket-control/ticket-control-form-machine.d.ts.map +1 -1
- package/lib/ticket-control/ticket-control-form-machine.js +25 -5
- package/lib/ticketing/forms/app/appAccountForm.d.ts.map +1 -1
- package/lib/ticketing/forms/app/appAccountForm.js +9 -8
- package/lib/ticketing/forms/app/appTicketingForm.d.ts.map +1 -1
- package/lib/ticketing/forms/app/appTicketingForm.js +13 -12
- package/lib/ticketing/forms/app/appTravelSuggestionForm.d.ts.map +1 -1
- package/lib/ticketing/forms/app/appTravelSuggestionForm.js +6 -5
- package/lib/ticketing/forms/app/index.d.ts.map +1 -1
- package/lib/ticketing/forms/app/index.js +2 -1
- package/lib/ticketing/forms/priceAndTicketTypesForm.d.ts.map +1 -1
- package/lib/ticketing/forms/priceAndTicketTypesForm.js +6 -5
- package/lib/ticketing/forms/travel-card/index.d.ts.map +1 -1
- package/lib/ticketing/forms/travel-card/index.js +2 -1
- package/lib/ticketing/forms/travel-card/orderTravelCard.d.ts.map +1 -1
- package/lib/ticketing/forms/travel-card/orderTravelCard.js +2 -2
- package/lib/ticketing/forms/travel-card/travelCardQuestionForm.d.ts.map +1 -1
- package/lib/ticketing/forms/travel-card/travelCardQuestionForm.js +9 -8
- package/lib/ticketing/forms/webshop/index.d.ts.map +1 -1
- package/lib/ticketing/forms/webshop/index.js +2 -1
- package/lib/ticketing/forms/webshop/webshopAccountForm.d.ts.map +1 -1
- package/lib/ticketing/forms/webshop/webshopAccountForm.js +9 -8
- package/lib/ticketing/forms/webshop/webshopTicketingForm.d.ts.map +1 -1
- package/lib/ticketing/forms/webshop/webshopTicketingForm.js +12 -11
- package/lib/ticketing/index.d.ts.map +1 -1
- package/lib/ticketing/index.js +21 -6
- package/lib/ticketing/ticketingStateMachine.d.ts +12 -12
- package/lib/translations/index.d.ts +1 -1
- package/lib/translations/index.d.ts.map +1 -1
- package/lib/translations/index.js +2 -1
- package/lib/translations/merge-overrides.d.ts.map +1 -1
- package/lib/translations/merge-overrides.js +8 -1
- package/lib/translations/pages/contact.d.ts +61 -0
- package/lib/translations/pages/contact.d.ts.map +1 -1
- package/lib/translations/pages/contact.js +64 -2
- package/lib/translations/translations-context.d.ts +2 -0
- package/lib/translations/translations-context.d.ts.map +1 -1
- package/lib/translations/translations-context.js +39 -0
- package/lib/types/submit-payloads.d.ts +40 -11
- package/lib/types/submit-payloads.d.ts.map +1 -1
- package/lib/types/submit-payloads.js +1 -1
- package/lib/types.d.ts +1 -1
- package/lib/types.d.ts.map +1 -1
- package/lib/url-form-type.d.ts +6 -0
- package/lib/url-form-type.d.ts.map +1 -0
- package/lib/url-form-type.js +21 -0
- package/lib/utils.d.ts.map +1 -1
- package/lib/utils.js +10 -0
- package/lib/validation/validationRules.d.ts.map +1 -1
- package/lib/validation/validationRules.js +31 -0
- package/package.json +11 -3
|
@@ -5,8 +5,9 @@ const jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
5
5
|
const translations_1 = require("../../../translations");
|
|
6
6
|
const components_1 = require("../../../components");
|
|
7
7
|
const AppTravelSuggestionForm = ({ state, send, }) => {
|
|
8
|
+
const PageText = (0, translations_1.usePageText)();
|
|
8
9
|
const { t } = (0, translations_1.useTranslation)();
|
|
9
|
-
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(components_1.Fieldset, { title: t(
|
|
10
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(components_1.Fieldset, { title: t(PageText.Contact.input.question.title), isRequired: true, children: (0, jsx_runtime_1.jsx)(components_1.Textarea, { id: "question", description: t(PageText.Contact.input.question.info), value: state.context.question || '', onChange: (e) => send({
|
|
10
11
|
type: 'ON_INPUT_CHANGE',
|
|
11
12
|
inputName: 'question',
|
|
12
13
|
value: e.target.value,
|
|
@@ -15,7 +16,7 @@ const AppTravelSuggestionForm = ({ state, send, }) => {
|
|
|
15
16
|
: undefined, fileInputProps: {
|
|
16
17
|
id: 'attachments',
|
|
17
18
|
name: 'attachments',
|
|
18
|
-
iconLabel: t(
|
|
19
|
+
iconLabel: t(PageText.Contact.input.question.attachment),
|
|
19
20
|
onChange: (files) => {
|
|
20
21
|
send({
|
|
21
22
|
type: 'ON_INPUT_CHANGE',
|
|
@@ -23,15 +24,15 @@ const AppTravelSuggestionForm = ({ state, send, }) => {
|
|
|
23
24
|
value: files,
|
|
24
25
|
});
|
|
25
26
|
},
|
|
26
|
-
} }) }), (0, jsx_runtime_1.jsxs)(components_1.Fieldset, { title: t(
|
|
27
|
+
} }) }), (0, jsx_runtime_1.jsxs)(components_1.Fieldset, { title: t(PageText.Contact.aboutYouInfo.title), children: [(0, jsx_runtime_1.jsx)(components_1.Input, { id: "firstName", label: t(PageText.Contact.input.firstName.label), type: "text", autoComplete: "given-name additional-name", name: "firstName", value: state.context.firstName || '', isRequired: true, errorMessage: state.context?.errorMessages['firstName']?.[0], onChange: (e) => send({
|
|
27
28
|
type: 'ON_INPUT_CHANGE',
|
|
28
29
|
inputName: 'firstName',
|
|
29
30
|
value: e.target.value,
|
|
30
|
-
}) }), (0, jsx_runtime_1.jsx)(components_1.Input, { id: "lastName", label: t(
|
|
31
|
+
}) }), (0, jsx_runtime_1.jsx)(components_1.Input, { id: "lastName", label: t(PageText.Contact.input.lastName.label), type: "text", autoComplete: "family-name", name: "lastName", value: state.context.lastName || '', isRequired: true, errorMessage: state.context?.errorMessages['lastName']?.[0], onChange: (e) => send({
|
|
31
32
|
type: 'ON_INPUT_CHANGE',
|
|
32
33
|
inputName: 'lastName',
|
|
33
34
|
value: e.target.value,
|
|
34
|
-
}) }), (0, jsx_runtime_1.jsx)(components_1.Input, { id: "email", label: t(
|
|
35
|
+
}) }), (0, jsx_runtime_1.jsx)(components_1.Input, { id: "email", label: t(PageText.Contact.input.email.label), type: "email", autoComplete: "email", name: "email", value: state.context.email || '', isRequired: true, errorMessage: state.context?.errorMessages['email']?.[0], onChange: (e) => send({
|
|
35
36
|
type: 'ON_INPUT_CHANGE',
|
|
36
37
|
inputName: 'email',
|
|
37
38
|
value: e.target.value,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/ticketing/forms/app/index.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AAEnC,OAAO,EAAW,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AAI7E,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAGnD,KAAK,aAAa,GAAG;IACnB,KAAK,EAAE,SAAS,CAAC,OAAO,qBAAqB,CAAC,CAAC;IAC/C,IAAI,EAAE,CAAC,KAAK,EAAE,OAAO,mBAAmB,KAAK,IAAI,CAAC;CACnD,CAAC;AAEF,eAAO,MAAM,QAAQ,GAAI,iBAAiB,aAAa,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/ticketing/forms/app/index.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AAEnC,OAAO,EAAW,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AAI7E,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAGnD,KAAK,aAAa,GAAG;IACnB,KAAK,EAAE,SAAS,CAAC,OAAO,qBAAqB,CAAC,CAAC;IAC/C,IAAI,EAAE,CAAC,KAAK,EAAE,OAAO,mBAAmB,KAAK,IAAI,CAAC;CACnD,CAAC;AAEF,eAAO,MAAM,QAAQ,GAAI,iBAAiB,aAAa,4CAoCtD,CAAC;AAEF,eAAe,QAAQ,CAAC"}
|
|
@@ -13,8 +13,9 @@ const appTicketingForm_1 = __importDefault(require("./appTicketingForm"));
|
|
|
13
13
|
const appTravelSuggestionForm_1 = __importDefault(require("./appTravelSuggestionForm"));
|
|
14
14
|
const components_1 = require("../../../components");
|
|
15
15
|
const AppForms = ({ state, send }) => {
|
|
16
|
+
const PageText = (0, translations_1.usePageText)();
|
|
16
17
|
const { t } = (0, translations_1.useTranslation)();
|
|
17
|
-
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(components_1.Fieldset, { title: t(
|
|
18
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(components_1.Fieldset, { title: t(PageText.Contact.ticketing.app.description), children: (0, jsx_runtime_1.jsx)("ul", { className: contact_module_css_1.default.form_options__list, children: Object.values(ticketingStateMachine_1.AppForm).map((appForm) => ((0, jsx_runtime_1.jsx)("li", { children: (0, jsx_runtime_1.jsx)(components_1.Radio, { label: t(PageText.Contact.ticketing.app[appForm].label), checked: state.matches({ editing: { app: appForm } }), onChange: () => send({
|
|
18
19
|
type: 'SELECT_APP_FORM',
|
|
19
20
|
appForm: appForm,
|
|
20
21
|
}) }) }, appForm))) }) }), state.matches({ editing: { app: 'appTicketing' } }) && ((0, jsx_runtime_1.jsx)(appTicketingForm_1.default, { state: state, send: send })), state.matches({ editing: { app: 'appTravelSuggestion' } }) && ((0, jsx_runtime_1.jsx)(appTravelSuggestionForm_1.default, { state: state, send: send })), state.matches({ editing: { app: 'appAccount' } }) && ((0, jsx_runtime_1.jsx)(appAccountForm_1.default, { state: state, send: send }))] }));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"priceAndTicketTypesForm.d.ts","sourceRoot":"","sources":["../../../src/ticketing/forms/priceAndTicketTypesForm.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAChE,OAAO,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC;AAGhD,KAAK,4BAA4B,GAAG;IAClC,KAAK,EAAE;QAAE,OAAO,EAAE,oBAAoB,CAAA;KAAE,CAAC;IACzC,IAAI,EAAE,CAAC,KAAK,EAAE,OAAO,mBAAmB,KAAK,IAAI,CAAC;CACnD,CAAC;AAEF,eAAO,MAAM,uBAAuB,GAAI,kBAGrC,4BAA4B,
|
|
1
|
+
{"version":3,"file":"priceAndTicketTypesForm.d.ts","sourceRoot":"","sources":["../../../src/ticketing/forms/priceAndTicketTypesForm.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAChE,OAAO,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC;AAGhD,KAAK,4BAA4B,GAAG;IAClC,KAAK,EAAE;QAAE,OAAO,EAAE,oBAAoB,CAAA;KAAE,CAAC;IACzC,IAAI,EAAE,CAAC,KAAK,EAAE,OAAO,mBAAmB,KAAK,IAAI,CAAC;CACnD,CAAC;AAEF,eAAO,MAAM,uBAAuB,GAAI,kBAGrC,4BAA4B,4CA6F9B,CAAC;AAEF,eAAe,uBAAuB,CAAC"}
|
|
@@ -5,8 +5,9 @@ const jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
5
5
|
const translations_1 = require("../../translations");
|
|
6
6
|
const components_1 = require("../../components");
|
|
7
7
|
const PriceAndTicketTypesForm = ({ state, send, }) => {
|
|
8
|
+
const PageText = (0, translations_1.usePageText)();
|
|
8
9
|
const { t } = (0, translations_1.useTranslation)();
|
|
9
|
-
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(components_1.Fieldset, { title: t(
|
|
10
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(components_1.Fieldset, { title: t(PageText.Contact.input.question.title), isRequired: true, children: (0, jsx_runtime_1.jsx)(components_1.Textarea, { id: "question", description: t(PageText.Contact.input.question.info), value: state.context.question || '', onChange: (e) => send({
|
|
10
11
|
type: 'ON_INPUT_CHANGE',
|
|
11
12
|
inputName: 'question',
|
|
12
13
|
value: e.target.value,
|
|
@@ -15,7 +16,7 @@ const PriceAndTicketTypesForm = ({ state, send, }) => {
|
|
|
15
16
|
: undefined, fileInputProps: {
|
|
16
17
|
id: 'attachments',
|
|
17
18
|
name: 'attachments',
|
|
18
|
-
iconLabel: t(
|
|
19
|
+
iconLabel: t(PageText.Contact.input.question.attachment),
|
|
19
20
|
onChange: (files) => {
|
|
20
21
|
send({
|
|
21
22
|
type: 'ON_INPUT_CHANGE',
|
|
@@ -23,15 +24,15 @@ const PriceAndTicketTypesForm = ({ state, send, }) => {
|
|
|
23
24
|
value: files,
|
|
24
25
|
});
|
|
25
26
|
},
|
|
26
|
-
} }) }), (0, jsx_runtime_1.jsxs)(components_1.Fieldset, { title: t(
|
|
27
|
+
} }) }), (0, jsx_runtime_1.jsxs)(components_1.Fieldset, { title: t(PageText.Contact.aboutYouInfo.title), children: [(0, jsx_runtime_1.jsx)(components_1.Input, { id: "firstName", label: t(PageText.Contact.input.firstName.label), type: "text", autoComplete: "given-name additional-name", name: "firstName", value: state.context.firstName || '', isRequired: true, errorMessage: state.context?.errorMessages['firstName']?.[0], onChange: (e) => send({
|
|
27
28
|
type: 'ON_INPUT_CHANGE',
|
|
28
29
|
inputName: 'firstName',
|
|
29
30
|
value: e.target.value,
|
|
30
|
-
}) }), (0, jsx_runtime_1.jsx)(components_1.Input, { id: "lastName", label: t(
|
|
31
|
+
}) }), (0, jsx_runtime_1.jsx)(components_1.Input, { id: "lastName", label: t(PageText.Contact.input.lastName.label), type: "text", autoComplete: "family-name", name: "lastName", value: state.context.lastName || '', isRequired: true, errorMessage: state.context?.errorMessages['lastName']?.[0], onChange: (e) => send({
|
|
31
32
|
type: 'ON_INPUT_CHANGE',
|
|
32
33
|
inputName: 'lastName',
|
|
33
34
|
value: e.target.value,
|
|
34
|
-
}) }), (0, jsx_runtime_1.jsx)(components_1.Input, { id: "email", label: t(
|
|
35
|
+
}) }), (0, jsx_runtime_1.jsx)(components_1.Input, { id: "email", label: t(PageText.Contact.input.email.label), type: "email", autoComplete: "email", name: "email", value: state.context.email || '', isRequired: true, errorMessage: state.context?.errorMessages['email']?.[0], onChange: (e) => send({
|
|
35
36
|
type: 'ON_INPUT_CHANGE',
|
|
36
37
|
inputName: 'email',
|
|
37
38
|
value: e.target.value,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/ticketing/forms/travel-card/index.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AAEnC,OAAO,EAEL,qBAAqB,EACtB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAKnD,KAAK,oBAAoB,GAAG;IAC1B,KAAK,EAAE,SAAS,CAAC,OAAO,qBAAqB,CAAC,CAAC;IAC/C,IAAI,EAAE,CAAC,KAAK,EAAE,OAAO,mBAAmB,KAAK,IAAI,CAAC;CACnD,CAAC;AAEF,eAAO,MAAM,eAAe,GAAI,iBAAiB,oBAAoB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/ticketing/forms/travel-card/index.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AAEnC,OAAO,EAEL,qBAAqB,EACtB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAKnD,KAAK,oBAAoB,GAAG;IAC1B,KAAK,EAAE,SAAS,CAAC,OAAO,qBAAqB,CAAC,CAAC;IAC/C,IAAI,EAAE,CAAC,KAAK,EAAE,OAAO,mBAAmB,KAAK,IAAI,CAAC;CACnD,CAAC;AAEF,eAAO,MAAM,eAAe,GAAI,iBAAiB,oBAAoB,4CAqCpE,CAAC;AAEF,eAAe,eAAe,CAAC"}
|
|
@@ -12,8 +12,9 @@ const components_1 = require("../../../components");
|
|
|
12
12
|
const travelCardQuestionForm_1 = __importDefault(require("./travelCardQuestionForm"));
|
|
13
13
|
const orderTravelCard_1 = __importDefault(require("./orderTravelCard"));
|
|
14
14
|
const TravelCardForms = ({ state, send }) => {
|
|
15
|
+
const PageText = (0, translations_1.usePageText)();
|
|
15
16
|
const { t } = (0, translations_1.useTranslation)();
|
|
16
|
-
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(components_1.Fieldset, { title: t(
|
|
17
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(components_1.Fieldset, { title: t(PageText.Contact.ticketing.travelCard.description), children: (0, jsx_runtime_1.jsx)("ul", { className: contact_module_css_1.default.form_options__list, children: Object.values(ticketingStateMachine_1.TravelCardForm).map((travelCardForm) => ((0, jsx_runtime_1.jsx)("li", { children: (0, jsx_runtime_1.jsx)(components_1.Radio, { label: t(PageText.Contact.ticketing.travelCard[travelCardForm].label), checked: state.matches({
|
|
17
18
|
editing: { travelCard: travelCardForm },
|
|
18
19
|
}), onChange: () => send({
|
|
19
20
|
type: 'SELECT_TRAVELCARD_FORM',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"orderTravelCard.d.ts","sourceRoot":"","sources":["../../../../src/ticketing/forms/travel-card/orderTravelCard.tsx"],"names":[],"mappings":"AAUA,eAAO,MAAM,mBAAmB,+
|
|
1
|
+
{"version":3,"file":"orderTravelCard.d.ts","sourceRoot":"","sources":["../../../../src/ticketing/forms/travel-card/orderTravelCard.tsx"],"names":[],"mappings":"AAUA,eAAO,MAAM,mBAAmB,+CAuC/B,CAAC;AAEF,eAAe,mBAAmB,CAAC"}
|
|
@@ -13,8 +13,8 @@ const link_1 = __importDefault(require("next/link"));
|
|
|
13
13
|
const OrderTravelCardForm = () => {
|
|
14
14
|
const { t } = (0, translations_1.useTranslation)();
|
|
15
15
|
return ((0, jsx_runtime_1.jsx)(components_1.Fieldset, { title: t(translations_1.PageText.Contact.ticketing.travelCard.orderTravelCard.label), children: (0, jsx_runtime_1.jsxs)("ul", { className: contact_module_css_1.default.rules__list, children: [translations_1.PageText.Contact.ticketing.travelCard.orderTravelCard.detailsList.map((paragraph, index) => ((0, jsx_runtime_1.jsx)("li", { children: (0, jsx_runtime_1.jsx)(typography_1.Typo.p, { textType: "body__m", children: t(paragraph) }) }, `info-paragraph-${index}`))), (0, jsx_runtime_1.jsxs)("li", { children: [t(translations_1.PageText.Contact.ticketing.travelCard.orderTravelCard.detailWithUrl
|
|
16
|
-
.detail), ' ', (0, jsx_runtime_1.jsx)(link_1.default, { href: t(translations_1.PageText.Contact.ticketing.travelCard.orderTravelCard
|
|
17
|
-
.detailWithUrl.href), children: t(translations_1.PageText.Contact.ticketing.travelCard.orderTravelCard
|
|
16
|
+
.detail), ' ', (0, jsx_runtime_1.jsx)(link_1.default, { className: contact_module_css_1.default.link, href: t(translations_1.PageText.Contact.ticketing.travelCard.orderTravelCard
|
|
17
|
+
.detailWithUrl.href), target: "_blank", rel: "noopener noreferrer", children: t(translations_1.PageText.Contact.ticketing.travelCard.orderTravelCard
|
|
18
18
|
.detailWithUrl.linkText) }), "."] })] }) }));
|
|
19
19
|
};
|
|
20
20
|
exports.OrderTravelCardForm = OrderTravelCardForm;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"travelCardQuestionForm.d.ts","sourceRoot":"","sources":["../../../../src/ticketing/forms/travel-card/travelCardQuestionForm.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AACnD,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AAInE,KAAK,2BAA2B,GAAG;IACjC,KAAK,EAAE;QAAE,OAAO,EAAE,oBAAoB,CAAA;KAAE,CAAC;IACzC,IAAI,EAAE,CAAC,KAAK,EAAE,OAAO,mBAAmB,KAAK,IAAI,CAAC;CACnD,CAAC;AAEF,eAAO,MAAM,sBAAsB,GAAI,kBAGpC,2BAA2B,
|
|
1
|
+
{"version":3,"file":"travelCardQuestionForm.d.ts","sourceRoot":"","sources":["../../../../src/ticketing/forms/travel-card/travelCardQuestionForm.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AACnD,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AAInE,KAAK,2BAA2B,GAAG;IACjC,KAAK,EAAE;QAAE,OAAO,EAAE,oBAAoB,CAAA;KAAE,CAAC;IACzC,IAAI,EAAE,CAAC,KAAK,EAAE,OAAO,mBAAmB,KAAK,IAAI,CAAC;CACnD,CAAC;AAEF,eAAO,MAAM,sBAAsB,GAAI,kBAGpC,2BAA2B,4CAyI7B,CAAC;AAEF,eAAe,sBAAsB,CAAC"}
|
|
@@ -6,14 +6,15 @@ const translations_1 = require("../../../translations");
|
|
|
6
6
|
const typography_1 = require("../../../components/typography");
|
|
7
7
|
const components_1 = require("../../../components");
|
|
8
8
|
const TravelCardQuestionForm = ({ state, send, }) => {
|
|
9
|
+
const PageText = (0, translations_1.usePageText)();
|
|
9
10
|
const { t } = (0, translations_1.useTranslation)();
|
|
10
|
-
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)(components_1.Fieldset, { title: t(
|
|
11
|
-
description: t(
|
|
11
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)(components_1.Fieldset, { title: t(PageText.Contact.ticketing.travelCard.travelCardQuestion.label), children: [(0, jsx_runtime_1.jsx)(typography_1.Typo.p, { textType: "body__m", children: t(PageText.Contact.input.travelCardNumber.info) }), (0, jsx_runtime_1.jsx)(components_1.Input, { id: "travelCardNumber", label: t(PageText.Contact.input.travelCardNumber.label), type: "text", name: "travelCardNumber", value: state.context.travelCardNumber || '', modalContent: {
|
|
12
|
+
description: t(PageText.Contact.input.travelCardNumber.info),
|
|
12
13
|
}, isRequired: true, errorMessage: state.context?.errorMessages['travelCardNumber']?.[0], onChange: (e) => send({
|
|
13
14
|
type: 'ON_INPUT_CHANGE',
|
|
14
15
|
inputName: 'travelCardNumber',
|
|
15
16
|
value: e.target.value,
|
|
16
|
-
}) })] }), (0, jsx_runtime_1.jsx)(components_1.Fieldset, { title: t(
|
|
17
|
+
}) })] }), (0, jsx_runtime_1.jsx)(components_1.Fieldset, { title: t(PageText.Contact.input.question.title), isRequired: true, children: (0, jsx_runtime_1.jsx)(components_1.Textarea, { id: "question", description: t(PageText.Contact.input.question.info), value: state.context.question || '', onChange: (e) => send({
|
|
17
18
|
type: 'ON_INPUT_CHANGE',
|
|
18
19
|
inputName: 'question',
|
|
19
20
|
value: e.target.value,
|
|
@@ -22,7 +23,7 @@ const TravelCardQuestionForm = ({ state, send, }) => {
|
|
|
22
23
|
: undefined, fileInputProps: {
|
|
23
24
|
id: 'attachments',
|
|
24
25
|
name: 'attachments',
|
|
25
|
-
iconLabel: t(
|
|
26
|
+
iconLabel: t(PageText.Contact.input.question.attachment),
|
|
26
27
|
onChange: (files) => {
|
|
27
28
|
send({
|
|
28
29
|
type: 'ON_INPUT_CHANGE',
|
|
@@ -30,19 +31,19 @@ const TravelCardQuestionForm = ({ state, send, }) => {
|
|
|
30
31
|
value: files,
|
|
31
32
|
});
|
|
32
33
|
},
|
|
33
|
-
} }) }), (0, jsx_runtime_1.jsxs)(components_1.Fieldset, { title: t(
|
|
34
|
+
} }) }), (0, jsx_runtime_1.jsxs)(components_1.Fieldset, { title: t(PageText.Contact.aboutYouInfo.title), children: [(0, jsx_runtime_1.jsx)(components_1.Input, { id: "firstName", label: t(PageText.Contact.input.firstName.label), type: "text", autoComplete: "given-name additional-name", name: "firstName", value: state.context.firstName || '', isRequired: true, errorMessage: state.context?.errorMessages['firstName']?.[0], onChange: (e) => send({
|
|
34
35
|
type: 'ON_INPUT_CHANGE',
|
|
35
36
|
inputName: 'firstName',
|
|
36
37
|
value: e.target.value,
|
|
37
|
-
}) }), (0, jsx_runtime_1.jsx)(components_1.Input, { id: "lastName", label: t(
|
|
38
|
+
}) }), (0, jsx_runtime_1.jsx)(components_1.Input, { id: "lastName", label: t(PageText.Contact.input.lastName.label), type: "text", autoComplete: "family-name", name: "lastName", value: state.context.lastName || '', isRequired: true, errorMessage: state.context?.errorMessages['lastName']?.[0], onChange: (e) => send({
|
|
38
39
|
type: 'ON_INPUT_CHANGE',
|
|
39
40
|
inputName: 'lastName',
|
|
40
41
|
value: e.target.value,
|
|
41
|
-
}) }), (0, jsx_runtime_1.jsx)(components_1.Input, { id: "email", label: t(
|
|
42
|
+
}) }), (0, jsx_runtime_1.jsx)(components_1.Input, { id: "email", label: t(PageText.Contact.input.email.label), type: "email", autoComplete: "email", name: "email", value: state.context.email || '', isRequired: true, errorMessage: state.context?.errorMessages['email']?.[0], onChange: (e) => send({
|
|
42
43
|
type: 'ON_INPUT_CHANGE',
|
|
43
44
|
inputName: 'email',
|
|
44
45
|
value: e.target.value,
|
|
45
|
-
}) }), (0, jsx_runtime_1.jsx)(components_1.Input, { id: "phoneNumber", label: t(
|
|
46
|
+
}) }), (0, jsx_runtime_1.jsx)(components_1.Input, { id: "phoneNumber", label: t(PageText.Contact.input.phoneNumber.label), type: "tel", name: "phoneNumber", value: state.context.phoneNumber || '', isRequired: true, errorMessage: state.context?.errorMessages['phoneNumber']?.[0], onChange: (e) => send({
|
|
46
47
|
type: 'ON_INPUT_CHANGE',
|
|
47
48
|
inputName: 'phoneNumber',
|
|
48
49
|
value: e.target.value,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/ticketing/forms/webshop/index.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AAEnC,OAAO,EAEL,qBAAqB,EACtB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAKnD,KAAK,aAAa,GAAG;IACnB,KAAK,EAAE,SAAS,CAAC,OAAO,qBAAqB,CAAC,CAAC;IAC/C,IAAI,EAAE,CAAC,KAAK,EAAE,OAAO,mBAAmB,KAAK,IAAI,CAAC;CACnD,CAAC;AAEF,eAAO,MAAM,YAAY,GAAI,iBAAiB,aAAa,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/ticketing/forms/webshop/index.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AAEnC,OAAO,EAEL,qBAAqB,EACtB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAKnD,KAAK,aAAa,GAAG;IACnB,KAAK,EAAE,SAAS,CAAC,OAAO,qBAAqB,CAAC,CAAC;IAC/C,IAAI,EAAE,CAAC,KAAK,EAAE,OAAO,mBAAmB,KAAK,IAAI,CAAC;CACnD,CAAC;AAEF,eAAO,MAAM,YAAY,GAAI,iBAAiB,aAAa,4CAiC1D,CAAC;AAEF,eAAe,YAAY,CAAC"}
|
|
@@ -12,8 +12,9 @@ const components_1 = require("../../../components");
|
|
|
12
12
|
const webshopAccountForm_1 = __importDefault(require("./webshopAccountForm"));
|
|
13
13
|
const webshopTicketingForm_1 = __importDefault(require("./webshopTicketingForm"));
|
|
14
14
|
const WebshopForms = ({ state, send }) => {
|
|
15
|
+
const PageText = (0, translations_1.usePageText)();
|
|
15
16
|
const { t } = (0, translations_1.useTranslation)();
|
|
16
|
-
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(components_1.Fieldset, { title: t(
|
|
17
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(components_1.Fieldset, { title: t(PageText.Contact.ticketing.webshop.description), children: (0, jsx_runtime_1.jsx)("ul", { className: contact_module_css_1.default.form_options__list, children: Object.values(ticketingStateMachine_1.WebshopForm).map((webshopForm) => ((0, jsx_runtime_1.jsx)("li", { children: (0, jsx_runtime_1.jsx)(components_1.Radio, { label: t(PageText.Contact.ticketing.webshop[webshopForm].label), checked: state.matches({ editing: { webshop: webshopForm } }), onChange: () => send({
|
|
17
18
|
type: 'SELECT_WEBSHOP_FORM',
|
|
18
19
|
webshopForm: webshopForm,
|
|
19
20
|
}) }) }, webshopForm))) }) }), state.matches({ editing: { webshop: 'webshopTicketing' } }) && ((0, jsx_runtime_1.jsx)(webshopTicketingForm_1.default, { state: state, send: send })), state.matches({ editing: { webshop: 'webshopAccount' } }) && ((0, jsx_runtime_1.jsx)(webshopAccountForm_1.default, { state: state, send: send }))] }));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"webshopAccountForm.d.ts","sourceRoot":"","sources":["../../../../src/ticketing/forms/webshop/webshopAccountForm.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AACnD,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AAGnE,KAAK,uBAAuB,GAAG;IAC7B,KAAK,EAAE;QAAE,OAAO,EAAE,oBAAoB,CAAA;KAAE,CAAC;IACzC,IAAI,EAAE,CAAC,KAAK,EAAE,OAAO,mBAAmB,KAAK,IAAI,CAAC;CACnD,CAAC;AAEF,eAAO,MAAM,kBAAkB,GAAI,kBAGhC,uBAAuB,
|
|
1
|
+
{"version":3,"file":"webshopAccountForm.d.ts","sourceRoot":"","sources":["../../../../src/ticketing/forms/webshop/webshopAccountForm.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AACnD,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AAGnE,KAAK,uBAAuB,GAAG;IAC7B,KAAK,EAAE;QAAE,OAAO,EAAE,oBAAoB,CAAA;KAAE,CAAC;IACzC,IAAI,EAAE,CAAC,KAAK,EAAE,OAAO,mBAAmB,KAAK,IAAI,CAAC;CACnD,CAAC;AAEF,eAAO,MAAM,kBAAkB,GAAI,kBAGhC,uBAAuB,4CAgIzB,CAAC;AAEF,eAAe,kBAAkB,CAAC"}
|
|
@@ -5,8 +5,9 @@ const jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
5
5
|
const translations_1 = require("../../../translations");
|
|
6
6
|
const components_1 = require("../../../components");
|
|
7
7
|
const WebshopAccountForm = ({ state, send, }) => {
|
|
8
|
+
const PageText = (0, translations_1.usePageText)();
|
|
8
9
|
const { t } = (0, translations_1.useTranslation)();
|
|
9
|
-
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(components_1.Fieldset, { title: t(
|
|
10
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(components_1.Fieldset, { title: t(PageText.Contact.input.question.title), isRequired: true, children: (0, jsx_runtime_1.jsx)(components_1.Textarea, { id: "question", description: t(PageText.Contact.input.question.info), value: state.context.question || '', onChange: (e) => send({
|
|
10
11
|
type: 'ON_INPUT_CHANGE',
|
|
11
12
|
inputName: 'question',
|
|
12
13
|
value: e.target.value,
|
|
@@ -15,7 +16,7 @@ const WebshopAccountForm = ({ state, send, }) => {
|
|
|
15
16
|
: undefined, fileInputProps: {
|
|
16
17
|
id: 'attachments',
|
|
17
18
|
name: 'attachments',
|
|
18
|
-
iconLabel: t(
|
|
19
|
+
iconLabel: t(PageText.Contact.input.question.attachment),
|
|
19
20
|
onChange: (files) => {
|
|
20
21
|
send({
|
|
21
22
|
type: 'ON_INPUT_CHANGE',
|
|
@@ -23,25 +24,25 @@ const WebshopAccountForm = ({ state, send, }) => {
|
|
|
23
24
|
value: files,
|
|
24
25
|
});
|
|
25
26
|
},
|
|
26
|
-
} }) }), (0, jsx_runtime_1.jsxs)(components_1.Fieldset, { title: t(
|
|
27
|
+
} }) }), (0, jsx_runtime_1.jsxs)(components_1.Fieldset, { title: t(PageText.Contact.aboutYouInfo.title), children: [(0, jsx_runtime_1.jsx)(components_1.Input, { id: "customerNumber", label: t(PageText.Contact.input.customerNumber.labelOptional), type: "text", name: "customerNumber", value: state.context.customerNumber || '', errorMessage: state.context?.errorMessages['customerNumber']?.[0], onChange: (e) => send({
|
|
27
28
|
type: 'ON_INPUT_CHANGE',
|
|
28
29
|
inputName: 'customerNumber',
|
|
29
30
|
value: e.target.value,
|
|
30
31
|
}), modalContent: {
|
|
31
|
-
description: t(
|
|
32
|
-
} }), (0, jsx_runtime_1.jsx)(components_1.Input, { id: "firstName", label: t(
|
|
32
|
+
description: t(PageText.Contact.input.customerNumber.description),
|
|
33
|
+
} }), (0, jsx_runtime_1.jsx)(components_1.Input, { id: "firstName", label: t(PageText.Contact.input.firstName.label), type: "text", autoComplete: "given-name additional-name", name: "firstName", value: state.context.firstName || '', isRequired: true, errorMessage: state.context?.errorMessages['firstName']?.[0], onChange: (e) => send({
|
|
33
34
|
type: 'ON_INPUT_CHANGE',
|
|
34
35
|
inputName: 'firstName',
|
|
35
36
|
value: e.target.value,
|
|
36
|
-
}) }), (0, jsx_runtime_1.jsx)(components_1.Input, { id: "lastName", label: t(
|
|
37
|
+
}) }), (0, jsx_runtime_1.jsx)(components_1.Input, { id: "lastName", label: t(PageText.Contact.input.lastName.label), type: "text", autoComplete: "family-name", name: "lastName", value: state.context.lastName || '', isRequired: true, errorMessage: state.context?.errorMessages['lastName']?.[0], onChange: (e) => send({
|
|
37
38
|
type: 'ON_INPUT_CHANGE',
|
|
38
39
|
inputName: 'lastName',
|
|
39
40
|
value: e.target.value,
|
|
40
|
-
}) }), (0, jsx_runtime_1.jsx)(components_1.Input, { id: "email", label: t(
|
|
41
|
+
}) }), (0, jsx_runtime_1.jsx)(components_1.Input, { id: "email", label: t(PageText.Contact.input.email.label), type: "email", autoComplete: "email", name: "email", value: state.context.email || '', isRequired: true, errorMessage: state.context?.errorMessages['email']?.[0], onChange: (e) => send({
|
|
41
42
|
type: 'ON_INPUT_CHANGE',
|
|
42
43
|
inputName: 'email',
|
|
43
44
|
value: e.target.value,
|
|
44
|
-
}) }), (0, jsx_runtime_1.jsx)(components_1.Input, { id: "phoneNumber", label: t(
|
|
45
|
+
}) }), (0, jsx_runtime_1.jsx)(components_1.Input, { id: "phoneNumber", label: t(PageText.Contact.input.phoneNumber.label), type: "tel", autoComplete: "tel", name: "phoneNumber", value: state.context.phoneNumber || '', isRequired: true, errorMessage: state.context?.errorMessages['phoneNumber']?.[0], onChange: (e) => send({
|
|
45
46
|
type: 'ON_INPUT_CHANGE',
|
|
46
47
|
inputName: 'phoneNumber',
|
|
47
48
|
value: e.target.value,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"webshopTicketingForm.d.ts","sourceRoot":"","sources":["../../../../src/ticketing/forms/webshop/webshopTicketingForm.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AACnD,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AAGnE,KAAK,yBAAyB,GAAG;IAC/B,KAAK,EAAE;QAAE,OAAO,EAAE,oBAAoB,CAAA;KAAE,CAAC;IACzC,IAAI,EAAE,CAAC,KAAK,EAAE,OAAO,mBAAmB,KAAK,IAAI,CAAC;CACnD,CAAC;AAEF,eAAO,MAAM,oBAAoB,GAAI,kBAGlC,yBAAyB,
|
|
1
|
+
{"version":3,"file":"webshopTicketingForm.d.ts","sourceRoot":"","sources":["../../../../src/ticketing/forms/webshop/webshopTicketingForm.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AACnD,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AAGnE,KAAK,yBAAyB,GAAG;IAC/B,KAAK,EAAE;QAAE,OAAO,EAAE,oBAAoB,CAAA;KAAE,CAAC;IACzC,IAAI,EAAE,CAAC,KAAK,EAAE,OAAO,mBAAmB,KAAK,IAAI,CAAC;CACnD,CAAC;AAEF,eAAO,MAAM,oBAAoB,GAAI,kBAGlC,yBAAyB,4CA4J3B,CAAC;AAEF,eAAe,oBAAoB,CAAC"}
|
|
@@ -5,15 +5,16 @@ const jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
5
5
|
const translations_1 = require("../../../translations");
|
|
6
6
|
const components_1 = require("../../../components");
|
|
7
7
|
const WebshopTicketingForm = ({ state, send, }) => {
|
|
8
|
+
const PageText = (0, translations_1.usePageText)();
|
|
8
9
|
const { t } = (0, translations_1.useTranslation)();
|
|
9
|
-
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(components_1.Fieldset, { title: t(
|
|
10
|
-
description: t(
|
|
11
|
-
bulletPoints:
|
|
10
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(components_1.Fieldset, { title: t(PageText.Contact.ticketing.webshop.webshopTicketing.title), children: (0, jsx_runtime_1.jsx)(components_1.Input, { id: "orderId", label: t(PageText.Contact.input.orderId.label(false)), type: "text", name: "orderId", value: state.context.orderId || '', isRequired: true, modalContent: {
|
|
11
|
+
description: t(PageText.Contact.input.orderId.description),
|
|
12
|
+
bulletPoints: PageText.Contact.input.orderId.descriptionBulletPoints.map((bulletPoint) => t(bulletPoint)),
|
|
12
13
|
}, errorMessage: state.context?.errorMessages['orderId']?.[0], onChange: (e) => send({
|
|
13
14
|
type: 'ON_INPUT_CHANGE',
|
|
14
15
|
inputName: 'orderId',
|
|
15
16
|
value: e.target.value,
|
|
16
|
-
}) }) }), (0, jsx_runtime_1.jsx)(components_1.Fieldset, { title: t(
|
|
17
|
+
}) }) }), (0, jsx_runtime_1.jsx)(components_1.Fieldset, { title: t(PageText.Contact.input.question.title), isRequired: true, children: (0, jsx_runtime_1.jsx)(components_1.Textarea, { id: "question", description: t(PageText.Contact.input.question.info), value: state.context.question || '', onChange: (e) => send({
|
|
17
18
|
type: 'ON_INPUT_CHANGE',
|
|
18
19
|
inputName: 'question',
|
|
19
20
|
value: e.target.value,
|
|
@@ -22,7 +23,7 @@ const WebshopTicketingForm = ({ state, send, }) => {
|
|
|
22
23
|
: undefined, fileInputProps: {
|
|
23
24
|
id: 'attachments',
|
|
24
25
|
name: 'attachments',
|
|
25
|
-
iconLabel: t(
|
|
26
|
+
iconLabel: t(PageText.Contact.input.question.attachment),
|
|
26
27
|
onChange: (files) => {
|
|
27
28
|
send({
|
|
28
29
|
type: 'ON_INPUT_CHANGE',
|
|
@@ -30,25 +31,25 @@ const WebshopTicketingForm = ({ state, send, }) => {
|
|
|
30
31
|
value: files,
|
|
31
32
|
});
|
|
32
33
|
},
|
|
33
|
-
} }) }), (0, jsx_runtime_1.jsxs)(components_1.Fieldset, { title: t(
|
|
34
|
+
} }) }), (0, jsx_runtime_1.jsxs)(components_1.Fieldset, { title: t(PageText.Contact.aboutYouInfo.title), children: [(0, jsx_runtime_1.jsx)(components_1.Input, { id: "customerNumber", label: t(PageText.Contact.input.customerNumber.labelOptional), type: "text", name: "customerNumber", value: state.context.customerNumber || '', errorMessage: state.context?.errorMessages['customerNumber']?.[0], onChange: (e) => send({
|
|
34
35
|
type: 'ON_INPUT_CHANGE',
|
|
35
36
|
inputName: 'customerNumber',
|
|
36
37
|
value: e.target.value,
|
|
37
38
|
}), modalContent: {
|
|
38
|
-
description: t(
|
|
39
|
-
} }), (0, jsx_runtime_1.jsx)(components_1.Input, { id: "firstName", label: t(
|
|
39
|
+
description: t(PageText.Contact.input.customerNumber.description),
|
|
40
|
+
} }), (0, jsx_runtime_1.jsx)(components_1.Input, { id: "firstName", label: t(PageText.Contact.input.firstName.label), type: "text", autoComplete: "given-name additional-name", name: "firstName", isRequired: true, value: state.context.firstName || '', errorMessage: state.context?.errorMessages['firstName']?.[0], onChange: (e) => send({
|
|
40
41
|
type: 'ON_INPUT_CHANGE',
|
|
41
42
|
inputName: 'firstName',
|
|
42
43
|
value: e.target.value,
|
|
43
|
-
}) }), (0, jsx_runtime_1.jsx)(components_1.Input, { id: "lastName", label: t(
|
|
44
|
+
}) }), (0, jsx_runtime_1.jsx)(components_1.Input, { id: "lastName", label: t(PageText.Contact.input.lastName.label), type: "text", autoComplete: "family-name", name: "lastName", isRequired: true, value: state.context.lastName || '', errorMessage: state.context?.errorMessages['lastName']?.[0], onChange: (e) => send({
|
|
44
45
|
type: 'ON_INPUT_CHANGE',
|
|
45
46
|
inputName: 'lastName',
|
|
46
47
|
value: e.target.value,
|
|
47
|
-
}) }), (0, jsx_runtime_1.jsx)(components_1.Input, { id: "email", label: t(
|
|
48
|
+
}) }), (0, jsx_runtime_1.jsx)(components_1.Input, { id: "email", label: t(PageText.Contact.input.email.label), type: "email", autoComplete: "email", name: "email", isRequired: true, value: state.context.email || '', errorMessage: state.context?.errorMessages['email']?.[0], onChange: (e) => send({
|
|
48
49
|
type: 'ON_INPUT_CHANGE',
|
|
49
50
|
inputName: 'email',
|
|
50
51
|
value: e.target.value,
|
|
51
|
-
}) }), (0, jsx_runtime_1.jsx)(components_1.Input, { id: "phoneNumber", label: t(
|
|
52
|
+
}) }), (0, jsx_runtime_1.jsx)(components_1.Input, { id: "phoneNumber", label: t(PageText.Contact.input.phoneNumber.label), type: "tel", autoComplete: "tel", name: "phoneNumber", isRequired: true, value: state.context.phoneNumber || '', errorMessage: state.context?.errorMessages['phoneNumber']?.[0], onChange: (e) => send({
|
|
52
53
|
type: 'ON_INPUT_CHANGE',
|
|
53
54
|
inputName: 'phoneNumber',
|
|
54
55
|
value: e.target.value,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ticketing/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ticketing/index.tsx"],"names":[],"mappings":"AAmBA,QAAA,MAAM,gBAAgB,+CAqHrB,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
|
package/lib/ticketing/index.js
CHANGED
|
@@ -8,6 +8,7 @@ const contact_module_css_1 = __importDefault(require("../contact.module.css"));
|
|
|
8
8
|
const react_1 = require("@xstate/react");
|
|
9
9
|
const react_2 = require("react");
|
|
10
10
|
const ticketingStateMachine_1 = require("./ticketingStateMachine");
|
|
11
|
+
const url_form_type_1 = require("../url-form-type");
|
|
11
12
|
const components_1 = require("../components");
|
|
12
13
|
const priceAndTicketTypesForm_1 = __importDefault(require("./forms/priceAndTicketTypesForm"));
|
|
13
14
|
const app_1 = __importDefault(require("./forms/app"));
|
|
@@ -19,6 +20,7 @@ const button_1 = require("../components/button");
|
|
|
19
20
|
const config_1 = require("../modules/config");
|
|
20
21
|
const error_message_1 = __importDefault(require("../components/error-message/error-message"));
|
|
21
22
|
const TicketingContent = () => {
|
|
23
|
+
const PageText = (0, translations_1.usePageText)();
|
|
22
24
|
const { t } = (0, translations_1.useTranslation)();
|
|
23
25
|
const apiConfig = (0, config_1.useApiConfig)();
|
|
24
26
|
const { formSchemaOverrides, layout } = (0, config_1.useContactFormConfig)();
|
|
@@ -40,15 +42,28 @@ const TicketingContent = () => {
|
|
|
40
42
|
return allCategories;
|
|
41
43
|
return allCategories.filter((category) => override.includes(category));
|
|
42
44
|
}, [formSchemaOverrides]);
|
|
45
|
+
const enabledFormCategoriesRef = (0, react_2.useRef)(enabledFormCategories);
|
|
46
|
+
(0, react_2.useEffect)(() => {
|
|
47
|
+
const { type } = (0, url_form_type_1.readFormTypeParam)(enabledFormCategoriesRef.current);
|
|
48
|
+
if (type) {
|
|
49
|
+
send({
|
|
50
|
+
type: 'SELECT_FORM_CATEGORY',
|
|
51
|
+
formCategory: type,
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
}, [send]);
|
|
43
55
|
const onSubmit = async (e) => {
|
|
44
56
|
e.preventDefault();
|
|
45
57
|
send({ type: 'SUBMIT', orderedFormFieldNames: (0, utils_1.findOrderFormFields)(e) });
|
|
46
58
|
};
|
|
47
|
-
const additionalTicketingInfo =
|
|
48
|
-
.additionalTicketingInfo ? ((0, jsx_runtime_1.jsxs)("p", { children: [t(
|
|
49
|
-
return ((0, jsx_runtime_1.jsxs)("form", { onSubmit: onSubmit, className: contact_module_css_1.default.form, children: [(0, jsx_runtime_1.jsxs)(components_1.Fieldset, { title: t(
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
59
|
+
const additionalTicketingInfo = PageText.Contact.ticketing
|
|
60
|
+
.additionalTicketingInfo ? ((0, jsx_runtime_1.jsxs)("p", { children: [t(PageText.Contact.ticketing.additionalTicketingInfo.detail), ' ', (0, jsx_runtime_1.jsx)("a", { href: t(PageText.Contact.ticketing.additionalTicketingInfo.href), children: t(PageText.Contact.ticketing.additionalTicketingInfo.linkText) }), "."] })) : null;
|
|
61
|
+
return ((0, jsx_runtime_1.jsxs)("form", { onSubmit: onSubmit, className: contact_module_css_1.default.form, children: [(0, jsx_runtime_1.jsxs)(components_1.Fieldset, { title: t(PageText.Contact.ticketing.title), children: [(0, jsx_runtime_1.jsx)("ul", { className: contact_module_css_1.default.form_options__list, children: enabledFormCategories.map((formCategory) => ((0, jsx_runtime_1.jsx)("li", { children: (0, jsx_runtime_1.jsx)(components_1.Radio, { label: t(PageText.Contact.ticketing[formCategory].description), checked: state.matches({ editing: formCategory }), onChange: () => {
|
|
62
|
+
(0, url_form_type_1.setFormTypeParam)(formCategory);
|
|
63
|
+
send({
|
|
64
|
+
type: 'SELECT_FORM_CATEGORY',
|
|
65
|
+
formCategory: formCategory,
|
|
66
|
+
});
|
|
67
|
+
} }) }, formCategory))) }), additionalTicketingInfo] }), state.matches({ editing: 'priceAndTicketTypes' }) && ((0, jsx_runtime_1.jsx)(priceAndTicketTypesForm_1.default, { state: state, send: send })), state.matches({ editing: 'app' }) && ((0, jsx_runtime_1.jsx)(app_1.default, { state: state, send: send })), state.matches({ editing: 'webshop' }) && ((0, jsx_runtime_1.jsx)(webshop_1.default, { state: state, send: send })), state.matches({ editing: 'travelCard' }) && ((0, jsx_runtime_1.jsx)(travel_card_1.default, { 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 }))] }));
|
|
53
68
|
};
|
|
54
69
|
exports.default = TicketingContent;
|
|
@@ -72,7 +72,7 @@ export declare function createTicketingStateMachine(onSubmit: (schemaName: FormS
|
|
|
72
72
|
type: "VALIDATE";
|
|
73
73
|
} | {
|
|
74
74
|
type: "ON_INPUT_CHANGE";
|
|
75
|
-
inputName: "address" | "attachments" | "bankAccountNumber" | "city" | "date" | "email" | "firstName" | "feedback" | "IBAN" | "lastName" | "phoneNumber" | "postalCode" | "SWIFT" | "toStop" | "fromStop" | "plannedDepartureTime";
|
|
75
|
+
inputName: "address" | "attachments" | "bankAccountNumber" | "city" | "date" | "email" | "firstName" | "feedback" | "IBAN" | "lastName" | "phoneNumber" | "postalCode" | "SWIFT" | "toStop" | "fromStop" | "plannedDepartureTime" | "tripId";
|
|
76
76
|
value: any;
|
|
77
77
|
} | {
|
|
78
78
|
type: "ON_TRANSPORTMODE_CHANGE";
|
|
@@ -109,6 +109,9 @@ export declare function createTicketingStateMachine(onSubmit: (schemaName: FormS
|
|
|
109
109
|
logic: import("xstate").PromiseActorLogic<true, SubmitInput, import("xstate").EventObject>;
|
|
110
110
|
id: string | undefined;
|
|
111
111
|
}, {
|
|
112
|
+
type: "onInputChange";
|
|
113
|
+
params: unknown;
|
|
114
|
+
} | {
|
|
112
115
|
type: "navigateToErrorPage";
|
|
113
116
|
params: unknown;
|
|
114
117
|
} | {
|
|
@@ -132,9 +135,6 @@ export declare function createTicketingStateMachine(onSubmit: (schemaName: FormS
|
|
|
132
135
|
} | {
|
|
133
136
|
type: "clearSubmissionError";
|
|
134
137
|
params: unknown;
|
|
135
|
-
} | {
|
|
136
|
-
type: "onInputChange";
|
|
137
|
-
params: unknown;
|
|
138
138
|
}, {
|
|
139
139
|
type: "isFormValid";
|
|
140
140
|
params: unknown;
|
|
@@ -173,11 +173,11 @@ export declare function createTicketingStateMachine(onSubmit: (schemaName: FormS
|
|
|
173
173
|
params: unknown;
|
|
174
174
|
}, never, "success" | "formCategoryHandler" | "validating" | "submitting" | "appFormHandler" | "webshopFormHandler" | "travelCardFormHandler" | {
|
|
175
175
|
editing: "priceAndTicketTypes" | "selectFormCategory" | {
|
|
176
|
-
travelCard: "orderTravelCard" | "travelCardQuestion" | "selectTravelCardForm";
|
|
177
|
-
} | {
|
|
178
176
|
webshop: "webshopTicketing" | "webshopAccount" | "selectWebshopForm";
|
|
179
177
|
} | {
|
|
180
178
|
app: "appTicketing" | "appTravelSuggestion" | "appAccount" | "selectAppForm";
|
|
179
|
+
} | {
|
|
180
|
+
travelCard: "orderTravelCard" | "travelCardQuestion" | "selectTravelCardForm";
|
|
181
181
|
};
|
|
182
182
|
}, string, import("xstate").NonReducibleUnknown, import("xstate").NonReducibleUnknown, import("xstate").EventObject, import("xstate").MetaObject, {
|
|
183
183
|
id: "ticketingStateMachine";
|
|
@@ -255,7 +255,7 @@ export declare const ticketingStateMachine: import("xstate").StateMachine<Ticket
|
|
|
255
255
|
type: "VALIDATE";
|
|
256
256
|
} | {
|
|
257
257
|
type: "ON_INPUT_CHANGE";
|
|
258
|
-
inputName: "address" | "attachments" | "bankAccountNumber" | "city" | "date" | "email" | "firstName" | "feedback" | "IBAN" | "lastName" | "phoneNumber" | "postalCode" | "SWIFT" | "toStop" | "fromStop" | "plannedDepartureTime";
|
|
258
|
+
inputName: "address" | "attachments" | "bankAccountNumber" | "city" | "date" | "email" | "firstName" | "feedback" | "IBAN" | "lastName" | "phoneNumber" | "postalCode" | "SWIFT" | "toStop" | "fromStop" | "plannedDepartureTime" | "tripId";
|
|
259
259
|
value: any;
|
|
260
260
|
} | {
|
|
261
261
|
type: "ON_TRANSPORTMODE_CHANGE";
|
|
@@ -292,6 +292,9 @@ export declare const ticketingStateMachine: import("xstate").StateMachine<Ticket
|
|
|
292
292
|
logic: import("xstate").PromiseActorLogic<true, SubmitInput, import("xstate").EventObject>;
|
|
293
293
|
id: string | undefined;
|
|
294
294
|
}, {
|
|
295
|
+
type: "onInputChange";
|
|
296
|
+
params: unknown;
|
|
297
|
+
} | {
|
|
295
298
|
type: "navigateToErrorPage";
|
|
296
299
|
params: unknown;
|
|
297
300
|
} | {
|
|
@@ -315,9 +318,6 @@ export declare const ticketingStateMachine: import("xstate").StateMachine<Ticket
|
|
|
315
318
|
} | {
|
|
316
319
|
type: "clearSubmissionError";
|
|
317
320
|
params: unknown;
|
|
318
|
-
} | {
|
|
319
|
-
type: "onInputChange";
|
|
320
|
-
params: unknown;
|
|
321
321
|
}, {
|
|
322
322
|
type: "isFormValid";
|
|
323
323
|
params: unknown;
|
|
@@ -356,11 +356,11 @@ export declare const ticketingStateMachine: import("xstate").StateMachine<Ticket
|
|
|
356
356
|
params: unknown;
|
|
357
357
|
}, never, "success" | "formCategoryHandler" | "validating" | "submitting" | "appFormHandler" | "webshopFormHandler" | "travelCardFormHandler" | {
|
|
358
358
|
editing: "priceAndTicketTypes" | "selectFormCategory" | {
|
|
359
|
-
travelCard: "orderTravelCard" | "travelCardQuestion" | "selectTravelCardForm";
|
|
360
|
-
} | {
|
|
361
359
|
webshop: "webshopTicketing" | "webshopAccount" | "selectWebshopForm";
|
|
362
360
|
} | {
|
|
363
361
|
app: "appTicketing" | "appTravelSuggestion" | "appAccount" | "selectAppForm";
|
|
362
|
+
} | {
|
|
363
|
+
travelCard: "orderTravelCard" | "travelCardQuestion" | "selectTravelCardForm";
|
|
364
364
|
};
|
|
365
365
|
}, string, import("xstate").NonReducibleUnknown, import("xstate").NonReducibleUnknown, import("xstate").EventObject, import("xstate").MetaObject, {
|
|
366
366
|
id: "ticketingStateMachine";
|
|
@@ -4,7 +4,7 @@ export type { ContactFormTranslationsOverride } from './types';
|
|
|
4
4
|
export { default as AppLanguageProvider, useTranslation, useLanguageSettings, } from './language-context';
|
|
5
5
|
export { getTextForLanguage } from './utils';
|
|
6
6
|
export { jsonToTranslatedString, mergeTranslationOverrides, } from './merge-overrides';
|
|
7
|
-
export { useMergedTranslations } from './translations-context';
|
|
7
|
+
export { useMergedTranslations, usePageText } from './translations-context';
|
|
8
8
|
export { jsonTranslationsToOverride } from './json-to-override';
|
|
9
9
|
export { loadOrgTranslations } from './load-org-translations';
|
|
10
10
|
export type { JsonTranslationObject, JsonTranslationValue, } from './json-to-override';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/translations/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AACrE,OAAO,EACL,QAAQ,EACR,gBAAgB,EAChB,uBAAuB,EACvB,YAAY,EACZ,WAAW,GACZ,MAAM,WAAW,CAAC;AAEnB,YAAY,EAAE,+BAA+B,EAAE,MAAM,SAAS,CAAC;AAE/D,OAAO,EACL,OAAO,IAAI,mBAAmB,EAC9B,cAAc,EACd,mBAAmB,GACpB,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAC7C,OAAO,EACL,sBAAsB,EACtB,yBAAyB,GAC1B,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/translations/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AACrE,OAAO,EACL,QAAQ,EACR,gBAAgB,EAChB,uBAAuB,EACvB,YAAY,EACZ,WAAW,GACZ,MAAM,WAAW,CAAC;AAEnB,YAAY,EAAE,+BAA+B,EAAE,MAAM,SAAS,CAAC;AAE/D,OAAO,EACL,OAAO,IAAI,mBAAmB,EAC9B,cAAc,EACd,mBAAmB,GACpB,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAC7C,OAAO,EACL,sBAAsB,EACtB,yBAAyB,GAC1B,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,qBAAqB,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAC5E,OAAO,EAAE,0BAA0B,EAAE,MAAM,oBAAoB,CAAC;AAChE,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAC9D,YAAY,EACV,qBAAqB,EACrB,oBAAoB,GACrB,MAAM,oBAAoB,CAAC;AAE5B,OAAO,KAAK,UAAU,MAAM,UAAU,CAAC;AACvC,OAAO,KAAK,UAAU,MAAM,UAAU,CAAC;AACvC,OAAO,KAAK,aAAa,MAAM,cAAc,CAAC;AAC9C,OAAO,KAAK,QAAQ,MAAM,SAAS,CAAC"}
|
|
@@ -36,7 +36,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
36
36
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
37
37
|
};
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
-
exports.PageText = exports.ComponentText = exports.ServerText = exports.CommonText = exports.loadOrgTranslations = exports.jsonTranslationsToOverride = exports.useMergedTranslations = exports.mergeTranslationOverrides = exports.jsonToTranslatedString = exports.getTextForLanguage = exports.useLanguageSettings = exports.useTranslation = exports.AppLanguageProvider = exports.translation = exports.appLanguages = exports.DEFAULT_LANGUAGE_STRING = exports.DEFAULT_LANGUAGE = exports.Language = void 0;
|
|
39
|
+
exports.PageText = exports.ComponentText = exports.ServerText = exports.CommonText = exports.loadOrgTranslations = exports.jsonTranslationsToOverride = exports.usePageText = exports.useMergedTranslations = exports.mergeTranslationOverrides = exports.jsonToTranslatedString = exports.getTextForLanguage = exports.useLanguageSettings = exports.useTranslation = exports.AppLanguageProvider = exports.translation = exports.appLanguages = exports.DEFAULT_LANGUAGE_STRING = exports.DEFAULT_LANGUAGE = exports.Language = void 0;
|
|
40
40
|
var commons_1 = require("./commons");
|
|
41
41
|
Object.defineProperty(exports, "Language", { enumerable: true, get: function () { return commons_1.Language; } });
|
|
42
42
|
Object.defineProperty(exports, "DEFAULT_LANGUAGE", { enumerable: true, get: function () { return commons_1.DEFAULT_LANGUAGE; } });
|
|
@@ -54,6 +54,7 @@ Object.defineProperty(exports, "jsonToTranslatedString", { enumerable: true, get
|
|
|
54
54
|
Object.defineProperty(exports, "mergeTranslationOverrides", { enumerable: true, get: function () { return merge_overrides_1.mergeTranslationOverrides; } });
|
|
55
55
|
var translations_context_1 = require("./translations-context");
|
|
56
56
|
Object.defineProperty(exports, "useMergedTranslations", { enumerable: true, get: function () { return translations_context_1.useMergedTranslations; } });
|
|
57
|
+
Object.defineProperty(exports, "usePageText", { enumerable: true, get: function () { return translations_context_1.usePageText; } });
|
|
57
58
|
var json_to_override_1 = require("./json-to-override");
|
|
58
59
|
Object.defineProperty(exports, "jsonTranslationsToOverride", { enumerable: true, get: function () { return json_to_override_1.jsonTranslationsToOverride; } });
|
|
59
60
|
var load_org_translations_1 = require("./load-org-translations");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"merge-overrides.d.ts","sourceRoot":"","sources":["../../src/translations/merge-overrides.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,WAAW,EAAE,MAAM,WAAW,CAAC;AAClD,OAAO,KAAK,EAAE,+BAA+B,EAAE,MAAM,SAAS,CAAC;AAC/D,OAAO,KAAK,QAAQ,MAAM,SAAS,CAAC;AACpC,OAAO,KAAK,aAAa,MAAM,cAAc,CAAC;AAC9C,OAAO,KAAK,UAAU,MAAM,UAAU,CAAC;AACvC,OAAO,KAAK,UAAU,MAAM,UAAU,CAAC;AAEvC;;GAEG;AACH,wBAAgB,sBAAsB,CACpC,IAAI,EAAE;IAAE,EAAE,CAAC,EAAE,MAAM,CAAC;IAAC,EAAE,CAAC,EAAE,MAAM,CAAC;IAAC,EAAE,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,MAAM,GACvD,UAAU,CAAC,OAAO,WAAW,CAAC,GAAG,MAAM,CASzC;
|
|
1
|
+
{"version":3,"file":"merge-overrides.d.ts","sourceRoot":"","sources":["../../src/translations/merge-overrides.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,WAAW,EAAE,MAAM,WAAW,CAAC;AAClD,OAAO,KAAK,EAAE,+BAA+B,EAAE,MAAM,SAAS,CAAC;AAC/D,OAAO,KAAK,QAAQ,MAAM,SAAS,CAAC;AACpC,OAAO,KAAK,aAAa,MAAM,cAAc,CAAC;AAC9C,OAAO,KAAK,UAAU,MAAM,UAAU,CAAC;AACvC,OAAO,KAAK,UAAU,MAAM,UAAU,CAAC;AAEvC;;GAEG;AACH,wBAAgB,sBAAsB,CACpC,IAAI,EAAE;IAAE,EAAE,CAAC,EAAE,MAAM,CAAC;IAAC,EAAE,CAAC,EAAE,MAAM,CAAC;IAAC,EAAE,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,MAAM,GACvD,UAAU,CAAC,OAAO,WAAW,CAAC,GAAG,MAAM,CASzC;AAsFD;;;;GAIG;AACH,wBAAgB,yBAAyB,CACvC,SAAS,EAAE,+BAA+B,GACzC;IACD,QAAQ,EAAE,OAAO,QAAQ,CAAC;IAC1B,aAAa,EAAE,OAAO,aAAa,CAAC;IACpC,UAAU,EAAE,OAAO,UAAU,CAAC;IAC9B,UAAU,EAAE,OAAO,UAAU,CAAC;CAC/B,CAiBA"}
|
|
@@ -73,8 +73,15 @@ function deepMergeTranslations(defaults, overrides) {
|
|
|
73
73
|
(commons_1.Language.Norwegian in defaultValue ||
|
|
74
74
|
commons_1.Language.English in defaultValue ||
|
|
75
75
|
commons_1.Language.Nynorsk in defaultValue)) {
|
|
76
|
-
//
|
|
76
|
+
// If override is already a proper TranslatedString, use it directly
|
|
77
77
|
if (overrideValue &&
|
|
78
|
+
typeof overrideValue === 'object' &&
|
|
79
|
+
(commons_1.Language.Norwegian in overrideValue ||
|
|
80
|
+
commons_1.Language.English in overrideValue ||
|
|
81
|
+
commons_1.Language.Nynorsk in overrideValue)) {
|
|
82
|
+
result[key] = overrideValue;
|
|
83
|
+
}
|
|
84
|
+
else if (overrideValue &&
|
|
78
85
|
typeof overrideValue === 'object' &&
|
|
79
86
|
('no' in overrideValue ||
|
|
80
87
|
'en' in overrideValue ||
|