@wise/dynamic-flow-client 3.32.0 → 3.34.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 +802 -531
- package/build/main.min.js +1 -1
- package/build/main.mjs +734 -463
- 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 +5 -5
package/build/main.mjs
CHANGED
|
@@ -64,7 +64,7 @@ var require_classnames = __commonJS({
|
|
|
64
64
|
(function() {
|
|
65
65
|
"use strict";
|
|
66
66
|
var hasOwn = {}.hasOwnProperty;
|
|
67
|
-
function
|
|
67
|
+
function classNames17() {
|
|
68
68
|
var classes = "";
|
|
69
69
|
for (var i = 0; i < arguments.length; i++) {
|
|
70
70
|
var arg = arguments[i];
|
|
@@ -82,7 +82,7 @@ var require_classnames = __commonJS({
|
|
|
82
82
|
return "";
|
|
83
83
|
}
|
|
84
84
|
if (Array.isArray(arg)) {
|
|
85
|
-
return
|
|
85
|
+
return classNames17.apply(null, arg);
|
|
86
86
|
}
|
|
87
87
|
if (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes("[native code]")) {
|
|
88
88
|
return arg.toString();
|
|
@@ -105,14 +105,14 @@ var require_classnames = __commonJS({
|
|
|
105
105
|
return value + newClass;
|
|
106
106
|
}
|
|
107
107
|
if (typeof module !== "undefined" && module.exports) {
|
|
108
|
-
|
|
109
|
-
module.exports =
|
|
108
|
+
classNames17.default = classNames17;
|
|
109
|
+
module.exports = classNames17;
|
|
110
110
|
} else if (typeof define === "function" && typeof define.amd === "object" && define.amd) {
|
|
111
111
|
define("classnames", [], function() {
|
|
112
|
-
return
|
|
112
|
+
return classNames17;
|
|
113
113
|
});
|
|
114
114
|
} else {
|
|
115
|
-
window.classNames =
|
|
115
|
+
window.classNames = classNames17;
|
|
116
116
|
}
|
|
117
117
|
})();
|
|
118
118
|
}
|
|
@@ -1495,7 +1495,7 @@ var mapErrorsToValidationState = (errors) => {
|
|
|
1495
1495
|
|
|
1496
1496
|
// src/revamp/renderers/mappers/utils/inputComponentToProps.ts
|
|
1497
1497
|
var inputComponentToProps = (component, type) => {
|
|
1498
|
-
var _a;
|
|
1498
|
+
var _a, _b, _c, _d;
|
|
1499
1499
|
const {
|
|
1500
1500
|
autoComplete,
|
|
1501
1501
|
control,
|
|
@@ -1524,7 +1524,11 @@ var inputComponentToProps = (component, type) => {
|
|
|
1524
1524
|
help,
|
|
1525
1525
|
icon,
|
|
1526
1526
|
id,
|
|
1527
|
-
image
|
|
1527
|
+
image: image ? {
|
|
1528
|
+
accessibilityDescription: (_b = image.accessibilityDescription) != null ? _b : image.text,
|
|
1529
|
+
uri: image.uri,
|
|
1530
|
+
url: (_d = (_c = image.uri) != null ? _c : image.url) != null ? _d : ""
|
|
1531
|
+
} : void 0,
|
|
1528
1532
|
label: title,
|
|
1529
1533
|
placeholder,
|
|
1530
1534
|
required,
|
|
@@ -1594,7 +1598,19 @@ var dateInputComponentToProps = (component) => __spreadProps(__spreadValues({},
|
|
|
1594
1598
|
});
|
|
1595
1599
|
|
|
1596
1600
|
// src/revamp/renderers/mappers/decisionComponentToProps.ts
|
|
1597
|
-
var decisionComponentToProps = (component) => pick(component, "type", "control", "
|
|
1601
|
+
var decisionComponentToProps = (component) => __spreadProps(__spreadValues({}, pick(component, "type", "control", "margin", "title")), {
|
|
1602
|
+
options: component.options.map((_a) => {
|
|
1603
|
+
var _b = _a, { image } = _b, rest = __objRest(_b, ["image"]);
|
|
1604
|
+
var _a2, _b2, _c;
|
|
1605
|
+
return __spreadProps(__spreadValues({}, rest), {
|
|
1606
|
+
image: image ? {
|
|
1607
|
+
accessibilityDescription: (_a2 = image.accessibilityDescription) != null ? _a2 : image.text,
|
|
1608
|
+
uri: image.uri,
|
|
1609
|
+
url: (_c = (_b2 = image.uri) != null ? _b2 : image.url) != null ? _c : ""
|
|
1610
|
+
} : image
|
|
1611
|
+
});
|
|
1612
|
+
})
|
|
1613
|
+
});
|
|
1598
1614
|
|
|
1599
1615
|
// src/revamp/renderers/mappers/dividerComponentToProps.ts
|
|
1600
1616
|
var dividerComponentToProps = (component) => pick(component, "type", "control", "margin");
|
|
@@ -1675,17 +1691,25 @@ var numberInputComponentToProps = (component) => __spreadProps(__spreadValues({}
|
|
|
1675
1691
|
});
|
|
1676
1692
|
|
|
1677
1693
|
// src/revamp/renderers/mappers/objectComponentToProps.ts
|
|
1678
|
-
var objectComponentToProps = (component, children) =>
|
|
1679
|
-
|
|
1680
|
-
|
|
1681
|
-
|
|
1682
|
-
})
|
|
1694
|
+
var objectComponentToProps = (component, children) => {
|
|
1695
|
+
var _a, _b;
|
|
1696
|
+
return __spreadProps(__spreadValues({
|
|
1697
|
+
type: "form-section"
|
|
1698
|
+
}, pick(component, "control", "description", "help", "icon", "title")), {
|
|
1699
|
+
// TODO: Remove when viewbindings are updated
|
|
1700
|
+
image: component.image ? __spreadProps(__spreadValues({}, component.image), {
|
|
1701
|
+
url: (_b = (_a = component.image) == null ? void 0 : _a.url) != null ? _b : ""
|
|
1702
|
+
}) : void 0,
|
|
1703
|
+
children
|
|
1704
|
+
});
|
|
1705
|
+
};
|
|
1683
1706
|
|
|
1684
1707
|
// src/revamp/renderers/mappers/paragraphComponentToProps.ts
|
|
1685
1708
|
var paragraphComponentToProps = (component) => pick(component, "type", "align", "control", "margin", "text");
|
|
1686
1709
|
|
|
1687
1710
|
// src/revamp/renderers/mappers/repeatableComponentToProps.ts
|
|
1688
1711
|
var repeatableComponentToProps = (component, children, editableItemChildren) => {
|
|
1712
|
+
var _a, _b;
|
|
1689
1713
|
const {
|
|
1690
1714
|
addItemTitle,
|
|
1691
1715
|
control,
|
|
@@ -1704,13 +1728,26 @@ var repeatableComponentToProps = (component, children, editableItemChildren) =>
|
|
|
1704
1728
|
onSave,
|
|
1705
1729
|
onRemove
|
|
1706
1730
|
} = component;
|
|
1731
|
+
const getSummaryImage = (componentSummary) => {
|
|
1732
|
+
var _a2, _b2;
|
|
1733
|
+
if (componentSummary.image) {
|
|
1734
|
+
return __spreadProps(__spreadValues({}, componentSummary.image), {
|
|
1735
|
+
url: (_a2 = componentSummary.image.url) != null ? _a2 : ""
|
|
1736
|
+
});
|
|
1737
|
+
}
|
|
1738
|
+
if (summaryDefaults.image) {
|
|
1739
|
+
return __spreadProps(__spreadValues({}, summaryDefaults.image), {
|
|
1740
|
+
url: (_b2 = summaryDefaults.image.url) != null ? _b2 : ""
|
|
1741
|
+
});
|
|
1742
|
+
}
|
|
1743
|
+
};
|
|
1707
1744
|
const getSummary = (componentSummary) => {
|
|
1708
|
-
var
|
|
1745
|
+
var _a2, _b2, _c;
|
|
1709
1746
|
return {
|
|
1710
|
-
title: (
|
|
1711
|
-
description: (
|
|
1747
|
+
title: (_a2 = componentSummary.title) != null ? _a2 : summaryDefaults.title,
|
|
1748
|
+
description: (_b2 = componentSummary.description) != null ? _b2 : summaryDefaults.description,
|
|
1712
1749
|
icon: (_c = componentSummary.icon) != null ? _c : summaryDefaults.icon,
|
|
1713
|
-
image: (
|
|
1750
|
+
image: getSummaryImage(componentSummary)
|
|
1714
1751
|
};
|
|
1715
1752
|
};
|
|
1716
1753
|
const itemProps = components.map((childComponent) => __spreadProps(__spreadValues({}, getSummary(childComponent.getSummary())), {
|
|
@@ -1726,7 +1763,11 @@ var repeatableComponentToProps = (component, children, editableItemChildren) =>
|
|
|
1726
1763
|
editItemTitle,
|
|
1727
1764
|
error: errors == null ? void 0 : errors[0],
|
|
1728
1765
|
icon,
|
|
1729
|
-
image
|
|
1766
|
+
image: image ? {
|
|
1767
|
+
accessibilityDescription: (_a = image.accessibilityDescription) != null ? _a : image.text,
|
|
1768
|
+
uri: image.uri,
|
|
1769
|
+
url: (_b = image.url) != null ? _b : ""
|
|
1770
|
+
} : void 0,
|
|
1730
1771
|
items: itemProps,
|
|
1731
1772
|
maxItems,
|
|
1732
1773
|
minItems,
|
|
@@ -1844,10 +1885,32 @@ var uploadInputComponentToProps = (component) => {
|
|
|
1844
1885
|
};
|
|
1845
1886
|
|
|
1846
1887
|
// src/revamp/renderers/mappers/tupleComponentToProps.ts
|
|
1847
|
-
var tupleComponentToProps = (component, children) =>
|
|
1848
|
-
|
|
1849
|
-
|
|
1850
|
-
|
|
1888
|
+
var tupleComponentToProps = (component, children) => {
|
|
1889
|
+
var _a, _b;
|
|
1890
|
+
return __spreadProps(__spreadValues({
|
|
1891
|
+
type: "form-section"
|
|
1892
|
+
}, pick(component, "control", "description", "help", "icon", "title")), {
|
|
1893
|
+
// TODO Remove URL default after next types update (add back to `pick`)
|
|
1894
|
+
image: component.image ? __spreadProps(__spreadValues({}, component.image), {
|
|
1895
|
+
url: (_b = (_a = component.image) == null ? void 0 : _a.url) != null ? _b : ""
|
|
1896
|
+
}) : void 0,
|
|
1897
|
+
children
|
|
1898
|
+
});
|
|
1899
|
+
};
|
|
1900
|
+
|
|
1901
|
+
// src/revamp/renderers/mappers/listComponentToProps.ts
|
|
1902
|
+
var listComponentToProps = (component) => __spreadProps(__spreadValues({}, pick(component, "type", "callToAction", "control", "margin", "title")), {
|
|
1903
|
+
items: component.items.map((_a) => {
|
|
1904
|
+
var _b = _a, { image } = _b, rest = __objRest(_b, ["image"]);
|
|
1905
|
+
var _a2, _b2, _c;
|
|
1906
|
+
return __spreadProps(__spreadValues({}, rest), {
|
|
1907
|
+
image: image ? {
|
|
1908
|
+
accessibilityDescription: (_a2 = image == null ? void 0 : image.accessibilityDescription) != null ? _a2 : image == null ? void 0 : image.text,
|
|
1909
|
+
uri: image == null ? void 0 : image.uri,
|
|
1910
|
+
url: (_c = (_b2 = image == null ? void 0 : image.url) != null ? _b2 : image == null ? void 0 : image.url) != null ? _c : ""
|
|
1911
|
+
} : void 0
|
|
1912
|
+
});
|
|
1913
|
+
})
|
|
1851
1914
|
});
|
|
1852
1915
|
|
|
1853
1916
|
// src/revamp/renderers/mappers/componentToRendererProps.ts
|
|
@@ -1891,6 +1954,8 @@ var componentToRendererProps = (component, nestedContent) => {
|
|
|
1891
1954
|
return instructionsComponentToProps(component);
|
|
1892
1955
|
case "integer":
|
|
1893
1956
|
return integerInputComponentToProps(component);
|
|
1957
|
+
case "list":
|
|
1958
|
+
return listComponentToProps(component);
|
|
1894
1959
|
case "loading-indicator":
|
|
1895
1960
|
return loadingIndicatorComponentToProps(component);
|
|
1896
1961
|
case "markdown":
|
|
@@ -6213,10 +6278,14 @@ var actionSchema = z.object({
|
|
|
6213
6278
|
skipValidation: z.boolean().optional()
|
|
6214
6279
|
});
|
|
6215
6280
|
var listLayoutItemSchema = z.object({
|
|
6216
|
-
title: z.string(),
|
|
6217
6281
|
description: z.string().optional(),
|
|
6218
|
-
|
|
6219
|
-
|
|
6282
|
+
status: listLayoutStatusSchema.optional(),
|
|
6283
|
+
icon: iconSchema.optional(),
|
|
6284
|
+
image: imageSchema.optional(),
|
|
6285
|
+
title: z.string(),
|
|
6286
|
+
subtitle: z.string().optional(),
|
|
6287
|
+
value: z.string().optional(),
|
|
6288
|
+
subvalue: z.string().optional()
|
|
6220
6289
|
});
|
|
6221
6290
|
var decisionLayoutOptionSchema = z.object({
|
|
6222
6291
|
action: actionSchema,
|
|
@@ -6237,6 +6306,11 @@ var behaviorSchema = z.object({
|
|
|
6237
6306
|
action: actionSchema.optional(),
|
|
6238
6307
|
link: linkSchema.optional()
|
|
6239
6308
|
});
|
|
6309
|
+
var itemCallToActionSchema = z.object({
|
|
6310
|
+
title: z.string(),
|
|
6311
|
+
accessibilityDescription: z.string().optional(),
|
|
6312
|
+
behavior: behaviorSchema
|
|
6313
|
+
});
|
|
6240
6314
|
var buttonLayoutSchema = z.object({
|
|
6241
6315
|
type: z.literal("button"),
|
|
6242
6316
|
size: sizeSchema.optional(),
|
|
@@ -6300,12 +6374,10 @@ var alertLayoutCallToActionSchema = z.object({
|
|
|
6300
6374
|
accessibilityDescription: z.string().optional(),
|
|
6301
6375
|
behavior: behaviorSchema
|
|
6302
6376
|
});
|
|
6303
|
-
var
|
|
6304
|
-
|
|
6305
|
-
|
|
6306
|
-
|
|
6307
|
-
control: z.string().optional(),
|
|
6308
|
-
margin: sizeSchema.optional()
|
|
6377
|
+
var listLayoutCallToActionSchema = z.object({
|
|
6378
|
+
title: z.string(),
|
|
6379
|
+
accessibilityDescription: z.string().optional(),
|
|
6380
|
+
behavior: behaviorSchema
|
|
6309
6381
|
});
|
|
6310
6382
|
var decisionLayoutSchema = z.object({
|
|
6311
6383
|
type: z.literal("decision"),
|
|
@@ -6314,10 +6386,12 @@ var decisionLayoutSchema = z.object({
|
|
|
6314
6386
|
control: z.string().optional(),
|
|
6315
6387
|
margin: sizeSchema.optional()
|
|
6316
6388
|
});
|
|
6317
|
-
var
|
|
6389
|
+
var statusListLayoutItemSchema = z.object({
|
|
6318
6390
|
title: z.string(),
|
|
6319
|
-
|
|
6320
|
-
|
|
6391
|
+
description: z.string().optional(),
|
|
6392
|
+
icon: iconSchema,
|
|
6393
|
+
status: statusListLayoutStatusSchema.optional(),
|
|
6394
|
+
callToAction: itemCallToActionSchema.optional()
|
|
6321
6395
|
});
|
|
6322
6396
|
var reviewLayoutSchema = z.object({
|
|
6323
6397
|
type: z.literal("review"),
|
|
@@ -6351,12 +6425,20 @@ var alertLayoutSchema = z.object({
|
|
|
6351
6425
|
margin: sizeSchema.optional(),
|
|
6352
6426
|
callToAction: alertLayoutCallToActionSchema.optional()
|
|
6353
6427
|
});
|
|
6354
|
-
var
|
|
6355
|
-
|
|
6356
|
-
|
|
6357
|
-
|
|
6358
|
-
|
|
6359
|
-
|
|
6428
|
+
var listLayoutSchema = z.object({
|
|
6429
|
+
type: z.literal("list"),
|
|
6430
|
+
title: z.string().optional(),
|
|
6431
|
+
callToAction: listLayoutCallToActionSchema.optional(),
|
|
6432
|
+
items: z.array(listLayoutItemSchema),
|
|
6433
|
+
control: z.string().optional(),
|
|
6434
|
+
margin: sizeSchema.optional()
|
|
6435
|
+
});
|
|
6436
|
+
var statusListLayoutSchema = z.object({
|
|
6437
|
+
type: z.literal("status-list"),
|
|
6438
|
+
items: z.array(statusListLayoutItemSchema),
|
|
6439
|
+
title: z.string().optional(),
|
|
6440
|
+
control: z.string().optional(),
|
|
6441
|
+
margin: sizeSchema.optional()
|
|
6360
6442
|
});
|
|
6361
6443
|
var searchResponseBodySchema = z.object({
|
|
6362
6444
|
results: z.array(searchResultSchema)
|
|
@@ -6399,13 +6481,6 @@ var constSchemaSchema = z.object({
|
|
|
6399
6481
|
analyticsId: z.string().optional(),
|
|
6400
6482
|
disabled: z.boolean().optional()
|
|
6401
6483
|
});
|
|
6402
|
-
var statusListLayoutSchema = z.object({
|
|
6403
|
-
type: z.literal("status-list"),
|
|
6404
|
-
items: z.array(statusListLayoutItemSchema),
|
|
6405
|
-
title: z.string().optional(),
|
|
6406
|
-
control: z.string().optional(),
|
|
6407
|
-
margin: sizeSchema.optional()
|
|
6408
|
-
});
|
|
6409
6484
|
var layoutSchema = z.lazy(
|
|
6410
6485
|
() => z.union([
|
|
6411
6486
|
alertLayoutSchema,
|
|
@@ -6920,19 +6995,20 @@ var getStepPolling = ({
|
|
|
6920
6995
|
if (delay == null) {
|
|
6921
6996
|
throw new Error("Polling configuration must include delay or interval");
|
|
6922
6997
|
}
|
|
6998
|
+
const onErrorAction = getOnErrorAction(onError);
|
|
6923
6999
|
let attempts = 0;
|
|
6924
7000
|
const poll = () => {
|
|
6925
7001
|
attempts += 1;
|
|
6926
7002
|
abortController.abort();
|
|
6927
7003
|
abortController = new AbortController();
|
|
6928
7004
|
const { signal } = abortController;
|
|
6929
|
-
onPoll(url,
|
|
7005
|
+
onPoll(url, onErrorAction, signal).then((result) => {
|
|
6930
7006
|
if (result) {
|
|
6931
7007
|
stop();
|
|
6932
7008
|
return;
|
|
6933
7009
|
}
|
|
6934
7010
|
if (attempts >= maxAttempts && !signal.aborted) {
|
|
6935
|
-
void onAction(
|
|
7011
|
+
void onAction(onErrorAction);
|
|
6936
7012
|
stop();
|
|
6937
7013
|
}
|
|
6938
7014
|
}).catch(() => {
|
|
@@ -6946,6 +7022,20 @@ var getStepPolling = ({
|
|
|
6946
7022
|
poll();
|
|
6947
7023
|
return { stop };
|
|
6948
7024
|
};
|
|
7025
|
+
var getOnErrorAction = (onError) => {
|
|
7026
|
+
if ("behavior" in onError) {
|
|
7027
|
+
if (onError.behavior && "type" in onError.behavior && onError.behavior.type === "action") {
|
|
7028
|
+
return onError.behavior.action;
|
|
7029
|
+
}
|
|
7030
|
+
if (onError.behavior && "action" in onError.behavior && onError.behavior.action) {
|
|
7031
|
+
return onError.behavior.action;
|
|
7032
|
+
}
|
|
7033
|
+
}
|
|
7034
|
+
if ("action" in onError) {
|
|
7035
|
+
return onError.action;
|
|
7036
|
+
}
|
|
7037
|
+
return {};
|
|
7038
|
+
};
|
|
6949
7039
|
|
|
6950
7040
|
// src/revamp/domain/components/AlertComponent.ts
|
|
6951
7041
|
var createAlertComponent = (alertProps) => __spreadProps(__spreadValues({
|
|
@@ -7151,7 +7241,7 @@ var buttonLayoutToComponent = (uid, button, mapperProps) => {
|
|
|
7151
7241
|
var buttonLayoutToComponentWithBehavior = (uid, button, mapperProps) => {
|
|
7152
7242
|
const { onAction, onLink, step } = mapperProps;
|
|
7153
7243
|
const { context, control, disabled, margin = "md", pinOrder, size: size2, title, behavior } = button;
|
|
7154
|
-
const
|
|
7244
|
+
const getOnClick2 = () => {
|
|
7155
7245
|
if ("type" in behavior) {
|
|
7156
7246
|
switch (behavior.type) {
|
|
7157
7247
|
case "action": {
|
|
@@ -7195,7 +7285,7 @@ var buttonLayoutToComponentWithBehavior = (uid, button, mapperProps) => {
|
|
|
7195
7285
|
pinOrder,
|
|
7196
7286
|
size: size2,
|
|
7197
7287
|
title: title != null ? title : "",
|
|
7198
|
-
onClick:
|
|
7288
|
+
onClick: getOnClick2()
|
|
7199
7289
|
});
|
|
7200
7290
|
};
|
|
7201
7291
|
var buttonLayoutToComponentWithAction = (uid, button, mapperProps) => {
|
|
@@ -7307,21 +7397,51 @@ var createDecisionComponent = (decisionProps) => __spreadProps(__spreadValues({
|
|
|
7307
7397
|
});
|
|
7308
7398
|
|
|
7309
7399
|
// src/revamp/domain/mappers/layout/decisionLayoutToComponent.ts
|
|
7310
|
-
var decisionLayoutToComponent = (uid, { control, margin = "md", options, title },
|
|
7400
|
+
var decisionLayoutToComponent = (uid, { control, margin = "md", options, title }, mapperProps) => createDecisionComponent({
|
|
7311
7401
|
uid,
|
|
7312
7402
|
control,
|
|
7313
7403
|
margin,
|
|
7314
|
-
options: options.map((
|
|
7315
|
-
|
|
7316
|
-
|
|
7317
|
-
|
|
7318
|
-
onClick: () => {
|
|
7319
|
-
void onAction(action);
|
|
7320
|
-
}
|
|
7404
|
+
options: options.map((option) => {
|
|
7405
|
+
return __spreadProps(__spreadValues({}, option), {
|
|
7406
|
+
href: getHref(option),
|
|
7407
|
+
onClick: getOnClick(option, mapperProps)
|
|
7321
7408
|
});
|
|
7322
7409
|
}),
|
|
7323
7410
|
title
|
|
7324
7411
|
});
|
|
7412
|
+
var getHref = (option) => {
|
|
7413
|
+
const { behavior } = option;
|
|
7414
|
+
if (behavior && "type" in behavior && behavior.type === "link") {
|
|
7415
|
+
return behavior.url;
|
|
7416
|
+
}
|
|
7417
|
+
return void 0;
|
|
7418
|
+
};
|
|
7419
|
+
var getOnClick = (option, { step, onAction, onLink }) => {
|
|
7420
|
+
const { behavior } = option;
|
|
7421
|
+
if (!behavior) {
|
|
7422
|
+
const action = inlineAction(option.action, step == null ? void 0 : step.actions);
|
|
7423
|
+
return () => {
|
|
7424
|
+
void onAction(action);
|
|
7425
|
+
};
|
|
7426
|
+
}
|
|
7427
|
+
if ("type" in behavior) {
|
|
7428
|
+
switch (behavior.type) {
|
|
7429
|
+
case "action": {
|
|
7430
|
+
const action = inlineAction(behavior.action, step == null ? void 0 : step.actions);
|
|
7431
|
+
return () => {
|
|
7432
|
+
void onAction(action);
|
|
7433
|
+
};
|
|
7434
|
+
}
|
|
7435
|
+
case "link": {
|
|
7436
|
+
return () => {
|
|
7437
|
+
void onLink(behavior.url);
|
|
7438
|
+
};
|
|
7439
|
+
}
|
|
7440
|
+
}
|
|
7441
|
+
}
|
|
7442
|
+
return () => {
|
|
7443
|
+
};
|
|
7444
|
+
};
|
|
7325
7445
|
|
|
7326
7446
|
// src/revamp/domain/components/DividerComponent.ts
|
|
7327
7447
|
var createDividerComponent = (props) => __spreadProps(__spreadValues({
|
|
@@ -10599,14 +10719,14 @@ var getItemCallToAction = (callToAction, onAction, onLink) => {
|
|
|
10599
10719
|
};
|
|
10600
10720
|
};
|
|
10601
10721
|
|
|
10602
|
-
// src/revamp/domain/mappers/layout/
|
|
10603
|
-
var
|
|
10722
|
+
// src/revamp/domain/mappers/layout/deprecatedListLayoutToComponent.ts
|
|
10723
|
+
var deprecatedListLayoutToComponent = (uid, { control, items, margin = "md", title }) => createStatusListComponent({
|
|
10604
10724
|
uid,
|
|
10605
10725
|
control,
|
|
10606
10726
|
items: items.map(({ description, icon, status, title: itemTitle }) => ({
|
|
10607
10727
|
description,
|
|
10608
|
-
icon,
|
|
10609
|
-
title: itemTitle,
|
|
10728
|
+
icon: icon != null ? icon : { text: "" },
|
|
10729
|
+
title: itemTitle != null ? itemTitle : "",
|
|
10610
10730
|
status: status ? mapLegacyStatus(status) : void 0
|
|
10611
10731
|
})),
|
|
10612
10732
|
margin,
|
|
@@ -10624,6 +10744,68 @@ var mapLegacyStatus = (status) => {
|
|
|
10624
10744
|
}
|
|
10625
10745
|
};
|
|
10626
10746
|
|
|
10747
|
+
// src/revamp/domain/components/ListComponent.ts
|
|
10748
|
+
var createListComponent = (listProps) => __spreadProps(__spreadValues({
|
|
10749
|
+
type: "list"
|
|
10750
|
+
}, listProps), {
|
|
10751
|
+
getLocalValue: () => null,
|
|
10752
|
+
getSubmittableValue: async () => null,
|
|
10753
|
+
getSubmittableValueSync: () => null,
|
|
10754
|
+
getSummary: () => ({}),
|
|
10755
|
+
// noop
|
|
10756
|
+
validate: () => true
|
|
10757
|
+
});
|
|
10758
|
+
|
|
10759
|
+
// src/revamp/domain/mappers/layout/listLayoutToComponent.ts
|
|
10760
|
+
var listLayoutToComponent = (uid, { callToAction, control, items, margin = "md", title }, mapperProps) => createListComponent({
|
|
10761
|
+
uid,
|
|
10762
|
+
control,
|
|
10763
|
+
items: items.map(({ value, subvalue, title: itemTitle, subtitle, icon, image }) => ({
|
|
10764
|
+
title: itemTitle,
|
|
10765
|
+
subtitle,
|
|
10766
|
+
value,
|
|
10767
|
+
subvalue,
|
|
10768
|
+
icon,
|
|
10769
|
+
image
|
|
10770
|
+
})),
|
|
10771
|
+
callToAction: getListCallToAction(callToAction, mapperProps),
|
|
10772
|
+
margin,
|
|
10773
|
+
title
|
|
10774
|
+
});
|
|
10775
|
+
var getListCallToAction = (callToAction, { onAction, onLink }) => {
|
|
10776
|
+
if (!callToAction) {
|
|
10777
|
+
return void 0;
|
|
10778
|
+
}
|
|
10779
|
+
const { accessibilityDescription, behavior, title } = callToAction;
|
|
10780
|
+
if ("type" in behavior) {
|
|
10781
|
+
switch (behavior.type) {
|
|
10782
|
+
case "action": {
|
|
10783
|
+
const { action } = behavior;
|
|
10784
|
+
return {
|
|
10785
|
+
type: "action",
|
|
10786
|
+
accessibilityDescription,
|
|
10787
|
+
title,
|
|
10788
|
+
onClick: () => {
|
|
10789
|
+
void onAction(action);
|
|
10790
|
+
}
|
|
10791
|
+
};
|
|
10792
|
+
}
|
|
10793
|
+
case "link": {
|
|
10794
|
+
return {
|
|
10795
|
+
type: "link",
|
|
10796
|
+
accessibilityDescription,
|
|
10797
|
+
href: behavior.url,
|
|
10798
|
+
title,
|
|
10799
|
+
onClick: () => {
|
|
10800
|
+
void onLink(behavior.url);
|
|
10801
|
+
}
|
|
10802
|
+
};
|
|
10803
|
+
}
|
|
10804
|
+
}
|
|
10805
|
+
}
|
|
10806
|
+
return void 0;
|
|
10807
|
+
};
|
|
10808
|
+
|
|
10627
10809
|
// src/revamp/domain/mappers/mapLayoutToComponent.ts
|
|
10628
10810
|
var mapLayoutToComponent = (uid, layout, mapperProps) => {
|
|
10629
10811
|
switch (layout.type) {
|
|
@@ -10650,7 +10832,10 @@ var mapLayoutToComponent = (uid, layout, mapperProps) => {
|
|
|
10650
10832
|
case "instructions":
|
|
10651
10833
|
return instructionsLayoutToComponent(uid, layout);
|
|
10652
10834
|
case "list":
|
|
10653
|
-
|
|
10835
|
+
if (layout.items.some((item) => item.status || item.description)) {
|
|
10836
|
+
return deprecatedListLayoutToComponent(uid, layout);
|
|
10837
|
+
}
|
|
10838
|
+
return listLayoutToComponent(uid, layout, mapperProps);
|
|
10654
10839
|
case "loading-indicator":
|
|
10655
10840
|
return loadingIndicatorLayoutToComponent(uid, layout);
|
|
10656
10841
|
case "markdown":
|
|
@@ -11983,9 +12168,14 @@ function NavigationOptionMedia({ icon, image }) {
|
|
|
11983
12168
|
return /* @__PURE__ */ jsx21(Avatar, { type: AvatarType.INITIALS, children: icon.text });
|
|
11984
12169
|
}
|
|
11985
12170
|
}
|
|
11986
|
-
if (image
|
|
11987
|
-
const {
|
|
11988
|
-
|
|
12171
|
+
if (image) {
|
|
12172
|
+
const { accessibilityDescription, uri, url } = image;
|
|
12173
|
+
if (uri && !uri.startsWith("urn:")) {
|
|
12174
|
+
return /* @__PURE__ */ jsx21("img", { src: uri, alt: accessibilityDescription });
|
|
12175
|
+
}
|
|
12176
|
+
if (url) {
|
|
12177
|
+
return /* @__PURE__ */ jsx21("img", { src: url, alt: accessibilityDescription });
|
|
12178
|
+
}
|
|
11989
12179
|
}
|
|
11990
12180
|
return null;
|
|
11991
12181
|
}
|
|
@@ -12001,10 +12191,10 @@ function DecisionRendererComponent({ margin, options, title }) {
|
|
|
12001
12191
|
const { isLoading } = useLoadingContext();
|
|
12002
12192
|
return /* @__PURE__ */ jsxs5("div", { className: getMargin(margin), children: [
|
|
12003
12193
|
title && /* @__PURE__ */ jsx22(Header, { as: "h2", title }),
|
|
12004
|
-
/* @__PURE__ */ jsx22(NavigationOptionsList, { children: options.map(({ description, disabled, icon, image, title:
|
|
12194
|
+
/* @__PURE__ */ jsx22(NavigationOptionsList, { children: options.map(({ description, disabled, icon, image, title: itemTitle, onClick }) => /* @__PURE__ */ jsx22(
|
|
12005
12195
|
NavigationOption,
|
|
12006
12196
|
{
|
|
12007
|
-
title:
|
|
12197
|
+
title: itemTitle,
|
|
12008
12198
|
content: description,
|
|
12009
12199
|
disabled: isLoading || disabled,
|
|
12010
12200
|
media: /* @__PURE__ */ jsx22(NavigationOptionMedia, { icon, image }),
|
|
@@ -12012,7 +12202,7 @@ function DecisionRendererComponent({ margin, options, title }) {
|
|
|
12012
12202
|
showMediaAtAllSizes: true,
|
|
12013
12203
|
onClick
|
|
12014
12204
|
},
|
|
12015
|
-
JSON.stringify(
|
|
12205
|
+
JSON.stringify(itemTitle)
|
|
12016
12206
|
)) })
|
|
12017
12207
|
] });
|
|
12018
12208
|
}
|
|
@@ -12120,8 +12310,8 @@ function ImageRendererComponent({
|
|
|
12120
12310
|
accessibilityDescription,
|
|
12121
12311
|
margin,
|
|
12122
12312
|
size: size2,
|
|
12123
|
-
|
|
12124
|
-
|
|
12313
|
+
uri,
|
|
12314
|
+
url
|
|
12125
12315
|
}) {
|
|
12126
12316
|
const [imageSource, setImageSource] = useState3("");
|
|
12127
12317
|
const httpClient = useRendererHttpClient();
|
|
@@ -12134,7 +12324,7 @@ function ImageRendererComponent({
|
|
|
12134
12324
|
void getImageSource(httpClient, uri).then(setImageSource);
|
|
12135
12325
|
return;
|
|
12136
12326
|
}
|
|
12137
|
-
}, [url, httpClient]);
|
|
12327
|
+
}, [uri, url, httpClient]);
|
|
12138
12328
|
return /* @__PURE__ */ jsx27("div", { className: `df-image ${size2 || "md"}`, children: /* @__PURE__ */ jsx27(
|
|
12139
12329
|
Image,
|
|
12140
12330
|
{
|
|
@@ -13837,6 +14027,72 @@ function StepRendererComponent(props) {
|
|
|
13837
14027
|
] });
|
|
13838
14028
|
}
|
|
13839
14029
|
|
|
14030
|
+
// ../renderers/src/ListRenderer.tsx
|
|
14031
|
+
var import_classnames6 = __toESM(require_classnames());
|
|
14032
|
+
import { Body, Header as Header7 } from "@transferwise/components";
|
|
14033
|
+
import { jsx as jsx58, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
14034
|
+
var ListRenderer = {
|
|
14035
|
+
canRenderType: "list",
|
|
14036
|
+
render: ({ callToAction, margin, items, title }) => /* @__PURE__ */ jsxs23("div", { className: getMargin(margin), children: [
|
|
14037
|
+
title && /* @__PURE__ */ jsx58(Header7, { as: "h2", title, action: getListAction(callToAction) }),
|
|
14038
|
+
items.map((props) => /* @__PURE__ */ jsx58(DesignSystemListItem, __spreadValues({}, props), props.title))
|
|
14039
|
+
] })
|
|
14040
|
+
};
|
|
14041
|
+
var DesignSystemListItem = ({ title, subtitle, value, subvalue, icon, image }) => /* @__PURE__ */ jsx58(
|
|
14042
|
+
"label",
|
|
14043
|
+
{
|
|
14044
|
+
className: (0, import_classnames6.default)("np-option p-a-2", {
|
|
14045
|
+
"np-option__sm-media": true,
|
|
14046
|
+
"np-option__container-aligned": true
|
|
14047
|
+
}),
|
|
14048
|
+
children: /* @__PURE__ */ jsxs23("div", { className: "media", children: [
|
|
14049
|
+
icon || image ? /* @__PURE__ */ jsx58("div", { className: "media-left", children: /* @__PURE__ */ jsx58(ListItemMedia, { image, icon }) }) : null,
|
|
14050
|
+
/* @__PURE__ */ jsxs23("div", { className: "media-body", children: [
|
|
14051
|
+
/* @__PURE__ */ jsxs23("div", { className: "d-flex justify-content-between", children: [
|
|
14052
|
+
/* @__PURE__ */ jsx58("h4", { className: "np-text-body-large-bold text-primary np-option__title", children: title }),
|
|
14053
|
+
/* @__PURE__ */ jsx58("h4", { className: "np-text-body-large-bold text-primary np-option__title", children: value })
|
|
14054
|
+
] }),
|
|
14055
|
+
/* @__PURE__ */ jsxs23("div", { className: "d-flex justify-content-between", children: [
|
|
14056
|
+
/* @__PURE__ */ jsx58(Body, { className: "d-block np-option__body", children: subtitle }),
|
|
14057
|
+
/* @__PURE__ */ jsx58(Body, { className: "d-block np-option__body", children: subvalue })
|
|
14058
|
+
] })
|
|
14059
|
+
] })
|
|
14060
|
+
] })
|
|
14061
|
+
},
|
|
14062
|
+
title
|
|
14063
|
+
);
|
|
14064
|
+
var ListItemMedia = ({ icon, image }) => {
|
|
14065
|
+
if (icon) {
|
|
14066
|
+
return /* @__PURE__ */ jsx58("div", { className: "circle circle-sm text-primary", children: /* @__PURE__ */ jsx58(NavigationOptionMedia, { icon, image }) });
|
|
14067
|
+
}
|
|
14068
|
+
if (image) {
|
|
14069
|
+
return /* @__PURE__ */ jsx58("div", { className: "np-option__no-media-circle", children: /* @__PURE__ */ jsx58(NavigationOptionMedia, { icon, image }) });
|
|
14070
|
+
}
|
|
14071
|
+
};
|
|
14072
|
+
var getListAction = (callToAction) => {
|
|
14073
|
+
if (!callToAction) {
|
|
14074
|
+
return void 0;
|
|
14075
|
+
}
|
|
14076
|
+
const { accessibilityDescription, title, onClick } = callToAction;
|
|
14077
|
+
if (callToAction.type === "action") {
|
|
14078
|
+
return {
|
|
14079
|
+
"aria-label": accessibilityDescription,
|
|
14080
|
+
text: title,
|
|
14081
|
+
onClick: (event) => {
|
|
14082
|
+
event.preventDefault();
|
|
14083
|
+
onClick();
|
|
14084
|
+
}
|
|
14085
|
+
};
|
|
14086
|
+
}
|
|
14087
|
+
return {
|
|
14088
|
+
"aria-label": accessibilityDescription,
|
|
14089
|
+
href: callToAction.href,
|
|
14090
|
+
target: "_blank",
|
|
14091
|
+
text: title
|
|
14092
|
+
};
|
|
14093
|
+
};
|
|
14094
|
+
var ListRenderer_default = ListRenderer;
|
|
14095
|
+
|
|
13840
14096
|
// ../renderers/src/getWiseRenderers.ts
|
|
13841
14097
|
var getWiseRenderers = () => [
|
|
13842
14098
|
AlertRenderer_default,
|
|
@@ -13854,6 +14110,7 @@ var getWiseRenderers = () => [
|
|
|
13854
14110
|
InstructionsRenderer_default,
|
|
13855
14111
|
IntegerInputRenderer_default,
|
|
13856
14112
|
LargeUploadRenderer,
|
|
14113
|
+
ListRenderer_default,
|
|
13857
14114
|
LoadingIndicatorRenderer_default,
|
|
13858
14115
|
MarkdownRenderer_default,
|
|
13859
14116
|
ModalRenderer_default,
|
|
@@ -13883,12 +14140,12 @@ var openLinkInNewTab = (url) => {
|
|
|
13883
14140
|
};
|
|
13884
14141
|
|
|
13885
14142
|
// src/revamp/DynamicFlowWise.tsx
|
|
13886
|
-
import { jsx as
|
|
14143
|
+
import { jsx as jsx59 } from "react/jsx-runtime";
|
|
13887
14144
|
var wiseRenderers = getWiseRenderers();
|
|
13888
14145
|
function DynamicFlowWise(props) {
|
|
13889
14146
|
const { httpClient, renderers, onLink = openLinkInNewTab } = props;
|
|
13890
14147
|
const mergedRenderers = useMemo4(() => [...renderers != null ? renderers : [], ...wiseRenderers], [renderers]);
|
|
13891
|
-
return /* @__PURE__ */
|
|
14148
|
+
return /* @__PURE__ */ jsx59(RendererHttpClientProvider, { httpClient, children: /* @__PURE__ */ jsx59(DynamicFlowCore, __spreadProps(__spreadValues({}, props), { renderers: mergedRenderers, onLink })) });
|
|
13892
14149
|
}
|
|
13893
14150
|
var DynamicFlowWise_default = DynamicFlowWise;
|
|
13894
14151
|
|
|
@@ -13897,14 +14154,14 @@ import { forwardRef as forwardRef2, useImperativeHandle, useMemo as useMemo6 } f
|
|
|
13897
14154
|
|
|
13898
14155
|
// src/common/httpClientContext/HttpClientContext.tsx
|
|
13899
14156
|
import { createContext as createContext3, useContext as useContext4, useMemo as useMemo5 } from "react";
|
|
13900
|
-
import { jsx as
|
|
14157
|
+
import { jsx as jsx60 } from "react/jsx-runtime";
|
|
13901
14158
|
var HttpClientContext2 = createContext3(void 0);
|
|
13902
14159
|
function HttpClientProvider({ httpClient, children }) {
|
|
13903
|
-
return /* @__PURE__ */
|
|
14160
|
+
return /* @__PURE__ */ jsx60(HttpClientContext2.Provider, { value: httpClient, children });
|
|
13904
14161
|
}
|
|
13905
14162
|
function HttpClientProviderFromBaseUrl({ baseUrl, children }) {
|
|
13906
14163
|
const httpClient = useMemo5(() => makeHttpClient(baseUrl), [baseUrl]);
|
|
13907
|
-
return /* @__PURE__ */
|
|
14164
|
+
return /* @__PURE__ */ jsx60(HttpClientContext2.Provider, { value: httpClient, children });
|
|
13908
14165
|
}
|
|
13909
14166
|
var useHttpClient = () => {
|
|
13910
14167
|
const contextFetch = useContext4(HttpClientContext2);
|
|
@@ -13916,7 +14173,7 @@ var useHasHttpClientProvider = () => {
|
|
|
13916
14173
|
};
|
|
13917
14174
|
|
|
13918
14175
|
// src/revamp/DynamicFragmentWise.tsx
|
|
13919
|
-
import { jsx as
|
|
14176
|
+
import { jsx as jsx61 } from "react/jsx-runtime";
|
|
13920
14177
|
var wiseRenderers2 = getWiseRenderers();
|
|
13921
14178
|
var DynamicFragmentWise = forwardRef2(function DynamicFragmentWise2(props, ref) {
|
|
13922
14179
|
const {
|
|
@@ -13949,14 +14206,14 @@ var DynamicFragmentWise = forwardRef2(function DynamicFragmentWise2(props, ref)
|
|
|
13949
14206
|
() => getRenderFunction([CoreContainerRenderer, ...mergedRenderers, StepRenderer]),
|
|
13950
14207
|
[mergedRenderers]
|
|
13951
14208
|
);
|
|
13952
|
-
return /* @__PURE__ */
|
|
14209
|
+
return /* @__PURE__ */ jsx61(
|
|
13953
14210
|
ErrorBoundary_default,
|
|
13954
14211
|
{
|
|
13955
14212
|
onError: (error) => {
|
|
13956
14213
|
onEvent == null ? void 0 : onEvent("Dynamic Flow - Failed");
|
|
13957
14214
|
onError(error);
|
|
13958
14215
|
},
|
|
13959
|
-
children: /* @__PURE__ */
|
|
14216
|
+
children: /* @__PURE__ */ jsx61(HttpClientProvider, { httpClient, children: stepComponentRef.current ? render(stepComponentRef.current) : null })
|
|
13960
14217
|
}
|
|
13961
14218
|
);
|
|
13962
14219
|
});
|
|
@@ -13964,7 +14221,7 @@ var DynamicFragmentWise_default = DynamicFragmentWise;
|
|
|
13964
14221
|
|
|
13965
14222
|
// src/revamp/DynamicFragmentCore.tsx
|
|
13966
14223
|
import { forwardRef as forwardRef3, useImperativeHandle as useImperativeHandle2, useMemo as useMemo7 } from "react";
|
|
13967
|
-
import { jsx as
|
|
14224
|
+
import { jsx as jsx62 } from "react/jsx-runtime";
|
|
13968
14225
|
var DynamicFragmentCore = forwardRef3(function DynamicFragmentCore2(props, ref) {
|
|
13969
14226
|
const { onCompletion = () => {
|
|
13970
14227
|
}, onEvent, onError, onLink = openLinkInNewTab, renderers } = props;
|
|
@@ -13988,7 +14245,7 @@ var DynamicFragmentCore = forwardRef3(function DynamicFragmentCore2(props, ref)
|
|
|
13988
14245
|
() => getRenderFunction([CoreContainerRenderer, ...renderers]),
|
|
13989
14246
|
[renderers]
|
|
13990
14247
|
);
|
|
13991
|
-
return /* @__PURE__ */
|
|
14248
|
+
return /* @__PURE__ */ jsx62(
|
|
13992
14249
|
ErrorBoundary_default,
|
|
13993
14250
|
{
|
|
13994
14251
|
onError: (error) => {
|
|
@@ -14329,7 +14586,7 @@ var noop2 = () => {
|
|
|
14329
14586
|
};
|
|
14330
14587
|
|
|
14331
14588
|
// src/legacy/common/contexts/dynamicFlowContexts/DynamicFlowContexts.tsx
|
|
14332
|
-
import { jsx as
|
|
14589
|
+
import { jsx as jsx63 } from "react/jsx-runtime";
|
|
14333
14590
|
var defaultContextValue = {
|
|
14334
14591
|
loading: false,
|
|
14335
14592
|
registerPersistAsyncPromise: (promise) => {
|
|
@@ -14344,7 +14601,7 @@ var DynamicFlowProvider = ({ loading, children }) => {
|
|
|
14344
14601
|
registerPersistAsyncPromise: addPendingPromise
|
|
14345
14602
|
};
|
|
14346
14603
|
}, [loading, pendingPromises, addPendingPromise]);
|
|
14347
|
-
return /* @__PURE__ */
|
|
14604
|
+
return /* @__PURE__ */ jsx63(DFContext.Provider, { value: providerValue, children });
|
|
14348
14605
|
};
|
|
14349
14606
|
var useDynamicFlow = () => {
|
|
14350
14607
|
const context = useContext5(DFContext);
|
|
@@ -14353,7 +14610,7 @@ var useDynamicFlow = () => {
|
|
|
14353
14610
|
|
|
14354
14611
|
// src/legacy/common/contexts/eventsContext/EventsContext.tsx
|
|
14355
14612
|
import { createContext as createContext5, useContext as useContext6, useMemo as useMemo9 } from "react";
|
|
14356
|
-
import { jsx as
|
|
14613
|
+
import { jsx as jsx64 } from "react/jsx-runtime";
|
|
14357
14614
|
var EventsContext = createContext5({
|
|
14358
14615
|
triggerEvent: () => {
|
|
14359
14616
|
}
|
|
@@ -14363,7 +14620,7 @@ function EventsContextProvider({ metadata, children, onEvent }) {
|
|
|
14363
14620
|
() => ({ triggerEvent: getEventDispatcher(onEvent, metadata) }),
|
|
14364
14621
|
[onEvent, metadata]
|
|
14365
14622
|
);
|
|
14366
|
-
return /* @__PURE__ */
|
|
14623
|
+
return /* @__PURE__ */ jsx64(EventsContext.Provider, { value, children });
|
|
14367
14624
|
}
|
|
14368
14625
|
function useEventDispatcher() {
|
|
14369
14626
|
const { triggerEvent } = useContext6(EventsContext);
|
|
@@ -14378,7 +14635,7 @@ var getEventDispatcher = (onEvent, metadata) => (eventName, properties = {}) =>
|
|
|
14378
14635
|
|
|
14379
14636
|
// src/legacy/common/contexts/logContext/LogContext.tsx
|
|
14380
14637
|
import { createContext as createContext6, useContext as useContext7, useMemo as useMemo10 } from "react";
|
|
14381
|
-
import { jsx as
|
|
14638
|
+
import { jsx as jsx65 } from "react/jsx-runtime";
|
|
14382
14639
|
var getLogger = (level, onLog, flowId = "UNKNOWN-FLOW-ID", stepId = "UNKNOWN-FLOW-ID") => (title, description, extra) => {
|
|
14383
14640
|
try {
|
|
14384
14641
|
onLog(level, `Dynamic Flow ${level} - ${title} - ${description}`, __spreadValues({
|
|
@@ -14400,7 +14657,7 @@ function LogProvider({ flowId, stepId, children, onLog }) {
|
|
|
14400
14657
|
}),
|
|
14401
14658
|
[onLog, flowId, stepId]
|
|
14402
14659
|
);
|
|
14403
|
-
return /* @__PURE__ */
|
|
14660
|
+
return /* @__PURE__ */ jsx65(LogContext.Provider, { value, children });
|
|
14404
14661
|
}
|
|
14405
14662
|
var useLogger = () => {
|
|
14406
14663
|
const logging = useContext7(LogContext);
|
|
@@ -14414,10 +14671,10 @@ var useLogger = () => {
|
|
|
14414
14671
|
|
|
14415
14672
|
// src/legacy/common/contexts/featureContext/FeatureContext.tsx
|
|
14416
14673
|
import { createContext as createContext7, useContext as useContext8 } from "react";
|
|
14417
|
-
import { jsx as
|
|
14674
|
+
import { jsx as jsx66 } from "react/jsx-runtime";
|
|
14418
14675
|
var FeatureContext = createContext7([]);
|
|
14419
14676
|
function FeatureContextProvider({ features, children }) {
|
|
14420
|
-
return /* @__PURE__ */
|
|
14677
|
+
return /* @__PURE__ */ jsx66(FeatureContext.Provider, { value: features, children });
|
|
14421
14678
|
}
|
|
14422
14679
|
|
|
14423
14680
|
// src/common/cameraCapture/utils/mobile-utils.ts
|
|
@@ -15276,7 +15533,7 @@ var Size = {
|
|
|
15276
15533
|
};
|
|
15277
15534
|
|
|
15278
15535
|
// src/legacy/jsonSchemaForm/basicTypeSchema/BasicTypeSchema.tsx
|
|
15279
|
-
var
|
|
15536
|
+
var import_classnames16 = __toESM(require_classnames());
|
|
15280
15537
|
import { useEffect as useEffect17, useMemo as useMemo19, useState as useState26 } from "react";
|
|
15281
15538
|
|
|
15282
15539
|
// src/legacy/layout/alert/DynamicAlert.tsx
|
|
@@ -15286,19 +15543,19 @@ import { Alert as Alert4 } from "@transferwise/components";
|
|
|
15286
15543
|
import { Avatar as Avatar5, AvatarType as AvatarType4 } from "@transferwise/components";
|
|
15287
15544
|
|
|
15288
15545
|
// src/legacy/layout/icon/FlagIcon.tsx
|
|
15289
|
-
import { jsx as
|
|
15546
|
+
import { jsx as jsx67 } from "react/jsx-runtime";
|
|
15290
15547
|
var isFlagIcon3 = (name) => name.startsWith("flag-");
|
|
15291
15548
|
function FlagIcon2({ name }) {
|
|
15292
15549
|
if (!isFlagIcon3(name)) {
|
|
15293
15550
|
return null;
|
|
15294
15551
|
}
|
|
15295
15552
|
const code = name.substring(5);
|
|
15296
|
-
return /* @__PURE__ */
|
|
15553
|
+
return /* @__PURE__ */ jsx67(Flag, { intrinsicSize: 24, code });
|
|
15297
15554
|
}
|
|
15298
15555
|
|
|
15299
15556
|
// src/legacy/layout/icon/NamedIcon.tsx
|
|
15300
15557
|
import * as icons2 from "@transferwise/icons";
|
|
15301
|
-
import { jsx as
|
|
15558
|
+
import { jsx as jsx68 } from "react/jsx-runtime";
|
|
15302
15559
|
var isNamedIcon3 = (name) => {
|
|
15303
15560
|
const iconName = toCapitalisedCamelCase2(name);
|
|
15304
15561
|
return Object.keys(icons2).includes(iconName);
|
|
@@ -15309,19 +15566,19 @@ function NamedIcon2({ name }) {
|
|
|
15309
15566
|
}
|
|
15310
15567
|
const iconName = toCapitalisedCamelCase2(name);
|
|
15311
15568
|
const Icon = icons2[iconName];
|
|
15312
|
-
return /* @__PURE__ */
|
|
15569
|
+
return /* @__PURE__ */ jsx68(Icon, { size: 24 });
|
|
15313
15570
|
}
|
|
15314
15571
|
var toCapitalisedCamelCase2 = (value) => value.split("-").map(capitaliseFirstChar2).join("");
|
|
15315
15572
|
var capitaliseFirstChar2 = (value) => `${value[0].toUpperCase()}${value.slice(1)}`;
|
|
15316
15573
|
|
|
15317
15574
|
// src/legacy/layout/icon/DynamicIcon.tsx
|
|
15318
|
-
import { jsx as
|
|
15575
|
+
import { jsx as jsx69 } from "react/jsx-runtime";
|
|
15319
15576
|
function DynamicIcon2({ type }) {
|
|
15320
15577
|
if (isFlagIcon3(type)) {
|
|
15321
|
-
return /* @__PURE__ */
|
|
15578
|
+
return /* @__PURE__ */ jsx69(FlagIcon2, { name: type });
|
|
15322
15579
|
}
|
|
15323
15580
|
if (isNamedIcon3(type)) {
|
|
15324
|
-
return /* @__PURE__ */
|
|
15581
|
+
return /* @__PURE__ */ jsx69(NamedIcon2, { name: type });
|
|
15325
15582
|
}
|
|
15326
15583
|
return null;
|
|
15327
15584
|
}
|
|
@@ -15331,17 +15588,17 @@ function isValidIconName(name) {
|
|
|
15331
15588
|
var DynamicIcon_default2 = DynamicIcon2;
|
|
15332
15589
|
|
|
15333
15590
|
// src/legacy/layout/utils/getNavigationOptionMedia.tsx
|
|
15334
|
-
import { jsx as
|
|
15591
|
+
import { jsx as jsx70 } from "react/jsx-runtime";
|
|
15335
15592
|
var getNavigationOptionMedia = ({ icon, image }) => {
|
|
15336
15593
|
if (icon == null ? void 0 : icon.name) {
|
|
15337
|
-
return /* @__PURE__ */
|
|
15594
|
+
return /* @__PURE__ */ jsx70(Avatar5, { type: AvatarType4.ICON, children: /* @__PURE__ */ jsx70(DynamicIcon_default2, { type: icon.name }) });
|
|
15338
15595
|
}
|
|
15339
15596
|
if (icon == null ? void 0 : icon.text) {
|
|
15340
|
-
return /* @__PURE__ */
|
|
15597
|
+
return /* @__PURE__ */ jsx70(Avatar5, { type: AvatarType4.INITIALS, children: icon.text });
|
|
15341
15598
|
}
|
|
15342
15599
|
if (image == null ? void 0 : image.url) {
|
|
15343
15600
|
const { url, text } = image;
|
|
15344
|
-
return /* @__PURE__ */
|
|
15601
|
+
return /* @__PURE__ */ jsx70("img", { src: url, alt: text });
|
|
15345
15602
|
}
|
|
15346
15603
|
return null;
|
|
15347
15604
|
};
|
|
@@ -15377,10 +15634,10 @@ var getTextAlignment2 = (align) => {
|
|
|
15377
15634
|
var getTextAlignmentAndMargin2 = (component) => `${getTextAlignment2(component.align)} ${getMargin2(component.margin)}`;
|
|
15378
15635
|
|
|
15379
15636
|
// src/legacy/layout/alert/DynamicAlert.tsx
|
|
15380
|
-
import { jsx as
|
|
15637
|
+
import { jsx as jsx71 } from "react/jsx-runtime";
|
|
15381
15638
|
var DynamicAlert = ({ component: alert, onAction }) => {
|
|
15382
15639
|
const { context, markdown, margin } = alert;
|
|
15383
|
-
return /* @__PURE__ */
|
|
15640
|
+
return /* @__PURE__ */ jsx71(
|
|
15384
15641
|
Alert4,
|
|
15385
15642
|
{
|
|
15386
15643
|
type: mapContextToAlertType(legacy_mapContext(context)),
|
|
@@ -15464,12 +15721,12 @@ var mapContextToAlertType = (context) => {
|
|
|
15464
15721
|
var DynamicAlert_default = DynamicAlert;
|
|
15465
15722
|
|
|
15466
15723
|
// src/legacy/layout/box/DynamicBox.tsx
|
|
15467
|
-
import { jsx as
|
|
15724
|
+
import { jsx as jsx72 } from "react/jsx-runtime";
|
|
15468
15725
|
var DynamicBox = (props) => {
|
|
15469
15726
|
const box = props.component;
|
|
15470
15727
|
const margin = getMargin2(box.margin || box.border ? "lg" : "xs");
|
|
15471
15728
|
if (!box.width || box.width === "xl") {
|
|
15472
|
-
return /* @__PURE__ */
|
|
15729
|
+
return /* @__PURE__ */ jsx72("div", { className: margin + getBorderClass(box.border), children: /* @__PURE__ */ jsx72(
|
|
15473
15730
|
DynamicLayout_default,
|
|
15474
15731
|
{
|
|
15475
15732
|
components: box.components,
|
|
@@ -15482,7 +15739,7 @@ var DynamicBox = (props) => {
|
|
|
15482
15739
|
}
|
|
15483
15740
|
) });
|
|
15484
15741
|
}
|
|
15485
|
-
return /* @__PURE__ */
|
|
15742
|
+
return /* @__PURE__ */ jsx72("div", { className: "row", children: /* @__PURE__ */ jsx72("div", { className: margin + getBoxWidthClasses(box), children: /* @__PURE__ */ jsx72("div", { className: getBorderClass(box.border), children: /* @__PURE__ */ jsx72(
|
|
15486
15743
|
DynamicLayout_default,
|
|
15487
15744
|
{
|
|
15488
15745
|
components: box.components,
|
|
@@ -15568,9 +15825,9 @@ var getButtonSize = (size2) => {
|
|
|
15568
15825
|
};
|
|
15569
15826
|
|
|
15570
15827
|
// src/legacy/layout/button/DynamicButton.tsx
|
|
15571
|
-
import { jsx as
|
|
15828
|
+
import { jsx as jsx73 } from "react/jsx-runtime";
|
|
15572
15829
|
function DynamicButton(props) {
|
|
15573
|
-
return props.component.behavior ? /* @__PURE__ */
|
|
15830
|
+
return props.component.behavior ? /* @__PURE__ */ jsx73(DynamicButtonWithBehavior, __spreadValues({}, props)) : /* @__PURE__ */ jsx73(DynamicButtonWithoutBehavior, __spreadValues({}, props));
|
|
15574
15831
|
}
|
|
15575
15832
|
function DynamicButtonWithoutBehavior(props) {
|
|
15576
15833
|
var _a, _b;
|
|
@@ -15587,7 +15844,7 @@ function DynamicButtonWithoutBehavior(props) {
|
|
|
15587
15844
|
onAction(componentAction);
|
|
15588
15845
|
}
|
|
15589
15846
|
};
|
|
15590
|
-
return /* @__PURE__ */
|
|
15847
|
+
return /* @__PURE__ */ jsx73(
|
|
15591
15848
|
Button7,
|
|
15592
15849
|
{
|
|
15593
15850
|
size: getButtonSize(component.size),
|
|
@@ -15639,7 +15896,7 @@ function DynamicButtonWithBehavior(props) {
|
|
|
15639
15896
|
}
|
|
15640
15897
|
}
|
|
15641
15898
|
};
|
|
15642
|
-
return /* @__PURE__ */
|
|
15899
|
+
return /* @__PURE__ */ jsx73(
|
|
15643
15900
|
Button7,
|
|
15644
15901
|
{
|
|
15645
15902
|
size: getButtonSize(component.size),
|
|
@@ -15656,12 +15913,12 @@ function DynamicButtonWithBehavior(props) {
|
|
|
15656
15913
|
var DynamicButton_default = DynamicButton;
|
|
15657
15914
|
|
|
15658
15915
|
// src/legacy/layout/columns/DynamicColumns.tsx
|
|
15659
|
-
import { jsx as
|
|
15916
|
+
import { jsx as jsx74, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
15660
15917
|
var DynamicColumns = (props) => {
|
|
15661
15918
|
const columns = props.component;
|
|
15662
15919
|
const { leftWidth, rightWidth } = getWidth(columns.bias);
|
|
15663
|
-
return /* @__PURE__ */
|
|
15664
|
-
/* @__PURE__ */
|
|
15920
|
+
return /* @__PURE__ */ jsxs24("div", { className: `${getMargin2(columns.margin || "xs")} row`, children: [
|
|
15921
|
+
/* @__PURE__ */ jsx74("div", { className: `${leftWidth} m-b-0`, children: /* @__PURE__ */ jsx74(
|
|
15665
15922
|
DynamicLayout_default,
|
|
15666
15923
|
{
|
|
15667
15924
|
components: columns.left,
|
|
@@ -15673,7 +15930,7 @@ var DynamicColumns = (props) => {
|
|
|
15673
15930
|
onPersistAsync: props.onPersistAsync
|
|
15674
15931
|
}
|
|
15675
15932
|
) }),
|
|
15676
|
-
/* @__PURE__ */
|
|
15933
|
+
/* @__PURE__ */ jsx74("div", { className: `${rightWidth} m-b-0`, children: /* @__PURE__ */ jsx74(
|
|
15677
15934
|
DynamicLayout_default,
|
|
15678
15935
|
{
|
|
15679
15936
|
components: columns.right,
|
|
@@ -15708,14 +15965,14 @@ var getWidth = (bias) => {
|
|
|
15708
15965
|
var DynamicColumns_default = DynamicColumns;
|
|
15709
15966
|
|
|
15710
15967
|
// src/legacy/layout/decision/DynamicDecision.tsx
|
|
15711
|
-
import { Header as
|
|
15712
|
-
import { jsx as
|
|
15968
|
+
import { Header as Header8, NavigationOption as NavigationOption4, NavigationOptionsList as NavigationOptionsList3 } from "@transferwise/components";
|
|
15969
|
+
import { jsx as jsx75, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
15713
15970
|
function DynamicDecision({ component, onAction }) {
|
|
15714
15971
|
const { loading } = useDynamicFlow();
|
|
15715
15972
|
const { margin, options, title } = component;
|
|
15716
|
-
return /* @__PURE__ */
|
|
15717
|
-
title && /* @__PURE__ */
|
|
15718
|
-
/* @__PURE__ */
|
|
15973
|
+
return /* @__PURE__ */ jsxs25("div", { className: getMargin2(margin), children: [
|
|
15974
|
+
title && /* @__PURE__ */ jsx75(Header8, { as: "h2", title }),
|
|
15975
|
+
/* @__PURE__ */ jsx75(NavigationOptionsList3, { children: options.map((option) => /* @__PURE__ */ jsx75(
|
|
15719
15976
|
NavigationOption4,
|
|
15720
15977
|
{
|
|
15721
15978
|
title: option.title,
|
|
@@ -15733,11 +15990,11 @@ function DynamicDecision({ component, onAction }) {
|
|
|
15733
15990
|
var DynamicDecision_default = DynamicDecision;
|
|
15734
15991
|
|
|
15735
15992
|
// src/legacy/layout/divider/DynamicDivider.tsx
|
|
15736
|
-
import { jsx as
|
|
15993
|
+
import { jsx as jsx76 } from "react/jsx-runtime";
|
|
15737
15994
|
var DynamicDivider = ({ component }) => {
|
|
15738
15995
|
const margin = getMargin2(component.margin);
|
|
15739
15996
|
const className = `m-t-0 ${margin}`;
|
|
15740
|
-
return /* @__PURE__ */
|
|
15997
|
+
return /* @__PURE__ */ jsx76("hr", { className });
|
|
15741
15998
|
};
|
|
15742
15999
|
var DynamicDivider_default = DynamicDivider;
|
|
15743
16000
|
|
|
@@ -15757,7 +16014,7 @@ var DynamicExternal_messages_default = defineMessages13({
|
|
|
15757
16014
|
});
|
|
15758
16015
|
|
|
15759
16016
|
// src/legacy/layout/external/DynamicExternal.tsx
|
|
15760
|
-
import { Fragment as Fragment11, jsx as
|
|
16017
|
+
import { Fragment as Fragment11, jsx as jsx77, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
15761
16018
|
var DynamicExternal = ({ component, onAction }) => {
|
|
15762
16019
|
const { requestUrl, responseHandlers, polling, retryTitle } = component;
|
|
15763
16020
|
const intl = useIntl11();
|
|
@@ -15774,10 +16031,10 @@ var DynamicExternal = ({ component, onAction }) => {
|
|
|
15774
16031
|
}) : void 0;
|
|
15775
16032
|
}, [polling, responseHandlers]);
|
|
15776
16033
|
useExternalStepPolling(pollingConfiguration, onAction);
|
|
15777
|
-
return /* @__PURE__ */
|
|
15778
|
-
/* @__PURE__ */
|
|
15779
|
-
/* @__PURE__ */
|
|
15780
|
-
/* @__PURE__ */
|
|
16034
|
+
return /* @__PURE__ */ jsxs26(Fragment11, { children: [
|
|
16035
|
+
/* @__PURE__ */ jsx77(Loader2, { size: Size2.LARGE, classNames: { "tw-loader": "tw-loader m-x-auto" } }),
|
|
16036
|
+
/* @__PURE__ */ jsx77("br", {}),
|
|
16037
|
+
/* @__PURE__ */ jsx77(Button8, { priority: "tertiary", block: true, onClick: openExternalUrl, children: retryTitle || intl.formatMessage(DynamicExternal_messages_default.retryTitle) })
|
|
15781
16038
|
] });
|
|
15782
16039
|
};
|
|
15783
16040
|
var DynamicExternal_default = DynamicExternal;
|
|
@@ -15786,10 +16043,10 @@ var DynamicExternal_default = DynamicExternal;
|
|
|
15786
16043
|
import { useEffect as useEffect15 } from "react";
|
|
15787
16044
|
|
|
15788
16045
|
// src/legacy/jsonSchemaForm/allOfSchema/AllOfSchema.tsx
|
|
15789
|
-
var
|
|
15790
|
-
import { Header as
|
|
16046
|
+
var import_classnames7 = __toESM(require_classnames());
|
|
16047
|
+
import { Header as Header9 } from "@transferwise/components";
|
|
15791
16048
|
import { useState as useState12 } from "react";
|
|
15792
|
-
import { Fragment as Fragment12, jsx as
|
|
16049
|
+
import { Fragment as Fragment12, jsx as jsx78, jsxs as jsxs27 } from "react/jsx-runtime";
|
|
15793
16050
|
var splitModel = (model, schemas) => schemas.map((schema) => getValidObjectModelParts(model, schema) || {});
|
|
15794
16051
|
var combineModels = (models) => models.reduce((current, combined) => __spreadValues(__spreadValues({}, combined), current), {});
|
|
15795
16052
|
var getSchemaColumnClasses = (width) => ({
|
|
@@ -15806,12 +16063,12 @@ function AllOfSchema(props) {
|
|
|
15806
16063
|
props.onChange(__spreadProps(__spreadValues({}, onChangeProps), { model: combineModels(models) }));
|
|
15807
16064
|
};
|
|
15808
16065
|
const [models, setModels] = useState12(splitModel(props.model, props.schema.allOf));
|
|
15809
|
-
return /* @__PURE__ */
|
|
15810
|
-
props.schema.title && !hideTitle && /* @__PURE__ */
|
|
15811
|
-
props.schema.description && /* @__PURE__ */
|
|
15812
|
-
/* @__PURE__ */
|
|
16066
|
+
return /* @__PURE__ */ jsxs27(Fragment12, { children: [
|
|
16067
|
+
props.schema.title && !hideTitle && /* @__PURE__ */ jsx78(Header9, { title: props.schema.title }),
|
|
16068
|
+
props.schema.description && /* @__PURE__ */ jsx78("p", { children: props.schema.description }),
|
|
16069
|
+
/* @__PURE__ */ jsx78("div", { className: "row", children: props.schema.allOf.map((schema, index) => (
|
|
15813
16070
|
// eslint-disable-next-line react/no-array-index-key
|
|
15814
|
-
/* @__PURE__ */
|
|
16071
|
+
/* @__PURE__ */ jsx78("div", { className: (0, import_classnames7.default)(getSchemaColumnClasses(schema.width)), children: /* @__PURE__ */ jsx78(
|
|
15815
16072
|
GenericSchema_default,
|
|
15816
16073
|
{
|
|
15817
16074
|
schema,
|
|
@@ -15832,7 +16089,7 @@ function AllOfSchema(props) {
|
|
|
15832
16089
|
var AllOfSchema_default = AllOfSchema;
|
|
15833
16090
|
|
|
15834
16091
|
// src/legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/MultipleFileUploadSchema.tsx
|
|
15835
|
-
var
|
|
16092
|
+
var import_classnames8 = __toESM(require_classnames());
|
|
15836
16093
|
import {
|
|
15837
16094
|
Status,
|
|
15838
16095
|
UploadInput as UploadInput3
|
|
@@ -15843,7 +16100,7 @@ import { useMemo as useMemo13, useState as useState13 } from "react";
|
|
|
15843
16100
|
import { InlineAlert as InlineAlert3 } from "@transferwise/components";
|
|
15844
16101
|
import { formatDate as formatDate3 } from "@transferwise/formatting";
|
|
15845
16102
|
import { useIntl as useIntl12 } from "react-intl";
|
|
15846
|
-
import { jsx as
|
|
16103
|
+
import { jsx as jsx79, jsxs as jsxs28 } from "react/jsx-runtime";
|
|
15847
16104
|
function ControlFeedback(props) {
|
|
15848
16105
|
const { errors = "", validations = [], validationMessages = {} } = props;
|
|
15849
16106
|
const defaultValidationMessages = useDefaultValidationMessages(props.schema);
|
|
@@ -15852,12 +16109,12 @@ function ControlFeedback(props) {
|
|
|
15852
16109
|
const isValidationVisible = !isErrorVisible && (props.submitted || props.changed && props.blurred) && Boolean(validations == null ? void 0 : validations.length);
|
|
15853
16110
|
const isDescriptionVisible = props.schema.type !== "boolean" && props.schema.description && !isErrorVisible && !isValidationVisible;
|
|
15854
16111
|
const hasInfoMessage = Boolean(props.infoMessage);
|
|
15855
|
-
return /* @__PURE__ */
|
|
15856
|
-
isErrorVisible ? /* @__PURE__ */
|
|
15857
|
-
isValidationVisible ? /* @__PURE__ */
|
|
15858
|
-
(isDescriptionVisible || hasInfoMessage) && /* @__PURE__ */
|
|
15859
|
-
isDescriptionVisible && /* @__PURE__ */
|
|
15860
|
-
hasInfoMessage && /* @__PURE__ */
|
|
16112
|
+
return /* @__PURE__ */ jsxs28("div", { id: props.id, children: [
|
|
16113
|
+
isErrorVisible ? /* @__PURE__ */ jsx79(InlineAlert3, { type: "error", children: errors }) : null,
|
|
16114
|
+
isValidationVisible ? /* @__PURE__ */ jsx79(InlineAlert3, { type: "error", children: validations.map((validation) => /* @__PURE__ */ jsx79("div", { children: mergedValidationMessages[validation] }, validation)) }) : null,
|
|
16115
|
+
(isDescriptionVisible || hasInfoMessage) && /* @__PURE__ */ jsxs28(InlineAlert3, { type: "info", children: [
|
|
16116
|
+
isDescriptionVisible && /* @__PURE__ */ jsx79("div", { children: props.schema.description }),
|
|
16117
|
+
hasInfoMessage && /* @__PURE__ */ jsx79("div", { children: props.infoMessage })
|
|
15861
16118
|
] })
|
|
15862
16119
|
] });
|
|
15863
16120
|
}
|
|
@@ -15977,7 +16234,7 @@ function useFormattedDefaultErrorMessages({
|
|
|
15977
16234
|
}
|
|
15978
16235
|
|
|
15979
16236
|
// src/legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/MultipleFileUploadSchema.tsx
|
|
15980
|
-
import { jsx as
|
|
16237
|
+
import { jsx as jsx80, jsxs as jsxs29 } from "react/jsx-runtime";
|
|
15981
16238
|
function MultipleFileUploadSchema(props) {
|
|
15982
16239
|
var _a, _b;
|
|
15983
16240
|
const { onChange, errors = null, schema, required = false } = props;
|
|
@@ -16038,10 +16295,10 @@ function MultipleFileUploadSchema(props) {
|
|
|
16038
16295
|
onDeleteFile: () => Promise.resolve()
|
|
16039
16296
|
});
|
|
16040
16297
|
const feedbackId = `${uid}-feedback`;
|
|
16041
|
-
return /* @__PURE__ */
|
|
16042
|
-
/* @__PURE__ */
|
|
16043
|
-
/* @__PURE__ */
|
|
16044
|
-
/* @__PURE__ */
|
|
16298
|
+
return /* @__PURE__ */ jsxs29("div", { className: (0, import_classnames8.default)("form-group", { "has-error": showError }), children: [
|
|
16299
|
+
/* @__PURE__ */ jsx80("label", { className: "d-block control-label", htmlFor: uid, children: props.schema.title }),
|
|
16300
|
+
/* @__PURE__ */ jsx80("div", { "aria-describedby": feedbackId, children: /* @__PURE__ */ jsx80(UploadInput3, __spreadValues({}, uploadInputProps)) }),
|
|
16301
|
+
/* @__PURE__ */ jsx80(
|
|
16045
16302
|
ControlFeedback_default,
|
|
16046
16303
|
{
|
|
16047
16304
|
id: feedbackId,
|
|
@@ -16074,14 +16331,14 @@ function getValidationMessages(schema, required, defaultErrorMessages) {
|
|
|
16074
16331
|
}
|
|
16075
16332
|
|
|
16076
16333
|
// src/legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multiSelectSchema/MultiSelectSchema.tsx
|
|
16077
|
-
var
|
|
16334
|
+
var import_classnames9 = __toESM(require_classnames());
|
|
16078
16335
|
import { SelectInput as SelectInput3, SelectInputOptionContent as SelectInputOptionContent3 } from "@transferwise/components";
|
|
16079
16336
|
import { useEffect as useEffect9, useMemo as useMemo14, useState as useState14 } from "react";
|
|
16080
16337
|
import { useIntl as useIntl14 } from "react-intl";
|
|
16081
16338
|
|
|
16082
16339
|
// src/legacy/jsonSchemaForm/schemaFormControl/utils/mapping-utils.tsx
|
|
16083
16340
|
import { Avatar as Avatar6, AvatarType as AvatarType5 } from "@transferwise/components";
|
|
16084
|
-
import { jsx as
|
|
16341
|
+
import { jsx as jsx81 } from "react/jsx-runtime";
|
|
16085
16342
|
var mapConstSchemaToOption = (schema, controlType) => {
|
|
16086
16343
|
switch (controlType) {
|
|
16087
16344
|
case "select":
|
|
@@ -16105,7 +16362,7 @@ var mapKeywordsToSearchStrings = (searchStrings) => isArray2(searchStrings) ? {
|
|
|
16105
16362
|
var mapImage = (image) => {
|
|
16106
16363
|
if (image == null ? void 0 : image.url) {
|
|
16107
16364
|
return {
|
|
16108
|
-
icon: /* @__PURE__ */
|
|
16365
|
+
icon: /* @__PURE__ */ jsx81("div", { className: "media", children: /* @__PURE__ */ jsx81("div", { className: "np-option__no-media-circle", children: /* @__PURE__ */ jsx81("img", { src: image.url, alt: image.name || "" }) }) }),
|
|
16109
16366
|
hideIconInTrigger: true
|
|
16110
16367
|
};
|
|
16111
16368
|
}
|
|
@@ -16114,17 +16371,17 @@ var mapImage = (image) => {
|
|
|
16114
16371
|
var getIconPropertyForSelectOption = (icon) => {
|
|
16115
16372
|
if ((icon == null ? void 0 : icon.name) && isFlagIcon3(icon.name)) {
|
|
16116
16373
|
return {
|
|
16117
|
-
icon: /* @__PURE__ */
|
|
16374
|
+
icon: /* @__PURE__ */ jsx81(Flag, { code: icon.name.substring(5), intrinsicSize: 24 })
|
|
16118
16375
|
};
|
|
16119
16376
|
}
|
|
16120
16377
|
if ((icon == null ? void 0 : icon.name) && isValidIconName(icon.name)) {
|
|
16121
16378
|
return {
|
|
16122
|
-
icon: /* @__PURE__ */
|
|
16379
|
+
icon: /* @__PURE__ */ jsx81(DynamicIcon_default2, { type: icon.name })
|
|
16123
16380
|
};
|
|
16124
16381
|
}
|
|
16125
16382
|
if (icon == null ? void 0 : icon.text) {
|
|
16126
16383
|
return {
|
|
16127
|
-
icon: /* @__PURE__ */
|
|
16384
|
+
icon: /* @__PURE__ */ jsx81("span", { children: icon.text })
|
|
16128
16385
|
};
|
|
16129
16386
|
}
|
|
16130
16387
|
return null;
|
|
@@ -16132,17 +16389,17 @@ var getIconPropertyForSelectOption = (icon) => {
|
|
|
16132
16389
|
var getAvatarPropertyForRadioOption = ({ image, icon }) => {
|
|
16133
16390
|
if (image == null ? void 0 : image.url) {
|
|
16134
16391
|
return {
|
|
16135
|
-
avatar: /* @__PURE__ */
|
|
16392
|
+
avatar: /* @__PURE__ */ jsx81(Avatar6, { type: AvatarType5.THUMBNAIL, children: /* @__PURE__ */ jsx81("img", { src: image.url, alt: "" }) })
|
|
16136
16393
|
};
|
|
16137
16394
|
}
|
|
16138
16395
|
if ((icon == null ? void 0 : icon.name) && isValidIconName(icon.name)) {
|
|
16139
16396
|
return {
|
|
16140
|
-
avatar: /* @__PURE__ */
|
|
16397
|
+
avatar: /* @__PURE__ */ jsx81(Avatar6, { type: AvatarType5.ICON, children: /* @__PURE__ */ jsx81(DynamicIcon_default2, { type: icon.name }) })
|
|
16141
16398
|
};
|
|
16142
16399
|
}
|
|
16143
16400
|
if (icon == null ? void 0 : icon.text) {
|
|
16144
16401
|
return {
|
|
16145
|
-
avatar: /* @__PURE__ */
|
|
16402
|
+
avatar: /* @__PURE__ */ jsx81(Avatar6, { type: AvatarType5.INITIALS, children: icon.text })
|
|
16146
16403
|
};
|
|
16147
16404
|
}
|
|
16148
16405
|
return null;
|
|
@@ -16181,7 +16438,7 @@ var multi_select_messages_default2 = defineMessages15({
|
|
|
16181
16438
|
});
|
|
16182
16439
|
|
|
16183
16440
|
// src/legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multiSelectSchema/MultiSelectSchema.tsx
|
|
16184
|
-
import { jsx as
|
|
16441
|
+
import { jsx as jsx82, jsxs as jsxs30 } from "react/jsx-runtime";
|
|
16185
16442
|
function MultiSelectSchema({
|
|
16186
16443
|
schema,
|
|
16187
16444
|
model,
|
|
@@ -16235,9 +16492,9 @@ function MultiSelectSchema({
|
|
|
16235
16492
|
"has-error": shouldShowInitialError || shouldShowValidationError,
|
|
16236
16493
|
"has-info": !!schema.description
|
|
16237
16494
|
};
|
|
16238
|
-
return /* @__PURE__ */
|
|
16239
|
-
schema.title ? /* @__PURE__ */
|
|
16240
|
-
/* @__PURE__ */
|
|
16495
|
+
return /* @__PURE__ */ jsxs30("div", { className: (0, import_classnames9.default)("d-flex flex-column", formGroupClasses), children: [
|
|
16496
|
+
schema.title ? /* @__PURE__ */ jsx82("label", { className: "control-label d-inline m-b-1", htmlFor: id, children: schema.title }) : void 0,
|
|
16497
|
+
/* @__PURE__ */ jsx82(
|
|
16241
16498
|
SelectInput3,
|
|
16242
16499
|
{
|
|
16243
16500
|
id,
|
|
@@ -16263,12 +16520,12 @@ function MultiSelectSchema({
|
|
|
16263
16520
|
if (withinTrigger) {
|
|
16264
16521
|
return selected && index === selected[0] ? getFormattedMessage() : void 0;
|
|
16265
16522
|
}
|
|
16266
|
-
return /* @__PURE__ */
|
|
16523
|
+
return /* @__PURE__ */ jsx82(SelectInputOptionContent3, { title: label, note: note != null ? note : secondary, icon });
|
|
16267
16524
|
},
|
|
16268
16525
|
onChange: broadcastModelChange
|
|
16269
16526
|
}
|
|
16270
16527
|
),
|
|
16271
|
-
/* @__PURE__ */
|
|
16528
|
+
/* @__PURE__ */ jsx82(
|
|
16272
16529
|
ControlFeedback_default,
|
|
16273
16530
|
{
|
|
16274
16531
|
id: `${id}-feedback`,
|
|
@@ -16293,16 +16550,16 @@ var getInitialModelIndices2 = (model, options) => {
|
|
|
16293
16550
|
};
|
|
16294
16551
|
|
|
16295
16552
|
// src/legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/repeatableSchema/RepeatableSchema.tsx
|
|
16296
|
-
import { Header as
|
|
16553
|
+
import { Header as Header10, Modal as Modal3, NavigationOption as NavigationOption6 } from "@transferwise/components";
|
|
16297
16554
|
import { Plus as Plus2 } from "@transferwise/icons";
|
|
16298
16555
|
import { useMemo as useMemo15, useState as useState16 } from "react";
|
|
16299
16556
|
import { useIntl as useIntl16 } from "react-intl";
|
|
16300
16557
|
|
|
16301
16558
|
// src/legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/repeatableSchema/ItemSummary.tsx
|
|
16302
16559
|
import { NavigationOption as NavigationOption5 } from "@transferwise/components";
|
|
16303
|
-
import { jsx as
|
|
16560
|
+
import { jsx as jsx83 } from "react/jsx-runtime";
|
|
16304
16561
|
function ItemSummaryOption2({ item, onClick }) {
|
|
16305
|
-
return /* @__PURE__ */
|
|
16562
|
+
return /* @__PURE__ */ jsx83(
|
|
16306
16563
|
NavigationOption5,
|
|
16307
16564
|
{
|
|
16308
16565
|
media: getNavigationOptionMedia(item),
|
|
@@ -16342,7 +16599,7 @@ var repeatable_messages_default2 = defineMessages16({
|
|
|
16342
16599
|
// src/legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/repeatableSchema/RepeatableSchemaStep.tsx
|
|
16343
16600
|
import { useState as useState15 } from "react";
|
|
16344
16601
|
import { useIntl as useIntl15 } from "react-intl";
|
|
16345
|
-
import { jsx as
|
|
16602
|
+
import { jsx as jsx84 } from "react/jsx-runtime";
|
|
16346
16603
|
function RepeatableSchemaStep({
|
|
16347
16604
|
type,
|
|
16348
16605
|
schema,
|
|
@@ -16390,7 +16647,7 @@ function RepeatableSchemaStep({
|
|
|
16390
16647
|
}
|
|
16391
16648
|
onModelChange(__spreadProps(__spreadValues({}, modelChangeProps), { model: model2 }));
|
|
16392
16649
|
};
|
|
16393
|
-
return /* @__PURE__ */
|
|
16650
|
+
return /* @__PURE__ */ jsx84(
|
|
16394
16651
|
DynamicFlowStep,
|
|
16395
16652
|
{
|
|
16396
16653
|
step,
|
|
@@ -16595,8 +16852,8 @@ var schemaSummaryProvides = (summary, providesProp) => (
|
|
|
16595
16852
|
);
|
|
16596
16853
|
|
|
16597
16854
|
// src/legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/repeatableSchema/RepeatableSchema.tsx
|
|
16598
|
-
var
|
|
16599
|
-
import { jsx as
|
|
16855
|
+
var import_classnames10 = __toESM(require_classnames());
|
|
16856
|
+
import { jsx as jsx85, jsxs as jsxs31 } from "react/jsx-runtime";
|
|
16600
16857
|
function RepeatableSchema({
|
|
16601
16858
|
schema,
|
|
16602
16859
|
model,
|
|
@@ -16673,9 +16930,9 @@ function RepeatableSchema({
|
|
|
16673
16930
|
const formGroupClasses = {
|
|
16674
16931
|
"has-error": (_a = errors && !isEmpty(errors)) != null ? _a : submitted && validations.length
|
|
16675
16932
|
};
|
|
16676
|
-
return /* @__PURE__ */
|
|
16677
|
-
schema.title && /* @__PURE__ */
|
|
16678
|
-
itemSummaries == null ? void 0 : itemSummaries.map((itemSummary) => /* @__PURE__ */
|
|
16933
|
+
return /* @__PURE__ */ jsxs31("div", { id, className: (0, import_classnames10.default)(formGroupClasses), children: [
|
|
16934
|
+
schema.title && /* @__PURE__ */ jsx85(Header10, { title: schema.title }),
|
|
16935
|
+
itemSummaries == null ? void 0 : itemSummaries.map((itemSummary) => /* @__PURE__ */ jsx85(
|
|
16679
16936
|
ItemSummaryOption2,
|
|
16680
16937
|
{
|
|
16681
16938
|
item: itemSummary,
|
|
@@ -16683,21 +16940,21 @@ function RepeatableSchema({
|
|
|
16683
16940
|
},
|
|
16684
16941
|
JSON.stringify(itemSummary)
|
|
16685
16942
|
)),
|
|
16686
|
-
/* @__PURE__ */
|
|
16943
|
+
/* @__PURE__ */ jsx85(
|
|
16687
16944
|
NavigationOption6,
|
|
16688
16945
|
{
|
|
16689
|
-
media: /* @__PURE__ */
|
|
16946
|
+
media: /* @__PURE__ */ jsx85(Plus2, {}),
|
|
16690
16947
|
title: schema.addItemTitle || formatMessage(repeatable_messages_default2.addItemTitle),
|
|
16691
16948
|
showMediaAtAllSizes: true,
|
|
16692
16949
|
onClick: onAddItem
|
|
16693
16950
|
}
|
|
16694
16951
|
),
|
|
16695
|
-
/* @__PURE__ */
|
|
16952
|
+
/* @__PURE__ */ jsx85(
|
|
16696
16953
|
Modal3,
|
|
16697
16954
|
{
|
|
16698
16955
|
open: openModalType !== null,
|
|
16699
16956
|
title: (openModalType === "add" ? schema.addItemTitle : schema.editItemTitle) || formatMessage(repeatable_messages_default2.addItemTitle),
|
|
16700
|
-
body: /* @__PURE__ */
|
|
16957
|
+
body: /* @__PURE__ */ jsx85(
|
|
16701
16958
|
RepeatableSchemaStep_default,
|
|
16702
16959
|
{
|
|
16703
16960
|
type: openModalType != null ? openModalType : "add",
|
|
@@ -16712,7 +16969,7 @@ function RepeatableSchema({
|
|
|
16712
16969
|
onClose: onCancelEdit
|
|
16713
16970
|
}
|
|
16714
16971
|
),
|
|
16715
|
-
/* @__PURE__ */
|
|
16972
|
+
/* @__PURE__ */ jsx85(
|
|
16716
16973
|
ControlFeedback_default,
|
|
16717
16974
|
{
|
|
16718
16975
|
id: `${id}-feedback`,
|
|
@@ -16754,38 +17011,38 @@ var getUpdatedItemSummaries = (action, {
|
|
|
16754
17011
|
var RepeatableSchema_default = RepeatableSchema;
|
|
16755
17012
|
|
|
16756
17013
|
// src/legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/ArrayListSchema.tsx
|
|
16757
|
-
import { jsx as
|
|
17014
|
+
import { jsx as jsx86 } from "react/jsx-runtime";
|
|
16758
17015
|
function ArrayListSchema(props) {
|
|
16759
17016
|
const { errors = null, schema } = props;
|
|
16760
17017
|
if (isMultipleFileUploadSchema(schema)) {
|
|
16761
|
-
return /* @__PURE__ */
|
|
17018
|
+
return /* @__PURE__ */ jsx86(MultipleFileUploadSchema_default, __spreadProps(__spreadValues({}, props), { errors, schema }));
|
|
16762
17019
|
}
|
|
16763
17020
|
if (isMultiSelectConstSchema(schema)) {
|
|
16764
|
-
return /* @__PURE__ */
|
|
17021
|
+
return /* @__PURE__ */ jsx86(MultiSelectSchema, __spreadProps(__spreadValues({}, props), { errors, schema }));
|
|
16765
17022
|
}
|
|
16766
17023
|
if (isListArraySchema(schema)) {
|
|
16767
|
-
return /* @__PURE__ */
|
|
17024
|
+
return /* @__PURE__ */ jsx86(RepeatableSchema_default, __spreadProps(__spreadValues({}, props), { errors, schema }));
|
|
16768
17025
|
}
|
|
16769
17026
|
throw new Error("Invalid array list schema");
|
|
16770
17027
|
}
|
|
16771
17028
|
var ArrayListSchema_default = ArrayListSchema;
|
|
16772
17029
|
|
|
16773
17030
|
// src/legacy/jsonSchemaForm/arrayTypeSchema/ArraySchema.tsx
|
|
16774
|
-
import { jsx as
|
|
17031
|
+
import { jsx as jsx87 } from "react/jsx-runtime";
|
|
16775
17032
|
var ArraySchema = (props) => {
|
|
16776
17033
|
const { schema } = props;
|
|
16777
17034
|
if (isListArraySchema(schema)) {
|
|
16778
|
-
return /* @__PURE__ */
|
|
17035
|
+
return /* @__PURE__ */ jsx87(ArrayListSchema_default, __spreadValues({}, props));
|
|
16779
17036
|
}
|
|
16780
17037
|
throw new Error("Not implemented");
|
|
16781
17038
|
};
|
|
16782
17039
|
var ArraySchema_default = ArraySchema;
|
|
16783
17040
|
|
|
16784
17041
|
// src/legacy/jsonSchemaForm/objectSchema/ObjectSchema.tsx
|
|
16785
|
-
var
|
|
16786
|
-
import { Header as
|
|
17042
|
+
var import_classnames11 = __toESM(require_classnames());
|
|
17043
|
+
import { Header as Header11 } from "@transferwise/components";
|
|
16787
17044
|
import { useState as useState17, useEffect as useEffect10 } from "react";
|
|
16788
|
-
import { Fragment as Fragment13, jsx as
|
|
17045
|
+
import { Fragment as Fragment13, jsx as jsx88, jsxs as jsxs32 } from "react/jsx-runtime";
|
|
16789
17046
|
var getSchemaColumnClasses2 = (width) => ({
|
|
16790
17047
|
"col-xs-12": true,
|
|
16791
17048
|
"col-sm-6": width === "md",
|
|
@@ -16822,22 +17079,22 @@ function ObjectSchema(props) {
|
|
|
16822
17079
|
const isPropertyDefined = (propertyName) => typeof props.schema.properties[propertyName] !== "undefined";
|
|
16823
17080
|
const orderedPropertyNames = Array.from(allorderedPropertiesSet).filter(isPropertyDefined);
|
|
16824
17081
|
const propsErrors = props.errors;
|
|
16825
|
-
return /* @__PURE__ */
|
|
16826
|
-
props.schema.alert && /* @__PURE__ */
|
|
16827
|
-
/* @__PURE__ */
|
|
16828
|
-
props.schema.title && !hideTitle && /* @__PURE__ */
|
|
16829
|
-
props.schema.description && !hideTitle && /* @__PURE__ */
|
|
17082
|
+
return /* @__PURE__ */ jsxs32(Fragment13, { children: [
|
|
17083
|
+
props.schema.alert && /* @__PURE__ */ jsx88(DynamicAlert_default, { component: props.schema.alert }),
|
|
17084
|
+
/* @__PURE__ */ jsxs32("fieldset", { children: [
|
|
17085
|
+
props.schema.title && !hideTitle && /* @__PURE__ */ jsx88(Header11, { title: props.schema.title, as: "legend" }),
|
|
17086
|
+
props.schema.description && !hideTitle && /* @__PURE__ */ jsxs32("p", { children: [
|
|
16830
17087
|
" ",
|
|
16831
17088
|
props.schema.description,
|
|
16832
17089
|
" "
|
|
16833
17090
|
] }),
|
|
16834
|
-
/* @__PURE__ */
|
|
17091
|
+
/* @__PURE__ */ jsx88("div", { className: "row", children: orderedPropertyNames.map((propertyName) => /* @__PURE__ */ jsx88(
|
|
16835
17092
|
"div",
|
|
16836
17093
|
{
|
|
16837
|
-
className: (0,
|
|
17094
|
+
className: (0, import_classnames11.default)(
|
|
16838
17095
|
getSchemaColumnClasses2(props.schema.properties[propertyName].width)
|
|
16839
17096
|
),
|
|
16840
|
-
children: /* @__PURE__ */
|
|
17097
|
+
children: /* @__PURE__ */ jsx88(
|
|
16841
17098
|
GenericSchema_default,
|
|
16842
17099
|
{
|
|
16843
17100
|
schema: props.schema.properties[propertyName],
|
|
@@ -16859,8 +17116,8 @@ function ObjectSchema(props) {
|
|
|
16859
17116
|
var ObjectSchema_default = ObjectSchema;
|
|
16860
17117
|
|
|
16861
17118
|
// src/legacy/jsonSchemaForm/oneOfSchema/OneOfSchema.tsx
|
|
16862
|
-
var
|
|
16863
|
-
import { Header as
|
|
17119
|
+
var import_classnames12 = __toESM(require_classnames());
|
|
17120
|
+
import { Header as Header12 } from "@transferwise/components";
|
|
16864
17121
|
import { useEffect as useEffect12, useMemo as useMemo16, useState as useState18 } from "react";
|
|
16865
17122
|
|
|
16866
17123
|
// src/legacy/jsonSchemaForm/help/Help.tsx
|
|
@@ -16878,14 +17135,14 @@ var help_messages_default2 = defineMessages17({
|
|
|
16878
17135
|
});
|
|
16879
17136
|
|
|
16880
17137
|
// src/legacy/jsonSchemaForm/help/Help.tsx
|
|
16881
|
-
import { jsx as
|
|
17138
|
+
import { jsx as jsx89 } from "react/jsx-runtime";
|
|
16882
17139
|
function Help2(props) {
|
|
16883
17140
|
const intl = useIntl17();
|
|
16884
|
-
return /* @__PURE__ */
|
|
17141
|
+
return /* @__PURE__ */ jsx89(
|
|
16885
17142
|
Info2,
|
|
16886
17143
|
{
|
|
16887
17144
|
className: "m-l-1",
|
|
16888
|
-
content: /* @__PURE__ */
|
|
17145
|
+
content: /* @__PURE__ */ jsx89(Markdown6, { config: { link: { target: "_blank" } }, children: props.help.markdown }),
|
|
16889
17146
|
presentation: "POPOVER",
|
|
16890
17147
|
size: "sm",
|
|
16891
17148
|
"aria-label": intl.formatMessage(help_messages_default2.helpAria)
|
|
@@ -17098,7 +17355,7 @@ var autocompleteTokenMap2 = {
|
|
|
17098
17355
|
};
|
|
17099
17356
|
|
|
17100
17357
|
// src/legacy/formControl/FormControl.tsx
|
|
17101
|
-
import { Fragment as Fragment14, jsx as
|
|
17358
|
+
import { Fragment as Fragment14, jsx as jsx90 } from "react/jsx-runtime";
|
|
17102
17359
|
var _FormControl = class _FormControl extends PureComponent {
|
|
17103
17360
|
constructor(props) {
|
|
17104
17361
|
super(props);
|
|
@@ -17188,7 +17445,7 @@ var _FormControl = class _FormControl extends PureComponent {
|
|
|
17188
17445
|
} = this.props;
|
|
17189
17446
|
switch (type) {
|
|
17190
17447
|
case FormControlType.RADIO:
|
|
17191
|
-
return /* @__PURE__ */
|
|
17448
|
+
return /* @__PURE__ */ jsx90(
|
|
17192
17449
|
RadioGroup2,
|
|
17193
17450
|
{
|
|
17194
17451
|
radios: options.map(this.mapOption),
|
|
@@ -17204,7 +17461,7 @@ var _FormControl = class _FormControl extends PureComponent {
|
|
|
17204
17461
|
}
|
|
17205
17462
|
);
|
|
17206
17463
|
case FormControlType.CHECKBOX:
|
|
17207
|
-
return /* @__PURE__ */
|
|
17464
|
+
return /* @__PURE__ */ jsx90(
|
|
17208
17465
|
Checkbox2,
|
|
17209
17466
|
{
|
|
17210
17467
|
checked: getSafeBooleanValue(value, { coerceValue: true }),
|
|
@@ -17222,7 +17479,7 @@ var _FormControl = class _FormControl extends PureComponent {
|
|
|
17222
17479
|
const search = options.length >= 8;
|
|
17223
17480
|
const items = options;
|
|
17224
17481
|
const selected = this.getSelectedOption(options);
|
|
17225
|
-
return /* @__PURE__ */
|
|
17482
|
+
return /* @__PURE__ */ jsx90("div", { className: "d-flex flex-column", children: /* @__PURE__ */ jsx90(
|
|
17226
17483
|
SelectInput4,
|
|
17227
17484
|
{
|
|
17228
17485
|
id,
|
|
@@ -17238,7 +17495,7 @@ var _FormControl = class _FormControl extends PureComponent {
|
|
|
17238
17495
|
disabled: value2.disabled
|
|
17239
17496
|
})),
|
|
17240
17497
|
value: selected != null ? selected : null,
|
|
17241
|
-
renderValue: ({ hideIconInTrigger, icon, label: label2, note, secondary }, withinTrigger) => /* @__PURE__ */
|
|
17498
|
+
renderValue: ({ hideIconInTrigger, icon, label: label2, note, secondary }, withinTrigger) => /* @__PURE__ */ jsx90(
|
|
17242
17499
|
SelectInputOptionContent4,
|
|
17243
17500
|
{
|
|
17244
17501
|
title: label2,
|
|
@@ -17267,13 +17524,13 @@ var _FormControl = class _FormControl extends PureComponent {
|
|
|
17267
17524
|
) });
|
|
17268
17525
|
}
|
|
17269
17526
|
case FormControlType.TAB:
|
|
17270
|
-
return /* @__PURE__ */
|
|
17527
|
+
return /* @__PURE__ */ jsx90(
|
|
17271
17528
|
Tabs2,
|
|
17272
17529
|
{
|
|
17273
17530
|
selected: ((_a = this.getSelectedOption(options)) == null ? void 0 : _a.value) || 0,
|
|
17274
17531
|
tabs: options.map((option) => ({
|
|
17275
17532
|
title: option.label,
|
|
17276
|
-
content: /* @__PURE__ */
|
|
17533
|
+
content: /* @__PURE__ */ jsx90(Fragment14, {}),
|
|
17277
17534
|
disabled: option.disabled || false
|
|
17278
17535
|
})),
|
|
17279
17536
|
name: id,
|
|
@@ -17288,7 +17545,7 @@ var _FormControl = class _FormControl extends PureComponent {
|
|
|
17288
17545
|
);
|
|
17289
17546
|
case FormControlType.NUMERIC:
|
|
17290
17547
|
case FormControlType.NUMBER: {
|
|
17291
|
-
return /* @__PURE__ */
|
|
17548
|
+
return /* @__PURE__ */ jsx90(
|
|
17292
17549
|
"input",
|
|
17293
17550
|
{
|
|
17294
17551
|
autoComplete: this.getAutocompleteValue(),
|
|
@@ -17322,7 +17579,7 @@ var _FormControl = class _FormControl extends PureComponent {
|
|
|
17322
17579
|
);
|
|
17323
17580
|
}
|
|
17324
17581
|
case FormControlType.HIDDEN:
|
|
17325
|
-
return /* @__PURE__ */
|
|
17582
|
+
return /* @__PURE__ */ jsx90(
|
|
17326
17583
|
"input",
|
|
17327
17584
|
{
|
|
17328
17585
|
type: "hidden",
|
|
@@ -17332,7 +17589,7 @@ var _FormControl = class _FormControl extends PureComponent {
|
|
|
17332
17589
|
}
|
|
17333
17590
|
);
|
|
17334
17591
|
case FormControlType.PASSWORD:
|
|
17335
|
-
return /* @__PURE__ */
|
|
17592
|
+
return /* @__PURE__ */ jsx90(
|
|
17336
17593
|
"input",
|
|
17337
17594
|
{
|
|
17338
17595
|
autoComplete: this.getAutocompleteValue(),
|
|
@@ -17352,7 +17609,7 @@ var _FormControl = class _FormControl extends PureComponent {
|
|
|
17352
17609
|
);
|
|
17353
17610
|
case FormControlType.DATE:
|
|
17354
17611
|
case FormControlType.DATETIME:
|
|
17355
|
-
return /* @__PURE__ */
|
|
17612
|
+
return /* @__PURE__ */ jsx90(
|
|
17356
17613
|
DateInput2,
|
|
17357
17614
|
{
|
|
17358
17615
|
"aria-labelledby": labelledBy,
|
|
@@ -17369,7 +17626,7 @@ var _FormControl = class _FormControl extends PureComponent {
|
|
|
17369
17626
|
}
|
|
17370
17627
|
);
|
|
17371
17628
|
case FormControlType.DATELOOKUP: {
|
|
17372
|
-
return /* @__PURE__ */
|
|
17629
|
+
return /* @__PURE__ */ jsx90(
|
|
17373
17630
|
DateLookup2,
|
|
17374
17631
|
{
|
|
17375
17632
|
value: getSafeDateStringValue(value),
|
|
@@ -17387,7 +17644,7 @@ var _FormControl = class _FormControl extends PureComponent {
|
|
|
17387
17644
|
);
|
|
17388
17645
|
}
|
|
17389
17646
|
case FormControlType.TEL:
|
|
17390
|
-
return /* @__PURE__ */
|
|
17647
|
+
return /* @__PURE__ */ jsx90(
|
|
17391
17648
|
PhoneNumberInput2,
|
|
17392
17649
|
{
|
|
17393
17650
|
disabled,
|
|
@@ -17419,7 +17676,7 @@ var _FormControl = class _FormControl extends PureComponent {
|
|
|
17419
17676
|
autoComplete: this.getAutocompleteValue()
|
|
17420
17677
|
};
|
|
17421
17678
|
if (this.props.displayPattern) {
|
|
17422
|
-
return /* @__PURE__ */
|
|
17679
|
+
return /* @__PURE__ */ jsx90(
|
|
17423
17680
|
TextareaWithDisplayFormat2,
|
|
17424
17681
|
__spreadProps(__spreadValues({
|
|
17425
17682
|
displayPattern: this.props.displayPattern
|
|
@@ -17428,7 +17685,7 @@ var _FormControl = class _FormControl extends PureComponent {
|
|
|
17428
17685
|
})
|
|
17429
17686
|
);
|
|
17430
17687
|
}
|
|
17431
|
-
return /* @__PURE__ */
|
|
17688
|
+
return /* @__PURE__ */ jsx90(
|
|
17432
17689
|
"textarea",
|
|
17433
17690
|
__spreadProps(__spreadValues({}, textareaProps), {
|
|
17434
17691
|
"aria-describedby": describedBy,
|
|
@@ -17438,7 +17695,7 @@ var _FormControl = class _FormControl extends PureComponent {
|
|
|
17438
17695
|
}
|
|
17439
17696
|
case FormControlType.FILE:
|
|
17440
17697
|
case FormControlType.UPLOAD: {
|
|
17441
|
-
return /* @__PURE__ */
|
|
17698
|
+
return /* @__PURE__ */ jsx90(
|
|
17442
17699
|
Upload2,
|
|
17443
17700
|
__spreadProps(__spreadValues({}, uploadProps), {
|
|
17444
17701
|
usAccept: uploadProps.usAccept || "*",
|
|
@@ -17475,7 +17732,7 @@ var _FormControl = class _FormControl extends PureComponent {
|
|
|
17475
17732
|
autoComplete: this.getAutocompleteValue()
|
|
17476
17733
|
};
|
|
17477
17734
|
if (this.props.displayPattern) {
|
|
17478
|
-
return /* @__PURE__ */
|
|
17735
|
+
return /* @__PURE__ */ jsx90(
|
|
17479
17736
|
InputWithDisplayFormat2,
|
|
17480
17737
|
__spreadProps(__spreadValues({
|
|
17481
17738
|
displayPattern: this.props.displayPattern
|
|
@@ -17484,7 +17741,7 @@ var _FormControl = class _FormControl extends PureComponent {
|
|
|
17484
17741
|
})
|
|
17485
17742
|
);
|
|
17486
17743
|
}
|
|
17487
|
-
return /* @__PURE__ */
|
|
17744
|
+
return /* @__PURE__ */ jsx90(
|
|
17488
17745
|
"input",
|
|
17489
17746
|
__spreadProps(__spreadValues({}, inputProps), {
|
|
17490
17747
|
"aria-describedby": describedBy,
|
|
@@ -17534,7 +17791,7 @@ _FormControl.defaultProps = {
|
|
|
17534
17791
|
var FormControl = _FormControl;
|
|
17535
17792
|
|
|
17536
17793
|
// src/legacy/jsonSchemaForm/schemaFormControl/SchemaFormControl.tsx
|
|
17537
|
-
import { jsx as
|
|
17794
|
+
import { jsx as jsx91 } from "react/jsx-runtime";
|
|
17538
17795
|
var isNativeInput = (propsSchemaType) => propsSchemaType === "string" || propsSchemaType === "number";
|
|
17539
17796
|
var getControlType = (schema) => {
|
|
17540
17797
|
if (isOneOfSchema2(schema)) {
|
|
@@ -17651,7 +17908,7 @@ function SchemaFormControl(props) {
|
|
|
17651
17908
|
labelledBy,
|
|
17652
17909
|
required
|
|
17653
17910
|
};
|
|
17654
|
-
return /* @__PURE__ */
|
|
17911
|
+
return /* @__PURE__ */ jsx91("div", { "aria-describedby": describedBy, children: /* @__PURE__ */ jsx91(FormControl, __spreadValues(__spreadValues({ type: controlType, value: safeValue }, events), controlProps)) });
|
|
17655
17912
|
}
|
|
17656
17913
|
var warnIfInvalidSchema = (schema, log, controlType) => {
|
|
17657
17914
|
if (isOneOfSchema2(schema) && schema.oneOf.length === 2 && !schema.control) {
|
|
@@ -17673,7 +17930,7 @@ var warnIfInvalidSchema = (schema, log, controlType) => {
|
|
|
17673
17930
|
var SchemaFormControl_default = SchemaFormControl;
|
|
17674
17931
|
|
|
17675
17932
|
// src/legacy/jsonSchemaForm/oneOfSchema/OneOfSchema.tsx
|
|
17676
|
-
import { Fragment as Fragment15, jsx as
|
|
17933
|
+
import { Fragment as Fragment15, jsx as jsx92, jsxs as jsxs33 } from "react/jsx-runtime";
|
|
17677
17934
|
function OneOfSchema(props) {
|
|
17678
17935
|
const onEvent = useEventDispatcher();
|
|
17679
17936
|
const [changed, setChanged] = useState18(false);
|
|
@@ -17752,12 +18009,12 @@ function OneOfSchema(props) {
|
|
|
17752
18009
|
const isHidden = props.schema.hidden;
|
|
17753
18010
|
const feedbackId = `${id}-feedback`;
|
|
17754
18011
|
const labelId = `${id}-label`;
|
|
17755
|
-
return !isHidden ? /* @__PURE__ */
|
|
17756
|
-
(props.schema.oneOf.length > 1 || isConstSchema2(props.schema.oneOf[0])) && /* @__PURE__ */
|
|
17757
|
-
props.schema.alert && /* @__PURE__ */
|
|
17758
|
-
/* @__PURE__ */
|
|
18012
|
+
return !isHidden ? /* @__PURE__ */ jsxs33(Fragment15, { children: [
|
|
18013
|
+
(props.schema.oneOf.length > 1 || isConstSchema2(props.schema.oneOf[0])) && /* @__PURE__ */ jsxs33(Fragment15, { children: [
|
|
18014
|
+
props.schema.alert && /* @__PURE__ */ jsx92(DynamicAlert_default, { component: props.schema.alert }),
|
|
18015
|
+
/* @__PURE__ */ jsxs33("div", { className: (0, import_classnames12.default)(formGroupClasses), children: [
|
|
17759
18016
|
getTitleAndHelp(props.schema, id, labelId),
|
|
17760
|
-
/* @__PURE__ */
|
|
18017
|
+
/* @__PURE__ */ jsx92(
|
|
17761
18018
|
SchemaFormControl_default,
|
|
17762
18019
|
{
|
|
17763
18020
|
id,
|
|
@@ -17774,7 +18031,7 @@ function OneOfSchema(props) {
|
|
|
17774
18031
|
onSearchChange
|
|
17775
18032
|
}
|
|
17776
18033
|
),
|
|
17777
|
-
/* @__PURE__ */
|
|
18034
|
+
/* @__PURE__ */ jsx92(
|
|
17778
18035
|
ControlFeedback_default,
|
|
17779
18036
|
{
|
|
17780
18037
|
id: feedbackId,
|
|
@@ -17790,7 +18047,7 @@ function OneOfSchema(props) {
|
|
|
17790
18047
|
)
|
|
17791
18048
|
] })
|
|
17792
18049
|
] }),
|
|
17793
|
-
isNoNConstSchema(props.schema.oneOf[schemaIndex]) && /* @__PURE__ */
|
|
18050
|
+
isNoNConstSchema(props.schema.oneOf[schemaIndex]) && /* @__PURE__ */ jsx92(
|
|
17794
18051
|
GenericSchema_default,
|
|
17795
18052
|
{
|
|
17796
18053
|
schema: props.schema.oneOf[schemaIndex],
|
|
@@ -17807,16 +18064,16 @@ function OneOfSchema(props) {
|
|
|
17807
18064
|
}
|
|
17808
18065
|
function getTitleAndHelp(schema, forId, labelId) {
|
|
17809
18066
|
var _a;
|
|
17810
|
-
const helpElement = schema.help ? /* @__PURE__ */
|
|
17811
|
-
const titleElement = isConstSchema2(schema.oneOf[0]) ? /* @__PURE__ */
|
|
18067
|
+
const helpElement = schema.help ? /* @__PURE__ */ jsx92(Help_default2, { help: schema.help }) : null;
|
|
18068
|
+
const titleElement = isConstSchema2(schema.oneOf[0]) ? /* @__PURE__ */ jsx92("div", { className: "m-b-1", children: /* @__PURE__ */ jsxs33("label", { className: "control-label d-inline", id: labelId, htmlFor: forId, children: [
|
|
17812
18069
|
schema.title,
|
|
17813
18070
|
" ",
|
|
17814
18071
|
helpElement
|
|
17815
|
-
] }) }) : /* @__PURE__ */
|
|
18072
|
+
] }) }) : /* @__PURE__ */ jsx92(Fragment15, { children: helpElement ? /* @__PURE__ */ jsxs33("h4", { className: "m-b-2", children: [
|
|
17816
18073
|
schema.title,
|
|
17817
18074
|
" ",
|
|
17818
18075
|
helpElement
|
|
17819
|
-
] }) : /* @__PURE__ */
|
|
18076
|
+
] }) : /* @__PURE__ */ jsx92(Header12, { title: (_a = schema.title) != null ? _a : "" }) });
|
|
17820
18077
|
return schema.title ? titleElement : helpElement;
|
|
17821
18078
|
}
|
|
17822
18079
|
function getValidations(props, schemaIndex) {
|
|
@@ -17849,14 +18106,14 @@ function mapOneOfToConst(schema, index) {
|
|
|
17849
18106
|
var OneOfSchema_default = OneOfSchema;
|
|
17850
18107
|
|
|
17851
18108
|
// src/legacy/jsonSchemaForm/persistAsyncSchema/persistAsyncBlobSchema/PersistAsyncBlobSchema.tsx
|
|
17852
|
-
var
|
|
18109
|
+
var import_classnames13 = __toESM(require_classnames());
|
|
17853
18110
|
import { useEffect as useEffect13, useState as useState19 } from "react";
|
|
17854
18111
|
import { useIntl as useIntl19 } from "react-intl";
|
|
17855
18112
|
|
|
17856
18113
|
// src/legacy/jsonSchemaForm/persistAsyncSchema/persistAsyncBlobSchema/UploadInputAdapter.tsx
|
|
17857
18114
|
import { Status as Status2, UploadInput as UploadInput4 } from "@transferwise/components";
|
|
17858
18115
|
import { useMemo as useMemo17 } from "react";
|
|
17859
|
-
import { jsx as
|
|
18116
|
+
import { jsx as jsx93 } from "react/jsx-runtime";
|
|
17860
18117
|
function UploadInputAdapter(props) {
|
|
17861
18118
|
const {
|
|
17862
18119
|
id,
|
|
@@ -17891,7 +18148,7 @@ function UploadInputAdapter(props) {
|
|
|
17891
18148
|
return Promise.reject();
|
|
17892
18149
|
});
|
|
17893
18150
|
};
|
|
17894
|
-
return /* @__PURE__ */
|
|
18151
|
+
return /* @__PURE__ */ jsx93(
|
|
17895
18152
|
UploadInput4,
|
|
17896
18153
|
{
|
|
17897
18154
|
id,
|
|
@@ -17911,7 +18168,7 @@ function UploadInputAdapter(props) {
|
|
|
17911
18168
|
}
|
|
17912
18169
|
|
|
17913
18170
|
// src/legacy/jsonSchemaForm/persistAsyncSchema/persistAsyncBlobSchema/PersistAsyncBlobSchema.tsx
|
|
17914
|
-
import { jsx as
|
|
18171
|
+
import { jsx as jsx94, jsxs as jsxs34 } from "react/jsx-runtime";
|
|
17915
18172
|
function PersistAsyncBlobSchema(props) {
|
|
17916
18173
|
const { model, schema, submitted, required = false, errors, onChange } = props;
|
|
17917
18174
|
const [persistAsyncValidationMessages, setPersistAsyncValidationMessages] = useState19({});
|
|
@@ -17959,8 +18216,8 @@ function PersistAsyncBlobSchema(props) {
|
|
|
17959
18216
|
};
|
|
17960
18217
|
const id = schema.$id || schema.persistAsync.schema.$id || schema.persistAsync.idProperty;
|
|
17961
18218
|
const feedbackId = `${id}-feedback`;
|
|
17962
|
-
return /* @__PURE__ */
|
|
17963
|
-
/* @__PURE__ */
|
|
18219
|
+
return /* @__PURE__ */ jsxs34("div", { className: (0, import_classnames13.default)(formGroupClasses), children: [
|
|
18220
|
+
/* @__PURE__ */ jsx94("div", { "aria-describedby": feedbackId, children: /* @__PURE__ */ jsx94(
|
|
17964
18221
|
UploadInputAdapter,
|
|
17965
18222
|
__spreadValues({
|
|
17966
18223
|
id,
|
|
@@ -17978,7 +18235,7 @@ function PersistAsyncBlobSchema(props) {
|
|
|
17978
18235
|
onCancel
|
|
17979
18236
|
}, mapSchemaToUploadOptions(schema.persistAsync.schema))
|
|
17980
18237
|
) }),
|
|
17981
|
-
/* @__PURE__ */
|
|
18238
|
+
/* @__PURE__ */ jsx94(
|
|
17982
18239
|
ControlFeedback_default,
|
|
17983
18240
|
{
|
|
17984
18241
|
id: feedbackId,
|
|
@@ -18004,17 +18261,17 @@ var getResponseJsonObject = async (response) => {
|
|
|
18004
18261
|
var PersistAsyncBlobSchema_default = PersistAsyncBlobSchema;
|
|
18005
18262
|
|
|
18006
18263
|
// src/legacy/jsonSchemaForm/persistAsyncSchema/PersistAsyncSchema.tsx
|
|
18007
|
-
import { jsx as
|
|
18264
|
+
import { jsx as jsx95 } from "react/jsx-runtime";
|
|
18008
18265
|
function PersistAsyncSchema(props) {
|
|
18009
18266
|
const { schema } = props;
|
|
18010
18267
|
const persistAsyncSchemaType = schema.persistAsync.schema.type;
|
|
18011
18268
|
if (persistAsyncSchemaType === "blob") {
|
|
18012
|
-
return /* @__PURE__ */
|
|
18269
|
+
return /* @__PURE__ */ jsx95(
|
|
18013
18270
|
PersistAsyncBlobSchema_default,
|
|
18014
18271
|
__spreadValues({}, props)
|
|
18015
18272
|
);
|
|
18016
18273
|
}
|
|
18017
|
-
return /* @__PURE__ */
|
|
18274
|
+
return /* @__PURE__ */ jsx95(PersistAsyncBasicSchema_default, __spreadValues({}, props));
|
|
18018
18275
|
}
|
|
18019
18276
|
var PersistAsyncSchema_default = PersistAsyncSchema;
|
|
18020
18277
|
|
|
@@ -18032,7 +18289,7 @@ var getSelectionFromModel = (schema, model) => {
|
|
|
18032
18289
|
|
|
18033
18290
|
// src/legacy/jsonSchemaForm/promotedOneOfSchema/promotedOneOfControl/PromotedOneOfCheckboxControl.tsx
|
|
18034
18291
|
import { Checkbox as Checkbox3 } from "@transferwise/components";
|
|
18035
|
-
import { jsx as
|
|
18292
|
+
import { jsx as jsx96 } from "react/jsx-runtime";
|
|
18036
18293
|
var PromotedOneOfCheckboxControl = (props) => {
|
|
18037
18294
|
const { id, selection, setSelection } = props;
|
|
18038
18295
|
const { promoted, other, checkedMeans } = props.promotion;
|
|
@@ -18043,13 +18300,13 @@ var PromotedOneOfCheckboxControl = (props) => {
|
|
|
18043
18300
|
const toggleSelection = () => {
|
|
18044
18301
|
setSelection(checked ? selectionWhenUnchecked : selectionWhenChecked);
|
|
18045
18302
|
};
|
|
18046
|
-
return /* @__PURE__ */
|
|
18303
|
+
return /* @__PURE__ */ jsx96("div", { className: "form-group", children: /* @__PURE__ */ jsx96(Checkbox3, { id, label: title, checked, onChange: toggleSelection }) });
|
|
18047
18304
|
};
|
|
18048
18305
|
var PromotedOneOfCheckboxControl_default = PromotedOneOfCheckboxControl;
|
|
18049
18306
|
|
|
18050
18307
|
// src/legacy/jsonSchemaForm/promotedOneOfSchema/promotedOneOfControl/PromotedOneOfRadioControl.tsx
|
|
18051
18308
|
import { RadioGroup as RadioGroup3 } from "@transferwise/components";
|
|
18052
|
-
import { jsx as
|
|
18309
|
+
import { jsx as jsx97, jsxs as jsxs35 } from "react/jsx-runtime";
|
|
18053
18310
|
function PromotedOneOfRadioControl(props) {
|
|
18054
18311
|
var _a, _b;
|
|
18055
18312
|
const { id, selection, setSelection, promotion, promotedOneOf, title } = props;
|
|
@@ -18066,9 +18323,9 @@ function PromotedOneOfRadioControl(props) {
|
|
|
18066
18323
|
secondary: promotion.other.description
|
|
18067
18324
|
}, getAvatarPropertyForRadioOption(promotion.other))
|
|
18068
18325
|
];
|
|
18069
|
-
return /* @__PURE__ */
|
|
18070
|
-
title && /* @__PURE__ */
|
|
18071
|
-
/* @__PURE__ */
|
|
18326
|
+
return /* @__PURE__ */ jsxs35("div", { className: "form-group", children: [
|
|
18327
|
+
title && /* @__PURE__ */ jsx97("label", { className: "control-label", htmlFor: id, children: title }),
|
|
18328
|
+
/* @__PURE__ */ jsx97(
|
|
18072
18329
|
RadioGroup3,
|
|
18073
18330
|
{
|
|
18074
18331
|
name: "promoted-selection",
|
|
@@ -18086,16 +18343,16 @@ PromotedOneOfRadioControl.defaultProps = {
|
|
|
18086
18343
|
var PromotedOneOfRadioControl_default = PromotedOneOfRadioControl;
|
|
18087
18344
|
|
|
18088
18345
|
// src/legacy/jsonSchemaForm/promotedOneOfSchema/promotedOneOfControl/PromotedOneOfControl.tsx
|
|
18089
|
-
import { Fragment as Fragment16, jsx as
|
|
18346
|
+
import { Fragment as Fragment16, jsx as jsx98 } from "react/jsx-runtime";
|
|
18090
18347
|
function PromotedOneOfControl(props) {
|
|
18091
18348
|
const controlType = props.promotion.control || "radio";
|
|
18092
18349
|
switch (controlType) {
|
|
18093
18350
|
case "radio":
|
|
18094
|
-
return /* @__PURE__ */
|
|
18351
|
+
return /* @__PURE__ */ jsx98(PromotedOneOfRadioControl_default, __spreadValues({}, props));
|
|
18095
18352
|
case "checkbox":
|
|
18096
|
-
return /* @__PURE__ */
|
|
18353
|
+
return /* @__PURE__ */ jsx98(PromotedOneOfCheckboxControl_default, __spreadValues({}, props));
|
|
18097
18354
|
default:
|
|
18098
|
-
return /* @__PURE__ */
|
|
18355
|
+
return /* @__PURE__ */ jsx98(Fragment16, {});
|
|
18099
18356
|
}
|
|
18100
18357
|
}
|
|
18101
18358
|
PromotedOneOfControl.defaultProps = {
|
|
@@ -18105,7 +18362,7 @@ PromotedOneOfControl.defaultProps = {
|
|
|
18105
18362
|
var PromotedOneOfControl_default = PromotedOneOfControl;
|
|
18106
18363
|
|
|
18107
18364
|
// src/legacy/jsonSchemaForm/promotedOneOfSchema/PromotedOneOfSchema.tsx
|
|
18108
|
-
import { Fragment as Fragment17, jsx as
|
|
18365
|
+
import { Fragment as Fragment17, jsx as jsx99, jsxs as jsxs36 } from "react/jsx-runtime";
|
|
18109
18366
|
var isPromoted = (schema) => schema.promoted === true;
|
|
18110
18367
|
var PromotedOneOfSchema = (props) => {
|
|
18111
18368
|
var _a;
|
|
@@ -18116,9 +18373,9 @@ var PromotedOneOfSchema = (props) => {
|
|
|
18116
18373
|
const promotedOneOf = props.schema.oneOf.find(isPromoted);
|
|
18117
18374
|
const promotedObjectSchema = getPromotedObjectSchema(promotedOneOf);
|
|
18118
18375
|
const otherOneOf = getOtherOneOf(props.schema);
|
|
18119
|
-
return /* @__PURE__ */
|
|
18120
|
-
promotedAlert && /* @__PURE__ */
|
|
18121
|
-
/* @__PURE__ */
|
|
18376
|
+
return /* @__PURE__ */ jsxs36(Fragment17, { children: [
|
|
18377
|
+
promotedAlert && /* @__PURE__ */ jsx99(DynamicAlert_default, { component: promotedAlert }),
|
|
18378
|
+
/* @__PURE__ */ jsx99(
|
|
18122
18379
|
PromotedOneOfControl_default,
|
|
18123
18380
|
{
|
|
18124
18381
|
id: props.schema.$id,
|
|
@@ -18129,8 +18386,8 @@ var PromotedOneOfSchema = (props) => {
|
|
|
18129
18386
|
setSelection
|
|
18130
18387
|
}
|
|
18131
18388
|
),
|
|
18132
|
-
selection === "promoted" && /* @__PURE__ */
|
|
18133
|
-
selection === "other" && /* @__PURE__ */
|
|
18389
|
+
selection === "promoted" && /* @__PURE__ */ jsx99(ObjectSchema_default, __spreadProps(__spreadValues({}, props), { schema: promotedObjectSchema })),
|
|
18390
|
+
selection === "other" && /* @__PURE__ */ jsx99(GenericSchema_default, __spreadProps(__spreadValues({}, props), { schema: otherOneOf }))
|
|
18134
18391
|
] });
|
|
18135
18392
|
};
|
|
18136
18393
|
function getPromotedObjectSchema(promotedSchema) {
|
|
@@ -18179,12 +18436,12 @@ var ReadOnlySchema_messages_default = defineMessages18({
|
|
|
18179
18436
|
});
|
|
18180
18437
|
|
|
18181
18438
|
// src/legacy/jsonSchemaForm/readOnlySchema/ReadOnlySchema.tsx
|
|
18182
|
-
import { Fragment as Fragment18, jsx as
|
|
18439
|
+
import { Fragment as Fragment18, jsx as jsx100, jsxs as jsxs37 } from "react/jsx-runtime";
|
|
18183
18440
|
function ReadOnlySchema({ schema, model }) {
|
|
18184
18441
|
const { title = "" } = schema;
|
|
18185
18442
|
const { formatMessage } = useIntl20();
|
|
18186
18443
|
const value = getValueForSchema({ schema, model, formatMessage });
|
|
18187
|
-
return /* @__PURE__ */
|
|
18444
|
+
return /* @__PURE__ */ jsx100(DefinitionList2, { layout: Layout.VERTICAL_ONE_COLUMN, definitions: [{ title, value, key: "" }] });
|
|
18188
18445
|
}
|
|
18189
18446
|
var ReadOnlySchema_default = ReadOnlySchema;
|
|
18190
18447
|
function getValueForSchema({
|
|
@@ -18217,7 +18474,7 @@ function getSelectedOneOf(schema, model) {
|
|
|
18217
18474
|
function getValueFromOption(option) {
|
|
18218
18475
|
const text = option.title && option.description ? `${option.title} - ${option.description}` : option.title || "";
|
|
18219
18476
|
const icon = getAvatarPropertyForRadioOption({ icon: option.icon });
|
|
18220
|
-
return (icon == null ? void 0 : icon.avatar) ? /* @__PURE__ */
|
|
18477
|
+
return (icon == null ? void 0 : icon.avatar) ? /* @__PURE__ */ jsxs37(Fragment18, { children: [
|
|
18221
18478
|
icon.avatar,
|
|
18222
18479
|
" ",
|
|
18223
18480
|
text
|
|
@@ -18226,7 +18483,7 @@ function getValueFromOption(option) {
|
|
|
18226
18483
|
|
|
18227
18484
|
// src/legacy/jsonSchemaForm/validationAsyncSchema/ValidationAsyncSchema.tsx
|
|
18228
18485
|
import { useEffect as useEffect14, useRef as useRef3, useState as useState21 } from "react";
|
|
18229
|
-
import { jsx as
|
|
18486
|
+
import { jsx as jsx101 } from "react/jsx-runtime";
|
|
18230
18487
|
function ValidationAsyncSchema(props) {
|
|
18231
18488
|
const { schema, model, required = false, submitted, errors, onChange } = props;
|
|
18232
18489
|
const [validationAsyncModel, setValidationAsyncModel] = useState21(model);
|
|
@@ -18310,12 +18567,12 @@ function ValidationAsyncSchema(props) {
|
|
|
18310
18567
|
required,
|
|
18311
18568
|
schema
|
|
18312
18569
|
};
|
|
18313
|
-
return /* @__PURE__ */
|
|
18570
|
+
return /* @__PURE__ */ jsx101(BasicTypeSchema_default, __spreadValues({}, basicTypeSchemaProps));
|
|
18314
18571
|
}
|
|
18315
18572
|
var ValidationAsyncSchema_default = ValidationAsyncSchema;
|
|
18316
18573
|
|
|
18317
18574
|
// src/legacy/jsonSchemaForm/genericSchema/GenericSchema.tsx
|
|
18318
|
-
import { Fragment as Fragment19, jsx as
|
|
18575
|
+
import { Fragment as Fragment19, jsx as jsx102 } from "react/jsx-runtime";
|
|
18319
18576
|
import { createElement } from "react";
|
|
18320
18577
|
function GenericSchemaForm(props) {
|
|
18321
18578
|
const { schema, model = null, errors = null, hideTitle = false, disabled = false } = props;
|
|
@@ -18332,29 +18589,29 @@ function GenericSchemaForm(props) {
|
|
|
18332
18589
|
}, [JSON.stringify(schema), JSON.stringify(model), JSON.stringify(errors), type, log]);
|
|
18333
18590
|
switch (type) {
|
|
18334
18591
|
case "readOnly":
|
|
18335
|
-
return /* @__PURE__ */
|
|
18592
|
+
return /* @__PURE__ */ jsx102(ReadOnlySchema_default, __spreadValues({}, schemaProps));
|
|
18336
18593
|
case "persistAsync":
|
|
18337
|
-
return /* @__PURE__ */
|
|
18594
|
+
return /* @__PURE__ */ jsx102(PersistAsyncSchema_default, __spreadValues({}, schemaProps));
|
|
18338
18595
|
case "validationAsync":
|
|
18339
|
-
return /* @__PURE__ */
|
|
18596
|
+
return /* @__PURE__ */ jsx102(ValidationAsyncSchema_default, __spreadValues({}, schemaProps));
|
|
18340
18597
|
case "basic": {
|
|
18341
18598
|
const basicTypeProps = __spreadValues({
|
|
18342
18599
|
infoMessage: null
|
|
18343
18600
|
}, schemaProps);
|
|
18344
|
-
return /* @__PURE__ */
|
|
18601
|
+
return /* @__PURE__ */ jsx102(BasicTypeSchema_default, __spreadValues({}, basicTypeProps));
|
|
18345
18602
|
}
|
|
18346
18603
|
case "object":
|
|
18347
18604
|
return /* @__PURE__ */ createElement(ObjectSchema_default, __spreadProps(__spreadValues({}, schemaProps), { key: JSON.stringify(schema) }));
|
|
18348
18605
|
case "array":
|
|
18349
|
-
return /* @__PURE__ */
|
|
18606
|
+
return /* @__PURE__ */ jsx102(ArraySchema_default, __spreadValues({}, schemaProps));
|
|
18350
18607
|
case "promotedOneOf":
|
|
18351
|
-
return /* @__PURE__ */
|
|
18608
|
+
return /* @__PURE__ */ jsx102(PromotedOneOfSchema_default, __spreadValues({}, schemaProps));
|
|
18352
18609
|
case "oneOf":
|
|
18353
|
-
return /* @__PURE__ */
|
|
18610
|
+
return /* @__PURE__ */ jsx102(OneOfSchema_default, __spreadValues({}, schemaProps));
|
|
18354
18611
|
case "allOf":
|
|
18355
|
-
return /* @__PURE__ */
|
|
18612
|
+
return /* @__PURE__ */ jsx102(AllOfSchema_default, __spreadValues({}, schemaProps));
|
|
18356
18613
|
}
|
|
18357
|
-
return /* @__PURE__ */
|
|
18614
|
+
return /* @__PURE__ */ jsx102(Fragment19, {});
|
|
18358
18615
|
}
|
|
18359
18616
|
var GenericSchema_default = GenericSchemaForm;
|
|
18360
18617
|
var isValidGenericSchema = (schema, model, errors) => {
|
|
@@ -18381,7 +18638,7 @@ var isValidGenericSchema = (schema, model, errors) => {
|
|
|
18381
18638
|
};
|
|
18382
18639
|
|
|
18383
18640
|
// src/legacy/layout/form/DynamicForm.tsx
|
|
18384
|
-
import { jsx as
|
|
18641
|
+
import { jsx as jsx103 } from "react/jsx-runtime";
|
|
18385
18642
|
function DynamicForm({
|
|
18386
18643
|
component,
|
|
18387
18644
|
model = null,
|
|
@@ -18391,7 +18648,7 @@ function DynamicForm({
|
|
|
18391
18648
|
onPersistAsync
|
|
18392
18649
|
}) {
|
|
18393
18650
|
const formSchema = component.schema;
|
|
18394
|
-
return /* @__PURE__ */
|
|
18651
|
+
return /* @__PURE__ */ jsx103("div", { className: getMargin2(component.margin || "md"), children: /* @__PURE__ */ jsx103(
|
|
18395
18652
|
GenericSchema_default,
|
|
18396
18653
|
{
|
|
18397
18654
|
schema: formSchema,
|
|
@@ -18408,68 +18665,82 @@ function DynamicForm({
|
|
|
18408
18665
|
var DynamicForm_default = DynamicForm;
|
|
18409
18666
|
|
|
18410
18667
|
// src/legacy/layout/heading/DynamicHeading.tsx
|
|
18411
|
-
var
|
|
18668
|
+
var import_classnames14 = __toESM(require_classnames());
|
|
18412
18669
|
import { Display as Display2 } from "@transferwise/components";
|
|
18413
|
-
import { jsx as
|
|
18670
|
+
import { jsx as jsx104 } from "react/jsx-runtime";
|
|
18414
18671
|
var DynamicHeading = (props) => {
|
|
18415
18672
|
const { text, size: size2 = "md", align = "left", margin = "md", control } = props.component;
|
|
18416
|
-
const classes = (0,
|
|
18417
|
-
return control === "display" ? /* @__PURE__ */
|
|
18673
|
+
const classes = (0, import_classnames14.default)(getTextAlignmentAndMargin2({ align, margin }));
|
|
18674
|
+
return control === "display" ? /* @__PURE__ */ jsx104(DisplayHeading2, { size: size2, text, classes }) : /* @__PURE__ */ jsx104(StandardHeading2, { size: size2, text, classes });
|
|
18418
18675
|
};
|
|
18419
18676
|
var StandardHeading2 = ({ size: size2, text, classes }) => {
|
|
18420
18677
|
switch (size2) {
|
|
18421
18678
|
case "xs":
|
|
18422
|
-
return /* @__PURE__ */
|
|
18679
|
+
return /* @__PURE__ */ jsx104("h5", { className: classes, children: text });
|
|
18423
18680
|
case "sm":
|
|
18424
|
-
return /* @__PURE__ */
|
|
18681
|
+
return /* @__PURE__ */ jsx104("h4", { className: classes, children: text });
|
|
18425
18682
|
case "lg":
|
|
18426
|
-
return /* @__PURE__ */
|
|
18683
|
+
return /* @__PURE__ */ jsx104("h2", { className: classes, children: text });
|
|
18427
18684
|
case "xl":
|
|
18428
|
-
return /* @__PURE__ */
|
|
18685
|
+
return /* @__PURE__ */ jsx104("h1", { className: classes, children: text });
|
|
18429
18686
|
case "md":
|
|
18430
18687
|
default:
|
|
18431
|
-
return /* @__PURE__ */
|
|
18688
|
+
return /* @__PURE__ */ jsx104("h3", { className: classes, children: text });
|
|
18432
18689
|
}
|
|
18433
18690
|
};
|
|
18434
18691
|
var DisplayHeading2 = ({ size: size2, text, classes }) => {
|
|
18435
18692
|
switch (size2) {
|
|
18436
18693
|
case "xs":
|
|
18437
18694
|
case "sm":
|
|
18438
|
-
return /* @__PURE__ */
|
|
18695
|
+
return /* @__PURE__ */ jsx104(Display2, { type: "display-small", className: classes, children: text });
|
|
18439
18696
|
case "xl":
|
|
18440
18697
|
case "lg":
|
|
18441
|
-
return /* @__PURE__ */
|
|
18698
|
+
return /* @__PURE__ */ jsx104(Display2, { type: "display-large", className: classes, children: text });
|
|
18442
18699
|
case "md":
|
|
18443
18700
|
default:
|
|
18444
|
-
return /* @__PURE__ */
|
|
18701
|
+
return /* @__PURE__ */ jsx104(Display2, { type: "display-medium", className: classes, children: text });
|
|
18445
18702
|
}
|
|
18446
18703
|
};
|
|
18447
18704
|
var DynamicHeading_default = DynamicHeading;
|
|
18448
18705
|
|
|
18449
18706
|
// src/legacy/layout/markdown/DynamicMarkdown.tsx
|
|
18450
18707
|
import { Markdown as Markdown7 } from "@transferwise/components";
|
|
18451
|
-
import { jsx as
|
|
18708
|
+
import { jsx as jsx105 } from "react/jsx-runtime";
|
|
18452
18709
|
var DynamicMarkdown = ({ component }) => {
|
|
18453
18710
|
const { content, align, margin } = component;
|
|
18454
|
-
return /* @__PURE__ */
|
|
18711
|
+
return /* @__PURE__ */ jsx105("div", { className: getTextAlignmentAndMargin2({ align, margin }), children: /* @__PURE__ */ jsx105(Markdown7, { config: { link: { target: "_blank" } }, children: content }) });
|
|
18455
18712
|
};
|
|
18456
18713
|
var DynamicInfo = ({ component }) => {
|
|
18457
|
-
return /* @__PURE__ */
|
|
18714
|
+
return /* @__PURE__ */ jsx105("div", { className: getTextAlignmentAndMargin2(component), children: /* @__PURE__ */ jsx105(Markdown7, { config: { link: { target: "_blank" } }, children: component.markdown }) });
|
|
18458
18715
|
};
|
|
18459
18716
|
|
|
18460
18717
|
// src/legacy/layout/image/DynamicImage.tsx
|
|
18461
18718
|
import { Image as Image2 } from "@transferwise/components";
|
|
18462
18719
|
import { useEffect as useEffect16, useState as useState22 } from "react";
|
|
18463
|
-
import { jsx as
|
|
18720
|
+
import { jsx as jsx106 } from "react/jsx-runtime";
|
|
18464
18721
|
function DynamicImage({ component: image }) {
|
|
18465
|
-
|
|
18722
|
+
var _a, _b, _c;
|
|
18723
|
+
const { content, url, size: size2, text, margin, accessibilityDescription } = image;
|
|
18466
18724
|
const httpClient = useHttpClient();
|
|
18467
18725
|
const [imageSource, setImageSource] = useState22("");
|
|
18468
18726
|
useEffect16(() => {
|
|
18469
|
-
|
|
18470
|
-
|
|
18727
|
+
if (content) {
|
|
18728
|
+
const { uri, url: contentUrl } = content;
|
|
18729
|
+
if (uri && !uri.startsWith("urn:")) {
|
|
18730
|
+
void getImageSource2(httpClient, uri).then(setImageSource);
|
|
18731
|
+
return;
|
|
18732
|
+
}
|
|
18733
|
+
if (contentUrl) {
|
|
18734
|
+
void getImageSource2(httpClient, contentUrl).then(setImageSource);
|
|
18735
|
+
return;
|
|
18736
|
+
}
|
|
18737
|
+
}
|
|
18738
|
+
if (url) {
|
|
18739
|
+
void getImageSource2(httpClient, url).then(setImageSource);
|
|
18740
|
+
}
|
|
18741
|
+
}, [content, url, httpClient]);
|
|
18471
18742
|
const imageProps = {
|
|
18472
|
-
alt: accessibilityDescription
|
|
18743
|
+
alt: (_c = (_b = (_a = content == null ? void 0 : content.accessibilityDescription) != null ? _a : accessibilityDescription) != null ? _b : text) != null ? _c : "",
|
|
18473
18744
|
src: imageSource,
|
|
18474
18745
|
stretch: true,
|
|
18475
18746
|
shrink: true
|
|
@@ -18477,7 +18748,7 @@ function DynamicImage({ component: image }) {
|
|
|
18477
18748
|
if (!imageSource) {
|
|
18478
18749
|
return null;
|
|
18479
18750
|
}
|
|
18480
|
-
return /* @__PURE__ */
|
|
18751
|
+
return /* @__PURE__ */ jsx106("div", { className: `df-image ${size2 || "md"}`, children: /* @__PURE__ */ jsx106(Image2, __spreadValues({ className: `img-responsive ${getMargin2(margin || "md")}` }, imageProps)) });
|
|
18481
18752
|
}
|
|
18482
18753
|
var readImageBlobAsDataURL2 = (imageBlob) => (
|
|
18483
18754
|
// we can safely assume the type of reader.result is string
|
|
@@ -18513,48 +18784,48 @@ var getImageSource2 = async (httpClient, imageUrl) => {
|
|
|
18513
18784
|
var DynamicImage_default = DynamicImage;
|
|
18514
18785
|
|
|
18515
18786
|
// src/legacy/layout/instructions/DynamicInstructions.tsx
|
|
18516
|
-
import { Header as
|
|
18517
|
-
import { jsx as
|
|
18787
|
+
import { Header as Header13, InstructionsList as InstructionsList2 } from "@transferwise/components";
|
|
18788
|
+
import { jsx as jsx107, jsxs as jsxs38 } from "react/jsx-runtime";
|
|
18518
18789
|
var doContext2 = ["positive", "neutral"];
|
|
18519
18790
|
var dontContext2 = ["warning", "negative"];
|
|
18520
18791
|
var DynamicInstructions = ({ component }) => {
|
|
18521
18792
|
const { items } = component;
|
|
18522
18793
|
const dos = items.filter((item) => doContext2.includes(item.context)).map(({ text }) => text);
|
|
18523
18794
|
const donts = items.filter((item) => dontContext2.includes(item.context)).map(({ text }) => text);
|
|
18524
|
-
return /* @__PURE__ */
|
|
18525
|
-
component.title ? /* @__PURE__ */
|
|
18526
|
-
/* @__PURE__ */
|
|
18795
|
+
return /* @__PURE__ */ jsxs38("div", { className: getMargin2(component.margin || "md"), children: [
|
|
18796
|
+
component.title ? /* @__PURE__ */ jsx107(Header13, { title: component.title }) : null,
|
|
18797
|
+
/* @__PURE__ */ jsx107(InstructionsList2, { dos, donts })
|
|
18527
18798
|
] });
|
|
18528
18799
|
};
|
|
18529
18800
|
var DynamicInstructions_default = DynamicInstructions;
|
|
18530
18801
|
|
|
18531
18802
|
// src/legacy/layout/DynamicLayout.tsx
|
|
18532
|
-
import { Fragment as Fragment20, jsx as
|
|
18803
|
+
import { Fragment as Fragment20, jsx as jsx108 } from "react/jsx-runtime";
|
|
18533
18804
|
var getKey = (component) => JSON.stringify(component);
|
|
18534
18805
|
function DynamicLayout(props) {
|
|
18535
18806
|
const { components, model, submitted, errors, onModelChange, onAction, onPersistAsync, baseUrl } = props;
|
|
18536
18807
|
const renderComponent = (component) => {
|
|
18537
18808
|
switch (component.type) {
|
|
18538
18809
|
case "heading":
|
|
18539
|
-
return /* @__PURE__ */
|
|
18810
|
+
return /* @__PURE__ */ jsx108(DynamicHeading_default, { component }, getKey(component));
|
|
18540
18811
|
case "paragraph":
|
|
18541
|
-
return /* @__PURE__ */
|
|
18812
|
+
return /* @__PURE__ */ jsx108(DynamicParagraph_default, { component }, getKey(component));
|
|
18542
18813
|
case "image":
|
|
18543
|
-
return /* @__PURE__ */
|
|
18814
|
+
return /* @__PURE__ */ jsx108(DynamicImage_default, { component }, getKey(component));
|
|
18544
18815
|
case "alert":
|
|
18545
|
-
return /* @__PURE__ */
|
|
18816
|
+
return /* @__PURE__ */ jsx108(DynamicAlert_default, { component, onAction }, getKey(component));
|
|
18546
18817
|
case "review":
|
|
18547
|
-
return /* @__PURE__ */
|
|
18818
|
+
return /* @__PURE__ */ jsx108(DynamicReview_default, { component, onAction }, getKey(component));
|
|
18548
18819
|
case "divider":
|
|
18549
|
-
return /* @__PURE__ */
|
|
18820
|
+
return /* @__PURE__ */ jsx108(DynamicDivider_default, { component }, getKey(component));
|
|
18550
18821
|
case "info":
|
|
18551
|
-
return /* @__PURE__ */
|
|
18822
|
+
return /* @__PURE__ */ jsx108(DynamicInfo, { component }, getKey(component));
|
|
18552
18823
|
case "instructions":
|
|
18553
|
-
return /* @__PURE__ */
|
|
18824
|
+
return /* @__PURE__ */ jsx108(DynamicInstructions_default, { component }, getKey(component));
|
|
18554
18825
|
case "markdown":
|
|
18555
|
-
return /* @__PURE__ */
|
|
18826
|
+
return /* @__PURE__ */ jsx108(DynamicMarkdown, { component }, getKey(component));
|
|
18556
18827
|
case "columns":
|
|
18557
|
-
return /* @__PURE__ */
|
|
18828
|
+
return /* @__PURE__ */ jsx108(
|
|
18558
18829
|
DynamicColumns_default,
|
|
18559
18830
|
{
|
|
18560
18831
|
component,
|
|
@@ -18568,7 +18839,7 @@ function DynamicLayout(props) {
|
|
|
18568
18839
|
getKey(component)
|
|
18569
18840
|
);
|
|
18570
18841
|
case "form":
|
|
18571
|
-
return /* @__PURE__ */
|
|
18842
|
+
return /* @__PURE__ */ jsx108(
|
|
18572
18843
|
DynamicForm_default,
|
|
18573
18844
|
{
|
|
18574
18845
|
component,
|
|
@@ -18581,9 +18852,9 @@ function DynamicLayout(props) {
|
|
|
18581
18852
|
getKey(__spreadProps(__spreadValues({}, component), { errors: errors != null ? errors : null }))
|
|
18582
18853
|
);
|
|
18583
18854
|
case "button":
|
|
18584
|
-
return /* @__PURE__ */
|
|
18855
|
+
return /* @__PURE__ */ jsx108(DynamicButton_default, { component, onAction }, getKey(component));
|
|
18585
18856
|
case "box":
|
|
18586
|
-
return /* @__PURE__ */
|
|
18857
|
+
return /* @__PURE__ */ jsx108(
|
|
18587
18858
|
DynamicBox_default,
|
|
18588
18859
|
{
|
|
18589
18860
|
component,
|
|
@@ -18597,18 +18868,18 @@ function DynamicLayout(props) {
|
|
|
18597
18868
|
getKey(component)
|
|
18598
18869
|
);
|
|
18599
18870
|
case "decision":
|
|
18600
|
-
return /* @__PURE__ */
|
|
18871
|
+
return /* @__PURE__ */ jsx108(DynamicDecision_default, { component, onAction }, getKey(component));
|
|
18601
18872
|
case "external":
|
|
18602
|
-
return /* @__PURE__ */
|
|
18873
|
+
return /* @__PURE__ */ jsx108(DynamicExternal_default, { component, onAction }, getKey(component));
|
|
18603
18874
|
case "list":
|
|
18604
18875
|
case "status-list":
|
|
18605
|
-
return /* @__PURE__ */
|
|
18876
|
+
return /* @__PURE__ */ jsx108(DynamicStatusList_default, { component, onAction }, getKey(component));
|
|
18606
18877
|
case "loading-indicator":
|
|
18607
|
-
return /* @__PURE__ */
|
|
18878
|
+
return /* @__PURE__ */ jsx108(DynamicLoadingIndicator_default, { component }, getKey(component));
|
|
18608
18879
|
case "search":
|
|
18609
|
-
return /* @__PURE__ */
|
|
18880
|
+
return /* @__PURE__ */ jsx108(DynamicSearch_default, { component, onAction }, getKey(component));
|
|
18610
18881
|
case "modal":
|
|
18611
|
-
return /* @__PURE__ */
|
|
18882
|
+
return /* @__PURE__ */ jsx108(
|
|
18612
18883
|
DynamicModal_default,
|
|
18613
18884
|
{
|
|
18614
18885
|
component,
|
|
@@ -18622,22 +18893,22 @@ function DynamicLayout(props) {
|
|
|
18622
18893
|
getKey(component)
|
|
18623
18894
|
);
|
|
18624
18895
|
default:
|
|
18625
|
-
return /* @__PURE__ */
|
|
18896
|
+
return /* @__PURE__ */ jsx108("div", {}, getKey(component));
|
|
18626
18897
|
}
|
|
18627
18898
|
};
|
|
18628
18899
|
if (useHasHttpClientProvider() || baseUrl == null) {
|
|
18629
|
-
return /* @__PURE__ */
|
|
18900
|
+
return /* @__PURE__ */ jsx108(Fragment20, { children: components.map(renderComponent) });
|
|
18630
18901
|
}
|
|
18631
|
-
return /* @__PURE__ */
|
|
18902
|
+
return /* @__PURE__ */ jsx108(HttpClientProviderFromBaseUrl, { baseUrl, children: components.map(renderComponent) });
|
|
18632
18903
|
}
|
|
18633
18904
|
var DynamicLayout_default = DynamicLayout;
|
|
18634
18905
|
|
|
18635
18906
|
// src/legacy/layout/list/DynamicStatusList.tsx
|
|
18636
|
-
import { Header as
|
|
18637
|
-
import { jsx as
|
|
18907
|
+
import { Header as Header14, Summary as Summary2 } from "@transferwise/components";
|
|
18908
|
+
import { jsx as jsx109, jsxs as jsxs39 } from "react/jsx-runtime";
|
|
18638
18909
|
var DynamicStatusList = ({ component, onAction }) => {
|
|
18639
|
-
return /* @__PURE__ */
|
|
18640
|
-
component.title ? /* @__PURE__ */
|
|
18910
|
+
return /* @__PURE__ */ jsxs39("div", { className: getMargin2(component.margin || "md"), children: [
|
|
18911
|
+
component.title ? /* @__PURE__ */ jsx109(Header14, { title: component.title, className: "m-b-2" }) : null,
|
|
18641
18912
|
component.items.map((item) => mapListItemToSummary(item, onAction))
|
|
18642
18913
|
] });
|
|
18643
18914
|
};
|
|
@@ -18647,8 +18918,8 @@ var mapListItemToSummary = (props, onAction) => {
|
|
|
18647
18918
|
title,
|
|
18648
18919
|
description,
|
|
18649
18920
|
action: "callToAction" in props ? callToActionToSummaryAction(props == null ? void 0 : props.callToAction, onAction) : void 0
|
|
18650
|
-
}, (icon == null ? void 0 : icon.name) ? { icon: /* @__PURE__ */
|
|
18651
|
-
return /* @__PURE__ */
|
|
18921
|
+
}, (icon == null ? void 0 : icon.name) ? { icon: /* @__PURE__ */ jsx109(DynamicIcon_default2, { type: icon.name }) } : {}), status ? { status: statusMap[status] } : {});
|
|
18922
|
+
return /* @__PURE__ */ jsx109(Summary2, __spreadValues({}, summaryProps), `${title}/${description || ""}`);
|
|
18652
18923
|
};
|
|
18653
18924
|
var callToActionToSummaryAction = (callToAction, onAction) => {
|
|
18654
18925
|
if (!callToAction) {
|
|
@@ -18718,10 +18989,10 @@ var DynamicStatusList_default = DynamicStatusList;
|
|
|
18718
18989
|
|
|
18719
18990
|
// src/legacy/layout/loadingIndicator/DynamicLoadingIndicator.tsx
|
|
18720
18991
|
import { Loader as Loader3 } from "@transferwise/components";
|
|
18721
|
-
import { jsx as
|
|
18992
|
+
import { jsx as jsx110 } from "react/jsx-runtime";
|
|
18722
18993
|
var DynamicLoadingIndicator = ({ component }) => {
|
|
18723
18994
|
const { margin = "md", size: size2 = "md" } = component;
|
|
18724
|
-
return /* @__PURE__ */
|
|
18995
|
+
return /* @__PURE__ */ jsx110(
|
|
18725
18996
|
Loader3,
|
|
18726
18997
|
{
|
|
18727
18998
|
size: size2,
|
|
@@ -18764,12 +19035,12 @@ function noop3() {
|
|
|
18764
19035
|
}
|
|
18765
19036
|
|
|
18766
19037
|
// src/legacy/layout/paragraph/DynamicParagraph.tsx
|
|
18767
|
-
import { jsx as
|
|
19038
|
+
import { jsx as jsx111, jsxs as jsxs40 } from "react/jsx-runtime";
|
|
18768
19039
|
function DynamicParagraph({ component }) {
|
|
18769
|
-
return component.control === "copyable" ? /* @__PURE__ */
|
|
19040
|
+
return component.control === "copyable" ? /* @__PURE__ */ jsx111(CopyableDynamicParagraph, { component }) : /* @__PURE__ */ jsx111(BasicDynamicParagraph, { component });
|
|
18770
19041
|
}
|
|
18771
19042
|
function BasicDynamicParagraph({ component }) {
|
|
18772
|
-
return /* @__PURE__ */
|
|
19043
|
+
return /* @__PURE__ */ jsx111("p", { className: `np-text-body-large ${getTextAlignmentAndMargin2(component)}`, children: component.text });
|
|
18773
19044
|
}
|
|
18774
19045
|
function CopyableDynamicParagraph({ component }) {
|
|
18775
19046
|
const { formatMessage } = useIntl21();
|
|
@@ -18779,22 +19050,22 @@ function CopyableDynamicParagraph({ component }) {
|
|
|
18779
19050
|
var _a;
|
|
18780
19051
|
(_a = navigator.clipboard) == null ? void 0 : _a.writeText(text).then(() => createSnackbar({ text: formatMessage(paragraph_messages_default2.copied) })).catch(noop4);
|
|
18781
19052
|
};
|
|
18782
|
-
const
|
|
19053
|
+
const classNames17 = `${getTextAlignmentAndMargin2({
|
|
18783
19054
|
align: component.align,
|
|
18784
19055
|
margin: "sm"
|
|
18785
19056
|
})} form-control`;
|
|
18786
|
-
return /* @__PURE__ */
|
|
18787
|
-
/* @__PURE__ */
|
|
19057
|
+
return /* @__PURE__ */ jsxs40("div", { className: getTextAlignmentAndMargin2(component), children: [
|
|
19058
|
+
/* @__PURE__ */ jsx111(
|
|
18788
19059
|
"input",
|
|
18789
19060
|
{
|
|
18790
19061
|
type: "text",
|
|
18791
|
-
className:
|
|
19062
|
+
className: classNames17,
|
|
18792
19063
|
value: text,
|
|
18793
19064
|
readOnly: true,
|
|
18794
19065
|
style: { textOverflow: "ellipsis" }
|
|
18795
19066
|
}
|
|
18796
19067
|
),
|
|
18797
|
-
/* @__PURE__ */
|
|
19068
|
+
/* @__PURE__ */ jsx111(Button9, { block: true, onClick: copy, children: formatMessage(paragraph_messages_default2.copy) })
|
|
18798
19069
|
] });
|
|
18799
19070
|
}
|
|
18800
19071
|
function noop4() {
|
|
@@ -18802,8 +19073,8 @@ function noop4() {
|
|
|
18802
19073
|
var DynamicParagraph_default = DynamicParagraph;
|
|
18803
19074
|
|
|
18804
19075
|
// src/legacy/layout/review/DynamicReview.tsx
|
|
18805
|
-
import { DefinitionList as DefinitionList3, Header as
|
|
18806
|
-
import { Fragment as Fragment21, jsx as
|
|
19076
|
+
import { DefinitionList as DefinitionList3, Header as Header15 } from "@transferwise/components";
|
|
19077
|
+
import { Fragment as Fragment21, jsx as jsx112, jsxs as jsxs41 } from "react/jsx-runtime";
|
|
18807
19078
|
var getDefinitions = (orientation, review) => review.fields.map(({ label, value, help }, index) => ({
|
|
18808
19079
|
key: String(index),
|
|
18809
19080
|
title: label,
|
|
@@ -18811,14 +19082,14 @@ var getDefinitions = (orientation, review) => review.fields.map(({ label, value,
|
|
|
18811
19082
|
}));
|
|
18812
19083
|
var getFieldValue2 = (value, help, orientation) => {
|
|
18813
19084
|
if (help) {
|
|
18814
|
-
return orientation === "HORIZONTAL_RIGHT_ALIGNED" ? /* @__PURE__ */
|
|
18815
|
-
/* @__PURE__ */
|
|
19085
|
+
return orientation === "HORIZONTAL_RIGHT_ALIGNED" ? /* @__PURE__ */ jsxs41(Fragment21, { children: [
|
|
19086
|
+
/* @__PURE__ */ jsx112(Help_default2, { help }),
|
|
18816
19087
|
" ",
|
|
18817
19088
|
value
|
|
18818
|
-
] }) : /* @__PURE__ */
|
|
19089
|
+
] }) : /* @__PURE__ */ jsxs41(Fragment21, { children: [
|
|
18819
19090
|
value,
|
|
18820
19091
|
" ",
|
|
18821
|
-
/* @__PURE__ */
|
|
19092
|
+
/* @__PURE__ */ jsx112(Help_default2, { help })
|
|
18822
19093
|
] });
|
|
18823
19094
|
}
|
|
18824
19095
|
return value;
|
|
@@ -18851,7 +19122,7 @@ function DynamicReview({ component: review, onAction }) {
|
|
|
18851
19122
|
const { action: behaviorAction2 } = behavior;
|
|
18852
19123
|
return {
|
|
18853
19124
|
text: title != null ? title : "",
|
|
18854
|
-
onClick: behaviorAction2 ?
|
|
19125
|
+
onClick: behaviorAction2 ? getOnClick2(behaviorAction2) : void 0
|
|
18855
19126
|
};
|
|
18856
19127
|
}
|
|
18857
19128
|
case "link": {
|
|
@@ -18866,7 +19137,7 @@ function DynamicReview({ component: review, onAction }) {
|
|
|
18866
19137
|
if (behaviorAction) {
|
|
18867
19138
|
return {
|
|
18868
19139
|
text: title != null ? title : "",
|
|
18869
|
-
onClick: behaviorAction ?
|
|
19140
|
+
onClick: behaviorAction ? getOnClick2(behaviorAction) : void 0
|
|
18870
19141
|
};
|
|
18871
19142
|
}
|
|
18872
19143
|
if (link) {
|
|
@@ -18878,10 +19149,10 @@ function DynamicReview({ component: review, onAction }) {
|
|
|
18878
19149
|
}
|
|
18879
19150
|
return {
|
|
18880
19151
|
text: title != null ? title : "",
|
|
18881
|
-
onClick: action ?
|
|
19152
|
+
onClick: action ? getOnClick2(action) : void 0
|
|
18882
19153
|
};
|
|
18883
19154
|
};
|
|
18884
|
-
const
|
|
19155
|
+
const getOnClick2 = (action) => {
|
|
18885
19156
|
return (event) => {
|
|
18886
19157
|
event.preventDefault();
|
|
18887
19158
|
if (action) {
|
|
@@ -18891,10 +19162,10 @@ function DynamicReview({ component: review, onAction }) {
|
|
|
18891
19162
|
};
|
|
18892
19163
|
const orientation = getDefinitionListLayout(review);
|
|
18893
19164
|
const callToAction = review.callToAction ? getReviewAction3(review.callToAction) : null;
|
|
18894
|
-
const legacyCallToAction = !callToAction && review.action ? { text: (_a = review.action.title) != null ? _a : "", onClick:
|
|
18895
|
-
return /* @__PURE__ */
|
|
18896
|
-
review.title && /* @__PURE__ */
|
|
18897
|
-
/* @__PURE__ */
|
|
19165
|
+
const legacyCallToAction = !callToAction && review.action ? { text: (_a = review.action.title) != null ? _a : "", onClick: getOnClick2(review.action) } : null;
|
|
19166
|
+
return /* @__PURE__ */ jsxs41("div", { className: margin, children: [
|
|
19167
|
+
review.title && /* @__PURE__ */ jsx112(Header15, { title: review.title, action: (_b = callToAction != null ? callToAction : legacyCallToAction) != null ? _b : void 0 }),
|
|
19168
|
+
/* @__PURE__ */ jsx112("div", { className: margin, children: /* @__PURE__ */ jsx112(DefinitionList3, { layout: orientation, definitions: getDefinitions(orientation, review) }) })
|
|
18898
19169
|
] });
|
|
18899
19170
|
}
|
|
18900
19171
|
var DynamicReview_default = DynamicReview;
|
|
@@ -18905,11 +19176,11 @@ import { Search as Search2 } from "@transferwise/icons";
|
|
|
18905
19176
|
|
|
18906
19177
|
// src/legacy/layout/search/SearchInput.tsx
|
|
18907
19178
|
import { Input as Input6 } from "@transferwise/components";
|
|
18908
|
-
import { jsx as
|
|
19179
|
+
import { jsx as jsx113, jsxs as jsxs42 } from "react/jsx-runtime";
|
|
18909
19180
|
var SearchInput = ({ title, value, onFocus, onChange }) => {
|
|
18910
|
-
return /* @__PURE__ */
|
|
19181
|
+
return /* @__PURE__ */ jsxs42("label", { className: "control-label d-inline", children: [
|
|
18911
19182
|
title,
|
|
18912
|
-
/* @__PURE__ */
|
|
19183
|
+
/* @__PURE__ */ jsx113(
|
|
18913
19184
|
Input6,
|
|
18914
19185
|
{
|
|
18915
19186
|
type: "text",
|
|
@@ -18925,12 +19196,12 @@ var SearchInput = ({ title, value, onFocus, onChange }) => {
|
|
|
18925
19196
|
// src/legacy/layout/search/SearchResults.tsx
|
|
18926
19197
|
import { NavigationOption as NavigationOption7, NavigationOptionsList as NavigationOptionsList4 } from "@transferwise/components";
|
|
18927
19198
|
import { useIntl as useIntl22 } from "react-intl";
|
|
18928
|
-
import { jsx as
|
|
19199
|
+
import { jsx as jsx114, jsxs as jsxs43 } from "react/jsx-runtime";
|
|
18929
19200
|
function SearchResults2({ results, emptyMessage, onSelect }) {
|
|
18930
19201
|
if (results.length === 0) {
|
|
18931
|
-
return /* @__PURE__ */
|
|
19202
|
+
return /* @__PURE__ */ jsx114("p", { className: "m-t-2", children: emptyMessage });
|
|
18932
19203
|
}
|
|
18933
|
-
return /* @__PURE__ */
|
|
19204
|
+
return /* @__PURE__ */ jsx114(NavigationOptionsList4, { children: results.map((result) => /* @__PURE__ */ jsx114(
|
|
18934
19205
|
NavigationOption7,
|
|
18935
19206
|
{
|
|
18936
19207
|
title: result.title,
|
|
@@ -18945,10 +19216,10 @@ function SearchResults2({ results, emptyMessage, onSelect }) {
|
|
|
18945
19216
|
}
|
|
18946
19217
|
function ErrorResult2({ onRetrySearch }) {
|
|
18947
19218
|
const intl = useIntl22();
|
|
18948
|
-
return /* @__PURE__ */
|
|
19219
|
+
return /* @__PURE__ */ jsxs43("p", { className: "m-t-2", children: [
|
|
18949
19220
|
intl.formatMessage(generic_error_messages_default.genericError),
|
|
18950
19221
|
"\xA0",
|
|
18951
|
-
/* @__PURE__ */
|
|
19222
|
+
/* @__PURE__ */ jsx114(
|
|
18952
19223
|
"a",
|
|
18953
19224
|
{
|
|
18954
19225
|
href: "/",
|
|
@@ -19032,7 +19303,7 @@ var addQueryParameter2 = (url, key, value) => {
|
|
|
19032
19303
|
};
|
|
19033
19304
|
|
|
19034
19305
|
// src/legacy/layout/search/DynamicSearch.tsx
|
|
19035
|
-
var
|
|
19306
|
+
var import_classnames15 = __toESM(require_classnames());
|
|
19036
19307
|
import { Markdown as Markdown8, Typeahead as Typeahead2 } from "@transferwise/components";
|
|
19037
19308
|
import { useIntl as useIntl23 } from "react-intl";
|
|
19038
19309
|
|
|
@@ -19047,7 +19318,7 @@ var search_messages_default2 = defineMessages20({
|
|
|
19047
19318
|
});
|
|
19048
19319
|
|
|
19049
19320
|
// src/legacy/layout/search/DynamicSearch.tsx
|
|
19050
|
-
import { jsx as
|
|
19321
|
+
import { jsx as jsx115, jsxs as jsxs44 } from "react/jsx-runtime";
|
|
19051
19322
|
var DEBOUNCE_TIME2 = 400;
|
|
19052
19323
|
function DynamicSearch({ component, onAction }) {
|
|
19053
19324
|
const [query, setQuery] = useState24("");
|
|
@@ -19085,9 +19356,9 @@ function DynamicSearch({ component, onAction }) {
|
|
|
19085
19356
|
};
|
|
19086
19357
|
const loadingMessage = intl.formatMessage(search_messages_default2.loading);
|
|
19087
19358
|
if (control === "inline") {
|
|
19088
|
-
return /* @__PURE__ */
|
|
19359
|
+
return /* @__PURE__ */ jsx115("div", { className: (0, import_classnames15.default)(getMargin2(margin != null ? margin : "md"), "df-search-typeahead"), children: /* @__PURE__ */ jsxs44("label", { className: "control-label d-inline", children: [
|
|
19089
19360
|
title,
|
|
19090
|
-
/* @__PURE__ */
|
|
19361
|
+
/* @__PURE__ */ jsx115("div", { className: "m-t-1", children: /* @__PURE__ */ jsx115(
|
|
19091
19362
|
Typeahead2,
|
|
19092
19363
|
{
|
|
19093
19364
|
id: "typeahead-input-id",
|
|
@@ -19095,7 +19366,7 @@ function DynamicSearch({ component, onAction }) {
|
|
|
19095
19366
|
name: "typeahead-input-name",
|
|
19096
19367
|
size: "md",
|
|
19097
19368
|
maxHeight: 100,
|
|
19098
|
-
footer: /* @__PURE__ */
|
|
19369
|
+
footer: /* @__PURE__ */ jsx115(
|
|
19099
19370
|
TypeaheadFooter2,
|
|
19100
19371
|
{
|
|
19101
19372
|
state: status,
|
|
@@ -19107,7 +19378,7 @@ function DynamicSearch({ component, onAction }) {
|
|
|
19107
19378
|
),
|
|
19108
19379
|
multiple: false,
|
|
19109
19380
|
clearable: false,
|
|
19110
|
-
addon: /* @__PURE__ */
|
|
19381
|
+
addon: /* @__PURE__ */ jsx115(Search2, { size: 24 }),
|
|
19111
19382
|
options: results.map(mapResultToTypeaheadOption2),
|
|
19112
19383
|
onChange: (values) => {
|
|
19113
19384
|
if (values.length > 0) {
|
|
@@ -19122,11 +19393,11 @@ function DynamicSearch({ component, onAction }) {
|
|
|
19122
19393
|
) })
|
|
19123
19394
|
] }) });
|
|
19124
19395
|
}
|
|
19125
|
-
return /* @__PURE__ */
|
|
19126
|
-
/* @__PURE__ */
|
|
19127
|
-
status === "loading" && /* @__PURE__ */
|
|
19128
|
-
status === "error" && /* @__PURE__ */
|
|
19129
|
-
status === "success" && /* @__PURE__ */
|
|
19396
|
+
return /* @__PURE__ */ jsxs44("div", { className: getMargin2(margin != null ? margin : "md"), children: [
|
|
19397
|
+
/* @__PURE__ */ jsx115(SearchInput, { title, value: query, onChange, onFocus: onSearchStart }),
|
|
19398
|
+
status === "loading" && /* @__PURE__ */ jsx115(DynamicLoadingIndicator_default, { component: { type: "loading-indicator", size: "sm" } }),
|
|
19399
|
+
status === "error" && /* @__PURE__ */ jsx115(ErrorResult2, { onRetrySearch }),
|
|
19400
|
+
status === "success" && /* @__PURE__ */ jsx115(SearchResults2, { results, emptyMessage, onSelect: onResultSelected })
|
|
19130
19401
|
] });
|
|
19131
19402
|
}
|
|
19132
19403
|
function mapResultToTypeaheadOption2(result) {
|
|
@@ -19146,13 +19417,13 @@ function TypeaheadFooter2({
|
|
|
19146
19417
|
onRetrySearch
|
|
19147
19418
|
}) {
|
|
19148
19419
|
if (state === "success" && results.length === 0) {
|
|
19149
|
-
return /* @__PURE__ */
|
|
19420
|
+
return /* @__PURE__ */ jsx115(Markdown8, { className: "m-t-2 m-x-2", config: { link: { target: "_blank" } }, children: emptyMessage });
|
|
19150
19421
|
}
|
|
19151
19422
|
if (state === "error" && results.length === 0) {
|
|
19152
|
-
return /* @__PURE__ */
|
|
19423
|
+
return /* @__PURE__ */ jsx115("div", { className: "m-t-2 m-x-2", children: /* @__PURE__ */ jsx115(ErrorResult2, { onRetrySearch }) });
|
|
19153
19424
|
}
|
|
19154
19425
|
if (state === "loading" || results.length === 0) {
|
|
19155
|
-
return /* @__PURE__ */
|
|
19426
|
+
return /* @__PURE__ */ jsx115("p", { className: "m-t-2 m-x-2", children: loadingMessage });
|
|
19156
19427
|
}
|
|
19157
19428
|
return null;
|
|
19158
19429
|
}
|
|
@@ -19161,21 +19432,21 @@ var DynamicSearch_default = DynamicSearch;
|
|
|
19161
19432
|
// src/legacy/layout/modal/DynamicModal.tsx
|
|
19162
19433
|
import { Button as Button10, Modal as Modal4 } from "@transferwise/components";
|
|
19163
19434
|
import { useState as useState25 } from "react";
|
|
19164
|
-
import { jsx as
|
|
19435
|
+
import { jsx as jsx116, jsxs as jsxs45 } from "react/jsx-runtime";
|
|
19165
19436
|
function DynamicModal(props) {
|
|
19166
19437
|
const [visible, isVisible] = useState25(false);
|
|
19167
19438
|
const { component, onAction } = props;
|
|
19168
19439
|
const { margin = "md" } = component;
|
|
19169
|
-
return /* @__PURE__ */
|
|
19170
|
-
/* @__PURE__ */
|
|
19171
|
-
/* @__PURE__ */
|
|
19440
|
+
return /* @__PURE__ */ jsxs45("div", { className: getTextAlignmentAndMargin2({ margin }), children: [
|
|
19441
|
+
/* @__PURE__ */ jsx116(Button10, { priority: "tertiary", block: true, onClick: () => isVisible(true), children: component.trigger.title }),
|
|
19442
|
+
/* @__PURE__ */ jsx116(
|
|
19172
19443
|
Modal4,
|
|
19173
19444
|
{
|
|
19174
19445
|
scroll: "content",
|
|
19175
19446
|
open: visible,
|
|
19176
19447
|
size: "lg",
|
|
19177
19448
|
title: component.content.title,
|
|
19178
|
-
body: /* @__PURE__ */
|
|
19449
|
+
body: /* @__PURE__ */ jsx116(
|
|
19179
19450
|
DynamicLayout_default,
|
|
19180
19451
|
__spreadProps(__spreadValues({}, props), {
|
|
19181
19452
|
components: component.content.components,
|
|
@@ -19193,7 +19464,7 @@ function DynamicModal(props) {
|
|
|
19193
19464
|
var DynamicModal_default = DynamicModal;
|
|
19194
19465
|
|
|
19195
19466
|
// src/legacy/jsonSchemaForm/basicTypeSchema/BasicTypeSchema.tsx
|
|
19196
|
-
import { Fragment as Fragment22, jsx as
|
|
19467
|
+
import { Fragment as Fragment22, jsx as jsx117, jsxs as jsxs46 } from "react/jsx-runtime";
|
|
19197
19468
|
var isNullish3 = (value) => isNull3(value) || isUndefined3(value);
|
|
19198
19469
|
var getDefaultValue = (schema) => {
|
|
19199
19470
|
return schema.type === "boolean" && isNullish3(schema.default) ? false : schema.default;
|
|
@@ -19271,15 +19542,15 @@ var BasicTypeSchema = (props) => {
|
|
|
19271
19542
|
const schemaHelp = props.schema.help;
|
|
19272
19543
|
const feedbackId = `${id}-feedback`;
|
|
19273
19544
|
const labelId = `${id}-label`;
|
|
19274
|
-
return !isHidden ? /* @__PURE__ */
|
|
19275
|
-
props.schema.alert && /* @__PURE__ */
|
|
19276
|
-
/* @__PURE__ */
|
|
19277
|
-
showLabel && /* @__PURE__ */
|
|
19278
|
-
/* @__PURE__ */
|
|
19279
|
-
!!schemaHelp && /* @__PURE__ */
|
|
19545
|
+
return !isHidden ? /* @__PURE__ */ jsxs46(Fragment22, { children: [
|
|
19546
|
+
props.schema.alert && /* @__PURE__ */ jsx117(DynamicAlert_default, { component: props.schema.alert }),
|
|
19547
|
+
/* @__PURE__ */ jsxs46("div", { className: (0, import_classnames16.default)(formGroupClasses), children: [
|
|
19548
|
+
showLabel && /* @__PURE__ */ jsxs46("div", { className: "d-inline-block m-b-1", children: [
|
|
19549
|
+
/* @__PURE__ */ jsx117("label", { className: "control-label d-inline", htmlFor: id, id: labelId, children: props.schema.title }),
|
|
19550
|
+
!!schemaHelp && /* @__PURE__ */ jsx117(Help_default2, { help: schemaHelp })
|
|
19280
19551
|
] }),
|
|
19281
|
-
!showLabel && !!schemaHelp && /* @__PURE__ */
|
|
19282
|
-
/* @__PURE__ */
|
|
19552
|
+
!showLabel && !!schemaHelp && /* @__PURE__ */ jsx117(Help_default2, { help: schemaHelp }),
|
|
19553
|
+
/* @__PURE__ */ jsx117(
|
|
19283
19554
|
SchemaFormControl_default,
|
|
19284
19555
|
{
|
|
19285
19556
|
id,
|
|
@@ -19293,7 +19564,7 @@ var BasicTypeSchema = (props) => {
|
|
|
19293
19564
|
labelledBy: labelId
|
|
19294
19565
|
}
|
|
19295
19566
|
),
|
|
19296
|
-
/* @__PURE__ */
|
|
19567
|
+
/* @__PURE__ */ jsx117(
|
|
19297
19568
|
ControlFeedback_default,
|
|
19298
19569
|
{
|
|
19299
19570
|
id: feedbackId,
|
|
@@ -19313,7 +19584,7 @@ var BasicTypeSchema = (props) => {
|
|
|
19313
19584
|
var BasicTypeSchema_default = BasicTypeSchema;
|
|
19314
19585
|
|
|
19315
19586
|
// src/legacy/jsonSchemaForm/persistAsyncSchema/persistAsyncBasicSchema/PersistAsyncBasicSchema.tsx
|
|
19316
|
-
import { jsx as
|
|
19587
|
+
import { jsx as jsx118 } from "react/jsx-runtime";
|
|
19317
19588
|
var getIdFromResponse = (idProperty, response) => response[idProperty];
|
|
19318
19589
|
var getErrorFromResponse = (errorProperty, response) => {
|
|
19319
19590
|
var _a;
|
|
@@ -19403,7 +19674,7 @@ function PersistAsyncBasicSchema(props) {
|
|
|
19403
19674
|
setPersistAsyncModel(newPersistAsyncModel);
|
|
19404
19675
|
}
|
|
19405
19676
|
};
|
|
19406
|
-
return /* @__PURE__ */
|
|
19677
|
+
return /* @__PURE__ */ jsx118(
|
|
19407
19678
|
BasicTypeSchema_default,
|
|
19408
19679
|
{
|
|
19409
19680
|
required,
|
|
@@ -19617,7 +19888,7 @@ function useStepPolling(polling, onAction) {
|
|
|
19617
19888
|
}
|
|
19618
19889
|
|
|
19619
19890
|
// src/legacy/step/layoutStep/LayoutStep.tsx
|
|
19620
|
-
import { jsx as
|
|
19891
|
+
import { jsx as jsx119 } from "react/jsx-runtime";
|
|
19621
19892
|
var getComponents = (step, options) => {
|
|
19622
19893
|
var _a;
|
|
19623
19894
|
if (isEmpty(step)) {
|
|
@@ -19640,7 +19911,7 @@ var LayoutStep = (props) => {
|
|
|
19640
19911
|
onEvent("Dynamic Flow - onAction supressed", { reason: "LayoutStep - loading state" });
|
|
19641
19912
|
};
|
|
19642
19913
|
useStepPolling(stepSpecification.polling, onAction);
|
|
19643
|
-
return /* @__PURE__ */
|
|
19914
|
+
return /* @__PURE__ */ jsx119(
|
|
19644
19915
|
DynamicLayout_default,
|
|
19645
19916
|
{
|
|
19646
19917
|
components,
|
|
@@ -19726,15 +19997,15 @@ var CameraCapture_messages_default = defineMessages21({
|
|
|
19726
19997
|
// src/common/cameraCapture/components/bottomBar/BottomBar.tsx
|
|
19727
19998
|
import { Button as Button11, ControlType, Priority, Size as Size3 } from "@transferwise/components";
|
|
19728
19999
|
import { useIntl as useIntl26 } from "react-intl";
|
|
19729
|
-
import { jsx as
|
|
19730
|
-
var CaptureBottomBar = ({ onCapture }) => /* @__PURE__ */
|
|
20000
|
+
import { jsx as jsx120, jsxs as jsxs47 } from "react/jsx-runtime";
|
|
20001
|
+
var CaptureBottomBar = ({ onCapture }) => /* @__PURE__ */ jsx120("div", { className: "bottom-bar", children: /* @__PURE__ */ jsx120(CaptureButton, { onClick: onCapture }) });
|
|
19731
20002
|
var ReviewBottomBar = ({
|
|
19732
20003
|
onSubmit,
|
|
19733
20004
|
onRetry
|
|
19734
20005
|
}) => {
|
|
19735
20006
|
const intl = useIntl26();
|
|
19736
|
-
return /* @__PURE__ */
|
|
19737
|
-
/* @__PURE__ */
|
|
20007
|
+
return /* @__PURE__ */ jsx120("div", { className: "bottom-bar p-x-2", children: /* @__PURE__ */ jsx120("div", { className: "row", children: /* @__PURE__ */ jsxs47("div", { className: "col-xs-12 col-md-6 col-md-offset-3", children: [
|
|
20008
|
+
/* @__PURE__ */ jsx120(
|
|
19738
20009
|
Button11,
|
|
19739
20010
|
{
|
|
19740
20011
|
className: "m-b-1",
|
|
@@ -19745,7 +20016,7 @@ var ReviewBottomBar = ({
|
|
|
19745
20016
|
children: intl.formatMessage(CameraCapture_messages_default.reviewSubmit)
|
|
19746
20017
|
}
|
|
19747
20018
|
),
|
|
19748
|
-
/* @__PURE__ */
|
|
20019
|
+
/* @__PURE__ */ jsx120(
|
|
19749
20020
|
Button11,
|
|
19750
20021
|
{
|
|
19751
20022
|
className: "m-b-2",
|
|
@@ -19759,14 +20030,14 @@ var ReviewBottomBar = ({
|
|
|
19759
20030
|
)
|
|
19760
20031
|
] }) }) });
|
|
19761
20032
|
};
|
|
19762
|
-
var CaptureButton = ({ onClick }) => /* @__PURE__ */
|
|
20033
|
+
var CaptureButton = ({ onClick }) => /* @__PURE__ */ jsx120(
|
|
19763
20034
|
"button",
|
|
19764
20035
|
{
|
|
19765
20036
|
type: "button",
|
|
19766
20037
|
className: "camera-capture-btn m-b-2",
|
|
19767
20038
|
"data-testid": "camera-capture-button",
|
|
19768
20039
|
onClick,
|
|
19769
|
-
children: /* @__PURE__ */
|
|
20040
|
+
children: /* @__PURE__ */ jsx120("span", { className: "camera-capture-btn-inner" })
|
|
19770
20041
|
}
|
|
19771
20042
|
);
|
|
19772
20043
|
|
|
@@ -19784,11 +20055,11 @@ var OrientationLockOverlay_messages_default = defineMessages22({
|
|
|
19784
20055
|
});
|
|
19785
20056
|
|
|
19786
20057
|
// src/common/cameraCapture/components/orientationLockOverlay/OrientationLockOverlay.tsx
|
|
19787
|
-
import { jsx as
|
|
20058
|
+
import { jsx as jsx121, jsxs as jsxs48 } from "react/jsx-runtime";
|
|
19788
20059
|
function OrientationLockOverlay() {
|
|
19789
20060
|
const intl = useIntl27();
|
|
19790
|
-
return /* @__PURE__ */
|
|
19791
|
-
/* @__PURE__ */
|
|
20061
|
+
return /* @__PURE__ */ jsxs48("div", { className: "orientation-lock-overlay", children: [
|
|
20062
|
+
/* @__PURE__ */ jsx121(
|
|
19792
20063
|
"img",
|
|
19793
20064
|
{
|
|
19794
20065
|
className: "m-b-3",
|
|
@@ -19798,7 +20069,7 @@ function OrientationLockOverlay() {
|
|
|
19798
20069
|
alt: ""
|
|
19799
20070
|
}
|
|
19800
20071
|
),
|
|
19801
|
-
/* @__PURE__ */
|
|
20072
|
+
/* @__PURE__ */ jsx121("p", { className: "text-center m-b-0", children: intl.formatMessage(OrientationLockOverlay_messages_default.text) })
|
|
19802
20073
|
] });
|
|
19803
20074
|
}
|
|
19804
20075
|
var OrientationLockOverlay_default = OrientationLockOverlay;
|
|
@@ -19973,7 +20244,7 @@ var getVideoConstraints = async (dir) => {
|
|
|
19973
20244
|
|
|
19974
20245
|
// src/common/cameraCapture/overlay/Overlay.tsx
|
|
19975
20246
|
import { useEffect as useEffect23, useRef as useRef7 } from "react";
|
|
19976
|
-
import { Fragment as Fragment23, jsx as
|
|
20247
|
+
import { Fragment as Fragment23, jsx as jsx122, jsxs as jsxs49 } from "react/jsx-runtime";
|
|
19977
20248
|
var captureButtonHeight = 92;
|
|
19978
20249
|
var reviewButtonsHeight = 120;
|
|
19979
20250
|
var imageHeight = 40;
|
|
@@ -19995,18 +20266,18 @@ function Overlay({ overlay, outline, imageUrl, title, instructions, reviewInstru
|
|
|
19995
20266
|
return () => window.removeEventListener("resize", listener);
|
|
19996
20267
|
});
|
|
19997
20268
|
let helperBoxHeight = (imageUrl ? imageHeight : 0) + (title ? titleHeight : 0) + (instructions ? instructionsHeight : 0);
|
|
19998
|
-
let helperBox = /* @__PURE__ */
|
|
19999
|
-
imageUrl && /* @__PURE__ */
|
|
20000
|
-
title && /* @__PURE__ */
|
|
20001
|
-
instructions && /* @__PURE__ */
|
|
20269
|
+
let helperBox = /* @__PURE__ */ jsxs49(Fragment23, { children: [
|
|
20270
|
+
imageUrl && /* @__PURE__ */ jsx122("img", { className: "camera-capture-img", src: imageUrl, alt: "" }),
|
|
20271
|
+
title && /* @__PURE__ */ jsx122("h4", { className: "camera-capture-title", children: title }),
|
|
20272
|
+
instructions && /* @__PURE__ */ jsx122("small", { className: "camera-capture-instructions", children: instructions })
|
|
20002
20273
|
] });
|
|
20003
20274
|
const frameBottomMargin = captureButtonHeight + helperBoxHeight;
|
|
20004
20275
|
if (reviewInstructions) {
|
|
20005
20276
|
helperBoxHeight = frameBottomMargin - reviewButtonsHeight;
|
|
20006
|
-
helperBox = /* @__PURE__ */
|
|
20277
|
+
helperBox = /* @__PURE__ */ jsx122("small", { className: "camera-capture-instructions", children: reviewInstructions });
|
|
20007
20278
|
const frameWithReviewInstructionsMinBottomMargin = reviewButtonsHeight + reviewInstructionsHeight;
|
|
20008
20279
|
if (frameBottomMargin < frameWithReviewInstructionsMinBottomMargin) {
|
|
20009
|
-
helperBox = /* @__PURE__ */
|
|
20280
|
+
helperBox = /* @__PURE__ */ jsx122(Fragment23, {});
|
|
20010
20281
|
}
|
|
20011
20282
|
}
|
|
20012
20283
|
const framePosition = {
|
|
@@ -20024,32 +20295,32 @@ function Overlay({ overlay, outline, imageUrl, title, instructions, reviewInstru
|
|
|
20024
20295
|
width: "90%"
|
|
20025
20296
|
}
|
|
20026
20297
|
};
|
|
20027
|
-
return /* @__PURE__ */
|
|
20028
|
-
/* @__PURE__ */
|
|
20029
|
-
/* @__PURE__ */
|
|
20030
|
-
/* @__PURE__ */
|
|
20298
|
+
return /* @__PURE__ */ jsxs49("svg", { ref: svgReference, xmlns: "http://www.w3.org/2000/svg", children: [
|
|
20299
|
+
/* @__PURE__ */ jsx122("defs", { children: /* @__PURE__ */ jsxs49("mask", { id: "mask", children: [
|
|
20300
|
+
/* @__PURE__ */ jsx122("rect", { width: "100%", height: "100%", fill: "#fff" }),
|
|
20301
|
+
/* @__PURE__ */ jsx122("image", __spreadValues({ href: overlay }, framePosition))
|
|
20031
20302
|
] }) }),
|
|
20032
|
-
overlay && /* @__PURE__ */
|
|
20033
|
-
outline && /* @__PURE__ */
|
|
20034
|
-
/* @__PURE__ */
|
|
20303
|
+
overlay && /* @__PURE__ */ jsx122("rect", { width: "100%", height: "100%", mask: "url(#mask)", fillOpacity: "0.72" }),
|
|
20304
|
+
outline && /* @__PURE__ */ jsx122("image", __spreadValues({ href: outline }, framePosition)),
|
|
20305
|
+
/* @__PURE__ */ jsx122("foreignObject", { width: "100%", height: "100%", children: /* @__PURE__ */ jsx122("div", __spreadProps(__spreadValues({ className: "camera-capture-text-and-image-container" }, helperBoxPosition), { children: helperBox })) })
|
|
20035
20306
|
] });
|
|
20036
20307
|
}
|
|
20037
20308
|
var Overlay_default = Overlay;
|
|
20038
20309
|
|
|
20039
20310
|
// src/common/cameraCapture/screens/cameraErrorScreen/CameraErrorScreen.tsx
|
|
20040
20311
|
import { Button as Button12 } from "@transferwise/components";
|
|
20041
|
-
import { jsx as
|
|
20312
|
+
import { jsx as jsx123, jsxs as jsxs50 } from "react/jsx-runtime";
|
|
20042
20313
|
function CameraErrorScreen({ title, description, actionButton, onAction }) {
|
|
20043
|
-
return /* @__PURE__ */
|
|
20044
|
-
/* @__PURE__ */
|
|
20045
|
-
/* @__PURE__ */
|
|
20046
|
-
onAction && actionButton && /* @__PURE__ */
|
|
20314
|
+
return /* @__PURE__ */ jsx123("div", { className: "container p-t-5", children: /* @__PURE__ */ jsx123("div", { className: "row", children: /* @__PURE__ */ jsxs50("div", { className: "col-md-6 col-md-offset-3", children: [
|
|
20315
|
+
/* @__PURE__ */ jsx123("h2", { className: "text-xs-center m-b-3", children: title }),
|
|
20316
|
+
/* @__PURE__ */ jsx123("p", { className: "text-xs-center m-b-5", children: description }),
|
|
20317
|
+
onAction && actionButton && /* @__PURE__ */ jsx123(Button12, { block: true, onClick: onAction, children: actionButton })
|
|
20047
20318
|
] }) }) });
|
|
20048
20319
|
}
|
|
20049
20320
|
var CameraErrorScreen_default = CameraErrorScreen;
|
|
20050
20321
|
|
|
20051
20322
|
// src/common/cameraCapture/CameraCapture.tsx
|
|
20052
|
-
import { jsx as
|
|
20323
|
+
import { jsx as jsx124, jsxs as jsxs51 } from "react/jsx-runtime";
|
|
20053
20324
|
function CameraCapture({
|
|
20054
20325
|
direction = "back",
|
|
20055
20326
|
overlay = "",
|
|
@@ -20157,8 +20428,8 @@ function CameraCapture({
|
|
|
20157
20428
|
exitFullScreen();
|
|
20158
20429
|
}
|
|
20159
20430
|
}, [mode, exitFullScreen]);
|
|
20160
|
-
const captureScreen = /* @__PURE__ */
|
|
20161
|
-
videoConstraints && /* @__PURE__ */
|
|
20431
|
+
const captureScreen = /* @__PURE__ */ jsxs51("div", { className: "camera-capture", children: [
|
|
20432
|
+
videoConstraints && /* @__PURE__ */ jsx124(
|
|
20162
20433
|
Webcam,
|
|
20163
20434
|
{
|
|
20164
20435
|
ref: webcamReference,
|
|
@@ -20169,7 +20440,7 @@ function CameraCapture({
|
|
|
20169
20440
|
onUserMedia: handleUserMedia
|
|
20170
20441
|
}
|
|
20171
20442
|
),
|
|
20172
|
-
/* @__PURE__ */
|
|
20443
|
+
/* @__PURE__ */ jsx124(
|
|
20173
20444
|
Overlay_default,
|
|
20174
20445
|
{
|
|
20175
20446
|
overlay,
|
|
@@ -20179,8 +20450,8 @@ function CameraCapture({
|
|
|
20179
20450
|
instructions
|
|
20180
20451
|
}
|
|
20181
20452
|
),
|
|
20182
|
-
shouldLockOrientation && /* @__PURE__ */
|
|
20183
|
-
ready && /* @__PURE__ */
|
|
20453
|
+
shouldLockOrientation && /* @__PURE__ */ jsx124(OrientationLockOverlay_default, {}),
|
|
20454
|
+
ready && /* @__PURE__ */ jsx124(
|
|
20184
20455
|
CaptureBottomBar,
|
|
20185
20456
|
{
|
|
20186
20457
|
onCapture: () => {
|
|
@@ -20189,9 +20460,9 @@ function CameraCapture({
|
|
|
20189
20460
|
}
|
|
20190
20461
|
)
|
|
20191
20462
|
] });
|
|
20192
|
-
const reviewScreen = /* @__PURE__ */
|
|
20193
|
-
/* @__PURE__ */
|
|
20194
|
-
/* @__PURE__ */
|
|
20463
|
+
const reviewScreen = /* @__PURE__ */ jsxs51("div", { className: "camera-capture", children: [
|
|
20464
|
+
/* @__PURE__ */ jsx124("img", { className: "review-image", src: reviewImage == null ? void 0 : reviewImage.source, alt: "" }),
|
|
20465
|
+
/* @__PURE__ */ jsx124(
|
|
20195
20466
|
Overlay_default,
|
|
20196
20467
|
{
|
|
20197
20468
|
overlay,
|
|
@@ -20201,18 +20472,18 @@ function CameraCapture({
|
|
|
20201
20472
|
reviewInstructions: intl.formatMessage(CameraCapture_messages_default.reviewInstructions)
|
|
20202
20473
|
}
|
|
20203
20474
|
),
|
|
20204
|
-
/* @__PURE__ */
|
|
20475
|
+
/* @__PURE__ */ jsx124(ReviewBottomBar, { onSubmit: handleReviewSubmit, onRetry: handleReviewRetry })
|
|
20205
20476
|
] });
|
|
20206
|
-
return /* @__PURE__ */
|
|
20477
|
+
return /* @__PURE__ */ jsxs51("section", { children: [
|
|
20207
20478
|
mode === "CAPTURE" /* CAPTURE */ && captureScreen,
|
|
20208
20479
|
mode === "REVIEW" /* REVIEW */ && reviewScreen,
|
|
20209
|
-
mode === "ERROR" /* ERROR */ && cameraError && /* @__PURE__ */
|
|
20480
|
+
mode === "ERROR" /* ERROR */ && cameraError && /* @__PURE__ */ jsx124(CameraErrorScreen_default, __spreadValues({}, cameraError))
|
|
20210
20481
|
] });
|
|
20211
20482
|
}
|
|
20212
20483
|
var CameraCapture_default = CameraCapture;
|
|
20213
20484
|
|
|
20214
20485
|
// src/legacy/step/cameraStep/CameraStep.tsx
|
|
20215
|
-
import { jsx as
|
|
20486
|
+
import { jsx as jsx125 } from "react/jsx-runtime";
|
|
20216
20487
|
function blobToBase64(blob) {
|
|
20217
20488
|
return new Promise((resolve, _) => {
|
|
20218
20489
|
const reader = new FileReader();
|
|
@@ -20250,7 +20521,7 @@ function CameraStep(props) {
|
|
|
20250
20521
|
});
|
|
20251
20522
|
}
|
|
20252
20523
|
};
|
|
20253
|
-
return /* @__PURE__ */
|
|
20524
|
+
return /* @__PURE__ */ jsx125(
|
|
20254
20525
|
CameraCapture_default,
|
|
20255
20526
|
{
|
|
20256
20527
|
overlay,
|
|
@@ -20327,12 +20598,12 @@ var external_confirmation_messages_default2 = defineMessages23({
|
|
|
20327
20598
|
});
|
|
20328
20599
|
|
|
20329
20600
|
// src/legacy/step/externalConfirmationStep/ExternalConfirmationStep.tsx
|
|
20330
|
-
import { jsx as
|
|
20601
|
+
import { jsx as jsx126 } from "react/jsx-runtime";
|
|
20331
20602
|
var noop6 = () => {
|
|
20332
20603
|
};
|
|
20333
20604
|
function ExternalConfirmationStep({ url, onClose }) {
|
|
20334
20605
|
const { formatMessage } = useIntl29();
|
|
20335
|
-
return /* @__PURE__ */
|
|
20606
|
+
return /* @__PURE__ */ jsx126(
|
|
20336
20607
|
DynamicLayout_default,
|
|
20337
20608
|
{
|
|
20338
20609
|
components: [
|
|
@@ -20399,9 +20670,9 @@ function getOrigin2(url) {
|
|
|
20399
20670
|
// src/legacy/dynamicFlow/BackButton.tsx
|
|
20400
20671
|
import { Avatar as Avatar7 } from "@transferwise/components";
|
|
20401
20672
|
import { ArrowLeft as ArrowLeft2 } from "@transferwise/icons";
|
|
20402
|
-
import { jsx as
|
|
20673
|
+
import { jsx as jsx127, jsxs as jsxs52 } from "react/jsx-runtime";
|
|
20403
20674
|
function BackButton2({ title, action, onAction }) {
|
|
20404
|
-
return /* @__PURE__ */
|
|
20675
|
+
return /* @__PURE__ */ jsx127("div", { className: "m-b-2", children: /* @__PURE__ */ jsxs52(
|
|
20405
20676
|
"a",
|
|
20406
20677
|
{
|
|
20407
20678
|
href: "/",
|
|
@@ -20412,8 +20683,8 @@ function BackButton2({ title, action, onAction }) {
|
|
|
20412
20683
|
onAction(__spreadProps(__spreadValues({}, action), { skipValidation: true }));
|
|
20413
20684
|
},
|
|
20414
20685
|
children: [
|
|
20415
|
-
/* @__PURE__ */
|
|
20416
|
-
/* @__PURE__ */
|
|
20686
|
+
/* @__PURE__ */ jsx127("span", { className: "sr-only", children: title }),
|
|
20687
|
+
/* @__PURE__ */ jsx127(Avatar7, { type: "icon", children: /* @__PURE__ */ jsx127(ArrowLeft2, { size: "24" }) })
|
|
20417
20688
|
]
|
|
20418
20689
|
}
|
|
20419
20690
|
) });
|
|
@@ -20421,7 +20692,7 @@ function BackButton2({ title, action, onAction }) {
|
|
|
20421
20692
|
var BackButton_default2 = BackButton2;
|
|
20422
20693
|
|
|
20423
20694
|
// src/legacy/dynamicFlow/DynamicFlowStep.tsx
|
|
20424
|
-
import { Fragment as Fragment24, jsx as
|
|
20695
|
+
import { Fragment as Fragment24, jsx as jsx128, jsxs as jsxs53 } from "react/jsx-runtime";
|
|
20425
20696
|
function DynamicFlowStep(props) {
|
|
20426
20697
|
var _a, _b, _c;
|
|
20427
20698
|
const { step, globalError, onAction } = props;
|
|
@@ -20430,20 +20701,20 @@ function DynamicFlowStep(props) {
|
|
|
20430
20701
|
const { requiresManualTrigger, dismissConfirmation } = useExternal2(externalUrl);
|
|
20431
20702
|
if (step === void 0) {
|
|
20432
20703
|
if (globalError) {
|
|
20433
|
-
return /* @__PURE__ */
|
|
20704
|
+
return /* @__PURE__ */ jsx128(DynamicAlert_default, { component: { context: "negative", markdown: globalError, margin: "lg" } });
|
|
20434
20705
|
}
|
|
20435
20706
|
return null;
|
|
20436
20707
|
}
|
|
20437
20708
|
if (externalUrl && requiresManualTrigger) {
|
|
20438
|
-
return /* @__PURE__ */
|
|
20709
|
+
return /* @__PURE__ */ jsx128(ExternalConfirmationStep_default, { url: externalUrl, onClose: dismissConfirmation });
|
|
20439
20710
|
}
|
|
20440
20711
|
if (isCameraStep(step)) {
|
|
20441
|
-
return /* @__PURE__ */
|
|
20712
|
+
return /* @__PURE__ */ jsx128(CameraStep_default, __spreadProps(__spreadValues({}, props), { step }));
|
|
20442
20713
|
}
|
|
20443
|
-
return /* @__PURE__ */
|
|
20444
|
-
backButton && /* @__PURE__ */
|
|
20445
|
-
globalError ? /* @__PURE__ */
|
|
20446
|
-
/* @__PURE__ */
|
|
20714
|
+
return /* @__PURE__ */ jsxs53(Fragment24, { children: [
|
|
20715
|
+
backButton && /* @__PURE__ */ jsx128(BackButton_default2, __spreadProps(__spreadValues({}, backButton), { onAction })),
|
|
20716
|
+
globalError ? /* @__PURE__ */ jsx128(DynamicAlert_default, { component: { context: "negative", markdown: globalError, margin: "lg" } }) : null,
|
|
20717
|
+
/* @__PURE__ */ jsx128(LayoutStep_default, __spreadProps(__spreadValues({}, props), { stepSpecification: step }))
|
|
20447
20718
|
] });
|
|
20448
20719
|
}
|
|
20449
20720
|
|
|
@@ -20592,7 +20863,7 @@ var isInlineSchema = (schema) => schema !== void 0 && typeof schema === "object"
|
|
|
20592
20863
|
// src/legacy/dynamicFlow/utils/useLoader.tsx
|
|
20593
20864
|
import { Loader as Loader4, Size as Size4 } from "@transferwise/components";
|
|
20594
20865
|
import { useState as useState33 } from "react";
|
|
20595
|
-
import { jsx as
|
|
20866
|
+
import { jsx as jsx129 } from "react/jsx-runtime";
|
|
20596
20867
|
function useLoader(loaderConfig, initialState) {
|
|
20597
20868
|
const config = __spreadValues({
|
|
20598
20869
|
size: Size4.EXTRA_LARGE,
|
|
@@ -20601,7 +20872,7 @@ function useLoader(loaderConfig, initialState) {
|
|
|
20601
20872
|
}, loaderConfig);
|
|
20602
20873
|
const [loadingState, setLoadingState] = useState33(initialState);
|
|
20603
20874
|
const shouldDisplayLoader = config.initial && loadingState === "initial" || config.submission && loadingState === "submission";
|
|
20604
|
-
const loader = shouldDisplayLoader ? /* @__PURE__ */
|
|
20875
|
+
const loader = shouldDisplayLoader ? /* @__PURE__ */ jsx129(
|
|
20605
20876
|
Loader4,
|
|
20606
20877
|
{
|
|
20607
20878
|
size: config.size,
|
|
@@ -20721,7 +20992,7 @@ var useErrorResponse = () => {
|
|
|
20721
20992
|
};
|
|
20722
20993
|
|
|
20723
20994
|
// src/legacy/dynamicFlow/DynamicFlow.tsx
|
|
20724
|
-
import { jsx as
|
|
20995
|
+
import { jsx as jsx130 } from "react/jsx-runtime";
|
|
20725
20996
|
var noop7 = () => {
|
|
20726
20997
|
};
|
|
20727
20998
|
var DynamicFlowComponent = ({
|
|
@@ -20964,7 +21235,7 @@ var DynamicFlowComponent = ({
|
|
|
20964
21235
|
await performAction(action);
|
|
20965
21236
|
}
|
|
20966
21237
|
};
|
|
20967
|
-
return /* @__PURE__ */
|
|
21238
|
+
return /* @__PURE__ */ jsx130(LogProvider, { flowId, stepId: (step == null ? void 0 : step.id) || (step == null ? void 0 : step.key), onLog, children: /* @__PURE__ */ jsx130(EventsContextProvider, { metadata: analyticsMetadata, onEvent, children: /* @__PURE__ */ jsx130(DynamicFlowProvider, { loading: isLoading || isDebouncing, children: /* @__PURE__ */ jsx130(HttpClientProvider, { httpClient, children: /* @__PURE__ */ jsx130(FeatureContextProvider, { features, children: loader !== null ? loader : /* @__PURE__ */ jsx130("div", { id: (step == null ? void 0 : step.id) || (step == null ? void 0 : step.key), className: "dynamic-flow-legacy", children: /* @__PURE__ */ jsx130(
|
|
20968
21239
|
DynamicFlowStep,
|
|
20969
21240
|
{
|
|
20970
21241
|
step,
|
|
@@ -20981,7 +21252,7 @@ var DynamicFlowComponent = ({
|
|
|
20981
21252
|
) }) }) }) }) }) });
|
|
20982
21253
|
};
|
|
20983
21254
|
function DynamicFlow(props) {
|
|
20984
|
-
return /* @__PURE__ */
|
|
21255
|
+
return /* @__PURE__ */ jsx130(ErrorBoundary_default, { onError: props.onError, children: /* @__PURE__ */ jsx130(DynamicFlowComponent, __spreadValues({}, props)) });
|
|
20985
21256
|
}
|
|
20986
21257
|
var DynamicFlow_default = DynamicFlow;
|
|
20987
21258
|
var combineModels2 = (formModels) => Object.values(formModels).reduce((previous, model) => __spreadValues(__spreadValues({}, previous), model), {});
|
|
@@ -20998,19 +21269,19 @@ var shouldTriggerRefresh = (props) => {
|
|
|
20998
21269
|
};
|
|
20999
21270
|
|
|
21000
21271
|
// src/legacy/jsonSchemaForm/JsonSchemaForm.tsx
|
|
21001
|
-
import { jsx as
|
|
21272
|
+
import { jsx as jsx131 } from "react/jsx-runtime";
|
|
21002
21273
|
function JsonSchemaForm(props) {
|
|
21003
21274
|
const schemaProps = __spreadValues({
|
|
21004
21275
|
model: null,
|
|
21005
21276
|
errors: null
|
|
21006
21277
|
}, props);
|
|
21007
21278
|
const { baseUrl = "", onEvent = noop8, onLog = noop8 } = props;
|
|
21008
|
-
return /* @__PURE__ */
|
|
21279
|
+
return /* @__PURE__ */ jsx131(LogProvider, { flowId: "JsonSchemaForm", stepId: "JsonSchemaForm", onLog, children: /* @__PURE__ */ jsx131(
|
|
21009
21280
|
EventsContextProvider,
|
|
21010
21281
|
{
|
|
21011
21282
|
metadata: { flowId: "JsonSchemaForm", stepId: "JsonSchemaForm" },
|
|
21012
21283
|
onEvent,
|
|
21013
|
-
children: /* @__PURE__ */
|
|
21284
|
+
children: /* @__PURE__ */ jsx131(HttpClientProviderFromBaseUrl, { baseUrl, children: /* @__PURE__ */ jsx131(GenericSchema_default, __spreadValues({}, schemaProps)) })
|
|
21014
21285
|
}
|
|
21015
21286
|
) });
|
|
21016
21287
|
}
|