@mrfylke/contact-form 0.1.25 → 0.1.27
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 +41 -13
- package/lib/ContactFormRoot.d.ts.map +1 -1
- package/lib/ContactFormRoot.js +4 -3
- package/lib/components/icon/generated-icons.d.ts +26 -26
- package/lib/components/icon/generated-icons.js +108 -108
- package/lib/contact.module.css +0 -9
- package/lib/group-travel/index.d.ts.map +1 -1
- package/lib/group-travel/index.js +1 -2
- package/lib/index.d.ts +2 -2
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +3 -2
- package/lib/journey-info/index.d.ts.map +1 -1
- package/lib/journey-info/index.js +10 -8
- package/lib/journey-info/journeyInfoStateMachine.d.ts +2 -2
- package/lib/journey-info/journeyInfoStateMachine.d.ts.map +1 -1
- package/lib/journey-info/journeyInfoStateMachine.js +1 -1
- package/lib/layouts/contact-pages.js +1 -1
- package/lib/lost-property/LostPropertyMachine.d.ts +2 -2
- package/lib/lost-property/LostPropertyMachine.d.ts.map +1 -1
- package/lib/lost-property/LostPropertyMachine.js +1 -1
- package/lib/lost-property-external/index.d.ts.map +1 -1
- package/lib/lost-property-external/index.js +1 -2
- package/lib/means-of-transport/forms/serviceOfferingForm.d.ts.map +1 -1
- package/lib/means-of-transport/forms/serviceOfferingForm.js +3 -1
- package/lib/means-of-transport/index.d.ts.map +1 -1
- package/lib/means-of-transport/index.js +8 -2
- package/lib/means-of-transport/means-of-transport-form-machine.d.ts +4 -2
- package/lib/means-of-transport/means-of-transport-form-machine.d.ts.map +1 -1
- package/lib/means-of-transport/means-of-transport-form-machine.js +9 -3
- package/lib/modules/config/context.d.ts +8 -1
- package/lib/modules/config/context.d.ts.map +1 -1
- package/lib/modules/config/context.js +7 -1
- package/lib/modules/config/default-submit.d.ts +3 -0
- package/lib/modules/config/default-submit.d.ts.map +1 -0
- package/lib/modules/config/default-submit.js +13 -0
- package/lib/modules/config/index.d.ts +1 -0
- package/lib/modules/config/index.d.ts.map +1 -1
- package/lib/modules/config/index.js +1 -0
- package/lib/modules/config/types.d.ts +52 -25
- package/lib/modules/config/types.d.ts.map +1 -1
- package/lib/modules/org-data/index.d.ts +1 -2
- package/lib/modules/org-data/index.d.ts.map +1 -1
- package/lib/modules/org-data/index.js +1 -2
- package/lib/refund/forms/refund-and-travel-guarantee/index.d.ts.map +1 -1
- package/lib/refund/forms/refund-and-travel-guarantee/index.js +1 -1
- package/lib/refund/forms/refund-and-travel-guarantee/refundCarForm.d.ts.map +1 -1
- package/lib/refund/forms/refund-and-travel-guarantee/refundCarForm.js +1 -1
- package/lib/refund/forms/refund-ticket/appTicketRefund.d.ts.map +1 -1
- package/lib/refund/forms/refund-ticket/appTicketRefund.js +18 -2
- package/lib/refund/forms/refund-ticket/index.d.ts.map +1 -1
- package/lib/refund/forms/refund-ticket/index.js +1 -1
- package/lib/refund/forms/refund-ticket/otherTicketRefund.d.ts.map +1 -1
- package/lib/refund/forms/refund-ticket/otherTicketRefund.js +19 -3
- package/lib/refund/forms/residualValueOnTravelCard/index.d.ts.map +1 -1
- package/lib/refund/forms/residualValueOnTravelCard/index.js +1 -2
- package/lib/refund/index.d.ts.map +1 -1
- package/lib/refund/index.js +9 -0
- package/lib/refund/refundFormMachine.d.ts +11 -2
- package/lib/refund/refundFormMachine.d.ts.map +1 -1
- package/lib/refund/refundFormMachine.js +24 -2
- package/lib/server/index.d.ts +1 -0
- package/lib/server/index.d.ts.map +1 -1
- package/lib/server/index.js +3 -1
- package/lib/server/submit-route-handler.d.ts +20 -0
- package/lib/server/submit-route-handler.d.ts.map +1 -0
- package/lib/server/submit-route-handler.js +62 -0
- package/lib/ticket-control/forms/feeComplaintForm.d.ts.map +1 -1
- package/lib/ticket-control/forms/feeComplaintForm.js +2 -2
- package/lib/ticket-control/forms/postponePayment.d.ts.map +1 -1
- package/lib/ticket-control/forms/postponePayment.js +2 -2
- package/lib/ticket-control/index.d.ts.map +1 -1
- package/lib/ticket-control/index.js +2 -0
- package/lib/ticket-control/ticket-control-form-machine.d.ts +5 -2
- package/lib/ticket-control/ticket-control-form-machine.d.ts.map +1 -1
- package/lib/ticket-control/ticket-control-form-machine.js +14 -4
- package/lib/ticketing/forms/travel-card/orderTravelCard.d.ts.map +1 -1
- package/lib/ticketing/forms/travel-card/orderTravelCard.js +1 -1
- package/lib/ticketing/ticketingStateMachine.d.ts +2 -2
- package/lib/ticketing/ticketingStateMachine.d.ts.map +1 -1
- package/lib/translations/commons.d.ts +1 -0
- package/lib/translations/commons.d.ts.map +1 -1
- package/lib/translations/commons.js +4 -4
- package/lib/translations/index.d.ts +2 -6
- package/lib/translations/index.d.ts.map +1 -1
- package/lib/translations/index.js +1 -9
- package/lib/translations/language-context.d.ts +0 -8
- package/lib/translations/language-context.d.ts.map +1 -1
- package/lib/translations/language-context.js +1 -31
- package/lib/translations/merge-overrides.d.ts +1 -7
- package/lib/translations/merge-overrides.d.ts.map +1 -1
- package/lib/translations/merge-overrides.js +1 -13
- package/lib/translations/pages/contact.d.ts +9 -4
- package/lib/translations/pages/contact.d.ts.map +1 -1
- package/lib/translations/pages/contact.js +10 -5
- package/lib/translations/server/endpoints.d.ts +0 -62
- package/lib/translations/server/endpoints.d.ts.map +1 -1
- package/lib/translations/server/endpoints.js +0 -62
- package/lib/translations/types.d.ts +0 -6
- package/lib/translations/types.d.ts.map +1 -1
- package/lib/types/submit-payloads.d.ts +2 -0
- package/lib/types/submit-payloads.d.ts.map +1 -1
- package/package.json +1 -1
- package/lib/translations/common/index.d.ts +0 -3
- package/lib/translations/common/index.d.ts.map +0 -1
- package/lib/translations/common/index.js +0 -7
- package/lib/translations/common/layout.d.ts +0 -8
- package/lib/translations/common/layout.d.ts.map +0 -1
- package/lib/translations/common/layout.js +0 -11
- package/lib/translations/common/titles.d.ts +0 -4
- package/lib/translations/common/titles.d.ts.map +0 -1
- package/lib/translations/common/titles.js +0 -7
- package/lib/translations/json-to-override.d.ts +0 -19
- package/lib/translations/json-to-override.d.ts.map +0 -1
- package/lib/translations/json-to-override.js +0 -65
- package/lib/translations/load-org-translations.d.ts +0 -19
- package/lib/translations/load-org-translations.d.ts.map +0 -1
- package/lib/translations/load-org-translations.js +0 -23
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"json-to-override.d.ts","sourceRoot":"","sources":["../../src/translations/json-to-override.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,+BAA+B,EAAE,MAAM,SAAS,CAAC;AAG/D;;;GAGG;AACH,MAAM,MAAM,oBAAoB,GAC9B,MAAM,GAAG;IAAE,EAAE,CAAC,EAAE,MAAM,CAAC;IAAC,EAAE,CAAC,EAAE,MAAM,CAAC;IAAC,EAAE,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,qBAAqB,CAAC;AAE7E,MAAM,MAAM,qBAAqB,GAAG;IAClC,CAAC,GAAG,EAAE,MAAM,GAAG,oBAAoB,GAAG,oBAAoB,EAAE,CAAC;CAC9D,CAAC;AAEF;;;GAGG;AACH,wBAAgB,0BAA0B,CACxC,IAAI,EAAE,qBAAqB,GAC1B,+BAA+B,CAqEjC"}
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.jsonTranslationsToOverride = jsonTranslationsToOverride;
|
|
4
|
-
const merge_overrides_1 = require("./merge-overrides");
|
|
5
|
-
/**
|
|
6
|
-
* Convert a JSON translation object (from org config) to ContactFormTranslationsOverride format.
|
|
7
|
-
* Recursively converts no/en/nn objects to TranslatedString format.
|
|
8
|
-
*/
|
|
9
|
-
function jsonTranslationsToOverride(json) {
|
|
10
|
-
function convertValue(value) {
|
|
11
|
-
if (typeof value === 'string') {
|
|
12
|
-
return value;
|
|
13
|
-
}
|
|
14
|
-
if (Array.isArray(value)) {
|
|
15
|
-
return value.map(convertValue);
|
|
16
|
-
}
|
|
17
|
-
if (value && typeof value === 'object') {
|
|
18
|
-
// Check if it's a translation object (has no/en/nn keys)
|
|
19
|
-
if ('no' in value || 'en' in value || 'nn' in value) {
|
|
20
|
-
return (0, merge_overrides_1.jsonToTranslatedString)(value);
|
|
21
|
-
}
|
|
22
|
-
// Otherwise it's a nested object
|
|
23
|
-
const result = {};
|
|
24
|
-
for (const key in value) {
|
|
25
|
-
const val = value[key];
|
|
26
|
-
if (val === undefined)
|
|
27
|
-
continue;
|
|
28
|
-
if (Array.isArray(val)) {
|
|
29
|
-
result[key] = val.map(convertValue);
|
|
30
|
-
}
|
|
31
|
-
else {
|
|
32
|
-
result[key] = convertValue(val);
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
return result;
|
|
36
|
-
}
|
|
37
|
-
return value;
|
|
38
|
-
}
|
|
39
|
-
const result = {};
|
|
40
|
-
if (json.pages) {
|
|
41
|
-
const pagesVal = json.pages;
|
|
42
|
-
result.pages = (Array.isArray(pagesVal)
|
|
43
|
-
? pagesVal.map(convertValue)
|
|
44
|
-
: convertValue(pagesVal));
|
|
45
|
-
}
|
|
46
|
-
if (json.components) {
|
|
47
|
-
const componentsVal = json.components;
|
|
48
|
-
result.components = (Array.isArray(componentsVal)
|
|
49
|
-
? componentsVal.map(convertValue)
|
|
50
|
-
: convertValue(componentsVal));
|
|
51
|
-
}
|
|
52
|
-
if (json.common) {
|
|
53
|
-
const commonVal = json.common;
|
|
54
|
-
result.common = (Array.isArray(commonVal)
|
|
55
|
-
? commonVal.map(convertValue)
|
|
56
|
-
: convertValue(commonVal));
|
|
57
|
-
}
|
|
58
|
-
if (json.server) {
|
|
59
|
-
const serverVal = json.server;
|
|
60
|
-
result.server = (Array.isArray(serverVal)
|
|
61
|
-
? serverVal.map(convertValue)
|
|
62
|
-
: convertValue(serverVal));
|
|
63
|
-
}
|
|
64
|
-
return result;
|
|
65
|
-
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import type { JsonTranslationObject } from './json-to-override';
|
|
2
|
-
import type { ContactFormTranslationsOverride } from './types';
|
|
3
|
-
/**
|
|
4
|
-
* Load translations from an org JSON config file.
|
|
5
|
-
* The org JSON should have a `translations` property with the structure:
|
|
6
|
-
* {
|
|
7
|
-
* translations: {
|
|
8
|
-
* pages?: { ... },
|
|
9
|
-
* components?: { ... },
|
|
10
|
-
* modules?: { ... },
|
|
11
|
-
* common?: { ... },
|
|
12
|
-
* server?: { ... }
|
|
13
|
-
* }
|
|
14
|
-
* }
|
|
15
|
-
*/
|
|
16
|
-
export declare function loadOrgTranslations(orgJson: {
|
|
17
|
-
translations?: JsonTranslationObject;
|
|
18
|
-
}): ContactFormTranslationsOverride | undefined;
|
|
19
|
-
//# sourceMappingURL=load-org-translations.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"load-org-translations.d.ts","sourceRoot":"","sources":["../../src/translations/load-org-translations.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAEhE,OAAO,KAAK,EAAE,+BAA+B,EAAE,MAAM,SAAS,CAAC;AAE/D;;;;;;;;;;;;GAYG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,EAAE;IAC3C,YAAY,CAAC,EAAE,qBAAqB,CAAC;CACtC,GAAG,+BAA+B,GAAG,SAAS,CAK9C"}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.loadOrgTranslations = loadOrgTranslations;
|
|
4
|
-
const json_to_override_1 = require("./json-to-override");
|
|
5
|
-
/**
|
|
6
|
-
* Load translations from an org JSON config file.
|
|
7
|
-
* The org JSON should have a `translations` property with the structure:
|
|
8
|
-
* {
|
|
9
|
-
* translations: {
|
|
10
|
-
* pages?: { ... },
|
|
11
|
-
* components?: { ... },
|
|
12
|
-
* modules?: { ... },
|
|
13
|
-
* common?: { ... },
|
|
14
|
-
* server?: { ... }
|
|
15
|
-
* }
|
|
16
|
-
* }
|
|
17
|
-
*/
|
|
18
|
-
function loadOrgTranslations(orgJson) {
|
|
19
|
-
if (!orgJson.translations) {
|
|
20
|
-
return undefined;
|
|
21
|
-
}
|
|
22
|
-
return (0, json_to_override_1.jsonTranslationsToOverride)(orgJson.translations);
|
|
23
|
-
}
|