@wise/dynamic-flow-client 1.0.2 → 1.1.0
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/build/i18n/pl.json +2 -2
- package/build/i18n/zh.json +5 -5
- package/build/main.js +519 -424
- package/build/main.min.js +3 -3
- package/build/types/fixtures/components/decision-flags.d.ts +3 -0
- package/build/types/fixtures/components/decision-icons.d.ts +3 -0
- package/build/types/fixtures/components/index.d.ts +2 -0
- package/build/types/fixtures/index.d.ts +2 -0
- package/build/types/jsonSchemaForm/schemaFormControl/utils/mapping-utils.d.ts +10 -14
- package/build/types/layout/icon/DynamicIcon.d.ts +2 -2
- package/build/types/layout/icon/FlagIcon.d.ts +7 -0
- package/build/types/layout/icon/NamedIcon.d.ts +6 -0
- package/package.json +2 -2
- package/build/types/jsonSchemaForm/schemaFormControl/utils/currency-utils.d.ts +0 -3
package/build/main.js
CHANGED
|
@@ -541,92 +541,92 @@ __export(src_exports, {
|
|
|
541
541
|
module.exports = __toCommonJS(src_exports);
|
|
542
542
|
|
|
543
543
|
// src/step/layoutStep/utils/layout-utils.ts
|
|
544
|
-
function convertStepToLayout(
|
|
545
|
-
if (!
|
|
544
|
+
function convertStepToLayout(step33, { displayStepTitle = true } = {}) {
|
|
545
|
+
if (!step33 || !step33.type) {
|
|
546
546
|
throw new Error("Missing step type");
|
|
547
547
|
}
|
|
548
|
-
if (
|
|
549
|
-
return addMissingTitleAndDescriptionToStep(
|
|
548
|
+
if (step33.layout) {
|
|
549
|
+
return addMissingTitleAndDescriptionToStep(step33, displayStepTitle);
|
|
550
550
|
}
|
|
551
|
-
switch (
|
|
551
|
+
switch (step33.type) {
|
|
552
552
|
case "final":
|
|
553
|
-
return convertFinalStepToDynamicLayout(
|
|
553
|
+
return convertFinalStepToDynamicLayout(step33);
|
|
554
554
|
case "decision":
|
|
555
|
-
return convertDecisionStepToDynamicLayout(
|
|
555
|
+
return convertDecisionStepToDynamicLayout(step33);
|
|
556
556
|
case "form":
|
|
557
|
-
return convertFormStepToDynamicLayout(
|
|
557
|
+
return convertFormStepToDynamicLayout(step33);
|
|
558
558
|
case "external":
|
|
559
|
-
return convertExternalStepToDynamicLayout(
|
|
559
|
+
return convertExternalStepToDynamicLayout(step33);
|
|
560
560
|
default:
|
|
561
561
|
throw new Error("invalid step type");
|
|
562
562
|
}
|
|
563
563
|
}
|
|
564
|
-
function convertCommonComponents(
|
|
564
|
+
function convertCommonComponents(step33) {
|
|
565
565
|
const layout6 = [];
|
|
566
|
-
if (
|
|
567
|
-
layout6.push(convertStepTitleToDynamicHeading(
|
|
566
|
+
if (step33.title) {
|
|
567
|
+
layout6.push(convertStepTitleToDynamicHeading(step33.title));
|
|
568
568
|
}
|
|
569
|
-
if (
|
|
570
|
-
const image = convertStepImageToDynamicImage(
|
|
569
|
+
if (step33.image) {
|
|
570
|
+
const image = convertStepImageToDynamicImage(step33.image);
|
|
571
571
|
layout6.push(image);
|
|
572
572
|
}
|
|
573
|
-
if (
|
|
574
|
-
layout6.push(convertStepDescriptionToDynamicParagraph(
|
|
573
|
+
if (step33.description) {
|
|
574
|
+
layout6.push(convertStepDescriptionToDynamicParagraph(step33.description));
|
|
575
575
|
}
|
|
576
576
|
return layout6;
|
|
577
577
|
}
|
|
578
|
-
function convertExternalStepToDynamicLayout(
|
|
579
|
-
return [...convertCommonComponents(
|
|
578
|
+
function convertExternalStepToDynamicLayout(step33) {
|
|
579
|
+
return [...convertCommonComponents(step33), convertStepToExternalComponent(step33)];
|
|
580
580
|
}
|
|
581
|
-
function convertStepToExternalComponent(
|
|
581
|
+
function convertStepToExternalComponent(step33) {
|
|
582
582
|
return {
|
|
583
583
|
type: "external",
|
|
584
|
-
requestUrl:
|
|
585
|
-
polling:
|
|
586
|
-
responseHandlers:
|
|
587
|
-
retryTitle:
|
|
584
|
+
requestUrl: step33.requestUrl,
|
|
585
|
+
polling: step33.polling,
|
|
586
|
+
responseHandlers: step33.responseHandlers,
|
|
587
|
+
retryTitle: step33.retryTitle
|
|
588
588
|
};
|
|
589
589
|
}
|
|
590
|
-
function convertFormStepToDynamicLayout(
|
|
591
|
-
const layout6 = convertCommonComponents(
|
|
592
|
-
if (
|
|
593
|
-
layout6.push(convertStepReviewToDynamicReview(
|
|
590
|
+
function convertFormStepToDynamicLayout(step33) {
|
|
591
|
+
const layout6 = convertCommonComponents(step33);
|
|
592
|
+
if (step33.reviewFields) {
|
|
593
|
+
layout6.push(convertStepReviewToDynamicReview(step33.reviewFields));
|
|
594
594
|
}
|
|
595
|
-
if (
|
|
596
|
-
layout6.push(...getSchemaLayout(
|
|
595
|
+
if (step33.schemas) {
|
|
596
|
+
layout6.push(...getSchemaLayout(step33));
|
|
597
597
|
}
|
|
598
|
-
if (
|
|
599
|
-
const actions =
|
|
598
|
+
if (step33.actions) {
|
|
599
|
+
const actions = step33.actions.map(convertStepActionToDynamicAction);
|
|
600
600
|
layout6.push(dynamicBox(actions, "md"));
|
|
601
601
|
}
|
|
602
602
|
return layout6;
|
|
603
603
|
}
|
|
604
|
-
function convertFinalStepToDynamicLayout(
|
|
604
|
+
function convertFinalStepToDynamicLayout(step33) {
|
|
605
605
|
const layout6 = [];
|
|
606
|
-
if (
|
|
607
|
-
if (
|
|
608
|
-
const image = convertFinalStepImageToDynamicImage(
|
|
606
|
+
if (step33.details) {
|
|
607
|
+
if (step33.details.image) {
|
|
608
|
+
const image = convertFinalStepImageToDynamicImage(step33.details.image);
|
|
609
609
|
layout6.push(image);
|
|
610
610
|
}
|
|
611
|
-
if (
|
|
612
|
-
layout6.push(convertStepTitleToDynamicHeading(
|
|
611
|
+
if (step33.details.title) {
|
|
612
|
+
layout6.push(convertStepTitleToDynamicHeading(step33.details.title));
|
|
613
613
|
}
|
|
614
|
-
if (
|
|
615
|
-
layout6.push(convertStepDescriptionToDynamicParagraph(
|
|
614
|
+
if (step33.details.description) {
|
|
615
|
+
layout6.push(convertStepDescriptionToDynamicParagraph(step33.details.description));
|
|
616
616
|
}
|
|
617
617
|
}
|
|
618
|
-
if (
|
|
619
|
-
const actions =
|
|
618
|
+
if (step33.actions) {
|
|
619
|
+
const actions = step33.actions.map(
|
|
620
620
|
(action2) => convertStepActionToDynamicAction(__spreadProps(__spreadValues({}, action2), { type: action2.type || "primary" }))
|
|
621
621
|
);
|
|
622
622
|
layout6.push(dynamicBox(actions, "md"));
|
|
623
623
|
}
|
|
624
624
|
return layout6;
|
|
625
625
|
}
|
|
626
|
-
function convertDecisionStepToDynamicLayout(
|
|
627
|
-
const layout6 = convertCommonComponents(
|
|
628
|
-
if (
|
|
629
|
-
layout6.push(convertStepDecisionToDynamicDecision(
|
|
626
|
+
function convertDecisionStepToDynamicLayout(step33) {
|
|
627
|
+
const layout6 = convertCommonComponents(step33);
|
|
628
|
+
if (step33.options) {
|
|
629
|
+
layout6.push(convertStepDecisionToDynamicDecision(step33.options));
|
|
630
630
|
}
|
|
631
631
|
return layout6;
|
|
632
632
|
}
|
|
@@ -712,10 +712,10 @@ function convertReviewFieldToDefinition(reviewField) {
|
|
|
712
712
|
value: reviewField.value
|
|
713
713
|
};
|
|
714
714
|
}
|
|
715
|
-
function getSchemaLayout(
|
|
715
|
+
function getSchemaLayout(step33) {
|
|
716
716
|
const layout6 = [];
|
|
717
|
-
if (
|
|
718
|
-
const schema2 =
|
|
717
|
+
if (step33.schemas && step33.schemas[0]) {
|
|
718
|
+
const schema2 = step33.schemas[0];
|
|
719
719
|
const dynamicForm = convertStepSchemaToDynamicForm(schema2);
|
|
720
720
|
if (isWideForm()) {
|
|
721
721
|
layout6.push(dynamicForm);
|
|
@@ -728,11 +728,11 @@ function getSchemaLayout(step31) {
|
|
|
728
728
|
function isWideForm() {
|
|
729
729
|
return false;
|
|
730
730
|
}
|
|
731
|
-
function addMissingTitleAndDescriptionToStep(
|
|
731
|
+
function addMissingTitleAndDescriptionToStep(step33, displayStepTitle) {
|
|
732
732
|
return [
|
|
733
|
-
...displayStepTitle &&
|
|
734
|
-
...
|
|
735
|
-
...
|
|
733
|
+
...displayStepTitle && step33.title ? [convertStepTitleToDynamicHeading(step33.title)] : [],
|
|
734
|
+
...step33.description ? [convertStepDescriptionToDynamicParagraph(step33.description)] : [],
|
|
735
|
+
...step33.layout || []
|
|
736
736
|
];
|
|
737
737
|
}
|
|
738
738
|
|
|
@@ -1715,19 +1715,19 @@ var stepType = {
|
|
|
1715
1715
|
LAYOUT: "layout",
|
|
1716
1716
|
CAMERA: "camera"
|
|
1717
1717
|
};
|
|
1718
|
-
var isCameraStep = (
|
|
1719
|
-
return isFormStep(
|
|
1718
|
+
var isCameraStep = (step33) => {
|
|
1719
|
+
return isFormStep(step33) && hasSingleAction(step33) && hasSingleFileUploadSchemaWithCameraOnly(step33);
|
|
1720
1720
|
};
|
|
1721
|
-
var isFormStep = (
|
|
1722
|
-
var hasSingleAction = (
|
|
1721
|
+
var isFormStep = (step33) => (step33 == null ? void 0 : step33.type) === "form";
|
|
1722
|
+
var hasSingleAction = (step33) => {
|
|
1723
1723
|
var _a;
|
|
1724
|
-
return ((_a =
|
|
1724
|
+
return ((_a = step33 == null ? void 0 : step33.actions) == null ? void 0 : _a.length) === 1;
|
|
1725
1725
|
};
|
|
1726
|
-
var hasSingleFileUploadSchemaWithCameraOnly = (
|
|
1727
|
-
if (!
|
|
1726
|
+
var hasSingleFileUploadSchemaWithCameraOnly = (step33) => {
|
|
1727
|
+
if (!step33.schemas) {
|
|
1728
1728
|
return false;
|
|
1729
1729
|
}
|
|
1730
|
-
const schemas = filterHiddenSchemas(
|
|
1730
|
+
const schemas = filterHiddenSchemas(step33.schemas);
|
|
1731
1731
|
if ((schemas == null ? void 0 : schemas.length) !== 1) {
|
|
1732
1732
|
return false;
|
|
1733
1733
|
}
|
|
@@ -1749,8 +1749,8 @@ var filterHiddenSchemas = (schemas) => {
|
|
|
1749
1749
|
return (schema2 == null ? void 0 : schema2.hidden) !== true;
|
|
1750
1750
|
});
|
|
1751
1751
|
};
|
|
1752
|
-
var getStepType = (
|
|
1753
|
-
if (isCameraStep(
|
|
1752
|
+
var getStepType = (step33) => {
|
|
1753
|
+
if (isCameraStep(step33)) {
|
|
1754
1754
|
return stepType.CAMERA;
|
|
1755
1755
|
}
|
|
1756
1756
|
return stepType.LAYOUT;
|
|
@@ -2994,7 +2994,7 @@ var _FormControl = class extends import_react13.PureComponent {
|
|
|
2994
2994
|
const {
|
|
2995
2995
|
name,
|
|
2996
2996
|
placeholder,
|
|
2997
|
-
step:
|
|
2997
|
+
step: step33,
|
|
2998
2998
|
countryCode,
|
|
2999
2999
|
type,
|
|
3000
3000
|
options,
|
|
@@ -3102,7 +3102,7 @@ var _FormControl = class extends import_react13.PureComponent {
|
|
|
3102
3102
|
placeholder,
|
|
3103
3103
|
readOnly,
|
|
3104
3104
|
required,
|
|
3105
|
-
step:
|
|
3105
|
+
step: step33,
|
|
3106
3106
|
type: "number",
|
|
3107
3107
|
value: getSafeStringOrNumberValue(value, { coerceValue: true }),
|
|
3108
3108
|
onBlur: this.handleOnBlur,
|
|
@@ -3318,52 +3318,30 @@ FormControl.defaultProps = {
|
|
|
3318
3318
|
// src/jsonSchemaForm/schemaFormControl/utils/mapping-utils.tsx
|
|
3319
3319
|
var import_components9 = require("@transferwise/components");
|
|
3320
3320
|
|
|
3321
|
-
// src/layout/icon/
|
|
3322
|
-
var icons = __toESM(require("@transferwise/icons"));
|
|
3321
|
+
// src/layout/icon/FlagIcon.tsx
|
|
3323
3322
|
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
3324
|
-
var
|
|
3325
|
-
|
|
3326
|
-
if (!
|
|
3327
|
-
return
|
|
3323
|
+
var isFlagIcon = (name) => availableCurrencyFlags.some((currencyCode) => name === `flag-${currencyCode}`);
|
|
3324
|
+
var FlagIcon = ({ name }) => {
|
|
3325
|
+
if (!isFlagIcon(name)) {
|
|
3326
|
+
return null;
|
|
3328
3327
|
}
|
|
3329
|
-
const
|
|
3330
|
-
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
3331
|
-
|
|
3332
|
-
|
|
3333
|
-
|
|
3334
|
-
|
|
3335
|
-
|
|
3336
|
-
var _a;
|
|
3337
|
-
return `${(_a = value[0]) == null ? void 0 : _a.toUpperCase()}${value.slice(1)}`;
|
|
3338
|
-
}
|
|
3339
|
-
function isValidIconName(name) {
|
|
3340
|
-
const iconName = toCapitalisedCamelCase(name);
|
|
3341
|
-
return Object.keys(icons).includes(iconName);
|
|
3342
|
-
}
|
|
3343
|
-
var DynamicIcon_default = DynamicIcon;
|
|
3344
|
-
|
|
3345
|
-
// src/jsonSchemaForm/schemaFormControl/utils/currency-utils.ts
|
|
3346
|
-
function getCurrencyFlag(iconName) {
|
|
3347
|
-
if (iconName) {
|
|
3348
|
-
const index = availablePrefixedCurrencyFlags.indexOf(iconName);
|
|
3349
|
-
if (index >= 0) {
|
|
3350
|
-
return {
|
|
3351
|
-
currency: availableCurrencyFlags[index]
|
|
3352
|
-
};
|
|
3328
|
+
const currencyCode = name.substring(5);
|
|
3329
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
3330
|
+
"img",
|
|
3331
|
+
{
|
|
3332
|
+
src: `https://wise.com/web-art/assets/flags/${currencyCode}.svg`,
|
|
3333
|
+
alt: "",
|
|
3334
|
+
"data-testid": `img-flag-${currencyCode}`
|
|
3353
3335
|
}
|
|
3354
|
-
|
|
3355
|
-
|
|
3356
|
-
}
|
|
3336
|
+
);
|
|
3337
|
+
};
|
|
3357
3338
|
var availableCurrencyFlags = [
|
|
3358
|
-
"eur",
|
|
3359
|
-
"gbp",
|
|
3360
|
-
"inr",
|
|
3361
|
-
"usd",
|
|
3362
3339
|
"aed",
|
|
3363
3340
|
"ars",
|
|
3364
3341
|
"aud",
|
|
3365
3342
|
"bdt",
|
|
3366
3343
|
"bgn",
|
|
3344
|
+
"bnd",
|
|
3367
3345
|
"brl",
|
|
3368
3346
|
"bwp",
|
|
3369
3347
|
"cad",
|
|
@@ -3375,7 +3353,9 @@ var availableCurrencyFlags = [
|
|
|
3375
3353
|
"czk",
|
|
3376
3354
|
"dkk",
|
|
3377
3355
|
"egp",
|
|
3356
|
+
"eur",
|
|
3378
3357
|
"fjd",
|
|
3358
|
+
"gbp",
|
|
3379
3359
|
"gel",
|
|
3380
3360
|
"ghs",
|
|
3381
3361
|
"hkd",
|
|
@@ -3383,10 +3363,14 @@ var availableCurrencyFlags = [
|
|
|
3383
3363
|
"huf",
|
|
3384
3364
|
"idr",
|
|
3385
3365
|
"ils",
|
|
3366
|
+
"imp",
|
|
3367
|
+
"inr",
|
|
3386
3368
|
"jpy",
|
|
3387
3369
|
"kes",
|
|
3388
3370
|
"krw",
|
|
3371
|
+
"lak",
|
|
3389
3372
|
"lkr",
|
|
3373
|
+
"lsl",
|
|
3390
3374
|
"mad",
|
|
3391
3375
|
"mxn",
|
|
3392
3376
|
"myr",
|
|
@@ -3396,6 +3380,7 @@ var availableCurrencyFlags = [
|
|
|
3396
3380
|
"nok",
|
|
3397
3381
|
"npr",
|
|
3398
3382
|
"nzd",
|
|
3383
|
+
"pab",
|
|
3399
3384
|
"pen",
|
|
3400
3385
|
"php",
|
|
3401
3386
|
"pkr",
|
|
@@ -3405,20 +3390,58 @@ var availableCurrencyFlags = [
|
|
|
3405
3390
|
"sek",
|
|
3406
3391
|
"sgd",
|
|
3407
3392
|
"thb",
|
|
3393
|
+
"tmt",
|
|
3408
3394
|
"try",
|
|
3409
3395
|
"tzs",
|
|
3410
3396
|
"uah",
|
|
3411
3397
|
"ugx",
|
|
3398
|
+
"usd",
|
|
3412
3399
|
"uyu",
|
|
3413
3400
|
"vnd",
|
|
3414
3401
|
"xof",
|
|
3415
3402
|
"zar",
|
|
3416
3403
|
"zmw"
|
|
3417
3404
|
];
|
|
3418
|
-
var availablePrefixedCurrencyFlags = availableCurrencyFlags.map((code) => `flag-${code}`);
|
|
3419
3405
|
|
|
3420
|
-
// src/
|
|
3406
|
+
// src/layout/icon/NamedIcon.tsx
|
|
3407
|
+
var icons = __toESM(require("@transferwise/icons"));
|
|
3421
3408
|
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
3409
|
+
var isNamedIcon = (name) => {
|
|
3410
|
+
const iconName = toCapitalisedCamelCase(name);
|
|
3411
|
+
return Object.keys(icons).includes(iconName);
|
|
3412
|
+
};
|
|
3413
|
+
var NamedIcon = ({ name }) => {
|
|
3414
|
+
if (!isNamedIcon(name)) {
|
|
3415
|
+
return null;
|
|
3416
|
+
}
|
|
3417
|
+
const iconName = toCapitalisedCamelCase(name);
|
|
3418
|
+
const Icon = icons[iconName];
|
|
3419
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Icon, { size: 24 });
|
|
3420
|
+
};
|
|
3421
|
+
var toCapitalisedCamelCase = (value) => value.split("-").map(capitaliseFirstChar).join("");
|
|
3422
|
+
var capitaliseFirstChar = (value) => {
|
|
3423
|
+
var _a;
|
|
3424
|
+
return `${(_a = value[0]) == null ? void 0 : _a.toUpperCase()}${value.slice(1)}`;
|
|
3425
|
+
};
|
|
3426
|
+
|
|
3427
|
+
// src/layout/icon/DynamicIcon.tsx
|
|
3428
|
+
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
3429
|
+
var DynamicIcon = ({ type }) => {
|
|
3430
|
+
if (isFlagIcon(type)) {
|
|
3431
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(FlagIcon, { name: type });
|
|
3432
|
+
}
|
|
3433
|
+
if (isNamedIcon(type)) {
|
|
3434
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(NamedIcon, { name: type });
|
|
3435
|
+
}
|
|
3436
|
+
return null;
|
|
3437
|
+
};
|
|
3438
|
+
function isValidIconName(name) {
|
|
3439
|
+
return isNamedIcon(name) || isFlagIcon(name);
|
|
3440
|
+
}
|
|
3441
|
+
var DynamicIcon_default = DynamicIcon;
|
|
3442
|
+
|
|
3443
|
+
// src/jsonSchemaForm/schemaFormControl/utils/mapping-utils.tsx
|
|
3444
|
+
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
3422
3445
|
var mapConstSchemaToOption = (schema2, controlType) => {
|
|
3423
3446
|
switch (controlType) {
|
|
3424
3447
|
case "select":
|
|
@@ -3429,56 +3452,58 @@ var mapConstSchemaToOption = (schema2, controlType) => {
|
|
|
3429
3452
|
}
|
|
3430
3453
|
};
|
|
3431
3454
|
var mapConstSchemaToRadioOption = (schema2) => {
|
|
3432
|
-
return __spreadValues(__spreadValues(__spreadValues(
|
|
3455
|
+
return __spreadValues(__spreadValues(__spreadValues({
|
|
3433
3456
|
// TODO: LOW avoid type assertion -- using || '' would fail some tests
|
|
3434
3457
|
label: schema2.title,
|
|
3435
3458
|
value: schema2.const
|
|
3436
|
-
}, getOptionDescription(schema2.title, schema2.description)),
|
|
3459
|
+
}, getOptionDescription(schema2.title, schema2.description)), getAvatarPropertyForRadioOption(schema2)), getDisabled(schema2.disabled));
|
|
3437
3460
|
};
|
|
3438
3461
|
var mapConstSchemaToSelectOption = (schema2) => {
|
|
3439
|
-
return __spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(
|
|
3462
|
+
return __spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues({
|
|
3440
3463
|
// TODO: LOW avoid type assertion -- using || '' would fail some tests
|
|
3441
3464
|
label: schema2.title,
|
|
3442
3465
|
value: schema2.const
|
|
3443
|
-
}, getOptionDescription(schema2.title, schema2.description)),
|
|
3466
|
+
}, getOptionDescription(schema2.title, schema2.description)), getIconPropertyForSelectOption(schema2.icon)), mapImage(schema2.image)), getDisabled(schema2.disabled)), mapKeywordsToSearchStrings(schema2.keywords));
|
|
3444
3467
|
};
|
|
3445
|
-
var mapCurrency = (icon) => icon ? getCurrencyFlag(icon.name) : null;
|
|
3446
3468
|
var mapKeywordsToSearchStrings = (searchStrings) => isArray(searchStrings) ? { searchStrings } : {};
|
|
3447
3469
|
var mapImage = (image) => {
|
|
3448
3470
|
if (image == null ? void 0 : image.url) {
|
|
3449
3471
|
return {
|
|
3450
|
-
icon: /* @__PURE__ */ (0,
|
|
3472
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "media", children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "np-option__no-media-circle", children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("img", { src: image.url, alt: image.name || "" }) }) })
|
|
3451
3473
|
};
|
|
3452
3474
|
}
|
|
3453
3475
|
return null;
|
|
3454
3476
|
};
|
|
3455
|
-
var
|
|
3477
|
+
var getIconPropertyForSelectOption = (icon) => {
|
|
3478
|
+
if ((icon == null ? void 0 : icon.name) && isFlagIcon(icon.name)) {
|
|
3479
|
+
return { currency: icon.name.substring(5) };
|
|
3480
|
+
}
|
|
3456
3481
|
if ((icon == null ? void 0 : icon.name) && isValidIconName(icon.name)) {
|
|
3457
|
-
return { icon: /* @__PURE__ */ (0,
|
|
3482
|
+
return { icon: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(DynamicIcon_default, { type: icon.name }) };
|
|
3458
3483
|
}
|
|
3459
3484
|
if (icon == null ? void 0 : icon.text) {
|
|
3460
|
-
return { icon: /* @__PURE__ */ (0,
|
|
3485
|
+
return { icon: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { children: icon.text }) };
|
|
3461
3486
|
}
|
|
3462
3487
|
return null;
|
|
3463
3488
|
};
|
|
3464
|
-
var
|
|
3489
|
+
var getAvatarPropertyForRadioOption = ({ image, icon }) => {
|
|
3490
|
+
if (image == null ? void 0 : image.url) {
|
|
3491
|
+
return {
|
|
3492
|
+
avatar: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_components9.Avatar, { type: import_components9.AvatarType.THUMBNAIL, children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("img", { src: image.url, alt: "" }) })
|
|
3493
|
+
};
|
|
3494
|
+
}
|
|
3465
3495
|
if ((icon == null ? void 0 : icon.name) && isValidIconName(icon.name)) {
|
|
3466
3496
|
return {
|
|
3467
|
-
avatar: /* @__PURE__ */ (0,
|
|
3497
|
+
avatar: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_components9.Avatar, { type: import_components9.AvatarType.ICON, children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(DynamicIcon_default, { type: icon.name }) })
|
|
3468
3498
|
};
|
|
3469
3499
|
}
|
|
3470
3500
|
if (icon == null ? void 0 : icon.text) {
|
|
3471
3501
|
return {
|
|
3472
|
-
avatar: /* @__PURE__ */ (0,
|
|
3502
|
+
avatar: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_components9.Avatar, { type: import_components9.AvatarType.INITIALS, children: icon.text })
|
|
3473
3503
|
};
|
|
3474
3504
|
}
|
|
3475
3505
|
return null;
|
|
3476
3506
|
};
|
|
3477
|
-
var mapAvatar = (image) => {
|
|
3478
|
-
return image && image.url ? {
|
|
3479
|
-
avatar: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_components9.Avatar, { type: import_components9.AvatarType.THUMBNAIL, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("img", { src: image.url, alt: "User avatar" }) })
|
|
3480
|
-
} : null;
|
|
3481
|
-
};
|
|
3482
3507
|
var mapSchemaToUploadOptions = ({ accepts }) => __spreadValues({}, isArray(accepts) && { usAccept: accepts.join(",") });
|
|
3483
3508
|
var getOptionDescription = (title, description) => {
|
|
3484
3509
|
if (title && description) {
|
|
@@ -3495,7 +3520,7 @@ var getDisabled = (disabled) => {
|
|
|
3495
3520
|
};
|
|
3496
3521
|
|
|
3497
3522
|
// src/jsonSchemaForm/schemaFormControl/SchemaFormControl.tsx
|
|
3498
|
-
var
|
|
3523
|
+
var import_jsx_runtime24 = require("react/jsx-runtime");
|
|
3499
3524
|
var isNativeInput = (propsSchemaType) => {
|
|
3500
3525
|
return propsSchemaType === "string" || propsSchemaType === "number";
|
|
3501
3526
|
};
|
|
@@ -3580,7 +3605,7 @@ var SchemaFormControl = (props) => {
|
|
|
3580
3605
|
// TODO: LOW avoid type assertion below
|
|
3581
3606
|
uploadProps: mapSchemaToUploadOptions(props.schema)
|
|
3582
3607
|
};
|
|
3583
|
-
return /* @__PURE__ */ (0,
|
|
3608
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(FormControl, __spreadValues(__spreadValues({ type: controlType, value: safeValue }, events), controlProps));
|
|
3584
3609
|
};
|
|
3585
3610
|
SchemaFormControl.defaultProps = {
|
|
3586
3611
|
value: null,
|
|
@@ -3651,7 +3676,7 @@ function getSchemaProperties(childSchema) {
|
|
|
3651
3676
|
}
|
|
3652
3677
|
|
|
3653
3678
|
// src/jsonSchemaForm/oneOfSchema/OneOfSchema.tsx
|
|
3654
|
-
var
|
|
3679
|
+
var import_jsx_runtime25 = require("react/jsx-runtime");
|
|
3655
3680
|
var OneOfSchema5 = (props) => {
|
|
3656
3681
|
const onEvent = useEventDispatcher();
|
|
3657
3682
|
const [changed, setChanged] = (0, import_react14.useState)(false);
|
|
@@ -3724,11 +3749,11 @@ var OneOfSchema5 = (props) => {
|
|
|
3724
3749
|
"form-group": true,
|
|
3725
3750
|
"has-error": !changed && props.errors && !isEmpty(props.errors) || (props.submitted || changed && blurred) && validations.length
|
|
3726
3751
|
};
|
|
3727
|
-
return /* @__PURE__ */ (0,
|
|
3728
|
-
(props.schema.oneOf.length > 1 || isConstSchema(props.schema.oneOf[0])) && /* @__PURE__ */ (0,
|
|
3729
|
-
/* @__PURE__ */ (0,
|
|
3752
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(import_jsx_runtime25.Fragment, { children: [
|
|
3753
|
+
(props.schema.oneOf.length > 1 || isConstSchema(props.schema.oneOf[0])) && /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(import_jsx_runtime25.Fragment, { children: [
|
|
3754
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: (0, import_classnames4.default)(formGroupClasses), children: [
|
|
3730
3755
|
getTitleAndHelp(props.schema, id),
|
|
3731
|
-
/* @__PURE__ */ (0,
|
|
3756
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
3732
3757
|
SchemaFormControl_default,
|
|
3733
3758
|
{
|
|
3734
3759
|
id,
|
|
@@ -3741,7 +3766,7 @@ var OneOfSchema5 = (props) => {
|
|
|
3741
3766
|
onSearchChange
|
|
3742
3767
|
}
|
|
3743
3768
|
),
|
|
3744
|
-
/* @__PURE__ */ (0,
|
|
3769
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
3745
3770
|
ControlFeedback_default,
|
|
3746
3771
|
{
|
|
3747
3772
|
changed,
|
|
@@ -3755,9 +3780,9 @@ var OneOfSchema5 = (props) => {
|
|
|
3755
3780
|
}
|
|
3756
3781
|
)
|
|
3757
3782
|
] }),
|
|
3758
|
-
props.schema.alert && /* @__PURE__ */ (0,
|
|
3783
|
+
props.schema.alert && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(DynamicAlert_default, { component: props.schema.alert })
|
|
3759
3784
|
] }),
|
|
3760
|
-
isNoNConstSchema(props.schema.oneOf[schemaIndex]) && /* @__PURE__ */ (0,
|
|
3785
|
+
isNoNConstSchema(props.schema.oneOf[schemaIndex]) && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
3761
3786
|
GenericSchema_default,
|
|
3762
3787
|
{
|
|
3763
3788
|
schema: props.schema.oneOf[schemaIndex],
|
|
@@ -3773,12 +3798,12 @@ var OneOfSchema5 = (props) => {
|
|
|
3773
3798
|
] });
|
|
3774
3799
|
};
|
|
3775
3800
|
function getTitleAndHelp(schema2, id) {
|
|
3776
|
-
const helpElement = schema2.help ? /* @__PURE__ */ (0,
|
|
3777
|
-
const titleElement = isConstSchema(schema2.oneOf[0]) ? /* @__PURE__ */ (0,
|
|
3801
|
+
const helpElement = schema2.help ? /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Help_default, { help: schema2.help }) : null;
|
|
3802
|
+
const titleElement = isConstSchema(schema2.oneOf[0]) ? /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("label", { className: "control-label d-inline", htmlFor: id, children: [
|
|
3778
3803
|
schema2.title,
|
|
3779
3804
|
" ",
|
|
3780
3805
|
helpElement
|
|
3781
|
-
] }) : /* @__PURE__ */ (0,
|
|
3806
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("h4", { className: "m-b-2", children: [
|
|
3782
3807
|
schema2.title,
|
|
3783
3808
|
" ",
|
|
3784
3809
|
helpElement
|
|
@@ -3824,7 +3849,7 @@ var import_react16 = require("react");
|
|
|
3824
3849
|
// src/jsonSchemaForm/persistAsyncSchema/persistAsyncBlobSchema/UploadInputAdapter.tsx
|
|
3825
3850
|
var import_components10 = require("@transferwise/components");
|
|
3826
3851
|
var import_react15 = require("react");
|
|
3827
|
-
var
|
|
3852
|
+
var import_jsx_runtime26 = require("react/jsx-runtime");
|
|
3828
3853
|
var UploadInputAdapter = (props) => {
|
|
3829
3854
|
const {
|
|
3830
3855
|
id,
|
|
@@ -3858,7 +3883,7 @@ var UploadInputAdapter = (props) => {
|
|
|
3858
3883
|
}
|
|
3859
3884
|
});
|
|
3860
3885
|
};
|
|
3861
|
-
return /* @__PURE__ */ (0,
|
|
3886
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
3862
3887
|
import_components10.UploadInput,
|
|
3863
3888
|
{
|
|
3864
3889
|
id,
|
|
@@ -3878,7 +3903,7 @@ var UploadInputAdapter = (props) => {
|
|
|
3878
3903
|
};
|
|
3879
3904
|
|
|
3880
3905
|
// src/jsonSchemaForm/persistAsyncSchema/persistAsyncBlobSchema/PersistAsyncBlobSchema.tsx
|
|
3881
|
-
var
|
|
3906
|
+
var import_jsx_runtime27 = require("react/jsx-runtime");
|
|
3882
3907
|
var PersistAsyncBlobSchema = (props) => {
|
|
3883
3908
|
const [persistAsyncValidationMessages, setPersistAsyncValidationMessages] = (0, import_react16.useState)({});
|
|
3884
3909
|
const [persistAsyncValidations, setPersistAsyncValidations] = (0, import_react16.useState)(null);
|
|
@@ -3920,8 +3945,8 @@ var PersistAsyncBlobSchema = (props) => {
|
|
|
3920
3945
|
"form-group": true,
|
|
3921
3946
|
"has-error": (props.submitted || changed) && !!combinedValidations.length
|
|
3922
3947
|
};
|
|
3923
|
-
return /* @__PURE__ */ (0,
|
|
3924
|
-
/* @__PURE__ */ (0,
|
|
3948
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: (0, import_classnames5.default)(formGroupClasses), children: [
|
|
3949
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
3925
3950
|
UploadInputAdapter,
|
|
3926
3951
|
__spreadValues({
|
|
3927
3952
|
id: props.schema.$id || props.schema.persistAsync.schema.$id || props.schema.persistAsync.idProperty,
|
|
@@ -3938,7 +3963,7 @@ var PersistAsyncBlobSchema = (props) => {
|
|
|
3938
3963
|
onCancel
|
|
3939
3964
|
}, mapSchemaToUploadOptions(props.schema.persistAsync.schema))
|
|
3940
3965
|
),
|
|
3941
|
-
/* @__PURE__ */ (0,
|
|
3966
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
3942
3967
|
ControlFeedback_default,
|
|
3943
3968
|
{
|
|
3944
3969
|
blurred: true,
|
|
@@ -3962,17 +3987,17 @@ PersistAsyncBlobSchema.defaultProps = {
|
|
|
3962
3987
|
var PersistAsyncBlobSchema_default = PersistAsyncBlobSchema;
|
|
3963
3988
|
|
|
3964
3989
|
// src/jsonSchemaForm/persistAsyncSchema/PersistAsyncSchema.tsx
|
|
3965
|
-
var
|
|
3990
|
+
var import_jsx_runtime28 = require("react/jsx-runtime");
|
|
3966
3991
|
var PersistAsyncSchema = (props) => {
|
|
3967
3992
|
const { schema: schema2 } = props;
|
|
3968
3993
|
const persistAsyncSchemaType = schema2.persistAsync.schema.type;
|
|
3969
3994
|
if (persistAsyncSchemaType === "blob") {
|
|
3970
|
-
return /* @__PURE__ */ (0,
|
|
3995
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
3971
3996
|
PersistAsyncBlobSchema_default,
|
|
3972
3997
|
__spreadValues({}, props)
|
|
3973
3998
|
);
|
|
3974
3999
|
}
|
|
3975
|
-
return /* @__PURE__ */ (0,
|
|
4000
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(PersistAsyncBasicSchema_default, __spreadValues({}, props));
|
|
3976
4001
|
};
|
|
3977
4002
|
PersistAsyncSchema.defaultProps = {
|
|
3978
4003
|
required: false
|
|
@@ -3993,7 +4018,7 @@ var getSelectionFromModel = (schema2, model) => {
|
|
|
3993
4018
|
|
|
3994
4019
|
// src/jsonSchemaForm/promotedOneOfSchema/promotedOneOfControl/PromotedOneOfCheckboxControl.tsx
|
|
3995
4020
|
var import_components11 = require("@transferwise/components");
|
|
3996
|
-
var
|
|
4021
|
+
var import_jsx_runtime29 = require("react/jsx-runtime");
|
|
3997
4022
|
var PromotedOneOfCheckboxControl = (props) => {
|
|
3998
4023
|
const { id, selection, setSelection } = props;
|
|
3999
4024
|
const { promoted, other, checkedMeans } = props.promotion;
|
|
@@ -4004,33 +4029,33 @@ var PromotedOneOfCheckboxControl = (props) => {
|
|
|
4004
4029
|
const toggleSelection = () => {
|
|
4005
4030
|
setSelection(checked ? selectionWhenUnchecked : selectionWhenChecked);
|
|
4006
4031
|
};
|
|
4007
|
-
return /* @__PURE__ */ (0,
|
|
4032
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { className: "form-group", children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_components11.Checkbox, { id, label: title, checked, onChange: toggleSelection }) });
|
|
4008
4033
|
};
|
|
4009
4034
|
PromotedOneOfCheckboxControl.defaultProps = {};
|
|
4010
4035
|
var PromotedOneOfCheckboxControl_default = PromotedOneOfCheckboxControl;
|
|
4011
4036
|
|
|
4012
4037
|
// src/jsonSchemaForm/promotedOneOfSchema/promotedOneOfControl/PromotedOneOfRadioControl.tsx
|
|
4013
4038
|
var import_components12 = require("@transferwise/components");
|
|
4014
|
-
var
|
|
4039
|
+
var import_jsx_runtime30 = require("react/jsx-runtime");
|
|
4015
4040
|
var PromotedOneOfRadioControl = (props) => {
|
|
4016
4041
|
var _a, _b;
|
|
4017
4042
|
const { id, selection, setSelection, promotion, promotedOneOf, title } = props;
|
|
4018
4043
|
const radios = [
|
|
4019
|
-
__spreadValues(
|
|
4044
|
+
__spreadValues({
|
|
4020
4045
|
value: "promoted",
|
|
4021
4046
|
// TODO: LOW avoid type assertion below the expression may be nullish, but "label" cannot be
|
|
4022
4047
|
label: ((_a = promotion.promoted) == null ? void 0 : _a.title) || promotedOneOf.title,
|
|
4023
4048
|
secondary: ((_b = promotion.promoted) == null ? void 0 : _b.description) || promotedOneOf.description
|
|
4024
|
-
},
|
|
4025
|
-
__spreadValues(
|
|
4049
|
+
}, getAvatarPropertyForRadioOption(promotedOneOf)),
|
|
4050
|
+
__spreadValues({
|
|
4026
4051
|
value: "other",
|
|
4027
4052
|
label: promotion.other.title,
|
|
4028
4053
|
secondary: promotion.other.description
|
|
4029
|
-
},
|
|
4054
|
+
}, getAvatarPropertyForRadioOption(promotion.other))
|
|
4030
4055
|
];
|
|
4031
|
-
return /* @__PURE__ */ (0,
|
|
4032
|
-
title && /* @__PURE__ */ (0,
|
|
4033
|
-
/* @__PURE__ */ (0,
|
|
4056
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: "form-group", children: [
|
|
4057
|
+
title && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("label", { className: "control-label", htmlFor: id, children: title }),
|
|
4058
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
4034
4059
|
import_components12.RadioGroup,
|
|
4035
4060
|
{
|
|
4036
4061
|
name: "promoted-selection",
|
|
@@ -4048,16 +4073,16 @@ PromotedOneOfRadioControl.defaultProps = {
|
|
|
4048
4073
|
var PromotedOneOfRadioControl_default = PromotedOneOfRadioControl;
|
|
4049
4074
|
|
|
4050
4075
|
// src/jsonSchemaForm/promotedOneOfSchema/promotedOneOfControl/PromotedOneOfControl.tsx
|
|
4051
|
-
var
|
|
4076
|
+
var import_jsx_runtime31 = require("react/jsx-runtime");
|
|
4052
4077
|
var PromotedOneOfControl = (props) => {
|
|
4053
4078
|
const controlType = props.promotion.control || "radio";
|
|
4054
4079
|
switch (controlType) {
|
|
4055
4080
|
case "radio":
|
|
4056
|
-
return /* @__PURE__ */ (0,
|
|
4081
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(PromotedOneOfRadioControl_default, __spreadValues({}, props));
|
|
4057
4082
|
case "checkbox":
|
|
4058
|
-
return /* @__PURE__ */ (0,
|
|
4083
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(PromotedOneOfCheckboxControl_default, __spreadValues({}, props));
|
|
4059
4084
|
default:
|
|
4060
|
-
return /* @__PURE__ */ (0,
|
|
4085
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_jsx_runtime31.Fragment, {});
|
|
4061
4086
|
}
|
|
4062
4087
|
};
|
|
4063
4088
|
PromotedOneOfControl.defaultProps = {
|
|
@@ -4067,7 +4092,7 @@ PromotedOneOfControl.defaultProps = {
|
|
|
4067
4092
|
var PromotedOneOfControl_default = PromotedOneOfControl;
|
|
4068
4093
|
|
|
4069
4094
|
// src/jsonSchemaForm/promotedOneOfSchema/PromotedOneOfSchema.tsx
|
|
4070
|
-
var
|
|
4095
|
+
var import_jsx_runtime32 = require("react/jsx-runtime");
|
|
4071
4096
|
var isPromoted = (schema2) => schema2.promoted === true;
|
|
4072
4097
|
var PromotedOneOfSchema = (props) => {
|
|
4073
4098
|
var _a;
|
|
@@ -4078,9 +4103,9 @@ var PromotedOneOfSchema = (props) => {
|
|
|
4078
4103
|
const promotedOneOf = props.schema.oneOf.find(isPromoted);
|
|
4079
4104
|
const promotedObjectSchema = getPromotedObjectSchema(promotedOneOf);
|
|
4080
4105
|
const otherOneOf = getOtherOneOf(props.schema);
|
|
4081
|
-
return /* @__PURE__ */ (0,
|
|
4082
|
-
promotedAlert && /* @__PURE__ */ (0,
|
|
4083
|
-
/* @__PURE__ */ (0,
|
|
4106
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(import_jsx_runtime32.Fragment, { children: [
|
|
4107
|
+
promotedAlert && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(DynamicAlert_default, { component: promotedAlert }),
|
|
4108
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
4084
4109
|
PromotedOneOfControl_default,
|
|
4085
4110
|
{
|
|
4086
4111
|
id: props.schema.$id,
|
|
@@ -4091,8 +4116,8 @@ var PromotedOneOfSchema = (props) => {
|
|
|
4091
4116
|
setSelection
|
|
4092
4117
|
}
|
|
4093
4118
|
),
|
|
4094
|
-
selection === "promoted" && /* @__PURE__ */ (0,
|
|
4095
|
-
selection === "other" && /* @__PURE__ */ (0,
|
|
4119
|
+
selection === "promoted" && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(ObjectSchema_default, __spreadProps(__spreadValues({}, props), { schema: promotedObjectSchema })),
|
|
4120
|
+
selection === "other" && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(GenericSchema_default, __spreadProps(__spreadValues({}, props), { schema: otherOneOf }))
|
|
4096
4121
|
] });
|
|
4097
4122
|
};
|
|
4098
4123
|
function getPromotedObjectSchema(promotedSchema) {
|
|
@@ -4141,12 +4166,12 @@ var ReadOnlySchema_messages_default = (0, import_react_intl11.defineMessages)({
|
|
|
4141
4166
|
});
|
|
4142
4167
|
|
|
4143
4168
|
// src/jsonSchemaForm/readOnlySchema/ReadOnlySchema.tsx
|
|
4144
|
-
var
|
|
4169
|
+
var import_jsx_runtime33 = require("react/jsx-runtime");
|
|
4145
4170
|
var ReadOnlySchema = ({ schema: schema2, model }) => {
|
|
4146
4171
|
const { title = "" } = schema2;
|
|
4147
4172
|
const { formatMessage } = (0, import_react_intl12.useIntl)();
|
|
4148
4173
|
const value = getValueForSchema({ schema: schema2, model, formatMessage });
|
|
4149
|
-
return /* @__PURE__ */ (0,
|
|
4174
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_components13.DefinitionList, { layout: import_components13.Layout.VERTICAL_ONE_COLUMN, definitions: [{ title, value, key: "" }] });
|
|
4150
4175
|
};
|
|
4151
4176
|
var ReadOnlySchema_default = ReadOnlySchema;
|
|
4152
4177
|
function getValueForSchema({
|
|
@@ -4178,22 +4203,17 @@ function getSelectedOneOf(schema2, model) {
|
|
|
4178
4203
|
}
|
|
4179
4204
|
function getValueFromOption(option) {
|
|
4180
4205
|
const text = option.title && option.description ? `${option.title} - ${option.description}` : option.title || "";
|
|
4181
|
-
const
|
|
4182
|
-
return
|
|
4183
|
-
|
|
4206
|
+
const icon = getAvatarPropertyForRadioOption({ icon: option.icon });
|
|
4207
|
+
return (icon == null ? void 0 : icon.avatar) ? /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(import_jsx_runtime33.Fragment, { children: [
|
|
4208
|
+
icon.avatar,
|
|
4184
4209
|
" ",
|
|
4185
4210
|
text
|
|
4186
4211
|
] }) : text;
|
|
4187
4212
|
}
|
|
4188
|
-
function getCurrencyFlagFromOption(option) {
|
|
4189
|
-
var _a, _b;
|
|
4190
|
-
const currency = (_b = getCurrencyFlag((_a = option.icon) == null ? void 0 : _a.name)) == null ? void 0 : _b.currency;
|
|
4191
|
-
return currency ? /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("i", { className: `currency-flag currency-flag-${currency} hidden-xs` }) : null;
|
|
4192
|
-
}
|
|
4193
4213
|
|
|
4194
4214
|
// src/jsonSchemaForm/validationAsyncSchema/ValidationAsyncSchema.tsx
|
|
4195
4215
|
var import_react18 = require("react");
|
|
4196
|
-
var
|
|
4216
|
+
var import_jsx_runtime34 = require("react/jsx-runtime");
|
|
4197
4217
|
var ValidationAsyncSchema = (props) => {
|
|
4198
4218
|
const [validationAsyncModel, setValidationAsyncModel] = (0, import_react18.useState)(props.model);
|
|
4199
4219
|
const previousRequestedModelReference = (0, import_react18.useRef)(null);
|
|
@@ -4276,13 +4296,13 @@ var ValidationAsyncSchema = (props) => {
|
|
|
4276
4296
|
onBlur,
|
|
4277
4297
|
infoMessage: validationAsyncSuccessMessage
|
|
4278
4298
|
};
|
|
4279
|
-
return /* @__PURE__ */ (0,
|
|
4299
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(BasicTypeSchema_default, __spreadValues({}, basicTypeSchemaProps));
|
|
4280
4300
|
};
|
|
4281
4301
|
ValidationAsyncSchema.defaultProps = { required: false };
|
|
4282
4302
|
var ValidationAsyncSchema_default = ValidationAsyncSchema;
|
|
4283
4303
|
|
|
4284
4304
|
// src/jsonSchemaForm/genericSchema/GenericSchema.tsx
|
|
4285
|
-
var
|
|
4305
|
+
var import_jsx_runtime35 = require("react/jsx-runtime");
|
|
4286
4306
|
var GenericSchemaForm = (props) => {
|
|
4287
4307
|
const { schema: schema2, model = null, errors = null, hideTitle = false, disabled = false } = props;
|
|
4288
4308
|
const schemaProps = __spreadProps(__spreadValues({}, props), { model, errors, hideTitle, disabled });
|
|
@@ -4294,22 +4314,22 @@ var GenericSchemaForm = (props) => {
|
|
|
4294
4314
|
);
|
|
4295
4315
|
switch (type) {
|
|
4296
4316
|
case "readOnly":
|
|
4297
|
-
return /* @__PURE__ */ (0,
|
|
4317
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(ReadOnlySchema_default, __spreadValues({}, schemaProps));
|
|
4298
4318
|
case "persistAsync":
|
|
4299
4319
|
if (isPersistAsyncSchema(schema2) && isNullableStringModel(model) && isBasicError(errors)) {
|
|
4300
4320
|
const filteredProps = __spreadProps(__spreadValues({}, schemaProps), { schema: schema2, model, errors });
|
|
4301
|
-
return /* @__PURE__ */ (0,
|
|
4321
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(PersistAsyncSchema_default, __spreadValues({}, filteredProps));
|
|
4302
4322
|
} else {
|
|
4303
4323
|
logInvalidSchemaWarning();
|
|
4304
|
-
return /* @__PURE__ */ (0,
|
|
4324
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(PersistAsyncSchema_default, __spreadValues({}, props));
|
|
4305
4325
|
}
|
|
4306
4326
|
case "validationAsync":
|
|
4307
4327
|
if (isValidationAsyncSchema(schema2) && isNullableBasicModel(model) && isBasicError(errors)) {
|
|
4308
4328
|
const filteredProps = __spreadProps(__spreadValues({}, schemaProps), { schema: schema2, model, errors });
|
|
4309
|
-
return /* @__PURE__ */ (0,
|
|
4329
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(ValidationAsyncSchema_default, __spreadValues({}, filteredProps));
|
|
4310
4330
|
} else {
|
|
4311
4331
|
logInvalidSchemaWarning();
|
|
4312
|
-
return /* @__PURE__ */ (0,
|
|
4332
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(ValidationAsyncSchema_default, __spreadValues({}, props));
|
|
4313
4333
|
}
|
|
4314
4334
|
case "basic": {
|
|
4315
4335
|
if (isBasicSchema(schema2) && isNullableBasicModel(model) && isBasicError(errors)) {
|
|
@@ -4320,7 +4340,7 @@ var GenericSchemaForm = (props) => {
|
|
|
4320
4340
|
model,
|
|
4321
4341
|
errors
|
|
4322
4342
|
});
|
|
4323
|
-
return /* @__PURE__ */ (0,
|
|
4343
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(BasicTypeSchema_default, __spreadValues({}, filteredProps));
|
|
4324
4344
|
} else {
|
|
4325
4345
|
const filteredProps = __spreadProps(__spreadValues({
|
|
4326
4346
|
infoMessage: null
|
|
@@ -4330,56 +4350,56 @@ var GenericSchemaForm = (props) => {
|
|
|
4330
4350
|
errors
|
|
4331
4351
|
});
|
|
4332
4352
|
logInvalidSchemaWarning();
|
|
4333
|
-
return /* @__PURE__ */ (0,
|
|
4353
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(BasicTypeSchema_default, __spreadValues({}, filteredProps));
|
|
4334
4354
|
}
|
|
4335
4355
|
}
|
|
4336
4356
|
case "object":
|
|
4337
4357
|
if (isObjectSchema(schema2) && isNullableObjectModel(model)) {
|
|
4338
4358
|
const filteredProps = __spreadProps(__spreadValues({}, schemaProps), { schema: schema2, model, errors });
|
|
4339
|
-
return /* @__PURE__ */ (0,
|
|
4359
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(ObjectSchema_default, __spreadValues({}, filteredProps), JSON.stringify(schema2));
|
|
4340
4360
|
} else {
|
|
4341
4361
|
logInvalidSchemaWarning();
|
|
4342
|
-
return /* @__PURE__ */ (0,
|
|
4362
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(ObjectSchema_default, __spreadValues({}, props));
|
|
4343
4363
|
}
|
|
4344
4364
|
case "array":
|
|
4345
4365
|
if (isArraySchema(schema2) && isNullableArrayModel(model) && isBasicError(errors)) {
|
|
4346
4366
|
const filteredProps = __spreadProps(__spreadValues({}, schemaProps), { schema: schema2, model, errors });
|
|
4347
|
-
return /* @__PURE__ */ (0,
|
|
4367
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(ArraySchema_default, __spreadValues({}, filteredProps));
|
|
4348
4368
|
} else {
|
|
4349
4369
|
logInvalidSchemaWarning();
|
|
4350
|
-
return /* @__PURE__ */ (0,
|
|
4370
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(ArraySchema_default, __spreadValues({}, props));
|
|
4351
4371
|
}
|
|
4352
4372
|
case "promotedOneOf":
|
|
4353
4373
|
if (isOneOfObjectSchema(schema2) && isNullableObjectModel(model)) {
|
|
4354
4374
|
const filteredProps = __spreadProps(__spreadValues({}, schemaProps), { schema: schema2, model, errors });
|
|
4355
|
-
return /* @__PURE__ */ (0,
|
|
4375
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(PromotedOneOfSchema_default, __spreadValues({}, filteredProps));
|
|
4356
4376
|
} else {
|
|
4357
4377
|
logInvalidSchemaWarning();
|
|
4358
|
-
return /* @__PURE__ */ (0,
|
|
4378
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(PromotedOneOfSchema_default, __spreadValues({}, props));
|
|
4359
4379
|
}
|
|
4360
4380
|
case "oneOf":
|
|
4361
4381
|
if (isOneOfSchema(schema2)) {
|
|
4362
4382
|
const filteredProps = __spreadProps(__spreadValues({}, schemaProps), { schema: schema2, model, errors });
|
|
4363
|
-
return /* @__PURE__ */ (0,
|
|
4383
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(OneOfSchema_default, __spreadValues({}, filteredProps));
|
|
4364
4384
|
} else {
|
|
4365
4385
|
logInvalidSchemaWarning();
|
|
4366
|
-
return /* @__PURE__ */ (0,
|
|
4386
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(OneOfSchema_default, __spreadValues({}, props));
|
|
4367
4387
|
}
|
|
4368
4388
|
case "allOf":
|
|
4369
4389
|
if (isAllOfSchema(schema2) && isObjectModel(model)) {
|
|
4370
4390
|
const filteredProps = __spreadProps(__spreadValues({}, schemaProps), { schema: schema2, model, errors });
|
|
4371
|
-
return /* @__PURE__ */ (0,
|
|
4391
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(AllOfSchema_default, __spreadValues({}, filteredProps));
|
|
4372
4392
|
} else {
|
|
4373
4393
|
logInvalidSchemaWarning();
|
|
4374
|
-
return /* @__PURE__ */ (0,
|
|
4394
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(AllOfSchema_default, __spreadValues({}, props));
|
|
4375
4395
|
}
|
|
4376
4396
|
}
|
|
4377
|
-
return /* @__PURE__ */ (0,
|
|
4397
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_jsx_runtime35.Fragment, {});
|
|
4378
4398
|
};
|
|
4379
4399
|
var GenericSchema_default = GenericSchemaForm;
|
|
4380
4400
|
|
|
4381
4401
|
// src/jsonSchemaForm/JsonSchemaForm.tsx
|
|
4382
|
-
var
|
|
4402
|
+
var import_jsx_runtime36 = require("react/jsx-runtime");
|
|
4383
4403
|
var JsonSchemaForm = (props) => {
|
|
4384
4404
|
const schemaProps = __spreadValues({
|
|
4385
4405
|
model: null,
|
|
@@ -4388,26 +4408,26 @@ var JsonSchemaForm = (props) => {
|
|
|
4388
4408
|
baseUrl: ""
|
|
4389
4409
|
}, props);
|
|
4390
4410
|
if (useHasHttpClientProvider() || schemaProps.baseUrl == null) {
|
|
4391
|
-
return /* @__PURE__ */ (0,
|
|
4411
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(GenericSchema_default, __spreadValues({}, schemaProps));
|
|
4392
4412
|
}
|
|
4393
|
-
return /* @__PURE__ */ (0,
|
|
4413
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
4394
4414
|
Providers,
|
|
4395
4415
|
{
|
|
4396
4416
|
baseUrl: schemaProps.baseUrl,
|
|
4397
4417
|
onEvent: schemaProps.onEvent,
|
|
4398
4418
|
onLog: schemaProps.onLog,
|
|
4399
|
-
children: /* @__PURE__ */ (0,
|
|
4419
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(GenericSchema_default, __spreadValues({}, schemaProps))
|
|
4400
4420
|
}
|
|
4401
4421
|
);
|
|
4402
4422
|
};
|
|
4403
4423
|
var JsonSchemaForm_default = JsonSchemaForm;
|
|
4404
4424
|
var Providers = ({ baseUrl, onEvent, onLog, children }) => {
|
|
4405
|
-
return /* @__PURE__ */ (0,
|
|
4425
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(LogProvider, { flowId: "JsonSchemaForm", stepId: "JsonSchemaForm", onLog: onLog != null ? onLog : noop2, children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
4406
4426
|
EventsContextProvider,
|
|
4407
4427
|
{
|
|
4408
4428
|
metadata: { flowId: "JsonSchemaForm", stepId: "JsonSchemaForm" },
|
|
4409
4429
|
onEvent: onEvent != null ? onEvent : noop2,
|
|
4410
|
-
children: /* @__PURE__ */ (0,
|
|
4430
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(HttpClientProviderFromBaseUrl, { baseUrl, children })
|
|
4411
4431
|
}
|
|
4412
4432
|
) });
|
|
4413
4433
|
};
|
|
@@ -4415,11 +4435,11 @@ var noop2 = () => {
|
|
|
4415
4435
|
};
|
|
4416
4436
|
|
|
4417
4437
|
// src/layout/form/DynamicForm.tsx
|
|
4418
|
-
var
|
|
4438
|
+
var import_jsx_runtime37 = require("react/jsx-runtime");
|
|
4419
4439
|
var DynamicForm = (props) => {
|
|
4420
4440
|
const form = props.component;
|
|
4421
4441
|
const formSchema = form.schema;
|
|
4422
|
-
return /* @__PURE__ */ (0,
|
|
4442
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { className: getMarginBottom(form.margin || "md"), children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
4423
4443
|
JsonSchemaForm_default,
|
|
4424
4444
|
{
|
|
4425
4445
|
schema: formSchema,
|
|
@@ -4436,38 +4456,38 @@ var DynamicForm = (props) => {
|
|
|
4436
4456
|
var DynamicForm_default = DynamicForm;
|
|
4437
4457
|
|
|
4438
4458
|
// src/layout/heading/DynamicHeading.tsx
|
|
4439
|
-
var
|
|
4459
|
+
var import_jsx_runtime38 = require("react/jsx-runtime");
|
|
4440
4460
|
var DynamicHeading = (props) => {
|
|
4441
4461
|
const { text, size = "md", align = "left", margin = "md" } = props.component;
|
|
4442
4462
|
const classes = getTextAlignmentAndMargin({ align, margin });
|
|
4443
4463
|
switch (size) {
|
|
4444
4464
|
case "xs":
|
|
4445
|
-
return /* @__PURE__ */ (0,
|
|
4465
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("h5", { className: classes, children: text });
|
|
4446
4466
|
case "sm":
|
|
4447
|
-
return /* @__PURE__ */ (0,
|
|
4467
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("h4", { className: classes, children: text });
|
|
4448
4468
|
case "lg":
|
|
4449
|
-
return /* @__PURE__ */ (0,
|
|
4469
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("h2", { className: classes, children: text });
|
|
4450
4470
|
case "xl":
|
|
4451
|
-
return /* @__PURE__ */ (0,
|
|
4471
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("h1", { className: classes, children: text });
|
|
4452
4472
|
case "md":
|
|
4453
4473
|
default:
|
|
4454
|
-
return /* @__PURE__ */ (0,
|
|
4474
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("h3", { className: classes, children: text });
|
|
4455
4475
|
}
|
|
4456
4476
|
};
|
|
4457
4477
|
var DynamicHeading_default = DynamicHeading;
|
|
4458
4478
|
|
|
4459
4479
|
// src/layout/info/DynamicInfo.tsx
|
|
4460
4480
|
var import_components14 = require("@transferwise/components");
|
|
4461
|
-
var
|
|
4481
|
+
var import_jsx_runtime39 = require("react/jsx-runtime");
|
|
4462
4482
|
var DynamicInfo = ({ component }) => {
|
|
4463
|
-
return /* @__PURE__ */ (0,
|
|
4483
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("div", { className: getTextAlignmentAndMargin(component), children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_components14.Markdown, { config: { link: { target: "_blank" } }, children: component.markdown }) });
|
|
4464
4484
|
};
|
|
4465
4485
|
var DynamicInfo_default = DynamicInfo;
|
|
4466
4486
|
|
|
4467
4487
|
// src/layout/image/DynamicImage.tsx
|
|
4468
4488
|
var import_components15 = require("@transferwise/components");
|
|
4469
4489
|
var import_react19 = require("react");
|
|
4470
|
-
var
|
|
4490
|
+
var import_jsx_runtime40 = require("react/jsx-runtime");
|
|
4471
4491
|
var DynamicImage = ({ component: image }) => {
|
|
4472
4492
|
const { url, size, text, margin } = image;
|
|
4473
4493
|
const httpClient = useHttpClient();
|
|
@@ -4484,7 +4504,7 @@ var DynamicImage = ({ component: image }) => {
|
|
|
4484
4504
|
if (!imageSource) {
|
|
4485
4505
|
return null;
|
|
4486
4506
|
}
|
|
4487
|
-
return /* @__PURE__ */ (0,
|
|
4507
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: `df-image ${size || "xl"}`, children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_components15.Image, __spreadValues({ className: `img-responsive ${getMarginBottom(margin || "lg")}` }, imageProps)) });
|
|
4488
4508
|
};
|
|
4489
4509
|
var readImageBlobAsDataURL = (imageBlob) => {
|
|
4490
4510
|
return new Promise((resolve, reject) => {
|
|
@@ -4517,28 +4537,28 @@ var getImageSource = async (httpClient, imageUrl) => {
|
|
|
4517
4537
|
var DynamicImage_default = DynamicImage;
|
|
4518
4538
|
|
|
4519
4539
|
// src/layout/DynamicLayout.tsx
|
|
4520
|
-
var
|
|
4540
|
+
var import_jsx_runtime41 = require("react/jsx-runtime");
|
|
4521
4541
|
var getKey = (component) => JSON.stringify(component);
|
|
4522
4542
|
var DynamicLayout = (props) => {
|
|
4523
4543
|
const { components, model, submitted, errors, onModelChange, onAction, onPersistAsync, baseUrl } = props;
|
|
4524
4544
|
const renderComponent = (component) => {
|
|
4525
4545
|
switch (component.type) {
|
|
4526
4546
|
case "heading":
|
|
4527
|
-
return /* @__PURE__ */ (0,
|
|
4547
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(DynamicHeading_default, { component }, getKey(component));
|
|
4528
4548
|
case "paragraph":
|
|
4529
|
-
return /* @__PURE__ */ (0,
|
|
4549
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(DynamicParagraph_default, { component }, getKey(component));
|
|
4530
4550
|
case "image":
|
|
4531
|
-
return /* @__PURE__ */ (0,
|
|
4551
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(DynamicImage_default, { component }, getKey(component));
|
|
4532
4552
|
case "alert":
|
|
4533
|
-
return /* @__PURE__ */ (0,
|
|
4553
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(DynamicAlert_default, { component }, getKey(component));
|
|
4534
4554
|
case "review":
|
|
4535
|
-
return /* @__PURE__ */ (0,
|
|
4555
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(DynamicReview_default, { component, onAction }, getKey(component));
|
|
4536
4556
|
case "divider":
|
|
4537
|
-
return /* @__PURE__ */ (0,
|
|
4557
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(DynamicDivider_default, { component }, getKey(component));
|
|
4538
4558
|
case "info":
|
|
4539
|
-
return /* @__PURE__ */ (0,
|
|
4559
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(DynamicInfo_default, { component }, getKey(component));
|
|
4540
4560
|
case "columns":
|
|
4541
|
-
return /* @__PURE__ */ (0,
|
|
4561
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
4542
4562
|
DynamicColumns_default,
|
|
4543
4563
|
{
|
|
4544
4564
|
component,
|
|
@@ -4552,7 +4572,7 @@ var DynamicLayout = (props) => {
|
|
|
4552
4572
|
getKey(component)
|
|
4553
4573
|
);
|
|
4554
4574
|
case "form":
|
|
4555
|
-
return /* @__PURE__ */ (0,
|
|
4575
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
4556
4576
|
DynamicForm_default,
|
|
4557
4577
|
{
|
|
4558
4578
|
component,
|
|
@@ -4565,9 +4585,9 @@ var DynamicLayout = (props) => {
|
|
|
4565
4585
|
getKey(component)
|
|
4566
4586
|
);
|
|
4567
4587
|
case "button":
|
|
4568
|
-
return /* @__PURE__ */ (0,
|
|
4588
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(DynamicButton_default, { component, onAction }, getKey(component));
|
|
4569
4589
|
case "box":
|
|
4570
|
-
return /* @__PURE__ */ (0,
|
|
4590
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
4571
4591
|
DynamicBox_default,
|
|
4572
4592
|
{
|
|
4573
4593
|
component,
|
|
@@ -4581,31 +4601,31 @@ var DynamicLayout = (props) => {
|
|
|
4581
4601
|
getKey(component)
|
|
4582
4602
|
);
|
|
4583
4603
|
case "decision":
|
|
4584
|
-
return /* @__PURE__ */ (0,
|
|
4604
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(DynamicDecision_default, { component, onAction }, getKey(component));
|
|
4585
4605
|
case "external":
|
|
4586
|
-
return /* @__PURE__ */ (0,
|
|
4606
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(DynamicExternal_default, { component, onAction }, getKey(component));
|
|
4587
4607
|
case "list":
|
|
4588
|
-
return /* @__PURE__ */ (0,
|
|
4608
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(DynamicList_default, { component, onAction }, getKey(component));
|
|
4589
4609
|
case "loading-indicator":
|
|
4590
|
-
return /* @__PURE__ */ (0,
|
|
4610
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(DynamicLoadingIndicator_default, { component }, getKey(component));
|
|
4591
4611
|
default:
|
|
4592
|
-
return /* @__PURE__ */ (0,
|
|
4612
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("div", {}, getKey(component));
|
|
4593
4613
|
}
|
|
4594
4614
|
};
|
|
4595
4615
|
if (useHasHttpClientProvider() || baseUrl == null) {
|
|
4596
|
-
return /* @__PURE__ */ (0,
|
|
4616
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_jsx_runtime41.Fragment, { children: components.map(renderComponent) });
|
|
4597
4617
|
} else {
|
|
4598
|
-
return /* @__PURE__ */ (0,
|
|
4618
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(HttpClientProviderFromBaseUrl, { baseUrl, children: components.map(renderComponent) });
|
|
4599
4619
|
}
|
|
4600
4620
|
};
|
|
4601
4621
|
var DynamicLayout_default = DynamicLayout;
|
|
4602
4622
|
|
|
4603
4623
|
// src/layout/list/DynamicList.tsx
|
|
4604
4624
|
var import_components16 = require("@transferwise/components");
|
|
4605
|
-
var
|
|
4625
|
+
var import_jsx_runtime42 = require("react/jsx-runtime");
|
|
4606
4626
|
var DynamicList = ({ component }) => {
|
|
4607
|
-
return /* @__PURE__ */ (0,
|
|
4608
|
-
component.title ? /* @__PURE__ */ (0,
|
|
4627
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { className: getMarginBottom(component.margin || "md"), children: [
|
|
4628
|
+
component.title ? /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("h4", { className: "m-b-2", children: [
|
|
4609
4629
|
" ",
|
|
4610
4630
|
component.title,
|
|
4611
4631
|
" "
|
|
@@ -4618,8 +4638,8 @@ function mapItemToSummary({ title, description, icon, status }) {
|
|
|
4618
4638
|
key: `${title}/${description || ""}`,
|
|
4619
4639
|
title,
|
|
4620
4640
|
description
|
|
4621
|
-
}, (icon == null ? void 0 : icon.name) ? { icon: /* @__PURE__ */ (0,
|
|
4622
|
-
return /* @__PURE__ */ (0,
|
|
4641
|
+
}, (icon == null ? void 0 : icon.name) ? { icon: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(DynamicIcon_default, { type: icon.name }) } : {}), status ? { status: statusMap[status] } : {});
|
|
4642
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_components16.Summary, __spreadValues({}, props));
|
|
4623
4643
|
}
|
|
4624
4644
|
var statusMap = {
|
|
4625
4645
|
positive: "done",
|
|
@@ -4630,10 +4650,10 @@ var DynamicList_default = DynamicList;
|
|
|
4630
4650
|
|
|
4631
4651
|
// src/layout/loadingIndicator/DynamicLoadingIndicator.tsx
|
|
4632
4652
|
var import_components17 = require("@transferwise/components");
|
|
4633
|
-
var
|
|
4653
|
+
var import_jsx_runtime43 = require("react/jsx-runtime");
|
|
4634
4654
|
var DynamicLoadingIndicator = ({ component }) => {
|
|
4635
4655
|
const { margin, size = "md" } = component;
|
|
4636
|
-
return /* @__PURE__ */ (0,
|
|
4656
|
+
return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
4637
4657
|
import_components17.Loader,
|
|
4638
4658
|
{
|
|
4639
4659
|
size,
|
|
@@ -4676,9 +4696,9 @@ function noop3() {
|
|
|
4676
4696
|
}
|
|
4677
4697
|
|
|
4678
4698
|
// src/layout/paragraph/DynamicParagraph.tsx
|
|
4679
|
-
var
|
|
4680
|
-
var DynamicParagraph = ({ component }) => component.control === "copyable" ? /* @__PURE__ */ (0,
|
|
4681
|
-
var BasicDynamicParagraph = ({ component }) => /* @__PURE__ */ (0,
|
|
4699
|
+
var import_jsx_runtime44 = require("react/jsx-runtime");
|
|
4700
|
+
var DynamicParagraph = ({ component }) => component.control === "copyable" ? /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(CopyableDynamicParagraph, { component }) : /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(BasicDynamicParagraph, { component });
|
|
4701
|
+
var BasicDynamicParagraph = ({ component }) => /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("p", { className: getTextAlignmentAndMargin(component), children: [
|
|
4682
4702
|
" ",
|
|
4683
4703
|
component.text,
|
|
4684
4704
|
" "
|
|
@@ -4692,8 +4712,8 @@ var CopyableDynamicParagraph = ({ component }) => {
|
|
|
4692
4712
|
(_a = navigator.clipboard) == null ? void 0 : _a.writeText(text).then(() => createSnackbar({ text: formatMessage(DynamicParagraph_messages_default.copied) })).catch(noop4);
|
|
4693
4713
|
};
|
|
4694
4714
|
const classNames7 = getTextAlignmentAndMargin({ align: component.align, margin: "sm" }) + " form-control";
|
|
4695
|
-
return /* @__PURE__ */ (0,
|
|
4696
|
-
/* @__PURE__ */ (0,
|
|
4715
|
+
return /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("div", { className: getTextAlignmentAndMargin(component), children: [
|
|
4716
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
4697
4717
|
"input",
|
|
4698
4718
|
{
|
|
4699
4719
|
type: "text",
|
|
@@ -4703,7 +4723,7 @@ var CopyableDynamicParagraph = ({ component }) => {
|
|
|
4703
4723
|
style: { textOverflow: "ellipsis" }
|
|
4704
4724
|
}
|
|
4705
4725
|
),
|
|
4706
|
-
/* @__PURE__ */ (0,
|
|
4726
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_components19.Button, { block: true, onClick: copy, children: formatMessage(DynamicParagraph_messages_default.copy) })
|
|
4707
4727
|
] });
|
|
4708
4728
|
};
|
|
4709
4729
|
function noop4() {
|
|
@@ -4712,7 +4732,7 @@ var DynamicParagraph_default = DynamicParagraph;
|
|
|
4712
4732
|
|
|
4713
4733
|
// src/layout/review/DynamicReview.tsx
|
|
4714
4734
|
var import_components20 = require("@transferwise/components");
|
|
4715
|
-
var
|
|
4735
|
+
var import_jsx_runtime45 = require("react/jsx-runtime");
|
|
4716
4736
|
var mapFieldsToDefinitions = ({ label, value }, index) => {
|
|
4717
4737
|
return { key: String(index), title: label, value };
|
|
4718
4738
|
};
|
|
@@ -4723,7 +4743,7 @@ var DynamicReview = (props) => {
|
|
|
4723
4743
|
const review = props.component;
|
|
4724
4744
|
const margin = getMarginBottom(review.margin || "xs");
|
|
4725
4745
|
const getReviewAction = (action2) => {
|
|
4726
|
-
return /* @__PURE__ */ (0,
|
|
4746
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
4727
4747
|
"a",
|
|
4728
4748
|
{
|
|
4729
4749
|
href: action2.url,
|
|
@@ -4737,12 +4757,12 @@ var DynamicReview = (props) => {
|
|
|
4737
4757
|
}
|
|
4738
4758
|
);
|
|
4739
4759
|
};
|
|
4740
|
-
return /* @__PURE__ */ (0,
|
|
4741
|
-
review.title && /* @__PURE__ */ (0,
|
|
4760
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(import_jsx_runtime45.Fragment, { children: [
|
|
4761
|
+
review.title && /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("h6", { className: "m-b-2", children: [
|
|
4742
4762
|
review.title,
|
|
4743
4763
|
review.action && getReviewAction(review.action)
|
|
4744
4764
|
] }),
|
|
4745
|
-
/* @__PURE__ */ (0,
|
|
4765
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)("div", { className: margin, children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
4746
4766
|
import_components20.DefinitionList,
|
|
4747
4767
|
{
|
|
4748
4768
|
layout: getReviewLayout(review.orientation),
|
|
@@ -4754,7 +4774,7 @@ var DynamicReview = (props) => {
|
|
|
4754
4774
|
var DynamicReview_default = DynamicReview;
|
|
4755
4775
|
|
|
4756
4776
|
// src/jsonSchemaForm/basicTypeSchema/BasicTypeSchema.tsx
|
|
4757
|
-
var
|
|
4777
|
+
var import_jsx_runtime46 = require("react/jsx-runtime");
|
|
4758
4778
|
var isNullish = (value) => isNull(value) || isUndefined(value);
|
|
4759
4779
|
var getDefaultValue = (schema2) => {
|
|
4760
4780
|
return schema2.type === "boolean" && isNullish(schema2.default) ? false : schema2.default;
|
|
@@ -4825,15 +4845,15 @@ var BasicTypeSchema = (props) => {
|
|
|
4825
4845
|
};
|
|
4826
4846
|
const showLabel = props.schema.format !== "file" && props.schema.type !== "boolean";
|
|
4827
4847
|
const schemaHelp = props.schema.help;
|
|
4828
|
-
return !isHidden ? /* @__PURE__ */ (0,
|
|
4829
|
-
props.schema.alert && /* @__PURE__ */ (0,
|
|
4830
|
-
/* @__PURE__ */ (0,
|
|
4831
|
-
showLabel && /* @__PURE__ */ (0,
|
|
4832
|
-
/* @__PURE__ */ (0,
|
|
4833
|
-
!!schemaHelp && /* @__PURE__ */ (0,
|
|
4848
|
+
return !isHidden ? /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(import_jsx_runtime46.Fragment, { children: [
|
|
4849
|
+
props.schema.alert && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(DynamicAlert_default, { component: props.schema.alert }),
|
|
4850
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("div", { className: (0, import_classnames6.default)(formGroupClasses), children: [
|
|
4851
|
+
showLabel && /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("div", { className: "d-inline-block", children: [
|
|
4852
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("label", { className: "control-label d-inline", htmlFor: id, children: props.schema.title }),
|
|
4853
|
+
!!schemaHelp && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(Help_default, { help: schemaHelp })
|
|
4834
4854
|
] }),
|
|
4835
|
-
!showLabel && !!schemaHelp && /* @__PURE__ */ (0,
|
|
4836
|
-
/* @__PURE__ */ (0,
|
|
4855
|
+
!showLabel && !!schemaHelp && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(Help_default, { help: schemaHelp }),
|
|
4856
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
4837
4857
|
SchemaFormControl_default,
|
|
4838
4858
|
{
|
|
4839
4859
|
id,
|
|
@@ -4845,7 +4865,7 @@ var BasicTypeSchema = (props) => {
|
|
|
4845
4865
|
onBlur
|
|
4846
4866
|
}
|
|
4847
4867
|
),
|
|
4848
|
-
/* @__PURE__ */ (0,
|
|
4868
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
4849
4869
|
ControlFeedback_default,
|
|
4850
4870
|
{
|
|
4851
4871
|
changed,
|
|
@@ -4869,7 +4889,7 @@ BasicTypeSchema.defaultProps = {
|
|
|
4869
4889
|
var BasicTypeSchema_default = BasicTypeSchema;
|
|
4870
4890
|
|
|
4871
4891
|
// src/jsonSchemaForm/persistAsyncSchema/persistAsyncBasicSchema/PersistAsyncBasicSchema.tsx
|
|
4872
|
-
var
|
|
4892
|
+
var import_jsx_runtime47 = require("react/jsx-runtime");
|
|
4873
4893
|
var getIdFromResponse = (idProperty, response) => {
|
|
4874
4894
|
return response[idProperty];
|
|
4875
4895
|
};
|
|
@@ -4961,7 +4981,7 @@ var PersistAsyncBasicSchema = (props) => {
|
|
|
4961
4981
|
setPersistAsyncModel(newPersistAsyncModel);
|
|
4962
4982
|
}
|
|
4963
4983
|
};
|
|
4964
|
-
return /* @__PURE__ */ (0,
|
|
4984
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
4965
4985
|
BasicTypeSchema_default,
|
|
4966
4986
|
{
|
|
4967
4987
|
required: props.required,
|
|
@@ -5172,18 +5192,18 @@ function useStepPolling(polling, onAction) {
|
|
|
5172
5192
|
}
|
|
5173
5193
|
|
|
5174
5194
|
// src/step/layoutStep/LayoutStep.tsx
|
|
5175
|
-
var
|
|
5176
|
-
var getComponents = (
|
|
5195
|
+
var import_jsx_runtime48 = require("react/jsx-runtime");
|
|
5196
|
+
var getComponents = (step33, options) => {
|
|
5177
5197
|
var _a;
|
|
5178
|
-
if (!
|
|
5198
|
+
if (!step33 || isEmpty(step33) || !step33.layout && !step33.type) {
|
|
5179
5199
|
return [];
|
|
5180
5200
|
}
|
|
5181
|
-
const layout6 = convertStepToLayout(
|
|
5201
|
+
const layout6 = convertStepToLayout(step33, options);
|
|
5182
5202
|
return inlineReferences({
|
|
5183
5203
|
layout: layout6,
|
|
5184
|
-
schemas:
|
|
5185
|
-
actions:
|
|
5186
|
-
model: (_a =
|
|
5204
|
+
schemas: step33.schemas || [],
|
|
5205
|
+
actions: step33.actions || [],
|
|
5206
|
+
model: (_a = step33.model) != null ? _a : null
|
|
5187
5207
|
});
|
|
5188
5208
|
};
|
|
5189
5209
|
var LayoutStep = (props) => {
|
|
@@ -5195,7 +5215,7 @@ var LayoutStep = (props) => {
|
|
|
5195
5215
|
onEvent("Dynamic Flow - onAction supressed", { reason: "LayoutStep - loading state" });
|
|
5196
5216
|
};
|
|
5197
5217
|
useStepPolling(stepSpecification.polling, onAction);
|
|
5198
|
-
return /* @__PURE__ */ (0,
|
|
5218
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
5199
5219
|
DynamicLayout_default,
|
|
5200
5220
|
{
|
|
5201
5221
|
components,
|
|
@@ -5241,15 +5261,15 @@ var CameraCapture_messages_default = (0, import_react_intl17.defineMessages)({
|
|
|
5241
5261
|
// src/step/cameraStep/cameraCapture/components/index.tsx
|
|
5242
5262
|
var import_components21 = require("@transferwise/components");
|
|
5243
5263
|
var import_react_intl18 = require("react-intl");
|
|
5244
|
-
var
|
|
5245
|
-
var CaptureBottomBar = ({ onCapture }) => /* @__PURE__ */ (0,
|
|
5264
|
+
var import_jsx_runtime49 = require("react/jsx-runtime");
|
|
5265
|
+
var CaptureBottomBar = ({ onCapture }) => /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("div", { className: "bottom-bar", children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(CaptureButton, { onClick: onCapture }) });
|
|
5246
5266
|
var ReviewBottomBar = ({
|
|
5247
5267
|
onSubmit,
|
|
5248
5268
|
onRetry
|
|
5249
5269
|
}) => {
|
|
5250
5270
|
const intl = (0, import_react_intl18.useIntl)();
|
|
5251
|
-
return /* @__PURE__ */ (0,
|
|
5252
|
-
/* @__PURE__ */ (0,
|
|
5271
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("div", { className: "bottom-bar p-x-2", children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("div", { className: "row", children: /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { className: "col-xs-12 col-md-6 col-md-offset-3", children: [
|
|
5272
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
5253
5273
|
import_components21.Button,
|
|
5254
5274
|
{
|
|
5255
5275
|
className: "m-b-1",
|
|
@@ -5260,7 +5280,7 @@ var ReviewBottomBar = ({
|
|
|
5260
5280
|
children: intl.formatMessage(CameraCapture_messages_default.reviewSubmit)
|
|
5261
5281
|
}
|
|
5262
5282
|
),
|
|
5263
|
-
/* @__PURE__ */ (0,
|
|
5283
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
5264
5284
|
import_components21.Button,
|
|
5265
5285
|
{
|
|
5266
5286
|
className: "m-b-2",
|
|
@@ -5274,14 +5294,14 @@ var ReviewBottomBar = ({
|
|
|
5274
5294
|
)
|
|
5275
5295
|
] }) }) });
|
|
5276
5296
|
};
|
|
5277
|
-
var CaptureButton = ({ onClick }) => /* @__PURE__ */ (0,
|
|
5297
|
+
var CaptureButton = ({ onClick }) => /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
5278
5298
|
"button",
|
|
5279
5299
|
{
|
|
5280
5300
|
type: "button",
|
|
5281
5301
|
className: "camera-capture-btn m-b-2",
|
|
5282
5302
|
"data-testid": "camera-capture-button",
|
|
5283
5303
|
onClick,
|
|
5284
|
-
children: /* @__PURE__ */ (0,
|
|
5304
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("span", { className: "camera-capture-btn-inner" })
|
|
5285
5305
|
}
|
|
5286
5306
|
);
|
|
5287
5307
|
|
|
@@ -5361,7 +5381,7 @@ var useVideoConstraints = (direction) => {
|
|
|
5361
5381
|
|
|
5362
5382
|
// src/step/cameraStep/cameraCapture/overlay/Overlay.tsx
|
|
5363
5383
|
var import_react28 = require("react");
|
|
5364
|
-
var
|
|
5384
|
+
var import_jsx_runtime50 = require("react/jsx-runtime");
|
|
5365
5385
|
var captureButtonHeight = 92;
|
|
5366
5386
|
var reviewButtonsHeight = 120;
|
|
5367
5387
|
var imageHeight = 40;
|
|
@@ -5390,18 +5410,18 @@ var Overlay = ({
|
|
|
5390
5410
|
return () => window.removeEventListener("resize", listener);
|
|
5391
5411
|
});
|
|
5392
5412
|
let helperBoxHeight = (imageUrl ? imageHeight : 0) + (title ? titleHeight : 0) + (instructions ? instructionsHeight : 0);
|
|
5393
|
-
let helperBox = /* @__PURE__ */ (0,
|
|
5394
|
-
imageUrl && /* @__PURE__ */ (0,
|
|
5395
|
-
title && /* @__PURE__ */ (0,
|
|
5396
|
-
instructions && /* @__PURE__ */ (0,
|
|
5413
|
+
let helperBox = /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(import_jsx_runtime50.Fragment, { children: [
|
|
5414
|
+
imageUrl && /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("img", { className: "camera-capture-img", src: imageUrl, alt: "" }),
|
|
5415
|
+
title && /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("h4", { className: "camera-capture-title", children: title }),
|
|
5416
|
+
instructions && /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("small", { className: "camera-capture-instructions", children: instructions })
|
|
5397
5417
|
] });
|
|
5398
5418
|
const frameBottomMargin = captureButtonHeight + helperBoxHeight;
|
|
5399
5419
|
if (reviewInstructions) {
|
|
5400
5420
|
helperBoxHeight = frameBottomMargin - reviewButtonsHeight;
|
|
5401
|
-
helperBox = /* @__PURE__ */ (0,
|
|
5421
|
+
helperBox = /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("small", { className: "camera-capture-instructions", children: reviewInstructions });
|
|
5402
5422
|
const frameWithReviewInstructionsMinBottomMargin = reviewButtonsHeight + reviewInstructionsHeight;
|
|
5403
5423
|
if (frameBottomMargin < frameWithReviewInstructionsMinBottomMargin) {
|
|
5404
|
-
helperBox = /* @__PURE__ */ (0,
|
|
5424
|
+
helperBox = /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_jsx_runtime50.Fragment, {});
|
|
5405
5425
|
}
|
|
5406
5426
|
}
|
|
5407
5427
|
const framePosition = {
|
|
@@ -5419,14 +5439,14 @@ var Overlay = ({
|
|
|
5419
5439
|
width: "90%"
|
|
5420
5440
|
}
|
|
5421
5441
|
};
|
|
5422
|
-
return /* @__PURE__ */ (0,
|
|
5423
|
-
/* @__PURE__ */ (0,
|
|
5424
|
-
/* @__PURE__ */ (0,
|
|
5425
|
-
/* @__PURE__ */ (0,
|
|
5442
|
+
return /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("svg", { ref: svgReference, xmlns: "http://www.w3.org/2000/svg", children: [
|
|
5443
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)("defs", { children: /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("mask", { id: "mask", children: [
|
|
5444
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)("rect", { width: "100%", height: "100%", fill: "#fff" }),
|
|
5445
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)("image", __spreadValues({ href: overlay }, framePosition))
|
|
5426
5446
|
] }) }),
|
|
5427
|
-
overlay && /* @__PURE__ */ (0,
|
|
5428
|
-
outline && /* @__PURE__ */ (0,
|
|
5429
|
-
/* @__PURE__ */ (0,
|
|
5447
|
+
overlay && /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("rect", { width: "100%", height: "100%", mask: "url(#mask)", fillOpacity: "0.72" }),
|
|
5448
|
+
outline && /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("image", __spreadValues({ href: outline }, framePosition)),
|
|
5449
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)("foreignObject", { width: "100%", height: "100%", children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("div", __spreadProps(__spreadValues({ className: "camera-capture-text-and-image-container" }, helperBoxPosition), { children: helperBox })) })
|
|
5430
5450
|
] });
|
|
5431
5451
|
};
|
|
5432
5452
|
var Overlay_default = Overlay;
|
|
@@ -5456,13 +5476,13 @@ var NoCameraAccess_messages_default = (0, import_react_intl19.defineMessages)({
|
|
|
5456
5476
|
});
|
|
5457
5477
|
|
|
5458
5478
|
// src/step/cameraStep/cameraCapture/screens/NoCameraAccess/NoCameraAccess.tsx
|
|
5459
|
-
var
|
|
5479
|
+
var import_jsx_runtime51 = require("react/jsx-runtime");
|
|
5460
5480
|
var NoCameraAccess = ({ onAction }) => {
|
|
5461
5481
|
const intl = (0, import_react_intl20.useIntl)();
|
|
5462
|
-
return /* @__PURE__ */ (0,
|
|
5463
|
-
/* @__PURE__ */ (0,
|
|
5464
|
-
/* @__PURE__ */ (0,
|
|
5465
|
-
/* @__PURE__ */ (0,
|
|
5482
|
+
return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", { id: "no-camera-access", children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", { className: "container p-t-5", children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", { className: "row", children: /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("div", { className: "col-md-6 col-md-offset-3", children: [
|
|
5483
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)("h2", { className: "text-xs-center m-b-3", children: intl.formatMessage(NoCameraAccess_messages_default.title) }),
|
|
5484
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)("p", { className: "text-xs-center m-b-5", children: intl.formatMessage(NoCameraAccess_messages_default.paragraph) }),
|
|
5485
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_components22.Button, { block: true, onClick: onAction, children: intl.formatMessage(NoCameraAccess_messages_default.action) })
|
|
5466
5486
|
] }) }) }) });
|
|
5467
5487
|
};
|
|
5468
5488
|
var NoCameraAccess_default = NoCameraAccess;
|
|
@@ -5486,12 +5506,12 @@ var CameraNotSupported_messages_default = (0, import_react_intl21.defineMessages
|
|
|
5486
5506
|
});
|
|
5487
5507
|
|
|
5488
5508
|
// src/step/cameraStep/cameraCapture/screens/CameraNotSupported/CameraNotSupported.tsx
|
|
5489
|
-
var
|
|
5509
|
+
var import_jsx_runtime52 = require("react/jsx-runtime");
|
|
5490
5510
|
var CameraNotSupported = () => {
|
|
5491
5511
|
const intl = (0, import_react_intl22.useIntl)();
|
|
5492
|
-
return /* @__PURE__ */ (0,
|
|
5493
|
-
/* @__PURE__ */ (0,
|
|
5494
|
-
/* @__PURE__ */ (0,
|
|
5512
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("div", { id: "camera-not-supported", children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("div", { className: "container p-t-5", children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("div", { className: "row", children: /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("div", { className: "col-md-6 col-md-offset-3", children: [
|
|
5513
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)("h2", { className: "text-xs-center m-b-3", children: intl.formatMessage(CameraNotSupported_messages_default.title) }),
|
|
5514
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)("p", { className: "text-xs-center m-b-5", children: intl.formatMessage(CameraNotSupported_messages_default.paragraph) })
|
|
5495
5515
|
] }) }) }) });
|
|
5496
5516
|
};
|
|
5497
5517
|
var CameraNotSupported_default = CameraNotSupported;
|
|
@@ -5516,7 +5536,7 @@ var getCameraStartedProperties = async (props, videoStream) => {
|
|
|
5516
5536
|
};
|
|
5517
5537
|
|
|
5518
5538
|
// src/step/cameraStep/cameraCapture/CameraCapture.tsx
|
|
5519
|
-
var
|
|
5539
|
+
var import_jsx_runtime53 = require("react/jsx-runtime");
|
|
5520
5540
|
var CameraCapture = ({
|
|
5521
5541
|
direction = "back",
|
|
5522
5542
|
overlay = "",
|
|
@@ -5585,8 +5605,8 @@ var CameraCapture = ({
|
|
|
5585
5605
|
setReviewImage(void 0);
|
|
5586
5606
|
};
|
|
5587
5607
|
const handleRetryCameraAccess = () => setMode("CAPTURE");
|
|
5588
|
-
const captureScreen = /* @__PURE__ */ (0,
|
|
5589
|
-
videoConstraints && /* @__PURE__ */ (0,
|
|
5608
|
+
const captureScreen = /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(import_jsx_runtime53.Fragment, { children: [
|
|
5609
|
+
videoConstraints && /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
5590
5610
|
import_react_webcam.default,
|
|
5591
5611
|
{
|
|
5592
5612
|
ref: webcamReference,
|
|
@@ -5597,7 +5617,7 @@ var CameraCapture = ({
|
|
|
5597
5617
|
onUserMedia: handleUserMedia
|
|
5598
5618
|
}
|
|
5599
5619
|
),
|
|
5600
|
-
/* @__PURE__ */ (0,
|
|
5620
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
5601
5621
|
Overlay_default,
|
|
5602
5622
|
{
|
|
5603
5623
|
overlay,
|
|
@@ -5607,11 +5627,11 @@ var CameraCapture = ({
|
|
|
5607
5627
|
instructions
|
|
5608
5628
|
}
|
|
5609
5629
|
),
|
|
5610
|
-
ready && /* @__PURE__ */ (0,
|
|
5630
|
+
ready && /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(CaptureBottomBar, { onCapture: () => void handleCapture() })
|
|
5611
5631
|
] });
|
|
5612
|
-
const reviewScreen = /* @__PURE__ */ (0,
|
|
5613
|
-
/* @__PURE__ */ (0,
|
|
5614
|
-
/* @__PURE__ */ (0,
|
|
5632
|
+
const reviewScreen = /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(import_jsx_runtime53.Fragment, { children: [
|
|
5633
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)("img", { className: "review-image", src: reviewImage == null ? void 0 : reviewImage.source, alt: "" }),
|
|
5634
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
5615
5635
|
Overlay_default,
|
|
5616
5636
|
{
|
|
5617
5637
|
overlay,
|
|
@@ -5621,19 +5641,19 @@ var CameraCapture = ({
|
|
|
5621
5641
|
reviewInstructions: intl.formatMessage(CameraCapture_messages_default.reviewInstructions)
|
|
5622
5642
|
}
|
|
5623
5643
|
),
|
|
5624
|
-
/* @__PURE__ */ (0,
|
|
5644
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(ReviewBottomBar, { onSubmit: handleReviewSubmit, onRetry: handleReviewRetry })
|
|
5625
5645
|
] });
|
|
5626
|
-
return /* @__PURE__ */ (0,
|
|
5646
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("section", { className: "camera-capture", children: [
|
|
5627
5647
|
mode === "CAPTURE" && captureScreen,
|
|
5628
5648
|
mode === "REVIEW" && reviewScreen,
|
|
5629
|
-
mode === "NO_CAMERA_ACCESS" && /* @__PURE__ */ (0,
|
|
5630
|
-
mode === "CAMERA_NOT_SUPPORTED" && /* @__PURE__ */ (0,
|
|
5649
|
+
mode === "NO_CAMERA_ACCESS" && /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(NoCameraAccess_default, { onAction: handleRetryCameraAccess }),
|
|
5650
|
+
mode === "CAMERA_NOT_SUPPORTED" && /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(CameraNotSupported_default, {})
|
|
5631
5651
|
] });
|
|
5632
5652
|
};
|
|
5633
5653
|
var CameraCapture_default = CameraCapture;
|
|
5634
5654
|
|
|
5635
5655
|
// src/step/cameraStep/CameraStep.tsx
|
|
5636
|
-
var
|
|
5656
|
+
var import_jsx_runtime54 = require("react/jsx-runtime");
|
|
5637
5657
|
function blobToBase64(blob) {
|
|
5638
5658
|
return new Promise((resolve, _) => {
|
|
5639
5659
|
const reader = new FileReader();
|
|
@@ -5642,11 +5662,11 @@ function blobToBase64(blob) {
|
|
|
5642
5662
|
});
|
|
5643
5663
|
}
|
|
5644
5664
|
var CameraStep = (props) => {
|
|
5645
|
-
const { step:
|
|
5665
|
+
const { step: step33, model, onModelChange, onAction } = props;
|
|
5646
5666
|
const onEvent = useEventDispatcher();
|
|
5647
|
-
const objectSchema = getObjectSchema(
|
|
5648
|
-
const cameraSchema = getCameraSchema(
|
|
5649
|
-
const action2 = getFirstAction(
|
|
5667
|
+
const objectSchema = getObjectSchema(step33);
|
|
5668
|
+
const cameraSchema = getCameraSchema(step33);
|
|
5669
|
+
const action2 = getFirstAction(step33);
|
|
5650
5670
|
const { title, image, cameraConfig } = cameraSchema;
|
|
5651
5671
|
const { assets, direction, instructions } = cameraConfig || {};
|
|
5652
5672
|
const { overlay, outline } = assets || {};
|
|
@@ -5671,7 +5691,7 @@ var CameraStep = (props) => {
|
|
|
5671
5691
|
});
|
|
5672
5692
|
}
|
|
5673
5693
|
};
|
|
5674
|
-
return /* @__PURE__ */ (0,
|
|
5694
|
+
return /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
5675
5695
|
CameraCapture_default,
|
|
5676
5696
|
{
|
|
5677
5697
|
overlay,
|
|
@@ -5688,8 +5708,8 @@ var CameraStep = (props) => {
|
|
|
5688
5708
|
);
|
|
5689
5709
|
};
|
|
5690
5710
|
var CameraStep_default = CameraStep;
|
|
5691
|
-
function getObjectSchema(
|
|
5692
|
-
const nonHiddenSchemas = filterHiddenSchemas(
|
|
5711
|
+
function getObjectSchema(step33) {
|
|
5712
|
+
const nonHiddenSchemas = filterHiddenSchemas(step33.schemas || []);
|
|
5693
5713
|
const objectSchema = nonHiddenSchemas[0];
|
|
5694
5714
|
if (!objectSchema || !isObjectSchema(objectSchema)) {
|
|
5695
5715
|
throw new Error(
|
|
@@ -5698,8 +5718,8 @@ function getObjectSchema(step31) {
|
|
|
5698
5718
|
}
|
|
5699
5719
|
return objectSchema;
|
|
5700
5720
|
}
|
|
5701
|
-
function getCameraSchema(
|
|
5702
|
-
const objectSchema = getObjectSchema(
|
|
5721
|
+
function getCameraSchema(step33) {
|
|
5722
|
+
const objectSchema = getObjectSchema(step33);
|
|
5703
5723
|
const firstProperty = Object.values(objectSchema.properties)[0];
|
|
5704
5724
|
if (!firstProperty) {
|
|
5705
5725
|
throw new Error(
|
|
@@ -5708,15 +5728,15 @@ function getCameraSchema(step31) {
|
|
|
5708
5728
|
}
|
|
5709
5729
|
return firstProperty;
|
|
5710
5730
|
}
|
|
5711
|
-
function getFirstAction(
|
|
5731
|
+
function getFirstAction(step33) {
|
|
5712
5732
|
var _a, _b;
|
|
5713
|
-
if (!
|
|
5733
|
+
if (!step33.schemas || ((_a = filterHiddenSchemas(step33.schemas)) == null ? void 0 : _a.length) !== 1) {
|
|
5714
5734
|
throw new Error("camera step expects 1 non-hidden object schema");
|
|
5715
5735
|
}
|
|
5716
|
-
if (((_b =
|
|
5736
|
+
if (((_b = step33 == null ? void 0 : step33.actions) == null ? void 0 : _b.length) !== 1) {
|
|
5717
5737
|
throw new Error("camera step expects 1 action");
|
|
5718
5738
|
}
|
|
5719
|
-
return
|
|
5739
|
+
return step33.actions[0];
|
|
5720
5740
|
}
|
|
5721
5741
|
|
|
5722
5742
|
// src/step/externalConfirmationStep/ExternalConfirmationStep.tsx
|
|
@@ -5748,12 +5768,12 @@ var ExternalConfirmationStep_messages_default = (0, import_react_intl24.defineMe
|
|
|
5748
5768
|
});
|
|
5749
5769
|
|
|
5750
5770
|
// src/step/externalConfirmationStep/ExternalConfirmationStep.tsx
|
|
5751
|
-
var
|
|
5771
|
+
var import_jsx_runtime55 = require("react/jsx-runtime");
|
|
5752
5772
|
var noop5 = () => {
|
|
5753
5773
|
};
|
|
5754
5774
|
var ExternalConfirmationStep = ({ url, onClose }) => {
|
|
5755
5775
|
const { formatMessage } = (0, import_react_intl25.useIntl)();
|
|
5756
|
-
return /* @__PURE__ */ (0,
|
|
5776
|
+
return /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
5757
5777
|
DynamicLayout_default,
|
|
5758
5778
|
{
|
|
5759
5779
|
components: [
|
|
@@ -5818,24 +5838,24 @@ function getOrigin(url) {
|
|
|
5818
5838
|
}
|
|
5819
5839
|
|
|
5820
5840
|
// src/dynamicFlow/DynamicFlowStep.tsx
|
|
5821
|
-
var
|
|
5841
|
+
var import_jsx_runtime56 = require("react/jsx-runtime");
|
|
5822
5842
|
var DynamicFlowStep = (props) => {
|
|
5823
5843
|
var _a;
|
|
5824
|
-
const { step:
|
|
5825
|
-
const externalUrl = (_a =
|
|
5844
|
+
const { step: step33, globalError } = props;
|
|
5845
|
+
const externalUrl = (_a = step33 == null ? void 0 : step33.external) == null ? void 0 : _a.url;
|
|
5826
5846
|
const { requiresManualTrigger, dismissConfirmation } = useExternal(externalUrl);
|
|
5827
|
-
if (
|
|
5847
|
+
if (step33 === void 0) {
|
|
5828
5848
|
return null;
|
|
5829
5849
|
}
|
|
5830
5850
|
if (externalUrl && requiresManualTrigger) {
|
|
5831
|
-
return /* @__PURE__ */ (0,
|
|
5851
|
+
return /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(ExternalConfirmationStep_default, { url: externalUrl, onClose: dismissConfirmation });
|
|
5832
5852
|
}
|
|
5833
|
-
if (getStepType(
|
|
5834
|
-
return /* @__PURE__ */ (0,
|
|
5853
|
+
if (getStepType(step33) === "camera") {
|
|
5854
|
+
return /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(CameraStep_default, __spreadProps(__spreadValues({}, props), { step: step33 }));
|
|
5835
5855
|
}
|
|
5836
|
-
return /* @__PURE__ */ (0,
|
|
5837
|
-
globalError ? /* @__PURE__ */ (0,
|
|
5838
|
-
/* @__PURE__ */ (0,
|
|
5856
|
+
return /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(import_jsx_runtime56.Fragment, { children: [
|
|
5857
|
+
globalError ? /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(DynamicAlert_default, { component: { context: "negative", markdown: globalError, margin: "lg" } }) : null,
|
|
5858
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(LayoutStep_default, __spreadProps(__spreadValues({}, props), { stepSpecification: step33 }))
|
|
5839
5859
|
] });
|
|
5840
5860
|
};
|
|
5841
5861
|
|
|
@@ -5883,16 +5903,16 @@ var useDynamicFlowState = (initialStep) => {
|
|
|
5883
5903
|
models: (initialStep == null ? void 0 : initialStep.model) ? buildInitialModels(initialStep.model, getAllSchemas(initialStep)) : {},
|
|
5884
5904
|
etag: void 0
|
|
5885
5905
|
});
|
|
5886
|
-
const { step:
|
|
5887
|
-
const setStepAndEtag = (
|
|
5906
|
+
const { step: step33, models, etag } = stepAndModels;
|
|
5907
|
+
const setStepAndEtag = (step34, etag2) => {
|
|
5888
5908
|
var _a2, _b2, _c, _d;
|
|
5889
5909
|
setStepAndModels((previous) => ({
|
|
5890
|
-
step:
|
|
5891
|
-
models:
|
|
5910
|
+
step: step34,
|
|
5911
|
+
models: step34.model ? buildInitialModels(step34.model, getAllSchemas(step34)) : previous.models,
|
|
5892
5912
|
etag: etag2
|
|
5893
5913
|
}));
|
|
5894
|
-
setFormErrors((_b2 = (_a2 =
|
|
5895
|
-
setGlobalError((_d = (_c =
|
|
5914
|
+
setFormErrors((_b2 = (_a2 = step34 == null ? void 0 : step34.errors) == null ? void 0 : _a2.validation) != null ? _b2 : null);
|
|
5915
|
+
setGlobalError((_d = (_c = step34 == null ? void 0 : step34.errors) == null ? void 0 : _c.error) != null ? _d : null);
|
|
5896
5916
|
};
|
|
5897
5917
|
const setSchemaModel = (schemaId, objectModel, onModelsUpdated) => {
|
|
5898
5918
|
setStepAndModels((previous) => {
|
|
@@ -5908,11 +5928,11 @@ var useDynamicFlowState = (initialStep) => {
|
|
|
5908
5928
|
return updatedState;
|
|
5909
5929
|
});
|
|
5910
5930
|
};
|
|
5911
|
-
const modelIsValid = (0, import_react32.useMemo)(() => areModelsValid(models, getAllSchemas(
|
|
5931
|
+
const modelIsValid = (0, import_react32.useMemo)(() => areModelsValid(models, getAllSchemas(step33)), [models, step33]);
|
|
5912
5932
|
return {
|
|
5913
5933
|
formErrors,
|
|
5914
5934
|
globalError,
|
|
5915
|
-
step:
|
|
5935
|
+
step: step33,
|
|
5916
5936
|
models,
|
|
5917
5937
|
etag,
|
|
5918
5938
|
modelIsValid,
|
|
@@ -5932,9 +5952,9 @@ var buildInitialModels = (model, schemas = []) => {
|
|
|
5932
5952
|
});
|
|
5933
5953
|
}, {});
|
|
5934
5954
|
};
|
|
5935
|
-
var getAllSchemas = (
|
|
5936
|
-
...getAllSchemasInLayout((
|
|
5937
|
-
...(
|
|
5955
|
+
var getAllSchemas = (step33) => [
|
|
5956
|
+
...getAllSchemasInLayout((step33 == null ? void 0 : step33.layout) || []),
|
|
5957
|
+
...(step33 == null ? void 0 : step33.schemas) || []
|
|
5938
5958
|
];
|
|
5939
5959
|
var getAllSchemasInLayout = (components) => components.flatMap((component) => {
|
|
5940
5960
|
switch (component.type) {
|
|
@@ -5960,7 +5980,7 @@ var areModelsValid = (formModels, schemas = []) => {
|
|
|
5960
5980
|
// src/dynamicFlow/utils/useLoader.tsx
|
|
5961
5981
|
var import_components24 = require("@transferwise/components");
|
|
5962
5982
|
var import_react33 = require("react");
|
|
5963
|
-
var
|
|
5983
|
+
var import_jsx_runtime57 = require("react/jsx-runtime");
|
|
5964
5984
|
function useLoader(loaderConfig, initialState) {
|
|
5965
5985
|
const config = __spreadValues({
|
|
5966
5986
|
size: import_components24.Size.EXTRA_LARGE,
|
|
@@ -5969,7 +5989,7 @@ function useLoader(loaderConfig, initialState) {
|
|
|
5969
5989
|
}, loaderConfig);
|
|
5970
5990
|
const [loadingState, setLoadingState] = (0, import_react33.useState)(initialState);
|
|
5971
5991
|
const shouldDisplayLoader = config.initial && loadingState === "initial" || config.submission && loadingState === "submission";
|
|
5972
|
-
const loader = shouldDisplayLoader ? /* @__PURE__ */ (0,
|
|
5992
|
+
const loader = shouldDisplayLoader ? /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
5973
5993
|
import_components24.Loader,
|
|
5974
5994
|
{
|
|
5975
5995
|
size: config.size,
|
|
@@ -6003,10 +6023,10 @@ var ErrorBoundary_messages_default = (0, import_react_intl26.defineMessages)({
|
|
|
6003
6023
|
});
|
|
6004
6024
|
|
|
6005
6025
|
// src/dynamicFlow/utils/errorBoundary/ErrorBoundaryAlert.tsx
|
|
6006
|
-
var
|
|
6026
|
+
var import_jsx_runtime58 = require("react/jsx-runtime");
|
|
6007
6027
|
var ErrorBoundaryAlert = ({ onDismiss }) => {
|
|
6008
6028
|
const { formatMessage } = (0, import_react_intl27.useIntl)();
|
|
6009
|
-
return /* @__PURE__ */ (0,
|
|
6029
|
+
return /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
6010
6030
|
import_components25.Alert,
|
|
6011
6031
|
{
|
|
6012
6032
|
action: {
|
|
@@ -6022,7 +6042,7 @@ var ErrorBoundaryAlert = ({ onDismiss }) => {
|
|
|
6022
6042
|
};
|
|
6023
6043
|
|
|
6024
6044
|
// src/dynamicFlow/utils/errorBoundary/ErrorBoundary.tsx
|
|
6025
|
-
var
|
|
6045
|
+
var import_jsx_runtime59 = require("react/jsx-runtime");
|
|
6026
6046
|
var noop6 = () => {
|
|
6027
6047
|
};
|
|
6028
6048
|
var ErrorBoundary = class extends import_react34.Component {
|
|
@@ -6043,8 +6063,8 @@ var ErrorBoundary = class extends import_react34.Component {
|
|
|
6043
6063
|
render() {
|
|
6044
6064
|
const { children } = this.props;
|
|
6045
6065
|
const { hasError, isFatalError } = this.state;
|
|
6046
|
-
return /* @__PURE__ */ (0,
|
|
6047
|
-
hasError && /* @__PURE__ */ (0,
|
|
6066
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(import_jsx_runtime59.Fragment, { children: [
|
|
6067
|
+
hasError && /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(ErrorBoundaryAlert, { onDismiss: this.handleErrorReset }),
|
|
6048
6068
|
!isFatalError && children
|
|
6049
6069
|
] });
|
|
6050
6070
|
}
|
|
@@ -6113,7 +6133,7 @@ var assertResponseIsValid = (response) => {
|
|
|
6113
6133
|
var isResponse = (response) => typeof response === "object" && response !== null && "clone" in response && "bodyUsed" in response;
|
|
6114
6134
|
|
|
6115
6135
|
// src/dynamicFlow/DynamicFlow.tsx
|
|
6116
|
-
var
|
|
6136
|
+
var import_jsx_runtime60 = require("react/jsx-runtime");
|
|
6117
6137
|
var noop7 = () => {
|
|
6118
6138
|
};
|
|
6119
6139
|
var DynamicFlowComponent = ({
|
|
@@ -6132,7 +6152,7 @@ var DynamicFlowComponent = ({
|
|
|
6132
6152
|
const {
|
|
6133
6153
|
formErrors,
|
|
6134
6154
|
globalError,
|
|
6135
|
-
step:
|
|
6155
|
+
step: step33,
|
|
6136
6156
|
models,
|
|
6137
6157
|
etag,
|
|
6138
6158
|
modelIsValid,
|
|
@@ -6146,15 +6166,15 @@ var DynamicFlowComponent = ({
|
|
|
6146
6166
|
loaderConfig,
|
|
6147
6167
|
initialStep ? "idle" : "initial"
|
|
6148
6168
|
);
|
|
6149
|
-
const logWarning = getLogger("warning", onLog, flowId,
|
|
6150
|
-
const logError = getLogger("error", onLog, flowId,
|
|
6151
|
-
const logCritical = getLogger("critical", onLog, flowId,
|
|
6169
|
+
const logWarning = getLogger("warning", onLog, flowId, step33 == null ? void 0 : step33.key);
|
|
6170
|
+
const logError = getLogger("error", onLog, flowId, step33 == null ? void 0 : step33.key);
|
|
6171
|
+
const logCritical = getLogger("critical", onLog, flowId, step33 == null ? void 0 : step33.key);
|
|
6152
6172
|
const analyticsMetadata = (0, import_react35.useMemo)(
|
|
6153
6173
|
() => {
|
|
6154
6174
|
var _a;
|
|
6155
|
-
return __spreadValues({ flowId, stepId:
|
|
6175
|
+
return __spreadValues({ flowId, stepId: step33 == null ? void 0 : step33.key }, (_a = step33 == null ? void 0 : step33.analytics) != null ? _a : {});
|
|
6156
6176
|
},
|
|
6157
|
-
[flowId,
|
|
6177
|
+
[flowId, step33]
|
|
6158
6178
|
);
|
|
6159
6179
|
const dispatchEvent = (0, import_react35.useMemo)(
|
|
6160
6180
|
() => getEventDispatcher(onEvent, analyticsMetadata),
|
|
@@ -6238,8 +6258,8 @@ var DynamicFlowComponent = ({
|
|
|
6238
6258
|
return dispatchEventAndComplete(parsedResponse.result);
|
|
6239
6259
|
case "step":
|
|
6240
6260
|
default: {
|
|
6241
|
-
const { step:
|
|
6242
|
-
return fetchType === "submission" ? updateStepAfterSubmission(
|
|
6261
|
+
const { step: step34, etag: etag2 } = parsedResponse;
|
|
6262
|
+
return fetchType === "submission" ? updateStepAfterSubmission(step34, etag2) : updateStepAfterRefresh(step34, etag2);
|
|
6243
6263
|
}
|
|
6244
6264
|
}
|
|
6245
6265
|
} catch (error) {
|
|
@@ -6254,8 +6274,8 @@ var DynamicFlowComponent = ({
|
|
|
6254
6274
|
setLoadingState("idle");
|
|
6255
6275
|
dispatchEvent("Dynamic Flow - Step Started", __spreadValues({ stepId: newStep.key }, newStep == null ? void 0 : newStep.analytics));
|
|
6256
6276
|
};
|
|
6257
|
-
const updateStepAfterRefresh = (
|
|
6258
|
-
setStepAndEtag(
|
|
6277
|
+
const updateStepAfterRefresh = (step34, etag2) => {
|
|
6278
|
+
setStepAndEtag(step34, etag2);
|
|
6259
6279
|
setLoadingState("idle");
|
|
6260
6280
|
dispatchEvent("Dynamic Flow - Step Refreshed", { status: "success" });
|
|
6261
6281
|
};
|
|
@@ -6316,7 +6336,7 @@ var DynamicFlowComponent = ({
|
|
|
6316
6336
|
const refreshOnChangeIfNeeded = (props, updatedModels) => {
|
|
6317
6337
|
const { triggerSchema } = props;
|
|
6318
6338
|
if (shouldTriggerRefresh(props)) {
|
|
6319
|
-
const url = triggerSchema.refreshFormUrl || (
|
|
6339
|
+
const url = triggerSchema.refreshFormUrl || (step33 == null ? void 0 : step33.refreshFormUrl);
|
|
6320
6340
|
const action2 = { url, method: "POST" };
|
|
6321
6341
|
debouncedFetchRefresh(action2, combineModels2(updatedModels), etag, triggerSchema);
|
|
6322
6342
|
}
|
|
@@ -6368,10 +6388,10 @@ var DynamicFlowComponent = ({
|
|
|
6368
6388
|
}
|
|
6369
6389
|
void fetchNextStep(action2);
|
|
6370
6390
|
};
|
|
6371
|
-
return /* @__PURE__ */ (0,
|
|
6391
|
+
return /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(LogProvider, { flowId, stepId: step33 == null ? void 0 : step33.key, onLog, children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(EventsContextProvider, { metadata: analyticsMetadata, onEvent, children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(DynamicFlowProvider, { loading: loadingState !== "idle", children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(HttpClientProvider, { httpClient, children: loader !== null ? loader : /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
6372
6392
|
DynamicFlowStep,
|
|
6373
6393
|
{
|
|
6374
|
-
step:
|
|
6394
|
+
step: step33,
|
|
6375
6395
|
model: combineModels2(models),
|
|
6376
6396
|
submitted,
|
|
6377
6397
|
globalError,
|
|
@@ -6384,7 +6404,7 @@ var DynamicFlowComponent = ({
|
|
|
6384
6404
|
}
|
|
6385
6405
|
) }) }) }) });
|
|
6386
6406
|
};
|
|
6387
|
-
var DynamicFlow = (props) => /* @__PURE__ */ (0,
|
|
6407
|
+
var DynamicFlow = (props) => /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(ErrorBoundary_default, { onError: props.onError, children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(DynamicFlowComponent, __spreadValues({}, props)) });
|
|
6388
6408
|
var DynamicFlow_default = DynamicFlow;
|
|
6389
6409
|
var combineModels2 = (formModels) => {
|
|
6390
6410
|
return Object.values(formModels).reduce((previous, model) => __spreadValues(__spreadValues({}, previous), model), {});
|
|
@@ -6409,6 +6429,8 @@ __export(components_exports, {
|
|
|
6409
6429
|
columns: () => columns_default,
|
|
6410
6430
|
copyable: () => copyable_default,
|
|
6411
6431
|
decision: () => decision_default,
|
|
6432
|
+
decisionFlags: () => decision_flags_default,
|
|
6433
|
+
decisionIcons: () => decision_icons_default,
|
|
6412
6434
|
heading: () => heading_default,
|
|
6413
6435
|
image: () => image_default,
|
|
6414
6436
|
info: () => info_default,
|
|
@@ -6642,6 +6664,17 @@ var step6 = {
|
|
|
6642
6664
|
title: "",
|
|
6643
6665
|
url: "external"
|
|
6644
6666
|
}
|
|
6667
|
+
},
|
|
6668
|
+
{
|
|
6669
|
+
title: "Currency flags are now supported as well",
|
|
6670
|
+
disabled: false,
|
|
6671
|
+
icon: {
|
|
6672
|
+
name: "flag-eur"
|
|
6673
|
+
},
|
|
6674
|
+
action: {
|
|
6675
|
+
title: "",
|
|
6676
|
+
url: "external"
|
|
6677
|
+
}
|
|
6645
6678
|
}
|
|
6646
6679
|
]
|
|
6647
6680
|
}
|
|
@@ -6649,8 +6682,69 @@ var step6 = {
|
|
|
6649
6682
|
};
|
|
6650
6683
|
var decision_default = step6;
|
|
6651
6684
|
|
|
6652
|
-
// src/fixtures/components/
|
|
6685
|
+
// src/fixtures/components/decision-flags.ts
|
|
6653
6686
|
var step7 = {
|
|
6687
|
+
type: "form",
|
|
6688
|
+
key: "Components/Decision Flags",
|
|
6689
|
+
title: "Decision Component",
|
|
6690
|
+
description: "A step with a decision Component.",
|
|
6691
|
+
actions: [],
|
|
6692
|
+
schemas: [],
|
|
6693
|
+
layout: [
|
|
6694
|
+
{
|
|
6695
|
+
type: "heading",
|
|
6696
|
+
size: "sm",
|
|
6697
|
+
text: "Please continue using one of the following options:"
|
|
6698
|
+
},
|
|
6699
|
+
{
|
|
6700
|
+
type: "decision",
|
|
6701
|
+
options: availableCurrencyFlags.map((currencyCode) => {
|
|
6702
|
+
return {
|
|
6703
|
+
title: `${currencyCode.toUpperCase()}`,
|
|
6704
|
+
icon: {
|
|
6705
|
+
name: `flag-${currencyCode}`
|
|
6706
|
+
},
|
|
6707
|
+
action: { url: "/" }
|
|
6708
|
+
};
|
|
6709
|
+
})
|
|
6710
|
+
}
|
|
6711
|
+
]
|
|
6712
|
+
};
|
|
6713
|
+
var decision_flags_default = step7;
|
|
6714
|
+
|
|
6715
|
+
// src/fixtures/components/decision-icons.ts
|
|
6716
|
+
var icons2 = __toESM(require("@transferwise/icons"));
|
|
6717
|
+
var step8 = {
|
|
6718
|
+
type: "form",
|
|
6719
|
+
key: "Components/Decision Icons",
|
|
6720
|
+
title: "Decision Component",
|
|
6721
|
+
description: "A step with a decision Component.",
|
|
6722
|
+
actions: [],
|
|
6723
|
+
schemas: [],
|
|
6724
|
+
layout: [
|
|
6725
|
+
{
|
|
6726
|
+
type: "heading",
|
|
6727
|
+
size: "sm",
|
|
6728
|
+
text: "Please continue using one of the following options:"
|
|
6729
|
+
},
|
|
6730
|
+
{
|
|
6731
|
+
type: "decision",
|
|
6732
|
+
options: Object.keys(icons2).map((iconName) => {
|
|
6733
|
+
return {
|
|
6734
|
+
title: `${iconName} Icon`,
|
|
6735
|
+
icon: {
|
|
6736
|
+
name: iconName
|
|
6737
|
+
},
|
|
6738
|
+
action: { url: "/" }
|
|
6739
|
+
};
|
|
6740
|
+
})
|
|
6741
|
+
}
|
|
6742
|
+
]
|
|
6743
|
+
};
|
|
6744
|
+
var decision_icons_default = step8;
|
|
6745
|
+
|
|
6746
|
+
// src/fixtures/components/heading.ts
|
|
6747
|
+
var step9 = {
|
|
6654
6748
|
type: "form",
|
|
6655
6749
|
key: "Components/Heading",
|
|
6656
6750
|
title: "Heading Component",
|
|
@@ -6663,11 +6757,11 @@ var step7 = {
|
|
|
6663
6757
|
size
|
|
6664
6758
|
}))
|
|
6665
6759
|
};
|
|
6666
|
-
var heading_default =
|
|
6760
|
+
var heading_default = step9;
|
|
6667
6761
|
|
|
6668
6762
|
// src/fixtures/components/image.ts
|
|
6669
6763
|
var sizes = ["xs", "sm", "md", "lg", "xl"];
|
|
6670
|
-
var
|
|
6764
|
+
var step10 = {
|
|
6671
6765
|
type: "form",
|
|
6672
6766
|
key: "Components/Image",
|
|
6673
6767
|
title: "Image Component",
|
|
@@ -6688,10 +6782,10 @@ var step8 = {
|
|
|
6688
6782
|
}
|
|
6689
6783
|
])
|
|
6690
6784
|
};
|
|
6691
|
-
var image_default =
|
|
6785
|
+
var image_default = step10;
|
|
6692
6786
|
|
|
6693
6787
|
// src/fixtures/components/info.ts
|
|
6694
|
-
var
|
|
6788
|
+
var step11 = {
|
|
6695
6789
|
type: "form",
|
|
6696
6790
|
key: "Components/Info",
|
|
6697
6791
|
title: "Info Component",
|
|
@@ -6723,10 +6817,10 @@ But the best part? Bananas are biodegradable and environmentally-friendly, makin
|
|
|
6723
6817
|
{ type: "alert", markdown: "Links always open in a new tab.", context: "neutral" }
|
|
6724
6818
|
]
|
|
6725
6819
|
};
|
|
6726
|
-
var info_default =
|
|
6820
|
+
var info_default = step11;
|
|
6727
6821
|
|
|
6728
6822
|
// src/fixtures/components/list.ts
|
|
6729
|
-
var
|
|
6823
|
+
var step12 = {
|
|
6730
6824
|
type: "form",
|
|
6731
6825
|
key: "Components/List",
|
|
6732
6826
|
title: "List Component",
|
|
@@ -6759,10 +6853,10 @@ var step10 = {
|
|
|
6759
6853
|
}
|
|
6760
6854
|
]
|
|
6761
6855
|
};
|
|
6762
|
-
var list_default =
|
|
6856
|
+
var list_default = step12;
|
|
6763
6857
|
|
|
6764
6858
|
// src/fixtures/components/loading-indicator.ts
|
|
6765
|
-
var
|
|
6859
|
+
var step13 = {
|
|
6766
6860
|
type: "form",
|
|
6767
6861
|
key: "Components/Loading Indicator",
|
|
6768
6862
|
title: "Loading Indicator Component",
|
|
@@ -6777,10 +6871,10 @@ var step11 = {
|
|
|
6777
6871
|
}
|
|
6778
6872
|
]
|
|
6779
6873
|
};
|
|
6780
|
-
var loading_indicator_default =
|
|
6874
|
+
var loading_indicator_default = step13;
|
|
6781
6875
|
|
|
6782
6876
|
// src/fixtures/components/paragraph.ts
|
|
6783
|
-
var
|
|
6877
|
+
var step14 = {
|
|
6784
6878
|
type: "form",
|
|
6785
6879
|
key: "Components/Paragraph",
|
|
6786
6880
|
title: "Paragraph Component",
|
|
@@ -6807,10 +6901,10 @@ var step12 = {
|
|
|
6807
6901
|
}
|
|
6808
6902
|
]
|
|
6809
6903
|
};
|
|
6810
|
-
var paragraph_default =
|
|
6904
|
+
var paragraph_default = step14;
|
|
6811
6905
|
|
|
6812
6906
|
// src/fixtures/components/review.ts
|
|
6813
|
-
var
|
|
6907
|
+
var step15 = {
|
|
6814
6908
|
type: "form",
|
|
6815
6909
|
key: "Components/Review",
|
|
6816
6910
|
title: "Review Component",
|
|
@@ -6869,7 +6963,7 @@ var step13 = {
|
|
|
6869
6963
|
}
|
|
6870
6964
|
]
|
|
6871
6965
|
};
|
|
6872
|
-
var review_default =
|
|
6966
|
+
var review_default = step15;
|
|
6873
6967
|
|
|
6874
6968
|
// src/fixtures/examples/index.ts
|
|
6875
6969
|
var examples_exports = {};
|
|
@@ -6882,7 +6976,7 @@ __export(examples_exports, {
|
|
|
6882
6976
|
});
|
|
6883
6977
|
|
|
6884
6978
|
// src/fixtures/examples/camera-capture.ts
|
|
6885
|
-
var
|
|
6979
|
+
var step16 = {
|
|
6886
6980
|
key: "Examples/Camera Capture",
|
|
6887
6981
|
title: "Camera Capture Example",
|
|
6888
6982
|
type: "form",
|
|
@@ -7002,10 +7096,10 @@ var step14 = {
|
|
|
7002
7096
|
},
|
|
7003
7097
|
refreshFormUrl: "/"
|
|
7004
7098
|
};
|
|
7005
|
-
var camera_capture_default =
|
|
7099
|
+
var camera_capture_default = step16;
|
|
7006
7100
|
|
|
7007
7101
|
// src/fixtures/examples/recipient.ts
|
|
7008
|
-
var
|
|
7102
|
+
var step17 = {
|
|
7009
7103
|
key: "Examples/Recipient Creation",
|
|
7010
7104
|
type: "form",
|
|
7011
7105
|
title: "Recipient Creation Example",
|
|
@@ -7317,10 +7411,10 @@ var step15 = {
|
|
|
7317
7411
|
details: {}
|
|
7318
7412
|
}
|
|
7319
7413
|
};
|
|
7320
|
-
var recipient_default =
|
|
7414
|
+
var recipient_default = step17;
|
|
7321
7415
|
|
|
7322
7416
|
// src/fixtures/examples/recipient-update.ts
|
|
7323
|
-
var
|
|
7417
|
+
var step18 = {
|
|
7324
7418
|
key: "Examples/Recipient Update",
|
|
7325
7419
|
type: "form",
|
|
7326
7420
|
title: "Edit recipient",
|
|
@@ -7569,10 +7663,10 @@ var step16 = {
|
|
|
7569
7663
|
}
|
|
7570
7664
|
]
|
|
7571
7665
|
};
|
|
7572
|
-
var recipient_update_default =
|
|
7666
|
+
var recipient_update_default = step18;
|
|
7573
7667
|
|
|
7574
7668
|
// src/fixtures/examples/single-file-upload.ts
|
|
7575
|
-
var
|
|
7669
|
+
var step19 = {
|
|
7576
7670
|
key: "Examples/Single File Upload",
|
|
7577
7671
|
type: "form",
|
|
7578
7672
|
title: "Single File Upload Example",
|
|
@@ -7669,10 +7763,10 @@ var step17 = {
|
|
|
7669
7763
|
frontSide: 0
|
|
7670
7764
|
}
|
|
7671
7765
|
};
|
|
7672
|
-
var single_file_upload_default =
|
|
7766
|
+
var single_file_upload_default = step19;
|
|
7673
7767
|
|
|
7674
7768
|
// src/fixtures/examples/step-validation-errors.ts
|
|
7675
|
-
var
|
|
7769
|
+
var step20 = {
|
|
7676
7770
|
key: "Examples/Step Validation Errors",
|
|
7677
7771
|
title: "Step with validation errors",
|
|
7678
7772
|
type: "form",
|
|
@@ -7746,7 +7840,7 @@ var step18 = {
|
|
|
7746
7840
|
}
|
|
7747
7841
|
]
|
|
7748
7842
|
};
|
|
7749
|
-
var step_validation_errors_default =
|
|
7843
|
+
var step_validation_errors_default = step20;
|
|
7750
7844
|
|
|
7751
7845
|
// src/fixtures/features/index.ts
|
|
7752
7846
|
var features_exports = {};
|
|
@@ -7759,7 +7853,7 @@ __export(features_exports, {
|
|
|
7759
7853
|
});
|
|
7760
7854
|
|
|
7761
7855
|
// src/fixtures/features/action-response.ts
|
|
7762
|
-
var
|
|
7856
|
+
var step21 = {
|
|
7763
7857
|
key: "Features/Action Response",
|
|
7764
7858
|
title: "Action Response",
|
|
7765
7859
|
description: "",
|
|
@@ -7787,10 +7881,10 @@ var step19 = {
|
|
|
7787
7881
|
}
|
|
7788
7882
|
]
|
|
7789
7883
|
};
|
|
7790
|
-
var action_response_default =
|
|
7884
|
+
var action_response_default = step21;
|
|
7791
7885
|
|
|
7792
7886
|
// src/fixtures/features/external.ts
|
|
7793
|
-
var
|
|
7887
|
+
var step22 = {
|
|
7794
7888
|
type: "form",
|
|
7795
7889
|
key: "Features/External",
|
|
7796
7890
|
title: "External Feature",
|
|
@@ -7820,10 +7914,10 @@ var step20 = {
|
|
|
7820
7914
|
actions: [],
|
|
7821
7915
|
schemas: []
|
|
7822
7916
|
};
|
|
7823
|
-
var external_default =
|
|
7917
|
+
var external_default = step22;
|
|
7824
7918
|
|
|
7825
7919
|
// src/fixtures/features/persist-async.ts
|
|
7826
|
-
var
|
|
7920
|
+
var step23 = {
|
|
7827
7921
|
type: "form",
|
|
7828
7922
|
key: "Features/Persist Async",
|
|
7829
7923
|
title: "Persist Async Feature",
|
|
@@ -7866,10 +7960,10 @@ var step21 = {
|
|
|
7866
7960
|
}
|
|
7867
7961
|
]
|
|
7868
7962
|
};
|
|
7869
|
-
var persist_async_default =
|
|
7963
|
+
var persist_async_default = step23;
|
|
7870
7964
|
|
|
7871
7965
|
// src/fixtures/features/polling.ts
|
|
7872
|
-
var
|
|
7966
|
+
var step24 = {
|
|
7873
7967
|
type: "form",
|
|
7874
7968
|
key: "Features/Polling",
|
|
7875
7969
|
title: "Polling Feature",
|
|
@@ -7901,10 +7995,10 @@ var step22 = {
|
|
|
7901
7995
|
actions: [],
|
|
7902
7996
|
schemas: []
|
|
7903
7997
|
};
|
|
7904
|
-
var polling_default =
|
|
7998
|
+
var polling_default = step24;
|
|
7905
7999
|
|
|
7906
8000
|
// src/fixtures/features/validation-async.ts
|
|
7907
|
-
var
|
|
8001
|
+
var step25 = {
|
|
7908
8002
|
type: "form",
|
|
7909
8003
|
key: "Features/Validation Async",
|
|
7910
8004
|
title: "Validation Async Feature",
|
|
@@ -7941,7 +8035,7 @@ var step23 = {
|
|
|
7941
8035
|
// name: 'Colin Robinson',
|
|
7942
8036
|
}
|
|
7943
8037
|
};
|
|
7944
|
-
var validation_async_default =
|
|
8038
|
+
var validation_async_default = step25;
|
|
7945
8039
|
|
|
7946
8040
|
// src/fixtures/layouts/index.ts
|
|
7947
8041
|
var layouts_exports = {};
|
|
@@ -8209,7 +8303,7 @@ var layout3 = [
|
|
|
8209
8303
|
var list_default2 = layout3;
|
|
8210
8304
|
|
|
8211
8305
|
// src/fixtures/layouts/pay-in.ts
|
|
8212
|
-
var
|
|
8306
|
+
var step26 = {
|
|
8213
8307
|
key: "PAY_ID",
|
|
8214
8308
|
type: "form",
|
|
8215
8309
|
title: "Pay Using PayID",
|
|
@@ -8305,7 +8399,7 @@ var step24 = {
|
|
|
8305
8399
|
}
|
|
8306
8400
|
]
|
|
8307
8401
|
};
|
|
8308
|
-
var pay_in_default =
|
|
8402
|
+
var pay_in_default = step26;
|
|
8309
8403
|
|
|
8310
8404
|
// src/fixtures/layouts/review.ts
|
|
8311
8405
|
var layout4 = [
|
|
@@ -8551,7 +8645,7 @@ var action = { action: { url: "/responses/success", method: "POST" } };
|
|
|
8551
8645
|
var action_default = action;
|
|
8552
8646
|
|
|
8553
8647
|
// src/fixtures/responses/action-response-final.ts
|
|
8554
|
-
var
|
|
8648
|
+
var step27 = {
|
|
8555
8649
|
type: "form",
|
|
8556
8650
|
key: "action-response-final",
|
|
8557
8651
|
title: "Action Response Final Step",
|
|
@@ -8574,14 +8668,14 @@ var step25 = {
|
|
|
8574
8668
|
}
|
|
8575
8669
|
]
|
|
8576
8670
|
};
|
|
8577
|
-
var action_response_final_default =
|
|
8671
|
+
var action_response_final_default = step27;
|
|
8578
8672
|
|
|
8579
8673
|
// src/fixtures/responses/exit.ts
|
|
8580
8674
|
var exit = { id: "123456", name: "Bob Loblaw", country: "US" };
|
|
8581
8675
|
var exit_default = exit;
|
|
8582
8676
|
|
|
8583
8677
|
// src/fixtures/responses/recipient-update-final.ts
|
|
8584
|
-
var
|
|
8678
|
+
var step28 = {
|
|
8585
8679
|
type: "form",
|
|
8586
8680
|
key: "recipient-update-final",
|
|
8587
8681
|
title: "Recipient Update Final Step",
|
|
@@ -8604,7 +8698,7 @@ var step26 = {
|
|
|
8604
8698
|
}
|
|
8605
8699
|
]
|
|
8606
8700
|
};
|
|
8607
|
-
var recipient_update_final_default =
|
|
8701
|
+
var recipient_update_final_default = step28;
|
|
8608
8702
|
|
|
8609
8703
|
// src/fixtures/schemas/index.ts
|
|
8610
8704
|
var schemas_exports = {};
|
|
@@ -8616,7 +8710,7 @@ __export(schemas_exports, {
|
|
|
8616
8710
|
});
|
|
8617
8711
|
|
|
8618
8712
|
// src/fixtures/schemas/basic-form.ts
|
|
8619
|
-
var
|
|
8713
|
+
var step29 = {
|
|
8620
8714
|
key: "Schemas/Basic Form",
|
|
8621
8715
|
title: "Simple Form",
|
|
8622
8716
|
description: "A simple form with text fields and a checkbox.",
|
|
@@ -8654,10 +8748,10 @@ var step27 = {
|
|
|
8654
8748
|
}
|
|
8655
8749
|
]
|
|
8656
8750
|
};
|
|
8657
|
-
var basic_form_default =
|
|
8751
|
+
var basic_form_default = step29;
|
|
8658
8752
|
|
|
8659
8753
|
// src/fixtures/schemas/number-and-integer.ts
|
|
8660
|
-
var
|
|
8754
|
+
var step30 = {
|
|
8661
8755
|
key: "Schemas/Number And Integer",
|
|
8662
8756
|
title: "Number and Integer Schemas",
|
|
8663
8757
|
description: "Number and Integer Schemas.",
|
|
@@ -8697,7 +8791,7 @@ var step28 = {
|
|
|
8697
8791
|
}
|
|
8698
8792
|
]
|
|
8699
8793
|
};
|
|
8700
|
-
var number_and_integer_default =
|
|
8794
|
+
var number_and_integer_default = step30;
|
|
8701
8795
|
|
|
8702
8796
|
// src/fixtures/schemas/one-of.ts
|
|
8703
8797
|
var currencies = [
|
|
@@ -8762,7 +8856,7 @@ var currencies = [
|
|
|
8762
8856
|
["ZAR", "South African rand"],
|
|
8763
8857
|
["ZMW", "Zambian kwacha"]
|
|
8764
8858
|
];
|
|
8765
|
-
var
|
|
8859
|
+
var step31 = {
|
|
8766
8860
|
key: "Schemas/OneOf",
|
|
8767
8861
|
title: "OneOf Schemas",
|
|
8768
8862
|
description: "OneOf Schema using select, radio buttons and tabs.",
|
|
@@ -8779,6 +8873,7 @@ var step29 = {
|
|
|
8779
8873
|
"account-type-radio": {
|
|
8780
8874
|
title: 'Personal or Business Account? (oneOf schema with two options default to control: "radio")',
|
|
8781
8875
|
analyticsId: "account-type-radio",
|
|
8876
|
+
control: "radio",
|
|
8782
8877
|
oneOf: [
|
|
8783
8878
|
{
|
|
8784
8879
|
title: "Personal",
|
|
@@ -8919,10 +9014,10 @@ var step29 = {
|
|
|
8919
9014
|
}
|
|
8920
9015
|
]
|
|
8921
9016
|
};
|
|
8922
|
-
var one_of_default =
|
|
9017
|
+
var one_of_default = step31;
|
|
8923
9018
|
|
|
8924
9019
|
// src/fixtures/schemas/string-formats.ts
|
|
8925
|
-
var
|
|
9020
|
+
var step32 = {
|
|
8926
9021
|
key: "Schemas/String Formats",
|
|
8927
9022
|
title: "String Schema Formats",
|
|
8928
9023
|
description: "String schemas with different formats (password, date, telephone).",
|
|
@@ -8983,7 +9078,7 @@ var step30 = {
|
|
|
8983
9078
|
"date-lookup": "2023-01-01"
|
|
8984
9079
|
}
|
|
8985
9080
|
};
|
|
8986
|
-
var string_formats_default =
|
|
9081
|
+
var string_formats_default = step32;
|
|
8987
9082
|
|
|
8988
9083
|
// src/fixtures/utils/image-util.ts
|
|
8989
9084
|
var getImageStep = (size) => {
|
|
@@ -9351,10 +9446,10 @@ var pl_default = {
|
|
|
9351
9446
|
"dynamicFlows.CameraCapture.reviewRetry": "Nie, spr\xF3buj ponownie",
|
|
9352
9447
|
"dynamicFlows.CameraCapture.reviewSubmit": "Tak, prze\u015Blij",
|
|
9353
9448
|
"dynamicFlows.ControlFeedback.maxLength": "Prosimy wprowadzi\u0107 do {maxLength} znak\xF3w.",
|
|
9354
|
-
"dynamicFlows.ControlFeedback.maximum": "Wprowad\u017A liczb\u0119
|
|
9449
|
+
"dynamicFlows.ControlFeedback.maximum": "Wprowad\u017A liczb\u0119 r\xF3wn\u0105 lub mniejsz\u0105 ni\u017C {maximum}.",
|
|
9355
9450
|
"dynamicFlows.ControlFeedback.maximumDate": "Wprowad\u017A dat\u0119 nie p\xF3\u017Aniejsz\u0105 ni\u017C {maximum}.",
|
|
9356
9451
|
"dynamicFlows.ControlFeedback.minLength": "Prosz\u0119 wpisa\u0107 co najmniej {minLength} znak\xF3w.",
|
|
9357
|
-
"dynamicFlows.ControlFeedback.minimum": "Wprowad\u017A liczb\u0119
|
|
9452
|
+
"dynamicFlows.ControlFeedback.minimum": "Wprowad\u017A liczb\u0119 r\xF3wn\u0105 lub wi\u0119ksz\u0105 ni\u017C {minimum}.",
|
|
9358
9453
|
"dynamicFlows.ControlFeedback.minimumDate": "Wprowad\u017A dat\u0119 nie wcze\u015Bniejsz\u0105 ni\u017C {minimum}.",
|
|
9359
9454
|
"dynamicFlows.ControlFeedback.pattern": "Wprowad\u017A t\u0119 warto\u015B\u0107 w prawid\u0142owym formacie.",
|
|
9360
9455
|
"dynamicFlows.ControlFeedback.patternDate": "Wprowad\u017A dat\u0119 w prawid\u0142owym formacie.",
|
|
@@ -9542,10 +9637,10 @@ var tr_default = {
|
|
|
9542
9637
|
var zh_default = {
|
|
9543
9638
|
"dynamicFlows.ArraySchema.maxItemsError": "\u8ACB\u6DFB\u52A0\u4E0D\u8D85\u904E{maxItems}\u9805\u3002",
|
|
9544
9639
|
"dynamicFlows.ArraySchema.minItemsError": "\u8ACB\u81F3\u5C11\u6DFB\u52A0{minItems}\u9805\u3002",
|
|
9545
|
-
"dynamicFlows.CameraCapture.CameraNotSupported.paragraph": "\u4F60\u76EE\u524D\u4F7F\u7528\u7684\u700F\u89BD\u5668\u4E0D\u652F\u6301\u76F8\u6A5F\
|
|
9546
|
-
"dynamicFlows.CameraCapture.CameraNotSupported.title": "\u4E0D\u652F\u6301\u76F8\u6A5F
|
|
9640
|
+
"dynamicFlows.CameraCapture.CameraNotSupported.paragraph": "\u4F60\u76EE\u524D\u4F7F\u7528\u7684\u700F\u89BD\u5668\u4E0D\u652F\u6301\u76F8\u6A5F\u3002\u8ACB\u5617\u8A66\u4F7F\u7528\u5176\u4ED6\u700F\u89BD\u5668\u6216\u5176\u4ED6\u88DD\u7F6E\uFF0C\u6216\u8005\u4F60\u53EF\u4EE5\u4E0B\u8F09\u6211\u5011\u7684\u61C9\u7528\u7A0B\u5F0F\u3002",
|
|
9641
|
+
"dynamicFlows.CameraCapture.CameraNotSupported.title": "\u4E0D\u652F\u6301\u76F8\u6A5F",
|
|
9547
9642
|
"dynamicFlows.CameraCapture.NoCameraAccess.action": "\u5141\u8A31\u53D6\u7528\u76F8\u6A5F",
|
|
9548
|
-
"dynamicFlows.CameraCapture.NoCameraAccess.paragraph": "\u4F60\u53EF\u4EE5\u5728\u700F\u89BD\u5668\u7684\u8A2D\u5B9A\u4E2D\u958B\u555F\u76F8\u6A5F\u5B58\u53D6\u6B0A\u9650",
|
|
9643
|
+
"dynamicFlows.CameraCapture.NoCameraAccess.paragraph": "\u4F60\u53EF\u4EE5\u5728\u700F\u89BD\u5668\u7684\u8A2D\u5B9A\u4E2D\u958B\u555F\u76F8\u6A5F\u5B58\u53D6\u6B0A\u9650\u3002",
|
|
9549
9644
|
"dynamicFlows.CameraCapture.NoCameraAccess.title": "\u6211\u5011\u7121\u6CD5\u53D6\u7528\u4F60\u7684\u76F8\u6A5F",
|
|
9550
9645
|
"dynamicFlows.CameraCapture.reviewInstructions": "\u4F60\u7684\u7167\u7247\u662F\u5426\u5B8C\u6574\u3001\u6E05\u6670\u53CA\u53EF\u8B80\uFF1F",
|
|
9551
9646
|
"dynamicFlows.CameraCapture.reviewRetry": "\u5426\uFF0C\u518D\u8A66\u4E00\u6B21",
|
|
@@ -9560,13 +9655,13 @@ var zh_default = {
|
|
|
9560
9655
|
"dynamicFlows.ControlFeedback.patternDate": "\u8ACB\u4EE5\u6B63\u78BA\u683C\u5F0F\u8F38\u5165\u65E5\u671F\u3002",
|
|
9561
9656
|
"dynamicFlows.ControlFeedback.required": "\u8ACB\u586B\u5BEB\u6B64\u6B04\u4F4D\u3002",
|
|
9562
9657
|
"dynamicFlows.ControlFeedback.type": "\u932F\u8AA4\u7684\u985E\u578B",
|
|
9563
|
-
"dynamicFlows.DynamicExternal.retryTitle": "\u91CD\u65B0\u958B\
|
|
9658
|
+
"dynamicFlows.DynamicExternal.retryTitle": "\u91CD\u65B0\u6253\u958B\u8996\u7A97",
|
|
9564
9659
|
"dynamicFlows.DynamicParagraph.copied": "\u8907\u88FD\u5230\u526A\u8CBC\u677F",
|
|
9565
9660
|
"dynamicFlows.DynamicParagraph.copy": "\u8907\u88FD",
|
|
9566
9661
|
"dynamicFlows.ErrorBoundary.errorAlert": "\u5662\uFF01\u51FA\u4E86\u4E9B\u554F\u984C...",
|
|
9567
9662
|
"dynamicFlows.ErrorBoundary.retry": "\u91CD\u8A66",
|
|
9568
9663
|
"dynamicFlows.ExternalConfirmation.cancel": "\u53D6\u6D88",
|
|
9569
|
-
"dynamicFlows.ExternalConfirmation.description": "\u8ACB\u78BA\u8A8D\u4F60\
|
|
9664
|
+
"dynamicFlows.ExternalConfirmation.description": "\u8ACB\u78BA\u8A8D\u4F60\u662F\u5426\u8981\u5728\u700F\u89BD\u5668\u7684\u65B0\u5206\u9801\u6253\u958B**{origin}**\u3002",
|
|
9570
9665
|
"dynamicFlows.ExternalConfirmation.open": "\u5728\u65B0\u5206\u9801\u4E2D\u958B\u555F",
|
|
9571
9666
|
"dynamicFlows.ExternalConfirmation.title": "\u8ACB\u78BA\u8A8D",
|
|
9572
9667
|
"dynamicFlows.Help.ariaLabel": "\u6309\u6B64\u67E5\u770B\u8A73\u60C5\u3002",
|