@wise/dynamic-flow-client-internal 3.28.2 → 3.28.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/main.js +316 -304
- package/build/main.min.js +1 -1
- package/build/main.mjs +263 -251
- package/build/types/dynamicFlow/DynamicFlow.d.ts +1 -1
- package/package.json +2 -2
package/build/main.js
CHANGED
|
@@ -144,13 +144,13 @@ var init_clsx = __esm({
|
|
|
144
144
|
});
|
|
145
145
|
|
|
146
146
|
// ../../node_modules/.pnpm/@wise+art@2.19.0_@transferwise+neptune-css@14.20.1_@types+react@18.3.18_react-dom@18.3.1_reac_mzw7cg6j4wc7ddwlhxck7linn4/node_modules/@wise/art/dist/index-8Fxev6OI.esm.js
|
|
147
|
-
var
|
|
147
|
+
var import_react3, import_jsx_runtime12, unknownFlagName, Flag, Sizes, ImageSizes, imageSizes, Assets, RenderMode;
|
|
148
148
|
var init_index_8Fxev6OI_esm = __esm({
|
|
149
149
|
"../../node_modules/.pnpm/@wise+art@2.19.0_@transferwise+neptune-css@14.20.1_@types+react@18.3.18_react-dom@18.3.1_reac_mzw7cg6j4wc7ddwlhxck7linn4/node_modules/@wise/art/dist/index-8Fxev6OI.esm.js"() {
|
|
150
150
|
"use strict";
|
|
151
151
|
init_clsx();
|
|
152
|
-
|
|
153
|
-
|
|
152
|
+
import_react3 = require("react");
|
|
153
|
+
import_jsx_runtime12 = require("react/jsx-runtime");
|
|
154
154
|
unknownFlagName = "wise";
|
|
155
155
|
Flag = ({
|
|
156
156
|
code,
|
|
@@ -158,13 +158,13 @@ var init_index_8Fxev6OI_esm = __esm({
|
|
|
158
158
|
className = void 0,
|
|
159
159
|
loading = "lazy"
|
|
160
160
|
}) => {
|
|
161
|
-
const [fallback, setFallback] = (0,
|
|
162
|
-
(0,
|
|
161
|
+
const [fallback, setFallback] = (0, import_react3.useState)(null);
|
|
162
|
+
(0, import_react3.useEffect)(() => {
|
|
163
163
|
setFallback(null);
|
|
164
164
|
}, [code]);
|
|
165
165
|
const detailed = intrinsicSize >= 150;
|
|
166
166
|
const name = fallback !== "unknown" ? `${code.toLowerCase()}${fallback == null && detailed ? "-detailed" : ""}` : unknownFlagName;
|
|
167
|
-
return /* @__PURE__ */ (0,
|
|
167
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("img", {
|
|
168
168
|
className: clsx(`wds-flag wds-flag-${name}`, className),
|
|
169
169
|
src: false ? `${name}.svg` : `https://wise.com/web-art/assets/flags/${name}.svg`,
|
|
170
170
|
loading,
|
|
@@ -880,26 +880,20 @@ var translations = languages.reduce(
|
|
|
880
880
|
var i18n_default = translations;
|
|
881
881
|
|
|
882
882
|
// src/dynamicFlow/DynamicFlow.tsx
|
|
883
|
-
var
|
|
883
|
+
var import_react16 = require("react");
|
|
884
884
|
var import_react_intl16 = require("react-intl");
|
|
885
885
|
var import_dynamic_flow_client2 = require("@wise/dynamic-flow-client");
|
|
886
886
|
|
|
887
|
-
// ../renderers/src/contexts/
|
|
887
|
+
// ../renderers/src/contexts/RendererHttpClientContext.tsx
|
|
888
888
|
var import_react = require("react");
|
|
889
|
-
var
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
return { loadingState, isLoading: loadingState !== "idle" };
|
|
895
|
-
};
|
|
896
|
-
var useTrackEvent = () => {
|
|
897
|
-
const { trackEvent } = (0, import_react.useContext)(RendererContext);
|
|
898
|
-
return trackEvent;
|
|
899
|
-
};
|
|
889
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
890
|
+
var HttpClientContext = (0, import_react.createContext)(void 0);
|
|
891
|
+
function RendererHttpClientProvider({ httpClient, children }) {
|
|
892
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(HttpClientContext.Provider, { value: httpClient, children });
|
|
893
|
+
}
|
|
900
894
|
var useRendererHttpClient = () => {
|
|
901
|
-
const
|
|
902
|
-
return
|
|
895
|
+
const contextFetch = (0, import_react.useContext)(HttpClientContext);
|
|
896
|
+
return contextFetch != null ? contextFetch : fetch;
|
|
903
897
|
};
|
|
904
898
|
|
|
905
899
|
// ../renderers/src/AlertRenderer.tsx
|
|
@@ -936,10 +930,10 @@ var getTextAlignment = (align) => {
|
|
|
936
930
|
var getTextAlignmentAndMargin = (component) => `${getTextAlignment(component.align)} ${getMargin(component.margin)}`;
|
|
937
931
|
|
|
938
932
|
// ../renderers/src/AlertRenderer.tsx
|
|
939
|
-
var
|
|
933
|
+
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
940
934
|
var AlertRenderer = {
|
|
941
935
|
canRenderType: "alert",
|
|
942
|
-
render: ({ context, markdown, margin, callToAction }) => /* @__PURE__ */ (0,
|
|
936
|
+
render: ({ context, markdown, margin, callToAction }) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
943
937
|
import_components.Alert,
|
|
944
938
|
{
|
|
945
939
|
type: context,
|
|
@@ -993,14 +987,14 @@ var help_messages_default = (0, import_react_intl.defineMessages)({
|
|
|
993
987
|
});
|
|
994
988
|
|
|
995
989
|
// ../renderers/src/components/Help.tsx
|
|
996
|
-
var
|
|
990
|
+
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
997
991
|
function Help({ help }) {
|
|
998
992
|
const intl = (0, import_react_intl2.useIntl)();
|
|
999
|
-
return /* @__PURE__ */ (0,
|
|
993
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
1000
994
|
import_components2.Info,
|
|
1001
995
|
{
|
|
1002
996
|
className: "m-l-1",
|
|
1003
|
-
content: /* @__PURE__ */ (0,
|
|
997
|
+
content: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_components2.Markdown, { config: { link: { target: "_blank" } }, children: help }),
|
|
1004
998
|
presentation: "POPOVER",
|
|
1005
999
|
size: "sm",
|
|
1006
1000
|
"aria-label": intl.formatMessage(help_messages_default.helpAria)
|
|
@@ -1010,19 +1004,19 @@ function Help({ help }) {
|
|
|
1010
1004
|
var Help_default = Help;
|
|
1011
1005
|
|
|
1012
1006
|
// ../renderers/src/components/LabelContentWithHelp.tsx
|
|
1013
|
-
var
|
|
1007
|
+
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
1014
1008
|
function LabelContentWithHelp({ text, help }) {
|
|
1015
|
-
return /* @__PURE__ */ (0,
|
|
1009
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { children: [
|
|
1016
1010
|
text,
|
|
1017
|
-
/* @__PURE__ */ (0,
|
|
1011
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Help_default, { help })
|
|
1018
1012
|
] });
|
|
1019
1013
|
}
|
|
1020
1014
|
|
|
1021
1015
|
// ../renderers/src/components/FieldInput.tsx
|
|
1022
|
-
var
|
|
1016
|
+
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
1023
1017
|
function FieldInput({ id, children, label, validation, description, help }) {
|
|
1024
|
-
const labelContent = label && help ? /* @__PURE__ */ (0,
|
|
1025
|
-
return /* @__PURE__ */ (0,
|
|
1018
|
+
const labelContent = label && help ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(LabelContentWithHelp, { text: label, help }) : label;
|
|
1019
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
1026
1020
|
import_components3.Field,
|
|
1027
1021
|
{
|
|
1028
1022
|
id,
|
|
@@ -1047,7 +1041,7 @@ var FieldInput_default = FieldInput;
|
|
|
1047
1041
|
|
|
1048
1042
|
// ../renderers/src/BooleanInputRenderer.tsx
|
|
1049
1043
|
var import_components4 = require("@transferwise/components");
|
|
1050
|
-
var
|
|
1044
|
+
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
1051
1045
|
var BooleanInputRenderer = {
|
|
1052
1046
|
canRenderType: "input-boolean",
|
|
1053
1047
|
render: (props) => {
|
|
@@ -1071,20 +1065,20 @@ var BooleanInputRenderer = {
|
|
|
1071
1065
|
"value"
|
|
1072
1066
|
]);
|
|
1073
1067
|
const checkboxProps = __spreadProps(__spreadValues({}, rest), { label, secondary: description, checked: value });
|
|
1074
|
-
return /* @__PURE__ */ (0,
|
|
1068
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(FieldInput_default, { id, label: "", description: "", validation: validationState, help, children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_components4.Checkbox, __spreadValues({ id }, checkboxProps)) });
|
|
1075
1069
|
}
|
|
1076
1070
|
};
|
|
1077
1071
|
var BooleanInputRenderer_default = BooleanInputRenderer;
|
|
1078
1072
|
|
|
1079
1073
|
// ../renderers/src/BoxRenderer.tsx
|
|
1080
1074
|
var import_classnames = __toESM(require_classnames());
|
|
1081
|
-
var
|
|
1075
|
+
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
1082
1076
|
var BoxRenderer = {
|
|
1083
1077
|
canRenderType: "box",
|
|
1084
1078
|
render: ({ border, children, control, margin, width }) => {
|
|
1085
1079
|
const hasFixedWidth = width !== "xl";
|
|
1086
1080
|
const hasBorder = control === "bordered" || control === "bordered-web" || border;
|
|
1087
|
-
const contents = /* @__PURE__ */ (0,
|
|
1081
|
+
const contents = /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
1088
1082
|
"div",
|
|
1089
1083
|
{
|
|
1090
1084
|
className: (0, import_classnames.default)({
|
|
@@ -1095,14 +1089,30 @@ var BoxRenderer = {
|
|
|
1095
1089
|
children
|
|
1096
1090
|
}
|
|
1097
1091
|
);
|
|
1098
|
-
return hasFixedWidth ? /* @__PURE__ */ (0,
|
|
1092
|
+
return hasFixedWidth ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: (0, import_classnames.default)("df-box-renderer-fixed-width", getMargin(margin)), children: contents }) : contents;
|
|
1099
1093
|
}
|
|
1100
1094
|
};
|
|
1101
1095
|
var BoxRenderer_default = BoxRenderer;
|
|
1102
1096
|
|
|
1103
1097
|
// ../renderers/src/ButtonRenderer.tsx
|
|
1104
1098
|
var import_components5 = require("@transferwise/components");
|
|
1105
|
-
|
|
1099
|
+
|
|
1100
|
+
// ../renderers/src/step/StepRendererContext.tsx
|
|
1101
|
+
var import_react2 = require("react");
|
|
1102
|
+
var StepRendererContext = (0, import_react2.createContext)({ loadingState: "idle", trackEvent: () => {
|
|
1103
|
+
} });
|
|
1104
|
+
var StepRendererContextProvider = StepRendererContext.Provider;
|
|
1105
|
+
var useLoadingContext = () => {
|
|
1106
|
+
const { loadingState } = (0, import_react2.useContext)(StepRendererContext);
|
|
1107
|
+
return { loadingState, isLoading: loadingState !== "idle" };
|
|
1108
|
+
};
|
|
1109
|
+
var useTrackEvent = () => {
|
|
1110
|
+
const { trackEvent } = (0, import_react2.useContext)(StepRendererContext);
|
|
1111
|
+
return trackEvent;
|
|
1112
|
+
};
|
|
1113
|
+
|
|
1114
|
+
// ../renderers/src/ButtonRenderer.tsx
|
|
1115
|
+
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
1106
1116
|
var ButtonRenderer = {
|
|
1107
1117
|
canRenderType: "button",
|
|
1108
1118
|
render: ButtonRendererComponent
|
|
@@ -1120,7 +1130,7 @@ function ButtonRendererComponent({
|
|
|
1120
1130
|
const priority = mapControl(control);
|
|
1121
1131
|
const type = priority === "tertiary" ? void 0 : mapContext(context);
|
|
1122
1132
|
const { isLoading } = useLoadingContext();
|
|
1123
|
-
return /* @__PURE__ */ (0,
|
|
1133
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1124
1134
|
import_components5.Button,
|
|
1125
1135
|
{
|
|
1126
1136
|
block: true,
|
|
@@ -1172,10 +1182,10 @@ var ButtonRenderer_default = ButtonRenderer;
|
|
|
1172
1182
|
|
|
1173
1183
|
// ../renderers/src/ColumnsRenderer.tsx
|
|
1174
1184
|
var import_classnames2 = __toESM(require_classnames());
|
|
1175
|
-
var
|
|
1185
|
+
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
1176
1186
|
var ColumnsRenderer = {
|
|
1177
1187
|
canRenderType: "columns",
|
|
1178
|
-
render: ({ bias, margin, startChildren, endChildren }) => /* @__PURE__ */ (0,
|
|
1188
|
+
render: ({ bias, margin, startChildren, endChildren }) => /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
|
|
1179
1189
|
"div",
|
|
1180
1190
|
{
|
|
1181
1191
|
className: (0, import_classnames2.default)("df-columns-renderer-container", getMargin(margin), {
|
|
@@ -1183,8 +1193,8 @@ var ColumnsRenderer = {
|
|
|
1183
1193
|
"df-columns-renderer-bias-end": bias === "end"
|
|
1184
1194
|
}),
|
|
1185
1195
|
children: [
|
|
1186
|
-
/* @__PURE__ */ (0,
|
|
1187
|
-
/* @__PURE__ */ (0,
|
|
1196
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "df-columns-renderer-column", children: startChildren }),
|
|
1197
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "df-columns-renderer-column", children: endChildren })
|
|
1188
1198
|
]
|
|
1189
1199
|
}
|
|
1190
1200
|
)
|
|
@@ -1223,7 +1233,7 @@ var dateToDateString = (date) => {
|
|
|
1223
1233
|
};
|
|
1224
1234
|
|
|
1225
1235
|
// ../renderers/src/components/VariableDateInput.tsx
|
|
1226
|
-
var
|
|
1236
|
+
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
1227
1237
|
function VariableDateInput({
|
|
1228
1238
|
control,
|
|
1229
1239
|
inputProps
|
|
@@ -1239,7 +1249,7 @@ function VariableDateInput({
|
|
|
1239
1249
|
onFocus
|
|
1240
1250
|
} = inputProps;
|
|
1241
1251
|
if (control === "date-lookup") {
|
|
1242
|
-
return /* @__PURE__ */ (0,
|
|
1252
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
1243
1253
|
import_components6.DateLookup,
|
|
1244
1254
|
{
|
|
1245
1255
|
value: dateStringToDateOrNull(inputProps.value),
|
|
@@ -1255,7 +1265,7 @@ function VariableDateInput({
|
|
|
1255
1265
|
}
|
|
1256
1266
|
);
|
|
1257
1267
|
}
|
|
1258
|
-
return /* @__PURE__ */ (0,
|
|
1268
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
1259
1269
|
import_components6.DateInput,
|
|
1260
1270
|
__spreadProps(__spreadValues({}, inputProps), {
|
|
1261
1271
|
dayAutoComplete: getAutocompleteString(autoComplete, "day"),
|
|
@@ -1272,7 +1282,7 @@ var getAutocompleteString = (value, suffix) => {
|
|
|
1272
1282
|
var VariableDateInput_default = VariableDateInput;
|
|
1273
1283
|
|
|
1274
1284
|
// ../renderers/src/DateInputRenderer.tsx
|
|
1275
|
-
var
|
|
1285
|
+
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
1276
1286
|
var DateInputRenderer = {
|
|
1277
1287
|
canRenderType: "input-date",
|
|
1278
1288
|
render: (props) => {
|
|
@@ -1297,7 +1307,7 @@ var DateInputRenderer = {
|
|
|
1297
1307
|
]);
|
|
1298
1308
|
const value = initialValue != null ? initialValue : "";
|
|
1299
1309
|
const inputProps = __spreadProps(__spreadValues({}, rest), { value, id });
|
|
1300
|
-
return /* @__PURE__ */ (0,
|
|
1310
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1301
1311
|
FieldInput_default,
|
|
1302
1312
|
{
|
|
1303
1313
|
id,
|
|
@@ -1305,7 +1315,7 @@ var DateInputRenderer = {
|
|
|
1305
1315
|
description,
|
|
1306
1316
|
validation: validationState,
|
|
1307
1317
|
help,
|
|
1308
|
-
children: /* @__PURE__ */ (0,
|
|
1318
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(VariableDateInput_default, { control, inputProps })
|
|
1309
1319
|
}
|
|
1310
1320
|
);
|
|
1311
1321
|
}
|
|
@@ -1318,23 +1328,23 @@ var import_components8 = require("@transferwise/components");
|
|
|
1318
1328
|
// ../../node_modules/.pnpm/@wise+art@2.19.0_@transferwise+neptune-css@14.20.1_@types+react@18.3.18_react-dom@18.3.1_reac_mzw7cg6j4wc7ddwlhxck7linn4/node_modules/@wise/art/dist/index.esm.js
|
|
1319
1329
|
init_index_8Fxev6OI_esm();
|
|
1320
1330
|
init_clsx();
|
|
1321
|
-
var
|
|
1322
|
-
var
|
|
1331
|
+
var import_react4 = require("react");
|
|
1332
|
+
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
1323
1333
|
|
|
1324
1334
|
// ../renderers/src/components/icon/FlagIcon.tsx
|
|
1325
|
-
var
|
|
1335
|
+
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
1326
1336
|
var isFlagIcon = (name) => name.startsWith("flag-");
|
|
1327
1337
|
function FlagIcon({ name }) {
|
|
1328
1338
|
if (!isFlagIcon(name)) {
|
|
1329
1339
|
return null;
|
|
1330
1340
|
}
|
|
1331
1341
|
const code = name.substring(5);
|
|
1332
|
-
return /* @__PURE__ */ (0,
|
|
1342
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Flag, { code });
|
|
1333
1343
|
}
|
|
1334
1344
|
|
|
1335
1345
|
// ../renderers/src/components/icon/NamedIcon.tsx
|
|
1336
1346
|
var icons = __toESM(require("@transferwise/icons"));
|
|
1337
|
-
var
|
|
1347
|
+
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
1338
1348
|
var isNamedIcon = (name) => {
|
|
1339
1349
|
const iconName = toCapitalisedCamelCase(name);
|
|
1340
1350
|
return Object.keys(icons).includes(iconName);
|
|
@@ -1345,19 +1355,19 @@ function NamedIcon({ name }) {
|
|
|
1345
1355
|
}
|
|
1346
1356
|
const iconName = toCapitalisedCamelCase(name);
|
|
1347
1357
|
const Icon = icons[iconName];
|
|
1348
|
-
return /* @__PURE__ */ (0,
|
|
1358
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Icon, { size: 24 });
|
|
1349
1359
|
}
|
|
1350
1360
|
var toCapitalisedCamelCase = (value) => value.split("-").map(capitaliseFirstChar).join("");
|
|
1351
1361
|
var capitaliseFirstChar = (value) => `${value[0].toUpperCase()}${value.slice(1)}`;
|
|
1352
1362
|
|
|
1353
1363
|
// ../renderers/src/components/icon/DynamicIcon.tsx
|
|
1354
|
-
var
|
|
1364
|
+
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
1355
1365
|
function DynamicIcon({ name }) {
|
|
1356
1366
|
if (isFlagIcon(name)) {
|
|
1357
|
-
return /* @__PURE__ */ (0,
|
|
1367
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(FlagIcon, { name });
|
|
1358
1368
|
}
|
|
1359
1369
|
if (isNamedIcon(name)) {
|
|
1360
|
-
return /* @__PURE__ */ (0,
|
|
1370
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(NamedIcon, { name });
|
|
1361
1371
|
}
|
|
1362
1372
|
return null;
|
|
1363
1373
|
}
|
|
@@ -1365,25 +1375,25 @@ var DynamicIcon_default = DynamicIcon;
|
|
|
1365
1375
|
|
|
1366
1376
|
// ../renderers/src/components/icon/NavigationOptionMedia.tsx
|
|
1367
1377
|
var import_components7 = require("@transferwise/components");
|
|
1368
|
-
var
|
|
1378
|
+
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
1369
1379
|
function NavigationOptionMedia({ icon, image }) {
|
|
1370
1380
|
if (!isNullish(icon)) {
|
|
1371
1381
|
if ("name" in icon) {
|
|
1372
|
-
return /* @__PURE__ */ (0,
|
|
1382
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_components7.Avatar, { type: import_components7.AvatarType.ICON, children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(DynamicIcon_default, { name: icon.name }) });
|
|
1373
1383
|
}
|
|
1374
1384
|
if (icon.text) {
|
|
1375
|
-
return /* @__PURE__ */ (0,
|
|
1385
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_components7.Avatar, { type: import_components7.AvatarType.INITIALS, children: icon.text });
|
|
1376
1386
|
}
|
|
1377
1387
|
}
|
|
1378
1388
|
if (image == null ? void 0 : image.url) {
|
|
1379
1389
|
const { url, accessibilityDescription } = image;
|
|
1380
|
-
return /* @__PURE__ */ (0,
|
|
1390
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("img", { src: url, alt: accessibilityDescription });
|
|
1381
1391
|
}
|
|
1382
1392
|
return null;
|
|
1383
1393
|
}
|
|
1384
1394
|
|
|
1385
1395
|
// ../renderers/src/DecisionRenderer.tsx
|
|
1386
|
-
var
|
|
1396
|
+
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
1387
1397
|
var DecisionRenderer = {
|
|
1388
1398
|
canRenderType: "decision",
|
|
1389
1399
|
render: DecisionRendererComponent
|
|
@@ -1391,15 +1401,15 @@ var DecisionRenderer = {
|
|
|
1391
1401
|
var DecisionRenderer_default = DecisionRenderer;
|
|
1392
1402
|
function DecisionRendererComponent({ margin, options, title }) {
|
|
1393
1403
|
const { isLoading } = useLoadingContext();
|
|
1394
|
-
return /* @__PURE__ */ (0,
|
|
1395
|
-
title && /* @__PURE__ */ (0,
|
|
1396
|
-
/* @__PURE__ */ (0,
|
|
1404
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: getMargin(margin), children: [
|
|
1405
|
+
title && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_components8.Header, { as: "h2", title }),
|
|
1406
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_components8.NavigationOptionsList, { children: options.map(({ description, disabled, icon, image, title: title2, onClick }) => /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
1397
1407
|
import_components8.NavigationOption,
|
|
1398
1408
|
{
|
|
1399
1409
|
title: title2,
|
|
1400
1410
|
content: description,
|
|
1401
1411
|
disabled: isLoading || disabled,
|
|
1402
|
-
media: /* @__PURE__ */ (0,
|
|
1412
|
+
media: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(NavigationOptionMedia, { icon, image }),
|
|
1403
1413
|
showMediaCircle: false,
|
|
1404
1414
|
showMediaAtAllSizes: true,
|
|
1405
1415
|
onClick
|
|
@@ -1410,36 +1420,36 @@ function DecisionRendererComponent({ margin, options, title }) {
|
|
|
1410
1420
|
}
|
|
1411
1421
|
|
|
1412
1422
|
// ../renderers/src/DividerRenderer.tsx
|
|
1413
|
-
var
|
|
1423
|
+
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
1414
1424
|
var DividerRenderer = {
|
|
1415
1425
|
canRenderType: "divider",
|
|
1416
|
-
render: ({ margin }) => /* @__PURE__ */ (0,
|
|
1426
|
+
render: ({ margin }) => /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("hr", { className: `m-t-0 ${getMargin(margin)}` })
|
|
1417
1427
|
};
|
|
1418
1428
|
var DividerRenderer_default = DividerRenderer;
|
|
1419
1429
|
|
|
1420
1430
|
// ../renderers/src/FormRenderer.tsx
|
|
1421
|
-
var
|
|
1431
|
+
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
1422
1432
|
var FormRenderer = {
|
|
1423
1433
|
canRenderType: "form",
|
|
1424
|
-
render: ({ children, margin }) => /* @__PURE__ */ (0,
|
|
1434
|
+
render: ({ children, margin }) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: getMargin(margin), children })
|
|
1425
1435
|
};
|
|
1426
1436
|
var FormRenderer_default = FormRenderer;
|
|
1427
1437
|
|
|
1428
1438
|
// ../renderers/src/FormSectionRenderer.tsx
|
|
1429
1439
|
var import_components9 = require("@transferwise/components");
|
|
1430
|
-
var
|
|
1440
|
+
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
1431
1441
|
var FormSectionRenderer = {
|
|
1432
1442
|
canRenderType: "form-section",
|
|
1433
|
-
render: ({ title, description, children }) => /* @__PURE__ */ (0,
|
|
1443
|
+
render: ({ title, description, children }) => /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("fieldset", { children: [
|
|
1434
1444
|
title && // TODO - once section headers support help, we could show help in here
|
|
1435
|
-
/* @__PURE__ */ (0,
|
|
1445
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
1436
1446
|
import_components9.Header,
|
|
1437
1447
|
{
|
|
1438
1448
|
as: "h2",
|
|
1439
1449
|
title
|
|
1440
1450
|
}
|
|
1441
1451
|
),
|
|
1442
|
-
description && /* @__PURE__ */ (0,
|
|
1452
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("p", { children: description }),
|
|
1443
1453
|
children
|
|
1444
1454
|
] })
|
|
1445
1455
|
};
|
|
@@ -1447,32 +1457,32 @@ var FormSectionRenderer_default = FormSectionRenderer;
|
|
|
1447
1457
|
|
|
1448
1458
|
// ../renderers/src/HeadingRenderer.tsx
|
|
1449
1459
|
var import_components10 = require("@transferwise/components");
|
|
1450
|
-
var
|
|
1460
|
+
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
1451
1461
|
var HeadingRenderer = {
|
|
1452
1462
|
canRenderType: "heading",
|
|
1453
|
-
render: (props) => /* @__PURE__ */ (0,
|
|
1463
|
+
render: (props) => /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(Heading, __spreadValues({}, props))
|
|
1454
1464
|
};
|
|
1455
1465
|
function Heading(props) {
|
|
1456
1466
|
const { text, size: size2, align, margin, control } = props;
|
|
1457
1467
|
const className = getTextAlignmentAndMargin({ align, margin });
|
|
1458
|
-
return control === "display" ? /* @__PURE__ */ (0,
|
|
1468
|
+
return control === "display" ? /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(DisplayHeading, { size: size2, text, className }) : /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(StandardHeading, { size: size2, text, className });
|
|
1459
1469
|
}
|
|
1460
1470
|
function DisplayHeading({ size: size2, text, className }) {
|
|
1461
|
-
return /* @__PURE__ */ (0,
|
|
1471
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_components10.Display, { type: getDisplayType(size2), className, children: text });
|
|
1462
1472
|
}
|
|
1463
1473
|
function StandardHeading({ size: size2, text, className }) {
|
|
1464
1474
|
switch (size2) {
|
|
1465
1475
|
case "xs":
|
|
1466
|
-
return /* @__PURE__ */ (0,
|
|
1476
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("h5", { className, children: text });
|
|
1467
1477
|
case "sm":
|
|
1468
|
-
return /* @__PURE__ */ (0,
|
|
1478
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("h4", { className, children: text });
|
|
1469
1479
|
case "lg":
|
|
1470
|
-
return /* @__PURE__ */ (0,
|
|
1480
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("h2", { className, children: text });
|
|
1471
1481
|
case "xl":
|
|
1472
|
-
return /* @__PURE__ */ (0,
|
|
1482
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("h1", { className, children: text });
|
|
1473
1483
|
case "md":
|
|
1474
1484
|
default:
|
|
1475
|
-
return /* @__PURE__ */ (0,
|
|
1485
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("h3", { className, children: text });
|
|
1476
1486
|
}
|
|
1477
1487
|
}
|
|
1478
1488
|
var getDisplayType = (size2) => {
|
|
@@ -1492,7 +1502,7 @@ var HeadingRenderer_default = HeadingRenderer;
|
|
|
1492
1502
|
|
|
1493
1503
|
// ../renderers/src/ImageRenderer.tsx
|
|
1494
1504
|
var import_components11 = require("@transferwise/components");
|
|
1495
|
-
var
|
|
1505
|
+
var import_react5 = require("react");
|
|
1496
1506
|
|
|
1497
1507
|
// ../renderers/src/utils/api-utils.ts
|
|
1498
1508
|
function isRelativePath(url = "") {
|
|
@@ -1502,10 +1512,10 @@ function isRelativePath(url = "") {
|
|
|
1502
1512
|
}
|
|
1503
1513
|
|
|
1504
1514
|
// ../renderers/src/ImageRenderer.tsx
|
|
1505
|
-
var
|
|
1515
|
+
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
1506
1516
|
var ImageRenderer = {
|
|
1507
1517
|
canRenderType: "image",
|
|
1508
|
-
render: (props) => /* @__PURE__ */ (0,
|
|
1518
|
+
render: (props) => /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(ImageRendererComponent, __spreadValues({}, props))
|
|
1509
1519
|
};
|
|
1510
1520
|
var ImageRenderer_default = ImageRenderer;
|
|
1511
1521
|
function ImageRendererComponent({
|
|
@@ -1514,12 +1524,12 @@ function ImageRendererComponent({
|
|
|
1514
1524
|
size: size2,
|
|
1515
1525
|
url
|
|
1516
1526
|
}) {
|
|
1517
|
-
const [imageSource, setImageSource] = (0,
|
|
1527
|
+
const [imageSource, setImageSource] = (0, import_react5.useState)("");
|
|
1518
1528
|
const httpClient = useRendererHttpClient();
|
|
1519
|
-
(0,
|
|
1529
|
+
(0, import_react5.useEffect)(() => {
|
|
1520
1530
|
void getImageSource(httpClient, url).then(setImageSource);
|
|
1521
1531
|
}, [url, httpClient]);
|
|
1522
|
-
return /* @__PURE__ */ (0,
|
|
1532
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: `df-image ${size2 || "md"}`, children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
1523
1533
|
import_components11.Image,
|
|
1524
1534
|
{
|
|
1525
1535
|
className: `img-responsive ${getMargin(margin)}`,
|
|
@@ -1564,7 +1574,7 @@ var getImageSource = async (httpClient, imageUrl) => {
|
|
|
1564
1574
|
|
|
1565
1575
|
// ../renderers/src/InstructionsRenderer.tsx
|
|
1566
1576
|
var import_components12 = require("@transferwise/components");
|
|
1567
|
-
var
|
|
1577
|
+
var import_jsx_runtime24 = require("react/jsx-runtime");
|
|
1568
1578
|
var doContext = ["positive", "neutral"];
|
|
1569
1579
|
var dontContext = ["warning", "negative"];
|
|
1570
1580
|
var InstructionsRenderer = {
|
|
@@ -1572,9 +1582,9 @@ var InstructionsRenderer = {
|
|
|
1572
1582
|
render: ({ items, margin, title }) => {
|
|
1573
1583
|
const dos = items.filter((item) => doContext.includes(item.context)).map(({ text }) => text);
|
|
1574
1584
|
const donts = items.filter((item) => dontContext.includes(item.context)).map(({ text }) => text);
|
|
1575
|
-
return /* @__PURE__ */ (0,
|
|
1576
|
-
title ? /* @__PURE__ */ (0,
|
|
1577
|
-
/* @__PURE__ */ (0,
|
|
1585
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: getMargin(margin), children: [
|
|
1586
|
+
title ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_components12.Header, { title }) : null,
|
|
1587
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_components12.InstructionsList, { dos, donts })
|
|
1578
1588
|
] });
|
|
1579
1589
|
}
|
|
1580
1590
|
};
|
|
@@ -1592,11 +1602,11 @@ var onWheel = (event) => {
|
|
|
1592
1602
|
|
|
1593
1603
|
// ../renderers/src/utils/getIconAvatar.tsx
|
|
1594
1604
|
var import_components13 = require("@transferwise/components");
|
|
1595
|
-
var
|
|
1605
|
+
var import_jsx_runtime25 = require("react/jsx-runtime");
|
|
1596
1606
|
var size = 24;
|
|
1597
1607
|
function getIconAvatar({ icon, image }) {
|
|
1598
1608
|
if (image == null ? void 0 : image.url) {
|
|
1599
|
-
return /* @__PURE__ */ (0,
|
|
1609
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
1600
1610
|
"img",
|
|
1601
1611
|
{
|
|
1602
1612
|
src: image.url,
|
|
@@ -1607,13 +1617,13 @@ function getIconAvatar({ icon, image }) {
|
|
|
1607
1617
|
);
|
|
1608
1618
|
}
|
|
1609
1619
|
if (isFlagIcon2(icon)) {
|
|
1610
|
-
return /* @__PURE__ */ (0,
|
|
1620
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_components13.Avatar, { type: import_components13.AvatarType.ICON, size, children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(DynamicIcon_default, { name: icon.name }) });
|
|
1611
1621
|
}
|
|
1612
1622
|
if (isNamedIcon2(icon)) {
|
|
1613
|
-
return /* @__PURE__ */ (0,
|
|
1623
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(DynamicIcon_default, { name: icon.name });
|
|
1614
1624
|
}
|
|
1615
1625
|
if (icon && "text" in icon) {
|
|
1616
|
-
return /* @__PURE__ */ (0,
|
|
1626
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_components13.Avatar, { type: import_components13.AvatarType.ICON, size, children: icon.text });
|
|
1617
1627
|
}
|
|
1618
1628
|
return null;
|
|
1619
1629
|
}
|
|
@@ -1627,7 +1637,7 @@ var getInputGroupAddonStart = ({ icon, image }) => {
|
|
|
1627
1637
|
};
|
|
1628
1638
|
|
|
1629
1639
|
// ../renderers/src/IntegerInputRenderer.tsx
|
|
1630
|
-
var
|
|
1640
|
+
var import_jsx_runtime26 = require("react/jsx-runtime");
|
|
1631
1641
|
var IntegerInputRenderer = {
|
|
1632
1642
|
canRenderType: "input-integer",
|
|
1633
1643
|
render: (props) => {
|
|
@@ -1654,7 +1664,7 @@ var IntegerInputRenderer = {
|
|
|
1654
1664
|
"value",
|
|
1655
1665
|
"onChange"
|
|
1656
1666
|
]);
|
|
1657
|
-
return /* @__PURE__ */ (0,
|
|
1667
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
1658
1668
|
FieldInput_default,
|
|
1659
1669
|
{
|
|
1660
1670
|
id,
|
|
@@ -1662,7 +1672,7 @@ var IntegerInputRenderer = {
|
|
|
1662
1672
|
description,
|
|
1663
1673
|
validation: validationState,
|
|
1664
1674
|
help,
|
|
1665
|
-
children: /* @__PURE__ */ (0,
|
|
1675
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_components14.InputGroup, { addonStart: getInputGroupAddonStart({ icon, image }), children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
1666
1676
|
import_components14.Input,
|
|
1667
1677
|
__spreadValues({
|
|
1668
1678
|
id,
|
|
@@ -1686,10 +1696,10 @@ var IntegerInputRenderer_default = IntegerInputRenderer;
|
|
|
1686
1696
|
|
|
1687
1697
|
// ../renderers/src/LoadingIndicatorRenderer.tsx
|
|
1688
1698
|
var import_components15 = require("@transferwise/components");
|
|
1689
|
-
var
|
|
1699
|
+
var import_jsx_runtime27 = require("react/jsx-runtime");
|
|
1690
1700
|
var LoadingIndicatorRenderer = {
|
|
1691
1701
|
canRenderType: "loading-indicator",
|
|
1692
|
-
render: ({ margin, size: size2 }) => /* @__PURE__ */ (0,
|
|
1702
|
+
render: ({ margin, size: size2 }) => /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
1693
1703
|
import_components15.Loader,
|
|
1694
1704
|
{
|
|
1695
1705
|
size: size2,
|
|
@@ -1702,28 +1712,28 @@ var LoadingIndicatorRenderer_default = LoadingIndicatorRenderer;
|
|
|
1702
1712
|
|
|
1703
1713
|
// ../renderers/src/MarkdownRenderer.tsx
|
|
1704
1714
|
var import_components16 = require("@transferwise/components");
|
|
1705
|
-
var
|
|
1715
|
+
var import_jsx_runtime28 = require("react/jsx-runtime");
|
|
1706
1716
|
var MarkdownRenderer = {
|
|
1707
1717
|
canRenderType: "markdown",
|
|
1708
|
-
render: ({ content, align, margin }) => /* @__PURE__ */ (0,
|
|
1718
|
+
render: ({ content, align, margin }) => /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: getTextAlignmentAndMargin({ align, margin }), children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_components16.Markdown, { config: { link: { target: "_blank" } }, children: content }) })
|
|
1709
1719
|
};
|
|
1710
1720
|
var MarkdownRenderer_default = MarkdownRenderer;
|
|
1711
1721
|
|
|
1712
1722
|
// ../renderers/src/ModalRenderer.tsx
|
|
1713
1723
|
var import_components17 = require("@transferwise/components");
|
|
1714
|
-
var
|
|
1715
|
-
var
|
|
1724
|
+
var import_react6 = require("react");
|
|
1725
|
+
var import_jsx_runtime29 = require("react/jsx-runtime");
|
|
1716
1726
|
var ModalRenderer = {
|
|
1717
1727
|
canRenderType: "modal",
|
|
1718
|
-
render: (props) => /* @__PURE__ */ (0,
|
|
1728
|
+
render: (props) => /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(DFModal, __spreadValues({}, props))
|
|
1719
1729
|
};
|
|
1720
1730
|
var ModalRenderer_default = ModalRenderer;
|
|
1721
1731
|
function DFModal({ content, margin, trigger }) {
|
|
1722
|
-
const [visible, setVisible] = (0,
|
|
1732
|
+
const [visible, setVisible] = (0, import_react6.useState)(false);
|
|
1723
1733
|
const { components, title } = content;
|
|
1724
|
-
return /* @__PURE__ */ (0,
|
|
1725
|
-
/* @__PURE__ */ (0,
|
|
1726
|
-
/* @__PURE__ */ (0,
|
|
1734
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: getMargin(margin), children: [
|
|
1735
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_components17.Button, { priority: "tertiary", block: true, onClick: () => setVisible(true), children: trigger.title }),
|
|
1736
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
1727
1737
|
import_components17.Modal,
|
|
1728
1738
|
{
|
|
1729
1739
|
scroll: "content",
|
|
@@ -1742,16 +1752,16 @@ var import_components19 = require("@transferwise/components");
|
|
|
1742
1752
|
|
|
1743
1753
|
// ../renderers/src/SelectInputRenderer/OptionMedia.tsx
|
|
1744
1754
|
var import_components18 = require("@transferwise/components");
|
|
1745
|
-
var
|
|
1755
|
+
var import_jsx_runtime30 = require("react/jsx-runtime");
|
|
1746
1756
|
function OptionMedia({ icon, image }) {
|
|
1747
1757
|
if (image == null ? void 0 : image.url) {
|
|
1748
|
-
return /* @__PURE__ */ (0,
|
|
1758
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("img", { src: image.url, alt: image.accessibilityDescription || "", width: "64px" });
|
|
1749
1759
|
}
|
|
1750
1760
|
if (icon && "name" in icon) {
|
|
1751
|
-
return /* @__PURE__ */ (0,
|
|
1761
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_components18.Avatar, { type: import_components18.AvatarType.ICON, children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(DynamicIcon_default, { name: icon.name }) });
|
|
1752
1762
|
}
|
|
1753
1763
|
if (icon && "text" in icon) {
|
|
1754
|
-
return /* @__PURE__ */ (0,
|
|
1764
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_components18.Avatar, { type: import_components18.AvatarType.INITIALS, children: icon.text });
|
|
1755
1765
|
}
|
|
1756
1766
|
return null;
|
|
1757
1767
|
}
|
|
@@ -1770,15 +1780,15 @@ var multi_select_messages_default = (0, import_react_intl3.defineMessages)({
|
|
|
1770
1780
|
});
|
|
1771
1781
|
|
|
1772
1782
|
// ../renderers/src/MultiSelectInputRenderer.tsx
|
|
1773
|
-
var
|
|
1774
|
-
var
|
|
1783
|
+
var import_react7 = require("react");
|
|
1784
|
+
var import_jsx_runtime31 = require("react/jsx-runtime");
|
|
1775
1785
|
var MultiSelectInputRenderer = {
|
|
1776
1786
|
canRenderType: "input-multi-select",
|
|
1777
|
-
render: (props) => /* @__PURE__ */ (0,
|
|
1787
|
+
render: (props) => /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(MultiSelectInputRendererComponent, __spreadValues({}, props))
|
|
1778
1788
|
};
|
|
1779
1789
|
function MultiSelectInputRendererComponent(props) {
|
|
1780
1790
|
const { formatMessage } = (0, import_react_intl4.useIntl)();
|
|
1781
|
-
const [stagedIndices, setStagedIndices] = (0,
|
|
1791
|
+
const [stagedIndices, setStagedIndices] = (0, import_react7.useState)();
|
|
1782
1792
|
const {
|
|
1783
1793
|
id,
|
|
1784
1794
|
autoComplete,
|
|
@@ -1816,12 +1826,12 @@ function MultiSelectInputRendererComponent(props) {
|
|
|
1816
1826
|
const contentProps = {
|
|
1817
1827
|
title: option.title,
|
|
1818
1828
|
description: option.description,
|
|
1819
|
-
icon: /* @__PURE__ */ (0,
|
|
1829
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(OptionMedia, { icon: option.icon, image: option.image })
|
|
1820
1830
|
};
|
|
1821
|
-
return /* @__PURE__ */ (0,
|
|
1831
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_components19.SelectInputOptionContent, __spreadValues({}, contentProps));
|
|
1822
1832
|
};
|
|
1823
1833
|
const extraProps = { autoComplete };
|
|
1824
|
-
return /* @__PURE__ */ (0,
|
|
1834
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
1825
1835
|
FieldInput_default,
|
|
1826
1836
|
{
|
|
1827
1837
|
id,
|
|
@@ -1829,7 +1839,7 @@ function MultiSelectInputRendererComponent(props) {
|
|
|
1829
1839
|
help,
|
|
1830
1840
|
description,
|
|
1831
1841
|
validation: validationState,
|
|
1832
|
-
children: /* @__PURE__ */ (0,
|
|
1842
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
1833
1843
|
import_components19.SelectInput,
|
|
1834
1844
|
__spreadValues({
|
|
1835
1845
|
id,
|
|
@@ -1873,7 +1883,7 @@ var import_components21 = require("@transferwise/components");
|
|
|
1873
1883
|
// ../renderers/src/components/UploadFieldInput.tsx
|
|
1874
1884
|
var import_components20 = require("@transferwise/components");
|
|
1875
1885
|
var import_classnames3 = __toESM(require_classnames());
|
|
1876
|
-
var
|
|
1886
|
+
var import_jsx_runtime32 = require("react/jsx-runtime");
|
|
1877
1887
|
function UploadFieldInput({
|
|
1878
1888
|
id,
|
|
1879
1889
|
children,
|
|
@@ -1882,18 +1892,18 @@ function UploadFieldInput({
|
|
|
1882
1892
|
help,
|
|
1883
1893
|
validation
|
|
1884
1894
|
}) {
|
|
1885
|
-
const labelContent = label && help ? /* @__PURE__ */ (0,
|
|
1895
|
+
const labelContent = label && help ? /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(LabelContentWithHelp, { text: label, help }) : label;
|
|
1886
1896
|
const descriptionId = description ? `${id}-description` : void 0;
|
|
1887
|
-
return /* @__PURE__ */ (0,
|
|
1897
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(
|
|
1888
1898
|
"div",
|
|
1889
1899
|
{
|
|
1890
1900
|
className: (0, import_classnames3.default)("form-group d-block", {
|
|
1891
1901
|
"has-error": (validation == null ? void 0 : validation.status) === "invalid"
|
|
1892
1902
|
}),
|
|
1893
1903
|
children: [
|
|
1894
|
-
/* @__PURE__ */ (0,
|
|
1904
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("label", { htmlFor: id, className: "control-label", children: labelContent }),
|
|
1895
1905
|
children,
|
|
1896
|
-
(validation == null ? void 0 : validation.status) === "invalid" && /* @__PURE__ */ (0,
|
|
1906
|
+
(validation == null ? void 0 : validation.status) === "invalid" && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_components20.InlineAlert, { type: "negative", id: descriptionId, children: validation.message })
|
|
1897
1907
|
]
|
|
1898
1908
|
}
|
|
1899
1909
|
);
|
|
@@ -1925,7 +1935,7 @@ var getFileType = (base64Url) => {
|
|
|
1925
1935
|
var getRandomId = () => Math.random().toString(36).substring(2);
|
|
1926
1936
|
|
|
1927
1937
|
// ../renderers/src/MultiUploadInputRenderer.tsx
|
|
1928
|
-
var
|
|
1938
|
+
var import_jsx_runtime33 = require("react/jsx-runtime");
|
|
1929
1939
|
var MultiUploadInputRenderer = {
|
|
1930
1940
|
canRenderType: "input-upload-multi",
|
|
1931
1941
|
render: (props) => {
|
|
@@ -1952,7 +1962,7 @@ var MultiUploadInputRenderer = {
|
|
|
1952
1962
|
};
|
|
1953
1963
|
const onDeleteFile = async (fileId) => onDelete(String(fileId));
|
|
1954
1964
|
const descriptionId = description ? `${id}-description` : void 0;
|
|
1955
|
-
return /* @__PURE__ */ (0,
|
|
1965
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
1956
1966
|
UploadFieldInput_default,
|
|
1957
1967
|
{
|
|
1958
1968
|
id,
|
|
@@ -1960,7 +1970,7 @@ var MultiUploadInputRenderer = {
|
|
|
1960
1970
|
description,
|
|
1961
1971
|
validation: validationState,
|
|
1962
1972
|
help,
|
|
1963
|
-
children: /* @__PURE__ */ (0,
|
|
1973
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
1964
1974
|
import_components21.UploadInput,
|
|
1965
1975
|
{
|
|
1966
1976
|
id,
|
|
@@ -1984,7 +1994,7 @@ var MultiUploadInputRenderer_default = MultiUploadInputRenderer;
|
|
|
1984
1994
|
|
|
1985
1995
|
// ../renderers/src/NumberInputRenderer.tsx
|
|
1986
1996
|
var import_components22 = require("@transferwise/components");
|
|
1987
|
-
var
|
|
1997
|
+
var import_jsx_runtime34 = require("react/jsx-runtime");
|
|
1988
1998
|
var NumberInputRenderer = {
|
|
1989
1999
|
canRenderType: "input-number",
|
|
1990
2000
|
render: (props) => {
|
|
@@ -2011,7 +2021,7 @@ var NumberInputRenderer = {
|
|
|
2011
2021
|
"value",
|
|
2012
2022
|
"onChange"
|
|
2013
2023
|
]);
|
|
2014
|
-
return /* @__PURE__ */ (0,
|
|
2024
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
2015
2025
|
FieldInput_default,
|
|
2016
2026
|
{
|
|
2017
2027
|
id,
|
|
@@ -2019,7 +2029,7 @@ var NumberInputRenderer = {
|
|
|
2019
2029
|
description,
|
|
2020
2030
|
validation: validationState,
|
|
2021
2031
|
help,
|
|
2022
|
-
children: /* @__PURE__ */ (0,
|
|
2032
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_components22.InputGroup, { addonStart: getInputGroupAddonStart({ icon, image }), children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
2023
2033
|
import_components22.Input,
|
|
2024
2034
|
__spreadValues({
|
|
2025
2035
|
id,
|
|
@@ -2044,9 +2054,9 @@ var import_react_intl6 = require("react-intl");
|
|
|
2044
2054
|
|
|
2045
2055
|
// ../renderers/src/hooks/useSnackBarIfAvailable.ts
|
|
2046
2056
|
var import_components23 = require("@transferwise/components");
|
|
2047
|
-
var
|
|
2057
|
+
var import_react8 = require("react");
|
|
2048
2058
|
function useSnackBarIfAvailable() {
|
|
2049
|
-
const context = (0,
|
|
2059
|
+
const context = (0, import_react8.useContext)(import_components23.SnackbarContext);
|
|
2050
2060
|
return context ? context.createSnackbar : () => {
|
|
2051
2061
|
};
|
|
2052
2062
|
}
|
|
@@ -2071,17 +2081,17 @@ var paragraph_messages_default = (0, import_react_intl5.defineMessages)({
|
|
|
2071
2081
|
});
|
|
2072
2082
|
|
|
2073
2083
|
// ../renderers/src/ParagraphRenderer.tsx
|
|
2074
|
-
var
|
|
2084
|
+
var import_jsx_runtime35 = require("react/jsx-runtime");
|
|
2075
2085
|
var ParagraphRenderer = {
|
|
2076
2086
|
canRenderType: "paragraph",
|
|
2077
|
-
render: (props) => /* @__PURE__ */ (0,
|
|
2087
|
+
render: (props) => /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(Paragraph, __spreadValues({}, props))
|
|
2078
2088
|
};
|
|
2079
2089
|
function Paragraph({ align, control, margin, text }) {
|
|
2080
2090
|
const className = getTextAlignmentAndMargin({ align, margin });
|
|
2081
|
-
return control === "copyable" ? /* @__PURE__ */ (0,
|
|
2091
|
+
return control === "copyable" ? /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(CopyableParagraph, { className, align, text }) : /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(StandardParagraph, { className, text });
|
|
2082
2092
|
}
|
|
2083
2093
|
function StandardParagraph({ text, className }) {
|
|
2084
|
-
return /* @__PURE__ */ (0,
|
|
2094
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("p", { className: `np-text-body-large ${className}`, children: text });
|
|
2085
2095
|
}
|
|
2086
2096
|
function CopyableParagraph({
|
|
2087
2097
|
text,
|
|
@@ -2095,8 +2105,8 @@ function CopyableParagraph({
|
|
|
2095
2105
|
});
|
|
2096
2106
|
};
|
|
2097
2107
|
const inputAlignmentClasses = getTextAlignmentAndMargin({ align, margin: "sm" });
|
|
2098
|
-
return /* @__PURE__ */ (0,
|
|
2099
|
-
/* @__PURE__ */ (0,
|
|
2108
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className, children: [
|
|
2109
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
2100
2110
|
import_components24.Input,
|
|
2101
2111
|
{
|
|
2102
2112
|
type: "text",
|
|
@@ -2105,14 +2115,14 @@ function CopyableParagraph({
|
|
|
2105
2115
|
className: (0, import_classnames4.default)("text-ellipsis", inputAlignmentClasses)
|
|
2106
2116
|
}
|
|
2107
2117
|
),
|
|
2108
|
-
/* @__PURE__ */ (0,
|
|
2118
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_components24.Button, { block: true, onClick: copy, children: formatMessage(paragraph_messages_default.copy) })
|
|
2109
2119
|
] });
|
|
2110
2120
|
}
|
|
2111
2121
|
var ParagraphRenderer_default = ParagraphRenderer;
|
|
2112
2122
|
|
|
2113
2123
|
// ../renderers/src/RepeatableRenderer.tsx
|
|
2114
2124
|
var import_components25 = require("@transferwise/components");
|
|
2115
|
-
var
|
|
2125
|
+
var import_react9 = require("react");
|
|
2116
2126
|
var import_icons = require("@transferwise/icons");
|
|
2117
2127
|
var import_react_intl8 = require("react-intl");
|
|
2118
2128
|
|
|
@@ -2143,10 +2153,10 @@ var repeatable_messages_default = (0, import_react_intl7.defineMessages)({
|
|
|
2143
2153
|
|
|
2144
2154
|
// ../renderers/src/RepeatableRenderer.tsx
|
|
2145
2155
|
var import_classnames5 = __toESM(require_classnames());
|
|
2146
|
-
var
|
|
2156
|
+
var import_jsx_runtime36 = require("react/jsx-runtime");
|
|
2147
2157
|
var RepeatableRenderer = {
|
|
2148
2158
|
canRenderType: "repeatable",
|
|
2149
|
-
render: (props) => /* @__PURE__ */ (0,
|
|
2159
|
+
render: (props) => /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(Repeatable, __spreadValues({}, props))
|
|
2150
2160
|
};
|
|
2151
2161
|
function Repeatable(props) {
|
|
2152
2162
|
const {
|
|
@@ -2163,7 +2173,7 @@ function Repeatable(props) {
|
|
|
2163
2173
|
onRemove
|
|
2164
2174
|
} = props;
|
|
2165
2175
|
const { formatMessage } = (0, import_react_intl8.useIntl)();
|
|
2166
|
-
const [openModalType, setOpenModalType] = (0,
|
|
2176
|
+
const [openModalType, setOpenModalType] = (0, import_react9.useState)(null);
|
|
2167
2177
|
const onAddItem = () => {
|
|
2168
2178
|
onAdd();
|
|
2169
2179
|
setOpenModalType("add");
|
|
@@ -2185,40 +2195,40 @@ function Repeatable(props) {
|
|
|
2185
2195
|
const onCancelEdit = () => {
|
|
2186
2196
|
setOpenModalType(null);
|
|
2187
2197
|
};
|
|
2188
|
-
return /* @__PURE__ */ (0,
|
|
2189
|
-
title && /* @__PURE__ */ (0,
|
|
2190
|
-
description && /* @__PURE__ */ (0,
|
|
2191
|
-
/* @__PURE__ */ (0,
|
|
2198
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(import_jsx_runtime36.Fragment, { children: [
|
|
2199
|
+
title && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_components25.Header, { title }),
|
|
2200
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("p", { children: description }),
|
|
2201
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(
|
|
2192
2202
|
"div",
|
|
2193
2203
|
{
|
|
2194
2204
|
className: (0, import_classnames5.default)("form-group", {
|
|
2195
2205
|
"has-error": (validationState == null ? void 0 : validationState.status) === "invalid"
|
|
2196
2206
|
}),
|
|
2197
2207
|
children: [
|
|
2198
|
-
items == null ? void 0 : items.map((item, index) => /* @__PURE__ */ (0,
|
|
2199
|
-
/* @__PURE__ */ (0,
|
|
2208
|
+
items == null ? void 0 : items.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(ItemSummaryOption, { item, onClick: () => onEditItem(index) }, item.id)),
|
|
2209
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
2200
2210
|
import_components25.NavigationOption,
|
|
2201
2211
|
{
|
|
2202
|
-
media: /* @__PURE__ */ (0,
|
|
2212
|
+
media: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_icons.Plus, {}),
|
|
2203
2213
|
title: addItemTitle || formatMessage(repeatable_messages_default.addItemTitle),
|
|
2204
2214
|
showMediaAtAllSizes: true,
|
|
2205
2215
|
onClick: () => onAddItem()
|
|
2206
2216
|
}
|
|
2207
2217
|
),
|
|
2208
|
-
(validationState == null ? void 0 : validationState.status) === "invalid" && /* @__PURE__ */ (0,
|
|
2218
|
+
(validationState == null ? void 0 : validationState.status) === "invalid" && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_components25.InlineAlert, { type: "negative", children: validationState.message })
|
|
2209
2219
|
]
|
|
2210
2220
|
}
|
|
2211
2221
|
),
|
|
2212
|
-
/* @__PURE__ */ (0,
|
|
2222
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
2213
2223
|
import_components25.Modal,
|
|
2214
2224
|
{
|
|
2215
2225
|
open: openModalType !== null,
|
|
2216
2226
|
title: (openModalType === "add" ? addItemTitle : editItemTitle) || formatMessage(repeatable_messages_default.addItemTitle),
|
|
2217
|
-
body: /* @__PURE__ */ (0,
|
|
2218
|
-
/* @__PURE__ */ (0,
|
|
2219
|
-
/* @__PURE__ */ (0,
|
|
2220
|
-
/* @__PURE__ */ (0,
|
|
2221
|
-
/* @__PURE__ */ (0,
|
|
2227
|
+
body: /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(import_jsx_runtime36.Fragment, { children: [
|
|
2228
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { className: "m-b-2", children: editableItem }),
|
|
2229
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { children: [
|
|
2230
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_components25.Button, { priority: "primary", block: true, className: "m-b-2", onClick: () => onSaveItem(), children: formatMessage(repeatable_messages_default.addItem) }),
|
|
2231
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_components25.Button, { priority: "secondary", type: "negative", block: true, onClick: () => onRemoveItem(), children: formatMessage(repeatable_messages_default.removeItem) })
|
|
2222
2232
|
] })
|
|
2223
2233
|
] }),
|
|
2224
2234
|
onClose: () => onCancelEdit()
|
|
@@ -2230,10 +2240,10 @@ function ItemSummaryOption({
|
|
|
2230
2240
|
item,
|
|
2231
2241
|
onClick
|
|
2232
2242
|
}) {
|
|
2233
|
-
return /* @__PURE__ */ (0,
|
|
2243
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
2234
2244
|
import_components25.NavigationOption,
|
|
2235
2245
|
{
|
|
2236
|
-
media: /* @__PURE__ */ (0,
|
|
2246
|
+
media: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(NavigationOptionMedia, __spreadValues({}, item)),
|
|
2237
2247
|
title: item.title,
|
|
2238
2248
|
content: item.description,
|
|
2239
2249
|
showMediaAtAllSizes: true,
|
|
@@ -2271,7 +2281,7 @@ var generic_error_messages_default = (0, import_react_intl9.defineMessages)({
|
|
|
2271
2281
|
|
|
2272
2282
|
// ../renderers/src/SearchRenderer/ErrorResult.tsx
|
|
2273
2283
|
var import_components26 = require("@transferwise/components");
|
|
2274
|
-
var
|
|
2284
|
+
var import_jsx_runtime37 = require("react/jsx-runtime");
|
|
2275
2285
|
function ErrorResult({ state }) {
|
|
2276
2286
|
const intl = (0, import_react_intl10.useIntl)();
|
|
2277
2287
|
const buttonVisualProps = {
|
|
@@ -2279,10 +2289,10 @@ function ErrorResult({ state }) {
|
|
|
2279
2289
|
size: "sm",
|
|
2280
2290
|
style: { marginTop: "-2px", padding: "0", width: "auto", display: "inline" }
|
|
2281
2291
|
};
|
|
2282
|
-
return /* @__PURE__ */ (0,
|
|
2292
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("p", { className: "m-t-2", children: [
|
|
2283
2293
|
intl.formatMessage(generic_error_messages_default.genericError),
|
|
2284
2294
|
"\xA0",
|
|
2285
|
-
/* @__PURE__ */ (0,
|
|
2295
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
2286
2296
|
import_components26.Button,
|
|
2287
2297
|
__spreadProps(__spreadValues({}, buttonVisualProps), {
|
|
2288
2298
|
onClick: () => {
|
|
@@ -2295,7 +2305,7 @@ function ErrorResult({ state }) {
|
|
|
2295
2305
|
}
|
|
2296
2306
|
|
|
2297
2307
|
// ../renderers/src/SearchRenderer/BlockSearchRendererComponent.tsx
|
|
2298
|
-
var
|
|
2308
|
+
var import_react10 = require("react");
|
|
2299
2309
|
|
|
2300
2310
|
// ../renderers/src/messages/search.messages.ts
|
|
2301
2311
|
var import_react_intl11 = require("react-intl");
|
|
@@ -2309,7 +2319,7 @@ var search_messages_default = (0, import_react_intl11.defineMessages)({
|
|
|
2309
2319
|
|
|
2310
2320
|
// ../renderers/src/SearchRenderer/BlockSearchRendererComponent.tsx
|
|
2311
2321
|
var import_react_intl12 = require("react-intl");
|
|
2312
|
-
var
|
|
2322
|
+
var import_jsx_runtime38 = require("react/jsx-runtime");
|
|
2313
2323
|
function BlockSearchRendererComponent({
|
|
2314
2324
|
id,
|
|
2315
2325
|
isLoading,
|
|
@@ -2319,11 +2329,11 @@ function BlockSearchRendererComponent({
|
|
|
2319
2329
|
state,
|
|
2320
2330
|
title
|
|
2321
2331
|
}) {
|
|
2322
|
-
const [hasSearched, setHasSearched] = (0,
|
|
2332
|
+
const [hasSearched, setHasSearched] = (0, import_react10.useState)(false);
|
|
2323
2333
|
const trackEvent = useTrackEvent();
|
|
2324
2334
|
const { formatMessage } = (0, import_react_intl12.useIntl)();
|
|
2325
|
-
return /* @__PURE__ */ (0,
|
|
2326
|
-
/* @__PURE__ */ (0,
|
|
2335
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: getMargin(margin), children: [
|
|
2336
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(FieldInput_default, { id, description: "", validation: void 0, help: "", label: title, children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
2327
2337
|
import_components27.Input,
|
|
2328
2338
|
{
|
|
2329
2339
|
id,
|
|
@@ -2340,7 +2350,7 @@ function BlockSearchRendererComponent({
|
|
|
2340
2350
|
}
|
|
2341
2351
|
}
|
|
2342
2352
|
) }),
|
|
2343
|
-
isLoading ? /* @__PURE__ */ (0,
|
|
2353
|
+
isLoading ? /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_jsx_runtime38.Fragment, { children: formatMessage(search_messages_default.loading) }) : /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(SearchResultContent, { state, onChange })
|
|
2344
2354
|
] });
|
|
2345
2355
|
}
|
|
2346
2356
|
function SearchResultContent({
|
|
@@ -2349,26 +2359,26 @@ function SearchResultContent({
|
|
|
2349
2359
|
}) {
|
|
2350
2360
|
switch (state.type) {
|
|
2351
2361
|
case "error":
|
|
2352
|
-
return /* @__PURE__ */ (0,
|
|
2362
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(ErrorResult, { state });
|
|
2353
2363
|
case "results":
|
|
2354
|
-
return /* @__PURE__ */ (0,
|
|
2364
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(SearchResults, { state, onChange });
|
|
2355
2365
|
case "noResults":
|
|
2356
|
-
return /* @__PURE__ */ (0,
|
|
2366
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(EmptySearchResult, { state });
|
|
2357
2367
|
case "pending":
|
|
2358
2368
|
default:
|
|
2359
2369
|
return null;
|
|
2360
2370
|
}
|
|
2361
2371
|
}
|
|
2362
2372
|
function EmptySearchResult({ state }) {
|
|
2363
|
-
return /* @__PURE__ */ (0,
|
|
2373
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_components27.Markdown, { className: "m-t-2", config: { link: { target: "_blank" } }, children: state.message });
|
|
2364
2374
|
}
|
|
2365
2375
|
function SearchResults({
|
|
2366
2376
|
state
|
|
2367
2377
|
}) {
|
|
2368
2378
|
const trackEvent = useTrackEvent();
|
|
2369
|
-
return /* @__PURE__ */ (0,
|
|
2379
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_components27.NavigationOptionsList, { children: state.results.map((result) => {
|
|
2370
2380
|
const { icon, image } = result;
|
|
2371
|
-
return /* @__PURE__ */ (0,
|
|
2381
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
2372
2382
|
import_components27.NavigationOption,
|
|
2373
2383
|
{
|
|
2374
2384
|
title: result.title,
|
|
@@ -2392,9 +2402,9 @@ var BlockSearchRendererComponent_default = BlockSearchRendererComponent;
|
|
|
2392
2402
|
// ../renderers/src/SearchRenderer/InlineSearchRendererComponent.tsx
|
|
2393
2403
|
var import_components28 = require("@transferwise/components");
|
|
2394
2404
|
var import_icons2 = require("@transferwise/icons");
|
|
2395
|
-
var
|
|
2405
|
+
var import_react11 = require("react");
|
|
2396
2406
|
var import_react_intl13 = require("react-intl");
|
|
2397
|
-
var
|
|
2407
|
+
var import_jsx_runtime39 = require("react/jsx-runtime");
|
|
2398
2408
|
function InlineSearchRenderer({
|
|
2399
2409
|
id,
|
|
2400
2410
|
isLoading,
|
|
@@ -2403,10 +2413,10 @@ function InlineSearchRenderer({
|
|
|
2403
2413
|
state,
|
|
2404
2414
|
title
|
|
2405
2415
|
}) {
|
|
2406
|
-
const [hasSearched, setHasSearched] = (0,
|
|
2416
|
+
const [hasSearched, setHasSearched] = (0, import_react11.useState)(false);
|
|
2407
2417
|
const trackEvent = useTrackEvent();
|
|
2408
2418
|
const intl = (0, import_react_intl13.useIntl)();
|
|
2409
|
-
return /* @__PURE__ */ (0,
|
|
2419
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("div", { className: getMargin(margin), children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(FieldInput_default, { id, description: "", validation: void 0, help: "", label: title, children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
2410
2420
|
import_components28.Typeahead,
|
|
2411
2421
|
{
|
|
2412
2422
|
id: "typeahead-input-id",
|
|
@@ -2414,10 +2424,10 @@ function InlineSearchRenderer({
|
|
|
2414
2424
|
name: "typeahead-input-name",
|
|
2415
2425
|
size: "md",
|
|
2416
2426
|
maxHeight: 100,
|
|
2417
|
-
footer: /* @__PURE__ */ (0,
|
|
2427
|
+
footer: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(TypeaheadFooter, { state, isLoading }),
|
|
2418
2428
|
multiple: false,
|
|
2419
2429
|
clearable: false,
|
|
2420
|
-
addon: /* @__PURE__ */ (0,
|
|
2430
|
+
addon: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_icons2.Search, { size: 24 }),
|
|
2421
2431
|
options: state.type === "results" ? state.results.map(mapResultToTypeaheadOption) : [],
|
|
2422
2432
|
minQueryLength: 1,
|
|
2423
2433
|
onChange: (values) => {
|
|
@@ -2454,29 +2464,29 @@ function mapResultToTypeaheadOption(result) {
|
|
|
2454
2464
|
function TypeaheadFooter({ state, isLoading }) {
|
|
2455
2465
|
const { formatMessage } = (0, import_react_intl13.useIntl)();
|
|
2456
2466
|
if (state.type === "noResults") {
|
|
2457
|
-
return /* @__PURE__ */ (0,
|
|
2467
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_components28.Markdown, { className: "m-t-2 m-x-2", config: { link: { target: "_blank" } }, children: state.message });
|
|
2458
2468
|
}
|
|
2459
2469
|
if (state.type === "error") {
|
|
2460
|
-
return /* @__PURE__ */ (0,
|
|
2470
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("div", { className: "m-t-2 m-x-2", children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(ErrorResult, { state }) });
|
|
2461
2471
|
}
|
|
2462
2472
|
if (state.type === "pending" || isLoading) {
|
|
2463
|
-
return /* @__PURE__ */ (0,
|
|
2473
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("p", { className: "m-t-2 m-x-2", children: formatMessage(search_messages_default.loading) });
|
|
2464
2474
|
}
|
|
2465
2475
|
return null;
|
|
2466
2476
|
}
|
|
2467
2477
|
var InlineSearchRendererComponent_default = InlineSearchRenderer;
|
|
2468
2478
|
|
|
2469
2479
|
// ../renderers/src/SearchRenderer/SearchRenderer.tsx
|
|
2470
|
-
var
|
|
2480
|
+
var import_jsx_runtime40 = require("react/jsx-runtime");
|
|
2471
2481
|
var SearchRenderer = {
|
|
2472
2482
|
canRenderType: "search",
|
|
2473
|
-
render: (props) => props.control === "inline" ? /* @__PURE__ */ (0,
|
|
2483
|
+
render: (props) => props.control === "inline" ? /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(InlineSearchRendererComponent_default, __spreadValues({}, props)) : /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(BlockSearchRendererComponent_default, __spreadValues({}, props))
|
|
2474
2484
|
};
|
|
2475
2485
|
var SearchRenderer_default = SearchRenderer;
|
|
2476
2486
|
|
|
2477
2487
|
// ../renderers/src/SelectInputRenderer/RadioInputRendererComponent.tsx
|
|
2478
2488
|
var import_components29 = require("@transferwise/components");
|
|
2479
|
-
var
|
|
2489
|
+
var import_jsx_runtime41 = require("react/jsx-runtime");
|
|
2480
2490
|
function RadioInputRendererComponent(props) {
|
|
2481
2491
|
const {
|
|
2482
2492
|
id,
|
|
@@ -2490,8 +2500,8 @@ function RadioInputRendererComponent(props) {
|
|
|
2490
2500
|
validationState,
|
|
2491
2501
|
onSelect
|
|
2492
2502
|
} = props;
|
|
2493
|
-
return /* @__PURE__ */ (0,
|
|
2494
|
-
/* @__PURE__ */ (0,
|
|
2503
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(import_jsx_runtime41.Fragment, { children: [
|
|
2504
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
2495
2505
|
FieldInput_default,
|
|
2496
2506
|
{
|
|
2497
2507
|
id,
|
|
@@ -2499,7 +2509,7 @@ function RadioInputRendererComponent(props) {
|
|
|
2499
2509
|
help,
|
|
2500
2510
|
description,
|
|
2501
2511
|
validation: validationState,
|
|
2502
|
-
children: /* @__PURE__ */ (0,
|
|
2512
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("span", { children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
2503
2513
|
import_components29.RadioGroup,
|
|
2504
2514
|
{
|
|
2505
2515
|
name: id,
|
|
@@ -2508,7 +2518,7 @@ function RadioInputRendererComponent(props) {
|
|
|
2508
2518
|
value: index,
|
|
2509
2519
|
secondary: option.description,
|
|
2510
2520
|
disabled: option.disabled || disabled,
|
|
2511
|
-
avatar: /* @__PURE__ */ (0,
|
|
2521
|
+
avatar: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(OptionMedia, { icon: option.icon, image: option.image })
|
|
2512
2522
|
})),
|
|
2513
2523
|
selectedValue: selectedIndex != null ? selectedIndex : void 0,
|
|
2514
2524
|
onChange: onSelect
|
|
@@ -2523,8 +2533,8 @@ function RadioInputRendererComponent(props) {
|
|
|
2523
2533
|
|
|
2524
2534
|
// ../renderers/src/SelectInputRenderer/TabInputRendererComponent.tsx
|
|
2525
2535
|
var import_components30 = require("@transferwise/components");
|
|
2526
|
-
var
|
|
2527
|
-
var
|
|
2536
|
+
var import_react12 = require("react");
|
|
2537
|
+
var import_jsx_runtime42 = require("react/jsx-runtime");
|
|
2528
2538
|
function TabInputRendererComponent(props) {
|
|
2529
2539
|
const {
|
|
2530
2540
|
id,
|
|
@@ -2538,13 +2548,13 @@ function TabInputRendererComponent(props) {
|
|
|
2538
2548
|
validationState,
|
|
2539
2549
|
onSelect
|
|
2540
2550
|
} = props;
|
|
2541
|
-
(0,
|
|
2551
|
+
(0, import_react12.useEffect)(() => {
|
|
2542
2552
|
if (!isValidIndex(selectedIndex, options.length)) {
|
|
2543
2553
|
onSelect(0);
|
|
2544
2554
|
}
|
|
2545
2555
|
}, [selectedIndex, onSelect, options.length]);
|
|
2546
|
-
return /* @__PURE__ */ (0,
|
|
2547
|
-
/* @__PURE__ */ (0,
|
|
2556
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(import_jsx_runtime42.Fragment, { children: [
|
|
2557
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
2548
2558
|
FieldInput_default,
|
|
2549
2559
|
{
|
|
2550
2560
|
id,
|
|
@@ -2552,7 +2562,7 @@ function TabInputRendererComponent(props) {
|
|
|
2552
2562
|
help,
|
|
2553
2563
|
description,
|
|
2554
2564
|
validation: validationState,
|
|
2555
|
-
children: /* @__PURE__ */ (0,
|
|
2565
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
2556
2566
|
import_components30.Tabs,
|
|
2557
2567
|
{
|
|
2558
2568
|
name: id,
|
|
@@ -2561,7 +2571,7 @@ function TabInputRendererComponent(props) {
|
|
|
2561
2571
|
title: option.title,
|
|
2562
2572
|
// if we pass null, we get some props-types console errors
|
|
2563
2573
|
// eslint-disable-next-line react/jsx-no-useless-fragment
|
|
2564
|
-
content: /* @__PURE__ */ (0,
|
|
2574
|
+
content: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_jsx_runtime42.Fragment, {}),
|
|
2565
2575
|
disabled: option.disabled || disabled
|
|
2566
2576
|
})),
|
|
2567
2577
|
onTabSelect: onSelect
|
|
@@ -2576,7 +2586,7 @@ var isValidIndex = (index, options) => index !== null && index >= 0 && index < o
|
|
|
2576
2586
|
|
|
2577
2587
|
// ../renderers/src/SelectInputRenderer/SelectInputRendererComponent.tsx
|
|
2578
2588
|
var import_components31 = require("@transferwise/components");
|
|
2579
|
-
var
|
|
2589
|
+
var import_jsx_runtime43 = require("react/jsx-runtime");
|
|
2580
2590
|
function SelectInputRendererComponent(props) {
|
|
2581
2591
|
const {
|
|
2582
2592
|
id,
|
|
@@ -2616,13 +2626,13 @@ function SelectInputRendererComponent(props) {
|
|
|
2616
2626
|
} : {
|
|
2617
2627
|
title: option.title,
|
|
2618
2628
|
description: option.description,
|
|
2619
|
-
icon: /* @__PURE__ */ (0,
|
|
2629
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(OptionMedia, { icon: option.icon, image: option.image })
|
|
2620
2630
|
};
|
|
2621
|
-
return /* @__PURE__ */ (0,
|
|
2631
|
+
return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_components31.SelectInputOptionContent, __spreadValues({}, contentProps));
|
|
2622
2632
|
};
|
|
2623
2633
|
const extraProps = { autoComplete };
|
|
2624
|
-
return /* @__PURE__ */ (0,
|
|
2625
|
-
/* @__PURE__ */ (0,
|
|
2634
|
+
return /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(import_jsx_runtime43.Fragment, { children: [
|
|
2635
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
2626
2636
|
FieldInput_default,
|
|
2627
2637
|
{
|
|
2628
2638
|
id,
|
|
@@ -2630,7 +2640,7 @@ function SelectInputRendererComponent(props) {
|
|
|
2630
2640
|
help,
|
|
2631
2641
|
description,
|
|
2632
2642
|
validation: validationState,
|
|
2633
|
-
children: /* @__PURE__ */ (0,
|
|
2643
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
2634
2644
|
import_components31.SelectInput,
|
|
2635
2645
|
__spreadValues({
|
|
2636
2646
|
name: id,
|
|
@@ -2651,9 +2661,9 @@ function SelectInputRendererComponent(props) {
|
|
|
2651
2661
|
}
|
|
2652
2662
|
|
|
2653
2663
|
// ../renderers/src/SelectInputRenderer/SegmentedInputRendererComponent.tsx
|
|
2654
|
-
var
|
|
2664
|
+
var import_react13 = require("react");
|
|
2655
2665
|
var import_components32 = require("@transferwise/components");
|
|
2656
|
-
var
|
|
2666
|
+
var import_jsx_runtime44 = require("react/jsx-runtime");
|
|
2657
2667
|
function SegmentedInputRendererComponent(props) {
|
|
2658
2668
|
const {
|
|
2659
2669
|
id,
|
|
@@ -2666,13 +2676,13 @@ function SegmentedInputRendererComponent(props) {
|
|
|
2666
2676
|
validationState,
|
|
2667
2677
|
onSelect
|
|
2668
2678
|
} = props;
|
|
2669
|
-
(0,
|
|
2679
|
+
(0, import_react13.useEffect)(() => {
|
|
2670
2680
|
if (!isValidIndex2(selectedIndex, options.length)) {
|
|
2671
2681
|
onSelect(0);
|
|
2672
2682
|
}
|
|
2673
2683
|
}, [selectedIndex, onSelect, options.length]);
|
|
2674
|
-
return /* @__PURE__ */ (0,
|
|
2675
|
-
/* @__PURE__ */ (0,
|
|
2684
|
+
return /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(import_jsx_runtime44.Fragment, { children: [
|
|
2685
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
2676
2686
|
FieldInput_default,
|
|
2677
2687
|
{
|
|
2678
2688
|
id,
|
|
@@ -2680,7 +2690,7 @@ function SegmentedInputRendererComponent(props) {
|
|
|
2680
2690
|
help,
|
|
2681
2691
|
description,
|
|
2682
2692
|
validation: validationState,
|
|
2683
|
-
children: /* @__PURE__ */ (0,
|
|
2693
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
2684
2694
|
import_components32.SegmentedControl,
|
|
2685
2695
|
{
|
|
2686
2696
|
name: `${id}-segmented-control`,
|
|
@@ -2697,26 +2707,26 @@ function SegmentedInputRendererComponent(props) {
|
|
|
2697
2707
|
)
|
|
2698
2708
|
}
|
|
2699
2709
|
),
|
|
2700
|
-
/* @__PURE__ */ (0,
|
|
2710
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)("div", { id: `${id}-children`, children })
|
|
2701
2711
|
] });
|
|
2702
2712
|
}
|
|
2703
2713
|
var isValidIndex2 = (index, options) => index !== null && index >= 0 && index < options;
|
|
2704
2714
|
|
|
2705
2715
|
// ../renderers/src/SelectInputRenderer/SelectInputRenderer.tsx
|
|
2706
|
-
var
|
|
2716
|
+
var import_jsx_runtime45 = require("react/jsx-runtime");
|
|
2707
2717
|
var SelectInputRenderer = {
|
|
2708
2718
|
canRenderType: "input-select",
|
|
2709
2719
|
render: (props) => {
|
|
2710
2720
|
switch (props.control) {
|
|
2711
2721
|
case "radio":
|
|
2712
|
-
return /* @__PURE__ */ (0,
|
|
2722
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(RadioInputRendererComponent, __spreadValues({}, props));
|
|
2713
2723
|
case "tab":
|
|
2714
|
-
return props.options.length > 3 ? /* @__PURE__ */ (0,
|
|
2724
|
+
return props.options.length > 3 ? /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(SelectInputRendererComponent, __spreadValues({}, props)) : /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(TabInputRendererComponent, __spreadValues({}, props));
|
|
2715
2725
|
case "segmented":
|
|
2716
|
-
return props.options.length > 3 ? /* @__PURE__ */ (0,
|
|
2726
|
+
return props.options.length > 3 ? /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(SelectInputRendererComponent, __spreadValues({}, props)) : /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(SegmentedInputRendererComponent, __spreadValues({}, props));
|
|
2717
2727
|
case "select":
|
|
2718
2728
|
default:
|
|
2719
|
-
return /* @__PURE__ */ (0,
|
|
2729
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(SelectInputRendererComponent, __spreadValues({}, props));
|
|
2720
2730
|
}
|
|
2721
2731
|
}
|
|
2722
2732
|
};
|
|
@@ -2724,17 +2734,17 @@ var SelectInputRenderer_default = SelectInputRenderer;
|
|
|
2724
2734
|
|
|
2725
2735
|
// ../renderers/src/StatusListRenderer.tsx
|
|
2726
2736
|
var import_components33 = require("@transferwise/components");
|
|
2727
|
-
var
|
|
2737
|
+
var import_jsx_runtime46 = require("react/jsx-runtime");
|
|
2728
2738
|
var StatusListRenderer = {
|
|
2729
2739
|
canRenderType: "status-list",
|
|
2730
|
-
render: ({ margin, items, title }) => /* @__PURE__ */ (0,
|
|
2731
|
-
title ? /* @__PURE__ */ (0,
|
|
2732
|
-
items.map(({ callToAction, description, icon, status, title: itemTitle }) => /* @__PURE__ */ (0,
|
|
2740
|
+
render: ({ margin, items, title }) => /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("div", { className: getMargin(margin), children: [
|
|
2741
|
+
title ? /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_components33.Header, { title, className: "m-b-2" }) : null,
|
|
2742
|
+
items.map(({ callToAction, description, icon, status, title: itemTitle }) => /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
2733
2743
|
import_components33.Summary,
|
|
2734
2744
|
{
|
|
2735
2745
|
title: itemTitle,
|
|
2736
2746
|
description,
|
|
2737
|
-
icon: icon && "name" in icon ? /* @__PURE__ */ (0,
|
|
2747
|
+
icon: icon && "name" in icon ? /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(DynamicIcon_default, { name: icon.name }) : null,
|
|
2738
2748
|
status: mapStatus(status),
|
|
2739
2749
|
action: getSummaryAction(callToAction)
|
|
2740
2750
|
},
|
|
@@ -2774,31 +2784,31 @@ var import_components35 = require("@transferwise/components");
|
|
|
2774
2784
|
|
|
2775
2785
|
// ../renderers/src/components/VariableTextInput.tsx
|
|
2776
2786
|
var import_components34 = require("@transferwise/components");
|
|
2777
|
-
var
|
|
2787
|
+
var import_jsx_runtime47 = require("react/jsx-runtime");
|
|
2778
2788
|
function VariableTextInput({
|
|
2779
2789
|
control,
|
|
2780
2790
|
inputProps
|
|
2781
2791
|
}) {
|
|
2782
2792
|
switch (control) {
|
|
2783
2793
|
case "password":
|
|
2784
|
-
return /* @__PURE__ */ (0,
|
|
2794
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(TextInput, __spreadValues({ type: "password" }, inputProps));
|
|
2785
2795
|
case "email":
|
|
2786
|
-
return /* @__PURE__ */ (0,
|
|
2796
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(TextInput, __spreadValues({ type: "email" }, inputProps));
|
|
2787
2797
|
case "textarea":
|
|
2788
|
-
return /* @__PURE__ */ (0,
|
|
2798
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(TextAreaInput, __spreadValues({}, inputProps));
|
|
2789
2799
|
case "numeric":
|
|
2790
|
-
return /* @__PURE__ */ (0,
|
|
2800
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(NumericInput, __spreadValues({ type: "number" }, inputProps));
|
|
2791
2801
|
case "phone-number":
|
|
2792
|
-
return /* @__PURE__ */ (0,
|
|
2802
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(PhoneNumberInput, __spreadValues({}, inputProps));
|
|
2793
2803
|
default:
|
|
2794
|
-
return /* @__PURE__ */ (0,
|
|
2804
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(TextInput, __spreadValues({ type: "text" }, inputProps));
|
|
2795
2805
|
}
|
|
2796
2806
|
}
|
|
2797
2807
|
function TextInput(_a) {
|
|
2798
2808
|
var _b = _a, { id, displayFormat, onChange } = _b, rest = __objRest(_b, ["id", "displayFormat", "onChange"]);
|
|
2799
2809
|
if (typeof displayFormat === "string") {
|
|
2800
2810
|
const inputProps = __spreadValues({ id, name: id, className: "form-control" }, rest);
|
|
2801
|
-
return /* @__PURE__ */ (0,
|
|
2811
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
2802
2812
|
import_components34.InputWithDisplayFormat,
|
|
2803
2813
|
__spreadValues({
|
|
2804
2814
|
displayPattern: displayFormat,
|
|
@@ -2806,29 +2816,29 @@ function TextInput(_a) {
|
|
|
2806
2816
|
}, inputProps)
|
|
2807
2817
|
);
|
|
2808
2818
|
}
|
|
2809
|
-
return /* @__PURE__ */ (0,
|
|
2819
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_components34.Input, __spreadValues({ id, name: id, onChange: (e) => onChange(e.target.value) }, rest));
|
|
2810
2820
|
}
|
|
2811
2821
|
function TextAreaInput(_a) {
|
|
2812
2822
|
var _b = _a, { id, displayFormat, onChange } = _b, rest = __objRest(_b, ["id", "displayFormat", "onChange"]);
|
|
2813
2823
|
const textAreaProps = __spreadValues({ id, name: id }, rest);
|
|
2814
|
-
return typeof displayFormat === "string" ? /* @__PURE__ */ (0,
|
|
2824
|
+
return typeof displayFormat === "string" ? /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
2815
2825
|
import_components34.TextareaWithDisplayFormat,
|
|
2816
2826
|
__spreadValues({
|
|
2817
2827
|
displayPattern: displayFormat,
|
|
2818
2828
|
onChange: (newValue) => onChange(newValue)
|
|
2819
2829
|
}, textAreaProps)
|
|
2820
|
-
) : /* @__PURE__ */ (0,
|
|
2830
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_components34.TextArea, __spreadValues({ onChange: (e) => onChange(e.target.value) }, textAreaProps));
|
|
2821
2831
|
}
|
|
2822
2832
|
function NumericInput(_a) {
|
|
2823
2833
|
var _b = _a, { id, displayFormat, onChange } = _b, rest = __objRest(_b, ["id", "displayFormat", "onChange"]);
|
|
2824
2834
|
const numericProps = __spreadValues({ id, name: id, onWheel }, rest);
|
|
2825
|
-
return typeof displayFormat === "string" ? /* @__PURE__ */ (0,
|
|
2835
|
+
return typeof displayFormat === "string" ? /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
2826
2836
|
import_components34.InputWithDisplayFormat,
|
|
2827
2837
|
__spreadValues({
|
|
2828
2838
|
displayPattern: displayFormat,
|
|
2829
2839
|
onChange: (newValue) => onChange(numericValueOrNull(newValue))
|
|
2830
2840
|
}, numericProps)
|
|
2831
|
-
) : /* @__PURE__ */ (0,
|
|
2841
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
2832
2842
|
import_components34.Input,
|
|
2833
2843
|
__spreadValues({
|
|
2834
2844
|
onChange: ({ target: { value: newValue } }) => onChange(numericValueOrNull(newValue))
|
|
@@ -2837,12 +2847,12 @@ function NumericInput(_a) {
|
|
|
2837
2847
|
}
|
|
2838
2848
|
function PhoneNumberInput(_a) {
|
|
2839
2849
|
var _b = _a, { value } = _b, rest = __objRest(_b, ["value"]);
|
|
2840
|
-
return /* @__PURE__ */ (0,
|
|
2850
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_components34.PhoneNumberInput, __spreadValues({ initialValue: value }, rest));
|
|
2841
2851
|
}
|
|
2842
2852
|
var VariableTextInput_default = VariableTextInput;
|
|
2843
2853
|
|
|
2844
2854
|
// ../renderers/src/TextInputRenderer.tsx
|
|
2845
|
-
var
|
|
2855
|
+
var import_jsx_runtime48 = require("react/jsx-runtime");
|
|
2846
2856
|
var TextInputRenderer = {
|
|
2847
2857
|
canRenderType: "input-text",
|
|
2848
2858
|
render: (props) => {
|
|
@@ -2877,7 +2887,7 @@ var TextInputRenderer = {
|
|
|
2877
2887
|
]);
|
|
2878
2888
|
const value = initialValue != null ? initialValue : "";
|
|
2879
2889
|
const inputProps = __spreadProps(__spreadValues({}, rest), { value, id });
|
|
2880
|
-
return /* @__PURE__ */ (0,
|
|
2890
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
2881
2891
|
FieldInput_default,
|
|
2882
2892
|
{
|
|
2883
2893
|
id,
|
|
@@ -2885,7 +2895,7 @@ var TextInputRenderer = {
|
|
|
2885
2895
|
description,
|
|
2886
2896
|
validation: validationState,
|
|
2887
2897
|
help,
|
|
2888
|
-
children: /* @__PURE__ */ (0,
|
|
2898
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_components35.InputGroup, { addonStart: getInputGroupAddonStart({ icon, image }), children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(VariableTextInput_default, { control, inputProps }) })
|
|
2889
2899
|
}
|
|
2890
2900
|
);
|
|
2891
2901
|
}
|
|
@@ -2894,7 +2904,7 @@ var TextInputRenderer_default = TextInputRenderer;
|
|
|
2894
2904
|
|
|
2895
2905
|
// ../renderers/src/UploadInputRenderer.tsx
|
|
2896
2906
|
var import_components36 = require("@transferwise/components");
|
|
2897
|
-
var
|
|
2907
|
+
var import_jsx_runtime49 = require("react/jsx-runtime");
|
|
2898
2908
|
var UploadInputRenderer = {
|
|
2899
2909
|
canRenderType: "input-upload",
|
|
2900
2910
|
render: (props) => {
|
|
@@ -2910,14 +2920,14 @@ var UploadInputRenderer = {
|
|
|
2910
2920
|
};
|
|
2911
2921
|
return (
|
|
2912
2922
|
// We don't pass help here as there is no sensible place to display it
|
|
2913
|
-
/* @__PURE__ */ (0,
|
|
2923
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
2914
2924
|
UploadFieldInput_default,
|
|
2915
2925
|
{
|
|
2916
2926
|
id,
|
|
2917
2927
|
label: void 0,
|
|
2918
2928
|
description: void 0,
|
|
2919
2929
|
validation: validationState,
|
|
2920
|
-
children: /* @__PURE__ */ (0,
|
|
2930
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
2921
2931
|
import_components36.UploadInput,
|
|
2922
2932
|
{
|
|
2923
2933
|
id,
|
|
@@ -2974,7 +2984,7 @@ var LargeUploadRenderer = {
|
|
|
2974
2984
|
throw e;
|
|
2975
2985
|
}
|
|
2976
2986
|
};
|
|
2977
|
-
return /* @__PURE__ */ (0,
|
|
2987
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
2978
2988
|
FieldInput_default,
|
|
2979
2989
|
{
|
|
2980
2990
|
id,
|
|
@@ -2982,7 +2992,7 @@ var LargeUploadRenderer = {
|
|
|
2982
2992
|
description,
|
|
2983
2993
|
validation: validationState,
|
|
2984
2994
|
help,
|
|
2985
|
-
children: /* @__PURE__ */ (0,
|
|
2995
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
2986
2996
|
import_components36.Upload,
|
|
2987
2997
|
__spreadProps(__spreadValues({}, uploadProps), {
|
|
2988
2998
|
usAccept: getAcceptsString(accepts),
|
|
@@ -2999,14 +3009,14 @@ var LargeUploadRenderer = {
|
|
|
2999
3009
|
|
|
3000
3010
|
// ../renderers/src/ReviewRenderer.tsx
|
|
3001
3011
|
var import_components37 = require("@transferwise/components");
|
|
3002
|
-
var
|
|
3012
|
+
var import_jsx_runtime50 = require("react/jsx-runtime");
|
|
3003
3013
|
var ReviewRenderer = {
|
|
3004
3014
|
canRenderType: "review",
|
|
3005
3015
|
render: ({ callToAction, control, fields, margin, title }) => {
|
|
3006
3016
|
const orientation = mapControlToDefinitionListLayout(control);
|
|
3007
|
-
return /* @__PURE__ */ (0,
|
|
3008
|
-
(title || callToAction) && /* @__PURE__ */ (0,
|
|
3009
|
-
/* @__PURE__ */ (0,
|
|
3017
|
+
return /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("div", { className: getMargin(margin), children: [
|
|
3018
|
+
(title || callToAction) && /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_components37.Header, { title: title != null ? title : "", action: getReviewAction(callToAction) }),
|
|
3019
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)("div", { className: margin, children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
3010
3020
|
import_components37.DefinitionList,
|
|
3011
3021
|
{
|
|
3012
3022
|
layout: orientation,
|
|
@@ -3038,14 +3048,14 @@ var mapControlToDefinitionListLayout = (control) => {
|
|
|
3038
3048
|
};
|
|
3039
3049
|
var getFieldValue = (value, help, orientation) => {
|
|
3040
3050
|
if (help) {
|
|
3041
|
-
return orientation === "HORIZONTAL_RIGHT_ALIGNED" ? /* @__PURE__ */ (0,
|
|
3042
|
-
/* @__PURE__ */ (0,
|
|
3051
|
+
return orientation === "HORIZONTAL_RIGHT_ALIGNED" ? /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(import_jsx_runtime50.Fragment, { children: [
|
|
3052
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)(Help_default, { help }),
|
|
3043
3053
|
" ",
|
|
3044
3054
|
value
|
|
3045
|
-
] }) : /* @__PURE__ */ (0,
|
|
3055
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(import_jsx_runtime50.Fragment, { children: [
|
|
3046
3056
|
value,
|
|
3047
3057
|
" ",
|
|
3048
|
-
/* @__PURE__ */ (0,
|
|
3058
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)(Help_default, { help })
|
|
3049
3059
|
] });
|
|
3050
3060
|
}
|
|
3051
3061
|
return value;
|
|
@@ -3074,29 +3084,7 @@ var getReviewAction = (callToAction) => {
|
|
|
3074
3084
|
};
|
|
3075
3085
|
|
|
3076
3086
|
// ../renderers/src/step/StepRenderer.tsx
|
|
3077
|
-
var
|
|
3078
|
-
|
|
3079
|
-
// ../renderers/src/step/BackButton.tsx
|
|
3080
|
-
var import_components38 = require("@transferwise/components");
|
|
3081
|
-
var import_icons3 = require("@transferwise/icons");
|
|
3082
|
-
var import_jsx_runtime50 = require("react/jsx-runtime");
|
|
3083
|
-
function BackButton({ title, onClick }) {
|
|
3084
|
-
return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("div", { className: "m-b-2", children: /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(
|
|
3085
|
-
"button",
|
|
3086
|
-
{
|
|
3087
|
-
type: "button",
|
|
3088
|
-
className: "df-back-btn",
|
|
3089
|
-
title,
|
|
3090
|
-
"aria-label": title,
|
|
3091
|
-
onClick,
|
|
3092
|
-
children: [
|
|
3093
|
-
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)("span", { className: "sr-only", children: title }),
|
|
3094
|
-
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_components38.Avatar, { type: "icon", children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_icons3.ArrowLeft, { size: "24" }) })
|
|
3095
|
-
]
|
|
3096
|
-
}
|
|
3097
|
-
) });
|
|
3098
|
-
}
|
|
3099
|
-
var BackButton_default = BackButton;
|
|
3087
|
+
var import_react15 = require("react");
|
|
3100
3088
|
|
|
3101
3089
|
// ../renderers/src/step/ExternalConfirmationDialog.tsx
|
|
3102
3090
|
var import_react_intl15 = require("react-intl");
|
|
@@ -3127,7 +3115,7 @@ var external_confirmation_messages_default = (0, import_react_intl14.defineMessa
|
|
|
3127
3115
|
});
|
|
3128
3116
|
|
|
3129
3117
|
// ../renderers/src/step/ExternalConfirmationDialog.tsx
|
|
3130
|
-
var
|
|
3118
|
+
var import_components38 = require("@transferwise/components");
|
|
3131
3119
|
var import_jsx_runtime51 = require("react/jsx-runtime");
|
|
3132
3120
|
function ExternalConfirmationDialog({
|
|
3133
3121
|
external,
|
|
@@ -3136,10 +3124,10 @@ function ExternalConfirmationDialog({
|
|
|
3136
3124
|
const { formatMessage } = (0, import_react_intl15.useIntl)();
|
|
3137
3125
|
return /* @__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: [
|
|
3138
3126
|
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)("h2", { className: "text-xs-center m-b-5", children: formatMessage(external_confirmation_messages_default.title) }),
|
|
3139
|
-
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
3127
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_components38.Markdown, { config: { link: { target: "_blank" } }, className: "text-xs-center m-b-5", children: formatMessage(external_confirmation_messages_default.description, { origin: getOrigin(external.url) }) }),
|
|
3140
3128
|
/* @__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: [
|
|
3141
3129
|
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
3142
|
-
|
|
3130
|
+
import_components38.Button,
|
|
3143
3131
|
{
|
|
3144
3132
|
block: true,
|
|
3145
3133
|
className: "m-b-2",
|
|
@@ -3152,7 +3140,7 @@ function ExternalConfirmationDialog({
|
|
|
3152
3140
|
children: formatMessage(external_confirmation_messages_default.open)
|
|
3153
3141
|
}
|
|
3154
3142
|
),
|
|
3155
|
-
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
3143
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_components38.Button, { block: true, className: "m-b-2", priority: "tertiary", size: "md", onClick: onClose, children: formatMessage(external_confirmation_messages_default.cancel) })
|
|
3156
3144
|
] }) })
|
|
3157
3145
|
] }) });
|
|
3158
3146
|
}
|
|
@@ -3165,12 +3153,12 @@ function getOrigin(url) {
|
|
|
3165
3153
|
}
|
|
3166
3154
|
|
|
3167
3155
|
// ../renderers/src/step/useExternal.tsx
|
|
3168
|
-
var
|
|
3156
|
+
var import_react14 = require("react");
|
|
3169
3157
|
function useExternal(url) {
|
|
3170
|
-
const [externalWindow, setExternalWindow] = (0,
|
|
3171
|
-
const [hasDismissed, setHasDismissed] = (0,
|
|
3158
|
+
const [externalWindow, setExternalWindow] = (0, import_react14.useState)(null);
|
|
3159
|
+
const [hasDismissed, setHasDismissed] = (0, import_react14.useState)(false);
|
|
3172
3160
|
const dismissConfirmation = () => setHasDismissed(true);
|
|
3173
|
-
(0,
|
|
3161
|
+
(0, import_react14.useEffect)(() => {
|
|
3174
3162
|
if (url) {
|
|
3175
3163
|
setHasDismissed(false);
|
|
3176
3164
|
setExternalWindow(window.open(url, "_blank"));
|
|
@@ -3180,25 +3168,49 @@ function useExternal(url) {
|
|
|
3180
3168
|
return { requiresUserConfirmation, dismissConfirmation };
|
|
3181
3169
|
}
|
|
3182
3170
|
|
|
3183
|
-
// ../renderers/src/step/
|
|
3171
|
+
// ../renderers/src/step/BackButton.tsx
|
|
3172
|
+
var import_components39 = require("@transferwise/components");
|
|
3173
|
+
var import_icons3 = require("@transferwise/icons");
|
|
3184
3174
|
var import_jsx_runtime52 = require("react/jsx-runtime");
|
|
3175
|
+
function BackButton({ title, onClick }) {
|
|
3176
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("div", { className: "m-b-2", children: /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(
|
|
3177
|
+
"button",
|
|
3178
|
+
{
|
|
3179
|
+
type: "button",
|
|
3180
|
+
className: "df-back-btn",
|
|
3181
|
+
title,
|
|
3182
|
+
"aria-label": title,
|
|
3183
|
+
onClick,
|
|
3184
|
+
children: [
|
|
3185
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)("span", { className: "sr-only", children: title }),
|
|
3186
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_components39.Avatar, { type: "icon", children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_icons3.ArrowLeft, { size: "24" }) })
|
|
3187
|
+
]
|
|
3188
|
+
}
|
|
3189
|
+
) });
|
|
3190
|
+
}
|
|
3191
|
+
var BackButton_default = BackButton;
|
|
3192
|
+
|
|
3193
|
+
// ../renderers/src/step/StepRenderer.tsx
|
|
3194
|
+
var import_components40 = require("@transferwise/components");
|
|
3195
|
+
var import_jsx_runtime53 = require("react/jsx-runtime");
|
|
3185
3196
|
var StepRenderer = {
|
|
3186
3197
|
canRenderType: "step",
|
|
3187
3198
|
render: StepRendererComponent
|
|
3188
3199
|
};
|
|
3189
3200
|
function StepRendererComponent(props) {
|
|
3190
|
-
const { back, description, error, external, title, children } = props;
|
|
3201
|
+
const { back, description, error, external, loadingState, title, trackEvent, children } = props;
|
|
3202
|
+
const value = (0, import_react15.useMemo)(() => ({ loadingState, trackEvent }), [loadingState, trackEvent]);
|
|
3191
3203
|
const { requiresUserConfirmation, dismissConfirmation } = useExternal(external == null ? void 0 : external.url);
|
|
3192
3204
|
if ((external == null ? void 0 : external.url) && requiresUserConfirmation) {
|
|
3193
|
-
return /* @__PURE__ */ (0,
|
|
3205
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(ExternalConfirmationDialog, { external, onClose: dismissConfirmation });
|
|
3194
3206
|
}
|
|
3195
|
-
return /* @__PURE__ */ (0,
|
|
3196
|
-
back ? /* @__PURE__ */ (0,
|
|
3197
|
-
title || description ? /* @__PURE__ */ (0,
|
|
3198
|
-
title ? /* @__PURE__ */ (0,
|
|
3199
|
-
description ? /* @__PURE__ */ (0,
|
|
3207
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(StepRendererContextProvider, { value, children: [
|
|
3208
|
+
back ? /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(BackButton_default, __spreadValues({}, back)) : null,
|
|
3209
|
+
title || description ? /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("div", { className: "m-b-4", children: [
|
|
3210
|
+
title ? /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_components40.Title, { as: "h1", type: "title-section", className: "text-xs-center m-b-2", children: title }) : void 0,
|
|
3211
|
+
description ? /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("p", { className: "text-xs-center np-text-body-large", children: description }) : void 0
|
|
3200
3212
|
] }) : void 0,
|
|
3201
|
-
error ? /* @__PURE__ */ (0,
|
|
3213
|
+
error ? /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_components40.Alert, { type: "negative", className: "m-b-2", message: error }) : void 0,
|
|
3202
3214
|
children
|
|
3203
3215
|
] });
|
|
3204
3216
|
}
|
|
@@ -3238,30 +3250,30 @@ var getWiseRenderers = () => [
|
|
|
3238
3250
|
];
|
|
3239
3251
|
|
|
3240
3252
|
// src/dynamicFlow/DynamicFlow.tsx
|
|
3241
|
-
var
|
|
3253
|
+
var import_jsx_runtime54 = require("react/jsx-runtime");
|
|
3242
3254
|
var wiseRenderers = getWiseRenderers();
|
|
3243
3255
|
function DynamicFlowLegacy(props) {
|
|
3244
3256
|
const { customFetch = globalThis.fetch } = props;
|
|
3245
3257
|
const coreProps = __spreadProps(__spreadValues({}, props), { httpClient: customFetch });
|
|
3246
|
-
return /* @__PURE__ */ (0,
|
|
3258
|
+
return /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(import_dynamic_flow_client2.DynamicFlow, __spreadValues({}, coreProps));
|
|
3247
3259
|
}
|
|
3248
3260
|
function DynamicFlowRevamp(props) {
|
|
3249
3261
|
const { customFetch = globalThis.fetch, renderers, onLink = openLinkInNewTab } = props;
|
|
3250
3262
|
const httpClient = useWiseHttpClient(customFetch);
|
|
3251
|
-
const mergedRenderers = (0,
|
|
3263
|
+
const mergedRenderers = (0, import_react16.useMemo)(() => [...renderers != null ? renderers : [], ...wiseRenderers], [renderers]);
|
|
3252
3264
|
const coreProps = __spreadProps(__spreadValues({}, props), { httpClient, renderers: mergedRenderers, onLink });
|
|
3253
|
-
return /* @__PURE__ */ (0,
|
|
3265
|
+
return /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(RendererHttpClientProvider, { httpClient, children: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(import_dynamic_flow_client2.DynamicFlowCoreRevamp, __spreadValues({}, coreProps)) });
|
|
3254
3266
|
}
|
|
3255
|
-
var DynamicFragment = (0,
|
|
3267
|
+
var DynamicFragment = (0, import_react16.forwardRef)(function DynamicFragment2(props, ref) {
|
|
3256
3268
|
const { customFetch = globalThis.fetch, renderers, onLink = openLinkInNewTab } = props;
|
|
3257
3269
|
const httpClient = useWiseHttpClient(customFetch);
|
|
3258
|
-
const mergedRenderers = (0,
|
|
3270
|
+
const mergedRenderers = (0, import_react16.useMemo)(() => [...renderers != null ? renderers : [], ...wiseRenderers], [renderers]);
|
|
3259
3271
|
const coreProps = __spreadProps(__spreadValues({}, props), { httpClient, renderers: mergedRenderers, onLink });
|
|
3260
|
-
return /* @__PURE__ */ (0,
|
|
3272
|
+
return /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(RendererHttpClientProvider, { httpClient, children: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(import_dynamic_flow_client2.DynamicFragmentCore, __spreadProps(__spreadValues({}, coreProps), { ref })) });
|
|
3261
3273
|
});
|
|
3262
3274
|
var useWiseHttpClient = (httpClient) => {
|
|
3263
3275
|
const { locale } = (0, import_react_intl16.useIntl)();
|
|
3264
|
-
return (0,
|
|
3276
|
+
return (0, import_react16.useCallback)(
|
|
3265
3277
|
async (input, init = {}) => {
|
|
3266
3278
|
const headers = new Headers(init.headers);
|
|
3267
3279
|
headers.set("accept-language", locale);
|