@mrfylke/contact-form 0.1.31 → 0.1.32
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 +19 -3
- package/lib/components/icon/generated-icons.d.ts +6 -6
- 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/index.js +3 -2
- package/lib/lines/use-lines.d.ts +2 -2
- package/lib/lines/use-lines.d.ts.map +1 -1
- package/lib/lines/use-lines.js +14 -21
- package/lib/means-of-transport/means-of-transport-form-machine.d.ts +2 -2
- package/lib/modules/config/context.d.ts.map +1 -1
- package/lib/modules/config/types.d.ts +26 -17
- package/lib/modules/config/types.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 +2 -2
- package/lib/refund/forms/refund-and-travel-guarantee/refundCarForm.d.ts.map +1 -1
- package/lib/refund/forms/refund-and-travel-guarantee/refundCarForm.js +5 -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 +7 -4
- package/lib/refund/forms/refund-ticket/appTicketRefund.d.ts.map +1 -1
- package/lib/refund/forms/refund-ticket/appTicketRefund.js +7 -2
- package/lib/refund/forms/refund-ticket/index.d.ts.map +1 -1
- package/lib/refund/forms/refund-ticket/index.js +2 -5
- package/lib/refund/forms/refund-ticket/otherTicketRefund.js +2 -2
- package/lib/refund/forms/residualValueOnTravelCard/index.d.ts.map +1 -1
- package/lib/refund/forms/residualValueOnTravelCard/index.js +2 -7
- package/lib/refund/index.d.ts.map +1 -1
- package/lib/refund/index.js +6 -2
- package/lib/refund/refundFormMachine.d.ts +6 -2
- package/lib/refund/refundFormMachine.d.ts.map +1 -1
- package/lib/refund/refundFormMachine.js +14 -7
- package/lib/ticketing/forms/travel-card/orderTravelCard.d.ts.map +1 -1
- package/lib/ticketing/forms/travel-card/orderTravelCard.js +2 -11
- package/lib/ticketing/ticketingStateMachine.d.ts +4 -4
- package/lib/translations/commons.d.ts +8 -2
- package/lib/translations/commons.d.ts.map +1 -1
- package/lib/translations/commons.js +4 -0
- package/lib/translations/index.d.ts +3 -2
- package/lib/translations/index.d.ts.map +1 -1
- package/lib/translations/index.js +5 -1
- package/lib/translations/language-context.d.ts +4 -10
- package/lib/translations/language-context.d.ts.map +1 -1
- package/lib/translations/language-context.js +12 -5
- package/lib/translations/lobot.d.ts +9 -0
- package/lib/translations/lobot.d.ts.map +1 -0
- package/lib/translations/lobot.js +6 -0
- package/lib/translations/merge-overrides.d.ts +2 -0
- package/lib/translations/merge-overrides.d.ts.map +1 -1
- package/lib/translations/merge-overrides.js +2 -0
- package/lib/translations/pages/contact.d.ts +4 -13
- package/lib/translations/pages/contact.d.ts.map +1 -1
- package/lib/translations/pages/contact.js +38 -35
- package/lib/translations/terms/default-terms.d.ts +23 -0
- package/lib/translations/terms/default-terms.d.ts.map +1 -0
- package/lib/translations/terms/default-terms.js +25 -0
- package/lib/translations/terms/index.d.ts +4 -0
- package/lib/translations/terms/index.d.ts.map +1 -0
- package/lib/translations/terms/index.js +9 -0
- package/lib/translations/terms/placeholders.d.ts +16 -0
- package/lib/translations/terms/placeholders.d.ts.map +1 -0
- package/lib/translations/terms/placeholders.js +16 -0
- package/lib/translations/terms/types.d.ts +17 -0
- package/lib/translations/terms/types.d.ts.map +1 -0
- package/lib/translations/terms/types.js +2 -0
- package/lib/translations/translations-context.d.ts +6 -0
- package/lib/translations/translations-context.d.ts.map +1 -1
- package/lib/translations/translations-context.js +25 -0
- package/lib/translations/types.d.ts +2 -0
- package/lib/translations/types.d.ts.map +1 -1
- package/lib/types.d.ts +2 -2
- package/lib/types.d.ts.map +1 -1
- package/lib/utils/rich-text.d.ts +9 -0
- package/lib/utils/rich-text.d.ts.map +1 -0
- package/lib/utils/rich-text.js +33 -0
- package/lib/utils/rich-text.module.css +5 -0
- package/package.json +2 -1
|
@@ -24,7 +24,7 @@ const RefundSection = ({ state, send }) => {
|
|
|
24
24
|
});
|
|
25
25
|
}, placeholder: t(PageText.Contact.input.ticketType.optionLabelRefund), options: PageText.Contact.input.ticketType.options, isRequired: true, error: state.context?.errorMessages['ticketType']?.[0]
|
|
26
26
|
? t(state.context?.errorMessages['ticketType'][0])
|
|
27
|
-
: undefined })), features?.
|
|
27
|
+
: undefined })), features?.includeOrderIdInOtherTicketRefund && ((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, errorMessage: state.context?.errorMessages['orderId']?.[0], onChange: (e) => send({
|
|
28
28
|
type: 'ON_INPUT_CHANGE',
|
|
29
29
|
inputName: 'orderId',
|
|
30
30
|
value: e.target.value,
|
|
@@ -38,7 +38,7 @@ const RefundSection = ({ state, send }) => {
|
|
|
38
38
|
value: e.target.value,
|
|
39
39
|
}), modalContent: {
|
|
40
40
|
description: t(PageText.Contact.input.travelCardNumber.info),
|
|
41
|
-
} })), features?.
|
|
41
|
+
} })), features?.includeAmountInOtherTicketRefund && ((0, jsx_runtime_1.jsx)(components_1.Input, { id: "amount", label: t(PageText.Contact.input.amount.info), type: "text", name: "amount", value: state.context.amount || '', isRequired: true, errorMessage: state.context?.errorMessages['amount']?.[0], onChange: (e) => send({
|
|
42
42
|
type: 'ON_INPUT_CHANGE',
|
|
43
43
|
inputName: 'amount',
|
|
44
44
|
value: e.target.value,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/refund/forms/residualValueOnTravelCard/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/refund/forms/residualValueOnTravelCard/index.tsx"],"names":[],"mappings":"AAIA,eAAO,MAAM,yBAAyB,GAAI,MAAE,gCAyB3C,CAAC"}
|
|
@@ -1,19 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
3
|
exports.ResidualValueOnTravelCard = void 0;
|
|
7
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
-
const link_1 = __importDefault(require("next/link"));
|
|
9
5
|
const typography_1 = require("../../../components/typography");
|
|
10
6
|
const translations_1 = require("../../../translations");
|
|
11
7
|
const components_1 = require("../../../components");
|
|
12
8
|
const ResidualValueOnTravelCard = ({}) => {
|
|
13
9
|
const PageText = (0, translations_1.usePageText)();
|
|
14
|
-
const { t } = (0, translations_1.useTranslation)();
|
|
15
|
-
return ((0, jsx_runtime_1.jsxs)(components_1.Fieldset, { title: t(PageText.Contact.refund.residualValueOnTravelCard.title), children: [(
|
|
16
|
-
.monthlyPayoutDetails) }), (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)(typography_1.Typo.p, { textType: "body__m__strong", children: t(PageText.Contact.refund.residualValueOnTravelCard
|
|
10
|
+
const { t, tRich } = (0, translations_1.useTranslation)();
|
|
11
|
+
return ((0, jsx_runtime_1.jsxs)(components_1.Fieldset, { title: t(PageText.Contact.refund.residualValueOnTravelCard.title), children: [tRich(PageText.Contact.refund.residualValueOnTravelCard.text), (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)(typography_1.Typo.p, { textType: "body__m__strong", children: t(PageText.Contact.refund.residualValueOnTravelCard
|
|
17
12
|
.automatedProcessNotice.note) }), (0, jsx_runtime_1.jsx)(typography_1.Typo.p, { textType: "body__m", children: t(PageText.Contact.refund.residualValueOnTravelCard
|
|
18
13
|
.automatedProcessNotice.text) })] })] }));
|
|
19
14
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/refund/index.tsx"],"names":[],"mappings":"AAgBA,QAAA,MAAM,aAAa,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/refund/index.tsx"],"names":[],"mappings":"AAgBA,QAAA,MAAM,aAAa,mCAiJlB,CAAC;AAEF,eAAe,aAAa,CAAC"}
|
package/lib/refund/index.js
CHANGED
|
@@ -35,7 +35,9 @@ const RefundContent = () => {
|
|
|
35
35
|
includeRefundDepartureInfo: features?.includeRefundDepartureInfo === true,
|
|
36
36
|
includeCustomerNumberAndPurchasePlatformInAppTicketRefund: features?.includeCustomerNumberAndPurchasePlatformInAppTicketRefund ===
|
|
37
37
|
true,
|
|
38
|
-
|
|
38
|
+
includeOrderIdInOtherTicketRefund: features?.includeOrderIdInOtherTicketRefund === true,
|
|
39
|
+
includeAmountInOtherTicketRefund: features?.includeAmountInOtherTicketRefund === true,
|
|
40
|
+
includeAmountInRefundTaxi: features?.includeAmountInRefundTaxi !== false,
|
|
39
41
|
enableFileUploads: features?.enableFileUploads === true,
|
|
40
42
|
enableRequiredAttachmentInOtherTicketRefund: features?.enableRequiredAttachmentInOtherTicketRefund === true,
|
|
41
43
|
}), [
|
|
@@ -45,7 +47,9 @@ const RefundContent = () => {
|
|
|
45
47
|
features?.includeOtherTicketTypeSelector,
|
|
46
48
|
features?.includeRefundDepartureInfo,
|
|
47
49
|
features?.includeCustomerNumberAndPurchasePlatformInAppTicketRefund,
|
|
48
|
-
features?.
|
|
50
|
+
features?.includeOrderIdInOtherTicketRefund,
|
|
51
|
+
features?.includeAmountInOtherTicketRefund,
|
|
52
|
+
features?.includeAmountInRefundTaxi,
|
|
49
53
|
features?.enableFileUploads,
|
|
50
54
|
features?.enableRequiredAttachmentInOtherTicketRefund,
|
|
51
55
|
]);
|
|
@@ -102,7 +102,9 @@ export type RefundContextProps = {
|
|
|
102
102
|
includeOtherTicketTypeSelector: boolean;
|
|
103
103
|
includeRefundDepartureInfo: boolean;
|
|
104
104
|
includeCustomerNumberAndPurchasePlatformInAppTicketRefund: boolean;
|
|
105
|
-
|
|
105
|
+
includeOrderIdInOtherTicketRefund: boolean;
|
|
106
|
+
includeAmountInOtherTicketRefund: boolean;
|
|
107
|
+
includeAmountInRefundTaxi: boolean;
|
|
106
108
|
enableFileUploads: boolean;
|
|
107
109
|
enableRequiredAttachmentInOtherTicketRefund: boolean;
|
|
108
110
|
errorMessages: InputErrorMessages;
|
|
@@ -115,7 +117,9 @@ export type MachinePaths = {
|
|
|
115
117
|
includeOtherTicketTypeSelector?: boolean;
|
|
116
118
|
includeRefundDepartureInfo?: boolean;
|
|
117
119
|
includeCustomerNumberAndPurchasePlatformInAppTicketRefund?: boolean;
|
|
118
|
-
|
|
120
|
+
includeOrderIdInOtherTicketRefund?: boolean;
|
|
121
|
+
includeAmountInOtherTicketRefund?: boolean;
|
|
122
|
+
includeAmountInRefundTaxi?: boolean;
|
|
119
123
|
enableFileUploads?: boolean;
|
|
120
124
|
enableRequiredAttachmentInOtherTicketRefund?: boolean;
|
|
121
125
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"refundFormMachine.d.ts","sourceRoot":"","sources":["../../src/refund/refundFormMachine.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,oBAAoB,EACpB,iBAAiB,EACjB,yBAAyB,EACzB,UAAU,EAEX,MAAM,UAAU,CAAC;AAElB,OAAO,EAAE,IAAI,EAAE,MAAM,sCAAsC,CAAC;AAC5D,OAAO,EAAwB,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAWzE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAExD,oBAAY,YAAY;IACtB,cAAc,mBAAmB;IACjC,wBAAwB,6BAA6B;IACrD,yBAAyB,8BAA8B;IACvD,iBAAiB,sBAAsB;CACxC;AAED,oBAAY,gBAAgB;IAC1B,eAAe,oBAAoB;IACnC,iBAAiB,sBAAsB;CACxC;AAED,oBAAY,wB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AAE,OAAO,CAAC;IAC5C,gCAAgC,CAAC,EAAE,OAAO,CAAC;IAC3C,yBAAyB,CAAC,EAAE,OAAO,CAAC;IACpC,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,2CAA2C,CAAC,EAAE,OAAO,CAAC;CACvD,CAAC;AAEF,wBAAgB,wBAAwB,CACtC,QAAQ,EAAE,CACR,IAAI,EAAE,QAAQ,EACd,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAC3B,OAAO,CAAC,QAAQ,CAAC,EACtB,KAAK,CAAC,EAAE,OAAO,CAAC,YAAY,CAAC;;;uEA1TS,aAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqtBrD;AAED,eAAO,MAAM,kBAAkB;;;uEAvtBS,aAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA8tBrD,CAAC"}
|
|
@@ -47,7 +47,7 @@ const setInitialAgreementAndFormType = (context, isChecked) => {
|
|
|
47
47
|
};
|
|
48
48
|
};
|
|
49
49
|
const setInputToValidate = (context) => {
|
|
50
|
-
const { formType, firstName, lastName, email, phoneNumber, address, postalCode, city, hasInternationalBankAccount, bankAccountNumber, IBAN, SWIFT, transportMode, line, fromStop, toStop, date, kilometersDriven, fromAddress, toAddress, plannedDepartureTime, reasonForTransportFailure, amount, attachments, receiptAttachments, orderId, ticketType, refundReason, includeOtherTicketTypeSelector, includeRefundDepartureInfo, includeCustomerNumberAndPurchasePlatformInAppTicketRefund, customerNumber, purchasePlatform,
|
|
50
|
+
const { formType, firstName, lastName, email, phoneNumber, address, postalCode, city, hasInternationalBankAccount, bankAccountNumber, IBAN, SWIFT, transportMode, line, fromStop, toStop, date, kilometersDriven, fromAddress, toAddress, plannedDepartureTime, reasonForTransportFailure, amount, attachments, receiptAttachments, orderId, ticketType, refundReason, includeOtherTicketTypeSelector, includeRefundDepartureInfo, includeCustomerNumberAndPurchasePlatformInAppTicketRefund, customerNumber, purchasePlatform, includeOrderIdInOtherTicketRefund, includeAmountInOtherTicketRefund, includeAmountInRefundTaxi, enableFileUploads, enableRequiredAttachmentInOtherTicketRefund, } = context;
|
|
51
51
|
const commonFields = {
|
|
52
52
|
formType,
|
|
53
53
|
transportMode,
|
|
@@ -68,7 +68,11 @@ const setInputToValidate = (context) => {
|
|
|
68
68
|
};
|
|
69
69
|
switch (formType) {
|
|
70
70
|
case FormType.RefundTaxi:
|
|
71
|
-
return {
|
|
71
|
+
return {
|
|
72
|
+
...commonFields,
|
|
73
|
+
receiptAttachments,
|
|
74
|
+
...(includeAmountInRefundTaxi ? { amount } : {}),
|
|
75
|
+
};
|
|
72
76
|
case FormType.RefundCar:
|
|
73
77
|
return { ...commonFields, kilometersDriven, fromAddress, toAddress };
|
|
74
78
|
case FormType.AppTicketRefund:
|
|
@@ -100,9 +104,8 @@ const setInputToValidate = (context) => {
|
|
|
100
104
|
case FormType.OtherTicketRefund:
|
|
101
105
|
return {
|
|
102
106
|
formType,
|
|
103
|
-
...(
|
|
104
|
-
|
|
105
|
-
: {}),
|
|
107
|
+
...(includeOrderIdInOtherTicketRefund ? { orderId } : {}),
|
|
108
|
+
...(includeAmountInOtherTicketRefund ? { amount } : {}),
|
|
106
109
|
...(includeOtherTicketTypeSelector ? { ticketType } : {}),
|
|
107
110
|
refundReason,
|
|
108
111
|
firstName,
|
|
@@ -185,7 +188,9 @@ function createRefundStateMachine(onSubmit, paths) {
|
|
|
185
188
|
const includeOtherTicketTypeSelector = paths?.includeOtherTicketTypeSelector !== false;
|
|
186
189
|
const includeRefundDepartureInfo = paths?.includeRefundDepartureInfo === true;
|
|
187
190
|
const includeCustomerNumberAndPurchasePlatformInAppTicketRefund = paths?.includeCustomerNumberAndPurchasePlatformInAppTicketRefund === true;
|
|
188
|
-
const
|
|
191
|
+
const includeOrderIdInOtherTicketRefund = paths?.includeOrderIdInOtherTicketRefund === true;
|
|
192
|
+
const includeAmountInOtherTicketRefund = paths?.includeAmountInOtherTicketRefund === true;
|
|
193
|
+
const includeAmountInRefundTaxi = paths?.includeAmountInRefundTaxi !== false;
|
|
189
194
|
const enableFileUploads = paths?.enableFileUploads === true;
|
|
190
195
|
const enableRequiredAttachmentInOtherTicketRefund = paths?.enableRequiredAttachmentInOtherTicketRefund === true;
|
|
191
196
|
return (0, xstate_1.setup)({
|
|
@@ -337,7 +342,9 @@ function createRefundStateMachine(onSubmit, paths) {
|
|
|
337
342
|
includeOtherTicketTypeSelector,
|
|
338
343
|
includeRefundDepartureInfo,
|
|
339
344
|
includeCustomerNumberAndPurchasePlatformInAppTicketRefund,
|
|
340
|
-
|
|
345
|
+
includeOrderIdInOtherTicketRefund,
|
|
346
|
+
includeAmountInOtherTicketRefund,
|
|
347
|
+
includeAmountInRefundTaxi,
|
|
341
348
|
enableFileUploads,
|
|
342
349
|
enableRequiredAttachmentInOtherTicketRefund,
|
|
343
350
|
errorMessages: {},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"orderTravelCard.d.ts","sourceRoot":"","sources":["../../../../src/ticketing/forms/travel-card/orderTravelCard.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"orderTravelCard.d.ts","sourceRoot":"","sources":["../../../../src/ticketing/forms/travel-card/orderTravelCard.tsx"],"names":[],"mappings":"AAIA,eAAO,MAAM,mBAAmB,mCAiB/B,CAAC;AAEF,eAAe,mBAAmB,CAAC"}
|
|
@@ -7,20 +7,11 @@ exports.OrderTravelCardForm = void 0;
|
|
|
7
7
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
8
|
const contact_module_css_1 = __importDefault(require("../../../contact.module.css"));
|
|
9
9
|
const translations_1 = require("../../../translations");
|
|
10
|
-
const typography_1 = require("../../../components/typography");
|
|
11
10
|
const components_1 = require("../../../components");
|
|
12
|
-
const link_1 = __importDefault(require("next/link"));
|
|
13
|
-
const utils_1 = require("../../../utils");
|
|
14
11
|
const OrderTravelCardForm = () => {
|
|
15
12
|
const PageText = (0, translations_1.usePageText)();
|
|
16
|
-
const { t } = (0, translations_1.useTranslation)();
|
|
17
|
-
|
|
18
|
-
if (!detailWithUrlHref) {
|
|
19
|
-
(0, utils_1.warnDevMissingTranslation)('ticketing.travelCard.orderTravelCard.detailWithUrl.href');
|
|
20
|
-
}
|
|
21
|
-
return ((0, jsx_runtime_1.jsx)(components_1.Fieldset, { title: t(PageText.Contact.ticketing.travelCard.orderTravelCard.label), children: (0, jsx_runtime_1.jsxs)("ul", { className: contact_module_css_1.default.rules__list, children: [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}`))), detailWithUrlHref && ((0, jsx_runtime_1.jsxs)("li", { children: [t(PageText.Contact.ticketing.travelCard.orderTravelCard
|
|
22
|
-
.detailWithUrl.detail), ' ', (0, jsx_runtime_1.jsx)(link_1.default, { href: detailWithUrlHref, target: "_blank", rel: "noopener noreferrer", children: t(PageText.Contact.ticketing.travelCard.orderTravelCard
|
|
23
|
-
.detailWithUrl.linkText) }), "."] }))] }) }));
|
|
13
|
+
const { t, tRich } = (0, translations_1.useTranslation)();
|
|
14
|
+
return ((0, jsx_runtime_1.jsx)(components_1.Fieldset, { title: t(PageText.Contact.ticketing.travelCard.orderTravelCard.label), children: (0, jsx_runtime_1.jsx)("ul", { className: contact_module_css_1.default.rules__list, children: PageText.Contact.ticketing.travelCard.orderTravelCard.detailsList.map((paragraph, index) => ((0, jsx_runtime_1.jsx)("li", { children: tRich(paragraph) }, `info-paragraph-${index}`))) }) }));
|
|
24
15
|
};
|
|
25
16
|
exports.OrderTravelCardForm = OrderTravelCardForm;
|
|
26
17
|
exports.default = exports.OrderTravelCardForm;
|
|
@@ -173,11 +173,11 @@ export declare function createTicketingStateMachine(onSubmit: (slug: FormSlug, s
|
|
|
173
173
|
params: unknown;
|
|
174
174
|
}, never, "success" | "validating" | "submitting" | "formCategoryHandler" | "appFormHandler" | "webshopFormHandler" | "travelCardFormHandler" | {
|
|
175
175
|
editing: "priceAndTicketTypes" | "selectFormCategory" | {
|
|
176
|
-
|
|
176
|
+
travelCard: "orderTravelCard" | "travelCardQuestion" | "selectTravelCardForm";
|
|
177
177
|
} | {
|
|
178
178
|
app: "appTicketing" | "appTravelSuggestion" | "appAccount" | "selectAppForm";
|
|
179
179
|
} | {
|
|
180
|
-
|
|
180
|
+
webshop: "webshopTicketing" | "webshopAccount" | "selectWebshopForm";
|
|
181
181
|
};
|
|
182
182
|
}, string, import("xstate").NonReducibleUnknown, import("xstate").NonReducibleUnknown, import("xstate").EventObject, import("xstate").MetaObject, {
|
|
183
183
|
id: "ticketingStateMachine";
|
|
@@ -356,11 +356,11 @@ export declare const ticketingStateMachine: import("xstate").StateMachine<Ticket
|
|
|
356
356
|
params: unknown;
|
|
357
357
|
}, never, "success" | "validating" | "submitting" | "formCategoryHandler" | "appFormHandler" | "webshopFormHandler" | "travelCardFormHandler" | {
|
|
358
358
|
editing: "priceAndTicketTypes" | "selectFormCategory" | {
|
|
359
|
-
|
|
359
|
+
travelCard: "orderTravelCard" | "travelCardQuestion" | "selectTravelCardForm";
|
|
360
360
|
} | {
|
|
361
361
|
app: "appTicketing" | "appTravelSuggestion" | "appAccount" | "selectAppForm";
|
|
362
362
|
} | {
|
|
363
|
-
|
|
363
|
+
webshop: "webshopTicketing" | "webshopAccount" | "selectWebshopForm";
|
|
364
364
|
};
|
|
365
365
|
}, string, import("xstate").NonReducibleUnknown, import("xstate").NonReducibleUnknown, import("xstate").EventObject, import("xstate").MetaObject, {
|
|
366
366
|
id: "ticketingStateMachine";
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { TFunc } from '@leile/lobo-t';
|
|
2
1
|
import type { Translatable } from '@leile/lobo-t';
|
|
3
2
|
export declare enum Language {
|
|
4
3
|
Norwegian = "no",
|
|
@@ -10,9 +9,16 @@ export declare const DEFAULT_LANGUAGE = Language.Norwegian;
|
|
|
10
9
|
export declare const DEFAULT_LANGUAGE_STRING = "no";
|
|
11
10
|
export declare const FALLBACK_LANGUAGE = Language.English;
|
|
12
11
|
export type TranslatedString = Translatable<typeof Language, string>;
|
|
13
|
-
export type TranslateFunction =
|
|
12
|
+
export type TranslateFunction = (text: TranslatedString & {
|
|
13
|
+
readonly __rich?: never;
|
|
14
|
+
}) => string;
|
|
15
|
+
/** A translation containing markdown-style `[text](href)` links. */
|
|
16
|
+
export type RichTranslatedString = TranslatedString & {
|
|
17
|
+
readonly __rich: true;
|
|
18
|
+
};
|
|
14
19
|
export declare function translation(invariant: string): TranslatedString;
|
|
15
20
|
export declare function translation(norwegian: string, english: string, nynorsk: string): TranslatedString;
|
|
21
|
+
export declare function richTranslation(norwegian: string, english: string, nynorsk: string): RichTranslatedString;
|
|
16
22
|
export declare function isTranslatedString(a: any): a is TranslatedString;
|
|
17
23
|
export type LocalizedString = {
|
|
18
24
|
lang: 'nob' | 'eng' | 'nno';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"commons.d.ts","sourceRoot":"","sources":["../../src/translations/commons.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"commons.d.ts","sourceRoot":"","sources":["../../src/translations/commons.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAElD,oBAAY,QAAQ;IAClB,SAAS,OAAO;IAChB,OAAO,UAAU;IACjB,OAAO,OAAO;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ports.DEFAULT_LANGUAGE_STRING = exports.DEFAULT_LANGUAGE = exports.appLanguages = exports.Language = void 0;
|
|
4
4
|
exports.translation = translation;
|
|
5
|
+
exports.richTranslation = richTranslation;
|
|
5
6
|
exports.isTranslatedString = isTranslatedString;
|
|
6
7
|
exports.convertLocalizedString = convertLocalizedString;
|
|
7
8
|
var Language;
|
|
@@ -25,6 +26,9 @@ function translation(norwegianOrInvariant, english, nynorsk) {
|
|
|
25
26
|
[Language.Nynorsk]: nynorsk ?? norwegianOrInvariant,
|
|
26
27
|
};
|
|
27
28
|
}
|
|
29
|
+
function richTranslation(norwegian, english, nynorsk) {
|
|
30
|
+
return translation(norwegian, english, nynorsk);
|
|
31
|
+
}
|
|
28
32
|
function isTranslatedString(a) {
|
|
29
33
|
return typeof a[Language.Norwegian] !== 'undefined';
|
|
30
34
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
export type { TranslateFunction, TranslatedString } from './commons';
|
|
2
|
-
export { Language, DEFAULT_LANGUAGE, DEFAULT_LANGUAGE_STRING, appLanguages, translation, } from './commons';
|
|
1
|
+
export type { RichTranslatedString, TranslateFunction, TranslatedString, } from './commons';
|
|
2
|
+
export { Language, DEFAULT_LANGUAGE, DEFAULT_LANGUAGE_STRING, appLanguages, translation, richTranslation, } from './commons';
|
|
3
3
|
export type { ContactFormTranslationsOverride } from './types';
|
|
4
|
+
export { T, defaultTerms, type TermForm, type TermForms, type TermGroup, type Terms, } from './terms';
|
|
4
5
|
export { default as AppLanguageProvider, useTranslation, getLocalesFromAcceptLanguage, } from './language-context';
|
|
5
6
|
export { getTextForLanguage } from './utils';
|
|
6
7
|
export { mergeTranslationOverrides } from './merge-overrides';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/translations/index.ts"],"names":[],"mappings":"AAAA,YAAY,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/translations/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,oBAAoB,EACpB,iBAAiB,EACjB,gBAAgB,GACjB,MAAM,WAAW,CAAC;AACnB,OAAO,EACL,QAAQ,EACR,gBAAgB,EAChB,uBAAuB,EACvB,YAAY,EACZ,WAAW,EACX,eAAe,GAChB,MAAM,WAAW,CAAC;AAEnB,YAAY,EAAE,+BAA+B,EAAE,MAAM,SAAS,CAAC;AAC/D,OAAO,EACL,CAAC,EACD,YAAY,EACZ,KAAK,QAAQ,EACb,KAAK,SAAS,EACd,KAAK,SAAS,EACd,KAAK,KAAK,GACX,MAAM,SAAS,CAAC;AAEjB,OAAO,EACL,OAAO,IAAI,mBAAmB,EAC9B,cAAc,EACd,4BAA4B,GAC7B,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAC7C,OAAO,EAAE,yBAAyB,EAAE,MAAM,mBAAmB,CAAC;AAC9D,OAAO,EAAE,qBAAqB,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAE5E,OAAO,KAAK,UAAU,MAAM,UAAU,CAAC;AACvC,OAAO,KAAK,aAAa,MAAM,cAAc,CAAC;AAC9C,OAAO,KAAK,QAAQ,MAAM,SAAS,CAAC"}
|
|
@@ -36,13 +36,17 @@ 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.usePageText = exports.useMergedTranslations = exports.mergeTranslationOverrides = exports.getTextForLanguage = exports.getLocalesFromAcceptLanguage = 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.usePageText = exports.useMergedTranslations = exports.mergeTranslationOverrides = exports.getTextForLanguage = exports.getLocalesFromAcceptLanguage = exports.useTranslation = exports.AppLanguageProvider = exports.defaultTerms = exports.T = exports.richTranslation = 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; } });
|
|
43
43
|
Object.defineProperty(exports, "DEFAULT_LANGUAGE_STRING", { enumerable: true, get: function () { return commons_1.DEFAULT_LANGUAGE_STRING; } });
|
|
44
44
|
Object.defineProperty(exports, "appLanguages", { enumerable: true, get: function () { return commons_1.appLanguages; } });
|
|
45
45
|
Object.defineProperty(exports, "translation", { enumerable: true, get: function () { return commons_1.translation; } });
|
|
46
|
+
Object.defineProperty(exports, "richTranslation", { enumerable: true, get: function () { return commons_1.richTranslation; } });
|
|
47
|
+
var terms_1 = require("./terms");
|
|
48
|
+
Object.defineProperty(exports, "T", { enumerable: true, get: function () { return terms_1.T; } });
|
|
49
|
+
Object.defineProperty(exports, "defaultTerms", { enumerable: true, get: function () { return terms_1.defaultTerms; } });
|
|
46
50
|
var language_context_1 = require("./language-context");
|
|
47
51
|
Object.defineProperty(exports, "AppLanguageProvider", { enumerable: true, get: function () { return __importDefault(language_context_1).default; } });
|
|
48
52
|
Object.defineProperty(exports, "useTranslation", { enumerable: true, get: function () { return language_context_1.useTranslation; } });
|
|
@@ -1,15 +1,9 @@
|
|
|
1
|
-
import { Language } from './commons';
|
|
1
|
+
import { Language, TranslatedString, TranslateFunction } from './commons';
|
|
2
2
|
import { PropsWithChildren } from 'react';
|
|
3
3
|
import type { ContactFormTranslationsOverride } from './types';
|
|
4
|
-
export declare
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
t: import("@leile/lobo-t").TFunc<typeof Language>;
|
|
8
|
-
language: Language;
|
|
9
|
-
};
|
|
10
|
-
};
|
|
11
|
-
export declare const useTranslation: () => {
|
|
12
|
-
t: import("@leile/lobo-t").TFunc<typeof Language>;
|
|
4
|
+
export declare function useTranslation(): {
|
|
5
|
+
t: TranslateFunction;
|
|
6
|
+
tRich: (text: TranslatedString) => import("react").JSX.Element;
|
|
13
7
|
language: Language;
|
|
14
8
|
};
|
|
15
9
|
export type AppLanguageProviderProps = PropsWithChildren<{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"language-context.d.ts","sourceRoot":"","sources":["../../src/translations/language-context.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"language-context.d.ts","sourceRoot":"","sources":["../../src/translations/language-context.tsx"],"names":[],"mappings":"AAAA,OAAO,EAGL,QAAQ,EACR,gBAAgB,EAChB,iBAAiB,EAClB,MAAM,WAAW,CAAC;AAEnB,OAAO,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAC1C,OAAO,KAAK,EAAE,+BAA+B,EAAE,MAAM,SAAS,CAAC;AAK/D,wBAAgB,cAAc;;kBAMP,gBAAgB;;EAItC;AAeD,MAAM,MAAM,wBAAwB,GAAG,iBAAiB,CAAC;IACvD;;;OAGG;IACH,SAAS,EAAE,+BAA+B,CAAC;IAC3C,QAAQ,EAAE,QAAQ,CAAC;CACpB,CAAC,CAAC;AACH,MAAM,CAAC,OAAO,UAAU,mBAAmB,CAAC,EAC1C,QAAQ,EACR,SAAS,EACT,QAAQ,GACT,EAAE,wBAAwB,+BAQ1B;AAED,4FAA4F;AAC5F,wBAAgB,4BAA4B,CAAC,SAAS,EAAE,MAAM,YAK7D"}
|
|
@@ -3,16 +3,23 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.useTranslation =
|
|
6
|
+
exports.useTranslation = useTranslation;
|
|
7
7
|
exports.default = AppLanguageProvider;
|
|
8
8
|
exports.getLocalesFromAcceptLanguage = getLocalesFromAcceptLanguage;
|
|
9
9
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
10
10
|
const commons_1 = require("./commons");
|
|
11
|
-
const lobo_t_1 = require("@leile/lobo-t");
|
|
12
11
|
const detect_nearest_locale_1 = __importDefault(require("detect-nearest-locale"));
|
|
12
|
+
const rich_text_1 = require("../utils/rich-text");
|
|
13
|
+
const lobot_1 = require("./lobot");
|
|
13
14
|
const translations_context_1 = require("./translations-context");
|
|
14
|
-
|
|
15
|
-
|
|
15
|
+
function useTranslation() {
|
|
16
|
+
const { t: rawT, language } = lobot_1.lobot.useTranslation();
|
|
17
|
+
const fillTerms = (0, translations_context_1.useFillTerms)();
|
|
18
|
+
const translateWithTerms = (text) => fillTerms(rawT(text));
|
|
19
|
+
const t = translateWithTerms;
|
|
20
|
+
const tRich = (text) => ((0, jsx_runtime_1.jsx)(rich_text_1.RichText, { children: translateWithTerms(text) }));
|
|
21
|
+
return { t, tRich, language };
|
|
22
|
+
}
|
|
16
23
|
function mapLanguageStringToEnum(language) {
|
|
17
24
|
if (language == commons_1.Language.English) {
|
|
18
25
|
return commons_1.Language.English;
|
|
@@ -26,7 +33,7 @@ function mapLanguageStringToEnum(language) {
|
|
|
26
33
|
return commons_1.DEFAULT_LANGUAGE;
|
|
27
34
|
}
|
|
28
35
|
function AppLanguageProvider({ children, overrides, language, }) {
|
|
29
|
-
return ((0, jsx_runtime_1.jsx)(translations_context_1.TranslationsProvider, { overrides: overrides, children: (0, jsx_runtime_1.jsx)(
|
|
36
|
+
return ((0, jsx_runtime_1.jsx)(translations_context_1.TranslationsProvider, { overrides: overrides, children: (0, jsx_runtime_1.jsx)(lobot_1.lobot.LanguageProvider, { value: language, children: children }) }));
|
|
30
37
|
}
|
|
31
38
|
/** Parses a raw Accept-Language header into the nearest supported Language. Use for SSR. */
|
|
32
39
|
function getLocalesFromAcceptLanguage(headerStr) {
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Language } from './commons';
|
|
2
|
+
export declare const lobot: {
|
|
3
|
+
LanguageProvider: import("react").Provider<Language>;
|
|
4
|
+
useTranslation: () => {
|
|
5
|
+
t: import("@leile/lobo-t").TFunc<typeof Language>;
|
|
6
|
+
language: Language;
|
|
7
|
+
};
|
|
8
|
+
};
|
|
9
|
+
//# sourceMappingURL=lobot.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lobot.d.ts","sourceRoot":"","sources":["../../src/translations/lobot.ts"],"names":[],"mappings":"AACA,OAAO,EAAoB,QAAQ,EAAE,MAAM,WAAW,CAAC;AAEvD,eAAO,MAAM,KAAK;;;;;;CAA+C,CAAC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { translation } from './commons';
|
|
2
2
|
import type { ContactFormTranslationsOverride } from './types';
|
|
3
3
|
import * as PageText from './pages';
|
|
4
|
+
import { type Terms } from './terms';
|
|
4
5
|
/**
|
|
5
6
|
* Convert a JSON translation object with no/en/nn keys to TranslatedString format
|
|
6
7
|
*/
|
|
@@ -16,5 +17,6 @@ export declare function jsonToTranslatedString(json: {
|
|
|
16
17
|
*/
|
|
17
18
|
export declare function mergeTranslationOverrides(overrides: ContactFormTranslationsOverride): {
|
|
18
19
|
PageText: typeof PageText;
|
|
20
|
+
terms: Terms;
|
|
19
21
|
};
|
|
20
22
|
//# sourceMappingURL=merge-overrides.d.ts.map
|
|
@@ -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;
|
|
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,EAAgB,KAAK,KAAK,EAAE,MAAM,SAAS,CAAC;AAEnD;;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,KAAK,EAAE,KAAK,CAAC;CACd,CASA"}
|
|
@@ -37,6 +37,7 @@ exports.jsonToTranslatedString = jsonToTranslatedString;
|
|
|
37
37
|
exports.mergeTranslationOverrides = mergeTranslationOverrides;
|
|
38
38
|
const commons_1 = require("./commons");
|
|
39
39
|
const PageText = __importStar(require("./pages"));
|
|
40
|
+
const terms_1 = require("./terms");
|
|
40
41
|
/**
|
|
41
42
|
* Convert a JSON translation object with no/en/nn keys to TranslatedString format
|
|
42
43
|
*/
|
|
@@ -115,5 +116,6 @@ function mergeTranslationOverrides(overrides) {
|
|
|
115
116
|
PageText: overrides.pages
|
|
116
117
|
? deepMergeTranslations(PageText, overrides.pages)
|
|
117
118
|
: PageText,
|
|
119
|
+
terms: { ...terms_1.defaultTerms, ...overrides.terms },
|
|
118
120
|
};
|
|
119
121
|
}
|
|
@@ -66,11 +66,7 @@ export declare const Contact: {
|
|
|
66
66
|
description: import("../../translations/commons").TranslatedString;
|
|
67
67
|
webshopRefundLabel: import("../../translations/commons").TranslatedString;
|
|
68
68
|
title: import("../../translations/commons").TranslatedString;
|
|
69
|
-
|
|
70
|
-
text: import("../../translations/commons").TranslatedString;
|
|
71
|
-
href: import("../../translations/commons").TranslatedString;
|
|
72
|
-
};
|
|
73
|
-
monthlyPayoutDetails: import("../../translations/commons").TranslatedString;
|
|
69
|
+
text: import("../../translations/commons").RichTranslatedString;
|
|
74
70
|
paymentWhen: import("../../translations/commons").TranslatedString;
|
|
75
71
|
automatedProcessNotice: {
|
|
76
72
|
note: import("../../translations/commons").TranslatedString;
|
|
@@ -80,7 +76,7 @@ export declare const Contact: {
|
|
|
80
76
|
agreement: {
|
|
81
77
|
title: import("../../translations/commons").TranslatedString;
|
|
82
78
|
delayedRefundText: import("../../translations/commons").TranslatedString;
|
|
83
|
-
ticketRefundText: import("../../translations/commons").
|
|
79
|
+
ticketRefundText: import("../../translations/commons").RichTranslatedString;
|
|
84
80
|
travelGuaranteeExceptions: {
|
|
85
81
|
label: import("../../translations/commons").TranslatedString;
|
|
86
82
|
exceptions: {
|
|
@@ -220,11 +216,6 @@ export declare const Contact: {
|
|
|
220
216
|
orderTravelCard: {
|
|
221
217
|
label: import("../../translations/commons").TranslatedString;
|
|
222
218
|
detailsList: import("../../translations/commons").TranslatedString[];
|
|
223
|
-
detailWithUrl: {
|
|
224
|
-
detail: import("../../translations/commons").TranslatedString;
|
|
225
|
-
linkText: import("../../translations/commons").TranslatedString;
|
|
226
|
-
href: import("../../translations/commons").TranslatedString;
|
|
227
|
-
};
|
|
228
219
|
};
|
|
229
220
|
travelCardQuestion: {
|
|
230
221
|
label: import("../../translations/commons").TranslatedString;
|
|
@@ -241,8 +232,7 @@ export declare const Contact: {
|
|
|
241
232
|
title: import("../../translations/commons").TranslatedString;
|
|
242
233
|
rules: import("../../translations/commons").TranslatedString[];
|
|
243
234
|
info: {
|
|
244
|
-
text: import("../../translations/commons").
|
|
245
|
-
link: import("../../translations/commons").TranslatedString;
|
|
235
|
+
text: import("../../translations/commons").RichTranslatedString;
|
|
246
236
|
note: import("../../translations/commons").TranslatedString;
|
|
247
237
|
};
|
|
248
238
|
checkbox: import("../../translations/commons").TranslatedString;
|
|
@@ -382,6 +372,7 @@ export declare const Contact: {
|
|
|
382
372
|
optionLabel: import("../../translations/commons").TranslatedString;
|
|
383
373
|
modes: {
|
|
384
374
|
bus: import("../../translations/commons").TranslatedString;
|
|
375
|
+
tram: import("../../translations/commons").TranslatedString;
|
|
385
376
|
expressboat: import("../../translations/commons").TranslatedString;
|
|
386
377
|
ferry: import("../../translations/commons").TranslatedString;
|
|
387
378
|
bestillingstransport: import("../../translations/commons").TranslatedString;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contact.d.ts","sourceRoot":"","sources":["../../../src/translations/pages/contact.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"contact.d.ts","sourceRoot":"","sources":["../../../src/translations/pages/contact.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW,IAAI,CAAC,EAEjB,MAAM,4BAA4B,CAAC;AAEpC,OAAO,EAAE,yBAAyB,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAEtE,eAAO,MAAM,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2BAuvBG,UAAU,CAAC,OAAO,CAAC,CAAC,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBA6dlC,yBAAyB,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;0CAwPF,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qCAyLd,MAAM;;;;yCASA,MAAM;;;;CAexC,CAAC"}
|