@wise/dynamic-flow-client-internal 5.24.0-experimental-9265cac → 5.24.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/i18n/ar.json +45 -0
- package/build/i18n/ko.json +45 -0
- package/build/main.js +723 -1930
- package/build/main.mjs +637 -1844
- package/build/tsconfig.types.tsbuildinfo +1 -1
- package/build/types/dynamicFlow/DynamicFlowWithRef.d.ts +2 -2
- package/build/types/dynamicFlow/DynamicFlowWithRef.d.ts.map +1 -1
- package/build/types/dynamicFlow/context-menu/useDFContextMenu.d.ts +1 -1
- package/build/types/dynamicFlow/context-menu/useDFContextMenu.d.ts.map +1 -1
- package/package.json +6 -6
package/build/main.mjs
CHANGED
|
@@ -127,7 +127,7 @@ import { useDynamicFlow } from "@wise/dynamic-flow-client";
|
|
|
127
127
|
// src/dynamicFlow/telemetry/app-version.ts
|
|
128
128
|
var appVersion = (
|
|
129
129
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
|
130
|
-
typeof process !== "undefined" ? "5.
|
|
130
|
+
typeof process !== "undefined" ? "5.24.0" : "0.0.0"
|
|
131
131
|
);
|
|
132
132
|
|
|
133
133
|
// src/dynamicFlow/context-menu/useContextMenu.tsx
|
|
@@ -191,7 +191,7 @@ var useDFContextMenu = (controller) => {
|
|
|
191
191
|
if (!step) {
|
|
192
192
|
return null;
|
|
193
193
|
}
|
|
194
|
-
const model =
|
|
194
|
+
const model = controller.getValue();
|
|
195
195
|
return recursivelyRemoveNullish(__spreadProps(__spreadValues({}, step), { model }));
|
|
196
196
|
};
|
|
197
197
|
const getEncodedCurrentStep = () => {
|
|
@@ -311,7 +311,7 @@ var recursivelyRemoveNullish = (element) => {
|
|
|
311
311
|
};
|
|
312
312
|
|
|
313
313
|
// src/dynamicFlow/useWiseToCoreProps.tsx
|
|
314
|
-
import { useMemo as
|
|
314
|
+
import { useMemo as useMemo2 } from "react";
|
|
315
315
|
|
|
316
316
|
// src/dynamicFlow/getMergedRenderers.tsx
|
|
317
317
|
import { getDynamicSubflowRenderer } from "@wise/dynamic-flow-client";
|
|
@@ -356,7 +356,7 @@ var AlertRenderer = {
|
|
|
356
356
|
render: ({ context, markdown, margin, callToAction }) => /* @__PURE__ */ jsx2(
|
|
357
357
|
Alert,
|
|
358
358
|
{
|
|
359
|
-
type: context,
|
|
359
|
+
type: mapAlertType(context),
|
|
360
360
|
className: getMargin(margin),
|
|
361
361
|
message: markdown,
|
|
362
362
|
action: mapCtaToAlertAction(callToAction)
|
|
@@ -372,6 +372,7 @@ var mapCtaToAlertAction = (callToAction) => {
|
|
|
372
372
|
}
|
|
373
373
|
return void 0;
|
|
374
374
|
};
|
|
375
|
+
var mapAlertType = (context) => context !== "proposition" ? context : "neutral";
|
|
375
376
|
var AlertRenderer_default = AlertRenderer;
|
|
376
377
|
|
|
377
378
|
// ../renderers/src/BoxRenderer.tsx
|
|
@@ -1104,1384 +1105,18 @@ var getInlineAlertOrValidation = (validationState, inlineAlert) => {
|
|
|
1104
1105
|
};
|
|
1105
1106
|
var CheckboxInputRenderer_default = CheckboxInputRenderer;
|
|
1106
1107
|
|
|
1107
|
-
// ../renderers/src/CollectionRenderer/CollectionRenderer.tsx
|
|
1108
|
-
import { InlinePrompt, Link as DSLink } from "@transferwise/components";
|
|
1109
|
-
|
|
1110
|
-
// ../../node_modules/.pnpm/@tanstack+react-virtual@3.13.24_react-dom@19.2.7_react@19.2.7__react@19.2.7/node_modules/@tanstack/react-virtual/dist/esm/index.js
|
|
1111
|
-
import * as React from "react";
|
|
1112
|
-
import { flushSync } from "react-dom";
|
|
1113
|
-
|
|
1114
|
-
// ../../node_modules/.pnpm/@tanstack+virtual-core@3.14.0/node_modules/@tanstack/virtual-core/dist/esm/utils.js
|
|
1115
|
-
function memo(getDeps, fn, opts) {
|
|
1116
|
-
var _a;
|
|
1117
|
-
let deps = (_a = opts.initialDeps) != null ? _a : [];
|
|
1118
|
-
let result;
|
|
1119
|
-
let isInitial = true;
|
|
1120
|
-
function memoizedFunction() {
|
|
1121
|
-
var _a2, _b, _c;
|
|
1122
|
-
let depTime;
|
|
1123
|
-
if (opts.key && ((_a2 = opts.debug) == null ? void 0 : _a2.call(opts))) depTime = Date.now();
|
|
1124
|
-
const newDeps = getDeps();
|
|
1125
|
-
const depsChanged = newDeps.length !== deps.length || newDeps.some((dep, index) => deps[index] !== dep);
|
|
1126
|
-
if (!depsChanged) {
|
|
1127
|
-
return result;
|
|
1128
|
-
}
|
|
1129
|
-
deps = newDeps;
|
|
1130
|
-
let resultTime;
|
|
1131
|
-
if (opts.key && ((_b = opts.debug) == null ? void 0 : _b.call(opts))) resultTime = Date.now();
|
|
1132
|
-
result = fn(...newDeps);
|
|
1133
|
-
if (opts.key && ((_c = opts.debug) == null ? void 0 : _c.call(opts))) {
|
|
1134
|
-
const depEndTime = Math.round((Date.now() - depTime) * 100) / 100;
|
|
1135
|
-
const resultEndTime = Math.round((Date.now() - resultTime) * 100) / 100;
|
|
1136
|
-
const resultFpsPercentage = resultEndTime / 16;
|
|
1137
|
-
const pad = (str, num) => {
|
|
1138
|
-
str = String(str);
|
|
1139
|
-
while (str.length < num) {
|
|
1140
|
-
str = " " + str;
|
|
1141
|
-
}
|
|
1142
|
-
return str;
|
|
1143
|
-
};
|
|
1144
|
-
console.info(
|
|
1145
|
-
`%c\u23F1 ${pad(resultEndTime, 5)} /${pad(depEndTime, 5)} ms`,
|
|
1146
|
-
`
|
|
1147
|
-
font-size: .6rem;
|
|
1148
|
-
font-weight: bold;
|
|
1149
|
-
color: hsl(${Math.max(
|
|
1150
|
-
0,
|
|
1151
|
-
Math.min(120 - 120 * resultFpsPercentage, 120)
|
|
1152
|
-
)}deg 100% 31%);`,
|
|
1153
|
-
opts == null ? void 0 : opts.key
|
|
1154
|
-
);
|
|
1155
|
-
}
|
|
1156
|
-
if ((opts == null ? void 0 : opts.onChange) && !(isInitial && opts.skipInitialOnChange)) {
|
|
1157
|
-
opts.onChange(result);
|
|
1158
|
-
}
|
|
1159
|
-
isInitial = false;
|
|
1160
|
-
return result;
|
|
1161
|
-
}
|
|
1162
|
-
memoizedFunction.updateDeps = (newDeps) => {
|
|
1163
|
-
deps = newDeps;
|
|
1164
|
-
};
|
|
1165
|
-
return memoizedFunction;
|
|
1166
|
-
}
|
|
1167
|
-
function notUndefined(value, msg) {
|
|
1168
|
-
if (value === void 0) {
|
|
1169
|
-
throw new Error(`Unexpected undefined${msg ? `: ${msg}` : ""}`);
|
|
1170
|
-
} else {
|
|
1171
|
-
return value;
|
|
1172
|
-
}
|
|
1173
|
-
}
|
|
1174
|
-
var approxEqual = (a, b) => Math.abs(a - b) < 1.01;
|
|
1175
|
-
var debounce = (targetWindow, fn, ms) => {
|
|
1176
|
-
let timeoutId;
|
|
1177
|
-
return function(...args) {
|
|
1178
|
-
targetWindow.clearTimeout(timeoutId);
|
|
1179
|
-
timeoutId = targetWindow.setTimeout(() => fn.apply(this, args), ms);
|
|
1180
|
-
};
|
|
1181
|
-
};
|
|
1182
|
-
|
|
1183
|
-
// ../../node_modules/.pnpm/@tanstack+virtual-core@3.14.0/node_modules/@tanstack/virtual-core/dist/esm/index.js
|
|
1184
|
-
var defaultKeyExtractor = (index) => index;
|
|
1185
|
-
var defaultRangeExtractor = (range) => {
|
|
1186
|
-
const start = Math.max(range.startIndex - range.overscan, 0);
|
|
1187
|
-
const end = Math.min(range.endIndex + range.overscan, range.count - 1);
|
|
1188
|
-
const arr = [];
|
|
1189
|
-
for (let i = start; i <= end; i++) {
|
|
1190
|
-
arr.push(i);
|
|
1191
|
-
}
|
|
1192
|
-
return arr;
|
|
1193
|
-
};
|
|
1194
|
-
var addEventListenerOptions = {
|
|
1195
|
-
passive: true
|
|
1196
|
-
};
|
|
1197
|
-
var observeWindowRect = (instance, cb) => {
|
|
1198
|
-
const element = instance.scrollElement;
|
|
1199
|
-
if (!element) {
|
|
1200
|
-
return;
|
|
1201
|
-
}
|
|
1202
|
-
const handler = () => {
|
|
1203
|
-
cb({ width: element.innerWidth, height: element.innerHeight });
|
|
1204
|
-
};
|
|
1205
|
-
handler();
|
|
1206
|
-
element.addEventListener("resize", handler, addEventListenerOptions);
|
|
1207
|
-
return () => {
|
|
1208
|
-
element.removeEventListener("resize", handler);
|
|
1209
|
-
};
|
|
1210
|
-
};
|
|
1211
|
-
var supportsScrollend = typeof window == "undefined" ? true : "onscrollend" in window;
|
|
1212
|
-
var observeWindowOffset = (instance, cb) => {
|
|
1213
|
-
const element = instance.scrollElement;
|
|
1214
|
-
if (!element) {
|
|
1215
|
-
return;
|
|
1216
|
-
}
|
|
1217
|
-
const targetWindow = instance.targetWindow;
|
|
1218
|
-
if (!targetWindow) {
|
|
1219
|
-
return;
|
|
1220
|
-
}
|
|
1221
|
-
let offset = 0;
|
|
1222
|
-
const fallback = instance.options.useScrollendEvent && supportsScrollend ? () => void 0 : debounce(
|
|
1223
|
-
targetWindow,
|
|
1224
|
-
() => {
|
|
1225
|
-
cb(offset, false);
|
|
1226
|
-
},
|
|
1227
|
-
instance.options.isScrollingResetDelay
|
|
1228
|
-
);
|
|
1229
|
-
const createHandler = (isScrolling) => () => {
|
|
1230
|
-
offset = element[instance.options.horizontal ? "scrollX" : "scrollY"];
|
|
1231
|
-
fallback();
|
|
1232
|
-
cb(offset, isScrolling);
|
|
1233
|
-
};
|
|
1234
|
-
const handler = createHandler(true);
|
|
1235
|
-
const endHandler = createHandler(false);
|
|
1236
|
-
element.addEventListener("scroll", handler, addEventListenerOptions);
|
|
1237
|
-
const registerScrollendEvent = instance.options.useScrollendEvent && supportsScrollend;
|
|
1238
|
-
if (registerScrollendEvent) {
|
|
1239
|
-
element.addEventListener("scrollend", endHandler, addEventListenerOptions);
|
|
1240
|
-
}
|
|
1241
|
-
return () => {
|
|
1242
|
-
element.removeEventListener("scroll", handler);
|
|
1243
|
-
if (registerScrollendEvent) {
|
|
1244
|
-
element.removeEventListener("scrollend", endHandler);
|
|
1245
|
-
}
|
|
1246
|
-
};
|
|
1247
|
-
};
|
|
1248
|
-
var measureElement = (element, entry, instance) => {
|
|
1249
|
-
if (entry == null ? void 0 : entry.borderBoxSize) {
|
|
1250
|
-
const box = entry.borderBoxSize[0];
|
|
1251
|
-
if (box) {
|
|
1252
|
-
const size = Math.round(
|
|
1253
|
-
box[instance.options.horizontal ? "inlineSize" : "blockSize"]
|
|
1254
|
-
);
|
|
1255
|
-
return size;
|
|
1256
|
-
}
|
|
1257
|
-
}
|
|
1258
|
-
return element[instance.options.horizontal ? "offsetWidth" : "offsetHeight"];
|
|
1259
|
-
};
|
|
1260
|
-
var windowScroll = (offset, {
|
|
1261
|
-
adjustments = 0,
|
|
1262
|
-
behavior
|
|
1263
|
-
}, instance) => {
|
|
1264
|
-
var _a, _b;
|
|
1265
|
-
const toOffset = offset + adjustments;
|
|
1266
|
-
(_b = (_a = instance.scrollElement) == null ? void 0 : _a.scrollTo) == null ? void 0 : _b.call(_a, {
|
|
1267
|
-
[instance.options.horizontal ? "left" : "top"]: toOffset,
|
|
1268
|
-
behavior
|
|
1269
|
-
});
|
|
1270
|
-
};
|
|
1271
|
-
var Virtualizer = class {
|
|
1272
|
-
constructor(opts) {
|
|
1273
|
-
this.unsubs = [];
|
|
1274
|
-
this.scrollElement = null;
|
|
1275
|
-
this.targetWindow = null;
|
|
1276
|
-
this.isScrolling = false;
|
|
1277
|
-
this.scrollState = null;
|
|
1278
|
-
this.measurementsCache = [];
|
|
1279
|
-
this.itemSizeCache = /* @__PURE__ */ new Map();
|
|
1280
|
-
this.laneAssignments = /* @__PURE__ */ new Map();
|
|
1281
|
-
this.pendingMeasuredCacheIndexes = [];
|
|
1282
|
-
this.prevLanes = void 0;
|
|
1283
|
-
this.lanesChangedFlag = false;
|
|
1284
|
-
this.lanesSettling = false;
|
|
1285
|
-
this.scrollRect = null;
|
|
1286
|
-
this.scrollOffset = null;
|
|
1287
|
-
this.scrollDirection = null;
|
|
1288
|
-
this.scrollAdjustments = 0;
|
|
1289
|
-
this.elementsCache = /* @__PURE__ */ new Map();
|
|
1290
|
-
this.now = () => {
|
|
1291
|
-
var _a2;
|
|
1292
|
-
var _a, _b, _c;
|
|
1293
|
-
return (_a2 = (_c = (_b = (_a = this.targetWindow) == null ? void 0 : _a.performance) == null ? void 0 : _b.now) == null ? void 0 : _c.call(_b)) != null ? _a2 : Date.now();
|
|
1294
|
-
};
|
|
1295
|
-
this.observer = /* @__PURE__ */ (() => {
|
|
1296
|
-
let _ro = null;
|
|
1297
|
-
const get = () => {
|
|
1298
|
-
if (_ro) {
|
|
1299
|
-
return _ro;
|
|
1300
|
-
}
|
|
1301
|
-
if (!this.targetWindow || !this.targetWindow.ResizeObserver) {
|
|
1302
|
-
return null;
|
|
1303
|
-
}
|
|
1304
|
-
return _ro = new this.targetWindow.ResizeObserver((entries) => {
|
|
1305
|
-
entries.forEach((entry) => {
|
|
1306
|
-
const run = () => {
|
|
1307
|
-
const node = entry.target;
|
|
1308
|
-
const index = this.indexFromElement(node);
|
|
1309
|
-
if (!node.isConnected) {
|
|
1310
|
-
this.observer.unobserve(node);
|
|
1311
|
-
return;
|
|
1312
|
-
}
|
|
1313
|
-
if (this.shouldMeasureDuringScroll(index)) {
|
|
1314
|
-
this.resizeItem(
|
|
1315
|
-
index,
|
|
1316
|
-
this.options.measureElement(node, entry, this)
|
|
1317
|
-
);
|
|
1318
|
-
}
|
|
1319
|
-
};
|
|
1320
|
-
this.options.useAnimationFrameWithResizeObserver ? requestAnimationFrame(run) : run();
|
|
1321
|
-
});
|
|
1322
|
-
});
|
|
1323
|
-
};
|
|
1324
|
-
return {
|
|
1325
|
-
disconnect: () => {
|
|
1326
|
-
var _a;
|
|
1327
|
-
(_a = get()) == null ? void 0 : _a.disconnect();
|
|
1328
|
-
_ro = null;
|
|
1329
|
-
},
|
|
1330
|
-
observe: (target) => {
|
|
1331
|
-
var _a;
|
|
1332
|
-
return (_a = get()) == null ? void 0 : _a.observe(target, { box: "border-box" });
|
|
1333
|
-
},
|
|
1334
|
-
unobserve: (target) => {
|
|
1335
|
-
var _a;
|
|
1336
|
-
return (_a = get()) == null ? void 0 : _a.unobserve(target);
|
|
1337
|
-
}
|
|
1338
|
-
};
|
|
1339
|
-
})();
|
|
1340
|
-
this.range = null;
|
|
1341
|
-
this.setOptions = (opts2) => {
|
|
1342
|
-
Object.entries(opts2).forEach(([key, value]) => {
|
|
1343
|
-
if (typeof value === "undefined") delete opts2[key];
|
|
1344
|
-
});
|
|
1345
|
-
this.options = __spreadValues({
|
|
1346
|
-
debug: false,
|
|
1347
|
-
initialOffset: 0,
|
|
1348
|
-
overscan: 1,
|
|
1349
|
-
paddingStart: 0,
|
|
1350
|
-
paddingEnd: 0,
|
|
1351
|
-
scrollPaddingStart: 0,
|
|
1352
|
-
scrollPaddingEnd: 0,
|
|
1353
|
-
horizontal: false,
|
|
1354
|
-
getItemKey: defaultKeyExtractor,
|
|
1355
|
-
rangeExtractor: defaultRangeExtractor,
|
|
1356
|
-
onChange: () => {
|
|
1357
|
-
},
|
|
1358
|
-
measureElement,
|
|
1359
|
-
initialRect: { width: 0, height: 0 },
|
|
1360
|
-
scrollMargin: 0,
|
|
1361
|
-
gap: 0,
|
|
1362
|
-
indexAttribute: "data-index",
|
|
1363
|
-
initialMeasurementsCache: [],
|
|
1364
|
-
lanes: 1,
|
|
1365
|
-
isScrollingResetDelay: 150,
|
|
1366
|
-
enabled: true,
|
|
1367
|
-
isRtl: false,
|
|
1368
|
-
useScrollendEvent: false,
|
|
1369
|
-
useAnimationFrameWithResizeObserver: false,
|
|
1370
|
-
laneAssignmentMode: "estimate"
|
|
1371
|
-
}, opts2);
|
|
1372
|
-
};
|
|
1373
|
-
this.notify = (sync) => {
|
|
1374
|
-
var _a, _b;
|
|
1375
|
-
(_b = (_a = this.options).onChange) == null ? void 0 : _b.call(_a, this, sync);
|
|
1376
|
-
};
|
|
1377
|
-
this.maybeNotify = memo(
|
|
1378
|
-
() => {
|
|
1379
|
-
this.calculateRange();
|
|
1380
|
-
return [
|
|
1381
|
-
this.isScrolling,
|
|
1382
|
-
this.range ? this.range.startIndex : null,
|
|
1383
|
-
this.range ? this.range.endIndex : null
|
|
1384
|
-
];
|
|
1385
|
-
},
|
|
1386
|
-
(isScrolling) => {
|
|
1387
|
-
this.notify(isScrolling);
|
|
1388
|
-
},
|
|
1389
|
-
{
|
|
1390
|
-
key: "maybeNotify",
|
|
1391
|
-
debug: () => this.options.debug,
|
|
1392
|
-
initialDeps: [
|
|
1393
|
-
this.isScrolling,
|
|
1394
|
-
this.range ? this.range.startIndex : null,
|
|
1395
|
-
this.range ? this.range.endIndex : null
|
|
1396
|
-
]
|
|
1397
|
-
}
|
|
1398
|
-
);
|
|
1399
|
-
this.cleanup = () => {
|
|
1400
|
-
this.unsubs.filter(Boolean).forEach((d) => d());
|
|
1401
|
-
this.unsubs = [];
|
|
1402
|
-
this.observer.disconnect();
|
|
1403
|
-
if (this.rafId != null && this.targetWindow) {
|
|
1404
|
-
this.targetWindow.cancelAnimationFrame(this.rafId);
|
|
1405
|
-
this.rafId = null;
|
|
1406
|
-
}
|
|
1407
|
-
this.scrollState = null;
|
|
1408
|
-
this.scrollElement = null;
|
|
1409
|
-
this.targetWindow = null;
|
|
1410
|
-
};
|
|
1411
|
-
this._didMount = () => {
|
|
1412
|
-
return () => {
|
|
1413
|
-
this.cleanup();
|
|
1414
|
-
};
|
|
1415
|
-
};
|
|
1416
|
-
this._willUpdate = () => {
|
|
1417
|
-
var _a2;
|
|
1418
|
-
var _a;
|
|
1419
|
-
const scrollElement = this.options.enabled ? this.options.getScrollElement() : null;
|
|
1420
|
-
if (this.scrollElement !== scrollElement) {
|
|
1421
|
-
this.cleanup();
|
|
1422
|
-
if (!scrollElement) {
|
|
1423
|
-
this.maybeNotify();
|
|
1424
|
-
return;
|
|
1425
|
-
}
|
|
1426
|
-
this.scrollElement = scrollElement;
|
|
1427
|
-
if (this.scrollElement && "ownerDocument" in this.scrollElement) {
|
|
1428
|
-
this.targetWindow = this.scrollElement.ownerDocument.defaultView;
|
|
1429
|
-
} else {
|
|
1430
|
-
this.targetWindow = (_a2 = (_a = this.scrollElement) == null ? void 0 : _a.window) != null ? _a2 : null;
|
|
1431
|
-
}
|
|
1432
|
-
this.elementsCache.forEach((cached) => {
|
|
1433
|
-
this.observer.observe(cached);
|
|
1434
|
-
});
|
|
1435
|
-
this.unsubs.push(
|
|
1436
|
-
this.options.observeElementRect(this, (rect) => {
|
|
1437
|
-
this.scrollRect = rect;
|
|
1438
|
-
this.maybeNotify();
|
|
1439
|
-
})
|
|
1440
|
-
);
|
|
1441
|
-
this.unsubs.push(
|
|
1442
|
-
this.options.observeElementOffset(this, (offset, isScrolling) => {
|
|
1443
|
-
this.scrollAdjustments = 0;
|
|
1444
|
-
this.scrollDirection = isScrolling ? this.getScrollOffset() < offset ? "forward" : "backward" : null;
|
|
1445
|
-
this.scrollOffset = offset;
|
|
1446
|
-
this.isScrolling = isScrolling;
|
|
1447
|
-
if (this.scrollState) {
|
|
1448
|
-
this.scheduleScrollReconcile();
|
|
1449
|
-
}
|
|
1450
|
-
this.maybeNotify();
|
|
1451
|
-
})
|
|
1452
|
-
);
|
|
1453
|
-
this._scrollToOffset(this.getScrollOffset(), {
|
|
1454
|
-
adjustments: void 0,
|
|
1455
|
-
behavior: void 0
|
|
1456
|
-
});
|
|
1457
|
-
}
|
|
1458
|
-
};
|
|
1459
|
-
this.rafId = null;
|
|
1460
|
-
this.getSize = () => {
|
|
1461
|
-
var _a;
|
|
1462
|
-
if (!this.options.enabled) {
|
|
1463
|
-
this.scrollRect = null;
|
|
1464
|
-
return 0;
|
|
1465
|
-
}
|
|
1466
|
-
this.scrollRect = (_a = this.scrollRect) != null ? _a : this.options.initialRect;
|
|
1467
|
-
return this.scrollRect[this.options.horizontal ? "width" : "height"];
|
|
1468
|
-
};
|
|
1469
|
-
this.getScrollOffset = () => {
|
|
1470
|
-
var _a;
|
|
1471
|
-
if (!this.options.enabled) {
|
|
1472
|
-
this.scrollOffset = null;
|
|
1473
|
-
return 0;
|
|
1474
|
-
}
|
|
1475
|
-
this.scrollOffset = (_a = this.scrollOffset) != null ? _a : typeof this.options.initialOffset === "function" ? this.options.initialOffset() : this.options.initialOffset;
|
|
1476
|
-
return this.scrollOffset;
|
|
1477
|
-
};
|
|
1478
|
-
this.getFurthestMeasurement = (measurements, index) => {
|
|
1479
|
-
const furthestMeasurementsFound = /* @__PURE__ */ new Map();
|
|
1480
|
-
const furthestMeasurements = /* @__PURE__ */ new Map();
|
|
1481
|
-
for (let m = index - 1; m >= 0; m--) {
|
|
1482
|
-
const measurement = measurements[m];
|
|
1483
|
-
if (furthestMeasurementsFound.has(measurement.lane)) {
|
|
1484
|
-
continue;
|
|
1485
|
-
}
|
|
1486
|
-
const previousFurthestMeasurement = furthestMeasurements.get(
|
|
1487
|
-
measurement.lane
|
|
1488
|
-
);
|
|
1489
|
-
if (previousFurthestMeasurement == null || measurement.end > previousFurthestMeasurement.end) {
|
|
1490
|
-
furthestMeasurements.set(measurement.lane, measurement);
|
|
1491
|
-
} else if (measurement.end < previousFurthestMeasurement.end) {
|
|
1492
|
-
furthestMeasurementsFound.set(measurement.lane, true);
|
|
1493
|
-
}
|
|
1494
|
-
if (furthestMeasurementsFound.size === this.options.lanes) {
|
|
1495
|
-
break;
|
|
1496
|
-
}
|
|
1497
|
-
}
|
|
1498
|
-
return furthestMeasurements.size === this.options.lanes ? Array.from(furthestMeasurements.values()).sort((a, b) => {
|
|
1499
|
-
if (a.end === b.end) {
|
|
1500
|
-
return a.index - b.index;
|
|
1501
|
-
}
|
|
1502
|
-
return a.end - b.end;
|
|
1503
|
-
})[0] : void 0;
|
|
1504
|
-
};
|
|
1505
|
-
this.getMeasurementOptions = memo(
|
|
1506
|
-
() => [
|
|
1507
|
-
this.options.count,
|
|
1508
|
-
this.options.paddingStart,
|
|
1509
|
-
this.options.scrollMargin,
|
|
1510
|
-
this.options.getItemKey,
|
|
1511
|
-
this.options.enabled,
|
|
1512
|
-
this.options.lanes,
|
|
1513
|
-
this.options.laneAssignmentMode
|
|
1514
|
-
],
|
|
1515
|
-
(count, paddingStart, scrollMargin, getItemKey, enabled, lanes, laneAssignmentMode) => {
|
|
1516
|
-
const lanesChanged = this.prevLanes !== void 0 && this.prevLanes !== lanes;
|
|
1517
|
-
if (lanesChanged) {
|
|
1518
|
-
this.lanesChangedFlag = true;
|
|
1519
|
-
}
|
|
1520
|
-
this.prevLanes = lanes;
|
|
1521
|
-
this.pendingMeasuredCacheIndexes = [];
|
|
1522
|
-
return {
|
|
1523
|
-
count,
|
|
1524
|
-
paddingStart,
|
|
1525
|
-
scrollMargin,
|
|
1526
|
-
getItemKey,
|
|
1527
|
-
enabled,
|
|
1528
|
-
lanes,
|
|
1529
|
-
laneAssignmentMode
|
|
1530
|
-
};
|
|
1531
|
-
},
|
|
1532
|
-
{
|
|
1533
|
-
key: false
|
|
1534
|
-
}
|
|
1535
|
-
);
|
|
1536
|
-
this.getMeasurements = memo(
|
|
1537
|
-
() => [this.getMeasurementOptions(), this.itemSizeCache],
|
|
1538
|
-
({
|
|
1539
|
-
count,
|
|
1540
|
-
paddingStart,
|
|
1541
|
-
scrollMargin,
|
|
1542
|
-
getItemKey,
|
|
1543
|
-
enabled,
|
|
1544
|
-
lanes,
|
|
1545
|
-
laneAssignmentMode
|
|
1546
|
-
}, itemSizeCache) => {
|
|
1547
|
-
if (!enabled) {
|
|
1548
|
-
this.measurementsCache = [];
|
|
1549
|
-
this.itemSizeCache.clear();
|
|
1550
|
-
this.laneAssignments.clear();
|
|
1551
|
-
return [];
|
|
1552
|
-
}
|
|
1553
|
-
if (this.laneAssignments.size > count) {
|
|
1554
|
-
for (const index of this.laneAssignments.keys()) {
|
|
1555
|
-
if (index >= count) {
|
|
1556
|
-
this.laneAssignments.delete(index);
|
|
1557
|
-
}
|
|
1558
|
-
}
|
|
1559
|
-
}
|
|
1560
|
-
if (this.lanesChangedFlag) {
|
|
1561
|
-
this.lanesChangedFlag = false;
|
|
1562
|
-
this.lanesSettling = true;
|
|
1563
|
-
this.measurementsCache = [];
|
|
1564
|
-
this.itemSizeCache.clear();
|
|
1565
|
-
this.laneAssignments.clear();
|
|
1566
|
-
this.pendingMeasuredCacheIndexes = [];
|
|
1567
|
-
}
|
|
1568
|
-
if (this.measurementsCache.length === 0 && !this.lanesSettling) {
|
|
1569
|
-
this.measurementsCache = this.options.initialMeasurementsCache;
|
|
1570
|
-
this.measurementsCache.forEach((item) => {
|
|
1571
|
-
this.itemSizeCache.set(item.key, item.size);
|
|
1572
|
-
});
|
|
1573
|
-
}
|
|
1574
|
-
const min = this.lanesSettling ? 0 : this.pendingMeasuredCacheIndexes.length > 0 ? Math.min(...this.pendingMeasuredCacheIndexes) : 0;
|
|
1575
|
-
this.pendingMeasuredCacheIndexes = [];
|
|
1576
|
-
if (this.lanesSettling && this.measurementsCache.length === count) {
|
|
1577
|
-
this.lanesSettling = false;
|
|
1578
|
-
}
|
|
1579
|
-
const measurements = this.measurementsCache.slice(0, min);
|
|
1580
|
-
const laneLastIndex = new Array(lanes).fill(
|
|
1581
|
-
void 0
|
|
1582
|
-
);
|
|
1583
|
-
for (let m = 0; m < min; m++) {
|
|
1584
|
-
const item = measurements[m];
|
|
1585
|
-
if (item) {
|
|
1586
|
-
laneLastIndex[item.lane] = m;
|
|
1587
|
-
}
|
|
1588
|
-
}
|
|
1589
|
-
for (let i = min; i < count; i++) {
|
|
1590
|
-
const key = getItemKey(i);
|
|
1591
|
-
const cachedLane = this.laneAssignments.get(i);
|
|
1592
|
-
let lane;
|
|
1593
|
-
let start;
|
|
1594
|
-
const shouldCacheLane = laneAssignmentMode === "estimate" || itemSizeCache.has(key);
|
|
1595
|
-
if (cachedLane !== void 0 && this.options.lanes > 1) {
|
|
1596
|
-
lane = cachedLane;
|
|
1597
|
-
const prevIndex = laneLastIndex[lane];
|
|
1598
|
-
const prevInLane = prevIndex !== void 0 ? measurements[prevIndex] : void 0;
|
|
1599
|
-
start = prevInLane ? prevInLane.end + this.options.gap : paddingStart + scrollMargin;
|
|
1600
|
-
} else {
|
|
1601
|
-
const furthestMeasurement = this.options.lanes === 1 ? measurements[i - 1] : this.getFurthestMeasurement(measurements, i);
|
|
1602
|
-
start = furthestMeasurement ? furthestMeasurement.end + this.options.gap : paddingStart + scrollMargin;
|
|
1603
|
-
lane = furthestMeasurement ? furthestMeasurement.lane : i % this.options.lanes;
|
|
1604
|
-
if (this.options.lanes > 1 && shouldCacheLane) {
|
|
1605
|
-
this.laneAssignments.set(i, lane);
|
|
1606
|
-
}
|
|
1607
|
-
}
|
|
1608
|
-
const measuredSize = itemSizeCache.get(key);
|
|
1609
|
-
const size = typeof measuredSize === "number" ? measuredSize : this.options.estimateSize(i);
|
|
1610
|
-
const end = start + size;
|
|
1611
|
-
measurements[i] = {
|
|
1612
|
-
index: i,
|
|
1613
|
-
start,
|
|
1614
|
-
size,
|
|
1615
|
-
end,
|
|
1616
|
-
key,
|
|
1617
|
-
lane
|
|
1618
|
-
};
|
|
1619
|
-
laneLastIndex[lane] = i;
|
|
1620
|
-
}
|
|
1621
|
-
this.measurementsCache = measurements;
|
|
1622
|
-
return measurements;
|
|
1623
|
-
},
|
|
1624
|
-
{
|
|
1625
|
-
key: "getMeasurements",
|
|
1626
|
-
debug: () => this.options.debug
|
|
1627
|
-
}
|
|
1628
|
-
);
|
|
1629
|
-
this.calculateRange = memo(
|
|
1630
|
-
() => [
|
|
1631
|
-
this.getMeasurements(),
|
|
1632
|
-
this.getSize(),
|
|
1633
|
-
this.getScrollOffset(),
|
|
1634
|
-
this.options.lanes
|
|
1635
|
-
],
|
|
1636
|
-
(measurements, outerSize, scrollOffset, lanes) => {
|
|
1637
|
-
return this.range = measurements.length > 0 && outerSize > 0 ? calculateRange({
|
|
1638
|
-
measurements,
|
|
1639
|
-
outerSize,
|
|
1640
|
-
scrollOffset,
|
|
1641
|
-
lanes
|
|
1642
|
-
}) : null;
|
|
1643
|
-
},
|
|
1644
|
-
{
|
|
1645
|
-
key: "calculateRange",
|
|
1646
|
-
debug: () => this.options.debug
|
|
1647
|
-
}
|
|
1648
|
-
);
|
|
1649
|
-
this.getVirtualIndexes = memo(
|
|
1650
|
-
() => {
|
|
1651
|
-
let startIndex = null;
|
|
1652
|
-
let endIndex = null;
|
|
1653
|
-
const range = this.calculateRange();
|
|
1654
|
-
if (range) {
|
|
1655
|
-
startIndex = range.startIndex;
|
|
1656
|
-
endIndex = range.endIndex;
|
|
1657
|
-
}
|
|
1658
|
-
this.maybeNotify.updateDeps([this.isScrolling, startIndex, endIndex]);
|
|
1659
|
-
return [
|
|
1660
|
-
this.options.rangeExtractor,
|
|
1661
|
-
this.options.overscan,
|
|
1662
|
-
this.options.count,
|
|
1663
|
-
startIndex,
|
|
1664
|
-
endIndex
|
|
1665
|
-
];
|
|
1666
|
-
},
|
|
1667
|
-
(rangeExtractor, overscan, count, startIndex, endIndex) => {
|
|
1668
|
-
return startIndex === null || endIndex === null ? [] : rangeExtractor({
|
|
1669
|
-
startIndex,
|
|
1670
|
-
endIndex,
|
|
1671
|
-
overscan,
|
|
1672
|
-
count
|
|
1673
|
-
});
|
|
1674
|
-
},
|
|
1675
|
-
{
|
|
1676
|
-
key: "getVirtualIndexes",
|
|
1677
|
-
debug: () => this.options.debug
|
|
1678
|
-
}
|
|
1679
|
-
);
|
|
1680
|
-
this.indexFromElement = (node) => {
|
|
1681
|
-
const attributeName = this.options.indexAttribute;
|
|
1682
|
-
const indexStr = node.getAttribute(attributeName);
|
|
1683
|
-
if (!indexStr) {
|
|
1684
|
-
console.warn(
|
|
1685
|
-
`Missing attribute name '${attributeName}={index}' on measured element.`
|
|
1686
|
-
);
|
|
1687
|
-
return -1;
|
|
1688
|
-
}
|
|
1689
|
-
return parseInt(indexStr, 10);
|
|
1690
|
-
};
|
|
1691
|
-
this.shouldMeasureDuringScroll = (index) => {
|
|
1692
|
-
var _a2;
|
|
1693
|
-
var _a;
|
|
1694
|
-
if (!this.scrollState || this.scrollState.behavior !== "smooth") {
|
|
1695
|
-
return true;
|
|
1696
|
-
}
|
|
1697
|
-
const scrollIndex = (_a2 = this.scrollState.index) != null ? _a2 : (_a = this.getVirtualItemForOffset(this.scrollState.lastTargetOffset)) == null ? void 0 : _a.index;
|
|
1698
|
-
if (scrollIndex !== void 0 && this.range) {
|
|
1699
|
-
const bufferSize = Math.max(
|
|
1700
|
-
this.options.overscan,
|
|
1701
|
-
Math.ceil((this.range.endIndex - this.range.startIndex) / 2)
|
|
1702
|
-
);
|
|
1703
|
-
const minIndex = Math.max(0, scrollIndex - bufferSize);
|
|
1704
|
-
const maxIndex = Math.min(
|
|
1705
|
-
this.options.count - 1,
|
|
1706
|
-
scrollIndex + bufferSize
|
|
1707
|
-
);
|
|
1708
|
-
return index >= minIndex && index <= maxIndex;
|
|
1709
|
-
}
|
|
1710
|
-
return true;
|
|
1711
|
-
};
|
|
1712
|
-
this.measureElement = (node) => {
|
|
1713
|
-
if (!node) {
|
|
1714
|
-
this.elementsCache.forEach((cached, key2) => {
|
|
1715
|
-
if (!cached.isConnected) {
|
|
1716
|
-
this.observer.unobserve(cached);
|
|
1717
|
-
this.elementsCache.delete(key2);
|
|
1718
|
-
}
|
|
1719
|
-
});
|
|
1720
|
-
return;
|
|
1721
|
-
}
|
|
1722
|
-
const index = this.indexFromElement(node);
|
|
1723
|
-
const key = this.options.getItemKey(index);
|
|
1724
|
-
const prevNode = this.elementsCache.get(key);
|
|
1725
|
-
if (prevNode !== node) {
|
|
1726
|
-
if (prevNode) {
|
|
1727
|
-
this.observer.unobserve(prevNode);
|
|
1728
|
-
}
|
|
1729
|
-
this.observer.observe(node);
|
|
1730
|
-
this.elementsCache.set(key, node);
|
|
1731
|
-
}
|
|
1732
|
-
if ((!this.isScrolling || this.scrollState) && this.shouldMeasureDuringScroll(index)) {
|
|
1733
|
-
this.resizeItem(index, this.options.measureElement(node, void 0, this));
|
|
1734
|
-
}
|
|
1735
|
-
};
|
|
1736
|
-
this.resizeItem = (index, size) => {
|
|
1737
|
-
var _a2;
|
|
1738
|
-
var _a;
|
|
1739
|
-
const item = this.measurementsCache[index];
|
|
1740
|
-
if (!item) return;
|
|
1741
|
-
const itemSize = (_a2 = this.itemSizeCache.get(item.key)) != null ? _a2 : item.size;
|
|
1742
|
-
const delta = size - itemSize;
|
|
1743
|
-
if (delta !== 0) {
|
|
1744
|
-
if (((_a = this.scrollState) == null ? void 0 : _a.behavior) !== "smooth" && (this.shouldAdjustScrollPositionOnItemSizeChange !== void 0 ? this.shouldAdjustScrollPositionOnItemSizeChange(item, delta, this) : item.start < this.getScrollOffset() + this.scrollAdjustments)) {
|
|
1745
|
-
if (this.options.debug) {
|
|
1746
|
-
console.info("correction", delta);
|
|
1747
|
-
}
|
|
1748
|
-
this._scrollToOffset(this.getScrollOffset(), {
|
|
1749
|
-
adjustments: this.scrollAdjustments += delta,
|
|
1750
|
-
behavior: void 0
|
|
1751
|
-
});
|
|
1752
|
-
}
|
|
1753
|
-
this.pendingMeasuredCacheIndexes.push(item.index);
|
|
1754
|
-
this.itemSizeCache = new Map(this.itemSizeCache.set(item.key, size));
|
|
1755
|
-
this.notify(false);
|
|
1756
|
-
}
|
|
1757
|
-
};
|
|
1758
|
-
this.getVirtualItems = memo(
|
|
1759
|
-
() => [this.getVirtualIndexes(), this.getMeasurements()],
|
|
1760
|
-
(indexes, measurements) => {
|
|
1761
|
-
const virtualItems = [];
|
|
1762
|
-
for (let k = 0, len = indexes.length; k < len; k++) {
|
|
1763
|
-
const i = indexes[k];
|
|
1764
|
-
const measurement = measurements[i];
|
|
1765
|
-
virtualItems.push(measurement);
|
|
1766
|
-
}
|
|
1767
|
-
return virtualItems;
|
|
1768
|
-
},
|
|
1769
|
-
{
|
|
1770
|
-
key: "getVirtualItems",
|
|
1771
|
-
debug: () => this.options.debug
|
|
1772
|
-
}
|
|
1773
|
-
);
|
|
1774
|
-
this.getVirtualItemForOffset = (offset) => {
|
|
1775
|
-
const measurements = this.getMeasurements();
|
|
1776
|
-
if (measurements.length === 0) {
|
|
1777
|
-
return void 0;
|
|
1778
|
-
}
|
|
1779
|
-
return notUndefined(
|
|
1780
|
-
measurements[findNearestBinarySearch(
|
|
1781
|
-
0,
|
|
1782
|
-
measurements.length - 1,
|
|
1783
|
-
(index) => notUndefined(measurements[index]).start,
|
|
1784
|
-
offset
|
|
1785
|
-
)]
|
|
1786
|
-
);
|
|
1787
|
-
};
|
|
1788
|
-
this.getMaxScrollOffset = () => {
|
|
1789
|
-
if (!this.scrollElement) return 0;
|
|
1790
|
-
if ("scrollHeight" in this.scrollElement) {
|
|
1791
|
-
return this.options.horizontal ? this.scrollElement.scrollWidth - this.scrollElement.clientWidth : this.scrollElement.scrollHeight - this.scrollElement.clientHeight;
|
|
1792
|
-
} else {
|
|
1793
|
-
const doc = this.scrollElement.document.documentElement;
|
|
1794
|
-
return this.options.horizontal ? doc.scrollWidth - this.scrollElement.innerWidth : doc.scrollHeight - this.scrollElement.innerHeight;
|
|
1795
|
-
}
|
|
1796
|
-
};
|
|
1797
|
-
this.getOffsetForAlignment = (toOffset, align, itemSize = 0) => {
|
|
1798
|
-
if (!this.scrollElement) return 0;
|
|
1799
|
-
const size = this.getSize();
|
|
1800
|
-
const scrollOffset = this.getScrollOffset();
|
|
1801
|
-
if (align === "auto") {
|
|
1802
|
-
align = toOffset >= scrollOffset + size ? "end" : "start";
|
|
1803
|
-
}
|
|
1804
|
-
if (align === "center") {
|
|
1805
|
-
toOffset += (itemSize - size) / 2;
|
|
1806
|
-
} else if (align === "end") {
|
|
1807
|
-
toOffset -= size;
|
|
1808
|
-
}
|
|
1809
|
-
const maxOffset = this.getMaxScrollOffset();
|
|
1810
|
-
return Math.max(Math.min(maxOffset, toOffset), 0);
|
|
1811
|
-
};
|
|
1812
|
-
this.getOffsetForIndex = (index, align = "auto") => {
|
|
1813
|
-
index = Math.max(0, Math.min(index, this.options.count - 1));
|
|
1814
|
-
const size = this.getSize();
|
|
1815
|
-
const scrollOffset = this.getScrollOffset();
|
|
1816
|
-
const item = this.measurementsCache[index];
|
|
1817
|
-
if (!item) return;
|
|
1818
|
-
if (align === "auto") {
|
|
1819
|
-
if (item.end >= scrollOffset + size - this.options.scrollPaddingEnd) {
|
|
1820
|
-
align = "end";
|
|
1821
|
-
} else if (item.start <= scrollOffset + this.options.scrollPaddingStart) {
|
|
1822
|
-
align = "start";
|
|
1823
|
-
} else {
|
|
1824
|
-
return [scrollOffset, align];
|
|
1825
|
-
}
|
|
1826
|
-
}
|
|
1827
|
-
if (align === "end" && index === this.options.count - 1) {
|
|
1828
|
-
return [this.getMaxScrollOffset(), align];
|
|
1829
|
-
}
|
|
1830
|
-
const toOffset = align === "end" ? item.end + this.options.scrollPaddingEnd : item.start - this.options.scrollPaddingStart;
|
|
1831
|
-
return [
|
|
1832
|
-
this.getOffsetForAlignment(toOffset, align, item.size),
|
|
1833
|
-
align
|
|
1834
|
-
];
|
|
1835
|
-
};
|
|
1836
|
-
this.scrollToOffset = (toOffset, { align = "start", behavior = "auto" } = {}) => {
|
|
1837
|
-
const offset = this.getOffsetForAlignment(toOffset, align);
|
|
1838
|
-
const now = this.now();
|
|
1839
|
-
this.scrollState = {
|
|
1840
|
-
index: null,
|
|
1841
|
-
align,
|
|
1842
|
-
behavior,
|
|
1843
|
-
startedAt: now,
|
|
1844
|
-
lastTargetOffset: offset,
|
|
1845
|
-
stableFrames: 0
|
|
1846
|
-
};
|
|
1847
|
-
this._scrollToOffset(offset, { adjustments: void 0, behavior });
|
|
1848
|
-
this.scheduleScrollReconcile();
|
|
1849
|
-
};
|
|
1850
|
-
this.scrollToIndex = (index, {
|
|
1851
|
-
align: initialAlign = "auto",
|
|
1852
|
-
behavior = "auto"
|
|
1853
|
-
} = {}) => {
|
|
1854
|
-
index = Math.max(0, Math.min(index, this.options.count - 1));
|
|
1855
|
-
const offsetInfo = this.getOffsetForIndex(index, initialAlign);
|
|
1856
|
-
if (!offsetInfo) {
|
|
1857
|
-
return;
|
|
1858
|
-
}
|
|
1859
|
-
const [offset, align] = offsetInfo;
|
|
1860
|
-
const now = this.now();
|
|
1861
|
-
this.scrollState = {
|
|
1862
|
-
index,
|
|
1863
|
-
align,
|
|
1864
|
-
behavior,
|
|
1865
|
-
startedAt: now,
|
|
1866
|
-
lastTargetOffset: offset,
|
|
1867
|
-
stableFrames: 0
|
|
1868
|
-
};
|
|
1869
|
-
this._scrollToOffset(offset, { adjustments: void 0, behavior });
|
|
1870
|
-
this.scheduleScrollReconcile();
|
|
1871
|
-
};
|
|
1872
|
-
this.scrollBy = (delta, { behavior = "auto" } = {}) => {
|
|
1873
|
-
const offset = this.getScrollOffset() + delta;
|
|
1874
|
-
const now = this.now();
|
|
1875
|
-
this.scrollState = {
|
|
1876
|
-
index: null,
|
|
1877
|
-
align: "start",
|
|
1878
|
-
behavior,
|
|
1879
|
-
startedAt: now,
|
|
1880
|
-
lastTargetOffset: offset,
|
|
1881
|
-
stableFrames: 0
|
|
1882
|
-
};
|
|
1883
|
-
this._scrollToOffset(offset, { adjustments: void 0, behavior });
|
|
1884
|
-
this.scheduleScrollReconcile();
|
|
1885
|
-
};
|
|
1886
|
-
this.getTotalSize = () => {
|
|
1887
|
-
var _a2;
|
|
1888
|
-
var _a;
|
|
1889
|
-
const measurements = this.getMeasurements();
|
|
1890
|
-
let end;
|
|
1891
|
-
if (measurements.length === 0) {
|
|
1892
|
-
end = this.options.paddingStart;
|
|
1893
|
-
} else if (this.options.lanes === 1) {
|
|
1894
|
-
end = (_a2 = (_a = measurements[measurements.length - 1]) == null ? void 0 : _a.end) != null ? _a2 : 0;
|
|
1895
|
-
} else {
|
|
1896
|
-
const endByLane = Array(this.options.lanes).fill(null);
|
|
1897
|
-
let endIndex = measurements.length - 1;
|
|
1898
|
-
while (endIndex >= 0 && endByLane.some((val) => val === null)) {
|
|
1899
|
-
const item = measurements[endIndex];
|
|
1900
|
-
if (endByLane[item.lane] === null) {
|
|
1901
|
-
endByLane[item.lane] = item.end;
|
|
1902
|
-
}
|
|
1903
|
-
endIndex--;
|
|
1904
|
-
}
|
|
1905
|
-
end = Math.max(...endByLane.filter((val) => val !== null));
|
|
1906
|
-
}
|
|
1907
|
-
return Math.max(
|
|
1908
|
-
end - this.options.scrollMargin + this.options.paddingEnd,
|
|
1909
|
-
0
|
|
1910
|
-
);
|
|
1911
|
-
};
|
|
1912
|
-
this._scrollToOffset = (offset, {
|
|
1913
|
-
adjustments,
|
|
1914
|
-
behavior
|
|
1915
|
-
}) => {
|
|
1916
|
-
this.options.scrollToFn(offset, { behavior, adjustments }, this);
|
|
1917
|
-
};
|
|
1918
|
-
this.measure = () => {
|
|
1919
|
-
this.itemSizeCache = /* @__PURE__ */ new Map();
|
|
1920
|
-
this.laneAssignments = /* @__PURE__ */ new Map();
|
|
1921
|
-
this.notify(false);
|
|
1922
|
-
};
|
|
1923
|
-
this.setOptions(opts);
|
|
1924
|
-
}
|
|
1925
|
-
scheduleScrollReconcile() {
|
|
1926
|
-
if (!this.targetWindow) {
|
|
1927
|
-
this.scrollState = null;
|
|
1928
|
-
return;
|
|
1929
|
-
}
|
|
1930
|
-
if (this.rafId != null) return;
|
|
1931
|
-
this.rafId = this.targetWindow.requestAnimationFrame(() => {
|
|
1932
|
-
this.rafId = null;
|
|
1933
|
-
this.reconcileScroll();
|
|
1934
|
-
});
|
|
1935
|
-
}
|
|
1936
|
-
reconcileScroll() {
|
|
1937
|
-
if (!this.scrollState) return;
|
|
1938
|
-
const el = this.scrollElement;
|
|
1939
|
-
if (!el) return;
|
|
1940
|
-
const MAX_RECONCILE_MS = 5e3;
|
|
1941
|
-
if (this.now() - this.scrollState.startedAt > MAX_RECONCILE_MS) {
|
|
1942
|
-
this.scrollState = null;
|
|
1943
|
-
return;
|
|
1944
|
-
}
|
|
1945
|
-
const offsetInfo = this.scrollState.index != null ? this.getOffsetForIndex(this.scrollState.index, this.scrollState.align) : void 0;
|
|
1946
|
-
const targetOffset = offsetInfo ? offsetInfo[0] : this.scrollState.lastTargetOffset;
|
|
1947
|
-
const STABLE_FRAMES = 1;
|
|
1948
|
-
const targetChanged = targetOffset !== this.scrollState.lastTargetOffset;
|
|
1949
|
-
if (!targetChanged && approxEqual(targetOffset, this.getScrollOffset())) {
|
|
1950
|
-
this.scrollState.stableFrames++;
|
|
1951
|
-
if (this.scrollState.stableFrames >= STABLE_FRAMES) {
|
|
1952
|
-
this.scrollState = null;
|
|
1953
|
-
return;
|
|
1954
|
-
}
|
|
1955
|
-
} else {
|
|
1956
|
-
this.scrollState.stableFrames = 0;
|
|
1957
|
-
if (targetChanged) {
|
|
1958
|
-
this.scrollState.lastTargetOffset = targetOffset;
|
|
1959
|
-
this.scrollState.behavior = "auto";
|
|
1960
|
-
this._scrollToOffset(targetOffset, {
|
|
1961
|
-
adjustments: void 0,
|
|
1962
|
-
behavior: "auto"
|
|
1963
|
-
});
|
|
1964
|
-
}
|
|
1965
|
-
}
|
|
1966
|
-
this.scheduleScrollReconcile();
|
|
1967
|
-
}
|
|
1968
|
-
};
|
|
1969
|
-
var findNearestBinarySearch = (low, high, getCurrentValue, value) => {
|
|
1970
|
-
while (low <= high) {
|
|
1971
|
-
const middle = (low + high) / 2 | 0;
|
|
1972
|
-
const currentValue = getCurrentValue(middle);
|
|
1973
|
-
if (currentValue < value) {
|
|
1974
|
-
low = middle + 1;
|
|
1975
|
-
} else if (currentValue > value) {
|
|
1976
|
-
high = middle - 1;
|
|
1977
|
-
} else {
|
|
1978
|
-
return middle;
|
|
1979
|
-
}
|
|
1980
|
-
}
|
|
1981
|
-
if (low > 0) {
|
|
1982
|
-
return low - 1;
|
|
1983
|
-
} else {
|
|
1984
|
-
return 0;
|
|
1985
|
-
}
|
|
1986
|
-
};
|
|
1987
|
-
function calculateRange({
|
|
1988
|
-
measurements,
|
|
1989
|
-
outerSize,
|
|
1990
|
-
scrollOffset,
|
|
1991
|
-
lanes
|
|
1992
|
-
}) {
|
|
1993
|
-
const lastIndex = measurements.length - 1;
|
|
1994
|
-
const getOffset = (index) => measurements[index].start;
|
|
1995
|
-
if (measurements.length <= lanes) {
|
|
1996
|
-
return {
|
|
1997
|
-
startIndex: 0,
|
|
1998
|
-
endIndex: lastIndex
|
|
1999
|
-
};
|
|
2000
|
-
}
|
|
2001
|
-
let startIndex = findNearestBinarySearch(
|
|
2002
|
-
0,
|
|
2003
|
-
lastIndex,
|
|
2004
|
-
getOffset,
|
|
2005
|
-
scrollOffset
|
|
2006
|
-
);
|
|
2007
|
-
let endIndex = startIndex;
|
|
2008
|
-
if (lanes === 1) {
|
|
2009
|
-
while (endIndex < lastIndex && measurements[endIndex].end < scrollOffset + outerSize) {
|
|
2010
|
-
endIndex++;
|
|
2011
|
-
}
|
|
2012
|
-
} else if (lanes > 1) {
|
|
2013
|
-
const endPerLane = Array(lanes).fill(0);
|
|
2014
|
-
while (endIndex < lastIndex && endPerLane.some((pos) => pos < scrollOffset + outerSize)) {
|
|
2015
|
-
const item = measurements[endIndex];
|
|
2016
|
-
endPerLane[item.lane] = item.end;
|
|
2017
|
-
endIndex++;
|
|
2018
|
-
}
|
|
2019
|
-
const startPerLane = Array(lanes).fill(scrollOffset + outerSize);
|
|
2020
|
-
while (startIndex >= 0 && startPerLane.some((pos) => pos >= scrollOffset)) {
|
|
2021
|
-
const item = measurements[startIndex];
|
|
2022
|
-
startPerLane[item.lane] = item.start;
|
|
2023
|
-
startIndex--;
|
|
2024
|
-
}
|
|
2025
|
-
startIndex = Math.max(0, startIndex - startIndex % lanes);
|
|
2026
|
-
endIndex = Math.min(lastIndex, endIndex + (lanes - 1 - endIndex % lanes));
|
|
2027
|
-
}
|
|
2028
|
-
return { startIndex, endIndex };
|
|
2029
|
-
}
|
|
2030
|
-
|
|
2031
|
-
// ../../node_modules/.pnpm/@tanstack+react-virtual@3.13.24_react-dom@19.2.7_react@19.2.7__react@19.2.7/node_modules/@tanstack/react-virtual/dist/esm/index.js
|
|
2032
|
-
var useIsomorphicLayoutEffect = typeof document !== "undefined" ? React.useLayoutEffect : React.useEffect;
|
|
2033
|
-
function useVirtualizerBase(_a) {
|
|
2034
|
-
var _b = _a, {
|
|
2035
|
-
useFlushSync = true
|
|
2036
|
-
} = _b, options = __objRest(_b, [
|
|
2037
|
-
"useFlushSync"
|
|
2038
|
-
]);
|
|
2039
|
-
const rerender = React.useReducer(() => ({}), {})[1];
|
|
2040
|
-
const resolvedOptions = __spreadProps(__spreadValues({}, options), {
|
|
2041
|
-
onChange: (instance2, sync) => {
|
|
2042
|
-
var _a2;
|
|
2043
|
-
if (useFlushSync && sync) {
|
|
2044
|
-
flushSync(rerender);
|
|
2045
|
-
} else {
|
|
2046
|
-
rerender();
|
|
2047
|
-
}
|
|
2048
|
-
(_a2 = options.onChange) == null ? void 0 : _a2.call(options, instance2, sync);
|
|
2049
|
-
}
|
|
2050
|
-
});
|
|
2051
|
-
const [instance] = React.useState(
|
|
2052
|
-
() => new Virtualizer(resolvedOptions)
|
|
2053
|
-
);
|
|
2054
|
-
instance.setOptions(resolvedOptions);
|
|
2055
|
-
useIsomorphicLayoutEffect(() => {
|
|
2056
|
-
return instance._didMount();
|
|
2057
|
-
}, []);
|
|
2058
|
-
useIsomorphicLayoutEffect(() => {
|
|
2059
|
-
return instance._willUpdate();
|
|
2060
|
-
});
|
|
2061
|
-
return instance;
|
|
2062
|
-
}
|
|
2063
|
-
function useWindowVirtualizer(options) {
|
|
2064
|
-
return useVirtualizerBase(__spreadValues({
|
|
2065
|
-
getScrollElement: () => typeof document !== "undefined" ? window : null,
|
|
2066
|
-
observeElementRect: observeWindowRect,
|
|
2067
|
-
observeElementOffset: observeWindowOffset,
|
|
2068
|
-
scrollToFn: windowScroll,
|
|
2069
|
-
initialOffset: () => typeof document !== "undefined" ? window.scrollY : 0
|
|
2070
|
-
}, options));
|
|
2071
|
-
}
|
|
2072
|
-
|
|
2073
|
-
// ../renderers/src/CollectionRenderer/components/ContentComponent.tsx
|
|
2074
|
-
import { ProcessIndicator, Button as Button4 } from "@transferwise/components";
|
|
2075
|
-
import { useRef as useRef3, useEffect as useEffect7, useMemo, useLayoutEffect as useLayoutEffect2 } from "react";
|
|
2076
|
-
|
|
2077
|
-
// ../renderers/src/step/StepFooter.tsx
|
|
2078
|
-
import { Button as Button3 } from "@transferwise/components";
|
|
2079
|
-
import { useEffect as useEffect6, useRef as useRef2, useState as useState5 } from "react";
|
|
2080
|
-
import { useIntl as useIntl3 } from "react-intl";
|
|
2081
|
-
|
|
2082
|
-
// ../renderers/src/messages/step.messages.ts
|
|
2083
|
-
import { defineMessages as defineMessages3 } from "react-intl";
|
|
2084
|
-
var step_messages_default = defineMessages3({
|
|
2085
|
-
scrollToBottom: {
|
|
2086
|
-
id: "df.wise.step.scrollToBottom",
|
|
2087
|
-
defaultMessage: "Scroll to bottom",
|
|
2088
|
-
description: "Label for a button that appears when the content of a step is too long and the user needs to scroll to the bottom to see all the content."
|
|
2089
|
-
}
|
|
2090
|
-
});
|
|
2091
|
-
|
|
2092
|
-
// ../renderers/src/step/StepFooter.tsx
|
|
2093
|
-
import { Fragment as Fragment2, jsx as jsx24, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
2094
|
-
var SCROLL_TO_BOTTOM = "scroll-to-bottom";
|
|
2095
|
-
var StepFooter = ({ footer, tags }) => {
|
|
2096
|
-
if (tags == null ? void 0 : tags.includes(SCROLL_TO_BOTTOM)) {
|
|
2097
|
-
return /* @__PURE__ */ jsx24(FooterWithScrollButton, { footer });
|
|
2098
|
-
}
|
|
2099
|
-
return /* @__PURE__ */ jsx24(DefaultFooter, { footer });
|
|
2100
|
-
};
|
|
2101
|
-
var DefaultFooter = ({ footer }) => {
|
|
2102
|
-
const hasFooter = footer && Array.isArray(footer) && footer.length > 0;
|
|
2103
|
-
return hasFooter ? /* @__PURE__ */ jsx24("div", { className: "df-step-fixed__footer", children: footer }) : void 0;
|
|
2104
|
-
};
|
|
2105
|
-
var FooterWithScrollButton = ({ footer }) => {
|
|
2106
|
-
const { formatMessage } = useIntl3();
|
|
2107
|
-
const endOfLayoutRef = useRef2(null);
|
|
2108
|
-
const isElementVisible = useIsElementVisible(endOfLayoutRef);
|
|
2109
|
-
const scrollButton = /* @__PURE__ */ jsx24(
|
|
2110
|
-
Button3,
|
|
2111
|
-
{
|
|
2112
|
-
className: "m-b-1",
|
|
2113
|
-
v2: true,
|
|
2114
|
-
block: true,
|
|
2115
|
-
priority: "tertiary",
|
|
2116
|
-
onClick: () => {
|
|
2117
|
-
var _a;
|
|
2118
|
-
(_a = endOfLayoutRef.current) == null ? void 0 : _a.scrollIntoView({ behavior: "smooth" });
|
|
2119
|
-
},
|
|
2120
|
-
children: formatMessage(step_messages_default.scrollToBottom)
|
|
2121
|
-
}
|
|
2122
|
-
);
|
|
2123
|
-
const hasStepFooterContent = footer && Array.isArray(footer) && footer.length > 0;
|
|
2124
|
-
if (isElementVisible && !hasStepFooterContent) {
|
|
2125
|
-
return /* @__PURE__ */ jsx24("div", { ref: endOfLayoutRef, "aria-hidden": "true" });
|
|
2126
|
-
}
|
|
2127
|
-
return /* @__PURE__ */ jsxs5(Fragment2, { children: [
|
|
2128
|
-
/* @__PURE__ */ jsx24("div", { ref: endOfLayoutRef, "aria-hidden": "true" }),
|
|
2129
|
-
/* @__PURE__ */ jsxs5("div", { className: "df-step-fixed__footer", children: [
|
|
2130
|
-
!isElementVisible && scrollButton,
|
|
2131
|
-
footer
|
|
2132
|
-
] })
|
|
2133
|
-
] });
|
|
2134
|
-
};
|
|
2135
|
-
var useIsElementVisible = (elementRef) => {
|
|
2136
|
-
const [isVisible, setIsVisible] = useState5(false);
|
|
2137
|
-
useEffect6(() => {
|
|
2138
|
-
const element = elementRef.current;
|
|
2139
|
-
if (!element) return;
|
|
2140
|
-
const observer = new IntersectionObserver(([entry]) => {
|
|
2141
|
-
setIsVisible(entry.isIntersecting);
|
|
2142
|
-
});
|
|
2143
|
-
observer.observe(element);
|
|
2144
|
-
return () => observer.disconnect();
|
|
2145
|
-
}, [elementRef]);
|
|
2146
|
-
return isVisible;
|
|
2147
|
-
};
|
|
2148
|
-
|
|
2149
|
-
// ../renderers/src/CollectionRenderer/components/ContentComponent.tsx
|
|
2150
|
-
import { jsx as jsx25, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
2151
|
-
var ContentComponent = (props) => {
|
|
2152
|
-
const { state, status, SectionHeader, Item } = props;
|
|
2153
|
-
const endOfContentRef = useRef3(null);
|
|
2154
|
-
const isBottomVisible = useIsElementVisible(endOfContentRef);
|
|
2155
|
-
useEffect7(() => {
|
|
2156
|
-
var _a;
|
|
2157
|
-
console.log("bottom visible", status);
|
|
2158
|
-
if (isBottomVisible && status.type === "idle" && status.loadMore) {
|
|
2159
|
-
(_a = status.loadMore) == null ? void 0 : _a.call(status);
|
|
2160
|
-
}
|
|
2161
|
-
}, [isBottomVisible]);
|
|
2162
|
-
const stateCount = state.sections.reduce(
|
|
2163
|
-
(total, section) => section.items.length + total + (section.title ? 1 : 0),
|
|
2164
|
-
0
|
|
2165
|
-
);
|
|
2166
|
-
const items = useMemo(() => {
|
|
2167
|
-
return state.sections.reduce((acc, section) => {
|
|
2168
|
-
return [
|
|
2169
|
-
...acc,
|
|
2170
|
-
...section.title ? [
|
|
2171
|
-
{
|
|
2172
|
-
type: "header",
|
|
2173
|
-
title: section.title,
|
|
2174
|
-
items: section.items,
|
|
2175
|
-
id: section.id
|
|
2176
|
-
}
|
|
2177
|
-
] : [],
|
|
2178
|
-
...section.items.map((item) => ({
|
|
2179
|
-
item,
|
|
2180
|
-
type: "item"
|
|
2181
|
-
}))
|
|
2182
|
-
];
|
|
2183
|
-
}, []);
|
|
2184
|
-
}, [stateCount]);
|
|
2185
|
-
const listRef = useRef3(null);
|
|
2186
|
-
const listOffsetRef = useRef3(0);
|
|
2187
|
-
useLayoutEffect2(() => {
|
|
2188
|
-
var _a, _b;
|
|
2189
|
-
listOffsetRef.current = (_b = (_a = listRef.current) == null ? void 0 : _a.offsetTop) != null ? _b : 0;
|
|
2190
|
-
});
|
|
2191
|
-
const virtualizer = useWindowVirtualizer({
|
|
2192
|
-
count: stateCount,
|
|
2193
|
-
estimateSize: () => 120,
|
|
2194
|
-
// todo, we could be clever here. Is it worth it?
|
|
2195
|
-
overscan: 10,
|
|
2196
|
-
scrollMargin: listOffsetRef.current
|
|
2197
|
-
});
|
|
2198
|
-
const showState = status.type === "idle" || status.reason === "pagination";
|
|
2199
|
-
return /* @__PURE__ */ jsxs6("div", { ref: listRef, children: [
|
|
2200
|
-
showState && state.beforeSections,
|
|
2201
|
-
showState && /* @__PURE__ */ jsx25(
|
|
2202
|
-
"div",
|
|
2203
|
-
{
|
|
2204
|
-
style: {
|
|
2205
|
-
height: `${virtualizer.getTotalSize()}px`,
|
|
2206
|
-
width: "100%",
|
|
2207
|
-
position: "relative"
|
|
2208
|
-
},
|
|
2209
|
-
children: virtualizer.getVirtualItems().map((item) => {
|
|
2210
|
-
const i = items[item.index];
|
|
2211
|
-
if (!i) {
|
|
2212
|
-
return null;
|
|
2213
|
-
}
|
|
2214
|
-
return /* @__PURE__ */ jsx25(
|
|
2215
|
-
"div",
|
|
2216
|
-
{
|
|
2217
|
-
ref: virtualizer.measureElement,
|
|
2218
|
-
"data-index": item.index,
|
|
2219
|
-
style: {
|
|
2220
|
-
position: "absolute",
|
|
2221
|
-
top: 0,
|
|
2222
|
-
left: 0,
|
|
2223
|
-
width: "100%",
|
|
2224
|
-
transform: `translateY(${item.start - virtualizer.options.scrollMargin}px)`
|
|
2225
|
-
},
|
|
2226
|
-
children: i.type === "header" ? /* @__PURE__ */ jsx25(SectionHeader, __spreadValues({}, i)) : /* @__PURE__ */ jsx25(Item, __spreadValues({}, i.item))
|
|
2227
|
-
},
|
|
2228
|
-
item.key
|
|
2229
|
-
);
|
|
2230
|
-
})
|
|
2231
|
-
}
|
|
2232
|
-
),
|
|
2233
|
-
/* @__PURE__ */ jsxs6("div", { ref: endOfContentRef, className: "d-flex m-x-auto m-y-2", children: [
|
|
2234
|
-
status.type === "idle" && status.loadMore || status.type === "loading" ? /* @__PURE__ */ jsx25(ProcessIndicator, { size: "xs" }) : null,
|
|
2235
|
-
status.type === "error" && status.reason === "pagination" ? /* @__PURE__ */ jsx25("div", { className: "d-flex m-x-auto", children: /* @__PURE__ */ jsx25(Button4, { v2: true, size: "sm", priority: "secondary-neutral", onClick: status.retry, children: "Load more" }) }) : null
|
|
2236
|
-
] }),
|
|
2237
|
-
showState && state.afterSections
|
|
2238
|
-
] });
|
|
2239
|
-
};
|
|
2240
|
-
|
|
2241
|
-
// ../renderers/src/CollectionRenderer/components/SearchComponent.tsx
|
|
2242
|
-
import { InputGroup, Input } from "@transferwise/components";
|
|
2243
|
-
import { Search } from "@transferwise/icons";
|
|
2244
|
-
import { jsx as jsx26 } from "react/jsx-runtime";
|
|
2245
|
-
var SearchComponent = ({ state, features }) => {
|
|
2246
|
-
const { search } = state;
|
|
2247
|
-
if (!search) {
|
|
2248
|
-
return;
|
|
2249
|
-
}
|
|
2250
|
-
return /* @__PURE__ */ jsx26(
|
|
2251
|
-
FieldInput_default,
|
|
2252
|
-
{
|
|
2253
|
-
id: "search",
|
|
2254
|
-
description: "",
|
|
2255
|
-
validation: void 0,
|
|
2256
|
-
help: "",
|
|
2257
|
-
label: search.title,
|
|
2258
|
-
features,
|
|
2259
|
-
children: /* @__PURE__ */ jsx26(InputGroup, { addonStart: { content: /* @__PURE__ */ jsx26(Search, { size: 24 }) }, children: /* @__PURE__ */ jsx26(
|
|
2260
|
-
Input,
|
|
2261
|
-
{
|
|
2262
|
-
id: "search",
|
|
2263
|
-
name: "search",
|
|
2264
|
-
shape: "pill",
|
|
2265
|
-
placeholder: search.hint,
|
|
2266
|
-
type: "text",
|
|
2267
|
-
value: search.query,
|
|
2268
|
-
onChange: ({ currentTarget: { value } }) => {
|
|
2269
|
-
search.onChange(value);
|
|
2270
|
-
}
|
|
2271
|
-
}
|
|
2272
|
-
) })
|
|
2273
|
-
}
|
|
2274
|
-
);
|
|
2275
|
-
};
|
|
2276
|
-
|
|
2277
|
-
// ../renderers/src/CollectionRenderer/components/FilterComponent.tsx
|
|
2278
|
-
import { Chips } from "@transferwise/components";
|
|
2279
|
-
import { jsx as jsx27 } from "react/jsx-runtime";
|
|
2280
|
-
var FiltersComponent = ({ state }) => {
|
|
2281
|
-
const { filters } = state;
|
|
2282
|
-
return filters.map((filter) => {
|
|
2283
|
-
var _a;
|
|
2284
|
-
return /* @__PURE__ */ jsx27(FilterComponent, __spreadValues({}, filter), JSON.stringify((_a = filter.options) == null ? void 0 : _a.map((o) => o.value)));
|
|
2285
|
-
});
|
|
2286
|
-
};
|
|
2287
|
-
var FilterComponent = (filter) => {
|
|
2288
|
-
const { multiSelect, options } = filter;
|
|
2289
|
-
if (!options) {
|
|
2290
|
-
return null;
|
|
2291
|
-
}
|
|
2292
|
-
return /* @__PURE__ */ jsx27(
|
|
2293
|
-
Chips,
|
|
2294
|
-
{
|
|
2295
|
-
className: "m-b-1",
|
|
2296
|
-
multiple: multiSelect,
|
|
2297
|
-
selected: options.some((option) => option.selected) ? options.filter((option) => option.selected).map((option) => option.value) : multiSelect ? [] : "",
|
|
2298
|
-
chips: [
|
|
2299
|
-
...options.map((option) => ({
|
|
2300
|
-
value: option.value,
|
|
2301
|
-
label: option.title
|
|
2302
|
-
}))
|
|
2303
|
-
],
|
|
2304
|
-
onChange: (value) => {
|
|
2305
|
-
var _a;
|
|
2306
|
-
if (value.selectedValue === "") {
|
|
2307
|
-
options == null ? void 0 : options.filter((option) => option.selected).map((option) => option == null ? void 0 : option.onSelect());
|
|
2308
|
-
return;
|
|
2309
|
-
}
|
|
2310
|
-
(_a = options == null ? void 0 : options.find((option) => value.selectedValue === option.value)) == null ? void 0 : _a.onSelect();
|
|
2311
|
-
}
|
|
2312
|
-
},
|
|
2313
|
-
JSON.stringify(options)
|
|
2314
|
-
);
|
|
2315
|
-
};
|
|
2316
|
-
|
|
2317
|
-
// ../renderers/src/CollectionRenderer/components/ItemComponent.tsx
|
|
2318
|
-
import { ListItem as ListItem6 } from "@transferwise/components";
|
|
2319
|
-
|
|
2320
|
-
// ../renderers/src/utils/listItem/getAdditionalInfo.tsx
|
|
2321
|
-
import { ListItem as ListItem4 } from "@transferwise/components";
|
|
2322
|
-
import { jsx as jsx28 } from "react/jsx-runtime";
|
|
2323
|
-
var getAdditionalInfo = (additionalInfo) => {
|
|
2324
|
-
var _a, _b;
|
|
2325
|
-
if (!additionalInfo) {
|
|
2326
|
-
return void 0;
|
|
2327
|
-
}
|
|
2328
|
-
const { href, text, onClick } = additionalInfo;
|
|
2329
|
-
if (href || onClick) {
|
|
2330
|
-
return /* @__PURE__ */ jsx28(
|
|
2331
|
-
ListItem4.AdditionalInfo,
|
|
2332
|
-
{
|
|
2333
|
-
action: __spreadValues({
|
|
2334
|
-
label: text
|
|
2335
|
-
}, (_b = (_a = additionalInfo.getAnchorProps) == null ? void 0 : _a.call(additionalInfo)) != null ? _b : { onClick })
|
|
2336
|
-
}
|
|
2337
|
-
);
|
|
2338
|
-
}
|
|
2339
|
-
return /* @__PURE__ */ jsx28(ListItem4.AdditionalInfo, { children: additionalInfo == null ? void 0 : additionalInfo.text });
|
|
2340
|
-
};
|
|
2341
|
-
|
|
2342
|
-
// ../renderers/src/utils/listItem/getCTAControl.tsx
|
|
2343
|
-
import { ListItem as ListItem5 } from "@transferwise/components";
|
|
2344
|
-
import { jsx as jsx29 } from "react/jsx-runtime";
|
|
2345
|
-
var getCTAControl = (callToAction, { ctaSecondary, fullyInteractive }) => {
|
|
2346
|
-
if (!callToAction) {
|
|
2347
|
-
return void 0;
|
|
2348
|
-
}
|
|
2349
|
-
const { accessibilityDescription, title, context } = callToAction;
|
|
2350
|
-
const { priority, sentiment } = getPriorityAndSentiment(ctaSecondary, context);
|
|
2351
|
-
return /* @__PURE__ */ jsx29(
|
|
2352
|
-
ListItem5.Button,
|
|
2353
|
-
__spreadProps(__spreadValues({}, callToAction.getAnchorProps()), {
|
|
2354
|
-
partiallyInteractive: !fullyInteractive,
|
|
2355
|
-
priority,
|
|
2356
|
-
"aria-description": accessibilityDescription,
|
|
2357
|
-
sentiment,
|
|
2358
|
-
children: title
|
|
2359
|
-
})
|
|
2360
|
-
);
|
|
2361
|
-
};
|
|
2362
|
-
var getPriorityAndSentiment = (ctaSecondary, context) => {
|
|
2363
|
-
if (context === "negative") {
|
|
2364
|
-
return { priority: "secondary", sentiment: "negative" };
|
|
2365
|
-
}
|
|
2366
|
-
return { priority: ctaSecondary ? "secondary" : "secondary-neutral", sentiment: "default" };
|
|
2367
|
-
};
|
|
2368
|
-
|
|
2369
|
-
// ../renderers/src/utils/listItem/shouldUseAvatar.ts
|
|
2370
|
-
var shouldUseAvatar = (control, tags) => {
|
|
2371
|
-
var _a;
|
|
2372
|
-
return control === "with-avatar" || ((_a = tags == null ? void 0 : tags.includes("with-avatar")) != null ? _a : false);
|
|
2373
|
-
};
|
|
2374
|
-
|
|
2375
|
-
// ../renderers/src/CollectionRenderer/components/ItemComponent.tsx
|
|
2376
|
-
import { jsx as jsx30 } from "react/jsx-runtime";
|
|
2377
|
-
var ItemComponent = (props) => {
|
|
2378
|
-
var _a, _b;
|
|
2379
|
-
const {
|
|
2380
|
-
title,
|
|
2381
|
-
description,
|
|
2382
|
-
supportingValues,
|
|
2383
|
-
media,
|
|
2384
|
-
additionalInfo,
|
|
2385
|
-
inlineAlert,
|
|
2386
|
-
href,
|
|
2387
|
-
onClick,
|
|
2388
|
-
callToAction,
|
|
2389
|
-
tags,
|
|
2390
|
-
parentTags,
|
|
2391
|
-
control
|
|
2392
|
-
} = props;
|
|
2393
|
-
const controlOptions = {
|
|
2394
|
-
ctaSecondary: (_a = tags == null ? void 0 : tags.includes("cta-secondary")) != null ? _a : false,
|
|
2395
|
-
fullyInteractive: (_b = (tags == null ? void 0 : tags.includes("fully-interactive")) && (additionalInfo == null ? void 0 : additionalInfo.onClick) == null) != null ? _b : false
|
|
2396
|
-
};
|
|
2397
|
-
return /* @__PURE__ */ jsx30(
|
|
2398
|
-
ListItem6,
|
|
2399
|
-
{
|
|
2400
|
-
title,
|
|
2401
|
-
subtitle: description,
|
|
2402
|
-
valueTitle: supportingValues == null ? void 0 : supportingValues.value,
|
|
2403
|
-
valueSubtitle: supportingValues == null ? void 0 : supportingValues.subvalue,
|
|
2404
|
-
media: getMedia(media, shouldUseAvatar(control, parentTags)),
|
|
2405
|
-
prompt: getInlineAlert(inlineAlert),
|
|
2406
|
-
additionalInfo: getAdditionalInfo(additionalInfo),
|
|
2407
|
-
control: onClick || href ? getNavigationControl(onClick, href) : getCTAControl(callToAction, controlOptions)
|
|
2408
|
-
},
|
|
2409
|
-
title
|
|
2410
|
-
);
|
|
2411
|
-
};
|
|
2412
|
-
var getNavigationControl = (onClick, href) => {
|
|
2413
|
-
if (href) {
|
|
2414
|
-
return /* @__PURE__ */ jsx30(ListItem6.Navigation, { href });
|
|
2415
|
-
}
|
|
2416
|
-
if (onClick) {
|
|
2417
|
-
return /* @__PURE__ */ jsx30(ListItem6.Navigation, { onClick });
|
|
2418
|
-
}
|
|
2419
|
-
return null;
|
|
2420
|
-
};
|
|
2421
|
-
|
|
2422
|
-
// ../renderers/src/CollectionRenderer/components/SectionHeaderComponent.tsx
|
|
2423
|
-
import { jsx as jsx31 } from "react/jsx-runtime";
|
|
2424
|
-
var SectionHeaderComponent = ({
|
|
2425
|
-
title,
|
|
2426
|
-
callToAction
|
|
2427
|
-
}) => /* @__PURE__ */ jsx31(Header, { title, callToAction });
|
|
2428
|
-
|
|
2429
|
-
// ../renderers/src/CollectionRenderer/createCollectionRenderer.tsx
|
|
2430
|
-
import { jsx as jsx32 } from "react/jsx-runtime";
|
|
2431
|
-
var createCollectionRenderer = (canRender, components) => {
|
|
2432
|
-
const componeontsWithDefaults = __spreadValues({
|
|
2433
|
-
Search: SearchComponent,
|
|
2434
|
-
Filters: FiltersComponent,
|
|
2435
|
-
Filter: FilterComponent,
|
|
2436
|
-
Item: ItemComponent,
|
|
2437
|
-
SectionHeader: SectionHeaderComponent,
|
|
2438
|
-
Results: ContentComponent
|
|
2439
|
-
}, components);
|
|
2440
|
-
return {
|
|
2441
|
-
canRenderType: "collection",
|
|
2442
|
-
canRender,
|
|
2443
|
-
render: (props) => {
|
|
2444
|
-
return /* @__PURE__ */ jsx32(CollectionRendererComponent, __spreadValues(__spreadValues({}, props), componeontsWithDefaults));
|
|
2445
|
-
}
|
|
2446
|
-
};
|
|
2447
|
-
};
|
|
2448
|
-
|
|
2449
|
-
// ../renderers/src/CollectionRenderer/CollectionRenderer.tsx
|
|
2450
|
-
import { Fragment as Fragment3, jsx as jsx33, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
2451
|
-
var CollectionRendererComponent = (props) => {
|
|
2452
|
-
const { status, Search: Search4, Filters, Results } = props;
|
|
2453
|
-
return /* @__PURE__ */ jsxs7(Fragment3, { children: [
|
|
2454
|
-
/* @__PURE__ */ jsx33(Search4, __spreadValues({}, props)),
|
|
2455
|
-
/* @__PURE__ */ jsx33(Filters, __spreadValues({}, props)),
|
|
2456
|
-
status.type === "idle" || status.type === "loading" ? /* @__PURE__ */ jsx33(Results, __spreadValues({}, props)) : void 0,
|
|
2457
|
-
status.type === "error" && status.reason === "search" && /* @__PURE__ */ jsxs7(InlinePrompt, { width: "full", sentiment: "negative", children: [
|
|
2458
|
-
"Something went wrong,\xA0",
|
|
2459
|
-
/* @__PURE__ */ jsx33(DSLink, { onClick: status.retry, children: "click here to retry" })
|
|
2460
|
-
] })
|
|
2461
|
-
] });
|
|
2462
|
-
};
|
|
2463
|
-
var CollectionRenderer = createCollectionRenderer(() => true, {
|
|
2464
|
-
Search: (props) => /* @__PURE__ */ jsx33(SearchComponent, __spreadValues({}, props)),
|
|
2465
|
-
Filters: (props) => /* @__PURE__ */ jsx33(FiltersComponent, __spreadValues({}, props)),
|
|
2466
|
-
Filter: (props) => /* @__PURE__ */ jsx33(FilterComponent, __spreadValues({}, props)),
|
|
2467
|
-
Item: (props) => /* @__PURE__ */ jsx33(ItemComponent, __spreadValues({}, props)),
|
|
2468
|
-
SectionHeader: (props) => /* @__PURE__ */ jsx33(SectionHeaderComponent, __spreadValues({}, props)),
|
|
2469
|
-
Results: (props) => /* @__PURE__ */ jsx33(ContentComponent, __spreadValues({}, props))
|
|
2470
|
-
});
|
|
2471
|
-
var CollectionRenderer_default = CollectionRenderer;
|
|
2472
|
-
|
|
2473
1108
|
// ../renderers/src/ColumnsRenderer.tsx
|
|
2474
1109
|
var import_classnames3 = __toESM(require_classnames());
|
|
2475
1110
|
|
|
2476
1111
|
// ../renderers/src/utils/useIsCollapsed.ts
|
|
2477
|
-
import { useEffect as
|
|
1112
|
+
import { useEffect as useEffect5, useState as useState4 } from "react";
|
|
2478
1113
|
var COLLAPSE_QUERY = "(max-width: 767.98px)";
|
|
2479
1114
|
var supportsMatchMedia = () => typeof window !== "undefined" && !!window.matchMedia;
|
|
2480
1115
|
var useIsCollapsed = () => {
|
|
2481
|
-
const [collapsed, setCollapsed] =
|
|
1116
|
+
const [collapsed, setCollapsed] = useState4(
|
|
2482
1117
|
() => supportsMatchMedia() && window.matchMedia(COLLAPSE_QUERY).matches
|
|
2483
1118
|
);
|
|
2484
|
-
|
|
1119
|
+
useEffect5(() => {
|
|
2485
1120
|
if (supportsMatchMedia()) {
|
|
2486
1121
|
const mql = window.matchMedia(COLLAPSE_QUERY);
|
|
2487
1122
|
const update = () => setCollapsed(mql.matches);
|
|
@@ -2494,7 +1129,7 @@ var useIsCollapsed = () => {
|
|
|
2494
1129
|
};
|
|
2495
1130
|
|
|
2496
1131
|
// ../renderers/src/ColumnsRenderer.tsx
|
|
2497
|
-
import { jsx as
|
|
1132
|
+
import { jsx as jsx24, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
2498
1133
|
var RIGHT_FIRST_STACKING = "right-first-stacking";
|
|
2499
1134
|
var ColumnsRenderer = {
|
|
2500
1135
|
canRenderType: "columns",
|
|
@@ -2510,9 +1145,9 @@ function ColumnsRendererComponent({
|
|
|
2510
1145
|
var _a;
|
|
2511
1146
|
const isCollapsed = useIsCollapsed();
|
|
2512
1147
|
const reverse = isCollapsed && ((_a = tags == null ? void 0 : tags.includes(RIGHT_FIRST_STACKING)) != null ? _a : false);
|
|
2513
|
-
const startColumn = /* @__PURE__ */
|
|
2514
|
-
const endColumn = /* @__PURE__ */
|
|
2515
|
-
return /* @__PURE__ */
|
|
1148
|
+
const startColumn = /* @__PURE__ */ jsx24("div", { className: "df-columns-renderer-column", children: startChildren });
|
|
1149
|
+
const endColumn = /* @__PURE__ */ jsx24("div", { className: "df-columns-renderer-column", children: endChildren });
|
|
1150
|
+
return /* @__PURE__ */ jsxs5(
|
|
2516
1151
|
"div",
|
|
2517
1152
|
{
|
|
2518
1153
|
className: (0, import_classnames3.default)("df-columns-renderer-container", getMargin(margin), {
|
|
@@ -2556,7 +1191,7 @@ var dateToDateString = (date) => {
|
|
|
2556
1191
|
};
|
|
2557
1192
|
|
|
2558
1193
|
// ../renderers/src/components/VariableDateInput.tsx
|
|
2559
|
-
import { jsx as
|
|
1194
|
+
import { jsx as jsx25 } from "react/jsx-runtime";
|
|
2560
1195
|
function VariableDateInput({
|
|
2561
1196
|
control,
|
|
2562
1197
|
inputProps
|
|
@@ -2572,7 +1207,7 @@ function VariableDateInput({
|
|
|
2572
1207
|
onFocus
|
|
2573
1208
|
} = inputProps;
|
|
2574
1209
|
if (control === "date-lookup") {
|
|
2575
|
-
return /* @__PURE__ */
|
|
1210
|
+
return /* @__PURE__ */ jsx25(
|
|
2576
1211
|
DateLookup,
|
|
2577
1212
|
{
|
|
2578
1213
|
value: dateStringToDateOrNull(inputProps.value),
|
|
@@ -2588,7 +1223,7 @@ function VariableDateInput({
|
|
|
2588
1223
|
}
|
|
2589
1224
|
);
|
|
2590
1225
|
}
|
|
2591
|
-
return /* @__PURE__ */
|
|
1226
|
+
return /* @__PURE__ */ jsx25(
|
|
2592
1227
|
DateInput,
|
|
2593
1228
|
__spreadProps(__spreadValues({}, inputProps), {
|
|
2594
1229
|
dayAutoComplete: getAutocompleteString(autoComplete, "day"),
|
|
@@ -2605,7 +1240,7 @@ var getAutocompleteString = (value, suffix) => {
|
|
|
2605
1240
|
var VariableDateInput_default = VariableDateInput;
|
|
2606
1241
|
|
|
2607
1242
|
// ../renderers/src/DateInputRenderer.tsx
|
|
2608
|
-
import { jsx as
|
|
1243
|
+
import { jsx as jsx26 } from "react/jsx-runtime";
|
|
2609
1244
|
var DateInputRenderer = {
|
|
2610
1245
|
canRenderType: "input-date",
|
|
2611
1246
|
render: (props) => {
|
|
@@ -2630,7 +1265,7 @@ var DateInputRenderer = {
|
|
|
2630
1265
|
]);
|
|
2631
1266
|
const value = initialValue != null ? initialValue : "";
|
|
2632
1267
|
const inputProps = __spreadProps(__spreadValues({}, rest), { value, id });
|
|
2633
|
-
return /* @__PURE__ */
|
|
1268
|
+
return /* @__PURE__ */ jsx26(
|
|
2634
1269
|
FieldInput_default,
|
|
2635
1270
|
{
|
|
2636
1271
|
id,
|
|
@@ -2641,7 +1276,7 @@ var DateInputRenderer = {
|
|
|
2641
1276
|
loadingState: props.fieldLoadingState,
|
|
2642
1277
|
help,
|
|
2643
1278
|
features: props.features,
|
|
2644
|
-
children: /* @__PURE__ */
|
|
1279
|
+
children: /* @__PURE__ */ jsx26(VariableDateInput_default, { control, inputProps })
|
|
2645
1280
|
}
|
|
2646
1281
|
);
|
|
2647
1282
|
}
|
|
@@ -2649,16 +1284,44 @@ var DateInputRenderer = {
|
|
|
2649
1284
|
var DateInputRenderer_default = DateInputRenderer;
|
|
2650
1285
|
|
|
2651
1286
|
// ../renderers/src/DecisionRenderer/DecisionRenderer.tsx
|
|
2652
|
-
import { ListItem as
|
|
1287
|
+
import { ListItem as ListItem5 } from "@transferwise/components";
|
|
1288
|
+
|
|
1289
|
+
// ../renderers/src/utils/listItem/getAdditionalInfo.tsx
|
|
1290
|
+
import { ListItem as ListItem4 } from "@transferwise/components";
|
|
1291
|
+
import { jsx as jsx27 } from "react/jsx-runtime";
|
|
1292
|
+
var getAdditionalInfo = (additionalInfo) => {
|
|
1293
|
+
var _a, _b;
|
|
1294
|
+
if (!additionalInfo) {
|
|
1295
|
+
return void 0;
|
|
1296
|
+
}
|
|
1297
|
+
const { href, text, onClick } = additionalInfo;
|
|
1298
|
+
if (href || onClick) {
|
|
1299
|
+
return /* @__PURE__ */ jsx27(
|
|
1300
|
+
ListItem4.AdditionalInfo,
|
|
1301
|
+
{
|
|
1302
|
+
action: __spreadValues({
|
|
1303
|
+
label: text
|
|
1304
|
+
}, (_b = (_a = additionalInfo.getAnchorProps) == null ? void 0 : _a.call(additionalInfo)) != null ? _b : { onClick })
|
|
1305
|
+
}
|
|
1306
|
+
);
|
|
1307
|
+
}
|
|
1308
|
+
return /* @__PURE__ */ jsx27(ListItem4.AdditionalInfo, { children: additionalInfo == null ? void 0 : additionalInfo.text });
|
|
1309
|
+
};
|
|
1310
|
+
|
|
1311
|
+
// ../renderers/src/utils/listItem/shouldUseAvatar.ts
|
|
1312
|
+
var shouldUseAvatar = (control, tags) => {
|
|
1313
|
+
var _a;
|
|
1314
|
+
return control === "with-avatar" || ((_a = tags == null ? void 0 : tags.includes("with-avatar")) != null ? _a : false);
|
|
1315
|
+
};
|
|
2653
1316
|
|
|
2654
1317
|
// ../renderers/src/DecisionRenderer/DecisionWrapper.tsx
|
|
2655
|
-
import { Header as
|
|
2656
|
-
import { useState as
|
|
2657
|
-
import { useIntl as
|
|
1318
|
+
import { Header as Header2, SearchInput } from "@transferwise/components";
|
|
1319
|
+
import { useState as useState5 } from "react";
|
|
1320
|
+
import { useIntl as useIntl4 } from "react-intl";
|
|
2658
1321
|
|
|
2659
1322
|
// ../renderers/src/messages/filter.messages.ts
|
|
2660
|
-
import { defineMessages as
|
|
2661
|
-
var filter_messages_default =
|
|
1323
|
+
import { defineMessages as defineMessages3 } from "react-intl";
|
|
1324
|
+
var filter_messages_default = defineMessages3({
|
|
2662
1325
|
placeholder: {
|
|
2663
1326
|
id: "df.wise.filter.placeholder",
|
|
2664
1327
|
defaultMessage: "Start typing to search",
|
|
@@ -2676,10 +1339,10 @@ var filter_messages_default = defineMessages4({
|
|
|
2676
1339
|
}
|
|
2677
1340
|
});
|
|
2678
1341
|
|
|
2679
|
-
// ../renderers/src/
|
|
2680
|
-
function
|
|
1342
|
+
// ../renderers/src/utils/filter-and-sort-items.ts
|
|
1343
|
+
function filterAndSortItems(options, query) {
|
|
2681
1344
|
const upperQuery = normalizeAndRemoveAccents(query);
|
|
2682
|
-
const filteredItems =
|
|
1345
|
+
const filteredItems = options.filter((option) => {
|
|
2683
1346
|
var _a, _b, _c, _d;
|
|
2684
1347
|
const searchableWords = [
|
|
2685
1348
|
option.title,
|
|
@@ -2724,12 +1387,12 @@ function filterAndSortDecisionOptions(selectOptions, query) {
|
|
|
2724
1387
|
var normalizeAndRemoveAccents = (text) => text.trim().toLowerCase().normalize("NFKD").replace(new RegExp("\\p{Diacritic}", "gu"), "");
|
|
2725
1388
|
|
|
2726
1389
|
// ../renderers/src/DecisionRenderer/GroupedDecisionList.tsx
|
|
2727
|
-
import { Header
|
|
2728
|
-
import { useIntl as
|
|
1390
|
+
import { Header, Section } from "@transferwise/components";
|
|
1391
|
+
import { useIntl as useIntl3 } from "react-intl";
|
|
2729
1392
|
|
|
2730
1393
|
// ../renderers/src/messages/group.messages.ts
|
|
2731
|
-
import { defineMessages as
|
|
2732
|
-
var group_messages_default =
|
|
1394
|
+
import { defineMessages as defineMessages4 } from "react-intl";
|
|
1395
|
+
var group_messages_default = defineMessages4({
|
|
2733
1396
|
all: {
|
|
2734
1397
|
id: "df.wise.group.all",
|
|
2735
1398
|
defaultMessage: "All",
|
|
@@ -2763,19 +1426,19 @@ var getGroupsFromTags = (knownTags, items) => {
|
|
|
2763
1426
|
};
|
|
2764
1427
|
|
|
2765
1428
|
// ../renderers/src/DecisionRenderer/GroupedDecisionList.tsx
|
|
2766
|
-
import { Fragment as
|
|
1429
|
+
import { Fragment as Fragment2, jsx as jsx28, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
2767
1430
|
var groupingTags = Object.keys(group_messages_default).filter((key) => key !== "all");
|
|
2768
1431
|
var isGroupedDecision = (options) => {
|
|
2769
1432
|
return getGroupsFromTags(groupingTags, options).length > 0;
|
|
2770
1433
|
};
|
|
2771
1434
|
var GroupedDecisionList = (_a) => {
|
|
2772
1435
|
var _b = _a, { renderDecisionList: renderDecisionList2 } = _b, rest = __objRest(_b, ["renderDecisionList"]);
|
|
2773
|
-
const { formatMessage } =
|
|
1436
|
+
const { formatMessage } = useIntl3();
|
|
2774
1437
|
const { options } = rest;
|
|
2775
1438
|
const itemsByTag = [...getGroupsFromTags(groupingTags, options), { tag: "all", items: options }];
|
|
2776
|
-
return /* @__PURE__ */
|
|
2777
|
-
/* @__PURE__ */
|
|
2778
|
-
|
|
1439
|
+
return /* @__PURE__ */ jsx28(Fragment2, { children: itemsByTag.map(({ tag, items }) => /* @__PURE__ */ jsxs6(Section, { children: [
|
|
1440
|
+
/* @__PURE__ */ jsx28(
|
|
1441
|
+
Header,
|
|
2779
1442
|
{
|
|
2780
1443
|
as: "h2",
|
|
2781
1444
|
title: tag in group_messages_default ? formatMessage(group_messages_default[tag]) : tag
|
|
@@ -2786,25 +1449,26 @@ var GroupedDecisionList = (_a) => {
|
|
|
2786
1449
|
};
|
|
2787
1450
|
|
|
2788
1451
|
// ../renderers/src/DecisionRenderer/DecisionWrapper.tsx
|
|
2789
|
-
import { Fragment as
|
|
1452
|
+
import { Fragment as Fragment3, jsx as jsx29, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
2790
1453
|
var DecisionWrapper = (props) => {
|
|
2791
|
-
|
|
2792
|
-
|
|
2793
|
-
|
|
1454
|
+
const { title, control, margin } = props;
|
|
1455
|
+
return /* @__PURE__ */ jsxs7("div", { className: getMargin(margin), children: [
|
|
1456
|
+
title && /* @__PURE__ */ jsx29(Header2, { as: "h2", title }),
|
|
1457
|
+
control === "filtered" ? /* @__PURE__ */ jsx29(FilteredDecisionList, __spreadValues({}, props)) : /* @__PURE__ */ jsx29(UnfilteredDecisionList, __spreadValues({}, props))
|
|
2794
1458
|
] });
|
|
2795
1459
|
};
|
|
2796
1460
|
var UnfilteredDecisionList = (_a) => {
|
|
2797
1461
|
var _b = _a, { renderDecisionList: renderDecisionList2 } = _b, rest = __objRest(_b, ["renderDecisionList"]);
|
|
2798
|
-
return isGroupedDecision(rest.options) ? /* @__PURE__ */
|
|
1462
|
+
return isGroupedDecision(rest.options) ? /* @__PURE__ */ jsx29(GroupedDecisionList, __spreadProps(__spreadValues({}, rest), { renderDecisionList: renderDecisionList2 })) : renderDecisionList2(rest);
|
|
2799
1463
|
};
|
|
2800
1464
|
var FilteredDecisionList = (props) => {
|
|
2801
|
-
const { formatMessage } =
|
|
2802
|
-
const [query, setQuery] =
|
|
1465
|
+
const { formatMessage } = useIntl4();
|
|
1466
|
+
const [query, setQuery] = useState5("");
|
|
2803
1467
|
const { control, options, renderDecisionList: renderDecisionList2 } = props;
|
|
2804
|
-
const filteredOptions = (query == null ? void 0 : query.length) > 0 ?
|
|
1468
|
+
const filteredOptions = (query == null ? void 0 : query.length) > 0 ? filterAndSortItems(options, query) : options;
|
|
2805
1469
|
const isGrouped = isGroupedDecision(options);
|
|
2806
|
-
return /* @__PURE__ */
|
|
2807
|
-
/* @__PURE__ */
|
|
1470
|
+
return /* @__PURE__ */ jsxs7(Fragment3, { children: [
|
|
1471
|
+
/* @__PURE__ */ jsx29(
|
|
2808
1472
|
SearchInput,
|
|
2809
1473
|
{
|
|
2810
1474
|
placeholder: formatMessage(filter_messages_default.placeholder),
|
|
@@ -2816,25 +1480,25 @@ var FilteredDecisionList = (props) => {
|
|
|
2816
1480
|
}
|
|
2817
1481
|
}
|
|
2818
1482
|
),
|
|
2819
|
-
isGrouped && query.length === 0 ? /* @__PURE__ */
|
|
2820
|
-
query.length > 0 && /* @__PURE__ */
|
|
1483
|
+
isGrouped && query.length === 0 ? /* @__PURE__ */ jsx29(GroupedDecisionList, __spreadValues({}, props)) : /* @__PURE__ */ jsxs7(Fragment3, { children: [
|
|
1484
|
+
query.length > 0 && /* @__PURE__ */ jsx29(Header2, { as: "h2", title: formatMessage(filter_messages_default.results), className: "m-t-4" }),
|
|
2821
1485
|
filteredOptions.length > 0 ? renderDecisionList2({
|
|
2822
1486
|
control,
|
|
2823
1487
|
className: query.length === 0 ? "m-t-3" : "",
|
|
2824
1488
|
options: filteredOptions
|
|
2825
|
-
}) : /* @__PURE__ */
|
|
1489
|
+
}) : /* @__PURE__ */ jsx29("p", { children: formatMessage(filter_messages_default.noResults) })
|
|
2826
1490
|
] })
|
|
2827
1491
|
] });
|
|
2828
1492
|
};
|
|
2829
1493
|
|
|
2830
1494
|
// ../renderers/src/DecisionRenderer/DecisionRenderer.tsx
|
|
2831
|
-
import { Fragment as
|
|
1495
|
+
import { Fragment as Fragment4, jsx as jsx30 } from "react/jsx-runtime";
|
|
2832
1496
|
var DecisionRenderer = {
|
|
2833
1497
|
canRenderType: "decision",
|
|
2834
|
-
render: (props) => /* @__PURE__ */
|
|
1498
|
+
render: (props) => /* @__PURE__ */ jsx30(DecisionWrapper, __spreadProps(__spreadValues({}, props), { renderDecisionList }))
|
|
2835
1499
|
};
|
|
2836
1500
|
var renderDecisionList = ({ options, control }) => {
|
|
2837
|
-
return /* @__PURE__ */
|
|
1501
|
+
return /* @__PURE__ */ jsx30(Fragment4, { children: options.map((_a) => {
|
|
2838
1502
|
var _b = _a, { onClick } = _b, rest = __objRest(_b, ["onClick"]);
|
|
2839
1503
|
const {
|
|
2840
1504
|
description,
|
|
@@ -2847,8 +1511,8 @@ var renderDecisionList = ({ options, control }) => {
|
|
|
2847
1511
|
supportingValues,
|
|
2848
1512
|
tags
|
|
2849
1513
|
} = rest;
|
|
2850
|
-
return /* @__PURE__ */
|
|
2851
|
-
|
|
1514
|
+
return /* @__PURE__ */ jsx30(
|
|
1515
|
+
ListItem5,
|
|
2852
1516
|
{
|
|
2853
1517
|
title: itemTitle,
|
|
2854
1518
|
subtitle: description,
|
|
@@ -2859,7 +1523,7 @@ var renderDecisionList = ({ options, control }) => {
|
|
|
2859
1523
|
media: getMedia(media, shouldUseAvatar(control, tags)),
|
|
2860
1524
|
prompt: getInlineAlert(inlineAlert),
|
|
2861
1525
|
additionalInfo: additionalText ? getAdditionalInfo({ text: additionalText }) : void 0,
|
|
2862
|
-
control: /* @__PURE__ */
|
|
1526
|
+
control: /* @__PURE__ */ jsx30(ListItem5.Navigation, __spreadValues({}, getAnchorProps()))
|
|
2863
1527
|
},
|
|
2864
1528
|
JSON.stringify(rest)
|
|
2865
1529
|
);
|
|
@@ -2869,7 +1533,7 @@ var DecisionRenderer_default = DecisionRenderer;
|
|
|
2869
1533
|
|
|
2870
1534
|
// ../renderers/src/DividerRenderer.tsx
|
|
2871
1535
|
import { Divider } from "@transferwise/components";
|
|
2872
|
-
import { jsx as
|
|
1536
|
+
import { jsx as jsx31 } from "react/jsx-runtime";
|
|
2873
1537
|
var mapControlToLevel = (control) => {
|
|
2874
1538
|
switch (control) {
|
|
2875
1539
|
case "section":
|
|
@@ -2882,16 +1546,16 @@ var mapControlToLevel = (control) => {
|
|
|
2882
1546
|
};
|
|
2883
1547
|
var DividerRenderer = {
|
|
2884
1548
|
canRenderType: "divider",
|
|
2885
|
-
render: ({ margin, control }) => /* @__PURE__ */
|
|
1549
|
+
render: ({ margin, control }) => /* @__PURE__ */ jsx31(Divider, { className: `m-t-0 d-block ${getMargin(margin)}`, level: mapControlToLevel(control) })
|
|
2886
1550
|
};
|
|
2887
1551
|
var DividerRenderer_default = DividerRenderer;
|
|
2888
1552
|
|
|
2889
1553
|
// ../renderers/src/ExternalConfirmationRenderer.tsx
|
|
2890
|
-
import { Button as
|
|
1554
|
+
import { Button as Button3, Markdown as Markdown2, Modal } from "@transferwise/components";
|
|
2891
1555
|
|
|
2892
1556
|
// ../renderers/src/messages/external-confirmation.messages.ts
|
|
2893
|
-
import { defineMessages as
|
|
2894
|
-
var external_confirmation_messages_default =
|
|
1557
|
+
import { defineMessages as defineMessages5 } from "react-intl";
|
|
1558
|
+
var external_confirmation_messages_default = defineMessages5({
|
|
2895
1559
|
title: {
|
|
2896
1560
|
id: "df.wise.ExternalConfirmation.title",
|
|
2897
1561
|
defaultMessage: "Please confirm",
|
|
@@ -2915,9 +1579,9 @@ var external_confirmation_messages_default = defineMessages6({
|
|
|
2915
1579
|
});
|
|
2916
1580
|
|
|
2917
1581
|
// ../renderers/src/ExternalConfirmationRenderer.tsx
|
|
2918
|
-
import { useIntl as
|
|
2919
|
-
import { useEffect as
|
|
2920
|
-
import { Fragment as
|
|
1582
|
+
import { useIntl as useIntl5 } from "react-intl";
|
|
1583
|
+
import { useEffect as useEffect6 } from "react";
|
|
1584
|
+
import { Fragment as Fragment5, jsx as jsx32, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
2921
1585
|
var ExternalConfirmationRenderer = {
|
|
2922
1586
|
canRenderType: "external-confirmation",
|
|
2923
1587
|
render: ExternalConfirmationRendererComponent
|
|
@@ -2928,20 +1592,20 @@ function ExternalConfirmationRendererComponent({
|
|
|
2928
1592
|
open,
|
|
2929
1593
|
onCancel
|
|
2930
1594
|
}) {
|
|
2931
|
-
const { formatMessage } =
|
|
2932
|
-
|
|
1595
|
+
const { formatMessage } = useIntl5();
|
|
1596
|
+
useEffect6(() => {
|
|
2933
1597
|
open();
|
|
2934
1598
|
}, []);
|
|
2935
|
-
return /* @__PURE__ */
|
|
1599
|
+
return /* @__PURE__ */ jsx32(
|
|
2936
1600
|
Modal,
|
|
2937
1601
|
{
|
|
2938
1602
|
open: visible,
|
|
2939
1603
|
title: formatMessage(external_confirmation_messages_default.title),
|
|
2940
|
-
body: /* @__PURE__ */
|
|
2941
|
-
/* @__PURE__ */
|
|
2942
|
-
/* @__PURE__ */
|
|
2943
|
-
/* @__PURE__ */
|
|
2944
|
-
|
|
1604
|
+
body: /* @__PURE__ */ jsxs8(Fragment5, { children: [
|
|
1605
|
+
/* @__PURE__ */ jsx32(Markdown2, { config: { link: { target: "_blank" } }, className: "text-xs-center m-b-5", children: formatMessage(external_confirmation_messages_default.description, { origin: getOrigin(url) }) }),
|
|
1606
|
+
/* @__PURE__ */ jsx32("div", { className: "df-box-renderer-fixed-width", children: /* @__PURE__ */ jsxs8("div", { className: "df-box-renderer-width-lg", children: [
|
|
1607
|
+
/* @__PURE__ */ jsx32(
|
|
1608
|
+
Button3,
|
|
2945
1609
|
{
|
|
2946
1610
|
v2: true,
|
|
2947
1611
|
block: true,
|
|
@@ -2954,7 +1618,7 @@ function ExternalConfirmationRendererComponent({
|
|
|
2954
1618
|
children: formatMessage(external_confirmation_messages_default.open)
|
|
2955
1619
|
}
|
|
2956
1620
|
),
|
|
2957
|
-
/* @__PURE__ */
|
|
1621
|
+
/* @__PURE__ */ jsx32(Button3, { v2: true, block: true, className: "m-b-2", priority: "tertiary", size: "md", onClick: onCancel, children: formatMessage(external_confirmation_messages_default.cancel) })
|
|
2958
1622
|
] }) })
|
|
2959
1623
|
] }),
|
|
2960
1624
|
onClose: onCancel
|
|
@@ -2971,27 +1635,27 @@ function getOrigin(url) {
|
|
|
2971
1635
|
var ExternalConfirmationRenderer_default = ExternalConfirmationRenderer;
|
|
2972
1636
|
|
|
2973
1637
|
// ../renderers/src/FormRenderer.tsx
|
|
2974
|
-
import { jsx as
|
|
1638
|
+
import { jsx as jsx33 } from "react/jsx-runtime";
|
|
2975
1639
|
var FormRenderer = {
|
|
2976
1640
|
canRenderType: "form",
|
|
2977
|
-
render: ({ children, margin }) => /* @__PURE__ */
|
|
1641
|
+
render: ({ children, margin }) => /* @__PURE__ */ jsx33("div", { className: getMargin(margin), children })
|
|
2978
1642
|
};
|
|
2979
1643
|
var FormRenderer_default = FormRenderer;
|
|
2980
1644
|
|
|
2981
1645
|
// ../renderers/src/FormSectionRenderer.tsx
|
|
2982
|
-
import { Header as
|
|
2983
|
-
import { jsx as
|
|
1646
|
+
import { Header as Header3 } from "@transferwise/components";
|
|
1647
|
+
import { jsx as jsx34, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
2984
1648
|
var FormSectionRenderer = {
|
|
2985
1649
|
canRenderType: "form-section",
|
|
2986
|
-
render: ({ title, description, children }) => /* @__PURE__ */
|
|
2987
|
-
title && /* @__PURE__ */
|
|
2988
|
-
|
|
1650
|
+
render: ({ title, description, children }) => /* @__PURE__ */ jsxs9("fieldset", { children: [
|
|
1651
|
+
title && /* @__PURE__ */ jsx34(
|
|
1652
|
+
Header3,
|
|
2989
1653
|
{
|
|
2990
1654
|
as: "h2",
|
|
2991
1655
|
title
|
|
2992
1656
|
}
|
|
2993
1657
|
),
|
|
2994
|
-
description && /* @__PURE__ */
|
|
1658
|
+
description && /* @__PURE__ */ jsx34("p", { children: description }),
|
|
2995
1659
|
children
|
|
2996
1660
|
] })
|
|
2997
1661
|
};
|
|
@@ -2999,18 +1663,18 @@ var FormSectionRenderer_default = FormSectionRenderer;
|
|
|
2999
1663
|
|
|
3000
1664
|
// ../renderers/src/HeadingRenderer.tsx
|
|
3001
1665
|
import { Display, Title } from "@transferwise/components";
|
|
3002
|
-
import { jsx as
|
|
1666
|
+
import { jsx as jsx35 } from "react/jsx-runtime";
|
|
3003
1667
|
var HeadingRenderer = {
|
|
3004
1668
|
canRenderType: "heading",
|
|
3005
|
-
render: (props) => /* @__PURE__ */
|
|
1669
|
+
render: (props) => /* @__PURE__ */ jsx35(Heading, __spreadValues({}, props))
|
|
3006
1670
|
};
|
|
3007
1671
|
function Heading(props) {
|
|
3008
1672
|
const { text, size, align, margin, control } = props;
|
|
3009
1673
|
const className = getTextAlignmentAndMargin({ align, margin });
|
|
3010
|
-
return control === "display" ? /* @__PURE__ */
|
|
1674
|
+
return control === "display" ? /* @__PURE__ */ jsx35(DisplayHeading, { size, text, className }) : /* @__PURE__ */ jsx35(StandardHeading, { size, text, className });
|
|
3011
1675
|
}
|
|
3012
1676
|
function DisplayHeading({ size, text, className }) {
|
|
3013
|
-
return /* @__PURE__ */
|
|
1677
|
+
return /* @__PURE__ */ jsx35(Display, { type: getDisplayType(size), className, children: text });
|
|
3014
1678
|
}
|
|
3015
1679
|
var getDisplayType = (size) => {
|
|
3016
1680
|
switch (size) {
|
|
@@ -3026,7 +1690,7 @@ var getDisplayType = (size) => {
|
|
|
3026
1690
|
}
|
|
3027
1691
|
};
|
|
3028
1692
|
function StandardHeading({ size, text, className }) {
|
|
3029
|
-
return /* @__PURE__ */
|
|
1693
|
+
return /* @__PURE__ */ jsx35(Title, { type: getTitleTypeBySize(size), className, children: text });
|
|
3030
1694
|
}
|
|
3031
1695
|
var getTitleTypeBySize = (size) => {
|
|
3032
1696
|
var _a;
|
|
@@ -3043,7 +1707,7 @@ var HeadingRenderer_default = HeadingRenderer;
|
|
|
3043
1707
|
|
|
3044
1708
|
// ../renderers/src/ImageRenderer/UrlImage.tsx
|
|
3045
1709
|
import { Image } from "@transferwise/components";
|
|
3046
|
-
import { useEffect as
|
|
1710
|
+
import { useEffect as useEffect7, useState as useState6 } from "react";
|
|
3047
1711
|
|
|
3048
1712
|
// ../renderers/src/utils/api-utils.ts
|
|
3049
1713
|
function isRelativePath(url = "") {
|
|
@@ -3053,7 +1717,7 @@ function isRelativePath(url = "") {
|
|
|
3053
1717
|
}
|
|
3054
1718
|
|
|
3055
1719
|
// ../renderers/src/ImageRenderer/UrlImage.tsx
|
|
3056
|
-
import { jsx as
|
|
1720
|
+
import { jsx as jsx36 } from "react/jsx-runtime";
|
|
3057
1721
|
function UrlImage({
|
|
3058
1722
|
accessibilityDescription,
|
|
3059
1723
|
align,
|
|
@@ -3062,13 +1726,13 @@ function UrlImage({
|
|
|
3062
1726
|
uri,
|
|
3063
1727
|
httpClient
|
|
3064
1728
|
}) {
|
|
3065
|
-
const [imageSource, setImageSource] =
|
|
3066
|
-
|
|
1729
|
+
const [imageSource, setImageSource] = useState6("");
|
|
1730
|
+
useEffect7(() => {
|
|
3067
1731
|
if (!uri.startsWith("urn:")) {
|
|
3068
1732
|
void getImageSource(httpClient, uri).then(setImageSource);
|
|
3069
1733
|
}
|
|
3070
1734
|
}, [uri, httpClient]);
|
|
3071
|
-
return /* @__PURE__ */
|
|
1735
|
+
return /* @__PURE__ */ jsx36("div", { className: `df-image ${align} ${size || "md"} ${getMargin(margin)}`, children: /* @__PURE__ */ jsx36(
|
|
3072
1736
|
Image,
|
|
3073
1737
|
{
|
|
3074
1738
|
className: "df-reserve-space",
|
|
@@ -3112,7 +1776,7 @@ var getImageSource = async (httpClient, imageUrl) => {
|
|
|
3112
1776
|
};
|
|
3113
1777
|
|
|
3114
1778
|
// ../renderers/src/ImageRenderer/UrnFlagImage.tsx
|
|
3115
|
-
import { jsx as
|
|
1779
|
+
import { jsx as jsx37 } from "react/jsx-runtime";
|
|
3116
1780
|
var maxFlagSize = 600;
|
|
3117
1781
|
function UrnFlagImage({
|
|
3118
1782
|
accessibilityDescription,
|
|
@@ -3121,7 +1785,7 @@ function UrnFlagImage({
|
|
|
3121
1785
|
size,
|
|
3122
1786
|
uri
|
|
3123
1787
|
}) {
|
|
3124
|
-
return /* @__PURE__ */
|
|
1788
|
+
return /* @__PURE__ */ jsx37("div", { className: `df-image ${align} ${size || "md"} ${getMargin(margin)}`, children: /* @__PURE__ */ jsx37(UrnFlag, { size: maxFlagSize, urn: uri, accessibilityDescription }) });
|
|
3125
1789
|
}
|
|
3126
1790
|
|
|
3127
1791
|
// ../renderers/src/ImageRenderer/UrnIllustration.tsx
|
|
@@ -3129,7 +1793,7 @@ import {
|
|
|
3129
1793
|
Illustration,
|
|
3130
1794
|
isIllustrationSupport3D
|
|
3131
1795
|
} from "@wise/art";
|
|
3132
|
-
import { useState as
|
|
1796
|
+
import { useState as useState7 } from "react";
|
|
3133
1797
|
|
|
3134
1798
|
// ../renderers/src/ImageRenderer/isAnimated.ts
|
|
3135
1799
|
var isAnimated = (uri) => {
|
|
@@ -3140,7 +1804,7 @@ var isAnimated = (uri) => {
|
|
|
3140
1804
|
// ../renderers/src/ImageRenderer/SafeIllustration3D.tsx
|
|
3141
1805
|
import { Illustration3D } from "@wise/art";
|
|
3142
1806
|
import { Component } from "react";
|
|
3143
|
-
import { jsx as
|
|
1807
|
+
import { jsx as jsx38 } from "react/jsx-runtime";
|
|
3144
1808
|
var Illustration3DErrorBoundary = class extends Component {
|
|
3145
1809
|
constructor(props) {
|
|
3146
1810
|
super(props);
|
|
@@ -3152,7 +1816,7 @@ var Illustration3DErrorBoundary = class extends Component {
|
|
|
3152
1816
|
componentDidCatch() {
|
|
3153
1817
|
this.props.onError();
|
|
3154
1818
|
}
|
|
3155
|
-
|
|
1819
|
+
render() {
|
|
3156
1820
|
if (this.state.hasError) {
|
|
3157
1821
|
return null;
|
|
3158
1822
|
}
|
|
@@ -3164,12 +1828,12 @@ var SafeIllustration3D = ({
|
|
|
3164
1828
|
size,
|
|
3165
1829
|
onError
|
|
3166
1830
|
}) => {
|
|
3167
|
-
return /* @__PURE__ */
|
|
1831
|
+
return /* @__PURE__ */ jsx38(Illustration3DErrorBoundary, { onError, children: /* @__PURE__ */ jsx38(Illustration3D, { name, size }) });
|
|
3168
1832
|
};
|
|
3169
1833
|
var SafeIllustration3D_default = SafeIllustration3D;
|
|
3170
1834
|
|
|
3171
1835
|
// ../renderers/src/ImageRenderer/UrnIllustration.tsx
|
|
3172
|
-
import { jsx as
|
|
1836
|
+
import { jsx as jsx39 } from "react/jsx-runtime";
|
|
3173
1837
|
var urnPrefix = "urn:wise:illustrations:";
|
|
3174
1838
|
var isUrnIllustration = (uri) => uri.startsWith(urnPrefix);
|
|
3175
1839
|
function UrnIllustration({
|
|
@@ -3179,12 +1843,12 @@ function UrnIllustration({
|
|
|
3179
1843
|
size,
|
|
3180
1844
|
uri
|
|
3181
1845
|
}) {
|
|
3182
|
-
const [has3DFailed, setHas3DFailed] =
|
|
1846
|
+
const [has3DFailed, setHas3DFailed] = useState7(false);
|
|
3183
1847
|
const illustrationSize = getIllustrationSize(size);
|
|
3184
1848
|
const illustrationName = getIllustrationName(uri);
|
|
3185
1849
|
const illustration3DName = getIllustration3DName(uri);
|
|
3186
1850
|
if (illustration3DName && isAnimated(uri) && !has3DFailed) {
|
|
3187
|
-
return /* @__PURE__ */
|
|
1851
|
+
return /* @__PURE__ */ jsx39("div", { className: `df-image ${align} ${getMargin(margin)}`, children: /* @__PURE__ */ jsx39(
|
|
3188
1852
|
SafeIllustration3D_default,
|
|
3189
1853
|
{
|
|
3190
1854
|
name: illustration3DName,
|
|
@@ -3193,7 +1857,7 @@ function UrnIllustration({
|
|
|
3193
1857
|
}
|
|
3194
1858
|
) });
|
|
3195
1859
|
}
|
|
3196
|
-
return /* @__PURE__ */
|
|
1860
|
+
return /* @__PURE__ */ jsx39("div", { className: `df-image ${align} ${getMargin(margin)}`, children: /* @__PURE__ */ jsx39(
|
|
3197
1861
|
Illustration,
|
|
3198
1862
|
{
|
|
3199
1863
|
className: "df-illustration",
|
|
@@ -3213,32 +1877,32 @@ var getIllustration3DName = (uri) => {
|
|
|
3213
1877
|
};
|
|
3214
1878
|
|
|
3215
1879
|
// ../renderers/src/ImageRenderer/UrnImage.tsx
|
|
3216
|
-
import { jsx as
|
|
1880
|
+
import { jsx as jsx40 } from "react/jsx-runtime";
|
|
3217
1881
|
var isUrnImage = (uri) => uri.startsWith("urn:");
|
|
3218
1882
|
function UrnImage(props) {
|
|
3219
1883
|
const { uri } = props;
|
|
3220
1884
|
if (isUrnIllustration(uri)) {
|
|
3221
|
-
return /* @__PURE__ */
|
|
1885
|
+
return /* @__PURE__ */ jsx40(UrnIllustration, __spreadValues({}, props));
|
|
3222
1886
|
}
|
|
3223
1887
|
if (isUrnFlag(uri)) {
|
|
3224
|
-
return /* @__PURE__ */
|
|
1888
|
+
return /* @__PURE__ */ jsx40(UrnFlagImage, __spreadValues({}, props));
|
|
3225
1889
|
}
|
|
3226
1890
|
return null;
|
|
3227
1891
|
}
|
|
3228
1892
|
|
|
3229
1893
|
// ../renderers/src/ImageRenderer/ImageRenderer.tsx
|
|
3230
|
-
import { jsx as
|
|
1894
|
+
import { jsx as jsx41 } from "react/jsx-runtime";
|
|
3231
1895
|
var ImageRenderer = {
|
|
3232
1896
|
canRenderType: "image",
|
|
3233
|
-
render: (props) => isUrnImage(props.uri) ? /* @__PURE__ */
|
|
1897
|
+
render: (props) => isUrnImage(props.uri) ? /* @__PURE__ */ jsx41(UrnImage, __spreadValues({}, props)) : /* @__PURE__ */ jsx41(UrlImage, __spreadValues({}, props))
|
|
3234
1898
|
};
|
|
3235
1899
|
|
|
3236
1900
|
// ../renderers/src/ImageRenderer/index.tsx
|
|
3237
1901
|
var ImageRenderer_default = ImageRenderer;
|
|
3238
1902
|
|
|
3239
1903
|
// ../renderers/src/InstructionsRenderer.tsx
|
|
3240
|
-
import { Header as
|
|
3241
|
-
import { jsx as
|
|
1904
|
+
import { Header as Header4, InstructionsList } from "@transferwise/components";
|
|
1905
|
+
import { jsx as jsx42, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
3242
1906
|
var doContext = ["positive", "neutral"];
|
|
3243
1907
|
var dontContext = ["warning", "negative"];
|
|
3244
1908
|
var InstructionsRenderer = {
|
|
@@ -3246,16 +1910,16 @@ var InstructionsRenderer = {
|
|
|
3246
1910
|
render: ({ items, margin, title }) => {
|
|
3247
1911
|
const dos = items.filter((item) => doContext.includes(item.context)).map(({ text }) => text);
|
|
3248
1912
|
const donts = items.filter((item) => dontContext.includes(item.context)).map(({ text }) => text);
|
|
3249
|
-
return /* @__PURE__ */
|
|
3250
|
-
title ? /* @__PURE__ */
|
|
3251
|
-
/* @__PURE__ */
|
|
1913
|
+
return /* @__PURE__ */ jsxs10("div", { className: getMargin(margin), children: [
|
|
1914
|
+
title ? /* @__PURE__ */ jsx42(Header4, { title }) : null,
|
|
1915
|
+
/* @__PURE__ */ jsx42(InstructionsList, { dos, donts })
|
|
3252
1916
|
] });
|
|
3253
1917
|
}
|
|
3254
1918
|
};
|
|
3255
1919
|
var InstructionsRenderer_default = InstructionsRenderer;
|
|
3256
1920
|
|
|
3257
1921
|
// ../renderers/src/IntegerInputRenderer.tsx
|
|
3258
|
-
import { Input
|
|
1922
|
+
import { Input, InputGroup } from "@transferwise/components";
|
|
3259
1923
|
|
|
3260
1924
|
// ../renderers/src/utils/input-utils.ts
|
|
3261
1925
|
var onWheel = (event) => {
|
|
@@ -3280,7 +1944,7 @@ function pick(obj, ...keys) {
|
|
|
3280
1944
|
}
|
|
3281
1945
|
|
|
3282
1946
|
// ../renderers/src/IntegerInputRenderer.tsx
|
|
3283
|
-
import { jsx as
|
|
1947
|
+
import { jsx as jsx43 } from "react/jsx-runtime";
|
|
3284
1948
|
var IntegerInputRenderer = {
|
|
3285
1949
|
canRenderType: "input-integer",
|
|
3286
1950
|
render: (props) => {
|
|
@@ -3295,7 +1959,7 @@ var IntegerInputRenderer = {
|
|
|
3295
1959
|
"maximum",
|
|
3296
1960
|
"minimum"
|
|
3297
1961
|
);
|
|
3298
|
-
return /* @__PURE__ */
|
|
1962
|
+
return /* @__PURE__ */ jsx43(
|
|
3299
1963
|
FieldInput_default,
|
|
3300
1964
|
{
|
|
3301
1965
|
id,
|
|
@@ -3306,8 +1970,8 @@ var IntegerInputRenderer = {
|
|
|
3306
1970
|
loadingState: props.fieldLoadingState,
|
|
3307
1971
|
help,
|
|
3308
1972
|
features: props.features,
|
|
3309
|
-
children: /* @__PURE__ */
|
|
3310
|
-
|
|
1973
|
+
children: /* @__PURE__ */ jsx43(InputGroup, { addonStart: getInputGroupAddonStart(media), children: /* @__PURE__ */ jsx43(
|
|
1974
|
+
Input,
|
|
3311
1975
|
__spreadValues({
|
|
3312
1976
|
id,
|
|
3313
1977
|
name: id,
|
|
@@ -3329,12 +1993,39 @@ var IntegerInputRenderer = {
|
|
|
3329
1993
|
var IntegerInputRenderer_default = IntegerInputRenderer;
|
|
3330
1994
|
|
|
3331
1995
|
// ../renderers/src/ListRenderer.tsx
|
|
3332
|
-
import { ListItem as
|
|
1996
|
+
import { ListItem as ListItem7 } from "@transferwise/components";
|
|
1997
|
+
|
|
1998
|
+
// ../renderers/src/utils/listItem/getCTAControl.tsx
|
|
1999
|
+
import { ListItem as ListItem6 } from "@transferwise/components";
|
|
2000
|
+
import { jsx as jsx44 } from "react/jsx-runtime";
|
|
2001
|
+
var getCTAControl = (callToAction, { ctaSecondary, fullyInteractive }) => {
|
|
2002
|
+
if (!callToAction) {
|
|
2003
|
+
return void 0;
|
|
2004
|
+
}
|
|
2005
|
+
const { accessibilityDescription, title, context } = callToAction;
|
|
2006
|
+
const { priority, sentiment } = getPriorityAndSentiment(ctaSecondary, context);
|
|
2007
|
+
return /* @__PURE__ */ jsx44(
|
|
2008
|
+
ListItem6.Button,
|
|
2009
|
+
__spreadProps(__spreadValues({}, callToAction.getAnchorProps()), {
|
|
2010
|
+
partiallyInteractive: !fullyInteractive,
|
|
2011
|
+
priority,
|
|
2012
|
+
"aria-description": accessibilityDescription,
|
|
2013
|
+
sentiment,
|
|
2014
|
+
children: title
|
|
2015
|
+
})
|
|
2016
|
+
);
|
|
2017
|
+
};
|
|
2018
|
+
var getPriorityAndSentiment = (ctaSecondary, context) => {
|
|
2019
|
+
if (context === "negative") {
|
|
2020
|
+
return { priority: "secondary", sentiment: "negative" };
|
|
2021
|
+
}
|
|
2022
|
+
return { priority: ctaSecondary ? "secondary" : "secondary-neutral", sentiment: "default" };
|
|
2023
|
+
};
|
|
3333
2024
|
|
|
3334
2025
|
// ../renderers/src/components/Header.tsx
|
|
3335
2026
|
import { Header as DSHeader } from "@transferwise/components";
|
|
3336
|
-
import { jsx as
|
|
3337
|
-
var
|
|
2027
|
+
import { jsx as jsx45 } from "react/jsx-runtime";
|
|
2028
|
+
var Header5 = ({ title, callToAction }) => (title || callToAction) && /* @__PURE__ */ jsx45(DSHeader, { title: title != null ? title : "", action: getHeaderAction(callToAction) });
|
|
3338
2029
|
var getHeaderAction = (callToAction) => {
|
|
3339
2030
|
if (!callToAction) {
|
|
3340
2031
|
return void 0;
|
|
@@ -3346,11 +2037,11 @@ var getHeaderAction = (callToAction) => {
|
|
|
3346
2037
|
};
|
|
3347
2038
|
|
|
3348
2039
|
// ../renderers/src/ListRenderer.tsx
|
|
3349
|
-
import { jsx as
|
|
2040
|
+
import { jsx as jsx46, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
3350
2041
|
var ListRenderer = {
|
|
3351
2042
|
canRenderType: "list",
|
|
3352
|
-
render: ({ callToAction, control, margin, items, tags, title }) => /* @__PURE__ */
|
|
3353
|
-
/* @__PURE__ */
|
|
2043
|
+
render: ({ callToAction, control, margin, items, tags, title }) => /* @__PURE__ */ jsxs11("div", { className: getMargin(margin), children: [
|
|
2044
|
+
/* @__PURE__ */ jsx46(Header5, { title, callToAction }),
|
|
3354
2045
|
items.map((item) => {
|
|
3355
2046
|
var _a, _b;
|
|
3356
2047
|
const {
|
|
@@ -3367,8 +2058,8 @@ var ListRenderer = {
|
|
|
3367
2058
|
ctaSecondary: (_a = itemTags == null ? void 0 : itemTags.includes("cta-secondary")) != null ? _a : false,
|
|
3368
2059
|
fullyInteractive: (_b = (tags == null ? void 0 : tags.includes("fully-interactive")) && (additionalInfo == null ? void 0 : additionalInfo.onClick) == null) != null ? _b : false
|
|
3369
2060
|
};
|
|
3370
|
-
return /* @__PURE__ */
|
|
3371
|
-
|
|
2061
|
+
return /* @__PURE__ */ jsx46(
|
|
2062
|
+
ListItem7,
|
|
3372
2063
|
{
|
|
3373
2064
|
title: itemTitle,
|
|
3374
2065
|
subtitle: description,
|
|
@@ -3388,10 +2079,10 @@ var ListRenderer_default = ListRenderer;
|
|
|
3388
2079
|
|
|
3389
2080
|
// ../renderers/src/LoadingIndicatorRenderer.tsx
|
|
3390
2081
|
import { Loader } from "@transferwise/components";
|
|
3391
|
-
import { jsx as
|
|
2082
|
+
import { jsx as jsx47 } from "react/jsx-runtime";
|
|
3392
2083
|
var LoadingIndicatorRenderer = {
|
|
3393
2084
|
canRenderType: "loading-indicator",
|
|
3394
|
-
render: ({ margin, size }) => /* @__PURE__ */
|
|
2085
|
+
render: ({ margin, size }) => /* @__PURE__ */ jsx47(
|
|
3395
2086
|
Loader,
|
|
3396
2087
|
{
|
|
3397
2088
|
size,
|
|
@@ -3405,10 +2096,10 @@ var LoadingIndicatorRenderer_default = LoadingIndicatorRenderer;
|
|
|
3405
2096
|
// ../renderers/src/MarkdownRenderer.tsx
|
|
3406
2097
|
import { Markdown as Markdown3 } from "@transferwise/components";
|
|
3407
2098
|
var import_classnames4 = __toESM(require_classnames());
|
|
3408
|
-
import { jsx as
|
|
2099
|
+
import { jsx as jsx48 } from "react/jsx-runtime";
|
|
3409
2100
|
var MarkdownRenderer = {
|
|
3410
2101
|
canRenderType: "markdown",
|
|
3411
|
-
render: ({ content, align, margin, size }) => /* @__PURE__ */
|
|
2102
|
+
render: ({ content, align, margin, size }) => /* @__PURE__ */ jsx48("div", { className: getTextAlignmentAndMargin({ align, margin }), children: /* @__PURE__ */ jsx48(
|
|
3412
2103
|
Markdown3,
|
|
3413
2104
|
{
|
|
3414
2105
|
className: (0, import_classnames4.default)(
|
|
@@ -3423,16 +2114,16 @@ var MarkdownRenderer = {
|
|
|
3423
2114
|
var MarkdownRenderer_default = MarkdownRenderer;
|
|
3424
2115
|
|
|
3425
2116
|
// ../renderers/src/MediaRenderer.tsx
|
|
3426
|
-
import { jsx as
|
|
2117
|
+
import { jsx as jsx49 } from "react/jsx-runtime";
|
|
3427
2118
|
var MediaRenderer = {
|
|
3428
2119
|
canRenderType: "media",
|
|
3429
2120
|
render: (_a) => {
|
|
3430
2121
|
var _b = _a, { media } = _b, rest = __objRest(_b, ["media"]);
|
|
3431
2122
|
switch (media.type) {
|
|
3432
2123
|
case "avatar":
|
|
3433
|
-
return /* @__PURE__ */
|
|
2124
|
+
return /* @__PURE__ */ jsx49(AvatarMediaRendererComponent, __spreadValues({ media }, rest));
|
|
3434
2125
|
case "image":
|
|
3435
|
-
return /* @__PURE__ */
|
|
2126
|
+
return /* @__PURE__ */ jsx49(ImageMediaRendererComponent, __spreadValues({ media }, rest));
|
|
3436
2127
|
case "legacy":
|
|
3437
2128
|
return null;
|
|
3438
2129
|
}
|
|
@@ -3444,7 +2135,7 @@ var AvatarMediaRendererComponent = ({
|
|
|
3444
2135
|
margin,
|
|
3445
2136
|
size
|
|
3446
2137
|
}) => {
|
|
3447
|
-
return /* @__PURE__ */
|
|
2138
|
+
return /* @__PURE__ */ jsx49("div", { className: `df-media-layout-avatar ${align} ${getMargin(margin)}`, children: /* @__PURE__ */ jsx49(Media, { media, size: mapAvatarMediaSize(size) }) });
|
|
3448
2139
|
};
|
|
3449
2140
|
var ImageMediaRendererComponent = (_a) => {
|
|
3450
2141
|
var _b = _a, {
|
|
@@ -3452,7 +2143,7 @@ var ImageMediaRendererComponent = (_a) => {
|
|
|
3452
2143
|
} = _b, rest = __objRest(_b, [
|
|
3453
2144
|
"media"
|
|
3454
2145
|
]);
|
|
3455
|
-
return isUrnImage(media.uri) ? /* @__PURE__ */
|
|
2146
|
+
return isUrnImage(media.uri) ? /* @__PURE__ */ jsx49(UrnImage, __spreadValues({ uri: media.uri, accessibilityDescription: media.accessibilityDescription }, rest)) : /* @__PURE__ */ jsx49(UrlImage, __spreadValues({ uri: media.uri, accessibilityDescription: media.accessibilityDescription }, rest));
|
|
3456
2147
|
};
|
|
3457
2148
|
var mapAvatarMediaSize = (size) => {
|
|
3458
2149
|
switch (size) {
|
|
@@ -3470,20 +2161,20 @@ var mapAvatarMediaSize = (size) => {
|
|
|
3470
2161
|
};
|
|
3471
2162
|
|
|
3472
2163
|
// ../renderers/src/ModalLayoutRenderer.tsx
|
|
3473
|
-
import { Button as
|
|
3474
|
-
import { useState as
|
|
3475
|
-
import { jsx as
|
|
2164
|
+
import { Button as Button4, Modal as Modal2 } from "@transferwise/components";
|
|
2165
|
+
import { useState as useState8 } from "react";
|
|
2166
|
+
import { jsx as jsx50, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
3476
2167
|
var ModalLayoutRenderer = {
|
|
3477
2168
|
canRenderType: "modal-layout",
|
|
3478
|
-
render: (props) => /* @__PURE__ */
|
|
2169
|
+
render: (props) => /* @__PURE__ */ jsx50(DFModal, __spreadValues({}, props))
|
|
3479
2170
|
};
|
|
3480
2171
|
var ModalLayoutRenderer_default = ModalLayoutRenderer;
|
|
3481
2172
|
function DFModal({ content, margin, trigger }) {
|
|
3482
|
-
const [visible, setVisible] =
|
|
2173
|
+
const [visible, setVisible] = useState8(false);
|
|
3483
2174
|
const { children, title } = content;
|
|
3484
|
-
return /* @__PURE__ */
|
|
3485
|
-
/* @__PURE__ */
|
|
3486
|
-
/* @__PURE__ */
|
|
2175
|
+
return /* @__PURE__ */ jsxs12("div", { className: getMargin(margin), children: [
|
|
2176
|
+
/* @__PURE__ */ jsx50(Button4, { v2: true, priority: "tertiary", block: true, onClick: () => setVisible(true), children: trigger.title }),
|
|
2177
|
+
/* @__PURE__ */ jsx50(
|
|
3487
2178
|
Modal2,
|
|
3488
2179
|
{
|
|
3489
2180
|
scroll: "content",
|
|
@@ -3499,19 +2190,19 @@ function DFModal({ content, margin, trigger }) {
|
|
|
3499
2190
|
|
|
3500
2191
|
// ../renderers/src/ModalRenderer.tsx
|
|
3501
2192
|
import { Modal as Modal3 } from "@transferwise/components";
|
|
3502
|
-
import { jsx as
|
|
2193
|
+
import { jsx as jsx51 } from "react/jsx-runtime";
|
|
3503
2194
|
var ModalRenderer = {
|
|
3504
2195
|
canRenderType: "modal",
|
|
3505
2196
|
render: ({ title, children, open, onClose }) => {
|
|
3506
|
-
return /* @__PURE__ */
|
|
2197
|
+
return /* @__PURE__ */ jsx51(Modal3, { open, title, body: children, onClose });
|
|
3507
2198
|
}
|
|
3508
2199
|
};
|
|
3509
2200
|
|
|
3510
2201
|
// ../renderers/src/MoneyInputRenderer.tsx
|
|
3511
2202
|
import { MoneyInput } from "@transferwise/components";
|
|
3512
|
-
import { useEffect as
|
|
3513
|
-
import { useIntl as
|
|
3514
|
-
import { jsx as
|
|
2203
|
+
import { useEffect as useEffect8 } from "react";
|
|
2204
|
+
import { useIntl as useIntl6 } from "react-intl";
|
|
2205
|
+
import { jsx as jsx52 } from "react/jsx-runtime";
|
|
3515
2206
|
var groupingTags2 = Object.keys(group_messages_default).filter((key) => key !== "all");
|
|
3516
2207
|
var MoneyInputRenderer = {
|
|
3517
2208
|
canRenderType: "money-input",
|
|
@@ -3532,13 +2223,13 @@ function MoneyInputRendererComponent(props) {
|
|
|
3532
2223
|
onAmountChange,
|
|
3533
2224
|
onCurrencyChange
|
|
3534
2225
|
} = props;
|
|
3535
|
-
|
|
2226
|
+
useEffect8(() => {
|
|
3536
2227
|
if (!isValidIndex(selectedCurrencyIndex, currencies.length)) {
|
|
3537
2228
|
onCurrencyChange(0);
|
|
3538
2229
|
}
|
|
3539
2230
|
}, [selectedCurrencyIndex, onCurrencyChange, currencies.length]);
|
|
3540
|
-
const { formatMessage } =
|
|
3541
|
-
return /* @__PURE__ */
|
|
2231
|
+
const { formatMessage } = useIntl6();
|
|
2232
|
+
return /* @__PURE__ */ jsx52(
|
|
3542
2233
|
FieldInput_default,
|
|
3543
2234
|
{
|
|
3544
2235
|
id: uid,
|
|
@@ -3547,7 +2238,7 @@ function MoneyInputRendererComponent(props) {
|
|
|
3547
2238
|
validation: validationState,
|
|
3548
2239
|
help,
|
|
3549
2240
|
features: props.features,
|
|
3550
|
-
children: /* @__PURE__ */
|
|
2241
|
+
children: /* @__PURE__ */ jsx52(
|
|
3551
2242
|
MoneyInput,
|
|
3552
2243
|
{
|
|
3553
2244
|
amount: parseFloatOrNull(amountValue),
|
|
@@ -3609,8 +2300,17 @@ function assertCurrencyCodeIsString(currencyCode) {
|
|
|
3609
2300
|
}
|
|
3610
2301
|
|
|
3611
2302
|
// ../renderers/src/MultiSelectInputRenderer/InlineComponent.tsx
|
|
3612
|
-
import { ListItem as
|
|
3613
|
-
import {
|
|
2303
|
+
import { ListItem as ListItem8, SearchInput as SearchInput2 } from "@transferwise/components";
|
|
2304
|
+
import { useState as useState9 } from "react";
|
|
2305
|
+
import { useIntl as useIntl7 } from "react-intl";
|
|
2306
|
+
|
|
2307
|
+
// ../renderers/src/utils/items-with-index.ts
|
|
2308
|
+
var zipWithIndex = (items) => items.map((item, index) => __spreadProps(__spreadValues({}, item), {
|
|
2309
|
+
index
|
|
2310
|
+
}));
|
|
2311
|
+
|
|
2312
|
+
// ../renderers/src/MultiSelectInputRenderer/InlineComponent.tsx
|
|
2313
|
+
import { Fragment as Fragment6, jsx as jsx53, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
3614
2314
|
function InlineComponent(props) {
|
|
3615
2315
|
const {
|
|
3616
2316
|
id,
|
|
@@ -3620,69 +2320,91 @@ function InlineComponent(props) {
|
|
|
3620
2320
|
help,
|
|
3621
2321
|
options,
|
|
3622
2322
|
selectedIndices,
|
|
2323
|
+
tags,
|
|
3623
2324
|
title,
|
|
3624
2325
|
validationState,
|
|
3625
2326
|
onSelect
|
|
3626
2327
|
} = props;
|
|
3627
|
-
|
|
3628
|
-
|
|
3629
|
-
|
|
3630
|
-
|
|
3631
|
-
|
|
3632
|
-
|
|
3633
|
-
|
|
3634
|
-
|
|
3635
|
-
|
|
3636
|
-
|
|
3637
|
-
|
|
3638
|
-
|
|
3639
|
-
|
|
3640
|
-
|
|
3641
|
-
|
|
3642
|
-
|
|
3643
|
-
|
|
3644
|
-
|
|
3645
|
-
|
|
3646
|
-
|
|
3647
|
-
|
|
3648
|
-
|
|
3649
|
-
|
|
3650
|
-
|
|
3651
|
-
|
|
2328
|
+
const optionsWithIndex = zipWithIndex(options);
|
|
2329
|
+
const [query, setQuery] = useState9("");
|
|
2330
|
+
const { formatMessage } = useIntl7();
|
|
2331
|
+
const filtered = tags == null ? void 0 : tags.includes("filtered");
|
|
2332
|
+
const filteredOptions = query ? filterAndSortItems(optionsWithIndex, filtered ? query : "") : optionsWithIndex;
|
|
2333
|
+
return /* @__PURE__ */ jsxs13(Fragment6, { children: [
|
|
2334
|
+
filtered && /* @__PURE__ */ jsx53(
|
|
2335
|
+
SearchInput2,
|
|
2336
|
+
{
|
|
2337
|
+
placeholder: formatMessage(filter_messages_default.placeholder),
|
|
2338
|
+
disabled,
|
|
2339
|
+
value: query,
|
|
2340
|
+
className: "m-b-2",
|
|
2341
|
+
onChange: (e) => {
|
|
2342
|
+
var _a;
|
|
2343
|
+
return setQuery((_a = e.target.value) != null ? _a : "");
|
|
2344
|
+
}
|
|
2345
|
+
}
|
|
2346
|
+
),
|
|
2347
|
+
/* @__PURE__ */ jsx53(
|
|
2348
|
+
FieldInput_default,
|
|
2349
|
+
{
|
|
2350
|
+
id,
|
|
2351
|
+
label: title,
|
|
2352
|
+
help,
|
|
2353
|
+
description,
|
|
2354
|
+
validation: validationState,
|
|
2355
|
+
features,
|
|
2356
|
+
children: filteredOptions.map((option) => {
|
|
2357
|
+
var _a;
|
|
2358
|
+
const {
|
|
3652
2359
|
title: itemTitle,
|
|
3653
|
-
subtitle,
|
|
3654
|
-
|
|
3655
|
-
|
|
3656
|
-
|
|
3657
|
-
|
|
3658
|
-
|
|
3659
|
-
|
|
3660
|
-
|
|
3661
|
-
|
|
3662
|
-
|
|
3663
|
-
|
|
3664
|
-
|
|
3665
|
-
|
|
3666
|
-
|
|
2360
|
+
description: subtitle,
|
|
2361
|
+
disabled: optionDisabled,
|
|
2362
|
+
media,
|
|
2363
|
+
index,
|
|
2364
|
+
additionalText,
|
|
2365
|
+
inlineAlert,
|
|
2366
|
+
supportingValues,
|
|
2367
|
+
childrenProps
|
|
2368
|
+
} = option;
|
|
2369
|
+
const key = (_a = childrenProps == null ? void 0 : childrenProps.uid) != null ? _a : index;
|
|
2370
|
+
return /* @__PURE__ */ jsx53(
|
|
2371
|
+
ListItem8,
|
|
2372
|
+
{
|
|
2373
|
+
title: itemTitle,
|
|
2374
|
+
subtitle,
|
|
2375
|
+
valueTitle: supportingValues == null ? void 0 : supportingValues.value,
|
|
2376
|
+
valueSubtitle: supportingValues == null ? void 0 : supportingValues.subvalue,
|
|
2377
|
+
media: getMedia(media, false),
|
|
2378
|
+
prompt: getInlineAlert(inlineAlert),
|
|
2379
|
+
additionalInfo: additionalText ? /* @__PURE__ */ jsx53(ListItem8.AdditionalInfo, { children: additionalText }) : void 0,
|
|
2380
|
+
disabled: disabled || optionDisabled,
|
|
2381
|
+
control: /* @__PURE__ */ jsx53(
|
|
2382
|
+
ListItem8.Checkbox,
|
|
2383
|
+
{
|
|
2384
|
+
checked: selectedIndices.includes(index),
|
|
2385
|
+
onChange: (e) => {
|
|
2386
|
+
const newSelectedIndices = e.target.checked ? [...selectedIndices, index] : selectedIndices.filter((i) => i !== index);
|
|
2387
|
+
onSelect(newSelectedIndices);
|
|
2388
|
+
}
|
|
3667
2389
|
}
|
|
3668
|
-
|
|
3669
|
-
|
|
3670
|
-
|
|
3671
|
-
|
|
3672
|
-
)
|
|
3673
|
-
}
|
|
3674
|
-
|
|
3675
|
-
);
|
|
2390
|
+
)
|
|
2391
|
+
},
|
|
2392
|
+
key
|
|
2393
|
+
);
|
|
2394
|
+
})
|
|
2395
|
+
}
|
|
2396
|
+
)
|
|
2397
|
+
] });
|
|
3676
2398
|
}
|
|
3677
2399
|
|
|
3678
2400
|
// ../renderers/src/MultiSelectInputRenderer/DefaultComponent.tsx
|
|
3679
2401
|
import { SelectInput, SelectInputOptionContent } from "@transferwise/components";
|
|
3680
|
-
import { useState as
|
|
2402
|
+
import { useState as useState10 } from "react";
|
|
3681
2403
|
import { useIntl as useIntl8 } from "react-intl";
|
|
3682
2404
|
|
|
3683
2405
|
// ../renderers/src/messages/multi-select.messages.ts
|
|
3684
|
-
import { defineMessages as
|
|
3685
|
-
var multi_select_messages_default =
|
|
2406
|
+
import { defineMessages as defineMessages6 } from "react-intl";
|
|
2407
|
+
var multi_select_messages_default = defineMessages6({
|
|
3686
2408
|
summary: {
|
|
3687
2409
|
id: "df.wise.MultiSelect.summary",
|
|
3688
2410
|
defaultMessage: "{first} and {count} more",
|
|
@@ -3691,10 +2413,10 @@ var multi_select_messages_default = defineMessages7({
|
|
|
3691
2413
|
});
|
|
3692
2414
|
|
|
3693
2415
|
// ../renderers/src/MultiSelectInputRenderer/DefaultComponent.tsx
|
|
3694
|
-
import { jsx as
|
|
2416
|
+
import { jsx as jsx54 } from "react/jsx-runtime";
|
|
3695
2417
|
function DefaultComponent(props) {
|
|
3696
2418
|
const { formatMessage } = useIntl8();
|
|
3697
|
-
const [stagedIndices, setStagedIndices] =
|
|
2419
|
+
const [stagedIndices, setStagedIndices] = useState10();
|
|
3698
2420
|
const {
|
|
3699
2421
|
id,
|
|
3700
2422
|
autoComplete,
|
|
@@ -3733,12 +2455,12 @@ function DefaultComponent(props) {
|
|
|
3733
2455
|
const contentProps = {
|
|
3734
2456
|
title: option.title,
|
|
3735
2457
|
description: option.description,
|
|
3736
|
-
icon: /* @__PURE__ */
|
|
2458
|
+
icon: /* @__PURE__ */ jsx54(OptionMedia, { media: option.media, preferAvatar: false })
|
|
3737
2459
|
};
|
|
3738
|
-
return /* @__PURE__ */
|
|
2460
|
+
return /* @__PURE__ */ jsx54(SelectInputOptionContent, __spreadValues({}, contentProps));
|
|
3739
2461
|
};
|
|
3740
2462
|
const extraProps = { autoComplete };
|
|
3741
|
-
return /* @__PURE__ */
|
|
2463
|
+
return /* @__PURE__ */ jsx54(
|
|
3742
2464
|
FieldInput_default,
|
|
3743
2465
|
{
|
|
3744
2466
|
id,
|
|
@@ -3747,7 +2469,7 @@ function DefaultComponent(props) {
|
|
|
3747
2469
|
description,
|
|
3748
2470
|
validation: validationState,
|
|
3749
2471
|
features,
|
|
3750
|
-
children: /* @__PURE__ */
|
|
2472
|
+
children: /* @__PURE__ */ jsx54(
|
|
3751
2473
|
SelectInput,
|
|
3752
2474
|
__spreadValues({
|
|
3753
2475
|
id,
|
|
@@ -3787,7 +2509,7 @@ function DefaultComponent(props) {
|
|
|
3787
2509
|
|
|
3788
2510
|
// ../renderers/src/MultiSelectInputRenderer/InlineCheckboxComponent.tsx
|
|
3789
2511
|
import { Checkbox as Checkbox2 } from "@transferwise/components";
|
|
3790
|
-
import { jsx as
|
|
2512
|
+
import { jsx as jsx55 } from "react/jsx-runtime";
|
|
3791
2513
|
function InlineCheckboxComponent(props) {
|
|
3792
2514
|
const {
|
|
3793
2515
|
id,
|
|
@@ -3801,7 +2523,7 @@ function InlineCheckboxComponent(props) {
|
|
|
3801
2523
|
validationState,
|
|
3802
2524
|
onSelect
|
|
3803
2525
|
} = props;
|
|
3804
|
-
return /* @__PURE__ */
|
|
2526
|
+
return /* @__PURE__ */ jsx55(
|
|
3805
2527
|
FieldInput_default,
|
|
3806
2528
|
{
|
|
3807
2529
|
id,
|
|
@@ -3830,24 +2552,24 @@ function InlineCheckboxComponent(props) {
|
|
|
3830
2552
|
onSelect(newSelectedIndices);
|
|
3831
2553
|
}
|
|
3832
2554
|
};
|
|
3833
|
-
return /* @__PURE__ */
|
|
2555
|
+
return /* @__PURE__ */ jsx55(Checkbox2, __spreadProps(__spreadValues({}, checkboxProps), { className: "m-t-1" }), key);
|
|
3834
2556
|
})
|
|
3835
2557
|
}
|
|
3836
2558
|
);
|
|
3837
2559
|
}
|
|
3838
2560
|
|
|
3839
2561
|
// ../renderers/src/MultiSelectInputRenderer/MultiSelectInputRenderer.tsx
|
|
3840
|
-
import { jsx as
|
|
2562
|
+
import { jsx as jsx56 } from "react/jsx-runtime";
|
|
3841
2563
|
var MultiSelectInputRenderer = {
|
|
3842
2564
|
canRenderType: "input-multi-select",
|
|
3843
2565
|
render: (props) => {
|
|
3844
2566
|
switch (props.control) {
|
|
3845
2567
|
case "inline":
|
|
3846
|
-
return /* @__PURE__ */
|
|
2568
|
+
return /* @__PURE__ */ jsx56(InlineComponent, __spreadValues({}, props));
|
|
3847
2569
|
case "inline-checkbox-group":
|
|
3848
|
-
return /* @__PURE__ */
|
|
2570
|
+
return /* @__PURE__ */ jsx56(InlineCheckboxComponent, __spreadValues({}, props));
|
|
3849
2571
|
default:
|
|
3850
|
-
return /* @__PURE__ */
|
|
2572
|
+
return /* @__PURE__ */ jsx56(DefaultComponent, __spreadValues({}, props));
|
|
3851
2573
|
}
|
|
3852
2574
|
}
|
|
3853
2575
|
};
|
|
@@ -3858,7 +2580,7 @@ import { Status, UploadInput } from "@transferwise/components";
|
|
|
3858
2580
|
// ../renderers/src/components/UploadFieldInput.tsx
|
|
3859
2581
|
var import_classnames5 = __toESM(require_classnames());
|
|
3860
2582
|
import { InlineAlert as InlineAlert2 } from "@transferwise/components";
|
|
3861
|
-
import { jsx as
|
|
2583
|
+
import { jsx as jsx57, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
3862
2584
|
function UploadFieldInput({
|
|
3863
2585
|
id,
|
|
3864
2586
|
children,
|
|
@@ -3868,10 +2590,10 @@ function UploadFieldInput({
|
|
|
3868
2590
|
validation,
|
|
3869
2591
|
features
|
|
3870
2592
|
}) {
|
|
3871
|
-
const labelContent = label && help ? /* @__PURE__ */
|
|
2593
|
+
const labelContent = label && help ? /* @__PURE__ */ jsx57(LabelContentWithHelp, { text: label, help }) : label;
|
|
3872
2594
|
const descriptionId = description ? `${id}-description` : void 0;
|
|
3873
2595
|
const { ref } = useScrollToError(validation, features);
|
|
3874
|
-
return /* @__PURE__ */
|
|
2596
|
+
return /* @__PURE__ */ jsxs14(
|
|
3875
2597
|
"div",
|
|
3876
2598
|
{
|
|
3877
2599
|
ref,
|
|
@@ -3879,9 +2601,9 @@ function UploadFieldInput({
|
|
|
3879
2601
|
"has-error": (validation == null ? void 0 : validation.status) === "invalid"
|
|
3880
2602
|
}),
|
|
3881
2603
|
children: [
|
|
3882
|
-
/* @__PURE__ */
|
|
2604
|
+
/* @__PURE__ */ jsx57("label", { htmlFor: id, className: "control-label", children: labelContent }),
|
|
3883
2605
|
children,
|
|
3884
|
-
(validation == null ? void 0 : validation.status) === "invalid" && /* @__PURE__ */
|
|
2606
|
+
(validation == null ? void 0 : validation.status) === "invalid" && /* @__PURE__ */ jsx57(InlineAlert2, { type: "negative", id: descriptionId, children: validation.message })
|
|
3885
2607
|
]
|
|
3886
2608
|
}
|
|
3887
2609
|
);
|
|
@@ -3916,7 +2638,7 @@ var getSizeLimit = (maxSize) => {
|
|
|
3916
2638
|
};
|
|
3917
2639
|
|
|
3918
2640
|
// ../renderers/src/MultiUploadInputRenderer.tsx
|
|
3919
|
-
import { jsx as
|
|
2641
|
+
import { jsx as jsx58 } from "react/jsx-runtime";
|
|
3920
2642
|
var MultiUploadInputRenderer = {
|
|
3921
2643
|
canRenderType: "input-upload-multi",
|
|
3922
2644
|
render: (props) => {
|
|
@@ -3942,7 +2664,7 @@ var MultiUploadInputRenderer = {
|
|
|
3942
2664
|
};
|
|
3943
2665
|
const onDeleteFile = async (fileId) => onRemoveFile(value.findIndex((file) => file.id === fileId));
|
|
3944
2666
|
const descriptionId = description ? `${id}-description` : void 0;
|
|
3945
|
-
return /* @__PURE__ */
|
|
2667
|
+
return /* @__PURE__ */ jsx58(
|
|
3946
2668
|
UploadFieldInput_default,
|
|
3947
2669
|
{
|
|
3948
2670
|
id,
|
|
@@ -3951,7 +2673,7 @@ var MultiUploadInputRenderer = {
|
|
|
3951
2673
|
validation: validationState,
|
|
3952
2674
|
help,
|
|
3953
2675
|
features,
|
|
3954
|
-
children: /* @__PURE__ */
|
|
2676
|
+
children: /* @__PURE__ */ jsx58(
|
|
3955
2677
|
UploadInput,
|
|
3956
2678
|
{
|
|
3957
2679
|
id,
|
|
@@ -3979,8 +2701,8 @@ var MultiUploadInputRenderer = {
|
|
|
3979
2701
|
var MultiUploadInputRenderer_default = MultiUploadInputRenderer;
|
|
3980
2702
|
|
|
3981
2703
|
// ../renderers/src/NumberInputRenderer.tsx
|
|
3982
|
-
import { Input as
|
|
3983
|
-
import { jsx as
|
|
2704
|
+
import { Input as Input2, InputGroup as InputGroup2 } from "@transferwise/components";
|
|
2705
|
+
import { jsx as jsx59 } from "react/jsx-runtime";
|
|
3984
2706
|
var NumberInputRenderer = {
|
|
3985
2707
|
canRenderType: "input-number",
|
|
3986
2708
|
render: (props) => {
|
|
@@ -3994,7 +2716,7 @@ var NumberInputRenderer = {
|
|
|
3994
2716
|
"maximum",
|
|
3995
2717
|
"minimum"
|
|
3996
2718
|
);
|
|
3997
|
-
return /* @__PURE__ */
|
|
2719
|
+
return /* @__PURE__ */ jsx59(
|
|
3998
2720
|
FieldInput_default,
|
|
3999
2721
|
{
|
|
4000
2722
|
id,
|
|
@@ -4005,8 +2727,8 @@ var NumberInputRenderer = {
|
|
|
4005
2727
|
loadingState: props.fieldLoadingState,
|
|
4006
2728
|
help,
|
|
4007
2729
|
features: props.features,
|
|
4008
|
-
children: /* @__PURE__ */
|
|
4009
|
-
|
|
2730
|
+
children: /* @__PURE__ */ jsx59(InputGroup2, { addonStart: getInputGroupAddonStart(media), children: /* @__PURE__ */ jsx59(
|
|
2731
|
+
Input2,
|
|
4010
2732
|
__spreadValues({
|
|
4011
2733
|
id,
|
|
4012
2734
|
name: id,
|
|
@@ -4039,11 +2761,11 @@ function useSnackBarIfAvailable() {
|
|
|
4039
2761
|
|
|
4040
2762
|
// ../renderers/src/ParagraphRenderer.tsx
|
|
4041
2763
|
var import_classnames6 = __toESM(require_classnames());
|
|
4042
|
-
import { Button as
|
|
2764
|
+
import { Button as Button5, Input as Input3 } from "@transferwise/components";
|
|
4043
2765
|
|
|
4044
2766
|
// ../renderers/src/messages/paragraph.messages.ts
|
|
4045
|
-
import { defineMessages as
|
|
4046
|
-
var paragraph_messages_default =
|
|
2767
|
+
import { defineMessages as defineMessages7 } from "react-intl";
|
|
2768
|
+
var paragraph_messages_default = defineMessages7({
|
|
4047
2769
|
copy: {
|
|
4048
2770
|
id: "df.wise.DynamicParagraph.copy",
|
|
4049
2771
|
defaultMessage: "Copy",
|
|
@@ -4057,14 +2779,14 @@ var paragraph_messages_default = defineMessages8({
|
|
|
4057
2779
|
});
|
|
4058
2780
|
|
|
4059
2781
|
// ../renderers/src/ParagraphRenderer.tsx
|
|
4060
|
-
import { jsx as
|
|
2782
|
+
import { jsx as jsx60, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
4061
2783
|
var ParagraphRenderer = {
|
|
4062
2784
|
canRenderType: "paragraph",
|
|
4063
|
-
render: (props) => /* @__PURE__ */
|
|
2785
|
+
render: (props) => /* @__PURE__ */ jsx60(Paragraph, __spreadValues({}, props))
|
|
4064
2786
|
};
|
|
4065
2787
|
function Paragraph({ align, control, margin, size, text }) {
|
|
4066
2788
|
const className = getTextAlignmentAndMargin({ align, margin });
|
|
4067
|
-
return control === "copyable" ? /* @__PURE__ */
|
|
2789
|
+
return control === "copyable" ? /* @__PURE__ */ jsx60(CopyableParagraph, { className, align, text }) : /* @__PURE__ */ jsx60(
|
|
4068
2790
|
"p",
|
|
4069
2791
|
{
|
|
4070
2792
|
className: `${["xs", "sm"].includes(size) ? "np-text-body-default" : "np-text-body-large"} ${className}`,
|
|
@@ -4084,9 +2806,9 @@ function CopyableParagraph({
|
|
|
4084
2806
|
});
|
|
4085
2807
|
};
|
|
4086
2808
|
const inputAlignmentClasses = getTextAlignmentAndMargin({ align, margin: "sm" });
|
|
4087
|
-
return /* @__PURE__ */
|
|
4088
|
-
/* @__PURE__ */
|
|
4089
|
-
|
|
2809
|
+
return /* @__PURE__ */ jsxs15("div", { className, children: [
|
|
2810
|
+
/* @__PURE__ */ jsx60(
|
|
2811
|
+
Input3,
|
|
4090
2812
|
{
|
|
4091
2813
|
type: "text",
|
|
4092
2814
|
value: text,
|
|
@@ -4094,23 +2816,23 @@ function CopyableParagraph({
|
|
|
4094
2816
|
className: (0, import_classnames6.default)("text-ellipsis", inputAlignmentClasses)
|
|
4095
2817
|
}
|
|
4096
2818
|
),
|
|
4097
|
-
/* @__PURE__ */
|
|
2819
|
+
/* @__PURE__ */ jsx60(Button5, { v2: true, block: true, onClick: copy, children: formatMessage(paragraph_messages_default.copy) })
|
|
4098
2820
|
] });
|
|
4099
2821
|
}
|
|
4100
2822
|
var ParagraphRenderer_default = ParagraphRenderer;
|
|
4101
2823
|
|
|
4102
2824
|
// ../renderers/src/ProgressRenderer.tsx
|
|
4103
2825
|
import { ProgressBar } from "@transferwise/components";
|
|
4104
|
-
import { jsx as
|
|
2826
|
+
import { jsx as jsx61 } from "react/jsx-runtime";
|
|
4105
2827
|
var ProgressRenderer = {
|
|
4106
2828
|
canRenderType: "progress",
|
|
4107
2829
|
render: ({ uid, title, help, progress, progressText, margin, description }) => {
|
|
4108
|
-
return /* @__PURE__ */
|
|
2830
|
+
return /* @__PURE__ */ jsx61(
|
|
4109
2831
|
ProgressBar,
|
|
4110
2832
|
{
|
|
4111
2833
|
id: uid,
|
|
4112
2834
|
className: getMargin(margin),
|
|
4113
|
-
title: title && help ? /* @__PURE__ */
|
|
2835
|
+
title: title && help ? /* @__PURE__ */ jsx61(LabelContentWithHelp, { text: title, help }) : title,
|
|
4114
2836
|
description,
|
|
4115
2837
|
progress: {
|
|
4116
2838
|
max: 1,
|
|
@@ -4124,14 +2846,14 @@ var ProgressRenderer = {
|
|
|
4124
2846
|
|
|
4125
2847
|
// ../renderers/src/RepeatableRenderer.tsx
|
|
4126
2848
|
var import_classnames7 = __toESM(require_classnames());
|
|
4127
|
-
import { Button as
|
|
2849
|
+
import { Button as Button6, Header as Header6, InlineAlert as InlineAlert3, Modal as Modal4, NavigationOption } from "@transferwise/components";
|
|
4128
2850
|
import { Plus } from "@transferwise/icons";
|
|
4129
|
-
import { useState as
|
|
2851
|
+
import { useState as useState11 } from "react";
|
|
4130
2852
|
import { useIntl as useIntl10 } from "react-intl";
|
|
4131
2853
|
|
|
4132
2854
|
// ../renderers/src/messages/repeatable.messages.ts
|
|
4133
|
-
import { defineMessages as
|
|
4134
|
-
var repeatable_messages_default =
|
|
2855
|
+
import { defineMessages as defineMessages8 } from "react-intl";
|
|
2856
|
+
var repeatable_messages_default = defineMessages8({
|
|
4135
2857
|
addItemTitle: {
|
|
4136
2858
|
id: "df.wise.ArraySchema.addItemTitle",
|
|
4137
2859
|
defaultMessage: "Add Item",
|
|
@@ -4155,10 +2877,10 @@ var repeatable_messages_default = defineMessages9({
|
|
|
4155
2877
|
});
|
|
4156
2878
|
|
|
4157
2879
|
// ../renderers/src/RepeatableRenderer.tsx
|
|
4158
|
-
import { Fragment as
|
|
2880
|
+
import { Fragment as Fragment7, jsx as jsx62, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
4159
2881
|
var RepeatableRenderer = {
|
|
4160
2882
|
canRenderType: "repeatable",
|
|
4161
|
-
render: (props) => /* @__PURE__ */
|
|
2883
|
+
render: (props) => /* @__PURE__ */ jsx62(Repeatable, __spreadValues({}, props))
|
|
4162
2884
|
};
|
|
4163
2885
|
function Repeatable(props) {
|
|
4164
2886
|
const {
|
|
@@ -4176,7 +2898,7 @@ function Repeatable(props) {
|
|
|
4176
2898
|
onRemove
|
|
4177
2899
|
} = props;
|
|
4178
2900
|
const { formatMessage } = useIntl10();
|
|
4179
|
-
const [openModalType, setOpenModalType] =
|
|
2901
|
+
const [openModalType, setOpenModalType] = useState11(null);
|
|
4180
2902
|
const { ref } = useScrollToError(validationState, features);
|
|
4181
2903
|
const onAddItem = () => {
|
|
4182
2904
|
onAdd();
|
|
@@ -4199,43 +2921,43 @@ function Repeatable(props) {
|
|
|
4199
2921
|
const onCancelEdit = () => {
|
|
4200
2922
|
setOpenModalType(null);
|
|
4201
2923
|
};
|
|
4202
|
-
return /* @__PURE__ */
|
|
4203
|
-
/* @__PURE__ */
|
|
4204
|
-
title && /* @__PURE__ */
|
|
4205
|
-
description && /* @__PURE__ */
|
|
4206
|
-
/* @__PURE__ */
|
|
2924
|
+
return /* @__PURE__ */ jsxs16(Fragment7, { children: [
|
|
2925
|
+
/* @__PURE__ */ jsxs16("div", { ref, children: [
|
|
2926
|
+
title && /* @__PURE__ */ jsx62(Header6, { title }),
|
|
2927
|
+
description && /* @__PURE__ */ jsx62("p", { children: description }),
|
|
2928
|
+
/* @__PURE__ */ jsxs16(
|
|
4207
2929
|
"div",
|
|
4208
2930
|
{
|
|
4209
2931
|
className: (0, import_classnames7.default)("form-group", {
|
|
4210
2932
|
"has-error": (validationState == null ? void 0 : validationState.status) === "invalid"
|
|
4211
2933
|
}),
|
|
4212
2934
|
children: [
|
|
4213
|
-
items == null ? void 0 : items.map((item, index) => /* @__PURE__ */
|
|
4214
|
-
/* @__PURE__ */
|
|
2935
|
+
items == null ? void 0 : items.map((item, index) => /* @__PURE__ */ jsx62(ItemSummaryOption, { item, onClick: () => onEditItem(index) }, item.id)),
|
|
2936
|
+
/* @__PURE__ */ jsx62(
|
|
4215
2937
|
NavigationOption,
|
|
4216
2938
|
{
|
|
4217
|
-
media: /* @__PURE__ */
|
|
2939
|
+
media: /* @__PURE__ */ jsx62(Plus, {}),
|
|
4218
2940
|
title: addItemTitle || formatMessage(repeatable_messages_default.addItemTitle),
|
|
4219
2941
|
showMediaAtAllSizes: true,
|
|
4220
2942
|
onClick: () => onAddItem()
|
|
4221
2943
|
}
|
|
4222
2944
|
),
|
|
4223
|
-
(validationState == null ? void 0 : validationState.status) === "invalid" && /* @__PURE__ */
|
|
2945
|
+
(validationState == null ? void 0 : validationState.status) === "invalid" && /* @__PURE__ */ jsx62(InlineAlert3, { type: "negative", children: validationState.message })
|
|
4224
2946
|
]
|
|
4225
2947
|
}
|
|
4226
2948
|
)
|
|
4227
2949
|
] }),
|
|
4228
|
-
/* @__PURE__ */
|
|
2950
|
+
/* @__PURE__ */ jsx62(
|
|
4229
2951
|
Modal4,
|
|
4230
2952
|
{
|
|
4231
2953
|
open: openModalType !== null,
|
|
4232
2954
|
title: (openModalType === "add" ? addItemTitle : editItemTitle) || formatMessage(repeatable_messages_default.addItemTitle),
|
|
4233
|
-
body: /* @__PURE__ */
|
|
4234
|
-
/* @__PURE__ */
|
|
4235
|
-
/* @__PURE__ */
|
|
4236
|
-
/* @__PURE__ */
|
|
4237
|
-
/* @__PURE__ */
|
|
4238
|
-
|
|
2955
|
+
body: /* @__PURE__ */ jsxs16(Fragment7, { children: [
|
|
2956
|
+
/* @__PURE__ */ jsx62("div", { className: "m-b-2", children: editableItem }),
|
|
2957
|
+
/* @__PURE__ */ jsxs16("div", { children: [
|
|
2958
|
+
/* @__PURE__ */ jsx62(Button6, { priority: "primary", block: true, className: "m-b-2", onClick: () => onSaveItem(), children: formatMessage(repeatable_messages_default.addItem) }),
|
|
2959
|
+
/* @__PURE__ */ jsx62(
|
|
2960
|
+
Button6,
|
|
4239
2961
|
{
|
|
4240
2962
|
v2: true,
|
|
4241
2963
|
priority: "secondary",
|
|
@@ -4256,10 +2978,10 @@ function ItemSummaryOption({
|
|
|
4256
2978
|
item,
|
|
4257
2979
|
onClick
|
|
4258
2980
|
}) {
|
|
4259
|
-
return /* @__PURE__ */
|
|
2981
|
+
return /* @__PURE__ */ jsx62(
|
|
4260
2982
|
NavigationOption,
|
|
4261
2983
|
{
|
|
4262
|
-
media: /* @__PURE__ */
|
|
2984
|
+
media: /* @__PURE__ */ jsx62(OptionMedia, { media: item.media, preferAvatar: false }),
|
|
4263
2985
|
title: item.title,
|
|
4264
2986
|
content: item.description,
|
|
4265
2987
|
showMediaAtAllSizes: true,
|
|
@@ -4272,14 +2994,14 @@ var RepeatableRenderer_default = RepeatableRenderer;
|
|
|
4272
2994
|
|
|
4273
2995
|
// ../renderers/src/ReviewLegacyRenderer.tsx
|
|
4274
2996
|
import { DefinitionList } from "@transferwise/components";
|
|
4275
|
-
import { Fragment as
|
|
2997
|
+
import { Fragment as Fragment8, jsx as jsx63, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
4276
2998
|
var ReviewRenderer = {
|
|
4277
2999
|
canRenderType: "review",
|
|
4278
3000
|
render: ({ callToAction, control, fields, margin, title, trackEvent }) => {
|
|
4279
3001
|
const orientation = mapControlToDefinitionListLayout(control);
|
|
4280
|
-
return /* @__PURE__ */
|
|
4281
|
-
/* @__PURE__ */
|
|
4282
|
-
/* @__PURE__ */
|
|
3002
|
+
return /* @__PURE__ */ jsxs17("div", { className: getMargin(margin), children: [
|
|
3003
|
+
/* @__PURE__ */ jsx63(Header5, { title, callToAction }),
|
|
3004
|
+
/* @__PURE__ */ jsx63("div", { className: margin, children: /* @__PURE__ */ jsx63(
|
|
4283
3005
|
DefinitionList,
|
|
4284
3006
|
{
|
|
4285
3007
|
layout: orientation,
|
|
@@ -4317,20 +3039,20 @@ var mapControlToDefinitionListLayout = (control) => {
|
|
|
4317
3039
|
};
|
|
4318
3040
|
var getFieldLabel = (label, help, onClick) => {
|
|
4319
3041
|
if (help) {
|
|
4320
|
-
return /* @__PURE__ */
|
|
3042
|
+
return /* @__PURE__ */ jsxs17(Fragment8, { children: [
|
|
4321
3043
|
label,
|
|
4322
3044
|
" ",
|
|
4323
|
-
/* @__PURE__ */
|
|
3045
|
+
/* @__PURE__ */ jsx63(Help_default, { help, onClick })
|
|
4324
3046
|
] });
|
|
4325
3047
|
}
|
|
4326
3048
|
return label;
|
|
4327
3049
|
};
|
|
4328
3050
|
|
|
4329
3051
|
// ../renderers/src/ReviewRenderer.tsx
|
|
4330
|
-
import { ListItem as
|
|
3052
|
+
import { ListItem as ListItem9, Markdown as Markdown4, Popover } from "@transferwise/components";
|
|
4331
3053
|
import { QuestionMarkCircle } from "@transferwise/icons";
|
|
4332
3054
|
import { useIntl as useIntl11 } from "react-intl";
|
|
4333
|
-
import { jsx as
|
|
3055
|
+
import { jsx as jsx64, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
4334
3056
|
var IGNORED_CONTROLS = [
|
|
4335
3057
|
"horizontal",
|
|
4336
3058
|
"horizontal-end-aligned",
|
|
@@ -4340,7 +3062,7 @@ var IGNORED_CONTROLS = [
|
|
|
4340
3062
|
var ReviewRenderer2 = {
|
|
4341
3063
|
canRenderType: "review",
|
|
4342
3064
|
canRender: ({ control }) => control ? !IGNORED_CONTROLS.includes(control) : true,
|
|
4343
|
-
render: (props) => /* @__PURE__ */
|
|
3065
|
+
render: (props) => /* @__PURE__ */ jsx64(Review, __spreadValues({}, props))
|
|
4344
3066
|
};
|
|
4345
3067
|
var Review = ({
|
|
4346
3068
|
callToAction,
|
|
@@ -4352,8 +3074,8 @@ var Review = ({
|
|
|
4352
3074
|
trackEvent
|
|
4353
3075
|
}) => {
|
|
4354
3076
|
const intl = useIntl11();
|
|
4355
|
-
return /* @__PURE__ */
|
|
4356
|
-
/* @__PURE__ */
|
|
3077
|
+
return /* @__PURE__ */ jsxs18("div", { className: getMargin(margin), children: [
|
|
3078
|
+
/* @__PURE__ */ jsx64(Header5, { title, callToAction }),
|
|
4357
3079
|
fields.map((field) => {
|
|
4358
3080
|
var _a, _b, _c;
|
|
4359
3081
|
const {
|
|
@@ -4371,8 +3093,8 @@ var Review = ({
|
|
|
4371
3093
|
ctaSecondary: (_a = itemTags == null ? void 0 : itemTags.includes("cta-secondary")) != null ? _a : false,
|
|
4372
3094
|
fullyInteractive: (_b = (tags == null ? void 0 : tags.includes("fully-interactive")) && (additionalInfo == null ? void 0 : additionalInfo.onClick) == null) != null ? _b : false
|
|
4373
3095
|
};
|
|
4374
|
-
return /* @__PURE__ */
|
|
4375
|
-
|
|
3096
|
+
return /* @__PURE__ */ jsx64(
|
|
3097
|
+
ListItem9,
|
|
4376
3098
|
{
|
|
4377
3099
|
title: value,
|
|
4378
3100
|
subtitle: label,
|
|
@@ -4392,18 +3114,18 @@ var Review = ({
|
|
|
4392
3114
|
] });
|
|
4393
3115
|
};
|
|
4394
3116
|
var getHelpControl = (help, ariaLabel, onClick) => {
|
|
4395
|
-
return /* @__PURE__ */
|
|
3117
|
+
return /* @__PURE__ */ jsx64(Popover, { content: /* @__PURE__ */ jsx64(Markdown4, { config: { link: { target: "_blank" } }, children: help }), children: /* @__PURE__ */ jsx64(ListItem9.IconButton, { partiallyInteractive: true, "aria-label": ariaLabel, onClick, children: /* @__PURE__ */ jsx64(QuestionMarkCircle, {}) }) });
|
|
4396
3118
|
};
|
|
4397
3119
|
var ReviewRenderer_default = ReviewRenderer2;
|
|
4398
3120
|
|
|
4399
3121
|
// ../renderers/src/SearchRenderer/BlockSearchRendererComponent.tsx
|
|
4400
|
-
import { Input as
|
|
4401
|
-
import { useState as
|
|
3122
|
+
import { Input as Input4, InputGroup as InputGroup3, List, ListItem as ListItem10, Markdown as Markdown5 } from "@transferwise/components";
|
|
3123
|
+
import { useState as useState12 } from "react";
|
|
4402
3124
|
import { useIntl as useIntl13 } from "react-intl";
|
|
4403
3125
|
|
|
4404
3126
|
// ../renderers/src/messages/search.messages.ts
|
|
4405
|
-
import { defineMessages as
|
|
4406
|
-
var search_messages_default =
|
|
3127
|
+
import { defineMessages as defineMessages9 } from "react-intl";
|
|
3128
|
+
var search_messages_default = defineMessages9({
|
|
4407
3129
|
loading: {
|
|
4408
3130
|
id: "df.wise.SearchLayout.loading",
|
|
4409
3131
|
defaultMessage: "Loading...",
|
|
@@ -4415,8 +3137,8 @@ var search_messages_default = defineMessages10({
|
|
|
4415
3137
|
import { useIntl as useIntl12 } from "react-intl";
|
|
4416
3138
|
|
|
4417
3139
|
// ../renderers/src/messages/generic-error.messages.ts
|
|
4418
|
-
import { defineMessages as
|
|
4419
|
-
var generic_error_messages_default =
|
|
3140
|
+
import { defineMessages as defineMessages10 } from "react-intl";
|
|
3141
|
+
var generic_error_messages_default = defineMessages10({
|
|
4420
3142
|
genericErrorRetryHint: {
|
|
4421
3143
|
id: "df.wise.PersistAsyncSchema.genericError",
|
|
4422
3144
|
defaultMessage: "Something went wrong, please try again.",
|
|
@@ -4435,20 +3157,20 @@ var generic_error_messages_default = defineMessages11({
|
|
|
4435
3157
|
});
|
|
4436
3158
|
|
|
4437
3159
|
// ../renderers/src/SearchRenderer/ErrorResult.tsx
|
|
4438
|
-
import { Link as
|
|
4439
|
-
import { jsx as
|
|
3160
|
+
import { Link as DSLink } from "@transferwise/components";
|
|
3161
|
+
import { jsx as jsx65, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
4440
3162
|
function ErrorResult({ state }) {
|
|
4441
3163
|
const intl = useIntl12();
|
|
4442
|
-
return /* @__PURE__ */
|
|
3164
|
+
return /* @__PURE__ */ jsxs19("p", { className: "m-t-2", children: [
|
|
4443
3165
|
intl.formatMessage(generic_error_messages_default.genericError),
|
|
4444
3166
|
"\xA0",
|
|
4445
|
-
/* @__PURE__ */
|
|
3167
|
+
/* @__PURE__ */ jsx65(DSLink, { onClick: () => state.onRetry(), children: intl.formatMessage(generic_error_messages_default.retry) })
|
|
4446
3168
|
] });
|
|
4447
3169
|
}
|
|
4448
3170
|
|
|
4449
3171
|
// ../renderers/src/SearchRenderer/BlockSearchRendererComponent.tsx
|
|
4450
|
-
import { Search
|
|
4451
|
-
import { Fragment as
|
|
3172
|
+
import { Search } from "@transferwise/icons";
|
|
3173
|
+
import { Fragment as Fragment9, jsx as jsx66, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
4452
3174
|
function BlockSearchRendererComponent({
|
|
4453
3175
|
id,
|
|
4454
3176
|
hint,
|
|
@@ -4461,10 +3183,10 @@ function BlockSearchRendererComponent({
|
|
|
4461
3183
|
trackEvent,
|
|
4462
3184
|
onChange
|
|
4463
3185
|
}) {
|
|
4464
|
-
const [hasSearched, setHasSearched] =
|
|
3186
|
+
const [hasSearched, setHasSearched] = useState12(false);
|
|
4465
3187
|
const { formatMessage } = useIntl13();
|
|
4466
|
-
return /* @__PURE__ */
|
|
4467
|
-
/* @__PURE__ */
|
|
3188
|
+
return /* @__PURE__ */ jsxs20("div", { className: getMargin(margin), children: [
|
|
3189
|
+
/* @__PURE__ */ jsx66(
|
|
4468
3190
|
FieldInput_default,
|
|
4469
3191
|
{
|
|
4470
3192
|
id,
|
|
@@ -4473,8 +3195,8 @@ function BlockSearchRendererComponent({
|
|
|
4473
3195
|
help: "",
|
|
4474
3196
|
label: title,
|
|
4475
3197
|
features,
|
|
4476
|
-
children: /* @__PURE__ */
|
|
4477
|
-
|
|
3198
|
+
children: /* @__PURE__ */ jsx66(InputGroup3, { addonStart: { content: /* @__PURE__ */ jsx66(Search, { size: 24 }) }, children: /* @__PURE__ */ jsx66(
|
|
3199
|
+
Input4,
|
|
4478
3200
|
{
|
|
4479
3201
|
id,
|
|
4480
3202
|
name: id,
|
|
@@ -4493,7 +3215,7 @@ function BlockSearchRendererComponent({
|
|
|
4493
3215
|
) })
|
|
4494
3216
|
}
|
|
4495
3217
|
),
|
|
4496
|
-
isLoading ? /* @__PURE__ */
|
|
3218
|
+
isLoading ? /* @__PURE__ */ jsx66("span", { children: formatMessage(search_messages_default.loading) }) : /* @__PURE__ */ jsx66(SearchResultContent, { state, trackEvent })
|
|
4497
3219
|
] });
|
|
4498
3220
|
}
|
|
4499
3221
|
function SearchResultContent({
|
|
@@ -4502,39 +3224,39 @@ function SearchResultContent({
|
|
|
4502
3224
|
}) {
|
|
4503
3225
|
switch (state.type) {
|
|
4504
3226
|
case "error":
|
|
4505
|
-
return /* @__PURE__ */
|
|
3227
|
+
return /* @__PURE__ */ jsx66(ErrorResult, { state });
|
|
4506
3228
|
case "results":
|
|
4507
|
-
return /* @__PURE__ */
|
|
3229
|
+
return /* @__PURE__ */ jsx66(SearchResults, { state, trackEvent });
|
|
4508
3230
|
case "layout":
|
|
4509
|
-
return /* @__PURE__ */
|
|
3231
|
+
return /* @__PURE__ */ jsxs20(Fragment9, { children: [
|
|
4510
3232
|
" ",
|
|
4511
3233
|
state.layout,
|
|
4512
3234
|
" "
|
|
4513
3235
|
] });
|
|
4514
3236
|
case "noResults":
|
|
4515
|
-
return /* @__PURE__ */
|
|
3237
|
+
return /* @__PURE__ */ jsx66(EmptySearchResult, { state });
|
|
4516
3238
|
case "pending":
|
|
4517
3239
|
default:
|
|
4518
3240
|
return null;
|
|
4519
3241
|
}
|
|
4520
3242
|
}
|
|
4521
3243
|
function EmptySearchResult({ state }) {
|
|
4522
|
-
return /* @__PURE__ */
|
|
3244
|
+
return /* @__PURE__ */ jsx66(Markdown5, { className: "m-t-2", config: { link: { target: "_blank" } }, children: state.message });
|
|
4523
3245
|
}
|
|
4524
3246
|
function SearchResults({
|
|
4525
3247
|
state,
|
|
4526
3248
|
trackEvent
|
|
4527
3249
|
}) {
|
|
4528
|
-
return /* @__PURE__ */
|
|
3250
|
+
return /* @__PURE__ */ jsx66(List, { children: state.results.map((result) => {
|
|
4529
3251
|
const { media } = result;
|
|
4530
|
-
return /* @__PURE__ */
|
|
4531
|
-
|
|
3252
|
+
return /* @__PURE__ */ jsx66(
|
|
3253
|
+
ListItem10,
|
|
4532
3254
|
{
|
|
4533
3255
|
title: result.title,
|
|
4534
3256
|
subtitle: result.description,
|
|
4535
|
-
media: media ? /* @__PURE__ */
|
|
4536
|
-
control: /* @__PURE__ */
|
|
4537
|
-
|
|
3257
|
+
media: media ? /* @__PURE__ */ jsx66(OptionMedia, { media, preferAvatar: false }) : void 0,
|
|
3258
|
+
control: /* @__PURE__ */ jsx66(
|
|
3259
|
+
ListItem10.Navigation,
|
|
4538
3260
|
{
|
|
4539
3261
|
onClick: () => {
|
|
4540
3262
|
trackEvent("Search Result Selected", __spreadValues({
|
|
@@ -4553,10 +3275,10 @@ var BlockSearchRendererComponent_default = BlockSearchRendererComponent;
|
|
|
4553
3275
|
|
|
4554
3276
|
// ../renderers/src/SearchRenderer/InlineSearchRendererComponent.tsx
|
|
4555
3277
|
import { Markdown as Markdown6, Typeahead } from "@transferwise/components";
|
|
4556
|
-
import { Search as
|
|
4557
|
-
import { useState as
|
|
3278
|
+
import { Search as Search2 } from "@transferwise/icons";
|
|
3279
|
+
import { useState as useState13 } from "react";
|
|
4558
3280
|
import { useIntl as useIntl14 } from "react-intl";
|
|
4559
|
-
import { jsx as
|
|
3281
|
+
import { jsx as jsx67 } from "react/jsx-runtime";
|
|
4560
3282
|
function InlineSearchRenderer({
|
|
4561
3283
|
id,
|
|
4562
3284
|
hint,
|
|
@@ -4568,9 +3290,9 @@ function InlineSearchRenderer({
|
|
|
4568
3290
|
onChange,
|
|
4569
3291
|
trackEvent
|
|
4570
3292
|
}) {
|
|
4571
|
-
const [hasSearched, setHasSearched] =
|
|
3293
|
+
const [hasSearched, setHasSearched] = useState13(false);
|
|
4572
3294
|
const intl = useIntl14();
|
|
4573
|
-
return /* @__PURE__ */
|
|
3295
|
+
return /* @__PURE__ */ jsx67("div", { className: getMargin(margin), children: /* @__PURE__ */ jsx67(
|
|
4574
3296
|
FieldInput_default,
|
|
4575
3297
|
{
|
|
4576
3298
|
id,
|
|
@@ -4579,7 +3301,7 @@ function InlineSearchRenderer({
|
|
|
4579
3301
|
help: "",
|
|
4580
3302
|
label: title,
|
|
4581
3303
|
features,
|
|
4582
|
-
children: /* @__PURE__ */
|
|
3304
|
+
children: /* @__PURE__ */ jsx67(
|
|
4583
3305
|
Typeahead,
|
|
4584
3306
|
{
|
|
4585
3307
|
id: "typeahead-input-id",
|
|
@@ -4588,10 +3310,10 @@ function InlineSearchRenderer({
|
|
|
4588
3310
|
size: "md",
|
|
4589
3311
|
placeholder: hint,
|
|
4590
3312
|
maxHeight: 100,
|
|
4591
|
-
footer: /* @__PURE__ */
|
|
3313
|
+
footer: /* @__PURE__ */ jsx67(TypeaheadFooter, { state, isLoading }),
|
|
4592
3314
|
multiple: false,
|
|
4593
3315
|
clearable: false,
|
|
4594
|
-
addon: /* @__PURE__ */
|
|
3316
|
+
addon: /* @__PURE__ */ jsx67(Search2, { size: 24 }),
|
|
4595
3317
|
options: state.type === "results" ? state.results.map(mapResultToTypeaheadOption) : [],
|
|
4596
3318
|
minQueryLength: 1,
|
|
4597
3319
|
onChange: (values) => {
|
|
@@ -4630,26 +3352,26 @@ function mapResultToTypeaheadOption(result) {
|
|
|
4630
3352
|
function TypeaheadFooter({ state, isLoading }) {
|
|
4631
3353
|
const { formatMessage } = useIntl14();
|
|
4632
3354
|
if (state.type === "layout") {
|
|
4633
|
-
return /* @__PURE__ */
|
|
3355
|
+
return /* @__PURE__ */ jsx67("div", { className: "m-x-1 m-y-1", children: state.layout });
|
|
4634
3356
|
}
|
|
4635
3357
|
if (state.type === "noResults") {
|
|
4636
|
-
return /* @__PURE__ */
|
|
3358
|
+
return /* @__PURE__ */ jsx67(Markdown6, { className: "m-t-2 m-x-2", config: { link: { target: "_blank" } }, children: state.message });
|
|
4637
3359
|
}
|
|
4638
3360
|
if (state.type === "error") {
|
|
4639
|
-
return /* @__PURE__ */
|
|
3361
|
+
return /* @__PURE__ */ jsx67("div", { className: "m-t-2 m-x-2", children: /* @__PURE__ */ jsx67(ErrorResult, { state }) });
|
|
4640
3362
|
}
|
|
4641
3363
|
if (state.type === "pending" || isLoading) {
|
|
4642
|
-
return /* @__PURE__ */
|
|
3364
|
+
return /* @__PURE__ */ jsx67("p", { className: "m-t-2 m-x-2", children: formatMessage(search_messages_default.loading) });
|
|
4643
3365
|
}
|
|
4644
3366
|
return null;
|
|
4645
3367
|
}
|
|
4646
3368
|
var InlineSearchRendererComponent_default = InlineSearchRenderer;
|
|
4647
3369
|
|
|
4648
3370
|
// ../renderers/src/SearchRenderer/SearchRenderer.tsx
|
|
4649
|
-
import { jsx as
|
|
3371
|
+
import { jsx as jsx68 } from "react/jsx-runtime";
|
|
4650
3372
|
var SearchRenderer = {
|
|
4651
3373
|
canRenderType: "search",
|
|
4652
|
-
render: (props) => props.control === "inline" ? /* @__PURE__ */
|
|
3374
|
+
render: (props) => props.control === "inline" ? /* @__PURE__ */ jsx68(InlineSearchRendererComponent_default, __spreadValues({}, props)) : /* @__PURE__ */ jsx68(BlockSearchRendererComponent_default, __spreadValues({}, props))
|
|
4653
3375
|
};
|
|
4654
3376
|
var SearchRenderer_default = SearchRenderer;
|
|
4655
3377
|
|
|
@@ -4678,12 +3400,12 @@ var getHeaderAction2 = (callToAction) => {
|
|
|
4678
3400
|
};
|
|
4679
3401
|
|
|
4680
3402
|
// ../renderers/src/SectionRenderer.tsx
|
|
4681
|
-
import { jsx as
|
|
3403
|
+
import { jsx as jsx69, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
4682
3404
|
var SectionRenderer = {
|
|
4683
3405
|
canRenderType: "section",
|
|
4684
3406
|
render: ({ children, callToAction, margin, title }) => {
|
|
4685
|
-
return /* @__PURE__ */
|
|
4686
|
-
(title || callToAction) && /* @__PURE__ */
|
|
3407
|
+
return /* @__PURE__ */ jsxs21("section", { className: getMargin(margin), children: [
|
|
3408
|
+
(title || callToAction) && /* @__PURE__ */ jsx69(Header7, { title: title != null ? title : "", action: getHeaderAction2(callToAction) }),
|
|
4687
3409
|
children
|
|
4688
3410
|
] });
|
|
4689
3411
|
}
|
|
@@ -4692,7 +3414,7 @@ var SectionRenderer_default = SectionRenderer;
|
|
|
4692
3414
|
|
|
4693
3415
|
// ../renderers/src/SelectInputRenderer/RadioInputRendererComponent.tsx
|
|
4694
3416
|
import { RadioGroup } from "@transferwise/components";
|
|
4695
|
-
import { Fragment as
|
|
3417
|
+
import { Fragment as Fragment10, jsx as jsx70, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
4696
3418
|
function RadioInputRendererComponent(props) {
|
|
4697
3419
|
const {
|
|
4698
3420
|
id,
|
|
@@ -4707,8 +3429,8 @@ function RadioInputRendererComponent(props) {
|
|
|
4707
3429
|
validationState,
|
|
4708
3430
|
onSelect
|
|
4709
3431
|
} = props;
|
|
4710
|
-
return /* @__PURE__ */
|
|
4711
|
-
/* @__PURE__ */
|
|
3432
|
+
return /* @__PURE__ */ jsxs22(Fragment10, { children: [
|
|
3433
|
+
/* @__PURE__ */ jsx70(
|
|
4712
3434
|
FieldInput_default,
|
|
4713
3435
|
{
|
|
4714
3436
|
id,
|
|
@@ -4717,7 +3439,7 @@ function RadioInputRendererComponent(props) {
|
|
|
4717
3439
|
description,
|
|
4718
3440
|
validation: validationState,
|
|
4719
3441
|
features,
|
|
4720
|
-
children: /* @__PURE__ */
|
|
3442
|
+
children: /* @__PURE__ */ jsx70("span", { children: /* @__PURE__ */ jsx70(
|
|
4721
3443
|
RadioGroup,
|
|
4722
3444
|
{
|
|
4723
3445
|
name: id,
|
|
@@ -4726,7 +3448,7 @@ function RadioInputRendererComponent(props) {
|
|
|
4726
3448
|
value: index,
|
|
4727
3449
|
secondary: option.description,
|
|
4728
3450
|
disabled: option.disabled || disabled,
|
|
4729
|
-
avatar: /* @__PURE__ */
|
|
3451
|
+
avatar: /* @__PURE__ */ jsx70(OptionMedia, { media: option.media, preferAvatar: false })
|
|
4730
3452
|
})),
|
|
4731
3453
|
selectedValue: selectedIndex != null ? selectedIndex : void 0,
|
|
4732
3454
|
onChange: onSelect
|
|
@@ -4741,8 +3463,8 @@ function RadioInputRendererComponent(props) {
|
|
|
4741
3463
|
|
|
4742
3464
|
// ../renderers/src/SelectInputRenderer/TabInputRendererComponent.tsx
|
|
4743
3465
|
import { Tabs } from "@transferwise/components";
|
|
4744
|
-
import { useEffect as
|
|
4745
|
-
import { Fragment as
|
|
3466
|
+
import { useEffect as useEffect9 } from "react";
|
|
3467
|
+
import { Fragment as Fragment11, jsx as jsx71, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
4746
3468
|
function TabInputRendererComponent(props) {
|
|
4747
3469
|
const {
|
|
4748
3470
|
id,
|
|
@@ -4757,13 +3479,13 @@ function TabInputRendererComponent(props) {
|
|
|
4757
3479
|
validationState,
|
|
4758
3480
|
onSelect
|
|
4759
3481
|
} = props;
|
|
4760
|
-
|
|
3482
|
+
useEffect9(() => {
|
|
4761
3483
|
if (!isValidIndex2(selectedIndex, options.length)) {
|
|
4762
3484
|
onSelect(0);
|
|
4763
3485
|
}
|
|
4764
3486
|
}, [selectedIndex, onSelect, options.length]);
|
|
4765
|
-
return /* @__PURE__ */
|
|
4766
|
-
/* @__PURE__ */
|
|
3487
|
+
return /* @__PURE__ */ jsxs23(Fragment11, { children: [
|
|
3488
|
+
/* @__PURE__ */ jsx71(
|
|
4767
3489
|
FieldInput_default,
|
|
4768
3490
|
{
|
|
4769
3491
|
id,
|
|
@@ -4772,7 +3494,7 @@ function TabInputRendererComponent(props) {
|
|
|
4772
3494
|
description,
|
|
4773
3495
|
validation: validationState,
|
|
4774
3496
|
features,
|
|
4775
|
-
children: /* @__PURE__ */
|
|
3497
|
+
children: /* @__PURE__ */ jsx71(
|
|
4776
3498
|
Tabs,
|
|
4777
3499
|
{
|
|
4778
3500
|
name: id,
|
|
@@ -4781,7 +3503,7 @@ function TabInputRendererComponent(props) {
|
|
|
4781
3503
|
title: option.title,
|
|
4782
3504
|
// if we pass null, we get some props-types console errors
|
|
4783
3505
|
// eslint-disable-next-line react/jsx-no-useless-fragment
|
|
4784
|
-
content: /* @__PURE__ */
|
|
3506
|
+
content: /* @__PURE__ */ jsx71(Fragment11, {}),
|
|
4785
3507
|
disabled: option.disabled || disabled
|
|
4786
3508
|
})),
|
|
4787
3509
|
onTabSelect: onSelect
|
|
@@ -4796,7 +3518,7 @@ var isValidIndex2 = (index, options) => index !== null && index >= 0 && index <
|
|
|
4796
3518
|
|
|
4797
3519
|
// ../renderers/src/SelectInputRenderer/SelectInputRendererComponent.tsx
|
|
4798
3520
|
import { SelectInput as SelectInput2, SelectInputOptionContent as SelectInputOptionContent2 } from "@transferwise/components";
|
|
4799
|
-
import { Fragment as
|
|
3521
|
+
import { Fragment as Fragment12, jsx as jsx72, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
4800
3522
|
function SelectInputRendererComponent(props) {
|
|
4801
3523
|
const {
|
|
4802
3524
|
id,
|
|
@@ -4837,13 +3559,13 @@ function SelectInputRendererComponent(props) {
|
|
|
4837
3559
|
} : {
|
|
4838
3560
|
title: option.title,
|
|
4839
3561
|
description: option.description,
|
|
4840
|
-
icon: /* @__PURE__ */
|
|
3562
|
+
icon: /* @__PURE__ */ jsx72(OptionMedia, { media: option.media, preferAvatar: false })
|
|
4841
3563
|
};
|
|
4842
|
-
return /* @__PURE__ */
|
|
3564
|
+
return /* @__PURE__ */ jsx72(SelectInputOptionContent2, __spreadValues({}, contentProps));
|
|
4843
3565
|
};
|
|
4844
3566
|
const extraProps = { autoComplete };
|
|
4845
|
-
return /* @__PURE__ */
|
|
4846
|
-
/* @__PURE__ */
|
|
3567
|
+
return /* @__PURE__ */ jsxs24(Fragment12, { children: [
|
|
3568
|
+
/* @__PURE__ */ jsx72(
|
|
4847
3569
|
FieldInput_default,
|
|
4848
3570
|
{
|
|
4849
3571
|
id,
|
|
@@ -4852,7 +3574,7 @@ function SelectInputRendererComponent(props) {
|
|
|
4852
3574
|
description,
|
|
4853
3575
|
validation: validationState,
|
|
4854
3576
|
features,
|
|
4855
|
-
children: /* @__PURE__ */
|
|
3577
|
+
children: /* @__PURE__ */ jsx72(
|
|
4856
3578
|
SelectInput2,
|
|
4857
3579
|
__spreadValues({
|
|
4858
3580
|
name: id,
|
|
@@ -4873,9 +3595,9 @@ function SelectInputRendererComponent(props) {
|
|
|
4873
3595
|
}
|
|
4874
3596
|
|
|
4875
3597
|
// ../renderers/src/SelectInputRenderer/SegmentedInputRendererComponent.tsx
|
|
4876
|
-
import { useEffect as
|
|
3598
|
+
import { useEffect as useEffect10 } from "react";
|
|
4877
3599
|
import { SegmentedControl } from "@transferwise/components";
|
|
4878
|
-
import { Fragment as
|
|
3600
|
+
import { Fragment as Fragment13, jsx as jsx73, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
4879
3601
|
function SegmentedInputRendererComponent(props) {
|
|
4880
3602
|
const {
|
|
4881
3603
|
id,
|
|
@@ -4889,13 +3611,13 @@ function SegmentedInputRendererComponent(props) {
|
|
|
4889
3611
|
validationState,
|
|
4890
3612
|
onSelect
|
|
4891
3613
|
} = props;
|
|
4892
|
-
|
|
3614
|
+
useEffect10(() => {
|
|
4893
3615
|
if (!isValidIndex3(selectedIndex, options.length)) {
|
|
4894
3616
|
onSelect(0);
|
|
4895
3617
|
}
|
|
4896
3618
|
}, [selectedIndex, onSelect, options.length]);
|
|
4897
|
-
return /* @__PURE__ */
|
|
4898
|
-
/* @__PURE__ */
|
|
3619
|
+
return /* @__PURE__ */ jsxs25(Fragment13, { children: [
|
|
3620
|
+
/* @__PURE__ */ jsx73(
|
|
4899
3621
|
FieldInput_default,
|
|
4900
3622
|
{
|
|
4901
3623
|
id,
|
|
@@ -4904,7 +3626,7 @@ function SegmentedInputRendererComponent(props) {
|
|
|
4904
3626
|
description,
|
|
4905
3627
|
validation: validationState,
|
|
4906
3628
|
features,
|
|
4907
|
-
children: /* @__PURE__ */
|
|
3629
|
+
children: /* @__PURE__ */ jsx73(
|
|
4908
3630
|
SegmentedControl,
|
|
4909
3631
|
{
|
|
4910
3632
|
name: `${id}-segmented-control`,
|
|
@@ -4921,14 +3643,14 @@ function SegmentedInputRendererComponent(props) {
|
|
|
4921
3643
|
)
|
|
4922
3644
|
}
|
|
4923
3645
|
),
|
|
4924
|
-
/* @__PURE__ */
|
|
3646
|
+
/* @__PURE__ */ jsx73("div", { id: `${id}-children`, children })
|
|
4925
3647
|
] });
|
|
4926
3648
|
}
|
|
4927
3649
|
var isValidIndex3 = (index, options) => index !== null && index >= 0 && index < options;
|
|
4928
3650
|
|
|
4929
3651
|
// ../renderers/src/SelectInputRenderer/RadioItemRendererComponent.tsx
|
|
4930
|
-
import { Header as Header8, InlineAlert as InlineAlert4, List as List2, ListItem as
|
|
4931
|
-
import { jsx as
|
|
3652
|
+
import { Header as Header8, InlineAlert as InlineAlert4, List as List2, ListItem as ListItem11 } from "@transferwise/components";
|
|
3653
|
+
import { jsx as jsx74, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
4932
3654
|
function RadioItemRendererComponent(props) {
|
|
4933
3655
|
const {
|
|
4934
3656
|
id,
|
|
@@ -4944,23 +3666,23 @@ function RadioItemRendererComponent(props) {
|
|
|
4944
3666
|
onSelect
|
|
4945
3667
|
} = props;
|
|
4946
3668
|
const { ref } = useScrollToError(validationState, features);
|
|
4947
|
-
return /* @__PURE__ */
|
|
4948
|
-
rootTitle && /* @__PURE__ */
|
|
3669
|
+
return /* @__PURE__ */ jsxs26("div", { ref, children: [
|
|
3670
|
+
rootTitle && /* @__PURE__ */ jsx74(
|
|
4949
3671
|
Header8,
|
|
4950
3672
|
{
|
|
4951
3673
|
as: "h2",
|
|
4952
|
-
title: help ? /* @__PURE__ */
|
|
3674
|
+
title: help ? /* @__PURE__ */ jsx74(LabelContentWithHelp, { text: rootTitle, help }) : rootTitle
|
|
4953
3675
|
}
|
|
4954
3676
|
),
|
|
4955
|
-
rootDescription && /* @__PURE__ */
|
|
4956
|
-
/* @__PURE__ */
|
|
4957
|
-
({ title, description, additionalText, inlineAlert, disabled, media, supportingValues }, index) => /* @__PURE__ */
|
|
4958
|
-
|
|
3677
|
+
rootDescription && /* @__PURE__ */ jsx74("p", { children: rootDescription }),
|
|
3678
|
+
/* @__PURE__ */ jsx74(List2, { children: options.map(
|
|
3679
|
+
({ title, description, additionalText, inlineAlert, disabled, media, supportingValues }, index) => /* @__PURE__ */ jsx74(
|
|
3680
|
+
ListItem11,
|
|
4959
3681
|
__spreadValues({
|
|
4960
3682
|
title,
|
|
4961
3683
|
subtitle: description,
|
|
4962
|
-
control: /* @__PURE__ */
|
|
4963
|
-
|
|
3684
|
+
control: /* @__PURE__ */ jsx74(
|
|
3685
|
+
ListItem11.Radio,
|
|
4964
3686
|
{
|
|
4965
3687
|
name: title,
|
|
4966
3688
|
checked: selectedIndex === index,
|
|
@@ -4975,50 +3697,50 @@ function RadioItemRendererComponent(props) {
|
|
|
4975
3697
|
title
|
|
4976
3698
|
)
|
|
4977
3699
|
) }, `${id}-${selectedIndex}`),
|
|
4978
|
-
(validationState == null ? void 0 : validationState.status) === "invalid" && /* @__PURE__ */
|
|
3700
|
+
(validationState == null ? void 0 : validationState.status) === "invalid" && /* @__PURE__ */ jsx74(InlineAlert4, { type: "negative", children: validationState.message }),
|
|
4979
3701
|
children
|
|
4980
3702
|
] });
|
|
4981
3703
|
}
|
|
4982
3704
|
|
|
4983
3705
|
// ../renderers/src/SelectInputRenderer/SelectInputRenderer.tsx
|
|
4984
|
-
import { jsx as
|
|
3706
|
+
import { jsx as jsx75 } from "react/jsx-runtime";
|
|
4985
3707
|
var SelectInputRenderer = {
|
|
4986
3708
|
canRenderType: "input-select",
|
|
4987
3709
|
render: (props) => {
|
|
4988
3710
|
switch (props.control) {
|
|
4989
3711
|
case "radio":
|
|
4990
|
-
return /* @__PURE__ */
|
|
3712
|
+
return /* @__PURE__ */ jsx75(RadioInputRendererComponent, __spreadValues({}, props));
|
|
4991
3713
|
case "radio-item":
|
|
4992
|
-
return /* @__PURE__ */
|
|
3714
|
+
return /* @__PURE__ */ jsx75(RadioItemRendererComponent, __spreadValues({}, props));
|
|
4993
3715
|
case "tab":
|
|
4994
|
-
return props.options.length > 3 ? /* @__PURE__ */
|
|
3716
|
+
return props.options.length > 3 ? /* @__PURE__ */ jsx75(SelectInputRendererComponent, __spreadValues({}, props)) : /* @__PURE__ */ jsx75(TabInputRendererComponent, __spreadValues({}, props));
|
|
4995
3717
|
case "segmented":
|
|
4996
|
-
return props.options.length > 3 ? /* @__PURE__ */
|
|
3718
|
+
return props.options.length > 3 ? /* @__PURE__ */ jsx75(SelectInputRendererComponent, __spreadValues({}, props)) : /* @__PURE__ */ jsx75(SegmentedInputRendererComponent, __spreadValues({}, props));
|
|
4997
3719
|
case "select":
|
|
4998
3720
|
default:
|
|
4999
|
-
return /* @__PURE__ */
|
|
3721
|
+
return /* @__PURE__ */ jsx75(SelectInputRendererComponent, __spreadValues({}, props));
|
|
5000
3722
|
}
|
|
5001
3723
|
}
|
|
5002
3724
|
};
|
|
5003
3725
|
var SelectInputRenderer_default = SelectInputRenderer;
|
|
5004
3726
|
|
|
5005
3727
|
// ../renderers/src/StatusListRenderer.tsx
|
|
5006
|
-
import { AvatarView as AvatarView4, Header as Header9, ListItem as
|
|
5007
|
-
import { jsx as
|
|
3728
|
+
import { AvatarView as AvatarView4, Header as Header9, ListItem as ListItem12 } from "@transferwise/components";
|
|
3729
|
+
import { jsx as jsx76, jsxs as jsxs27 } from "react/jsx-runtime";
|
|
5008
3730
|
var StatusListRenderer = {
|
|
5009
3731
|
canRenderType: "status-list",
|
|
5010
|
-
render: ({ margin, items, title }) => /* @__PURE__ */
|
|
5011
|
-
title ? /* @__PURE__ */
|
|
3732
|
+
render: ({ margin, items, title }) => /* @__PURE__ */ jsxs27("div", { className: getMargin(margin), children: [
|
|
3733
|
+
title ? /* @__PURE__ */ jsx76(Header9, { title }) : null,
|
|
5012
3734
|
items.map((item) => {
|
|
5013
3735
|
const { callToAction, description, title: itemTitle } = item;
|
|
5014
|
-
return /* @__PURE__ */
|
|
5015
|
-
|
|
3736
|
+
return /* @__PURE__ */ jsx76(
|
|
3737
|
+
ListItem12,
|
|
5016
3738
|
{
|
|
5017
3739
|
title: itemTitle,
|
|
5018
3740
|
subtitle: description,
|
|
5019
|
-
media: /* @__PURE__ */
|
|
5020
|
-
additionalInfo: callToAction ? /* @__PURE__ */
|
|
5021
|
-
|
|
3741
|
+
media: /* @__PURE__ */ jsx76(StatusListItemMedia, __spreadValues({}, item)),
|
|
3742
|
+
additionalInfo: callToAction ? /* @__PURE__ */ jsx76(
|
|
3743
|
+
ListItem12.AdditionalInfo,
|
|
5022
3744
|
{
|
|
5023
3745
|
action: __spreadValues({
|
|
5024
3746
|
label: callToAction.title
|
|
@@ -5036,10 +3758,10 @@ var StatusListItemMedia = ({ icon, status }) => {
|
|
|
5036
3758
|
return void 0;
|
|
5037
3759
|
}
|
|
5038
3760
|
if ("name" in icon) {
|
|
5039
|
-
return /* @__PURE__ */
|
|
3761
|
+
return /* @__PURE__ */ jsx76(AvatarView4, { badge: { status: mapStatus(status) }, children: /* @__PURE__ */ jsx76(DynamicIcon_default, { name: icon.name }) });
|
|
5040
3762
|
}
|
|
5041
3763
|
if ("text" in icon) {
|
|
5042
|
-
return /* @__PURE__ */
|
|
3764
|
+
return /* @__PURE__ */ jsx76(AvatarView4, { badge: { status: mapStatus(status) }, children: icon.text });
|
|
5043
3765
|
}
|
|
5044
3766
|
return void 0;
|
|
5045
3767
|
};
|
|
@@ -5057,12 +3779,12 @@ var StatusListRenderer_default = StatusListRenderer;
|
|
|
5057
3779
|
|
|
5058
3780
|
// ../renderers/src/utils/useCustomTheme.ts
|
|
5059
3781
|
import { useTheme } from "@wise/components-theming";
|
|
5060
|
-
import { useEffect as
|
|
3782
|
+
import { useEffect as useEffect11, useMemo } from "react";
|
|
5061
3783
|
var ThemeRequiredEventName = "Theme Required";
|
|
5062
3784
|
var useCustomTheme = (theme, trackEvent) => {
|
|
5063
3785
|
const theming = useTheme();
|
|
5064
|
-
const previousTheme =
|
|
5065
|
-
|
|
3786
|
+
const previousTheme = useMemo(() => theming.theme, []);
|
|
3787
|
+
useEffect11(() => {
|
|
5066
3788
|
theming.setTheme(theme);
|
|
5067
3789
|
trackEvent(ThemeRequiredEventName, { theme });
|
|
5068
3790
|
return theme !== previousTheme ? () => {
|
|
@@ -5073,14 +3795,86 @@ var useCustomTheme = (theme, trackEvent) => {
|
|
|
5073
3795
|
}, []);
|
|
5074
3796
|
};
|
|
5075
3797
|
|
|
3798
|
+
// ../renderers/src/step/StepFooter.tsx
|
|
3799
|
+
import { Button as Button7 } from "@transferwise/components";
|
|
3800
|
+
import { useEffect as useEffect12, useRef as useRef2, useState as useState14 } from "react";
|
|
3801
|
+
import { useIntl as useIntl15 } from "react-intl";
|
|
3802
|
+
|
|
3803
|
+
// ../renderers/src/messages/step.messages.ts
|
|
3804
|
+
import { defineMessages as defineMessages11 } from "react-intl";
|
|
3805
|
+
var step_messages_default = defineMessages11({
|
|
3806
|
+
scrollToBottom: {
|
|
3807
|
+
id: "df.wise.step.scrollToBottom",
|
|
3808
|
+
defaultMessage: "Scroll to bottom",
|
|
3809
|
+
description: "Label for a button that appears when the content of a step is too long and the user needs to scroll to the bottom to see all the content."
|
|
3810
|
+
}
|
|
3811
|
+
});
|
|
3812
|
+
|
|
3813
|
+
// ../renderers/src/step/StepFooter.tsx
|
|
3814
|
+
import { Fragment as Fragment14, jsx as jsx77, jsxs as jsxs28 } from "react/jsx-runtime";
|
|
3815
|
+
var SCROLL_TO_BOTTOM = "scroll-to-bottom";
|
|
3816
|
+
var StepFooter = ({ footer, tags }) => {
|
|
3817
|
+
if (tags == null ? void 0 : tags.includes(SCROLL_TO_BOTTOM)) {
|
|
3818
|
+
return /* @__PURE__ */ jsx77(FooterWithScrollButton, { footer });
|
|
3819
|
+
}
|
|
3820
|
+
return /* @__PURE__ */ jsx77(DefaultFooter, { footer });
|
|
3821
|
+
};
|
|
3822
|
+
var DefaultFooter = ({ footer }) => {
|
|
3823
|
+
const hasFooter = footer && Array.isArray(footer) && footer.length > 0;
|
|
3824
|
+
return hasFooter ? /* @__PURE__ */ jsx77("div", { className: "df-step-fixed__footer", children: footer }) : void 0;
|
|
3825
|
+
};
|
|
3826
|
+
var FooterWithScrollButton = ({ footer }) => {
|
|
3827
|
+
const { formatMessage } = useIntl15();
|
|
3828
|
+
const endOfLayoutRef = useRef2(null);
|
|
3829
|
+
const isElementVisible = useIsElementVisible(endOfLayoutRef);
|
|
3830
|
+
const scrollButton = /* @__PURE__ */ jsx77(
|
|
3831
|
+
Button7,
|
|
3832
|
+
{
|
|
3833
|
+
className: "m-b-1",
|
|
3834
|
+
v2: true,
|
|
3835
|
+
block: true,
|
|
3836
|
+
priority: "tertiary",
|
|
3837
|
+
onClick: () => {
|
|
3838
|
+
var _a;
|
|
3839
|
+
(_a = endOfLayoutRef.current) == null ? void 0 : _a.scrollIntoView({ behavior: "smooth" });
|
|
3840
|
+
},
|
|
3841
|
+
children: formatMessage(step_messages_default.scrollToBottom)
|
|
3842
|
+
}
|
|
3843
|
+
);
|
|
3844
|
+
const hasStepFooterContent = footer && Array.isArray(footer) && footer.length > 0;
|
|
3845
|
+
if (isElementVisible && !hasStepFooterContent) {
|
|
3846
|
+
return /* @__PURE__ */ jsx77("div", { ref: endOfLayoutRef, "aria-hidden": "true" });
|
|
3847
|
+
}
|
|
3848
|
+
return /* @__PURE__ */ jsxs28(Fragment14, { children: [
|
|
3849
|
+
/* @__PURE__ */ jsx77("div", { ref: endOfLayoutRef, "aria-hidden": "true" }),
|
|
3850
|
+
/* @__PURE__ */ jsxs28("div", { className: "df-step-fixed__footer", children: [
|
|
3851
|
+
!isElementVisible && scrollButton,
|
|
3852
|
+
footer
|
|
3853
|
+
] })
|
|
3854
|
+
] });
|
|
3855
|
+
};
|
|
3856
|
+
var useIsElementVisible = (elementRef) => {
|
|
3857
|
+
const [isVisible, setIsVisible] = useState14(false);
|
|
3858
|
+
useEffect12(() => {
|
|
3859
|
+
const element = elementRef.current;
|
|
3860
|
+
if (!element) return;
|
|
3861
|
+
const observer = new IntersectionObserver(([entry]) => {
|
|
3862
|
+
setIsVisible(entry.isIntersecting);
|
|
3863
|
+
});
|
|
3864
|
+
observer.observe(element);
|
|
3865
|
+
return () => observer.disconnect();
|
|
3866
|
+
}, [elementRef]);
|
|
3867
|
+
return isVisible;
|
|
3868
|
+
};
|
|
3869
|
+
|
|
5076
3870
|
// ../renderers/src/step/StepHeader.tsx
|
|
5077
3871
|
import { Title as Title2 } from "@transferwise/components";
|
|
5078
|
-
import { Fragment as Fragment15, jsx as
|
|
3872
|
+
import { Fragment as Fragment15, jsx as jsx78, jsxs as jsxs29 } from "react/jsx-runtime";
|
|
5079
3873
|
var StepHeader = ({ title, description, tags }) => {
|
|
5080
3874
|
const { titleType, alignmentClassName } = getHeaderStyle(tags);
|
|
5081
|
-
return /* @__PURE__ */
|
|
5082
|
-
title ? /* @__PURE__ */
|
|
5083
|
-
description ? /* @__PURE__ */
|
|
3875
|
+
return /* @__PURE__ */ jsxs29(Fragment15, { children: [
|
|
3876
|
+
title ? /* @__PURE__ */ jsx78(Title2, { as: "h1", type: titleType, className: `${alignmentClassName} m-b-2`, children: title }) : void 0,
|
|
3877
|
+
description ? /* @__PURE__ */ jsx78("p", { className: `${alignmentClassName} np-text-body-large`, children: description }) : void 0
|
|
5084
3878
|
] });
|
|
5085
3879
|
};
|
|
5086
3880
|
var getHeaderStyle = (tags) => {
|
|
@@ -5093,7 +3887,7 @@ var getHeaderStyle = (tags) => {
|
|
|
5093
3887
|
// ../renderers/src/step/topbar/BackButton.tsx
|
|
5094
3888
|
import { IconButton } from "@transferwise/components";
|
|
5095
3889
|
import { ArrowLeft } from "@transferwise/icons";
|
|
5096
|
-
import { useIntl as
|
|
3890
|
+
import { useIntl as useIntl16 } from "react-intl";
|
|
5097
3891
|
|
|
5098
3892
|
// ../renderers/src/messages/back.messages.ts
|
|
5099
3893
|
import { defineMessages as defineMessages12 } from "react-intl";
|
|
@@ -5106,30 +3900,30 @@ var back_messages_default = defineMessages12({
|
|
|
5106
3900
|
});
|
|
5107
3901
|
|
|
5108
3902
|
// ../renderers/src/step/topbar/BackButton.tsx
|
|
5109
|
-
import { jsx as
|
|
3903
|
+
import { jsx as jsx79, jsxs as jsxs30 } from "react/jsx-runtime";
|
|
5110
3904
|
function BackButton({ title, onClick }) {
|
|
5111
|
-
const { formatMessage } =
|
|
5112
|
-
return /* @__PURE__ */
|
|
5113
|
-
/* @__PURE__ */
|
|
5114
|
-
/* @__PURE__ */
|
|
3905
|
+
const { formatMessage } = useIntl16();
|
|
3906
|
+
return /* @__PURE__ */ jsxs30(IconButton, { className: "df-back-button", priority: "tertiary", onClick, children: [
|
|
3907
|
+
/* @__PURE__ */ jsx79("span", { className: "sr-only", children: title != null ? title : formatMessage(back_messages_default.back) }),
|
|
3908
|
+
/* @__PURE__ */ jsx79(ArrowLeft, {})
|
|
5115
3909
|
] });
|
|
5116
3910
|
}
|
|
5117
3911
|
|
|
5118
3912
|
// ../renderers/src/step/topbar/Toolbar.tsx
|
|
5119
|
-
import { Button as
|
|
5120
|
-
import { jsx as
|
|
3913
|
+
import { Button as Button8, IconButton as IconButton2 } from "@transferwise/components";
|
|
3914
|
+
import { jsx as jsx80, jsxs as jsxs31 } from "react/jsx-runtime";
|
|
5121
3915
|
var Toolbar = ({ items }) => {
|
|
5122
|
-
return (items == null ? void 0 : items.length) > 0 ? /* @__PURE__ */
|
|
3916
|
+
return (items == null ? void 0 : items.length) > 0 ? /* @__PURE__ */ jsx80("div", { className: "df-toolbar", children: items.map((item, index) => /* @__PURE__ */ jsx80(ToolbarButton, __spreadValues({}, item), `${item.type}-${index}-${item.title}`)) }) : null;
|
|
5123
3917
|
};
|
|
5124
3918
|
function ToolbarButton(props) {
|
|
5125
|
-
return prefersMedia(props.control) ? /* @__PURE__ */
|
|
3919
|
+
return prefersMedia(props.control) ? /* @__PURE__ */ jsx80(MediaToolbarButton, __spreadValues({}, props)) : /* @__PURE__ */ jsx80(TextToolbarButton, __spreadValues({}, props));
|
|
5126
3920
|
}
|
|
5127
3921
|
function MediaToolbarButton(props) {
|
|
5128
3922
|
var _a;
|
|
5129
3923
|
const { context, control, media, accessibilityDescription, disabled, onClick } = props;
|
|
5130
3924
|
const priority = getIconButtonPriority(control);
|
|
5131
3925
|
const type = getSentiment2(context);
|
|
5132
|
-
return /* @__PURE__ */
|
|
3926
|
+
return /* @__PURE__ */ jsxs31(
|
|
5133
3927
|
IconButton2,
|
|
5134
3928
|
{
|
|
5135
3929
|
className: "df-toolbar-button",
|
|
@@ -5139,7 +3933,7 @@ function MediaToolbarButton(props) {
|
|
|
5139
3933
|
type,
|
|
5140
3934
|
onClick,
|
|
5141
3935
|
children: [
|
|
5142
|
-
accessibilityDescription ? /* @__PURE__ */
|
|
3936
|
+
accessibilityDescription ? /* @__PURE__ */ jsx80("span", { className: "sr-only", children: accessibilityDescription }) : null,
|
|
5143
3937
|
media ? (_a = getAddonStartMedia(media)) == null ? void 0 : _a.value : null
|
|
5144
3938
|
]
|
|
5145
3939
|
}
|
|
@@ -5150,8 +3944,8 @@ function TextToolbarButton(props) {
|
|
|
5150
3944
|
const addonStart = media ? getAddonStartMedia(media) : void 0;
|
|
5151
3945
|
const priority = getPriority2(control);
|
|
5152
3946
|
const sentiment = getSentiment2(context);
|
|
5153
|
-
return /* @__PURE__ */
|
|
5154
|
-
|
|
3947
|
+
return /* @__PURE__ */ jsx80(
|
|
3948
|
+
Button8,
|
|
5155
3949
|
{
|
|
5156
3950
|
v2: true,
|
|
5157
3951
|
size: "sm",
|
|
@@ -5180,18 +3974,18 @@ var getIconButtonPriority = (control) => {
|
|
|
5180
3974
|
};
|
|
5181
3975
|
|
|
5182
3976
|
// ../renderers/src/step/topbar/TopBar.tsx
|
|
5183
|
-
import { jsx as
|
|
3977
|
+
import { jsx as jsx81, jsxs as jsxs32 } from "react/jsx-runtime";
|
|
5184
3978
|
function TopBar({ back, toolbar, tags }) {
|
|
5185
3979
|
const isBackAllowed = !(tags == null ? void 0 : tags.includes("non-dismissible"));
|
|
5186
3980
|
const backCTA = isBackAllowed ? back : void 0;
|
|
5187
|
-
return backCTA || toolbar ? /* @__PURE__ */
|
|
5188
|
-
backCTA ? /* @__PURE__ */
|
|
5189
|
-
toolbar ? /* @__PURE__ */
|
|
3981
|
+
return backCTA || toolbar ? /* @__PURE__ */ jsxs32("div", { className: "d-flex m-b-2", children: [
|
|
3982
|
+
backCTA ? /* @__PURE__ */ jsx81(BackButton, __spreadValues({}, backCTA)) : null,
|
|
3983
|
+
toolbar ? /* @__PURE__ */ jsx81(Toolbar, __spreadValues({}, toolbar)) : null
|
|
5190
3984
|
] }) : null;
|
|
5191
3985
|
}
|
|
5192
3986
|
|
|
5193
3987
|
// ../renderers/src/step/SplashCelebrationStepRenderer.tsx
|
|
5194
|
-
import { jsx as
|
|
3988
|
+
import { jsx as jsx82, jsxs as jsxs33 } from "react/jsx-runtime";
|
|
5195
3989
|
var SplashCelebrationStepRenderer = {
|
|
5196
3990
|
canRenderType: "step",
|
|
5197
3991
|
canRender: ({ control }) => control === "splash-celebration",
|
|
@@ -5200,16 +3994,16 @@ var SplashCelebrationStepRenderer = {
|
|
|
5200
3994
|
function SplashCelebrationStepRendererComponent(props) {
|
|
5201
3995
|
const { back, title, description, toolbar, children, footer, tags, trackEvent } = props;
|
|
5202
3996
|
useCustomTheme("forest-green", trackEvent);
|
|
5203
|
-
return /* @__PURE__ */
|
|
5204
|
-
/* @__PURE__ */
|
|
5205
|
-
title || description ? /* @__PURE__ */
|
|
3997
|
+
return /* @__PURE__ */ jsxs33("div", { className: "splash-screen m-t-5", children: [
|
|
3998
|
+
/* @__PURE__ */ jsx82(TopBar, { back, toolbar, tags }),
|
|
3999
|
+
title || description ? /* @__PURE__ */ jsx82("div", { className: "m-b-4", children: /* @__PURE__ */ jsx82(StepHeader, { title, description, tags }) }) : void 0,
|
|
5206
4000
|
children,
|
|
5207
|
-
/* @__PURE__ */
|
|
4001
|
+
/* @__PURE__ */ jsx82(StepFooter, { footer, tags })
|
|
5208
4002
|
] });
|
|
5209
4003
|
}
|
|
5210
4004
|
|
|
5211
4005
|
// ../renderers/src/step/SplashStepRenderer.tsx
|
|
5212
|
-
import { jsx as
|
|
4006
|
+
import { jsx as jsx83, jsxs as jsxs34 } from "react/jsx-runtime";
|
|
5213
4007
|
var SplashStepRenderer = {
|
|
5214
4008
|
canRenderType: "step",
|
|
5215
4009
|
canRender: ({ control }) => control === "splash",
|
|
@@ -5217,55 +4011,55 @@ var SplashStepRenderer = {
|
|
|
5217
4011
|
};
|
|
5218
4012
|
function SplashStepRendererComponent(props) {
|
|
5219
4013
|
const { back, title, description, toolbar, children, footer, tags } = props;
|
|
5220
|
-
return /* @__PURE__ */
|
|
5221
|
-
/* @__PURE__ */
|
|
5222
|
-
title || description ? /* @__PURE__ */
|
|
4014
|
+
return /* @__PURE__ */ jsxs34("div", { className: "splash-screen m-t-5", children: [
|
|
4015
|
+
/* @__PURE__ */ jsx83(TopBar, { back, toolbar, tags }),
|
|
4016
|
+
title || description ? /* @__PURE__ */ jsx83("div", { className: "m-b-4", children: /* @__PURE__ */ jsx83(StepHeader, { title, description, tags }) }) : void 0,
|
|
5223
4017
|
children,
|
|
5224
|
-
/* @__PURE__ */
|
|
4018
|
+
/* @__PURE__ */ jsx83(StepFooter, { footer, tags })
|
|
5225
4019
|
] });
|
|
5226
4020
|
}
|
|
5227
4021
|
|
|
5228
4022
|
// ../renderers/src/step/StepRenderer.tsx
|
|
5229
4023
|
import { Alert as Alert2 } from "@transferwise/components";
|
|
5230
|
-
import { jsx as
|
|
4024
|
+
import { jsx as jsx84, jsxs as jsxs35 } from "react/jsx-runtime";
|
|
5231
4025
|
var StepRenderer = {
|
|
5232
4026
|
canRenderType: "step",
|
|
5233
4027
|
render: StepRendererComponent
|
|
5234
4028
|
};
|
|
5235
4029
|
function StepRendererComponent(props) {
|
|
5236
4030
|
const { back, description, error, title, children, toolbar, footer, tags } = props;
|
|
5237
|
-
return /* @__PURE__ */
|
|
5238
|
-
/* @__PURE__ */
|
|
5239
|
-
title || description ? /* @__PURE__ */
|
|
5240
|
-
error ? /* @__PURE__ */
|
|
4031
|
+
return /* @__PURE__ */ jsxs35("div", { children: [
|
|
4032
|
+
/* @__PURE__ */ jsx84(TopBar, { back, toolbar, tags }),
|
|
4033
|
+
title || description ? /* @__PURE__ */ jsx84("div", { className: "m-b-4", children: /* @__PURE__ */ jsx84(StepHeader, { title, description, tags }) }) : void 0,
|
|
4034
|
+
error ? /* @__PURE__ */ jsx84(Alert2, { type: "negative", className: "m-b-2", message: error }) : null,
|
|
5241
4035
|
children,
|
|
5242
|
-
/* @__PURE__ */
|
|
4036
|
+
/* @__PURE__ */ jsx84(StepFooter, { footer, tags })
|
|
5243
4037
|
] });
|
|
5244
4038
|
}
|
|
5245
4039
|
|
|
5246
4040
|
// ../renderers/src/TabsRenderer.tsx
|
|
5247
|
-
import { Chips
|
|
4041
|
+
import { Chips, SegmentedControl as SegmentedControl2, Tabs as Tabs2 } from "@transferwise/components";
|
|
5248
4042
|
import { useState as useState15 } from "react";
|
|
5249
|
-
import { jsx as
|
|
4043
|
+
import { jsx as jsx85, jsxs as jsxs36 } from "react/jsx-runtime";
|
|
5250
4044
|
var TabsRenderer = {
|
|
5251
4045
|
canRenderType: "tabs",
|
|
5252
4046
|
render: (props) => {
|
|
5253
4047
|
switch (props.control) {
|
|
5254
4048
|
case "segmented":
|
|
5255
4049
|
if (props.tabs.length > 3) {
|
|
5256
|
-
return /* @__PURE__ */
|
|
4050
|
+
return /* @__PURE__ */ jsx85(TabsRendererComponent, __spreadValues({}, props));
|
|
5257
4051
|
}
|
|
5258
|
-
return /* @__PURE__ */
|
|
4052
|
+
return /* @__PURE__ */ jsx85(SegmentedTabsRendererComponent, __spreadValues({}, props));
|
|
5259
4053
|
case "chips":
|
|
5260
|
-
return /* @__PURE__ */
|
|
4054
|
+
return /* @__PURE__ */ jsx85(ChipsTabsRendererComponent, __spreadValues({}, props));
|
|
5261
4055
|
default:
|
|
5262
|
-
return /* @__PURE__ */
|
|
4056
|
+
return /* @__PURE__ */ jsx85(TabsRendererComponent, __spreadValues({}, props));
|
|
5263
4057
|
}
|
|
5264
4058
|
}
|
|
5265
4059
|
};
|
|
5266
4060
|
function TabsRendererComponent({ uid, margin, tabs }) {
|
|
5267
4061
|
const [selectedIndex, setSelectedIndex] = useState15(0);
|
|
5268
|
-
return /* @__PURE__ */
|
|
4062
|
+
return /* @__PURE__ */ jsx85("div", { className: getMargin(margin), children: /* @__PURE__ */ jsx85(
|
|
5269
4063
|
Tabs2,
|
|
5270
4064
|
{
|
|
5271
4065
|
name: uid,
|
|
@@ -5273,7 +4067,7 @@ function TabsRendererComponent({ uid, margin, tabs }) {
|
|
|
5273
4067
|
tabs: tabs.map((option) => ({
|
|
5274
4068
|
title: option.title,
|
|
5275
4069
|
disabled: false,
|
|
5276
|
-
content: /* @__PURE__ */
|
|
4070
|
+
content: /* @__PURE__ */ jsxs36("div", { className: "m-t-2", children: [
|
|
5277
4071
|
" ",
|
|
5278
4072
|
option.children,
|
|
5279
4073
|
" "
|
|
@@ -5286,8 +4080,8 @@ function TabsRendererComponent({ uid, margin, tabs }) {
|
|
|
5286
4080
|
function SegmentedTabsRendererComponent({ uid, margin, tabs }) {
|
|
5287
4081
|
var _a;
|
|
5288
4082
|
const [selectedIndex, setSelectedIndex] = useState15(0);
|
|
5289
|
-
return /* @__PURE__ */
|
|
5290
|
-
/* @__PURE__ */
|
|
4083
|
+
return /* @__PURE__ */ jsxs36("div", { className: getMargin(margin), children: [
|
|
4084
|
+
/* @__PURE__ */ jsx85(
|
|
5291
4085
|
SegmentedControl2,
|
|
5292
4086
|
{
|
|
5293
4087
|
name: uid,
|
|
@@ -5302,37 +4096,37 @@ function SegmentedTabsRendererComponent({ uid, margin, tabs }) {
|
|
|
5302
4096
|
onChange: (value) => setSelectedIndex(Number(value))
|
|
5303
4097
|
}
|
|
5304
4098
|
),
|
|
5305
|
-
/* @__PURE__ */
|
|
4099
|
+
/* @__PURE__ */ jsx85("div", { id: `${uid}-children`, className: "m-t-2", children: (_a = tabs[selectedIndex]) == null ? void 0 : _a.children })
|
|
5306
4100
|
] });
|
|
5307
4101
|
}
|
|
5308
4102
|
function ChipsTabsRendererComponent({ margin, tabs }) {
|
|
5309
4103
|
var _a;
|
|
5310
4104
|
const [selectedIndex, setSelectedIndex] = useState15(0);
|
|
5311
|
-
return /* @__PURE__ */
|
|
5312
|
-
/* @__PURE__ */
|
|
5313
|
-
|
|
4105
|
+
return /* @__PURE__ */ jsxs36("div", { className: getMargin(margin), children: [
|
|
4106
|
+
/* @__PURE__ */ jsx85("div", { className: "chips-container", children: /* @__PURE__ */ jsx85(
|
|
4107
|
+
Chips,
|
|
5314
4108
|
{
|
|
5315
4109
|
chips: tabs.map((tab, index) => ({ label: tab.title, value: index })),
|
|
5316
4110
|
selected: selectedIndex,
|
|
5317
4111
|
onChange: ({ selectedValue }) => setSelectedIndex(Number(selectedValue))
|
|
5318
4112
|
}
|
|
5319
4113
|
) }),
|
|
5320
|
-
/* @__PURE__ */
|
|
4114
|
+
/* @__PURE__ */ jsx85("div", { className: "m-t-2", children: (_a = tabs[selectedIndex]) == null ? void 0 : _a.children })
|
|
5321
4115
|
] });
|
|
5322
4116
|
}
|
|
5323
4117
|
|
|
5324
4118
|
// ../renderers/src/TextInputRenderer.tsx
|
|
5325
|
-
import { InputGroup as
|
|
4119
|
+
import { InputGroup as InputGroup4 } from "@transferwise/components";
|
|
5326
4120
|
|
|
5327
4121
|
// ../renderers/src/components/VariableTextInput.tsx
|
|
5328
4122
|
import {
|
|
5329
|
-
Input as
|
|
4123
|
+
Input as Input5,
|
|
5330
4124
|
InputWithDisplayFormat,
|
|
5331
4125
|
PhoneNumberInput,
|
|
5332
4126
|
TextArea,
|
|
5333
4127
|
TextareaWithDisplayFormat
|
|
5334
4128
|
} from "@transferwise/components";
|
|
5335
|
-
import { jsx as
|
|
4129
|
+
import { jsx as jsx86 } from "react/jsx-runtime";
|
|
5336
4130
|
var commonKeys = [
|
|
5337
4131
|
"autoComplete",
|
|
5338
4132
|
"autoCapitalize",
|
|
@@ -5351,12 +4145,12 @@ function VariableTextInput(inputProps) {
|
|
|
5351
4145
|
const commonProps = __spreadProps(__spreadValues({}, pick(inputProps, ...commonKeys)), { name: id });
|
|
5352
4146
|
switch (control) {
|
|
5353
4147
|
case "email":
|
|
5354
|
-
return /* @__PURE__ */
|
|
4148
|
+
return /* @__PURE__ */ jsx86(TextInput, __spreadProps(__spreadValues({}, commonProps), { type: "email", onChange }));
|
|
5355
4149
|
case "password":
|
|
5356
|
-
return /* @__PURE__ */
|
|
4150
|
+
return /* @__PURE__ */ jsx86(TextInput, __spreadProps(__spreadValues({}, commonProps), { type: "password", onChange }));
|
|
5357
4151
|
case "numeric": {
|
|
5358
4152
|
const numericProps = __spreadProps(__spreadValues({}, commonProps), { type: "number", onWheel });
|
|
5359
|
-
return /* @__PURE__ */
|
|
4153
|
+
return /* @__PURE__ */ jsx86(
|
|
5360
4154
|
TextInput,
|
|
5361
4155
|
__spreadProps(__spreadValues({}, numericProps), {
|
|
5362
4156
|
onChange: (newValue) => {
|
|
@@ -5367,21 +4161,21 @@ function VariableTextInput(inputProps) {
|
|
|
5367
4161
|
);
|
|
5368
4162
|
}
|
|
5369
4163
|
case "phone-number":
|
|
5370
|
-
return /* @__PURE__ */
|
|
4164
|
+
return /* @__PURE__ */ jsx86(PhoneNumberInput, __spreadProps(__spreadValues({ initialValue: value }, commonProps), { onChange }));
|
|
5371
4165
|
default: {
|
|
5372
|
-
return /* @__PURE__ */
|
|
4166
|
+
return /* @__PURE__ */ jsx86(TextInput, __spreadProps(__spreadValues({}, commonProps), { type: "text", onChange }));
|
|
5373
4167
|
}
|
|
5374
4168
|
}
|
|
5375
4169
|
}
|
|
5376
4170
|
function TextInput(props) {
|
|
5377
4171
|
const _a = props, { control, displayFormat, onChange } = _a, commonProps = __objRest(_a, ["control", "displayFormat", "onChange"]);
|
|
5378
4172
|
const InputWithPattern = control === "textarea" ? TextareaWithDisplayFormat : InputWithDisplayFormat;
|
|
5379
|
-
const InputWithoutPattern = control === "textarea" ? TextArea :
|
|
5380
|
-
return displayFormat ? /* @__PURE__ */
|
|
4173
|
+
const InputWithoutPattern = control === "textarea" ? TextArea : Input5;
|
|
4174
|
+
return displayFormat ? /* @__PURE__ */ jsx86(InputWithPattern, __spreadProps(__spreadValues({ displayPattern: displayFormat }, commonProps), { onChange })) : /* @__PURE__ */ jsx86(InputWithoutPattern, __spreadProps(__spreadValues({}, commonProps), { onChange: (e) => onChange(e.target.value) }));
|
|
5381
4175
|
}
|
|
5382
4176
|
|
|
5383
4177
|
// ../renderers/src/TextInputRenderer.tsx
|
|
5384
|
-
import { jsx as
|
|
4178
|
+
import { jsx as jsx87 } from "react/jsx-runtime";
|
|
5385
4179
|
var TextInputRenderer = {
|
|
5386
4180
|
canRenderType: "input-text",
|
|
5387
4181
|
render: (props) => {
|
|
@@ -5414,7 +4208,7 @@ var TextInputRenderer = {
|
|
|
5414
4208
|
}
|
|
5415
4209
|
}
|
|
5416
4210
|
});
|
|
5417
|
-
return /* @__PURE__ */
|
|
4211
|
+
return /* @__PURE__ */ jsx87(
|
|
5418
4212
|
FieldInput_default,
|
|
5419
4213
|
{
|
|
5420
4214
|
id,
|
|
@@ -5425,7 +4219,7 @@ var TextInputRenderer = {
|
|
|
5425
4219
|
loadingState: props.fieldLoadingState,
|
|
5426
4220
|
help,
|
|
5427
4221
|
features: props.features,
|
|
5428
|
-
children: /* @__PURE__ */
|
|
4222
|
+
children: /* @__PURE__ */ jsx87(InputGroup4, { addonStart: getInputGroupAddonStart(media), children: /* @__PURE__ */ jsx87(VariableTextInput, __spreadValues({}, inputProps)) })
|
|
5429
4223
|
}
|
|
5430
4224
|
);
|
|
5431
4225
|
}
|
|
@@ -5439,7 +4233,7 @@ import { Status as Status2, Upload, UploadInput as UploadInput2 } from "@transfe
|
|
|
5439
4233
|
var getRandomId = () => Math.random().toString(36).substring(2);
|
|
5440
4234
|
|
|
5441
4235
|
// ../renderers/src/UploadInputRenderer.tsx
|
|
5442
|
-
import { jsx as
|
|
4236
|
+
import { jsx as jsx88 } from "react/jsx-runtime";
|
|
5443
4237
|
var UploadInputRenderer = {
|
|
5444
4238
|
canRenderType: "input-upload",
|
|
5445
4239
|
render: (props) => {
|
|
@@ -5466,7 +4260,7 @@ var UploadInputRenderer = {
|
|
|
5466
4260
|
};
|
|
5467
4261
|
return (
|
|
5468
4262
|
// We don't pass help here as there is no sensible place to display it
|
|
5469
|
-
/* @__PURE__ */
|
|
4263
|
+
/* @__PURE__ */ jsx88(
|
|
5470
4264
|
UploadFieldInput_default,
|
|
5471
4265
|
{
|
|
5472
4266
|
id,
|
|
@@ -5474,7 +4268,7 @@ var UploadInputRenderer = {
|
|
|
5474
4268
|
description: void 0,
|
|
5475
4269
|
validation: validationState,
|
|
5476
4270
|
features,
|
|
5477
|
-
children: /* @__PURE__ */
|
|
4271
|
+
children: /* @__PURE__ */ jsx88(
|
|
5478
4272
|
UploadInput2,
|
|
5479
4273
|
{
|
|
5480
4274
|
id,
|
|
@@ -5542,7 +4336,7 @@ var LargeUploadRenderer = {
|
|
|
5542
4336
|
};
|
|
5543
4337
|
const filetypes = acceptsToFileTypes(accepts);
|
|
5544
4338
|
const usAccept = filetypes === "*" ? "*" : filetypes.join(",");
|
|
5545
|
-
return /* @__PURE__ */
|
|
4339
|
+
return /* @__PURE__ */ jsx88(
|
|
5546
4340
|
FieldInput_default,
|
|
5547
4341
|
{
|
|
5548
4342
|
id,
|
|
@@ -5551,7 +4345,7 @@ var LargeUploadRenderer = {
|
|
|
5551
4345
|
validation: validationState,
|
|
5552
4346
|
help,
|
|
5553
4347
|
features,
|
|
5554
|
-
children: /* @__PURE__ */
|
|
4348
|
+
children: /* @__PURE__ */ jsx88(
|
|
5555
4349
|
Upload,
|
|
5556
4350
|
__spreadProps(__spreadValues({}, uploadProps), {
|
|
5557
4351
|
usAccept,
|
|
@@ -5569,7 +4363,7 @@ var LargeUploadRenderer = {
|
|
|
5569
4363
|
// ../renderers/src/UpsellRenderer.tsx
|
|
5570
4364
|
import { Nudge } from "@transferwise/components";
|
|
5571
4365
|
import { useState as useState16 } from "react";
|
|
5572
|
-
import { jsx as
|
|
4366
|
+
import { jsx as jsx89 } from "react/jsx-runtime";
|
|
5573
4367
|
var UpsellRenderer = {
|
|
5574
4368
|
canRenderType: "upsell",
|
|
5575
4369
|
render: UpsellRendererComponent
|
|
@@ -5577,7 +4371,7 @@ var UpsellRenderer = {
|
|
|
5577
4371
|
function UpsellRendererComponent(props) {
|
|
5578
4372
|
const { text, callToAction, media, margin, onDismiss } = props;
|
|
5579
4373
|
const [isVisible, setIsVisible] = useState16(true);
|
|
5580
|
-
return isVisible ? /* @__PURE__ */
|
|
4374
|
+
return isVisible ? /* @__PURE__ */ jsx89(
|
|
5581
4375
|
Nudge,
|
|
5582
4376
|
{
|
|
5583
4377
|
className: getMargin(margin),
|
|
@@ -5626,7 +4420,7 @@ var supportedMediaNames = [
|
|
|
5626
4420
|
// ../renderers/src/ButtonRenderer/CircularButtonRenderer.tsx
|
|
5627
4421
|
import { CircularButton } from "@transferwise/components";
|
|
5628
4422
|
var import_classnames8 = __toESM(require_classnames());
|
|
5629
|
-
import { jsx as
|
|
4423
|
+
import { jsx as jsx90 } from "react/jsx-runtime";
|
|
5630
4424
|
var CircularButtonRenderer = {
|
|
5631
4425
|
canRenderType: "button",
|
|
5632
4426
|
canRender: ({ control }) => control === "circular",
|
|
@@ -5636,7 +4430,7 @@ function CircularButtonComponent(props) {
|
|
|
5636
4430
|
var _a;
|
|
5637
4431
|
const { context, disabled, margin, media, tags, title, onClick } = props;
|
|
5638
4432
|
const priority = tags == null ? void 0 : tags.find((tag) => tag === "primary" || tag === "secondary");
|
|
5639
|
-
return /* @__PURE__ */
|
|
4433
|
+
return /* @__PURE__ */ jsx90("div", { className: (0, import_classnames8.default)(getMargin(margin), "df-button", "circular"), children: /* @__PURE__ */ jsx90(
|
|
5640
4434
|
CircularButton,
|
|
5641
4435
|
{
|
|
5642
4436
|
disabled,
|
|
@@ -5656,7 +4450,6 @@ var getWiseRenderers = () => [
|
|
|
5656
4450
|
CheckboxInputRenderer_default,
|
|
5657
4451
|
CircularButtonRenderer,
|
|
5658
4452
|
BoxRenderer_default,
|
|
5659
|
-
CollectionRenderer_default,
|
|
5660
4453
|
ButtonRenderer,
|
|
5661
4454
|
ColumnsRenderer_default,
|
|
5662
4455
|
DateInputRenderer_default,
|
|
@@ -5701,11 +4494,11 @@ var getWiseRenderers = () => [
|
|
|
5701
4494
|
|
|
5702
4495
|
// ../renderers/src/InitialLoadingStateRenderer.tsx
|
|
5703
4496
|
import { Loader as Loader2 } from "@transferwise/components";
|
|
5704
|
-
import { jsx as
|
|
4497
|
+
import { jsx as jsx91 } from "react/jsx-runtime";
|
|
5705
4498
|
var InitialLoadingStateRenderer = {
|
|
5706
4499
|
canRenderType: "loading-state",
|
|
5707
4500
|
canRender: ({ stepLoadingState }) => stepLoadingState === "initial",
|
|
5708
|
-
render: () => /* @__PURE__ */
|
|
4501
|
+
render: () => /* @__PURE__ */ jsx91(
|
|
5709
4502
|
Loader2,
|
|
5710
4503
|
{
|
|
5711
4504
|
size: "md",
|
|
@@ -5718,24 +4511,24 @@ var InitialLoadingStateRenderer = {
|
|
|
5718
4511
|
// src/dynamicFlow/DynamicFlowModal.tsx
|
|
5719
4512
|
import { useDynamicFlowModal } from "@wise/dynamic-flow-client";
|
|
5720
4513
|
import { Modal as Modal5 } from "@transferwise/components";
|
|
5721
|
-
import { jsx as
|
|
4514
|
+
import { jsx as jsx92 } from "react/jsx-runtime";
|
|
5722
4515
|
function DynamicFlowModal(props) {
|
|
5723
4516
|
const _a = props, { className = "" } = _a, rest = __objRest(_a, ["className"]);
|
|
5724
4517
|
const dfProps = useWiseToCoreProps(rest);
|
|
5725
4518
|
const df = useDynamicFlowModal(dfProps);
|
|
5726
|
-
return /* @__PURE__ */
|
|
4519
|
+
return /* @__PURE__ */ jsx92(
|
|
5727
4520
|
Modal5,
|
|
5728
4521
|
__spreadProps(__spreadValues({
|
|
5729
4522
|
className: `dynamic-flow-modal ${className}`,
|
|
5730
4523
|
disableDimmerClickToClose: true
|
|
5731
4524
|
}, df.modal), {
|
|
5732
|
-
body: /* @__PURE__ */
|
|
4525
|
+
body: /* @__PURE__ */ jsx92("div", { className: "dynamic-flow-modal", children: df.modal.body })
|
|
5733
4526
|
})
|
|
5734
4527
|
);
|
|
5735
4528
|
}
|
|
5736
4529
|
|
|
5737
4530
|
// src/dynamicFlow/getMergedRenderers.tsx
|
|
5738
|
-
import { jsx as
|
|
4531
|
+
import { jsx as jsx93 } from "react/jsx-runtime";
|
|
5739
4532
|
var wiseRenderers = getWiseRenderers();
|
|
5740
4533
|
var getMergedRenderers = (props) => {
|
|
5741
4534
|
var _d, _e;
|
|
@@ -5749,7 +4542,7 @@ var getMergedRenderers = (props) => {
|
|
|
5749
4542
|
method: initialRequest.method,
|
|
5750
4543
|
data: initialRequest.body
|
|
5751
4544
|
};
|
|
5752
|
-
return presentation.type === "push" ? /* @__PURE__ */
|
|
4545
|
+
return presentation.type === "push" ? /* @__PURE__ */ jsx93(DynamicFlow, __spreadProps(__spreadValues(__spreadValues({}, restProps), rest), { features: subflowFeatures, initialAction: action })) : /* @__PURE__ */ jsx93(
|
|
5753
4546
|
DynamicFlowModal,
|
|
5754
4547
|
__spreadProps(__spreadValues(__spreadValues({}, restProps), rest), {
|
|
5755
4548
|
features: subflowFeatures,
|
|
@@ -5829,7 +4622,7 @@ var customEventsToAnalytics = {
|
|
|
5829
4622
|
|
|
5830
4623
|
// src/dynamicFlow/useOnCopy.tsx
|
|
5831
4624
|
import { useCallback as useCallback2 } from "react";
|
|
5832
|
-
import { useIntl as
|
|
4625
|
+
import { useIntl as useIntl17 } from "react-intl";
|
|
5833
4626
|
|
|
5834
4627
|
// src/dynamicFlow/messages.ts
|
|
5835
4628
|
import { defineMessages as defineMessages13 } from "react-intl";
|
|
@@ -5848,7 +4641,7 @@ var messages_default = defineMessages13({
|
|
|
5848
4641
|
|
|
5849
4642
|
// src/dynamicFlow/useOnCopy.tsx
|
|
5850
4643
|
var useOnCopy = () => {
|
|
5851
|
-
const { formatMessage } =
|
|
4644
|
+
const { formatMessage } = useIntl17();
|
|
5852
4645
|
const createSnackBar = useSnackBarIfAvailable();
|
|
5853
4646
|
return useCallback2(
|
|
5854
4647
|
(copiedContent) => {
|
|
@@ -5864,9 +4657,9 @@ var useOnCopy = () => {
|
|
|
5864
4657
|
|
|
5865
4658
|
// src/dynamicFlow/useWiseHttpClient.tsx
|
|
5866
4659
|
import { useCallback as useCallback3 } from "react";
|
|
5867
|
-
import { useIntl as
|
|
4660
|
+
import { useIntl as useIntl18 } from "react-intl";
|
|
5868
4661
|
var useWiseHttpClient = (httpClient) => {
|
|
5869
|
-
const { locale } =
|
|
4662
|
+
const { locale } = useIntl18();
|
|
5870
4663
|
return useCallback3(
|
|
5871
4664
|
async (input, init = {}) => {
|
|
5872
4665
|
const headers = new Headers(init.headers);
|
|
@@ -5908,10 +4701,10 @@ var useWiseToCoreProps = (props) => {
|
|
|
5908
4701
|
onLog
|
|
5909
4702
|
} = props;
|
|
5910
4703
|
const httpClient = useWiseHttpClient(customFetch);
|
|
5911
|
-
const mergedRenderers =
|
|
4704
|
+
const mergedRenderers = useMemo2(() => getMergedRenderers(props), [renderers]);
|
|
5912
4705
|
const createSnackBar = useCreateSnackBar();
|
|
5913
|
-
const logEvent =
|
|
5914
|
-
const trackEvent =
|
|
4706
|
+
const logEvent = useMemo2(() => getLogEvent(onLog), [onLog]);
|
|
4707
|
+
const trackEvent = useMemo2(() => getTrackEvent(onEvent, onAnalytics), [onEvent, onAnalytics]);
|
|
5915
4708
|
const onCopy = useOnCopy();
|
|
5916
4709
|
return __spreadProps(__spreadValues({}, props), {
|
|
5917
4710
|
httpClient,
|
|
@@ -5943,13 +4736,13 @@ var openLinkInNewTab = (url) => {
|
|
|
5943
4736
|
};
|
|
5944
4737
|
|
|
5945
4738
|
// src/dynamicFlow/DynamicFlow.tsx
|
|
5946
|
-
import { jsxs as
|
|
4739
|
+
import { jsxs as jsxs37 } from "react/jsx-runtime";
|
|
5947
4740
|
function DynamicFlow(props) {
|
|
5948
4741
|
const { className = "" } = props;
|
|
5949
4742
|
const dfProps = useWiseToCoreProps(props);
|
|
5950
4743
|
const df = useDynamicFlow(dfProps);
|
|
5951
4744
|
const { onContextMenu, contextMenu } = useDFContextMenu(df.controller);
|
|
5952
|
-
return /* @__PURE__ */
|
|
4745
|
+
return /* @__PURE__ */ jsxs37("div", { className, onContextMenu, children: [
|
|
5953
4746
|
df.view,
|
|
5954
4747
|
contextMenu
|
|
5955
4748
|
] });
|
|
@@ -5961,7 +4754,7 @@ import {
|
|
|
5961
4754
|
useImperativeHandle
|
|
5962
4755
|
} from "react";
|
|
5963
4756
|
import { useDynamicFlow as useDynamicFlow2 } from "@wise/dynamic-flow-client";
|
|
5964
|
-
import { jsx as
|
|
4757
|
+
import { jsx as jsx94 } from "react/jsx-runtime";
|
|
5965
4758
|
var DynamicFlowWithRef = forwardRef(function DynamicFlowWithRef2(props, ref) {
|
|
5966
4759
|
const { className = "" } = props;
|
|
5967
4760
|
const dfProps = useWiseToCoreProps(props);
|
|
@@ -5969,22 +4762,22 @@ var DynamicFlowWithRef = forwardRef(function DynamicFlowWithRef2(props, ref) {
|
|
|
5969
4762
|
useImperativeHandle(
|
|
5970
4763
|
ref,
|
|
5971
4764
|
() => ({
|
|
5972
|
-
getValue:
|
|
4765
|
+
getValue: () => {
|
|
5973
4766
|
var _a;
|
|
5974
|
-
return (_a =
|
|
4767
|
+
return (_a = df.controller.getValue()) != null ? _a : null;
|
|
5975
4768
|
},
|
|
5976
4769
|
validate: () => df.controller.validate()
|
|
5977
4770
|
}),
|
|
5978
4771
|
[df]
|
|
5979
4772
|
);
|
|
5980
|
-
return /* @__PURE__ */
|
|
4773
|
+
return /* @__PURE__ */ jsx94("div", { className, children: df.view });
|
|
5981
4774
|
});
|
|
5982
4775
|
|
|
5983
4776
|
// src/index.ts
|
|
5984
4777
|
import { findRendererPropsByType } from "@wise/dynamic-flow-client";
|
|
5985
4778
|
|
|
5986
4779
|
// src/dynamicFlow/renderers.tsx
|
|
5987
|
-
var Header10 =
|
|
4780
|
+
var Header10 = Header5;
|
|
5988
4781
|
var Media2 = Media;
|
|
5989
4782
|
var getMargin2 = getMargin;
|
|
5990
4783
|
|