@wise/dynamic-flow-client-internal 5.33.0 → 5.34.0-experimental-18a8b47
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/i18n/en.json +2 -0
- package/build/main.css +54 -0
- package/build/main.js +1024 -746
- package/build/main.mjs +870 -587
- package/build/tsconfig.types.tsbuildinfo +1 -1
- package/package.json +4 -4
- package/build/dynamicFlow/DynamicFlow.js +0 -11
- package/build/dynamicFlow/DynamicFlowModal.js +0 -21
- package/build/dynamicFlow/DynamicFlowWiseProps.js +0 -1
- package/build/dynamicFlow/DynamicFlowWithRef.js +0 -19
- package/build/dynamicFlow/context-menu/useContextMenu.js +0 -33
- package/build/dynamicFlow/context-menu/useDFContextMenu.js +0 -135
- package/build/dynamicFlow/context-menu/useDFContextMenu.test.js +0 -101
- package/build/dynamicFlow/getMergedRenderers.js +0 -36
- package/build/dynamicFlow/messages.js +0 -13
- package/build/dynamicFlow/renderers.js +0 -10
- package/build/dynamicFlow/telemetry/app-version.js +0 -4
- package/build/dynamicFlow/telemetry/dispatchAnalyticsEvent.js +0 -8
- package/build/dynamicFlow/telemetry/getLogEvent.js +0 -22
- package/build/dynamicFlow/telemetry/getTrackEvent.js +0 -39
- package/build/dynamicFlow/telemetry/index.js +0 -2
- package/build/dynamicFlow/useCreateSnackBar.js +0 -9
- package/build/dynamicFlow/useOnCopy.js +0 -16
- package/build/dynamicFlow/useWiseHttpClient.js +0 -24
- package/build/dynamicFlow/useWiseToCoreProps.js +0 -42
- package/build/i18n/index.js +0 -43
- package/build/index.js +0 -6
- package/build/stories/ButtonLoader.story.js +0 -109
- package/build/stories/ContainerQueries.story.js +0 -74
- package/build/stories/DynamicFlow.story.js +0 -37
- package/build/stories/DynamicFlowWithRef.story.js +0 -72
- package/build/stories/Editable.story.js +0 -58
- package/build/stories/Initialisation.story.js +0 -33
- package/build/stories/PinnedButtons.story.js +0 -94
- package/build/stories/SCAIntegration.story.js +0 -67
- package/build/stories/utils/fixtureHttpClient.js +0 -59
- package/build/test-utils/NeptuneProviders.js +0 -11
- package/build/test-utils/index.js +0 -4
- package/build/test-utils/respond-with.js +0 -6
- package/build/test-utils/rtl-utils.js +0 -7
- package/build/test-utils/wait.js +0 -3
- package/build/tests/DynamicFlow.test.js +0 -177
- package/build/tests/HideStepTitle.test.js +0 -58
- package/build/tests/RequestCache.test.js +0 -34
- package/build/tests/SCARejectionHandling.test.js +0 -71
- package/build/tests/Subflow.Wise.test.js +0 -650
- package/build/tests/events.test.js +0 -124
- package/build/tests/logging.test.js +0 -12
- package/build/tests/onNotification.test.js +0 -96
- package/build/tests/renderers/ControlAndTags.test.js +0 -225
- package/build/tests/renderers/ImageRenderer.test.js +0 -129
- package/build/tests/renderers/RadioInputRendererComponent.test.js +0 -89
- package/build/tests/renderers/ReviewRenderer.test.js +0 -41
- package/build/tests/renderers/TextInputRenderer.test.js +0 -245
- package/build/tests/renderers/TimeZoneHeader.test.js +0 -19
- package/build/tests/renderers/UploadInputRenderer.maxSize.test.js +0 -22
- package/build/tests/renderers/value-utils.test.js +0 -24
package/build/main.js
CHANGED
|
@@ -70,7 +70,7 @@ var require_classnames = __commonJS({
|
|
|
70
70
|
(function() {
|
|
71
71
|
"use strict";
|
|
72
72
|
var hasOwn = {}.hasOwnProperty;
|
|
73
|
-
function
|
|
73
|
+
function classNames38() {
|
|
74
74
|
var classes = "";
|
|
75
75
|
for (var i = 0; i < arguments.length; i++) {
|
|
76
76
|
var arg = arguments[i];
|
|
@@ -88,7 +88,7 @@ var require_classnames = __commonJS({
|
|
|
88
88
|
return "";
|
|
89
89
|
}
|
|
90
90
|
if (Array.isArray(arg)) {
|
|
91
|
-
return
|
|
91
|
+
return classNames38.apply(null, arg);
|
|
92
92
|
}
|
|
93
93
|
if (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes("[native code]")) {
|
|
94
94
|
return arg.toString();
|
|
@@ -111,14 +111,14 @@ var require_classnames = __commonJS({
|
|
|
111
111
|
return value + newClass;
|
|
112
112
|
}
|
|
113
113
|
if (typeof module2 !== "undefined" && module2.exports) {
|
|
114
|
-
|
|
115
|
-
module2.exports =
|
|
114
|
+
classNames38.default = classNames38;
|
|
115
|
+
module2.exports = classNames38;
|
|
116
116
|
} else if (typeof define === "function" && typeof define.amd === "object" && define.amd) {
|
|
117
117
|
define("classnames", [], function() {
|
|
118
|
-
return
|
|
118
|
+
return classNames38;
|
|
119
119
|
});
|
|
120
120
|
} else {
|
|
121
|
-
window.classNames =
|
|
121
|
+
window.classNames = classNames38;
|
|
122
122
|
}
|
|
123
123
|
})();
|
|
124
124
|
}
|
|
@@ -336,7 +336,7 @@ var recursivelyRemoveNullish = (element) => {
|
|
|
336
336
|
};
|
|
337
337
|
|
|
338
338
|
// src/dynamicFlow/useWiseToCoreProps.tsx
|
|
339
|
-
var
|
|
339
|
+
var import_react35 = require("react");
|
|
340
340
|
|
|
341
341
|
// src/dynamicFlow/getMergedRenderers.tsx
|
|
342
342
|
var import_dynamic_flow_client2 = require("@wise/dynamic-flow-client");
|
|
@@ -1659,8 +1659,8 @@ var getInlineAlertOrValidation = (validationState, inlineAlert) => {
|
|
|
1659
1659
|
};
|
|
1660
1660
|
var CheckboxInputRenderer_default = CheckboxInputRenderer;
|
|
1661
1661
|
|
|
1662
|
-
// ../renderers/src/CollectionRenderer/
|
|
1663
|
-
var
|
|
1662
|
+
// ../renderers/src/CollectionRenderer/CollectionRendererComponent.tsx
|
|
1663
|
+
var import_components15 = require("@transferwise/components");
|
|
1664
1664
|
|
|
1665
1665
|
// ../renderers/src/messages/generic-error.messages.ts
|
|
1666
1666
|
var import_react_intl5 = require("react-intl");
|
|
@@ -1682,6 +1682,29 @@ var generic_error_messages_default = (0, import_react_intl5.defineMessages)({
|
|
|
1682
1682
|
}
|
|
1683
1683
|
});
|
|
1684
1684
|
|
|
1685
|
+
// ../renderers/src/CollectionRenderer/CollectionRendererComponent.tsx
|
|
1686
|
+
var import_react_intl6 = require("react-intl");
|
|
1687
|
+
var import_jsx_runtime35 = require("react/jsx-runtime");
|
|
1688
|
+
var CollectionRendererComponent = (props) => {
|
|
1689
|
+
const { state, depth, Search: Search5, Filters, Results, FocusedResults } = props;
|
|
1690
|
+
const { status } = state;
|
|
1691
|
+
const isForked = depth > 0;
|
|
1692
|
+
const isError = status.type === "error" && (status.reason === "search" || status.reason === "filter");
|
|
1693
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(import_jsx_runtime35.Fragment, { children: [
|
|
1694
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(Search5, __spreadValues({}, props)),
|
|
1695
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(Filters, __spreadValues({}, props)),
|
|
1696
|
+
isError ? /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(SearchError, { retry: status.retry }) : isForked ? /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(FocusedResults, __spreadValues({}, props)) : /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(Results, __spreadValues({}, props))
|
|
1697
|
+
] });
|
|
1698
|
+
};
|
|
1699
|
+
var SearchError = ({ retry }) => {
|
|
1700
|
+
const { formatMessage } = (0, import_react_intl6.useIntl)();
|
|
1701
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(import_components15.InlinePrompt, { width: "full", sentiment: "negative", children: [
|
|
1702
|
+
formatMessage(generic_error_messages_default.genericError),
|
|
1703
|
+
"\xA0",
|
|
1704
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_components15.Link, { onClick: retry, children: formatMessage(generic_error_messages_default.retry) })
|
|
1705
|
+
] });
|
|
1706
|
+
};
|
|
1707
|
+
|
|
1685
1708
|
// ../../node_modules/.pnpm/@tanstack+react-virtual@3.14.10_react-dom@19.2.8_react@19.2.8__react@19.2.8/node_modules/@tanstack/react-virtual/dist/esm/index.js
|
|
1686
1709
|
var React = __toESM(require("react"), 1);
|
|
1687
1710
|
var import_react_dom = require("react-dom");
|
|
@@ -3218,18 +3241,18 @@ function useWindowVirtualizer(options) {
|
|
|
3218
3241
|
}, options));
|
|
3219
3242
|
}
|
|
3220
3243
|
|
|
3221
|
-
// ../renderers/src/CollectionRenderer/components/
|
|
3222
|
-
var
|
|
3244
|
+
// ../renderers/src/CollectionRenderer/components/VirtualisedContentComponent.tsx
|
|
3245
|
+
var import_components17 = require("@transferwise/components");
|
|
3223
3246
|
var import_react9 = require("react");
|
|
3224
3247
|
|
|
3225
3248
|
// ../renderers/src/step/StepFooter.tsx
|
|
3226
|
-
var
|
|
3249
|
+
var import_components16 = require("@transferwise/components");
|
|
3227
3250
|
var import_react8 = require("react");
|
|
3228
|
-
var
|
|
3251
|
+
var import_react_intl8 = require("react-intl");
|
|
3229
3252
|
|
|
3230
3253
|
// ../renderers/src/messages/step.messages.ts
|
|
3231
|
-
var
|
|
3232
|
-
var step_messages_default = (0,
|
|
3254
|
+
var import_react_intl7 = require("react-intl");
|
|
3255
|
+
var step_messages_default = (0, import_react_intl7.defineMessages)({
|
|
3233
3256
|
scrollToBottom: {
|
|
3234
3257
|
id: "df.wise.step.scrollToBottom",
|
|
3235
3258
|
defaultMessage: "Scroll to bottom",
|
|
@@ -3238,24 +3261,24 @@ var step_messages_default = (0, import_react_intl6.defineMessages)({
|
|
|
3238
3261
|
});
|
|
3239
3262
|
|
|
3240
3263
|
// ../renderers/src/step/StepFooter.tsx
|
|
3241
|
-
var
|
|
3264
|
+
var import_jsx_runtime36 = require("react/jsx-runtime");
|
|
3242
3265
|
var SCROLL_TO_BOTTOM = "scroll-to-bottom";
|
|
3243
3266
|
var StepFooter = ({ footer, tags }) => {
|
|
3244
3267
|
if (tags == null ? void 0 : tags.includes(SCROLL_TO_BOTTOM)) {
|
|
3245
|
-
return /* @__PURE__ */ (0,
|
|
3268
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(FooterWithScrollButton, { footer });
|
|
3246
3269
|
}
|
|
3247
|
-
return /* @__PURE__ */ (0,
|
|
3270
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(DefaultFooter, { footer });
|
|
3248
3271
|
};
|
|
3249
3272
|
var DefaultFooter = ({ footer }) => {
|
|
3250
3273
|
const hasFooter = footer && Array.isArray(footer) && footer.length > 0;
|
|
3251
|
-
return hasFooter ? /* @__PURE__ */ (0,
|
|
3274
|
+
return hasFooter ? /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { className: "df-step-fixed__footer", children: footer }) : void 0;
|
|
3252
3275
|
};
|
|
3253
3276
|
var FooterWithScrollButton = ({ footer }) => {
|
|
3254
|
-
const { formatMessage } = (0,
|
|
3277
|
+
const { formatMessage } = (0, import_react_intl8.useIntl)();
|
|
3255
3278
|
const endOfLayoutRef = (0, import_react8.useRef)(null);
|
|
3256
3279
|
const isElementVisible = useIsElementVisible(endOfLayoutRef);
|
|
3257
|
-
const scrollButton = /* @__PURE__ */ (0,
|
|
3258
|
-
|
|
3280
|
+
const scrollButton = /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
3281
|
+
import_components16.Button,
|
|
3259
3282
|
{
|
|
3260
3283
|
className: "m-b-1",
|
|
3261
3284
|
v2: true,
|
|
@@ -3270,11 +3293,11 @@ var FooterWithScrollButton = ({ footer }) => {
|
|
|
3270
3293
|
);
|
|
3271
3294
|
const hasStepFooterContent = footer && Array.isArray(footer) && footer.length > 0;
|
|
3272
3295
|
if (isElementVisible && !hasStepFooterContent) {
|
|
3273
|
-
return /* @__PURE__ */ (0,
|
|
3296
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { ref: endOfLayoutRef, "aria-hidden": "true" });
|
|
3274
3297
|
}
|
|
3275
|
-
return /* @__PURE__ */ (0,
|
|
3276
|
-
/* @__PURE__ */ (0,
|
|
3277
|
-
/* @__PURE__ */ (0,
|
|
3298
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(import_jsx_runtime36.Fragment, { children: [
|
|
3299
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { ref: endOfLayoutRef, "aria-hidden": "true" }),
|
|
3300
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "df-step-fixed__footer", children: [
|
|
3278
3301
|
!isElementVisible && scrollButton,
|
|
3279
3302
|
footer
|
|
3280
3303
|
] })
|
|
@@ -3297,12 +3320,12 @@ var useIsElementVisible = (elementRef, root = null) => {
|
|
|
3297
3320
|
return isVisible;
|
|
3298
3321
|
};
|
|
3299
3322
|
|
|
3300
|
-
// ../renderers/src/CollectionRenderer/components/
|
|
3301
|
-
var
|
|
3323
|
+
// ../renderers/src/CollectionRenderer/components/VirtualisedContentComponent.tsx
|
|
3324
|
+
var import_react_intl10 = require("react-intl");
|
|
3302
3325
|
|
|
3303
3326
|
// ../renderers/src/messages/collection.messages.ts
|
|
3304
|
-
var
|
|
3305
|
-
var collection_messages_default = (0,
|
|
3327
|
+
var import_react_intl9 = require("react-intl");
|
|
3328
|
+
var collection_messages_default = (0, import_react_intl9.defineMessages)({
|
|
3306
3329
|
loadMoreButton: {
|
|
3307
3330
|
id: "df.wise.Collection.loadMoreMessage",
|
|
3308
3331
|
defaultMessage: "Load more",
|
|
@@ -3312,6 +3335,16 @@ var collection_messages_default = (0, import_react_intl8.defineMessages)({
|
|
|
3312
3335
|
id: "df.wise.Collection.clearText",
|
|
3313
3336
|
defaultMessage: "Clear text",
|
|
3314
3337
|
description: "A message shown at the edge of the search bar to clear the users query"
|
|
3338
|
+
},
|
|
3339
|
+
showMoreResultsButton: {
|
|
3340
|
+
id: "df.wise.Collection.showMoreResultsButton",
|
|
3341
|
+
defaultMessage: "Show all {count} results",
|
|
3342
|
+
description: "A message shown at the bottom of a truncated list of items, clicking will expand to show more"
|
|
3343
|
+
},
|
|
3344
|
+
showLessResultsButton: {
|
|
3345
|
+
id: "df.wise.Collection.showLessResultsButton",
|
|
3346
|
+
defaultMessage: "Show less results",
|
|
3347
|
+
description: "A message shown at the bottom of an expanded list of items, clicking will truncate to show only a few"
|
|
3315
3348
|
}
|
|
3316
3349
|
});
|
|
3317
3350
|
|
|
@@ -3335,10 +3368,48 @@ var getScrollableAncestor = (element) => {
|
|
|
3335
3368
|
return null;
|
|
3336
3369
|
};
|
|
3337
3370
|
|
|
3338
|
-
// ../renderers/src/CollectionRenderer/components/
|
|
3339
|
-
var
|
|
3340
|
-
|
|
3341
|
-
|
|
3371
|
+
// ../renderers/src/CollectionRenderer/components/flattenCollectionItems.ts
|
|
3372
|
+
var flattenCollectionItems = (sections) => {
|
|
3373
|
+
return sections.flatMap((section) => {
|
|
3374
|
+
if (section.type === "items") {
|
|
3375
|
+
return flattenItemsBody(section);
|
|
3376
|
+
}
|
|
3377
|
+
if (section.type === "layout") {
|
|
3378
|
+
return flattenLayoutBody(section);
|
|
3379
|
+
}
|
|
3380
|
+
return [];
|
|
3381
|
+
});
|
|
3382
|
+
};
|
|
3383
|
+
var flattenItemsBody = (section) => {
|
|
3384
|
+
return [
|
|
3385
|
+
...flattenSectionHeader(section),
|
|
3386
|
+
...section.items.map((item) => ({
|
|
3387
|
+
item,
|
|
3388
|
+
type: "item"
|
|
3389
|
+
}))
|
|
3390
|
+
];
|
|
3391
|
+
};
|
|
3392
|
+
var flattenLayoutBody = (section) => [
|
|
3393
|
+
...flattenSectionHeader(section),
|
|
3394
|
+
__spreadProps(__spreadValues({}, section), {
|
|
3395
|
+
type: "layout"
|
|
3396
|
+
})
|
|
3397
|
+
];
|
|
3398
|
+
var flattenSectionHeader = (section) => section.title ? [
|
|
3399
|
+
{
|
|
3400
|
+
type: "header",
|
|
3401
|
+
title: section.title,
|
|
3402
|
+
items: section.type === "items" ? section.items : void 0,
|
|
3403
|
+
id: section.id,
|
|
3404
|
+
callToAction: section.callToAction
|
|
3405
|
+
}
|
|
3406
|
+
] : [];
|
|
3407
|
+
|
|
3408
|
+
// ../renderers/src/CollectionRenderer/components/VirtualisedContentComponent.tsx
|
|
3409
|
+
var import_jsx_runtime37 = require("react/jsx-runtime");
|
|
3410
|
+
var VirtualisedContentComponent = (props) => {
|
|
3411
|
+
const { state, SectionHeader, Item } = props;
|
|
3412
|
+
const { status } = state;
|
|
3342
3413
|
const contentRef = (0, import_react9.useRef)(null);
|
|
3343
3414
|
const [scrollElement, setScrollElement] = (0, import_react9.useState)(null);
|
|
3344
3415
|
(0, import_react9.useLayoutEffect)(() => {
|
|
@@ -3355,34 +3426,20 @@ var ContentComponent = (props) => {
|
|
|
3355
3426
|
status.loadMore();
|
|
3356
3427
|
}
|
|
3357
3428
|
}, [isBottomVisible, state.afterSectionsProps.length, status]);
|
|
3358
|
-
const stateCount = state.sections.reduce(
|
|
3359
|
-
|
|
3360
|
-
0
|
|
3361
|
-
);
|
|
3362
|
-
const items = state.sections
|
|
3363
|
-
...section.title ? [
|
|
3364
|
-
{
|
|
3365
|
-
type: "header",
|
|
3366
|
-
title: section.title,
|
|
3367
|
-
items: section.items,
|
|
3368
|
-
id: section.id,
|
|
3369
|
-
callToAction: section.callToAction
|
|
3370
|
-
}
|
|
3371
|
-
] : [],
|
|
3372
|
-
...section.items.map((item) => ({
|
|
3373
|
-
item,
|
|
3374
|
-
type: "item"
|
|
3375
|
-
}))
|
|
3376
|
-
]);
|
|
3429
|
+
const stateCount = state.sections.reduce((total, section) => {
|
|
3430
|
+
const count = section.type === "items" ? section.items.length : 1;
|
|
3431
|
+
return count + total + (section.title ? 1 : 0);
|
|
3432
|
+
}, 0);
|
|
3433
|
+
const items = flattenCollectionItems(state.sections);
|
|
3377
3434
|
const listRef = (0, import_react9.useRef)(null);
|
|
3378
3435
|
const listOffsetRef = (0, import_react9.useRef)(0);
|
|
3379
3436
|
(0, import_react9.useLayoutEffect)(() => {
|
|
3380
3437
|
var _a, _b;
|
|
3381
3438
|
listOffsetRef.current = (_b = (_a = listRef.current) == null ? void 0 : _a.offsetTop) != null ? _b : 0;
|
|
3382
3439
|
});
|
|
3383
|
-
return /* @__PURE__ */ (0,
|
|
3440
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", { ref: contentRef, children: [
|
|
3384
3441
|
state.beforeSections,
|
|
3385
|
-
scrollElement ? /* @__PURE__ */ (0,
|
|
3442
|
+
scrollElement ? /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
3386
3443
|
ElementVirtualizedItems,
|
|
3387
3444
|
{
|
|
3388
3445
|
Item,
|
|
@@ -3391,7 +3448,7 @@ var ContentComponent = (props) => {
|
|
|
3391
3448
|
scrollElement,
|
|
3392
3449
|
stateCount
|
|
3393
3450
|
}
|
|
3394
|
-
) : /* @__PURE__ */ (0,
|
|
3451
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
3395
3452
|
WindowVirtualizedItems,
|
|
3396
3453
|
{
|
|
3397
3454
|
Item,
|
|
@@ -3400,7 +3457,7 @@ var ContentComponent = (props) => {
|
|
|
3400
3457
|
stateCount
|
|
3401
3458
|
}
|
|
3402
3459
|
),
|
|
3403
|
-
/* @__PURE__ */ (0,
|
|
3460
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { ref: endOfContentRef, className: "d-flex m-x-auto m-y-2", children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(PaginationComponent, { state }) }),
|
|
3404
3461
|
state.afterSections
|
|
3405
3462
|
] });
|
|
3406
3463
|
};
|
|
@@ -3412,7 +3469,7 @@ var WindowVirtualizedItems = (props) => {
|
|
|
3412
3469
|
estimateSize: () => 120,
|
|
3413
3470
|
overscan: 10
|
|
3414
3471
|
});
|
|
3415
|
-
return /* @__PURE__ */ (0,
|
|
3472
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(VirtualizedItems, __spreadProps(__spreadValues({}, props), { virtualItemsRef, virtualizer }));
|
|
3416
3473
|
};
|
|
3417
3474
|
var ElementVirtualizedItems = (props) => {
|
|
3418
3475
|
const { scrollElement, stateCount } = props;
|
|
@@ -3423,7 +3480,7 @@ var ElementVirtualizedItems = (props) => {
|
|
|
3423
3480
|
estimateSize: () => 120,
|
|
3424
3481
|
overscan: 10
|
|
3425
3482
|
});
|
|
3426
|
-
return /* @__PURE__ */ (0,
|
|
3483
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(VirtualizedItems, __spreadProps(__spreadValues({}, props), { virtualItemsRef, virtualizer }));
|
|
3427
3484
|
};
|
|
3428
3485
|
var VirtualizedItems = ({
|
|
3429
3486
|
Item,
|
|
@@ -3431,7 +3488,7 @@ var VirtualizedItems = ({
|
|
|
3431
3488
|
items,
|
|
3432
3489
|
virtualItemsRef,
|
|
3433
3490
|
virtualizer
|
|
3434
|
-
}) => /* @__PURE__ */ (0,
|
|
3491
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
3435
3492
|
"div",
|
|
3436
3493
|
{
|
|
3437
3494
|
ref: virtualItemsRef,
|
|
@@ -3445,7 +3502,7 @@ var VirtualizedItems = ({
|
|
|
3445
3502
|
if (!i) {
|
|
3446
3503
|
return null;
|
|
3447
3504
|
}
|
|
3448
|
-
return /* @__PURE__ */ (0,
|
|
3505
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(
|
|
3449
3506
|
"div",
|
|
3450
3507
|
{
|
|
3451
3508
|
ref: virtualizer.measureElement,
|
|
@@ -3457,17 +3514,19 @@ var VirtualizedItems = ({
|
|
|
3457
3514
|
width: "100%",
|
|
3458
3515
|
transform: `translateY(${item.start - virtualizer.options.scrollMargin}px)`
|
|
3459
3516
|
},
|
|
3460
|
-
children:
|
|
3517
|
+
children: [
|
|
3518
|
+
i.type === "header" && /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(SectionHeader, __spreadValues({}, i)),
|
|
3519
|
+
i.type === "item" && /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(Item, __spreadValues({}, i.item)),
|
|
3520
|
+
i.type === "layout" && i.children
|
|
3521
|
+
]
|
|
3461
3522
|
},
|
|
3462
3523
|
item.key
|
|
3463
3524
|
);
|
|
3464
3525
|
})
|
|
3465
3526
|
}
|
|
3466
3527
|
);
|
|
3467
|
-
var PaginationComponent = ({
|
|
3468
|
-
status
|
|
3469
|
-
state
|
|
3470
|
-
}) => {
|
|
3528
|
+
var PaginationComponent = ({ state }) => {
|
|
3529
|
+
const { status } = state;
|
|
3471
3530
|
const isPaginationError = status.type === "error" && status.reason === "pagination";
|
|
3472
3531
|
const isPaginationLoading = status.type === "loading" && status.reason === "pagination";
|
|
3473
3532
|
const loadMore = status.type === "idle" ? status.loadMore : void 0;
|
|
@@ -3475,35 +3534,42 @@ var PaginationComponent = ({
|
|
|
3475
3534
|
return null;
|
|
3476
3535
|
}
|
|
3477
3536
|
if (isPaginationError) {
|
|
3478
|
-
return /* @__PURE__ */ (0,
|
|
3537
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(LoadMoreButton, { onClick: status.retry });
|
|
3479
3538
|
}
|
|
3480
3539
|
if (state.afterSectionsProps.length > 0 && loadMore) {
|
|
3481
|
-
return /* @__PURE__ */ (0,
|
|
3540
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(LoadMoreButton, { onClick: loadMore });
|
|
3482
3541
|
}
|
|
3483
|
-
return /* @__PURE__ */ (0,
|
|
3542
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_components17.ProcessIndicator, { size: "xs", "data-testid": "collection-pagination-loader" });
|
|
3484
3543
|
};
|
|
3485
3544
|
var LoadMoreButton = ({ onClick }) => {
|
|
3486
|
-
const { formatMessage } = (0,
|
|
3487
|
-
return /* @__PURE__ */ (0,
|
|
3545
|
+
const { formatMessage } = (0, import_react_intl10.useIntl)();
|
|
3546
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { className: "d-flex m-x-auto", children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_components17.Button, { v2: true, size: "sm", priority: "secondary-neutral", onClick, children: formatMessage(collection_messages_default.loadMoreButton) }) });
|
|
3488
3547
|
};
|
|
3489
3548
|
|
|
3490
|
-
// ../renderers/src/CollectionRenderer/
|
|
3491
|
-
var
|
|
3492
|
-
var
|
|
3493
|
-
var FiltersComponent = (
|
|
3494
|
-
const {
|
|
3495
|
-
|
|
3496
|
-
|
|
3497
|
-
|
|
3549
|
+
// ../renderers/src/CollectionRenderer/v1/FilterComponent.tsx
|
|
3550
|
+
var import_components18 = require("@transferwise/components");
|
|
3551
|
+
var import_jsx_runtime38 = require("react/jsx-runtime");
|
|
3552
|
+
var FiltersComponent = (props) => {
|
|
3553
|
+
const _a = props, { Filter } = _a, collectionProps = __objRest(_a, ["Filter"]);
|
|
3554
|
+
const { filters } = collectionProps.state;
|
|
3555
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { className: "df-filters-container", children: filters.map((filter) => {
|
|
3556
|
+
var _a2;
|
|
3557
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
3558
|
+
Filter,
|
|
3559
|
+
__spreadProps(__spreadValues({}, collectionProps), {
|
|
3560
|
+
filter
|
|
3561
|
+
}),
|
|
3562
|
+
JSON.stringify((_a2 = filter.options) == null ? void 0 : _a2.map((o) => o.value))
|
|
3563
|
+
);
|
|
3498
3564
|
}) });
|
|
3499
3565
|
};
|
|
3500
|
-
var FilterComponent = (filter) => {
|
|
3566
|
+
var FilterComponent = ({ filter }) => {
|
|
3501
3567
|
const { multiSelect, options } = filter;
|
|
3502
3568
|
if (!options) {
|
|
3503
3569
|
return null;
|
|
3504
3570
|
}
|
|
3505
|
-
return /* @__PURE__ */ (0,
|
|
3506
|
-
|
|
3571
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
3572
|
+
import_components18.Chips,
|
|
3507
3573
|
{
|
|
3508
3574
|
className: "m-b-1",
|
|
3509
3575
|
multiple: multiSelect,
|
|
@@ -3528,11 +3594,11 @@ var FilterComponent = (filter) => {
|
|
|
3528
3594
|
};
|
|
3529
3595
|
|
|
3530
3596
|
// ../renderers/src/CollectionRenderer/components/ItemComponent.tsx
|
|
3531
|
-
var
|
|
3597
|
+
var import_components21 = require("@transferwise/components");
|
|
3532
3598
|
|
|
3533
3599
|
// ../renderers/src/utils/listItem/getAdditionalInfo.tsx
|
|
3534
|
-
var
|
|
3535
|
-
var
|
|
3600
|
+
var import_components19 = require("@transferwise/components");
|
|
3601
|
+
var import_jsx_runtime39 = require("react/jsx-runtime");
|
|
3536
3602
|
var getAdditionalInfo = (additionalInfo) => {
|
|
3537
3603
|
var _a, _b;
|
|
3538
3604
|
if (!additionalInfo) {
|
|
@@ -3540,8 +3606,8 @@ var getAdditionalInfo = (additionalInfo) => {
|
|
|
3540
3606
|
}
|
|
3541
3607
|
const { href, text, onClick } = additionalInfo;
|
|
3542
3608
|
if (href || onClick) {
|
|
3543
|
-
return /* @__PURE__ */ (0,
|
|
3544
|
-
|
|
3609
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
3610
|
+
import_components19.ListItem.AdditionalInfo,
|
|
3545
3611
|
{
|
|
3546
3612
|
action: __spreadValues({
|
|
3547
3613
|
label: text
|
|
@@ -3549,20 +3615,20 @@ var getAdditionalInfo = (additionalInfo) => {
|
|
|
3549
3615
|
}
|
|
3550
3616
|
);
|
|
3551
3617
|
}
|
|
3552
|
-
return /* @__PURE__ */ (0,
|
|
3618
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_components19.ListItem.AdditionalInfo, { children: additionalInfo == null ? void 0 : additionalInfo.text });
|
|
3553
3619
|
};
|
|
3554
3620
|
|
|
3555
3621
|
// ../renderers/src/utils/listItem/getCTAControl.tsx
|
|
3556
|
-
var
|
|
3557
|
-
var
|
|
3622
|
+
var import_components20 = require("@transferwise/components");
|
|
3623
|
+
var import_jsx_runtime40 = require("react/jsx-runtime");
|
|
3558
3624
|
var getCTAControl = (callToAction, { ctaSecondary, fullyInteractive }) => {
|
|
3559
3625
|
if (!callToAction) {
|
|
3560
3626
|
return void 0;
|
|
3561
3627
|
}
|
|
3562
3628
|
const { accessibilityDescription, title, context } = callToAction;
|
|
3563
3629
|
const { priority, sentiment } = getPriorityAndSentiment(ctaSecondary, context);
|
|
3564
|
-
return /* @__PURE__ */ (0,
|
|
3565
|
-
|
|
3630
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
3631
|
+
import_components20.ListItem.Button,
|
|
3566
3632
|
__spreadProps(__spreadValues({}, callToAction.getAnchorProps()), {
|
|
3567
3633
|
partiallyInteractive: !fullyInteractive,
|
|
3568
3634
|
priority,
|
|
@@ -3586,7 +3652,7 @@ var shouldUseAvatar = (control, tags) => {
|
|
|
3586
3652
|
};
|
|
3587
3653
|
|
|
3588
3654
|
// ../renderers/src/CollectionRenderer/components/ItemComponent.tsx
|
|
3589
|
-
var
|
|
3655
|
+
var import_jsx_runtime41 = require("react/jsx-runtime");
|
|
3590
3656
|
var ItemComponent = (props) => {
|
|
3591
3657
|
var _a, _b;
|
|
3592
3658
|
const {
|
|
@@ -3608,8 +3674,8 @@ var ItemComponent = (props) => {
|
|
|
3608
3674
|
ctaSecondary: (_a = tags == null ? void 0 : tags.includes("cta-secondary")) != null ? _a : false,
|
|
3609
3675
|
fullyInteractive: (_b = (tags == null ? void 0 : tags.includes("fully-interactive")) && (additionalInfo == null ? void 0 : additionalInfo.onClick) == null) != null ? _b : false
|
|
3610
3676
|
};
|
|
3611
|
-
return /* @__PURE__ */ (0,
|
|
3612
|
-
|
|
3677
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
3678
|
+
import_components21.ListItem,
|
|
3613
3679
|
{
|
|
3614
3680
|
title,
|
|
3615
3681
|
subtitle: description,
|
|
@@ -3625,57 +3691,52 @@ var ItemComponent = (props) => {
|
|
|
3625
3691
|
};
|
|
3626
3692
|
var getNavigationControl = (onClick, href) => {
|
|
3627
3693
|
if (href) {
|
|
3628
|
-
return /* @__PURE__ */ (0,
|
|
3694
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_components21.ListItem.Navigation, { href });
|
|
3629
3695
|
}
|
|
3630
3696
|
if (onClick) {
|
|
3631
|
-
return /* @__PURE__ */ (0,
|
|
3697
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_components21.ListItem.Navigation, { onClick });
|
|
3632
3698
|
}
|
|
3633
3699
|
return null;
|
|
3634
3700
|
};
|
|
3635
3701
|
|
|
3636
|
-
// ../renderers/src/CollectionRenderer/
|
|
3637
|
-
var
|
|
3702
|
+
// ../renderers/src/CollectionRenderer/v1/SearchComponent.tsx
|
|
3703
|
+
var import_components22 = require("@transferwise/components");
|
|
3638
3704
|
var import_icons = require("@transferwise/icons");
|
|
3639
|
-
var
|
|
3640
|
-
var
|
|
3641
|
-
var SearchComponent = ({
|
|
3642
|
-
|
|
3643
|
-
status,
|
|
3644
|
-
features,
|
|
3645
|
-
control,
|
|
3646
|
-
tags
|
|
3647
|
-
}) => {
|
|
3705
|
+
var import_react_intl11 = require("react-intl");
|
|
3706
|
+
var import_jsx_runtime42 = require("react/jsx-runtime");
|
|
3707
|
+
var SearchComponent = ({ state, features, control, tags }) => {
|
|
3708
|
+
var _a;
|
|
3648
3709
|
const { search } = state;
|
|
3649
|
-
const { formatMessage } = (0,
|
|
3710
|
+
const { formatMessage } = (0, import_react_intl11.useIntl)();
|
|
3650
3711
|
if (!search) {
|
|
3651
3712
|
return;
|
|
3652
3713
|
}
|
|
3653
3714
|
const getAddon = () => {
|
|
3654
|
-
var
|
|
3655
|
-
if (status.type === "loading") {
|
|
3656
|
-
return { content: /* @__PURE__ */ (0,
|
|
3715
|
+
var _a2;
|
|
3716
|
+
if (state.status.type === "loading") {
|
|
3717
|
+
return { content: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_components22.ProcessIndicator, { size: "xs", "data-testid": "collection-search-loader" }) };
|
|
3657
3718
|
}
|
|
3658
|
-
if ((
|
|
3719
|
+
if ((_a2 = state.search) == null ? void 0 : _a2.query) {
|
|
3659
3720
|
return {
|
|
3660
3721
|
interactive: true,
|
|
3661
|
-
content: /* @__PURE__ */ (0,
|
|
3662
|
-
|
|
3722
|
+
content: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
3723
|
+
import_components22.IconButton,
|
|
3663
3724
|
{
|
|
3664
3725
|
priority: "minimal",
|
|
3665
3726
|
size: 24,
|
|
3666
3727
|
"aria-label": formatMessage(collection_messages_default.clearTextLabel),
|
|
3667
3728
|
onClick: () => {
|
|
3668
|
-
var
|
|
3669
|
-
return (
|
|
3729
|
+
var _a3;
|
|
3730
|
+
return (_a3 = state.search) == null ? void 0 : _a3.onChange("");
|
|
3670
3731
|
},
|
|
3671
|
-
children: /* @__PURE__ */ (0,
|
|
3732
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_icons.CrossCircleFill, {})
|
|
3672
3733
|
}
|
|
3673
3734
|
)
|
|
3674
3735
|
};
|
|
3675
3736
|
}
|
|
3676
3737
|
return void 0;
|
|
3677
3738
|
};
|
|
3678
|
-
return /* @__PURE__ */ (0,
|
|
3739
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
3679
3740
|
FieldInput_default,
|
|
3680
3741
|
{
|
|
3681
3742
|
id: "search",
|
|
@@ -3686,13 +3747,13 @@ var SearchComponent = ({
|
|
|
3686
3747
|
features,
|
|
3687
3748
|
control,
|
|
3688
3749
|
tags,
|
|
3689
|
-
children: /* @__PURE__ */ (0,
|
|
3690
|
-
|
|
3750
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_components22.InputGroup, { addonStart: { content: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_icons.Search, { size: 24 }) }, addonEnd: getAddon(), children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
3751
|
+
import_components22.Input,
|
|
3691
3752
|
{
|
|
3692
3753
|
id: "search",
|
|
3693
3754
|
name: "search",
|
|
3694
3755
|
shape: "pill",
|
|
3695
|
-
placeholder: search.
|
|
3756
|
+
placeholder: (_a = search.hints) == null ? void 0 : _a[0],
|
|
3696
3757
|
type: "text",
|
|
3697
3758
|
value: search.query,
|
|
3698
3759
|
onChange: ({ currentTarget: { value } }) => {
|
|
@@ -3705,14 +3766,72 @@ var SearchComponent = ({
|
|
|
3705
3766
|
};
|
|
3706
3767
|
|
|
3707
3768
|
// ../renderers/src/CollectionRenderer/components/SectionHeaderComponent.tsx
|
|
3708
|
-
var
|
|
3769
|
+
var import_jsx_runtime43 = require("react/jsx-runtime");
|
|
3709
3770
|
var SectionHeaderComponent = ({
|
|
3710
3771
|
title,
|
|
3711
3772
|
callToAction
|
|
3712
|
-
}) => /* @__PURE__ */ (0,
|
|
3773
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(Header, { title, callToAction });
|
|
3774
|
+
|
|
3775
|
+
// ../renderers/src/CollectionRenderer/components/CollapsibleContentComponent.tsx
|
|
3776
|
+
var import_react10 = require("react");
|
|
3777
|
+
var import_components23 = require("@transferwise/components");
|
|
3778
|
+
var import_react_intl12 = require("react-intl");
|
|
3779
|
+
var import_jsx_runtime44 = require("react/jsx-runtime");
|
|
3780
|
+
var CollapsibleContentComponent = (props) => {
|
|
3781
|
+
const { state, SectionHeader, Item } = props;
|
|
3782
|
+
const { search, status } = state;
|
|
3783
|
+
const [isShowingInitialState, setIsShowingInitialState] = (0, import_react10.useState)(true);
|
|
3784
|
+
const isSearchRunning = status.type === "loading" && status.reason === "search";
|
|
3785
|
+
const shouldShowInitialState = !(search == null ? void 0 : search.query) || isSearchRunning && isShowingInitialState;
|
|
3786
|
+
if (shouldShowInitialState !== isShowingInitialState) {
|
|
3787
|
+
setIsShowingInitialState(shouldShowInitialState);
|
|
3788
|
+
}
|
|
3789
|
+
return (
|
|
3790
|
+
// keep focus in the search input when clicking the results, so clicking doesn't blur it and
|
|
3791
|
+
// pop the collection before the click is handled
|
|
3792
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)("div", { role: "presentation", onMouseDown: (event) => event.preventDefault(), children: state.sections.map((section) => {
|
|
3793
|
+
return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(Section, { section, SectionHeader, Item }, section.id);
|
|
3794
|
+
}) })
|
|
3795
|
+
);
|
|
3796
|
+
};
|
|
3797
|
+
var Section = ({ section, SectionHeader, Item }) => {
|
|
3798
|
+
const { formatMessage } = (0, import_react_intl12.useIntl)();
|
|
3799
|
+
const [expanded, setExpanded] = (0, import_react10.useState)(false);
|
|
3800
|
+
const itemIds = section.type === "items" ? section.items.map(({ id }) => id).join("") : section.id;
|
|
3801
|
+
const [prevItemIds, setPrevItemIds] = (0, import_react10.useState)(itemIds);
|
|
3802
|
+
if (itemIds !== prevItemIds) {
|
|
3803
|
+
setExpanded(false);
|
|
3804
|
+
setPrevItemIds(itemIds);
|
|
3805
|
+
}
|
|
3806
|
+
const showLoadMore = section.type === "items" && section.items.some((item) => {
|
|
3807
|
+
var _a;
|
|
3808
|
+
return (_a = item.tags) == null ? void 0 : _a.includes("hidden");
|
|
3809
|
+
});
|
|
3810
|
+
return /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(import_jsx_runtime44.Fragment, { children: [
|
|
3811
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(SectionHeader, __spreadValues({}, section)),
|
|
3812
|
+
section.type === "items" && section.items.filter((item) => {
|
|
3813
|
+
var _a;
|
|
3814
|
+
return expanded || !((_a = item.tags) == null ? void 0 : _a.includes("hidden"));
|
|
3815
|
+
}).map((item) => /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(Item, __spreadValues({}, item), item.id)),
|
|
3816
|
+
section.type === "layout" && section.children,
|
|
3817
|
+
showLoadMore ? /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
3818
|
+
import_components23.Button,
|
|
3819
|
+
{
|
|
3820
|
+
priority: "tertiary",
|
|
3821
|
+
onClick: () => {
|
|
3822
|
+
setExpanded(!expanded);
|
|
3823
|
+
},
|
|
3824
|
+
children: expanded ? /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("span", { children: [
|
|
3825
|
+
formatMessage(collection_messages_default.showLessResultsButton),
|
|
3826
|
+
" "
|
|
3827
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("span", { children: formatMessage(collection_messages_default.showMoreResultsButton, { count: section.items.length }) })
|
|
3828
|
+
}
|
|
3829
|
+
) : void 0
|
|
3830
|
+
] });
|
|
3831
|
+
};
|
|
3713
3832
|
|
|
3714
3833
|
// ../renderers/src/CollectionRenderer/createCollectionRenderer.tsx
|
|
3715
|
-
var
|
|
3834
|
+
var import_jsx_runtime45 = require("react/jsx-runtime");
|
|
3716
3835
|
var createCollectionRenderer = (canRender, components) => {
|
|
3717
3836
|
const componentsWithDefaults = __spreadValues({
|
|
3718
3837
|
Search: SearchComponent,
|
|
@@ -3720,51 +3839,207 @@ var createCollectionRenderer = (canRender, components) => {
|
|
|
3720
3839
|
Filter: FilterComponent,
|
|
3721
3840
|
Item: ItemComponent,
|
|
3722
3841
|
SectionHeader: SectionHeaderComponent,
|
|
3723
|
-
Results:
|
|
3842
|
+
Results: VirtualisedContentComponent,
|
|
3843
|
+
FocusedResults: CollapsibleContentComponent
|
|
3724
3844
|
}, components);
|
|
3725
3845
|
return {
|
|
3726
3846
|
canRenderType: "collection",
|
|
3727
3847
|
canRender,
|
|
3728
3848
|
render: (props) => {
|
|
3729
|
-
return /* @__PURE__ */ (0,
|
|
3849
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(CollectionRendererComponent, __spreadValues(__spreadValues({}, props), componentsWithDefaults));
|
|
3730
3850
|
}
|
|
3731
3851
|
};
|
|
3732
3852
|
};
|
|
3733
3853
|
|
|
3734
|
-
// ../renderers/src/CollectionRenderer/
|
|
3735
|
-
var
|
|
3736
|
-
|
|
3737
|
-
|
|
3738
|
-
|
|
3739
|
-
|
|
3740
|
-
|
|
3741
|
-
|
|
3742
|
-
|
|
3743
|
-
|
|
3854
|
+
// ../renderers/src/CollectionRenderer/v1/CollectionRendererV1.tsx
|
|
3855
|
+
var CollectionRendererV1 = createCollectionRenderer(
|
|
3856
|
+
() => true
|
|
3857
|
+
);
|
|
3858
|
+
var CollectionRendererV1_default = CollectionRendererV1;
|
|
3859
|
+
|
|
3860
|
+
// ../renderers/src/CollectionRenderer/v2/FilterComponent.tsx
|
|
3861
|
+
var import_components24 = require("@transferwise/components");
|
|
3862
|
+
var import_classnames12 = __toESM(require_classnames());
|
|
3863
|
+
var import_react11 = require("react");
|
|
3864
|
+
var import_jsx_runtime46 = require("react/jsx-runtime");
|
|
3865
|
+
var FiltersComponent2 = (props) => {
|
|
3866
|
+
const _a = props, { Filter } = _a, collectionProps = __objRest(_a, ["Filter"]);
|
|
3867
|
+
const { state, depth, tags } = collectionProps;
|
|
3868
|
+
const { filters, status, search } = state;
|
|
3869
|
+
const isForked = depth > 0;
|
|
3870
|
+
const isSearching = status.type === "loading" && status.reason === "search";
|
|
3871
|
+
const [searchedStateId, setSearchedStateId] = (0, import_react11.useState)();
|
|
3872
|
+
if (isForked && !isSearching && (search == null ? void 0 : search.query) && searchedStateId !== state.id) {
|
|
3873
|
+
setSearchedStateId(state.id);
|
|
3874
|
+
}
|
|
3875
|
+
const isFirstSearchPending = isForked && isSearching && searchedStateId !== state.id;
|
|
3876
|
+
return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
3877
|
+
"div",
|
|
3878
|
+
{
|
|
3879
|
+
className: (0, import_classnames12.default)("df-filters-collapsible", {
|
|
3880
|
+
"df-filters-collapsible--hidden": isFirstSearchPending
|
|
3881
|
+
}),
|
|
3882
|
+
"aria-hidden": isFirstSearchPending,
|
|
3883
|
+
inert: isFirstSearchPending,
|
|
3884
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("div", { className: "df-filters-collapsible-content", children: [
|
|
3885
|
+
(tags == null ? void 0 : tags.includes("filter-divider")) && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_components24.Divider, { className: "m-b-3", level: "subsection" }),
|
|
3886
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("div", { className: (0, import_classnames12.default)("df-filters-container", { "df-filter-loader": isSearching }), children: filters.map((filter) => {
|
|
3887
|
+
var _a2;
|
|
3888
|
+
return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
3889
|
+
Filter,
|
|
3890
|
+
__spreadProps(__spreadValues({}, collectionProps), {
|
|
3891
|
+
filter
|
|
3892
|
+
}),
|
|
3893
|
+
JSON.stringify((_a2 = filter.options) == null ? void 0 : _a2.map((o) => o.value))
|
|
3894
|
+
);
|
|
3895
|
+
}) })
|
|
3896
|
+
] })
|
|
3897
|
+
}
|
|
3898
|
+
);
|
|
3744
3899
|
};
|
|
3745
|
-
var
|
|
3746
|
-
|
|
3747
|
-
|
|
3748
|
-
|
|
3749
|
-
|
|
3750
|
-
|
|
3751
|
-
|
|
3900
|
+
var FilterComponent2 = ({
|
|
3901
|
+
filter,
|
|
3902
|
+
state
|
|
3903
|
+
}) => {
|
|
3904
|
+
const { multiSelect, options } = filter;
|
|
3905
|
+
const { status } = state;
|
|
3906
|
+
const disabled = status.type === "loading" && status.reason === "search";
|
|
3907
|
+
if (!options) {
|
|
3908
|
+
return null;
|
|
3909
|
+
}
|
|
3910
|
+
return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
3911
|
+
import_components24.Chips,
|
|
3912
|
+
{
|
|
3913
|
+
className: "m-b-1",
|
|
3914
|
+
multiple: multiSelect,
|
|
3915
|
+
selected: options.some((option) => option.selected) ? options.filter((option) => option.selected).map((option) => option.value) : multiSelect ? [] : "",
|
|
3916
|
+
chips: [
|
|
3917
|
+
...options.map((option) => ({
|
|
3918
|
+
value: option.value,
|
|
3919
|
+
label: option.title
|
|
3920
|
+
}))
|
|
3921
|
+
],
|
|
3922
|
+
onChange: (value) => {
|
|
3923
|
+
var _a;
|
|
3924
|
+
if (disabled) {
|
|
3925
|
+
return;
|
|
3926
|
+
}
|
|
3927
|
+
if (value.selectedValue === "") {
|
|
3928
|
+
options == null ? void 0 : options.filter((option) => option.selected).map((option) => option == null ? void 0 : option.onSelect());
|
|
3929
|
+
return;
|
|
3930
|
+
}
|
|
3931
|
+
(_a = options == null ? void 0 : options.find((option) => value.selectedValue === option.value)) == null ? void 0 : _a.onSelect();
|
|
3932
|
+
}
|
|
3933
|
+
},
|
|
3934
|
+
JSON.stringify(options)
|
|
3935
|
+
);
|
|
3936
|
+
};
|
|
3937
|
+
|
|
3938
|
+
// ../renderers/src/CollectionRenderer/v2/SearchComponent.tsx
|
|
3939
|
+
var import_components25 = require("@transferwise/components");
|
|
3940
|
+
var import_icons2 = require("@transferwise/icons");
|
|
3941
|
+
var import_react12 = require("react");
|
|
3942
|
+
var import_react_intl13 = require("react-intl");
|
|
3943
|
+
var import_jsx_runtime47 = require("react/jsx-runtime");
|
|
3944
|
+
var SearchComponent2 = ({
|
|
3945
|
+
state,
|
|
3946
|
+
depth,
|
|
3947
|
+
fork,
|
|
3948
|
+
pop,
|
|
3949
|
+
features,
|
|
3950
|
+
control,
|
|
3951
|
+
tags
|
|
3952
|
+
}) => {
|
|
3953
|
+
var _a;
|
|
3954
|
+
const { search } = state;
|
|
3955
|
+
const { formatMessage } = (0, import_react_intl13.useIntl)();
|
|
3956
|
+
const inputRef = (0, import_react12.useRef)(null);
|
|
3957
|
+
if (!search) {
|
|
3958
|
+
return;
|
|
3959
|
+
}
|
|
3960
|
+
const isForked = depth > 0;
|
|
3961
|
+
const getAddon = () => {
|
|
3962
|
+
if (state.status.type === "loading") {
|
|
3963
|
+
return { content: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_components25.ProcessIndicator, { size: "xs", "data-testid": "collection-search-loader" }) };
|
|
3964
|
+
}
|
|
3965
|
+
if (search.query) {
|
|
3966
|
+
return {
|
|
3967
|
+
interactive: true,
|
|
3968
|
+
content: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
3969
|
+
import_components25.IconButton,
|
|
3970
|
+
{
|
|
3971
|
+
priority: "minimal",
|
|
3972
|
+
size: 24,
|
|
3973
|
+
"aria-label": formatMessage(collection_messages_default.clearTextLabel),
|
|
3974
|
+
onClick: () => {
|
|
3975
|
+
var _a2;
|
|
3976
|
+
search.onChange("");
|
|
3977
|
+
pop();
|
|
3978
|
+
(_a2 = inputRef.current) == null ? void 0 : _a2.focus();
|
|
3979
|
+
},
|
|
3980
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_icons2.CrossCircleFill, {})
|
|
3981
|
+
}
|
|
3982
|
+
)
|
|
3983
|
+
};
|
|
3984
|
+
}
|
|
3985
|
+
return void 0;
|
|
3986
|
+
};
|
|
3987
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
3988
|
+
FieldInput_default,
|
|
3989
|
+
{
|
|
3990
|
+
id: "search",
|
|
3991
|
+
description: "",
|
|
3992
|
+
validation: void 0,
|
|
3993
|
+
help: "",
|
|
3994
|
+
label: search.title,
|
|
3995
|
+
features,
|
|
3996
|
+
control,
|
|
3997
|
+
tags,
|
|
3998
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_components25.InputGroup, { addonStart: { content: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_icons2.Search, { size: 24 }) }, addonEnd: getAddon(), children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
3999
|
+
import_components25.Input,
|
|
4000
|
+
{
|
|
4001
|
+
ref: inputRef,
|
|
4002
|
+
id: "search",
|
|
4003
|
+
name: "search",
|
|
4004
|
+
shape: "pill",
|
|
4005
|
+
placeholder: (_a = search.hints) == null ? void 0 : _a[0],
|
|
4006
|
+
type: "text",
|
|
4007
|
+
value: search.query,
|
|
4008
|
+
onChange: ({ currentTarget: { value } }) => {
|
|
4009
|
+
if (isForked && value === "") {
|
|
4010
|
+
pop();
|
|
4011
|
+
return;
|
|
4012
|
+
}
|
|
4013
|
+
if (value && !isForked) {
|
|
4014
|
+
fork();
|
|
4015
|
+
}
|
|
4016
|
+
search.onChange(value);
|
|
4017
|
+
}
|
|
4018
|
+
}
|
|
4019
|
+
) })
|
|
4020
|
+
}
|
|
4021
|
+
);
|
|
3752
4022
|
};
|
|
3753
|
-
|
|
3754
|
-
|
|
4023
|
+
|
|
4024
|
+
// ../renderers/src/CollectionRenderer/v2/CollectionRendererV2.tsx
|
|
4025
|
+
var CollectionRendererV2 = createCollectionRenderer(
|
|
4026
|
+
({ control }) => control === "contacts-collection-v2",
|
|
4027
|
+
{ Search: SearchComponent2, Filters: FiltersComponent2, Filter: FilterComponent2 }
|
|
4028
|
+
);
|
|
4029
|
+
var CollectionRendererV2_default = CollectionRendererV2;
|
|
3755
4030
|
|
|
3756
4031
|
// ../renderers/src/ColumnsRenderer.tsx
|
|
3757
|
-
var
|
|
4032
|
+
var import_classnames13 = __toESM(require_classnames());
|
|
3758
4033
|
|
|
3759
4034
|
// ../renderers/src/utils/useIsCollapsed.ts
|
|
3760
|
-
var
|
|
4035
|
+
var import_react13 = require("react");
|
|
3761
4036
|
var COLLAPSE_QUERY = "(max-width: 767.98px)";
|
|
3762
4037
|
var supportsMatchMedia = () => typeof window !== "undefined" && !!window.matchMedia;
|
|
3763
4038
|
var useIsCollapsed = () => {
|
|
3764
|
-
const [collapsed, setCollapsed] = (0,
|
|
4039
|
+
const [collapsed, setCollapsed] = (0, import_react13.useState)(
|
|
3765
4040
|
() => supportsMatchMedia() && window.matchMedia(COLLAPSE_QUERY).matches
|
|
3766
4041
|
);
|
|
3767
|
-
(0,
|
|
4042
|
+
(0, import_react13.useEffect)(() => {
|
|
3768
4043
|
if (supportsMatchMedia()) {
|
|
3769
4044
|
const mql = window.matchMedia(COLLAPSE_QUERY);
|
|
3770
4045
|
const update = () => setCollapsed(mql.matches);
|
|
@@ -3777,7 +4052,7 @@ var useIsCollapsed = () => {
|
|
|
3777
4052
|
};
|
|
3778
4053
|
|
|
3779
4054
|
// ../renderers/src/ColumnsRenderer.tsx
|
|
3780
|
-
var
|
|
4055
|
+
var import_jsx_runtime48 = require("react/jsx-runtime");
|
|
3781
4056
|
var RIGHT_FIRST_STACKING = "right-first-stacking";
|
|
3782
4057
|
var ColumnsRenderer = {
|
|
3783
4058
|
canRenderType: "columns",
|
|
@@ -3788,12 +4063,12 @@ function ColumnsRendererComponent(props) {
|
|
|
3788
4063
|
const { bias, margin, startChildren, endChildren, tags } = props;
|
|
3789
4064
|
const isCollapsed = useIsCollapsed();
|
|
3790
4065
|
const reverse = isCollapsed && ((_a = tags == null ? void 0 : tags.includes(RIGHT_FIRST_STACKING)) != null ? _a : false);
|
|
3791
|
-
const startColumn = /* @__PURE__ */ (0,
|
|
3792
|
-
const endColumn = /* @__PURE__ */ (0,
|
|
3793
|
-
return /* @__PURE__ */ (0,
|
|
4066
|
+
const startColumn = /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("div", { className: "df-columns-renderer-column", children: startChildren });
|
|
4067
|
+
const endColumn = /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("div", { className: "df-columns-renderer-column", children: endChildren });
|
|
4068
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(
|
|
3794
4069
|
"div",
|
|
3795
4070
|
{
|
|
3796
|
-
className: (0,
|
|
4071
|
+
className: (0, import_classnames13.default)(
|
|
3797
4072
|
"df-columns-renderer-container",
|
|
3798
4073
|
getMargin(margin),
|
|
3799
4074
|
{
|
|
@@ -3840,15 +4115,15 @@ var dateToDateString = (date) => {
|
|
|
3840
4115
|
};
|
|
3841
4116
|
|
|
3842
4117
|
// ../renderers/src/DateInputRenderer/DateLookupControl.tsx
|
|
3843
|
-
var
|
|
4118
|
+
var import_components26 = require("@transferwise/components");
|
|
3844
4119
|
|
|
3845
4120
|
// ../renderers/src/hooks/useAvailabilityRules.ts
|
|
3846
|
-
var
|
|
3847
|
-
var
|
|
3848
|
-
|
|
4121
|
+
var import_react14 = require("react");
|
|
4122
|
+
var import_react_intl15 = require("react-intl");
|
|
4123
|
+
|
|
3849
4124
|
// ../renderers/src/messages/date-input.messages.ts
|
|
3850
|
-
var
|
|
3851
|
-
var date_input_messages_default = (0,
|
|
4125
|
+
var import_react_intl14 = require("react-intl");
|
|
4126
|
+
var date_input_messages_default = (0, import_react_intl14.defineMessages)({
|
|
3852
4127
|
unavailableDates: {
|
|
3853
4128
|
id: "df.wise.DateInput.unavailableDates",
|
|
3854
4129
|
defaultMessage: "Some dates are unavailable.",
|
|
@@ -3859,8 +4134,8 @@ var date_input_messages_default = (0, import_react_intl12.defineMessages)({
|
|
|
3859
4134
|
// ../renderers/src/hooks/useAvailabilityRules.ts
|
|
3860
4135
|
var useAvailabilityRules = (availability) => {
|
|
3861
4136
|
var _a, _b;
|
|
3862
|
-
const { formatMessage } = (0,
|
|
3863
|
-
const [focusedDate, setFocusedDate] = (0,
|
|
4137
|
+
const { formatMessage } = (0, import_react_intl15.useIntl)();
|
|
4138
|
+
const [focusedDate, setFocusedDate] = (0, import_react14.useState)(null);
|
|
3864
4139
|
const unavailableMessage = (_b = (_a = focusedDate ? getUnavailableDateReason(focusedDate, availability) : null) != null ? _a : availability == null ? void 0 : availability.message) != null ? _b : formatMessage(date_input_messages_default.unavailableDates);
|
|
3865
4140
|
const onDateSelect = ({ date }) => {
|
|
3866
4141
|
setFocusedDate((current) => (current == null ? void 0 : current.getTime()) === date.getTime() ? current : date);
|
|
@@ -3912,7 +4187,7 @@ var matchesDateRule = (date, weekday, rule) => {
|
|
|
3912
4187
|
var isDate = (date) => date !== null;
|
|
3913
4188
|
|
|
3914
4189
|
// ../renderers/src/DateInputRenderer/DateLookupControl.tsx
|
|
3915
|
-
var
|
|
4190
|
+
var import_jsx_runtime49 = require("react/jsx-runtime");
|
|
3916
4191
|
var DateLookupControl = ({
|
|
3917
4192
|
value,
|
|
3918
4193
|
minimumDate,
|
|
@@ -3925,8 +4200,8 @@ var DateLookupControl = ({
|
|
|
3925
4200
|
onFocus
|
|
3926
4201
|
}) => {
|
|
3927
4202
|
const { disabledRules, onDateSelect, resetFocusedDate } = useAvailabilityRules(availability);
|
|
3928
|
-
return /* @__PURE__ */ (0,
|
|
3929
|
-
|
|
4203
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
4204
|
+
import_components26.DateLookup,
|
|
3930
4205
|
{
|
|
3931
4206
|
value: dateStringToDateOrNull(value),
|
|
3932
4207
|
min: dateStringToDateOrNull(minimumDate),
|
|
@@ -3948,8 +4223,8 @@ var DateLookupControl = ({
|
|
|
3948
4223
|
};
|
|
3949
4224
|
|
|
3950
4225
|
// ../renderers/src/DateInputRenderer/CalendarControl.tsx
|
|
3951
|
-
var
|
|
3952
|
-
var
|
|
4226
|
+
var import_components27 = require("@transferwise/components");
|
|
4227
|
+
var import_jsx_runtime50 = require("react/jsx-runtime");
|
|
3953
4228
|
var CalendarControl = ({
|
|
3954
4229
|
id,
|
|
3955
4230
|
title,
|
|
@@ -3972,7 +4247,7 @@ var CalendarControl = ({
|
|
|
3972
4247
|
};
|
|
3973
4248
|
return (
|
|
3974
4249
|
// Wrapping in a <fieldset> to address some a11y gaps in the current inline Calendar component
|
|
3975
|
-
/* @__PURE__ */ (0,
|
|
4250
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
3976
4251
|
"fieldset",
|
|
3977
4252
|
{
|
|
3978
4253
|
id,
|
|
@@ -3989,8 +4264,8 @@ var CalendarControl = ({
|
|
|
3989
4264
|
onBlur();
|
|
3990
4265
|
}
|
|
3991
4266
|
},
|
|
3992
|
-
children: /* @__PURE__ */ (0,
|
|
3993
|
-
|
|
4267
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
4268
|
+
import_components27.Calendar,
|
|
3994
4269
|
{
|
|
3995
4270
|
value: dateStringToDateOrNull(value),
|
|
3996
4271
|
min: dateStringToDateOrNull(minimumDate),
|
|
@@ -4008,12 +4283,12 @@ var CalendarControl = ({
|
|
|
4008
4283
|
};
|
|
4009
4284
|
|
|
4010
4285
|
// ../renderers/src/DateInputRenderer/DateInputControl.tsx
|
|
4011
|
-
var
|
|
4012
|
-
var
|
|
4286
|
+
var import_components28 = require("@transferwise/components");
|
|
4287
|
+
var import_jsx_runtime51 = require("react/jsx-runtime");
|
|
4013
4288
|
var DateInputControl = (_a) => {
|
|
4014
4289
|
var _b = _a, { autoComplete } = _b, props = __objRest(_b, ["autoComplete"]);
|
|
4015
|
-
return /* @__PURE__ */ (0,
|
|
4016
|
-
|
|
4290
|
+
return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
4291
|
+
import_components28.DateInput,
|
|
4017
4292
|
__spreadProps(__spreadValues({}, props), {
|
|
4018
4293
|
dayAutoComplete: getAutocompleteString(autoComplete, "day"),
|
|
4019
4294
|
yearAutoComplete: getAutocompleteString(autoComplete, "year")
|
|
@@ -4028,7 +4303,7 @@ var getAutocompleteString = (value, suffix) => {
|
|
|
4028
4303
|
};
|
|
4029
4304
|
|
|
4030
4305
|
// ../renderers/src/DateInputRenderer/DateInputRenderer.tsx
|
|
4031
|
-
var
|
|
4306
|
+
var import_jsx_runtime52 = require("react/jsx-runtime");
|
|
4032
4307
|
var DateInputRenderer = {
|
|
4033
4308
|
canRenderType: "input-date",
|
|
4034
4309
|
render: (props) => {
|
|
@@ -4062,7 +4337,7 @@ var DateInputRenderer = {
|
|
|
4062
4337
|
}
|
|
4063
4338
|
return DateInputControl;
|
|
4064
4339
|
})();
|
|
4065
|
-
return /* @__PURE__ */ (0,
|
|
4340
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
4066
4341
|
FieldInput_default,
|
|
4067
4342
|
{
|
|
4068
4343
|
id,
|
|
@@ -4075,7 +4350,7 @@ var DateInputRenderer = {
|
|
|
4075
4350
|
features: props.features,
|
|
4076
4351
|
control,
|
|
4077
4352
|
tags: props.tags,
|
|
4078
|
-
children: /* @__PURE__ */ (0,
|
|
4353
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(UIComponent, __spreadValues({}, inputProps))
|
|
4079
4354
|
}
|
|
4080
4355
|
);
|
|
4081
4356
|
}
|
|
@@ -4083,16 +4358,16 @@ var DateInputRenderer = {
|
|
|
4083
4358
|
var DateInputRenderer_default = DateInputRenderer;
|
|
4084
4359
|
|
|
4085
4360
|
// ../renderers/src/DecisionRenderer/DecisionRenderer.tsx
|
|
4086
|
-
var
|
|
4361
|
+
var import_components31 = require("@transferwise/components");
|
|
4087
4362
|
|
|
4088
4363
|
// ../renderers/src/DecisionRenderer/DecisionWrapper.tsx
|
|
4089
|
-
var
|
|
4090
|
-
var
|
|
4091
|
-
var
|
|
4364
|
+
var import_components30 = require("@transferwise/components");
|
|
4365
|
+
var import_react15 = require("react");
|
|
4366
|
+
var import_react_intl19 = require("react-intl");
|
|
4092
4367
|
|
|
4093
4368
|
// ../renderers/src/messages/filter.messages.ts
|
|
4094
|
-
var
|
|
4095
|
-
var filter_messages_default = (0,
|
|
4369
|
+
var import_react_intl16 = require("react-intl");
|
|
4370
|
+
var filter_messages_default = (0, import_react_intl16.defineMessages)({
|
|
4096
4371
|
placeholder: {
|
|
4097
4372
|
id: "df.wise.filter.placeholder",
|
|
4098
4373
|
defaultMessage: "Start typing to search",
|
|
@@ -4158,12 +4433,12 @@ function filterAndSortItems(options, query) {
|
|
|
4158
4433
|
var normalizeAndRemoveAccents = (text) => text.trim().toLowerCase().normalize("NFKD").replace(new RegExp("\\p{Diacritic}", "gu"), "");
|
|
4159
4434
|
|
|
4160
4435
|
// ../renderers/src/DecisionRenderer/GroupedDecisionList.tsx
|
|
4161
|
-
var
|
|
4162
|
-
var
|
|
4436
|
+
var import_components29 = require("@transferwise/components");
|
|
4437
|
+
var import_react_intl18 = require("react-intl");
|
|
4163
4438
|
|
|
4164
4439
|
// ../renderers/src/messages/group.messages.ts
|
|
4165
|
-
var
|
|
4166
|
-
var group_messages_default = (0,
|
|
4440
|
+
var import_react_intl17 = require("react-intl");
|
|
4441
|
+
var group_messages_default = (0, import_react_intl17.defineMessages)({
|
|
4167
4442
|
all: {
|
|
4168
4443
|
id: "df.wise.group.all",
|
|
4169
4444
|
defaultMessage: "All",
|
|
@@ -4197,19 +4472,19 @@ var getGroupsFromTags = (knownTags, items) => {
|
|
|
4197
4472
|
};
|
|
4198
4473
|
|
|
4199
4474
|
// ../renderers/src/DecisionRenderer/GroupedDecisionList.tsx
|
|
4200
|
-
var
|
|
4475
|
+
var import_jsx_runtime53 = require("react/jsx-runtime");
|
|
4201
4476
|
var groupingTags = Object.keys(group_messages_default).filter((key) => key !== "all");
|
|
4202
4477
|
var isGroupedDecision = (options) => {
|
|
4203
4478
|
return getGroupsFromTags(groupingTags, options).length > 0;
|
|
4204
4479
|
};
|
|
4205
4480
|
var GroupedDecisionList = (_a) => {
|
|
4206
4481
|
var _b = _a, { renderDecisionList: renderDecisionList2 } = _b, rest = __objRest(_b, ["renderDecisionList"]);
|
|
4207
|
-
const { formatMessage } = (0,
|
|
4482
|
+
const { formatMessage } = (0, import_react_intl18.useIntl)();
|
|
4208
4483
|
const { options } = rest;
|
|
4209
4484
|
const itemsByTag = [...getGroupsFromTags(groupingTags, options), { tag: "all", items: options }];
|
|
4210
|
-
return /* @__PURE__ */ (0,
|
|
4211
|
-
/* @__PURE__ */ (0,
|
|
4212
|
-
|
|
4485
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_jsx_runtime53.Fragment, { children: itemsByTag.map(({ tag, items }) => /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(import_components29.Section, { children: [
|
|
4486
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
4487
|
+
import_components29.Header,
|
|
4213
4488
|
{
|
|
4214
4489
|
as: "h2",
|
|
4215
4490
|
title: tag in group_messages_default ? formatMessage(group_messages_default[tag]) : tag
|
|
@@ -4220,28 +4495,28 @@ var GroupedDecisionList = (_a) => {
|
|
|
4220
4495
|
};
|
|
4221
4496
|
|
|
4222
4497
|
// ../renderers/src/DecisionRenderer/DecisionWrapper.tsx
|
|
4223
|
-
var
|
|
4224
|
-
var
|
|
4498
|
+
var import_classnames14 = __toESM(require_classnames());
|
|
4499
|
+
var import_jsx_runtime54 = require("react/jsx-runtime");
|
|
4225
4500
|
var DecisionWrapper = (props) => {
|
|
4226
4501
|
const { margin, control, title, tags } = props;
|
|
4227
|
-
return /* @__PURE__ */ (0,
|
|
4228
|
-
title && /* @__PURE__ */ (0,
|
|
4229
|
-
control === "filtered" ? /* @__PURE__ */ (0,
|
|
4502
|
+
return /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { className: (0, import_classnames14.default)(getMargin(margin), controlAndTagsToCSSClass({ control, tags })), children: [
|
|
4503
|
+
title && /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(import_components30.Header, { as: "h2", title }),
|
|
4504
|
+
control === "filtered" ? /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(FilteredDecisionList, __spreadValues({}, props)) : /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(UnfilteredDecisionList, __spreadValues({}, props))
|
|
4230
4505
|
] });
|
|
4231
4506
|
};
|
|
4232
4507
|
var UnfilteredDecisionList = (_a) => {
|
|
4233
4508
|
var _b = _a, { renderDecisionList: renderDecisionList2 } = _b, rest = __objRest(_b, ["renderDecisionList"]);
|
|
4234
|
-
return isGroupedDecision(rest.options) ? /* @__PURE__ */ (0,
|
|
4509
|
+
return isGroupedDecision(rest.options) ? /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(GroupedDecisionList, __spreadProps(__spreadValues({}, rest), { renderDecisionList: renderDecisionList2 })) : renderDecisionList2(rest);
|
|
4235
4510
|
};
|
|
4236
4511
|
var FilteredDecisionList = (props) => {
|
|
4237
|
-
const { formatMessage } = (0,
|
|
4238
|
-
const [query, setQuery] = (0,
|
|
4512
|
+
const { formatMessage } = (0, import_react_intl19.useIntl)();
|
|
4513
|
+
const [query, setQuery] = (0, import_react15.useState)("");
|
|
4239
4514
|
const { control, options, renderDecisionList: renderDecisionList2 } = props;
|
|
4240
4515
|
const filteredOptions = (query == null ? void 0 : query.length) > 0 ? filterAndSortItems(options, query) : options;
|
|
4241
4516
|
const isGrouped = isGroupedDecision(options);
|
|
4242
|
-
return /* @__PURE__ */ (0,
|
|
4243
|
-
/* @__PURE__ */ (0,
|
|
4244
|
-
|
|
4517
|
+
return /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(import_jsx_runtime54.Fragment, { children: [
|
|
4518
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
4519
|
+
import_components30.SearchInput,
|
|
4245
4520
|
{
|
|
4246
4521
|
placeholder: formatMessage(filter_messages_default.placeholder),
|
|
4247
4522
|
value: query,
|
|
@@ -4252,25 +4527,25 @@ var FilteredDecisionList = (props) => {
|
|
|
4252
4527
|
}
|
|
4253
4528
|
}
|
|
4254
4529
|
),
|
|
4255
|
-
isGrouped && query.length === 0 ? /* @__PURE__ */ (0,
|
|
4256
|
-
query.length > 0 && /* @__PURE__ */ (0,
|
|
4530
|
+
isGrouped && query.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(GroupedDecisionList, __spreadValues({}, props)) : /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(import_jsx_runtime54.Fragment, { children: [
|
|
4531
|
+
query.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(import_components30.Header, { as: "h2", title: formatMessage(filter_messages_default.results), className: "m-t-4" }),
|
|
4257
4532
|
filteredOptions.length > 0 ? renderDecisionList2({
|
|
4258
4533
|
control,
|
|
4259
4534
|
className: query.length === 0 ? "m-t-3" : "",
|
|
4260
4535
|
options: filteredOptions
|
|
4261
|
-
}) : /* @__PURE__ */ (0,
|
|
4536
|
+
}) : /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("p", { children: formatMessage(filter_messages_default.noResults) })
|
|
4262
4537
|
] })
|
|
4263
4538
|
] });
|
|
4264
4539
|
};
|
|
4265
4540
|
|
|
4266
4541
|
// ../renderers/src/DecisionRenderer/DecisionRenderer.tsx
|
|
4267
|
-
var
|
|
4542
|
+
var import_jsx_runtime55 = require("react/jsx-runtime");
|
|
4268
4543
|
var DecisionRenderer = {
|
|
4269
4544
|
canRenderType: "decision",
|
|
4270
|
-
render: (props) => /* @__PURE__ */ (0,
|
|
4545
|
+
render: (props) => /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(DecisionWrapper, __spreadProps(__spreadValues({}, props), { renderDecisionList }))
|
|
4271
4546
|
};
|
|
4272
4547
|
var renderDecisionList = ({ options, control }) => {
|
|
4273
|
-
return /* @__PURE__ */ (0,
|
|
4548
|
+
return /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(import_jsx_runtime55.Fragment, { children: options.map((_a) => {
|
|
4274
4549
|
var _b = _a, { onClick } = _b, rest = __objRest(_b, ["onClick"]);
|
|
4275
4550
|
const {
|
|
4276
4551
|
description,
|
|
@@ -4283,8 +4558,8 @@ var renderDecisionList = ({ options, control }) => {
|
|
|
4283
4558
|
supportingValues,
|
|
4284
4559
|
tags
|
|
4285
4560
|
} = rest;
|
|
4286
|
-
return /* @__PURE__ */ (0,
|
|
4287
|
-
|
|
4561
|
+
return /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
4562
|
+
import_components31.ListItem,
|
|
4288
4563
|
{
|
|
4289
4564
|
title: itemTitle,
|
|
4290
4565
|
subtitle: description,
|
|
@@ -4295,7 +4570,7 @@ var renderDecisionList = ({ options, control }) => {
|
|
|
4295
4570
|
media: getMedia(media, shouldUseAvatar(control, tags)),
|
|
4296
4571
|
prompt: getInlineAlert(inlineAlert),
|
|
4297
4572
|
additionalInfo: additionalText ? getAdditionalInfo({ text: additionalText }) : void 0,
|
|
4298
|
-
control: /* @__PURE__ */ (0,
|
|
4573
|
+
control: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(import_components31.ListItem.Navigation, __spreadValues({}, getAnchorProps()))
|
|
4299
4574
|
},
|
|
4300
4575
|
JSON.stringify(rest)
|
|
4301
4576
|
);
|
|
@@ -4304,9 +4579,9 @@ var renderDecisionList = ({ options, control }) => {
|
|
|
4304
4579
|
var DecisionRenderer_default = DecisionRenderer;
|
|
4305
4580
|
|
|
4306
4581
|
// ../renderers/src/DividerRenderer.tsx
|
|
4307
|
-
var
|
|
4308
|
-
var
|
|
4309
|
-
var
|
|
4582
|
+
var import_components32 = require("@transferwise/components");
|
|
4583
|
+
var import_classnames15 = __toESM(require_classnames());
|
|
4584
|
+
var import_jsx_runtime56 = require("react/jsx-runtime");
|
|
4310
4585
|
var mapControlToLevel = (control) => {
|
|
4311
4586
|
switch (control) {
|
|
4312
4587
|
case "section":
|
|
@@ -4319,10 +4594,10 @@ var mapControlToLevel = (control) => {
|
|
|
4319
4594
|
};
|
|
4320
4595
|
var DividerRenderer = {
|
|
4321
4596
|
canRenderType: "divider",
|
|
4322
|
-
render: ({ margin, control, tags }) => /* @__PURE__ */ (0,
|
|
4323
|
-
|
|
4597
|
+
render: ({ margin, control, tags }) => /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
4598
|
+
import_components32.Divider,
|
|
4324
4599
|
{
|
|
4325
|
-
className: (0,
|
|
4600
|
+
className: (0, import_classnames15.default)(
|
|
4326
4601
|
"m-t-0",
|
|
4327
4602
|
"d-block",
|
|
4328
4603
|
getMargin(margin),
|
|
@@ -4335,11 +4610,11 @@ var DividerRenderer = {
|
|
|
4335
4610
|
var DividerRenderer_default = DividerRenderer;
|
|
4336
4611
|
|
|
4337
4612
|
// ../renderers/src/ExternalConfirmationRenderer.tsx
|
|
4338
|
-
var
|
|
4613
|
+
var import_components33 = require("@transferwise/components");
|
|
4339
4614
|
|
|
4340
4615
|
// ../renderers/src/messages/external-confirmation.messages.ts
|
|
4341
|
-
var
|
|
4342
|
-
var external_confirmation_messages_default = (0,
|
|
4616
|
+
var import_react_intl20 = require("react-intl");
|
|
4617
|
+
var external_confirmation_messages_default = (0, import_react_intl20.defineMessages)({
|
|
4343
4618
|
title: {
|
|
4344
4619
|
id: "df.wise.ExternalConfirmation.title",
|
|
4345
4620
|
defaultMessage: "Please confirm",
|
|
@@ -4363,9 +4638,9 @@ var external_confirmation_messages_default = (0, import_react_intl18.defineMessa
|
|
|
4363
4638
|
});
|
|
4364
4639
|
|
|
4365
4640
|
// ../renderers/src/ExternalConfirmationRenderer.tsx
|
|
4366
|
-
var
|
|
4367
|
-
var
|
|
4368
|
-
var
|
|
4641
|
+
var import_react_intl21 = require("react-intl");
|
|
4642
|
+
var import_react16 = require("react");
|
|
4643
|
+
var import_jsx_runtime57 = require("react/jsx-runtime");
|
|
4369
4644
|
var ExternalConfirmationRenderer = {
|
|
4370
4645
|
canRenderType: "external-confirmation",
|
|
4371
4646
|
render: ExternalConfirmationRendererComponent
|
|
@@ -4378,20 +4653,20 @@ function ExternalConfirmationRendererComponent({
|
|
|
4378
4653
|
control,
|
|
4379
4654
|
tags
|
|
4380
4655
|
}) {
|
|
4381
|
-
const { formatMessage } = (0,
|
|
4382
|
-
(0,
|
|
4656
|
+
const { formatMessage } = (0, import_react_intl21.useIntl)();
|
|
4657
|
+
(0, import_react16.useEffect)(() => {
|
|
4383
4658
|
open();
|
|
4384
4659
|
}, []);
|
|
4385
|
-
return /* @__PURE__ */ (0,
|
|
4386
|
-
|
|
4660
|
+
return /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
4661
|
+
import_components33.Modal,
|
|
4387
4662
|
{
|
|
4388
4663
|
open: visible,
|
|
4389
4664
|
title: formatMessage(external_confirmation_messages_default.title),
|
|
4390
|
-
body: /* @__PURE__ */ (0,
|
|
4391
|
-
/* @__PURE__ */ (0,
|
|
4392
|
-
/* @__PURE__ */ (0,
|
|
4393
|
-
/* @__PURE__ */ (0,
|
|
4394
|
-
|
|
4665
|
+
body: /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(import_jsx_runtime57.Fragment, { children: [
|
|
4666
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(import_components33.Markdown, { config: { link: { target: "_blank" } }, className: "text-xs-center m-b-5", children: formatMessage(external_confirmation_messages_default.description, { origin: getOrigin(url) }) }),
|
|
4667
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)("div", { className: "df-box-renderer-fixed-width", children: /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("div", { className: "df-box-renderer-width-lg", children: [
|
|
4668
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
4669
|
+
import_components33.Button,
|
|
4395
4670
|
{
|
|
4396
4671
|
v2: true,
|
|
4397
4672
|
block: true,
|
|
@@ -4404,7 +4679,7 @@ function ExternalConfirmationRendererComponent({
|
|
|
4404
4679
|
children: formatMessage(external_confirmation_messages_default.open)
|
|
4405
4680
|
}
|
|
4406
4681
|
),
|
|
4407
|
-
/* @__PURE__ */ (0,
|
|
4682
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(import_components33.Button, { v2: true, block: true, className: "m-b-2", priority: "tertiary", size: "md", onClick: onCancel, children: formatMessage(external_confirmation_messages_default.cancel) })
|
|
4408
4683
|
] }) })
|
|
4409
4684
|
] }),
|
|
4410
4685
|
className: controlAndTagsToCSSClass({ control, tags }),
|
|
@@ -4422,51 +4697,51 @@ function getOrigin(url) {
|
|
|
4422
4697
|
var ExternalConfirmationRenderer_default = ExternalConfirmationRenderer;
|
|
4423
4698
|
|
|
4424
4699
|
// ../renderers/src/FormRenderer.tsx
|
|
4425
|
-
var
|
|
4426
|
-
var
|
|
4700
|
+
var import_classnames16 = __toESM(require_classnames());
|
|
4701
|
+
var import_jsx_runtime58 = require("react/jsx-runtime");
|
|
4427
4702
|
var FormRenderer = {
|
|
4428
4703
|
canRenderType: "form",
|
|
4429
|
-
render: ({ children, margin, control, tags }) => /* @__PURE__ */ (0,
|
|
4704
|
+
render: ({ children, margin, control, tags }) => /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("div", { className: (0, import_classnames16.default)(getMargin(margin), controlAndTagsToCSSClass({ control, tags })), children })
|
|
4430
4705
|
};
|
|
4431
4706
|
var FormRenderer_default = FormRenderer;
|
|
4432
4707
|
|
|
4433
4708
|
// ../renderers/src/FormSectionRenderer.tsx
|
|
4434
|
-
var
|
|
4435
|
-
var
|
|
4709
|
+
var import_components34 = require("@transferwise/components");
|
|
4710
|
+
var import_jsx_runtime59 = require("react/jsx-runtime");
|
|
4436
4711
|
var FormSectionRenderer = {
|
|
4437
4712
|
canRenderType: "form-section",
|
|
4438
|
-
render: ({ title, description, children, control, tags }) => /* @__PURE__ */ (0,
|
|
4439
|
-
title && /* @__PURE__ */ (0,
|
|
4440
|
-
|
|
4713
|
+
render: ({ title, description, children, control, tags }) => /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)("fieldset", { className: controlAndTagsToCSSClass({ control, tags }), children: [
|
|
4714
|
+
title && /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
4715
|
+
import_components34.Header,
|
|
4441
4716
|
{
|
|
4442
4717
|
as: "h2",
|
|
4443
4718
|
title
|
|
4444
4719
|
}
|
|
4445
4720
|
),
|
|
4446
|
-
description && /* @__PURE__ */ (0,
|
|
4721
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("p", { children: description }),
|
|
4447
4722
|
children
|
|
4448
4723
|
] })
|
|
4449
4724
|
};
|
|
4450
4725
|
var FormSectionRenderer_default = FormSectionRenderer;
|
|
4451
4726
|
|
|
4452
4727
|
// ../renderers/src/HeadingRenderer.tsx
|
|
4453
|
-
var
|
|
4454
|
-
var
|
|
4455
|
-
var
|
|
4728
|
+
var import_components35 = require("@transferwise/components");
|
|
4729
|
+
var import_classnames17 = __toESM(require_classnames());
|
|
4730
|
+
var import_jsx_runtime60 = require("react/jsx-runtime");
|
|
4456
4731
|
var HeadingRenderer = {
|
|
4457
4732
|
canRenderType: "heading",
|
|
4458
4733
|
render: Heading
|
|
4459
4734
|
};
|
|
4460
4735
|
function Heading(props) {
|
|
4461
4736
|
const { text, size, align, margin, control } = props;
|
|
4462
|
-
const className = (0,
|
|
4737
|
+
const className = (0, import_classnames17.default)(
|
|
4463
4738
|
getTextAlignmentAndMargin({ align, margin }),
|
|
4464
4739
|
controlAndTagsToCSSClass(props)
|
|
4465
4740
|
);
|
|
4466
|
-
return control === "display" ? /* @__PURE__ */ (0,
|
|
4741
|
+
return control === "display" ? /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(DisplayHeading, { size, text, className }) : /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(StandardHeading, { size, text, className });
|
|
4467
4742
|
}
|
|
4468
4743
|
function DisplayHeading({ size, text, className }) {
|
|
4469
|
-
return /* @__PURE__ */ (0,
|
|
4744
|
+
return /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(import_components35.Display, { type: getDisplayType(size), className, children: text });
|
|
4470
4745
|
}
|
|
4471
4746
|
var getDisplayType = (size) => {
|
|
4472
4747
|
switch (size) {
|
|
@@ -4482,7 +4757,7 @@ var getDisplayType = (size) => {
|
|
|
4482
4757
|
}
|
|
4483
4758
|
};
|
|
4484
4759
|
function StandardHeading({ size, text, className }) {
|
|
4485
|
-
return /* @__PURE__ */ (0,
|
|
4760
|
+
return /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(import_components35.Title, { type: getTitleTypeBySize(size), className, children: text });
|
|
4486
4761
|
}
|
|
4487
4762
|
var getTitleTypeBySize = (size) => {
|
|
4488
4763
|
var _a;
|
|
@@ -4498,9 +4773,9 @@ var getTitleTypeBySize = (size) => {
|
|
|
4498
4773
|
var HeadingRenderer_default = HeadingRenderer;
|
|
4499
4774
|
|
|
4500
4775
|
// ../renderers/src/ImageRenderer/UrlImage.tsx
|
|
4501
|
-
var
|
|
4502
|
-
var
|
|
4503
|
-
var
|
|
4776
|
+
var import_components36 = require("@transferwise/components");
|
|
4777
|
+
var import_classnames18 = __toESM(require_classnames());
|
|
4778
|
+
var import_react17 = require("react");
|
|
4504
4779
|
|
|
4505
4780
|
// ../renderers/src/utils/api-utils.ts
|
|
4506
4781
|
function isRelativePath(url = "") {
|
|
@@ -4510,7 +4785,7 @@ function isRelativePath(url = "") {
|
|
|
4510
4785
|
}
|
|
4511
4786
|
|
|
4512
4787
|
// ../renderers/src/ImageRenderer/UrlImage.tsx
|
|
4513
|
-
var
|
|
4788
|
+
var import_jsx_runtime61 = require("react/jsx-runtime");
|
|
4514
4789
|
function UrlImage({
|
|
4515
4790
|
accessibilityDescription,
|
|
4516
4791
|
align,
|
|
@@ -4521,24 +4796,24 @@ function UrlImage({
|
|
|
4521
4796
|
uri,
|
|
4522
4797
|
httpClient
|
|
4523
4798
|
}) {
|
|
4524
|
-
const [imageSource, setImageSource] = (0,
|
|
4525
|
-
(0,
|
|
4799
|
+
const [imageSource, setImageSource] = (0, import_react17.useState)("");
|
|
4800
|
+
(0, import_react17.useEffect)(() => {
|
|
4526
4801
|
if (!uri.startsWith("urn:")) {
|
|
4527
4802
|
void getImageSource(httpClient, uri).then(setImageSource);
|
|
4528
4803
|
}
|
|
4529
4804
|
}, [uri, httpClient]);
|
|
4530
|
-
return /* @__PURE__ */ (0,
|
|
4805
|
+
return /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
4531
4806
|
"div",
|
|
4532
4807
|
{
|
|
4533
|
-
className: (0,
|
|
4808
|
+
className: (0, import_classnames18.default)(
|
|
4534
4809
|
"df-image",
|
|
4535
4810
|
align,
|
|
4536
4811
|
size || "md",
|
|
4537
4812
|
getMargin(margin),
|
|
4538
4813
|
controlAndTagsToCSSClass({ control, tags })
|
|
4539
4814
|
),
|
|
4540
|
-
children: /* @__PURE__ */ (0,
|
|
4541
|
-
|
|
4815
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
4816
|
+
import_components36.Image,
|
|
4542
4817
|
{
|
|
4543
4818
|
className: "df-reserve-space",
|
|
4544
4819
|
alt: accessibilityDescription != null ? accessibilityDescription : "",
|
|
@@ -4583,19 +4858,19 @@ var getImageSource = async (httpClient, imageUrl) => {
|
|
|
4583
4858
|
};
|
|
4584
4859
|
|
|
4585
4860
|
// ../renderers/src/ImageRenderer/ImageRenderer.tsx
|
|
4586
|
-
var
|
|
4861
|
+
var import_jsx_runtime62 = require("react/jsx-runtime");
|
|
4587
4862
|
var ImageRenderer = {
|
|
4588
4863
|
canRenderType: "image",
|
|
4589
|
-
render: (props) => isUrnImage(props.uri) ? /* @__PURE__ */ (0,
|
|
4864
|
+
render: (props) => isUrnImage(props.uri) ? /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(UrnImage, __spreadValues({}, props)) : /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(UrlImage, __spreadValues({}, props))
|
|
4590
4865
|
};
|
|
4591
4866
|
|
|
4592
4867
|
// ../renderers/src/ImageRenderer/index.tsx
|
|
4593
4868
|
var ImageRenderer_default = ImageRenderer;
|
|
4594
4869
|
|
|
4595
4870
|
// ../renderers/src/InstructionsRenderer.tsx
|
|
4596
|
-
var
|
|
4597
|
-
var
|
|
4598
|
-
var
|
|
4871
|
+
var import_components37 = require("@transferwise/components");
|
|
4872
|
+
var import_classnames19 = __toESM(require_classnames());
|
|
4873
|
+
var import_jsx_runtime63 = require("react/jsx-runtime");
|
|
4599
4874
|
var doContext = ["positive", "neutral", "proposition"];
|
|
4600
4875
|
var dontContext = ["warning", "negative"];
|
|
4601
4876
|
var InstructionsRenderer = {
|
|
@@ -4603,16 +4878,16 @@ var InstructionsRenderer = {
|
|
|
4603
4878
|
render: ({ items, margin, title, control, tags }) => {
|
|
4604
4879
|
const dos = items.filter((item) => doContext.includes(item.context)).map(({ text }) => text);
|
|
4605
4880
|
const donts = items.filter((item) => dontContext.includes(item.context)).map(({ text }) => text);
|
|
4606
|
-
return /* @__PURE__ */ (0,
|
|
4607
|
-
title ? /* @__PURE__ */ (0,
|
|
4608
|
-
/* @__PURE__ */ (0,
|
|
4881
|
+
return /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)("div", { className: (0, import_classnames19.default)(getMargin(margin), controlAndTagsToCSSClass({ control, tags })), children: [
|
|
4882
|
+
title ? /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(import_components37.Header, { title }) : null,
|
|
4883
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)(import_components37.InstructionsList, { dos, donts })
|
|
4609
4884
|
] });
|
|
4610
4885
|
}
|
|
4611
4886
|
};
|
|
4612
4887
|
var InstructionsRenderer_default = InstructionsRenderer;
|
|
4613
4888
|
|
|
4614
4889
|
// ../renderers/src/IntegerInputRenderer.tsx
|
|
4615
|
-
var
|
|
4890
|
+
var import_components38 = require("@transferwise/components");
|
|
4616
4891
|
|
|
4617
4892
|
// ../renderers/src/utils/input-utils.ts
|
|
4618
4893
|
var onWheel = (event) => {
|
|
@@ -4637,7 +4912,7 @@ function pick(obj, ...keys) {
|
|
|
4637
4912
|
}
|
|
4638
4913
|
|
|
4639
4914
|
// ../renderers/src/IntegerInputRenderer.tsx
|
|
4640
|
-
var
|
|
4915
|
+
var import_jsx_runtime64 = require("react/jsx-runtime");
|
|
4641
4916
|
var IntegerInputRenderer = {
|
|
4642
4917
|
canRenderType: "input-integer",
|
|
4643
4918
|
render: (props) => {
|
|
@@ -4652,7 +4927,7 @@ var IntegerInputRenderer = {
|
|
|
4652
4927
|
"maximum",
|
|
4653
4928
|
"minimum"
|
|
4654
4929
|
);
|
|
4655
|
-
return /* @__PURE__ */ (0,
|
|
4930
|
+
return /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
|
|
4656
4931
|
FieldInput_default,
|
|
4657
4932
|
{
|
|
4658
4933
|
id,
|
|
@@ -4665,8 +4940,8 @@ var IntegerInputRenderer = {
|
|
|
4665
4940
|
features: props.features,
|
|
4666
4941
|
control: props.control,
|
|
4667
4942
|
tags: props.tags,
|
|
4668
|
-
children: /* @__PURE__ */ (0,
|
|
4669
|
-
|
|
4943
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(import_components38.InputGroup, { addonStart: getInputGroupAddonStart(media), children: /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
|
|
4944
|
+
import_components38.Input,
|
|
4670
4945
|
__spreadValues({
|
|
4671
4946
|
id,
|
|
4672
4947
|
name: id,
|
|
@@ -4688,13 +4963,13 @@ var IntegerInputRenderer = {
|
|
|
4688
4963
|
var IntegerInputRenderer_default = IntegerInputRenderer;
|
|
4689
4964
|
|
|
4690
4965
|
// ../renderers/src/ListRenderer.tsx
|
|
4691
|
-
var
|
|
4692
|
-
var
|
|
4966
|
+
var import_components40 = require("@transferwise/components");
|
|
4967
|
+
var import_classnames20 = __toESM(require_classnames());
|
|
4693
4968
|
|
|
4694
4969
|
// ../renderers/src/components/Header.tsx
|
|
4695
|
-
var
|
|
4696
|
-
var
|
|
4697
|
-
var Header = ({ title, callToAction }) => (title || callToAction) && /* @__PURE__ */ (0,
|
|
4970
|
+
var import_components39 = require("@transferwise/components");
|
|
4971
|
+
var import_jsx_runtime65 = require("react/jsx-runtime");
|
|
4972
|
+
var Header = ({ title, callToAction }) => (title || callToAction) && /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(import_components39.Header, { title: title != null ? title : "", action: getHeaderAction(callToAction) });
|
|
4698
4973
|
var getHeaderAction = (callToAction) => {
|
|
4699
4974
|
if (!callToAction) {
|
|
4700
4975
|
return void 0;
|
|
@@ -4706,11 +4981,11 @@ var getHeaderAction = (callToAction) => {
|
|
|
4706
4981
|
};
|
|
4707
4982
|
|
|
4708
4983
|
// ../renderers/src/ListRenderer.tsx
|
|
4709
|
-
var
|
|
4984
|
+
var import_jsx_runtime66 = require("react/jsx-runtime");
|
|
4710
4985
|
var ListRenderer = {
|
|
4711
4986
|
canRenderType: "list",
|
|
4712
|
-
render: ({ callToAction, control, margin, items, tags, title }) => /* @__PURE__ */ (0,
|
|
4713
|
-
/* @__PURE__ */ (0,
|
|
4987
|
+
render: ({ callToAction, control, margin, items, tags, title }) => /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)("div", { className: (0, import_classnames20.default)(getMargin(margin), controlAndTagsToCSSClass({ control, tags })), children: [
|
|
4988
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)(Header, { title, callToAction }),
|
|
4714
4989
|
items.map((item) => {
|
|
4715
4990
|
var _a, _b;
|
|
4716
4991
|
const {
|
|
@@ -4727,8 +5002,8 @@ var ListRenderer = {
|
|
|
4727
5002
|
ctaSecondary: (_a = itemTags == null ? void 0 : itemTags.includes("cta-secondary")) != null ? _a : false,
|
|
4728
5003
|
fullyInteractive: (_b = (tags == null ? void 0 : tags.includes("fully-interactive")) && (additionalInfo == null ? void 0 : additionalInfo.onClick) == null) != null ? _b : false
|
|
4729
5004
|
};
|
|
4730
|
-
return /* @__PURE__ */ (0,
|
|
4731
|
-
|
|
5005
|
+
return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
5006
|
+
import_components40.ListItem,
|
|
4732
5007
|
{
|
|
4733
5008
|
title: itemTitle,
|
|
4734
5009
|
subtitle: description,
|
|
@@ -4747,17 +5022,17 @@ var ListRenderer = {
|
|
|
4747
5022
|
var ListRenderer_default = ListRenderer;
|
|
4748
5023
|
|
|
4749
5024
|
// ../renderers/src/LoadingIndicatorRenderer.tsx
|
|
4750
|
-
var
|
|
4751
|
-
var
|
|
4752
|
-
var
|
|
5025
|
+
var import_components41 = require("@transferwise/components");
|
|
5026
|
+
var import_classnames21 = __toESM(require_classnames());
|
|
5027
|
+
var import_jsx_runtime67 = require("react/jsx-runtime");
|
|
4753
5028
|
var LoadingIndicatorRenderer = {
|
|
4754
5029
|
canRenderType: "loading-indicator",
|
|
4755
|
-
render: ({ size, margin, control, tags }) => /* @__PURE__ */ (0,
|
|
4756
|
-
|
|
5030
|
+
render: ({ size, margin, control, tags }) => /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
5031
|
+
import_components41.Loader,
|
|
4757
5032
|
{
|
|
4758
5033
|
size,
|
|
4759
5034
|
classNames: {
|
|
4760
|
-
"tw-loader": (0,
|
|
5035
|
+
"tw-loader": (0, import_classnames21.default)(
|
|
4761
5036
|
"tw-loader",
|
|
4762
5037
|
"m-x-auto",
|
|
4763
5038
|
getMargin(margin),
|
|
@@ -4771,24 +5046,24 @@ var LoadingIndicatorRenderer = {
|
|
|
4771
5046
|
var LoadingIndicatorRenderer_default = LoadingIndicatorRenderer;
|
|
4772
5047
|
|
|
4773
5048
|
// ../renderers/src/MarkdownRenderer.tsx
|
|
4774
|
-
var
|
|
4775
|
-
var
|
|
4776
|
-
var
|
|
5049
|
+
var import_components42 = require("@transferwise/components");
|
|
5050
|
+
var import_classnames22 = __toESM(require_classnames());
|
|
5051
|
+
var import_jsx_runtime68 = require("react/jsx-runtime");
|
|
4777
5052
|
var MarkdownRenderer = {
|
|
4778
5053
|
canRenderType: "markdown",
|
|
4779
5054
|
render: ({ content, align, margin, size, control, tags }) => {
|
|
4780
5055
|
const isLarge = !["xs", "sm"].includes(size);
|
|
4781
|
-
return /* @__PURE__ */ (0,
|
|
5056
|
+
return /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
|
|
4782
5057
|
"div",
|
|
4783
5058
|
{
|
|
4784
|
-
className: (0,
|
|
5059
|
+
className: (0, import_classnames22.default)(
|
|
4785
5060
|
getTextAlignmentAndMargin({ align, margin }),
|
|
4786
5061
|
controlAndTagsToCSSClass({ control, tags })
|
|
4787
5062
|
),
|
|
4788
|
-
children: /* @__PURE__ */ (0,
|
|
4789
|
-
|
|
5063
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
|
|
5064
|
+
import_components42.Markdown,
|
|
4790
5065
|
{
|
|
4791
|
-
className: (0,
|
|
5066
|
+
className: (0, import_classnames22.default)("df-markdown", {
|
|
4792
5067
|
"np-text-body-large": isLarge,
|
|
4793
5068
|
"np-text-body-default": !isLarge
|
|
4794
5069
|
}),
|
|
@@ -4803,17 +5078,17 @@ var MarkdownRenderer = {
|
|
|
4803
5078
|
var MarkdownRenderer_default = MarkdownRenderer;
|
|
4804
5079
|
|
|
4805
5080
|
// ../renderers/src/MediaRenderer.tsx
|
|
4806
|
-
var
|
|
4807
|
-
var
|
|
5081
|
+
var import_classnames23 = __toESM(require_classnames());
|
|
5082
|
+
var import_jsx_runtime69 = require("react/jsx-runtime");
|
|
4808
5083
|
var MediaRenderer = {
|
|
4809
5084
|
canRenderType: "media",
|
|
4810
5085
|
render: (_a) => {
|
|
4811
5086
|
var _b = _a, { media } = _b, rest = __objRest(_b, ["media"]);
|
|
4812
5087
|
switch (media.type) {
|
|
4813
5088
|
case "avatar":
|
|
4814
|
-
return /* @__PURE__ */ (0,
|
|
5089
|
+
return /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(AvatarMediaRendererComponent, __spreadValues({ media }, rest));
|
|
4815
5090
|
case "image":
|
|
4816
|
-
return /* @__PURE__ */ (0,
|
|
5091
|
+
return /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(ImageMediaRendererComponent, __spreadValues({ media }, rest));
|
|
4817
5092
|
case "legacy":
|
|
4818
5093
|
return null;
|
|
4819
5094
|
}
|
|
@@ -4827,16 +5102,16 @@ var AvatarMediaRendererComponent = ({
|
|
|
4827
5102
|
control,
|
|
4828
5103
|
tags
|
|
4829
5104
|
}) => {
|
|
4830
|
-
return /* @__PURE__ */ (0,
|
|
5105
|
+
return /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
4831
5106
|
"div",
|
|
4832
5107
|
{
|
|
4833
|
-
className: (0,
|
|
5108
|
+
className: (0, import_classnames23.default)(
|
|
4834
5109
|
"df-media-layout-avatar",
|
|
4835
5110
|
align,
|
|
4836
5111
|
getMargin(margin),
|
|
4837
5112
|
controlAndTagsToCSSClass({ control, tags })
|
|
4838
5113
|
),
|
|
4839
|
-
children: /* @__PURE__ */ (0,
|
|
5114
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(Media, { media, size: mapAvatarMediaSize(size) })
|
|
4840
5115
|
}
|
|
4841
5116
|
);
|
|
4842
5117
|
};
|
|
@@ -4849,14 +5124,14 @@ var ImageMediaRendererComponent = (_a) => {
|
|
|
4849
5124
|
"size"
|
|
4850
5125
|
]);
|
|
4851
5126
|
var _a2, _b2;
|
|
4852
|
-
return isUrnImage(media.uri) ? /* @__PURE__ */ (0,
|
|
5127
|
+
return isUrnImage(media.uri) ? /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
4853
5128
|
UrnImage,
|
|
4854
5129
|
__spreadValues({
|
|
4855
5130
|
uri: media.uri,
|
|
4856
5131
|
size: (_a2 = media.size) != null ? _a2 : size,
|
|
4857
5132
|
accessibilityDescription: media.accessibilityDescription
|
|
4858
5133
|
}, rest)
|
|
4859
|
-
) : /* @__PURE__ */ (0,
|
|
5134
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
4860
5135
|
UrlImage,
|
|
4861
5136
|
__spreadValues({
|
|
4862
5137
|
uri: media.uri,
|
|
@@ -4881,22 +5156,22 @@ var mapAvatarMediaSize = (size) => {
|
|
|
4881
5156
|
};
|
|
4882
5157
|
|
|
4883
5158
|
// ../renderers/src/ModalLayoutRenderer.tsx
|
|
4884
|
-
var
|
|
4885
|
-
var
|
|
4886
|
-
var
|
|
4887
|
-
var
|
|
5159
|
+
var import_components43 = require("@transferwise/components");
|
|
5160
|
+
var import_classnames24 = __toESM(require_classnames());
|
|
5161
|
+
var import_react18 = require("react");
|
|
5162
|
+
var import_jsx_runtime70 = require("react/jsx-runtime");
|
|
4888
5163
|
var ModalLayoutRenderer = {
|
|
4889
5164
|
canRenderType: "modal-layout",
|
|
4890
|
-
render: (props) => /* @__PURE__ */ (0,
|
|
5165
|
+
render: (props) => /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(DFModal, __spreadValues({}, props))
|
|
4891
5166
|
};
|
|
4892
5167
|
var ModalLayoutRenderer_default = ModalLayoutRenderer;
|
|
4893
5168
|
function DFModal({ content, margin, trigger, control, tags }) {
|
|
4894
|
-
const [visible, setVisible] = (0,
|
|
5169
|
+
const [visible, setVisible] = (0, import_react18.useState)(false);
|
|
4895
5170
|
const { children, title } = content;
|
|
4896
|
-
return /* @__PURE__ */ (0,
|
|
4897
|
-
/* @__PURE__ */ (0,
|
|
4898
|
-
/* @__PURE__ */ (0,
|
|
4899
|
-
|
|
5171
|
+
return /* @__PURE__ */ (0, import_jsx_runtime70.jsxs)("div", { className: (0, import_classnames24.default)(getMargin(margin), controlAndTagsToCSSClass({ control, tags })), children: [
|
|
5172
|
+
/* @__PURE__ */ (0, import_jsx_runtime70.jsx)(import_components43.Button, { v2: true, priority: "tertiary", block: true, onClick: () => setVisible(true), children: trigger.title }),
|
|
5173
|
+
/* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
|
|
5174
|
+
import_components43.Modal,
|
|
4900
5175
|
{
|
|
4901
5176
|
scroll: "content",
|
|
4902
5177
|
open: visible,
|
|
@@ -4910,13 +5185,13 @@ function DFModal({ content, margin, trigger, control, tags }) {
|
|
|
4910
5185
|
}
|
|
4911
5186
|
|
|
4912
5187
|
// ../renderers/src/ModalRenderer.tsx
|
|
4913
|
-
var
|
|
4914
|
-
var
|
|
5188
|
+
var import_components44 = require("@transferwise/components");
|
|
5189
|
+
var import_jsx_runtime71 = require("react/jsx-runtime");
|
|
4915
5190
|
var ModalRenderer = {
|
|
4916
5191
|
canRenderType: "modal",
|
|
4917
5192
|
render: ({ title, children, open, onClose, control, tags }) => {
|
|
4918
|
-
return /* @__PURE__ */ (0,
|
|
4919
|
-
|
|
5193
|
+
return /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(
|
|
5194
|
+
import_components44.Modal,
|
|
4920
5195
|
{
|
|
4921
5196
|
open,
|
|
4922
5197
|
title,
|
|
@@ -4929,10 +5204,10 @@ var ModalRenderer = {
|
|
|
4929
5204
|
};
|
|
4930
5205
|
|
|
4931
5206
|
// ../renderers/src/MoneyInputRenderer.tsx
|
|
4932
|
-
var
|
|
4933
|
-
var
|
|
4934
|
-
var
|
|
4935
|
-
var
|
|
5207
|
+
var import_components45 = require("@transferwise/components");
|
|
5208
|
+
var import_react19 = require("react");
|
|
5209
|
+
var import_react_intl22 = require("react-intl");
|
|
5210
|
+
var import_jsx_runtime72 = require("react/jsx-runtime");
|
|
4936
5211
|
var groupingTags2 = Object.keys(group_messages_default).filter((key) => key !== "all");
|
|
4937
5212
|
var MoneyInputRenderer = {
|
|
4938
5213
|
canRenderType: "money-input",
|
|
@@ -4956,13 +5231,13 @@ function MoneyInputRendererComponent(props) {
|
|
|
4956
5231
|
onAmountChange,
|
|
4957
5232
|
onCurrencyChange
|
|
4958
5233
|
} = props;
|
|
4959
|
-
(0,
|
|
5234
|
+
(0, import_react19.useEffect)(() => {
|
|
4960
5235
|
if (!isValidIndex(selectedCurrencyIndex, currencies.length)) {
|
|
4961
5236
|
onCurrencyChange(0);
|
|
4962
5237
|
}
|
|
4963
5238
|
}, [selectedCurrencyIndex, onCurrencyChange, currencies.length]);
|
|
4964
|
-
const { formatMessage } = (0,
|
|
4965
|
-
return /* @__PURE__ */ (0,
|
|
5239
|
+
const { formatMessage } = (0, import_react_intl22.useIntl)();
|
|
5240
|
+
return /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(
|
|
4966
5241
|
FieldInput_default,
|
|
4967
5242
|
{
|
|
4968
5243
|
id: uid,
|
|
@@ -4973,8 +5248,8 @@ function MoneyInputRendererComponent(props) {
|
|
|
4973
5248
|
features,
|
|
4974
5249
|
control,
|
|
4975
5250
|
tags,
|
|
4976
|
-
children: /* @__PURE__ */ (0,
|
|
4977
|
-
|
|
5251
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(
|
|
5252
|
+
import_components45.MoneyInput,
|
|
4978
5253
|
{
|
|
4979
5254
|
amount: parseFloatOrNull(amountValue),
|
|
4980
5255
|
searchPlaceholder: "",
|
|
@@ -5035,9 +5310,9 @@ function assertCurrencyCodeIsString(currencyCode) {
|
|
|
5035
5310
|
}
|
|
5036
5311
|
|
|
5037
5312
|
// ../renderers/src/MultiSelectInputRenderer/InlineComponent.tsx
|
|
5038
|
-
var
|
|
5039
|
-
var
|
|
5040
|
-
var
|
|
5313
|
+
var import_components46 = require("@transferwise/components");
|
|
5314
|
+
var import_react20 = require("react");
|
|
5315
|
+
var import_react_intl23 = require("react-intl");
|
|
5041
5316
|
|
|
5042
5317
|
// ../renderers/src/utils/items-with-index.ts
|
|
5043
5318
|
var zipWithIndex = (items) => items.map((item, index) => __spreadProps(__spreadValues({}, item), {
|
|
@@ -5045,7 +5320,7 @@ var zipWithIndex = (items) => items.map((item, index) => __spreadProps(__spreadV
|
|
|
5045
5320
|
}));
|
|
5046
5321
|
|
|
5047
5322
|
// ../renderers/src/MultiSelectInputRenderer/InlineComponent.tsx
|
|
5048
|
-
var
|
|
5323
|
+
var import_jsx_runtime73 = require("react/jsx-runtime");
|
|
5049
5324
|
function InlineComponent(props) {
|
|
5050
5325
|
const {
|
|
5051
5326
|
id,
|
|
@@ -5062,13 +5337,13 @@ function InlineComponent(props) {
|
|
|
5062
5337
|
onSelect
|
|
5063
5338
|
} = props;
|
|
5064
5339
|
const optionsWithIndex = zipWithIndex(options);
|
|
5065
|
-
const [query, setQuery] = (0,
|
|
5066
|
-
const { formatMessage } = (0,
|
|
5340
|
+
const [query, setQuery] = (0, import_react20.useState)("");
|
|
5341
|
+
const { formatMessage } = (0, import_react_intl23.useIntl)();
|
|
5067
5342
|
const filtered = tags == null ? void 0 : tags.includes("filtered");
|
|
5068
5343
|
const filteredOptions = query ? filterAndSortItems(optionsWithIndex, filtered ? query : "") : optionsWithIndex;
|
|
5069
|
-
return /* @__PURE__ */ (0,
|
|
5070
|
-
filtered && /* @__PURE__ */ (0,
|
|
5071
|
-
|
|
5344
|
+
return /* @__PURE__ */ (0, import_jsx_runtime73.jsxs)(import_jsx_runtime73.Fragment, { children: [
|
|
5345
|
+
filtered && /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(
|
|
5346
|
+
import_components46.SearchInput,
|
|
5072
5347
|
{
|
|
5073
5348
|
placeholder: formatMessage(filter_messages_default.placeholder),
|
|
5074
5349
|
disabled,
|
|
@@ -5080,7 +5355,7 @@ function InlineComponent(props) {
|
|
|
5080
5355
|
}
|
|
5081
5356
|
}
|
|
5082
5357
|
),
|
|
5083
|
-
/* @__PURE__ */ (0,
|
|
5358
|
+
/* @__PURE__ */ (0, import_jsx_runtime73.jsx)(
|
|
5084
5359
|
FieldInput_default,
|
|
5085
5360
|
{
|
|
5086
5361
|
id,
|
|
@@ -5105,8 +5380,8 @@ function InlineComponent(props) {
|
|
|
5105
5380
|
childrenProps
|
|
5106
5381
|
} = option;
|
|
5107
5382
|
const key = (_a = childrenProps == null ? void 0 : childrenProps.uid) != null ? _a : index;
|
|
5108
|
-
return /* @__PURE__ */ (0,
|
|
5109
|
-
|
|
5383
|
+
return /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(
|
|
5384
|
+
import_components46.ListItem,
|
|
5110
5385
|
{
|
|
5111
5386
|
title: itemTitle,
|
|
5112
5387
|
subtitle,
|
|
@@ -5114,10 +5389,10 @@ function InlineComponent(props) {
|
|
|
5114
5389
|
valueSubtitle: supportingValues == null ? void 0 : supportingValues.subvalue,
|
|
5115
5390
|
media: getMedia(media, false),
|
|
5116
5391
|
prompt: getInlineAlert(inlineAlert),
|
|
5117
|
-
additionalInfo: additionalText ? /* @__PURE__ */ (0,
|
|
5392
|
+
additionalInfo: additionalText ? /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(import_components46.ListItem.AdditionalInfo, { children: additionalText }) : void 0,
|
|
5118
5393
|
disabled: disabled || optionDisabled,
|
|
5119
|
-
control: /* @__PURE__ */ (0,
|
|
5120
|
-
|
|
5394
|
+
control: /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(
|
|
5395
|
+
import_components46.ListItem.Checkbox,
|
|
5121
5396
|
{
|
|
5122
5397
|
checked: selectedIndices.includes(index),
|
|
5123
5398
|
onChange: (e) => {
|
|
@@ -5136,13 +5411,13 @@ function InlineComponent(props) {
|
|
|
5136
5411
|
}
|
|
5137
5412
|
|
|
5138
5413
|
// ../renderers/src/MultiSelectInputRenderer/DefaultComponent.tsx
|
|
5139
|
-
var
|
|
5140
|
-
var
|
|
5141
|
-
var
|
|
5414
|
+
var import_components47 = require("@transferwise/components");
|
|
5415
|
+
var import_react21 = require("react");
|
|
5416
|
+
var import_react_intl25 = require("react-intl");
|
|
5142
5417
|
|
|
5143
5418
|
// ../renderers/src/messages/multi-select.messages.ts
|
|
5144
|
-
var
|
|
5145
|
-
var multi_select_messages_default = (0,
|
|
5419
|
+
var import_react_intl24 = require("react-intl");
|
|
5420
|
+
var multi_select_messages_default = (0, import_react_intl24.defineMessages)({
|
|
5146
5421
|
summary: {
|
|
5147
5422
|
id: "df.wise.MultiSelect.summary",
|
|
5148
5423
|
defaultMessage: "{first} and {count} more",
|
|
@@ -5151,10 +5426,10 @@ var multi_select_messages_default = (0, import_react_intl22.defineMessages)({
|
|
|
5151
5426
|
});
|
|
5152
5427
|
|
|
5153
5428
|
// ../renderers/src/MultiSelectInputRenderer/DefaultComponent.tsx
|
|
5154
|
-
var
|
|
5429
|
+
var import_jsx_runtime74 = require("react/jsx-runtime");
|
|
5155
5430
|
function DefaultComponent(props) {
|
|
5156
|
-
const { formatMessage } = (0,
|
|
5157
|
-
const [stagedIndices, setStagedIndices] = (0,
|
|
5431
|
+
const { formatMessage } = (0, import_react_intl25.useIntl)();
|
|
5432
|
+
const [stagedIndices, setStagedIndices] = (0, import_react21.useState)();
|
|
5158
5433
|
const {
|
|
5159
5434
|
id,
|
|
5160
5435
|
autoComplete,
|
|
@@ -5195,12 +5470,12 @@ function DefaultComponent(props) {
|
|
|
5195
5470
|
const contentProps = {
|
|
5196
5471
|
title: option.title,
|
|
5197
5472
|
description: option.description,
|
|
5198
|
-
icon: /* @__PURE__ */ (0,
|
|
5473
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(OptionMedia, { media: option.media, preferAvatar: false })
|
|
5199
5474
|
};
|
|
5200
|
-
return /* @__PURE__ */ (0,
|
|
5475
|
+
return /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(import_components47.SelectInputOptionContent, __spreadValues({}, contentProps));
|
|
5201
5476
|
};
|
|
5202
5477
|
const extraProps = { autoComplete };
|
|
5203
|
-
return /* @__PURE__ */ (0,
|
|
5478
|
+
return /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(
|
|
5204
5479
|
FieldInput_default,
|
|
5205
5480
|
{
|
|
5206
5481
|
id,
|
|
@@ -5211,8 +5486,8 @@ function DefaultComponent(props) {
|
|
|
5211
5486
|
features,
|
|
5212
5487
|
control,
|
|
5213
5488
|
tags,
|
|
5214
|
-
children: /* @__PURE__ */ (0,
|
|
5215
|
-
|
|
5489
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(
|
|
5490
|
+
import_components47.SelectInput,
|
|
5216
5491
|
__spreadValues({
|
|
5217
5492
|
id,
|
|
5218
5493
|
items: options.map((option, index) => {
|
|
@@ -5250,8 +5525,8 @@ function DefaultComponent(props) {
|
|
|
5250
5525
|
}
|
|
5251
5526
|
|
|
5252
5527
|
// ../renderers/src/MultiSelectInputRenderer/InlineCheckboxComponent.tsx
|
|
5253
|
-
var
|
|
5254
|
-
var
|
|
5528
|
+
var import_components48 = require("@transferwise/components");
|
|
5529
|
+
var import_jsx_runtime75 = require("react/jsx-runtime");
|
|
5255
5530
|
function InlineCheckboxComponent(props) {
|
|
5256
5531
|
const {
|
|
5257
5532
|
id,
|
|
@@ -5267,7 +5542,7 @@ function InlineCheckboxComponent(props) {
|
|
|
5267
5542
|
tags,
|
|
5268
5543
|
onSelect
|
|
5269
5544
|
} = props;
|
|
5270
|
-
return /* @__PURE__ */ (0,
|
|
5545
|
+
return /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
|
|
5271
5546
|
FieldInput_default,
|
|
5272
5547
|
{
|
|
5273
5548
|
id,
|
|
@@ -5298,35 +5573,35 @@ function InlineCheckboxComponent(props) {
|
|
|
5298
5573
|
onSelect(newSelectedIndices);
|
|
5299
5574
|
}
|
|
5300
5575
|
};
|
|
5301
|
-
return /* @__PURE__ */ (0,
|
|
5576
|
+
return /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(import_components48.Checkbox, __spreadProps(__spreadValues({}, checkboxProps), { className: "m-t-1" }), key);
|
|
5302
5577
|
})
|
|
5303
5578
|
}
|
|
5304
5579
|
);
|
|
5305
5580
|
}
|
|
5306
5581
|
|
|
5307
5582
|
// ../renderers/src/MultiSelectInputRenderer/MultiSelectInputRenderer.tsx
|
|
5308
|
-
var
|
|
5583
|
+
var import_jsx_runtime76 = require("react/jsx-runtime");
|
|
5309
5584
|
var MultiSelectInputRenderer = {
|
|
5310
5585
|
canRenderType: "input-multi-select",
|
|
5311
5586
|
render: (props) => {
|
|
5312
5587
|
switch (props.control) {
|
|
5313
5588
|
case "inline":
|
|
5314
|
-
return /* @__PURE__ */ (0,
|
|
5589
|
+
return /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(InlineComponent, __spreadValues({}, props));
|
|
5315
5590
|
case "inline-checkbox-group":
|
|
5316
|
-
return /* @__PURE__ */ (0,
|
|
5591
|
+
return /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(InlineCheckboxComponent, __spreadValues({}, props));
|
|
5317
5592
|
default:
|
|
5318
|
-
return /* @__PURE__ */ (0,
|
|
5593
|
+
return /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(DefaultComponent, __spreadValues({}, props));
|
|
5319
5594
|
}
|
|
5320
5595
|
}
|
|
5321
5596
|
};
|
|
5322
5597
|
|
|
5323
5598
|
// ../renderers/src/MultiUploadInputRenderer.tsx
|
|
5324
|
-
var
|
|
5599
|
+
var import_components50 = require("@transferwise/components");
|
|
5325
5600
|
|
|
5326
5601
|
// ../renderers/src/components/UploadFieldInput.tsx
|
|
5327
|
-
var
|
|
5328
|
-
var
|
|
5329
|
-
var
|
|
5602
|
+
var import_components49 = require("@transferwise/components");
|
|
5603
|
+
var import_classnames25 = __toESM(require_classnames());
|
|
5604
|
+
var import_jsx_runtime77 = require("react/jsx-runtime");
|
|
5330
5605
|
function UploadFieldInput({
|
|
5331
5606
|
id,
|
|
5332
5607
|
children,
|
|
@@ -5338,14 +5613,14 @@ function UploadFieldInput({
|
|
|
5338
5613
|
control,
|
|
5339
5614
|
tags
|
|
5340
5615
|
}) {
|
|
5341
|
-
const labelContent = label && help ? /* @__PURE__ */ (0,
|
|
5616
|
+
const labelContent = label && help ? /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(LabelContentWithHelp, { text: label, help }) : label;
|
|
5342
5617
|
const descriptionId = description ? `${id}-description` : void 0;
|
|
5343
5618
|
const { ref } = useScrollToError(validation, features);
|
|
5344
|
-
return /* @__PURE__ */ (0,
|
|
5619
|
+
return /* @__PURE__ */ (0, import_jsx_runtime77.jsxs)(
|
|
5345
5620
|
"div",
|
|
5346
5621
|
{
|
|
5347
5622
|
ref,
|
|
5348
|
-
className: (0,
|
|
5623
|
+
className: (0, import_classnames25.default)(
|
|
5349
5624
|
"form-group d-block",
|
|
5350
5625
|
{
|
|
5351
5626
|
"has-error": (validation == null ? void 0 : validation.status) === "invalid"
|
|
@@ -5353,9 +5628,9 @@ function UploadFieldInput({
|
|
|
5353
5628
|
controlAndTagsToCSSClass({ control, tags })
|
|
5354
5629
|
),
|
|
5355
5630
|
children: [
|
|
5356
|
-
/* @__PURE__ */ (0,
|
|
5631
|
+
/* @__PURE__ */ (0, import_jsx_runtime77.jsx)("label", { htmlFor: id, className: "control-label", children: labelContent }),
|
|
5357
5632
|
children,
|
|
5358
|
-
(validation == null ? void 0 : validation.status) === "invalid" && /* @__PURE__ */ (0,
|
|
5633
|
+
(validation == null ? void 0 : validation.status) === "invalid" && /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(import_components49.InlineAlert, { type: "negative", id: descriptionId, children: validation.message })
|
|
5359
5634
|
]
|
|
5360
5635
|
}
|
|
5361
5636
|
);
|
|
@@ -5390,7 +5665,7 @@ var getSizeLimit = (maxSize) => {
|
|
|
5390
5665
|
};
|
|
5391
5666
|
|
|
5392
5667
|
// ../renderers/src/MultiUploadInputRenderer.tsx
|
|
5393
|
-
var
|
|
5668
|
+
var import_jsx_runtime78 = require("react/jsx-runtime");
|
|
5394
5669
|
var MultiUploadInputRenderer = {
|
|
5395
5670
|
canRenderType: "input-upload-multi",
|
|
5396
5671
|
render: (props) => {
|
|
@@ -5418,7 +5693,7 @@ var MultiUploadInputRenderer = {
|
|
|
5418
5693
|
};
|
|
5419
5694
|
const onDeleteFile = async (fileId) => onRemoveFile(value.findIndex((file) => file.id === fileId));
|
|
5420
5695
|
const descriptionId = description ? `${id}-description` : void 0;
|
|
5421
|
-
return /* @__PURE__ */ (0,
|
|
5696
|
+
return /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
|
|
5422
5697
|
UploadFieldInput_default,
|
|
5423
5698
|
{
|
|
5424
5699
|
id,
|
|
@@ -5429,8 +5704,8 @@ var MultiUploadInputRenderer = {
|
|
|
5429
5704
|
features,
|
|
5430
5705
|
control,
|
|
5431
5706
|
tags,
|
|
5432
|
-
children: /* @__PURE__ */ (0,
|
|
5433
|
-
|
|
5707
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
|
|
5708
|
+
import_components50.UploadInput,
|
|
5434
5709
|
{
|
|
5435
5710
|
id,
|
|
5436
5711
|
"aria-describedby": descriptionId,
|
|
@@ -5439,7 +5714,7 @@ var MultiUploadInputRenderer = {
|
|
|
5439
5714
|
files: value.map(({ id: fileId, file, validationState: fileValidationState }) => ({
|
|
5440
5715
|
id: fileId,
|
|
5441
5716
|
filename: file.name,
|
|
5442
|
-
status: (fileValidationState == null ? void 0 : fileValidationState.status) === "invalid" ?
|
|
5717
|
+
status: (fileValidationState == null ? void 0 : fileValidationState.status) === "invalid" ? import_components50.Status.FAILED : import_components50.Status.SUCCEEDED
|
|
5443
5718
|
})),
|
|
5444
5719
|
fileTypes: acceptsToFileTypes(accepts),
|
|
5445
5720
|
maxFiles: maxItems,
|
|
@@ -5457,8 +5732,8 @@ var MultiUploadInputRenderer = {
|
|
|
5457
5732
|
var MultiUploadInputRenderer_default = MultiUploadInputRenderer;
|
|
5458
5733
|
|
|
5459
5734
|
// ../renderers/src/NumberInputRenderer.tsx
|
|
5460
|
-
var
|
|
5461
|
-
var
|
|
5735
|
+
var import_components51 = require("@transferwise/components");
|
|
5736
|
+
var import_jsx_runtime79 = require("react/jsx-runtime");
|
|
5462
5737
|
var NumberInputRenderer = {
|
|
5463
5738
|
canRenderType: "input-number",
|
|
5464
5739
|
render: (props) => {
|
|
@@ -5472,7 +5747,7 @@ var NumberInputRenderer = {
|
|
|
5472
5747
|
"maximum",
|
|
5473
5748
|
"minimum"
|
|
5474
5749
|
);
|
|
5475
|
-
return /* @__PURE__ */ (0,
|
|
5750
|
+
return /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
|
|
5476
5751
|
FieldInput_default,
|
|
5477
5752
|
{
|
|
5478
5753
|
id,
|
|
@@ -5485,8 +5760,8 @@ var NumberInputRenderer = {
|
|
|
5485
5760
|
features: props.features,
|
|
5486
5761
|
control: props.control,
|
|
5487
5762
|
tags: props.tags,
|
|
5488
|
-
children: /* @__PURE__ */ (0,
|
|
5489
|
-
|
|
5763
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(import_components51.InputGroup, { addonStart: getInputGroupAddonStart(media), children: /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
|
|
5764
|
+
import_components51.Input,
|
|
5490
5765
|
__spreadValues({
|
|
5491
5766
|
id,
|
|
5492
5767
|
name: id,
|
|
@@ -5506,22 +5781,22 @@ var NumberInputRenderer = {
|
|
|
5506
5781
|
var NumberInputRenderer_default = NumberInputRenderer;
|
|
5507
5782
|
|
|
5508
5783
|
// ../renderers/src/ParagraphRenderer.tsx
|
|
5509
|
-
var
|
|
5510
|
-
var
|
|
5511
|
-
var
|
|
5784
|
+
var import_components53 = require("@transferwise/components");
|
|
5785
|
+
var import_classnames26 = __toESM(require_classnames());
|
|
5786
|
+
var import_react_intl27 = require("react-intl");
|
|
5512
5787
|
|
|
5513
5788
|
// ../renderers/src/hooks/useSnackBarIfAvailable.ts
|
|
5514
|
-
var
|
|
5515
|
-
var
|
|
5789
|
+
var import_components52 = require("@transferwise/components");
|
|
5790
|
+
var import_react22 = require("react");
|
|
5516
5791
|
function useSnackBarIfAvailable() {
|
|
5517
|
-
const context = (0,
|
|
5792
|
+
const context = (0, import_react22.useContext)(import_components52.SnackbarContext);
|
|
5518
5793
|
return context ? context.createSnackbar : () => {
|
|
5519
5794
|
};
|
|
5520
5795
|
}
|
|
5521
5796
|
|
|
5522
5797
|
// ../renderers/src/messages/paragraph.messages.ts
|
|
5523
|
-
var
|
|
5524
|
-
var paragraph_messages_default = (0,
|
|
5798
|
+
var import_react_intl26 = require("react-intl");
|
|
5799
|
+
var paragraph_messages_default = (0, import_react_intl26.defineMessages)({
|
|
5525
5800
|
copy: {
|
|
5526
5801
|
id: "df.wise.DynamicParagraph.copy",
|
|
5527
5802
|
defaultMessage: "Copy",
|
|
@@ -5535,18 +5810,18 @@ var paragraph_messages_default = (0, import_react_intl24.defineMessages)({
|
|
|
5535
5810
|
});
|
|
5536
5811
|
|
|
5537
5812
|
// ../renderers/src/ParagraphRenderer.tsx
|
|
5538
|
-
var
|
|
5813
|
+
var import_jsx_runtime80 = require("react/jsx-runtime");
|
|
5539
5814
|
var ParagraphRenderer = {
|
|
5540
5815
|
canRenderType: "paragraph",
|
|
5541
|
-
render: (props) => /* @__PURE__ */ (0,
|
|
5816
|
+
render: (props) => /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(Paragraph, __spreadValues({}, props))
|
|
5542
5817
|
};
|
|
5543
5818
|
function Paragraph(props) {
|
|
5544
5819
|
const { align, control, margin, size, text } = props;
|
|
5545
|
-
const className = (0,
|
|
5820
|
+
const className = (0, import_classnames26.default)(
|
|
5546
5821
|
getTextAlignmentAndMargin({ align, margin }),
|
|
5547
5822
|
controlAndTagsToCSSClass(props)
|
|
5548
5823
|
);
|
|
5549
|
-
return control === "copyable" ? /* @__PURE__ */ (0,
|
|
5824
|
+
return control === "copyable" ? /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(CopyableParagraph, { className, align, text }) : /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(
|
|
5550
5825
|
"p",
|
|
5551
5826
|
{
|
|
5552
5827
|
className: `${["xs", "sm"].includes(size) ? "np-text-body-default" : "np-text-body-large"} ${className}`,
|
|
@@ -5559,41 +5834,41 @@ function CopyableParagraph({
|
|
|
5559
5834
|
align,
|
|
5560
5835
|
className
|
|
5561
5836
|
}) {
|
|
5562
|
-
const { formatMessage } = (0,
|
|
5837
|
+
const { formatMessage } = (0, import_react_intl27.useIntl)();
|
|
5563
5838
|
const createSnackbar = useSnackBarIfAvailable();
|
|
5564
5839
|
const copy = () => {
|
|
5565
5840
|
navigator.clipboard.writeText(text).then(() => createSnackbar({ text: formatMessage(paragraph_messages_default.copied) })).catch(() => {
|
|
5566
5841
|
});
|
|
5567
5842
|
};
|
|
5568
5843
|
const inputAlignmentClasses = getTextAlignmentAndMargin({ align, margin: "sm" });
|
|
5569
|
-
return /* @__PURE__ */ (0,
|
|
5570
|
-
/* @__PURE__ */ (0,
|
|
5571
|
-
|
|
5844
|
+
return /* @__PURE__ */ (0, import_jsx_runtime80.jsxs)("div", { className, children: [
|
|
5845
|
+
/* @__PURE__ */ (0, import_jsx_runtime80.jsx)(
|
|
5846
|
+
import_components53.Input,
|
|
5572
5847
|
{
|
|
5573
5848
|
type: "text",
|
|
5574
5849
|
value: text,
|
|
5575
5850
|
readOnly: true,
|
|
5576
|
-
className: (0,
|
|
5851
|
+
className: (0, import_classnames26.default)("text-ellipsis", inputAlignmentClasses)
|
|
5577
5852
|
}
|
|
5578
5853
|
),
|
|
5579
|
-
/* @__PURE__ */ (0,
|
|
5854
|
+
/* @__PURE__ */ (0, import_jsx_runtime80.jsx)(import_components53.Button, { v2: true, block: true, onClick: copy, children: formatMessage(paragraph_messages_default.copy) })
|
|
5580
5855
|
] });
|
|
5581
5856
|
}
|
|
5582
5857
|
var ParagraphRenderer_default = ParagraphRenderer;
|
|
5583
5858
|
|
|
5584
5859
|
// ../renderers/src/ProgressRenderer.tsx
|
|
5585
|
-
var
|
|
5586
|
-
var
|
|
5587
|
-
var
|
|
5860
|
+
var import_components54 = require("@transferwise/components");
|
|
5861
|
+
var import_classnames27 = __toESM(require_classnames());
|
|
5862
|
+
var import_jsx_runtime81 = require("react/jsx-runtime");
|
|
5588
5863
|
var ProgressRenderer = {
|
|
5589
5864
|
canRenderType: "progress",
|
|
5590
5865
|
render: ({ uid, title, help, progress, progressText, margin, description, control, tags }) => {
|
|
5591
|
-
return /* @__PURE__ */ (0,
|
|
5592
|
-
|
|
5866
|
+
return /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(
|
|
5867
|
+
import_components54.ProgressBar,
|
|
5593
5868
|
{
|
|
5594
5869
|
id: uid,
|
|
5595
|
-
className: (0,
|
|
5596
|
-
title: title && help ? /* @__PURE__ */ (0,
|
|
5870
|
+
className: (0, import_classnames27.default)(getMargin(margin), controlAndTagsToCSSClass({ control, tags })),
|
|
5871
|
+
title: title && help ? /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(LabelContentWithHelp, { text: title, help }) : title,
|
|
5597
5872
|
description,
|
|
5598
5873
|
progress: {
|
|
5599
5874
|
max: 1,
|
|
@@ -5606,15 +5881,15 @@ var ProgressRenderer = {
|
|
|
5606
5881
|
};
|
|
5607
5882
|
|
|
5608
5883
|
// ../renderers/src/RepeatableRenderer.tsx
|
|
5609
|
-
var
|
|
5610
|
-
var
|
|
5611
|
-
var
|
|
5612
|
-
var
|
|
5613
|
-
var
|
|
5884
|
+
var import_components55 = require("@transferwise/components");
|
|
5885
|
+
var import_icons3 = require("@transferwise/icons");
|
|
5886
|
+
var import_classnames28 = __toESM(require_classnames());
|
|
5887
|
+
var import_react23 = require("react");
|
|
5888
|
+
var import_react_intl29 = require("react-intl");
|
|
5614
5889
|
|
|
5615
5890
|
// ../renderers/src/messages/repeatable.messages.ts
|
|
5616
|
-
var
|
|
5617
|
-
var repeatable_messages_default = (0,
|
|
5891
|
+
var import_react_intl28 = require("react-intl");
|
|
5892
|
+
var repeatable_messages_default = (0, import_react_intl28.defineMessages)({
|
|
5618
5893
|
addItemTitle: {
|
|
5619
5894
|
id: "df.wise.ArraySchema.addItemTitle",
|
|
5620
5895
|
defaultMessage: "Add Item",
|
|
@@ -5638,10 +5913,10 @@ var repeatable_messages_default = (0, import_react_intl26.defineMessages)({
|
|
|
5638
5913
|
});
|
|
5639
5914
|
|
|
5640
5915
|
// ../renderers/src/RepeatableRenderer.tsx
|
|
5641
|
-
var
|
|
5916
|
+
var import_jsx_runtime82 = require("react/jsx-runtime");
|
|
5642
5917
|
var RepeatableRenderer = {
|
|
5643
5918
|
canRenderType: "repeatable",
|
|
5644
|
-
render: (props) => /* @__PURE__ */ (0,
|
|
5919
|
+
render: (props) => /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(Repeatable, __spreadValues({}, props))
|
|
5645
5920
|
};
|
|
5646
5921
|
function Repeatable(props) {
|
|
5647
5922
|
const {
|
|
@@ -5658,8 +5933,8 @@ function Repeatable(props) {
|
|
|
5658
5933
|
onSave,
|
|
5659
5934
|
onRemove
|
|
5660
5935
|
} = props;
|
|
5661
|
-
const { formatMessage } = (0,
|
|
5662
|
-
const [openModalType, setOpenModalType] = (0,
|
|
5936
|
+
const { formatMessage } = (0, import_react_intl29.useIntl)();
|
|
5937
|
+
const [openModalType, setOpenModalType] = (0, import_react23.useState)(null);
|
|
5663
5938
|
const { ref } = useScrollToError(validationState, features);
|
|
5664
5939
|
const onAddItem = () => {
|
|
5665
5940
|
onAdd();
|
|
@@ -5682,43 +5957,43 @@ function Repeatable(props) {
|
|
|
5682
5957
|
const onCancelEdit = () => {
|
|
5683
5958
|
setOpenModalType(null);
|
|
5684
5959
|
};
|
|
5685
|
-
return /* @__PURE__ */ (0,
|
|
5686
|
-
/* @__PURE__ */ (0,
|
|
5687
|
-
title && /* @__PURE__ */ (0,
|
|
5688
|
-
description && /* @__PURE__ */ (0,
|
|
5689
|
-
/* @__PURE__ */ (0,
|
|
5960
|
+
return /* @__PURE__ */ (0, import_jsx_runtime82.jsxs)(import_jsx_runtime82.Fragment, { children: [
|
|
5961
|
+
/* @__PURE__ */ (0, import_jsx_runtime82.jsxs)("div", { ref, className: controlAndTagsToCSSClass(props), children: [
|
|
5962
|
+
title && /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(import_components55.Header, { title }),
|
|
5963
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime82.jsx)("p", { children: description }),
|
|
5964
|
+
/* @__PURE__ */ (0, import_jsx_runtime82.jsxs)(
|
|
5690
5965
|
"div",
|
|
5691
5966
|
{
|
|
5692
|
-
className: (0,
|
|
5967
|
+
className: (0, import_classnames28.default)("form-group", {
|
|
5693
5968
|
"has-error": (validationState == null ? void 0 : validationState.status) === "invalid"
|
|
5694
5969
|
}),
|
|
5695
5970
|
children: [
|
|
5696
|
-
items == null ? void 0 : items.map((item, index) => /* @__PURE__ */ (0,
|
|
5697
|
-
/* @__PURE__ */ (0,
|
|
5698
|
-
|
|
5971
|
+
items == null ? void 0 : items.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(ItemSummaryOption, { item, onClick: () => onEditItem(index) }, item.id)),
|
|
5972
|
+
/* @__PURE__ */ (0, import_jsx_runtime82.jsx)(
|
|
5973
|
+
import_components55.NavigationOption,
|
|
5699
5974
|
{
|
|
5700
|
-
media: /* @__PURE__ */ (0,
|
|
5975
|
+
media: /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(import_icons3.Plus, {}),
|
|
5701
5976
|
title: addItemTitle || formatMessage(repeatable_messages_default.addItemTitle),
|
|
5702
5977
|
showMediaAtAllSizes: true,
|
|
5703
5978
|
onClick: () => onAddItem()
|
|
5704
5979
|
}
|
|
5705
5980
|
),
|
|
5706
|
-
(validationState == null ? void 0 : validationState.status) === "invalid" && /* @__PURE__ */ (0,
|
|
5981
|
+
(validationState == null ? void 0 : validationState.status) === "invalid" && /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(import_components55.InlineAlert, { type: "negative", children: validationState.message })
|
|
5707
5982
|
]
|
|
5708
5983
|
}
|
|
5709
5984
|
)
|
|
5710
5985
|
] }),
|
|
5711
|
-
/* @__PURE__ */ (0,
|
|
5712
|
-
|
|
5986
|
+
/* @__PURE__ */ (0, import_jsx_runtime82.jsx)(
|
|
5987
|
+
import_components55.Modal,
|
|
5713
5988
|
{
|
|
5714
5989
|
open: openModalType !== null,
|
|
5715
5990
|
title: (openModalType === "add" ? addItemTitle : editItemTitle) || formatMessage(repeatable_messages_default.addItemTitle),
|
|
5716
|
-
body: /* @__PURE__ */ (0,
|
|
5717
|
-
/* @__PURE__ */ (0,
|
|
5718
|
-
/* @__PURE__ */ (0,
|
|
5719
|
-
/* @__PURE__ */ (0,
|
|
5720
|
-
/* @__PURE__ */ (0,
|
|
5721
|
-
|
|
5991
|
+
body: /* @__PURE__ */ (0, import_jsx_runtime82.jsxs)(import_jsx_runtime82.Fragment, { children: [
|
|
5992
|
+
/* @__PURE__ */ (0, import_jsx_runtime82.jsx)("div", { className: "m-b-2", children: editableItem }),
|
|
5993
|
+
/* @__PURE__ */ (0, import_jsx_runtime82.jsxs)("div", { children: [
|
|
5994
|
+
/* @__PURE__ */ (0, import_jsx_runtime82.jsx)(import_components55.Button, { priority: "primary", block: true, className: "m-b-2", onClick: () => onSaveItem(), children: formatMessage(repeatable_messages_default.addItem) }),
|
|
5995
|
+
/* @__PURE__ */ (0, import_jsx_runtime82.jsx)(
|
|
5996
|
+
import_components55.Button,
|
|
5722
5997
|
{
|
|
5723
5998
|
v2: true,
|
|
5724
5999
|
priority: "secondary",
|
|
@@ -5739,10 +6014,10 @@ function ItemSummaryOption({
|
|
|
5739
6014
|
item,
|
|
5740
6015
|
onClick
|
|
5741
6016
|
}) {
|
|
5742
|
-
return /* @__PURE__ */ (0,
|
|
5743
|
-
|
|
6017
|
+
return /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(
|
|
6018
|
+
import_components55.NavigationOption,
|
|
5744
6019
|
{
|
|
5745
|
-
media: /* @__PURE__ */ (0,
|
|
6020
|
+
media: /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(OptionMedia, { media: item.media, preferAvatar: false }),
|
|
5746
6021
|
title: item.title,
|
|
5747
6022
|
content: item.description,
|
|
5748
6023
|
showMediaAtAllSizes: true,
|
|
@@ -5754,17 +6029,17 @@ function ItemSummaryOption({
|
|
|
5754
6029
|
var RepeatableRenderer_default = RepeatableRenderer;
|
|
5755
6030
|
|
|
5756
6031
|
// ../renderers/src/ReviewLegacyRenderer.tsx
|
|
5757
|
-
var
|
|
5758
|
-
var
|
|
5759
|
-
var
|
|
6032
|
+
var import_components56 = require("@transferwise/components");
|
|
6033
|
+
var import_classnames29 = __toESM(require_classnames());
|
|
6034
|
+
var import_jsx_runtime83 = require("react/jsx-runtime");
|
|
5760
6035
|
var ReviewRenderer = {
|
|
5761
6036
|
canRenderType: "review",
|
|
5762
6037
|
render: ({ callToAction, control, fields, margin, title, trackEvent, tags }) => {
|
|
5763
6038
|
const orientation = mapControlToDefinitionListLayout(control);
|
|
5764
|
-
return /* @__PURE__ */ (0,
|
|
5765
|
-
/* @__PURE__ */ (0,
|
|
5766
|
-
/* @__PURE__ */ (0,
|
|
5767
|
-
|
|
6039
|
+
return /* @__PURE__ */ (0, import_jsx_runtime83.jsxs)("div", { className: (0, import_classnames29.default)(getMargin(margin), controlAndTagsToCSSClass({ control, tags })), children: [
|
|
6040
|
+
/* @__PURE__ */ (0, import_jsx_runtime83.jsx)(Header, { title, callToAction }),
|
|
6041
|
+
/* @__PURE__ */ (0, import_jsx_runtime83.jsx)("div", { className: margin, children: /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(
|
|
6042
|
+
import_components56.DefinitionList,
|
|
5768
6043
|
{
|
|
5769
6044
|
layout: orientation,
|
|
5770
6045
|
definitions: fields.map(
|
|
@@ -5801,21 +6076,21 @@ var mapControlToDefinitionListLayout = (control) => {
|
|
|
5801
6076
|
};
|
|
5802
6077
|
var getFieldLabel = (label, help, onClick) => {
|
|
5803
6078
|
if (help) {
|
|
5804
|
-
return /* @__PURE__ */ (0,
|
|
6079
|
+
return /* @__PURE__ */ (0, import_jsx_runtime83.jsxs)(import_jsx_runtime83.Fragment, { children: [
|
|
5805
6080
|
label,
|
|
5806
6081
|
" ",
|
|
5807
|
-
/* @__PURE__ */ (0,
|
|
6082
|
+
/* @__PURE__ */ (0, import_jsx_runtime83.jsx)(Help_default, { help, onClick })
|
|
5808
6083
|
] });
|
|
5809
6084
|
}
|
|
5810
6085
|
return label;
|
|
5811
6086
|
};
|
|
5812
6087
|
|
|
5813
6088
|
// ../renderers/src/ReviewRenderer.tsx
|
|
5814
|
-
var
|
|
5815
|
-
var
|
|
5816
|
-
var
|
|
5817
|
-
var
|
|
5818
|
-
var
|
|
6089
|
+
var import_components57 = require("@transferwise/components");
|
|
6090
|
+
var import_icons4 = require("@transferwise/icons");
|
|
6091
|
+
var import_classnames30 = __toESM(require_classnames());
|
|
6092
|
+
var import_react_intl30 = require("react-intl");
|
|
6093
|
+
var import_jsx_runtime84 = require("react/jsx-runtime");
|
|
5819
6094
|
var IGNORED_CONTROLS = [
|
|
5820
6095
|
"horizontal",
|
|
5821
6096
|
"horizontal-end-aligned",
|
|
@@ -5825,7 +6100,7 @@ var IGNORED_CONTROLS = [
|
|
|
5825
6100
|
var ReviewRenderer2 = {
|
|
5826
6101
|
canRenderType: "review",
|
|
5827
6102
|
canRender: ({ control }) => control ? !IGNORED_CONTROLS.includes(control) : true,
|
|
5828
|
-
render: (props) => /* @__PURE__ */ (0,
|
|
6103
|
+
render: (props) => /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(Review, __spreadValues({}, props))
|
|
5829
6104
|
};
|
|
5830
6105
|
var Review = ({
|
|
5831
6106
|
callToAction,
|
|
@@ -5836,9 +6111,9 @@ var Review = ({
|
|
|
5836
6111
|
title,
|
|
5837
6112
|
trackEvent
|
|
5838
6113
|
}) => {
|
|
5839
|
-
const intl = (0,
|
|
5840
|
-
return /* @__PURE__ */ (0,
|
|
5841
|
-
/* @__PURE__ */ (0,
|
|
6114
|
+
const intl = (0, import_react_intl30.useIntl)();
|
|
6115
|
+
return /* @__PURE__ */ (0, import_jsx_runtime84.jsxs)("div", { className: (0, import_classnames30.default)(getMargin(margin), controlAndTagsToCSSClass({ control, tags })), children: [
|
|
6116
|
+
/* @__PURE__ */ (0, import_jsx_runtime84.jsx)(Header, { title, callToAction }),
|
|
5842
6117
|
fields.map((field) => {
|
|
5843
6118
|
var _a, _b, _c;
|
|
5844
6119
|
const {
|
|
@@ -5856,8 +6131,8 @@ var Review = ({
|
|
|
5856
6131
|
ctaSecondary: (_a = itemTags == null ? void 0 : itemTags.includes("cta-secondary")) != null ? _a : false,
|
|
5857
6132
|
fullyInteractive: (_b = (tags == null ? void 0 : tags.includes("fully-interactive")) && (additionalInfo == null ? void 0 : additionalInfo.onClick) == null) != null ? _b : false
|
|
5858
6133
|
};
|
|
5859
|
-
return /* @__PURE__ */ (0,
|
|
5860
|
-
|
|
6134
|
+
return /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(
|
|
6135
|
+
import_components57.ListItem,
|
|
5861
6136
|
{
|
|
5862
6137
|
title: value,
|
|
5863
6138
|
subtitle: label,
|
|
@@ -5877,18 +6152,18 @@ var Review = ({
|
|
|
5877
6152
|
] });
|
|
5878
6153
|
};
|
|
5879
6154
|
var getHelpControl = (help, ariaLabel, onClick) => {
|
|
5880
|
-
return /* @__PURE__ */ (0,
|
|
6155
|
+
return /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(import_components57.Popover, { content: /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(import_components57.Markdown, { config: { link: { target: "_blank" } }, children: help }), children: /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(import_components57.ListItem.IconButton, { partiallyInteractive: true, "aria-label": ariaLabel, onClick, children: /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(import_icons4.QuestionMarkCircle, {}) }) });
|
|
5881
6156
|
};
|
|
5882
6157
|
var ReviewRenderer_default = ReviewRenderer2;
|
|
5883
6158
|
|
|
5884
6159
|
// ../renderers/src/SearchRenderer/BlockSearchRendererComponent.tsx
|
|
5885
|
-
var
|
|
5886
|
-
var
|
|
5887
|
-
var
|
|
6160
|
+
var import_components59 = require("@transferwise/components");
|
|
6161
|
+
var import_react24 = require("react");
|
|
6162
|
+
var import_react_intl33 = require("react-intl");
|
|
5888
6163
|
|
|
5889
6164
|
// ../renderers/src/messages/search.messages.ts
|
|
5890
|
-
var
|
|
5891
|
-
var search_messages_default = (0,
|
|
6165
|
+
var import_react_intl31 = require("react-intl");
|
|
6166
|
+
var search_messages_default = (0, import_react_intl31.defineMessages)({
|
|
5892
6167
|
loading: {
|
|
5893
6168
|
id: "df.wise.SearchLayout.loading",
|
|
5894
6169
|
defaultMessage: "Loading...",
|
|
@@ -5897,21 +6172,21 @@ var search_messages_default = (0, import_react_intl29.defineMessages)({
|
|
|
5897
6172
|
});
|
|
5898
6173
|
|
|
5899
6174
|
// ../renderers/src/SearchRenderer/ErrorResult.tsx
|
|
5900
|
-
var
|
|
5901
|
-
var
|
|
5902
|
-
var
|
|
6175
|
+
var import_react_intl32 = require("react-intl");
|
|
6176
|
+
var import_components58 = require("@transferwise/components");
|
|
6177
|
+
var import_jsx_runtime85 = require("react/jsx-runtime");
|
|
5903
6178
|
function ErrorResult({ state }) {
|
|
5904
|
-
const intl = (0,
|
|
5905
|
-
return /* @__PURE__ */ (0,
|
|
6179
|
+
const intl = (0, import_react_intl32.useIntl)();
|
|
6180
|
+
return /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)("p", { className: "m-t-2", children: [
|
|
5906
6181
|
intl.formatMessage(generic_error_messages_default.genericError),
|
|
5907
6182
|
"\xA0",
|
|
5908
|
-
/* @__PURE__ */ (0,
|
|
6183
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)(import_components58.Link, { onClick: () => state.onRetry(), children: intl.formatMessage(generic_error_messages_default.retry) })
|
|
5909
6184
|
] });
|
|
5910
6185
|
}
|
|
5911
6186
|
|
|
5912
6187
|
// ../renderers/src/SearchRenderer/BlockSearchRendererComponent.tsx
|
|
5913
|
-
var
|
|
5914
|
-
var
|
|
6188
|
+
var import_icons5 = require("@transferwise/icons");
|
|
6189
|
+
var import_jsx_runtime86 = require("react/jsx-runtime");
|
|
5915
6190
|
function BlockSearchRendererComponent({
|
|
5916
6191
|
id,
|
|
5917
6192
|
hint,
|
|
@@ -5926,10 +6201,10 @@ function BlockSearchRendererComponent({
|
|
|
5926
6201
|
trackEvent,
|
|
5927
6202
|
onChange
|
|
5928
6203
|
}) {
|
|
5929
|
-
const [hasSearched, setHasSearched] = (0,
|
|
5930
|
-
const { formatMessage } = (0,
|
|
5931
|
-
return /* @__PURE__ */ (0,
|
|
5932
|
-
/* @__PURE__ */ (0,
|
|
6204
|
+
const [hasSearched, setHasSearched] = (0, import_react24.useState)(false);
|
|
6205
|
+
const { formatMessage } = (0, import_react_intl33.useIntl)();
|
|
6206
|
+
return /* @__PURE__ */ (0, import_jsx_runtime86.jsxs)("div", { className: getMargin(margin), children: [
|
|
6207
|
+
/* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
|
|
5933
6208
|
FieldInput_default,
|
|
5934
6209
|
{
|
|
5935
6210
|
id,
|
|
@@ -5940,8 +6215,8 @@ function BlockSearchRendererComponent({
|
|
|
5940
6215
|
features,
|
|
5941
6216
|
control,
|
|
5942
6217
|
tags,
|
|
5943
|
-
children: /* @__PURE__ */ (0,
|
|
5944
|
-
|
|
6218
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(import_components59.InputGroup, { addonStart: { content: /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(import_icons5.Search, { size: 24 }) }, children: /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
|
|
6219
|
+
import_components59.Input,
|
|
5945
6220
|
{
|
|
5946
6221
|
id,
|
|
5947
6222
|
name: id,
|
|
@@ -5960,7 +6235,7 @@ function BlockSearchRendererComponent({
|
|
|
5960
6235
|
) })
|
|
5961
6236
|
}
|
|
5962
6237
|
),
|
|
5963
|
-
isLoading ? /* @__PURE__ */ (0,
|
|
6238
|
+
isLoading ? /* @__PURE__ */ (0, import_jsx_runtime86.jsx)("span", { children: formatMessage(search_messages_default.loading) }) : /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(SearchResultContent, { state, trackEvent })
|
|
5964
6239
|
] });
|
|
5965
6240
|
}
|
|
5966
6241
|
function SearchResultContent({
|
|
@@ -5969,39 +6244,39 @@ function SearchResultContent({
|
|
|
5969
6244
|
}) {
|
|
5970
6245
|
switch (state.type) {
|
|
5971
6246
|
case "error":
|
|
5972
|
-
return /* @__PURE__ */ (0,
|
|
6247
|
+
return /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(ErrorResult, { state });
|
|
5973
6248
|
case "results":
|
|
5974
|
-
return /* @__PURE__ */ (0,
|
|
6249
|
+
return /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(SearchResults, { state, trackEvent });
|
|
5975
6250
|
case "layout":
|
|
5976
|
-
return /* @__PURE__ */ (0,
|
|
6251
|
+
return /* @__PURE__ */ (0, import_jsx_runtime86.jsxs)(import_jsx_runtime86.Fragment, { children: [
|
|
5977
6252
|
" ",
|
|
5978
6253
|
state.layout,
|
|
5979
6254
|
" "
|
|
5980
6255
|
] });
|
|
5981
6256
|
case "noResults":
|
|
5982
|
-
return /* @__PURE__ */ (0,
|
|
6257
|
+
return /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(EmptySearchResult, { state });
|
|
5983
6258
|
case "pending":
|
|
5984
6259
|
default:
|
|
5985
6260
|
return null;
|
|
5986
6261
|
}
|
|
5987
6262
|
}
|
|
5988
6263
|
function EmptySearchResult({ state }) {
|
|
5989
|
-
return /* @__PURE__ */ (0,
|
|
6264
|
+
return /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(import_components59.Markdown, { className: "m-t-2", config: { link: { target: "_blank" } }, children: state.message });
|
|
5990
6265
|
}
|
|
5991
6266
|
function SearchResults({
|
|
5992
6267
|
state,
|
|
5993
6268
|
trackEvent
|
|
5994
6269
|
}) {
|
|
5995
|
-
return /* @__PURE__ */ (0,
|
|
6270
|
+
return /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(import_components59.List, { children: state.results.map((result) => {
|
|
5996
6271
|
const { media } = result;
|
|
5997
|
-
return /* @__PURE__ */ (0,
|
|
5998
|
-
|
|
6272
|
+
return /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
|
|
6273
|
+
import_components59.ListItem,
|
|
5999
6274
|
{
|
|
6000
6275
|
title: result.title,
|
|
6001
6276
|
subtitle: result.description,
|
|
6002
|
-
media: media ? /* @__PURE__ */ (0,
|
|
6003
|
-
control: /* @__PURE__ */ (0,
|
|
6004
|
-
|
|
6277
|
+
media: media ? /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(OptionMedia, { media, preferAvatar: false }) : void 0,
|
|
6278
|
+
control: /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
|
|
6279
|
+
import_components59.ListItem.Navigation,
|
|
6005
6280
|
{
|
|
6006
6281
|
onClick: () => {
|
|
6007
6282
|
trackEvent("Search Result Selected", __spreadValues({
|
|
@@ -6019,11 +6294,11 @@ function SearchResults({
|
|
|
6019
6294
|
var BlockSearchRendererComponent_default = BlockSearchRendererComponent;
|
|
6020
6295
|
|
|
6021
6296
|
// ../renderers/src/SearchRenderer/InlineSearchRendererComponent.tsx
|
|
6022
|
-
var
|
|
6023
|
-
var
|
|
6024
|
-
var
|
|
6025
|
-
var
|
|
6026
|
-
var
|
|
6297
|
+
var import_components60 = require("@transferwise/components");
|
|
6298
|
+
var import_icons6 = require("@transferwise/icons");
|
|
6299
|
+
var import_react25 = require("react");
|
|
6300
|
+
var import_react_intl34 = require("react-intl");
|
|
6301
|
+
var import_jsx_runtime87 = require("react/jsx-runtime");
|
|
6027
6302
|
function InlineSearchRenderer({
|
|
6028
6303
|
id,
|
|
6029
6304
|
hint,
|
|
@@ -6037,9 +6312,9 @@ function InlineSearchRenderer({
|
|
|
6037
6312
|
onChange,
|
|
6038
6313
|
trackEvent
|
|
6039
6314
|
}) {
|
|
6040
|
-
const [hasSearched, setHasSearched] = (0,
|
|
6041
|
-
const intl = (0,
|
|
6042
|
-
return /* @__PURE__ */ (0,
|
|
6315
|
+
const [hasSearched, setHasSearched] = (0, import_react25.useState)(false);
|
|
6316
|
+
const intl = (0, import_react_intl34.useIntl)();
|
|
6317
|
+
return /* @__PURE__ */ (0, import_jsx_runtime87.jsx)("div", { className: getMargin(margin), children: /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(
|
|
6043
6318
|
FieldInput_default,
|
|
6044
6319
|
{
|
|
6045
6320
|
id,
|
|
@@ -6050,8 +6325,8 @@ function InlineSearchRenderer({
|
|
|
6050
6325
|
features,
|
|
6051
6326
|
control,
|
|
6052
6327
|
tags,
|
|
6053
|
-
children: /* @__PURE__ */ (0,
|
|
6054
|
-
|
|
6328
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(
|
|
6329
|
+
import_components60.Typeahead,
|
|
6055
6330
|
{
|
|
6056
6331
|
id: "typeahead-input-id",
|
|
6057
6332
|
intl,
|
|
@@ -6059,10 +6334,10 @@ function InlineSearchRenderer({
|
|
|
6059
6334
|
size: "md",
|
|
6060
6335
|
placeholder: hint,
|
|
6061
6336
|
maxHeight: 100,
|
|
6062
|
-
footer: /* @__PURE__ */ (0,
|
|
6337
|
+
footer: /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(TypeaheadFooter, { state, isLoading }),
|
|
6063
6338
|
multiple: false,
|
|
6064
6339
|
clearable: false,
|
|
6065
|
-
addon: /* @__PURE__ */ (0,
|
|
6340
|
+
addon: /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(import_icons6.Search, { size: 24 }),
|
|
6066
6341
|
options: state.type === "results" ? state.results.map(mapResultToTypeaheadOption) : [],
|
|
6067
6342
|
minQueryLength: 1,
|
|
6068
6343
|
onChange: (values) => {
|
|
@@ -6099,34 +6374,34 @@ function mapResultToTypeaheadOption(result) {
|
|
|
6099
6374
|
};
|
|
6100
6375
|
}
|
|
6101
6376
|
function TypeaheadFooter({ state, isLoading }) {
|
|
6102
|
-
const { formatMessage } = (0,
|
|
6377
|
+
const { formatMessage } = (0, import_react_intl34.useIntl)();
|
|
6103
6378
|
if (state.type === "layout") {
|
|
6104
|
-
return /* @__PURE__ */ (0,
|
|
6379
|
+
return /* @__PURE__ */ (0, import_jsx_runtime87.jsx)("div", { className: "m-x-1 m-y-1", children: state.layout });
|
|
6105
6380
|
}
|
|
6106
6381
|
if (state.type === "noResults") {
|
|
6107
|
-
return /* @__PURE__ */ (0,
|
|
6382
|
+
return /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(import_components60.Markdown, { className: "m-t-2 m-x-2", config: { link: { target: "_blank" } }, children: state.message });
|
|
6108
6383
|
}
|
|
6109
6384
|
if (state.type === "error") {
|
|
6110
|
-
return /* @__PURE__ */ (0,
|
|
6385
|
+
return /* @__PURE__ */ (0, import_jsx_runtime87.jsx)("div", { className: "m-t-2 m-x-2", children: /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(ErrorResult, { state }) });
|
|
6111
6386
|
}
|
|
6112
6387
|
if (state.type === "pending" || isLoading) {
|
|
6113
|
-
return /* @__PURE__ */ (0,
|
|
6388
|
+
return /* @__PURE__ */ (0, import_jsx_runtime87.jsx)("p", { className: "m-t-2 m-x-2", children: formatMessage(search_messages_default.loading) });
|
|
6114
6389
|
}
|
|
6115
6390
|
return null;
|
|
6116
6391
|
}
|
|
6117
6392
|
var InlineSearchRendererComponent_default = InlineSearchRenderer;
|
|
6118
6393
|
|
|
6119
6394
|
// ../renderers/src/SearchRenderer/SearchRenderer.tsx
|
|
6120
|
-
var
|
|
6395
|
+
var import_jsx_runtime88 = require("react/jsx-runtime");
|
|
6121
6396
|
var SearchRenderer = {
|
|
6122
6397
|
canRenderType: "search",
|
|
6123
|
-
render: (props) => props.control === "inline" ? /* @__PURE__ */ (0,
|
|
6398
|
+
render: (props) => props.control === "inline" ? /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(InlineSearchRendererComponent_default, __spreadValues({}, props)) : /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(BlockSearchRendererComponent_default, __spreadValues({}, props))
|
|
6124
6399
|
};
|
|
6125
6400
|
var SearchRenderer_default = SearchRenderer;
|
|
6126
6401
|
|
|
6127
6402
|
// ../renderers/src/SectionRenderer.tsx
|
|
6128
|
-
var
|
|
6129
|
-
var
|
|
6403
|
+
var import_components61 = require("@transferwise/components");
|
|
6404
|
+
var import_classnames31 = __toESM(require_classnames());
|
|
6130
6405
|
|
|
6131
6406
|
// ../renderers/src/utils/getHeaderAction.tsx
|
|
6132
6407
|
var getHeaderAction2 = (callToAction) => {
|
|
@@ -6150,16 +6425,16 @@ var getHeaderAction2 = (callToAction) => {
|
|
|
6150
6425
|
};
|
|
6151
6426
|
|
|
6152
6427
|
// ../renderers/src/SectionRenderer.tsx
|
|
6153
|
-
var
|
|
6428
|
+
var import_jsx_runtime89 = require("react/jsx-runtime");
|
|
6154
6429
|
var SectionRenderer = {
|
|
6155
6430
|
canRenderType: "section",
|
|
6156
6431
|
render: ({ children, callToAction, margin, title, control, tags }) => {
|
|
6157
|
-
return /* @__PURE__ */ (0,
|
|
6432
|
+
return /* @__PURE__ */ (0, import_jsx_runtime89.jsxs)(
|
|
6158
6433
|
"section",
|
|
6159
6434
|
{
|
|
6160
|
-
className: (0,
|
|
6435
|
+
className: (0, import_classnames31.default)(getMargin(margin), controlAndTagsToCSSClass({ control, tags })),
|
|
6161
6436
|
children: [
|
|
6162
|
-
(title || callToAction) && /* @__PURE__ */ (0,
|
|
6437
|
+
(title || callToAction) && /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(import_components61.Header, { title: title != null ? title : "", action: getHeaderAction2(callToAction) }),
|
|
6163
6438
|
children
|
|
6164
6439
|
]
|
|
6165
6440
|
}
|
|
@@ -6169,8 +6444,8 @@ var SectionRenderer = {
|
|
|
6169
6444
|
var SectionRenderer_default = SectionRenderer;
|
|
6170
6445
|
|
|
6171
6446
|
// ../renderers/src/SelectInputRenderer/RadioInputRendererComponent.tsx
|
|
6172
|
-
var
|
|
6173
|
-
var
|
|
6447
|
+
var import_components62 = require("@transferwise/components");
|
|
6448
|
+
var import_jsx_runtime90 = require("react/jsx-runtime");
|
|
6174
6449
|
function RadioInputRendererComponent(props) {
|
|
6175
6450
|
const {
|
|
6176
6451
|
id,
|
|
@@ -6187,8 +6462,8 @@ function RadioInputRendererComponent(props) {
|
|
|
6187
6462
|
tags,
|
|
6188
6463
|
onSelect
|
|
6189
6464
|
} = props;
|
|
6190
|
-
return /* @__PURE__ */ (0,
|
|
6191
|
-
/* @__PURE__ */ (0,
|
|
6465
|
+
return /* @__PURE__ */ (0, import_jsx_runtime90.jsxs)(import_jsx_runtime90.Fragment, { children: [
|
|
6466
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
|
|
6192
6467
|
FieldInput_default,
|
|
6193
6468
|
{
|
|
6194
6469
|
id,
|
|
@@ -6199,8 +6474,8 @@ function RadioInputRendererComponent(props) {
|
|
|
6199
6474
|
features,
|
|
6200
6475
|
control,
|
|
6201
6476
|
tags,
|
|
6202
|
-
children: /* @__PURE__ */ (0,
|
|
6203
|
-
|
|
6477
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime90.jsx)("span", { children: /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
|
|
6478
|
+
import_components62.RadioGroup,
|
|
6204
6479
|
{
|
|
6205
6480
|
name: id,
|
|
6206
6481
|
radios: options.map((option, index) => ({
|
|
@@ -6208,7 +6483,7 @@ function RadioInputRendererComponent(props) {
|
|
|
6208
6483
|
value: index,
|
|
6209
6484
|
secondary: option.description,
|
|
6210
6485
|
disabled: option.disabled || disabled,
|
|
6211
|
-
avatar: /* @__PURE__ */ (0,
|
|
6486
|
+
avatar: /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(OptionMedia, { media: option.media, preferAvatar: false })
|
|
6212
6487
|
})),
|
|
6213
6488
|
selectedValue: selectedIndex != null ? selectedIndex : void 0,
|
|
6214
6489
|
onChange: onSelect
|
|
@@ -6222,9 +6497,9 @@ function RadioInputRendererComponent(props) {
|
|
|
6222
6497
|
}
|
|
6223
6498
|
|
|
6224
6499
|
// ../renderers/src/SelectInputRenderer/TabInputRendererComponent.tsx
|
|
6225
|
-
var
|
|
6226
|
-
var
|
|
6227
|
-
var
|
|
6500
|
+
var import_components63 = require("@transferwise/components");
|
|
6501
|
+
var import_react26 = require("react");
|
|
6502
|
+
var import_jsx_runtime91 = require("react/jsx-runtime");
|
|
6228
6503
|
function TabInputRendererComponent(props) {
|
|
6229
6504
|
const {
|
|
6230
6505
|
id,
|
|
@@ -6241,13 +6516,13 @@ function TabInputRendererComponent(props) {
|
|
|
6241
6516
|
tags,
|
|
6242
6517
|
onSelect
|
|
6243
6518
|
} = props;
|
|
6244
|
-
(0,
|
|
6519
|
+
(0, import_react26.useEffect)(() => {
|
|
6245
6520
|
if (!isValidIndex2(selectedIndex, options.length)) {
|
|
6246
6521
|
onSelect(0);
|
|
6247
6522
|
}
|
|
6248
6523
|
}, [selectedIndex, onSelect, options.length]);
|
|
6249
|
-
return /* @__PURE__ */ (0,
|
|
6250
|
-
/* @__PURE__ */ (0,
|
|
6524
|
+
return /* @__PURE__ */ (0, import_jsx_runtime91.jsxs)(import_jsx_runtime91.Fragment, { children: [
|
|
6525
|
+
/* @__PURE__ */ (0, import_jsx_runtime91.jsx)(
|
|
6251
6526
|
FieldInput_default,
|
|
6252
6527
|
{
|
|
6253
6528
|
id,
|
|
@@ -6258,8 +6533,8 @@ function TabInputRendererComponent(props) {
|
|
|
6258
6533
|
features,
|
|
6259
6534
|
control,
|
|
6260
6535
|
tags,
|
|
6261
|
-
children: /* @__PURE__ */ (0,
|
|
6262
|
-
|
|
6536
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(
|
|
6537
|
+
import_components63.Tabs,
|
|
6263
6538
|
{
|
|
6264
6539
|
name: id,
|
|
6265
6540
|
selected: selectedIndex != null ? selectedIndex : 0,
|
|
@@ -6267,7 +6542,7 @@ function TabInputRendererComponent(props) {
|
|
|
6267
6542
|
title: option.title,
|
|
6268
6543
|
// if we pass null, we get some props-types console errors
|
|
6269
6544
|
// eslint-disable-next-line react/jsx-no-useless-fragment
|
|
6270
|
-
content: /* @__PURE__ */ (0,
|
|
6545
|
+
content: /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(import_jsx_runtime91.Fragment, {}),
|
|
6271
6546
|
disabled: option.disabled || disabled
|
|
6272
6547
|
})),
|
|
6273
6548
|
onTabSelect: onSelect
|
|
@@ -6281,8 +6556,8 @@ function TabInputRendererComponent(props) {
|
|
|
6281
6556
|
var isValidIndex2 = (index, options) => index !== null && index >= 0 && index < options;
|
|
6282
6557
|
|
|
6283
6558
|
// ../renderers/src/SelectInputRenderer/SelectInputRendererComponent.tsx
|
|
6284
|
-
var
|
|
6285
|
-
var
|
|
6559
|
+
var import_components64 = require("@transferwise/components");
|
|
6560
|
+
var import_jsx_runtime92 = require("react/jsx-runtime");
|
|
6286
6561
|
function SelectInputRendererComponent(props) {
|
|
6287
6562
|
const {
|
|
6288
6563
|
id,
|
|
@@ -6325,13 +6600,13 @@ function SelectInputRendererComponent(props) {
|
|
|
6325
6600
|
} : {
|
|
6326
6601
|
title: option.title,
|
|
6327
6602
|
description: option.description,
|
|
6328
|
-
icon: /* @__PURE__ */ (0,
|
|
6603
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(OptionMedia, { media: option.media, preferAvatar: false })
|
|
6329
6604
|
};
|
|
6330
|
-
return /* @__PURE__ */ (0,
|
|
6605
|
+
return /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(import_components64.SelectInputOptionContent, __spreadValues({}, contentProps));
|
|
6331
6606
|
};
|
|
6332
6607
|
const extraProps = { autoComplete };
|
|
6333
|
-
return /* @__PURE__ */ (0,
|
|
6334
|
-
/* @__PURE__ */ (0,
|
|
6608
|
+
return /* @__PURE__ */ (0, import_jsx_runtime92.jsxs)(import_jsx_runtime92.Fragment, { children: [
|
|
6609
|
+
/* @__PURE__ */ (0, import_jsx_runtime92.jsx)(
|
|
6335
6610
|
FieldInput_default,
|
|
6336
6611
|
{
|
|
6337
6612
|
id,
|
|
@@ -6342,8 +6617,8 @@ function SelectInputRendererComponent(props) {
|
|
|
6342
6617
|
features,
|
|
6343
6618
|
control,
|
|
6344
6619
|
tags,
|
|
6345
|
-
children: /* @__PURE__ */ (0,
|
|
6346
|
-
|
|
6620
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(
|
|
6621
|
+
import_components64.SelectInput,
|
|
6347
6622
|
__spreadValues({
|
|
6348
6623
|
name: id,
|
|
6349
6624
|
placeholder,
|
|
@@ -6363,9 +6638,9 @@ function SelectInputRendererComponent(props) {
|
|
|
6363
6638
|
}
|
|
6364
6639
|
|
|
6365
6640
|
// ../renderers/src/SelectInputRenderer/SegmentedInputRendererComponent.tsx
|
|
6366
|
-
var
|
|
6367
|
-
var
|
|
6368
|
-
var
|
|
6641
|
+
var import_react27 = require("react");
|
|
6642
|
+
var import_components65 = require("@transferwise/components");
|
|
6643
|
+
var import_jsx_runtime93 = require("react/jsx-runtime");
|
|
6369
6644
|
function SegmentedInputRendererComponent(props) {
|
|
6370
6645
|
const {
|
|
6371
6646
|
id,
|
|
@@ -6381,13 +6656,13 @@ function SegmentedInputRendererComponent(props) {
|
|
|
6381
6656
|
tags,
|
|
6382
6657
|
onSelect
|
|
6383
6658
|
} = props;
|
|
6384
|
-
(0,
|
|
6659
|
+
(0, import_react27.useEffect)(() => {
|
|
6385
6660
|
if (!isValidIndex3(selectedIndex, options.length)) {
|
|
6386
6661
|
onSelect(0);
|
|
6387
6662
|
}
|
|
6388
6663
|
}, [selectedIndex, onSelect, options.length]);
|
|
6389
|
-
return /* @__PURE__ */ (0,
|
|
6390
|
-
/* @__PURE__ */ (0,
|
|
6664
|
+
return /* @__PURE__ */ (0, import_jsx_runtime93.jsxs)(import_jsx_runtime93.Fragment, { children: [
|
|
6665
|
+
/* @__PURE__ */ (0, import_jsx_runtime93.jsx)(
|
|
6391
6666
|
FieldInput_default,
|
|
6392
6667
|
{
|
|
6393
6668
|
id,
|
|
@@ -6398,8 +6673,8 @@ function SegmentedInputRendererComponent(props) {
|
|
|
6398
6673
|
features,
|
|
6399
6674
|
control,
|
|
6400
6675
|
tags,
|
|
6401
|
-
children: /* @__PURE__ */ (0,
|
|
6402
|
-
|
|
6676
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(
|
|
6677
|
+
import_components65.SegmentedControl,
|
|
6403
6678
|
{
|
|
6404
6679
|
name: `${id}-segmented-control`,
|
|
6405
6680
|
value: String(selectedIndex),
|
|
@@ -6415,14 +6690,14 @@ function SegmentedInputRendererComponent(props) {
|
|
|
6415
6690
|
)
|
|
6416
6691
|
}
|
|
6417
6692
|
),
|
|
6418
|
-
/* @__PURE__ */ (0,
|
|
6693
|
+
/* @__PURE__ */ (0, import_jsx_runtime93.jsx)("div", { id: `${id}-children`, children })
|
|
6419
6694
|
] });
|
|
6420
6695
|
}
|
|
6421
6696
|
var isValidIndex3 = (index, options) => index !== null && index >= 0 && index < options;
|
|
6422
6697
|
|
|
6423
6698
|
// ../renderers/src/SelectInputRenderer/RadioItemRendererComponent.tsx
|
|
6424
|
-
var
|
|
6425
|
-
var
|
|
6699
|
+
var import_components66 = require("@transferwise/components");
|
|
6700
|
+
var import_jsx_runtime94 = require("react/jsx-runtime");
|
|
6426
6701
|
function RadioItemRendererComponent(props) {
|
|
6427
6702
|
const {
|
|
6428
6703
|
id,
|
|
@@ -6438,23 +6713,23 @@ function RadioItemRendererComponent(props) {
|
|
|
6438
6713
|
onSelect
|
|
6439
6714
|
} = props;
|
|
6440
6715
|
const { ref } = useScrollToError(validationState, features);
|
|
6441
|
-
return /* @__PURE__ */ (0,
|
|
6442
|
-
rootTitle && /* @__PURE__ */ (0,
|
|
6443
|
-
|
|
6716
|
+
return /* @__PURE__ */ (0, import_jsx_runtime94.jsxs)("div", { ref, className: controlAndTagsToCSSClass(props), children: [
|
|
6717
|
+
rootTitle && /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(
|
|
6718
|
+
import_components66.Header,
|
|
6444
6719
|
{
|
|
6445
6720
|
as: "h2",
|
|
6446
|
-
title: help ? /* @__PURE__ */ (0,
|
|
6721
|
+
title: help ? /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(LabelContentWithHelp, { text: rootTitle, help }) : rootTitle
|
|
6447
6722
|
}
|
|
6448
6723
|
),
|
|
6449
|
-
rootDescription && /* @__PURE__ */ (0,
|
|
6450
|
-
/* @__PURE__ */ (0,
|
|
6451
|
-
({ title, description, additionalText, inlineAlert, disabled, media, supportingValues }, index) => /* @__PURE__ */ (0,
|
|
6452
|
-
|
|
6724
|
+
rootDescription && /* @__PURE__ */ (0, import_jsx_runtime94.jsx)("p", { children: rootDescription }),
|
|
6725
|
+
/* @__PURE__ */ (0, import_jsx_runtime94.jsx)(import_components66.List, { children: options.map(
|
|
6726
|
+
({ title, description, additionalText, inlineAlert, disabled, media, supportingValues }, index) => /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(
|
|
6727
|
+
import_components66.ListItem,
|
|
6453
6728
|
__spreadValues({
|
|
6454
6729
|
title,
|
|
6455
6730
|
subtitle: description,
|
|
6456
|
-
control: /* @__PURE__ */ (0,
|
|
6457
|
-
|
|
6731
|
+
control: /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(
|
|
6732
|
+
import_components66.ListItem.Radio,
|
|
6458
6733
|
{
|
|
6459
6734
|
name: title,
|
|
6460
6735
|
checked: selectedIndex === index,
|
|
@@ -6469,51 +6744,51 @@ function RadioItemRendererComponent(props) {
|
|
|
6469
6744
|
title
|
|
6470
6745
|
)
|
|
6471
6746
|
) }, `${id}-${selectedIndex}`),
|
|
6472
|
-
(validationState == null ? void 0 : validationState.status) === "invalid" && /* @__PURE__ */ (0,
|
|
6747
|
+
(validationState == null ? void 0 : validationState.status) === "invalid" && /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(import_components66.InlineAlert, { type: "negative", children: validationState.message }),
|
|
6473
6748
|
children
|
|
6474
6749
|
] });
|
|
6475
6750
|
}
|
|
6476
6751
|
|
|
6477
6752
|
// ../renderers/src/SelectInputRenderer/SelectInputRenderer.tsx
|
|
6478
|
-
var
|
|
6753
|
+
var import_jsx_runtime95 = require("react/jsx-runtime");
|
|
6479
6754
|
var SelectInputRenderer = {
|
|
6480
6755
|
canRenderType: "input-select",
|
|
6481
6756
|
render: (props) => {
|
|
6482
6757
|
switch (props.control) {
|
|
6483
6758
|
case "radio":
|
|
6484
|
-
return /* @__PURE__ */ (0,
|
|
6759
|
+
return /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(RadioInputRendererComponent, __spreadValues({}, props));
|
|
6485
6760
|
case "radio-item":
|
|
6486
|
-
return /* @__PURE__ */ (0,
|
|
6761
|
+
return /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(RadioItemRendererComponent, __spreadValues({}, props));
|
|
6487
6762
|
case "tab":
|
|
6488
|
-
return props.options.length > 3 ? /* @__PURE__ */ (0,
|
|
6763
|
+
return props.options.length > 3 ? /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(SelectInputRendererComponent, __spreadValues({}, props)) : /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(TabInputRendererComponent, __spreadValues({}, props));
|
|
6489
6764
|
case "segmented":
|
|
6490
|
-
return props.options.length > 3 ? /* @__PURE__ */ (0,
|
|
6765
|
+
return props.options.length > 3 ? /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(SelectInputRendererComponent, __spreadValues({}, props)) : /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(SegmentedInputRendererComponent, __spreadValues({}, props));
|
|
6491
6766
|
case "select":
|
|
6492
6767
|
default:
|
|
6493
|
-
return /* @__PURE__ */ (0,
|
|
6768
|
+
return /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(SelectInputRendererComponent, __spreadValues({}, props));
|
|
6494
6769
|
}
|
|
6495
6770
|
}
|
|
6496
6771
|
};
|
|
6497
6772
|
var SelectInputRenderer_default = SelectInputRenderer;
|
|
6498
6773
|
|
|
6499
6774
|
// ../renderers/src/StatusListRenderer.tsx
|
|
6500
|
-
var
|
|
6501
|
-
var
|
|
6502
|
-
var
|
|
6775
|
+
var import_components67 = require("@transferwise/components");
|
|
6776
|
+
var import_classnames32 = __toESM(require_classnames());
|
|
6777
|
+
var import_jsx_runtime96 = require("react/jsx-runtime");
|
|
6503
6778
|
var StatusListRenderer = {
|
|
6504
6779
|
canRenderType: "status-list",
|
|
6505
|
-
render: ({ margin, items, title, control, tags }) => /* @__PURE__ */ (0,
|
|
6506
|
-
title ? /* @__PURE__ */ (0,
|
|
6780
|
+
render: ({ margin, items, title, control, tags }) => /* @__PURE__ */ (0, import_jsx_runtime96.jsxs)("div", { className: (0, import_classnames32.default)(getMargin(margin), controlAndTagsToCSSClass({ control, tags })), children: [
|
|
6781
|
+
title ? /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(import_components67.Header, { title }) : null,
|
|
6507
6782
|
items.map((item) => {
|
|
6508
6783
|
const { callToAction, description, title: itemTitle } = item;
|
|
6509
|
-
return /* @__PURE__ */ (0,
|
|
6510
|
-
|
|
6784
|
+
return /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(
|
|
6785
|
+
import_components67.ListItem,
|
|
6511
6786
|
{
|
|
6512
6787
|
title: itemTitle,
|
|
6513
6788
|
subtitle: description,
|
|
6514
|
-
media: /* @__PURE__ */ (0,
|
|
6515
|
-
additionalInfo: callToAction ? /* @__PURE__ */ (0,
|
|
6516
|
-
|
|
6789
|
+
media: /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(StatusListItemMedia, __spreadValues({}, item)),
|
|
6790
|
+
additionalInfo: callToAction ? /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(
|
|
6791
|
+
import_components67.ListItem.AdditionalInfo,
|
|
6517
6792
|
{
|
|
6518
6793
|
action: __spreadValues({
|
|
6519
6794
|
label: callToAction.title
|
|
@@ -6531,10 +6806,10 @@ var StatusListItemMedia = ({ icon, status }) => {
|
|
|
6531
6806
|
return void 0;
|
|
6532
6807
|
}
|
|
6533
6808
|
if ("name" in icon) {
|
|
6534
|
-
return /* @__PURE__ */ (0,
|
|
6809
|
+
return /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(import_components67.AvatarView, { badge: { status: mapStatus(status) }, children: /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(DynamicIcon_default, { name: icon.name }) });
|
|
6535
6810
|
}
|
|
6536
6811
|
if ("text" in icon) {
|
|
6537
|
-
return /* @__PURE__ */ (0,
|
|
6812
|
+
return /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(import_components67.AvatarView, { badge: { status: mapStatus(status) }, children: icon.text });
|
|
6538
6813
|
}
|
|
6539
6814
|
return void 0;
|
|
6540
6815
|
};
|
|
@@ -6551,16 +6826,16 @@ var mapStatus = (status) => {
|
|
|
6551
6826
|
var StatusListRenderer_default = StatusListRenderer;
|
|
6552
6827
|
|
|
6553
6828
|
// ../renderers/src/step/SplashCelebrationStepRenderer.tsx
|
|
6554
|
-
var
|
|
6829
|
+
var import_classnames33 = __toESM(require_classnames());
|
|
6555
6830
|
|
|
6556
6831
|
// ../renderers/src/utils/useCustomTheme.ts
|
|
6557
6832
|
var import_components_theming = require("@wise/components-theming");
|
|
6558
|
-
var
|
|
6833
|
+
var import_react28 = require("react");
|
|
6559
6834
|
var ThemeRequiredEventName = "Theme Required";
|
|
6560
6835
|
var useCustomTheme = (theme, trackEvent) => {
|
|
6561
6836
|
const theming = (0, import_components_theming.useTheme)();
|
|
6562
|
-
const previousTheme = (0,
|
|
6563
|
-
(0,
|
|
6837
|
+
const previousTheme = (0, import_react28.useMemo)(() => theming.theme, []);
|
|
6838
|
+
(0, import_react28.useEffect)(() => {
|
|
6564
6839
|
theming.setTheme(theme);
|
|
6565
6840
|
trackEvent(ThemeRequiredEventName, { theme });
|
|
6566
6841
|
return theme !== previousTheme ? () => {
|
|
@@ -6572,13 +6847,13 @@ var useCustomTheme = (theme, trackEvent) => {
|
|
|
6572
6847
|
};
|
|
6573
6848
|
|
|
6574
6849
|
// ../renderers/src/step/StepHeader.tsx
|
|
6575
|
-
var
|
|
6576
|
-
var
|
|
6850
|
+
var import_components68 = require("@transferwise/components");
|
|
6851
|
+
var import_jsx_runtime97 = require("react/jsx-runtime");
|
|
6577
6852
|
var StepHeader = ({ title, description, tags }) => {
|
|
6578
6853
|
const { titleType, alignmentClassName } = getHeaderStyle(tags);
|
|
6579
|
-
return /* @__PURE__ */ (0,
|
|
6580
|
-
title ? /* @__PURE__ */ (0,
|
|
6581
|
-
description ? /* @__PURE__ */ (0,
|
|
6854
|
+
return /* @__PURE__ */ (0, import_jsx_runtime97.jsxs)(import_jsx_runtime97.Fragment, { children: [
|
|
6855
|
+
title ? /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(import_components68.Title, { as: "h1", type: titleType, className: `${alignmentClassName} m-b-2`, children: title }) : void 0,
|
|
6856
|
+
description ? /* @__PURE__ */ (0, import_jsx_runtime97.jsx)("p", { className: `${alignmentClassName} np-text-body-large`, children: description }) : void 0
|
|
6582
6857
|
] });
|
|
6583
6858
|
};
|
|
6584
6859
|
var getHeaderStyle = (tags) => {
|
|
@@ -6589,13 +6864,13 @@ var getHeaderStyle = (tags) => {
|
|
|
6589
6864
|
};
|
|
6590
6865
|
|
|
6591
6866
|
// ../renderers/src/step/topbar/BackButton.tsx
|
|
6592
|
-
var
|
|
6593
|
-
var
|
|
6594
|
-
var
|
|
6867
|
+
var import_components69 = require("@transferwise/components");
|
|
6868
|
+
var import_icons7 = require("@transferwise/icons");
|
|
6869
|
+
var import_react_intl36 = require("react-intl");
|
|
6595
6870
|
|
|
6596
6871
|
// ../renderers/src/messages/back.messages.ts
|
|
6597
|
-
var
|
|
6598
|
-
var back_messages_default = (0,
|
|
6872
|
+
var import_react_intl35 = require("react-intl");
|
|
6873
|
+
var back_messages_default = (0, import_react_intl35.defineMessages)({
|
|
6599
6874
|
back: {
|
|
6600
6875
|
id: "df.wise.back.label",
|
|
6601
6876
|
defaultMessage: "Back",
|
|
@@ -6604,31 +6879,31 @@ var back_messages_default = (0, import_react_intl33.defineMessages)({
|
|
|
6604
6879
|
});
|
|
6605
6880
|
|
|
6606
6881
|
// ../renderers/src/step/topbar/BackButton.tsx
|
|
6607
|
-
var
|
|
6882
|
+
var import_jsx_runtime98 = require("react/jsx-runtime");
|
|
6608
6883
|
function BackButton({ title, onClick }) {
|
|
6609
|
-
const { formatMessage } = (0,
|
|
6610
|
-
return /* @__PURE__ */ (0,
|
|
6611
|
-
/* @__PURE__ */ (0,
|
|
6612
|
-
/* @__PURE__ */ (0,
|
|
6884
|
+
const { formatMessage } = (0, import_react_intl36.useIntl)();
|
|
6885
|
+
return /* @__PURE__ */ (0, import_jsx_runtime98.jsxs)(import_components69.IconButton, { className: "df-back-button", priority: "tertiary", onClick, children: [
|
|
6886
|
+
/* @__PURE__ */ (0, import_jsx_runtime98.jsx)("span", { className: "sr-only", children: title != null ? title : formatMessage(back_messages_default.back) }),
|
|
6887
|
+
/* @__PURE__ */ (0, import_jsx_runtime98.jsx)(import_icons7.ArrowLeft, {})
|
|
6613
6888
|
] });
|
|
6614
6889
|
}
|
|
6615
6890
|
|
|
6616
6891
|
// ../renderers/src/step/topbar/Toolbar.tsx
|
|
6617
|
-
var
|
|
6618
|
-
var
|
|
6892
|
+
var import_components70 = require("@transferwise/components");
|
|
6893
|
+
var import_jsx_runtime99 = require("react/jsx-runtime");
|
|
6619
6894
|
var Toolbar = ({ items }) => {
|
|
6620
|
-
return (items == null ? void 0 : items.length) > 0 ? /* @__PURE__ */ (0,
|
|
6895
|
+
return (items == null ? void 0 : items.length) > 0 ? /* @__PURE__ */ (0, import_jsx_runtime99.jsx)("div", { className: "df-toolbar", children: items.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime99.jsx)(ToolbarButton, __spreadValues({}, item), `${item.type}-${index}-${item.title}`)) }) : null;
|
|
6621
6896
|
};
|
|
6622
6897
|
function ToolbarButton(props) {
|
|
6623
|
-
return prefersMedia(props.control) ? /* @__PURE__ */ (0,
|
|
6898
|
+
return prefersMedia(props.control) ? /* @__PURE__ */ (0, import_jsx_runtime99.jsx)(MediaToolbarButton, __spreadValues({}, props)) : /* @__PURE__ */ (0, import_jsx_runtime99.jsx)(TextToolbarButton, __spreadValues({}, props));
|
|
6624
6899
|
}
|
|
6625
6900
|
function MediaToolbarButton(props) {
|
|
6626
6901
|
var _a;
|
|
6627
6902
|
const { context, control, media, accessibilityDescription, disabled, onClick } = props;
|
|
6628
6903
|
const priority = getIconButtonPriority(control);
|
|
6629
6904
|
const type = getSentiment2(context);
|
|
6630
|
-
return /* @__PURE__ */ (0,
|
|
6631
|
-
|
|
6905
|
+
return /* @__PURE__ */ (0, import_jsx_runtime99.jsxs)(
|
|
6906
|
+
import_components70.IconButton,
|
|
6632
6907
|
{
|
|
6633
6908
|
className: "df-toolbar-button",
|
|
6634
6909
|
disabled,
|
|
@@ -6637,7 +6912,7 @@ function MediaToolbarButton(props) {
|
|
|
6637
6912
|
type,
|
|
6638
6913
|
onClick,
|
|
6639
6914
|
children: [
|
|
6640
|
-
accessibilityDescription ? /* @__PURE__ */ (0,
|
|
6915
|
+
accessibilityDescription ? /* @__PURE__ */ (0, import_jsx_runtime99.jsx)("span", { className: "sr-only", children: accessibilityDescription }) : null,
|
|
6641
6916
|
media ? (_a = getAddonStartMedia(media)) == null ? void 0 : _a.value : null
|
|
6642
6917
|
]
|
|
6643
6918
|
}
|
|
@@ -6648,8 +6923,8 @@ function TextToolbarButton(props) {
|
|
|
6648
6923
|
const addonStart = media ? getAddonStartMedia(media) : void 0;
|
|
6649
6924
|
const priority = getPriority2(control);
|
|
6650
6925
|
const sentiment = getSentiment2(context);
|
|
6651
|
-
return /* @__PURE__ */ (0,
|
|
6652
|
-
|
|
6926
|
+
return /* @__PURE__ */ (0, import_jsx_runtime99.jsx)(
|
|
6927
|
+
import_components70.Button,
|
|
6653
6928
|
{
|
|
6654
6929
|
v2: true,
|
|
6655
6930
|
size: "sm",
|
|
@@ -6678,18 +6953,18 @@ var getIconButtonPriority = (control) => {
|
|
|
6678
6953
|
};
|
|
6679
6954
|
|
|
6680
6955
|
// ../renderers/src/step/topbar/TopBar.tsx
|
|
6681
|
-
var
|
|
6956
|
+
var import_jsx_runtime100 = require("react/jsx-runtime");
|
|
6682
6957
|
function TopBar({ back, toolbar, tags }) {
|
|
6683
6958
|
const isBackAllowed = !(tags == null ? void 0 : tags.includes("non-dismissible"));
|
|
6684
6959
|
const backCTA = isBackAllowed ? back : void 0;
|
|
6685
|
-
return backCTA || toolbar ? /* @__PURE__ */ (0,
|
|
6686
|
-
backCTA ? /* @__PURE__ */ (0,
|
|
6687
|
-
toolbar ? /* @__PURE__ */ (0,
|
|
6960
|
+
return backCTA || toolbar ? /* @__PURE__ */ (0, import_jsx_runtime100.jsxs)("div", { className: "d-flex m-b-2", children: [
|
|
6961
|
+
backCTA ? /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(BackButton, __spreadValues({}, backCTA)) : null,
|
|
6962
|
+
toolbar ? /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(Toolbar, __spreadValues({}, toolbar)) : null
|
|
6688
6963
|
] }) : null;
|
|
6689
6964
|
}
|
|
6690
6965
|
|
|
6691
6966
|
// ../renderers/src/step/SplashCelebrationStepRenderer.tsx
|
|
6692
|
-
var
|
|
6967
|
+
var import_jsx_runtime101 = require("react/jsx-runtime");
|
|
6693
6968
|
var SplashCelebrationStepRenderer = {
|
|
6694
6969
|
canRenderType: "step",
|
|
6695
6970
|
canRender: ({ control }) => control === "splash-celebration",
|
|
@@ -6698,23 +6973,23 @@ var SplashCelebrationStepRenderer = {
|
|
|
6698
6973
|
function SplashCelebrationStepRendererComponent(props) {
|
|
6699
6974
|
const { back, title, description, toolbar, children, footer, control, tags, trackEvent } = props;
|
|
6700
6975
|
useCustomTheme("forest-green", trackEvent);
|
|
6701
|
-
return /* @__PURE__ */ (0,
|
|
6976
|
+
return /* @__PURE__ */ (0, import_jsx_runtime101.jsxs)(
|
|
6702
6977
|
"div",
|
|
6703
6978
|
{
|
|
6704
|
-
className: (0,
|
|
6979
|
+
className: (0, import_classnames33.default)("splash-screen", "m-t-5", controlAndTagsToCSSClass({ control, tags })),
|
|
6705
6980
|
children: [
|
|
6706
|
-
/* @__PURE__ */ (0,
|
|
6707
|
-
title || description ? /* @__PURE__ */ (0,
|
|
6981
|
+
/* @__PURE__ */ (0, import_jsx_runtime101.jsx)(TopBar, { back, toolbar, tags }),
|
|
6982
|
+
title || description ? /* @__PURE__ */ (0, import_jsx_runtime101.jsx)("div", { className: "m-b-4", children: /* @__PURE__ */ (0, import_jsx_runtime101.jsx)(StepHeader, { title, description, tags }) }) : void 0,
|
|
6708
6983
|
children,
|
|
6709
|
-
/* @__PURE__ */ (0,
|
|
6984
|
+
/* @__PURE__ */ (0, import_jsx_runtime101.jsx)(StepFooter, { footer, tags })
|
|
6710
6985
|
]
|
|
6711
6986
|
}
|
|
6712
6987
|
);
|
|
6713
6988
|
}
|
|
6714
6989
|
|
|
6715
6990
|
// ../renderers/src/step/SplashStepRenderer.tsx
|
|
6716
|
-
var
|
|
6717
|
-
var
|
|
6991
|
+
var import_classnames34 = __toESM(require_classnames());
|
|
6992
|
+
var import_jsx_runtime102 = require("react/jsx-runtime");
|
|
6718
6993
|
var SplashStepRenderer = {
|
|
6719
6994
|
canRenderType: "step",
|
|
6720
6995
|
canRender: ({ control }) => control === "splash",
|
|
@@ -6722,70 +6997,70 @@ var SplashStepRenderer = {
|
|
|
6722
6997
|
};
|
|
6723
6998
|
function SplashStepRendererComponent(props) {
|
|
6724
6999
|
const { back, title, description, toolbar, children, footer, control, tags } = props;
|
|
6725
|
-
return /* @__PURE__ */ (0,
|
|
7000
|
+
return /* @__PURE__ */ (0, import_jsx_runtime102.jsxs)(
|
|
6726
7001
|
"div",
|
|
6727
7002
|
{
|
|
6728
|
-
className: (0,
|
|
7003
|
+
className: (0, import_classnames34.default)("splash-screen", "m-t-5", controlAndTagsToCSSClass({ control, tags })),
|
|
6729
7004
|
children: [
|
|
6730
|
-
/* @__PURE__ */ (0,
|
|
6731
|
-
title || description ? /* @__PURE__ */ (0,
|
|
7005
|
+
/* @__PURE__ */ (0, import_jsx_runtime102.jsx)(TopBar, { back, toolbar, tags }),
|
|
7006
|
+
title || description ? /* @__PURE__ */ (0, import_jsx_runtime102.jsx)("div", { className: "m-b-4", children: /* @__PURE__ */ (0, import_jsx_runtime102.jsx)(StepHeader, { title, description, tags }) }) : void 0,
|
|
6732
7007
|
children,
|
|
6733
|
-
/* @__PURE__ */ (0,
|
|
7008
|
+
/* @__PURE__ */ (0, import_jsx_runtime102.jsx)(StepFooter, { footer, tags })
|
|
6734
7009
|
]
|
|
6735
7010
|
}
|
|
6736
7011
|
);
|
|
6737
7012
|
}
|
|
6738
7013
|
|
|
6739
7014
|
// ../renderers/src/step/StepRenderer.tsx
|
|
6740
|
-
var
|
|
6741
|
-
var
|
|
7015
|
+
var import_components71 = require("@transferwise/components");
|
|
7016
|
+
var import_jsx_runtime103 = require("react/jsx-runtime");
|
|
6742
7017
|
var StepRenderer = {
|
|
6743
7018
|
canRenderType: "step",
|
|
6744
7019
|
render: StepRendererComponent
|
|
6745
7020
|
};
|
|
6746
7021
|
function StepRendererComponent(props) {
|
|
6747
7022
|
const { back, description, error, title, children, toolbar, footer, control, tags } = props;
|
|
6748
|
-
return /* @__PURE__ */ (0,
|
|
6749
|
-
/* @__PURE__ */ (0,
|
|
6750
|
-
title || description ? /* @__PURE__ */ (0,
|
|
6751
|
-
error ? /* @__PURE__ */ (0,
|
|
7023
|
+
return /* @__PURE__ */ (0, import_jsx_runtime103.jsxs)("div", { className: controlAndTagsToCSSClass({ control, tags }), children: [
|
|
7024
|
+
/* @__PURE__ */ (0, import_jsx_runtime103.jsx)(TopBar, { back, toolbar, tags }),
|
|
7025
|
+
title || description ? /* @__PURE__ */ (0, import_jsx_runtime103.jsx)("div", { className: "m-b-4", children: /* @__PURE__ */ (0, import_jsx_runtime103.jsx)(StepHeader, { title, description, tags }) }) : void 0,
|
|
7026
|
+
error ? /* @__PURE__ */ (0, import_jsx_runtime103.jsx)(import_components71.Alert, { type: "negative", className: "m-b-2", message: error }) : null,
|
|
6752
7027
|
children,
|
|
6753
|
-
/* @__PURE__ */ (0,
|
|
7028
|
+
/* @__PURE__ */ (0, import_jsx_runtime103.jsx)(StepFooter, { footer, tags })
|
|
6754
7029
|
] });
|
|
6755
7030
|
}
|
|
6756
7031
|
|
|
6757
7032
|
// ../renderers/src/TabsRenderer.tsx
|
|
6758
|
-
var
|
|
6759
|
-
var
|
|
6760
|
-
var
|
|
6761
|
-
var
|
|
7033
|
+
var import_components72 = require("@transferwise/components");
|
|
7034
|
+
var import_classnames35 = __toESM(require_classnames());
|
|
7035
|
+
var import_react29 = require("react");
|
|
7036
|
+
var import_jsx_runtime104 = require("react/jsx-runtime");
|
|
6762
7037
|
var TabsRenderer = {
|
|
6763
7038
|
canRenderType: "tabs",
|
|
6764
7039
|
render: (props) => {
|
|
6765
7040
|
switch (props.control) {
|
|
6766
7041
|
case "segmented":
|
|
6767
7042
|
if (props.tabs.length > 3) {
|
|
6768
|
-
return /* @__PURE__ */ (0,
|
|
7043
|
+
return /* @__PURE__ */ (0, import_jsx_runtime104.jsx)(TabsRendererComponent, __spreadValues({}, props));
|
|
6769
7044
|
}
|
|
6770
|
-
return /* @__PURE__ */ (0,
|
|
7045
|
+
return /* @__PURE__ */ (0, import_jsx_runtime104.jsx)(SegmentedTabsRendererComponent, __spreadValues({}, props));
|
|
6771
7046
|
case "chips":
|
|
6772
|
-
return /* @__PURE__ */ (0,
|
|
7047
|
+
return /* @__PURE__ */ (0, import_jsx_runtime104.jsx)(ChipsTabsRendererComponent, __spreadValues({}, props));
|
|
6773
7048
|
default:
|
|
6774
|
-
return /* @__PURE__ */ (0,
|
|
7049
|
+
return /* @__PURE__ */ (0, import_jsx_runtime104.jsx)(TabsRendererComponent, __spreadValues({}, props));
|
|
6775
7050
|
}
|
|
6776
7051
|
}
|
|
6777
7052
|
};
|
|
6778
7053
|
function TabsRendererComponent({ uid, margin, tabs, control, tags }) {
|
|
6779
|
-
const [selectedIndex, setSelectedIndex] = (0,
|
|
6780
|
-
return /* @__PURE__ */ (0,
|
|
6781
|
-
|
|
7054
|
+
const [selectedIndex, setSelectedIndex] = (0, import_react29.useState)(0);
|
|
7055
|
+
return /* @__PURE__ */ (0, import_jsx_runtime104.jsx)("div", { className: (0, import_classnames35.default)(getMargin(margin), controlAndTagsToCSSClass({ control, tags })), children: /* @__PURE__ */ (0, import_jsx_runtime104.jsx)(
|
|
7056
|
+
import_components72.Tabs,
|
|
6782
7057
|
{
|
|
6783
7058
|
name: uid,
|
|
6784
7059
|
selected: selectedIndex != null ? selectedIndex : 0,
|
|
6785
7060
|
tabs: tabs.map((option) => ({
|
|
6786
7061
|
title: option.title,
|
|
6787
7062
|
disabled: false,
|
|
6788
|
-
content: /* @__PURE__ */ (0,
|
|
7063
|
+
content: /* @__PURE__ */ (0, import_jsx_runtime104.jsxs)("div", { className: "m-t-2", children: [
|
|
6789
7064
|
" ",
|
|
6790
7065
|
option.children,
|
|
6791
7066
|
" "
|
|
@@ -6797,10 +7072,10 @@ function TabsRendererComponent({ uid, margin, tabs, control, tags }) {
|
|
|
6797
7072
|
}
|
|
6798
7073
|
function SegmentedTabsRendererComponent({ uid, margin, tabs, control, tags }) {
|
|
6799
7074
|
var _a;
|
|
6800
|
-
const [selectedIndex, setSelectedIndex] = (0,
|
|
6801
|
-
return /* @__PURE__ */ (0,
|
|
6802
|
-
/* @__PURE__ */ (0,
|
|
6803
|
-
|
|
7075
|
+
const [selectedIndex, setSelectedIndex] = (0, import_react29.useState)(0);
|
|
7076
|
+
return /* @__PURE__ */ (0, import_jsx_runtime104.jsxs)("div", { className: (0, import_classnames35.default)(getMargin(margin), controlAndTagsToCSSClass({ control, tags })), children: [
|
|
7077
|
+
/* @__PURE__ */ (0, import_jsx_runtime104.jsx)(
|
|
7078
|
+
import_components72.SegmentedControl,
|
|
6804
7079
|
{
|
|
6805
7080
|
name: uid,
|
|
6806
7081
|
value: String(selectedIndex),
|
|
@@ -6814,38 +7089,38 @@ function SegmentedTabsRendererComponent({ uid, margin, tabs, control, tags }) {
|
|
|
6814
7089
|
onChange: (value) => setSelectedIndex(Number(value))
|
|
6815
7090
|
}
|
|
6816
7091
|
),
|
|
6817
|
-
/* @__PURE__ */ (0,
|
|
7092
|
+
/* @__PURE__ */ (0, import_jsx_runtime104.jsx)("div", { id: `${uid}-children`, className: "m-t-2", children: (_a = tabs[selectedIndex]) == null ? void 0 : _a.children })
|
|
6818
7093
|
] });
|
|
6819
7094
|
}
|
|
6820
7095
|
function ChipsTabsRendererComponent({ margin, tabs, control, tags }) {
|
|
6821
7096
|
var _a;
|
|
6822
|
-
const [selectedIndex, setSelectedIndex] = (0,
|
|
6823
|
-
return /* @__PURE__ */ (0,
|
|
6824
|
-
/* @__PURE__ */ (0,
|
|
6825
|
-
|
|
7097
|
+
const [selectedIndex, setSelectedIndex] = (0, import_react29.useState)(0);
|
|
7098
|
+
return /* @__PURE__ */ (0, import_jsx_runtime104.jsxs)("div", { className: (0, import_classnames35.default)(getMargin(margin), controlAndTagsToCSSClass({ control, tags })), children: [
|
|
7099
|
+
/* @__PURE__ */ (0, import_jsx_runtime104.jsx)("div", { className: "chips-container", children: /* @__PURE__ */ (0, import_jsx_runtime104.jsx)(
|
|
7100
|
+
import_components72.Chips,
|
|
6826
7101
|
{
|
|
6827
7102
|
chips: tabs.map((tab, index) => ({ label: tab.title, value: index })),
|
|
6828
7103
|
selected: selectedIndex,
|
|
6829
7104
|
onChange: ({ selectedValue }) => setSelectedIndex(Number(selectedValue))
|
|
6830
7105
|
}
|
|
6831
7106
|
) }),
|
|
6832
|
-
/* @__PURE__ */ (0,
|
|
7107
|
+
/* @__PURE__ */ (0, import_jsx_runtime104.jsx)("div", { className: "m-t-2", children: (_a = tabs[selectedIndex]) == null ? void 0 : _a.children })
|
|
6833
7108
|
] });
|
|
6834
7109
|
}
|
|
6835
7110
|
|
|
6836
7111
|
// ../renderers/src/TextInputRenderer.tsx
|
|
6837
|
-
var
|
|
6838
|
-
var
|
|
7112
|
+
var import_components74 = require("@transferwise/components");
|
|
7113
|
+
var import_react31 = require("react");
|
|
6839
7114
|
|
|
6840
7115
|
// ../renderers/src/components/VariableTextInput.tsx
|
|
6841
|
-
var
|
|
6842
|
-
var
|
|
6843
|
-
var
|
|
6844
|
-
var
|
|
7116
|
+
var import_components73 = require("@transferwise/components");
|
|
7117
|
+
var import_icons8 = require("@transferwise/icons");
|
|
7118
|
+
var import_react_intl38 = require("react-intl");
|
|
7119
|
+
var import_react30 = require("react");
|
|
6845
7120
|
|
|
6846
7121
|
// ../renderers/src/messages/ssn-input.messages.ts
|
|
6847
|
-
var
|
|
6848
|
-
var ssn_input_messages_default = (0,
|
|
7122
|
+
var import_react_intl37 = require("react-intl");
|
|
7123
|
+
var ssn_input_messages_default = (0, import_react_intl37.defineMessages)({
|
|
6849
7124
|
showValue: {
|
|
6850
7125
|
id: "df.wise.ssnInput.showValue",
|
|
6851
7126
|
defaultMessage: "Show value",
|
|
@@ -6930,7 +7205,7 @@ function getDisplayOffset(displayValue, rawOffset) {
|
|
|
6930
7205
|
}
|
|
6931
7206
|
|
|
6932
7207
|
// ../renderers/src/components/VariableTextInput.tsx
|
|
6933
|
-
var
|
|
7208
|
+
var import_jsx_runtime105 = require("react/jsx-runtime");
|
|
6934
7209
|
var commonKeys = [
|
|
6935
7210
|
"autoComplete",
|
|
6936
7211
|
"autoCapitalize",
|
|
@@ -6949,14 +7224,14 @@ function VariableTextInput(inputProps) {
|
|
|
6949
7224
|
const commonProps = __spreadProps(__spreadValues({}, pick(inputProps, ...commonKeys)), { name: id });
|
|
6950
7225
|
switch (control) {
|
|
6951
7226
|
case "email":
|
|
6952
|
-
return /* @__PURE__ */ (0,
|
|
7227
|
+
return /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(TextInput, __spreadProps(__spreadValues({}, commonProps), { type: "email", onChange }));
|
|
6953
7228
|
case "password":
|
|
6954
|
-
return /* @__PURE__ */ (0,
|
|
7229
|
+
return /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(TextInput, __spreadProps(__spreadValues({}, commonProps), { type: "password", onChange }));
|
|
6955
7230
|
case "ssn-input":
|
|
6956
|
-
return /* @__PURE__ */ (0,
|
|
7231
|
+
return /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(SsnInput, __spreadProps(__spreadValues({}, commonProps), { isVisible: isSsnVisible, onChange }));
|
|
6957
7232
|
case "numeric": {
|
|
6958
7233
|
const numericProps = __spreadProps(__spreadValues({}, commonProps), { type: "number", onWheel });
|
|
6959
|
-
return /* @__PURE__ */ (0,
|
|
7234
|
+
return /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(
|
|
6960
7235
|
TextInput,
|
|
6961
7236
|
__spreadProps(__spreadValues({}, numericProps), {
|
|
6962
7237
|
onChange: (newValue) => {
|
|
@@ -6967,9 +7242,9 @@ function VariableTextInput(inputProps) {
|
|
|
6967
7242
|
);
|
|
6968
7243
|
}
|
|
6969
7244
|
case "phone-number":
|
|
6970
|
-
return /* @__PURE__ */ (0,
|
|
7245
|
+
return /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(import_components73.PhoneNumberInput, __spreadProps(__spreadValues({ initialValue: value }, commonProps), { onChange }));
|
|
6971
7246
|
default: {
|
|
6972
|
-
return /* @__PURE__ */ (0,
|
|
7247
|
+
return /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(TextInput, __spreadProps(__spreadValues({}, commonProps), { type: "text", onChange }));
|
|
6973
7248
|
}
|
|
6974
7249
|
}
|
|
6975
7250
|
}
|
|
@@ -6977,31 +7252,31 @@ function SsnInputToggle({
|
|
|
6977
7252
|
isVisible,
|
|
6978
7253
|
onClick
|
|
6979
7254
|
}) {
|
|
6980
|
-
const { formatMessage } = (0,
|
|
6981
|
-
return /* @__PURE__ */ (0,
|
|
6982
|
-
|
|
7255
|
+
const { formatMessage } = (0, import_react_intl38.useIntl)();
|
|
7256
|
+
return /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(
|
|
7257
|
+
import_components73.IconButton,
|
|
6983
7258
|
{
|
|
6984
7259
|
priority: "minimal",
|
|
6985
7260
|
size: 24,
|
|
6986
7261
|
"aria-label": formatMessage(isVisible ? ssn_input_messages_default.hideValue : ssn_input_messages_default.showValue),
|
|
6987
7262
|
"aria-pressed": isVisible,
|
|
6988
7263
|
onClick,
|
|
6989
|
-
children: isVisible ? /* @__PURE__ */ (0,
|
|
7264
|
+
children: isVisible ? /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(import_icons8.EyeShut, { size: 24 }) : /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(import_icons8.Eye, { size: 24 })
|
|
6990
7265
|
}
|
|
6991
7266
|
);
|
|
6992
7267
|
}
|
|
6993
7268
|
function TextInput(props) {
|
|
6994
7269
|
const _a = props, { control, displayFormat, onChange, type } = _a, commonProps = __objRest(_a, ["control", "displayFormat", "onChange", "type"]);
|
|
6995
|
-
const InputWithPattern = control === "textarea" ?
|
|
6996
|
-
const InputWithoutPattern = control === "textarea" ?
|
|
6997
|
-
return displayFormat ? /* @__PURE__ */ (0,
|
|
7270
|
+
const InputWithPattern = control === "textarea" ? import_components73.TextareaWithDisplayFormat : import_components73.InputWithDisplayFormat;
|
|
7271
|
+
const InputWithoutPattern = control === "textarea" ? import_components73.TextArea : import_components73.Input;
|
|
7272
|
+
return displayFormat ? /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(InputWithPattern, __spreadProps(__spreadValues({ displayPattern: displayFormat }, commonProps), { onChange })) : /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(InputWithoutPattern, __spreadProps(__spreadValues({}, commonProps), { type, onChange: (e) => onChange(e.target.value) }));
|
|
6998
7273
|
}
|
|
6999
7274
|
function SsnInput(props) {
|
|
7000
7275
|
const _a = props, { displayFormat = "", isVisible = false, onChange, value = "" } = _a, commonProps = __objRest(_a, ["displayFormat", "isVisible", "onChange", "value"]);
|
|
7001
|
-
const [editVersion, setEditVersion] = (0,
|
|
7002
|
-
const inputRef = (0,
|
|
7003
|
-
const selection = (0,
|
|
7004
|
-
const pendingCaret = (0,
|
|
7276
|
+
const [editVersion, setEditVersion] = (0, import_react30.useState)(0);
|
|
7277
|
+
const inputRef = (0, import_react30.useRef)(null);
|
|
7278
|
+
const selection = (0, import_react30.useRef)({ start: 0, end: 0 });
|
|
7279
|
+
const pendingCaret = (0, import_react30.useRef)(null);
|
|
7005
7280
|
const rawValue = value.replace(/\D/g, "");
|
|
7006
7281
|
const formattedValue = formatSsnValue(rawValue, displayFormat, isVisible);
|
|
7007
7282
|
const scheduleCaret = (rawOffset) => {
|
|
@@ -7021,7 +7296,7 @@ function SsnInput(props) {
|
|
|
7021
7296
|
scheduleCaret(result.caret);
|
|
7022
7297
|
onChange(result.value);
|
|
7023
7298
|
};
|
|
7024
|
-
(0,
|
|
7299
|
+
(0, import_react30.useLayoutEffect)(() => {
|
|
7025
7300
|
if (pendingCaret.current === null || !inputRef.current) {
|
|
7026
7301
|
return;
|
|
7027
7302
|
}
|
|
@@ -7031,7 +7306,7 @@ function SsnInput(props) {
|
|
|
7031
7306
|
);
|
|
7032
7307
|
pendingCaret.current = null;
|
|
7033
7308
|
}, [editVersion, formattedValue, rawValue]);
|
|
7034
|
-
return /* @__PURE__ */ (0,
|
|
7309
|
+
return /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(
|
|
7035
7310
|
"input",
|
|
7036
7311
|
__spreadProps(__spreadValues({
|
|
7037
7312
|
ref: inputRef
|
|
@@ -7094,13 +7369,13 @@ function SsnInput(props) {
|
|
|
7094
7369
|
}
|
|
7095
7370
|
|
|
7096
7371
|
// ../renderers/src/TextInputRenderer.tsx
|
|
7097
|
-
var
|
|
7372
|
+
var import_jsx_runtime106 = require("react/jsx-runtime");
|
|
7098
7373
|
var TextInputRenderer = {
|
|
7099
7374
|
canRenderType: "input-text",
|
|
7100
|
-
render: (props) => /* @__PURE__ */ (0,
|
|
7375
|
+
render: (props) => /* @__PURE__ */ (0, import_jsx_runtime106.jsx)(TextInputRendererComponent, __spreadValues({}, props))
|
|
7101
7376
|
};
|
|
7102
7377
|
function TextInputRendererComponent(props) {
|
|
7103
|
-
const [isSsnVisible, setIsSsnVisible] = (0,
|
|
7378
|
+
const [isSsnVisible, setIsSsnVisible] = (0, import_react31.useState)(false);
|
|
7104
7379
|
const _a = props, {
|
|
7105
7380
|
id,
|
|
7106
7381
|
title,
|
|
@@ -7132,7 +7407,7 @@ function TextInputRendererComponent(props) {
|
|
|
7132
7407
|
}
|
|
7133
7408
|
}
|
|
7134
7409
|
});
|
|
7135
|
-
return /* @__PURE__ */ (0,
|
|
7410
|
+
return /* @__PURE__ */ (0, import_jsx_runtime106.jsx)(
|
|
7136
7411
|
FieldInput_default,
|
|
7137
7412
|
{
|
|
7138
7413
|
id,
|
|
@@ -7145,13 +7420,13 @@ function TextInputRendererComponent(props) {
|
|
|
7145
7420
|
features: props.features,
|
|
7146
7421
|
control: props.control,
|
|
7147
7422
|
tags: props.tags,
|
|
7148
|
-
children: /* @__PURE__ */ (0,
|
|
7149
|
-
|
|
7423
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime106.jsx)(
|
|
7424
|
+
import_components74.InputGroup,
|
|
7150
7425
|
{
|
|
7151
7426
|
addonStart: getInputGroupAddonStart(media),
|
|
7152
7427
|
addonEnd: isSsnInput ? {
|
|
7153
7428
|
interactive: true,
|
|
7154
|
-
content: /* @__PURE__ */ (0,
|
|
7429
|
+
content: /* @__PURE__ */ (0, import_jsx_runtime106.jsx)(
|
|
7155
7430
|
SsnInputToggle,
|
|
7156
7431
|
{
|
|
7157
7432
|
isVisible: isSsnVisible,
|
|
@@ -7159,7 +7434,7 @@ function TextInputRendererComponent(props) {
|
|
|
7159
7434
|
}
|
|
7160
7435
|
)
|
|
7161
7436
|
} : void 0,
|
|
7162
|
-
children: /* @__PURE__ */ (0,
|
|
7437
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime106.jsx)(VariableTextInput, __spreadValues({}, inputProps))
|
|
7163
7438
|
}
|
|
7164
7439
|
)
|
|
7165
7440
|
}
|
|
@@ -7168,23 +7443,23 @@ function TextInputRendererComponent(props) {
|
|
|
7168
7443
|
var TextInputRenderer_default = TextInputRenderer;
|
|
7169
7444
|
|
|
7170
7445
|
// ../renderers/src/UpdatableRenderer.tsx
|
|
7171
|
-
var
|
|
7172
|
-
var
|
|
7446
|
+
var import_classnames36 = __toESM(require_classnames());
|
|
7447
|
+
var import_jsx_runtime107 = require("react/jsx-runtime");
|
|
7173
7448
|
var UpdatableRenderer = {
|
|
7174
7449
|
canRenderType: "updatable",
|
|
7175
7450
|
render: ({ children, control, margin, tags }) => {
|
|
7176
|
-
return /* @__PURE__ */ (0,
|
|
7451
|
+
return /* @__PURE__ */ (0, import_jsx_runtime107.jsx)("div", { className: (0, import_classnames36.default)(getMargin(margin), controlAndTagsToCSSClass({ control, tags })), children });
|
|
7177
7452
|
}
|
|
7178
7453
|
};
|
|
7179
7454
|
|
|
7180
7455
|
// ../renderers/src/UploadInputRenderer.tsx
|
|
7181
|
-
var
|
|
7456
|
+
var import_components75 = require("@transferwise/components");
|
|
7182
7457
|
|
|
7183
7458
|
// ../renderers/src/utils/getRandomId.ts
|
|
7184
7459
|
var getRandomId = () => Math.random().toString(36).substring(2);
|
|
7185
7460
|
|
|
7186
7461
|
// ../renderers/src/UploadInputRenderer.tsx
|
|
7187
|
-
var
|
|
7462
|
+
var import_jsx_runtime108 = require("react/jsx-runtime");
|
|
7188
7463
|
var UploadInputRenderer = {
|
|
7189
7464
|
canRenderType: "input-upload",
|
|
7190
7465
|
render: (props) => {
|
|
@@ -7213,7 +7488,7 @@ var UploadInputRenderer = {
|
|
|
7213
7488
|
};
|
|
7214
7489
|
return (
|
|
7215
7490
|
// We don't pass help here as there is no sensible place to display it
|
|
7216
|
-
/* @__PURE__ */ (0,
|
|
7491
|
+
/* @__PURE__ */ (0, import_jsx_runtime108.jsx)(
|
|
7217
7492
|
UploadFieldInput_default,
|
|
7218
7493
|
{
|
|
7219
7494
|
id,
|
|
@@ -7223,8 +7498,8 @@ var UploadInputRenderer = {
|
|
|
7223
7498
|
features,
|
|
7224
7499
|
control,
|
|
7225
7500
|
tags,
|
|
7226
|
-
children: /* @__PURE__ */ (0,
|
|
7227
|
-
|
|
7501
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(
|
|
7502
|
+
import_components75.UploadInput,
|
|
7228
7503
|
{
|
|
7229
7504
|
id,
|
|
7230
7505
|
description,
|
|
@@ -7234,7 +7509,7 @@ var UploadInputRenderer = {
|
|
|
7234
7509
|
{
|
|
7235
7510
|
id: "my-file",
|
|
7236
7511
|
filename: value.name,
|
|
7237
|
-
status: (validationState == null ? void 0 : validationState.status) === "invalid" ?
|
|
7512
|
+
status: (validationState == null ? void 0 : validationState.status) === "invalid" ? import_components75.Status.FAILED : import_components75.Status.SUCCEEDED
|
|
7238
7513
|
}
|
|
7239
7514
|
] : void 0,
|
|
7240
7515
|
fileTypes: acceptsToFileTypes(accepts),
|
|
@@ -7293,7 +7568,7 @@ var LargeUploadRenderer = {
|
|
|
7293
7568
|
};
|
|
7294
7569
|
const filetypes = acceptsToFileTypes(accepts);
|
|
7295
7570
|
const usAccept = filetypes === "*" ? "*" : filetypes.join(",");
|
|
7296
|
-
return /* @__PURE__ */ (0,
|
|
7571
|
+
return /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(
|
|
7297
7572
|
FieldInput_default,
|
|
7298
7573
|
{
|
|
7299
7574
|
id,
|
|
@@ -7304,8 +7579,8 @@ var LargeUploadRenderer = {
|
|
|
7304
7579
|
features,
|
|
7305
7580
|
control,
|
|
7306
7581
|
tags,
|
|
7307
|
-
children: /* @__PURE__ */ (0,
|
|
7308
|
-
|
|
7582
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(
|
|
7583
|
+
import_components75.Upload,
|
|
7309
7584
|
__spreadProps(__spreadValues({}, uploadProps), {
|
|
7310
7585
|
usAccept,
|
|
7311
7586
|
usDisabled: disabled,
|
|
@@ -7320,21 +7595,21 @@ var LargeUploadRenderer = {
|
|
|
7320
7595
|
};
|
|
7321
7596
|
|
|
7322
7597
|
// ../renderers/src/UpsellRenderer.tsx
|
|
7323
|
-
var
|
|
7324
|
-
var
|
|
7325
|
-
var
|
|
7326
|
-
var
|
|
7598
|
+
var import_components76 = require("@transferwise/components");
|
|
7599
|
+
var import_classnames37 = __toESM(require_classnames());
|
|
7600
|
+
var import_react32 = require("react");
|
|
7601
|
+
var import_jsx_runtime109 = require("react/jsx-runtime");
|
|
7327
7602
|
var UpsellRenderer = {
|
|
7328
7603
|
canRenderType: "upsell",
|
|
7329
7604
|
render: UpsellRendererComponent
|
|
7330
7605
|
};
|
|
7331
7606
|
function UpsellRendererComponent(props) {
|
|
7332
7607
|
const { text, callToAction, media, margin, onDismiss, control, tags } = props;
|
|
7333
|
-
const [isVisible, setIsVisible] = (0,
|
|
7334
|
-
return isVisible ? /* @__PURE__ */ (0,
|
|
7335
|
-
|
|
7608
|
+
const [isVisible, setIsVisible] = (0, import_react32.useState)(true);
|
|
7609
|
+
return isVisible ? /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(
|
|
7610
|
+
import_components76.Nudge,
|
|
7336
7611
|
{
|
|
7337
|
-
className: (0,
|
|
7612
|
+
className: (0, import_classnames37.default)(getMargin(margin), controlAndTagsToCSSClass({ control, tags })),
|
|
7338
7613
|
mediaName: getMediaName(media),
|
|
7339
7614
|
title: text,
|
|
7340
7615
|
action: __spreadValues({
|
|
@@ -7385,7 +7660,8 @@ var getWiseRenderers = () => [
|
|
|
7385
7660
|
CircularButtonRenderer,
|
|
7386
7661
|
BorderedBackgroundColoredBoxRenderer,
|
|
7387
7662
|
BoxRenderer_default,
|
|
7388
|
-
|
|
7663
|
+
CollectionRendererV2_default,
|
|
7664
|
+
CollectionRendererV1_default,
|
|
7389
7665
|
ButtonRenderer,
|
|
7390
7666
|
ColumnsRenderer_default,
|
|
7391
7667
|
DateInputRenderer_default,
|
|
@@ -7431,13 +7707,13 @@ var getWiseRenderers = () => [
|
|
|
7431
7707
|
];
|
|
7432
7708
|
|
|
7433
7709
|
// ../renderers/src/InitialLoadingStateRenderer.tsx
|
|
7434
|
-
var
|
|
7435
|
-
var
|
|
7710
|
+
var import_components77 = require("@transferwise/components");
|
|
7711
|
+
var import_jsx_runtime110 = require("react/jsx-runtime");
|
|
7436
7712
|
var InitialLoadingStateRenderer = {
|
|
7437
7713
|
canRenderType: "loading-state",
|
|
7438
7714
|
canRender: ({ stepLoadingState }) => stepLoadingState === "initial",
|
|
7439
|
-
render: () => /* @__PURE__ */ (0,
|
|
7440
|
-
|
|
7715
|
+
render: () => /* @__PURE__ */ (0, import_jsx_runtime110.jsx)(
|
|
7716
|
+
import_components77.Loader,
|
|
7441
7717
|
{
|
|
7442
7718
|
size: "md",
|
|
7443
7719
|
classNames: { "tw-loader": `tw-loader m-x-auto ${getMargin("md")}` },
|
|
@@ -7448,25 +7724,25 @@ var InitialLoadingStateRenderer = {
|
|
|
7448
7724
|
|
|
7449
7725
|
// src/dynamicFlow/DynamicFlowModal.tsx
|
|
7450
7726
|
var import_dynamic_flow_client = require("@wise/dynamic-flow-client");
|
|
7451
|
-
var
|
|
7452
|
-
var
|
|
7727
|
+
var import_components78 = require("@transferwise/components");
|
|
7728
|
+
var import_jsx_runtime111 = require("react/jsx-runtime");
|
|
7453
7729
|
function DynamicFlowModal(props) {
|
|
7454
7730
|
const _a = props, { className = "" } = _a, rest = __objRest(_a, ["className"]);
|
|
7455
7731
|
const dfProps = useWiseToCoreProps(rest);
|
|
7456
7732
|
const df = (0, import_dynamic_flow_client.useDynamicFlowModal)(dfProps);
|
|
7457
|
-
return /* @__PURE__ */ (0,
|
|
7458
|
-
|
|
7733
|
+
return /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(
|
|
7734
|
+
import_components78.Modal,
|
|
7459
7735
|
__spreadProps(__spreadValues({
|
|
7460
7736
|
className: `dynamic-flow-modal ${className}`,
|
|
7461
7737
|
disableDimmerClickToClose: true
|
|
7462
7738
|
}, df.modal), {
|
|
7463
|
-
body: /* @__PURE__ */ (0,
|
|
7739
|
+
body: /* @__PURE__ */ (0, import_jsx_runtime111.jsx)("div", { className: "dynamic-flow-modal", children: df.modal.body })
|
|
7464
7740
|
})
|
|
7465
7741
|
);
|
|
7466
7742
|
}
|
|
7467
7743
|
|
|
7468
7744
|
// src/dynamicFlow/getMergedRenderers.tsx
|
|
7469
|
-
var
|
|
7745
|
+
var import_jsx_runtime112 = require("react/jsx-runtime");
|
|
7470
7746
|
var wiseRenderers = getWiseRenderers();
|
|
7471
7747
|
var getMergedRenderers = (props) => {
|
|
7472
7748
|
var _d, _e;
|
|
@@ -7480,7 +7756,7 @@ var getMergedRenderers = (props) => {
|
|
|
7480
7756
|
method: initialRequest.method,
|
|
7481
7757
|
data: initialRequest.body
|
|
7482
7758
|
};
|
|
7483
|
-
return presentation.type === "push" ? /* @__PURE__ */ (0,
|
|
7759
|
+
return presentation.type === "push" ? /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(DynamicFlow, __spreadProps(__spreadValues(__spreadValues({}, restProps), rest), { features: subflowFeatures, initialAction: action })) : /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(
|
|
7484
7760
|
DynamicFlowModal,
|
|
7485
7761
|
__spreadProps(__spreadValues(__spreadValues({}, restProps), rest), {
|
|
7486
7762
|
features: subflowFeatures,
|
|
@@ -7559,12 +7835,12 @@ var customEventsToAnalytics = {
|
|
|
7559
7835
|
};
|
|
7560
7836
|
|
|
7561
7837
|
// src/dynamicFlow/useOnCopy.tsx
|
|
7562
|
-
var
|
|
7563
|
-
var
|
|
7838
|
+
var import_react33 = require("react");
|
|
7839
|
+
var import_react_intl40 = require("react-intl");
|
|
7564
7840
|
|
|
7565
7841
|
// src/dynamicFlow/messages.ts
|
|
7566
|
-
var
|
|
7567
|
-
var messages_default = (0,
|
|
7842
|
+
var import_react_intl39 = require("react-intl");
|
|
7843
|
+
var messages_default = (0, import_react_intl39.defineMessages)({
|
|
7568
7844
|
copied: {
|
|
7569
7845
|
id: "df.wise.CopyFeedback.copy",
|
|
7570
7846
|
defaultMessage: "Copied to clipboard",
|
|
@@ -7579,9 +7855,9 @@ var messages_default = (0, import_react_intl37.defineMessages)({
|
|
|
7579
7855
|
|
|
7580
7856
|
// src/dynamicFlow/useOnCopy.tsx
|
|
7581
7857
|
var useOnCopy = () => {
|
|
7582
|
-
const { formatMessage } = (0,
|
|
7858
|
+
const { formatMessage } = (0, import_react_intl40.useIntl)();
|
|
7583
7859
|
const createSnackBar = useSnackBarIfAvailable();
|
|
7584
|
-
return (0,
|
|
7860
|
+
return (0, import_react33.useCallback)(
|
|
7585
7861
|
(copiedContent) => {
|
|
7586
7862
|
if (copiedContent) {
|
|
7587
7863
|
createSnackBar({ text: formatMessage(messages_default.copied) });
|
|
@@ -7594,11 +7870,11 @@ var useOnCopy = () => {
|
|
|
7594
7870
|
};
|
|
7595
7871
|
|
|
7596
7872
|
// src/dynamicFlow/useWiseHttpClient.tsx
|
|
7597
|
-
var
|
|
7598
|
-
var
|
|
7873
|
+
var import_react34 = require("react");
|
|
7874
|
+
var import_react_intl41 = require("react-intl");
|
|
7599
7875
|
var useWiseHttpClient = (httpClient) => {
|
|
7600
|
-
const { locale } = (0,
|
|
7601
|
-
return (0,
|
|
7876
|
+
const { locale } = (0, import_react_intl41.useIntl)();
|
|
7877
|
+
return (0, import_react34.useCallback)(
|
|
7602
7878
|
async (input, init = {}) => {
|
|
7603
7879
|
const headers = new Headers(init.headers);
|
|
7604
7880
|
headers.set("accept-language", locale);
|
|
@@ -7639,10 +7915,10 @@ var useWiseToCoreProps = (props) => {
|
|
|
7639
7915
|
onLog
|
|
7640
7916
|
} = props;
|
|
7641
7917
|
const httpClient = useWiseHttpClient(customFetch);
|
|
7642
|
-
const mergedRenderers = (0,
|
|
7918
|
+
const mergedRenderers = (0, import_react35.useMemo)(() => getMergedRenderers(props), [renderers]);
|
|
7643
7919
|
const createSnackBar = useCreateSnackBar();
|
|
7644
|
-
const logEvent = (0,
|
|
7645
|
-
const trackEvent = (0,
|
|
7920
|
+
const logEvent = (0, import_react35.useMemo)(() => getLogEvent(onLog), [onLog]);
|
|
7921
|
+
const trackEvent = (0, import_react35.useMemo)(() => getTrackEvent(onEvent, onAnalytics), [onEvent, onAnalytics]);
|
|
7646
7922
|
const onCopy = useOnCopy();
|
|
7647
7923
|
return __spreadProps(__spreadValues({}, props), {
|
|
7648
7924
|
httpClient,
|
|
@@ -7677,27 +7953,27 @@ var openLinkInNewTab = (url) => {
|
|
|
7677
7953
|
};
|
|
7678
7954
|
|
|
7679
7955
|
// src/dynamicFlow/DynamicFlow.tsx
|
|
7680
|
-
var
|
|
7956
|
+
var import_jsx_runtime113 = require("react/jsx-runtime");
|
|
7681
7957
|
function DynamicFlow(props) {
|
|
7682
7958
|
const { className = "" } = props;
|
|
7683
7959
|
const dfProps = useWiseToCoreProps(props);
|
|
7684
7960
|
const df = (0, import_dynamic_flow_client4.useDynamicFlow)(dfProps);
|
|
7685
7961
|
const { onContextMenu, contextMenu } = useDFContextMenu(df.controller);
|
|
7686
|
-
return /* @__PURE__ */ (0,
|
|
7962
|
+
return /* @__PURE__ */ (0, import_jsx_runtime113.jsxs)("div", { className, onContextMenu, children: [
|
|
7687
7963
|
df.view,
|
|
7688
7964
|
contextMenu
|
|
7689
7965
|
] });
|
|
7690
7966
|
}
|
|
7691
7967
|
|
|
7692
7968
|
// src/dynamicFlow/DynamicFlowWithRef.tsx
|
|
7693
|
-
var
|
|
7969
|
+
var import_react36 = require("react");
|
|
7694
7970
|
var import_dynamic_flow_client5 = require("@wise/dynamic-flow-client");
|
|
7695
|
-
var
|
|
7696
|
-
var DynamicFlowWithRef = (0,
|
|
7971
|
+
var import_jsx_runtime114 = require("react/jsx-runtime");
|
|
7972
|
+
var DynamicFlowWithRef = (0, import_react36.forwardRef)(function DynamicFlowWithRef2(props, ref) {
|
|
7697
7973
|
const { className = "" } = props;
|
|
7698
7974
|
const dfProps = useWiseToCoreProps(props);
|
|
7699
7975
|
const df = (0, import_dynamic_flow_client5.useDynamicFlow)(dfProps);
|
|
7700
|
-
(0,
|
|
7976
|
+
(0, import_react36.useImperativeHandle)(
|
|
7701
7977
|
ref,
|
|
7702
7978
|
() => ({
|
|
7703
7979
|
getValue: () => {
|
|
@@ -7708,7 +7984,7 @@ var DynamicFlowWithRef = (0, import_react33.forwardRef)(function DynamicFlowWith
|
|
|
7708
7984
|
}),
|
|
7709
7985
|
[df]
|
|
7710
7986
|
);
|
|
7711
|
-
return /* @__PURE__ */ (0,
|
|
7987
|
+
return /* @__PURE__ */ (0, import_jsx_runtime114.jsx)("div", { className, children: df.view });
|
|
7712
7988
|
});
|
|
7713
7989
|
|
|
7714
7990
|
// src/index.ts
|
|
@@ -7838,6 +8114,8 @@ var en_default = {
|
|
|
7838
8114
|
"df.wise.ButtonLayout.buttonLoadingMessage": "This might take a few seconds",
|
|
7839
8115
|
"df.wise.Collection.clearText": "Clear text",
|
|
7840
8116
|
"df.wise.Collection.loadMoreMessage": "Load more",
|
|
8117
|
+
"df.wise.Collection.showLessResultsButton": "Show less results",
|
|
8118
|
+
"df.wise.Collection.showMoreResultsButton": "Show all {count} results",
|
|
7841
8119
|
"df.wise.ControlFeedback.maxLength": "Please enter {maxLength} or fewer characters.",
|
|
7842
8120
|
"df.wise.ControlFeedback.maximum": "Please enter a number that's {maximum} or less.",
|
|
7843
8121
|
"df.wise.ControlFeedback.maximumDate": "Please enter a date that's on or before {maximum}.",
|