@wise/dynamic-flow-client 3.14.1 → 3.15.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/main.js +998 -926
- package/build/main.min.js +1 -1
- package/build/main.mjs +364 -292
- package/build/types/revamp/domain/components/DecisionComponent.d.ts +2 -1
- package/build/types/revamp/domain/mappers/layout/decisionLayoutToComponent.d.ts +1 -1
- package/build/types/revamp/renderers/mappers/decisionComponentToProps.d.ts +1 -1
- package/package.json +2 -2
package/build/main.js
CHANGED
|
@@ -35,6 +35,9 @@ var __objRest = (source, exclude) => {
|
|
|
35
35
|
}
|
|
36
36
|
return target;
|
|
37
37
|
};
|
|
38
|
+
var __esm = (fn, res) => function __init() {
|
|
39
|
+
return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
|
|
40
|
+
};
|
|
38
41
|
var __commonJS = (cb, mod) => function __require() {
|
|
39
42
|
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
40
43
|
};
|
|
@@ -121,6 +124,158 @@ var require_classnames = __commonJS({
|
|
|
121
124
|
}
|
|
122
125
|
});
|
|
123
126
|
|
|
127
|
+
// ../../node_modules/.pnpm/clsx@2.1.1/node_modules/clsx/dist/clsx.mjs
|
|
128
|
+
function r(e) {
|
|
129
|
+
var t, f, n = "";
|
|
130
|
+
if ("string" == typeof e || "number" == typeof e)
|
|
131
|
+
n += e;
|
|
132
|
+
else if ("object" == typeof e)
|
|
133
|
+
if (Array.isArray(e)) {
|
|
134
|
+
var o = e.length;
|
|
135
|
+
for (t = 0; t < o; t++)
|
|
136
|
+
e[t] && (f = r(e[t])) && (n && (n += " "), n += f);
|
|
137
|
+
} else
|
|
138
|
+
for (f in e)
|
|
139
|
+
e[f] && (n && (n += " "), n += f);
|
|
140
|
+
return n;
|
|
141
|
+
}
|
|
142
|
+
function clsx() {
|
|
143
|
+
for (var e, t, f = 0, n = "", o = arguments.length; f < o; f++)
|
|
144
|
+
(e = arguments[f]) && (t = r(e)) && (n && (n += " "), n += t);
|
|
145
|
+
return n;
|
|
146
|
+
}
|
|
147
|
+
var init_clsx = __esm({
|
|
148
|
+
"../../node_modules/.pnpm/clsx@2.1.1/node_modules/clsx/dist/clsx.mjs"() {
|
|
149
|
+
"use strict";
|
|
150
|
+
}
|
|
151
|
+
});
|
|
152
|
+
|
|
153
|
+
// ../../node_modules/.pnpm/@wise+art@2.14.0_@transferwise+neptune-css@14.12.1_@types+react@18.3.3_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@wise/art/dist/index-93a0c34e.esm.js
|
|
154
|
+
var import_react7, import_jsx_runtime17, unknownFlagName, Flag, Sizes, ImageSizes, imageSizes, Assets, RenderMode;
|
|
155
|
+
var init_index_93a0c34e_esm = __esm({
|
|
156
|
+
"../../node_modules/.pnpm/@wise+art@2.14.0_@transferwise+neptune-css@14.12.1_@types+react@18.3.3_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@wise/art/dist/index-93a0c34e.esm.js"() {
|
|
157
|
+
"use strict";
|
|
158
|
+
init_clsx();
|
|
159
|
+
import_react7 = require("react");
|
|
160
|
+
import_jsx_runtime17 = require("react/jsx-runtime");
|
|
161
|
+
unknownFlagName = "wise";
|
|
162
|
+
Flag = ({
|
|
163
|
+
code,
|
|
164
|
+
intrinsicSize = 64,
|
|
165
|
+
className = void 0
|
|
166
|
+
}) => {
|
|
167
|
+
const [fallback, setFallback] = (0, import_react7.useState)(null);
|
|
168
|
+
(0, import_react7.useEffect)(() => {
|
|
169
|
+
setFallback(null);
|
|
170
|
+
}, [code]);
|
|
171
|
+
const detailed = intrinsicSize >= 150;
|
|
172
|
+
const name = fallback !== "unknown" ? `${code.toLowerCase()}${fallback == null && detailed ? "-detailed" : ""}` : unknownFlagName;
|
|
173
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("img", {
|
|
174
|
+
className: clsx(`wds-flag wds-flag-${name}`, className),
|
|
175
|
+
src: `https://wise.com/web-art/assets/flags/${name}.svg`,
|
|
176
|
+
alt: "",
|
|
177
|
+
width: intrinsicSize,
|
|
178
|
+
height: intrinsicSize,
|
|
179
|
+
onError: () => {
|
|
180
|
+
setFallback((prev) => prev == null && detailed ? "simple" : "unknown");
|
|
181
|
+
}
|
|
182
|
+
});
|
|
183
|
+
};
|
|
184
|
+
(function(Sizes2) {
|
|
185
|
+
Sizes2["SMALL"] = "small";
|
|
186
|
+
Sizes2["MEDIUM"] = "medium";
|
|
187
|
+
Sizes2["LARGE"] = "large";
|
|
188
|
+
})(Sizes || (Sizes = {}));
|
|
189
|
+
ImageSizes = {
|
|
190
|
+
[Sizes.SMALL]: 200,
|
|
191
|
+
[Sizes.MEDIUM]: 300,
|
|
192
|
+
[Sizes.LARGE]: 500
|
|
193
|
+
};
|
|
194
|
+
imageSizes = {
|
|
195
|
+
[Sizes.SMALL]: 200,
|
|
196
|
+
[Sizes.MEDIUM]: 300,
|
|
197
|
+
[Sizes.LARGE]: 500
|
|
198
|
+
};
|
|
199
|
+
(function(Assets2) {
|
|
200
|
+
Assets2["BELL"] = "bell";
|
|
201
|
+
Assets2["BRIEFCASE"] = "briefcase";
|
|
202
|
+
Assets2["BUSINESS_CARD"] = "business-card";
|
|
203
|
+
Assets2["CALENDAR"] = "calendar";
|
|
204
|
+
Assets2["CHECK_MARK"] = "check-mark";
|
|
205
|
+
Assets2["CLOSED_WINDOW"] = "closed-window";
|
|
206
|
+
Assets2["COIN_PILE_DOWN"] = "coin-pile-down";
|
|
207
|
+
Assets2["COIN_PILE_UP"] = "coin-pile-up";
|
|
208
|
+
Assets2["CONFETTI"] = "confetti";
|
|
209
|
+
Assets2["CONSTRUCTION_FENCE"] = "construction-fence";
|
|
210
|
+
Assets2["CONVERT"] = "convert";
|
|
211
|
+
Assets2["COOKIE"] = "cookie";
|
|
212
|
+
Assets2["DIGITAL_CARD_2"] = "digital-card-2";
|
|
213
|
+
Assets2["DIGITAL_CARD"] = "digital-card";
|
|
214
|
+
Assets2["DOCUMENTS"] = "documents";
|
|
215
|
+
Assets2["DOOR"] = "door";
|
|
216
|
+
Assets2["ECO_CARD"] = "eco-card";
|
|
217
|
+
Assets2["ELECTRIC_PLUG"] = "electric-plug";
|
|
218
|
+
Assets2["EMAIL_SUCCESS"] = "email-success";
|
|
219
|
+
Assets2["EMAIL"] = "email";
|
|
220
|
+
Assets2["EXCLAMATION_MARK"] = "exclamation-mark";
|
|
221
|
+
Assets2["FLAG"] = "flag";
|
|
222
|
+
Assets2["FLOWER"] = "flower";
|
|
223
|
+
Assets2["GEAR"] = "gear";
|
|
224
|
+
Assets2["GLOBE"] = "globe";
|
|
225
|
+
Assets2["GRAPH"] = "graph";
|
|
226
|
+
Assets2["HEART_2"] = "heart-2";
|
|
227
|
+
Assets2["HEART_3"] = "heart-3";
|
|
228
|
+
Assets2["HEART_4"] = "heart-4";
|
|
229
|
+
Assets2["HEART_5"] = "heart-5";
|
|
230
|
+
Assets2["HEART"] = "heart";
|
|
231
|
+
Assets2["HOUSE"] = "house";
|
|
232
|
+
Assets2["ID_CARD"] = "id-card";
|
|
233
|
+
Assets2["INFINITE"] = "infinite";
|
|
234
|
+
Assets2["INTEREST"] = "interest";
|
|
235
|
+
Assets2["INVITE_LETTER"] = "invite-letter";
|
|
236
|
+
Assets2["JARS"] = "jars";
|
|
237
|
+
Assets2["KEY"] = "key";
|
|
238
|
+
Assets2["LIGHT_BULB"] = "light-bulb";
|
|
239
|
+
Assets2["LOCK_PLATFORM"] = "lock-platform";
|
|
240
|
+
Assets2["LOCK"] = "lock";
|
|
241
|
+
Assets2["MAGNIFYING_GLASS"] = "magnifying-glass";
|
|
242
|
+
Assets2["MAP"] = "map";
|
|
243
|
+
Assets2["MARBLE_CARD_BUSINESS"] = "marble-card-business";
|
|
244
|
+
Assets2["MARBLE_CARD"] = "marble-card";
|
|
245
|
+
Assets2["MARBLE"] = "marble";
|
|
246
|
+
Assets2["MEGAPHONE"] = "megaphone";
|
|
247
|
+
Assets2["MULTI_CURRENCY"] = "multi-currency";
|
|
248
|
+
Assets2["ONE_INVITE_LETTER_OPENED"] = "one-invite-letter-opened";
|
|
249
|
+
Assets2["PALM_TREE"] = "palm-tree";
|
|
250
|
+
Assets2["PERCENTAGE"] = "percentage";
|
|
251
|
+
Assets2["PERSONAL_CARD"] = "personal-card";
|
|
252
|
+
Assets2["PHONES"] = "phones";
|
|
253
|
+
Assets2["PIE_CHART"] = "pie-chart";
|
|
254
|
+
Assets2["PLANE_2"] = "plane-2";
|
|
255
|
+
Assets2["PLANE"] = "plane";
|
|
256
|
+
Assets2["PUZZLE_PIECES"] = "puzzle-pieces";
|
|
257
|
+
Assets2["QUESTION_MARK"] = "question-mark";
|
|
258
|
+
Assets2["RECEIVE"] = "receive";
|
|
259
|
+
Assets2["REMINDER_LETTER"] = "reminder-letter";
|
|
260
|
+
Assets2["SAND_TIMER"] = "sand-timer";
|
|
261
|
+
Assets2["SATELLITE_PLATFORM"] = "satellite-platform";
|
|
262
|
+
Assets2["SHOPPING_BAG"] = "shopping-bag";
|
|
263
|
+
Assets2["SKIP_AUTHENTICATION"] = "skip-authentication";
|
|
264
|
+
Assets2["SPEECH_BUBBLE"] = "speech-bubble";
|
|
265
|
+
Assets2["STOPWATCH_PLATFORM"] = "stopwatch-platform";
|
|
266
|
+
Assets2["TARGET_PLATFORM"] = "target-platform";
|
|
267
|
+
Assets2["TOOL"] = "tool";
|
|
268
|
+
Assets2["TWO_INVITE_LETTERS_OPENED"] = "two-invite-letters-opened";
|
|
269
|
+
Assets2["WALLET"] = "wallet";
|
|
270
|
+
})(Assets || (Assets = {}));
|
|
271
|
+
(function(RenderMode2) {
|
|
272
|
+
RenderMode2[RenderMode2["INIT"] = 0] = "INIT";
|
|
273
|
+
RenderMode2[RenderMode2["FALLBACK"] = 1] = "FALLBACK";
|
|
274
|
+
RenderMode2[RenderMode2["ASSET_3D"] = 2] = "ASSET_3D";
|
|
275
|
+
})(RenderMode || (RenderMode = {}));
|
|
276
|
+
}
|
|
277
|
+
});
|
|
278
|
+
|
|
124
279
|
// ../../node_modules/.pnpm/screenfull@5.2.0/node_modules/screenfull/dist/screenfull.js
|
|
125
280
|
var require_screenfull = __commonJS({
|
|
126
281
|
"../../node_modules/.pnpm/screenfull@5.2.0/node_modules/screenfull/dist/screenfull.js"(exports, module2) {
|
|
@@ -1397,9 +1552,11 @@ var dateInputComponentToProps = (component) => __spreadProps(__spreadValues({},
|
|
|
1397
1552
|
|
|
1398
1553
|
// src/revamp/renderers/mappers/decisionComponentToProps.ts
|
|
1399
1554
|
var decisionComponentToProps = ({
|
|
1555
|
+
control,
|
|
1400
1556
|
options,
|
|
1401
|
-
margin
|
|
1402
|
-
|
|
1557
|
+
margin,
|
|
1558
|
+
title
|
|
1559
|
+
}) => ({ type: "decision", control, options, margin, title });
|
|
1403
1560
|
|
|
1404
1561
|
// src/revamp/renderers/mappers/dividerComponentToProps.ts
|
|
1405
1562
|
var dividerComponentToProps = ({
|
|
@@ -6931,7 +7088,7 @@ var createDecisionComponent = (decisionProps) => __spreadProps(__spreadValues({
|
|
|
6931
7088
|
});
|
|
6932
7089
|
|
|
6933
7090
|
// src/revamp/domain/mappers/layout/decisionLayoutToComponent.ts
|
|
6934
|
-
var decisionLayoutToComponent = (uid, { control, margin = "md", options }, { onAction, step }) => createDecisionComponent({
|
|
7091
|
+
var decisionLayoutToComponent = (uid, { control, margin = "md", options, title }, { onAction, step }) => createDecisionComponent({
|
|
6935
7092
|
uid,
|
|
6936
7093
|
control,
|
|
6937
7094
|
margin,
|
|
@@ -6943,7 +7100,8 @@ var decisionLayoutToComponent = (uid, { control, margin = "md", options }, { onA
|
|
|
6943
7100
|
void onAction(action);
|
|
6944
7101
|
}
|
|
6945
7102
|
});
|
|
6946
|
-
})
|
|
7103
|
+
}),
|
|
7104
|
+
title
|
|
6947
7105
|
});
|
|
6948
7106
|
|
|
6949
7107
|
// src/revamp/domain/components/DividerComponent.ts
|
|
@@ -10665,6 +10823,7 @@ function useDynamicFlowCore(props) {
|
|
|
10665
10823
|
// src/revamp/DynamicFlowCore.tsx
|
|
10666
10824
|
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
10667
10825
|
function DynamicFlowCore(props) {
|
|
10826
|
+
var _a, _b;
|
|
10668
10827
|
const { stepComponentRef } = useDynamicFlowCore(props);
|
|
10669
10828
|
const { renderers, onEvent, onError } = props;
|
|
10670
10829
|
const render = (0, import_react4.useMemo)(
|
|
@@ -10678,13 +10837,20 @@ function DynamicFlowCore(props) {
|
|
|
10678
10837
|
onEvent == null ? void 0 : onEvent("Dynamic Flow - Failed", { error });
|
|
10679
10838
|
onError == null ? void 0 : onError(error);
|
|
10680
10839
|
},
|
|
10681
|
-
children:
|
|
10840
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
10841
|
+
"div",
|
|
10842
|
+
{
|
|
10843
|
+
id: (_b = (_a = stepComponentRef.current) == null ? void 0 : _a.step) == null ? void 0 : _b.id,
|
|
10844
|
+
className: "dynamic-flow",
|
|
10845
|
+
children: stepComponentRef.current ? render(stepComponentRef.current) : null
|
|
10846
|
+
}
|
|
10847
|
+
)
|
|
10682
10848
|
}
|
|
10683
10849
|
);
|
|
10684
10850
|
}
|
|
10685
10851
|
|
|
10686
10852
|
// src/revamp/DynamicFlowWise.tsx
|
|
10687
|
-
var
|
|
10853
|
+
var import_react20 = require("react");
|
|
10688
10854
|
|
|
10689
10855
|
// ../renderers/src/contexts/RendererHttpClientContext.tsx
|
|
10690
10856
|
var import_react5 = require("react");
|
|
@@ -11047,124 +11213,26 @@ var DateInputRenderer_default = DateInputRenderer;
|
|
|
11047
11213
|
// ../renderers/src/DecisionRenderer.tsx
|
|
11048
11214
|
var import_components9 = require("@transferwise/components");
|
|
11049
11215
|
|
|
11050
|
-
// ../../node_modules/.pnpm/@wise+art@2.
|
|
11051
|
-
|
|
11052
|
-
|
|
11053
|
-
var
|
|
11054
|
-
var
|
|
11055
|
-
code,
|
|
11056
|
-
intrinsicSize = 64
|
|
11057
|
-
}) => {
|
|
11058
|
-
const [fallback, setFallback] = (0, import_react7.useState)(null);
|
|
11059
|
-
(0, import_react7.useEffect)(() => {
|
|
11060
|
-
setFallback(null);
|
|
11061
|
-
}, [code]);
|
|
11062
|
-
const detailed = intrinsicSize >= 150;
|
|
11063
|
-
const name = fallback !== "unknown" ? `${code.toLowerCase()}${fallback == null && detailed ? "-detailed" : ""}` : unknownFlagName;
|
|
11064
|
-
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("img", {
|
|
11065
|
-
src: `https://wise.com/web-art/assets/flags/${name}.svg`,
|
|
11066
|
-
alt: "",
|
|
11067
|
-
width: intrinsicSize,
|
|
11068
|
-
height: intrinsicSize,
|
|
11069
|
-
onError: () => {
|
|
11070
|
-
setFallback((prev) => prev == null && detailed ? "simple" : "unknown");
|
|
11071
|
-
}
|
|
11072
|
-
});
|
|
11073
|
-
};
|
|
11074
|
-
var Sizes;
|
|
11075
|
-
(function(Sizes2) {
|
|
11076
|
-
Sizes2["SMALL"] = "small";
|
|
11077
|
-
Sizes2["MEDIUM"] = "medium";
|
|
11078
|
-
Sizes2["LARGE"] = "large";
|
|
11079
|
-
})(Sizes || (Sizes = {}));
|
|
11080
|
-
var imageSizes = {
|
|
11081
|
-
[Sizes.SMALL]: 200,
|
|
11082
|
-
[Sizes.MEDIUM]: 300,
|
|
11083
|
-
[Sizes.LARGE]: 500
|
|
11084
|
-
};
|
|
11085
|
-
var Assets;
|
|
11086
|
-
(function(Assets2) {
|
|
11087
|
-
Assets2["BELL"] = "bell";
|
|
11088
|
-
Assets2["BRIEFCASE"] = "briefcase";
|
|
11089
|
-
Assets2["BUSINESS_CARD"] = "business-card";
|
|
11090
|
-
Assets2["CALENDAR"] = "calendar";
|
|
11091
|
-
Assets2["CHECK_MARK"] = "check-mark";
|
|
11092
|
-
Assets2["CLOSED_WINDOW"] = "closed-window";
|
|
11093
|
-
Assets2["COIN_PILE_DOWN"] = "coin-pile-down";
|
|
11094
|
-
Assets2["COIN_PILE_UP"] = "coin-pile-up";
|
|
11095
|
-
Assets2["CONFETTI"] = "confetti";
|
|
11096
|
-
Assets2["CONSTRUCTION_FENCE"] = "construction-fence";
|
|
11097
|
-
Assets2["CONVERT"] = "convert";
|
|
11098
|
-
Assets2["COOKIE"] = "cookie";
|
|
11099
|
-
Assets2["DIGITAL_CARD_2"] = "digital-card-2";
|
|
11100
|
-
Assets2["DIGITAL_CARD"] = "digital-card";
|
|
11101
|
-
Assets2["DOCUMENTS"] = "documents";
|
|
11102
|
-
Assets2["DOOR"] = "door";
|
|
11103
|
-
Assets2["ECO_CARD"] = "eco-card";
|
|
11104
|
-
Assets2["ELECTRIC_PLUG"] = "electric-plug";
|
|
11105
|
-
Assets2["EMAIL_SUCCESS"] = "email-success";
|
|
11106
|
-
Assets2["EMAIL"] = "email";
|
|
11107
|
-
Assets2["EXCLAMATION_MARK"] = "exclamation-mark";
|
|
11108
|
-
Assets2["FLAG"] = "flag";
|
|
11109
|
-
Assets2["FLOWER"] = "flower";
|
|
11110
|
-
Assets2["GEAR"] = "gear";
|
|
11111
|
-
Assets2["GLOBE"] = "globe";
|
|
11112
|
-
Assets2["GRAPH"] = "graph";
|
|
11113
|
-
Assets2["HEART_2"] = "heart-2";
|
|
11114
|
-
Assets2["HEART_3"] = "heart-3";
|
|
11115
|
-
Assets2["HEART_4"] = "heart-4";
|
|
11116
|
-
Assets2["HEART_5"] = "heart-5";
|
|
11117
|
-
Assets2["HEART"] = "heart";
|
|
11118
|
-
Assets2["HOUSE"] = "house";
|
|
11119
|
-
Assets2["ID_CARD"] = "id-card";
|
|
11120
|
-
Assets2["INFINITE"] = "infinite";
|
|
11121
|
-
Assets2["INVITE_LETTER"] = "invite-letter";
|
|
11122
|
-
Assets2["JARS"] = "jars";
|
|
11123
|
-
Assets2["KEY"] = "key";
|
|
11124
|
-
Assets2["LIGHT_BULB"] = "light-bulb";
|
|
11125
|
-
Assets2["LOCK"] = "lock";
|
|
11126
|
-
Assets2["MAGNIFYING_GLASS"] = "magnifying-glass";
|
|
11127
|
-
Assets2["MAP"] = "map";
|
|
11128
|
-
Assets2["MARBLE_CARD_BUSINESS"] = "marble-card-business";
|
|
11129
|
-
Assets2["MARBLE_CARD"] = "marble-card";
|
|
11130
|
-
Assets2["MARBLE"] = "marble";
|
|
11131
|
-
Assets2["MEGAPHONE"] = "megaphone";
|
|
11132
|
-
Assets2["MULTI_CURRENCY"] = "multi-currency";
|
|
11133
|
-
Assets2["ONE_INVITE_LETTER_OPENED"] = "one-invite-letter-opened";
|
|
11134
|
-
Assets2["PALM_TREE"] = "palm-tree";
|
|
11135
|
-
Assets2["PERCENTAGE"] = "percentage";
|
|
11136
|
-
Assets2["PERSONAL_CARD"] = "personal-card";
|
|
11137
|
-
Assets2["PHONES"] = "phones";
|
|
11138
|
-
Assets2["PIE_CHART"] = "pie-chart";
|
|
11139
|
-
Assets2["PLANE_2"] = "plane-2";
|
|
11140
|
-
Assets2["PLANE"] = "plane";
|
|
11141
|
-
Assets2["PUZZLE_PIECES"] = "puzzle-pieces";
|
|
11142
|
-
Assets2["QUESTION_MARK"] = "question-mark";
|
|
11143
|
-
Assets2["RECEIVE"] = "receive";
|
|
11144
|
-
Assets2["REMINDER_LETTER"] = "reminder-letter";
|
|
11145
|
-
Assets2["SAND_TIMER"] = "sand-timer";
|
|
11146
|
-
Assets2["SHOPPING_BAG"] = "shopping-bag";
|
|
11147
|
-
Assets2["SKIP_AUTHENTICATION"] = "skip-authentication";
|
|
11148
|
-
Assets2["SPEECH_BUBBLE"] = "speech-bubble";
|
|
11149
|
-
Assets2["TOOL"] = "tool";
|
|
11150
|
-
Assets2["TWO_INVITE_LETTERS_OPENED"] = "two-invite-letters-opened";
|
|
11151
|
-
Assets2["WALLET"] = "wallet";
|
|
11152
|
-
})(Assets || (Assets = {}));
|
|
11216
|
+
// ../../node_modules/.pnpm/@wise+art@2.14.0_@transferwise+neptune-css@14.12.1_@types+react@18.3.3_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@wise/art/dist/index.esm.js
|
|
11217
|
+
init_index_93a0c34e_esm();
|
|
11218
|
+
init_clsx();
|
|
11219
|
+
var import_react8 = require("react");
|
|
11220
|
+
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
11153
11221
|
|
|
11154
11222
|
// ../renderers/src/components/icon/FlagIcon.tsx
|
|
11155
|
-
var
|
|
11223
|
+
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
11156
11224
|
var isFlagIcon = (name) => name.startsWith("flag-");
|
|
11157
11225
|
function FlagIcon({ name }) {
|
|
11158
11226
|
if (!isFlagIcon(name)) {
|
|
11159
11227
|
return null;
|
|
11160
11228
|
}
|
|
11161
11229
|
const code = name.substring(5);
|
|
11162
|
-
return /* @__PURE__ */ (0,
|
|
11230
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Flag, { code });
|
|
11163
11231
|
}
|
|
11164
11232
|
|
|
11165
11233
|
// ../renderers/src/components/icon/NamedIcon.tsx
|
|
11166
11234
|
var icons = __toESM(require("@transferwise/icons"));
|
|
11167
|
-
var
|
|
11235
|
+
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
11168
11236
|
var isNamedIcon = (name) => {
|
|
11169
11237
|
const iconName = toCapitalisedCamelCase(name);
|
|
11170
11238
|
return Object.keys(icons).includes(iconName);
|
|
@@ -11175,19 +11243,19 @@ function NamedIcon({ name }) {
|
|
|
11175
11243
|
}
|
|
11176
11244
|
const iconName = toCapitalisedCamelCase(name);
|
|
11177
11245
|
const Icon = icons[iconName];
|
|
11178
|
-
return /* @__PURE__ */ (0,
|
|
11246
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Icon, { size: 24 });
|
|
11179
11247
|
}
|
|
11180
11248
|
var toCapitalisedCamelCase = (value) => value.split("-").map(capitaliseFirstChar).join("");
|
|
11181
11249
|
var capitaliseFirstChar = (value) => `${value[0].toUpperCase()}${value.slice(1)}`;
|
|
11182
11250
|
|
|
11183
11251
|
// ../renderers/src/components/icon/DynamicIcon.tsx
|
|
11184
|
-
var
|
|
11252
|
+
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
11185
11253
|
function DynamicIcon({ name }) {
|
|
11186
11254
|
if (isFlagIcon(name)) {
|
|
11187
|
-
return /* @__PURE__ */ (0,
|
|
11255
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(FlagIcon, { name });
|
|
11188
11256
|
}
|
|
11189
11257
|
if (isNamedIcon(name)) {
|
|
11190
|
-
return /* @__PURE__ */ (0,
|
|
11258
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(NamedIcon, { name });
|
|
11191
11259
|
}
|
|
11192
11260
|
return null;
|
|
11193
11261
|
}
|
|
@@ -11195,78 +11263,81 @@ var DynamicIcon_default = DynamicIcon;
|
|
|
11195
11263
|
|
|
11196
11264
|
// ../renderers/src/components/icon/NavigationOptionMedia.tsx
|
|
11197
11265
|
var import_components8 = require("@transferwise/components");
|
|
11198
|
-
var
|
|
11266
|
+
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
11199
11267
|
function NavigationOptionMedia({ icon, image }) {
|
|
11200
11268
|
if (!isNullish2(icon)) {
|
|
11201
11269
|
if ("name" in icon) {
|
|
11202
|
-
return /* @__PURE__ */ (0,
|
|
11270
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_components8.Avatar, { type: import_components8.AvatarType.ICON, children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(DynamicIcon_default, { name: icon.name }) });
|
|
11203
11271
|
}
|
|
11204
11272
|
if (icon.text) {
|
|
11205
|
-
return /* @__PURE__ */ (0,
|
|
11273
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_components8.Avatar, { type: import_components8.AvatarType.INITIALS, children: icon.text });
|
|
11206
11274
|
}
|
|
11207
11275
|
}
|
|
11208
11276
|
if (image == null ? void 0 : image.url) {
|
|
11209
11277
|
const { url, accessibilityDescription } = image;
|
|
11210
|
-
return /* @__PURE__ */ (0,
|
|
11278
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("img", { src: url, alt: accessibilityDescription });
|
|
11211
11279
|
}
|
|
11212
11280
|
return null;
|
|
11213
11281
|
}
|
|
11214
11282
|
|
|
11215
11283
|
// ../renderers/src/DecisionRenderer.tsx
|
|
11216
|
-
var
|
|
11284
|
+
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
11217
11285
|
var DecisionRenderer = {
|
|
11218
11286
|
canRenderType: "decision",
|
|
11219
11287
|
render: DecisionRendererComponent
|
|
11220
11288
|
};
|
|
11221
11289
|
var DecisionRenderer_default = DecisionRenderer;
|
|
11222
|
-
function DecisionRendererComponent({ margin, options }) {
|
|
11290
|
+
function DecisionRendererComponent({ margin, options, title }) {
|
|
11223
11291
|
const { isLoading } = useLoadingContext();
|
|
11224
|
-
return /* @__PURE__ */ (0,
|
|
11225
|
-
import_components9.
|
|
11226
|
-
{
|
|
11227
|
-
|
|
11228
|
-
|
|
11229
|
-
|
|
11230
|
-
|
|
11231
|
-
|
|
11232
|
-
|
|
11233
|
-
|
|
11234
|
-
|
|
11235
|
-
|
|
11236
|
-
|
|
11292
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: getMargin(margin), children: [
|
|
11293
|
+
title && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_components9.Header, { as: "h2", title }),
|
|
11294
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_components9.NavigationOptionsList, { children: options.map(({ description, disabled, icon, image, title: title2, onClick }) => /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
11295
|
+
import_components9.NavigationOption,
|
|
11296
|
+
{
|
|
11297
|
+
title: title2,
|
|
11298
|
+
content: description,
|
|
11299
|
+
disabled: isLoading || disabled,
|
|
11300
|
+
media: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(NavigationOptionMedia, { icon, image }),
|
|
11301
|
+
showMediaCircle: false,
|
|
11302
|
+
showMediaAtAllSizes: true,
|
|
11303
|
+
onClick
|
|
11304
|
+
},
|
|
11305
|
+
JSON.stringify(title2)
|
|
11306
|
+
)) })
|
|
11307
|
+
] });
|
|
11237
11308
|
}
|
|
11238
11309
|
|
|
11239
11310
|
// ../renderers/src/DividerRenderer.tsx
|
|
11240
|
-
var
|
|
11311
|
+
var import_jsx_runtime24 = require("react/jsx-runtime");
|
|
11241
11312
|
var DividerRenderer = {
|
|
11242
11313
|
canRenderType: "divider",
|
|
11243
|
-
render: ({ margin }) => /* @__PURE__ */ (0,
|
|
11314
|
+
render: ({ margin }) => /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("hr", { className: `m-t-0 ${getMargin(margin)}` })
|
|
11244
11315
|
};
|
|
11245
11316
|
var DividerRenderer_default = DividerRenderer;
|
|
11246
11317
|
|
|
11247
11318
|
// ../renderers/src/FormRenderer.tsx
|
|
11248
|
-
var
|
|
11319
|
+
var import_jsx_runtime25 = require("react/jsx-runtime");
|
|
11249
11320
|
var FormRenderer = {
|
|
11250
11321
|
canRenderType: "form",
|
|
11251
|
-
render: ({ children, margin }) => /* @__PURE__ */ (0,
|
|
11322
|
+
render: ({ children, margin }) => /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: getMargin(margin), children })
|
|
11252
11323
|
};
|
|
11253
11324
|
var FormRenderer_default = FormRenderer;
|
|
11254
11325
|
|
|
11255
11326
|
// ../renderers/src/FormSectionRenderer.tsx
|
|
11256
11327
|
var import_components10 = require("@transferwise/components");
|
|
11257
|
-
var
|
|
11328
|
+
var import_jsx_runtime26 = require("react/jsx-runtime");
|
|
11258
11329
|
var FormSectionRenderer = {
|
|
11259
11330
|
canRenderType: "form-section",
|
|
11260
|
-
render: ({ title, description, children }) => /* @__PURE__ */ (0,
|
|
11331
|
+
render: ({ title, description, children }) => /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("fieldset", { children: [
|
|
11261
11332
|
title && // TODO - once section headers support help, we could show help in here
|
|
11262
|
-
/* @__PURE__ */ (0,
|
|
11333
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
11263
11334
|
import_components10.Header,
|
|
11264
11335
|
{
|
|
11265
11336
|
as: "h2",
|
|
11266
11337
|
title
|
|
11267
11338
|
}
|
|
11268
11339
|
),
|
|
11269
|
-
description && /* @__PURE__ */ (0,
|
|
11340
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("p", { children: description }),
|
|
11270
11341
|
children
|
|
11271
11342
|
] })
|
|
11272
11343
|
};
|
|
@@ -11274,32 +11345,32 @@ var FormSectionRenderer_default = FormSectionRenderer;
|
|
|
11274
11345
|
|
|
11275
11346
|
// ../renderers/src/HeadingRenderer.tsx
|
|
11276
11347
|
var import_components11 = require("@transferwise/components");
|
|
11277
|
-
var
|
|
11348
|
+
var import_jsx_runtime27 = require("react/jsx-runtime");
|
|
11278
11349
|
var HeadingRenderer = {
|
|
11279
11350
|
canRenderType: "heading",
|
|
11280
|
-
render: (props) => /* @__PURE__ */ (0,
|
|
11351
|
+
render: (props) => /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Heading, __spreadValues({}, props))
|
|
11281
11352
|
};
|
|
11282
11353
|
function Heading(props) {
|
|
11283
11354
|
const { text, size, align, margin, control } = props;
|
|
11284
11355
|
const className = getTextAlignmentAndMargin({ align, margin });
|
|
11285
|
-
return control === "display" ? /* @__PURE__ */ (0,
|
|
11356
|
+
return control === "display" ? /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(DisplayHeading, { size, text, className }) : /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(StandardHeading, { size, text, className });
|
|
11286
11357
|
}
|
|
11287
11358
|
function DisplayHeading({ size, text, className }) {
|
|
11288
|
-
return /* @__PURE__ */ (0,
|
|
11359
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_components11.Display, { type: getDisplayType(size), className, children: text });
|
|
11289
11360
|
}
|
|
11290
11361
|
function StandardHeading({ size, text, className }) {
|
|
11291
11362
|
switch (size) {
|
|
11292
11363
|
case "xs":
|
|
11293
|
-
return /* @__PURE__ */ (0,
|
|
11364
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("h5", { className, children: text });
|
|
11294
11365
|
case "sm":
|
|
11295
|
-
return /* @__PURE__ */ (0,
|
|
11366
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("h4", { className, children: text });
|
|
11296
11367
|
case "lg":
|
|
11297
|
-
return /* @__PURE__ */ (0,
|
|
11368
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("h2", { className, children: text });
|
|
11298
11369
|
case "xl":
|
|
11299
|
-
return /* @__PURE__ */ (0,
|
|
11370
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("h1", { className, children: text });
|
|
11300
11371
|
case "md":
|
|
11301
11372
|
default:
|
|
11302
|
-
return /* @__PURE__ */ (0,
|
|
11373
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("h3", { className, children: text });
|
|
11303
11374
|
}
|
|
11304
11375
|
}
|
|
11305
11376
|
var getDisplayType = (size) => {
|
|
@@ -11319,7 +11390,7 @@ var HeadingRenderer_default = HeadingRenderer;
|
|
|
11319
11390
|
|
|
11320
11391
|
// ../renderers/src/ImageRenderer.tsx
|
|
11321
11392
|
var import_components12 = require("@transferwise/components");
|
|
11322
|
-
var
|
|
11393
|
+
var import_react9 = require("react");
|
|
11323
11394
|
|
|
11324
11395
|
// ../renderers/src/utils/api-utils.ts
|
|
11325
11396
|
function isRelativePath2(url = "") {
|
|
@@ -11329,10 +11400,10 @@ function isRelativePath2(url = "") {
|
|
|
11329
11400
|
}
|
|
11330
11401
|
|
|
11331
11402
|
// ../renderers/src/ImageRenderer.tsx
|
|
11332
|
-
var
|
|
11403
|
+
var import_jsx_runtime28 = require("react/jsx-runtime");
|
|
11333
11404
|
var ImageRenderer = {
|
|
11334
11405
|
canRenderType: "image",
|
|
11335
|
-
render: (props) => /* @__PURE__ */ (0,
|
|
11406
|
+
render: (props) => /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(ImageRendererComponent, __spreadValues({}, props))
|
|
11336
11407
|
};
|
|
11337
11408
|
var ImageRenderer_default = ImageRenderer;
|
|
11338
11409
|
function ImageRendererComponent({
|
|
@@ -11341,12 +11412,12 @@ function ImageRendererComponent({
|
|
|
11341
11412
|
size,
|
|
11342
11413
|
url
|
|
11343
11414
|
}) {
|
|
11344
|
-
const [imageSource, setImageSource] = (0,
|
|
11415
|
+
const [imageSource, setImageSource] = (0, import_react9.useState)("");
|
|
11345
11416
|
const httpClient = useRendererHttpClient();
|
|
11346
|
-
(0,
|
|
11417
|
+
(0, import_react9.useEffect)(() => {
|
|
11347
11418
|
void getImageSource(httpClient, url).then(setImageSource);
|
|
11348
11419
|
}, [url, httpClient]);
|
|
11349
|
-
return /* @__PURE__ */ (0,
|
|
11420
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: `df-image ${size || "md"}`, children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
11350
11421
|
import_components12.Image,
|
|
11351
11422
|
{
|
|
11352
11423
|
className: `img-responsive ${getMargin(margin)}`,
|
|
@@ -11391,7 +11462,7 @@ var getImageSource = async (httpClient, imageUrl) => {
|
|
|
11391
11462
|
|
|
11392
11463
|
// ../renderers/src/InstructionsRenderer.tsx
|
|
11393
11464
|
var import_components13 = require("@transferwise/components");
|
|
11394
|
-
var
|
|
11465
|
+
var import_jsx_runtime29 = require("react/jsx-runtime");
|
|
11395
11466
|
var doContext = ["positive", "neutral"];
|
|
11396
11467
|
var dontContext = ["warning", "negative"];
|
|
11397
11468
|
var InstructionsRenderer = {
|
|
@@ -11399,9 +11470,9 @@ var InstructionsRenderer = {
|
|
|
11399
11470
|
render: ({ items, margin, title }) => {
|
|
11400
11471
|
const dos = items.filter((item) => doContext.includes(item.context)).map(({ text }) => text);
|
|
11401
11472
|
const donts = items.filter((item) => dontContext.includes(item.context)).map(({ text }) => text);
|
|
11402
|
-
return /* @__PURE__ */ (0,
|
|
11403
|
-
title ? /* @__PURE__ */ (0,
|
|
11404
|
-
/* @__PURE__ */ (0,
|
|
11473
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: getMargin(margin), children: [
|
|
11474
|
+
title ? /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_components13.Header, { title }) : null,
|
|
11475
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_components13.InstructionsList, { dos, donts })
|
|
11405
11476
|
] });
|
|
11406
11477
|
}
|
|
11407
11478
|
};
|
|
@@ -11418,12 +11489,12 @@ var onWheel = (event) => {
|
|
|
11418
11489
|
};
|
|
11419
11490
|
|
|
11420
11491
|
// ../renderers/src/IntegerInputRenderer.tsx
|
|
11421
|
-
var
|
|
11492
|
+
var import_jsx_runtime30 = require("react/jsx-runtime");
|
|
11422
11493
|
var IntegerInputRenderer = {
|
|
11423
11494
|
canRenderType: "input-integer",
|
|
11424
11495
|
render: (props) => {
|
|
11425
11496
|
const _a = props, { id, label, error, description, help, type, value, onChange } = _a, rest = __objRest(_a, ["id", "label", "error", "description", "help", "type", "value", "onChange"]);
|
|
11426
|
-
return /* @__PURE__ */ (0,
|
|
11497
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(FieldInput_default, { id, label, description, error, help, children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
11427
11498
|
import_components14.Input,
|
|
11428
11499
|
__spreadValues({
|
|
11429
11500
|
id,
|
|
@@ -11445,10 +11516,10 @@ var IntegerInputRenderer_default = IntegerInputRenderer;
|
|
|
11445
11516
|
|
|
11446
11517
|
// ../renderers/src/LoadingIndicatorRenderer.tsx
|
|
11447
11518
|
var import_components15 = require("@transferwise/components");
|
|
11448
|
-
var
|
|
11519
|
+
var import_jsx_runtime31 = require("react/jsx-runtime");
|
|
11449
11520
|
var LoadingIndicatorRenderer = {
|
|
11450
11521
|
canRenderType: "loading-indicator",
|
|
11451
|
-
render: ({ margin, size }) => /* @__PURE__ */ (0,
|
|
11522
|
+
render: ({ margin, size }) => /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
11452
11523
|
import_components15.Loader,
|
|
11453
11524
|
{
|
|
11454
11525
|
size,
|
|
@@ -11461,27 +11532,27 @@ var LoadingIndicatorRenderer_default = LoadingIndicatorRenderer;
|
|
|
11461
11532
|
|
|
11462
11533
|
// ../renderers/src/MarkdownRenderer.tsx
|
|
11463
11534
|
var import_components16 = require("@transferwise/components");
|
|
11464
|
-
var
|
|
11535
|
+
var import_jsx_runtime32 = require("react/jsx-runtime");
|
|
11465
11536
|
var MarkdownRenderer = {
|
|
11466
11537
|
canRenderType: "markdown",
|
|
11467
|
-
render: ({ content, align, margin }) => /* @__PURE__ */ (0,
|
|
11538
|
+
render: ({ content, align, margin }) => /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { className: getTextAlignmentAndMargin({ align, margin }), children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_components16.Markdown, { config: { link: { target: "_blank" } }, children: content }) })
|
|
11468
11539
|
};
|
|
11469
11540
|
var MarkdownRenderer_default = MarkdownRenderer;
|
|
11470
11541
|
|
|
11471
11542
|
// ../renderers/src/ModalRenderer.tsx
|
|
11472
11543
|
var import_components17 = require("@transferwise/components");
|
|
11473
|
-
var
|
|
11474
|
-
var
|
|
11544
|
+
var import_react10 = require("react");
|
|
11545
|
+
var import_jsx_runtime33 = require("react/jsx-runtime");
|
|
11475
11546
|
var ModalRenderer = {
|
|
11476
11547
|
canRenderType: "modal",
|
|
11477
|
-
render: (props) => /* @__PURE__ */ (0,
|
|
11548
|
+
render: (props) => /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(DFModal, __spreadValues({}, props))
|
|
11478
11549
|
};
|
|
11479
11550
|
var ModalRenderer_default = ModalRenderer;
|
|
11480
11551
|
function DFModal({ content, margin, trigger }) {
|
|
11481
|
-
const [visible, setVisible] = (0,
|
|
11482
|
-
return /* @__PURE__ */ (0,
|
|
11483
|
-
/* @__PURE__ */ (0,
|
|
11484
|
-
/* @__PURE__ */ (0,
|
|
11552
|
+
const [visible, setVisible] = (0, import_react10.useState)(false);
|
|
11553
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: getMargin(margin), children: [
|
|
11554
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_components17.Button, { priority: "tertiary", block: true, onClick: () => setVisible(true), children: trigger.title }),
|
|
11555
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
11485
11556
|
import_components17.Modal,
|
|
11486
11557
|
{
|
|
11487
11558
|
scroll: "content",
|
|
@@ -11499,16 +11570,16 @@ var import_components19 = require("@transferwise/components");
|
|
|
11499
11570
|
|
|
11500
11571
|
// ../renderers/src/SelectInputRenderer/OptionMedia.tsx
|
|
11501
11572
|
var import_components18 = require("@transferwise/components");
|
|
11502
|
-
var
|
|
11573
|
+
var import_jsx_runtime34 = require("react/jsx-runtime");
|
|
11503
11574
|
function OptionMedia({ icon, image }) {
|
|
11504
11575
|
if (image == null ? void 0 : image.url) {
|
|
11505
|
-
return /* @__PURE__ */ (0,
|
|
11576
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("img", { src: image.url, alt: image.accessibilityDescription || "", width: "64px" });
|
|
11506
11577
|
}
|
|
11507
11578
|
if (icon && "name" in icon) {
|
|
11508
|
-
return /* @__PURE__ */ (0,
|
|
11579
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_components18.Avatar, { type: import_components18.AvatarType.ICON, children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(DynamicIcon_default, { name: icon.name }) });
|
|
11509
11580
|
}
|
|
11510
11581
|
if (icon && "text" in icon) {
|
|
11511
|
-
return /* @__PURE__ */ (0,
|
|
11582
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_components18.Avatar, { type: import_components18.AvatarType.INITIALS, children: icon.text });
|
|
11512
11583
|
}
|
|
11513
11584
|
return null;
|
|
11514
11585
|
}
|
|
@@ -11527,15 +11598,15 @@ var multi_select_messages_default = (0, import_react_intl9.defineMessages)({
|
|
|
11527
11598
|
});
|
|
11528
11599
|
|
|
11529
11600
|
// ../renderers/src/MultiSelectInputRenderer.tsx
|
|
11530
|
-
var
|
|
11531
|
-
var
|
|
11601
|
+
var import_react11 = require("react");
|
|
11602
|
+
var import_jsx_runtime35 = require("react/jsx-runtime");
|
|
11532
11603
|
var MultiSelectInputRenderer = {
|
|
11533
11604
|
canRenderType: "input-multi-select",
|
|
11534
|
-
render: (props) => /* @__PURE__ */ (0,
|
|
11605
|
+
render: (props) => /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(MultiSelectInputRendererComponent, __spreadValues({}, props))
|
|
11535
11606
|
};
|
|
11536
11607
|
function MultiSelectInputRendererComponent(props) {
|
|
11537
11608
|
const { formatMessage } = (0, import_react_intl10.useIntl)();
|
|
11538
|
-
const [stagedIndices, setStagedIndices] = (0,
|
|
11609
|
+
const [stagedIndices, setStagedIndices] = (0, import_react11.useState)();
|
|
11539
11610
|
const {
|
|
11540
11611
|
id,
|
|
11541
11612
|
description,
|
|
@@ -11572,11 +11643,11 @@ function MultiSelectInputRendererComponent(props) {
|
|
|
11572
11643
|
const contentProps = {
|
|
11573
11644
|
title: option.title,
|
|
11574
11645
|
description: option.description,
|
|
11575
|
-
icon: /* @__PURE__ */ (0,
|
|
11646
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(OptionMedia, { icon: option.icon, image: option.image })
|
|
11576
11647
|
};
|
|
11577
|
-
return /* @__PURE__ */ (0,
|
|
11648
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_components19.SelectInputOptionContent, __spreadValues({}, contentProps));
|
|
11578
11649
|
};
|
|
11579
|
-
return /* @__PURE__ */ (0,
|
|
11650
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(FieldInput_default, { id, label, help, description, error, children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
11580
11651
|
import_components19.SelectInput,
|
|
11581
11652
|
{
|
|
11582
11653
|
id,
|
|
@@ -11618,7 +11689,7 @@ var import_components21 = require("@transferwise/components");
|
|
|
11618
11689
|
// ../renderers/src/components/UploadFieldInput.tsx
|
|
11619
11690
|
var import_components20 = require("@transferwise/components");
|
|
11620
11691
|
var import_classnames3 = __toESM(require_classnames());
|
|
11621
|
-
var
|
|
11692
|
+
var import_jsx_runtime36 = require("react/jsx-runtime");
|
|
11622
11693
|
function UploadFieldInput({
|
|
11623
11694
|
id,
|
|
11624
11695
|
children,
|
|
@@ -11627,18 +11698,18 @@ function UploadFieldInput({
|
|
|
11627
11698
|
error,
|
|
11628
11699
|
help
|
|
11629
11700
|
}) {
|
|
11630
|
-
const labelContent = label && help ? /* @__PURE__ */ (0,
|
|
11701
|
+
const labelContent = label && help ? /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(LabelContentWithHelp, { text: label, help }) : label;
|
|
11631
11702
|
const descriptionId = description ? `${id}-description` : void 0;
|
|
11632
|
-
return /* @__PURE__ */ (0,
|
|
11703
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(
|
|
11633
11704
|
"div",
|
|
11634
11705
|
{
|
|
11635
11706
|
className: (0, import_classnames3.default)("form-group d-block", {
|
|
11636
11707
|
"has-error": !!error
|
|
11637
11708
|
}),
|
|
11638
11709
|
children: [
|
|
11639
|
-
/* @__PURE__ */ (0,
|
|
11710
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("label", { htmlFor: id, className: "control-label", children: labelContent }),
|
|
11640
11711
|
children,
|
|
11641
|
-
error && /* @__PURE__ */ (0,
|
|
11712
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_components20.InlineAlert, { type: "negative", id: descriptionId, children: error })
|
|
11642
11713
|
]
|
|
11643
11714
|
}
|
|
11644
11715
|
);
|
|
@@ -11670,7 +11741,7 @@ var getFileType = (base64Url) => {
|
|
|
11670
11741
|
var getRandomId = () => Math.random().toString(36).substring(2);
|
|
11671
11742
|
|
|
11672
11743
|
// ../renderers/src/MultiUploadInputRenderer.tsx
|
|
11673
|
-
var
|
|
11744
|
+
var import_jsx_runtime37 = require("react/jsx-runtime");
|
|
11674
11745
|
var MultiUploadInputRenderer = {
|
|
11675
11746
|
canRenderType: "input-upload-multi",
|
|
11676
11747
|
render: (props) => {
|
|
@@ -11697,7 +11768,7 @@ var MultiUploadInputRenderer = {
|
|
|
11697
11768
|
};
|
|
11698
11769
|
const onDeleteFile = async (fileId) => onDelete(String(fileId));
|
|
11699
11770
|
const descriptionId = description ? `${id}-description` : void 0;
|
|
11700
|
-
return /* @__PURE__ */ (0,
|
|
11771
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(UploadFieldInput_default, { id, label, description, error, help, children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
11701
11772
|
import_components21.UploadInput,
|
|
11702
11773
|
{
|
|
11703
11774
|
id,
|
|
@@ -11720,12 +11791,12 @@ var MultiUploadInputRenderer_default = MultiUploadInputRenderer;
|
|
|
11720
11791
|
|
|
11721
11792
|
// ../renderers/src/NumberInputRenderer.tsx
|
|
11722
11793
|
var import_components22 = require("@transferwise/components");
|
|
11723
|
-
var
|
|
11794
|
+
var import_jsx_runtime38 = require("react/jsx-runtime");
|
|
11724
11795
|
var NumberInputRenderer = {
|
|
11725
11796
|
canRenderType: "input-number",
|
|
11726
11797
|
render: (props) => {
|
|
11727
11798
|
const _a = props, { id, label, error, description, help, type, value, onChange } = _a, rest = __objRest(_a, ["id", "label", "error", "description", "help", "type", "value", "onChange"]);
|
|
11728
|
-
return /* @__PURE__ */ (0,
|
|
11799
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(FieldInput_default, { id, label, description, error, help, children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
11729
11800
|
import_components22.Input,
|
|
11730
11801
|
__spreadValues({
|
|
11731
11802
|
id,
|
|
@@ -11748,9 +11819,9 @@ var import_react_intl12 = require("react-intl");
|
|
|
11748
11819
|
|
|
11749
11820
|
// ../renderers/src/hooks/useSnackBarIfAvailable.ts
|
|
11750
11821
|
var import_components23 = require("@transferwise/components");
|
|
11751
|
-
var
|
|
11822
|
+
var import_react12 = require("react");
|
|
11752
11823
|
function useSnackBarIfAvailable() {
|
|
11753
|
-
const context = (0,
|
|
11824
|
+
const context = (0, import_react12.useContext)(import_components23.SnackbarContext);
|
|
11754
11825
|
return context ? context.createSnackbar : () => {
|
|
11755
11826
|
};
|
|
11756
11827
|
}
|
|
@@ -11775,17 +11846,17 @@ var paragraph_messages_default = (0, import_react_intl11.defineMessages)({
|
|
|
11775
11846
|
});
|
|
11776
11847
|
|
|
11777
11848
|
// ../renderers/src/ParagraphRenderer.tsx
|
|
11778
|
-
var
|
|
11849
|
+
var import_jsx_runtime39 = require("react/jsx-runtime");
|
|
11779
11850
|
var ParagraphRenderer = {
|
|
11780
11851
|
canRenderType: "paragraph",
|
|
11781
|
-
render: (props) => /* @__PURE__ */ (0,
|
|
11852
|
+
render: (props) => /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(Paragraph, __spreadValues({}, props))
|
|
11782
11853
|
};
|
|
11783
11854
|
function Paragraph({ align, control, margin, text }) {
|
|
11784
11855
|
const className = getTextAlignmentAndMargin({ align, margin });
|
|
11785
|
-
return control === "copyable" ? /* @__PURE__ */ (0,
|
|
11856
|
+
return control === "copyable" ? /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(CopyableParagraph, { className, align, text }) : /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(StandardParagraph, { className, text });
|
|
11786
11857
|
}
|
|
11787
11858
|
function StandardParagraph({ text, className }) {
|
|
11788
|
-
return /* @__PURE__ */ (0,
|
|
11859
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("p", { className, children: text });
|
|
11789
11860
|
}
|
|
11790
11861
|
function CopyableParagraph({
|
|
11791
11862
|
text,
|
|
@@ -11799,8 +11870,8 @@ function CopyableParagraph({
|
|
|
11799
11870
|
});
|
|
11800
11871
|
};
|
|
11801
11872
|
const inputAlignmentClasses = getTextAlignmentAndMargin({ align, margin: "sm" });
|
|
11802
|
-
return /* @__PURE__ */ (0,
|
|
11803
|
-
/* @__PURE__ */ (0,
|
|
11873
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("div", { className, children: [
|
|
11874
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
11804
11875
|
import_components24.Input,
|
|
11805
11876
|
{
|
|
11806
11877
|
type: "text",
|
|
@@ -11809,14 +11880,14 @@ function CopyableParagraph({
|
|
|
11809
11880
|
className: (0, import_classnames4.default)("text-ellipsis", inputAlignmentClasses)
|
|
11810
11881
|
}
|
|
11811
11882
|
),
|
|
11812
|
-
/* @__PURE__ */ (0,
|
|
11883
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_components24.Button, { block: true, onClick: copy, children: formatMessage(paragraph_messages_default.copy) })
|
|
11813
11884
|
] });
|
|
11814
11885
|
}
|
|
11815
11886
|
var ParagraphRenderer_default = ParagraphRenderer;
|
|
11816
11887
|
|
|
11817
11888
|
// ../renderers/src/RepeatableRenderer.tsx
|
|
11818
11889
|
var import_components25 = require("@transferwise/components");
|
|
11819
|
-
var
|
|
11890
|
+
var import_react13 = require("react");
|
|
11820
11891
|
var import_icons = require("@transferwise/icons");
|
|
11821
11892
|
var import_react_intl14 = require("react-intl");
|
|
11822
11893
|
|
|
@@ -11847,10 +11918,10 @@ var repeatable_messages_default = (0, import_react_intl13.defineMessages)({
|
|
|
11847
11918
|
|
|
11848
11919
|
// ../renderers/src/RepeatableRenderer.tsx
|
|
11849
11920
|
var import_classnames5 = __toESM(require_classnames());
|
|
11850
|
-
var
|
|
11921
|
+
var import_jsx_runtime40 = require("react/jsx-runtime");
|
|
11851
11922
|
var RepeatableRenderer = {
|
|
11852
11923
|
canRenderType: "repeatable",
|
|
11853
|
-
render: (props) => /* @__PURE__ */ (0,
|
|
11924
|
+
render: (props) => /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(Repeatable, __spreadValues({}, props))
|
|
11854
11925
|
};
|
|
11855
11926
|
function Repeatable(props) {
|
|
11856
11927
|
const {
|
|
@@ -11867,7 +11938,7 @@ function Repeatable(props) {
|
|
|
11867
11938
|
onRemove
|
|
11868
11939
|
} = props;
|
|
11869
11940
|
const { formatMessage } = (0, import_react_intl14.useIntl)();
|
|
11870
|
-
const [openModalType, setOpenModalType] = (0,
|
|
11941
|
+
const [openModalType, setOpenModalType] = (0, import_react13.useState)(null);
|
|
11871
11942
|
const onAddItem = () => {
|
|
11872
11943
|
onAdd();
|
|
11873
11944
|
setOpenModalType("add");
|
|
@@ -11889,40 +11960,40 @@ function Repeatable(props) {
|
|
|
11889
11960
|
const onCancelEdit = () => {
|
|
11890
11961
|
setOpenModalType(null);
|
|
11891
11962
|
};
|
|
11892
|
-
return /* @__PURE__ */ (0,
|
|
11893
|
-
title && /* @__PURE__ */ (0,
|
|
11894
|
-
description && /* @__PURE__ */ (0,
|
|
11895
|
-
/* @__PURE__ */ (0,
|
|
11963
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(import_jsx_runtime40.Fragment, { children: [
|
|
11964
|
+
title && /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_components25.Header, { title }),
|
|
11965
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("p", { children: description }),
|
|
11966
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(
|
|
11896
11967
|
"div",
|
|
11897
11968
|
{
|
|
11898
11969
|
className: (0, import_classnames5.default)("form-group", {
|
|
11899
11970
|
"has-error": error
|
|
11900
11971
|
}),
|
|
11901
11972
|
children: [
|
|
11902
|
-
items == null ? void 0 : items.map((item, index) => /* @__PURE__ */ (0,
|
|
11903
|
-
/* @__PURE__ */ (0,
|
|
11973
|
+
items == null ? void 0 : items.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(ItemSummaryOption, { item, onClick: () => onEditItem(index) }, item.id)),
|
|
11974
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
11904
11975
|
import_components25.NavigationOption,
|
|
11905
11976
|
{
|
|
11906
|
-
media: /* @__PURE__ */ (0,
|
|
11977
|
+
media: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_icons.Plus, {}),
|
|
11907
11978
|
title: addItemTitle || formatMessage(repeatable_messages_default.addItemTitle),
|
|
11908
11979
|
showMediaAtAllSizes: true,
|
|
11909
11980
|
onClick: () => onAddItem()
|
|
11910
11981
|
}
|
|
11911
11982
|
),
|
|
11912
|
-
error && /* @__PURE__ */ (0,
|
|
11983
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_components25.InlineAlert, { type: "negative", children: error })
|
|
11913
11984
|
]
|
|
11914
11985
|
}
|
|
11915
11986
|
),
|
|
11916
|
-
/* @__PURE__ */ (0,
|
|
11987
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
11917
11988
|
import_components25.Modal,
|
|
11918
11989
|
{
|
|
11919
11990
|
open: openModalType !== null,
|
|
11920
11991
|
title: (openModalType === "add" ? addItemTitle : editItemTitle) || formatMessage(repeatable_messages_default.addItemTitle),
|
|
11921
|
-
body: /* @__PURE__ */ (0,
|
|
11922
|
-
/* @__PURE__ */ (0,
|
|
11923
|
-
/* @__PURE__ */ (0,
|
|
11924
|
-
/* @__PURE__ */ (0,
|
|
11925
|
-
/* @__PURE__ */ (0,
|
|
11992
|
+
body: /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(import_jsx_runtime40.Fragment, { children: [
|
|
11993
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: "m-b-2", children: editableItem }),
|
|
11994
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { children: [
|
|
11995
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_components25.Button, { priority: "primary", block: true, className: "m-b-2", onClick: () => onSaveItem(), children: formatMessage(repeatable_messages_default.addItem) }),
|
|
11996
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_components25.Button, { priority: "secondary", type: "negative", block: true, onClick: () => onRemoveItem(), children: formatMessage(repeatable_messages_default.removeItem) })
|
|
11926
11997
|
] })
|
|
11927
11998
|
] }),
|
|
11928
11999
|
onClose: () => onCancelEdit()
|
|
@@ -11934,10 +12005,10 @@ function ItemSummaryOption({
|
|
|
11934
12005
|
item,
|
|
11935
12006
|
onClick
|
|
11936
12007
|
}) {
|
|
11937
|
-
return /* @__PURE__ */ (0,
|
|
12008
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
11938
12009
|
import_components25.NavigationOption,
|
|
11939
12010
|
{
|
|
11940
|
-
media: /* @__PURE__ */ (0,
|
|
12011
|
+
media: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(NavigationOptionMedia, __spreadValues({}, item)),
|
|
11941
12012
|
title: item.title,
|
|
11942
12013
|
content: item.description,
|
|
11943
12014
|
showMediaAtAllSizes: true,
|
|
@@ -11974,13 +12045,13 @@ var generic_error_messages_default2 = (0, import_react_intl15.defineMessages)({
|
|
|
11974
12045
|
});
|
|
11975
12046
|
|
|
11976
12047
|
// ../renderers/src/SearchRenderer/ErrorResult.tsx
|
|
11977
|
-
var
|
|
12048
|
+
var import_jsx_runtime41 = require("react/jsx-runtime");
|
|
11978
12049
|
function ErrorResult({ state }) {
|
|
11979
12050
|
const intl = (0, import_react_intl16.useIntl)();
|
|
11980
|
-
return /* @__PURE__ */ (0,
|
|
12051
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("p", { className: "m-t-2", children: [
|
|
11981
12052
|
intl.formatMessage(generic_error_messages_default2.genericError),
|
|
11982
12053
|
"\xA0",
|
|
11983
|
-
/* @__PURE__ */ (0,
|
|
12054
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
11984
12055
|
"a",
|
|
11985
12056
|
{
|
|
11986
12057
|
href: "/",
|
|
@@ -11995,8 +12066,8 @@ function ErrorResult({ state }) {
|
|
|
11995
12066
|
}
|
|
11996
12067
|
|
|
11997
12068
|
// ../renderers/src/SearchRenderer/BlockSearchRendererComponent.tsx
|
|
11998
|
-
var
|
|
11999
|
-
var
|
|
12069
|
+
var import_react14 = require("react");
|
|
12070
|
+
var import_jsx_runtime42 = require("react/jsx-runtime");
|
|
12000
12071
|
function BlockSearchRendererComponent({
|
|
12001
12072
|
id,
|
|
12002
12073
|
isLoading,
|
|
@@ -12006,10 +12077,10 @@ function BlockSearchRendererComponent({
|
|
|
12006
12077
|
state,
|
|
12007
12078
|
title
|
|
12008
12079
|
}) {
|
|
12009
|
-
const [hasSearched, setHasSearched] = (0,
|
|
12080
|
+
const [hasSearched, setHasSearched] = (0, import_react14.useState)(false);
|
|
12010
12081
|
const trackEvent = useTrackEvent();
|
|
12011
|
-
return /* @__PURE__ */ (0,
|
|
12012
|
-
/* @__PURE__ */ (0,
|
|
12082
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { className: getMargin(margin), children: [
|
|
12083
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(FieldInput_default, { id, description: "", error: "", help: "", label: title, children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
12013
12084
|
import_components26.Input,
|
|
12014
12085
|
{
|
|
12015
12086
|
id,
|
|
@@ -12026,7 +12097,7 @@ function BlockSearchRendererComponent({
|
|
|
12026
12097
|
}
|
|
12027
12098
|
}
|
|
12028
12099
|
) }),
|
|
12029
|
-
isLoading ? /* @__PURE__ */ (0,
|
|
12100
|
+
isLoading ? /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_jsx_runtime42.Fragment, { children: "Loading..." }) : /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(SearchResultContent, { state, onChange })
|
|
12030
12101
|
] });
|
|
12031
12102
|
}
|
|
12032
12103
|
function SearchResultContent({
|
|
@@ -12035,29 +12106,29 @@ function SearchResultContent({
|
|
|
12035
12106
|
}) {
|
|
12036
12107
|
switch (state.type) {
|
|
12037
12108
|
case "error":
|
|
12038
|
-
return /* @__PURE__ */ (0,
|
|
12109
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(ErrorResult, { state });
|
|
12039
12110
|
case "results":
|
|
12040
|
-
return /* @__PURE__ */ (0,
|
|
12111
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(SearchResults, { state, onChange });
|
|
12041
12112
|
case "noResults":
|
|
12042
|
-
return /* @__PURE__ */ (0,
|
|
12113
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(EmptySearchResult, { state });
|
|
12043
12114
|
case "pending":
|
|
12044
12115
|
default:
|
|
12045
12116
|
return null;
|
|
12046
12117
|
}
|
|
12047
12118
|
}
|
|
12048
12119
|
function EmptySearchResult({ state }) {
|
|
12049
|
-
return /* @__PURE__ */ (0,
|
|
12120
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_components26.Markdown, { className: "m-t-2", config: { link: { target: "_blank" } }, children: state.message });
|
|
12050
12121
|
}
|
|
12051
12122
|
function SearchResults({
|
|
12052
12123
|
state
|
|
12053
12124
|
}) {
|
|
12054
12125
|
const trackEvent = useTrackEvent();
|
|
12055
|
-
return /* @__PURE__ */ (0,
|
|
12126
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_components26.NavigationOptionsList, { children: state.results.map((result) => /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
12056
12127
|
import_components26.NavigationOption,
|
|
12057
12128
|
{
|
|
12058
12129
|
title: result.title,
|
|
12059
12130
|
content: result.description,
|
|
12060
|
-
media: /* @__PURE__ */ (0,
|
|
12131
|
+
media: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(NavigationOptionMedia, __spreadValues({}, result)),
|
|
12061
12132
|
showMediaCircle: false,
|
|
12062
12133
|
showMediaAtAllSizes: true,
|
|
12063
12134
|
onClick: () => {
|
|
@@ -12075,8 +12146,8 @@ var BlockSearchRendererComponent_default = BlockSearchRendererComponent;
|
|
|
12075
12146
|
// ../renderers/src/SearchRenderer/InlineSearchRendererComponent.tsx
|
|
12076
12147
|
var import_components27 = require("@transferwise/components");
|
|
12077
12148
|
var import_icons2 = require("@transferwise/icons");
|
|
12078
|
-
var
|
|
12079
|
-
var
|
|
12149
|
+
var import_react15 = require("react");
|
|
12150
|
+
var import_jsx_runtime43 = require("react/jsx-runtime");
|
|
12080
12151
|
function InlineSearchRenderer({
|
|
12081
12152
|
id,
|
|
12082
12153
|
isLoading,
|
|
@@ -12085,45 +12156,42 @@ function InlineSearchRenderer({
|
|
|
12085
12156
|
state,
|
|
12086
12157
|
title
|
|
12087
12158
|
}) {
|
|
12088
|
-
const [hasSearched, setHasSearched] = (0,
|
|
12159
|
+
const [hasSearched, setHasSearched] = (0, import_react15.useState)(false);
|
|
12089
12160
|
const trackEvent = useTrackEvent();
|
|
12090
|
-
return /* @__PURE__ */ (0,
|
|
12091
|
-
|
|
12092
|
-
|
|
12093
|
-
|
|
12094
|
-
|
|
12095
|
-
|
|
12096
|
-
|
|
12097
|
-
|
|
12098
|
-
|
|
12099
|
-
|
|
12100
|
-
|
|
12101
|
-
|
|
12102
|
-
|
|
12103
|
-
|
|
12104
|
-
|
|
12105
|
-
|
|
12106
|
-
|
|
12107
|
-
|
|
12108
|
-
|
|
12109
|
-
|
|
12110
|
-
|
|
12111
|
-
|
|
12112
|
-
}, result.type === "action" ? { actionId: result.id } : {}));
|
|
12113
|
-
result.onClick();
|
|
12114
|
-
}
|
|
12115
|
-
}
|
|
12116
|
-
},
|
|
12117
|
-
onInputChange: (query) => {
|
|
12118
|
-
if (!hasSearched) {
|
|
12119
|
-
setHasSearched(true);
|
|
12120
|
-
trackEvent("Search Started");
|
|
12161
|
+
return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("div", { className: getMargin(margin), children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(FieldInput_default, { id, description: "", error: "", help: "", label: title, children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
12162
|
+
import_components27.Typeahead,
|
|
12163
|
+
{
|
|
12164
|
+
id: "typeahead-input-id",
|
|
12165
|
+
name: "typeahead-input-name",
|
|
12166
|
+
size: "md",
|
|
12167
|
+
maxHeight: 100,
|
|
12168
|
+
footer: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(TypeaheadFooter, { state, isLoading }),
|
|
12169
|
+
multiple: false,
|
|
12170
|
+
clearable: false,
|
|
12171
|
+
addon: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_icons2.Search, { size: 24 }),
|
|
12172
|
+
options: state.type === "results" ? state.results.map(mapResultToTypeaheadOption) : [],
|
|
12173
|
+
minQueryLength: 1,
|
|
12174
|
+
onChange: (values) => {
|
|
12175
|
+
if (values.length > 0) {
|
|
12176
|
+
const [updatedValue] = values;
|
|
12177
|
+
const { value: result } = updatedValue;
|
|
12178
|
+
if (result) {
|
|
12179
|
+
trackEvent("Search Result Selected", __spreadValues({
|
|
12180
|
+
type: result.type
|
|
12181
|
+
}, result.type === "action" ? { actionId: result.id } : {}));
|
|
12182
|
+
result.onClick();
|
|
12121
12183
|
}
|
|
12122
|
-
onChange(query);
|
|
12123
12184
|
}
|
|
12185
|
+
},
|
|
12186
|
+
onInputChange: (query) => {
|
|
12187
|
+
if (!hasSearched) {
|
|
12188
|
+
setHasSearched(true);
|
|
12189
|
+
trackEvent("Search Started");
|
|
12190
|
+
}
|
|
12191
|
+
onChange(query);
|
|
12124
12192
|
}
|
|
12125
|
-
|
|
12126
|
-
|
|
12193
|
+
}
|
|
12194
|
+
) }) });
|
|
12127
12195
|
}
|
|
12128
12196
|
function mapResultToTypeaheadOption(result) {
|
|
12129
12197
|
return {
|
|
@@ -12136,29 +12204,29 @@ function mapResultToTypeaheadOption(result) {
|
|
|
12136
12204
|
}
|
|
12137
12205
|
function TypeaheadFooter({ state, isLoading }) {
|
|
12138
12206
|
if (state.type === "noResults") {
|
|
12139
|
-
return /* @__PURE__ */ (0,
|
|
12207
|
+
return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_components27.Markdown, { className: "m-t-2 m-x-2", config: { link: { target: "_blank" } }, children: state.message });
|
|
12140
12208
|
}
|
|
12141
12209
|
if (state.type === "error") {
|
|
12142
|
-
return /* @__PURE__ */ (0,
|
|
12210
|
+
return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("div", { className: "m-t-2 m-x-2", children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(ErrorResult, { state }) });
|
|
12143
12211
|
}
|
|
12144
12212
|
if (state.type === "pending" || isLoading) {
|
|
12145
|
-
return /* @__PURE__ */ (0,
|
|
12213
|
+
return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("p", { className: "m-t-2 m-x-2", children: "Loading..." });
|
|
12146
12214
|
}
|
|
12147
12215
|
return null;
|
|
12148
12216
|
}
|
|
12149
12217
|
var InlineSearchRendererComponent_default = InlineSearchRenderer;
|
|
12150
12218
|
|
|
12151
12219
|
// ../renderers/src/SearchRenderer/SearchRenderer.tsx
|
|
12152
|
-
var
|
|
12220
|
+
var import_jsx_runtime44 = require("react/jsx-runtime");
|
|
12153
12221
|
var SearchRenderer = {
|
|
12154
12222
|
canRenderType: "search",
|
|
12155
|
-
render: (props) => props.control === "inline" ? /* @__PURE__ */ (0,
|
|
12223
|
+
render: (props) => props.control === "inline" ? /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(InlineSearchRendererComponent_default, __spreadValues({}, props)) : /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(BlockSearchRendererComponent_default, __spreadValues({}, props))
|
|
12156
12224
|
};
|
|
12157
12225
|
var SearchRenderer_default = SearchRenderer;
|
|
12158
12226
|
|
|
12159
12227
|
// ../renderers/src/SelectInputRenderer/RadioInputRendererComponent.tsx
|
|
12160
12228
|
var import_components28 = require("@transferwise/components");
|
|
12161
|
-
var
|
|
12229
|
+
var import_jsx_runtime45 = require("react/jsx-runtime");
|
|
12162
12230
|
function RadioInputRendererComponent(props) {
|
|
12163
12231
|
const {
|
|
12164
12232
|
id,
|
|
@@ -12172,8 +12240,8 @@ function RadioInputRendererComponent(props) {
|
|
|
12172
12240
|
selectedIndex,
|
|
12173
12241
|
onSelect
|
|
12174
12242
|
} = props;
|
|
12175
|
-
return /* @__PURE__ */ (0,
|
|
12176
|
-
/* @__PURE__ */ (0,
|
|
12243
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(import_jsx_runtime45.Fragment, { children: [
|
|
12244
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(FieldInput_default, { id, label, help, description, error, children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("span", { children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
12177
12245
|
import_components28.RadioGroup,
|
|
12178
12246
|
{
|
|
12179
12247
|
name: id,
|
|
@@ -12182,7 +12250,7 @@ function RadioInputRendererComponent(props) {
|
|
|
12182
12250
|
value: index,
|
|
12183
12251
|
secondary: option.description,
|
|
12184
12252
|
disabled: option.disabled || disabled,
|
|
12185
|
-
avatar: /* @__PURE__ */ (0,
|
|
12253
|
+
avatar: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(OptionMedia, { icon: option.icon, image: option.image })
|
|
12186
12254
|
})),
|
|
12187
12255
|
selectedValue: selectedIndex != null ? selectedIndex : void 0,
|
|
12188
12256
|
onChange: onSelect
|
|
@@ -12195,8 +12263,8 @@ function RadioInputRendererComponent(props) {
|
|
|
12195
12263
|
|
|
12196
12264
|
// ../renderers/src/SelectInputRenderer/TabInputRendererComponent.tsx
|
|
12197
12265
|
var import_components29 = require("@transferwise/components");
|
|
12198
|
-
var
|
|
12199
|
-
var
|
|
12266
|
+
var import_react16 = require("react");
|
|
12267
|
+
var import_jsx_runtime46 = require("react/jsx-runtime");
|
|
12200
12268
|
function TabInputRendererComponent(props) {
|
|
12201
12269
|
const {
|
|
12202
12270
|
id,
|
|
@@ -12210,13 +12278,13 @@ function TabInputRendererComponent(props) {
|
|
|
12210
12278
|
selectedIndex,
|
|
12211
12279
|
onSelect
|
|
12212
12280
|
} = props;
|
|
12213
|
-
(0,
|
|
12281
|
+
(0, import_react16.useEffect)(() => {
|
|
12214
12282
|
if (!isValidIndex(selectedIndex, options.length)) {
|
|
12215
12283
|
onSelect(0);
|
|
12216
12284
|
}
|
|
12217
12285
|
}, [selectedIndex, onSelect, options.length]);
|
|
12218
|
-
return /* @__PURE__ */ (0,
|
|
12219
|
-
/* @__PURE__ */ (0,
|
|
12286
|
+
return /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(import_jsx_runtime46.Fragment, { children: [
|
|
12287
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(FieldInput_default, { id, label, help, description, error, children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
12220
12288
|
import_components29.Tabs,
|
|
12221
12289
|
{
|
|
12222
12290
|
name: id,
|
|
@@ -12225,7 +12293,7 @@ function TabInputRendererComponent(props) {
|
|
|
12225
12293
|
title: option.title,
|
|
12226
12294
|
// if we pass null, we get some props-types console errors
|
|
12227
12295
|
// eslint-disable-next-line react/jsx-no-useless-fragment
|
|
12228
|
-
content: /* @__PURE__ */ (0,
|
|
12296
|
+
content: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_jsx_runtime46.Fragment, {}),
|
|
12229
12297
|
disabled: option.disabled || disabled
|
|
12230
12298
|
})),
|
|
12231
12299
|
onTabSelect: onSelect
|
|
@@ -12241,22 +12309,22 @@ var import_components31 = require("@transferwise/components");
|
|
|
12241
12309
|
|
|
12242
12310
|
// ../renderers/src/SelectInputRenderer/SelectTriggerMedia.tsx
|
|
12243
12311
|
var import_components30 = require("@transferwise/components");
|
|
12244
|
-
var
|
|
12312
|
+
var import_jsx_runtime47 = require("react/jsx-runtime");
|
|
12245
12313
|
function SelectTriggerMedia({ icon, image }) {
|
|
12246
12314
|
if (image == null ? void 0 : image.url) {
|
|
12247
12315
|
return null;
|
|
12248
12316
|
}
|
|
12249
12317
|
if (icon && "name" in icon) {
|
|
12250
|
-
return /* @__PURE__ */ (0,
|
|
12318
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_components30.Avatar, { type: import_components30.AvatarType.ICON, size: 24, children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(DynamicIcon_default, { name: icon.name }) });
|
|
12251
12319
|
}
|
|
12252
12320
|
if (icon && "text" in icon) {
|
|
12253
|
-
return /* @__PURE__ */ (0,
|
|
12321
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_components30.Avatar, { type: import_components30.AvatarType.ICON, size: 24, children: icon.text });
|
|
12254
12322
|
}
|
|
12255
12323
|
return null;
|
|
12256
12324
|
}
|
|
12257
12325
|
|
|
12258
12326
|
// ../renderers/src/SelectInputRenderer/SelectInputRendererComponent.tsx
|
|
12259
|
-
var
|
|
12327
|
+
var import_jsx_runtime48 = require("react/jsx-runtime");
|
|
12260
12328
|
function SelectInputRendererComponent(props) {
|
|
12261
12329
|
const {
|
|
12262
12330
|
id,
|
|
@@ -12291,16 +12359,16 @@ function SelectInputRendererComponent(props) {
|
|
|
12291
12359
|
const contentProps = withinTrigger ? {
|
|
12292
12360
|
title: option.title,
|
|
12293
12361
|
note: option.description,
|
|
12294
|
-
icon: /* @__PURE__ */ (0,
|
|
12362
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(SelectTriggerMedia, { icon: option.icon, image: option.image })
|
|
12295
12363
|
} : {
|
|
12296
12364
|
title: option.title,
|
|
12297
12365
|
description: option.description,
|
|
12298
|
-
icon: /* @__PURE__ */ (0,
|
|
12366
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(OptionMedia, { icon: option.icon, image: option.image })
|
|
12299
12367
|
};
|
|
12300
|
-
return /* @__PURE__ */ (0,
|
|
12368
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_components31.SelectInputOptionContent, __spreadValues({}, contentProps));
|
|
12301
12369
|
};
|
|
12302
|
-
return /* @__PURE__ */ (0,
|
|
12303
|
-
/* @__PURE__ */ (0,
|
|
12370
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(import_jsx_runtime48.Fragment, { children: [
|
|
12371
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(FieldInput_default, { id, label, help, description, error, children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
12304
12372
|
import_components31.SelectInput,
|
|
12305
12373
|
{
|
|
12306
12374
|
name: id,
|
|
@@ -12319,18 +12387,18 @@ function SelectInputRendererComponent(props) {
|
|
|
12319
12387
|
}
|
|
12320
12388
|
|
|
12321
12389
|
// ../renderers/src/SelectInputRenderer/SegmentedInputRendererComponent.tsx
|
|
12322
|
-
var
|
|
12390
|
+
var import_react17 = require("react");
|
|
12323
12391
|
var import_components32 = require("@transferwise/components");
|
|
12324
|
-
var
|
|
12392
|
+
var import_jsx_runtime49 = require("react/jsx-runtime");
|
|
12325
12393
|
function SegmentedInputRendererComponent(props) {
|
|
12326
12394
|
const { id, children, description, error, help, label, options, selectedIndex, onSelect } = props;
|
|
12327
|
-
(0,
|
|
12395
|
+
(0, import_react17.useEffect)(() => {
|
|
12328
12396
|
if (!isValidIndex2(selectedIndex, options.length)) {
|
|
12329
12397
|
onSelect(0);
|
|
12330
12398
|
}
|
|
12331
12399
|
}, [selectedIndex, onSelect, options.length]);
|
|
12332
|
-
return /* @__PURE__ */ (0,
|
|
12333
|
-
/* @__PURE__ */ (0,
|
|
12400
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(import_jsx_runtime49.Fragment, { children: [
|
|
12401
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(FieldInput_default, { id, label, help, description, error, children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
12334
12402
|
import_components32.SegmentedControl,
|
|
12335
12403
|
{
|
|
12336
12404
|
name: `${id}-segmented-control`,
|
|
@@ -12345,26 +12413,26 @@ function SegmentedInputRendererComponent(props) {
|
|
|
12345
12413
|
onChange: (value) => onSelect(Number(value))
|
|
12346
12414
|
}
|
|
12347
12415
|
) }),
|
|
12348
|
-
/* @__PURE__ */ (0,
|
|
12416
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)("div", { id: `${id}-children`, children })
|
|
12349
12417
|
] });
|
|
12350
12418
|
}
|
|
12351
12419
|
var isValidIndex2 = (index, options) => index !== null && index >= 0 && index < options;
|
|
12352
12420
|
|
|
12353
12421
|
// ../renderers/src/SelectInputRenderer/SelectInputRenderer.tsx
|
|
12354
|
-
var
|
|
12422
|
+
var import_jsx_runtime50 = require("react/jsx-runtime");
|
|
12355
12423
|
var SelectInputRenderer = {
|
|
12356
12424
|
canRenderType: "input-select",
|
|
12357
12425
|
render: (props) => {
|
|
12358
12426
|
switch (props.control) {
|
|
12359
12427
|
case "radio":
|
|
12360
|
-
return /* @__PURE__ */ (0,
|
|
12428
|
+
return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(RadioInputRendererComponent, __spreadValues({}, props));
|
|
12361
12429
|
case "tab":
|
|
12362
|
-
return props.options.length > 3 ? /* @__PURE__ */ (0,
|
|
12430
|
+
return props.options.length > 3 ? /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(SelectInputRendererComponent, __spreadValues({}, props)) : /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(TabInputRendererComponent, __spreadValues({}, props));
|
|
12363
12431
|
case "segmented":
|
|
12364
|
-
return props.options.length > 3 ? /* @__PURE__ */ (0,
|
|
12432
|
+
return props.options.length > 3 ? /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(SelectInputRendererComponent, __spreadValues({}, props)) : /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(SegmentedInputRendererComponent, __spreadValues({}, props));
|
|
12365
12433
|
case "select":
|
|
12366
12434
|
default:
|
|
12367
|
-
return /* @__PURE__ */ (0,
|
|
12435
|
+
return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(SelectInputRendererComponent, __spreadValues({}, props));
|
|
12368
12436
|
}
|
|
12369
12437
|
}
|
|
12370
12438
|
};
|
|
@@ -12372,17 +12440,17 @@ var SelectInputRenderer_default = SelectInputRenderer;
|
|
|
12372
12440
|
|
|
12373
12441
|
// ../renderers/src/StatusListRenderer.tsx
|
|
12374
12442
|
var import_components33 = require("@transferwise/components");
|
|
12375
|
-
var
|
|
12443
|
+
var import_jsx_runtime51 = require("react/jsx-runtime");
|
|
12376
12444
|
var StatusListRenderer = {
|
|
12377
12445
|
canRenderType: "status-list",
|
|
12378
|
-
render: ({ margin, items, title }) => /* @__PURE__ */ (0,
|
|
12379
|
-
title ? /* @__PURE__ */ (0,
|
|
12380
|
-
items.map(({ description, icon, status, title: itemTitle }) => /* @__PURE__ */ (0,
|
|
12446
|
+
render: ({ margin, items, title }) => /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("div", { className: getMargin(margin), children: [
|
|
12447
|
+
title ? /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_components33.Header, { title }) : null,
|
|
12448
|
+
items.map(({ description, icon, status, title: itemTitle }) => /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
12381
12449
|
import_components33.Summary,
|
|
12382
12450
|
{
|
|
12383
12451
|
title: itemTitle,
|
|
12384
12452
|
description,
|
|
12385
|
-
icon: icon && "name" in icon ? /* @__PURE__ */ (0,
|
|
12453
|
+
icon: icon && "name" in icon ? /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(DynamicIcon_default, { name: icon.name }) : null,
|
|
12386
12454
|
status: mapStatus(status)
|
|
12387
12455
|
},
|
|
12388
12456
|
`${title}/${description || ""}`
|
|
@@ -12399,31 +12467,31 @@ var mapStatus = (status) => {
|
|
|
12399
12467
|
|
|
12400
12468
|
// ../renderers/src/components/VariableTextInput.tsx
|
|
12401
12469
|
var import_components34 = require("@transferwise/components");
|
|
12402
|
-
var
|
|
12470
|
+
var import_jsx_runtime52 = require("react/jsx-runtime");
|
|
12403
12471
|
function VariableTextInput({
|
|
12404
12472
|
control,
|
|
12405
12473
|
inputProps
|
|
12406
12474
|
}) {
|
|
12407
12475
|
switch (control) {
|
|
12408
12476
|
case "password":
|
|
12409
|
-
return /* @__PURE__ */ (0,
|
|
12477
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(TextInput, __spreadValues({ type: "password" }, inputProps));
|
|
12410
12478
|
case "email":
|
|
12411
|
-
return /* @__PURE__ */ (0,
|
|
12479
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(TextInput, __spreadValues({ type: "email" }, inputProps));
|
|
12412
12480
|
case "textarea":
|
|
12413
|
-
return /* @__PURE__ */ (0,
|
|
12481
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(TextAreaInput, __spreadValues({}, inputProps));
|
|
12414
12482
|
case "numeric":
|
|
12415
|
-
return /* @__PURE__ */ (0,
|
|
12483
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(NumericInput, __spreadValues({ type: "number" }, inputProps));
|
|
12416
12484
|
case "phone-number":
|
|
12417
|
-
return /* @__PURE__ */ (0,
|
|
12485
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(PhoneNumberInput, __spreadValues({}, inputProps));
|
|
12418
12486
|
default:
|
|
12419
|
-
return /* @__PURE__ */ (0,
|
|
12487
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(TextInput, __spreadValues({ type: "text" }, inputProps));
|
|
12420
12488
|
}
|
|
12421
12489
|
}
|
|
12422
12490
|
function TextInput(_a) {
|
|
12423
12491
|
var _b = _a, { id, displayFormat, onChange } = _b, rest = __objRest(_b, ["id", "displayFormat", "onChange"]);
|
|
12424
12492
|
if (typeof displayFormat === "string") {
|
|
12425
12493
|
const inputProps = __spreadValues({ id, name: id, className: "form-control" }, rest);
|
|
12426
|
-
return /* @__PURE__ */ (0,
|
|
12494
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
12427
12495
|
import_components34.InputWithDisplayFormat,
|
|
12428
12496
|
__spreadValues({
|
|
12429
12497
|
displayPattern: displayFormat,
|
|
@@ -12431,29 +12499,29 @@ function TextInput(_a) {
|
|
|
12431
12499
|
}, inputProps)
|
|
12432
12500
|
);
|
|
12433
12501
|
}
|
|
12434
|
-
return /* @__PURE__ */ (0,
|
|
12502
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_components34.Input, __spreadValues({ id, name: id, onChange: (e) => onChange(e.target.value) }, rest));
|
|
12435
12503
|
}
|
|
12436
12504
|
function TextAreaInput(_a) {
|
|
12437
12505
|
var _b = _a, { id, displayFormat, onChange } = _b, rest = __objRest(_b, ["id", "displayFormat", "onChange"]);
|
|
12438
12506
|
const textAreaProps = __spreadValues({ id, name: id }, rest);
|
|
12439
|
-
return typeof displayFormat === "string" ? /* @__PURE__ */ (0,
|
|
12507
|
+
return typeof displayFormat === "string" ? /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
12440
12508
|
import_components34.TextareaWithDisplayFormat,
|
|
12441
12509
|
__spreadValues({
|
|
12442
12510
|
displayPattern: displayFormat,
|
|
12443
12511
|
onChange: (newValue) => onChange(newValue)
|
|
12444
12512
|
}, textAreaProps)
|
|
12445
|
-
) : /* @__PURE__ */ (0,
|
|
12513
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_components34.TextArea, __spreadValues({ onChange: (e) => onChange(e.target.value) }, textAreaProps));
|
|
12446
12514
|
}
|
|
12447
12515
|
function NumericInput(_a) {
|
|
12448
12516
|
var _b = _a, { id, displayFormat, onChange } = _b, rest = __objRest(_b, ["id", "displayFormat", "onChange"]);
|
|
12449
12517
|
const numericProps = __spreadValues({ id, name: id, onWheel }, rest);
|
|
12450
|
-
return typeof displayFormat === "string" ? /* @__PURE__ */ (0,
|
|
12518
|
+
return typeof displayFormat === "string" ? /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
12451
12519
|
import_components34.InputWithDisplayFormat,
|
|
12452
12520
|
__spreadValues({
|
|
12453
12521
|
displayPattern: displayFormat,
|
|
12454
12522
|
onChange: (newValue) => onChange(numericValueOrNull(newValue))
|
|
12455
12523
|
}, numericProps)
|
|
12456
|
-
) : /* @__PURE__ */ (0,
|
|
12524
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
12457
12525
|
import_components34.Input,
|
|
12458
12526
|
__spreadValues({
|
|
12459
12527
|
onChange: ({ target: { value: newValue } }) => onChange(numericValueOrNull(newValue))
|
|
@@ -12462,12 +12530,12 @@ function NumericInput(_a) {
|
|
|
12462
12530
|
}
|
|
12463
12531
|
function PhoneNumberInput(_a) {
|
|
12464
12532
|
var _b = _a, { value } = _b, rest = __objRest(_b, ["value"]);
|
|
12465
|
-
return /* @__PURE__ */ (0,
|
|
12533
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_components34.PhoneNumberInput, __spreadValues({ initialValue: value }, rest));
|
|
12466
12534
|
}
|
|
12467
12535
|
var VariableTextInput_default = VariableTextInput;
|
|
12468
12536
|
|
|
12469
12537
|
// ../renderers/src/TextInputRenderer.tsx
|
|
12470
|
-
var
|
|
12538
|
+
var import_jsx_runtime53 = require("react/jsx-runtime");
|
|
12471
12539
|
var TextInputRenderer = {
|
|
12472
12540
|
canRenderType: "input-text",
|
|
12473
12541
|
render: (props) => {
|
|
@@ -12492,14 +12560,14 @@ var TextInputRenderer = {
|
|
|
12492
12560
|
]);
|
|
12493
12561
|
const value = initialValue != null ? initialValue : "";
|
|
12494
12562
|
const inputProps = __spreadProps(__spreadValues({}, rest), { value, id });
|
|
12495
|
-
return /* @__PURE__ */ (0,
|
|
12563
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(FieldInput_default, { id, label, description, error, help, children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(VariableTextInput_default, { control, inputProps }) });
|
|
12496
12564
|
}
|
|
12497
12565
|
};
|
|
12498
12566
|
var TextInputRenderer_default = TextInputRenderer;
|
|
12499
12567
|
|
|
12500
12568
|
// ../renderers/src/UploadInputRenderer.tsx
|
|
12501
12569
|
var import_components35 = require("@transferwise/components");
|
|
12502
|
-
var
|
|
12570
|
+
var import_jsx_runtime54 = require("react/jsx-runtime");
|
|
12503
12571
|
var UploadInputRenderer = {
|
|
12504
12572
|
canRenderType: "input-upload",
|
|
12505
12573
|
render: (props) => {
|
|
@@ -12515,7 +12583,7 @@ var UploadInputRenderer = {
|
|
|
12515
12583
|
};
|
|
12516
12584
|
return (
|
|
12517
12585
|
// We don't pass help here as there is no sensible place to display it
|
|
12518
|
-
/* @__PURE__ */ (0,
|
|
12586
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)(UploadFieldInput_default, { id, label: void 0, description: void 0, error, children: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
12519
12587
|
import_components35.UploadInput,
|
|
12520
12588
|
{
|
|
12521
12589
|
id,
|
|
@@ -12570,7 +12638,7 @@ var LargeUploadRenderer = {
|
|
|
12570
12638
|
throw e;
|
|
12571
12639
|
}
|
|
12572
12640
|
};
|
|
12573
|
-
return /* @__PURE__ */ (0,
|
|
12641
|
+
return /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(FieldInput_default, { id, label, description, error, help, children: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
12574
12642
|
import_components35.Upload,
|
|
12575
12643
|
__spreadProps(__spreadValues({}, uploadProps), {
|
|
12576
12644
|
usAccept: getAcceptsString(accepts),
|
|
@@ -12585,7 +12653,7 @@ var LargeUploadRenderer = {
|
|
|
12585
12653
|
|
|
12586
12654
|
// ../renderers/src/ReviewRenderer.tsx
|
|
12587
12655
|
var import_components36 = require("@transferwise/components");
|
|
12588
|
-
var
|
|
12656
|
+
var import_jsx_runtime55 = require("react/jsx-runtime");
|
|
12589
12657
|
var ReviewRenderer = {
|
|
12590
12658
|
canRenderType: "review",
|
|
12591
12659
|
render: ({ callToAction, control, fields, margin, title }) => {
|
|
@@ -12597,9 +12665,9 @@ var ReviewRenderer = {
|
|
|
12597
12665
|
callToAction.onClick();
|
|
12598
12666
|
}
|
|
12599
12667
|
} : void 0;
|
|
12600
|
-
return /* @__PURE__ */ (0,
|
|
12601
|
-
(title || callToAction) && /* @__PURE__ */ (0,
|
|
12602
|
-
/* @__PURE__ */ (0,
|
|
12668
|
+
return /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("div", { className: getMargin(margin), children: [
|
|
12669
|
+
(title || callToAction) && /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(import_components36.Header, { title: title != null ? title : "", action }),
|
|
12670
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)("div", { className: margin, children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
12603
12671
|
import_components36.DefinitionList,
|
|
12604
12672
|
{
|
|
12605
12673
|
layout: orientation,
|
|
@@ -12631,21 +12699,21 @@ var mapControlToDefinitionListLayout = (control) => {
|
|
|
12631
12699
|
};
|
|
12632
12700
|
var getFieldValue = (value, help, orientation) => {
|
|
12633
12701
|
if (help) {
|
|
12634
|
-
return orientation === "HORIZONTAL_RIGHT_ALIGNED" ? /* @__PURE__ */ (0,
|
|
12635
|
-
/* @__PURE__ */ (0,
|
|
12702
|
+
return orientation === "HORIZONTAL_RIGHT_ALIGNED" ? /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(import_jsx_runtime55.Fragment, { children: [
|
|
12703
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)(Help_default, { help }),
|
|
12636
12704
|
" ",
|
|
12637
12705
|
value
|
|
12638
|
-
] }) : /* @__PURE__ */ (0,
|
|
12706
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(import_jsx_runtime55.Fragment, { children: [
|
|
12639
12707
|
value,
|
|
12640
12708
|
" ",
|
|
12641
|
-
/* @__PURE__ */ (0,
|
|
12709
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)(Help_default, { help })
|
|
12642
12710
|
] });
|
|
12643
12711
|
}
|
|
12644
12712
|
return value;
|
|
12645
12713
|
};
|
|
12646
12714
|
|
|
12647
12715
|
// ../renderers/src/step/StepRenderer.tsx
|
|
12648
|
-
var
|
|
12716
|
+
var import_react19 = require("react");
|
|
12649
12717
|
|
|
12650
12718
|
// ../renderers/src/step/ExternalConfirmationDialog.tsx
|
|
12651
12719
|
var import_react_intl18 = require("react-intl");
|
|
@@ -12677,17 +12745,17 @@ var external_confirmation_messages_default = (0, import_react_intl17.defineMessa
|
|
|
12677
12745
|
|
|
12678
12746
|
// ../renderers/src/step/ExternalConfirmationDialog.tsx
|
|
12679
12747
|
var import_components37 = require("@transferwise/components");
|
|
12680
|
-
var
|
|
12748
|
+
var import_jsx_runtime56 = require("react/jsx-runtime");
|
|
12681
12749
|
function ExternalConfirmationDialog({
|
|
12682
12750
|
external,
|
|
12683
12751
|
onClose
|
|
12684
12752
|
}) {
|
|
12685
12753
|
const { formatMessage } = (0, import_react_intl18.useIntl)();
|
|
12686
|
-
return /* @__PURE__ */ (0,
|
|
12687
|
-
/* @__PURE__ */ (0,
|
|
12688
|
-
/* @__PURE__ */ (0,
|
|
12689
|
-
/* @__PURE__ */ (0,
|
|
12690
|
-
/* @__PURE__ */ (0,
|
|
12754
|
+
return /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("div", { className: "df-box-renderer-fixed-width", children: /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { className: "df-box-renderer-width-lg", children: [
|
|
12755
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)("h2", { className: "text-xs-center m-b-5", children: formatMessage(external_confirmation_messages_default.title) }),
|
|
12756
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(import_components37.Markdown, { config: { link: { target: "_blank" } }, className: "text-xs-center m-b-5", children: formatMessage(external_confirmation_messages_default.description, { origin: getOrigin(external.url) }) }),
|
|
12757
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)("div", { className: "df-box-renderer-fixed-width", children: /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { className: "df-box-renderer-width-lg", children: [
|
|
12758
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
12691
12759
|
import_components37.Button,
|
|
12692
12760
|
{
|
|
12693
12761
|
block: true,
|
|
@@ -12701,7 +12769,7 @@ function ExternalConfirmationDialog({
|
|
|
12701
12769
|
children: formatMessage(external_confirmation_messages_default.open)
|
|
12702
12770
|
}
|
|
12703
12771
|
),
|
|
12704
|
-
/* @__PURE__ */ (0,
|
|
12772
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(import_components37.Button, { block: true, className: "m-b-2", priority: "tertiary", size: "md", onClick: onClose, children: formatMessage(external_confirmation_messages_default.cancel) })
|
|
12705
12773
|
] }) })
|
|
12706
12774
|
] }) });
|
|
12707
12775
|
}
|
|
@@ -12714,12 +12782,12 @@ function getOrigin(url) {
|
|
|
12714
12782
|
}
|
|
12715
12783
|
|
|
12716
12784
|
// ../renderers/src/step/useExternal.tsx
|
|
12717
|
-
var
|
|
12785
|
+
var import_react18 = require("react");
|
|
12718
12786
|
function useExternal(url) {
|
|
12719
|
-
const [externalWindow, setExternalWindow] = (0,
|
|
12720
|
-
const [hasDismissed, setHasDismissed] = (0,
|
|
12787
|
+
const [externalWindow, setExternalWindow] = (0, import_react18.useState)(null);
|
|
12788
|
+
const [hasDismissed, setHasDismissed] = (0, import_react18.useState)(false);
|
|
12721
12789
|
const dismissConfirmation = () => setHasDismissed(true);
|
|
12722
|
-
(0,
|
|
12790
|
+
(0, import_react18.useEffect)(() => {
|
|
12723
12791
|
if (url) {
|
|
12724
12792
|
setHasDismissed(false);
|
|
12725
12793
|
setExternalWindow(window.open(url, "_blank"));
|
|
@@ -12732,9 +12800,9 @@ function useExternal(url) {
|
|
|
12732
12800
|
// ../renderers/src/step/BackButton.tsx
|
|
12733
12801
|
var import_components38 = require("@transferwise/components");
|
|
12734
12802
|
var import_icons3 = require("@transferwise/icons");
|
|
12735
|
-
var
|
|
12803
|
+
var import_jsx_runtime57 = require("react/jsx-runtime");
|
|
12736
12804
|
function BackButton({ title, onClick }) {
|
|
12737
|
-
return /* @__PURE__ */ (0,
|
|
12805
|
+
return /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(
|
|
12738
12806
|
"a",
|
|
12739
12807
|
{
|
|
12740
12808
|
href: "/",
|
|
@@ -12745,8 +12813,8 @@ function BackButton({ title, onClick }) {
|
|
|
12745
12813
|
onClick();
|
|
12746
12814
|
},
|
|
12747
12815
|
children: [
|
|
12748
|
-
/* @__PURE__ */ (0,
|
|
12749
|
-
/* @__PURE__ */ (0,
|
|
12816
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)("span", { className: "sr-only", children: title }),
|
|
12817
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(import_components38.Avatar, { type: "icon", children: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(import_icons3.ArrowLeft, { size: "24" }) })
|
|
12750
12818
|
]
|
|
12751
12819
|
}
|
|
12752
12820
|
);
|
|
@@ -12755,23 +12823,23 @@ var BackButton_default = BackButton;
|
|
|
12755
12823
|
|
|
12756
12824
|
// ../renderers/src/step/StepRenderer.tsx
|
|
12757
12825
|
var import_components39 = require("@transferwise/components");
|
|
12758
|
-
var
|
|
12826
|
+
var import_jsx_runtime58 = require("react/jsx-runtime");
|
|
12759
12827
|
var StepRenderer = {
|
|
12760
12828
|
canRenderType: "step",
|
|
12761
12829
|
render: StepRendererComponent
|
|
12762
12830
|
};
|
|
12763
12831
|
function StepRendererComponent(props) {
|
|
12764
12832
|
const { back, description, error, external, loadingState, title, trackEvent, children } = props;
|
|
12765
|
-
const value = (0,
|
|
12833
|
+
const value = (0, import_react19.useMemo)(() => ({ loadingState, trackEvent }), [loadingState, trackEvent]);
|
|
12766
12834
|
const { requiresUserConfirmation, dismissConfirmation } = useExternal(external == null ? void 0 : external.url);
|
|
12767
12835
|
if ((external == null ? void 0 : external.url) && requiresUserConfirmation) {
|
|
12768
|
-
return /* @__PURE__ */ (0,
|
|
12836
|
+
return /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(ExternalConfirmationDialog, { external, onClose: dismissConfirmation });
|
|
12769
12837
|
}
|
|
12770
|
-
return /* @__PURE__ */ (0,
|
|
12771
|
-
back ? /* @__PURE__ */ (0,
|
|
12772
|
-
title ? /* @__PURE__ */ (0,
|
|
12773
|
-
description ? /* @__PURE__ */ (0,
|
|
12774
|
-
error ? /* @__PURE__ */ (0,
|
|
12838
|
+
return /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)(StepRendererContextProvider, { value, children: [
|
|
12839
|
+
back ? /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(BackButton_default, __spreadValues({}, back)) : null,
|
|
12840
|
+
title ? /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("h2", { className: "text-xs-center m-b-2", children: title }) : void 0,
|
|
12841
|
+
description ? /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("p", { className: "text-xs-center m-b-2", children: description }) : void 0,
|
|
12842
|
+
error ? /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(import_components39.Alert, { type: "negative", className: "m-b-2", message: error }) : void 0,
|
|
12775
12843
|
children
|
|
12776
12844
|
] });
|
|
12777
12845
|
}
|
|
@@ -12811,46 +12879,46 @@ var getWiseRenderers = () => [
|
|
|
12811
12879
|
];
|
|
12812
12880
|
|
|
12813
12881
|
// src/revamp/DynamicFlowWise.tsx
|
|
12814
|
-
var
|
|
12882
|
+
var import_jsx_runtime59 = require("react/jsx-runtime");
|
|
12815
12883
|
var wiseRenderers = getWiseRenderers();
|
|
12816
12884
|
function DynamicFlowWise(props) {
|
|
12817
12885
|
const { httpClient, renderers } = props;
|
|
12818
|
-
const mergedRenderers = (0,
|
|
12819
|
-
return /* @__PURE__ */ (0,
|
|
12886
|
+
const mergedRenderers = (0, import_react20.useMemo)(() => [...renderers != null ? renderers : [], ...wiseRenderers], [renderers]);
|
|
12887
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(RendererHttpClientProvider, { httpClient, children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(DynamicFlowCore, __spreadProps(__spreadValues({}, props), { renderers: mergedRenderers })) });
|
|
12820
12888
|
}
|
|
12821
12889
|
var DynamicFlowWise_default = DynamicFlowWise;
|
|
12822
12890
|
|
|
12823
12891
|
// src/revamp/DynamicFragmentWise.tsx
|
|
12824
|
-
var
|
|
12892
|
+
var import_react22 = require("react");
|
|
12825
12893
|
|
|
12826
12894
|
// src/common/httpClientContext/HttpClientContext.tsx
|
|
12827
|
-
var
|
|
12828
|
-
var
|
|
12829
|
-
var HttpClientContext2 = (0,
|
|
12895
|
+
var import_react21 = require("react");
|
|
12896
|
+
var import_jsx_runtime60 = require("react/jsx-runtime");
|
|
12897
|
+
var HttpClientContext2 = (0, import_react21.createContext)(void 0);
|
|
12830
12898
|
function HttpClientProvider({ httpClient, children }) {
|
|
12831
|
-
return /* @__PURE__ */ (0,
|
|
12899
|
+
return /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(HttpClientContext2.Provider, { value: httpClient, children });
|
|
12832
12900
|
}
|
|
12833
12901
|
function HttpClientProviderFromBaseUrl({ baseUrl, children }) {
|
|
12834
|
-
const httpClient = (0,
|
|
12835
|
-
return /* @__PURE__ */ (0,
|
|
12902
|
+
const httpClient = (0, import_react21.useMemo)(() => makeHttpClient(baseUrl), [baseUrl]);
|
|
12903
|
+
return /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(HttpClientContext2.Provider, { value: httpClient, children });
|
|
12836
12904
|
}
|
|
12837
12905
|
var useHttpClient = () => {
|
|
12838
|
-
const contextFetch = (0,
|
|
12906
|
+
const contextFetch = (0, import_react21.useContext)(HttpClientContext2);
|
|
12839
12907
|
return contextFetch != null ? contextFetch : fetch;
|
|
12840
12908
|
};
|
|
12841
12909
|
var useHasHttpClientProvider = () => {
|
|
12842
|
-
const context = (0,
|
|
12910
|
+
const context = (0, import_react21.useContext)(HttpClientContext2);
|
|
12843
12911
|
return Boolean(context);
|
|
12844
12912
|
};
|
|
12845
12913
|
|
|
12846
12914
|
// src/revamp/DynamicFragmentWise.tsx
|
|
12847
|
-
var
|
|
12915
|
+
var import_jsx_runtime61 = require("react/jsx-runtime");
|
|
12848
12916
|
var wiseRenderers2 = getWiseRenderers();
|
|
12849
|
-
var DynamicFragmentWise = (0,
|
|
12917
|
+
var DynamicFragmentWise = (0, import_react22.forwardRef)(function DynamicFragmentWise2(props, ref) {
|
|
12850
12918
|
const { httpClient, onEvent, onError, renderers } = props;
|
|
12851
|
-
const mergedRenderers = (0,
|
|
12919
|
+
const mergedRenderers = (0, import_react22.useMemo)(() => [...renderers != null ? renderers : [], ...wiseRenderers2], [renderers]);
|
|
12852
12920
|
const { stepComponentRef } = useDynamicFlowCore(props);
|
|
12853
|
-
(0,
|
|
12921
|
+
(0, import_react22.useImperativeHandle)(
|
|
12854
12922
|
ref,
|
|
12855
12923
|
() => ({
|
|
12856
12924
|
getValue: async () => {
|
|
@@ -12865,30 +12933,30 @@ var DynamicFragmentWise = (0, import_react21.forwardRef)(function DynamicFragmen
|
|
|
12865
12933
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
12866
12934
|
[]
|
|
12867
12935
|
);
|
|
12868
|
-
const render = (0,
|
|
12936
|
+
const render = (0, import_react22.useMemo)(
|
|
12869
12937
|
() => getRenderFunction([CoreContainerRenderer, ...mergedRenderers, StepRenderer]),
|
|
12870
12938
|
[mergedRenderers]
|
|
12871
12939
|
);
|
|
12872
|
-
return /* @__PURE__ */ (0,
|
|
12940
|
+
return /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
12873
12941
|
ErrorBoundary_default,
|
|
12874
12942
|
{
|
|
12875
12943
|
onError: (error) => {
|
|
12876
12944
|
onEvent == null ? void 0 : onEvent("Dynamic Flow - Failed");
|
|
12877
12945
|
onError(error);
|
|
12878
12946
|
},
|
|
12879
|
-
children: /* @__PURE__ */ (0,
|
|
12947
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(HttpClientProvider, { httpClient, children: stepComponentRef.current ? render(stepComponentRef.current) : null })
|
|
12880
12948
|
}
|
|
12881
12949
|
);
|
|
12882
12950
|
});
|
|
12883
12951
|
var DynamicFragmentWise_default = DynamicFragmentWise;
|
|
12884
12952
|
|
|
12885
12953
|
// src/revamp/DynamicFragmentCore.tsx
|
|
12886
|
-
var
|
|
12887
|
-
var
|
|
12888
|
-
var DynamicFragmentCore = (0,
|
|
12954
|
+
var import_react23 = require("react");
|
|
12955
|
+
var import_jsx_runtime62 = require("react/jsx-runtime");
|
|
12956
|
+
var DynamicFragmentCore = (0, import_react23.forwardRef)(function DynamicFragmentCore2(props, ref) {
|
|
12889
12957
|
const { onEvent, onError, renderers } = props;
|
|
12890
12958
|
const { stepComponentRef } = useDynamicFlowCore(props);
|
|
12891
|
-
(0,
|
|
12959
|
+
(0, import_react23.useImperativeHandle)(
|
|
12892
12960
|
ref,
|
|
12893
12961
|
() => ({
|
|
12894
12962
|
getValue: async () => {
|
|
@@ -12903,11 +12971,11 @@ var DynamicFragmentCore = (0, import_react22.forwardRef)(function DynamicFragmen
|
|
|
12903
12971
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
12904
12972
|
[]
|
|
12905
12973
|
);
|
|
12906
|
-
const render = (0,
|
|
12974
|
+
const render = (0, import_react23.useMemo)(
|
|
12907
12975
|
() => getRenderFunction([CoreContainerRenderer, ...renderers]),
|
|
12908
12976
|
[renderers]
|
|
12909
12977
|
);
|
|
12910
|
-
return /* @__PURE__ */ (0,
|
|
12978
|
+
return /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
12911
12979
|
ErrorBoundary_default,
|
|
12912
12980
|
{
|
|
12913
12981
|
onError: (error) => {
|
|
@@ -13224,17 +13292,17 @@ function isReference(block) {
|
|
|
13224
13292
|
}
|
|
13225
13293
|
|
|
13226
13294
|
// src/legacy/dynamicFlow/DynamicFlow.tsx
|
|
13227
|
-
var
|
|
13295
|
+
var import_react67 = require("react");
|
|
13228
13296
|
var import_react_intl48 = require("react-intl");
|
|
13229
13297
|
|
|
13230
13298
|
// src/legacy/common/contexts/dynamicFlowContexts/DynamicFlowContexts.tsx
|
|
13231
|
-
var
|
|
13299
|
+
var import_react25 = require("react");
|
|
13232
13300
|
|
|
13233
13301
|
// src/legacy/common/contexts/dynamicFlowContexts/usePendingPromiseCounter.ts
|
|
13234
|
-
var
|
|
13302
|
+
var import_react24 = require("react");
|
|
13235
13303
|
function usePendingPromiseCounter() {
|
|
13236
|
-
const [count, setCount] = (0,
|
|
13237
|
-
const addPendingPromise = (0,
|
|
13304
|
+
const [count, setCount] = (0, import_react24.useState)(0);
|
|
13305
|
+
const addPendingPromise = (0, import_react24.useCallback)(
|
|
13238
13306
|
(promise) => {
|
|
13239
13307
|
setCount((c) => c + 1);
|
|
13240
13308
|
promise.catch(noop2).finally(() => delayUntilNextCycle(() => setCount((c) => Math.max(0, c - 1))));
|
|
@@ -13248,44 +13316,44 @@ var noop2 = () => {
|
|
|
13248
13316
|
};
|
|
13249
13317
|
|
|
13250
13318
|
// src/legacy/common/contexts/dynamicFlowContexts/DynamicFlowContexts.tsx
|
|
13251
|
-
var
|
|
13319
|
+
var import_jsx_runtime63 = require("react/jsx-runtime");
|
|
13252
13320
|
var defaultContextValue = {
|
|
13253
13321
|
loading: false,
|
|
13254
13322
|
registerPersistAsyncPromise: (promise) => {
|
|
13255
13323
|
}
|
|
13256
13324
|
};
|
|
13257
|
-
var DFContext = (0,
|
|
13325
|
+
var DFContext = (0, import_react25.createContext)(defaultContextValue);
|
|
13258
13326
|
var DynamicFlowProvider = ({ loading, children }) => {
|
|
13259
13327
|
const { pendingPromises, addPendingPromise } = usePendingPromiseCounter();
|
|
13260
|
-
const providerValue = (0,
|
|
13328
|
+
const providerValue = (0, import_react25.useMemo)(() => {
|
|
13261
13329
|
return {
|
|
13262
13330
|
loading: loading || pendingPromises > 0,
|
|
13263
13331
|
registerPersistAsyncPromise: addPendingPromise
|
|
13264
13332
|
};
|
|
13265
13333
|
}, [loading, pendingPromises, addPendingPromise]);
|
|
13266
|
-
return /* @__PURE__ */ (0,
|
|
13334
|
+
return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(DFContext.Provider, { value: providerValue, children });
|
|
13267
13335
|
};
|
|
13268
13336
|
var useDynamicFlow = () => {
|
|
13269
|
-
const context = (0,
|
|
13337
|
+
const context = (0, import_react25.useContext)(DFContext);
|
|
13270
13338
|
return context || defaultContextValue;
|
|
13271
13339
|
};
|
|
13272
13340
|
|
|
13273
13341
|
// src/legacy/common/contexts/eventsContext/EventsContext.tsx
|
|
13274
|
-
var
|
|
13275
|
-
var
|
|
13276
|
-
var EventsContext = (0,
|
|
13342
|
+
var import_react26 = require("react");
|
|
13343
|
+
var import_jsx_runtime64 = require("react/jsx-runtime");
|
|
13344
|
+
var EventsContext = (0, import_react26.createContext)({
|
|
13277
13345
|
triggerEvent: () => {
|
|
13278
13346
|
}
|
|
13279
13347
|
});
|
|
13280
13348
|
function EventsContextProvider({ metadata, children, onEvent }) {
|
|
13281
|
-
const value = (0,
|
|
13349
|
+
const value = (0, import_react26.useMemo)(
|
|
13282
13350
|
() => ({ triggerEvent: getEventDispatcher(onEvent, metadata) }),
|
|
13283
13351
|
[onEvent, metadata]
|
|
13284
13352
|
);
|
|
13285
|
-
return /* @__PURE__ */ (0,
|
|
13353
|
+
return /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(EventsContext.Provider, { value, children });
|
|
13286
13354
|
}
|
|
13287
13355
|
function useEventDispatcher() {
|
|
13288
|
-
const { triggerEvent } = (0,
|
|
13356
|
+
const { triggerEvent } = (0, import_react26.useContext)(EventsContext);
|
|
13289
13357
|
return triggerEvent;
|
|
13290
13358
|
}
|
|
13291
13359
|
var getEventDispatcher = (onEvent, metadata) => (eventName, properties = {}) => {
|
|
@@ -13296,8 +13364,8 @@ var getEventDispatcher = (onEvent, metadata) => (eventName, properties = {}) =>
|
|
|
13296
13364
|
};
|
|
13297
13365
|
|
|
13298
13366
|
// src/legacy/common/contexts/logContext/LogContext.tsx
|
|
13299
|
-
var
|
|
13300
|
-
var
|
|
13367
|
+
var import_react27 = require("react");
|
|
13368
|
+
var import_jsx_runtime65 = require("react/jsx-runtime");
|
|
13301
13369
|
var getLogger = (level, onLog, flowId = "UNKNOWN-FLOW-ID", stepId = "UNKNOWN-FLOW-ID") => (title, description, extra) => {
|
|
13302
13370
|
try {
|
|
13303
13371
|
onLog(level, `Dynamic Flow ${level} - ${title} - ${description}`, __spreadValues({
|
|
@@ -13307,9 +13375,9 @@ var getLogger = (level, onLog, flowId = "UNKNOWN-FLOW-ID", stepId = "UNKNOWN-FLO
|
|
|
13307
13375
|
} catch (e) {
|
|
13308
13376
|
}
|
|
13309
13377
|
};
|
|
13310
|
-
var LogContext = (0,
|
|
13378
|
+
var LogContext = (0, import_react27.createContext)(null);
|
|
13311
13379
|
function LogProvider({ flowId, stepId, children, onLog }) {
|
|
13312
|
-
const value = (0,
|
|
13380
|
+
const value = (0, import_react27.useMemo)(
|
|
13313
13381
|
() => ({
|
|
13314
13382
|
debug: getLogger("debug", onLog, flowId, stepId),
|
|
13315
13383
|
info: getLogger("info", onLog, flowId, stepId),
|
|
@@ -13319,10 +13387,10 @@ function LogProvider({ flowId, stepId, children, onLog }) {
|
|
|
13319
13387
|
}),
|
|
13320
13388
|
[onLog, flowId, stepId]
|
|
13321
13389
|
);
|
|
13322
|
-
return /* @__PURE__ */ (0,
|
|
13390
|
+
return /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(LogContext.Provider, { value, children });
|
|
13323
13391
|
}
|
|
13324
13392
|
var useLogger = () => {
|
|
13325
|
-
const logging = (0,
|
|
13393
|
+
const logging = (0, import_react27.useContext)(LogContext);
|
|
13326
13394
|
if (logging == null) {
|
|
13327
13395
|
throw new Error(
|
|
13328
13396
|
"Logging context not found. Did you forget to wrap your component in a <LogProvider />?"
|
|
@@ -13332,11 +13400,11 @@ var useLogger = () => {
|
|
|
13332
13400
|
};
|
|
13333
13401
|
|
|
13334
13402
|
// src/legacy/common/contexts/featureContext/FeatureContext.tsx
|
|
13335
|
-
var
|
|
13336
|
-
var
|
|
13337
|
-
var FeatureContext = (0,
|
|
13403
|
+
var import_react28 = require("react");
|
|
13404
|
+
var import_jsx_runtime66 = require("react/jsx-runtime");
|
|
13405
|
+
var FeatureContext = (0, import_react28.createContext)([]);
|
|
13338
13406
|
function FeatureContextProvider({ features, children }) {
|
|
13339
|
-
return /* @__PURE__ */ (0,
|
|
13407
|
+
return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(FeatureContext.Provider, { value: features, children });
|
|
13340
13408
|
}
|
|
13341
13409
|
|
|
13342
13410
|
// src/common/cameraCapture/utils/mobile-utils.ts
|
|
@@ -14066,18 +14134,18 @@ var filterHiddenSchemas = (schemas) => schemas.filter((schema) => {
|
|
|
14066
14134
|
});
|
|
14067
14135
|
|
|
14068
14136
|
// src/legacy/common/hooks/useDebouncedFunction/useDebouncedFunction.tsx
|
|
14069
|
-
var
|
|
14137
|
+
var import_react29 = require("react");
|
|
14070
14138
|
function useDebouncedFunction(callback, waitMs) {
|
|
14071
|
-
return (0,
|
|
14139
|
+
return (0, import_react29.useCallback)(debounce2(callback, waitMs), [callback, waitMs]);
|
|
14072
14140
|
}
|
|
14073
14141
|
|
|
14074
14142
|
// src/legacy/common/hooks/useExternal/useExternal.tsx
|
|
14075
|
-
var
|
|
14143
|
+
var import_react30 = require("react");
|
|
14076
14144
|
function useExternal2(url) {
|
|
14077
|
-
const [externalWindow, setExternalWindow] = (0,
|
|
14078
|
-
const [hasManuallyTriggered, setHasManuallyTriggered] = (0,
|
|
14145
|
+
const [externalWindow, setExternalWindow] = (0, import_react30.useState)(null);
|
|
14146
|
+
const [hasManuallyTriggered, setHasManuallyTriggered] = (0, import_react30.useState)(false);
|
|
14079
14147
|
const dismissConfirmation = () => setHasManuallyTriggered(true);
|
|
14080
|
-
(0,
|
|
14148
|
+
(0, import_react30.useEffect)(() => {
|
|
14081
14149
|
if (url) {
|
|
14082
14150
|
setHasManuallyTriggered(false);
|
|
14083
14151
|
setExternalWindow(window.open(url, "_blank"));
|
|
@@ -14088,10 +14156,10 @@ function useExternal2(url) {
|
|
|
14088
14156
|
}
|
|
14089
14157
|
|
|
14090
14158
|
// src/legacy/common/hooks/useExternalStepPolling/useExternalStepPolling.tsx
|
|
14091
|
-
var
|
|
14159
|
+
var import_react31 = require("react");
|
|
14092
14160
|
function useExternalStepPolling(polling, onAction) {
|
|
14093
14161
|
const httpClient = useHttpClient();
|
|
14094
|
-
const asyncFn = (0,
|
|
14162
|
+
const asyncFn = (0, import_react31.useMemo)(() => {
|
|
14095
14163
|
if (polling) {
|
|
14096
14164
|
return () => httpClient(polling.url).then((response) => {
|
|
14097
14165
|
if (response.ok) {
|
|
@@ -14109,7 +14177,7 @@ function useExternalStepPolling(polling, onAction) {
|
|
|
14109
14177
|
}
|
|
14110
14178
|
return void 0;
|
|
14111
14179
|
}, [polling, httpClient]);
|
|
14112
|
-
const onPollingResponse = (0,
|
|
14180
|
+
const onPollingResponse = (0, import_react31.useCallback)(
|
|
14113
14181
|
(pollingResponse) => {
|
|
14114
14182
|
const responseHandlers = (polling == null ? void 0 : polling.responseHandlers) || [];
|
|
14115
14183
|
const responseHandler = responseHandlers.find(
|
|
@@ -14136,7 +14204,7 @@ function useExternalStepPolling(polling, onAction) {
|
|
|
14136
14204
|
maxAttempts: (polling == null ? void 0 : polling.maxAttempts) || 0,
|
|
14137
14205
|
maxConsecutiveFails: (polling == null ? void 0 : polling.maxConsecutiveFails) || 0,
|
|
14138
14206
|
onPollingResponse,
|
|
14139
|
-
onFailure: (0,
|
|
14207
|
+
onFailure: (0, import_react31.useCallback)(() => {
|
|
14140
14208
|
if (polling) {
|
|
14141
14209
|
onAction(polling.onError.action);
|
|
14142
14210
|
}
|
|
@@ -14145,11 +14213,11 @@ function useExternalStepPolling(polling, onAction) {
|
|
|
14145
14213
|
}
|
|
14146
14214
|
|
|
14147
14215
|
// src/legacy/common/hooks/usePersistAsync/usePersistAsync.ts
|
|
14148
|
-
var
|
|
14216
|
+
var import_react55 = require("react");
|
|
14149
14217
|
var import_react_intl39 = require("react-intl");
|
|
14150
14218
|
|
|
14151
14219
|
// src/legacy/jsonSchemaForm/persistAsyncSchema/persistAsyncBasicSchema/PersistAsyncBasicSchema.tsx
|
|
14152
|
-
var
|
|
14220
|
+
var import_react54 = require("react");
|
|
14153
14221
|
var import_react_intl38 = require("react-intl");
|
|
14154
14222
|
|
|
14155
14223
|
// src/legacy/common/constants/DateMode.ts
|
|
@@ -14198,7 +14266,7 @@ var Size = {
|
|
|
14198
14266
|
|
|
14199
14267
|
// src/legacy/jsonSchemaForm/basicTypeSchema/BasicTypeSchema.tsx
|
|
14200
14268
|
var import_classnames15 = __toESM(require_classnames());
|
|
14201
|
-
var
|
|
14269
|
+
var import_react53 = require("react");
|
|
14202
14270
|
|
|
14203
14271
|
// src/legacy/layout/alert/DynamicAlert.tsx
|
|
14204
14272
|
var import_components41 = require("@transferwise/components");
|
|
@@ -14207,19 +14275,19 @@ var import_components41 = require("@transferwise/components");
|
|
|
14207
14275
|
var import_components40 = require("@transferwise/components");
|
|
14208
14276
|
|
|
14209
14277
|
// src/legacy/layout/icon/FlagIcon.tsx
|
|
14210
|
-
var
|
|
14278
|
+
var import_jsx_runtime67 = require("react/jsx-runtime");
|
|
14211
14279
|
var isFlagIcon2 = (name) => name.startsWith("flag-");
|
|
14212
14280
|
function FlagIcon2({ name }) {
|
|
14213
14281
|
if (!isFlagIcon2(name)) {
|
|
14214
14282
|
return null;
|
|
14215
14283
|
}
|
|
14216
14284
|
const code = name.substring(5);
|
|
14217
|
-
return /* @__PURE__ */ (0,
|
|
14285
|
+
return /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(Flag, { intrinsicSize: 24, code });
|
|
14218
14286
|
}
|
|
14219
14287
|
|
|
14220
14288
|
// src/legacy/layout/icon/NamedIcon.tsx
|
|
14221
14289
|
var icons2 = __toESM(require("@transferwise/icons"));
|
|
14222
|
-
var
|
|
14290
|
+
var import_jsx_runtime68 = require("react/jsx-runtime");
|
|
14223
14291
|
var isNamedIcon2 = (name) => {
|
|
14224
14292
|
const iconName = toCapitalisedCamelCase2(name);
|
|
14225
14293
|
return Object.keys(icons2).includes(iconName);
|
|
@@ -14230,19 +14298,19 @@ function NamedIcon2({ name }) {
|
|
|
14230
14298
|
}
|
|
14231
14299
|
const iconName = toCapitalisedCamelCase2(name);
|
|
14232
14300
|
const Icon = icons2[iconName];
|
|
14233
|
-
return /* @__PURE__ */ (0,
|
|
14301
|
+
return /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(Icon, { size: 24 });
|
|
14234
14302
|
}
|
|
14235
14303
|
var toCapitalisedCamelCase2 = (value) => value.split("-").map(capitaliseFirstChar2).join("");
|
|
14236
14304
|
var capitaliseFirstChar2 = (value) => `${value[0].toUpperCase()}${value.slice(1)}`;
|
|
14237
14305
|
|
|
14238
14306
|
// src/legacy/layout/icon/DynamicIcon.tsx
|
|
14239
|
-
var
|
|
14307
|
+
var import_jsx_runtime69 = require("react/jsx-runtime");
|
|
14240
14308
|
function DynamicIcon2({ type }) {
|
|
14241
14309
|
if (isFlagIcon2(type)) {
|
|
14242
|
-
return /* @__PURE__ */ (0,
|
|
14310
|
+
return /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(FlagIcon2, { name: type });
|
|
14243
14311
|
}
|
|
14244
14312
|
if (isNamedIcon2(type)) {
|
|
14245
|
-
return /* @__PURE__ */ (0,
|
|
14313
|
+
return /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(NamedIcon2, { name: type });
|
|
14246
14314
|
}
|
|
14247
14315
|
return null;
|
|
14248
14316
|
}
|
|
@@ -14252,17 +14320,17 @@ function isValidIconName(name) {
|
|
|
14252
14320
|
var DynamicIcon_default2 = DynamicIcon2;
|
|
14253
14321
|
|
|
14254
14322
|
// src/legacy/layout/utils/getNavigationOptionMedia.tsx
|
|
14255
|
-
var
|
|
14323
|
+
var import_jsx_runtime70 = require("react/jsx-runtime");
|
|
14256
14324
|
var getNavigationOptionMedia = ({ icon, image }) => {
|
|
14257
14325
|
if (icon == null ? void 0 : icon.name) {
|
|
14258
|
-
return /* @__PURE__ */ (0,
|
|
14326
|
+
return /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(import_components40.Avatar, { type: import_components40.AvatarType.ICON, children: /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(DynamicIcon_default2, { type: icon.name }) });
|
|
14259
14327
|
}
|
|
14260
14328
|
if (icon == null ? void 0 : icon.text) {
|
|
14261
|
-
return /* @__PURE__ */ (0,
|
|
14329
|
+
return /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(import_components40.Avatar, { type: import_components40.AvatarType.INITIALS, children: icon.text });
|
|
14262
14330
|
}
|
|
14263
14331
|
if (image == null ? void 0 : image.url) {
|
|
14264
14332
|
const { url, text } = image;
|
|
14265
|
-
return /* @__PURE__ */ (0,
|
|
14333
|
+
return /* @__PURE__ */ (0, import_jsx_runtime70.jsx)("img", { src: url, alt: text });
|
|
14266
14334
|
}
|
|
14267
14335
|
return null;
|
|
14268
14336
|
};
|
|
@@ -14298,10 +14366,10 @@ var getTextAlignment2 = (align) => {
|
|
|
14298
14366
|
var getTextAlignmentAndMargin2 = (component) => `${getTextAlignment2(component.align)} ${getMargin2(component.margin)}`;
|
|
14299
14367
|
|
|
14300
14368
|
// src/legacy/layout/alert/DynamicAlert.tsx
|
|
14301
|
-
var
|
|
14369
|
+
var import_jsx_runtime71 = require("react/jsx-runtime");
|
|
14302
14370
|
var DynamicAlert = (props) => {
|
|
14303
14371
|
const alert = props.component;
|
|
14304
|
-
return /* @__PURE__ */ (0,
|
|
14372
|
+
return /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(
|
|
14305
14373
|
import_components41.Alert,
|
|
14306
14374
|
{
|
|
14307
14375
|
type: mapContextToAlertType(legacy_mapContext(alert.context)),
|
|
@@ -14334,12 +14402,12 @@ var mapContextToAlertType = (context) => {
|
|
|
14334
14402
|
var DynamicAlert_default = DynamicAlert;
|
|
14335
14403
|
|
|
14336
14404
|
// src/legacy/layout/box/DynamicBox.tsx
|
|
14337
|
-
var
|
|
14405
|
+
var import_jsx_runtime72 = require("react/jsx-runtime");
|
|
14338
14406
|
var DynamicBox = (props) => {
|
|
14339
14407
|
const box = props.component;
|
|
14340
14408
|
const margin = getMargin2(box.margin || box.border ? "lg" : "xs");
|
|
14341
14409
|
if (!box.width || box.width === "xl") {
|
|
14342
|
-
return /* @__PURE__ */ (0,
|
|
14410
|
+
return /* @__PURE__ */ (0, import_jsx_runtime72.jsx)("div", { className: margin + getBorderClass(box.border), children: /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(
|
|
14343
14411
|
DynamicLayout_default,
|
|
14344
14412
|
{
|
|
14345
14413
|
components: box.components,
|
|
@@ -14352,7 +14420,7 @@ var DynamicBox = (props) => {
|
|
|
14352
14420
|
}
|
|
14353
14421
|
) });
|
|
14354
14422
|
}
|
|
14355
|
-
return /* @__PURE__ */ (0,
|
|
14423
|
+
return /* @__PURE__ */ (0, import_jsx_runtime72.jsx)("div", { className: "row", children: /* @__PURE__ */ (0, import_jsx_runtime72.jsx)("div", { className: margin + getBoxWidthClasses(box), children: /* @__PURE__ */ (0, import_jsx_runtime72.jsx)("div", { className: getBorderClass(box.border), children: /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(
|
|
14356
14424
|
DynamicLayout_default,
|
|
14357
14425
|
{
|
|
14358
14426
|
components: box.components,
|
|
@@ -14436,7 +14504,7 @@ var getButtonSize = (size) => {
|
|
|
14436
14504
|
};
|
|
14437
14505
|
|
|
14438
14506
|
// src/legacy/layout/button/DynamicButton.tsx
|
|
14439
|
-
var
|
|
14507
|
+
var import_jsx_runtime73 = require("react/jsx-runtime");
|
|
14440
14508
|
function DynamicButton(props) {
|
|
14441
14509
|
var _a;
|
|
14442
14510
|
const { component, onAction } = props;
|
|
@@ -14445,7 +14513,7 @@ function DynamicButton(props) {
|
|
|
14445
14513
|
const priority = getButtonPriority(component);
|
|
14446
14514
|
const { loading } = useDynamicFlow();
|
|
14447
14515
|
const className = getMargin2(component.margin || "md");
|
|
14448
|
-
return /* @__PURE__ */ (0,
|
|
14516
|
+
return /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(
|
|
14449
14517
|
import_components42.Button,
|
|
14450
14518
|
{
|
|
14451
14519
|
size: getButtonSize(component.size),
|
|
@@ -14462,12 +14530,12 @@ function DynamicButton(props) {
|
|
|
14462
14530
|
var DynamicButton_default = DynamicButton;
|
|
14463
14531
|
|
|
14464
14532
|
// src/legacy/layout/columns/DynamicColumns.tsx
|
|
14465
|
-
var
|
|
14533
|
+
var import_jsx_runtime74 = require("react/jsx-runtime");
|
|
14466
14534
|
var DynamicColumns = (props) => {
|
|
14467
14535
|
const columns = props.component;
|
|
14468
14536
|
const { leftWidth, rightWidth } = getWidth(columns.bias);
|
|
14469
|
-
return /* @__PURE__ */ (0,
|
|
14470
|
-
/* @__PURE__ */ (0,
|
|
14537
|
+
return /* @__PURE__ */ (0, import_jsx_runtime74.jsxs)("div", { className: `${getMargin2(columns.margin || "xs")} row`, children: [
|
|
14538
|
+
/* @__PURE__ */ (0, import_jsx_runtime74.jsx)("div", { className: `${leftWidth} m-b-0`, children: /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(
|
|
14471
14539
|
DynamicLayout_default,
|
|
14472
14540
|
{
|
|
14473
14541
|
components: columns.left,
|
|
@@ -14479,7 +14547,7 @@ var DynamicColumns = (props) => {
|
|
|
14479
14547
|
onPersistAsync: props.onPersistAsync
|
|
14480
14548
|
}
|
|
14481
14549
|
) }),
|
|
14482
|
-
/* @__PURE__ */ (0,
|
|
14550
|
+
/* @__PURE__ */ (0, import_jsx_runtime74.jsx)("div", { className: `${rightWidth} m-b-0`, children: /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(
|
|
14483
14551
|
DynamicLayout_default,
|
|
14484
14552
|
{
|
|
14485
14553
|
components: columns.right,
|
|
@@ -14515,37 +14583,41 @@ var DynamicColumns_default = DynamicColumns;
|
|
|
14515
14583
|
|
|
14516
14584
|
// src/legacy/layout/decision/DynamicDecision.tsx
|
|
14517
14585
|
var import_components43 = require("@transferwise/components");
|
|
14518
|
-
var
|
|
14586
|
+
var import_jsx_runtime75 = require("react/jsx-runtime");
|
|
14519
14587
|
function DynamicDecision({ component, onAction }) {
|
|
14520
14588
|
const { loading } = useDynamicFlow();
|
|
14521
|
-
|
|
14522
|
-
|
|
14523
|
-
{
|
|
14524
|
-
|
|
14525
|
-
|
|
14526
|
-
|
|
14527
|
-
|
|
14528
|
-
|
|
14529
|
-
|
|
14530
|
-
|
|
14531
|
-
|
|
14532
|
-
|
|
14533
|
-
|
|
14589
|
+
const { margin, options, title } = component;
|
|
14590
|
+
return /* @__PURE__ */ (0, import_jsx_runtime75.jsxs)("div", { className: getMargin2(margin), children: [
|
|
14591
|
+
title && /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(import_components43.Header, { as: "h2", title }),
|
|
14592
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)(import_components43.NavigationOptionsList, { children: options.map((option) => /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
|
|
14593
|
+
import_components43.NavigationOption,
|
|
14594
|
+
{
|
|
14595
|
+
title: option.title,
|
|
14596
|
+
content: option.description,
|
|
14597
|
+
disabled: loading || option.disabled,
|
|
14598
|
+
media: getNavigationOptionMedia(option),
|
|
14599
|
+
showMediaCircle: false,
|
|
14600
|
+
showMediaAtAllSizes: true,
|
|
14601
|
+
onClick: () => onAction(option.action)
|
|
14602
|
+
},
|
|
14603
|
+
JSON.stringify(option)
|
|
14604
|
+
)) })
|
|
14605
|
+
] });
|
|
14534
14606
|
}
|
|
14535
14607
|
var DynamicDecision_default = DynamicDecision;
|
|
14536
14608
|
|
|
14537
14609
|
// src/legacy/layout/divider/DynamicDivider.tsx
|
|
14538
|
-
var
|
|
14610
|
+
var import_jsx_runtime76 = require("react/jsx-runtime");
|
|
14539
14611
|
var DynamicDivider = ({ component }) => {
|
|
14540
14612
|
const margin = getMargin2(component.margin);
|
|
14541
14613
|
const className = `m-t-0 ${margin}`;
|
|
14542
|
-
return /* @__PURE__ */ (0,
|
|
14614
|
+
return /* @__PURE__ */ (0, import_jsx_runtime76.jsx)("hr", { className });
|
|
14543
14615
|
};
|
|
14544
14616
|
var DynamicDivider_default = DynamicDivider;
|
|
14545
14617
|
|
|
14546
14618
|
// src/legacy/layout/external/DynamicExternal.tsx
|
|
14547
14619
|
var import_components44 = require("@transferwise/components");
|
|
14548
|
-
var
|
|
14620
|
+
var import_react32 = require("react");
|
|
14549
14621
|
var import_react_intl20 = require("react-intl");
|
|
14550
14622
|
|
|
14551
14623
|
// src/legacy/layout/external/DynamicExternal.messages.ts
|
|
@@ -14559,37 +14631,37 @@ var DynamicExternal_messages_default = (0, import_react_intl19.defineMessages)({
|
|
|
14559
14631
|
});
|
|
14560
14632
|
|
|
14561
14633
|
// src/legacy/layout/external/DynamicExternal.tsx
|
|
14562
|
-
var
|
|
14634
|
+
var import_jsx_runtime77 = require("react/jsx-runtime");
|
|
14563
14635
|
var DynamicExternal = ({ component, onAction }) => {
|
|
14564
14636
|
const { requestUrl, responseHandlers, polling, retryTitle } = component;
|
|
14565
14637
|
const intl = (0, import_react_intl20.useIntl)();
|
|
14566
|
-
const openExternalUrl = (0,
|
|
14638
|
+
const openExternalUrl = (0, import_react32.useCallback)(
|
|
14567
14639
|
() => window.open(requestUrl, "df-external-window"),
|
|
14568
14640
|
[requestUrl]
|
|
14569
14641
|
);
|
|
14570
|
-
(0,
|
|
14642
|
+
(0, import_react32.useEffect)(() => {
|
|
14571
14643
|
openExternalUrl();
|
|
14572
14644
|
}, [openExternalUrl]);
|
|
14573
14645
|
const pollingConfiguration = polling && responseHandlers ? __spreadProps(__spreadValues({}, polling), {
|
|
14574
14646
|
responseHandlers
|
|
14575
14647
|
}) : void 0;
|
|
14576
14648
|
useExternalStepPolling(pollingConfiguration, onAction);
|
|
14577
|
-
return /* @__PURE__ */ (0,
|
|
14578
|
-
/* @__PURE__ */ (0,
|
|
14579
|
-
/* @__PURE__ */ (0,
|
|
14580
|
-
/* @__PURE__ */ (0,
|
|
14649
|
+
return /* @__PURE__ */ (0, import_jsx_runtime77.jsxs)(import_jsx_runtime77.Fragment, { children: [
|
|
14650
|
+
/* @__PURE__ */ (0, import_jsx_runtime77.jsx)(import_components44.Loader, { size: import_components44.Size.LARGE, classNames: { "tw-loader": "tw-loader m-x-auto" } }),
|
|
14651
|
+
/* @__PURE__ */ (0, import_jsx_runtime77.jsx)("br", {}),
|
|
14652
|
+
/* @__PURE__ */ (0, import_jsx_runtime77.jsx)(import_components44.Button, { priority: "tertiary", block: true, onClick: openExternalUrl, children: retryTitle || intl.formatMessage(DynamicExternal_messages_default.retryTitle) })
|
|
14581
14653
|
] });
|
|
14582
14654
|
};
|
|
14583
14655
|
var DynamicExternal_default = DynamicExternal;
|
|
14584
14656
|
|
|
14585
14657
|
// src/legacy/jsonSchemaForm/genericSchema/GenericSchema.tsx
|
|
14586
|
-
var
|
|
14658
|
+
var import_react46 = require("react");
|
|
14587
14659
|
|
|
14588
14660
|
// src/legacy/jsonSchemaForm/allOfSchema/AllOfSchema.tsx
|
|
14589
14661
|
var import_components45 = require("@transferwise/components");
|
|
14590
14662
|
var import_classnames6 = __toESM(require_classnames());
|
|
14591
|
-
var
|
|
14592
|
-
var
|
|
14663
|
+
var import_react33 = require("react");
|
|
14664
|
+
var import_jsx_runtime78 = require("react/jsx-runtime");
|
|
14593
14665
|
var splitModel = (model, schemas) => schemas.map((schema) => getValidObjectModelParts(model, schema) || {});
|
|
14594
14666
|
var combineModels = (models) => models.reduce((current, combined) => __spreadValues(__spreadValues({}, combined), current), {});
|
|
14595
14667
|
var getSchemaColumnClasses = (width) => ({
|
|
@@ -14604,13 +14676,13 @@ function AllOfSchema(props) {
|
|
|
14604
14676
|
setModels(models);
|
|
14605
14677
|
props.onChange(__spreadProps(__spreadValues({}, onChangeProps), { model: combineModels(models) }));
|
|
14606
14678
|
};
|
|
14607
|
-
const [models, setModels] = (0,
|
|
14608
|
-
return /* @__PURE__ */ (0,
|
|
14609
|
-
props.schema.title && /* @__PURE__ */ (0,
|
|
14610
|
-
props.schema.description && /* @__PURE__ */ (0,
|
|
14611
|
-
/* @__PURE__ */ (0,
|
|
14679
|
+
const [models, setModels] = (0, import_react33.useState)(splitModel(props.model, props.schema.allOf));
|
|
14680
|
+
return /* @__PURE__ */ (0, import_jsx_runtime78.jsxs)(import_jsx_runtime78.Fragment, { children: [
|
|
14681
|
+
props.schema.title && /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(import_components45.Header, { title: props.schema.title }),
|
|
14682
|
+
props.schema.description && /* @__PURE__ */ (0, import_jsx_runtime78.jsx)("p", { children: props.schema.description }),
|
|
14683
|
+
/* @__PURE__ */ (0, import_jsx_runtime78.jsx)("div", { className: "row", children: props.schema.allOf.map((schema, index) => (
|
|
14612
14684
|
// eslint-disable-next-line react/no-array-index-key
|
|
14613
|
-
/* @__PURE__ */ (0,
|
|
14685
|
+
/* @__PURE__ */ (0, import_jsx_runtime78.jsx)("div", { className: (0, import_classnames6.default)(getSchemaColumnClasses(schema.width)), children: /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
|
|
14614
14686
|
GenericSchema_default,
|
|
14615
14687
|
{
|
|
14616
14688
|
schema,
|
|
@@ -14636,13 +14708,13 @@ var AllOfSchema_default = AllOfSchema;
|
|
|
14636
14708
|
// src/legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/MultipleFileUploadSchema.tsx
|
|
14637
14709
|
var import_components47 = require("@transferwise/components");
|
|
14638
14710
|
var import_classnames7 = __toESM(require_classnames());
|
|
14639
|
-
var
|
|
14711
|
+
var import_react34 = require("react");
|
|
14640
14712
|
|
|
14641
14713
|
// src/legacy/jsonSchemaForm/controlFeedback/ControlFeedback.tsx
|
|
14642
14714
|
var import_components46 = require("@transferwise/components");
|
|
14643
14715
|
var import_formatting2 = require("@transferwise/formatting");
|
|
14644
14716
|
var import_react_intl21 = require("react-intl");
|
|
14645
|
-
var
|
|
14717
|
+
var import_jsx_runtime79 = require("react/jsx-runtime");
|
|
14646
14718
|
function ControlFeedback(props) {
|
|
14647
14719
|
var _a;
|
|
14648
14720
|
const defaultValidationMessages = useDefaultValidationMessages(props.schema);
|
|
@@ -14651,12 +14723,12 @@ function ControlFeedback(props) {
|
|
|
14651
14723
|
const isValidationVisible = !isErrorVisible && (props.submitted || props.changed && props.blurred) && Boolean((_a = props.validations) == null ? void 0 : _a.length);
|
|
14652
14724
|
const isDescriptionVisible = props.schema.type !== "boolean" && props.schema.description && !isErrorVisible && !isValidationVisible;
|
|
14653
14725
|
const hasInfoMessage = Boolean(props.infoMessage);
|
|
14654
|
-
return /* @__PURE__ */ (0,
|
|
14655
|
-
isErrorVisible ? /* @__PURE__ */ (0,
|
|
14656
|
-
isValidationVisible ? /* @__PURE__ */ (0,
|
|
14657
|
-
(isDescriptionVisible || hasInfoMessage) && /* @__PURE__ */ (0,
|
|
14658
|
-
isDescriptionVisible && /* @__PURE__ */ (0,
|
|
14659
|
-
hasInfoMessage && /* @__PURE__ */ (0,
|
|
14726
|
+
return /* @__PURE__ */ (0, import_jsx_runtime79.jsxs)("div", { id: props.id, children: [
|
|
14727
|
+
isErrorVisible ? /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(import_components46.InlineAlert, { type: "error", children: props.errors }) : null,
|
|
14728
|
+
isValidationVisible ? /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(import_components46.InlineAlert, { type: "error", children: props.validations.map((validation) => /* @__PURE__ */ (0, import_jsx_runtime79.jsx)("div", { children: validationMessages[validation] }, validation)) }) : null,
|
|
14729
|
+
(isDescriptionVisible || hasInfoMessage) && /* @__PURE__ */ (0, import_jsx_runtime79.jsxs)(import_components46.InlineAlert, { type: "info", children: [
|
|
14730
|
+
isDescriptionVisible && /* @__PURE__ */ (0, import_jsx_runtime79.jsx)("div", { children: props.schema.description }),
|
|
14731
|
+
hasInfoMessage && /* @__PURE__ */ (0, import_jsx_runtime79.jsx)("div", { children: props.infoMessage })
|
|
14660
14732
|
] })
|
|
14661
14733
|
] });
|
|
14662
14734
|
}
|
|
@@ -14782,15 +14854,15 @@ function useFormattedDefaultErrorMessages({
|
|
|
14782
14854
|
}
|
|
14783
14855
|
|
|
14784
14856
|
// src/legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/MultipleFileUploadSchema.tsx
|
|
14785
|
-
var
|
|
14857
|
+
var import_jsx_runtime80 = require("react/jsx-runtime");
|
|
14786
14858
|
function MultipleFileUploadSchema(props) {
|
|
14787
14859
|
var _a, _b;
|
|
14788
14860
|
const { onChange, schema } = props;
|
|
14789
14861
|
const onEvent = useEventDispatcher();
|
|
14790
14862
|
const defaultErrorMessages = useFormattedDefaultErrorMessages(schema);
|
|
14791
|
-
const uid = (0,
|
|
14792
|
-
const [inputChanged, setInputChanged] = (0,
|
|
14793
|
-
const [files, setFiles] = (0,
|
|
14863
|
+
const uid = (0, import_react34.useMemo)(() => schema.$id || generateRandomId(), [schema.$id]);
|
|
14864
|
+
const [inputChanged, setInputChanged] = (0, import_react34.useState)(false);
|
|
14865
|
+
const [files, setFiles] = (0, import_react34.useState)(() => convertFileIdsToComponentFileObjects(props.model || []));
|
|
14794
14866
|
const performPersistAsync = usePersistAsync(schema.items.persistAsync);
|
|
14795
14867
|
const fileSchemaDescriptor = schema.items.persistAsync.schema;
|
|
14796
14868
|
const isBlob = isBlobSchema2(fileSchemaDescriptor);
|
|
@@ -14844,10 +14916,10 @@ function MultipleFileUploadSchema(props) {
|
|
|
14844
14916
|
onDeleteFile: () => Promise.resolve()
|
|
14845
14917
|
});
|
|
14846
14918
|
const feedbackId = `${uid}-feedback`;
|
|
14847
|
-
return /* @__PURE__ */ (0,
|
|
14848
|
-
/* @__PURE__ */ (0,
|
|
14849
|
-
/* @__PURE__ */ (0,
|
|
14850
|
-
/* @__PURE__ */ (0,
|
|
14919
|
+
return /* @__PURE__ */ (0, import_jsx_runtime80.jsxs)("div", { className: (0, import_classnames7.default)("form-group", { "has-error": showError }), children: [
|
|
14920
|
+
/* @__PURE__ */ (0, import_jsx_runtime80.jsx)("label", { className: "d-block control-label", htmlFor: uid, children: props.schema.title }),
|
|
14921
|
+
/* @__PURE__ */ (0, import_jsx_runtime80.jsx)("div", { "aria-describedby": feedbackId, children: /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(import_components47.UploadInput, __spreadValues({}, uploadInputProps)) }),
|
|
14922
|
+
/* @__PURE__ */ (0, import_jsx_runtime80.jsx)(
|
|
14851
14923
|
ControlFeedback_default,
|
|
14852
14924
|
{
|
|
14853
14925
|
id: feedbackId,
|
|
@@ -14890,12 +14962,12 @@ function getValidationMessages(schema, required, defaultErrorMessages) {
|
|
|
14890
14962
|
// src/legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multiSelectSchema/MultiSelectSchema.tsx
|
|
14891
14963
|
var import_components49 = require("@transferwise/components");
|
|
14892
14964
|
var import_classnames8 = __toESM(require_classnames());
|
|
14893
|
-
var
|
|
14965
|
+
var import_react35 = require("react");
|
|
14894
14966
|
var import_react_intl25 = require("react-intl");
|
|
14895
14967
|
|
|
14896
14968
|
// src/legacy/jsonSchemaForm/schemaFormControl/utils/mapping-utils.tsx
|
|
14897
14969
|
var import_components48 = require("@transferwise/components");
|
|
14898
|
-
var
|
|
14970
|
+
var import_jsx_runtime81 = require("react/jsx-runtime");
|
|
14899
14971
|
var mapConstSchemaToOption = (schema, controlType) => {
|
|
14900
14972
|
switch (controlType) {
|
|
14901
14973
|
case "select":
|
|
@@ -14919,7 +14991,7 @@ var mapKeywordsToSearchStrings = (searchStrings) => isArray2(searchStrings) ? {
|
|
|
14919
14991
|
var mapImage = (image) => {
|
|
14920
14992
|
if (image == null ? void 0 : image.url) {
|
|
14921
14993
|
return {
|
|
14922
|
-
icon: /* @__PURE__ */ (0,
|
|
14994
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime81.jsx)("div", { className: "media", children: /* @__PURE__ */ (0, import_jsx_runtime81.jsx)("div", { className: "np-option__no-media-circle", children: /* @__PURE__ */ (0, import_jsx_runtime81.jsx)("img", { src: image.url, alt: image.name || "" }) }) }),
|
|
14923
14995
|
hideIconInTrigger: true
|
|
14924
14996
|
};
|
|
14925
14997
|
}
|
|
@@ -14928,17 +15000,17 @@ var mapImage = (image) => {
|
|
|
14928
15000
|
var getIconPropertyForSelectOption = (icon) => {
|
|
14929
15001
|
if ((icon == null ? void 0 : icon.name) && isFlagIcon2(icon.name)) {
|
|
14930
15002
|
return {
|
|
14931
|
-
icon: /* @__PURE__ */ (0,
|
|
15003
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(Flag, { code: icon.name.substring(5), intrinsicSize: 24 })
|
|
14932
15004
|
};
|
|
14933
15005
|
}
|
|
14934
15006
|
if ((icon == null ? void 0 : icon.name) && isValidIconName(icon.name)) {
|
|
14935
15007
|
return {
|
|
14936
|
-
icon: /* @__PURE__ */ (0,
|
|
15008
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(DynamicIcon_default2, { type: icon.name })
|
|
14937
15009
|
};
|
|
14938
15010
|
}
|
|
14939
15011
|
if (icon == null ? void 0 : icon.text) {
|
|
14940
15012
|
return {
|
|
14941
|
-
icon: /* @__PURE__ */ (0,
|
|
15013
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime81.jsx)("span", { children: icon.text })
|
|
14942
15014
|
};
|
|
14943
15015
|
}
|
|
14944
15016
|
return null;
|
|
@@ -14946,17 +15018,17 @@ var getIconPropertyForSelectOption = (icon) => {
|
|
|
14946
15018
|
var getAvatarPropertyForRadioOption = ({ image, icon }) => {
|
|
14947
15019
|
if (image == null ? void 0 : image.url) {
|
|
14948
15020
|
return {
|
|
14949
|
-
avatar: /* @__PURE__ */ (0,
|
|
15021
|
+
avatar: /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(import_components48.Avatar, { type: import_components48.AvatarType.THUMBNAIL, children: /* @__PURE__ */ (0, import_jsx_runtime81.jsx)("img", { src: image.url, alt: "" }) })
|
|
14950
15022
|
};
|
|
14951
15023
|
}
|
|
14952
15024
|
if ((icon == null ? void 0 : icon.name) && isValidIconName(icon.name)) {
|
|
14953
15025
|
return {
|
|
14954
|
-
avatar: /* @__PURE__ */ (0,
|
|
15026
|
+
avatar: /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(import_components48.Avatar, { type: import_components48.AvatarType.ICON, children: /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(DynamicIcon_default2, { type: icon.name }) })
|
|
14955
15027
|
};
|
|
14956
15028
|
}
|
|
14957
15029
|
if (icon == null ? void 0 : icon.text) {
|
|
14958
15030
|
return {
|
|
14959
|
-
avatar: /* @__PURE__ */ (0,
|
|
15031
|
+
avatar: /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(import_components48.Avatar, { type: import_components48.AvatarType.INITIALS, children: icon.text })
|
|
14960
15032
|
};
|
|
14961
15033
|
}
|
|
14962
15034
|
return null;
|
|
@@ -14995,7 +15067,7 @@ var multi_select_messages_default2 = (0, import_react_intl24.defineMessages)({
|
|
|
14995
15067
|
});
|
|
14996
15068
|
|
|
14997
15069
|
// src/legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multiSelectSchema/MultiSelectSchema.tsx
|
|
14998
|
-
var
|
|
15070
|
+
var import_jsx_runtime82 = require("react/jsx-runtime");
|
|
14999
15071
|
function MultiSelectSchema({
|
|
15000
15072
|
schema,
|
|
15001
15073
|
model,
|
|
@@ -15007,10 +15079,10 @@ function MultiSelectSchema({
|
|
|
15007
15079
|
const { formatMessage, locale } = (0, import_react_intl25.useIntl)();
|
|
15008
15080
|
const { disabled, items, validationMessages, placeholder } = schema;
|
|
15009
15081
|
const options = items.oneOf.map((item) => mapConstSchemaToOption(item, "select"));
|
|
15010
|
-
const id = (0,
|
|
15011
|
-
const [changed, setChanged] = (0,
|
|
15012
|
-
const [selected, setSelected] = (0,
|
|
15013
|
-
(0,
|
|
15082
|
+
const id = (0, import_react35.useMemo)(() => schema.$id || generateRandomId(), [schema.$id]);
|
|
15083
|
+
const [changed, setChanged] = (0, import_react35.useState)(false);
|
|
15084
|
+
const [selected, setSelected] = (0, import_react35.useState)(getInitialModelIndices2(model, options));
|
|
15085
|
+
(0, import_react35.useEffect)(
|
|
15014
15086
|
() => {
|
|
15015
15087
|
if (selected) {
|
|
15016
15088
|
broadcastModelChange(selected);
|
|
@@ -15047,9 +15119,9 @@ function MultiSelectSchema({
|
|
|
15047
15119
|
const formGroupClasses = {
|
|
15048
15120
|
"has-error": shouldShowInitialError || shouldShowValidationError
|
|
15049
15121
|
};
|
|
15050
|
-
return /* @__PURE__ */ (0,
|
|
15051
|
-
schema.title ? /* @__PURE__ */ (0,
|
|
15052
|
-
/* @__PURE__ */ (0,
|
|
15122
|
+
return /* @__PURE__ */ (0, import_jsx_runtime82.jsxs)("div", { className: (0, import_classnames8.default)("d-flex flex-column", formGroupClasses), children: [
|
|
15123
|
+
schema.title ? /* @__PURE__ */ (0, import_jsx_runtime82.jsx)("label", { htmlFor: id, children: schema.title }) : void 0,
|
|
15124
|
+
/* @__PURE__ */ (0, import_jsx_runtime82.jsx)(
|
|
15053
15125
|
import_components49.SelectInput,
|
|
15054
15126
|
{
|
|
15055
15127
|
id,
|
|
@@ -15075,12 +15147,12 @@ function MultiSelectSchema({
|
|
|
15075
15147
|
if (withinTrigger) {
|
|
15076
15148
|
return selected && index === selected[0] ? getFormattedMessage() : void 0;
|
|
15077
15149
|
}
|
|
15078
|
-
return /* @__PURE__ */ (0,
|
|
15150
|
+
return /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(import_components49.SelectInputOptionContent, { title: label, note: note != null ? note : secondary, icon });
|
|
15079
15151
|
},
|
|
15080
15152
|
onChange: broadcastModelChange
|
|
15081
15153
|
}
|
|
15082
15154
|
),
|
|
15083
|
-
/* @__PURE__ */ (0,
|
|
15155
|
+
/* @__PURE__ */ (0, import_jsx_runtime82.jsx)(
|
|
15084
15156
|
ControlFeedback_default,
|
|
15085
15157
|
{
|
|
15086
15158
|
id: `${id}-feedback`,
|
|
@@ -15107,14 +15179,14 @@ var getInitialModelIndices2 = (model, options) => {
|
|
|
15107
15179
|
// src/legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/repeatableSchema/RepeatableSchema.tsx
|
|
15108
15180
|
var import_components51 = require("@transferwise/components");
|
|
15109
15181
|
var import_icons4 = require("@transferwise/icons");
|
|
15110
|
-
var
|
|
15182
|
+
var import_react37 = require("react");
|
|
15111
15183
|
var import_react_intl28 = require("react-intl");
|
|
15112
15184
|
|
|
15113
15185
|
// src/legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/repeatableSchema/ItemSummary.tsx
|
|
15114
15186
|
var import_components50 = require("@transferwise/components");
|
|
15115
|
-
var
|
|
15187
|
+
var import_jsx_runtime83 = require("react/jsx-runtime");
|
|
15116
15188
|
function ItemSummaryOption2({ item, onClick }) {
|
|
15117
|
-
return /* @__PURE__ */ (0,
|
|
15189
|
+
return /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(
|
|
15118
15190
|
import_components50.NavigationOption,
|
|
15119
15191
|
{
|
|
15120
15192
|
media: getNavigationOptionMedia(item),
|
|
@@ -15152,9 +15224,9 @@ var repeatable_messages_default2 = (0, import_react_intl26.defineMessages)({
|
|
|
15152
15224
|
});
|
|
15153
15225
|
|
|
15154
15226
|
// src/legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/repeatableSchema/RepeatableSchemaStep.tsx
|
|
15155
|
-
var
|
|
15227
|
+
var import_react36 = require("react");
|
|
15156
15228
|
var import_react_intl27 = require("react-intl");
|
|
15157
|
-
var
|
|
15229
|
+
var import_jsx_runtime84 = require("react/jsx-runtime");
|
|
15158
15230
|
function RepeatableSchemaStep({
|
|
15159
15231
|
type,
|
|
15160
15232
|
schema,
|
|
@@ -15165,7 +15237,7 @@ function RepeatableSchemaStep({
|
|
|
15165
15237
|
onAction
|
|
15166
15238
|
}) {
|
|
15167
15239
|
const { formatMessage } = (0, import_react_intl27.useIntl)();
|
|
15168
|
-
const [filename, setFilename] = (0,
|
|
15240
|
+
const [filename, setFilename] = (0, import_react36.useState)(void 0);
|
|
15169
15241
|
const step = {
|
|
15170
15242
|
layout: [
|
|
15171
15243
|
{
|
|
@@ -15202,7 +15274,7 @@ function RepeatableSchemaStep({
|
|
|
15202
15274
|
}
|
|
15203
15275
|
onModelChange(__spreadProps(__spreadValues({}, modelChangeProps), { model: model2 }));
|
|
15204
15276
|
};
|
|
15205
|
-
return /* @__PURE__ */ (0,
|
|
15277
|
+
return /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(
|
|
15206
15278
|
DynamicFlowStep,
|
|
15207
15279
|
{
|
|
15208
15280
|
step,
|
|
@@ -15408,7 +15480,7 @@ var schemaSummaryProvides = (summary, providesProp) => (
|
|
|
15408
15480
|
|
|
15409
15481
|
// src/legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/repeatableSchema/RepeatableSchema.tsx
|
|
15410
15482
|
var import_classnames9 = __toESM(require_classnames());
|
|
15411
|
-
var
|
|
15483
|
+
var import_jsx_runtime85 = require("react/jsx-runtime");
|
|
15412
15484
|
function RepeatableSchema({
|
|
15413
15485
|
schema,
|
|
15414
15486
|
model,
|
|
@@ -15418,9 +15490,9 @@ function RepeatableSchema({
|
|
|
15418
15490
|
onChange
|
|
15419
15491
|
}) {
|
|
15420
15492
|
var _a;
|
|
15421
|
-
const [openModalType, setOpenModalType] = (0,
|
|
15422
|
-
const [changed, setChanged] = (0,
|
|
15423
|
-
const [itemSummaries, setItemSummaries] = (0,
|
|
15493
|
+
const [openModalType, setOpenModalType] = (0, import_react37.useState)(null);
|
|
15494
|
+
const [changed, setChanged] = (0, import_react37.useState)(false);
|
|
15495
|
+
const [itemSummaries, setItemSummaries] = (0, import_react37.useState)(() => {
|
|
15424
15496
|
if (isObject2(model) && !isArray2(model)) {
|
|
15425
15497
|
throw new Error(
|
|
15426
15498
|
"RepeatableSchema does not support object models. Ensure your array schema is wrapped inside an object schema."
|
|
@@ -15428,8 +15500,8 @@ function RepeatableSchema({
|
|
|
15428
15500
|
}
|
|
15429
15501
|
return model ? model.map((item) => getItemSummaryFromSchema(schema.items, item, schema == null ? void 0 : schema.summary)) : null;
|
|
15430
15502
|
});
|
|
15431
|
-
const [editableItem, setEditableItem] = (0,
|
|
15432
|
-
const id = (0,
|
|
15503
|
+
const [editableItem, setEditableItem] = (0, import_react37.useState)({ item: null, model: null });
|
|
15504
|
+
const id = (0, import_react37.useMemo)(() => schema.$id || generateRandomId(), [schema.$id]);
|
|
15433
15505
|
const broadcastModelChange = (updatedItems) => {
|
|
15434
15506
|
const updatedModel = updatedItems ? updatedItems.map(({ value }) => value) : null;
|
|
15435
15507
|
onChange({
|
|
@@ -15485,9 +15557,9 @@ function RepeatableSchema({
|
|
|
15485
15557
|
const formGroupClasses = {
|
|
15486
15558
|
"has-error": (_a = errors && !isEmpty(errors)) != null ? _a : submitted && validations.length
|
|
15487
15559
|
};
|
|
15488
|
-
return /* @__PURE__ */ (0,
|
|
15489
|
-
schema.title && /* @__PURE__ */ (0,
|
|
15490
|
-
itemSummaries == null ? void 0 : itemSummaries.map((itemSummary) => /* @__PURE__ */ (0,
|
|
15560
|
+
return /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)("div", { id, className: (0, import_classnames9.default)(formGroupClasses), children: [
|
|
15561
|
+
schema.title && /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(import_components51.Header, { title: schema.title }),
|
|
15562
|
+
itemSummaries == null ? void 0 : itemSummaries.map((itemSummary) => /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
|
|
15491
15563
|
ItemSummaryOption2,
|
|
15492
15564
|
{
|
|
15493
15565
|
item: itemSummary,
|
|
@@ -15495,21 +15567,21 @@ function RepeatableSchema({
|
|
|
15495
15567
|
},
|
|
15496
15568
|
JSON.stringify(itemSummary)
|
|
15497
15569
|
)),
|
|
15498
|
-
/* @__PURE__ */ (0,
|
|
15570
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
|
|
15499
15571
|
import_components51.NavigationOption,
|
|
15500
15572
|
{
|
|
15501
|
-
media: /* @__PURE__ */ (0,
|
|
15573
|
+
media: /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(import_icons4.Plus, {}),
|
|
15502
15574
|
title: schema.addItemTitle || formatMessage(repeatable_messages_default2.addItemTitle),
|
|
15503
15575
|
showMediaAtAllSizes: true,
|
|
15504
15576
|
onClick: onAddItem
|
|
15505
15577
|
}
|
|
15506
15578
|
),
|
|
15507
|
-
/* @__PURE__ */ (0,
|
|
15579
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
|
|
15508
15580
|
import_components51.Modal,
|
|
15509
15581
|
{
|
|
15510
15582
|
open: openModalType !== null,
|
|
15511
15583
|
title: (openModalType === "add" ? schema.addItemTitle : schema.editItemTitle) || formatMessage(repeatable_messages_default2.addItemTitle),
|
|
15512
|
-
body: /* @__PURE__ */ (0,
|
|
15584
|
+
body: /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
|
|
15513
15585
|
RepeatableSchemaStep_default,
|
|
15514
15586
|
{
|
|
15515
15587
|
type: openModalType != null ? openModalType : "add",
|
|
@@ -15524,7 +15596,7 @@ function RepeatableSchema({
|
|
|
15524
15596
|
onClose: onCancelEdit
|
|
15525
15597
|
}
|
|
15526
15598
|
),
|
|
15527
|
-
/* @__PURE__ */ (0,
|
|
15599
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
|
|
15528
15600
|
ControlFeedback_default,
|
|
15529
15601
|
{
|
|
15530
15602
|
id: `${id}-feedback`,
|
|
@@ -15566,17 +15638,17 @@ var getUpdatedItemSummaries = (action, {
|
|
|
15566
15638
|
var RepeatableSchema_default = RepeatableSchema;
|
|
15567
15639
|
|
|
15568
15640
|
// src/legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/ArrayListSchema.tsx
|
|
15569
|
-
var
|
|
15641
|
+
var import_jsx_runtime86 = require("react/jsx-runtime");
|
|
15570
15642
|
function ArrayListSchema(props) {
|
|
15571
15643
|
const { schema } = props;
|
|
15572
15644
|
if (isMultipleFileUploadSchema(schema)) {
|
|
15573
|
-
return /* @__PURE__ */ (0,
|
|
15645
|
+
return /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(MultipleFileUploadSchema_default, __spreadProps(__spreadValues({}, props), { schema }));
|
|
15574
15646
|
}
|
|
15575
15647
|
if (isMultiSelectConstSchema(schema)) {
|
|
15576
|
-
return /* @__PURE__ */ (0,
|
|
15648
|
+
return /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(MultiSelectSchema, __spreadProps(__spreadValues({}, props), { schema }));
|
|
15577
15649
|
}
|
|
15578
15650
|
if (isListArraySchema(schema)) {
|
|
15579
|
-
return /* @__PURE__ */ (0,
|
|
15651
|
+
return /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(RepeatableSchema_default, __spreadProps(__spreadValues({}, props), { schema }));
|
|
15580
15652
|
}
|
|
15581
15653
|
throw new Error("Invalid array list schema");
|
|
15582
15654
|
}
|
|
@@ -15587,11 +15659,11 @@ ArrayListSchema.defaultProps = {
|
|
|
15587
15659
|
var ArrayListSchema_default = ArrayListSchema;
|
|
15588
15660
|
|
|
15589
15661
|
// src/legacy/jsonSchemaForm/arrayTypeSchema/ArraySchema.tsx
|
|
15590
|
-
var
|
|
15662
|
+
var import_jsx_runtime87 = require("react/jsx-runtime");
|
|
15591
15663
|
var ArraySchema = (props) => {
|
|
15592
15664
|
const { schema } = props;
|
|
15593
15665
|
if (isListArraySchema(schema)) {
|
|
15594
|
-
return /* @__PURE__ */ (0,
|
|
15666
|
+
return /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(ArrayListSchema_default, __spreadValues({}, props));
|
|
15595
15667
|
}
|
|
15596
15668
|
throw new Error("Not implemented");
|
|
15597
15669
|
};
|
|
@@ -15603,15 +15675,15 @@ var ArraySchema_default = ArraySchema;
|
|
|
15603
15675
|
// src/legacy/jsonSchemaForm/objectSchema/ObjectSchema.tsx
|
|
15604
15676
|
var import_components52 = require("@transferwise/components");
|
|
15605
15677
|
var import_classnames10 = __toESM(require_classnames());
|
|
15606
|
-
var
|
|
15607
|
-
var
|
|
15678
|
+
var import_react38 = require("react");
|
|
15679
|
+
var import_jsx_runtime88 = require("react/jsx-runtime");
|
|
15608
15680
|
var getSchemaColumnClasses2 = (width) => ({
|
|
15609
15681
|
"col-xs-12": true,
|
|
15610
15682
|
"col-sm-6": width === "md",
|
|
15611
15683
|
"col-sm-4": width === "sm"
|
|
15612
15684
|
});
|
|
15613
15685
|
function ObjectSchema(props) {
|
|
15614
|
-
const [model, setModel] = (0,
|
|
15686
|
+
const [model, setModel] = (0, import_react38.useState)(() => __spreadValues({}, getValidObjectModelParts(props.model, props.schema)));
|
|
15615
15687
|
const onChangeProperty = (propertyName, onChangeProps) => {
|
|
15616
15688
|
if (onChangeProps.model !== null) {
|
|
15617
15689
|
model[propertyName] = onChangeProps.model;
|
|
@@ -15622,7 +15694,7 @@ function ObjectSchema(props) {
|
|
|
15622
15694
|
props.onChange(__spreadProps(__spreadValues({}, onChangeProps), { model }));
|
|
15623
15695
|
};
|
|
15624
15696
|
const isRequired = (propertyName) => props.schema.required && props.schema.required.includes(propertyName);
|
|
15625
|
-
(0,
|
|
15697
|
+
(0, import_react38.useEffect)(() => {
|
|
15626
15698
|
const newModel = getValidObjectModelParts(model, props.schema) || {};
|
|
15627
15699
|
setModel(newModel);
|
|
15628
15700
|
if (!isEqual(newModel, model)) {
|
|
@@ -15640,22 +15712,22 @@ function ObjectSchema(props) {
|
|
|
15640
15712
|
const isPropertyDefined = (propertyName) => typeof props.schema.properties[propertyName] !== "undefined";
|
|
15641
15713
|
const orderedPropertyNames = Array.from(allorderedPropertiesSet).filter(isPropertyDefined);
|
|
15642
15714
|
const propsErrors = props.errors;
|
|
15643
|
-
return /* @__PURE__ */ (0,
|
|
15644
|
-
props.schema.alert && /* @__PURE__ */ (0,
|
|
15645
|
-
/* @__PURE__ */ (0,
|
|
15646
|
-
props.schema.title && !props.hideTitle && /* @__PURE__ */ (0,
|
|
15647
|
-
props.schema.description && !props.hideTitle && /* @__PURE__ */ (0,
|
|
15715
|
+
return /* @__PURE__ */ (0, import_jsx_runtime88.jsxs)(import_jsx_runtime88.Fragment, { children: [
|
|
15716
|
+
props.schema.alert && /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(DynamicAlert_default, { component: props.schema.alert }),
|
|
15717
|
+
/* @__PURE__ */ (0, import_jsx_runtime88.jsxs)("fieldset", { children: [
|
|
15718
|
+
props.schema.title && !props.hideTitle && /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(import_components52.Header, { title: props.schema.title, as: "legend" }),
|
|
15719
|
+
props.schema.description && !props.hideTitle && /* @__PURE__ */ (0, import_jsx_runtime88.jsxs)("p", { children: [
|
|
15648
15720
|
" ",
|
|
15649
15721
|
props.schema.description,
|
|
15650
15722
|
" "
|
|
15651
15723
|
] }),
|
|
15652
|
-
/* @__PURE__ */ (0,
|
|
15724
|
+
/* @__PURE__ */ (0, import_jsx_runtime88.jsx)("div", { className: "row", children: orderedPropertyNames.map((propertyName) => /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(
|
|
15653
15725
|
"div",
|
|
15654
15726
|
{
|
|
15655
15727
|
className: (0, import_classnames10.default)(
|
|
15656
15728
|
getSchemaColumnClasses2(props.schema.properties[propertyName].width)
|
|
15657
15729
|
),
|
|
15658
|
-
children: /* @__PURE__ */ (0,
|
|
15730
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(
|
|
15659
15731
|
GenericSchema_default,
|
|
15660
15732
|
{
|
|
15661
15733
|
schema: props.schema.properties[propertyName],
|
|
@@ -15683,7 +15755,7 @@ var ObjectSchema_default = ObjectSchema;
|
|
|
15683
15755
|
// src/legacy/jsonSchemaForm/oneOfSchema/OneOfSchema.tsx
|
|
15684
15756
|
var import_components55 = require("@transferwise/components");
|
|
15685
15757
|
var import_classnames11 = __toESM(require_classnames());
|
|
15686
|
-
var
|
|
15758
|
+
var import_react41 = require("react");
|
|
15687
15759
|
|
|
15688
15760
|
// src/legacy/jsonSchemaForm/help/Help.tsx
|
|
15689
15761
|
var import_components53 = require("@transferwise/components");
|
|
@@ -15700,14 +15772,14 @@ var help_messages_default2 = (0, import_react_intl29.defineMessages)({
|
|
|
15700
15772
|
});
|
|
15701
15773
|
|
|
15702
15774
|
// src/legacy/jsonSchemaForm/help/Help.tsx
|
|
15703
|
-
var
|
|
15775
|
+
var import_jsx_runtime89 = require("react/jsx-runtime");
|
|
15704
15776
|
function Help2(props) {
|
|
15705
15777
|
const intl = (0, import_react_intl30.useIntl)();
|
|
15706
|
-
return /* @__PURE__ */ (0,
|
|
15778
|
+
return /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
|
|
15707
15779
|
import_components53.Info,
|
|
15708
15780
|
{
|
|
15709
15781
|
className: "m-l-1",
|
|
15710
|
-
content: /* @__PURE__ */ (0,
|
|
15782
|
+
content: /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(import_components53.Markdown, { config: { link: { target: "_blank" } }, children: props.help.markdown }),
|
|
15711
15783
|
presentation: "POPOVER",
|
|
15712
15784
|
size: "sm",
|
|
15713
15785
|
"aria-label": intl.formatMessage(help_messages_default2.helpAria)
|
|
@@ -15717,12 +15789,12 @@ function Help2(props) {
|
|
|
15717
15789
|
var Help_default2 = Help2;
|
|
15718
15790
|
|
|
15719
15791
|
// src/legacy/jsonSchemaForm/schemaFormControl/SchemaFormControl.tsx
|
|
15720
|
-
var
|
|
15792
|
+
var import_react40 = require("react");
|
|
15721
15793
|
var import_react_intl31 = require("react-intl");
|
|
15722
15794
|
|
|
15723
15795
|
// src/legacy/formControl/FormControl.tsx
|
|
15724
15796
|
var import_components54 = require("@transferwise/components");
|
|
15725
|
-
var
|
|
15797
|
+
var import_react39 = require("react");
|
|
15726
15798
|
|
|
15727
15799
|
// src/legacy/formControl/utils/value-utils.ts
|
|
15728
15800
|
var getSafeStringValue = (value, options = {}) => {
|
|
@@ -15908,8 +15980,8 @@ var autocompleteTokenMap2 = {
|
|
|
15908
15980
|
};
|
|
15909
15981
|
|
|
15910
15982
|
// src/legacy/formControl/FormControl.tsx
|
|
15911
|
-
var
|
|
15912
|
-
var _FormControl = class _FormControl extends
|
|
15983
|
+
var import_jsx_runtime90 = require("react/jsx-runtime");
|
|
15984
|
+
var _FormControl = class _FormControl extends import_react39.PureComponent {
|
|
15913
15985
|
constructor(props) {
|
|
15914
15986
|
super(props);
|
|
15915
15987
|
this.getAutocompleteValue = ({ prefix = "", suffix = "" } = {}) => {
|
|
@@ -15997,7 +16069,7 @@ var _FormControl = class _FormControl extends import_react38.PureComponent {
|
|
|
15997
16069
|
} = this.props;
|
|
15998
16070
|
switch (type) {
|
|
15999
16071
|
case FormControlType.RADIO:
|
|
16000
|
-
return /* @__PURE__ */ (0,
|
|
16072
|
+
return /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
|
|
16001
16073
|
import_components54.RadioGroup,
|
|
16002
16074
|
{
|
|
16003
16075
|
radios: options.map(this.mapOption),
|
|
@@ -16007,7 +16079,7 @@ var _FormControl = class _FormControl extends import_react38.PureComponent {
|
|
|
16007
16079
|
}
|
|
16008
16080
|
);
|
|
16009
16081
|
case FormControlType.CHECKBOX:
|
|
16010
|
-
return /* @__PURE__ */ (0,
|
|
16082
|
+
return /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
|
|
16011
16083
|
import_components54.Checkbox,
|
|
16012
16084
|
{
|
|
16013
16085
|
checked: getSafeBooleanValue(value, { coerceValue: true }),
|
|
@@ -16025,7 +16097,7 @@ var _FormControl = class _FormControl extends import_react38.PureComponent {
|
|
|
16025
16097
|
const search = options.length >= 8;
|
|
16026
16098
|
const items = options;
|
|
16027
16099
|
const selected = this.getSelectedOption(options);
|
|
16028
|
-
return /* @__PURE__ */ (0,
|
|
16100
|
+
return /* @__PURE__ */ (0, import_jsx_runtime90.jsx)("div", { className: "d-flex flex-column", children: /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
|
|
16029
16101
|
import_components54.SelectInput,
|
|
16030
16102
|
{
|
|
16031
16103
|
id,
|
|
@@ -16041,7 +16113,7 @@ var _FormControl = class _FormControl extends import_react38.PureComponent {
|
|
|
16041
16113
|
disabled: value2.disabled
|
|
16042
16114
|
})),
|
|
16043
16115
|
value: selected != null ? selected : null,
|
|
16044
|
-
renderValue: ({ hideIconInTrigger, icon, label: label2, note, secondary }, withinTrigger) => /* @__PURE__ */ (0,
|
|
16116
|
+
renderValue: ({ hideIconInTrigger, icon, label: label2, note, secondary }, withinTrigger) => /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
|
|
16045
16117
|
import_components54.SelectInputOptionContent,
|
|
16046
16118
|
{
|
|
16047
16119
|
title: label2,
|
|
@@ -16070,13 +16142,13 @@ var _FormControl = class _FormControl extends import_react38.PureComponent {
|
|
|
16070
16142
|
) });
|
|
16071
16143
|
}
|
|
16072
16144
|
case FormControlType.TAB:
|
|
16073
|
-
return /* @__PURE__ */ (0,
|
|
16145
|
+
return /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
|
|
16074
16146
|
import_components54.Tabs,
|
|
16075
16147
|
{
|
|
16076
16148
|
selected: ((_a = this.getSelectedOption(options)) == null ? void 0 : _a.value) || 0,
|
|
16077
16149
|
tabs: options.map((option) => ({
|
|
16078
16150
|
title: option.label,
|
|
16079
|
-
content: /* @__PURE__ */ (0,
|
|
16151
|
+
content: /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(import_jsx_runtime90.Fragment, {}),
|
|
16080
16152
|
disabled: option.disabled || false
|
|
16081
16153
|
})),
|
|
16082
16154
|
name: id,
|
|
@@ -16091,7 +16163,7 @@ var _FormControl = class _FormControl extends import_react38.PureComponent {
|
|
|
16091
16163
|
);
|
|
16092
16164
|
case FormControlType.NUMERIC:
|
|
16093
16165
|
case FormControlType.NUMBER: {
|
|
16094
|
-
return /* @__PURE__ */ (0,
|
|
16166
|
+
return /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
|
|
16095
16167
|
"input",
|
|
16096
16168
|
{
|
|
16097
16169
|
autoComplete: this.getAutocompleteValue(),
|
|
@@ -16125,7 +16197,7 @@ var _FormControl = class _FormControl extends import_react38.PureComponent {
|
|
|
16125
16197
|
);
|
|
16126
16198
|
}
|
|
16127
16199
|
case FormControlType.HIDDEN:
|
|
16128
|
-
return /* @__PURE__ */ (0,
|
|
16200
|
+
return /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
|
|
16129
16201
|
"input",
|
|
16130
16202
|
{
|
|
16131
16203
|
type: "hidden",
|
|
@@ -16135,7 +16207,7 @@ var _FormControl = class _FormControl extends import_react38.PureComponent {
|
|
|
16135
16207
|
}
|
|
16136
16208
|
);
|
|
16137
16209
|
case FormControlType.PASSWORD:
|
|
16138
|
-
return /* @__PURE__ */ (0,
|
|
16210
|
+
return /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
|
|
16139
16211
|
"input",
|
|
16140
16212
|
{
|
|
16141
16213
|
autoComplete: this.getAutocompleteValue(),
|
|
@@ -16155,7 +16227,7 @@ var _FormControl = class _FormControl extends import_react38.PureComponent {
|
|
|
16155
16227
|
);
|
|
16156
16228
|
case FormControlType.DATE:
|
|
16157
16229
|
case FormControlType.DATETIME:
|
|
16158
|
-
return /* @__PURE__ */ (0,
|
|
16230
|
+
return /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
|
|
16159
16231
|
import_components54.DateInput,
|
|
16160
16232
|
{
|
|
16161
16233
|
dayAutoComplete: this.getAutocompleteValue({ suffix: "-day" }),
|
|
@@ -16171,7 +16243,7 @@ var _FormControl = class _FormControl extends import_react38.PureComponent {
|
|
|
16171
16243
|
}
|
|
16172
16244
|
);
|
|
16173
16245
|
case FormControlType.DATELOOKUP: {
|
|
16174
|
-
return /* @__PURE__ */ (0,
|
|
16246
|
+
return /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
|
|
16175
16247
|
import_components54.DateLookup,
|
|
16176
16248
|
{
|
|
16177
16249
|
value: getSafeDateStringValue(value),
|
|
@@ -16189,7 +16261,7 @@ var _FormControl = class _FormControl extends import_react38.PureComponent {
|
|
|
16189
16261
|
);
|
|
16190
16262
|
}
|
|
16191
16263
|
case FormControlType.TEL:
|
|
16192
|
-
return /* @__PURE__ */ (0,
|
|
16264
|
+
return /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
|
|
16193
16265
|
import_components54.PhoneNumberInput,
|
|
16194
16266
|
{
|
|
16195
16267
|
disabled,
|
|
@@ -16221,7 +16293,7 @@ var _FormControl = class _FormControl extends import_react38.PureComponent {
|
|
|
16221
16293
|
autoComplete: this.getAutocompleteValue()
|
|
16222
16294
|
};
|
|
16223
16295
|
if (this.props.displayPattern) {
|
|
16224
|
-
return /* @__PURE__ */ (0,
|
|
16296
|
+
return /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
|
|
16225
16297
|
import_components54.TextareaWithDisplayFormat,
|
|
16226
16298
|
__spreadProps(__spreadValues({
|
|
16227
16299
|
displayPattern: this.props.displayPattern
|
|
@@ -16230,7 +16302,7 @@ var _FormControl = class _FormControl extends import_react38.PureComponent {
|
|
|
16230
16302
|
})
|
|
16231
16303
|
);
|
|
16232
16304
|
}
|
|
16233
|
-
return /* @__PURE__ */ (0,
|
|
16305
|
+
return /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
|
|
16234
16306
|
"textarea",
|
|
16235
16307
|
__spreadProps(__spreadValues({}, textareaProps), {
|
|
16236
16308
|
"aria-describedby": describedBy,
|
|
@@ -16240,7 +16312,7 @@ var _FormControl = class _FormControl extends import_react38.PureComponent {
|
|
|
16240
16312
|
}
|
|
16241
16313
|
case FormControlType.FILE:
|
|
16242
16314
|
case FormControlType.UPLOAD: {
|
|
16243
|
-
return /* @__PURE__ */ (0,
|
|
16315
|
+
return /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
|
|
16244
16316
|
import_components54.Upload,
|
|
16245
16317
|
__spreadProps(__spreadValues({}, uploadProps), {
|
|
16246
16318
|
usAccept: uploadProps.usAccept || "*",
|
|
@@ -16277,7 +16349,7 @@ var _FormControl = class _FormControl extends import_react38.PureComponent {
|
|
|
16277
16349
|
autoComplete: this.getAutocompleteValue()
|
|
16278
16350
|
};
|
|
16279
16351
|
if (this.props.displayPattern) {
|
|
16280
|
-
return /* @__PURE__ */ (0,
|
|
16352
|
+
return /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
|
|
16281
16353
|
import_components54.InputWithDisplayFormat,
|
|
16282
16354
|
__spreadProps(__spreadValues({
|
|
16283
16355
|
displayPattern: this.props.displayPattern
|
|
@@ -16286,7 +16358,7 @@ var _FormControl = class _FormControl extends import_react38.PureComponent {
|
|
|
16286
16358
|
})
|
|
16287
16359
|
);
|
|
16288
16360
|
}
|
|
16289
|
-
return /* @__PURE__ */ (0,
|
|
16361
|
+
return /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
|
|
16290
16362
|
"input",
|
|
16291
16363
|
__spreadProps(__spreadValues({}, inputProps), {
|
|
16292
16364
|
"aria-describedby": describedBy,
|
|
@@ -16336,7 +16408,7 @@ _FormControl.defaultProps = {
|
|
|
16336
16408
|
var FormControl = _FormControl;
|
|
16337
16409
|
|
|
16338
16410
|
// src/legacy/jsonSchemaForm/schemaFormControl/SchemaFormControl.tsx
|
|
16339
|
-
var
|
|
16411
|
+
var import_jsx_runtime91 = require("react/jsx-runtime");
|
|
16340
16412
|
var isNativeInput = (propsSchemaType) => propsSchemaType === "string" || propsSchemaType === "number";
|
|
16341
16413
|
var getControlType = (schema) => {
|
|
16342
16414
|
if (isOneOfSchema2(schema)) {
|
|
@@ -16417,7 +16489,7 @@ function SchemaFormControl(props) {
|
|
|
16417
16489
|
onChange(getValidBasicModelOrNull(value2, schema), type, metadata);
|
|
16418
16490
|
};
|
|
16419
16491
|
const controlType = getControlType(schema);
|
|
16420
|
-
(0,
|
|
16492
|
+
(0, import_react40.useEffect)(() => {
|
|
16421
16493
|
warnIfInvalidSchema(schema, log, controlType);
|
|
16422
16494
|
}, [JSON.stringify(schema), log, controlType]);
|
|
16423
16495
|
const options = schema.values || getOptions(schema, controlType);
|
|
@@ -16447,7 +16519,7 @@ function SchemaFormControl(props) {
|
|
|
16447
16519
|
describedBy,
|
|
16448
16520
|
required
|
|
16449
16521
|
};
|
|
16450
|
-
return /* @__PURE__ */ (0,
|
|
16522
|
+
return /* @__PURE__ */ (0, import_jsx_runtime91.jsx)("div", { "aria-describedby": describedBy, children: /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(FormControl, __spreadValues(__spreadValues({ type: controlType, value: safeValue }, events), controlProps)) });
|
|
16451
16523
|
}
|
|
16452
16524
|
SchemaFormControl.defaultProps = {
|
|
16453
16525
|
value: null,
|
|
@@ -16476,17 +16548,17 @@ var warnIfInvalidSchema = (schema, log, controlType) => {
|
|
|
16476
16548
|
var SchemaFormControl_default = SchemaFormControl;
|
|
16477
16549
|
|
|
16478
16550
|
// src/legacy/jsonSchemaForm/oneOfSchema/OneOfSchema.tsx
|
|
16479
|
-
var
|
|
16551
|
+
var import_jsx_runtime92 = require("react/jsx-runtime");
|
|
16480
16552
|
function OneOfSchema(props) {
|
|
16481
16553
|
const onEvent = useEventDispatcher();
|
|
16482
|
-
const [changed, setChanged] = (0,
|
|
16483
|
-
const [focused, setFocused] = (0,
|
|
16484
|
-
const [blurred, setBlurred] = (0,
|
|
16485
|
-
const id = (0,
|
|
16486
|
-
const [schemaIndex, setSchemaIndex] = (0,
|
|
16554
|
+
const [changed, setChanged] = (0, import_react41.useState)(false);
|
|
16555
|
+
const [focused, setFocused] = (0, import_react41.useState)(false);
|
|
16556
|
+
const [blurred, setBlurred] = (0, import_react41.useState)(false);
|
|
16557
|
+
const id = (0, import_react41.useMemo)(() => props.schema.$id || generateRandomId(), [props.schema.$id]);
|
|
16558
|
+
const [schemaIndex, setSchemaIndex] = (0, import_react41.useState)(
|
|
16487
16559
|
getActiveSchemaIndex(props.schema, props.model)
|
|
16488
16560
|
);
|
|
16489
|
-
const [models, setModels] = (0,
|
|
16561
|
+
const [models, setModels] = (0, import_react41.useState)(getModelPartsForSchemas(props.model, props.schema.oneOf));
|
|
16490
16562
|
const debouncedTrackEvent = useDebouncedFunction(onEvent, 200);
|
|
16491
16563
|
const onSearchChange = (searchValue) => {
|
|
16492
16564
|
debouncedTrackEvent("Dynamic Flow - OneOf Searched", {
|
|
@@ -16494,7 +16566,7 @@ function OneOfSchema(props) {
|
|
|
16494
16566
|
searchValueLength: searchValue.length
|
|
16495
16567
|
});
|
|
16496
16568
|
};
|
|
16497
|
-
(0,
|
|
16569
|
+
(0, import_react41.useEffect)(() => {
|
|
16498
16570
|
const modelIndex = getValidIndexFromValue(props.schema, props.model);
|
|
16499
16571
|
const defaultIndex = getValidIndexFromValue(props.schema, props.schema.default);
|
|
16500
16572
|
if (modelIndex === -1 && defaultIndex >= 0) {
|
|
@@ -16552,12 +16624,12 @@ function OneOfSchema(props) {
|
|
|
16552
16624
|
"has-error": !changed && props.errors && !isEmpty(props.errors) || (props.submitted || changed && blurred) && validations.length
|
|
16553
16625
|
};
|
|
16554
16626
|
const feedbackId = `${id}-feedback`;
|
|
16555
|
-
return /* @__PURE__ */ (0,
|
|
16556
|
-
(props.schema.oneOf.length > 1 || isConstSchema2(props.schema.oneOf[0])) && /* @__PURE__ */ (0,
|
|
16557
|
-
props.schema.alert && /* @__PURE__ */ (0,
|
|
16558
|
-
/* @__PURE__ */ (0,
|
|
16627
|
+
return /* @__PURE__ */ (0, import_jsx_runtime92.jsxs)(import_jsx_runtime92.Fragment, { children: [
|
|
16628
|
+
(props.schema.oneOf.length > 1 || isConstSchema2(props.schema.oneOf[0])) && /* @__PURE__ */ (0, import_jsx_runtime92.jsxs)(import_jsx_runtime92.Fragment, { children: [
|
|
16629
|
+
props.schema.alert && /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(DynamicAlert_default, { component: props.schema.alert }),
|
|
16630
|
+
/* @__PURE__ */ (0, import_jsx_runtime92.jsxs)("div", { className: (0, import_classnames11.default)(formGroupClasses), children: [
|
|
16559
16631
|
getTitleAndHelp(props.schema, id),
|
|
16560
|
-
/* @__PURE__ */ (0,
|
|
16632
|
+
/* @__PURE__ */ (0, import_jsx_runtime92.jsx)(
|
|
16561
16633
|
SchemaFormControl_default,
|
|
16562
16634
|
{
|
|
16563
16635
|
id,
|
|
@@ -16573,7 +16645,7 @@ function OneOfSchema(props) {
|
|
|
16573
16645
|
onSearchChange
|
|
16574
16646
|
}
|
|
16575
16647
|
),
|
|
16576
|
-
/* @__PURE__ */ (0,
|
|
16648
|
+
/* @__PURE__ */ (0, import_jsx_runtime92.jsx)(
|
|
16577
16649
|
ControlFeedback_default,
|
|
16578
16650
|
{
|
|
16579
16651
|
id: feedbackId,
|
|
@@ -16589,7 +16661,7 @@ function OneOfSchema(props) {
|
|
|
16589
16661
|
)
|
|
16590
16662
|
] })
|
|
16591
16663
|
] }),
|
|
16592
|
-
isNoNConstSchema(props.schema.oneOf[schemaIndex]) && /* @__PURE__ */ (0,
|
|
16664
|
+
isNoNConstSchema(props.schema.oneOf[schemaIndex]) && /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(
|
|
16593
16665
|
GenericSchema_default,
|
|
16594
16666
|
{
|
|
16595
16667
|
schema: props.schema.oneOf[schemaIndex],
|
|
@@ -16606,16 +16678,16 @@ function OneOfSchema(props) {
|
|
|
16606
16678
|
}
|
|
16607
16679
|
function getTitleAndHelp(schema, forId) {
|
|
16608
16680
|
var _a;
|
|
16609
|
-
const helpElement = schema.help ? /* @__PURE__ */ (0,
|
|
16610
|
-
const titleElement = isConstSchema2(schema.oneOf[0]) ? /* @__PURE__ */ (0,
|
|
16681
|
+
const helpElement = schema.help ? /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(Help_default2, { help: schema.help }) : null;
|
|
16682
|
+
const titleElement = isConstSchema2(schema.oneOf[0]) ? /* @__PURE__ */ (0, import_jsx_runtime92.jsx)("div", { className: "m-b-1", children: /* @__PURE__ */ (0, import_jsx_runtime92.jsxs)("label", { className: "control-label d-inline", htmlFor: forId, children: [
|
|
16611
16683
|
schema.title,
|
|
16612
16684
|
" ",
|
|
16613
16685
|
helpElement
|
|
16614
|
-
] }) }) : /* @__PURE__ */ (0,
|
|
16686
|
+
] }) }) : /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(import_jsx_runtime92.Fragment, { children: helpElement ? /* @__PURE__ */ (0, import_jsx_runtime92.jsxs)("h4", { className: "m-b-2", children: [
|
|
16615
16687
|
schema.title,
|
|
16616
16688
|
" ",
|
|
16617
16689
|
helpElement
|
|
16618
|
-
] }) : /* @__PURE__ */ (0,
|
|
16690
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(import_components55.Header, { title: (_a = schema.title) != null ? _a : "" }) });
|
|
16619
16691
|
return schema.title ? titleElement : helpElement;
|
|
16620
16692
|
}
|
|
16621
16693
|
function getValidations(props, schemaIndex) {
|
|
@@ -16652,13 +16724,13 @@ var OneOfSchema_default = OneOfSchema;
|
|
|
16652
16724
|
|
|
16653
16725
|
// src/legacy/jsonSchemaForm/persistAsyncSchema/persistAsyncBlobSchema/PersistAsyncBlobSchema.tsx
|
|
16654
16726
|
var import_classnames12 = __toESM(require_classnames());
|
|
16655
|
-
var
|
|
16727
|
+
var import_react43 = require("react");
|
|
16656
16728
|
var import_react_intl32 = require("react-intl");
|
|
16657
16729
|
|
|
16658
16730
|
// src/legacy/jsonSchemaForm/persistAsyncSchema/persistAsyncBlobSchema/UploadInputAdapter.tsx
|
|
16659
16731
|
var import_components56 = require("@transferwise/components");
|
|
16660
|
-
var
|
|
16661
|
-
var
|
|
16732
|
+
var import_react42 = require("react");
|
|
16733
|
+
var import_jsx_runtime93 = require("react/jsx-runtime");
|
|
16662
16734
|
function UploadInputAdapter(props) {
|
|
16663
16735
|
const {
|
|
16664
16736
|
id,
|
|
@@ -16674,7 +16746,7 @@ function UploadInputAdapter(props) {
|
|
|
16674
16746
|
onCancel
|
|
16675
16747
|
} = props;
|
|
16676
16748
|
const onEvent = useEventDispatcher();
|
|
16677
|
-
const files = (0,
|
|
16749
|
+
const files = (0, import_react42.useMemo)(() => fileId ? [{ id: fileId, status: import_components56.Status.SUCCEEDED }] : [], [fileId]);
|
|
16678
16750
|
const uploadFile = (formData) => {
|
|
16679
16751
|
onEvent("Dynamic Flow - PersistAsync", { status: "pending", schemaId: id });
|
|
16680
16752
|
return httpClient(String(httpOptions.url), {
|
|
@@ -16693,7 +16765,7 @@ function UploadInputAdapter(props) {
|
|
|
16693
16765
|
return Promise.reject();
|
|
16694
16766
|
});
|
|
16695
16767
|
};
|
|
16696
|
-
return /* @__PURE__ */ (0,
|
|
16768
|
+
return /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(
|
|
16697
16769
|
import_components56.UploadInput,
|
|
16698
16770
|
{
|
|
16699
16771
|
id,
|
|
@@ -16713,17 +16785,17 @@ function UploadInputAdapter(props) {
|
|
|
16713
16785
|
}
|
|
16714
16786
|
|
|
16715
16787
|
// src/legacy/jsonSchemaForm/persistAsyncSchema/persistAsyncBlobSchema/PersistAsyncBlobSchema.tsx
|
|
16716
|
-
var
|
|
16788
|
+
var import_jsx_runtime94 = require("react/jsx-runtime");
|
|
16717
16789
|
function PersistAsyncBlobSchema(props) {
|
|
16718
16790
|
const { model, schema, submitted, required, errors, onChange } = props;
|
|
16719
|
-
const [persistAsyncValidationMessages, setPersistAsyncValidationMessages] = (0,
|
|
16720
|
-
const [persistAsyncValidations, setPersistAsyncValidations] = (0,
|
|
16721
|
-
const [validations, setValidations] = (0,
|
|
16722
|
-
const [changed, setChanged] = (0,
|
|
16791
|
+
const [persistAsyncValidationMessages, setPersistAsyncValidationMessages] = (0, import_react43.useState)({});
|
|
16792
|
+
const [persistAsyncValidations, setPersistAsyncValidations] = (0, import_react43.useState)(null);
|
|
16793
|
+
const [validations, setValidations] = (0, import_react43.useState)([]);
|
|
16794
|
+
const [changed, setChanged] = (0, import_react43.useState)(false);
|
|
16723
16795
|
const intl = (0, import_react_intl32.useIntl)();
|
|
16724
16796
|
const httpClient = useHttpClient();
|
|
16725
16797
|
const onEvent = useEventDispatcher();
|
|
16726
|
-
(0,
|
|
16798
|
+
(0, import_react43.useEffect)(() => {
|
|
16727
16799
|
if (submitted) {
|
|
16728
16800
|
setValidations(getValidationFailures(model, schema, Boolean(required)));
|
|
16729
16801
|
} else {
|
|
@@ -16761,8 +16833,8 @@ function PersistAsyncBlobSchema(props) {
|
|
|
16761
16833
|
};
|
|
16762
16834
|
const id = schema.$id || schema.persistAsync.schema.$id || schema.persistAsync.idProperty;
|
|
16763
16835
|
const feedbackId = `${id}-feedback`;
|
|
16764
|
-
return /* @__PURE__ */ (0,
|
|
16765
|
-
/* @__PURE__ */ (0,
|
|
16836
|
+
return /* @__PURE__ */ (0, import_jsx_runtime94.jsxs)("div", { className: (0, import_classnames12.default)(formGroupClasses), children: [
|
|
16837
|
+
/* @__PURE__ */ (0, import_jsx_runtime94.jsx)("div", { "aria-describedby": feedbackId, children: /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(
|
|
16766
16838
|
UploadInputAdapter,
|
|
16767
16839
|
__spreadValues({
|
|
16768
16840
|
id,
|
|
@@ -16780,7 +16852,7 @@ function PersistAsyncBlobSchema(props) {
|
|
|
16780
16852
|
onCancel
|
|
16781
16853
|
}, mapSchemaToUploadOptions(schema.persistAsync.schema))
|
|
16782
16854
|
) }),
|
|
16783
|
-
/* @__PURE__ */ (0,
|
|
16855
|
+
/* @__PURE__ */ (0, import_jsx_runtime94.jsx)(
|
|
16784
16856
|
ControlFeedback_default,
|
|
16785
16857
|
{
|
|
16786
16858
|
id: feedbackId,
|
|
@@ -16805,17 +16877,17 @@ PersistAsyncBlobSchema.defaultProps = {
|
|
|
16805
16877
|
var PersistAsyncBlobSchema_default = PersistAsyncBlobSchema;
|
|
16806
16878
|
|
|
16807
16879
|
// src/legacy/jsonSchemaForm/persistAsyncSchema/PersistAsyncSchema.tsx
|
|
16808
|
-
var
|
|
16880
|
+
var import_jsx_runtime95 = require("react/jsx-runtime");
|
|
16809
16881
|
function PersistAsyncSchema(props) {
|
|
16810
16882
|
const { schema } = props;
|
|
16811
16883
|
const persistAsyncSchemaType = schema.persistAsync.schema.type;
|
|
16812
16884
|
if (persistAsyncSchemaType === "blob") {
|
|
16813
|
-
return /* @__PURE__ */ (0,
|
|
16885
|
+
return /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(
|
|
16814
16886
|
PersistAsyncBlobSchema_default,
|
|
16815
16887
|
__spreadValues({}, props)
|
|
16816
16888
|
);
|
|
16817
16889
|
}
|
|
16818
|
-
return /* @__PURE__ */ (0,
|
|
16890
|
+
return /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(PersistAsyncBasicSchema_default, __spreadValues({}, props));
|
|
16819
16891
|
}
|
|
16820
16892
|
PersistAsyncSchema.defaultProps = {
|
|
16821
16893
|
required: false
|
|
@@ -16823,7 +16895,7 @@ PersistAsyncSchema.defaultProps = {
|
|
|
16823
16895
|
var PersistAsyncSchema_default = PersistAsyncSchema;
|
|
16824
16896
|
|
|
16825
16897
|
// src/legacy/jsonSchemaForm/promotedOneOfSchema/PromotedOneOfSchema.tsx
|
|
16826
|
-
var
|
|
16898
|
+
var import_react44 = require("react");
|
|
16827
16899
|
|
|
16828
16900
|
// src/legacy/jsonSchemaForm/promotedOneOfSchema/promoted-one-of-utils.ts
|
|
16829
16901
|
var getSelectionFromModel = (schema, model) => {
|
|
@@ -16836,7 +16908,7 @@ var getSelectionFromModel = (schema, model) => {
|
|
|
16836
16908
|
|
|
16837
16909
|
// src/legacy/jsonSchemaForm/promotedOneOfSchema/promotedOneOfControl/PromotedOneOfCheckboxControl.tsx
|
|
16838
16910
|
var import_components57 = require("@transferwise/components");
|
|
16839
|
-
var
|
|
16911
|
+
var import_jsx_runtime96 = require("react/jsx-runtime");
|
|
16840
16912
|
var PromotedOneOfCheckboxControl = (props) => {
|
|
16841
16913
|
const { id, selection, setSelection } = props;
|
|
16842
16914
|
const { promoted, other, checkedMeans } = props.promotion;
|
|
@@ -16847,14 +16919,14 @@ var PromotedOneOfCheckboxControl = (props) => {
|
|
|
16847
16919
|
const toggleSelection = () => {
|
|
16848
16920
|
setSelection(checked ? selectionWhenUnchecked : selectionWhenChecked);
|
|
16849
16921
|
};
|
|
16850
|
-
return /* @__PURE__ */ (0,
|
|
16922
|
+
return /* @__PURE__ */ (0, import_jsx_runtime96.jsx)("div", { className: "form-group", children: /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(import_components57.Checkbox, { id, label: title, checked, onChange: toggleSelection }) });
|
|
16851
16923
|
};
|
|
16852
16924
|
PromotedOneOfCheckboxControl.defaultProps = {};
|
|
16853
16925
|
var PromotedOneOfCheckboxControl_default = PromotedOneOfCheckboxControl;
|
|
16854
16926
|
|
|
16855
16927
|
// src/legacy/jsonSchemaForm/promotedOneOfSchema/promotedOneOfControl/PromotedOneOfRadioControl.tsx
|
|
16856
16928
|
var import_components58 = require("@transferwise/components");
|
|
16857
|
-
var
|
|
16929
|
+
var import_jsx_runtime97 = require("react/jsx-runtime");
|
|
16858
16930
|
function PromotedOneOfRadioControl(props) {
|
|
16859
16931
|
var _a, _b;
|
|
16860
16932
|
const { id, selection, setSelection, promotion, promotedOneOf, title } = props;
|
|
@@ -16871,9 +16943,9 @@ function PromotedOneOfRadioControl(props) {
|
|
|
16871
16943
|
secondary: promotion.other.description
|
|
16872
16944
|
}, getAvatarPropertyForRadioOption(promotion.other))
|
|
16873
16945
|
];
|
|
16874
|
-
return /* @__PURE__ */ (0,
|
|
16875
|
-
title && /* @__PURE__ */ (0,
|
|
16876
|
-
/* @__PURE__ */ (0,
|
|
16946
|
+
return /* @__PURE__ */ (0, import_jsx_runtime97.jsxs)("div", { className: "form-group", children: [
|
|
16947
|
+
title && /* @__PURE__ */ (0, import_jsx_runtime97.jsx)("label", { className: "control-label", htmlFor: id, children: title }),
|
|
16948
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsx)(
|
|
16877
16949
|
import_components58.RadioGroup,
|
|
16878
16950
|
{
|
|
16879
16951
|
name: "promoted-selection",
|
|
@@ -16891,16 +16963,16 @@ PromotedOneOfRadioControl.defaultProps = {
|
|
|
16891
16963
|
var PromotedOneOfRadioControl_default = PromotedOneOfRadioControl;
|
|
16892
16964
|
|
|
16893
16965
|
// src/legacy/jsonSchemaForm/promotedOneOfSchema/promotedOneOfControl/PromotedOneOfControl.tsx
|
|
16894
|
-
var
|
|
16966
|
+
var import_jsx_runtime98 = require("react/jsx-runtime");
|
|
16895
16967
|
function PromotedOneOfControl(props) {
|
|
16896
16968
|
const controlType = props.promotion.control || "radio";
|
|
16897
16969
|
switch (controlType) {
|
|
16898
16970
|
case "radio":
|
|
16899
|
-
return /* @__PURE__ */ (0,
|
|
16971
|
+
return /* @__PURE__ */ (0, import_jsx_runtime98.jsx)(PromotedOneOfRadioControl_default, __spreadValues({}, props));
|
|
16900
16972
|
case "checkbox":
|
|
16901
|
-
return /* @__PURE__ */ (0,
|
|
16973
|
+
return /* @__PURE__ */ (0, import_jsx_runtime98.jsx)(PromotedOneOfCheckboxControl_default, __spreadValues({}, props));
|
|
16902
16974
|
default:
|
|
16903
|
-
return /* @__PURE__ */ (0,
|
|
16975
|
+
return /* @__PURE__ */ (0, import_jsx_runtime98.jsx)(import_jsx_runtime98.Fragment, {});
|
|
16904
16976
|
}
|
|
16905
16977
|
}
|
|
16906
16978
|
PromotedOneOfControl.defaultProps = {
|
|
@@ -16910,20 +16982,20 @@ PromotedOneOfControl.defaultProps = {
|
|
|
16910
16982
|
var PromotedOneOfControl_default = PromotedOneOfControl;
|
|
16911
16983
|
|
|
16912
16984
|
// src/legacy/jsonSchemaForm/promotedOneOfSchema/PromotedOneOfSchema.tsx
|
|
16913
|
-
var
|
|
16985
|
+
var import_jsx_runtime99 = require("react/jsx-runtime");
|
|
16914
16986
|
var isPromoted = (schema) => schema.promoted === true;
|
|
16915
16987
|
var PromotedOneOfSchema = (props) => {
|
|
16916
16988
|
var _a;
|
|
16917
|
-
const [selection, setSelection] = (0,
|
|
16989
|
+
const [selection, setSelection] = (0, import_react44.useState)(
|
|
16918
16990
|
getSelectionFromModel(props.schema, props.model) || ((_a = props.schema.promotion) == null ? void 0 : _a.default) || "promoted"
|
|
16919
16991
|
);
|
|
16920
16992
|
const promotedAlert = props.schema.alert;
|
|
16921
16993
|
const promotedOneOf = props.schema.oneOf.find(isPromoted);
|
|
16922
16994
|
const promotedObjectSchema = getPromotedObjectSchema(promotedOneOf);
|
|
16923
16995
|
const otherOneOf = getOtherOneOf(props.schema);
|
|
16924
|
-
return /* @__PURE__ */ (0,
|
|
16925
|
-
promotedAlert && /* @__PURE__ */ (0,
|
|
16926
|
-
/* @__PURE__ */ (0,
|
|
16996
|
+
return /* @__PURE__ */ (0, import_jsx_runtime99.jsxs)(import_jsx_runtime99.Fragment, { children: [
|
|
16997
|
+
promotedAlert && /* @__PURE__ */ (0, import_jsx_runtime99.jsx)(DynamicAlert_default, { component: promotedAlert }),
|
|
16998
|
+
/* @__PURE__ */ (0, import_jsx_runtime99.jsx)(
|
|
16927
16999
|
PromotedOneOfControl_default,
|
|
16928
17000
|
{
|
|
16929
17001
|
id: props.schema.$id,
|
|
@@ -16934,8 +17006,8 @@ var PromotedOneOfSchema = (props) => {
|
|
|
16934
17006
|
setSelection
|
|
16935
17007
|
}
|
|
16936
17008
|
),
|
|
16937
|
-
selection === "promoted" && /* @__PURE__ */ (0,
|
|
16938
|
-
selection === "other" && /* @__PURE__ */ (0,
|
|
17009
|
+
selection === "promoted" && /* @__PURE__ */ (0, import_jsx_runtime99.jsx)(ObjectSchema_default, __spreadProps(__spreadValues({}, props), { schema: promotedObjectSchema })),
|
|
17010
|
+
selection === "other" && /* @__PURE__ */ (0, import_jsx_runtime99.jsx)(GenericSchema_default, __spreadProps(__spreadValues({}, props), { schema: otherOneOf }))
|
|
16939
17011
|
] });
|
|
16940
17012
|
};
|
|
16941
17013
|
function getPromotedObjectSchema(promotedSchema) {
|
|
@@ -16984,12 +17056,12 @@ var ReadOnlySchema_messages_default = (0, import_react_intl33.defineMessages)({
|
|
|
16984
17056
|
});
|
|
16985
17057
|
|
|
16986
17058
|
// src/legacy/jsonSchemaForm/readOnlySchema/ReadOnlySchema.tsx
|
|
16987
|
-
var
|
|
17059
|
+
var import_jsx_runtime100 = require("react/jsx-runtime");
|
|
16988
17060
|
function ReadOnlySchema({ schema, model }) {
|
|
16989
17061
|
const { title = "" } = schema;
|
|
16990
17062
|
const { formatMessage } = (0, import_react_intl34.useIntl)();
|
|
16991
17063
|
const value = getValueForSchema({ schema, model, formatMessage });
|
|
16992
|
-
return /* @__PURE__ */ (0,
|
|
17064
|
+
return /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(import_components59.DefinitionList, { layout: import_components59.Layout.VERTICAL_ONE_COLUMN, definitions: [{ title, value, key: "" }] });
|
|
16993
17065
|
}
|
|
16994
17066
|
var ReadOnlySchema_default = ReadOnlySchema;
|
|
16995
17067
|
function getValueForSchema({
|
|
@@ -17022,7 +17094,7 @@ function getSelectedOneOf(schema, model) {
|
|
|
17022
17094
|
function getValueFromOption(option) {
|
|
17023
17095
|
const text = option.title && option.description ? `${option.title} - ${option.description}` : option.title || "";
|
|
17024
17096
|
const icon = getAvatarPropertyForRadioOption({ icon: option.icon });
|
|
17025
|
-
return (icon == null ? void 0 : icon.avatar) ? /* @__PURE__ */ (0,
|
|
17097
|
+
return (icon == null ? void 0 : icon.avatar) ? /* @__PURE__ */ (0, import_jsx_runtime100.jsxs)(import_jsx_runtime100.Fragment, { children: [
|
|
17026
17098
|
icon.avatar,
|
|
17027
17099
|
" ",
|
|
17028
17100
|
text
|
|
@@ -17030,22 +17102,22 @@ function getValueFromOption(option) {
|
|
|
17030
17102
|
}
|
|
17031
17103
|
|
|
17032
17104
|
// src/legacy/jsonSchemaForm/validationAsyncSchema/ValidationAsyncSchema.tsx
|
|
17033
|
-
var
|
|
17034
|
-
var
|
|
17105
|
+
var import_react45 = require("react");
|
|
17106
|
+
var import_jsx_runtime101 = require("react/jsx-runtime");
|
|
17035
17107
|
function ValidationAsyncSchema(props) {
|
|
17036
17108
|
const { schema, model, required, submitted, errors, onChange } = props;
|
|
17037
|
-
const [validationAsyncModel, setValidationAsyncModel] = (0,
|
|
17038
|
-
const previousRequestedModelReference = (0,
|
|
17039
|
-
const [validationAsyncSuccessMessage, setValidationAsyncSuccessMessage] = (0,
|
|
17109
|
+
const [validationAsyncModel, setValidationAsyncModel] = (0, import_react45.useState)(model);
|
|
17110
|
+
const previousRequestedModelReference = (0, import_react45.useRef)(null);
|
|
17111
|
+
const [validationAsyncSuccessMessage, setValidationAsyncSuccessMessage] = (0, import_react45.useState)(
|
|
17040
17112
|
null
|
|
17041
17113
|
);
|
|
17042
|
-
const [validationAsyncErrors, setValidationAsyncErrors] = (0,
|
|
17043
|
-
const [fieldSubmitted, setFieldSubmitted] = (0,
|
|
17044
|
-
const [abortController, setAbortController] = (0,
|
|
17114
|
+
const [validationAsyncErrors, setValidationAsyncErrors] = (0, import_react45.useState)(null);
|
|
17115
|
+
const [fieldSubmitted, setFieldSubmitted] = (0, import_react45.useState)(false);
|
|
17116
|
+
const [abortController, setAbortController] = (0, import_react45.useState)(null);
|
|
17045
17117
|
const httpClient = useHttpClient();
|
|
17046
17118
|
const onEvent = useEventDispatcher();
|
|
17047
17119
|
const log = useLogger();
|
|
17048
|
-
(0,
|
|
17120
|
+
(0, import_react45.useEffect)(() => {
|
|
17049
17121
|
if (!schema.validationAsync.method) {
|
|
17050
17122
|
log.warning(
|
|
17051
17123
|
"Invalid schema or model",
|
|
@@ -17115,20 +17187,20 @@ function ValidationAsyncSchema(props) {
|
|
|
17115
17187
|
required,
|
|
17116
17188
|
schema
|
|
17117
17189
|
};
|
|
17118
|
-
return /* @__PURE__ */ (0,
|
|
17190
|
+
return /* @__PURE__ */ (0, import_jsx_runtime101.jsx)(BasicTypeSchema_default, __spreadValues({}, basicTypeSchemaProps));
|
|
17119
17191
|
}
|
|
17120
17192
|
ValidationAsyncSchema.defaultProps = { required: false };
|
|
17121
17193
|
var ValidationAsyncSchema_default = ValidationAsyncSchema;
|
|
17122
17194
|
|
|
17123
17195
|
// src/legacy/jsonSchemaForm/genericSchema/GenericSchema.tsx
|
|
17124
|
-
var
|
|
17125
|
-
var
|
|
17196
|
+
var import_jsx_runtime102 = require("react/jsx-runtime");
|
|
17197
|
+
var import_react47 = require("react");
|
|
17126
17198
|
function GenericSchemaForm(props) {
|
|
17127
17199
|
const { schema, model = null, errors = null, hideTitle = false, disabled = false } = props;
|
|
17128
17200
|
const schemaProps = __spreadProps(__spreadValues({}, props), { model, errors, hideTitle, disabled });
|
|
17129
17201
|
const type = getSchemaType(schema);
|
|
17130
17202
|
const log = useLogger();
|
|
17131
|
-
(0,
|
|
17203
|
+
(0, import_react46.useEffect)(() => {
|
|
17132
17204
|
if (!isValidGenericSchema(schema, model, errors)) {
|
|
17133
17205
|
log.error(
|
|
17134
17206
|
"Invalid schema or model",
|
|
@@ -17138,29 +17210,29 @@ function GenericSchemaForm(props) {
|
|
|
17138
17210
|
}, [JSON.stringify(schema), JSON.stringify(model), JSON.stringify(errors), type, log]);
|
|
17139
17211
|
switch (type) {
|
|
17140
17212
|
case "readOnly":
|
|
17141
|
-
return /* @__PURE__ */ (0,
|
|
17213
|
+
return /* @__PURE__ */ (0, import_jsx_runtime102.jsx)(ReadOnlySchema_default, __spreadValues({}, schemaProps));
|
|
17142
17214
|
case "persistAsync":
|
|
17143
|
-
return /* @__PURE__ */ (0,
|
|
17215
|
+
return /* @__PURE__ */ (0, import_jsx_runtime102.jsx)(PersistAsyncSchema_default, __spreadValues({}, schemaProps));
|
|
17144
17216
|
case "validationAsync":
|
|
17145
|
-
return /* @__PURE__ */ (0,
|
|
17217
|
+
return /* @__PURE__ */ (0, import_jsx_runtime102.jsx)(ValidationAsyncSchema_default, __spreadValues({}, schemaProps));
|
|
17146
17218
|
case "basic": {
|
|
17147
17219
|
const basicTypeProps = __spreadValues({
|
|
17148
17220
|
infoMessage: null
|
|
17149
17221
|
}, schemaProps);
|
|
17150
|
-
return /* @__PURE__ */ (0,
|
|
17222
|
+
return /* @__PURE__ */ (0, import_jsx_runtime102.jsx)(BasicTypeSchema_default, __spreadValues({}, basicTypeProps));
|
|
17151
17223
|
}
|
|
17152
17224
|
case "object":
|
|
17153
|
-
return /* @__PURE__ */ (0,
|
|
17225
|
+
return /* @__PURE__ */ (0, import_react47.createElement)(ObjectSchema_default, __spreadProps(__spreadValues({}, schemaProps), { key: JSON.stringify(schema) }));
|
|
17154
17226
|
case "array":
|
|
17155
|
-
return /* @__PURE__ */ (0,
|
|
17227
|
+
return /* @__PURE__ */ (0, import_jsx_runtime102.jsx)(ArraySchema_default, __spreadValues({}, schemaProps));
|
|
17156
17228
|
case "promotedOneOf":
|
|
17157
|
-
return /* @__PURE__ */ (0,
|
|
17229
|
+
return /* @__PURE__ */ (0, import_jsx_runtime102.jsx)(PromotedOneOfSchema_default, __spreadValues({}, schemaProps));
|
|
17158
17230
|
case "oneOf":
|
|
17159
|
-
return /* @__PURE__ */ (0,
|
|
17231
|
+
return /* @__PURE__ */ (0, import_jsx_runtime102.jsx)(OneOfSchema_default, __spreadValues({}, schemaProps));
|
|
17160
17232
|
case "allOf":
|
|
17161
|
-
return /* @__PURE__ */ (0,
|
|
17233
|
+
return /* @__PURE__ */ (0, import_jsx_runtime102.jsx)(AllOfSchema_default, __spreadValues({}, schemaProps));
|
|
17162
17234
|
}
|
|
17163
|
-
return /* @__PURE__ */ (0,
|
|
17235
|
+
return /* @__PURE__ */ (0, import_jsx_runtime102.jsx)(import_jsx_runtime102.Fragment, {});
|
|
17164
17236
|
}
|
|
17165
17237
|
var GenericSchema_default = GenericSchemaForm;
|
|
17166
17238
|
var isValidGenericSchema = (schema, model, errors) => {
|
|
@@ -17187,7 +17259,7 @@ var isValidGenericSchema = (schema, model, errors) => {
|
|
|
17187
17259
|
};
|
|
17188
17260
|
|
|
17189
17261
|
// src/legacy/layout/form/DynamicForm.tsx
|
|
17190
|
-
var
|
|
17262
|
+
var import_jsx_runtime103 = require("react/jsx-runtime");
|
|
17191
17263
|
function DynamicForm({
|
|
17192
17264
|
component,
|
|
17193
17265
|
model = null,
|
|
@@ -17197,7 +17269,7 @@ function DynamicForm({
|
|
|
17197
17269
|
onPersistAsync
|
|
17198
17270
|
}) {
|
|
17199
17271
|
const formSchema = component.schema;
|
|
17200
|
-
return /* @__PURE__ */ (0,
|
|
17272
|
+
return /* @__PURE__ */ (0, import_jsx_runtime103.jsx)("div", { className: getMargin2(component.margin || "md"), children: /* @__PURE__ */ (0, import_jsx_runtime103.jsx)(
|
|
17201
17273
|
GenericSchema_default,
|
|
17202
17274
|
{
|
|
17203
17275
|
schema: formSchema,
|
|
@@ -17216,62 +17288,62 @@ var DynamicForm_default = DynamicForm;
|
|
|
17216
17288
|
// src/legacy/layout/heading/DynamicHeading.tsx
|
|
17217
17289
|
var import_components60 = require("@transferwise/components");
|
|
17218
17290
|
var import_classnames13 = __toESM(require_classnames());
|
|
17219
|
-
var
|
|
17291
|
+
var import_jsx_runtime104 = require("react/jsx-runtime");
|
|
17220
17292
|
var DynamicHeading = (props) => {
|
|
17221
17293
|
const { text, size = "md", align = "left", margin = "md", control } = props.component;
|
|
17222
17294
|
const classes = (0, import_classnames13.default)(getTextAlignmentAndMargin2({ align, margin }));
|
|
17223
|
-
return control === "display" ? /* @__PURE__ */ (0,
|
|
17295
|
+
return control === "display" ? /* @__PURE__ */ (0, import_jsx_runtime104.jsx)(DisplayHeading2, { size, text, classes }) : /* @__PURE__ */ (0, import_jsx_runtime104.jsx)(StandardHeading2, { size, text, classes });
|
|
17224
17296
|
};
|
|
17225
17297
|
var StandardHeading2 = ({ size, text, classes }) => {
|
|
17226
17298
|
switch (size) {
|
|
17227
17299
|
case "xs":
|
|
17228
|
-
return /* @__PURE__ */ (0,
|
|
17300
|
+
return /* @__PURE__ */ (0, import_jsx_runtime104.jsx)("h5", { className: classes, children: text });
|
|
17229
17301
|
case "sm":
|
|
17230
|
-
return /* @__PURE__ */ (0,
|
|
17302
|
+
return /* @__PURE__ */ (0, import_jsx_runtime104.jsx)("h4", { className: classes, children: text });
|
|
17231
17303
|
case "lg":
|
|
17232
|
-
return /* @__PURE__ */ (0,
|
|
17304
|
+
return /* @__PURE__ */ (0, import_jsx_runtime104.jsx)("h2", { className: classes, children: text });
|
|
17233
17305
|
case "xl":
|
|
17234
|
-
return /* @__PURE__ */ (0,
|
|
17306
|
+
return /* @__PURE__ */ (0, import_jsx_runtime104.jsx)("h1", { className: classes, children: text });
|
|
17235
17307
|
case "md":
|
|
17236
17308
|
default:
|
|
17237
|
-
return /* @__PURE__ */ (0,
|
|
17309
|
+
return /* @__PURE__ */ (0, import_jsx_runtime104.jsx)("h3", { className: classes, children: text });
|
|
17238
17310
|
}
|
|
17239
17311
|
};
|
|
17240
17312
|
var DisplayHeading2 = ({ size, text, classes }) => {
|
|
17241
17313
|
switch (size) {
|
|
17242
17314
|
case "xs":
|
|
17243
17315
|
case "sm":
|
|
17244
|
-
return /* @__PURE__ */ (0,
|
|
17316
|
+
return /* @__PURE__ */ (0, import_jsx_runtime104.jsx)(import_components60.Display, { type: "display-small", className: classes, children: text });
|
|
17245
17317
|
case "xl":
|
|
17246
17318
|
case "lg":
|
|
17247
|
-
return /* @__PURE__ */ (0,
|
|
17319
|
+
return /* @__PURE__ */ (0, import_jsx_runtime104.jsx)(import_components60.Display, { type: "display-large", className: classes, children: text });
|
|
17248
17320
|
case "md":
|
|
17249
17321
|
default:
|
|
17250
|
-
return /* @__PURE__ */ (0,
|
|
17322
|
+
return /* @__PURE__ */ (0, import_jsx_runtime104.jsx)(import_components60.Display, { type: "display-medium", className: classes, children: text });
|
|
17251
17323
|
}
|
|
17252
17324
|
};
|
|
17253
17325
|
var DynamicHeading_default = DynamicHeading;
|
|
17254
17326
|
|
|
17255
17327
|
// src/legacy/layout/markdown/DynamicMarkdown.tsx
|
|
17256
17328
|
var import_components61 = require("@transferwise/components");
|
|
17257
|
-
var
|
|
17329
|
+
var import_jsx_runtime105 = require("react/jsx-runtime");
|
|
17258
17330
|
var DynamicMarkdown = ({ component }) => {
|
|
17259
17331
|
const { content, align, margin } = component;
|
|
17260
|
-
return /* @__PURE__ */ (0,
|
|
17332
|
+
return /* @__PURE__ */ (0, import_jsx_runtime105.jsx)("div", { className: getTextAlignmentAndMargin2({ align, margin }), children: /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(import_components61.Markdown, { config: { link: { target: "_blank" } }, children: content }) });
|
|
17261
17333
|
};
|
|
17262
17334
|
var DynamicInfo = ({ component }) => {
|
|
17263
|
-
return /* @__PURE__ */ (0,
|
|
17335
|
+
return /* @__PURE__ */ (0, import_jsx_runtime105.jsx)("div", { className: getTextAlignmentAndMargin2(component), children: /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(import_components61.Markdown, { config: { link: { target: "_blank" } }, children: component.markdown }) });
|
|
17264
17336
|
};
|
|
17265
17337
|
|
|
17266
17338
|
// src/legacy/layout/image/DynamicImage.tsx
|
|
17267
17339
|
var import_components62 = require("@transferwise/components");
|
|
17268
|
-
var
|
|
17269
|
-
var
|
|
17340
|
+
var import_react48 = require("react");
|
|
17341
|
+
var import_jsx_runtime106 = require("react/jsx-runtime");
|
|
17270
17342
|
function DynamicImage({ component: image }) {
|
|
17271
17343
|
const { url, size, text, margin, accessibilityDescription } = image;
|
|
17272
17344
|
const httpClient = useHttpClient();
|
|
17273
|
-
const [imageSource, setImageSource] = (0,
|
|
17274
|
-
(0,
|
|
17345
|
+
const [imageSource, setImageSource] = (0, import_react48.useState)("");
|
|
17346
|
+
(0, import_react48.useEffect)(() => {
|
|
17275
17347
|
void getImageSource2(httpClient, url).then(setImageSource);
|
|
17276
17348
|
}, [url, httpClient]);
|
|
17277
17349
|
const imageProps = {
|
|
@@ -17283,7 +17355,7 @@ function DynamicImage({ component: image }) {
|
|
|
17283
17355
|
if (!imageSource) {
|
|
17284
17356
|
return null;
|
|
17285
17357
|
}
|
|
17286
|
-
return /* @__PURE__ */ (0,
|
|
17358
|
+
return /* @__PURE__ */ (0, import_jsx_runtime106.jsx)("div", { className: `df-image ${size || "md"}`, children: /* @__PURE__ */ (0, import_jsx_runtime106.jsx)(import_components62.Image, __spreadValues({ className: `img-responsive ${getMargin2(margin || "md")}` }, imageProps)) });
|
|
17287
17359
|
}
|
|
17288
17360
|
var readImageBlobAsDataURL2 = (imageBlob) => (
|
|
17289
17361
|
// we can safely assume the type of reader.result is string
|
|
@@ -17320,47 +17392,47 @@ var DynamicImage_default = DynamicImage;
|
|
|
17320
17392
|
|
|
17321
17393
|
// src/legacy/layout/instructions/DynamicInstructions.tsx
|
|
17322
17394
|
var import_components63 = require("@transferwise/components");
|
|
17323
|
-
var
|
|
17395
|
+
var import_jsx_runtime107 = require("react/jsx-runtime");
|
|
17324
17396
|
var doContext2 = ["positive", "neutral"];
|
|
17325
17397
|
var dontContext2 = ["warning", "negative"];
|
|
17326
17398
|
var DynamicInstructions = ({ component }) => {
|
|
17327
17399
|
const { items } = component;
|
|
17328
17400
|
const dos = items.filter((item) => doContext2.includes(item.context)).map(({ text }) => text);
|
|
17329
17401
|
const donts = items.filter((item) => dontContext2.includes(item.context)).map(({ text }) => text);
|
|
17330
|
-
return /* @__PURE__ */ (0,
|
|
17331
|
-
component.title ? /* @__PURE__ */ (0,
|
|
17332
|
-
/* @__PURE__ */ (0,
|
|
17402
|
+
return /* @__PURE__ */ (0, import_jsx_runtime107.jsxs)("div", { className: getMargin2(component.margin || "md"), children: [
|
|
17403
|
+
component.title ? /* @__PURE__ */ (0, import_jsx_runtime107.jsx)(import_components63.Header, { title: component.title }) : null,
|
|
17404
|
+
/* @__PURE__ */ (0, import_jsx_runtime107.jsx)(import_components63.InstructionsList, { dos, donts })
|
|
17333
17405
|
] });
|
|
17334
17406
|
};
|
|
17335
17407
|
var DynamicInstructions_default = DynamicInstructions;
|
|
17336
17408
|
|
|
17337
17409
|
// src/legacy/layout/DynamicLayout.tsx
|
|
17338
|
-
var
|
|
17410
|
+
var import_jsx_runtime108 = require("react/jsx-runtime");
|
|
17339
17411
|
var getKey = (component) => JSON.stringify(component);
|
|
17340
17412
|
function DynamicLayout(props) {
|
|
17341
17413
|
const { components, model, submitted, errors, onModelChange, onAction, onPersistAsync, baseUrl } = props;
|
|
17342
17414
|
const renderComponent = (component) => {
|
|
17343
17415
|
switch (component.type) {
|
|
17344
17416
|
case "heading":
|
|
17345
|
-
return /* @__PURE__ */ (0,
|
|
17417
|
+
return /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(DynamicHeading_default, { component }, getKey(component));
|
|
17346
17418
|
case "paragraph":
|
|
17347
|
-
return /* @__PURE__ */ (0,
|
|
17419
|
+
return /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(DynamicParagraph_default, { component }, getKey(component));
|
|
17348
17420
|
case "image":
|
|
17349
|
-
return /* @__PURE__ */ (0,
|
|
17421
|
+
return /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(DynamicImage_default, { component }, getKey(component));
|
|
17350
17422
|
case "alert":
|
|
17351
|
-
return /* @__PURE__ */ (0,
|
|
17423
|
+
return /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(DynamicAlert_default, { component }, getKey(component));
|
|
17352
17424
|
case "review":
|
|
17353
|
-
return /* @__PURE__ */ (0,
|
|
17425
|
+
return /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(DynamicReview_default, { component, onAction }, getKey(component));
|
|
17354
17426
|
case "divider":
|
|
17355
|
-
return /* @__PURE__ */ (0,
|
|
17427
|
+
return /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(DynamicDivider_default, { component }, getKey(component));
|
|
17356
17428
|
case "info":
|
|
17357
|
-
return /* @__PURE__ */ (0,
|
|
17429
|
+
return /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(DynamicInfo, { component }, getKey(component));
|
|
17358
17430
|
case "instructions":
|
|
17359
|
-
return /* @__PURE__ */ (0,
|
|
17431
|
+
return /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(DynamicInstructions_default, { component }, getKey(component));
|
|
17360
17432
|
case "markdown":
|
|
17361
|
-
return /* @__PURE__ */ (0,
|
|
17433
|
+
return /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(DynamicMarkdown, { component }, getKey(component));
|
|
17362
17434
|
case "columns":
|
|
17363
|
-
return /* @__PURE__ */ (0,
|
|
17435
|
+
return /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(
|
|
17364
17436
|
DynamicColumns_default,
|
|
17365
17437
|
{
|
|
17366
17438
|
component,
|
|
@@ -17374,7 +17446,7 @@ function DynamicLayout(props) {
|
|
|
17374
17446
|
getKey(component)
|
|
17375
17447
|
);
|
|
17376
17448
|
case "form":
|
|
17377
|
-
return /* @__PURE__ */ (0,
|
|
17449
|
+
return /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(
|
|
17378
17450
|
DynamicForm_default,
|
|
17379
17451
|
{
|
|
17380
17452
|
component,
|
|
@@ -17387,9 +17459,9 @@ function DynamicLayout(props) {
|
|
|
17387
17459
|
getKey(__spreadProps(__spreadValues({}, component), { errors: errors != null ? errors : null }))
|
|
17388
17460
|
);
|
|
17389
17461
|
case "button":
|
|
17390
|
-
return /* @__PURE__ */ (0,
|
|
17462
|
+
return /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(DynamicButton_default, { component, onAction }, getKey(component));
|
|
17391
17463
|
case "box":
|
|
17392
|
-
return /* @__PURE__ */ (0,
|
|
17464
|
+
return /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(
|
|
17393
17465
|
DynamicBox_default,
|
|
17394
17466
|
{
|
|
17395
17467
|
component,
|
|
@@ -17403,18 +17475,18 @@ function DynamicLayout(props) {
|
|
|
17403
17475
|
getKey(component)
|
|
17404
17476
|
);
|
|
17405
17477
|
case "decision":
|
|
17406
|
-
return /* @__PURE__ */ (0,
|
|
17478
|
+
return /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(DynamicDecision_default, { component, onAction }, getKey(component));
|
|
17407
17479
|
case "external":
|
|
17408
|
-
return /* @__PURE__ */ (0,
|
|
17480
|
+
return /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(DynamicExternal_default, { component, onAction }, getKey(component));
|
|
17409
17481
|
case "list":
|
|
17410
17482
|
case "status-list":
|
|
17411
|
-
return /* @__PURE__ */ (0,
|
|
17483
|
+
return /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(DynamicStatusList_default, { component, onAction }, getKey(component));
|
|
17412
17484
|
case "loading-indicator":
|
|
17413
|
-
return /* @__PURE__ */ (0,
|
|
17485
|
+
return /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(DynamicLoadingIndicator_default, { component }, getKey(component));
|
|
17414
17486
|
case "search":
|
|
17415
|
-
return /* @__PURE__ */ (0,
|
|
17487
|
+
return /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(DynamicSearch_default, { component, onAction }, getKey(component));
|
|
17416
17488
|
case "modal":
|
|
17417
|
-
return /* @__PURE__ */ (0,
|
|
17489
|
+
return /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(
|
|
17418
17490
|
DynamicModal_default,
|
|
17419
17491
|
{
|
|
17420
17492
|
component,
|
|
@@ -17428,22 +17500,22 @@ function DynamicLayout(props) {
|
|
|
17428
17500
|
getKey(component)
|
|
17429
17501
|
);
|
|
17430
17502
|
default:
|
|
17431
|
-
return /* @__PURE__ */ (0,
|
|
17503
|
+
return /* @__PURE__ */ (0, import_jsx_runtime108.jsx)("div", {}, getKey(component));
|
|
17432
17504
|
}
|
|
17433
17505
|
};
|
|
17434
17506
|
if (useHasHttpClientProvider() || baseUrl == null) {
|
|
17435
|
-
return /* @__PURE__ */ (0,
|
|
17507
|
+
return /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(import_jsx_runtime108.Fragment, { children: components.map(renderComponent) });
|
|
17436
17508
|
}
|
|
17437
|
-
return /* @__PURE__ */ (0,
|
|
17509
|
+
return /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(HttpClientProviderFromBaseUrl, { baseUrl, children: components.map(renderComponent) });
|
|
17438
17510
|
}
|
|
17439
17511
|
var DynamicLayout_default = DynamicLayout;
|
|
17440
17512
|
|
|
17441
17513
|
// src/legacy/layout/list/DynamicStatusList.tsx
|
|
17442
17514
|
var import_components64 = require("@transferwise/components");
|
|
17443
|
-
var
|
|
17515
|
+
var import_jsx_runtime109 = require("react/jsx-runtime");
|
|
17444
17516
|
var DynamicStatusList = ({ component }) => {
|
|
17445
|
-
return /* @__PURE__ */ (0,
|
|
17446
|
-
component.title ? /* @__PURE__ */ (0,
|
|
17517
|
+
return /* @__PURE__ */ (0, import_jsx_runtime109.jsxs)("div", { className: getMargin2(component.margin || "md"), children: [
|
|
17518
|
+
component.title ? /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(import_components64.Header, { title: component.title }) : null,
|
|
17447
17519
|
component.items.map(mapListItemToSummary)
|
|
17448
17520
|
] });
|
|
17449
17521
|
};
|
|
@@ -17452,8 +17524,8 @@ var mapListItemToSummary = ({ title, description, icon, status }) => {
|
|
|
17452
17524
|
key: `${title}/${description || ""}`,
|
|
17453
17525
|
title,
|
|
17454
17526
|
description
|
|
17455
|
-
}, (icon == null ? void 0 : icon.name) ? { icon: /* @__PURE__ */ (0,
|
|
17456
|
-
return /* @__PURE__ */ (0,
|
|
17527
|
+
}, (icon == null ? void 0 : icon.name) ? { icon: /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(DynamicIcon_default2, { type: icon.name }) } : {}), status ? { status: statusMap[status] } : {});
|
|
17528
|
+
return /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(import_components64.Summary, __spreadValues({}, props));
|
|
17457
17529
|
};
|
|
17458
17530
|
var statusListMap = {
|
|
17459
17531
|
done: "done",
|
|
@@ -17470,10 +17542,10 @@ var DynamicStatusList_default = DynamicStatusList;
|
|
|
17470
17542
|
|
|
17471
17543
|
// src/legacy/layout/loadingIndicator/DynamicLoadingIndicator.tsx
|
|
17472
17544
|
var import_components65 = require("@transferwise/components");
|
|
17473
|
-
var
|
|
17545
|
+
var import_jsx_runtime110 = require("react/jsx-runtime");
|
|
17474
17546
|
var DynamicLoadingIndicator = ({ component }) => {
|
|
17475
17547
|
const { margin = "md", size = "md" } = component;
|
|
17476
|
-
return /* @__PURE__ */ (0,
|
|
17548
|
+
return /* @__PURE__ */ (0, import_jsx_runtime110.jsx)(
|
|
17477
17549
|
import_components65.Loader,
|
|
17478
17550
|
{
|
|
17479
17551
|
size,
|
|
@@ -17507,21 +17579,21 @@ var paragraph_messages_default2 = (0, import_react_intl35.defineMessages)({
|
|
|
17507
17579
|
|
|
17508
17580
|
// src/legacy/layout/paragraph/useSnackBarIfAvailable.ts
|
|
17509
17581
|
var import_components66 = require("@transferwise/components");
|
|
17510
|
-
var
|
|
17582
|
+
var import_react49 = require("react");
|
|
17511
17583
|
function useSnackBarIfAvailable2() {
|
|
17512
|
-
const context = (0,
|
|
17584
|
+
const context = (0, import_react49.useContext)(import_components66.SnackbarContext);
|
|
17513
17585
|
return context ? context.createSnackbar : noop3;
|
|
17514
17586
|
}
|
|
17515
17587
|
function noop3() {
|
|
17516
17588
|
}
|
|
17517
17589
|
|
|
17518
17590
|
// src/legacy/layout/paragraph/DynamicParagraph.tsx
|
|
17519
|
-
var
|
|
17591
|
+
var import_jsx_runtime111 = require("react/jsx-runtime");
|
|
17520
17592
|
function DynamicParagraph({ component }) {
|
|
17521
|
-
return component.control === "copyable" ? /* @__PURE__ */ (0,
|
|
17593
|
+
return component.control === "copyable" ? /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(CopyableDynamicParagraph, { component }) : /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(BasicDynamicParagraph, { component });
|
|
17522
17594
|
}
|
|
17523
17595
|
function BasicDynamicParagraph({ component }) {
|
|
17524
|
-
return /* @__PURE__ */ (0,
|
|
17596
|
+
return /* @__PURE__ */ (0, import_jsx_runtime111.jsxs)("p", { className: getTextAlignmentAndMargin2(component), children: [
|
|
17525
17597
|
" ",
|
|
17526
17598
|
component.text,
|
|
17527
17599
|
" "
|
|
@@ -17539,8 +17611,8 @@ function CopyableDynamicParagraph({ component }) {
|
|
|
17539
17611
|
align: component.align,
|
|
17540
17612
|
margin: "sm"
|
|
17541
17613
|
})} form-control`;
|
|
17542
|
-
return /* @__PURE__ */ (0,
|
|
17543
|
-
/* @__PURE__ */ (0,
|
|
17614
|
+
return /* @__PURE__ */ (0, import_jsx_runtime111.jsxs)("div", { className: getTextAlignmentAndMargin2(component), children: [
|
|
17615
|
+
/* @__PURE__ */ (0, import_jsx_runtime111.jsx)(
|
|
17544
17616
|
"input",
|
|
17545
17617
|
{
|
|
17546
17618
|
type: "text",
|
|
@@ -17550,7 +17622,7 @@ function CopyableDynamicParagraph({ component }) {
|
|
|
17550
17622
|
style: { textOverflow: "ellipsis" }
|
|
17551
17623
|
}
|
|
17552
17624
|
),
|
|
17553
|
-
/* @__PURE__ */ (0,
|
|
17625
|
+
/* @__PURE__ */ (0, import_jsx_runtime111.jsx)(import_components67.Button, { block: true, onClick: copy, children: formatMessage(paragraph_messages_default2.copy) })
|
|
17554
17626
|
] });
|
|
17555
17627
|
}
|
|
17556
17628
|
function noop4() {
|
|
@@ -17559,7 +17631,7 @@ var DynamicParagraph_default = DynamicParagraph;
|
|
|
17559
17631
|
|
|
17560
17632
|
// src/legacy/layout/review/DynamicReview.tsx
|
|
17561
17633
|
var import_components68 = require("@transferwise/components");
|
|
17562
|
-
var
|
|
17634
|
+
var import_jsx_runtime112 = require("react/jsx-runtime");
|
|
17563
17635
|
var getDefinitions = (orientation, review) => review.fields.map(({ label, value, help }, index) => ({
|
|
17564
17636
|
key: String(index),
|
|
17565
17637
|
title: label,
|
|
@@ -17567,14 +17639,14 @@ var getDefinitions = (orientation, review) => review.fields.map(({ label, value,
|
|
|
17567
17639
|
}));
|
|
17568
17640
|
var getFieldValue2 = (value, help, orientation) => {
|
|
17569
17641
|
if (help) {
|
|
17570
|
-
return orientation === "HORIZONTAL_RIGHT_ALIGNED" ? /* @__PURE__ */ (0,
|
|
17571
|
-
/* @__PURE__ */ (0,
|
|
17642
|
+
return orientation === "HORIZONTAL_RIGHT_ALIGNED" ? /* @__PURE__ */ (0, import_jsx_runtime112.jsxs)(import_jsx_runtime112.Fragment, { children: [
|
|
17643
|
+
/* @__PURE__ */ (0, import_jsx_runtime112.jsx)(Help_default2, { help }),
|
|
17572
17644
|
" ",
|
|
17573
17645
|
value
|
|
17574
|
-
] }) : /* @__PURE__ */ (0,
|
|
17646
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime112.jsxs)(import_jsx_runtime112.Fragment, { children: [
|
|
17575
17647
|
value,
|
|
17576
17648
|
" ",
|
|
17577
|
-
/* @__PURE__ */ (0,
|
|
17649
|
+
/* @__PURE__ */ (0, import_jsx_runtime112.jsx)(Help_default2, { help })
|
|
17578
17650
|
] });
|
|
17579
17651
|
}
|
|
17580
17652
|
return value;
|
|
@@ -17611,24 +17683,24 @@ function DynamicReview(props) {
|
|
|
17611
17683
|
const orientation = getDefinitionListLayout(review);
|
|
17612
17684
|
const callToAction = review.callToAction ? getReviewAction2(review.callToAction.title, review.callToAction.action) : null;
|
|
17613
17685
|
const legacyCallToAction = !callToAction && review.action ? getReviewAction2(review.action.title || "", review.action) : null;
|
|
17614
|
-
return /* @__PURE__ */ (0,
|
|
17615
|
-
review.title && /* @__PURE__ */ (0,
|
|
17616
|
-
/* @__PURE__ */ (0,
|
|
17686
|
+
return /* @__PURE__ */ (0, import_jsx_runtime112.jsxs)("div", { className: margin, children: [
|
|
17687
|
+
review.title && /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(import_components68.Header, { title: review.title, action: callToAction || legacyCallToAction || void 0 }),
|
|
17688
|
+
/* @__PURE__ */ (0, import_jsx_runtime112.jsx)("div", { className: margin, children: /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(import_components68.DefinitionList, { layout: orientation, definitions: getDefinitions(orientation, review) }) })
|
|
17617
17689
|
] });
|
|
17618
17690
|
}
|
|
17619
17691
|
var DynamicReview_default = DynamicReview;
|
|
17620
17692
|
|
|
17621
17693
|
// src/legacy/layout/search/DynamicSearch.tsx
|
|
17622
|
-
var
|
|
17694
|
+
var import_react51 = require("react");
|
|
17623
17695
|
var import_icons5 = require("@transferwise/icons");
|
|
17624
17696
|
|
|
17625
17697
|
// src/legacy/layout/search/SearchInput.tsx
|
|
17626
17698
|
var import_components69 = require("@transferwise/components");
|
|
17627
|
-
var
|
|
17699
|
+
var import_jsx_runtime113 = require("react/jsx-runtime");
|
|
17628
17700
|
var SearchInput = ({ title, value, onFocus, onChange }) => {
|
|
17629
|
-
return /* @__PURE__ */ (0,
|
|
17701
|
+
return /* @__PURE__ */ (0, import_jsx_runtime113.jsxs)("label", { className: "control-label d-inline", children: [
|
|
17630
17702
|
title,
|
|
17631
|
-
/* @__PURE__ */ (0,
|
|
17703
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsx)(
|
|
17632
17704
|
import_components69.Input,
|
|
17633
17705
|
{
|
|
17634
17706
|
type: "text",
|
|
@@ -17644,12 +17716,12 @@ var SearchInput = ({ title, value, onFocus, onChange }) => {
|
|
|
17644
17716
|
// src/legacy/layout/search/SearchResults.tsx
|
|
17645
17717
|
var import_components70 = require("@transferwise/components");
|
|
17646
17718
|
var import_react_intl37 = require("react-intl");
|
|
17647
|
-
var
|
|
17719
|
+
var import_jsx_runtime114 = require("react/jsx-runtime");
|
|
17648
17720
|
function SearchResults2({ results, emptyMessage, onSelect }) {
|
|
17649
17721
|
if (results.length === 0) {
|
|
17650
|
-
return /* @__PURE__ */ (0,
|
|
17722
|
+
return /* @__PURE__ */ (0, import_jsx_runtime114.jsx)("p", { className: "m-t-2", children: emptyMessage });
|
|
17651
17723
|
}
|
|
17652
|
-
return /* @__PURE__ */ (0,
|
|
17724
|
+
return /* @__PURE__ */ (0, import_jsx_runtime114.jsx)(import_components70.NavigationOptionsList, { children: results.map((result) => /* @__PURE__ */ (0, import_jsx_runtime114.jsx)(
|
|
17653
17725
|
import_components70.NavigationOption,
|
|
17654
17726
|
{
|
|
17655
17727
|
title: result.title,
|
|
@@ -17664,10 +17736,10 @@ function SearchResults2({ results, emptyMessage, onSelect }) {
|
|
|
17664
17736
|
}
|
|
17665
17737
|
function ErrorResult2({ onRetrySearch }) {
|
|
17666
17738
|
const intl = (0, import_react_intl37.useIntl)();
|
|
17667
|
-
return /* @__PURE__ */ (0,
|
|
17739
|
+
return /* @__PURE__ */ (0, import_jsx_runtime114.jsxs)("p", { className: "m-t-2", children: [
|
|
17668
17740
|
intl.formatMessage(generic_error_messages_default.genericError),
|
|
17669
17741
|
"\xA0",
|
|
17670
|
-
/* @__PURE__ */ (0,
|
|
17742
|
+
/* @__PURE__ */ (0, import_jsx_runtime114.jsx)(
|
|
17671
17743
|
"a",
|
|
17672
17744
|
{
|
|
17673
17745
|
href: "/",
|
|
@@ -17682,15 +17754,15 @@ function ErrorResult2({ onRetrySearch }) {
|
|
|
17682
17754
|
}
|
|
17683
17755
|
|
|
17684
17756
|
// src/legacy/layout/search/useSearch.tsx
|
|
17685
|
-
var
|
|
17757
|
+
var import_react50 = require("react");
|
|
17686
17758
|
var headers = { "Content-Type": "application/json" };
|
|
17687
17759
|
var useSearch = (defaultSearchConfig) => {
|
|
17688
|
-
const [state, setState] = (0,
|
|
17760
|
+
const [state, setState] = (0, import_react50.useState)({
|
|
17689
17761
|
status: "idle"
|
|
17690
17762
|
});
|
|
17691
|
-
const abortControllerRef = (0,
|
|
17763
|
+
const abortControllerRef = (0, import_react50.useRef)(null);
|
|
17692
17764
|
const httpClient = useHttpClient();
|
|
17693
|
-
const search = (0,
|
|
17765
|
+
const search = (0, import_react50.useCallback)(
|
|
17694
17766
|
async (query, { url, method, param } = defaultSearchConfig) => {
|
|
17695
17767
|
var _a;
|
|
17696
17768
|
(_a = abortControllerRef.current) == null ? void 0 : _a.abort();
|
|
@@ -17753,14 +17825,14 @@ var addQueryParameter2 = (url, key, value) => {
|
|
|
17753
17825
|
// src/legacy/layout/search/DynamicSearch.tsx
|
|
17754
17826
|
var import_components71 = require("@transferwise/components");
|
|
17755
17827
|
var import_classnames14 = __toESM(require_classnames());
|
|
17756
|
-
var
|
|
17828
|
+
var import_jsx_runtime115 = require("react/jsx-runtime");
|
|
17757
17829
|
var DEBOUNCE_TIME2 = 400;
|
|
17758
17830
|
function DynamicSearch({ component, onAction }) {
|
|
17759
|
-
const [query, setQuery] = (0,
|
|
17831
|
+
const [query, setQuery] = (0, import_react51.useState)("");
|
|
17760
17832
|
const { control, title, margin, url, method, param, emptyMessage } = component;
|
|
17761
17833
|
const { status, results, search } = useSearch({ url, method, param });
|
|
17762
17834
|
const onEvent = useEventDispatcher();
|
|
17763
|
-
const debouncedSearch = (0,
|
|
17835
|
+
const debouncedSearch = (0, import_react51.useMemo)(() => debounce2(search, DEBOUNCE_TIME2), [search]);
|
|
17764
17836
|
const onSearchStart = () => {
|
|
17765
17837
|
onEvent("Dynamic Flow - Search Started", {});
|
|
17766
17838
|
};
|
|
@@ -17789,16 +17861,16 @@ function DynamicSearch({ component, onAction }) {
|
|
|
17789
17861
|
void search(query);
|
|
17790
17862
|
};
|
|
17791
17863
|
if (control === "inline") {
|
|
17792
|
-
return /* @__PURE__ */ (0,
|
|
17864
|
+
return /* @__PURE__ */ (0, import_jsx_runtime115.jsx)("div", { className: (0, import_classnames14.default)(getMargin2(margin != null ? margin : "md"), "df-search-typeahead"), children: /* @__PURE__ */ (0, import_jsx_runtime115.jsxs)("label", { className: "control-label d-inline", children: [
|
|
17793
17865
|
title,
|
|
17794
|
-
/* @__PURE__ */ (0,
|
|
17866
|
+
/* @__PURE__ */ (0, import_jsx_runtime115.jsx)("div", { className: "m-t-1", children: /* @__PURE__ */ (0, import_jsx_runtime115.jsx)(
|
|
17795
17867
|
import_components71.Typeahead,
|
|
17796
17868
|
{
|
|
17797
17869
|
id: "typeahead-input-id",
|
|
17798
17870
|
name: "typeahead-input-name",
|
|
17799
17871
|
size: "md",
|
|
17800
17872
|
maxHeight: 100,
|
|
17801
|
-
footer: /* @__PURE__ */ (0,
|
|
17873
|
+
footer: /* @__PURE__ */ (0, import_jsx_runtime115.jsx)(
|
|
17802
17874
|
TypeaheadFooter2,
|
|
17803
17875
|
{
|
|
17804
17876
|
state: status,
|
|
@@ -17809,7 +17881,7 @@ function DynamicSearch({ component, onAction }) {
|
|
|
17809
17881
|
),
|
|
17810
17882
|
multiple: false,
|
|
17811
17883
|
clearable: false,
|
|
17812
|
-
addon: /* @__PURE__ */ (0,
|
|
17884
|
+
addon: /* @__PURE__ */ (0, import_jsx_runtime115.jsx)(import_icons5.Search, { size: 24 }),
|
|
17813
17885
|
options: results.map(mapResultToTypeaheadOption2),
|
|
17814
17886
|
onChange: (values) => {
|
|
17815
17887
|
if (values.length > 0) {
|
|
@@ -17824,11 +17896,11 @@ function DynamicSearch({ component, onAction }) {
|
|
|
17824
17896
|
) })
|
|
17825
17897
|
] }) });
|
|
17826
17898
|
}
|
|
17827
|
-
return /* @__PURE__ */ (0,
|
|
17828
|
-
/* @__PURE__ */ (0,
|
|
17829
|
-
status === "loading" && /* @__PURE__ */ (0,
|
|
17830
|
-
status === "error" && /* @__PURE__ */ (0,
|
|
17831
|
-
status === "success" && /* @__PURE__ */ (0,
|
|
17899
|
+
return /* @__PURE__ */ (0, import_jsx_runtime115.jsxs)("div", { className: getMargin2(margin != null ? margin : "md"), children: [
|
|
17900
|
+
/* @__PURE__ */ (0, import_jsx_runtime115.jsx)(SearchInput, { title, value: query, onChange, onFocus: onSearchStart }),
|
|
17901
|
+
status === "loading" && /* @__PURE__ */ (0, import_jsx_runtime115.jsx)(DynamicLoadingIndicator_default, { component: { type: "loading-indicator", size: "sm" } }),
|
|
17902
|
+
status === "error" && /* @__PURE__ */ (0, import_jsx_runtime115.jsx)(ErrorResult2, { onRetrySearch }),
|
|
17903
|
+
status === "success" && /* @__PURE__ */ (0, import_jsx_runtime115.jsx)(SearchResults2, { results, emptyMessage, onSelect: onResultSelected })
|
|
17832
17904
|
] });
|
|
17833
17905
|
}
|
|
17834
17906
|
function mapResultToTypeaheadOption2(result) {
|
|
@@ -17847,13 +17919,13 @@ function TypeaheadFooter2({
|
|
|
17847
17919
|
emptyMessage
|
|
17848
17920
|
}) {
|
|
17849
17921
|
if (state === "success" && results.length === 0) {
|
|
17850
|
-
return /* @__PURE__ */ (0,
|
|
17922
|
+
return /* @__PURE__ */ (0, import_jsx_runtime115.jsx)(import_components71.Markdown, { className: "m-t-2 m-x-2", config: { link: { target: "_blank" } }, children: emptyMessage });
|
|
17851
17923
|
}
|
|
17852
17924
|
if (state === "error" && results.length === 0) {
|
|
17853
|
-
return /* @__PURE__ */ (0,
|
|
17925
|
+
return /* @__PURE__ */ (0, import_jsx_runtime115.jsx)("div", { className: "m-t-2 m-x-2", children: /* @__PURE__ */ (0, import_jsx_runtime115.jsx)(ErrorResult2, { onRetrySearch }) });
|
|
17854
17926
|
}
|
|
17855
17927
|
if (state === "loading" || results.length === 0) {
|
|
17856
|
-
return /* @__PURE__ */ (0,
|
|
17928
|
+
return /* @__PURE__ */ (0, import_jsx_runtime115.jsx)("p", { className: "m-t-2 m-x-2", children: "Loading..." });
|
|
17857
17929
|
}
|
|
17858
17930
|
return null;
|
|
17859
17931
|
}
|
|
@@ -17861,21 +17933,21 @@ var DynamicSearch_default = DynamicSearch;
|
|
|
17861
17933
|
|
|
17862
17934
|
// src/legacy/layout/modal/DynamicModal.tsx
|
|
17863
17935
|
var import_components72 = require("@transferwise/components");
|
|
17864
|
-
var
|
|
17865
|
-
var
|
|
17936
|
+
var import_react52 = require("react");
|
|
17937
|
+
var import_jsx_runtime116 = require("react/jsx-runtime");
|
|
17866
17938
|
function DynamicModal(props) {
|
|
17867
|
-
const [visible, isVisible] = (0,
|
|
17939
|
+
const [visible, isVisible] = (0, import_react52.useState)(false);
|
|
17868
17940
|
const { component, onAction } = props;
|
|
17869
17941
|
const { margin = "md" } = component;
|
|
17870
|
-
return /* @__PURE__ */ (0,
|
|
17871
|
-
/* @__PURE__ */ (0,
|
|
17872
|
-
/* @__PURE__ */ (0,
|
|
17942
|
+
return /* @__PURE__ */ (0, import_jsx_runtime116.jsxs)("div", { className: getTextAlignmentAndMargin2({ margin }), children: [
|
|
17943
|
+
/* @__PURE__ */ (0, import_jsx_runtime116.jsx)(import_components72.Button, { priority: "tertiary", block: true, onClick: () => isVisible(true), children: component.trigger.title }),
|
|
17944
|
+
/* @__PURE__ */ (0, import_jsx_runtime116.jsx)(
|
|
17873
17945
|
import_components72.Modal,
|
|
17874
17946
|
{
|
|
17875
17947
|
scroll: "content",
|
|
17876
17948
|
open: visible,
|
|
17877
17949
|
size: "lg",
|
|
17878
|
-
body: /* @__PURE__ */ (0,
|
|
17950
|
+
body: /* @__PURE__ */ (0, import_jsx_runtime116.jsx)(
|
|
17879
17951
|
DynamicLayout_default,
|
|
17880
17952
|
__spreadProps(__spreadValues({}, props), {
|
|
17881
17953
|
components: component.content.components,
|
|
@@ -17893,7 +17965,7 @@ function DynamicModal(props) {
|
|
|
17893
17965
|
var DynamicModal_default = DynamicModal;
|
|
17894
17966
|
|
|
17895
17967
|
// src/legacy/jsonSchemaForm/basicTypeSchema/BasicTypeSchema.tsx
|
|
17896
|
-
var
|
|
17968
|
+
var import_jsx_runtime117 = require("react/jsx-runtime");
|
|
17897
17969
|
var isNullish3 = (value) => isNull3(value) || isUndefined3(value);
|
|
17898
17970
|
var getDefaultValue = (schema) => {
|
|
17899
17971
|
return schema.type === "boolean" && isNullish3(schema.default) ? false : schema.default;
|
|
@@ -17931,13 +18003,13 @@ var BasicTypeSchema = (props) => {
|
|
|
17931
18003
|
props.onBlur();
|
|
17932
18004
|
}
|
|
17933
18005
|
};
|
|
17934
|
-
const [model, setModel] = (0,
|
|
17935
|
-
const [lastModel, setLastModel] = (0,
|
|
17936
|
-
const [changed, setChanged] = (0,
|
|
17937
|
-
const [focused, setFocused] = (0,
|
|
17938
|
-
const [blurred, setBlurred] = (0,
|
|
17939
|
-
const [validations, setValidations] = (0,
|
|
17940
|
-
const id = (0,
|
|
18006
|
+
const [model, setModel] = (0, import_react53.useState)((_a = props.model) != null ? _a : null);
|
|
18007
|
+
const [lastModel, setLastModel] = (0, import_react53.useState)((_b = props.model) != null ? _b : null);
|
|
18008
|
+
const [changed, setChanged] = (0, import_react53.useState)(false);
|
|
18009
|
+
const [focused, setFocused] = (0, import_react53.useState)(false);
|
|
18010
|
+
const [blurred, setBlurred] = (0, import_react53.useState)(false);
|
|
18011
|
+
const [validations, setValidations] = (0, import_react53.useState)([]);
|
|
18012
|
+
const id = (0, import_react53.useMemo)(() => props.schema.$id || generateRandomId(), [props.schema.$id]);
|
|
17941
18013
|
const onSchemaChange = () => {
|
|
17942
18014
|
const defaultValue = getDefaultValue(props.schema);
|
|
17943
18015
|
if (isNullish3(model) && !isNullish3(defaultValue)) {
|
|
@@ -17952,9 +18024,9 @@ var BasicTypeSchema = (props) => {
|
|
|
17952
18024
|
};
|
|
17953
18025
|
const isConst = props.schema.const;
|
|
17954
18026
|
const isHidden = props.schema.hidden || isConst;
|
|
17955
|
-
(0,
|
|
17956
|
-
(0,
|
|
17957
|
-
(0,
|
|
18027
|
+
(0, import_react53.useEffect)(refreshValidations, [props.model, props.submitted]);
|
|
18028
|
+
(0, import_react53.useEffect)(onSchemaChange, [props.schema]);
|
|
18029
|
+
(0, import_react53.useEffect)(() => {
|
|
17958
18030
|
var _a2;
|
|
17959
18031
|
const newModel = (_a2 = props.model) != null ? _a2 : null;
|
|
17960
18032
|
if (newModel !== model) {
|
|
@@ -17969,15 +18041,15 @@ var BasicTypeSchema = (props) => {
|
|
|
17969
18041
|
const showLabel = props.schema.format !== "file" && props.schema.type !== "boolean";
|
|
17970
18042
|
const schemaHelp = props.schema.help;
|
|
17971
18043
|
const feedbackId = `${id}-feedback`;
|
|
17972
|
-
return !isHidden ? /* @__PURE__ */ (0,
|
|
17973
|
-
props.schema.alert && /* @__PURE__ */ (0,
|
|
17974
|
-
/* @__PURE__ */ (0,
|
|
17975
|
-
showLabel && /* @__PURE__ */ (0,
|
|
17976
|
-
/* @__PURE__ */ (0,
|
|
17977
|
-
!!schemaHelp && /* @__PURE__ */ (0,
|
|
18044
|
+
return !isHidden ? /* @__PURE__ */ (0, import_jsx_runtime117.jsxs)(import_jsx_runtime117.Fragment, { children: [
|
|
18045
|
+
props.schema.alert && /* @__PURE__ */ (0, import_jsx_runtime117.jsx)(DynamicAlert_default, { component: props.schema.alert }),
|
|
18046
|
+
/* @__PURE__ */ (0, import_jsx_runtime117.jsxs)("div", { className: (0, import_classnames15.default)(formGroupClasses), children: [
|
|
18047
|
+
showLabel && /* @__PURE__ */ (0, import_jsx_runtime117.jsxs)("div", { className: "d-inline-block m-b-1", children: [
|
|
18048
|
+
/* @__PURE__ */ (0, import_jsx_runtime117.jsx)("label", { className: "control-label d-inline", htmlFor: id, children: props.schema.title }),
|
|
18049
|
+
!!schemaHelp && /* @__PURE__ */ (0, import_jsx_runtime117.jsx)(Help_default2, { help: schemaHelp })
|
|
17978
18050
|
] }),
|
|
17979
|
-
!showLabel && !!schemaHelp && /* @__PURE__ */ (0,
|
|
17980
|
-
/* @__PURE__ */ (0,
|
|
18051
|
+
!showLabel && !!schemaHelp && /* @__PURE__ */ (0, import_jsx_runtime117.jsx)(Help_default2, { help: schemaHelp }),
|
|
18052
|
+
/* @__PURE__ */ (0, import_jsx_runtime117.jsx)(
|
|
17981
18053
|
SchemaFormControl_default,
|
|
17982
18054
|
{
|
|
17983
18055
|
id,
|
|
@@ -17990,7 +18062,7 @@ var BasicTypeSchema = (props) => {
|
|
|
17990
18062
|
describedBy: feedbackId
|
|
17991
18063
|
}
|
|
17992
18064
|
),
|
|
17993
|
-
/* @__PURE__ */ (0,
|
|
18065
|
+
/* @__PURE__ */ (0, import_jsx_runtime117.jsx)(
|
|
17994
18066
|
ControlFeedback_default,
|
|
17995
18067
|
{
|
|
17996
18068
|
id: feedbackId,
|
|
@@ -18015,7 +18087,7 @@ BasicTypeSchema.defaultProps = {
|
|
|
18015
18087
|
var BasicTypeSchema_default = BasicTypeSchema;
|
|
18016
18088
|
|
|
18017
18089
|
// src/legacy/jsonSchemaForm/persistAsyncSchema/persistAsyncBasicSchema/PersistAsyncBasicSchema.tsx
|
|
18018
|
-
var
|
|
18090
|
+
var import_jsx_runtime118 = require("react/jsx-runtime");
|
|
18019
18091
|
var getIdFromResponse = (idProperty, response) => response[idProperty];
|
|
18020
18092
|
var getErrorFromResponse = (errorProperty, response) => {
|
|
18021
18093
|
var _a;
|
|
@@ -18033,12 +18105,12 @@ function PersistAsyncBasicSchema(props) {
|
|
|
18033
18105
|
const intl = (0, import_react_intl38.useIntl)();
|
|
18034
18106
|
const httpClient = useHttpClient();
|
|
18035
18107
|
const onEvent = useEventDispatcher();
|
|
18036
|
-
const [persistAsyncModel, setPersistAsyncModel] = (0,
|
|
18108
|
+
const [persistAsyncModel, setPersistAsyncModel] = (0, import_react54.useState)(null);
|
|
18037
18109
|
const previousPersistAsyncModel = usePrevious(persistAsyncModel);
|
|
18038
|
-
const [persistAsyncError, setPersistAsyncError] = (0,
|
|
18039
|
-
const [fieldSubmitted, setFieldSubmitted] = (0,
|
|
18040
|
-
const [abortController, setAbortController] = (0,
|
|
18041
|
-
(0,
|
|
18110
|
+
const [persistAsyncError, setPersistAsyncError] = (0, import_react54.useState)(null);
|
|
18111
|
+
const [fieldSubmitted, setFieldSubmitted] = (0, import_react54.useState)(false);
|
|
18112
|
+
const [abortController, setAbortController] = (0, import_react54.useState)(null);
|
|
18113
|
+
(0, import_react54.useEffect)(() => {
|
|
18042
18114
|
if (controlTypesWithPersistOnChange.has(
|
|
18043
18115
|
// TODO: LOW avoid type assertion below -- control type may be nullish. consider ?? ''
|
|
18044
18116
|
getControlType(schema.persistAsync.schema)
|
|
@@ -18105,7 +18177,7 @@ function PersistAsyncBasicSchema(props) {
|
|
|
18105
18177
|
setPersistAsyncModel(newPersistAsyncModel);
|
|
18106
18178
|
}
|
|
18107
18179
|
};
|
|
18108
|
-
return /* @__PURE__ */ (0,
|
|
18180
|
+
return /* @__PURE__ */ (0, import_jsx_runtime118.jsx)(
|
|
18109
18181
|
BasicTypeSchema_default,
|
|
18110
18182
|
{
|
|
18111
18183
|
required,
|
|
@@ -18126,7 +18198,7 @@ var PersistAsyncBasicSchema_default = PersistAsyncBasicSchema;
|
|
|
18126
18198
|
|
|
18127
18199
|
// src/legacy/common/hooks/usePersistAsync/usePersistAsync.ts
|
|
18128
18200
|
var usePersistAsync = (persistAsync) => {
|
|
18129
|
-
const [abortController, setAbortController] = (0,
|
|
18201
|
+
const [abortController, setAbortController] = (0, import_react55.useState)(null);
|
|
18130
18202
|
const httpClient = useHttpClient();
|
|
18131
18203
|
const intl = (0, import_react_intl39.useIntl)();
|
|
18132
18204
|
const { schema } = persistAsync;
|
|
@@ -18205,7 +18277,7 @@ function hasStringMessage(value) {
|
|
|
18205
18277
|
}
|
|
18206
18278
|
|
|
18207
18279
|
// src/legacy/common/hooks/usePolling/usePolling.tsx
|
|
18208
|
-
var
|
|
18280
|
+
var import_react56 = require("react");
|
|
18209
18281
|
function usePolling({
|
|
18210
18282
|
asyncFn,
|
|
18211
18283
|
interval,
|
|
@@ -18214,9 +18286,9 @@ function usePolling({
|
|
|
18214
18286
|
onPollingResponse,
|
|
18215
18287
|
onFailure
|
|
18216
18288
|
}) {
|
|
18217
|
-
const onPollingResponseReference = (0,
|
|
18218
|
-
const onFailureReference = (0,
|
|
18219
|
-
const poll = (0,
|
|
18289
|
+
const onPollingResponseReference = (0, import_react56.useRef)(onPollingResponse);
|
|
18290
|
+
const onFailureReference = (0, import_react56.useRef)(onFailure);
|
|
18291
|
+
const poll = (0, import_react56.useMemo)(
|
|
18220
18292
|
() => createPollingClosure(
|
|
18221
18293
|
asyncFn,
|
|
18222
18294
|
maxAttempts,
|
|
@@ -18226,7 +18298,7 @@ function usePolling({
|
|
|
18226
18298
|
),
|
|
18227
18299
|
[asyncFn, maxAttempts, maxConsecutiveFails]
|
|
18228
18300
|
);
|
|
18229
|
-
(0,
|
|
18301
|
+
(0, import_react56.useEffect)(() => {
|
|
18230
18302
|
if (interval > 0) {
|
|
18231
18303
|
const intervalReference = setInterval(() => {
|
|
18232
18304
|
poll();
|
|
@@ -18234,7 +18306,7 @@ function usePolling({
|
|
|
18234
18306
|
return () => clearInterval(intervalReference);
|
|
18235
18307
|
}
|
|
18236
18308
|
}, [poll, interval]);
|
|
18237
|
-
(0,
|
|
18309
|
+
(0, import_react56.useEffect)(() => {
|
|
18238
18310
|
onPollingResponseReference.current = onPollingResponse;
|
|
18239
18311
|
onFailureReference.current = onFailure;
|
|
18240
18312
|
}, [onPollingResponse, onFailure]);
|
|
@@ -18265,20 +18337,20 @@ function createPollingClosure(asyncFn, maxAttempts, maxConsecutiveFails, onPolli
|
|
|
18265
18337
|
}
|
|
18266
18338
|
|
|
18267
18339
|
// src/legacy/common/hooks/usePrevious/usePrevious.js
|
|
18268
|
-
var
|
|
18340
|
+
var import_react57 = require("react");
|
|
18269
18341
|
var usePrevious = (value) => {
|
|
18270
|
-
const reference = (0,
|
|
18271
|
-
(0,
|
|
18342
|
+
const reference = (0, import_react57.useRef)();
|
|
18343
|
+
(0, import_react57.useEffect)(() => {
|
|
18272
18344
|
reference.current = value;
|
|
18273
18345
|
}, [value]);
|
|
18274
18346
|
return reference.current;
|
|
18275
18347
|
};
|
|
18276
18348
|
|
|
18277
18349
|
// src/legacy/common/hooks/useStepPolling/useStepPolling.tsx
|
|
18278
|
-
var
|
|
18350
|
+
var import_react58 = require("react");
|
|
18279
18351
|
function useStepPolling(polling, onAction) {
|
|
18280
18352
|
const httpClient = useHttpClient();
|
|
18281
|
-
const asyncFn = (0,
|
|
18353
|
+
const asyncFn = (0, import_react58.useMemo)(() => {
|
|
18282
18354
|
if (polling) {
|
|
18283
18355
|
return () => httpClient(polling.url).then((response) => {
|
|
18284
18356
|
if (response.ok) {
|
|
@@ -18291,7 +18363,7 @@ function useStepPolling(polling, onAction) {
|
|
|
18291
18363
|
}
|
|
18292
18364
|
return void 0;
|
|
18293
18365
|
}, [polling, httpClient]);
|
|
18294
|
-
const onPollingResponse = (0,
|
|
18366
|
+
const onPollingResponse = (0, import_react58.useCallback)(
|
|
18295
18367
|
(pollingResponse) => {
|
|
18296
18368
|
if (pollingResponse == null ? void 0 : pollingResponse.action) {
|
|
18297
18369
|
onAction(pollingResponse.action);
|
|
@@ -18307,7 +18379,7 @@ function useStepPolling(polling, onAction) {
|
|
|
18307
18379
|
maxAttempts: (polling == null ? void 0 : polling.maxAttempts) || 0,
|
|
18308
18380
|
maxConsecutiveFails: 1,
|
|
18309
18381
|
onPollingResponse,
|
|
18310
|
-
onFailure: (0,
|
|
18382
|
+
onFailure: (0, import_react58.useCallback)(() => {
|
|
18311
18383
|
if (polling) {
|
|
18312
18384
|
onAction(polling.onError.action);
|
|
18313
18385
|
}
|
|
@@ -18316,7 +18388,7 @@ function useStepPolling(polling, onAction) {
|
|
|
18316
18388
|
}
|
|
18317
18389
|
|
|
18318
18390
|
// src/legacy/step/layoutStep/LayoutStep.tsx
|
|
18319
|
-
var
|
|
18391
|
+
var import_jsx_runtime119 = require("react/jsx-runtime");
|
|
18320
18392
|
var getComponents = (step, options) => {
|
|
18321
18393
|
var _a;
|
|
18322
18394
|
if (isEmpty(step)) {
|
|
@@ -18339,7 +18411,7 @@ var LayoutStep = (props) => {
|
|
|
18339
18411
|
onEvent("Dynamic Flow - onAction supressed", { reason: "LayoutStep - loading state" });
|
|
18340
18412
|
};
|
|
18341
18413
|
useStepPolling(stepSpecification.polling, onAction);
|
|
18342
|
-
return /* @__PURE__ */ (0,
|
|
18414
|
+
return /* @__PURE__ */ (0, import_jsx_runtime119.jsx)(
|
|
18343
18415
|
DynamicLayout_default,
|
|
18344
18416
|
{
|
|
18345
18417
|
components,
|
|
@@ -18355,10 +18427,10 @@ var LayoutStep = (props) => {
|
|
|
18355
18427
|
var LayoutStep_default = LayoutStep;
|
|
18356
18428
|
|
|
18357
18429
|
// src/legacy/step/cameraStep/CameraStep.tsx
|
|
18358
|
-
var
|
|
18430
|
+
var import_react63 = require("react");
|
|
18359
18431
|
|
|
18360
18432
|
// src/common/cameraCapture/CameraCapture.tsx
|
|
18361
|
-
var
|
|
18433
|
+
var import_react62 = require("react");
|
|
18362
18434
|
var import_react_intl44 = require("react-intl");
|
|
18363
18435
|
var import_react_webcam = __toESM(require("react-webcam"));
|
|
18364
18436
|
|
|
@@ -18425,15 +18497,15 @@ var CameraCapture_messages_default = (0, import_react_intl40.defineMessages)({
|
|
|
18425
18497
|
// src/common/cameraCapture/components/bottomBar/BottomBar.tsx
|
|
18426
18498
|
var import_components73 = require("@transferwise/components");
|
|
18427
18499
|
var import_react_intl41 = require("react-intl");
|
|
18428
|
-
var
|
|
18429
|
-
var CaptureBottomBar = ({ onCapture }) => /* @__PURE__ */ (0,
|
|
18500
|
+
var import_jsx_runtime120 = require("react/jsx-runtime");
|
|
18501
|
+
var CaptureBottomBar = ({ onCapture }) => /* @__PURE__ */ (0, import_jsx_runtime120.jsx)("div", { className: "bottom-bar", children: /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(CaptureButton, { onClick: onCapture }) });
|
|
18430
18502
|
var ReviewBottomBar = ({
|
|
18431
18503
|
onSubmit,
|
|
18432
18504
|
onRetry
|
|
18433
18505
|
}) => {
|
|
18434
18506
|
const intl = (0, import_react_intl41.useIntl)();
|
|
18435
|
-
return /* @__PURE__ */ (0,
|
|
18436
|
-
/* @__PURE__ */ (0,
|
|
18507
|
+
return /* @__PURE__ */ (0, import_jsx_runtime120.jsx)("div", { className: "bottom-bar p-x-2", children: /* @__PURE__ */ (0, import_jsx_runtime120.jsx)("div", { className: "row", children: /* @__PURE__ */ (0, import_jsx_runtime120.jsxs)("div", { className: "col-xs-12 col-md-6 col-md-offset-3", children: [
|
|
18508
|
+
/* @__PURE__ */ (0, import_jsx_runtime120.jsx)(
|
|
18437
18509
|
import_components73.Button,
|
|
18438
18510
|
{
|
|
18439
18511
|
className: "m-b-1",
|
|
@@ -18444,7 +18516,7 @@ var ReviewBottomBar = ({
|
|
|
18444
18516
|
children: intl.formatMessage(CameraCapture_messages_default.reviewSubmit)
|
|
18445
18517
|
}
|
|
18446
18518
|
),
|
|
18447
|
-
/* @__PURE__ */ (0,
|
|
18519
|
+
/* @__PURE__ */ (0, import_jsx_runtime120.jsx)(
|
|
18448
18520
|
import_components73.Button,
|
|
18449
18521
|
{
|
|
18450
18522
|
className: "m-b-2",
|
|
@@ -18458,14 +18530,14 @@ var ReviewBottomBar = ({
|
|
|
18458
18530
|
)
|
|
18459
18531
|
] }) }) });
|
|
18460
18532
|
};
|
|
18461
|
-
var CaptureButton = ({ onClick }) => /* @__PURE__ */ (0,
|
|
18533
|
+
var CaptureButton = ({ onClick }) => /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(
|
|
18462
18534
|
"button",
|
|
18463
18535
|
{
|
|
18464
18536
|
type: "button",
|
|
18465
18537
|
className: "camera-capture-btn m-b-2",
|
|
18466
18538
|
"data-testid": "camera-capture-button",
|
|
18467
18539
|
onClick,
|
|
18468
|
-
children: /* @__PURE__ */ (0,
|
|
18540
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime120.jsx)("span", { className: "camera-capture-btn-inner" })
|
|
18469
18541
|
}
|
|
18470
18542
|
);
|
|
18471
18543
|
|
|
@@ -18483,11 +18555,11 @@ var OrientationLockOverlay_messages_default = (0, import_react_intl42.defineMess
|
|
|
18483
18555
|
});
|
|
18484
18556
|
|
|
18485
18557
|
// src/common/cameraCapture/components/orientationLockOverlay/OrientationLockOverlay.tsx
|
|
18486
|
-
var
|
|
18558
|
+
var import_jsx_runtime121 = require("react/jsx-runtime");
|
|
18487
18559
|
function OrientationLockOverlay() {
|
|
18488
18560
|
const intl = (0, import_react_intl43.useIntl)();
|
|
18489
|
-
return /* @__PURE__ */ (0,
|
|
18490
|
-
/* @__PURE__ */ (0,
|
|
18561
|
+
return /* @__PURE__ */ (0, import_jsx_runtime121.jsxs)("div", { className: "orientation-lock-overlay", children: [
|
|
18562
|
+
/* @__PURE__ */ (0, import_jsx_runtime121.jsx)(
|
|
18491
18563
|
"img",
|
|
18492
18564
|
{
|
|
18493
18565
|
className: "m-b-3",
|
|
@@ -18497,13 +18569,13 @@ function OrientationLockOverlay() {
|
|
|
18497
18569
|
alt: ""
|
|
18498
18570
|
}
|
|
18499
18571
|
),
|
|
18500
|
-
/* @__PURE__ */ (0,
|
|
18572
|
+
/* @__PURE__ */ (0, import_jsx_runtime121.jsx)("p", { className: "text-center m-b-0", children: intl.formatMessage(OrientationLockOverlay_messages_default.text) })
|
|
18501
18573
|
] });
|
|
18502
18574
|
}
|
|
18503
18575
|
var OrientationLockOverlay_default = OrientationLockOverlay;
|
|
18504
18576
|
|
|
18505
18577
|
// src/common/cameraCapture/hooks/useFullScreenOrientationLock.ts
|
|
18506
|
-
var
|
|
18578
|
+
var import_react59 = require("react");
|
|
18507
18579
|
var import_screenfull = __toESM(require_screenfull());
|
|
18508
18580
|
|
|
18509
18581
|
// src/common/cameraCapture/utils/index.ts
|
|
@@ -18582,7 +18654,7 @@ var trackCameraOrientationLocked = (onEvent) => {
|
|
|
18582
18654
|
|
|
18583
18655
|
// src/common/cameraCapture/hooks/useFullScreenOrientationLock.ts
|
|
18584
18656
|
var useFullScreenOrientationLock = (shouldLockOrientation, onEvent) => {
|
|
18585
|
-
const lockOrientation = (0,
|
|
18657
|
+
const lockOrientation = (0, import_react59.useCallback)(() => {
|
|
18586
18658
|
if (window.screen.orientation && "lock" in window.screen.orientation && typeof window.screen.orientation.lock === "function") {
|
|
18587
18659
|
const lockPromise = window.screen.orientation.lock("portrait");
|
|
18588
18660
|
if (lockPromise instanceof Promise) {
|
|
@@ -18590,11 +18662,11 @@ var useFullScreenOrientationLock = (shouldLockOrientation, onEvent) => {
|
|
|
18590
18662
|
}
|
|
18591
18663
|
}
|
|
18592
18664
|
}, [onEvent]);
|
|
18593
|
-
const unlockOrientation = (0,
|
|
18665
|
+
const unlockOrientation = (0, import_react59.useCallback)(() => {
|
|
18594
18666
|
var _a, _b, _c;
|
|
18595
18667
|
return (_c = (_b = (_a = window == null ? void 0 : window.screen) == null ? void 0 : _a.orientation) == null ? void 0 : _b.unlock) == null ? void 0 : _c.call(_b);
|
|
18596
18668
|
}, []);
|
|
18597
|
-
const enterFullScreen = (0,
|
|
18669
|
+
const enterFullScreen = (0, import_react59.useCallback)(() => {
|
|
18598
18670
|
setTimeout(() => {
|
|
18599
18671
|
if (shouldLockOrientation && !import_screenfull.default.isFullscreen && import_screenfull.default.isEnabled) {
|
|
18600
18672
|
import_screenfull.default.request(document.documentElement, { navigationUI: "show" }).then(() => {
|
|
@@ -18603,13 +18675,13 @@ var useFullScreenOrientationLock = (shouldLockOrientation, onEvent) => {
|
|
|
18603
18675
|
}
|
|
18604
18676
|
}, 100);
|
|
18605
18677
|
}, [shouldLockOrientation, lockOrientation]);
|
|
18606
|
-
const exitFullScreen = (0,
|
|
18678
|
+
const exitFullScreen = (0, import_react59.useCallback)(() => {
|
|
18607
18679
|
if (import_screenfull.default.isFullscreen) {
|
|
18608
18680
|
import_screenfull.default.exit().catch(noop5);
|
|
18609
18681
|
}
|
|
18610
18682
|
unlockOrientation();
|
|
18611
18683
|
}, [unlockOrientation]);
|
|
18612
|
-
const handleOrientationChange = (0,
|
|
18684
|
+
const handleOrientationChange = (0, import_react59.useCallback)(
|
|
18613
18685
|
(event) => {
|
|
18614
18686
|
var _a, _b;
|
|
18615
18687
|
if ((_a = event == null ? void 0 : event.target) == null ? void 0 : _a.type.includes("landscape")) {
|
|
@@ -18620,7 +18692,7 @@ var useFullScreenOrientationLock = (shouldLockOrientation, onEvent) => {
|
|
|
18620
18692
|
},
|
|
18621
18693
|
[onEvent]
|
|
18622
18694
|
);
|
|
18623
|
-
(0,
|
|
18695
|
+
(0, import_react59.useEffect)(() => {
|
|
18624
18696
|
var _a, _b;
|
|
18625
18697
|
if (shouldLockOrientation) {
|
|
18626
18698
|
(_b = (_a = window.screen) == null ? void 0 : _a.orientation) == null ? void 0 : _b.addEventListener(
|
|
@@ -18643,10 +18715,10 @@ var noop5 = () => {
|
|
|
18643
18715
|
};
|
|
18644
18716
|
|
|
18645
18717
|
// src/common/cameraCapture/hooks/useVideoConstraints.ts
|
|
18646
|
-
var
|
|
18718
|
+
var import_react60 = require("react");
|
|
18647
18719
|
var useVideoConstraints = (direction) => {
|
|
18648
|
-
const [videoConstraints, setVideoConstraints] = (0,
|
|
18649
|
-
(0,
|
|
18720
|
+
const [videoConstraints, setVideoConstraints] = (0, import_react60.useState)();
|
|
18721
|
+
(0, import_react60.useEffect)(() => {
|
|
18650
18722
|
void getVideoConstraints(direction).then(setVideoConstraints);
|
|
18651
18723
|
}, [direction]);
|
|
18652
18724
|
return { videoConstraints };
|
|
@@ -18671,8 +18743,8 @@ var getVideoConstraints = async (dir) => {
|
|
|
18671
18743
|
};
|
|
18672
18744
|
|
|
18673
18745
|
// src/common/cameraCapture/overlay/Overlay.tsx
|
|
18674
|
-
var
|
|
18675
|
-
var
|
|
18746
|
+
var import_react61 = require("react");
|
|
18747
|
+
var import_jsx_runtime122 = require("react/jsx-runtime");
|
|
18676
18748
|
var captureButtonHeight = 92;
|
|
18677
18749
|
var reviewButtonsHeight = 120;
|
|
18678
18750
|
var imageHeight = 40;
|
|
@@ -18681,8 +18753,8 @@ var instructionsHeight = 48;
|
|
|
18681
18753
|
var reviewInstructionsHeight = 40;
|
|
18682
18754
|
var overlayMaxWidth = 800;
|
|
18683
18755
|
function Overlay({ overlay, outline, imageUrl, title, instructions, reviewInstructions }) {
|
|
18684
|
-
const svgReference = (0,
|
|
18685
|
-
(0,
|
|
18756
|
+
const svgReference = (0, import_react61.useRef)(null);
|
|
18757
|
+
(0, import_react61.useEffect)(() => {
|
|
18686
18758
|
const listener = debounce2(() => {
|
|
18687
18759
|
var _a;
|
|
18688
18760
|
if ((_a = svgReference.current) == null ? void 0 : _a.innerHTML) {
|
|
@@ -18694,18 +18766,18 @@ function Overlay({ overlay, outline, imageUrl, title, instructions, reviewInstru
|
|
|
18694
18766
|
return () => window.removeEventListener("resize", listener);
|
|
18695
18767
|
});
|
|
18696
18768
|
let helperBoxHeight = (imageUrl ? imageHeight : 0) + (title ? titleHeight : 0) + (instructions ? instructionsHeight : 0);
|
|
18697
|
-
let helperBox = /* @__PURE__ */ (0,
|
|
18698
|
-
imageUrl && /* @__PURE__ */ (0,
|
|
18699
|
-
title && /* @__PURE__ */ (0,
|
|
18700
|
-
instructions && /* @__PURE__ */ (0,
|
|
18769
|
+
let helperBox = /* @__PURE__ */ (0, import_jsx_runtime122.jsxs)(import_jsx_runtime122.Fragment, { children: [
|
|
18770
|
+
imageUrl && /* @__PURE__ */ (0, import_jsx_runtime122.jsx)("img", { className: "camera-capture-img", src: imageUrl, alt: "" }),
|
|
18771
|
+
title && /* @__PURE__ */ (0, import_jsx_runtime122.jsx)("h4", { className: "camera-capture-title", children: title }),
|
|
18772
|
+
instructions && /* @__PURE__ */ (0, import_jsx_runtime122.jsx)("small", { className: "camera-capture-instructions", children: instructions })
|
|
18701
18773
|
] });
|
|
18702
18774
|
const frameBottomMargin = captureButtonHeight + helperBoxHeight;
|
|
18703
18775
|
if (reviewInstructions) {
|
|
18704
18776
|
helperBoxHeight = frameBottomMargin - reviewButtonsHeight;
|
|
18705
|
-
helperBox = /* @__PURE__ */ (0,
|
|
18777
|
+
helperBox = /* @__PURE__ */ (0, import_jsx_runtime122.jsx)("small", { className: "camera-capture-instructions", children: reviewInstructions });
|
|
18706
18778
|
const frameWithReviewInstructionsMinBottomMargin = reviewButtonsHeight + reviewInstructionsHeight;
|
|
18707
18779
|
if (frameBottomMargin < frameWithReviewInstructionsMinBottomMargin) {
|
|
18708
|
-
helperBox = /* @__PURE__ */ (0,
|
|
18780
|
+
helperBox = /* @__PURE__ */ (0, import_jsx_runtime122.jsx)(import_jsx_runtime122.Fragment, {});
|
|
18709
18781
|
}
|
|
18710
18782
|
}
|
|
18711
18783
|
const framePosition = {
|
|
@@ -18723,32 +18795,32 @@ function Overlay({ overlay, outline, imageUrl, title, instructions, reviewInstru
|
|
|
18723
18795
|
width: "90%"
|
|
18724
18796
|
}
|
|
18725
18797
|
};
|
|
18726
|
-
return /* @__PURE__ */ (0,
|
|
18727
|
-
/* @__PURE__ */ (0,
|
|
18728
|
-
/* @__PURE__ */ (0,
|
|
18729
|
-
/* @__PURE__ */ (0,
|
|
18798
|
+
return /* @__PURE__ */ (0, import_jsx_runtime122.jsxs)("svg", { ref: svgReference, xmlns: "http://www.w3.org/2000/svg", children: [
|
|
18799
|
+
/* @__PURE__ */ (0, import_jsx_runtime122.jsx)("defs", { children: /* @__PURE__ */ (0, import_jsx_runtime122.jsxs)("mask", { id: "mask", children: [
|
|
18800
|
+
/* @__PURE__ */ (0, import_jsx_runtime122.jsx)("rect", { width: "100%", height: "100%", fill: "#fff" }),
|
|
18801
|
+
/* @__PURE__ */ (0, import_jsx_runtime122.jsx)("image", __spreadValues({ href: overlay }, framePosition))
|
|
18730
18802
|
] }) }),
|
|
18731
|
-
overlay && /* @__PURE__ */ (0,
|
|
18732
|
-
outline && /* @__PURE__ */ (0,
|
|
18733
|
-
/* @__PURE__ */ (0,
|
|
18803
|
+
overlay && /* @__PURE__ */ (0, import_jsx_runtime122.jsx)("rect", { width: "100%", height: "100%", mask: "url(#mask)", fillOpacity: "0.72" }),
|
|
18804
|
+
outline && /* @__PURE__ */ (0, import_jsx_runtime122.jsx)("image", __spreadValues({ href: outline }, framePosition)),
|
|
18805
|
+
/* @__PURE__ */ (0, import_jsx_runtime122.jsx)("foreignObject", { width: "100%", height: "100%", children: /* @__PURE__ */ (0, import_jsx_runtime122.jsx)("div", __spreadProps(__spreadValues({ className: "camera-capture-text-and-image-container" }, helperBoxPosition), { children: helperBox })) })
|
|
18734
18806
|
] });
|
|
18735
18807
|
}
|
|
18736
18808
|
var Overlay_default = Overlay;
|
|
18737
18809
|
|
|
18738
18810
|
// src/common/cameraCapture/screens/cameraErrorScreen/CameraErrorScreen.tsx
|
|
18739
18811
|
var import_components74 = require("@transferwise/components");
|
|
18740
|
-
var
|
|
18812
|
+
var import_jsx_runtime123 = require("react/jsx-runtime");
|
|
18741
18813
|
function CameraErrorScreen({ title, description, actionButton, onAction }) {
|
|
18742
|
-
return /* @__PURE__ */ (0,
|
|
18743
|
-
/* @__PURE__ */ (0,
|
|
18744
|
-
/* @__PURE__ */ (0,
|
|
18745
|
-
onAction && actionButton && /* @__PURE__ */ (0,
|
|
18814
|
+
return /* @__PURE__ */ (0, import_jsx_runtime123.jsx)("div", { className: "container p-t-5", children: /* @__PURE__ */ (0, import_jsx_runtime123.jsx)("div", { className: "row", children: /* @__PURE__ */ (0, import_jsx_runtime123.jsxs)("div", { className: "col-md-6 col-md-offset-3", children: [
|
|
18815
|
+
/* @__PURE__ */ (0, import_jsx_runtime123.jsx)("h2", { className: "text-xs-center m-b-3", children: title }),
|
|
18816
|
+
/* @__PURE__ */ (0, import_jsx_runtime123.jsx)("p", { className: "text-xs-center m-b-5", children: description }),
|
|
18817
|
+
onAction && actionButton && /* @__PURE__ */ (0, import_jsx_runtime123.jsx)(import_components74.Button, { block: true, onClick: onAction, children: actionButton })
|
|
18746
18818
|
] }) }) });
|
|
18747
18819
|
}
|
|
18748
18820
|
var CameraErrorScreen_default = CameraErrorScreen;
|
|
18749
18821
|
|
|
18750
18822
|
// src/common/cameraCapture/CameraCapture.tsx
|
|
18751
|
-
var
|
|
18823
|
+
var import_jsx_runtime124 = require("react/jsx-runtime");
|
|
18752
18824
|
function CameraCapture({
|
|
18753
18825
|
direction = "back",
|
|
18754
18826
|
overlay = "",
|
|
@@ -18760,14 +18832,14 @@ function CameraCapture({
|
|
|
18760
18832
|
onCapture,
|
|
18761
18833
|
onEvent
|
|
18762
18834
|
}) {
|
|
18763
|
-
const [mode, setMode] = (0,
|
|
18764
|
-
const [cameraError, setCameraError] = (0,
|
|
18765
|
-
const [isVideoMirrored, setIsVideoMirrored] = (0,
|
|
18766
|
-
const [ready, setReady] = (0,
|
|
18767
|
-
const [reviewImage, setReviewImage] = (0,
|
|
18768
|
-
const webcamReference = (0,
|
|
18835
|
+
const [mode, setMode] = (0, import_react62.useState)("CAPTURE" /* CAPTURE */);
|
|
18836
|
+
const [cameraError, setCameraError] = (0, import_react62.useState)();
|
|
18837
|
+
const [isVideoMirrored, setIsVideoMirrored] = (0, import_react62.useState)(false);
|
|
18838
|
+
const [ready, setReady] = (0, import_react62.useState)(false);
|
|
18839
|
+
const [reviewImage, setReviewImage] = (0, import_react62.useState)();
|
|
18840
|
+
const webcamReference = (0, import_react62.useRef)(null);
|
|
18769
18841
|
const { videoConstraints } = useVideoConstraints(direction);
|
|
18770
|
-
const shouldLockOrientation = (0,
|
|
18842
|
+
const shouldLockOrientation = (0, import_react62.useMemo)(
|
|
18771
18843
|
() => !!(isMobile() && mode === "CAPTURE" /* CAPTURE */),
|
|
18772
18844
|
[mode]
|
|
18773
18845
|
);
|
|
@@ -18776,7 +18848,7 @@ function CameraCapture({
|
|
|
18776
18848
|
onEvent
|
|
18777
18849
|
);
|
|
18778
18850
|
const intl = (0, import_react_intl44.useIntl)();
|
|
18779
|
-
const handleCapture = (0,
|
|
18851
|
+
const handleCapture = (0, import_react62.useCallback)(async () => {
|
|
18780
18852
|
var _a, _b, _c, _d, _e, _f;
|
|
18781
18853
|
if (((_a = webcamReference == null ? void 0 : webcamReference.current) == null ? void 0 : _a.video) && ((_c = (_b = webcamReference == null ? void 0 : webcamReference.current) == null ? void 0 : _b.video) == null ? void 0 : _c.readyState) >= 3) {
|
|
18782
18854
|
(_e = (_d = webcamReference == null ? void 0 : webcamReference.current) == null ? void 0 : _d.video) == null ? void 0 : _e.pause();
|
|
@@ -18798,7 +18870,7 @@ function CameraCapture({
|
|
|
18798
18870
|
);
|
|
18799
18871
|
}
|
|
18800
18872
|
}, [webcamReference, showReview, setReviewImage, setMode, onCapture, isVideoMirrored]);
|
|
18801
|
-
const handleUserMediaError = (0,
|
|
18873
|
+
const handleUserMediaError = (0, import_react62.useCallback)(
|
|
18802
18874
|
(error) => {
|
|
18803
18875
|
setMode("ERROR" /* ERROR */);
|
|
18804
18876
|
if (error instanceof DOMException) {
|
|
@@ -18834,7 +18906,7 @@ function CameraCapture({
|
|
|
18834
18906
|
},
|
|
18835
18907
|
[intl, onEvent]
|
|
18836
18908
|
);
|
|
18837
|
-
const handleUserMedia = (0,
|
|
18909
|
+
const handleUserMedia = (0, import_react62.useCallback)(
|
|
18838
18910
|
(stream) => {
|
|
18839
18911
|
enterFullScreen();
|
|
18840
18912
|
setReady(true);
|
|
@@ -18851,13 +18923,13 @@ function CameraCapture({
|
|
|
18851
18923
|
setReviewImage(void 0);
|
|
18852
18924
|
};
|
|
18853
18925
|
const handleRetryCameraAccess = () => setMode("CAPTURE" /* CAPTURE */);
|
|
18854
|
-
(0,
|
|
18926
|
+
(0, import_react62.useEffect)(() => {
|
|
18855
18927
|
if (mode !== "CAPTURE" /* CAPTURE */) {
|
|
18856
18928
|
exitFullScreen();
|
|
18857
18929
|
}
|
|
18858
18930
|
}, [mode, exitFullScreen]);
|
|
18859
|
-
const captureScreen = /* @__PURE__ */ (0,
|
|
18860
|
-
videoConstraints && /* @__PURE__ */ (0,
|
|
18931
|
+
const captureScreen = /* @__PURE__ */ (0, import_jsx_runtime124.jsxs)("div", { className: "camera-capture", children: [
|
|
18932
|
+
videoConstraints && /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(
|
|
18861
18933
|
import_react_webcam.default,
|
|
18862
18934
|
{
|
|
18863
18935
|
ref: webcamReference,
|
|
@@ -18868,7 +18940,7 @@ function CameraCapture({
|
|
|
18868
18940
|
onUserMedia: handleUserMedia
|
|
18869
18941
|
}
|
|
18870
18942
|
),
|
|
18871
|
-
/* @__PURE__ */ (0,
|
|
18943
|
+
/* @__PURE__ */ (0, import_jsx_runtime124.jsx)(
|
|
18872
18944
|
Overlay_default,
|
|
18873
18945
|
{
|
|
18874
18946
|
overlay,
|
|
@@ -18878,8 +18950,8 @@ function CameraCapture({
|
|
|
18878
18950
|
instructions
|
|
18879
18951
|
}
|
|
18880
18952
|
),
|
|
18881
|
-
shouldLockOrientation && /* @__PURE__ */ (0,
|
|
18882
|
-
ready && /* @__PURE__ */ (0,
|
|
18953
|
+
shouldLockOrientation && /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(OrientationLockOverlay_default, {}),
|
|
18954
|
+
ready && /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(
|
|
18883
18955
|
CaptureBottomBar,
|
|
18884
18956
|
{
|
|
18885
18957
|
onCapture: () => {
|
|
@@ -18888,9 +18960,9 @@ function CameraCapture({
|
|
|
18888
18960
|
}
|
|
18889
18961
|
)
|
|
18890
18962
|
] });
|
|
18891
|
-
const reviewScreen = /* @__PURE__ */ (0,
|
|
18892
|
-
/* @__PURE__ */ (0,
|
|
18893
|
-
/* @__PURE__ */ (0,
|
|
18963
|
+
const reviewScreen = /* @__PURE__ */ (0, import_jsx_runtime124.jsxs)("div", { className: "camera-capture", children: [
|
|
18964
|
+
/* @__PURE__ */ (0, import_jsx_runtime124.jsx)("img", { className: "review-image", src: reviewImage == null ? void 0 : reviewImage.source, alt: "" }),
|
|
18965
|
+
/* @__PURE__ */ (0, import_jsx_runtime124.jsx)(
|
|
18894
18966
|
Overlay_default,
|
|
18895
18967
|
{
|
|
18896
18968
|
overlay,
|
|
@@ -18900,18 +18972,18 @@ function CameraCapture({
|
|
|
18900
18972
|
reviewInstructions: intl.formatMessage(CameraCapture_messages_default.reviewInstructions)
|
|
18901
18973
|
}
|
|
18902
18974
|
),
|
|
18903
|
-
/* @__PURE__ */ (0,
|
|
18975
|
+
/* @__PURE__ */ (0, import_jsx_runtime124.jsx)(ReviewBottomBar, { onSubmit: handleReviewSubmit, onRetry: handleReviewRetry })
|
|
18904
18976
|
] });
|
|
18905
|
-
return /* @__PURE__ */ (0,
|
|
18977
|
+
return /* @__PURE__ */ (0, import_jsx_runtime124.jsxs)("section", { children: [
|
|
18906
18978
|
mode === "CAPTURE" /* CAPTURE */ && captureScreen,
|
|
18907
18979
|
mode === "REVIEW" /* REVIEW */ && reviewScreen,
|
|
18908
|
-
mode === "ERROR" /* ERROR */ && cameraError && /* @__PURE__ */ (0,
|
|
18980
|
+
mode === "ERROR" /* ERROR */ && cameraError && /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(CameraErrorScreen_default, __spreadValues({}, cameraError))
|
|
18909
18981
|
] });
|
|
18910
18982
|
}
|
|
18911
18983
|
var CameraCapture_default = CameraCapture;
|
|
18912
18984
|
|
|
18913
18985
|
// src/legacy/step/cameraStep/CameraStep.tsx
|
|
18914
|
-
var
|
|
18986
|
+
var import_jsx_runtime125 = require("react/jsx-runtime");
|
|
18915
18987
|
function blobToBase64(blob) {
|
|
18916
18988
|
return new Promise((resolve, _) => {
|
|
18917
18989
|
const reader = new FileReader();
|
|
@@ -18929,8 +19001,8 @@ function CameraStep(props) {
|
|
|
18929
19001
|
const { assets, direction, instructions } = cameraConfig || {};
|
|
18930
19002
|
const { overlay, outline } = assets || {};
|
|
18931
19003
|
const { url: imageUrl } = image || {};
|
|
18932
|
-
const [captureClicked, setCaptureClicked] = (0,
|
|
18933
|
-
(0,
|
|
19004
|
+
const [captureClicked, setCaptureClicked] = (0, import_react63.useState)(false);
|
|
19005
|
+
(0, import_react63.useEffect)(() => {
|
|
18934
19006
|
if (captureClicked) {
|
|
18935
19007
|
onAction(action);
|
|
18936
19008
|
}
|
|
@@ -18949,7 +19021,7 @@ function CameraStep(props) {
|
|
|
18949
19021
|
});
|
|
18950
19022
|
}
|
|
18951
19023
|
};
|
|
18952
|
-
return /* @__PURE__ */ (0,
|
|
19024
|
+
return /* @__PURE__ */ (0, import_jsx_runtime125.jsx)(
|
|
18953
19025
|
CameraCapture_default,
|
|
18954
19026
|
{
|
|
18955
19027
|
overlay,
|
|
@@ -19026,12 +19098,12 @@ var external_confirmation_messages_default2 = (0, import_react_intl45.defineMess
|
|
|
19026
19098
|
});
|
|
19027
19099
|
|
|
19028
19100
|
// src/legacy/step/externalConfirmationStep/ExternalConfirmationStep.tsx
|
|
19029
|
-
var
|
|
19101
|
+
var import_jsx_runtime126 = require("react/jsx-runtime");
|
|
19030
19102
|
var noop6 = () => {
|
|
19031
19103
|
};
|
|
19032
19104
|
function ExternalConfirmationStep({ url, onClose }) {
|
|
19033
19105
|
const { formatMessage } = (0, import_react_intl46.useIntl)();
|
|
19034
|
-
return /* @__PURE__ */ (0,
|
|
19106
|
+
return /* @__PURE__ */ (0, import_jsx_runtime126.jsx)(
|
|
19035
19107
|
DynamicLayout_default,
|
|
19036
19108
|
{
|
|
19037
19109
|
components: [
|
|
@@ -19098,9 +19170,9 @@ function getOrigin2(url) {
|
|
|
19098
19170
|
// src/legacy/dynamicFlow/BackButton.tsx
|
|
19099
19171
|
var import_components76 = require("@transferwise/components");
|
|
19100
19172
|
var import_icons6 = require("@transferwise/icons");
|
|
19101
|
-
var
|
|
19173
|
+
var import_jsx_runtime127 = require("react/jsx-runtime");
|
|
19102
19174
|
function BackButton2({ title, action, onAction }) {
|
|
19103
|
-
return /* @__PURE__ */ (0,
|
|
19175
|
+
return /* @__PURE__ */ (0, import_jsx_runtime127.jsxs)(
|
|
19104
19176
|
"a",
|
|
19105
19177
|
{
|
|
19106
19178
|
href: "/",
|
|
@@ -19111,8 +19183,8 @@ function BackButton2({ title, action, onAction }) {
|
|
|
19111
19183
|
onAction(__spreadProps(__spreadValues({}, action), { skipValidation: true }));
|
|
19112
19184
|
},
|
|
19113
19185
|
children: [
|
|
19114
|
-
/* @__PURE__ */ (0,
|
|
19115
|
-
/* @__PURE__ */ (0,
|
|
19186
|
+
/* @__PURE__ */ (0, import_jsx_runtime127.jsx)("span", { className: "sr-only", children: title }),
|
|
19187
|
+
/* @__PURE__ */ (0, import_jsx_runtime127.jsx)(import_components76.Avatar, { type: "icon", children: /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(import_icons6.ArrowLeft, { size: "24" }) })
|
|
19116
19188
|
]
|
|
19117
19189
|
}
|
|
19118
19190
|
);
|
|
@@ -19120,7 +19192,7 @@ function BackButton2({ title, action, onAction }) {
|
|
|
19120
19192
|
var BackButton_default2 = BackButton2;
|
|
19121
19193
|
|
|
19122
19194
|
// src/legacy/dynamicFlow/DynamicFlowStep.tsx
|
|
19123
|
-
var
|
|
19195
|
+
var import_jsx_runtime128 = require("react/jsx-runtime");
|
|
19124
19196
|
function DynamicFlowStep(props) {
|
|
19125
19197
|
var _a, _b, _c;
|
|
19126
19198
|
const { step, globalError, onAction } = props;
|
|
@@ -19129,28 +19201,28 @@ function DynamicFlowStep(props) {
|
|
|
19129
19201
|
const { requiresManualTrigger, dismissConfirmation } = useExternal2(externalUrl);
|
|
19130
19202
|
if (step === void 0) {
|
|
19131
19203
|
if (globalError) {
|
|
19132
|
-
return /* @__PURE__ */ (0,
|
|
19204
|
+
return /* @__PURE__ */ (0, import_jsx_runtime128.jsx)(DynamicAlert_default, { component: { context: "negative", markdown: globalError, margin: "lg" } });
|
|
19133
19205
|
}
|
|
19134
19206
|
return null;
|
|
19135
19207
|
}
|
|
19136
19208
|
if (externalUrl && requiresManualTrigger) {
|
|
19137
|
-
return /* @__PURE__ */ (0,
|
|
19209
|
+
return /* @__PURE__ */ (0, import_jsx_runtime128.jsx)(ExternalConfirmationStep_default, { url: externalUrl, onClose: dismissConfirmation });
|
|
19138
19210
|
}
|
|
19139
19211
|
if (isCameraStep(step)) {
|
|
19140
|
-
return /* @__PURE__ */ (0,
|
|
19212
|
+
return /* @__PURE__ */ (0, import_jsx_runtime128.jsx)(CameraStep_default, __spreadProps(__spreadValues({}, props), { step }));
|
|
19141
19213
|
}
|
|
19142
|
-
return /* @__PURE__ */ (0,
|
|
19143
|
-
backButton && /* @__PURE__ */ (0,
|
|
19144
|
-
globalError ? /* @__PURE__ */ (0,
|
|
19145
|
-
/* @__PURE__ */ (0,
|
|
19214
|
+
return /* @__PURE__ */ (0, import_jsx_runtime128.jsxs)(import_jsx_runtime128.Fragment, { children: [
|
|
19215
|
+
backButton && /* @__PURE__ */ (0, import_jsx_runtime128.jsx)(BackButton_default2, __spreadProps(__spreadValues({}, backButton), { onAction })),
|
|
19216
|
+
globalError ? /* @__PURE__ */ (0, import_jsx_runtime128.jsx)(DynamicAlert_default, { component: { context: "negative", markdown: globalError, margin: "lg" } }) : null,
|
|
19217
|
+
/* @__PURE__ */ (0, import_jsx_runtime128.jsx)(LayoutStep_default, __spreadProps(__spreadValues({}, props), { stepSpecification: step }))
|
|
19146
19218
|
] });
|
|
19147
19219
|
}
|
|
19148
19220
|
|
|
19149
19221
|
// src/legacy/dynamicFlow/utils/useDebouncedRefresh/useDebouncedRefresh.ts
|
|
19150
|
-
var
|
|
19222
|
+
var import_react64 = require("react");
|
|
19151
19223
|
var DEBOUNCE_DELAY = 1e3;
|
|
19152
19224
|
function useDebouncedRefresh(fetchRefresh) {
|
|
19153
|
-
const map = (0,
|
|
19225
|
+
const map = (0, import_react64.useRef)(/* @__PURE__ */ new Map());
|
|
19154
19226
|
const retrieveOrCreate = (key) => {
|
|
19155
19227
|
if (map.current.has(key)) {
|
|
19156
19228
|
return map.current.get(key);
|
|
@@ -19182,12 +19254,12 @@ function useDebouncedRefresh(fetchRefresh) {
|
|
|
19182
19254
|
var shouldDebounceSchema = (schema) => getSchemaType(schema) === "basic" && schema.type !== "boolean" && schema.format !== "base64url";
|
|
19183
19255
|
|
|
19184
19256
|
// src/legacy/dynamicFlow/utils/useDynamicFlowState.ts
|
|
19185
|
-
var
|
|
19257
|
+
var import_react65 = require("react");
|
|
19186
19258
|
var useDynamicFlowState = (initialStep) => {
|
|
19187
19259
|
var _a, _b;
|
|
19188
|
-
const [formErrors, setFormErrors] = (0,
|
|
19189
|
-
const [globalError, setGlobalError] = (0,
|
|
19190
|
-
const [stepAndModels, setStepAndModels] = (0,
|
|
19260
|
+
const [formErrors, setFormErrors] = (0, import_react65.useState)((_a = initialStep == null ? void 0 : initialStep.errors) == null ? void 0 : _a.validation);
|
|
19261
|
+
const [globalError, setGlobalError] = (0, import_react65.useState)((_b = initialStep == null ? void 0 : initialStep.errors) == null ? void 0 : _b.error);
|
|
19262
|
+
const [stepAndModels, setStepAndModels] = (0, import_react65.useState)({
|
|
19191
19263
|
step: initialStep || void 0,
|
|
19192
19264
|
models: (initialStep == null ? void 0 : initialStep.model) ? buildInitialModels(initialStep.model, getAllSchemas(initialStep)) : {},
|
|
19193
19265
|
etag: void 0
|
|
@@ -19217,7 +19289,7 @@ var useDynamicFlowState = (initialStep) => {
|
|
|
19217
19289
|
return updatedState;
|
|
19218
19290
|
});
|
|
19219
19291
|
};
|
|
19220
|
-
const modelIsValid = (0,
|
|
19292
|
+
const modelIsValid = (0, import_react65.useMemo)(
|
|
19221
19293
|
() => areModelsValid(models, getAllValidatableSchemas(step)),
|
|
19222
19294
|
[models, step]
|
|
19223
19295
|
);
|
|
@@ -19290,17 +19362,17 @@ var isInlineSchema = (schema) => schema !== void 0 && typeof schema === "object"
|
|
|
19290
19362
|
|
|
19291
19363
|
// src/legacy/dynamicFlow/utils/useLoader.tsx
|
|
19292
19364
|
var import_components77 = require("@transferwise/components");
|
|
19293
|
-
var
|
|
19294
|
-
var
|
|
19365
|
+
var import_react66 = require("react");
|
|
19366
|
+
var import_jsx_runtime129 = require("react/jsx-runtime");
|
|
19295
19367
|
function useLoader(loaderConfig, initialState) {
|
|
19296
19368
|
const config = __spreadValues({
|
|
19297
19369
|
size: import_components77.Size.EXTRA_LARGE,
|
|
19298
19370
|
initial: true,
|
|
19299
19371
|
submission: false
|
|
19300
19372
|
}, loaderConfig);
|
|
19301
|
-
const [loadingState, setLoadingState] = (0,
|
|
19373
|
+
const [loadingState, setLoadingState] = (0, import_react66.useState)(initialState);
|
|
19302
19374
|
const shouldDisplayLoader = config.initial && loadingState === "initial" || config.submission && loadingState === "submission";
|
|
19303
|
-
const loader = shouldDisplayLoader ? /* @__PURE__ */ (0,
|
|
19375
|
+
const loader = shouldDisplayLoader ? /* @__PURE__ */ (0, import_jsx_runtime129.jsx)(
|
|
19304
19376
|
import_components77.Loader,
|
|
19305
19377
|
{
|
|
19306
19378
|
size: config.size,
|
|
@@ -19420,7 +19492,7 @@ var useErrorResponse = () => {
|
|
|
19420
19492
|
};
|
|
19421
19493
|
|
|
19422
19494
|
// src/legacy/dynamicFlow/DynamicFlow.tsx
|
|
19423
|
-
var
|
|
19495
|
+
var import_jsx_runtime130 = require("react/jsx-runtime");
|
|
19424
19496
|
var noop7 = () => {
|
|
19425
19497
|
};
|
|
19426
19498
|
var DynamicFlowComponent = ({
|
|
@@ -19448,7 +19520,7 @@ var DynamicFlowComponent = ({
|
|
|
19448
19520
|
setStepAndEtag,
|
|
19449
19521
|
setSchemaModel
|
|
19450
19522
|
} = useDynamicFlowState(initialStep);
|
|
19451
|
-
const [submitted, setSubmitted] = (0,
|
|
19523
|
+
const [submitted, setSubmitted] = (0, import_react67.useState)(false);
|
|
19452
19524
|
const { locale } = (0, import_react_intl48.useIntl)();
|
|
19453
19525
|
const { isLoading, loader, setLoadingState } = useLoader(
|
|
19454
19526
|
loaderConfig,
|
|
@@ -19467,18 +19539,18 @@ var DynamicFlowComponent = ({
|
|
|
19467
19539
|
);
|
|
19468
19540
|
}
|
|
19469
19541
|
};
|
|
19470
|
-
const analyticsMetadata = (0,
|
|
19542
|
+
const analyticsMetadata = (0, import_react67.useMemo)(
|
|
19471
19543
|
() => {
|
|
19472
19544
|
var _a;
|
|
19473
19545
|
return __spreadValues({ flowId, stepId: (step == null ? void 0 : step.id) || (step == null ? void 0 : step.key) }, (_a = step == null ? void 0 : step.analytics) != null ? _a : {});
|
|
19474
19546
|
},
|
|
19475
19547
|
[flowId, step]
|
|
19476
19548
|
);
|
|
19477
|
-
const dispatchEvent = (0,
|
|
19549
|
+
const dispatchEvent = (0, import_react67.useMemo)(
|
|
19478
19550
|
() => getEventDispatcher(onEvent, analyticsMetadata),
|
|
19479
19551
|
[onEvent, analyticsMetadata]
|
|
19480
19552
|
);
|
|
19481
|
-
const dfHttpClient = (0,
|
|
19553
|
+
const dfHttpClient = (0, import_react67.useCallback)(
|
|
19482
19554
|
({
|
|
19483
19555
|
action,
|
|
19484
19556
|
data,
|
|
@@ -19531,17 +19603,17 @@ var DynamicFlowComponent = ({
|
|
|
19531
19603
|
dispatchEventAndComplete(__spreadValues(__spreadValues({}, exitResult), actionResult));
|
|
19532
19604
|
};
|
|
19533
19605
|
const { debouncedRefresh, isDebouncing, cancelPendingRefreshes } = useDebouncedRefresh(performRefresh);
|
|
19534
|
-
const dispatchEventAndComplete = (0,
|
|
19606
|
+
const dispatchEventAndComplete = (0, import_react67.useCallback)(
|
|
19535
19607
|
(result) => {
|
|
19536
19608
|
dispatchEvent("Dynamic Flow - Flow Finished", { result: "success" });
|
|
19537
19609
|
onCompletion(result);
|
|
19538
19610
|
},
|
|
19539
19611
|
[onCompletion, dispatchEvent]
|
|
19540
19612
|
);
|
|
19541
|
-
(0,
|
|
19613
|
+
(0, import_react67.useEffect)(() => {
|
|
19542
19614
|
dispatchEvent("Dynamic Flow - Flow Started", {});
|
|
19543
19615
|
}, []);
|
|
19544
|
-
(0,
|
|
19616
|
+
(0, import_react67.useEffect)(() => {
|
|
19545
19617
|
if (!initialStep) {
|
|
19546
19618
|
const action = __spreadValues({
|
|
19547
19619
|
id: "#initial-step-request",
|
|
@@ -19663,7 +19735,7 @@ var DynamicFlowComponent = ({
|
|
|
19663
19735
|
await performAction(action);
|
|
19664
19736
|
}
|
|
19665
19737
|
};
|
|
19666
|
-
return /* @__PURE__ */ (0,
|
|
19738
|
+
return /* @__PURE__ */ (0, import_jsx_runtime130.jsx)(LogProvider, { flowId, stepId: (step == null ? void 0 : step.id) || (step == null ? void 0 : step.key), onLog, children: /* @__PURE__ */ (0, import_jsx_runtime130.jsx)(EventsContextProvider, { metadata: analyticsMetadata, onEvent, children: /* @__PURE__ */ (0, import_jsx_runtime130.jsx)(DynamicFlowProvider, { loading: isLoading || isDebouncing, children: /* @__PURE__ */ (0, import_jsx_runtime130.jsx)(HttpClientProvider, { httpClient, children: /* @__PURE__ */ (0, import_jsx_runtime130.jsx)(FeatureContextProvider, { features, children: loader !== null ? loader : /* @__PURE__ */ (0, import_jsx_runtime130.jsx)("div", { id: (step == null ? void 0 : step.id) || (step == null ? void 0 : step.key), className: "dynamic-flow-legacy", children: /* @__PURE__ */ (0, import_jsx_runtime130.jsx)(
|
|
19667
19739
|
DynamicFlowStep,
|
|
19668
19740
|
{
|
|
19669
19741
|
step,
|
|
@@ -19677,10 +19749,10 @@ var DynamicFlowComponent = ({
|
|
|
19677
19749
|
},
|
|
19678
19750
|
onModelChange
|
|
19679
19751
|
}
|
|
19680
|
-
) }) }) }) }) });
|
|
19752
|
+
) }) }) }) }) }) });
|
|
19681
19753
|
};
|
|
19682
19754
|
function DynamicFlow(props) {
|
|
19683
|
-
return /* @__PURE__ */ (0,
|
|
19755
|
+
return /* @__PURE__ */ (0, import_jsx_runtime130.jsx)(ErrorBoundary_default, { onError: props.onError, children: /* @__PURE__ */ (0, import_jsx_runtime130.jsx)(DynamicFlowComponent, __spreadValues({}, props)) });
|
|
19684
19756
|
}
|
|
19685
19757
|
var DynamicFlow_default = DynamicFlow;
|
|
19686
19758
|
var combineModels2 = (formModels) => Object.values(formModels).reduce((previous, model) => __spreadValues(__spreadValues({}, previous), model), {});
|
|
@@ -19697,19 +19769,19 @@ var shouldTriggerRefresh = (props) => {
|
|
|
19697
19769
|
};
|
|
19698
19770
|
|
|
19699
19771
|
// src/legacy/jsonSchemaForm/JsonSchemaForm.tsx
|
|
19700
|
-
var
|
|
19772
|
+
var import_jsx_runtime131 = require("react/jsx-runtime");
|
|
19701
19773
|
function JsonSchemaForm(props) {
|
|
19702
19774
|
const schemaProps = __spreadValues({
|
|
19703
19775
|
model: null,
|
|
19704
19776
|
errors: null
|
|
19705
19777
|
}, props);
|
|
19706
19778
|
const { baseUrl = "", onEvent = noop8, onLog = noop8 } = props;
|
|
19707
|
-
return /* @__PURE__ */ (0,
|
|
19779
|
+
return /* @__PURE__ */ (0, import_jsx_runtime131.jsx)(LogProvider, { flowId: "JsonSchemaForm", stepId: "JsonSchemaForm", onLog, children: /* @__PURE__ */ (0, import_jsx_runtime131.jsx)(
|
|
19708
19780
|
EventsContextProvider,
|
|
19709
19781
|
{
|
|
19710
19782
|
metadata: { flowId: "JsonSchemaForm", stepId: "JsonSchemaForm" },
|
|
19711
19783
|
onEvent,
|
|
19712
|
-
children: /* @__PURE__ */ (0,
|
|
19784
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime131.jsx)(HttpClientProviderFromBaseUrl, { baseUrl, children: /* @__PURE__ */ (0, import_jsx_runtime131.jsx)(GenericSchema_default, __spreadValues({}, schemaProps)) })
|
|
19713
19785
|
}
|
|
19714
19786
|
) });
|
|
19715
19787
|
}
|