@wise/dynamic-flow-client 2.8.9 → 2.8.11
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 +118 -132
- package/build/main.min.js +1 -1
- package/build/types/common/messages/validation.array.messages.d.ts +13 -0
- package/build/types/legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/repeatableSchema/RepeatableSchema.d.ts +3 -3
- 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/legacy/layout/icon/FlagIcon.d.ts +1 -1
- package/build/types/legacy/layout/icon/NamedIcon.d.ts +1 -1
- package/build/types/revamp/domain/components/BooleanInputComponent.d.ts +9 -0
- package/build/types/revamp/domain/components/DateInputComponent.d.ts +4 -3
- package/build/types/revamp/domain/components/HiddenComponent.d.ts +4 -6
- package/build/types/revamp/domain/components/IntegerInputComponent.d.ts +4 -3
- package/build/types/revamp/domain/components/NumberInputComponent.d.ts +4 -3
- package/build/types/revamp/domain/components/ObjectComponent.d.ts +8 -9
- package/build/types/revamp/domain/components/SelectInputComponent.d.ts +30 -0
- package/build/types/revamp/domain/components/TextInputComponent.d.ts +4 -3
- package/build/types/revamp/domain/components/UploadInputComponent.d.ts +4 -3
- package/build/types/revamp/domain/components/repeatableComponent/RepeatableComponent.d.ts +31 -0
- package/build/types/revamp/domain/components/searchComponent/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/features/summary/summary-utils.d.ts +32 -0
- package/build/types/revamp/domain/{validation → features/validation}/spec-utils.d.ts +2 -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 +4 -2
- package/build/types/revamp/domain/mappers/layout/alertLayoutToComponent.d.ts +1 -1
- package/build/types/revamp/domain/mappers/layout/boxLayoutToComponents.d.ts +1 -1
- package/build/types/revamp/domain/mappers/layout/buttonLayoutToComponent.d.ts +1 -1
- package/build/types/revamp/domain/mappers/layout/columnsLayoutToComponent.d.ts +1 -1
- package/build/types/revamp/domain/mappers/layout/formLayoutToComponent.d.ts +1 -1
- package/build/types/revamp/domain/mappers/layout/headingLayoutToComponent.d.ts +1 -1
- package/build/types/revamp/domain/mappers/layout/paragraphLayoutToComponent.d.ts +1 -1
- package/build/types/revamp/domain/mappers/layout/searchLayoutToComponent.d.ts +3 -0
- package/build/types/revamp/domain/mappers/mapLayoutToComponent.d.ts +1 -1
- package/build/types/revamp/domain/mappers/mapSchemaToComponent.d.ts +1 -1
- package/build/types/revamp/domain/mappers/schema/arraySchemaToComponent/arraySchemaToComponent.d.ts +5 -0
- package/build/types/revamp/domain/mappers/schema/arraySchemaToComponent/arraySchemaToRepeatableComponent.d.ts +6 -0
- package/build/types/revamp/domain/mappers/schema/booleanSchemaToComponent.d.ts +5 -0
- package/build/types/revamp/domain/mappers/schema/constSchemaToComponent.d.ts +1 -1
- package/build/types/revamp/domain/mappers/schema/integerSchemaToComponent.d.ts +1 -1
- package/build/types/revamp/domain/mappers/schema/numberSchemaToComponent.d.ts +1 -1
- package/build/types/revamp/domain/mappers/schema/objectSchemaToComponent/objectSchemaToComponent.d.ts +1 -1
- package/build/types/revamp/domain/mappers/schema/oneOfSchemaToComponent/oneOfSchemaToComponent.d.ts +5 -0
- package/build/types/revamp/domain/mappers/schema/stringSchemaToComponent/stringSchemaToComponent.d.ts +1 -1
- package/build/types/revamp/domain/mappers/schema/stringSchemaToComponent/stringSchemaToDateInputComponent.d.ts +1 -1
- package/build/types/revamp/domain/mappers/schema/stringSchemaToComponent/stringSchemaToTextInputComponent.d.ts +1 -1
- package/build/types/revamp/domain/mappers/schema/stringSchemaToComponent/stringSchemaToUploadInputComponent.d.ts +1 -1
- 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/mappers/types.d.ts +2 -0
- package/build/types/revamp/domain/mappers/utils/getRandomId.d.ts +1 -0
- package/build/types/revamp/domain/types.d.ts +20 -8
- package/build/types/revamp/domain/validation/validation-functions.d.ts +8 -0
- 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 +4 -3
- package/build/types/revamp/renderers/mappers/objectComponentToProps.d.ts +1 -1
- package/build/types/revamp/renderers/mappers/repeatableComponentToProps.d.ts +4 -0
- 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/mappers/utils/inputComponentToProps.d.ts +19 -0
- package/build/types/revamp/renderers/types.d.ts +109 -30
- 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/stories/visual-tests/array.d.ts +3 -0
- package/build/types/revamp/test-utils/component-utils.d.ts +2 -0
- package/build/types/revamp/utils/type-utils.d.ts +11 -5
- package/build/types/revamp/wise/renderers/BooleanInputRenderer.d.ts +3 -0
- package/build/types/revamp/wise/renderers/RepeatableRenderer.d.ts +3 -0
- package/build/types/revamp/wise/renderers/SearchRenderer.d.ts +14 -0
- package/build/types/revamp/wise/renderers/SelectInputRenderer/OptionMedia.d.ts +5 -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/SelectTriggerMedia.d.ts +5 -0
- package/build/types/revamp/wise/renderers/SelectInputRenderer/TabInputRendererComponent.d.ts +2 -0
- package/build/types/revamp/wise/renderers/components/FieldInput.d.ts +2 -1
- 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/revamp/wise/renderers/components/icon/NavigationOptionMedia.d.ts +5 -0
- package/build/types/test-utils/fetch-utils.d.ts +19 -0
- package/package.json +7 -6
- /package/build/types/{legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/repeatableSchema/RepeatableSchema.messages.d.ts → common/messages/repeatable.messages.d.ts} +0 -0
- /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/main.js
CHANGED
|
@@ -2057,7 +2057,7 @@ var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
|
2057
2057
|
var isFlagIcon = (name) => isCurrencyFlagIcon(name) || isCountryFlagIcon(name);
|
|
2058
2058
|
var isCurrencyFlagIcon = (name) => currencyCodes.some((currencyCode) => name === `flag-${currencyCode}`);
|
|
2059
2059
|
var isCountryFlagIcon = (name) => countryCodes.some((countryCode) => name === `flag-${countryCode}`);
|
|
2060
|
-
|
|
2060
|
+
function FlagIcon({ name }) {
|
|
2061
2061
|
if (!isFlagIcon(name)) {
|
|
2062
2062
|
return null;
|
|
2063
2063
|
}
|
|
@@ -2067,10 +2067,11 @@ var FlagIcon = ({ name }) => {
|
|
|
2067
2067
|
{
|
|
2068
2068
|
src: `https://wise.com/web-art/assets/flags/${code}.svg`,
|
|
2069
2069
|
alt: "",
|
|
2070
|
-
"data-testid": `img-flag-${code}
|
|
2070
|
+
"data-testid": `img-flag-${code}`,
|
|
2071
|
+
width: "24px"
|
|
2071
2072
|
}
|
|
2072
2073
|
);
|
|
2073
|
-
}
|
|
2074
|
+
}
|
|
2074
2075
|
var currencyCodes = [
|
|
2075
2076
|
"aed",
|
|
2076
2077
|
"ars",
|
|
@@ -2261,23 +2262,20 @@ var isNamedIcon = (name) => {
|
|
|
2261
2262
|
const iconName = toCapitalisedCamelCase(name);
|
|
2262
2263
|
return Object.keys(icons).includes(iconName);
|
|
2263
2264
|
};
|
|
2264
|
-
|
|
2265
|
+
function NamedIcon({ name }) {
|
|
2265
2266
|
if (!isNamedIcon(name)) {
|
|
2266
2267
|
return null;
|
|
2267
2268
|
}
|
|
2268
2269
|
const iconName = toCapitalisedCamelCase(name);
|
|
2269
2270
|
const Icon = icons[iconName];
|
|
2270
2271
|
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Icon, { size: 24 });
|
|
2271
|
-
}
|
|
2272
|
+
}
|
|
2272
2273
|
var toCapitalisedCamelCase = (value) => value.split("-").map(capitaliseFirstChar).join("");
|
|
2273
|
-
var capitaliseFirstChar = (value) => {
|
|
2274
|
-
var _a;
|
|
2275
|
-
return `${(_a = value[0]) == null ? void 0 : _a.toUpperCase()}${value.slice(1)}`;
|
|
2276
|
-
};
|
|
2274
|
+
var capitaliseFirstChar = (value) => `${value[0].toUpperCase()}${value.slice(1)}`;
|
|
2277
2275
|
|
|
2278
2276
|
// src/legacy/layout/icon/DynamicIcon.tsx
|
|
2279
2277
|
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
2280
|
-
|
|
2278
|
+
function DynamicIcon({ type }) {
|
|
2281
2279
|
if (isFlagIcon(type)) {
|
|
2282
2280
|
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(FlagIcon, { name: type });
|
|
2283
2281
|
}
|
|
@@ -2285,7 +2283,7 @@ var DynamicIcon = ({ type }) => {
|
|
|
2285
2283
|
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(NamedIcon, { name: type });
|
|
2286
2284
|
}
|
|
2287
2285
|
return null;
|
|
2288
|
-
}
|
|
2286
|
+
}
|
|
2289
2287
|
function isValidIconName(name) {
|
|
2290
2288
|
return isNamedIcon(name) || isFlagIcon(name);
|
|
2291
2289
|
}
|
|
@@ -2477,7 +2475,7 @@ var getButtonSize = (size) => {
|
|
|
2477
2475
|
|
|
2478
2476
|
// src/legacy/layout/button/DynamicButton.tsx
|
|
2479
2477
|
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
2480
|
-
|
|
2478
|
+
function DynamicButton(props) {
|
|
2481
2479
|
var _a;
|
|
2482
2480
|
const { component, onAction } = props;
|
|
2483
2481
|
const componentAction = component.action;
|
|
@@ -2493,12 +2491,12 @@ var DynamicButton = (props) => {
|
|
|
2493
2491
|
priority,
|
|
2494
2492
|
block: true,
|
|
2495
2493
|
className,
|
|
2496
|
-
disabled: component.disabled || componentAction.disabled
|
|
2494
|
+
disabled: loading || component.disabled || componentAction.disabled,
|
|
2497
2495
|
onClick: () => onAction(componentAction),
|
|
2498
2496
|
children: (_a = component.title) != null ? _a : componentAction.title
|
|
2499
2497
|
}
|
|
2500
2498
|
);
|
|
2501
|
-
}
|
|
2499
|
+
}
|
|
2502
2500
|
var DynamicButton_default = DynamicButton;
|
|
2503
2501
|
|
|
2504
2502
|
// src/legacy/layout/columns/DynamicColumns.tsx
|
|
@@ -2558,22 +2556,19 @@ var import_components4 = require("@transferwise/components");
|
|
|
2558
2556
|
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
2559
2557
|
function DynamicDecision({ component, onAction }) {
|
|
2560
2558
|
const { loading } = useDynamicFlow();
|
|
2561
|
-
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) =>
|
|
2562
|
-
|
|
2563
|
-
|
|
2564
|
-
|
|
2565
|
-
|
|
2566
|
-
|
|
2567
|
-
|
|
2568
|
-
|
|
2569
|
-
|
|
2570
|
-
|
|
2571
|
-
|
|
2572
|
-
|
|
2573
|
-
|
|
2574
|
-
JSON.stringify(option)
|
|
2575
|
-
);
|
|
2576
|
-
}) }) });
|
|
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
|
+
)) }) });
|
|
2577
2572
|
}
|
|
2578
2573
|
var DynamicDecision_default = DynamicDecision;
|
|
2579
2574
|
|
|
@@ -3026,9 +3021,9 @@ var ItemSummaryOption = ({
|
|
|
3026
3021
|
);
|
|
3027
3022
|
};
|
|
3028
3023
|
|
|
3029
|
-
// src/
|
|
3024
|
+
// src/common/messages/repeatable.messages.ts
|
|
3030
3025
|
var import_react_intl9 = require("react-intl");
|
|
3031
|
-
var
|
|
3026
|
+
var repeatable_messages_default = (0, import_react_intl9.defineMessages)({
|
|
3032
3027
|
addItemTitle: {
|
|
3033
3028
|
id: "dynamicFlows.ArraySchema.addItemTitle",
|
|
3034
3029
|
defaultMessage: "Add Item",
|
|
@@ -3075,7 +3070,7 @@ function RepeatableSchemaStep({
|
|
|
3075
3070
|
control: "primary",
|
|
3076
3071
|
action: {
|
|
3077
3072
|
url: type,
|
|
3078
|
-
title: formatMessage(type === "add" ?
|
|
3073
|
+
title: formatMessage(type === "add" ? repeatable_messages_default.addItem : repeatable_messages_default.editItem)
|
|
3079
3074
|
}
|
|
3080
3075
|
},
|
|
3081
3076
|
...type === "edit" ? [
|
|
@@ -3084,7 +3079,7 @@ function RepeatableSchemaStep({
|
|
|
3084
3079
|
context: "negative",
|
|
3085
3080
|
action: {
|
|
3086
3081
|
url: "remove",
|
|
3087
|
-
title: formatMessage(
|
|
3082
|
+
title: formatMessage(repeatable_messages_default.removeItem)
|
|
3088
3083
|
}
|
|
3089
3084
|
}
|
|
3090
3085
|
] : []
|
|
@@ -3298,13 +3293,7 @@ var schemaSummaryProvides = (summary, providesProp) => (
|
|
|
3298
3293
|
|
|
3299
3294
|
// src/legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/repeatableSchema/RepeatableSchema.tsx
|
|
3300
3295
|
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
3301
|
-
|
|
3302
|
-
schema,
|
|
3303
|
-
model,
|
|
3304
|
-
errors,
|
|
3305
|
-
submitted,
|
|
3306
|
-
onChange
|
|
3307
|
-
}) => {
|
|
3296
|
+
function RepeatableSchema({ schema, model, errors, submitted, onChange }) {
|
|
3308
3297
|
const [openModalType, setOpenModalType] = (0, import_react13.useState)(null);
|
|
3309
3298
|
const [itemSummaries, setItemSummaries] = (0, import_react13.useState)(() => {
|
|
3310
3299
|
if (isObject(model) && !isArray(model)) {
|
|
@@ -3364,18 +3353,17 @@ var RepeatableSchema = ({
|
|
|
3364
3353
|
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
3365
3354
|
import_components10.NavigationOption,
|
|
3366
3355
|
{
|
|
3367
|
-
onClick: onAddItem,
|
|
3368
3356
|
media: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_icons.Plus, {}),
|
|
3369
|
-
title: schema.addItemTitle || formatMessage(
|
|
3370
|
-
showMediaAtAllSizes: true
|
|
3357
|
+
title: schema.addItemTitle || formatMessage(repeatable_messages_default.addItemTitle),
|
|
3358
|
+
showMediaAtAllSizes: true,
|
|
3359
|
+
onClick: onAddItem
|
|
3371
3360
|
}
|
|
3372
3361
|
),
|
|
3373
3362
|
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
3374
3363
|
import_components10.Modal,
|
|
3375
3364
|
{
|
|
3376
3365
|
open: openModalType !== null,
|
|
3377
|
-
|
|
3378
|
-
title: (openModalType === "add" ? schema.addItemTitle : schema.editItemTitle) || formatMessage(RepeatableSchema_messages_default.addItemTitle),
|
|
3366
|
+
title: (openModalType === "add" ? schema.addItemTitle : schema.editItemTitle) || formatMessage(repeatable_messages_default.addItemTitle),
|
|
3379
3367
|
body: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
3380
3368
|
RepeatableSchemaStep_default,
|
|
3381
3369
|
{
|
|
@@ -3387,11 +3375,12 @@ var RepeatableSchema = ({
|
|
|
3387
3375
|
onAction: onSaveItem,
|
|
3388
3376
|
onModelChange: ({ model: model2 }) => setEditableItem(__spreadProps(__spreadValues({}, editableItem), { model: model2 }))
|
|
3389
3377
|
}
|
|
3390
|
-
)
|
|
3378
|
+
),
|
|
3379
|
+
onClose: onCancelEdit
|
|
3391
3380
|
}
|
|
3392
3381
|
)
|
|
3393
3382
|
] });
|
|
3394
|
-
}
|
|
3383
|
+
}
|
|
3395
3384
|
var getUpdatedItemSummaries = (action, {
|
|
3396
3385
|
originalItem,
|
|
3397
3386
|
updatedItem,
|
|
@@ -3449,6 +3438,7 @@ ArraySchema.defaultProps = {
|
|
|
3449
3438
|
var ArraySchema_default = ArraySchema;
|
|
3450
3439
|
|
|
3451
3440
|
// src/legacy/jsonSchemaForm/objectSchema/ObjectSchema.tsx
|
|
3441
|
+
var import_components11 = require("@transferwise/components");
|
|
3452
3442
|
var import_classnames3 = __toESM(require_classnames());
|
|
3453
3443
|
var import_react14 = require("react");
|
|
3454
3444
|
var import_jsx_runtime25 = require("react/jsx-runtime");
|
|
@@ -3490,11 +3480,7 @@ function ObjectSchema(props) {
|
|
|
3490
3480
|
return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(import_jsx_runtime25.Fragment, { children: [
|
|
3491
3481
|
props.schema.alert && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(DynamicAlert_default, { component: props.schema.alert }),
|
|
3492
3482
|
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("fieldset", { children: [
|
|
3493
|
-
props.schema.title && !props.hideTitle && /* @__PURE__ */ (0, import_jsx_runtime25.
|
|
3494
|
-
" ",
|
|
3495
|
-
props.schema.title,
|
|
3496
|
-
" "
|
|
3497
|
-
] }),
|
|
3483
|
+
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 }) }),
|
|
3498
3484
|
props.schema.description && !props.hideTitle && /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("p", { children: [
|
|
3499
3485
|
" ",
|
|
3500
3486
|
props.schema.description,
|
|
@@ -3532,12 +3518,12 @@ ObjectSchema.defaultProps = {
|
|
|
3532
3518
|
var ObjectSchema_default = ObjectSchema;
|
|
3533
3519
|
|
|
3534
3520
|
// src/legacy/jsonSchemaForm/oneOfSchema/OneOfSchema.tsx
|
|
3535
|
-
var
|
|
3521
|
+
var import_components15 = require("@transferwise/components");
|
|
3536
3522
|
var import_classnames4 = __toESM(require_classnames());
|
|
3537
3523
|
var import_react17 = require("react");
|
|
3538
3524
|
|
|
3539
3525
|
// src/legacy/jsonSchemaForm/help/Help.tsx
|
|
3540
|
-
var
|
|
3526
|
+
var import_components12 = require("@transferwise/components");
|
|
3541
3527
|
var import_react_intl13 = require("react-intl");
|
|
3542
3528
|
|
|
3543
3529
|
// src/common/messages/help.messages.ts
|
|
@@ -3555,10 +3541,10 @@ var import_jsx_runtime26 = require("react/jsx-runtime");
|
|
|
3555
3541
|
function Help(props) {
|
|
3556
3542
|
const intl = (0, import_react_intl13.useIntl)();
|
|
3557
3543
|
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
3558
|
-
|
|
3544
|
+
import_components12.Info,
|
|
3559
3545
|
{
|
|
3560
3546
|
className: "m-l-1",
|
|
3561
|
-
content: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
3547
|
+
content: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_components12.Markdown, { children: props.help.markdown }),
|
|
3562
3548
|
presentation: "POPOVER",
|
|
3563
3549
|
size: "sm",
|
|
3564
3550
|
"aria-label": intl.formatMessage(help_messages_default.helpAria)
|
|
@@ -3571,7 +3557,7 @@ var Help_default = Help;
|
|
|
3571
3557
|
var import_react16 = require("react");
|
|
3572
3558
|
|
|
3573
3559
|
// src/legacy/formControl/FormControl.tsx
|
|
3574
|
-
var
|
|
3560
|
+
var import_components13 = require("@transferwise/components");
|
|
3575
3561
|
var import_react15 = require("react");
|
|
3576
3562
|
|
|
3577
3563
|
// src/legacy/formControl/utils/value-utils.ts
|
|
@@ -3851,7 +3837,7 @@ var _FormControl = class _FormControl extends import_react15.PureComponent {
|
|
|
3851
3837
|
switch (type) {
|
|
3852
3838
|
case FormControlType.RADIO:
|
|
3853
3839
|
return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
3854
|
-
|
|
3840
|
+
import_components13.RadioGroup,
|
|
3855
3841
|
{
|
|
3856
3842
|
radios: options.map(this.mapOption),
|
|
3857
3843
|
name,
|
|
@@ -3861,7 +3847,7 @@ var _FormControl = class _FormControl extends import_react15.PureComponent {
|
|
|
3861
3847
|
);
|
|
3862
3848
|
case FormControlType.CHECKBOX:
|
|
3863
3849
|
return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
3864
|
-
|
|
3850
|
+
import_components13.Checkbox,
|
|
3865
3851
|
{
|
|
3866
3852
|
checked: getSafeBooleanValue(value, { coerceValue: true }),
|
|
3867
3853
|
disabled,
|
|
@@ -3876,7 +3862,7 @@ var _FormControl = class _FormControl extends import_react15.PureComponent {
|
|
|
3876
3862
|
case FormControlType.SELECT: {
|
|
3877
3863
|
const search = options.length >= 20;
|
|
3878
3864
|
return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
3879
|
-
|
|
3865
|
+
import_components13.Select,
|
|
3880
3866
|
{
|
|
3881
3867
|
id,
|
|
3882
3868
|
selected: this.getSelectedOption(options),
|
|
@@ -3900,7 +3886,7 @@ var _FormControl = class _FormControl extends import_react15.PureComponent {
|
|
|
3900
3886
|
}
|
|
3901
3887
|
case FormControlType.TAB:
|
|
3902
3888
|
return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
3903
|
-
|
|
3889
|
+
import_components13.Tabs,
|
|
3904
3890
|
{
|
|
3905
3891
|
selected: ((_a = this.getSelectedOption(options)) == null ? void 0 : _a.value) || 0,
|
|
3906
3892
|
tabs: options.map((option) => ({
|
|
@@ -3985,7 +3971,7 @@ var _FormControl = class _FormControl extends import_react15.PureComponent {
|
|
|
3985
3971
|
case FormControlType.DATE:
|
|
3986
3972
|
case FormControlType.DATETIME:
|
|
3987
3973
|
return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
3988
|
-
|
|
3974
|
+
import_components13.DateInput,
|
|
3989
3975
|
{
|
|
3990
3976
|
disabled,
|
|
3991
3977
|
size,
|
|
@@ -3999,7 +3985,7 @@ var _FormControl = class _FormControl extends import_react15.PureComponent {
|
|
|
3999
3985
|
);
|
|
4000
3986
|
case FormControlType.DATELOOKUP: {
|
|
4001
3987
|
return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
4002
|
-
|
|
3988
|
+
import_components13.DateLookup,
|
|
4003
3989
|
{
|
|
4004
3990
|
value: getSafeDateStringValue(value),
|
|
4005
3991
|
min: minDate,
|
|
@@ -4017,7 +4003,7 @@ var _FormControl = class _FormControl extends import_react15.PureComponent {
|
|
|
4017
4003
|
}
|
|
4018
4004
|
case FormControlType.TEL:
|
|
4019
4005
|
return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
4020
|
-
|
|
4006
|
+
import_components13.PhoneNumberInput,
|
|
4021
4007
|
{
|
|
4022
4008
|
disabled,
|
|
4023
4009
|
countryCode,
|
|
@@ -4049,7 +4035,7 @@ var _FormControl = class _FormControl extends import_react15.PureComponent {
|
|
|
4049
4035
|
};
|
|
4050
4036
|
if (this.props.displayPattern) {
|
|
4051
4037
|
return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
4052
|
-
|
|
4038
|
+
import_components13.TextareaWithDisplayFormat,
|
|
4053
4039
|
__spreadProps(__spreadValues({
|
|
4054
4040
|
displayPattern: this.props.displayPattern
|
|
4055
4041
|
}, textareaProps), {
|
|
@@ -4071,7 +4057,7 @@ var _FormControl = class _FormControl extends import_react15.PureComponent {
|
|
|
4071
4057
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
4072
4058
|
// @ts-expect-error - TODO: Remove this once Upload is migrated to TypeScript
|
|
4073
4059
|
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
4074
|
-
|
|
4060
|
+
import_components13.Upload,
|
|
4075
4061
|
__spreadProps(__spreadValues({}, uploadProps), {
|
|
4076
4062
|
usAccept: uploadProps.usAccept || "*",
|
|
4077
4063
|
usDisabled: uploadProps.usDisabled || disabled,
|
|
@@ -4109,7 +4095,7 @@ var _FormControl = class _FormControl extends import_react15.PureComponent {
|
|
|
4109
4095
|
};
|
|
4110
4096
|
if (this.props.displayPattern) {
|
|
4111
4097
|
return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
4112
|
-
|
|
4098
|
+
import_components13.InputWithDisplayFormat,
|
|
4113
4099
|
__spreadProps(__spreadValues({
|
|
4114
4100
|
displayPattern: this.props.displayPattern
|
|
4115
4101
|
}, inputProps), {
|
|
@@ -4166,7 +4152,7 @@ _FormControl.defaultProps = {
|
|
|
4166
4152
|
var FormControl = _FormControl;
|
|
4167
4153
|
|
|
4168
4154
|
// src/legacy/jsonSchemaForm/schemaFormControl/utils/mapping-utils.tsx
|
|
4169
|
-
var
|
|
4155
|
+
var import_components14 = require("@transferwise/components");
|
|
4170
4156
|
var import_jsx_runtime28 = require("react/jsx-runtime");
|
|
4171
4157
|
var mapConstSchemaToOption = (schema, controlType) => {
|
|
4172
4158
|
switch (controlType) {
|
|
@@ -4211,17 +4197,17 @@ var getIconPropertyForSelectOption = (icon) => {
|
|
|
4211
4197
|
var getAvatarPropertyForRadioOption = ({ image, icon }) => {
|
|
4212
4198
|
if (image == null ? void 0 : image.url) {
|
|
4213
4199
|
return {
|
|
4214
|
-
avatar: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
4200
|
+
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: "" }) })
|
|
4215
4201
|
};
|
|
4216
4202
|
}
|
|
4217
4203
|
if ((icon == null ? void 0 : icon.name) && isValidIconName(icon.name)) {
|
|
4218
4204
|
return {
|
|
4219
|
-
avatar: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
4205
|
+
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 }) })
|
|
4220
4206
|
};
|
|
4221
4207
|
}
|
|
4222
4208
|
if (icon == null ? void 0 : icon.text) {
|
|
4223
4209
|
return {
|
|
4224
|
-
avatar: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
4210
|
+
avatar: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_components14.Avatar, { type: import_components14.AvatarType.INITIALS, children: icon.text })
|
|
4225
4211
|
};
|
|
4226
4212
|
}
|
|
4227
4213
|
return null;
|
|
@@ -4505,7 +4491,7 @@ function getTitleAndHelp(schema, id) {
|
|
|
4505
4491
|
schema.title,
|
|
4506
4492
|
" ",
|
|
4507
4493
|
helpElement
|
|
4508
|
-
] }) : /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
4494
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_components15.Header, { title: (_a = schema.title) != null ? _a : "" }) });
|
|
4509
4495
|
return schema.title ? titleElement : helpElement;
|
|
4510
4496
|
}
|
|
4511
4497
|
function getValidations(props, schemaIndex) {
|
|
@@ -4545,7 +4531,7 @@ var import_classnames5 = __toESM(require_classnames());
|
|
|
4545
4531
|
var import_react19 = require("react");
|
|
4546
4532
|
|
|
4547
4533
|
// src/legacy/jsonSchemaForm/persistAsyncSchema/persistAsyncBlobSchema/UploadInputAdapter.tsx
|
|
4548
|
-
var
|
|
4534
|
+
var import_components16 = require("@transferwise/components");
|
|
4549
4535
|
var import_react18 = require("react");
|
|
4550
4536
|
var import_jsx_runtime31 = require("react/jsx-runtime");
|
|
4551
4537
|
function UploadInputAdapter(props) {
|
|
@@ -4563,7 +4549,7 @@ function UploadInputAdapter(props) {
|
|
|
4563
4549
|
onCancel
|
|
4564
4550
|
} = props;
|
|
4565
4551
|
const onEvent = useEventDispatcher();
|
|
4566
|
-
const files = (0, import_react18.useMemo)(() => fileId ? [{ id: fileId, status:
|
|
4552
|
+
const files = (0, import_react18.useMemo)(() => fileId ? [{ id: fileId, status: import_components16.Status.SUCCEEDED }] : [], [fileId]);
|
|
4567
4553
|
const uploadFile = (formData) => {
|
|
4568
4554
|
onEvent("Dynamic Flow - PersistAsync", { status: "pending", schemaId: id });
|
|
4569
4555
|
return httpClient(String(httpOptions.url), {
|
|
@@ -4581,7 +4567,7 @@ function UploadInputAdapter(props) {
|
|
|
4581
4567
|
});
|
|
4582
4568
|
};
|
|
4583
4569
|
return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
4584
|
-
|
|
4570
|
+
import_components16.UploadInput,
|
|
4585
4571
|
{
|
|
4586
4572
|
id,
|
|
4587
4573
|
fileInputName: httpOptions.fileInputName,
|
|
@@ -4717,7 +4703,7 @@ var getSelectionFromModel = (schema, model) => {
|
|
|
4717
4703
|
};
|
|
4718
4704
|
|
|
4719
4705
|
// src/legacy/jsonSchemaForm/promotedOneOfSchema/promotedOneOfControl/PromotedOneOfCheckboxControl.tsx
|
|
4720
|
-
var
|
|
4706
|
+
var import_components17 = require("@transferwise/components");
|
|
4721
4707
|
var import_jsx_runtime34 = require("react/jsx-runtime");
|
|
4722
4708
|
var PromotedOneOfCheckboxControl = (props) => {
|
|
4723
4709
|
const { id, selection, setSelection } = props;
|
|
@@ -4729,13 +4715,13 @@ var PromotedOneOfCheckboxControl = (props) => {
|
|
|
4729
4715
|
const toggleSelection = () => {
|
|
4730
4716
|
setSelection(checked ? selectionWhenUnchecked : selectionWhenChecked);
|
|
4731
4717
|
};
|
|
4732
|
-
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: "form-group", children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
4718
|
+
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 }) });
|
|
4733
4719
|
};
|
|
4734
4720
|
PromotedOneOfCheckboxControl.defaultProps = {};
|
|
4735
4721
|
var PromotedOneOfCheckboxControl_default = PromotedOneOfCheckboxControl;
|
|
4736
4722
|
|
|
4737
4723
|
// src/legacy/jsonSchemaForm/promotedOneOfSchema/promotedOneOfControl/PromotedOneOfRadioControl.tsx
|
|
4738
|
-
var
|
|
4724
|
+
var import_components18 = require("@transferwise/components");
|
|
4739
4725
|
var import_jsx_runtime35 = require("react/jsx-runtime");
|
|
4740
4726
|
function PromotedOneOfRadioControl(props) {
|
|
4741
4727
|
var _a, _b;
|
|
@@ -4756,7 +4742,7 @@ function PromotedOneOfRadioControl(props) {
|
|
|
4756
4742
|
return /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "form-group", children: [
|
|
4757
4743
|
title && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("label", { className: "control-label", htmlFor: id, children: title }),
|
|
4758
4744
|
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
4759
|
-
|
|
4745
|
+
import_components18.RadioGroup,
|
|
4760
4746
|
{
|
|
4761
4747
|
name: "promoted-selection",
|
|
4762
4748
|
selectedValue: selection,
|
|
@@ -4847,7 +4833,7 @@ function getOtherOneOf(schema) {
|
|
|
4847
4833
|
var PromotedOneOfSchema_default = PromotedOneOfSchema;
|
|
4848
4834
|
|
|
4849
4835
|
// src/legacy/jsonSchemaForm/readOnlySchema/ReadOnlySchema.tsx
|
|
4850
|
-
var
|
|
4836
|
+
var import_components19 = require("@transferwise/components");
|
|
4851
4837
|
var import_react_intl15 = require("react-intl");
|
|
4852
4838
|
|
|
4853
4839
|
// src/legacy/jsonSchemaForm/readOnlySchema/ReadOnlySchema.messages.js
|
|
@@ -4871,7 +4857,7 @@ function ReadOnlySchema({ schema, model }) {
|
|
|
4871
4857
|
const { title = "" } = schema;
|
|
4872
4858
|
const { formatMessage } = (0, import_react_intl15.useIntl)();
|
|
4873
4859
|
const value = getValueForSchema({ schema, model, formatMessage });
|
|
4874
|
-
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
4860
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_components19.DefinitionList, { layout: import_components19.Layout.VERTICAL_ONE_COLUMN, definitions: [{ title, value, key: "" }] });
|
|
4875
4861
|
}
|
|
4876
4862
|
var ReadOnlySchema_default = ReadOnlySchema;
|
|
4877
4863
|
function getValueForSchema({
|
|
@@ -5096,7 +5082,7 @@ function DynamicForm({
|
|
|
5096
5082
|
var DynamicForm_default = DynamicForm;
|
|
5097
5083
|
|
|
5098
5084
|
// src/legacy/layout/heading/DynamicHeading.tsx
|
|
5099
|
-
var
|
|
5085
|
+
var import_components20 = require("@transferwise/components");
|
|
5100
5086
|
var import_classnames6 = __toESM(require_classnames());
|
|
5101
5087
|
var import_jsx_runtime42 = require("react/jsx-runtime");
|
|
5102
5088
|
var DynamicHeading = (props) => {
|
|
@@ -5123,30 +5109,30 @@ var DisplayHeading = ({ size, text, classes }) => {
|
|
|
5123
5109
|
switch (size) {
|
|
5124
5110
|
case "xs":
|
|
5125
5111
|
case "sm":
|
|
5126
|
-
return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
5112
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_components20.Display, { type: "display-small", className: classes, children: text });
|
|
5127
5113
|
case "xl":
|
|
5128
5114
|
case "lg":
|
|
5129
|
-
return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
5115
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_components20.Display, { type: "display-large", className: classes, children: text });
|
|
5130
5116
|
case "md":
|
|
5131
5117
|
default:
|
|
5132
|
-
return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
5118
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_components20.Display, { type: "display-medium", className: classes, children: text });
|
|
5133
5119
|
}
|
|
5134
5120
|
};
|
|
5135
5121
|
var DynamicHeading_default = DynamicHeading;
|
|
5136
5122
|
|
|
5137
5123
|
// src/legacy/layout/markdown/DynamicMarkdown.tsx
|
|
5138
|
-
var
|
|
5124
|
+
var import_components21 = require("@transferwise/components");
|
|
5139
5125
|
var import_jsx_runtime43 = require("react/jsx-runtime");
|
|
5140
5126
|
var DynamicMarkdown = ({ component }) => {
|
|
5141
5127
|
const { content, align, margin } = component;
|
|
5142
|
-
return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("div", { className: getTextAlignmentAndMargin({ align, margin }), children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
5128
|
+
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 }) });
|
|
5143
5129
|
};
|
|
5144
5130
|
var DynamicInfo = ({ component }) => {
|
|
5145
|
-
return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("div", { className: getTextAlignmentAndMargin(component), children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
5131
|
+
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 }) });
|
|
5146
5132
|
};
|
|
5147
5133
|
|
|
5148
5134
|
// src/legacy/layout/image/DynamicImage.tsx
|
|
5149
|
-
var
|
|
5135
|
+
var import_components22 = require("@transferwise/components");
|
|
5150
5136
|
var import_react24 = require("react");
|
|
5151
5137
|
var import_jsx_runtime44 = require("react/jsx-runtime");
|
|
5152
5138
|
function DynamicImage({ component: image }) {
|
|
@@ -5165,7 +5151,7 @@ function DynamicImage({ component: image }) {
|
|
|
5165
5151
|
if (!imageSource) {
|
|
5166
5152
|
return null;
|
|
5167
5153
|
}
|
|
5168
|
-
return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("div", { className: `df-image ${size || "md"}`, children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
5154
|
+
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)) });
|
|
5169
5155
|
}
|
|
5170
5156
|
var readImageBlobAsDataURL = (imageBlob) => (
|
|
5171
5157
|
// we can safely assume the type of reader.result is string
|
|
@@ -5201,7 +5187,7 @@ var getImageSource = async (httpClient, imageUrl) => {
|
|
|
5201
5187
|
var DynamicImage_default = DynamicImage;
|
|
5202
5188
|
|
|
5203
5189
|
// src/legacy/layout/instructions/DynamicInstructions.tsx
|
|
5204
|
-
var
|
|
5190
|
+
var import_components23 = require("@transferwise/components");
|
|
5205
5191
|
var import_jsx_runtime45 = require("react/jsx-runtime");
|
|
5206
5192
|
var doContext = ["positive", "neutral"];
|
|
5207
5193
|
var dontContext = ["warning", "negative"];
|
|
@@ -5210,8 +5196,8 @@ var DynamicInstructions = ({ component }) => {
|
|
|
5210
5196
|
const dos = items.filter((item) => doContext.includes(item.context)).map(({ text }) => text);
|
|
5211
5197
|
const donts = items.filter((item) => dontContext.includes(item.context)).map(({ text }) => text);
|
|
5212
5198
|
return /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("div", { className: getMargin(component.margin || "md"), children: [
|
|
5213
|
-
component.title ? /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
5214
|
-
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
5199
|
+
component.title ? /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_components23.Header, { title: component.title }) : null,
|
|
5200
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_components23.InstructionsList, { dos, donts })
|
|
5215
5201
|
] });
|
|
5216
5202
|
};
|
|
5217
5203
|
var DynamicInstructions_default = DynamicInstructions;
|
|
@@ -5321,11 +5307,11 @@ function DynamicLayout(props) {
|
|
|
5321
5307
|
var DynamicLayout_default = DynamicLayout;
|
|
5322
5308
|
|
|
5323
5309
|
// src/legacy/layout/list/DynamicStatusList.tsx
|
|
5324
|
-
var
|
|
5310
|
+
var import_components24 = require("@transferwise/components");
|
|
5325
5311
|
var import_jsx_runtime47 = require("react/jsx-runtime");
|
|
5326
5312
|
var DynamicStatusList = ({ component }) => {
|
|
5327
5313
|
return /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("div", { className: getMargin(component.margin || "md"), children: [
|
|
5328
|
-
component.title ? /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
5314
|
+
component.title ? /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_components24.Header, { title: component.title }) : null,
|
|
5329
5315
|
component.items.map(mapListItemToSummary)
|
|
5330
5316
|
] });
|
|
5331
5317
|
};
|
|
@@ -5335,7 +5321,7 @@ var mapListItemToSummary = ({ title, description, icon, status }) => {
|
|
|
5335
5321
|
title,
|
|
5336
5322
|
description
|
|
5337
5323
|
}, (icon == null ? void 0 : icon.name) ? { icon: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(DynamicIcon_default, { type: icon.name }) } : {}), status ? { status: statusMap[status] } : {});
|
|
5338
|
-
return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
5324
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_components24.Summary, __spreadValues({}, props));
|
|
5339
5325
|
};
|
|
5340
5326
|
var statusListMap = {
|
|
5341
5327
|
done: "done",
|
|
@@ -5351,12 +5337,12 @@ var statusMap = __spreadValues(__spreadValues({}, statusListMap), legacyStatusMa
|
|
|
5351
5337
|
var DynamicStatusList_default = DynamicStatusList;
|
|
5352
5338
|
|
|
5353
5339
|
// src/legacy/layout/loadingIndicator/DynamicLoadingIndicator.tsx
|
|
5354
|
-
var
|
|
5340
|
+
var import_components25 = require("@transferwise/components");
|
|
5355
5341
|
var import_jsx_runtime48 = require("react/jsx-runtime");
|
|
5356
5342
|
var DynamicLoadingIndicator = ({ component }) => {
|
|
5357
5343
|
const { margin = "md", size = "md" } = component;
|
|
5358
5344
|
return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
5359
|
-
|
|
5345
|
+
import_components25.Loader,
|
|
5360
5346
|
{
|
|
5361
5347
|
size,
|
|
5362
5348
|
classNames: {
|
|
@@ -5369,7 +5355,7 @@ var DynamicLoadingIndicator = ({ component }) => {
|
|
|
5369
5355
|
var DynamicLoadingIndicator_default = DynamicLoadingIndicator;
|
|
5370
5356
|
|
|
5371
5357
|
// src/legacy/layout/paragraph/DynamicParagraph.tsx
|
|
5372
|
-
var
|
|
5358
|
+
var import_components27 = require("@transferwise/components");
|
|
5373
5359
|
var import_react_intl17 = require("react-intl");
|
|
5374
5360
|
|
|
5375
5361
|
// src/common/messages/paragraph.messages.ts
|
|
@@ -5388,10 +5374,10 @@ var paragraph_messages_default = (0, import_react_intl16.defineMessages)({
|
|
|
5388
5374
|
});
|
|
5389
5375
|
|
|
5390
5376
|
// src/legacy/layout/paragraph/useSnackBarIfAvailable.ts
|
|
5391
|
-
var
|
|
5377
|
+
var import_components26 = require("@transferwise/components");
|
|
5392
5378
|
var import_react25 = require("react");
|
|
5393
5379
|
function useSnackBarIfAvailable() {
|
|
5394
|
-
const context = (0, import_react25.useContext)(
|
|
5380
|
+
const context = (0, import_react25.useContext)(import_components26.SnackbarContext);
|
|
5395
5381
|
return context ? context.createSnackbar : noop2;
|
|
5396
5382
|
}
|
|
5397
5383
|
function noop2() {
|
|
@@ -5432,7 +5418,7 @@ function CopyableDynamicParagraph({ component }) {
|
|
|
5432
5418
|
style: { textOverflow: "ellipsis" }
|
|
5433
5419
|
}
|
|
5434
5420
|
),
|
|
5435
|
-
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
5421
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_components27.Button, { block: true, onClick: copy, children: formatMessage(paragraph_messages_default.copy) })
|
|
5436
5422
|
] });
|
|
5437
5423
|
}
|
|
5438
5424
|
function noop3() {
|
|
@@ -5440,7 +5426,7 @@ function noop3() {
|
|
|
5440
5426
|
var DynamicParagraph_default = DynamicParagraph;
|
|
5441
5427
|
|
|
5442
5428
|
// src/legacy/layout/review/DynamicReview.tsx
|
|
5443
|
-
var
|
|
5429
|
+
var import_components28 = require("@transferwise/components");
|
|
5444
5430
|
var import_jsx_runtime50 = require("react/jsx-runtime");
|
|
5445
5431
|
var getDefinitions = (orientation, review) => review.fields.map(({ label, value, help }, index) => ({
|
|
5446
5432
|
key: String(index),
|
|
@@ -5482,8 +5468,8 @@ function DynamicReview(props) {
|
|
|
5482
5468
|
const callToAction = review.callToAction ? getReviewAction(review.callToAction.title, review.callToAction.action) : null;
|
|
5483
5469
|
const legacyCallToAction = !callToAction && review.action ? getReviewAction(review.action.title || "", review.action) : null;
|
|
5484
5470
|
return /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("div", { className: margin, children: [
|
|
5485
|
-
review.title && /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
5486
|
-
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)("div", { className: margin, children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
5471
|
+
review.title && /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_components28.Header, { title: review.title, action: callToAction || legacyCallToAction || void 0 }),
|
|
5472
|
+
/* @__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) }) })
|
|
5487
5473
|
] });
|
|
5488
5474
|
}
|
|
5489
5475
|
var DynamicReview_default = DynamicReview;
|
|
@@ -5492,13 +5478,13 @@ var DynamicReview_default = DynamicReview;
|
|
|
5492
5478
|
var import_react27 = require("react");
|
|
5493
5479
|
|
|
5494
5480
|
// src/legacy/layout/search/SearchInput.tsx
|
|
5495
|
-
var
|
|
5481
|
+
var import_components29 = require("@transferwise/components");
|
|
5496
5482
|
var import_jsx_runtime51 = require("react/jsx-runtime");
|
|
5497
5483
|
var SearchInput = ({ title, value, onFocus, onChange }) => {
|
|
5498
5484
|
return /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("label", { className: "control-label d-inline", children: [
|
|
5499
5485
|
title,
|
|
5500
5486
|
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
5501
|
-
|
|
5487
|
+
import_components29.Input,
|
|
5502
5488
|
{
|
|
5503
5489
|
type: "text",
|
|
5504
5490
|
value,
|
|
@@ -5511,7 +5497,7 @@ var SearchInput = ({ title, value, onFocus, onChange }) => {
|
|
|
5511
5497
|
};
|
|
5512
5498
|
|
|
5513
5499
|
// src/legacy/layout/search/SearchResults.tsx
|
|
5514
|
-
var
|
|
5500
|
+
var import_components30 = require("@transferwise/components");
|
|
5515
5501
|
var import_react_intl19 = require("react-intl");
|
|
5516
5502
|
|
|
5517
5503
|
// src/common/errorBoundary/ErrorBoundary.messages.ts
|
|
@@ -5535,9 +5521,9 @@ var SearchResults = ({ results, emptyMessage, onSelect }) => {
|
|
|
5535
5521
|
if (results.length === 0) {
|
|
5536
5522
|
return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("p", { className: "m-t-2", children: emptyMessage });
|
|
5537
5523
|
}
|
|
5538
|
-
return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
5524
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_components30.NavigationOptionsList, { children: results.map((result) => {
|
|
5539
5525
|
return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
5540
|
-
|
|
5526
|
+
import_components30.NavigationOption,
|
|
5541
5527
|
{
|
|
5542
5528
|
title: result.title,
|
|
5543
5529
|
content: result.description,
|
|
@@ -5683,7 +5669,7 @@ function DynamicSearch({ component, onAction }) {
|
|
|
5683
5669
|
var DynamicSearch_default = DynamicSearch;
|
|
5684
5670
|
|
|
5685
5671
|
// src/legacy/layout/modal/DynamicModal.tsx
|
|
5686
|
-
var
|
|
5672
|
+
var import_components31 = require("@transferwise/components");
|
|
5687
5673
|
var import_react28 = require("react");
|
|
5688
5674
|
var import_jsx_runtime54 = require("react/jsx-runtime");
|
|
5689
5675
|
var DynamicModal = (props) => {
|
|
@@ -5691,9 +5677,9 @@ var DynamicModal = (props) => {
|
|
|
5691
5677
|
const { component, onAction } = props;
|
|
5692
5678
|
const { margin = "md" } = component;
|
|
5693
5679
|
return /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { className: getTextAlignmentAndMargin({ margin }), children: [
|
|
5694
|
-
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
5680
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)(import_components31.Button, { priority: "tertiary", block: true, onClick: () => isVisible(true), children: component.trigger.title }),
|
|
5695
5681
|
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
5696
|
-
|
|
5682
|
+
import_components31.Modal,
|
|
5697
5683
|
{
|
|
5698
5684
|
scroll: "content",
|
|
5699
5685
|
onClose: () => isVisible(false),
|
|
@@ -6236,7 +6222,7 @@ var CameraCapture_messages_default = (0, import_react_intl22.defineMessages)({
|
|
|
6236
6222
|
});
|
|
6237
6223
|
|
|
6238
6224
|
// src/legacy/step/cameraStep/cameraCapture/components/bottomBar/BottomBar.tsx
|
|
6239
|
-
var
|
|
6225
|
+
var import_components32 = require("@transferwise/components");
|
|
6240
6226
|
var import_react_intl23 = require("react-intl");
|
|
6241
6227
|
var import_jsx_runtime58 = require("react/jsx-runtime");
|
|
6242
6228
|
var CaptureBottomBar = ({ onCapture }) => /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("div", { className: "bottom-bar", children: /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(CaptureButton, { onClick: onCapture }) });
|
|
@@ -6247,24 +6233,24 @@ var ReviewBottomBar = ({
|
|
|
6247
6233
|
const intl = (0, import_react_intl23.useIntl)();
|
|
6248
6234
|
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: [
|
|
6249
6235
|
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
6250
|
-
|
|
6236
|
+
import_components32.Button,
|
|
6251
6237
|
{
|
|
6252
6238
|
className: "m-b-1",
|
|
6253
6239
|
block: true,
|
|
6254
|
-
size:
|
|
6255
|
-
type:
|
|
6240
|
+
size: import_components32.Size.MEDIUM,
|
|
6241
|
+
type: import_components32.ControlType.ACCENT,
|
|
6256
6242
|
onClick: onSubmit,
|
|
6257
6243
|
children: intl.formatMessage(CameraCapture_messages_default.reviewSubmit)
|
|
6258
6244
|
}
|
|
6259
6245
|
),
|
|
6260
6246
|
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
6261
|
-
|
|
6247
|
+
import_components32.Button,
|
|
6262
6248
|
{
|
|
6263
6249
|
className: "m-b-2",
|
|
6264
6250
|
block: true,
|
|
6265
|
-
size:
|
|
6266
|
-
type:
|
|
6267
|
-
priority:
|
|
6251
|
+
size: import_components32.Size.MEDIUM,
|
|
6252
|
+
type: import_components32.ControlType.ACCENT,
|
|
6253
|
+
priority: import_components32.Priority.SECONDARY,
|
|
6268
6254
|
onClick: onRetry,
|
|
6269
6255
|
children: intl.formatMessage(CameraCapture_messages_default.reviewRetry)
|
|
6270
6256
|
}
|
|
@@ -6316,13 +6302,13 @@ function OrientationLockOverlay() {
|
|
|
6316
6302
|
var OrientationLockOverlay_default = OrientationLockOverlay;
|
|
6317
6303
|
|
|
6318
6304
|
// src/legacy/step/cameraStep/cameraCapture/screens/cameraErrorScreen/CameraErrorScreen.tsx
|
|
6319
|
-
var
|
|
6305
|
+
var import_components33 = require("@transferwise/components");
|
|
6320
6306
|
var import_jsx_runtime60 = require("react/jsx-runtime");
|
|
6321
6307
|
function CameraErrorScreen({ title, description, actionButton, onAction }) {
|
|
6322
6308
|
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: [
|
|
6323
6309
|
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)("h2", { className: "text-xs-center m-b-3", children: title }),
|
|
6324
6310
|
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)("p", { className: "text-xs-center m-b-5", children: description }),
|
|
6325
|
-
onAction && actionButton && /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
6311
|
+
onAction && actionButton && /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(import_components33.Button, { block: true, onClick: onAction, children: actionButton })
|
|
6326
6312
|
] }) }) });
|
|
6327
6313
|
}
|
|
6328
6314
|
var CameraErrorScreen_default = CameraErrorScreen;
|
|
@@ -6906,7 +6892,7 @@ function getOrigin(url) {
|
|
|
6906
6892
|
}
|
|
6907
6893
|
|
|
6908
6894
|
// src/legacy/dynamicFlow/BackButton.tsx
|
|
6909
|
-
var
|
|
6895
|
+
var import_components35 = require("@transferwise/components");
|
|
6910
6896
|
var import_icons2 = require("@transferwise/icons");
|
|
6911
6897
|
var import_jsx_runtime65 = require("react/jsx-runtime");
|
|
6912
6898
|
function BackButton({ title, action, onAction }) {
|
|
@@ -6922,7 +6908,7 @@ function BackButton({ title, action, onAction }) {
|
|
|
6922
6908
|
},
|
|
6923
6909
|
children: [
|
|
6924
6910
|
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)("span", { className: "sr-only", children: title }),
|
|
6925
|
-
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
6911
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)(import_components35.Avatar, { type: "icon", children: /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(import_icons2.ArrowLeft, { size: "24" }) })
|
|
6926
6912
|
]
|
|
6927
6913
|
}
|
|
6928
6914
|
);
|
|
@@ -7090,19 +7076,19 @@ var getSchemaReference = (component) => {
|
|
|
7090
7076
|
var isInlineSchema = (schema) => schema !== void 0 && typeof schema === "object" && !Object.hasOwnProperty.call(schema, "$ref");
|
|
7091
7077
|
|
|
7092
7078
|
// src/legacy/dynamicFlow/utils/useLoader.tsx
|
|
7093
|
-
var
|
|
7079
|
+
var import_components36 = require("@transferwise/components");
|
|
7094
7080
|
var import_react42 = require("react");
|
|
7095
7081
|
var import_jsx_runtime67 = require("react/jsx-runtime");
|
|
7096
7082
|
function useLoader(loaderConfig, initialState) {
|
|
7097
7083
|
const config = __spreadValues({
|
|
7098
|
-
size:
|
|
7084
|
+
size: import_components36.Size.EXTRA_LARGE,
|
|
7099
7085
|
initial: true,
|
|
7100
7086
|
submission: false
|
|
7101
7087
|
}, loaderConfig);
|
|
7102
7088
|
const [loadingState, setLoadingState] = (0, import_react42.useState)(initialState);
|
|
7103
7089
|
const shouldDisplayLoader = config.initial && loadingState === "initial" || config.submission && loadingState === "submission";
|
|
7104
7090
|
const loader = shouldDisplayLoader ? /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
7105
|
-
|
|
7091
|
+
import_components36.Loader,
|
|
7106
7092
|
{
|
|
7107
7093
|
size: config.size,
|
|
7108
7094
|
classNames: { "tw-loader": "tw-loader m-x-auto" },
|
|
@@ -7116,20 +7102,20 @@ function useLoader(loaderConfig, initialState) {
|
|
|
7116
7102
|
var import_react43 = require("react");
|
|
7117
7103
|
|
|
7118
7104
|
// src/common/errorBoundary/ErrorBoundaryAlert.tsx
|
|
7119
|
-
var
|
|
7105
|
+
var import_components37 = require("@transferwise/components");
|
|
7120
7106
|
var import_react_intl29 = require("react-intl");
|
|
7121
7107
|
var import_jsx_runtime68 = require("react/jsx-runtime");
|
|
7122
7108
|
function ErrorBoundaryAlert({ onDismiss }) {
|
|
7123
7109
|
const { formatMessage } = (0, import_react_intl29.useIntl)();
|
|
7124
7110
|
return /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
|
|
7125
|
-
|
|
7111
|
+
import_components37.Alert,
|
|
7126
7112
|
{
|
|
7127
7113
|
action: {
|
|
7128
7114
|
text: formatMessage(ErrorBoundary_messages_default.retry),
|
|
7129
7115
|
href: window.location.href
|
|
7130
7116
|
},
|
|
7131
7117
|
message: formatMessage(ErrorBoundary_messages_default.errorAlert),
|
|
7132
|
-
type:
|
|
7118
|
+
type: import_components37.Sentiment.NEGATIVE,
|
|
7133
7119
|
className: "m-b-3",
|
|
7134
7120
|
onDismiss
|
|
7135
7121
|
}
|