@mrfylke/contact-form 0.1.31 → 0.1.33
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/form/file-input.js +1 -1
- package/lib/components/form/textarea.d.ts +3 -2
- package/lib/components/form/textarea.d.ts.map +1 -1
- package/lib/components/form/textarea.js +6 -4
- package/lib/components/icon/generated-icons.d.ts +6 -6
- package/lib/components/icon/generated-icons.js +16 -16
- 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/forms/injuryForm.d.ts.map +1 -1
- package/lib/means-of-transport/forms/injuryForm.js +1 -1
- 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 +46 -21
- 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 +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 +17 -9
- 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.d.ts.map +1 -1
- package/lib/refund/forms/refund-ticket/otherTicketRefund.js +14 -5
- 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 +12 -6
- package/lib/refund/refundFormMachine.d.ts +19 -10
- package/lib/refund/refundFormMachine.d.ts.map +1 -1
- package/lib/refund/refundFormMachine.js +42 -15
- package/lib/ticketing/forms/app/appTravelSuggestionForm.d.ts.map +1 -1
- package/lib/ticketing/forms/app/appTravelSuggestionForm.js +5 -1
- package/lib/ticketing/forms/priceAndTicketTypesForm.d.ts.map +1 -1
- package/lib/ticketing/forms/priceAndTicketTypesForm.js +5 -1
- 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/index.d.ts.map +1 -1
- package/lib/ticketing/index.js +8 -2
- package/lib/ticketing/ticketingStateMachine.d.ts +6 -4
- package/lib/ticketing/ticketingStateMachine.d.ts.map +1 -1
- package/lib/ticketing/ticketingStateMachine.js +4 -1
- 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 +19 -22
- package/lib/translations/pages/contact.d.ts.map +1 -1
- package/lib/translations/pages/contact.js +52 -40
- 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 +12 -5
- package/lib/translations/types.d.ts.map +1 -1
- package/lib/types.d.ts +3 -3
- 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/lib/validation/validationRules.d.ts.map +1 -1
- package/lib/validation/validationRules.js +2 -1
- package/package.json +2 -1
|
@@ -36,7 +36,11 @@ const PriceAndTicketTypesForm = ({ state, send, }) => {
|
|
|
36
36
|
type: 'ON_INPUT_CHANGE',
|
|
37
37
|
inputName: 'email',
|
|
38
38
|
value: e.target.value,
|
|
39
|
-
}) })
|
|
39
|
+
}) }), state.context.includePhoneNumberInPriceAndTravelSuggestion && ((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({
|
|
40
|
+
type: 'ON_INPUT_CHANGE',
|
|
41
|
+
inputName: 'phoneNumber',
|
|
42
|
+
value: e.target.value,
|
|
43
|
+
}) }))] })] }));
|
|
40
44
|
};
|
|
41
45
|
exports.PriceAndTicketTypesForm = PriceAndTicketTypesForm;
|
|
42
46
|
exports.default = exports.PriceAndTicketTypesForm;
|
|
@@ -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;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ticketing/index.tsx"],"names":[],"mappings":"AAmBA,QAAA,MAAM,gBAAgB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ticketing/index.tsx"],"names":[],"mappings":"AAmBA,QAAA,MAAM,gBAAgB,mCAoIrB,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
|
package/lib/ticketing/index.js
CHANGED
|
@@ -23,7 +23,7 @@ const TicketingContent = () => {
|
|
|
23
23
|
const PageText = (0, translations_1.usePageText)();
|
|
24
24
|
const { t } = (0, translations_1.useTranslation)();
|
|
25
25
|
const apiConfig = (0, config_1.useApiConfig)();
|
|
26
|
-
const { formSchemaOverrides, layout } = (0, config_1.useContactFormConfig)();
|
|
26
|
+
const { formSchemaOverrides, layout, features } = (0, config_1.useContactFormConfig)();
|
|
27
27
|
const successPath = layout?.successPath ??
|
|
28
28
|
(layout?.basePath ? `${layout.basePath}/success` : '/contact/success');
|
|
29
29
|
const errorPath = layout?.errorPath ??
|
|
@@ -31,7 +31,13 @@ const TicketingContent = () => {
|
|
|
31
31
|
const machine = (0, react_2.useMemo)(() => (0, ticketingStateMachine_1.createTicketingStateMachine)(apiConfig.onSubmit, {
|
|
32
32
|
successPath,
|
|
33
33
|
errorPath,
|
|
34
|
-
|
|
34
|
+
includePhoneNumberInPriceAndTravelSuggestion: features?.includePhoneNumberInPriceAndTravelSuggestion === true,
|
|
35
|
+
}), [
|
|
36
|
+
apiConfig.onSubmit,
|
|
37
|
+
successPath,
|
|
38
|
+
errorPath,
|
|
39
|
+
features?.includePhoneNumberInPriceAndTravelSuggestion,
|
|
40
|
+
]);
|
|
35
41
|
const [state, send] = (0, react_1.useMachine)(machine);
|
|
36
42
|
const displaySubmitButton = state.context.formType && state.context.formType !== 'orderTravelCard';
|
|
37
43
|
// Filter form categories based on overrides
|
|
@@ -60,6 +60,7 @@ export type TicketingContextType = {
|
|
|
60
60
|
hasInternationalBankAccount: boolean;
|
|
61
61
|
isInitialAgreementChecked: boolean;
|
|
62
62
|
showInputTravelCardNumber: boolean;
|
|
63
|
+
includePhoneNumberInPriceAndTravelSuggestion: boolean;
|
|
63
64
|
errorMessages: InputErrorMessages;
|
|
64
65
|
firstIncorrectErrorMessage?: string;
|
|
65
66
|
hasSubmissionError?: boolean;
|
|
@@ -67,6 +68,7 @@ export type TicketingContextType = {
|
|
|
67
68
|
export type MachinePaths = {
|
|
68
69
|
successPath: string;
|
|
69
70
|
errorPath: string;
|
|
71
|
+
includePhoneNumberInPriceAndTravelSuggestion?: boolean;
|
|
70
72
|
};
|
|
71
73
|
export declare function createTicketingStateMachine(onSubmit: (slug: FormSlug, state: Record<string, unknown>) => Promise<Response>, paths?: MachinePaths): import("xstate").StateMachine<TicketingContextType, {
|
|
72
74
|
type: "VALIDATE";
|
|
@@ -173,11 +175,11 @@ export declare function createTicketingStateMachine(onSubmit: (slug: FormSlug, s
|
|
|
173
175
|
params: unknown;
|
|
174
176
|
}, never, "success" | "validating" | "submitting" | "formCategoryHandler" | "appFormHandler" | "webshopFormHandler" | "travelCardFormHandler" | {
|
|
175
177
|
editing: "priceAndTicketTypes" | "selectFormCategory" | {
|
|
176
|
-
|
|
178
|
+
travelCard: "orderTravelCard" | "travelCardQuestion" | "selectTravelCardForm";
|
|
177
179
|
} | {
|
|
178
180
|
app: "appTicketing" | "appTravelSuggestion" | "appAccount" | "selectAppForm";
|
|
179
181
|
} | {
|
|
180
|
-
|
|
182
|
+
webshop: "webshopTicketing" | "webshopAccount" | "selectWebshopForm";
|
|
181
183
|
};
|
|
182
184
|
}, string, import("xstate").NonReducibleUnknown, import("xstate").NonReducibleUnknown, import("xstate").EventObject, import("xstate").MetaObject, {
|
|
183
185
|
id: "ticketingStateMachine";
|
|
@@ -356,11 +358,11 @@ export declare const ticketingStateMachine: import("xstate").StateMachine<Ticket
|
|
|
356
358
|
params: unknown;
|
|
357
359
|
}, never, "success" | "validating" | "submitting" | "formCategoryHandler" | "appFormHandler" | "webshopFormHandler" | "travelCardFormHandler" | {
|
|
358
360
|
editing: "priceAndTicketTypes" | "selectFormCategory" | {
|
|
359
|
-
|
|
361
|
+
travelCard: "orderTravelCard" | "travelCardQuestion" | "selectTravelCardForm";
|
|
360
362
|
} | {
|
|
361
363
|
app: "appTicketing" | "appTravelSuggestion" | "appAccount" | "selectAppForm";
|
|
362
364
|
} | {
|
|
363
|
-
|
|
365
|
+
webshop: "webshopTicketing" | "webshopAccount" | "selectWebshopForm";
|
|
364
366
|
};
|
|
365
367
|
}, string, import("xstate").NonReducibleUnknown, import("xstate").NonReducibleUnknown, import("xstate").EventObject, import("xstate").MetaObject, {
|
|
366
368
|
id: "ticketingStateMachine";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ticketingStateMachine.d.ts","sourceRoot":"","sources":["../../src/ticketing/ticketingStateMachine.ts"],"names":[],"mappings":"AAEA,OAAO,EAAwB,kBAAkB,EAAE,MAAM,eAAe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ACtD,aAAa,EAAE,kBAAkB,CAAC;IAClC,0BAA0B,CAAC,EAAE,MAAM,CAAC;IACpC,kBAAkB,CAAC,EAAE,OAAO,CAAC;CAC9B,CAAC;AA4EF,MAAM,MAAM,YAAY,GAAG;IACzB,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,4CAA4C,CAAC,EAAE,OAAO,CAAC;CACxD,CAAC;AAEF,wBAAgB,2BAA2B,CACzC,QAAQ,EAAE,CACR,IAAI,EAAE,QAAQ,EACd,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAC3B,OAAO,CAAC,QAAQ,CAAC,EACtB,KAAK,CAAC,EAAE,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsYrB;AAED,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAOjC,CAAC"}
|
|
@@ -41,7 +41,7 @@ var FormType;
|
|
|
41
41
|
FormType["OrderTravelCard"] = "orderTravelCard";
|
|
42
42
|
})(FormType || (FormType = {}));
|
|
43
43
|
const setInputsToValidate = (context) => {
|
|
44
|
-
const { formType, firstName, lastName, email, phoneNumber, question, orderId, customerNumber, travelCardNumber, } = context;
|
|
44
|
+
const { formType, firstName, lastName, email, phoneNumber, question, orderId, customerNumber, travelCardNumber, includePhoneNumberInPriceAndTravelSuggestion, } = context;
|
|
45
45
|
const commonFields = {
|
|
46
46
|
formType,
|
|
47
47
|
question,
|
|
@@ -53,6 +53,7 @@ const setInputsToValidate = (context) => {
|
|
|
53
53
|
case FormType.PriceAndTicketTypes:
|
|
54
54
|
return {
|
|
55
55
|
...commonFields,
|
|
56
|
+
...(includePhoneNumberInPriceAndTravelSuggestion && { phoneNumber }),
|
|
56
57
|
};
|
|
57
58
|
case FormType.AppTicketing:
|
|
58
59
|
return {
|
|
@@ -64,6 +65,7 @@ const setInputsToValidate = (context) => {
|
|
|
64
65
|
case FormType.AppTravelSuggestion:
|
|
65
66
|
return {
|
|
66
67
|
...commonFields,
|
|
68
|
+
...(includePhoneNumberInPriceAndTravelSuggestion && { phoneNumber }),
|
|
67
69
|
};
|
|
68
70
|
case FormType.AppAccount:
|
|
69
71
|
return {
|
|
@@ -210,6 +212,7 @@ function createTicketingStateMachine(onSubmit, paths) {
|
|
|
210
212
|
hasInternationalBankAccount: false,
|
|
211
213
|
isInitialAgreementChecked: false,
|
|
212
214
|
showInputTravelCardNumber: true,
|
|
215
|
+
includePhoneNumberInPriceAndTravelSuggestion: paths?.includePhoneNumberInPriceAndTravelSuggestion === true,
|
|
213
216
|
errorMessages: {},
|
|
214
217
|
},
|
|
215
218
|
on: {
|
|
@@ -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;CACf;AAED,eAAO,MAAM,YAAY,EAAE,SAAS,QAAQ,EAIlC,CAAC;AAEX,eAAO,MAAM,gBAAgB,qBAAqB,CAAC;AACnD,eAAO,MAAM,uBAAuB,OAAO,CAAC;AAC5C,eAAO,MAAM,iBAAiB,mBAAmB,CAAC;AAClD,MAAM,MAAM,gBAAgB,GAAG,YAAY,CAAC,OAAO,QAAQ,EAAE,MAAM,CAAC,CAAC;AAErE,MAAM,MAAM,iBAAiB,GAAG,CAC9B,IAAI,EAAE,gBAAgB,GAAG;IAAE,QAAQ,CAAC,MAAM,CAAC,EAAE,KAAK,CAAA;CAAE,KACjD,MAAM,CAAC;AAEZ,oEAAoE;AACpE,MAAM,MAAM,oBAAoB,GAAG,gBAAgB,GAAG;IACpD,QAAQ,CAAC,MAAM,EAAE,IAAI,CAAC;CACvB,CAAC;AAEF,wBAAgB,WAAW,CAAC,SAAS,EAAE,MAAM,GAAG,gBAAgB,CAAC;AACjE,wBAAgB,WAAW,CACzB,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,MAAM,GACd,gBAAgB,CAAC;AAapB,wBAAgB,eAAe,CAC7B,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,MAAM,GACd,oBAAoB,CAEtB;AAED,wBAAgB,kBAAkB,CAAC,CAAC,EAAE,GAAG,GAAG,CAAC,IAAI,gBAAgB,CAEhE;AAED,MAAM,MAAM,eAAe,GAAG;IAC5B,IAAI,EAAE,KAAK,GAAG,KAAK,GAAG,KAAK,CAAC;IAC5B,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,wBAAgB,sBAAsB,CACpC,QAAQ,EAAE,QAAQ,EAClB,gBAAgB,EAAE,eAAe,EAAE,GAClC,MAAM,GAAG,SAAS,CASpB"}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.FALLBACK_LANGUAGE = exports.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, RichTranslatedString, 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: RichTranslatedString) => 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,oBAAoB,EAEpB,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,oBAAoB;;EAI1C;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
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { translation as _ } from '../../translations/commons';
|
|
2
|
-
import { ReasonForTransportFailure,
|
|
2
|
+
import { ReasonForTransportFailure, TicketType } from '../../types';
|
|
3
3
|
export declare const Contact: {
|
|
4
4
|
pageTitle: import("../../translations/commons").TranslatedString;
|
|
5
5
|
contactPageLayout: {
|
|
@@ -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,11 +76,11 @@ 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: {
|
|
87
|
-
text: import("../../translations/commons").
|
|
83
|
+
text: import("../../translations/commons").RichTranslatedString;
|
|
88
84
|
examples: import("../../translations/commons").TranslatedString[];
|
|
89
85
|
}[];
|
|
90
86
|
exclusion: import("../../translations/commons").TranslatedString;
|
|
@@ -96,7 +92,6 @@ export declare const Contact: {
|
|
|
96
92
|
};
|
|
97
93
|
};
|
|
98
94
|
refundTaxi: {
|
|
99
|
-
description: import("../../translations/commons").TranslatedString;
|
|
100
95
|
taxiReceipt: {
|
|
101
96
|
title: import("../../translations/commons").TranslatedString;
|
|
102
97
|
info: import("../../translations/commons").TranslatedString;
|
|
@@ -108,6 +103,11 @@ export declare const Contact: {
|
|
|
108
103
|
title: import("../../translations/commons").TranslatedString;
|
|
109
104
|
};
|
|
110
105
|
};
|
|
106
|
+
otherTicketRefund: {
|
|
107
|
+
receipt: {
|
|
108
|
+
info: import("../../translations/commons").TranslatedString;
|
|
109
|
+
};
|
|
110
|
+
};
|
|
111
111
|
refundCar: {
|
|
112
112
|
description: import("../../translations/commons").TranslatedString;
|
|
113
113
|
info: import("../../translations/commons").TranslatedString;
|
|
@@ -167,6 +167,7 @@ export declare const Contact: {
|
|
|
167
167
|
injury: {
|
|
168
168
|
description: import("../../translations/commons").TranslatedString;
|
|
169
169
|
info: import("../../translations/commons").TranslatedString;
|
|
170
|
+
feedbackDescription: import("../../translations/commons").TranslatedString;
|
|
170
171
|
about: {
|
|
171
172
|
title: import("../../translations/commons").TranslatedString;
|
|
172
173
|
description: import("../../translations/commons").TranslatedString;
|
|
@@ -219,12 +220,7 @@ export declare const Contact: {
|
|
|
219
220
|
question: import("../../translations/commons").TranslatedString;
|
|
220
221
|
orderTravelCard: {
|
|
221
222
|
label: import("../../translations/commons").TranslatedString;
|
|
222
|
-
detailsList: import("../../translations/commons").
|
|
223
|
-
detailWithUrl: {
|
|
224
|
-
detail: import("../../translations/commons").TranslatedString;
|
|
225
|
-
linkText: import("../../translations/commons").TranslatedString;
|
|
226
|
-
href: import("../../translations/commons").TranslatedString;
|
|
227
|
-
};
|
|
223
|
+
detailsList: import("../../translations/commons").RichTranslatedString[];
|
|
228
224
|
};
|
|
229
225
|
travelCardQuestion: {
|
|
230
226
|
label: import("../../translations/commons").TranslatedString;
|
|
@@ -241,8 +237,7 @@ export declare const Contact: {
|
|
|
241
237
|
title: import("../../translations/commons").TranslatedString;
|
|
242
238
|
rules: import("../../translations/commons").TranslatedString[];
|
|
243
239
|
info: {
|
|
244
|
-
text: import("../../translations/commons").
|
|
245
|
-
link: import("../../translations/commons").TranslatedString;
|
|
240
|
+
text: import("../../translations/commons").RichTranslatedString;
|
|
246
241
|
note: import("../../translations/commons").TranslatedString;
|
|
247
242
|
};
|
|
248
243
|
checkbox: import("../../translations/commons").TranslatedString;
|
|
@@ -382,6 +377,7 @@ export declare const Contact: {
|
|
|
382
377
|
optionLabel: import("../../translations/commons").TranslatedString;
|
|
383
378
|
modes: {
|
|
384
379
|
bus: import("../../translations/commons").TranslatedString;
|
|
380
|
+
tram: import("../../translations/commons").TranslatedString;
|
|
385
381
|
expressboat: import("../../translations/commons").TranslatedString;
|
|
386
382
|
ferry: import("../../translations/commons").TranslatedString;
|
|
387
383
|
bestillingstransport: import("../../translations/commons").TranslatedString;
|
|
@@ -398,6 +394,7 @@ export declare const Contact: {
|
|
|
398
394
|
framApp: import("../../translations/commons").TranslatedString;
|
|
399
395
|
enturWeb: import("../../translations/commons").TranslatedString;
|
|
400
396
|
framWeb: import("../../translations/commons").TranslatedString;
|
|
397
|
+
sms: import("../../translations/commons").TranslatedString;
|
|
401
398
|
};
|
|
402
399
|
errorMessages: {
|
|
403
400
|
empty: import("../../translations/commons").TranslatedString;
|
|
@@ -578,9 +575,12 @@ export declare const Contact: {
|
|
|
578
575
|
};
|
|
579
576
|
};
|
|
580
577
|
};
|
|
581
|
-
|
|
578
|
+
identificationAttachments: {
|
|
582
579
|
label: import("../../translations/commons").TranslatedString;
|
|
580
|
+
};
|
|
581
|
+
refundReason: {
|
|
583
582
|
question: import("../../translations/commons").TranslatedString;
|
|
583
|
+
description: import("../../translations/commons").TranslatedString;
|
|
584
584
|
errorMessages: {
|
|
585
585
|
empty: import("../../translations/commons").TranslatedString;
|
|
586
586
|
};
|
|
@@ -597,10 +597,7 @@ export declare const Contact: {
|
|
|
597
597
|
ticketType: {
|
|
598
598
|
labelRefund: import("../../translations/commons").TranslatedString;
|
|
599
599
|
optionLabelRefund: import("../../translations/commons").TranslatedString;
|
|
600
|
-
options:
|
|
601
|
-
id: TicketTypeId;
|
|
602
|
-
name: import("../../translations/commons").TranslatedString;
|
|
603
|
-
}[];
|
|
600
|
+
options: TicketType[];
|
|
604
601
|
errorMessages: {
|
|
605
602
|
empty: import("../../translations/commons").TranslatedString;
|
|
606
603
|
};
|
|
@@ -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,EACL,yBAAyB,EACzB,UAAU,EAEX,MAAM,aAAa,CAAC;AAErB,eAAO,MAAM,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2BAiwBG,UAAU,CAAC,OAAO,CAAC,CAAC,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBA8dlC,yBAAyB,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;0CAwPF,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAsHhC,UAAU,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qCA2EM,MAAM;;;;yCASA,MAAM;;;;CAexC,CAAC"}
|