@wise/dynamic-flow-client 3.31.2 → 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 +803 -533
- package/build/main.min.js +1 -1
- package/build/main.mjs +735 -465
- package/build/types/revamp/domain/components/DecisionComponent.d.ts +3 -2
- package/build/types/revamp/domain/components/ImageComponent.d.ts +9 -3
- 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/imageLayoutToComponent.d.ts +10 -1
- 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 +22 -22
package/build/main.js
CHANGED
|
@@ -70,7 +70,7 @@ var require_classnames = __commonJS({
|
|
|
70
70
|
(function() {
|
|
71
71
|
"use strict";
|
|
72
72
|
var hasOwn = {}.hasOwnProperty;
|
|
73
|
-
function
|
|
73
|
+
function classNames17() {
|
|
74
74
|
var classes = "";
|
|
75
75
|
for (var i = 0; i < arguments.length; i++) {
|
|
76
76
|
var arg = arguments[i];
|
|
@@ -88,7 +88,7 @@ var require_classnames = __commonJS({
|
|
|
88
88
|
return "";
|
|
89
89
|
}
|
|
90
90
|
if (Array.isArray(arg)) {
|
|
91
|
-
return
|
|
91
|
+
return classNames17.apply(null, arg);
|
|
92
92
|
}
|
|
93
93
|
if (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes("[native code]")) {
|
|
94
94
|
return arg.toString();
|
|
@@ -111,14 +111,14 @@ var require_classnames = __commonJS({
|
|
|
111
111
|
return value + newClass;
|
|
112
112
|
}
|
|
113
113
|
if (typeof module2 !== "undefined" && module2.exports) {
|
|
114
|
-
|
|
115
|
-
module2.exports =
|
|
114
|
+
classNames17.default = classNames17;
|
|
115
|
+
module2.exports = classNames17;
|
|
116
116
|
} else if (typeof define === "function" && typeof define.amd === "object" && define.amd) {
|
|
117
117
|
define("classnames", [], function() {
|
|
118
|
-
return
|
|
118
|
+
return classNames17;
|
|
119
119
|
});
|
|
120
120
|
} else {
|
|
121
|
-
window.classNames =
|
|
121
|
+
window.classNames = classNames17;
|
|
122
122
|
}
|
|
123
123
|
})();
|
|
124
124
|
}
|
|
@@ -1519,7 +1519,7 @@ var mapErrorsToValidationState = (errors) => {
|
|
|
1519
1519
|
|
|
1520
1520
|
// src/revamp/renderers/mappers/utils/inputComponentToProps.ts
|
|
1521
1521
|
var inputComponentToProps = (component, type) => {
|
|
1522
|
-
var _a;
|
|
1522
|
+
var _a, _b, _c, _d;
|
|
1523
1523
|
const {
|
|
1524
1524
|
autoComplete,
|
|
1525
1525
|
control,
|
|
@@ -1548,7 +1548,11 @@ var inputComponentToProps = (component, type) => {
|
|
|
1548
1548
|
help,
|
|
1549
1549
|
icon,
|
|
1550
1550
|
id,
|
|
1551
|
-
image
|
|
1551
|
+
image: image ? {
|
|
1552
|
+
accessibilityDescription: (_b = image.accessibilityDescription) != null ? _b : image.text,
|
|
1553
|
+
uri: image.uri,
|
|
1554
|
+
url: (_d = (_c = image.uri) != null ? _c : image.url) != null ? _d : ""
|
|
1555
|
+
} : void 0,
|
|
1552
1556
|
label: title,
|
|
1553
1557
|
placeholder,
|
|
1554
1558
|
required,
|
|
@@ -1618,7 +1622,19 @@ var dateInputComponentToProps = (component) => __spreadProps(__spreadValues({},
|
|
|
1618
1622
|
});
|
|
1619
1623
|
|
|
1620
1624
|
// src/revamp/renderers/mappers/decisionComponentToProps.ts
|
|
1621
|
-
var decisionComponentToProps = (component) => pick(component, "type", "control", "
|
|
1625
|
+
var decisionComponentToProps = (component) => __spreadProps(__spreadValues({}, pick(component, "type", "control", "margin", "title")), {
|
|
1626
|
+
options: component.options.map((_a) => {
|
|
1627
|
+
var _b = _a, { image } = _b, rest = __objRest(_b, ["image"]);
|
|
1628
|
+
var _a2, _b2, _c;
|
|
1629
|
+
return __spreadProps(__spreadValues({}, rest), {
|
|
1630
|
+
image: image ? {
|
|
1631
|
+
accessibilityDescription: (_a2 = image.accessibilityDescription) != null ? _a2 : image.text,
|
|
1632
|
+
uri: image.uri,
|
|
1633
|
+
url: (_c = (_b2 = image.uri) != null ? _b2 : image.url) != null ? _c : ""
|
|
1634
|
+
} : image
|
|
1635
|
+
});
|
|
1636
|
+
})
|
|
1637
|
+
});
|
|
1622
1638
|
|
|
1623
1639
|
// src/revamp/renderers/mappers/dividerComponentToProps.ts
|
|
1624
1640
|
var dividerComponentToProps = (component) => pick(component, "type", "control", "margin");
|
|
@@ -1635,7 +1651,14 @@ var hiddenComponentToProps = () => ({
|
|
|
1635
1651
|
});
|
|
1636
1652
|
|
|
1637
1653
|
// src/revamp/renderers/mappers/imageComponentToProps.ts
|
|
1638
|
-
var imageComponentToProps = (component) =>
|
|
1654
|
+
var imageComponentToProps = (component) => {
|
|
1655
|
+
var _a;
|
|
1656
|
+
return __spreadProps(__spreadValues({}, pick(component, "type", "control", "margin", "size")), {
|
|
1657
|
+
accessibilityDescription: component.content.accessibilityDescription,
|
|
1658
|
+
url: (_a = component.content.url) != null ? _a : "",
|
|
1659
|
+
uri: component.content.uri
|
|
1660
|
+
});
|
|
1661
|
+
};
|
|
1639
1662
|
|
|
1640
1663
|
// src/revamp/renderers/mappers/instructionsComponentToProps.ts
|
|
1641
1664
|
var instructionsComponentToProps = (component) => pick(component, "type", "control", "items", "margin", "title");
|
|
@@ -1692,17 +1715,25 @@ var numberInputComponentToProps = (component) => __spreadProps(__spreadValues({}
|
|
|
1692
1715
|
});
|
|
1693
1716
|
|
|
1694
1717
|
// src/revamp/renderers/mappers/objectComponentToProps.ts
|
|
1695
|
-
var objectComponentToProps = (component, children) =>
|
|
1696
|
-
|
|
1697
|
-
|
|
1698
|
-
|
|
1699
|
-
})
|
|
1718
|
+
var objectComponentToProps = (component, children) => {
|
|
1719
|
+
var _a, _b;
|
|
1720
|
+
return __spreadProps(__spreadValues({
|
|
1721
|
+
type: "form-section"
|
|
1722
|
+
}, pick(component, "control", "description", "help", "icon", "title")), {
|
|
1723
|
+
// TODO: Remove when viewbindings are updated
|
|
1724
|
+
image: component.image ? __spreadProps(__spreadValues({}, component.image), {
|
|
1725
|
+
url: (_b = (_a = component.image) == null ? void 0 : _a.url) != null ? _b : ""
|
|
1726
|
+
}) : void 0,
|
|
1727
|
+
children
|
|
1728
|
+
});
|
|
1729
|
+
};
|
|
1700
1730
|
|
|
1701
1731
|
// src/revamp/renderers/mappers/paragraphComponentToProps.ts
|
|
1702
1732
|
var paragraphComponentToProps = (component) => pick(component, "type", "align", "control", "margin", "text");
|
|
1703
1733
|
|
|
1704
1734
|
// src/revamp/renderers/mappers/repeatableComponentToProps.ts
|
|
1705
1735
|
var repeatableComponentToProps = (component, children, editableItemChildren) => {
|
|
1736
|
+
var _a, _b;
|
|
1706
1737
|
const {
|
|
1707
1738
|
addItemTitle,
|
|
1708
1739
|
control,
|
|
@@ -1721,13 +1752,26 @@ var repeatableComponentToProps = (component, children, editableItemChildren) =>
|
|
|
1721
1752
|
onSave,
|
|
1722
1753
|
onRemove
|
|
1723
1754
|
} = component;
|
|
1755
|
+
const getSummaryImage = (componentSummary) => {
|
|
1756
|
+
var _a2, _b2;
|
|
1757
|
+
if (componentSummary.image) {
|
|
1758
|
+
return __spreadProps(__spreadValues({}, componentSummary.image), {
|
|
1759
|
+
url: (_a2 = componentSummary.image.url) != null ? _a2 : ""
|
|
1760
|
+
});
|
|
1761
|
+
}
|
|
1762
|
+
if (summaryDefaults.image) {
|
|
1763
|
+
return __spreadProps(__spreadValues({}, summaryDefaults.image), {
|
|
1764
|
+
url: (_b2 = summaryDefaults.image.url) != null ? _b2 : ""
|
|
1765
|
+
});
|
|
1766
|
+
}
|
|
1767
|
+
};
|
|
1724
1768
|
const getSummary = (componentSummary) => {
|
|
1725
|
-
var
|
|
1769
|
+
var _a2, _b2, _c;
|
|
1726
1770
|
return {
|
|
1727
|
-
title: (
|
|
1728
|
-
description: (
|
|
1771
|
+
title: (_a2 = componentSummary.title) != null ? _a2 : summaryDefaults.title,
|
|
1772
|
+
description: (_b2 = componentSummary.description) != null ? _b2 : summaryDefaults.description,
|
|
1729
1773
|
icon: (_c = componentSummary.icon) != null ? _c : summaryDefaults.icon,
|
|
1730
|
-
image: (
|
|
1774
|
+
image: getSummaryImage(componentSummary)
|
|
1731
1775
|
};
|
|
1732
1776
|
};
|
|
1733
1777
|
const itemProps = components.map((childComponent) => __spreadProps(__spreadValues({}, getSummary(childComponent.getSummary())), {
|
|
@@ -1743,7 +1787,11 @@ var repeatableComponentToProps = (component, children, editableItemChildren) =>
|
|
|
1743
1787
|
editItemTitle,
|
|
1744
1788
|
error: errors == null ? void 0 : errors[0],
|
|
1745
1789
|
icon,
|
|
1746
|
-
image
|
|
1790
|
+
image: image ? {
|
|
1791
|
+
accessibilityDescription: (_a = image.accessibilityDescription) != null ? _a : image.text,
|
|
1792
|
+
uri: image.uri,
|
|
1793
|
+
url: (_b = image.url) != null ? _b : ""
|
|
1794
|
+
} : void 0,
|
|
1747
1795
|
items: itemProps,
|
|
1748
1796
|
maxItems,
|
|
1749
1797
|
minItems,
|
|
@@ -1861,10 +1909,32 @@ var uploadInputComponentToProps = (component) => {
|
|
|
1861
1909
|
};
|
|
1862
1910
|
|
|
1863
1911
|
// src/revamp/renderers/mappers/tupleComponentToProps.ts
|
|
1864
|
-
var tupleComponentToProps = (component, children) =>
|
|
1865
|
-
|
|
1866
|
-
|
|
1867
|
-
|
|
1912
|
+
var tupleComponentToProps = (component, children) => {
|
|
1913
|
+
var _a, _b;
|
|
1914
|
+
return __spreadProps(__spreadValues({
|
|
1915
|
+
type: "form-section"
|
|
1916
|
+
}, pick(component, "control", "description", "help", "icon", "title")), {
|
|
1917
|
+
// TODO Remove URL default after next types update (add back to `pick`)
|
|
1918
|
+
image: component.image ? __spreadProps(__spreadValues({}, component.image), {
|
|
1919
|
+
url: (_b = (_a = component.image) == null ? void 0 : _a.url) != null ? _b : ""
|
|
1920
|
+
}) : void 0,
|
|
1921
|
+
children
|
|
1922
|
+
});
|
|
1923
|
+
};
|
|
1924
|
+
|
|
1925
|
+
// src/revamp/renderers/mappers/listComponentToProps.ts
|
|
1926
|
+
var listComponentToProps = (component) => __spreadProps(__spreadValues({}, pick(component, "type", "callToAction", "control", "margin", "title")), {
|
|
1927
|
+
items: component.items.map((_a) => {
|
|
1928
|
+
var _b = _a, { image } = _b, rest = __objRest(_b, ["image"]);
|
|
1929
|
+
var _a2, _b2, _c;
|
|
1930
|
+
return __spreadProps(__spreadValues({}, rest), {
|
|
1931
|
+
image: image ? {
|
|
1932
|
+
accessibilityDescription: (_a2 = image == null ? void 0 : image.accessibilityDescription) != null ? _a2 : image == null ? void 0 : image.text,
|
|
1933
|
+
uri: image == null ? void 0 : image.uri,
|
|
1934
|
+
url: (_c = (_b2 = image == null ? void 0 : image.url) != null ? _b2 : image == null ? void 0 : image.url) != null ? _c : ""
|
|
1935
|
+
} : void 0
|
|
1936
|
+
});
|
|
1937
|
+
})
|
|
1868
1938
|
});
|
|
1869
1939
|
|
|
1870
1940
|
// src/revamp/renderers/mappers/componentToRendererProps.ts
|
|
@@ -1908,6 +1978,8 @@ var componentToRendererProps = (component, nestedContent) => {
|
|
|
1908
1978
|
return instructionsComponentToProps(component);
|
|
1909
1979
|
case "integer":
|
|
1910
1980
|
return integerInputComponentToProps(component);
|
|
1981
|
+
case "list":
|
|
1982
|
+
return listComponentToProps(component);
|
|
1911
1983
|
case "loading-indicator":
|
|
1912
1984
|
return loadingIndicatorComponentToProps(component);
|
|
1913
1985
|
case "markdown":
|
|
@@ -6230,10 +6302,14 @@ var actionSchema = z.object({
|
|
|
6230
6302
|
skipValidation: z.boolean().optional()
|
|
6231
6303
|
});
|
|
6232
6304
|
var listLayoutItemSchema = z.object({
|
|
6233
|
-
title: z.string(),
|
|
6234
6305
|
description: z.string().optional(),
|
|
6235
|
-
|
|
6236
|
-
|
|
6306
|
+
status: listLayoutStatusSchema.optional(),
|
|
6307
|
+
icon: iconSchema.optional(),
|
|
6308
|
+
image: imageSchema.optional(),
|
|
6309
|
+
title: z.string(),
|
|
6310
|
+
subtitle: z.string().optional(),
|
|
6311
|
+
value: z.string().optional(),
|
|
6312
|
+
subvalue: z.string().optional()
|
|
6237
6313
|
});
|
|
6238
6314
|
var decisionLayoutOptionSchema = z.object({
|
|
6239
6315
|
action: actionSchema,
|
|
@@ -6254,6 +6330,11 @@ var behaviorSchema = z.object({
|
|
|
6254
6330
|
action: actionSchema.optional(),
|
|
6255
6331
|
link: linkSchema.optional()
|
|
6256
6332
|
});
|
|
6333
|
+
var itemCallToActionSchema = z.object({
|
|
6334
|
+
title: z.string(),
|
|
6335
|
+
accessibilityDescription: z.string().optional(),
|
|
6336
|
+
behavior: behaviorSchema
|
|
6337
|
+
});
|
|
6257
6338
|
var buttonLayoutSchema = z.object({
|
|
6258
6339
|
type: z.literal("button"),
|
|
6259
6340
|
size: sizeSchema.optional(),
|
|
@@ -6317,12 +6398,10 @@ var alertLayoutCallToActionSchema = z.object({
|
|
|
6317
6398
|
accessibilityDescription: z.string().optional(),
|
|
6318
6399
|
behavior: behaviorSchema
|
|
6319
6400
|
});
|
|
6320
|
-
var
|
|
6321
|
-
|
|
6322
|
-
|
|
6323
|
-
|
|
6324
|
-
control: z.string().optional(),
|
|
6325
|
-
margin: sizeSchema.optional()
|
|
6401
|
+
var listLayoutCallToActionSchema = z.object({
|
|
6402
|
+
title: z.string(),
|
|
6403
|
+
accessibilityDescription: z.string().optional(),
|
|
6404
|
+
behavior: behaviorSchema
|
|
6326
6405
|
});
|
|
6327
6406
|
var decisionLayoutSchema = z.object({
|
|
6328
6407
|
type: z.literal("decision"),
|
|
@@ -6331,10 +6410,12 @@ var decisionLayoutSchema = z.object({
|
|
|
6331
6410
|
control: z.string().optional(),
|
|
6332
6411
|
margin: sizeSchema.optional()
|
|
6333
6412
|
});
|
|
6334
|
-
var
|
|
6413
|
+
var statusListLayoutItemSchema = z.object({
|
|
6335
6414
|
title: z.string(),
|
|
6336
|
-
|
|
6337
|
-
|
|
6415
|
+
description: z.string().optional(),
|
|
6416
|
+
icon: iconSchema,
|
|
6417
|
+
status: statusListLayoutStatusSchema.optional(),
|
|
6418
|
+
callToAction: itemCallToActionSchema.optional()
|
|
6338
6419
|
});
|
|
6339
6420
|
var reviewLayoutSchema = z.object({
|
|
6340
6421
|
type: z.literal("review"),
|
|
@@ -6368,12 +6449,20 @@ var alertLayoutSchema = z.object({
|
|
|
6368
6449
|
margin: sizeSchema.optional(),
|
|
6369
6450
|
callToAction: alertLayoutCallToActionSchema.optional()
|
|
6370
6451
|
});
|
|
6371
|
-
var
|
|
6372
|
-
|
|
6373
|
-
|
|
6374
|
-
|
|
6375
|
-
|
|
6376
|
-
|
|
6452
|
+
var listLayoutSchema = z.object({
|
|
6453
|
+
type: z.literal("list"),
|
|
6454
|
+
title: z.string().optional(),
|
|
6455
|
+
callToAction: listLayoutCallToActionSchema.optional(),
|
|
6456
|
+
items: z.array(listLayoutItemSchema),
|
|
6457
|
+
control: z.string().optional(),
|
|
6458
|
+
margin: sizeSchema.optional()
|
|
6459
|
+
});
|
|
6460
|
+
var statusListLayoutSchema = z.object({
|
|
6461
|
+
type: z.literal("status-list"),
|
|
6462
|
+
items: z.array(statusListLayoutItemSchema),
|
|
6463
|
+
title: z.string().optional(),
|
|
6464
|
+
control: z.string().optional(),
|
|
6465
|
+
margin: sizeSchema.optional()
|
|
6377
6466
|
});
|
|
6378
6467
|
var searchResponseBodySchema = z.object({
|
|
6379
6468
|
results: z.array(searchResultSchema)
|
|
@@ -6416,13 +6505,6 @@ var constSchemaSchema = z.object({
|
|
|
6416
6505
|
analyticsId: z.string().optional(),
|
|
6417
6506
|
disabled: z.boolean().optional()
|
|
6418
6507
|
});
|
|
6419
|
-
var statusListLayoutSchema = z.object({
|
|
6420
|
-
type: z.literal("status-list"),
|
|
6421
|
-
items: z.array(statusListLayoutItemSchema),
|
|
6422
|
-
title: z.string().optional(),
|
|
6423
|
-
control: z.string().optional(),
|
|
6424
|
-
margin: sizeSchema.optional()
|
|
6425
|
-
});
|
|
6426
6508
|
var layoutSchema = z.lazy(
|
|
6427
6509
|
() => z.union([
|
|
6428
6510
|
alertLayoutSchema,
|
|
@@ -7168,7 +7250,7 @@ var buttonLayoutToComponent = (uid, button, mapperProps) => {
|
|
|
7168
7250
|
var buttonLayoutToComponentWithBehavior = (uid, button, mapperProps) => {
|
|
7169
7251
|
const { onAction, onLink, step } = mapperProps;
|
|
7170
7252
|
const { context, control, disabled, margin = "md", pinOrder, size: size2, title, behavior } = button;
|
|
7171
|
-
const
|
|
7253
|
+
const getOnClick2 = () => {
|
|
7172
7254
|
if ("type" in behavior) {
|
|
7173
7255
|
switch (behavior.type) {
|
|
7174
7256
|
case "action": {
|
|
@@ -7212,7 +7294,7 @@ var buttonLayoutToComponentWithBehavior = (uid, button, mapperProps) => {
|
|
|
7212
7294
|
pinOrder,
|
|
7213
7295
|
size: size2,
|
|
7214
7296
|
title: title != null ? title : "",
|
|
7215
|
-
onClick:
|
|
7297
|
+
onClick: getOnClick2()
|
|
7216
7298
|
});
|
|
7217
7299
|
};
|
|
7218
7300
|
var buttonLayoutToComponentWithAction = (uid, button, mapperProps) => {
|
|
@@ -7324,21 +7406,51 @@ var createDecisionComponent = (decisionProps) => __spreadProps(__spreadValues({
|
|
|
7324
7406
|
});
|
|
7325
7407
|
|
|
7326
7408
|
// src/revamp/domain/mappers/layout/decisionLayoutToComponent.ts
|
|
7327
|
-
var decisionLayoutToComponent = (uid, { control, margin = "md", options, title },
|
|
7409
|
+
var decisionLayoutToComponent = (uid, { control, margin = "md", options, title }, mapperProps) => createDecisionComponent({
|
|
7328
7410
|
uid,
|
|
7329
7411
|
control,
|
|
7330
7412
|
margin,
|
|
7331
|
-
options: options.map((
|
|
7332
|
-
|
|
7333
|
-
|
|
7334
|
-
|
|
7335
|
-
onClick: () => {
|
|
7336
|
-
void onAction(action);
|
|
7337
|
-
}
|
|
7413
|
+
options: options.map((option) => {
|
|
7414
|
+
return __spreadProps(__spreadValues({}, option), {
|
|
7415
|
+
href: getHref(option),
|
|
7416
|
+
onClick: getOnClick(option, mapperProps)
|
|
7338
7417
|
});
|
|
7339
7418
|
}),
|
|
7340
7419
|
title
|
|
7341
7420
|
});
|
|
7421
|
+
var getHref = (option) => {
|
|
7422
|
+
const { behavior } = option;
|
|
7423
|
+
if (behavior && "type" in behavior && behavior.type === "link") {
|
|
7424
|
+
return behavior.url;
|
|
7425
|
+
}
|
|
7426
|
+
return void 0;
|
|
7427
|
+
};
|
|
7428
|
+
var getOnClick = (option, { step, onAction, onLink }) => {
|
|
7429
|
+
const { behavior } = option;
|
|
7430
|
+
if (!behavior) {
|
|
7431
|
+
const action = inlineAction(option.action, step == null ? void 0 : step.actions);
|
|
7432
|
+
return () => {
|
|
7433
|
+
void onAction(action);
|
|
7434
|
+
};
|
|
7435
|
+
}
|
|
7436
|
+
if ("type" in behavior) {
|
|
7437
|
+
switch (behavior.type) {
|
|
7438
|
+
case "action": {
|
|
7439
|
+
const action = inlineAction(behavior.action, step == null ? void 0 : step.actions);
|
|
7440
|
+
return () => {
|
|
7441
|
+
void onAction(action);
|
|
7442
|
+
};
|
|
7443
|
+
}
|
|
7444
|
+
case "link": {
|
|
7445
|
+
return () => {
|
|
7446
|
+
void onLink(behavior.url);
|
|
7447
|
+
};
|
|
7448
|
+
}
|
|
7449
|
+
}
|
|
7450
|
+
}
|
|
7451
|
+
return () => {
|
|
7452
|
+
};
|
|
7453
|
+
};
|
|
7342
7454
|
|
|
7343
7455
|
// src/revamp/domain/components/DividerComponent.ts
|
|
7344
7456
|
var createDividerComponent = (props) => __spreadProps(__spreadValues({
|
|
@@ -10131,13 +10243,12 @@ var createImageComponent = (imageProps) => __spreadProps(__spreadValues({
|
|
|
10131
10243
|
});
|
|
10132
10244
|
|
|
10133
10245
|
// src/revamp/domain/mappers/layout/imageLayoutToComponent.ts
|
|
10134
|
-
var imageLayoutToComponent = (uid, { accessibilityDescription, control, margin = "md", size: size2 = "md", text, url }) => createImageComponent({
|
|
10246
|
+
var imageLayoutToComponent = (uid, { accessibilityDescription, content, control, margin = "md", size: size2 = "md", text, url }) => createImageComponent({
|
|
10135
10247
|
uid,
|
|
10136
|
-
accessibilityDescription: accessibilityDescription != null ? accessibilityDescription : text,
|
|
10248
|
+
content: content != null ? content : { accessibilityDescription: accessibilityDescription != null ? accessibilityDescription : text, url },
|
|
10137
10249
|
control,
|
|
10138
10250
|
margin,
|
|
10139
|
-
size: size2
|
|
10140
|
-
url
|
|
10251
|
+
size: size2
|
|
10141
10252
|
});
|
|
10142
10253
|
|
|
10143
10254
|
// src/revamp/domain/components/MarkdownComponent.ts
|
|
@@ -10617,14 +10728,14 @@ var getItemCallToAction = (callToAction, onAction, onLink) => {
|
|
|
10617
10728
|
};
|
|
10618
10729
|
};
|
|
10619
10730
|
|
|
10620
|
-
// src/revamp/domain/mappers/layout/
|
|
10621
|
-
var
|
|
10731
|
+
// src/revamp/domain/mappers/layout/deprecatedListLayoutToComponent.ts
|
|
10732
|
+
var deprecatedListLayoutToComponent = (uid, { control, items, margin = "md", title }) => createStatusListComponent({
|
|
10622
10733
|
uid,
|
|
10623
10734
|
control,
|
|
10624
10735
|
items: items.map(({ description, icon, status, title: itemTitle }) => ({
|
|
10625
10736
|
description,
|
|
10626
|
-
icon,
|
|
10627
|
-
title: itemTitle,
|
|
10737
|
+
icon: icon != null ? icon : { text: "" },
|
|
10738
|
+
title: itemTitle != null ? itemTitle : "",
|
|
10628
10739
|
status: status ? mapLegacyStatus(status) : void 0
|
|
10629
10740
|
})),
|
|
10630
10741
|
margin,
|
|
@@ -10642,6 +10753,68 @@ var mapLegacyStatus = (status) => {
|
|
|
10642
10753
|
}
|
|
10643
10754
|
};
|
|
10644
10755
|
|
|
10756
|
+
// src/revamp/domain/components/ListComponent.ts
|
|
10757
|
+
var createListComponent = (listProps) => __spreadProps(__spreadValues({
|
|
10758
|
+
type: "list"
|
|
10759
|
+
}, listProps), {
|
|
10760
|
+
getLocalValue: () => null,
|
|
10761
|
+
getSubmittableValue: async () => null,
|
|
10762
|
+
getSubmittableValueSync: () => null,
|
|
10763
|
+
getSummary: () => ({}),
|
|
10764
|
+
// noop
|
|
10765
|
+
validate: () => true
|
|
10766
|
+
});
|
|
10767
|
+
|
|
10768
|
+
// src/revamp/domain/mappers/layout/listLayoutToComponent.ts
|
|
10769
|
+
var listLayoutToComponent = (uid, { callToAction, control, items, margin = "md", title }, mapperProps) => createListComponent({
|
|
10770
|
+
uid,
|
|
10771
|
+
control,
|
|
10772
|
+
items: items.map(({ value, subvalue, title: itemTitle, subtitle, icon, image }) => ({
|
|
10773
|
+
title: itemTitle,
|
|
10774
|
+
subtitle,
|
|
10775
|
+
value,
|
|
10776
|
+
subvalue,
|
|
10777
|
+
icon,
|
|
10778
|
+
image
|
|
10779
|
+
})),
|
|
10780
|
+
callToAction: getListCallToAction(callToAction, mapperProps),
|
|
10781
|
+
margin,
|
|
10782
|
+
title
|
|
10783
|
+
});
|
|
10784
|
+
var getListCallToAction = (callToAction, { onAction, onLink }) => {
|
|
10785
|
+
if (!callToAction) {
|
|
10786
|
+
return void 0;
|
|
10787
|
+
}
|
|
10788
|
+
const { accessibilityDescription, behavior, title } = callToAction;
|
|
10789
|
+
if ("type" in behavior) {
|
|
10790
|
+
switch (behavior.type) {
|
|
10791
|
+
case "action": {
|
|
10792
|
+
const { action } = behavior;
|
|
10793
|
+
return {
|
|
10794
|
+
type: "action",
|
|
10795
|
+
accessibilityDescription,
|
|
10796
|
+
title,
|
|
10797
|
+
onClick: () => {
|
|
10798
|
+
void onAction(action);
|
|
10799
|
+
}
|
|
10800
|
+
};
|
|
10801
|
+
}
|
|
10802
|
+
case "link": {
|
|
10803
|
+
return {
|
|
10804
|
+
type: "link",
|
|
10805
|
+
accessibilityDescription,
|
|
10806
|
+
href: behavior.url,
|
|
10807
|
+
title,
|
|
10808
|
+
onClick: () => {
|
|
10809
|
+
void onLink(behavior.url);
|
|
10810
|
+
}
|
|
10811
|
+
};
|
|
10812
|
+
}
|
|
10813
|
+
}
|
|
10814
|
+
}
|
|
10815
|
+
return void 0;
|
|
10816
|
+
};
|
|
10817
|
+
|
|
10645
10818
|
// src/revamp/domain/mappers/mapLayoutToComponent.ts
|
|
10646
10819
|
var mapLayoutToComponent = (uid, layout, mapperProps) => {
|
|
10647
10820
|
switch (layout.type) {
|
|
@@ -10668,7 +10841,10 @@ var mapLayoutToComponent = (uid, layout, mapperProps) => {
|
|
|
10668
10841
|
case "instructions":
|
|
10669
10842
|
return instructionsLayoutToComponent(uid, layout);
|
|
10670
10843
|
case "list":
|
|
10671
|
-
|
|
10844
|
+
if (layout.items.some((item) => item.status || item.description)) {
|
|
10845
|
+
return deprecatedListLayoutToComponent(uid, layout);
|
|
10846
|
+
}
|
|
10847
|
+
return listLayoutToComponent(uid, layout, mapperProps);
|
|
10672
10848
|
case "loading-indicator":
|
|
10673
10849
|
return loadingIndicatorLayoutToComponent(uid, layout);
|
|
10674
10850
|
case "markdown":
|
|
@@ -12001,9 +12177,14 @@ function NavigationOptionMedia({ icon, image }) {
|
|
|
12001
12177
|
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_components8.Avatar, { type: import_components8.AvatarType.INITIALS, children: icon.text });
|
|
12002
12178
|
}
|
|
12003
12179
|
}
|
|
12004
|
-
if (image
|
|
12005
|
-
const {
|
|
12006
|
-
|
|
12180
|
+
if (image) {
|
|
12181
|
+
const { accessibilityDescription, uri, url } = image;
|
|
12182
|
+
if (uri && !uri.startsWith("urn:")) {
|
|
12183
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("img", { src: uri, alt: accessibilityDescription });
|
|
12184
|
+
}
|
|
12185
|
+
if (url) {
|
|
12186
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("img", { src: url, alt: accessibilityDescription });
|
|
12187
|
+
}
|
|
12007
12188
|
}
|
|
12008
12189
|
return null;
|
|
12009
12190
|
}
|
|
@@ -12019,10 +12200,10 @@ function DecisionRendererComponent({ margin, options, title }) {
|
|
|
12019
12200
|
const { isLoading } = useLoadingContext();
|
|
12020
12201
|
return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: getMargin(margin), children: [
|
|
12021
12202
|
title && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_components9.Header, { as: "h2", title }),
|
|
12022
|
-
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_components9.NavigationOptionsList, { children: options.map(({ description, disabled, icon, image, title:
|
|
12203
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_components9.NavigationOptionsList, { children: options.map(({ description, disabled, icon, image, title: itemTitle, onClick }) => /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
12023
12204
|
import_components9.NavigationOption,
|
|
12024
12205
|
{
|
|
12025
|
-
title:
|
|
12206
|
+
title: itemTitle,
|
|
12026
12207
|
content: description,
|
|
12027
12208
|
disabled: isLoading || disabled,
|
|
12028
12209
|
media: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(NavigationOptionMedia, { icon, image }),
|
|
@@ -12030,7 +12211,7 @@ function DecisionRendererComponent({ margin, options, title }) {
|
|
|
12030
12211
|
showMediaAtAllSizes: true,
|
|
12031
12212
|
onClick
|
|
12032
12213
|
},
|
|
12033
|
-
JSON.stringify(
|
|
12214
|
+
JSON.stringify(itemTitle)
|
|
12034
12215
|
)) })
|
|
12035
12216
|
] });
|
|
12036
12217
|
}
|
|
@@ -12138,13 +12319,21 @@ function ImageRendererComponent({
|
|
|
12138
12319
|
accessibilityDescription,
|
|
12139
12320
|
margin,
|
|
12140
12321
|
size: size2,
|
|
12322
|
+
uri,
|
|
12141
12323
|
url
|
|
12142
12324
|
}) {
|
|
12143
12325
|
const [imageSource, setImageSource] = (0, import_react9.useState)("");
|
|
12144
12326
|
const httpClient = useRendererHttpClient();
|
|
12145
12327
|
(0, import_react9.useEffect)(() => {
|
|
12146
|
-
|
|
12147
|
-
|
|
12328
|
+
if (!uri) {
|
|
12329
|
+
void getImageSource(httpClient, url).then(setImageSource);
|
|
12330
|
+
return;
|
|
12331
|
+
}
|
|
12332
|
+
if (!uri.startsWith("urn:")) {
|
|
12333
|
+
void getImageSource(httpClient, uri).then(setImageSource);
|
|
12334
|
+
return;
|
|
12335
|
+
}
|
|
12336
|
+
}, [uri, url, httpClient]);
|
|
12148
12337
|
return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: `df-image ${size2 || "md"}`, children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
12149
12338
|
import_components12.Image,
|
|
12150
12339
|
{
|
|
@@ -13841,6 +14030,72 @@ function StepRendererComponent(props) {
|
|
|
13841
14030
|
] });
|
|
13842
14031
|
}
|
|
13843
14032
|
|
|
14033
|
+
// ../renderers/src/ListRenderer.tsx
|
|
14034
|
+
var import_components42 = require("@transferwise/components");
|
|
14035
|
+
var import_classnames6 = __toESM(require_classnames());
|
|
14036
|
+
var import_jsx_runtime59 = require("react/jsx-runtime");
|
|
14037
|
+
var ListRenderer = {
|
|
14038
|
+
canRenderType: "list",
|
|
14039
|
+
render: ({ callToAction, margin, items, title }) => /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)("div", { className: getMargin(margin), children: [
|
|
14040
|
+
title && /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(import_components42.Header, { as: "h2", title, action: getListAction(callToAction) }),
|
|
14041
|
+
items.map((props) => /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(DesignSystemListItem, __spreadValues({}, props), props.title))
|
|
14042
|
+
] })
|
|
14043
|
+
};
|
|
14044
|
+
var DesignSystemListItem = ({ title, subtitle, value, subvalue, icon, image }) => /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
14045
|
+
"label",
|
|
14046
|
+
{
|
|
14047
|
+
className: (0, import_classnames6.default)("np-option p-a-2", {
|
|
14048
|
+
"np-option__sm-media": true,
|
|
14049
|
+
"np-option__container-aligned": true
|
|
14050
|
+
}),
|
|
14051
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)("div", { className: "media", children: [
|
|
14052
|
+
icon || image ? /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("div", { className: "media-left", children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(ListItemMedia, { image, icon }) }) : null,
|
|
14053
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsxs)("div", { className: "media-body", children: [
|
|
14054
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsxs)("div", { className: "d-flex justify-content-between", children: [
|
|
14055
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)("h4", { className: "np-text-body-large-bold text-primary np-option__title", children: title }),
|
|
14056
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)("h4", { className: "np-text-body-large-bold text-primary np-option__title", children: value })
|
|
14057
|
+
] }),
|
|
14058
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsxs)("div", { className: "d-flex justify-content-between", children: [
|
|
14059
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(import_components42.Body, { className: "d-block np-option__body", children: subtitle }),
|
|
14060
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(import_components42.Body, { className: "d-block np-option__body", children: subvalue })
|
|
14061
|
+
] })
|
|
14062
|
+
] })
|
|
14063
|
+
] })
|
|
14064
|
+
},
|
|
14065
|
+
title
|
|
14066
|
+
);
|
|
14067
|
+
var ListItemMedia = ({ icon, image }) => {
|
|
14068
|
+
if (icon) {
|
|
14069
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("div", { className: "circle circle-sm text-primary", children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(NavigationOptionMedia, { icon, image }) });
|
|
14070
|
+
}
|
|
14071
|
+
if (image) {
|
|
14072
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("div", { className: "np-option__no-media-circle", children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(NavigationOptionMedia, { icon, image }) });
|
|
14073
|
+
}
|
|
14074
|
+
};
|
|
14075
|
+
var getListAction = (callToAction) => {
|
|
14076
|
+
if (!callToAction) {
|
|
14077
|
+
return void 0;
|
|
14078
|
+
}
|
|
14079
|
+
const { accessibilityDescription, title, onClick } = callToAction;
|
|
14080
|
+
if (callToAction.type === "action") {
|
|
14081
|
+
return {
|
|
14082
|
+
"aria-label": accessibilityDescription,
|
|
14083
|
+
text: title,
|
|
14084
|
+
onClick: (event) => {
|
|
14085
|
+
event.preventDefault();
|
|
14086
|
+
onClick();
|
|
14087
|
+
}
|
|
14088
|
+
};
|
|
14089
|
+
}
|
|
14090
|
+
return {
|
|
14091
|
+
"aria-label": accessibilityDescription,
|
|
14092
|
+
href: callToAction.href,
|
|
14093
|
+
target: "_blank",
|
|
14094
|
+
text: title
|
|
14095
|
+
};
|
|
14096
|
+
};
|
|
14097
|
+
var ListRenderer_default = ListRenderer;
|
|
14098
|
+
|
|
13844
14099
|
// ../renderers/src/getWiseRenderers.ts
|
|
13845
14100
|
var getWiseRenderers = () => [
|
|
13846
14101
|
AlertRenderer_default,
|
|
@@ -13858,6 +14113,7 @@ var getWiseRenderers = () => [
|
|
|
13858
14113
|
InstructionsRenderer_default,
|
|
13859
14114
|
IntegerInputRenderer_default,
|
|
13860
14115
|
LargeUploadRenderer,
|
|
14116
|
+
ListRenderer_default,
|
|
13861
14117
|
LoadingIndicatorRenderer_default,
|
|
13862
14118
|
MarkdownRenderer_default,
|
|
13863
14119
|
ModalRenderer_default,
|
|
@@ -13887,12 +14143,12 @@ var openLinkInNewTab = (url) => {
|
|
|
13887
14143
|
};
|
|
13888
14144
|
|
|
13889
14145
|
// src/revamp/DynamicFlowWise.tsx
|
|
13890
|
-
var
|
|
14146
|
+
var import_jsx_runtime60 = require("react/jsx-runtime");
|
|
13891
14147
|
var wiseRenderers = getWiseRenderers();
|
|
13892
14148
|
function DynamicFlowWise(props) {
|
|
13893
14149
|
const { httpClient, renderers, onLink = openLinkInNewTab } = props;
|
|
13894
14150
|
const mergedRenderers = (0, import_react20.useMemo)(() => [...renderers != null ? renderers : [], ...wiseRenderers], [renderers]);
|
|
13895
|
-
return /* @__PURE__ */ (0,
|
|
14151
|
+
return /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(RendererHttpClientProvider, { httpClient, children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(DynamicFlowCore, __spreadProps(__spreadValues({}, props), { renderers: mergedRenderers, onLink })) });
|
|
13896
14152
|
}
|
|
13897
14153
|
var DynamicFlowWise_default = DynamicFlowWise;
|
|
13898
14154
|
|
|
@@ -13901,14 +14157,14 @@ var import_react22 = require("react");
|
|
|
13901
14157
|
|
|
13902
14158
|
// src/common/httpClientContext/HttpClientContext.tsx
|
|
13903
14159
|
var import_react21 = require("react");
|
|
13904
|
-
var
|
|
14160
|
+
var import_jsx_runtime61 = require("react/jsx-runtime");
|
|
13905
14161
|
var HttpClientContext2 = (0, import_react21.createContext)(void 0);
|
|
13906
14162
|
function HttpClientProvider({ httpClient, children }) {
|
|
13907
|
-
return /* @__PURE__ */ (0,
|
|
14163
|
+
return /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(HttpClientContext2.Provider, { value: httpClient, children });
|
|
13908
14164
|
}
|
|
13909
14165
|
function HttpClientProviderFromBaseUrl({ baseUrl, children }) {
|
|
13910
14166
|
const httpClient = (0, import_react21.useMemo)(() => makeHttpClient(baseUrl), [baseUrl]);
|
|
13911
|
-
return /* @__PURE__ */ (0,
|
|
14167
|
+
return /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(HttpClientContext2.Provider, { value: httpClient, children });
|
|
13912
14168
|
}
|
|
13913
14169
|
var useHttpClient = () => {
|
|
13914
14170
|
const contextFetch = (0, import_react21.useContext)(HttpClientContext2);
|
|
@@ -13920,7 +14176,7 @@ var useHasHttpClientProvider = () => {
|
|
|
13920
14176
|
};
|
|
13921
14177
|
|
|
13922
14178
|
// src/revamp/DynamicFragmentWise.tsx
|
|
13923
|
-
var
|
|
14179
|
+
var import_jsx_runtime62 = require("react/jsx-runtime");
|
|
13924
14180
|
var wiseRenderers2 = getWiseRenderers();
|
|
13925
14181
|
var DynamicFragmentWise = (0, import_react22.forwardRef)(function DynamicFragmentWise2(props, ref) {
|
|
13926
14182
|
const {
|
|
@@ -13953,14 +14209,14 @@ var DynamicFragmentWise = (0, import_react22.forwardRef)(function DynamicFragmen
|
|
|
13953
14209
|
() => getRenderFunction([CoreContainerRenderer, ...mergedRenderers, StepRenderer]),
|
|
13954
14210
|
[mergedRenderers]
|
|
13955
14211
|
);
|
|
13956
|
-
return /* @__PURE__ */ (0,
|
|
14212
|
+
return /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
13957
14213
|
ErrorBoundary_default,
|
|
13958
14214
|
{
|
|
13959
14215
|
onError: (error) => {
|
|
13960
14216
|
onEvent == null ? void 0 : onEvent("Dynamic Flow - Failed");
|
|
13961
14217
|
onError(error);
|
|
13962
14218
|
},
|
|
13963
|
-
children: /* @__PURE__ */ (0,
|
|
14219
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(HttpClientProvider, { httpClient, children: stepComponentRef.current ? render(stepComponentRef.current) : null })
|
|
13964
14220
|
}
|
|
13965
14221
|
);
|
|
13966
14222
|
});
|
|
@@ -13968,7 +14224,7 @@ var DynamicFragmentWise_default = DynamicFragmentWise;
|
|
|
13968
14224
|
|
|
13969
14225
|
// src/revamp/DynamicFragmentCore.tsx
|
|
13970
14226
|
var import_react23 = require("react");
|
|
13971
|
-
var
|
|
14227
|
+
var import_jsx_runtime63 = require("react/jsx-runtime");
|
|
13972
14228
|
var DynamicFragmentCore = (0, import_react23.forwardRef)(function DynamicFragmentCore2(props, ref) {
|
|
13973
14229
|
const { onCompletion = () => {
|
|
13974
14230
|
}, onEvent, onError, onLink = openLinkInNewTab, renderers } = props;
|
|
@@ -13992,7 +14248,7 @@ var DynamicFragmentCore = (0, import_react23.forwardRef)(function DynamicFragmen
|
|
|
13992
14248
|
() => getRenderFunction([CoreContainerRenderer, ...renderers]),
|
|
13993
14249
|
[renderers]
|
|
13994
14250
|
);
|
|
13995
|
-
return /* @__PURE__ */ (0,
|
|
14251
|
+
return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
|
|
13996
14252
|
ErrorBoundary_default,
|
|
13997
14253
|
{
|
|
13998
14254
|
onError: (error) => {
|
|
@@ -14333,7 +14589,7 @@ var noop2 = () => {
|
|
|
14333
14589
|
};
|
|
14334
14590
|
|
|
14335
14591
|
// src/legacy/common/contexts/dynamicFlowContexts/DynamicFlowContexts.tsx
|
|
14336
|
-
var
|
|
14592
|
+
var import_jsx_runtime64 = require("react/jsx-runtime");
|
|
14337
14593
|
var defaultContextValue = {
|
|
14338
14594
|
loading: false,
|
|
14339
14595
|
registerPersistAsyncPromise: (promise) => {
|
|
@@ -14348,7 +14604,7 @@ var DynamicFlowProvider = ({ loading, children }) => {
|
|
|
14348
14604
|
registerPersistAsyncPromise: addPendingPromise
|
|
14349
14605
|
};
|
|
14350
14606
|
}, [loading, pendingPromises, addPendingPromise]);
|
|
14351
|
-
return /* @__PURE__ */ (0,
|
|
14607
|
+
return /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(DFContext.Provider, { value: providerValue, children });
|
|
14352
14608
|
};
|
|
14353
14609
|
var useDynamicFlow = () => {
|
|
14354
14610
|
const context = (0, import_react25.useContext)(DFContext);
|
|
@@ -14357,7 +14613,7 @@ var useDynamicFlow = () => {
|
|
|
14357
14613
|
|
|
14358
14614
|
// src/legacy/common/contexts/eventsContext/EventsContext.tsx
|
|
14359
14615
|
var import_react26 = require("react");
|
|
14360
|
-
var
|
|
14616
|
+
var import_jsx_runtime65 = require("react/jsx-runtime");
|
|
14361
14617
|
var EventsContext = (0, import_react26.createContext)({
|
|
14362
14618
|
triggerEvent: () => {
|
|
14363
14619
|
}
|
|
@@ -14367,7 +14623,7 @@ function EventsContextProvider({ metadata, children, onEvent }) {
|
|
|
14367
14623
|
() => ({ triggerEvent: getEventDispatcher(onEvent, metadata) }),
|
|
14368
14624
|
[onEvent, metadata]
|
|
14369
14625
|
);
|
|
14370
|
-
return /* @__PURE__ */ (0,
|
|
14626
|
+
return /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(EventsContext.Provider, { value, children });
|
|
14371
14627
|
}
|
|
14372
14628
|
function useEventDispatcher() {
|
|
14373
14629
|
const { triggerEvent } = (0, import_react26.useContext)(EventsContext);
|
|
@@ -14382,7 +14638,7 @@ var getEventDispatcher = (onEvent, metadata) => (eventName, properties = {}) =>
|
|
|
14382
14638
|
|
|
14383
14639
|
// src/legacy/common/contexts/logContext/LogContext.tsx
|
|
14384
14640
|
var import_react27 = require("react");
|
|
14385
|
-
var
|
|
14641
|
+
var import_jsx_runtime66 = require("react/jsx-runtime");
|
|
14386
14642
|
var getLogger = (level, onLog, flowId = "UNKNOWN-FLOW-ID", stepId = "UNKNOWN-FLOW-ID") => (title, description, extra) => {
|
|
14387
14643
|
try {
|
|
14388
14644
|
onLog(level, `Dynamic Flow ${level} - ${title} - ${description}`, __spreadValues({
|
|
@@ -14404,7 +14660,7 @@ function LogProvider({ flowId, stepId, children, onLog }) {
|
|
|
14404
14660
|
}),
|
|
14405
14661
|
[onLog, flowId, stepId]
|
|
14406
14662
|
);
|
|
14407
|
-
return /* @__PURE__ */ (0,
|
|
14663
|
+
return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(LogContext.Provider, { value, children });
|
|
14408
14664
|
}
|
|
14409
14665
|
var useLogger = () => {
|
|
14410
14666
|
const logging = (0, import_react27.useContext)(LogContext);
|
|
@@ -14418,10 +14674,10 @@ var useLogger = () => {
|
|
|
14418
14674
|
|
|
14419
14675
|
// src/legacy/common/contexts/featureContext/FeatureContext.tsx
|
|
14420
14676
|
var import_react28 = require("react");
|
|
14421
|
-
var
|
|
14677
|
+
var import_jsx_runtime67 = require("react/jsx-runtime");
|
|
14422
14678
|
var FeatureContext = (0, import_react28.createContext)([]);
|
|
14423
14679
|
function FeatureContextProvider({ features, children }) {
|
|
14424
|
-
return /* @__PURE__ */ (0,
|
|
14680
|
+
return /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(FeatureContext.Provider, { value: features, children });
|
|
14425
14681
|
}
|
|
14426
14682
|
|
|
14427
14683
|
// src/common/cameraCapture/utils/mobile-utils.ts
|
|
@@ -15280,29 +15536,29 @@ var Size = {
|
|
|
15280
15536
|
};
|
|
15281
15537
|
|
|
15282
15538
|
// src/legacy/jsonSchemaForm/basicTypeSchema/BasicTypeSchema.tsx
|
|
15283
|
-
var
|
|
15539
|
+
var import_classnames16 = __toESM(require_classnames());
|
|
15284
15540
|
var import_react53 = require("react");
|
|
15285
15541
|
|
|
15286
15542
|
// src/legacy/layout/alert/DynamicAlert.tsx
|
|
15287
|
-
var
|
|
15543
|
+
var import_components44 = require("@transferwise/components");
|
|
15288
15544
|
|
|
15289
15545
|
// src/legacy/layout/utils/getNavigationOptionMedia.tsx
|
|
15290
|
-
var
|
|
15546
|
+
var import_components43 = require("@transferwise/components");
|
|
15291
15547
|
|
|
15292
15548
|
// src/legacy/layout/icon/FlagIcon.tsx
|
|
15293
|
-
var
|
|
15549
|
+
var import_jsx_runtime68 = require("react/jsx-runtime");
|
|
15294
15550
|
var isFlagIcon3 = (name) => name.startsWith("flag-");
|
|
15295
15551
|
function FlagIcon2({ name }) {
|
|
15296
15552
|
if (!isFlagIcon3(name)) {
|
|
15297
15553
|
return null;
|
|
15298
15554
|
}
|
|
15299
15555
|
const code = name.substring(5);
|
|
15300
|
-
return /* @__PURE__ */ (0,
|
|
15556
|
+
return /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(Flag, { intrinsicSize: 24, code });
|
|
15301
15557
|
}
|
|
15302
15558
|
|
|
15303
15559
|
// src/legacy/layout/icon/NamedIcon.tsx
|
|
15304
15560
|
var icons2 = __toESM(require("@transferwise/icons"));
|
|
15305
|
-
var
|
|
15561
|
+
var import_jsx_runtime69 = require("react/jsx-runtime");
|
|
15306
15562
|
var isNamedIcon3 = (name) => {
|
|
15307
15563
|
const iconName = toCapitalisedCamelCase2(name);
|
|
15308
15564
|
return Object.keys(icons2).includes(iconName);
|
|
@@ -15313,19 +15569,19 @@ function NamedIcon2({ name }) {
|
|
|
15313
15569
|
}
|
|
15314
15570
|
const iconName = toCapitalisedCamelCase2(name);
|
|
15315
15571
|
const Icon = icons2[iconName];
|
|
15316
|
-
return /* @__PURE__ */ (0,
|
|
15572
|
+
return /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(Icon, { size: 24 });
|
|
15317
15573
|
}
|
|
15318
15574
|
var toCapitalisedCamelCase2 = (value) => value.split("-").map(capitaliseFirstChar2).join("");
|
|
15319
15575
|
var capitaliseFirstChar2 = (value) => `${value[0].toUpperCase()}${value.slice(1)}`;
|
|
15320
15576
|
|
|
15321
15577
|
// src/legacy/layout/icon/DynamicIcon.tsx
|
|
15322
|
-
var
|
|
15578
|
+
var import_jsx_runtime70 = require("react/jsx-runtime");
|
|
15323
15579
|
function DynamicIcon2({ type }) {
|
|
15324
15580
|
if (isFlagIcon3(type)) {
|
|
15325
|
-
return /* @__PURE__ */ (0,
|
|
15581
|
+
return /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(FlagIcon2, { name: type });
|
|
15326
15582
|
}
|
|
15327
15583
|
if (isNamedIcon3(type)) {
|
|
15328
|
-
return /* @__PURE__ */ (0,
|
|
15584
|
+
return /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(NamedIcon2, { name: type });
|
|
15329
15585
|
}
|
|
15330
15586
|
return null;
|
|
15331
15587
|
}
|
|
@@ -15335,17 +15591,17 @@ function isValidIconName(name) {
|
|
|
15335
15591
|
var DynamicIcon_default2 = DynamicIcon2;
|
|
15336
15592
|
|
|
15337
15593
|
// src/legacy/layout/utils/getNavigationOptionMedia.tsx
|
|
15338
|
-
var
|
|
15594
|
+
var import_jsx_runtime71 = require("react/jsx-runtime");
|
|
15339
15595
|
var getNavigationOptionMedia = ({ icon, image }) => {
|
|
15340
15596
|
if (icon == null ? void 0 : icon.name) {
|
|
15341
|
-
return /* @__PURE__ */ (0,
|
|
15597
|
+
return /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(import_components43.Avatar, { type: import_components43.AvatarType.ICON, children: /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(DynamicIcon_default2, { type: icon.name }) });
|
|
15342
15598
|
}
|
|
15343
15599
|
if (icon == null ? void 0 : icon.text) {
|
|
15344
|
-
return /* @__PURE__ */ (0,
|
|
15600
|
+
return /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(import_components43.Avatar, { type: import_components43.AvatarType.INITIALS, children: icon.text });
|
|
15345
15601
|
}
|
|
15346
15602
|
if (image == null ? void 0 : image.url) {
|
|
15347
15603
|
const { url, text } = image;
|
|
15348
|
-
return /* @__PURE__ */ (0,
|
|
15604
|
+
return /* @__PURE__ */ (0, import_jsx_runtime71.jsx)("img", { src: url, alt: text });
|
|
15349
15605
|
}
|
|
15350
15606
|
return null;
|
|
15351
15607
|
};
|
|
@@ -15381,11 +15637,11 @@ var getTextAlignment2 = (align) => {
|
|
|
15381
15637
|
var getTextAlignmentAndMargin2 = (component) => `${getTextAlignment2(component.align)} ${getMargin2(component.margin)}`;
|
|
15382
15638
|
|
|
15383
15639
|
// src/legacy/layout/alert/DynamicAlert.tsx
|
|
15384
|
-
var
|
|
15640
|
+
var import_jsx_runtime72 = require("react/jsx-runtime");
|
|
15385
15641
|
var DynamicAlert = ({ component: alert, onAction }) => {
|
|
15386
15642
|
const { context, markdown, margin } = alert;
|
|
15387
|
-
return /* @__PURE__ */ (0,
|
|
15388
|
-
|
|
15643
|
+
return /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(
|
|
15644
|
+
import_components44.Alert,
|
|
15389
15645
|
{
|
|
15390
15646
|
type: mapContextToAlertType(legacy_mapContext(context)),
|
|
15391
15647
|
className: getMargin2(margin),
|
|
@@ -15468,12 +15724,12 @@ var mapContextToAlertType = (context) => {
|
|
|
15468
15724
|
var DynamicAlert_default = DynamicAlert;
|
|
15469
15725
|
|
|
15470
15726
|
// src/legacy/layout/box/DynamicBox.tsx
|
|
15471
|
-
var
|
|
15727
|
+
var import_jsx_runtime73 = require("react/jsx-runtime");
|
|
15472
15728
|
var DynamicBox = (props) => {
|
|
15473
15729
|
const box = props.component;
|
|
15474
15730
|
const margin = getMargin2(box.margin || box.border ? "lg" : "xs");
|
|
15475
15731
|
if (!box.width || box.width === "xl") {
|
|
15476
|
-
return /* @__PURE__ */ (0,
|
|
15732
|
+
return /* @__PURE__ */ (0, import_jsx_runtime73.jsx)("div", { className: margin + getBorderClass(box.border), children: /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(
|
|
15477
15733
|
DynamicLayout_default,
|
|
15478
15734
|
{
|
|
15479
15735
|
components: box.components,
|
|
@@ -15486,7 +15742,7 @@ var DynamicBox = (props) => {
|
|
|
15486
15742
|
}
|
|
15487
15743
|
) });
|
|
15488
15744
|
}
|
|
15489
|
-
return /* @__PURE__ */ (0,
|
|
15745
|
+
return /* @__PURE__ */ (0, import_jsx_runtime73.jsx)("div", { className: "row", children: /* @__PURE__ */ (0, import_jsx_runtime73.jsx)("div", { className: margin + getBoxWidthClasses(box), children: /* @__PURE__ */ (0, import_jsx_runtime73.jsx)("div", { className: getBorderClass(box.border), children: /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(
|
|
15490
15746
|
DynamicLayout_default,
|
|
15491
15747
|
{
|
|
15492
15748
|
components: box.components,
|
|
@@ -15520,7 +15776,7 @@ var getBoxWidthClasses = (component) => {
|
|
|
15520
15776
|
var DynamicBox_default = DynamicBox;
|
|
15521
15777
|
|
|
15522
15778
|
// src/legacy/layout/button/DynamicButton.tsx
|
|
15523
|
-
var
|
|
15779
|
+
var import_components45 = require("@transferwise/components");
|
|
15524
15780
|
|
|
15525
15781
|
// src/legacy/layout/button/utils.ts
|
|
15526
15782
|
var priorities = {
|
|
@@ -15572,9 +15828,9 @@ var getButtonSize = (size2) => {
|
|
|
15572
15828
|
};
|
|
15573
15829
|
|
|
15574
15830
|
// src/legacy/layout/button/DynamicButton.tsx
|
|
15575
|
-
var
|
|
15831
|
+
var import_jsx_runtime74 = require("react/jsx-runtime");
|
|
15576
15832
|
function DynamicButton(props) {
|
|
15577
|
-
return props.component.behavior ? /* @__PURE__ */ (0,
|
|
15833
|
+
return props.component.behavior ? /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(DynamicButtonWithBehavior, __spreadValues({}, props)) : /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(DynamicButtonWithoutBehavior, __spreadValues({}, props));
|
|
15578
15834
|
}
|
|
15579
15835
|
function DynamicButtonWithoutBehavior(props) {
|
|
15580
15836
|
var _a, _b;
|
|
@@ -15591,8 +15847,8 @@ function DynamicButtonWithoutBehavior(props) {
|
|
|
15591
15847
|
onAction(componentAction);
|
|
15592
15848
|
}
|
|
15593
15849
|
};
|
|
15594
|
-
return /* @__PURE__ */ (0,
|
|
15595
|
-
|
|
15850
|
+
return /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(
|
|
15851
|
+
import_components45.Button,
|
|
15596
15852
|
{
|
|
15597
15853
|
size: getButtonSize(component.size),
|
|
15598
15854
|
type: priority === "tertiary" ? void 0 : type,
|
|
@@ -15643,8 +15899,8 @@ function DynamicButtonWithBehavior(props) {
|
|
|
15643
15899
|
}
|
|
15644
15900
|
}
|
|
15645
15901
|
};
|
|
15646
|
-
return /* @__PURE__ */ (0,
|
|
15647
|
-
|
|
15902
|
+
return /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(
|
|
15903
|
+
import_components45.Button,
|
|
15648
15904
|
{
|
|
15649
15905
|
size: getButtonSize(component.size),
|
|
15650
15906
|
type: priority === "tertiary" ? void 0 : type,
|
|
@@ -15660,12 +15916,12 @@ function DynamicButtonWithBehavior(props) {
|
|
|
15660
15916
|
var DynamicButton_default = DynamicButton;
|
|
15661
15917
|
|
|
15662
15918
|
// src/legacy/layout/columns/DynamicColumns.tsx
|
|
15663
|
-
var
|
|
15919
|
+
var import_jsx_runtime75 = require("react/jsx-runtime");
|
|
15664
15920
|
var DynamicColumns = (props) => {
|
|
15665
15921
|
const columns = props.component;
|
|
15666
15922
|
const { leftWidth, rightWidth } = getWidth(columns.bias);
|
|
15667
|
-
return /* @__PURE__ */ (0,
|
|
15668
|
-
/* @__PURE__ */ (0,
|
|
15923
|
+
return /* @__PURE__ */ (0, import_jsx_runtime75.jsxs)("div", { className: `${getMargin2(columns.margin || "xs")} row`, children: [
|
|
15924
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)("div", { className: `${leftWidth} m-b-0`, children: /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
|
|
15669
15925
|
DynamicLayout_default,
|
|
15670
15926
|
{
|
|
15671
15927
|
components: columns.left,
|
|
@@ -15677,7 +15933,7 @@ var DynamicColumns = (props) => {
|
|
|
15677
15933
|
onPersistAsync: props.onPersistAsync
|
|
15678
15934
|
}
|
|
15679
15935
|
) }),
|
|
15680
|
-
/* @__PURE__ */ (0,
|
|
15936
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)("div", { className: `${rightWidth} m-b-0`, children: /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
|
|
15681
15937
|
DynamicLayout_default,
|
|
15682
15938
|
{
|
|
15683
15939
|
components: columns.right,
|
|
@@ -15712,15 +15968,15 @@ var getWidth = (bias) => {
|
|
|
15712
15968
|
var DynamicColumns_default = DynamicColumns;
|
|
15713
15969
|
|
|
15714
15970
|
// src/legacy/layout/decision/DynamicDecision.tsx
|
|
15715
|
-
var
|
|
15716
|
-
var
|
|
15971
|
+
var import_components46 = require("@transferwise/components");
|
|
15972
|
+
var import_jsx_runtime76 = require("react/jsx-runtime");
|
|
15717
15973
|
function DynamicDecision({ component, onAction }) {
|
|
15718
15974
|
const { loading } = useDynamicFlow();
|
|
15719
15975
|
const { margin, options, title } = component;
|
|
15720
|
-
return /* @__PURE__ */ (0,
|
|
15721
|
-
title && /* @__PURE__ */ (0,
|
|
15722
|
-
/* @__PURE__ */ (0,
|
|
15723
|
-
|
|
15976
|
+
return /* @__PURE__ */ (0, import_jsx_runtime76.jsxs)("div", { className: getMargin2(margin), children: [
|
|
15977
|
+
title && /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(import_components46.Header, { as: "h2", title }),
|
|
15978
|
+
/* @__PURE__ */ (0, import_jsx_runtime76.jsx)(import_components46.NavigationOptionsList, { children: options.map((option) => /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(
|
|
15979
|
+
import_components46.NavigationOption,
|
|
15724
15980
|
{
|
|
15725
15981
|
title: option.title,
|
|
15726
15982
|
content: option.description,
|
|
@@ -15737,16 +15993,16 @@ function DynamicDecision({ component, onAction }) {
|
|
|
15737
15993
|
var DynamicDecision_default = DynamicDecision;
|
|
15738
15994
|
|
|
15739
15995
|
// src/legacy/layout/divider/DynamicDivider.tsx
|
|
15740
|
-
var
|
|
15996
|
+
var import_jsx_runtime77 = require("react/jsx-runtime");
|
|
15741
15997
|
var DynamicDivider = ({ component }) => {
|
|
15742
15998
|
const margin = getMargin2(component.margin);
|
|
15743
15999
|
const className = `m-t-0 ${margin}`;
|
|
15744
|
-
return /* @__PURE__ */ (0,
|
|
16000
|
+
return /* @__PURE__ */ (0, import_jsx_runtime77.jsx)("hr", { className });
|
|
15745
16001
|
};
|
|
15746
16002
|
var DynamicDivider_default = DynamicDivider;
|
|
15747
16003
|
|
|
15748
16004
|
// src/legacy/layout/external/DynamicExternal.tsx
|
|
15749
|
-
var
|
|
16005
|
+
var import_components47 = require("@transferwise/components");
|
|
15750
16006
|
var import_react32 = require("react");
|
|
15751
16007
|
var import_react_intl24 = require("react-intl");
|
|
15752
16008
|
|
|
@@ -15761,7 +16017,7 @@ var DynamicExternal_messages_default = (0, import_react_intl23.defineMessages)({
|
|
|
15761
16017
|
});
|
|
15762
16018
|
|
|
15763
16019
|
// src/legacy/layout/external/DynamicExternal.tsx
|
|
15764
|
-
var
|
|
16020
|
+
var import_jsx_runtime78 = require("react/jsx-runtime");
|
|
15765
16021
|
var DynamicExternal = ({ component, onAction }) => {
|
|
15766
16022
|
const { requestUrl, responseHandlers, polling, retryTitle } = component;
|
|
15767
16023
|
const intl = (0, import_react_intl24.useIntl)();
|
|
@@ -15778,10 +16034,10 @@ var DynamicExternal = ({ component, onAction }) => {
|
|
|
15778
16034
|
}) : void 0;
|
|
15779
16035
|
}, [polling, responseHandlers]);
|
|
15780
16036
|
useExternalStepPolling(pollingConfiguration, onAction);
|
|
15781
|
-
return /* @__PURE__ */ (0,
|
|
15782
|
-
/* @__PURE__ */ (0,
|
|
15783
|
-
/* @__PURE__ */ (0,
|
|
15784
|
-
/* @__PURE__ */ (0,
|
|
16037
|
+
return /* @__PURE__ */ (0, import_jsx_runtime78.jsxs)(import_jsx_runtime78.Fragment, { children: [
|
|
16038
|
+
/* @__PURE__ */ (0, import_jsx_runtime78.jsx)(import_components47.Loader, { size: import_components47.Size.LARGE, classNames: { "tw-loader": "tw-loader m-x-auto" } }),
|
|
16039
|
+
/* @__PURE__ */ (0, import_jsx_runtime78.jsx)("br", {}),
|
|
16040
|
+
/* @__PURE__ */ (0, import_jsx_runtime78.jsx)(import_components47.Button, { priority: "tertiary", block: true, onClick: openExternalUrl, children: retryTitle || intl.formatMessage(DynamicExternal_messages_default.retryTitle) })
|
|
15785
16041
|
] });
|
|
15786
16042
|
};
|
|
15787
16043
|
var DynamicExternal_default = DynamicExternal;
|
|
@@ -15790,10 +16046,10 @@ var DynamicExternal_default = DynamicExternal;
|
|
|
15790
16046
|
var import_react46 = require("react");
|
|
15791
16047
|
|
|
15792
16048
|
// src/legacy/jsonSchemaForm/allOfSchema/AllOfSchema.tsx
|
|
15793
|
-
var
|
|
15794
|
-
var
|
|
16049
|
+
var import_components48 = require("@transferwise/components");
|
|
16050
|
+
var import_classnames7 = __toESM(require_classnames());
|
|
15795
16051
|
var import_react33 = require("react");
|
|
15796
|
-
var
|
|
16052
|
+
var import_jsx_runtime79 = require("react/jsx-runtime");
|
|
15797
16053
|
var splitModel = (model, schemas) => schemas.map((schema) => getValidObjectModelParts(model, schema) || {});
|
|
15798
16054
|
var combineModels = (models) => models.reduce((current, combined) => __spreadValues(__spreadValues({}, combined), current), {});
|
|
15799
16055
|
var getSchemaColumnClasses = (width) => ({
|
|
@@ -15810,12 +16066,12 @@ function AllOfSchema(props) {
|
|
|
15810
16066
|
props.onChange(__spreadProps(__spreadValues({}, onChangeProps), { model: combineModels(models) }));
|
|
15811
16067
|
};
|
|
15812
16068
|
const [models, setModels] = (0, import_react33.useState)(splitModel(props.model, props.schema.allOf));
|
|
15813
|
-
return /* @__PURE__ */ (0,
|
|
15814
|
-
props.schema.title && !hideTitle && /* @__PURE__ */ (0,
|
|
15815
|
-
props.schema.description && /* @__PURE__ */ (0,
|
|
15816
|
-
/* @__PURE__ */ (0,
|
|
16069
|
+
return /* @__PURE__ */ (0, import_jsx_runtime79.jsxs)(import_jsx_runtime79.Fragment, { children: [
|
|
16070
|
+
props.schema.title && !hideTitle && /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(import_components48.Header, { title: props.schema.title }),
|
|
16071
|
+
props.schema.description && /* @__PURE__ */ (0, import_jsx_runtime79.jsx)("p", { children: props.schema.description }),
|
|
16072
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsx)("div", { className: "row", children: props.schema.allOf.map((schema, index) => (
|
|
15817
16073
|
// eslint-disable-next-line react/no-array-index-key
|
|
15818
|
-
/* @__PURE__ */ (0,
|
|
16074
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsx)("div", { className: (0, import_classnames7.default)(getSchemaColumnClasses(schema.width)), children: /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
|
|
15819
16075
|
GenericSchema_default,
|
|
15820
16076
|
{
|
|
15821
16077
|
schema,
|
|
@@ -15836,15 +16092,15 @@ function AllOfSchema(props) {
|
|
|
15836
16092
|
var AllOfSchema_default = AllOfSchema;
|
|
15837
16093
|
|
|
15838
16094
|
// src/legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/MultipleFileUploadSchema.tsx
|
|
15839
|
-
var
|
|
15840
|
-
var
|
|
16095
|
+
var import_components50 = require("@transferwise/components");
|
|
16096
|
+
var import_classnames8 = __toESM(require_classnames());
|
|
15841
16097
|
var import_react34 = require("react");
|
|
15842
16098
|
|
|
15843
16099
|
// src/legacy/jsonSchemaForm/controlFeedback/ControlFeedback.tsx
|
|
15844
|
-
var
|
|
16100
|
+
var import_components49 = require("@transferwise/components");
|
|
15845
16101
|
var import_formatting2 = require("@transferwise/formatting");
|
|
15846
16102
|
var import_react_intl25 = require("react-intl");
|
|
15847
|
-
var
|
|
16103
|
+
var import_jsx_runtime80 = require("react/jsx-runtime");
|
|
15848
16104
|
function ControlFeedback(props) {
|
|
15849
16105
|
const { errors = "", validations = [], validationMessages = {} } = props;
|
|
15850
16106
|
const defaultValidationMessages = useDefaultValidationMessages(props.schema);
|
|
@@ -15853,12 +16109,12 @@ function ControlFeedback(props) {
|
|
|
15853
16109
|
const isValidationVisible = !isErrorVisible && (props.submitted || props.changed && props.blurred) && Boolean(validations == null ? void 0 : validations.length);
|
|
15854
16110
|
const isDescriptionVisible = props.schema.type !== "boolean" && props.schema.description && !isErrorVisible && !isValidationVisible;
|
|
15855
16111
|
const hasInfoMessage = Boolean(props.infoMessage);
|
|
15856
|
-
return /* @__PURE__ */ (0,
|
|
15857
|
-
isErrorVisible ? /* @__PURE__ */ (0,
|
|
15858
|
-
isValidationVisible ? /* @__PURE__ */ (0,
|
|
15859
|
-
(isDescriptionVisible || hasInfoMessage) && /* @__PURE__ */ (0,
|
|
15860
|
-
isDescriptionVisible && /* @__PURE__ */ (0,
|
|
15861
|
-
hasInfoMessage && /* @__PURE__ */ (0,
|
|
16112
|
+
return /* @__PURE__ */ (0, import_jsx_runtime80.jsxs)("div", { id: props.id, children: [
|
|
16113
|
+
isErrorVisible ? /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(import_components49.InlineAlert, { type: "error", children: errors }) : null,
|
|
16114
|
+
isValidationVisible ? /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(import_components49.InlineAlert, { type: "error", children: validations.map((validation) => /* @__PURE__ */ (0, import_jsx_runtime80.jsx)("div", { children: mergedValidationMessages[validation] }, validation)) }) : null,
|
|
16115
|
+
(isDescriptionVisible || hasInfoMessage) && /* @__PURE__ */ (0, import_jsx_runtime80.jsxs)(import_components49.InlineAlert, { type: "info", children: [
|
|
16116
|
+
isDescriptionVisible && /* @__PURE__ */ (0, import_jsx_runtime80.jsx)("div", { children: props.schema.description }),
|
|
16117
|
+
hasInfoMessage && /* @__PURE__ */ (0, import_jsx_runtime80.jsx)("div", { children: props.infoMessage })
|
|
15862
16118
|
] })
|
|
15863
16119
|
] });
|
|
15864
16120
|
}
|
|
@@ -15978,7 +16234,7 @@ function useFormattedDefaultErrorMessages({
|
|
|
15978
16234
|
}
|
|
15979
16235
|
|
|
15980
16236
|
// src/legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/MultipleFileUploadSchema.tsx
|
|
15981
|
-
var
|
|
16237
|
+
var import_jsx_runtime81 = require("react/jsx-runtime");
|
|
15982
16238
|
function MultipleFileUploadSchema(props) {
|
|
15983
16239
|
var _a, _b;
|
|
15984
16240
|
const { onChange, errors = null, schema, required = false } = props;
|
|
@@ -16039,10 +16295,10 @@ function MultipleFileUploadSchema(props) {
|
|
|
16039
16295
|
onDeleteFile: () => Promise.resolve()
|
|
16040
16296
|
});
|
|
16041
16297
|
const feedbackId = `${uid}-feedback`;
|
|
16042
|
-
return /* @__PURE__ */ (0,
|
|
16043
|
-
/* @__PURE__ */ (0,
|
|
16044
|
-
/* @__PURE__ */ (0,
|
|
16045
|
-
/* @__PURE__ */ (0,
|
|
16298
|
+
return /* @__PURE__ */ (0, import_jsx_runtime81.jsxs)("div", { className: (0, import_classnames8.default)("form-group", { "has-error": showError }), children: [
|
|
16299
|
+
/* @__PURE__ */ (0, import_jsx_runtime81.jsx)("label", { className: "d-block control-label", htmlFor: uid, children: props.schema.title }),
|
|
16300
|
+
/* @__PURE__ */ (0, import_jsx_runtime81.jsx)("div", { "aria-describedby": feedbackId, children: /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(import_components50.UploadInput, __spreadValues({}, uploadInputProps)) }),
|
|
16301
|
+
/* @__PURE__ */ (0, import_jsx_runtime81.jsx)(
|
|
16046
16302
|
ControlFeedback_default,
|
|
16047
16303
|
{
|
|
16048
16304
|
id: feedbackId,
|
|
@@ -16064,7 +16320,7 @@ function getSuccessfullyProcessedFiles(allFiles) {
|
|
|
16064
16320
|
return allFiles.filter((file) => !file.error && file.status === "succeeded");
|
|
16065
16321
|
}
|
|
16066
16322
|
function convertFileIdsToComponentFileObjects(fileIds) {
|
|
16067
|
-
return fileIds.map((id) => isValidId(id) ? { id, status:
|
|
16323
|
+
return fileIds.map((id) => isValidId(id) ? { id, status: import_components50.Status.SUCCEEDED } : null).filter((item) => item !== null);
|
|
16068
16324
|
}
|
|
16069
16325
|
function isValidId(id) {
|
|
16070
16326
|
return isNumber3(id) || isString2(id);
|
|
@@ -16075,14 +16331,14 @@ function getValidationMessages(schema, required, defaultErrorMessages) {
|
|
|
16075
16331
|
}
|
|
16076
16332
|
|
|
16077
16333
|
// src/legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multiSelectSchema/MultiSelectSchema.tsx
|
|
16078
|
-
var
|
|
16079
|
-
var
|
|
16334
|
+
var import_components52 = require("@transferwise/components");
|
|
16335
|
+
var import_classnames9 = __toESM(require_classnames());
|
|
16080
16336
|
var import_react35 = require("react");
|
|
16081
16337
|
var import_react_intl29 = require("react-intl");
|
|
16082
16338
|
|
|
16083
16339
|
// src/legacy/jsonSchemaForm/schemaFormControl/utils/mapping-utils.tsx
|
|
16084
|
-
var
|
|
16085
|
-
var
|
|
16340
|
+
var import_components51 = require("@transferwise/components");
|
|
16341
|
+
var import_jsx_runtime82 = require("react/jsx-runtime");
|
|
16086
16342
|
var mapConstSchemaToOption = (schema, controlType) => {
|
|
16087
16343
|
switch (controlType) {
|
|
16088
16344
|
case "select":
|
|
@@ -16106,7 +16362,7 @@ var mapKeywordsToSearchStrings = (searchStrings) => isArray2(searchStrings) ? {
|
|
|
16106
16362
|
var mapImage = (image) => {
|
|
16107
16363
|
if (image == null ? void 0 : image.url) {
|
|
16108
16364
|
return {
|
|
16109
|
-
icon: /* @__PURE__ */ (0,
|
|
16365
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime82.jsx)("div", { className: "media", children: /* @__PURE__ */ (0, import_jsx_runtime82.jsx)("div", { className: "np-option__no-media-circle", children: /* @__PURE__ */ (0, import_jsx_runtime82.jsx)("img", { src: image.url, alt: image.name || "" }) }) }),
|
|
16110
16366
|
hideIconInTrigger: true
|
|
16111
16367
|
};
|
|
16112
16368
|
}
|
|
@@ -16115,17 +16371,17 @@ var mapImage = (image) => {
|
|
|
16115
16371
|
var getIconPropertyForSelectOption = (icon) => {
|
|
16116
16372
|
if ((icon == null ? void 0 : icon.name) && isFlagIcon3(icon.name)) {
|
|
16117
16373
|
return {
|
|
16118
|
-
icon: /* @__PURE__ */ (0,
|
|
16374
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(Flag, { code: icon.name.substring(5), intrinsicSize: 24 })
|
|
16119
16375
|
};
|
|
16120
16376
|
}
|
|
16121
16377
|
if ((icon == null ? void 0 : icon.name) && isValidIconName(icon.name)) {
|
|
16122
16378
|
return {
|
|
16123
|
-
icon: /* @__PURE__ */ (0,
|
|
16379
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(DynamicIcon_default2, { type: icon.name })
|
|
16124
16380
|
};
|
|
16125
16381
|
}
|
|
16126
16382
|
if (icon == null ? void 0 : icon.text) {
|
|
16127
16383
|
return {
|
|
16128
|
-
icon: /* @__PURE__ */ (0,
|
|
16384
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime82.jsx)("span", { children: icon.text })
|
|
16129
16385
|
};
|
|
16130
16386
|
}
|
|
16131
16387
|
return null;
|
|
@@ -16133,17 +16389,17 @@ var getIconPropertyForSelectOption = (icon) => {
|
|
|
16133
16389
|
var getAvatarPropertyForRadioOption = ({ image, icon }) => {
|
|
16134
16390
|
if (image == null ? void 0 : image.url) {
|
|
16135
16391
|
return {
|
|
16136
|
-
avatar: /* @__PURE__ */ (0,
|
|
16392
|
+
avatar: /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(import_components51.Avatar, { type: import_components51.AvatarType.THUMBNAIL, children: /* @__PURE__ */ (0, import_jsx_runtime82.jsx)("img", { src: image.url, alt: "" }) })
|
|
16137
16393
|
};
|
|
16138
16394
|
}
|
|
16139
16395
|
if ((icon == null ? void 0 : icon.name) && isValidIconName(icon.name)) {
|
|
16140
16396
|
return {
|
|
16141
|
-
avatar: /* @__PURE__ */ (0,
|
|
16397
|
+
avatar: /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(import_components51.Avatar, { type: import_components51.AvatarType.ICON, children: /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(DynamicIcon_default2, { type: icon.name }) })
|
|
16142
16398
|
};
|
|
16143
16399
|
}
|
|
16144
16400
|
if (icon == null ? void 0 : icon.text) {
|
|
16145
16401
|
return {
|
|
16146
|
-
avatar: /* @__PURE__ */ (0,
|
|
16402
|
+
avatar: /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(import_components51.Avatar, { type: import_components51.AvatarType.INITIALS, children: icon.text })
|
|
16147
16403
|
};
|
|
16148
16404
|
}
|
|
16149
16405
|
return null;
|
|
@@ -16182,7 +16438,7 @@ var multi_select_messages_default2 = (0, import_react_intl28.defineMessages)({
|
|
|
16182
16438
|
});
|
|
16183
16439
|
|
|
16184
16440
|
// src/legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multiSelectSchema/MultiSelectSchema.tsx
|
|
16185
|
-
var
|
|
16441
|
+
var import_jsx_runtime83 = require("react/jsx-runtime");
|
|
16186
16442
|
function MultiSelectSchema({
|
|
16187
16443
|
schema,
|
|
16188
16444
|
model,
|
|
@@ -16236,10 +16492,10 @@ function MultiSelectSchema({
|
|
|
16236
16492
|
"has-error": shouldShowInitialError || shouldShowValidationError,
|
|
16237
16493
|
"has-info": !!schema.description
|
|
16238
16494
|
};
|
|
16239
|
-
return /* @__PURE__ */ (0,
|
|
16240
|
-
schema.title ? /* @__PURE__ */ (0,
|
|
16241
|
-
/* @__PURE__ */ (0,
|
|
16242
|
-
|
|
16495
|
+
return /* @__PURE__ */ (0, import_jsx_runtime83.jsxs)("div", { className: (0, import_classnames9.default)("d-flex flex-column", formGroupClasses), children: [
|
|
16496
|
+
schema.title ? /* @__PURE__ */ (0, import_jsx_runtime83.jsx)("label", { className: "control-label d-inline m-b-1", htmlFor: id, children: schema.title }) : void 0,
|
|
16497
|
+
/* @__PURE__ */ (0, import_jsx_runtime83.jsx)(
|
|
16498
|
+
import_components52.SelectInput,
|
|
16243
16499
|
{
|
|
16244
16500
|
id,
|
|
16245
16501
|
multiple: true,
|
|
@@ -16264,12 +16520,12 @@ function MultiSelectSchema({
|
|
|
16264
16520
|
if (withinTrigger) {
|
|
16265
16521
|
return selected && index === selected[0] ? getFormattedMessage() : void 0;
|
|
16266
16522
|
}
|
|
16267
|
-
return /* @__PURE__ */ (0,
|
|
16523
|
+
return /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(import_components52.SelectInputOptionContent, { title: label, note: note != null ? note : secondary, icon });
|
|
16268
16524
|
},
|
|
16269
16525
|
onChange: broadcastModelChange
|
|
16270
16526
|
}
|
|
16271
16527
|
),
|
|
16272
|
-
/* @__PURE__ */ (0,
|
|
16528
|
+
/* @__PURE__ */ (0, import_jsx_runtime83.jsx)(
|
|
16273
16529
|
ControlFeedback_default,
|
|
16274
16530
|
{
|
|
16275
16531
|
id: `${id}-feedback`,
|
|
@@ -16294,17 +16550,17 @@ var getInitialModelIndices2 = (model, options) => {
|
|
|
16294
16550
|
};
|
|
16295
16551
|
|
|
16296
16552
|
// src/legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/repeatableSchema/RepeatableSchema.tsx
|
|
16297
|
-
var
|
|
16553
|
+
var import_components54 = require("@transferwise/components");
|
|
16298
16554
|
var import_icons4 = require("@transferwise/icons");
|
|
16299
16555
|
var import_react37 = require("react");
|
|
16300
16556
|
var import_react_intl32 = require("react-intl");
|
|
16301
16557
|
|
|
16302
16558
|
// src/legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/repeatableSchema/ItemSummary.tsx
|
|
16303
|
-
var
|
|
16304
|
-
var
|
|
16559
|
+
var import_components53 = require("@transferwise/components");
|
|
16560
|
+
var import_jsx_runtime84 = require("react/jsx-runtime");
|
|
16305
16561
|
function ItemSummaryOption2({ item, onClick }) {
|
|
16306
|
-
return /* @__PURE__ */ (0,
|
|
16307
|
-
|
|
16562
|
+
return /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(
|
|
16563
|
+
import_components53.NavigationOption,
|
|
16308
16564
|
{
|
|
16309
16565
|
media: getNavigationOptionMedia(item),
|
|
16310
16566
|
title: item.title,
|
|
@@ -16343,7 +16599,7 @@ var repeatable_messages_default2 = (0, import_react_intl30.defineMessages)({
|
|
|
16343
16599
|
// src/legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/repeatableSchema/RepeatableSchemaStep.tsx
|
|
16344
16600
|
var import_react36 = require("react");
|
|
16345
16601
|
var import_react_intl31 = require("react-intl");
|
|
16346
|
-
var
|
|
16602
|
+
var import_jsx_runtime85 = require("react/jsx-runtime");
|
|
16347
16603
|
function RepeatableSchemaStep({
|
|
16348
16604
|
type,
|
|
16349
16605
|
schema,
|
|
@@ -16391,7 +16647,7 @@ function RepeatableSchemaStep({
|
|
|
16391
16647
|
}
|
|
16392
16648
|
onModelChange(__spreadProps(__spreadValues({}, modelChangeProps), { model: model2 }));
|
|
16393
16649
|
};
|
|
16394
|
-
return /* @__PURE__ */ (0,
|
|
16650
|
+
return /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
|
|
16395
16651
|
DynamicFlowStep,
|
|
16396
16652
|
{
|
|
16397
16653
|
step,
|
|
@@ -16596,8 +16852,8 @@ var schemaSummaryProvides = (summary, providesProp) => (
|
|
|
16596
16852
|
);
|
|
16597
16853
|
|
|
16598
16854
|
// src/legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/repeatableSchema/RepeatableSchema.tsx
|
|
16599
|
-
var
|
|
16600
|
-
var
|
|
16855
|
+
var import_classnames10 = __toESM(require_classnames());
|
|
16856
|
+
var import_jsx_runtime86 = require("react/jsx-runtime");
|
|
16601
16857
|
function RepeatableSchema({
|
|
16602
16858
|
schema,
|
|
16603
16859
|
model,
|
|
@@ -16674,9 +16930,9 @@ function RepeatableSchema({
|
|
|
16674
16930
|
const formGroupClasses = {
|
|
16675
16931
|
"has-error": (_a = errors && !isEmpty(errors)) != null ? _a : submitted && validations.length
|
|
16676
16932
|
};
|
|
16677
|
-
return /* @__PURE__ */ (0,
|
|
16678
|
-
schema.title && /* @__PURE__ */ (0,
|
|
16679
|
-
itemSummaries == null ? void 0 : itemSummaries.map((itemSummary) => /* @__PURE__ */ (0,
|
|
16933
|
+
return /* @__PURE__ */ (0, import_jsx_runtime86.jsxs)("div", { id, className: (0, import_classnames10.default)(formGroupClasses), children: [
|
|
16934
|
+
schema.title && /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(import_components54.Header, { title: schema.title }),
|
|
16935
|
+
itemSummaries == null ? void 0 : itemSummaries.map((itemSummary) => /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
|
|
16680
16936
|
ItemSummaryOption2,
|
|
16681
16937
|
{
|
|
16682
16938
|
item: itemSummary,
|
|
@@ -16684,21 +16940,21 @@ function RepeatableSchema({
|
|
|
16684
16940
|
},
|
|
16685
16941
|
JSON.stringify(itemSummary)
|
|
16686
16942
|
)),
|
|
16687
|
-
/* @__PURE__ */ (0,
|
|
16688
|
-
|
|
16943
|
+
/* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
|
|
16944
|
+
import_components54.NavigationOption,
|
|
16689
16945
|
{
|
|
16690
|
-
media: /* @__PURE__ */ (0,
|
|
16946
|
+
media: /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(import_icons4.Plus, {}),
|
|
16691
16947
|
title: schema.addItemTitle || formatMessage(repeatable_messages_default2.addItemTitle),
|
|
16692
16948
|
showMediaAtAllSizes: true,
|
|
16693
16949
|
onClick: onAddItem
|
|
16694
16950
|
}
|
|
16695
16951
|
),
|
|
16696
|
-
/* @__PURE__ */ (0,
|
|
16697
|
-
|
|
16952
|
+
/* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
|
|
16953
|
+
import_components54.Modal,
|
|
16698
16954
|
{
|
|
16699
16955
|
open: openModalType !== null,
|
|
16700
16956
|
title: (openModalType === "add" ? schema.addItemTitle : schema.editItemTitle) || formatMessage(repeatable_messages_default2.addItemTitle),
|
|
16701
|
-
body: /* @__PURE__ */ (0,
|
|
16957
|
+
body: /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
|
|
16702
16958
|
RepeatableSchemaStep_default,
|
|
16703
16959
|
{
|
|
16704
16960
|
type: openModalType != null ? openModalType : "add",
|
|
@@ -16713,7 +16969,7 @@ function RepeatableSchema({
|
|
|
16713
16969
|
onClose: onCancelEdit
|
|
16714
16970
|
}
|
|
16715
16971
|
),
|
|
16716
|
-
/* @__PURE__ */ (0,
|
|
16972
|
+
/* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
|
|
16717
16973
|
ControlFeedback_default,
|
|
16718
16974
|
{
|
|
16719
16975
|
id: `${id}-feedback`,
|
|
@@ -16755,38 +17011,38 @@ var getUpdatedItemSummaries = (action, {
|
|
|
16755
17011
|
var RepeatableSchema_default = RepeatableSchema;
|
|
16756
17012
|
|
|
16757
17013
|
// src/legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/ArrayListSchema.tsx
|
|
16758
|
-
var
|
|
17014
|
+
var import_jsx_runtime87 = require("react/jsx-runtime");
|
|
16759
17015
|
function ArrayListSchema(props) {
|
|
16760
17016
|
const { errors = null, schema } = props;
|
|
16761
17017
|
if (isMultipleFileUploadSchema(schema)) {
|
|
16762
|
-
return /* @__PURE__ */ (0,
|
|
17018
|
+
return /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(MultipleFileUploadSchema_default, __spreadProps(__spreadValues({}, props), { errors, schema }));
|
|
16763
17019
|
}
|
|
16764
17020
|
if (isMultiSelectConstSchema(schema)) {
|
|
16765
|
-
return /* @__PURE__ */ (0,
|
|
17021
|
+
return /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(MultiSelectSchema, __spreadProps(__spreadValues({}, props), { errors, schema }));
|
|
16766
17022
|
}
|
|
16767
17023
|
if (isListArraySchema(schema)) {
|
|
16768
|
-
return /* @__PURE__ */ (0,
|
|
17024
|
+
return /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(RepeatableSchema_default, __spreadProps(__spreadValues({}, props), { errors, schema }));
|
|
16769
17025
|
}
|
|
16770
17026
|
throw new Error("Invalid array list schema");
|
|
16771
17027
|
}
|
|
16772
17028
|
var ArrayListSchema_default = ArrayListSchema;
|
|
16773
17029
|
|
|
16774
17030
|
// src/legacy/jsonSchemaForm/arrayTypeSchema/ArraySchema.tsx
|
|
16775
|
-
var
|
|
17031
|
+
var import_jsx_runtime88 = require("react/jsx-runtime");
|
|
16776
17032
|
var ArraySchema = (props) => {
|
|
16777
17033
|
const { schema } = props;
|
|
16778
17034
|
if (isListArraySchema(schema)) {
|
|
16779
|
-
return /* @__PURE__ */ (0,
|
|
17035
|
+
return /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(ArrayListSchema_default, __spreadValues({}, props));
|
|
16780
17036
|
}
|
|
16781
17037
|
throw new Error("Not implemented");
|
|
16782
17038
|
};
|
|
16783
17039
|
var ArraySchema_default = ArraySchema;
|
|
16784
17040
|
|
|
16785
17041
|
// src/legacy/jsonSchemaForm/objectSchema/ObjectSchema.tsx
|
|
16786
|
-
var
|
|
16787
|
-
var
|
|
17042
|
+
var import_components55 = require("@transferwise/components");
|
|
17043
|
+
var import_classnames11 = __toESM(require_classnames());
|
|
16788
17044
|
var import_react38 = require("react");
|
|
16789
|
-
var
|
|
17045
|
+
var import_jsx_runtime89 = require("react/jsx-runtime");
|
|
16790
17046
|
var getSchemaColumnClasses2 = (width) => ({
|
|
16791
17047
|
"col-xs-12": true,
|
|
16792
17048
|
"col-sm-6": width === "md",
|
|
@@ -16823,22 +17079,22 @@ function ObjectSchema(props) {
|
|
|
16823
17079
|
const isPropertyDefined = (propertyName) => typeof props.schema.properties[propertyName] !== "undefined";
|
|
16824
17080
|
const orderedPropertyNames = Array.from(allorderedPropertiesSet).filter(isPropertyDefined);
|
|
16825
17081
|
const propsErrors = props.errors;
|
|
16826
|
-
return /* @__PURE__ */ (0,
|
|
16827
|
-
props.schema.alert && /* @__PURE__ */ (0,
|
|
16828
|
-
/* @__PURE__ */ (0,
|
|
16829
|
-
props.schema.title && !hideTitle && /* @__PURE__ */ (0,
|
|
16830
|
-
props.schema.description && !hideTitle && /* @__PURE__ */ (0,
|
|
17082
|
+
return /* @__PURE__ */ (0, import_jsx_runtime89.jsxs)(import_jsx_runtime89.Fragment, { children: [
|
|
17083
|
+
props.schema.alert && /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(DynamicAlert_default, { component: props.schema.alert }),
|
|
17084
|
+
/* @__PURE__ */ (0, import_jsx_runtime89.jsxs)("fieldset", { children: [
|
|
17085
|
+
props.schema.title && !hideTitle && /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(import_components55.Header, { title: props.schema.title, as: "legend" }),
|
|
17086
|
+
props.schema.description && !hideTitle && /* @__PURE__ */ (0, import_jsx_runtime89.jsxs)("p", { children: [
|
|
16831
17087
|
" ",
|
|
16832
17088
|
props.schema.description,
|
|
16833
17089
|
" "
|
|
16834
17090
|
] }),
|
|
16835
|
-
/* @__PURE__ */ (0,
|
|
17091
|
+
/* @__PURE__ */ (0, import_jsx_runtime89.jsx)("div", { className: "row", children: orderedPropertyNames.map((propertyName) => /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
|
|
16836
17092
|
"div",
|
|
16837
17093
|
{
|
|
16838
|
-
className: (0,
|
|
17094
|
+
className: (0, import_classnames11.default)(
|
|
16839
17095
|
getSchemaColumnClasses2(props.schema.properties[propertyName].width)
|
|
16840
17096
|
),
|
|
16841
|
-
children: /* @__PURE__ */ (0,
|
|
17097
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
|
|
16842
17098
|
GenericSchema_default,
|
|
16843
17099
|
{
|
|
16844
17100
|
schema: props.schema.properties[propertyName],
|
|
@@ -16860,12 +17116,12 @@ function ObjectSchema(props) {
|
|
|
16860
17116
|
var ObjectSchema_default = ObjectSchema;
|
|
16861
17117
|
|
|
16862
17118
|
// src/legacy/jsonSchemaForm/oneOfSchema/OneOfSchema.tsx
|
|
16863
|
-
var
|
|
16864
|
-
var
|
|
17119
|
+
var import_components58 = require("@transferwise/components");
|
|
17120
|
+
var import_classnames12 = __toESM(require_classnames());
|
|
16865
17121
|
var import_react41 = require("react");
|
|
16866
17122
|
|
|
16867
17123
|
// src/legacy/jsonSchemaForm/help/Help.tsx
|
|
16868
|
-
var
|
|
17124
|
+
var import_components56 = require("@transferwise/components");
|
|
16869
17125
|
var import_react_intl34 = require("react-intl");
|
|
16870
17126
|
|
|
16871
17127
|
// src/common/messages/help.messages.ts
|
|
@@ -16879,14 +17135,14 @@ var help_messages_default2 = (0, import_react_intl33.defineMessages)({
|
|
|
16879
17135
|
});
|
|
16880
17136
|
|
|
16881
17137
|
// src/legacy/jsonSchemaForm/help/Help.tsx
|
|
16882
|
-
var
|
|
17138
|
+
var import_jsx_runtime90 = require("react/jsx-runtime");
|
|
16883
17139
|
function Help2(props) {
|
|
16884
17140
|
const intl = (0, import_react_intl34.useIntl)();
|
|
16885
|
-
return /* @__PURE__ */ (0,
|
|
16886
|
-
|
|
17141
|
+
return /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
|
|
17142
|
+
import_components56.Info,
|
|
16887
17143
|
{
|
|
16888
17144
|
className: "m-l-1",
|
|
16889
|
-
content: /* @__PURE__ */ (0,
|
|
17145
|
+
content: /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(import_components56.Markdown, { config: { link: { target: "_blank" } }, children: props.help.markdown }),
|
|
16890
17146
|
presentation: "POPOVER",
|
|
16891
17147
|
size: "sm",
|
|
16892
17148
|
"aria-label": intl.formatMessage(help_messages_default2.helpAria)
|
|
@@ -16900,7 +17156,7 @@ var import_react40 = require("react");
|
|
|
16900
17156
|
var import_react_intl35 = require("react-intl");
|
|
16901
17157
|
|
|
16902
17158
|
// src/legacy/formControl/FormControl.tsx
|
|
16903
|
-
var
|
|
17159
|
+
var import_components57 = require("@transferwise/components");
|
|
16904
17160
|
var import_react39 = require("react");
|
|
16905
17161
|
|
|
16906
17162
|
// src/legacy/formControl/utils/value-utils.ts
|
|
@@ -17087,7 +17343,7 @@ var autocompleteTokenMap2 = {
|
|
|
17087
17343
|
};
|
|
17088
17344
|
|
|
17089
17345
|
// src/legacy/formControl/FormControl.tsx
|
|
17090
|
-
var
|
|
17346
|
+
var import_jsx_runtime91 = require("react/jsx-runtime");
|
|
17091
17347
|
var _FormControl = class _FormControl extends import_react39.PureComponent {
|
|
17092
17348
|
constructor(props) {
|
|
17093
17349
|
super(props);
|
|
@@ -17177,8 +17433,8 @@ var _FormControl = class _FormControl extends import_react39.PureComponent {
|
|
|
17177
17433
|
} = this.props;
|
|
17178
17434
|
switch (type) {
|
|
17179
17435
|
case FormControlType.RADIO:
|
|
17180
|
-
return /* @__PURE__ */ (0,
|
|
17181
|
-
|
|
17436
|
+
return /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(
|
|
17437
|
+
import_components57.RadioGroup,
|
|
17182
17438
|
{
|
|
17183
17439
|
radios: options.map(this.mapOption),
|
|
17184
17440
|
name,
|
|
@@ -17193,8 +17449,8 @@ var _FormControl = class _FormControl extends import_react39.PureComponent {
|
|
|
17193
17449
|
}
|
|
17194
17450
|
);
|
|
17195
17451
|
case FormControlType.CHECKBOX:
|
|
17196
|
-
return /* @__PURE__ */ (0,
|
|
17197
|
-
|
|
17452
|
+
return /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(
|
|
17453
|
+
import_components57.Checkbox,
|
|
17198
17454
|
{
|
|
17199
17455
|
checked: getSafeBooleanValue(value, { coerceValue: true }),
|
|
17200
17456
|
disabled,
|
|
@@ -17211,8 +17467,8 @@ var _FormControl = class _FormControl extends import_react39.PureComponent {
|
|
|
17211
17467
|
const search = options.length >= 8;
|
|
17212
17468
|
const items = options;
|
|
17213
17469
|
const selected = this.getSelectedOption(options);
|
|
17214
|
-
return /* @__PURE__ */ (0,
|
|
17215
|
-
|
|
17470
|
+
return /* @__PURE__ */ (0, import_jsx_runtime91.jsx)("div", { className: "d-flex flex-column", children: /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(
|
|
17471
|
+
import_components57.SelectInput,
|
|
17216
17472
|
{
|
|
17217
17473
|
id,
|
|
17218
17474
|
UNSAFE_triggerButtonProps: {
|
|
@@ -17227,8 +17483,8 @@ var _FormControl = class _FormControl extends import_react39.PureComponent {
|
|
|
17227
17483
|
disabled: value2.disabled
|
|
17228
17484
|
})),
|
|
17229
17485
|
value: selected != null ? selected : null,
|
|
17230
|
-
renderValue: ({ hideIconInTrigger, icon, label: label2, note, secondary }, withinTrigger) => /* @__PURE__ */ (0,
|
|
17231
|
-
|
|
17486
|
+
renderValue: ({ hideIconInTrigger, icon, label: label2, note, secondary }, withinTrigger) => /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(
|
|
17487
|
+
import_components57.SelectInputOptionContent,
|
|
17232
17488
|
{
|
|
17233
17489
|
title: label2,
|
|
17234
17490
|
note: withinTrigger ? note != null ? note : secondary : note,
|
|
@@ -17256,13 +17512,13 @@ var _FormControl = class _FormControl extends import_react39.PureComponent {
|
|
|
17256
17512
|
) });
|
|
17257
17513
|
}
|
|
17258
17514
|
case FormControlType.TAB:
|
|
17259
|
-
return /* @__PURE__ */ (0,
|
|
17260
|
-
|
|
17515
|
+
return /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(
|
|
17516
|
+
import_components57.Tabs,
|
|
17261
17517
|
{
|
|
17262
17518
|
selected: ((_a = this.getSelectedOption(options)) == null ? void 0 : _a.value) || 0,
|
|
17263
17519
|
tabs: options.map((option) => ({
|
|
17264
17520
|
title: option.label,
|
|
17265
|
-
content: /* @__PURE__ */ (0,
|
|
17521
|
+
content: /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(import_jsx_runtime91.Fragment, {}),
|
|
17266
17522
|
disabled: option.disabled || false
|
|
17267
17523
|
})),
|
|
17268
17524
|
name: id,
|
|
@@ -17277,7 +17533,7 @@ var _FormControl = class _FormControl extends import_react39.PureComponent {
|
|
|
17277
17533
|
);
|
|
17278
17534
|
case FormControlType.NUMERIC:
|
|
17279
17535
|
case FormControlType.NUMBER: {
|
|
17280
|
-
return /* @__PURE__ */ (0,
|
|
17536
|
+
return /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(
|
|
17281
17537
|
"input",
|
|
17282
17538
|
{
|
|
17283
17539
|
autoComplete: this.getAutocompleteValue(),
|
|
@@ -17311,7 +17567,7 @@ var _FormControl = class _FormControl extends import_react39.PureComponent {
|
|
|
17311
17567
|
);
|
|
17312
17568
|
}
|
|
17313
17569
|
case FormControlType.HIDDEN:
|
|
17314
|
-
return /* @__PURE__ */ (0,
|
|
17570
|
+
return /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(
|
|
17315
17571
|
"input",
|
|
17316
17572
|
{
|
|
17317
17573
|
type: "hidden",
|
|
@@ -17321,7 +17577,7 @@ var _FormControl = class _FormControl extends import_react39.PureComponent {
|
|
|
17321
17577
|
}
|
|
17322
17578
|
);
|
|
17323
17579
|
case FormControlType.PASSWORD:
|
|
17324
|
-
return /* @__PURE__ */ (0,
|
|
17580
|
+
return /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(
|
|
17325
17581
|
"input",
|
|
17326
17582
|
{
|
|
17327
17583
|
autoComplete: this.getAutocompleteValue(),
|
|
@@ -17341,8 +17597,8 @@ var _FormControl = class _FormControl extends import_react39.PureComponent {
|
|
|
17341
17597
|
);
|
|
17342
17598
|
case FormControlType.DATE:
|
|
17343
17599
|
case FormControlType.DATETIME:
|
|
17344
|
-
return /* @__PURE__ */ (0,
|
|
17345
|
-
|
|
17600
|
+
return /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(
|
|
17601
|
+
import_components57.DateInput,
|
|
17346
17602
|
{
|
|
17347
17603
|
"aria-labelledby": labelledBy,
|
|
17348
17604
|
dayAutoComplete: this.getAutocompleteValue({ suffix: "-day" }),
|
|
@@ -17358,8 +17614,8 @@ var _FormControl = class _FormControl extends import_react39.PureComponent {
|
|
|
17358
17614
|
}
|
|
17359
17615
|
);
|
|
17360
17616
|
case FormControlType.DATELOOKUP: {
|
|
17361
|
-
return /* @__PURE__ */ (0,
|
|
17362
|
-
|
|
17617
|
+
return /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(
|
|
17618
|
+
import_components57.DateLookup,
|
|
17363
17619
|
{
|
|
17364
17620
|
value: getSafeDateStringValue(value),
|
|
17365
17621
|
min: minDate,
|
|
@@ -17376,8 +17632,8 @@ var _FormControl = class _FormControl extends import_react39.PureComponent {
|
|
|
17376
17632
|
);
|
|
17377
17633
|
}
|
|
17378
17634
|
case FormControlType.TEL:
|
|
17379
|
-
return /* @__PURE__ */ (0,
|
|
17380
|
-
|
|
17635
|
+
return /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(
|
|
17636
|
+
import_components57.PhoneNumberInput,
|
|
17381
17637
|
{
|
|
17382
17638
|
disabled,
|
|
17383
17639
|
countryCode,
|
|
@@ -17408,8 +17664,8 @@ var _FormControl = class _FormControl extends import_react39.PureComponent {
|
|
|
17408
17664
|
autoComplete: this.getAutocompleteValue()
|
|
17409
17665
|
};
|
|
17410
17666
|
if (this.props.displayPattern) {
|
|
17411
|
-
return /* @__PURE__ */ (0,
|
|
17412
|
-
|
|
17667
|
+
return /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(
|
|
17668
|
+
import_components57.TextareaWithDisplayFormat,
|
|
17413
17669
|
__spreadProps(__spreadValues({
|
|
17414
17670
|
displayPattern: this.props.displayPattern
|
|
17415
17671
|
}, textareaProps), {
|
|
@@ -17417,7 +17673,7 @@ var _FormControl = class _FormControl extends import_react39.PureComponent {
|
|
|
17417
17673
|
})
|
|
17418
17674
|
);
|
|
17419
17675
|
}
|
|
17420
|
-
return /* @__PURE__ */ (0,
|
|
17676
|
+
return /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(
|
|
17421
17677
|
"textarea",
|
|
17422
17678
|
__spreadProps(__spreadValues({}, textareaProps), {
|
|
17423
17679
|
"aria-describedby": describedBy,
|
|
@@ -17427,8 +17683,8 @@ var _FormControl = class _FormControl extends import_react39.PureComponent {
|
|
|
17427
17683
|
}
|
|
17428
17684
|
case FormControlType.FILE:
|
|
17429
17685
|
case FormControlType.UPLOAD: {
|
|
17430
|
-
return /* @__PURE__ */ (0,
|
|
17431
|
-
|
|
17686
|
+
return /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(
|
|
17687
|
+
import_components57.Upload,
|
|
17432
17688
|
__spreadProps(__spreadValues({}, uploadProps), {
|
|
17433
17689
|
usAccept: uploadProps.usAccept || "*",
|
|
17434
17690
|
usDisabled: uploadProps.usDisabled || disabled,
|
|
@@ -17464,8 +17720,8 @@ var _FormControl = class _FormControl extends import_react39.PureComponent {
|
|
|
17464
17720
|
autoComplete: this.getAutocompleteValue()
|
|
17465
17721
|
};
|
|
17466
17722
|
if (this.props.displayPattern) {
|
|
17467
|
-
return /* @__PURE__ */ (0,
|
|
17468
|
-
|
|
17723
|
+
return /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(
|
|
17724
|
+
import_components57.InputWithDisplayFormat,
|
|
17469
17725
|
__spreadProps(__spreadValues({
|
|
17470
17726
|
displayPattern: this.props.displayPattern
|
|
17471
17727
|
}, inputProps), {
|
|
@@ -17473,7 +17729,7 @@ var _FormControl = class _FormControl extends import_react39.PureComponent {
|
|
|
17473
17729
|
})
|
|
17474
17730
|
);
|
|
17475
17731
|
}
|
|
17476
|
-
return /* @__PURE__ */ (0,
|
|
17732
|
+
return /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(
|
|
17477
17733
|
"input",
|
|
17478
17734
|
__spreadProps(__spreadValues({}, inputProps), {
|
|
17479
17735
|
"aria-describedby": describedBy,
|
|
@@ -17523,7 +17779,7 @@ _FormControl.defaultProps = {
|
|
|
17523
17779
|
var FormControl = _FormControl;
|
|
17524
17780
|
|
|
17525
17781
|
// src/legacy/jsonSchemaForm/schemaFormControl/SchemaFormControl.tsx
|
|
17526
|
-
var
|
|
17782
|
+
var import_jsx_runtime92 = require("react/jsx-runtime");
|
|
17527
17783
|
var isNativeInput = (propsSchemaType) => propsSchemaType === "string" || propsSchemaType === "number";
|
|
17528
17784
|
var getControlType = (schema) => {
|
|
17529
17785
|
if (isOneOfSchema2(schema)) {
|
|
@@ -17640,7 +17896,7 @@ function SchemaFormControl(props) {
|
|
|
17640
17896
|
labelledBy,
|
|
17641
17897
|
required
|
|
17642
17898
|
};
|
|
17643
|
-
return /* @__PURE__ */ (0,
|
|
17899
|
+
return /* @__PURE__ */ (0, import_jsx_runtime92.jsx)("div", { "aria-describedby": describedBy, children: /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(FormControl, __spreadValues(__spreadValues({ type: controlType, value: safeValue }, events), controlProps)) });
|
|
17644
17900
|
}
|
|
17645
17901
|
var warnIfInvalidSchema = (schema, log, controlType) => {
|
|
17646
17902
|
if (isOneOfSchema2(schema) && schema.oneOf.length === 2 && !schema.control) {
|
|
@@ -17662,7 +17918,7 @@ var warnIfInvalidSchema = (schema, log, controlType) => {
|
|
|
17662
17918
|
var SchemaFormControl_default = SchemaFormControl;
|
|
17663
17919
|
|
|
17664
17920
|
// src/legacy/jsonSchemaForm/oneOfSchema/OneOfSchema.tsx
|
|
17665
|
-
var
|
|
17921
|
+
var import_jsx_runtime93 = require("react/jsx-runtime");
|
|
17666
17922
|
function OneOfSchema(props) {
|
|
17667
17923
|
const onEvent = useEventDispatcher();
|
|
17668
17924
|
const [changed, setChanged] = (0, import_react41.useState)(false);
|
|
@@ -17741,12 +17997,12 @@ function OneOfSchema(props) {
|
|
|
17741
17997
|
const isHidden = props.schema.hidden;
|
|
17742
17998
|
const feedbackId = `${id}-feedback`;
|
|
17743
17999
|
const labelId = `${id}-label`;
|
|
17744
|
-
return !isHidden ? /* @__PURE__ */ (0,
|
|
17745
|
-
(props.schema.oneOf.length > 1 || isConstSchema2(props.schema.oneOf[0])) && /* @__PURE__ */ (0,
|
|
17746
|
-
props.schema.alert && /* @__PURE__ */ (0,
|
|
17747
|
-
/* @__PURE__ */ (0,
|
|
18000
|
+
return !isHidden ? /* @__PURE__ */ (0, import_jsx_runtime93.jsxs)(import_jsx_runtime93.Fragment, { children: [
|
|
18001
|
+
(props.schema.oneOf.length > 1 || isConstSchema2(props.schema.oneOf[0])) && /* @__PURE__ */ (0, import_jsx_runtime93.jsxs)(import_jsx_runtime93.Fragment, { children: [
|
|
18002
|
+
props.schema.alert && /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(DynamicAlert_default, { component: props.schema.alert }),
|
|
18003
|
+
/* @__PURE__ */ (0, import_jsx_runtime93.jsxs)("div", { className: (0, import_classnames12.default)(formGroupClasses), children: [
|
|
17748
18004
|
getTitleAndHelp(props.schema, id, labelId),
|
|
17749
|
-
/* @__PURE__ */ (0,
|
|
18005
|
+
/* @__PURE__ */ (0, import_jsx_runtime93.jsx)(
|
|
17750
18006
|
SchemaFormControl_default,
|
|
17751
18007
|
{
|
|
17752
18008
|
id,
|
|
@@ -17763,7 +18019,7 @@ function OneOfSchema(props) {
|
|
|
17763
18019
|
onSearchChange
|
|
17764
18020
|
}
|
|
17765
18021
|
),
|
|
17766
|
-
/* @__PURE__ */ (0,
|
|
18022
|
+
/* @__PURE__ */ (0, import_jsx_runtime93.jsx)(
|
|
17767
18023
|
ControlFeedback_default,
|
|
17768
18024
|
{
|
|
17769
18025
|
id: feedbackId,
|
|
@@ -17779,7 +18035,7 @@ function OneOfSchema(props) {
|
|
|
17779
18035
|
)
|
|
17780
18036
|
] })
|
|
17781
18037
|
] }),
|
|
17782
|
-
isNoNConstSchema(props.schema.oneOf[schemaIndex]) && /* @__PURE__ */ (0,
|
|
18038
|
+
isNoNConstSchema(props.schema.oneOf[schemaIndex]) && /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(
|
|
17783
18039
|
GenericSchema_default,
|
|
17784
18040
|
{
|
|
17785
18041
|
schema: props.schema.oneOf[schemaIndex],
|
|
@@ -17796,16 +18052,16 @@ function OneOfSchema(props) {
|
|
|
17796
18052
|
}
|
|
17797
18053
|
function getTitleAndHelp(schema, forId, labelId) {
|
|
17798
18054
|
var _a;
|
|
17799
|
-
const helpElement = schema.help ? /* @__PURE__ */ (0,
|
|
17800
|
-
const titleElement = isConstSchema2(schema.oneOf[0]) ? /* @__PURE__ */ (0,
|
|
18055
|
+
const helpElement = schema.help ? /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(Help_default2, { help: schema.help }) : null;
|
|
18056
|
+
const titleElement = isConstSchema2(schema.oneOf[0]) ? /* @__PURE__ */ (0, import_jsx_runtime93.jsx)("div", { className: "m-b-1", children: /* @__PURE__ */ (0, import_jsx_runtime93.jsxs)("label", { className: "control-label d-inline", id: labelId, htmlFor: forId, children: [
|
|
17801
18057
|
schema.title,
|
|
17802
18058
|
" ",
|
|
17803
18059
|
helpElement
|
|
17804
|
-
] }) }) : /* @__PURE__ */ (0,
|
|
18060
|
+
] }) }) : /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(import_jsx_runtime93.Fragment, { children: helpElement ? /* @__PURE__ */ (0, import_jsx_runtime93.jsxs)("h4", { className: "m-b-2", children: [
|
|
17805
18061
|
schema.title,
|
|
17806
18062
|
" ",
|
|
17807
18063
|
helpElement
|
|
17808
|
-
] }) : /* @__PURE__ */ (0,
|
|
18064
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(import_components58.Header, { title: (_a = schema.title) != null ? _a : "" }) });
|
|
17809
18065
|
return schema.title ? titleElement : helpElement;
|
|
17810
18066
|
}
|
|
17811
18067
|
function getValidations(props, schemaIndex) {
|
|
@@ -17838,14 +18094,14 @@ function mapOneOfToConst(schema, index) {
|
|
|
17838
18094
|
var OneOfSchema_default = OneOfSchema;
|
|
17839
18095
|
|
|
17840
18096
|
// src/legacy/jsonSchemaForm/persistAsyncSchema/persistAsyncBlobSchema/PersistAsyncBlobSchema.tsx
|
|
17841
|
-
var
|
|
18097
|
+
var import_classnames13 = __toESM(require_classnames());
|
|
17842
18098
|
var import_react43 = require("react");
|
|
17843
18099
|
var import_react_intl36 = require("react-intl");
|
|
17844
18100
|
|
|
17845
18101
|
// src/legacy/jsonSchemaForm/persistAsyncSchema/persistAsyncBlobSchema/UploadInputAdapter.tsx
|
|
17846
|
-
var
|
|
18102
|
+
var import_components59 = require("@transferwise/components");
|
|
17847
18103
|
var import_react42 = require("react");
|
|
17848
|
-
var
|
|
18104
|
+
var import_jsx_runtime94 = require("react/jsx-runtime");
|
|
17849
18105
|
function UploadInputAdapter(props) {
|
|
17850
18106
|
const {
|
|
17851
18107
|
id,
|
|
@@ -17861,7 +18117,7 @@ function UploadInputAdapter(props) {
|
|
|
17861
18117
|
onCancel
|
|
17862
18118
|
} = props;
|
|
17863
18119
|
const onEvent = useEventDispatcher();
|
|
17864
|
-
const files = (0, import_react42.useMemo)(() => fileId ? [{ id: fileId, status:
|
|
18120
|
+
const files = (0, import_react42.useMemo)(() => fileId ? [{ id: fileId, status: import_components59.Status.SUCCEEDED }] : [], [fileId]);
|
|
17865
18121
|
const uploadFile = (formData) => {
|
|
17866
18122
|
onEvent("Dynamic Flow - PersistAsync", { status: "pending", schemaId: id });
|
|
17867
18123
|
return httpClient(String(httpOptions.url), {
|
|
@@ -17880,8 +18136,8 @@ function UploadInputAdapter(props) {
|
|
|
17880
18136
|
return Promise.reject();
|
|
17881
18137
|
});
|
|
17882
18138
|
};
|
|
17883
|
-
return /* @__PURE__ */ (0,
|
|
17884
|
-
|
|
18139
|
+
return /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(
|
|
18140
|
+
import_components59.UploadInput,
|
|
17885
18141
|
{
|
|
17886
18142
|
id,
|
|
17887
18143
|
fileInputName: httpOptions.fileInputName,
|
|
@@ -17900,7 +18156,7 @@ function UploadInputAdapter(props) {
|
|
|
17900
18156
|
}
|
|
17901
18157
|
|
|
17902
18158
|
// src/legacy/jsonSchemaForm/persistAsyncSchema/persistAsyncBlobSchema/PersistAsyncBlobSchema.tsx
|
|
17903
|
-
var
|
|
18159
|
+
var import_jsx_runtime95 = require("react/jsx-runtime");
|
|
17904
18160
|
function PersistAsyncBlobSchema(props) {
|
|
17905
18161
|
const { model, schema, submitted, required = false, errors, onChange } = props;
|
|
17906
18162
|
const [persistAsyncValidationMessages, setPersistAsyncValidationMessages] = (0, import_react43.useState)({});
|
|
@@ -17948,8 +18204,8 @@ function PersistAsyncBlobSchema(props) {
|
|
|
17948
18204
|
};
|
|
17949
18205
|
const id = schema.$id || schema.persistAsync.schema.$id || schema.persistAsync.idProperty;
|
|
17950
18206
|
const feedbackId = `${id}-feedback`;
|
|
17951
|
-
return /* @__PURE__ */ (0,
|
|
17952
|
-
/* @__PURE__ */ (0,
|
|
18207
|
+
return /* @__PURE__ */ (0, import_jsx_runtime95.jsxs)("div", { className: (0, import_classnames13.default)(formGroupClasses), children: [
|
|
18208
|
+
/* @__PURE__ */ (0, import_jsx_runtime95.jsx)("div", { "aria-describedby": feedbackId, children: /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(
|
|
17953
18209
|
UploadInputAdapter,
|
|
17954
18210
|
__spreadValues({
|
|
17955
18211
|
id,
|
|
@@ -17967,7 +18223,7 @@ function PersistAsyncBlobSchema(props) {
|
|
|
17967
18223
|
onCancel
|
|
17968
18224
|
}, mapSchemaToUploadOptions(schema.persistAsync.schema))
|
|
17969
18225
|
) }),
|
|
17970
|
-
/* @__PURE__ */ (0,
|
|
18226
|
+
/* @__PURE__ */ (0, import_jsx_runtime95.jsx)(
|
|
17971
18227
|
ControlFeedback_default,
|
|
17972
18228
|
{
|
|
17973
18229
|
id: feedbackId,
|
|
@@ -17993,17 +18249,17 @@ var getResponseJsonObject = async (response) => {
|
|
|
17993
18249
|
var PersistAsyncBlobSchema_default = PersistAsyncBlobSchema;
|
|
17994
18250
|
|
|
17995
18251
|
// src/legacy/jsonSchemaForm/persistAsyncSchema/PersistAsyncSchema.tsx
|
|
17996
|
-
var
|
|
18252
|
+
var import_jsx_runtime96 = require("react/jsx-runtime");
|
|
17997
18253
|
function PersistAsyncSchema(props) {
|
|
17998
18254
|
const { schema } = props;
|
|
17999
18255
|
const persistAsyncSchemaType = schema.persistAsync.schema.type;
|
|
18000
18256
|
if (persistAsyncSchemaType === "blob") {
|
|
18001
|
-
return /* @__PURE__ */ (0,
|
|
18257
|
+
return /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(
|
|
18002
18258
|
PersistAsyncBlobSchema_default,
|
|
18003
18259
|
__spreadValues({}, props)
|
|
18004
18260
|
);
|
|
18005
18261
|
}
|
|
18006
|
-
return /* @__PURE__ */ (0,
|
|
18262
|
+
return /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(PersistAsyncBasicSchema_default, __spreadValues({}, props));
|
|
18007
18263
|
}
|
|
18008
18264
|
var PersistAsyncSchema_default = PersistAsyncSchema;
|
|
18009
18265
|
|
|
@@ -18020,8 +18276,8 @@ var getSelectionFromModel = (schema, model) => {
|
|
|
18020
18276
|
};
|
|
18021
18277
|
|
|
18022
18278
|
// src/legacy/jsonSchemaForm/promotedOneOfSchema/promotedOneOfControl/PromotedOneOfCheckboxControl.tsx
|
|
18023
|
-
var
|
|
18024
|
-
var
|
|
18279
|
+
var import_components60 = require("@transferwise/components");
|
|
18280
|
+
var import_jsx_runtime97 = require("react/jsx-runtime");
|
|
18025
18281
|
var PromotedOneOfCheckboxControl = (props) => {
|
|
18026
18282
|
const { id, selection, setSelection } = props;
|
|
18027
18283
|
const { promoted, other, checkedMeans } = props.promotion;
|
|
@@ -18032,13 +18288,13 @@ var PromotedOneOfCheckboxControl = (props) => {
|
|
|
18032
18288
|
const toggleSelection = () => {
|
|
18033
18289
|
setSelection(checked ? selectionWhenUnchecked : selectionWhenChecked);
|
|
18034
18290
|
};
|
|
18035
|
-
return /* @__PURE__ */ (0,
|
|
18291
|
+
return /* @__PURE__ */ (0, import_jsx_runtime97.jsx)("div", { className: "form-group", children: /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(import_components60.Checkbox, { id, label: title, checked, onChange: toggleSelection }) });
|
|
18036
18292
|
};
|
|
18037
18293
|
var PromotedOneOfCheckboxControl_default = PromotedOneOfCheckboxControl;
|
|
18038
18294
|
|
|
18039
18295
|
// src/legacy/jsonSchemaForm/promotedOneOfSchema/promotedOneOfControl/PromotedOneOfRadioControl.tsx
|
|
18040
|
-
var
|
|
18041
|
-
var
|
|
18296
|
+
var import_components61 = require("@transferwise/components");
|
|
18297
|
+
var import_jsx_runtime98 = require("react/jsx-runtime");
|
|
18042
18298
|
function PromotedOneOfRadioControl(props) {
|
|
18043
18299
|
var _a, _b;
|
|
18044
18300
|
const { id, selection, setSelection, promotion, promotedOneOf, title } = props;
|
|
@@ -18055,10 +18311,10 @@ function PromotedOneOfRadioControl(props) {
|
|
|
18055
18311
|
secondary: promotion.other.description
|
|
18056
18312
|
}, getAvatarPropertyForRadioOption(promotion.other))
|
|
18057
18313
|
];
|
|
18058
|
-
return /* @__PURE__ */ (0,
|
|
18059
|
-
title && /* @__PURE__ */ (0,
|
|
18060
|
-
/* @__PURE__ */ (0,
|
|
18061
|
-
|
|
18314
|
+
return /* @__PURE__ */ (0, import_jsx_runtime98.jsxs)("div", { className: "form-group", children: [
|
|
18315
|
+
title && /* @__PURE__ */ (0, import_jsx_runtime98.jsx)("label", { className: "control-label", htmlFor: id, children: title }),
|
|
18316
|
+
/* @__PURE__ */ (0, import_jsx_runtime98.jsx)(
|
|
18317
|
+
import_components61.RadioGroup,
|
|
18062
18318
|
{
|
|
18063
18319
|
name: "promoted-selection",
|
|
18064
18320
|
selectedValue: selection,
|
|
@@ -18075,16 +18331,16 @@ PromotedOneOfRadioControl.defaultProps = {
|
|
|
18075
18331
|
var PromotedOneOfRadioControl_default = PromotedOneOfRadioControl;
|
|
18076
18332
|
|
|
18077
18333
|
// src/legacy/jsonSchemaForm/promotedOneOfSchema/promotedOneOfControl/PromotedOneOfControl.tsx
|
|
18078
|
-
var
|
|
18334
|
+
var import_jsx_runtime99 = require("react/jsx-runtime");
|
|
18079
18335
|
function PromotedOneOfControl(props) {
|
|
18080
18336
|
const controlType = props.promotion.control || "radio";
|
|
18081
18337
|
switch (controlType) {
|
|
18082
18338
|
case "radio":
|
|
18083
|
-
return /* @__PURE__ */ (0,
|
|
18339
|
+
return /* @__PURE__ */ (0, import_jsx_runtime99.jsx)(PromotedOneOfRadioControl_default, __spreadValues({}, props));
|
|
18084
18340
|
case "checkbox":
|
|
18085
|
-
return /* @__PURE__ */ (0,
|
|
18341
|
+
return /* @__PURE__ */ (0, import_jsx_runtime99.jsx)(PromotedOneOfCheckboxControl_default, __spreadValues({}, props));
|
|
18086
18342
|
default:
|
|
18087
|
-
return /* @__PURE__ */ (0,
|
|
18343
|
+
return /* @__PURE__ */ (0, import_jsx_runtime99.jsx)(import_jsx_runtime99.Fragment, {});
|
|
18088
18344
|
}
|
|
18089
18345
|
}
|
|
18090
18346
|
PromotedOneOfControl.defaultProps = {
|
|
@@ -18094,7 +18350,7 @@ PromotedOneOfControl.defaultProps = {
|
|
|
18094
18350
|
var PromotedOneOfControl_default = PromotedOneOfControl;
|
|
18095
18351
|
|
|
18096
18352
|
// src/legacy/jsonSchemaForm/promotedOneOfSchema/PromotedOneOfSchema.tsx
|
|
18097
|
-
var
|
|
18353
|
+
var import_jsx_runtime100 = require("react/jsx-runtime");
|
|
18098
18354
|
var isPromoted = (schema) => schema.promoted === true;
|
|
18099
18355
|
var PromotedOneOfSchema = (props) => {
|
|
18100
18356
|
var _a;
|
|
@@ -18105,9 +18361,9 @@ var PromotedOneOfSchema = (props) => {
|
|
|
18105
18361
|
const promotedOneOf = props.schema.oneOf.find(isPromoted);
|
|
18106
18362
|
const promotedObjectSchema = getPromotedObjectSchema(promotedOneOf);
|
|
18107
18363
|
const otherOneOf = getOtherOneOf(props.schema);
|
|
18108
|
-
return /* @__PURE__ */ (0,
|
|
18109
|
-
promotedAlert && /* @__PURE__ */ (0,
|
|
18110
|
-
/* @__PURE__ */ (0,
|
|
18364
|
+
return /* @__PURE__ */ (0, import_jsx_runtime100.jsxs)(import_jsx_runtime100.Fragment, { children: [
|
|
18365
|
+
promotedAlert && /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(DynamicAlert_default, { component: promotedAlert }),
|
|
18366
|
+
/* @__PURE__ */ (0, import_jsx_runtime100.jsx)(
|
|
18111
18367
|
PromotedOneOfControl_default,
|
|
18112
18368
|
{
|
|
18113
18369
|
id: props.schema.$id,
|
|
@@ -18118,8 +18374,8 @@ var PromotedOneOfSchema = (props) => {
|
|
|
18118
18374
|
setSelection
|
|
18119
18375
|
}
|
|
18120
18376
|
),
|
|
18121
|
-
selection === "promoted" && /* @__PURE__ */ (0,
|
|
18122
|
-
selection === "other" && /* @__PURE__ */ (0,
|
|
18377
|
+
selection === "promoted" && /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(ObjectSchema_default, __spreadProps(__spreadValues({}, props), { schema: promotedObjectSchema })),
|
|
18378
|
+
selection === "other" && /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(GenericSchema_default, __spreadProps(__spreadValues({}, props), { schema: otherOneOf }))
|
|
18123
18379
|
] });
|
|
18124
18380
|
};
|
|
18125
18381
|
function getPromotedObjectSchema(promotedSchema) {
|
|
@@ -18149,7 +18405,7 @@ function getOtherOneOf(schema) {
|
|
|
18149
18405
|
var PromotedOneOfSchema_default = PromotedOneOfSchema;
|
|
18150
18406
|
|
|
18151
18407
|
// src/legacy/jsonSchemaForm/readOnlySchema/ReadOnlySchema.tsx
|
|
18152
|
-
var
|
|
18408
|
+
var import_components62 = require("@transferwise/components");
|
|
18153
18409
|
var import_react_intl38 = require("react-intl");
|
|
18154
18410
|
|
|
18155
18411
|
// src/legacy/jsonSchemaForm/readOnlySchema/ReadOnlySchema.messages.ts
|
|
@@ -18168,12 +18424,12 @@ var ReadOnlySchema_messages_default = (0, import_react_intl37.defineMessages)({
|
|
|
18168
18424
|
});
|
|
18169
18425
|
|
|
18170
18426
|
// src/legacy/jsonSchemaForm/readOnlySchema/ReadOnlySchema.tsx
|
|
18171
|
-
var
|
|
18427
|
+
var import_jsx_runtime101 = require("react/jsx-runtime");
|
|
18172
18428
|
function ReadOnlySchema({ schema, model }) {
|
|
18173
18429
|
const { title = "" } = schema;
|
|
18174
18430
|
const { formatMessage } = (0, import_react_intl38.useIntl)();
|
|
18175
18431
|
const value = getValueForSchema({ schema, model, formatMessage });
|
|
18176
|
-
return /* @__PURE__ */ (0,
|
|
18432
|
+
return /* @__PURE__ */ (0, import_jsx_runtime101.jsx)(import_components62.DefinitionList, { layout: import_components62.Layout.VERTICAL_ONE_COLUMN, definitions: [{ title, value, key: "" }] });
|
|
18177
18433
|
}
|
|
18178
18434
|
var ReadOnlySchema_default = ReadOnlySchema;
|
|
18179
18435
|
function getValueForSchema({
|
|
@@ -18206,7 +18462,7 @@ function getSelectedOneOf(schema, model) {
|
|
|
18206
18462
|
function getValueFromOption(option) {
|
|
18207
18463
|
const text = option.title && option.description ? `${option.title} - ${option.description}` : option.title || "";
|
|
18208
18464
|
const icon = getAvatarPropertyForRadioOption({ icon: option.icon });
|
|
18209
|
-
return (icon == null ? void 0 : icon.avatar) ? /* @__PURE__ */ (0,
|
|
18465
|
+
return (icon == null ? void 0 : icon.avatar) ? /* @__PURE__ */ (0, import_jsx_runtime101.jsxs)(import_jsx_runtime101.Fragment, { children: [
|
|
18210
18466
|
icon.avatar,
|
|
18211
18467
|
" ",
|
|
18212
18468
|
text
|
|
@@ -18215,7 +18471,7 @@ function getValueFromOption(option) {
|
|
|
18215
18471
|
|
|
18216
18472
|
// src/legacy/jsonSchemaForm/validationAsyncSchema/ValidationAsyncSchema.tsx
|
|
18217
18473
|
var import_react45 = require("react");
|
|
18218
|
-
var
|
|
18474
|
+
var import_jsx_runtime102 = require("react/jsx-runtime");
|
|
18219
18475
|
function ValidationAsyncSchema(props) {
|
|
18220
18476
|
const { schema, model, required = false, submitted, errors, onChange } = props;
|
|
18221
18477
|
const [validationAsyncModel, setValidationAsyncModel] = (0, import_react45.useState)(model);
|
|
@@ -18299,12 +18555,12 @@ function ValidationAsyncSchema(props) {
|
|
|
18299
18555
|
required,
|
|
18300
18556
|
schema
|
|
18301
18557
|
};
|
|
18302
|
-
return /* @__PURE__ */ (0,
|
|
18558
|
+
return /* @__PURE__ */ (0, import_jsx_runtime102.jsx)(BasicTypeSchema_default, __spreadValues({}, basicTypeSchemaProps));
|
|
18303
18559
|
}
|
|
18304
18560
|
var ValidationAsyncSchema_default = ValidationAsyncSchema;
|
|
18305
18561
|
|
|
18306
18562
|
// src/legacy/jsonSchemaForm/genericSchema/GenericSchema.tsx
|
|
18307
|
-
var
|
|
18563
|
+
var import_jsx_runtime103 = require("react/jsx-runtime");
|
|
18308
18564
|
var import_react47 = require("react");
|
|
18309
18565
|
function GenericSchemaForm(props) {
|
|
18310
18566
|
const { schema, model = null, errors = null, hideTitle = false, disabled = false } = props;
|
|
@@ -18321,29 +18577,29 @@ function GenericSchemaForm(props) {
|
|
|
18321
18577
|
}, [JSON.stringify(schema), JSON.stringify(model), JSON.stringify(errors), type, log]);
|
|
18322
18578
|
switch (type) {
|
|
18323
18579
|
case "readOnly":
|
|
18324
|
-
return /* @__PURE__ */ (0,
|
|
18580
|
+
return /* @__PURE__ */ (0, import_jsx_runtime103.jsx)(ReadOnlySchema_default, __spreadValues({}, schemaProps));
|
|
18325
18581
|
case "persistAsync":
|
|
18326
|
-
return /* @__PURE__ */ (0,
|
|
18582
|
+
return /* @__PURE__ */ (0, import_jsx_runtime103.jsx)(PersistAsyncSchema_default, __spreadValues({}, schemaProps));
|
|
18327
18583
|
case "validationAsync":
|
|
18328
|
-
return /* @__PURE__ */ (0,
|
|
18584
|
+
return /* @__PURE__ */ (0, import_jsx_runtime103.jsx)(ValidationAsyncSchema_default, __spreadValues({}, schemaProps));
|
|
18329
18585
|
case "basic": {
|
|
18330
18586
|
const basicTypeProps = __spreadValues({
|
|
18331
18587
|
infoMessage: null
|
|
18332
18588
|
}, schemaProps);
|
|
18333
|
-
return /* @__PURE__ */ (0,
|
|
18589
|
+
return /* @__PURE__ */ (0, import_jsx_runtime103.jsx)(BasicTypeSchema_default, __spreadValues({}, basicTypeProps));
|
|
18334
18590
|
}
|
|
18335
18591
|
case "object":
|
|
18336
18592
|
return /* @__PURE__ */ (0, import_react47.createElement)(ObjectSchema_default, __spreadProps(__spreadValues({}, schemaProps), { key: JSON.stringify(schema) }));
|
|
18337
18593
|
case "array":
|
|
18338
|
-
return /* @__PURE__ */ (0,
|
|
18594
|
+
return /* @__PURE__ */ (0, import_jsx_runtime103.jsx)(ArraySchema_default, __spreadValues({}, schemaProps));
|
|
18339
18595
|
case "promotedOneOf":
|
|
18340
|
-
return /* @__PURE__ */ (0,
|
|
18596
|
+
return /* @__PURE__ */ (0, import_jsx_runtime103.jsx)(PromotedOneOfSchema_default, __spreadValues({}, schemaProps));
|
|
18341
18597
|
case "oneOf":
|
|
18342
|
-
return /* @__PURE__ */ (0,
|
|
18598
|
+
return /* @__PURE__ */ (0, import_jsx_runtime103.jsx)(OneOfSchema_default, __spreadValues({}, schemaProps));
|
|
18343
18599
|
case "allOf":
|
|
18344
|
-
return /* @__PURE__ */ (0,
|
|
18600
|
+
return /* @__PURE__ */ (0, import_jsx_runtime103.jsx)(AllOfSchema_default, __spreadValues({}, schemaProps));
|
|
18345
18601
|
}
|
|
18346
|
-
return /* @__PURE__ */ (0,
|
|
18602
|
+
return /* @__PURE__ */ (0, import_jsx_runtime103.jsx)(import_jsx_runtime103.Fragment, {});
|
|
18347
18603
|
}
|
|
18348
18604
|
var GenericSchema_default = GenericSchemaForm;
|
|
18349
18605
|
var isValidGenericSchema = (schema, model, errors) => {
|
|
@@ -18370,7 +18626,7 @@ var isValidGenericSchema = (schema, model, errors) => {
|
|
|
18370
18626
|
};
|
|
18371
18627
|
|
|
18372
18628
|
// src/legacy/layout/form/DynamicForm.tsx
|
|
18373
|
-
var
|
|
18629
|
+
var import_jsx_runtime104 = require("react/jsx-runtime");
|
|
18374
18630
|
function DynamicForm({
|
|
18375
18631
|
component,
|
|
18376
18632
|
model = null,
|
|
@@ -18380,7 +18636,7 @@ function DynamicForm({
|
|
|
18380
18636
|
onPersistAsync
|
|
18381
18637
|
}) {
|
|
18382
18638
|
const formSchema = component.schema;
|
|
18383
|
-
return /* @__PURE__ */ (0,
|
|
18639
|
+
return /* @__PURE__ */ (0, import_jsx_runtime104.jsx)("div", { className: getMargin2(component.margin || "md"), children: /* @__PURE__ */ (0, import_jsx_runtime104.jsx)(
|
|
18384
18640
|
GenericSchema_default,
|
|
18385
18641
|
{
|
|
18386
18642
|
schema: formSchema,
|
|
@@ -18397,68 +18653,82 @@ function DynamicForm({
|
|
|
18397
18653
|
var DynamicForm_default = DynamicForm;
|
|
18398
18654
|
|
|
18399
18655
|
// src/legacy/layout/heading/DynamicHeading.tsx
|
|
18400
|
-
var
|
|
18401
|
-
var
|
|
18402
|
-
var
|
|
18656
|
+
var import_components63 = require("@transferwise/components");
|
|
18657
|
+
var import_classnames14 = __toESM(require_classnames());
|
|
18658
|
+
var import_jsx_runtime105 = require("react/jsx-runtime");
|
|
18403
18659
|
var DynamicHeading = (props) => {
|
|
18404
18660
|
const { text, size: size2 = "md", align = "left", margin = "md", control } = props.component;
|
|
18405
|
-
const classes = (0,
|
|
18406
|
-
return control === "display" ? /* @__PURE__ */ (0,
|
|
18661
|
+
const classes = (0, import_classnames14.default)(getTextAlignmentAndMargin2({ align, margin }));
|
|
18662
|
+
return control === "display" ? /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(DisplayHeading2, { size: size2, text, classes }) : /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(StandardHeading2, { size: size2, text, classes });
|
|
18407
18663
|
};
|
|
18408
18664
|
var StandardHeading2 = ({ size: size2, text, classes }) => {
|
|
18409
18665
|
switch (size2) {
|
|
18410
18666
|
case "xs":
|
|
18411
|
-
return /* @__PURE__ */ (0,
|
|
18667
|
+
return /* @__PURE__ */ (0, import_jsx_runtime105.jsx)("h5", { className: classes, children: text });
|
|
18412
18668
|
case "sm":
|
|
18413
|
-
return /* @__PURE__ */ (0,
|
|
18669
|
+
return /* @__PURE__ */ (0, import_jsx_runtime105.jsx)("h4", { className: classes, children: text });
|
|
18414
18670
|
case "lg":
|
|
18415
|
-
return /* @__PURE__ */ (0,
|
|
18671
|
+
return /* @__PURE__ */ (0, import_jsx_runtime105.jsx)("h2", { className: classes, children: text });
|
|
18416
18672
|
case "xl":
|
|
18417
|
-
return /* @__PURE__ */ (0,
|
|
18673
|
+
return /* @__PURE__ */ (0, import_jsx_runtime105.jsx)("h1", { className: classes, children: text });
|
|
18418
18674
|
case "md":
|
|
18419
18675
|
default:
|
|
18420
|
-
return /* @__PURE__ */ (0,
|
|
18676
|
+
return /* @__PURE__ */ (0, import_jsx_runtime105.jsx)("h3", { className: classes, children: text });
|
|
18421
18677
|
}
|
|
18422
18678
|
};
|
|
18423
18679
|
var DisplayHeading2 = ({ size: size2, text, classes }) => {
|
|
18424
18680
|
switch (size2) {
|
|
18425
18681
|
case "xs":
|
|
18426
18682
|
case "sm":
|
|
18427
|
-
return /* @__PURE__ */ (0,
|
|
18683
|
+
return /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(import_components63.Display, { type: "display-small", className: classes, children: text });
|
|
18428
18684
|
case "xl":
|
|
18429
18685
|
case "lg":
|
|
18430
|
-
return /* @__PURE__ */ (0,
|
|
18686
|
+
return /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(import_components63.Display, { type: "display-large", className: classes, children: text });
|
|
18431
18687
|
case "md":
|
|
18432
18688
|
default:
|
|
18433
|
-
return /* @__PURE__ */ (0,
|
|
18689
|
+
return /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(import_components63.Display, { type: "display-medium", className: classes, children: text });
|
|
18434
18690
|
}
|
|
18435
18691
|
};
|
|
18436
18692
|
var DynamicHeading_default = DynamicHeading;
|
|
18437
18693
|
|
|
18438
18694
|
// src/legacy/layout/markdown/DynamicMarkdown.tsx
|
|
18439
|
-
var
|
|
18440
|
-
var
|
|
18695
|
+
var import_components64 = require("@transferwise/components");
|
|
18696
|
+
var import_jsx_runtime106 = require("react/jsx-runtime");
|
|
18441
18697
|
var DynamicMarkdown = ({ component }) => {
|
|
18442
18698
|
const { content, align, margin } = component;
|
|
18443
|
-
return /* @__PURE__ */ (0,
|
|
18699
|
+
return /* @__PURE__ */ (0, import_jsx_runtime106.jsx)("div", { className: getTextAlignmentAndMargin2({ align, margin }), children: /* @__PURE__ */ (0, import_jsx_runtime106.jsx)(import_components64.Markdown, { config: { link: { target: "_blank" } }, children: content }) });
|
|
18444
18700
|
};
|
|
18445
18701
|
var DynamicInfo = ({ component }) => {
|
|
18446
|
-
return /* @__PURE__ */ (0,
|
|
18702
|
+
return /* @__PURE__ */ (0, import_jsx_runtime106.jsx)("div", { className: getTextAlignmentAndMargin2(component), children: /* @__PURE__ */ (0, import_jsx_runtime106.jsx)(import_components64.Markdown, { config: { link: { target: "_blank" } }, children: component.markdown }) });
|
|
18447
18703
|
};
|
|
18448
18704
|
|
|
18449
18705
|
// src/legacy/layout/image/DynamicImage.tsx
|
|
18450
|
-
var
|
|
18706
|
+
var import_components65 = require("@transferwise/components");
|
|
18451
18707
|
var import_react48 = require("react");
|
|
18452
|
-
var
|
|
18708
|
+
var import_jsx_runtime107 = require("react/jsx-runtime");
|
|
18453
18709
|
function DynamicImage({ component: image }) {
|
|
18454
|
-
|
|
18710
|
+
var _a, _b, _c;
|
|
18711
|
+
const { content, url, size: size2, text, margin, accessibilityDescription } = image;
|
|
18455
18712
|
const httpClient = useHttpClient();
|
|
18456
18713
|
const [imageSource, setImageSource] = (0, import_react48.useState)("");
|
|
18457
18714
|
(0, import_react48.useEffect)(() => {
|
|
18458
|
-
|
|
18459
|
-
|
|
18715
|
+
if (content) {
|
|
18716
|
+
const { uri, url: contentUrl } = content;
|
|
18717
|
+
if (uri && !uri.startsWith("urn:")) {
|
|
18718
|
+
void getImageSource2(httpClient, uri).then(setImageSource);
|
|
18719
|
+
return;
|
|
18720
|
+
}
|
|
18721
|
+
if (contentUrl) {
|
|
18722
|
+
void getImageSource2(httpClient, contentUrl).then(setImageSource);
|
|
18723
|
+
return;
|
|
18724
|
+
}
|
|
18725
|
+
}
|
|
18726
|
+
if (url) {
|
|
18727
|
+
void getImageSource2(httpClient, url).then(setImageSource);
|
|
18728
|
+
}
|
|
18729
|
+
}, [content, url, httpClient]);
|
|
18460
18730
|
const imageProps = {
|
|
18461
|
-
alt: accessibilityDescription
|
|
18731
|
+
alt: (_c = (_b = (_a = content == null ? void 0 : content.accessibilityDescription) != null ? _a : accessibilityDescription) != null ? _b : text) != null ? _c : "",
|
|
18462
18732
|
src: imageSource,
|
|
18463
18733
|
stretch: true,
|
|
18464
18734
|
shrink: true
|
|
@@ -18466,7 +18736,7 @@ function DynamicImage({ component: image }) {
|
|
|
18466
18736
|
if (!imageSource) {
|
|
18467
18737
|
return null;
|
|
18468
18738
|
}
|
|
18469
|
-
return /* @__PURE__ */ (0,
|
|
18739
|
+
return /* @__PURE__ */ (0, import_jsx_runtime107.jsx)("div", { className: `df-image ${size2 || "md"}`, children: /* @__PURE__ */ (0, import_jsx_runtime107.jsx)(import_components65.Image, __spreadValues({ className: `img-responsive ${getMargin2(margin || "md")}` }, imageProps)) });
|
|
18470
18740
|
}
|
|
18471
18741
|
var readImageBlobAsDataURL2 = (imageBlob) => (
|
|
18472
18742
|
// we can safely assume the type of reader.result is string
|
|
@@ -18502,48 +18772,48 @@ var getImageSource2 = async (httpClient, imageUrl) => {
|
|
|
18502
18772
|
var DynamicImage_default = DynamicImage;
|
|
18503
18773
|
|
|
18504
18774
|
// src/legacy/layout/instructions/DynamicInstructions.tsx
|
|
18505
|
-
var
|
|
18506
|
-
var
|
|
18775
|
+
var import_components66 = require("@transferwise/components");
|
|
18776
|
+
var import_jsx_runtime108 = require("react/jsx-runtime");
|
|
18507
18777
|
var doContext2 = ["positive", "neutral"];
|
|
18508
18778
|
var dontContext2 = ["warning", "negative"];
|
|
18509
18779
|
var DynamicInstructions = ({ component }) => {
|
|
18510
18780
|
const { items } = component;
|
|
18511
18781
|
const dos = items.filter((item) => doContext2.includes(item.context)).map(({ text }) => text);
|
|
18512
18782
|
const donts = items.filter((item) => dontContext2.includes(item.context)).map(({ text }) => text);
|
|
18513
|
-
return /* @__PURE__ */ (0,
|
|
18514
|
-
component.title ? /* @__PURE__ */ (0,
|
|
18515
|
-
/* @__PURE__ */ (0,
|
|
18783
|
+
return /* @__PURE__ */ (0, import_jsx_runtime108.jsxs)("div", { className: getMargin2(component.margin || "md"), children: [
|
|
18784
|
+
component.title ? /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(import_components66.Header, { title: component.title }) : null,
|
|
18785
|
+
/* @__PURE__ */ (0, import_jsx_runtime108.jsx)(import_components66.InstructionsList, { dos, donts })
|
|
18516
18786
|
] });
|
|
18517
18787
|
};
|
|
18518
18788
|
var DynamicInstructions_default = DynamicInstructions;
|
|
18519
18789
|
|
|
18520
18790
|
// src/legacy/layout/DynamicLayout.tsx
|
|
18521
|
-
var
|
|
18791
|
+
var import_jsx_runtime109 = require("react/jsx-runtime");
|
|
18522
18792
|
var getKey = (component) => JSON.stringify(component);
|
|
18523
18793
|
function DynamicLayout(props) {
|
|
18524
18794
|
const { components, model, submitted, errors, onModelChange, onAction, onPersistAsync, baseUrl } = props;
|
|
18525
18795
|
const renderComponent = (component) => {
|
|
18526
18796
|
switch (component.type) {
|
|
18527
18797
|
case "heading":
|
|
18528
|
-
return /* @__PURE__ */ (0,
|
|
18798
|
+
return /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(DynamicHeading_default, { component }, getKey(component));
|
|
18529
18799
|
case "paragraph":
|
|
18530
|
-
return /* @__PURE__ */ (0,
|
|
18800
|
+
return /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(DynamicParagraph_default, { component }, getKey(component));
|
|
18531
18801
|
case "image":
|
|
18532
|
-
return /* @__PURE__ */ (0,
|
|
18802
|
+
return /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(DynamicImage_default, { component }, getKey(component));
|
|
18533
18803
|
case "alert":
|
|
18534
|
-
return /* @__PURE__ */ (0,
|
|
18804
|
+
return /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(DynamicAlert_default, { component, onAction }, getKey(component));
|
|
18535
18805
|
case "review":
|
|
18536
|
-
return /* @__PURE__ */ (0,
|
|
18806
|
+
return /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(DynamicReview_default, { component, onAction }, getKey(component));
|
|
18537
18807
|
case "divider":
|
|
18538
|
-
return /* @__PURE__ */ (0,
|
|
18808
|
+
return /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(DynamicDivider_default, { component }, getKey(component));
|
|
18539
18809
|
case "info":
|
|
18540
|
-
return /* @__PURE__ */ (0,
|
|
18810
|
+
return /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(DynamicInfo, { component }, getKey(component));
|
|
18541
18811
|
case "instructions":
|
|
18542
|
-
return /* @__PURE__ */ (0,
|
|
18812
|
+
return /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(DynamicInstructions_default, { component }, getKey(component));
|
|
18543
18813
|
case "markdown":
|
|
18544
|
-
return /* @__PURE__ */ (0,
|
|
18814
|
+
return /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(DynamicMarkdown, { component }, getKey(component));
|
|
18545
18815
|
case "columns":
|
|
18546
|
-
return /* @__PURE__ */ (0,
|
|
18816
|
+
return /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(
|
|
18547
18817
|
DynamicColumns_default,
|
|
18548
18818
|
{
|
|
18549
18819
|
component,
|
|
@@ -18557,7 +18827,7 @@ function DynamicLayout(props) {
|
|
|
18557
18827
|
getKey(component)
|
|
18558
18828
|
);
|
|
18559
18829
|
case "form":
|
|
18560
|
-
return /* @__PURE__ */ (0,
|
|
18830
|
+
return /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(
|
|
18561
18831
|
DynamicForm_default,
|
|
18562
18832
|
{
|
|
18563
18833
|
component,
|
|
@@ -18570,9 +18840,9 @@ function DynamicLayout(props) {
|
|
|
18570
18840
|
getKey(__spreadProps(__spreadValues({}, component), { errors: errors != null ? errors : null }))
|
|
18571
18841
|
);
|
|
18572
18842
|
case "button":
|
|
18573
|
-
return /* @__PURE__ */ (0,
|
|
18843
|
+
return /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(DynamicButton_default, { component, onAction }, getKey(component));
|
|
18574
18844
|
case "box":
|
|
18575
|
-
return /* @__PURE__ */ (0,
|
|
18845
|
+
return /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(
|
|
18576
18846
|
DynamicBox_default,
|
|
18577
18847
|
{
|
|
18578
18848
|
component,
|
|
@@ -18586,18 +18856,18 @@ function DynamicLayout(props) {
|
|
|
18586
18856
|
getKey(component)
|
|
18587
18857
|
);
|
|
18588
18858
|
case "decision":
|
|
18589
|
-
return /* @__PURE__ */ (0,
|
|
18859
|
+
return /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(DynamicDecision_default, { component, onAction }, getKey(component));
|
|
18590
18860
|
case "external":
|
|
18591
|
-
return /* @__PURE__ */ (0,
|
|
18861
|
+
return /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(DynamicExternal_default, { component, onAction }, getKey(component));
|
|
18592
18862
|
case "list":
|
|
18593
18863
|
case "status-list":
|
|
18594
|
-
return /* @__PURE__ */ (0,
|
|
18864
|
+
return /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(DynamicStatusList_default, { component, onAction }, getKey(component));
|
|
18595
18865
|
case "loading-indicator":
|
|
18596
|
-
return /* @__PURE__ */ (0,
|
|
18866
|
+
return /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(DynamicLoadingIndicator_default, { component }, getKey(component));
|
|
18597
18867
|
case "search":
|
|
18598
|
-
return /* @__PURE__ */ (0,
|
|
18868
|
+
return /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(DynamicSearch_default, { component, onAction }, getKey(component));
|
|
18599
18869
|
case "modal":
|
|
18600
|
-
return /* @__PURE__ */ (0,
|
|
18870
|
+
return /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(
|
|
18601
18871
|
DynamicModal_default,
|
|
18602
18872
|
{
|
|
18603
18873
|
component,
|
|
@@ -18611,22 +18881,22 @@ function DynamicLayout(props) {
|
|
|
18611
18881
|
getKey(component)
|
|
18612
18882
|
);
|
|
18613
18883
|
default:
|
|
18614
|
-
return /* @__PURE__ */ (0,
|
|
18884
|
+
return /* @__PURE__ */ (0, import_jsx_runtime109.jsx)("div", {}, getKey(component));
|
|
18615
18885
|
}
|
|
18616
18886
|
};
|
|
18617
18887
|
if (useHasHttpClientProvider() || baseUrl == null) {
|
|
18618
|
-
return /* @__PURE__ */ (0,
|
|
18888
|
+
return /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(import_jsx_runtime109.Fragment, { children: components.map(renderComponent) });
|
|
18619
18889
|
}
|
|
18620
|
-
return /* @__PURE__ */ (0,
|
|
18890
|
+
return /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(HttpClientProviderFromBaseUrl, { baseUrl, children: components.map(renderComponent) });
|
|
18621
18891
|
}
|
|
18622
18892
|
var DynamicLayout_default = DynamicLayout;
|
|
18623
18893
|
|
|
18624
18894
|
// src/legacy/layout/list/DynamicStatusList.tsx
|
|
18625
|
-
var
|
|
18626
|
-
var
|
|
18895
|
+
var import_components67 = require("@transferwise/components");
|
|
18896
|
+
var import_jsx_runtime110 = require("react/jsx-runtime");
|
|
18627
18897
|
var DynamicStatusList = ({ component, onAction }) => {
|
|
18628
|
-
return /* @__PURE__ */ (0,
|
|
18629
|
-
component.title ? /* @__PURE__ */ (0,
|
|
18898
|
+
return /* @__PURE__ */ (0, import_jsx_runtime110.jsxs)("div", { className: getMargin2(component.margin || "md"), children: [
|
|
18899
|
+
component.title ? /* @__PURE__ */ (0, import_jsx_runtime110.jsx)(import_components67.Header, { title: component.title, className: "m-b-2" }) : null,
|
|
18630
18900
|
component.items.map((item) => mapListItemToSummary(item, onAction))
|
|
18631
18901
|
] });
|
|
18632
18902
|
};
|
|
@@ -18636,8 +18906,8 @@ var mapListItemToSummary = (props, onAction) => {
|
|
|
18636
18906
|
title,
|
|
18637
18907
|
description,
|
|
18638
18908
|
action: "callToAction" in props ? callToActionToSummaryAction(props == null ? void 0 : props.callToAction, onAction) : void 0
|
|
18639
|
-
}, (icon == null ? void 0 : icon.name) ? { icon: /* @__PURE__ */ (0,
|
|
18640
|
-
return /* @__PURE__ */ (0,
|
|
18909
|
+
}, (icon == null ? void 0 : icon.name) ? { icon: /* @__PURE__ */ (0, import_jsx_runtime110.jsx)(DynamicIcon_default2, { type: icon.name }) } : {}), status ? { status: statusMap[status] } : {});
|
|
18910
|
+
return /* @__PURE__ */ (0, import_jsx_runtime110.jsx)(import_components67.Summary, __spreadValues({}, summaryProps), `${title}/${description || ""}`);
|
|
18641
18911
|
};
|
|
18642
18912
|
var callToActionToSummaryAction = (callToAction, onAction) => {
|
|
18643
18913
|
if (!callToAction) {
|
|
@@ -18706,12 +18976,12 @@ var statusMap = __spreadValues(__spreadValues({}, statusListMap), legacyStatusMa
|
|
|
18706
18976
|
var DynamicStatusList_default = DynamicStatusList;
|
|
18707
18977
|
|
|
18708
18978
|
// src/legacy/layout/loadingIndicator/DynamicLoadingIndicator.tsx
|
|
18709
|
-
var
|
|
18710
|
-
var
|
|
18979
|
+
var import_components68 = require("@transferwise/components");
|
|
18980
|
+
var import_jsx_runtime111 = require("react/jsx-runtime");
|
|
18711
18981
|
var DynamicLoadingIndicator = ({ component }) => {
|
|
18712
18982
|
const { margin = "md", size: size2 = "md" } = component;
|
|
18713
|
-
return /* @__PURE__ */ (0,
|
|
18714
|
-
|
|
18983
|
+
return /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(
|
|
18984
|
+
import_components68.Loader,
|
|
18715
18985
|
{
|
|
18716
18986
|
size: size2,
|
|
18717
18987
|
classNames: {
|
|
@@ -18724,7 +18994,7 @@ var DynamicLoadingIndicator = ({ component }) => {
|
|
|
18724
18994
|
var DynamicLoadingIndicator_default = DynamicLoadingIndicator;
|
|
18725
18995
|
|
|
18726
18996
|
// src/legacy/layout/paragraph/DynamicParagraph.tsx
|
|
18727
|
-
var
|
|
18997
|
+
var import_components70 = require("@transferwise/components");
|
|
18728
18998
|
var import_react_intl40 = require("react-intl");
|
|
18729
18999
|
|
|
18730
19000
|
// src/common/messages/paragraph.messages.ts
|
|
@@ -18743,22 +19013,22 @@ var paragraph_messages_default2 = (0, import_react_intl39.defineMessages)({
|
|
|
18743
19013
|
});
|
|
18744
19014
|
|
|
18745
19015
|
// src/legacy/layout/paragraph/useSnackBarIfAvailable.ts
|
|
18746
|
-
var
|
|
19016
|
+
var import_components69 = require("@transferwise/components");
|
|
18747
19017
|
var import_react49 = require("react");
|
|
18748
19018
|
function useSnackBarIfAvailable2() {
|
|
18749
|
-
const context = (0, import_react49.useContext)(
|
|
19019
|
+
const context = (0, import_react49.useContext)(import_components69.SnackbarContext);
|
|
18750
19020
|
return context ? context.createSnackbar : noop3;
|
|
18751
19021
|
}
|
|
18752
19022
|
function noop3() {
|
|
18753
19023
|
}
|
|
18754
19024
|
|
|
18755
19025
|
// src/legacy/layout/paragraph/DynamicParagraph.tsx
|
|
18756
|
-
var
|
|
19026
|
+
var import_jsx_runtime112 = require("react/jsx-runtime");
|
|
18757
19027
|
function DynamicParagraph({ component }) {
|
|
18758
|
-
return component.control === "copyable" ? /* @__PURE__ */ (0,
|
|
19028
|
+
return component.control === "copyable" ? /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(CopyableDynamicParagraph, { component }) : /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(BasicDynamicParagraph, { component });
|
|
18759
19029
|
}
|
|
18760
19030
|
function BasicDynamicParagraph({ component }) {
|
|
18761
|
-
return /* @__PURE__ */ (0,
|
|
19031
|
+
return /* @__PURE__ */ (0, import_jsx_runtime112.jsx)("p", { className: `np-text-body-large ${getTextAlignmentAndMargin2(component)}`, children: component.text });
|
|
18762
19032
|
}
|
|
18763
19033
|
function CopyableDynamicParagraph({ component }) {
|
|
18764
19034
|
const { formatMessage } = (0, import_react_intl40.useIntl)();
|
|
@@ -18768,22 +19038,22 @@ function CopyableDynamicParagraph({ component }) {
|
|
|
18768
19038
|
var _a;
|
|
18769
19039
|
(_a = navigator.clipboard) == null ? void 0 : _a.writeText(text).then(() => createSnackbar({ text: formatMessage(paragraph_messages_default2.copied) })).catch(noop4);
|
|
18770
19040
|
};
|
|
18771
|
-
const
|
|
19041
|
+
const classNames17 = `${getTextAlignmentAndMargin2({
|
|
18772
19042
|
align: component.align,
|
|
18773
19043
|
margin: "sm"
|
|
18774
19044
|
})} form-control`;
|
|
18775
|
-
return /* @__PURE__ */ (0,
|
|
18776
|
-
/* @__PURE__ */ (0,
|
|
19045
|
+
return /* @__PURE__ */ (0, import_jsx_runtime112.jsxs)("div", { className: getTextAlignmentAndMargin2(component), children: [
|
|
19046
|
+
/* @__PURE__ */ (0, import_jsx_runtime112.jsx)(
|
|
18777
19047
|
"input",
|
|
18778
19048
|
{
|
|
18779
19049
|
type: "text",
|
|
18780
|
-
className:
|
|
19050
|
+
className: classNames17,
|
|
18781
19051
|
value: text,
|
|
18782
19052
|
readOnly: true,
|
|
18783
19053
|
style: { textOverflow: "ellipsis" }
|
|
18784
19054
|
}
|
|
18785
19055
|
),
|
|
18786
|
-
/* @__PURE__ */ (0,
|
|
19056
|
+
/* @__PURE__ */ (0, import_jsx_runtime112.jsx)(import_components70.Button, { block: true, onClick: copy, children: formatMessage(paragraph_messages_default2.copy) })
|
|
18787
19057
|
] });
|
|
18788
19058
|
}
|
|
18789
19059
|
function noop4() {
|
|
@@ -18791,8 +19061,8 @@ function noop4() {
|
|
|
18791
19061
|
var DynamicParagraph_default = DynamicParagraph;
|
|
18792
19062
|
|
|
18793
19063
|
// src/legacy/layout/review/DynamicReview.tsx
|
|
18794
|
-
var
|
|
18795
|
-
var
|
|
19064
|
+
var import_components71 = require("@transferwise/components");
|
|
19065
|
+
var import_jsx_runtime113 = require("react/jsx-runtime");
|
|
18796
19066
|
var getDefinitions = (orientation, review) => review.fields.map(({ label, value, help }, index) => ({
|
|
18797
19067
|
key: String(index),
|
|
18798
19068
|
title: label,
|
|
@@ -18800,14 +19070,14 @@ var getDefinitions = (orientation, review) => review.fields.map(({ label, value,
|
|
|
18800
19070
|
}));
|
|
18801
19071
|
var getFieldValue2 = (value, help, orientation) => {
|
|
18802
19072
|
if (help) {
|
|
18803
|
-
return orientation === "HORIZONTAL_RIGHT_ALIGNED" ? /* @__PURE__ */ (0,
|
|
18804
|
-
/* @__PURE__ */ (0,
|
|
19073
|
+
return orientation === "HORIZONTAL_RIGHT_ALIGNED" ? /* @__PURE__ */ (0, import_jsx_runtime113.jsxs)(import_jsx_runtime113.Fragment, { children: [
|
|
19074
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsx)(Help_default2, { help }),
|
|
18805
19075
|
" ",
|
|
18806
19076
|
value
|
|
18807
|
-
] }) : /* @__PURE__ */ (0,
|
|
19077
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime113.jsxs)(import_jsx_runtime113.Fragment, { children: [
|
|
18808
19078
|
value,
|
|
18809
19079
|
" ",
|
|
18810
|
-
/* @__PURE__ */ (0,
|
|
19080
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsx)(Help_default2, { help })
|
|
18811
19081
|
] });
|
|
18812
19082
|
}
|
|
18813
19083
|
return value;
|
|
@@ -18840,7 +19110,7 @@ function DynamicReview({ component: review, onAction }) {
|
|
|
18840
19110
|
const { action: behaviorAction2 } = behavior;
|
|
18841
19111
|
return {
|
|
18842
19112
|
text: title != null ? title : "",
|
|
18843
|
-
onClick: behaviorAction2 ?
|
|
19113
|
+
onClick: behaviorAction2 ? getOnClick2(behaviorAction2) : void 0
|
|
18844
19114
|
};
|
|
18845
19115
|
}
|
|
18846
19116
|
case "link": {
|
|
@@ -18855,7 +19125,7 @@ function DynamicReview({ component: review, onAction }) {
|
|
|
18855
19125
|
if (behaviorAction) {
|
|
18856
19126
|
return {
|
|
18857
19127
|
text: title != null ? title : "",
|
|
18858
|
-
onClick: behaviorAction ?
|
|
19128
|
+
onClick: behaviorAction ? getOnClick2(behaviorAction) : void 0
|
|
18859
19129
|
};
|
|
18860
19130
|
}
|
|
18861
19131
|
if (link) {
|
|
@@ -18867,10 +19137,10 @@ function DynamicReview({ component: review, onAction }) {
|
|
|
18867
19137
|
}
|
|
18868
19138
|
return {
|
|
18869
19139
|
text: title != null ? title : "",
|
|
18870
|
-
onClick: action ?
|
|
19140
|
+
onClick: action ? getOnClick2(action) : void 0
|
|
18871
19141
|
};
|
|
18872
19142
|
};
|
|
18873
|
-
const
|
|
19143
|
+
const getOnClick2 = (action) => {
|
|
18874
19144
|
return (event) => {
|
|
18875
19145
|
event.preventDefault();
|
|
18876
19146
|
if (action) {
|
|
@@ -18880,10 +19150,10 @@ function DynamicReview({ component: review, onAction }) {
|
|
|
18880
19150
|
};
|
|
18881
19151
|
const orientation = getDefinitionListLayout(review);
|
|
18882
19152
|
const callToAction = review.callToAction ? getReviewAction3(review.callToAction) : null;
|
|
18883
|
-
const legacyCallToAction = !callToAction && review.action ? { text: (_a = review.action.title) != null ? _a : "", onClick:
|
|
18884
|
-
return /* @__PURE__ */ (0,
|
|
18885
|
-
review.title && /* @__PURE__ */ (0,
|
|
18886
|
-
/* @__PURE__ */ (0,
|
|
19153
|
+
const legacyCallToAction = !callToAction && review.action ? { text: (_a = review.action.title) != null ? _a : "", onClick: getOnClick2(review.action) } : null;
|
|
19154
|
+
return /* @__PURE__ */ (0, import_jsx_runtime113.jsxs)("div", { className: margin, children: [
|
|
19155
|
+
review.title && /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(import_components71.Header, { title: review.title, action: (_b = callToAction != null ? callToAction : legacyCallToAction) != null ? _b : void 0 }),
|
|
19156
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsx)("div", { className: margin, children: /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(import_components71.DefinitionList, { layout: orientation, definitions: getDefinitions(orientation, review) }) })
|
|
18887
19157
|
] });
|
|
18888
19158
|
}
|
|
18889
19159
|
var DynamicReview_default = DynamicReview;
|
|
@@ -18893,13 +19163,13 @@ var import_react51 = require("react");
|
|
|
18893
19163
|
var import_icons5 = require("@transferwise/icons");
|
|
18894
19164
|
|
|
18895
19165
|
// src/legacy/layout/search/SearchInput.tsx
|
|
18896
|
-
var
|
|
18897
|
-
var
|
|
19166
|
+
var import_components72 = require("@transferwise/components");
|
|
19167
|
+
var import_jsx_runtime114 = require("react/jsx-runtime");
|
|
18898
19168
|
var SearchInput = ({ title, value, onFocus, onChange }) => {
|
|
18899
|
-
return /* @__PURE__ */ (0,
|
|
19169
|
+
return /* @__PURE__ */ (0, import_jsx_runtime114.jsxs)("label", { className: "control-label d-inline", children: [
|
|
18900
19170
|
title,
|
|
18901
|
-
/* @__PURE__ */ (0,
|
|
18902
|
-
|
|
19171
|
+
/* @__PURE__ */ (0, import_jsx_runtime114.jsx)(
|
|
19172
|
+
import_components72.Input,
|
|
18903
19173
|
{
|
|
18904
19174
|
type: "text",
|
|
18905
19175
|
value,
|
|
@@ -18912,15 +19182,15 @@ var SearchInput = ({ title, value, onFocus, onChange }) => {
|
|
|
18912
19182
|
};
|
|
18913
19183
|
|
|
18914
19184
|
// src/legacy/layout/search/SearchResults.tsx
|
|
18915
|
-
var
|
|
19185
|
+
var import_components73 = require("@transferwise/components");
|
|
18916
19186
|
var import_react_intl41 = require("react-intl");
|
|
18917
|
-
var
|
|
19187
|
+
var import_jsx_runtime115 = require("react/jsx-runtime");
|
|
18918
19188
|
function SearchResults2({ results, emptyMessage, onSelect }) {
|
|
18919
19189
|
if (results.length === 0) {
|
|
18920
|
-
return /* @__PURE__ */ (0,
|
|
19190
|
+
return /* @__PURE__ */ (0, import_jsx_runtime115.jsx)("p", { className: "m-t-2", children: emptyMessage });
|
|
18921
19191
|
}
|
|
18922
|
-
return /* @__PURE__ */ (0,
|
|
18923
|
-
|
|
19192
|
+
return /* @__PURE__ */ (0, import_jsx_runtime115.jsx)(import_components73.NavigationOptionsList, { children: results.map((result) => /* @__PURE__ */ (0, import_jsx_runtime115.jsx)(
|
|
19193
|
+
import_components73.NavigationOption,
|
|
18924
19194
|
{
|
|
18925
19195
|
title: result.title,
|
|
18926
19196
|
content: result.description,
|
|
@@ -18934,10 +19204,10 @@ function SearchResults2({ results, emptyMessage, onSelect }) {
|
|
|
18934
19204
|
}
|
|
18935
19205
|
function ErrorResult2({ onRetrySearch }) {
|
|
18936
19206
|
const intl = (0, import_react_intl41.useIntl)();
|
|
18937
|
-
return /* @__PURE__ */ (0,
|
|
19207
|
+
return /* @__PURE__ */ (0, import_jsx_runtime115.jsxs)("p", { className: "m-t-2", children: [
|
|
18938
19208
|
intl.formatMessage(generic_error_messages_default.genericError),
|
|
18939
19209
|
"\xA0",
|
|
18940
|
-
/* @__PURE__ */ (0,
|
|
19210
|
+
/* @__PURE__ */ (0, import_jsx_runtime115.jsx)(
|
|
18941
19211
|
"a",
|
|
18942
19212
|
{
|
|
18943
19213
|
href: "/",
|
|
@@ -19021,8 +19291,8 @@ var addQueryParameter2 = (url, key, value) => {
|
|
|
19021
19291
|
};
|
|
19022
19292
|
|
|
19023
19293
|
// src/legacy/layout/search/DynamicSearch.tsx
|
|
19024
|
-
var
|
|
19025
|
-
var
|
|
19294
|
+
var import_components74 = require("@transferwise/components");
|
|
19295
|
+
var import_classnames15 = __toESM(require_classnames());
|
|
19026
19296
|
var import_react_intl43 = require("react-intl");
|
|
19027
19297
|
|
|
19028
19298
|
// src/common/messages/search.messages.ts
|
|
@@ -19036,7 +19306,7 @@ var search_messages_default2 = (0, import_react_intl42.defineMessages)({
|
|
|
19036
19306
|
});
|
|
19037
19307
|
|
|
19038
19308
|
// src/legacy/layout/search/DynamicSearch.tsx
|
|
19039
|
-
var
|
|
19309
|
+
var import_jsx_runtime116 = require("react/jsx-runtime");
|
|
19040
19310
|
var DEBOUNCE_TIME2 = 400;
|
|
19041
19311
|
function DynamicSearch({ component, onAction }) {
|
|
19042
19312
|
const [query, setQuery] = (0, import_react51.useState)("");
|
|
@@ -19074,17 +19344,17 @@ function DynamicSearch({ component, onAction }) {
|
|
|
19074
19344
|
};
|
|
19075
19345
|
const loadingMessage = intl.formatMessage(search_messages_default2.loading);
|
|
19076
19346
|
if (control === "inline") {
|
|
19077
|
-
return /* @__PURE__ */ (0,
|
|
19347
|
+
return /* @__PURE__ */ (0, import_jsx_runtime116.jsx)("div", { className: (0, import_classnames15.default)(getMargin2(margin != null ? margin : "md"), "df-search-typeahead"), children: /* @__PURE__ */ (0, import_jsx_runtime116.jsxs)("label", { className: "control-label d-inline", children: [
|
|
19078
19348
|
title,
|
|
19079
|
-
/* @__PURE__ */ (0,
|
|
19080
|
-
|
|
19349
|
+
/* @__PURE__ */ (0, import_jsx_runtime116.jsx)("div", { className: "m-t-1", children: /* @__PURE__ */ (0, import_jsx_runtime116.jsx)(
|
|
19350
|
+
import_components74.Typeahead,
|
|
19081
19351
|
{
|
|
19082
19352
|
id: "typeahead-input-id",
|
|
19083
19353
|
intl,
|
|
19084
19354
|
name: "typeahead-input-name",
|
|
19085
19355
|
size: "md",
|
|
19086
19356
|
maxHeight: 100,
|
|
19087
|
-
footer: /* @__PURE__ */ (0,
|
|
19357
|
+
footer: /* @__PURE__ */ (0, import_jsx_runtime116.jsx)(
|
|
19088
19358
|
TypeaheadFooter2,
|
|
19089
19359
|
{
|
|
19090
19360
|
state: status,
|
|
@@ -19096,7 +19366,7 @@ function DynamicSearch({ component, onAction }) {
|
|
|
19096
19366
|
),
|
|
19097
19367
|
multiple: false,
|
|
19098
19368
|
clearable: false,
|
|
19099
|
-
addon: /* @__PURE__ */ (0,
|
|
19369
|
+
addon: /* @__PURE__ */ (0, import_jsx_runtime116.jsx)(import_icons5.Search, { size: 24 }),
|
|
19100
19370
|
options: results.map(mapResultToTypeaheadOption2),
|
|
19101
19371
|
onChange: (values) => {
|
|
19102
19372
|
if (values.length > 0) {
|
|
@@ -19111,11 +19381,11 @@ function DynamicSearch({ component, onAction }) {
|
|
|
19111
19381
|
) })
|
|
19112
19382
|
] }) });
|
|
19113
19383
|
}
|
|
19114
|
-
return /* @__PURE__ */ (0,
|
|
19115
|
-
/* @__PURE__ */ (0,
|
|
19116
|
-
status === "loading" && /* @__PURE__ */ (0,
|
|
19117
|
-
status === "error" && /* @__PURE__ */ (0,
|
|
19118
|
-
status === "success" && /* @__PURE__ */ (0,
|
|
19384
|
+
return /* @__PURE__ */ (0, import_jsx_runtime116.jsxs)("div", { className: getMargin2(margin != null ? margin : "md"), children: [
|
|
19385
|
+
/* @__PURE__ */ (0, import_jsx_runtime116.jsx)(SearchInput, { title, value: query, onChange, onFocus: onSearchStart }),
|
|
19386
|
+
status === "loading" && /* @__PURE__ */ (0, import_jsx_runtime116.jsx)(DynamicLoadingIndicator_default, { component: { type: "loading-indicator", size: "sm" } }),
|
|
19387
|
+
status === "error" && /* @__PURE__ */ (0, import_jsx_runtime116.jsx)(ErrorResult2, { onRetrySearch }),
|
|
19388
|
+
status === "success" && /* @__PURE__ */ (0, import_jsx_runtime116.jsx)(SearchResults2, { results, emptyMessage, onSelect: onResultSelected })
|
|
19119
19389
|
] });
|
|
19120
19390
|
}
|
|
19121
19391
|
function mapResultToTypeaheadOption2(result) {
|
|
@@ -19135,36 +19405,36 @@ function TypeaheadFooter2({
|
|
|
19135
19405
|
onRetrySearch
|
|
19136
19406
|
}) {
|
|
19137
19407
|
if (state === "success" && results.length === 0) {
|
|
19138
|
-
return /* @__PURE__ */ (0,
|
|
19408
|
+
return /* @__PURE__ */ (0, import_jsx_runtime116.jsx)(import_components74.Markdown, { className: "m-t-2 m-x-2", config: { link: { target: "_blank" } }, children: emptyMessage });
|
|
19139
19409
|
}
|
|
19140
19410
|
if (state === "error" && results.length === 0) {
|
|
19141
|
-
return /* @__PURE__ */ (0,
|
|
19411
|
+
return /* @__PURE__ */ (0, import_jsx_runtime116.jsx)("div", { className: "m-t-2 m-x-2", children: /* @__PURE__ */ (0, import_jsx_runtime116.jsx)(ErrorResult2, { onRetrySearch }) });
|
|
19142
19412
|
}
|
|
19143
19413
|
if (state === "loading" || results.length === 0) {
|
|
19144
|
-
return /* @__PURE__ */ (0,
|
|
19414
|
+
return /* @__PURE__ */ (0, import_jsx_runtime116.jsx)("p", { className: "m-t-2 m-x-2", children: loadingMessage });
|
|
19145
19415
|
}
|
|
19146
19416
|
return null;
|
|
19147
19417
|
}
|
|
19148
19418
|
var DynamicSearch_default = DynamicSearch;
|
|
19149
19419
|
|
|
19150
19420
|
// src/legacy/layout/modal/DynamicModal.tsx
|
|
19151
|
-
var
|
|
19421
|
+
var import_components75 = require("@transferwise/components");
|
|
19152
19422
|
var import_react52 = require("react");
|
|
19153
|
-
var
|
|
19423
|
+
var import_jsx_runtime117 = require("react/jsx-runtime");
|
|
19154
19424
|
function DynamicModal(props) {
|
|
19155
19425
|
const [visible, isVisible] = (0, import_react52.useState)(false);
|
|
19156
19426
|
const { component, onAction } = props;
|
|
19157
19427
|
const { margin = "md" } = component;
|
|
19158
|
-
return /* @__PURE__ */ (0,
|
|
19159
|
-
/* @__PURE__ */ (0,
|
|
19160
|
-
/* @__PURE__ */ (0,
|
|
19161
|
-
|
|
19428
|
+
return /* @__PURE__ */ (0, import_jsx_runtime117.jsxs)("div", { className: getTextAlignmentAndMargin2({ margin }), children: [
|
|
19429
|
+
/* @__PURE__ */ (0, import_jsx_runtime117.jsx)(import_components75.Button, { priority: "tertiary", block: true, onClick: () => isVisible(true), children: component.trigger.title }),
|
|
19430
|
+
/* @__PURE__ */ (0, import_jsx_runtime117.jsx)(
|
|
19431
|
+
import_components75.Modal,
|
|
19162
19432
|
{
|
|
19163
19433
|
scroll: "content",
|
|
19164
19434
|
open: visible,
|
|
19165
19435
|
size: "lg",
|
|
19166
19436
|
title: component.content.title,
|
|
19167
|
-
body: /* @__PURE__ */ (0,
|
|
19437
|
+
body: /* @__PURE__ */ (0, import_jsx_runtime117.jsx)(
|
|
19168
19438
|
DynamicLayout_default,
|
|
19169
19439
|
__spreadProps(__spreadValues({}, props), {
|
|
19170
19440
|
components: component.content.components,
|
|
@@ -19182,7 +19452,7 @@ function DynamicModal(props) {
|
|
|
19182
19452
|
var DynamicModal_default = DynamicModal;
|
|
19183
19453
|
|
|
19184
19454
|
// src/legacy/jsonSchemaForm/basicTypeSchema/BasicTypeSchema.tsx
|
|
19185
|
-
var
|
|
19455
|
+
var import_jsx_runtime118 = require("react/jsx-runtime");
|
|
19186
19456
|
var isNullish3 = (value) => isNull3(value) || isUndefined3(value);
|
|
19187
19457
|
var getDefaultValue = (schema) => {
|
|
19188
19458
|
return schema.type === "boolean" && isNullish3(schema.default) ? false : schema.default;
|
|
@@ -19260,15 +19530,15 @@ var BasicTypeSchema = (props) => {
|
|
|
19260
19530
|
const schemaHelp = props.schema.help;
|
|
19261
19531
|
const feedbackId = `${id}-feedback`;
|
|
19262
19532
|
const labelId = `${id}-label`;
|
|
19263
|
-
return !isHidden ? /* @__PURE__ */ (0,
|
|
19264
|
-
props.schema.alert && /* @__PURE__ */ (0,
|
|
19265
|
-
/* @__PURE__ */ (0,
|
|
19266
|
-
showLabel && /* @__PURE__ */ (0,
|
|
19267
|
-
/* @__PURE__ */ (0,
|
|
19268
|
-
!!schemaHelp && /* @__PURE__ */ (0,
|
|
19533
|
+
return !isHidden ? /* @__PURE__ */ (0, import_jsx_runtime118.jsxs)(import_jsx_runtime118.Fragment, { children: [
|
|
19534
|
+
props.schema.alert && /* @__PURE__ */ (0, import_jsx_runtime118.jsx)(DynamicAlert_default, { component: props.schema.alert }),
|
|
19535
|
+
/* @__PURE__ */ (0, import_jsx_runtime118.jsxs)("div", { className: (0, import_classnames16.default)(formGroupClasses), children: [
|
|
19536
|
+
showLabel && /* @__PURE__ */ (0, import_jsx_runtime118.jsxs)("div", { className: "d-inline-block m-b-1", children: [
|
|
19537
|
+
/* @__PURE__ */ (0, import_jsx_runtime118.jsx)("label", { className: "control-label d-inline", htmlFor: id, id: labelId, children: props.schema.title }),
|
|
19538
|
+
!!schemaHelp && /* @__PURE__ */ (0, import_jsx_runtime118.jsx)(Help_default2, { help: schemaHelp })
|
|
19269
19539
|
] }),
|
|
19270
|
-
!showLabel && !!schemaHelp && /* @__PURE__ */ (0,
|
|
19271
|
-
/* @__PURE__ */ (0,
|
|
19540
|
+
!showLabel && !!schemaHelp && /* @__PURE__ */ (0, import_jsx_runtime118.jsx)(Help_default2, { help: schemaHelp }),
|
|
19541
|
+
/* @__PURE__ */ (0, import_jsx_runtime118.jsx)(
|
|
19272
19542
|
SchemaFormControl_default,
|
|
19273
19543
|
{
|
|
19274
19544
|
id,
|
|
@@ -19282,7 +19552,7 @@ var BasicTypeSchema = (props) => {
|
|
|
19282
19552
|
labelledBy: labelId
|
|
19283
19553
|
}
|
|
19284
19554
|
),
|
|
19285
|
-
/* @__PURE__ */ (0,
|
|
19555
|
+
/* @__PURE__ */ (0, import_jsx_runtime118.jsx)(
|
|
19286
19556
|
ControlFeedback_default,
|
|
19287
19557
|
{
|
|
19288
19558
|
id: feedbackId,
|
|
@@ -19302,7 +19572,7 @@ var BasicTypeSchema = (props) => {
|
|
|
19302
19572
|
var BasicTypeSchema_default = BasicTypeSchema;
|
|
19303
19573
|
|
|
19304
19574
|
// src/legacy/jsonSchemaForm/persistAsyncSchema/persistAsyncBasicSchema/PersistAsyncBasicSchema.tsx
|
|
19305
|
-
var
|
|
19575
|
+
var import_jsx_runtime119 = require("react/jsx-runtime");
|
|
19306
19576
|
var getIdFromResponse = (idProperty, response) => response[idProperty];
|
|
19307
19577
|
var getErrorFromResponse = (errorProperty, response) => {
|
|
19308
19578
|
var _a;
|
|
@@ -19392,7 +19662,7 @@ function PersistAsyncBasicSchema(props) {
|
|
|
19392
19662
|
setPersistAsyncModel(newPersistAsyncModel);
|
|
19393
19663
|
}
|
|
19394
19664
|
};
|
|
19395
|
-
return /* @__PURE__ */ (0,
|
|
19665
|
+
return /* @__PURE__ */ (0, import_jsx_runtime119.jsx)(
|
|
19396
19666
|
BasicTypeSchema_default,
|
|
19397
19667
|
{
|
|
19398
19668
|
required,
|
|
@@ -19606,7 +19876,7 @@ function useStepPolling(polling, onAction) {
|
|
|
19606
19876
|
}
|
|
19607
19877
|
|
|
19608
19878
|
// src/legacy/step/layoutStep/LayoutStep.tsx
|
|
19609
|
-
var
|
|
19879
|
+
var import_jsx_runtime120 = require("react/jsx-runtime");
|
|
19610
19880
|
var getComponents = (step, options) => {
|
|
19611
19881
|
var _a;
|
|
19612
19882
|
if (isEmpty(step)) {
|
|
@@ -19629,7 +19899,7 @@ var LayoutStep = (props) => {
|
|
|
19629
19899
|
onEvent("Dynamic Flow - onAction supressed", { reason: "LayoutStep - loading state" });
|
|
19630
19900
|
};
|
|
19631
19901
|
useStepPolling(stepSpecification.polling, onAction);
|
|
19632
|
-
return /* @__PURE__ */ (0,
|
|
19902
|
+
return /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(
|
|
19633
19903
|
DynamicLayout_default,
|
|
19634
19904
|
{
|
|
19635
19905
|
components,
|
|
@@ -19713,49 +19983,49 @@ var CameraCapture_messages_default = (0, import_react_intl46.defineMessages)({
|
|
|
19713
19983
|
});
|
|
19714
19984
|
|
|
19715
19985
|
// src/common/cameraCapture/components/bottomBar/BottomBar.tsx
|
|
19716
|
-
var
|
|
19986
|
+
var import_components76 = require("@transferwise/components");
|
|
19717
19987
|
var import_react_intl47 = require("react-intl");
|
|
19718
|
-
var
|
|
19719
|
-
var CaptureBottomBar = ({ onCapture }) => /* @__PURE__ */ (0,
|
|
19988
|
+
var import_jsx_runtime121 = require("react/jsx-runtime");
|
|
19989
|
+
var CaptureBottomBar = ({ onCapture }) => /* @__PURE__ */ (0, import_jsx_runtime121.jsx)("div", { className: "bottom-bar", children: /* @__PURE__ */ (0, import_jsx_runtime121.jsx)(CaptureButton, { onClick: onCapture }) });
|
|
19720
19990
|
var ReviewBottomBar = ({
|
|
19721
19991
|
onSubmit,
|
|
19722
19992
|
onRetry
|
|
19723
19993
|
}) => {
|
|
19724
19994
|
const intl = (0, import_react_intl47.useIntl)();
|
|
19725
|
-
return /* @__PURE__ */ (0,
|
|
19726
|
-
/* @__PURE__ */ (0,
|
|
19727
|
-
|
|
19995
|
+
return /* @__PURE__ */ (0, import_jsx_runtime121.jsx)("div", { className: "bottom-bar p-x-2", children: /* @__PURE__ */ (0, import_jsx_runtime121.jsx)("div", { className: "row", children: /* @__PURE__ */ (0, import_jsx_runtime121.jsxs)("div", { className: "col-xs-12 col-md-6 col-md-offset-3", children: [
|
|
19996
|
+
/* @__PURE__ */ (0, import_jsx_runtime121.jsx)(
|
|
19997
|
+
import_components76.Button,
|
|
19728
19998
|
{
|
|
19729
19999
|
className: "m-b-1",
|
|
19730
20000
|
block: true,
|
|
19731
|
-
size:
|
|
19732
|
-
type:
|
|
20001
|
+
size: import_components76.Size.MEDIUM,
|
|
20002
|
+
type: import_components76.ControlType.ACCENT,
|
|
19733
20003
|
onClick: onSubmit,
|
|
19734
20004
|
children: intl.formatMessage(CameraCapture_messages_default.reviewSubmit)
|
|
19735
20005
|
}
|
|
19736
20006
|
),
|
|
19737
|
-
/* @__PURE__ */ (0,
|
|
19738
|
-
|
|
20007
|
+
/* @__PURE__ */ (0, import_jsx_runtime121.jsx)(
|
|
20008
|
+
import_components76.Button,
|
|
19739
20009
|
{
|
|
19740
20010
|
className: "m-b-2",
|
|
19741
20011
|
block: true,
|
|
19742
|
-
size:
|
|
19743
|
-
type:
|
|
19744
|
-
priority:
|
|
20012
|
+
size: import_components76.Size.MEDIUM,
|
|
20013
|
+
type: import_components76.ControlType.ACCENT,
|
|
20014
|
+
priority: import_components76.Priority.SECONDARY,
|
|
19745
20015
|
onClick: onRetry,
|
|
19746
20016
|
children: intl.formatMessage(CameraCapture_messages_default.reviewRetry)
|
|
19747
20017
|
}
|
|
19748
20018
|
)
|
|
19749
20019
|
] }) }) });
|
|
19750
20020
|
};
|
|
19751
|
-
var CaptureButton = ({ onClick }) => /* @__PURE__ */ (0,
|
|
20021
|
+
var CaptureButton = ({ onClick }) => /* @__PURE__ */ (0, import_jsx_runtime121.jsx)(
|
|
19752
20022
|
"button",
|
|
19753
20023
|
{
|
|
19754
20024
|
type: "button",
|
|
19755
20025
|
className: "camera-capture-btn m-b-2",
|
|
19756
20026
|
"data-testid": "camera-capture-button",
|
|
19757
20027
|
onClick,
|
|
19758
|
-
children: /* @__PURE__ */ (0,
|
|
20028
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime121.jsx)("span", { className: "camera-capture-btn-inner" })
|
|
19759
20029
|
}
|
|
19760
20030
|
);
|
|
19761
20031
|
|
|
@@ -19773,11 +20043,11 @@ var OrientationLockOverlay_messages_default = (0, import_react_intl48.defineMess
|
|
|
19773
20043
|
});
|
|
19774
20044
|
|
|
19775
20045
|
// src/common/cameraCapture/components/orientationLockOverlay/OrientationLockOverlay.tsx
|
|
19776
|
-
var
|
|
20046
|
+
var import_jsx_runtime122 = require("react/jsx-runtime");
|
|
19777
20047
|
function OrientationLockOverlay() {
|
|
19778
20048
|
const intl = (0, import_react_intl49.useIntl)();
|
|
19779
|
-
return /* @__PURE__ */ (0,
|
|
19780
|
-
/* @__PURE__ */ (0,
|
|
20049
|
+
return /* @__PURE__ */ (0, import_jsx_runtime122.jsxs)("div", { className: "orientation-lock-overlay", children: [
|
|
20050
|
+
/* @__PURE__ */ (0, import_jsx_runtime122.jsx)(
|
|
19781
20051
|
"img",
|
|
19782
20052
|
{
|
|
19783
20053
|
className: "m-b-3",
|
|
@@ -19787,7 +20057,7 @@ function OrientationLockOverlay() {
|
|
|
19787
20057
|
alt: ""
|
|
19788
20058
|
}
|
|
19789
20059
|
),
|
|
19790
|
-
/* @__PURE__ */ (0,
|
|
20060
|
+
/* @__PURE__ */ (0, import_jsx_runtime122.jsx)("p", { className: "text-center m-b-0", children: intl.formatMessage(OrientationLockOverlay_messages_default.text) })
|
|
19791
20061
|
] });
|
|
19792
20062
|
}
|
|
19793
20063
|
var OrientationLockOverlay_default = OrientationLockOverlay;
|
|
@@ -19962,7 +20232,7 @@ var getVideoConstraints = async (dir) => {
|
|
|
19962
20232
|
|
|
19963
20233
|
// src/common/cameraCapture/overlay/Overlay.tsx
|
|
19964
20234
|
var import_react61 = require("react");
|
|
19965
|
-
var
|
|
20235
|
+
var import_jsx_runtime123 = require("react/jsx-runtime");
|
|
19966
20236
|
var captureButtonHeight = 92;
|
|
19967
20237
|
var reviewButtonsHeight = 120;
|
|
19968
20238
|
var imageHeight = 40;
|
|
@@ -19984,18 +20254,18 @@ function Overlay({ overlay, outline, imageUrl, title, instructions, reviewInstru
|
|
|
19984
20254
|
return () => window.removeEventListener("resize", listener);
|
|
19985
20255
|
});
|
|
19986
20256
|
let helperBoxHeight = (imageUrl ? imageHeight : 0) + (title ? titleHeight : 0) + (instructions ? instructionsHeight : 0);
|
|
19987
|
-
let helperBox = /* @__PURE__ */ (0,
|
|
19988
|
-
imageUrl && /* @__PURE__ */ (0,
|
|
19989
|
-
title && /* @__PURE__ */ (0,
|
|
19990
|
-
instructions && /* @__PURE__ */ (0,
|
|
20257
|
+
let helperBox = /* @__PURE__ */ (0, import_jsx_runtime123.jsxs)(import_jsx_runtime123.Fragment, { children: [
|
|
20258
|
+
imageUrl && /* @__PURE__ */ (0, import_jsx_runtime123.jsx)("img", { className: "camera-capture-img", src: imageUrl, alt: "" }),
|
|
20259
|
+
title && /* @__PURE__ */ (0, import_jsx_runtime123.jsx)("h4", { className: "camera-capture-title", children: title }),
|
|
20260
|
+
instructions && /* @__PURE__ */ (0, import_jsx_runtime123.jsx)("small", { className: "camera-capture-instructions", children: instructions })
|
|
19991
20261
|
] });
|
|
19992
20262
|
const frameBottomMargin = captureButtonHeight + helperBoxHeight;
|
|
19993
20263
|
if (reviewInstructions) {
|
|
19994
20264
|
helperBoxHeight = frameBottomMargin - reviewButtonsHeight;
|
|
19995
|
-
helperBox = /* @__PURE__ */ (0,
|
|
20265
|
+
helperBox = /* @__PURE__ */ (0, import_jsx_runtime123.jsx)("small", { className: "camera-capture-instructions", children: reviewInstructions });
|
|
19996
20266
|
const frameWithReviewInstructionsMinBottomMargin = reviewButtonsHeight + reviewInstructionsHeight;
|
|
19997
20267
|
if (frameBottomMargin < frameWithReviewInstructionsMinBottomMargin) {
|
|
19998
|
-
helperBox = /* @__PURE__ */ (0,
|
|
20268
|
+
helperBox = /* @__PURE__ */ (0, import_jsx_runtime123.jsx)(import_jsx_runtime123.Fragment, {});
|
|
19999
20269
|
}
|
|
20000
20270
|
}
|
|
20001
20271
|
const framePosition = {
|
|
@@ -20013,32 +20283,32 @@ function Overlay({ overlay, outline, imageUrl, title, instructions, reviewInstru
|
|
|
20013
20283
|
width: "90%"
|
|
20014
20284
|
}
|
|
20015
20285
|
};
|
|
20016
|
-
return /* @__PURE__ */ (0,
|
|
20017
|
-
/* @__PURE__ */ (0,
|
|
20018
|
-
/* @__PURE__ */ (0,
|
|
20019
|
-
/* @__PURE__ */ (0,
|
|
20286
|
+
return /* @__PURE__ */ (0, import_jsx_runtime123.jsxs)("svg", { ref: svgReference, xmlns: "http://www.w3.org/2000/svg", children: [
|
|
20287
|
+
/* @__PURE__ */ (0, import_jsx_runtime123.jsx)("defs", { children: /* @__PURE__ */ (0, import_jsx_runtime123.jsxs)("mask", { id: "mask", children: [
|
|
20288
|
+
/* @__PURE__ */ (0, import_jsx_runtime123.jsx)("rect", { width: "100%", height: "100%", fill: "#fff" }),
|
|
20289
|
+
/* @__PURE__ */ (0, import_jsx_runtime123.jsx)("image", __spreadValues({ href: overlay }, framePosition))
|
|
20020
20290
|
] }) }),
|
|
20021
|
-
overlay && /* @__PURE__ */ (0,
|
|
20022
|
-
outline && /* @__PURE__ */ (0,
|
|
20023
|
-
/* @__PURE__ */ (0,
|
|
20291
|
+
overlay && /* @__PURE__ */ (0, import_jsx_runtime123.jsx)("rect", { width: "100%", height: "100%", mask: "url(#mask)", fillOpacity: "0.72" }),
|
|
20292
|
+
outline && /* @__PURE__ */ (0, import_jsx_runtime123.jsx)("image", __spreadValues({ href: outline }, framePosition)),
|
|
20293
|
+
/* @__PURE__ */ (0, import_jsx_runtime123.jsx)("foreignObject", { width: "100%", height: "100%", children: /* @__PURE__ */ (0, import_jsx_runtime123.jsx)("div", __spreadProps(__spreadValues({ className: "camera-capture-text-and-image-container" }, helperBoxPosition), { children: helperBox })) })
|
|
20024
20294
|
] });
|
|
20025
20295
|
}
|
|
20026
20296
|
var Overlay_default = Overlay;
|
|
20027
20297
|
|
|
20028
20298
|
// src/common/cameraCapture/screens/cameraErrorScreen/CameraErrorScreen.tsx
|
|
20029
|
-
var
|
|
20030
|
-
var
|
|
20299
|
+
var import_components77 = require("@transferwise/components");
|
|
20300
|
+
var import_jsx_runtime124 = require("react/jsx-runtime");
|
|
20031
20301
|
function CameraErrorScreen({ title, description, actionButton, onAction }) {
|
|
20032
|
-
return /* @__PURE__ */ (0,
|
|
20033
|
-
/* @__PURE__ */ (0,
|
|
20034
|
-
/* @__PURE__ */ (0,
|
|
20035
|
-
onAction && actionButton && /* @__PURE__ */ (0,
|
|
20302
|
+
return /* @__PURE__ */ (0, import_jsx_runtime124.jsx)("div", { className: "container p-t-5", children: /* @__PURE__ */ (0, import_jsx_runtime124.jsx)("div", { className: "row", children: /* @__PURE__ */ (0, import_jsx_runtime124.jsxs)("div", { className: "col-md-6 col-md-offset-3", children: [
|
|
20303
|
+
/* @__PURE__ */ (0, import_jsx_runtime124.jsx)("h2", { className: "text-xs-center m-b-3", children: title }),
|
|
20304
|
+
/* @__PURE__ */ (0, import_jsx_runtime124.jsx)("p", { className: "text-xs-center m-b-5", children: description }),
|
|
20305
|
+
onAction && actionButton && /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(import_components77.Button, { block: true, onClick: onAction, children: actionButton })
|
|
20036
20306
|
] }) }) });
|
|
20037
20307
|
}
|
|
20038
20308
|
var CameraErrorScreen_default = CameraErrorScreen;
|
|
20039
20309
|
|
|
20040
20310
|
// src/common/cameraCapture/CameraCapture.tsx
|
|
20041
|
-
var
|
|
20311
|
+
var import_jsx_runtime125 = require("react/jsx-runtime");
|
|
20042
20312
|
function CameraCapture({
|
|
20043
20313
|
direction = "back",
|
|
20044
20314
|
overlay = "",
|
|
@@ -20146,8 +20416,8 @@ function CameraCapture({
|
|
|
20146
20416
|
exitFullScreen();
|
|
20147
20417
|
}
|
|
20148
20418
|
}, [mode, exitFullScreen]);
|
|
20149
|
-
const captureScreen = /* @__PURE__ */ (0,
|
|
20150
|
-
videoConstraints && /* @__PURE__ */ (0,
|
|
20419
|
+
const captureScreen = /* @__PURE__ */ (0, import_jsx_runtime125.jsxs)("div", { className: "camera-capture", children: [
|
|
20420
|
+
videoConstraints && /* @__PURE__ */ (0, import_jsx_runtime125.jsx)(
|
|
20151
20421
|
import_react_webcam.default,
|
|
20152
20422
|
{
|
|
20153
20423
|
ref: webcamReference,
|
|
@@ -20158,7 +20428,7 @@ function CameraCapture({
|
|
|
20158
20428
|
onUserMedia: handleUserMedia
|
|
20159
20429
|
}
|
|
20160
20430
|
),
|
|
20161
|
-
/* @__PURE__ */ (0,
|
|
20431
|
+
/* @__PURE__ */ (0, import_jsx_runtime125.jsx)(
|
|
20162
20432
|
Overlay_default,
|
|
20163
20433
|
{
|
|
20164
20434
|
overlay,
|
|
@@ -20168,8 +20438,8 @@ function CameraCapture({
|
|
|
20168
20438
|
instructions
|
|
20169
20439
|
}
|
|
20170
20440
|
),
|
|
20171
|
-
shouldLockOrientation && /* @__PURE__ */ (0,
|
|
20172
|
-
ready && /* @__PURE__ */ (0,
|
|
20441
|
+
shouldLockOrientation && /* @__PURE__ */ (0, import_jsx_runtime125.jsx)(OrientationLockOverlay_default, {}),
|
|
20442
|
+
ready && /* @__PURE__ */ (0, import_jsx_runtime125.jsx)(
|
|
20173
20443
|
CaptureBottomBar,
|
|
20174
20444
|
{
|
|
20175
20445
|
onCapture: () => {
|
|
@@ -20178,9 +20448,9 @@ function CameraCapture({
|
|
|
20178
20448
|
}
|
|
20179
20449
|
)
|
|
20180
20450
|
] });
|
|
20181
|
-
const reviewScreen = /* @__PURE__ */ (0,
|
|
20182
|
-
/* @__PURE__ */ (0,
|
|
20183
|
-
/* @__PURE__ */ (0,
|
|
20451
|
+
const reviewScreen = /* @__PURE__ */ (0, import_jsx_runtime125.jsxs)("div", { className: "camera-capture", children: [
|
|
20452
|
+
/* @__PURE__ */ (0, import_jsx_runtime125.jsx)("img", { className: "review-image", src: reviewImage == null ? void 0 : reviewImage.source, alt: "" }),
|
|
20453
|
+
/* @__PURE__ */ (0, import_jsx_runtime125.jsx)(
|
|
20184
20454
|
Overlay_default,
|
|
20185
20455
|
{
|
|
20186
20456
|
overlay,
|
|
@@ -20190,18 +20460,18 @@ function CameraCapture({
|
|
|
20190
20460
|
reviewInstructions: intl.formatMessage(CameraCapture_messages_default.reviewInstructions)
|
|
20191
20461
|
}
|
|
20192
20462
|
),
|
|
20193
|
-
/* @__PURE__ */ (0,
|
|
20463
|
+
/* @__PURE__ */ (0, import_jsx_runtime125.jsx)(ReviewBottomBar, { onSubmit: handleReviewSubmit, onRetry: handleReviewRetry })
|
|
20194
20464
|
] });
|
|
20195
|
-
return /* @__PURE__ */ (0,
|
|
20465
|
+
return /* @__PURE__ */ (0, import_jsx_runtime125.jsxs)("section", { children: [
|
|
20196
20466
|
mode === "CAPTURE" /* CAPTURE */ && captureScreen,
|
|
20197
20467
|
mode === "REVIEW" /* REVIEW */ && reviewScreen,
|
|
20198
|
-
mode === "ERROR" /* ERROR */ && cameraError && /* @__PURE__ */ (0,
|
|
20468
|
+
mode === "ERROR" /* ERROR */ && cameraError && /* @__PURE__ */ (0, import_jsx_runtime125.jsx)(CameraErrorScreen_default, __spreadValues({}, cameraError))
|
|
20199
20469
|
] });
|
|
20200
20470
|
}
|
|
20201
20471
|
var CameraCapture_default = CameraCapture;
|
|
20202
20472
|
|
|
20203
20473
|
// src/legacy/step/cameraStep/CameraStep.tsx
|
|
20204
|
-
var
|
|
20474
|
+
var import_jsx_runtime126 = require("react/jsx-runtime");
|
|
20205
20475
|
function blobToBase64(blob) {
|
|
20206
20476
|
return new Promise((resolve, _) => {
|
|
20207
20477
|
const reader = new FileReader();
|
|
@@ -20239,7 +20509,7 @@ function CameraStep(props) {
|
|
|
20239
20509
|
});
|
|
20240
20510
|
}
|
|
20241
20511
|
};
|
|
20242
|
-
return /* @__PURE__ */ (0,
|
|
20512
|
+
return /* @__PURE__ */ (0, import_jsx_runtime126.jsx)(
|
|
20243
20513
|
CameraCapture_default,
|
|
20244
20514
|
{
|
|
20245
20515
|
overlay,
|
|
@@ -20316,12 +20586,12 @@ var external_confirmation_messages_default2 = (0, import_react_intl51.defineMess
|
|
|
20316
20586
|
});
|
|
20317
20587
|
|
|
20318
20588
|
// src/legacy/step/externalConfirmationStep/ExternalConfirmationStep.tsx
|
|
20319
|
-
var
|
|
20589
|
+
var import_jsx_runtime127 = require("react/jsx-runtime");
|
|
20320
20590
|
var noop6 = () => {
|
|
20321
20591
|
};
|
|
20322
20592
|
function ExternalConfirmationStep({ url, onClose }) {
|
|
20323
20593
|
const { formatMessage } = (0, import_react_intl52.useIntl)();
|
|
20324
|
-
return /* @__PURE__ */ (0,
|
|
20594
|
+
return /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(
|
|
20325
20595
|
DynamicLayout_default,
|
|
20326
20596
|
{
|
|
20327
20597
|
components: [
|
|
@@ -20386,11 +20656,11 @@ function getOrigin2(url) {
|
|
|
20386
20656
|
}
|
|
20387
20657
|
|
|
20388
20658
|
// src/legacy/dynamicFlow/BackButton.tsx
|
|
20389
|
-
var
|
|
20659
|
+
var import_components79 = require("@transferwise/components");
|
|
20390
20660
|
var import_icons6 = require("@transferwise/icons");
|
|
20391
|
-
var
|
|
20661
|
+
var import_jsx_runtime128 = require("react/jsx-runtime");
|
|
20392
20662
|
function BackButton2({ title, action, onAction }) {
|
|
20393
|
-
return /* @__PURE__ */ (0,
|
|
20663
|
+
return /* @__PURE__ */ (0, import_jsx_runtime128.jsx)("div", { className: "m-b-2", children: /* @__PURE__ */ (0, import_jsx_runtime128.jsxs)(
|
|
20394
20664
|
"a",
|
|
20395
20665
|
{
|
|
20396
20666
|
href: "/",
|
|
@@ -20401,8 +20671,8 @@ function BackButton2({ title, action, onAction }) {
|
|
|
20401
20671
|
onAction(__spreadProps(__spreadValues({}, action), { skipValidation: true }));
|
|
20402
20672
|
},
|
|
20403
20673
|
children: [
|
|
20404
|
-
/* @__PURE__ */ (0,
|
|
20405
|
-
/* @__PURE__ */ (0,
|
|
20674
|
+
/* @__PURE__ */ (0, import_jsx_runtime128.jsx)("span", { className: "sr-only", children: title }),
|
|
20675
|
+
/* @__PURE__ */ (0, import_jsx_runtime128.jsx)(import_components79.Avatar, { type: "icon", children: /* @__PURE__ */ (0, import_jsx_runtime128.jsx)(import_icons6.ArrowLeft, { size: "24" }) })
|
|
20406
20676
|
]
|
|
20407
20677
|
}
|
|
20408
20678
|
) });
|
|
@@ -20410,7 +20680,7 @@ function BackButton2({ title, action, onAction }) {
|
|
|
20410
20680
|
var BackButton_default2 = BackButton2;
|
|
20411
20681
|
|
|
20412
20682
|
// src/legacy/dynamicFlow/DynamicFlowStep.tsx
|
|
20413
|
-
var
|
|
20683
|
+
var import_jsx_runtime129 = require("react/jsx-runtime");
|
|
20414
20684
|
function DynamicFlowStep(props) {
|
|
20415
20685
|
var _a, _b, _c;
|
|
20416
20686
|
const { step, globalError, onAction } = props;
|
|
@@ -20419,20 +20689,20 @@ function DynamicFlowStep(props) {
|
|
|
20419
20689
|
const { requiresManualTrigger, dismissConfirmation } = useExternal2(externalUrl);
|
|
20420
20690
|
if (step === void 0) {
|
|
20421
20691
|
if (globalError) {
|
|
20422
|
-
return /* @__PURE__ */ (0,
|
|
20692
|
+
return /* @__PURE__ */ (0, import_jsx_runtime129.jsx)(DynamicAlert_default, { component: { context: "negative", markdown: globalError, margin: "lg" } });
|
|
20423
20693
|
}
|
|
20424
20694
|
return null;
|
|
20425
20695
|
}
|
|
20426
20696
|
if (externalUrl && requiresManualTrigger) {
|
|
20427
|
-
return /* @__PURE__ */ (0,
|
|
20697
|
+
return /* @__PURE__ */ (0, import_jsx_runtime129.jsx)(ExternalConfirmationStep_default, { url: externalUrl, onClose: dismissConfirmation });
|
|
20428
20698
|
}
|
|
20429
20699
|
if (isCameraStep(step)) {
|
|
20430
|
-
return /* @__PURE__ */ (0,
|
|
20700
|
+
return /* @__PURE__ */ (0, import_jsx_runtime129.jsx)(CameraStep_default, __spreadProps(__spreadValues({}, props), { step }));
|
|
20431
20701
|
}
|
|
20432
|
-
return /* @__PURE__ */ (0,
|
|
20433
|
-
backButton && /* @__PURE__ */ (0,
|
|
20434
|
-
globalError ? /* @__PURE__ */ (0,
|
|
20435
|
-
/* @__PURE__ */ (0,
|
|
20702
|
+
return /* @__PURE__ */ (0, import_jsx_runtime129.jsxs)(import_jsx_runtime129.Fragment, { children: [
|
|
20703
|
+
backButton && /* @__PURE__ */ (0, import_jsx_runtime129.jsx)(BackButton_default2, __spreadProps(__spreadValues({}, backButton), { onAction })),
|
|
20704
|
+
globalError ? /* @__PURE__ */ (0, import_jsx_runtime129.jsx)(DynamicAlert_default, { component: { context: "negative", markdown: globalError, margin: "lg" } }) : null,
|
|
20705
|
+
/* @__PURE__ */ (0, import_jsx_runtime129.jsx)(LayoutStep_default, __spreadProps(__spreadValues({}, props), { stepSpecification: step }))
|
|
20436
20706
|
] });
|
|
20437
20707
|
}
|
|
20438
20708
|
|
|
@@ -20579,19 +20849,19 @@ var getSchemaReference = (component) => {
|
|
|
20579
20849
|
var isInlineSchema = (schema) => schema !== void 0 && typeof schema === "object" && !Object.hasOwnProperty.call(schema, "$ref");
|
|
20580
20850
|
|
|
20581
20851
|
// src/legacy/dynamicFlow/utils/useLoader.tsx
|
|
20582
|
-
var
|
|
20852
|
+
var import_components80 = require("@transferwise/components");
|
|
20583
20853
|
var import_react66 = require("react");
|
|
20584
|
-
var
|
|
20854
|
+
var import_jsx_runtime130 = require("react/jsx-runtime");
|
|
20585
20855
|
function useLoader(loaderConfig, initialState) {
|
|
20586
20856
|
const config = __spreadValues({
|
|
20587
|
-
size:
|
|
20857
|
+
size: import_components80.Size.EXTRA_LARGE,
|
|
20588
20858
|
initial: true,
|
|
20589
20859
|
submission: false
|
|
20590
20860
|
}, loaderConfig);
|
|
20591
20861
|
const [loadingState, setLoadingState] = (0, import_react66.useState)(initialState);
|
|
20592
20862
|
const shouldDisplayLoader = config.initial && loadingState === "initial" || config.submission && loadingState === "submission";
|
|
20593
|
-
const loader = shouldDisplayLoader ? /* @__PURE__ */ (0,
|
|
20594
|
-
|
|
20863
|
+
const loader = shouldDisplayLoader ? /* @__PURE__ */ (0, import_jsx_runtime130.jsx)(
|
|
20864
|
+
import_components80.Loader,
|
|
20595
20865
|
{
|
|
20596
20866
|
size: config.size,
|
|
20597
20867
|
classNames: { "tw-loader": "tw-loader m-x-auto" },
|
|
@@ -20710,7 +20980,7 @@ var useErrorResponse = () => {
|
|
|
20710
20980
|
};
|
|
20711
20981
|
|
|
20712
20982
|
// src/legacy/dynamicFlow/DynamicFlow.tsx
|
|
20713
|
-
var
|
|
20983
|
+
var import_jsx_runtime131 = require("react/jsx-runtime");
|
|
20714
20984
|
var noop7 = () => {
|
|
20715
20985
|
};
|
|
20716
20986
|
var DynamicFlowComponent = ({
|
|
@@ -20953,7 +21223,7 @@ var DynamicFlowComponent = ({
|
|
|
20953
21223
|
await performAction(action);
|
|
20954
21224
|
}
|
|
20955
21225
|
};
|
|
20956
|
-
return /* @__PURE__ */ (0,
|
|
21226
|
+
return /* @__PURE__ */ (0, import_jsx_runtime131.jsx)(LogProvider, { flowId, stepId: (step == null ? void 0 : step.id) || (step == null ? void 0 : step.key), onLog, children: /* @__PURE__ */ (0, import_jsx_runtime131.jsx)(EventsContextProvider, { metadata: analyticsMetadata, onEvent, children: /* @__PURE__ */ (0, import_jsx_runtime131.jsx)(DynamicFlowProvider, { loading: isLoading || isDebouncing, children: /* @__PURE__ */ (0, import_jsx_runtime131.jsx)(HttpClientProvider, { httpClient, children: /* @__PURE__ */ (0, import_jsx_runtime131.jsx)(FeatureContextProvider, { features, children: loader !== null ? loader : /* @__PURE__ */ (0, import_jsx_runtime131.jsx)("div", { id: (step == null ? void 0 : step.id) || (step == null ? void 0 : step.key), className: "dynamic-flow-legacy", children: /* @__PURE__ */ (0, import_jsx_runtime131.jsx)(
|
|
20957
21227
|
DynamicFlowStep,
|
|
20958
21228
|
{
|
|
20959
21229
|
step,
|
|
@@ -20970,7 +21240,7 @@ var DynamicFlowComponent = ({
|
|
|
20970
21240
|
) }) }) }) }) }) });
|
|
20971
21241
|
};
|
|
20972
21242
|
function DynamicFlow(props) {
|
|
20973
|
-
return /* @__PURE__ */ (0,
|
|
21243
|
+
return /* @__PURE__ */ (0, import_jsx_runtime131.jsx)(ErrorBoundary_default, { onError: props.onError, children: /* @__PURE__ */ (0, import_jsx_runtime131.jsx)(DynamicFlowComponent, __spreadValues({}, props)) });
|
|
20974
21244
|
}
|
|
20975
21245
|
var DynamicFlow_default = DynamicFlow;
|
|
20976
21246
|
var combineModels2 = (formModels) => Object.values(formModels).reduce((previous, model) => __spreadValues(__spreadValues({}, previous), model), {});
|
|
@@ -20987,19 +21257,19 @@ var shouldTriggerRefresh = (props) => {
|
|
|
20987
21257
|
};
|
|
20988
21258
|
|
|
20989
21259
|
// src/legacy/jsonSchemaForm/JsonSchemaForm.tsx
|
|
20990
|
-
var
|
|
21260
|
+
var import_jsx_runtime132 = require("react/jsx-runtime");
|
|
20991
21261
|
function JsonSchemaForm(props) {
|
|
20992
21262
|
const schemaProps = __spreadValues({
|
|
20993
21263
|
model: null,
|
|
20994
21264
|
errors: null
|
|
20995
21265
|
}, props);
|
|
20996
21266
|
const { baseUrl = "", onEvent = noop8, onLog = noop8 } = props;
|
|
20997
|
-
return /* @__PURE__ */ (0,
|
|
21267
|
+
return /* @__PURE__ */ (0, import_jsx_runtime132.jsx)(LogProvider, { flowId: "JsonSchemaForm", stepId: "JsonSchemaForm", onLog, children: /* @__PURE__ */ (0, import_jsx_runtime132.jsx)(
|
|
20998
21268
|
EventsContextProvider,
|
|
20999
21269
|
{
|
|
21000
21270
|
metadata: { flowId: "JsonSchemaForm", stepId: "JsonSchemaForm" },
|
|
21001
21271
|
onEvent,
|
|
21002
|
-
children: /* @__PURE__ */ (0,
|
|
21272
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime132.jsx)(HttpClientProviderFromBaseUrl, { baseUrl, children: /* @__PURE__ */ (0, import_jsx_runtime132.jsx)(GenericSchema_default, __spreadValues({}, schemaProps)) })
|
|
21003
21273
|
}
|
|
21004
21274
|
) });
|
|
21005
21275
|
}
|