@wise/dynamic-flow-client 3.9.1 → 3.9.2
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 +745 -682
- package/build/main.min.js +1 -1
- package/build/main.mjs +513 -450
- package/build/types/legacy/dynamicFlow/utils/useErrorResponse.d.ts +2 -0
- package/build/types/revamp/wise/renderers/SelectInputRenderer/SegmentedInputRendererComponent.d.ts +2 -0
- package/package.json +2 -2
package/build/main.mjs
CHANGED
|
@@ -10202,7 +10202,7 @@ function $1746a345f3d73bb7$export$f680877a34711e37(deterministicId) {
|
|
|
10202
10202
|
return deterministicId || (id ? `radix-${id}` : "");
|
|
10203
10203
|
}
|
|
10204
10204
|
|
|
10205
|
-
// ../../node_modules/.pnpm/@wise+forms@0.3.4_@transferwise+components@46.
|
|
10205
|
+
// ../../node_modules/.pnpm/@wise+forms@0.3.4_@transferwise+components@46.29.0_@types+react@18.0.29_react@18.2.0/node_modules/@wise/forms/dist/index.mjs
|
|
10206
10206
|
var import_classnames = __toESM(require_classnames(), 1);
|
|
10207
10207
|
import { InlineAlert, Sentiment as Sentiment2, Input, TextArea } from "@transferwise/components";
|
|
10208
10208
|
import { createContext as createContext2, useContext as useContext2, forwardRef } from "react";
|
|
@@ -11701,19 +11701,53 @@ function SelectInputRendererComponent(props) {
|
|
|
11701
11701
|
] });
|
|
11702
11702
|
}
|
|
11703
11703
|
|
|
11704
|
+
// src/revamp/wise/renderers/SelectInputRenderer/SegmentedInputRendererComponent.tsx
|
|
11705
|
+
import { useEffect as useEffect5 } from "react";
|
|
11706
|
+
import { SegmentedControl } from "@transferwise/components";
|
|
11707
|
+
import { Fragment as Fragment9, jsx as jsx48, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
11708
|
+
function SegmentedInputRendererComponent(props) {
|
|
11709
|
+
const { id, children, description, error, help, label, options, selectedIndex, onSelect } = props;
|
|
11710
|
+
useEffect5(() => {
|
|
11711
|
+
if (!isValidIndex2(selectedIndex, options.length)) {
|
|
11712
|
+
onSelect(0);
|
|
11713
|
+
}
|
|
11714
|
+
}, [selectedIndex, onSelect, options.length]);
|
|
11715
|
+
return /* @__PURE__ */ jsxs18(Fragment9, { children: [
|
|
11716
|
+
/* @__PURE__ */ jsx48(FieldInput_default, { id, label, help, description, error, children: /* @__PURE__ */ jsx48(
|
|
11717
|
+
SegmentedControl,
|
|
11718
|
+
{
|
|
11719
|
+
name: `${id}-segmented-control`,
|
|
11720
|
+
value: String(selectedIndex),
|
|
11721
|
+
mode: "view",
|
|
11722
|
+
segments: options.map((option, index) => ({
|
|
11723
|
+
id: String(index),
|
|
11724
|
+
value: String(index),
|
|
11725
|
+
label: option.title,
|
|
11726
|
+
controls: `${id}-children`
|
|
11727
|
+
})),
|
|
11728
|
+
onChange: (value) => onSelect(Number(value))
|
|
11729
|
+
}
|
|
11730
|
+
) }),
|
|
11731
|
+
/* @__PURE__ */ jsx48("div", { id: `${id}-children`, children })
|
|
11732
|
+
] });
|
|
11733
|
+
}
|
|
11734
|
+
var isValidIndex2 = (index, options) => index !== null && index >= 0 && index < options;
|
|
11735
|
+
|
|
11704
11736
|
// src/revamp/wise/renderers/SelectInputRenderer/SelectInputRenderer.tsx
|
|
11705
|
-
import { jsx as
|
|
11737
|
+
import { jsx as jsx49 } from "react/jsx-runtime";
|
|
11706
11738
|
var SelectInputRenderer = {
|
|
11707
11739
|
canRenderType: "input-select",
|
|
11708
11740
|
render: (props) => {
|
|
11709
11741
|
switch (props.control) {
|
|
11710
11742
|
case "radio":
|
|
11711
|
-
return /* @__PURE__ */
|
|
11743
|
+
return /* @__PURE__ */ jsx49(RadioInputRendererComponent, __spreadValues({}, props));
|
|
11712
11744
|
case "tab":
|
|
11713
|
-
return props.options.length > 3 ? /* @__PURE__ */
|
|
11745
|
+
return props.options.length > 3 ? /* @__PURE__ */ jsx49(SelectInputRendererComponent, __spreadValues({}, props)) : /* @__PURE__ */ jsx49(TabInputRendererComponent, __spreadValues({}, props));
|
|
11746
|
+
case "segmented":
|
|
11747
|
+
return props.options.length > 3 ? /* @__PURE__ */ jsx49(SelectInputRendererComponent, __spreadValues({}, props)) : /* @__PURE__ */ jsx49(SegmentedInputRendererComponent, __spreadValues({}, props));
|
|
11714
11748
|
case "select":
|
|
11715
11749
|
default:
|
|
11716
|
-
return /* @__PURE__ */
|
|
11750
|
+
return /* @__PURE__ */ jsx49(SelectInputRendererComponent, __spreadValues({}, props));
|
|
11717
11751
|
}
|
|
11718
11752
|
}
|
|
11719
11753
|
};
|
|
@@ -11721,17 +11755,17 @@ var SelectInputRenderer_default = SelectInputRenderer;
|
|
|
11721
11755
|
|
|
11722
11756
|
// src/revamp/wise/renderers/StatusListRenderer.tsx
|
|
11723
11757
|
import { Header as Header4, Summary } from "@transferwise/components";
|
|
11724
|
-
import { jsx as
|
|
11758
|
+
import { jsx as jsx50, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
11725
11759
|
var StatusListRenderer = {
|
|
11726
11760
|
canRenderType: "status-list",
|
|
11727
|
-
render: ({ margin, items, title }) => /* @__PURE__ */
|
|
11728
|
-
title ? /* @__PURE__ */
|
|
11729
|
-
items.map(({ description, icon, status, title: itemTitle }) => /* @__PURE__ */
|
|
11761
|
+
render: ({ margin, items, title }) => /* @__PURE__ */ jsxs19("div", { className: getMargin(margin), children: [
|
|
11762
|
+
title ? /* @__PURE__ */ jsx50(Header4, { title }) : null,
|
|
11763
|
+
items.map(({ description, icon, status, title: itemTitle }) => /* @__PURE__ */ jsx50(
|
|
11730
11764
|
Summary,
|
|
11731
11765
|
{
|
|
11732
11766
|
title: itemTitle,
|
|
11733
11767
|
description,
|
|
11734
|
-
icon: icon && "name" in icon ? /* @__PURE__ */
|
|
11768
|
+
icon: icon && "name" in icon ? /* @__PURE__ */ jsx50(DynamicIcon_default, { name: icon.name }) : null,
|
|
11735
11769
|
status: mapStatus(status)
|
|
11736
11770
|
},
|
|
11737
11771
|
`${title}/${description || ""}`
|
|
@@ -11754,31 +11788,31 @@ import {
|
|
|
11754
11788
|
TextArea as TextArea2,
|
|
11755
11789
|
TextareaWithDisplayFormat
|
|
11756
11790
|
} from "@transferwise/components";
|
|
11757
|
-
import { jsx as
|
|
11791
|
+
import { jsx as jsx51 } from "react/jsx-runtime";
|
|
11758
11792
|
function VariableTextInput({
|
|
11759
11793
|
control,
|
|
11760
11794
|
inputProps
|
|
11761
11795
|
}) {
|
|
11762
11796
|
switch (control) {
|
|
11763
11797
|
case "password":
|
|
11764
|
-
return /* @__PURE__ */
|
|
11798
|
+
return /* @__PURE__ */ jsx51(TextInput, __spreadValues({ type: "password" }, inputProps));
|
|
11765
11799
|
case "email":
|
|
11766
|
-
return /* @__PURE__ */
|
|
11800
|
+
return /* @__PURE__ */ jsx51(TextInput, __spreadValues({ type: "email" }, inputProps));
|
|
11767
11801
|
case "textarea":
|
|
11768
|
-
return /* @__PURE__ */
|
|
11802
|
+
return /* @__PURE__ */ jsx51(TextAreaInput, __spreadValues({}, inputProps));
|
|
11769
11803
|
case "numeric":
|
|
11770
|
-
return /* @__PURE__ */
|
|
11804
|
+
return /* @__PURE__ */ jsx51(NumericInput, __spreadValues({ type: "number" }, inputProps));
|
|
11771
11805
|
case "phone-number":
|
|
11772
|
-
return /* @__PURE__ */
|
|
11806
|
+
return /* @__PURE__ */ jsx51(PhoneNumberInput, __spreadValues({}, inputProps));
|
|
11773
11807
|
default:
|
|
11774
|
-
return /* @__PURE__ */
|
|
11808
|
+
return /* @__PURE__ */ jsx51(TextInput, __spreadValues({ type: "text" }, inputProps));
|
|
11775
11809
|
}
|
|
11776
11810
|
}
|
|
11777
11811
|
function TextInput(_a) {
|
|
11778
11812
|
var _b = _a, { id, displayFormat, onChange } = _b, rest = __objRest(_b, ["id", "displayFormat", "onChange"]);
|
|
11779
11813
|
if (typeof displayFormat === "string") {
|
|
11780
11814
|
const inputProps = __spreadValues({ id, name: id, className: "form-control" }, rest);
|
|
11781
|
-
return /* @__PURE__ */
|
|
11815
|
+
return /* @__PURE__ */ jsx51(
|
|
11782
11816
|
InputWithDisplayFormat,
|
|
11783
11817
|
__spreadValues({
|
|
11784
11818
|
displayPattern: displayFormat,
|
|
@@ -11786,29 +11820,29 @@ function TextInput(_a) {
|
|
|
11786
11820
|
}, inputProps)
|
|
11787
11821
|
);
|
|
11788
11822
|
}
|
|
11789
|
-
return /* @__PURE__ */
|
|
11823
|
+
return /* @__PURE__ */ jsx51(Input6, __spreadValues({ id, name: id, onChange: (e) => onChange(e.target.value) }, rest));
|
|
11790
11824
|
}
|
|
11791
11825
|
function TextAreaInput(_a) {
|
|
11792
11826
|
var _b = _a, { id, displayFormat, onChange } = _b, rest = __objRest(_b, ["id", "displayFormat", "onChange"]);
|
|
11793
11827
|
const textAreaProps = __spreadValues({ id, name: id }, rest);
|
|
11794
|
-
return typeof displayFormat === "string" ? /* @__PURE__ */
|
|
11828
|
+
return typeof displayFormat === "string" ? /* @__PURE__ */ jsx51(
|
|
11795
11829
|
TextareaWithDisplayFormat,
|
|
11796
11830
|
__spreadValues({
|
|
11797
11831
|
displayPattern: displayFormat,
|
|
11798
11832
|
onChange: (newValue) => onChange(newValue)
|
|
11799
11833
|
}, textAreaProps)
|
|
11800
|
-
) : /* @__PURE__ */
|
|
11834
|
+
) : /* @__PURE__ */ jsx51(TextArea2, __spreadValues({ onChange: (e) => onChange(e.target.value) }, textAreaProps));
|
|
11801
11835
|
}
|
|
11802
11836
|
function NumericInput(_a) {
|
|
11803
11837
|
var _b = _a, { id, displayFormat, onChange } = _b, rest = __objRest(_b, ["id", "displayFormat", "onChange"]);
|
|
11804
11838
|
const numericProps = __spreadValues({ id, name: id, onWheel }, rest);
|
|
11805
|
-
return typeof displayFormat === "string" ? /* @__PURE__ */
|
|
11839
|
+
return typeof displayFormat === "string" ? /* @__PURE__ */ jsx51(
|
|
11806
11840
|
InputWithDisplayFormat,
|
|
11807
11841
|
__spreadValues({
|
|
11808
11842
|
displayPattern: displayFormat,
|
|
11809
11843
|
onChange: (newValue) => onChange(numericValueOrNull(newValue))
|
|
11810
11844
|
}, numericProps)
|
|
11811
|
-
) : /* @__PURE__ */
|
|
11845
|
+
) : /* @__PURE__ */ jsx51(
|
|
11812
11846
|
Input6,
|
|
11813
11847
|
__spreadValues({
|
|
11814
11848
|
onChange: ({ target: { value: newValue } }) => onChange(numericValueOrNull(newValue))
|
|
@@ -11817,12 +11851,12 @@ function NumericInput(_a) {
|
|
|
11817
11851
|
}
|
|
11818
11852
|
function PhoneNumberInput(_a) {
|
|
11819
11853
|
var _b = _a, { value } = _b, rest = __objRest(_b, ["value"]);
|
|
11820
|
-
return /* @__PURE__ */
|
|
11854
|
+
return /* @__PURE__ */ jsx51(PhoneNumber, __spreadValues({ initialValue: value }, rest));
|
|
11821
11855
|
}
|
|
11822
11856
|
var VariableTextInput_default = VariableTextInput;
|
|
11823
11857
|
|
|
11824
11858
|
// src/revamp/wise/renderers/TextInputRenderer.tsx
|
|
11825
|
-
import { jsx as
|
|
11859
|
+
import { jsx as jsx52 } from "react/jsx-runtime";
|
|
11826
11860
|
var TextInputRenderer = {
|
|
11827
11861
|
canRenderType: "input-text",
|
|
11828
11862
|
render: (props) => {
|
|
@@ -11847,14 +11881,14 @@ var TextInputRenderer = {
|
|
|
11847
11881
|
]);
|
|
11848
11882
|
const value = initialValue != null ? initialValue : "";
|
|
11849
11883
|
const inputProps = __spreadProps(__spreadValues({}, rest), { value, id });
|
|
11850
|
-
return /* @__PURE__ */
|
|
11884
|
+
return /* @__PURE__ */ jsx52(FieldInput_default, { id, label, description, error, help, children: /* @__PURE__ */ jsx52(VariableTextInput_default, { control, inputProps }) });
|
|
11851
11885
|
}
|
|
11852
11886
|
};
|
|
11853
11887
|
var TextInputRenderer_default = TextInputRenderer;
|
|
11854
11888
|
|
|
11855
11889
|
// src/revamp/wise/renderers/UploadInputRenderer.tsx
|
|
11856
11890
|
import { Upload, UploadInput as UploadInput2 } from "@transferwise/components";
|
|
11857
|
-
import { jsx as
|
|
11891
|
+
import { jsx as jsx53 } from "react/jsx-runtime";
|
|
11858
11892
|
var UploadInputRenderer = {
|
|
11859
11893
|
canRenderType: "input-upload",
|
|
11860
11894
|
render: (props) => {
|
|
@@ -11870,7 +11904,7 @@ var UploadInputRenderer = {
|
|
|
11870
11904
|
};
|
|
11871
11905
|
return (
|
|
11872
11906
|
// We don't pass help here as there is no sensible place to display it
|
|
11873
|
-
/* @__PURE__ */
|
|
11907
|
+
/* @__PURE__ */ jsx53(UploadFieldInput_default, { id, label: void 0, description: void 0, error, children: /* @__PURE__ */ jsx53(
|
|
11874
11908
|
UploadInput2,
|
|
11875
11909
|
{
|
|
11876
11910
|
id,
|
|
@@ -11925,7 +11959,7 @@ var LargeUploadRenderer = {
|
|
|
11925
11959
|
throw e;
|
|
11926
11960
|
}
|
|
11927
11961
|
};
|
|
11928
|
-
return /* @__PURE__ */
|
|
11962
|
+
return /* @__PURE__ */ jsx53(FieldInput_default, { id, label, description, error, help, children: /* @__PURE__ */ jsx53(
|
|
11929
11963
|
Upload,
|
|
11930
11964
|
__spreadProps(__spreadValues({}, uploadProps), {
|
|
11931
11965
|
usAccept: getAcceptsString(accepts),
|
|
@@ -11940,7 +11974,7 @@ var LargeUploadRenderer = {
|
|
|
11940
11974
|
|
|
11941
11975
|
// src/revamp/wise/renderers/ReviewRenderer.tsx
|
|
11942
11976
|
import { DefinitionList, Header as Header5 } from "@transferwise/components";
|
|
11943
|
-
import { Fragment as
|
|
11977
|
+
import { Fragment as Fragment10, jsx as jsx54, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
11944
11978
|
var ReviewRenderer = {
|
|
11945
11979
|
canRenderType: "review",
|
|
11946
11980
|
render: ({ callToAction, control, fields, margin, title }) => {
|
|
@@ -11952,9 +11986,9 @@ var ReviewRenderer = {
|
|
|
11952
11986
|
callToAction.onClick();
|
|
11953
11987
|
}
|
|
11954
11988
|
} : void 0;
|
|
11955
|
-
return /* @__PURE__ */
|
|
11956
|
-
(title || callToAction) && /* @__PURE__ */
|
|
11957
|
-
/* @__PURE__ */
|
|
11989
|
+
return /* @__PURE__ */ jsxs20("div", { className: getMargin(margin), children: [
|
|
11990
|
+
(title || callToAction) && /* @__PURE__ */ jsx54(Header5, { title: title != null ? title : "", action }),
|
|
11991
|
+
/* @__PURE__ */ jsx54("div", { className: margin, children: /* @__PURE__ */ jsx54(
|
|
11958
11992
|
DefinitionList,
|
|
11959
11993
|
{
|
|
11960
11994
|
layout: orientation,
|
|
@@ -11971,14 +12005,14 @@ var ReviewRenderer = {
|
|
|
11971
12005
|
var ReviewRenderer_default = ReviewRenderer;
|
|
11972
12006
|
var getFieldValue = (value, help, orientation) => {
|
|
11973
12007
|
if (help) {
|
|
11974
|
-
return orientation === "HORIZONTAL_RIGHT_ALIGNED" ? /* @__PURE__ */
|
|
11975
|
-
/* @__PURE__ */
|
|
12008
|
+
return orientation === "HORIZONTAL_RIGHT_ALIGNED" ? /* @__PURE__ */ jsxs20(Fragment10, { children: [
|
|
12009
|
+
/* @__PURE__ */ jsx54(Help_default, { help }),
|
|
11976
12010
|
" ",
|
|
11977
12011
|
value
|
|
11978
|
-
] }) : /* @__PURE__ */
|
|
12012
|
+
] }) : /* @__PURE__ */ jsxs20(Fragment10, { children: [
|
|
11979
12013
|
value,
|
|
11980
12014
|
" ",
|
|
11981
|
-
/* @__PURE__ */
|
|
12015
|
+
/* @__PURE__ */ jsx54(Help_default, { help })
|
|
11982
12016
|
] });
|
|
11983
12017
|
}
|
|
11984
12018
|
return value;
|
|
@@ -12017,17 +12051,17 @@ var external_confirmation_messages_default = defineMessages8({
|
|
|
12017
12051
|
|
|
12018
12052
|
// src/revamp/wise/renderers/step/ExternalConfirmationDialog.tsx
|
|
12019
12053
|
import { Button as Button5, Markdown as Markdown5 } from "@transferwise/components";
|
|
12020
|
-
import { jsx as
|
|
12054
|
+
import { jsx as jsx55, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
12021
12055
|
function ExternalConfirmationDialog({
|
|
12022
12056
|
external,
|
|
12023
12057
|
onClose
|
|
12024
12058
|
}) {
|
|
12025
12059
|
const { formatMessage } = useIntl7();
|
|
12026
|
-
return /* @__PURE__ */
|
|
12027
|
-
/* @__PURE__ */
|
|
12028
|
-
/* @__PURE__ */
|
|
12029
|
-
/* @__PURE__ */
|
|
12030
|
-
/* @__PURE__ */
|
|
12060
|
+
return /* @__PURE__ */ jsx55("div", { className: "df-box-renderer-fixed-width", children: /* @__PURE__ */ jsxs21("div", { className: "df-box-renderer-width-lg", children: [
|
|
12061
|
+
/* @__PURE__ */ jsx55("h2", { className: "text-xs-center m-b-5", children: formatMessage(external_confirmation_messages_default.title) }),
|
|
12062
|
+
/* @__PURE__ */ jsx55(Markdown5, { config: { link: { target: "_blank" } }, className: "text-xs-center m-b-5", children: formatMessage(external_confirmation_messages_default.description, { origin: getOrigin(external.url) }) }),
|
|
12063
|
+
/* @__PURE__ */ jsx55("div", { className: "df-box-renderer-fixed-width", children: /* @__PURE__ */ jsxs21("div", { className: "df-box-renderer-width-lg", children: [
|
|
12064
|
+
/* @__PURE__ */ jsx55(
|
|
12031
12065
|
Button5,
|
|
12032
12066
|
{
|
|
12033
12067
|
block: true,
|
|
@@ -12041,7 +12075,7 @@ function ExternalConfirmationDialog({
|
|
|
12041
12075
|
children: formatMessage(external_confirmation_messages_default.open)
|
|
12042
12076
|
}
|
|
12043
12077
|
),
|
|
12044
|
-
/* @__PURE__ */
|
|
12078
|
+
/* @__PURE__ */ jsx55(Button5, { block: true, className: "m-b-2", priority: "tertiary", size: "md", onClick: onClose, children: formatMessage(external_confirmation_messages_default.cancel) })
|
|
12045
12079
|
] }) })
|
|
12046
12080
|
] }) });
|
|
12047
12081
|
}
|
|
@@ -12054,12 +12088,12 @@ function getOrigin(url) {
|
|
|
12054
12088
|
}
|
|
12055
12089
|
|
|
12056
12090
|
// src/revamp/wise/renderers/step/useExternal.tsx
|
|
12057
|
-
import { useEffect as
|
|
12091
|
+
import { useEffect as useEffect6, useState as useState9 } from "react";
|
|
12058
12092
|
function useExternal(url) {
|
|
12059
12093
|
const [externalWindow, setExternalWindow] = useState9(null);
|
|
12060
12094
|
const [hasDismissed, setHasDismissed] = useState9(false);
|
|
12061
12095
|
const dismissConfirmation = () => setHasDismissed(true);
|
|
12062
|
-
|
|
12096
|
+
useEffect6(() => {
|
|
12063
12097
|
if (url) {
|
|
12064
12098
|
setHasDismissed(false);
|
|
12065
12099
|
setExternalWindow(window.open(url, "_blank"));
|
|
@@ -12072,9 +12106,9 @@ function useExternal(url) {
|
|
|
12072
12106
|
// src/revamp/wise/renderers/step/BackButton.tsx
|
|
12073
12107
|
import { Avatar as Avatar4 } from "@transferwise/components";
|
|
12074
12108
|
import { ArrowLeft } from "@transferwise/icons";
|
|
12075
|
-
import { jsx as
|
|
12109
|
+
import { jsx as jsx56, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
12076
12110
|
function BackButton({ title, onClick }) {
|
|
12077
|
-
return /* @__PURE__ */
|
|
12111
|
+
return /* @__PURE__ */ jsxs22(
|
|
12078
12112
|
"a",
|
|
12079
12113
|
{
|
|
12080
12114
|
href: "/",
|
|
@@ -12085,8 +12119,8 @@ function BackButton({ title, onClick }) {
|
|
|
12085
12119
|
onClick();
|
|
12086
12120
|
},
|
|
12087
12121
|
children: [
|
|
12088
|
-
/* @__PURE__ */
|
|
12089
|
-
/* @__PURE__ */
|
|
12122
|
+
/* @__PURE__ */ jsx56("span", { className: "sr-only", children: title }),
|
|
12123
|
+
/* @__PURE__ */ jsx56(Avatar4, { type: "icon", children: /* @__PURE__ */ jsx56(ArrowLeft, { size: "24" }) })
|
|
12090
12124
|
]
|
|
12091
12125
|
}
|
|
12092
12126
|
);
|
|
@@ -12094,7 +12128,7 @@ function BackButton({ title, onClick }) {
|
|
|
12094
12128
|
var BackButton_default = BackButton;
|
|
12095
12129
|
|
|
12096
12130
|
// src/revamp/wise/renderers/step/StepRenderer.tsx
|
|
12097
|
-
import { jsx as
|
|
12131
|
+
import { jsx as jsx57, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
12098
12132
|
var StepRenderer = {
|
|
12099
12133
|
canRenderType: "step",
|
|
12100
12134
|
render: StepRendererComponent
|
|
@@ -12104,10 +12138,10 @@ function StepRendererComponent(props) {
|
|
|
12104
12138
|
const value = useMemo4(() => ({ loadingState, trackEvent }), [loadingState, trackEvent]);
|
|
12105
12139
|
const { requiresUserConfirmation, dismissConfirmation } = useExternal(external == null ? void 0 : external.url);
|
|
12106
12140
|
if ((external == null ? void 0 : external.url) && requiresUserConfirmation) {
|
|
12107
|
-
return /* @__PURE__ */
|
|
12141
|
+
return /* @__PURE__ */ jsx57(ExternalConfirmationDialog, { external, onClose: dismissConfirmation });
|
|
12108
12142
|
}
|
|
12109
|
-
return /* @__PURE__ */
|
|
12110
|
-
back ? /* @__PURE__ */
|
|
12143
|
+
return /* @__PURE__ */ jsxs23(StepRendererContextProvider, { value, children: [
|
|
12144
|
+
back ? /* @__PURE__ */ jsx57(BackButton_default, __spreadValues({}, back)) : null,
|
|
12111
12145
|
children
|
|
12112
12146
|
] });
|
|
12113
12147
|
}
|
|
@@ -12146,18 +12180,18 @@ var getWiseRenderers = () => [
|
|
|
12146
12180
|
];
|
|
12147
12181
|
|
|
12148
12182
|
// src/revamp/DynamicFlowWise.tsx
|
|
12149
|
-
import { jsx as
|
|
12183
|
+
import { jsx as jsx58 } from "react/jsx-runtime";
|
|
12150
12184
|
var wiseRenderers = getWiseRenderers();
|
|
12151
12185
|
function DynamicFlowWise(props) {
|
|
12152
12186
|
const { httpClient, renderers } = props;
|
|
12153
12187
|
const mergedRenderers = useMemo5(() => [...renderers != null ? renderers : [], ...wiseRenderers], [renderers]);
|
|
12154
|
-
return /* @__PURE__ */
|
|
12188
|
+
return /* @__PURE__ */ jsx58(HttpClientProvider, { httpClient, children: /* @__PURE__ */ jsx58(DynamicFlowCore, __spreadProps(__spreadValues({}, props), { renderers: mergedRenderers })) });
|
|
12155
12189
|
}
|
|
12156
12190
|
var DynamicFlowWise_default = DynamicFlowWise;
|
|
12157
12191
|
|
|
12158
12192
|
// src/revamp/DynamicFragmentWise.tsx
|
|
12159
12193
|
import { forwardRef as forwardRef3, useImperativeHandle, useMemo as useMemo6 } from "react";
|
|
12160
|
-
import { jsx as
|
|
12194
|
+
import { jsx as jsx59 } from "react/jsx-runtime";
|
|
12161
12195
|
var wiseRenderers2 = getWiseRenderers();
|
|
12162
12196
|
var DynamicFragmentWise = forwardRef3(function DynamicFragmentWise2(props, ref) {
|
|
12163
12197
|
const { httpClient, onEvent, onError, renderers } = props;
|
|
@@ -12182,14 +12216,14 @@ var DynamicFragmentWise = forwardRef3(function DynamicFragmentWise2(props, ref)
|
|
|
12182
12216
|
() => getRenderFunction([CoreContainerRenderer, ...mergedRenderers, StepRenderer]),
|
|
12183
12217
|
[mergedRenderers]
|
|
12184
12218
|
);
|
|
12185
|
-
return /* @__PURE__ */
|
|
12219
|
+
return /* @__PURE__ */ jsx59(
|
|
12186
12220
|
ErrorBoundary_default,
|
|
12187
12221
|
{
|
|
12188
12222
|
onError: (error) => {
|
|
12189
12223
|
onEvent == null ? void 0 : onEvent("Dynamic Flow - Failed");
|
|
12190
12224
|
onError(error);
|
|
12191
12225
|
},
|
|
12192
|
-
children: /* @__PURE__ */
|
|
12226
|
+
children: /* @__PURE__ */ jsx59(HttpClientProvider, { httpClient, children: stepComponentRef.current ? render(stepComponentRef.current) : null })
|
|
12193
12227
|
}
|
|
12194
12228
|
);
|
|
12195
12229
|
});
|
|
@@ -12500,7 +12534,7 @@ function isReference(block) {
|
|
|
12500
12534
|
}
|
|
12501
12535
|
|
|
12502
12536
|
// src/legacy/dynamicFlow/DynamicFlow.tsx
|
|
12503
|
-
import { useCallback as useCallback11, useEffect as
|
|
12537
|
+
import { useCallback as useCallback11, useEffect as useEffect26, useMemo as useMemo22, useState as useState34 } from "react";
|
|
12504
12538
|
|
|
12505
12539
|
// src/legacy/common/contexts/dynamicFlowContexts/DynamicFlowContexts.tsx
|
|
12506
12540
|
import { createContext as createContext4, useContext as useContext5, useMemo as useMemo7 } from "react";
|
|
@@ -12523,7 +12557,7 @@ var noop2 = () => {
|
|
|
12523
12557
|
};
|
|
12524
12558
|
|
|
12525
12559
|
// src/legacy/common/contexts/dynamicFlowContexts/DynamicFlowContexts.tsx
|
|
12526
|
-
import { jsx as
|
|
12560
|
+
import { jsx as jsx60 } from "react/jsx-runtime";
|
|
12527
12561
|
var defaultContextValue = {
|
|
12528
12562
|
loading: false,
|
|
12529
12563
|
registerPersistAsyncPromise: (promise) => {
|
|
@@ -12538,7 +12572,7 @@ var DynamicFlowProvider = ({ loading, children }) => {
|
|
|
12538
12572
|
registerPersistAsyncPromise: addPendingPromise
|
|
12539
12573
|
};
|
|
12540
12574
|
}, [loading, pendingPromises, addPendingPromise]);
|
|
12541
|
-
return /* @__PURE__ */
|
|
12575
|
+
return /* @__PURE__ */ jsx60(DFContext.Provider, { value: providerValue, children });
|
|
12542
12576
|
};
|
|
12543
12577
|
var useDynamicFlow = () => {
|
|
12544
12578
|
const context = useContext5(DFContext);
|
|
@@ -12547,7 +12581,7 @@ var useDynamicFlow = () => {
|
|
|
12547
12581
|
|
|
12548
12582
|
// src/legacy/common/contexts/eventsContext/EventsContext.tsx
|
|
12549
12583
|
import { createContext as createContext5, useContext as useContext6, useMemo as useMemo8 } from "react";
|
|
12550
|
-
import { jsx as
|
|
12584
|
+
import { jsx as jsx61 } from "react/jsx-runtime";
|
|
12551
12585
|
var EventsContext = createContext5({
|
|
12552
12586
|
triggerEvent: () => {
|
|
12553
12587
|
}
|
|
@@ -12557,7 +12591,7 @@ function EventsContextProvider({ metadata, children, onEvent }) {
|
|
|
12557
12591
|
() => ({ triggerEvent: getEventDispatcher(onEvent, metadata) }),
|
|
12558
12592
|
[onEvent, metadata]
|
|
12559
12593
|
);
|
|
12560
|
-
return /* @__PURE__ */
|
|
12594
|
+
return /* @__PURE__ */ jsx61(EventsContext.Provider, { value, children });
|
|
12561
12595
|
}
|
|
12562
12596
|
function useEventDispatcher() {
|
|
12563
12597
|
const { triggerEvent } = useContext6(EventsContext);
|
|
@@ -12572,7 +12606,7 @@ var getEventDispatcher = (onEvent, metadata) => (eventName, properties = {}) =>
|
|
|
12572
12606
|
|
|
12573
12607
|
// src/legacy/common/contexts/logContext/LogContext.tsx
|
|
12574
12608
|
import { createContext as createContext6, useContext as useContext7, useMemo as useMemo9 } from "react";
|
|
12575
|
-
import { jsx as
|
|
12609
|
+
import { jsx as jsx62 } from "react/jsx-runtime";
|
|
12576
12610
|
var getLogger = (level, onLog, flowId = "UNKNOWN-FLOW-ID", stepId = "UNKNOWN-FLOW-ID") => (title, description, extra) => {
|
|
12577
12611
|
try {
|
|
12578
12612
|
onLog(level, `Dynamic Flow ${level} - ${title} - ${description}`, __spreadValues({
|
|
@@ -12594,7 +12628,7 @@ function LogProvider({ flowId, stepId, children, onLog }) {
|
|
|
12594
12628
|
}),
|
|
12595
12629
|
[onLog, flowId, stepId]
|
|
12596
12630
|
);
|
|
12597
|
-
return /* @__PURE__ */
|
|
12631
|
+
return /* @__PURE__ */ jsx62(LogContext.Provider, { value, children });
|
|
12598
12632
|
}
|
|
12599
12633
|
var useLogger = () => {
|
|
12600
12634
|
const logging = useContext7(LogContext);
|
|
@@ -12608,10 +12642,10 @@ var useLogger = () => {
|
|
|
12608
12642
|
|
|
12609
12643
|
// src/legacy/common/contexts/featureContext/FeatureContext.tsx
|
|
12610
12644
|
import { createContext as createContext7, useContext as useContext8 } from "react";
|
|
12611
|
-
import { jsx as
|
|
12645
|
+
import { jsx as jsx63 } from "react/jsx-runtime";
|
|
12612
12646
|
var FeatureContext = createContext7([]);
|
|
12613
12647
|
function FeatureContextProvider({ features, children }) {
|
|
12614
|
-
return /* @__PURE__ */
|
|
12648
|
+
return /* @__PURE__ */ jsx63(FeatureContext.Provider, { value: features, children });
|
|
12615
12649
|
}
|
|
12616
12650
|
|
|
12617
12651
|
// src/legacy/common/utils/api-utils.ts
|
|
@@ -13347,12 +13381,12 @@ function useDebouncedFunction(callback, waitMs) {
|
|
|
13347
13381
|
}
|
|
13348
13382
|
|
|
13349
13383
|
// src/legacy/common/hooks/useExternal/useExternal.tsx
|
|
13350
|
-
import { useEffect as
|
|
13384
|
+
import { useEffect as useEffect7, useState as useState11 } from "react";
|
|
13351
13385
|
function useExternal2(url) {
|
|
13352
13386
|
const [externalWindow, setExternalWindow] = useState11(null);
|
|
13353
13387
|
const [hasManuallyTriggered, setHasManuallyTriggered] = useState11(false);
|
|
13354
13388
|
const dismissConfirmation = () => setHasManuallyTriggered(true);
|
|
13355
|
-
|
|
13389
|
+
useEffect7(() => {
|
|
13356
13390
|
if (url) {
|
|
13357
13391
|
setHasManuallyTriggered(false);
|
|
13358
13392
|
setExternalWindow(window.open(url, "_blank"));
|
|
@@ -13424,7 +13458,7 @@ import { useState as useState28 } from "react";
|
|
|
13424
13458
|
import { useIntl as useIntl19 } from "react-intl";
|
|
13425
13459
|
|
|
13426
13460
|
// src/legacy/jsonSchemaForm/persistAsyncSchema/persistAsyncBasicSchema/PersistAsyncBasicSchema.tsx
|
|
13427
|
-
import { useEffect as
|
|
13461
|
+
import { useEffect as useEffect18, useState as useState27 } from "react";
|
|
13428
13462
|
import { useIntl as useIntl18 } from "react-intl";
|
|
13429
13463
|
|
|
13430
13464
|
// src/legacy/common/constants/DateMode.ts
|
|
@@ -13473,7 +13507,7 @@ var Size = {
|
|
|
13473
13507
|
|
|
13474
13508
|
// src/legacy/jsonSchemaForm/basicTypeSchema/BasicTypeSchema.tsx
|
|
13475
13509
|
var import_classnames16 = __toESM(require_classnames());
|
|
13476
|
-
import { useEffect as
|
|
13510
|
+
import { useEffect as useEffect17, useMemo as useMemo17, useState as useState26 } from "react";
|
|
13477
13511
|
|
|
13478
13512
|
// src/legacy/layout/alert/DynamicAlert.tsx
|
|
13479
13513
|
import { Alert as Alert3 } from "@transferwise/components";
|
|
@@ -13482,19 +13516,19 @@ import { Alert as Alert3 } from "@transferwise/components";
|
|
|
13482
13516
|
import { Avatar as Avatar5, AvatarType as AvatarType4 } from "@transferwise/components";
|
|
13483
13517
|
|
|
13484
13518
|
// src/legacy/layout/icon/FlagIcon.tsx
|
|
13485
|
-
import { jsx as
|
|
13519
|
+
import { jsx as jsx64 } from "react/jsx-runtime";
|
|
13486
13520
|
var isFlagIcon2 = (name) => name.startsWith("flag-");
|
|
13487
13521
|
function FlagIcon2({ name }) {
|
|
13488
13522
|
if (!isFlagIcon2(name)) {
|
|
13489
13523
|
return null;
|
|
13490
13524
|
}
|
|
13491
13525
|
const code = name.substring(5);
|
|
13492
|
-
return /* @__PURE__ */
|
|
13526
|
+
return /* @__PURE__ */ jsx64(Flag, { intrinsicSize: 24, code });
|
|
13493
13527
|
}
|
|
13494
13528
|
|
|
13495
13529
|
// src/legacy/layout/icon/NamedIcon.tsx
|
|
13496
13530
|
import * as icons2 from "@transferwise/icons";
|
|
13497
|
-
import { jsx as
|
|
13531
|
+
import { jsx as jsx65 } from "react/jsx-runtime";
|
|
13498
13532
|
var isNamedIcon2 = (name) => {
|
|
13499
13533
|
const iconName = toCapitalisedCamelCase2(name);
|
|
13500
13534
|
return Object.keys(icons2).includes(iconName);
|
|
@@ -13505,19 +13539,19 @@ function NamedIcon2({ name }) {
|
|
|
13505
13539
|
}
|
|
13506
13540
|
const iconName = toCapitalisedCamelCase2(name);
|
|
13507
13541
|
const Icon = icons2[iconName];
|
|
13508
|
-
return /* @__PURE__ */
|
|
13542
|
+
return /* @__PURE__ */ jsx65(Icon, { size: 24 });
|
|
13509
13543
|
}
|
|
13510
13544
|
var toCapitalisedCamelCase2 = (value) => value.split("-").map(capitaliseFirstChar2).join("");
|
|
13511
13545
|
var capitaliseFirstChar2 = (value) => `${value[0].toUpperCase()}${value.slice(1)}`;
|
|
13512
13546
|
|
|
13513
13547
|
// src/legacy/layout/icon/DynamicIcon.tsx
|
|
13514
|
-
import { jsx as
|
|
13548
|
+
import { jsx as jsx66 } from "react/jsx-runtime";
|
|
13515
13549
|
function DynamicIcon2({ type }) {
|
|
13516
13550
|
if (isFlagIcon2(type)) {
|
|
13517
|
-
return /* @__PURE__ */
|
|
13551
|
+
return /* @__PURE__ */ jsx66(FlagIcon2, { name: type });
|
|
13518
13552
|
}
|
|
13519
13553
|
if (isNamedIcon2(type)) {
|
|
13520
|
-
return /* @__PURE__ */
|
|
13554
|
+
return /* @__PURE__ */ jsx66(NamedIcon2, { name: type });
|
|
13521
13555
|
}
|
|
13522
13556
|
return null;
|
|
13523
13557
|
}
|
|
@@ -13527,17 +13561,17 @@ function isValidIconName(name) {
|
|
|
13527
13561
|
var DynamicIcon_default2 = DynamicIcon2;
|
|
13528
13562
|
|
|
13529
13563
|
// src/legacy/layout/utils/getNavigationOptionMedia.tsx
|
|
13530
|
-
import { jsx as
|
|
13564
|
+
import { jsx as jsx67 } from "react/jsx-runtime";
|
|
13531
13565
|
var getNavigationOptionMedia = ({ icon, image }) => {
|
|
13532
13566
|
if (icon == null ? void 0 : icon.name) {
|
|
13533
|
-
return /* @__PURE__ */
|
|
13567
|
+
return /* @__PURE__ */ jsx67(Avatar5, { type: AvatarType4.ICON, children: /* @__PURE__ */ jsx67(DynamicIcon_default2, { type: icon.name }) });
|
|
13534
13568
|
}
|
|
13535
13569
|
if (icon == null ? void 0 : icon.text) {
|
|
13536
|
-
return /* @__PURE__ */
|
|
13570
|
+
return /* @__PURE__ */ jsx67(Avatar5, { type: AvatarType4.INITIALS, children: icon.text });
|
|
13537
13571
|
}
|
|
13538
13572
|
if (image == null ? void 0 : image.url) {
|
|
13539
13573
|
const { url, text } = image;
|
|
13540
|
-
return /* @__PURE__ */
|
|
13574
|
+
return /* @__PURE__ */ jsx67("img", { src: url, alt: text });
|
|
13541
13575
|
}
|
|
13542
13576
|
return null;
|
|
13543
13577
|
};
|
|
@@ -13573,10 +13607,10 @@ var getTextAlignment2 = (align) => {
|
|
|
13573
13607
|
var getTextAlignmentAndMargin2 = (component) => `${getTextAlignment2(component.align)} ${getMargin2(component.margin)}`;
|
|
13574
13608
|
|
|
13575
13609
|
// src/legacy/layout/alert/DynamicAlert.tsx
|
|
13576
|
-
import { jsx as
|
|
13610
|
+
import { jsx as jsx68 } from "react/jsx-runtime";
|
|
13577
13611
|
var DynamicAlert = (props) => {
|
|
13578
13612
|
const alert = props.component;
|
|
13579
|
-
return /* @__PURE__ */
|
|
13613
|
+
return /* @__PURE__ */ jsx68(
|
|
13580
13614
|
Alert3,
|
|
13581
13615
|
{
|
|
13582
13616
|
type: mapContextToAlertType(legacy_mapContext(alert.context)),
|
|
@@ -13609,12 +13643,12 @@ var mapContextToAlertType = (context) => {
|
|
|
13609
13643
|
var DynamicAlert_default = DynamicAlert;
|
|
13610
13644
|
|
|
13611
13645
|
// src/legacy/layout/box/DynamicBox.tsx
|
|
13612
|
-
import { jsx as
|
|
13646
|
+
import { jsx as jsx69 } from "react/jsx-runtime";
|
|
13613
13647
|
var DynamicBox = (props) => {
|
|
13614
13648
|
const box = props.component;
|
|
13615
13649
|
const margin = getMargin2(box.margin || box.border ? "lg" : "xs");
|
|
13616
13650
|
if (!box.width || box.width === "xl") {
|
|
13617
|
-
return /* @__PURE__ */
|
|
13651
|
+
return /* @__PURE__ */ jsx69("div", { className: margin + getBorderClass(box.border), children: /* @__PURE__ */ jsx69(
|
|
13618
13652
|
DynamicLayout_default,
|
|
13619
13653
|
{
|
|
13620
13654
|
components: box.components,
|
|
@@ -13627,7 +13661,7 @@ var DynamicBox = (props) => {
|
|
|
13627
13661
|
}
|
|
13628
13662
|
) });
|
|
13629
13663
|
}
|
|
13630
|
-
return /* @__PURE__ */
|
|
13664
|
+
return /* @__PURE__ */ jsx69("div", { className: "row", children: /* @__PURE__ */ jsx69("div", { className: margin + getBoxWidthClasses(box), children: /* @__PURE__ */ jsx69("div", { className: getBorderClass(box.border), children: /* @__PURE__ */ jsx69(
|
|
13631
13665
|
DynamicLayout_default,
|
|
13632
13666
|
{
|
|
13633
13667
|
components: box.components,
|
|
@@ -13711,7 +13745,7 @@ var getButtonSize = (size) => {
|
|
|
13711
13745
|
};
|
|
13712
13746
|
|
|
13713
13747
|
// src/legacy/layout/button/DynamicButton.tsx
|
|
13714
|
-
import { jsx as
|
|
13748
|
+
import { jsx as jsx70 } from "react/jsx-runtime";
|
|
13715
13749
|
function DynamicButton(props) {
|
|
13716
13750
|
var _a;
|
|
13717
13751
|
const { component, onAction } = props;
|
|
@@ -13720,7 +13754,7 @@ function DynamicButton(props) {
|
|
|
13720
13754
|
const priority = getButtonPriority(component);
|
|
13721
13755
|
const { loading } = useDynamicFlow();
|
|
13722
13756
|
const className = getMargin2(component.margin || "md");
|
|
13723
|
-
return /* @__PURE__ */
|
|
13757
|
+
return /* @__PURE__ */ jsx70(
|
|
13724
13758
|
Button6,
|
|
13725
13759
|
{
|
|
13726
13760
|
size: getButtonSize(component.size),
|
|
@@ -13737,12 +13771,12 @@ function DynamicButton(props) {
|
|
|
13737
13771
|
var DynamicButton_default = DynamicButton;
|
|
13738
13772
|
|
|
13739
13773
|
// src/legacy/layout/columns/DynamicColumns.tsx
|
|
13740
|
-
import { jsx as
|
|
13774
|
+
import { jsx as jsx71, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
13741
13775
|
var DynamicColumns = (props) => {
|
|
13742
13776
|
const columns = props.component;
|
|
13743
13777
|
const { leftWidth, rightWidth } = getWidth(columns.bias);
|
|
13744
|
-
return /* @__PURE__ */
|
|
13745
|
-
/* @__PURE__ */
|
|
13778
|
+
return /* @__PURE__ */ jsxs24("div", { className: `${getMargin2(columns.margin || "xs")} row`, children: [
|
|
13779
|
+
/* @__PURE__ */ jsx71("div", { className: `${leftWidth} m-b-0`, children: /* @__PURE__ */ jsx71(
|
|
13746
13780
|
DynamicLayout_default,
|
|
13747
13781
|
{
|
|
13748
13782
|
components: columns.left,
|
|
@@ -13754,7 +13788,7 @@ var DynamicColumns = (props) => {
|
|
|
13754
13788
|
onPersistAsync: props.onPersistAsync
|
|
13755
13789
|
}
|
|
13756
13790
|
) }),
|
|
13757
|
-
/* @__PURE__ */
|
|
13791
|
+
/* @__PURE__ */ jsx71("div", { className: `${rightWidth} m-b-0`, children: /* @__PURE__ */ jsx71(
|
|
13758
13792
|
DynamicLayout_default,
|
|
13759
13793
|
{
|
|
13760
13794
|
components: columns.right,
|
|
@@ -13790,10 +13824,10 @@ var DynamicColumns_default = DynamicColumns;
|
|
|
13790
13824
|
|
|
13791
13825
|
// src/legacy/layout/decision/DynamicDecision.tsx
|
|
13792
13826
|
import { NavigationOption as NavigationOption4, NavigationOptionsList as NavigationOptionsList3 } from "@transferwise/components";
|
|
13793
|
-
import { jsx as
|
|
13827
|
+
import { jsx as jsx72 } from "react/jsx-runtime";
|
|
13794
13828
|
function DynamicDecision({ component, onAction }) {
|
|
13795
13829
|
const { loading } = useDynamicFlow();
|
|
13796
|
-
return /* @__PURE__ */
|
|
13830
|
+
return /* @__PURE__ */ jsx72("div", { className: getMargin2(component.margin), children: /* @__PURE__ */ jsx72(NavigationOptionsList3, { children: component.options.map((option) => /* @__PURE__ */ jsx72(
|
|
13797
13831
|
NavigationOption4,
|
|
13798
13832
|
{
|
|
13799
13833
|
title: option.title,
|
|
@@ -13810,17 +13844,17 @@ function DynamicDecision({ component, onAction }) {
|
|
|
13810
13844
|
var DynamicDecision_default = DynamicDecision;
|
|
13811
13845
|
|
|
13812
13846
|
// src/legacy/layout/divider/DynamicDivider.tsx
|
|
13813
|
-
import { jsx as
|
|
13847
|
+
import { jsx as jsx73 } from "react/jsx-runtime";
|
|
13814
13848
|
var DynamicDivider = ({ component }) => {
|
|
13815
13849
|
const margin = getMargin2(component.margin);
|
|
13816
13850
|
const className = `m-t-0 ${margin}`;
|
|
13817
|
-
return /* @__PURE__ */
|
|
13851
|
+
return /* @__PURE__ */ jsx73("hr", { className });
|
|
13818
13852
|
};
|
|
13819
13853
|
var DynamicDivider_default = DynamicDivider;
|
|
13820
13854
|
|
|
13821
13855
|
// src/legacy/layout/external/DynamicExternal.tsx
|
|
13822
13856
|
import { Button as Button7, Loader as Loader2, Size as Size2 } from "@transferwise/components";
|
|
13823
|
-
import { useCallback as useCallback6, useEffect as
|
|
13857
|
+
import { useCallback as useCallback6, useEffect as useEffect8 } from "react";
|
|
13824
13858
|
import { useIntl as useIntl8 } from "react-intl";
|
|
13825
13859
|
|
|
13826
13860
|
// src/legacy/layout/external/DynamicExternal.messages.ts
|
|
@@ -13834,7 +13868,7 @@ var DynamicExternal_messages_default = defineMessages9({
|
|
|
13834
13868
|
});
|
|
13835
13869
|
|
|
13836
13870
|
// src/legacy/layout/external/DynamicExternal.tsx
|
|
13837
|
-
import { Fragment as
|
|
13871
|
+
import { Fragment as Fragment11, jsx as jsx74, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
13838
13872
|
var DynamicExternal = ({ component, onAction }) => {
|
|
13839
13873
|
const { requestUrl, responseHandlers, polling, retryTitle } = component;
|
|
13840
13874
|
const intl = useIntl8();
|
|
@@ -13842,29 +13876,29 @@ var DynamicExternal = ({ component, onAction }) => {
|
|
|
13842
13876
|
() => window.open(requestUrl, "df-external-window"),
|
|
13843
13877
|
[requestUrl]
|
|
13844
13878
|
);
|
|
13845
|
-
|
|
13879
|
+
useEffect8(() => {
|
|
13846
13880
|
openExternalUrl();
|
|
13847
13881
|
}, [openExternalUrl]);
|
|
13848
13882
|
const pollingConfiguration = polling && responseHandlers ? __spreadProps(__spreadValues({}, polling), {
|
|
13849
13883
|
responseHandlers
|
|
13850
13884
|
}) : void 0;
|
|
13851
13885
|
useExternalStepPolling(pollingConfiguration, onAction);
|
|
13852
|
-
return /* @__PURE__ */
|
|
13853
|
-
/* @__PURE__ */
|
|
13854
|
-
/* @__PURE__ */
|
|
13855
|
-
/* @__PURE__ */
|
|
13886
|
+
return /* @__PURE__ */ jsxs25(Fragment11, { children: [
|
|
13887
|
+
/* @__PURE__ */ jsx74(Loader2, { size: Size2.LARGE, classNames: { "tw-loader": "tw-loader m-x-auto" } }),
|
|
13888
|
+
/* @__PURE__ */ jsx74("br", {}),
|
|
13889
|
+
/* @__PURE__ */ jsx74(Button7, { priority: "tertiary", block: true, onClick: openExternalUrl, children: retryTitle || intl.formatMessage(DynamicExternal_messages_default.retryTitle) })
|
|
13856
13890
|
] });
|
|
13857
13891
|
};
|
|
13858
13892
|
var DynamicExternal_default = DynamicExternal;
|
|
13859
13893
|
|
|
13860
13894
|
// src/legacy/jsonSchemaForm/genericSchema/GenericSchema.tsx
|
|
13861
|
-
import { useEffect as
|
|
13895
|
+
import { useEffect as useEffect15 } from "react";
|
|
13862
13896
|
|
|
13863
13897
|
// src/legacy/jsonSchemaForm/allOfSchema/AllOfSchema.tsx
|
|
13864
13898
|
var import_classnames7 = __toESM(require_classnames());
|
|
13865
13899
|
import { Header as Header6 } from "@transferwise/components";
|
|
13866
13900
|
import { useState as useState12 } from "react";
|
|
13867
|
-
import { Fragment as
|
|
13901
|
+
import { Fragment as Fragment12, jsx as jsx75, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
13868
13902
|
var splitModel = (model, schemas) => schemas.map((schema) => getValidObjectModelParts(model, schema) || {});
|
|
13869
13903
|
var combineModels = (models) => models.reduce((current, combined) => __spreadValues(__spreadValues({}, combined), current), {});
|
|
13870
13904
|
var getSchemaColumnClasses = (width) => ({
|
|
@@ -13880,12 +13914,12 @@ function AllOfSchema(props) {
|
|
|
13880
13914
|
props.onChange(__spreadProps(__spreadValues({}, onChangeProps), { model: combineModels(models) }));
|
|
13881
13915
|
};
|
|
13882
13916
|
const [models, setModels] = useState12(splitModel(props.model, props.schema.allOf));
|
|
13883
|
-
return /* @__PURE__ */
|
|
13884
|
-
props.schema.title && /* @__PURE__ */
|
|
13885
|
-
props.schema.description && /* @__PURE__ */
|
|
13886
|
-
/* @__PURE__ */
|
|
13917
|
+
return /* @__PURE__ */ jsxs26(Fragment12, { children: [
|
|
13918
|
+
props.schema.title && /* @__PURE__ */ jsx75(Header6, { title: props.schema.title }),
|
|
13919
|
+
props.schema.description && /* @__PURE__ */ jsx75("p", { children: props.schema.description }),
|
|
13920
|
+
/* @__PURE__ */ jsx75("div", { className: "row", children: props.schema.allOf.map((schema, index) => (
|
|
13887
13921
|
// eslint-disable-next-line react/no-array-index-key
|
|
13888
|
-
/* @__PURE__ */
|
|
13922
|
+
/* @__PURE__ */ jsx75("div", { className: (0, import_classnames7.default)(getSchemaColumnClasses(schema.width)), children: /* @__PURE__ */ jsx75(
|
|
13889
13923
|
GenericSchema_default,
|
|
13890
13924
|
{
|
|
13891
13925
|
schema,
|
|
@@ -13920,7 +13954,7 @@ import { useMemo as useMemo11, useState as useState13 } from "react";
|
|
|
13920
13954
|
import { InlineAlert as InlineAlert4 } from "@transferwise/components";
|
|
13921
13955
|
import { formatDate as formatDate3 } from "@transferwise/formatting";
|
|
13922
13956
|
import { useIntl as useIntl9 } from "react-intl";
|
|
13923
|
-
import { jsx as
|
|
13957
|
+
import { jsx as jsx76, jsxs as jsxs27 } from "react/jsx-runtime";
|
|
13924
13958
|
function ControlFeedback(props) {
|
|
13925
13959
|
var _a;
|
|
13926
13960
|
const defaultValidationMessages = useDefaultValidationMessages(props.schema);
|
|
@@ -13929,12 +13963,12 @@ function ControlFeedback(props) {
|
|
|
13929
13963
|
const isValidationVisible = !isErrorVisible && (props.submitted || props.changed && props.blurred) && Boolean((_a = props.validations) == null ? void 0 : _a.length);
|
|
13930
13964
|
const isDescriptionVisible = props.schema.type !== "boolean" && props.schema.description && !isErrorVisible && !isValidationVisible;
|
|
13931
13965
|
const hasInfoMessage = Boolean(props.infoMessage);
|
|
13932
|
-
return /* @__PURE__ */
|
|
13933
|
-
isErrorVisible ? /* @__PURE__ */
|
|
13934
|
-
isValidationVisible ? /* @__PURE__ */
|
|
13935
|
-
(isDescriptionVisible || hasInfoMessage) && /* @__PURE__ */
|
|
13936
|
-
isDescriptionVisible && /* @__PURE__ */
|
|
13937
|
-
hasInfoMessage && /* @__PURE__ */
|
|
13966
|
+
return /* @__PURE__ */ jsxs27("div", { id: props.id, children: [
|
|
13967
|
+
isErrorVisible ? /* @__PURE__ */ jsx76(InlineAlert4, { type: "error", children: props.errors }) : null,
|
|
13968
|
+
isValidationVisible ? /* @__PURE__ */ jsx76(InlineAlert4, { type: "error", children: props.validations.map((validation) => /* @__PURE__ */ jsx76("div", { children: validationMessages[validation] }, validation)) }) : null,
|
|
13969
|
+
(isDescriptionVisible || hasInfoMessage) && /* @__PURE__ */ jsxs27(InlineAlert4, { type: "info", children: [
|
|
13970
|
+
isDescriptionVisible && /* @__PURE__ */ jsx76("div", { children: props.schema.description }),
|
|
13971
|
+
hasInfoMessage && /* @__PURE__ */ jsx76("div", { children: props.infoMessage })
|
|
13938
13972
|
] })
|
|
13939
13973
|
] });
|
|
13940
13974
|
}
|
|
@@ -14060,7 +14094,7 @@ function useFormattedDefaultErrorMessages({
|
|
|
14060
14094
|
}
|
|
14061
14095
|
|
|
14062
14096
|
// src/legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/MultipleFileUploadSchema.tsx
|
|
14063
|
-
import { jsx as
|
|
14097
|
+
import { jsx as jsx77, jsxs as jsxs28 } from "react/jsx-runtime";
|
|
14064
14098
|
function MultipleFileUploadSchema(props) {
|
|
14065
14099
|
var _a, _b;
|
|
14066
14100
|
const { onChange, schema } = props;
|
|
@@ -14122,10 +14156,10 @@ function MultipleFileUploadSchema(props) {
|
|
|
14122
14156
|
onDeleteFile: () => Promise.resolve()
|
|
14123
14157
|
});
|
|
14124
14158
|
const feedbackId = `${uid}-feedback`;
|
|
14125
|
-
return /* @__PURE__ */
|
|
14126
|
-
/* @__PURE__ */
|
|
14127
|
-
/* @__PURE__ */
|
|
14128
|
-
/* @__PURE__ */
|
|
14159
|
+
return /* @__PURE__ */ jsxs28("div", { className: (0, import_classnames8.default)("form-group", { "has-error": showError }), children: [
|
|
14160
|
+
/* @__PURE__ */ jsx77("label", { className: "d-block control-label", htmlFor: uid, children: props.schema.title }),
|
|
14161
|
+
/* @__PURE__ */ jsx77("div", { "aria-describedby": feedbackId, children: /* @__PURE__ */ jsx77(UploadInput3, __spreadValues({}, uploadInputProps)) }),
|
|
14162
|
+
/* @__PURE__ */ jsx77(
|
|
14129
14163
|
ControlFeedback_default,
|
|
14130
14164
|
{
|
|
14131
14165
|
id: feedbackId,
|
|
@@ -14168,12 +14202,12 @@ function getValidationMessages(schema, required, defaultErrorMessages) {
|
|
|
14168
14202
|
// src/legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multiSelectSchema/MultiSelectSchema.tsx
|
|
14169
14203
|
var import_classnames9 = __toESM(require_classnames());
|
|
14170
14204
|
import { SelectInput as SelectInput2, SelectInputOptionContent as SelectInputOptionContent2 } from "@transferwise/components";
|
|
14171
|
-
import { useEffect as
|
|
14205
|
+
import { useEffect as useEffect9, useMemo as useMemo12, useState as useState14 } from "react";
|
|
14172
14206
|
import { useIntl as useIntl11 } from "react-intl";
|
|
14173
14207
|
|
|
14174
14208
|
// src/legacy/jsonSchemaForm/schemaFormControl/utils/mapping-utils.tsx
|
|
14175
14209
|
import { Avatar as Avatar6, AvatarType as AvatarType5 } from "@transferwise/components";
|
|
14176
|
-
import { jsx as
|
|
14210
|
+
import { jsx as jsx78 } from "react/jsx-runtime";
|
|
14177
14211
|
var mapConstSchemaToOption = (schema, controlType) => {
|
|
14178
14212
|
switch (controlType) {
|
|
14179
14213
|
case "select":
|
|
@@ -14197,7 +14231,7 @@ var mapKeywordsToSearchStrings = (searchStrings) => isArray2(searchStrings) ? {
|
|
|
14197
14231
|
var mapImage = (image) => {
|
|
14198
14232
|
if (image == null ? void 0 : image.url) {
|
|
14199
14233
|
return {
|
|
14200
|
-
icon: /* @__PURE__ */
|
|
14234
|
+
icon: /* @__PURE__ */ jsx78("div", { className: "media", children: /* @__PURE__ */ jsx78("div", { className: "np-option__no-media-circle", children: /* @__PURE__ */ jsx78("img", { src: image.url, alt: image.name || "" }) }) }),
|
|
14201
14235
|
hideIconInTrigger: true
|
|
14202
14236
|
};
|
|
14203
14237
|
}
|
|
@@ -14206,17 +14240,17 @@ var mapImage = (image) => {
|
|
|
14206
14240
|
var getIconPropertyForSelectOption = (icon) => {
|
|
14207
14241
|
if ((icon == null ? void 0 : icon.name) && isFlagIcon2(icon.name)) {
|
|
14208
14242
|
return {
|
|
14209
|
-
icon: /* @__PURE__ */
|
|
14243
|
+
icon: /* @__PURE__ */ jsx78(Flag, { code: icon.name.substring(5), intrinsicSize: 24 })
|
|
14210
14244
|
};
|
|
14211
14245
|
}
|
|
14212
14246
|
if ((icon == null ? void 0 : icon.name) && isValidIconName(icon.name)) {
|
|
14213
14247
|
return {
|
|
14214
|
-
icon: /* @__PURE__ */
|
|
14248
|
+
icon: /* @__PURE__ */ jsx78(DynamicIcon_default2, { type: icon.name })
|
|
14215
14249
|
};
|
|
14216
14250
|
}
|
|
14217
14251
|
if (icon == null ? void 0 : icon.text) {
|
|
14218
14252
|
return {
|
|
14219
|
-
icon: /* @__PURE__ */
|
|
14253
|
+
icon: /* @__PURE__ */ jsx78("span", { children: icon.text })
|
|
14220
14254
|
};
|
|
14221
14255
|
}
|
|
14222
14256
|
return null;
|
|
@@ -14224,17 +14258,17 @@ var getIconPropertyForSelectOption = (icon) => {
|
|
|
14224
14258
|
var getAvatarPropertyForRadioOption = ({ image, icon }) => {
|
|
14225
14259
|
if (image == null ? void 0 : image.url) {
|
|
14226
14260
|
return {
|
|
14227
|
-
avatar: /* @__PURE__ */
|
|
14261
|
+
avatar: /* @__PURE__ */ jsx78(Avatar6, { type: AvatarType5.THUMBNAIL, children: /* @__PURE__ */ jsx78("img", { src: image.url, alt: "" }) })
|
|
14228
14262
|
};
|
|
14229
14263
|
}
|
|
14230
14264
|
if ((icon == null ? void 0 : icon.name) && isValidIconName(icon.name)) {
|
|
14231
14265
|
return {
|
|
14232
|
-
avatar: /* @__PURE__ */
|
|
14266
|
+
avatar: /* @__PURE__ */ jsx78(Avatar6, { type: AvatarType5.ICON, children: /* @__PURE__ */ jsx78(DynamicIcon_default2, { type: icon.name }) })
|
|
14233
14267
|
};
|
|
14234
14268
|
}
|
|
14235
14269
|
if (icon == null ? void 0 : icon.text) {
|
|
14236
14270
|
return {
|
|
14237
|
-
avatar: /* @__PURE__ */
|
|
14271
|
+
avatar: /* @__PURE__ */ jsx78(Avatar6, { type: AvatarType5.INITIALS, children: icon.text })
|
|
14238
14272
|
};
|
|
14239
14273
|
}
|
|
14240
14274
|
return null;
|
|
@@ -14273,7 +14307,7 @@ var multi_select_messages_default = defineMessages11({
|
|
|
14273
14307
|
});
|
|
14274
14308
|
|
|
14275
14309
|
// src/legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multiSelectSchema/MultiSelectSchema.tsx
|
|
14276
|
-
import { jsx as
|
|
14310
|
+
import { jsx as jsx79, jsxs as jsxs29 } from "react/jsx-runtime";
|
|
14277
14311
|
function MultiSelectSchema({
|
|
14278
14312
|
schema,
|
|
14279
14313
|
model,
|
|
@@ -14288,7 +14322,7 @@ function MultiSelectSchema({
|
|
|
14288
14322
|
const id = useMemo12(() => schema.$id || generateRandomId(), [schema.$id]);
|
|
14289
14323
|
const [changed, setChanged] = useState14(false);
|
|
14290
14324
|
const [selected, setSelected] = useState14(getInitialModelIndices(model, options));
|
|
14291
|
-
|
|
14325
|
+
useEffect9(
|
|
14292
14326
|
() => {
|
|
14293
14327
|
if (selected) {
|
|
14294
14328
|
broadcastModelChange(selected);
|
|
@@ -14325,9 +14359,9 @@ function MultiSelectSchema({
|
|
|
14325
14359
|
const formGroupClasses = {
|
|
14326
14360
|
"has-error": shouldShowInitialError || shouldShowValidationError
|
|
14327
14361
|
};
|
|
14328
|
-
return /* @__PURE__ */
|
|
14329
|
-
schema.title ? /* @__PURE__ */
|
|
14330
|
-
/* @__PURE__ */
|
|
14362
|
+
return /* @__PURE__ */ jsxs29("div", { className: (0, import_classnames9.default)("d-flex flex-column", formGroupClasses), children: [
|
|
14363
|
+
schema.title ? /* @__PURE__ */ jsx79("label", { htmlFor: id, children: schema.title }) : void 0,
|
|
14364
|
+
/* @__PURE__ */ jsx79(
|
|
14331
14365
|
SelectInput2,
|
|
14332
14366
|
{
|
|
14333
14367
|
id,
|
|
@@ -14337,20 +14371,28 @@ function MultiSelectSchema({
|
|
|
14337
14371
|
items: options.map((value, index) => ({
|
|
14338
14372
|
type: "option",
|
|
14339
14373
|
value: index,
|
|
14340
|
-
disabled: value.disabled
|
|
14374
|
+
disabled: value.disabled,
|
|
14375
|
+
filterMatchers: [
|
|
14376
|
+
value.label,
|
|
14377
|
+
value.value,
|
|
14378
|
+
...value.note ? [value.note] : [],
|
|
14379
|
+
...value.secondary ? [value.secondary] : [],
|
|
14380
|
+
...value.searchStrings ? value.searchStrings : []
|
|
14381
|
+
]
|
|
14341
14382
|
})),
|
|
14383
|
+
filterable: options.length >= 8,
|
|
14342
14384
|
value: selected != null ? selected : [],
|
|
14343
14385
|
renderValue: (index, withinTrigger) => {
|
|
14344
14386
|
const { icon, label, note, secondary } = options[index];
|
|
14345
14387
|
if (withinTrigger) {
|
|
14346
14388
|
return selected && index === selected[0] ? getFormattedMessage() : void 0;
|
|
14347
14389
|
}
|
|
14348
|
-
return /* @__PURE__ */
|
|
14390
|
+
return /* @__PURE__ */ jsx79(SelectInputOptionContent2, { title: label, note: note != null ? note : secondary, icon });
|
|
14349
14391
|
},
|
|
14350
14392
|
onChange: broadcastModelChange
|
|
14351
14393
|
}
|
|
14352
14394
|
),
|
|
14353
|
-
/* @__PURE__ */
|
|
14395
|
+
/* @__PURE__ */ jsx79(
|
|
14354
14396
|
ControlFeedback_default,
|
|
14355
14397
|
{
|
|
14356
14398
|
id: `${id}-feedback`,
|
|
@@ -14382,9 +14424,9 @@ import { useIntl as useIntl13 } from "react-intl";
|
|
|
14382
14424
|
|
|
14383
14425
|
// src/legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/repeatableSchema/ItemSummary.tsx
|
|
14384
14426
|
import { NavigationOption as NavigationOption5 } from "@transferwise/components";
|
|
14385
|
-
import { jsx as
|
|
14427
|
+
import { jsx as jsx80 } from "react/jsx-runtime";
|
|
14386
14428
|
function ItemSummaryOption2({ item, onClick }) {
|
|
14387
|
-
return /* @__PURE__ */
|
|
14429
|
+
return /* @__PURE__ */ jsx80(
|
|
14388
14430
|
NavigationOption5,
|
|
14389
14431
|
{
|
|
14390
14432
|
media: getNavigationOptionMedia(item),
|
|
@@ -14399,7 +14441,7 @@ function ItemSummaryOption2({ item, onClick }) {
|
|
|
14399
14441
|
// src/legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/repeatableSchema/RepeatableSchemaStep.tsx
|
|
14400
14442
|
import { useState as useState15 } from "react";
|
|
14401
14443
|
import { useIntl as useIntl12 } from "react-intl";
|
|
14402
|
-
import { jsx as
|
|
14444
|
+
import { jsx as jsx81 } from "react/jsx-runtime";
|
|
14403
14445
|
function RepeatableSchemaStep({
|
|
14404
14446
|
type,
|
|
14405
14447
|
schema,
|
|
@@ -14447,7 +14489,7 @@ function RepeatableSchemaStep({
|
|
|
14447
14489
|
}
|
|
14448
14490
|
onModelChange(__spreadProps(__spreadValues({}, modelChangeProps), { model: model2 }));
|
|
14449
14491
|
};
|
|
14450
|
-
return /* @__PURE__ */
|
|
14492
|
+
return /* @__PURE__ */ jsx81(
|
|
14451
14493
|
DynamicFlowStep,
|
|
14452
14494
|
{
|
|
14453
14495
|
step,
|
|
@@ -14653,7 +14695,7 @@ var schemaSummaryProvides = (summary, providesProp) => (
|
|
|
14653
14695
|
|
|
14654
14696
|
// src/legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/repeatableSchema/RepeatableSchema.tsx
|
|
14655
14697
|
var import_classnames10 = __toESM(require_classnames());
|
|
14656
|
-
import { jsx as
|
|
14698
|
+
import { jsx as jsx82, jsxs as jsxs30 } from "react/jsx-runtime";
|
|
14657
14699
|
function RepeatableSchema({
|
|
14658
14700
|
schema,
|
|
14659
14701
|
model,
|
|
@@ -14730,9 +14772,9 @@ function RepeatableSchema({
|
|
|
14730
14772
|
const formGroupClasses = {
|
|
14731
14773
|
"has-error": (_a = errors && !isEmpty(errors)) != null ? _a : submitted && validations.length
|
|
14732
14774
|
};
|
|
14733
|
-
return /* @__PURE__ */
|
|
14734
|
-
schema.title && /* @__PURE__ */
|
|
14735
|
-
itemSummaries == null ? void 0 : itemSummaries.map((itemSummary) => /* @__PURE__ */
|
|
14775
|
+
return /* @__PURE__ */ jsxs30("div", { id, className: (0, import_classnames10.default)(formGroupClasses), children: [
|
|
14776
|
+
schema.title && /* @__PURE__ */ jsx82(Header7, { title: schema.title }),
|
|
14777
|
+
itemSummaries == null ? void 0 : itemSummaries.map((itemSummary) => /* @__PURE__ */ jsx82(
|
|
14736
14778
|
ItemSummaryOption2,
|
|
14737
14779
|
{
|
|
14738
14780
|
item: itemSummary,
|
|
@@ -14740,21 +14782,21 @@ function RepeatableSchema({
|
|
|
14740
14782
|
},
|
|
14741
14783
|
JSON.stringify(itemSummary)
|
|
14742
14784
|
)),
|
|
14743
|
-
/* @__PURE__ */
|
|
14785
|
+
/* @__PURE__ */ jsx82(
|
|
14744
14786
|
NavigationOption6,
|
|
14745
14787
|
{
|
|
14746
|
-
media: /* @__PURE__ */
|
|
14788
|
+
media: /* @__PURE__ */ jsx82(Plus2, {}),
|
|
14747
14789
|
title: schema.addItemTitle || formatMessage(repeatable_messages_default.addItemTitle),
|
|
14748
14790
|
showMediaAtAllSizes: true,
|
|
14749
14791
|
onClick: onAddItem
|
|
14750
14792
|
}
|
|
14751
14793
|
),
|
|
14752
|
-
/* @__PURE__ */
|
|
14794
|
+
/* @__PURE__ */ jsx82(
|
|
14753
14795
|
Modal3,
|
|
14754
14796
|
{
|
|
14755
14797
|
open: openModalType !== null,
|
|
14756
14798
|
title: (openModalType === "add" ? schema.addItemTitle : schema.editItemTitle) || formatMessage(repeatable_messages_default.addItemTitle),
|
|
14757
|
-
body: /* @__PURE__ */
|
|
14799
|
+
body: /* @__PURE__ */ jsx82(
|
|
14758
14800
|
RepeatableSchemaStep_default,
|
|
14759
14801
|
{
|
|
14760
14802
|
type: openModalType != null ? openModalType : "add",
|
|
@@ -14769,7 +14811,7 @@ function RepeatableSchema({
|
|
|
14769
14811
|
onClose: onCancelEdit
|
|
14770
14812
|
}
|
|
14771
14813
|
),
|
|
14772
|
-
/* @__PURE__ */
|
|
14814
|
+
/* @__PURE__ */ jsx82(
|
|
14773
14815
|
ControlFeedback_default,
|
|
14774
14816
|
{
|
|
14775
14817
|
id: `${id}-feedback`,
|
|
@@ -14811,17 +14853,17 @@ var getUpdatedItemSummaries = (action, {
|
|
|
14811
14853
|
var RepeatableSchema_default = RepeatableSchema;
|
|
14812
14854
|
|
|
14813
14855
|
// src/legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/ArrayListSchema.tsx
|
|
14814
|
-
import { jsx as
|
|
14856
|
+
import { jsx as jsx83 } from "react/jsx-runtime";
|
|
14815
14857
|
function ArrayListSchema(props) {
|
|
14816
14858
|
const { schema } = props;
|
|
14817
14859
|
if (isMultipleFileUploadSchema(schema)) {
|
|
14818
|
-
return /* @__PURE__ */
|
|
14860
|
+
return /* @__PURE__ */ jsx83(MultipleFileUploadSchema_default, __spreadProps(__spreadValues({}, props), { schema }));
|
|
14819
14861
|
}
|
|
14820
14862
|
if (isMultiSelectConstSchema(schema)) {
|
|
14821
|
-
return /* @__PURE__ */
|
|
14863
|
+
return /* @__PURE__ */ jsx83(MultiSelectSchema, __spreadProps(__spreadValues({}, props), { schema }));
|
|
14822
14864
|
}
|
|
14823
14865
|
if (isListArraySchema(schema)) {
|
|
14824
|
-
return /* @__PURE__ */
|
|
14866
|
+
return /* @__PURE__ */ jsx83(RepeatableSchema_default, __spreadProps(__spreadValues({}, props), { schema }));
|
|
14825
14867
|
}
|
|
14826
14868
|
throw new Error("Invalid array list schema");
|
|
14827
14869
|
}
|
|
@@ -14832,11 +14874,11 @@ ArrayListSchema.defaultProps = {
|
|
|
14832
14874
|
var ArrayListSchema_default = ArrayListSchema;
|
|
14833
14875
|
|
|
14834
14876
|
// src/legacy/jsonSchemaForm/arrayTypeSchema/ArraySchema.tsx
|
|
14835
|
-
import { jsx as
|
|
14877
|
+
import { jsx as jsx84 } from "react/jsx-runtime";
|
|
14836
14878
|
var ArraySchema = (props) => {
|
|
14837
14879
|
const { schema } = props;
|
|
14838
14880
|
if (isListArraySchema(schema)) {
|
|
14839
|
-
return /* @__PURE__ */
|
|
14881
|
+
return /* @__PURE__ */ jsx84(ArrayListSchema_default, __spreadValues({}, props));
|
|
14840
14882
|
}
|
|
14841
14883
|
throw new Error("Not implemented");
|
|
14842
14884
|
};
|
|
@@ -14848,8 +14890,8 @@ var ArraySchema_default = ArraySchema;
|
|
|
14848
14890
|
// src/legacy/jsonSchemaForm/objectSchema/ObjectSchema.tsx
|
|
14849
14891
|
var import_classnames11 = __toESM(require_classnames());
|
|
14850
14892
|
import { Header as Header8 } from "@transferwise/components";
|
|
14851
|
-
import { useState as useState17, useEffect as
|
|
14852
|
-
import { Fragment as
|
|
14893
|
+
import { useState as useState17, useEffect as useEffect10 } from "react";
|
|
14894
|
+
import { Fragment as Fragment13, jsx as jsx85, jsxs as jsxs31 } from "react/jsx-runtime";
|
|
14853
14895
|
var getSchemaColumnClasses2 = (width) => ({
|
|
14854
14896
|
"col-xs-12": true,
|
|
14855
14897
|
"col-sm-6": width === "md",
|
|
@@ -14867,7 +14909,7 @@ function ObjectSchema(props) {
|
|
|
14867
14909
|
props.onChange(__spreadProps(__spreadValues({}, onChangeProps), { model }));
|
|
14868
14910
|
};
|
|
14869
14911
|
const isRequired = (propertyName) => props.schema.required && props.schema.required.includes(propertyName);
|
|
14870
|
-
|
|
14912
|
+
useEffect10(() => {
|
|
14871
14913
|
const newModel = getValidObjectModelParts(model, props.schema) || {};
|
|
14872
14914
|
setModel(newModel);
|
|
14873
14915
|
if (!isEqual(newModel, model)) {
|
|
@@ -14885,22 +14927,22 @@ function ObjectSchema(props) {
|
|
|
14885
14927
|
const isPropertyDefined = (propertyName) => typeof props.schema.properties[propertyName] !== "undefined";
|
|
14886
14928
|
const orderedPropertyNames = Array.from(allorderedPropertiesSet).filter(isPropertyDefined);
|
|
14887
14929
|
const propsErrors = props.errors;
|
|
14888
|
-
return /* @__PURE__ */
|
|
14889
|
-
props.schema.alert && /* @__PURE__ */
|
|
14890
|
-
/* @__PURE__ */
|
|
14891
|
-
props.schema.title && !props.hideTitle && /* @__PURE__ */
|
|
14892
|
-
props.schema.description && !props.hideTitle && /* @__PURE__ */
|
|
14930
|
+
return /* @__PURE__ */ jsxs31(Fragment13, { children: [
|
|
14931
|
+
props.schema.alert && /* @__PURE__ */ jsx85(DynamicAlert_default, { component: props.schema.alert }),
|
|
14932
|
+
/* @__PURE__ */ jsxs31("fieldset", { children: [
|
|
14933
|
+
props.schema.title && !props.hideTitle && /* @__PURE__ */ jsx85(Header8, { title: props.schema.title, as: "legend" }),
|
|
14934
|
+
props.schema.description && !props.hideTitle && /* @__PURE__ */ jsxs31("p", { children: [
|
|
14893
14935
|
" ",
|
|
14894
14936
|
props.schema.description,
|
|
14895
14937
|
" "
|
|
14896
14938
|
] }),
|
|
14897
|
-
/* @__PURE__ */
|
|
14939
|
+
/* @__PURE__ */ jsx85("div", { className: "row", children: orderedPropertyNames.map((propertyName) => /* @__PURE__ */ jsx85(
|
|
14898
14940
|
"div",
|
|
14899
14941
|
{
|
|
14900
14942
|
className: (0, import_classnames11.default)(
|
|
14901
14943
|
getSchemaColumnClasses2(props.schema.properties[propertyName].width)
|
|
14902
14944
|
),
|
|
14903
|
-
children: /* @__PURE__ */
|
|
14945
|
+
children: /* @__PURE__ */ jsx85(
|
|
14904
14946
|
GenericSchema_default,
|
|
14905
14947
|
{
|
|
14906
14948
|
schema: props.schema.properties[propertyName],
|
|
@@ -14928,19 +14970,19 @@ var ObjectSchema_default = ObjectSchema;
|
|
|
14928
14970
|
// src/legacy/jsonSchemaForm/oneOfSchema/OneOfSchema.tsx
|
|
14929
14971
|
var import_classnames12 = __toESM(require_classnames());
|
|
14930
14972
|
import { Header as Header9 } from "@transferwise/components";
|
|
14931
|
-
import { useEffect as
|
|
14973
|
+
import { useEffect as useEffect12, useMemo as useMemo14, useState as useState18 } from "react";
|
|
14932
14974
|
|
|
14933
14975
|
// src/legacy/jsonSchemaForm/help/Help.tsx
|
|
14934
14976
|
import { Markdown as Markdown6, Info as Info2 } from "@transferwise/components";
|
|
14935
14977
|
import { useIntl as useIntl14 } from "react-intl";
|
|
14936
|
-
import { jsx as
|
|
14978
|
+
import { jsx as jsx86 } from "react/jsx-runtime";
|
|
14937
14979
|
function Help2(props) {
|
|
14938
14980
|
const intl = useIntl14();
|
|
14939
|
-
return /* @__PURE__ */
|
|
14981
|
+
return /* @__PURE__ */ jsx86(
|
|
14940
14982
|
Info2,
|
|
14941
14983
|
{
|
|
14942
14984
|
className: "m-l-1",
|
|
14943
|
-
content: /* @__PURE__ */
|
|
14985
|
+
content: /* @__PURE__ */ jsx86(Markdown6, { config: { link: { target: "_blank" } }, children: props.help.markdown }),
|
|
14944
14986
|
presentation: "POPOVER",
|
|
14945
14987
|
size: "sm",
|
|
14946
14988
|
"aria-label": intl.formatMessage(help_messages_default.helpAria)
|
|
@@ -14950,7 +14992,7 @@ function Help2(props) {
|
|
|
14950
14992
|
var Help_default2 = Help2;
|
|
14951
14993
|
|
|
14952
14994
|
// src/legacy/jsonSchemaForm/schemaFormControl/SchemaFormControl.tsx
|
|
14953
|
-
import { useEffect as
|
|
14995
|
+
import { useEffect as useEffect11 } from "react";
|
|
14954
14996
|
|
|
14955
14997
|
// src/legacy/formControl/FormControl.tsx
|
|
14956
14998
|
import {
|
|
@@ -15152,7 +15194,7 @@ var autocompleteTokenMap2 = {
|
|
|
15152
15194
|
};
|
|
15153
15195
|
|
|
15154
15196
|
// src/legacy/formControl/FormControl.tsx
|
|
15155
|
-
import { Fragment as
|
|
15197
|
+
import { Fragment as Fragment14, jsx as jsx87 } from "react/jsx-runtime";
|
|
15156
15198
|
var _FormControl = class _FormControl extends PureComponent {
|
|
15157
15199
|
constructor(props) {
|
|
15158
15200
|
super(props);
|
|
@@ -15240,7 +15282,7 @@ var _FormControl = class _FormControl extends PureComponent {
|
|
|
15240
15282
|
} = this.props;
|
|
15241
15283
|
switch (type) {
|
|
15242
15284
|
case FormControlType.RADIO:
|
|
15243
|
-
return /* @__PURE__ */
|
|
15285
|
+
return /* @__PURE__ */ jsx87(
|
|
15244
15286
|
RadioGroup2,
|
|
15245
15287
|
{
|
|
15246
15288
|
radios: options.map(this.mapOption),
|
|
@@ -15250,7 +15292,7 @@ var _FormControl = class _FormControl extends PureComponent {
|
|
|
15250
15292
|
}
|
|
15251
15293
|
);
|
|
15252
15294
|
case FormControlType.CHECKBOX:
|
|
15253
|
-
return /* @__PURE__ */
|
|
15295
|
+
return /* @__PURE__ */ jsx87(
|
|
15254
15296
|
Checkbox2,
|
|
15255
15297
|
{
|
|
15256
15298
|
checked: getSafeBooleanValue(value, { coerceValue: true }),
|
|
@@ -15268,7 +15310,7 @@ var _FormControl = class _FormControl extends PureComponent {
|
|
|
15268
15310
|
const search = options.length >= 8;
|
|
15269
15311
|
const items = options;
|
|
15270
15312
|
const selected = this.getSelectedOption(options);
|
|
15271
|
-
return /* @__PURE__ */
|
|
15313
|
+
return /* @__PURE__ */ jsx87("div", { className: "d-flex flex-column", children: /* @__PURE__ */ jsx87(
|
|
15272
15314
|
SelectInput3,
|
|
15273
15315
|
{
|
|
15274
15316
|
id,
|
|
@@ -15278,7 +15320,7 @@ var _FormControl = class _FormControl extends PureComponent {
|
|
|
15278
15320
|
disabled: value2.disabled
|
|
15279
15321
|
})),
|
|
15280
15322
|
value: selected != null ? selected : null,
|
|
15281
|
-
renderValue: ({ hideIconInTrigger, icon, label: label2, note, secondary }, withinTrigger) => /* @__PURE__ */
|
|
15323
|
+
renderValue: ({ hideIconInTrigger, icon, label: label2, note, secondary }, withinTrigger) => /* @__PURE__ */ jsx87(
|
|
15282
15324
|
SelectInputOptionContent3,
|
|
15283
15325
|
{
|
|
15284
15326
|
title: label2,
|
|
@@ -15307,13 +15349,13 @@ var _FormControl = class _FormControl extends PureComponent {
|
|
|
15307
15349
|
) });
|
|
15308
15350
|
}
|
|
15309
15351
|
case FormControlType.TAB:
|
|
15310
|
-
return /* @__PURE__ */
|
|
15352
|
+
return /* @__PURE__ */ jsx87(
|
|
15311
15353
|
Tabs2,
|
|
15312
15354
|
{
|
|
15313
15355
|
selected: ((_a = this.getSelectedOption(options)) == null ? void 0 : _a.value) || 0,
|
|
15314
15356
|
tabs: options.map((option) => ({
|
|
15315
15357
|
title: option.label,
|
|
15316
|
-
content: /* @__PURE__ */
|
|
15358
|
+
content: /* @__PURE__ */ jsx87(Fragment14, {}),
|
|
15317
15359
|
disabled: option.disabled || false
|
|
15318
15360
|
})),
|
|
15319
15361
|
name: id,
|
|
@@ -15328,7 +15370,7 @@ var _FormControl = class _FormControl extends PureComponent {
|
|
|
15328
15370
|
);
|
|
15329
15371
|
case FormControlType.NUMERIC:
|
|
15330
15372
|
case FormControlType.NUMBER: {
|
|
15331
|
-
return /* @__PURE__ */
|
|
15373
|
+
return /* @__PURE__ */ jsx87(
|
|
15332
15374
|
"input",
|
|
15333
15375
|
{
|
|
15334
15376
|
autoComplete: this.getAutocompleteValue(),
|
|
@@ -15362,7 +15404,7 @@ var _FormControl = class _FormControl extends PureComponent {
|
|
|
15362
15404
|
);
|
|
15363
15405
|
}
|
|
15364
15406
|
case FormControlType.HIDDEN:
|
|
15365
|
-
return /* @__PURE__ */
|
|
15407
|
+
return /* @__PURE__ */ jsx87(
|
|
15366
15408
|
"input",
|
|
15367
15409
|
{
|
|
15368
15410
|
type: "hidden",
|
|
@@ -15372,7 +15414,7 @@ var _FormControl = class _FormControl extends PureComponent {
|
|
|
15372
15414
|
}
|
|
15373
15415
|
);
|
|
15374
15416
|
case FormControlType.PASSWORD:
|
|
15375
|
-
return /* @__PURE__ */
|
|
15417
|
+
return /* @__PURE__ */ jsx87(
|
|
15376
15418
|
"input",
|
|
15377
15419
|
{
|
|
15378
15420
|
autoComplete: this.getAutocompleteValue(),
|
|
@@ -15392,7 +15434,7 @@ var _FormControl = class _FormControl extends PureComponent {
|
|
|
15392
15434
|
);
|
|
15393
15435
|
case FormControlType.DATE:
|
|
15394
15436
|
case FormControlType.DATETIME:
|
|
15395
|
-
return /* @__PURE__ */
|
|
15437
|
+
return /* @__PURE__ */ jsx87(
|
|
15396
15438
|
DateInput2,
|
|
15397
15439
|
{
|
|
15398
15440
|
dayAutoComplete: this.getAutocompleteValue({ suffix: "-day" }),
|
|
@@ -15408,7 +15450,7 @@ var _FormControl = class _FormControl extends PureComponent {
|
|
|
15408
15450
|
}
|
|
15409
15451
|
);
|
|
15410
15452
|
case FormControlType.DATELOOKUP: {
|
|
15411
|
-
return /* @__PURE__ */
|
|
15453
|
+
return /* @__PURE__ */ jsx87(
|
|
15412
15454
|
DateLookup2,
|
|
15413
15455
|
{
|
|
15414
15456
|
value: getSafeDateStringValue(value),
|
|
@@ -15426,7 +15468,7 @@ var _FormControl = class _FormControl extends PureComponent {
|
|
|
15426
15468
|
);
|
|
15427
15469
|
}
|
|
15428
15470
|
case FormControlType.TEL:
|
|
15429
|
-
return /* @__PURE__ */
|
|
15471
|
+
return /* @__PURE__ */ jsx87(
|
|
15430
15472
|
PhoneNumberInput2,
|
|
15431
15473
|
{
|
|
15432
15474
|
disabled,
|
|
@@ -15458,7 +15500,7 @@ var _FormControl = class _FormControl extends PureComponent {
|
|
|
15458
15500
|
autoComplete: this.getAutocompleteValue()
|
|
15459
15501
|
};
|
|
15460
15502
|
if (this.props.displayPattern) {
|
|
15461
|
-
return /* @__PURE__ */
|
|
15503
|
+
return /* @__PURE__ */ jsx87(
|
|
15462
15504
|
TextareaWithDisplayFormat2,
|
|
15463
15505
|
__spreadProps(__spreadValues({
|
|
15464
15506
|
displayPattern: this.props.displayPattern
|
|
@@ -15467,7 +15509,7 @@ var _FormControl = class _FormControl extends PureComponent {
|
|
|
15467
15509
|
})
|
|
15468
15510
|
);
|
|
15469
15511
|
}
|
|
15470
|
-
return /* @__PURE__ */
|
|
15512
|
+
return /* @__PURE__ */ jsx87(
|
|
15471
15513
|
"textarea",
|
|
15472
15514
|
__spreadProps(__spreadValues({}, textareaProps), {
|
|
15473
15515
|
"aria-describedby": describedBy,
|
|
@@ -15480,7 +15522,7 @@ var _FormControl = class _FormControl extends PureComponent {
|
|
|
15480
15522
|
return (
|
|
15481
15523
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
15482
15524
|
// @ts-expect-error - TODO: Remove this once Upload is migrated to TypeScript
|
|
15483
|
-
/* @__PURE__ */
|
|
15525
|
+
/* @__PURE__ */ jsx87(
|
|
15484
15526
|
Upload2,
|
|
15485
15527
|
__spreadProps(__spreadValues({}, uploadProps), {
|
|
15486
15528
|
usAccept: uploadProps.usAccept || "*",
|
|
@@ -15518,7 +15560,7 @@ var _FormControl = class _FormControl extends PureComponent {
|
|
|
15518
15560
|
autoComplete: this.getAutocompleteValue()
|
|
15519
15561
|
};
|
|
15520
15562
|
if (this.props.displayPattern) {
|
|
15521
|
-
return /* @__PURE__ */
|
|
15563
|
+
return /* @__PURE__ */ jsx87(
|
|
15522
15564
|
InputWithDisplayFormat2,
|
|
15523
15565
|
__spreadProps(__spreadValues({
|
|
15524
15566
|
displayPattern: this.props.displayPattern
|
|
@@ -15527,7 +15569,7 @@ var _FormControl = class _FormControl extends PureComponent {
|
|
|
15527
15569
|
})
|
|
15528
15570
|
);
|
|
15529
15571
|
}
|
|
15530
|
-
return /* @__PURE__ */
|
|
15572
|
+
return /* @__PURE__ */ jsx87(
|
|
15531
15573
|
"input",
|
|
15532
15574
|
__spreadProps(__spreadValues({}, inputProps), {
|
|
15533
15575
|
"aria-describedby": describedBy,
|
|
@@ -15576,14 +15618,17 @@ _FormControl.defaultProps = {
|
|
|
15576
15618
|
var FormControl = _FormControl;
|
|
15577
15619
|
|
|
15578
15620
|
// src/legacy/jsonSchemaForm/schemaFormControl/SchemaFormControl.tsx
|
|
15579
|
-
import { jsx as
|
|
15621
|
+
import { jsx as jsx88 } from "react/jsx-runtime";
|
|
15580
15622
|
var isNativeInput = (propsSchemaType) => propsSchemaType === "string" || propsSchemaType === "number";
|
|
15581
15623
|
var getControlType = (schema) => {
|
|
15582
15624
|
if (isOneOfSchema2(schema)) {
|
|
15583
15625
|
if (schema.control === FormControlType.TAB && schema.oneOf.length > 3) {
|
|
15584
15626
|
return FormControlType.SELECT;
|
|
15585
15627
|
}
|
|
15586
|
-
|
|
15628
|
+
if (schema.control == null || !Object.values(FormControlType).includes(schema.control)) {
|
|
15629
|
+
return FormControlType.SELECT;
|
|
15630
|
+
}
|
|
15631
|
+
return schema.control;
|
|
15587
15632
|
}
|
|
15588
15633
|
if (isStringSchema2(schema)) {
|
|
15589
15634
|
return getStringSchemaControlType(schema);
|
|
@@ -15641,7 +15686,7 @@ function SchemaFormControl(props) {
|
|
|
15641
15686
|
onChange(getValidBasicModelOrNull(value2, schema), type, metadata);
|
|
15642
15687
|
};
|
|
15643
15688
|
const controlType = getControlType(schema);
|
|
15644
|
-
|
|
15689
|
+
useEffect11(() => {
|
|
15645
15690
|
warnIfInvalidSchema(schema, log, controlType);
|
|
15646
15691
|
}, [JSON.stringify(schema), log, controlType]);
|
|
15647
15692
|
const options = schema.values || getOptions(schema, controlType);
|
|
@@ -15667,7 +15712,7 @@ function SchemaFormControl(props) {
|
|
|
15667
15712
|
uploadProps: mapSchemaToUploadOptions(schema),
|
|
15668
15713
|
describedBy
|
|
15669
15714
|
};
|
|
15670
|
-
return /* @__PURE__ */
|
|
15715
|
+
return /* @__PURE__ */ jsx88("div", { "aria-describedby": describedBy, children: /* @__PURE__ */ jsx88(FormControl, __spreadValues(__spreadValues({ type: controlType, value: safeValue }, events), controlProps)) });
|
|
15671
15716
|
}
|
|
15672
15717
|
SchemaFormControl.defaultProps = {
|
|
15673
15718
|
value: null,
|
|
@@ -15696,7 +15741,7 @@ var warnIfInvalidSchema = (schema, log, controlType) => {
|
|
|
15696
15741
|
var SchemaFormControl_default = SchemaFormControl;
|
|
15697
15742
|
|
|
15698
15743
|
// src/legacy/jsonSchemaForm/oneOfSchema/OneOfSchema.tsx
|
|
15699
|
-
import { Fragment as
|
|
15744
|
+
import { Fragment as Fragment15, jsx as jsx89, jsxs as jsxs32 } from "react/jsx-runtime";
|
|
15700
15745
|
function OneOfSchema(props) {
|
|
15701
15746
|
const onEvent = useEventDispatcher();
|
|
15702
15747
|
const [changed, setChanged] = useState18(false);
|
|
@@ -15714,7 +15759,7 @@ function OneOfSchema(props) {
|
|
|
15714
15759
|
searchValueLength: searchValue.length
|
|
15715
15760
|
});
|
|
15716
15761
|
};
|
|
15717
|
-
|
|
15762
|
+
useEffect12(() => {
|
|
15718
15763
|
const modelIndex = getValidIndexFromValue(props.schema, props.model);
|
|
15719
15764
|
const defaultIndex = getValidIndexFromValue(props.schema, props.schema.default);
|
|
15720
15765
|
if (modelIndex === -1 && defaultIndex >= 0) {
|
|
@@ -15772,12 +15817,12 @@ function OneOfSchema(props) {
|
|
|
15772
15817
|
"has-error": !changed && props.errors && !isEmpty(props.errors) || (props.submitted || changed && blurred) && validations.length
|
|
15773
15818
|
};
|
|
15774
15819
|
const feedbackId = `${id}-feedback`;
|
|
15775
|
-
return /* @__PURE__ */
|
|
15776
|
-
(props.schema.oneOf.length > 1 || isConstSchema2(props.schema.oneOf[0])) && /* @__PURE__ */
|
|
15777
|
-
props.schema.alert && /* @__PURE__ */
|
|
15778
|
-
/* @__PURE__ */
|
|
15820
|
+
return /* @__PURE__ */ jsxs32(Fragment15, { children: [
|
|
15821
|
+
(props.schema.oneOf.length > 1 || isConstSchema2(props.schema.oneOf[0])) && /* @__PURE__ */ jsxs32(Fragment15, { children: [
|
|
15822
|
+
props.schema.alert && /* @__PURE__ */ jsx89(DynamicAlert_default, { component: props.schema.alert }),
|
|
15823
|
+
/* @__PURE__ */ jsxs32("div", { className: (0, import_classnames12.default)(formGroupClasses), children: [
|
|
15779
15824
|
getTitleAndHelp(props.schema, id),
|
|
15780
|
-
/* @__PURE__ */
|
|
15825
|
+
/* @__PURE__ */ jsx89(
|
|
15781
15826
|
SchemaFormControl_default,
|
|
15782
15827
|
{
|
|
15783
15828
|
id,
|
|
@@ -15791,7 +15836,7 @@ function OneOfSchema(props) {
|
|
|
15791
15836
|
onSearchChange
|
|
15792
15837
|
}
|
|
15793
15838
|
),
|
|
15794
|
-
/* @__PURE__ */
|
|
15839
|
+
/* @__PURE__ */ jsx89(
|
|
15795
15840
|
ControlFeedback_default,
|
|
15796
15841
|
{
|
|
15797
15842
|
id: feedbackId,
|
|
@@ -15807,7 +15852,7 @@ function OneOfSchema(props) {
|
|
|
15807
15852
|
)
|
|
15808
15853
|
] })
|
|
15809
15854
|
] }),
|
|
15810
|
-
isNoNConstSchema(props.schema.oneOf[schemaIndex]) && /* @__PURE__ */
|
|
15855
|
+
isNoNConstSchema(props.schema.oneOf[schemaIndex]) && /* @__PURE__ */ jsx89(
|
|
15811
15856
|
GenericSchema_default,
|
|
15812
15857
|
{
|
|
15813
15858
|
schema: props.schema.oneOf[schemaIndex],
|
|
@@ -15824,16 +15869,16 @@ function OneOfSchema(props) {
|
|
|
15824
15869
|
}
|
|
15825
15870
|
function getTitleAndHelp(schema, forId) {
|
|
15826
15871
|
var _a;
|
|
15827
|
-
const helpElement = schema.help ? /* @__PURE__ */
|
|
15828
|
-
const titleElement = isConstSchema2(schema.oneOf[0]) ? /* @__PURE__ */
|
|
15872
|
+
const helpElement = schema.help ? /* @__PURE__ */ jsx89(Help_default2, { help: schema.help }) : null;
|
|
15873
|
+
const titleElement = isConstSchema2(schema.oneOf[0]) ? /* @__PURE__ */ jsx89("div", { className: "m-b-1", children: /* @__PURE__ */ jsxs32("label", { className: "control-label d-inline", htmlFor: forId, children: [
|
|
15829
15874
|
schema.title,
|
|
15830
15875
|
" ",
|
|
15831
15876
|
helpElement
|
|
15832
|
-
] }) }) : /* @__PURE__ */
|
|
15877
|
+
] }) }) : /* @__PURE__ */ jsx89(Fragment15, { children: helpElement ? /* @__PURE__ */ jsxs32("h4", { className: "m-b-2", children: [
|
|
15833
15878
|
schema.title,
|
|
15834
15879
|
" ",
|
|
15835
15880
|
helpElement
|
|
15836
|
-
] }) : /* @__PURE__ */
|
|
15881
|
+
] }) : /* @__PURE__ */ jsx89(Header9, { title: (_a = schema.title) != null ? _a : "" }) });
|
|
15837
15882
|
return schema.title ? titleElement : helpElement;
|
|
15838
15883
|
}
|
|
15839
15884
|
function getValidations(props, schemaIndex) {
|
|
@@ -15870,12 +15915,12 @@ var OneOfSchema_default = OneOfSchema;
|
|
|
15870
15915
|
|
|
15871
15916
|
// src/legacy/jsonSchemaForm/persistAsyncSchema/persistAsyncBlobSchema/PersistAsyncBlobSchema.tsx
|
|
15872
15917
|
var import_classnames13 = __toESM(require_classnames());
|
|
15873
|
-
import { useEffect as
|
|
15918
|
+
import { useEffect as useEffect13, useState as useState19 } from "react";
|
|
15874
15919
|
|
|
15875
15920
|
// src/legacy/jsonSchemaForm/persistAsyncSchema/persistAsyncBlobSchema/UploadInputAdapter.tsx
|
|
15876
15921
|
import { Status as Status2, UploadInput as UploadInput4 } from "@transferwise/components";
|
|
15877
15922
|
import { useMemo as useMemo15 } from "react";
|
|
15878
|
-
import { jsx as
|
|
15923
|
+
import { jsx as jsx90 } from "react/jsx-runtime";
|
|
15879
15924
|
function UploadInputAdapter(props) {
|
|
15880
15925
|
const {
|
|
15881
15926
|
id,
|
|
@@ -15908,7 +15953,7 @@ function UploadInputAdapter(props) {
|
|
|
15908
15953
|
return Promise.reject();
|
|
15909
15954
|
});
|
|
15910
15955
|
};
|
|
15911
|
-
return /* @__PURE__ */
|
|
15956
|
+
return /* @__PURE__ */ jsx90(
|
|
15912
15957
|
UploadInput4,
|
|
15913
15958
|
{
|
|
15914
15959
|
id,
|
|
@@ -15928,7 +15973,7 @@ function UploadInputAdapter(props) {
|
|
|
15928
15973
|
}
|
|
15929
15974
|
|
|
15930
15975
|
// src/legacy/jsonSchemaForm/persistAsyncSchema/persistAsyncBlobSchema/PersistAsyncBlobSchema.tsx
|
|
15931
|
-
import { jsx as
|
|
15976
|
+
import { jsx as jsx91, jsxs as jsxs33 } from "react/jsx-runtime";
|
|
15932
15977
|
function PersistAsyncBlobSchema(props) {
|
|
15933
15978
|
const { model, schema, submitted, required, errors, onChange } = props;
|
|
15934
15979
|
const [persistAsyncValidationMessages, setPersistAsyncValidationMessages] = useState19({});
|
|
@@ -15937,7 +15982,7 @@ function PersistAsyncBlobSchema(props) {
|
|
|
15937
15982
|
const [changed, setChanged] = useState19(false);
|
|
15938
15983
|
const httpClient = useHttpClient();
|
|
15939
15984
|
const onEvent = useEventDispatcher();
|
|
15940
|
-
|
|
15985
|
+
useEffect13(() => {
|
|
15941
15986
|
if (submitted) {
|
|
15942
15987
|
setValidations(getValidationFailures(model, schema, Boolean(required)));
|
|
15943
15988
|
} else {
|
|
@@ -15974,8 +16019,8 @@ function PersistAsyncBlobSchema(props) {
|
|
|
15974
16019
|
};
|
|
15975
16020
|
const id = schema.$id || schema.persistAsync.schema.$id || schema.persistAsync.idProperty;
|
|
15976
16021
|
const feedbackId = `${id}-feedback`;
|
|
15977
|
-
return /* @__PURE__ */
|
|
15978
|
-
/* @__PURE__ */
|
|
16022
|
+
return /* @__PURE__ */ jsxs33("div", { className: (0, import_classnames13.default)(formGroupClasses), children: [
|
|
16023
|
+
/* @__PURE__ */ jsx91("div", { "aria-describedby": feedbackId, children: /* @__PURE__ */ jsx91(
|
|
15979
16024
|
UploadInputAdapter,
|
|
15980
16025
|
__spreadValues({
|
|
15981
16026
|
id,
|
|
@@ -15992,7 +16037,7 @@ function PersistAsyncBlobSchema(props) {
|
|
|
15992
16037
|
onCancel
|
|
15993
16038
|
}, mapSchemaToUploadOptions(schema.persistAsync.schema))
|
|
15994
16039
|
) }),
|
|
15995
|
-
/* @__PURE__ */
|
|
16040
|
+
/* @__PURE__ */ jsx91(
|
|
15996
16041
|
ControlFeedback_default,
|
|
15997
16042
|
{
|
|
15998
16043
|
id: feedbackId,
|
|
@@ -16017,17 +16062,17 @@ PersistAsyncBlobSchema.defaultProps = {
|
|
|
16017
16062
|
var PersistAsyncBlobSchema_default = PersistAsyncBlobSchema;
|
|
16018
16063
|
|
|
16019
16064
|
// src/legacy/jsonSchemaForm/persistAsyncSchema/PersistAsyncSchema.tsx
|
|
16020
|
-
import { jsx as
|
|
16065
|
+
import { jsx as jsx92 } from "react/jsx-runtime";
|
|
16021
16066
|
function PersistAsyncSchema(props) {
|
|
16022
16067
|
const { schema } = props;
|
|
16023
16068
|
const persistAsyncSchemaType = schema.persistAsync.schema.type;
|
|
16024
16069
|
if (persistAsyncSchemaType === "blob") {
|
|
16025
|
-
return /* @__PURE__ */
|
|
16070
|
+
return /* @__PURE__ */ jsx92(
|
|
16026
16071
|
PersistAsyncBlobSchema_default,
|
|
16027
16072
|
__spreadValues({}, props)
|
|
16028
16073
|
);
|
|
16029
16074
|
}
|
|
16030
|
-
return /* @__PURE__ */
|
|
16075
|
+
return /* @__PURE__ */ jsx92(PersistAsyncBasicSchema_default, __spreadValues({}, props));
|
|
16031
16076
|
}
|
|
16032
16077
|
PersistAsyncSchema.defaultProps = {
|
|
16033
16078
|
required: false
|
|
@@ -16048,7 +16093,7 @@ var getSelectionFromModel = (schema, model) => {
|
|
|
16048
16093
|
|
|
16049
16094
|
// src/legacy/jsonSchemaForm/promotedOneOfSchema/promotedOneOfControl/PromotedOneOfCheckboxControl.tsx
|
|
16050
16095
|
import { Checkbox as Checkbox3 } from "@transferwise/components";
|
|
16051
|
-
import { jsx as
|
|
16096
|
+
import { jsx as jsx93 } from "react/jsx-runtime";
|
|
16052
16097
|
var PromotedOneOfCheckboxControl = (props) => {
|
|
16053
16098
|
const { id, selection, setSelection } = props;
|
|
16054
16099
|
const { promoted, other, checkedMeans } = props.promotion;
|
|
@@ -16059,14 +16104,14 @@ var PromotedOneOfCheckboxControl = (props) => {
|
|
|
16059
16104
|
const toggleSelection = () => {
|
|
16060
16105
|
setSelection(checked ? selectionWhenUnchecked : selectionWhenChecked);
|
|
16061
16106
|
};
|
|
16062
|
-
return /* @__PURE__ */
|
|
16107
|
+
return /* @__PURE__ */ jsx93("div", { className: "form-group", children: /* @__PURE__ */ jsx93(Checkbox3, { id, label: title, checked, onChange: toggleSelection }) });
|
|
16063
16108
|
};
|
|
16064
16109
|
PromotedOneOfCheckboxControl.defaultProps = {};
|
|
16065
16110
|
var PromotedOneOfCheckboxControl_default = PromotedOneOfCheckboxControl;
|
|
16066
16111
|
|
|
16067
16112
|
// src/legacy/jsonSchemaForm/promotedOneOfSchema/promotedOneOfControl/PromotedOneOfRadioControl.tsx
|
|
16068
16113
|
import { RadioGroup as RadioGroup3 } from "@transferwise/components";
|
|
16069
|
-
import { jsx as
|
|
16114
|
+
import { jsx as jsx94, jsxs as jsxs34 } from "react/jsx-runtime";
|
|
16070
16115
|
function PromotedOneOfRadioControl(props) {
|
|
16071
16116
|
var _a, _b;
|
|
16072
16117
|
const { id, selection, setSelection, promotion, promotedOneOf, title } = props;
|
|
@@ -16083,9 +16128,9 @@ function PromotedOneOfRadioControl(props) {
|
|
|
16083
16128
|
secondary: promotion.other.description
|
|
16084
16129
|
}, getAvatarPropertyForRadioOption(promotion.other))
|
|
16085
16130
|
];
|
|
16086
|
-
return /* @__PURE__ */
|
|
16087
|
-
title && /* @__PURE__ */
|
|
16088
|
-
/* @__PURE__ */
|
|
16131
|
+
return /* @__PURE__ */ jsxs34("div", { className: "form-group", children: [
|
|
16132
|
+
title && /* @__PURE__ */ jsx94("label", { className: "control-label", htmlFor: id, children: title }),
|
|
16133
|
+
/* @__PURE__ */ jsx94(
|
|
16089
16134
|
RadioGroup3,
|
|
16090
16135
|
{
|
|
16091
16136
|
name: "promoted-selection",
|
|
@@ -16103,16 +16148,16 @@ PromotedOneOfRadioControl.defaultProps = {
|
|
|
16103
16148
|
var PromotedOneOfRadioControl_default = PromotedOneOfRadioControl;
|
|
16104
16149
|
|
|
16105
16150
|
// src/legacy/jsonSchemaForm/promotedOneOfSchema/promotedOneOfControl/PromotedOneOfControl.tsx
|
|
16106
|
-
import { Fragment as
|
|
16151
|
+
import { Fragment as Fragment16, jsx as jsx95 } from "react/jsx-runtime";
|
|
16107
16152
|
function PromotedOneOfControl(props) {
|
|
16108
16153
|
const controlType = props.promotion.control || "radio";
|
|
16109
16154
|
switch (controlType) {
|
|
16110
16155
|
case "radio":
|
|
16111
|
-
return /* @__PURE__ */
|
|
16156
|
+
return /* @__PURE__ */ jsx95(PromotedOneOfRadioControl_default, __spreadValues({}, props));
|
|
16112
16157
|
case "checkbox":
|
|
16113
|
-
return /* @__PURE__ */
|
|
16158
|
+
return /* @__PURE__ */ jsx95(PromotedOneOfCheckboxControl_default, __spreadValues({}, props));
|
|
16114
16159
|
default:
|
|
16115
|
-
return /* @__PURE__ */
|
|
16160
|
+
return /* @__PURE__ */ jsx95(Fragment16, {});
|
|
16116
16161
|
}
|
|
16117
16162
|
}
|
|
16118
16163
|
PromotedOneOfControl.defaultProps = {
|
|
@@ -16122,7 +16167,7 @@ PromotedOneOfControl.defaultProps = {
|
|
|
16122
16167
|
var PromotedOneOfControl_default = PromotedOneOfControl;
|
|
16123
16168
|
|
|
16124
16169
|
// src/legacy/jsonSchemaForm/promotedOneOfSchema/PromotedOneOfSchema.tsx
|
|
16125
|
-
import { Fragment as
|
|
16170
|
+
import { Fragment as Fragment17, jsx as jsx96, jsxs as jsxs35 } from "react/jsx-runtime";
|
|
16126
16171
|
var isPromoted = (schema) => schema.promoted === true;
|
|
16127
16172
|
var PromotedOneOfSchema = (props) => {
|
|
16128
16173
|
var _a;
|
|
@@ -16133,9 +16178,9 @@ var PromotedOneOfSchema = (props) => {
|
|
|
16133
16178
|
const promotedOneOf = props.schema.oneOf.find(isPromoted);
|
|
16134
16179
|
const promotedObjectSchema = getPromotedObjectSchema(promotedOneOf);
|
|
16135
16180
|
const otherOneOf = getOtherOneOf(props.schema);
|
|
16136
|
-
return /* @__PURE__ */
|
|
16137
|
-
promotedAlert && /* @__PURE__ */
|
|
16138
|
-
/* @__PURE__ */
|
|
16181
|
+
return /* @__PURE__ */ jsxs35(Fragment17, { children: [
|
|
16182
|
+
promotedAlert && /* @__PURE__ */ jsx96(DynamicAlert_default, { component: promotedAlert }),
|
|
16183
|
+
/* @__PURE__ */ jsx96(
|
|
16139
16184
|
PromotedOneOfControl_default,
|
|
16140
16185
|
{
|
|
16141
16186
|
id: props.schema.$id,
|
|
@@ -16146,8 +16191,8 @@ var PromotedOneOfSchema = (props) => {
|
|
|
16146
16191
|
setSelection
|
|
16147
16192
|
}
|
|
16148
16193
|
),
|
|
16149
|
-
selection === "promoted" && /* @__PURE__ */
|
|
16150
|
-
selection === "other" && /* @__PURE__ */
|
|
16194
|
+
selection === "promoted" && /* @__PURE__ */ jsx96(ObjectSchema_default, __spreadProps(__spreadValues({}, props), { schema: promotedObjectSchema })),
|
|
16195
|
+
selection === "other" && /* @__PURE__ */ jsx96(GenericSchema_default, __spreadProps(__spreadValues({}, props), { schema: otherOneOf }))
|
|
16151
16196
|
] });
|
|
16152
16197
|
};
|
|
16153
16198
|
function getPromotedObjectSchema(promotedSchema) {
|
|
@@ -16196,12 +16241,12 @@ var ReadOnlySchema_messages_default = defineMessages12({
|
|
|
16196
16241
|
});
|
|
16197
16242
|
|
|
16198
16243
|
// src/legacy/jsonSchemaForm/readOnlySchema/ReadOnlySchema.tsx
|
|
16199
|
-
import { Fragment as
|
|
16244
|
+
import { Fragment as Fragment18, jsx as jsx97, jsxs as jsxs36 } from "react/jsx-runtime";
|
|
16200
16245
|
function ReadOnlySchema({ schema, model }) {
|
|
16201
16246
|
const { title = "" } = schema;
|
|
16202
16247
|
const { formatMessage } = useIntl15();
|
|
16203
16248
|
const value = getValueForSchema({ schema, model, formatMessage });
|
|
16204
|
-
return /* @__PURE__ */
|
|
16249
|
+
return /* @__PURE__ */ jsx97(DefinitionList2, { layout: Layout.VERTICAL_ONE_COLUMN, definitions: [{ title, value, key: "" }] });
|
|
16205
16250
|
}
|
|
16206
16251
|
var ReadOnlySchema_default = ReadOnlySchema;
|
|
16207
16252
|
function getValueForSchema({
|
|
@@ -16234,7 +16279,7 @@ function getSelectedOneOf(schema, model) {
|
|
|
16234
16279
|
function getValueFromOption(option) {
|
|
16235
16280
|
const text = option.title && option.description ? `${option.title} - ${option.description}` : option.title || "";
|
|
16236
16281
|
const icon = getAvatarPropertyForRadioOption({ icon: option.icon });
|
|
16237
|
-
return (icon == null ? void 0 : icon.avatar) ? /* @__PURE__ */
|
|
16282
|
+
return (icon == null ? void 0 : icon.avatar) ? /* @__PURE__ */ jsxs36(Fragment18, { children: [
|
|
16238
16283
|
icon.avatar,
|
|
16239
16284
|
" ",
|
|
16240
16285
|
text
|
|
@@ -16242,8 +16287,8 @@ function getValueFromOption(option) {
|
|
|
16242
16287
|
}
|
|
16243
16288
|
|
|
16244
16289
|
// src/legacy/jsonSchemaForm/validationAsyncSchema/ValidationAsyncSchema.tsx
|
|
16245
|
-
import { useEffect as
|
|
16246
|
-
import { jsx as
|
|
16290
|
+
import { useEffect as useEffect14, useRef as useRef3, useState as useState21 } from "react";
|
|
16291
|
+
import { jsx as jsx98 } from "react/jsx-runtime";
|
|
16247
16292
|
function ValidationAsyncSchema(props) {
|
|
16248
16293
|
const { schema, model, required, submitted, errors, onChange } = props;
|
|
16249
16294
|
const [validationAsyncModel, setValidationAsyncModel] = useState21(model);
|
|
@@ -16257,7 +16302,7 @@ function ValidationAsyncSchema(props) {
|
|
|
16257
16302
|
const httpClient = useHttpClient();
|
|
16258
16303
|
const onEvent = useEventDispatcher();
|
|
16259
16304
|
const log = useLogger();
|
|
16260
|
-
|
|
16305
|
+
useEffect14(() => {
|
|
16261
16306
|
if (!schema.validationAsync.method) {
|
|
16262
16307
|
log.warning(
|
|
16263
16308
|
"Invalid schema or model",
|
|
@@ -16327,20 +16372,20 @@ function ValidationAsyncSchema(props) {
|
|
|
16327
16372
|
required,
|
|
16328
16373
|
schema
|
|
16329
16374
|
};
|
|
16330
|
-
return /* @__PURE__ */
|
|
16375
|
+
return /* @__PURE__ */ jsx98(BasicTypeSchema_default, __spreadValues({}, basicTypeSchemaProps));
|
|
16331
16376
|
}
|
|
16332
16377
|
ValidationAsyncSchema.defaultProps = { required: false };
|
|
16333
16378
|
var ValidationAsyncSchema_default = ValidationAsyncSchema;
|
|
16334
16379
|
|
|
16335
16380
|
// src/legacy/jsonSchemaForm/genericSchema/GenericSchema.tsx
|
|
16336
|
-
import { Fragment as
|
|
16381
|
+
import { Fragment as Fragment19, jsx as jsx99 } from "react/jsx-runtime";
|
|
16337
16382
|
import { createElement } from "react";
|
|
16338
16383
|
function GenericSchemaForm(props) {
|
|
16339
16384
|
const { schema, model = null, errors = null, hideTitle = false, disabled = false } = props;
|
|
16340
16385
|
const schemaProps = __spreadProps(__spreadValues({}, props), { model, errors, hideTitle, disabled });
|
|
16341
16386
|
const type = getSchemaType(schema);
|
|
16342
16387
|
const log = useLogger();
|
|
16343
|
-
|
|
16388
|
+
useEffect15(() => {
|
|
16344
16389
|
if (!isValidGenericSchema(schema, model, errors)) {
|
|
16345
16390
|
log.error(
|
|
16346
16391
|
"Invalid schema or model",
|
|
@@ -16350,29 +16395,29 @@ function GenericSchemaForm(props) {
|
|
|
16350
16395
|
}, [JSON.stringify(schema), JSON.stringify(model), JSON.stringify(errors), type, log]);
|
|
16351
16396
|
switch (type) {
|
|
16352
16397
|
case "readOnly":
|
|
16353
|
-
return /* @__PURE__ */
|
|
16398
|
+
return /* @__PURE__ */ jsx99(ReadOnlySchema_default, __spreadValues({}, schemaProps));
|
|
16354
16399
|
case "persistAsync":
|
|
16355
|
-
return /* @__PURE__ */
|
|
16400
|
+
return /* @__PURE__ */ jsx99(PersistAsyncSchema_default, __spreadValues({}, schemaProps));
|
|
16356
16401
|
case "validationAsync":
|
|
16357
|
-
return /* @__PURE__ */
|
|
16402
|
+
return /* @__PURE__ */ jsx99(ValidationAsyncSchema_default, __spreadValues({}, schemaProps));
|
|
16358
16403
|
case "basic": {
|
|
16359
16404
|
const basicTypeProps = __spreadValues({
|
|
16360
16405
|
infoMessage: null
|
|
16361
16406
|
}, schemaProps);
|
|
16362
|
-
return /* @__PURE__ */
|
|
16407
|
+
return /* @__PURE__ */ jsx99(BasicTypeSchema_default, __spreadValues({}, basicTypeProps));
|
|
16363
16408
|
}
|
|
16364
16409
|
case "object":
|
|
16365
16410
|
return /* @__PURE__ */ createElement(ObjectSchema_default, __spreadProps(__spreadValues({}, schemaProps), { key: JSON.stringify(schema) }));
|
|
16366
16411
|
case "array":
|
|
16367
|
-
return /* @__PURE__ */
|
|
16412
|
+
return /* @__PURE__ */ jsx99(ArraySchema_default, __spreadValues({}, schemaProps));
|
|
16368
16413
|
case "promotedOneOf":
|
|
16369
|
-
return /* @__PURE__ */
|
|
16414
|
+
return /* @__PURE__ */ jsx99(PromotedOneOfSchema_default, __spreadValues({}, schemaProps));
|
|
16370
16415
|
case "oneOf":
|
|
16371
|
-
return /* @__PURE__ */
|
|
16416
|
+
return /* @__PURE__ */ jsx99(OneOfSchema_default, __spreadValues({}, schemaProps));
|
|
16372
16417
|
case "allOf":
|
|
16373
|
-
return /* @__PURE__ */
|
|
16418
|
+
return /* @__PURE__ */ jsx99(AllOfSchema_default, __spreadValues({}, schemaProps));
|
|
16374
16419
|
}
|
|
16375
|
-
return /* @__PURE__ */
|
|
16420
|
+
return /* @__PURE__ */ jsx99(Fragment19, {});
|
|
16376
16421
|
}
|
|
16377
16422
|
var GenericSchema_default = GenericSchemaForm;
|
|
16378
16423
|
var isValidGenericSchema = (schema, model, errors) => {
|
|
@@ -16399,7 +16444,7 @@ var isValidGenericSchema = (schema, model, errors) => {
|
|
|
16399
16444
|
};
|
|
16400
16445
|
|
|
16401
16446
|
// src/legacy/layout/form/DynamicForm.tsx
|
|
16402
|
-
import { jsx as
|
|
16447
|
+
import { jsx as jsx100 } from "react/jsx-runtime";
|
|
16403
16448
|
function DynamicForm({
|
|
16404
16449
|
component,
|
|
16405
16450
|
model = null,
|
|
@@ -16409,7 +16454,7 @@ function DynamicForm({
|
|
|
16409
16454
|
onPersistAsync
|
|
16410
16455
|
}) {
|
|
16411
16456
|
const formSchema = component.schema;
|
|
16412
|
-
return /* @__PURE__ */
|
|
16457
|
+
return /* @__PURE__ */ jsx100("div", { className: getMargin2(component.margin || "md"), children: /* @__PURE__ */ jsx100(
|
|
16413
16458
|
GenericSchema_default,
|
|
16414
16459
|
{
|
|
16415
16460
|
schema: formSchema,
|
|
@@ -16428,62 +16473,62 @@ var DynamicForm_default = DynamicForm;
|
|
|
16428
16473
|
// src/legacy/layout/heading/DynamicHeading.tsx
|
|
16429
16474
|
var import_classnames14 = __toESM(require_classnames());
|
|
16430
16475
|
import { Display as Display2 } from "@transferwise/components";
|
|
16431
|
-
import { jsx as
|
|
16476
|
+
import { jsx as jsx101 } from "react/jsx-runtime";
|
|
16432
16477
|
var DynamicHeading = (props) => {
|
|
16433
16478
|
const { text, size = "md", align = "left", margin = "md", control } = props.component;
|
|
16434
16479
|
const classes = (0, import_classnames14.default)(getTextAlignmentAndMargin2({ align, margin }));
|
|
16435
|
-
return control === "display" ? /* @__PURE__ */
|
|
16480
|
+
return control === "display" ? /* @__PURE__ */ jsx101(DisplayHeading2, { size, text, classes }) : /* @__PURE__ */ jsx101(StandardHeading2, { size, text, classes });
|
|
16436
16481
|
};
|
|
16437
16482
|
var StandardHeading2 = ({ size, text, classes }) => {
|
|
16438
16483
|
switch (size) {
|
|
16439
16484
|
case "xs":
|
|
16440
|
-
return /* @__PURE__ */
|
|
16485
|
+
return /* @__PURE__ */ jsx101("h5", { className: classes, children: text });
|
|
16441
16486
|
case "sm":
|
|
16442
|
-
return /* @__PURE__ */
|
|
16487
|
+
return /* @__PURE__ */ jsx101("h4", { className: classes, children: text });
|
|
16443
16488
|
case "lg":
|
|
16444
|
-
return /* @__PURE__ */
|
|
16489
|
+
return /* @__PURE__ */ jsx101("h2", { className: classes, children: text });
|
|
16445
16490
|
case "xl":
|
|
16446
|
-
return /* @__PURE__ */
|
|
16491
|
+
return /* @__PURE__ */ jsx101("h1", { className: classes, children: text });
|
|
16447
16492
|
case "md":
|
|
16448
16493
|
default:
|
|
16449
|
-
return /* @__PURE__ */
|
|
16494
|
+
return /* @__PURE__ */ jsx101("h3", { className: classes, children: text });
|
|
16450
16495
|
}
|
|
16451
16496
|
};
|
|
16452
16497
|
var DisplayHeading2 = ({ size, text, classes }) => {
|
|
16453
16498
|
switch (size) {
|
|
16454
16499
|
case "xs":
|
|
16455
16500
|
case "sm":
|
|
16456
|
-
return /* @__PURE__ */
|
|
16501
|
+
return /* @__PURE__ */ jsx101(Display2, { type: "display-small", className: classes, children: text });
|
|
16457
16502
|
case "xl":
|
|
16458
16503
|
case "lg":
|
|
16459
|
-
return /* @__PURE__ */
|
|
16504
|
+
return /* @__PURE__ */ jsx101(Display2, { type: "display-large", className: classes, children: text });
|
|
16460
16505
|
case "md":
|
|
16461
16506
|
default:
|
|
16462
|
-
return /* @__PURE__ */
|
|
16507
|
+
return /* @__PURE__ */ jsx101(Display2, { type: "display-medium", className: classes, children: text });
|
|
16463
16508
|
}
|
|
16464
16509
|
};
|
|
16465
16510
|
var DynamicHeading_default = DynamicHeading;
|
|
16466
16511
|
|
|
16467
16512
|
// src/legacy/layout/markdown/DynamicMarkdown.tsx
|
|
16468
16513
|
import { Markdown as Markdown7 } from "@transferwise/components";
|
|
16469
|
-
import { jsx as
|
|
16514
|
+
import { jsx as jsx102 } from "react/jsx-runtime";
|
|
16470
16515
|
var DynamicMarkdown = ({ component }) => {
|
|
16471
16516
|
const { content, align, margin } = component;
|
|
16472
|
-
return /* @__PURE__ */
|
|
16517
|
+
return /* @__PURE__ */ jsx102("div", { className: getTextAlignmentAndMargin2({ align, margin }), children: /* @__PURE__ */ jsx102(Markdown7, { config: { link: { target: "_blank" } }, children: content }) });
|
|
16473
16518
|
};
|
|
16474
16519
|
var DynamicInfo = ({ component }) => {
|
|
16475
|
-
return /* @__PURE__ */
|
|
16520
|
+
return /* @__PURE__ */ jsx102("div", { className: getTextAlignmentAndMargin2(component), children: /* @__PURE__ */ jsx102(Markdown7, { config: { link: { target: "_blank" } }, children: component.markdown }) });
|
|
16476
16521
|
};
|
|
16477
16522
|
|
|
16478
16523
|
// src/legacy/layout/image/DynamicImage.tsx
|
|
16479
16524
|
import { Image as Image2 } from "@transferwise/components";
|
|
16480
|
-
import { useEffect as
|
|
16481
|
-
import { jsx as
|
|
16525
|
+
import { useEffect as useEffect16, useState as useState22 } from "react";
|
|
16526
|
+
import { jsx as jsx103 } from "react/jsx-runtime";
|
|
16482
16527
|
function DynamicImage({ component: image }) {
|
|
16483
16528
|
const { url, size, text, margin, accessibilityDescription } = image;
|
|
16484
16529
|
const httpClient = useHttpClient();
|
|
16485
16530
|
const [imageSource, setImageSource] = useState22("");
|
|
16486
|
-
|
|
16531
|
+
useEffect16(() => {
|
|
16487
16532
|
void getImageSource2(httpClient, url).then(setImageSource);
|
|
16488
16533
|
}, [url, httpClient]);
|
|
16489
16534
|
const imageProps = {
|
|
@@ -16495,7 +16540,7 @@ function DynamicImage({ component: image }) {
|
|
|
16495
16540
|
if (!imageSource) {
|
|
16496
16541
|
return null;
|
|
16497
16542
|
}
|
|
16498
|
-
return /* @__PURE__ */
|
|
16543
|
+
return /* @__PURE__ */ jsx103("div", { className: `df-image ${size || "md"}`, children: /* @__PURE__ */ jsx103(Image2, __spreadValues({ className: `img-responsive ${getMargin2(margin || "md")}` }, imageProps)) });
|
|
16499
16544
|
}
|
|
16500
16545
|
var readImageBlobAsDataURL2 = (imageBlob) => (
|
|
16501
16546
|
// we can safely assume the type of reader.result is string
|
|
@@ -16532,47 +16577,47 @@ var DynamicImage_default = DynamicImage;
|
|
|
16532
16577
|
|
|
16533
16578
|
// src/legacy/layout/instructions/DynamicInstructions.tsx
|
|
16534
16579
|
import { Header as Header10, InstructionsList as InstructionsList2 } from "@transferwise/components";
|
|
16535
|
-
import { jsx as
|
|
16580
|
+
import { jsx as jsx104, jsxs as jsxs37 } from "react/jsx-runtime";
|
|
16536
16581
|
var doContext2 = ["positive", "neutral"];
|
|
16537
16582
|
var dontContext2 = ["warning", "negative"];
|
|
16538
16583
|
var DynamicInstructions = ({ component }) => {
|
|
16539
16584
|
const { items } = component;
|
|
16540
16585
|
const dos = items.filter((item) => doContext2.includes(item.context)).map(({ text }) => text);
|
|
16541
16586
|
const donts = items.filter((item) => dontContext2.includes(item.context)).map(({ text }) => text);
|
|
16542
|
-
return /* @__PURE__ */
|
|
16543
|
-
component.title ? /* @__PURE__ */
|
|
16544
|
-
/* @__PURE__ */
|
|
16587
|
+
return /* @__PURE__ */ jsxs37("div", { className: getMargin2(component.margin || "md"), children: [
|
|
16588
|
+
component.title ? /* @__PURE__ */ jsx104(Header10, { title: component.title }) : null,
|
|
16589
|
+
/* @__PURE__ */ jsx104(InstructionsList2, { dos, donts })
|
|
16545
16590
|
] });
|
|
16546
16591
|
};
|
|
16547
16592
|
var DynamicInstructions_default = DynamicInstructions;
|
|
16548
16593
|
|
|
16549
16594
|
// src/legacy/layout/DynamicLayout.tsx
|
|
16550
|
-
import { Fragment as
|
|
16595
|
+
import { Fragment as Fragment20, jsx as jsx105 } from "react/jsx-runtime";
|
|
16551
16596
|
var getKey = (component) => JSON.stringify(component);
|
|
16552
16597
|
function DynamicLayout(props) {
|
|
16553
16598
|
const { components, model, submitted, errors, onModelChange, onAction, onPersistAsync, baseUrl } = props;
|
|
16554
16599
|
const renderComponent = (component) => {
|
|
16555
16600
|
switch (component.type) {
|
|
16556
16601
|
case "heading":
|
|
16557
|
-
return /* @__PURE__ */
|
|
16602
|
+
return /* @__PURE__ */ jsx105(DynamicHeading_default, { component }, getKey(component));
|
|
16558
16603
|
case "paragraph":
|
|
16559
|
-
return /* @__PURE__ */
|
|
16604
|
+
return /* @__PURE__ */ jsx105(DynamicParagraph_default, { component }, getKey(component));
|
|
16560
16605
|
case "image":
|
|
16561
|
-
return /* @__PURE__ */
|
|
16606
|
+
return /* @__PURE__ */ jsx105(DynamicImage_default, { component }, getKey(component));
|
|
16562
16607
|
case "alert":
|
|
16563
|
-
return /* @__PURE__ */
|
|
16608
|
+
return /* @__PURE__ */ jsx105(DynamicAlert_default, { component }, getKey(component));
|
|
16564
16609
|
case "review":
|
|
16565
|
-
return /* @__PURE__ */
|
|
16610
|
+
return /* @__PURE__ */ jsx105(DynamicReview_default, { component, onAction }, getKey(component));
|
|
16566
16611
|
case "divider":
|
|
16567
|
-
return /* @__PURE__ */
|
|
16612
|
+
return /* @__PURE__ */ jsx105(DynamicDivider_default, { component }, getKey(component));
|
|
16568
16613
|
case "info":
|
|
16569
|
-
return /* @__PURE__ */
|
|
16614
|
+
return /* @__PURE__ */ jsx105(DynamicInfo, { component }, getKey(component));
|
|
16570
16615
|
case "instructions":
|
|
16571
|
-
return /* @__PURE__ */
|
|
16616
|
+
return /* @__PURE__ */ jsx105(DynamicInstructions_default, { component }, getKey(component));
|
|
16572
16617
|
case "markdown":
|
|
16573
|
-
return /* @__PURE__ */
|
|
16618
|
+
return /* @__PURE__ */ jsx105(DynamicMarkdown, { component }, getKey(component));
|
|
16574
16619
|
case "columns":
|
|
16575
|
-
return /* @__PURE__ */
|
|
16620
|
+
return /* @__PURE__ */ jsx105(
|
|
16576
16621
|
DynamicColumns_default,
|
|
16577
16622
|
{
|
|
16578
16623
|
component,
|
|
@@ -16586,7 +16631,7 @@ function DynamicLayout(props) {
|
|
|
16586
16631
|
getKey(component)
|
|
16587
16632
|
);
|
|
16588
16633
|
case "form":
|
|
16589
|
-
return /* @__PURE__ */
|
|
16634
|
+
return /* @__PURE__ */ jsx105(
|
|
16590
16635
|
DynamicForm_default,
|
|
16591
16636
|
{
|
|
16592
16637
|
component,
|
|
@@ -16599,9 +16644,9 @@ function DynamicLayout(props) {
|
|
|
16599
16644
|
getKey(__spreadProps(__spreadValues({}, component), { errors: errors != null ? errors : null }))
|
|
16600
16645
|
);
|
|
16601
16646
|
case "button":
|
|
16602
|
-
return /* @__PURE__ */
|
|
16647
|
+
return /* @__PURE__ */ jsx105(DynamicButton_default, { component, onAction }, getKey(component));
|
|
16603
16648
|
case "box":
|
|
16604
|
-
return /* @__PURE__ */
|
|
16649
|
+
return /* @__PURE__ */ jsx105(
|
|
16605
16650
|
DynamicBox_default,
|
|
16606
16651
|
{
|
|
16607
16652
|
component,
|
|
@@ -16615,18 +16660,18 @@ function DynamicLayout(props) {
|
|
|
16615
16660
|
getKey(component)
|
|
16616
16661
|
);
|
|
16617
16662
|
case "decision":
|
|
16618
|
-
return /* @__PURE__ */
|
|
16663
|
+
return /* @__PURE__ */ jsx105(DynamicDecision_default, { component, onAction }, getKey(component));
|
|
16619
16664
|
case "external":
|
|
16620
|
-
return /* @__PURE__ */
|
|
16665
|
+
return /* @__PURE__ */ jsx105(DynamicExternal_default, { component, onAction }, getKey(component));
|
|
16621
16666
|
case "list":
|
|
16622
16667
|
case "status-list":
|
|
16623
|
-
return /* @__PURE__ */
|
|
16668
|
+
return /* @__PURE__ */ jsx105(DynamicStatusList_default, { component, onAction }, getKey(component));
|
|
16624
16669
|
case "loading-indicator":
|
|
16625
|
-
return /* @__PURE__ */
|
|
16670
|
+
return /* @__PURE__ */ jsx105(DynamicLoadingIndicator_default, { component }, getKey(component));
|
|
16626
16671
|
case "search":
|
|
16627
|
-
return /* @__PURE__ */
|
|
16672
|
+
return /* @__PURE__ */ jsx105(DynamicSearch_default, { component, onAction }, getKey(component));
|
|
16628
16673
|
case "modal":
|
|
16629
|
-
return /* @__PURE__ */
|
|
16674
|
+
return /* @__PURE__ */ jsx105(
|
|
16630
16675
|
DynamicModal_default,
|
|
16631
16676
|
{
|
|
16632
16677
|
component,
|
|
@@ -16640,22 +16685,22 @@ function DynamicLayout(props) {
|
|
|
16640
16685
|
getKey(component)
|
|
16641
16686
|
);
|
|
16642
16687
|
default:
|
|
16643
|
-
return /* @__PURE__ */
|
|
16688
|
+
return /* @__PURE__ */ jsx105("div", {}, getKey(component));
|
|
16644
16689
|
}
|
|
16645
16690
|
};
|
|
16646
16691
|
if (useHasHttpClientProvider() || baseUrl == null) {
|
|
16647
|
-
return /* @__PURE__ */
|
|
16692
|
+
return /* @__PURE__ */ jsx105(Fragment20, { children: components.map(renderComponent) });
|
|
16648
16693
|
}
|
|
16649
|
-
return /* @__PURE__ */
|
|
16694
|
+
return /* @__PURE__ */ jsx105(HttpClientProviderFromBaseUrl, { baseUrl, children: components.map(renderComponent) });
|
|
16650
16695
|
}
|
|
16651
16696
|
var DynamicLayout_default = DynamicLayout;
|
|
16652
16697
|
|
|
16653
16698
|
// src/legacy/layout/list/DynamicStatusList.tsx
|
|
16654
16699
|
import { Header as Header11, Summary as Summary2 } from "@transferwise/components";
|
|
16655
|
-
import { jsx as
|
|
16700
|
+
import { jsx as jsx106, jsxs as jsxs38 } from "react/jsx-runtime";
|
|
16656
16701
|
var DynamicStatusList = ({ component }) => {
|
|
16657
|
-
return /* @__PURE__ */
|
|
16658
|
-
component.title ? /* @__PURE__ */
|
|
16702
|
+
return /* @__PURE__ */ jsxs38("div", { className: getMargin2(component.margin || "md"), children: [
|
|
16703
|
+
component.title ? /* @__PURE__ */ jsx106(Header11, { title: component.title }) : null,
|
|
16659
16704
|
component.items.map(mapListItemToSummary)
|
|
16660
16705
|
] });
|
|
16661
16706
|
};
|
|
@@ -16664,8 +16709,8 @@ var mapListItemToSummary = ({ title, description, icon, status }) => {
|
|
|
16664
16709
|
key: `${title}/${description || ""}`,
|
|
16665
16710
|
title,
|
|
16666
16711
|
description
|
|
16667
|
-
}, (icon == null ? void 0 : icon.name) ? { icon: /* @__PURE__ */
|
|
16668
|
-
return /* @__PURE__ */
|
|
16712
|
+
}, (icon == null ? void 0 : icon.name) ? { icon: /* @__PURE__ */ jsx106(DynamicIcon_default2, { type: icon.name }) } : {}), status ? { status: statusMap[status] } : {});
|
|
16713
|
+
return /* @__PURE__ */ jsx106(Summary2, __spreadValues({}, props));
|
|
16669
16714
|
};
|
|
16670
16715
|
var statusListMap = {
|
|
16671
16716
|
done: "done",
|
|
@@ -16682,10 +16727,10 @@ var DynamicStatusList_default = DynamicStatusList;
|
|
|
16682
16727
|
|
|
16683
16728
|
// src/legacy/layout/loadingIndicator/DynamicLoadingIndicator.tsx
|
|
16684
16729
|
import { Loader as Loader3 } from "@transferwise/components";
|
|
16685
|
-
import { jsx as
|
|
16730
|
+
import { jsx as jsx107 } from "react/jsx-runtime";
|
|
16686
16731
|
var DynamicLoadingIndicator = ({ component }) => {
|
|
16687
16732
|
const { margin = "md", size = "md" } = component;
|
|
16688
|
-
return /* @__PURE__ */
|
|
16733
|
+
return /* @__PURE__ */ jsx107(
|
|
16689
16734
|
Loader3,
|
|
16690
16735
|
{
|
|
16691
16736
|
size,
|
|
@@ -16713,12 +16758,12 @@ function noop3() {
|
|
|
16713
16758
|
}
|
|
16714
16759
|
|
|
16715
16760
|
// src/legacy/layout/paragraph/DynamicParagraph.tsx
|
|
16716
|
-
import { jsx as
|
|
16761
|
+
import { jsx as jsx108, jsxs as jsxs39 } from "react/jsx-runtime";
|
|
16717
16762
|
function DynamicParagraph({ component }) {
|
|
16718
|
-
return component.control === "copyable" ? /* @__PURE__ */
|
|
16763
|
+
return component.control === "copyable" ? /* @__PURE__ */ jsx108(CopyableDynamicParagraph, { component }) : /* @__PURE__ */ jsx108(BasicDynamicParagraph, { component });
|
|
16719
16764
|
}
|
|
16720
16765
|
function BasicDynamicParagraph({ component }) {
|
|
16721
|
-
return /* @__PURE__ */
|
|
16766
|
+
return /* @__PURE__ */ jsxs39("p", { className: getTextAlignmentAndMargin2(component), children: [
|
|
16722
16767
|
" ",
|
|
16723
16768
|
component.text,
|
|
16724
16769
|
" "
|
|
@@ -16736,8 +16781,8 @@ function CopyableDynamicParagraph({ component }) {
|
|
|
16736
16781
|
align: component.align,
|
|
16737
16782
|
margin: "sm"
|
|
16738
16783
|
})} form-control`;
|
|
16739
|
-
return /* @__PURE__ */
|
|
16740
|
-
/* @__PURE__ */
|
|
16784
|
+
return /* @__PURE__ */ jsxs39("div", { className: getTextAlignmentAndMargin2(component), children: [
|
|
16785
|
+
/* @__PURE__ */ jsx108(
|
|
16741
16786
|
"input",
|
|
16742
16787
|
{
|
|
16743
16788
|
type: "text",
|
|
@@ -16747,7 +16792,7 @@ function CopyableDynamicParagraph({ component }) {
|
|
|
16747
16792
|
style: { textOverflow: "ellipsis" }
|
|
16748
16793
|
}
|
|
16749
16794
|
),
|
|
16750
|
-
/* @__PURE__ */
|
|
16795
|
+
/* @__PURE__ */ jsx108(Button8, { block: true, onClick: copy, children: formatMessage(paragraph_messages_default.copy) })
|
|
16751
16796
|
] });
|
|
16752
16797
|
}
|
|
16753
16798
|
function noop4() {
|
|
@@ -16756,7 +16801,7 @@ var DynamicParagraph_default = DynamicParagraph;
|
|
|
16756
16801
|
|
|
16757
16802
|
// src/legacy/layout/review/DynamicReview.tsx
|
|
16758
16803
|
import { DefinitionList as DefinitionList3, Header as Header12 } from "@transferwise/components";
|
|
16759
|
-
import { Fragment as
|
|
16804
|
+
import { Fragment as Fragment21, jsx as jsx109, jsxs as jsxs40 } from "react/jsx-runtime";
|
|
16760
16805
|
var getDefinitions = (orientation, review) => review.fields.map(({ label, value, help }, index) => ({
|
|
16761
16806
|
key: String(index),
|
|
16762
16807
|
title: label,
|
|
@@ -16764,14 +16809,14 @@ var getDefinitions = (orientation, review) => review.fields.map(({ label, value,
|
|
|
16764
16809
|
}));
|
|
16765
16810
|
var getFieldValue2 = (value, help, orientation) => {
|
|
16766
16811
|
if (help) {
|
|
16767
|
-
return orientation === "HORIZONTAL_RIGHT_ALIGNED" ? /* @__PURE__ */
|
|
16768
|
-
/* @__PURE__ */
|
|
16812
|
+
return orientation === "HORIZONTAL_RIGHT_ALIGNED" ? /* @__PURE__ */ jsxs40(Fragment21, { children: [
|
|
16813
|
+
/* @__PURE__ */ jsx109(Help_default2, { help }),
|
|
16769
16814
|
" ",
|
|
16770
16815
|
value
|
|
16771
|
-
] }) : /* @__PURE__ */
|
|
16816
|
+
] }) : /* @__PURE__ */ jsxs40(Fragment21, { children: [
|
|
16772
16817
|
value,
|
|
16773
16818
|
" ",
|
|
16774
|
-
/* @__PURE__ */
|
|
16819
|
+
/* @__PURE__ */ jsx109(Help_default2, { help })
|
|
16775
16820
|
] });
|
|
16776
16821
|
}
|
|
16777
16822
|
return value;
|
|
@@ -16796,9 +16841,9 @@ function DynamicReview(props) {
|
|
|
16796
16841
|
const orientation = getReviewLayout(review);
|
|
16797
16842
|
const callToAction = review.callToAction ? getReviewAction2(review.callToAction.title, review.callToAction.action) : null;
|
|
16798
16843
|
const legacyCallToAction = !callToAction && review.action ? getReviewAction2(review.action.title || "", review.action) : null;
|
|
16799
|
-
return /* @__PURE__ */
|
|
16800
|
-
review.title && /* @__PURE__ */
|
|
16801
|
-
/* @__PURE__ */
|
|
16844
|
+
return /* @__PURE__ */ jsxs40("div", { className: margin, children: [
|
|
16845
|
+
review.title && /* @__PURE__ */ jsx109(Header12, { title: review.title, action: callToAction || legacyCallToAction || void 0 }),
|
|
16846
|
+
/* @__PURE__ */ jsx109("div", { className: margin, children: /* @__PURE__ */ jsx109(DefinitionList3, { layout: orientation, definitions: getDefinitions(orientation, review) }) })
|
|
16802
16847
|
] });
|
|
16803
16848
|
}
|
|
16804
16849
|
var DynamicReview_default = DynamicReview;
|
|
@@ -16809,11 +16854,11 @@ import { Search as Search2 } from "@transferwise/icons";
|
|
|
16809
16854
|
|
|
16810
16855
|
// src/legacy/layout/search/SearchInput.tsx
|
|
16811
16856
|
import { Input as Input7 } from "@transferwise/components";
|
|
16812
|
-
import { jsx as
|
|
16857
|
+
import { jsx as jsx110, jsxs as jsxs41 } from "react/jsx-runtime";
|
|
16813
16858
|
var SearchInput = ({ title, value, onFocus, onChange }) => {
|
|
16814
|
-
return /* @__PURE__ */
|
|
16859
|
+
return /* @__PURE__ */ jsxs41("label", { className: "control-label d-inline", children: [
|
|
16815
16860
|
title,
|
|
16816
|
-
/* @__PURE__ */
|
|
16861
|
+
/* @__PURE__ */ jsx110(
|
|
16817
16862
|
Input7,
|
|
16818
16863
|
{
|
|
16819
16864
|
type: "text",
|
|
@@ -16829,12 +16874,12 @@ var SearchInput = ({ title, value, onFocus, onChange }) => {
|
|
|
16829
16874
|
// src/legacy/layout/search/SearchResults.tsx
|
|
16830
16875
|
import { NavigationOption as NavigationOption7, NavigationOptionsList as NavigationOptionsList4 } from "@transferwise/components";
|
|
16831
16876
|
import { useIntl as useIntl17 } from "react-intl";
|
|
16832
|
-
import { jsx as
|
|
16877
|
+
import { jsx as jsx111, jsxs as jsxs42 } from "react/jsx-runtime";
|
|
16833
16878
|
function SearchResults2({ results, emptyMessage, onSelect }) {
|
|
16834
16879
|
if (results.length === 0) {
|
|
16835
|
-
return /* @__PURE__ */
|
|
16880
|
+
return /* @__PURE__ */ jsx111("p", { className: "m-t-2", children: emptyMessage });
|
|
16836
16881
|
}
|
|
16837
|
-
return /* @__PURE__ */
|
|
16882
|
+
return /* @__PURE__ */ jsx111(NavigationOptionsList4, { children: results.map((result) => /* @__PURE__ */ jsx111(
|
|
16838
16883
|
NavigationOption7,
|
|
16839
16884
|
{
|
|
16840
16885
|
title: result.title,
|
|
@@ -16849,10 +16894,10 @@ function SearchResults2({ results, emptyMessage, onSelect }) {
|
|
|
16849
16894
|
}
|
|
16850
16895
|
function ErrorResult2({ onRetrySearch }) {
|
|
16851
16896
|
const intl = useIntl17();
|
|
16852
|
-
return /* @__PURE__ */
|
|
16897
|
+
return /* @__PURE__ */ jsxs42("p", { className: "m-t-2", children: [
|
|
16853
16898
|
intl.formatMessage(generic_error_messages_default.genericError),
|
|
16854
16899
|
"\xA0",
|
|
16855
|
-
/* @__PURE__ */
|
|
16900
|
+
/* @__PURE__ */ jsx111(
|
|
16856
16901
|
"a",
|
|
16857
16902
|
{
|
|
16858
16903
|
href: "/",
|
|
@@ -16938,7 +16983,7 @@ var addQueryParameter2 = (url, key, value) => {
|
|
|
16938
16983
|
// src/legacy/layout/search/DynamicSearch.tsx
|
|
16939
16984
|
var import_classnames15 = __toESM(require_classnames());
|
|
16940
16985
|
import { Markdown as Markdown8, Typeahead as Typeahead2 } from "@transferwise/components";
|
|
16941
|
-
import { jsx as
|
|
16986
|
+
import { jsx as jsx112, jsxs as jsxs43 } from "react/jsx-runtime";
|
|
16942
16987
|
var DEBOUNCE_TIME2 = 400;
|
|
16943
16988
|
function DynamicSearch({ component, onAction }) {
|
|
16944
16989
|
const [query, setQuery] = useState24("");
|
|
@@ -16974,16 +17019,16 @@ function DynamicSearch({ component, onAction }) {
|
|
|
16974
17019
|
void search(query);
|
|
16975
17020
|
};
|
|
16976
17021
|
if (control === "inline") {
|
|
16977
|
-
return /* @__PURE__ */
|
|
17022
|
+
return /* @__PURE__ */ jsx112("div", { className: (0, import_classnames15.default)(getMargin2(margin != null ? margin : "md"), "df-search-typeahead"), children: /* @__PURE__ */ jsxs43("label", { className: "control-label d-inline", children: [
|
|
16978
17023
|
title,
|
|
16979
|
-
/* @__PURE__ */
|
|
17024
|
+
/* @__PURE__ */ jsx112("div", { className: "m-t-1", children: /* @__PURE__ */ jsx112(
|
|
16980
17025
|
Typeahead2,
|
|
16981
17026
|
{
|
|
16982
17027
|
id: "typeahead-input-id",
|
|
16983
17028
|
name: "typeahead-input-name",
|
|
16984
17029
|
size: "md",
|
|
16985
17030
|
maxHeight: 100,
|
|
16986
|
-
footer: /* @__PURE__ */
|
|
17031
|
+
footer: /* @__PURE__ */ jsx112(
|
|
16987
17032
|
TypeaheadFooter2,
|
|
16988
17033
|
{
|
|
16989
17034
|
state: status,
|
|
@@ -16994,7 +17039,7 @@ function DynamicSearch({ component, onAction }) {
|
|
|
16994
17039
|
),
|
|
16995
17040
|
multiple: false,
|
|
16996
17041
|
clearable: false,
|
|
16997
|
-
addon: /* @__PURE__ */
|
|
17042
|
+
addon: /* @__PURE__ */ jsx112(Search2, { size: 24 }),
|
|
16998
17043
|
options: results.map(mapResultToTypeaheadOption2),
|
|
16999
17044
|
onChange: (values) => {
|
|
17000
17045
|
if (values.length > 0) {
|
|
@@ -17009,11 +17054,11 @@ function DynamicSearch({ component, onAction }) {
|
|
|
17009
17054
|
) })
|
|
17010
17055
|
] }) });
|
|
17011
17056
|
}
|
|
17012
|
-
return /* @__PURE__ */
|
|
17013
|
-
/* @__PURE__ */
|
|
17014
|
-
status === "loading" && /* @__PURE__ */
|
|
17015
|
-
status === "error" && /* @__PURE__ */
|
|
17016
|
-
status === "success" && /* @__PURE__ */
|
|
17057
|
+
return /* @__PURE__ */ jsxs43("div", { className: getMargin2(margin != null ? margin : "md"), children: [
|
|
17058
|
+
/* @__PURE__ */ jsx112(SearchInput, { title, value: query, onChange, onFocus: onSearchStart }),
|
|
17059
|
+
status === "loading" && /* @__PURE__ */ jsx112(DynamicLoadingIndicator_default, { component: { type: "loading-indicator", size: "sm" } }),
|
|
17060
|
+
status === "error" && /* @__PURE__ */ jsx112(ErrorResult2, { onRetrySearch }),
|
|
17061
|
+
status === "success" && /* @__PURE__ */ jsx112(SearchResults2, { results, emptyMessage, onSelect: onResultSelected })
|
|
17017
17062
|
] });
|
|
17018
17063
|
}
|
|
17019
17064
|
function mapResultToTypeaheadOption2(result) {
|
|
@@ -17032,13 +17077,13 @@ function TypeaheadFooter2({
|
|
|
17032
17077
|
emptyMessage
|
|
17033
17078
|
}) {
|
|
17034
17079
|
if (state === "success" && results.length === 0) {
|
|
17035
|
-
return /* @__PURE__ */
|
|
17080
|
+
return /* @__PURE__ */ jsx112(Markdown8, { className: "m-t-2 m-x-2", config: { link: { target: "_blank" } }, children: emptyMessage });
|
|
17036
17081
|
}
|
|
17037
17082
|
if (state === "error" && results.length === 0) {
|
|
17038
|
-
return /* @__PURE__ */
|
|
17083
|
+
return /* @__PURE__ */ jsx112("div", { className: "m-t-2 m-x-2", children: /* @__PURE__ */ jsx112(ErrorResult2, { onRetrySearch }) });
|
|
17039
17084
|
}
|
|
17040
17085
|
if (state === "loading" || results.length === 0) {
|
|
17041
|
-
return /* @__PURE__ */
|
|
17086
|
+
return /* @__PURE__ */ jsx112("p", { className: "m-t-2 m-x-2", children: "Loading..." });
|
|
17042
17087
|
}
|
|
17043
17088
|
return null;
|
|
17044
17089
|
}
|
|
@@ -17047,20 +17092,20 @@ var DynamicSearch_default = DynamicSearch;
|
|
|
17047
17092
|
// src/legacy/layout/modal/DynamicModal.tsx
|
|
17048
17093
|
import { Button as Button9, Modal as Modal4 } from "@transferwise/components";
|
|
17049
17094
|
import { useState as useState25 } from "react";
|
|
17050
|
-
import { jsx as
|
|
17095
|
+
import { jsx as jsx113, jsxs as jsxs44 } from "react/jsx-runtime";
|
|
17051
17096
|
function DynamicModal(props) {
|
|
17052
17097
|
const [visible, isVisible] = useState25(false);
|
|
17053
17098
|
const { component, onAction } = props;
|
|
17054
17099
|
const { margin = "md" } = component;
|
|
17055
|
-
return /* @__PURE__ */
|
|
17056
|
-
/* @__PURE__ */
|
|
17057
|
-
/* @__PURE__ */
|
|
17100
|
+
return /* @__PURE__ */ jsxs44("div", { className: getTextAlignmentAndMargin2({ margin }), children: [
|
|
17101
|
+
/* @__PURE__ */ jsx113(Button9, { priority: "tertiary", block: true, onClick: () => isVisible(true), children: component.trigger.title }),
|
|
17102
|
+
/* @__PURE__ */ jsx113(
|
|
17058
17103
|
Modal4,
|
|
17059
17104
|
{
|
|
17060
17105
|
scroll: "content",
|
|
17061
17106
|
open: visible,
|
|
17062
17107
|
size: "lg",
|
|
17063
|
-
body: /* @__PURE__ */
|
|
17108
|
+
body: /* @__PURE__ */ jsx113(
|
|
17064
17109
|
DynamicLayout_default,
|
|
17065
17110
|
__spreadProps(__spreadValues({}, props), {
|
|
17066
17111
|
components: component.content.components,
|
|
@@ -17078,7 +17123,7 @@ function DynamicModal(props) {
|
|
|
17078
17123
|
var DynamicModal_default = DynamicModal;
|
|
17079
17124
|
|
|
17080
17125
|
// src/legacy/jsonSchemaForm/basicTypeSchema/BasicTypeSchema.tsx
|
|
17081
|
-
import { Fragment as
|
|
17126
|
+
import { Fragment as Fragment22, jsx as jsx114, jsxs as jsxs45 } from "react/jsx-runtime";
|
|
17082
17127
|
var isNullish3 = (value) => isNull3(value) || isUndefined3(value);
|
|
17083
17128
|
var getDefaultValue = (schema) => {
|
|
17084
17129
|
return schema.type === "boolean" && isNullish3(schema.default) ? false : schema.default;
|
|
@@ -17137,9 +17182,9 @@ var BasicTypeSchema = (props) => {
|
|
|
17137
17182
|
};
|
|
17138
17183
|
const isConst = props.schema.const;
|
|
17139
17184
|
const isHidden = props.schema.hidden || isConst;
|
|
17140
|
-
|
|
17141
|
-
|
|
17142
|
-
|
|
17185
|
+
useEffect17(refreshValidations, [props.model, props.submitted]);
|
|
17186
|
+
useEffect17(onSchemaChange, [props.schema]);
|
|
17187
|
+
useEffect17(() => {
|
|
17143
17188
|
var _a2;
|
|
17144
17189
|
const newModel = (_a2 = props.model) != null ? _a2 : null;
|
|
17145
17190
|
if (newModel !== model) {
|
|
@@ -17154,15 +17199,15 @@ var BasicTypeSchema = (props) => {
|
|
|
17154
17199
|
const showLabel = props.schema.format !== "file" && props.schema.type !== "boolean";
|
|
17155
17200
|
const schemaHelp = props.schema.help;
|
|
17156
17201
|
const feedbackId = `${id}-feedback`;
|
|
17157
|
-
return !isHidden ? /* @__PURE__ */
|
|
17158
|
-
props.schema.alert && /* @__PURE__ */
|
|
17159
|
-
/* @__PURE__ */
|
|
17160
|
-
showLabel && /* @__PURE__ */
|
|
17161
|
-
/* @__PURE__ */
|
|
17162
|
-
!!schemaHelp && /* @__PURE__ */
|
|
17202
|
+
return !isHidden ? /* @__PURE__ */ jsxs45(Fragment22, { children: [
|
|
17203
|
+
props.schema.alert && /* @__PURE__ */ jsx114(DynamicAlert_default, { component: props.schema.alert }),
|
|
17204
|
+
/* @__PURE__ */ jsxs45("div", { className: (0, import_classnames16.default)(formGroupClasses), children: [
|
|
17205
|
+
showLabel && /* @__PURE__ */ jsxs45("div", { className: "d-inline-block m-b-1", children: [
|
|
17206
|
+
/* @__PURE__ */ jsx114("label", { className: "control-label d-inline", htmlFor: id, children: props.schema.title }),
|
|
17207
|
+
!!schemaHelp && /* @__PURE__ */ jsx114(Help_default2, { help: schemaHelp })
|
|
17163
17208
|
] }),
|
|
17164
|
-
!showLabel && !!schemaHelp && /* @__PURE__ */
|
|
17165
|
-
/* @__PURE__ */
|
|
17209
|
+
!showLabel && !!schemaHelp && /* @__PURE__ */ jsx114(Help_default2, { help: schemaHelp }),
|
|
17210
|
+
/* @__PURE__ */ jsx114(
|
|
17166
17211
|
SchemaFormControl_default,
|
|
17167
17212
|
{
|
|
17168
17213
|
id,
|
|
@@ -17175,7 +17220,7 @@ var BasicTypeSchema = (props) => {
|
|
|
17175
17220
|
describedBy: feedbackId
|
|
17176
17221
|
}
|
|
17177
17222
|
),
|
|
17178
|
-
/* @__PURE__ */
|
|
17223
|
+
/* @__PURE__ */ jsx114(
|
|
17179
17224
|
ControlFeedback_default,
|
|
17180
17225
|
{
|
|
17181
17226
|
id: feedbackId,
|
|
@@ -17200,7 +17245,7 @@ BasicTypeSchema.defaultProps = {
|
|
|
17200
17245
|
var BasicTypeSchema_default = BasicTypeSchema;
|
|
17201
17246
|
|
|
17202
17247
|
// src/legacy/jsonSchemaForm/persistAsyncSchema/persistAsyncBasicSchema/PersistAsyncBasicSchema.tsx
|
|
17203
|
-
import { jsx as
|
|
17248
|
+
import { jsx as jsx115 } from "react/jsx-runtime";
|
|
17204
17249
|
var getIdFromResponse = (idProperty, response) => response[idProperty];
|
|
17205
17250
|
var getErrorFromResponse = (errorProperty, response) => {
|
|
17206
17251
|
var _a;
|
|
@@ -17223,7 +17268,7 @@ function PersistAsyncBasicSchema(props) {
|
|
|
17223
17268
|
const [persistAsyncError, setPersistAsyncError] = useState27(null);
|
|
17224
17269
|
const [fieldSubmitted, setFieldSubmitted] = useState27(false);
|
|
17225
17270
|
const [abortController, setAbortController] = useState27(null);
|
|
17226
|
-
|
|
17271
|
+
useEffect18(() => {
|
|
17227
17272
|
if (controlTypesWithPersistOnChange.has(
|
|
17228
17273
|
// TODO: LOW avoid type assertion below -- control type may be nullish. consider ?? ''
|
|
17229
17274
|
getControlType(schema.persistAsync.schema)
|
|
@@ -17290,7 +17335,7 @@ function PersistAsyncBasicSchema(props) {
|
|
|
17290
17335
|
setPersistAsyncModel(newPersistAsyncModel);
|
|
17291
17336
|
}
|
|
17292
17337
|
};
|
|
17293
|
-
return /* @__PURE__ */
|
|
17338
|
+
return /* @__PURE__ */ jsx115(
|
|
17294
17339
|
BasicTypeSchema_default,
|
|
17295
17340
|
{
|
|
17296
17341
|
required,
|
|
@@ -17390,7 +17435,7 @@ function hasStringMessage(value) {
|
|
|
17390
17435
|
}
|
|
17391
17436
|
|
|
17392
17437
|
// src/legacy/common/hooks/usePolling/usePolling.tsx
|
|
17393
|
-
import { useEffect as
|
|
17438
|
+
import { useEffect as useEffect19, useMemo as useMemo18, useRef as useRef5 } from "react";
|
|
17394
17439
|
function usePolling({
|
|
17395
17440
|
asyncFn,
|
|
17396
17441
|
interval,
|
|
@@ -17411,7 +17456,7 @@ function usePolling({
|
|
|
17411
17456
|
),
|
|
17412
17457
|
[asyncFn, maxAttempts, maxConsecutiveFails]
|
|
17413
17458
|
);
|
|
17414
|
-
|
|
17459
|
+
useEffect19(() => {
|
|
17415
17460
|
if (interval > 0) {
|
|
17416
17461
|
const intervalReference = setInterval(() => {
|
|
17417
17462
|
poll();
|
|
@@ -17419,7 +17464,7 @@ function usePolling({
|
|
|
17419
17464
|
return () => clearInterval(intervalReference);
|
|
17420
17465
|
}
|
|
17421
17466
|
}, [poll, interval]);
|
|
17422
|
-
|
|
17467
|
+
useEffect19(() => {
|
|
17423
17468
|
onPollingResponseReference.current = onPollingResponse;
|
|
17424
17469
|
onFailureReference.current = onFailure;
|
|
17425
17470
|
}, [onPollingResponse, onFailure]);
|
|
@@ -17450,10 +17495,10 @@ function createPollingClosure(asyncFn, maxAttempts, maxConsecutiveFails, onPolli
|
|
|
17450
17495
|
}
|
|
17451
17496
|
|
|
17452
17497
|
// src/legacy/common/hooks/usePrevious/usePrevious.js
|
|
17453
|
-
import { useEffect as
|
|
17498
|
+
import { useEffect as useEffect20, useRef as useRef6 } from "react";
|
|
17454
17499
|
var usePrevious = (value) => {
|
|
17455
17500
|
const reference = useRef6();
|
|
17456
|
-
|
|
17501
|
+
useEffect20(() => {
|
|
17457
17502
|
reference.current = value;
|
|
17458
17503
|
}, [value]);
|
|
17459
17504
|
return reference.current;
|
|
@@ -17501,7 +17546,7 @@ function useStepPolling(polling, onAction) {
|
|
|
17501
17546
|
}
|
|
17502
17547
|
|
|
17503
17548
|
// src/legacy/step/layoutStep/LayoutStep.tsx
|
|
17504
|
-
import { jsx as
|
|
17549
|
+
import { jsx as jsx116 } from "react/jsx-runtime";
|
|
17505
17550
|
var getComponents = (step, options) => {
|
|
17506
17551
|
var _a;
|
|
17507
17552
|
if (isEmpty(step)) {
|
|
@@ -17524,7 +17569,7 @@ var LayoutStep = (props) => {
|
|
|
17524
17569
|
onEvent("Dynamic Flow - onAction supressed", { reason: "LayoutStep - loading state" });
|
|
17525
17570
|
};
|
|
17526
17571
|
useStepPolling(stepSpecification.polling, onAction);
|
|
17527
|
-
return /* @__PURE__ */
|
|
17572
|
+
return /* @__PURE__ */ jsx116(
|
|
17528
17573
|
DynamicLayout_default,
|
|
17529
17574
|
{
|
|
17530
17575
|
components,
|
|
@@ -17540,10 +17585,10 @@ var LayoutStep = (props) => {
|
|
|
17540
17585
|
var LayoutStep_default = LayoutStep;
|
|
17541
17586
|
|
|
17542
17587
|
// src/legacy/step/cameraStep/CameraStep.tsx
|
|
17543
|
-
import { useEffect as
|
|
17588
|
+
import { useEffect as useEffect25, useState as useState31 } from "react";
|
|
17544
17589
|
|
|
17545
17590
|
// src/legacy/step/cameraStep/cameraCapture/CameraCapture.tsx
|
|
17546
|
-
import { useCallback as useCallback10, useEffect as
|
|
17591
|
+
import { useCallback as useCallback10, useEffect as useEffect24, useMemo as useMemo20, useRef as useRef8, useState as useState30 } from "react";
|
|
17547
17592
|
import { useIntl as useIntl22 } from "react-intl";
|
|
17548
17593
|
import Webcam from "react-webcam";
|
|
17549
17594
|
|
|
@@ -17610,15 +17655,15 @@ var CameraCapture_messages_default = defineMessages13({
|
|
|
17610
17655
|
// src/legacy/step/cameraStep/cameraCapture/components/bottomBar/BottomBar.tsx
|
|
17611
17656
|
import { Button as Button10, ControlType, Priority, Size as Size3 } from "@transferwise/components";
|
|
17612
17657
|
import { useIntl as useIntl20 } from "react-intl";
|
|
17613
|
-
import { jsx as
|
|
17614
|
-
var CaptureBottomBar = ({ onCapture }) => /* @__PURE__ */
|
|
17658
|
+
import { jsx as jsx117, jsxs as jsxs46 } from "react/jsx-runtime";
|
|
17659
|
+
var CaptureBottomBar = ({ onCapture }) => /* @__PURE__ */ jsx117("div", { className: "bottom-bar", children: /* @__PURE__ */ jsx117(CaptureButton, { onClick: onCapture }) });
|
|
17615
17660
|
var ReviewBottomBar = ({
|
|
17616
17661
|
onSubmit,
|
|
17617
17662
|
onRetry
|
|
17618
17663
|
}) => {
|
|
17619
17664
|
const intl = useIntl20();
|
|
17620
|
-
return /* @__PURE__ */
|
|
17621
|
-
/* @__PURE__ */
|
|
17665
|
+
return /* @__PURE__ */ jsx117("div", { className: "bottom-bar p-x-2", children: /* @__PURE__ */ jsx117("div", { className: "row", children: /* @__PURE__ */ jsxs46("div", { className: "col-xs-12 col-md-6 col-md-offset-3", children: [
|
|
17666
|
+
/* @__PURE__ */ jsx117(
|
|
17622
17667
|
Button10,
|
|
17623
17668
|
{
|
|
17624
17669
|
className: "m-b-1",
|
|
@@ -17629,7 +17674,7 @@ var ReviewBottomBar = ({
|
|
|
17629
17674
|
children: intl.formatMessage(CameraCapture_messages_default.reviewSubmit)
|
|
17630
17675
|
}
|
|
17631
17676
|
),
|
|
17632
|
-
/* @__PURE__ */
|
|
17677
|
+
/* @__PURE__ */ jsx117(
|
|
17633
17678
|
Button10,
|
|
17634
17679
|
{
|
|
17635
17680
|
className: "m-b-2",
|
|
@@ -17643,14 +17688,14 @@ var ReviewBottomBar = ({
|
|
|
17643
17688
|
)
|
|
17644
17689
|
] }) }) });
|
|
17645
17690
|
};
|
|
17646
|
-
var CaptureButton = ({ onClick }) => /* @__PURE__ */
|
|
17691
|
+
var CaptureButton = ({ onClick }) => /* @__PURE__ */ jsx117(
|
|
17647
17692
|
"button",
|
|
17648
17693
|
{
|
|
17649
17694
|
type: "button",
|
|
17650
17695
|
className: "camera-capture-btn m-b-2",
|
|
17651
17696
|
"data-testid": "camera-capture-button",
|
|
17652
17697
|
onClick,
|
|
17653
|
-
children: /* @__PURE__ */
|
|
17698
|
+
children: /* @__PURE__ */ jsx117("span", { className: "camera-capture-btn-inner" })
|
|
17654
17699
|
}
|
|
17655
17700
|
);
|
|
17656
17701
|
|
|
@@ -17668,11 +17713,11 @@ var OrientationLockOverlay_messages_default = defineMessages14({
|
|
|
17668
17713
|
});
|
|
17669
17714
|
|
|
17670
17715
|
// src/legacy/step/cameraStep/cameraCapture/components/orientationLockOverlay/OrientationLockOverlay.tsx
|
|
17671
|
-
import { jsx as
|
|
17716
|
+
import { jsx as jsx118, jsxs as jsxs47 } from "react/jsx-runtime";
|
|
17672
17717
|
function OrientationLockOverlay() {
|
|
17673
17718
|
const intl = useIntl21();
|
|
17674
|
-
return /* @__PURE__ */
|
|
17675
|
-
/* @__PURE__ */
|
|
17719
|
+
return /* @__PURE__ */ jsxs47("div", { className: "orientation-lock-overlay", children: [
|
|
17720
|
+
/* @__PURE__ */ jsx118(
|
|
17676
17721
|
"img",
|
|
17677
17722
|
{
|
|
17678
17723
|
className: "m-b-3",
|
|
@@ -17682,26 +17727,26 @@ function OrientationLockOverlay() {
|
|
|
17682
17727
|
alt: ""
|
|
17683
17728
|
}
|
|
17684
17729
|
),
|
|
17685
|
-
/* @__PURE__ */
|
|
17730
|
+
/* @__PURE__ */ jsx118("p", { className: "text-center m-b-0", children: intl.formatMessage(OrientationLockOverlay_messages_default.text) })
|
|
17686
17731
|
] });
|
|
17687
17732
|
}
|
|
17688
17733
|
var OrientationLockOverlay_default = OrientationLockOverlay;
|
|
17689
17734
|
|
|
17690
17735
|
// src/legacy/step/cameraStep/cameraCapture/screens/cameraErrorScreen/CameraErrorScreen.tsx
|
|
17691
17736
|
import { Button as Button11 } from "@transferwise/components";
|
|
17692
|
-
import { jsx as
|
|
17737
|
+
import { jsx as jsx119, jsxs as jsxs48 } from "react/jsx-runtime";
|
|
17693
17738
|
function CameraErrorScreen({ title, description, actionButton, onAction }) {
|
|
17694
|
-
return /* @__PURE__ */
|
|
17695
|
-
/* @__PURE__ */
|
|
17696
|
-
/* @__PURE__ */
|
|
17697
|
-
onAction && actionButton && /* @__PURE__ */
|
|
17739
|
+
return /* @__PURE__ */ jsx119("div", { className: "container p-t-5", children: /* @__PURE__ */ jsx119("div", { className: "row", children: /* @__PURE__ */ jsxs48("div", { className: "col-md-6 col-md-offset-3", children: [
|
|
17740
|
+
/* @__PURE__ */ jsx119("h2", { className: "text-xs-center m-b-3", children: title }),
|
|
17741
|
+
/* @__PURE__ */ jsx119("p", { className: "text-xs-center m-b-5", children: description }),
|
|
17742
|
+
onAction && actionButton && /* @__PURE__ */ jsx119(Button11, { block: true, onClick: onAction, children: actionButton })
|
|
17698
17743
|
] }) }) });
|
|
17699
17744
|
}
|
|
17700
17745
|
var CameraErrorScreen_default = CameraErrorScreen;
|
|
17701
17746
|
|
|
17702
17747
|
// src/legacy/step/cameraStep/cameraCapture/hooks/useFullScreenOrientationLock.ts
|
|
17703
17748
|
var import_screenfull = __toESM(require_screenfull());
|
|
17704
|
-
import { useCallback as useCallback9, useEffect as
|
|
17749
|
+
import { useCallback as useCallback9, useEffect as useEffect21 } from "react";
|
|
17705
17750
|
|
|
17706
17751
|
// src/legacy/step/cameraStep/cameraCapture/utils/index.ts
|
|
17707
17752
|
var isSelfieCamera = (stream) => {
|
|
@@ -17814,7 +17859,7 @@ var useFullScreenOrientationLock = (shouldLockOrientation, onEvent) => {
|
|
|
17814
17859
|
},
|
|
17815
17860
|
[onEvent]
|
|
17816
17861
|
);
|
|
17817
|
-
|
|
17862
|
+
useEffect21(() => {
|
|
17818
17863
|
var _a, _b;
|
|
17819
17864
|
if (shouldLockOrientation) {
|
|
17820
17865
|
(_b = (_a = window.screen) == null ? void 0 : _a.orientation) == null ? void 0 : _b.addEventListener(
|
|
@@ -17837,7 +17882,7 @@ var noop5 = () => {
|
|
|
17837
17882
|
};
|
|
17838
17883
|
|
|
17839
17884
|
// src/legacy/step/cameraStep/cameraCapture/hooks/useVideoConstraints.ts
|
|
17840
|
-
import { useEffect as
|
|
17885
|
+
import { useEffect as useEffect22, useState as useState29 } from "react";
|
|
17841
17886
|
var useVideoConstraints = (direction) => {
|
|
17842
17887
|
const [videoConstraints, setVideoConstraints] = useState29();
|
|
17843
17888
|
const defaultVideoConstraints = {
|
|
@@ -17847,7 +17892,7 @@ var useVideoConstraints = (direction) => {
|
|
|
17847
17892
|
frameRate: 30,
|
|
17848
17893
|
aspectRatio: 16 / 9
|
|
17849
17894
|
};
|
|
17850
|
-
|
|
17895
|
+
useEffect22(() => {
|
|
17851
17896
|
void getVideoConstraints(direction).then(setVideoConstraints);
|
|
17852
17897
|
}, [direction]);
|
|
17853
17898
|
const getVideoConstraints = async (direction2) => {
|
|
@@ -17865,8 +17910,8 @@ var useVideoConstraints = (direction) => {
|
|
|
17865
17910
|
};
|
|
17866
17911
|
|
|
17867
17912
|
// src/legacy/step/cameraStep/cameraCapture/overlay/Overlay.tsx
|
|
17868
|
-
import { useEffect as
|
|
17869
|
-
import { Fragment as
|
|
17913
|
+
import { useEffect as useEffect23, useRef as useRef7 } from "react";
|
|
17914
|
+
import { Fragment as Fragment23, jsx as jsx120, jsxs as jsxs49 } from "react/jsx-runtime";
|
|
17870
17915
|
var captureButtonHeight = 92;
|
|
17871
17916
|
var reviewButtonsHeight = 120;
|
|
17872
17917
|
var imageHeight = 40;
|
|
@@ -17876,7 +17921,7 @@ var reviewInstructionsHeight = 40;
|
|
|
17876
17921
|
var overlayMaxWidth = 800;
|
|
17877
17922
|
function Overlay({ overlay, outline, imageUrl, title, instructions, reviewInstructions }) {
|
|
17878
17923
|
const svgReference = useRef7(null);
|
|
17879
|
-
|
|
17924
|
+
useEffect23(() => {
|
|
17880
17925
|
const listener = debounce2(() => {
|
|
17881
17926
|
var _a;
|
|
17882
17927
|
if ((_a = svgReference.current) == null ? void 0 : _a.innerHTML) {
|
|
@@ -17888,18 +17933,18 @@ function Overlay({ overlay, outline, imageUrl, title, instructions, reviewInstru
|
|
|
17888
17933
|
return () => window.removeEventListener("resize", listener);
|
|
17889
17934
|
});
|
|
17890
17935
|
let helperBoxHeight = (imageUrl ? imageHeight : 0) + (title ? titleHeight : 0) + (instructions ? instructionsHeight : 0);
|
|
17891
|
-
let helperBox = /* @__PURE__ */
|
|
17892
|
-
imageUrl && /* @__PURE__ */
|
|
17893
|
-
title && /* @__PURE__ */
|
|
17894
|
-
instructions && /* @__PURE__ */
|
|
17936
|
+
let helperBox = /* @__PURE__ */ jsxs49(Fragment23, { children: [
|
|
17937
|
+
imageUrl && /* @__PURE__ */ jsx120("img", { className: "camera-capture-img", src: imageUrl, alt: "" }),
|
|
17938
|
+
title && /* @__PURE__ */ jsx120("h4", { className: "camera-capture-title", children: title }),
|
|
17939
|
+
instructions && /* @__PURE__ */ jsx120("small", { className: "camera-capture-instructions", children: instructions })
|
|
17895
17940
|
] });
|
|
17896
17941
|
const frameBottomMargin = captureButtonHeight + helperBoxHeight;
|
|
17897
17942
|
if (reviewInstructions) {
|
|
17898
17943
|
helperBoxHeight = frameBottomMargin - reviewButtonsHeight;
|
|
17899
|
-
helperBox = /* @__PURE__ */
|
|
17944
|
+
helperBox = /* @__PURE__ */ jsx120("small", { className: "camera-capture-instructions", children: reviewInstructions });
|
|
17900
17945
|
const frameWithReviewInstructionsMinBottomMargin = reviewButtonsHeight + reviewInstructionsHeight;
|
|
17901
17946
|
if (frameBottomMargin < frameWithReviewInstructionsMinBottomMargin) {
|
|
17902
|
-
helperBox = /* @__PURE__ */
|
|
17947
|
+
helperBox = /* @__PURE__ */ jsx120(Fragment23, {});
|
|
17903
17948
|
}
|
|
17904
17949
|
}
|
|
17905
17950
|
const framePosition = {
|
|
@@ -17917,20 +17962,20 @@ function Overlay({ overlay, outline, imageUrl, title, instructions, reviewInstru
|
|
|
17917
17962
|
width: "90%"
|
|
17918
17963
|
}
|
|
17919
17964
|
};
|
|
17920
|
-
return /* @__PURE__ */
|
|
17921
|
-
/* @__PURE__ */
|
|
17922
|
-
/* @__PURE__ */
|
|
17923
|
-
/* @__PURE__ */
|
|
17965
|
+
return /* @__PURE__ */ jsxs49("svg", { ref: svgReference, xmlns: "http://www.w3.org/2000/svg", children: [
|
|
17966
|
+
/* @__PURE__ */ jsx120("defs", { children: /* @__PURE__ */ jsxs49("mask", { id: "mask", children: [
|
|
17967
|
+
/* @__PURE__ */ jsx120("rect", { width: "100%", height: "100%", fill: "#fff" }),
|
|
17968
|
+
/* @__PURE__ */ jsx120("image", __spreadValues({ href: overlay }, framePosition))
|
|
17924
17969
|
] }) }),
|
|
17925
|
-
overlay && /* @__PURE__ */
|
|
17926
|
-
outline && /* @__PURE__ */
|
|
17927
|
-
/* @__PURE__ */
|
|
17970
|
+
overlay && /* @__PURE__ */ jsx120("rect", { width: "100%", height: "100%", mask: "url(#mask)", fillOpacity: "0.72" }),
|
|
17971
|
+
outline && /* @__PURE__ */ jsx120("image", __spreadValues({ href: outline }, framePosition)),
|
|
17972
|
+
/* @__PURE__ */ jsx120("foreignObject", { width: "100%", height: "100%", children: /* @__PURE__ */ jsx120("div", __spreadProps(__spreadValues({ className: "camera-capture-text-and-image-container" }, helperBoxPosition), { children: helperBox })) })
|
|
17928
17973
|
] });
|
|
17929
17974
|
}
|
|
17930
17975
|
var Overlay_default = Overlay;
|
|
17931
17976
|
|
|
17932
17977
|
// src/legacy/step/cameraStep/cameraCapture/CameraCapture.tsx
|
|
17933
|
-
import { jsx as
|
|
17978
|
+
import { jsx as jsx121, jsxs as jsxs50 } from "react/jsx-runtime";
|
|
17934
17979
|
function CameraCapture({
|
|
17935
17980
|
direction = "back",
|
|
17936
17981
|
overlay = "",
|
|
@@ -18033,13 +18078,13 @@ function CameraCapture({
|
|
|
18033
18078
|
setReviewImage(void 0);
|
|
18034
18079
|
};
|
|
18035
18080
|
const handleRetryCameraAccess = () => setMode("CAPTURE" /* CAPTURE */);
|
|
18036
|
-
|
|
18081
|
+
useEffect24(() => {
|
|
18037
18082
|
if (mode !== "CAPTURE" /* CAPTURE */) {
|
|
18038
18083
|
exitFullScreen();
|
|
18039
18084
|
}
|
|
18040
18085
|
}, [mode, exitFullScreen]);
|
|
18041
|
-
const captureScreen = /* @__PURE__ */
|
|
18042
|
-
videoConstraints && /* @__PURE__ */
|
|
18086
|
+
const captureScreen = /* @__PURE__ */ jsxs50("div", { className: "camera-capture", children: [
|
|
18087
|
+
videoConstraints && /* @__PURE__ */ jsx121(
|
|
18043
18088
|
Webcam,
|
|
18044
18089
|
{
|
|
18045
18090
|
ref: webcamReference,
|
|
@@ -18050,7 +18095,7 @@ function CameraCapture({
|
|
|
18050
18095
|
onUserMedia: handleUserMedia
|
|
18051
18096
|
}
|
|
18052
18097
|
),
|
|
18053
|
-
/* @__PURE__ */
|
|
18098
|
+
/* @__PURE__ */ jsx121(
|
|
18054
18099
|
Overlay_default,
|
|
18055
18100
|
{
|
|
18056
18101
|
overlay,
|
|
@@ -18060,8 +18105,8 @@ function CameraCapture({
|
|
|
18060
18105
|
instructions
|
|
18061
18106
|
}
|
|
18062
18107
|
),
|
|
18063
|
-
shouldLockOrientation && /* @__PURE__ */
|
|
18064
|
-
ready && /* @__PURE__ */
|
|
18108
|
+
shouldLockOrientation && /* @__PURE__ */ jsx121(OrientationLockOverlay_default, {}),
|
|
18109
|
+
ready && /* @__PURE__ */ jsx121(
|
|
18065
18110
|
CaptureBottomBar,
|
|
18066
18111
|
{
|
|
18067
18112
|
onCapture: () => {
|
|
@@ -18070,9 +18115,9 @@ function CameraCapture({
|
|
|
18070
18115
|
}
|
|
18071
18116
|
)
|
|
18072
18117
|
] });
|
|
18073
|
-
const reviewScreen = /* @__PURE__ */
|
|
18074
|
-
/* @__PURE__ */
|
|
18075
|
-
/* @__PURE__ */
|
|
18118
|
+
const reviewScreen = /* @__PURE__ */ jsxs50("div", { className: "camera-capture", children: [
|
|
18119
|
+
/* @__PURE__ */ jsx121("img", { className: "review-image", src: reviewImage == null ? void 0 : reviewImage.source, alt: "" }),
|
|
18120
|
+
/* @__PURE__ */ jsx121(
|
|
18076
18121
|
Overlay_default,
|
|
18077
18122
|
{
|
|
18078
18123
|
overlay,
|
|
@@ -18082,18 +18127,18 @@ function CameraCapture({
|
|
|
18082
18127
|
reviewInstructions: intl.formatMessage(CameraCapture_messages_default.reviewInstructions)
|
|
18083
18128
|
}
|
|
18084
18129
|
),
|
|
18085
|
-
/* @__PURE__ */
|
|
18130
|
+
/* @__PURE__ */ jsx121(ReviewBottomBar, { onSubmit: handleReviewSubmit, onRetry: handleReviewRetry })
|
|
18086
18131
|
] });
|
|
18087
|
-
return /* @__PURE__ */
|
|
18132
|
+
return /* @__PURE__ */ jsxs50("section", { children: [
|
|
18088
18133
|
mode === "CAPTURE" /* CAPTURE */ && captureScreen,
|
|
18089
18134
|
mode === "REVIEW" /* REVIEW */ && reviewScreen,
|
|
18090
|
-
mode === "ERROR" /* ERROR */ && cameraError && /* @__PURE__ */
|
|
18135
|
+
mode === "ERROR" /* ERROR */ && cameraError && /* @__PURE__ */ jsx121(CameraErrorScreen_default, __spreadValues({}, cameraError))
|
|
18091
18136
|
] });
|
|
18092
18137
|
}
|
|
18093
18138
|
var CameraCapture_default = CameraCapture;
|
|
18094
18139
|
|
|
18095
18140
|
// src/legacy/step/cameraStep/CameraStep.tsx
|
|
18096
|
-
import { jsx as
|
|
18141
|
+
import { jsx as jsx122 } from "react/jsx-runtime";
|
|
18097
18142
|
function blobToBase64(blob) {
|
|
18098
18143
|
return new Promise((resolve, _) => {
|
|
18099
18144
|
const reader = new FileReader();
|
|
@@ -18112,7 +18157,7 @@ function CameraStep(props) {
|
|
|
18112
18157
|
const { overlay, outline } = assets || {};
|
|
18113
18158
|
const { url: imageUrl } = image || {};
|
|
18114
18159
|
const [captureClicked, setCaptureClicked] = useState31(false);
|
|
18115
|
-
|
|
18160
|
+
useEffect25(() => {
|
|
18116
18161
|
if (captureClicked) {
|
|
18117
18162
|
onAction(action);
|
|
18118
18163
|
}
|
|
@@ -18131,7 +18176,7 @@ function CameraStep(props) {
|
|
|
18131
18176
|
});
|
|
18132
18177
|
}
|
|
18133
18178
|
};
|
|
18134
|
-
return /* @__PURE__ */
|
|
18179
|
+
return /* @__PURE__ */ jsx122(
|
|
18135
18180
|
CameraCapture_default,
|
|
18136
18181
|
{
|
|
18137
18182
|
overlay,
|
|
@@ -18181,12 +18226,12 @@ function getFirstAction(step) {
|
|
|
18181
18226
|
|
|
18182
18227
|
// src/legacy/step/externalConfirmationStep/ExternalConfirmationStep.tsx
|
|
18183
18228
|
import { useIntl as useIntl23 } from "react-intl";
|
|
18184
|
-
import { jsx as
|
|
18229
|
+
import { jsx as jsx123 } from "react/jsx-runtime";
|
|
18185
18230
|
var noop6 = () => {
|
|
18186
18231
|
};
|
|
18187
18232
|
function ExternalConfirmationStep({ url, onClose }) {
|
|
18188
18233
|
const { formatMessage } = useIntl23();
|
|
18189
|
-
return /* @__PURE__ */
|
|
18234
|
+
return /* @__PURE__ */ jsx123(
|
|
18190
18235
|
DynamicLayout_default,
|
|
18191
18236
|
{
|
|
18192
18237
|
components: [
|
|
@@ -18253,9 +18298,9 @@ function getOrigin2(url) {
|
|
|
18253
18298
|
// src/legacy/dynamicFlow/BackButton.tsx
|
|
18254
18299
|
import { Avatar as Avatar7 } from "@transferwise/components";
|
|
18255
18300
|
import { ArrowLeft as ArrowLeft2 } from "@transferwise/icons";
|
|
18256
|
-
import { jsx as
|
|
18301
|
+
import { jsx as jsx124, jsxs as jsxs51 } from "react/jsx-runtime";
|
|
18257
18302
|
function BackButton2({ title, action, onAction }) {
|
|
18258
|
-
return /* @__PURE__ */
|
|
18303
|
+
return /* @__PURE__ */ jsxs51(
|
|
18259
18304
|
"a",
|
|
18260
18305
|
{
|
|
18261
18306
|
href: "/",
|
|
@@ -18266,8 +18311,8 @@ function BackButton2({ title, action, onAction }) {
|
|
|
18266
18311
|
onAction(__spreadProps(__spreadValues({}, action), { skipValidation: true }));
|
|
18267
18312
|
},
|
|
18268
18313
|
children: [
|
|
18269
|
-
/* @__PURE__ */
|
|
18270
|
-
/* @__PURE__ */
|
|
18314
|
+
/* @__PURE__ */ jsx124("span", { className: "sr-only", children: title }),
|
|
18315
|
+
/* @__PURE__ */ jsx124(Avatar7, { type: "icon", children: /* @__PURE__ */ jsx124(ArrowLeft2, { size: "24" }) })
|
|
18271
18316
|
]
|
|
18272
18317
|
}
|
|
18273
18318
|
);
|
|
@@ -18275,7 +18320,7 @@ function BackButton2({ title, action, onAction }) {
|
|
|
18275
18320
|
var BackButton_default2 = BackButton2;
|
|
18276
18321
|
|
|
18277
18322
|
// src/legacy/dynamicFlow/DynamicFlowStep.tsx
|
|
18278
|
-
import { Fragment as
|
|
18323
|
+
import { Fragment as Fragment24, jsx as jsx125, jsxs as jsxs52 } from "react/jsx-runtime";
|
|
18279
18324
|
function DynamicFlowStep(props) {
|
|
18280
18325
|
var _a, _b, _c;
|
|
18281
18326
|
const { step, globalError, onAction } = props;
|
|
@@ -18284,20 +18329,20 @@ function DynamicFlowStep(props) {
|
|
|
18284
18329
|
const { requiresManualTrigger, dismissConfirmation } = useExternal2(externalUrl);
|
|
18285
18330
|
if (step === void 0) {
|
|
18286
18331
|
if (globalError) {
|
|
18287
|
-
return /* @__PURE__ */
|
|
18332
|
+
return /* @__PURE__ */ jsx125(DynamicAlert_default, { component: { context: "negative", markdown: globalError, margin: "lg" } });
|
|
18288
18333
|
}
|
|
18289
18334
|
return null;
|
|
18290
18335
|
}
|
|
18291
18336
|
if (externalUrl && requiresManualTrigger) {
|
|
18292
|
-
return /* @__PURE__ */
|
|
18337
|
+
return /* @__PURE__ */ jsx125(ExternalConfirmationStep_default, { url: externalUrl, onClose: dismissConfirmation });
|
|
18293
18338
|
}
|
|
18294
18339
|
if (isCameraStep(step)) {
|
|
18295
|
-
return /* @__PURE__ */
|
|
18340
|
+
return /* @__PURE__ */ jsx125(CameraStep_default, __spreadProps(__spreadValues({}, props), { step }));
|
|
18296
18341
|
}
|
|
18297
|
-
return /* @__PURE__ */
|
|
18298
|
-
backButton && /* @__PURE__ */
|
|
18299
|
-
globalError ? /* @__PURE__ */
|
|
18300
|
-
/* @__PURE__ */
|
|
18342
|
+
return /* @__PURE__ */ jsxs52(Fragment24, { children: [
|
|
18343
|
+
backButton && /* @__PURE__ */ jsx125(BackButton_default2, __spreadProps(__spreadValues({}, backButton), { onAction })),
|
|
18344
|
+
globalError ? /* @__PURE__ */ jsx125(DynamicAlert_default, { component: { context: "negative", markdown: globalError, margin: "lg" } }) : null,
|
|
18345
|
+
/* @__PURE__ */ jsx125(LayoutStep_default, __spreadProps(__spreadValues({}, props), { stepSpecification: step }))
|
|
18301
18346
|
] });
|
|
18302
18347
|
}
|
|
18303
18348
|
|
|
@@ -18446,7 +18491,7 @@ var isInlineSchema = (schema) => schema !== void 0 && typeof schema === "object"
|
|
|
18446
18491
|
// src/legacy/dynamicFlow/utils/useLoader.tsx
|
|
18447
18492
|
import { Loader as Loader4, Size as Size4 } from "@transferwise/components";
|
|
18448
18493
|
import { useState as useState33 } from "react";
|
|
18449
|
-
import { jsx as
|
|
18494
|
+
import { jsx as jsx126 } from "react/jsx-runtime";
|
|
18450
18495
|
function useLoader(loaderConfig, initialState) {
|
|
18451
18496
|
const config = __spreadValues({
|
|
18452
18497
|
size: Size4.EXTRA_LARGE,
|
|
@@ -18455,7 +18500,7 @@ function useLoader(loaderConfig, initialState) {
|
|
|
18455
18500
|
}, loaderConfig);
|
|
18456
18501
|
const [loadingState, setLoadingState] = useState33(initialState);
|
|
18457
18502
|
const shouldDisplayLoader = config.initial && loadingState === "initial" || config.submission && loadingState === "submission";
|
|
18458
|
-
const loader = shouldDisplayLoader ? /* @__PURE__ */
|
|
18503
|
+
const loader = shouldDisplayLoader ? /* @__PURE__ */ jsx126(
|
|
18459
18504
|
Loader4,
|
|
18460
18505
|
{
|
|
18461
18506
|
size: config.size,
|
|
@@ -18557,8 +18602,25 @@ var assertResponseIsValid2 = (response) => {
|
|
|
18557
18602
|
};
|
|
18558
18603
|
var isResponse2 = (response) => typeof response === "object" && response !== null && "clone" in response && "bodyUsed" in response;
|
|
18559
18604
|
|
|
18605
|
+
// src/legacy/dynamicFlow/utils/useErrorResponse.tsx
|
|
18606
|
+
import { useIntl as useIntl24 } from "react-intl";
|
|
18607
|
+
var useErrorResponse = () => {
|
|
18608
|
+
const { formatMessage } = useIntl24();
|
|
18609
|
+
return async (response, fetchType) => {
|
|
18610
|
+
try {
|
|
18611
|
+
const errorResponse = await parseErrorResponse(response);
|
|
18612
|
+
return errorResponse;
|
|
18613
|
+
} catch (error) {
|
|
18614
|
+
if (fetchType === "submission") {
|
|
18615
|
+
return { error: formatMessage(generic_error_messages_default.genericErrorRetryHint) };
|
|
18616
|
+
}
|
|
18617
|
+
throw error;
|
|
18618
|
+
}
|
|
18619
|
+
};
|
|
18620
|
+
};
|
|
18621
|
+
|
|
18560
18622
|
// src/legacy/dynamicFlow/DynamicFlow.tsx
|
|
18561
|
-
import { jsx as
|
|
18623
|
+
import { jsx as jsx127 } from "react/jsx-runtime";
|
|
18562
18624
|
var noop7 = () => {
|
|
18563
18625
|
};
|
|
18564
18626
|
var DynamicFlowComponent = ({
|
|
@@ -18673,10 +18735,10 @@ var DynamicFlowComponent = ({
|
|
|
18673
18735
|
},
|
|
18674
18736
|
[onCompletion, dispatchEvent]
|
|
18675
18737
|
);
|
|
18676
|
-
|
|
18738
|
+
useEffect26(() => {
|
|
18677
18739
|
dispatchEvent("Dynamic Flow - Flow Started", {});
|
|
18678
18740
|
}, []);
|
|
18679
|
-
|
|
18741
|
+
useEffect26(() => {
|
|
18680
18742
|
if (!initialStep) {
|
|
18681
18743
|
const action = __spreadValues({
|
|
18682
18744
|
id: "#initial-step-request",
|
|
@@ -18688,6 +18750,7 @@ var DynamicFlowComponent = ({
|
|
|
18688
18750
|
warnIfNoStepLayout(initialStep);
|
|
18689
18751
|
}
|
|
18690
18752
|
}, [httpClient, JSON.stringify(initialStep), JSON.stringify(initialAction)]);
|
|
18753
|
+
const getErrorResponse = useErrorResponse();
|
|
18691
18754
|
const handleResponse = async (response, fetchType, actionResult) => {
|
|
18692
18755
|
try {
|
|
18693
18756
|
if (response.status === 304) {
|
|
@@ -18695,7 +18758,7 @@ var DynamicFlowComponent = ({
|
|
|
18695
18758
|
return;
|
|
18696
18759
|
}
|
|
18697
18760
|
if (!response.ok) {
|
|
18698
|
-
const errorResponse = await
|
|
18761
|
+
const errorResponse = await getErrorResponse(response, fetchType);
|
|
18699
18762
|
void updateAfterError(errorResponse);
|
|
18700
18763
|
return;
|
|
18701
18764
|
}
|
|
@@ -18796,7 +18859,7 @@ var DynamicFlowComponent = ({
|
|
|
18796
18859
|
await performAction(action);
|
|
18797
18860
|
}
|
|
18798
18861
|
};
|
|
18799
|
-
return /* @__PURE__ */
|
|
18862
|
+
return /* @__PURE__ */ jsx127(LogProvider, { flowId, stepId: (step == null ? void 0 : step.id) || (step == null ? void 0 : step.key), onLog, children: /* @__PURE__ */ jsx127(EventsContextProvider, { metadata: analyticsMetadata, onEvent, children: /* @__PURE__ */ jsx127(DynamicFlowProvider, { loading: isLoading || isDebouncing, children: /* @__PURE__ */ jsx127(HttpClientProvider, { httpClient, children: /* @__PURE__ */ jsx127(FeatureContextProvider, { features, children: loader !== null ? loader : /* @__PURE__ */ jsx127(
|
|
18800
18863
|
DynamicFlowStep,
|
|
18801
18864
|
{
|
|
18802
18865
|
step,
|
|
@@ -18813,7 +18876,7 @@ var DynamicFlowComponent = ({
|
|
|
18813
18876
|
) }) }) }) }) });
|
|
18814
18877
|
};
|
|
18815
18878
|
function DynamicFlow(props) {
|
|
18816
|
-
return /* @__PURE__ */
|
|
18879
|
+
return /* @__PURE__ */ jsx127(ErrorBoundary_default, { onError: props.onError, children: /* @__PURE__ */ jsx127(DynamicFlowComponent, __spreadValues({}, props)) });
|
|
18817
18880
|
}
|
|
18818
18881
|
var DynamicFlow_default = DynamicFlow;
|
|
18819
18882
|
var combineModels2 = (formModels) => Object.values(formModels).reduce((previous, model) => __spreadValues(__spreadValues({}, previous), model), {});
|
|
@@ -18830,19 +18893,19 @@ var shouldTriggerRefresh = (props) => {
|
|
|
18830
18893
|
};
|
|
18831
18894
|
|
|
18832
18895
|
// src/legacy/jsonSchemaForm/JsonSchemaForm.tsx
|
|
18833
|
-
import { jsx as
|
|
18896
|
+
import { jsx as jsx128 } from "react/jsx-runtime";
|
|
18834
18897
|
function JsonSchemaForm(props) {
|
|
18835
18898
|
const schemaProps = __spreadValues({
|
|
18836
18899
|
model: null,
|
|
18837
18900
|
errors: null
|
|
18838
18901
|
}, props);
|
|
18839
18902
|
const { baseUrl = "", onEvent = noop8, onLog = noop8 } = props;
|
|
18840
|
-
return /* @__PURE__ */
|
|
18903
|
+
return /* @__PURE__ */ jsx128(LogProvider, { flowId: "JsonSchemaForm", stepId: "JsonSchemaForm", onLog, children: /* @__PURE__ */ jsx128(
|
|
18841
18904
|
EventsContextProvider,
|
|
18842
18905
|
{
|
|
18843
18906
|
metadata: { flowId: "JsonSchemaForm", stepId: "JsonSchemaForm" },
|
|
18844
18907
|
onEvent,
|
|
18845
|
-
children: /* @__PURE__ */
|
|
18908
|
+
children: /* @__PURE__ */ jsx128(HttpClientProviderFromBaseUrl, { baseUrl, children: /* @__PURE__ */ jsx128(GenericSchema_default, __spreadValues({}, schemaProps)) })
|
|
18846
18909
|
}
|
|
18847
18910
|
) });
|
|
18848
18911
|
}
|