@wise/dynamic-flow-client 2.8.8 → 2.8.10
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 +145 -144
- package/build/main.min.js +1 -1
- package/build/types/{legacy/layout → common}/icon/FlagIcon.d.ts +1 -1
- package/build/types/{legacy/layout → common}/icon/NamedIcon.d.ts +1 -1
- package/build/types/legacy/layout/button/DynamicButton.d.ts +3 -3
- package/build/types/legacy/layout/icon/DynamicIcon.d.ts +1 -1
- package/build/types/revamp/domain/components/BooleanInputComponent.d.ts +8 -0
- package/build/types/revamp/domain/components/DateInputComponent.d.ts +2 -2
- package/build/types/revamp/domain/components/HiddenComponent.d.ts +2 -1
- package/build/types/revamp/domain/components/IntegerInputComponent.d.ts +2 -2
- package/build/types/revamp/domain/components/NumberInputComponent.d.ts +2 -2
- package/build/types/revamp/domain/components/ObjectComponent.d.ts +3 -2
- package/build/types/revamp/domain/components/SelectInputComponent.d.ts +29 -0
- package/build/types/revamp/domain/components/TextInputComponent.d.ts +2 -2
- package/build/types/revamp/domain/components/UploadInputComponent.d.ts +2 -2
- package/build/types/revamp/domain/components/search/SearchComponent.d.ts +25 -0
- package/build/types/revamp/domain/components/utils/debounce.d.ts +6 -0
- package/build/types/revamp/domain/components/utils/isModelPartialOf.d.ts +2 -0
- package/build/types/revamp/domain/{events → features/events}/getAnalyticsEventDispatcher.d.ts +1 -1
- package/build/types/revamp/domain/features/search/getPerformSearchFunction.d.ts +3 -0
- package/build/types/revamp/domain/{validation → features/validation}/validateComponents.d.ts +1 -1
- package/build/types/revamp/domain/{validation → features/validation}/value-checks.d.ts +1 -1
- package/build/types/revamp/domain/mappers/layout/searchLayoutToComponent.d.ts +3 -0
- package/build/types/revamp/domain/mappers/schema/booleanSchemaToComponent.d.ts +5 -0
- package/build/types/revamp/domain/mappers/schema/oneOfSchemaToComponent/oneOfSchemaToComponent.d.ts +5 -0
- package/build/types/revamp/domain/mappers/schema/tests/test-utils.d.ts +4 -2
- package/build/types/revamp/domain/mappers/schema/types.d.ts +3 -1
- package/build/types/revamp/domain/types.d.ts +10 -6
- package/build/types/revamp/dynamic-flow-types.d.ts +1 -1
- package/build/types/revamp/renderers/mappers/booleanInputComponentToProps.d.ts +3 -0
- package/build/types/revamp/renderers/mappers/componentToRendererProps.d.ts +3 -3
- package/build/types/revamp/renderers/mappers/searchComponentToProps.d.ts +3 -0
- package/build/types/revamp/renderers/mappers/selectInputComponentToProps.d.ts +4 -0
- package/build/types/revamp/renderers/types.d.ts +84 -29
- package/build/types/revamp/step/Step.d.ts +4 -2
- package/build/types/revamp/stories/utils/mockSearchHandler.d.ts +1 -0
- package/build/types/revamp/utils/type-utils.d.ts +7 -5
- package/build/types/revamp/wise/renderers/BooleanInputRenderer.d.ts +3 -0
- package/build/types/revamp/wise/renderers/SearchRenderer.d.ts +14 -0
- package/build/types/revamp/wise/renderers/SelectInputRenderer/RadioInputRendererComponent.d.ts +2 -0
- package/build/types/revamp/wise/renderers/SelectInputRenderer/SelectInputRenderer.d.ts +3 -0
- package/build/types/revamp/wise/renderers/SelectInputRenderer/SelectInputRendererComponent.d.ts +2 -0
- package/build/types/revamp/wise/renderers/SelectInputRenderer/TabInputRendererComponent.d.ts +2 -0
- package/build/types/revamp/wise/renderers/components/icon/DynamicIcon.d.ts +6 -0
- package/build/types/revamp/wise/renderers/components/icon/FlagIcon.d.ts +6 -0
- package/build/types/revamp/wise/renderers/components/icon/NamedIcon.d.ts +6 -0
- package/build/types/test-utils/fetch-utils.d.ts +19 -0
- package/package.json +26 -26
- /package/build/types/revamp/domain/{events → features/events}/getLogggingEventDispatcher.d.ts +0 -0
- /package/build/types/revamp/domain/{events → features/events}/index.d.ts +0 -0
- /package/build/types/revamp/domain/{validation → features/validation}/getModelValidationErrors.d.ts +0 -0
- /package/build/types/revamp/domain/{validation → features/validation}/spec-utils.d.ts +0 -0
package/build/main.js
CHANGED
|
@@ -47,43 +47,52 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
47
47
|
));
|
|
48
48
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
49
49
|
|
|
50
|
-
// ../../node_modules/.pnpm/classnames@2.
|
|
50
|
+
// ../../node_modules/.pnpm/classnames@2.5.1/node_modules/classnames/index.js
|
|
51
51
|
var require_classnames = __commonJS({
|
|
52
|
-
"../../node_modules/.pnpm/classnames@2.
|
|
52
|
+
"../../node_modules/.pnpm/classnames@2.5.1/node_modules/classnames/index.js"(exports, module2) {
|
|
53
53
|
"use strict";
|
|
54
54
|
(function() {
|
|
55
55
|
"use strict";
|
|
56
56
|
var hasOwn = {}.hasOwnProperty;
|
|
57
|
-
var nativeCodeString = "[native code]";
|
|
58
57
|
function classNames8() {
|
|
59
|
-
var classes =
|
|
58
|
+
var classes = "";
|
|
60
59
|
for (var i = 0; i < arguments.length; i++) {
|
|
61
60
|
var arg = arguments[i];
|
|
62
|
-
if (
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
61
|
+
if (arg) {
|
|
62
|
+
classes = appendClass(classes, parseValue(arg));
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
return classes;
|
|
66
|
+
}
|
|
67
|
+
function parseValue(arg) {
|
|
68
|
+
if (typeof arg === "string" || typeof arg === "number") {
|
|
69
|
+
return arg;
|
|
70
|
+
}
|
|
71
|
+
if (typeof arg !== "object") {
|
|
72
|
+
return "";
|
|
73
|
+
}
|
|
74
|
+
if (Array.isArray(arg)) {
|
|
75
|
+
return classNames8.apply(null, arg);
|
|
76
|
+
}
|
|
77
|
+
if (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes("[native code]")) {
|
|
78
|
+
return arg.toString();
|
|
79
|
+
}
|
|
80
|
+
var classes = "";
|
|
81
|
+
for (var key in arg) {
|
|
82
|
+
if (hasOwn.call(arg, key) && arg[key]) {
|
|
83
|
+
classes = appendClass(classes, key);
|
|
84
84
|
}
|
|
85
85
|
}
|
|
86
|
-
return classes
|
|
86
|
+
return classes;
|
|
87
|
+
}
|
|
88
|
+
function appendClass(value, newClass) {
|
|
89
|
+
if (!newClass) {
|
|
90
|
+
return value;
|
|
91
|
+
}
|
|
92
|
+
if (value) {
|
|
93
|
+
return value + " " + newClass;
|
|
94
|
+
}
|
|
95
|
+
return value + newClass;
|
|
87
96
|
}
|
|
88
97
|
if (typeof module2 !== "undefined" && module2.exports) {
|
|
89
98
|
classNames8.default = classNames8;
|
|
@@ -200,7 +209,7 @@ var require_react_webcam = __commonJS({
|
|
|
200
209
|
"react"
|
|
201
210
|
);
|
|
202
211
|
var react__WEBPACK_IMPORTED_MODULE_0___default = /* @__PURE__ */ __webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
|
|
203
|
-
var __extends = function() {
|
|
212
|
+
var __extends = /* @__PURE__ */ function() {
|
|
204
213
|
var extendStatics = function(d, b) {
|
|
205
214
|
extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
|
|
206
215
|
d2.__proto__ = b2;
|
|
@@ -2043,12 +2052,12 @@ var import_components2 = require("@transferwise/components");
|
|
|
2043
2052
|
// src/legacy/layout/utils/getNavigationOptionMedia.tsx
|
|
2044
2053
|
var import_components = require("@transferwise/components");
|
|
2045
2054
|
|
|
2046
|
-
// src/
|
|
2055
|
+
// src/common/icon/FlagIcon.tsx
|
|
2047
2056
|
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
2048
2057
|
var isFlagIcon = (name) => isCurrencyFlagIcon(name) || isCountryFlagIcon(name);
|
|
2049
2058
|
var isCurrencyFlagIcon = (name) => currencyCodes.some((currencyCode) => name === `flag-${currencyCode}`);
|
|
2050
2059
|
var isCountryFlagIcon = (name) => countryCodes.some((countryCode) => name === `flag-${countryCode}`);
|
|
2051
|
-
|
|
2060
|
+
function FlagIcon({ name }) {
|
|
2052
2061
|
if (!isFlagIcon(name)) {
|
|
2053
2062
|
return null;
|
|
2054
2063
|
}
|
|
@@ -2058,10 +2067,11 @@ var FlagIcon = ({ name }) => {
|
|
|
2058
2067
|
{
|
|
2059
2068
|
src: `https://wise.com/web-art/assets/flags/${code}.svg`,
|
|
2060
2069
|
alt: "",
|
|
2061
|
-
"data-testid": `img-flag-${code}
|
|
2070
|
+
"data-testid": `img-flag-${code}`,
|
|
2071
|
+
width: "24px"
|
|
2062
2072
|
}
|
|
2063
2073
|
);
|
|
2064
|
-
}
|
|
2074
|
+
}
|
|
2065
2075
|
var currencyCodes = [
|
|
2066
2076
|
"aed",
|
|
2067
2077
|
"ars",
|
|
@@ -2245,30 +2255,27 @@ var countryCodes = [
|
|
|
2245
2255
|
"zm"
|
|
2246
2256
|
];
|
|
2247
2257
|
|
|
2248
|
-
// src/
|
|
2258
|
+
// src/common/icon/NamedIcon.tsx
|
|
2249
2259
|
var icons = __toESM(require("@transferwise/icons"));
|
|
2250
2260
|
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
2251
2261
|
var isNamedIcon = (name) => {
|
|
2252
2262
|
const iconName = toCapitalisedCamelCase(name);
|
|
2253
2263
|
return Object.keys(icons).includes(iconName);
|
|
2254
2264
|
};
|
|
2255
|
-
|
|
2265
|
+
function NamedIcon({ name }) {
|
|
2256
2266
|
if (!isNamedIcon(name)) {
|
|
2257
2267
|
return null;
|
|
2258
2268
|
}
|
|
2259
2269
|
const iconName = toCapitalisedCamelCase(name);
|
|
2260
2270
|
const Icon = icons[iconName];
|
|
2261
2271
|
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Icon, { size: 24 });
|
|
2262
|
-
}
|
|
2272
|
+
}
|
|
2263
2273
|
var toCapitalisedCamelCase = (value) => value.split("-").map(capitaliseFirstChar).join("");
|
|
2264
|
-
var capitaliseFirstChar = (value) => {
|
|
2265
|
-
var _a;
|
|
2266
|
-
return `${(_a = value[0]) == null ? void 0 : _a.toUpperCase()}${value.slice(1)}`;
|
|
2267
|
-
};
|
|
2274
|
+
var capitaliseFirstChar = (value) => `${value[0].toUpperCase()}${value.slice(1)}`;
|
|
2268
2275
|
|
|
2269
2276
|
// src/legacy/layout/icon/DynamicIcon.tsx
|
|
2270
2277
|
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
2271
|
-
|
|
2278
|
+
function DynamicIcon({ type }) {
|
|
2272
2279
|
if (isFlagIcon(type)) {
|
|
2273
2280
|
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(FlagIcon, { name: type });
|
|
2274
2281
|
}
|
|
@@ -2276,7 +2283,7 @@ var DynamicIcon = ({ type }) => {
|
|
|
2276
2283
|
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(NamedIcon, { name: type });
|
|
2277
2284
|
}
|
|
2278
2285
|
return null;
|
|
2279
|
-
}
|
|
2286
|
+
}
|
|
2280
2287
|
function isValidIconName(name) {
|
|
2281
2288
|
return isNamedIcon(name) || isFlagIcon(name);
|
|
2282
2289
|
}
|
|
@@ -2468,7 +2475,7 @@ var getButtonSize = (size) => {
|
|
|
2468
2475
|
|
|
2469
2476
|
// src/legacy/layout/button/DynamicButton.tsx
|
|
2470
2477
|
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
2471
|
-
|
|
2478
|
+
function DynamicButton(props) {
|
|
2472
2479
|
var _a;
|
|
2473
2480
|
const { component, onAction } = props;
|
|
2474
2481
|
const componentAction = component.action;
|
|
@@ -2484,12 +2491,12 @@ var DynamicButton = (props) => {
|
|
|
2484
2491
|
priority,
|
|
2485
2492
|
block: true,
|
|
2486
2493
|
className,
|
|
2487
|
-
disabled: component.disabled || componentAction.disabled
|
|
2494
|
+
disabled: loading || component.disabled || componentAction.disabled,
|
|
2488
2495
|
onClick: () => onAction(componentAction),
|
|
2489
2496
|
children: (_a = component.title) != null ? _a : componentAction.title
|
|
2490
2497
|
}
|
|
2491
2498
|
);
|
|
2492
|
-
}
|
|
2499
|
+
}
|
|
2493
2500
|
var DynamicButton_default = DynamicButton;
|
|
2494
2501
|
|
|
2495
2502
|
// src/legacy/layout/columns/DynamicColumns.tsx
|
|
@@ -2549,22 +2556,19 @@ var import_components4 = require("@transferwise/components");
|
|
|
2549
2556
|
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
2550
2557
|
function DynamicDecision({ component, onAction }) {
|
|
2551
2558
|
const { loading } = useDynamicFlow();
|
|
2552
|
-
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: getMargin(component.margin), children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_components4.NavigationOptionsList, { children: component.options.map((option) =>
|
|
2553
|
-
|
|
2554
|
-
|
|
2555
|
-
|
|
2556
|
-
|
|
2557
|
-
|
|
2558
|
-
|
|
2559
|
-
|
|
2560
|
-
|
|
2561
|
-
|
|
2562
|
-
|
|
2563
|
-
|
|
2564
|
-
|
|
2565
|
-
JSON.stringify(option)
|
|
2566
|
-
);
|
|
2567
|
-
}) }) });
|
|
2559
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: getMargin(component.margin), children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_components4.NavigationOptionsList, { children: component.options.map((option) => /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
2560
|
+
import_components4.NavigationOption,
|
|
2561
|
+
{
|
|
2562
|
+
title: option.title,
|
|
2563
|
+
content: option.description,
|
|
2564
|
+
disabled: loading || option.disabled,
|
|
2565
|
+
media: getNavigationOptionMedia(option),
|
|
2566
|
+
showMediaCircle: false,
|
|
2567
|
+
showMediaAtAllSizes: true,
|
|
2568
|
+
onClick: () => onAction(option.action)
|
|
2569
|
+
},
|
|
2570
|
+
JSON.stringify(option)
|
|
2571
|
+
)) }) });
|
|
2568
2572
|
}
|
|
2569
2573
|
var DynamicDecision_default = DynamicDecision;
|
|
2570
2574
|
|
|
@@ -3440,6 +3444,7 @@ ArraySchema.defaultProps = {
|
|
|
3440
3444
|
var ArraySchema_default = ArraySchema;
|
|
3441
3445
|
|
|
3442
3446
|
// src/legacy/jsonSchemaForm/objectSchema/ObjectSchema.tsx
|
|
3447
|
+
var import_components11 = require("@transferwise/components");
|
|
3443
3448
|
var import_classnames3 = __toESM(require_classnames());
|
|
3444
3449
|
var import_react14 = require("react");
|
|
3445
3450
|
var import_jsx_runtime25 = require("react/jsx-runtime");
|
|
@@ -3481,11 +3486,7 @@ function ObjectSchema(props) {
|
|
|
3481
3486
|
return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(import_jsx_runtime25.Fragment, { children: [
|
|
3482
3487
|
props.schema.alert && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(DynamicAlert_default, { component: props.schema.alert }),
|
|
3483
3488
|
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("fieldset", { children: [
|
|
3484
|
-
props.schema.title && !props.hideTitle && /* @__PURE__ */ (0, import_jsx_runtime25.
|
|
3485
|
-
" ",
|
|
3486
|
-
props.schema.title,
|
|
3487
|
-
" "
|
|
3488
|
-
] }),
|
|
3489
|
+
props.schema.title && !props.hideTitle && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_components11.Section, { children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_components11.Header, { title: props.schema.title }) }),
|
|
3489
3490
|
props.schema.description && !props.hideTitle && /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("p", { children: [
|
|
3490
3491
|
" ",
|
|
3491
3492
|
props.schema.description,
|
|
@@ -3523,12 +3524,12 @@ ObjectSchema.defaultProps = {
|
|
|
3523
3524
|
var ObjectSchema_default = ObjectSchema;
|
|
3524
3525
|
|
|
3525
3526
|
// src/legacy/jsonSchemaForm/oneOfSchema/OneOfSchema.tsx
|
|
3526
|
-
var
|
|
3527
|
+
var import_components15 = require("@transferwise/components");
|
|
3527
3528
|
var import_classnames4 = __toESM(require_classnames());
|
|
3528
3529
|
var import_react17 = require("react");
|
|
3529
3530
|
|
|
3530
3531
|
// src/legacy/jsonSchemaForm/help/Help.tsx
|
|
3531
|
-
var
|
|
3532
|
+
var import_components12 = require("@transferwise/components");
|
|
3532
3533
|
var import_react_intl13 = require("react-intl");
|
|
3533
3534
|
|
|
3534
3535
|
// src/common/messages/help.messages.ts
|
|
@@ -3546,10 +3547,10 @@ var import_jsx_runtime26 = require("react/jsx-runtime");
|
|
|
3546
3547
|
function Help(props) {
|
|
3547
3548
|
const intl = (0, import_react_intl13.useIntl)();
|
|
3548
3549
|
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
3549
|
-
|
|
3550
|
+
import_components12.Info,
|
|
3550
3551
|
{
|
|
3551
3552
|
className: "m-l-1",
|
|
3552
|
-
content: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
3553
|
+
content: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_components12.Markdown, { children: props.help.markdown }),
|
|
3553
3554
|
presentation: "POPOVER",
|
|
3554
3555
|
size: "sm",
|
|
3555
3556
|
"aria-label": intl.formatMessage(help_messages_default.helpAria)
|
|
@@ -3562,7 +3563,7 @@ var Help_default = Help;
|
|
|
3562
3563
|
var import_react16 = require("react");
|
|
3563
3564
|
|
|
3564
3565
|
// src/legacy/formControl/FormControl.tsx
|
|
3565
|
-
var
|
|
3566
|
+
var import_components13 = require("@transferwise/components");
|
|
3566
3567
|
var import_react15 = require("react");
|
|
3567
3568
|
|
|
3568
3569
|
// src/legacy/formControl/utils/value-utils.ts
|
|
@@ -3842,7 +3843,7 @@ var _FormControl = class _FormControl extends import_react15.PureComponent {
|
|
|
3842
3843
|
switch (type) {
|
|
3843
3844
|
case FormControlType.RADIO:
|
|
3844
3845
|
return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
3845
|
-
|
|
3846
|
+
import_components13.RadioGroup,
|
|
3846
3847
|
{
|
|
3847
3848
|
radios: options.map(this.mapOption),
|
|
3848
3849
|
name,
|
|
@@ -3852,7 +3853,7 @@ var _FormControl = class _FormControl extends import_react15.PureComponent {
|
|
|
3852
3853
|
);
|
|
3853
3854
|
case FormControlType.CHECKBOX:
|
|
3854
3855
|
return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
3855
|
-
|
|
3856
|
+
import_components13.Checkbox,
|
|
3856
3857
|
{
|
|
3857
3858
|
checked: getSafeBooleanValue(value, { coerceValue: true }),
|
|
3858
3859
|
disabled,
|
|
@@ -3867,7 +3868,7 @@ var _FormControl = class _FormControl extends import_react15.PureComponent {
|
|
|
3867
3868
|
case FormControlType.SELECT: {
|
|
3868
3869
|
const search = options.length >= 20;
|
|
3869
3870
|
return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
3870
|
-
|
|
3871
|
+
import_components13.Select,
|
|
3871
3872
|
{
|
|
3872
3873
|
id,
|
|
3873
3874
|
selected: this.getSelectedOption(options),
|
|
@@ -3891,7 +3892,7 @@ var _FormControl = class _FormControl extends import_react15.PureComponent {
|
|
|
3891
3892
|
}
|
|
3892
3893
|
case FormControlType.TAB:
|
|
3893
3894
|
return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
3894
|
-
|
|
3895
|
+
import_components13.Tabs,
|
|
3895
3896
|
{
|
|
3896
3897
|
selected: ((_a = this.getSelectedOption(options)) == null ? void 0 : _a.value) || 0,
|
|
3897
3898
|
tabs: options.map((option) => ({
|
|
@@ -3976,7 +3977,7 @@ var _FormControl = class _FormControl extends import_react15.PureComponent {
|
|
|
3976
3977
|
case FormControlType.DATE:
|
|
3977
3978
|
case FormControlType.DATETIME:
|
|
3978
3979
|
return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
3979
|
-
|
|
3980
|
+
import_components13.DateInput,
|
|
3980
3981
|
{
|
|
3981
3982
|
disabled,
|
|
3982
3983
|
size,
|
|
@@ -3990,7 +3991,7 @@ var _FormControl = class _FormControl extends import_react15.PureComponent {
|
|
|
3990
3991
|
);
|
|
3991
3992
|
case FormControlType.DATELOOKUP: {
|
|
3992
3993
|
return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
3993
|
-
|
|
3994
|
+
import_components13.DateLookup,
|
|
3994
3995
|
{
|
|
3995
3996
|
value: getSafeDateStringValue(value),
|
|
3996
3997
|
min: minDate,
|
|
@@ -4008,7 +4009,7 @@ var _FormControl = class _FormControl extends import_react15.PureComponent {
|
|
|
4008
4009
|
}
|
|
4009
4010
|
case FormControlType.TEL:
|
|
4010
4011
|
return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
4011
|
-
|
|
4012
|
+
import_components13.PhoneNumberInput,
|
|
4012
4013
|
{
|
|
4013
4014
|
disabled,
|
|
4014
4015
|
countryCode,
|
|
@@ -4040,7 +4041,7 @@ var _FormControl = class _FormControl extends import_react15.PureComponent {
|
|
|
4040
4041
|
};
|
|
4041
4042
|
if (this.props.displayPattern) {
|
|
4042
4043
|
return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
4043
|
-
|
|
4044
|
+
import_components13.TextareaWithDisplayFormat,
|
|
4044
4045
|
__spreadProps(__spreadValues({
|
|
4045
4046
|
displayPattern: this.props.displayPattern
|
|
4046
4047
|
}, textareaProps), {
|
|
@@ -4062,7 +4063,7 @@ var _FormControl = class _FormControl extends import_react15.PureComponent {
|
|
|
4062
4063
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
4063
4064
|
// @ts-expect-error - TODO: Remove this once Upload is migrated to TypeScript
|
|
4064
4065
|
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
4065
|
-
|
|
4066
|
+
import_components13.Upload,
|
|
4066
4067
|
__spreadProps(__spreadValues({}, uploadProps), {
|
|
4067
4068
|
usAccept: uploadProps.usAccept || "*",
|
|
4068
4069
|
usDisabled: uploadProps.usDisabled || disabled,
|
|
@@ -4100,7 +4101,7 @@ var _FormControl = class _FormControl extends import_react15.PureComponent {
|
|
|
4100
4101
|
};
|
|
4101
4102
|
if (this.props.displayPattern) {
|
|
4102
4103
|
return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
4103
|
-
|
|
4104
|
+
import_components13.InputWithDisplayFormat,
|
|
4104
4105
|
__spreadProps(__spreadValues({
|
|
4105
4106
|
displayPattern: this.props.displayPattern
|
|
4106
4107
|
}, inputProps), {
|
|
@@ -4157,7 +4158,7 @@ _FormControl.defaultProps = {
|
|
|
4157
4158
|
var FormControl = _FormControl;
|
|
4158
4159
|
|
|
4159
4160
|
// src/legacy/jsonSchemaForm/schemaFormControl/utils/mapping-utils.tsx
|
|
4160
|
-
var
|
|
4161
|
+
var import_components14 = require("@transferwise/components");
|
|
4161
4162
|
var import_jsx_runtime28 = require("react/jsx-runtime");
|
|
4162
4163
|
var mapConstSchemaToOption = (schema, controlType) => {
|
|
4163
4164
|
switch (controlType) {
|
|
@@ -4202,17 +4203,17 @@ var getIconPropertyForSelectOption = (icon) => {
|
|
|
4202
4203
|
var getAvatarPropertyForRadioOption = ({ image, icon }) => {
|
|
4203
4204
|
if (image == null ? void 0 : image.url) {
|
|
4204
4205
|
return {
|
|
4205
|
-
avatar: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
4206
|
+
avatar: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_components14.Avatar, { type: import_components14.AvatarType.THUMBNAIL, children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("img", { src: image.url, alt: "" }) })
|
|
4206
4207
|
};
|
|
4207
4208
|
}
|
|
4208
4209
|
if ((icon == null ? void 0 : icon.name) && isValidIconName(icon.name)) {
|
|
4209
4210
|
return {
|
|
4210
|
-
avatar: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
4211
|
+
avatar: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_components14.Avatar, { type: import_components14.AvatarType.ICON, children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(DynamicIcon_default, { type: icon.name }) })
|
|
4211
4212
|
};
|
|
4212
4213
|
}
|
|
4213
4214
|
if (icon == null ? void 0 : icon.text) {
|
|
4214
4215
|
return {
|
|
4215
|
-
avatar: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
4216
|
+
avatar: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_components14.Avatar, { type: import_components14.AvatarType.INITIALS, children: icon.text })
|
|
4216
4217
|
};
|
|
4217
4218
|
}
|
|
4218
4219
|
return null;
|
|
@@ -4496,7 +4497,7 @@ function getTitleAndHelp(schema, id) {
|
|
|
4496
4497
|
schema.title,
|
|
4497
4498
|
" ",
|
|
4498
4499
|
helpElement
|
|
4499
|
-
] }) : /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
4500
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_components15.Header, { title: (_a = schema.title) != null ? _a : "" }) });
|
|
4500
4501
|
return schema.title ? titleElement : helpElement;
|
|
4501
4502
|
}
|
|
4502
4503
|
function getValidations(props, schemaIndex) {
|
|
@@ -4536,7 +4537,7 @@ var import_classnames5 = __toESM(require_classnames());
|
|
|
4536
4537
|
var import_react19 = require("react");
|
|
4537
4538
|
|
|
4538
4539
|
// src/legacy/jsonSchemaForm/persistAsyncSchema/persistAsyncBlobSchema/UploadInputAdapter.tsx
|
|
4539
|
-
var
|
|
4540
|
+
var import_components16 = require("@transferwise/components");
|
|
4540
4541
|
var import_react18 = require("react");
|
|
4541
4542
|
var import_jsx_runtime31 = require("react/jsx-runtime");
|
|
4542
4543
|
function UploadInputAdapter(props) {
|
|
@@ -4554,7 +4555,7 @@ function UploadInputAdapter(props) {
|
|
|
4554
4555
|
onCancel
|
|
4555
4556
|
} = props;
|
|
4556
4557
|
const onEvent = useEventDispatcher();
|
|
4557
|
-
const files = (0, import_react18.useMemo)(() => fileId ? [{ id: fileId, status:
|
|
4558
|
+
const files = (0, import_react18.useMemo)(() => fileId ? [{ id: fileId, status: import_components16.Status.SUCCEEDED }] : [], [fileId]);
|
|
4558
4559
|
const uploadFile = (formData) => {
|
|
4559
4560
|
onEvent("Dynamic Flow - PersistAsync", { status: "pending", schemaId: id });
|
|
4560
4561
|
return httpClient(String(httpOptions.url), {
|
|
@@ -4572,7 +4573,7 @@ function UploadInputAdapter(props) {
|
|
|
4572
4573
|
});
|
|
4573
4574
|
};
|
|
4574
4575
|
return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
4575
|
-
|
|
4576
|
+
import_components16.UploadInput,
|
|
4576
4577
|
{
|
|
4577
4578
|
id,
|
|
4578
4579
|
fileInputName: httpOptions.fileInputName,
|
|
@@ -4708,7 +4709,7 @@ var getSelectionFromModel = (schema, model) => {
|
|
|
4708
4709
|
};
|
|
4709
4710
|
|
|
4710
4711
|
// src/legacy/jsonSchemaForm/promotedOneOfSchema/promotedOneOfControl/PromotedOneOfCheckboxControl.tsx
|
|
4711
|
-
var
|
|
4712
|
+
var import_components17 = require("@transferwise/components");
|
|
4712
4713
|
var import_jsx_runtime34 = require("react/jsx-runtime");
|
|
4713
4714
|
var PromotedOneOfCheckboxControl = (props) => {
|
|
4714
4715
|
const { id, selection, setSelection } = props;
|
|
@@ -4720,13 +4721,13 @@ var PromotedOneOfCheckboxControl = (props) => {
|
|
|
4720
4721
|
const toggleSelection = () => {
|
|
4721
4722
|
setSelection(checked ? selectionWhenUnchecked : selectionWhenChecked);
|
|
4722
4723
|
};
|
|
4723
|
-
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: "form-group", children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
4724
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: "form-group", children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_components17.Checkbox, { id, label: title, checked, onChange: toggleSelection }) });
|
|
4724
4725
|
};
|
|
4725
4726
|
PromotedOneOfCheckboxControl.defaultProps = {};
|
|
4726
4727
|
var PromotedOneOfCheckboxControl_default = PromotedOneOfCheckboxControl;
|
|
4727
4728
|
|
|
4728
4729
|
// src/legacy/jsonSchemaForm/promotedOneOfSchema/promotedOneOfControl/PromotedOneOfRadioControl.tsx
|
|
4729
|
-
var
|
|
4730
|
+
var import_components18 = require("@transferwise/components");
|
|
4730
4731
|
var import_jsx_runtime35 = require("react/jsx-runtime");
|
|
4731
4732
|
function PromotedOneOfRadioControl(props) {
|
|
4732
4733
|
var _a, _b;
|
|
@@ -4747,7 +4748,7 @@ function PromotedOneOfRadioControl(props) {
|
|
|
4747
4748
|
return /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "form-group", children: [
|
|
4748
4749
|
title && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("label", { className: "control-label", htmlFor: id, children: title }),
|
|
4749
4750
|
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
4750
|
-
|
|
4751
|
+
import_components18.RadioGroup,
|
|
4751
4752
|
{
|
|
4752
4753
|
name: "promoted-selection",
|
|
4753
4754
|
selectedValue: selection,
|
|
@@ -4838,7 +4839,7 @@ function getOtherOneOf(schema) {
|
|
|
4838
4839
|
var PromotedOneOfSchema_default = PromotedOneOfSchema;
|
|
4839
4840
|
|
|
4840
4841
|
// src/legacy/jsonSchemaForm/readOnlySchema/ReadOnlySchema.tsx
|
|
4841
|
-
var
|
|
4842
|
+
var import_components19 = require("@transferwise/components");
|
|
4842
4843
|
var import_react_intl15 = require("react-intl");
|
|
4843
4844
|
|
|
4844
4845
|
// src/legacy/jsonSchemaForm/readOnlySchema/ReadOnlySchema.messages.js
|
|
@@ -4862,7 +4863,7 @@ function ReadOnlySchema({ schema, model }) {
|
|
|
4862
4863
|
const { title = "" } = schema;
|
|
4863
4864
|
const { formatMessage } = (0, import_react_intl15.useIntl)();
|
|
4864
4865
|
const value = getValueForSchema({ schema, model, formatMessage });
|
|
4865
|
-
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
4866
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_components19.DefinitionList, { layout: import_components19.Layout.VERTICAL_ONE_COLUMN, definitions: [{ title, value, key: "" }] });
|
|
4866
4867
|
}
|
|
4867
4868
|
var ReadOnlySchema_default = ReadOnlySchema;
|
|
4868
4869
|
function getValueForSchema({
|
|
@@ -5087,7 +5088,7 @@ function DynamicForm({
|
|
|
5087
5088
|
var DynamicForm_default = DynamicForm;
|
|
5088
5089
|
|
|
5089
5090
|
// src/legacy/layout/heading/DynamicHeading.tsx
|
|
5090
|
-
var
|
|
5091
|
+
var import_components20 = require("@transferwise/components");
|
|
5091
5092
|
var import_classnames6 = __toESM(require_classnames());
|
|
5092
5093
|
var import_jsx_runtime42 = require("react/jsx-runtime");
|
|
5093
5094
|
var DynamicHeading = (props) => {
|
|
@@ -5114,30 +5115,30 @@ var DisplayHeading = ({ size, text, classes }) => {
|
|
|
5114
5115
|
switch (size) {
|
|
5115
5116
|
case "xs":
|
|
5116
5117
|
case "sm":
|
|
5117
|
-
return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
5118
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_components20.Display, { type: "display-small", className: classes, children: text });
|
|
5118
5119
|
case "xl":
|
|
5119
5120
|
case "lg":
|
|
5120
|
-
return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
5121
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_components20.Display, { type: "display-large", className: classes, children: text });
|
|
5121
5122
|
case "md":
|
|
5122
5123
|
default:
|
|
5123
|
-
return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
5124
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_components20.Display, { type: "display-medium", className: classes, children: text });
|
|
5124
5125
|
}
|
|
5125
5126
|
};
|
|
5126
5127
|
var DynamicHeading_default = DynamicHeading;
|
|
5127
5128
|
|
|
5128
5129
|
// src/legacy/layout/markdown/DynamicMarkdown.tsx
|
|
5129
|
-
var
|
|
5130
|
+
var import_components21 = require("@transferwise/components");
|
|
5130
5131
|
var import_jsx_runtime43 = require("react/jsx-runtime");
|
|
5131
5132
|
var DynamicMarkdown = ({ component }) => {
|
|
5132
5133
|
const { content, align, margin } = component;
|
|
5133
|
-
return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("div", { className: getTextAlignmentAndMargin({ align, margin }), children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
5134
|
+
return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("div", { className: getTextAlignmentAndMargin({ align, margin }), children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_components21.Markdown, { config: { link: { target: "_blank" } }, children: content }) });
|
|
5134
5135
|
};
|
|
5135
5136
|
var DynamicInfo = ({ component }) => {
|
|
5136
|
-
return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("div", { className: getTextAlignmentAndMargin(component), children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
5137
|
+
return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("div", { className: getTextAlignmentAndMargin(component), children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_components21.Markdown, { config: { link: { target: "_blank" } }, children: component.markdown }) });
|
|
5137
5138
|
};
|
|
5138
5139
|
|
|
5139
5140
|
// src/legacy/layout/image/DynamicImage.tsx
|
|
5140
|
-
var
|
|
5141
|
+
var import_components22 = require("@transferwise/components");
|
|
5141
5142
|
var import_react24 = require("react");
|
|
5142
5143
|
var import_jsx_runtime44 = require("react/jsx-runtime");
|
|
5143
5144
|
function DynamicImage({ component: image }) {
|
|
@@ -5156,7 +5157,7 @@ function DynamicImage({ component: image }) {
|
|
|
5156
5157
|
if (!imageSource) {
|
|
5157
5158
|
return null;
|
|
5158
5159
|
}
|
|
5159
|
-
return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("div", { className: `df-image ${size || "md"}`, children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
5160
|
+
return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("div", { className: `df-image ${size || "md"}`, children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_components22.Image, __spreadValues({ className: `img-responsive ${getMargin(margin || "md")}` }, imageProps)) });
|
|
5160
5161
|
}
|
|
5161
5162
|
var readImageBlobAsDataURL = (imageBlob) => (
|
|
5162
5163
|
// we can safely assume the type of reader.result is string
|
|
@@ -5192,7 +5193,7 @@ var getImageSource = async (httpClient, imageUrl) => {
|
|
|
5192
5193
|
var DynamicImage_default = DynamicImage;
|
|
5193
5194
|
|
|
5194
5195
|
// src/legacy/layout/instructions/DynamicInstructions.tsx
|
|
5195
|
-
var
|
|
5196
|
+
var import_components23 = require("@transferwise/components");
|
|
5196
5197
|
var import_jsx_runtime45 = require("react/jsx-runtime");
|
|
5197
5198
|
var doContext = ["positive", "neutral"];
|
|
5198
5199
|
var dontContext = ["warning", "negative"];
|
|
@@ -5201,8 +5202,8 @@ var DynamicInstructions = ({ component }) => {
|
|
|
5201
5202
|
const dos = items.filter((item) => doContext.includes(item.context)).map(({ text }) => text);
|
|
5202
5203
|
const donts = items.filter((item) => dontContext.includes(item.context)).map(({ text }) => text);
|
|
5203
5204
|
return /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("div", { className: getMargin(component.margin || "md"), children: [
|
|
5204
|
-
component.title ? /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
5205
|
-
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
5205
|
+
component.title ? /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_components23.Header, { title: component.title }) : null,
|
|
5206
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_components23.InstructionsList, { dos, donts })
|
|
5206
5207
|
] });
|
|
5207
5208
|
};
|
|
5208
5209
|
var DynamicInstructions_default = DynamicInstructions;
|
|
@@ -5312,11 +5313,11 @@ function DynamicLayout(props) {
|
|
|
5312
5313
|
var DynamicLayout_default = DynamicLayout;
|
|
5313
5314
|
|
|
5314
5315
|
// src/legacy/layout/list/DynamicStatusList.tsx
|
|
5315
|
-
var
|
|
5316
|
+
var import_components24 = require("@transferwise/components");
|
|
5316
5317
|
var import_jsx_runtime47 = require("react/jsx-runtime");
|
|
5317
5318
|
var DynamicStatusList = ({ component }) => {
|
|
5318
5319
|
return /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("div", { className: getMargin(component.margin || "md"), children: [
|
|
5319
|
-
component.title ? /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
5320
|
+
component.title ? /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_components24.Header, { title: component.title }) : null,
|
|
5320
5321
|
component.items.map(mapListItemToSummary)
|
|
5321
5322
|
] });
|
|
5322
5323
|
};
|
|
@@ -5326,7 +5327,7 @@ var mapListItemToSummary = ({ title, description, icon, status }) => {
|
|
|
5326
5327
|
title,
|
|
5327
5328
|
description
|
|
5328
5329
|
}, (icon == null ? void 0 : icon.name) ? { icon: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(DynamicIcon_default, { type: icon.name }) } : {}), status ? { status: statusMap[status] } : {});
|
|
5329
|
-
return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
5330
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_components24.Summary, __spreadValues({}, props));
|
|
5330
5331
|
};
|
|
5331
5332
|
var statusListMap = {
|
|
5332
5333
|
done: "done",
|
|
@@ -5342,12 +5343,12 @@ var statusMap = __spreadValues(__spreadValues({}, statusListMap), legacyStatusMa
|
|
|
5342
5343
|
var DynamicStatusList_default = DynamicStatusList;
|
|
5343
5344
|
|
|
5344
5345
|
// src/legacy/layout/loadingIndicator/DynamicLoadingIndicator.tsx
|
|
5345
|
-
var
|
|
5346
|
+
var import_components25 = require("@transferwise/components");
|
|
5346
5347
|
var import_jsx_runtime48 = require("react/jsx-runtime");
|
|
5347
5348
|
var DynamicLoadingIndicator = ({ component }) => {
|
|
5348
5349
|
const { margin = "md", size = "md" } = component;
|
|
5349
5350
|
return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
5350
|
-
|
|
5351
|
+
import_components25.Loader,
|
|
5351
5352
|
{
|
|
5352
5353
|
size,
|
|
5353
5354
|
classNames: {
|
|
@@ -5360,7 +5361,7 @@ var DynamicLoadingIndicator = ({ component }) => {
|
|
|
5360
5361
|
var DynamicLoadingIndicator_default = DynamicLoadingIndicator;
|
|
5361
5362
|
|
|
5362
5363
|
// src/legacy/layout/paragraph/DynamicParagraph.tsx
|
|
5363
|
-
var
|
|
5364
|
+
var import_components27 = require("@transferwise/components");
|
|
5364
5365
|
var import_react_intl17 = require("react-intl");
|
|
5365
5366
|
|
|
5366
5367
|
// src/common/messages/paragraph.messages.ts
|
|
@@ -5379,10 +5380,10 @@ var paragraph_messages_default = (0, import_react_intl16.defineMessages)({
|
|
|
5379
5380
|
});
|
|
5380
5381
|
|
|
5381
5382
|
// src/legacy/layout/paragraph/useSnackBarIfAvailable.ts
|
|
5382
|
-
var
|
|
5383
|
+
var import_components26 = require("@transferwise/components");
|
|
5383
5384
|
var import_react25 = require("react");
|
|
5384
5385
|
function useSnackBarIfAvailable() {
|
|
5385
|
-
const context = (0, import_react25.useContext)(
|
|
5386
|
+
const context = (0, import_react25.useContext)(import_components26.SnackbarContext);
|
|
5386
5387
|
return context ? context.createSnackbar : noop2;
|
|
5387
5388
|
}
|
|
5388
5389
|
function noop2() {
|
|
@@ -5423,7 +5424,7 @@ function CopyableDynamicParagraph({ component }) {
|
|
|
5423
5424
|
style: { textOverflow: "ellipsis" }
|
|
5424
5425
|
}
|
|
5425
5426
|
),
|
|
5426
|
-
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
5427
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_components27.Button, { block: true, onClick: copy, children: formatMessage(paragraph_messages_default.copy) })
|
|
5427
5428
|
] });
|
|
5428
5429
|
}
|
|
5429
5430
|
function noop3() {
|
|
@@ -5431,7 +5432,7 @@ function noop3() {
|
|
|
5431
5432
|
var DynamicParagraph_default = DynamicParagraph;
|
|
5432
5433
|
|
|
5433
5434
|
// src/legacy/layout/review/DynamicReview.tsx
|
|
5434
|
-
var
|
|
5435
|
+
var import_components28 = require("@transferwise/components");
|
|
5435
5436
|
var import_jsx_runtime50 = require("react/jsx-runtime");
|
|
5436
5437
|
var getDefinitions = (orientation, review) => review.fields.map(({ label, value, help }, index) => ({
|
|
5437
5438
|
key: String(index),
|
|
@@ -5473,8 +5474,8 @@ function DynamicReview(props) {
|
|
|
5473
5474
|
const callToAction = review.callToAction ? getReviewAction(review.callToAction.title, review.callToAction.action) : null;
|
|
5474
5475
|
const legacyCallToAction = !callToAction && review.action ? getReviewAction(review.action.title || "", review.action) : null;
|
|
5475
5476
|
return /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("div", { className: margin, children: [
|
|
5476
|
-
review.title && /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
5477
|
-
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)("div", { className: margin, children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
5477
|
+
review.title && /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_components28.Header, { title: review.title, action: callToAction || legacyCallToAction || void 0 }),
|
|
5478
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)("div", { className: margin, children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_components28.DefinitionList, { layout: orientation, definitions: getDefinitions(orientation, review) }) })
|
|
5478
5479
|
] });
|
|
5479
5480
|
}
|
|
5480
5481
|
var DynamicReview_default = DynamicReview;
|
|
@@ -5483,13 +5484,13 @@ var DynamicReview_default = DynamicReview;
|
|
|
5483
5484
|
var import_react27 = require("react");
|
|
5484
5485
|
|
|
5485
5486
|
// src/legacy/layout/search/SearchInput.tsx
|
|
5486
|
-
var
|
|
5487
|
+
var import_components29 = require("@transferwise/components");
|
|
5487
5488
|
var import_jsx_runtime51 = require("react/jsx-runtime");
|
|
5488
5489
|
var SearchInput = ({ title, value, onFocus, onChange }) => {
|
|
5489
5490
|
return /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("label", { className: "control-label d-inline", children: [
|
|
5490
5491
|
title,
|
|
5491
5492
|
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
5492
|
-
|
|
5493
|
+
import_components29.Input,
|
|
5493
5494
|
{
|
|
5494
5495
|
type: "text",
|
|
5495
5496
|
value,
|
|
@@ -5502,7 +5503,7 @@ var SearchInput = ({ title, value, onFocus, onChange }) => {
|
|
|
5502
5503
|
};
|
|
5503
5504
|
|
|
5504
5505
|
// src/legacy/layout/search/SearchResults.tsx
|
|
5505
|
-
var
|
|
5506
|
+
var import_components30 = require("@transferwise/components");
|
|
5506
5507
|
var import_react_intl19 = require("react-intl");
|
|
5507
5508
|
|
|
5508
5509
|
// src/common/errorBoundary/ErrorBoundary.messages.ts
|
|
@@ -5526,9 +5527,9 @@ var SearchResults = ({ results, emptyMessage, onSelect }) => {
|
|
|
5526
5527
|
if (results.length === 0) {
|
|
5527
5528
|
return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("p", { className: "m-t-2", children: emptyMessage });
|
|
5528
5529
|
}
|
|
5529
|
-
return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
5530
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_components30.NavigationOptionsList, { children: results.map((result) => {
|
|
5530
5531
|
return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
5531
|
-
|
|
5532
|
+
import_components30.NavigationOption,
|
|
5532
5533
|
{
|
|
5533
5534
|
title: result.title,
|
|
5534
5535
|
content: result.description,
|
|
@@ -5674,7 +5675,7 @@ function DynamicSearch({ component, onAction }) {
|
|
|
5674
5675
|
var DynamicSearch_default = DynamicSearch;
|
|
5675
5676
|
|
|
5676
5677
|
// src/legacy/layout/modal/DynamicModal.tsx
|
|
5677
|
-
var
|
|
5678
|
+
var import_components31 = require("@transferwise/components");
|
|
5678
5679
|
var import_react28 = require("react");
|
|
5679
5680
|
var import_jsx_runtime54 = require("react/jsx-runtime");
|
|
5680
5681
|
var DynamicModal = (props) => {
|
|
@@ -5682,9 +5683,9 @@ var DynamicModal = (props) => {
|
|
|
5682
5683
|
const { component, onAction } = props;
|
|
5683
5684
|
const { margin = "md" } = component;
|
|
5684
5685
|
return /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { className: getTextAlignmentAndMargin({ margin }), children: [
|
|
5685
|
-
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
5686
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)(import_components31.Button, { priority: "tertiary", block: true, onClick: () => isVisible(true), children: component.trigger.title }),
|
|
5686
5687
|
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
5687
|
-
|
|
5688
|
+
import_components31.Modal,
|
|
5688
5689
|
{
|
|
5689
5690
|
scroll: "content",
|
|
5690
5691
|
onClose: () => isVisible(false),
|
|
@@ -6227,7 +6228,7 @@ var CameraCapture_messages_default = (0, import_react_intl22.defineMessages)({
|
|
|
6227
6228
|
});
|
|
6228
6229
|
|
|
6229
6230
|
// src/legacy/step/cameraStep/cameraCapture/components/bottomBar/BottomBar.tsx
|
|
6230
|
-
var
|
|
6231
|
+
var import_components32 = require("@transferwise/components");
|
|
6231
6232
|
var import_react_intl23 = require("react-intl");
|
|
6232
6233
|
var import_jsx_runtime58 = require("react/jsx-runtime");
|
|
6233
6234
|
var CaptureBottomBar = ({ onCapture }) => /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("div", { className: "bottom-bar", children: /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(CaptureButton, { onClick: onCapture }) });
|
|
@@ -6238,24 +6239,24 @@ var ReviewBottomBar = ({
|
|
|
6238
6239
|
const intl = (0, import_react_intl23.useIntl)();
|
|
6239
6240
|
return /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("div", { className: "bottom-bar p-x-2", children: /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("div", { className: "row", children: /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)("div", { className: "col-xs-12 col-md-6 col-md-offset-3", children: [
|
|
6240
6241
|
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
6241
|
-
|
|
6242
|
+
import_components32.Button,
|
|
6242
6243
|
{
|
|
6243
6244
|
className: "m-b-1",
|
|
6244
6245
|
block: true,
|
|
6245
|
-
size:
|
|
6246
|
-
type:
|
|
6246
|
+
size: import_components32.Size.MEDIUM,
|
|
6247
|
+
type: import_components32.ControlType.ACCENT,
|
|
6247
6248
|
onClick: onSubmit,
|
|
6248
6249
|
children: intl.formatMessage(CameraCapture_messages_default.reviewSubmit)
|
|
6249
6250
|
}
|
|
6250
6251
|
),
|
|
6251
6252
|
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
6252
|
-
|
|
6253
|
+
import_components32.Button,
|
|
6253
6254
|
{
|
|
6254
6255
|
className: "m-b-2",
|
|
6255
6256
|
block: true,
|
|
6256
|
-
size:
|
|
6257
|
-
type:
|
|
6258
|
-
priority:
|
|
6257
|
+
size: import_components32.Size.MEDIUM,
|
|
6258
|
+
type: import_components32.ControlType.ACCENT,
|
|
6259
|
+
priority: import_components32.Priority.SECONDARY,
|
|
6259
6260
|
onClick: onRetry,
|
|
6260
6261
|
children: intl.formatMessage(CameraCapture_messages_default.reviewRetry)
|
|
6261
6262
|
}
|
|
@@ -6307,13 +6308,13 @@ function OrientationLockOverlay() {
|
|
|
6307
6308
|
var OrientationLockOverlay_default = OrientationLockOverlay;
|
|
6308
6309
|
|
|
6309
6310
|
// src/legacy/step/cameraStep/cameraCapture/screens/cameraErrorScreen/CameraErrorScreen.tsx
|
|
6310
|
-
var
|
|
6311
|
+
var import_components33 = require("@transferwise/components");
|
|
6311
6312
|
var import_jsx_runtime60 = require("react/jsx-runtime");
|
|
6312
6313
|
function CameraErrorScreen({ title, description, actionButton, onAction }) {
|
|
6313
6314
|
return /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("div", { className: "container p-t-5", children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("div", { className: "row", children: /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("div", { className: "col-md-6 col-md-offset-3", children: [
|
|
6314
6315
|
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)("h2", { className: "text-xs-center m-b-3", children: title }),
|
|
6315
6316
|
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)("p", { className: "text-xs-center m-b-5", children: description }),
|
|
6316
|
-
onAction && actionButton && /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
6317
|
+
onAction && actionButton && /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(import_components33.Button, { block: true, onClick: onAction, children: actionButton })
|
|
6317
6318
|
] }) }) });
|
|
6318
6319
|
}
|
|
6319
6320
|
var CameraErrorScreen_default = CameraErrorScreen;
|
|
@@ -6897,7 +6898,7 @@ function getOrigin(url) {
|
|
|
6897
6898
|
}
|
|
6898
6899
|
|
|
6899
6900
|
// src/legacy/dynamicFlow/BackButton.tsx
|
|
6900
|
-
var
|
|
6901
|
+
var import_components35 = require("@transferwise/components");
|
|
6901
6902
|
var import_icons2 = require("@transferwise/icons");
|
|
6902
6903
|
var import_jsx_runtime65 = require("react/jsx-runtime");
|
|
6903
6904
|
function BackButton({ title, action, onAction }) {
|
|
@@ -6913,7 +6914,7 @@ function BackButton({ title, action, onAction }) {
|
|
|
6913
6914
|
},
|
|
6914
6915
|
children: [
|
|
6915
6916
|
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)("span", { className: "sr-only", children: title }),
|
|
6916
|
-
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
6917
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)(import_components35.Avatar, { type: "icon", children: /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(import_icons2.ArrowLeft, { size: "24" }) })
|
|
6917
6918
|
]
|
|
6918
6919
|
}
|
|
6919
6920
|
);
|
|
@@ -7081,19 +7082,19 @@ var getSchemaReference = (component) => {
|
|
|
7081
7082
|
var isInlineSchema = (schema) => schema !== void 0 && typeof schema === "object" && !Object.hasOwnProperty.call(schema, "$ref");
|
|
7082
7083
|
|
|
7083
7084
|
// src/legacy/dynamicFlow/utils/useLoader.tsx
|
|
7084
|
-
var
|
|
7085
|
+
var import_components36 = require("@transferwise/components");
|
|
7085
7086
|
var import_react42 = require("react");
|
|
7086
7087
|
var import_jsx_runtime67 = require("react/jsx-runtime");
|
|
7087
7088
|
function useLoader(loaderConfig, initialState) {
|
|
7088
7089
|
const config = __spreadValues({
|
|
7089
|
-
size:
|
|
7090
|
+
size: import_components36.Size.EXTRA_LARGE,
|
|
7090
7091
|
initial: true,
|
|
7091
7092
|
submission: false
|
|
7092
7093
|
}, loaderConfig);
|
|
7093
7094
|
const [loadingState, setLoadingState] = (0, import_react42.useState)(initialState);
|
|
7094
7095
|
const shouldDisplayLoader = config.initial && loadingState === "initial" || config.submission && loadingState === "submission";
|
|
7095
7096
|
const loader = shouldDisplayLoader ? /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
7096
|
-
|
|
7097
|
+
import_components36.Loader,
|
|
7097
7098
|
{
|
|
7098
7099
|
size: config.size,
|
|
7099
7100
|
classNames: { "tw-loader": "tw-loader m-x-auto" },
|
|
@@ -7107,20 +7108,20 @@ function useLoader(loaderConfig, initialState) {
|
|
|
7107
7108
|
var import_react43 = require("react");
|
|
7108
7109
|
|
|
7109
7110
|
// src/common/errorBoundary/ErrorBoundaryAlert.tsx
|
|
7110
|
-
var
|
|
7111
|
+
var import_components37 = require("@transferwise/components");
|
|
7111
7112
|
var import_react_intl29 = require("react-intl");
|
|
7112
7113
|
var import_jsx_runtime68 = require("react/jsx-runtime");
|
|
7113
7114
|
function ErrorBoundaryAlert({ onDismiss }) {
|
|
7114
7115
|
const { formatMessage } = (0, import_react_intl29.useIntl)();
|
|
7115
7116
|
return /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
|
|
7116
|
-
|
|
7117
|
+
import_components37.Alert,
|
|
7117
7118
|
{
|
|
7118
7119
|
action: {
|
|
7119
7120
|
text: formatMessage(ErrorBoundary_messages_default.retry),
|
|
7120
7121
|
href: window.location.href
|
|
7121
7122
|
},
|
|
7122
7123
|
message: formatMessage(ErrorBoundary_messages_default.errorAlert),
|
|
7123
|
-
type:
|
|
7124
|
+
type: import_components37.Sentiment.NEGATIVE,
|
|
7124
7125
|
className: "m-b-3",
|
|
7125
7126
|
onDismiss
|
|
7126
7127
|
}
|