@wise/dynamic-flow-client 3.32.0 → 3.33.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/main.js +785 -529
- package/build/main.min.js +1 -1
- package/build/main.mjs +717 -461
- package/build/types/revamp/domain/components/DecisionComponent.d.ts +3 -2
- package/build/types/revamp/domain/components/ListComponent.d.ts +30 -0
- package/build/types/revamp/domain/features/summary/summary-utils.d.ts +1 -1
- package/build/types/revamp/domain/mappers/layout/decisionLayoutToComponent.d.ts +7 -2
- package/build/types/revamp/domain/mappers/layout/deprecatedListLayoutToComponent.d.ts +2 -0
- package/build/types/revamp/domain/mappers/layout/listLayoutToComponent.d.ts +4 -2
- package/build/types/revamp/domain/types.d.ts +9 -2
- package/build/types/revamp/renderers/mappers/listComponentToProps.d.ts +3 -0
- package/build/types/revamp/renderers/mappers/utils/inputComponentToProps.d.ts +5 -1
- package/package.json +2 -2
package/build/main.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");
|
|
@@ -1699,17 +1715,25 @@ var numberInputComponentToProps = (component) => __spreadProps(__spreadValues({}
|
|
|
1699
1715
|
});
|
|
1700
1716
|
|
|
1701
1717
|
// src/revamp/renderers/mappers/objectComponentToProps.ts
|
|
1702
|
-
var objectComponentToProps = (component, children) =>
|
|
1703
|
-
|
|
1704
|
-
|
|
1705
|
-
|
|
1706
|
-
})
|
|
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
|
+
};
|
|
1707
1730
|
|
|
1708
1731
|
// src/revamp/renderers/mappers/paragraphComponentToProps.ts
|
|
1709
1732
|
var paragraphComponentToProps = (component) => pick(component, "type", "align", "control", "margin", "text");
|
|
1710
1733
|
|
|
1711
1734
|
// src/revamp/renderers/mappers/repeatableComponentToProps.ts
|
|
1712
1735
|
var repeatableComponentToProps = (component, children, editableItemChildren) => {
|
|
1736
|
+
var _a, _b;
|
|
1713
1737
|
const {
|
|
1714
1738
|
addItemTitle,
|
|
1715
1739
|
control,
|
|
@@ -1728,13 +1752,26 @@ var repeatableComponentToProps = (component, children, editableItemChildren) =>
|
|
|
1728
1752
|
onSave,
|
|
1729
1753
|
onRemove
|
|
1730
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
|
+
};
|
|
1731
1768
|
const getSummary = (componentSummary) => {
|
|
1732
|
-
var
|
|
1769
|
+
var _a2, _b2, _c;
|
|
1733
1770
|
return {
|
|
1734
|
-
title: (
|
|
1735
|
-
description: (
|
|
1771
|
+
title: (_a2 = componentSummary.title) != null ? _a2 : summaryDefaults.title,
|
|
1772
|
+
description: (_b2 = componentSummary.description) != null ? _b2 : summaryDefaults.description,
|
|
1736
1773
|
icon: (_c = componentSummary.icon) != null ? _c : summaryDefaults.icon,
|
|
1737
|
-
image: (
|
|
1774
|
+
image: getSummaryImage(componentSummary)
|
|
1738
1775
|
};
|
|
1739
1776
|
};
|
|
1740
1777
|
const itemProps = components.map((childComponent) => __spreadProps(__spreadValues({}, getSummary(childComponent.getSummary())), {
|
|
@@ -1750,7 +1787,11 @@ var repeatableComponentToProps = (component, children, editableItemChildren) =>
|
|
|
1750
1787
|
editItemTitle,
|
|
1751
1788
|
error: errors == null ? void 0 : errors[0],
|
|
1752
1789
|
icon,
|
|
1753
|
-
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,
|
|
1754
1795
|
items: itemProps,
|
|
1755
1796
|
maxItems,
|
|
1756
1797
|
minItems,
|
|
@@ -1868,10 +1909,32 @@ var uploadInputComponentToProps = (component) => {
|
|
|
1868
1909
|
};
|
|
1869
1910
|
|
|
1870
1911
|
// src/revamp/renderers/mappers/tupleComponentToProps.ts
|
|
1871
|
-
var tupleComponentToProps = (component, children) =>
|
|
1872
|
-
|
|
1873
|
-
|
|
1874
|
-
|
|
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
|
+
})
|
|
1875
1938
|
});
|
|
1876
1939
|
|
|
1877
1940
|
// src/revamp/renderers/mappers/componentToRendererProps.ts
|
|
@@ -1915,6 +1978,8 @@ var componentToRendererProps = (component, nestedContent) => {
|
|
|
1915
1978
|
return instructionsComponentToProps(component);
|
|
1916
1979
|
case "integer":
|
|
1917
1980
|
return integerInputComponentToProps(component);
|
|
1981
|
+
case "list":
|
|
1982
|
+
return listComponentToProps(component);
|
|
1918
1983
|
case "loading-indicator":
|
|
1919
1984
|
return loadingIndicatorComponentToProps(component);
|
|
1920
1985
|
case "markdown":
|
|
@@ -6237,10 +6302,14 @@ var actionSchema = z.object({
|
|
|
6237
6302
|
skipValidation: z.boolean().optional()
|
|
6238
6303
|
});
|
|
6239
6304
|
var listLayoutItemSchema = z.object({
|
|
6240
|
-
title: z.string(),
|
|
6241
6305
|
description: z.string().optional(),
|
|
6242
|
-
|
|
6243
|
-
|
|
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()
|
|
6244
6313
|
});
|
|
6245
6314
|
var decisionLayoutOptionSchema = z.object({
|
|
6246
6315
|
action: actionSchema,
|
|
@@ -6261,6 +6330,11 @@ var behaviorSchema = z.object({
|
|
|
6261
6330
|
action: actionSchema.optional(),
|
|
6262
6331
|
link: linkSchema.optional()
|
|
6263
6332
|
});
|
|
6333
|
+
var itemCallToActionSchema = z.object({
|
|
6334
|
+
title: z.string(),
|
|
6335
|
+
accessibilityDescription: z.string().optional(),
|
|
6336
|
+
behavior: behaviorSchema
|
|
6337
|
+
});
|
|
6264
6338
|
var buttonLayoutSchema = z.object({
|
|
6265
6339
|
type: z.literal("button"),
|
|
6266
6340
|
size: sizeSchema.optional(),
|
|
@@ -6324,12 +6398,10 @@ var alertLayoutCallToActionSchema = z.object({
|
|
|
6324
6398
|
accessibilityDescription: z.string().optional(),
|
|
6325
6399
|
behavior: behaviorSchema
|
|
6326
6400
|
});
|
|
6327
|
-
var
|
|
6328
|
-
|
|
6329
|
-
|
|
6330
|
-
|
|
6331
|
-
control: z.string().optional(),
|
|
6332
|
-
margin: sizeSchema.optional()
|
|
6401
|
+
var listLayoutCallToActionSchema = z.object({
|
|
6402
|
+
title: z.string(),
|
|
6403
|
+
accessibilityDescription: z.string().optional(),
|
|
6404
|
+
behavior: behaviorSchema
|
|
6333
6405
|
});
|
|
6334
6406
|
var decisionLayoutSchema = z.object({
|
|
6335
6407
|
type: z.literal("decision"),
|
|
@@ -6338,10 +6410,12 @@ var decisionLayoutSchema = z.object({
|
|
|
6338
6410
|
control: z.string().optional(),
|
|
6339
6411
|
margin: sizeSchema.optional()
|
|
6340
6412
|
});
|
|
6341
|
-
var
|
|
6413
|
+
var statusListLayoutItemSchema = z.object({
|
|
6342
6414
|
title: z.string(),
|
|
6343
|
-
|
|
6344
|
-
|
|
6415
|
+
description: z.string().optional(),
|
|
6416
|
+
icon: iconSchema,
|
|
6417
|
+
status: statusListLayoutStatusSchema.optional(),
|
|
6418
|
+
callToAction: itemCallToActionSchema.optional()
|
|
6345
6419
|
});
|
|
6346
6420
|
var reviewLayoutSchema = z.object({
|
|
6347
6421
|
type: z.literal("review"),
|
|
@@ -6375,12 +6449,20 @@ var alertLayoutSchema = z.object({
|
|
|
6375
6449
|
margin: sizeSchema.optional(),
|
|
6376
6450
|
callToAction: alertLayoutCallToActionSchema.optional()
|
|
6377
6451
|
});
|
|
6378
|
-
var
|
|
6379
|
-
|
|
6380
|
-
|
|
6381
|
-
|
|
6382
|
-
|
|
6383
|
-
|
|
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()
|
|
6384
6466
|
});
|
|
6385
6467
|
var searchResponseBodySchema = z.object({
|
|
6386
6468
|
results: z.array(searchResultSchema)
|
|
@@ -6423,13 +6505,6 @@ var constSchemaSchema = z.object({
|
|
|
6423
6505
|
analyticsId: z.string().optional(),
|
|
6424
6506
|
disabled: z.boolean().optional()
|
|
6425
6507
|
});
|
|
6426
|
-
var statusListLayoutSchema = z.object({
|
|
6427
|
-
type: z.literal("status-list"),
|
|
6428
|
-
items: z.array(statusListLayoutItemSchema),
|
|
6429
|
-
title: z.string().optional(),
|
|
6430
|
-
control: z.string().optional(),
|
|
6431
|
-
margin: sizeSchema.optional()
|
|
6432
|
-
});
|
|
6433
6508
|
var layoutSchema = z.lazy(
|
|
6434
6509
|
() => z.union([
|
|
6435
6510
|
alertLayoutSchema,
|
|
@@ -7175,7 +7250,7 @@ var buttonLayoutToComponent = (uid, button, mapperProps) => {
|
|
|
7175
7250
|
var buttonLayoutToComponentWithBehavior = (uid, button, mapperProps) => {
|
|
7176
7251
|
const { onAction, onLink, step } = mapperProps;
|
|
7177
7252
|
const { context, control, disabled, margin = "md", pinOrder, size: size2, title, behavior } = button;
|
|
7178
|
-
const
|
|
7253
|
+
const getOnClick2 = () => {
|
|
7179
7254
|
if ("type" in behavior) {
|
|
7180
7255
|
switch (behavior.type) {
|
|
7181
7256
|
case "action": {
|
|
@@ -7219,7 +7294,7 @@ var buttonLayoutToComponentWithBehavior = (uid, button, mapperProps) => {
|
|
|
7219
7294
|
pinOrder,
|
|
7220
7295
|
size: size2,
|
|
7221
7296
|
title: title != null ? title : "",
|
|
7222
|
-
onClick:
|
|
7297
|
+
onClick: getOnClick2()
|
|
7223
7298
|
});
|
|
7224
7299
|
};
|
|
7225
7300
|
var buttonLayoutToComponentWithAction = (uid, button, mapperProps) => {
|
|
@@ -7331,21 +7406,51 @@ var createDecisionComponent = (decisionProps) => __spreadProps(__spreadValues({
|
|
|
7331
7406
|
});
|
|
7332
7407
|
|
|
7333
7408
|
// src/revamp/domain/mappers/layout/decisionLayoutToComponent.ts
|
|
7334
|
-
var decisionLayoutToComponent = (uid, { control, margin = "md", options, title },
|
|
7409
|
+
var decisionLayoutToComponent = (uid, { control, margin = "md", options, title }, mapperProps) => createDecisionComponent({
|
|
7335
7410
|
uid,
|
|
7336
7411
|
control,
|
|
7337
7412
|
margin,
|
|
7338
|
-
options: options.map((
|
|
7339
|
-
|
|
7340
|
-
|
|
7341
|
-
|
|
7342
|
-
onClick: () => {
|
|
7343
|
-
void onAction(action);
|
|
7344
|
-
}
|
|
7413
|
+
options: options.map((option) => {
|
|
7414
|
+
return __spreadProps(__spreadValues({}, option), {
|
|
7415
|
+
href: getHref(option),
|
|
7416
|
+
onClick: getOnClick(option, mapperProps)
|
|
7345
7417
|
});
|
|
7346
7418
|
}),
|
|
7347
7419
|
title
|
|
7348
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
|
+
};
|
|
7349
7454
|
|
|
7350
7455
|
// src/revamp/domain/components/DividerComponent.ts
|
|
7351
7456
|
var createDividerComponent = (props) => __spreadProps(__spreadValues({
|
|
@@ -10623,14 +10728,14 @@ var getItemCallToAction = (callToAction, onAction, onLink) => {
|
|
|
10623
10728
|
};
|
|
10624
10729
|
};
|
|
10625
10730
|
|
|
10626
|
-
// src/revamp/domain/mappers/layout/
|
|
10627
|
-
var
|
|
10731
|
+
// src/revamp/domain/mappers/layout/deprecatedListLayoutToComponent.ts
|
|
10732
|
+
var deprecatedListLayoutToComponent = (uid, { control, items, margin = "md", title }) => createStatusListComponent({
|
|
10628
10733
|
uid,
|
|
10629
10734
|
control,
|
|
10630
10735
|
items: items.map(({ description, icon, status, title: itemTitle }) => ({
|
|
10631
10736
|
description,
|
|
10632
|
-
icon,
|
|
10633
|
-
title: itemTitle,
|
|
10737
|
+
icon: icon != null ? icon : { text: "" },
|
|
10738
|
+
title: itemTitle != null ? itemTitle : "",
|
|
10634
10739
|
status: status ? mapLegacyStatus(status) : void 0
|
|
10635
10740
|
})),
|
|
10636
10741
|
margin,
|
|
@@ -10648,6 +10753,68 @@ var mapLegacyStatus = (status) => {
|
|
|
10648
10753
|
}
|
|
10649
10754
|
};
|
|
10650
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
|
+
|
|
10651
10818
|
// src/revamp/domain/mappers/mapLayoutToComponent.ts
|
|
10652
10819
|
var mapLayoutToComponent = (uid, layout, mapperProps) => {
|
|
10653
10820
|
switch (layout.type) {
|
|
@@ -10674,7 +10841,10 @@ var mapLayoutToComponent = (uid, layout, mapperProps) => {
|
|
|
10674
10841
|
case "instructions":
|
|
10675
10842
|
return instructionsLayoutToComponent(uid, layout);
|
|
10676
10843
|
case "list":
|
|
10677
|
-
|
|
10844
|
+
if (layout.items.some((item) => item.status || item.description)) {
|
|
10845
|
+
return deprecatedListLayoutToComponent(uid, layout);
|
|
10846
|
+
}
|
|
10847
|
+
return listLayoutToComponent(uid, layout, mapperProps);
|
|
10678
10848
|
case "loading-indicator":
|
|
10679
10849
|
return loadingIndicatorLayoutToComponent(uid, layout);
|
|
10680
10850
|
case "markdown":
|
|
@@ -12007,9 +12177,14 @@ function NavigationOptionMedia({ icon, image }) {
|
|
|
12007
12177
|
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_components8.Avatar, { type: import_components8.AvatarType.INITIALS, children: icon.text });
|
|
12008
12178
|
}
|
|
12009
12179
|
}
|
|
12010
|
-
if (image
|
|
12011
|
-
const {
|
|
12012
|
-
|
|
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
|
+
}
|
|
12013
12188
|
}
|
|
12014
12189
|
return null;
|
|
12015
12190
|
}
|
|
@@ -12025,10 +12200,10 @@ function DecisionRendererComponent({ margin, options, title }) {
|
|
|
12025
12200
|
const { isLoading } = useLoadingContext();
|
|
12026
12201
|
return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: getMargin(margin), children: [
|
|
12027
12202
|
title && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_components9.Header, { as: "h2", title }),
|
|
12028
|
-
/* @__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)(
|
|
12029
12204
|
import_components9.NavigationOption,
|
|
12030
12205
|
{
|
|
12031
|
-
title:
|
|
12206
|
+
title: itemTitle,
|
|
12032
12207
|
content: description,
|
|
12033
12208
|
disabled: isLoading || disabled,
|
|
12034
12209
|
media: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(NavigationOptionMedia, { icon, image }),
|
|
@@ -12036,7 +12211,7 @@ function DecisionRendererComponent({ margin, options, title }) {
|
|
|
12036
12211
|
showMediaAtAllSizes: true,
|
|
12037
12212
|
onClick
|
|
12038
12213
|
},
|
|
12039
|
-
JSON.stringify(
|
|
12214
|
+
JSON.stringify(itemTitle)
|
|
12040
12215
|
)) })
|
|
12041
12216
|
] });
|
|
12042
12217
|
}
|
|
@@ -12144,8 +12319,8 @@ function ImageRendererComponent({
|
|
|
12144
12319
|
accessibilityDescription,
|
|
12145
12320
|
margin,
|
|
12146
12321
|
size: size2,
|
|
12147
|
-
|
|
12148
|
-
|
|
12322
|
+
uri,
|
|
12323
|
+
url
|
|
12149
12324
|
}) {
|
|
12150
12325
|
const [imageSource, setImageSource] = (0, import_react9.useState)("");
|
|
12151
12326
|
const httpClient = useRendererHttpClient();
|
|
@@ -12158,7 +12333,7 @@ function ImageRendererComponent({
|
|
|
12158
12333
|
void getImageSource(httpClient, uri).then(setImageSource);
|
|
12159
12334
|
return;
|
|
12160
12335
|
}
|
|
12161
|
-
}, [url, httpClient]);
|
|
12336
|
+
}, [uri, url, httpClient]);
|
|
12162
12337
|
return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: `df-image ${size2 || "md"}`, children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
12163
12338
|
import_components12.Image,
|
|
12164
12339
|
{
|
|
@@ -13855,6 +14030,72 @@ function StepRendererComponent(props) {
|
|
|
13855
14030
|
] });
|
|
13856
14031
|
}
|
|
13857
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
|
+
|
|
13858
14099
|
// ../renderers/src/getWiseRenderers.ts
|
|
13859
14100
|
var getWiseRenderers = () => [
|
|
13860
14101
|
AlertRenderer_default,
|
|
@@ -13872,6 +14113,7 @@ var getWiseRenderers = () => [
|
|
|
13872
14113
|
InstructionsRenderer_default,
|
|
13873
14114
|
IntegerInputRenderer_default,
|
|
13874
14115
|
LargeUploadRenderer,
|
|
14116
|
+
ListRenderer_default,
|
|
13875
14117
|
LoadingIndicatorRenderer_default,
|
|
13876
14118
|
MarkdownRenderer_default,
|
|
13877
14119
|
ModalRenderer_default,
|
|
@@ -13901,12 +14143,12 @@ var openLinkInNewTab = (url) => {
|
|
|
13901
14143
|
};
|
|
13902
14144
|
|
|
13903
14145
|
// src/revamp/DynamicFlowWise.tsx
|
|
13904
|
-
var
|
|
14146
|
+
var import_jsx_runtime60 = require("react/jsx-runtime");
|
|
13905
14147
|
var wiseRenderers = getWiseRenderers();
|
|
13906
14148
|
function DynamicFlowWise(props) {
|
|
13907
14149
|
const { httpClient, renderers, onLink = openLinkInNewTab } = props;
|
|
13908
14150
|
const mergedRenderers = (0, import_react20.useMemo)(() => [...renderers != null ? renderers : [], ...wiseRenderers], [renderers]);
|
|
13909
|
-
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 })) });
|
|
13910
14152
|
}
|
|
13911
14153
|
var DynamicFlowWise_default = DynamicFlowWise;
|
|
13912
14154
|
|
|
@@ -13915,14 +14157,14 @@ var import_react22 = require("react");
|
|
|
13915
14157
|
|
|
13916
14158
|
// src/common/httpClientContext/HttpClientContext.tsx
|
|
13917
14159
|
var import_react21 = require("react");
|
|
13918
|
-
var
|
|
14160
|
+
var import_jsx_runtime61 = require("react/jsx-runtime");
|
|
13919
14161
|
var HttpClientContext2 = (0, import_react21.createContext)(void 0);
|
|
13920
14162
|
function HttpClientProvider({ httpClient, children }) {
|
|
13921
|
-
return /* @__PURE__ */ (0,
|
|
14163
|
+
return /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(HttpClientContext2.Provider, { value: httpClient, children });
|
|
13922
14164
|
}
|
|
13923
14165
|
function HttpClientProviderFromBaseUrl({ baseUrl, children }) {
|
|
13924
14166
|
const httpClient = (0, import_react21.useMemo)(() => makeHttpClient(baseUrl), [baseUrl]);
|
|
13925
|
-
return /* @__PURE__ */ (0,
|
|
14167
|
+
return /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(HttpClientContext2.Provider, { value: httpClient, children });
|
|
13926
14168
|
}
|
|
13927
14169
|
var useHttpClient = () => {
|
|
13928
14170
|
const contextFetch = (0, import_react21.useContext)(HttpClientContext2);
|
|
@@ -13934,7 +14176,7 @@ var useHasHttpClientProvider = () => {
|
|
|
13934
14176
|
};
|
|
13935
14177
|
|
|
13936
14178
|
// src/revamp/DynamicFragmentWise.tsx
|
|
13937
|
-
var
|
|
14179
|
+
var import_jsx_runtime62 = require("react/jsx-runtime");
|
|
13938
14180
|
var wiseRenderers2 = getWiseRenderers();
|
|
13939
14181
|
var DynamicFragmentWise = (0, import_react22.forwardRef)(function DynamicFragmentWise2(props, ref) {
|
|
13940
14182
|
const {
|
|
@@ -13967,14 +14209,14 @@ var DynamicFragmentWise = (0, import_react22.forwardRef)(function DynamicFragmen
|
|
|
13967
14209
|
() => getRenderFunction([CoreContainerRenderer, ...mergedRenderers, StepRenderer]),
|
|
13968
14210
|
[mergedRenderers]
|
|
13969
14211
|
);
|
|
13970
|
-
return /* @__PURE__ */ (0,
|
|
14212
|
+
return /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
13971
14213
|
ErrorBoundary_default,
|
|
13972
14214
|
{
|
|
13973
14215
|
onError: (error) => {
|
|
13974
14216
|
onEvent == null ? void 0 : onEvent("Dynamic Flow - Failed");
|
|
13975
14217
|
onError(error);
|
|
13976
14218
|
},
|
|
13977
|
-
children: /* @__PURE__ */ (0,
|
|
14219
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(HttpClientProvider, { httpClient, children: stepComponentRef.current ? render(stepComponentRef.current) : null })
|
|
13978
14220
|
}
|
|
13979
14221
|
);
|
|
13980
14222
|
});
|
|
@@ -13982,7 +14224,7 @@ var DynamicFragmentWise_default = DynamicFragmentWise;
|
|
|
13982
14224
|
|
|
13983
14225
|
// src/revamp/DynamicFragmentCore.tsx
|
|
13984
14226
|
var import_react23 = require("react");
|
|
13985
|
-
var
|
|
14227
|
+
var import_jsx_runtime63 = require("react/jsx-runtime");
|
|
13986
14228
|
var DynamicFragmentCore = (0, import_react23.forwardRef)(function DynamicFragmentCore2(props, ref) {
|
|
13987
14229
|
const { onCompletion = () => {
|
|
13988
14230
|
}, onEvent, onError, onLink = openLinkInNewTab, renderers } = props;
|
|
@@ -14006,7 +14248,7 @@ var DynamicFragmentCore = (0, import_react23.forwardRef)(function DynamicFragmen
|
|
|
14006
14248
|
() => getRenderFunction([CoreContainerRenderer, ...renderers]),
|
|
14007
14249
|
[renderers]
|
|
14008
14250
|
);
|
|
14009
|
-
return /* @__PURE__ */ (0,
|
|
14251
|
+
return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
|
|
14010
14252
|
ErrorBoundary_default,
|
|
14011
14253
|
{
|
|
14012
14254
|
onError: (error) => {
|
|
@@ -14347,7 +14589,7 @@ var noop2 = () => {
|
|
|
14347
14589
|
};
|
|
14348
14590
|
|
|
14349
14591
|
// src/legacy/common/contexts/dynamicFlowContexts/DynamicFlowContexts.tsx
|
|
14350
|
-
var
|
|
14592
|
+
var import_jsx_runtime64 = require("react/jsx-runtime");
|
|
14351
14593
|
var defaultContextValue = {
|
|
14352
14594
|
loading: false,
|
|
14353
14595
|
registerPersistAsyncPromise: (promise) => {
|
|
@@ -14362,7 +14604,7 @@ var DynamicFlowProvider = ({ loading, children }) => {
|
|
|
14362
14604
|
registerPersistAsyncPromise: addPendingPromise
|
|
14363
14605
|
};
|
|
14364
14606
|
}, [loading, pendingPromises, addPendingPromise]);
|
|
14365
|
-
return /* @__PURE__ */ (0,
|
|
14607
|
+
return /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(DFContext.Provider, { value: providerValue, children });
|
|
14366
14608
|
};
|
|
14367
14609
|
var useDynamicFlow = () => {
|
|
14368
14610
|
const context = (0, import_react25.useContext)(DFContext);
|
|
@@ -14371,7 +14613,7 @@ var useDynamicFlow = () => {
|
|
|
14371
14613
|
|
|
14372
14614
|
// src/legacy/common/contexts/eventsContext/EventsContext.tsx
|
|
14373
14615
|
var import_react26 = require("react");
|
|
14374
|
-
var
|
|
14616
|
+
var import_jsx_runtime65 = require("react/jsx-runtime");
|
|
14375
14617
|
var EventsContext = (0, import_react26.createContext)({
|
|
14376
14618
|
triggerEvent: () => {
|
|
14377
14619
|
}
|
|
@@ -14381,7 +14623,7 @@ function EventsContextProvider({ metadata, children, onEvent }) {
|
|
|
14381
14623
|
() => ({ triggerEvent: getEventDispatcher(onEvent, metadata) }),
|
|
14382
14624
|
[onEvent, metadata]
|
|
14383
14625
|
);
|
|
14384
|
-
return /* @__PURE__ */ (0,
|
|
14626
|
+
return /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(EventsContext.Provider, { value, children });
|
|
14385
14627
|
}
|
|
14386
14628
|
function useEventDispatcher() {
|
|
14387
14629
|
const { triggerEvent } = (0, import_react26.useContext)(EventsContext);
|
|
@@ -14396,7 +14638,7 @@ var getEventDispatcher = (onEvent, metadata) => (eventName, properties = {}) =>
|
|
|
14396
14638
|
|
|
14397
14639
|
// src/legacy/common/contexts/logContext/LogContext.tsx
|
|
14398
14640
|
var import_react27 = require("react");
|
|
14399
|
-
var
|
|
14641
|
+
var import_jsx_runtime66 = require("react/jsx-runtime");
|
|
14400
14642
|
var getLogger = (level, onLog, flowId = "UNKNOWN-FLOW-ID", stepId = "UNKNOWN-FLOW-ID") => (title, description, extra) => {
|
|
14401
14643
|
try {
|
|
14402
14644
|
onLog(level, `Dynamic Flow ${level} - ${title} - ${description}`, __spreadValues({
|
|
@@ -14418,7 +14660,7 @@ function LogProvider({ flowId, stepId, children, onLog }) {
|
|
|
14418
14660
|
}),
|
|
14419
14661
|
[onLog, flowId, stepId]
|
|
14420
14662
|
);
|
|
14421
|
-
return /* @__PURE__ */ (0,
|
|
14663
|
+
return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(LogContext.Provider, { value, children });
|
|
14422
14664
|
}
|
|
14423
14665
|
var useLogger = () => {
|
|
14424
14666
|
const logging = (0, import_react27.useContext)(LogContext);
|
|
@@ -14432,10 +14674,10 @@ var useLogger = () => {
|
|
|
14432
14674
|
|
|
14433
14675
|
// src/legacy/common/contexts/featureContext/FeatureContext.tsx
|
|
14434
14676
|
var import_react28 = require("react");
|
|
14435
|
-
var
|
|
14677
|
+
var import_jsx_runtime67 = require("react/jsx-runtime");
|
|
14436
14678
|
var FeatureContext = (0, import_react28.createContext)([]);
|
|
14437
14679
|
function FeatureContextProvider({ features, children }) {
|
|
14438
|
-
return /* @__PURE__ */ (0,
|
|
14680
|
+
return /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(FeatureContext.Provider, { value: features, children });
|
|
14439
14681
|
}
|
|
14440
14682
|
|
|
14441
14683
|
// src/common/cameraCapture/utils/mobile-utils.ts
|
|
@@ -15294,29 +15536,29 @@ var Size = {
|
|
|
15294
15536
|
};
|
|
15295
15537
|
|
|
15296
15538
|
// src/legacy/jsonSchemaForm/basicTypeSchema/BasicTypeSchema.tsx
|
|
15297
|
-
var
|
|
15539
|
+
var import_classnames16 = __toESM(require_classnames());
|
|
15298
15540
|
var import_react53 = require("react");
|
|
15299
15541
|
|
|
15300
15542
|
// src/legacy/layout/alert/DynamicAlert.tsx
|
|
15301
|
-
var
|
|
15543
|
+
var import_components44 = require("@transferwise/components");
|
|
15302
15544
|
|
|
15303
15545
|
// src/legacy/layout/utils/getNavigationOptionMedia.tsx
|
|
15304
|
-
var
|
|
15546
|
+
var import_components43 = require("@transferwise/components");
|
|
15305
15547
|
|
|
15306
15548
|
// src/legacy/layout/icon/FlagIcon.tsx
|
|
15307
|
-
var
|
|
15549
|
+
var import_jsx_runtime68 = require("react/jsx-runtime");
|
|
15308
15550
|
var isFlagIcon3 = (name) => name.startsWith("flag-");
|
|
15309
15551
|
function FlagIcon2({ name }) {
|
|
15310
15552
|
if (!isFlagIcon3(name)) {
|
|
15311
15553
|
return null;
|
|
15312
15554
|
}
|
|
15313
15555
|
const code = name.substring(5);
|
|
15314
|
-
return /* @__PURE__ */ (0,
|
|
15556
|
+
return /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(Flag, { intrinsicSize: 24, code });
|
|
15315
15557
|
}
|
|
15316
15558
|
|
|
15317
15559
|
// src/legacy/layout/icon/NamedIcon.tsx
|
|
15318
15560
|
var icons2 = __toESM(require("@transferwise/icons"));
|
|
15319
|
-
var
|
|
15561
|
+
var import_jsx_runtime69 = require("react/jsx-runtime");
|
|
15320
15562
|
var isNamedIcon3 = (name) => {
|
|
15321
15563
|
const iconName = toCapitalisedCamelCase2(name);
|
|
15322
15564
|
return Object.keys(icons2).includes(iconName);
|
|
@@ -15327,19 +15569,19 @@ function NamedIcon2({ name }) {
|
|
|
15327
15569
|
}
|
|
15328
15570
|
const iconName = toCapitalisedCamelCase2(name);
|
|
15329
15571
|
const Icon = icons2[iconName];
|
|
15330
|
-
return /* @__PURE__ */ (0,
|
|
15572
|
+
return /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(Icon, { size: 24 });
|
|
15331
15573
|
}
|
|
15332
15574
|
var toCapitalisedCamelCase2 = (value) => value.split("-").map(capitaliseFirstChar2).join("");
|
|
15333
15575
|
var capitaliseFirstChar2 = (value) => `${value[0].toUpperCase()}${value.slice(1)}`;
|
|
15334
15576
|
|
|
15335
15577
|
// src/legacy/layout/icon/DynamicIcon.tsx
|
|
15336
|
-
var
|
|
15578
|
+
var import_jsx_runtime70 = require("react/jsx-runtime");
|
|
15337
15579
|
function DynamicIcon2({ type }) {
|
|
15338
15580
|
if (isFlagIcon3(type)) {
|
|
15339
|
-
return /* @__PURE__ */ (0,
|
|
15581
|
+
return /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(FlagIcon2, { name: type });
|
|
15340
15582
|
}
|
|
15341
15583
|
if (isNamedIcon3(type)) {
|
|
15342
|
-
return /* @__PURE__ */ (0,
|
|
15584
|
+
return /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(NamedIcon2, { name: type });
|
|
15343
15585
|
}
|
|
15344
15586
|
return null;
|
|
15345
15587
|
}
|
|
@@ -15349,17 +15591,17 @@ function isValidIconName(name) {
|
|
|
15349
15591
|
var DynamicIcon_default2 = DynamicIcon2;
|
|
15350
15592
|
|
|
15351
15593
|
// src/legacy/layout/utils/getNavigationOptionMedia.tsx
|
|
15352
|
-
var
|
|
15594
|
+
var import_jsx_runtime71 = require("react/jsx-runtime");
|
|
15353
15595
|
var getNavigationOptionMedia = ({ icon, image }) => {
|
|
15354
15596
|
if (icon == null ? void 0 : icon.name) {
|
|
15355
|
-
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 }) });
|
|
15356
15598
|
}
|
|
15357
15599
|
if (icon == null ? void 0 : icon.text) {
|
|
15358
|
-
return /* @__PURE__ */ (0,
|
|
15600
|
+
return /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(import_components43.Avatar, { type: import_components43.AvatarType.INITIALS, children: icon.text });
|
|
15359
15601
|
}
|
|
15360
15602
|
if (image == null ? void 0 : image.url) {
|
|
15361
15603
|
const { url, text } = image;
|
|
15362
|
-
return /* @__PURE__ */ (0,
|
|
15604
|
+
return /* @__PURE__ */ (0, import_jsx_runtime71.jsx)("img", { src: url, alt: text });
|
|
15363
15605
|
}
|
|
15364
15606
|
return null;
|
|
15365
15607
|
};
|
|
@@ -15395,11 +15637,11 @@ var getTextAlignment2 = (align) => {
|
|
|
15395
15637
|
var getTextAlignmentAndMargin2 = (component) => `${getTextAlignment2(component.align)} ${getMargin2(component.margin)}`;
|
|
15396
15638
|
|
|
15397
15639
|
// src/legacy/layout/alert/DynamicAlert.tsx
|
|
15398
|
-
var
|
|
15640
|
+
var import_jsx_runtime72 = require("react/jsx-runtime");
|
|
15399
15641
|
var DynamicAlert = ({ component: alert, onAction }) => {
|
|
15400
15642
|
const { context, markdown, margin } = alert;
|
|
15401
|
-
return /* @__PURE__ */ (0,
|
|
15402
|
-
|
|
15643
|
+
return /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(
|
|
15644
|
+
import_components44.Alert,
|
|
15403
15645
|
{
|
|
15404
15646
|
type: mapContextToAlertType(legacy_mapContext(context)),
|
|
15405
15647
|
className: getMargin2(margin),
|
|
@@ -15482,12 +15724,12 @@ var mapContextToAlertType = (context) => {
|
|
|
15482
15724
|
var DynamicAlert_default = DynamicAlert;
|
|
15483
15725
|
|
|
15484
15726
|
// src/legacy/layout/box/DynamicBox.tsx
|
|
15485
|
-
var
|
|
15727
|
+
var import_jsx_runtime73 = require("react/jsx-runtime");
|
|
15486
15728
|
var DynamicBox = (props) => {
|
|
15487
15729
|
const box = props.component;
|
|
15488
15730
|
const margin = getMargin2(box.margin || box.border ? "lg" : "xs");
|
|
15489
15731
|
if (!box.width || box.width === "xl") {
|
|
15490
|
-
return /* @__PURE__ */ (0,
|
|
15732
|
+
return /* @__PURE__ */ (0, import_jsx_runtime73.jsx)("div", { className: margin + getBorderClass(box.border), children: /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(
|
|
15491
15733
|
DynamicLayout_default,
|
|
15492
15734
|
{
|
|
15493
15735
|
components: box.components,
|
|
@@ -15500,7 +15742,7 @@ var DynamicBox = (props) => {
|
|
|
15500
15742
|
}
|
|
15501
15743
|
) });
|
|
15502
15744
|
}
|
|
15503
|
-
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)(
|
|
15504
15746
|
DynamicLayout_default,
|
|
15505
15747
|
{
|
|
15506
15748
|
components: box.components,
|
|
@@ -15534,7 +15776,7 @@ var getBoxWidthClasses = (component) => {
|
|
|
15534
15776
|
var DynamicBox_default = DynamicBox;
|
|
15535
15777
|
|
|
15536
15778
|
// src/legacy/layout/button/DynamicButton.tsx
|
|
15537
|
-
var
|
|
15779
|
+
var import_components45 = require("@transferwise/components");
|
|
15538
15780
|
|
|
15539
15781
|
// src/legacy/layout/button/utils.ts
|
|
15540
15782
|
var priorities = {
|
|
@@ -15586,9 +15828,9 @@ var getButtonSize = (size2) => {
|
|
|
15586
15828
|
};
|
|
15587
15829
|
|
|
15588
15830
|
// src/legacy/layout/button/DynamicButton.tsx
|
|
15589
|
-
var
|
|
15831
|
+
var import_jsx_runtime74 = require("react/jsx-runtime");
|
|
15590
15832
|
function DynamicButton(props) {
|
|
15591
|
-
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));
|
|
15592
15834
|
}
|
|
15593
15835
|
function DynamicButtonWithoutBehavior(props) {
|
|
15594
15836
|
var _a, _b;
|
|
@@ -15605,8 +15847,8 @@ function DynamicButtonWithoutBehavior(props) {
|
|
|
15605
15847
|
onAction(componentAction);
|
|
15606
15848
|
}
|
|
15607
15849
|
};
|
|
15608
|
-
return /* @__PURE__ */ (0,
|
|
15609
|
-
|
|
15850
|
+
return /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(
|
|
15851
|
+
import_components45.Button,
|
|
15610
15852
|
{
|
|
15611
15853
|
size: getButtonSize(component.size),
|
|
15612
15854
|
type: priority === "tertiary" ? void 0 : type,
|
|
@@ -15657,8 +15899,8 @@ function DynamicButtonWithBehavior(props) {
|
|
|
15657
15899
|
}
|
|
15658
15900
|
}
|
|
15659
15901
|
};
|
|
15660
|
-
return /* @__PURE__ */ (0,
|
|
15661
|
-
|
|
15902
|
+
return /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(
|
|
15903
|
+
import_components45.Button,
|
|
15662
15904
|
{
|
|
15663
15905
|
size: getButtonSize(component.size),
|
|
15664
15906
|
type: priority === "tertiary" ? void 0 : type,
|
|
@@ -15674,12 +15916,12 @@ function DynamicButtonWithBehavior(props) {
|
|
|
15674
15916
|
var DynamicButton_default = DynamicButton;
|
|
15675
15917
|
|
|
15676
15918
|
// src/legacy/layout/columns/DynamicColumns.tsx
|
|
15677
|
-
var
|
|
15919
|
+
var import_jsx_runtime75 = require("react/jsx-runtime");
|
|
15678
15920
|
var DynamicColumns = (props) => {
|
|
15679
15921
|
const columns = props.component;
|
|
15680
15922
|
const { leftWidth, rightWidth } = getWidth(columns.bias);
|
|
15681
|
-
return /* @__PURE__ */ (0,
|
|
15682
|
-
/* @__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)(
|
|
15683
15925
|
DynamicLayout_default,
|
|
15684
15926
|
{
|
|
15685
15927
|
components: columns.left,
|
|
@@ -15691,7 +15933,7 @@ var DynamicColumns = (props) => {
|
|
|
15691
15933
|
onPersistAsync: props.onPersistAsync
|
|
15692
15934
|
}
|
|
15693
15935
|
) }),
|
|
15694
|
-
/* @__PURE__ */ (0,
|
|
15936
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)("div", { className: `${rightWidth} m-b-0`, children: /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
|
|
15695
15937
|
DynamicLayout_default,
|
|
15696
15938
|
{
|
|
15697
15939
|
components: columns.right,
|
|
@@ -15726,15 +15968,15 @@ var getWidth = (bias) => {
|
|
|
15726
15968
|
var DynamicColumns_default = DynamicColumns;
|
|
15727
15969
|
|
|
15728
15970
|
// src/legacy/layout/decision/DynamicDecision.tsx
|
|
15729
|
-
var
|
|
15730
|
-
var
|
|
15971
|
+
var import_components46 = require("@transferwise/components");
|
|
15972
|
+
var import_jsx_runtime76 = require("react/jsx-runtime");
|
|
15731
15973
|
function DynamicDecision({ component, onAction }) {
|
|
15732
15974
|
const { loading } = useDynamicFlow();
|
|
15733
15975
|
const { margin, options, title } = component;
|
|
15734
|
-
return /* @__PURE__ */ (0,
|
|
15735
|
-
title && /* @__PURE__ */ (0,
|
|
15736
|
-
/* @__PURE__ */ (0,
|
|
15737
|
-
|
|
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,
|
|
15738
15980
|
{
|
|
15739
15981
|
title: option.title,
|
|
15740
15982
|
content: option.description,
|
|
@@ -15751,16 +15993,16 @@ function DynamicDecision({ component, onAction }) {
|
|
|
15751
15993
|
var DynamicDecision_default = DynamicDecision;
|
|
15752
15994
|
|
|
15753
15995
|
// src/legacy/layout/divider/DynamicDivider.tsx
|
|
15754
|
-
var
|
|
15996
|
+
var import_jsx_runtime77 = require("react/jsx-runtime");
|
|
15755
15997
|
var DynamicDivider = ({ component }) => {
|
|
15756
15998
|
const margin = getMargin2(component.margin);
|
|
15757
15999
|
const className = `m-t-0 ${margin}`;
|
|
15758
|
-
return /* @__PURE__ */ (0,
|
|
16000
|
+
return /* @__PURE__ */ (0, import_jsx_runtime77.jsx)("hr", { className });
|
|
15759
16001
|
};
|
|
15760
16002
|
var DynamicDivider_default = DynamicDivider;
|
|
15761
16003
|
|
|
15762
16004
|
// src/legacy/layout/external/DynamicExternal.tsx
|
|
15763
|
-
var
|
|
16005
|
+
var import_components47 = require("@transferwise/components");
|
|
15764
16006
|
var import_react32 = require("react");
|
|
15765
16007
|
var import_react_intl24 = require("react-intl");
|
|
15766
16008
|
|
|
@@ -15775,7 +16017,7 @@ var DynamicExternal_messages_default = (0, import_react_intl23.defineMessages)({
|
|
|
15775
16017
|
});
|
|
15776
16018
|
|
|
15777
16019
|
// src/legacy/layout/external/DynamicExternal.tsx
|
|
15778
|
-
var
|
|
16020
|
+
var import_jsx_runtime78 = require("react/jsx-runtime");
|
|
15779
16021
|
var DynamicExternal = ({ component, onAction }) => {
|
|
15780
16022
|
const { requestUrl, responseHandlers, polling, retryTitle } = component;
|
|
15781
16023
|
const intl = (0, import_react_intl24.useIntl)();
|
|
@@ -15792,10 +16034,10 @@ var DynamicExternal = ({ component, onAction }) => {
|
|
|
15792
16034
|
}) : void 0;
|
|
15793
16035
|
}, [polling, responseHandlers]);
|
|
15794
16036
|
useExternalStepPolling(pollingConfiguration, onAction);
|
|
15795
|
-
return /* @__PURE__ */ (0,
|
|
15796
|
-
/* @__PURE__ */ (0,
|
|
15797
|
-
/* @__PURE__ */ (0,
|
|
15798
|
-
/* @__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) })
|
|
15799
16041
|
] });
|
|
15800
16042
|
};
|
|
15801
16043
|
var DynamicExternal_default = DynamicExternal;
|
|
@@ -15804,10 +16046,10 @@ var DynamicExternal_default = DynamicExternal;
|
|
|
15804
16046
|
var import_react46 = require("react");
|
|
15805
16047
|
|
|
15806
16048
|
// src/legacy/jsonSchemaForm/allOfSchema/AllOfSchema.tsx
|
|
15807
|
-
var
|
|
15808
|
-
var
|
|
16049
|
+
var import_components48 = require("@transferwise/components");
|
|
16050
|
+
var import_classnames7 = __toESM(require_classnames());
|
|
15809
16051
|
var import_react33 = require("react");
|
|
15810
|
-
var
|
|
16052
|
+
var import_jsx_runtime79 = require("react/jsx-runtime");
|
|
15811
16053
|
var splitModel = (model, schemas) => schemas.map((schema) => getValidObjectModelParts(model, schema) || {});
|
|
15812
16054
|
var combineModels = (models) => models.reduce((current, combined) => __spreadValues(__spreadValues({}, combined), current), {});
|
|
15813
16055
|
var getSchemaColumnClasses = (width) => ({
|
|
@@ -15824,12 +16066,12 @@ function AllOfSchema(props) {
|
|
|
15824
16066
|
props.onChange(__spreadProps(__spreadValues({}, onChangeProps), { model: combineModels(models) }));
|
|
15825
16067
|
};
|
|
15826
16068
|
const [models, setModels] = (0, import_react33.useState)(splitModel(props.model, props.schema.allOf));
|
|
15827
|
-
return /* @__PURE__ */ (0,
|
|
15828
|
-
props.schema.title && !hideTitle && /* @__PURE__ */ (0,
|
|
15829
|
-
props.schema.description && /* @__PURE__ */ (0,
|
|
15830
|
-
/* @__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) => (
|
|
15831
16073
|
// eslint-disable-next-line react/no-array-index-key
|
|
15832
|
-
/* @__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)(
|
|
15833
16075
|
GenericSchema_default,
|
|
15834
16076
|
{
|
|
15835
16077
|
schema,
|
|
@@ -15850,15 +16092,15 @@ function AllOfSchema(props) {
|
|
|
15850
16092
|
var AllOfSchema_default = AllOfSchema;
|
|
15851
16093
|
|
|
15852
16094
|
// src/legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/MultipleFileUploadSchema.tsx
|
|
15853
|
-
var
|
|
15854
|
-
var
|
|
16095
|
+
var import_components50 = require("@transferwise/components");
|
|
16096
|
+
var import_classnames8 = __toESM(require_classnames());
|
|
15855
16097
|
var import_react34 = require("react");
|
|
15856
16098
|
|
|
15857
16099
|
// src/legacy/jsonSchemaForm/controlFeedback/ControlFeedback.tsx
|
|
15858
|
-
var
|
|
16100
|
+
var import_components49 = require("@transferwise/components");
|
|
15859
16101
|
var import_formatting2 = require("@transferwise/formatting");
|
|
15860
16102
|
var import_react_intl25 = require("react-intl");
|
|
15861
|
-
var
|
|
16103
|
+
var import_jsx_runtime80 = require("react/jsx-runtime");
|
|
15862
16104
|
function ControlFeedback(props) {
|
|
15863
16105
|
const { errors = "", validations = [], validationMessages = {} } = props;
|
|
15864
16106
|
const defaultValidationMessages = useDefaultValidationMessages(props.schema);
|
|
@@ -15867,12 +16109,12 @@ function ControlFeedback(props) {
|
|
|
15867
16109
|
const isValidationVisible = !isErrorVisible && (props.submitted || props.changed && props.blurred) && Boolean(validations == null ? void 0 : validations.length);
|
|
15868
16110
|
const isDescriptionVisible = props.schema.type !== "boolean" && props.schema.description && !isErrorVisible && !isValidationVisible;
|
|
15869
16111
|
const hasInfoMessage = Boolean(props.infoMessage);
|
|
15870
|
-
return /* @__PURE__ */ (0,
|
|
15871
|
-
isErrorVisible ? /* @__PURE__ */ (0,
|
|
15872
|
-
isValidationVisible ? /* @__PURE__ */ (0,
|
|
15873
|
-
(isDescriptionVisible || hasInfoMessage) && /* @__PURE__ */ (0,
|
|
15874
|
-
isDescriptionVisible && /* @__PURE__ */ (0,
|
|
15875
|
-
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 })
|
|
15876
16118
|
] })
|
|
15877
16119
|
] });
|
|
15878
16120
|
}
|
|
@@ -15992,7 +16234,7 @@ function useFormattedDefaultErrorMessages({
|
|
|
15992
16234
|
}
|
|
15993
16235
|
|
|
15994
16236
|
// src/legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/MultipleFileUploadSchema.tsx
|
|
15995
|
-
var
|
|
16237
|
+
var import_jsx_runtime81 = require("react/jsx-runtime");
|
|
15996
16238
|
function MultipleFileUploadSchema(props) {
|
|
15997
16239
|
var _a, _b;
|
|
15998
16240
|
const { onChange, errors = null, schema, required = false } = props;
|
|
@@ -16053,10 +16295,10 @@ function MultipleFileUploadSchema(props) {
|
|
|
16053
16295
|
onDeleteFile: () => Promise.resolve()
|
|
16054
16296
|
});
|
|
16055
16297
|
const feedbackId = `${uid}-feedback`;
|
|
16056
|
-
return /* @__PURE__ */ (0,
|
|
16057
|
-
/* @__PURE__ */ (0,
|
|
16058
|
-
/* @__PURE__ */ (0,
|
|
16059
|
-
/* @__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)(
|
|
16060
16302
|
ControlFeedback_default,
|
|
16061
16303
|
{
|
|
16062
16304
|
id: feedbackId,
|
|
@@ -16078,7 +16320,7 @@ function getSuccessfullyProcessedFiles(allFiles) {
|
|
|
16078
16320
|
return allFiles.filter((file) => !file.error && file.status === "succeeded");
|
|
16079
16321
|
}
|
|
16080
16322
|
function convertFileIdsToComponentFileObjects(fileIds) {
|
|
16081
|
-
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);
|
|
16082
16324
|
}
|
|
16083
16325
|
function isValidId(id) {
|
|
16084
16326
|
return isNumber3(id) || isString2(id);
|
|
@@ -16089,14 +16331,14 @@ function getValidationMessages(schema, required, defaultErrorMessages) {
|
|
|
16089
16331
|
}
|
|
16090
16332
|
|
|
16091
16333
|
// src/legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multiSelectSchema/MultiSelectSchema.tsx
|
|
16092
|
-
var
|
|
16093
|
-
var
|
|
16334
|
+
var import_components52 = require("@transferwise/components");
|
|
16335
|
+
var import_classnames9 = __toESM(require_classnames());
|
|
16094
16336
|
var import_react35 = require("react");
|
|
16095
16337
|
var import_react_intl29 = require("react-intl");
|
|
16096
16338
|
|
|
16097
16339
|
// src/legacy/jsonSchemaForm/schemaFormControl/utils/mapping-utils.tsx
|
|
16098
|
-
var
|
|
16099
|
-
var
|
|
16340
|
+
var import_components51 = require("@transferwise/components");
|
|
16341
|
+
var import_jsx_runtime82 = require("react/jsx-runtime");
|
|
16100
16342
|
var mapConstSchemaToOption = (schema, controlType) => {
|
|
16101
16343
|
switch (controlType) {
|
|
16102
16344
|
case "select":
|
|
@@ -16120,7 +16362,7 @@ var mapKeywordsToSearchStrings = (searchStrings) => isArray2(searchStrings) ? {
|
|
|
16120
16362
|
var mapImage = (image) => {
|
|
16121
16363
|
if (image == null ? void 0 : image.url) {
|
|
16122
16364
|
return {
|
|
16123
|
-
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 || "" }) }) }),
|
|
16124
16366
|
hideIconInTrigger: true
|
|
16125
16367
|
};
|
|
16126
16368
|
}
|
|
@@ -16129,17 +16371,17 @@ var mapImage = (image) => {
|
|
|
16129
16371
|
var getIconPropertyForSelectOption = (icon) => {
|
|
16130
16372
|
if ((icon == null ? void 0 : icon.name) && isFlagIcon3(icon.name)) {
|
|
16131
16373
|
return {
|
|
16132
|
-
icon: /* @__PURE__ */ (0,
|
|
16374
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(Flag, { code: icon.name.substring(5), intrinsicSize: 24 })
|
|
16133
16375
|
};
|
|
16134
16376
|
}
|
|
16135
16377
|
if ((icon == null ? void 0 : icon.name) && isValidIconName(icon.name)) {
|
|
16136
16378
|
return {
|
|
16137
|
-
icon: /* @__PURE__ */ (0,
|
|
16379
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(DynamicIcon_default2, { type: icon.name })
|
|
16138
16380
|
};
|
|
16139
16381
|
}
|
|
16140
16382
|
if (icon == null ? void 0 : icon.text) {
|
|
16141
16383
|
return {
|
|
16142
|
-
icon: /* @__PURE__ */ (0,
|
|
16384
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime82.jsx)("span", { children: icon.text })
|
|
16143
16385
|
};
|
|
16144
16386
|
}
|
|
16145
16387
|
return null;
|
|
@@ -16147,17 +16389,17 @@ var getIconPropertyForSelectOption = (icon) => {
|
|
|
16147
16389
|
var getAvatarPropertyForRadioOption = ({ image, icon }) => {
|
|
16148
16390
|
if (image == null ? void 0 : image.url) {
|
|
16149
16391
|
return {
|
|
16150
|
-
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: "" }) })
|
|
16151
16393
|
};
|
|
16152
16394
|
}
|
|
16153
16395
|
if ((icon == null ? void 0 : icon.name) && isValidIconName(icon.name)) {
|
|
16154
16396
|
return {
|
|
16155
|
-
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 }) })
|
|
16156
16398
|
};
|
|
16157
16399
|
}
|
|
16158
16400
|
if (icon == null ? void 0 : icon.text) {
|
|
16159
16401
|
return {
|
|
16160
|
-
avatar: /* @__PURE__ */ (0,
|
|
16402
|
+
avatar: /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(import_components51.Avatar, { type: import_components51.AvatarType.INITIALS, children: icon.text })
|
|
16161
16403
|
};
|
|
16162
16404
|
}
|
|
16163
16405
|
return null;
|
|
@@ -16196,7 +16438,7 @@ var multi_select_messages_default2 = (0, import_react_intl28.defineMessages)({
|
|
|
16196
16438
|
});
|
|
16197
16439
|
|
|
16198
16440
|
// src/legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multiSelectSchema/MultiSelectSchema.tsx
|
|
16199
|
-
var
|
|
16441
|
+
var import_jsx_runtime83 = require("react/jsx-runtime");
|
|
16200
16442
|
function MultiSelectSchema({
|
|
16201
16443
|
schema,
|
|
16202
16444
|
model,
|
|
@@ -16250,10 +16492,10 @@ function MultiSelectSchema({
|
|
|
16250
16492
|
"has-error": shouldShowInitialError || shouldShowValidationError,
|
|
16251
16493
|
"has-info": !!schema.description
|
|
16252
16494
|
};
|
|
16253
|
-
return /* @__PURE__ */ (0,
|
|
16254
|
-
schema.title ? /* @__PURE__ */ (0,
|
|
16255
|
-
/* @__PURE__ */ (0,
|
|
16256
|
-
|
|
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,
|
|
16257
16499
|
{
|
|
16258
16500
|
id,
|
|
16259
16501
|
multiple: true,
|
|
@@ -16278,12 +16520,12 @@ function MultiSelectSchema({
|
|
|
16278
16520
|
if (withinTrigger) {
|
|
16279
16521
|
return selected && index === selected[0] ? getFormattedMessage() : void 0;
|
|
16280
16522
|
}
|
|
16281
|
-
return /* @__PURE__ */ (0,
|
|
16523
|
+
return /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(import_components52.SelectInputOptionContent, { title: label, note: note != null ? note : secondary, icon });
|
|
16282
16524
|
},
|
|
16283
16525
|
onChange: broadcastModelChange
|
|
16284
16526
|
}
|
|
16285
16527
|
),
|
|
16286
|
-
/* @__PURE__ */ (0,
|
|
16528
|
+
/* @__PURE__ */ (0, import_jsx_runtime83.jsx)(
|
|
16287
16529
|
ControlFeedback_default,
|
|
16288
16530
|
{
|
|
16289
16531
|
id: `${id}-feedback`,
|
|
@@ -16308,17 +16550,17 @@ var getInitialModelIndices2 = (model, options) => {
|
|
|
16308
16550
|
};
|
|
16309
16551
|
|
|
16310
16552
|
// src/legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/repeatableSchema/RepeatableSchema.tsx
|
|
16311
|
-
var
|
|
16553
|
+
var import_components54 = require("@transferwise/components");
|
|
16312
16554
|
var import_icons4 = require("@transferwise/icons");
|
|
16313
16555
|
var import_react37 = require("react");
|
|
16314
16556
|
var import_react_intl32 = require("react-intl");
|
|
16315
16557
|
|
|
16316
16558
|
// src/legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/repeatableSchema/ItemSummary.tsx
|
|
16317
|
-
var
|
|
16318
|
-
var
|
|
16559
|
+
var import_components53 = require("@transferwise/components");
|
|
16560
|
+
var import_jsx_runtime84 = require("react/jsx-runtime");
|
|
16319
16561
|
function ItemSummaryOption2({ item, onClick }) {
|
|
16320
|
-
return /* @__PURE__ */ (0,
|
|
16321
|
-
|
|
16562
|
+
return /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(
|
|
16563
|
+
import_components53.NavigationOption,
|
|
16322
16564
|
{
|
|
16323
16565
|
media: getNavigationOptionMedia(item),
|
|
16324
16566
|
title: item.title,
|
|
@@ -16357,7 +16599,7 @@ var repeatable_messages_default2 = (0, import_react_intl30.defineMessages)({
|
|
|
16357
16599
|
// src/legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/repeatableSchema/RepeatableSchemaStep.tsx
|
|
16358
16600
|
var import_react36 = require("react");
|
|
16359
16601
|
var import_react_intl31 = require("react-intl");
|
|
16360
|
-
var
|
|
16602
|
+
var import_jsx_runtime85 = require("react/jsx-runtime");
|
|
16361
16603
|
function RepeatableSchemaStep({
|
|
16362
16604
|
type,
|
|
16363
16605
|
schema,
|
|
@@ -16405,7 +16647,7 @@ function RepeatableSchemaStep({
|
|
|
16405
16647
|
}
|
|
16406
16648
|
onModelChange(__spreadProps(__spreadValues({}, modelChangeProps), { model: model2 }));
|
|
16407
16649
|
};
|
|
16408
|
-
return /* @__PURE__ */ (0,
|
|
16650
|
+
return /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
|
|
16409
16651
|
DynamicFlowStep,
|
|
16410
16652
|
{
|
|
16411
16653
|
step,
|
|
@@ -16610,8 +16852,8 @@ var schemaSummaryProvides = (summary, providesProp) => (
|
|
|
16610
16852
|
);
|
|
16611
16853
|
|
|
16612
16854
|
// src/legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/repeatableSchema/RepeatableSchema.tsx
|
|
16613
|
-
var
|
|
16614
|
-
var
|
|
16855
|
+
var import_classnames10 = __toESM(require_classnames());
|
|
16856
|
+
var import_jsx_runtime86 = require("react/jsx-runtime");
|
|
16615
16857
|
function RepeatableSchema({
|
|
16616
16858
|
schema,
|
|
16617
16859
|
model,
|
|
@@ -16688,9 +16930,9 @@ function RepeatableSchema({
|
|
|
16688
16930
|
const formGroupClasses = {
|
|
16689
16931
|
"has-error": (_a = errors && !isEmpty(errors)) != null ? _a : submitted && validations.length
|
|
16690
16932
|
};
|
|
16691
|
-
return /* @__PURE__ */ (0,
|
|
16692
|
-
schema.title && /* @__PURE__ */ (0,
|
|
16693
|
-
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)(
|
|
16694
16936
|
ItemSummaryOption2,
|
|
16695
16937
|
{
|
|
16696
16938
|
item: itemSummary,
|
|
@@ -16698,21 +16940,21 @@ function RepeatableSchema({
|
|
|
16698
16940
|
},
|
|
16699
16941
|
JSON.stringify(itemSummary)
|
|
16700
16942
|
)),
|
|
16701
|
-
/* @__PURE__ */ (0,
|
|
16702
|
-
|
|
16943
|
+
/* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
|
|
16944
|
+
import_components54.NavigationOption,
|
|
16703
16945
|
{
|
|
16704
|
-
media: /* @__PURE__ */ (0,
|
|
16946
|
+
media: /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(import_icons4.Plus, {}),
|
|
16705
16947
|
title: schema.addItemTitle || formatMessage(repeatable_messages_default2.addItemTitle),
|
|
16706
16948
|
showMediaAtAllSizes: true,
|
|
16707
16949
|
onClick: onAddItem
|
|
16708
16950
|
}
|
|
16709
16951
|
),
|
|
16710
|
-
/* @__PURE__ */ (0,
|
|
16711
|
-
|
|
16952
|
+
/* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
|
|
16953
|
+
import_components54.Modal,
|
|
16712
16954
|
{
|
|
16713
16955
|
open: openModalType !== null,
|
|
16714
16956
|
title: (openModalType === "add" ? schema.addItemTitle : schema.editItemTitle) || formatMessage(repeatable_messages_default2.addItemTitle),
|
|
16715
|
-
body: /* @__PURE__ */ (0,
|
|
16957
|
+
body: /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
|
|
16716
16958
|
RepeatableSchemaStep_default,
|
|
16717
16959
|
{
|
|
16718
16960
|
type: openModalType != null ? openModalType : "add",
|
|
@@ -16727,7 +16969,7 @@ function RepeatableSchema({
|
|
|
16727
16969
|
onClose: onCancelEdit
|
|
16728
16970
|
}
|
|
16729
16971
|
),
|
|
16730
|
-
/* @__PURE__ */ (0,
|
|
16972
|
+
/* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
|
|
16731
16973
|
ControlFeedback_default,
|
|
16732
16974
|
{
|
|
16733
16975
|
id: `${id}-feedback`,
|
|
@@ -16769,38 +17011,38 @@ var getUpdatedItemSummaries = (action, {
|
|
|
16769
17011
|
var RepeatableSchema_default = RepeatableSchema;
|
|
16770
17012
|
|
|
16771
17013
|
// src/legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/ArrayListSchema.tsx
|
|
16772
|
-
var
|
|
17014
|
+
var import_jsx_runtime87 = require("react/jsx-runtime");
|
|
16773
17015
|
function ArrayListSchema(props) {
|
|
16774
17016
|
const { errors = null, schema } = props;
|
|
16775
17017
|
if (isMultipleFileUploadSchema(schema)) {
|
|
16776
|
-
return /* @__PURE__ */ (0,
|
|
17018
|
+
return /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(MultipleFileUploadSchema_default, __spreadProps(__spreadValues({}, props), { errors, schema }));
|
|
16777
17019
|
}
|
|
16778
17020
|
if (isMultiSelectConstSchema(schema)) {
|
|
16779
|
-
return /* @__PURE__ */ (0,
|
|
17021
|
+
return /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(MultiSelectSchema, __spreadProps(__spreadValues({}, props), { errors, schema }));
|
|
16780
17022
|
}
|
|
16781
17023
|
if (isListArraySchema(schema)) {
|
|
16782
|
-
return /* @__PURE__ */ (0,
|
|
17024
|
+
return /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(RepeatableSchema_default, __spreadProps(__spreadValues({}, props), { errors, schema }));
|
|
16783
17025
|
}
|
|
16784
17026
|
throw new Error("Invalid array list schema");
|
|
16785
17027
|
}
|
|
16786
17028
|
var ArrayListSchema_default = ArrayListSchema;
|
|
16787
17029
|
|
|
16788
17030
|
// src/legacy/jsonSchemaForm/arrayTypeSchema/ArraySchema.tsx
|
|
16789
|
-
var
|
|
17031
|
+
var import_jsx_runtime88 = require("react/jsx-runtime");
|
|
16790
17032
|
var ArraySchema = (props) => {
|
|
16791
17033
|
const { schema } = props;
|
|
16792
17034
|
if (isListArraySchema(schema)) {
|
|
16793
|
-
return /* @__PURE__ */ (0,
|
|
17035
|
+
return /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(ArrayListSchema_default, __spreadValues({}, props));
|
|
16794
17036
|
}
|
|
16795
17037
|
throw new Error("Not implemented");
|
|
16796
17038
|
};
|
|
16797
17039
|
var ArraySchema_default = ArraySchema;
|
|
16798
17040
|
|
|
16799
17041
|
// src/legacy/jsonSchemaForm/objectSchema/ObjectSchema.tsx
|
|
16800
|
-
var
|
|
16801
|
-
var
|
|
17042
|
+
var import_components55 = require("@transferwise/components");
|
|
17043
|
+
var import_classnames11 = __toESM(require_classnames());
|
|
16802
17044
|
var import_react38 = require("react");
|
|
16803
|
-
var
|
|
17045
|
+
var import_jsx_runtime89 = require("react/jsx-runtime");
|
|
16804
17046
|
var getSchemaColumnClasses2 = (width) => ({
|
|
16805
17047
|
"col-xs-12": true,
|
|
16806
17048
|
"col-sm-6": width === "md",
|
|
@@ -16837,22 +17079,22 @@ function ObjectSchema(props) {
|
|
|
16837
17079
|
const isPropertyDefined = (propertyName) => typeof props.schema.properties[propertyName] !== "undefined";
|
|
16838
17080
|
const orderedPropertyNames = Array.from(allorderedPropertiesSet).filter(isPropertyDefined);
|
|
16839
17081
|
const propsErrors = props.errors;
|
|
16840
|
-
return /* @__PURE__ */ (0,
|
|
16841
|
-
props.schema.alert && /* @__PURE__ */ (0,
|
|
16842
|
-
/* @__PURE__ */ (0,
|
|
16843
|
-
props.schema.title && !hideTitle && /* @__PURE__ */ (0,
|
|
16844
|
-
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: [
|
|
16845
17087
|
" ",
|
|
16846
17088
|
props.schema.description,
|
|
16847
17089
|
" "
|
|
16848
17090
|
] }),
|
|
16849
|
-
/* @__PURE__ */ (0,
|
|
17091
|
+
/* @__PURE__ */ (0, import_jsx_runtime89.jsx)("div", { className: "row", children: orderedPropertyNames.map((propertyName) => /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
|
|
16850
17092
|
"div",
|
|
16851
17093
|
{
|
|
16852
|
-
className: (0,
|
|
17094
|
+
className: (0, import_classnames11.default)(
|
|
16853
17095
|
getSchemaColumnClasses2(props.schema.properties[propertyName].width)
|
|
16854
17096
|
),
|
|
16855
|
-
children: /* @__PURE__ */ (0,
|
|
17097
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
|
|
16856
17098
|
GenericSchema_default,
|
|
16857
17099
|
{
|
|
16858
17100
|
schema: props.schema.properties[propertyName],
|
|
@@ -16874,12 +17116,12 @@ function ObjectSchema(props) {
|
|
|
16874
17116
|
var ObjectSchema_default = ObjectSchema;
|
|
16875
17117
|
|
|
16876
17118
|
// src/legacy/jsonSchemaForm/oneOfSchema/OneOfSchema.tsx
|
|
16877
|
-
var
|
|
16878
|
-
var
|
|
17119
|
+
var import_components58 = require("@transferwise/components");
|
|
17120
|
+
var import_classnames12 = __toESM(require_classnames());
|
|
16879
17121
|
var import_react41 = require("react");
|
|
16880
17122
|
|
|
16881
17123
|
// src/legacy/jsonSchemaForm/help/Help.tsx
|
|
16882
|
-
var
|
|
17124
|
+
var import_components56 = require("@transferwise/components");
|
|
16883
17125
|
var import_react_intl34 = require("react-intl");
|
|
16884
17126
|
|
|
16885
17127
|
// src/common/messages/help.messages.ts
|
|
@@ -16893,14 +17135,14 @@ var help_messages_default2 = (0, import_react_intl33.defineMessages)({
|
|
|
16893
17135
|
});
|
|
16894
17136
|
|
|
16895
17137
|
// src/legacy/jsonSchemaForm/help/Help.tsx
|
|
16896
|
-
var
|
|
17138
|
+
var import_jsx_runtime90 = require("react/jsx-runtime");
|
|
16897
17139
|
function Help2(props) {
|
|
16898
17140
|
const intl = (0, import_react_intl34.useIntl)();
|
|
16899
|
-
return /* @__PURE__ */ (0,
|
|
16900
|
-
|
|
17141
|
+
return /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
|
|
17142
|
+
import_components56.Info,
|
|
16901
17143
|
{
|
|
16902
17144
|
className: "m-l-1",
|
|
16903
|
-
content: /* @__PURE__ */ (0,
|
|
17145
|
+
content: /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(import_components56.Markdown, { config: { link: { target: "_blank" } }, children: props.help.markdown }),
|
|
16904
17146
|
presentation: "POPOVER",
|
|
16905
17147
|
size: "sm",
|
|
16906
17148
|
"aria-label": intl.formatMessage(help_messages_default2.helpAria)
|
|
@@ -16914,7 +17156,7 @@ var import_react40 = require("react");
|
|
|
16914
17156
|
var import_react_intl35 = require("react-intl");
|
|
16915
17157
|
|
|
16916
17158
|
// src/legacy/formControl/FormControl.tsx
|
|
16917
|
-
var
|
|
17159
|
+
var import_components57 = require("@transferwise/components");
|
|
16918
17160
|
var import_react39 = require("react");
|
|
16919
17161
|
|
|
16920
17162
|
// src/legacy/formControl/utils/value-utils.ts
|
|
@@ -17101,7 +17343,7 @@ var autocompleteTokenMap2 = {
|
|
|
17101
17343
|
};
|
|
17102
17344
|
|
|
17103
17345
|
// src/legacy/formControl/FormControl.tsx
|
|
17104
|
-
var
|
|
17346
|
+
var import_jsx_runtime91 = require("react/jsx-runtime");
|
|
17105
17347
|
var _FormControl = class _FormControl extends import_react39.PureComponent {
|
|
17106
17348
|
constructor(props) {
|
|
17107
17349
|
super(props);
|
|
@@ -17191,8 +17433,8 @@ var _FormControl = class _FormControl extends import_react39.PureComponent {
|
|
|
17191
17433
|
} = this.props;
|
|
17192
17434
|
switch (type) {
|
|
17193
17435
|
case FormControlType.RADIO:
|
|
17194
|
-
return /* @__PURE__ */ (0,
|
|
17195
|
-
|
|
17436
|
+
return /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(
|
|
17437
|
+
import_components57.RadioGroup,
|
|
17196
17438
|
{
|
|
17197
17439
|
radios: options.map(this.mapOption),
|
|
17198
17440
|
name,
|
|
@@ -17207,8 +17449,8 @@ var _FormControl = class _FormControl extends import_react39.PureComponent {
|
|
|
17207
17449
|
}
|
|
17208
17450
|
);
|
|
17209
17451
|
case FormControlType.CHECKBOX:
|
|
17210
|
-
return /* @__PURE__ */ (0,
|
|
17211
|
-
|
|
17452
|
+
return /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(
|
|
17453
|
+
import_components57.Checkbox,
|
|
17212
17454
|
{
|
|
17213
17455
|
checked: getSafeBooleanValue(value, { coerceValue: true }),
|
|
17214
17456
|
disabled,
|
|
@@ -17225,8 +17467,8 @@ var _FormControl = class _FormControl extends import_react39.PureComponent {
|
|
|
17225
17467
|
const search = options.length >= 8;
|
|
17226
17468
|
const items = options;
|
|
17227
17469
|
const selected = this.getSelectedOption(options);
|
|
17228
|
-
return /* @__PURE__ */ (0,
|
|
17229
|
-
|
|
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,
|
|
17230
17472
|
{
|
|
17231
17473
|
id,
|
|
17232
17474
|
UNSAFE_triggerButtonProps: {
|
|
@@ -17241,8 +17483,8 @@ var _FormControl = class _FormControl extends import_react39.PureComponent {
|
|
|
17241
17483
|
disabled: value2.disabled
|
|
17242
17484
|
})),
|
|
17243
17485
|
value: selected != null ? selected : null,
|
|
17244
|
-
renderValue: ({ hideIconInTrigger, icon, label: label2, note, secondary }, withinTrigger) => /* @__PURE__ */ (0,
|
|
17245
|
-
|
|
17486
|
+
renderValue: ({ hideIconInTrigger, icon, label: label2, note, secondary }, withinTrigger) => /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(
|
|
17487
|
+
import_components57.SelectInputOptionContent,
|
|
17246
17488
|
{
|
|
17247
17489
|
title: label2,
|
|
17248
17490
|
note: withinTrigger ? note != null ? note : secondary : note,
|
|
@@ -17270,13 +17512,13 @@ var _FormControl = class _FormControl extends import_react39.PureComponent {
|
|
|
17270
17512
|
) });
|
|
17271
17513
|
}
|
|
17272
17514
|
case FormControlType.TAB:
|
|
17273
|
-
return /* @__PURE__ */ (0,
|
|
17274
|
-
|
|
17515
|
+
return /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(
|
|
17516
|
+
import_components57.Tabs,
|
|
17275
17517
|
{
|
|
17276
17518
|
selected: ((_a = this.getSelectedOption(options)) == null ? void 0 : _a.value) || 0,
|
|
17277
17519
|
tabs: options.map((option) => ({
|
|
17278
17520
|
title: option.label,
|
|
17279
|
-
content: /* @__PURE__ */ (0,
|
|
17521
|
+
content: /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(import_jsx_runtime91.Fragment, {}),
|
|
17280
17522
|
disabled: option.disabled || false
|
|
17281
17523
|
})),
|
|
17282
17524
|
name: id,
|
|
@@ -17291,7 +17533,7 @@ var _FormControl = class _FormControl extends import_react39.PureComponent {
|
|
|
17291
17533
|
);
|
|
17292
17534
|
case FormControlType.NUMERIC:
|
|
17293
17535
|
case FormControlType.NUMBER: {
|
|
17294
|
-
return /* @__PURE__ */ (0,
|
|
17536
|
+
return /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(
|
|
17295
17537
|
"input",
|
|
17296
17538
|
{
|
|
17297
17539
|
autoComplete: this.getAutocompleteValue(),
|
|
@@ -17325,7 +17567,7 @@ var _FormControl = class _FormControl extends import_react39.PureComponent {
|
|
|
17325
17567
|
);
|
|
17326
17568
|
}
|
|
17327
17569
|
case FormControlType.HIDDEN:
|
|
17328
|
-
return /* @__PURE__ */ (0,
|
|
17570
|
+
return /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(
|
|
17329
17571
|
"input",
|
|
17330
17572
|
{
|
|
17331
17573
|
type: "hidden",
|
|
@@ -17335,7 +17577,7 @@ var _FormControl = class _FormControl extends import_react39.PureComponent {
|
|
|
17335
17577
|
}
|
|
17336
17578
|
);
|
|
17337
17579
|
case FormControlType.PASSWORD:
|
|
17338
|
-
return /* @__PURE__ */ (0,
|
|
17580
|
+
return /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(
|
|
17339
17581
|
"input",
|
|
17340
17582
|
{
|
|
17341
17583
|
autoComplete: this.getAutocompleteValue(),
|
|
@@ -17355,8 +17597,8 @@ var _FormControl = class _FormControl extends import_react39.PureComponent {
|
|
|
17355
17597
|
);
|
|
17356
17598
|
case FormControlType.DATE:
|
|
17357
17599
|
case FormControlType.DATETIME:
|
|
17358
|
-
return /* @__PURE__ */ (0,
|
|
17359
|
-
|
|
17600
|
+
return /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(
|
|
17601
|
+
import_components57.DateInput,
|
|
17360
17602
|
{
|
|
17361
17603
|
"aria-labelledby": labelledBy,
|
|
17362
17604
|
dayAutoComplete: this.getAutocompleteValue({ suffix: "-day" }),
|
|
@@ -17372,8 +17614,8 @@ var _FormControl = class _FormControl extends import_react39.PureComponent {
|
|
|
17372
17614
|
}
|
|
17373
17615
|
);
|
|
17374
17616
|
case FormControlType.DATELOOKUP: {
|
|
17375
|
-
return /* @__PURE__ */ (0,
|
|
17376
|
-
|
|
17617
|
+
return /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(
|
|
17618
|
+
import_components57.DateLookup,
|
|
17377
17619
|
{
|
|
17378
17620
|
value: getSafeDateStringValue(value),
|
|
17379
17621
|
min: minDate,
|
|
@@ -17390,8 +17632,8 @@ var _FormControl = class _FormControl extends import_react39.PureComponent {
|
|
|
17390
17632
|
);
|
|
17391
17633
|
}
|
|
17392
17634
|
case FormControlType.TEL:
|
|
17393
|
-
return /* @__PURE__ */ (0,
|
|
17394
|
-
|
|
17635
|
+
return /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(
|
|
17636
|
+
import_components57.PhoneNumberInput,
|
|
17395
17637
|
{
|
|
17396
17638
|
disabled,
|
|
17397
17639
|
countryCode,
|
|
@@ -17422,8 +17664,8 @@ var _FormControl = class _FormControl extends import_react39.PureComponent {
|
|
|
17422
17664
|
autoComplete: this.getAutocompleteValue()
|
|
17423
17665
|
};
|
|
17424
17666
|
if (this.props.displayPattern) {
|
|
17425
|
-
return /* @__PURE__ */ (0,
|
|
17426
|
-
|
|
17667
|
+
return /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(
|
|
17668
|
+
import_components57.TextareaWithDisplayFormat,
|
|
17427
17669
|
__spreadProps(__spreadValues({
|
|
17428
17670
|
displayPattern: this.props.displayPattern
|
|
17429
17671
|
}, textareaProps), {
|
|
@@ -17431,7 +17673,7 @@ var _FormControl = class _FormControl extends import_react39.PureComponent {
|
|
|
17431
17673
|
})
|
|
17432
17674
|
);
|
|
17433
17675
|
}
|
|
17434
|
-
return /* @__PURE__ */ (0,
|
|
17676
|
+
return /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(
|
|
17435
17677
|
"textarea",
|
|
17436
17678
|
__spreadProps(__spreadValues({}, textareaProps), {
|
|
17437
17679
|
"aria-describedby": describedBy,
|
|
@@ -17441,8 +17683,8 @@ var _FormControl = class _FormControl extends import_react39.PureComponent {
|
|
|
17441
17683
|
}
|
|
17442
17684
|
case FormControlType.FILE:
|
|
17443
17685
|
case FormControlType.UPLOAD: {
|
|
17444
|
-
return /* @__PURE__ */ (0,
|
|
17445
|
-
|
|
17686
|
+
return /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(
|
|
17687
|
+
import_components57.Upload,
|
|
17446
17688
|
__spreadProps(__spreadValues({}, uploadProps), {
|
|
17447
17689
|
usAccept: uploadProps.usAccept || "*",
|
|
17448
17690
|
usDisabled: uploadProps.usDisabled || disabled,
|
|
@@ -17478,8 +17720,8 @@ var _FormControl = class _FormControl extends import_react39.PureComponent {
|
|
|
17478
17720
|
autoComplete: this.getAutocompleteValue()
|
|
17479
17721
|
};
|
|
17480
17722
|
if (this.props.displayPattern) {
|
|
17481
|
-
return /* @__PURE__ */ (0,
|
|
17482
|
-
|
|
17723
|
+
return /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(
|
|
17724
|
+
import_components57.InputWithDisplayFormat,
|
|
17483
17725
|
__spreadProps(__spreadValues({
|
|
17484
17726
|
displayPattern: this.props.displayPattern
|
|
17485
17727
|
}, inputProps), {
|
|
@@ -17487,7 +17729,7 @@ var _FormControl = class _FormControl extends import_react39.PureComponent {
|
|
|
17487
17729
|
})
|
|
17488
17730
|
);
|
|
17489
17731
|
}
|
|
17490
|
-
return /* @__PURE__ */ (0,
|
|
17732
|
+
return /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(
|
|
17491
17733
|
"input",
|
|
17492
17734
|
__spreadProps(__spreadValues({}, inputProps), {
|
|
17493
17735
|
"aria-describedby": describedBy,
|
|
@@ -17537,7 +17779,7 @@ _FormControl.defaultProps = {
|
|
|
17537
17779
|
var FormControl = _FormControl;
|
|
17538
17780
|
|
|
17539
17781
|
// src/legacy/jsonSchemaForm/schemaFormControl/SchemaFormControl.tsx
|
|
17540
|
-
var
|
|
17782
|
+
var import_jsx_runtime92 = require("react/jsx-runtime");
|
|
17541
17783
|
var isNativeInput = (propsSchemaType) => propsSchemaType === "string" || propsSchemaType === "number";
|
|
17542
17784
|
var getControlType = (schema) => {
|
|
17543
17785
|
if (isOneOfSchema2(schema)) {
|
|
@@ -17654,7 +17896,7 @@ function SchemaFormControl(props) {
|
|
|
17654
17896
|
labelledBy,
|
|
17655
17897
|
required
|
|
17656
17898
|
};
|
|
17657
|
-
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)) });
|
|
17658
17900
|
}
|
|
17659
17901
|
var warnIfInvalidSchema = (schema, log, controlType) => {
|
|
17660
17902
|
if (isOneOfSchema2(schema) && schema.oneOf.length === 2 && !schema.control) {
|
|
@@ -17676,7 +17918,7 @@ var warnIfInvalidSchema = (schema, log, controlType) => {
|
|
|
17676
17918
|
var SchemaFormControl_default = SchemaFormControl;
|
|
17677
17919
|
|
|
17678
17920
|
// src/legacy/jsonSchemaForm/oneOfSchema/OneOfSchema.tsx
|
|
17679
|
-
var
|
|
17921
|
+
var import_jsx_runtime93 = require("react/jsx-runtime");
|
|
17680
17922
|
function OneOfSchema(props) {
|
|
17681
17923
|
const onEvent = useEventDispatcher();
|
|
17682
17924
|
const [changed, setChanged] = (0, import_react41.useState)(false);
|
|
@@ -17755,12 +17997,12 @@ function OneOfSchema(props) {
|
|
|
17755
17997
|
const isHidden = props.schema.hidden;
|
|
17756
17998
|
const feedbackId = `${id}-feedback`;
|
|
17757
17999
|
const labelId = `${id}-label`;
|
|
17758
|
-
return !isHidden ? /* @__PURE__ */ (0,
|
|
17759
|
-
(props.schema.oneOf.length > 1 || isConstSchema2(props.schema.oneOf[0])) && /* @__PURE__ */ (0,
|
|
17760
|
-
props.schema.alert && /* @__PURE__ */ (0,
|
|
17761
|
-
/* @__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: [
|
|
17762
18004
|
getTitleAndHelp(props.schema, id, labelId),
|
|
17763
|
-
/* @__PURE__ */ (0,
|
|
18005
|
+
/* @__PURE__ */ (0, import_jsx_runtime93.jsx)(
|
|
17764
18006
|
SchemaFormControl_default,
|
|
17765
18007
|
{
|
|
17766
18008
|
id,
|
|
@@ -17777,7 +18019,7 @@ function OneOfSchema(props) {
|
|
|
17777
18019
|
onSearchChange
|
|
17778
18020
|
}
|
|
17779
18021
|
),
|
|
17780
|
-
/* @__PURE__ */ (0,
|
|
18022
|
+
/* @__PURE__ */ (0, import_jsx_runtime93.jsx)(
|
|
17781
18023
|
ControlFeedback_default,
|
|
17782
18024
|
{
|
|
17783
18025
|
id: feedbackId,
|
|
@@ -17793,7 +18035,7 @@ function OneOfSchema(props) {
|
|
|
17793
18035
|
)
|
|
17794
18036
|
] })
|
|
17795
18037
|
] }),
|
|
17796
|
-
isNoNConstSchema(props.schema.oneOf[schemaIndex]) && /* @__PURE__ */ (0,
|
|
18038
|
+
isNoNConstSchema(props.schema.oneOf[schemaIndex]) && /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(
|
|
17797
18039
|
GenericSchema_default,
|
|
17798
18040
|
{
|
|
17799
18041
|
schema: props.schema.oneOf[schemaIndex],
|
|
@@ -17810,16 +18052,16 @@ function OneOfSchema(props) {
|
|
|
17810
18052
|
}
|
|
17811
18053
|
function getTitleAndHelp(schema, forId, labelId) {
|
|
17812
18054
|
var _a;
|
|
17813
|
-
const helpElement = schema.help ? /* @__PURE__ */ (0,
|
|
17814
|
-
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: [
|
|
17815
18057
|
schema.title,
|
|
17816
18058
|
" ",
|
|
17817
18059
|
helpElement
|
|
17818
|
-
] }) }) : /* @__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: [
|
|
17819
18061
|
schema.title,
|
|
17820
18062
|
" ",
|
|
17821
18063
|
helpElement
|
|
17822
|
-
] }) : /* @__PURE__ */ (0,
|
|
18064
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(import_components58.Header, { title: (_a = schema.title) != null ? _a : "" }) });
|
|
17823
18065
|
return schema.title ? titleElement : helpElement;
|
|
17824
18066
|
}
|
|
17825
18067
|
function getValidations(props, schemaIndex) {
|
|
@@ -17852,14 +18094,14 @@ function mapOneOfToConst(schema, index) {
|
|
|
17852
18094
|
var OneOfSchema_default = OneOfSchema;
|
|
17853
18095
|
|
|
17854
18096
|
// src/legacy/jsonSchemaForm/persistAsyncSchema/persistAsyncBlobSchema/PersistAsyncBlobSchema.tsx
|
|
17855
|
-
var
|
|
18097
|
+
var import_classnames13 = __toESM(require_classnames());
|
|
17856
18098
|
var import_react43 = require("react");
|
|
17857
18099
|
var import_react_intl36 = require("react-intl");
|
|
17858
18100
|
|
|
17859
18101
|
// src/legacy/jsonSchemaForm/persistAsyncSchema/persistAsyncBlobSchema/UploadInputAdapter.tsx
|
|
17860
|
-
var
|
|
18102
|
+
var import_components59 = require("@transferwise/components");
|
|
17861
18103
|
var import_react42 = require("react");
|
|
17862
|
-
var
|
|
18104
|
+
var import_jsx_runtime94 = require("react/jsx-runtime");
|
|
17863
18105
|
function UploadInputAdapter(props) {
|
|
17864
18106
|
const {
|
|
17865
18107
|
id,
|
|
@@ -17875,7 +18117,7 @@ function UploadInputAdapter(props) {
|
|
|
17875
18117
|
onCancel
|
|
17876
18118
|
} = props;
|
|
17877
18119
|
const onEvent = useEventDispatcher();
|
|
17878
|
-
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]);
|
|
17879
18121
|
const uploadFile = (formData) => {
|
|
17880
18122
|
onEvent("Dynamic Flow - PersistAsync", { status: "pending", schemaId: id });
|
|
17881
18123
|
return httpClient(String(httpOptions.url), {
|
|
@@ -17894,8 +18136,8 @@ function UploadInputAdapter(props) {
|
|
|
17894
18136
|
return Promise.reject();
|
|
17895
18137
|
});
|
|
17896
18138
|
};
|
|
17897
|
-
return /* @__PURE__ */ (0,
|
|
17898
|
-
|
|
18139
|
+
return /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(
|
|
18140
|
+
import_components59.UploadInput,
|
|
17899
18141
|
{
|
|
17900
18142
|
id,
|
|
17901
18143
|
fileInputName: httpOptions.fileInputName,
|
|
@@ -17914,7 +18156,7 @@ function UploadInputAdapter(props) {
|
|
|
17914
18156
|
}
|
|
17915
18157
|
|
|
17916
18158
|
// src/legacy/jsonSchemaForm/persistAsyncSchema/persistAsyncBlobSchema/PersistAsyncBlobSchema.tsx
|
|
17917
|
-
var
|
|
18159
|
+
var import_jsx_runtime95 = require("react/jsx-runtime");
|
|
17918
18160
|
function PersistAsyncBlobSchema(props) {
|
|
17919
18161
|
const { model, schema, submitted, required = false, errors, onChange } = props;
|
|
17920
18162
|
const [persistAsyncValidationMessages, setPersistAsyncValidationMessages] = (0, import_react43.useState)({});
|
|
@@ -17962,8 +18204,8 @@ function PersistAsyncBlobSchema(props) {
|
|
|
17962
18204
|
};
|
|
17963
18205
|
const id = schema.$id || schema.persistAsync.schema.$id || schema.persistAsync.idProperty;
|
|
17964
18206
|
const feedbackId = `${id}-feedback`;
|
|
17965
|
-
return /* @__PURE__ */ (0,
|
|
17966
|
-
/* @__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)(
|
|
17967
18209
|
UploadInputAdapter,
|
|
17968
18210
|
__spreadValues({
|
|
17969
18211
|
id,
|
|
@@ -17981,7 +18223,7 @@ function PersistAsyncBlobSchema(props) {
|
|
|
17981
18223
|
onCancel
|
|
17982
18224
|
}, mapSchemaToUploadOptions(schema.persistAsync.schema))
|
|
17983
18225
|
) }),
|
|
17984
|
-
/* @__PURE__ */ (0,
|
|
18226
|
+
/* @__PURE__ */ (0, import_jsx_runtime95.jsx)(
|
|
17985
18227
|
ControlFeedback_default,
|
|
17986
18228
|
{
|
|
17987
18229
|
id: feedbackId,
|
|
@@ -18007,17 +18249,17 @@ var getResponseJsonObject = async (response) => {
|
|
|
18007
18249
|
var PersistAsyncBlobSchema_default = PersistAsyncBlobSchema;
|
|
18008
18250
|
|
|
18009
18251
|
// src/legacy/jsonSchemaForm/persistAsyncSchema/PersistAsyncSchema.tsx
|
|
18010
|
-
var
|
|
18252
|
+
var import_jsx_runtime96 = require("react/jsx-runtime");
|
|
18011
18253
|
function PersistAsyncSchema(props) {
|
|
18012
18254
|
const { schema } = props;
|
|
18013
18255
|
const persistAsyncSchemaType = schema.persistAsync.schema.type;
|
|
18014
18256
|
if (persistAsyncSchemaType === "blob") {
|
|
18015
|
-
return /* @__PURE__ */ (0,
|
|
18257
|
+
return /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(
|
|
18016
18258
|
PersistAsyncBlobSchema_default,
|
|
18017
18259
|
__spreadValues({}, props)
|
|
18018
18260
|
);
|
|
18019
18261
|
}
|
|
18020
|
-
return /* @__PURE__ */ (0,
|
|
18262
|
+
return /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(PersistAsyncBasicSchema_default, __spreadValues({}, props));
|
|
18021
18263
|
}
|
|
18022
18264
|
var PersistAsyncSchema_default = PersistAsyncSchema;
|
|
18023
18265
|
|
|
@@ -18034,8 +18276,8 @@ var getSelectionFromModel = (schema, model) => {
|
|
|
18034
18276
|
};
|
|
18035
18277
|
|
|
18036
18278
|
// src/legacy/jsonSchemaForm/promotedOneOfSchema/promotedOneOfControl/PromotedOneOfCheckboxControl.tsx
|
|
18037
|
-
var
|
|
18038
|
-
var
|
|
18279
|
+
var import_components60 = require("@transferwise/components");
|
|
18280
|
+
var import_jsx_runtime97 = require("react/jsx-runtime");
|
|
18039
18281
|
var PromotedOneOfCheckboxControl = (props) => {
|
|
18040
18282
|
const { id, selection, setSelection } = props;
|
|
18041
18283
|
const { promoted, other, checkedMeans } = props.promotion;
|
|
@@ -18046,13 +18288,13 @@ var PromotedOneOfCheckboxControl = (props) => {
|
|
|
18046
18288
|
const toggleSelection = () => {
|
|
18047
18289
|
setSelection(checked ? selectionWhenUnchecked : selectionWhenChecked);
|
|
18048
18290
|
};
|
|
18049
|
-
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 }) });
|
|
18050
18292
|
};
|
|
18051
18293
|
var PromotedOneOfCheckboxControl_default = PromotedOneOfCheckboxControl;
|
|
18052
18294
|
|
|
18053
18295
|
// src/legacy/jsonSchemaForm/promotedOneOfSchema/promotedOneOfControl/PromotedOneOfRadioControl.tsx
|
|
18054
|
-
var
|
|
18055
|
-
var
|
|
18296
|
+
var import_components61 = require("@transferwise/components");
|
|
18297
|
+
var import_jsx_runtime98 = require("react/jsx-runtime");
|
|
18056
18298
|
function PromotedOneOfRadioControl(props) {
|
|
18057
18299
|
var _a, _b;
|
|
18058
18300
|
const { id, selection, setSelection, promotion, promotedOneOf, title } = props;
|
|
@@ -18069,10 +18311,10 @@ function PromotedOneOfRadioControl(props) {
|
|
|
18069
18311
|
secondary: promotion.other.description
|
|
18070
18312
|
}, getAvatarPropertyForRadioOption(promotion.other))
|
|
18071
18313
|
];
|
|
18072
|
-
return /* @__PURE__ */ (0,
|
|
18073
|
-
title && /* @__PURE__ */ (0,
|
|
18074
|
-
/* @__PURE__ */ (0,
|
|
18075
|
-
|
|
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,
|
|
18076
18318
|
{
|
|
18077
18319
|
name: "promoted-selection",
|
|
18078
18320
|
selectedValue: selection,
|
|
@@ -18089,16 +18331,16 @@ PromotedOneOfRadioControl.defaultProps = {
|
|
|
18089
18331
|
var PromotedOneOfRadioControl_default = PromotedOneOfRadioControl;
|
|
18090
18332
|
|
|
18091
18333
|
// src/legacy/jsonSchemaForm/promotedOneOfSchema/promotedOneOfControl/PromotedOneOfControl.tsx
|
|
18092
|
-
var
|
|
18334
|
+
var import_jsx_runtime99 = require("react/jsx-runtime");
|
|
18093
18335
|
function PromotedOneOfControl(props) {
|
|
18094
18336
|
const controlType = props.promotion.control || "radio";
|
|
18095
18337
|
switch (controlType) {
|
|
18096
18338
|
case "radio":
|
|
18097
|
-
return /* @__PURE__ */ (0,
|
|
18339
|
+
return /* @__PURE__ */ (0, import_jsx_runtime99.jsx)(PromotedOneOfRadioControl_default, __spreadValues({}, props));
|
|
18098
18340
|
case "checkbox":
|
|
18099
|
-
return /* @__PURE__ */ (0,
|
|
18341
|
+
return /* @__PURE__ */ (0, import_jsx_runtime99.jsx)(PromotedOneOfCheckboxControl_default, __spreadValues({}, props));
|
|
18100
18342
|
default:
|
|
18101
|
-
return /* @__PURE__ */ (0,
|
|
18343
|
+
return /* @__PURE__ */ (0, import_jsx_runtime99.jsx)(import_jsx_runtime99.Fragment, {});
|
|
18102
18344
|
}
|
|
18103
18345
|
}
|
|
18104
18346
|
PromotedOneOfControl.defaultProps = {
|
|
@@ -18108,7 +18350,7 @@ PromotedOneOfControl.defaultProps = {
|
|
|
18108
18350
|
var PromotedOneOfControl_default = PromotedOneOfControl;
|
|
18109
18351
|
|
|
18110
18352
|
// src/legacy/jsonSchemaForm/promotedOneOfSchema/PromotedOneOfSchema.tsx
|
|
18111
|
-
var
|
|
18353
|
+
var import_jsx_runtime100 = require("react/jsx-runtime");
|
|
18112
18354
|
var isPromoted = (schema) => schema.promoted === true;
|
|
18113
18355
|
var PromotedOneOfSchema = (props) => {
|
|
18114
18356
|
var _a;
|
|
@@ -18119,9 +18361,9 @@ var PromotedOneOfSchema = (props) => {
|
|
|
18119
18361
|
const promotedOneOf = props.schema.oneOf.find(isPromoted);
|
|
18120
18362
|
const promotedObjectSchema = getPromotedObjectSchema(promotedOneOf);
|
|
18121
18363
|
const otherOneOf = getOtherOneOf(props.schema);
|
|
18122
|
-
return /* @__PURE__ */ (0,
|
|
18123
|
-
promotedAlert && /* @__PURE__ */ (0,
|
|
18124
|
-
/* @__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)(
|
|
18125
18367
|
PromotedOneOfControl_default,
|
|
18126
18368
|
{
|
|
18127
18369
|
id: props.schema.$id,
|
|
@@ -18132,8 +18374,8 @@ var PromotedOneOfSchema = (props) => {
|
|
|
18132
18374
|
setSelection
|
|
18133
18375
|
}
|
|
18134
18376
|
),
|
|
18135
|
-
selection === "promoted" && /* @__PURE__ */ (0,
|
|
18136
|
-
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 }))
|
|
18137
18379
|
] });
|
|
18138
18380
|
};
|
|
18139
18381
|
function getPromotedObjectSchema(promotedSchema) {
|
|
@@ -18163,7 +18405,7 @@ function getOtherOneOf(schema) {
|
|
|
18163
18405
|
var PromotedOneOfSchema_default = PromotedOneOfSchema;
|
|
18164
18406
|
|
|
18165
18407
|
// src/legacy/jsonSchemaForm/readOnlySchema/ReadOnlySchema.tsx
|
|
18166
|
-
var
|
|
18408
|
+
var import_components62 = require("@transferwise/components");
|
|
18167
18409
|
var import_react_intl38 = require("react-intl");
|
|
18168
18410
|
|
|
18169
18411
|
// src/legacy/jsonSchemaForm/readOnlySchema/ReadOnlySchema.messages.ts
|
|
@@ -18182,12 +18424,12 @@ var ReadOnlySchema_messages_default = (0, import_react_intl37.defineMessages)({
|
|
|
18182
18424
|
});
|
|
18183
18425
|
|
|
18184
18426
|
// src/legacy/jsonSchemaForm/readOnlySchema/ReadOnlySchema.tsx
|
|
18185
|
-
var
|
|
18427
|
+
var import_jsx_runtime101 = require("react/jsx-runtime");
|
|
18186
18428
|
function ReadOnlySchema({ schema, model }) {
|
|
18187
18429
|
const { title = "" } = schema;
|
|
18188
18430
|
const { formatMessage } = (0, import_react_intl38.useIntl)();
|
|
18189
18431
|
const value = getValueForSchema({ schema, model, formatMessage });
|
|
18190
|
-
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: "" }] });
|
|
18191
18433
|
}
|
|
18192
18434
|
var ReadOnlySchema_default = ReadOnlySchema;
|
|
18193
18435
|
function getValueForSchema({
|
|
@@ -18220,7 +18462,7 @@ function getSelectedOneOf(schema, model) {
|
|
|
18220
18462
|
function getValueFromOption(option) {
|
|
18221
18463
|
const text = option.title && option.description ? `${option.title} - ${option.description}` : option.title || "";
|
|
18222
18464
|
const icon = getAvatarPropertyForRadioOption({ icon: option.icon });
|
|
18223
|
-
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: [
|
|
18224
18466
|
icon.avatar,
|
|
18225
18467
|
" ",
|
|
18226
18468
|
text
|
|
@@ -18229,7 +18471,7 @@ function getValueFromOption(option) {
|
|
|
18229
18471
|
|
|
18230
18472
|
// src/legacy/jsonSchemaForm/validationAsyncSchema/ValidationAsyncSchema.tsx
|
|
18231
18473
|
var import_react45 = require("react");
|
|
18232
|
-
var
|
|
18474
|
+
var import_jsx_runtime102 = require("react/jsx-runtime");
|
|
18233
18475
|
function ValidationAsyncSchema(props) {
|
|
18234
18476
|
const { schema, model, required = false, submitted, errors, onChange } = props;
|
|
18235
18477
|
const [validationAsyncModel, setValidationAsyncModel] = (0, import_react45.useState)(model);
|
|
@@ -18313,12 +18555,12 @@ function ValidationAsyncSchema(props) {
|
|
|
18313
18555
|
required,
|
|
18314
18556
|
schema
|
|
18315
18557
|
};
|
|
18316
|
-
return /* @__PURE__ */ (0,
|
|
18558
|
+
return /* @__PURE__ */ (0, import_jsx_runtime102.jsx)(BasicTypeSchema_default, __spreadValues({}, basicTypeSchemaProps));
|
|
18317
18559
|
}
|
|
18318
18560
|
var ValidationAsyncSchema_default = ValidationAsyncSchema;
|
|
18319
18561
|
|
|
18320
18562
|
// src/legacy/jsonSchemaForm/genericSchema/GenericSchema.tsx
|
|
18321
|
-
var
|
|
18563
|
+
var import_jsx_runtime103 = require("react/jsx-runtime");
|
|
18322
18564
|
var import_react47 = require("react");
|
|
18323
18565
|
function GenericSchemaForm(props) {
|
|
18324
18566
|
const { schema, model = null, errors = null, hideTitle = false, disabled = false } = props;
|
|
@@ -18335,29 +18577,29 @@ function GenericSchemaForm(props) {
|
|
|
18335
18577
|
}, [JSON.stringify(schema), JSON.stringify(model), JSON.stringify(errors), type, log]);
|
|
18336
18578
|
switch (type) {
|
|
18337
18579
|
case "readOnly":
|
|
18338
|
-
return /* @__PURE__ */ (0,
|
|
18580
|
+
return /* @__PURE__ */ (0, import_jsx_runtime103.jsx)(ReadOnlySchema_default, __spreadValues({}, schemaProps));
|
|
18339
18581
|
case "persistAsync":
|
|
18340
|
-
return /* @__PURE__ */ (0,
|
|
18582
|
+
return /* @__PURE__ */ (0, import_jsx_runtime103.jsx)(PersistAsyncSchema_default, __spreadValues({}, schemaProps));
|
|
18341
18583
|
case "validationAsync":
|
|
18342
|
-
return /* @__PURE__ */ (0,
|
|
18584
|
+
return /* @__PURE__ */ (0, import_jsx_runtime103.jsx)(ValidationAsyncSchema_default, __spreadValues({}, schemaProps));
|
|
18343
18585
|
case "basic": {
|
|
18344
18586
|
const basicTypeProps = __spreadValues({
|
|
18345
18587
|
infoMessage: null
|
|
18346
18588
|
}, schemaProps);
|
|
18347
|
-
return /* @__PURE__ */ (0,
|
|
18589
|
+
return /* @__PURE__ */ (0, import_jsx_runtime103.jsx)(BasicTypeSchema_default, __spreadValues({}, basicTypeProps));
|
|
18348
18590
|
}
|
|
18349
18591
|
case "object":
|
|
18350
18592
|
return /* @__PURE__ */ (0, import_react47.createElement)(ObjectSchema_default, __spreadProps(__spreadValues({}, schemaProps), { key: JSON.stringify(schema) }));
|
|
18351
18593
|
case "array":
|
|
18352
|
-
return /* @__PURE__ */ (0,
|
|
18594
|
+
return /* @__PURE__ */ (0, import_jsx_runtime103.jsx)(ArraySchema_default, __spreadValues({}, schemaProps));
|
|
18353
18595
|
case "promotedOneOf":
|
|
18354
|
-
return /* @__PURE__ */ (0,
|
|
18596
|
+
return /* @__PURE__ */ (0, import_jsx_runtime103.jsx)(PromotedOneOfSchema_default, __spreadValues({}, schemaProps));
|
|
18355
18597
|
case "oneOf":
|
|
18356
|
-
return /* @__PURE__ */ (0,
|
|
18598
|
+
return /* @__PURE__ */ (0, import_jsx_runtime103.jsx)(OneOfSchema_default, __spreadValues({}, schemaProps));
|
|
18357
18599
|
case "allOf":
|
|
18358
|
-
return /* @__PURE__ */ (0,
|
|
18600
|
+
return /* @__PURE__ */ (0, import_jsx_runtime103.jsx)(AllOfSchema_default, __spreadValues({}, schemaProps));
|
|
18359
18601
|
}
|
|
18360
|
-
return /* @__PURE__ */ (0,
|
|
18602
|
+
return /* @__PURE__ */ (0, import_jsx_runtime103.jsx)(import_jsx_runtime103.Fragment, {});
|
|
18361
18603
|
}
|
|
18362
18604
|
var GenericSchema_default = GenericSchemaForm;
|
|
18363
18605
|
var isValidGenericSchema = (schema, model, errors) => {
|
|
@@ -18384,7 +18626,7 @@ var isValidGenericSchema = (schema, model, errors) => {
|
|
|
18384
18626
|
};
|
|
18385
18627
|
|
|
18386
18628
|
// src/legacy/layout/form/DynamicForm.tsx
|
|
18387
|
-
var
|
|
18629
|
+
var import_jsx_runtime104 = require("react/jsx-runtime");
|
|
18388
18630
|
function DynamicForm({
|
|
18389
18631
|
component,
|
|
18390
18632
|
model = null,
|
|
@@ -18394,7 +18636,7 @@ function DynamicForm({
|
|
|
18394
18636
|
onPersistAsync
|
|
18395
18637
|
}) {
|
|
18396
18638
|
const formSchema = component.schema;
|
|
18397
|
-
return /* @__PURE__ */ (0,
|
|
18639
|
+
return /* @__PURE__ */ (0, import_jsx_runtime104.jsx)("div", { className: getMargin2(component.margin || "md"), children: /* @__PURE__ */ (0, import_jsx_runtime104.jsx)(
|
|
18398
18640
|
GenericSchema_default,
|
|
18399
18641
|
{
|
|
18400
18642
|
schema: formSchema,
|
|
@@ -18411,68 +18653,82 @@ function DynamicForm({
|
|
|
18411
18653
|
var DynamicForm_default = DynamicForm;
|
|
18412
18654
|
|
|
18413
18655
|
// src/legacy/layout/heading/DynamicHeading.tsx
|
|
18414
|
-
var
|
|
18415
|
-
var
|
|
18416
|
-
var
|
|
18656
|
+
var import_components63 = require("@transferwise/components");
|
|
18657
|
+
var import_classnames14 = __toESM(require_classnames());
|
|
18658
|
+
var import_jsx_runtime105 = require("react/jsx-runtime");
|
|
18417
18659
|
var DynamicHeading = (props) => {
|
|
18418
18660
|
const { text, size: size2 = "md", align = "left", margin = "md", control } = props.component;
|
|
18419
|
-
const classes = (0,
|
|
18420
|
-
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 });
|
|
18421
18663
|
};
|
|
18422
18664
|
var StandardHeading2 = ({ size: size2, text, classes }) => {
|
|
18423
18665
|
switch (size2) {
|
|
18424
18666
|
case "xs":
|
|
18425
|
-
return /* @__PURE__ */ (0,
|
|
18667
|
+
return /* @__PURE__ */ (0, import_jsx_runtime105.jsx)("h5", { className: classes, children: text });
|
|
18426
18668
|
case "sm":
|
|
18427
|
-
return /* @__PURE__ */ (0,
|
|
18669
|
+
return /* @__PURE__ */ (0, import_jsx_runtime105.jsx)("h4", { className: classes, children: text });
|
|
18428
18670
|
case "lg":
|
|
18429
|
-
return /* @__PURE__ */ (0,
|
|
18671
|
+
return /* @__PURE__ */ (0, import_jsx_runtime105.jsx)("h2", { className: classes, children: text });
|
|
18430
18672
|
case "xl":
|
|
18431
|
-
return /* @__PURE__ */ (0,
|
|
18673
|
+
return /* @__PURE__ */ (0, import_jsx_runtime105.jsx)("h1", { className: classes, children: text });
|
|
18432
18674
|
case "md":
|
|
18433
18675
|
default:
|
|
18434
|
-
return /* @__PURE__ */ (0,
|
|
18676
|
+
return /* @__PURE__ */ (0, import_jsx_runtime105.jsx)("h3", { className: classes, children: text });
|
|
18435
18677
|
}
|
|
18436
18678
|
};
|
|
18437
18679
|
var DisplayHeading2 = ({ size: size2, text, classes }) => {
|
|
18438
18680
|
switch (size2) {
|
|
18439
18681
|
case "xs":
|
|
18440
18682
|
case "sm":
|
|
18441
|
-
return /* @__PURE__ */ (0,
|
|
18683
|
+
return /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(import_components63.Display, { type: "display-small", className: classes, children: text });
|
|
18442
18684
|
case "xl":
|
|
18443
18685
|
case "lg":
|
|
18444
|
-
return /* @__PURE__ */ (0,
|
|
18686
|
+
return /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(import_components63.Display, { type: "display-large", className: classes, children: text });
|
|
18445
18687
|
case "md":
|
|
18446
18688
|
default:
|
|
18447
|
-
return /* @__PURE__ */ (0,
|
|
18689
|
+
return /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(import_components63.Display, { type: "display-medium", className: classes, children: text });
|
|
18448
18690
|
}
|
|
18449
18691
|
};
|
|
18450
18692
|
var DynamicHeading_default = DynamicHeading;
|
|
18451
18693
|
|
|
18452
18694
|
// src/legacy/layout/markdown/DynamicMarkdown.tsx
|
|
18453
|
-
var
|
|
18454
|
-
var
|
|
18695
|
+
var import_components64 = require("@transferwise/components");
|
|
18696
|
+
var import_jsx_runtime106 = require("react/jsx-runtime");
|
|
18455
18697
|
var DynamicMarkdown = ({ component }) => {
|
|
18456
18698
|
const { content, align, margin } = component;
|
|
18457
|
-
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 }) });
|
|
18458
18700
|
};
|
|
18459
18701
|
var DynamicInfo = ({ component }) => {
|
|
18460
|
-
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 }) });
|
|
18461
18703
|
};
|
|
18462
18704
|
|
|
18463
18705
|
// src/legacy/layout/image/DynamicImage.tsx
|
|
18464
|
-
var
|
|
18706
|
+
var import_components65 = require("@transferwise/components");
|
|
18465
18707
|
var import_react48 = require("react");
|
|
18466
|
-
var
|
|
18708
|
+
var import_jsx_runtime107 = require("react/jsx-runtime");
|
|
18467
18709
|
function DynamicImage({ component: image }) {
|
|
18468
|
-
|
|
18710
|
+
var _a, _b, _c;
|
|
18711
|
+
const { content, url, size: size2, text, margin, accessibilityDescription } = image;
|
|
18469
18712
|
const httpClient = useHttpClient();
|
|
18470
18713
|
const [imageSource, setImageSource] = (0, import_react48.useState)("");
|
|
18471
18714
|
(0, import_react48.useEffect)(() => {
|
|
18472
|
-
|
|
18473
|
-
|
|
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]);
|
|
18474
18730
|
const imageProps = {
|
|
18475
|
-
alt: accessibilityDescription
|
|
18731
|
+
alt: (_c = (_b = (_a = content == null ? void 0 : content.accessibilityDescription) != null ? _a : accessibilityDescription) != null ? _b : text) != null ? _c : "",
|
|
18476
18732
|
src: imageSource,
|
|
18477
18733
|
stretch: true,
|
|
18478
18734
|
shrink: true
|
|
@@ -18480,7 +18736,7 @@ function DynamicImage({ component: image }) {
|
|
|
18480
18736
|
if (!imageSource) {
|
|
18481
18737
|
return null;
|
|
18482
18738
|
}
|
|
18483
|
-
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)) });
|
|
18484
18740
|
}
|
|
18485
18741
|
var readImageBlobAsDataURL2 = (imageBlob) => (
|
|
18486
18742
|
// we can safely assume the type of reader.result is string
|
|
@@ -18516,48 +18772,48 @@ var getImageSource2 = async (httpClient, imageUrl) => {
|
|
|
18516
18772
|
var DynamicImage_default = DynamicImage;
|
|
18517
18773
|
|
|
18518
18774
|
// src/legacy/layout/instructions/DynamicInstructions.tsx
|
|
18519
|
-
var
|
|
18520
|
-
var
|
|
18775
|
+
var import_components66 = require("@transferwise/components");
|
|
18776
|
+
var import_jsx_runtime108 = require("react/jsx-runtime");
|
|
18521
18777
|
var doContext2 = ["positive", "neutral"];
|
|
18522
18778
|
var dontContext2 = ["warning", "negative"];
|
|
18523
18779
|
var DynamicInstructions = ({ component }) => {
|
|
18524
18780
|
const { items } = component;
|
|
18525
18781
|
const dos = items.filter((item) => doContext2.includes(item.context)).map(({ text }) => text);
|
|
18526
18782
|
const donts = items.filter((item) => dontContext2.includes(item.context)).map(({ text }) => text);
|
|
18527
|
-
return /* @__PURE__ */ (0,
|
|
18528
|
-
component.title ? /* @__PURE__ */ (0,
|
|
18529
|
-
/* @__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 })
|
|
18530
18786
|
] });
|
|
18531
18787
|
};
|
|
18532
18788
|
var DynamicInstructions_default = DynamicInstructions;
|
|
18533
18789
|
|
|
18534
18790
|
// src/legacy/layout/DynamicLayout.tsx
|
|
18535
|
-
var
|
|
18791
|
+
var import_jsx_runtime109 = require("react/jsx-runtime");
|
|
18536
18792
|
var getKey = (component) => JSON.stringify(component);
|
|
18537
18793
|
function DynamicLayout(props) {
|
|
18538
18794
|
const { components, model, submitted, errors, onModelChange, onAction, onPersistAsync, baseUrl } = props;
|
|
18539
18795
|
const renderComponent = (component) => {
|
|
18540
18796
|
switch (component.type) {
|
|
18541
18797
|
case "heading":
|
|
18542
|
-
return /* @__PURE__ */ (0,
|
|
18798
|
+
return /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(DynamicHeading_default, { component }, getKey(component));
|
|
18543
18799
|
case "paragraph":
|
|
18544
|
-
return /* @__PURE__ */ (0,
|
|
18800
|
+
return /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(DynamicParagraph_default, { component }, getKey(component));
|
|
18545
18801
|
case "image":
|
|
18546
|
-
return /* @__PURE__ */ (0,
|
|
18802
|
+
return /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(DynamicImage_default, { component }, getKey(component));
|
|
18547
18803
|
case "alert":
|
|
18548
|
-
return /* @__PURE__ */ (0,
|
|
18804
|
+
return /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(DynamicAlert_default, { component, onAction }, getKey(component));
|
|
18549
18805
|
case "review":
|
|
18550
|
-
return /* @__PURE__ */ (0,
|
|
18806
|
+
return /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(DynamicReview_default, { component, onAction }, getKey(component));
|
|
18551
18807
|
case "divider":
|
|
18552
|
-
return /* @__PURE__ */ (0,
|
|
18808
|
+
return /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(DynamicDivider_default, { component }, getKey(component));
|
|
18553
18809
|
case "info":
|
|
18554
|
-
return /* @__PURE__ */ (0,
|
|
18810
|
+
return /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(DynamicInfo, { component }, getKey(component));
|
|
18555
18811
|
case "instructions":
|
|
18556
|
-
return /* @__PURE__ */ (0,
|
|
18812
|
+
return /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(DynamicInstructions_default, { component }, getKey(component));
|
|
18557
18813
|
case "markdown":
|
|
18558
|
-
return /* @__PURE__ */ (0,
|
|
18814
|
+
return /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(DynamicMarkdown, { component }, getKey(component));
|
|
18559
18815
|
case "columns":
|
|
18560
|
-
return /* @__PURE__ */ (0,
|
|
18816
|
+
return /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(
|
|
18561
18817
|
DynamicColumns_default,
|
|
18562
18818
|
{
|
|
18563
18819
|
component,
|
|
@@ -18571,7 +18827,7 @@ function DynamicLayout(props) {
|
|
|
18571
18827
|
getKey(component)
|
|
18572
18828
|
);
|
|
18573
18829
|
case "form":
|
|
18574
|
-
return /* @__PURE__ */ (0,
|
|
18830
|
+
return /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(
|
|
18575
18831
|
DynamicForm_default,
|
|
18576
18832
|
{
|
|
18577
18833
|
component,
|
|
@@ -18584,9 +18840,9 @@ function DynamicLayout(props) {
|
|
|
18584
18840
|
getKey(__spreadProps(__spreadValues({}, component), { errors: errors != null ? errors : null }))
|
|
18585
18841
|
);
|
|
18586
18842
|
case "button":
|
|
18587
|
-
return /* @__PURE__ */ (0,
|
|
18843
|
+
return /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(DynamicButton_default, { component, onAction }, getKey(component));
|
|
18588
18844
|
case "box":
|
|
18589
|
-
return /* @__PURE__ */ (0,
|
|
18845
|
+
return /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(
|
|
18590
18846
|
DynamicBox_default,
|
|
18591
18847
|
{
|
|
18592
18848
|
component,
|
|
@@ -18600,18 +18856,18 @@ function DynamicLayout(props) {
|
|
|
18600
18856
|
getKey(component)
|
|
18601
18857
|
);
|
|
18602
18858
|
case "decision":
|
|
18603
|
-
return /* @__PURE__ */ (0,
|
|
18859
|
+
return /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(DynamicDecision_default, { component, onAction }, getKey(component));
|
|
18604
18860
|
case "external":
|
|
18605
|
-
return /* @__PURE__ */ (0,
|
|
18861
|
+
return /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(DynamicExternal_default, { component, onAction }, getKey(component));
|
|
18606
18862
|
case "list":
|
|
18607
18863
|
case "status-list":
|
|
18608
|
-
return /* @__PURE__ */ (0,
|
|
18864
|
+
return /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(DynamicStatusList_default, { component, onAction }, getKey(component));
|
|
18609
18865
|
case "loading-indicator":
|
|
18610
|
-
return /* @__PURE__ */ (0,
|
|
18866
|
+
return /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(DynamicLoadingIndicator_default, { component }, getKey(component));
|
|
18611
18867
|
case "search":
|
|
18612
|
-
return /* @__PURE__ */ (0,
|
|
18868
|
+
return /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(DynamicSearch_default, { component, onAction }, getKey(component));
|
|
18613
18869
|
case "modal":
|
|
18614
|
-
return /* @__PURE__ */ (0,
|
|
18870
|
+
return /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(
|
|
18615
18871
|
DynamicModal_default,
|
|
18616
18872
|
{
|
|
18617
18873
|
component,
|
|
@@ -18625,22 +18881,22 @@ function DynamicLayout(props) {
|
|
|
18625
18881
|
getKey(component)
|
|
18626
18882
|
);
|
|
18627
18883
|
default:
|
|
18628
|
-
return /* @__PURE__ */ (0,
|
|
18884
|
+
return /* @__PURE__ */ (0, import_jsx_runtime109.jsx)("div", {}, getKey(component));
|
|
18629
18885
|
}
|
|
18630
18886
|
};
|
|
18631
18887
|
if (useHasHttpClientProvider() || baseUrl == null) {
|
|
18632
|
-
return /* @__PURE__ */ (0,
|
|
18888
|
+
return /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(import_jsx_runtime109.Fragment, { children: components.map(renderComponent) });
|
|
18633
18889
|
}
|
|
18634
|
-
return /* @__PURE__ */ (0,
|
|
18890
|
+
return /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(HttpClientProviderFromBaseUrl, { baseUrl, children: components.map(renderComponent) });
|
|
18635
18891
|
}
|
|
18636
18892
|
var DynamicLayout_default = DynamicLayout;
|
|
18637
18893
|
|
|
18638
18894
|
// src/legacy/layout/list/DynamicStatusList.tsx
|
|
18639
|
-
var
|
|
18640
|
-
var
|
|
18895
|
+
var import_components67 = require("@transferwise/components");
|
|
18896
|
+
var import_jsx_runtime110 = require("react/jsx-runtime");
|
|
18641
18897
|
var DynamicStatusList = ({ component, onAction }) => {
|
|
18642
|
-
return /* @__PURE__ */ (0,
|
|
18643
|
-
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,
|
|
18644
18900
|
component.items.map((item) => mapListItemToSummary(item, onAction))
|
|
18645
18901
|
] });
|
|
18646
18902
|
};
|
|
@@ -18650,8 +18906,8 @@ var mapListItemToSummary = (props, onAction) => {
|
|
|
18650
18906
|
title,
|
|
18651
18907
|
description,
|
|
18652
18908
|
action: "callToAction" in props ? callToActionToSummaryAction(props == null ? void 0 : props.callToAction, onAction) : void 0
|
|
18653
|
-
}, (icon == null ? void 0 : icon.name) ? { icon: /* @__PURE__ */ (0,
|
|
18654
|
-
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 || ""}`);
|
|
18655
18911
|
};
|
|
18656
18912
|
var callToActionToSummaryAction = (callToAction, onAction) => {
|
|
18657
18913
|
if (!callToAction) {
|
|
@@ -18720,12 +18976,12 @@ var statusMap = __spreadValues(__spreadValues({}, statusListMap), legacyStatusMa
|
|
|
18720
18976
|
var DynamicStatusList_default = DynamicStatusList;
|
|
18721
18977
|
|
|
18722
18978
|
// src/legacy/layout/loadingIndicator/DynamicLoadingIndicator.tsx
|
|
18723
|
-
var
|
|
18724
|
-
var
|
|
18979
|
+
var import_components68 = require("@transferwise/components");
|
|
18980
|
+
var import_jsx_runtime111 = require("react/jsx-runtime");
|
|
18725
18981
|
var DynamicLoadingIndicator = ({ component }) => {
|
|
18726
18982
|
const { margin = "md", size: size2 = "md" } = component;
|
|
18727
|
-
return /* @__PURE__ */ (0,
|
|
18728
|
-
|
|
18983
|
+
return /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(
|
|
18984
|
+
import_components68.Loader,
|
|
18729
18985
|
{
|
|
18730
18986
|
size: size2,
|
|
18731
18987
|
classNames: {
|
|
@@ -18738,7 +18994,7 @@ var DynamicLoadingIndicator = ({ component }) => {
|
|
|
18738
18994
|
var DynamicLoadingIndicator_default = DynamicLoadingIndicator;
|
|
18739
18995
|
|
|
18740
18996
|
// src/legacy/layout/paragraph/DynamicParagraph.tsx
|
|
18741
|
-
var
|
|
18997
|
+
var import_components70 = require("@transferwise/components");
|
|
18742
18998
|
var import_react_intl40 = require("react-intl");
|
|
18743
18999
|
|
|
18744
19000
|
// src/common/messages/paragraph.messages.ts
|
|
@@ -18757,22 +19013,22 @@ var paragraph_messages_default2 = (0, import_react_intl39.defineMessages)({
|
|
|
18757
19013
|
});
|
|
18758
19014
|
|
|
18759
19015
|
// src/legacy/layout/paragraph/useSnackBarIfAvailable.ts
|
|
18760
|
-
var
|
|
19016
|
+
var import_components69 = require("@transferwise/components");
|
|
18761
19017
|
var import_react49 = require("react");
|
|
18762
19018
|
function useSnackBarIfAvailable2() {
|
|
18763
|
-
const context = (0, import_react49.useContext)(
|
|
19019
|
+
const context = (0, import_react49.useContext)(import_components69.SnackbarContext);
|
|
18764
19020
|
return context ? context.createSnackbar : noop3;
|
|
18765
19021
|
}
|
|
18766
19022
|
function noop3() {
|
|
18767
19023
|
}
|
|
18768
19024
|
|
|
18769
19025
|
// src/legacy/layout/paragraph/DynamicParagraph.tsx
|
|
18770
|
-
var
|
|
19026
|
+
var import_jsx_runtime112 = require("react/jsx-runtime");
|
|
18771
19027
|
function DynamicParagraph({ component }) {
|
|
18772
|
-
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 });
|
|
18773
19029
|
}
|
|
18774
19030
|
function BasicDynamicParagraph({ component }) {
|
|
18775
|
-
return /* @__PURE__ */ (0,
|
|
19031
|
+
return /* @__PURE__ */ (0, import_jsx_runtime112.jsx)("p", { className: `np-text-body-large ${getTextAlignmentAndMargin2(component)}`, children: component.text });
|
|
18776
19032
|
}
|
|
18777
19033
|
function CopyableDynamicParagraph({ component }) {
|
|
18778
19034
|
const { formatMessage } = (0, import_react_intl40.useIntl)();
|
|
@@ -18782,22 +19038,22 @@ function CopyableDynamicParagraph({ component }) {
|
|
|
18782
19038
|
var _a;
|
|
18783
19039
|
(_a = navigator.clipboard) == null ? void 0 : _a.writeText(text).then(() => createSnackbar({ text: formatMessage(paragraph_messages_default2.copied) })).catch(noop4);
|
|
18784
19040
|
};
|
|
18785
|
-
const
|
|
19041
|
+
const classNames17 = `${getTextAlignmentAndMargin2({
|
|
18786
19042
|
align: component.align,
|
|
18787
19043
|
margin: "sm"
|
|
18788
19044
|
})} form-control`;
|
|
18789
|
-
return /* @__PURE__ */ (0,
|
|
18790
|
-
/* @__PURE__ */ (0,
|
|
19045
|
+
return /* @__PURE__ */ (0, import_jsx_runtime112.jsxs)("div", { className: getTextAlignmentAndMargin2(component), children: [
|
|
19046
|
+
/* @__PURE__ */ (0, import_jsx_runtime112.jsx)(
|
|
18791
19047
|
"input",
|
|
18792
19048
|
{
|
|
18793
19049
|
type: "text",
|
|
18794
|
-
className:
|
|
19050
|
+
className: classNames17,
|
|
18795
19051
|
value: text,
|
|
18796
19052
|
readOnly: true,
|
|
18797
19053
|
style: { textOverflow: "ellipsis" }
|
|
18798
19054
|
}
|
|
18799
19055
|
),
|
|
18800
|
-
/* @__PURE__ */ (0,
|
|
19056
|
+
/* @__PURE__ */ (0, import_jsx_runtime112.jsx)(import_components70.Button, { block: true, onClick: copy, children: formatMessage(paragraph_messages_default2.copy) })
|
|
18801
19057
|
] });
|
|
18802
19058
|
}
|
|
18803
19059
|
function noop4() {
|
|
@@ -18805,8 +19061,8 @@ function noop4() {
|
|
|
18805
19061
|
var DynamicParagraph_default = DynamicParagraph;
|
|
18806
19062
|
|
|
18807
19063
|
// src/legacy/layout/review/DynamicReview.tsx
|
|
18808
|
-
var
|
|
18809
|
-
var
|
|
19064
|
+
var import_components71 = require("@transferwise/components");
|
|
19065
|
+
var import_jsx_runtime113 = require("react/jsx-runtime");
|
|
18810
19066
|
var getDefinitions = (orientation, review) => review.fields.map(({ label, value, help }, index) => ({
|
|
18811
19067
|
key: String(index),
|
|
18812
19068
|
title: label,
|
|
@@ -18814,14 +19070,14 @@ var getDefinitions = (orientation, review) => review.fields.map(({ label, value,
|
|
|
18814
19070
|
}));
|
|
18815
19071
|
var getFieldValue2 = (value, help, orientation) => {
|
|
18816
19072
|
if (help) {
|
|
18817
|
-
return orientation === "HORIZONTAL_RIGHT_ALIGNED" ? /* @__PURE__ */ (0,
|
|
18818
|
-
/* @__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 }),
|
|
18819
19075
|
" ",
|
|
18820
19076
|
value
|
|
18821
|
-
] }) : /* @__PURE__ */ (0,
|
|
19077
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime113.jsxs)(import_jsx_runtime113.Fragment, { children: [
|
|
18822
19078
|
value,
|
|
18823
19079
|
" ",
|
|
18824
|
-
/* @__PURE__ */ (0,
|
|
19080
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsx)(Help_default2, { help })
|
|
18825
19081
|
] });
|
|
18826
19082
|
}
|
|
18827
19083
|
return value;
|
|
@@ -18854,7 +19110,7 @@ function DynamicReview({ component: review, onAction }) {
|
|
|
18854
19110
|
const { action: behaviorAction2 } = behavior;
|
|
18855
19111
|
return {
|
|
18856
19112
|
text: title != null ? title : "",
|
|
18857
|
-
onClick: behaviorAction2 ?
|
|
19113
|
+
onClick: behaviorAction2 ? getOnClick2(behaviorAction2) : void 0
|
|
18858
19114
|
};
|
|
18859
19115
|
}
|
|
18860
19116
|
case "link": {
|
|
@@ -18869,7 +19125,7 @@ function DynamicReview({ component: review, onAction }) {
|
|
|
18869
19125
|
if (behaviorAction) {
|
|
18870
19126
|
return {
|
|
18871
19127
|
text: title != null ? title : "",
|
|
18872
|
-
onClick: behaviorAction ?
|
|
19128
|
+
onClick: behaviorAction ? getOnClick2(behaviorAction) : void 0
|
|
18873
19129
|
};
|
|
18874
19130
|
}
|
|
18875
19131
|
if (link) {
|
|
@@ -18881,10 +19137,10 @@ function DynamicReview({ component: review, onAction }) {
|
|
|
18881
19137
|
}
|
|
18882
19138
|
return {
|
|
18883
19139
|
text: title != null ? title : "",
|
|
18884
|
-
onClick: action ?
|
|
19140
|
+
onClick: action ? getOnClick2(action) : void 0
|
|
18885
19141
|
};
|
|
18886
19142
|
};
|
|
18887
|
-
const
|
|
19143
|
+
const getOnClick2 = (action) => {
|
|
18888
19144
|
return (event) => {
|
|
18889
19145
|
event.preventDefault();
|
|
18890
19146
|
if (action) {
|
|
@@ -18894,10 +19150,10 @@ function DynamicReview({ component: review, onAction }) {
|
|
|
18894
19150
|
};
|
|
18895
19151
|
const orientation = getDefinitionListLayout(review);
|
|
18896
19152
|
const callToAction = review.callToAction ? getReviewAction3(review.callToAction) : null;
|
|
18897
|
-
const legacyCallToAction = !callToAction && review.action ? { text: (_a = review.action.title) != null ? _a : "", onClick:
|
|
18898
|
-
return /* @__PURE__ */ (0,
|
|
18899
|
-
review.title && /* @__PURE__ */ (0,
|
|
18900
|
-
/* @__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) }) })
|
|
18901
19157
|
] });
|
|
18902
19158
|
}
|
|
18903
19159
|
var DynamicReview_default = DynamicReview;
|
|
@@ -18907,13 +19163,13 @@ var import_react51 = require("react");
|
|
|
18907
19163
|
var import_icons5 = require("@transferwise/icons");
|
|
18908
19164
|
|
|
18909
19165
|
// src/legacy/layout/search/SearchInput.tsx
|
|
18910
|
-
var
|
|
18911
|
-
var
|
|
19166
|
+
var import_components72 = require("@transferwise/components");
|
|
19167
|
+
var import_jsx_runtime114 = require("react/jsx-runtime");
|
|
18912
19168
|
var SearchInput = ({ title, value, onFocus, onChange }) => {
|
|
18913
|
-
return /* @__PURE__ */ (0,
|
|
19169
|
+
return /* @__PURE__ */ (0, import_jsx_runtime114.jsxs)("label", { className: "control-label d-inline", children: [
|
|
18914
19170
|
title,
|
|
18915
|
-
/* @__PURE__ */ (0,
|
|
18916
|
-
|
|
19171
|
+
/* @__PURE__ */ (0, import_jsx_runtime114.jsx)(
|
|
19172
|
+
import_components72.Input,
|
|
18917
19173
|
{
|
|
18918
19174
|
type: "text",
|
|
18919
19175
|
value,
|
|
@@ -18926,15 +19182,15 @@ var SearchInput = ({ title, value, onFocus, onChange }) => {
|
|
|
18926
19182
|
};
|
|
18927
19183
|
|
|
18928
19184
|
// src/legacy/layout/search/SearchResults.tsx
|
|
18929
|
-
var
|
|
19185
|
+
var import_components73 = require("@transferwise/components");
|
|
18930
19186
|
var import_react_intl41 = require("react-intl");
|
|
18931
|
-
var
|
|
19187
|
+
var import_jsx_runtime115 = require("react/jsx-runtime");
|
|
18932
19188
|
function SearchResults2({ results, emptyMessage, onSelect }) {
|
|
18933
19189
|
if (results.length === 0) {
|
|
18934
|
-
return /* @__PURE__ */ (0,
|
|
19190
|
+
return /* @__PURE__ */ (0, import_jsx_runtime115.jsx)("p", { className: "m-t-2", children: emptyMessage });
|
|
18935
19191
|
}
|
|
18936
|
-
return /* @__PURE__ */ (0,
|
|
18937
|
-
|
|
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,
|
|
18938
19194
|
{
|
|
18939
19195
|
title: result.title,
|
|
18940
19196
|
content: result.description,
|
|
@@ -18948,10 +19204,10 @@ function SearchResults2({ results, emptyMessage, onSelect }) {
|
|
|
18948
19204
|
}
|
|
18949
19205
|
function ErrorResult2({ onRetrySearch }) {
|
|
18950
19206
|
const intl = (0, import_react_intl41.useIntl)();
|
|
18951
|
-
return /* @__PURE__ */ (0,
|
|
19207
|
+
return /* @__PURE__ */ (0, import_jsx_runtime115.jsxs)("p", { className: "m-t-2", children: [
|
|
18952
19208
|
intl.formatMessage(generic_error_messages_default.genericError),
|
|
18953
19209
|
"\xA0",
|
|
18954
|
-
/* @__PURE__ */ (0,
|
|
19210
|
+
/* @__PURE__ */ (0, import_jsx_runtime115.jsx)(
|
|
18955
19211
|
"a",
|
|
18956
19212
|
{
|
|
18957
19213
|
href: "/",
|
|
@@ -19035,8 +19291,8 @@ var addQueryParameter2 = (url, key, value) => {
|
|
|
19035
19291
|
};
|
|
19036
19292
|
|
|
19037
19293
|
// src/legacy/layout/search/DynamicSearch.tsx
|
|
19038
|
-
var
|
|
19039
|
-
var
|
|
19294
|
+
var import_components74 = require("@transferwise/components");
|
|
19295
|
+
var import_classnames15 = __toESM(require_classnames());
|
|
19040
19296
|
var import_react_intl43 = require("react-intl");
|
|
19041
19297
|
|
|
19042
19298
|
// src/common/messages/search.messages.ts
|
|
@@ -19050,7 +19306,7 @@ var search_messages_default2 = (0, import_react_intl42.defineMessages)({
|
|
|
19050
19306
|
});
|
|
19051
19307
|
|
|
19052
19308
|
// src/legacy/layout/search/DynamicSearch.tsx
|
|
19053
|
-
var
|
|
19309
|
+
var import_jsx_runtime116 = require("react/jsx-runtime");
|
|
19054
19310
|
var DEBOUNCE_TIME2 = 400;
|
|
19055
19311
|
function DynamicSearch({ component, onAction }) {
|
|
19056
19312
|
const [query, setQuery] = (0, import_react51.useState)("");
|
|
@@ -19088,17 +19344,17 @@ function DynamicSearch({ component, onAction }) {
|
|
|
19088
19344
|
};
|
|
19089
19345
|
const loadingMessage = intl.formatMessage(search_messages_default2.loading);
|
|
19090
19346
|
if (control === "inline") {
|
|
19091
|
-
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: [
|
|
19092
19348
|
title,
|
|
19093
|
-
/* @__PURE__ */ (0,
|
|
19094
|
-
|
|
19349
|
+
/* @__PURE__ */ (0, import_jsx_runtime116.jsx)("div", { className: "m-t-1", children: /* @__PURE__ */ (0, import_jsx_runtime116.jsx)(
|
|
19350
|
+
import_components74.Typeahead,
|
|
19095
19351
|
{
|
|
19096
19352
|
id: "typeahead-input-id",
|
|
19097
19353
|
intl,
|
|
19098
19354
|
name: "typeahead-input-name",
|
|
19099
19355
|
size: "md",
|
|
19100
19356
|
maxHeight: 100,
|
|
19101
|
-
footer: /* @__PURE__ */ (0,
|
|
19357
|
+
footer: /* @__PURE__ */ (0, import_jsx_runtime116.jsx)(
|
|
19102
19358
|
TypeaheadFooter2,
|
|
19103
19359
|
{
|
|
19104
19360
|
state: status,
|
|
@@ -19110,7 +19366,7 @@ function DynamicSearch({ component, onAction }) {
|
|
|
19110
19366
|
),
|
|
19111
19367
|
multiple: false,
|
|
19112
19368
|
clearable: false,
|
|
19113
|
-
addon: /* @__PURE__ */ (0,
|
|
19369
|
+
addon: /* @__PURE__ */ (0, import_jsx_runtime116.jsx)(import_icons5.Search, { size: 24 }),
|
|
19114
19370
|
options: results.map(mapResultToTypeaheadOption2),
|
|
19115
19371
|
onChange: (values) => {
|
|
19116
19372
|
if (values.length > 0) {
|
|
@@ -19125,11 +19381,11 @@ function DynamicSearch({ component, onAction }) {
|
|
|
19125
19381
|
) })
|
|
19126
19382
|
] }) });
|
|
19127
19383
|
}
|
|
19128
|
-
return /* @__PURE__ */ (0,
|
|
19129
|
-
/* @__PURE__ */ (0,
|
|
19130
|
-
status === "loading" && /* @__PURE__ */ (0,
|
|
19131
|
-
status === "error" && /* @__PURE__ */ (0,
|
|
19132
|
-
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 })
|
|
19133
19389
|
] });
|
|
19134
19390
|
}
|
|
19135
19391
|
function mapResultToTypeaheadOption2(result) {
|
|
@@ -19149,36 +19405,36 @@ function TypeaheadFooter2({
|
|
|
19149
19405
|
onRetrySearch
|
|
19150
19406
|
}) {
|
|
19151
19407
|
if (state === "success" && results.length === 0) {
|
|
19152
|
-
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 });
|
|
19153
19409
|
}
|
|
19154
19410
|
if (state === "error" && results.length === 0) {
|
|
19155
|
-
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 }) });
|
|
19156
19412
|
}
|
|
19157
19413
|
if (state === "loading" || results.length === 0) {
|
|
19158
|
-
return /* @__PURE__ */ (0,
|
|
19414
|
+
return /* @__PURE__ */ (0, import_jsx_runtime116.jsx)("p", { className: "m-t-2 m-x-2", children: loadingMessage });
|
|
19159
19415
|
}
|
|
19160
19416
|
return null;
|
|
19161
19417
|
}
|
|
19162
19418
|
var DynamicSearch_default = DynamicSearch;
|
|
19163
19419
|
|
|
19164
19420
|
// src/legacy/layout/modal/DynamicModal.tsx
|
|
19165
|
-
var
|
|
19421
|
+
var import_components75 = require("@transferwise/components");
|
|
19166
19422
|
var import_react52 = require("react");
|
|
19167
|
-
var
|
|
19423
|
+
var import_jsx_runtime117 = require("react/jsx-runtime");
|
|
19168
19424
|
function DynamicModal(props) {
|
|
19169
19425
|
const [visible, isVisible] = (0, import_react52.useState)(false);
|
|
19170
19426
|
const { component, onAction } = props;
|
|
19171
19427
|
const { margin = "md" } = component;
|
|
19172
|
-
return /* @__PURE__ */ (0,
|
|
19173
|
-
/* @__PURE__ */ (0,
|
|
19174
|
-
/* @__PURE__ */ (0,
|
|
19175
|
-
|
|
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,
|
|
19176
19432
|
{
|
|
19177
19433
|
scroll: "content",
|
|
19178
19434
|
open: visible,
|
|
19179
19435
|
size: "lg",
|
|
19180
19436
|
title: component.content.title,
|
|
19181
|
-
body: /* @__PURE__ */ (0,
|
|
19437
|
+
body: /* @__PURE__ */ (0, import_jsx_runtime117.jsx)(
|
|
19182
19438
|
DynamicLayout_default,
|
|
19183
19439
|
__spreadProps(__spreadValues({}, props), {
|
|
19184
19440
|
components: component.content.components,
|
|
@@ -19196,7 +19452,7 @@ function DynamicModal(props) {
|
|
|
19196
19452
|
var DynamicModal_default = DynamicModal;
|
|
19197
19453
|
|
|
19198
19454
|
// src/legacy/jsonSchemaForm/basicTypeSchema/BasicTypeSchema.tsx
|
|
19199
|
-
var
|
|
19455
|
+
var import_jsx_runtime118 = require("react/jsx-runtime");
|
|
19200
19456
|
var isNullish3 = (value) => isNull3(value) || isUndefined3(value);
|
|
19201
19457
|
var getDefaultValue = (schema) => {
|
|
19202
19458
|
return schema.type === "boolean" && isNullish3(schema.default) ? false : schema.default;
|
|
@@ -19274,15 +19530,15 @@ var BasicTypeSchema = (props) => {
|
|
|
19274
19530
|
const schemaHelp = props.schema.help;
|
|
19275
19531
|
const feedbackId = `${id}-feedback`;
|
|
19276
19532
|
const labelId = `${id}-label`;
|
|
19277
|
-
return !isHidden ? /* @__PURE__ */ (0,
|
|
19278
|
-
props.schema.alert && /* @__PURE__ */ (0,
|
|
19279
|
-
/* @__PURE__ */ (0,
|
|
19280
|
-
showLabel && /* @__PURE__ */ (0,
|
|
19281
|
-
/* @__PURE__ */ (0,
|
|
19282
|
-
!!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 })
|
|
19283
19539
|
] }),
|
|
19284
|
-
!showLabel && !!schemaHelp && /* @__PURE__ */ (0,
|
|
19285
|
-
/* @__PURE__ */ (0,
|
|
19540
|
+
!showLabel && !!schemaHelp && /* @__PURE__ */ (0, import_jsx_runtime118.jsx)(Help_default2, { help: schemaHelp }),
|
|
19541
|
+
/* @__PURE__ */ (0, import_jsx_runtime118.jsx)(
|
|
19286
19542
|
SchemaFormControl_default,
|
|
19287
19543
|
{
|
|
19288
19544
|
id,
|
|
@@ -19296,7 +19552,7 @@ var BasicTypeSchema = (props) => {
|
|
|
19296
19552
|
labelledBy: labelId
|
|
19297
19553
|
}
|
|
19298
19554
|
),
|
|
19299
|
-
/* @__PURE__ */ (0,
|
|
19555
|
+
/* @__PURE__ */ (0, import_jsx_runtime118.jsx)(
|
|
19300
19556
|
ControlFeedback_default,
|
|
19301
19557
|
{
|
|
19302
19558
|
id: feedbackId,
|
|
@@ -19316,7 +19572,7 @@ var BasicTypeSchema = (props) => {
|
|
|
19316
19572
|
var BasicTypeSchema_default = BasicTypeSchema;
|
|
19317
19573
|
|
|
19318
19574
|
// src/legacy/jsonSchemaForm/persistAsyncSchema/persistAsyncBasicSchema/PersistAsyncBasicSchema.tsx
|
|
19319
|
-
var
|
|
19575
|
+
var import_jsx_runtime119 = require("react/jsx-runtime");
|
|
19320
19576
|
var getIdFromResponse = (idProperty, response) => response[idProperty];
|
|
19321
19577
|
var getErrorFromResponse = (errorProperty, response) => {
|
|
19322
19578
|
var _a;
|
|
@@ -19406,7 +19662,7 @@ function PersistAsyncBasicSchema(props) {
|
|
|
19406
19662
|
setPersistAsyncModel(newPersistAsyncModel);
|
|
19407
19663
|
}
|
|
19408
19664
|
};
|
|
19409
|
-
return /* @__PURE__ */ (0,
|
|
19665
|
+
return /* @__PURE__ */ (0, import_jsx_runtime119.jsx)(
|
|
19410
19666
|
BasicTypeSchema_default,
|
|
19411
19667
|
{
|
|
19412
19668
|
required,
|
|
@@ -19620,7 +19876,7 @@ function useStepPolling(polling, onAction) {
|
|
|
19620
19876
|
}
|
|
19621
19877
|
|
|
19622
19878
|
// src/legacy/step/layoutStep/LayoutStep.tsx
|
|
19623
|
-
var
|
|
19879
|
+
var import_jsx_runtime120 = require("react/jsx-runtime");
|
|
19624
19880
|
var getComponents = (step, options) => {
|
|
19625
19881
|
var _a;
|
|
19626
19882
|
if (isEmpty(step)) {
|
|
@@ -19643,7 +19899,7 @@ var LayoutStep = (props) => {
|
|
|
19643
19899
|
onEvent("Dynamic Flow - onAction supressed", { reason: "LayoutStep - loading state" });
|
|
19644
19900
|
};
|
|
19645
19901
|
useStepPolling(stepSpecification.polling, onAction);
|
|
19646
|
-
return /* @__PURE__ */ (0,
|
|
19902
|
+
return /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(
|
|
19647
19903
|
DynamicLayout_default,
|
|
19648
19904
|
{
|
|
19649
19905
|
components,
|
|
@@ -19727,49 +19983,49 @@ var CameraCapture_messages_default = (0, import_react_intl46.defineMessages)({
|
|
|
19727
19983
|
});
|
|
19728
19984
|
|
|
19729
19985
|
// src/common/cameraCapture/components/bottomBar/BottomBar.tsx
|
|
19730
|
-
var
|
|
19986
|
+
var import_components76 = require("@transferwise/components");
|
|
19731
19987
|
var import_react_intl47 = require("react-intl");
|
|
19732
|
-
var
|
|
19733
|
-
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 }) });
|
|
19734
19990
|
var ReviewBottomBar = ({
|
|
19735
19991
|
onSubmit,
|
|
19736
19992
|
onRetry
|
|
19737
19993
|
}) => {
|
|
19738
19994
|
const intl = (0, import_react_intl47.useIntl)();
|
|
19739
|
-
return /* @__PURE__ */ (0,
|
|
19740
|
-
/* @__PURE__ */ (0,
|
|
19741
|
-
|
|
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,
|
|
19742
19998
|
{
|
|
19743
19999
|
className: "m-b-1",
|
|
19744
20000
|
block: true,
|
|
19745
|
-
size:
|
|
19746
|
-
type:
|
|
20001
|
+
size: import_components76.Size.MEDIUM,
|
|
20002
|
+
type: import_components76.ControlType.ACCENT,
|
|
19747
20003
|
onClick: onSubmit,
|
|
19748
20004
|
children: intl.formatMessage(CameraCapture_messages_default.reviewSubmit)
|
|
19749
20005
|
}
|
|
19750
20006
|
),
|
|
19751
|
-
/* @__PURE__ */ (0,
|
|
19752
|
-
|
|
20007
|
+
/* @__PURE__ */ (0, import_jsx_runtime121.jsx)(
|
|
20008
|
+
import_components76.Button,
|
|
19753
20009
|
{
|
|
19754
20010
|
className: "m-b-2",
|
|
19755
20011
|
block: true,
|
|
19756
|
-
size:
|
|
19757
|
-
type:
|
|
19758
|
-
priority:
|
|
20012
|
+
size: import_components76.Size.MEDIUM,
|
|
20013
|
+
type: import_components76.ControlType.ACCENT,
|
|
20014
|
+
priority: import_components76.Priority.SECONDARY,
|
|
19759
20015
|
onClick: onRetry,
|
|
19760
20016
|
children: intl.formatMessage(CameraCapture_messages_default.reviewRetry)
|
|
19761
20017
|
}
|
|
19762
20018
|
)
|
|
19763
20019
|
] }) }) });
|
|
19764
20020
|
};
|
|
19765
|
-
var CaptureButton = ({ onClick }) => /* @__PURE__ */ (0,
|
|
20021
|
+
var CaptureButton = ({ onClick }) => /* @__PURE__ */ (0, import_jsx_runtime121.jsx)(
|
|
19766
20022
|
"button",
|
|
19767
20023
|
{
|
|
19768
20024
|
type: "button",
|
|
19769
20025
|
className: "camera-capture-btn m-b-2",
|
|
19770
20026
|
"data-testid": "camera-capture-button",
|
|
19771
20027
|
onClick,
|
|
19772
|
-
children: /* @__PURE__ */ (0,
|
|
20028
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime121.jsx)("span", { className: "camera-capture-btn-inner" })
|
|
19773
20029
|
}
|
|
19774
20030
|
);
|
|
19775
20031
|
|
|
@@ -19787,11 +20043,11 @@ var OrientationLockOverlay_messages_default = (0, import_react_intl48.defineMess
|
|
|
19787
20043
|
});
|
|
19788
20044
|
|
|
19789
20045
|
// src/common/cameraCapture/components/orientationLockOverlay/OrientationLockOverlay.tsx
|
|
19790
|
-
var
|
|
20046
|
+
var import_jsx_runtime122 = require("react/jsx-runtime");
|
|
19791
20047
|
function OrientationLockOverlay() {
|
|
19792
20048
|
const intl = (0, import_react_intl49.useIntl)();
|
|
19793
|
-
return /* @__PURE__ */ (0,
|
|
19794
|
-
/* @__PURE__ */ (0,
|
|
20049
|
+
return /* @__PURE__ */ (0, import_jsx_runtime122.jsxs)("div", { className: "orientation-lock-overlay", children: [
|
|
20050
|
+
/* @__PURE__ */ (0, import_jsx_runtime122.jsx)(
|
|
19795
20051
|
"img",
|
|
19796
20052
|
{
|
|
19797
20053
|
className: "m-b-3",
|
|
@@ -19801,7 +20057,7 @@ function OrientationLockOverlay() {
|
|
|
19801
20057
|
alt: ""
|
|
19802
20058
|
}
|
|
19803
20059
|
),
|
|
19804
|
-
/* @__PURE__ */ (0,
|
|
20060
|
+
/* @__PURE__ */ (0, import_jsx_runtime122.jsx)("p", { className: "text-center m-b-0", children: intl.formatMessage(OrientationLockOverlay_messages_default.text) })
|
|
19805
20061
|
] });
|
|
19806
20062
|
}
|
|
19807
20063
|
var OrientationLockOverlay_default = OrientationLockOverlay;
|
|
@@ -19976,7 +20232,7 @@ var getVideoConstraints = async (dir) => {
|
|
|
19976
20232
|
|
|
19977
20233
|
// src/common/cameraCapture/overlay/Overlay.tsx
|
|
19978
20234
|
var import_react61 = require("react");
|
|
19979
|
-
var
|
|
20235
|
+
var import_jsx_runtime123 = require("react/jsx-runtime");
|
|
19980
20236
|
var captureButtonHeight = 92;
|
|
19981
20237
|
var reviewButtonsHeight = 120;
|
|
19982
20238
|
var imageHeight = 40;
|
|
@@ -19998,18 +20254,18 @@ function Overlay({ overlay, outline, imageUrl, title, instructions, reviewInstru
|
|
|
19998
20254
|
return () => window.removeEventListener("resize", listener);
|
|
19999
20255
|
});
|
|
20000
20256
|
let helperBoxHeight = (imageUrl ? imageHeight : 0) + (title ? titleHeight : 0) + (instructions ? instructionsHeight : 0);
|
|
20001
|
-
let helperBox = /* @__PURE__ */ (0,
|
|
20002
|
-
imageUrl && /* @__PURE__ */ (0,
|
|
20003
|
-
title && /* @__PURE__ */ (0,
|
|
20004
|
-
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 })
|
|
20005
20261
|
] });
|
|
20006
20262
|
const frameBottomMargin = captureButtonHeight + helperBoxHeight;
|
|
20007
20263
|
if (reviewInstructions) {
|
|
20008
20264
|
helperBoxHeight = frameBottomMargin - reviewButtonsHeight;
|
|
20009
|
-
helperBox = /* @__PURE__ */ (0,
|
|
20265
|
+
helperBox = /* @__PURE__ */ (0, import_jsx_runtime123.jsx)("small", { className: "camera-capture-instructions", children: reviewInstructions });
|
|
20010
20266
|
const frameWithReviewInstructionsMinBottomMargin = reviewButtonsHeight + reviewInstructionsHeight;
|
|
20011
20267
|
if (frameBottomMargin < frameWithReviewInstructionsMinBottomMargin) {
|
|
20012
|
-
helperBox = /* @__PURE__ */ (0,
|
|
20268
|
+
helperBox = /* @__PURE__ */ (0, import_jsx_runtime123.jsx)(import_jsx_runtime123.Fragment, {});
|
|
20013
20269
|
}
|
|
20014
20270
|
}
|
|
20015
20271
|
const framePosition = {
|
|
@@ -20027,32 +20283,32 @@ function Overlay({ overlay, outline, imageUrl, title, instructions, reviewInstru
|
|
|
20027
20283
|
width: "90%"
|
|
20028
20284
|
}
|
|
20029
20285
|
};
|
|
20030
|
-
return /* @__PURE__ */ (0,
|
|
20031
|
-
/* @__PURE__ */ (0,
|
|
20032
|
-
/* @__PURE__ */ (0,
|
|
20033
|
-
/* @__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))
|
|
20034
20290
|
] }) }),
|
|
20035
|
-
overlay && /* @__PURE__ */ (0,
|
|
20036
|
-
outline && /* @__PURE__ */ (0,
|
|
20037
|
-
/* @__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 })) })
|
|
20038
20294
|
] });
|
|
20039
20295
|
}
|
|
20040
20296
|
var Overlay_default = Overlay;
|
|
20041
20297
|
|
|
20042
20298
|
// src/common/cameraCapture/screens/cameraErrorScreen/CameraErrorScreen.tsx
|
|
20043
|
-
var
|
|
20044
|
-
var
|
|
20299
|
+
var import_components77 = require("@transferwise/components");
|
|
20300
|
+
var import_jsx_runtime124 = require("react/jsx-runtime");
|
|
20045
20301
|
function CameraErrorScreen({ title, description, actionButton, onAction }) {
|
|
20046
|
-
return /* @__PURE__ */ (0,
|
|
20047
|
-
/* @__PURE__ */ (0,
|
|
20048
|
-
/* @__PURE__ */ (0,
|
|
20049
|
-
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 })
|
|
20050
20306
|
] }) }) });
|
|
20051
20307
|
}
|
|
20052
20308
|
var CameraErrorScreen_default = CameraErrorScreen;
|
|
20053
20309
|
|
|
20054
20310
|
// src/common/cameraCapture/CameraCapture.tsx
|
|
20055
|
-
var
|
|
20311
|
+
var import_jsx_runtime125 = require("react/jsx-runtime");
|
|
20056
20312
|
function CameraCapture({
|
|
20057
20313
|
direction = "back",
|
|
20058
20314
|
overlay = "",
|
|
@@ -20160,8 +20416,8 @@ function CameraCapture({
|
|
|
20160
20416
|
exitFullScreen();
|
|
20161
20417
|
}
|
|
20162
20418
|
}, [mode, exitFullScreen]);
|
|
20163
|
-
const captureScreen = /* @__PURE__ */ (0,
|
|
20164
|
-
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)(
|
|
20165
20421
|
import_react_webcam.default,
|
|
20166
20422
|
{
|
|
20167
20423
|
ref: webcamReference,
|
|
@@ -20172,7 +20428,7 @@ function CameraCapture({
|
|
|
20172
20428
|
onUserMedia: handleUserMedia
|
|
20173
20429
|
}
|
|
20174
20430
|
),
|
|
20175
|
-
/* @__PURE__ */ (0,
|
|
20431
|
+
/* @__PURE__ */ (0, import_jsx_runtime125.jsx)(
|
|
20176
20432
|
Overlay_default,
|
|
20177
20433
|
{
|
|
20178
20434
|
overlay,
|
|
@@ -20182,8 +20438,8 @@ function CameraCapture({
|
|
|
20182
20438
|
instructions
|
|
20183
20439
|
}
|
|
20184
20440
|
),
|
|
20185
|
-
shouldLockOrientation && /* @__PURE__ */ (0,
|
|
20186
|
-
ready && /* @__PURE__ */ (0,
|
|
20441
|
+
shouldLockOrientation && /* @__PURE__ */ (0, import_jsx_runtime125.jsx)(OrientationLockOverlay_default, {}),
|
|
20442
|
+
ready && /* @__PURE__ */ (0, import_jsx_runtime125.jsx)(
|
|
20187
20443
|
CaptureBottomBar,
|
|
20188
20444
|
{
|
|
20189
20445
|
onCapture: () => {
|
|
@@ -20192,9 +20448,9 @@ function CameraCapture({
|
|
|
20192
20448
|
}
|
|
20193
20449
|
)
|
|
20194
20450
|
] });
|
|
20195
|
-
const reviewScreen = /* @__PURE__ */ (0,
|
|
20196
|
-
/* @__PURE__ */ (0,
|
|
20197
|
-
/* @__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)(
|
|
20198
20454
|
Overlay_default,
|
|
20199
20455
|
{
|
|
20200
20456
|
overlay,
|
|
@@ -20204,18 +20460,18 @@ function CameraCapture({
|
|
|
20204
20460
|
reviewInstructions: intl.formatMessage(CameraCapture_messages_default.reviewInstructions)
|
|
20205
20461
|
}
|
|
20206
20462
|
),
|
|
20207
|
-
/* @__PURE__ */ (0,
|
|
20463
|
+
/* @__PURE__ */ (0, import_jsx_runtime125.jsx)(ReviewBottomBar, { onSubmit: handleReviewSubmit, onRetry: handleReviewRetry })
|
|
20208
20464
|
] });
|
|
20209
|
-
return /* @__PURE__ */ (0,
|
|
20465
|
+
return /* @__PURE__ */ (0, import_jsx_runtime125.jsxs)("section", { children: [
|
|
20210
20466
|
mode === "CAPTURE" /* CAPTURE */ && captureScreen,
|
|
20211
20467
|
mode === "REVIEW" /* REVIEW */ && reviewScreen,
|
|
20212
|
-
mode === "ERROR" /* ERROR */ && cameraError && /* @__PURE__ */ (0,
|
|
20468
|
+
mode === "ERROR" /* ERROR */ && cameraError && /* @__PURE__ */ (0, import_jsx_runtime125.jsx)(CameraErrorScreen_default, __spreadValues({}, cameraError))
|
|
20213
20469
|
] });
|
|
20214
20470
|
}
|
|
20215
20471
|
var CameraCapture_default = CameraCapture;
|
|
20216
20472
|
|
|
20217
20473
|
// src/legacy/step/cameraStep/CameraStep.tsx
|
|
20218
|
-
var
|
|
20474
|
+
var import_jsx_runtime126 = require("react/jsx-runtime");
|
|
20219
20475
|
function blobToBase64(blob) {
|
|
20220
20476
|
return new Promise((resolve, _) => {
|
|
20221
20477
|
const reader = new FileReader();
|
|
@@ -20253,7 +20509,7 @@ function CameraStep(props) {
|
|
|
20253
20509
|
});
|
|
20254
20510
|
}
|
|
20255
20511
|
};
|
|
20256
|
-
return /* @__PURE__ */ (0,
|
|
20512
|
+
return /* @__PURE__ */ (0, import_jsx_runtime126.jsx)(
|
|
20257
20513
|
CameraCapture_default,
|
|
20258
20514
|
{
|
|
20259
20515
|
overlay,
|
|
@@ -20330,12 +20586,12 @@ var external_confirmation_messages_default2 = (0, import_react_intl51.defineMess
|
|
|
20330
20586
|
});
|
|
20331
20587
|
|
|
20332
20588
|
// src/legacy/step/externalConfirmationStep/ExternalConfirmationStep.tsx
|
|
20333
|
-
var
|
|
20589
|
+
var import_jsx_runtime127 = require("react/jsx-runtime");
|
|
20334
20590
|
var noop6 = () => {
|
|
20335
20591
|
};
|
|
20336
20592
|
function ExternalConfirmationStep({ url, onClose }) {
|
|
20337
20593
|
const { formatMessage } = (0, import_react_intl52.useIntl)();
|
|
20338
|
-
return /* @__PURE__ */ (0,
|
|
20594
|
+
return /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(
|
|
20339
20595
|
DynamicLayout_default,
|
|
20340
20596
|
{
|
|
20341
20597
|
components: [
|
|
@@ -20400,11 +20656,11 @@ function getOrigin2(url) {
|
|
|
20400
20656
|
}
|
|
20401
20657
|
|
|
20402
20658
|
// src/legacy/dynamicFlow/BackButton.tsx
|
|
20403
|
-
var
|
|
20659
|
+
var import_components79 = require("@transferwise/components");
|
|
20404
20660
|
var import_icons6 = require("@transferwise/icons");
|
|
20405
|
-
var
|
|
20661
|
+
var import_jsx_runtime128 = require("react/jsx-runtime");
|
|
20406
20662
|
function BackButton2({ title, action, onAction }) {
|
|
20407
|
-
return /* @__PURE__ */ (0,
|
|
20663
|
+
return /* @__PURE__ */ (0, import_jsx_runtime128.jsx)("div", { className: "m-b-2", children: /* @__PURE__ */ (0, import_jsx_runtime128.jsxs)(
|
|
20408
20664
|
"a",
|
|
20409
20665
|
{
|
|
20410
20666
|
href: "/",
|
|
@@ -20415,8 +20671,8 @@ function BackButton2({ title, action, onAction }) {
|
|
|
20415
20671
|
onAction(__spreadProps(__spreadValues({}, action), { skipValidation: true }));
|
|
20416
20672
|
},
|
|
20417
20673
|
children: [
|
|
20418
|
-
/* @__PURE__ */ (0,
|
|
20419
|
-
/* @__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" }) })
|
|
20420
20676
|
]
|
|
20421
20677
|
}
|
|
20422
20678
|
) });
|
|
@@ -20424,7 +20680,7 @@ function BackButton2({ title, action, onAction }) {
|
|
|
20424
20680
|
var BackButton_default2 = BackButton2;
|
|
20425
20681
|
|
|
20426
20682
|
// src/legacy/dynamicFlow/DynamicFlowStep.tsx
|
|
20427
|
-
var
|
|
20683
|
+
var import_jsx_runtime129 = require("react/jsx-runtime");
|
|
20428
20684
|
function DynamicFlowStep(props) {
|
|
20429
20685
|
var _a, _b, _c;
|
|
20430
20686
|
const { step, globalError, onAction } = props;
|
|
@@ -20433,20 +20689,20 @@ function DynamicFlowStep(props) {
|
|
|
20433
20689
|
const { requiresManualTrigger, dismissConfirmation } = useExternal2(externalUrl);
|
|
20434
20690
|
if (step === void 0) {
|
|
20435
20691
|
if (globalError) {
|
|
20436
|
-
return /* @__PURE__ */ (0,
|
|
20692
|
+
return /* @__PURE__ */ (0, import_jsx_runtime129.jsx)(DynamicAlert_default, { component: { context: "negative", markdown: globalError, margin: "lg" } });
|
|
20437
20693
|
}
|
|
20438
20694
|
return null;
|
|
20439
20695
|
}
|
|
20440
20696
|
if (externalUrl && requiresManualTrigger) {
|
|
20441
|
-
return /* @__PURE__ */ (0,
|
|
20697
|
+
return /* @__PURE__ */ (0, import_jsx_runtime129.jsx)(ExternalConfirmationStep_default, { url: externalUrl, onClose: dismissConfirmation });
|
|
20442
20698
|
}
|
|
20443
20699
|
if (isCameraStep(step)) {
|
|
20444
|
-
return /* @__PURE__ */ (0,
|
|
20700
|
+
return /* @__PURE__ */ (0, import_jsx_runtime129.jsx)(CameraStep_default, __spreadProps(__spreadValues({}, props), { step }));
|
|
20445
20701
|
}
|
|
20446
|
-
return /* @__PURE__ */ (0,
|
|
20447
|
-
backButton && /* @__PURE__ */ (0,
|
|
20448
|
-
globalError ? /* @__PURE__ */ (0,
|
|
20449
|
-
/* @__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 }))
|
|
20450
20706
|
] });
|
|
20451
20707
|
}
|
|
20452
20708
|
|
|
@@ -20593,19 +20849,19 @@ var getSchemaReference = (component) => {
|
|
|
20593
20849
|
var isInlineSchema = (schema) => schema !== void 0 && typeof schema === "object" && !Object.hasOwnProperty.call(schema, "$ref");
|
|
20594
20850
|
|
|
20595
20851
|
// src/legacy/dynamicFlow/utils/useLoader.tsx
|
|
20596
|
-
var
|
|
20852
|
+
var import_components80 = require("@transferwise/components");
|
|
20597
20853
|
var import_react66 = require("react");
|
|
20598
|
-
var
|
|
20854
|
+
var import_jsx_runtime130 = require("react/jsx-runtime");
|
|
20599
20855
|
function useLoader(loaderConfig, initialState) {
|
|
20600
20856
|
const config = __spreadValues({
|
|
20601
|
-
size:
|
|
20857
|
+
size: import_components80.Size.EXTRA_LARGE,
|
|
20602
20858
|
initial: true,
|
|
20603
20859
|
submission: false
|
|
20604
20860
|
}, loaderConfig);
|
|
20605
20861
|
const [loadingState, setLoadingState] = (0, import_react66.useState)(initialState);
|
|
20606
20862
|
const shouldDisplayLoader = config.initial && loadingState === "initial" || config.submission && loadingState === "submission";
|
|
20607
|
-
const loader = shouldDisplayLoader ? /* @__PURE__ */ (0,
|
|
20608
|
-
|
|
20863
|
+
const loader = shouldDisplayLoader ? /* @__PURE__ */ (0, import_jsx_runtime130.jsx)(
|
|
20864
|
+
import_components80.Loader,
|
|
20609
20865
|
{
|
|
20610
20866
|
size: config.size,
|
|
20611
20867
|
classNames: { "tw-loader": "tw-loader m-x-auto" },
|
|
@@ -20724,7 +20980,7 @@ var useErrorResponse = () => {
|
|
|
20724
20980
|
};
|
|
20725
20981
|
|
|
20726
20982
|
// src/legacy/dynamicFlow/DynamicFlow.tsx
|
|
20727
|
-
var
|
|
20983
|
+
var import_jsx_runtime131 = require("react/jsx-runtime");
|
|
20728
20984
|
var noop7 = () => {
|
|
20729
20985
|
};
|
|
20730
20986
|
var DynamicFlowComponent = ({
|
|
@@ -20967,7 +21223,7 @@ var DynamicFlowComponent = ({
|
|
|
20967
21223
|
await performAction(action);
|
|
20968
21224
|
}
|
|
20969
21225
|
};
|
|
20970
|
-
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)(
|
|
20971
21227
|
DynamicFlowStep,
|
|
20972
21228
|
{
|
|
20973
21229
|
step,
|
|
@@ -20984,7 +21240,7 @@ var DynamicFlowComponent = ({
|
|
|
20984
21240
|
) }) }) }) }) }) });
|
|
20985
21241
|
};
|
|
20986
21242
|
function DynamicFlow(props) {
|
|
20987
|
-
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)) });
|
|
20988
21244
|
}
|
|
20989
21245
|
var DynamicFlow_default = DynamicFlow;
|
|
20990
21246
|
var combineModels2 = (formModels) => Object.values(formModels).reduce((previous, model) => __spreadValues(__spreadValues({}, previous), model), {});
|
|
@@ -21001,19 +21257,19 @@ var shouldTriggerRefresh = (props) => {
|
|
|
21001
21257
|
};
|
|
21002
21258
|
|
|
21003
21259
|
// src/legacy/jsonSchemaForm/JsonSchemaForm.tsx
|
|
21004
|
-
var
|
|
21260
|
+
var import_jsx_runtime132 = require("react/jsx-runtime");
|
|
21005
21261
|
function JsonSchemaForm(props) {
|
|
21006
21262
|
const schemaProps = __spreadValues({
|
|
21007
21263
|
model: null,
|
|
21008
21264
|
errors: null
|
|
21009
21265
|
}, props);
|
|
21010
21266
|
const { baseUrl = "", onEvent = noop8, onLog = noop8 } = props;
|
|
21011
|
-
return /* @__PURE__ */ (0,
|
|
21267
|
+
return /* @__PURE__ */ (0, import_jsx_runtime132.jsx)(LogProvider, { flowId: "JsonSchemaForm", stepId: "JsonSchemaForm", onLog, children: /* @__PURE__ */ (0, import_jsx_runtime132.jsx)(
|
|
21012
21268
|
EventsContextProvider,
|
|
21013
21269
|
{
|
|
21014
21270
|
metadata: { flowId: "JsonSchemaForm", stepId: "JsonSchemaForm" },
|
|
21015
21271
|
onEvent,
|
|
21016
|
-
children: /* @__PURE__ */ (0,
|
|
21272
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime132.jsx)(HttpClientProviderFromBaseUrl, { baseUrl, children: /* @__PURE__ */ (0, import_jsx_runtime132.jsx)(GenericSchema_default, __spreadValues({}, schemaProps)) })
|
|
21017
21273
|
}
|
|
21018
21274
|
) });
|
|
21019
21275
|
}
|