@mrfylke/contact-form 0.1.33 → 0.1.35
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 +0 -22
- package/lib/commoneEvents.d.ts +1 -1
- package/lib/commoneEvents.d.ts.map +1 -1
- package/lib/components/form/date-selector.d.ts +4 -1
- package/lib/components/form/date-selector.d.ts.map +1 -1
- package/lib/components/form/date-selector.js +2 -2
- package/lib/components/form/form.module.css +0 -74
- package/lib/components/form/input.d.ts +2 -6
- package/lib/components/form/input.d.ts.map +1 -1
- package/lib/components/form/input.js +7 -22
- package/lib/components/form/time-selector.d.ts.map +1 -1
- package/lib/components/form/time-selector.js +1 -1
- package/lib/components/icon/generated-icons.js +8 -8
- package/lib/index.d.ts +1 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/journey-info/journeyInfoStateMachine.d.ts +2 -2
- package/lib/layouts/contact-pages.d.ts.map +1 -1
- package/lib/layouts/contact-pages.js +7 -2
- package/lib/lines/use-lines.d.ts +1 -0
- package/lib/lines/use-lines.d.ts.map +1 -1
- package/lib/lines/use-lines.js +1 -0
- package/lib/lost-property/LostPropertyForm.d.ts +6 -0
- package/lib/lost-property/LostPropertyForm.d.ts.map +1 -1
- package/lib/lost-property/LostPropertyForm.js +54 -12
- package/lib/lost-property/LostPropertyMachine.d.ts +5 -4
- package/lib/lost-property/LostPropertyMachine.d.ts.map +1 -1
- package/lib/lost-property/LostPropertyMachine.js +5 -1
- package/lib/lost-property/index.d.ts.map +1 -1
- package/lib/lost-property/index.js +40 -3
- package/lib/means-of-transport/means-of-transport-form-machine.d.ts +2 -2
- package/lib/modules/api-browser/index.d.ts +1 -1
- package/lib/modules/api-browser/index.d.ts.map +1 -1
- package/lib/modules/api-browser/index.js +5 -1
- package/lib/modules/config/context.d.ts.map +1 -1
- package/lib/modules/config/context.js +1 -4
- package/lib/modules/config/theme-adapter.d.ts.map +1 -1
- package/lib/modules/config/theme-adapter.js +2 -0
- package/lib/modules/config/types.d.ts +33 -4
- package/lib/modules/config/types.d.ts.map +1 -1
- package/lib/modules/transport-mode/utils.d.ts +2 -2
- package/lib/modules/transport-mode/utils.d.ts.map +1 -1
- package/lib/refund/events.d.ts +3 -3
- 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 +9 -2
- package/lib/refund/forms/refund-and-travel-guarantee/pre-purchased-ticket-refund-form/index.d.ts +11 -0
- package/lib/refund/forms/refund-and-travel-guarantee/pre-purchased-ticket-refund-form/index.d.ts.map +1 -0
- package/lib/refund/forms/refund-and-travel-guarantee/pre-purchased-ticket-refund-form/index.js +159 -0
- package/lib/refund/forms/refund-and-travel-guarantee/pre-purchased-ticket-refund-form/pre-purchased-ticket-refund-form.module.css +73 -0
- package/lib/refund/forms/refund-and-travel-guarantee/refundCarForm.d.ts.map +1 -1
- package/lib/refund/forms/refund-and-travel-guarantee/refundCarForm.js +2 -2
- package/lib/refund/forms/refund-and-travel-guarantee/refundTaxiForm.d.ts.map +1 -1
- package/lib/refund/forms/refund-and-travel-guarantee/refundTaxiForm.js +2 -2
- package/lib/refund/forms/refund-ticket/appTicketRefund.d.ts.map +1 -1
- package/lib/refund/forms/refund-ticket/appTicketRefund.js +2 -7
- package/lib/refund/forms/refund-ticket/otherTicketRefund.d.ts.map +1 -1
- package/lib/refund/forms/refund-ticket/otherTicketRefund.js +4 -10
- package/lib/refund/refundFormMachine.d.ts +38 -7
- package/lib/refund/refundFormMachine.d.ts.map +1 -1
- package/lib/refund/refundFormMachine.js +46 -0
- package/lib/server/journey-planner/entur-client.d.ts +2 -1
- package/lib/server/journey-planner/entur-client.d.ts.map +1 -1
- package/lib/ticket-control/forms/feeComplaintForm.js +4 -10
- package/lib/ticket-control/forms/postponePayment.d.ts.map +1 -1
- package/lib/ticket-control/forms/postponePayment.js +2 -6
- package/lib/ticket-control/ticket-control-form-machine.d.ts +2 -2
- package/lib/ticketing/forms/app/appAccountForm.d.ts.map +1 -1
- package/lib/ticketing/forms/app/appAccountForm.js +1 -3
- package/lib/ticketing/forms/app/appTicketingForm.d.ts.map +1 -1
- package/lib/ticketing/forms/app/appTicketingForm.js +2 -8
- package/lib/ticketing/forms/travel-card/travelCardQuestionForm.d.ts.map +1 -1
- package/lib/ticketing/forms/travel-card/travelCardQuestionForm.js +5 -8
- package/lib/ticketing/forms/webshop/webshopAccountForm.d.ts.map +1 -1
- package/lib/ticketing/forms/webshop/webshopAccountForm.js +1 -3
- package/lib/ticketing/forms/webshop/webshopTicketingForm.d.ts.map +1 -1
- package/lib/ticketing/forms/webshop/webshopTicketingForm.js +2 -7
- package/lib/ticketing/ticketingStateMachine.d.ts +2 -2
- package/lib/translations/commons.d.ts +1 -1
- package/lib/translations/commons.d.ts.map +1 -1
- package/lib/translations/commons.js +3 -1
- package/lib/translations/language-context.js +1 -1
- package/lib/translations/pages/contact.d.ts +31 -9
- package/lib/translations/pages/contact.d.ts.map +1 -1
- package/lib/translations/pages/contact.js +36 -18
- package/lib/translations/translations-context.d.ts +11 -4
- package/lib/translations/translations-context.d.ts.map +1 -1
- package/lib/translations/translations-context.js +18 -11
- package/lib/types/submit-payloads.d.ts +12 -0
- package/lib/types/submit-payloads.d.ts.map +1 -1
- package/lib/utils/rich-text.d.ts +2 -2
- package/lib/utils/rich-text.js +8 -3
- package/lib/utils.d.ts +56 -3
- package/lib/utils.d.ts.map +1 -1
- package/lib/validation/commonInputValidator.d.ts +1 -1
- package/lib/validation/commonInputValidator.d.ts.map +1 -1
- package/lib/validation/commonInputValidator.js +3 -3
- package/lib/validation/validationRules.d.ts +2 -0
- package/lib/validation/validationRules.d.ts.map +1 -1
- package/lib/validation/validationRules.js +26 -1
- package/package.json +14 -8
- package/lib/components/form/description-modal.d.ts +0 -13
- package/lib/components/form/description-modal.d.ts.map +0 -1
- package/lib/components/form/description-modal.js +0 -44
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/lost-property/index.tsx"],"names":[],"mappings":"AAaA,MAAM,CAAC,OAAO,UAAU,mBAAmB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/lost-property/index.tsx"],"names":[],"mappings":"AAaA,MAAM,CAAC,OAAO,UAAU,mBAAmB,gCAqD1C"}
|
|
@@ -1,5 +1,38 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
"use strict";
|
|
3
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4
|
+
if (k2 === undefined) k2 = k;
|
|
5
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
8
|
+
}
|
|
9
|
+
Object.defineProperty(o, k2, desc);
|
|
10
|
+
}) : (function(o, m, k, k2) {
|
|
11
|
+
if (k2 === undefined) k2 = k;
|
|
12
|
+
o[k2] = m[k];
|
|
13
|
+
}));
|
|
14
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
15
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
16
|
+
}) : function(o, v) {
|
|
17
|
+
o["default"] = v;
|
|
18
|
+
});
|
|
19
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
20
|
+
var ownKeys = function(o) {
|
|
21
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
22
|
+
var ar = [];
|
|
23
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
24
|
+
return ar;
|
|
25
|
+
};
|
|
26
|
+
return ownKeys(o);
|
|
27
|
+
};
|
|
28
|
+
return function (mod) {
|
|
29
|
+
if (mod && mod.__esModule) return mod;
|
|
30
|
+
var result = {};
|
|
31
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
32
|
+
__setModuleDefault(result, mod);
|
|
33
|
+
return result;
|
|
34
|
+
};
|
|
35
|
+
})();
|
|
3
36
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
4
37
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
5
38
|
};
|
|
@@ -12,24 +45,28 @@ const translations_1 = require("../translations");
|
|
|
12
45
|
const config_1 = require("../modules/config");
|
|
13
46
|
const button_1 = require("../components/button");
|
|
14
47
|
const error_message_1 = __importDefault(require("../components/error-message/error-message"));
|
|
15
|
-
const components_1 = require("../components");
|
|
16
48
|
const utils_1 = require("../utils");
|
|
17
49
|
const LostPropertyMachine_1 = require("./LostPropertyMachine");
|
|
18
|
-
const
|
|
50
|
+
const contact_module_css_1 = __importDefault(require("../contact.module.css"));
|
|
51
|
+
const LostPropertyForm_1 = __importStar(require("./LostPropertyForm"));
|
|
19
52
|
function LostPropertyContent() {
|
|
20
53
|
const PageText = (0, translations_1.usePageText)();
|
|
21
54
|
const { t } = (0, translations_1.useTranslation)();
|
|
22
55
|
const apiConfig = (0, config_1.useApiConfig)();
|
|
23
56
|
const { layout } = (0, config_1.useContactFormConfig)();
|
|
57
|
+
const modes = (0, LostPropertyForm_1.useLostPropertyModes)();
|
|
24
58
|
const successPath = layout?.successPath ??
|
|
25
59
|
(layout?.basePath ? `${layout.basePath}/success` : '/contact/success');
|
|
26
60
|
const errorPath = layout?.errorPath ??
|
|
27
61
|
(layout?.basePath ? `${layout.basePath}/error` : '/contact/error');
|
|
28
62
|
const machine = (0, react_2.useMemo)(() => (0, LostPropertyMachine_1.createLostPropertyMachine)(apiConfig.onSubmit, { successPath, errorPath }), [apiConfig.onSubmit, successPath, errorPath]);
|
|
29
63
|
const [state, send] = (0, react_1.useMachine)(machine);
|
|
64
|
+
const showForm = !!modes.find((mode) => mode.id === state.context.transportMode)?.lines;
|
|
30
65
|
const onSubmit = (e) => {
|
|
31
66
|
e.preventDefault();
|
|
67
|
+
if (!showForm)
|
|
68
|
+
return;
|
|
32
69
|
send({ type: 'SUBMIT', orderedFormFieldNames: (0, utils_1.findOrderFormFields)(e) });
|
|
33
70
|
};
|
|
34
|
-
return ((0, jsx_runtime_1.
|
|
71
|
+
return ((0, jsx_runtime_1.jsxs)("form", { onSubmit: onSubmit, className: contact_module_css_1.default.form, children: [(0, jsx_runtime_1.jsx)(LostPropertyForm_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" })), showForm && ((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 }))] }));
|
|
35
72
|
}
|
|
@@ -58,7 +58,7 @@ export declare function createMeansOfTransportFormMachine(onSubmit: (slug: FormS
|
|
|
58
58
|
} | {
|
|
59
59
|
type: "ON_INPUT_CHANGE";
|
|
60
60
|
inputName: "address" | "attachments" | "bankAccountNumber" | "city" | "date" | "email" | "firstName" | "feedback" | "IBAN" | "lastName" | "phoneNumber" | "postalCode" | "SWIFT" | "toStop" | "fromStop" | "plannedDepartureTime" | "tripId";
|
|
61
|
-
value:
|
|
61
|
+
value: unknown;
|
|
62
62
|
} | {
|
|
63
63
|
type: "ON_TRANSPORTMODE_CHANGE";
|
|
64
64
|
value: TransportModeType;
|
|
@@ -177,7 +177,7 @@ export declare const meansOfTransportFormMachine: import("xstate").StateMachine<
|
|
|
177
177
|
} | {
|
|
178
178
|
type: "ON_INPUT_CHANGE";
|
|
179
179
|
inputName: "address" | "attachments" | "bankAccountNumber" | "city" | "date" | "email" | "firstName" | "feedback" | "IBAN" | "lastName" | "phoneNumber" | "postalCode" | "SWIFT" | "toStop" | "fromStop" | "plannedDepartureTime" | "tripId";
|
|
180
|
-
value:
|
|
180
|
+
value: unknown;
|
|
181
181
|
} | {
|
|
182
182
|
type: "ON_TRANSPORTMODE_CHANGE";
|
|
183
183
|
value: TransportModeType;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { TranslatedString } from '../../translations';
|
|
2
|
-
export declare const swrFetcher: (url: string) => Promise<
|
|
2
|
+
export declare const swrFetcher: <T>(url: string) => Promise<T>;
|
|
3
3
|
export declare class ClientTranslatedError extends Error {
|
|
4
4
|
translatedString: TranslatedString;
|
|
5
5
|
statusCode: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/modules/api-browser/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/modules/api-browser/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAGlE,eAAO,MAAM,UAAU,GAAU,CAAC,EAAE,KAAK,MAAM,eAG9C,CAAC;AAwBF,qBAAa,qBAAsB,SAAQ,KAAK;IAC9C,gBAAgB,EAAE,gBAAgB,CAAC;IACnC,UAAU,EAAE,MAAM,CAAC;gBAEP,gBAAgB,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM;CAMnE"}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ClientTranslatedError = exports.swrFetcher = void 0;
|
|
4
4
|
const translations_1 = require("../../translations");
|
|
5
|
+
const commons_1 = require("../../translations/commons");
|
|
5
6
|
const swrFetcher = async (url) => {
|
|
6
7
|
const res = await fetch(url);
|
|
7
8
|
return fetchErrorHandler(res);
|
|
@@ -16,7 +17,10 @@ async function fetchErrorHandler(res) {
|
|
|
16
17
|
return (await res.json());
|
|
17
18
|
}
|
|
18
19
|
function isMessagedResponse(res) {
|
|
19
|
-
return '
|
|
20
|
+
return (typeof res === 'object' &&
|
|
21
|
+
res !== null &&
|
|
22
|
+
'message' in res &&
|
|
23
|
+
(0, commons_1.isTranslatedString)(res.message));
|
|
20
24
|
}
|
|
21
25
|
class ClientTranslatedError extends Error {
|
|
22
26
|
constructor(translatedString, statusCode) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../../src/modules/config/context.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,
|
|
1
|
+
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../../src/modules/config/context.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAe,KAAK,EAAE,MAAM,SAAS,CAAC;AAGrE;;;GAGG;AACH,eAAO,MAAM,wBAAwB,mDAEpC,CAAC;AAEF,wBAAgB,yBAAyB,CACvC,MAAM,EAAE,iBAAiB,GACxB,iBAAiB,CAKnB;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,IAAI,iBAAiB,CASxD;AAED;;;GAGG;AACH,wBAAgB,cAAc,UAG7B;AA6BD;;GAEG;AACH,wBAAgB,YAAY;;;aAYgvD,CAAC;kBAA+U,CAAC;cAAoB,CAAC;;EADjnE"}
|
|
@@ -45,10 +45,7 @@ function mergeThemeWithOverrides(base, overrides) {
|
|
|
45
45
|
// Shallow clone so we don't mutate the incoming theme object.
|
|
46
46
|
const result = { ...base };
|
|
47
47
|
function apply(target, source) {
|
|
48
|
-
|
|
49
|
-
return;
|
|
50
|
-
Object.keys(source).forEach((key) => {
|
|
51
|
-
const srcVal = source[key];
|
|
48
|
+
Object.entries(source).forEach(([key, srcVal]) => {
|
|
52
49
|
if (srcVal && typeof srcVal === 'object' && !Array.isArray(srcVal)) {
|
|
53
50
|
const current = target[key] ?? {};
|
|
54
51
|
target[key] = { ...current };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"theme-adapter.d.ts","sourceRoot":"","sources":["../../../src/modules/config/theme-adapter.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,KAAK,IAAI,gBAAgB,EAAe,MAAM,SAAS,CAAC;AAuBtE;;;;;;;;;;;;GAYG;
|
|
1
|
+
{"version":3,"file":"theme-adapter.d.ts","sourceRoot":"","sources":["../../../src/modules/config/theme-adapter.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,KAAK,IAAI,gBAAgB,EAAe,MAAM,SAAS,CAAC;AAuBtE;;;;;;;;;;;;GAYG;AAEH,wBAAgB,aAAa,CAAC,QAAQ,EAAE,GAAG,GAAG,gBAAgB,CAK7D"}
|
|
@@ -28,12 +28,14 @@ function adaptSpacer(spacing) {
|
|
|
28
28
|
* const contactFormTheme = adaptAtbTheme(atbThemes);
|
|
29
29
|
* ```
|
|
30
30
|
*/
|
|
31
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- accepts any @atb-as/theme version shape
|
|
31
32
|
function adaptAtbTheme(atbTheme) {
|
|
32
33
|
return {
|
|
33
34
|
light: adaptThemeColors(atbTheme.light),
|
|
34
35
|
dark: adaptThemeColors(atbTheme.dark),
|
|
35
36
|
};
|
|
36
37
|
}
|
|
38
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- accepts any @atb-as/theme version shape
|
|
37
39
|
function adaptThemeColors(themeVariant) {
|
|
38
40
|
const ds = themeVariant.color.interactive;
|
|
39
41
|
// Map design-system interactive (0, 1, 2, destructive) to contact-form shape (primary, secondary, destructive).
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import React, { ComponentType } from 'react';
|
|
6
6
|
import type { Line } from '../../server/journey-planner/validators';
|
|
7
|
-
import type { ContactFormTranslationsOverride, TranslatedString } from '../../translations';
|
|
7
|
+
import type { ContactFormTranslationsOverride, RichTranslatedString, TranslatedString } from '../../translations';
|
|
8
8
|
import type { PurchasePlatformType, TransportModeType } from '../../types';
|
|
9
9
|
import type { MonoIcons } from '../../components/icon';
|
|
10
10
|
import type { AssertExtends, CheckNoConflicts } from '../../utils/typing';
|
|
@@ -150,10 +150,9 @@ export type ThemeColors = {
|
|
|
150
150
|
export type TextColorType = 'light' | 'dark';
|
|
151
151
|
/**
|
|
152
152
|
* Slugs of the pages that submit through the shared onSubmit(slug, state)
|
|
153
|
-
* contract.
|
|
154
|
-
* (e.g. 'group-travel', 'lost-property-external').
|
|
153
|
+
* contract. Allows any string, but with autocomplete for default submitting pages.
|
|
155
154
|
*/
|
|
156
|
-
export type FormSlug = 'ticket-control' | 'refund' | 'means-of-transport' | 'ticketing' | 'journey-info' | 'lost-property';
|
|
155
|
+
export type FormSlug = 'ticket-control' | 'refund' | 'means-of-transport' | 'ticketing' | 'journey-info' | 'lost-property' | (string & {});
|
|
157
156
|
/**
|
|
158
157
|
* API configuration
|
|
159
158
|
*/
|
|
@@ -289,7 +288,31 @@ export type FormSchemaOverrides = {
|
|
|
289
288
|
ticketing?: {
|
|
290
289
|
enabledFormCategories?: string[];
|
|
291
290
|
};
|
|
291
|
+
lostProperty?: {
|
|
292
|
+
/**
|
|
293
|
+
* Modes offered in the lost property form's transport mode dropdown, in
|
|
294
|
+
* display order. Default: the global `transportModes`, all with the full
|
|
295
|
+
* form.
|
|
296
|
+
*/
|
|
297
|
+
modes?: LostPropertyMode[];
|
|
298
|
+
};
|
|
292
299
|
};
|
|
300
|
+
/**
|
|
301
|
+
* A host-defined option in the lost property form's transport mode dropdown.
|
|
302
|
+
* `id` is submitted as `transportMode`.
|
|
303
|
+
*/
|
|
304
|
+
export type LostPropertyMode = {
|
|
305
|
+
id: string;
|
|
306
|
+
label: TranslatedString;
|
|
307
|
+
} & ({
|
|
308
|
+
/** Shows the full form, with lines filtered by this predicate. */
|
|
309
|
+
lines: (line: Line) => boolean;
|
|
310
|
+
info?: never;
|
|
311
|
+
} | {
|
|
312
|
+
/** Shows this text instead of the form, with no submit button. */
|
|
313
|
+
info: RichTranslatedString;
|
|
314
|
+
lines?: never;
|
|
315
|
+
});
|
|
293
316
|
/**
|
|
294
317
|
* Main configuration object for the contact form
|
|
295
318
|
*/
|
|
@@ -399,6 +422,12 @@ export type ContactFormConfig = {
|
|
|
399
422
|
* When false, only the Norwegian bank account number field is shown and validated.
|
|
400
423
|
*/
|
|
401
424
|
enableInternationalBankAccountInTravelGuarantee?: boolean;
|
|
425
|
+
/**
|
|
426
|
+
* Show the "refund of pre-purchased ticket" (express boat) form under travel
|
|
427
|
+
* guarantee.
|
|
428
|
+
* Default: false.
|
|
429
|
+
*/
|
|
430
|
+
enablePrePurchasedTicketRefundInTravelGuarantee?: boolean;
|
|
402
431
|
};
|
|
403
432
|
/**
|
|
404
433
|
* Transport modes offered in dropdowns and used to filter lines, in
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/modules/config/types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAC7C,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,KAAK,EACV,+BAA+B,EAC/B,gBAAgB,EACjB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,KAAK,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAC3E,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,KAAK,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAE1E,MAAM,MAAM,WAAW,GAAG;IACxB,sFAAsF;IACtF,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,gBAAgB,CAAC;IACxB,qLAAqL;IACrL,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,SAAS,CAAC;IAChB,6CAA6C;IAC7C,SAAS,EAAE,aAAa,CAAC;CAC1B,CAAC;AAEF;;;;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OAAO,CAAC;QACvD;;;;WAIG;QACH,6BAA6B,CAAC,EAAE,OAAO,CAAC;QACxC;;;WAGG;QACH,0CAA0C,CAAC,EAAE,OAAO,CAAC;QACrD;;;;WAIG;QACH,kDAAkD,CAAC,EAAE,OAAO,CAAC;QAC7D;;;;WAIG;QACH,iDAAiD,CAAC,EAAE,OAAO,CAAC;QAC5D;;;;WAIG;QACH,+CAA+C,CAAC,EAAE,OAAO,CAAC;QAC1D;;;;WAIG;QACH,+CAA+C,CAAC,EAAE,OAAO,CAAC;KAC3D,CAAC;IAEF;;;;OAIG;IACH,cAAc,CAAC,EAAE,iBAAiB,EAAE,CAAC;IAErC,uDAAuD;IACvD,WAAW,CAAC,EAAE,gBAAgB,CAAC;IAE/B,gFAAgF;IAChF,MAAM,CAAC,EAAE,YAAY,CAAC;IAEtB;;;;OAIG;IACH,YAAY,CAAC,EAAE,+BAA+B,CAAC;IAE/C;;;OAGG;IACH,KAAK,EAAE,WAAW,CAAC;IAEnB;;;;OAIG;IACH,mBAAmB,CAAC,EAAE,mBAAmB,CAAC;CAC3C,CAAC;AAEF;;;GAGG;AACH,MAAM,MAAM,WAAW,CAAC,CAAC,IAAI;KAC1B,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,SAAS,MAAM,GAAG,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAChE,CAAC"}
|
|
@@ -2,8 +2,8 @@ import { TransportModeGroup, TransportModeType, TransportSubmodeType } from './t
|
|
|
2
2
|
import { TransportMode as GraphQlTransportMode } from '../../modules/graphql-types';
|
|
3
3
|
export declare function transportModeToTranslatedString(mode: TransportModeGroup): import("../..").TranslatedString;
|
|
4
4
|
export declare function severalTransportModesToTranslatedStrings(modes: TransportModeGroup[]): import("../..").TranslatedString[];
|
|
5
|
-
export declare function isTransportModeType(a:
|
|
6
|
-
export declare function isTransportSubmodeType(a:
|
|
5
|
+
export declare function isTransportModeType(a: unknown): a is TransportModeType;
|
|
6
|
+
export declare function isTransportSubmodeType(a: unknown): a is TransportSubmodeType;
|
|
7
7
|
export declare function filterGraphQlTransportModes(modes: GraphQlTransportMode[] | undefined): TransportModeType[] | undefined;
|
|
8
8
|
export declare function isSubModeBoat(subModes?: TransportSubmodeType[]): boolean;
|
|
9
9
|
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/modules/transport-mode/utils.ts"],"names":[],"mappings":"AACA,OAAO,EACL,kBAAkB,EAElB,iBAAiB,EAEjB,oBAAoB,EACrB,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,aAAa,IAAI,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AAEpF,wBAAgB,+BAA+B,CAAC,IAAI,EAAE,kBAAkB,oCAMvE;AAED,wBAAgB,wCAAwC,CACtD,KAAK,EAAE,kBAAkB,EAAE,sCAK5B;AAED,wBAAgB,mBAAmB,CAAC,CAAC,EAAE,
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/modules/transport-mode/utils.ts"],"names":[],"mappings":"AACA,OAAO,EACL,kBAAkB,EAElB,iBAAiB,EAEjB,oBAAoB,EACrB,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,aAAa,IAAI,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AAEpF,wBAAgB,+BAA+B,CAAC,IAAI,EAAE,kBAAkB,oCAMvE;AAED,wBAAgB,wCAAwC,CACtD,KAAK,EAAE,kBAAkB,EAAE,sCAK5B;AAED,wBAAgB,mBAAmB,CAAC,CAAC,EAAE,OAAO,GAAG,CAAC,IAAI,iBAAiB,CAEtE;AAED,wBAAgB,sBAAsB,CAAC,CAAC,EAAE,OAAO,GAAG,CAAC,IAAI,oBAAoB,CAE5E;AAED,wBAAgB,2BAA2B,CACzC,KAAK,EAAE,oBAAoB,EAAE,GAAG,SAAS,GACxC,iBAAiB,EAAE,GAAG,SAAS,CAQjC;AAUD,wBAAgB,aAAa,CAAC,QAAQ,CAAC,EAAE,oBAAoB,EAAE,WAG9D"}
|
package/lib/refund/events.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { FormCategory, RefundAndTravelGuarantee, RefundTicketForm } from './refundFormMachine';
|
|
1
|
+
import { FormCategory, DelayedDeparture, RefundAndTravelGuarantee, RefundTicketForm } from './refundFormMachine';
|
|
2
2
|
import { PurchasePlatformType, ReasonForTransportFailure, TicketType, TransportModeType } from '../types';
|
|
3
3
|
import { Line } from '..';
|
|
4
4
|
type RefundSpecificFormEvents = {
|
|
5
5
|
type: 'ON_INPUT_CHANGE';
|
|
6
|
-
inputName: 'formType' | 'kilometersDriven' | 'fromAddress' | 'toAddress' | 'amount' | 'reasonForTransportFailure' | 'orderId' | 'customerNumber' | 'ticketType' | 'travelCardNumber' | 'refundReason' | 'firstName' | 'lastName' | 'address' | 'postalCode' | 'city' | 'email' | 'phoneNumber' | 'bankAccountNumber' | 'IBAN' | 'SWIFT' | 'fromStop' | 'toStop' | 'date' | 'plannedDepartureTime' | 'tripId' | 'feedback' | 'attachments' | 'receiptAttachments' | 'identificationAttachments' | 'feedbackAttachments' | 'isInitialAgreementChecked' | 'hasInternationalBankAccount' | 'showInputTravelCardNumber' | 'bankCardDetails';
|
|
7
|
-
value: string | boolean | ReasonForTransportFailure | TicketType | Line['quays'][0] | File[] | undefined;
|
|
6
|
+
inputName: 'formType' | 'kilometersDriven' | 'fromAddress' | 'toAddress' | 'amount' | 'reasonForTransportFailure' | 'orderId' | 'customerNumber' | 'ticketType' | 'travelCardNumber' | 'refundReason' | 'firstName' | 'lastName' | 'address' | 'postalCode' | 'city' | 'email' | 'phoneNumber' | 'bankAccountNumber' | 'IBAN' | 'SWIFT' | 'fromStop' | 'toStop' | 'date' | 'plannedDepartureTime' | 'tripId' | 'feedback' | 'attachments' | 'receiptAttachments' | 'identificationAttachments' | 'feedbackAttachments' | 'isInitialAgreementChecked' | 'hasInternationalBankAccount' | 'showInputTravelCardNumber' | 'bankCardDetails' | 'prePurchasedTicketDelayedDepartures';
|
|
7
|
+
value: string | boolean | ReasonForTransportFailure | TicketType | Line['quays'][0] | File[] | DelayedDeparture[] | undefined;
|
|
8
8
|
} | {
|
|
9
9
|
type: 'SELECT_FORM_CATEGORY';
|
|
10
10
|
formCategory: FormCategory;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../src/refund/events.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EACZ,wBAAwB,EACxB,gBAAgB,EACjB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,oBAAoB,EACpB,yBAAyB,EACzB,UAAU,EACV,iBAAiB,EAClB,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,IAAI,EAAE,MAAM,IAAI,CAAC;AAE1B,KAAK,wBAAwB,GACzB;IACE,IAAI,EAAE,iBAAiB,CAAC;IACxB,SAAS,EACL,UAAU,GACV,kBAAkB,GAClB,aAAa,GACb,WAAW,GACX,QAAQ,GACR,2BAA2B,GAC3B,SAAS,GACT,gBAAgB,GAChB,YAAY,GACZ,kBAAkB,GAClB,cAAc,GACd,WAAW,GACX,UAAU,GACV,SAAS,GACT,YAAY,GACZ,MAAM,GACN,OAAO,GACP,aAAa,GACb,mBAAmB,GACnB,MAAM,GACN,OAAO,GACP,UAAU,GACV,QAAQ,GACR,MAAM,GACN,sBAAsB,GACtB,QAAQ,GACR,UAAU,GACV,aAAa,GACb,oBAAoB,GACpB,2BAA2B,GAC3B,qBAAqB,GACrB,2BAA2B,GAC3B,6BAA6B,GAC7B,2BAA2B,GAC3B,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../src/refund/events.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EACZ,gBAAgB,EAChB,wB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,EAAE,IAAI,GAAG,SAAS,CAAC;CACzB,GACD;IACE,IAAI,EAAE,6BAA6B,CAAC;IACpC,KAAK,EAAE,oBAAoB,GAAG,SAAS,CAAC;CACzC,GACD;IACE,IAAI,EAAE,QAAQ,CAAC;IACf,qBAAqB,EAAE,MAAM,EAAE,CAAC;CACjC,CAAC;AAEN,eAAO,MAAM,gBAAgB,EAAS,wBAAwB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/refund/forms/refund-and-travel-guarantee/index.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AACnC,OAAO,EAEL,kBAAkB,EACnB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/refund/forms/refund-and-travel-guarantee/index.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AACnC,OAAO,EAEL,kBAAkB,EACnB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAahD,KAAK,kCAAkC,GAAG;IACxC,KAAK,EAAE,SAAS,CAAC,OAAO,kBAAkB,CAAC,CAAC;IAC5C,IAAI,EAAE,CAAC,KAAK,EAAE,OAAO,gBAAgB,KAAK,IAAI,CAAC;CAChD,CAAC;AAEF,eAAO,MAAM,6BAA6B,GAAI,kBAG3C,kCAAkC,gCAmIpC,CAAC;AAEF,eAAe,6BAA6B,CAAC"}
|
|
@@ -10,6 +10,8 @@ const refundFormMachine_1 = require("../../refundFormMachine");
|
|
|
10
10
|
const link_1 = __importDefault(require("next/link"));
|
|
11
11
|
const refundTaxiForm_1 = __importDefault(require("./refundTaxiForm"));
|
|
12
12
|
const refundCarForm_1 = __importDefault(require("./refundCarForm"));
|
|
13
|
+
const pre_purchased_ticket_refund_form_1 = __importDefault(require("./pre-purchased-ticket-refund-form"));
|
|
14
|
+
const context_1 = require("../../../modules/config/context");
|
|
13
15
|
const translations_1 = require("../../../translations");
|
|
14
16
|
const translations_context_1 = require("../../../translations/translations-context");
|
|
15
17
|
const components_1 = require("../../../components");
|
|
@@ -19,6 +21,9 @@ const utils_1 = require("../../../utils");
|
|
|
19
21
|
const RefundAndTravelGuaranteeForms = ({ state, send, }) => {
|
|
20
22
|
const { t, tRich } = (0, translations_1.useTranslation)();
|
|
21
23
|
const { PageText } = (0, translations_context_1.useMergedTranslations)();
|
|
24
|
+
const { features } = (0, context_1.useContactFormConfig)();
|
|
25
|
+
const refundForms = Object.values(refundFormMachine_1.RefundAndTravelGuarantee).filter((refundForm) => refundForm !== refundFormMachine_1.RefundAndTravelGuarantee.PrePurchasedTicketRefund ||
|
|
26
|
+
features?.enablePrePurchasedTicketRefundInTravelGuarantee === true);
|
|
22
27
|
const travelGuaranteeLinkHref = t(PageText.Contact.refund.agreement.travelGuaranteeExceptions.link.href);
|
|
23
28
|
if (!travelGuaranteeLinkHref) {
|
|
24
29
|
(0, utils_1.warnDevMissingTranslation)('refund.agreement.travelGuaranteeExceptions.link.href');
|
|
@@ -27,17 +32,19 @@ const RefundAndTravelGuaranteeForms = ({ state, send, }) => {
|
|
|
27
32
|
state.context.formType === 'refundTaxi';
|
|
28
33
|
const displayRefundCarForm = state.context.isInitialAgreementChecked &&
|
|
29
34
|
state.context.formType === 'refundCar';
|
|
35
|
+
const displayPrePurchasedTicketRefundForm = state.context.isInitialAgreementChecked &&
|
|
36
|
+
state.context.formType === 'prePurchasedTicketRefund';
|
|
30
37
|
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)(components_1.Fieldset, { title: t(PageText.Contact.refund.agreement.title), children: [(0, jsx_runtime_1.jsx)(typography_1.Typo.p, { textType: "body__m", children: t(PageText.Contact.refund.agreement.delayedRefundText) }), tRich(PageText.Contact.refund.agreement.ticketRefundText), (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)(typography_1.Typo.p, { textType: "heading__m", children: t(PageText.Contact.refund.agreement.travelGuaranteeExceptions.label) }), (0, jsx_runtime_1.jsx)("ul", { className: contact_module_css_1.default.rules__list, children: PageText.Contact.refund.agreement.travelGuaranteeExceptions.exceptions.map((exception, index) => ((0, jsx_runtime_1.jsxs)("li", { children: [(0, jsx_runtime_1.jsx)(typography_1.Typo.p, { textType: "body__m", children: tRich(exception.text) }), exception.examples.length > 0 && ((0, jsx_runtime_1.jsx)("ul", { className: contact_module_css_1.default.rules__list, children: exception.examples.map((example, exampleIndex) => ((0, jsx_runtime_1.jsx)("li", { children: (0, jsx_runtime_1.jsx)(typography_1.Typo.p, { textType: "body__m", children: t(example) }) }, exampleIndex))) }))] }, index))) })] }), (0, jsx_runtime_1.jsxs)(typography_1.Typo.p, { textType: "body__m", children: [t(PageText.Contact.refund.agreement.travelGuaranteeExceptions
|
|
31
38
|
.exclusion), travelGuaranteeLinkHref && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [' ', (0, jsx_runtime_1.jsx)(link_1.default, { href: travelGuaranteeLinkHref, target: "_blank", rel: "noopener noreferrer", children: t(PageText.Contact.refund.agreement.travelGuaranteeExceptions
|
|
32
39
|
.link.text) })] }))] }), (0, jsx_runtime_1.jsx)(checkbox_1.Checkbox, { label: t(PageText.Contact.ticketControl.feeComplaint.firstAgreement.checkbox), checked: state.context.isInitialAgreementChecked, onChange: () => send({
|
|
33
40
|
type: 'ON_INPUT_CHANGE',
|
|
34
41
|
inputName: 'isInitialAgreementChecked',
|
|
35
42
|
value: !state.context.isInitialAgreementChecked,
|
|
36
|
-
}) })] }), state.context.isInitialAgreementChecked && ((0, jsx_runtime_1.jsx)(components_1.Fieldset, { title: t(PageText.Contact.refund.agreement.title), children: (0, jsx_runtime_1.jsx)("ul", { className: contact_module_css_1.default.form_options__list, children:
|
|
43
|
+
}) })] }), state.context.isInitialAgreementChecked && ((0, jsx_runtime_1.jsx)(components_1.Fieldset, { title: t(PageText.Contact.refund.agreement.title), children: (0, jsx_runtime_1.jsx)("ul", { className: contact_module_css_1.default.form_options__list, children: refundForms.map((refundForm) => ((0, jsx_runtime_1.jsx)("li", { children: (0, jsx_runtime_1.jsx)(components_1.Radio, { label: t(PageText.Contact.refund.refundAndTravelGuarantee[refundForm]
|
|
37
44
|
.label), checked: state.context.formType === refundForm, onChange: () => send({
|
|
38
45
|
type: 'SELECT_REFUND_AND_TRAVEL_GUARANTEE_FORM',
|
|
39
46
|
refundAndTravelGuarantee: refundForm,
|
|
40
|
-
}) }) }, refundForm))) }) })), displayRefundTaxiForm && (0, jsx_runtime_1.jsx)(refundTaxiForm_1.default, { state: state, send: send }), displayRefundCarForm && (0, jsx_runtime_1.jsx)(refundCarForm_1.default, { state: state, send: send })] }));
|
|
47
|
+
}) }) }, refundForm))) }) })), displayRefundTaxiForm && (0, jsx_runtime_1.jsx)(refundTaxiForm_1.default, { state: state, send: send }), displayRefundCarForm && (0, jsx_runtime_1.jsx)(refundCarForm_1.default, { state: state, send: send }), displayPrePurchasedTicketRefundForm && ((0, jsx_runtime_1.jsx)(pre_purchased_ticket_refund_form_1.default, { state: state, send: send }))] }));
|
|
41
48
|
};
|
|
42
49
|
exports.RefundAndTravelGuaranteeForms = RefundAndTravelGuaranteeForms;
|
|
43
50
|
exports.default = exports.RefundAndTravelGuaranteeForms;
|
package/lib/refund/forms/refund-and-travel-guarantee/pre-purchased-ticket-refund-form/index.d.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { RefundFormEvents } from '../../../events';
|
|
2
|
+
import { RefundContextProps } from '../../../refundFormMachine';
|
|
3
|
+
type PrePurchasedTicketRefundFormProps = {
|
|
4
|
+
state: {
|
|
5
|
+
context: RefundContextProps;
|
|
6
|
+
};
|
|
7
|
+
send: (event: typeof RefundFormEvents) => void;
|
|
8
|
+
};
|
|
9
|
+
export declare const PrePurchasedTicketRefundForm: ({ state, send, }: PrePurchasedTicketRefundFormProps) => import("react").JSX.Element;
|
|
10
|
+
export default PrePurchasedTicketRefundForm;
|
|
11
|
+
//# sourceMappingURL=index.d.ts.map
|
package/lib/refund/forms/refund-and-travel-guarantee/pre-purchased-ticket-refund-form/index.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/refund/forms/refund-and-travel-guarantee/pre-purchased-ticket-refund-form/index.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACnD,OAAO,EAEL,kBAAkB,EACnB,MAAM,4BAA4B,CAAC;AAoBpC,KAAK,iCAAiC,GAAG;IACvC,KAAK,EAAE;QAAE,OAAO,EAAE,kBAAkB,CAAA;KAAE,CAAC;IACvC,IAAI,EAAE,CAAC,KAAK,EAAE,OAAO,gBAAgB,KAAK,IAAI,CAAC;CAChD,CAAC;AAEF,eAAO,MAAM,4BAA4B,GAAI,kBAG1C,iCAAiC,gCA8enC,CAAC;AAEF,eAAe,4BAA4B,CAAC"}
|
package/lib/refund/forms/refund-and-travel-guarantee/pre-purchased-ticket-refund-form/index.js
ADDED
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.PrePurchasedTicketRefundForm = void 0;
|
|
7
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
+
const react_1 = require("react");
|
|
9
|
+
const date_1 = require("@internationalized/date");
|
|
10
|
+
const react_aria_components_1 = require("react-aria-components");
|
|
11
|
+
const use_lines_1 = require("../../../../lines/use-lines");
|
|
12
|
+
const use_departures_1 = require("../../../../lines/use-departures");
|
|
13
|
+
const components_1 = require("../../../../components");
|
|
14
|
+
const button_1 = require("../../../../components/button");
|
|
15
|
+
const icon_1 = require("../../../../components/icon");
|
|
16
|
+
const typography_1 = require("../../../../components/typography");
|
|
17
|
+
const checkbox_1 = require("../../../../components/checkbox");
|
|
18
|
+
const error_message_1 = require("../../../../components/error-message");
|
|
19
|
+
const pre_purchased_ticket_refund_form_module_css_1 = __importDefault(require("./pre-purchased-ticket-refund-form.module.css"));
|
|
20
|
+
const translations_1 = require("../../../../translations");
|
|
21
|
+
const config_1 = require("../../../../modules/config");
|
|
22
|
+
const PrePurchasedTicketRefundForm = ({ state, send, }) => {
|
|
23
|
+
const { t } = (0, translations_1.useTranslation)();
|
|
24
|
+
const PageText = (0, translations_1.usePageText)();
|
|
25
|
+
const { features } = (0, config_1.useContactFormConfig)();
|
|
26
|
+
const { getLinesByMode, getQuaysByLine } = (0, use_lines_1.useLines)();
|
|
27
|
+
const [draft, setDraft] = (0, react_1.useState)({});
|
|
28
|
+
// Same locale and format as the DateSelector's segments.
|
|
29
|
+
const { locale } = (0, react_aria_components_1.useLocale)();
|
|
30
|
+
const dateFormatter = new date_1.DateFormatter(locale, {
|
|
31
|
+
year: 'numeric',
|
|
32
|
+
month: '2-digit',
|
|
33
|
+
day: '2-digit',
|
|
34
|
+
timeZone: 'Europe/Oslo',
|
|
35
|
+
});
|
|
36
|
+
const departures = state.context.prePurchasedTicketDelayedDepartures ?? [];
|
|
37
|
+
const quayOptions = (0, components_1.getStopOptions)(getQuaysByLine(draft.line?.id ?? ''));
|
|
38
|
+
const texts = PageText.Contact.refund.prePurchasedTicketRefund;
|
|
39
|
+
const delayedDeparturesError = state.context?.errorMessages['prePurchasedTicketDelayedDepartures']?.[0];
|
|
40
|
+
// Claims must be sent within two months; allow from the 1st two months
|
|
41
|
+
// back for some buffer.
|
|
42
|
+
const latestDate = (0, date_1.today)('Europe/Oslo');
|
|
43
|
+
const earliestDate = latestDate.subtract({ months: 2 }).set({ day: 1 });
|
|
44
|
+
const isDraftComplete = !!draft.line &&
|
|
45
|
+
!!draft.fromStop &&
|
|
46
|
+
!!draft.toStop &&
|
|
47
|
+
!!draft.date &&
|
|
48
|
+
draft.date >= earliestDate.toString() &&
|
|
49
|
+
draft.date <= latestDate.toString() &&
|
|
50
|
+
!!draft.plannedDepartureTime;
|
|
51
|
+
const addDraft = () => {
|
|
52
|
+
if (!isDraftComplete)
|
|
53
|
+
return;
|
|
54
|
+
const departure = draft;
|
|
55
|
+
const isDuplicate = departures.some((d) => d.line.id === departure.line.id &&
|
|
56
|
+
d.date === departure.date &&
|
|
57
|
+
d.plannedDepartureTime === departure.plannedDepartureTime &&
|
|
58
|
+
d.fromStop.id === departure.fromStop.id &&
|
|
59
|
+
d.toStop.id === departure.toStop.id);
|
|
60
|
+
if (!isDuplicate) {
|
|
61
|
+
send({
|
|
62
|
+
type: 'ON_INPUT_CHANGE',
|
|
63
|
+
inputName: 'prePurchasedTicketDelayedDepartures',
|
|
64
|
+
// Kept sorted first to last, so the table and payload read in order.
|
|
65
|
+
value: [...departures, departure].sort((a, b) => `${a.date} ${a.plannedDepartureTime}`.localeCompare(`${b.date} ${b.plannedDepartureTime}`)),
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
// Keep line and stops; the next delayed departure is usually the same trip.
|
|
69
|
+
setDraft({
|
|
70
|
+
line: draft.line,
|
|
71
|
+
fromStop: draft.fromStop,
|
|
72
|
+
toStop: draft.toStop,
|
|
73
|
+
});
|
|
74
|
+
};
|
|
75
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)(components_1.Fieldset, { title: t(texts.aboutYourTicket.title), children: [(0, jsx_runtime_1.jsx)(typography_1.Typo.p, { textType: "body__m", children: t(texts.info) }), (0, jsx_runtime_1.jsx)(components_1.Input, { id: "orderId", label: t(PageText.Contact.input.orderId.label(true)), type: "text", name: "orderId", value: state.context.orderId || '', isRequired: true, errorMessage: state.context?.errorMessages['orderId']?.[0], onChange: (e) => send({
|
|
76
|
+
type: 'ON_INPUT_CHANGE',
|
|
77
|
+
inputName: 'orderId',
|
|
78
|
+
value: e.target.value,
|
|
79
|
+
}), description: t(PageText.Contact.input.orderId.description) }), (0, jsx_runtime_1.jsx)(components_1.Textarea, { id: "refundReason", label: t(PageText.Contact.input.refundReason.question), value: state.context.refundReason || '', isRequired: true, onChange: (e) => send({
|
|
80
|
+
type: 'ON_INPUT_CHANGE',
|
|
81
|
+
inputName: 'refundReason',
|
|
82
|
+
value: e.target.value,
|
|
83
|
+
}), error: state.context.errorMessages['refundReason']?.[0]
|
|
84
|
+
? t(state.context.errorMessages['refundReason']?.[0])
|
|
85
|
+
: undefined })] }), (0, jsx_runtime_1.jsxs)(components_1.Fieldset, { title: t(texts.delayedDepartures.title), children: [(0, jsx_runtime_1.jsx)(typography_1.Typo.p, { textType: "body__m", children: t(texts.delayedDepartures.info) }), (0, jsx_runtime_1.jsx)(components_1.SearchableSelect, { id: "delayedDepartureLine", label: t(PageText.Contact.input.line.label), value: draft.line, placeholder: t(PageText.Contact.input.line.optionLabel), options: (0, components_1.getLineOptions)(getLinesByMode('expressboat')), onChange: (value) =>
|
|
86
|
+
// Stops and departures belong to the line; keep only the date.
|
|
87
|
+
setDraft({ line: value, date: draft.date }) }), (0, jsx_runtime_1.jsx)(components_1.SearchableSelect, { id: "delayedDepartureFromStop", label: t(PageText.Contact.input.fromStop.label), value: draft.fromStop, isDisabled: !draft.line, onChange: (value) => setDraft({
|
|
88
|
+
...draft,
|
|
89
|
+
fromStop: value,
|
|
90
|
+
plannedDepartureTime: undefined,
|
|
91
|
+
tripId: undefined,
|
|
92
|
+
}), options: quayOptions, placeholder: t(PageText.Contact.input.fromStop.optionLabel) }), (0, jsx_runtime_1.jsx)(components_1.SearchableSelect, { id: "delayedDepartureToStop", label: t(PageText.Contact.input.toStop.label), value: draft.toStop, isDisabled: !draft.line, onChange: (value) => setDraft({
|
|
93
|
+
...draft,
|
|
94
|
+
toStop: value,
|
|
95
|
+
plannedDepartureTime: undefined,
|
|
96
|
+
tripId: undefined,
|
|
97
|
+
}), options: quayOptions, placeholder: t(PageText.Contact.input.toStop.optionLabel) }), (0, jsx_runtime_1.jsx)(components_1.DateSelector, { id: "delayedDepartureDate", label: t(PageText.Contact.input.date.label), value: draft.date, minValue: earliestDate, maxValue: latestDate, onChange: (date) => setDraft({
|
|
98
|
+
...draft,
|
|
99
|
+
date,
|
|
100
|
+
plannedDepartureTime: undefined,
|
|
101
|
+
tripId: undefined,
|
|
102
|
+
}) }), (0, jsx_runtime_1.jsx)(components_1.DepartureTimeField, { id: "delayedDeparturePlannedDepartureTime", date: draft.date, lineId: draft.line?.id, fromStopId: draft.fromStop?.id, toStopId: draft.toStop?.id, selectedTripId: draft.tripId, plannedDepartureTime: draft.plannedDepartureTime, onChange: (plannedDepartureTime, tripId) => setDraft({ ...draft, plannedDepartureTime, tripId }) }), (0, jsx_runtime_1.jsx)(button_1.Button, { title: t(texts.delayedDepartures.add), mode: "interactive_0--bordered", disabled: !isDraftComplete, onClick: addDraft,
|
|
103
|
+
// `input__` prefix lets a validation error scroll to this field.
|
|
104
|
+
buttonProps: { id: 'input__prePurchasedTicketDelayedDepartures' } }), departures.length > 0 && ((0, jsx_runtime_1.jsxs)("table", { className: pre_purchased_ticket_refund_form_module_css_1.default.departuresTable, children: [(0, jsx_runtime_1.jsx)("thead", { children: (0, jsx_runtime_1.jsxs)("tr", { children: [(0, jsx_runtime_1.jsx)("th", { children: (0, jsx_runtime_1.jsx)(typography_1.Typo.span, { textType: "body__s__strong", children: t(texts.delayedDepartures.columns.line) }) }), (0, jsx_runtime_1.jsx)("th", { children: (0, jsx_runtime_1.jsx)(typography_1.Typo.span, { textType: "body__s__strong", children: t(texts.delayedDepartures.columns.fromStop) }) }), (0, jsx_runtime_1.jsx)("th", { children: (0, jsx_runtime_1.jsx)(typography_1.Typo.span, { textType: "body__s__strong", children: t(texts.delayedDepartures.columns.toStop) }) }), (0, jsx_runtime_1.jsx)("th", { children: (0, jsx_runtime_1.jsx)(typography_1.Typo.span, { textType: "body__s__strong", children: t(texts.delayedDepartures.columns.date) }) }), (0, jsx_runtime_1.jsx)("th", { children: (0, jsx_runtime_1.jsx)(typography_1.Typo.span, { textType: "body__s__strong", children: t(texts.delayedDepartures.columns.time) }) }), (0, jsx_runtime_1.jsx)("th", { className: pre_purchased_ticket_refund_form_module_css_1.default.removeCell, children: (0, jsx_runtime_1.jsx)("span", { className: pre_purchased_ticket_refund_form_module_css_1.default.visuallyHidden, children: t(texts.delayedDepartures.remove) }) })] }) }), (0, jsx_runtime_1.jsx)("tbody", { children: departures.map((d, index) => ((0, jsx_runtime_1.jsxs)("tr", { children: [(0, jsx_runtime_1.jsx)("td", { children: (0, jsx_runtime_1.jsx)(typography_1.Typo.span, { textType: "body__m", children: d.line.publicCode ?? d.line.name }) }), (0, jsx_runtime_1.jsx)("td", { children: (0, jsx_runtime_1.jsx)(typography_1.Typo.span, { textType: "body__m", children: d.fromStop.name }) }), (0, jsx_runtime_1.jsx)("td", { children: (0, jsx_runtime_1.jsx)(typography_1.Typo.span, { textType: "body__m", children: d.toStop.name }) }), (0, jsx_runtime_1.jsx)("td", { children: (0, jsx_runtime_1.jsx)(typography_1.Typo.span, { textType: "body__m", children: dateFormatter.format((0, date_1.parseDate)(d.date).toDate('Europe/Oslo')) }) }), (0, jsx_runtime_1.jsx)("td", { children: (0, jsx_runtime_1.jsx)(typography_1.Typo.span, { textType: "body__m", children: (0, use_departures_1.formatDepartureTime)(d.plannedDepartureTime) }) }), (0, jsx_runtime_1.jsx)("td", { className: pre_purchased_ticket_refund_form_module_css_1.default.removeCell, children: (0, jsx_runtime_1.jsx)(button_1.Button, { mode: "transparent", className: pre_purchased_ticket_refund_form_module_css_1.default.removeButton, title: t(texts.delayedDepartures.removeLabel), icon: { left: (0, jsx_runtime_1.jsx)(icon_1.MonoIcon, { icon: "actions/Delete" }) }, buttonProps: {
|
|
105
|
+
'aria-label': t(texts.delayedDepartures.remove),
|
|
106
|
+
}, onClick: () => send({
|
|
107
|
+
type: 'ON_INPUT_CHANGE',
|
|
108
|
+
inputName: 'prePurchasedTicketDelayedDepartures',
|
|
109
|
+
value: departures.filter((_, i) => i !== index),
|
|
110
|
+
}) }) })] }, index))) })] })), delayedDeparturesError && ((0, jsx_runtime_1.jsx)(error_message_1.ErrorMessage, { message: t(delayedDeparturesError), id: "error-prePurchasedTicketDelayedDepartures" }))] }), (0, jsx_runtime_1.jsxs)(components_1.Fieldset, { title: t(PageText.Contact.aboutYouInfo.title), children: [(0, jsx_runtime_1.jsx)(components_1.Input, { id: "firstName", label: t(PageText.Contact.input.firstName.label), type: "text", autoComplete: "given-name additional-name", name: "firstName", value: state.context.firstName || '', isRequired: true, errorMessage: state.context?.errorMessages['firstName']?.[0], onChange: (e) => send({
|
|
111
|
+
type: 'ON_INPUT_CHANGE',
|
|
112
|
+
inputName: 'firstName',
|
|
113
|
+
value: e.target.value,
|
|
114
|
+
}) }), (0, jsx_runtime_1.jsx)(components_1.Input, { id: "lastName", label: t(PageText.Contact.input.lastName.label), type: "text", autoComplete: "family-name", name: "lastName", value: state.context.lastName || '', isRequired: true, errorMessage: state.context?.errorMessages['lastName']?.[0], onChange: (e) => send({
|
|
115
|
+
type: 'ON_INPUT_CHANGE',
|
|
116
|
+
inputName: 'lastName',
|
|
117
|
+
value: e.target.value,
|
|
118
|
+
}) }), (0, jsx_runtime_1.jsx)(components_1.Input, { id: "address", label: t(PageText.Contact.input.address.label), type: "text", autoComplete: "street-address", name: "address", value: state.context.address || '', isRequired: true, errorMessage: state.context?.errorMessages['address']?.[0], onChange: (e) => send({
|
|
119
|
+
type: 'ON_INPUT_CHANGE',
|
|
120
|
+
inputName: 'address',
|
|
121
|
+
value: e.target.value,
|
|
122
|
+
}) }), (0, jsx_runtime_1.jsx)(components_1.Input, { id: "postalCode", label: t(PageText.Contact.input.postalCode.label), type: "text", autoComplete: "postal-code", name: "postalCode", value: state.context.postalCode || '', isRequired: true, errorMessage: state.context?.errorMessages['postalCode']?.[0], onChange: (e) => send({
|
|
123
|
+
type: 'ON_INPUT_CHANGE',
|
|
124
|
+
inputName: 'postalCode',
|
|
125
|
+
value: e.target.value,
|
|
126
|
+
}) }), (0, jsx_runtime_1.jsx)(components_1.Input, { id: "city", label: t(PageText.Contact.input.city.label), type: "text", name: "city", value: state.context.city || '', isRequired: true, errorMessage: state.context?.errorMessages['city']?.[0], onChange: (e) => send({
|
|
127
|
+
type: 'ON_INPUT_CHANGE',
|
|
128
|
+
inputName: 'city',
|
|
129
|
+
value: e.target.value,
|
|
130
|
+
}) }), (0, jsx_runtime_1.jsx)(components_1.Input, { id: "email", label: t(PageText.Contact.input.email.label), type: "email", autoComplete: "email", name: "email", value: state.context.email || '', isRequired: true, errorMessage: state.context?.errorMessages['email']?.[0], onChange: (e) => send({
|
|
131
|
+
type: 'ON_INPUT_CHANGE',
|
|
132
|
+
inputName: 'email',
|
|
133
|
+
value: e.target.value,
|
|
134
|
+
}) }), (0, jsx_runtime_1.jsx)(components_1.Input, { id: "phoneNumber", label: t(PageText.Contact.input.phoneNumber.label), type: "tel", name: "phoneNumber", value: state.context.phoneNumber || '', isRequired: true, errorMessage: state.context?.errorMessages['phoneNumber']?.[0], onChange: (e) => send({
|
|
135
|
+
type: 'ON_INPUT_CHANGE',
|
|
136
|
+
inputName: 'phoneNumber',
|
|
137
|
+
value: e.target.value,
|
|
138
|
+
}) }), (0, jsx_runtime_1.jsx)(components_1.Input, { id: "bankAccountNumber", label: t(PageText.Contact.input.bankInformation.bankAccountNumber.label), placeholder: t(PageText.Contact.input.bankInformation.bankAccountNumber
|
|
139
|
+
.placeholder), type: "text", name: "bankAccountNumber", value: state.context.bankAccountNumber || '', disabled: state.context.hasInternationalBankAccount, isRequired: true, errorMessage: state.context?.errorMessages['bankAccountNumber']?.[0], onChange: (e) => send({
|
|
140
|
+
type: 'ON_INPUT_CHANGE',
|
|
141
|
+
inputName: 'bankAccountNumber',
|
|
142
|
+
value: e.target.value,
|
|
143
|
+
}) }), features?.enableInternationalBankAccountInTravelGuarantee !==
|
|
144
|
+
false && ((0, jsx_runtime_1.jsx)(checkbox_1.Checkbox, { label: t(PageText.Contact.input.bankInformation.checkbox), checked: state.context.hasInternationalBankAccount, onChange: () => send({
|
|
145
|
+
type: 'ON_INPUT_CHANGE',
|
|
146
|
+
inputName: 'hasInternationalBankAccount',
|
|
147
|
+
value: !state.context.hasInternationalBankAccount,
|
|
148
|
+
}) })), state.context.hasInternationalBankAccount && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(components_1.Input, { id: "IBAN", label: t(PageText.Contact.input.bankInformation.IBAN.label), description: t(PageText.Contact.input.bankInformation.IBAN.description), type: "string", name: "IBAN", value: state.context.IBAN || '', isRequired: true, errorMessage: state.context?.errorMessages['IBAN']?.[0], onChange: (e) => send({
|
|
149
|
+
type: 'ON_INPUT_CHANGE',
|
|
150
|
+
inputName: 'IBAN',
|
|
151
|
+
value: e.target.value,
|
|
152
|
+
}) }), (0, jsx_runtime_1.jsx)(components_1.Input, { id: "SWIFT", label: t(PageText.Contact.input.bankInformation.SWIFT.label), description: t(PageText.Contact.input.bankInformation.SWIFT.description), type: "string", name: "SWIFT", value: state.context.SWIFT || '', isRequired: true, errorMessage: state.context?.errorMessages['SWIFT']?.[0], onChange: (e) => send({
|
|
153
|
+
type: 'ON_INPUT_CHANGE',
|
|
154
|
+
inputName: 'SWIFT',
|
|
155
|
+
value: e.target.value,
|
|
156
|
+
}) })] }))] })] }));
|
|
157
|
+
};
|
|
158
|
+
exports.PrePurchasedTicketRefundForm = PrePurchasedTicketRefundForm;
|
|
159
|
+
exports.default = exports.PrePurchasedTicketRefundForm;
|