@wise/dynamic-flow-client 3.32.0 → 3.33.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/main.js +785 -529
- package/build/main.min.js +1 -1
- package/build/main.mjs +717 -461
- package/build/types/revamp/domain/components/DecisionComponent.d.ts +3 -2
- package/build/types/revamp/domain/components/ListComponent.d.ts +30 -0
- package/build/types/revamp/domain/features/summary/summary-utils.d.ts +1 -1
- package/build/types/revamp/domain/mappers/layout/decisionLayoutToComponent.d.ts +7 -2
- package/build/types/revamp/domain/mappers/layout/deprecatedListLayoutToComponent.d.ts +2 -0
- package/build/types/revamp/domain/mappers/layout/listLayoutToComponent.d.ts +4 -2
- package/build/types/revamp/domain/types.d.ts +9 -2
- package/build/types/revamp/renderers/mappers/listComponentToProps.d.ts +3 -0
- package/build/types/revamp/renderers/mappers/utils/inputComponentToProps.d.ts +5 -1
- package/package.json +2 -2
package/build/main.mjs
CHANGED
|
@@ -64,7 +64,7 @@ var require_classnames = __commonJS({
|
|
|
64
64
|
(function() {
|
|
65
65
|
"use strict";
|
|
66
66
|
var hasOwn = {}.hasOwnProperty;
|
|
67
|
-
function
|
|
67
|
+
function classNames17() {
|
|
68
68
|
var classes = "";
|
|
69
69
|
for (var i = 0; i < arguments.length; i++) {
|
|
70
70
|
var arg = arguments[i];
|
|
@@ -82,7 +82,7 @@ var require_classnames = __commonJS({
|
|
|
82
82
|
return "";
|
|
83
83
|
}
|
|
84
84
|
if (Array.isArray(arg)) {
|
|
85
|
-
return
|
|
85
|
+
return classNames17.apply(null, arg);
|
|
86
86
|
}
|
|
87
87
|
if (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes("[native code]")) {
|
|
88
88
|
return arg.toString();
|
|
@@ -105,14 +105,14 @@ var require_classnames = __commonJS({
|
|
|
105
105
|
return value + newClass;
|
|
106
106
|
}
|
|
107
107
|
if (typeof module !== "undefined" && module.exports) {
|
|
108
|
-
|
|
109
|
-
module.exports =
|
|
108
|
+
classNames17.default = classNames17;
|
|
109
|
+
module.exports = classNames17;
|
|
110
110
|
} else if (typeof define === "function" && typeof define.amd === "object" && define.amd) {
|
|
111
111
|
define("classnames", [], function() {
|
|
112
|
-
return
|
|
112
|
+
return classNames17;
|
|
113
113
|
});
|
|
114
114
|
} else {
|
|
115
|
-
window.classNames =
|
|
115
|
+
window.classNames = classNames17;
|
|
116
116
|
}
|
|
117
117
|
})();
|
|
118
118
|
}
|
|
@@ -1495,7 +1495,7 @@ var mapErrorsToValidationState = (errors) => {
|
|
|
1495
1495
|
|
|
1496
1496
|
// src/revamp/renderers/mappers/utils/inputComponentToProps.ts
|
|
1497
1497
|
var inputComponentToProps = (component, type) => {
|
|
1498
|
-
var _a;
|
|
1498
|
+
var _a, _b, _c, _d;
|
|
1499
1499
|
const {
|
|
1500
1500
|
autoComplete,
|
|
1501
1501
|
control,
|
|
@@ -1524,7 +1524,11 @@ var inputComponentToProps = (component, type) => {
|
|
|
1524
1524
|
help,
|
|
1525
1525
|
icon,
|
|
1526
1526
|
id,
|
|
1527
|
-
image
|
|
1527
|
+
image: image ? {
|
|
1528
|
+
accessibilityDescription: (_b = image.accessibilityDescription) != null ? _b : image.text,
|
|
1529
|
+
uri: image.uri,
|
|
1530
|
+
url: (_d = (_c = image.uri) != null ? _c : image.url) != null ? _d : ""
|
|
1531
|
+
} : void 0,
|
|
1528
1532
|
label: title,
|
|
1529
1533
|
placeholder,
|
|
1530
1534
|
required,
|
|
@@ -1594,7 +1598,19 @@ var dateInputComponentToProps = (component) => __spreadProps(__spreadValues({},
|
|
|
1594
1598
|
});
|
|
1595
1599
|
|
|
1596
1600
|
// src/revamp/renderers/mappers/decisionComponentToProps.ts
|
|
1597
|
-
var decisionComponentToProps = (component) => pick(component, "type", "control", "
|
|
1601
|
+
var decisionComponentToProps = (component) => __spreadProps(__spreadValues({}, pick(component, "type", "control", "margin", "title")), {
|
|
1602
|
+
options: component.options.map((_a) => {
|
|
1603
|
+
var _b = _a, { image } = _b, rest = __objRest(_b, ["image"]);
|
|
1604
|
+
var _a2, _b2, _c;
|
|
1605
|
+
return __spreadProps(__spreadValues({}, rest), {
|
|
1606
|
+
image: image ? {
|
|
1607
|
+
accessibilityDescription: (_a2 = image.accessibilityDescription) != null ? _a2 : image.text,
|
|
1608
|
+
uri: image.uri,
|
|
1609
|
+
url: (_c = (_b2 = image.uri) != null ? _b2 : image.url) != null ? _c : ""
|
|
1610
|
+
} : image
|
|
1611
|
+
});
|
|
1612
|
+
})
|
|
1613
|
+
});
|
|
1598
1614
|
|
|
1599
1615
|
// src/revamp/renderers/mappers/dividerComponentToProps.ts
|
|
1600
1616
|
var dividerComponentToProps = (component) => pick(component, "type", "control", "margin");
|
|
@@ -1675,17 +1691,25 @@ var numberInputComponentToProps = (component) => __spreadProps(__spreadValues({}
|
|
|
1675
1691
|
});
|
|
1676
1692
|
|
|
1677
1693
|
// src/revamp/renderers/mappers/objectComponentToProps.ts
|
|
1678
|
-
var objectComponentToProps = (component, children) =>
|
|
1679
|
-
|
|
1680
|
-
|
|
1681
|
-
|
|
1682
|
-
})
|
|
1694
|
+
var objectComponentToProps = (component, children) => {
|
|
1695
|
+
var _a, _b;
|
|
1696
|
+
return __spreadProps(__spreadValues({
|
|
1697
|
+
type: "form-section"
|
|
1698
|
+
}, pick(component, "control", "description", "help", "icon", "title")), {
|
|
1699
|
+
// TODO: Remove when viewbindings are updated
|
|
1700
|
+
image: component.image ? __spreadProps(__spreadValues({}, component.image), {
|
|
1701
|
+
url: (_b = (_a = component.image) == null ? void 0 : _a.url) != null ? _b : ""
|
|
1702
|
+
}) : void 0,
|
|
1703
|
+
children
|
|
1704
|
+
});
|
|
1705
|
+
};
|
|
1683
1706
|
|
|
1684
1707
|
// src/revamp/renderers/mappers/paragraphComponentToProps.ts
|
|
1685
1708
|
var paragraphComponentToProps = (component) => pick(component, "type", "align", "control", "margin", "text");
|
|
1686
1709
|
|
|
1687
1710
|
// src/revamp/renderers/mappers/repeatableComponentToProps.ts
|
|
1688
1711
|
var repeatableComponentToProps = (component, children, editableItemChildren) => {
|
|
1712
|
+
var _a, _b;
|
|
1689
1713
|
const {
|
|
1690
1714
|
addItemTitle,
|
|
1691
1715
|
control,
|
|
@@ -1704,13 +1728,26 @@ var repeatableComponentToProps = (component, children, editableItemChildren) =>
|
|
|
1704
1728
|
onSave,
|
|
1705
1729
|
onRemove
|
|
1706
1730
|
} = component;
|
|
1731
|
+
const getSummaryImage = (componentSummary) => {
|
|
1732
|
+
var _a2, _b2;
|
|
1733
|
+
if (componentSummary.image) {
|
|
1734
|
+
return __spreadProps(__spreadValues({}, componentSummary.image), {
|
|
1735
|
+
url: (_a2 = componentSummary.image.url) != null ? _a2 : ""
|
|
1736
|
+
});
|
|
1737
|
+
}
|
|
1738
|
+
if (summaryDefaults.image) {
|
|
1739
|
+
return __spreadProps(__spreadValues({}, summaryDefaults.image), {
|
|
1740
|
+
url: (_b2 = summaryDefaults.image.url) != null ? _b2 : ""
|
|
1741
|
+
});
|
|
1742
|
+
}
|
|
1743
|
+
};
|
|
1707
1744
|
const getSummary = (componentSummary) => {
|
|
1708
|
-
var
|
|
1745
|
+
var _a2, _b2, _c;
|
|
1709
1746
|
return {
|
|
1710
|
-
title: (
|
|
1711
|
-
description: (
|
|
1747
|
+
title: (_a2 = componentSummary.title) != null ? _a2 : summaryDefaults.title,
|
|
1748
|
+
description: (_b2 = componentSummary.description) != null ? _b2 : summaryDefaults.description,
|
|
1712
1749
|
icon: (_c = componentSummary.icon) != null ? _c : summaryDefaults.icon,
|
|
1713
|
-
image: (
|
|
1750
|
+
image: getSummaryImage(componentSummary)
|
|
1714
1751
|
};
|
|
1715
1752
|
};
|
|
1716
1753
|
const itemProps = components.map((childComponent) => __spreadProps(__spreadValues({}, getSummary(childComponent.getSummary())), {
|
|
@@ -1726,7 +1763,11 @@ var repeatableComponentToProps = (component, children, editableItemChildren) =>
|
|
|
1726
1763
|
editItemTitle,
|
|
1727
1764
|
error: errors == null ? void 0 : errors[0],
|
|
1728
1765
|
icon,
|
|
1729
|
-
image
|
|
1766
|
+
image: image ? {
|
|
1767
|
+
accessibilityDescription: (_a = image.accessibilityDescription) != null ? _a : image.text,
|
|
1768
|
+
uri: image.uri,
|
|
1769
|
+
url: (_b = image.url) != null ? _b : ""
|
|
1770
|
+
} : void 0,
|
|
1730
1771
|
items: itemProps,
|
|
1731
1772
|
maxItems,
|
|
1732
1773
|
minItems,
|
|
@@ -1844,10 +1885,32 @@ var uploadInputComponentToProps = (component) => {
|
|
|
1844
1885
|
};
|
|
1845
1886
|
|
|
1846
1887
|
// src/revamp/renderers/mappers/tupleComponentToProps.ts
|
|
1847
|
-
var tupleComponentToProps = (component, children) =>
|
|
1848
|
-
|
|
1849
|
-
|
|
1850
|
-
|
|
1888
|
+
var tupleComponentToProps = (component, children) => {
|
|
1889
|
+
var _a, _b;
|
|
1890
|
+
return __spreadProps(__spreadValues({
|
|
1891
|
+
type: "form-section"
|
|
1892
|
+
}, pick(component, "control", "description", "help", "icon", "title")), {
|
|
1893
|
+
// TODO Remove URL default after next types update (add back to `pick`)
|
|
1894
|
+
image: component.image ? __spreadProps(__spreadValues({}, component.image), {
|
|
1895
|
+
url: (_b = (_a = component.image) == null ? void 0 : _a.url) != null ? _b : ""
|
|
1896
|
+
}) : void 0,
|
|
1897
|
+
children
|
|
1898
|
+
});
|
|
1899
|
+
};
|
|
1900
|
+
|
|
1901
|
+
// src/revamp/renderers/mappers/listComponentToProps.ts
|
|
1902
|
+
var listComponentToProps = (component) => __spreadProps(__spreadValues({}, pick(component, "type", "callToAction", "control", "margin", "title")), {
|
|
1903
|
+
items: component.items.map((_a) => {
|
|
1904
|
+
var _b = _a, { image } = _b, rest = __objRest(_b, ["image"]);
|
|
1905
|
+
var _a2, _b2, _c;
|
|
1906
|
+
return __spreadProps(__spreadValues({}, rest), {
|
|
1907
|
+
image: image ? {
|
|
1908
|
+
accessibilityDescription: (_a2 = image == null ? void 0 : image.accessibilityDescription) != null ? _a2 : image == null ? void 0 : image.text,
|
|
1909
|
+
uri: image == null ? void 0 : image.uri,
|
|
1910
|
+
url: (_c = (_b2 = image == null ? void 0 : image.url) != null ? _b2 : image == null ? void 0 : image.url) != null ? _c : ""
|
|
1911
|
+
} : void 0
|
|
1912
|
+
});
|
|
1913
|
+
})
|
|
1851
1914
|
});
|
|
1852
1915
|
|
|
1853
1916
|
// src/revamp/renderers/mappers/componentToRendererProps.ts
|
|
@@ -1891,6 +1954,8 @@ var componentToRendererProps = (component, nestedContent) => {
|
|
|
1891
1954
|
return instructionsComponentToProps(component);
|
|
1892
1955
|
case "integer":
|
|
1893
1956
|
return integerInputComponentToProps(component);
|
|
1957
|
+
case "list":
|
|
1958
|
+
return listComponentToProps(component);
|
|
1894
1959
|
case "loading-indicator":
|
|
1895
1960
|
return loadingIndicatorComponentToProps(component);
|
|
1896
1961
|
case "markdown":
|
|
@@ -6213,10 +6278,14 @@ var actionSchema = z.object({
|
|
|
6213
6278
|
skipValidation: z.boolean().optional()
|
|
6214
6279
|
});
|
|
6215
6280
|
var listLayoutItemSchema = z.object({
|
|
6216
|
-
title: z.string(),
|
|
6217
6281
|
description: z.string().optional(),
|
|
6218
|
-
|
|
6219
|
-
|
|
6282
|
+
status: listLayoutStatusSchema.optional(),
|
|
6283
|
+
icon: iconSchema.optional(),
|
|
6284
|
+
image: imageSchema.optional(),
|
|
6285
|
+
title: z.string(),
|
|
6286
|
+
subtitle: z.string().optional(),
|
|
6287
|
+
value: z.string().optional(),
|
|
6288
|
+
subvalue: z.string().optional()
|
|
6220
6289
|
});
|
|
6221
6290
|
var decisionLayoutOptionSchema = z.object({
|
|
6222
6291
|
action: actionSchema,
|
|
@@ -6237,6 +6306,11 @@ var behaviorSchema = z.object({
|
|
|
6237
6306
|
action: actionSchema.optional(),
|
|
6238
6307
|
link: linkSchema.optional()
|
|
6239
6308
|
});
|
|
6309
|
+
var itemCallToActionSchema = z.object({
|
|
6310
|
+
title: z.string(),
|
|
6311
|
+
accessibilityDescription: z.string().optional(),
|
|
6312
|
+
behavior: behaviorSchema
|
|
6313
|
+
});
|
|
6240
6314
|
var buttonLayoutSchema = z.object({
|
|
6241
6315
|
type: z.literal("button"),
|
|
6242
6316
|
size: sizeSchema.optional(),
|
|
@@ -6300,12 +6374,10 @@ var alertLayoutCallToActionSchema = z.object({
|
|
|
6300
6374
|
accessibilityDescription: z.string().optional(),
|
|
6301
6375
|
behavior: behaviorSchema
|
|
6302
6376
|
});
|
|
6303
|
-
var
|
|
6304
|
-
|
|
6305
|
-
|
|
6306
|
-
|
|
6307
|
-
control: z.string().optional(),
|
|
6308
|
-
margin: sizeSchema.optional()
|
|
6377
|
+
var listLayoutCallToActionSchema = z.object({
|
|
6378
|
+
title: z.string(),
|
|
6379
|
+
accessibilityDescription: z.string().optional(),
|
|
6380
|
+
behavior: behaviorSchema
|
|
6309
6381
|
});
|
|
6310
6382
|
var decisionLayoutSchema = z.object({
|
|
6311
6383
|
type: z.literal("decision"),
|
|
@@ -6314,10 +6386,12 @@ var decisionLayoutSchema = z.object({
|
|
|
6314
6386
|
control: z.string().optional(),
|
|
6315
6387
|
margin: sizeSchema.optional()
|
|
6316
6388
|
});
|
|
6317
|
-
var
|
|
6389
|
+
var statusListLayoutItemSchema = z.object({
|
|
6318
6390
|
title: z.string(),
|
|
6319
|
-
|
|
6320
|
-
|
|
6391
|
+
description: z.string().optional(),
|
|
6392
|
+
icon: iconSchema,
|
|
6393
|
+
status: statusListLayoutStatusSchema.optional(),
|
|
6394
|
+
callToAction: itemCallToActionSchema.optional()
|
|
6321
6395
|
});
|
|
6322
6396
|
var reviewLayoutSchema = z.object({
|
|
6323
6397
|
type: z.literal("review"),
|
|
@@ -6351,12 +6425,20 @@ var alertLayoutSchema = z.object({
|
|
|
6351
6425
|
margin: sizeSchema.optional(),
|
|
6352
6426
|
callToAction: alertLayoutCallToActionSchema.optional()
|
|
6353
6427
|
});
|
|
6354
|
-
var
|
|
6355
|
-
|
|
6356
|
-
|
|
6357
|
-
|
|
6358
|
-
|
|
6359
|
-
|
|
6428
|
+
var listLayoutSchema = z.object({
|
|
6429
|
+
type: z.literal("list"),
|
|
6430
|
+
title: z.string().optional(),
|
|
6431
|
+
callToAction: listLayoutCallToActionSchema.optional(),
|
|
6432
|
+
items: z.array(listLayoutItemSchema),
|
|
6433
|
+
control: z.string().optional(),
|
|
6434
|
+
margin: sizeSchema.optional()
|
|
6435
|
+
});
|
|
6436
|
+
var statusListLayoutSchema = z.object({
|
|
6437
|
+
type: z.literal("status-list"),
|
|
6438
|
+
items: z.array(statusListLayoutItemSchema),
|
|
6439
|
+
title: z.string().optional(),
|
|
6440
|
+
control: z.string().optional(),
|
|
6441
|
+
margin: sizeSchema.optional()
|
|
6360
6442
|
});
|
|
6361
6443
|
var searchResponseBodySchema = z.object({
|
|
6362
6444
|
results: z.array(searchResultSchema)
|
|
@@ -6399,13 +6481,6 @@ var constSchemaSchema = z.object({
|
|
|
6399
6481
|
analyticsId: z.string().optional(),
|
|
6400
6482
|
disabled: z.boolean().optional()
|
|
6401
6483
|
});
|
|
6402
|
-
var statusListLayoutSchema = z.object({
|
|
6403
|
-
type: z.literal("status-list"),
|
|
6404
|
-
items: z.array(statusListLayoutItemSchema),
|
|
6405
|
-
title: z.string().optional(),
|
|
6406
|
-
control: z.string().optional(),
|
|
6407
|
-
margin: sizeSchema.optional()
|
|
6408
|
-
});
|
|
6409
6484
|
var layoutSchema = z.lazy(
|
|
6410
6485
|
() => z.union([
|
|
6411
6486
|
alertLayoutSchema,
|
|
@@ -7151,7 +7226,7 @@ var buttonLayoutToComponent = (uid, button, mapperProps) => {
|
|
|
7151
7226
|
var buttonLayoutToComponentWithBehavior = (uid, button, mapperProps) => {
|
|
7152
7227
|
const { onAction, onLink, step } = mapperProps;
|
|
7153
7228
|
const { context, control, disabled, margin = "md", pinOrder, size: size2, title, behavior } = button;
|
|
7154
|
-
const
|
|
7229
|
+
const getOnClick2 = () => {
|
|
7155
7230
|
if ("type" in behavior) {
|
|
7156
7231
|
switch (behavior.type) {
|
|
7157
7232
|
case "action": {
|
|
@@ -7195,7 +7270,7 @@ var buttonLayoutToComponentWithBehavior = (uid, button, mapperProps) => {
|
|
|
7195
7270
|
pinOrder,
|
|
7196
7271
|
size: size2,
|
|
7197
7272
|
title: title != null ? title : "",
|
|
7198
|
-
onClick:
|
|
7273
|
+
onClick: getOnClick2()
|
|
7199
7274
|
});
|
|
7200
7275
|
};
|
|
7201
7276
|
var buttonLayoutToComponentWithAction = (uid, button, mapperProps) => {
|
|
@@ -7307,21 +7382,51 @@ var createDecisionComponent = (decisionProps) => __spreadProps(__spreadValues({
|
|
|
7307
7382
|
});
|
|
7308
7383
|
|
|
7309
7384
|
// src/revamp/domain/mappers/layout/decisionLayoutToComponent.ts
|
|
7310
|
-
var decisionLayoutToComponent = (uid, { control, margin = "md", options, title },
|
|
7385
|
+
var decisionLayoutToComponent = (uid, { control, margin = "md", options, title }, mapperProps) => createDecisionComponent({
|
|
7311
7386
|
uid,
|
|
7312
7387
|
control,
|
|
7313
7388
|
margin,
|
|
7314
|
-
options: options.map((
|
|
7315
|
-
|
|
7316
|
-
|
|
7317
|
-
|
|
7318
|
-
onClick: () => {
|
|
7319
|
-
void onAction(action);
|
|
7320
|
-
}
|
|
7389
|
+
options: options.map((option) => {
|
|
7390
|
+
return __spreadProps(__spreadValues({}, option), {
|
|
7391
|
+
href: getHref(option),
|
|
7392
|
+
onClick: getOnClick(option, mapperProps)
|
|
7321
7393
|
});
|
|
7322
7394
|
}),
|
|
7323
7395
|
title
|
|
7324
7396
|
});
|
|
7397
|
+
var getHref = (option) => {
|
|
7398
|
+
const { behavior } = option;
|
|
7399
|
+
if (behavior && "type" in behavior && behavior.type === "link") {
|
|
7400
|
+
return behavior.url;
|
|
7401
|
+
}
|
|
7402
|
+
return void 0;
|
|
7403
|
+
};
|
|
7404
|
+
var getOnClick = (option, { step, onAction, onLink }) => {
|
|
7405
|
+
const { behavior } = option;
|
|
7406
|
+
if (!behavior) {
|
|
7407
|
+
const action = inlineAction(option.action, step == null ? void 0 : step.actions);
|
|
7408
|
+
return () => {
|
|
7409
|
+
void onAction(action);
|
|
7410
|
+
};
|
|
7411
|
+
}
|
|
7412
|
+
if ("type" in behavior) {
|
|
7413
|
+
switch (behavior.type) {
|
|
7414
|
+
case "action": {
|
|
7415
|
+
const action = inlineAction(behavior.action, step == null ? void 0 : step.actions);
|
|
7416
|
+
return () => {
|
|
7417
|
+
void onAction(action);
|
|
7418
|
+
};
|
|
7419
|
+
}
|
|
7420
|
+
case "link": {
|
|
7421
|
+
return () => {
|
|
7422
|
+
void onLink(behavior.url);
|
|
7423
|
+
};
|
|
7424
|
+
}
|
|
7425
|
+
}
|
|
7426
|
+
}
|
|
7427
|
+
return () => {
|
|
7428
|
+
};
|
|
7429
|
+
};
|
|
7325
7430
|
|
|
7326
7431
|
// src/revamp/domain/components/DividerComponent.ts
|
|
7327
7432
|
var createDividerComponent = (props) => __spreadProps(__spreadValues({
|
|
@@ -10599,14 +10704,14 @@ var getItemCallToAction = (callToAction, onAction, onLink) => {
|
|
|
10599
10704
|
};
|
|
10600
10705
|
};
|
|
10601
10706
|
|
|
10602
|
-
// src/revamp/domain/mappers/layout/
|
|
10603
|
-
var
|
|
10707
|
+
// src/revamp/domain/mappers/layout/deprecatedListLayoutToComponent.ts
|
|
10708
|
+
var deprecatedListLayoutToComponent = (uid, { control, items, margin = "md", title }) => createStatusListComponent({
|
|
10604
10709
|
uid,
|
|
10605
10710
|
control,
|
|
10606
10711
|
items: items.map(({ description, icon, status, title: itemTitle }) => ({
|
|
10607
10712
|
description,
|
|
10608
|
-
icon,
|
|
10609
|
-
title: itemTitle,
|
|
10713
|
+
icon: icon != null ? icon : { text: "" },
|
|
10714
|
+
title: itemTitle != null ? itemTitle : "",
|
|
10610
10715
|
status: status ? mapLegacyStatus(status) : void 0
|
|
10611
10716
|
})),
|
|
10612
10717
|
margin,
|
|
@@ -10624,6 +10729,68 @@ var mapLegacyStatus = (status) => {
|
|
|
10624
10729
|
}
|
|
10625
10730
|
};
|
|
10626
10731
|
|
|
10732
|
+
// src/revamp/domain/components/ListComponent.ts
|
|
10733
|
+
var createListComponent = (listProps) => __spreadProps(__spreadValues({
|
|
10734
|
+
type: "list"
|
|
10735
|
+
}, listProps), {
|
|
10736
|
+
getLocalValue: () => null,
|
|
10737
|
+
getSubmittableValue: async () => null,
|
|
10738
|
+
getSubmittableValueSync: () => null,
|
|
10739
|
+
getSummary: () => ({}),
|
|
10740
|
+
// noop
|
|
10741
|
+
validate: () => true
|
|
10742
|
+
});
|
|
10743
|
+
|
|
10744
|
+
// src/revamp/domain/mappers/layout/listLayoutToComponent.ts
|
|
10745
|
+
var listLayoutToComponent = (uid, { callToAction, control, items, margin = "md", title }, mapperProps) => createListComponent({
|
|
10746
|
+
uid,
|
|
10747
|
+
control,
|
|
10748
|
+
items: items.map(({ value, subvalue, title: itemTitle, subtitle, icon, image }) => ({
|
|
10749
|
+
title: itemTitle,
|
|
10750
|
+
subtitle,
|
|
10751
|
+
value,
|
|
10752
|
+
subvalue,
|
|
10753
|
+
icon,
|
|
10754
|
+
image
|
|
10755
|
+
})),
|
|
10756
|
+
callToAction: getListCallToAction(callToAction, mapperProps),
|
|
10757
|
+
margin,
|
|
10758
|
+
title
|
|
10759
|
+
});
|
|
10760
|
+
var getListCallToAction = (callToAction, { onAction, onLink }) => {
|
|
10761
|
+
if (!callToAction) {
|
|
10762
|
+
return void 0;
|
|
10763
|
+
}
|
|
10764
|
+
const { accessibilityDescription, behavior, title } = callToAction;
|
|
10765
|
+
if ("type" in behavior) {
|
|
10766
|
+
switch (behavior.type) {
|
|
10767
|
+
case "action": {
|
|
10768
|
+
const { action } = behavior;
|
|
10769
|
+
return {
|
|
10770
|
+
type: "action",
|
|
10771
|
+
accessibilityDescription,
|
|
10772
|
+
title,
|
|
10773
|
+
onClick: () => {
|
|
10774
|
+
void onAction(action);
|
|
10775
|
+
}
|
|
10776
|
+
};
|
|
10777
|
+
}
|
|
10778
|
+
case "link": {
|
|
10779
|
+
return {
|
|
10780
|
+
type: "link",
|
|
10781
|
+
accessibilityDescription,
|
|
10782
|
+
href: behavior.url,
|
|
10783
|
+
title,
|
|
10784
|
+
onClick: () => {
|
|
10785
|
+
void onLink(behavior.url);
|
|
10786
|
+
}
|
|
10787
|
+
};
|
|
10788
|
+
}
|
|
10789
|
+
}
|
|
10790
|
+
}
|
|
10791
|
+
return void 0;
|
|
10792
|
+
};
|
|
10793
|
+
|
|
10627
10794
|
// src/revamp/domain/mappers/mapLayoutToComponent.ts
|
|
10628
10795
|
var mapLayoutToComponent = (uid, layout, mapperProps) => {
|
|
10629
10796
|
switch (layout.type) {
|
|
@@ -10650,7 +10817,10 @@ var mapLayoutToComponent = (uid, layout, mapperProps) => {
|
|
|
10650
10817
|
case "instructions":
|
|
10651
10818
|
return instructionsLayoutToComponent(uid, layout);
|
|
10652
10819
|
case "list":
|
|
10653
|
-
|
|
10820
|
+
if (layout.items.some((item) => item.status || item.description)) {
|
|
10821
|
+
return deprecatedListLayoutToComponent(uid, layout);
|
|
10822
|
+
}
|
|
10823
|
+
return listLayoutToComponent(uid, layout, mapperProps);
|
|
10654
10824
|
case "loading-indicator":
|
|
10655
10825
|
return loadingIndicatorLayoutToComponent(uid, layout);
|
|
10656
10826
|
case "markdown":
|
|
@@ -11983,9 +12153,14 @@ function NavigationOptionMedia({ icon, image }) {
|
|
|
11983
12153
|
return /* @__PURE__ */ jsx21(Avatar, { type: AvatarType.INITIALS, children: icon.text });
|
|
11984
12154
|
}
|
|
11985
12155
|
}
|
|
11986
|
-
if (image
|
|
11987
|
-
const {
|
|
11988
|
-
|
|
12156
|
+
if (image) {
|
|
12157
|
+
const { accessibilityDescription, uri, url } = image;
|
|
12158
|
+
if (uri && !uri.startsWith("urn:")) {
|
|
12159
|
+
return /* @__PURE__ */ jsx21("img", { src: uri, alt: accessibilityDescription });
|
|
12160
|
+
}
|
|
12161
|
+
if (url) {
|
|
12162
|
+
return /* @__PURE__ */ jsx21("img", { src: url, alt: accessibilityDescription });
|
|
12163
|
+
}
|
|
11989
12164
|
}
|
|
11990
12165
|
return null;
|
|
11991
12166
|
}
|
|
@@ -12001,10 +12176,10 @@ function DecisionRendererComponent({ margin, options, title }) {
|
|
|
12001
12176
|
const { isLoading } = useLoadingContext();
|
|
12002
12177
|
return /* @__PURE__ */ jsxs5("div", { className: getMargin(margin), children: [
|
|
12003
12178
|
title && /* @__PURE__ */ jsx22(Header, { as: "h2", title }),
|
|
12004
|
-
/* @__PURE__ */ jsx22(NavigationOptionsList, { children: options.map(({ description, disabled, icon, image, title:
|
|
12179
|
+
/* @__PURE__ */ jsx22(NavigationOptionsList, { children: options.map(({ description, disabled, icon, image, title: itemTitle, onClick }) => /* @__PURE__ */ jsx22(
|
|
12005
12180
|
NavigationOption,
|
|
12006
12181
|
{
|
|
12007
|
-
title:
|
|
12182
|
+
title: itemTitle,
|
|
12008
12183
|
content: description,
|
|
12009
12184
|
disabled: isLoading || disabled,
|
|
12010
12185
|
media: /* @__PURE__ */ jsx22(NavigationOptionMedia, { icon, image }),
|
|
@@ -12012,7 +12187,7 @@ function DecisionRendererComponent({ margin, options, title }) {
|
|
|
12012
12187
|
showMediaAtAllSizes: true,
|
|
12013
12188
|
onClick
|
|
12014
12189
|
},
|
|
12015
|
-
JSON.stringify(
|
|
12190
|
+
JSON.stringify(itemTitle)
|
|
12016
12191
|
)) })
|
|
12017
12192
|
] });
|
|
12018
12193
|
}
|
|
@@ -12120,8 +12295,8 @@ function ImageRendererComponent({
|
|
|
12120
12295
|
accessibilityDescription,
|
|
12121
12296
|
margin,
|
|
12122
12297
|
size: size2,
|
|
12123
|
-
|
|
12124
|
-
|
|
12298
|
+
uri,
|
|
12299
|
+
url
|
|
12125
12300
|
}) {
|
|
12126
12301
|
const [imageSource, setImageSource] = useState3("");
|
|
12127
12302
|
const httpClient = useRendererHttpClient();
|
|
@@ -12134,7 +12309,7 @@ function ImageRendererComponent({
|
|
|
12134
12309
|
void getImageSource(httpClient, uri).then(setImageSource);
|
|
12135
12310
|
return;
|
|
12136
12311
|
}
|
|
12137
|
-
}, [url, httpClient]);
|
|
12312
|
+
}, [uri, url, httpClient]);
|
|
12138
12313
|
return /* @__PURE__ */ jsx27("div", { className: `df-image ${size2 || "md"}`, children: /* @__PURE__ */ jsx27(
|
|
12139
12314
|
Image,
|
|
12140
12315
|
{
|
|
@@ -13837,6 +14012,72 @@ function StepRendererComponent(props) {
|
|
|
13837
14012
|
] });
|
|
13838
14013
|
}
|
|
13839
14014
|
|
|
14015
|
+
// ../renderers/src/ListRenderer.tsx
|
|
14016
|
+
var import_classnames6 = __toESM(require_classnames());
|
|
14017
|
+
import { Body, Header as Header7 } from "@transferwise/components";
|
|
14018
|
+
import { jsx as jsx58, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
14019
|
+
var ListRenderer = {
|
|
14020
|
+
canRenderType: "list",
|
|
14021
|
+
render: ({ callToAction, margin, items, title }) => /* @__PURE__ */ jsxs23("div", { className: getMargin(margin), children: [
|
|
14022
|
+
title && /* @__PURE__ */ jsx58(Header7, { as: "h2", title, action: getListAction(callToAction) }),
|
|
14023
|
+
items.map((props) => /* @__PURE__ */ jsx58(DesignSystemListItem, __spreadValues({}, props), props.title))
|
|
14024
|
+
] })
|
|
14025
|
+
};
|
|
14026
|
+
var DesignSystemListItem = ({ title, subtitle, value, subvalue, icon, image }) => /* @__PURE__ */ jsx58(
|
|
14027
|
+
"label",
|
|
14028
|
+
{
|
|
14029
|
+
className: (0, import_classnames6.default)("np-option p-a-2", {
|
|
14030
|
+
"np-option__sm-media": true,
|
|
14031
|
+
"np-option__container-aligned": true
|
|
14032
|
+
}),
|
|
14033
|
+
children: /* @__PURE__ */ jsxs23("div", { className: "media", children: [
|
|
14034
|
+
icon || image ? /* @__PURE__ */ jsx58("div", { className: "media-left", children: /* @__PURE__ */ jsx58(ListItemMedia, { image, icon }) }) : null,
|
|
14035
|
+
/* @__PURE__ */ jsxs23("div", { className: "media-body", children: [
|
|
14036
|
+
/* @__PURE__ */ jsxs23("div", { className: "d-flex justify-content-between", children: [
|
|
14037
|
+
/* @__PURE__ */ jsx58("h4", { className: "np-text-body-large-bold text-primary np-option__title", children: title }),
|
|
14038
|
+
/* @__PURE__ */ jsx58("h4", { className: "np-text-body-large-bold text-primary np-option__title", children: value })
|
|
14039
|
+
] }),
|
|
14040
|
+
/* @__PURE__ */ jsxs23("div", { className: "d-flex justify-content-between", children: [
|
|
14041
|
+
/* @__PURE__ */ jsx58(Body, { className: "d-block np-option__body", children: subtitle }),
|
|
14042
|
+
/* @__PURE__ */ jsx58(Body, { className: "d-block np-option__body", children: subvalue })
|
|
14043
|
+
] })
|
|
14044
|
+
] })
|
|
14045
|
+
] })
|
|
14046
|
+
},
|
|
14047
|
+
title
|
|
14048
|
+
);
|
|
14049
|
+
var ListItemMedia = ({ icon, image }) => {
|
|
14050
|
+
if (icon) {
|
|
14051
|
+
return /* @__PURE__ */ jsx58("div", { className: "circle circle-sm text-primary", children: /* @__PURE__ */ jsx58(NavigationOptionMedia, { icon, image }) });
|
|
14052
|
+
}
|
|
14053
|
+
if (image) {
|
|
14054
|
+
return /* @__PURE__ */ jsx58("div", { className: "np-option__no-media-circle", children: /* @__PURE__ */ jsx58(NavigationOptionMedia, { icon, image }) });
|
|
14055
|
+
}
|
|
14056
|
+
};
|
|
14057
|
+
var getListAction = (callToAction) => {
|
|
14058
|
+
if (!callToAction) {
|
|
14059
|
+
return void 0;
|
|
14060
|
+
}
|
|
14061
|
+
const { accessibilityDescription, title, onClick } = callToAction;
|
|
14062
|
+
if (callToAction.type === "action") {
|
|
14063
|
+
return {
|
|
14064
|
+
"aria-label": accessibilityDescription,
|
|
14065
|
+
text: title,
|
|
14066
|
+
onClick: (event) => {
|
|
14067
|
+
event.preventDefault();
|
|
14068
|
+
onClick();
|
|
14069
|
+
}
|
|
14070
|
+
};
|
|
14071
|
+
}
|
|
14072
|
+
return {
|
|
14073
|
+
"aria-label": accessibilityDescription,
|
|
14074
|
+
href: callToAction.href,
|
|
14075
|
+
target: "_blank",
|
|
14076
|
+
text: title
|
|
14077
|
+
};
|
|
14078
|
+
};
|
|
14079
|
+
var ListRenderer_default = ListRenderer;
|
|
14080
|
+
|
|
13840
14081
|
// ../renderers/src/getWiseRenderers.ts
|
|
13841
14082
|
var getWiseRenderers = () => [
|
|
13842
14083
|
AlertRenderer_default,
|
|
@@ -13854,6 +14095,7 @@ var getWiseRenderers = () => [
|
|
|
13854
14095
|
InstructionsRenderer_default,
|
|
13855
14096
|
IntegerInputRenderer_default,
|
|
13856
14097
|
LargeUploadRenderer,
|
|
14098
|
+
ListRenderer_default,
|
|
13857
14099
|
LoadingIndicatorRenderer_default,
|
|
13858
14100
|
MarkdownRenderer_default,
|
|
13859
14101
|
ModalRenderer_default,
|
|
@@ -13883,12 +14125,12 @@ var openLinkInNewTab = (url) => {
|
|
|
13883
14125
|
};
|
|
13884
14126
|
|
|
13885
14127
|
// src/revamp/DynamicFlowWise.tsx
|
|
13886
|
-
import { jsx as
|
|
14128
|
+
import { jsx as jsx59 } from "react/jsx-runtime";
|
|
13887
14129
|
var wiseRenderers = getWiseRenderers();
|
|
13888
14130
|
function DynamicFlowWise(props) {
|
|
13889
14131
|
const { httpClient, renderers, onLink = openLinkInNewTab } = props;
|
|
13890
14132
|
const mergedRenderers = useMemo4(() => [...renderers != null ? renderers : [], ...wiseRenderers], [renderers]);
|
|
13891
|
-
return /* @__PURE__ */
|
|
14133
|
+
return /* @__PURE__ */ jsx59(RendererHttpClientProvider, { httpClient, children: /* @__PURE__ */ jsx59(DynamicFlowCore, __spreadProps(__spreadValues({}, props), { renderers: mergedRenderers, onLink })) });
|
|
13892
14134
|
}
|
|
13893
14135
|
var DynamicFlowWise_default = DynamicFlowWise;
|
|
13894
14136
|
|
|
@@ -13897,14 +14139,14 @@ import { forwardRef as forwardRef2, useImperativeHandle, useMemo as useMemo6 } f
|
|
|
13897
14139
|
|
|
13898
14140
|
// src/common/httpClientContext/HttpClientContext.tsx
|
|
13899
14141
|
import { createContext as createContext3, useContext as useContext4, useMemo as useMemo5 } from "react";
|
|
13900
|
-
import { jsx as
|
|
14142
|
+
import { jsx as jsx60 } from "react/jsx-runtime";
|
|
13901
14143
|
var HttpClientContext2 = createContext3(void 0);
|
|
13902
14144
|
function HttpClientProvider({ httpClient, children }) {
|
|
13903
|
-
return /* @__PURE__ */
|
|
14145
|
+
return /* @__PURE__ */ jsx60(HttpClientContext2.Provider, { value: httpClient, children });
|
|
13904
14146
|
}
|
|
13905
14147
|
function HttpClientProviderFromBaseUrl({ baseUrl, children }) {
|
|
13906
14148
|
const httpClient = useMemo5(() => makeHttpClient(baseUrl), [baseUrl]);
|
|
13907
|
-
return /* @__PURE__ */
|
|
14149
|
+
return /* @__PURE__ */ jsx60(HttpClientContext2.Provider, { value: httpClient, children });
|
|
13908
14150
|
}
|
|
13909
14151
|
var useHttpClient = () => {
|
|
13910
14152
|
const contextFetch = useContext4(HttpClientContext2);
|
|
@@ -13916,7 +14158,7 @@ var useHasHttpClientProvider = () => {
|
|
|
13916
14158
|
};
|
|
13917
14159
|
|
|
13918
14160
|
// src/revamp/DynamicFragmentWise.tsx
|
|
13919
|
-
import { jsx as
|
|
14161
|
+
import { jsx as jsx61 } from "react/jsx-runtime";
|
|
13920
14162
|
var wiseRenderers2 = getWiseRenderers();
|
|
13921
14163
|
var DynamicFragmentWise = forwardRef2(function DynamicFragmentWise2(props, ref) {
|
|
13922
14164
|
const {
|
|
@@ -13949,14 +14191,14 @@ var DynamicFragmentWise = forwardRef2(function DynamicFragmentWise2(props, ref)
|
|
|
13949
14191
|
() => getRenderFunction([CoreContainerRenderer, ...mergedRenderers, StepRenderer]),
|
|
13950
14192
|
[mergedRenderers]
|
|
13951
14193
|
);
|
|
13952
|
-
return /* @__PURE__ */
|
|
14194
|
+
return /* @__PURE__ */ jsx61(
|
|
13953
14195
|
ErrorBoundary_default,
|
|
13954
14196
|
{
|
|
13955
14197
|
onError: (error) => {
|
|
13956
14198
|
onEvent == null ? void 0 : onEvent("Dynamic Flow - Failed");
|
|
13957
14199
|
onError(error);
|
|
13958
14200
|
},
|
|
13959
|
-
children: /* @__PURE__ */
|
|
14201
|
+
children: /* @__PURE__ */ jsx61(HttpClientProvider, { httpClient, children: stepComponentRef.current ? render(stepComponentRef.current) : null })
|
|
13960
14202
|
}
|
|
13961
14203
|
);
|
|
13962
14204
|
});
|
|
@@ -13964,7 +14206,7 @@ var DynamicFragmentWise_default = DynamicFragmentWise;
|
|
|
13964
14206
|
|
|
13965
14207
|
// src/revamp/DynamicFragmentCore.tsx
|
|
13966
14208
|
import { forwardRef as forwardRef3, useImperativeHandle as useImperativeHandle2, useMemo as useMemo7 } from "react";
|
|
13967
|
-
import { jsx as
|
|
14209
|
+
import { jsx as jsx62 } from "react/jsx-runtime";
|
|
13968
14210
|
var DynamicFragmentCore = forwardRef3(function DynamicFragmentCore2(props, ref) {
|
|
13969
14211
|
const { onCompletion = () => {
|
|
13970
14212
|
}, onEvent, onError, onLink = openLinkInNewTab, renderers } = props;
|
|
@@ -13988,7 +14230,7 @@ var DynamicFragmentCore = forwardRef3(function DynamicFragmentCore2(props, ref)
|
|
|
13988
14230
|
() => getRenderFunction([CoreContainerRenderer, ...renderers]),
|
|
13989
14231
|
[renderers]
|
|
13990
14232
|
);
|
|
13991
|
-
return /* @__PURE__ */
|
|
14233
|
+
return /* @__PURE__ */ jsx62(
|
|
13992
14234
|
ErrorBoundary_default,
|
|
13993
14235
|
{
|
|
13994
14236
|
onError: (error) => {
|
|
@@ -14329,7 +14571,7 @@ var noop2 = () => {
|
|
|
14329
14571
|
};
|
|
14330
14572
|
|
|
14331
14573
|
// src/legacy/common/contexts/dynamicFlowContexts/DynamicFlowContexts.tsx
|
|
14332
|
-
import { jsx as
|
|
14574
|
+
import { jsx as jsx63 } from "react/jsx-runtime";
|
|
14333
14575
|
var defaultContextValue = {
|
|
14334
14576
|
loading: false,
|
|
14335
14577
|
registerPersistAsyncPromise: (promise) => {
|
|
@@ -14344,7 +14586,7 @@ var DynamicFlowProvider = ({ loading, children }) => {
|
|
|
14344
14586
|
registerPersistAsyncPromise: addPendingPromise
|
|
14345
14587
|
};
|
|
14346
14588
|
}, [loading, pendingPromises, addPendingPromise]);
|
|
14347
|
-
return /* @__PURE__ */
|
|
14589
|
+
return /* @__PURE__ */ jsx63(DFContext.Provider, { value: providerValue, children });
|
|
14348
14590
|
};
|
|
14349
14591
|
var useDynamicFlow = () => {
|
|
14350
14592
|
const context = useContext5(DFContext);
|
|
@@ -14353,7 +14595,7 @@ var useDynamicFlow = () => {
|
|
|
14353
14595
|
|
|
14354
14596
|
// src/legacy/common/contexts/eventsContext/EventsContext.tsx
|
|
14355
14597
|
import { createContext as createContext5, useContext as useContext6, useMemo as useMemo9 } from "react";
|
|
14356
|
-
import { jsx as
|
|
14598
|
+
import { jsx as jsx64 } from "react/jsx-runtime";
|
|
14357
14599
|
var EventsContext = createContext5({
|
|
14358
14600
|
triggerEvent: () => {
|
|
14359
14601
|
}
|
|
@@ -14363,7 +14605,7 @@ function EventsContextProvider({ metadata, children, onEvent }) {
|
|
|
14363
14605
|
() => ({ triggerEvent: getEventDispatcher(onEvent, metadata) }),
|
|
14364
14606
|
[onEvent, metadata]
|
|
14365
14607
|
);
|
|
14366
|
-
return /* @__PURE__ */
|
|
14608
|
+
return /* @__PURE__ */ jsx64(EventsContext.Provider, { value, children });
|
|
14367
14609
|
}
|
|
14368
14610
|
function useEventDispatcher() {
|
|
14369
14611
|
const { triggerEvent } = useContext6(EventsContext);
|
|
@@ -14378,7 +14620,7 @@ var getEventDispatcher = (onEvent, metadata) => (eventName, properties = {}) =>
|
|
|
14378
14620
|
|
|
14379
14621
|
// src/legacy/common/contexts/logContext/LogContext.tsx
|
|
14380
14622
|
import { createContext as createContext6, useContext as useContext7, useMemo as useMemo10 } from "react";
|
|
14381
|
-
import { jsx as
|
|
14623
|
+
import { jsx as jsx65 } from "react/jsx-runtime";
|
|
14382
14624
|
var getLogger = (level, onLog, flowId = "UNKNOWN-FLOW-ID", stepId = "UNKNOWN-FLOW-ID") => (title, description, extra) => {
|
|
14383
14625
|
try {
|
|
14384
14626
|
onLog(level, `Dynamic Flow ${level} - ${title} - ${description}`, __spreadValues({
|
|
@@ -14400,7 +14642,7 @@ function LogProvider({ flowId, stepId, children, onLog }) {
|
|
|
14400
14642
|
}),
|
|
14401
14643
|
[onLog, flowId, stepId]
|
|
14402
14644
|
);
|
|
14403
|
-
return /* @__PURE__ */
|
|
14645
|
+
return /* @__PURE__ */ jsx65(LogContext.Provider, { value, children });
|
|
14404
14646
|
}
|
|
14405
14647
|
var useLogger = () => {
|
|
14406
14648
|
const logging = useContext7(LogContext);
|
|
@@ -14414,10 +14656,10 @@ var useLogger = () => {
|
|
|
14414
14656
|
|
|
14415
14657
|
// src/legacy/common/contexts/featureContext/FeatureContext.tsx
|
|
14416
14658
|
import { createContext as createContext7, useContext as useContext8 } from "react";
|
|
14417
|
-
import { jsx as
|
|
14659
|
+
import { jsx as jsx66 } from "react/jsx-runtime";
|
|
14418
14660
|
var FeatureContext = createContext7([]);
|
|
14419
14661
|
function FeatureContextProvider({ features, children }) {
|
|
14420
|
-
return /* @__PURE__ */
|
|
14662
|
+
return /* @__PURE__ */ jsx66(FeatureContext.Provider, { value: features, children });
|
|
14421
14663
|
}
|
|
14422
14664
|
|
|
14423
14665
|
// src/common/cameraCapture/utils/mobile-utils.ts
|
|
@@ -15276,7 +15518,7 @@ var Size = {
|
|
|
15276
15518
|
};
|
|
15277
15519
|
|
|
15278
15520
|
// src/legacy/jsonSchemaForm/basicTypeSchema/BasicTypeSchema.tsx
|
|
15279
|
-
var
|
|
15521
|
+
var import_classnames16 = __toESM(require_classnames());
|
|
15280
15522
|
import { useEffect as useEffect17, useMemo as useMemo19, useState as useState26 } from "react";
|
|
15281
15523
|
|
|
15282
15524
|
// src/legacy/layout/alert/DynamicAlert.tsx
|
|
@@ -15286,19 +15528,19 @@ import { Alert as Alert4 } from "@transferwise/components";
|
|
|
15286
15528
|
import { Avatar as Avatar5, AvatarType as AvatarType4 } from "@transferwise/components";
|
|
15287
15529
|
|
|
15288
15530
|
// src/legacy/layout/icon/FlagIcon.tsx
|
|
15289
|
-
import { jsx as
|
|
15531
|
+
import { jsx as jsx67 } from "react/jsx-runtime";
|
|
15290
15532
|
var isFlagIcon3 = (name) => name.startsWith("flag-");
|
|
15291
15533
|
function FlagIcon2({ name }) {
|
|
15292
15534
|
if (!isFlagIcon3(name)) {
|
|
15293
15535
|
return null;
|
|
15294
15536
|
}
|
|
15295
15537
|
const code = name.substring(5);
|
|
15296
|
-
return /* @__PURE__ */
|
|
15538
|
+
return /* @__PURE__ */ jsx67(Flag, { intrinsicSize: 24, code });
|
|
15297
15539
|
}
|
|
15298
15540
|
|
|
15299
15541
|
// src/legacy/layout/icon/NamedIcon.tsx
|
|
15300
15542
|
import * as icons2 from "@transferwise/icons";
|
|
15301
|
-
import { jsx as
|
|
15543
|
+
import { jsx as jsx68 } from "react/jsx-runtime";
|
|
15302
15544
|
var isNamedIcon3 = (name) => {
|
|
15303
15545
|
const iconName = toCapitalisedCamelCase2(name);
|
|
15304
15546
|
return Object.keys(icons2).includes(iconName);
|
|
@@ -15309,19 +15551,19 @@ function NamedIcon2({ name }) {
|
|
|
15309
15551
|
}
|
|
15310
15552
|
const iconName = toCapitalisedCamelCase2(name);
|
|
15311
15553
|
const Icon = icons2[iconName];
|
|
15312
|
-
return /* @__PURE__ */
|
|
15554
|
+
return /* @__PURE__ */ jsx68(Icon, { size: 24 });
|
|
15313
15555
|
}
|
|
15314
15556
|
var toCapitalisedCamelCase2 = (value) => value.split("-").map(capitaliseFirstChar2).join("");
|
|
15315
15557
|
var capitaliseFirstChar2 = (value) => `${value[0].toUpperCase()}${value.slice(1)}`;
|
|
15316
15558
|
|
|
15317
15559
|
// src/legacy/layout/icon/DynamicIcon.tsx
|
|
15318
|
-
import { jsx as
|
|
15560
|
+
import { jsx as jsx69 } from "react/jsx-runtime";
|
|
15319
15561
|
function DynamicIcon2({ type }) {
|
|
15320
15562
|
if (isFlagIcon3(type)) {
|
|
15321
|
-
return /* @__PURE__ */
|
|
15563
|
+
return /* @__PURE__ */ jsx69(FlagIcon2, { name: type });
|
|
15322
15564
|
}
|
|
15323
15565
|
if (isNamedIcon3(type)) {
|
|
15324
|
-
return /* @__PURE__ */
|
|
15566
|
+
return /* @__PURE__ */ jsx69(NamedIcon2, { name: type });
|
|
15325
15567
|
}
|
|
15326
15568
|
return null;
|
|
15327
15569
|
}
|
|
@@ -15331,17 +15573,17 @@ function isValidIconName(name) {
|
|
|
15331
15573
|
var DynamicIcon_default2 = DynamicIcon2;
|
|
15332
15574
|
|
|
15333
15575
|
// src/legacy/layout/utils/getNavigationOptionMedia.tsx
|
|
15334
|
-
import { jsx as
|
|
15576
|
+
import { jsx as jsx70 } from "react/jsx-runtime";
|
|
15335
15577
|
var getNavigationOptionMedia = ({ icon, image }) => {
|
|
15336
15578
|
if (icon == null ? void 0 : icon.name) {
|
|
15337
|
-
return /* @__PURE__ */
|
|
15579
|
+
return /* @__PURE__ */ jsx70(Avatar5, { type: AvatarType4.ICON, children: /* @__PURE__ */ jsx70(DynamicIcon_default2, { type: icon.name }) });
|
|
15338
15580
|
}
|
|
15339
15581
|
if (icon == null ? void 0 : icon.text) {
|
|
15340
|
-
return /* @__PURE__ */
|
|
15582
|
+
return /* @__PURE__ */ jsx70(Avatar5, { type: AvatarType4.INITIALS, children: icon.text });
|
|
15341
15583
|
}
|
|
15342
15584
|
if (image == null ? void 0 : image.url) {
|
|
15343
15585
|
const { url, text } = image;
|
|
15344
|
-
return /* @__PURE__ */
|
|
15586
|
+
return /* @__PURE__ */ jsx70("img", { src: url, alt: text });
|
|
15345
15587
|
}
|
|
15346
15588
|
return null;
|
|
15347
15589
|
};
|
|
@@ -15377,10 +15619,10 @@ var getTextAlignment2 = (align) => {
|
|
|
15377
15619
|
var getTextAlignmentAndMargin2 = (component) => `${getTextAlignment2(component.align)} ${getMargin2(component.margin)}`;
|
|
15378
15620
|
|
|
15379
15621
|
// src/legacy/layout/alert/DynamicAlert.tsx
|
|
15380
|
-
import { jsx as
|
|
15622
|
+
import { jsx as jsx71 } from "react/jsx-runtime";
|
|
15381
15623
|
var DynamicAlert = ({ component: alert, onAction }) => {
|
|
15382
15624
|
const { context, markdown, margin } = alert;
|
|
15383
|
-
return /* @__PURE__ */
|
|
15625
|
+
return /* @__PURE__ */ jsx71(
|
|
15384
15626
|
Alert4,
|
|
15385
15627
|
{
|
|
15386
15628
|
type: mapContextToAlertType(legacy_mapContext(context)),
|
|
@@ -15464,12 +15706,12 @@ var mapContextToAlertType = (context) => {
|
|
|
15464
15706
|
var DynamicAlert_default = DynamicAlert;
|
|
15465
15707
|
|
|
15466
15708
|
// src/legacy/layout/box/DynamicBox.tsx
|
|
15467
|
-
import { jsx as
|
|
15709
|
+
import { jsx as jsx72 } from "react/jsx-runtime";
|
|
15468
15710
|
var DynamicBox = (props) => {
|
|
15469
15711
|
const box = props.component;
|
|
15470
15712
|
const margin = getMargin2(box.margin || box.border ? "lg" : "xs");
|
|
15471
15713
|
if (!box.width || box.width === "xl") {
|
|
15472
|
-
return /* @__PURE__ */
|
|
15714
|
+
return /* @__PURE__ */ jsx72("div", { className: margin + getBorderClass(box.border), children: /* @__PURE__ */ jsx72(
|
|
15473
15715
|
DynamicLayout_default,
|
|
15474
15716
|
{
|
|
15475
15717
|
components: box.components,
|
|
@@ -15482,7 +15724,7 @@ var DynamicBox = (props) => {
|
|
|
15482
15724
|
}
|
|
15483
15725
|
) });
|
|
15484
15726
|
}
|
|
15485
|
-
return /* @__PURE__ */
|
|
15727
|
+
return /* @__PURE__ */ jsx72("div", { className: "row", children: /* @__PURE__ */ jsx72("div", { className: margin + getBoxWidthClasses(box), children: /* @__PURE__ */ jsx72("div", { className: getBorderClass(box.border), children: /* @__PURE__ */ jsx72(
|
|
15486
15728
|
DynamicLayout_default,
|
|
15487
15729
|
{
|
|
15488
15730
|
components: box.components,
|
|
@@ -15568,9 +15810,9 @@ var getButtonSize = (size2) => {
|
|
|
15568
15810
|
};
|
|
15569
15811
|
|
|
15570
15812
|
// src/legacy/layout/button/DynamicButton.tsx
|
|
15571
|
-
import { jsx as
|
|
15813
|
+
import { jsx as jsx73 } from "react/jsx-runtime";
|
|
15572
15814
|
function DynamicButton(props) {
|
|
15573
|
-
return props.component.behavior ? /* @__PURE__ */
|
|
15815
|
+
return props.component.behavior ? /* @__PURE__ */ jsx73(DynamicButtonWithBehavior, __spreadValues({}, props)) : /* @__PURE__ */ jsx73(DynamicButtonWithoutBehavior, __spreadValues({}, props));
|
|
15574
15816
|
}
|
|
15575
15817
|
function DynamicButtonWithoutBehavior(props) {
|
|
15576
15818
|
var _a, _b;
|
|
@@ -15587,7 +15829,7 @@ function DynamicButtonWithoutBehavior(props) {
|
|
|
15587
15829
|
onAction(componentAction);
|
|
15588
15830
|
}
|
|
15589
15831
|
};
|
|
15590
|
-
return /* @__PURE__ */
|
|
15832
|
+
return /* @__PURE__ */ jsx73(
|
|
15591
15833
|
Button7,
|
|
15592
15834
|
{
|
|
15593
15835
|
size: getButtonSize(component.size),
|
|
@@ -15639,7 +15881,7 @@ function DynamicButtonWithBehavior(props) {
|
|
|
15639
15881
|
}
|
|
15640
15882
|
}
|
|
15641
15883
|
};
|
|
15642
|
-
return /* @__PURE__ */
|
|
15884
|
+
return /* @__PURE__ */ jsx73(
|
|
15643
15885
|
Button7,
|
|
15644
15886
|
{
|
|
15645
15887
|
size: getButtonSize(component.size),
|
|
@@ -15656,12 +15898,12 @@ function DynamicButtonWithBehavior(props) {
|
|
|
15656
15898
|
var DynamicButton_default = DynamicButton;
|
|
15657
15899
|
|
|
15658
15900
|
// src/legacy/layout/columns/DynamicColumns.tsx
|
|
15659
|
-
import { jsx as
|
|
15901
|
+
import { jsx as jsx74, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
15660
15902
|
var DynamicColumns = (props) => {
|
|
15661
15903
|
const columns = props.component;
|
|
15662
15904
|
const { leftWidth, rightWidth } = getWidth(columns.bias);
|
|
15663
|
-
return /* @__PURE__ */
|
|
15664
|
-
/* @__PURE__ */
|
|
15905
|
+
return /* @__PURE__ */ jsxs24("div", { className: `${getMargin2(columns.margin || "xs")} row`, children: [
|
|
15906
|
+
/* @__PURE__ */ jsx74("div", { className: `${leftWidth} m-b-0`, children: /* @__PURE__ */ jsx74(
|
|
15665
15907
|
DynamicLayout_default,
|
|
15666
15908
|
{
|
|
15667
15909
|
components: columns.left,
|
|
@@ -15673,7 +15915,7 @@ var DynamicColumns = (props) => {
|
|
|
15673
15915
|
onPersistAsync: props.onPersistAsync
|
|
15674
15916
|
}
|
|
15675
15917
|
) }),
|
|
15676
|
-
/* @__PURE__ */
|
|
15918
|
+
/* @__PURE__ */ jsx74("div", { className: `${rightWidth} m-b-0`, children: /* @__PURE__ */ jsx74(
|
|
15677
15919
|
DynamicLayout_default,
|
|
15678
15920
|
{
|
|
15679
15921
|
components: columns.right,
|
|
@@ -15708,14 +15950,14 @@ var getWidth = (bias) => {
|
|
|
15708
15950
|
var DynamicColumns_default = DynamicColumns;
|
|
15709
15951
|
|
|
15710
15952
|
// src/legacy/layout/decision/DynamicDecision.tsx
|
|
15711
|
-
import { Header as
|
|
15712
|
-
import { jsx as
|
|
15953
|
+
import { Header as Header8, NavigationOption as NavigationOption4, NavigationOptionsList as NavigationOptionsList3 } from "@transferwise/components";
|
|
15954
|
+
import { jsx as jsx75, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
15713
15955
|
function DynamicDecision({ component, onAction }) {
|
|
15714
15956
|
const { loading } = useDynamicFlow();
|
|
15715
15957
|
const { margin, options, title } = component;
|
|
15716
|
-
return /* @__PURE__ */
|
|
15717
|
-
title && /* @__PURE__ */
|
|
15718
|
-
/* @__PURE__ */
|
|
15958
|
+
return /* @__PURE__ */ jsxs25("div", { className: getMargin2(margin), children: [
|
|
15959
|
+
title && /* @__PURE__ */ jsx75(Header8, { as: "h2", title }),
|
|
15960
|
+
/* @__PURE__ */ jsx75(NavigationOptionsList3, { children: options.map((option) => /* @__PURE__ */ jsx75(
|
|
15719
15961
|
NavigationOption4,
|
|
15720
15962
|
{
|
|
15721
15963
|
title: option.title,
|
|
@@ -15733,11 +15975,11 @@ function DynamicDecision({ component, onAction }) {
|
|
|
15733
15975
|
var DynamicDecision_default = DynamicDecision;
|
|
15734
15976
|
|
|
15735
15977
|
// src/legacy/layout/divider/DynamicDivider.tsx
|
|
15736
|
-
import { jsx as
|
|
15978
|
+
import { jsx as jsx76 } from "react/jsx-runtime";
|
|
15737
15979
|
var DynamicDivider = ({ component }) => {
|
|
15738
15980
|
const margin = getMargin2(component.margin);
|
|
15739
15981
|
const className = `m-t-0 ${margin}`;
|
|
15740
|
-
return /* @__PURE__ */
|
|
15982
|
+
return /* @__PURE__ */ jsx76("hr", { className });
|
|
15741
15983
|
};
|
|
15742
15984
|
var DynamicDivider_default = DynamicDivider;
|
|
15743
15985
|
|
|
@@ -15757,7 +15999,7 @@ var DynamicExternal_messages_default = defineMessages13({
|
|
|
15757
15999
|
});
|
|
15758
16000
|
|
|
15759
16001
|
// src/legacy/layout/external/DynamicExternal.tsx
|
|
15760
|
-
import { Fragment as Fragment11, jsx as
|
|
16002
|
+
import { Fragment as Fragment11, jsx as jsx77, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
15761
16003
|
var DynamicExternal = ({ component, onAction }) => {
|
|
15762
16004
|
const { requestUrl, responseHandlers, polling, retryTitle } = component;
|
|
15763
16005
|
const intl = useIntl11();
|
|
@@ -15774,10 +16016,10 @@ var DynamicExternal = ({ component, onAction }) => {
|
|
|
15774
16016
|
}) : void 0;
|
|
15775
16017
|
}, [polling, responseHandlers]);
|
|
15776
16018
|
useExternalStepPolling(pollingConfiguration, onAction);
|
|
15777
|
-
return /* @__PURE__ */
|
|
15778
|
-
/* @__PURE__ */
|
|
15779
|
-
/* @__PURE__ */
|
|
15780
|
-
/* @__PURE__ */
|
|
16019
|
+
return /* @__PURE__ */ jsxs26(Fragment11, { children: [
|
|
16020
|
+
/* @__PURE__ */ jsx77(Loader2, { size: Size2.LARGE, classNames: { "tw-loader": "tw-loader m-x-auto" } }),
|
|
16021
|
+
/* @__PURE__ */ jsx77("br", {}),
|
|
16022
|
+
/* @__PURE__ */ jsx77(Button8, { priority: "tertiary", block: true, onClick: openExternalUrl, children: retryTitle || intl.formatMessage(DynamicExternal_messages_default.retryTitle) })
|
|
15781
16023
|
] });
|
|
15782
16024
|
};
|
|
15783
16025
|
var DynamicExternal_default = DynamicExternal;
|
|
@@ -15786,10 +16028,10 @@ var DynamicExternal_default = DynamicExternal;
|
|
|
15786
16028
|
import { useEffect as useEffect15 } from "react";
|
|
15787
16029
|
|
|
15788
16030
|
// src/legacy/jsonSchemaForm/allOfSchema/AllOfSchema.tsx
|
|
15789
|
-
var
|
|
15790
|
-
import { Header as
|
|
16031
|
+
var import_classnames7 = __toESM(require_classnames());
|
|
16032
|
+
import { Header as Header9 } from "@transferwise/components";
|
|
15791
16033
|
import { useState as useState12 } from "react";
|
|
15792
|
-
import { Fragment as Fragment12, jsx as
|
|
16034
|
+
import { Fragment as Fragment12, jsx as jsx78, jsxs as jsxs27 } from "react/jsx-runtime";
|
|
15793
16035
|
var splitModel = (model, schemas) => schemas.map((schema) => getValidObjectModelParts(model, schema) || {});
|
|
15794
16036
|
var combineModels = (models) => models.reduce((current, combined) => __spreadValues(__spreadValues({}, combined), current), {});
|
|
15795
16037
|
var getSchemaColumnClasses = (width) => ({
|
|
@@ -15806,12 +16048,12 @@ function AllOfSchema(props) {
|
|
|
15806
16048
|
props.onChange(__spreadProps(__spreadValues({}, onChangeProps), { model: combineModels(models) }));
|
|
15807
16049
|
};
|
|
15808
16050
|
const [models, setModels] = useState12(splitModel(props.model, props.schema.allOf));
|
|
15809
|
-
return /* @__PURE__ */
|
|
15810
|
-
props.schema.title && !hideTitle && /* @__PURE__ */
|
|
15811
|
-
props.schema.description && /* @__PURE__ */
|
|
15812
|
-
/* @__PURE__ */
|
|
16051
|
+
return /* @__PURE__ */ jsxs27(Fragment12, { children: [
|
|
16052
|
+
props.schema.title && !hideTitle && /* @__PURE__ */ jsx78(Header9, { title: props.schema.title }),
|
|
16053
|
+
props.schema.description && /* @__PURE__ */ jsx78("p", { children: props.schema.description }),
|
|
16054
|
+
/* @__PURE__ */ jsx78("div", { className: "row", children: props.schema.allOf.map((schema, index) => (
|
|
15813
16055
|
// eslint-disable-next-line react/no-array-index-key
|
|
15814
|
-
/* @__PURE__ */
|
|
16056
|
+
/* @__PURE__ */ jsx78("div", { className: (0, import_classnames7.default)(getSchemaColumnClasses(schema.width)), children: /* @__PURE__ */ jsx78(
|
|
15815
16057
|
GenericSchema_default,
|
|
15816
16058
|
{
|
|
15817
16059
|
schema,
|
|
@@ -15832,7 +16074,7 @@ function AllOfSchema(props) {
|
|
|
15832
16074
|
var AllOfSchema_default = AllOfSchema;
|
|
15833
16075
|
|
|
15834
16076
|
// src/legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/MultipleFileUploadSchema.tsx
|
|
15835
|
-
var
|
|
16077
|
+
var import_classnames8 = __toESM(require_classnames());
|
|
15836
16078
|
import {
|
|
15837
16079
|
Status,
|
|
15838
16080
|
UploadInput as UploadInput3
|
|
@@ -15843,7 +16085,7 @@ import { useMemo as useMemo13, useState as useState13 } from "react";
|
|
|
15843
16085
|
import { InlineAlert as InlineAlert3 } from "@transferwise/components";
|
|
15844
16086
|
import { formatDate as formatDate3 } from "@transferwise/formatting";
|
|
15845
16087
|
import { useIntl as useIntl12 } from "react-intl";
|
|
15846
|
-
import { jsx as
|
|
16088
|
+
import { jsx as jsx79, jsxs as jsxs28 } from "react/jsx-runtime";
|
|
15847
16089
|
function ControlFeedback(props) {
|
|
15848
16090
|
const { errors = "", validations = [], validationMessages = {} } = props;
|
|
15849
16091
|
const defaultValidationMessages = useDefaultValidationMessages(props.schema);
|
|
@@ -15852,12 +16094,12 @@ function ControlFeedback(props) {
|
|
|
15852
16094
|
const isValidationVisible = !isErrorVisible && (props.submitted || props.changed && props.blurred) && Boolean(validations == null ? void 0 : validations.length);
|
|
15853
16095
|
const isDescriptionVisible = props.schema.type !== "boolean" && props.schema.description && !isErrorVisible && !isValidationVisible;
|
|
15854
16096
|
const hasInfoMessage = Boolean(props.infoMessage);
|
|
15855
|
-
return /* @__PURE__ */
|
|
15856
|
-
isErrorVisible ? /* @__PURE__ */
|
|
15857
|
-
isValidationVisible ? /* @__PURE__ */
|
|
15858
|
-
(isDescriptionVisible || hasInfoMessage) && /* @__PURE__ */
|
|
15859
|
-
isDescriptionVisible && /* @__PURE__ */
|
|
15860
|
-
hasInfoMessage && /* @__PURE__ */
|
|
16097
|
+
return /* @__PURE__ */ jsxs28("div", { id: props.id, children: [
|
|
16098
|
+
isErrorVisible ? /* @__PURE__ */ jsx79(InlineAlert3, { type: "error", children: errors }) : null,
|
|
16099
|
+
isValidationVisible ? /* @__PURE__ */ jsx79(InlineAlert3, { type: "error", children: validations.map((validation) => /* @__PURE__ */ jsx79("div", { children: mergedValidationMessages[validation] }, validation)) }) : null,
|
|
16100
|
+
(isDescriptionVisible || hasInfoMessage) && /* @__PURE__ */ jsxs28(InlineAlert3, { type: "info", children: [
|
|
16101
|
+
isDescriptionVisible && /* @__PURE__ */ jsx79("div", { children: props.schema.description }),
|
|
16102
|
+
hasInfoMessage && /* @__PURE__ */ jsx79("div", { children: props.infoMessage })
|
|
15861
16103
|
] })
|
|
15862
16104
|
] });
|
|
15863
16105
|
}
|
|
@@ -15977,7 +16219,7 @@ function useFormattedDefaultErrorMessages({
|
|
|
15977
16219
|
}
|
|
15978
16220
|
|
|
15979
16221
|
// src/legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/MultipleFileUploadSchema.tsx
|
|
15980
|
-
import { jsx as
|
|
16222
|
+
import { jsx as jsx80, jsxs as jsxs29 } from "react/jsx-runtime";
|
|
15981
16223
|
function MultipleFileUploadSchema(props) {
|
|
15982
16224
|
var _a, _b;
|
|
15983
16225
|
const { onChange, errors = null, schema, required = false } = props;
|
|
@@ -16038,10 +16280,10 @@ function MultipleFileUploadSchema(props) {
|
|
|
16038
16280
|
onDeleteFile: () => Promise.resolve()
|
|
16039
16281
|
});
|
|
16040
16282
|
const feedbackId = `${uid}-feedback`;
|
|
16041
|
-
return /* @__PURE__ */
|
|
16042
|
-
/* @__PURE__ */
|
|
16043
|
-
/* @__PURE__ */
|
|
16044
|
-
/* @__PURE__ */
|
|
16283
|
+
return /* @__PURE__ */ jsxs29("div", { className: (0, import_classnames8.default)("form-group", { "has-error": showError }), children: [
|
|
16284
|
+
/* @__PURE__ */ jsx80("label", { className: "d-block control-label", htmlFor: uid, children: props.schema.title }),
|
|
16285
|
+
/* @__PURE__ */ jsx80("div", { "aria-describedby": feedbackId, children: /* @__PURE__ */ jsx80(UploadInput3, __spreadValues({}, uploadInputProps)) }),
|
|
16286
|
+
/* @__PURE__ */ jsx80(
|
|
16045
16287
|
ControlFeedback_default,
|
|
16046
16288
|
{
|
|
16047
16289
|
id: feedbackId,
|
|
@@ -16074,14 +16316,14 @@ function getValidationMessages(schema, required, defaultErrorMessages) {
|
|
|
16074
16316
|
}
|
|
16075
16317
|
|
|
16076
16318
|
// src/legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multiSelectSchema/MultiSelectSchema.tsx
|
|
16077
|
-
var
|
|
16319
|
+
var import_classnames9 = __toESM(require_classnames());
|
|
16078
16320
|
import { SelectInput as SelectInput3, SelectInputOptionContent as SelectInputOptionContent3 } from "@transferwise/components";
|
|
16079
16321
|
import { useEffect as useEffect9, useMemo as useMemo14, useState as useState14 } from "react";
|
|
16080
16322
|
import { useIntl as useIntl14 } from "react-intl";
|
|
16081
16323
|
|
|
16082
16324
|
// src/legacy/jsonSchemaForm/schemaFormControl/utils/mapping-utils.tsx
|
|
16083
16325
|
import { Avatar as Avatar6, AvatarType as AvatarType5 } from "@transferwise/components";
|
|
16084
|
-
import { jsx as
|
|
16326
|
+
import { jsx as jsx81 } from "react/jsx-runtime";
|
|
16085
16327
|
var mapConstSchemaToOption = (schema, controlType) => {
|
|
16086
16328
|
switch (controlType) {
|
|
16087
16329
|
case "select":
|
|
@@ -16105,7 +16347,7 @@ var mapKeywordsToSearchStrings = (searchStrings) => isArray2(searchStrings) ? {
|
|
|
16105
16347
|
var mapImage = (image) => {
|
|
16106
16348
|
if (image == null ? void 0 : image.url) {
|
|
16107
16349
|
return {
|
|
16108
|
-
icon: /* @__PURE__ */
|
|
16350
|
+
icon: /* @__PURE__ */ jsx81("div", { className: "media", children: /* @__PURE__ */ jsx81("div", { className: "np-option__no-media-circle", children: /* @__PURE__ */ jsx81("img", { src: image.url, alt: image.name || "" }) }) }),
|
|
16109
16351
|
hideIconInTrigger: true
|
|
16110
16352
|
};
|
|
16111
16353
|
}
|
|
@@ -16114,17 +16356,17 @@ var mapImage = (image) => {
|
|
|
16114
16356
|
var getIconPropertyForSelectOption = (icon) => {
|
|
16115
16357
|
if ((icon == null ? void 0 : icon.name) && isFlagIcon3(icon.name)) {
|
|
16116
16358
|
return {
|
|
16117
|
-
icon: /* @__PURE__ */
|
|
16359
|
+
icon: /* @__PURE__ */ jsx81(Flag, { code: icon.name.substring(5), intrinsicSize: 24 })
|
|
16118
16360
|
};
|
|
16119
16361
|
}
|
|
16120
16362
|
if ((icon == null ? void 0 : icon.name) && isValidIconName(icon.name)) {
|
|
16121
16363
|
return {
|
|
16122
|
-
icon: /* @__PURE__ */
|
|
16364
|
+
icon: /* @__PURE__ */ jsx81(DynamicIcon_default2, { type: icon.name })
|
|
16123
16365
|
};
|
|
16124
16366
|
}
|
|
16125
16367
|
if (icon == null ? void 0 : icon.text) {
|
|
16126
16368
|
return {
|
|
16127
|
-
icon: /* @__PURE__ */
|
|
16369
|
+
icon: /* @__PURE__ */ jsx81("span", { children: icon.text })
|
|
16128
16370
|
};
|
|
16129
16371
|
}
|
|
16130
16372
|
return null;
|
|
@@ -16132,17 +16374,17 @@ var getIconPropertyForSelectOption = (icon) => {
|
|
|
16132
16374
|
var getAvatarPropertyForRadioOption = ({ image, icon }) => {
|
|
16133
16375
|
if (image == null ? void 0 : image.url) {
|
|
16134
16376
|
return {
|
|
16135
|
-
avatar: /* @__PURE__ */
|
|
16377
|
+
avatar: /* @__PURE__ */ jsx81(Avatar6, { type: AvatarType5.THUMBNAIL, children: /* @__PURE__ */ jsx81("img", { src: image.url, alt: "" }) })
|
|
16136
16378
|
};
|
|
16137
16379
|
}
|
|
16138
16380
|
if ((icon == null ? void 0 : icon.name) && isValidIconName(icon.name)) {
|
|
16139
16381
|
return {
|
|
16140
|
-
avatar: /* @__PURE__ */
|
|
16382
|
+
avatar: /* @__PURE__ */ jsx81(Avatar6, { type: AvatarType5.ICON, children: /* @__PURE__ */ jsx81(DynamicIcon_default2, { type: icon.name }) })
|
|
16141
16383
|
};
|
|
16142
16384
|
}
|
|
16143
16385
|
if (icon == null ? void 0 : icon.text) {
|
|
16144
16386
|
return {
|
|
16145
|
-
avatar: /* @__PURE__ */
|
|
16387
|
+
avatar: /* @__PURE__ */ jsx81(Avatar6, { type: AvatarType5.INITIALS, children: icon.text })
|
|
16146
16388
|
};
|
|
16147
16389
|
}
|
|
16148
16390
|
return null;
|
|
@@ -16181,7 +16423,7 @@ var multi_select_messages_default2 = defineMessages15({
|
|
|
16181
16423
|
});
|
|
16182
16424
|
|
|
16183
16425
|
// src/legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multiSelectSchema/MultiSelectSchema.tsx
|
|
16184
|
-
import { jsx as
|
|
16426
|
+
import { jsx as jsx82, jsxs as jsxs30 } from "react/jsx-runtime";
|
|
16185
16427
|
function MultiSelectSchema({
|
|
16186
16428
|
schema,
|
|
16187
16429
|
model,
|
|
@@ -16235,9 +16477,9 @@ function MultiSelectSchema({
|
|
|
16235
16477
|
"has-error": shouldShowInitialError || shouldShowValidationError,
|
|
16236
16478
|
"has-info": !!schema.description
|
|
16237
16479
|
};
|
|
16238
|
-
return /* @__PURE__ */
|
|
16239
|
-
schema.title ? /* @__PURE__ */
|
|
16240
|
-
/* @__PURE__ */
|
|
16480
|
+
return /* @__PURE__ */ jsxs30("div", { className: (0, import_classnames9.default)("d-flex flex-column", formGroupClasses), children: [
|
|
16481
|
+
schema.title ? /* @__PURE__ */ jsx82("label", { className: "control-label d-inline m-b-1", htmlFor: id, children: schema.title }) : void 0,
|
|
16482
|
+
/* @__PURE__ */ jsx82(
|
|
16241
16483
|
SelectInput3,
|
|
16242
16484
|
{
|
|
16243
16485
|
id,
|
|
@@ -16263,12 +16505,12 @@ function MultiSelectSchema({
|
|
|
16263
16505
|
if (withinTrigger) {
|
|
16264
16506
|
return selected && index === selected[0] ? getFormattedMessage() : void 0;
|
|
16265
16507
|
}
|
|
16266
|
-
return /* @__PURE__ */
|
|
16508
|
+
return /* @__PURE__ */ jsx82(SelectInputOptionContent3, { title: label, note: note != null ? note : secondary, icon });
|
|
16267
16509
|
},
|
|
16268
16510
|
onChange: broadcastModelChange
|
|
16269
16511
|
}
|
|
16270
16512
|
),
|
|
16271
|
-
/* @__PURE__ */
|
|
16513
|
+
/* @__PURE__ */ jsx82(
|
|
16272
16514
|
ControlFeedback_default,
|
|
16273
16515
|
{
|
|
16274
16516
|
id: `${id}-feedback`,
|
|
@@ -16293,16 +16535,16 @@ var getInitialModelIndices2 = (model, options) => {
|
|
|
16293
16535
|
};
|
|
16294
16536
|
|
|
16295
16537
|
// src/legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/repeatableSchema/RepeatableSchema.tsx
|
|
16296
|
-
import { Header as
|
|
16538
|
+
import { Header as Header10, Modal as Modal3, NavigationOption as NavigationOption6 } from "@transferwise/components";
|
|
16297
16539
|
import { Plus as Plus2 } from "@transferwise/icons";
|
|
16298
16540
|
import { useMemo as useMemo15, useState as useState16 } from "react";
|
|
16299
16541
|
import { useIntl as useIntl16 } from "react-intl";
|
|
16300
16542
|
|
|
16301
16543
|
// src/legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/repeatableSchema/ItemSummary.tsx
|
|
16302
16544
|
import { NavigationOption as NavigationOption5 } from "@transferwise/components";
|
|
16303
|
-
import { jsx as
|
|
16545
|
+
import { jsx as jsx83 } from "react/jsx-runtime";
|
|
16304
16546
|
function ItemSummaryOption2({ item, onClick }) {
|
|
16305
|
-
return /* @__PURE__ */
|
|
16547
|
+
return /* @__PURE__ */ jsx83(
|
|
16306
16548
|
NavigationOption5,
|
|
16307
16549
|
{
|
|
16308
16550
|
media: getNavigationOptionMedia(item),
|
|
@@ -16342,7 +16584,7 @@ var repeatable_messages_default2 = defineMessages16({
|
|
|
16342
16584
|
// src/legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/repeatableSchema/RepeatableSchemaStep.tsx
|
|
16343
16585
|
import { useState as useState15 } from "react";
|
|
16344
16586
|
import { useIntl as useIntl15 } from "react-intl";
|
|
16345
|
-
import { jsx as
|
|
16587
|
+
import { jsx as jsx84 } from "react/jsx-runtime";
|
|
16346
16588
|
function RepeatableSchemaStep({
|
|
16347
16589
|
type,
|
|
16348
16590
|
schema,
|
|
@@ -16390,7 +16632,7 @@ function RepeatableSchemaStep({
|
|
|
16390
16632
|
}
|
|
16391
16633
|
onModelChange(__spreadProps(__spreadValues({}, modelChangeProps), { model: model2 }));
|
|
16392
16634
|
};
|
|
16393
|
-
return /* @__PURE__ */
|
|
16635
|
+
return /* @__PURE__ */ jsx84(
|
|
16394
16636
|
DynamicFlowStep,
|
|
16395
16637
|
{
|
|
16396
16638
|
step,
|
|
@@ -16595,8 +16837,8 @@ var schemaSummaryProvides = (summary, providesProp) => (
|
|
|
16595
16837
|
);
|
|
16596
16838
|
|
|
16597
16839
|
// src/legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/repeatableSchema/RepeatableSchema.tsx
|
|
16598
|
-
var
|
|
16599
|
-
import { jsx as
|
|
16840
|
+
var import_classnames10 = __toESM(require_classnames());
|
|
16841
|
+
import { jsx as jsx85, jsxs as jsxs31 } from "react/jsx-runtime";
|
|
16600
16842
|
function RepeatableSchema({
|
|
16601
16843
|
schema,
|
|
16602
16844
|
model,
|
|
@@ -16673,9 +16915,9 @@ function RepeatableSchema({
|
|
|
16673
16915
|
const formGroupClasses = {
|
|
16674
16916
|
"has-error": (_a = errors && !isEmpty(errors)) != null ? _a : submitted && validations.length
|
|
16675
16917
|
};
|
|
16676
|
-
return /* @__PURE__ */
|
|
16677
|
-
schema.title && /* @__PURE__ */
|
|
16678
|
-
itemSummaries == null ? void 0 : itemSummaries.map((itemSummary) => /* @__PURE__ */
|
|
16918
|
+
return /* @__PURE__ */ jsxs31("div", { id, className: (0, import_classnames10.default)(formGroupClasses), children: [
|
|
16919
|
+
schema.title && /* @__PURE__ */ jsx85(Header10, { title: schema.title }),
|
|
16920
|
+
itemSummaries == null ? void 0 : itemSummaries.map((itemSummary) => /* @__PURE__ */ jsx85(
|
|
16679
16921
|
ItemSummaryOption2,
|
|
16680
16922
|
{
|
|
16681
16923
|
item: itemSummary,
|
|
@@ -16683,21 +16925,21 @@ function RepeatableSchema({
|
|
|
16683
16925
|
},
|
|
16684
16926
|
JSON.stringify(itemSummary)
|
|
16685
16927
|
)),
|
|
16686
|
-
/* @__PURE__ */
|
|
16928
|
+
/* @__PURE__ */ jsx85(
|
|
16687
16929
|
NavigationOption6,
|
|
16688
16930
|
{
|
|
16689
|
-
media: /* @__PURE__ */
|
|
16931
|
+
media: /* @__PURE__ */ jsx85(Plus2, {}),
|
|
16690
16932
|
title: schema.addItemTitle || formatMessage(repeatable_messages_default2.addItemTitle),
|
|
16691
16933
|
showMediaAtAllSizes: true,
|
|
16692
16934
|
onClick: onAddItem
|
|
16693
16935
|
}
|
|
16694
16936
|
),
|
|
16695
|
-
/* @__PURE__ */
|
|
16937
|
+
/* @__PURE__ */ jsx85(
|
|
16696
16938
|
Modal3,
|
|
16697
16939
|
{
|
|
16698
16940
|
open: openModalType !== null,
|
|
16699
16941
|
title: (openModalType === "add" ? schema.addItemTitle : schema.editItemTitle) || formatMessage(repeatable_messages_default2.addItemTitle),
|
|
16700
|
-
body: /* @__PURE__ */
|
|
16942
|
+
body: /* @__PURE__ */ jsx85(
|
|
16701
16943
|
RepeatableSchemaStep_default,
|
|
16702
16944
|
{
|
|
16703
16945
|
type: openModalType != null ? openModalType : "add",
|
|
@@ -16712,7 +16954,7 @@ function RepeatableSchema({
|
|
|
16712
16954
|
onClose: onCancelEdit
|
|
16713
16955
|
}
|
|
16714
16956
|
),
|
|
16715
|
-
/* @__PURE__ */
|
|
16957
|
+
/* @__PURE__ */ jsx85(
|
|
16716
16958
|
ControlFeedback_default,
|
|
16717
16959
|
{
|
|
16718
16960
|
id: `${id}-feedback`,
|
|
@@ -16754,38 +16996,38 @@ var getUpdatedItemSummaries = (action, {
|
|
|
16754
16996
|
var RepeatableSchema_default = RepeatableSchema;
|
|
16755
16997
|
|
|
16756
16998
|
// src/legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/ArrayListSchema.tsx
|
|
16757
|
-
import { jsx as
|
|
16999
|
+
import { jsx as jsx86 } from "react/jsx-runtime";
|
|
16758
17000
|
function ArrayListSchema(props) {
|
|
16759
17001
|
const { errors = null, schema } = props;
|
|
16760
17002
|
if (isMultipleFileUploadSchema(schema)) {
|
|
16761
|
-
return /* @__PURE__ */
|
|
17003
|
+
return /* @__PURE__ */ jsx86(MultipleFileUploadSchema_default, __spreadProps(__spreadValues({}, props), { errors, schema }));
|
|
16762
17004
|
}
|
|
16763
17005
|
if (isMultiSelectConstSchema(schema)) {
|
|
16764
|
-
return /* @__PURE__ */
|
|
17006
|
+
return /* @__PURE__ */ jsx86(MultiSelectSchema, __spreadProps(__spreadValues({}, props), { errors, schema }));
|
|
16765
17007
|
}
|
|
16766
17008
|
if (isListArraySchema(schema)) {
|
|
16767
|
-
return /* @__PURE__ */
|
|
17009
|
+
return /* @__PURE__ */ jsx86(RepeatableSchema_default, __spreadProps(__spreadValues({}, props), { errors, schema }));
|
|
16768
17010
|
}
|
|
16769
17011
|
throw new Error("Invalid array list schema");
|
|
16770
17012
|
}
|
|
16771
17013
|
var ArrayListSchema_default = ArrayListSchema;
|
|
16772
17014
|
|
|
16773
17015
|
// src/legacy/jsonSchemaForm/arrayTypeSchema/ArraySchema.tsx
|
|
16774
|
-
import { jsx as
|
|
17016
|
+
import { jsx as jsx87 } from "react/jsx-runtime";
|
|
16775
17017
|
var ArraySchema = (props) => {
|
|
16776
17018
|
const { schema } = props;
|
|
16777
17019
|
if (isListArraySchema(schema)) {
|
|
16778
|
-
return /* @__PURE__ */
|
|
17020
|
+
return /* @__PURE__ */ jsx87(ArrayListSchema_default, __spreadValues({}, props));
|
|
16779
17021
|
}
|
|
16780
17022
|
throw new Error("Not implemented");
|
|
16781
17023
|
};
|
|
16782
17024
|
var ArraySchema_default = ArraySchema;
|
|
16783
17025
|
|
|
16784
17026
|
// src/legacy/jsonSchemaForm/objectSchema/ObjectSchema.tsx
|
|
16785
|
-
var
|
|
16786
|
-
import { Header as
|
|
17027
|
+
var import_classnames11 = __toESM(require_classnames());
|
|
17028
|
+
import { Header as Header11 } from "@transferwise/components";
|
|
16787
17029
|
import { useState as useState17, useEffect as useEffect10 } from "react";
|
|
16788
|
-
import { Fragment as Fragment13, jsx as
|
|
17030
|
+
import { Fragment as Fragment13, jsx as jsx88, jsxs as jsxs32 } from "react/jsx-runtime";
|
|
16789
17031
|
var getSchemaColumnClasses2 = (width) => ({
|
|
16790
17032
|
"col-xs-12": true,
|
|
16791
17033
|
"col-sm-6": width === "md",
|
|
@@ -16822,22 +17064,22 @@ function ObjectSchema(props) {
|
|
|
16822
17064
|
const isPropertyDefined = (propertyName) => typeof props.schema.properties[propertyName] !== "undefined";
|
|
16823
17065
|
const orderedPropertyNames = Array.from(allorderedPropertiesSet).filter(isPropertyDefined);
|
|
16824
17066
|
const propsErrors = props.errors;
|
|
16825
|
-
return /* @__PURE__ */
|
|
16826
|
-
props.schema.alert && /* @__PURE__ */
|
|
16827
|
-
/* @__PURE__ */
|
|
16828
|
-
props.schema.title && !hideTitle && /* @__PURE__ */
|
|
16829
|
-
props.schema.description && !hideTitle && /* @__PURE__ */
|
|
17067
|
+
return /* @__PURE__ */ jsxs32(Fragment13, { children: [
|
|
17068
|
+
props.schema.alert && /* @__PURE__ */ jsx88(DynamicAlert_default, { component: props.schema.alert }),
|
|
17069
|
+
/* @__PURE__ */ jsxs32("fieldset", { children: [
|
|
17070
|
+
props.schema.title && !hideTitle && /* @__PURE__ */ jsx88(Header11, { title: props.schema.title, as: "legend" }),
|
|
17071
|
+
props.schema.description && !hideTitle && /* @__PURE__ */ jsxs32("p", { children: [
|
|
16830
17072
|
" ",
|
|
16831
17073
|
props.schema.description,
|
|
16832
17074
|
" "
|
|
16833
17075
|
] }),
|
|
16834
|
-
/* @__PURE__ */
|
|
17076
|
+
/* @__PURE__ */ jsx88("div", { className: "row", children: orderedPropertyNames.map((propertyName) => /* @__PURE__ */ jsx88(
|
|
16835
17077
|
"div",
|
|
16836
17078
|
{
|
|
16837
|
-
className: (0,
|
|
17079
|
+
className: (0, import_classnames11.default)(
|
|
16838
17080
|
getSchemaColumnClasses2(props.schema.properties[propertyName].width)
|
|
16839
17081
|
),
|
|
16840
|
-
children: /* @__PURE__ */
|
|
17082
|
+
children: /* @__PURE__ */ jsx88(
|
|
16841
17083
|
GenericSchema_default,
|
|
16842
17084
|
{
|
|
16843
17085
|
schema: props.schema.properties[propertyName],
|
|
@@ -16859,8 +17101,8 @@ function ObjectSchema(props) {
|
|
|
16859
17101
|
var ObjectSchema_default = ObjectSchema;
|
|
16860
17102
|
|
|
16861
17103
|
// src/legacy/jsonSchemaForm/oneOfSchema/OneOfSchema.tsx
|
|
16862
|
-
var
|
|
16863
|
-
import { Header as
|
|
17104
|
+
var import_classnames12 = __toESM(require_classnames());
|
|
17105
|
+
import { Header as Header12 } from "@transferwise/components";
|
|
16864
17106
|
import { useEffect as useEffect12, useMemo as useMemo16, useState as useState18 } from "react";
|
|
16865
17107
|
|
|
16866
17108
|
// src/legacy/jsonSchemaForm/help/Help.tsx
|
|
@@ -16878,14 +17120,14 @@ var help_messages_default2 = defineMessages17({
|
|
|
16878
17120
|
});
|
|
16879
17121
|
|
|
16880
17122
|
// src/legacy/jsonSchemaForm/help/Help.tsx
|
|
16881
|
-
import { jsx as
|
|
17123
|
+
import { jsx as jsx89 } from "react/jsx-runtime";
|
|
16882
17124
|
function Help2(props) {
|
|
16883
17125
|
const intl = useIntl17();
|
|
16884
|
-
return /* @__PURE__ */
|
|
17126
|
+
return /* @__PURE__ */ jsx89(
|
|
16885
17127
|
Info2,
|
|
16886
17128
|
{
|
|
16887
17129
|
className: "m-l-1",
|
|
16888
|
-
content: /* @__PURE__ */
|
|
17130
|
+
content: /* @__PURE__ */ jsx89(Markdown6, { config: { link: { target: "_blank" } }, children: props.help.markdown }),
|
|
16889
17131
|
presentation: "POPOVER",
|
|
16890
17132
|
size: "sm",
|
|
16891
17133
|
"aria-label": intl.formatMessage(help_messages_default2.helpAria)
|
|
@@ -17098,7 +17340,7 @@ var autocompleteTokenMap2 = {
|
|
|
17098
17340
|
};
|
|
17099
17341
|
|
|
17100
17342
|
// src/legacy/formControl/FormControl.tsx
|
|
17101
|
-
import { Fragment as Fragment14, jsx as
|
|
17343
|
+
import { Fragment as Fragment14, jsx as jsx90 } from "react/jsx-runtime";
|
|
17102
17344
|
var _FormControl = class _FormControl extends PureComponent {
|
|
17103
17345
|
constructor(props) {
|
|
17104
17346
|
super(props);
|
|
@@ -17188,7 +17430,7 @@ var _FormControl = class _FormControl extends PureComponent {
|
|
|
17188
17430
|
} = this.props;
|
|
17189
17431
|
switch (type) {
|
|
17190
17432
|
case FormControlType.RADIO:
|
|
17191
|
-
return /* @__PURE__ */
|
|
17433
|
+
return /* @__PURE__ */ jsx90(
|
|
17192
17434
|
RadioGroup2,
|
|
17193
17435
|
{
|
|
17194
17436
|
radios: options.map(this.mapOption),
|
|
@@ -17204,7 +17446,7 @@ var _FormControl = class _FormControl extends PureComponent {
|
|
|
17204
17446
|
}
|
|
17205
17447
|
);
|
|
17206
17448
|
case FormControlType.CHECKBOX:
|
|
17207
|
-
return /* @__PURE__ */
|
|
17449
|
+
return /* @__PURE__ */ jsx90(
|
|
17208
17450
|
Checkbox2,
|
|
17209
17451
|
{
|
|
17210
17452
|
checked: getSafeBooleanValue(value, { coerceValue: true }),
|
|
@@ -17222,7 +17464,7 @@ var _FormControl = class _FormControl extends PureComponent {
|
|
|
17222
17464
|
const search = options.length >= 8;
|
|
17223
17465
|
const items = options;
|
|
17224
17466
|
const selected = this.getSelectedOption(options);
|
|
17225
|
-
return /* @__PURE__ */
|
|
17467
|
+
return /* @__PURE__ */ jsx90("div", { className: "d-flex flex-column", children: /* @__PURE__ */ jsx90(
|
|
17226
17468
|
SelectInput4,
|
|
17227
17469
|
{
|
|
17228
17470
|
id,
|
|
@@ -17238,7 +17480,7 @@ var _FormControl = class _FormControl extends PureComponent {
|
|
|
17238
17480
|
disabled: value2.disabled
|
|
17239
17481
|
})),
|
|
17240
17482
|
value: selected != null ? selected : null,
|
|
17241
|
-
renderValue: ({ hideIconInTrigger, icon, label: label2, note, secondary }, withinTrigger) => /* @__PURE__ */
|
|
17483
|
+
renderValue: ({ hideIconInTrigger, icon, label: label2, note, secondary }, withinTrigger) => /* @__PURE__ */ jsx90(
|
|
17242
17484
|
SelectInputOptionContent4,
|
|
17243
17485
|
{
|
|
17244
17486
|
title: label2,
|
|
@@ -17267,13 +17509,13 @@ var _FormControl = class _FormControl extends PureComponent {
|
|
|
17267
17509
|
) });
|
|
17268
17510
|
}
|
|
17269
17511
|
case FormControlType.TAB:
|
|
17270
|
-
return /* @__PURE__ */
|
|
17512
|
+
return /* @__PURE__ */ jsx90(
|
|
17271
17513
|
Tabs2,
|
|
17272
17514
|
{
|
|
17273
17515
|
selected: ((_a = this.getSelectedOption(options)) == null ? void 0 : _a.value) || 0,
|
|
17274
17516
|
tabs: options.map((option) => ({
|
|
17275
17517
|
title: option.label,
|
|
17276
|
-
content: /* @__PURE__ */
|
|
17518
|
+
content: /* @__PURE__ */ jsx90(Fragment14, {}),
|
|
17277
17519
|
disabled: option.disabled || false
|
|
17278
17520
|
})),
|
|
17279
17521
|
name: id,
|
|
@@ -17288,7 +17530,7 @@ var _FormControl = class _FormControl extends PureComponent {
|
|
|
17288
17530
|
);
|
|
17289
17531
|
case FormControlType.NUMERIC:
|
|
17290
17532
|
case FormControlType.NUMBER: {
|
|
17291
|
-
return /* @__PURE__ */
|
|
17533
|
+
return /* @__PURE__ */ jsx90(
|
|
17292
17534
|
"input",
|
|
17293
17535
|
{
|
|
17294
17536
|
autoComplete: this.getAutocompleteValue(),
|
|
@@ -17322,7 +17564,7 @@ var _FormControl = class _FormControl extends PureComponent {
|
|
|
17322
17564
|
);
|
|
17323
17565
|
}
|
|
17324
17566
|
case FormControlType.HIDDEN:
|
|
17325
|
-
return /* @__PURE__ */
|
|
17567
|
+
return /* @__PURE__ */ jsx90(
|
|
17326
17568
|
"input",
|
|
17327
17569
|
{
|
|
17328
17570
|
type: "hidden",
|
|
@@ -17332,7 +17574,7 @@ var _FormControl = class _FormControl extends PureComponent {
|
|
|
17332
17574
|
}
|
|
17333
17575
|
);
|
|
17334
17576
|
case FormControlType.PASSWORD:
|
|
17335
|
-
return /* @__PURE__ */
|
|
17577
|
+
return /* @__PURE__ */ jsx90(
|
|
17336
17578
|
"input",
|
|
17337
17579
|
{
|
|
17338
17580
|
autoComplete: this.getAutocompleteValue(),
|
|
@@ -17352,7 +17594,7 @@ var _FormControl = class _FormControl extends PureComponent {
|
|
|
17352
17594
|
);
|
|
17353
17595
|
case FormControlType.DATE:
|
|
17354
17596
|
case FormControlType.DATETIME:
|
|
17355
|
-
return /* @__PURE__ */
|
|
17597
|
+
return /* @__PURE__ */ jsx90(
|
|
17356
17598
|
DateInput2,
|
|
17357
17599
|
{
|
|
17358
17600
|
"aria-labelledby": labelledBy,
|
|
@@ -17369,7 +17611,7 @@ var _FormControl = class _FormControl extends PureComponent {
|
|
|
17369
17611
|
}
|
|
17370
17612
|
);
|
|
17371
17613
|
case FormControlType.DATELOOKUP: {
|
|
17372
|
-
return /* @__PURE__ */
|
|
17614
|
+
return /* @__PURE__ */ jsx90(
|
|
17373
17615
|
DateLookup2,
|
|
17374
17616
|
{
|
|
17375
17617
|
value: getSafeDateStringValue(value),
|
|
@@ -17387,7 +17629,7 @@ var _FormControl = class _FormControl extends PureComponent {
|
|
|
17387
17629
|
);
|
|
17388
17630
|
}
|
|
17389
17631
|
case FormControlType.TEL:
|
|
17390
|
-
return /* @__PURE__ */
|
|
17632
|
+
return /* @__PURE__ */ jsx90(
|
|
17391
17633
|
PhoneNumberInput2,
|
|
17392
17634
|
{
|
|
17393
17635
|
disabled,
|
|
@@ -17419,7 +17661,7 @@ var _FormControl = class _FormControl extends PureComponent {
|
|
|
17419
17661
|
autoComplete: this.getAutocompleteValue()
|
|
17420
17662
|
};
|
|
17421
17663
|
if (this.props.displayPattern) {
|
|
17422
|
-
return /* @__PURE__ */
|
|
17664
|
+
return /* @__PURE__ */ jsx90(
|
|
17423
17665
|
TextareaWithDisplayFormat2,
|
|
17424
17666
|
__spreadProps(__spreadValues({
|
|
17425
17667
|
displayPattern: this.props.displayPattern
|
|
@@ -17428,7 +17670,7 @@ var _FormControl = class _FormControl extends PureComponent {
|
|
|
17428
17670
|
})
|
|
17429
17671
|
);
|
|
17430
17672
|
}
|
|
17431
|
-
return /* @__PURE__ */
|
|
17673
|
+
return /* @__PURE__ */ jsx90(
|
|
17432
17674
|
"textarea",
|
|
17433
17675
|
__spreadProps(__spreadValues({}, textareaProps), {
|
|
17434
17676
|
"aria-describedby": describedBy,
|
|
@@ -17438,7 +17680,7 @@ var _FormControl = class _FormControl extends PureComponent {
|
|
|
17438
17680
|
}
|
|
17439
17681
|
case FormControlType.FILE:
|
|
17440
17682
|
case FormControlType.UPLOAD: {
|
|
17441
|
-
return /* @__PURE__ */
|
|
17683
|
+
return /* @__PURE__ */ jsx90(
|
|
17442
17684
|
Upload2,
|
|
17443
17685
|
__spreadProps(__spreadValues({}, uploadProps), {
|
|
17444
17686
|
usAccept: uploadProps.usAccept || "*",
|
|
@@ -17475,7 +17717,7 @@ var _FormControl = class _FormControl extends PureComponent {
|
|
|
17475
17717
|
autoComplete: this.getAutocompleteValue()
|
|
17476
17718
|
};
|
|
17477
17719
|
if (this.props.displayPattern) {
|
|
17478
|
-
return /* @__PURE__ */
|
|
17720
|
+
return /* @__PURE__ */ jsx90(
|
|
17479
17721
|
InputWithDisplayFormat2,
|
|
17480
17722
|
__spreadProps(__spreadValues({
|
|
17481
17723
|
displayPattern: this.props.displayPattern
|
|
@@ -17484,7 +17726,7 @@ var _FormControl = class _FormControl extends PureComponent {
|
|
|
17484
17726
|
})
|
|
17485
17727
|
);
|
|
17486
17728
|
}
|
|
17487
|
-
return /* @__PURE__ */
|
|
17729
|
+
return /* @__PURE__ */ jsx90(
|
|
17488
17730
|
"input",
|
|
17489
17731
|
__spreadProps(__spreadValues({}, inputProps), {
|
|
17490
17732
|
"aria-describedby": describedBy,
|
|
@@ -17534,7 +17776,7 @@ _FormControl.defaultProps = {
|
|
|
17534
17776
|
var FormControl = _FormControl;
|
|
17535
17777
|
|
|
17536
17778
|
// src/legacy/jsonSchemaForm/schemaFormControl/SchemaFormControl.tsx
|
|
17537
|
-
import { jsx as
|
|
17779
|
+
import { jsx as jsx91 } from "react/jsx-runtime";
|
|
17538
17780
|
var isNativeInput = (propsSchemaType) => propsSchemaType === "string" || propsSchemaType === "number";
|
|
17539
17781
|
var getControlType = (schema) => {
|
|
17540
17782
|
if (isOneOfSchema2(schema)) {
|
|
@@ -17651,7 +17893,7 @@ function SchemaFormControl(props) {
|
|
|
17651
17893
|
labelledBy,
|
|
17652
17894
|
required
|
|
17653
17895
|
};
|
|
17654
|
-
return /* @__PURE__ */
|
|
17896
|
+
return /* @__PURE__ */ jsx91("div", { "aria-describedby": describedBy, children: /* @__PURE__ */ jsx91(FormControl, __spreadValues(__spreadValues({ type: controlType, value: safeValue }, events), controlProps)) });
|
|
17655
17897
|
}
|
|
17656
17898
|
var warnIfInvalidSchema = (schema, log, controlType) => {
|
|
17657
17899
|
if (isOneOfSchema2(schema) && schema.oneOf.length === 2 && !schema.control) {
|
|
@@ -17673,7 +17915,7 @@ var warnIfInvalidSchema = (schema, log, controlType) => {
|
|
|
17673
17915
|
var SchemaFormControl_default = SchemaFormControl;
|
|
17674
17916
|
|
|
17675
17917
|
// src/legacy/jsonSchemaForm/oneOfSchema/OneOfSchema.tsx
|
|
17676
|
-
import { Fragment as Fragment15, jsx as
|
|
17918
|
+
import { Fragment as Fragment15, jsx as jsx92, jsxs as jsxs33 } from "react/jsx-runtime";
|
|
17677
17919
|
function OneOfSchema(props) {
|
|
17678
17920
|
const onEvent = useEventDispatcher();
|
|
17679
17921
|
const [changed, setChanged] = useState18(false);
|
|
@@ -17752,12 +17994,12 @@ function OneOfSchema(props) {
|
|
|
17752
17994
|
const isHidden = props.schema.hidden;
|
|
17753
17995
|
const feedbackId = `${id}-feedback`;
|
|
17754
17996
|
const labelId = `${id}-label`;
|
|
17755
|
-
return !isHidden ? /* @__PURE__ */
|
|
17756
|
-
(props.schema.oneOf.length > 1 || isConstSchema2(props.schema.oneOf[0])) && /* @__PURE__ */
|
|
17757
|
-
props.schema.alert && /* @__PURE__ */
|
|
17758
|
-
/* @__PURE__ */
|
|
17997
|
+
return !isHidden ? /* @__PURE__ */ jsxs33(Fragment15, { children: [
|
|
17998
|
+
(props.schema.oneOf.length > 1 || isConstSchema2(props.schema.oneOf[0])) && /* @__PURE__ */ jsxs33(Fragment15, { children: [
|
|
17999
|
+
props.schema.alert && /* @__PURE__ */ jsx92(DynamicAlert_default, { component: props.schema.alert }),
|
|
18000
|
+
/* @__PURE__ */ jsxs33("div", { className: (0, import_classnames12.default)(formGroupClasses), children: [
|
|
17759
18001
|
getTitleAndHelp(props.schema, id, labelId),
|
|
17760
|
-
/* @__PURE__ */
|
|
18002
|
+
/* @__PURE__ */ jsx92(
|
|
17761
18003
|
SchemaFormControl_default,
|
|
17762
18004
|
{
|
|
17763
18005
|
id,
|
|
@@ -17774,7 +18016,7 @@ function OneOfSchema(props) {
|
|
|
17774
18016
|
onSearchChange
|
|
17775
18017
|
}
|
|
17776
18018
|
),
|
|
17777
|
-
/* @__PURE__ */
|
|
18019
|
+
/* @__PURE__ */ jsx92(
|
|
17778
18020
|
ControlFeedback_default,
|
|
17779
18021
|
{
|
|
17780
18022
|
id: feedbackId,
|
|
@@ -17790,7 +18032,7 @@ function OneOfSchema(props) {
|
|
|
17790
18032
|
)
|
|
17791
18033
|
] })
|
|
17792
18034
|
] }),
|
|
17793
|
-
isNoNConstSchema(props.schema.oneOf[schemaIndex]) && /* @__PURE__ */
|
|
18035
|
+
isNoNConstSchema(props.schema.oneOf[schemaIndex]) && /* @__PURE__ */ jsx92(
|
|
17794
18036
|
GenericSchema_default,
|
|
17795
18037
|
{
|
|
17796
18038
|
schema: props.schema.oneOf[schemaIndex],
|
|
@@ -17807,16 +18049,16 @@ function OneOfSchema(props) {
|
|
|
17807
18049
|
}
|
|
17808
18050
|
function getTitleAndHelp(schema, forId, labelId) {
|
|
17809
18051
|
var _a;
|
|
17810
|
-
const helpElement = schema.help ? /* @__PURE__ */
|
|
17811
|
-
const titleElement = isConstSchema2(schema.oneOf[0]) ? /* @__PURE__ */
|
|
18052
|
+
const helpElement = schema.help ? /* @__PURE__ */ jsx92(Help_default2, { help: schema.help }) : null;
|
|
18053
|
+
const titleElement = isConstSchema2(schema.oneOf[0]) ? /* @__PURE__ */ jsx92("div", { className: "m-b-1", children: /* @__PURE__ */ jsxs33("label", { className: "control-label d-inline", id: labelId, htmlFor: forId, children: [
|
|
17812
18054
|
schema.title,
|
|
17813
18055
|
" ",
|
|
17814
18056
|
helpElement
|
|
17815
|
-
] }) }) : /* @__PURE__ */
|
|
18057
|
+
] }) }) : /* @__PURE__ */ jsx92(Fragment15, { children: helpElement ? /* @__PURE__ */ jsxs33("h4", { className: "m-b-2", children: [
|
|
17816
18058
|
schema.title,
|
|
17817
18059
|
" ",
|
|
17818
18060
|
helpElement
|
|
17819
|
-
] }) : /* @__PURE__ */
|
|
18061
|
+
] }) : /* @__PURE__ */ jsx92(Header12, { title: (_a = schema.title) != null ? _a : "" }) });
|
|
17820
18062
|
return schema.title ? titleElement : helpElement;
|
|
17821
18063
|
}
|
|
17822
18064
|
function getValidations(props, schemaIndex) {
|
|
@@ -17849,14 +18091,14 @@ function mapOneOfToConst(schema, index) {
|
|
|
17849
18091
|
var OneOfSchema_default = OneOfSchema;
|
|
17850
18092
|
|
|
17851
18093
|
// src/legacy/jsonSchemaForm/persistAsyncSchema/persistAsyncBlobSchema/PersistAsyncBlobSchema.tsx
|
|
17852
|
-
var
|
|
18094
|
+
var import_classnames13 = __toESM(require_classnames());
|
|
17853
18095
|
import { useEffect as useEffect13, useState as useState19 } from "react";
|
|
17854
18096
|
import { useIntl as useIntl19 } from "react-intl";
|
|
17855
18097
|
|
|
17856
18098
|
// src/legacy/jsonSchemaForm/persistAsyncSchema/persistAsyncBlobSchema/UploadInputAdapter.tsx
|
|
17857
18099
|
import { Status as Status2, UploadInput as UploadInput4 } from "@transferwise/components";
|
|
17858
18100
|
import { useMemo as useMemo17 } from "react";
|
|
17859
|
-
import { jsx as
|
|
18101
|
+
import { jsx as jsx93 } from "react/jsx-runtime";
|
|
17860
18102
|
function UploadInputAdapter(props) {
|
|
17861
18103
|
const {
|
|
17862
18104
|
id,
|
|
@@ -17891,7 +18133,7 @@ function UploadInputAdapter(props) {
|
|
|
17891
18133
|
return Promise.reject();
|
|
17892
18134
|
});
|
|
17893
18135
|
};
|
|
17894
|
-
return /* @__PURE__ */
|
|
18136
|
+
return /* @__PURE__ */ jsx93(
|
|
17895
18137
|
UploadInput4,
|
|
17896
18138
|
{
|
|
17897
18139
|
id,
|
|
@@ -17911,7 +18153,7 @@ function UploadInputAdapter(props) {
|
|
|
17911
18153
|
}
|
|
17912
18154
|
|
|
17913
18155
|
// src/legacy/jsonSchemaForm/persistAsyncSchema/persistAsyncBlobSchema/PersistAsyncBlobSchema.tsx
|
|
17914
|
-
import { jsx as
|
|
18156
|
+
import { jsx as jsx94, jsxs as jsxs34 } from "react/jsx-runtime";
|
|
17915
18157
|
function PersistAsyncBlobSchema(props) {
|
|
17916
18158
|
const { model, schema, submitted, required = false, errors, onChange } = props;
|
|
17917
18159
|
const [persistAsyncValidationMessages, setPersistAsyncValidationMessages] = useState19({});
|
|
@@ -17959,8 +18201,8 @@ function PersistAsyncBlobSchema(props) {
|
|
|
17959
18201
|
};
|
|
17960
18202
|
const id = schema.$id || schema.persistAsync.schema.$id || schema.persistAsync.idProperty;
|
|
17961
18203
|
const feedbackId = `${id}-feedback`;
|
|
17962
|
-
return /* @__PURE__ */
|
|
17963
|
-
/* @__PURE__ */
|
|
18204
|
+
return /* @__PURE__ */ jsxs34("div", { className: (0, import_classnames13.default)(formGroupClasses), children: [
|
|
18205
|
+
/* @__PURE__ */ jsx94("div", { "aria-describedby": feedbackId, children: /* @__PURE__ */ jsx94(
|
|
17964
18206
|
UploadInputAdapter,
|
|
17965
18207
|
__spreadValues({
|
|
17966
18208
|
id,
|
|
@@ -17978,7 +18220,7 @@ function PersistAsyncBlobSchema(props) {
|
|
|
17978
18220
|
onCancel
|
|
17979
18221
|
}, mapSchemaToUploadOptions(schema.persistAsync.schema))
|
|
17980
18222
|
) }),
|
|
17981
|
-
/* @__PURE__ */
|
|
18223
|
+
/* @__PURE__ */ jsx94(
|
|
17982
18224
|
ControlFeedback_default,
|
|
17983
18225
|
{
|
|
17984
18226
|
id: feedbackId,
|
|
@@ -18004,17 +18246,17 @@ var getResponseJsonObject = async (response) => {
|
|
|
18004
18246
|
var PersistAsyncBlobSchema_default = PersistAsyncBlobSchema;
|
|
18005
18247
|
|
|
18006
18248
|
// src/legacy/jsonSchemaForm/persistAsyncSchema/PersistAsyncSchema.tsx
|
|
18007
|
-
import { jsx as
|
|
18249
|
+
import { jsx as jsx95 } from "react/jsx-runtime";
|
|
18008
18250
|
function PersistAsyncSchema(props) {
|
|
18009
18251
|
const { schema } = props;
|
|
18010
18252
|
const persistAsyncSchemaType = schema.persistAsync.schema.type;
|
|
18011
18253
|
if (persistAsyncSchemaType === "blob") {
|
|
18012
|
-
return /* @__PURE__ */
|
|
18254
|
+
return /* @__PURE__ */ jsx95(
|
|
18013
18255
|
PersistAsyncBlobSchema_default,
|
|
18014
18256
|
__spreadValues({}, props)
|
|
18015
18257
|
);
|
|
18016
18258
|
}
|
|
18017
|
-
return /* @__PURE__ */
|
|
18259
|
+
return /* @__PURE__ */ jsx95(PersistAsyncBasicSchema_default, __spreadValues({}, props));
|
|
18018
18260
|
}
|
|
18019
18261
|
var PersistAsyncSchema_default = PersistAsyncSchema;
|
|
18020
18262
|
|
|
@@ -18032,7 +18274,7 @@ var getSelectionFromModel = (schema, model) => {
|
|
|
18032
18274
|
|
|
18033
18275
|
// src/legacy/jsonSchemaForm/promotedOneOfSchema/promotedOneOfControl/PromotedOneOfCheckboxControl.tsx
|
|
18034
18276
|
import { Checkbox as Checkbox3 } from "@transferwise/components";
|
|
18035
|
-
import { jsx as
|
|
18277
|
+
import { jsx as jsx96 } from "react/jsx-runtime";
|
|
18036
18278
|
var PromotedOneOfCheckboxControl = (props) => {
|
|
18037
18279
|
const { id, selection, setSelection } = props;
|
|
18038
18280
|
const { promoted, other, checkedMeans } = props.promotion;
|
|
@@ -18043,13 +18285,13 @@ var PromotedOneOfCheckboxControl = (props) => {
|
|
|
18043
18285
|
const toggleSelection = () => {
|
|
18044
18286
|
setSelection(checked ? selectionWhenUnchecked : selectionWhenChecked);
|
|
18045
18287
|
};
|
|
18046
|
-
return /* @__PURE__ */
|
|
18288
|
+
return /* @__PURE__ */ jsx96("div", { className: "form-group", children: /* @__PURE__ */ jsx96(Checkbox3, { id, label: title, checked, onChange: toggleSelection }) });
|
|
18047
18289
|
};
|
|
18048
18290
|
var PromotedOneOfCheckboxControl_default = PromotedOneOfCheckboxControl;
|
|
18049
18291
|
|
|
18050
18292
|
// src/legacy/jsonSchemaForm/promotedOneOfSchema/promotedOneOfControl/PromotedOneOfRadioControl.tsx
|
|
18051
18293
|
import { RadioGroup as RadioGroup3 } from "@transferwise/components";
|
|
18052
|
-
import { jsx as
|
|
18294
|
+
import { jsx as jsx97, jsxs as jsxs35 } from "react/jsx-runtime";
|
|
18053
18295
|
function PromotedOneOfRadioControl(props) {
|
|
18054
18296
|
var _a, _b;
|
|
18055
18297
|
const { id, selection, setSelection, promotion, promotedOneOf, title } = props;
|
|
@@ -18066,9 +18308,9 @@ function PromotedOneOfRadioControl(props) {
|
|
|
18066
18308
|
secondary: promotion.other.description
|
|
18067
18309
|
}, getAvatarPropertyForRadioOption(promotion.other))
|
|
18068
18310
|
];
|
|
18069
|
-
return /* @__PURE__ */
|
|
18070
|
-
title && /* @__PURE__ */
|
|
18071
|
-
/* @__PURE__ */
|
|
18311
|
+
return /* @__PURE__ */ jsxs35("div", { className: "form-group", children: [
|
|
18312
|
+
title && /* @__PURE__ */ jsx97("label", { className: "control-label", htmlFor: id, children: title }),
|
|
18313
|
+
/* @__PURE__ */ jsx97(
|
|
18072
18314
|
RadioGroup3,
|
|
18073
18315
|
{
|
|
18074
18316
|
name: "promoted-selection",
|
|
@@ -18086,16 +18328,16 @@ PromotedOneOfRadioControl.defaultProps = {
|
|
|
18086
18328
|
var PromotedOneOfRadioControl_default = PromotedOneOfRadioControl;
|
|
18087
18329
|
|
|
18088
18330
|
// src/legacy/jsonSchemaForm/promotedOneOfSchema/promotedOneOfControl/PromotedOneOfControl.tsx
|
|
18089
|
-
import { Fragment as Fragment16, jsx as
|
|
18331
|
+
import { Fragment as Fragment16, jsx as jsx98 } from "react/jsx-runtime";
|
|
18090
18332
|
function PromotedOneOfControl(props) {
|
|
18091
18333
|
const controlType = props.promotion.control || "radio";
|
|
18092
18334
|
switch (controlType) {
|
|
18093
18335
|
case "radio":
|
|
18094
|
-
return /* @__PURE__ */
|
|
18336
|
+
return /* @__PURE__ */ jsx98(PromotedOneOfRadioControl_default, __spreadValues({}, props));
|
|
18095
18337
|
case "checkbox":
|
|
18096
|
-
return /* @__PURE__ */
|
|
18338
|
+
return /* @__PURE__ */ jsx98(PromotedOneOfCheckboxControl_default, __spreadValues({}, props));
|
|
18097
18339
|
default:
|
|
18098
|
-
return /* @__PURE__ */
|
|
18340
|
+
return /* @__PURE__ */ jsx98(Fragment16, {});
|
|
18099
18341
|
}
|
|
18100
18342
|
}
|
|
18101
18343
|
PromotedOneOfControl.defaultProps = {
|
|
@@ -18105,7 +18347,7 @@ PromotedOneOfControl.defaultProps = {
|
|
|
18105
18347
|
var PromotedOneOfControl_default = PromotedOneOfControl;
|
|
18106
18348
|
|
|
18107
18349
|
// src/legacy/jsonSchemaForm/promotedOneOfSchema/PromotedOneOfSchema.tsx
|
|
18108
|
-
import { Fragment as Fragment17, jsx as
|
|
18350
|
+
import { Fragment as Fragment17, jsx as jsx99, jsxs as jsxs36 } from "react/jsx-runtime";
|
|
18109
18351
|
var isPromoted = (schema) => schema.promoted === true;
|
|
18110
18352
|
var PromotedOneOfSchema = (props) => {
|
|
18111
18353
|
var _a;
|
|
@@ -18116,9 +18358,9 @@ var PromotedOneOfSchema = (props) => {
|
|
|
18116
18358
|
const promotedOneOf = props.schema.oneOf.find(isPromoted);
|
|
18117
18359
|
const promotedObjectSchema = getPromotedObjectSchema(promotedOneOf);
|
|
18118
18360
|
const otherOneOf = getOtherOneOf(props.schema);
|
|
18119
|
-
return /* @__PURE__ */
|
|
18120
|
-
promotedAlert && /* @__PURE__ */
|
|
18121
|
-
/* @__PURE__ */
|
|
18361
|
+
return /* @__PURE__ */ jsxs36(Fragment17, { children: [
|
|
18362
|
+
promotedAlert && /* @__PURE__ */ jsx99(DynamicAlert_default, { component: promotedAlert }),
|
|
18363
|
+
/* @__PURE__ */ jsx99(
|
|
18122
18364
|
PromotedOneOfControl_default,
|
|
18123
18365
|
{
|
|
18124
18366
|
id: props.schema.$id,
|
|
@@ -18129,8 +18371,8 @@ var PromotedOneOfSchema = (props) => {
|
|
|
18129
18371
|
setSelection
|
|
18130
18372
|
}
|
|
18131
18373
|
),
|
|
18132
|
-
selection === "promoted" && /* @__PURE__ */
|
|
18133
|
-
selection === "other" && /* @__PURE__ */
|
|
18374
|
+
selection === "promoted" && /* @__PURE__ */ jsx99(ObjectSchema_default, __spreadProps(__spreadValues({}, props), { schema: promotedObjectSchema })),
|
|
18375
|
+
selection === "other" && /* @__PURE__ */ jsx99(GenericSchema_default, __spreadProps(__spreadValues({}, props), { schema: otherOneOf }))
|
|
18134
18376
|
] });
|
|
18135
18377
|
};
|
|
18136
18378
|
function getPromotedObjectSchema(promotedSchema) {
|
|
@@ -18179,12 +18421,12 @@ var ReadOnlySchema_messages_default = defineMessages18({
|
|
|
18179
18421
|
});
|
|
18180
18422
|
|
|
18181
18423
|
// src/legacy/jsonSchemaForm/readOnlySchema/ReadOnlySchema.tsx
|
|
18182
|
-
import { Fragment as Fragment18, jsx as
|
|
18424
|
+
import { Fragment as Fragment18, jsx as jsx100, jsxs as jsxs37 } from "react/jsx-runtime";
|
|
18183
18425
|
function ReadOnlySchema({ schema, model }) {
|
|
18184
18426
|
const { title = "" } = schema;
|
|
18185
18427
|
const { formatMessage } = useIntl20();
|
|
18186
18428
|
const value = getValueForSchema({ schema, model, formatMessage });
|
|
18187
|
-
return /* @__PURE__ */
|
|
18429
|
+
return /* @__PURE__ */ jsx100(DefinitionList2, { layout: Layout.VERTICAL_ONE_COLUMN, definitions: [{ title, value, key: "" }] });
|
|
18188
18430
|
}
|
|
18189
18431
|
var ReadOnlySchema_default = ReadOnlySchema;
|
|
18190
18432
|
function getValueForSchema({
|
|
@@ -18217,7 +18459,7 @@ function getSelectedOneOf(schema, model) {
|
|
|
18217
18459
|
function getValueFromOption(option) {
|
|
18218
18460
|
const text = option.title && option.description ? `${option.title} - ${option.description}` : option.title || "";
|
|
18219
18461
|
const icon = getAvatarPropertyForRadioOption({ icon: option.icon });
|
|
18220
|
-
return (icon == null ? void 0 : icon.avatar) ? /* @__PURE__ */
|
|
18462
|
+
return (icon == null ? void 0 : icon.avatar) ? /* @__PURE__ */ jsxs37(Fragment18, { children: [
|
|
18221
18463
|
icon.avatar,
|
|
18222
18464
|
" ",
|
|
18223
18465
|
text
|
|
@@ -18226,7 +18468,7 @@ function getValueFromOption(option) {
|
|
|
18226
18468
|
|
|
18227
18469
|
// src/legacy/jsonSchemaForm/validationAsyncSchema/ValidationAsyncSchema.tsx
|
|
18228
18470
|
import { useEffect as useEffect14, useRef as useRef3, useState as useState21 } from "react";
|
|
18229
|
-
import { jsx as
|
|
18471
|
+
import { jsx as jsx101 } from "react/jsx-runtime";
|
|
18230
18472
|
function ValidationAsyncSchema(props) {
|
|
18231
18473
|
const { schema, model, required = false, submitted, errors, onChange } = props;
|
|
18232
18474
|
const [validationAsyncModel, setValidationAsyncModel] = useState21(model);
|
|
@@ -18310,12 +18552,12 @@ function ValidationAsyncSchema(props) {
|
|
|
18310
18552
|
required,
|
|
18311
18553
|
schema
|
|
18312
18554
|
};
|
|
18313
|
-
return /* @__PURE__ */
|
|
18555
|
+
return /* @__PURE__ */ jsx101(BasicTypeSchema_default, __spreadValues({}, basicTypeSchemaProps));
|
|
18314
18556
|
}
|
|
18315
18557
|
var ValidationAsyncSchema_default = ValidationAsyncSchema;
|
|
18316
18558
|
|
|
18317
18559
|
// src/legacy/jsonSchemaForm/genericSchema/GenericSchema.tsx
|
|
18318
|
-
import { Fragment as Fragment19, jsx as
|
|
18560
|
+
import { Fragment as Fragment19, jsx as jsx102 } from "react/jsx-runtime";
|
|
18319
18561
|
import { createElement } from "react";
|
|
18320
18562
|
function GenericSchemaForm(props) {
|
|
18321
18563
|
const { schema, model = null, errors = null, hideTitle = false, disabled = false } = props;
|
|
@@ -18332,29 +18574,29 @@ function GenericSchemaForm(props) {
|
|
|
18332
18574
|
}, [JSON.stringify(schema), JSON.stringify(model), JSON.stringify(errors), type, log]);
|
|
18333
18575
|
switch (type) {
|
|
18334
18576
|
case "readOnly":
|
|
18335
|
-
return /* @__PURE__ */
|
|
18577
|
+
return /* @__PURE__ */ jsx102(ReadOnlySchema_default, __spreadValues({}, schemaProps));
|
|
18336
18578
|
case "persistAsync":
|
|
18337
|
-
return /* @__PURE__ */
|
|
18579
|
+
return /* @__PURE__ */ jsx102(PersistAsyncSchema_default, __spreadValues({}, schemaProps));
|
|
18338
18580
|
case "validationAsync":
|
|
18339
|
-
return /* @__PURE__ */
|
|
18581
|
+
return /* @__PURE__ */ jsx102(ValidationAsyncSchema_default, __spreadValues({}, schemaProps));
|
|
18340
18582
|
case "basic": {
|
|
18341
18583
|
const basicTypeProps = __spreadValues({
|
|
18342
18584
|
infoMessage: null
|
|
18343
18585
|
}, schemaProps);
|
|
18344
|
-
return /* @__PURE__ */
|
|
18586
|
+
return /* @__PURE__ */ jsx102(BasicTypeSchema_default, __spreadValues({}, basicTypeProps));
|
|
18345
18587
|
}
|
|
18346
18588
|
case "object":
|
|
18347
18589
|
return /* @__PURE__ */ createElement(ObjectSchema_default, __spreadProps(__spreadValues({}, schemaProps), { key: JSON.stringify(schema) }));
|
|
18348
18590
|
case "array":
|
|
18349
|
-
return /* @__PURE__ */
|
|
18591
|
+
return /* @__PURE__ */ jsx102(ArraySchema_default, __spreadValues({}, schemaProps));
|
|
18350
18592
|
case "promotedOneOf":
|
|
18351
|
-
return /* @__PURE__ */
|
|
18593
|
+
return /* @__PURE__ */ jsx102(PromotedOneOfSchema_default, __spreadValues({}, schemaProps));
|
|
18352
18594
|
case "oneOf":
|
|
18353
|
-
return /* @__PURE__ */
|
|
18595
|
+
return /* @__PURE__ */ jsx102(OneOfSchema_default, __spreadValues({}, schemaProps));
|
|
18354
18596
|
case "allOf":
|
|
18355
|
-
return /* @__PURE__ */
|
|
18597
|
+
return /* @__PURE__ */ jsx102(AllOfSchema_default, __spreadValues({}, schemaProps));
|
|
18356
18598
|
}
|
|
18357
|
-
return /* @__PURE__ */
|
|
18599
|
+
return /* @__PURE__ */ jsx102(Fragment19, {});
|
|
18358
18600
|
}
|
|
18359
18601
|
var GenericSchema_default = GenericSchemaForm;
|
|
18360
18602
|
var isValidGenericSchema = (schema, model, errors) => {
|
|
@@ -18381,7 +18623,7 @@ var isValidGenericSchema = (schema, model, errors) => {
|
|
|
18381
18623
|
};
|
|
18382
18624
|
|
|
18383
18625
|
// src/legacy/layout/form/DynamicForm.tsx
|
|
18384
|
-
import { jsx as
|
|
18626
|
+
import { jsx as jsx103 } from "react/jsx-runtime";
|
|
18385
18627
|
function DynamicForm({
|
|
18386
18628
|
component,
|
|
18387
18629
|
model = null,
|
|
@@ -18391,7 +18633,7 @@ function DynamicForm({
|
|
|
18391
18633
|
onPersistAsync
|
|
18392
18634
|
}) {
|
|
18393
18635
|
const formSchema = component.schema;
|
|
18394
|
-
return /* @__PURE__ */
|
|
18636
|
+
return /* @__PURE__ */ jsx103("div", { className: getMargin2(component.margin || "md"), children: /* @__PURE__ */ jsx103(
|
|
18395
18637
|
GenericSchema_default,
|
|
18396
18638
|
{
|
|
18397
18639
|
schema: formSchema,
|
|
@@ -18408,68 +18650,82 @@ function DynamicForm({
|
|
|
18408
18650
|
var DynamicForm_default = DynamicForm;
|
|
18409
18651
|
|
|
18410
18652
|
// src/legacy/layout/heading/DynamicHeading.tsx
|
|
18411
|
-
var
|
|
18653
|
+
var import_classnames14 = __toESM(require_classnames());
|
|
18412
18654
|
import { Display as Display2 } from "@transferwise/components";
|
|
18413
|
-
import { jsx as
|
|
18655
|
+
import { jsx as jsx104 } from "react/jsx-runtime";
|
|
18414
18656
|
var DynamicHeading = (props) => {
|
|
18415
18657
|
const { text, size: size2 = "md", align = "left", margin = "md", control } = props.component;
|
|
18416
|
-
const classes = (0,
|
|
18417
|
-
return control === "display" ? /* @__PURE__ */
|
|
18658
|
+
const classes = (0, import_classnames14.default)(getTextAlignmentAndMargin2({ align, margin }));
|
|
18659
|
+
return control === "display" ? /* @__PURE__ */ jsx104(DisplayHeading2, { size: size2, text, classes }) : /* @__PURE__ */ jsx104(StandardHeading2, { size: size2, text, classes });
|
|
18418
18660
|
};
|
|
18419
18661
|
var StandardHeading2 = ({ size: size2, text, classes }) => {
|
|
18420
18662
|
switch (size2) {
|
|
18421
18663
|
case "xs":
|
|
18422
|
-
return /* @__PURE__ */
|
|
18664
|
+
return /* @__PURE__ */ jsx104("h5", { className: classes, children: text });
|
|
18423
18665
|
case "sm":
|
|
18424
|
-
return /* @__PURE__ */
|
|
18666
|
+
return /* @__PURE__ */ jsx104("h4", { className: classes, children: text });
|
|
18425
18667
|
case "lg":
|
|
18426
|
-
return /* @__PURE__ */
|
|
18668
|
+
return /* @__PURE__ */ jsx104("h2", { className: classes, children: text });
|
|
18427
18669
|
case "xl":
|
|
18428
|
-
return /* @__PURE__ */
|
|
18670
|
+
return /* @__PURE__ */ jsx104("h1", { className: classes, children: text });
|
|
18429
18671
|
case "md":
|
|
18430
18672
|
default:
|
|
18431
|
-
return /* @__PURE__ */
|
|
18673
|
+
return /* @__PURE__ */ jsx104("h3", { className: classes, children: text });
|
|
18432
18674
|
}
|
|
18433
18675
|
};
|
|
18434
18676
|
var DisplayHeading2 = ({ size: size2, text, classes }) => {
|
|
18435
18677
|
switch (size2) {
|
|
18436
18678
|
case "xs":
|
|
18437
18679
|
case "sm":
|
|
18438
|
-
return /* @__PURE__ */
|
|
18680
|
+
return /* @__PURE__ */ jsx104(Display2, { type: "display-small", className: classes, children: text });
|
|
18439
18681
|
case "xl":
|
|
18440
18682
|
case "lg":
|
|
18441
|
-
return /* @__PURE__ */
|
|
18683
|
+
return /* @__PURE__ */ jsx104(Display2, { type: "display-large", className: classes, children: text });
|
|
18442
18684
|
case "md":
|
|
18443
18685
|
default:
|
|
18444
|
-
return /* @__PURE__ */
|
|
18686
|
+
return /* @__PURE__ */ jsx104(Display2, { type: "display-medium", className: classes, children: text });
|
|
18445
18687
|
}
|
|
18446
18688
|
};
|
|
18447
18689
|
var DynamicHeading_default = DynamicHeading;
|
|
18448
18690
|
|
|
18449
18691
|
// src/legacy/layout/markdown/DynamicMarkdown.tsx
|
|
18450
18692
|
import { Markdown as Markdown7 } from "@transferwise/components";
|
|
18451
|
-
import { jsx as
|
|
18693
|
+
import { jsx as jsx105 } from "react/jsx-runtime";
|
|
18452
18694
|
var DynamicMarkdown = ({ component }) => {
|
|
18453
18695
|
const { content, align, margin } = component;
|
|
18454
|
-
return /* @__PURE__ */
|
|
18696
|
+
return /* @__PURE__ */ jsx105("div", { className: getTextAlignmentAndMargin2({ align, margin }), children: /* @__PURE__ */ jsx105(Markdown7, { config: { link: { target: "_blank" } }, children: content }) });
|
|
18455
18697
|
};
|
|
18456
18698
|
var DynamicInfo = ({ component }) => {
|
|
18457
|
-
return /* @__PURE__ */
|
|
18699
|
+
return /* @__PURE__ */ jsx105("div", { className: getTextAlignmentAndMargin2(component), children: /* @__PURE__ */ jsx105(Markdown7, { config: { link: { target: "_blank" } }, children: component.markdown }) });
|
|
18458
18700
|
};
|
|
18459
18701
|
|
|
18460
18702
|
// src/legacy/layout/image/DynamicImage.tsx
|
|
18461
18703
|
import { Image as Image2 } from "@transferwise/components";
|
|
18462
18704
|
import { useEffect as useEffect16, useState as useState22 } from "react";
|
|
18463
|
-
import { jsx as
|
|
18705
|
+
import { jsx as jsx106 } from "react/jsx-runtime";
|
|
18464
18706
|
function DynamicImage({ component: image }) {
|
|
18465
|
-
|
|
18707
|
+
var _a, _b, _c;
|
|
18708
|
+
const { content, url, size: size2, text, margin, accessibilityDescription } = image;
|
|
18466
18709
|
const httpClient = useHttpClient();
|
|
18467
18710
|
const [imageSource, setImageSource] = useState22("");
|
|
18468
18711
|
useEffect16(() => {
|
|
18469
|
-
|
|
18470
|
-
|
|
18712
|
+
if (content) {
|
|
18713
|
+
const { uri, url: contentUrl } = content;
|
|
18714
|
+
if (uri && !uri.startsWith("urn:")) {
|
|
18715
|
+
void getImageSource2(httpClient, uri).then(setImageSource);
|
|
18716
|
+
return;
|
|
18717
|
+
}
|
|
18718
|
+
if (contentUrl) {
|
|
18719
|
+
void getImageSource2(httpClient, contentUrl).then(setImageSource);
|
|
18720
|
+
return;
|
|
18721
|
+
}
|
|
18722
|
+
}
|
|
18723
|
+
if (url) {
|
|
18724
|
+
void getImageSource2(httpClient, url).then(setImageSource);
|
|
18725
|
+
}
|
|
18726
|
+
}, [content, url, httpClient]);
|
|
18471
18727
|
const imageProps = {
|
|
18472
|
-
alt: accessibilityDescription
|
|
18728
|
+
alt: (_c = (_b = (_a = content == null ? void 0 : content.accessibilityDescription) != null ? _a : accessibilityDescription) != null ? _b : text) != null ? _c : "",
|
|
18473
18729
|
src: imageSource,
|
|
18474
18730
|
stretch: true,
|
|
18475
18731
|
shrink: true
|
|
@@ -18477,7 +18733,7 @@ function DynamicImage({ component: image }) {
|
|
|
18477
18733
|
if (!imageSource) {
|
|
18478
18734
|
return null;
|
|
18479
18735
|
}
|
|
18480
|
-
return /* @__PURE__ */
|
|
18736
|
+
return /* @__PURE__ */ jsx106("div", { className: `df-image ${size2 || "md"}`, children: /* @__PURE__ */ jsx106(Image2, __spreadValues({ className: `img-responsive ${getMargin2(margin || "md")}` }, imageProps)) });
|
|
18481
18737
|
}
|
|
18482
18738
|
var readImageBlobAsDataURL2 = (imageBlob) => (
|
|
18483
18739
|
// we can safely assume the type of reader.result is string
|
|
@@ -18513,48 +18769,48 @@ var getImageSource2 = async (httpClient, imageUrl) => {
|
|
|
18513
18769
|
var DynamicImage_default = DynamicImage;
|
|
18514
18770
|
|
|
18515
18771
|
// src/legacy/layout/instructions/DynamicInstructions.tsx
|
|
18516
|
-
import { Header as
|
|
18517
|
-
import { jsx as
|
|
18772
|
+
import { Header as Header13, InstructionsList as InstructionsList2 } from "@transferwise/components";
|
|
18773
|
+
import { jsx as jsx107, jsxs as jsxs38 } from "react/jsx-runtime";
|
|
18518
18774
|
var doContext2 = ["positive", "neutral"];
|
|
18519
18775
|
var dontContext2 = ["warning", "negative"];
|
|
18520
18776
|
var DynamicInstructions = ({ component }) => {
|
|
18521
18777
|
const { items } = component;
|
|
18522
18778
|
const dos = items.filter((item) => doContext2.includes(item.context)).map(({ text }) => text);
|
|
18523
18779
|
const donts = items.filter((item) => dontContext2.includes(item.context)).map(({ text }) => text);
|
|
18524
|
-
return /* @__PURE__ */
|
|
18525
|
-
component.title ? /* @__PURE__ */
|
|
18526
|
-
/* @__PURE__ */
|
|
18780
|
+
return /* @__PURE__ */ jsxs38("div", { className: getMargin2(component.margin || "md"), children: [
|
|
18781
|
+
component.title ? /* @__PURE__ */ jsx107(Header13, { title: component.title }) : null,
|
|
18782
|
+
/* @__PURE__ */ jsx107(InstructionsList2, { dos, donts })
|
|
18527
18783
|
] });
|
|
18528
18784
|
};
|
|
18529
18785
|
var DynamicInstructions_default = DynamicInstructions;
|
|
18530
18786
|
|
|
18531
18787
|
// src/legacy/layout/DynamicLayout.tsx
|
|
18532
|
-
import { Fragment as Fragment20, jsx as
|
|
18788
|
+
import { Fragment as Fragment20, jsx as jsx108 } from "react/jsx-runtime";
|
|
18533
18789
|
var getKey = (component) => JSON.stringify(component);
|
|
18534
18790
|
function DynamicLayout(props) {
|
|
18535
18791
|
const { components, model, submitted, errors, onModelChange, onAction, onPersistAsync, baseUrl } = props;
|
|
18536
18792
|
const renderComponent = (component) => {
|
|
18537
18793
|
switch (component.type) {
|
|
18538
18794
|
case "heading":
|
|
18539
|
-
return /* @__PURE__ */
|
|
18795
|
+
return /* @__PURE__ */ jsx108(DynamicHeading_default, { component }, getKey(component));
|
|
18540
18796
|
case "paragraph":
|
|
18541
|
-
return /* @__PURE__ */
|
|
18797
|
+
return /* @__PURE__ */ jsx108(DynamicParagraph_default, { component }, getKey(component));
|
|
18542
18798
|
case "image":
|
|
18543
|
-
return /* @__PURE__ */
|
|
18799
|
+
return /* @__PURE__ */ jsx108(DynamicImage_default, { component }, getKey(component));
|
|
18544
18800
|
case "alert":
|
|
18545
|
-
return /* @__PURE__ */
|
|
18801
|
+
return /* @__PURE__ */ jsx108(DynamicAlert_default, { component, onAction }, getKey(component));
|
|
18546
18802
|
case "review":
|
|
18547
|
-
return /* @__PURE__ */
|
|
18803
|
+
return /* @__PURE__ */ jsx108(DynamicReview_default, { component, onAction }, getKey(component));
|
|
18548
18804
|
case "divider":
|
|
18549
|
-
return /* @__PURE__ */
|
|
18805
|
+
return /* @__PURE__ */ jsx108(DynamicDivider_default, { component }, getKey(component));
|
|
18550
18806
|
case "info":
|
|
18551
|
-
return /* @__PURE__ */
|
|
18807
|
+
return /* @__PURE__ */ jsx108(DynamicInfo, { component }, getKey(component));
|
|
18552
18808
|
case "instructions":
|
|
18553
|
-
return /* @__PURE__ */
|
|
18809
|
+
return /* @__PURE__ */ jsx108(DynamicInstructions_default, { component }, getKey(component));
|
|
18554
18810
|
case "markdown":
|
|
18555
|
-
return /* @__PURE__ */
|
|
18811
|
+
return /* @__PURE__ */ jsx108(DynamicMarkdown, { component }, getKey(component));
|
|
18556
18812
|
case "columns":
|
|
18557
|
-
return /* @__PURE__ */
|
|
18813
|
+
return /* @__PURE__ */ jsx108(
|
|
18558
18814
|
DynamicColumns_default,
|
|
18559
18815
|
{
|
|
18560
18816
|
component,
|
|
@@ -18568,7 +18824,7 @@ function DynamicLayout(props) {
|
|
|
18568
18824
|
getKey(component)
|
|
18569
18825
|
);
|
|
18570
18826
|
case "form":
|
|
18571
|
-
return /* @__PURE__ */
|
|
18827
|
+
return /* @__PURE__ */ jsx108(
|
|
18572
18828
|
DynamicForm_default,
|
|
18573
18829
|
{
|
|
18574
18830
|
component,
|
|
@@ -18581,9 +18837,9 @@ function DynamicLayout(props) {
|
|
|
18581
18837
|
getKey(__spreadProps(__spreadValues({}, component), { errors: errors != null ? errors : null }))
|
|
18582
18838
|
);
|
|
18583
18839
|
case "button":
|
|
18584
|
-
return /* @__PURE__ */
|
|
18840
|
+
return /* @__PURE__ */ jsx108(DynamicButton_default, { component, onAction }, getKey(component));
|
|
18585
18841
|
case "box":
|
|
18586
|
-
return /* @__PURE__ */
|
|
18842
|
+
return /* @__PURE__ */ jsx108(
|
|
18587
18843
|
DynamicBox_default,
|
|
18588
18844
|
{
|
|
18589
18845
|
component,
|
|
@@ -18597,18 +18853,18 @@ function DynamicLayout(props) {
|
|
|
18597
18853
|
getKey(component)
|
|
18598
18854
|
);
|
|
18599
18855
|
case "decision":
|
|
18600
|
-
return /* @__PURE__ */
|
|
18856
|
+
return /* @__PURE__ */ jsx108(DynamicDecision_default, { component, onAction }, getKey(component));
|
|
18601
18857
|
case "external":
|
|
18602
|
-
return /* @__PURE__ */
|
|
18858
|
+
return /* @__PURE__ */ jsx108(DynamicExternal_default, { component, onAction }, getKey(component));
|
|
18603
18859
|
case "list":
|
|
18604
18860
|
case "status-list":
|
|
18605
|
-
return /* @__PURE__ */
|
|
18861
|
+
return /* @__PURE__ */ jsx108(DynamicStatusList_default, { component, onAction }, getKey(component));
|
|
18606
18862
|
case "loading-indicator":
|
|
18607
|
-
return /* @__PURE__ */
|
|
18863
|
+
return /* @__PURE__ */ jsx108(DynamicLoadingIndicator_default, { component }, getKey(component));
|
|
18608
18864
|
case "search":
|
|
18609
|
-
return /* @__PURE__ */
|
|
18865
|
+
return /* @__PURE__ */ jsx108(DynamicSearch_default, { component, onAction }, getKey(component));
|
|
18610
18866
|
case "modal":
|
|
18611
|
-
return /* @__PURE__ */
|
|
18867
|
+
return /* @__PURE__ */ jsx108(
|
|
18612
18868
|
DynamicModal_default,
|
|
18613
18869
|
{
|
|
18614
18870
|
component,
|
|
@@ -18622,22 +18878,22 @@ function DynamicLayout(props) {
|
|
|
18622
18878
|
getKey(component)
|
|
18623
18879
|
);
|
|
18624
18880
|
default:
|
|
18625
|
-
return /* @__PURE__ */
|
|
18881
|
+
return /* @__PURE__ */ jsx108("div", {}, getKey(component));
|
|
18626
18882
|
}
|
|
18627
18883
|
};
|
|
18628
18884
|
if (useHasHttpClientProvider() || baseUrl == null) {
|
|
18629
|
-
return /* @__PURE__ */
|
|
18885
|
+
return /* @__PURE__ */ jsx108(Fragment20, { children: components.map(renderComponent) });
|
|
18630
18886
|
}
|
|
18631
|
-
return /* @__PURE__ */
|
|
18887
|
+
return /* @__PURE__ */ jsx108(HttpClientProviderFromBaseUrl, { baseUrl, children: components.map(renderComponent) });
|
|
18632
18888
|
}
|
|
18633
18889
|
var DynamicLayout_default = DynamicLayout;
|
|
18634
18890
|
|
|
18635
18891
|
// src/legacy/layout/list/DynamicStatusList.tsx
|
|
18636
|
-
import { Header as
|
|
18637
|
-
import { jsx as
|
|
18892
|
+
import { Header as Header14, Summary as Summary2 } from "@transferwise/components";
|
|
18893
|
+
import { jsx as jsx109, jsxs as jsxs39 } from "react/jsx-runtime";
|
|
18638
18894
|
var DynamicStatusList = ({ component, onAction }) => {
|
|
18639
|
-
return /* @__PURE__ */
|
|
18640
|
-
component.title ? /* @__PURE__ */
|
|
18895
|
+
return /* @__PURE__ */ jsxs39("div", { className: getMargin2(component.margin || "md"), children: [
|
|
18896
|
+
component.title ? /* @__PURE__ */ jsx109(Header14, { title: component.title, className: "m-b-2" }) : null,
|
|
18641
18897
|
component.items.map((item) => mapListItemToSummary(item, onAction))
|
|
18642
18898
|
] });
|
|
18643
18899
|
};
|
|
@@ -18647,8 +18903,8 @@ var mapListItemToSummary = (props, onAction) => {
|
|
|
18647
18903
|
title,
|
|
18648
18904
|
description,
|
|
18649
18905
|
action: "callToAction" in props ? callToActionToSummaryAction(props == null ? void 0 : props.callToAction, onAction) : void 0
|
|
18650
|
-
}, (icon == null ? void 0 : icon.name) ? { icon: /* @__PURE__ */
|
|
18651
|
-
return /* @__PURE__ */
|
|
18906
|
+
}, (icon == null ? void 0 : icon.name) ? { icon: /* @__PURE__ */ jsx109(DynamicIcon_default2, { type: icon.name }) } : {}), status ? { status: statusMap[status] } : {});
|
|
18907
|
+
return /* @__PURE__ */ jsx109(Summary2, __spreadValues({}, summaryProps), `${title}/${description || ""}`);
|
|
18652
18908
|
};
|
|
18653
18909
|
var callToActionToSummaryAction = (callToAction, onAction) => {
|
|
18654
18910
|
if (!callToAction) {
|
|
@@ -18718,10 +18974,10 @@ var DynamicStatusList_default = DynamicStatusList;
|
|
|
18718
18974
|
|
|
18719
18975
|
// src/legacy/layout/loadingIndicator/DynamicLoadingIndicator.tsx
|
|
18720
18976
|
import { Loader as Loader3 } from "@transferwise/components";
|
|
18721
|
-
import { jsx as
|
|
18977
|
+
import { jsx as jsx110 } from "react/jsx-runtime";
|
|
18722
18978
|
var DynamicLoadingIndicator = ({ component }) => {
|
|
18723
18979
|
const { margin = "md", size: size2 = "md" } = component;
|
|
18724
|
-
return /* @__PURE__ */
|
|
18980
|
+
return /* @__PURE__ */ jsx110(
|
|
18725
18981
|
Loader3,
|
|
18726
18982
|
{
|
|
18727
18983
|
size: size2,
|
|
@@ -18764,12 +19020,12 @@ function noop3() {
|
|
|
18764
19020
|
}
|
|
18765
19021
|
|
|
18766
19022
|
// src/legacy/layout/paragraph/DynamicParagraph.tsx
|
|
18767
|
-
import { jsx as
|
|
19023
|
+
import { jsx as jsx111, jsxs as jsxs40 } from "react/jsx-runtime";
|
|
18768
19024
|
function DynamicParagraph({ component }) {
|
|
18769
|
-
return component.control === "copyable" ? /* @__PURE__ */
|
|
19025
|
+
return component.control === "copyable" ? /* @__PURE__ */ jsx111(CopyableDynamicParagraph, { component }) : /* @__PURE__ */ jsx111(BasicDynamicParagraph, { component });
|
|
18770
19026
|
}
|
|
18771
19027
|
function BasicDynamicParagraph({ component }) {
|
|
18772
|
-
return /* @__PURE__ */
|
|
19028
|
+
return /* @__PURE__ */ jsx111("p", { className: `np-text-body-large ${getTextAlignmentAndMargin2(component)}`, children: component.text });
|
|
18773
19029
|
}
|
|
18774
19030
|
function CopyableDynamicParagraph({ component }) {
|
|
18775
19031
|
const { formatMessage } = useIntl21();
|
|
@@ -18779,22 +19035,22 @@ function CopyableDynamicParagraph({ component }) {
|
|
|
18779
19035
|
var _a;
|
|
18780
19036
|
(_a = navigator.clipboard) == null ? void 0 : _a.writeText(text).then(() => createSnackbar({ text: formatMessage(paragraph_messages_default2.copied) })).catch(noop4);
|
|
18781
19037
|
};
|
|
18782
|
-
const
|
|
19038
|
+
const classNames17 = `${getTextAlignmentAndMargin2({
|
|
18783
19039
|
align: component.align,
|
|
18784
19040
|
margin: "sm"
|
|
18785
19041
|
})} form-control`;
|
|
18786
|
-
return /* @__PURE__ */
|
|
18787
|
-
/* @__PURE__ */
|
|
19042
|
+
return /* @__PURE__ */ jsxs40("div", { className: getTextAlignmentAndMargin2(component), children: [
|
|
19043
|
+
/* @__PURE__ */ jsx111(
|
|
18788
19044
|
"input",
|
|
18789
19045
|
{
|
|
18790
19046
|
type: "text",
|
|
18791
|
-
className:
|
|
19047
|
+
className: classNames17,
|
|
18792
19048
|
value: text,
|
|
18793
19049
|
readOnly: true,
|
|
18794
19050
|
style: { textOverflow: "ellipsis" }
|
|
18795
19051
|
}
|
|
18796
19052
|
),
|
|
18797
|
-
/* @__PURE__ */
|
|
19053
|
+
/* @__PURE__ */ jsx111(Button9, { block: true, onClick: copy, children: formatMessage(paragraph_messages_default2.copy) })
|
|
18798
19054
|
] });
|
|
18799
19055
|
}
|
|
18800
19056
|
function noop4() {
|
|
@@ -18802,8 +19058,8 @@ function noop4() {
|
|
|
18802
19058
|
var DynamicParagraph_default = DynamicParagraph;
|
|
18803
19059
|
|
|
18804
19060
|
// src/legacy/layout/review/DynamicReview.tsx
|
|
18805
|
-
import { DefinitionList as DefinitionList3, Header as
|
|
18806
|
-
import { Fragment as Fragment21, jsx as
|
|
19061
|
+
import { DefinitionList as DefinitionList3, Header as Header15 } from "@transferwise/components";
|
|
19062
|
+
import { Fragment as Fragment21, jsx as jsx112, jsxs as jsxs41 } from "react/jsx-runtime";
|
|
18807
19063
|
var getDefinitions = (orientation, review) => review.fields.map(({ label, value, help }, index) => ({
|
|
18808
19064
|
key: String(index),
|
|
18809
19065
|
title: label,
|
|
@@ -18811,14 +19067,14 @@ var getDefinitions = (orientation, review) => review.fields.map(({ label, value,
|
|
|
18811
19067
|
}));
|
|
18812
19068
|
var getFieldValue2 = (value, help, orientation) => {
|
|
18813
19069
|
if (help) {
|
|
18814
|
-
return orientation === "HORIZONTAL_RIGHT_ALIGNED" ? /* @__PURE__ */
|
|
18815
|
-
/* @__PURE__ */
|
|
19070
|
+
return orientation === "HORIZONTAL_RIGHT_ALIGNED" ? /* @__PURE__ */ jsxs41(Fragment21, { children: [
|
|
19071
|
+
/* @__PURE__ */ jsx112(Help_default2, { help }),
|
|
18816
19072
|
" ",
|
|
18817
19073
|
value
|
|
18818
|
-
] }) : /* @__PURE__ */
|
|
19074
|
+
] }) : /* @__PURE__ */ jsxs41(Fragment21, { children: [
|
|
18819
19075
|
value,
|
|
18820
19076
|
" ",
|
|
18821
|
-
/* @__PURE__ */
|
|
19077
|
+
/* @__PURE__ */ jsx112(Help_default2, { help })
|
|
18822
19078
|
] });
|
|
18823
19079
|
}
|
|
18824
19080
|
return value;
|
|
@@ -18851,7 +19107,7 @@ function DynamicReview({ component: review, onAction }) {
|
|
|
18851
19107
|
const { action: behaviorAction2 } = behavior;
|
|
18852
19108
|
return {
|
|
18853
19109
|
text: title != null ? title : "",
|
|
18854
|
-
onClick: behaviorAction2 ?
|
|
19110
|
+
onClick: behaviorAction2 ? getOnClick2(behaviorAction2) : void 0
|
|
18855
19111
|
};
|
|
18856
19112
|
}
|
|
18857
19113
|
case "link": {
|
|
@@ -18866,7 +19122,7 @@ function DynamicReview({ component: review, onAction }) {
|
|
|
18866
19122
|
if (behaviorAction) {
|
|
18867
19123
|
return {
|
|
18868
19124
|
text: title != null ? title : "",
|
|
18869
|
-
onClick: behaviorAction ?
|
|
19125
|
+
onClick: behaviorAction ? getOnClick2(behaviorAction) : void 0
|
|
18870
19126
|
};
|
|
18871
19127
|
}
|
|
18872
19128
|
if (link) {
|
|
@@ -18878,10 +19134,10 @@ function DynamicReview({ component: review, onAction }) {
|
|
|
18878
19134
|
}
|
|
18879
19135
|
return {
|
|
18880
19136
|
text: title != null ? title : "",
|
|
18881
|
-
onClick: action ?
|
|
19137
|
+
onClick: action ? getOnClick2(action) : void 0
|
|
18882
19138
|
};
|
|
18883
19139
|
};
|
|
18884
|
-
const
|
|
19140
|
+
const getOnClick2 = (action) => {
|
|
18885
19141
|
return (event) => {
|
|
18886
19142
|
event.preventDefault();
|
|
18887
19143
|
if (action) {
|
|
@@ -18891,10 +19147,10 @@ function DynamicReview({ component: review, onAction }) {
|
|
|
18891
19147
|
};
|
|
18892
19148
|
const orientation = getDefinitionListLayout(review);
|
|
18893
19149
|
const callToAction = review.callToAction ? getReviewAction3(review.callToAction) : null;
|
|
18894
|
-
const legacyCallToAction = !callToAction && review.action ? { text: (_a = review.action.title) != null ? _a : "", onClick:
|
|
18895
|
-
return /* @__PURE__ */
|
|
18896
|
-
review.title && /* @__PURE__ */
|
|
18897
|
-
/* @__PURE__ */
|
|
19150
|
+
const legacyCallToAction = !callToAction && review.action ? { text: (_a = review.action.title) != null ? _a : "", onClick: getOnClick2(review.action) } : null;
|
|
19151
|
+
return /* @__PURE__ */ jsxs41("div", { className: margin, children: [
|
|
19152
|
+
review.title && /* @__PURE__ */ jsx112(Header15, { title: review.title, action: (_b = callToAction != null ? callToAction : legacyCallToAction) != null ? _b : void 0 }),
|
|
19153
|
+
/* @__PURE__ */ jsx112("div", { className: margin, children: /* @__PURE__ */ jsx112(DefinitionList3, { layout: orientation, definitions: getDefinitions(orientation, review) }) })
|
|
18898
19154
|
] });
|
|
18899
19155
|
}
|
|
18900
19156
|
var DynamicReview_default = DynamicReview;
|
|
@@ -18905,11 +19161,11 @@ import { Search as Search2 } from "@transferwise/icons";
|
|
|
18905
19161
|
|
|
18906
19162
|
// src/legacy/layout/search/SearchInput.tsx
|
|
18907
19163
|
import { Input as Input6 } from "@transferwise/components";
|
|
18908
|
-
import { jsx as
|
|
19164
|
+
import { jsx as jsx113, jsxs as jsxs42 } from "react/jsx-runtime";
|
|
18909
19165
|
var SearchInput = ({ title, value, onFocus, onChange }) => {
|
|
18910
|
-
return /* @__PURE__ */
|
|
19166
|
+
return /* @__PURE__ */ jsxs42("label", { className: "control-label d-inline", children: [
|
|
18911
19167
|
title,
|
|
18912
|
-
/* @__PURE__ */
|
|
19168
|
+
/* @__PURE__ */ jsx113(
|
|
18913
19169
|
Input6,
|
|
18914
19170
|
{
|
|
18915
19171
|
type: "text",
|
|
@@ -18925,12 +19181,12 @@ var SearchInput = ({ title, value, onFocus, onChange }) => {
|
|
|
18925
19181
|
// src/legacy/layout/search/SearchResults.tsx
|
|
18926
19182
|
import { NavigationOption as NavigationOption7, NavigationOptionsList as NavigationOptionsList4 } from "@transferwise/components";
|
|
18927
19183
|
import { useIntl as useIntl22 } from "react-intl";
|
|
18928
|
-
import { jsx as
|
|
19184
|
+
import { jsx as jsx114, jsxs as jsxs43 } from "react/jsx-runtime";
|
|
18929
19185
|
function SearchResults2({ results, emptyMessage, onSelect }) {
|
|
18930
19186
|
if (results.length === 0) {
|
|
18931
|
-
return /* @__PURE__ */
|
|
19187
|
+
return /* @__PURE__ */ jsx114("p", { className: "m-t-2", children: emptyMessage });
|
|
18932
19188
|
}
|
|
18933
|
-
return /* @__PURE__ */
|
|
19189
|
+
return /* @__PURE__ */ jsx114(NavigationOptionsList4, { children: results.map((result) => /* @__PURE__ */ jsx114(
|
|
18934
19190
|
NavigationOption7,
|
|
18935
19191
|
{
|
|
18936
19192
|
title: result.title,
|
|
@@ -18945,10 +19201,10 @@ function SearchResults2({ results, emptyMessage, onSelect }) {
|
|
|
18945
19201
|
}
|
|
18946
19202
|
function ErrorResult2({ onRetrySearch }) {
|
|
18947
19203
|
const intl = useIntl22();
|
|
18948
|
-
return /* @__PURE__ */
|
|
19204
|
+
return /* @__PURE__ */ jsxs43("p", { className: "m-t-2", children: [
|
|
18949
19205
|
intl.formatMessage(generic_error_messages_default.genericError),
|
|
18950
19206
|
"\xA0",
|
|
18951
|
-
/* @__PURE__ */
|
|
19207
|
+
/* @__PURE__ */ jsx114(
|
|
18952
19208
|
"a",
|
|
18953
19209
|
{
|
|
18954
19210
|
href: "/",
|
|
@@ -19032,7 +19288,7 @@ var addQueryParameter2 = (url, key, value) => {
|
|
|
19032
19288
|
};
|
|
19033
19289
|
|
|
19034
19290
|
// src/legacy/layout/search/DynamicSearch.tsx
|
|
19035
|
-
var
|
|
19291
|
+
var import_classnames15 = __toESM(require_classnames());
|
|
19036
19292
|
import { Markdown as Markdown8, Typeahead as Typeahead2 } from "@transferwise/components";
|
|
19037
19293
|
import { useIntl as useIntl23 } from "react-intl";
|
|
19038
19294
|
|
|
@@ -19047,7 +19303,7 @@ var search_messages_default2 = defineMessages20({
|
|
|
19047
19303
|
});
|
|
19048
19304
|
|
|
19049
19305
|
// src/legacy/layout/search/DynamicSearch.tsx
|
|
19050
|
-
import { jsx as
|
|
19306
|
+
import { jsx as jsx115, jsxs as jsxs44 } from "react/jsx-runtime";
|
|
19051
19307
|
var DEBOUNCE_TIME2 = 400;
|
|
19052
19308
|
function DynamicSearch({ component, onAction }) {
|
|
19053
19309
|
const [query, setQuery] = useState24("");
|
|
@@ -19085,9 +19341,9 @@ function DynamicSearch({ component, onAction }) {
|
|
|
19085
19341
|
};
|
|
19086
19342
|
const loadingMessage = intl.formatMessage(search_messages_default2.loading);
|
|
19087
19343
|
if (control === "inline") {
|
|
19088
|
-
return /* @__PURE__ */
|
|
19344
|
+
return /* @__PURE__ */ jsx115("div", { className: (0, import_classnames15.default)(getMargin2(margin != null ? margin : "md"), "df-search-typeahead"), children: /* @__PURE__ */ jsxs44("label", { className: "control-label d-inline", children: [
|
|
19089
19345
|
title,
|
|
19090
|
-
/* @__PURE__ */
|
|
19346
|
+
/* @__PURE__ */ jsx115("div", { className: "m-t-1", children: /* @__PURE__ */ jsx115(
|
|
19091
19347
|
Typeahead2,
|
|
19092
19348
|
{
|
|
19093
19349
|
id: "typeahead-input-id",
|
|
@@ -19095,7 +19351,7 @@ function DynamicSearch({ component, onAction }) {
|
|
|
19095
19351
|
name: "typeahead-input-name",
|
|
19096
19352
|
size: "md",
|
|
19097
19353
|
maxHeight: 100,
|
|
19098
|
-
footer: /* @__PURE__ */
|
|
19354
|
+
footer: /* @__PURE__ */ jsx115(
|
|
19099
19355
|
TypeaheadFooter2,
|
|
19100
19356
|
{
|
|
19101
19357
|
state: status,
|
|
@@ -19107,7 +19363,7 @@ function DynamicSearch({ component, onAction }) {
|
|
|
19107
19363
|
),
|
|
19108
19364
|
multiple: false,
|
|
19109
19365
|
clearable: false,
|
|
19110
|
-
addon: /* @__PURE__ */
|
|
19366
|
+
addon: /* @__PURE__ */ jsx115(Search2, { size: 24 }),
|
|
19111
19367
|
options: results.map(mapResultToTypeaheadOption2),
|
|
19112
19368
|
onChange: (values) => {
|
|
19113
19369
|
if (values.length > 0) {
|
|
@@ -19122,11 +19378,11 @@ function DynamicSearch({ component, onAction }) {
|
|
|
19122
19378
|
) })
|
|
19123
19379
|
] }) });
|
|
19124
19380
|
}
|
|
19125
|
-
return /* @__PURE__ */
|
|
19126
|
-
/* @__PURE__ */
|
|
19127
|
-
status === "loading" && /* @__PURE__ */
|
|
19128
|
-
status === "error" && /* @__PURE__ */
|
|
19129
|
-
status === "success" && /* @__PURE__ */
|
|
19381
|
+
return /* @__PURE__ */ jsxs44("div", { className: getMargin2(margin != null ? margin : "md"), children: [
|
|
19382
|
+
/* @__PURE__ */ jsx115(SearchInput, { title, value: query, onChange, onFocus: onSearchStart }),
|
|
19383
|
+
status === "loading" && /* @__PURE__ */ jsx115(DynamicLoadingIndicator_default, { component: { type: "loading-indicator", size: "sm" } }),
|
|
19384
|
+
status === "error" && /* @__PURE__ */ jsx115(ErrorResult2, { onRetrySearch }),
|
|
19385
|
+
status === "success" && /* @__PURE__ */ jsx115(SearchResults2, { results, emptyMessage, onSelect: onResultSelected })
|
|
19130
19386
|
] });
|
|
19131
19387
|
}
|
|
19132
19388
|
function mapResultToTypeaheadOption2(result) {
|
|
@@ -19146,13 +19402,13 @@ function TypeaheadFooter2({
|
|
|
19146
19402
|
onRetrySearch
|
|
19147
19403
|
}) {
|
|
19148
19404
|
if (state === "success" && results.length === 0) {
|
|
19149
|
-
return /* @__PURE__ */
|
|
19405
|
+
return /* @__PURE__ */ jsx115(Markdown8, { className: "m-t-2 m-x-2", config: { link: { target: "_blank" } }, children: emptyMessage });
|
|
19150
19406
|
}
|
|
19151
19407
|
if (state === "error" && results.length === 0) {
|
|
19152
|
-
return /* @__PURE__ */
|
|
19408
|
+
return /* @__PURE__ */ jsx115("div", { className: "m-t-2 m-x-2", children: /* @__PURE__ */ jsx115(ErrorResult2, { onRetrySearch }) });
|
|
19153
19409
|
}
|
|
19154
19410
|
if (state === "loading" || results.length === 0) {
|
|
19155
|
-
return /* @__PURE__ */
|
|
19411
|
+
return /* @__PURE__ */ jsx115("p", { className: "m-t-2 m-x-2", children: loadingMessage });
|
|
19156
19412
|
}
|
|
19157
19413
|
return null;
|
|
19158
19414
|
}
|
|
@@ -19161,21 +19417,21 @@ var DynamicSearch_default = DynamicSearch;
|
|
|
19161
19417
|
// src/legacy/layout/modal/DynamicModal.tsx
|
|
19162
19418
|
import { Button as Button10, Modal as Modal4 } from "@transferwise/components";
|
|
19163
19419
|
import { useState as useState25 } from "react";
|
|
19164
|
-
import { jsx as
|
|
19420
|
+
import { jsx as jsx116, jsxs as jsxs45 } from "react/jsx-runtime";
|
|
19165
19421
|
function DynamicModal(props) {
|
|
19166
19422
|
const [visible, isVisible] = useState25(false);
|
|
19167
19423
|
const { component, onAction } = props;
|
|
19168
19424
|
const { margin = "md" } = component;
|
|
19169
|
-
return /* @__PURE__ */
|
|
19170
|
-
/* @__PURE__ */
|
|
19171
|
-
/* @__PURE__ */
|
|
19425
|
+
return /* @__PURE__ */ jsxs45("div", { className: getTextAlignmentAndMargin2({ margin }), children: [
|
|
19426
|
+
/* @__PURE__ */ jsx116(Button10, { priority: "tertiary", block: true, onClick: () => isVisible(true), children: component.trigger.title }),
|
|
19427
|
+
/* @__PURE__ */ jsx116(
|
|
19172
19428
|
Modal4,
|
|
19173
19429
|
{
|
|
19174
19430
|
scroll: "content",
|
|
19175
19431
|
open: visible,
|
|
19176
19432
|
size: "lg",
|
|
19177
19433
|
title: component.content.title,
|
|
19178
|
-
body: /* @__PURE__ */
|
|
19434
|
+
body: /* @__PURE__ */ jsx116(
|
|
19179
19435
|
DynamicLayout_default,
|
|
19180
19436
|
__spreadProps(__spreadValues({}, props), {
|
|
19181
19437
|
components: component.content.components,
|
|
@@ -19193,7 +19449,7 @@ function DynamicModal(props) {
|
|
|
19193
19449
|
var DynamicModal_default = DynamicModal;
|
|
19194
19450
|
|
|
19195
19451
|
// src/legacy/jsonSchemaForm/basicTypeSchema/BasicTypeSchema.tsx
|
|
19196
|
-
import { Fragment as Fragment22, jsx as
|
|
19452
|
+
import { Fragment as Fragment22, jsx as jsx117, jsxs as jsxs46 } from "react/jsx-runtime";
|
|
19197
19453
|
var isNullish3 = (value) => isNull3(value) || isUndefined3(value);
|
|
19198
19454
|
var getDefaultValue = (schema) => {
|
|
19199
19455
|
return schema.type === "boolean" && isNullish3(schema.default) ? false : schema.default;
|
|
@@ -19271,15 +19527,15 @@ var BasicTypeSchema = (props) => {
|
|
|
19271
19527
|
const schemaHelp = props.schema.help;
|
|
19272
19528
|
const feedbackId = `${id}-feedback`;
|
|
19273
19529
|
const labelId = `${id}-label`;
|
|
19274
|
-
return !isHidden ? /* @__PURE__ */
|
|
19275
|
-
props.schema.alert && /* @__PURE__ */
|
|
19276
|
-
/* @__PURE__ */
|
|
19277
|
-
showLabel && /* @__PURE__ */
|
|
19278
|
-
/* @__PURE__ */
|
|
19279
|
-
!!schemaHelp && /* @__PURE__ */
|
|
19530
|
+
return !isHidden ? /* @__PURE__ */ jsxs46(Fragment22, { children: [
|
|
19531
|
+
props.schema.alert && /* @__PURE__ */ jsx117(DynamicAlert_default, { component: props.schema.alert }),
|
|
19532
|
+
/* @__PURE__ */ jsxs46("div", { className: (0, import_classnames16.default)(formGroupClasses), children: [
|
|
19533
|
+
showLabel && /* @__PURE__ */ jsxs46("div", { className: "d-inline-block m-b-1", children: [
|
|
19534
|
+
/* @__PURE__ */ jsx117("label", { className: "control-label d-inline", htmlFor: id, id: labelId, children: props.schema.title }),
|
|
19535
|
+
!!schemaHelp && /* @__PURE__ */ jsx117(Help_default2, { help: schemaHelp })
|
|
19280
19536
|
] }),
|
|
19281
|
-
!showLabel && !!schemaHelp && /* @__PURE__ */
|
|
19282
|
-
/* @__PURE__ */
|
|
19537
|
+
!showLabel && !!schemaHelp && /* @__PURE__ */ jsx117(Help_default2, { help: schemaHelp }),
|
|
19538
|
+
/* @__PURE__ */ jsx117(
|
|
19283
19539
|
SchemaFormControl_default,
|
|
19284
19540
|
{
|
|
19285
19541
|
id,
|
|
@@ -19293,7 +19549,7 @@ var BasicTypeSchema = (props) => {
|
|
|
19293
19549
|
labelledBy: labelId
|
|
19294
19550
|
}
|
|
19295
19551
|
),
|
|
19296
|
-
/* @__PURE__ */
|
|
19552
|
+
/* @__PURE__ */ jsx117(
|
|
19297
19553
|
ControlFeedback_default,
|
|
19298
19554
|
{
|
|
19299
19555
|
id: feedbackId,
|
|
@@ -19313,7 +19569,7 @@ var BasicTypeSchema = (props) => {
|
|
|
19313
19569
|
var BasicTypeSchema_default = BasicTypeSchema;
|
|
19314
19570
|
|
|
19315
19571
|
// src/legacy/jsonSchemaForm/persistAsyncSchema/persistAsyncBasicSchema/PersistAsyncBasicSchema.tsx
|
|
19316
|
-
import { jsx as
|
|
19572
|
+
import { jsx as jsx118 } from "react/jsx-runtime";
|
|
19317
19573
|
var getIdFromResponse = (idProperty, response) => response[idProperty];
|
|
19318
19574
|
var getErrorFromResponse = (errorProperty, response) => {
|
|
19319
19575
|
var _a;
|
|
@@ -19403,7 +19659,7 @@ function PersistAsyncBasicSchema(props) {
|
|
|
19403
19659
|
setPersistAsyncModel(newPersistAsyncModel);
|
|
19404
19660
|
}
|
|
19405
19661
|
};
|
|
19406
|
-
return /* @__PURE__ */
|
|
19662
|
+
return /* @__PURE__ */ jsx118(
|
|
19407
19663
|
BasicTypeSchema_default,
|
|
19408
19664
|
{
|
|
19409
19665
|
required,
|
|
@@ -19617,7 +19873,7 @@ function useStepPolling(polling, onAction) {
|
|
|
19617
19873
|
}
|
|
19618
19874
|
|
|
19619
19875
|
// src/legacy/step/layoutStep/LayoutStep.tsx
|
|
19620
|
-
import { jsx as
|
|
19876
|
+
import { jsx as jsx119 } from "react/jsx-runtime";
|
|
19621
19877
|
var getComponents = (step, options) => {
|
|
19622
19878
|
var _a;
|
|
19623
19879
|
if (isEmpty(step)) {
|
|
@@ -19640,7 +19896,7 @@ var LayoutStep = (props) => {
|
|
|
19640
19896
|
onEvent("Dynamic Flow - onAction supressed", { reason: "LayoutStep - loading state" });
|
|
19641
19897
|
};
|
|
19642
19898
|
useStepPolling(stepSpecification.polling, onAction);
|
|
19643
|
-
return /* @__PURE__ */
|
|
19899
|
+
return /* @__PURE__ */ jsx119(
|
|
19644
19900
|
DynamicLayout_default,
|
|
19645
19901
|
{
|
|
19646
19902
|
components,
|
|
@@ -19726,15 +19982,15 @@ var CameraCapture_messages_default = defineMessages21({
|
|
|
19726
19982
|
// src/common/cameraCapture/components/bottomBar/BottomBar.tsx
|
|
19727
19983
|
import { Button as Button11, ControlType, Priority, Size as Size3 } from "@transferwise/components";
|
|
19728
19984
|
import { useIntl as useIntl26 } from "react-intl";
|
|
19729
|
-
import { jsx as
|
|
19730
|
-
var CaptureBottomBar = ({ onCapture }) => /* @__PURE__ */
|
|
19985
|
+
import { jsx as jsx120, jsxs as jsxs47 } from "react/jsx-runtime";
|
|
19986
|
+
var CaptureBottomBar = ({ onCapture }) => /* @__PURE__ */ jsx120("div", { className: "bottom-bar", children: /* @__PURE__ */ jsx120(CaptureButton, { onClick: onCapture }) });
|
|
19731
19987
|
var ReviewBottomBar = ({
|
|
19732
19988
|
onSubmit,
|
|
19733
19989
|
onRetry
|
|
19734
19990
|
}) => {
|
|
19735
19991
|
const intl = useIntl26();
|
|
19736
|
-
return /* @__PURE__ */
|
|
19737
|
-
/* @__PURE__ */
|
|
19992
|
+
return /* @__PURE__ */ jsx120("div", { className: "bottom-bar p-x-2", children: /* @__PURE__ */ jsx120("div", { className: "row", children: /* @__PURE__ */ jsxs47("div", { className: "col-xs-12 col-md-6 col-md-offset-3", children: [
|
|
19993
|
+
/* @__PURE__ */ jsx120(
|
|
19738
19994
|
Button11,
|
|
19739
19995
|
{
|
|
19740
19996
|
className: "m-b-1",
|
|
@@ -19745,7 +20001,7 @@ var ReviewBottomBar = ({
|
|
|
19745
20001
|
children: intl.formatMessage(CameraCapture_messages_default.reviewSubmit)
|
|
19746
20002
|
}
|
|
19747
20003
|
),
|
|
19748
|
-
/* @__PURE__ */
|
|
20004
|
+
/* @__PURE__ */ jsx120(
|
|
19749
20005
|
Button11,
|
|
19750
20006
|
{
|
|
19751
20007
|
className: "m-b-2",
|
|
@@ -19759,14 +20015,14 @@ var ReviewBottomBar = ({
|
|
|
19759
20015
|
)
|
|
19760
20016
|
] }) }) });
|
|
19761
20017
|
};
|
|
19762
|
-
var CaptureButton = ({ onClick }) => /* @__PURE__ */
|
|
20018
|
+
var CaptureButton = ({ onClick }) => /* @__PURE__ */ jsx120(
|
|
19763
20019
|
"button",
|
|
19764
20020
|
{
|
|
19765
20021
|
type: "button",
|
|
19766
20022
|
className: "camera-capture-btn m-b-2",
|
|
19767
20023
|
"data-testid": "camera-capture-button",
|
|
19768
20024
|
onClick,
|
|
19769
|
-
children: /* @__PURE__ */
|
|
20025
|
+
children: /* @__PURE__ */ jsx120("span", { className: "camera-capture-btn-inner" })
|
|
19770
20026
|
}
|
|
19771
20027
|
);
|
|
19772
20028
|
|
|
@@ -19784,11 +20040,11 @@ var OrientationLockOverlay_messages_default = defineMessages22({
|
|
|
19784
20040
|
});
|
|
19785
20041
|
|
|
19786
20042
|
// src/common/cameraCapture/components/orientationLockOverlay/OrientationLockOverlay.tsx
|
|
19787
|
-
import { jsx as
|
|
20043
|
+
import { jsx as jsx121, jsxs as jsxs48 } from "react/jsx-runtime";
|
|
19788
20044
|
function OrientationLockOverlay() {
|
|
19789
20045
|
const intl = useIntl27();
|
|
19790
|
-
return /* @__PURE__ */
|
|
19791
|
-
/* @__PURE__ */
|
|
20046
|
+
return /* @__PURE__ */ jsxs48("div", { className: "orientation-lock-overlay", children: [
|
|
20047
|
+
/* @__PURE__ */ jsx121(
|
|
19792
20048
|
"img",
|
|
19793
20049
|
{
|
|
19794
20050
|
className: "m-b-3",
|
|
@@ -19798,7 +20054,7 @@ function OrientationLockOverlay() {
|
|
|
19798
20054
|
alt: ""
|
|
19799
20055
|
}
|
|
19800
20056
|
),
|
|
19801
|
-
/* @__PURE__ */
|
|
20057
|
+
/* @__PURE__ */ jsx121("p", { className: "text-center m-b-0", children: intl.formatMessage(OrientationLockOverlay_messages_default.text) })
|
|
19802
20058
|
] });
|
|
19803
20059
|
}
|
|
19804
20060
|
var OrientationLockOverlay_default = OrientationLockOverlay;
|
|
@@ -19973,7 +20229,7 @@ var getVideoConstraints = async (dir) => {
|
|
|
19973
20229
|
|
|
19974
20230
|
// src/common/cameraCapture/overlay/Overlay.tsx
|
|
19975
20231
|
import { useEffect as useEffect23, useRef as useRef7 } from "react";
|
|
19976
|
-
import { Fragment as Fragment23, jsx as
|
|
20232
|
+
import { Fragment as Fragment23, jsx as jsx122, jsxs as jsxs49 } from "react/jsx-runtime";
|
|
19977
20233
|
var captureButtonHeight = 92;
|
|
19978
20234
|
var reviewButtonsHeight = 120;
|
|
19979
20235
|
var imageHeight = 40;
|
|
@@ -19995,18 +20251,18 @@ function Overlay({ overlay, outline, imageUrl, title, instructions, reviewInstru
|
|
|
19995
20251
|
return () => window.removeEventListener("resize", listener);
|
|
19996
20252
|
});
|
|
19997
20253
|
let helperBoxHeight = (imageUrl ? imageHeight : 0) + (title ? titleHeight : 0) + (instructions ? instructionsHeight : 0);
|
|
19998
|
-
let helperBox = /* @__PURE__ */
|
|
19999
|
-
imageUrl && /* @__PURE__ */
|
|
20000
|
-
title && /* @__PURE__ */
|
|
20001
|
-
instructions && /* @__PURE__ */
|
|
20254
|
+
let helperBox = /* @__PURE__ */ jsxs49(Fragment23, { children: [
|
|
20255
|
+
imageUrl && /* @__PURE__ */ jsx122("img", { className: "camera-capture-img", src: imageUrl, alt: "" }),
|
|
20256
|
+
title && /* @__PURE__ */ jsx122("h4", { className: "camera-capture-title", children: title }),
|
|
20257
|
+
instructions && /* @__PURE__ */ jsx122("small", { className: "camera-capture-instructions", children: instructions })
|
|
20002
20258
|
] });
|
|
20003
20259
|
const frameBottomMargin = captureButtonHeight + helperBoxHeight;
|
|
20004
20260
|
if (reviewInstructions) {
|
|
20005
20261
|
helperBoxHeight = frameBottomMargin - reviewButtonsHeight;
|
|
20006
|
-
helperBox = /* @__PURE__ */
|
|
20262
|
+
helperBox = /* @__PURE__ */ jsx122("small", { className: "camera-capture-instructions", children: reviewInstructions });
|
|
20007
20263
|
const frameWithReviewInstructionsMinBottomMargin = reviewButtonsHeight + reviewInstructionsHeight;
|
|
20008
20264
|
if (frameBottomMargin < frameWithReviewInstructionsMinBottomMargin) {
|
|
20009
|
-
helperBox = /* @__PURE__ */
|
|
20265
|
+
helperBox = /* @__PURE__ */ jsx122(Fragment23, {});
|
|
20010
20266
|
}
|
|
20011
20267
|
}
|
|
20012
20268
|
const framePosition = {
|
|
@@ -20024,32 +20280,32 @@ function Overlay({ overlay, outline, imageUrl, title, instructions, reviewInstru
|
|
|
20024
20280
|
width: "90%"
|
|
20025
20281
|
}
|
|
20026
20282
|
};
|
|
20027
|
-
return /* @__PURE__ */
|
|
20028
|
-
/* @__PURE__ */
|
|
20029
|
-
/* @__PURE__ */
|
|
20030
|
-
/* @__PURE__ */
|
|
20283
|
+
return /* @__PURE__ */ jsxs49("svg", { ref: svgReference, xmlns: "http://www.w3.org/2000/svg", children: [
|
|
20284
|
+
/* @__PURE__ */ jsx122("defs", { children: /* @__PURE__ */ jsxs49("mask", { id: "mask", children: [
|
|
20285
|
+
/* @__PURE__ */ jsx122("rect", { width: "100%", height: "100%", fill: "#fff" }),
|
|
20286
|
+
/* @__PURE__ */ jsx122("image", __spreadValues({ href: overlay }, framePosition))
|
|
20031
20287
|
] }) }),
|
|
20032
|
-
overlay && /* @__PURE__ */
|
|
20033
|
-
outline && /* @__PURE__ */
|
|
20034
|
-
/* @__PURE__ */
|
|
20288
|
+
overlay && /* @__PURE__ */ jsx122("rect", { width: "100%", height: "100%", mask: "url(#mask)", fillOpacity: "0.72" }),
|
|
20289
|
+
outline && /* @__PURE__ */ jsx122("image", __spreadValues({ href: outline }, framePosition)),
|
|
20290
|
+
/* @__PURE__ */ jsx122("foreignObject", { width: "100%", height: "100%", children: /* @__PURE__ */ jsx122("div", __spreadProps(__spreadValues({ className: "camera-capture-text-and-image-container" }, helperBoxPosition), { children: helperBox })) })
|
|
20035
20291
|
] });
|
|
20036
20292
|
}
|
|
20037
20293
|
var Overlay_default = Overlay;
|
|
20038
20294
|
|
|
20039
20295
|
// src/common/cameraCapture/screens/cameraErrorScreen/CameraErrorScreen.tsx
|
|
20040
20296
|
import { Button as Button12 } from "@transferwise/components";
|
|
20041
|
-
import { jsx as
|
|
20297
|
+
import { jsx as jsx123, jsxs as jsxs50 } from "react/jsx-runtime";
|
|
20042
20298
|
function CameraErrorScreen({ title, description, actionButton, onAction }) {
|
|
20043
|
-
return /* @__PURE__ */
|
|
20044
|
-
/* @__PURE__ */
|
|
20045
|
-
/* @__PURE__ */
|
|
20046
|
-
onAction && actionButton && /* @__PURE__ */
|
|
20299
|
+
return /* @__PURE__ */ jsx123("div", { className: "container p-t-5", children: /* @__PURE__ */ jsx123("div", { className: "row", children: /* @__PURE__ */ jsxs50("div", { className: "col-md-6 col-md-offset-3", children: [
|
|
20300
|
+
/* @__PURE__ */ jsx123("h2", { className: "text-xs-center m-b-3", children: title }),
|
|
20301
|
+
/* @__PURE__ */ jsx123("p", { className: "text-xs-center m-b-5", children: description }),
|
|
20302
|
+
onAction && actionButton && /* @__PURE__ */ jsx123(Button12, { block: true, onClick: onAction, children: actionButton })
|
|
20047
20303
|
] }) }) });
|
|
20048
20304
|
}
|
|
20049
20305
|
var CameraErrorScreen_default = CameraErrorScreen;
|
|
20050
20306
|
|
|
20051
20307
|
// src/common/cameraCapture/CameraCapture.tsx
|
|
20052
|
-
import { jsx as
|
|
20308
|
+
import { jsx as jsx124, jsxs as jsxs51 } from "react/jsx-runtime";
|
|
20053
20309
|
function CameraCapture({
|
|
20054
20310
|
direction = "back",
|
|
20055
20311
|
overlay = "",
|
|
@@ -20157,8 +20413,8 @@ function CameraCapture({
|
|
|
20157
20413
|
exitFullScreen();
|
|
20158
20414
|
}
|
|
20159
20415
|
}, [mode, exitFullScreen]);
|
|
20160
|
-
const captureScreen = /* @__PURE__ */
|
|
20161
|
-
videoConstraints && /* @__PURE__ */
|
|
20416
|
+
const captureScreen = /* @__PURE__ */ jsxs51("div", { className: "camera-capture", children: [
|
|
20417
|
+
videoConstraints && /* @__PURE__ */ jsx124(
|
|
20162
20418
|
Webcam,
|
|
20163
20419
|
{
|
|
20164
20420
|
ref: webcamReference,
|
|
@@ -20169,7 +20425,7 @@ function CameraCapture({
|
|
|
20169
20425
|
onUserMedia: handleUserMedia
|
|
20170
20426
|
}
|
|
20171
20427
|
),
|
|
20172
|
-
/* @__PURE__ */
|
|
20428
|
+
/* @__PURE__ */ jsx124(
|
|
20173
20429
|
Overlay_default,
|
|
20174
20430
|
{
|
|
20175
20431
|
overlay,
|
|
@@ -20179,8 +20435,8 @@ function CameraCapture({
|
|
|
20179
20435
|
instructions
|
|
20180
20436
|
}
|
|
20181
20437
|
),
|
|
20182
|
-
shouldLockOrientation && /* @__PURE__ */
|
|
20183
|
-
ready && /* @__PURE__ */
|
|
20438
|
+
shouldLockOrientation && /* @__PURE__ */ jsx124(OrientationLockOverlay_default, {}),
|
|
20439
|
+
ready && /* @__PURE__ */ jsx124(
|
|
20184
20440
|
CaptureBottomBar,
|
|
20185
20441
|
{
|
|
20186
20442
|
onCapture: () => {
|
|
@@ -20189,9 +20445,9 @@ function CameraCapture({
|
|
|
20189
20445
|
}
|
|
20190
20446
|
)
|
|
20191
20447
|
] });
|
|
20192
|
-
const reviewScreen = /* @__PURE__ */
|
|
20193
|
-
/* @__PURE__ */
|
|
20194
|
-
/* @__PURE__ */
|
|
20448
|
+
const reviewScreen = /* @__PURE__ */ jsxs51("div", { className: "camera-capture", children: [
|
|
20449
|
+
/* @__PURE__ */ jsx124("img", { className: "review-image", src: reviewImage == null ? void 0 : reviewImage.source, alt: "" }),
|
|
20450
|
+
/* @__PURE__ */ jsx124(
|
|
20195
20451
|
Overlay_default,
|
|
20196
20452
|
{
|
|
20197
20453
|
overlay,
|
|
@@ -20201,18 +20457,18 @@ function CameraCapture({
|
|
|
20201
20457
|
reviewInstructions: intl.formatMessage(CameraCapture_messages_default.reviewInstructions)
|
|
20202
20458
|
}
|
|
20203
20459
|
),
|
|
20204
|
-
/* @__PURE__ */
|
|
20460
|
+
/* @__PURE__ */ jsx124(ReviewBottomBar, { onSubmit: handleReviewSubmit, onRetry: handleReviewRetry })
|
|
20205
20461
|
] });
|
|
20206
|
-
return /* @__PURE__ */
|
|
20462
|
+
return /* @__PURE__ */ jsxs51("section", { children: [
|
|
20207
20463
|
mode === "CAPTURE" /* CAPTURE */ && captureScreen,
|
|
20208
20464
|
mode === "REVIEW" /* REVIEW */ && reviewScreen,
|
|
20209
|
-
mode === "ERROR" /* ERROR */ && cameraError && /* @__PURE__ */
|
|
20465
|
+
mode === "ERROR" /* ERROR */ && cameraError && /* @__PURE__ */ jsx124(CameraErrorScreen_default, __spreadValues({}, cameraError))
|
|
20210
20466
|
] });
|
|
20211
20467
|
}
|
|
20212
20468
|
var CameraCapture_default = CameraCapture;
|
|
20213
20469
|
|
|
20214
20470
|
// src/legacy/step/cameraStep/CameraStep.tsx
|
|
20215
|
-
import { jsx as
|
|
20471
|
+
import { jsx as jsx125 } from "react/jsx-runtime";
|
|
20216
20472
|
function blobToBase64(blob) {
|
|
20217
20473
|
return new Promise((resolve, _) => {
|
|
20218
20474
|
const reader = new FileReader();
|
|
@@ -20250,7 +20506,7 @@ function CameraStep(props) {
|
|
|
20250
20506
|
});
|
|
20251
20507
|
}
|
|
20252
20508
|
};
|
|
20253
|
-
return /* @__PURE__ */
|
|
20509
|
+
return /* @__PURE__ */ jsx125(
|
|
20254
20510
|
CameraCapture_default,
|
|
20255
20511
|
{
|
|
20256
20512
|
overlay,
|
|
@@ -20327,12 +20583,12 @@ var external_confirmation_messages_default2 = defineMessages23({
|
|
|
20327
20583
|
});
|
|
20328
20584
|
|
|
20329
20585
|
// src/legacy/step/externalConfirmationStep/ExternalConfirmationStep.tsx
|
|
20330
|
-
import { jsx as
|
|
20586
|
+
import { jsx as jsx126 } from "react/jsx-runtime";
|
|
20331
20587
|
var noop6 = () => {
|
|
20332
20588
|
};
|
|
20333
20589
|
function ExternalConfirmationStep({ url, onClose }) {
|
|
20334
20590
|
const { formatMessage } = useIntl29();
|
|
20335
|
-
return /* @__PURE__ */
|
|
20591
|
+
return /* @__PURE__ */ jsx126(
|
|
20336
20592
|
DynamicLayout_default,
|
|
20337
20593
|
{
|
|
20338
20594
|
components: [
|
|
@@ -20399,9 +20655,9 @@ function getOrigin2(url) {
|
|
|
20399
20655
|
// src/legacy/dynamicFlow/BackButton.tsx
|
|
20400
20656
|
import { Avatar as Avatar7 } from "@transferwise/components";
|
|
20401
20657
|
import { ArrowLeft as ArrowLeft2 } from "@transferwise/icons";
|
|
20402
|
-
import { jsx as
|
|
20658
|
+
import { jsx as jsx127, jsxs as jsxs52 } from "react/jsx-runtime";
|
|
20403
20659
|
function BackButton2({ title, action, onAction }) {
|
|
20404
|
-
return /* @__PURE__ */
|
|
20660
|
+
return /* @__PURE__ */ jsx127("div", { className: "m-b-2", children: /* @__PURE__ */ jsxs52(
|
|
20405
20661
|
"a",
|
|
20406
20662
|
{
|
|
20407
20663
|
href: "/",
|
|
@@ -20412,8 +20668,8 @@ function BackButton2({ title, action, onAction }) {
|
|
|
20412
20668
|
onAction(__spreadProps(__spreadValues({}, action), { skipValidation: true }));
|
|
20413
20669
|
},
|
|
20414
20670
|
children: [
|
|
20415
|
-
/* @__PURE__ */
|
|
20416
|
-
/* @__PURE__ */
|
|
20671
|
+
/* @__PURE__ */ jsx127("span", { className: "sr-only", children: title }),
|
|
20672
|
+
/* @__PURE__ */ jsx127(Avatar7, { type: "icon", children: /* @__PURE__ */ jsx127(ArrowLeft2, { size: "24" }) })
|
|
20417
20673
|
]
|
|
20418
20674
|
}
|
|
20419
20675
|
) });
|
|
@@ -20421,7 +20677,7 @@ function BackButton2({ title, action, onAction }) {
|
|
|
20421
20677
|
var BackButton_default2 = BackButton2;
|
|
20422
20678
|
|
|
20423
20679
|
// src/legacy/dynamicFlow/DynamicFlowStep.tsx
|
|
20424
|
-
import { Fragment as Fragment24, jsx as
|
|
20680
|
+
import { Fragment as Fragment24, jsx as jsx128, jsxs as jsxs53 } from "react/jsx-runtime";
|
|
20425
20681
|
function DynamicFlowStep(props) {
|
|
20426
20682
|
var _a, _b, _c;
|
|
20427
20683
|
const { step, globalError, onAction } = props;
|
|
@@ -20430,20 +20686,20 @@ function DynamicFlowStep(props) {
|
|
|
20430
20686
|
const { requiresManualTrigger, dismissConfirmation } = useExternal2(externalUrl);
|
|
20431
20687
|
if (step === void 0) {
|
|
20432
20688
|
if (globalError) {
|
|
20433
|
-
return /* @__PURE__ */
|
|
20689
|
+
return /* @__PURE__ */ jsx128(DynamicAlert_default, { component: { context: "negative", markdown: globalError, margin: "lg" } });
|
|
20434
20690
|
}
|
|
20435
20691
|
return null;
|
|
20436
20692
|
}
|
|
20437
20693
|
if (externalUrl && requiresManualTrigger) {
|
|
20438
|
-
return /* @__PURE__ */
|
|
20694
|
+
return /* @__PURE__ */ jsx128(ExternalConfirmationStep_default, { url: externalUrl, onClose: dismissConfirmation });
|
|
20439
20695
|
}
|
|
20440
20696
|
if (isCameraStep(step)) {
|
|
20441
|
-
return /* @__PURE__ */
|
|
20697
|
+
return /* @__PURE__ */ jsx128(CameraStep_default, __spreadProps(__spreadValues({}, props), { step }));
|
|
20442
20698
|
}
|
|
20443
|
-
return /* @__PURE__ */
|
|
20444
|
-
backButton && /* @__PURE__ */
|
|
20445
|
-
globalError ? /* @__PURE__ */
|
|
20446
|
-
/* @__PURE__ */
|
|
20699
|
+
return /* @__PURE__ */ jsxs53(Fragment24, { children: [
|
|
20700
|
+
backButton && /* @__PURE__ */ jsx128(BackButton_default2, __spreadProps(__spreadValues({}, backButton), { onAction })),
|
|
20701
|
+
globalError ? /* @__PURE__ */ jsx128(DynamicAlert_default, { component: { context: "negative", markdown: globalError, margin: "lg" } }) : null,
|
|
20702
|
+
/* @__PURE__ */ jsx128(LayoutStep_default, __spreadProps(__spreadValues({}, props), { stepSpecification: step }))
|
|
20447
20703
|
] });
|
|
20448
20704
|
}
|
|
20449
20705
|
|
|
@@ -20592,7 +20848,7 @@ var isInlineSchema = (schema) => schema !== void 0 && typeof schema === "object"
|
|
|
20592
20848
|
// src/legacy/dynamicFlow/utils/useLoader.tsx
|
|
20593
20849
|
import { Loader as Loader4, Size as Size4 } from "@transferwise/components";
|
|
20594
20850
|
import { useState as useState33 } from "react";
|
|
20595
|
-
import { jsx as
|
|
20851
|
+
import { jsx as jsx129 } from "react/jsx-runtime";
|
|
20596
20852
|
function useLoader(loaderConfig, initialState) {
|
|
20597
20853
|
const config = __spreadValues({
|
|
20598
20854
|
size: Size4.EXTRA_LARGE,
|
|
@@ -20601,7 +20857,7 @@ function useLoader(loaderConfig, initialState) {
|
|
|
20601
20857
|
}, loaderConfig);
|
|
20602
20858
|
const [loadingState, setLoadingState] = useState33(initialState);
|
|
20603
20859
|
const shouldDisplayLoader = config.initial && loadingState === "initial" || config.submission && loadingState === "submission";
|
|
20604
|
-
const loader = shouldDisplayLoader ? /* @__PURE__ */
|
|
20860
|
+
const loader = shouldDisplayLoader ? /* @__PURE__ */ jsx129(
|
|
20605
20861
|
Loader4,
|
|
20606
20862
|
{
|
|
20607
20863
|
size: config.size,
|
|
@@ -20721,7 +20977,7 @@ var useErrorResponse = () => {
|
|
|
20721
20977
|
};
|
|
20722
20978
|
|
|
20723
20979
|
// src/legacy/dynamicFlow/DynamicFlow.tsx
|
|
20724
|
-
import { jsx as
|
|
20980
|
+
import { jsx as jsx130 } from "react/jsx-runtime";
|
|
20725
20981
|
var noop7 = () => {
|
|
20726
20982
|
};
|
|
20727
20983
|
var DynamicFlowComponent = ({
|
|
@@ -20964,7 +21220,7 @@ var DynamicFlowComponent = ({
|
|
|
20964
21220
|
await performAction(action);
|
|
20965
21221
|
}
|
|
20966
21222
|
};
|
|
20967
|
-
return /* @__PURE__ */
|
|
21223
|
+
return /* @__PURE__ */ jsx130(LogProvider, { flowId, stepId: (step == null ? void 0 : step.id) || (step == null ? void 0 : step.key), onLog, children: /* @__PURE__ */ jsx130(EventsContextProvider, { metadata: analyticsMetadata, onEvent, children: /* @__PURE__ */ jsx130(DynamicFlowProvider, { loading: isLoading || isDebouncing, children: /* @__PURE__ */ jsx130(HttpClientProvider, { httpClient, children: /* @__PURE__ */ jsx130(FeatureContextProvider, { features, children: loader !== null ? loader : /* @__PURE__ */ jsx130("div", { id: (step == null ? void 0 : step.id) || (step == null ? void 0 : step.key), className: "dynamic-flow-legacy", children: /* @__PURE__ */ jsx130(
|
|
20968
21224
|
DynamicFlowStep,
|
|
20969
21225
|
{
|
|
20970
21226
|
step,
|
|
@@ -20981,7 +21237,7 @@ var DynamicFlowComponent = ({
|
|
|
20981
21237
|
) }) }) }) }) }) });
|
|
20982
21238
|
};
|
|
20983
21239
|
function DynamicFlow(props) {
|
|
20984
|
-
return /* @__PURE__ */
|
|
21240
|
+
return /* @__PURE__ */ jsx130(ErrorBoundary_default, { onError: props.onError, children: /* @__PURE__ */ jsx130(DynamicFlowComponent, __spreadValues({}, props)) });
|
|
20985
21241
|
}
|
|
20986
21242
|
var DynamicFlow_default = DynamicFlow;
|
|
20987
21243
|
var combineModels2 = (formModels) => Object.values(formModels).reduce((previous, model) => __spreadValues(__spreadValues({}, previous), model), {});
|
|
@@ -20998,19 +21254,19 @@ var shouldTriggerRefresh = (props) => {
|
|
|
20998
21254
|
};
|
|
20999
21255
|
|
|
21000
21256
|
// src/legacy/jsonSchemaForm/JsonSchemaForm.tsx
|
|
21001
|
-
import { jsx as
|
|
21257
|
+
import { jsx as jsx131 } from "react/jsx-runtime";
|
|
21002
21258
|
function JsonSchemaForm(props) {
|
|
21003
21259
|
const schemaProps = __spreadValues({
|
|
21004
21260
|
model: null,
|
|
21005
21261
|
errors: null
|
|
21006
21262
|
}, props);
|
|
21007
21263
|
const { baseUrl = "", onEvent = noop8, onLog = noop8 } = props;
|
|
21008
|
-
return /* @__PURE__ */
|
|
21264
|
+
return /* @__PURE__ */ jsx131(LogProvider, { flowId: "JsonSchemaForm", stepId: "JsonSchemaForm", onLog, children: /* @__PURE__ */ jsx131(
|
|
21009
21265
|
EventsContextProvider,
|
|
21010
21266
|
{
|
|
21011
21267
|
metadata: { flowId: "JsonSchemaForm", stepId: "JsonSchemaForm" },
|
|
21012
21268
|
onEvent,
|
|
21013
|
-
children: /* @__PURE__ */
|
|
21269
|
+
children: /* @__PURE__ */ jsx131(HttpClientProviderFromBaseUrl, { baseUrl, children: /* @__PURE__ */ jsx131(GenericSchema_default, __spreadValues({}, schemaProps)) })
|
|
21014
21270
|
}
|
|
21015
21271
|
) });
|
|
21016
21272
|
}
|