@wise/dynamic-flow-client-internal 5.27.3 → 5.28.1
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/ar.json +1 -0
- package/build/i18n/cs.json +1 -0
- package/build/i18n/de.json +1 -0
- package/build/i18n/en.json +1 -0
- package/build/i18n/es.json +1 -0
- package/build/i18n/fr.json +1 -0
- package/build/i18n/hu.json +1 -0
- package/build/i18n/id.json +1 -0
- package/build/i18n/it.json +1 -0
- package/build/i18n/ja.json +1 -0
- package/build/i18n/ko.json +1 -0
- package/build/i18n/nl.json +1 -0
- package/build/i18n/pl.json +1 -0
- package/build/i18n/pt.json +1 -0
- package/build/i18n/ro.json +1 -0
- package/build/i18n/ru.json +1 -0
- package/build/i18n/sv.json +1 -0
- package/build/i18n/th.json +1 -0
- package/build/i18n/tr.json +1 -0
- package/build/i18n/uk.json +1 -0
- package/build/i18n/zh_CN.json +1 -0
- package/build/i18n/zh_HK.json +1 -0
- package/build/main.css +80 -0
- package/build/main.js +1417 -686
- package/build/main.mjs +1398 -667
- package/build/tsconfig.types.tsbuildinfo +1 -1
- package/package.json +25 -25
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 classNames35() {
|
|
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 classNames35.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
|
+
classNames35.default = classNames35;
|
|
115
|
+
module2.exports = classNames35;
|
|
116
116
|
} else if (typeof define === "function" && typeof define.amd === "object" && define.amd) {
|
|
117
117
|
define("classnames", [], function() {
|
|
118
|
-
return
|
|
118
|
+
return classNames35;
|
|
119
119
|
});
|
|
120
120
|
} else {
|
|
121
|
-
window.classNames =
|
|
121
|
+
window.classNames = classNames35;
|
|
122
122
|
}
|
|
123
123
|
})();
|
|
124
124
|
}
|
|
@@ -146,7 +146,7 @@ var import_dynamic_flow_client4 = require("@wise/dynamic-flow-client");
|
|
|
146
146
|
// src/dynamicFlow/telemetry/app-version.ts
|
|
147
147
|
var appVersion = (
|
|
148
148
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
|
149
|
-
typeof process !== "undefined" ? "5.
|
|
149
|
+
typeof process !== "undefined" ? "5.28.1" : "0.0.0"
|
|
150
150
|
);
|
|
151
151
|
|
|
152
152
|
// src/dynamicFlow/context-menu/useContextMenu.tsx
|
|
@@ -336,7 +336,7 @@ var recursivelyRemoveNullish = (element) => {
|
|
|
336
336
|
};
|
|
337
337
|
|
|
338
338
|
// src/dynamicFlow/useWiseToCoreProps.tsx
|
|
339
|
-
var
|
|
339
|
+
var import_react30 = require("react");
|
|
340
340
|
|
|
341
341
|
// src/dynamicFlow/getMergedRenderers.tsx
|
|
342
342
|
var import_dynamic_flow_client2 = require("@wise/dynamic-flow-client");
|
|
@@ -1041,18 +1041,128 @@ var shouldRenderActionPrompt = (props) => {
|
|
|
1041
1041
|
};
|
|
1042
1042
|
var AlertRenderer_default = AlertRenderer;
|
|
1043
1043
|
|
|
1044
|
-
// ../renderers/src/
|
|
1044
|
+
// ../renderers/src/CanadaPromo/BorderedBackgroundColoredBoxRenderer.tsx
|
|
1045
1045
|
var import_classnames5 = __toESM(require_classnames());
|
|
1046
|
+
|
|
1047
|
+
// ../renderers/src/CanadaPromo/color-utils.ts
|
|
1048
|
+
var URN_COLOR = "urn:wise:colors:";
|
|
1049
|
+
var validCategories = [
|
|
1050
|
+
"brand",
|
|
1051
|
+
"content",
|
|
1052
|
+
"interactive",
|
|
1053
|
+
"border",
|
|
1054
|
+
"background",
|
|
1055
|
+
"sentiment",
|
|
1056
|
+
"base",
|
|
1057
|
+
"contrast",
|
|
1058
|
+
"custom"
|
|
1059
|
+
];
|
|
1060
|
+
var customColorsMapping = {
|
|
1061
|
+
pix: "#4DB6AC"
|
|
1062
|
+
};
|
|
1063
|
+
var getColorFromUrn = (urn) => {
|
|
1064
|
+
if (!(urn == null ? void 0 : urn.startsWith(URN_COLOR))) return void 0;
|
|
1065
|
+
const parts = urn.slice(URN_COLOR.length).split(":");
|
|
1066
|
+
const category = parts[0];
|
|
1067
|
+
const name = parts[1];
|
|
1068
|
+
if (!category || !name) return void 0;
|
|
1069
|
+
if (!validCategories.includes(category)) return void 0;
|
|
1070
|
+
if (category === "brand" || category === "base") return `var(--color-${name})`;
|
|
1071
|
+
if (category === "custom") return customColorsMapping[name];
|
|
1072
|
+
return `var(--color-${category}-${name})`;
|
|
1073
|
+
};
|
|
1074
|
+
var getThemeClass = (themeTag) => {
|
|
1075
|
+
if (!themeTag) {
|
|
1076
|
+
return void 0;
|
|
1077
|
+
}
|
|
1078
|
+
const themeValue = themeTag.slice("theme-".length);
|
|
1079
|
+
switch (themeValue) {
|
|
1080
|
+
case "dark":
|
|
1081
|
+
return "np-theme-personal np-theme-personal--dark";
|
|
1082
|
+
case "light":
|
|
1083
|
+
return "np-theme-personal";
|
|
1084
|
+
default:
|
|
1085
|
+
return void 0;
|
|
1086
|
+
}
|
|
1087
|
+
};
|
|
1088
|
+
|
|
1089
|
+
// ../renderers/src/CanadaPromo/BorderedBackgroundColoredBoxRenderer.tsx
|
|
1046
1090
|
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
1091
|
+
var BorderedBackgroundColoredBoxRenderer = {
|
|
1092
|
+
canRenderType: "box",
|
|
1093
|
+
canRender: ({ control }) => control === "borderedBackgroundColored",
|
|
1094
|
+
render: ({ children, margin, tags }) => {
|
|
1095
|
+
const backgroundColor = getColorFromUrn(tags == null ? void 0 : tags.find((t) => t.startsWith("urn:wise:colors:")));
|
|
1096
|
+
const themeClass = getThemeClass(tags == null ? void 0 : tags.find((t) => t.startsWith("theme-")));
|
|
1097
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
1098
|
+
"div",
|
|
1099
|
+
{
|
|
1100
|
+
className: (0, import_classnames5.default)("df-bordered-background-colored-box", themeClass, getMargin(margin)),
|
|
1101
|
+
style: backgroundColor ? { backgroundColor } : void 0,
|
|
1102
|
+
children
|
|
1103
|
+
}
|
|
1104
|
+
);
|
|
1105
|
+
}
|
|
1106
|
+
};
|
|
1107
|
+
|
|
1108
|
+
// ../renderers/src/CanadaPromo/ColoredUpsellRenderer.tsx
|
|
1109
|
+
var import_art5 = require("@wise/art");
|
|
1110
|
+
var import_classnames6 = __toESM(require_classnames());
|
|
1111
|
+
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
1112
|
+
var URN_ILLUSTRATION_PREFIX = "urn:wise:illustrations:";
|
|
1113
|
+
var parseTextIntoTitleAndSubtitle = (text) => {
|
|
1114
|
+
const trimmedText = text.trim();
|
|
1115
|
+
if (!trimmedText) {
|
|
1116
|
+
return { title: "", subtitle: "" };
|
|
1117
|
+
}
|
|
1118
|
+
const [first, second] = trimmedText.split("\n", 2);
|
|
1119
|
+
if (first !== void 0 && second !== void 0) {
|
|
1120
|
+
return { title: first.trim(), subtitle: second.trim() };
|
|
1121
|
+
}
|
|
1122
|
+
return { title: "", subtitle: trimmedText };
|
|
1123
|
+
};
|
|
1124
|
+
var ColoredUpsellRenderer = {
|
|
1125
|
+
canRenderType: "upsell",
|
|
1126
|
+
canRender: ({ control }) => control === "promoColoredUpsell",
|
|
1127
|
+
render: ({ text, callToAction, media, margin, tags }) => {
|
|
1128
|
+
var _a;
|
|
1129
|
+
const backgroundColor = getColorFromUrn(tags == null ? void 0 : tags.find((t) => t.startsWith("urn:wise:colors:")));
|
|
1130
|
+
const themeClass = getThemeClass(tags == null ? void 0 : tags.find((t) => t.startsWith("theme-")));
|
|
1131
|
+
const mediaUri = (media == null ? void 0 : media.type) === "image" ? media.uri : void 0;
|
|
1132
|
+
const illustrationName = (mediaUri == null ? void 0 : mediaUri.startsWith(URN_ILLUSTRATION_PREFIX)) ? mediaUri.slice(URN_ILLUSTRATION_PREFIX.length).split("?")[0] : void 0;
|
|
1133
|
+
const { title, subtitle } = parseTextIntoTitleAndSubtitle(text);
|
|
1134
|
+
const actionTitle = (_a = callToAction == null ? void 0 : callToAction.title) != null ? _a : "";
|
|
1135
|
+
const handleActionClick = callToAction == null ? void 0 : callToAction.onClick;
|
|
1136
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
|
|
1137
|
+
"div",
|
|
1138
|
+
{
|
|
1139
|
+
className: (0, import_classnames6.default)("df-colored-upsell", themeClass, getMargin(margin)),
|
|
1140
|
+
style: backgroundColor ? { backgroundColor } : void 0,
|
|
1141
|
+
children: [
|
|
1142
|
+
illustrationName && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "df-colored-upsell-illustration", children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_art5.Illustration, { name: illustrationName, size: "small" }) }),
|
|
1143
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "df-colored-upsell-content", children: [
|
|
1144
|
+
title && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("p", { className: "df-colored-upsell-title", children: title }),
|
|
1145
|
+
subtitle && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("p", { className: "df-colored-upsell-subtitle", children: subtitle }),
|
|
1146
|
+
handleActionClick && actionTitle && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("button", { type: "button", className: "df-colored-upsell-action", onClick: handleActionClick, children: actionTitle })
|
|
1147
|
+
] })
|
|
1148
|
+
]
|
|
1149
|
+
}
|
|
1150
|
+
);
|
|
1151
|
+
}
|
|
1152
|
+
};
|
|
1153
|
+
|
|
1154
|
+
// ../renderers/src/BoxRenderer.tsx
|
|
1155
|
+
var import_classnames7 = __toESM(require_classnames());
|
|
1156
|
+
var import_jsx_runtime24 = require("react/jsx-runtime");
|
|
1047
1157
|
var BoxRenderer = {
|
|
1048
1158
|
canRenderType: "box",
|
|
1049
1159
|
render: ({ children, control, margin, width, tags }) => {
|
|
1050
1160
|
const hasFixedWidth = width !== "xl";
|
|
1051
1161
|
const hasBorder = control === "bordered" || control === "bordered-web";
|
|
1052
|
-
const contents = /* @__PURE__ */ (0,
|
|
1162
|
+
const contents = /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
1053
1163
|
"div",
|
|
1054
1164
|
{
|
|
1055
|
-
className: (0,
|
|
1165
|
+
className: (0, import_classnames7.default)(
|
|
1056
1166
|
"df-box-renderer",
|
|
1057
1167
|
{
|
|
1058
1168
|
"df-box-renderer-border": hasBorder,
|
|
@@ -1064,14 +1174,14 @@ var BoxRenderer = {
|
|
|
1064
1174
|
children
|
|
1065
1175
|
}
|
|
1066
1176
|
);
|
|
1067
|
-
return hasFixedWidth ? /* @__PURE__ */ (0,
|
|
1177
|
+
return hasFixedWidth ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: (0, import_classnames7.default)("df-box-renderer-fixed-width", getMargin(margin)), children: contents }) : contents;
|
|
1068
1178
|
}
|
|
1069
1179
|
};
|
|
1070
1180
|
var BoxRenderer_default = BoxRenderer;
|
|
1071
1181
|
|
|
1072
1182
|
// ../renderers/src/ButtonRenderer/AddressValidationButtonRenderer.tsx
|
|
1073
1183
|
var import_components7 = require("@transferwise/components");
|
|
1074
|
-
var
|
|
1184
|
+
var import_classnames8 = __toESM(require_classnames());
|
|
1075
1185
|
var import_react_intl2 = require("react-intl");
|
|
1076
1186
|
var import_react5 = require("react");
|
|
1077
1187
|
|
|
@@ -1086,7 +1196,7 @@ var loading_button_messages_default = (0, import_react_intl.defineMessages)({
|
|
|
1086
1196
|
});
|
|
1087
1197
|
|
|
1088
1198
|
// ../renderers/src/ButtonRenderer/AddressValidationButtonRenderer.tsx
|
|
1089
|
-
var
|
|
1199
|
+
var import_jsx_runtime25 = require("react/jsx-runtime");
|
|
1090
1200
|
var AddressValidationButtonRenderer = {
|
|
1091
1201
|
canRenderType: "button",
|
|
1092
1202
|
canRender: ({ control }) => control === "address-validation",
|
|
@@ -1106,16 +1216,16 @@ function AddressValidationButtonComponent(props) {
|
|
|
1106
1216
|
setSpinny(false);
|
|
1107
1217
|
}
|
|
1108
1218
|
};
|
|
1109
|
-
return /* @__PURE__ */ (0,
|
|
1219
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
|
|
1110
1220
|
"div",
|
|
1111
1221
|
{
|
|
1112
|
-
className: (0,
|
|
1222
|
+
className: (0, import_classnames8.default)(
|
|
1113
1223
|
"d-flex flex-column",
|
|
1114
1224
|
getMargin(margin),
|
|
1115
1225
|
controlAndTagsToCSSClass({ control, tags })
|
|
1116
1226
|
),
|
|
1117
1227
|
children: [
|
|
1118
|
-
/* @__PURE__ */ (0,
|
|
1228
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
1119
1229
|
import_components7.Button,
|
|
1120
1230
|
{
|
|
1121
1231
|
v2: true,
|
|
@@ -1132,7 +1242,7 @@ function AddressValidationButtonComponent(props) {
|
|
|
1132
1242
|
children: title
|
|
1133
1243
|
}
|
|
1134
1244
|
),
|
|
1135
|
-
spinny && /* @__PURE__ */ (0,
|
|
1245
|
+
spinny && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_components7.InlineAlert, { type: "warning", className: "m-x-auto", children: formatMessage(loading_button_messages_default.buttonLoadingMessage) })
|
|
1136
1246
|
]
|
|
1137
1247
|
}
|
|
1138
1248
|
);
|
|
@@ -1141,7 +1251,7 @@ var AddressValidationButtonRenderer_default = AddressValidationButtonRenderer;
|
|
|
1141
1251
|
|
|
1142
1252
|
// ../renderers/src/ButtonRenderer/ButtonRenderer.tsx
|
|
1143
1253
|
var import_components8 = require("@transferwise/components");
|
|
1144
|
-
var
|
|
1254
|
+
var import_classnames9 = __toESM(require_classnames());
|
|
1145
1255
|
var import_react6 = require("react");
|
|
1146
1256
|
|
|
1147
1257
|
// ../renderers/src/components/Media/getAddonStartMedia.ts
|
|
@@ -1184,7 +1294,7 @@ var mapLegacyButtonSize = (size) => {
|
|
|
1184
1294
|
};
|
|
1185
1295
|
|
|
1186
1296
|
// ../renderers/src/ButtonRenderer/ButtonRenderer.tsx
|
|
1187
|
-
var
|
|
1297
|
+
var import_jsx_runtime26 = require("react/jsx-runtime");
|
|
1188
1298
|
var ButtonRenderer = {
|
|
1189
1299
|
canRenderType: "button",
|
|
1190
1300
|
render: ButtonComponent
|
|
@@ -1217,12 +1327,13 @@ function ButtonComponent(props) {
|
|
|
1217
1327
|
const buttonProps = {
|
|
1218
1328
|
v2: true,
|
|
1219
1329
|
block: control !== "small",
|
|
1220
|
-
className: (0,
|
|
1330
|
+
className: (0, import_classnames9.default)(
|
|
1221
1331
|
getMargin(margin),
|
|
1222
1332
|
"df-button",
|
|
1223
1333
|
{
|
|
1224
1334
|
small: control === "small",
|
|
1225
|
-
"align-center": tags == null ? void 0 : tags.includes("align-center")
|
|
1335
|
+
"align-center": tags == null ? void 0 : tags.includes("align-center"),
|
|
1336
|
+
"align-end": tags == null ? void 0 : tags.includes("align-end")
|
|
1226
1337
|
},
|
|
1227
1338
|
controlAndTagsToCSSClass({ control, tags })
|
|
1228
1339
|
),
|
|
@@ -1238,7 +1349,7 @@ function ButtonComponent(props) {
|
|
|
1238
1349
|
onClick();
|
|
1239
1350
|
}
|
|
1240
1351
|
};
|
|
1241
|
-
return /* @__PURE__ */ (0,
|
|
1352
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_components8.Button, __spreadProps(__spreadValues({}, buttonProps), { children: title }));
|
|
1242
1353
|
}
|
|
1243
1354
|
var getSentiment = (context) => context === "negative" ? "negative" : "default";
|
|
1244
1355
|
var getPriority = (control, tags) => {
|
|
@@ -1292,13 +1403,13 @@ var help_messages_default = (0, import_react_intl3.defineMessages)({
|
|
|
1292
1403
|
});
|
|
1293
1404
|
|
|
1294
1405
|
// ../renderers/src/components/Help.tsx
|
|
1295
|
-
var
|
|
1406
|
+
var import_jsx_runtime27 = require("react/jsx-runtime");
|
|
1296
1407
|
function Help({ help, onClick }) {
|
|
1297
1408
|
const intl = (0, import_react_intl4.useIntl)();
|
|
1298
|
-
return /* @__PURE__ */ (0,
|
|
1409
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
1299
1410
|
import_components9.Info,
|
|
1300
1411
|
{
|
|
1301
|
-
content: /* @__PURE__ */ (0,
|
|
1412
|
+
content: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_components9.Markdown, { config: { link: { target: "_blank" } }, children: help }),
|
|
1302
1413
|
presentation: "POPOVER",
|
|
1303
1414
|
size: "sm",
|
|
1304
1415
|
"aria-label": intl.formatMessage(help_messages_default.helpAria),
|
|
@@ -1309,16 +1420,16 @@ function Help({ help, onClick }) {
|
|
|
1309
1420
|
var Help_default = Help;
|
|
1310
1421
|
|
|
1311
1422
|
// ../renderers/src/components/LabelContentWithHelp.tsx
|
|
1312
|
-
var
|
|
1423
|
+
var import_jsx_runtime28 = require("react/jsx-runtime");
|
|
1313
1424
|
function LabelContentWithHelp({ text, help }) {
|
|
1314
|
-
return /* @__PURE__ */ (0,
|
|
1425
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { children: [
|
|
1315
1426
|
text,
|
|
1316
|
-
/* @__PURE__ */ (0,
|
|
1427
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Help_default, { help })
|
|
1317
1428
|
] });
|
|
1318
1429
|
}
|
|
1319
1430
|
|
|
1320
1431
|
// ../renderers/src/components/FieldInput.tsx
|
|
1321
|
-
var
|
|
1432
|
+
var import_jsx_runtime29 = require("react/jsx-runtime");
|
|
1322
1433
|
function FieldInput({
|
|
1323
1434
|
id,
|
|
1324
1435
|
children,
|
|
@@ -1333,9 +1444,9 @@ function FieldInput({
|
|
|
1333
1444
|
tags
|
|
1334
1445
|
}) {
|
|
1335
1446
|
var _a;
|
|
1336
|
-
const labelContent = label && help ? /* @__PURE__ */ (0,
|
|
1447
|
+
const labelContent = label && help ? /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(LabelContentWithHelp, { text: label, help }) : label;
|
|
1337
1448
|
const { ref } = useScrollToError(validation, features);
|
|
1338
|
-
return /* @__PURE__ */ (0,
|
|
1449
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { ref, children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
1339
1450
|
import_components10.Field,
|
|
1340
1451
|
{
|
|
1341
1452
|
id,
|
|
@@ -1364,26 +1475,26 @@ var FieldInput_default = FieldInput;
|
|
|
1364
1475
|
|
|
1365
1476
|
// ../renderers/src/utils/listItem/getAdditionalText.tsx
|
|
1366
1477
|
var import_components11 = require("@transferwise/components");
|
|
1367
|
-
var
|
|
1478
|
+
var import_jsx_runtime30 = require("react/jsx-runtime");
|
|
1368
1479
|
var getAdditionalText = (additionalText) => {
|
|
1369
1480
|
if (!additionalText) {
|
|
1370
1481
|
return void 0;
|
|
1371
1482
|
}
|
|
1372
|
-
return /* @__PURE__ */ (0,
|
|
1483
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_components11.ListItem.AdditionalInfo, { children: additionalText });
|
|
1373
1484
|
};
|
|
1374
1485
|
|
|
1375
1486
|
// ../renderers/src/utils/listItem/getInlineAlert.tsx
|
|
1376
1487
|
var import_components12 = require("@transferwise/components");
|
|
1377
|
-
var
|
|
1488
|
+
var import_jsx_runtime31 = require("react/jsx-runtime");
|
|
1378
1489
|
var getInlineAlert = (inlineAlert) => {
|
|
1379
1490
|
if (!inlineAlert) return void 0;
|
|
1380
1491
|
const { context, media, content } = inlineAlert;
|
|
1381
|
-
return /* @__PURE__ */ (0,
|
|
1492
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_components12.ListItem.Prompt, { sentiment: context, media: media && getInlinePromptMedia(media), children: content });
|
|
1382
1493
|
};
|
|
1383
1494
|
|
|
1384
1495
|
// ../renderers/src/utils/listItem/getMedia.tsx
|
|
1385
|
-
var
|
|
1386
|
-
var getMedia = (media, preferAvatar) => media ? /* @__PURE__ */ (0,
|
|
1496
|
+
var import_jsx_runtime32 = require("react/jsx-runtime");
|
|
1497
|
+
var getMedia = (media, preferAvatar) => media ? /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(OptionMedia, { media, preferAvatar }) : void 0;
|
|
1387
1498
|
|
|
1388
1499
|
// ../renderers/src/utils/listItem/getSupportingValues.ts
|
|
1389
1500
|
var getSupportingValues = (supportingValues) => {
|
|
@@ -1391,18 +1502,18 @@ var getSupportingValues = (supportingValues) => {
|
|
|
1391
1502
|
};
|
|
1392
1503
|
|
|
1393
1504
|
// ../renderers/src/CheckboxInputRenderer.tsx
|
|
1394
|
-
var
|
|
1505
|
+
var import_jsx_runtime33 = require("react/jsx-runtime");
|
|
1395
1506
|
var CheckboxInputRenderer = {
|
|
1396
1507
|
canRenderType: "input-checkbox",
|
|
1397
1508
|
render: (props) => {
|
|
1398
1509
|
switch (props.control) {
|
|
1399
1510
|
case "switch-item":
|
|
1400
|
-
return /* @__PURE__ */ (0,
|
|
1511
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(SwitchItemComponent, __spreadValues({}, props));
|
|
1401
1512
|
case "checkbox-item":
|
|
1402
|
-
return /* @__PURE__ */ (0,
|
|
1513
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(CheckboxItemComponent, __spreadValues({}, props));
|
|
1403
1514
|
case "checkbox":
|
|
1404
1515
|
default:
|
|
1405
|
-
return /* @__PURE__ */ (0,
|
|
1516
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(CheckboxComponent, __spreadValues({}, props));
|
|
1406
1517
|
}
|
|
1407
1518
|
}
|
|
1408
1519
|
};
|
|
@@ -1427,7 +1538,7 @@ var CheckboxComponent = (props) => {
|
|
|
1427
1538
|
"value"
|
|
1428
1539
|
]);
|
|
1429
1540
|
const checkboxProps = __spreadProps(__spreadValues({}, rest), { label: title, secondary: description, checked: value });
|
|
1430
|
-
return /* @__PURE__ */ (0,
|
|
1541
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
1431
1542
|
FieldInput_default,
|
|
1432
1543
|
{
|
|
1433
1544
|
id,
|
|
@@ -1440,7 +1551,7 @@ var CheckboxComponent = (props) => {
|
|
|
1440
1551
|
features: rest.features,
|
|
1441
1552
|
control,
|
|
1442
1553
|
tags: rest.tags,
|
|
1443
|
-
children: /* @__PURE__ */ (0,
|
|
1554
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_components13.Checkbox, __spreadValues({ id }, checkboxProps))
|
|
1444
1555
|
}
|
|
1445
1556
|
);
|
|
1446
1557
|
};
|
|
@@ -1459,7 +1570,7 @@ var CheckboxItemComponent = (props) => {
|
|
|
1459
1570
|
onChange
|
|
1460
1571
|
} = props;
|
|
1461
1572
|
const { ref } = useScrollToError(validationState, features);
|
|
1462
|
-
return /* @__PURE__ */ (0,
|
|
1573
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { ref, children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
1463
1574
|
import_components13.ListItem,
|
|
1464
1575
|
__spreadProps(__spreadValues({
|
|
1465
1576
|
title,
|
|
@@ -1468,7 +1579,7 @@ var CheckboxItemComponent = (props) => {
|
|
|
1468
1579
|
media: getMedia(media, false),
|
|
1469
1580
|
disabled,
|
|
1470
1581
|
prompt: getInlineAlertOrValidation(validationState, inlineAlert),
|
|
1471
|
-
control: /* @__PURE__ */ (0,
|
|
1582
|
+
control: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_components13.ListItem.Checkbox, { checked: value, onChange: () => onChange(!value) })
|
|
1472
1583
|
}, getSupportingValues(supportingValues)), {
|
|
1473
1584
|
className: controlAndTagsToCSSClass(props)
|
|
1474
1585
|
})
|
|
@@ -1489,7 +1600,7 @@ var SwitchItemComponent = (props) => {
|
|
|
1489
1600
|
onChange
|
|
1490
1601
|
} = props;
|
|
1491
1602
|
const { ref } = useScrollToError(validationState, features);
|
|
1492
|
-
return /* @__PURE__ */ (0,
|
|
1603
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { ref, children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
1493
1604
|
import_components13.ListItem,
|
|
1494
1605
|
__spreadProps(__spreadValues({
|
|
1495
1606
|
title,
|
|
@@ -1498,7 +1609,7 @@ var SwitchItemComponent = (props) => {
|
|
|
1498
1609
|
media: getMedia(media, false),
|
|
1499
1610
|
disabled,
|
|
1500
1611
|
prompt: getInlineAlertOrValidation(validationState, inlineAlert),
|
|
1501
|
-
control: /* @__PURE__ */ (0,
|
|
1612
|
+
control: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_components13.ListItem.Switch, { checked: value, onClick: () => onChange(!value) })
|
|
1502
1613
|
}, getSupportingValues(supportingValues)), {
|
|
1503
1614
|
className: controlAndTagsToCSSClass(props)
|
|
1504
1615
|
})
|
|
@@ -1506,7 +1617,7 @@ var SwitchItemComponent = (props) => {
|
|
|
1506
1617
|
};
|
|
1507
1618
|
var getInlineAlertOrValidation = (validationState, inlineAlert) => {
|
|
1508
1619
|
if ((validationState == null ? void 0 : validationState.status) === "invalid") {
|
|
1509
|
-
return /* @__PURE__ */ (0,
|
|
1620
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_components13.ListItem.Prompt, { sentiment: "negative", children: validationState.message });
|
|
1510
1621
|
}
|
|
1511
1622
|
return getInlineAlert(inlineAlert);
|
|
1512
1623
|
};
|
|
@@ -1535,30 +1646,63 @@ var generic_error_messages_default = (0, import_react_intl5.defineMessages)({
|
|
|
1535
1646
|
}
|
|
1536
1647
|
});
|
|
1537
1648
|
|
|
1538
|
-
// ../../node_modules/.pnpm/@tanstack+react-virtual@3.
|
|
1649
|
+
// ../../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
|
|
1539
1650
|
var React = __toESM(require("react"), 1);
|
|
1540
1651
|
var import_react_dom = require("react-dom");
|
|
1541
1652
|
|
|
1542
|
-
// ../../node_modules/.pnpm/@tanstack+virtual-core@3.
|
|
1653
|
+
// ../../node_modules/.pnpm/@tanstack+virtual-core@3.17.8/node_modules/@tanstack/virtual-core/dist/esm/lazy-measurements.js
|
|
1654
|
+
function createLazyMeasurementsView(count, flat, getItemKey) {
|
|
1655
|
+
const cache = new Array(count);
|
|
1656
|
+
return new Proxy(cache, {
|
|
1657
|
+
get(target, prop, receiver) {
|
|
1658
|
+
if (typeof prop === "string") {
|
|
1659
|
+
const c = prop.charCodeAt(0);
|
|
1660
|
+
if (c >= 48 && c <= 57) {
|
|
1661
|
+
const i = +prop;
|
|
1662
|
+
if (Number.isInteger(i) && i >= 0 && i < count) {
|
|
1663
|
+
let v = target[i];
|
|
1664
|
+
if (!v) {
|
|
1665
|
+
const s = flat[i * 2];
|
|
1666
|
+
v = target[i] = {
|
|
1667
|
+
index: i,
|
|
1668
|
+
key: getItemKey(i),
|
|
1669
|
+
start: s,
|
|
1670
|
+
size: flat[i * 2 + 1],
|
|
1671
|
+
end: s + flat[i * 2 + 1],
|
|
1672
|
+
lane: 0
|
|
1673
|
+
};
|
|
1674
|
+
}
|
|
1675
|
+
return v;
|
|
1676
|
+
}
|
|
1677
|
+
}
|
|
1678
|
+
if (prop === "length") return count;
|
|
1679
|
+
}
|
|
1680
|
+
return Reflect.get(target, prop, receiver);
|
|
1681
|
+
}
|
|
1682
|
+
});
|
|
1683
|
+
}
|
|
1684
|
+
|
|
1685
|
+
// ../../node_modules/.pnpm/@tanstack+virtual-core@3.17.8/node_modules/@tanstack/virtual-core/dist/esm/utils.js
|
|
1543
1686
|
function memo(getDeps, fn, opts) {
|
|
1544
1687
|
var _a;
|
|
1545
1688
|
let deps = (_a = opts.initialDeps) != null ? _a : [];
|
|
1546
1689
|
let result;
|
|
1547
1690
|
let isInitial = true;
|
|
1548
1691
|
function memoizedFunction() {
|
|
1549
|
-
var _a2
|
|
1550
|
-
|
|
1551
|
-
|
|
1692
|
+
var _a2;
|
|
1693
|
+
const debugEnabled = !!opts.key && !!((_a2 = opts.debug) == null ? void 0 : _a2.call(opts));
|
|
1694
|
+
let depTime = 0;
|
|
1695
|
+
if (debugEnabled) depTime = Date.now();
|
|
1552
1696
|
const newDeps = getDeps();
|
|
1553
1697
|
const depsChanged = newDeps.length !== deps.length || newDeps.some((dep, index) => deps[index] !== dep);
|
|
1554
1698
|
if (!depsChanged) {
|
|
1555
1699
|
return result;
|
|
1556
1700
|
}
|
|
1557
1701
|
deps = newDeps;
|
|
1558
|
-
let resultTime;
|
|
1559
|
-
if (
|
|
1702
|
+
let resultTime = 0;
|
|
1703
|
+
if (debugEnabled) resultTime = Date.now();
|
|
1560
1704
|
result = fn(...newDeps);
|
|
1561
|
-
if (
|
|
1705
|
+
if (debugEnabled) {
|
|
1562
1706
|
const depEndTime = Math.round((Date.now() - depTime) * 100) / 100;
|
|
1563
1707
|
const resultEndTime = Math.round((Date.now() - resultTime) * 100) / 100;
|
|
1564
1708
|
const resultFpsPercentage = resultEndTime / 16;
|
|
@@ -1602,20 +1746,39 @@ function notUndefined(value, msg) {
|
|
|
1602
1746
|
var approxEqual = (a, b) => Math.abs(a - b) < 1.01;
|
|
1603
1747
|
var debounce = (targetWindow, fn, ms) => {
|
|
1604
1748
|
let timeoutId;
|
|
1605
|
-
return
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
|
|
1749
|
+
return Object.assign(
|
|
1750
|
+
function(...args) {
|
|
1751
|
+
targetWindow.clearTimeout(timeoutId);
|
|
1752
|
+
timeoutId = targetWindow.setTimeout(() => fn.apply(this, args), ms);
|
|
1753
|
+
},
|
|
1754
|
+
{
|
|
1755
|
+
// The handle is closure-local, so a caller that has already
|
|
1756
|
+
// unsubscribed has no way to stop a queued call. Teardown paths use
|
|
1757
|
+
// this to drop the pending invocation instead of letting it land.
|
|
1758
|
+
cancel: () => {
|
|
1759
|
+
targetWindow.clearTimeout(timeoutId);
|
|
1760
|
+
}
|
|
1761
|
+
}
|
|
1762
|
+
);
|
|
1609
1763
|
};
|
|
1610
1764
|
|
|
1611
|
-
// ../../node_modules/.pnpm/@tanstack+virtual-core@3.
|
|
1765
|
+
// ../../node_modules/.pnpm/@tanstack+virtual-core@3.17.8/node_modules/@tanstack/virtual-core/dist/esm/index.js
|
|
1766
|
+
var _isIOSResult;
|
|
1767
|
+
var isIOSWebKit = () => {
|
|
1768
|
+
if (_isIOSResult !== void 0) return _isIOSResult;
|
|
1769
|
+
if (typeof navigator === "undefined") return _isIOSResult = false;
|
|
1770
|
+
if (/iP(hone|od|ad)/.test(navigator.userAgent)) return _isIOSResult = true;
|
|
1771
|
+
const mtp = navigator.maxTouchPoints;
|
|
1772
|
+
return _isIOSResult = navigator.platform === "MacIntel" && mtp !== void 0 && mtp > 0;
|
|
1773
|
+
};
|
|
1612
1774
|
var defaultKeyExtractor = (index) => index;
|
|
1613
1775
|
var defaultRangeExtractor = (range) => {
|
|
1614
1776
|
const start = Math.max(range.startIndex - range.overscan, 0);
|
|
1615
1777
|
const end = Math.min(range.endIndex + range.overscan, range.count - 1);
|
|
1616
|
-
const
|
|
1617
|
-
|
|
1618
|
-
|
|
1778
|
+
const len = end - start + 1;
|
|
1779
|
+
const arr = new Array(len);
|
|
1780
|
+
for (let i = 0; i < len; i++) {
|
|
1781
|
+
arr[i] = start + i;
|
|
1619
1782
|
}
|
|
1620
1783
|
return arr;
|
|
1621
1784
|
};
|
|
@@ -1637,7 +1800,7 @@ var observeWindowRect = (instance, cb) => {
|
|
|
1637
1800
|
};
|
|
1638
1801
|
};
|
|
1639
1802
|
var supportsScrollend = typeof window == "undefined" ? true : "onscrollend" in window;
|
|
1640
|
-
var
|
|
1803
|
+
var observeOffset = (instance, cb, readOffset) => {
|
|
1641
1804
|
const element = instance.scrollElement;
|
|
1642
1805
|
if (!element) {
|
|
1643
1806
|
return;
|
|
@@ -1646,23 +1809,21 @@ var observeWindowOffset = (instance, cb) => {
|
|
|
1646
1809
|
if (!targetWindow) {
|
|
1647
1810
|
return;
|
|
1648
1811
|
}
|
|
1812
|
+
const registerScrollendEvent = instance.options.useScrollendEvent && supportsScrollend;
|
|
1649
1813
|
let offset = 0;
|
|
1650
|
-
const fallback =
|
|
1814
|
+
const fallback = registerScrollendEvent ? null : debounce(
|
|
1651
1815
|
targetWindow,
|
|
1652
|
-
() =>
|
|
1653
|
-
cb(offset, false);
|
|
1654
|
-
},
|
|
1816
|
+
() => cb(offset, false),
|
|
1655
1817
|
instance.options.isScrollingResetDelay
|
|
1656
1818
|
);
|
|
1657
1819
|
const createHandler = (isScrolling) => () => {
|
|
1658
|
-
offset = element
|
|
1659
|
-
fallback();
|
|
1820
|
+
offset = readOffset(element);
|
|
1821
|
+
fallback == null ? void 0 : fallback();
|
|
1660
1822
|
cb(offset, isScrolling);
|
|
1661
1823
|
};
|
|
1662
1824
|
const handler = createHandler(true);
|
|
1663
1825
|
const endHandler = createHandler(false);
|
|
1664
1826
|
element.addEventListener("scroll", handler, addEventListenerOptions);
|
|
1665
|
-
const registerScrollendEvent = instance.options.useScrollendEvent && supportsScrollend;
|
|
1666
1827
|
if (registerScrollendEvent) {
|
|
1667
1828
|
element.addEventListener("scrollend", endHandler, addEventListenerOptions);
|
|
1668
1829
|
}
|
|
@@ -1671,9 +1832,21 @@ var observeWindowOffset = (instance, cb) => {
|
|
|
1671
1832
|
if (registerScrollendEvent) {
|
|
1672
1833
|
element.removeEventListener("scrollend", endHandler);
|
|
1673
1834
|
}
|
|
1835
|
+
fallback == null ? void 0 : fallback.cancel();
|
|
1674
1836
|
};
|
|
1675
1837
|
};
|
|
1838
|
+
var observeWindowOffset = (instance, cb) => observeOffset(
|
|
1839
|
+
instance,
|
|
1840
|
+
cb,
|
|
1841
|
+
(win) => instance.options.horizontal ? win.scrollX : win.scrollY
|
|
1842
|
+
);
|
|
1676
1843
|
var measureElement = (element, entry, instance) => {
|
|
1844
|
+
var _a;
|
|
1845
|
+
if (instance.options.useCachedMeasurements) {
|
|
1846
|
+
const index = instance.indexFromElement(element);
|
|
1847
|
+
const key = instance.options.getItemKey(index);
|
|
1848
|
+
return (_a = instance.itemSizeCache.get(key)) != null ? _a : instance.options.estimateSize(index);
|
|
1849
|
+
}
|
|
1677
1850
|
if (entry == null ? void 0 : entry.borderBoxSize) {
|
|
1678
1851
|
const box = entry.borderBoxSize[0];
|
|
1679
1852
|
if (box) {
|
|
@@ -1683,19 +1856,27 @@ var measureElement = (element, entry, instance) => {
|
|
|
1683
1856
|
return size;
|
|
1684
1857
|
}
|
|
1685
1858
|
}
|
|
1859
|
+
if (!entry) {
|
|
1860
|
+
const index = instance.indexFromElement(element);
|
|
1861
|
+
const key = instance.options.getItemKey(index);
|
|
1862
|
+
const cachedSize = instance.itemSizeCache.get(key);
|
|
1863
|
+
if (cachedSize !== void 0) {
|
|
1864
|
+
return cachedSize;
|
|
1865
|
+
}
|
|
1866
|
+
}
|
|
1686
1867
|
return element[instance.options.horizontal ? "offsetWidth" : "offsetHeight"];
|
|
1687
1868
|
};
|
|
1688
|
-
var
|
|
1869
|
+
var scrollWithAdjustments = (offset, {
|
|
1689
1870
|
adjustments = 0,
|
|
1690
1871
|
behavior
|
|
1691
1872
|
}, instance) => {
|
|
1692
1873
|
var _a, _b;
|
|
1693
|
-
const toOffset = offset + adjustments;
|
|
1694
1874
|
(_b = (_a = instance.scrollElement) == null ? void 0 : _a.scrollTo) == null ? void 0 : _b.call(_a, {
|
|
1695
|
-
[instance.options.horizontal ? "left" : "top"]:
|
|
1875
|
+
[instance.options.horizontal ? "left" : "top"]: offset + adjustments,
|
|
1696
1876
|
behavior
|
|
1697
1877
|
});
|
|
1698
1878
|
};
|
|
1879
|
+
var windowScroll = scrollWithAdjustments;
|
|
1699
1880
|
var Virtualizer = class {
|
|
1700
1881
|
constructor(opts) {
|
|
1701
1882
|
this.unsubs = [];
|
|
@@ -1704,16 +1885,24 @@ var Virtualizer = class {
|
|
|
1704
1885
|
this.isScrolling = false;
|
|
1705
1886
|
this.scrollState = null;
|
|
1706
1887
|
this.measurementsCache = [];
|
|
1888
|
+
this._flatMeasurements = null;
|
|
1707
1889
|
this.itemSizeCache = /* @__PURE__ */ new Map();
|
|
1890
|
+
this.itemSizeCacheVersion = 0;
|
|
1708
1891
|
this.laneAssignments = /* @__PURE__ */ new Map();
|
|
1709
|
-
this.
|
|
1892
|
+
this.pendingMin = null;
|
|
1710
1893
|
this.prevLanes = void 0;
|
|
1711
1894
|
this.lanesChangedFlag = false;
|
|
1712
1895
|
this.lanesSettling = false;
|
|
1896
|
+
this.pendingScrollAnchor = null;
|
|
1713
1897
|
this.scrollRect = null;
|
|
1714
1898
|
this.scrollOffset = null;
|
|
1715
1899
|
this.scrollDirection = null;
|
|
1716
1900
|
this.scrollAdjustments = 0;
|
|
1901
|
+
this._iosDeferredAdjustment = 0;
|
|
1902
|
+
this._iosTouching = false;
|
|
1903
|
+
this._iosJustTouchEnded = false;
|
|
1904
|
+
this._iosTouchEndTimerId = null;
|
|
1905
|
+
this._intendedScrollOffset = null;
|
|
1717
1906
|
this.elementsCache = /* @__PURE__ */ new Map();
|
|
1718
1907
|
this.now = () => {
|
|
1719
1908
|
var _a2;
|
|
@@ -1736,8 +1925,15 @@ var Virtualizer = class {
|
|
|
1736
1925
|
const index = this.indexFromElement(node);
|
|
1737
1926
|
if (!node.isConnected) {
|
|
1738
1927
|
this.observer.unobserve(node);
|
|
1928
|
+
for (const [cacheKey, cachedNode] of this.elementsCache) {
|
|
1929
|
+
if (cachedNode === node) {
|
|
1930
|
+
this.elementsCache.delete(cacheKey);
|
|
1931
|
+
break;
|
|
1932
|
+
}
|
|
1933
|
+
}
|
|
1739
1934
|
return;
|
|
1740
1935
|
}
|
|
1936
|
+
if (!this.isIndexInRange(index)) return;
|
|
1741
1937
|
if (this.shouldMeasureDuringScroll(index)) {
|
|
1742
1938
|
this.resizeItem(
|
|
1743
1939
|
index,
|
|
@@ -1767,10 +1963,9 @@ var Virtualizer = class {
|
|
|
1767
1963
|
})();
|
|
1768
1964
|
this.range = null;
|
|
1769
1965
|
this.setOptions = (opts2) => {
|
|
1770
|
-
|
|
1771
|
-
|
|
1772
|
-
|
|
1773
|
-
this.options = __spreadValues({
|
|
1966
|
+
var _a2, _b2, _c;
|
|
1967
|
+
var _a, _b;
|
|
1968
|
+
const merged = {
|
|
1774
1969
|
debug: false,
|
|
1775
1970
|
initialOffset: 0,
|
|
1776
1971
|
overscan: 1,
|
|
@@ -1790,13 +1985,80 @@ var Virtualizer = class {
|
|
|
1790
1985
|
indexAttribute: "data-index",
|
|
1791
1986
|
initialMeasurementsCache: [],
|
|
1792
1987
|
lanes: 1,
|
|
1988
|
+
anchorTo: "start",
|
|
1989
|
+
followOnAppend: false,
|
|
1990
|
+
scrollEndThreshold: 1,
|
|
1793
1991
|
isScrollingResetDelay: 150,
|
|
1794
1992
|
enabled: true,
|
|
1795
1993
|
isRtl: false,
|
|
1796
1994
|
useScrollendEvent: false,
|
|
1797
1995
|
useAnimationFrameWithResizeObserver: false,
|
|
1798
|
-
laneAssignmentMode: "estimate"
|
|
1799
|
-
|
|
1996
|
+
laneAssignmentMode: "estimate",
|
|
1997
|
+
useCachedMeasurements: false
|
|
1998
|
+
};
|
|
1999
|
+
for (const key in opts2) {
|
|
2000
|
+
const v = opts2[key];
|
|
2001
|
+
if (v !== void 0) merged[key] = v;
|
|
2002
|
+
}
|
|
2003
|
+
const prevOptions = this.options;
|
|
2004
|
+
let anchor = null;
|
|
2005
|
+
let followOnAppend = null;
|
|
2006
|
+
let edgeKeysChanged = false;
|
|
2007
|
+
if (prevOptions !== void 0 && prevOptions.enabled && merged.enabled && merged.anchorTo === "end" && this.scrollElement !== null) {
|
|
2008
|
+
const prevCount = prevOptions.count;
|
|
2009
|
+
const nextCount = merged.count;
|
|
2010
|
+
const measurements = this.getMeasurements();
|
|
2011
|
+
const prevFirstKey = prevCount > 0 ? (_a2 = (_a = measurements[0]) == null ? void 0 : _a.key) != null ? _a2 : prevOptions.getItemKey(0) : null;
|
|
2012
|
+
const prevLastKey = prevCount > 0 ? (_b2 = (_b = measurements[prevCount - 1]) == null ? void 0 : _b.key) != null ? _b2 : prevOptions.getItemKey(prevCount - 1) : null;
|
|
2013
|
+
const didCountChange = nextCount !== prevCount;
|
|
2014
|
+
const didEdgeKeysChange = didCountChange || prevCount > 0 && nextCount > 0 && (merged.getItemKey(0) !== prevFirstKey || merged.getItemKey(nextCount - 1) !== prevLastKey);
|
|
2015
|
+
if (didEdgeKeysChange) {
|
|
2016
|
+
edgeKeysChanged = true;
|
|
2017
|
+
const item = prevCount > 0 ? (_c = this.getVirtualItemForOffset(this.getScrollOffset())) != null ? _c : measurements[0] : null;
|
|
2018
|
+
if (item) {
|
|
2019
|
+
anchor = [item.key, this.getScrollOffset() - item.start];
|
|
2020
|
+
}
|
|
2021
|
+
const behavior = merged.followOnAppend === true ? "auto" : merged.followOnAppend || null;
|
|
2022
|
+
if (behavior && nextCount > prevCount && this.isAtEnd(prevOptions.scrollEndThreshold) && (prevCount === 0 || merged.getItemKey(nextCount - 1) !== prevLastKey)) {
|
|
2023
|
+
followOnAppend = behavior;
|
|
2024
|
+
}
|
|
2025
|
+
}
|
|
2026
|
+
}
|
|
2027
|
+
this.options = merged;
|
|
2028
|
+
if (edgeKeysChanged) {
|
|
2029
|
+
this.pendingMin = 0;
|
|
2030
|
+
this.itemSizeCacheVersion++;
|
|
2031
|
+
}
|
|
2032
|
+
let anchorResolved = false;
|
|
2033
|
+
let anchorDelta = 0;
|
|
2034
|
+
if (anchor && this.scrollOffset !== null) {
|
|
2035
|
+
const [anchorKey, anchorOffset] = anchor;
|
|
2036
|
+
const newMeasurements = this.getMeasurements();
|
|
2037
|
+
const { count, getItemKey } = this.options;
|
|
2038
|
+
let idx = 0;
|
|
2039
|
+
while (idx < count && getItemKey(idx) !== anchorKey) {
|
|
2040
|
+
idx++;
|
|
2041
|
+
}
|
|
2042
|
+
if (idx < count) {
|
|
2043
|
+
const anchorItem = newMeasurements[idx];
|
|
2044
|
+
if (anchorItem) {
|
|
2045
|
+
const newOffset = Math.max(0, anchorItem.start + anchorOffset);
|
|
2046
|
+
if (newOffset !== this.scrollOffset) {
|
|
2047
|
+
anchorDelta = newOffset - this.scrollOffset;
|
|
2048
|
+
this.scrollOffset = newOffset;
|
|
2049
|
+
anchorResolved = true;
|
|
2050
|
+
}
|
|
2051
|
+
}
|
|
2052
|
+
}
|
|
2053
|
+
}
|
|
2054
|
+
if (anchorResolved || followOnAppend) {
|
|
2055
|
+
this.pendingScrollAnchor = [
|
|
2056
|
+
anchorResolved ? anchor[0] : null,
|
|
2057
|
+
anchorResolved ? anchor[1] : 0,
|
|
2058
|
+
followOnAppend,
|
|
2059
|
+
anchorDelta
|
|
2060
|
+
];
|
|
2061
|
+
}
|
|
1800
2062
|
};
|
|
1801
2063
|
this.notify = (sync) => {
|
|
1802
2064
|
var _a, _b;
|
|
@@ -1833,6 +2095,11 @@ var Virtualizer = class {
|
|
|
1833
2095
|
this.rafId = null;
|
|
1834
2096
|
}
|
|
1835
2097
|
this.scrollState = null;
|
|
2098
|
+
this.isScrolling = false;
|
|
2099
|
+
this.scrollDirection = null;
|
|
2100
|
+
this._iosDeferredAdjustment = 0;
|
|
2101
|
+
this._iosTouching = false;
|
|
2102
|
+
this._iosJustTouchEnded = false;
|
|
1836
2103
|
this.scrollElement = null;
|
|
1837
2104
|
this.targetWindow = null;
|
|
1838
2105
|
};
|
|
@@ -1868,21 +2135,110 @@ var Virtualizer = class {
|
|
|
1868
2135
|
);
|
|
1869
2136
|
this.unsubs.push(
|
|
1870
2137
|
this.options.observeElementOffset(this, (offset, isScrolling) => {
|
|
2138
|
+
if (isScrolling && this._intendedScrollOffset === null && offset === this.scrollOffset) {
|
|
2139
|
+
return;
|
|
2140
|
+
}
|
|
2141
|
+
if (this._intendedScrollOffset !== null && Math.abs(offset - this._intendedScrollOffset) < 1.5) {
|
|
2142
|
+
offset = this._intendedScrollOffset;
|
|
2143
|
+
}
|
|
2144
|
+
this._intendedScrollOffset = null;
|
|
1871
2145
|
this.scrollAdjustments = 0;
|
|
1872
|
-
|
|
2146
|
+
const prevOffset = this.getScrollOffset();
|
|
2147
|
+
this.scrollDirection = isScrolling ? prevOffset === offset ? this.scrollDirection : prevOffset < offset ? "forward" : "backward" : null;
|
|
1873
2148
|
this.scrollOffset = offset;
|
|
1874
2149
|
this.isScrolling = isScrolling;
|
|
2150
|
+
this._flushIosDeferredIfReady();
|
|
1875
2151
|
if (this.scrollState) {
|
|
1876
2152
|
this.scheduleScrollReconcile();
|
|
1877
2153
|
}
|
|
1878
2154
|
this.maybeNotify();
|
|
1879
2155
|
})
|
|
1880
2156
|
);
|
|
2157
|
+
if ("addEventListener" in this.scrollElement) {
|
|
2158
|
+
const scrollEl = this.scrollElement;
|
|
2159
|
+
const onTouchStart = () => {
|
|
2160
|
+
this._iosTouching = true;
|
|
2161
|
+
this._iosJustTouchEnded = false;
|
|
2162
|
+
if (this._iosTouchEndTimerId !== null && this.targetWindow != null) {
|
|
2163
|
+
this.targetWindow.clearTimeout(this._iosTouchEndTimerId);
|
|
2164
|
+
this._iosTouchEndTimerId = null;
|
|
2165
|
+
}
|
|
2166
|
+
};
|
|
2167
|
+
const onTouchEnd = () => {
|
|
2168
|
+
this._iosTouching = false;
|
|
2169
|
+
if (!isIOSWebKit() || this.targetWindow == null) {
|
|
2170
|
+
return;
|
|
2171
|
+
}
|
|
2172
|
+
this._iosJustTouchEnded = true;
|
|
2173
|
+
this._iosTouchEndTimerId = this.targetWindow.setTimeout(() => {
|
|
2174
|
+
this._iosJustTouchEnded = false;
|
|
2175
|
+
this._iosTouchEndTimerId = null;
|
|
2176
|
+
this._flushIosDeferredIfReady();
|
|
2177
|
+
}, 150);
|
|
2178
|
+
};
|
|
2179
|
+
scrollEl.addEventListener(
|
|
2180
|
+
"touchstart",
|
|
2181
|
+
onTouchStart,
|
|
2182
|
+
addEventListenerOptions
|
|
2183
|
+
);
|
|
2184
|
+
scrollEl.addEventListener(
|
|
2185
|
+
"touchend",
|
|
2186
|
+
onTouchEnd,
|
|
2187
|
+
addEventListenerOptions
|
|
2188
|
+
);
|
|
2189
|
+
this.unsubs.push(() => {
|
|
2190
|
+
scrollEl.removeEventListener("touchstart", onTouchStart);
|
|
2191
|
+
scrollEl.removeEventListener("touchend", onTouchEnd);
|
|
2192
|
+
if (this._iosTouchEndTimerId !== null && this.targetWindow != null) {
|
|
2193
|
+
this.targetWindow.clearTimeout(this._iosTouchEndTimerId);
|
|
2194
|
+
this._iosTouchEndTimerId = null;
|
|
2195
|
+
}
|
|
2196
|
+
});
|
|
2197
|
+
}
|
|
1881
2198
|
this._scrollToOffset(this.getScrollOffset(), {
|
|
1882
2199
|
adjustments: void 0,
|
|
1883
2200
|
behavior: void 0
|
|
1884
2201
|
});
|
|
1885
2202
|
}
|
|
2203
|
+
const anchor = this.pendingScrollAnchor;
|
|
2204
|
+
this.pendingScrollAnchor = null;
|
|
2205
|
+
if (anchor && this.scrollElement && this.options.enabled) {
|
|
2206
|
+
const [key, _offset, followOnAppend, anchorDelta] = anchor;
|
|
2207
|
+
if (key !== null && !followOnAppend) {
|
|
2208
|
+
if (isIOSWebKit() && (this.isScrolling || this._iosTouching || this._iosJustTouchEnded)) {
|
|
2209
|
+
if (anchorDelta !== 0) {
|
|
2210
|
+
this._iosDeferredAdjustment += anchorDelta;
|
|
2211
|
+
}
|
|
2212
|
+
} else {
|
|
2213
|
+
this._scrollToOffset(this.getScrollOffset(), {
|
|
2214
|
+
adjustments: void 0,
|
|
2215
|
+
behavior: void 0
|
|
2216
|
+
});
|
|
2217
|
+
}
|
|
2218
|
+
}
|
|
2219
|
+
if (followOnAppend) {
|
|
2220
|
+
this.scrollToEnd({ behavior: followOnAppend });
|
|
2221
|
+
}
|
|
2222
|
+
}
|
|
2223
|
+
};
|
|
2224
|
+
this._flushIosDeferredIfReady = () => {
|
|
2225
|
+
if (this._iosDeferredAdjustment === 0) return;
|
|
2226
|
+
if (this.isScrolling) return;
|
|
2227
|
+
if (this._iosTouching) return;
|
|
2228
|
+
if (this._iosJustTouchEnded) return;
|
|
2229
|
+
const cur = this.getScrollOffset();
|
|
2230
|
+
const max = this.getMaxScrollOffset();
|
|
2231
|
+
if (cur < 0 || cur > max) return;
|
|
2232
|
+
if (this._iosDeferredAdjustment < 0 && cur >= max - 1) {
|
|
2233
|
+
this._iosDeferredAdjustment = 0;
|
|
2234
|
+
return;
|
|
2235
|
+
}
|
|
2236
|
+
const delta = this._iosDeferredAdjustment;
|
|
2237
|
+
this._iosDeferredAdjustment = 0;
|
|
2238
|
+
this._scrollToOffset(cur, {
|
|
2239
|
+
adjustments: this.scrollAdjustments += delta,
|
|
2240
|
+
behavior: void 0
|
|
2241
|
+
});
|
|
1886
2242
|
};
|
|
1887
2243
|
this.rafId = null;
|
|
1888
2244
|
this.getSize = () => {
|
|
@@ -1903,33 +2259,6 @@ var Virtualizer = class {
|
|
|
1903
2259
|
this.scrollOffset = (_a = this.scrollOffset) != null ? _a : typeof this.options.initialOffset === "function" ? this.options.initialOffset() : this.options.initialOffset;
|
|
1904
2260
|
return this.scrollOffset;
|
|
1905
2261
|
};
|
|
1906
|
-
this.getFurthestMeasurement = (measurements, index) => {
|
|
1907
|
-
const furthestMeasurementsFound = /* @__PURE__ */ new Map();
|
|
1908
|
-
const furthestMeasurements = /* @__PURE__ */ new Map();
|
|
1909
|
-
for (let m = index - 1; m >= 0; m--) {
|
|
1910
|
-
const measurement = measurements[m];
|
|
1911
|
-
if (furthestMeasurementsFound.has(measurement.lane)) {
|
|
1912
|
-
continue;
|
|
1913
|
-
}
|
|
1914
|
-
const previousFurthestMeasurement = furthestMeasurements.get(
|
|
1915
|
-
measurement.lane
|
|
1916
|
-
);
|
|
1917
|
-
if (previousFurthestMeasurement == null || measurement.end > previousFurthestMeasurement.end) {
|
|
1918
|
-
furthestMeasurements.set(measurement.lane, measurement);
|
|
1919
|
-
} else if (measurement.end < previousFurthestMeasurement.end) {
|
|
1920
|
-
furthestMeasurementsFound.set(measurement.lane, true);
|
|
1921
|
-
}
|
|
1922
|
-
if (furthestMeasurementsFound.size === this.options.lanes) {
|
|
1923
|
-
break;
|
|
1924
|
-
}
|
|
1925
|
-
}
|
|
1926
|
-
return furthestMeasurements.size === this.options.lanes ? Array.from(furthestMeasurements.values()).sort((a, b) => {
|
|
1927
|
-
if (a.end === b.end) {
|
|
1928
|
-
return a.index - b.index;
|
|
1929
|
-
}
|
|
1930
|
-
return a.end - b.end;
|
|
1931
|
-
})[0] : void 0;
|
|
1932
|
-
};
|
|
1933
2262
|
this.getMeasurementOptions = memo(
|
|
1934
2263
|
() => [
|
|
1935
2264
|
this.options.count,
|
|
@@ -1938,15 +2267,16 @@ var Virtualizer = class {
|
|
|
1938
2267
|
this.options.getItemKey,
|
|
1939
2268
|
this.options.enabled,
|
|
1940
2269
|
this.options.lanes,
|
|
1941
|
-
this.options.laneAssignmentMode
|
|
2270
|
+
this.options.laneAssignmentMode,
|
|
2271
|
+
this.options.gap
|
|
1942
2272
|
],
|
|
1943
|
-
(count, paddingStart, scrollMargin, getItemKey, enabled, lanes, laneAssignmentMode) => {
|
|
2273
|
+
(count, paddingStart, scrollMargin, getItemKey, enabled, lanes, laneAssignmentMode, gap) => {
|
|
1944
2274
|
const lanesChanged = this.prevLanes !== void 0 && this.prevLanes !== lanes;
|
|
1945
2275
|
if (lanesChanged) {
|
|
1946
2276
|
this.lanesChangedFlag = true;
|
|
1947
2277
|
}
|
|
1948
2278
|
this.prevLanes = lanes;
|
|
1949
|
-
this.
|
|
2279
|
+
this.pendingMin = null;
|
|
1950
2280
|
return {
|
|
1951
2281
|
count,
|
|
1952
2282
|
paddingStart,
|
|
@@ -1954,15 +2284,17 @@ var Virtualizer = class {
|
|
|
1954
2284
|
getItemKey,
|
|
1955
2285
|
enabled,
|
|
1956
2286
|
lanes,
|
|
1957
|
-
laneAssignmentMode
|
|
2287
|
+
laneAssignmentMode,
|
|
2288
|
+
gap
|
|
1958
2289
|
};
|
|
1959
2290
|
},
|
|
1960
2291
|
{
|
|
1961
2292
|
key: false
|
|
1962
2293
|
}
|
|
1963
2294
|
);
|
|
2295
|
+
this.isIndexInRange = (index) => index >= 0 && index < this.options.count;
|
|
1964
2296
|
this.getMeasurements = memo(
|
|
1965
|
-
() => [this.getMeasurementOptions(), this.
|
|
2297
|
+
() => [this.getMeasurementOptions(), this.itemSizeCacheVersion],
|
|
1966
2298
|
({
|
|
1967
2299
|
count,
|
|
1968
2300
|
paddingStart,
|
|
@@ -1970,8 +2302,11 @@ var Virtualizer = class {
|
|
|
1970
2302
|
getItemKey,
|
|
1971
2303
|
enabled,
|
|
1972
2304
|
lanes,
|
|
1973
|
-
laneAssignmentMode
|
|
1974
|
-
|
|
2305
|
+
laneAssignmentMode,
|
|
2306
|
+
gap
|
|
2307
|
+
}, _itemSizeCacheVersion) => {
|
|
2308
|
+
var _a;
|
|
2309
|
+
const itemSizeCache = this.itemSizeCache;
|
|
1975
2310
|
if (!enabled) {
|
|
1976
2311
|
this.measurementsCache = [];
|
|
1977
2312
|
this.itemSizeCache.clear();
|
|
@@ -1991,7 +2326,7 @@ var Virtualizer = class {
|
|
|
1991
2326
|
this.measurementsCache = [];
|
|
1992
2327
|
this.itemSizeCache.clear();
|
|
1993
2328
|
this.laneAssignments.clear();
|
|
1994
|
-
this.
|
|
2329
|
+
this.pendingMin = null;
|
|
1995
2330
|
}
|
|
1996
2331
|
if (this.measurementsCache.length === 0 && !this.lanesSettling) {
|
|
1997
2332
|
this.measurementsCache = this.options.initialMeasurementsCache;
|
|
@@ -1999,19 +2334,51 @@ var Virtualizer = class {
|
|
|
1999
2334
|
this.itemSizeCache.set(item.key, item.size);
|
|
2000
2335
|
});
|
|
2001
2336
|
}
|
|
2002
|
-
const min = this.lanesSettling ? 0 : this.
|
|
2003
|
-
this.
|
|
2337
|
+
const min = this.lanesSettling ? 0 : (_a = this.pendingMin) != null ? _a : 0;
|
|
2338
|
+
this.pendingMin = null;
|
|
2004
2339
|
if (this.lanesSettling && this.measurementsCache.length === count) {
|
|
2005
2340
|
this.lanesSettling = false;
|
|
2006
2341
|
}
|
|
2342
|
+
if (lanes === 1) {
|
|
2343
|
+
const need = count * 2;
|
|
2344
|
+
let flat = this._flatMeasurements;
|
|
2345
|
+
if (!flat || flat.length < need) {
|
|
2346
|
+
const next = new Float64Array(need);
|
|
2347
|
+
if (flat && min > 0) next.set(flat.subarray(0, min * 2));
|
|
2348
|
+
flat = next;
|
|
2349
|
+
this._flatMeasurements = flat;
|
|
2350
|
+
}
|
|
2351
|
+
let runningStart;
|
|
2352
|
+
if (min === 0) {
|
|
2353
|
+
runningStart = paddingStart + scrollMargin;
|
|
2354
|
+
} else {
|
|
2355
|
+
const prevIdx = min - 1;
|
|
2356
|
+
runningStart = flat[prevIdx * 2] + flat[prevIdx * 2 + 1] + gap;
|
|
2357
|
+
}
|
|
2358
|
+
for (let i = min; i < count; i++) {
|
|
2359
|
+
const key = getItemKey(i);
|
|
2360
|
+
const measuredSize = itemSizeCache.get(key);
|
|
2361
|
+
const size = typeof measuredSize === "number" ? measuredSize : this.options.estimateSize(i);
|
|
2362
|
+
flat[i * 2] = runningStart;
|
|
2363
|
+
flat[i * 2 + 1] = size;
|
|
2364
|
+
runningStart += size + gap;
|
|
2365
|
+
}
|
|
2366
|
+
const view = createLazyMeasurementsView(count, flat, getItemKey);
|
|
2367
|
+
this.measurementsCache = view;
|
|
2368
|
+
return view;
|
|
2369
|
+
}
|
|
2007
2370
|
const measurements = this.measurementsCache.slice(0, min);
|
|
2008
2371
|
const laneLastIndex = new Array(lanes).fill(
|
|
2009
2372
|
void 0
|
|
2010
2373
|
);
|
|
2374
|
+
const laneEnds = new Float64Array(lanes);
|
|
2375
|
+
let filledLanes = 0;
|
|
2011
2376
|
for (let m = 0; m < min; m++) {
|
|
2012
2377
|
const item = measurements[m];
|
|
2013
2378
|
if (item) {
|
|
2379
|
+
if (laneLastIndex[item.lane] === void 0) filledLanes++;
|
|
2014
2380
|
laneLastIndex[item.lane] = m;
|
|
2381
|
+
laneEnds[item.lane] = item.end;
|
|
2015
2382
|
}
|
|
2016
2383
|
}
|
|
2017
2384
|
for (let i = min; i < count; i++) {
|
|
@@ -2024,12 +2391,28 @@ var Virtualizer = class {
|
|
|
2024
2391
|
lane = cachedLane;
|
|
2025
2392
|
const prevIndex = laneLastIndex[lane];
|
|
2026
2393
|
const prevInLane = prevIndex !== void 0 ? measurements[prevIndex] : void 0;
|
|
2027
|
-
start = prevInLane ? prevInLane.end +
|
|
2394
|
+
start = prevInLane ? prevInLane.end + gap : paddingStart + scrollMargin;
|
|
2395
|
+
} else if (filledLanes === lanes) {
|
|
2396
|
+
let bestLane = 0;
|
|
2397
|
+
let bestEnd = laneEnds[0];
|
|
2398
|
+
let bestIdx = laneLastIndex[0];
|
|
2399
|
+
for (let l = 1; l < lanes; l++) {
|
|
2400
|
+
const e = laneEnds[l];
|
|
2401
|
+
if (e < bestEnd || e === bestEnd && laneLastIndex[l] < bestIdx) {
|
|
2402
|
+
bestLane = l;
|
|
2403
|
+
bestEnd = e;
|
|
2404
|
+
bestIdx = laneLastIndex[l];
|
|
2405
|
+
}
|
|
2406
|
+
}
|
|
2407
|
+
lane = bestLane;
|
|
2408
|
+
start = bestEnd + gap;
|
|
2409
|
+
if (shouldCacheLane) {
|
|
2410
|
+
this.laneAssignments.set(i, lane);
|
|
2411
|
+
}
|
|
2028
2412
|
} else {
|
|
2029
|
-
|
|
2030
|
-
start =
|
|
2031
|
-
|
|
2032
|
-
if (this.options.lanes > 1 && shouldCacheLane) {
|
|
2413
|
+
lane = i % this.options.lanes;
|
|
2414
|
+
start = paddingStart + scrollMargin;
|
|
2415
|
+
if (shouldCacheLane) {
|
|
2033
2416
|
this.laneAssignments.set(i, lane);
|
|
2034
2417
|
}
|
|
2035
2418
|
}
|
|
@@ -2044,7 +2427,9 @@ var Virtualizer = class {
|
|
|
2044
2427
|
key,
|
|
2045
2428
|
lane
|
|
2046
2429
|
};
|
|
2430
|
+
if (laneLastIndex[lane] === void 0) filledLanes++;
|
|
2047
2431
|
laneLastIndex[lane] = i;
|
|
2432
|
+
laneEnds[lane] = end;
|
|
2048
2433
|
}
|
|
2049
2434
|
this.measurementsCache = measurements;
|
|
2050
2435
|
return measurements;
|
|
@@ -2062,12 +2447,20 @@ var Virtualizer = class {
|
|
|
2062
2447
|
this.options.lanes
|
|
2063
2448
|
],
|
|
2064
2449
|
(measurements, outerSize, scrollOffset, lanes) => {
|
|
2065
|
-
|
|
2450
|
+
if (measurements.length === 0 || outerSize === 0) {
|
|
2451
|
+
this.range = null;
|
|
2452
|
+
return null;
|
|
2453
|
+
}
|
|
2454
|
+
this.range = calculateRangeImpl(
|
|
2066
2455
|
measurements,
|
|
2067
2456
|
outerSize,
|
|
2068
2457
|
scrollOffset,
|
|
2069
|
-
lanes
|
|
2070
|
-
|
|
2458
|
+
lanes,
|
|
2459
|
+
// Pass the typed array so binary search + forward-walk can read
|
|
2460
|
+
// start/end directly from Float64Array, skipping the Proxy traps.
|
|
2461
|
+
lanes === 1 && this._flatMeasurements != null ? this._flatMeasurements : null
|
|
2462
|
+
);
|
|
2463
|
+
return this.range;
|
|
2071
2464
|
},
|
|
2072
2465
|
{
|
|
2073
2466
|
key: "calculateRange",
|
|
@@ -2148,6 +2541,7 @@ var Virtualizer = class {
|
|
|
2148
2541
|
return;
|
|
2149
2542
|
}
|
|
2150
2543
|
const index = this.indexFromElement(node);
|
|
2544
|
+
if (!this.isIndexInRange(index)) return;
|
|
2151
2545
|
const key = this.options.getItemKey(index);
|
|
2152
2546
|
const prevNode = this.elementsCache.get(key);
|
|
2153
2547
|
if (prevNode !== node) {
|
|
@@ -2162,25 +2556,74 @@ var Virtualizer = class {
|
|
|
2162
2556
|
}
|
|
2163
2557
|
};
|
|
2164
2558
|
this.resizeItem = (index, size) => {
|
|
2165
|
-
var _a2;
|
|
2166
|
-
var _a;
|
|
2167
|
-
|
|
2168
|
-
|
|
2169
|
-
|
|
2559
|
+
var _a2, _b2;
|
|
2560
|
+
var _a, _b;
|
|
2561
|
+
if (!this.isIndexInRange(index)) return;
|
|
2562
|
+
let cachedSize;
|
|
2563
|
+
let itemStart;
|
|
2564
|
+
let key;
|
|
2565
|
+
const flat = this._flatMeasurements;
|
|
2566
|
+
if (this.options.lanes === 1 && flat !== null) {
|
|
2567
|
+
key = this.options.getItemKey(index);
|
|
2568
|
+
itemStart = flat[index * 2];
|
|
2569
|
+
cachedSize = flat[index * 2 + 1];
|
|
2570
|
+
} else {
|
|
2571
|
+
const item = this.measurementsCache[index];
|
|
2572
|
+
if (!item) return;
|
|
2573
|
+
key = item.key;
|
|
2574
|
+
itemStart = item.start;
|
|
2575
|
+
cachedSize = item.size;
|
|
2576
|
+
}
|
|
2577
|
+
const itemSize = (_a2 = this.itemSizeCache.get(key)) != null ? _a2 : cachedSize;
|
|
2170
2578
|
const delta = size - itemSize;
|
|
2171
2579
|
if (delta !== 0) {
|
|
2172
|
-
|
|
2173
|
-
|
|
2174
|
-
|
|
2175
|
-
|
|
2176
|
-
|
|
2177
|
-
|
|
2178
|
-
|
|
2179
|
-
|
|
2580
|
+
const wasAtEnd = this.options.anchorTo === "end" && ((_a = this.scrollState) == null ? void 0 : _a.behavior) !== "smooth" && this.getVirtualDistanceFromEnd() <= this.options.scrollEndThreshold;
|
|
2581
|
+
const prevTotalSize = wasAtEnd ? this.getTotalSize() : 0;
|
|
2582
|
+
const scrollOffsetWithAdj = this.getScrollOffset() + this.scrollAdjustments;
|
|
2583
|
+
const isFirstMeasure = !this.itemSizeCache.has(key);
|
|
2584
|
+
const defaultShouldAdjust = isFirstMeasure ? (
|
|
2585
|
+
// First measurement: compensate any item whose top sits above the
|
|
2586
|
+
// fold — the estimate→actual delta must be corrected regardless of
|
|
2587
|
+
// scroll direction, since the whole estimated block was above it.
|
|
2588
|
+
itemStart < scrollOffsetWithAdj
|
|
2589
|
+
) : (
|
|
2590
|
+
// Re-measurement: only compensate an item that is ENTIRELY above the
|
|
2591
|
+
// fold. An item that merely *spans* the fold (top above, bottom
|
|
2592
|
+
// below — e.g. a streaming chat message growing at its bottom)
|
|
2593
|
+
// changes size *below* the anchor point, so shifting scrollTop by the
|
|
2594
|
+
// delta would drag the viewport downward on every growth (#1218).
|
|
2595
|
+
// Also skip during backward scroll to avoid the "items jump while
|
|
2596
|
+
// scrolling up" cascade.
|
|
2597
|
+
itemStart + itemSize <= scrollOffsetWithAdj && this.scrollDirection !== "backward"
|
|
2598
|
+
);
|
|
2599
|
+
const shouldAdjustScroll = ((_b = this.scrollState) == null ? void 0 : _b.behavior) !== "smooth" && (this.shouldAdjustScrollPositionOnItemSizeChange !== void 0 ? this.shouldAdjustScrollPositionOnItemSizeChange(
|
|
2600
|
+
// The callback expects a VirtualItem; build one lazily only
|
|
2601
|
+
// when the consumer actually supplied a custom predicate.
|
|
2602
|
+
(_b2 = this.measurementsCache[index]) != null ? _b2 : {
|
|
2603
|
+
index,
|
|
2604
|
+
key,
|
|
2605
|
+
start: itemStart,
|
|
2606
|
+
size: cachedSize,
|
|
2607
|
+
end: itemStart + cachedSize,
|
|
2608
|
+
lane: 0
|
|
2609
|
+
},
|
|
2610
|
+
delta,
|
|
2611
|
+
this
|
|
2612
|
+
) : defaultShouldAdjust);
|
|
2613
|
+
if (this.pendingMin === null || index < this.pendingMin) {
|
|
2614
|
+
this.pendingMin = index;
|
|
2615
|
+
}
|
|
2616
|
+
this.itemSizeCache.set(key, size);
|
|
2617
|
+
this.itemSizeCacheVersion++;
|
|
2618
|
+
let adjustedSync = false;
|
|
2619
|
+
if (wasAtEnd) {
|
|
2620
|
+
adjustedSync = this.applyScrollAdjustment(
|
|
2621
|
+
this.getTotalSize() - prevTotalSize
|
|
2622
|
+
);
|
|
2623
|
+
} else if (shouldAdjustScroll) {
|
|
2624
|
+
adjustedSync = this.applyScrollAdjustment(delta);
|
|
2180
2625
|
}
|
|
2181
|
-
this.
|
|
2182
|
-
this.itemSizeCache = new Map(this.itemSizeCache.set(item.key, size));
|
|
2183
|
-
this.notify(false);
|
|
2626
|
+
this.notify(adjustedSync);
|
|
2184
2627
|
}
|
|
2185
2628
|
};
|
|
2186
2629
|
this.getVirtualItems = memo(
|
|
@@ -2204,14 +2647,15 @@ var Virtualizer = class {
|
|
|
2204
2647
|
if (measurements.length === 0) {
|
|
2205
2648
|
return void 0;
|
|
2206
2649
|
}
|
|
2207
|
-
|
|
2208
|
-
|
|
2209
|
-
|
|
2210
|
-
|
|
2211
|
-
|
|
2212
|
-
|
|
2213
|
-
|
|
2650
|
+
const flat = this._flatMeasurements;
|
|
2651
|
+
const useFlat = this.options.lanes === 1 && flat != null;
|
|
2652
|
+
const idx = findNearestBinarySearch(
|
|
2653
|
+
0,
|
|
2654
|
+
measurements.length - 1,
|
|
2655
|
+
useFlat ? (i) => flat[i * 2] : (i) => notUndefined(measurements[i]).start,
|
|
2656
|
+
offset
|
|
2214
2657
|
);
|
|
2658
|
+
return notUndefined(measurements[idx]);
|
|
2215
2659
|
};
|
|
2216
2660
|
this.getMaxScrollOffset = () => {
|
|
2217
2661
|
if (!this.scrollElement) return 0;
|
|
@@ -2222,6 +2666,18 @@ var Virtualizer = class {
|
|
|
2222
2666
|
return this.options.horizontal ? doc.scrollWidth - this.scrollElement.innerWidth : doc.scrollHeight - this.scrollElement.innerHeight;
|
|
2223
2667
|
}
|
|
2224
2668
|
};
|
|
2669
|
+
this.getVirtualDistanceFromEnd = () => {
|
|
2670
|
+
return Math.max(
|
|
2671
|
+
this.getTotalSize() - this.getSize() - this.getScrollOffset(),
|
|
2672
|
+
0
|
|
2673
|
+
);
|
|
2674
|
+
};
|
|
2675
|
+
this.getDistanceFromEnd = () => {
|
|
2676
|
+
return Math.max(this.getMaxScrollOffset() - this.getScrollOffset(), 0);
|
|
2677
|
+
};
|
|
2678
|
+
this.isAtEnd = (threshold = this.options.scrollEndThreshold) => {
|
|
2679
|
+
return this.getDistanceFromEnd() <= threshold;
|
|
2680
|
+
};
|
|
2225
2681
|
this.getOffsetForAlignment = (toOffset, align, itemSize = 0) => {
|
|
2226
2682
|
if (!this.scrollElement) return 0;
|
|
2227
2683
|
const size = this.getSize();
|
|
@@ -2262,6 +2718,7 @@ var Virtualizer = class {
|
|
|
2262
2718
|
];
|
|
2263
2719
|
};
|
|
2264
2720
|
this.scrollToOffset = (toOffset, { align = "start", behavior = "auto" } = {}) => {
|
|
2721
|
+
this._iosDeferredAdjustment = 0;
|
|
2265
2722
|
const offset = this.getOffsetForAlignment(toOffset, align);
|
|
2266
2723
|
const now = this.now();
|
|
2267
2724
|
this.scrollState = {
|
|
@@ -2279,6 +2736,7 @@ var Virtualizer = class {
|
|
|
2279
2736
|
align: initialAlign = "auto",
|
|
2280
2737
|
behavior = "auto"
|
|
2281
2738
|
} = {}) => {
|
|
2739
|
+
this._iosDeferredAdjustment = 0;
|
|
2282
2740
|
index = Math.max(0, Math.min(index, this.options.count - 1));
|
|
2283
2741
|
const offsetInfo = this.getOffsetForIndex(index, initialAlign);
|
|
2284
2742
|
if (!offsetInfo) {
|
|
@@ -2311,6 +2769,18 @@ var Virtualizer = class {
|
|
|
2311
2769
|
this._scrollToOffset(offset, { adjustments: void 0, behavior });
|
|
2312
2770
|
this.scheduleScrollReconcile();
|
|
2313
2771
|
};
|
|
2772
|
+
this.scrollToEnd = ({ behavior = "auto" } = {}) => {
|
|
2773
|
+
if (this.options.count > 0) {
|
|
2774
|
+
this.scrollToIndex(this.options.count - 1, {
|
|
2775
|
+
align: "end",
|
|
2776
|
+
behavior
|
|
2777
|
+
});
|
|
2778
|
+
return;
|
|
2779
|
+
}
|
|
2780
|
+
this.scrollToOffset(Math.max(this.getTotalSize() - this.getSize(), 0), {
|
|
2781
|
+
behavior
|
|
2782
|
+
});
|
|
2783
|
+
};
|
|
2314
2784
|
this.getTotalSize = () => {
|
|
2315
2785
|
var _a2;
|
|
2316
2786
|
var _a;
|
|
@@ -2319,7 +2789,13 @@ var Virtualizer = class {
|
|
|
2319
2789
|
if (measurements.length === 0) {
|
|
2320
2790
|
end = this.options.paddingStart;
|
|
2321
2791
|
} else if (this.options.lanes === 1) {
|
|
2322
|
-
|
|
2792
|
+
const lastIdx = measurements.length - 1;
|
|
2793
|
+
const flat = this._flatMeasurements;
|
|
2794
|
+
if (flat != null) {
|
|
2795
|
+
end = flat[lastIdx * 2] + flat[lastIdx * 2 + 1];
|
|
2796
|
+
} else {
|
|
2797
|
+
end = (_a2 = (_a = measurements[lastIdx]) == null ? void 0 : _a.end) != null ? _a2 : 0;
|
|
2798
|
+
}
|
|
2323
2799
|
} else {
|
|
2324
2800
|
const endByLane = Array(this.options.lanes).fill(null);
|
|
2325
2801
|
let endIndex = measurements.length - 1;
|
|
@@ -2337,19 +2813,65 @@ var Virtualizer = class {
|
|
|
2337
2813
|
0
|
|
2338
2814
|
);
|
|
2339
2815
|
};
|
|
2816
|
+
this.takeSnapshot = () => {
|
|
2817
|
+
const snapshot = [];
|
|
2818
|
+
if (this.itemSizeCache.size === 0) return snapshot;
|
|
2819
|
+
const m = this.getMeasurements();
|
|
2820
|
+
for (const item of m) {
|
|
2821
|
+
if (item && this.itemSizeCache.has(item.key)) {
|
|
2822
|
+
snapshot.push({
|
|
2823
|
+
index: item.index,
|
|
2824
|
+
key: item.key,
|
|
2825
|
+
start: item.start,
|
|
2826
|
+
size: item.size,
|
|
2827
|
+
end: item.end,
|
|
2828
|
+
lane: item.lane
|
|
2829
|
+
});
|
|
2830
|
+
}
|
|
2831
|
+
}
|
|
2832
|
+
return snapshot;
|
|
2833
|
+
};
|
|
2340
2834
|
this._scrollToOffset = (offset, {
|
|
2341
2835
|
adjustments,
|
|
2342
2836
|
behavior
|
|
2343
2837
|
}) => {
|
|
2838
|
+
this._intendedScrollOffset = offset + (adjustments != null ? adjustments : 0);
|
|
2344
2839
|
this.options.scrollToFn(offset, { behavior, adjustments }, this);
|
|
2345
2840
|
};
|
|
2346
2841
|
this.measure = () => {
|
|
2347
|
-
this.
|
|
2348
|
-
this.
|
|
2842
|
+
this.pendingMin = null;
|
|
2843
|
+
this.itemSizeCache.clear();
|
|
2844
|
+
this.laneAssignments.clear();
|
|
2845
|
+
this.itemSizeCacheVersion++;
|
|
2349
2846
|
this.notify(false);
|
|
2350
2847
|
};
|
|
2351
2848
|
this.setOptions(opts);
|
|
2352
2849
|
}
|
|
2850
|
+
// Returns `true` when it performed a synchronous `scrollTop` write this
|
|
2851
|
+
// tick, `false` when the delta was zero or the write was deferred (iOS).
|
|
2852
|
+
// `resizeItem` uses that to decide whether the follow-up `notify` must be
|
|
2853
|
+
// synchronous so the grown transforms commit in the same paint (#1227).
|
|
2854
|
+
applyScrollAdjustment(delta, behavior) {
|
|
2855
|
+
if (delta === 0) return false;
|
|
2856
|
+
if (this.options.debug) {
|
|
2857
|
+
console.info("correction", delta);
|
|
2858
|
+
}
|
|
2859
|
+
if (isIOSWebKit() && (this.isScrolling || this._iosTouching || this._iosJustTouchEnded)) {
|
|
2860
|
+
this._iosDeferredAdjustment += delta;
|
|
2861
|
+
return false;
|
|
2862
|
+
} else {
|
|
2863
|
+
this._scrollToOffset(this.getScrollOffset(), {
|
|
2864
|
+
adjustments: this.scrollAdjustments += delta,
|
|
2865
|
+
behavior
|
|
2866
|
+
});
|
|
2867
|
+
if (this.scrollOffset !== null) {
|
|
2868
|
+
this.scrollOffset += this.scrollAdjustments;
|
|
2869
|
+
if (this.scrollOffset < 0) this.scrollOffset = 0;
|
|
2870
|
+
this.scrollAdjustments = 0;
|
|
2871
|
+
}
|
|
2872
|
+
return true;
|
|
2873
|
+
}
|
|
2874
|
+
}
|
|
2353
2875
|
scheduleScrollReconcile() {
|
|
2354
2876
|
if (!this.targetWindow) {
|
|
2355
2877
|
this.scrollState = null;
|
|
@@ -2377,17 +2899,28 @@ var Virtualizer = class {
|
|
|
2377
2899
|
if (!targetChanged && approxEqual(targetOffset, this.getScrollOffset())) {
|
|
2378
2900
|
this.scrollState.stableFrames++;
|
|
2379
2901
|
if (this.scrollState.stableFrames >= STABLE_FRAMES) {
|
|
2902
|
+
if (this.getScrollOffset() !== targetOffset) {
|
|
2903
|
+
this._scrollToOffset(targetOffset, {
|
|
2904
|
+
adjustments: void 0,
|
|
2905
|
+
behavior: "auto"
|
|
2906
|
+
});
|
|
2907
|
+
}
|
|
2380
2908
|
this.scrollState = null;
|
|
2381
2909
|
return;
|
|
2382
2910
|
}
|
|
2383
2911
|
} else {
|
|
2384
2912
|
this.scrollState.stableFrames = 0;
|
|
2385
2913
|
if (targetChanged) {
|
|
2914
|
+
const viewport = this.getSize() || 600;
|
|
2915
|
+
const distance = Math.abs(targetOffset - this.getScrollOffset());
|
|
2916
|
+
const keepSmooth = this.scrollState.behavior === "smooth" && distance > viewport;
|
|
2386
2917
|
this.scrollState.lastTargetOffset = targetOffset;
|
|
2387
|
-
|
|
2918
|
+
if (!keepSmooth) {
|
|
2919
|
+
this.scrollState.behavior = "auto";
|
|
2920
|
+
}
|
|
2388
2921
|
this._scrollToOffset(targetOffset, {
|
|
2389
2922
|
adjustments: void 0,
|
|
2390
|
-
behavior: "auto"
|
|
2923
|
+
behavior: keepSmooth ? "smooth" : "auto"
|
|
2391
2924
|
});
|
|
2392
2925
|
}
|
|
2393
2926
|
}
|
|
@@ -2412,26 +2945,41 @@ var findNearestBinarySearch = (low, high, getCurrentValue, value) => {
|
|
|
2412
2945
|
return 0;
|
|
2413
2946
|
}
|
|
2414
2947
|
};
|
|
2415
|
-
function
|
|
2416
|
-
|
|
2417
|
-
|
|
2418
|
-
|
|
2419
|
-
|
|
2420
|
-
|
|
2948
|
+
function findNearestBinarySearchFlat(flat, high, value) {
|
|
2949
|
+
let low = 0;
|
|
2950
|
+
while (low <= high) {
|
|
2951
|
+
const middle = (low + high) / 2 | 0;
|
|
2952
|
+
const currentValue = flat[middle * 2];
|
|
2953
|
+
if (currentValue < value) {
|
|
2954
|
+
low = middle + 1;
|
|
2955
|
+
} else if (currentValue > value) {
|
|
2956
|
+
high = middle - 1;
|
|
2957
|
+
} else {
|
|
2958
|
+
return middle;
|
|
2959
|
+
}
|
|
2960
|
+
}
|
|
2961
|
+
return low > 0 ? low - 1 : 0;
|
|
2962
|
+
}
|
|
2963
|
+
function calculateRangeImpl(measurements, outerSize, scrollOffset, lanes, flat) {
|
|
2421
2964
|
const lastIndex = measurements.length - 1;
|
|
2422
|
-
const getOffset = (index) => measurements[index].start;
|
|
2423
2965
|
if (measurements.length <= lanes) {
|
|
2424
|
-
return {
|
|
2425
|
-
startIndex: 0,
|
|
2426
|
-
endIndex: lastIndex
|
|
2427
|
-
};
|
|
2966
|
+
return { startIndex: 0, endIndex: lastIndex };
|
|
2428
2967
|
}
|
|
2429
|
-
|
|
2430
|
-
|
|
2431
|
-
|
|
2432
|
-
|
|
2433
|
-
|
|
2434
|
-
|
|
2968
|
+
if (lanes === 1 && flat !== null) {
|
|
2969
|
+
const startIndex2 = findNearestBinarySearchFlat(
|
|
2970
|
+
flat,
|
|
2971
|
+
lastIndex,
|
|
2972
|
+
scrollOffset
|
|
2973
|
+
);
|
|
2974
|
+
let endIndex2 = startIndex2;
|
|
2975
|
+
const limit = scrollOffset + outerSize;
|
|
2976
|
+
while (endIndex2 < lastIndex && flat[endIndex2 * 2] + flat[endIndex2 * 2 + 1] < limit) {
|
|
2977
|
+
endIndex2++;
|
|
2978
|
+
}
|
|
2979
|
+
return { startIndex: startIndex2, endIndex: endIndex2 };
|
|
2980
|
+
}
|
|
2981
|
+
const getStart = (index) => measurements[index].start;
|
|
2982
|
+
let startIndex = findNearestBinarySearch(0, lastIndex, getStart, scrollOffset);
|
|
2435
2983
|
let endIndex = startIndex;
|
|
2436
2984
|
if (lanes === 1) {
|
|
2437
2985
|
while (endIndex < lastIndex && measurements[endIndex].end < scrollOffset + outerSize) {
|
|
@@ -2456,36 +3004,119 @@ function calculateRange({
|
|
|
2456
3004
|
return { startIndex, endIndex };
|
|
2457
3005
|
}
|
|
2458
3006
|
|
|
2459
|
-
// ../../node_modules/.pnpm/@tanstack+react-virtual@3.
|
|
3007
|
+
// ../../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
|
|
2460
3008
|
var useIsomorphicLayoutEffect = typeof document !== "undefined" ? React.useLayoutEffect : React.useEffect;
|
|
2461
3009
|
function useVirtualizerBase(_a) {
|
|
2462
3010
|
var _b = _a, {
|
|
2463
|
-
useFlushSync = true
|
|
3011
|
+
useFlushSync = true,
|
|
3012
|
+
directDomUpdates = false,
|
|
3013
|
+
directDomUpdatesMode = "transform"
|
|
2464
3014
|
} = _b, options = __objRest(_b, [
|
|
2465
|
-
"useFlushSync"
|
|
3015
|
+
"useFlushSync",
|
|
3016
|
+
"directDomUpdates",
|
|
3017
|
+
"directDomUpdatesMode"
|
|
2466
3018
|
]);
|
|
2467
|
-
const rerender = React.useReducer(() =>
|
|
3019
|
+
const rerender = React.useReducer((x) => x + 1, 0)[1];
|
|
3020
|
+
const directRef = React.useRef({
|
|
3021
|
+
enabled: directDomUpdates,
|
|
3022
|
+
mode: directDomUpdatesMode,
|
|
3023
|
+
container: null,
|
|
3024
|
+
lastSize: null,
|
|
3025
|
+
// Keyed by the element itself so a remounted node (same key, new DOM
|
|
3026
|
+
// node — e.g. when `enabled` is toggled off then on) is treated as fresh
|
|
3027
|
+
// and gets its style written.
|
|
3028
|
+
lastPositions: /* @__PURE__ */ new WeakMap(),
|
|
3029
|
+
prevRange: null
|
|
3030
|
+
});
|
|
3031
|
+
directRef.current.enabled = directDomUpdates;
|
|
3032
|
+
directRef.current.mode = directDomUpdatesMode;
|
|
3033
|
+
const applyContainerSize = (instance2) => {
|
|
3034
|
+
const state = directRef.current;
|
|
3035
|
+
if (!state.enabled || !state.container) return;
|
|
3036
|
+
const totalSize = instance2.getTotalSize();
|
|
3037
|
+
if (totalSize !== state.lastSize) {
|
|
3038
|
+
state.lastSize = totalSize;
|
|
3039
|
+
const sizeAxis = instance2.options.horizontal ? "width" : "height";
|
|
3040
|
+
state.container.style[sizeAxis] = `${totalSize}px`;
|
|
3041
|
+
}
|
|
3042
|
+
};
|
|
3043
|
+
const applyDirectStyles = (instance2) => {
|
|
3044
|
+
const state = directRef.current;
|
|
3045
|
+
if (!state.enabled || !state.container) return;
|
|
3046
|
+
applyContainerSize(instance2);
|
|
3047
|
+
const horizontal = !!instance2.options.horizontal;
|
|
3048
|
+
const useTransform = state.mode === "transform";
|
|
3049
|
+
const posAxis = horizontal ? "left" : "top";
|
|
3050
|
+
const scrollMargin = instance2.options.scrollMargin;
|
|
3051
|
+
const items = instance2.getVirtualItems();
|
|
3052
|
+
for (const item of items) {
|
|
3053
|
+
const next = item.start - scrollMargin;
|
|
3054
|
+
const el = instance2.elementsCache.get(item.key);
|
|
3055
|
+
if (!el) continue;
|
|
3056
|
+
if (state.lastPositions.get(el) === next) continue;
|
|
3057
|
+
state.lastPositions.set(el, next);
|
|
3058
|
+
if (useTransform) {
|
|
3059
|
+
el.style.transform = horizontal ? `translate3d(${next}px, 0, 0)` : `translate3d(0, ${next}px, 0)`;
|
|
3060
|
+
} else {
|
|
3061
|
+
el.style[posAxis] = `${next}px`;
|
|
3062
|
+
}
|
|
3063
|
+
}
|
|
3064
|
+
};
|
|
2468
3065
|
const resolvedOptions = __spreadProps(__spreadValues({}, options), {
|
|
2469
3066
|
onChange: (instance2, sync) => {
|
|
2470
3067
|
var _a2;
|
|
2471
|
-
|
|
2472
|
-
|
|
2473
|
-
|
|
2474
|
-
|
|
3068
|
+
const state = directRef.current;
|
|
3069
|
+
let shouldRerender = true;
|
|
3070
|
+
if (state.enabled) {
|
|
3071
|
+
applyDirectStyles(instance2);
|
|
3072
|
+
const range = instance2.range;
|
|
3073
|
+
const prev = state.prevRange;
|
|
3074
|
+
shouldRerender = !prev || prev.isScrolling !== instance2.isScrolling || prev.startIndex !== (range == null ? void 0 : range.startIndex) || prev.endIndex !== (range == null ? void 0 : range.endIndex);
|
|
3075
|
+
if (shouldRerender) {
|
|
3076
|
+
state.prevRange = range ? {
|
|
3077
|
+
startIndex: range.startIndex,
|
|
3078
|
+
endIndex: range.endIndex,
|
|
3079
|
+
isScrolling: instance2.isScrolling
|
|
3080
|
+
} : null;
|
|
3081
|
+
}
|
|
3082
|
+
}
|
|
3083
|
+
if (shouldRerender) {
|
|
3084
|
+
if (useFlushSync && sync) {
|
|
3085
|
+
(0, import_react_dom.flushSync)(rerender);
|
|
3086
|
+
} else {
|
|
3087
|
+
rerender();
|
|
3088
|
+
}
|
|
2475
3089
|
}
|
|
2476
3090
|
(_a2 = options.onChange) == null ? void 0 : _a2.call(options, instance2, sync);
|
|
2477
3091
|
}
|
|
2478
3092
|
});
|
|
2479
|
-
const [instance] = React.useState(
|
|
2480
|
-
|
|
2481
|
-
|
|
3093
|
+
const [instance] = React.useState(() => {
|
|
3094
|
+
const v = new Virtualizer(resolvedOptions);
|
|
3095
|
+
return Object.assign(v, {
|
|
3096
|
+
containerRef: (node) => {
|
|
3097
|
+
const state = directRef.current;
|
|
3098
|
+
state.container = node;
|
|
3099
|
+
state.lastSize = null;
|
|
3100
|
+
if (node && state.enabled) {
|
|
3101
|
+
const total = v.getTotalSize();
|
|
3102
|
+
state.lastSize = total;
|
|
3103
|
+
const axis = v.options.horizontal ? "width" : "height";
|
|
3104
|
+
node.style[axis] = `${total}px`;
|
|
3105
|
+
}
|
|
3106
|
+
}
|
|
3107
|
+
});
|
|
3108
|
+
});
|
|
2482
3109
|
instance.setOptions(resolvedOptions);
|
|
2483
3110
|
useIsomorphicLayoutEffect(() => {
|
|
2484
3111
|
return instance._didMount();
|
|
2485
3112
|
}, []);
|
|
2486
3113
|
useIsomorphicLayoutEffect(() => {
|
|
3114
|
+
applyContainerSize(instance);
|
|
2487
3115
|
return instance._willUpdate();
|
|
2488
3116
|
});
|
|
3117
|
+
useIsomorphicLayoutEffect(() => {
|
|
3118
|
+
applyDirectStyles(instance);
|
|
3119
|
+
});
|
|
2489
3120
|
return instance;
|
|
2490
3121
|
}
|
|
2491
3122
|
function useWindowVirtualizer(options) {
|
|
@@ -2518,23 +3149,23 @@ var step_messages_default = (0, import_react_intl6.defineMessages)({
|
|
|
2518
3149
|
});
|
|
2519
3150
|
|
|
2520
3151
|
// ../renderers/src/step/StepFooter.tsx
|
|
2521
|
-
var
|
|
3152
|
+
var import_jsx_runtime34 = require("react/jsx-runtime");
|
|
2522
3153
|
var SCROLL_TO_BOTTOM = "scroll-to-bottom";
|
|
2523
3154
|
var StepFooter = ({ footer, tags }) => {
|
|
2524
3155
|
if (tags == null ? void 0 : tags.includes(SCROLL_TO_BOTTOM)) {
|
|
2525
|
-
return /* @__PURE__ */ (0,
|
|
3156
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(FooterWithScrollButton, { footer });
|
|
2526
3157
|
}
|
|
2527
|
-
return /* @__PURE__ */ (0,
|
|
3158
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(DefaultFooter, { footer });
|
|
2528
3159
|
};
|
|
2529
3160
|
var DefaultFooter = ({ footer }) => {
|
|
2530
3161
|
const hasFooter = footer && Array.isArray(footer) && footer.length > 0;
|
|
2531
|
-
return hasFooter ? /* @__PURE__ */ (0,
|
|
3162
|
+
return hasFooter ? /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: "df-step-fixed__footer", children: footer }) : void 0;
|
|
2532
3163
|
};
|
|
2533
3164
|
var FooterWithScrollButton = ({ footer }) => {
|
|
2534
3165
|
const { formatMessage } = (0, import_react_intl7.useIntl)();
|
|
2535
3166
|
const endOfLayoutRef = (0, import_react8.useRef)(null);
|
|
2536
3167
|
const isElementVisible = useIsElementVisible(endOfLayoutRef);
|
|
2537
|
-
const scrollButton = /* @__PURE__ */ (0,
|
|
3168
|
+
const scrollButton = /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
2538
3169
|
import_components14.Button,
|
|
2539
3170
|
{
|
|
2540
3171
|
className: "m-b-1",
|
|
@@ -2550,11 +3181,11 @@ var FooterWithScrollButton = ({ footer }) => {
|
|
|
2550
3181
|
);
|
|
2551
3182
|
const hasStepFooterContent = footer && Array.isArray(footer) && footer.length > 0;
|
|
2552
3183
|
if (isElementVisible && !hasStepFooterContent) {
|
|
2553
|
-
return /* @__PURE__ */ (0,
|
|
3184
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { ref: endOfLayoutRef, "aria-hidden": "true" });
|
|
2554
3185
|
}
|
|
2555
|
-
return /* @__PURE__ */ (0,
|
|
2556
|
-
/* @__PURE__ */ (0,
|
|
2557
|
-
/* @__PURE__ */ (0,
|
|
3186
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(import_jsx_runtime34.Fragment, { children: [
|
|
3187
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { ref: endOfLayoutRef, "aria-hidden": "true" }),
|
|
3188
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "df-step-fixed__footer", children: [
|
|
2558
3189
|
!isElementVisible && scrollButton,
|
|
2559
3190
|
footer
|
|
2560
3191
|
] })
|
|
@@ -2596,7 +3227,7 @@ var collection_messages_default = (0, import_react_intl8.defineMessages)({
|
|
|
2596
3227
|
});
|
|
2597
3228
|
|
|
2598
3229
|
// ../renderers/src/CollectionRenderer/components/ContentComponent.tsx
|
|
2599
|
-
var
|
|
3230
|
+
var import_jsx_runtime35 = require("react/jsx-runtime");
|
|
2600
3231
|
var ContentComponent = (props) => {
|
|
2601
3232
|
const { state, status, SectionHeader, Item } = props;
|
|
2602
3233
|
const endOfContentRef = (0, import_react9.useRef)(null);
|
|
@@ -2639,9 +3270,9 @@ var ContentComponent = (props) => {
|
|
|
2639
3270
|
// eslint-disable-next-line react-hooks/refs
|
|
2640
3271
|
scrollMargin: listOffsetRef.current
|
|
2641
3272
|
});
|
|
2642
|
-
return /* @__PURE__ */ (0,
|
|
3273
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { ref: listRef, children: [
|
|
2643
3274
|
state.beforeSections,
|
|
2644
|
-
/* @__PURE__ */ (0,
|
|
3275
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
2645
3276
|
"div",
|
|
2646
3277
|
{
|
|
2647
3278
|
style: {
|
|
@@ -2654,7 +3285,7 @@ var ContentComponent = (props) => {
|
|
|
2654
3285
|
if (!i) {
|
|
2655
3286
|
return null;
|
|
2656
3287
|
}
|
|
2657
|
-
return /* @__PURE__ */ (0,
|
|
3288
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
2658
3289
|
"div",
|
|
2659
3290
|
{
|
|
2660
3291
|
ref: virtualizer.measureElement,
|
|
@@ -2666,14 +3297,14 @@ var ContentComponent = (props) => {
|
|
|
2666
3297
|
width: "100%",
|
|
2667
3298
|
transform: `translateY(${item.start - virtualizer.options.scrollMargin}px)`
|
|
2668
3299
|
},
|
|
2669
|
-
children: i.type === "header" ? /* @__PURE__ */ (0,
|
|
3300
|
+
children: i.type === "header" ? /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(SectionHeader, __spreadValues({}, i)) : /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(Item, __spreadValues({}, i.item))
|
|
2670
3301
|
},
|
|
2671
3302
|
item.key
|
|
2672
3303
|
);
|
|
2673
3304
|
})
|
|
2674
3305
|
}
|
|
2675
3306
|
),
|
|
2676
|
-
/* @__PURE__ */ (0,
|
|
3307
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { ref: endOfContentRef, className: "d-flex m-x-auto m-y-2", children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(PaginationComponent, { status, state }) }),
|
|
2677
3308
|
state.afterSections
|
|
2678
3309
|
] });
|
|
2679
3310
|
};
|
|
@@ -2688,26 +3319,26 @@ var PaginationComponent = ({
|
|
|
2688
3319
|
return null;
|
|
2689
3320
|
}
|
|
2690
3321
|
if (isPaginationError) {
|
|
2691
|
-
return /* @__PURE__ */ (0,
|
|
3322
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(LoadMoreButton, { onClick: status.retry });
|
|
2692
3323
|
}
|
|
2693
3324
|
if (state.afterSectionsProps.length > 0 && loadMore) {
|
|
2694
|
-
return /* @__PURE__ */ (0,
|
|
3325
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(LoadMoreButton, { onClick: loadMore });
|
|
2695
3326
|
}
|
|
2696
|
-
return /* @__PURE__ */ (0,
|
|
3327
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_components15.ProcessIndicator, { size: "xs", "data-testid": "collection-pagination-loader" });
|
|
2697
3328
|
};
|
|
2698
3329
|
var LoadMoreButton = ({ onClick }) => {
|
|
2699
3330
|
const { formatMessage } = (0, import_react_intl9.useIntl)();
|
|
2700
|
-
return /* @__PURE__ */ (0,
|
|
3331
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: "d-flex m-x-auto", children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_components15.Button, { v2: true, size: "sm", priority: "secondary-neutral", onClick, children: formatMessage(collection_messages_default.loadMoreButton) }) });
|
|
2701
3332
|
};
|
|
2702
3333
|
|
|
2703
3334
|
// ../renderers/src/CollectionRenderer/components/FilterComponent.tsx
|
|
2704
3335
|
var import_components16 = require("@transferwise/components");
|
|
2705
|
-
var
|
|
3336
|
+
var import_jsx_runtime36 = require("react/jsx-runtime");
|
|
2706
3337
|
var FiltersComponent = ({ state }) => {
|
|
2707
3338
|
const { filters } = state;
|
|
2708
|
-
return /* @__PURE__ */ (0,
|
|
3339
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { className: "df-filters-container", children: filters.map((filter) => {
|
|
2709
3340
|
var _a;
|
|
2710
|
-
return /* @__PURE__ */ (0,
|
|
3341
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(FilterComponent, __spreadValues({}, filter), JSON.stringify((_a = filter.options) == null ? void 0 : _a.map((o) => o.value)));
|
|
2711
3342
|
}) });
|
|
2712
3343
|
};
|
|
2713
3344
|
var FilterComponent = (filter) => {
|
|
@@ -2715,7 +3346,7 @@ var FilterComponent = (filter) => {
|
|
|
2715
3346
|
if (!options) {
|
|
2716
3347
|
return null;
|
|
2717
3348
|
}
|
|
2718
|
-
return /* @__PURE__ */ (0,
|
|
3349
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
2719
3350
|
import_components16.Chips,
|
|
2720
3351
|
{
|
|
2721
3352
|
className: "m-b-1",
|
|
@@ -2745,7 +3376,7 @@ var import_components19 = require("@transferwise/components");
|
|
|
2745
3376
|
|
|
2746
3377
|
// ../renderers/src/utils/listItem/getAdditionalInfo.tsx
|
|
2747
3378
|
var import_components17 = require("@transferwise/components");
|
|
2748
|
-
var
|
|
3379
|
+
var import_jsx_runtime37 = require("react/jsx-runtime");
|
|
2749
3380
|
var getAdditionalInfo = (additionalInfo) => {
|
|
2750
3381
|
var _a, _b;
|
|
2751
3382
|
if (!additionalInfo) {
|
|
@@ -2753,7 +3384,7 @@ var getAdditionalInfo = (additionalInfo) => {
|
|
|
2753
3384
|
}
|
|
2754
3385
|
const { href, text, onClick } = additionalInfo;
|
|
2755
3386
|
if (href || onClick) {
|
|
2756
|
-
return /* @__PURE__ */ (0,
|
|
3387
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
2757
3388
|
import_components17.ListItem.AdditionalInfo,
|
|
2758
3389
|
{
|
|
2759
3390
|
action: __spreadValues({
|
|
@@ -2762,19 +3393,19 @@ var getAdditionalInfo = (additionalInfo) => {
|
|
|
2762
3393
|
}
|
|
2763
3394
|
);
|
|
2764
3395
|
}
|
|
2765
|
-
return /* @__PURE__ */ (0,
|
|
3396
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_components17.ListItem.AdditionalInfo, { children: additionalInfo == null ? void 0 : additionalInfo.text });
|
|
2766
3397
|
};
|
|
2767
3398
|
|
|
2768
3399
|
// ../renderers/src/utils/listItem/getCTAControl.tsx
|
|
2769
3400
|
var import_components18 = require("@transferwise/components");
|
|
2770
|
-
var
|
|
3401
|
+
var import_jsx_runtime38 = require("react/jsx-runtime");
|
|
2771
3402
|
var getCTAControl = (callToAction, { ctaSecondary, fullyInteractive }) => {
|
|
2772
3403
|
if (!callToAction) {
|
|
2773
3404
|
return void 0;
|
|
2774
3405
|
}
|
|
2775
3406
|
const { accessibilityDescription, title, context } = callToAction;
|
|
2776
3407
|
const { priority, sentiment } = getPriorityAndSentiment(ctaSecondary, context);
|
|
2777
|
-
return /* @__PURE__ */ (0,
|
|
3408
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
2778
3409
|
import_components18.ListItem.Button,
|
|
2779
3410
|
__spreadProps(__spreadValues({}, callToAction.getAnchorProps()), {
|
|
2780
3411
|
partiallyInteractive: !fullyInteractive,
|
|
@@ -2799,7 +3430,7 @@ var shouldUseAvatar = (control, tags) => {
|
|
|
2799
3430
|
};
|
|
2800
3431
|
|
|
2801
3432
|
// ../renderers/src/CollectionRenderer/components/ItemComponent.tsx
|
|
2802
|
-
var
|
|
3433
|
+
var import_jsx_runtime39 = require("react/jsx-runtime");
|
|
2803
3434
|
var ItemComponent = (props) => {
|
|
2804
3435
|
var _a, _b;
|
|
2805
3436
|
const {
|
|
@@ -2821,7 +3452,7 @@ var ItemComponent = (props) => {
|
|
|
2821
3452
|
ctaSecondary: (_a = tags == null ? void 0 : tags.includes("cta-secondary")) != null ? _a : false,
|
|
2822
3453
|
fullyInteractive: (_b = (tags == null ? void 0 : tags.includes("fully-interactive")) && (additionalInfo == null ? void 0 : additionalInfo.onClick) == null) != null ? _b : false
|
|
2823
3454
|
};
|
|
2824
|
-
return /* @__PURE__ */ (0,
|
|
3455
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
2825
3456
|
import_components19.ListItem,
|
|
2826
3457
|
{
|
|
2827
3458
|
title,
|
|
@@ -2838,10 +3469,10 @@ var ItemComponent = (props) => {
|
|
|
2838
3469
|
};
|
|
2839
3470
|
var getNavigationControl = (onClick, href) => {
|
|
2840
3471
|
if (href) {
|
|
2841
|
-
return /* @__PURE__ */ (0,
|
|
3472
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_components19.ListItem.Navigation, { href });
|
|
2842
3473
|
}
|
|
2843
3474
|
if (onClick) {
|
|
2844
|
-
return /* @__PURE__ */ (0,
|
|
3475
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_components19.ListItem.Navigation, { onClick });
|
|
2845
3476
|
}
|
|
2846
3477
|
return null;
|
|
2847
3478
|
};
|
|
@@ -2850,7 +3481,7 @@ var getNavigationControl = (onClick, href) => {
|
|
|
2850
3481
|
var import_components20 = require("@transferwise/components");
|
|
2851
3482
|
var import_icons = require("@transferwise/icons");
|
|
2852
3483
|
var import_react_intl10 = require("react-intl");
|
|
2853
|
-
var
|
|
3484
|
+
var import_jsx_runtime40 = require("react/jsx-runtime");
|
|
2854
3485
|
var SearchComponent = ({
|
|
2855
3486
|
state,
|
|
2856
3487
|
status,
|
|
@@ -2866,12 +3497,12 @@ var SearchComponent = ({
|
|
|
2866
3497
|
const getAddon = () => {
|
|
2867
3498
|
var _a;
|
|
2868
3499
|
if (status.type === "loading") {
|
|
2869
|
-
return { content: /* @__PURE__ */ (0,
|
|
3500
|
+
return { content: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_components20.ProcessIndicator, { size: "xs", "data-testid": "collection-search-loader" }) };
|
|
2870
3501
|
}
|
|
2871
3502
|
if ((_a = state.search) == null ? void 0 : _a.query) {
|
|
2872
3503
|
return {
|
|
2873
3504
|
interactive: true,
|
|
2874
|
-
content: /* @__PURE__ */ (0,
|
|
3505
|
+
content: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
2875
3506
|
import_components20.IconButton,
|
|
2876
3507
|
{
|
|
2877
3508
|
priority: "minimal",
|
|
@@ -2881,14 +3512,14 @@ var SearchComponent = ({
|
|
|
2881
3512
|
var _a2;
|
|
2882
3513
|
return (_a2 = state.search) == null ? void 0 : _a2.onChange("");
|
|
2883
3514
|
},
|
|
2884
|
-
children: /* @__PURE__ */ (0,
|
|
3515
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_icons.CrossCircleFill, {})
|
|
2885
3516
|
}
|
|
2886
3517
|
)
|
|
2887
3518
|
};
|
|
2888
3519
|
}
|
|
2889
3520
|
return void 0;
|
|
2890
3521
|
};
|
|
2891
|
-
return /* @__PURE__ */ (0,
|
|
3522
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
2892
3523
|
FieldInput_default,
|
|
2893
3524
|
{
|
|
2894
3525
|
id: "search",
|
|
@@ -2899,7 +3530,7 @@ var SearchComponent = ({
|
|
|
2899
3530
|
features,
|
|
2900
3531
|
control,
|
|
2901
3532
|
tags,
|
|
2902
|
-
children: /* @__PURE__ */ (0,
|
|
3533
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_components20.InputGroup, { addonStart: { content: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_icons.Search, { size: 24 }) }, addonEnd: getAddon(), children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
2903
3534
|
import_components20.Input,
|
|
2904
3535
|
{
|
|
2905
3536
|
id: "search",
|
|
@@ -2918,14 +3549,14 @@ var SearchComponent = ({
|
|
|
2918
3549
|
};
|
|
2919
3550
|
|
|
2920
3551
|
// ../renderers/src/CollectionRenderer/components/SectionHeaderComponent.tsx
|
|
2921
|
-
var
|
|
3552
|
+
var import_jsx_runtime41 = require("react/jsx-runtime");
|
|
2922
3553
|
var SectionHeaderComponent = ({
|
|
2923
3554
|
title,
|
|
2924
3555
|
callToAction
|
|
2925
|
-
}) => /* @__PURE__ */ (0,
|
|
3556
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(Header, { title, callToAction });
|
|
2926
3557
|
|
|
2927
3558
|
// ../renderers/src/CollectionRenderer/createCollectionRenderer.tsx
|
|
2928
|
-
var
|
|
3559
|
+
var import_jsx_runtime42 = require("react/jsx-runtime");
|
|
2929
3560
|
var createCollectionRenderer = (canRender, components) => {
|
|
2930
3561
|
const componentsWithDefaults = __spreadValues({
|
|
2931
3562
|
Search: SearchComponent,
|
|
@@ -2939,35 +3570,35 @@ var createCollectionRenderer = (canRender, components) => {
|
|
|
2939
3570
|
canRenderType: "collection",
|
|
2940
3571
|
canRender,
|
|
2941
3572
|
render: (props) => {
|
|
2942
|
-
return /* @__PURE__ */ (0,
|
|
3573
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(CollectionRendererComponent, __spreadValues(__spreadValues({}, props), componentsWithDefaults));
|
|
2943
3574
|
}
|
|
2944
3575
|
};
|
|
2945
3576
|
};
|
|
2946
3577
|
|
|
2947
3578
|
// ../renderers/src/CollectionRenderer/CollectionRenderer.tsx
|
|
2948
3579
|
var import_react_intl11 = require("react-intl");
|
|
2949
|
-
var
|
|
3580
|
+
var import_jsx_runtime43 = require("react/jsx-runtime");
|
|
2950
3581
|
var CollectionRendererComponent = (props) => {
|
|
2951
3582
|
const { status, Search: Search4, Filters, Results } = props;
|
|
2952
|
-
return /* @__PURE__ */ (0,
|
|
2953
|
-
/* @__PURE__ */ (0,
|
|
2954
|
-
/* @__PURE__ */ (0,
|
|
2955
|
-
status.type === "error" && status.reason === "search" ? /* @__PURE__ */ (0,
|
|
3583
|
+
return /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(import_jsx_runtime43.Fragment, { children: [
|
|
3584
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(Search4, __spreadValues({}, props)),
|
|
3585
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(Filters, __spreadValues({}, props)),
|
|
3586
|
+
status.type === "error" && status.reason === "search" ? /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(SearchError, { retry: status.retry }) : /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(Results, __spreadValues({}, props))
|
|
2956
3587
|
] });
|
|
2957
3588
|
};
|
|
2958
3589
|
var SearchError = ({ retry }) => {
|
|
2959
3590
|
const { formatMessage } = (0, import_react_intl11.useIntl)();
|
|
2960
|
-
return /* @__PURE__ */ (0,
|
|
3591
|
+
return /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(import_components21.InlinePrompt, { width: "full", sentiment: "negative", children: [
|
|
2961
3592
|
formatMessage(generic_error_messages_default.genericError),
|
|
2962
3593
|
"\xA0",
|
|
2963
|
-
/* @__PURE__ */ (0,
|
|
3594
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_components21.Link, { onClick: retry, children: formatMessage(generic_error_messages_default.retry) })
|
|
2964
3595
|
] });
|
|
2965
3596
|
};
|
|
2966
3597
|
var CollectionRenderer = createCollectionRenderer(() => true);
|
|
2967
3598
|
var CollectionRenderer_default = CollectionRenderer;
|
|
2968
3599
|
|
|
2969
3600
|
// ../renderers/src/ColumnsRenderer.tsx
|
|
2970
|
-
var
|
|
3601
|
+
var import_classnames10 = __toESM(require_classnames());
|
|
2971
3602
|
|
|
2972
3603
|
// ../renderers/src/utils/useIsCollapsed.ts
|
|
2973
3604
|
var import_react10 = require("react");
|
|
@@ -2990,7 +3621,7 @@ var useIsCollapsed = () => {
|
|
|
2990
3621
|
};
|
|
2991
3622
|
|
|
2992
3623
|
// ../renderers/src/ColumnsRenderer.tsx
|
|
2993
|
-
var
|
|
3624
|
+
var import_jsx_runtime44 = require("react/jsx-runtime");
|
|
2994
3625
|
var RIGHT_FIRST_STACKING = "right-first-stacking";
|
|
2995
3626
|
var ColumnsRenderer = {
|
|
2996
3627
|
canRenderType: "columns",
|
|
@@ -3001,12 +3632,12 @@ function ColumnsRendererComponent(props) {
|
|
|
3001
3632
|
const { bias, margin, startChildren, endChildren, tags } = props;
|
|
3002
3633
|
const isCollapsed = useIsCollapsed();
|
|
3003
3634
|
const reverse = isCollapsed && ((_a = tags == null ? void 0 : tags.includes(RIGHT_FIRST_STACKING)) != null ? _a : false);
|
|
3004
|
-
const startColumn = /* @__PURE__ */ (0,
|
|
3005
|
-
const endColumn = /* @__PURE__ */ (0,
|
|
3006
|
-
return /* @__PURE__ */ (0,
|
|
3635
|
+
const startColumn = /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("div", { className: "df-columns-renderer-column", children: startChildren });
|
|
3636
|
+
const endColumn = /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("div", { className: "df-columns-renderer-column", children: endChildren });
|
|
3637
|
+
return /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(
|
|
3007
3638
|
"div",
|
|
3008
3639
|
{
|
|
3009
|
-
className: (0,
|
|
3640
|
+
className: (0, import_classnames10.default)(
|
|
3010
3641
|
"df-columns-renderer-container",
|
|
3011
3642
|
getMargin(margin),
|
|
3012
3643
|
{
|
|
@@ -3027,19 +3658,37 @@ var ColumnsRenderer_default = ColumnsRenderer;
|
|
|
3027
3658
|
// ../renderers/src/components/VariableDateInput.tsx
|
|
3028
3659
|
var import_components22 = require("@transferwise/components");
|
|
3029
3660
|
|
|
3661
|
+
// ../renderers/src/hooks/useAvailabilityRules.ts
|
|
3662
|
+
var import_react11 = require("react");
|
|
3663
|
+
var import_react_intl13 = require("react-intl");
|
|
3664
|
+
|
|
3665
|
+
// ../renderers/src/messages/date-input.messages.ts
|
|
3666
|
+
var import_react_intl12 = require("react-intl");
|
|
3667
|
+
var date_input_messages_default = (0, import_react_intl12.defineMessages)({
|
|
3668
|
+
unavailableDates: {
|
|
3669
|
+
id: "df.wise.DateInput.unavailableDates",
|
|
3670
|
+
defaultMessage: "Some dates are unavailable.",
|
|
3671
|
+
description: "General explanation shown below a calendar containing unavailable dates"
|
|
3672
|
+
}
|
|
3673
|
+
});
|
|
3674
|
+
|
|
3030
3675
|
// ../renderers/src/validators/type-validators.ts
|
|
3031
3676
|
var isNumber = (value) => typeof value === "number" && !Number.isNaN(value);
|
|
3032
3677
|
|
|
3033
3678
|
// ../renderers/src/utils/value-utils.ts
|
|
3034
3679
|
var dateStringToDateOrNull = (dateString) => {
|
|
3035
|
-
|
|
3680
|
+
const match = dateString ? /^(\d{4})-(\d{2})-(\d{2})$/.exec(dateString) : null;
|
|
3681
|
+
if (!match) {
|
|
3036
3682
|
return null;
|
|
3037
3683
|
}
|
|
3038
|
-
const [year, month,
|
|
3039
|
-
if (!isNumber(year) || !isNumber(month) || !isNumber(
|
|
3684
|
+
const [, year, month, day] = match.map(Number);
|
|
3685
|
+
if (!isNumber(year) || !isNumber(month) || !isNumber(day)) {
|
|
3040
3686
|
return null;
|
|
3041
3687
|
}
|
|
3042
|
-
|
|
3688
|
+
const date = /* @__PURE__ */ new Date(0);
|
|
3689
|
+
date.setHours(0, 0, 0, 0);
|
|
3690
|
+
date.setFullYear(year, month - 1, day);
|
|
3691
|
+
return date.getFullYear() === year && date.getMonth() === month - 1 && date.getDate() === day ? date : null;
|
|
3043
3692
|
};
|
|
3044
3693
|
var dateToDateString = (date) => {
|
|
3045
3694
|
const d = new Date(date);
|
|
@@ -3051,14 +3700,70 @@ var dateToDateString = (date) => {
|
|
|
3051
3700
|
return [year, formattedMonth, formattedDay].join("-");
|
|
3052
3701
|
};
|
|
3053
3702
|
|
|
3703
|
+
// ../renderers/src/hooks/useAvailabilityRules.ts
|
|
3704
|
+
var useAvailabilityRules = (availability) => {
|
|
3705
|
+
var _a, _b;
|
|
3706
|
+
const { formatMessage } = (0, import_react_intl13.useIntl)();
|
|
3707
|
+
const [focusedDate, setFocusedDate] = (0, import_react11.useState)(null);
|
|
3708
|
+
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);
|
|
3709
|
+
const onDateSelect = ({ date }) => {
|
|
3710
|
+
setFocusedDate(date);
|
|
3711
|
+
};
|
|
3712
|
+
return {
|
|
3713
|
+
disabledRules: mapAvailabilityToDisabledRules(availability, unavailableMessage),
|
|
3714
|
+
onDateSelect,
|
|
3715
|
+
resetFocusedDate: () => setFocusedDate(null)
|
|
3716
|
+
};
|
|
3717
|
+
};
|
|
3718
|
+
var mapAvailabilityToDisabledRules = (availability, reason) => {
|
|
3719
|
+
if (!(availability == null ? void 0 : availability.unavailable.length)) {
|
|
3720
|
+
return void 0;
|
|
3721
|
+
}
|
|
3722
|
+
const dates = availability.unavailable.flatMap((rule) => rule.type === "dates" ? rule.dates : []).map(dateStringToDateOrNull).filter(isDate);
|
|
3723
|
+
const weekdays = availability.unavailable.flatMap(
|
|
3724
|
+
(rule) => rule.type === "weekdays" ? rule.weekdays : []
|
|
3725
|
+
);
|
|
3726
|
+
const ranges = availability.unavailable.flatMap((rule) => {
|
|
3727
|
+
if (rule.type !== "range") {
|
|
3728
|
+
return [];
|
|
3729
|
+
}
|
|
3730
|
+
const start = dateStringToDateOrNull(rule.start);
|
|
3731
|
+
const end = dateStringToDateOrNull(rule.end);
|
|
3732
|
+
return start && end ? [{ start, end }] : [];
|
|
3733
|
+
});
|
|
3734
|
+
return __spreadValues(__spreadValues(__spreadValues({
|
|
3735
|
+
reason
|
|
3736
|
+
}, dates.length > 0 ? { dates } : {}), weekdays.length > 0 ? { weekdays } : {}), ranges.length > 0 ? { ranges } : {});
|
|
3737
|
+
};
|
|
3738
|
+
var getUnavailableDateReason = (date, availability) => {
|
|
3739
|
+
var _a, _b;
|
|
3740
|
+
const dateString = dateToDateString(date);
|
|
3741
|
+
const weekday = date.getDay();
|
|
3742
|
+
return (_b = (_a = availability == null ? void 0 : availability.unavailable.find((rule) => matchesDateRule(dateString, weekday, rule))) == null ? void 0 : _a.reason) != null ? _b : null;
|
|
3743
|
+
};
|
|
3744
|
+
var matchesDateRule = (date, weekday, rule) => {
|
|
3745
|
+
switch (rule.type) {
|
|
3746
|
+
case "dates":
|
|
3747
|
+
return rule.dates.includes(date);
|
|
3748
|
+
case "weekdays": {
|
|
3749
|
+
const weekdayName = ["sun", "mon", "tue", "wed", "thu", "fri", "sat"][weekday];
|
|
3750
|
+
return rule.weekdays.some((ruleWeekday) => ruleWeekday === weekdayName);
|
|
3751
|
+
}
|
|
3752
|
+
case "range":
|
|
3753
|
+
return date >= rule.start && date <= rule.end;
|
|
3754
|
+
}
|
|
3755
|
+
};
|
|
3756
|
+
var isDate = (date) => date !== null;
|
|
3757
|
+
|
|
3054
3758
|
// ../renderers/src/components/VariableDateInput.tsx
|
|
3055
|
-
var
|
|
3759
|
+
var import_jsx_runtime45 = require("react/jsx-runtime");
|
|
3056
3760
|
function VariableDateInput({
|
|
3057
3761
|
control,
|
|
3058
3762
|
inputProps
|
|
3059
3763
|
}) {
|
|
3060
3764
|
const {
|
|
3061
3765
|
autoComplete,
|
|
3766
|
+
availability,
|
|
3062
3767
|
minimumDate,
|
|
3063
3768
|
maximumDate,
|
|
3064
3769
|
placeholder,
|
|
@@ -3067,8 +3772,9 @@ function VariableDateInput({
|
|
|
3067
3772
|
onChange,
|
|
3068
3773
|
onFocus
|
|
3069
3774
|
} = inputProps;
|
|
3775
|
+
const { disabledRules, onDateSelect, resetFocusedDate } = useAvailabilityRules(availability);
|
|
3070
3776
|
if (control === "date-lookup") {
|
|
3071
|
-
return /* @__PURE__ */ (0,
|
|
3777
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
3072
3778
|
import_components22.DateLookup,
|
|
3073
3779
|
{
|
|
3074
3780
|
value: dateStringToDateOrNull(inputProps.value),
|
|
@@ -3076,15 +3782,20 @@ function VariableDateInput({
|
|
|
3076
3782
|
max: dateStringToDateOrNull(maximumDate),
|
|
3077
3783
|
placeholder,
|
|
3078
3784
|
disabled,
|
|
3785
|
+
disabledRules,
|
|
3079
3786
|
onChange: (date) => {
|
|
3080
3787
|
onChange(date !== null ? dateToDateString(date) : null);
|
|
3081
3788
|
},
|
|
3789
|
+
onDateSelect,
|
|
3082
3790
|
onBlur,
|
|
3083
|
-
onFocus
|
|
3791
|
+
onFocus: () => {
|
|
3792
|
+
resetFocusedDate();
|
|
3793
|
+
onFocus();
|
|
3794
|
+
}
|
|
3084
3795
|
}
|
|
3085
3796
|
);
|
|
3086
3797
|
}
|
|
3087
|
-
return /* @__PURE__ */ (0,
|
|
3798
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
3088
3799
|
import_components22.DateInput,
|
|
3089
3800
|
__spreadProps(__spreadValues({}, inputProps), {
|
|
3090
3801
|
dayAutoComplete: getAutocompleteString(autoComplete, "day"),
|
|
@@ -3101,7 +3812,7 @@ var getAutocompleteString = (value, suffix) => {
|
|
|
3101
3812
|
var VariableDateInput_default = VariableDateInput;
|
|
3102
3813
|
|
|
3103
3814
|
// ../renderers/src/DateInputRenderer.tsx
|
|
3104
|
-
var
|
|
3815
|
+
var import_jsx_runtime46 = require("react/jsx-runtime");
|
|
3105
3816
|
var DateInputRenderer = {
|
|
3106
3817
|
canRenderType: "input-date",
|
|
3107
3818
|
render: (props) => {
|
|
@@ -3126,7 +3837,7 @@ var DateInputRenderer = {
|
|
|
3126
3837
|
]);
|
|
3127
3838
|
const value = initialValue != null ? initialValue : "";
|
|
3128
3839
|
const inputProps = __spreadProps(__spreadValues({}, rest), { value, id });
|
|
3129
|
-
return /* @__PURE__ */ (0,
|
|
3840
|
+
return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
3130
3841
|
FieldInput_default,
|
|
3131
3842
|
{
|
|
3132
3843
|
id,
|
|
@@ -3139,7 +3850,7 @@ var DateInputRenderer = {
|
|
|
3139
3850
|
features: props.features,
|
|
3140
3851
|
control,
|
|
3141
3852
|
tags: props.tags,
|
|
3142
|
-
children: /* @__PURE__ */ (0,
|
|
3853
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(VariableDateInput_default, { control, inputProps })
|
|
3143
3854
|
}
|
|
3144
3855
|
);
|
|
3145
3856
|
}
|
|
@@ -3151,12 +3862,12 @@ var import_components25 = require("@transferwise/components");
|
|
|
3151
3862
|
|
|
3152
3863
|
// ../renderers/src/DecisionRenderer/DecisionWrapper.tsx
|
|
3153
3864
|
var import_components24 = require("@transferwise/components");
|
|
3154
|
-
var
|
|
3155
|
-
var
|
|
3865
|
+
var import_react12 = require("react");
|
|
3866
|
+
var import_react_intl17 = require("react-intl");
|
|
3156
3867
|
|
|
3157
3868
|
// ../renderers/src/messages/filter.messages.ts
|
|
3158
|
-
var
|
|
3159
|
-
var filter_messages_default = (0,
|
|
3869
|
+
var import_react_intl14 = require("react-intl");
|
|
3870
|
+
var filter_messages_default = (0, import_react_intl14.defineMessages)({
|
|
3160
3871
|
placeholder: {
|
|
3161
3872
|
id: "df.wise.filter.placeholder",
|
|
3162
3873
|
defaultMessage: "Start typing to search",
|
|
@@ -3223,11 +3934,11 @@ var normalizeAndRemoveAccents = (text) => text.trim().toLowerCase().normalize("N
|
|
|
3223
3934
|
|
|
3224
3935
|
// ../renderers/src/DecisionRenderer/GroupedDecisionList.tsx
|
|
3225
3936
|
var import_components23 = require("@transferwise/components");
|
|
3226
|
-
var
|
|
3937
|
+
var import_react_intl16 = require("react-intl");
|
|
3227
3938
|
|
|
3228
3939
|
// ../renderers/src/messages/group.messages.ts
|
|
3229
|
-
var
|
|
3230
|
-
var group_messages_default = (0,
|
|
3940
|
+
var import_react_intl15 = require("react-intl");
|
|
3941
|
+
var group_messages_default = (0, import_react_intl15.defineMessages)({
|
|
3231
3942
|
all: {
|
|
3232
3943
|
id: "df.wise.group.all",
|
|
3233
3944
|
defaultMessage: "All",
|
|
@@ -3261,18 +3972,18 @@ var getGroupsFromTags = (knownTags, items) => {
|
|
|
3261
3972
|
};
|
|
3262
3973
|
|
|
3263
3974
|
// ../renderers/src/DecisionRenderer/GroupedDecisionList.tsx
|
|
3264
|
-
var
|
|
3975
|
+
var import_jsx_runtime47 = require("react/jsx-runtime");
|
|
3265
3976
|
var groupingTags = Object.keys(group_messages_default).filter((key) => key !== "all");
|
|
3266
3977
|
var isGroupedDecision = (options) => {
|
|
3267
3978
|
return getGroupsFromTags(groupingTags, options).length > 0;
|
|
3268
3979
|
};
|
|
3269
3980
|
var GroupedDecisionList = (_a) => {
|
|
3270
3981
|
var _b = _a, { renderDecisionList: renderDecisionList2 } = _b, rest = __objRest(_b, ["renderDecisionList"]);
|
|
3271
|
-
const { formatMessage } = (0,
|
|
3982
|
+
const { formatMessage } = (0, import_react_intl16.useIntl)();
|
|
3272
3983
|
const { options } = rest;
|
|
3273
3984
|
const itemsByTag = [...getGroupsFromTags(groupingTags, options), { tag: "all", items: options }];
|
|
3274
|
-
return /* @__PURE__ */ (0,
|
|
3275
|
-
/* @__PURE__ */ (0,
|
|
3985
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_jsx_runtime47.Fragment, { children: itemsByTag.map(({ tag, items }) => /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(import_components23.Section, { children: [
|
|
3986
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
3276
3987
|
import_components23.Header,
|
|
3277
3988
|
{
|
|
3278
3989
|
as: "h2",
|
|
@@ -3284,27 +3995,27 @@ var GroupedDecisionList = (_a) => {
|
|
|
3284
3995
|
};
|
|
3285
3996
|
|
|
3286
3997
|
// ../renderers/src/DecisionRenderer/DecisionWrapper.tsx
|
|
3287
|
-
var
|
|
3288
|
-
var
|
|
3998
|
+
var import_classnames11 = __toESM(require_classnames());
|
|
3999
|
+
var import_jsx_runtime48 = require("react/jsx-runtime");
|
|
3289
4000
|
var DecisionWrapper = (props) => {
|
|
3290
4001
|
const { margin, control, title, tags } = props;
|
|
3291
|
-
return /* @__PURE__ */ (0,
|
|
3292
|
-
title && /* @__PURE__ */ (0,
|
|
3293
|
-
control === "filtered" ? /* @__PURE__ */ (0,
|
|
4002
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { className: (0, import_classnames11.default)(getMargin(margin), controlAndTagsToCSSClass({ control, tags })), children: [
|
|
4003
|
+
title && /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_components24.Header, { as: "h2", title }),
|
|
4004
|
+
control === "filtered" ? /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(FilteredDecisionList, __spreadValues({}, props)) : /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(UnfilteredDecisionList, __spreadValues({}, props))
|
|
3294
4005
|
] });
|
|
3295
4006
|
};
|
|
3296
4007
|
var UnfilteredDecisionList = (_a) => {
|
|
3297
4008
|
var _b = _a, { renderDecisionList: renderDecisionList2 } = _b, rest = __objRest(_b, ["renderDecisionList"]);
|
|
3298
|
-
return isGroupedDecision(rest.options) ? /* @__PURE__ */ (0,
|
|
4009
|
+
return isGroupedDecision(rest.options) ? /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(GroupedDecisionList, __spreadProps(__spreadValues({}, rest), { renderDecisionList: renderDecisionList2 })) : renderDecisionList2(rest);
|
|
3299
4010
|
};
|
|
3300
4011
|
var FilteredDecisionList = (props) => {
|
|
3301
|
-
const { formatMessage } = (0,
|
|
3302
|
-
const [query, setQuery] = (0,
|
|
4012
|
+
const { formatMessage } = (0, import_react_intl17.useIntl)();
|
|
4013
|
+
const [query, setQuery] = (0, import_react12.useState)("");
|
|
3303
4014
|
const { control, options, renderDecisionList: renderDecisionList2 } = props;
|
|
3304
4015
|
const filteredOptions = (query == null ? void 0 : query.length) > 0 ? filterAndSortItems(options, query) : options;
|
|
3305
4016
|
const isGrouped = isGroupedDecision(options);
|
|
3306
|
-
return /* @__PURE__ */ (0,
|
|
3307
|
-
/* @__PURE__ */ (0,
|
|
4017
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(import_jsx_runtime48.Fragment, { children: [
|
|
4018
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
3308
4019
|
import_components24.SearchInput,
|
|
3309
4020
|
{
|
|
3310
4021
|
placeholder: formatMessage(filter_messages_default.placeholder),
|
|
@@ -3316,25 +4027,25 @@ var FilteredDecisionList = (props) => {
|
|
|
3316
4027
|
}
|
|
3317
4028
|
}
|
|
3318
4029
|
),
|
|
3319
|
-
isGrouped && query.length === 0 ? /* @__PURE__ */ (0,
|
|
3320
|
-
query.length > 0 && /* @__PURE__ */ (0,
|
|
4030
|
+
isGrouped && query.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(GroupedDecisionList, __spreadValues({}, props)) : /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(import_jsx_runtime48.Fragment, { children: [
|
|
4031
|
+
query.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_components24.Header, { as: "h2", title: formatMessage(filter_messages_default.results), className: "m-t-4" }),
|
|
3321
4032
|
filteredOptions.length > 0 ? renderDecisionList2({
|
|
3322
4033
|
control,
|
|
3323
4034
|
className: query.length === 0 ? "m-t-3" : "",
|
|
3324
4035
|
options: filteredOptions
|
|
3325
|
-
}) : /* @__PURE__ */ (0,
|
|
4036
|
+
}) : /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("p", { children: formatMessage(filter_messages_default.noResults) })
|
|
3326
4037
|
] })
|
|
3327
4038
|
] });
|
|
3328
4039
|
};
|
|
3329
4040
|
|
|
3330
4041
|
// ../renderers/src/DecisionRenderer/DecisionRenderer.tsx
|
|
3331
|
-
var
|
|
4042
|
+
var import_jsx_runtime49 = require("react/jsx-runtime");
|
|
3332
4043
|
var DecisionRenderer = {
|
|
3333
4044
|
canRenderType: "decision",
|
|
3334
|
-
render: (props) => /* @__PURE__ */ (0,
|
|
4045
|
+
render: (props) => /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(DecisionWrapper, __spreadProps(__spreadValues({}, props), { renderDecisionList }))
|
|
3335
4046
|
};
|
|
3336
4047
|
var renderDecisionList = ({ options, control }) => {
|
|
3337
|
-
return /* @__PURE__ */ (0,
|
|
4048
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_jsx_runtime49.Fragment, { children: options.map((_a) => {
|
|
3338
4049
|
var _b = _a, { onClick } = _b, rest = __objRest(_b, ["onClick"]);
|
|
3339
4050
|
const {
|
|
3340
4051
|
description,
|
|
@@ -3347,7 +4058,7 @@ var renderDecisionList = ({ options, control }) => {
|
|
|
3347
4058
|
supportingValues,
|
|
3348
4059
|
tags
|
|
3349
4060
|
} = rest;
|
|
3350
|
-
return /* @__PURE__ */ (0,
|
|
4061
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
3351
4062
|
import_components25.ListItem,
|
|
3352
4063
|
{
|
|
3353
4064
|
title: itemTitle,
|
|
@@ -3359,7 +4070,7 @@ var renderDecisionList = ({ options, control }) => {
|
|
|
3359
4070
|
media: getMedia(media, shouldUseAvatar(control, tags)),
|
|
3360
4071
|
prompt: getInlineAlert(inlineAlert),
|
|
3361
4072
|
additionalInfo: additionalText ? getAdditionalInfo({ text: additionalText }) : void 0,
|
|
3362
|
-
control: /* @__PURE__ */ (0,
|
|
4073
|
+
control: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_components25.ListItem.Navigation, __spreadValues({}, getAnchorProps()))
|
|
3363
4074
|
},
|
|
3364
4075
|
JSON.stringify(rest)
|
|
3365
4076
|
);
|
|
@@ -3369,8 +4080,8 @@ var DecisionRenderer_default = DecisionRenderer;
|
|
|
3369
4080
|
|
|
3370
4081
|
// ../renderers/src/DividerRenderer.tsx
|
|
3371
4082
|
var import_components26 = require("@transferwise/components");
|
|
3372
|
-
var
|
|
3373
|
-
var
|
|
4083
|
+
var import_classnames12 = __toESM(require_classnames());
|
|
4084
|
+
var import_jsx_runtime50 = require("react/jsx-runtime");
|
|
3374
4085
|
var mapControlToLevel = (control) => {
|
|
3375
4086
|
switch (control) {
|
|
3376
4087
|
case "section":
|
|
@@ -3383,10 +4094,10 @@ var mapControlToLevel = (control) => {
|
|
|
3383
4094
|
};
|
|
3384
4095
|
var DividerRenderer = {
|
|
3385
4096
|
canRenderType: "divider",
|
|
3386
|
-
render: ({ margin, control, tags }) => /* @__PURE__ */ (0,
|
|
4097
|
+
render: ({ margin, control, tags }) => /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
3387
4098
|
import_components26.Divider,
|
|
3388
4099
|
{
|
|
3389
|
-
className: (0,
|
|
4100
|
+
className: (0, import_classnames12.default)(
|
|
3390
4101
|
"m-t-0",
|
|
3391
4102
|
"d-block",
|
|
3392
4103
|
getMargin(margin),
|
|
@@ -3402,8 +4113,8 @@ var DividerRenderer_default = DividerRenderer;
|
|
|
3402
4113
|
var import_components27 = require("@transferwise/components");
|
|
3403
4114
|
|
|
3404
4115
|
// ../renderers/src/messages/external-confirmation.messages.ts
|
|
3405
|
-
var
|
|
3406
|
-
var external_confirmation_messages_default = (0,
|
|
4116
|
+
var import_react_intl18 = require("react-intl");
|
|
4117
|
+
var external_confirmation_messages_default = (0, import_react_intl18.defineMessages)({
|
|
3407
4118
|
title: {
|
|
3408
4119
|
id: "df.wise.ExternalConfirmation.title",
|
|
3409
4120
|
defaultMessage: "Please confirm",
|
|
@@ -3427,9 +4138,9 @@ var external_confirmation_messages_default = (0, import_react_intl16.defineMessa
|
|
|
3427
4138
|
});
|
|
3428
4139
|
|
|
3429
4140
|
// ../renderers/src/ExternalConfirmationRenderer.tsx
|
|
3430
|
-
var
|
|
3431
|
-
var
|
|
3432
|
-
var
|
|
4141
|
+
var import_react_intl19 = require("react-intl");
|
|
4142
|
+
var import_react13 = require("react");
|
|
4143
|
+
var import_jsx_runtime51 = require("react/jsx-runtime");
|
|
3433
4144
|
var ExternalConfirmationRenderer = {
|
|
3434
4145
|
canRenderType: "external-confirmation",
|
|
3435
4146
|
render: ExternalConfirmationRendererComponent
|
|
@@ -3442,19 +4153,19 @@ function ExternalConfirmationRendererComponent({
|
|
|
3442
4153
|
control,
|
|
3443
4154
|
tags
|
|
3444
4155
|
}) {
|
|
3445
|
-
const { formatMessage } = (0,
|
|
3446
|
-
(0,
|
|
4156
|
+
const { formatMessage } = (0, import_react_intl19.useIntl)();
|
|
4157
|
+
(0, import_react13.useEffect)(() => {
|
|
3447
4158
|
open();
|
|
3448
4159
|
}, []);
|
|
3449
|
-
return /* @__PURE__ */ (0,
|
|
4160
|
+
return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
3450
4161
|
import_components27.Modal,
|
|
3451
4162
|
{
|
|
3452
4163
|
open: visible,
|
|
3453
4164
|
title: formatMessage(external_confirmation_messages_default.title),
|
|
3454
|
-
body: /* @__PURE__ */ (0,
|
|
3455
|
-
/* @__PURE__ */ (0,
|
|
3456
|
-
/* @__PURE__ */ (0,
|
|
3457
|
-
/* @__PURE__ */ (0,
|
|
4165
|
+
body: /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(import_jsx_runtime51.Fragment, { children: [
|
|
4166
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_components27.Markdown, { config: { link: { target: "_blank" } }, className: "text-xs-center m-b-5", children: formatMessage(external_confirmation_messages_default.description, { origin: getOrigin(url) }) }),
|
|
4167
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", { className: "df-box-renderer-fixed-width", children: /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("div", { className: "df-box-renderer-width-lg", children: [
|
|
4168
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
3458
4169
|
import_components27.Button,
|
|
3459
4170
|
{
|
|
3460
4171
|
v2: true,
|
|
@@ -3468,7 +4179,7 @@ function ExternalConfirmationRendererComponent({
|
|
|
3468
4179
|
children: formatMessage(external_confirmation_messages_default.open)
|
|
3469
4180
|
}
|
|
3470
4181
|
),
|
|
3471
|
-
/* @__PURE__ */ (0,
|
|
4182
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_components27.Button, { v2: true, block: true, className: "m-b-2", priority: "tertiary", size: "md", onClick: onCancel, children: formatMessage(external_confirmation_messages_default.cancel) })
|
|
3472
4183
|
] }) })
|
|
3473
4184
|
] }),
|
|
3474
4185
|
className: controlAndTagsToCSSClass({ control, tags }),
|
|
@@ -3486,28 +4197,28 @@ function getOrigin(url) {
|
|
|
3486
4197
|
var ExternalConfirmationRenderer_default = ExternalConfirmationRenderer;
|
|
3487
4198
|
|
|
3488
4199
|
// ../renderers/src/FormRenderer.tsx
|
|
3489
|
-
var
|
|
3490
|
-
var
|
|
4200
|
+
var import_classnames13 = __toESM(require_classnames());
|
|
4201
|
+
var import_jsx_runtime52 = require("react/jsx-runtime");
|
|
3491
4202
|
var FormRenderer = {
|
|
3492
4203
|
canRenderType: "form",
|
|
3493
|
-
render: ({ children, margin, control, tags }) => /* @__PURE__ */ (0,
|
|
4204
|
+
render: ({ children, margin, control, tags }) => /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("div", { className: (0, import_classnames13.default)(getMargin(margin), controlAndTagsToCSSClass({ control, tags })), children })
|
|
3494
4205
|
};
|
|
3495
4206
|
var FormRenderer_default = FormRenderer;
|
|
3496
4207
|
|
|
3497
4208
|
// ../renderers/src/FormSectionRenderer.tsx
|
|
3498
4209
|
var import_components28 = require("@transferwise/components");
|
|
3499
|
-
var
|
|
4210
|
+
var import_jsx_runtime53 = require("react/jsx-runtime");
|
|
3500
4211
|
var FormSectionRenderer = {
|
|
3501
4212
|
canRenderType: "form-section",
|
|
3502
|
-
render: ({ title, description, children, control, tags }) => /* @__PURE__ */ (0,
|
|
3503
|
-
title && /* @__PURE__ */ (0,
|
|
4213
|
+
render: ({ title, description, children, control, tags }) => /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("fieldset", { className: controlAndTagsToCSSClass({ control, tags }), children: [
|
|
4214
|
+
title && /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
3504
4215
|
import_components28.Header,
|
|
3505
4216
|
{
|
|
3506
4217
|
as: "h2",
|
|
3507
4218
|
title
|
|
3508
4219
|
}
|
|
3509
4220
|
),
|
|
3510
|
-
description && /* @__PURE__ */ (0,
|
|
4221
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("p", { children: description }),
|
|
3511
4222
|
children
|
|
3512
4223
|
] })
|
|
3513
4224
|
};
|
|
@@ -3515,22 +4226,22 @@ var FormSectionRenderer_default = FormSectionRenderer;
|
|
|
3515
4226
|
|
|
3516
4227
|
// ../renderers/src/HeadingRenderer.tsx
|
|
3517
4228
|
var import_components29 = require("@transferwise/components");
|
|
3518
|
-
var
|
|
3519
|
-
var
|
|
4229
|
+
var import_classnames14 = __toESM(require_classnames());
|
|
4230
|
+
var import_jsx_runtime54 = require("react/jsx-runtime");
|
|
3520
4231
|
var HeadingRenderer = {
|
|
3521
4232
|
canRenderType: "heading",
|
|
3522
4233
|
render: Heading
|
|
3523
4234
|
};
|
|
3524
4235
|
function Heading(props) {
|
|
3525
4236
|
const { text, size, align, margin, control } = props;
|
|
3526
|
-
const className = (0,
|
|
4237
|
+
const className = (0, import_classnames14.default)(
|
|
3527
4238
|
getTextAlignmentAndMargin({ align, margin }),
|
|
3528
4239
|
controlAndTagsToCSSClass(props)
|
|
3529
4240
|
);
|
|
3530
|
-
return control === "display" ? /* @__PURE__ */ (0,
|
|
4241
|
+
return control === "display" ? /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(DisplayHeading, { size, text, className }) : /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(StandardHeading, { size, text, className });
|
|
3531
4242
|
}
|
|
3532
4243
|
function DisplayHeading({ size, text, className }) {
|
|
3533
|
-
return /* @__PURE__ */ (0,
|
|
4244
|
+
return /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(import_components29.Display, { type: getDisplayType(size), className, children: text });
|
|
3534
4245
|
}
|
|
3535
4246
|
var getDisplayType = (size) => {
|
|
3536
4247
|
switch (size) {
|
|
@@ -3546,7 +4257,7 @@ var getDisplayType = (size) => {
|
|
|
3546
4257
|
}
|
|
3547
4258
|
};
|
|
3548
4259
|
function StandardHeading({ size, text, className }) {
|
|
3549
|
-
return /* @__PURE__ */ (0,
|
|
4260
|
+
return /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(import_components29.Title, { type: getTitleTypeBySize(size), className, children: text });
|
|
3550
4261
|
}
|
|
3551
4262
|
var getTitleTypeBySize = (size) => {
|
|
3552
4263
|
var _a;
|
|
@@ -3563,8 +4274,8 @@ var HeadingRenderer_default = HeadingRenderer;
|
|
|
3563
4274
|
|
|
3564
4275
|
// ../renderers/src/ImageRenderer/UrlImage.tsx
|
|
3565
4276
|
var import_components30 = require("@transferwise/components");
|
|
3566
|
-
var
|
|
3567
|
-
var
|
|
4277
|
+
var import_classnames15 = __toESM(require_classnames());
|
|
4278
|
+
var import_react14 = require("react");
|
|
3568
4279
|
|
|
3569
4280
|
// ../renderers/src/utils/api-utils.ts
|
|
3570
4281
|
function isRelativePath(url = "") {
|
|
@@ -3574,7 +4285,7 @@ function isRelativePath(url = "") {
|
|
|
3574
4285
|
}
|
|
3575
4286
|
|
|
3576
4287
|
// ../renderers/src/ImageRenderer/UrlImage.tsx
|
|
3577
|
-
var
|
|
4288
|
+
var import_jsx_runtime55 = require("react/jsx-runtime");
|
|
3578
4289
|
function UrlImage({
|
|
3579
4290
|
accessibilityDescription,
|
|
3580
4291
|
align,
|
|
@@ -3585,23 +4296,23 @@ function UrlImage({
|
|
|
3585
4296
|
uri,
|
|
3586
4297
|
httpClient
|
|
3587
4298
|
}) {
|
|
3588
|
-
const [imageSource, setImageSource] = (0,
|
|
3589
|
-
(0,
|
|
4299
|
+
const [imageSource, setImageSource] = (0, import_react14.useState)("");
|
|
4300
|
+
(0, import_react14.useEffect)(() => {
|
|
3590
4301
|
if (!uri.startsWith("urn:")) {
|
|
3591
4302
|
void getImageSource(httpClient, uri).then(setImageSource);
|
|
3592
4303
|
}
|
|
3593
4304
|
}, [uri, httpClient]);
|
|
3594
|
-
return /* @__PURE__ */ (0,
|
|
4305
|
+
return /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
3595
4306
|
"div",
|
|
3596
4307
|
{
|
|
3597
|
-
className: (0,
|
|
4308
|
+
className: (0, import_classnames15.default)(
|
|
3598
4309
|
"df-image",
|
|
3599
4310
|
align,
|
|
3600
4311
|
size || "md",
|
|
3601
4312
|
getMargin(margin),
|
|
3602
4313
|
controlAndTagsToCSSClass({ control, tags })
|
|
3603
4314
|
),
|
|
3604
|
-
children: /* @__PURE__ */ (0,
|
|
4315
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
3605
4316
|
import_components30.Image,
|
|
3606
4317
|
{
|
|
3607
4318
|
className: "df-reserve-space",
|
|
@@ -3647,10 +4358,10 @@ var getImageSource = async (httpClient, imageUrl) => {
|
|
|
3647
4358
|
};
|
|
3648
4359
|
|
|
3649
4360
|
// ../renderers/src/ImageRenderer/ImageRenderer.tsx
|
|
3650
|
-
var
|
|
4361
|
+
var import_jsx_runtime56 = require("react/jsx-runtime");
|
|
3651
4362
|
var ImageRenderer = {
|
|
3652
4363
|
canRenderType: "image",
|
|
3653
|
-
render: (props) => isUrnImage(props.uri) ? /* @__PURE__ */ (0,
|
|
4364
|
+
render: (props) => isUrnImage(props.uri) ? /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(UrnImage, __spreadValues({}, props)) : /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(UrlImage, __spreadValues({}, props))
|
|
3654
4365
|
};
|
|
3655
4366
|
|
|
3656
4367
|
// ../renderers/src/ImageRenderer/index.tsx
|
|
@@ -3658,8 +4369,8 @@ var ImageRenderer_default = ImageRenderer;
|
|
|
3658
4369
|
|
|
3659
4370
|
// ../renderers/src/InstructionsRenderer.tsx
|
|
3660
4371
|
var import_components31 = require("@transferwise/components");
|
|
3661
|
-
var
|
|
3662
|
-
var
|
|
4372
|
+
var import_classnames16 = __toESM(require_classnames());
|
|
4373
|
+
var import_jsx_runtime57 = require("react/jsx-runtime");
|
|
3663
4374
|
var doContext = ["positive", "neutral", "proposition"];
|
|
3664
4375
|
var dontContext = ["warning", "negative"];
|
|
3665
4376
|
var InstructionsRenderer = {
|
|
@@ -3667,9 +4378,9 @@ var InstructionsRenderer = {
|
|
|
3667
4378
|
render: ({ items, margin, title, control, tags }) => {
|
|
3668
4379
|
const dos = items.filter((item) => doContext.includes(item.context)).map(({ text }) => text);
|
|
3669
4380
|
const donts = items.filter((item) => dontContext.includes(item.context)).map(({ text }) => text);
|
|
3670
|
-
return /* @__PURE__ */ (0,
|
|
3671
|
-
title ? /* @__PURE__ */ (0,
|
|
3672
|
-
/* @__PURE__ */ (0,
|
|
4381
|
+
return /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("div", { className: (0, import_classnames16.default)(getMargin(margin), controlAndTagsToCSSClass({ control, tags })), children: [
|
|
4382
|
+
title ? /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(import_components31.Header, { title }) : null,
|
|
4383
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(import_components31.InstructionsList, { dos, donts })
|
|
3673
4384
|
] });
|
|
3674
4385
|
}
|
|
3675
4386
|
};
|
|
@@ -3701,7 +4412,7 @@ function pick(obj, ...keys) {
|
|
|
3701
4412
|
}
|
|
3702
4413
|
|
|
3703
4414
|
// ../renderers/src/IntegerInputRenderer.tsx
|
|
3704
|
-
var
|
|
4415
|
+
var import_jsx_runtime58 = require("react/jsx-runtime");
|
|
3705
4416
|
var IntegerInputRenderer = {
|
|
3706
4417
|
canRenderType: "input-integer",
|
|
3707
4418
|
render: (props) => {
|
|
@@ -3716,7 +4427,7 @@ var IntegerInputRenderer = {
|
|
|
3716
4427
|
"maximum",
|
|
3717
4428
|
"minimum"
|
|
3718
4429
|
);
|
|
3719
|
-
return /* @__PURE__ */ (0,
|
|
4430
|
+
return /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
3720
4431
|
FieldInput_default,
|
|
3721
4432
|
{
|
|
3722
4433
|
id,
|
|
@@ -3729,7 +4440,7 @@ var IntegerInputRenderer = {
|
|
|
3729
4440
|
features: props.features,
|
|
3730
4441
|
control: props.control,
|
|
3731
4442
|
tags: props.tags,
|
|
3732
|
-
children: /* @__PURE__ */ (0,
|
|
4443
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(import_components32.InputGroup, { addonStart: getInputGroupAddonStart(media), children: /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
3733
4444
|
import_components32.Input,
|
|
3734
4445
|
__spreadValues({
|
|
3735
4446
|
id,
|
|
@@ -3753,12 +4464,12 @@ var IntegerInputRenderer_default = IntegerInputRenderer;
|
|
|
3753
4464
|
|
|
3754
4465
|
// ../renderers/src/ListRenderer.tsx
|
|
3755
4466
|
var import_components34 = require("@transferwise/components");
|
|
3756
|
-
var
|
|
4467
|
+
var import_classnames17 = __toESM(require_classnames());
|
|
3757
4468
|
|
|
3758
4469
|
// ../renderers/src/components/Header.tsx
|
|
3759
4470
|
var import_components33 = require("@transferwise/components");
|
|
3760
|
-
var
|
|
3761
|
-
var Header = ({ title, callToAction }) => (title || callToAction) && /* @__PURE__ */ (0,
|
|
4471
|
+
var import_jsx_runtime59 = require("react/jsx-runtime");
|
|
4472
|
+
var Header = ({ title, callToAction }) => (title || callToAction) && /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(import_components33.Header, { title: title != null ? title : "", action: getHeaderAction(callToAction) });
|
|
3762
4473
|
var getHeaderAction = (callToAction) => {
|
|
3763
4474
|
if (!callToAction) {
|
|
3764
4475
|
return void 0;
|
|
@@ -3770,11 +4481,11 @@ var getHeaderAction = (callToAction) => {
|
|
|
3770
4481
|
};
|
|
3771
4482
|
|
|
3772
4483
|
// ../renderers/src/ListRenderer.tsx
|
|
3773
|
-
var
|
|
4484
|
+
var import_jsx_runtime60 = require("react/jsx-runtime");
|
|
3774
4485
|
var ListRenderer = {
|
|
3775
4486
|
canRenderType: "list",
|
|
3776
|
-
render: ({ callToAction, control, margin, items, tags, title }) => /* @__PURE__ */ (0,
|
|
3777
|
-
/* @__PURE__ */ (0,
|
|
4487
|
+
render: ({ callToAction, control, margin, items, tags, title }) => /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("div", { className: (0, import_classnames17.default)(getMargin(margin), controlAndTagsToCSSClass({ control, tags })), children: [
|
|
4488
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)(Header, { title, callToAction }),
|
|
3778
4489
|
items.map((item) => {
|
|
3779
4490
|
var _a, _b;
|
|
3780
4491
|
const {
|
|
@@ -3791,7 +4502,7 @@ var ListRenderer = {
|
|
|
3791
4502
|
ctaSecondary: (_a = itemTags == null ? void 0 : itemTags.includes("cta-secondary")) != null ? _a : false,
|
|
3792
4503
|
fullyInteractive: (_b = (tags == null ? void 0 : tags.includes("fully-interactive")) && (additionalInfo == null ? void 0 : additionalInfo.onClick) == null) != null ? _b : false
|
|
3793
4504
|
};
|
|
3794
|
-
return /* @__PURE__ */ (0,
|
|
4505
|
+
return /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
3795
4506
|
import_components34.ListItem,
|
|
3796
4507
|
{
|
|
3797
4508
|
title: itemTitle,
|
|
@@ -3812,16 +4523,16 @@ var ListRenderer_default = ListRenderer;
|
|
|
3812
4523
|
|
|
3813
4524
|
// ../renderers/src/LoadingIndicatorRenderer.tsx
|
|
3814
4525
|
var import_components35 = require("@transferwise/components");
|
|
3815
|
-
var
|
|
3816
|
-
var
|
|
4526
|
+
var import_classnames18 = __toESM(require_classnames());
|
|
4527
|
+
var import_jsx_runtime61 = require("react/jsx-runtime");
|
|
3817
4528
|
var LoadingIndicatorRenderer = {
|
|
3818
4529
|
canRenderType: "loading-indicator",
|
|
3819
|
-
render: ({ size, margin, control, tags }) => /* @__PURE__ */ (0,
|
|
4530
|
+
render: ({ size, margin, control, tags }) => /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
3820
4531
|
import_components35.Loader,
|
|
3821
4532
|
{
|
|
3822
4533
|
size,
|
|
3823
4534
|
classNames: {
|
|
3824
|
-
"tw-loader": (0,
|
|
4535
|
+
"tw-loader": (0, import_classnames18.default)(
|
|
3825
4536
|
"tw-loader",
|
|
3826
4537
|
"m-x-auto",
|
|
3827
4538
|
getMargin(margin),
|
|
@@ -3836,23 +4547,23 @@ var LoadingIndicatorRenderer_default = LoadingIndicatorRenderer;
|
|
|
3836
4547
|
|
|
3837
4548
|
// ../renderers/src/MarkdownRenderer.tsx
|
|
3838
4549
|
var import_components36 = require("@transferwise/components");
|
|
3839
|
-
var
|
|
3840
|
-
var
|
|
4550
|
+
var import_classnames19 = __toESM(require_classnames());
|
|
4551
|
+
var import_jsx_runtime62 = require("react/jsx-runtime");
|
|
3841
4552
|
var MarkdownRenderer = {
|
|
3842
4553
|
canRenderType: "markdown",
|
|
3843
4554
|
render: ({ content, align, margin, size, control, tags }) => {
|
|
3844
4555
|
const isLarge = !["xs", "sm"].includes(size);
|
|
3845
|
-
return /* @__PURE__ */ (0,
|
|
4556
|
+
return /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
3846
4557
|
"div",
|
|
3847
4558
|
{
|
|
3848
|
-
className: (0,
|
|
4559
|
+
className: (0, import_classnames19.default)(
|
|
3849
4560
|
getTextAlignmentAndMargin({ align, margin }),
|
|
3850
4561
|
controlAndTagsToCSSClass({ control, tags })
|
|
3851
4562
|
),
|
|
3852
|
-
children: /* @__PURE__ */ (0,
|
|
4563
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
3853
4564
|
import_components36.Markdown,
|
|
3854
4565
|
{
|
|
3855
|
-
className: (0,
|
|
4566
|
+
className: (0, import_classnames19.default)("df-markdown", {
|
|
3856
4567
|
"np-text-body-large": isLarge,
|
|
3857
4568
|
"np-text-body-default": !isLarge
|
|
3858
4569
|
}),
|
|
@@ -3867,17 +4578,17 @@ var MarkdownRenderer = {
|
|
|
3867
4578
|
var MarkdownRenderer_default = MarkdownRenderer;
|
|
3868
4579
|
|
|
3869
4580
|
// ../renderers/src/MediaRenderer.tsx
|
|
3870
|
-
var
|
|
3871
|
-
var
|
|
4581
|
+
var import_classnames20 = __toESM(require_classnames());
|
|
4582
|
+
var import_jsx_runtime63 = require("react/jsx-runtime");
|
|
3872
4583
|
var MediaRenderer = {
|
|
3873
4584
|
canRenderType: "media",
|
|
3874
4585
|
render: (_a) => {
|
|
3875
4586
|
var _b = _a, { media } = _b, rest = __objRest(_b, ["media"]);
|
|
3876
4587
|
switch (media.type) {
|
|
3877
4588
|
case "avatar":
|
|
3878
|
-
return /* @__PURE__ */ (0,
|
|
4589
|
+
return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(AvatarMediaRendererComponent, __spreadValues({ media }, rest));
|
|
3879
4590
|
case "image":
|
|
3880
|
-
return /* @__PURE__ */ (0,
|
|
4591
|
+
return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(ImageMediaRendererComponent, __spreadValues({ media }, rest));
|
|
3881
4592
|
case "legacy":
|
|
3882
4593
|
return null;
|
|
3883
4594
|
}
|
|
@@ -3891,16 +4602,16 @@ var AvatarMediaRendererComponent = ({
|
|
|
3891
4602
|
control,
|
|
3892
4603
|
tags
|
|
3893
4604
|
}) => {
|
|
3894
|
-
return /* @__PURE__ */ (0,
|
|
4605
|
+
return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
|
|
3895
4606
|
"div",
|
|
3896
4607
|
{
|
|
3897
|
-
className: (0,
|
|
4608
|
+
className: (0, import_classnames20.default)(
|
|
3898
4609
|
"df-media-layout-avatar",
|
|
3899
4610
|
align,
|
|
3900
4611
|
getMargin(margin),
|
|
3901
4612
|
controlAndTagsToCSSClass({ control, tags })
|
|
3902
4613
|
),
|
|
3903
|
-
children: /* @__PURE__ */ (0,
|
|
4614
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(Media, { media, size: mapAvatarMediaSize(size) })
|
|
3904
4615
|
}
|
|
3905
4616
|
);
|
|
3906
4617
|
};
|
|
@@ -3910,7 +4621,7 @@ var ImageMediaRendererComponent = (_a) => {
|
|
|
3910
4621
|
} = _b, rest = __objRest(_b, [
|
|
3911
4622
|
"media"
|
|
3912
4623
|
]);
|
|
3913
|
-
return isUrnImage(media.uri) ? /* @__PURE__ */ (0,
|
|
4624
|
+
return isUrnImage(media.uri) ? /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(UrnImage, __spreadValues({ uri: media.uri, accessibilityDescription: media.accessibilityDescription }, rest)) : /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(UrlImage, __spreadValues({ uri: media.uri, accessibilityDescription: media.accessibilityDescription }, rest));
|
|
3914
4625
|
};
|
|
3915
4626
|
var mapAvatarMediaSize = (size) => {
|
|
3916
4627
|
switch (size) {
|
|
@@ -3929,20 +4640,20 @@ var mapAvatarMediaSize = (size) => {
|
|
|
3929
4640
|
|
|
3930
4641
|
// ../renderers/src/ModalLayoutRenderer.tsx
|
|
3931
4642
|
var import_components37 = require("@transferwise/components");
|
|
3932
|
-
var
|
|
3933
|
-
var
|
|
3934
|
-
var
|
|
4643
|
+
var import_classnames21 = __toESM(require_classnames());
|
|
4644
|
+
var import_react15 = require("react");
|
|
4645
|
+
var import_jsx_runtime64 = require("react/jsx-runtime");
|
|
3935
4646
|
var ModalLayoutRenderer = {
|
|
3936
4647
|
canRenderType: "modal-layout",
|
|
3937
|
-
render: (props) => /* @__PURE__ */ (0,
|
|
4648
|
+
render: (props) => /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(DFModal, __spreadValues({}, props))
|
|
3938
4649
|
};
|
|
3939
4650
|
var ModalLayoutRenderer_default = ModalLayoutRenderer;
|
|
3940
4651
|
function DFModal({ content, margin, trigger, control, tags }) {
|
|
3941
|
-
const [visible, setVisible] = (0,
|
|
4652
|
+
const [visible, setVisible] = (0, import_react15.useState)(false);
|
|
3942
4653
|
const { children, title } = content;
|
|
3943
|
-
return /* @__PURE__ */ (0,
|
|
3944
|
-
/* @__PURE__ */ (0,
|
|
3945
|
-
/* @__PURE__ */ (0,
|
|
4654
|
+
return /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)("div", { className: (0, import_classnames21.default)(getMargin(margin), controlAndTagsToCSSClass({ control, tags })), children: [
|
|
4655
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)(import_components37.Button, { v2: true, priority: "tertiary", block: true, onClick: () => setVisible(true), children: trigger.title }),
|
|
4656
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
|
|
3946
4657
|
import_components37.Modal,
|
|
3947
4658
|
{
|
|
3948
4659
|
scroll: "content",
|
|
@@ -3958,11 +4669,11 @@ function DFModal({ content, margin, trigger, control, tags }) {
|
|
|
3958
4669
|
|
|
3959
4670
|
// ../renderers/src/ModalRenderer.tsx
|
|
3960
4671
|
var import_components38 = require("@transferwise/components");
|
|
3961
|
-
var
|
|
4672
|
+
var import_jsx_runtime65 = require("react/jsx-runtime");
|
|
3962
4673
|
var ModalRenderer = {
|
|
3963
4674
|
canRenderType: "modal",
|
|
3964
4675
|
render: ({ title, children, open, onClose, control, tags }) => {
|
|
3965
|
-
return /* @__PURE__ */ (0,
|
|
4676
|
+
return /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
3966
4677
|
import_components38.Modal,
|
|
3967
4678
|
{
|
|
3968
4679
|
open,
|
|
@@ -3977,9 +4688,9 @@ var ModalRenderer = {
|
|
|
3977
4688
|
|
|
3978
4689
|
// ../renderers/src/MoneyInputRenderer.tsx
|
|
3979
4690
|
var import_components39 = require("@transferwise/components");
|
|
3980
|
-
var
|
|
3981
|
-
var
|
|
3982
|
-
var
|
|
4691
|
+
var import_react16 = require("react");
|
|
4692
|
+
var import_react_intl20 = require("react-intl");
|
|
4693
|
+
var import_jsx_runtime66 = require("react/jsx-runtime");
|
|
3983
4694
|
var groupingTags2 = Object.keys(group_messages_default).filter((key) => key !== "all");
|
|
3984
4695
|
var MoneyInputRenderer = {
|
|
3985
4696
|
canRenderType: "money-input",
|
|
@@ -4003,13 +4714,13 @@ function MoneyInputRendererComponent(props) {
|
|
|
4003
4714
|
onAmountChange,
|
|
4004
4715
|
onCurrencyChange
|
|
4005
4716
|
} = props;
|
|
4006
|
-
(0,
|
|
4717
|
+
(0, import_react16.useEffect)(() => {
|
|
4007
4718
|
if (!isValidIndex(selectedCurrencyIndex, currencies.length)) {
|
|
4008
4719
|
onCurrencyChange(0);
|
|
4009
4720
|
}
|
|
4010
4721
|
}, [selectedCurrencyIndex, onCurrencyChange, currencies.length]);
|
|
4011
|
-
const { formatMessage } = (0,
|
|
4012
|
-
return /* @__PURE__ */ (0,
|
|
4722
|
+
const { formatMessage } = (0, import_react_intl20.useIntl)();
|
|
4723
|
+
return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
4013
4724
|
FieldInput_default,
|
|
4014
4725
|
{
|
|
4015
4726
|
id: uid,
|
|
@@ -4020,7 +4731,7 @@ function MoneyInputRendererComponent(props) {
|
|
|
4020
4731
|
features,
|
|
4021
4732
|
control,
|
|
4022
4733
|
tags,
|
|
4023
|
-
children: /* @__PURE__ */ (0,
|
|
4734
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
4024
4735
|
import_components39.MoneyInput,
|
|
4025
4736
|
{
|
|
4026
4737
|
amount: parseFloatOrNull(amountValue),
|
|
@@ -4083,8 +4794,8 @@ function assertCurrencyCodeIsString(currencyCode) {
|
|
|
4083
4794
|
|
|
4084
4795
|
// ../renderers/src/MultiSelectInputRenderer/InlineComponent.tsx
|
|
4085
4796
|
var import_components40 = require("@transferwise/components");
|
|
4086
|
-
var
|
|
4087
|
-
var
|
|
4797
|
+
var import_react17 = require("react");
|
|
4798
|
+
var import_react_intl21 = require("react-intl");
|
|
4088
4799
|
|
|
4089
4800
|
// ../renderers/src/utils/items-with-index.ts
|
|
4090
4801
|
var zipWithIndex = (items) => items.map((item, index) => __spreadProps(__spreadValues({}, item), {
|
|
@@ -4092,7 +4803,7 @@ var zipWithIndex = (items) => items.map((item, index) => __spreadProps(__spreadV
|
|
|
4092
4803
|
}));
|
|
4093
4804
|
|
|
4094
4805
|
// ../renderers/src/MultiSelectInputRenderer/InlineComponent.tsx
|
|
4095
|
-
var
|
|
4806
|
+
var import_jsx_runtime67 = require("react/jsx-runtime");
|
|
4096
4807
|
function InlineComponent(props) {
|
|
4097
4808
|
const {
|
|
4098
4809
|
id,
|
|
@@ -4109,12 +4820,12 @@ function InlineComponent(props) {
|
|
|
4109
4820
|
onSelect
|
|
4110
4821
|
} = props;
|
|
4111
4822
|
const optionsWithIndex = zipWithIndex(options);
|
|
4112
|
-
const [query, setQuery] = (0,
|
|
4113
|
-
const { formatMessage } = (0,
|
|
4823
|
+
const [query, setQuery] = (0, import_react17.useState)("");
|
|
4824
|
+
const { formatMessage } = (0, import_react_intl21.useIntl)();
|
|
4114
4825
|
const filtered = tags == null ? void 0 : tags.includes("filtered");
|
|
4115
4826
|
const filteredOptions = query ? filterAndSortItems(optionsWithIndex, filtered ? query : "") : optionsWithIndex;
|
|
4116
|
-
return /* @__PURE__ */ (0,
|
|
4117
|
-
filtered && /* @__PURE__ */ (0,
|
|
4827
|
+
return /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)(import_jsx_runtime67.Fragment, { children: [
|
|
4828
|
+
filtered && /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
4118
4829
|
import_components40.SearchInput,
|
|
4119
4830
|
{
|
|
4120
4831
|
placeholder: formatMessage(filter_messages_default.placeholder),
|
|
@@ -4127,7 +4838,7 @@ function InlineComponent(props) {
|
|
|
4127
4838
|
}
|
|
4128
4839
|
}
|
|
4129
4840
|
),
|
|
4130
|
-
/* @__PURE__ */ (0,
|
|
4841
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
4131
4842
|
FieldInput_default,
|
|
4132
4843
|
{
|
|
4133
4844
|
id,
|
|
@@ -4152,7 +4863,7 @@ function InlineComponent(props) {
|
|
|
4152
4863
|
childrenProps
|
|
4153
4864
|
} = option;
|
|
4154
4865
|
const key = (_a = childrenProps == null ? void 0 : childrenProps.uid) != null ? _a : index;
|
|
4155
|
-
return /* @__PURE__ */ (0,
|
|
4866
|
+
return /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
4156
4867
|
import_components40.ListItem,
|
|
4157
4868
|
{
|
|
4158
4869
|
title: itemTitle,
|
|
@@ -4161,9 +4872,9 @@ function InlineComponent(props) {
|
|
|
4161
4872
|
valueSubtitle: supportingValues == null ? void 0 : supportingValues.subvalue,
|
|
4162
4873
|
media: getMedia(media, false),
|
|
4163
4874
|
prompt: getInlineAlert(inlineAlert),
|
|
4164
|
-
additionalInfo: additionalText ? /* @__PURE__ */ (0,
|
|
4875
|
+
additionalInfo: additionalText ? /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(import_components40.ListItem.AdditionalInfo, { children: additionalText }) : void 0,
|
|
4165
4876
|
disabled: disabled || optionDisabled,
|
|
4166
|
-
control: /* @__PURE__ */ (0,
|
|
4877
|
+
control: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
4167
4878
|
import_components40.ListItem.Checkbox,
|
|
4168
4879
|
{
|
|
4169
4880
|
checked: selectedIndices.includes(index),
|
|
@@ -4184,12 +4895,12 @@ function InlineComponent(props) {
|
|
|
4184
4895
|
|
|
4185
4896
|
// ../renderers/src/MultiSelectInputRenderer/DefaultComponent.tsx
|
|
4186
4897
|
var import_components41 = require("@transferwise/components");
|
|
4187
|
-
var
|
|
4188
|
-
var
|
|
4898
|
+
var import_react18 = require("react");
|
|
4899
|
+
var import_react_intl23 = require("react-intl");
|
|
4189
4900
|
|
|
4190
4901
|
// ../renderers/src/messages/multi-select.messages.ts
|
|
4191
|
-
var
|
|
4192
|
-
var multi_select_messages_default = (0,
|
|
4902
|
+
var import_react_intl22 = require("react-intl");
|
|
4903
|
+
var multi_select_messages_default = (0, import_react_intl22.defineMessages)({
|
|
4193
4904
|
summary: {
|
|
4194
4905
|
id: "df.wise.MultiSelect.summary",
|
|
4195
4906
|
defaultMessage: "{first} and {count} more",
|
|
@@ -4198,10 +4909,10 @@ var multi_select_messages_default = (0, import_react_intl20.defineMessages)({
|
|
|
4198
4909
|
});
|
|
4199
4910
|
|
|
4200
4911
|
// ../renderers/src/MultiSelectInputRenderer/DefaultComponent.tsx
|
|
4201
|
-
var
|
|
4912
|
+
var import_jsx_runtime68 = require("react/jsx-runtime");
|
|
4202
4913
|
function DefaultComponent(props) {
|
|
4203
|
-
const { formatMessage } = (0,
|
|
4204
|
-
const [stagedIndices, setStagedIndices] = (0,
|
|
4914
|
+
const { formatMessage } = (0, import_react_intl23.useIntl)();
|
|
4915
|
+
const [stagedIndices, setStagedIndices] = (0, import_react18.useState)();
|
|
4205
4916
|
const {
|
|
4206
4917
|
id,
|
|
4207
4918
|
autoComplete,
|
|
@@ -4242,12 +4953,12 @@ function DefaultComponent(props) {
|
|
|
4242
4953
|
const contentProps = {
|
|
4243
4954
|
title: option.title,
|
|
4244
4955
|
description: option.description,
|
|
4245
|
-
icon: /* @__PURE__ */ (0,
|
|
4956
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(OptionMedia, { media: option.media, preferAvatar: false })
|
|
4246
4957
|
};
|
|
4247
|
-
return /* @__PURE__ */ (0,
|
|
4958
|
+
return /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(import_components41.SelectInputOptionContent, __spreadValues({}, contentProps));
|
|
4248
4959
|
};
|
|
4249
4960
|
const extraProps = { autoComplete };
|
|
4250
|
-
return /* @__PURE__ */ (0,
|
|
4961
|
+
return /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
|
|
4251
4962
|
FieldInput_default,
|
|
4252
4963
|
{
|
|
4253
4964
|
id,
|
|
@@ -4258,7 +4969,7 @@ function DefaultComponent(props) {
|
|
|
4258
4969
|
features,
|
|
4259
4970
|
control,
|
|
4260
4971
|
tags,
|
|
4261
|
-
children: /* @__PURE__ */ (0,
|
|
4972
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
|
|
4262
4973
|
import_components41.SelectInput,
|
|
4263
4974
|
__spreadValues({
|
|
4264
4975
|
id,
|
|
@@ -4298,7 +5009,7 @@ function DefaultComponent(props) {
|
|
|
4298
5009
|
|
|
4299
5010
|
// ../renderers/src/MultiSelectInputRenderer/InlineCheckboxComponent.tsx
|
|
4300
5011
|
var import_components42 = require("@transferwise/components");
|
|
4301
|
-
var
|
|
5012
|
+
var import_jsx_runtime69 = require("react/jsx-runtime");
|
|
4302
5013
|
function InlineCheckboxComponent(props) {
|
|
4303
5014
|
const {
|
|
4304
5015
|
id,
|
|
@@ -4314,7 +5025,7 @@ function InlineCheckboxComponent(props) {
|
|
|
4314
5025
|
tags,
|
|
4315
5026
|
onSelect
|
|
4316
5027
|
} = props;
|
|
4317
|
-
return /* @__PURE__ */ (0,
|
|
5028
|
+
return /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
4318
5029
|
FieldInput_default,
|
|
4319
5030
|
{
|
|
4320
5031
|
id,
|
|
@@ -4345,24 +5056,24 @@ function InlineCheckboxComponent(props) {
|
|
|
4345
5056
|
onSelect(newSelectedIndices);
|
|
4346
5057
|
}
|
|
4347
5058
|
};
|
|
4348
|
-
return /* @__PURE__ */ (0,
|
|
5059
|
+
return /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(import_components42.Checkbox, __spreadProps(__spreadValues({}, checkboxProps), { className: "m-t-1" }), key);
|
|
4349
5060
|
})
|
|
4350
5061
|
}
|
|
4351
5062
|
);
|
|
4352
5063
|
}
|
|
4353
5064
|
|
|
4354
5065
|
// ../renderers/src/MultiSelectInputRenderer/MultiSelectInputRenderer.tsx
|
|
4355
|
-
var
|
|
5066
|
+
var import_jsx_runtime70 = require("react/jsx-runtime");
|
|
4356
5067
|
var MultiSelectInputRenderer = {
|
|
4357
5068
|
canRenderType: "input-multi-select",
|
|
4358
5069
|
render: (props) => {
|
|
4359
5070
|
switch (props.control) {
|
|
4360
5071
|
case "inline":
|
|
4361
|
-
return /* @__PURE__ */ (0,
|
|
5072
|
+
return /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(InlineComponent, __spreadValues({}, props));
|
|
4362
5073
|
case "inline-checkbox-group":
|
|
4363
|
-
return /* @__PURE__ */ (0,
|
|
5074
|
+
return /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(InlineCheckboxComponent, __spreadValues({}, props));
|
|
4364
5075
|
default:
|
|
4365
|
-
return /* @__PURE__ */ (0,
|
|
5076
|
+
return /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(DefaultComponent, __spreadValues({}, props));
|
|
4366
5077
|
}
|
|
4367
5078
|
}
|
|
4368
5079
|
};
|
|
@@ -4372,8 +5083,8 @@ var import_components44 = require("@transferwise/components");
|
|
|
4372
5083
|
|
|
4373
5084
|
// ../renderers/src/components/UploadFieldInput.tsx
|
|
4374
5085
|
var import_components43 = require("@transferwise/components");
|
|
4375
|
-
var
|
|
4376
|
-
var
|
|
5086
|
+
var import_classnames22 = __toESM(require_classnames());
|
|
5087
|
+
var import_jsx_runtime71 = require("react/jsx-runtime");
|
|
4377
5088
|
function UploadFieldInput({
|
|
4378
5089
|
id,
|
|
4379
5090
|
children,
|
|
@@ -4385,14 +5096,14 @@ function UploadFieldInput({
|
|
|
4385
5096
|
control,
|
|
4386
5097
|
tags
|
|
4387
5098
|
}) {
|
|
4388
|
-
const labelContent = label && help ? /* @__PURE__ */ (0,
|
|
5099
|
+
const labelContent = label && help ? /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(LabelContentWithHelp, { text: label, help }) : label;
|
|
4389
5100
|
const descriptionId = description ? `${id}-description` : void 0;
|
|
4390
5101
|
const { ref } = useScrollToError(validation, features);
|
|
4391
|
-
return /* @__PURE__ */ (0,
|
|
5102
|
+
return /* @__PURE__ */ (0, import_jsx_runtime71.jsxs)(
|
|
4392
5103
|
"div",
|
|
4393
5104
|
{
|
|
4394
5105
|
ref,
|
|
4395
|
-
className: (0,
|
|
5106
|
+
className: (0, import_classnames22.default)(
|
|
4396
5107
|
"form-group d-block",
|
|
4397
5108
|
{
|
|
4398
5109
|
"has-error": (validation == null ? void 0 : validation.status) === "invalid"
|
|
@@ -4400,9 +5111,9 @@ function UploadFieldInput({
|
|
|
4400
5111
|
controlAndTagsToCSSClass({ control, tags })
|
|
4401
5112
|
),
|
|
4402
5113
|
children: [
|
|
4403
|
-
/* @__PURE__ */ (0,
|
|
5114
|
+
/* @__PURE__ */ (0, import_jsx_runtime71.jsx)("label", { htmlFor: id, className: "control-label", children: labelContent }),
|
|
4404
5115
|
children,
|
|
4405
|
-
(validation == null ? void 0 : validation.status) === "invalid" && /* @__PURE__ */ (0,
|
|
5116
|
+
(validation == null ? void 0 : validation.status) === "invalid" && /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(import_components43.InlineAlert, { type: "negative", id: descriptionId, children: validation.message })
|
|
4406
5117
|
]
|
|
4407
5118
|
}
|
|
4408
5119
|
);
|
|
@@ -4437,7 +5148,7 @@ var getSizeLimit = (maxSize) => {
|
|
|
4437
5148
|
};
|
|
4438
5149
|
|
|
4439
5150
|
// ../renderers/src/MultiUploadInputRenderer.tsx
|
|
4440
|
-
var
|
|
5151
|
+
var import_jsx_runtime72 = require("react/jsx-runtime");
|
|
4441
5152
|
var MultiUploadInputRenderer = {
|
|
4442
5153
|
canRenderType: "input-upload-multi",
|
|
4443
5154
|
render: (props) => {
|
|
@@ -4465,7 +5176,7 @@ var MultiUploadInputRenderer = {
|
|
|
4465
5176
|
};
|
|
4466
5177
|
const onDeleteFile = async (fileId) => onRemoveFile(value.findIndex((file) => file.id === fileId));
|
|
4467
5178
|
const descriptionId = description ? `${id}-description` : void 0;
|
|
4468
|
-
return /* @__PURE__ */ (0,
|
|
5179
|
+
return /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(
|
|
4469
5180
|
UploadFieldInput_default,
|
|
4470
5181
|
{
|
|
4471
5182
|
id,
|
|
@@ -4476,7 +5187,7 @@ var MultiUploadInputRenderer = {
|
|
|
4476
5187
|
features,
|
|
4477
5188
|
control,
|
|
4478
5189
|
tags,
|
|
4479
|
-
children: /* @__PURE__ */ (0,
|
|
5190
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(
|
|
4480
5191
|
import_components44.UploadInput,
|
|
4481
5192
|
{
|
|
4482
5193
|
id,
|
|
@@ -4505,7 +5216,7 @@ var MultiUploadInputRenderer_default = MultiUploadInputRenderer;
|
|
|
4505
5216
|
|
|
4506
5217
|
// ../renderers/src/NumberInputRenderer.tsx
|
|
4507
5218
|
var import_components45 = require("@transferwise/components");
|
|
4508
|
-
var
|
|
5219
|
+
var import_jsx_runtime73 = require("react/jsx-runtime");
|
|
4509
5220
|
var NumberInputRenderer = {
|
|
4510
5221
|
canRenderType: "input-number",
|
|
4511
5222
|
render: (props) => {
|
|
@@ -4519,7 +5230,7 @@ var NumberInputRenderer = {
|
|
|
4519
5230
|
"maximum",
|
|
4520
5231
|
"minimum"
|
|
4521
5232
|
);
|
|
4522
|
-
return /* @__PURE__ */ (0,
|
|
5233
|
+
return /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(
|
|
4523
5234
|
FieldInput_default,
|
|
4524
5235
|
{
|
|
4525
5236
|
id,
|
|
@@ -4532,7 +5243,7 @@ var NumberInputRenderer = {
|
|
|
4532
5243
|
features: props.features,
|
|
4533
5244
|
control: props.control,
|
|
4534
5245
|
tags: props.tags,
|
|
4535
|
-
children: /* @__PURE__ */ (0,
|
|
5246
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(import_components45.InputGroup, { addonStart: getInputGroupAddonStart(media), children: /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(
|
|
4536
5247
|
import_components45.Input,
|
|
4537
5248
|
__spreadValues({
|
|
4538
5249
|
id,
|
|
@@ -4554,21 +5265,21 @@ var NumberInputRenderer_default = NumberInputRenderer;
|
|
|
4554
5265
|
|
|
4555
5266
|
// ../renderers/src/ParagraphRenderer.tsx
|
|
4556
5267
|
var import_components47 = require("@transferwise/components");
|
|
4557
|
-
var
|
|
4558
|
-
var
|
|
5268
|
+
var import_classnames23 = __toESM(require_classnames());
|
|
5269
|
+
var import_react_intl25 = require("react-intl");
|
|
4559
5270
|
|
|
4560
5271
|
// ../renderers/src/hooks/useSnackBarIfAvailable.ts
|
|
4561
5272
|
var import_components46 = require("@transferwise/components");
|
|
4562
|
-
var
|
|
5273
|
+
var import_react19 = require("react");
|
|
4563
5274
|
function useSnackBarIfAvailable() {
|
|
4564
|
-
const context = (0,
|
|
5275
|
+
const context = (0, import_react19.useContext)(import_components46.SnackbarContext);
|
|
4565
5276
|
return context ? context.createSnackbar : () => {
|
|
4566
5277
|
};
|
|
4567
5278
|
}
|
|
4568
5279
|
|
|
4569
5280
|
// ../renderers/src/messages/paragraph.messages.ts
|
|
4570
|
-
var
|
|
4571
|
-
var paragraph_messages_default = (0,
|
|
5281
|
+
var import_react_intl24 = require("react-intl");
|
|
5282
|
+
var paragraph_messages_default = (0, import_react_intl24.defineMessages)({
|
|
4572
5283
|
copy: {
|
|
4573
5284
|
id: "df.wise.DynamicParagraph.copy",
|
|
4574
5285
|
defaultMessage: "Copy",
|
|
@@ -4582,18 +5293,18 @@ var paragraph_messages_default = (0, import_react_intl22.defineMessages)({
|
|
|
4582
5293
|
});
|
|
4583
5294
|
|
|
4584
5295
|
// ../renderers/src/ParagraphRenderer.tsx
|
|
4585
|
-
var
|
|
5296
|
+
var import_jsx_runtime74 = require("react/jsx-runtime");
|
|
4586
5297
|
var ParagraphRenderer = {
|
|
4587
5298
|
canRenderType: "paragraph",
|
|
4588
|
-
render: (props) => /* @__PURE__ */ (0,
|
|
5299
|
+
render: (props) => /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(Paragraph, __spreadValues({}, props))
|
|
4589
5300
|
};
|
|
4590
5301
|
function Paragraph(props) {
|
|
4591
5302
|
const { align, control, margin, size, text } = props;
|
|
4592
|
-
const className = (0,
|
|
5303
|
+
const className = (0, import_classnames23.default)(
|
|
4593
5304
|
getTextAlignmentAndMargin({ align, margin }),
|
|
4594
5305
|
controlAndTagsToCSSClass(props)
|
|
4595
5306
|
);
|
|
4596
|
-
return control === "copyable" ? /* @__PURE__ */ (0,
|
|
5307
|
+
return control === "copyable" ? /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(CopyableParagraph, { className, align, text }) : /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(
|
|
4597
5308
|
"p",
|
|
4598
5309
|
{
|
|
4599
5310
|
className: `${["xs", "sm"].includes(size) ? "np-text-body-default" : "np-text-body-large"} ${className}`,
|
|
@@ -4606,41 +5317,41 @@ function CopyableParagraph({
|
|
|
4606
5317
|
align,
|
|
4607
5318
|
className
|
|
4608
5319
|
}) {
|
|
4609
|
-
const { formatMessage } = (0,
|
|
5320
|
+
const { formatMessage } = (0, import_react_intl25.useIntl)();
|
|
4610
5321
|
const createSnackbar = useSnackBarIfAvailable();
|
|
4611
5322
|
const copy = () => {
|
|
4612
5323
|
navigator.clipboard.writeText(text).then(() => createSnackbar({ text: formatMessage(paragraph_messages_default.copied) })).catch(() => {
|
|
4613
5324
|
});
|
|
4614
5325
|
};
|
|
4615
5326
|
const inputAlignmentClasses = getTextAlignmentAndMargin({ align, margin: "sm" });
|
|
4616
|
-
return /* @__PURE__ */ (0,
|
|
4617
|
-
/* @__PURE__ */ (0,
|
|
5327
|
+
return /* @__PURE__ */ (0, import_jsx_runtime74.jsxs)("div", { className, children: [
|
|
5328
|
+
/* @__PURE__ */ (0, import_jsx_runtime74.jsx)(
|
|
4618
5329
|
import_components47.Input,
|
|
4619
5330
|
{
|
|
4620
5331
|
type: "text",
|
|
4621
5332
|
value: text,
|
|
4622
5333
|
readOnly: true,
|
|
4623
|
-
className: (0,
|
|
5334
|
+
className: (0, import_classnames23.default)("text-ellipsis", inputAlignmentClasses)
|
|
4624
5335
|
}
|
|
4625
5336
|
),
|
|
4626
|
-
/* @__PURE__ */ (0,
|
|
5337
|
+
/* @__PURE__ */ (0, import_jsx_runtime74.jsx)(import_components47.Button, { v2: true, block: true, onClick: copy, children: formatMessage(paragraph_messages_default.copy) })
|
|
4627
5338
|
] });
|
|
4628
5339
|
}
|
|
4629
5340
|
var ParagraphRenderer_default = ParagraphRenderer;
|
|
4630
5341
|
|
|
4631
5342
|
// ../renderers/src/ProgressRenderer.tsx
|
|
4632
5343
|
var import_components48 = require("@transferwise/components");
|
|
4633
|
-
var
|
|
4634
|
-
var
|
|
5344
|
+
var import_classnames24 = __toESM(require_classnames());
|
|
5345
|
+
var import_jsx_runtime75 = require("react/jsx-runtime");
|
|
4635
5346
|
var ProgressRenderer = {
|
|
4636
5347
|
canRenderType: "progress",
|
|
4637
5348
|
render: ({ uid, title, help, progress, progressText, margin, description, control, tags }) => {
|
|
4638
|
-
return /* @__PURE__ */ (0,
|
|
5349
|
+
return /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
|
|
4639
5350
|
import_components48.ProgressBar,
|
|
4640
5351
|
{
|
|
4641
5352
|
id: uid,
|
|
4642
|
-
className: (0,
|
|
4643
|
-
title: title && help ? /* @__PURE__ */ (0,
|
|
5353
|
+
className: (0, import_classnames24.default)(getMargin(margin), controlAndTagsToCSSClass({ control, tags })),
|
|
5354
|
+
title: title && help ? /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(LabelContentWithHelp, { text: title, help }) : title,
|
|
4644
5355
|
description,
|
|
4645
5356
|
progress: {
|
|
4646
5357
|
max: 1,
|
|
@@ -4655,13 +5366,13 @@ var ProgressRenderer = {
|
|
|
4655
5366
|
// ../renderers/src/RepeatableRenderer.tsx
|
|
4656
5367
|
var import_components49 = require("@transferwise/components");
|
|
4657
5368
|
var import_icons2 = require("@transferwise/icons");
|
|
4658
|
-
var
|
|
4659
|
-
var
|
|
4660
|
-
var
|
|
5369
|
+
var import_classnames25 = __toESM(require_classnames());
|
|
5370
|
+
var import_react20 = require("react");
|
|
5371
|
+
var import_react_intl27 = require("react-intl");
|
|
4661
5372
|
|
|
4662
5373
|
// ../renderers/src/messages/repeatable.messages.ts
|
|
4663
|
-
var
|
|
4664
|
-
var repeatable_messages_default = (0,
|
|
5374
|
+
var import_react_intl26 = require("react-intl");
|
|
5375
|
+
var repeatable_messages_default = (0, import_react_intl26.defineMessages)({
|
|
4665
5376
|
addItemTitle: {
|
|
4666
5377
|
id: "df.wise.ArraySchema.addItemTitle",
|
|
4667
5378
|
defaultMessage: "Add Item",
|
|
@@ -4685,10 +5396,10 @@ var repeatable_messages_default = (0, import_react_intl24.defineMessages)({
|
|
|
4685
5396
|
});
|
|
4686
5397
|
|
|
4687
5398
|
// ../renderers/src/RepeatableRenderer.tsx
|
|
4688
|
-
var
|
|
5399
|
+
var import_jsx_runtime76 = require("react/jsx-runtime");
|
|
4689
5400
|
var RepeatableRenderer = {
|
|
4690
5401
|
canRenderType: "repeatable",
|
|
4691
|
-
render: (props) => /* @__PURE__ */ (0,
|
|
5402
|
+
render: (props) => /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(Repeatable, __spreadValues({}, props))
|
|
4692
5403
|
};
|
|
4693
5404
|
function Repeatable(props) {
|
|
4694
5405
|
const {
|
|
@@ -4705,8 +5416,8 @@ function Repeatable(props) {
|
|
|
4705
5416
|
onSave,
|
|
4706
5417
|
onRemove
|
|
4707
5418
|
} = props;
|
|
4708
|
-
const { formatMessage } = (0,
|
|
4709
|
-
const [openModalType, setOpenModalType] = (0,
|
|
5419
|
+
const { formatMessage } = (0, import_react_intl27.useIntl)();
|
|
5420
|
+
const [openModalType, setOpenModalType] = (0, import_react20.useState)(null);
|
|
4710
5421
|
const { ref } = useScrollToError(validationState, features);
|
|
4711
5422
|
const onAddItem = () => {
|
|
4712
5423
|
onAdd();
|
|
@@ -4729,42 +5440,42 @@ function Repeatable(props) {
|
|
|
4729
5440
|
const onCancelEdit = () => {
|
|
4730
5441
|
setOpenModalType(null);
|
|
4731
5442
|
};
|
|
4732
|
-
return /* @__PURE__ */ (0,
|
|
4733
|
-
/* @__PURE__ */ (0,
|
|
4734
|
-
title && /* @__PURE__ */ (0,
|
|
4735
|
-
description && /* @__PURE__ */ (0,
|
|
4736
|
-
/* @__PURE__ */ (0,
|
|
5443
|
+
return /* @__PURE__ */ (0, import_jsx_runtime76.jsxs)(import_jsx_runtime76.Fragment, { children: [
|
|
5444
|
+
/* @__PURE__ */ (0, import_jsx_runtime76.jsxs)("div", { ref, className: controlAndTagsToCSSClass(props), children: [
|
|
5445
|
+
title && /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(import_components49.Header, { title }),
|
|
5446
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime76.jsx)("p", { children: description }),
|
|
5447
|
+
/* @__PURE__ */ (0, import_jsx_runtime76.jsxs)(
|
|
4737
5448
|
"div",
|
|
4738
5449
|
{
|
|
4739
|
-
className: (0,
|
|
5450
|
+
className: (0, import_classnames25.default)("form-group", {
|
|
4740
5451
|
"has-error": (validationState == null ? void 0 : validationState.status) === "invalid"
|
|
4741
5452
|
}),
|
|
4742
5453
|
children: [
|
|
4743
|
-
items == null ? void 0 : items.map((item, index) => /* @__PURE__ */ (0,
|
|
4744
|
-
/* @__PURE__ */ (0,
|
|
5454
|
+
items == null ? void 0 : items.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(ItemSummaryOption, { item, onClick: () => onEditItem(index) }, item.id)),
|
|
5455
|
+
/* @__PURE__ */ (0, import_jsx_runtime76.jsx)(
|
|
4745
5456
|
import_components49.NavigationOption,
|
|
4746
5457
|
{
|
|
4747
|
-
media: /* @__PURE__ */ (0,
|
|
5458
|
+
media: /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(import_icons2.Plus, {}),
|
|
4748
5459
|
title: addItemTitle || formatMessage(repeatable_messages_default.addItemTitle),
|
|
4749
5460
|
showMediaAtAllSizes: true,
|
|
4750
5461
|
onClick: () => onAddItem()
|
|
4751
5462
|
}
|
|
4752
5463
|
),
|
|
4753
|
-
(validationState == null ? void 0 : validationState.status) === "invalid" && /* @__PURE__ */ (0,
|
|
5464
|
+
(validationState == null ? void 0 : validationState.status) === "invalid" && /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(import_components49.InlineAlert, { type: "negative", children: validationState.message })
|
|
4754
5465
|
]
|
|
4755
5466
|
}
|
|
4756
5467
|
)
|
|
4757
5468
|
] }),
|
|
4758
|
-
/* @__PURE__ */ (0,
|
|
5469
|
+
/* @__PURE__ */ (0, import_jsx_runtime76.jsx)(
|
|
4759
5470
|
import_components49.Modal,
|
|
4760
5471
|
{
|
|
4761
5472
|
open: openModalType !== null,
|
|
4762
5473
|
title: (openModalType === "add" ? addItemTitle : editItemTitle) || formatMessage(repeatable_messages_default.addItemTitle),
|
|
4763
|
-
body: /* @__PURE__ */ (0,
|
|
4764
|
-
/* @__PURE__ */ (0,
|
|
4765
|
-
/* @__PURE__ */ (0,
|
|
4766
|
-
/* @__PURE__ */ (0,
|
|
4767
|
-
/* @__PURE__ */ (0,
|
|
5474
|
+
body: /* @__PURE__ */ (0, import_jsx_runtime76.jsxs)(import_jsx_runtime76.Fragment, { children: [
|
|
5475
|
+
/* @__PURE__ */ (0, import_jsx_runtime76.jsx)("div", { className: "m-b-2", children: editableItem }),
|
|
5476
|
+
/* @__PURE__ */ (0, import_jsx_runtime76.jsxs)("div", { children: [
|
|
5477
|
+
/* @__PURE__ */ (0, import_jsx_runtime76.jsx)(import_components49.Button, { priority: "primary", block: true, className: "m-b-2", onClick: () => onSaveItem(), children: formatMessage(repeatable_messages_default.addItem) }),
|
|
5478
|
+
/* @__PURE__ */ (0, import_jsx_runtime76.jsx)(
|
|
4768
5479
|
import_components49.Button,
|
|
4769
5480
|
{
|
|
4770
5481
|
v2: true,
|
|
@@ -4786,10 +5497,10 @@ function ItemSummaryOption({
|
|
|
4786
5497
|
item,
|
|
4787
5498
|
onClick
|
|
4788
5499
|
}) {
|
|
4789
|
-
return /* @__PURE__ */ (0,
|
|
5500
|
+
return /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(
|
|
4790
5501
|
import_components49.NavigationOption,
|
|
4791
5502
|
{
|
|
4792
|
-
media: /* @__PURE__ */ (0,
|
|
5503
|
+
media: /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(OptionMedia, { media: item.media, preferAvatar: false }),
|
|
4793
5504
|
title: item.title,
|
|
4794
5505
|
content: item.description,
|
|
4795
5506
|
showMediaAtAllSizes: true,
|
|
@@ -4802,15 +5513,15 @@ var RepeatableRenderer_default = RepeatableRenderer;
|
|
|
4802
5513
|
|
|
4803
5514
|
// ../renderers/src/ReviewLegacyRenderer.tsx
|
|
4804
5515
|
var import_components50 = require("@transferwise/components");
|
|
4805
|
-
var
|
|
4806
|
-
var
|
|
5516
|
+
var import_classnames26 = __toESM(require_classnames());
|
|
5517
|
+
var import_jsx_runtime77 = require("react/jsx-runtime");
|
|
4807
5518
|
var ReviewRenderer = {
|
|
4808
5519
|
canRenderType: "review",
|
|
4809
5520
|
render: ({ callToAction, control, fields, margin, title, trackEvent, tags }) => {
|
|
4810
5521
|
const orientation = mapControlToDefinitionListLayout(control);
|
|
4811
|
-
return /* @__PURE__ */ (0,
|
|
4812
|
-
/* @__PURE__ */ (0,
|
|
4813
|
-
/* @__PURE__ */ (0,
|
|
5522
|
+
return /* @__PURE__ */ (0, import_jsx_runtime77.jsxs)("div", { className: (0, import_classnames26.default)(getMargin(margin), controlAndTagsToCSSClass({ control, tags })), children: [
|
|
5523
|
+
/* @__PURE__ */ (0, import_jsx_runtime77.jsx)(Header, { title, callToAction }),
|
|
5524
|
+
/* @__PURE__ */ (0, import_jsx_runtime77.jsx)("div", { className: margin, children: /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(
|
|
4814
5525
|
import_components50.DefinitionList,
|
|
4815
5526
|
{
|
|
4816
5527
|
layout: orientation,
|
|
@@ -4848,10 +5559,10 @@ var mapControlToDefinitionListLayout = (control) => {
|
|
|
4848
5559
|
};
|
|
4849
5560
|
var getFieldLabel = (label, help, onClick) => {
|
|
4850
5561
|
if (help) {
|
|
4851
|
-
return /* @__PURE__ */ (0,
|
|
5562
|
+
return /* @__PURE__ */ (0, import_jsx_runtime77.jsxs)(import_jsx_runtime77.Fragment, { children: [
|
|
4852
5563
|
label,
|
|
4853
5564
|
" ",
|
|
4854
|
-
/* @__PURE__ */ (0,
|
|
5565
|
+
/* @__PURE__ */ (0, import_jsx_runtime77.jsx)(Help_default, { help, onClick })
|
|
4855
5566
|
] });
|
|
4856
5567
|
}
|
|
4857
5568
|
return label;
|
|
@@ -4860,9 +5571,9 @@ var getFieldLabel = (label, help, onClick) => {
|
|
|
4860
5571
|
// ../renderers/src/ReviewRenderer.tsx
|
|
4861
5572
|
var import_components51 = require("@transferwise/components");
|
|
4862
5573
|
var import_icons3 = require("@transferwise/icons");
|
|
4863
|
-
var
|
|
4864
|
-
var
|
|
4865
|
-
var
|
|
5574
|
+
var import_classnames27 = __toESM(require_classnames());
|
|
5575
|
+
var import_react_intl28 = require("react-intl");
|
|
5576
|
+
var import_jsx_runtime78 = require("react/jsx-runtime");
|
|
4866
5577
|
var IGNORED_CONTROLS = [
|
|
4867
5578
|
"horizontal",
|
|
4868
5579
|
"horizontal-end-aligned",
|
|
@@ -4872,7 +5583,7 @@ var IGNORED_CONTROLS = [
|
|
|
4872
5583
|
var ReviewRenderer2 = {
|
|
4873
5584
|
canRenderType: "review",
|
|
4874
5585
|
canRender: ({ control }) => control ? !IGNORED_CONTROLS.includes(control) : true,
|
|
4875
|
-
render: (props) => /* @__PURE__ */ (0,
|
|
5586
|
+
render: (props) => /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(Review, __spreadValues({}, props))
|
|
4876
5587
|
};
|
|
4877
5588
|
var Review = ({
|
|
4878
5589
|
callToAction,
|
|
@@ -4883,9 +5594,9 @@ var Review = ({
|
|
|
4883
5594
|
title,
|
|
4884
5595
|
trackEvent
|
|
4885
5596
|
}) => {
|
|
4886
|
-
const intl = (0,
|
|
4887
|
-
return /* @__PURE__ */ (0,
|
|
4888
|
-
/* @__PURE__ */ (0,
|
|
5597
|
+
const intl = (0, import_react_intl28.useIntl)();
|
|
5598
|
+
return /* @__PURE__ */ (0, import_jsx_runtime78.jsxs)("div", { className: (0, import_classnames27.default)(getMargin(margin), controlAndTagsToCSSClass({ control, tags })), children: [
|
|
5599
|
+
/* @__PURE__ */ (0, import_jsx_runtime78.jsx)(Header, { title, callToAction }),
|
|
4889
5600
|
fields.map((field) => {
|
|
4890
5601
|
var _a, _b, _c;
|
|
4891
5602
|
const {
|
|
@@ -4903,7 +5614,7 @@ var Review = ({
|
|
|
4903
5614
|
ctaSecondary: (_a = itemTags == null ? void 0 : itemTags.includes("cta-secondary")) != null ? _a : false,
|
|
4904
5615
|
fullyInteractive: (_b = (tags == null ? void 0 : tags.includes("fully-interactive")) && (additionalInfo == null ? void 0 : additionalInfo.onClick) == null) != null ? _b : false
|
|
4905
5616
|
};
|
|
4906
|
-
return /* @__PURE__ */ (0,
|
|
5617
|
+
return /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
|
|
4907
5618
|
import_components51.ListItem,
|
|
4908
5619
|
{
|
|
4909
5620
|
title: value,
|
|
@@ -4924,18 +5635,18 @@ var Review = ({
|
|
|
4924
5635
|
] });
|
|
4925
5636
|
};
|
|
4926
5637
|
var getHelpControl = (help, ariaLabel, onClick) => {
|
|
4927
|
-
return /* @__PURE__ */ (0,
|
|
5638
|
+
return /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(import_components51.Popover, { content: /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(import_components51.Markdown, { config: { link: { target: "_blank" } }, children: help }), children: /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(import_components51.ListItem.IconButton, { partiallyInteractive: true, "aria-label": ariaLabel, onClick, children: /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(import_icons3.QuestionMarkCircle, {}) }) });
|
|
4928
5639
|
};
|
|
4929
5640
|
var ReviewRenderer_default = ReviewRenderer2;
|
|
4930
5641
|
|
|
4931
5642
|
// ../renderers/src/SearchRenderer/BlockSearchRendererComponent.tsx
|
|
4932
5643
|
var import_components53 = require("@transferwise/components");
|
|
4933
|
-
var
|
|
4934
|
-
var
|
|
5644
|
+
var import_react21 = require("react");
|
|
5645
|
+
var import_react_intl31 = require("react-intl");
|
|
4935
5646
|
|
|
4936
5647
|
// ../renderers/src/messages/search.messages.ts
|
|
4937
|
-
var
|
|
4938
|
-
var search_messages_default = (0,
|
|
5648
|
+
var import_react_intl29 = require("react-intl");
|
|
5649
|
+
var search_messages_default = (0, import_react_intl29.defineMessages)({
|
|
4939
5650
|
loading: {
|
|
4940
5651
|
id: "df.wise.SearchLayout.loading",
|
|
4941
5652
|
defaultMessage: "Loading...",
|
|
@@ -4944,21 +5655,21 @@ var search_messages_default = (0, import_react_intl27.defineMessages)({
|
|
|
4944
5655
|
});
|
|
4945
5656
|
|
|
4946
5657
|
// ../renderers/src/SearchRenderer/ErrorResult.tsx
|
|
4947
|
-
var
|
|
5658
|
+
var import_react_intl30 = require("react-intl");
|
|
4948
5659
|
var import_components52 = require("@transferwise/components");
|
|
4949
|
-
var
|
|
5660
|
+
var import_jsx_runtime79 = require("react/jsx-runtime");
|
|
4950
5661
|
function ErrorResult({ state }) {
|
|
4951
|
-
const intl = (0,
|
|
4952
|
-
return /* @__PURE__ */ (0,
|
|
5662
|
+
const intl = (0, import_react_intl30.useIntl)();
|
|
5663
|
+
return /* @__PURE__ */ (0, import_jsx_runtime79.jsxs)("p", { className: "m-t-2", children: [
|
|
4953
5664
|
intl.formatMessage(generic_error_messages_default.genericError),
|
|
4954
5665
|
"\xA0",
|
|
4955
|
-
/* @__PURE__ */ (0,
|
|
5666
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsx)(import_components52.Link, { onClick: () => state.onRetry(), children: intl.formatMessage(generic_error_messages_default.retry) })
|
|
4956
5667
|
] });
|
|
4957
5668
|
}
|
|
4958
5669
|
|
|
4959
5670
|
// ../renderers/src/SearchRenderer/BlockSearchRendererComponent.tsx
|
|
4960
5671
|
var import_icons4 = require("@transferwise/icons");
|
|
4961
|
-
var
|
|
5672
|
+
var import_jsx_runtime80 = require("react/jsx-runtime");
|
|
4962
5673
|
function BlockSearchRendererComponent({
|
|
4963
5674
|
id,
|
|
4964
5675
|
hint,
|
|
@@ -4973,10 +5684,10 @@ function BlockSearchRendererComponent({
|
|
|
4973
5684
|
trackEvent,
|
|
4974
5685
|
onChange
|
|
4975
5686
|
}) {
|
|
4976
|
-
const [hasSearched, setHasSearched] = (0,
|
|
4977
|
-
const { formatMessage } = (0,
|
|
4978
|
-
return /* @__PURE__ */ (0,
|
|
4979
|
-
/* @__PURE__ */ (0,
|
|
5687
|
+
const [hasSearched, setHasSearched] = (0, import_react21.useState)(false);
|
|
5688
|
+
const { formatMessage } = (0, import_react_intl31.useIntl)();
|
|
5689
|
+
return /* @__PURE__ */ (0, import_jsx_runtime80.jsxs)("div", { className: getMargin(margin), children: [
|
|
5690
|
+
/* @__PURE__ */ (0, import_jsx_runtime80.jsx)(
|
|
4980
5691
|
FieldInput_default,
|
|
4981
5692
|
{
|
|
4982
5693
|
id,
|
|
@@ -4987,7 +5698,7 @@ function BlockSearchRendererComponent({
|
|
|
4987
5698
|
features,
|
|
4988
5699
|
control,
|
|
4989
5700
|
tags,
|
|
4990
|
-
children: /* @__PURE__ */ (0,
|
|
5701
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(import_components53.InputGroup, { addonStart: { content: /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(import_icons4.Search, { size: 24 }) }, children: /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(
|
|
4991
5702
|
import_components53.Input,
|
|
4992
5703
|
{
|
|
4993
5704
|
id,
|
|
@@ -5007,7 +5718,7 @@ function BlockSearchRendererComponent({
|
|
|
5007
5718
|
) })
|
|
5008
5719
|
}
|
|
5009
5720
|
),
|
|
5010
|
-
isLoading ? /* @__PURE__ */ (0,
|
|
5721
|
+
isLoading ? /* @__PURE__ */ (0, import_jsx_runtime80.jsx)("span", { children: formatMessage(search_messages_default.loading) }) : /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(SearchResultContent, { state, trackEvent })
|
|
5011
5722
|
] });
|
|
5012
5723
|
}
|
|
5013
5724
|
function SearchResultContent({
|
|
@@ -5016,38 +5727,38 @@ function SearchResultContent({
|
|
|
5016
5727
|
}) {
|
|
5017
5728
|
switch (state.type) {
|
|
5018
5729
|
case "error":
|
|
5019
|
-
return /* @__PURE__ */ (0,
|
|
5730
|
+
return /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(ErrorResult, { state });
|
|
5020
5731
|
case "results":
|
|
5021
|
-
return /* @__PURE__ */ (0,
|
|
5732
|
+
return /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(SearchResults, { state, trackEvent });
|
|
5022
5733
|
case "layout":
|
|
5023
|
-
return /* @__PURE__ */ (0,
|
|
5734
|
+
return /* @__PURE__ */ (0, import_jsx_runtime80.jsxs)(import_jsx_runtime80.Fragment, { children: [
|
|
5024
5735
|
" ",
|
|
5025
5736
|
state.layout,
|
|
5026
5737
|
" "
|
|
5027
5738
|
] });
|
|
5028
5739
|
case "noResults":
|
|
5029
|
-
return /* @__PURE__ */ (0,
|
|
5740
|
+
return /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(EmptySearchResult, { state });
|
|
5030
5741
|
case "pending":
|
|
5031
5742
|
default:
|
|
5032
5743
|
return null;
|
|
5033
5744
|
}
|
|
5034
5745
|
}
|
|
5035
5746
|
function EmptySearchResult({ state }) {
|
|
5036
|
-
return /* @__PURE__ */ (0,
|
|
5747
|
+
return /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(import_components53.Markdown, { className: "m-t-2", config: { link: { target: "_blank" } }, children: state.message });
|
|
5037
5748
|
}
|
|
5038
5749
|
function SearchResults({
|
|
5039
5750
|
state,
|
|
5040
5751
|
trackEvent
|
|
5041
5752
|
}) {
|
|
5042
|
-
return /* @__PURE__ */ (0,
|
|
5753
|
+
return /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(import_components53.List, { children: state.results.map((result) => {
|
|
5043
5754
|
const { media } = result;
|
|
5044
|
-
return /* @__PURE__ */ (0,
|
|
5755
|
+
return /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(
|
|
5045
5756
|
import_components53.ListItem,
|
|
5046
5757
|
{
|
|
5047
5758
|
title: result.title,
|
|
5048
5759
|
subtitle: result.description,
|
|
5049
|
-
media: media ? /* @__PURE__ */ (0,
|
|
5050
|
-
control: /* @__PURE__ */ (0,
|
|
5760
|
+
media: media ? /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(OptionMedia, { media, preferAvatar: false }) : void 0,
|
|
5761
|
+
control: /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(
|
|
5051
5762
|
import_components53.ListItem.Navigation,
|
|
5052
5763
|
{
|
|
5053
5764
|
onClick: () => {
|
|
@@ -5068,9 +5779,9 @@ var BlockSearchRendererComponent_default = BlockSearchRendererComponent;
|
|
|
5068
5779
|
// ../renderers/src/SearchRenderer/InlineSearchRendererComponent.tsx
|
|
5069
5780
|
var import_components54 = require("@transferwise/components");
|
|
5070
5781
|
var import_icons5 = require("@transferwise/icons");
|
|
5071
|
-
var
|
|
5072
|
-
var
|
|
5073
|
-
var
|
|
5782
|
+
var import_react22 = require("react");
|
|
5783
|
+
var import_react_intl32 = require("react-intl");
|
|
5784
|
+
var import_jsx_runtime81 = require("react/jsx-runtime");
|
|
5074
5785
|
function InlineSearchRenderer({
|
|
5075
5786
|
id,
|
|
5076
5787
|
hint,
|
|
@@ -5084,9 +5795,9 @@ function InlineSearchRenderer({
|
|
|
5084
5795
|
onChange,
|
|
5085
5796
|
trackEvent
|
|
5086
5797
|
}) {
|
|
5087
|
-
const [hasSearched, setHasSearched] = (0,
|
|
5088
|
-
const intl = (0,
|
|
5089
|
-
return /* @__PURE__ */ (0,
|
|
5798
|
+
const [hasSearched, setHasSearched] = (0, import_react22.useState)(false);
|
|
5799
|
+
const intl = (0, import_react_intl32.useIntl)();
|
|
5800
|
+
return /* @__PURE__ */ (0, import_jsx_runtime81.jsx)("div", { className: getMargin(margin), children: /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(
|
|
5090
5801
|
FieldInput_default,
|
|
5091
5802
|
{
|
|
5092
5803
|
id,
|
|
@@ -5097,7 +5808,7 @@ function InlineSearchRenderer({
|
|
|
5097
5808
|
features,
|
|
5098
5809
|
control,
|
|
5099
5810
|
tags,
|
|
5100
|
-
children: /* @__PURE__ */ (0,
|
|
5811
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(
|
|
5101
5812
|
import_components54.Typeahead,
|
|
5102
5813
|
{
|
|
5103
5814
|
id: "typeahead-input-id",
|
|
@@ -5106,10 +5817,10 @@ function InlineSearchRenderer({
|
|
|
5106
5817
|
size: "md",
|
|
5107
5818
|
placeholder: hint,
|
|
5108
5819
|
maxHeight: 100,
|
|
5109
|
-
footer: /* @__PURE__ */ (0,
|
|
5820
|
+
footer: /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(TypeaheadFooter, { state, isLoading }),
|
|
5110
5821
|
multiple: false,
|
|
5111
5822
|
clearable: false,
|
|
5112
|
-
addon: /* @__PURE__ */ (0,
|
|
5823
|
+
addon: /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(import_icons5.Search, { size: 24 }),
|
|
5113
5824
|
options: state.type === "results" ? state.results.map(mapResultToTypeaheadOption) : [],
|
|
5114
5825
|
minQueryLength: 1,
|
|
5115
5826
|
onChange: (values) => {
|
|
@@ -5146,34 +5857,34 @@ function mapResultToTypeaheadOption(result) {
|
|
|
5146
5857
|
};
|
|
5147
5858
|
}
|
|
5148
5859
|
function TypeaheadFooter({ state, isLoading }) {
|
|
5149
|
-
const { formatMessage } = (0,
|
|
5860
|
+
const { formatMessage } = (0, import_react_intl32.useIntl)();
|
|
5150
5861
|
if (state.type === "layout") {
|
|
5151
|
-
return /* @__PURE__ */ (0,
|
|
5862
|
+
return /* @__PURE__ */ (0, import_jsx_runtime81.jsx)("div", { className: "m-x-1 m-y-1", children: state.layout });
|
|
5152
5863
|
}
|
|
5153
5864
|
if (state.type === "noResults") {
|
|
5154
|
-
return /* @__PURE__ */ (0,
|
|
5865
|
+
return /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(import_components54.Markdown, { className: "m-t-2 m-x-2", config: { link: { target: "_blank" } }, children: state.message });
|
|
5155
5866
|
}
|
|
5156
5867
|
if (state.type === "error") {
|
|
5157
|
-
return /* @__PURE__ */ (0,
|
|
5868
|
+
return /* @__PURE__ */ (0, import_jsx_runtime81.jsx)("div", { className: "m-t-2 m-x-2", children: /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(ErrorResult, { state }) });
|
|
5158
5869
|
}
|
|
5159
5870
|
if (state.type === "pending" || isLoading) {
|
|
5160
|
-
return /* @__PURE__ */ (0,
|
|
5871
|
+
return /* @__PURE__ */ (0, import_jsx_runtime81.jsx)("p", { className: "m-t-2 m-x-2", children: formatMessage(search_messages_default.loading) });
|
|
5161
5872
|
}
|
|
5162
5873
|
return null;
|
|
5163
5874
|
}
|
|
5164
5875
|
var InlineSearchRendererComponent_default = InlineSearchRenderer;
|
|
5165
5876
|
|
|
5166
5877
|
// ../renderers/src/SearchRenderer/SearchRenderer.tsx
|
|
5167
|
-
var
|
|
5878
|
+
var import_jsx_runtime82 = require("react/jsx-runtime");
|
|
5168
5879
|
var SearchRenderer = {
|
|
5169
5880
|
canRenderType: "search",
|
|
5170
|
-
render: (props) => props.control === "inline" ? /* @__PURE__ */ (0,
|
|
5881
|
+
render: (props) => props.control === "inline" ? /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(InlineSearchRendererComponent_default, __spreadValues({}, props)) : /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(BlockSearchRendererComponent_default, __spreadValues({}, props))
|
|
5171
5882
|
};
|
|
5172
5883
|
var SearchRenderer_default = SearchRenderer;
|
|
5173
5884
|
|
|
5174
5885
|
// ../renderers/src/SectionRenderer.tsx
|
|
5175
5886
|
var import_components55 = require("@transferwise/components");
|
|
5176
|
-
var
|
|
5887
|
+
var import_classnames28 = __toESM(require_classnames());
|
|
5177
5888
|
|
|
5178
5889
|
// ../renderers/src/utils/getHeaderAction.tsx
|
|
5179
5890
|
var getHeaderAction2 = (callToAction) => {
|
|
@@ -5197,16 +5908,16 @@ var getHeaderAction2 = (callToAction) => {
|
|
|
5197
5908
|
};
|
|
5198
5909
|
|
|
5199
5910
|
// ../renderers/src/SectionRenderer.tsx
|
|
5200
|
-
var
|
|
5911
|
+
var import_jsx_runtime83 = require("react/jsx-runtime");
|
|
5201
5912
|
var SectionRenderer = {
|
|
5202
5913
|
canRenderType: "section",
|
|
5203
5914
|
render: ({ children, callToAction, margin, title, control, tags }) => {
|
|
5204
|
-
return /* @__PURE__ */ (0,
|
|
5915
|
+
return /* @__PURE__ */ (0, import_jsx_runtime83.jsxs)(
|
|
5205
5916
|
"section",
|
|
5206
5917
|
{
|
|
5207
|
-
className: (0,
|
|
5918
|
+
className: (0, import_classnames28.default)(getMargin(margin), controlAndTagsToCSSClass({ control, tags })),
|
|
5208
5919
|
children: [
|
|
5209
|
-
(title || callToAction) && /* @__PURE__ */ (0,
|
|
5920
|
+
(title || callToAction) && /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(import_components55.Header, { title: title != null ? title : "", action: getHeaderAction2(callToAction) }),
|
|
5210
5921
|
children
|
|
5211
5922
|
]
|
|
5212
5923
|
}
|
|
@@ -5217,7 +5928,7 @@ var SectionRenderer_default = SectionRenderer;
|
|
|
5217
5928
|
|
|
5218
5929
|
// ../renderers/src/SelectInputRenderer/RadioInputRendererComponent.tsx
|
|
5219
5930
|
var import_components56 = require("@transferwise/components");
|
|
5220
|
-
var
|
|
5931
|
+
var import_jsx_runtime84 = require("react/jsx-runtime");
|
|
5221
5932
|
function RadioInputRendererComponent(props) {
|
|
5222
5933
|
const {
|
|
5223
5934
|
id,
|
|
@@ -5234,8 +5945,8 @@ function RadioInputRendererComponent(props) {
|
|
|
5234
5945
|
tags,
|
|
5235
5946
|
onSelect
|
|
5236
5947
|
} = props;
|
|
5237
|
-
return /* @__PURE__ */ (0,
|
|
5238
|
-
/* @__PURE__ */ (0,
|
|
5948
|
+
return /* @__PURE__ */ (0, import_jsx_runtime84.jsxs)(import_jsx_runtime84.Fragment, { children: [
|
|
5949
|
+
/* @__PURE__ */ (0, import_jsx_runtime84.jsx)(
|
|
5239
5950
|
FieldInput_default,
|
|
5240
5951
|
{
|
|
5241
5952
|
id,
|
|
@@ -5246,7 +5957,7 @@ function RadioInputRendererComponent(props) {
|
|
|
5246
5957
|
features,
|
|
5247
5958
|
control,
|
|
5248
5959
|
tags,
|
|
5249
|
-
children: /* @__PURE__ */ (0,
|
|
5960
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime84.jsx)("span", { children: /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(
|
|
5250
5961
|
import_components56.RadioGroup,
|
|
5251
5962
|
{
|
|
5252
5963
|
name: id,
|
|
@@ -5255,7 +5966,7 @@ function RadioInputRendererComponent(props) {
|
|
|
5255
5966
|
value: index,
|
|
5256
5967
|
secondary: option.description,
|
|
5257
5968
|
disabled: option.disabled || disabled,
|
|
5258
|
-
avatar: /* @__PURE__ */ (0,
|
|
5969
|
+
avatar: /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(OptionMedia, { media: option.media, preferAvatar: false })
|
|
5259
5970
|
})),
|
|
5260
5971
|
selectedValue: selectedIndex != null ? selectedIndex : void 0,
|
|
5261
5972
|
onChange: onSelect
|
|
@@ -5270,8 +5981,8 @@ function RadioInputRendererComponent(props) {
|
|
|
5270
5981
|
|
|
5271
5982
|
// ../renderers/src/SelectInputRenderer/TabInputRendererComponent.tsx
|
|
5272
5983
|
var import_components57 = require("@transferwise/components");
|
|
5273
|
-
var
|
|
5274
|
-
var
|
|
5984
|
+
var import_react23 = require("react");
|
|
5985
|
+
var import_jsx_runtime85 = require("react/jsx-runtime");
|
|
5275
5986
|
function TabInputRendererComponent(props) {
|
|
5276
5987
|
const {
|
|
5277
5988
|
id,
|
|
@@ -5288,13 +5999,13 @@ function TabInputRendererComponent(props) {
|
|
|
5288
5999
|
tags,
|
|
5289
6000
|
onSelect
|
|
5290
6001
|
} = props;
|
|
5291
|
-
(0,
|
|
6002
|
+
(0, import_react23.useEffect)(() => {
|
|
5292
6003
|
if (!isValidIndex2(selectedIndex, options.length)) {
|
|
5293
6004
|
onSelect(0);
|
|
5294
6005
|
}
|
|
5295
6006
|
}, [selectedIndex, onSelect, options.length]);
|
|
5296
|
-
return /* @__PURE__ */ (0,
|
|
5297
|
-
/* @__PURE__ */ (0,
|
|
6007
|
+
return /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)(import_jsx_runtime85.Fragment, { children: [
|
|
6008
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
|
|
5298
6009
|
FieldInput_default,
|
|
5299
6010
|
{
|
|
5300
6011
|
id,
|
|
@@ -5305,7 +6016,7 @@ function TabInputRendererComponent(props) {
|
|
|
5305
6016
|
features,
|
|
5306
6017
|
control,
|
|
5307
6018
|
tags,
|
|
5308
|
-
children: /* @__PURE__ */ (0,
|
|
6019
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
|
|
5309
6020
|
import_components57.Tabs,
|
|
5310
6021
|
{
|
|
5311
6022
|
name: id,
|
|
@@ -5314,7 +6025,7 @@ function TabInputRendererComponent(props) {
|
|
|
5314
6025
|
title: option.title,
|
|
5315
6026
|
// if we pass null, we get some props-types console errors
|
|
5316
6027
|
// eslint-disable-next-line react/jsx-no-useless-fragment
|
|
5317
|
-
content: /* @__PURE__ */ (0,
|
|
6028
|
+
content: /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(import_jsx_runtime85.Fragment, {}),
|
|
5318
6029
|
disabled: option.disabled || disabled
|
|
5319
6030
|
})),
|
|
5320
6031
|
onTabSelect: onSelect
|
|
@@ -5329,7 +6040,7 @@ var isValidIndex2 = (index, options) => index !== null && index >= 0 && index <
|
|
|
5329
6040
|
|
|
5330
6041
|
// ../renderers/src/SelectInputRenderer/SelectInputRendererComponent.tsx
|
|
5331
6042
|
var import_components58 = require("@transferwise/components");
|
|
5332
|
-
var
|
|
6043
|
+
var import_jsx_runtime86 = require("react/jsx-runtime");
|
|
5333
6044
|
function SelectInputRendererComponent(props) {
|
|
5334
6045
|
const {
|
|
5335
6046
|
id,
|
|
@@ -5372,13 +6083,13 @@ function SelectInputRendererComponent(props) {
|
|
|
5372
6083
|
} : {
|
|
5373
6084
|
title: option.title,
|
|
5374
6085
|
description: option.description,
|
|
5375
|
-
icon: /* @__PURE__ */ (0,
|
|
6086
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(OptionMedia, { media: option.media, preferAvatar: false })
|
|
5376
6087
|
};
|
|
5377
|
-
return /* @__PURE__ */ (0,
|
|
6088
|
+
return /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(import_components58.SelectInputOptionContent, __spreadValues({}, contentProps));
|
|
5378
6089
|
};
|
|
5379
6090
|
const extraProps = { autoComplete };
|
|
5380
|
-
return /* @__PURE__ */ (0,
|
|
5381
|
-
/* @__PURE__ */ (0,
|
|
6091
|
+
return /* @__PURE__ */ (0, import_jsx_runtime86.jsxs)(import_jsx_runtime86.Fragment, { children: [
|
|
6092
|
+
/* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
|
|
5382
6093
|
FieldInput_default,
|
|
5383
6094
|
{
|
|
5384
6095
|
id,
|
|
@@ -5389,7 +6100,7 @@ function SelectInputRendererComponent(props) {
|
|
|
5389
6100
|
features,
|
|
5390
6101
|
control,
|
|
5391
6102
|
tags,
|
|
5392
|
-
children: /* @__PURE__ */ (0,
|
|
6103
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
|
|
5393
6104
|
import_components58.SelectInput,
|
|
5394
6105
|
__spreadValues({
|
|
5395
6106
|
name: id,
|
|
@@ -5410,9 +6121,9 @@ function SelectInputRendererComponent(props) {
|
|
|
5410
6121
|
}
|
|
5411
6122
|
|
|
5412
6123
|
// ../renderers/src/SelectInputRenderer/SegmentedInputRendererComponent.tsx
|
|
5413
|
-
var
|
|
6124
|
+
var import_react24 = require("react");
|
|
5414
6125
|
var import_components59 = require("@transferwise/components");
|
|
5415
|
-
var
|
|
6126
|
+
var import_jsx_runtime87 = require("react/jsx-runtime");
|
|
5416
6127
|
function SegmentedInputRendererComponent(props) {
|
|
5417
6128
|
const {
|
|
5418
6129
|
id,
|
|
@@ -5428,13 +6139,13 @@ function SegmentedInputRendererComponent(props) {
|
|
|
5428
6139
|
tags,
|
|
5429
6140
|
onSelect
|
|
5430
6141
|
} = props;
|
|
5431
|
-
(0,
|
|
6142
|
+
(0, import_react24.useEffect)(() => {
|
|
5432
6143
|
if (!isValidIndex3(selectedIndex, options.length)) {
|
|
5433
6144
|
onSelect(0);
|
|
5434
6145
|
}
|
|
5435
6146
|
}, [selectedIndex, onSelect, options.length]);
|
|
5436
|
-
return /* @__PURE__ */ (0,
|
|
5437
|
-
/* @__PURE__ */ (0,
|
|
6147
|
+
return /* @__PURE__ */ (0, import_jsx_runtime87.jsxs)(import_jsx_runtime87.Fragment, { children: [
|
|
6148
|
+
/* @__PURE__ */ (0, import_jsx_runtime87.jsx)(
|
|
5438
6149
|
FieldInput_default,
|
|
5439
6150
|
{
|
|
5440
6151
|
id,
|
|
@@ -5445,7 +6156,7 @@ function SegmentedInputRendererComponent(props) {
|
|
|
5445
6156
|
features,
|
|
5446
6157
|
control,
|
|
5447
6158
|
tags,
|
|
5448
|
-
children: /* @__PURE__ */ (0,
|
|
6159
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(
|
|
5449
6160
|
import_components59.SegmentedControl,
|
|
5450
6161
|
{
|
|
5451
6162
|
name: `${id}-segmented-control`,
|
|
@@ -5462,14 +6173,14 @@ function SegmentedInputRendererComponent(props) {
|
|
|
5462
6173
|
)
|
|
5463
6174
|
}
|
|
5464
6175
|
),
|
|
5465
|
-
/* @__PURE__ */ (0,
|
|
6176
|
+
/* @__PURE__ */ (0, import_jsx_runtime87.jsx)("div", { id: `${id}-children`, children })
|
|
5466
6177
|
] });
|
|
5467
6178
|
}
|
|
5468
6179
|
var isValidIndex3 = (index, options) => index !== null && index >= 0 && index < options;
|
|
5469
6180
|
|
|
5470
6181
|
// ../renderers/src/SelectInputRenderer/RadioItemRendererComponent.tsx
|
|
5471
6182
|
var import_components60 = require("@transferwise/components");
|
|
5472
|
-
var
|
|
6183
|
+
var import_jsx_runtime88 = require("react/jsx-runtime");
|
|
5473
6184
|
function RadioItemRendererComponent(props) {
|
|
5474
6185
|
const {
|
|
5475
6186
|
id,
|
|
@@ -5485,22 +6196,22 @@ function RadioItemRendererComponent(props) {
|
|
|
5485
6196
|
onSelect
|
|
5486
6197
|
} = props;
|
|
5487
6198
|
const { ref } = useScrollToError(validationState, features);
|
|
5488
|
-
return /* @__PURE__ */ (0,
|
|
5489
|
-
rootTitle && /* @__PURE__ */ (0,
|
|
6199
|
+
return /* @__PURE__ */ (0, import_jsx_runtime88.jsxs)("div", { ref, className: controlAndTagsToCSSClass(props), children: [
|
|
6200
|
+
rootTitle && /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(
|
|
5490
6201
|
import_components60.Header,
|
|
5491
6202
|
{
|
|
5492
6203
|
as: "h2",
|
|
5493
|
-
title: help ? /* @__PURE__ */ (0,
|
|
6204
|
+
title: help ? /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(LabelContentWithHelp, { text: rootTitle, help }) : rootTitle
|
|
5494
6205
|
}
|
|
5495
6206
|
),
|
|
5496
|
-
rootDescription && /* @__PURE__ */ (0,
|
|
5497
|
-
/* @__PURE__ */ (0,
|
|
5498
|
-
({ title, description, additionalText, inlineAlert, disabled, media, supportingValues }, index) => /* @__PURE__ */ (0,
|
|
6207
|
+
rootDescription && /* @__PURE__ */ (0, import_jsx_runtime88.jsx)("p", { children: rootDescription }),
|
|
6208
|
+
/* @__PURE__ */ (0, import_jsx_runtime88.jsx)(import_components60.List, { children: options.map(
|
|
6209
|
+
({ title, description, additionalText, inlineAlert, disabled, media, supportingValues }, index) => /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(
|
|
5499
6210
|
import_components60.ListItem,
|
|
5500
6211
|
__spreadValues({
|
|
5501
6212
|
title,
|
|
5502
6213
|
subtitle: description,
|
|
5503
|
-
control: /* @__PURE__ */ (0,
|
|
6214
|
+
control: /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(
|
|
5504
6215
|
import_components60.ListItem.Radio,
|
|
5505
6216
|
{
|
|
5506
6217
|
name: title,
|
|
@@ -5516,28 +6227,28 @@ function RadioItemRendererComponent(props) {
|
|
|
5516
6227
|
title
|
|
5517
6228
|
)
|
|
5518
6229
|
) }, `${id}-${selectedIndex}`),
|
|
5519
|
-
(validationState == null ? void 0 : validationState.status) === "invalid" && /* @__PURE__ */ (0,
|
|
6230
|
+
(validationState == null ? void 0 : validationState.status) === "invalid" && /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(import_components60.InlineAlert, { type: "negative", children: validationState.message }),
|
|
5520
6231
|
children
|
|
5521
6232
|
] });
|
|
5522
6233
|
}
|
|
5523
6234
|
|
|
5524
6235
|
// ../renderers/src/SelectInputRenderer/SelectInputRenderer.tsx
|
|
5525
|
-
var
|
|
6236
|
+
var import_jsx_runtime89 = require("react/jsx-runtime");
|
|
5526
6237
|
var SelectInputRenderer = {
|
|
5527
6238
|
canRenderType: "input-select",
|
|
5528
6239
|
render: (props) => {
|
|
5529
6240
|
switch (props.control) {
|
|
5530
6241
|
case "radio":
|
|
5531
|
-
return /* @__PURE__ */ (0,
|
|
6242
|
+
return /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(RadioInputRendererComponent, __spreadValues({}, props));
|
|
5532
6243
|
case "radio-item":
|
|
5533
|
-
return /* @__PURE__ */ (0,
|
|
6244
|
+
return /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(RadioItemRendererComponent, __spreadValues({}, props));
|
|
5534
6245
|
case "tab":
|
|
5535
|
-
return props.options.length > 3 ? /* @__PURE__ */ (0,
|
|
6246
|
+
return props.options.length > 3 ? /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(SelectInputRendererComponent, __spreadValues({}, props)) : /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(TabInputRendererComponent, __spreadValues({}, props));
|
|
5536
6247
|
case "segmented":
|
|
5537
|
-
return props.options.length > 3 ? /* @__PURE__ */ (0,
|
|
6248
|
+
return props.options.length > 3 ? /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(SelectInputRendererComponent, __spreadValues({}, props)) : /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(SegmentedInputRendererComponent, __spreadValues({}, props));
|
|
5538
6249
|
case "select":
|
|
5539
6250
|
default:
|
|
5540
|
-
return /* @__PURE__ */ (0,
|
|
6251
|
+
return /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(SelectInputRendererComponent, __spreadValues({}, props));
|
|
5541
6252
|
}
|
|
5542
6253
|
}
|
|
5543
6254
|
};
|
|
@@ -5545,21 +6256,21 @@ var SelectInputRenderer_default = SelectInputRenderer;
|
|
|
5545
6256
|
|
|
5546
6257
|
// ../renderers/src/StatusListRenderer.tsx
|
|
5547
6258
|
var import_components61 = require("@transferwise/components");
|
|
5548
|
-
var
|
|
5549
|
-
var
|
|
6259
|
+
var import_classnames29 = __toESM(require_classnames());
|
|
6260
|
+
var import_jsx_runtime90 = require("react/jsx-runtime");
|
|
5550
6261
|
var StatusListRenderer = {
|
|
5551
6262
|
canRenderType: "status-list",
|
|
5552
|
-
render: ({ margin, items, title, control, tags }) => /* @__PURE__ */ (0,
|
|
5553
|
-
title ? /* @__PURE__ */ (0,
|
|
6263
|
+
render: ({ margin, items, title, control, tags }) => /* @__PURE__ */ (0, import_jsx_runtime90.jsxs)("div", { className: (0, import_classnames29.default)(getMargin(margin), controlAndTagsToCSSClass({ control, tags })), children: [
|
|
6264
|
+
title ? /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(import_components61.Header, { title }) : null,
|
|
5554
6265
|
items.map((item) => {
|
|
5555
6266
|
const { callToAction, description, title: itemTitle } = item;
|
|
5556
|
-
return /* @__PURE__ */ (0,
|
|
6267
|
+
return /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
|
|
5557
6268
|
import_components61.ListItem,
|
|
5558
6269
|
{
|
|
5559
6270
|
title: itemTitle,
|
|
5560
6271
|
subtitle: description,
|
|
5561
|
-
media: /* @__PURE__ */ (0,
|
|
5562
|
-
additionalInfo: callToAction ? /* @__PURE__ */ (0,
|
|
6272
|
+
media: /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(StatusListItemMedia, __spreadValues({}, item)),
|
|
6273
|
+
additionalInfo: callToAction ? /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
|
|
5563
6274
|
import_components61.ListItem.AdditionalInfo,
|
|
5564
6275
|
{
|
|
5565
6276
|
action: __spreadValues({
|
|
@@ -5578,10 +6289,10 @@ var StatusListItemMedia = ({ icon, status }) => {
|
|
|
5578
6289
|
return void 0;
|
|
5579
6290
|
}
|
|
5580
6291
|
if ("name" in icon) {
|
|
5581
|
-
return /* @__PURE__ */ (0,
|
|
6292
|
+
return /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(import_components61.AvatarView, { badge: { status: mapStatus(status) }, children: /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(DynamicIcon_default, { name: icon.name }) });
|
|
5582
6293
|
}
|
|
5583
6294
|
if ("text" in icon) {
|
|
5584
|
-
return /* @__PURE__ */ (0,
|
|
6295
|
+
return /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(import_components61.AvatarView, { badge: { status: mapStatus(status) }, children: icon.text });
|
|
5585
6296
|
}
|
|
5586
6297
|
return void 0;
|
|
5587
6298
|
};
|
|
@@ -5598,16 +6309,16 @@ var mapStatus = (status) => {
|
|
|
5598
6309
|
var StatusListRenderer_default = StatusListRenderer;
|
|
5599
6310
|
|
|
5600
6311
|
// ../renderers/src/step/SplashCelebrationStepRenderer.tsx
|
|
5601
|
-
var
|
|
6312
|
+
var import_classnames30 = __toESM(require_classnames());
|
|
5602
6313
|
|
|
5603
6314
|
// ../renderers/src/utils/useCustomTheme.ts
|
|
5604
6315
|
var import_components_theming = require("@wise/components-theming");
|
|
5605
|
-
var
|
|
6316
|
+
var import_react25 = require("react");
|
|
5606
6317
|
var ThemeRequiredEventName = "Theme Required";
|
|
5607
6318
|
var useCustomTheme = (theme, trackEvent) => {
|
|
5608
6319
|
const theming = (0, import_components_theming.useTheme)();
|
|
5609
|
-
const previousTheme = (0,
|
|
5610
|
-
(0,
|
|
6320
|
+
const previousTheme = (0, import_react25.useMemo)(() => theming.theme, []);
|
|
6321
|
+
(0, import_react25.useEffect)(() => {
|
|
5611
6322
|
theming.setTheme(theme);
|
|
5612
6323
|
trackEvent(ThemeRequiredEventName, { theme });
|
|
5613
6324
|
return theme !== previousTheme ? () => {
|
|
@@ -5620,12 +6331,12 @@ var useCustomTheme = (theme, trackEvent) => {
|
|
|
5620
6331
|
|
|
5621
6332
|
// ../renderers/src/step/StepHeader.tsx
|
|
5622
6333
|
var import_components62 = require("@transferwise/components");
|
|
5623
|
-
var
|
|
6334
|
+
var import_jsx_runtime91 = require("react/jsx-runtime");
|
|
5624
6335
|
var StepHeader = ({ title, description, tags }) => {
|
|
5625
6336
|
const { titleType, alignmentClassName } = getHeaderStyle(tags);
|
|
5626
|
-
return /* @__PURE__ */ (0,
|
|
5627
|
-
title ? /* @__PURE__ */ (0,
|
|
5628
|
-
description ? /* @__PURE__ */ (0,
|
|
6337
|
+
return /* @__PURE__ */ (0, import_jsx_runtime91.jsxs)(import_jsx_runtime91.Fragment, { children: [
|
|
6338
|
+
title ? /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(import_components62.Title, { as: "h1", type: titleType, className: `${alignmentClassName} m-b-2`, children: title }) : void 0,
|
|
6339
|
+
description ? /* @__PURE__ */ (0, import_jsx_runtime91.jsx)("p", { className: `${alignmentClassName} np-text-body-large`, children: description }) : void 0
|
|
5629
6340
|
] });
|
|
5630
6341
|
};
|
|
5631
6342
|
var getHeaderStyle = (tags) => {
|
|
@@ -5638,11 +6349,11 @@ var getHeaderStyle = (tags) => {
|
|
|
5638
6349
|
// ../renderers/src/step/topbar/BackButton.tsx
|
|
5639
6350
|
var import_components63 = require("@transferwise/components");
|
|
5640
6351
|
var import_icons6 = require("@transferwise/icons");
|
|
5641
|
-
var
|
|
6352
|
+
var import_react_intl34 = require("react-intl");
|
|
5642
6353
|
|
|
5643
6354
|
// ../renderers/src/messages/back.messages.ts
|
|
5644
|
-
var
|
|
5645
|
-
var back_messages_default = (0,
|
|
6355
|
+
var import_react_intl33 = require("react-intl");
|
|
6356
|
+
var back_messages_default = (0, import_react_intl33.defineMessages)({
|
|
5646
6357
|
back: {
|
|
5647
6358
|
id: "df.wise.back.label",
|
|
5648
6359
|
defaultMessage: "Back",
|
|
@@ -5651,30 +6362,30 @@ var back_messages_default = (0, import_react_intl31.defineMessages)({
|
|
|
5651
6362
|
});
|
|
5652
6363
|
|
|
5653
6364
|
// ../renderers/src/step/topbar/BackButton.tsx
|
|
5654
|
-
var
|
|
6365
|
+
var import_jsx_runtime92 = require("react/jsx-runtime");
|
|
5655
6366
|
function BackButton({ title, onClick }) {
|
|
5656
|
-
const { formatMessage } = (0,
|
|
5657
|
-
return /* @__PURE__ */ (0,
|
|
5658
|
-
/* @__PURE__ */ (0,
|
|
5659
|
-
/* @__PURE__ */ (0,
|
|
6367
|
+
const { formatMessage } = (0, import_react_intl34.useIntl)();
|
|
6368
|
+
return /* @__PURE__ */ (0, import_jsx_runtime92.jsxs)(import_components63.IconButton, { className: "df-back-button", priority: "tertiary", onClick, children: [
|
|
6369
|
+
/* @__PURE__ */ (0, import_jsx_runtime92.jsx)("span", { className: "sr-only", children: title != null ? title : formatMessage(back_messages_default.back) }),
|
|
6370
|
+
/* @__PURE__ */ (0, import_jsx_runtime92.jsx)(import_icons6.ArrowLeft, {})
|
|
5660
6371
|
] });
|
|
5661
6372
|
}
|
|
5662
6373
|
|
|
5663
6374
|
// ../renderers/src/step/topbar/Toolbar.tsx
|
|
5664
6375
|
var import_components64 = require("@transferwise/components");
|
|
5665
|
-
var
|
|
6376
|
+
var import_jsx_runtime93 = require("react/jsx-runtime");
|
|
5666
6377
|
var Toolbar = ({ items }) => {
|
|
5667
|
-
return (items == null ? void 0 : items.length) > 0 ? /* @__PURE__ */ (0,
|
|
6378
|
+
return (items == null ? void 0 : items.length) > 0 ? /* @__PURE__ */ (0, import_jsx_runtime93.jsx)("div", { className: "df-toolbar", children: items.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(ToolbarButton, __spreadValues({}, item), `${item.type}-${index}-${item.title}`)) }) : null;
|
|
5668
6379
|
};
|
|
5669
6380
|
function ToolbarButton(props) {
|
|
5670
|
-
return prefersMedia(props.control) ? /* @__PURE__ */ (0,
|
|
6381
|
+
return prefersMedia(props.control) ? /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(MediaToolbarButton, __spreadValues({}, props)) : /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(TextToolbarButton, __spreadValues({}, props));
|
|
5671
6382
|
}
|
|
5672
6383
|
function MediaToolbarButton(props) {
|
|
5673
6384
|
var _a;
|
|
5674
6385
|
const { context, control, media, accessibilityDescription, disabled, onClick } = props;
|
|
5675
6386
|
const priority = getIconButtonPriority(control);
|
|
5676
6387
|
const type = getSentiment2(context);
|
|
5677
|
-
return /* @__PURE__ */ (0,
|
|
6388
|
+
return /* @__PURE__ */ (0, import_jsx_runtime93.jsxs)(
|
|
5678
6389
|
import_components64.IconButton,
|
|
5679
6390
|
{
|
|
5680
6391
|
className: "df-toolbar-button",
|
|
@@ -5684,7 +6395,7 @@ function MediaToolbarButton(props) {
|
|
|
5684
6395
|
type,
|
|
5685
6396
|
onClick,
|
|
5686
6397
|
children: [
|
|
5687
|
-
accessibilityDescription ? /* @__PURE__ */ (0,
|
|
6398
|
+
accessibilityDescription ? /* @__PURE__ */ (0, import_jsx_runtime93.jsx)("span", { className: "sr-only", children: accessibilityDescription }) : null,
|
|
5688
6399
|
media ? (_a = getAddonStartMedia(media)) == null ? void 0 : _a.value : null
|
|
5689
6400
|
]
|
|
5690
6401
|
}
|
|
@@ -5695,7 +6406,7 @@ function TextToolbarButton(props) {
|
|
|
5695
6406
|
const addonStart = media ? getAddonStartMedia(media) : void 0;
|
|
5696
6407
|
const priority = getPriority2(control);
|
|
5697
6408
|
const sentiment = getSentiment2(context);
|
|
5698
|
-
return /* @__PURE__ */ (0,
|
|
6409
|
+
return /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(
|
|
5699
6410
|
import_components64.Button,
|
|
5700
6411
|
{
|
|
5701
6412
|
v2: true,
|
|
@@ -5725,18 +6436,18 @@ var getIconButtonPriority = (control) => {
|
|
|
5725
6436
|
};
|
|
5726
6437
|
|
|
5727
6438
|
// ../renderers/src/step/topbar/TopBar.tsx
|
|
5728
|
-
var
|
|
6439
|
+
var import_jsx_runtime94 = require("react/jsx-runtime");
|
|
5729
6440
|
function TopBar({ back, toolbar, tags }) {
|
|
5730
6441
|
const isBackAllowed = !(tags == null ? void 0 : tags.includes("non-dismissible"));
|
|
5731
6442
|
const backCTA = isBackAllowed ? back : void 0;
|
|
5732
|
-
return backCTA || toolbar ? /* @__PURE__ */ (0,
|
|
5733
|
-
backCTA ? /* @__PURE__ */ (0,
|
|
5734
|
-
toolbar ? /* @__PURE__ */ (0,
|
|
6443
|
+
return backCTA || toolbar ? /* @__PURE__ */ (0, import_jsx_runtime94.jsxs)("div", { className: "d-flex m-b-2", children: [
|
|
6444
|
+
backCTA ? /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(BackButton, __spreadValues({}, backCTA)) : null,
|
|
6445
|
+
toolbar ? /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(Toolbar, __spreadValues({}, toolbar)) : null
|
|
5735
6446
|
] }) : null;
|
|
5736
6447
|
}
|
|
5737
6448
|
|
|
5738
6449
|
// ../renderers/src/step/SplashCelebrationStepRenderer.tsx
|
|
5739
|
-
var
|
|
6450
|
+
var import_jsx_runtime95 = require("react/jsx-runtime");
|
|
5740
6451
|
var SplashCelebrationStepRenderer = {
|
|
5741
6452
|
canRenderType: "step",
|
|
5742
6453
|
canRender: ({ control }) => control === "splash-celebration",
|
|
@@ -5745,23 +6456,23 @@ var SplashCelebrationStepRenderer = {
|
|
|
5745
6456
|
function SplashCelebrationStepRendererComponent(props) {
|
|
5746
6457
|
const { back, title, description, toolbar, children, footer, control, tags, trackEvent } = props;
|
|
5747
6458
|
useCustomTheme("forest-green", trackEvent);
|
|
5748
|
-
return /* @__PURE__ */ (0,
|
|
6459
|
+
return /* @__PURE__ */ (0, import_jsx_runtime95.jsxs)(
|
|
5749
6460
|
"div",
|
|
5750
6461
|
{
|
|
5751
|
-
className: (0,
|
|
6462
|
+
className: (0, import_classnames30.default)("splash-screen", "m-t-5", controlAndTagsToCSSClass({ control, tags })),
|
|
5752
6463
|
children: [
|
|
5753
|
-
/* @__PURE__ */ (0,
|
|
5754
|
-
title || description ? /* @__PURE__ */ (0,
|
|
6464
|
+
/* @__PURE__ */ (0, import_jsx_runtime95.jsx)(TopBar, { back, toolbar, tags }),
|
|
6465
|
+
title || description ? /* @__PURE__ */ (0, import_jsx_runtime95.jsx)("div", { className: "m-b-4", children: /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(StepHeader, { title, description, tags }) }) : void 0,
|
|
5755
6466
|
children,
|
|
5756
|
-
/* @__PURE__ */ (0,
|
|
6467
|
+
/* @__PURE__ */ (0, import_jsx_runtime95.jsx)(StepFooter, { footer, tags })
|
|
5757
6468
|
]
|
|
5758
6469
|
}
|
|
5759
6470
|
);
|
|
5760
6471
|
}
|
|
5761
6472
|
|
|
5762
6473
|
// ../renderers/src/step/SplashStepRenderer.tsx
|
|
5763
|
-
var
|
|
5764
|
-
var
|
|
6474
|
+
var import_classnames31 = __toESM(require_classnames());
|
|
6475
|
+
var import_jsx_runtime96 = require("react/jsx-runtime");
|
|
5765
6476
|
var SplashStepRenderer = {
|
|
5766
6477
|
canRenderType: "step",
|
|
5767
6478
|
canRender: ({ control }) => control === "splash",
|
|
@@ -5769,15 +6480,15 @@ var SplashStepRenderer = {
|
|
|
5769
6480
|
};
|
|
5770
6481
|
function SplashStepRendererComponent(props) {
|
|
5771
6482
|
const { back, title, description, toolbar, children, footer, control, tags } = props;
|
|
5772
|
-
return /* @__PURE__ */ (0,
|
|
6483
|
+
return /* @__PURE__ */ (0, import_jsx_runtime96.jsxs)(
|
|
5773
6484
|
"div",
|
|
5774
6485
|
{
|
|
5775
|
-
className: (0,
|
|
6486
|
+
className: (0, import_classnames31.default)("splash-screen", "m-t-5", controlAndTagsToCSSClass({ control, tags })),
|
|
5776
6487
|
children: [
|
|
5777
|
-
/* @__PURE__ */ (0,
|
|
5778
|
-
title || description ? /* @__PURE__ */ (0,
|
|
6488
|
+
/* @__PURE__ */ (0, import_jsx_runtime96.jsx)(TopBar, { back, toolbar, tags }),
|
|
6489
|
+
title || description ? /* @__PURE__ */ (0, import_jsx_runtime96.jsx)("div", { className: "m-b-4", children: /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(StepHeader, { title, description, tags }) }) : void 0,
|
|
5779
6490
|
children,
|
|
5780
|
-
/* @__PURE__ */ (0,
|
|
6491
|
+
/* @__PURE__ */ (0, import_jsx_runtime96.jsx)(StepFooter, { footer, tags })
|
|
5781
6492
|
]
|
|
5782
6493
|
}
|
|
5783
6494
|
);
|
|
@@ -5785,46 +6496,46 @@ function SplashStepRendererComponent(props) {
|
|
|
5785
6496
|
|
|
5786
6497
|
// ../renderers/src/step/StepRenderer.tsx
|
|
5787
6498
|
var import_components65 = require("@transferwise/components");
|
|
5788
|
-
var
|
|
6499
|
+
var import_jsx_runtime97 = require("react/jsx-runtime");
|
|
5789
6500
|
var StepRenderer = {
|
|
5790
6501
|
canRenderType: "step",
|
|
5791
6502
|
render: StepRendererComponent
|
|
5792
6503
|
};
|
|
5793
6504
|
function StepRendererComponent(props) {
|
|
5794
6505
|
const { back, description, error, title, children, toolbar, footer, control, tags } = props;
|
|
5795
|
-
return /* @__PURE__ */ (0,
|
|
5796
|
-
/* @__PURE__ */ (0,
|
|
5797
|
-
title || description ? /* @__PURE__ */ (0,
|
|
5798
|
-
error ? /* @__PURE__ */ (0,
|
|
6506
|
+
return /* @__PURE__ */ (0, import_jsx_runtime97.jsxs)("div", { className: controlAndTagsToCSSClass({ control, tags }), children: [
|
|
6507
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsx)(TopBar, { back, toolbar, tags }),
|
|
6508
|
+
title || description ? /* @__PURE__ */ (0, import_jsx_runtime97.jsx)("div", { className: "m-b-4", children: /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(StepHeader, { title, description, tags }) }) : void 0,
|
|
6509
|
+
error ? /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(import_components65.Alert, { type: "negative", className: "m-b-2", message: error }) : null,
|
|
5799
6510
|
children,
|
|
5800
|
-
/* @__PURE__ */ (0,
|
|
6511
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsx)(StepFooter, { footer, tags })
|
|
5801
6512
|
] });
|
|
5802
6513
|
}
|
|
5803
6514
|
|
|
5804
6515
|
// ../renderers/src/TabsRenderer.tsx
|
|
5805
6516
|
var import_components66 = require("@transferwise/components");
|
|
5806
|
-
var
|
|
5807
|
-
var
|
|
5808
|
-
var
|
|
6517
|
+
var import_classnames32 = __toESM(require_classnames());
|
|
6518
|
+
var import_react26 = require("react");
|
|
6519
|
+
var import_jsx_runtime98 = require("react/jsx-runtime");
|
|
5809
6520
|
var TabsRenderer = {
|
|
5810
6521
|
canRenderType: "tabs",
|
|
5811
6522
|
render: (props) => {
|
|
5812
6523
|
switch (props.control) {
|
|
5813
6524
|
case "segmented":
|
|
5814
6525
|
if (props.tabs.length > 3) {
|
|
5815
|
-
return /* @__PURE__ */ (0,
|
|
6526
|
+
return /* @__PURE__ */ (0, import_jsx_runtime98.jsx)(TabsRendererComponent, __spreadValues({}, props));
|
|
5816
6527
|
}
|
|
5817
|
-
return /* @__PURE__ */ (0,
|
|
6528
|
+
return /* @__PURE__ */ (0, import_jsx_runtime98.jsx)(SegmentedTabsRendererComponent, __spreadValues({}, props));
|
|
5818
6529
|
case "chips":
|
|
5819
|
-
return /* @__PURE__ */ (0,
|
|
6530
|
+
return /* @__PURE__ */ (0, import_jsx_runtime98.jsx)(ChipsTabsRendererComponent, __spreadValues({}, props));
|
|
5820
6531
|
default:
|
|
5821
|
-
return /* @__PURE__ */ (0,
|
|
6532
|
+
return /* @__PURE__ */ (0, import_jsx_runtime98.jsx)(TabsRendererComponent, __spreadValues({}, props));
|
|
5822
6533
|
}
|
|
5823
6534
|
}
|
|
5824
6535
|
};
|
|
5825
6536
|
function TabsRendererComponent({ uid, margin, tabs, control, tags }) {
|
|
5826
|
-
const [selectedIndex, setSelectedIndex] = (0,
|
|
5827
|
-
return /* @__PURE__ */ (0,
|
|
6537
|
+
const [selectedIndex, setSelectedIndex] = (0, import_react26.useState)(0);
|
|
6538
|
+
return /* @__PURE__ */ (0, import_jsx_runtime98.jsx)("div", { className: (0, import_classnames32.default)(getMargin(margin), controlAndTagsToCSSClass({ control, tags })), children: /* @__PURE__ */ (0, import_jsx_runtime98.jsx)(
|
|
5828
6539
|
import_components66.Tabs,
|
|
5829
6540
|
{
|
|
5830
6541
|
name: uid,
|
|
@@ -5832,7 +6543,7 @@ function TabsRendererComponent({ uid, margin, tabs, control, tags }) {
|
|
|
5832
6543
|
tabs: tabs.map((option) => ({
|
|
5833
6544
|
title: option.title,
|
|
5834
6545
|
disabled: false,
|
|
5835
|
-
content: /* @__PURE__ */ (0,
|
|
6546
|
+
content: /* @__PURE__ */ (0, import_jsx_runtime98.jsxs)("div", { className: "m-t-2", children: [
|
|
5836
6547
|
" ",
|
|
5837
6548
|
option.children,
|
|
5838
6549
|
" "
|
|
@@ -5844,9 +6555,9 @@ function TabsRendererComponent({ uid, margin, tabs, control, tags }) {
|
|
|
5844
6555
|
}
|
|
5845
6556
|
function SegmentedTabsRendererComponent({ uid, margin, tabs, control, tags }) {
|
|
5846
6557
|
var _a;
|
|
5847
|
-
const [selectedIndex, setSelectedIndex] = (0,
|
|
5848
|
-
return /* @__PURE__ */ (0,
|
|
5849
|
-
/* @__PURE__ */ (0,
|
|
6558
|
+
const [selectedIndex, setSelectedIndex] = (0, import_react26.useState)(0);
|
|
6559
|
+
return /* @__PURE__ */ (0, import_jsx_runtime98.jsxs)("div", { className: (0, import_classnames32.default)(getMargin(margin), controlAndTagsToCSSClass({ control, tags })), children: [
|
|
6560
|
+
/* @__PURE__ */ (0, import_jsx_runtime98.jsx)(
|
|
5850
6561
|
import_components66.SegmentedControl,
|
|
5851
6562
|
{
|
|
5852
6563
|
name: uid,
|
|
@@ -5861,14 +6572,14 @@ function SegmentedTabsRendererComponent({ uid, margin, tabs, control, tags }) {
|
|
|
5861
6572
|
onChange: (value) => setSelectedIndex(Number(value))
|
|
5862
6573
|
}
|
|
5863
6574
|
),
|
|
5864
|
-
/* @__PURE__ */ (0,
|
|
6575
|
+
/* @__PURE__ */ (0, import_jsx_runtime98.jsx)("div", { id: `${uid}-children`, className: "m-t-2", children: (_a = tabs[selectedIndex]) == null ? void 0 : _a.children })
|
|
5865
6576
|
] });
|
|
5866
6577
|
}
|
|
5867
6578
|
function ChipsTabsRendererComponent({ margin, tabs, control, tags }) {
|
|
5868
6579
|
var _a;
|
|
5869
|
-
const [selectedIndex, setSelectedIndex] = (0,
|
|
5870
|
-
return /* @__PURE__ */ (0,
|
|
5871
|
-
/* @__PURE__ */ (0,
|
|
6580
|
+
const [selectedIndex, setSelectedIndex] = (0, import_react26.useState)(0);
|
|
6581
|
+
return /* @__PURE__ */ (0, import_jsx_runtime98.jsxs)("div", { className: (0, import_classnames32.default)(getMargin(margin), controlAndTagsToCSSClass({ control, tags })), children: [
|
|
6582
|
+
/* @__PURE__ */ (0, import_jsx_runtime98.jsx)("div", { className: "chips-container", children: /* @__PURE__ */ (0, import_jsx_runtime98.jsx)(
|
|
5872
6583
|
import_components66.Chips,
|
|
5873
6584
|
{
|
|
5874
6585
|
chips: tabs.map((tab, index) => ({ label: tab.title, value: index })),
|
|
@@ -5876,7 +6587,7 @@ function ChipsTabsRendererComponent({ margin, tabs, control, tags }) {
|
|
|
5876
6587
|
onChange: ({ selectedValue }) => setSelectedIndex(Number(selectedValue))
|
|
5877
6588
|
}
|
|
5878
6589
|
) }),
|
|
5879
|
-
/* @__PURE__ */ (0,
|
|
6590
|
+
/* @__PURE__ */ (0, import_jsx_runtime98.jsx)("div", { className: "m-t-2", children: (_a = tabs[selectedIndex]) == null ? void 0 : _a.children })
|
|
5880
6591
|
] });
|
|
5881
6592
|
}
|
|
5882
6593
|
|
|
@@ -5885,7 +6596,7 @@ var import_components68 = require("@transferwise/components");
|
|
|
5885
6596
|
|
|
5886
6597
|
// ../renderers/src/components/VariableTextInput.tsx
|
|
5887
6598
|
var import_components67 = require("@transferwise/components");
|
|
5888
|
-
var
|
|
6599
|
+
var import_jsx_runtime99 = require("react/jsx-runtime");
|
|
5889
6600
|
var commonKeys = [
|
|
5890
6601
|
"autoComplete",
|
|
5891
6602
|
"autoCapitalize",
|
|
@@ -5904,12 +6615,12 @@ function VariableTextInput(inputProps) {
|
|
|
5904
6615
|
const commonProps = __spreadProps(__spreadValues({}, pick(inputProps, ...commonKeys)), { name: id });
|
|
5905
6616
|
switch (control) {
|
|
5906
6617
|
case "email":
|
|
5907
|
-
return /* @__PURE__ */ (0,
|
|
6618
|
+
return /* @__PURE__ */ (0, import_jsx_runtime99.jsx)(TextInput, __spreadProps(__spreadValues({}, commonProps), { type: "email", onChange }));
|
|
5908
6619
|
case "password":
|
|
5909
|
-
return /* @__PURE__ */ (0,
|
|
6620
|
+
return /* @__PURE__ */ (0, import_jsx_runtime99.jsx)(TextInput, __spreadProps(__spreadValues({}, commonProps), { type: "password", onChange }));
|
|
5910
6621
|
case "numeric": {
|
|
5911
6622
|
const numericProps = __spreadProps(__spreadValues({}, commonProps), { type: "number", onWheel });
|
|
5912
|
-
return /* @__PURE__ */ (0,
|
|
6623
|
+
return /* @__PURE__ */ (0, import_jsx_runtime99.jsx)(
|
|
5913
6624
|
TextInput,
|
|
5914
6625
|
__spreadProps(__spreadValues({}, numericProps), {
|
|
5915
6626
|
onChange: (newValue) => {
|
|
@@ -5920,9 +6631,9 @@ function VariableTextInput(inputProps) {
|
|
|
5920
6631
|
);
|
|
5921
6632
|
}
|
|
5922
6633
|
case "phone-number":
|
|
5923
|
-
return /* @__PURE__ */ (0,
|
|
6634
|
+
return /* @__PURE__ */ (0, import_jsx_runtime99.jsx)(import_components67.PhoneNumberInput, __spreadProps(__spreadValues({ initialValue: value }, commonProps), { onChange }));
|
|
5924
6635
|
default: {
|
|
5925
|
-
return /* @__PURE__ */ (0,
|
|
6636
|
+
return /* @__PURE__ */ (0, import_jsx_runtime99.jsx)(TextInput, __spreadProps(__spreadValues({}, commonProps), { type: "text", onChange }));
|
|
5926
6637
|
}
|
|
5927
6638
|
}
|
|
5928
6639
|
}
|
|
@@ -5930,11 +6641,11 @@ function TextInput(props) {
|
|
|
5930
6641
|
const _a = props, { control, displayFormat, onChange } = _a, commonProps = __objRest(_a, ["control", "displayFormat", "onChange"]);
|
|
5931
6642
|
const InputWithPattern = control === "textarea" ? import_components67.TextareaWithDisplayFormat : import_components67.InputWithDisplayFormat;
|
|
5932
6643
|
const InputWithoutPattern = control === "textarea" ? import_components67.TextArea : import_components67.Input;
|
|
5933
|
-
return displayFormat ? /* @__PURE__ */ (0,
|
|
6644
|
+
return displayFormat ? /* @__PURE__ */ (0, import_jsx_runtime99.jsx)(InputWithPattern, __spreadProps(__spreadValues({ displayPattern: displayFormat }, commonProps), { onChange })) : /* @__PURE__ */ (0, import_jsx_runtime99.jsx)(InputWithoutPattern, __spreadProps(__spreadValues({}, commonProps), { onChange: (e) => onChange(e.target.value) }));
|
|
5934
6645
|
}
|
|
5935
6646
|
|
|
5936
6647
|
// ../renderers/src/TextInputRenderer.tsx
|
|
5937
|
-
var
|
|
6648
|
+
var import_jsx_runtime100 = require("react/jsx-runtime");
|
|
5938
6649
|
var TextInputRenderer = {
|
|
5939
6650
|
canRenderType: "input-text",
|
|
5940
6651
|
render: (props) => {
|
|
@@ -5967,7 +6678,7 @@ var TextInputRenderer = {
|
|
|
5967
6678
|
}
|
|
5968
6679
|
}
|
|
5969
6680
|
});
|
|
5970
|
-
return /* @__PURE__ */ (0,
|
|
6681
|
+
return /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(
|
|
5971
6682
|
FieldInput_default,
|
|
5972
6683
|
{
|
|
5973
6684
|
id,
|
|
@@ -5980,7 +6691,7 @@ var TextInputRenderer = {
|
|
|
5980
6691
|
features: props.features,
|
|
5981
6692
|
control: props.control,
|
|
5982
6693
|
tags: props.tags,
|
|
5983
|
-
children: /* @__PURE__ */ (0,
|
|
6694
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(import_components68.InputGroup, { addonStart: getInputGroupAddonStart(media), children: /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(VariableTextInput, __spreadValues({}, inputProps)) })
|
|
5984
6695
|
}
|
|
5985
6696
|
);
|
|
5986
6697
|
}
|
|
@@ -5994,7 +6705,7 @@ var import_components69 = require("@transferwise/components");
|
|
|
5994
6705
|
var getRandomId = () => Math.random().toString(36).substring(2);
|
|
5995
6706
|
|
|
5996
6707
|
// ../renderers/src/UploadInputRenderer.tsx
|
|
5997
|
-
var
|
|
6708
|
+
var import_jsx_runtime101 = require("react/jsx-runtime");
|
|
5998
6709
|
var UploadInputRenderer = {
|
|
5999
6710
|
canRenderType: "input-upload",
|
|
6000
6711
|
render: (props) => {
|
|
@@ -6023,7 +6734,7 @@ var UploadInputRenderer = {
|
|
|
6023
6734
|
};
|
|
6024
6735
|
return (
|
|
6025
6736
|
// We don't pass help here as there is no sensible place to display it
|
|
6026
|
-
/* @__PURE__ */ (0,
|
|
6737
|
+
/* @__PURE__ */ (0, import_jsx_runtime101.jsx)(
|
|
6027
6738
|
UploadFieldInput_default,
|
|
6028
6739
|
{
|
|
6029
6740
|
id,
|
|
@@ -6033,7 +6744,7 @@ var UploadInputRenderer = {
|
|
|
6033
6744
|
features,
|
|
6034
6745
|
control,
|
|
6035
6746
|
tags,
|
|
6036
|
-
children: /* @__PURE__ */ (0,
|
|
6747
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime101.jsx)(
|
|
6037
6748
|
import_components69.UploadInput,
|
|
6038
6749
|
{
|
|
6039
6750
|
id,
|
|
@@ -6103,7 +6814,7 @@ var LargeUploadRenderer = {
|
|
|
6103
6814
|
};
|
|
6104
6815
|
const filetypes = acceptsToFileTypes(accepts);
|
|
6105
6816
|
const usAccept = filetypes === "*" ? "*" : filetypes.join(",");
|
|
6106
|
-
return /* @__PURE__ */ (0,
|
|
6817
|
+
return /* @__PURE__ */ (0, import_jsx_runtime101.jsx)(
|
|
6107
6818
|
FieldInput_default,
|
|
6108
6819
|
{
|
|
6109
6820
|
id,
|
|
@@ -6114,7 +6825,7 @@ var LargeUploadRenderer = {
|
|
|
6114
6825
|
features,
|
|
6115
6826
|
control,
|
|
6116
6827
|
tags,
|
|
6117
|
-
children: /* @__PURE__ */ (0,
|
|
6828
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime101.jsx)(
|
|
6118
6829
|
import_components69.Upload,
|
|
6119
6830
|
__spreadProps(__spreadValues({}, uploadProps), {
|
|
6120
6831
|
usAccept,
|
|
@@ -6131,20 +6842,20 @@ var LargeUploadRenderer = {
|
|
|
6131
6842
|
|
|
6132
6843
|
// ../renderers/src/UpsellRenderer.tsx
|
|
6133
6844
|
var import_components70 = require("@transferwise/components");
|
|
6134
|
-
var
|
|
6135
|
-
var
|
|
6136
|
-
var
|
|
6845
|
+
var import_classnames33 = __toESM(require_classnames());
|
|
6846
|
+
var import_react27 = require("react");
|
|
6847
|
+
var import_jsx_runtime102 = require("react/jsx-runtime");
|
|
6137
6848
|
var UpsellRenderer = {
|
|
6138
6849
|
canRenderType: "upsell",
|
|
6139
6850
|
render: UpsellRendererComponent
|
|
6140
6851
|
};
|
|
6141
6852
|
function UpsellRendererComponent(props) {
|
|
6142
6853
|
const { text, callToAction, media, margin, onDismiss, control, tags } = props;
|
|
6143
|
-
const [isVisible, setIsVisible] = (0,
|
|
6144
|
-
return isVisible ? /* @__PURE__ */ (0,
|
|
6854
|
+
const [isVisible, setIsVisible] = (0, import_react27.useState)(true);
|
|
6855
|
+
return isVisible ? /* @__PURE__ */ (0, import_jsx_runtime102.jsx)(
|
|
6145
6856
|
import_components70.Nudge,
|
|
6146
6857
|
{
|
|
6147
|
-
className: (0,
|
|
6858
|
+
className: (0, import_classnames33.default)(getMargin(margin), controlAndTagsToCSSClass({ control, tags })),
|
|
6148
6859
|
mediaName: getMediaName(media),
|
|
6149
6860
|
title: text,
|
|
6150
6861
|
action: __spreadValues({
|
|
@@ -6189,8 +6900,8 @@ var supportedMediaNames = [
|
|
|
6189
6900
|
|
|
6190
6901
|
// ../renderers/src/ButtonRenderer/CircularButtonRenderer.tsx
|
|
6191
6902
|
var import_components71 = require("@transferwise/components");
|
|
6192
|
-
var
|
|
6193
|
-
var
|
|
6903
|
+
var import_classnames34 = __toESM(require_classnames());
|
|
6904
|
+
var import_jsx_runtime103 = require("react/jsx-runtime");
|
|
6194
6905
|
var CircularButtonRenderer = {
|
|
6195
6906
|
canRenderType: "button",
|
|
6196
6907
|
canRender: ({ control }) => control === "circular",
|
|
@@ -6200,16 +6911,16 @@ function CircularButtonComponent(props) {
|
|
|
6200
6911
|
var _a;
|
|
6201
6912
|
const { context, control, disabled, margin, media, tags, title, onClick } = props;
|
|
6202
6913
|
const priority = tags == null ? void 0 : tags.find((tag) => tag === "primary" || tag === "secondary");
|
|
6203
|
-
return /* @__PURE__ */ (0,
|
|
6914
|
+
return /* @__PURE__ */ (0, import_jsx_runtime103.jsx)(
|
|
6204
6915
|
"div",
|
|
6205
6916
|
{
|
|
6206
|
-
className: (0,
|
|
6917
|
+
className: (0, import_classnames34.default)(
|
|
6207
6918
|
getMargin(margin),
|
|
6208
6919
|
"df-button",
|
|
6209
6920
|
"circular",
|
|
6210
6921
|
controlAndTagsToCSSClass({ control, tags })
|
|
6211
6922
|
),
|
|
6212
|
-
children: /* @__PURE__ */ (0,
|
|
6923
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime103.jsx)(
|
|
6213
6924
|
import_components71.CircularButton,
|
|
6214
6925
|
{
|
|
6215
6926
|
disabled,
|
|
@@ -6230,6 +6941,7 @@ var getWiseRenderers = () => [
|
|
|
6230
6941
|
AlertRenderer_default,
|
|
6231
6942
|
CheckboxInputRenderer_default,
|
|
6232
6943
|
CircularButtonRenderer,
|
|
6944
|
+
BorderedBackgroundColoredBoxRenderer,
|
|
6233
6945
|
BoxRenderer_default,
|
|
6234
6946
|
CollectionRenderer_default,
|
|
6235
6947
|
ButtonRenderer,
|
|
@@ -6266,6 +6978,7 @@ var getWiseRenderers = () => [
|
|
|
6266
6978
|
TabsRenderer,
|
|
6267
6979
|
TextInputRenderer_default,
|
|
6268
6980
|
UploadInputRenderer,
|
|
6981
|
+
ColoredUpsellRenderer,
|
|
6269
6982
|
UpsellRenderer,
|
|
6270
6983
|
SplashStepRenderer,
|
|
6271
6984
|
SplashCelebrationStepRenderer,
|
|
@@ -6276,11 +6989,11 @@ var getWiseRenderers = () => [
|
|
|
6276
6989
|
|
|
6277
6990
|
// ../renderers/src/InitialLoadingStateRenderer.tsx
|
|
6278
6991
|
var import_components72 = require("@transferwise/components");
|
|
6279
|
-
var
|
|
6992
|
+
var import_jsx_runtime104 = require("react/jsx-runtime");
|
|
6280
6993
|
var InitialLoadingStateRenderer = {
|
|
6281
6994
|
canRenderType: "loading-state",
|
|
6282
6995
|
canRender: ({ stepLoadingState }) => stepLoadingState === "initial",
|
|
6283
|
-
render: () => /* @__PURE__ */ (0,
|
|
6996
|
+
render: () => /* @__PURE__ */ (0, import_jsx_runtime104.jsx)(
|
|
6284
6997
|
import_components72.Loader,
|
|
6285
6998
|
{
|
|
6286
6999
|
size: "md",
|
|
@@ -6293,24 +7006,24 @@ var InitialLoadingStateRenderer = {
|
|
|
6293
7006
|
// src/dynamicFlow/DynamicFlowModal.tsx
|
|
6294
7007
|
var import_dynamic_flow_client = require("@wise/dynamic-flow-client");
|
|
6295
7008
|
var import_components73 = require("@transferwise/components");
|
|
6296
|
-
var
|
|
7009
|
+
var import_jsx_runtime105 = require("react/jsx-runtime");
|
|
6297
7010
|
function DynamicFlowModal(props) {
|
|
6298
7011
|
const _a = props, { className = "" } = _a, rest = __objRest(_a, ["className"]);
|
|
6299
7012
|
const dfProps = useWiseToCoreProps(rest);
|
|
6300
7013
|
const df = (0, import_dynamic_flow_client.useDynamicFlowModal)(dfProps);
|
|
6301
|
-
return /* @__PURE__ */ (0,
|
|
7014
|
+
return /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(
|
|
6302
7015
|
import_components73.Modal,
|
|
6303
7016
|
__spreadProps(__spreadValues({
|
|
6304
7017
|
className: `dynamic-flow-modal ${className}`,
|
|
6305
7018
|
disableDimmerClickToClose: true
|
|
6306
7019
|
}, df.modal), {
|
|
6307
|
-
body: /* @__PURE__ */ (0,
|
|
7020
|
+
body: /* @__PURE__ */ (0, import_jsx_runtime105.jsx)("div", { className: "dynamic-flow-modal", children: df.modal.body })
|
|
6308
7021
|
})
|
|
6309
7022
|
);
|
|
6310
7023
|
}
|
|
6311
7024
|
|
|
6312
7025
|
// src/dynamicFlow/getMergedRenderers.tsx
|
|
6313
|
-
var
|
|
7026
|
+
var import_jsx_runtime106 = require("react/jsx-runtime");
|
|
6314
7027
|
var wiseRenderers = getWiseRenderers();
|
|
6315
7028
|
var getMergedRenderers = (props) => {
|
|
6316
7029
|
var _d, _e;
|
|
@@ -6324,7 +7037,7 @@ var getMergedRenderers = (props) => {
|
|
|
6324
7037
|
method: initialRequest.method,
|
|
6325
7038
|
data: initialRequest.body
|
|
6326
7039
|
};
|
|
6327
|
-
return presentation.type === "push" ? /* @__PURE__ */ (0,
|
|
7040
|
+
return presentation.type === "push" ? /* @__PURE__ */ (0, import_jsx_runtime106.jsx)(DynamicFlow, __spreadProps(__spreadValues(__spreadValues({}, restProps), rest), { features: subflowFeatures, initialAction: action })) : /* @__PURE__ */ (0, import_jsx_runtime106.jsx)(
|
|
6328
7041
|
DynamicFlowModal,
|
|
6329
7042
|
__spreadProps(__spreadValues(__spreadValues({}, restProps), rest), {
|
|
6330
7043
|
features: subflowFeatures,
|
|
@@ -6403,12 +7116,12 @@ var customEventsToAnalytics = {
|
|
|
6403
7116
|
};
|
|
6404
7117
|
|
|
6405
7118
|
// src/dynamicFlow/useOnCopy.tsx
|
|
6406
|
-
var
|
|
6407
|
-
var
|
|
7119
|
+
var import_react28 = require("react");
|
|
7120
|
+
var import_react_intl36 = require("react-intl");
|
|
6408
7121
|
|
|
6409
7122
|
// src/dynamicFlow/messages.ts
|
|
6410
|
-
var
|
|
6411
|
-
var messages_default = (0,
|
|
7123
|
+
var import_react_intl35 = require("react-intl");
|
|
7124
|
+
var messages_default = (0, import_react_intl35.defineMessages)({
|
|
6412
7125
|
copied: {
|
|
6413
7126
|
id: "df.wise.CopyFeedback.copy",
|
|
6414
7127
|
defaultMessage: "Copied to clipboard",
|
|
@@ -6423,9 +7136,9 @@ var messages_default = (0, import_react_intl33.defineMessages)({
|
|
|
6423
7136
|
|
|
6424
7137
|
// src/dynamicFlow/useOnCopy.tsx
|
|
6425
7138
|
var useOnCopy = () => {
|
|
6426
|
-
const { formatMessage } = (0,
|
|
7139
|
+
const { formatMessage } = (0, import_react_intl36.useIntl)();
|
|
6427
7140
|
const createSnackBar = useSnackBarIfAvailable();
|
|
6428
|
-
return (0,
|
|
7141
|
+
return (0, import_react28.useCallback)(
|
|
6429
7142
|
(copiedContent) => {
|
|
6430
7143
|
if (copiedContent) {
|
|
6431
7144
|
createSnackBar({ text: formatMessage(messages_default.copied) });
|
|
@@ -6438,11 +7151,11 @@ var useOnCopy = () => {
|
|
|
6438
7151
|
};
|
|
6439
7152
|
|
|
6440
7153
|
// src/dynamicFlow/useWiseHttpClient.tsx
|
|
6441
|
-
var
|
|
6442
|
-
var
|
|
7154
|
+
var import_react29 = require("react");
|
|
7155
|
+
var import_react_intl37 = require("react-intl");
|
|
6443
7156
|
var useWiseHttpClient = (httpClient) => {
|
|
6444
|
-
const { locale } = (0,
|
|
6445
|
-
return (0,
|
|
7157
|
+
const { locale } = (0, import_react_intl37.useIntl)();
|
|
7158
|
+
return (0, import_react29.useCallback)(
|
|
6446
7159
|
async (input, init = {}) => {
|
|
6447
7160
|
const headers = new Headers(init.headers);
|
|
6448
7161
|
headers.set("accept-language", locale);
|
|
@@ -6483,10 +7196,10 @@ var useWiseToCoreProps = (props) => {
|
|
|
6483
7196
|
onLog
|
|
6484
7197
|
} = props;
|
|
6485
7198
|
const httpClient = useWiseHttpClient(customFetch);
|
|
6486
|
-
const mergedRenderers = (0,
|
|
7199
|
+
const mergedRenderers = (0, import_react30.useMemo)(() => getMergedRenderers(props), [renderers]);
|
|
6487
7200
|
const createSnackBar = useCreateSnackBar();
|
|
6488
|
-
const logEvent = (0,
|
|
6489
|
-
const trackEvent = (0,
|
|
7201
|
+
const logEvent = (0, import_react30.useMemo)(() => getLogEvent(onLog), [onLog]);
|
|
7202
|
+
const trackEvent = (0, import_react30.useMemo)(() => getTrackEvent(onEvent, onAnalytics), [onEvent, onAnalytics]);
|
|
6490
7203
|
const onCopy = useOnCopy();
|
|
6491
7204
|
return __spreadProps(__spreadValues({}, props), {
|
|
6492
7205
|
httpClient,
|
|
@@ -6521,27 +7234,27 @@ var openLinkInNewTab = (url) => {
|
|
|
6521
7234
|
};
|
|
6522
7235
|
|
|
6523
7236
|
// src/dynamicFlow/DynamicFlow.tsx
|
|
6524
|
-
var
|
|
7237
|
+
var import_jsx_runtime107 = require("react/jsx-runtime");
|
|
6525
7238
|
function DynamicFlow(props) {
|
|
6526
7239
|
const { className = "" } = props;
|
|
6527
7240
|
const dfProps = useWiseToCoreProps(props);
|
|
6528
7241
|
const df = (0, import_dynamic_flow_client4.useDynamicFlow)(dfProps);
|
|
6529
7242
|
const { onContextMenu, contextMenu } = useDFContextMenu(df.controller);
|
|
6530
|
-
return /* @__PURE__ */ (0,
|
|
7243
|
+
return /* @__PURE__ */ (0, import_jsx_runtime107.jsxs)("div", { className, onContextMenu, children: [
|
|
6531
7244
|
df.view,
|
|
6532
7245
|
contextMenu
|
|
6533
7246
|
] });
|
|
6534
7247
|
}
|
|
6535
7248
|
|
|
6536
7249
|
// src/dynamicFlow/DynamicFlowWithRef.tsx
|
|
6537
|
-
var
|
|
7250
|
+
var import_react31 = require("react");
|
|
6538
7251
|
var import_dynamic_flow_client5 = require("@wise/dynamic-flow-client");
|
|
6539
|
-
var
|
|
6540
|
-
var DynamicFlowWithRef = (0,
|
|
7252
|
+
var import_jsx_runtime108 = require("react/jsx-runtime");
|
|
7253
|
+
var DynamicFlowWithRef = (0, import_react31.forwardRef)(function DynamicFlowWithRef2(props, ref) {
|
|
6541
7254
|
const { className = "" } = props;
|
|
6542
7255
|
const dfProps = useWiseToCoreProps(props);
|
|
6543
7256
|
const df = (0, import_dynamic_flow_client5.useDynamicFlow)(dfProps);
|
|
6544
|
-
(0,
|
|
7257
|
+
(0, import_react31.useImperativeHandle)(
|
|
6545
7258
|
ref,
|
|
6546
7259
|
() => ({
|
|
6547
7260
|
getValue: () => {
|
|
@@ -6552,7 +7265,7 @@ var DynamicFlowWithRef = (0, import_react30.forwardRef)(function DynamicFlowWith
|
|
|
6552
7265
|
}),
|
|
6553
7266
|
[df]
|
|
6554
7267
|
);
|
|
6555
|
-
return /* @__PURE__ */ (0,
|
|
7268
|
+
return /* @__PURE__ */ (0, import_jsx_runtime108.jsx)("div", { className, children: df.view });
|
|
6556
7269
|
});
|
|
6557
7270
|
|
|
6558
7271
|
// src/index.ts
|
|
@@ -6590,6 +7303,7 @@ var cs_default = {
|
|
|
6590
7303
|
"df.wise.ControlFeedback.type": "Nespr\xE1vn\xFD typ",
|
|
6591
7304
|
"df.wise.CopyFeedback.copy": "Zkop\xEDrov\xE1no do schr\xE1nky",
|
|
6592
7305
|
"df.wise.CopyFeedback.copyFailed": "Kop\xEDrov\xE1n\xED do schr\xE1nky se nezda\u0159ilo",
|
|
7306
|
+
"df.wise.DateInput.unavailableDates": "N\u011Bkter\xE1 data nejsou k dispozici.",
|
|
6593
7307
|
"df.wise.DynamicParagraph.copied": "Zkop\xEDrov\xE1no do schr\xE1nky",
|
|
6594
7308
|
"df.wise.DynamicParagraph.copy": "Kop\xEDrovat",
|
|
6595
7309
|
"df.wise.ErrorBoundary.errorAlert": "N\u011Bco se pokazilo.",
|
|
@@ -6639,6 +7353,7 @@ var de_default = {
|
|
|
6639
7353
|
"df.wise.ControlFeedback.type": "Falscher Typ",
|
|
6640
7354
|
"df.wise.CopyFeedback.copy": "In Zwischenablage kopiert",
|
|
6641
7355
|
"df.wise.CopyFeedback.copyFailed": "Kopieren in Zwischenablage fehlgeschlagen",
|
|
7356
|
+
"df.wise.DateInput.unavailableDates": "Some dates are unavailable.",
|
|
6642
7357
|
"df.wise.DynamicParagraph.copied": "In Zwischenablage kopiert",
|
|
6643
7358
|
"df.wise.DynamicParagraph.copy": "Kopieren",
|
|
6644
7359
|
"df.wise.ErrorBoundary.errorAlert": "Da ist etwas schiefgegangen.",
|
|
@@ -6688,6 +7403,7 @@ var en_default = {
|
|
|
6688
7403
|
"df.wise.ControlFeedback.type": "Incorrect type",
|
|
6689
7404
|
"df.wise.CopyFeedback.copy": "Copied to clipboard",
|
|
6690
7405
|
"df.wise.CopyFeedback.copyFailed": "Failed to copy to clipboard",
|
|
7406
|
+
"df.wise.DateInput.unavailableDates": "Some dates are unavailable.",
|
|
6691
7407
|
"df.wise.DynamicParagraph.copied": "Copied to clipboard",
|
|
6692
7408
|
"df.wise.DynamicParagraph.copy": "Copy",
|
|
6693
7409
|
"df.wise.ErrorBoundary.errorAlert": "Something went wrong.",
|
|
@@ -6737,6 +7453,7 @@ var es_default = {
|
|
|
6737
7453
|
"df.wise.ControlFeedback.type": "Tipo incorrecto",
|
|
6738
7454
|
"df.wise.CopyFeedback.copy": "Copiado al portapapeles",
|
|
6739
7455
|
"df.wise.CopyFeedback.copyFailed": "Error al copiar al portapapeles",
|
|
7456
|
+
"df.wise.DateInput.unavailableDates": "Algunas fechas no est\xE1n disponibles.",
|
|
6740
7457
|
"df.wise.DynamicParagraph.copied": "Copiado al portapapeles",
|
|
6741
7458
|
"df.wise.DynamicParagraph.copy": "Copiar",
|
|
6742
7459
|
"df.wise.ErrorBoundary.errorAlert": "Ha habido un error.",
|
|
@@ -6786,6 +7503,7 @@ var fr_default = {
|
|
|
6786
7503
|
"df.wise.ControlFeedback.type": "Type incorrect",
|
|
6787
7504
|
"df.wise.CopyFeedback.copy": "Copi\xE9 dans le presse-papier",
|
|
6788
7505
|
"df.wise.CopyFeedback.copyFailed": "Impossible de copier dans le presse-papier",
|
|
7506
|
+
"df.wise.DateInput.unavailableDates": "Some dates are unavailable.",
|
|
6789
7507
|
"df.wise.DynamicParagraph.copied": "Copi\xE9 dans le presse-papier",
|
|
6790
7508
|
"df.wise.DynamicParagraph.copy": "Copier",
|
|
6791
7509
|
"df.wise.ErrorBoundary.errorAlert": "Une erreur s'est produite.",
|
|
@@ -6835,6 +7553,7 @@ var hu_default = {
|
|
|
6835
7553
|
"df.wise.ControlFeedback.type": "Helytelen t\xEDpus",
|
|
6836
7554
|
"df.wise.CopyFeedback.copy": "V\xE1g\xF3lapra m\xE1solva",
|
|
6837
7555
|
"df.wise.CopyFeedback.copyFailed": "Nem siker\xFClt a v\xE1g\xF3lapra m\xE1solni",
|
|
7556
|
+
"df.wise.DateInput.unavailableDates": "Some dates are unavailable.",
|
|
6838
7557
|
"df.wise.DynamicParagraph.copied": "V\xE1g\xF3lapra m\xE1solva",
|
|
6839
7558
|
"df.wise.DynamicParagraph.copy": "M\xE1sol\xE1s",
|
|
6840
7559
|
"df.wise.ErrorBoundary.errorAlert": "Valami hiba t\xF6rt\xE9nt.",
|
|
@@ -6884,6 +7603,7 @@ var id_default = {
|
|
|
6884
7603
|
"df.wise.ControlFeedback.type": "Tipe salah",
|
|
6885
7604
|
"df.wise.CopyFeedback.copy": "Disalin ke clipboard",
|
|
6886
7605
|
"df.wise.CopyFeedback.copyFailed": "Gagal menyalin ke clipboard",
|
|
7606
|
+
"df.wise.DateInput.unavailableDates": "Some dates are unavailable.",
|
|
6887
7607
|
"df.wise.DynamicParagraph.copied": "Disalin ke clipboard",
|
|
6888
7608
|
"df.wise.DynamicParagraph.copy": "Salin",
|
|
6889
7609
|
"df.wise.ErrorBoundary.errorAlert": "Terjadi kesalahan.",
|
|
@@ -6933,6 +7653,7 @@ var it_default = {
|
|
|
6933
7653
|
"df.wise.ControlFeedback.type": "Tipo errato",
|
|
6934
7654
|
"df.wise.CopyFeedback.copy": "Copiato negli appunti",
|
|
6935
7655
|
"df.wise.CopyFeedback.copyFailed": "Impossibile copiare negli appunti",
|
|
7656
|
+
"df.wise.DateInput.unavailableDates": "Alcune date non sono disponibili.",
|
|
6936
7657
|
"df.wise.DynamicParagraph.copied": "Copiato negli appunti",
|
|
6937
7658
|
"df.wise.DynamicParagraph.copy": "Copia",
|
|
6938
7659
|
"df.wise.ErrorBoundary.errorAlert": "Qualcosa non ha funzionato.",
|
|
@@ -6982,6 +7703,7 @@ var ja_default = {
|
|
|
6982
7703
|
"df.wise.ControlFeedback.type": "\u4E0D\u6B63\u306A\u30BF\u30A4\u30D7",
|
|
6983
7704
|
"df.wise.CopyFeedback.copy": "\u30AF\u30EA\u30C3\u30D7\u30DC\u30FC\u30C9\u3078\u30B3\u30D4\u30FC\u3057\u307E\u3057\u305F",
|
|
6984
7705
|
"df.wise.CopyFeedback.copyFailed": "\u30AF\u30EA\u30C3\u30D7\u30DC\u30FC\u30C9\u306B\u30B3\u30D4\u30FC\u3067\u304D\u307E\u305B\u3093\u3067\u3057\u305F",
|
|
7706
|
+
"df.wise.DateInput.unavailableDates": "\u4E00\u90E8\u306E\u65E5\u4ED8\u306F\u4F7F\u7528\u3067\u304D\u307E\u305B\u3093",
|
|
6985
7707
|
"df.wise.DynamicParagraph.copied": "\u30AF\u30EA\u30C3\u30D7\u30DC\u30FC\u30C9\u3078\u30B3\u30D4\u30FC\u3057\u307E\u3057\u305F",
|
|
6986
7708
|
"df.wise.DynamicParagraph.copy": "\u30B3\u30D4\u30FC\u3059\u308B",
|
|
6987
7709
|
"df.wise.ErrorBoundary.errorAlert": "\u30A8\u30E9\u30FC\u304C\u767A\u751F\u3057\u307E\u3057\u305F\u3002",
|
|
@@ -7031,6 +7753,7 @@ var nl_default = {
|
|
|
7031
7753
|
"df.wise.ControlFeedback.type": "Onjuist type",
|
|
7032
7754
|
"df.wise.CopyFeedback.copy": "Naar klembord gekopieerd",
|
|
7033
7755
|
"df.wise.CopyFeedback.copyFailed": "Naar klembord kopi\xEBren mislukt",
|
|
7756
|
+
"df.wise.DateInput.unavailableDates": "Sommige datums zijn niet beschikbaar.",
|
|
7034
7757
|
"df.wise.DynamicParagraph.copied": "Naar klembord gekopieerd",
|
|
7035
7758
|
"df.wise.DynamicParagraph.copy": "Kopi\xEBren",
|
|
7036
7759
|
"df.wise.ErrorBoundary.errorAlert": "Er is iets misgegaan.",
|
|
@@ -7080,6 +7803,7 @@ var pl_default = {
|
|
|
7080
7803
|
"df.wise.ControlFeedback.type": "Nieprawid\u0142owy typ",
|
|
7081
7804
|
"df.wise.CopyFeedback.copy": "Skopiowano do schowka",
|
|
7082
7805
|
"df.wise.CopyFeedback.copyFailed": "Nie uda\u0142o si\u0119 skopiowa\u0107 do schowka",
|
|
7806
|
+
"df.wise.DateInput.unavailableDates": "Niekt\xF3re daty s\u0105 niedost\u0119pne.",
|
|
7083
7807
|
"df.wise.DynamicParagraph.copied": "Skopiowano do schowka",
|
|
7084
7808
|
"df.wise.DynamicParagraph.copy": "Kopiuj",
|
|
7085
7809
|
"df.wise.ErrorBoundary.errorAlert": "Co\u015B posz\u0142o nie tak.",
|
|
@@ -7129,6 +7853,7 @@ var pt_default = {
|
|
|
7129
7853
|
"df.wise.ControlFeedback.type": "Tipo incorreto",
|
|
7130
7854
|
"df.wise.CopyFeedback.copy": "Copiado",
|
|
7131
7855
|
"df.wise.CopyFeedback.copyFailed": "Falha ao copiar para \xE1rea de transfer\xEAncia",
|
|
7856
|
+
"df.wise.DateInput.unavailableDates": "Some dates are unavailable.",
|
|
7132
7857
|
"df.wise.DynamicParagraph.copied": "Copiado",
|
|
7133
7858
|
"df.wise.DynamicParagraph.copy": "Copiar",
|
|
7134
7859
|
"df.wise.ErrorBoundary.errorAlert": "Algo deu errado.",
|
|
@@ -7178,6 +7903,7 @@ var ro_default = {
|
|
|
7178
7903
|
"df.wise.ControlFeedback.type": "Tip incorect",
|
|
7179
7904
|
"df.wise.CopyFeedback.copy": "Copiat \xEEn clipboard",
|
|
7180
7905
|
"df.wise.CopyFeedback.copyFailed": "Copierea \xEEn clipboard a e\u0219uat",
|
|
7906
|
+
"df.wise.DateInput.unavailableDates": "Unele date nu sunt disponibile.",
|
|
7181
7907
|
"df.wise.DynamicParagraph.copied": "Copiat \xEEn clipboard",
|
|
7182
7908
|
"df.wise.DynamicParagraph.copy": "Copiaz\u0103",
|
|
7183
7909
|
"df.wise.ErrorBoundary.errorAlert": "Ceva nu a mers bine.",
|
|
@@ -7227,6 +7953,7 @@ var ru_default = {
|
|
|
7227
7953
|
"df.wise.ControlFeedback.type": "\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0442\u0438\u043F",
|
|
7228
7954
|
"df.wise.CopyFeedback.copy": "\u0421\u043A\u043E\u043F\u0438\u0440\u043E\u0432\u0430\u043D\u043E \u0432 \u0431\u0443\u0444\u0435\u0440 \u043E\u0431\u043C\u0435\u043D\u0430",
|
|
7229
7955
|
"df.wise.CopyFeedback.copyFailed": "\u041D\u0435 \u0443\u0434\u0430\u043B\u043E\u0441\u044C \u0441\u043A\u043E\u043F\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u0432 \u0431\u0443\u0444\u0435\u0440 \u043E\u0431\u043C\u0435\u043D\u0430",
|
|
7956
|
+
"df.wise.DateInput.unavailableDates": "Some dates are unavailable.",
|
|
7230
7957
|
"df.wise.DynamicParagraph.copied": "\u0421\u043A\u043E\u043F\u0438\u0440\u043E\u0432\u0430\u043D\u043E \u0432 \u0431\u0443\u0444\u0435\u0440 \u043E\u0431\u043C\u0435\u043D\u0430",
|
|
7231
7958
|
"df.wise.DynamicParagraph.copy": "\u041A\u043E\u043F\u0438\u0440\u043E\u0432\u0430\u0442\u044C",
|
|
7232
7959
|
"df.wise.ErrorBoundary.errorAlert": "\u0427\u0442\u043E-\u0442\u043E \u043F\u043E\u0448\u043B\u043E \u043D\u0435 \u0442\u0430\u043A.",
|
|
@@ -7276,6 +8003,7 @@ var th_default = {
|
|
|
7276
8003
|
"df.wise.ControlFeedback.type": "\u0E1B\u0E23\u0E30\u0E40\u0E20\u0E17\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07",
|
|
7277
8004
|
"df.wise.CopyFeedback.copy": "\u0E04\u0E31\u0E14\u0E25\u0E2D\u0E01\u0E44\u0E1B\u0E22\u0E31\u0E07\u0E04\u0E25\u0E34\u0E1B\u0E1A\u0E2D\u0E23\u0E4C\u0E14",
|
|
7278
8005
|
"df.wise.CopyFeedback.copyFailed": "\u0E04\u0E31\u0E14\u0E25\u0E2D\u0E01\u0E44\u0E1B\u0E22\u0E31\u0E07\u0E04\u0E25\u0E34\u0E1B\u0E1A\u0E2D\u0E23\u0E4C\u0E14\u0E44\u0E21\u0E48\u0E2A\u0E33\u0E40\u0E23\u0E47\u0E08",
|
|
8006
|
+
"df.wise.DateInput.unavailableDates": "\u0E44\u0E21\u0E48\u0E1E\u0E23\u0E49\u0E2D\u0E21\u0E43\u0E0A\u0E49\u0E07\u0E32\u0E19\u0E1A\u0E32\u0E07\u0E27\u0E31\u0E19",
|
|
7279
8007
|
"df.wise.DynamicParagraph.copied": "\u0E04\u0E31\u0E14\u0E25\u0E2D\u0E01\u0E44\u0E1B\u0E22\u0E31\u0E07\u0E04\u0E25\u0E34\u0E1B\u0E1A\u0E2D\u0E23\u0E4C\u0E14",
|
|
7280
8008
|
"df.wise.DynamicParagraph.copy": "\u0E04\u0E31\u0E14\u0E25\u0E2D\u0E01",
|
|
7281
8009
|
"df.wise.ErrorBoundary.errorAlert": "\u0E40\u0E01\u0E34\u0E14\u0E02\u0E49\u0E2D\u0E1C\u0E34\u0E14\u0E1E\u0E25\u0E32\u0E14\u0E1A\u0E32\u0E07\u0E2D\u0E22\u0E48\u0E32\u0E07\u0E02\u0E36\u0E49\u0E19",
|
|
@@ -7325,6 +8053,7 @@ var tr_default = {
|
|
|
7325
8053
|
"df.wise.ControlFeedback.type": "Ge\xE7ersiz se\xE7im",
|
|
7326
8054
|
"df.wise.CopyFeedback.copy": "Panoya kopyaland\u0131",
|
|
7327
8055
|
"df.wise.CopyFeedback.copyFailed": "Panoya kopyalama ba\u015Far\u0131s\u0131z oldu",
|
|
8056
|
+
"df.wise.DateInput.unavailableDates": "Some dates are unavailable.",
|
|
7328
8057
|
"df.wise.DynamicParagraph.copied": "Panoya kopyaland\u0131",
|
|
7329
8058
|
"df.wise.DynamicParagraph.copy": "Kopyala",
|
|
7330
8059
|
"df.wise.ErrorBoundary.errorAlert": "Bir sorun olu\u015Ftu.",
|
|
@@ -7374,6 +8103,7 @@ var zh_CN_default = {
|
|
|
7374
8103
|
"df.wise.ControlFeedback.type": "\u7C7B\u578B\u9519\u8BEF",
|
|
7375
8104
|
"df.wise.CopyFeedback.copy": "\u5DF2\u590D\u5236\u5230\u526A\u8D34\u677F",
|
|
7376
8105
|
"df.wise.CopyFeedback.copyFailed": "\u65E0\u6CD5\u590D\u5236\u5230\u526A\u8D34\u677F",
|
|
8106
|
+
"df.wise.DateInput.unavailableDates": "\u90E8\u5206\u65E5\u671F\u4E0D\u53EF\u7528\u3002",
|
|
7377
8107
|
"df.wise.DynamicParagraph.copied": "\u5DF2\u590D\u5236\u5230\u526A\u8D34\u677F",
|
|
7378
8108
|
"df.wise.DynamicParagraph.copy": "\u590D\u5236",
|
|
7379
8109
|
"df.wise.ErrorBoundary.errorAlert": "\u51FA\u9519\u4E86\u3002",
|
|
@@ -7423,6 +8153,7 @@ var zh_HK_default = {
|
|
|
7423
8153
|
"df.wise.ControlFeedback.type": "\u932F\u8AA4\u7684\u985E\u578B",
|
|
7424
8154
|
"df.wise.CopyFeedback.copy": "\u8907\u88FD\u5230\u526A\u8CBC\u677F",
|
|
7425
8155
|
"df.wise.CopyFeedback.copyFailed": "\u7121\u6CD5\u8907\u88FD\u5230\u526A\u8CBC\u677F",
|
|
8156
|
+
"df.wise.DateInput.unavailableDates": "Some dates are unavailable.",
|
|
7426
8157
|
"df.wise.DynamicParagraph.copied": "\u8907\u88FD\u5230\u526A\u8CBC\u677F",
|
|
7427
8158
|
"df.wise.DynamicParagraph.copy": "\u8907\u88FD",
|
|
7428
8159
|
"df.wise.ErrorBoundary.errorAlert": "\u51FA\u4E86\u4E9B\u554F\u984C\u3002",
|