@wise/dynamic-flow-client 3.9.1-experimental-152372b → 3.9.2-experimental-535221d
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/legacy/dynamicFlow/DynamicFlow.js +5 -5
- package/build/legacy/dynamicFlow/tests/Actions.spec.js +50 -3
- package/build/legacy/formControl/FormControl.js +6 -4
- package/build/legacy/jsonSchemaForm/JsonSchemaForm.end-to-end.spec.js +0 -29
- package/build/legacy/jsonSchemaForm/oneOfSchema/OneOfSchema.js +1 -1
- package/build/legacy/jsonSchemaForm/schemaFormControl/SchemaFormControl.js +6 -2
- package/build/main.js +1241 -1183
- package/build/main.min.js +1 -1
- package/build/main.mjs +943 -885
- package/build/revamp/DynamicFlowCore.js +2 -3
- package/build/revamp/DynamicFragmentWise.js +1 -1
- package/build/revamp/flow/executeSubmission.js +2 -2
- package/build/revamp/tests/RefreshOnChange.with.Segmented.spec.js +447 -0
- package/build/revamp/tests/RefreshOnChange.with.Tabs.spec.js +57 -0
- package/build/revamp/tests/SegmentedControl.spec.js +48 -0
- package/build/revamp/tests/legacy/Actions.spec.js +242 -0
- package/build/revamp/wise/renderers/ButtonRenderer.js +1 -1
- package/build/revamp/wise/renderers/DecisionRenderer.js +1 -1
- package/build/revamp/wise/renderers/SearchRenderer/BlockSearchRendererComponent.js +1 -1
- package/build/revamp/wise/renderers/SearchRenderer/InlineSearchRendererComponent.js +1 -1
- package/build/revamp/wise/renderers/SelectInputRenderer/SegmentedInputRendererComponent.js +21 -0
- package/build/revamp/wise/renderers/SelectInputRenderer/SelectInputRenderer.js +3 -0
- package/build/revamp/wise/renderers/SelectInputRenderer/SelectInputRendererComponent.js +2 -2
- package/build/revamp/wise/renderers/getWiseRenderers.js +2 -0
- package/build/revamp/{renderers → wise/renderers}/step/ExternalConfirmationDialog.js +1 -1
- package/build/types/legacy/jsonSchemaForm/schemaFormControl/SchemaFormControl.d.ts +1 -0
- package/build/types/legacy/layout/utils/index.d.ts +1 -1
- package/build/types/revamp/wise/renderers/SelectInputRenderer/SegmentedInputRendererComponent.d.ts +2 -0
- package/build/types/revamp/wise/renderers/getWiseRenderers.d.ts +1 -1
- package/build/types/revamp/{renderers → wise/renderers}/step/BackButton.d.ts +1 -1
- package/build/types/revamp/wise/renderers/step/StepRenderer.d.ts +2 -0
- package/build/types/revamp/{renderers → wise/renderers}/step/StepRendererContext.d.ts +2 -2
- package/build/types/revamp/wise/renderers/utils/layout-utils.d.ts +1 -1
- package/package.json +3 -3
- package/build/types/revamp/renderers/step/StepRenderer.d.ts +0 -2
- /package/build/revamp/{renderers → wise/renderers}/step/BackButton.js +0 -0
- /package/build/revamp/{renderers → wise/renderers}/step/StepRenderer.js +0 -0
- /package/build/revamp/{renderers → wise/renderers}/step/StepRendererContext.js +0 -0
- /package/build/revamp/{renderers → wise/renderers}/step/useExternal.js +0 -0
- /package/build/types/revamp/{renderers → wise/renderers}/step/ExternalConfirmationDialog.d.ts +0 -0
- /package/build/types/revamp/{renderers → wise/renderers}/step/useExternal.d.ts +0 -0
package/build/main.mjs
CHANGED
|
@@ -1154,13 +1154,89 @@ var useHasHttpClientProvider = () => {
|
|
|
1154
1154
|
};
|
|
1155
1155
|
|
|
1156
1156
|
// src/revamp/DynamicFlowCore.tsx
|
|
1157
|
-
import { useMemo as
|
|
1157
|
+
import { useMemo as useMemo3 } from "react";
|
|
1158
|
+
|
|
1159
|
+
// src/common/errorBoundary/ErrorBoundary.tsx
|
|
1160
|
+
import { Component } from "react";
|
|
1161
|
+
|
|
1162
|
+
// src/common/errorBoundary/ErrorBoundaryAlert.tsx
|
|
1163
|
+
import { Alert, Sentiment } from "@transferwise/components";
|
|
1164
|
+
import { useIntl } from "react-intl";
|
|
1165
|
+
|
|
1166
|
+
// src/common/messages/generic-error.messages.ts
|
|
1167
|
+
import { defineMessages } from "react-intl";
|
|
1168
|
+
var generic_error_messages_default = defineMessages({
|
|
1169
|
+
genericErrorRetryHint: {
|
|
1170
|
+
id: "dynamicFlows.PersistAsyncSchema.genericError",
|
|
1171
|
+
defaultMessage: "Something went wrong, please try again.",
|
|
1172
|
+
description: "Generic error message for persist async schema"
|
|
1173
|
+
},
|
|
1174
|
+
genericError: {
|
|
1175
|
+
id: "dynamicFlows.ErrorBoundary.errorAlert",
|
|
1176
|
+
defaultMessage: "Something went wrong.",
|
|
1177
|
+
description: "Generic error message for when something has gone wrong."
|
|
1178
|
+
},
|
|
1179
|
+
retry: {
|
|
1180
|
+
id: "dynamicFlows.ErrorBoundary.retry",
|
|
1181
|
+
defaultMessage: "Retry",
|
|
1182
|
+
description: "Usually this follows the generic error and contains a link."
|
|
1183
|
+
}
|
|
1184
|
+
});
|
|
1185
|
+
|
|
1186
|
+
// src/common/errorBoundary/ErrorBoundaryAlert.tsx
|
|
1187
|
+
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
1188
|
+
function ErrorBoundaryAlert({ onDismiss }) {
|
|
1189
|
+
const { formatMessage } = useIntl();
|
|
1190
|
+
return /* @__PURE__ */ jsx2(
|
|
1191
|
+
Alert,
|
|
1192
|
+
{
|
|
1193
|
+
action: {
|
|
1194
|
+
text: formatMessage(generic_error_messages_default.retry),
|
|
1195
|
+
href: window.location.href
|
|
1196
|
+
},
|
|
1197
|
+
message: formatMessage(generic_error_messages_default.genericError),
|
|
1198
|
+
type: Sentiment.NEGATIVE,
|
|
1199
|
+
className: "m-b-3",
|
|
1200
|
+
onDismiss
|
|
1201
|
+
}
|
|
1202
|
+
);
|
|
1203
|
+
}
|
|
1204
|
+
|
|
1205
|
+
// src/common/errorBoundary/ErrorBoundary.tsx
|
|
1206
|
+
import { Fragment, jsx as jsx3, jsxs } from "react/jsx-runtime";
|
|
1207
|
+
var noop = () => {
|
|
1208
|
+
};
|
|
1209
|
+
var ErrorBoundary = class extends Component {
|
|
1210
|
+
constructor(props) {
|
|
1211
|
+
super(props);
|
|
1212
|
+
this.handleErrorReset = () => {
|
|
1213
|
+
this.setState({ hasError: false, isFatalError: false });
|
|
1214
|
+
};
|
|
1215
|
+
this.state = { hasError: false, isFatalError: false };
|
|
1216
|
+
}
|
|
1217
|
+
static getDerivedStateFromError() {
|
|
1218
|
+
return { hasError: true, isFatalError: true };
|
|
1219
|
+
}
|
|
1220
|
+
componentDidCatch(error) {
|
|
1221
|
+
const { onError = noop } = this.props;
|
|
1222
|
+
onError(error);
|
|
1223
|
+
}
|
|
1224
|
+
render() {
|
|
1225
|
+
const { children } = this.props;
|
|
1226
|
+
const { hasError, isFatalError } = this.state;
|
|
1227
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1228
|
+
hasError && /* @__PURE__ */ jsx3(ErrorBoundaryAlert, { onDismiss: this.handleErrorReset }),
|
|
1229
|
+
!isFatalError && children
|
|
1230
|
+
] });
|
|
1231
|
+
}
|
|
1232
|
+
};
|
|
1233
|
+
var ErrorBoundary_default = ErrorBoundary;
|
|
1158
1234
|
|
|
1159
1235
|
// src/revamp/renderers/CoreContainerRenderer.tsx
|
|
1160
|
-
import { Fragment, jsx as
|
|
1236
|
+
import { Fragment as Fragment2, jsx as jsx4 } from "react/jsx-runtime";
|
|
1161
1237
|
var CoreContainerRenderer = {
|
|
1162
1238
|
canRenderType: "container",
|
|
1163
|
-
render: ({ children }) => /* @__PURE__ */
|
|
1239
|
+
render: ({ children }) => /* @__PURE__ */ jsx4(Fragment2, { children })
|
|
1164
1240
|
};
|
|
1165
1241
|
|
|
1166
1242
|
// src/revamp/utils/type-validators.ts
|
|
@@ -1700,7 +1776,7 @@ var componentToRendererProps = (component, nestedContent) => {
|
|
|
1700
1776
|
};
|
|
1701
1777
|
|
|
1702
1778
|
// src/revamp/renderers/getRenderFunction.tsx
|
|
1703
|
-
import { jsx as
|
|
1779
|
+
import { jsx as jsx5 } from "react/jsx-runtime";
|
|
1704
1780
|
var getRenderFunction = (renderers) => {
|
|
1705
1781
|
function ComponentRenderer(props) {
|
|
1706
1782
|
const { type } = props;
|
|
@@ -1739,7 +1815,7 @@ var getRenderFunction = (renderers) => {
|
|
|
1739
1815
|
children: component.getChildren().map(render)
|
|
1740
1816
|
};
|
|
1741
1817
|
};
|
|
1742
|
-
const render = (component) => /* @__PURE__ */
|
|
1818
|
+
const render = (component) => /* @__PURE__ */ jsx5(
|
|
1743
1819
|
ComponentRenderer,
|
|
1744
1820
|
__spreadValues({}, componentToRendererProps(component, getNestedContent(component))),
|
|
1745
1821
|
component.uid
|
|
@@ -1747,148 +1823,6 @@ var getRenderFunction = (renderers) => {
|
|
|
1747
1823
|
return render;
|
|
1748
1824
|
};
|
|
1749
1825
|
|
|
1750
|
-
// src/revamp/renderers/step/StepRenderer.tsx
|
|
1751
|
-
import { useMemo as useMemo2 } from "react";
|
|
1752
|
-
|
|
1753
|
-
// src/revamp/renderers/step/ExternalConfirmationDialog.tsx
|
|
1754
|
-
import { useIntl } from "react-intl";
|
|
1755
|
-
|
|
1756
|
-
// src/common/messages/external-confirmation.messages.ts
|
|
1757
|
-
import { defineMessages } from "react-intl";
|
|
1758
|
-
var external_confirmation_messages_default = defineMessages({
|
|
1759
|
-
title: {
|
|
1760
|
-
id: "dynamicFlows.ExternalConfirmation.title",
|
|
1761
|
-
defaultMessage: "Please confirm",
|
|
1762
|
-
description: "Heading for the confirmation screen."
|
|
1763
|
-
},
|
|
1764
|
-
description: {
|
|
1765
|
-
id: "dynamicFlows.ExternalConfirmation.description",
|
|
1766
|
-
defaultMessage: "Please confirm you want to open **{origin}** in a new browser tab.",
|
|
1767
|
-
description: "Description for the confirmation screen."
|
|
1768
|
-
},
|
|
1769
|
-
open: {
|
|
1770
|
-
id: "dynamicFlows.ExternalConfirmation.open",
|
|
1771
|
-
defaultMessage: "Open in new tab",
|
|
1772
|
-
description: "Button text confirming opening a new browser tab."
|
|
1773
|
-
},
|
|
1774
|
-
cancel: {
|
|
1775
|
-
id: "dynamicFlows.ExternalConfirmation.cancel",
|
|
1776
|
-
defaultMessage: "Cancel",
|
|
1777
|
-
description: "Button text rejecting opening a new browser tab."
|
|
1778
|
-
}
|
|
1779
|
-
});
|
|
1780
|
-
|
|
1781
|
-
// src/revamp/renderers/step/ExternalConfirmationDialog.tsx
|
|
1782
|
-
import { Button, Markdown } from "@transferwise/components";
|
|
1783
|
-
import { jsx as jsx4, jsxs } from "react/jsx-runtime";
|
|
1784
|
-
function ExternalConfirmationDialog({
|
|
1785
|
-
external,
|
|
1786
|
-
onClose
|
|
1787
|
-
}) {
|
|
1788
|
-
const { formatMessage } = useIntl();
|
|
1789
|
-
return /* @__PURE__ */ jsx4("div", { className: "df-box-renderer-fixed-width", children: /* @__PURE__ */ jsxs("div", { className: "df-box-renderer-width-lg", children: [
|
|
1790
|
-
/* @__PURE__ */ jsx4("h2", { className: "text-xs-center m-b-5", children: formatMessage(external_confirmation_messages_default.title) }),
|
|
1791
|
-
/* @__PURE__ */ jsx4(Markdown, { config: { link: { target: "_blank" } }, className: "text-xs-center m-b-5", children: formatMessage(external_confirmation_messages_default.description, { origin: getOrigin(external.url) }) }),
|
|
1792
|
-
/* @__PURE__ */ jsx4("div", { className: "df-box-renderer-fixed-width", children: /* @__PURE__ */ jsxs("div", { className: "df-box-renderer-width-lg", children: [
|
|
1793
|
-
/* @__PURE__ */ jsx4(
|
|
1794
|
-
Button,
|
|
1795
|
-
{
|
|
1796
|
-
block: true,
|
|
1797
|
-
className: "m-b-2",
|
|
1798
|
-
priority: "primary",
|
|
1799
|
-
size: "md",
|
|
1800
|
-
onClick: () => {
|
|
1801
|
-
window.open(external.url);
|
|
1802
|
-
onClose();
|
|
1803
|
-
},
|
|
1804
|
-
children: formatMessage(external_confirmation_messages_default.open)
|
|
1805
|
-
}
|
|
1806
|
-
),
|
|
1807
|
-
/* @__PURE__ */ jsx4(Button, { block: true, className: "m-b-2", priority: "tertiary", size: "md", onClick: onClose, children: formatMessage(external_confirmation_messages_default.cancel) })
|
|
1808
|
-
] }) })
|
|
1809
|
-
] }) });
|
|
1810
|
-
}
|
|
1811
|
-
function getOrigin(url) {
|
|
1812
|
-
try {
|
|
1813
|
-
return new URL(url).origin;
|
|
1814
|
-
} catch (e) {
|
|
1815
|
-
return url;
|
|
1816
|
-
}
|
|
1817
|
-
}
|
|
1818
|
-
|
|
1819
|
-
// src/revamp/renderers/step/StepRendererContext.tsx
|
|
1820
|
-
import { createContext as createContext2, useContext as useContext2 } from "react";
|
|
1821
|
-
var StepRendererContext = createContext2({ loadingState: "idle", trackEvent: () => {
|
|
1822
|
-
} });
|
|
1823
|
-
var StepRendererContextProvider = StepRendererContext.Provider;
|
|
1824
|
-
var useLoadingContext = () => {
|
|
1825
|
-
const { loadingState } = useContext2(StepRendererContext);
|
|
1826
|
-
return { loadingState, isLoading: loadingState !== "idle" };
|
|
1827
|
-
};
|
|
1828
|
-
var useTrackEvent = () => {
|
|
1829
|
-
const { trackEvent } = useContext2(StepRendererContext);
|
|
1830
|
-
return trackEvent;
|
|
1831
|
-
};
|
|
1832
|
-
|
|
1833
|
-
// src/revamp/renderers/step/useExternal.tsx
|
|
1834
|
-
import { useEffect, useState } from "react";
|
|
1835
|
-
function useExternal(url) {
|
|
1836
|
-
const [externalWindow, setExternalWindow] = useState(null);
|
|
1837
|
-
const [hasDismissed, setHasDismissed] = useState(false);
|
|
1838
|
-
const dismissConfirmation = () => setHasDismissed(true);
|
|
1839
|
-
useEffect(() => {
|
|
1840
|
-
if (url) {
|
|
1841
|
-
setHasDismissed(false);
|
|
1842
|
-
setExternalWindow(window.open(url, "_blank"));
|
|
1843
|
-
}
|
|
1844
|
-
}, [url]);
|
|
1845
|
-
const requiresUserConfirmation = Boolean(url && !externalWindow && !hasDismissed);
|
|
1846
|
-
return { requiresUserConfirmation, dismissConfirmation };
|
|
1847
|
-
}
|
|
1848
|
-
|
|
1849
|
-
// src/revamp/renderers/step/BackButton.tsx
|
|
1850
|
-
import { Avatar } from "@transferwise/components";
|
|
1851
|
-
import { ArrowLeft } from "@transferwise/icons";
|
|
1852
|
-
import { jsx as jsx5, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
1853
|
-
function BackButton({ title, onClick }) {
|
|
1854
|
-
return /* @__PURE__ */ jsxs2(
|
|
1855
|
-
"a",
|
|
1856
|
-
{
|
|
1857
|
-
href: "/",
|
|
1858
|
-
className: "df-back-btn",
|
|
1859
|
-
"aria-label": title,
|
|
1860
|
-
onClick: (event) => {
|
|
1861
|
-
event.preventDefault();
|
|
1862
|
-
onClick();
|
|
1863
|
-
},
|
|
1864
|
-
children: [
|
|
1865
|
-
/* @__PURE__ */ jsx5("span", { className: "sr-only", children: title }),
|
|
1866
|
-
/* @__PURE__ */ jsx5(Avatar, { type: "icon", children: /* @__PURE__ */ jsx5(ArrowLeft, { size: "24" }) })
|
|
1867
|
-
]
|
|
1868
|
-
}
|
|
1869
|
-
);
|
|
1870
|
-
}
|
|
1871
|
-
var BackButton_default = BackButton;
|
|
1872
|
-
|
|
1873
|
-
// src/revamp/renderers/step/StepRenderer.tsx
|
|
1874
|
-
import { jsx as jsx6, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
1875
|
-
var StepRenderer = {
|
|
1876
|
-
canRenderType: "step",
|
|
1877
|
-
render: StepRendererComponent
|
|
1878
|
-
};
|
|
1879
|
-
function StepRendererComponent(props) {
|
|
1880
|
-
const { back, loadingState, external, trackEvent, children } = props;
|
|
1881
|
-
const value = useMemo2(() => ({ loadingState, trackEvent }), [loadingState, trackEvent]);
|
|
1882
|
-
const { requiresUserConfirmation, dismissConfirmation } = useExternal(external == null ? void 0 : external.url);
|
|
1883
|
-
if ((external == null ? void 0 : external.url) && requiresUserConfirmation) {
|
|
1884
|
-
return /* @__PURE__ */ jsx6(ExternalConfirmationDialog, { external, onClose: dismissConfirmation });
|
|
1885
|
-
}
|
|
1886
|
-
return /* @__PURE__ */ jsxs3(StepRendererContextProvider, { value, children: [
|
|
1887
|
-
back ? /* @__PURE__ */ jsx6(BackButton_default, __spreadValues({}, back)) : null,
|
|
1888
|
-
children
|
|
1889
|
-
] });
|
|
1890
|
-
}
|
|
1891
|
-
|
|
1892
1826
|
// ../types/build/main.mjs
|
|
1893
1827
|
var __defProp2 = Object.defineProperty;
|
|
1894
1828
|
var __defProps2 = Object.defineProperties;
|
|
@@ -6370,7 +6304,7 @@ var flattenZodErrors = (zodError) => zodError.flatMap((e) => {
|
|
|
6370
6304
|
}).filter(Boolean);
|
|
6371
6305
|
|
|
6372
6306
|
// src/revamp/useDynamicFlowCore.tsx
|
|
6373
|
-
import { useCallback as useCallback2, useEffect
|
|
6307
|
+
import { useCallback as useCallback2, useEffect, useMemo as useMemo2, useRef as useRef2, useState } from "react";
|
|
6374
6308
|
import { useIntl as useIntl2 } from "react-intl";
|
|
6375
6309
|
|
|
6376
6310
|
// src/revamp/utils/component-utils.ts
|
|
@@ -9729,7 +9663,7 @@ var executeSubmission = async (props) => {
|
|
|
9729
9663
|
const responseType = await getResponseType(response);
|
|
9730
9664
|
const body = await parseResponseBodyAsJsonElement(response);
|
|
9731
9665
|
if (exit) {
|
|
9732
|
-
return { type: "complete", result: mergeModels(
|
|
9666
|
+
return { type: "complete", result: mergeModels(body, result) };
|
|
9733
9667
|
}
|
|
9734
9668
|
switch (responseType) {
|
|
9735
9669
|
case "step": {
|
|
@@ -9740,7 +9674,7 @@ var executeSubmission = async (props) => {
|
|
|
9740
9674
|
}
|
|
9741
9675
|
case "exit": {
|
|
9742
9676
|
trackSubmissionEvent("Action Succeeded", { actionId });
|
|
9743
|
-
return { type: "complete", result: mergeModels(
|
|
9677
|
+
return { type: "complete", result: mergeModels(body, result) };
|
|
9744
9678
|
}
|
|
9745
9679
|
case "action": {
|
|
9746
9680
|
assertActionResponseBody(body);
|
|
@@ -9829,29 +9763,9 @@ var validation_messages_default = defineMessages2({
|
|
|
9829
9763
|
}
|
|
9830
9764
|
});
|
|
9831
9765
|
|
|
9832
|
-
// src/common/messages/generic-error.messages.ts
|
|
9833
|
-
import { defineMessages as defineMessages3 } from "react-intl";
|
|
9834
|
-
var generic_error_messages_default = defineMessages3({
|
|
9835
|
-
genericErrorRetryHint: {
|
|
9836
|
-
id: "dynamicFlows.PersistAsyncSchema.genericError",
|
|
9837
|
-
defaultMessage: "Something went wrong, please try again.",
|
|
9838
|
-
description: "Generic error message for persist async schema"
|
|
9839
|
-
},
|
|
9840
|
-
genericError: {
|
|
9841
|
-
id: "dynamicFlows.ErrorBoundary.errorAlert",
|
|
9842
|
-
defaultMessage: "Something went wrong.",
|
|
9843
|
-
description: "Generic error message for when something has gone wrong."
|
|
9844
|
-
},
|
|
9845
|
-
retry: {
|
|
9846
|
-
id: "dynamicFlows.ErrorBoundary.retry",
|
|
9847
|
-
defaultMessage: "Retry",
|
|
9848
|
-
description: "Usually this follows the generic error and contains a link."
|
|
9849
|
-
}
|
|
9850
|
-
});
|
|
9851
|
-
|
|
9852
9766
|
// src/common/messages/multi-file-upload.messages.ts
|
|
9853
|
-
import { defineMessages as
|
|
9854
|
-
var multi_file_upload_messages_default =
|
|
9767
|
+
import { defineMessages as defineMessages3 } from "react-intl";
|
|
9768
|
+
var multi_file_upload_messages_default = defineMessages3({
|
|
9855
9769
|
minItemsError: {
|
|
9856
9770
|
id: "dynamicFlows.MultipleFileUploadSchema.minItemsError",
|
|
9857
9771
|
defaultMessage: "Please upload at least {minItems} file(s).",
|
|
@@ -9870,8 +9784,8 @@ var multi_file_upload_messages_default = defineMessages4({
|
|
|
9870
9784
|
});
|
|
9871
9785
|
|
|
9872
9786
|
// src/common/messages/validation.array.messages.ts
|
|
9873
|
-
import { defineMessages as
|
|
9874
|
-
var validation_array_messages_default =
|
|
9787
|
+
import { defineMessages as defineMessages4 } from "react-intl";
|
|
9788
|
+
var validation_array_messages_default = defineMessages4({
|
|
9875
9789
|
minItemsError: {
|
|
9876
9790
|
id: "dynamicFlows.ArraySchema.minItemsError",
|
|
9877
9791
|
defaultMessage: "Please add at least {minItems}.",
|
|
@@ -10008,11 +9922,11 @@ function useDynamicFlowCore(props) {
|
|
|
10008
9922
|
const onEvent = useStableCallback(rest.onEvent);
|
|
10009
9923
|
const onLog = useStableCallback(rest.onLog);
|
|
10010
9924
|
const { formatMessage, locale } = useIntl2();
|
|
10011
|
-
const getErrorMessageFunctions =
|
|
9925
|
+
const getErrorMessageFunctions = useMemo2(
|
|
10012
9926
|
() => getSchemaErrorMessageFunction(formatMessage, locale),
|
|
10013
9927
|
[formatMessage, locale]
|
|
10014
9928
|
);
|
|
10015
|
-
const [stepComponent, setStepComponent] =
|
|
9929
|
+
const [stepComponent, setStepComponent] = useState(null);
|
|
10016
9930
|
const stepComponentRef = useRef2(null);
|
|
10017
9931
|
const stepRef = useRef2(initialStep != null ? initialStep : null);
|
|
10018
9932
|
const etagRef = useRef2(null);
|
|
@@ -10022,7 +9936,7 @@ function useDynamicFlowCore(props) {
|
|
|
10022
9936
|
abortControllerRef.current = new AbortController();
|
|
10023
9937
|
return abortControllerRef.current.signal;
|
|
10024
9938
|
};
|
|
10025
|
-
|
|
9939
|
+
useEffect(() => {
|
|
10026
9940
|
trackCoreEvent("Initiated");
|
|
10027
9941
|
if (!initialStep && initialAction) {
|
|
10028
9942
|
void onAction(__spreadValues({ method: "GET" }, initialAction));
|
|
@@ -10202,70 +10116,16 @@ function useDynamicFlowCore(props) {
|
|
|
10202
10116
|
return { stepComponentRef };
|
|
10203
10117
|
}
|
|
10204
10118
|
|
|
10205
|
-
// src/common/errorBoundary/ErrorBoundary.tsx
|
|
10206
|
-
import { Component } from "react";
|
|
10207
|
-
|
|
10208
|
-
// src/common/errorBoundary/ErrorBoundaryAlert.tsx
|
|
10209
|
-
import { Alert, Sentiment } from "@transferwise/components";
|
|
10210
|
-
import { useIntl as useIntl3 } from "react-intl";
|
|
10211
|
-
import { jsx as jsx7 } from "react/jsx-runtime";
|
|
10212
|
-
function ErrorBoundaryAlert({ onDismiss }) {
|
|
10213
|
-
const { formatMessage } = useIntl3();
|
|
10214
|
-
return /* @__PURE__ */ jsx7(
|
|
10215
|
-
Alert,
|
|
10216
|
-
{
|
|
10217
|
-
action: {
|
|
10218
|
-
text: formatMessage(generic_error_messages_default.retry),
|
|
10219
|
-
href: window.location.href
|
|
10220
|
-
},
|
|
10221
|
-
message: formatMessage(generic_error_messages_default.genericError),
|
|
10222
|
-
type: Sentiment.NEGATIVE,
|
|
10223
|
-
className: "m-b-3",
|
|
10224
|
-
onDismiss
|
|
10225
|
-
}
|
|
10226
|
-
);
|
|
10227
|
-
}
|
|
10228
|
-
|
|
10229
|
-
// src/common/errorBoundary/ErrorBoundary.tsx
|
|
10230
|
-
import { Fragment as Fragment2, jsx as jsx8, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
10231
|
-
var noop = () => {
|
|
10232
|
-
};
|
|
10233
|
-
var ErrorBoundary = class extends Component {
|
|
10234
|
-
constructor(props) {
|
|
10235
|
-
super(props);
|
|
10236
|
-
this.handleErrorReset = () => {
|
|
10237
|
-
this.setState({ hasError: false, isFatalError: false });
|
|
10238
|
-
};
|
|
10239
|
-
this.state = { hasError: false, isFatalError: false };
|
|
10240
|
-
}
|
|
10241
|
-
static getDerivedStateFromError() {
|
|
10242
|
-
return { hasError: true, isFatalError: true };
|
|
10243
|
-
}
|
|
10244
|
-
componentDidCatch(error) {
|
|
10245
|
-
const { onError = noop } = this.props;
|
|
10246
|
-
onError(error);
|
|
10247
|
-
}
|
|
10248
|
-
render() {
|
|
10249
|
-
const { children } = this.props;
|
|
10250
|
-
const { hasError, isFatalError } = this.state;
|
|
10251
|
-
return /* @__PURE__ */ jsxs4(Fragment2, { children: [
|
|
10252
|
-
hasError && /* @__PURE__ */ jsx8(ErrorBoundaryAlert, { onDismiss: this.handleErrorReset }),
|
|
10253
|
-
!isFatalError && children
|
|
10254
|
-
] });
|
|
10255
|
-
}
|
|
10256
|
-
};
|
|
10257
|
-
var ErrorBoundary_default = ErrorBoundary;
|
|
10258
|
-
|
|
10259
10119
|
// src/revamp/DynamicFlowCore.tsx
|
|
10260
|
-
import { jsx as
|
|
10120
|
+
import { jsx as jsx6 } from "react/jsx-runtime";
|
|
10261
10121
|
function DynamicFlowCore(props) {
|
|
10262
10122
|
const { stepComponentRef } = useDynamicFlowCore(props);
|
|
10263
10123
|
const { renderers, onEvent, onError } = props;
|
|
10264
|
-
const render =
|
|
10265
|
-
() => getRenderFunction([CoreContainerRenderer, ...renderers
|
|
10124
|
+
const render = useMemo3(
|
|
10125
|
+
() => getRenderFunction([CoreContainerRenderer, ...renderers]),
|
|
10266
10126
|
[renderers]
|
|
10267
10127
|
);
|
|
10268
|
-
return /* @__PURE__ */
|
|
10128
|
+
return /* @__PURE__ */ jsx6(
|
|
10269
10129
|
ErrorBoundary_default,
|
|
10270
10130
|
{
|
|
10271
10131
|
onError: (error) => {
|
|
@@ -10311,10 +10171,10 @@ var getTextAlignment = (align) => {
|
|
|
10311
10171
|
var getTextAlignmentAndMargin = (component) => `${getTextAlignment(component.align)} ${getMargin(component.margin)}`;
|
|
10312
10172
|
|
|
10313
10173
|
// src/revamp/wise/renderers/AlertRenderer.tsx
|
|
10314
|
-
import { jsx as
|
|
10174
|
+
import { jsx as jsx7 } from "react/jsx-runtime";
|
|
10315
10175
|
var AlertRenderer = {
|
|
10316
10176
|
canRenderType: "alert",
|
|
10317
|
-
render: ({ context, markdown, margin }) => /* @__PURE__ */
|
|
10177
|
+
render: ({ context, markdown, margin }) => /* @__PURE__ */ jsx7(Alert2, { type: context, className: getMargin(margin), message: markdown })
|
|
10318
10178
|
};
|
|
10319
10179
|
var AlertRenderer_default = AlertRenderer;
|
|
10320
10180
|
|
|
@@ -10342,16 +10202,16 @@ function $1746a345f3d73bb7$export$f680877a34711e37(deterministicId) {
|
|
|
10342
10202
|
return deterministicId || (id ? `radix-${id}` : "");
|
|
10343
10203
|
}
|
|
10344
10204
|
|
|
10345
|
-
// ../../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
|
|
10346
10206
|
var import_classnames = __toESM(require_classnames(), 1);
|
|
10347
10207
|
import { InlineAlert, Sentiment as Sentiment2, Input, TextArea } from "@transferwise/components";
|
|
10348
|
-
import { createContext as
|
|
10349
|
-
import { jsx as
|
|
10350
|
-
var InputIdContext = /* @__PURE__ */
|
|
10208
|
+
import { createContext as createContext2, useContext as useContext2, forwardRef } from "react";
|
|
10209
|
+
import { jsx as jsx8, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
10210
|
+
var InputIdContext = /* @__PURE__ */ createContext2(void 0);
|
|
10351
10211
|
var InputIdContextProvider = InputIdContext.Provider;
|
|
10352
|
-
var FormControlDescribedByContext = /* @__PURE__ */
|
|
10212
|
+
var FormControlDescribedByContext = /* @__PURE__ */ createContext2(void 0);
|
|
10353
10213
|
var FormControlDescribedByProvider = FormControlDescribedByContext.Provider;
|
|
10354
|
-
var FormControlInvalidContext = /* @__PURE__ */
|
|
10214
|
+
var FormControlInvalidContext = /* @__PURE__ */ createContext2(void 0);
|
|
10355
10215
|
var FormControlInvalidProvider = FormControlInvalidContext.Provider;
|
|
10356
10216
|
var Label = ({
|
|
10357
10217
|
id,
|
|
@@ -10359,7 +10219,7 @@ var Label = ({
|
|
|
10359
10219
|
className,
|
|
10360
10220
|
children
|
|
10361
10221
|
}) => {
|
|
10362
|
-
return /* @__PURE__ */
|
|
10222
|
+
return /* @__PURE__ */ jsx8("label", {
|
|
10363
10223
|
id,
|
|
10364
10224
|
htmlFor,
|
|
10365
10225
|
className: (0, import_classnames.default)("control-label d-flex flex-column gap-y-1 m-b-0", className),
|
|
@@ -10379,25 +10239,25 @@ var Field = ({
|
|
|
10379
10239
|
const fallbackInputId = $1746a345f3d73bb7$export$f680877a34711e37();
|
|
10380
10240
|
const inputId = id !== null ? id != null ? id : fallbackInputId : void 0;
|
|
10381
10241
|
const descriptionId = $1746a345f3d73bb7$export$f680877a34711e37();
|
|
10382
|
-
return /* @__PURE__ */
|
|
10242
|
+
return /* @__PURE__ */ jsx8(InputIdContextProvider, {
|
|
10383
10243
|
value: inputId,
|
|
10384
|
-
children: /* @__PURE__ */
|
|
10244
|
+
children: /* @__PURE__ */ jsx8(FormControlDescribedByProvider, {
|
|
10385
10245
|
value: hasError || hasHint ? descriptionId : void 0,
|
|
10386
|
-
children: /* @__PURE__ */
|
|
10246
|
+
children: /* @__PURE__ */ jsx8(FormControlInvalidProvider, {
|
|
10387
10247
|
value: hasError,
|
|
10388
|
-
children: /* @__PURE__ */
|
|
10248
|
+
children: /* @__PURE__ */ jsxs2("div", {
|
|
10389
10249
|
className: (0, import_classnames.default)("form-group d-block", {
|
|
10390
10250
|
"has-error": hasError,
|
|
10391
10251
|
"has-info": hasHint
|
|
10392
10252
|
}, className),
|
|
10393
|
-
children: [/* @__PURE__ */
|
|
10253
|
+
children: [/* @__PURE__ */ jsxs2(Label, {
|
|
10394
10254
|
htmlFor: inputId,
|
|
10395
10255
|
children: [label, children]
|
|
10396
|
-
}), hasHint && /* @__PURE__ */
|
|
10256
|
+
}), hasHint && /* @__PURE__ */ jsx8(InlineAlert, {
|
|
10397
10257
|
type: Sentiment2.NEUTRAL,
|
|
10398
10258
|
id: descriptionId,
|
|
10399
10259
|
children: hint
|
|
10400
|
-
}), hasError && /* @__PURE__ */
|
|
10260
|
+
}), hasError && /* @__PURE__ */ jsx8(InlineAlert, {
|
|
10401
10261
|
type: Sentiment2.NEGATIVE,
|
|
10402
10262
|
id: descriptionId,
|
|
10403
10263
|
children: error
|
|
@@ -10409,12 +10269,12 @@ var Field = ({
|
|
|
10409
10269
|
};
|
|
10410
10270
|
|
|
10411
10271
|
// src/revamp/wise/renderers/components/Help.tsx
|
|
10412
|
-
import { Info, Markdown
|
|
10413
|
-
import { useIntl as
|
|
10272
|
+
import { Info, Markdown } from "@transferwise/components";
|
|
10273
|
+
import { useIntl as useIntl3 } from "react-intl";
|
|
10414
10274
|
|
|
10415
10275
|
// src/common/messages/help.messages.ts
|
|
10416
|
-
import { defineMessages as
|
|
10417
|
-
var help_messages_default =
|
|
10276
|
+
import { defineMessages as defineMessages5 } from "react-intl";
|
|
10277
|
+
var help_messages_default = defineMessages5({
|
|
10418
10278
|
helpAria: {
|
|
10419
10279
|
id: "dynamicFlows.Help.ariaLabel",
|
|
10420
10280
|
defaultMessage: "Click here for more info.",
|
|
@@ -10423,14 +10283,14 @@ var help_messages_default = defineMessages6({
|
|
|
10423
10283
|
});
|
|
10424
10284
|
|
|
10425
10285
|
// src/revamp/wise/renderers/components/Help.tsx
|
|
10426
|
-
import { jsx as
|
|
10286
|
+
import { jsx as jsx9 } from "react/jsx-runtime";
|
|
10427
10287
|
function Help({ help }) {
|
|
10428
|
-
const intl =
|
|
10429
|
-
return /* @__PURE__ */
|
|
10288
|
+
const intl = useIntl3();
|
|
10289
|
+
return /* @__PURE__ */ jsx9(
|
|
10430
10290
|
Info,
|
|
10431
10291
|
{
|
|
10432
10292
|
className: "m-l-1",
|
|
10433
|
-
content: /* @__PURE__ */
|
|
10293
|
+
content: /* @__PURE__ */ jsx9(Markdown, { config: { link: { target: "_blank" } }, children: help }),
|
|
10434
10294
|
presentation: "POPOVER",
|
|
10435
10295
|
size: "sm",
|
|
10436
10296
|
"aria-label": intl.formatMessage(help_messages_default.helpAria)
|
|
@@ -10440,43 +10300,43 @@ function Help({ help }) {
|
|
|
10440
10300
|
var Help_default = Help;
|
|
10441
10301
|
|
|
10442
10302
|
// src/revamp/wise/renderers/components/LabelContentWithHelp.tsx
|
|
10443
|
-
import { jsx as
|
|
10303
|
+
import { jsx as jsx10, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
10444
10304
|
function LabelContentWithHelp({ text, help }) {
|
|
10445
|
-
return /* @__PURE__ */
|
|
10305
|
+
return /* @__PURE__ */ jsxs3("div", { children: [
|
|
10446
10306
|
text,
|
|
10447
|
-
/* @__PURE__ */
|
|
10307
|
+
/* @__PURE__ */ jsx10(Help_default, { help })
|
|
10448
10308
|
] });
|
|
10449
10309
|
}
|
|
10450
10310
|
|
|
10451
10311
|
// src/revamp/wise/renderers/components/FieldInput.tsx
|
|
10452
|
-
import { jsx as
|
|
10312
|
+
import { jsx as jsx11 } from "react/jsx-runtime";
|
|
10453
10313
|
function FieldInput({ id, children, label, error, description, help }) {
|
|
10454
|
-
const labelContent = label && help ? /* @__PURE__ */
|
|
10455
|
-
return /* @__PURE__ */
|
|
10314
|
+
const labelContent = label && help ? /* @__PURE__ */ jsx11(LabelContentWithHelp, { text: label, help }) : label;
|
|
10315
|
+
return /* @__PURE__ */ jsx11(Field, { id, label: labelContent, hint: description, error, children });
|
|
10456
10316
|
}
|
|
10457
10317
|
var FieldInput_default = FieldInput;
|
|
10458
10318
|
|
|
10459
10319
|
// src/revamp/wise/renderers/BooleanInputRenderer.tsx
|
|
10460
10320
|
import { Checkbox } from "@transferwise/components";
|
|
10461
|
-
import { jsx as
|
|
10321
|
+
import { jsx as jsx12 } from "react/jsx-runtime";
|
|
10462
10322
|
var BooleanInputRenderer = {
|
|
10463
10323
|
canRenderType: "input-boolean",
|
|
10464
10324
|
render: (props) => {
|
|
10465
10325
|
const _a = props, { id, control, label = "", description, help, error, type, value } = _a, rest = __objRest(_a, ["id", "control", "label", "description", "help", "error", "type", "value"]);
|
|
10466
10326
|
const checkboxProps = __spreadProps(__spreadValues({}, rest), { label, secondary: description, checked: value });
|
|
10467
|
-
return /* @__PURE__ */
|
|
10327
|
+
return /* @__PURE__ */ jsx12(FieldInput_default, { id, label: "", description: "", error, help, children: /* @__PURE__ */ jsx12(Checkbox, __spreadValues({ id }, checkboxProps)) });
|
|
10468
10328
|
}
|
|
10469
10329
|
};
|
|
10470
10330
|
var BooleanInputRenderer_default = BooleanInputRenderer;
|
|
10471
10331
|
|
|
10472
10332
|
// src/revamp/wise/renderers/BoxRenderer.tsx
|
|
10473
10333
|
var import_classnames2 = __toESM(require_classnames());
|
|
10474
|
-
import { jsx as
|
|
10334
|
+
import { jsx as jsx13 } from "react/jsx-runtime";
|
|
10475
10335
|
var BoxRenderer = {
|
|
10476
10336
|
canRenderType: "box",
|
|
10477
10337
|
render: ({ border, children, margin, width }) => {
|
|
10478
10338
|
const hasFixedWidth = width !== "xl";
|
|
10479
|
-
const contents = /* @__PURE__ */
|
|
10339
|
+
const contents = /* @__PURE__ */ jsx13(
|
|
10480
10340
|
"div",
|
|
10481
10341
|
{
|
|
10482
10342
|
className: (0, import_classnames2.default)({
|
|
@@ -10487,14 +10347,30 @@ var BoxRenderer = {
|
|
|
10487
10347
|
children
|
|
10488
10348
|
}
|
|
10489
10349
|
);
|
|
10490
|
-
return hasFixedWidth ? /* @__PURE__ */
|
|
10350
|
+
return hasFixedWidth ? /* @__PURE__ */ jsx13("div", { className: (0, import_classnames2.default)("df-box-renderer-fixed-width", getMargin(margin)), children: contents }) : contents;
|
|
10491
10351
|
}
|
|
10492
10352
|
};
|
|
10493
10353
|
var BoxRenderer_default = BoxRenderer;
|
|
10494
10354
|
|
|
10495
10355
|
// src/revamp/wise/renderers/ButtonRenderer.tsx
|
|
10496
|
-
import { Button
|
|
10497
|
-
|
|
10356
|
+
import { Button } from "@transferwise/components";
|
|
10357
|
+
|
|
10358
|
+
// src/revamp/wise/renderers/step/StepRendererContext.tsx
|
|
10359
|
+
import { createContext as createContext3, useContext as useContext3 } from "react";
|
|
10360
|
+
var StepRendererContext = createContext3({ loadingState: "idle", trackEvent: () => {
|
|
10361
|
+
} });
|
|
10362
|
+
var StepRendererContextProvider = StepRendererContext.Provider;
|
|
10363
|
+
var useLoadingContext = () => {
|
|
10364
|
+
const { loadingState } = useContext3(StepRendererContext);
|
|
10365
|
+
return { loadingState, isLoading: loadingState !== "idle" };
|
|
10366
|
+
};
|
|
10367
|
+
var useTrackEvent = () => {
|
|
10368
|
+
const { trackEvent } = useContext3(StepRendererContext);
|
|
10369
|
+
return trackEvent;
|
|
10370
|
+
};
|
|
10371
|
+
|
|
10372
|
+
// src/revamp/wise/renderers/ButtonRenderer.tsx
|
|
10373
|
+
import { jsx as jsx14 } from "react/jsx-runtime";
|
|
10498
10374
|
var ButtonRenderer = {
|
|
10499
10375
|
canRenderType: "button",
|
|
10500
10376
|
render: ButtonRendererComponent
|
|
@@ -10512,8 +10388,8 @@ function ButtonRendererComponent({
|
|
|
10512
10388
|
const priority = mapControl(control);
|
|
10513
10389
|
const type = priority === "tertiary" ? void 0 : mapContext(context);
|
|
10514
10390
|
const { isLoading } = useLoadingContext();
|
|
10515
|
-
return /* @__PURE__ */
|
|
10516
|
-
|
|
10391
|
+
return /* @__PURE__ */ jsx14(
|
|
10392
|
+
Button,
|
|
10517
10393
|
{
|
|
10518
10394
|
block: true,
|
|
10519
10395
|
className,
|
|
@@ -10564,10 +10440,10 @@ var ButtonRenderer_default = ButtonRenderer;
|
|
|
10564
10440
|
|
|
10565
10441
|
// src/revamp/wise/renderers/ColumnsRenderer.tsx
|
|
10566
10442
|
var import_classnames3 = __toESM(require_classnames());
|
|
10567
|
-
import { jsx as
|
|
10443
|
+
import { jsx as jsx15, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
10568
10444
|
var ColumnsRenderer = {
|
|
10569
10445
|
canRenderType: "columns",
|
|
10570
|
-
render: ({ bias, margin, startChildren, endChildren }) => /* @__PURE__ */
|
|
10446
|
+
render: ({ bias, margin, startChildren, endChildren }) => /* @__PURE__ */ jsxs4(
|
|
10571
10447
|
"div",
|
|
10572
10448
|
{
|
|
10573
10449
|
className: (0, import_classnames3.default)("df-columns-renderer-container", getMargin(margin), {
|
|
@@ -10575,8 +10451,8 @@ var ColumnsRenderer = {
|
|
|
10575
10451
|
"df-columns-renderer-bias-end": bias === "end"
|
|
10576
10452
|
}),
|
|
10577
10453
|
children: [
|
|
10578
|
-
/* @__PURE__ */
|
|
10579
|
-
/* @__PURE__ */
|
|
10454
|
+
/* @__PURE__ */ jsx15("div", { className: "df-columns-renderer-column", children: startChildren }),
|
|
10455
|
+
/* @__PURE__ */ jsx15("div", { className: "df-columns-renderer-column", children: endChildren })
|
|
10580
10456
|
]
|
|
10581
10457
|
}
|
|
10582
10458
|
)
|
|
@@ -10615,14 +10491,14 @@ var dateToDateString = (date) => {
|
|
|
10615
10491
|
};
|
|
10616
10492
|
|
|
10617
10493
|
// src/revamp/wise/renderers/components/VariableDateInput.tsx
|
|
10618
|
-
import { jsx as
|
|
10494
|
+
import { jsx as jsx16 } from "react/jsx-runtime";
|
|
10619
10495
|
function VariableDateInput({
|
|
10620
10496
|
control,
|
|
10621
10497
|
inputProps
|
|
10622
10498
|
}) {
|
|
10623
10499
|
const { minimumDate, maximumDate, placeholder, disabled, onBlur, onChange, onFocus } = inputProps;
|
|
10624
10500
|
if (control === "date-lookup") {
|
|
10625
|
-
return /* @__PURE__ */
|
|
10501
|
+
return /* @__PURE__ */ jsx16(
|
|
10626
10502
|
DateLookup,
|
|
10627
10503
|
{
|
|
10628
10504
|
value: dateStringToDateOrNull(inputProps.value),
|
|
@@ -10638,12 +10514,12 @@ function VariableDateInput({
|
|
|
10638
10514
|
}
|
|
10639
10515
|
);
|
|
10640
10516
|
}
|
|
10641
|
-
return /* @__PURE__ */
|
|
10517
|
+
return /* @__PURE__ */ jsx16(DateInput, __spreadValues({}, inputProps));
|
|
10642
10518
|
}
|
|
10643
10519
|
var VariableDateInput_default = VariableDateInput;
|
|
10644
10520
|
|
|
10645
10521
|
// src/revamp/wise/renderers/DateInputRenderer.tsx
|
|
10646
|
-
import { jsx as
|
|
10522
|
+
import { jsx as jsx17 } from "react/jsx-runtime";
|
|
10647
10523
|
var DateInputRenderer = {
|
|
10648
10524
|
canRenderType: "input-date",
|
|
10649
10525
|
render: (props) => {
|
|
@@ -10668,7 +10544,7 @@ var DateInputRenderer = {
|
|
|
10668
10544
|
]);
|
|
10669
10545
|
const value = initialValue != null ? initialValue : "";
|
|
10670
10546
|
const inputProps = __spreadProps(__spreadValues({}, rest), { value, id });
|
|
10671
|
-
return /* @__PURE__ */
|
|
10547
|
+
return /* @__PURE__ */ jsx17(FieldInput_default, { id, label, description, error, help, children: /* @__PURE__ */ jsx17(VariableDateInput_default, { control, inputProps }) });
|
|
10672
10548
|
}
|
|
10673
10549
|
};
|
|
10674
10550
|
var DateInputRenderer_default = DateInputRenderer;
|
|
@@ -10677,20 +10553,20 @@ var DateInputRenderer_default = DateInputRenderer;
|
|
|
10677
10553
|
import { NavigationOptionsList, NavigationOption } from "@transferwise/components";
|
|
10678
10554
|
|
|
10679
10555
|
// ../../node_modules/.pnpm/@wise+art@2.7.0_react-dom@18.2.0_react@18.2.0/node_modules/@wise/art/dist/index.esm.js
|
|
10680
|
-
import { useState as
|
|
10681
|
-
import { jsx as
|
|
10556
|
+
import { useState as useState3, useEffect as useEffect2, forwardRef as forwardRef2 } from "react";
|
|
10557
|
+
import { jsx as jsx18, jsxs as jsxs5, Fragment as Fragment3 } from "react/jsx-runtime";
|
|
10682
10558
|
var unknownFlagName = "wise";
|
|
10683
10559
|
var Flag = ({
|
|
10684
10560
|
code,
|
|
10685
10561
|
intrinsicSize = 64
|
|
10686
10562
|
}) => {
|
|
10687
|
-
const [fallback, setFallback] =
|
|
10688
|
-
|
|
10563
|
+
const [fallback, setFallback] = useState3(null);
|
|
10564
|
+
useEffect2(() => {
|
|
10689
10565
|
setFallback(null);
|
|
10690
10566
|
}, [code]);
|
|
10691
10567
|
const detailed = intrinsicSize >= 150;
|
|
10692
10568
|
const name = fallback !== "unknown" ? `${code.toLowerCase()}${fallback == null && detailed ? "-detailed" : ""}` : unknownFlagName;
|
|
10693
|
-
return /* @__PURE__ */
|
|
10569
|
+
return /* @__PURE__ */ jsx18("img", {
|
|
10694
10570
|
src: `https://wise.com/web-art/assets/flags/${name}.svg`,
|
|
10695
10571
|
alt: "",
|
|
10696
10572
|
width: intrinsicSize,
|
|
@@ -10781,19 +10657,19 @@ var Assets;
|
|
|
10781
10657
|
})(Assets || (Assets = {}));
|
|
10782
10658
|
|
|
10783
10659
|
// src/revamp/wise/renderers/components/icon/FlagIcon.tsx
|
|
10784
|
-
import { jsx as
|
|
10660
|
+
import { jsx as jsx19 } from "react/jsx-runtime";
|
|
10785
10661
|
var isFlagIcon = (name) => name.startsWith("flag-");
|
|
10786
10662
|
function FlagIcon({ name }) {
|
|
10787
10663
|
if (!isFlagIcon(name)) {
|
|
10788
10664
|
return null;
|
|
10789
10665
|
}
|
|
10790
10666
|
const code = name.substring(5);
|
|
10791
|
-
return /* @__PURE__ */
|
|
10667
|
+
return /* @__PURE__ */ jsx19(Flag, { code });
|
|
10792
10668
|
}
|
|
10793
10669
|
|
|
10794
10670
|
// src/revamp/wise/renderers/components/icon/NamedIcon.tsx
|
|
10795
10671
|
import * as icons from "@transferwise/icons";
|
|
10796
|
-
import { jsx as
|
|
10672
|
+
import { jsx as jsx20 } from "react/jsx-runtime";
|
|
10797
10673
|
var isNamedIcon = (name) => {
|
|
10798
10674
|
const iconName = toCapitalisedCamelCase(name);
|
|
10799
10675
|
return Object.keys(icons).includes(iconName);
|
|
@@ -10804,45 +10680,45 @@ function NamedIcon({ name }) {
|
|
|
10804
10680
|
}
|
|
10805
10681
|
const iconName = toCapitalisedCamelCase(name);
|
|
10806
10682
|
const Icon = icons[iconName];
|
|
10807
|
-
return /* @__PURE__ */
|
|
10683
|
+
return /* @__PURE__ */ jsx20(Icon, { size: 24 });
|
|
10808
10684
|
}
|
|
10809
10685
|
var toCapitalisedCamelCase = (value) => value.split("-").map(capitaliseFirstChar).join("");
|
|
10810
10686
|
var capitaliseFirstChar = (value) => `${value[0].toUpperCase()}${value.slice(1)}`;
|
|
10811
10687
|
|
|
10812
10688
|
// src/revamp/wise/renderers/components/icon/DynamicIcon.tsx
|
|
10813
|
-
import { jsx as
|
|
10689
|
+
import { jsx as jsx21 } from "react/jsx-runtime";
|
|
10814
10690
|
function DynamicIcon({ name }) {
|
|
10815
10691
|
if (isFlagIcon(name)) {
|
|
10816
|
-
return /* @__PURE__ */
|
|
10692
|
+
return /* @__PURE__ */ jsx21(FlagIcon, { name });
|
|
10817
10693
|
}
|
|
10818
10694
|
if (isNamedIcon(name)) {
|
|
10819
|
-
return /* @__PURE__ */
|
|
10695
|
+
return /* @__PURE__ */ jsx21(NamedIcon, { name });
|
|
10820
10696
|
}
|
|
10821
10697
|
return null;
|
|
10822
10698
|
}
|
|
10823
10699
|
var DynamicIcon_default = DynamicIcon;
|
|
10824
10700
|
|
|
10825
10701
|
// src/revamp/wise/renderers/components/icon/NavigationOptionMedia.tsx
|
|
10826
|
-
import { Avatar
|
|
10827
|
-
import { jsx as
|
|
10702
|
+
import { Avatar, AvatarType } from "@transferwise/components";
|
|
10703
|
+
import { jsx as jsx22 } from "react/jsx-runtime";
|
|
10828
10704
|
function NavigationOptionMedia({ icon, image }) {
|
|
10829
10705
|
if (!isNullish2(icon)) {
|
|
10830
10706
|
if ("name" in icon) {
|
|
10831
|
-
return /* @__PURE__ */
|
|
10707
|
+
return /* @__PURE__ */ jsx22(Avatar, { type: AvatarType.ICON, children: /* @__PURE__ */ jsx22(DynamicIcon_default, { name: icon.name }) });
|
|
10832
10708
|
}
|
|
10833
10709
|
if (icon.text) {
|
|
10834
|
-
return /* @__PURE__ */
|
|
10710
|
+
return /* @__PURE__ */ jsx22(Avatar, { type: AvatarType.INITIALS, children: icon.text });
|
|
10835
10711
|
}
|
|
10836
10712
|
}
|
|
10837
10713
|
if (image == null ? void 0 : image.url) {
|
|
10838
10714
|
const { url, accessibilityDescription } = image;
|
|
10839
|
-
return /* @__PURE__ */
|
|
10715
|
+
return /* @__PURE__ */ jsx22("img", { src: url, alt: accessibilityDescription });
|
|
10840
10716
|
}
|
|
10841
10717
|
return null;
|
|
10842
10718
|
}
|
|
10843
10719
|
|
|
10844
10720
|
// src/revamp/wise/renderers/DecisionRenderer.tsx
|
|
10845
|
-
import { jsx as
|
|
10721
|
+
import { jsx as jsx23 } from "react/jsx-runtime";
|
|
10846
10722
|
var DecisionRenderer = {
|
|
10847
10723
|
canRenderType: "decision",
|
|
10848
10724
|
render: DecisionRendererComponent
|
|
@@ -10850,13 +10726,13 @@ var DecisionRenderer = {
|
|
|
10850
10726
|
var DecisionRenderer_default = DecisionRenderer;
|
|
10851
10727
|
function DecisionRendererComponent({ margin, options }) {
|
|
10852
10728
|
const { isLoading } = useLoadingContext();
|
|
10853
|
-
return /* @__PURE__ */
|
|
10729
|
+
return /* @__PURE__ */ jsx23("div", { className: getMargin(margin), children: /* @__PURE__ */ jsx23(NavigationOptionsList, { children: options.map(({ description, disabled, icon, image, title, onClick }) => /* @__PURE__ */ jsx23(
|
|
10854
10730
|
NavigationOption,
|
|
10855
10731
|
{
|
|
10856
10732
|
title,
|
|
10857
10733
|
content: description,
|
|
10858
10734
|
disabled: isLoading || disabled,
|
|
10859
|
-
media: /* @__PURE__ */
|
|
10735
|
+
media: /* @__PURE__ */ jsx23(NavigationOptionMedia, { icon, image }),
|
|
10860
10736
|
showMediaCircle: false,
|
|
10861
10737
|
showMediaAtAllSizes: true,
|
|
10862
10738
|
onClick
|
|
@@ -10866,36 +10742,36 @@ function DecisionRendererComponent({ margin, options }) {
|
|
|
10866
10742
|
}
|
|
10867
10743
|
|
|
10868
10744
|
// src/revamp/wise/renderers/DividerRenderer.tsx
|
|
10869
|
-
import { jsx as
|
|
10745
|
+
import { jsx as jsx24 } from "react/jsx-runtime";
|
|
10870
10746
|
var DividerRenderer = {
|
|
10871
10747
|
canRenderType: "divider",
|
|
10872
|
-
render: ({ margin }) => /* @__PURE__ */
|
|
10748
|
+
render: ({ margin }) => /* @__PURE__ */ jsx24("hr", { className: `m-t-0 ${getMargin(margin)}` })
|
|
10873
10749
|
};
|
|
10874
10750
|
var DividerRenderer_default = DividerRenderer;
|
|
10875
10751
|
|
|
10876
10752
|
// src/revamp/wise/renderers/FormRenderer.tsx
|
|
10877
|
-
import { jsx as
|
|
10753
|
+
import { jsx as jsx25 } from "react/jsx-runtime";
|
|
10878
10754
|
var FormRenderer = {
|
|
10879
10755
|
canRenderType: "form",
|
|
10880
|
-
render: ({ children, margin }) => /* @__PURE__ */
|
|
10756
|
+
render: ({ children, margin }) => /* @__PURE__ */ jsx25("div", { className: getMargin(margin), children })
|
|
10881
10757
|
};
|
|
10882
10758
|
var FormRenderer_default = FormRenderer;
|
|
10883
10759
|
|
|
10884
10760
|
// src/revamp/wise/renderers/FormSectionRenderer.tsx
|
|
10885
10761
|
import { Header } from "@transferwise/components";
|
|
10886
|
-
import { jsx as
|
|
10762
|
+
import { jsx as jsx26, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
10887
10763
|
var FormSectionRenderer = {
|
|
10888
10764
|
canRenderType: "form-section",
|
|
10889
|
-
render: ({ title, description, children }) => /* @__PURE__ */
|
|
10765
|
+
render: ({ title, description, children }) => /* @__PURE__ */ jsxs6("fieldset", { children: [
|
|
10890
10766
|
title && // TODO - once section headers support help, we could show help in here
|
|
10891
|
-
/* @__PURE__ */
|
|
10767
|
+
/* @__PURE__ */ jsx26(
|
|
10892
10768
|
Header,
|
|
10893
10769
|
{
|
|
10894
10770
|
as: "h2",
|
|
10895
10771
|
title
|
|
10896
10772
|
}
|
|
10897
10773
|
),
|
|
10898
|
-
description && /* @__PURE__ */
|
|
10774
|
+
description && /* @__PURE__ */ jsx26("p", { children: description }),
|
|
10899
10775
|
children
|
|
10900
10776
|
] })
|
|
10901
10777
|
};
|
|
@@ -10903,32 +10779,32 @@ var FormSectionRenderer_default = FormSectionRenderer;
|
|
|
10903
10779
|
|
|
10904
10780
|
// src/revamp/wise/renderers/HeadingRenderer.tsx
|
|
10905
10781
|
import { Display } from "@transferwise/components";
|
|
10906
|
-
import { jsx as
|
|
10782
|
+
import { jsx as jsx27 } from "react/jsx-runtime";
|
|
10907
10783
|
var HeadingRenderer = {
|
|
10908
10784
|
canRenderType: "heading",
|
|
10909
|
-
render: (props) => /* @__PURE__ */
|
|
10785
|
+
render: (props) => /* @__PURE__ */ jsx27(Heading, __spreadValues({}, props))
|
|
10910
10786
|
};
|
|
10911
10787
|
function Heading(props) {
|
|
10912
10788
|
const { text, size, align, margin, control } = props;
|
|
10913
10789
|
const className = getTextAlignmentAndMargin({ align, margin });
|
|
10914
|
-
return control === "display" ? /* @__PURE__ */
|
|
10790
|
+
return control === "display" ? /* @__PURE__ */ jsx27(DisplayHeading, { size, text, className }) : /* @__PURE__ */ jsx27(StandardHeading, { size, text, className });
|
|
10915
10791
|
}
|
|
10916
10792
|
function DisplayHeading({ size, text, className }) {
|
|
10917
|
-
return /* @__PURE__ */
|
|
10793
|
+
return /* @__PURE__ */ jsx27(Display, { type: getDisplayType(size), className, children: text });
|
|
10918
10794
|
}
|
|
10919
10795
|
function StandardHeading({ size, text, className }) {
|
|
10920
10796
|
switch (size) {
|
|
10921
10797
|
case "xs":
|
|
10922
|
-
return /* @__PURE__ */
|
|
10798
|
+
return /* @__PURE__ */ jsx27("h5", { className, children: text });
|
|
10923
10799
|
case "sm":
|
|
10924
|
-
return /* @__PURE__ */
|
|
10800
|
+
return /* @__PURE__ */ jsx27("h4", { className, children: text });
|
|
10925
10801
|
case "lg":
|
|
10926
|
-
return /* @__PURE__ */
|
|
10802
|
+
return /* @__PURE__ */ jsx27("h2", { className, children: text });
|
|
10927
10803
|
case "xl":
|
|
10928
|
-
return /* @__PURE__ */
|
|
10804
|
+
return /* @__PURE__ */ jsx27("h1", { className, children: text });
|
|
10929
10805
|
case "md":
|
|
10930
10806
|
default:
|
|
10931
|
-
return /* @__PURE__ */
|
|
10807
|
+
return /* @__PURE__ */ jsx27("h3", { className, children: text });
|
|
10932
10808
|
}
|
|
10933
10809
|
}
|
|
10934
10810
|
var getDisplayType = (size) => {
|
|
@@ -10948,11 +10824,11 @@ var HeadingRenderer_default = HeadingRenderer;
|
|
|
10948
10824
|
|
|
10949
10825
|
// src/revamp/wise/renderers/ImageRenderer.tsx
|
|
10950
10826
|
import { Image } from "@transferwise/components";
|
|
10951
|
-
import { useEffect as
|
|
10952
|
-
import { jsx as
|
|
10827
|
+
import { useEffect as useEffect3, useState as useState4 } from "react";
|
|
10828
|
+
import { jsx as jsx28 } from "react/jsx-runtime";
|
|
10953
10829
|
var ImageRenderer = {
|
|
10954
10830
|
canRenderType: "image",
|
|
10955
|
-
render: (props) => /* @__PURE__ */
|
|
10831
|
+
render: (props) => /* @__PURE__ */ jsx28(ImageRendererComponent, __spreadValues({}, props))
|
|
10956
10832
|
};
|
|
10957
10833
|
var ImageRenderer_default = ImageRenderer;
|
|
10958
10834
|
function ImageRendererComponent({
|
|
@@ -10961,12 +10837,12 @@ function ImageRendererComponent({
|
|
|
10961
10837
|
size,
|
|
10962
10838
|
url
|
|
10963
10839
|
}) {
|
|
10964
|
-
const [imageSource, setImageSource] =
|
|
10840
|
+
const [imageSource, setImageSource] = useState4("");
|
|
10965
10841
|
const httpClient = useHttpClient();
|
|
10966
|
-
|
|
10842
|
+
useEffect3(() => {
|
|
10967
10843
|
void getImageSource(httpClient, url).then(setImageSource);
|
|
10968
10844
|
}, [url, httpClient]);
|
|
10969
|
-
return /* @__PURE__ */
|
|
10845
|
+
return /* @__PURE__ */ jsx28("div", { className: `df-image ${size || "md"}`, children: /* @__PURE__ */ jsx28(
|
|
10970
10846
|
Image,
|
|
10971
10847
|
{
|
|
10972
10848
|
className: `img-responsive ${getMargin(margin)}`,
|
|
@@ -11011,7 +10887,7 @@ var getImageSource = async (httpClient, imageUrl) => {
|
|
|
11011
10887
|
|
|
11012
10888
|
// src/revamp/wise/renderers/InstructionsRenderer.tsx
|
|
11013
10889
|
import { Header as Header2, InstructionsList } from "@transferwise/components";
|
|
11014
|
-
import { jsx as
|
|
10890
|
+
import { jsx as jsx29, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
11015
10891
|
var doContext = ["positive", "neutral"];
|
|
11016
10892
|
var dontContext = ["warning", "negative"];
|
|
11017
10893
|
var InstructionsRenderer = {
|
|
@@ -11019,9 +10895,9 @@ var InstructionsRenderer = {
|
|
|
11019
10895
|
render: ({ items, margin, title }) => {
|
|
11020
10896
|
const dos = items.filter((item) => doContext.includes(item.context)).map(({ text }) => text);
|
|
11021
10897
|
const donts = items.filter((item) => dontContext.includes(item.context)).map(({ text }) => text);
|
|
11022
|
-
return /* @__PURE__ */
|
|
11023
|
-
title ? /* @__PURE__ */
|
|
11024
|
-
/* @__PURE__ */
|
|
10898
|
+
return /* @__PURE__ */ jsxs7("div", { className: getMargin(margin), children: [
|
|
10899
|
+
title ? /* @__PURE__ */ jsx29(Header2, { title }) : null,
|
|
10900
|
+
/* @__PURE__ */ jsx29(InstructionsList, { dos, donts })
|
|
11025
10901
|
] });
|
|
11026
10902
|
}
|
|
11027
10903
|
};
|
|
@@ -11038,12 +10914,12 @@ var onWheel = (event) => {
|
|
|
11038
10914
|
};
|
|
11039
10915
|
|
|
11040
10916
|
// src/revamp/wise/renderers/IntegerInputRenderer.tsx
|
|
11041
|
-
import { jsx as
|
|
10917
|
+
import { jsx as jsx30 } from "react/jsx-runtime";
|
|
11042
10918
|
var IntegerInputRenderer = {
|
|
11043
10919
|
canRenderType: "input-integer",
|
|
11044
10920
|
render: (props) => {
|
|
11045
10921
|
const _a = props, { id, label, error, description, help, type, value, onChange } = _a, rest = __objRest(_a, ["id", "label", "error", "description", "help", "type", "value", "onChange"]);
|
|
11046
|
-
return /* @__PURE__ */
|
|
10922
|
+
return /* @__PURE__ */ jsx30(FieldInput_default, { id, label, description, error, help, children: /* @__PURE__ */ jsx30(
|
|
11047
10923
|
Input2,
|
|
11048
10924
|
__spreadValues({
|
|
11049
10925
|
id,
|
|
@@ -11065,10 +10941,10 @@ var IntegerInputRenderer_default = IntegerInputRenderer;
|
|
|
11065
10941
|
|
|
11066
10942
|
// src/revamp/wise/renderers/LoadingIndicatorRenderer.tsx
|
|
11067
10943
|
import { Loader } from "@transferwise/components";
|
|
11068
|
-
import { jsx as
|
|
10944
|
+
import { jsx as jsx31 } from "react/jsx-runtime";
|
|
11069
10945
|
var LoadingIndicatorRenderer = {
|
|
11070
10946
|
canRenderType: "loading-indicator",
|
|
11071
|
-
render: ({ margin, size }) => /* @__PURE__ */
|
|
10947
|
+
render: ({ margin, size }) => /* @__PURE__ */ jsx31(
|
|
11072
10948
|
Loader,
|
|
11073
10949
|
{
|
|
11074
10950
|
size,
|
|
@@ -11080,28 +10956,28 @@ var LoadingIndicatorRenderer = {
|
|
|
11080
10956
|
var LoadingIndicatorRenderer_default = LoadingIndicatorRenderer;
|
|
11081
10957
|
|
|
11082
10958
|
// src/revamp/wise/renderers/MarkdownRenderer.tsx
|
|
11083
|
-
import { Markdown as
|
|
11084
|
-
import { jsx as
|
|
10959
|
+
import { Markdown as Markdown2 } from "@transferwise/components";
|
|
10960
|
+
import { jsx as jsx32 } from "react/jsx-runtime";
|
|
11085
10961
|
var MarkdownRenderer = {
|
|
11086
10962
|
canRenderType: "markdown",
|
|
11087
|
-
render: ({ content, align, margin }) => /* @__PURE__ */
|
|
10963
|
+
render: ({ content, align, margin }) => /* @__PURE__ */ jsx32("div", { className: getTextAlignmentAndMargin({ align, margin }), children: /* @__PURE__ */ jsx32(Markdown2, { config: { link: { target: "_blank" } }, children: content }) })
|
|
11088
10964
|
};
|
|
11089
10965
|
var MarkdownRenderer_default = MarkdownRenderer;
|
|
11090
10966
|
|
|
11091
10967
|
// src/revamp/wise/renderers/ModalRenderer.tsx
|
|
11092
|
-
import { Button as
|
|
11093
|
-
import { useState as
|
|
11094
|
-
import { jsx as
|
|
10968
|
+
import { Button as Button2, Modal } from "@transferwise/components";
|
|
10969
|
+
import { useState as useState5 } from "react";
|
|
10970
|
+
import { jsx as jsx33, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
11095
10971
|
var ModalRenderer = {
|
|
11096
10972
|
canRenderType: "modal",
|
|
11097
|
-
render: (props) => /* @__PURE__ */
|
|
10973
|
+
render: (props) => /* @__PURE__ */ jsx33(DFModal, __spreadValues({}, props))
|
|
11098
10974
|
};
|
|
11099
10975
|
var ModalRenderer_default = ModalRenderer;
|
|
11100
10976
|
function DFModal({ content, margin, trigger }) {
|
|
11101
|
-
const [visible, setVisible] =
|
|
11102
|
-
return /* @__PURE__ */
|
|
11103
|
-
/* @__PURE__ */
|
|
11104
|
-
/* @__PURE__ */
|
|
10977
|
+
const [visible, setVisible] = useState5(false);
|
|
10978
|
+
return /* @__PURE__ */ jsxs8("div", { className: getMargin(margin), children: [
|
|
10979
|
+
/* @__PURE__ */ jsx33(Button2, { priority: "tertiary", block: true, onClick: () => setVisible(true), children: trigger.title }),
|
|
10980
|
+
/* @__PURE__ */ jsx33(
|
|
11105
10981
|
Modal,
|
|
11106
10982
|
{
|
|
11107
10983
|
scroll: "content",
|
|
@@ -11120,7 +10996,7 @@ import { UploadInput } from "@transferwise/components";
|
|
|
11120
10996
|
// src/revamp/wise/renderers/components/UploadFieldInput.tsx
|
|
11121
10997
|
var import_classnames4 = __toESM(require_classnames());
|
|
11122
10998
|
import { InlineAlert as InlineAlert2 } from "@transferwise/components";
|
|
11123
|
-
import { jsx as
|
|
10999
|
+
import { jsx as jsx34, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
11124
11000
|
function UploadFieldInput({
|
|
11125
11001
|
id,
|
|
11126
11002
|
children,
|
|
@@ -11129,18 +11005,18 @@ function UploadFieldInput({
|
|
|
11129
11005
|
error,
|
|
11130
11006
|
help
|
|
11131
11007
|
}) {
|
|
11132
|
-
const labelContent = label && help ? /* @__PURE__ */
|
|
11008
|
+
const labelContent = label && help ? /* @__PURE__ */ jsx34(LabelContentWithHelp, { text: label, help }) : label;
|
|
11133
11009
|
const descriptionId = description ? `${id}-description` : void 0;
|
|
11134
|
-
return /* @__PURE__ */
|
|
11010
|
+
return /* @__PURE__ */ jsxs9(
|
|
11135
11011
|
"div",
|
|
11136
11012
|
{
|
|
11137
11013
|
className: (0, import_classnames4.default)("form-group d-block", {
|
|
11138
11014
|
"has-error": !!error
|
|
11139
11015
|
}),
|
|
11140
11016
|
children: [
|
|
11141
|
-
/* @__PURE__ */
|
|
11017
|
+
/* @__PURE__ */ jsx34("label", { htmlFor: id, className: "control-label", children: labelContent }),
|
|
11142
11018
|
children,
|
|
11143
|
-
error && /* @__PURE__ */
|
|
11019
|
+
error && /* @__PURE__ */ jsx34(InlineAlert2, { type: "negative", id: descriptionId, children: error })
|
|
11144
11020
|
]
|
|
11145
11021
|
}
|
|
11146
11022
|
);
|
|
@@ -11183,7 +11059,7 @@ var nanoid = (size = 21) => {
|
|
|
11183
11059
|
var getRandomId = () => nanoid(10);
|
|
11184
11060
|
|
|
11185
11061
|
// src/revamp/wise/renderers/MultiUploadInputRenderer.tsx
|
|
11186
|
-
import { jsx as
|
|
11062
|
+
import { jsx as jsx35 } from "react/jsx-runtime";
|
|
11187
11063
|
var MultiUploadInputRenderer = {
|
|
11188
11064
|
canRenderType: "input-upload-multi",
|
|
11189
11065
|
render: (props) => {
|
|
@@ -11210,7 +11086,7 @@ var MultiUploadInputRenderer = {
|
|
|
11210
11086
|
};
|
|
11211
11087
|
const onDeleteFile = async (fileId) => onDelete(String(fileId));
|
|
11212
11088
|
const descriptionId = description ? `${id}-description` : void 0;
|
|
11213
|
-
return /* @__PURE__ */
|
|
11089
|
+
return /* @__PURE__ */ jsx35(UploadFieldInput_default, { id, label, description, error, help, children: /* @__PURE__ */ jsx35(
|
|
11214
11090
|
UploadInput,
|
|
11215
11091
|
{
|
|
11216
11092
|
id,
|
|
@@ -11233,12 +11109,12 @@ var MultiUploadInputRenderer_default = MultiUploadInputRenderer;
|
|
|
11233
11109
|
|
|
11234
11110
|
// src/revamp/wise/renderers/NumberInputRenderer.tsx
|
|
11235
11111
|
import { Input as Input3 } from "@transferwise/components";
|
|
11236
|
-
import { jsx as
|
|
11112
|
+
import { jsx as jsx36 } from "react/jsx-runtime";
|
|
11237
11113
|
var NumberInputRenderer = {
|
|
11238
11114
|
canRenderType: "input-number",
|
|
11239
11115
|
render: (props) => {
|
|
11240
11116
|
const _a = props, { id, label, error, description, help, type, value, onChange } = _a, rest = __objRest(_a, ["id", "label", "error", "description", "help", "type", "value", "onChange"]);
|
|
11241
|
-
return /* @__PURE__ */
|
|
11117
|
+
return /* @__PURE__ */ jsx36(FieldInput_default, { id, label, description, error, help, children: /* @__PURE__ */ jsx36(
|
|
11242
11118
|
Input3,
|
|
11243
11119
|
__spreadValues({
|
|
11244
11120
|
id,
|
|
@@ -11257,7 +11133,7 @@ var NumberInputRenderer = {
|
|
|
11257
11133
|
var NumberInputRenderer_default = NumberInputRenderer;
|
|
11258
11134
|
|
|
11259
11135
|
// src/revamp/wise/renderers/ParagraphRenderer.tsx
|
|
11260
|
-
import { useIntl as
|
|
11136
|
+
import { useIntl as useIntl4 } from "react-intl";
|
|
11261
11137
|
|
|
11262
11138
|
// src/revamp/wise/renderers/hooks/useSnackBarIfAvailable.ts
|
|
11263
11139
|
import { SnackbarContext } from "@transferwise/components";
|
|
@@ -11270,11 +11146,11 @@ function useSnackBarIfAvailable() {
|
|
|
11270
11146
|
|
|
11271
11147
|
// src/revamp/wise/renderers/ParagraphRenderer.tsx
|
|
11272
11148
|
var import_classnames5 = __toESM(require_classnames());
|
|
11273
|
-
import { Button as
|
|
11149
|
+
import { Button as Button3, Input as Input4 } from "@transferwise/components";
|
|
11274
11150
|
|
|
11275
11151
|
// src/common/messages/paragraph.messages.ts
|
|
11276
|
-
import { defineMessages as
|
|
11277
|
-
var paragraph_messages_default =
|
|
11152
|
+
import { defineMessages as defineMessages6 } from "react-intl";
|
|
11153
|
+
var paragraph_messages_default = defineMessages6({
|
|
11278
11154
|
copy: {
|
|
11279
11155
|
id: "dynamicFlows.DynamicParagraph.copy",
|
|
11280
11156
|
defaultMessage: "Copy",
|
|
@@ -11288,32 +11164,32 @@ var paragraph_messages_default = defineMessages7({
|
|
|
11288
11164
|
});
|
|
11289
11165
|
|
|
11290
11166
|
// src/revamp/wise/renderers/ParagraphRenderer.tsx
|
|
11291
|
-
import { jsx as
|
|
11167
|
+
import { jsx as jsx37, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
11292
11168
|
var ParagraphRenderer = {
|
|
11293
11169
|
canRenderType: "paragraph",
|
|
11294
|
-
render: (props) => /* @__PURE__ */
|
|
11170
|
+
render: (props) => /* @__PURE__ */ jsx37(Paragraph, __spreadValues({}, props))
|
|
11295
11171
|
};
|
|
11296
11172
|
function Paragraph({ align, control, margin, text }) {
|
|
11297
11173
|
const className = getTextAlignmentAndMargin({ align, margin });
|
|
11298
|
-
return control === "copyable" ? /* @__PURE__ */
|
|
11174
|
+
return control === "copyable" ? /* @__PURE__ */ jsx37(CopyableParagraph, { className, align, text }) : /* @__PURE__ */ jsx37(StandardParagraph, { className, text });
|
|
11299
11175
|
}
|
|
11300
11176
|
function StandardParagraph({ text, className }) {
|
|
11301
|
-
return /* @__PURE__ */
|
|
11177
|
+
return /* @__PURE__ */ jsx37("p", { className, children: text });
|
|
11302
11178
|
}
|
|
11303
11179
|
function CopyableParagraph({
|
|
11304
11180
|
text,
|
|
11305
11181
|
align,
|
|
11306
11182
|
className
|
|
11307
11183
|
}) {
|
|
11308
|
-
const { formatMessage } =
|
|
11184
|
+
const { formatMessage } = useIntl4();
|
|
11309
11185
|
const createSnackbar = useSnackBarIfAvailable();
|
|
11310
11186
|
const copy = () => {
|
|
11311
11187
|
navigator.clipboard.writeText(text).then(() => createSnackbar({ text: formatMessage(paragraph_messages_default.copied) })).catch(() => {
|
|
11312
11188
|
});
|
|
11313
11189
|
};
|
|
11314
11190
|
const inputAlignmentClasses = getTextAlignmentAndMargin({ align, margin: "sm" });
|
|
11315
|
-
return /* @__PURE__ */
|
|
11316
|
-
/* @__PURE__ */
|
|
11191
|
+
return /* @__PURE__ */ jsxs10("div", { className, children: [
|
|
11192
|
+
/* @__PURE__ */ jsx37(
|
|
11317
11193
|
Input4,
|
|
11318
11194
|
{
|
|
11319
11195
|
type: "text",
|
|
@@ -11322,20 +11198,20 @@ function CopyableParagraph({
|
|
|
11322
11198
|
className: (0, import_classnames5.default)("text-ellipsis", inputAlignmentClasses)
|
|
11323
11199
|
}
|
|
11324
11200
|
),
|
|
11325
|
-
/* @__PURE__ */
|
|
11201
|
+
/* @__PURE__ */ jsx37(Button3, { block: true, onClick: copy, children: formatMessage(paragraph_messages_default.copy) })
|
|
11326
11202
|
] });
|
|
11327
11203
|
}
|
|
11328
11204
|
var ParagraphRenderer_default = ParagraphRenderer;
|
|
11329
11205
|
|
|
11330
11206
|
// src/revamp/wise/renderers/RepeatableRenderer.tsx
|
|
11331
|
-
import { Button as
|
|
11332
|
-
import { useState as
|
|
11207
|
+
import { Button as Button4, Header as Header3, Modal as Modal2, NavigationOption as NavigationOption2, InlineAlert as InlineAlert3 } from "@transferwise/components";
|
|
11208
|
+
import { useState as useState6 } from "react";
|
|
11333
11209
|
import { Plus } from "@transferwise/icons";
|
|
11334
|
-
import { useIntl as
|
|
11210
|
+
import { useIntl as useIntl5 } from "react-intl";
|
|
11335
11211
|
|
|
11336
11212
|
// src/common/messages/repeatable.messages.ts
|
|
11337
|
-
import { defineMessages as
|
|
11338
|
-
var repeatable_messages_default =
|
|
11213
|
+
import { defineMessages as defineMessages7 } from "react-intl";
|
|
11214
|
+
var repeatable_messages_default = defineMessages7({
|
|
11339
11215
|
addItemTitle: {
|
|
11340
11216
|
id: "dynamicFlows.ArraySchema.addItemTitle",
|
|
11341
11217
|
defaultMessage: "Add Item",
|
|
@@ -11360,10 +11236,10 @@ var repeatable_messages_default = defineMessages8({
|
|
|
11360
11236
|
|
|
11361
11237
|
// src/revamp/wise/renderers/RepeatableRenderer.tsx
|
|
11362
11238
|
var import_classnames6 = __toESM(require_classnames());
|
|
11363
|
-
import { Fragment as Fragment4, jsx as
|
|
11239
|
+
import { Fragment as Fragment4, jsx as jsx38, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
11364
11240
|
var RepeatableRenderer = {
|
|
11365
11241
|
canRenderType: "repeatable",
|
|
11366
|
-
render: (props) => /* @__PURE__ */
|
|
11242
|
+
render: (props) => /* @__PURE__ */ jsx38(Repeatable, __spreadValues({}, props))
|
|
11367
11243
|
};
|
|
11368
11244
|
function Repeatable(props) {
|
|
11369
11245
|
const {
|
|
@@ -11379,8 +11255,8 @@ function Repeatable(props) {
|
|
|
11379
11255
|
onSave,
|
|
11380
11256
|
onRemove
|
|
11381
11257
|
} = props;
|
|
11382
|
-
const { formatMessage } =
|
|
11383
|
-
const [openModalType, setOpenModalType] =
|
|
11258
|
+
const { formatMessage } = useIntl5();
|
|
11259
|
+
const [openModalType, setOpenModalType] = useState6(null);
|
|
11384
11260
|
const onAddItem = () => {
|
|
11385
11261
|
onAdd();
|
|
11386
11262
|
setOpenModalType("add");
|
|
@@ -11402,40 +11278,40 @@ function Repeatable(props) {
|
|
|
11402
11278
|
const onCancelEdit = () => {
|
|
11403
11279
|
setOpenModalType(null);
|
|
11404
11280
|
};
|
|
11405
|
-
return /* @__PURE__ */
|
|
11406
|
-
title && /* @__PURE__ */
|
|
11407
|
-
description && /* @__PURE__ */
|
|
11408
|
-
/* @__PURE__ */
|
|
11281
|
+
return /* @__PURE__ */ jsxs11(Fragment4, { children: [
|
|
11282
|
+
title && /* @__PURE__ */ jsx38(Header3, { title }),
|
|
11283
|
+
description && /* @__PURE__ */ jsx38("p", { children: description }),
|
|
11284
|
+
/* @__PURE__ */ jsxs11(
|
|
11409
11285
|
"div",
|
|
11410
11286
|
{
|
|
11411
11287
|
className: (0, import_classnames6.default)("form-group", {
|
|
11412
11288
|
"has-error": error
|
|
11413
11289
|
}),
|
|
11414
11290
|
children: [
|
|
11415
|
-
items == null ? void 0 : items.map((item, index) => /* @__PURE__ */
|
|
11416
|
-
/* @__PURE__ */
|
|
11291
|
+
items == null ? void 0 : items.map((item, index) => /* @__PURE__ */ jsx38(ItemSummaryOption, { item, onClick: () => onEditItem(index) }, item.id)),
|
|
11292
|
+
/* @__PURE__ */ jsx38(
|
|
11417
11293
|
NavigationOption2,
|
|
11418
11294
|
{
|
|
11419
|
-
media: /* @__PURE__ */
|
|
11295
|
+
media: /* @__PURE__ */ jsx38(Plus, {}),
|
|
11420
11296
|
title: addItemTitle || formatMessage(repeatable_messages_default.addItemTitle),
|
|
11421
11297
|
showMediaAtAllSizes: true,
|
|
11422
11298
|
onClick: () => onAddItem()
|
|
11423
11299
|
}
|
|
11424
11300
|
),
|
|
11425
|
-
error && /* @__PURE__ */
|
|
11301
|
+
error && /* @__PURE__ */ jsx38(InlineAlert3, { type: "negative", children: error })
|
|
11426
11302
|
]
|
|
11427
11303
|
}
|
|
11428
11304
|
),
|
|
11429
|
-
/* @__PURE__ */
|
|
11305
|
+
/* @__PURE__ */ jsx38(
|
|
11430
11306
|
Modal2,
|
|
11431
11307
|
{
|
|
11432
11308
|
open: openModalType !== null,
|
|
11433
11309
|
title: (openModalType === "add" ? addItemTitle : editItemTitle) || formatMessage(repeatable_messages_default.addItemTitle),
|
|
11434
|
-
body: /* @__PURE__ */
|
|
11435
|
-
/* @__PURE__ */
|
|
11436
|
-
/* @__PURE__ */
|
|
11437
|
-
/* @__PURE__ */
|
|
11438
|
-
/* @__PURE__ */
|
|
11310
|
+
body: /* @__PURE__ */ jsxs11(Fragment4, { children: [
|
|
11311
|
+
/* @__PURE__ */ jsx38("div", { className: "m-b-2", children: editableItem }),
|
|
11312
|
+
/* @__PURE__ */ jsxs11("div", { children: [
|
|
11313
|
+
/* @__PURE__ */ jsx38(Button4, { priority: "primary", block: true, className: "m-b-2", onClick: () => onSaveItem(), children: formatMessage(repeatable_messages_default.addItem) }),
|
|
11314
|
+
/* @__PURE__ */ jsx38(Button4, { priority: "secondary", type: "negative", block: true, onClick: () => onRemoveItem(), children: formatMessage(repeatable_messages_default.removeItem) })
|
|
11439
11315
|
] })
|
|
11440
11316
|
] }),
|
|
11441
11317
|
onClose: () => onCancelEdit()
|
|
@@ -11447,10 +11323,10 @@ function ItemSummaryOption({
|
|
|
11447
11323
|
item,
|
|
11448
11324
|
onClick
|
|
11449
11325
|
}) {
|
|
11450
|
-
return /* @__PURE__ */
|
|
11326
|
+
return /* @__PURE__ */ jsx38(
|
|
11451
11327
|
NavigationOption2,
|
|
11452
11328
|
{
|
|
11453
|
-
media: /* @__PURE__ */
|
|
11329
|
+
media: /* @__PURE__ */ jsx38(NavigationOptionMedia, __spreadValues({}, item)),
|
|
11454
11330
|
title: item.title,
|
|
11455
11331
|
content: item.description,
|
|
11456
11332
|
showMediaAtAllSizes: true,
|
|
@@ -11461,17 +11337,17 @@ function ItemSummaryOption({
|
|
|
11461
11337
|
var RepeatableRenderer_default = RepeatableRenderer;
|
|
11462
11338
|
|
|
11463
11339
|
// src/revamp/wise/renderers/SearchRenderer/BlockSearchRendererComponent.tsx
|
|
11464
|
-
import { Input as Input5, Markdown as
|
|
11340
|
+
import { Input as Input5, Markdown as Markdown3, NavigationOption as NavigationOption3, NavigationOptionsList as NavigationOptionsList2 } from "@transferwise/components";
|
|
11465
11341
|
|
|
11466
11342
|
// src/revamp/wise/renderers/SearchRenderer/ErrorResult.tsx
|
|
11467
|
-
import { useIntl as
|
|
11468
|
-
import { jsx as
|
|
11343
|
+
import { useIntl as useIntl6 } from "react-intl";
|
|
11344
|
+
import { jsx as jsx39, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
11469
11345
|
function ErrorResult({ state }) {
|
|
11470
|
-
const intl =
|
|
11471
|
-
return /* @__PURE__ */
|
|
11346
|
+
const intl = useIntl6();
|
|
11347
|
+
return /* @__PURE__ */ jsxs12("p", { className: "m-t-2", children: [
|
|
11472
11348
|
intl.formatMessage(generic_error_messages_default.genericError),
|
|
11473
11349
|
"\xA0",
|
|
11474
|
-
/* @__PURE__ */
|
|
11350
|
+
/* @__PURE__ */ jsx39(
|
|
11475
11351
|
"a",
|
|
11476
11352
|
{
|
|
11477
11353
|
href: "/",
|
|
@@ -11486,8 +11362,8 @@ function ErrorResult({ state }) {
|
|
|
11486
11362
|
}
|
|
11487
11363
|
|
|
11488
11364
|
// src/revamp/wise/renderers/SearchRenderer/BlockSearchRendererComponent.tsx
|
|
11489
|
-
import { useState as
|
|
11490
|
-
import { Fragment as Fragment5, jsx as
|
|
11365
|
+
import { useState as useState7 } from "react";
|
|
11366
|
+
import { Fragment as Fragment5, jsx as jsx40, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
11491
11367
|
function BlockSearchRendererComponent({
|
|
11492
11368
|
id,
|
|
11493
11369
|
isLoading,
|
|
@@ -11497,10 +11373,10 @@ function BlockSearchRendererComponent({
|
|
|
11497
11373
|
state,
|
|
11498
11374
|
title
|
|
11499
11375
|
}) {
|
|
11500
|
-
const [hasSearched, setHasSearched] =
|
|
11376
|
+
const [hasSearched, setHasSearched] = useState7(false);
|
|
11501
11377
|
const trackEvent = useTrackEvent();
|
|
11502
|
-
return /* @__PURE__ */
|
|
11503
|
-
/* @__PURE__ */
|
|
11378
|
+
return /* @__PURE__ */ jsxs13("div", { className: getMargin(margin), children: [
|
|
11379
|
+
/* @__PURE__ */ jsx40(FieldInput_default, { id, description: "", error: "", help: "", label: title, children: /* @__PURE__ */ jsx40(
|
|
11504
11380
|
Input5,
|
|
11505
11381
|
{
|
|
11506
11382
|
id,
|
|
@@ -11517,7 +11393,7 @@ function BlockSearchRendererComponent({
|
|
|
11517
11393
|
}
|
|
11518
11394
|
}
|
|
11519
11395
|
) }),
|
|
11520
|
-
isLoading ? /* @__PURE__ */
|
|
11396
|
+
isLoading ? /* @__PURE__ */ jsx40(Fragment5, { children: "Loading..." }) : /* @__PURE__ */ jsx40(SearchResultContent, { state, onChange })
|
|
11521
11397
|
] });
|
|
11522
11398
|
}
|
|
11523
11399
|
function SearchResultContent({
|
|
@@ -11526,29 +11402,29 @@ function SearchResultContent({
|
|
|
11526
11402
|
}) {
|
|
11527
11403
|
switch (state.type) {
|
|
11528
11404
|
case "error":
|
|
11529
|
-
return /* @__PURE__ */
|
|
11405
|
+
return /* @__PURE__ */ jsx40(ErrorResult, { state });
|
|
11530
11406
|
case "results":
|
|
11531
|
-
return /* @__PURE__ */
|
|
11407
|
+
return /* @__PURE__ */ jsx40(SearchResults, { state, onChange });
|
|
11532
11408
|
case "noResults":
|
|
11533
|
-
return /* @__PURE__ */
|
|
11409
|
+
return /* @__PURE__ */ jsx40(EmptySearchResult, { state });
|
|
11534
11410
|
case "pending":
|
|
11535
11411
|
default:
|
|
11536
11412
|
return null;
|
|
11537
11413
|
}
|
|
11538
11414
|
}
|
|
11539
11415
|
function EmptySearchResult({ state }) {
|
|
11540
|
-
return /* @__PURE__ */
|
|
11416
|
+
return /* @__PURE__ */ jsx40(Markdown3, { className: "m-t-2", config: { link: { target: "_blank" } }, children: state.message });
|
|
11541
11417
|
}
|
|
11542
11418
|
function SearchResults({
|
|
11543
11419
|
state
|
|
11544
11420
|
}) {
|
|
11545
11421
|
const trackEvent = useTrackEvent();
|
|
11546
|
-
return /* @__PURE__ */
|
|
11422
|
+
return /* @__PURE__ */ jsx40(NavigationOptionsList2, { children: state.results.map((result) => /* @__PURE__ */ jsx40(
|
|
11547
11423
|
NavigationOption3,
|
|
11548
11424
|
{
|
|
11549
11425
|
title: result.title,
|
|
11550
11426
|
content: result.description,
|
|
11551
|
-
media: /* @__PURE__ */
|
|
11427
|
+
media: /* @__PURE__ */ jsx40(NavigationOptionMedia, __spreadValues({}, result)),
|
|
11552
11428
|
showMediaCircle: false,
|
|
11553
11429
|
showMediaAtAllSizes: true,
|
|
11554
11430
|
onClick: () => {
|
|
@@ -11564,10 +11440,10 @@ function SearchResults({
|
|
|
11564
11440
|
var BlockSearchRendererComponent_default = BlockSearchRendererComponent;
|
|
11565
11441
|
|
|
11566
11442
|
// src/revamp/wise/renderers/SearchRenderer/InlineSearchRendererComponent.tsx
|
|
11567
|
-
import { Markdown as
|
|
11443
|
+
import { Markdown as Markdown4, Typeahead } from "@transferwise/components";
|
|
11568
11444
|
import { Search } from "@transferwise/icons";
|
|
11569
|
-
import { useState as
|
|
11570
|
-
import { jsx as
|
|
11445
|
+
import { useState as useState8 } from "react";
|
|
11446
|
+
import { jsx as jsx41, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
11571
11447
|
function InlineSearchRenderer({
|
|
11572
11448
|
id,
|
|
11573
11449
|
isLoading,
|
|
@@ -11576,21 +11452,21 @@ function InlineSearchRenderer({
|
|
|
11576
11452
|
state,
|
|
11577
11453
|
title
|
|
11578
11454
|
}) {
|
|
11579
|
-
const [hasSearched, setHasSearched] =
|
|
11455
|
+
const [hasSearched, setHasSearched] = useState8(false);
|
|
11580
11456
|
const trackEvent = useTrackEvent();
|
|
11581
|
-
return /* @__PURE__ */
|
|
11457
|
+
return /* @__PURE__ */ jsx41("div", { className: getMargin(margin), children: /* @__PURE__ */ jsxs14(FieldInput_default, { id, description: "", error: "", help: "", label: title, children: [
|
|
11582
11458
|
id,
|
|
11583
|
-
/* @__PURE__ */
|
|
11459
|
+
/* @__PURE__ */ jsx41(
|
|
11584
11460
|
Typeahead,
|
|
11585
11461
|
{
|
|
11586
11462
|
id: "typeahead-input-id",
|
|
11587
11463
|
name: "typeahead-input-name",
|
|
11588
11464
|
size: "md",
|
|
11589
11465
|
maxHeight: 100,
|
|
11590
|
-
footer: /* @__PURE__ */
|
|
11466
|
+
footer: /* @__PURE__ */ jsx41(TypeaheadFooter, { state, isLoading }),
|
|
11591
11467
|
multiple: false,
|
|
11592
11468
|
clearable: false,
|
|
11593
|
-
addon: /* @__PURE__ */
|
|
11469
|
+
addon: /* @__PURE__ */ jsx41(Search, { size: 24 }),
|
|
11594
11470
|
options: state.type === "results" ? state.results.map(mapResultToTypeaheadOption) : [],
|
|
11595
11471
|
minQueryLength: 1,
|
|
11596
11472
|
onChange: (values) => {
|
|
@@ -11627,23 +11503,23 @@ function mapResultToTypeaheadOption(result) {
|
|
|
11627
11503
|
}
|
|
11628
11504
|
function TypeaheadFooter({ state, isLoading }) {
|
|
11629
11505
|
if (state.type === "noResults") {
|
|
11630
|
-
return /* @__PURE__ */
|
|
11506
|
+
return /* @__PURE__ */ jsx41(Markdown4, { className: "m-t-2 m-x-2", config: { link: { target: "_blank" } }, children: state.message });
|
|
11631
11507
|
}
|
|
11632
11508
|
if (state.type === "error") {
|
|
11633
|
-
return /* @__PURE__ */
|
|
11509
|
+
return /* @__PURE__ */ jsx41("div", { className: "m-t-2 m-x-2", children: /* @__PURE__ */ jsx41(ErrorResult, { state }) });
|
|
11634
11510
|
}
|
|
11635
11511
|
if (state.type === "pending" || isLoading) {
|
|
11636
|
-
return /* @__PURE__ */
|
|
11512
|
+
return /* @__PURE__ */ jsx41("p", { className: "m-t-2 m-x-2", children: "Loading..." });
|
|
11637
11513
|
}
|
|
11638
11514
|
return null;
|
|
11639
11515
|
}
|
|
11640
11516
|
var InlineSearchRendererComponent_default = InlineSearchRenderer;
|
|
11641
11517
|
|
|
11642
11518
|
// src/revamp/wise/renderers/SearchRenderer/SearchRenderer.tsx
|
|
11643
|
-
import { jsx as
|
|
11519
|
+
import { jsx as jsx42 } from "react/jsx-runtime";
|
|
11644
11520
|
var SearchRenderer = {
|
|
11645
11521
|
canRenderType: "search",
|
|
11646
|
-
render: (props) => props.control === "inline" ? /* @__PURE__ */
|
|
11522
|
+
render: (props) => props.control === "inline" ? /* @__PURE__ */ jsx42(InlineSearchRendererComponent_default, __spreadValues({}, props)) : /* @__PURE__ */ jsx42(BlockSearchRendererComponent_default, __spreadValues({}, props))
|
|
11647
11523
|
};
|
|
11648
11524
|
var SearchRenderer_default = SearchRenderer;
|
|
11649
11525
|
|
|
@@ -11651,23 +11527,23 @@ var SearchRenderer_default = SearchRenderer;
|
|
|
11651
11527
|
import { RadioGroup } from "@transferwise/components";
|
|
11652
11528
|
|
|
11653
11529
|
// src/revamp/wise/renderers/SelectInputRenderer/OptionMedia.tsx
|
|
11654
|
-
import { Avatar as
|
|
11655
|
-
import { jsx as
|
|
11530
|
+
import { Avatar as Avatar2, AvatarType as AvatarType2 } from "@transferwise/components";
|
|
11531
|
+
import { jsx as jsx43 } from "react/jsx-runtime";
|
|
11656
11532
|
function OptionMedia({ icon, image }) {
|
|
11657
11533
|
if (image == null ? void 0 : image.url) {
|
|
11658
|
-
return /* @__PURE__ */
|
|
11534
|
+
return /* @__PURE__ */ jsx43("img", { src: image.url, alt: image.accessibilityDescription || "", width: "64px" });
|
|
11659
11535
|
}
|
|
11660
11536
|
if (icon && "name" in icon) {
|
|
11661
|
-
return /* @__PURE__ */
|
|
11537
|
+
return /* @__PURE__ */ jsx43(Avatar2, { type: AvatarType2.ICON, children: /* @__PURE__ */ jsx43(DynamicIcon_default, { name: icon.name }) });
|
|
11662
11538
|
}
|
|
11663
11539
|
if (icon && "text" in icon) {
|
|
11664
|
-
return /* @__PURE__ */
|
|
11540
|
+
return /* @__PURE__ */ jsx43(Avatar2, { type: AvatarType2.INITIALS, children: icon.text });
|
|
11665
11541
|
}
|
|
11666
11542
|
return null;
|
|
11667
11543
|
}
|
|
11668
11544
|
|
|
11669
11545
|
// src/revamp/wise/renderers/SelectInputRenderer/RadioInputRendererComponent.tsx
|
|
11670
|
-
import { Fragment as Fragment6, jsx as
|
|
11546
|
+
import { Fragment as Fragment6, jsx as jsx44, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
11671
11547
|
function RadioInputRendererComponent(props) {
|
|
11672
11548
|
const {
|
|
11673
11549
|
id,
|
|
@@ -11681,8 +11557,8 @@ function RadioInputRendererComponent(props) {
|
|
|
11681
11557
|
selectedIndex,
|
|
11682
11558
|
onSelect
|
|
11683
11559
|
} = props;
|
|
11684
|
-
return /* @__PURE__ */
|
|
11685
|
-
/* @__PURE__ */
|
|
11560
|
+
return /* @__PURE__ */ jsxs15(Fragment6, { children: [
|
|
11561
|
+
/* @__PURE__ */ jsx44(FieldInput_default, { id, label, help, description, error, children: /* @__PURE__ */ jsx44("span", { children: /* @__PURE__ */ jsx44(
|
|
11686
11562
|
RadioGroup,
|
|
11687
11563
|
{
|
|
11688
11564
|
name: id,
|
|
@@ -11691,7 +11567,7 @@ function RadioInputRendererComponent(props) {
|
|
|
11691
11567
|
value: index,
|
|
11692
11568
|
secondary: option.description,
|
|
11693
11569
|
disabled: option.disabled || disabled,
|
|
11694
|
-
avatar: /* @__PURE__ */
|
|
11570
|
+
avatar: /* @__PURE__ */ jsx44(OptionMedia, { icon: option.icon, image: option.image })
|
|
11695
11571
|
})),
|
|
11696
11572
|
selectedValue: selectedIndex != null ? selectedIndex : void 0,
|
|
11697
11573
|
onChange: onSelect
|
|
@@ -11703,8 +11579,8 @@ function RadioInputRendererComponent(props) {
|
|
|
11703
11579
|
|
|
11704
11580
|
// src/revamp/wise/renderers/SelectInputRenderer/TabInputRendererComponent.tsx
|
|
11705
11581
|
import { Tabs } from "@transferwise/components";
|
|
11706
|
-
import { useEffect as
|
|
11707
|
-
import { Fragment as Fragment7, jsx as
|
|
11582
|
+
import { useEffect as useEffect4 } from "react";
|
|
11583
|
+
import { Fragment as Fragment7, jsx as jsx45, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
11708
11584
|
function TabInputRendererComponent(props) {
|
|
11709
11585
|
const {
|
|
11710
11586
|
id,
|
|
@@ -11718,13 +11594,13 @@ function TabInputRendererComponent(props) {
|
|
|
11718
11594
|
selectedIndex,
|
|
11719
11595
|
onSelect
|
|
11720
11596
|
} = props;
|
|
11721
|
-
|
|
11597
|
+
useEffect4(() => {
|
|
11722
11598
|
if (!isValidIndex(selectedIndex, options.length)) {
|
|
11723
11599
|
onSelect(0);
|
|
11724
11600
|
}
|
|
11725
11601
|
}, [selectedIndex, onSelect, options.length]);
|
|
11726
|
-
return /* @__PURE__ */
|
|
11727
|
-
/* @__PURE__ */
|
|
11602
|
+
return /* @__PURE__ */ jsxs16(Fragment7, { children: [
|
|
11603
|
+
/* @__PURE__ */ jsx45(FieldInput_default, { id, label, help, description, error, children: /* @__PURE__ */ jsx45(
|
|
11728
11604
|
Tabs,
|
|
11729
11605
|
{
|
|
11730
11606
|
name: id,
|
|
@@ -11733,7 +11609,7 @@ function TabInputRendererComponent(props) {
|
|
|
11733
11609
|
title: option.title,
|
|
11734
11610
|
// if we pass null, we get some props-types console errors
|
|
11735
11611
|
// eslint-disable-next-line react/jsx-no-useless-fragment
|
|
11736
|
-
content: /* @__PURE__ */
|
|
11612
|
+
content: /* @__PURE__ */ jsx45(Fragment7, {}),
|
|
11737
11613
|
disabled: option.disabled || disabled
|
|
11738
11614
|
})),
|
|
11739
11615
|
onTabSelect: onSelect
|
|
@@ -11748,23 +11624,23 @@ var isValidIndex = (index, options) => index !== null && index >= 0 && index < o
|
|
|
11748
11624
|
import { SelectInput, SelectInputOptionContent } from "@transferwise/components";
|
|
11749
11625
|
|
|
11750
11626
|
// src/revamp/wise/renderers/SelectInputRenderer/SelectTriggerMedia.tsx
|
|
11751
|
-
import { Avatar as
|
|
11752
|
-
import { jsx as
|
|
11627
|
+
import { Avatar as Avatar3, AvatarType as AvatarType3 } from "@transferwise/components";
|
|
11628
|
+
import { jsx as jsx46 } from "react/jsx-runtime";
|
|
11753
11629
|
function SelectTriggerMedia({ icon, image }) {
|
|
11754
11630
|
if (image == null ? void 0 : image.url) {
|
|
11755
11631
|
return null;
|
|
11756
11632
|
}
|
|
11757
11633
|
if (icon && "name" in icon) {
|
|
11758
|
-
return /* @__PURE__ */
|
|
11634
|
+
return /* @__PURE__ */ jsx46(Avatar3, { type: AvatarType3.ICON, size: 24, children: /* @__PURE__ */ jsx46(DynamicIcon_default, { name: icon.name }) });
|
|
11759
11635
|
}
|
|
11760
11636
|
if (icon && "text" in icon) {
|
|
11761
|
-
return /* @__PURE__ */
|
|
11637
|
+
return /* @__PURE__ */ jsx46(Avatar3, { type: AvatarType3.ICON, size: 24, children: icon.text });
|
|
11762
11638
|
}
|
|
11763
11639
|
return null;
|
|
11764
11640
|
}
|
|
11765
11641
|
|
|
11766
11642
|
// src/revamp/wise/renderers/SelectInputRenderer/SelectInputRendererComponent.tsx
|
|
11767
|
-
import { Fragment as Fragment8, jsx as
|
|
11643
|
+
import { Fragment as Fragment8, jsx as jsx47, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
11768
11644
|
function SelectInputRendererComponent(props) {
|
|
11769
11645
|
const {
|
|
11770
11646
|
id,
|
|
@@ -11776,6 +11652,7 @@ function SelectInputRendererComponent(props) {
|
|
|
11776
11652
|
label,
|
|
11777
11653
|
options,
|
|
11778
11654
|
placeholder,
|
|
11655
|
+
required,
|
|
11779
11656
|
selectedIndex,
|
|
11780
11657
|
onSelect
|
|
11781
11658
|
} = props;
|
|
@@ -11798,16 +11675,16 @@ function SelectInputRendererComponent(props) {
|
|
|
11798
11675
|
const contentProps = withinTrigger ? {
|
|
11799
11676
|
title: option.title,
|
|
11800
11677
|
note: option.description,
|
|
11801
|
-
icon: /* @__PURE__ */
|
|
11678
|
+
icon: /* @__PURE__ */ jsx47(SelectTriggerMedia, { icon: option.icon, image: option.image })
|
|
11802
11679
|
} : {
|
|
11803
11680
|
title: option.title,
|
|
11804
11681
|
description: option.description,
|
|
11805
|
-
icon: /* @__PURE__ */
|
|
11682
|
+
icon: /* @__PURE__ */ jsx47(OptionMedia, { icon: option.icon, image: option.image })
|
|
11806
11683
|
};
|
|
11807
|
-
return /* @__PURE__ */
|
|
11684
|
+
return /* @__PURE__ */ jsx47(SelectInputOptionContent, __spreadValues({}, contentProps));
|
|
11808
11685
|
};
|
|
11809
|
-
return /* @__PURE__ */
|
|
11810
|
-
/* @__PURE__ */
|
|
11686
|
+
return /* @__PURE__ */ jsxs17(Fragment8, { children: [
|
|
11687
|
+
/* @__PURE__ */ jsx47(FieldInput_default, { id, label, help, description, error, children: /* @__PURE__ */ jsx47(
|
|
11811
11688
|
SelectInput,
|
|
11812
11689
|
{
|
|
11813
11690
|
name: id,
|
|
@@ -11818,26 +11695,60 @@ function SelectInputRendererComponent(props) {
|
|
|
11818
11695
|
renderValue,
|
|
11819
11696
|
filterable: items.length >= 8,
|
|
11820
11697
|
onChange: onSelect,
|
|
11821
|
-
onClear: () => onSelect(null)
|
|
11698
|
+
onClear: required ? void 0 : () => onSelect(null)
|
|
11822
11699
|
}
|
|
11823
11700
|
) }),
|
|
11824
11701
|
children
|
|
11825
11702
|
] });
|
|
11826
11703
|
}
|
|
11827
11704
|
|
|
11705
|
+
// src/revamp/wise/renderers/SelectInputRenderer/SegmentedInputRendererComponent.tsx
|
|
11706
|
+
import { useEffect as useEffect5 } from "react";
|
|
11707
|
+
import { SegmentedControl } from "@transferwise/components";
|
|
11708
|
+
import { Fragment as Fragment9, jsx as jsx48, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
11709
|
+
function SegmentedInputRendererComponent(props) {
|
|
11710
|
+
const { id, children, description, error, help, label, options, selectedIndex, onSelect } = props;
|
|
11711
|
+
useEffect5(() => {
|
|
11712
|
+
if (!isValidIndex2(selectedIndex, options.length)) {
|
|
11713
|
+
onSelect(0);
|
|
11714
|
+
}
|
|
11715
|
+
}, [selectedIndex, onSelect, options.length]);
|
|
11716
|
+
return /* @__PURE__ */ jsxs18(Fragment9, { children: [
|
|
11717
|
+
/* @__PURE__ */ jsx48(FieldInput_default, { id, label, help, description, error, children: /* @__PURE__ */ jsx48(
|
|
11718
|
+
SegmentedControl,
|
|
11719
|
+
{
|
|
11720
|
+
name: `${id}-segmented-control`,
|
|
11721
|
+
value: String(selectedIndex),
|
|
11722
|
+
mode: "view",
|
|
11723
|
+
segments: options.map((option, index) => ({
|
|
11724
|
+
id: String(index),
|
|
11725
|
+
value: String(index),
|
|
11726
|
+
label: option.title,
|
|
11727
|
+
controls: `${id}-children`
|
|
11728
|
+
})),
|
|
11729
|
+
onChange: (value) => onSelect(Number(value))
|
|
11730
|
+
}
|
|
11731
|
+
) }),
|
|
11732
|
+
/* @__PURE__ */ jsx48("div", { id: `${id}-children`, children })
|
|
11733
|
+
] });
|
|
11734
|
+
}
|
|
11735
|
+
var isValidIndex2 = (index, options) => index !== null && index >= 0 && index < options;
|
|
11736
|
+
|
|
11828
11737
|
// src/revamp/wise/renderers/SelectInputRenderer/SelectInputRenderer.tsx
|
|
11829
|
-
import { jsx as
|
|
11738
|
+
import { jsx as jsx49 } from "react/jsx-runtime";
|
|
11830
11739
|
var SelectInputRenderer = {
|
|
11831
11740
|
canRenderType: "input-select",
|
|
11832
11741
|
render: (props) => {
|
|
11833
11742
|
switch (props.control) {
|
|
11834
11743
|
case "radio":
|
|
11835
|
-
return /* @__PURE__ */
|
|
11744
|
+
return /* @__PURE__ */ jsx49(RadioInputRendererComponent, __spreadValues({}, props));
|
|
11836
11745
|
case "tab":
|
|
11837
|
-
return props.options.length > 3 ? /* @__PURE__ */
|
|
11746
|
+
return props.options.length > 3 ? /* @__PURE__ */ jsx49(SelectInputRendererComponent, __spreadValues({}, props)) : /* @__PURE__ */ jsx49(TabInputRendererComponent, __spreadValues({}, props));
|
|
11747
|
+
case "segmented":
|
|
11748
|
+
return props.options.length > 3 ? /* @__PURE__ */ jsx49(SelectInputRendererComponent, __spreadValues({}, props)) : /* @__PURE__ */ jsx49(SegmentedInputRendererComponent, __spreadValues({}, props));
|
|
11838
11749
|
case "select":
|
|
11839
11750
|
default:
|
|
11840
|
-
return /* @__PURE__ */
|
|
11751
|
+
return /* @__PURE__ */ jsx49(SelectInputRendererComponent, __spreadValues({}, props));
|
|
11841
11752
|
}
|
|
11842
11753
|
}
|
|
11843
11754
|
};
|
|
@@ -11845,17 +11756,17 @@ var SelectInputRenderer_default = SelectInputRenderer;
|
|
|
11845
11756
|
|
|
11846
11757
|
// src/revamp/wise/renderers/StatusListRenderer.tsx
|
|
11847
11758
|
import { Header as Header4, Summary } from "@transferwise/components";
|
|
11848
|
-
import { jsx as
|
|
11759
|
+
import { jsx as jsx50, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
11849
11760
|
var StatusListRenderer = {
|
|
11850
11761
|
canRenderType: "status-list",
|
|
11851
|
-
render: ({ margin, items, title }) => /* @__PURE__ */
|
|
11852
|
-
title ? /* @__PURE__ */
|
|
11853
|
-
items.map(({ description, icon, status, title: itemTitle }) => /* @__PURE__ */
|
|
11762
|
+
render: ({ margin, items, title }) => /* @__PURE__ */ jsxs19("div", { className: getMargin(margin), children: [
|
|
11763
|
+
title ? /* @__PURE__ */ jsx50(Header4, { title }) : null,
|
|
11764
|
+
items.map(({ description, icon, status, title: itemTitle }) => /* @__PURE__ */ jsx50(
|
|
11854
11765
|
Summary,
|
|
11855
11766
|
{
|
|
11856
11767
|
title: itemTitle,
|
|
11857
11768
|
description,
|
|
11858
|
-
icon: icon && "name" in icon ? /* @__PURE__ */
|
|
11769
|
+
icon: icon && "name" in icon ? /* @__PURE__ */ jsx50(DynamicIcon_default, { name: icon.name }) : null,
|
|
11859
11770
|
status: mapStatus(status)
|
|
11860
11771
|
},
|
|
11861
11772
|
`${title}/${description || ""}`
|
|
@@ -11878,31 +11789,31 @@ import {
|
|
|
11878
11789
|
TextArea as TextArea2,
|
|
11879
11790
|
TextareaWithDisplayFormat
|
|
11880
11791
|
} from "@transferwise/components";
|
|
11881
|
-
import { jsx as
|
|
11792
|
+
import { jsx as jsx51 } from "react/jsx-runtime";
|
|
11882
11793
|
function VariableTextInput({
|
|
11883
11794
|
control,
|
|
11884
11795
|
inputProps
|
|
11885
11796
|
}) {
|
|
11886
11797
|
switch (control) {
|
|
11887
11798
|
case "password":
|
|
11888
|
-
return /* @__PURE__ */
|
|
11799
|
+
return /* @__PURE__ */ jsx51(TextInput, __spreadValues({ type: "password" }, inputProps));
|
|
11889
11800
|
case "email":
|
|
11890
|
-
return /* @__PURE__ */
|
|
11801
|
+
return /* @__PURE__ */ jsx51(TextInput, __spreadValues({ type: "email" }, inputProps));
|
|
11891
11802
|
case "textarea":
|
|
11892
|
-
return /* @__PURE__ */
|
|
11803
|
+
return /* @__PURE__ */ jsx51(TextAreaInput, __spreadValues({}, inputProps));
|
|
11893
11804
|
case "numeric":
|
|
11894
|
-
return /* @__PURE__ */
|
|
11805
|
+
return /* @__PURE__ */ jsx51(NumericInput, __spreadValues({ type: "number" }, inputProps));
|
|
11895
11806
|
case "phone-number":
|
|
11896
|
-
return /* @__PURE__ */
|
|
11807
|
+
return /* @__PURE__ */ jsx51(PhoneNumberInput, __spreadValues({}, inputProps));
|
|
11897
11808
|
default:
|
|
11898
|
-
return /* @__PURE__ */
|
|
11809
|
+
return /* @__PURE__ */ jsx51(TextInput, __spreadValues({ type: "text" }, inputProps));
|
|
11899
11810
|
}
|
|
11900
11811
|
}
|
|
11901
11812
|
function TextInput(_a) {
|
|
11902
11813
|
var _b = _a, { id, displayFormat, onChange } = _b, rest = __objRest(_b, ["id", "displayFormat", "onChange"]);
|
|
11903
11814
|
if (typeof displayFormat === "string") {
|
|
11904
11815
|
const inputProps = __spreadValues({ id, name: id, className: "form-control" }, rest);
|
|
11905
|
-
return /* @__PURE__ */
|
|
11816
|
+
return /* @__PURE__ */ jsx51(
|
|
11906
11817
|
InputWithDisplayFormat,
|
|
11907
11818
|
__spreadValues({
|
|
11908
11819
|
displayPattern: displayFormat,
|
|
@@ -11910,29 +11821,29 @@ function TextInput(_a) {
|
|
|
11910
11821
|
}, inputProps)
|
|
11911
11822
|
);
|
|
11912
11823
|
}
|
|
11913
|
-
return /* @__PURE__ */
|
|
11824
|
+
return /* @__PURE__ */ jsx51(Input6, __spreadValues({ id, name: id, onChange: (e) => onChange(e.target.value) }, rest));
|
|
11914
11825
|
}
|
|
11915
11826
|
function TextAreaInput(_a) {
|
|
11916
11827
|
var _b = _a, { id, displayFormat, onChange } = _b, rest = __objRest(_b, ["id", "displayFormat", "onChange"]);
|
|
11917
11828
|
const textAreaProps = __spreadValues({ id, name: id }, rest);
|
|
11918
|
-
return typeof displayFormat === "string" ? /* @__PURE__ */
|
|
11829
|
+
return typeof displayFormat === "string" ? /* @__PURE__ */ jsx51(
|
|
11919
11830
|
TextareaWithDisplayFormat,
|
|
11920
11831
|
__spreadValues({
|
|
11921
11832
|
displayPattern: displayFormat,
|
|
11922
11833
|
onChange: (newValue) => onChange(newValue)
|
|
11923
11834
|
}, textAreaProps)
|
|
11924
|
-
) : /* @__PURE__ */
|
|
11835
|
+
) : /* @__PURE__ */ jsx51(TextArea2, __spreadValues({ onChange: (e) => onChange(e.target.value) }, textAreaProps));
|
|
11925
11836
|
}
|
|
11926
11837
|
function NumericInput(_a) {
|
|
11927
11838
|
var _b = _a, { id, displayFormat, onChange } = _b, rest = __objRest(_b, ["id", "displayFormat", "onChange"]);
|
|
11928
11839
|
const numericProps = __spreadValues({ id, name: id, onWheel }, rest);
|
|
11929
|
-
return typeof displayFormat === "string" ? /* @__PURE__ */
|
|
11840
|
+
return typeof displayFormat === "string" ? /* @__PURE__ */ jsx51(
|
|
11930
11841
|
InputWithDisplayFormat,
|
|
11931
11842
|
__spreadValues({
|
|
11932
11843
|
displayPattern: displayFormat,
|
|
11933
11844
|
onChange: (newValue) => onChange(numericValueOrNull(newValue))
|
|
11934
11845
|
}, numericProps)
|
|
11935
|
-
) : /* @__PURE__ */
|
|
11846
|
+
) : /* @__PURE__ */ jsx51(
|
|
11936
11847
|
Input6,
|
|
11937
11848
|
__spreadValues({
|
|
11938
11849
|
onChange: ({ target: { value: newValue } }) => onChange(numericValueOrNull(newValue))
|
|
@@ -11941,12 +11852,12 @@ function NumericInput(_a) {
|
|
|
11941
11852
|
}
|
|
11942
11853
|
function PhoneNumberInput(_a) {
|
|
11943
11854
|
var _b = _a, { value } = _b, rest = __objRest(_b, ["value"]);
|
|
11944
|
-
return /* @__PURE__ */
|
|
11855
|
+
return /* @__PURE__ */ jsx51(PhoneNumber, __spreadValues({ initialValue: value }, rest));
|
|
11945
11856
|
}
|
|
11946
11857
|
var VariableTextInput_default = VariableTextInput;
|
|
11947
11858
|
|
|
11948
11859
|
// src/revamp/wise/renderers/TextInputRenderer.tsx
|
|
11949
|
-
import { jsx as
|
|
11860
|
+
import { jsx as jsx52 } from "react/jsx-runtime";
|
|
11950
11861
|
var TextInputRenderer = {
|
|
11951
11862
|
canRenderType: "input-text",
|
|
11952
11863
|
render: (props) => {
|
|
@@ -11971,14 +11882,14 @@ var TextInputRenderer = {
|
|
|
11971
11882
|
]);
|
|
11972
11883
|
const value = initialValue != null ? initialValue : "";
|
|
11973
11884
|
const inputProps = __spreadProps(__spreadValues({}, rest), { value, id });
|
|
11974
|
-
return /* @__PURE__ */
|
|
11885
|
+
return /* @__PURE__ */ jsx52(FieldInput_default, { id, label, description, error, help, children: /* @__PURE__ */ jsx52(VariableTextInput_default, { control, inputProps }) });
|
|
11975
11886
|
}
|
|
11976
11887
|
};
|
|
11977
11888
|
var TextInputRenderer_default = TextInputRenderer;
|
|
11978
11889
|
|
|
11979
11890
|
// src/revamp/wise/renderers/UploadInputRenderer.tsx
|
|
11980
11891
|
import { Upload, UploadInput as UploadInput2 } from "@transferwise/components";
|
|
11981
|
-
import { jsx as
|
|
11892
|
+
import { jsx as jsx53 } from "react/jsx-runtime";
|
|
11982
11893
|
var UploadInputRenderer = {
|
|
11983
11894
|
canRenderType: "input-upload",
|
|
11984
11895
|
render: (props) => {
|
|
@@ -11994,7 +11905,7 @@ var UploadInputRenderer = {
|
|
|
11994
11905
|
};
|
|
11995
11906
|
return (
|
|
11996
11907
|
// We don't pass help here as there is no sensible place to display it
|
|
11997
|
-
/* @__PURE__ */
|
|
11908
|
+
/* @__PURE__ */ jsx53(UploadFieldInput_default, { id, label: void 0, description: void 0, error, children: /* @__PURE__ */ jsx53(
|
|
11998
11909
|
UploadInput2,
|
|
11999
11910
|
{
|
|
12000
11911
|
id,
|
|
@@ -12049,7 +11960,7 @@ var LargeUploadRenderer = {
|
|
|
12049
11960
|
throw e;
|
|
12050
11961
|
}
|
|
12051
11962
|
};
|
|
12052
|
-
return /* @__PURE__ */
|
|
11963
|
+
return /* @__PURE__ */ jsx53(FieldInput_default, { id, label, description, error, help, children: /* @__PURE__ */ jsx53(
|
|
12053
11964
|
Upload,
|
|
12054
11965
|
__spreadProps(__spreadValues({}, uploadProps), {
|
|
12055
11966
|
usAccept: getAcceptsString(accepts),
|
|
@@ -12064,7 +11975,7 @@ var LargeUploadRenderer = {
|
|
|
12064
11975
|
|
|
12065
11976
|
// src/revamp/wise/renderers/ReviewRenderer.tsx
|
|
12066
11977
|
import { DefinitionList, Header as Header5 } from "@transferwise/components";
|
|
12067
|
-
import { Fragment as
|
|
11978
|
+
import { Fragment as Fragment10, jsx as jsx54, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
12068
11979
|
var ReviewRenderer = {
|
|
12069
11980
|
canRenderType: "review",
|
|
12070
11981
|
render: ({ callToAction, control, fields, margin, title }) => {
|
|
@@ -12076,9 +11987,9 @@ var ReviewRenderer = {
|
|
|
12076
11987
|
callToAction.onClick();
|
|
12077
11988
|
}
|
|
12078
11989
|
} : void 0;
|
|
12079
|
-
return /* @__PURE__ */
|
|
12080
|
-
(title || callToAction) && /* @__PURE__ */
|
|
12081
|
-
/* @__PURE__ */
|
|
11990
|
+
return /* @__PURE__ */ jsxs20("div", { className: getMargin(margin), children: [
|
|
11991
|
+
(title || callToAction) && /* @__PURE__ */ jsx54(Header5, { title: title != null ? title : "", action }),
|
|
11992
|
+
/* @__PURE__ */ jsx54("div", { className: margin, children: /* @__PURE__ */ jsx54(
|
|
12082
11993
|
DefinitionList,
|
|
12083
11994
|
{
|
|
12084
11995
|
layout: orientation,
|
|
@@ -12095,19 +12006,147 @@ var ReviewRenderer = {
|
|
|
12095
12006
|
var ReviewRenderer_default = ReviewRenderer;
|
|
12096
12007
|
var getFieldValue = (value, help, orientation) => {
|
|
12097
12008
|
if (help) {
|
|
12098
|
-
return orientation === "HORIZONTAL_RIGHT_ALIGNED" ? /* @__PURE__ */
|
|
12099
|
-
/* @__PURE__ */
|
|
12009
|
+
return orientation === "HORIZONTAL_RIGHT_ALIGNED" ? /* @__PURE__ */ jsxs20(Fragment10, { children: [
|
|
12010
|
+
/* @__PURE__ */ jsx54(Help_default, { help }),
|
|
12100
12011
|
" ",
|
|
12101
12012
|
value
|
|
12102
|
-
] }) : /* @__PURE__ */
|
|
12013
|
+
] }) : /* @__PURE__ */ jsxs20(Fragment10, { children: [
|
|
12103
12014
|
value,
|
|
12104
12015
|
" ",
|
|
12105
|
-
/* @__PURE__ */
|
|
12016
|
+
/* @__PURE__ */ jsx54(Help_default, { help })
|
|
12106
12017
|
] });
|
|
12107
12018
|
}
|
|
12108
12019
|
return value;
|
|
12109
12020
|
};
|
|
12110
12021
|
|
|
12022
|
+
// src/revamp/wise/renderers/step/StepRenderer.tsx
|
|
12023
|
+
import { useMemo as useMemo4 } from "react";
|
|
12024
|
+
|
|
12025
|
+
// src/revamp/wise/renderers/step/ExternalConfirmationDialog.tsx
|
|
12026
|
+
import { useIntl as useIntl7 } from "react-intl";
|
|
12027
|
+
|
|
12028
|
+
// src/common/messages/external-confirmation.messages.ts
|
|
12029
|
+
import { defineMessages as defineMessages8 } from "react-intl";
|
|
12030
|
+
var external_confirmation_messages_default = defineMessages8({
|
|
12031
|
+
title: {
|
|
12032
|
+
id: "dynamicFlows.ExternalConfirmation.title",
|
|
12033
|
+
defaultMessage: "Please confirm",
|
|
12034
|
+
description: "Heading for the confirmation screen."
|
|
12035
|
+
},
|
|
12036
|
+
description: {
|
|
12037
|
+
id: "dynamicFlows.ExternalConfirmation.description",
|
|
12038
|
+
defaultMessage: "Please confirm you want to open **{origin}** in a new browser tab.",
|
|
12039
|
+
description: "Description for the confirmation screen."
|
|
12040
|
+
},
|
|
12041
|
+
open: {
|
|
12042
|
+
id: "dynamicFlows.ExternalConfirmation.open",
|
|
12043
|
+
defaultMessage: "Open in new tab",
|
|
12044
|
+
description: "Button text confirming opening a new browser tab."
|
|
12045
|
+
},
|
|
12046
|
+
cancel: {
|
|
12047
|
+
id: "dynamicFlows.ExternalConfirmation.cancel",
|
|
12048
|
+
defaultMessage: "Cancel",
|
|
12049
|
+
description: "Button text rejecting opening a new browser tab."
|
|
12050
|
+
}
|
|
12051
|
+
});
|
|
12052
|
+
|
|
12053
|
+
// src/revamp/wise/renderers/step/ExternalConfirmationDialog.tsx
|
|
12054
|
+
import { Button as Button5, Markdown as Markdown5 } from "@transferwise/components";
|
|
12055
|
+
import { jsx as jsx55, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
12056
|
+
function ExternalConfirmationDialog({
|
|
12057
|
+
external,
|
|
12058
|
+
onClose
|
|
12059
|
+
}) {
|
|
12060
|
+
const { formatMessage } = useIntl7();
|
|
12061
|
+
return /* @__PURE__ */ jsx55("div", { className: "df-box-renderer-fixed-width", children: /* @__PURE__ */ jsxs21("div", { className: "df-box-renderer-width-lg", children: [
|
|
12062
|
+
/* @__PURE__ */ jsx55("h2", { className: "text-xs-center m-b-5", children: formatMessage(external_confirmation_messages_default.title) }),
|
|
12063
|
+
/* @__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) }) }),
|
|
12064
|
+
/* @__PURE__ */ jsx55("div", { className: "df-box-renderer-fixed-width", children: /* @__PURE__ */ jsxs21("div", { className: "df-box-renderer-width-lg", children: [
|
|
12065
|
+
/* @__PURE__ */ jsx55(
|
|
12066
|
+
Button5,
|
|
12067
|
+
{
|
|
12068
|
+
block: true,
|
|
12069
|
+
className: "m-b-2",
|
|
12070
|
+
priority: "primary",
|
|
12071
|
+
size: "md",
|
|
12072
|
+
onClick: () => {
|
|
12073
|
+
window.open(external.url);
|
|
12074
|
+
onClose();
|
|
12075
|
+
},
|
|
12076
|
+
children: formatMessage(external_confirmation_messages_default.open)
|
|
12077
|
+
}
|
|
12078
|
+
),
|
|
12079
|
+
/* @__PURE__ */ jsx55(Button5, { block: true, className: "m-b-2", priority: "tertiary", size: "md", onClick: onClose, children: formatMessage(external_confirmation_messages_default.cancel) })
|
|
12080
|
+
] }) })
|
|
12081
|
+
] }) });
|
|
12082
|
+
}
|
|
12083
|
+
function getOrigin(url) {
|
|
12084
|
+
try {
|
|
12085
|
+
return new URL(url).origin;
|
|
12086
|
+
} catch (e) {
|
|
12087
|
+
return url;
|
|
12088
|
+
}
|
|
12089
|
+
}
|
|
12090
|
+
|
|
12091
|
+
// src/revamp/wise/renderers/step/useExternal.tsx
|
|
12092
|
+
import { useEffect as useEffect6, useState as useState9 } from "react";
|
|
12093
|
+
function useExternal(url) {
|
|
12094
|
+
const [externalWindow, setExternalWindow] = useState9(null);
|
|
12095
|
+
const [hasDismissed, setHasDismissed] = useState9(false);
|
|
12096
|
+
const dismissConfirmation = () => setHasDismissed(true);
|
|
12097
|
+
useEffect6(() => {
|
|
12098
|
+
if (url) {
|
|
12099
|
+
setHasDismissed(false);
|
|
12100
|
+
setExternalWindow(window.open(url, "_blank"));
|
|
12101
|
+
}
|
|
12102
|
+
}, [url]);
|
|
12103
|
+
const requiresUserConfirmation = Boolean(url && !externalWindow && !hasDismissed);
|
|
12104
|
+
return { requiresUserConfirmation, dismissConfirmation };
|
|
12105
|
+
}
|
|
12106
|
+
|
|
12107
|
+
// src/revamp/wise/renderers/step/BackButton.tsx
|
|
12108
|
+
import { Avatar as Avatar4 } from "@transferwise/components";
|
|
12109
|
+
import { ArrowLeft } from "@transferwise/icons";
|
|
12110
|
+
import { jsx as jsx56, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
12111
|
+
function BackButton({ title, onClick }) {
|
|
12112
|
+
return /* @__PURE__ */ jsxs22(
|
|
12113
|
+
"a",
|
|
12114
|
+
{
|
|
12115
|
+
href: "/",
|
|
12116
|
+
className: "df-back-btn",
|
|
12117
|
+
"aria-label": title,
|
|
12118
|
+
onClick: (event) => {
|
|
12119
|
+
event.preventDefault();
|
|
12120
|
+
onClick();
|
|
12121
|
+
},
|
|
12122
|
+
children: [
|
|
12123
|
+
/* @__PURE__ */ jsx56("span", { className: "sr-only", children: title }),
|
|
12124
|
+
/* @__PURE__ */ jsx56(Avatar4, { type: "icon", children: /* @__PURE__ */ jsx56(ArrowLeft, { size: "24" }) })
|
|
12125
|
+
]
|
|
12126
|
+
}
|
|
12127
|
+
);
|
|
12128
|
+
}
|
|
12129
|
+
var BackButton_default = BackButton;
|
|
12130
|
+
|
|
12131
|
+
// src/revamp/wise/renderers/step/StepRenderer.tsx
|
|
12132
|
+
import { jsx as jsx57, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
12133
|
+
var StepRenderer = {
|
|
12134
|
+
canRenderType: "step",
|
|
12135
|
+
render: StepRendererComponent
|
|
12136
|
+
};
|
|
12137
|
+
function StepRendererComponent(props) {
|
|
12138
|
+
const { back, loadingState, external, trackEvent, children } = props;
|
|
12139
|
+
const value = useMemo4(() => ({ loadingState, trackEvent }), [loadingState, trackEvent]);
|
|
12140
|
+
const { requiresUserConfirmation, dismissConfirmation } = useExternal(external == null ? void 0 : external.url);
|
|
12141
|
+
if ((external == null ? void 0 : external.url) && requiresUserConfirmation) {
|
|
12142
|
+
return /* @__PURE__ */ jsx57(ExternalConfirmationDialog, { external, onClose: dismissConfirmation });
|
|
12143
|
+
}
|
|
12144
|
+
return /* @__PURE__ */ jsxs23(StepRendererContextProvider, { value, children: [
|
|
12145
|
+
back ? /* @__PURE__ */ jsx57(BackButton_default, __spreadValues({}, back)) : null,
|
|
12146
|
+
children
|
|
12147
|
+
] });
|
|
12148
|
+
}
|
|
12149
|
+
|
|
12111
12150
|
// src/revamp/wise/renderers/getWiseRenderers.ts
|
|
12112
12151
|
var getWiseRenderers = () => [
|
|
12113
12152
|
AlertRenderer_default,
|
|
@@ -12137,22 +12176,23 @@ var getWiseRenderers = () => [
|
|
|
12137
12176
|
SelectInputRenderer_default,
|
|
12138
12177
|
StatusListRenderer_default,
|
|
12139
12178
|
TextInputRenderer_default,
|
|
12140
|
-
UploadInputRenderer
|
|
12179
|
+
UploadInputRenderer,
|
|
12180
|
+
StepRenderer
|
|
12141
12181
|
];
|
|
12142
12182
|
|
|
12143
12183
|
// src/revamp/DynamicFlowWise.tsx
|
|
12144
|
-
import { jsx as
|
|
12184
|
+
import { jsx as jsx58 } from "react/jsx-runtime";
|
|
12145
12185
|
var wiseRenderers = getWiseRenderers();
|
|
12146
12186
|
function DynamicFlowWise(props) {
|
|
12147
12187
|
const { httpClient, renderers } = props;
|
|
12148
12188
|
const mergedRenderers = useMemo5(() => [...renderers != null ? renderers : [], ...wiseRenderers], [renderers]);
|
|
12149
|
-
return /* @__PURE__ */
|
|
12189
|
+
return /* @__PURE__ */ jsx58(HttpClientProvider, { httpClient, children: /* @__PURE__ */ jsx58(DynamicFlowCore, __spreadProps(__spreadValues({}, props), { renderers: mergedRenderers })) });
|
|
12150
12190
|
}
|
|
12151
12191
|
var DynamicFlowWise_default = DynamicFlowWise;
|
|
12152
12192
|
|
|
12153
12193
|
// src/revamp/DynamicFragmentWise.tsx
|
|
12154
12194
|
import { forwardRef as forwardRef3, useImperativeHandle, useMemo as useMemo6 } from "react";
|
|
12155
|
-
import { jsx as
|
|
12195
|
+
import { jsx as jsx59 } from "react/jsx-runtime";
|
|
12156
12196
|
var wiseRenderers2 = getWiseRenderers();
|
|
12157
12197
|
var DynamicFragmentWise = forwardRef3(function DynamicFragmentWise2(props, ref) {
|
|
12158
12198
|
const { httpClient, onEvent, onError, renderers } = props;
|
|
@@ -12177,14 +12217,14 @@ var DynamicFragmentWise = forwardRef3(function DynamicFragmentWise2(props, ref)
|
|
|
12177
12217
|
() => getRenderFunction([CoreContainerRenderer, ...mergedRenderers, StepRenderer]),
|
|
12178
12218
|
[mergedRenderers]
|
|
12179
12219
|
);
|
|
12180
|
-
return /* @__PURE__ */
|
|
12220
|
+
return /* @__PURE__ */ jsx59(
|
|
12181
12221
|
ErrorBoundary_default,
|
|
12182
12222
|
{
|
|
12183
12223
|
onError: (error) => {
|
|
12184
12224
|
onEvent == null ? void 0 : onEvent("Dynamic Flow - Failed");
|
|
12185
12225
|
onError(error);
|
|
12186
12226
|
},
|
|
12187
|
-
children: /* @__PURE__ */
|
|
12227
|
+
children: /* @__PURE__ */ jsx59(HttpClientProvider, { httpClient, children: stepComponentRef.current ? render(stepComponentRef.current) : null })
|
|
12188
12228
|
}
|
|
12189
12229
|
);
|
|
12190
12230
|
});
|
|
@@ -12495,7 +12535,7 @@ function isReference(block) {
|
|
|
12495
12535
|
}
|
|
12496
12536
|
|
|
12497
12537
|
// src/legacy/dynamicFlow/DynamicFlow.tsx
|
|
12498
|
-
import { useCallback as useCallback11, useEffect as
|
|
12538
|
+
import { useCallback as useCallback11, useEffect as useEffect26, useMemo as useMemo22, useState as useState34 } from "react";
|
|
12499
12539
|
|
|
12500
12540
|
// src/legacy/common/contexts/dynamicFlowContexts/DynamicFlowContexts.tsx
|
|
12501
12541
|
import { createContext as createContext4, useContext as useContext5, useMemo as useMemo7 } from "react";
|
|
@@ -12518,7 +12558,7 @@ var noop2 = () => {
|
|
|
12518
12558
|
};
|
|
12519
12559
|
|
|
12520
12560
|
// src/legacy/common/contexts/dynamicFlowContexts/DynamicFlowContexts.tsx
|
|
12521
|
-
import { jsx as
|
|
12561
|
+
import { jsx as jsx60 } from "react/jsx-runtime";
|
|
12522
12562
|
var defaultContextValue = {
|
|
12523
12563
|
loading: false,
|
|
12524
12564
|
registerPersistAsyncPromise: (promise) => {
|
|
@@ -12533,7 +12573,7 @@ var DynamicFlowProvider = ({ loading, children }) => {
|
|
|
12533
12573
|
registerPersistAsyncPromise: addPendingPromise
|
|
12534
12574
|
};
|
|
12535
12575
|
}, [loading, pendingPromises, addPendingPromise]);
|
|
12536
|
-
return /* @__PURE__ */
|
|
12576
|
+
return /* @__PURE__ */ jsx60(DFContext.Provider, { value: providerValue, children });
|
|
12537
12577
|
};
|
|
12538
12578
|
var useDynamicFlow = () => {
|
|
12539
12579
|
const context = useContext5(DFContext);
|
|
@@ -12542,7 +12582,7 @@ var useDynamicFlow = () => {
|
|
|
12542
12582
|
|
|
12543
12583
|
// src/legacy/common/contexts/eventsContext/EventsContext.tsx
|
|
12544
12584
|
import { createContext as createContext5, useContext as useContext6, useMemo as useMemo8 } from "react";
|
|
12545
|
-
import { jsx as
|
|
12585
|
+
import { jsx as jsx61 } from "react/jsx-runtime";
|
|
12546
12586
|
var EventsContext = createContext5({
|
|
12547
12587
|
triggerEvent: () => {
|
|
12548
12588
|
}
|
|
@@ -12552,7 +12592,7 @@ function EventsContextProvider({ metadata, children, onEvent }) {
|
|
|
12552
12592
|
() => ({ triggerEvent: getEventDispatcher(onEvent, metadata) }),
|
|
12553
12593
|
[onEvent, metadata]
|
|
12554
12594
|
);
|
|
12555
|
-
return /* @__PURE__ */
|
|
12595
|
+
return /* @__PURE__ */ jsx61(EventsContext.Provider, { value, children });
|
|
12556
12596
|
}
|
|
12557
12597
|
function useEventDispatcher() {
|
|
12558
12598
|
const { triggerEvent } = useContext6(EventsContext);
|
|
@@ -12567,7 +12607,7 @@ var getEventDispatcher = (onEvent, metadata) => (eventName, properties = {}) =>
|
|
|
12567
12607
|
|
|
12568
12608
|
// src/legacy/common/contexts/logContext/LogContext.tsx
|
|
12569
12609
|
import { createContext as createContext6, useContext as useContext7, useMemo as useMemo9 } from "react";
|
|
12570
|
-
import { jsx as
|
|
12610
|
+
import { jsx as jsx62 } from "react/jsx-runtime";
|
|
12571
12611
|
var getLogger = (level, onLog, flowId = "UNKNOWN-FLOW-ID", stepId = "UNKNOWN-FLOW-ID") => (title, description, extra) => {
|
|
12572
12612
|
try {
|
|
12573
12613
|
onLog(level, `Dynamic Flow ${level} - ${title} - ${description}`, __spreadValues({
|
|
@@ -12589,7 +12629,7 @@ function LogProvider({ flowId, stepId, children, onLog }) {
|
|
|
12589
12629
|
}),
|
|
12590
12630
|
[onLog, flowId, stepId]
|
|
12591
12631
|
);
|
|
12592
|
-
return /* @__PURE__ */
|
|
12632
|
+
return /* @__PURE__ */ jsx62(LogContext.Provider, { value, children });
|
|
12593
12633
|
}
|
|
12594
12634
|
var useLogger = () => {
|
|
12595
12635
|
const logging = useContext7(LogContext);
|
|
@@ -12603,10 +12643,10 @@ var useLogger = () => {
|
|
|
12603
12643
|
|
|
12604
12644
|
// src/legacy/common/contexts/featureContext/FeatureContext.tsx
|
|
12605
12645
|
import { createContext as createContext7, useContext as useContext8 } from "react";
|
|
12606
|
-
import { jsx as
|
|
12646
|
+
import { jsx as jsx63 } from "react/jsx-runtime";
|
|
12607
12647
|
var FeatureContext = createContext7([]);
|
|
12608
12648
|
function FeatureContextProvider({ features, children }) {
|
|
12609
|
-
return /* @__PURE__ */
|
|
12649
|
+
return /* @__PURE__ */ jsx63(FeatureContext.Provider, { value: features, children });
|
|
12610
12650
|
}
|
|
12611
12651
|
|
|
12612
12652
|
// src/legacy/common/utils/api-utils.ts
|
|
@@ -13342,12 +13382,12 @@ function useDebouncedFunction(callback, waitMs) {
|
|
|
13342
13382
|
}
|
|
13343
13383
|
|
|
13344
13384
|
// src/legacy/common/hooks/useExternal/useExternal.tsx
|
|
13345
|
-
import { useEffect as
|
|
13385
|
+
import { useEffect as useEffect7, useState as useState11 } from "react";
|
|
13346
13386
|
function useExternal2(url) {
|
|
13347
13387
|
const [externalWindow, setExternalWindow] = useState11(null);
|
|
13348
13388
|
const [hasManuallyTriggered, setHasManuallyTriggered] = useState11(false);
|
|
13349
13389
|
const dismissConfirmation = () => setHasManuallyTriggered(true);
|
|
13350
|
-
|
|
13390
|
+
useEffect7(() => {
|
|
13351
13391
|
if (url) {
|
|
13352
13392
|
setHasManuallyTriggered(false);
|
|
13353
13393
|
setExternalWindow(window.open(url, "_blank"));
|
|
@@ -13419,7 +13459,7 @@ import { useState as useState28 } from "react";
|
|
|
13419
13459
|
import { useIntl as useIntl19 } from "react-intl";
|
|
13420
13460
|
|
|
13421
13461
|
// src/legacy/jsonSchemaForm/persistAsyncSchema/persistAsyncBasicSchema/PersistAsyncBasicSchema.tsx
|
|
13422
|
-
import { useEffect as
|
|
13462
|
+
import { useEffect as useEffect18, useState as useState27 } from "react";
|
|
13423
13463
|
import { useIntl as useIntl18 } from "react-intl";
|
|
13424
13464
|
|
|
13425
13465
|
// src/legacy/common/constants/DateMode.ts
|
|
@@ -13468,7 +13508,7 @@ var Size = {
|
|
|
13468
13508
|
|
|
13469
13509
|
// src/legacy/jsonSchemaForm/basicTypeSchema/BasicTypeSchema.tsx
|
|
13470
13510
|
var import_classnames16 = __toESM(require_classnames());
|
|
13471
|
-
import { useEffect as
|
|
13511
|
+
import { useEffect as useEffect17, useMemo as useMemo17, useState as useState26 } from "react";
|
|
13472
13512
|
|
|
13473
13513
|
// src/legacy/layout/alert/DynamicAlert.tsx
|
|
13474
13514
|
import { Alert as Alert3 } from "@transferwise/components";
|
|
@@ -13477,19 +13517,19 @@ import { Alert as Alert3 } from "@transferwise/components";
|
|
|
13477
13517
|
import { Avatar as Avatar5, AvatarType as AvatarType4 } from "@transferwise/components";
|
|
13478
13518
|
|
|
13479
13519
|
// src/legacy/layout/icon/FlagIcon.tsx
|
|
13480
|
-
import { jsx as
|
|
13520
|
+
import { jsx as jsx64 } from "react/jsx-runtime";
|
|
13481
13521
|
var isFlagIcon2 = (name) => name.startsWith("flag-");
|
|
13482
13522
|
function FlagIcon2({ name }) {
|
|
13483
13523
|
if (!isFlagIcon2(name)) {
|
|
13484
13524
|
return null;
|
|
13485
13525
|
}
|
|
13486
13526
|
const code = name.substring(5);
|
|
13487
|
-
return /* @__PURE__ */
|
|
13527
|
+
return /* @__PURE__ */ jsx64(Flag, { intrinsicSize: 24, code });
|
|
13488
13528
|
}
|
|
13489
13529
|
|
|
13490
13530
|
// src/legacy/layout/icon/NamedIcon.tsx
|
|
13491
13531
|
import * as icons2 from "@transferwise/icons";
|
|
13492
|
-
import { jsx as
|
|
13532
|
+
import { jsx as jsx65 } from "react/jsx-runtime";
|
|
13493
13533
|
var isNamedIcon2 = (name) => {
|
|
13494
13534
|
const iconName = toCapitalisedCamelCase2(name);
|
|
13495
13535
|
return Object.keys(icons2).includes(iconName);
|
|
@@ -13500,19 +13540,19 @@ function NamedIcon2({ name }) {
|
|
|
13500
13540
|
}
|
|
13501
13541
|
const iconName = toCapitalisedCamelCase2(name);
|
|
13502
13542
|
const Icon = icons2[iconName];
|
|
13503
|
-
return /* @__PURE__ */
|
|
13543
|
+
return /* @__PURE__ */ jsx65(Icon, { size: 24 });
|
|
13504
13544
|
}
|
|
13505
13545
|
var toCapitalisedCamelCase2 = (value) => value.split("-").map(capitaliseFirstChar2).join("");
|
|
13506
13546
|
var capitaliseFirstChar2 = (value) => `${value[0].toUpperCase()}${value.slice(1)}`;
|
|
13507
13547
|
|
|
13508
13548
|
// src/legacy/layout/icon/DynamicIcon.tsx
|
|
13509
|
-
import { jsx as
|
|
13549
|
+
import { jsx as jsx66 } from "react/jsx-runtime";
|
|
13510
13550
|
function DynamicIcon2({ type }) {
|
|
13511
13551
|
if (isFlagIcon2(type)) {
|
|
13512
|
-
return /* @__PURE__ */
|
|
13552
|
+
return /* @__PURE__ */ jsx66(FlagIcon2, { name: type });
|
|
13513
13553
|
}
|
|
13514
13554
|
if (isNamedIcon2(type)) {
|
|
13515
|
-
return /* @__PURE__ */
|
|
13555
|
+
return /* @__PURE__ */ jsx66(NamedIcon2, { name: type });
|
|
13516
13556
|
}
|
|
13517
13557
|
return null;
|
|
13518
13558
|
}
|
|
@@ -13522,17 +13562,17 @@ function isValidIconName(name) {
|
|
|
13522
13562
|
var DynamicIcon_default2 = DynamicIcon2;
|
|
13523
13563
|
|
|
13524
13564
|
// src/legacy/layout/utils/getNavigationOptionMedia.tsx
|
|
13525
|
-
import { jsx as
|
|
13565
|
+
import { jsx as jsx67 } from "react/jsx-runtime";
|
|
13526
13566
|
var getNavigationOptionMedia = ({ icon, image }) => {
|
|
13527
13567
|
if (icon == null ? void 0 : icon.name) {
|
|
13528
|
-
return /* @__PURE__ */
|
|
13568
|
+
return /* @__PURE__ */ jsx67(Avatar5, { type: AvatarType4.ICON, children: /* @__PURE__ */ jsx67(DynamicIcon_default2, { type: icon.name }) });
|
|
13529
13569
|
}
|
|
13530
13570
|
if (icon == null ? void 0 : icon.text) {
|
|
13531
|
-
return /* @__PURE__ */
|
|
13571
|
+
return /* @__PURE__ */ jsx67(Avatar5, { type: AvatarType4.INITIALS, children: icon.text });
|
|
13532
13572
|
}
|
|
13533
13573
|
if (image == null ? void 0 : image.url) {
|
|
13534
13574
|
const { url, text } = image;
|
|
13535
|
-
return /* @__PURE__ */
|
|
13575
|
+
return /* @__PURE__ */ jsx67("img", { src: url, alt: text });
|
|
13536
13576
|
}
|
|
13537
13577
|
return null;
|
|
13538
13578
|
};
|
|
@@ -13568,10 +13608,10 @@ var getTextAlignment2 = (align) => {
|
|
|
13568
13608
|
var getTextAlignmentAndMargin2 = (component) => `${getTextAlignment2(component.align)} ${getMargin2(component.margin)}`;
|
|
13569
13609
|
|
|
13570
13610
|
// src/legacy/layout/alert/DynamicAlert.tsx
|
|
13571
|
-
import { jsx as
|
|
13611
|
+
import { jsx as jsx68 } from "react/jsx-runtime";
|
|
13572
13612
|
var DynamicAlert = (props) => {
|
|
13573
13613
|
const alert = props.component;
|
|
13574
|
-
return /* @__PURE__ */
|
|
13614
|
+
return /* @__PURE__ */ jsx68(
|
|
13575
13615
|
Alert3,
|
|
13576
13616
|
{
|
|
13577
13617
|
type: mapContextToAlertType(legacy_mapContext(alert.context)),
|
|
@@ -13604,12 +13644,12 @@ var mapContextToAlertType = (context) => {
|
|
|
13604
13644
|
var DynamicAlert_default = DynamicAlert;
|
|
13605
13645
|
|
|
13606
13646
|
// src/legacy/layout/box/DynamicBox.tsx
|
|
13607
|
-
import { jsx as
|
|
13647
|
+
import { jsx as jsx69 } from "react/jsx-runtime";
|
|
13608
13648
|
var DynamicBox = (props) => {
|
|
13609
13649
|
const box = props.component;
|
|
13610
13650
|
const margin = getMargin2(box.margin || box.border ? "lg" : "xs");
|
|
13611
13651
|
if (!box.width || box.width === "xl") {
|
|
13612
|
-
return /* @__PURE__ */
|
|
13652
|
+
return /* @__PURE__ */ jsx69("div", { className: margin + getBorderClass(box.border), children: /* @__PURE__ */ jsx69(
|
|
13613
13653
|
DynamicLayout_default,
|
|
13614
13654
|
{
|
|
13615
13655
|
components: box.components,
|
|
@@ -13622,7 +13662,7 @@ var DynamicBox = (props) => {
|
|
|
13622
13662
|
}
|
|
13623
13663
|
) });
|
|
13624
13664
|
}
|
|
13625
|
-
return /* @__PURE__ */
|
|
13665
|
+
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(
|
|
13626
13666
|
DynamicLayout_default,
|
|
13627
13667
|
{
|
|
13628
13668
|
components: box.components,
|
|
@@ -13706,7 +13746,7 @@ var getButtonSize = (size) => {
|
|
|
13706
13746
|
};
|
|
13707
13747
|
|
|
13708
13748
|
// src/legacy/layout/button/DynamicButton.tsx
|
|
13709
|
-
import { jsx as
|
|
13749
|
+
import { jsx as jsx70 } from "react/jsx-runtime";
|
|
13710
13750
|
function DynamicButton(props) {
|
|
13711
13751
|
var _a;
|
|
13712
13752
|
const { component, onAction } = props;
|
|
@@ -13715,7 +13755,7 @@ function DynamicButton(props) {
|
|
|
13715
13755
|
const priority = getButtonPriority(component);
|
|
13716
13756
|
const { loading } = useDynamicFlow();
|
|
13717
13757
|
const className = getMargin2(component.margin || "md");
|
|
13718
|
-
return /* @__PURE__ */
|
|
13758
|
+
return /* @__PURE__ */ jsx70(
|
|
13719
13759
|
Button6,
|
|
13720
13760
|
{
|
|
13721
13761
|
size: getButtonSize(component.size),
|
|
@@ -13732,12 +13772,12 @@ function DynamicButton(props) {
|
|
|
13732
13772
|
var DynamicButton_default = DynamicButton;
|
|
13733
13773
|
|
|
13734
13774
|
// src/legacy/layout/columns/DynamicColumns.tsx
|
|
13735
|
-
import { jsx as
|
|
13775
|
+
import { jsx as jsx71, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
13736
13776
|
var DynamicColumns = (props) => {
|
|
13737
13777
|
const columns = props.component;
|
|
13738
13778
|
const { leftWidth, rightWidth } = getWidth(columns.bias);
|
|
13739
|
-
return /* @__PURE__ */
|
|
13740
|
-
/* @__PURE__ */
|
|
13779
|
+
return /* @__PURE__ */ jsxs24("div", { className: `${getMargin2(columns.margin || "xs")} row`, children: [
|
|
13780
|
+
/* @__PURE__ */ jsx71("div", { className: `${leftWidth} m-b-0`, children: /* @__PURE__ */ jsx71(
|
|
13741
13781
|
DynamicLayout_default,
|
|
13742
13782
|
{
|
|
13743
13783
|
components: columns.left,
|
|
@@ -13749,7 +13789,7 @@ var DynamicColumns = (props) => {
|
|
|
13749
13789
|
onPersistAsync: props.onPersistAsync
|
|
13750
13790
|
}
|
|
13751
13791
|
) }),
|
|
13752
|
-
/* @__PURE__ */
|
|
13792
|
+
/* @__PURE__ */ jsx71("div", { className: `${rightWidth} m-b-0`, children: /* @__PURE__ */ jsx71(
|
|
13753
13793
|
DynamicLayout_default,
|
|
13754
13794
|
{
|
|
13755
13795
|
components: columns.right,
|
|
@@ -13785,10 +13825,10 @@ var DynamicColumns_default = DynamicColumns;
|
|
|
13785
13825
|
|
|
13786
13826
|
// src/legacy/layout/decision/DynamicDecision.tsx
|
|
13787
13827
|
import { NavigationOption as NavigationOption4, NavigationOptionsList as NavigationOptionsList3 } from "@transferwise/components";
|
|
13788
|
-
import { jsx as
|
|
13828
|
+
import { jsx as jsx72 } from "react/jsx-runtime";
|
|
13789
13829
|
function DynamicDecision({ component, onAction }) {
|
|
13790
13830
|
const { loading } = useDynamicFlow();
|
|
13791
|
-
return /* @__PURE__ */
|
|
13831
|
+
return /* @__PURE__ */ jsx72("div", { className: getMargin2(component.margin), children: /* @__PURE__ */ jsx72(NavigationOptionsList3, { children: component.options.map((option) => /* @__PURE__ */ jsx72(
|
|
13792
13832
|
NavigationOption4,
|
|
13793
13833
|
{
|
|
13794
13834
|
title: option.title,
|
|
@@ -13805,17 +13845,17 @@ function DynamicDecision({ component, onAction }) {
|
|
|
13805
13845
|
var DynamicDecision_default = DynamicDecision;
|
|
13806
13846
|
|
|
13807
13847
|
// src/legacy/layout/divider/DynamicDivider.tsx
|
|
13808
|
-
import { jsx as
|
|
13848
|
+
import { jsx as jsx73 } from "react/jsx-runtime";
|
|
13809
13849
|
var DynamicDivider = ({ component }) => {
|
|
13810
13850
|
const margin = getMargin2(component.margin);
|
|
13811
13851
|
const className = `m-t-0 ${margin}`;
|
|
13812
|
-
return /* @__PURE__ */
|
|
13852
|
+
return /* @__PURE__ */ jsx73("hr", { className });
|
|
13813
13853
|
};
|
|
13814
13854
|
var DynamicDivider_default = DynamicDivider;
|
|
13815
13855
|
|
|
13816
13856
|
// src/legacy/layout/external/DynamicExternal.tsx
|
|
13817
13857
|
import { Button as Button7, Loader as Loader2, Size as Size2 } from "@transferwise/components";
|
|
13818
|
-
import { useCallback as useCallback6, useEffect as
|
|
13858
|
+
import { useCallback as useCallback6, useEffect as useEffect8 } from "react";
|
|
13819
13859
|
import { useIntl as useIntl8 } from "react-intl";
|
|
13820
13860
|
|
|
13821
13861
|
// src/legacy/layout/external/DynamicExternal.messages.ts
|
|
@@ -13829,7 +13869,7 @@ var DynamicExternal_messages_default = defineMessages9({
|
|
|
13829
13869
|
});
|
|
13830
13870
|
|
|
13831
13871
|
// src/legacy/layout/external/DynamicExternal.tsx
|
|
13832
|
-
import { Fragment as
|
|
13872
|
+
import { Fragment as Fragment11, jsx as jsx74, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
13833
13873
|
var DynamicExternal = ({ component, onAction }) => {
|
|
13834
13874
|
const { requestUrl, responseHandlers, polling, retryTitle } = component;
|
|
13835
13875
|
const intl = useIntl8();
|
|
@@ -13837,29 +13877,29 @@ var DynamicExternal = ({ component, onAction }) => {
|
|
|
13837
13877
|
() => window.open(requestUrl, "df-external-window"),
|
|
13838
13878
|
[requestUrl]
|
|
13839
13879
|
);
|
|
13840
|
-
|
|
13880
|
+
useEffect8(() => {
|
|
13841
13881
|
openExternalUrl();
|
|
13842
13882
|
}, [openExternalUrl]);
|
|
13843
13883
|
const pollingConfiguration = polling && responseHandlers ? __spreadProps(__spreadValues({}, polling), {
|
|
13844
13884
|
responseHandlers
|
|
13845
13885
|
}) : void 0;
|
|
13846
13886
|
useExternalStepPolling(pollingConfiguration, onAction);
|
|
13847
|
-
return /* @__PURE__ */
|
|
13848
|
-
/* @__PURE__ */
|
|
13849
|
-
/* @__PURE__ */
|
|
13850
|
-
/* @__PURE__ */
|
|
13887
|
+
return /* @__PURE__ */ jsxs25(Fragment11, { children: [
|
|
13888
|
+
/* @__PURE__ */ jsx74(Loader2, { size: Size2.LARGE, classNames: { "tw-loader": "tw-loader m-x-auto" } }),
|
|
13889
|
+
/* @__PURE__ */ jsx74("br", {}),
|
|
13890
|
+
/* @__PURE__ */ jsx74(Button7, { priority: "tertiary", block: true, onClick: openExternalUrl, children: retryTitle || intl.formatMessage(DynamicExternal_messages_default.retryTitle) })
|
|
13851
13891
|
] });
|
|
13852
13892
|
};
|
|
13853
13893
|
var DynamicExternal_default = DynamicExternal;
|
|
13854
13894
|
|
|
13855
13895
|
// src/legacy/jsonSchemaForm/genericSchema/GenericSchema.tsx
|
|
13856
|
-
import { useEffect as
|
|
13896
|
+
import { useEffect as useEffect15 } from "react";
|
|
13857
13897
|
|
|
13858
13898
|
// src/legacy/jsonSchemaForm/allOfSchema/AllOfSchema.tsx
|
|
13859
13899
|
var import_classnames7 = __toESM(require_classnames());
|
|
13860
13900
|
import { Header as Header6 } from "@transferwise/components";
|
|
13861
13901
|
import { useState as useState12 } from "react";
|
|
13862
|
-
import { Fragment as
|
|
13902
|
+
import { Fragment as Fragment12, jsx as jsx75, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
13863
13903
|
var splitModel = (model, schemas) => schemas.map((schema) => getValidObjectModelParts(model, schema) || {});
|
|
13864
13904
|
var combineModels = (models) => models.reduce((current, combined) => __spreadValues(__spreadValues({}, combined), current), {});
|
|
13865
13905
|
var getSchemaColumnClasses = (width) => ({
|
|
@@ -13875,12 +13915,12 @@ function AllOfSchema(props) {
|
|
|
13875
13915
|
props.onChange(__spreadProps(__spreadValues({}, onChangeProps), { model: combineModels(models) }));
|
|
13876
13916
|
};
|
|
13877
13917
|
const [models, setModels] = useState12(splitModel(props.model, props.schema.allOf));
|
|
13878
|
-
return /* @__PURE__ */
|
|
13879
|
-
props.schema.title && /* @__PURE__ */
|
|
13880
|
-
props.schema.description && /* @__PURE__ */
|
|
13881
|
-
/* @__PURE__ */
|
|
13918
|
+
return /* @__PURE__ */ jsxs26(Fragment12, { children: [
|
|
13919
|
+
props.schema.title && /* @__PURE__ */ jsx75(Header6, { title: props.schema.title }),
|
|
13920
|
+
props.schema.description && /* @__PURE__ */ jsx75("p", { children: props.schema.description }),
|
|
13921
|
+
/* @__PURE__ */ jsx75("div", { className: "row", children: props.schema.allOf.map((schema, index) => (
|
|
13882
13922
|
// eslint-disable-next-line react/no-array-index-key
|
|
13883
|
-
/* @__PURE__ */
|
|
13923
|
+
/* @__PURE__ */ jsx75("div", { className: (0, import_classnames7.default)(getSchemaColumnClasses(schema.width)), children: /* @__PURE__ */ jsx75(
|
|
13884
13924
|
GenericSchema_default,
|
|
13885
13925
|
{
|
|
13886
13926
|
schema,
|
|
@@ -13915,7 +13955,7 @@ import { useMemo as useMemo11, useState as useState13 } from "react";
|
|
|
13915
13955
|
import { InlineAlert as InlineAlert4 } from "@transferwise/components";
|
|
13916
13956
|
import { formatDate as formatDate3 } from "@transferwise/formatting";
|
|
13917
13957
|
import { useIntl as useIntl9 } from "react-intl";
|
|
13918
|
-
import { jsx as
|
|
13958
|
+
import { jsx as jsx76, jsxs as jsxs27 } from "react/jsx-runtime";
|
|
13919
13959
|
function ControlFeedback(props) {
|
|
13920
13960
|
var _a;
|
|
13921
13961
|
const defaultValidationMessages = useDefaultValidationMessages(props.schema);
|
|
@@ -13924,12 +13964,12 @@ function ControlFeedback(props) {
|
|
|
13924
13964
|
const isValidationVisible = !isErrorVisible && (props.submitted || props.changed && props.blurred) && Boolean((_a = props.validations) == null ? void 0 : _a.length);
|
|
13925
13965
|
const isDescriptionVisible = props.schema.type !== "boolean" && props.schema.description && !isErrorVisible && !isValidationVisible;
|
|
13926
13966
|
const hasInfoMessage = Boolean(props.infoMessage);
|
|
13927
|
-
return /* @__PURE__ */
|
|
13928
|
-
isErrorVisible ? /* @__PURE__ */
|
|
13929
|
-
isValidationVisible ? /* @__PURE__ */
|
|
13930
|
-
(isDescriptionVisible || hasInfoMessage) && /* @__PURE__ */
|
|
13931
|
-
isDescriptionVisible && /* @__PURE__ */
|
|
13932
|
-
hasInfoMessage && /* @__PURE__ */
|
|
13967
|
+
return /* @__PURE__ */ jsxs27("div", { id: props.id, children: [
|
|
13968
|
+
isErrorVisible ? /* @__PURE__ */ jsx76(InlineAlert4, { type: "error", children: props.errors }) : null,
|
|
13969
|
+
isValidationVisible ? /* @__PURE__ */ jsx76(InlineAlert4, { type: "error", children: props.validations.map((validation) => /* @__PURE__ */ jsx76("div", { children: validationMessages[validation] }, validation)) }) : null,
|
|
13970
|
+
(isDescriptionVisible || hasInfoMessage) && /* @__PURE__ */ jsxs27(InlineAlert4, { type: "info", children: [
|
|
13971
|
+
isDescriptionVisible && /* @__PURE__ */ jsx76("div", { children: props.schema.description }),
|
|
13972
|
+
hasInfoMessage && /* @__PURE__ */ jsx76("div", { children: props.infoMessage })
|
|
13933
13973
|
] })
|
|
13934
13974
|
] });
|
|
13935
13975
|
}
|
|
@@ -14055,7 +14095,7 @@ function useFormattedDefaultErrorMessages({
|
|
|
14055
14095
|
}
|
|
14056
14096
|
|
|
14057
14097
|
// src/legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/MultipleFileUploadSchema.tsx
|
|
14058
|
-
import { jsx as
|
|
14098
|
+
import { jsx as jsx77, jsxs as jsxs28 } from "react/jsx-runtime";
|
|
14059
14099
|
function MultipleFileUploadSchema(props) {
|
|
14060
14100
|
var _a, _b;
|
|
14061
14101
|
const { onChange, schema } = props;
|
|
@@ -14117,10 +14157,10 @@ function MultipleFileUploadSchema(props) {
|
|
|
14117
14157
|
onDeleteFile: () => Promise.resolve()
|
|
14118
14158
|
});
|
|
14119
14159
|
const feedbackId = `${uid}-feedback`;
|
|
14120
|
-
return /* @__PURE__ */
|
|
14121
|
-
/* @__PURE__ */
|
|
14122
|
-
/* @__PURE__ */
|
|
14123
|
-
/* @__PURE__ */
|
|
14160
|
+
return /* @__PURE__ */ jsxs28("div", { className: (0, import_classnames8.default)("form-group", { "has-error": showError }), children: [
|
|
14161
|
+
/* @__PURE__ */ jsx77("label", { className: "d-block control-label", htmlFor: uid, children: props.schema.title }),
|
|
14162
|
+
/* @__PURE__ */ jsx77("div", { "aria-describedby": feedbackId, children: /* @__PURE__ */ jsx77(UploadInput3, __spreadValues({}, uploadInputProps)) }),
|
|
14163
|
+
/* @__PURE__ */ jsx77(
|
|
14124
14164
|
ControlFeedback_default,
|
|
14125
14165
|
{
|
|
14126
14166
|
id: feedbackId,
|
|
@@ -14163,12 +14203,12 @@ function getValidationMessages(schema, required, defaultErrorMessages) {
|
|
|
14163
14203
|
// src/legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multiSelectSchema/MultiSelectSchema.tsx
|
|
14164
14204
|
var import_classnames9 = __toESM(require_classnames());
|
|
14165
14205
|
import { SelectInput as SelectInput2, SelectInputOptionContent as SelectInputOptionContent2 } from "@transferwise/components";
|
|
14166
|
-
import { useEffect as
|
|
14206
|
+
import { useEffect as useEffect9, useMemo as useMemo12, useState as useState14 } from "react";
|
|
14167
14207
|
import { useIntl as useIntl11 } from "react-intl";
|
|
14168
14208
|
|
|
14169
14209
|
// src/legacy/jsonSchemaForm/schemaFormControl/utils/mapping-utils.tsx
|
|
14170
14210
|
import { Avatar as Avatar6, AvatarType as AvatarType5 } from "@transferwise/components";
|
|
14171
|
-
import { jsx as
|
|
14211
|
+
import { jsx as jsx78 } from "react/jsx-runtime";
|
|
14172
14212
|
var mapConstSchemaToOption = (schema, controlType) => {
|
|
14173
14213
|
switch (controlType) {
|
|
14174
14214
|
case "select":
|
|
@@ -14192,7 +14232,7 @@ var mapKeywordsToSearchStrings = (searchStrings) => isArray2(searchStrings) ? {
|
|
|
14192
14232
|
var mapImage = (image) => {
|
|
14193
14233
|
if (image == null ? void 0 : image.url) {
|
|
14194
14234
|
return {
|
|
14195
|
-
icon: /* @__PURE__ */
|
|
14235
|
+
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 || "" }) }) }),
|
|
14196
14236
|
hideIconInTrigger: true
|
|
14197
14237
|
};
|
|
14198
14238
|
}
|
|
@@ -14201,17 +14241,17 @@ var mapImage = (image) => {
|
|
|
14201
14241
|
var getIconPropertyForSelectOption = (icon) => {
|
|
14202
14242
|
if ((icon == null ? void 0 : icon.name) && isFlagIcon2(icon.name)) {
|
|
14203
14243
|
return {
|
|
14204
|
-
icon: /* @__PURE__ */
|
|
14244
|
+
icon: /* @__PURE__ */ jsx78(Flag, { code: icon.name.substring(5), intrinsicSize: 24 })
|
|
14205
14245
|
};
|
|
14206
14246
|
}
|
|
14207
14247
|
if ((icon == null ? void 0 : icon.name) && isValidIconName(icon.name)) {
|
|
14208
14248
|
return {
|
|
14209
|
-
icon: /* @__PURE__ */
|
|
14249
|
+
icon: /* @__PURE__ */ jsx78(DynamicIcon_default2, { type: icon.name })
|
|
14210
14250
|
};
|
|
14211
14251
|
}
|
|
14212
14252
|
if (icon == null ? void 0 : icon.text) {
|
|
14213
14253
|
return {
|
|
14214
|
-
icon: /* @__PURE__ */
|
|
14254
|
+
icon: /* @__PURE__ */ jsx78("span", { children: icon.text })
|
|
14215
14255
|
};
|
|
14216
14256
|
}
|
|
14217
14257
|
return null;
|
|
@@ -14219,17 +14259,17 @@ var getIconPropertyForSelectOption = (icon) => {
|
|
|
14219
14259
|
var getAvatarPropertyForRadioOption = ({ image, icon }) => {
|
|
14220
14260
|
if (image == null ? void 0 : image.url) {
|
|
14221
14261
|
return {
|
|
14222
|
-
avatar: /* @__PURE__ */
|
|
14262
|
+
avatar: /* @__PURE__ */ jsx78(Avatar6, { type: AvatarType5.THUMBNAIL, children: /* @__PURE__ */ jsx78("img", { src: image.url, alt: "" }) })
|
|
14223
14263
|
};
|
|
14224
14264
|
}
|
|
14225
14265
|
if ((icon == null ? void 0 : icon.name) && isValidIconName(icon.name)) {
|
|
14226
14266
|
return {
|
|
14227
|
-
avatar: /* @__PURE__ */
|
|
14267
|
+
avatar: /* @__PURE__ */ jsx78(Avatar6, { type: AvatarType5.ICON, children: /* @__PURE__ */ jsx78(DynamicIcon_default2, { type: icon.name }) })
|
|
14228
14268
|
};
|
|
14229
14269
|
}
|
|
14230
14270
|
if (icon == null ? void 0 : icon.text) {
|
|
14231
14271
|
return {
|
|
14232
|
-
avatar: /* @__PURE__ */
|
|
14272
|
+
avatar: /* @__PURE__ */ jsx78(Avatar6, { type: AvatarType5.INITIALS, children: icon.text })
|
|
14233
14273
|
};
|
|
14234
14274
|
}
|
|
14235
14275
|
return null;
|
|
@@ -14268,7 +14308,7 @@ var multi_select_messages_default = defineMessages11({
|
|
|
14268
14308
|
});
|
|
14269
14309
|
|
|
14270
14310
|
// src/legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multiSelectSchema/MultiSelectSchema.tsx
|
|
14271
|
-
import { jsx as
|
|
14311
|
+
import { jsx as jsx79, jsxs as jsxs29 } from "react/jsx-runtime";
|
|
14272
14312
|
function MultiSelectSchema({
|
|
14273
14313
|
schema,
|
|
14274
14314
|
model,
|
|
@@ -14283,7 +14323,7 @@ function MultiSelectSchema({
|
|
|
14283
14323
|
const id = useMemo12(() => schema.$id || generateRandomId(), [schema.$id]);
|
|
14284
14324
|
const [changed, setChanged] = useState14(false);
|
|
14285
14325
|
const [selected, setSelected] = useState14(getInitialModelIndices(model, options));
|
|
14286
|
-
|
|
14326
|
+
useEffect9(
|
|
14287
14327
|
() => {
|
|
14288
14328
|
if (selected) {
|
|
14289
14329
|
broadcastModelChange(selected);
|
|
@@ -14320,9 +14360,9 @@ function MultiSelectSchema({
|
|
|
14320
14360
|
const formGroupClasses = {
|
|
14321
14361
|
"has-error": shouldShowInitialError || shouldShowValidationError
|
|
14322
14362
|
};
|
|
14323
|
-
return /* @__PURE__ */
|
|
14324
|
-
schema.title ? /* @__PURE__ */
|
|
14325
|
-
/* @__PURE__ */
|
|
14363
|
+
return /* @__PURE__ */ jsxs29("div", { className: (0, import_classnames9.default)("d-flex flex-column", formGroupClasses), children: [
|
|
14364
|
+
schema.title ? /* @__PURE__ */ jsx79("label", { htmlFor: id, children: schema.title }) : void 0,
|
|
14365
|
+
/* @__PURE__ */ jsx79(
|
|
14326
14366
|
SelectInput2,
|
|
14327
14367
|
{
|
|
14328
14368
|
id,
|
|
@@ -14340,12 +14380,12 @@ function MultiSelectSchema({
|
|
|
14340
14380
|
if (withinTrigger) {
|
|
14341
14381
|
return selected && index === selected[0] ? getFormattedMessage() : void 0;
|
|
14342
14382
|
}
|
|
14343
|
-
return /* @__PURE__ */
|
|
14383
|
+
return /* @__PURE__ */ jsx79(SelectInputOptionContent2, { title: label, note: note != null ? note : secondary, icon });
|
|
14344
14384
|
},
|
|
14345
14385
|
onChange: broadcastModelChange
|
|
14346
14386
|
}
|
|
14347
14387
|
),
|
|
14348
|
-
/* @__PURE__ */
|
|
14388
|
+
/* @__PURE__ */ jsx79(
|
|
14349
14389
|
ControlFeedback_default,
|
|
14350
14390
|
{
|
|
14351
14391
|
id: `${id}-feedback`,
|
|
@@ -14377,9 +14417,9 @@ import { useIntl as useIntl13 } from "react-intl";
|
|
|
14377
14417
|
|
|
14378
14418
|
// src/legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/repeatableSchema/ItemSummary.tsx
|
|
14379
14419
|
import { NavigationOption as NavigationOption5 } from "@transferwise/components";
|
|
14380
|
-
import { jsx as
|
|
14420
|
+
import { jsx as jsx80 } from "react/jsx-runtime";
|
|
14381
14421
|
function ItemSummaryOption2({ item, onClick }) {
|
|
14382
|
-
return /* @__PURE__ */
|
|
14422
|
+
return /* @__PURE__ */ jsx80(
|
|
14383
14423
|
NavigationOption5,
|
|
14384
14424
|
{
|
|
14385
14425
|
media: getNavigationOptionMedia(item),
|
|
@@ -14394,7 +14434,7 @@ function ItemSummaryOption2({ item, onClick }) {
|
|
|
14394
14434
|
// src/legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/repeatableSchema/RepeatableSchemaStep.tsx
|
|
14395
14435
|
import { useState as useState15 } from "react";
|
|
14396
14436
|
import { useIntl as useIntl12 } from "react-intl";
|
|
14397
|
-
import { jsx as
|
|
14437
|
+
import { jsx as jsx81 } from "react/jsx-runtime";
|
|
14398
14438
|
function RepeatableSchemaStep({
|
|
14399
14439
|
type,
|
|
14400
14440
|
schema,
|
|
@@ -14442,7 +14482,7 @@ function RepeatableSchemaStep({
|
|
|
14442
14482
|
}
|
|
14443
14483
|
onModelChange(__spreadProps(__spreadValues({}, modelChangeProps), { model: model2 }));
|
|
14444
14484
|
};
|
|
14445
|
-
return /* @__PURE__ */
|
|
14485
|
+
return /* @__PURE__ */ jsx81(
|
|
14446
14486
|
DynamicFlowStep,
|
|
14447
14487
|
{
|
|
14448
14488
|
step,
|
|
@@ -14648,7 +14688,7 @@ var schemaSummaryProvides = (summary, providesProp) => (
|
|
|
14648
14688
|
|
|
14649
14689
|
// src/legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/repeatableSchema/RepeatableSchema.tsx
|
|
14650
14690
|
var import_classnames10 = __toESM(require_classnames());
|
|
14651
|
-
import { jsx as
|
|
14691
|
+
import { jsx as jsx82, jsxs as jsxs30 } from "react/jsx-runtime";
|
|
14652
14692
|
function RepeatableSchema({
|
|
14653
14693
|
schema,
|
|
14654
14694
|
model,
|
|
@@ -14725,9 +14765,9 @@ function RepeatableSchema({
|
|
|
14725
14765
|
const formGroupClasses = {
|
|
14726
14766
|
"has-error": (_a = errors && !isEmpty(errors)) != null ? _a : submitted && validations.length
|
|
14727
14767
|
};
|
|
14728
|
-
return /* @__PURE__ */
|
|
14729
|
-
schema.title && /* @__PURE__ */
|
|
14730
|
-
itemSummaries == null ? void 0 : itemSummaries.map((itemSummary) => /* @__PURE__ */
|
|
14768
|
+
return /* @__PURE__ */ jsxs30("div", { id, className: (0, import_classnames10.default)(formGroupClasses), children: [
|
|
14769
|
+
schema.title && /* @__PURE__ */ jsx82(Header7, { title: schema.title }),
|
|
14770
|
+
itemSummaries == null ? void 0 : itemSummaries.map((itemSummary) => /* @__PURE__ */ jsx82(
|
|
14731
14771
|
ItemSummaryOption2,
|
|
14732
14772
|
{
|
|
14733
14773
|
item: itemSummary,
|
|
@@ -14735,21 +14775,21 @@ function RepeatableSchema({
|
|
|
14735
14775
|
},
|
|
14736
14776
|
JSON.stringify(itemSummary)
|
|
14737
14777
|
)),
|
|
14738
|
-
/* @__PURE__ */
|
|
14778
|
+
/* @__PURE__ */ jsx82(
|
|
14739
14779
|
NavigationOption6,
|
|
14740
14780
|
{
|
|
14741
|
-
media: /* @__PURE__ */
|
|
14781
|
+
media: /* @__PURE__ */ jsx82(Plus2, {}),
|
|
14742
14782
|
title: schema.addItemTitle || formatMessage(repeatable_messages_default.addItemTitle),
|
|
14743
14783
|
showMediaAtAllSizes: true,
|
|
14744
14784
|
onClick: onAddItem
|
|
14745
14785
|
}
|
|
14746
14786
|
),
|
|
14747
|
-
/* @__PURE__ */
|
|
14787
|
+
/* @__PURE__ */ jsx82(
|
|
14748
14788
|
Modal3,
|
|
14749
14789
|
{
|
|
14750
14790
|
open: openModalType !== null,
|
|
14751
14791
|
title: (openModalType === "add" ? schema.addItemTitle : schema.editItemTitle) || formatMessage(repeatable_messages_default.addItemTitle),
|
|
14752
|
-
body: /* @__PURE__ */
|
|
14792
|
+
body: /* @__PURE__ */ jsx82(
|
|
14753
14793
|
RepeatableSchemaStep_default,
|
|
14754
14794
|
{
|
|
14755
14795
|
type: openModalType != null ? openModalType : "add",
|
|
@@ -14764,7 +14804,7 @@ function RepeatableSchema({
|
|
|
14764
14804
|
onClose: onCancelEdit
|
|
14765
14805
|
}
|
|
14766
14806
|
),
|
|
14767
|
-
/* @__PURE__ */
|
|
14807
|
+
/* @__PURE__ */ jsx82(
|
|
14768
14808
|
ControlFeedback_default,
|
|
14769
14809
|
{
|
|
14770
14810
|
id: `${id}-feedback`,
|
|
@@ -14806,17 +14846,17 @@ var getUpdatedItemSummaries = (action, {
|
|
|
14806
14846
|
var RepeatableSchema_default = RepeatableSchema;
|
|
14807
14847
|
|
|
14808
14848
|
// src/legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/ArrayListSchema.tsx
|
|
14809
|
-
import { jsx as
|
|
14849
|
+
import { jsx as jsx83 } from "react/jsx-runtime";
|
|
14810
14850
|
function ArrayListSchema(props) {
|
|
14811
14851
|
const { schema } = props;
|
|
14812
14852
|
if (isMultipleFileUploadSchema(schema)) {
|
|
14813
|
-
return /* @__PURE__ */
|
|
14853
|
+
return /* @__PURE__ */ jsx83(MultipleFileUploadSchema_default, __spreadProps(__spreadValues({}, props), { schema }));
|
|
14814
14854
|
}
|
|
14815
14855
|
if (isMultiSelectConstSchema(schema)) {
|
|
14816
|
-
return /* @__PURE__ */
|
|
14856
|
+
return /* @__PURE__ */ jsx83(MultiSelectSchema, __spreadProps(__spreadValues({}, props), { schema }));
|
|
14817
14857
|
}
|
|
14818
14858
|
if (isListArraySchema(schema)) {
|
|
14819
|
-
return /* @__PURE__ */
|
|
14859
|
+
return /* @__PURE__ */ jsx83(RepeatableSchema_default, __spreadProps(__spreadValues({}, props), { schema }));
|
|
14820
14860
|
}
|
|
14821
14861
|
throw new Error("Invalid array list schema");
|
|
14822
14862
|
}
|
|
@@ -14827,11 +14867,11 @@ ArrayListSchema.defaultProps = {
|
|
|
14827
14867
|
var ArrayListSchema_default = ArrayListSchema;
|
|
14828
14868
|
|
|
14829
14869
|
// src/legacy/jsonSchemaForm/arrayTypeSchema/ArraySchema.tsx
|
|
14830
|
-
import { jsx as
|
|
14870
|
+
import { jsx as jsx84 } from "react/jsx-runtime";
|
|
14831
14871
|
var ArraySchema = (props) => {
|
|
14832
14872
|
const { schema } = props;
|
|
14833
14873
|
if (isListArraySchema(schema)) {
|
|
14834
|
-
return /* @__PURE__ */
|
|
14874
|
+
return /* @__PURE__ */ jsx84(ArrayListSchema_default, __spreadValues({}, props));
|
|
14835
14875
|
}
|
|
14836
14876
|
throw new Error("Not implemented");
|
|
14837
14877
|
};
|
|
@@ -14843,8 +14883,8 @@ var ArraySchema_default = ArraySchema;
|
|
|
14843
14883
|
// src/legacy/jsonSchemaForm/objectSchema/ObjectSchema.tsx
|
|
14844
14884
|
var import_classnames11 = __toESM(require_classnames());
|
|
14845
14885
|
import { Header as Header8 } from "@transferwise/components";
|
|
14846
|
-
import { useState as useState17, useEffect as
|
|
14847
|
-
import { Fragment as
|
|
14886
|
+
import { useState as useState17, useEffect as useEffect10 } from "react";
|
|
14887
|
+
import { Fragment as Fragment13, jsx as jsx85, jsxs as jsxs31 } from "react/jsx-runtime";
|
|
14848
14888
|
var getSchemaColumnClasses2 = (width) => ({
|
|
14849
14889
|
"col-xs-12": true,
|
|
14850
14890
|
"col-sm-6": width === "md",
|
|
@@ -14862,7 +14902,7 @@ function ObjectSchema(props) {
|
|
|
14862
14902
|
props.onChange(__spreadProps(__spreadValues({}, onChangeProps), { model }));
|
|
14863
14903
|
};
|
|
14864
14904
|
const isRequired = (propertyName) => props.schema.required && props.schema.required.includes(propertyName);
|
|
14865
|
-
|
|
14905
|
+
useEffect10(() => {
|
|
14866
14906
|
const newModel = getValidObjectModelParts(model, props.schema) || {};
|
|
14867
14907
|
setModel(newModel);
|
|
14868
14908
|
if (!isEqual(newModel, model)) {
|
|
@@ -14880,22 +14920,22 @@ function ObjectSchema(props) {
|
|
|
14880
14920
|
const isPropertyDefined = (propertyName) => typeof props.schema.properties[propertyName] !== "undefined";
|
|
14881
14921
|
const orderedPropertyNames = Array.from(allorderedPropertiesSet).filter(isPropertyDefined);
|
|
14882
14922
|
const propsErrors = props.errors;
|
|
14883
|
-
return /* @__PURE__ */
|
|
14884
|
-
props.schema.alert && /* @__PURE__ */
|
|
14885
|
-
/* @__PURE__ */
|
|
14886
|
-
props.schema.title && !props.hideTitle && /* @__PURE__ */
|
|
14887
|
-
props.schema.description && !props.hideTitle && /* @__PURE__ */
|
|
14923
|
+
return /* @__PURE__ */ jsxs31(Fragment13, { children: [
|
|
14924
|
+
props.schema.alert && /* @__PURE__ */ jsx85(DynamicAlert_default, { component: props.schema.alert }),
|
|
14925
|
+
/* @__PURE__ */ jsxs31("fieldset", { children: [
|
|
14926
|
+
props.schema.title && !props.hideTitle && /* @__PURE__ */ jsx85(Header8, { title: props.schema.title, as: "legend" }),
|
|
14927
|
+
props.schema.description && !props.hideTitle && /* @__PURE__ */ jsxs31("p", { children: [
|
|
14888
14928
|
" ",
|
|
14889
14929
|
props.schema.description,
|
|
14890
14930
|
" "
|
|
14891
14931
|
] }),
|
|
14892
|
-
/* @__PURE__ */
|
|
14932
|
+
/* @__PURE__ */ jsx85("div", { className: "row", children: orderedPropertyNames.map((propertyName) => /* @__PURE__ */ jsx85(
|
|
14893
14933
|
"div",
|
|
14894
14934
|
{
|
|
14895
14935
|
className: (0, import_classnames11.default)(
|
|
14896
14936
|
getSchemaColumnClasses2(props.schema.properties[propertyName].width)
|
|
14897
14937
|
),
|
|
14898
|
-
children: /* @__PURE__ */
|
|
14938
|
+
children: /* @__PURE__ */ jsx85(
|
|
14899
14939
|
GenericSchema_default,
|
|
14900
14940
|
{
|
|
14901
14941
|
schema: props.schema.properties[propertyName],
|
|
@@ -14923,19 +14963,19 @@ var ObjectSchema_default = ObjectSchema;
|
|
|
14923
14963
|
// src/legacy/jsonSchemaForm/oneOfSchema/OneOfSchema.tsx
|
|
14924
14964
|
var import_classnames12 = __toESM(require_classnames());
|
|
14925
14965
|
import { Header as Header9 } from "@transferwise/components";
|
|
14926
|
-
import { useEffect as
|
|
14966
|
+
import { useEffect as useEffect12, useMemo as useMemo14, useState as useState18 } from "react";
|
|
14927
14967
|
|
|
14928
14968
|
// src/legacy/jsonSchemaForm/help/Help.tsx
|
|
14929
14969
|
import { Markdown as Markdown6, Info as Info2 } from "@transferwise/components";
|
|
14930
14970
|
import { useIntl as useIntl14 } from "react-intl";
|
|
14931
|
-
import { jsx as
|
|
14971
|
+
import { jsx as jsx86 } from "react/jsx-runtime";
|
|
14932
14972
|
function Help2(props) {
|
|
14933
14973
|
const intl = useIntl14();
|
|
14934
|
-
return /* @__PURE__ */
|
|
14974
|
+
return /* @__PURE__ */ jsx86(
|
|
14935
14975
|
Info2,
|
|
14936
14976
|
{
|
|
14937
14977
|
className: "m-l-1",
|
|
14938
|
-
content: /* @__PURE__ */
|
|
14978
|
+
content: /* @__PURE__ */ jsx86(Markdown6, { config: { link: { target: "_blank" } }, children: props.help.markdown }),
|
|
14939
14979
|
presentation: "POPOVER",
|
|
14940
14980
|
size: "sm",
|
|
14941
14981
|
"aria-label": intl.formatMessage(help_messages_default.helpAria)
|
|
@@ -14945,7 +14985,7 @@ function Help2(props) {
|
|
|
14945
14985
|
var Help_default2 = Help2;
|
|
14946
14986
|
|
|
14947
14987
|
// src/legacy/jsonSchemaForm/schemaFormControl/SchemaFormControl.tsx
|
|
14948
|
-
import { useEffect as
|
|
14988
|
+
import { useEffect as useEffect11 } from "react";
|
|
14949
14989
|
|
|
14950
14990
|
// src/legacy/formControl/FormControl.tsx
|
|
14951
14991
|
import {
|
|
@@ -15147,7 +15187,7 @@ var autocompleteTokenMap2 = {
|
|
|
15147
15187
|
};
|
|
15148
15188
|
|
|
15149
15189
|
// src/legacy/formControl/FormControl.tsx
|
|
15150
|
-
import { Fragment as
|
|
15190
|
+
import { Fragment as Fragment14, jsx as jsx87 } from "react/jsx-runtime";
|
|
15151
15191
|
var _FormControl = class _FormControl extends PureComponent {
|
|
15152
15192
|
constructor(props) {
|
|
15153
15193
|
super(props);
|
|
@@ -15235,7 +15275,7 @@ var _FormControl = class _FormControl extends PureComponent {
|
|
|
15235
15275
|
} = this.props;
|
|
15236
15276
|
switch (type) {
|
|
15237
15277
|
case FormControlType.RADIO:
|
|
15238
|
-
return /* @__PURE__ */
|
|
15278
|
+
return /* @__PURE__ */ jsx87(
|
|
15239
15279
|
RadioGroup2,
|
|
15240
15280
|
{
|
|
15241
15281
|
radios: options.map(this.mapOption),
|
|
@@ -15245,7 +15285,7 @@ var _FormControl = class _FormControl extends PureComponent {
|
|
|
15245
15285
|
}
|
|
15246
15286
|
);
|
|
15247
15287
|
case FormControlType.CHECKBOX:
|
|
15248
|
-
return /* @__PURE__ */
|
|
15288
|
+
return /* @__PURE__ */ jsx87(
|
|
15249
15289
|
Checkbox2,
|
|
15250
15290
|
{
|
|
15251
15291
|
checked: getSafeBooleanValue(value, { coerceValue: true }),
|
|
@@ -15263,7 +15303,7 @@ var _FormControl = class _FormControl extends PureComponent {
|
|
|
15263
15303
|
const search = options.length >= 8;
|
|
15264
15304
|
const items = options;
|
|
15265
15305
|
const selected = this.getSelectedOption(options);
|
|
15266
|
-
return /* @__PURE__ */
|
|
15306
|
+
return /* @__PURE__ */ jsx87("div", { className: "d-flex flex-column", children: /* @__PURE__ */ jsx87(
|
|
15267
15307
|
SelectInput3,
|
|
15268
15308
|
{
|
|
15269
15309
|
id,
|
|
@@ -15273,7 +15313,7 @@ var _FormControl = class _FormControl extends PureComponent {
|
|
|
15273
15313
|
disabled: value2.disabled
|
|
15274
15314
|
})),
|
|
15275
15315
|
value: selected != null ? selected : null,
|
|
15276
|
-
renderValue: ({ hideIconInTrigger, icon, label: label2, note, secondary }, withinTrigger) => /* @__PURE__ */
|
|
15316
|
+
renderValue: ({ hideIconInTrigger, icon, label: label2, note, secondary }, withinTrigger) => /* @__PURE__ */ jsx87(
|
|
15277
15317
|
SelectInputOptionContent3,
|
|
15278
15318
|
{
|
|
15279
15319
|
title: label2,
|
|
@@ -15294,7 +15334,7 @@ var _FormControl = class _FormControl extends PureComponent {
|
|
|
15294
15334
|
onFilterChange: search && onSearchChange ? ({ query }) => {
|
|
15295
15335
|
onSearchChange(query);
|
|
15296
15336
|
} : void 0,
|
|
15297
|
-
onClear: () => {
|
|
15337
|
+
onClear: required ? void 0 : () => {
|
|
15298
15338
|
this.setState({ selectedOption: null });
|
|
15299
15339
|
this.props.onChange(null);
|
|
15300
15340
|
}
|
|
@@ -15302,13 +15342,13 @@ var _FormControl = class _FormControl extends PureComponent {
|
|
|
15302
15342
|
) });
|
|
15303
15343
|
}
|
|
15304
15344
|
case FormControlType.TAB:
|
|
15305
|
-
return /* @__PURE__ */
|
|
15345
|
+
return /* @__PURE__ */ jsx87(
|
|
15306
15346
|
Tabs2,
|
|
15307
15347
|
{
|
|
15308
15348
|
selected: ((_a = this.getSelectedOption(options)) == null ? void 0 : _a.value) || 0,
|
|
15309
15349
|
tabs: options.map((option) => ({
|
|
15310
15350
|
title: option.label,
|
|
15311
|
-
content: /* @__PURE__ */
|
|
15351
|
+
content: /* @__PURE__ */ jsx87(Fragment14, {}),
|
|
15312
15352
|
disabled: option.disabled || false
|
|
15313
15353
|
})),
|
|
15314
15354
|
name: id,
|
|
@@ -15323,7 +15363,7 @@ var _FormControl = class _FormControl extends PureComponent {
|
|
|
15323
15363
|
);
|
|
15324
15364
|
case FormControlType.NUMERIC:
|
|
15325
15365
|
case FormControlType.NUMBER: {
|
|
15326
|
-
return /* @__PURE__ */
|
|
15366
|
+
return /* @__PURE__ */ jsx87(
|
|
15327
15367
|
"input",
|
|
15328
15368
|
{
|
|
15329
15369
|
autoComplete: this.getAutocompleteValue(),
|
|
@@ -15357,7 +15397,7 @@ var _FormControl = class _FormControl extends PureComponent {
|
|
|
15357
15397
|
);
|
|
15358
15398
|
}
|
|
15359
15399
|
case FormControlType.HIDDEN:
|
|
15360
|
-
return /* @__PURE__ */
|
|
15400
|
+
return /* @__PURE__ */ jsx87(
|
|
15361
15401
|
"input",
|
|
15362
15402
|
{
|
|
15363
15403
|
type: "hidden",
|
|
@@ -15367,7 +15407,7 @@ var _FormControl = class _FormControl extends PureComponent {
|
|
|
15367
15407
|
}
|
|
15368
15408
|
);
|
|
15369
15409
|
case FormControlType.PASSWORD:
|
|
15370
|
-
return /* @__PURE__ */
|
|
15410
|
+
return /* @__PURE__ */ jsx87(
|
|
15371
15411
|
"input",
|
|
15372
15412
|
{
|
|
15373
15413
|
autoComplete: this.getAutocompleteValue(),
|
|
@@ -15387,7 +15427,7 @@ var _FormControl = class _FormControl extends PureComponent {
|
|
|
15387
15427
|
);
|
|
15388
15428
|
case FormControlType.DATE:
|
|
15389
15429
|
case FormControlType.DATETIME:
|
|
15390
|
-
return /* @__PURE__ */
|
|
15430
|
+
return /* @__PURE__ */ jsx87(
|
|
15391
15431
|
DateInput2,
|
|
15392
15432
|
{
|
|
15393
15433
|
dayAutoComplete: this.getAutocompleteValue({ suffix: "-day" }),
|
|
@@ -15403,7 +15443,7 @@ var _FormControl = class _FormControl extends PureComponent {
|
|
|
15403
15443
|
}
|
|
15404
15444
|
);
|
|
15405
15445
|
case FormControlType.DATELOOKUP: {
|
|
15406
|
-
return /* @__PURE__ */
|
|
15446
|
+
return /* @__PURE__ */ jsx87(
|
|
15407
15447
|
DateLookup2,
|
|
15408
15448
|
{
|
|
15409
15449
|
value: getSafeDateStringValue(value),
|
|
@@ -15421,7 +15461,7 @@ var _FormControl = class _FormControl extends PureComponent {
|
|
|
15421
15461
|
);
|
|
15422
15462
|
}
|
|
15423
15463
|
case FormControlType.TEL:
|
|
15424
|
-
return /* @__PURE__ */
|
|
15464
|
+
return /* @__PURE__ */ jsx87(
|
|
15425
15465
|
PhoneNumberInput2,
|
|
15426
15466
|
{
|
|
15427
15467
|
disabled,
|
|
@@ -15453,7 +15493,7 @@ var _FormControl = class _FormControl extends PureComponent {
|
|
|
15453
15493
|
autoComplete: this.getAutocompleteValue()
|
|
15454
15494
|
};
|
|
15455
15495
|
if (this.props.displayPattern) {
|
|
15456
|
-
return /* @__PURE__ */
|
|
15496
|
+
return /* @__PURE__ */ jsx87(
|
|
15457
15497
|
TextareaWithDisplayFormat2,
|
|
15458
15498
|
__spreadProps(__spreadValues({
|
|
15459
15499
|
displayPattern: this.props.displayPattern
|
|
@@ -15462,7 +15502,7 @@ var _FormControl = class _FormControl extends PureComponent {
|
|
|
15462
15502
|
})
|
|
15463
15503
|
);
|
|
15464
15504
|
}
|
|
15465
|
-
return /* @__PURE__ */
|
|
15505
|
+
return /* @__PURE__ */ jsx87(
|
|
15466
15506
|
"textarea",
|
|
15467
15507
|
__spreadProps(__spreadValues({}, textareaProps), {
|
|
15468
15508
|
"aria-describedby": describedBy,
|
|
@@ -15475,7 +15515,7 @@ var _FormControl = class _FormControl extends PureComponent {
|
|
|
15475
15515
|
return (
|
|
15476
15516
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
15477
15517
|
// @ts-expect-error - TODO: Remove this once Upload is migrated to TypeScript
|
|
15478
|
-
/* @__PURE__ */
|
|
15518
|
+
/* @__PURE__ */ jsx87(
|
|
15479
15519
|
Upload2,
|
|
15480
15520
|
__spreadProps(__spreadValues({}, uploadProps), {
|
|
15481
15521
|
usAccept: uploadProps.usAccept || "*",
|
|
@@ -15513,7 +15553,7 @@ var _FormControl = class _FormControl extends PureComponent {
|
|
|
15513
15553
|
autoComplete: this.getAutocompleteValue()
|
|
15514
15554
|
};
|
|
15515
15555
|
if (this.props.displayPattern) {
|
|
15516
|
-
return /* @__PURE__ */
|
|
15556
|
+
return /* @__PURE__ */ jsx87(
|
|
15517
15557
|
InputWithDisplayFormat2,
|
|
15518
15558
|
__spreadProps(__spreadValues({
|
|
15519
15559
|
displayPattern: this.props.displayPattern
|
|
@@ -15522,7 +15562,7 @@ var _FormControl = class _FormControl extends PureComponent {
|
|
|
15522
15562
|
})
|
|
15523
15563
|
);
|
|
15524
15564
|
}
|
|
15525
|
-
return /* @__PURE__ */
|
|
15565
|
+
return /* @__PURE__ */ jsx87(
|
|
15526
15566
|
"input",
|
|
15527
15567
|
__spreadProps(__spreadValues({}, inputProps), {
|
|
15528
15568
|
"aria-describedby": describedBy,
|
|
@@ -15571,14 +15611,17 @@ _FormControl.defaultProps = {
|
|
|
15571
15611
|
var FormControl = _FormControl;
|
|
15572
15612
|
|
|
15573
15613
|
// src/legacy/jsonSchemaForm/schemaFormControl/SchemaFormControl.tsx
|
|
15574
|
-
import { jsx as
|
|
15614
|
+
import { jsx as jsx88 } from "react/jsx-runtime";
|
|
15575
15615
|
var isNativeInput = (propsSchemaType) => propsSchemaType === "string" || propsSchemaType === "number";
|
|
15576
15616
|
var getControlType = (schema) => {
|
|
15577
15617
|
if (isOneOfSchema2(schema)) {
|
|
15578
15618
|
if (schema.control === FormControlType.TAB && schema.oneOf.length > 3) {
|
|
15579
15619
|
return FormControlType.SELECT;
|
|
15580
15620
|
}
|
|
15581
|
-
|
|
15621
|
+
if (schema.control == null || !Object.values(FormControlType).includes(schema.control)) {
|
|
15622
|
+
return FormControlType.SELECT;
|
|
15623
|
+
}
|
|
15624
|
+
return schema.control;
|
|
15582
15625
|
}
|
|
15583
15626
|
if (isStringSchema2(schema)) {
|
|
15584
15627
|
return getStringSchemaControlType(schema);
|
|
@@ -15629,14 +15672,25 @@ var getOptions = (schema, controlType) => {
|
|
|
15629
15672
|
return null;
|
|
15630
15673
|
};
|
|
15631
15674
|
function SchemaFormControl(props) {
|
|
15632
|
-
const {
|
|
15675
|
+
const {
|
|
15676
|
+
id,
|
|
15677
|
+
schema,
|
|
15678
|
+
value,
|
|
15679
|
+
disabled,
|
|
15680
|
+
required,
|
|
15681
|
+
onChange,
|
|
15682
|
+
onFocus,
|
|
15683
|
+
onBlur,
|
|
15684
|
+
onSearchChange,
|
|
15685
|
+
describedBy
|
|
15686
|
+
} = props;
|
|
15633
15687
|
const log = useLogger();
|
|
15634
15688
|
const getSanitisedValue = (value2) => isNativeInput(schema.type) && (isNull3(value2) || isUndefined3(value2)) ? "" : value2;
|
|
15635
15689
|
const onModelChange = (value2, type, metadata) => {
|
|
15636
15690
|
onChange(getValidBasicModelOrNull(value2, schema), type, metadata);
|
|
15637
15691
|
};
|
|
15638
15692
|
const controlType = getControlType(schema);
|
|
15639
|
-
|
|
15693
|
+
useEffect11(() => {
|
|
15640
15694
|
warnIfInvalidSchema(schema, log, controlType);
|
|
15641
15695
|
}, [JSON.stringify(schema), log, controlType]);
|
|
15642
15696
|
const options = schema.values || getOptions(schema, controlType);
|
|
@@ -15660,9 +15714,10 @@ function SchemaFormControl(props) {
|
|
|
15660
15714
|
displayPattern: schema.displayFormat,
|
|
15661
15715
|
// TODO: LOW avoid type assertion below
|
|
15662
15716
|
uploadProps: mapSchemaToUploadOptions(schema),
|
|
15663
|
-
describedBy
|
|
15717
|
+
describedBy,
|
|
15718
|
+
required
|
|
15664
15719
|
};
|
|
15665
|
-
return /* @__PURE__ */
|
|
15720
|
+
return /* @__PURE__ */ jsx88("div", { "aria-describedby": describedBy, children: /* @__PURE__ */ jsx88(FormControl, __spreadValues(__spreadValues({ type: controlType, value: safeValue }, events), controlProps)) });
|
|
15666
15721
|
}
|
|
15667
15722
|
SchemaFormControl.defaultProps = {
|
|
15668
15723
|
value: null,
|
|
@@ -15691,7 +15746,7 @@ var warnIfInvalidSchema = (schema, log, controlType) => {
|
|
|
15691
15746
|
var SchemaFormControl_default = SchemaFormControl;
|
|
15692
15747
|
|
|
15693
15748
|
// src/legacy/jsonSchemaForm/oneOfSchema/OneOfSchema.tsx
|
|
15694
|
-
import { Fragment as
|
|
15749
|
+
import { Fragment as Fragment15, jsx as jsx89, jsxs as jsxs32 } from "react/jsx-runtime";
|
|
15695
15750
|
function OneOfSchema(props) {
|
|
15696
15751
|
const onEvent = useEventDispatcher();
|
|
15697
15752
|
const [changed, setChanged] = useState18(false);
|
|
@@ -15709,7 +15764,7 @@ function OneOfSchema(props) {
|
|
|
15709
15764
|
searchValueLength: searchValue.length
|
|
15710
15765
|
});
|
|
15711
15766
|
};
|
|
15712
|
-
|
|
15767
|
+
useEffect12(() => {
|
|
15713
15768
|
const modelIndex = getValidIndexFromValue(props.schema, props.model);
|
|
15714
15769
|
const defaultIndex = getValidIndexFromValue(props.schema, props.schema.default);
|
|
15715
15770
|
if (modelIndex === -1 && defaultIndex >= 0) {
|
|
@@ -15767,12 +15822,12 @@ function OneOfSchema(props) {
|
|
|
15767
15822
|
"has-error": !changed && props.errors && !isEmpty(props.errors) || (props.submitted || changed && blurred) && validations.length
|
|
15768
15823
|
};
|
|
15769
15824
|
const feedbackId = `${id}-feedback`;
|
|
15770
|
-
return /* @__PURE__ */
|
|
15771
|
-
(props.schema.oneOf.length > 1 || isConstSchema2(props.schema.oneOf[0])) && /* @__PURE__ */
|
|
15772
|
-
props.schema.alert && /* @__PURE__ */
|
|
15773
|
-
/* @__PURE__ */
|
|
15825
|
+
return /* @__PURE__ */ jsxs32(Fragment15, { children: [
|
|
15826
|
+
(props.schema.oneOf.length > 1 || isConstSchema2(props.schema.oneOf[0])) && /* @__PURE__ */ jsxs32(Fragment15, { children: [
|
|
15827
|
+
props.schema.alert && /* @__PURE__ */ jsx89(DynamicAlert_default, { component: props.schema.alert }),
|
|
15828
|
+
/* @__PURE__ */ jsxs32("div", { className: (0, import_classnames12.default)(formGroupClasses), children: [
|
|
15774
15829
|
getTitleAndHelp(props.schema, id),
|
|
15775
|
-
/* @__PURE__ */
|
|
15830
|
+
/* @__PURE__ */ jsx89(
|
|
15776
15831
|
SchemaFormControl_default,
|
|
15777
15832
|
{
|
|
15778
15833
|
id,
|
|
@@ -15780,13 +15835,14 @@ function OneOfSchema(props) {
|
|
|
15780
15835
|
value: schemaIndex,
|
|
15781
15836
|
disabled: props.disabled,
|
|
15782
15837
|
describedBy: feedbackId,
|
|
15838
|
+
required: props.required,
|
|
15783
15839
|
onChange: onChooseNewSchema,
|
|
15784
15840
|
onFocus,
|
|
15785
15841
|
onBlur,
|
|
15786
15842
|
onSearchChange
|
|
15787
15843
|
}
|
|
15788
15844
|
),
|
|
15789
|
-
/* @__PURE__ */
|
|
15845
|
+
/* @__PURE__ */ jsx89(
|
|
15790
15846
|
ControlFeedback_default,
|
|
15791
15847
|
{
|
|
15792
15848
|
id: feedbackId,
|
|
@@ -15802,7 +15858,7 @@ function OneOfSchema(props) {
|
|
|
15802
15858
|
)
|
|
15803
15859
|
] })
|
|
15804
15860
|
] }),
|
|
15805
|
-
isNoNConstSchema(props.schema.oneOf[schemaIndex]) && /* @__PURE__ */
|
|
15861
|
+
isNoNConstSchema(props.schema.oneOf[schemaIndex]) && /* @__PURE__ */ jsx89(
|
|
15806
15862
|
GenericSchema_default,
|
|
15807
15863
|
{
|
|
15808
15864
|
schema: props.schema.oneOf[schemaIndex],
|
|
@@ -15819,16 +15875,16 @@ function OneOfSchema(props) {
|
|
|
15819
15875
|
}
|
|
15820
15876
|
function getTitleAndHelp(schema, forId) {
|
|
15821
15877
|
var _a;
|
|
15822
|
-
const helpElement = schema.help ? /* @__PURE__ */
|
|
15823
|
-
const titleElement = isConstSchema2(schema.oneOf[0]) ? /* @__PURE__ */
|
|
15878
|
+
const helpElement = schema.help ? /* @__PURE__ */ jsx89(Help_default2, { help: schema.help }) : null;
|
|
15879
|
+
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: [
|
|
15824
15880
|
schema.title,
|
|
15825
15881
|
" ",
|
|
15826
15882
|
helpElement
|
|
15827
|
-
] }) }) : /* @__PURE__ */
|
|
15883
|
+
] }) }) : /* @__PURE__ */ jsx89(Fragment15, { children: helpElement ? /* @__PURE__ */ jsxs32("h4", { className: "m-b-2", children: [
|
|
15828
15884
|
schema.title,
|
|
15829
15885
|
" ",
|
|
15830
15886
|
helpElement
|
|
15831
|
-
] }) : /* @__PURE__ */
|
|
15887
|
+
] }) : /* @__PURE__ */ jsx89(Header9, { title: (_a = schema.title) != null ? _a : "" }) });
|
|
15832
15888
|
return schema.title ? titleElement : helpElement;
|
|
15833
15889
|
}
|
|
15834
15890
|
function getValidations(props, schemaIndex) {
|
|
@@ -15865,12 +15921,12 @@ var OneOfSchema_default = OneOfSchema;
|
|
|
15865
15921
|
|
|
15866
15922
|
// src/legacy/jsonSchemaForm/persistAsyncSchema/persistAsyncBlobSchema/PersistAsyncBlobSchema.tsx
|
|
15867
15923
|
var import_classnames13 = __toESM(require_classnames());
|
|
15868
|
-
import { useEffect as
|
|
15924
|
+
import { useEffect as useEffect13, useState as useState19 } from "react";
|
|
15869
15925
|
|
|
15870
15926
|
// src/legacy/jsonSchemaForm/persistAsyncSchema/persistAsyncBlobSchema/UploadInputAdapter.tsx
|
|
15871
15927
|
import { Status as Status2, UploadInput as UploadInput4 } from "@transferwise/components";
|
|
15872
15928
|
import { useMemo as useMemo15 } from "react";
|
|
15873
|
-
import { jsx as
|
|
15929
|
+
import { jsx as jsx90 } from "react/jsx-runtime";
|
|
15874
15930
|
function UploadInputAdapter(props) {
|
|
15875
15931
|
const {
|
|
15876
15932
|
id,
|
|
@@ -15903,7 +15959,7 @@ function UploadInputAdapter(props) {
|
|
|
15903
15959
|
return Promise.reject();
|
|
15904
15960
|
});
|
|
15905
15961
|
};
|
|
15906
|
-
return /* @__PURE__ */
|
|
15962
|
+
return /* @__PURE__ */ jsx90(
|
|
15907
15963
|
UploadInput4,
|
|
15908
15964
|
{
|
|
15909
15965
|
id,
|
|
@@ -15923,7 +15979,7 @@ function UploadInputAdapter(props) {
|
|
|
15923
15979
|
}
|
|
15924
15980
|
|
|
15925
15981
|
// src/legacy/jsonSchemaForm/persistAsyncSchema/persistAsyncBlobSchema/PersistAsyncBlobSchema.tsx
|
|
15926
|
-
import { jsx as
|
|
15982
|
+
import { jsx as jsx91, jsxs as jsxs33 } from "react/jsx-runtime";
|
|
15927
15983
|
function PersistAsyncBlobSchema(props) {
|
|
15928
15984
|
const { model, schema, submitted, required, errors, onChange } = props;
|
|
15929
15985
|
const [persistAsyncValidationMessages, setPersistAsyncValidationMessages] = useState19({});
|
|
@@ -15932,7 +15988,7 @@ function PersistAsyncBlobSchema(props) {
|
|
|
15932
15988
|
const [changed, setChanged] = useState19(false);
|
|
15933
15989
|
const httpClient = useHttpClient();
|
|
15934
15990
|
const onEvent = useEventDispatcher();
|
|
15935
|
-
|
|
15991
|
+
useEffect13(() => {
|
|
15936
15992
|
if (submitted) {
|
|
15937
15993
|
setValidations(getValidationFailures(model, schema, Boolean(required)));
|
|
15938
15994
|
} else {
|
|
@@ -15969,8 +16025,8 @@ function PersistAsyncBlobSchema(props) {
|
|
|
15969
16025
|
};
|
|
15970
16026
|
const id = schema.$id || schema.persistAsync.schema.$id || schema.persistAsync.idProperty;
|
|
15971
16027
|
const feedbackId = `${id}-feedback`;
|
|
15972
|
-
return /* @__PURE__ */
|
|
15973
|
-
/* @__PURE__ */
|
|
16028
|
+
return /* @__PURE__ */ jsxs33("div", { className: (0, import_classnames13.default)(formGroupClasses), children: [
|
|
16029
|
+
/* @__PURE__ */ jsx91("div", { "aria-describedby": feedbackId, children: /* @__PURE__ */ jsx91(
|
|
15974
16030
|
UploadInputAdapter,
|
|
15975
16031
|
__spreadValues({
|
|
15976
16032
|
id,
|
|
@@ -15987,7 +16043,7 @@ function PersistAsyncBlobSchema(props) {
|
|
|
15987
16043
|
onCancel
|
|
15988
16044
|
}, mapSchemaToUploadOptions(schema.persistAsync.schema))
|
|
15989
16045
|
) }),
|
|
15990
|
-
/* @__PURE__ */
|
|
16046
|
+
/* @__PURE__ */ jsx91(
|
|
15991
16047
|
ControlFeedback_default,
|
|
15992
16048
|
{
|
|
15993
16049
|
id: feedbackId,
|
|
@@ -16012,17 +16068,17 @@ PersistAsyncBlobSchema.defaultProps = {
|
|
|
16012
16068
|
var PersistAsyncBlobSchema_default = PersistAsyncBlobSchema;
|
|
16013
16069
|
|
|
16014
16070
|
// src/legacy/jsonSchemaForm/persistAsyncSchema/PersistAsyncSchema.tsx
|
|
16015
|
-
import { jsx as
|
|
16071
|
+
import { jsx as jsx92 } from "react/jsx-runtime";
|
|
16016
16072
|
function PersistAsyncSchema(props) {
|
|
16017
16073
|
const { schema } = props;
|
|
16018
16074
|
const persistAsyncSchemaType = schema.persistAsync.schema.type;
|
|
16019
16075
|
if (persistAsyncSchemaType === "blob") {
|
|
16020
|
-
return /* @__PURE__ */
|
|
16076
|
+
return /* @__PURE__ */ jsx92(
|
|
16021
16077
|
PersistAsyncBlobSchema_default,
|
|
16022
16078
|
__spreadValues({}, props)
|
|
16023
16079
|
);
|
|
16024
16080
|
}
|
|
16025
|
-
return /* @__PURE__ */
|
|
16081
|
+
return /* @__PURE__ */ jsx92(PersistAsyncBasicSchema_default, __spreadValues({}, props));
|
|
16026
16082
|
}
|
|
16027
16083
|
PersistAsyncSchema.defaultProps = {
|
|
16028
16084
|
required: false
|
|
@@ -16043,7 +16099,7 @@ var getSelectionFromModel = (schema, model) => {
|
|
|
16043
16099
|
|
|
16044
16100
|
// src/legacy/jsonSchemaForm/promotedOneOfSchema/promotedOneOfControl/PromotedOneOfCheckboxControl.tsx
|
|
16045
16101
|
import { Checkbox as Checkbox3 } from "@transferwise/components";
|
|
16046
|
-
import { jsx as
|
|
16102
|
+
import { jsx as jsx93 } from "react/jsx-runtime";
|
|
16047
16103
|
var PromotedOneOfCheckboxControl = (props) => {
|
|
16048
16104
|
const { id, selection, setSelection } = props;
|
|
16049
16105
|
const { promoted, other, checkedMeans } = props.promotion;
|
|
@@ -16054,14 +16110,14 @@ var PromotedOneOfCheckboxControl = (props) => {
|
|
|
16054
16110
|
const toggleSelection = () => {
|
|
16055
16111
|
setSelection(checked ? selectionWhenUnchecked : selectionWhenChecked);
|
|
16056
16112
|
};
|
|
16057
|
-
return /* @__PURE__ */
|
|
16113
|
+
return /* @__PURE__ */ jsx93("div", { className: "form-group", children: /* @__PURE__ */ jsx93(Checkbox3, { id, label: title, checked, onChange: toggleSelection }) });
|
|
16058
16114
|
};
|
|
16059
16115
|
PromotedOneOfCheckboxControl.defaultProps = {};
|
|
16060
16116
|
var PromotedOneOfCheckboxControl_default = PromotedOneOfCheckboxControl;
|
|
16061
16117
|
|
|
16062
16118
|
// src/legacy/jsonSchemaForm/promotedOneOfSchema/promotedOneOfControl/PromotedOneOfRadioControl.tsx
|
|
16063
16119
|
import { RadioGroup as RadioGroup3 } from "@transferwise/components";
|
|
16064
|
-
import { jsx as
|
|
16120
|
+
import { jsx as jsx94, jsxs as jsxs34 } from "react/jsx-runtime";
|
|
16065
16121
|
function PromotedOneOfRadioControl(props) {
|
|
16066
16122
|
var _a, _b;
|
|
16067
16123
|
const { id, selection, setSelection, promotion, promotedOneOf, title } = props;
|
|
@@ -16078,9 +16134,9 @@ function PromotedOneOfRadioControl(props) {
|
|
|
16078
16134
|
secondary: promotion.other.description
|
|
16079
16135
|
}, getAvatarPropertyForRadioOption(promotion.other))
|
|
16080
16136
|
];
|
|
16081
|
-
return /* @__PURE__ */
|
|
16082
|
-
title && /* @__PURE__ */
|
|
16083
|
-
/* @__PURE__ */
|
|
16137
|
+
return /* @__PURE__ */ jsxs34("div", { className: "form-group", children: [
|
|
16138
|
+
title && /* @__PURE__ */ jsx94("label", { className: "control-label", htmlFor: id, children: title }),
|
|
16139
|
+
/* @__PURE__ */ jsx94(
|
|
16084
16140
|
RadioGroup3,
|
|
16085
16141
|
{
|
|
16086
16142
|
name: "promoted-selection",
|
|
@@ -16098,16 +16154,16 @@ PromotedOneOfRadioControl.defaultProps = {
|
|
|
16098
16154
|
var PromotedOneOfRadioControl_default = PromotedOneOfRadioControl;
|
|
16099
16155
|
|
|
16100
16156
|
// src/legacy/jsonSchemaForm/promotedOneOfSchema/promotedOneOfControl/PromotedOneOfControl.tsx
|
|
16101
|
-
import { Fragment as
|
|
16157
|
+
import { Fragment as Fragment16, jsx as jsx95 } from "react/jsx-runtime";
|
|
16102
16158
|
function PromotedOneOfControl(props) {
|
|
16103
16159
|
const controlType = props.promotion.control || "radio";
|
|
16104
16160
|
switch (controlType) {
|
|
16105
16161
|
case "radio":
|
|
16106
|
-
return /* @__PURE__ */
|
|
16162
|
+
return /* @__PURE__ */ jsx95(PromotedOneOfRadioControl_default, __spreadValues({}, props));
|
|
16107
16163
|
case "checkbox":
|
|
16108
|
-
return /* @__PURE__ */
|
|
16164
|
+
return /* @__PURE__ */ jsx95(PromotedOneOfCheckboxControl_default, __spreadValues({}, props));
|
|
16109
16165
|
default:
|
|
16110
|
-
return /* @__PURE__ */
|
|
16166
|
+
return /* @__PURE__ */ jsx95(Fragment16, {});
|
|
16111
16167
|
}
|
|
16112
16168
|
}
|
|
16113
16169
|
PromotedOneOfControl.defaultProps = {
|
|
@@ -16117,7 +16173,7 @@ PromotedOneOfControl.defaultProps = {
|
|
|
16117
16173
|
var PromotedOneOfControl_default = PromotedOneOfControl;
|
|
16118
16174
|
|
|
16119
16175
|
// src/legacy/jsonSchemaForm/promotedOneOfSchema/PromotedOneOfSchema.tsx
|
|
16120
|
-
import { Fragment as
|
|
16176
|
+
import { Fragment as Fragment17, jsx as jsx96, jsxs as jsxs35 } from "react/jsx-runtime";
|
|
16121
16177
|
var isPromoted = (schema) => schema.promoted === true;
|
|
16122
16178
|
var PromotedOneOfSchema = (props) => {
|
|
16123
16179
|
var _a;
|
|
@@ -16128,9 +16184,9 @@ var PromotedOneOfSchema = (props) => {
|
|
|
16128
16184
|
const promotedOneOf = props.schema.oneOf.find(isPromoted);
|
|
16129
16185
|
const promotedObjectSchema = getPromotedObjectSchema(promotedOneOf);
|
|
16130
16186
|
const otherOneOf = getOtherOneOf(props.schema);
|
|
16131
|
-
return /* @__PURE__ */
|
|
16132
|
-
promotedAlert && /* @__PURE__ */
|
|
16133
|
-
/* @__PURE__ */
|
|
16187
|
+
return /* @__PURE__ */ jsxs35(Fragment17, { children: [
|
|
16188
|
+
promotedAlert && /* @__PURE__ */ jsx96(DynamicAlert_default, { component: promotedAlert }),
|
|
16189
|
+
/* @__PURE__ */ jsx96(
|
|
16134
16190
|
PromotedOneOfControl_default,
|
|
16135
16191
|
{
|
|
16136
16192
|
id: props.schema.$id,
|
|
@@ -16141,8 +16197,8 @@ var PromotedOneOfSchema = (props) => {
|
|
|
16141
16197
|
setSelection
|
|
16142
16198
|
}
|
|
16143
16199
|
),
|
|
16144
|
-
selection === "promoted" && /* @__PURE__ */
|
|
16145
|
-
selection === "other" && /* @__PURE__ */
|
|
16200
|
+
selection === "promoted" && /* @__PURE__ */ jsx96(ObjectSchema_default, __spreadProps(__spreadValues({}, props), { schema: promotedObjectSchema })),
|
|
16201
|
+
selection === "other" && /* @__PURE__ */ jsx96(GenericSchema_default, __spreadProps(__spreadValues({}, props), { schema: otherOneOf }))
|
|
16146
16202
|
] });
|
|
16147
16203
|
};
|
|
16148
16204
|
function getPromotedObjectSchema(promotedSchema) {
|
|
@@ -16191,12 +16247,12 @@ var ReadOnlySchema_messages_default = defineMessages12({
|
|
|
16191
16247
|
});
|
|
16192
16248
|
|
|
16193
16249
|
// src/legacy/jsonSchemaForm/readOnlySchema/ReadOnlySchema.tsx
|
|
16194
|
-
import { Fragment as
|
|
16250
|
+
import { Fragment as Fragment18, jsx as jsx97, jsxs as jsxs36 } from "react/jsx-runtime";
|
|
16195
16251
|
function ReadOnlySchema({ schema, model }) {
|
|
16196
16252
|
const { title = "" } = schema;
|
|
16197
16253
|
const { formatMessage } = useIntl15();
|
|
16198
16254
|
const value = getValueForSchema({ schema, model, formatMessage });
|
|
16199
|
-
return /* @__PURE__ */
|
|
16255
|
+
return /* @__PURE__ */ jsx97(DefinitionList2, { layout: Layout.VERTICAL_ONE_COLUMN, definitions: [{ title, value, key: "" }] });
|
|
16200
16256
|
}
|
|
16201
16257
|
var ReadOnlySchema_default = ReadOnlySchema;
|
|
16202
16258
|
function getValueForSchema({
|
|
@@ -16229,7 +16285,7 @@ function getSelectedOneOf(schema, model) {
|
|
|
16229
16285
|
function getValueFromOption(option) {
|
|
16230
16286
|
const text = option.title && option.description ? `${option.title} - ${option.description}` : option.title || "";
|
|
16231
16287
|
const icon = getAvatarPropertyForRadioOption({ icon: option.icon });
|
|
16232
|
-
return (icon == null ? void 0 : icon.avatar) ? /* @__PURE__ */
|
|
16288
|
+
return (icon == null ? void 0 : icon.avatar) ? /* @__PURE__ */ jsxs36(Fragment18, { children: [
|
|
16233
16289
|
icon.avatar,
|
|
16234
16290
|
" ",
|
|
16235
16291
|
text
|
|
@@ -16237,8 +16293,8 @@ function getValueFromOption(option) {
|
|
|
16237
16293
|
}
|
|
16238
16294
|
|
|
16239
16295
|
// src/legacy/jsonSchemaForm/validationAsyncSchema/ValidationAsyncSchema.tsx
|
|
16240
|
-
import { useEffect as
|
|
16241
|
-
import { jsx as
|
|
16296
|
+
import { useEffect as useEffect14, useRef as useRef3, useState as useState21 } from "react";
|
|
16297
|
+
import { jsx as jsx98 } from "react/jsx-runtime";
|
|
16242
16298
|
function ValidationAsyncSchema(props) {
|
|
16243
16299
|
const { schema, model, required, submitted, errors, onChange } = props;
|
|
16244
16300
|
const [validationAsyncModel, setValidationAsyncModel] = useState21(model);
|
|
@@ -16252,7 +16308,7 @@ function ValidationAsyncSchema(props) {
|
|
|
16252
16308
|
const httpClient = useHttpClient();
|
|
16253
16309
|
const onEvent = useEventDispatcher();
|
|
16254
16310
|
const log = useLogger();
|
|
16255
|
-
|
|
16311
|
+
useEffect14(() => {
|
|
16256
16312
|
if (!schema.validationAsync.method) {
|
|
16257
16313
|
log.warning(
|
|
16258
16314
|
"Invalid schema or model",
|
|
@@ -16322,20 +16378,20 @@ function ValidationAsyncSchema(props) {
|
|
|
16322
16378
|
required,
|
|
16323
16379
|
schema
|
|
16324
16380
|
};
|
|
16325
|
-
return /* @__PURE__ */
|
|
16381
|
+
return /* @__PURE__ */ jsx98(BasicTypeSchema_default, __spreadValues({}, basicTypeSchemaProps));
|
|
16326
16382
|
}
|
|
16327
16383
|
ValidationAsyncSchema.defaultProps = { required: false };
|
|
16328
16384
|
var ValidationAsyncSchema_default = ValidationAsyncSchema;
|
|
16329
16385
|
|
|
16330
16386
|
// src/legacy/jsonSchemaForm/genericSchema/GenericSchema.tsx
|
|
16331
|
-
import { Fragment as
|
|
16387
|
+
import { Fragment as Fragment19, jsx as jsx99 } from "react/jsx-runtime";
|
|
16332
16388
|
import { createElement } from "react";
|
|
16333
16389
|
function GenericSchemaForm(props) {
|
|
16334
16390
|
const { schema, model = null, errors = null, hideTitle = false, disabled = false } = props;
|
|
16335
16391
|
const schemaProps = __spreadProps(__spreadValues({}, props), { model, errors, hideTitle, disabled });
|
|
16336
16392
|
const type = getSchemaType(schema);
|
|
16337
16393
|
const log = useLogger();
|
|
16338
|
-
|
|
16394
|
+
useEffect15(() => {
|
|
16339
16395
|
if (!isValidGenericSchema(schema, model, errors)) {
|
|
16340
16396
|
log.error(
|
|
16341
16397
|
"Invalid schema or model",
|
|
@@ -16345,29 +16401,29 @@ function GenericSchemaForm(props) {
|
|
|
16345
16401
|
}, [JSON.stringify(schema), JSON.stringify(model), JSON.stringify(errors), type, log]);
|
|
16346
16402
|
switch (type) {
|
|
16347
16403
|
case "readOnly":
|
|
16348
|
-
return /* @__PURE__ */
|
|
16404
|
+
return /* @__PURE__ */ jsx99(ReadOnlySchema_default, __spreadValues({}, schemaProps));
|
|
16349
16405
|
case "persistAsync":
|
|
16350
|
-
return /* @__PURE__ */
|
|
16406
|
+
return /* @__PURE__ */ jsx99(PersistAsyncSchema_default, __spreadValues({}, schemaProps));
|
|
16351
16407
|
case "validationAsync":
|
|
16352
|
-
return /* @__PURE__ */
|
|
16408
|
+
return /* @__PURE__ */ jsx99(ValidationAsyncSchema_default, __spreadValues({}, schemaProps));
|
|
16353
16409
|
case "basic": {
|
|
16354
16410
|
const basicTypeProps = __spreadValues({
|
|
16355
16411
|
infoMessage: null
|
|
16356
16412
|
}, schemaProps);
|
|
16357
|
-
return /* @__PURE__ */
|
|
16413
|
+
return /* @__PURE__ */ jsx99(BasicTypeSchema_default, __spreadValues({}, basicTypeProps));
|
|
16358
16414
|
}
|
|
16359
16415
|
case "object":
|
|
16360
16416
|
return /* @__PURE__ */ createElement(ObjectSchema_default, __spreadProps(__spreadValues({}, schemaProps), { key: JSON.stringify(schema) }));
|
|
16361
16417
|
case "array":
|
|
16362
|
-
return /* @__PURE__ */
|
|
16418
|
+
return /* @__PURE__ */ jsx99(ArraySchema_default, __spreadValues({}, schemaProps));
|
|
16363
16419
|
case "promotedOneOf":
|
|
16364
|
-
return /* @__PURE__ */
|
|
16420
|
+
return /* @__PURE__ */ jsx99(PromotedOneOfSchema_default, __spreadValues({}, schemaProps));
|
|
16365
16421
|
case "oneOf":
|
|
16366
|
-
return /* @__PURE__ */
|
|
16422
|
+
return /* @__PURE__ */ jsx99(OneOfSchema_default, __spreadValues({}, schemaProps));
|
|
16367
16423
|
case "allOf":
|
|
16368
|
-
return /* @__PURE__ */
|
|
16424
|
+
return /* @__PURE__ */ jsx99(AllOfSchema_default, __spreadValues({}, schemaProps));
|
|
16369
16425
|
}
|
|
16370
|
-
return /* @__PURE__ */
|
|
16426
|
+
return /* @__PURE__ */ jsx99(Fragment19, {});
|
|
16371
16427
|
}
|
|
16372
16428
|
var GenericSchema_default = GenericSchemaForm;
|
|
16373
16429
|
var isValidGenericSchema = (schema, model, errors) => {
|
|
@@ -16394,7 +16450,7 @@ var isValidGenericSchema = (schema, model, errors) => {
|
|
|
16394
16450
|
};
|
|
16395
16451
|
|
|
16396
16452
|
// src/legacy/layout/form/DynamicForm.tsx
|
|
16397
|
-
import { jsx as
|
|
16453
|
+
import { jsx as jsx100 } from "react/jsx-runtime";
|
|
16398
16454
|
function DynamicForm({
|
|
16399
16455
|
component,
|
|
16400
16456
|
model = null,
|
|
@@ -16404,7 +16460,7 @@ function DynamicForm({
|
|
|
16404
16460
|
onPersistAsync
|
|
16405
16461
|
}) {
|
|
16406
16462
|
const formSchema = component.schema;
|
|
16407
|
-
return /* @__PURE__ */
|
|
16463
|
+
return /* @__PURE__ */ jsx100("div", { className: getMargin2(component.margin || "md"), children: /* @__PURE__ */ jsx100(
|
|
16408
16464
|
GenericSchema_default,
|
|
16409
16465
|
{
|
|
16410
16466
|
schema: formSchema,
|
|
@@ -16423,62 +16479,62 @@ var DynamicForm_default = DynamicForm;
|
|
|
16423
16479
|
// src/legacy/layout/heading/DynamicHeading.tsx
|
|
16424
16480
|
var import_classnames14 = __toESM(require_classnames());
|
|
16425
16481
|
import { Display as Display2 } from "@transferwise/components";
|
|
16426
|
-
import { jsx as
|
|
16482
|
+
import { jsx as jsx101 } from "react/jsx-runtime";
|
|
16427
16483
|
var DynamicHeading = (props) => {
|
|
16428
16484
|
const { text, size = "md", align = "left", margin = "md", control } = props.component;
|
|
16429
16485
|
const classes = (0, import_classnames14.default)(getTextAlignmentAndMargin2({ align, margin }));
|
|
16430
|
-
return control === "display" ? /* @__PURE__ */
|
|
16486
|
+
return control === "display" ? /* @__PURE__ */ jsx101(DisplayHeading2, { size, text, classes }) : /* @__PURE__ */ jsx101(StandardHeading2, { size, text, classes });
|
|
16431
16487
|
};
|
|
16432
16488
|
var StandardHeading2 = ({ size, text, classes }) => {
|
|
16433
16489
|
switch (size) {
|
|
16434
16490
|
case "xs":
|
|
16435
|
-
return /* @__PURE__ */
|
|
16491
|
+
return /* @__PURE__ */ jsx101("h5", { className: classes, children: text });
|
|
16436
16492
|
case "sm":
|
|
16437
|
-
return /* @__PURE__ */
|
|
16493
|
+
return /* @__PURE__ */ jsx101("h4", { className: classes, children: text });
|
|
16438
16494
|
case "lg":
|
|
16439
|
-
return /* @__PURE__ */
|
|
16495
|
+
return /* @__PURE__ */ jsx101("h2", { className: classes, children: text });
|
|
16440
16496
|
case "xl":
|
|
16441
|
-
return /* @__PURE__ */
|
|
16497
|
+
return /* @__PURE__ */ jsx101("h1", { className: classes, children: text });
|
|
16442
16498
|
case "md":
|
|
16443
16499
|
default:
|
|
16444
|
-
return /* @__PURE__ */
|
|
16500
|
+
return /* @__PURE__ */ jsx101("h3", { className: classes, children: text });
|
|
16445
16501
|
}
|
|
16446
16502
|
};
|
|
16447
16503
|
var DisplayHeading2 = ({ size, text, classes }) => {
|
|
16448
16504
|
switch (size) {
|
|
16449
16505
|
case "xs":
|
|
16450
16506
|
case "sm":
|
|
16451
|
-
return /* @__PURE__ */
|
|
16507
|
+
return /* @__PURE__ */ jsx101(Display2, { type: "display-small", className: classes, children: text });
|
|
16452
16508
|
case "xl":
|
|
16453
16509
|
case "lg":
|
|
16454
|
-
return /* @__PURE__ */
|
|
16510
|
+
return /* @__PURE__ */ jsx101(Display2, { type: "display-large", className: classes, children: text });
|
|
16455
16511
|
case "md":
|
|
16456
16512
|
default:
|
|
16457
|
-
return /* @__PURE__ */
|
|
16513
|
+
return /* @__PURE__ */ jsx101(Display2, { type: "display-medium", className: classes, children: text });
|
|
16458
16514
|
}
|
|
16459
16515
|
};
|
|
16460
16516
|
var DynamicHeading_default = DynamicHeading;
|
|
16461
16517
|
|
|
16462
16518
|
// src/legacy/layout/markdown/DynamicMarkdown.tsx
|
|
16463
16519
|
import { Markdown as Markdown7 } from "@transferwise/components";
|
|
16464
|
-
import { jsx as
|
|
16520
|
+
import { jsx as jsx102 } from "react/jsx-runtime";
|
|
16465
16521
|
var DynamicMarkdown = ({ component }) => {
|
|
16466
16522
|
const { content, align, margin } = component;
|
|
16467
|
-
return /* @__PURE__ */
|
|
16523
|
+
return /* @__PURE__ */ jsx102("div", { className: getTextAlignmentAndMargin2({ align, margin }), children: /* @__PURE__ */ jsx102(Markdown7, { config: { link: { target: "_blank" } }, children: content }) });
|
|
16468
16524
|
};
|
|
16469
16525
|
var DynamicInfo = ({ component }) => {
|
|
16470
|
-
return /* @__PURE__ */
|
|
16526
|
+
return /* @__PURE__ */ jsx102("div", { className: getTextAlignmentAndMargin2(component), children: /* @__PURE__ */ jsx102(Markdown7, { config: { link: { target: "_blank" } }, children: component.markdown }) });
|
|
16471
16527
|
};
|
|
16472
16528
|
|
|
16473
16529
|
// src/legacy/layout/image/DynamicImage.tsx
|
|
16474
16530
|
import { Image as Image2 } from "@transferwise/components";
|
|
16475
|
-
import { useEffect as
|
|
16476
|
-
import { jsx as
|
|
16531
|
+
import { useEffect as useEffect16, useState as useState22 } from "react";
|
|
16532
|
+
import { jsx as jsx103 } from "react/jsx-runtime";
|
|
16477
16533
|
function DynamicImage({ component: image }) {
|
|
16478
16534
|
const { url, size, text, margin, accessibilityDescription } = image;
|
|
16479
16535
|
const httpClient = useHttpClient();
|
|
16480
16536
|
const [imageSource, setImageSource] = useState22("");
|
|
16481
|
-
|
|
16537
|
+
useEffect16(() => {
|
|
16482
16538
|
void getImageSource2(httpClient, url).then(setImageSource);
|
|
16483
16539
|
}, [url, httpClient]);
|
|
16484
16540
|
const imageProps = {
|
|
@@ -16490,7 +16546,7 @@ function DynamicImage({ component: image }) {
|
|
|
16490
16546
|
if (!imageSource) {
|
|
16491
16547
|
return null;
|
|
16492
16548
|
}
|
|
16493
|
-
return /* @__PURE__ */
|
|
16549
|
+
return /* @__PURE__ */ jsx103("div", { className: `df-image ${size || "md"}`, children: /* @__PURE__ */ jsx103(Image2, __spreadValues({ className: `img-responsive ${getMargin2(margin || "md")}` }, imageProps)) });
|
|
16494
16550
|
}
|
|
16495
16551
|
var readImageBlobAsDataURL2 = (imageBlob) => (
|
|
16496
16552
|
// we can safely assume the type of reader.result is string
|
|
@@ -16527,47 +16583,47 @@ var DynamicImage_default = DynamicImage;
|
|
|
16527
16583
|
|
|
16528
16584
|
// src/legacy/layout/instructions/DynamicInstructions.tsx
|
|
16529
16585
|
import { Header as Header10, InstructionsList as InstructionsList2 } from "@transferwise/components";
|
|
16530
|
-
import { jsx as
|
|
16586
|
+
import { jsx as jsx104, jsxs as jsxs37 } from "react/jsx-runtime";
|
|
16531
16587
|
var doContext2 = ["positive", "neutral"];
|
|
16532
16588
|
var dontContext2 = ["warning", "negative"];
|
|
16533
16589
|
var DynamicInstructions = ({ component }) => {
|
|
16534
16590
|
const { items } = component;
|
|
16535
16591
|
const dos = items.filter((item) => doContext2.includes(item.context)).map(({ text }) => text);
|
|
16536
16592
|
const donts = items.filter((item) => dontContext2.includes(item.context)).map(({ text }) => text);
|
|
16537
|
-
return /* @__PURE__ */
|
|
16538
|
-
component.title ? /* @__PURE__ */
|
|
16539
|
-
/* @__PURE__ */
|
|
16593
|
+
return /* @__PURE__ */ jsxs37("div", { className: getMargin2(component.margin || "md"), children: [
|
|
16594
|
+
component.title ? /* @__PURE__ */ jsx104(Header10, { title: component.title }) : null,
|
|
16595
|
+
/* @__PURE__ */ jsx104(InstructionsList2, { dos, donts })
|
|
16540
16596
|
] });
|
|
16541
16597
|
};
|
|
16542
16598
|
var DynamicInstructions_default = DynamicInstructions;
|
|
16543
16599
|
|
|
16544
16600
|
// src/legacy/layout/DynamicLayout.tsx
|
|
16545
|
-
import { Fragment as
|
|
16601
|
+
import { Fragment as Fragment20, jsx as jsx105 } from "react/jsx-runtime";
|
|
16546
16602
|
var getKey = (component) => JSON.stringify(component);
|
|
16547
16603
|
function DynamicLayout(props) {
|
|
16548
16604
|
const { components, model, submitted, errors, onModelChange, onAction, onPersistAsync, baseUrl } = props;
|
|
16549
16605
|
const renderComponent = (component) => {
|
|
16550
16606
|
switch (component.type) {
|
|
16551
16607
|
case "heading":
|
|
16552
|
-
return /* @__PURE__ */
|
|
16608
|
+
return /* @__PURE__ */ jsx105(DynamicHeading_default, { component }, getKey(component));
|
|
16553
16609
|
case "paragraph":
|
|
16554
|
-
return /* @__PURE__ */
|
|
16610
|
+
return /* @__PURE__ */ jsx105(DynamicParagraph_default, { component }, getKey(component));
|
|
16555
16611
|
case "image":
|
|
16556
|
-
return /* @__PURE__ */
|
|
16612
|
+
return /* @__PURE__ */ jsx105(DynamicImage_default, { component }, getKey(component));
|
|
16557
16613
|
case "alert":
|
|
16558
|
-
return /* @__PURE__ */
|
|
16614
|
+
return /* @__PURE__ */ jsx105(DynamicAlert_default, { component }, getKey(component));
|
|
16559
16615
|
case "review":
|
|
16560
|
-
return /* @__PURE__ */
|
|
16616
|
+
return /* @__PURE__ */ jsx105(DynamicReview_default, { component, onAction }, getKey(component));
|
|
16561
16617
|
case "divider":
|
|
16562
|
-
return /* @__PURE__ */
|
|
16618
|
+
return /* @__PURE__ */ jsx105(DynamicDivider_default, { component }, getKey(component));
|
|
16563
16619
|
case "info":
|
|
16564
|
-
return /* @__PURE__ */
|
|
16620
|
+
return /* @__PURE__ */ jsx105(DynamicInfo, { component }, getKey(component));
|
|
16565
16621
|
case "instructions":
|
|
16566
|
-
return /* @__PURE__ */
|
|
16622
|
+
return /* @__PURE__ */ jsx105(DynamicInstructions_default, { component }, getKey(component));
|
|
16567
16623
|
case "markdown":
|
|
16568
|
-
return /* @__PURE__ */
|
|
16624
|
+
return /* @__PURE__ */ jsx105(DynamicMarkdown, { component }, getKey(component));
|
|
16569
16625
|
case "columns":
|
|
16570
|
-
return /* @__PURE__ */
|
|
16626
|
+
return /* @__PURE__ */ jsx105(
|
|
16571
16627
|
DynamicColumns_default,
|
|
16572
16628
|
{
|
|
16573
16629
|
component,
|
|
@@ -16581,7 +16637,7 @@ function DynamicLayout(props) {
|
|
|
16581
16637
|
getKey(component)
|
|
16582
16638
|
);
|
|
16583
16639
|
case "form":
|
|
16584
|
-
return /* @__PURE__ */
|
|
16640
|
+
return /* @__PURE__ */ jsx105(
|
|
16585
16641
|
DynamicForm_default,
|
|
16586
16642
|
{
|
|
16587
16643
|
component,
|
|
@@ -16594,9 +16650,9 @@ function DynamicLayout(props) {
|
|
|
16594
16650
|
getKey(__spreadProps(__spreadValues({}, component), { errors: errors != null ? errors : null }))
|
|
16595
16651
|
);
|
|
16596
16652
|
case "button":
|
|
16597
|
-
return /* @__PURE__ */
|
|
16653
|
+
return /* @__PURE__ */ jsx105(DynamicButton_default, { component, onAction }, getKey(component));
|
|
16598
16654
|
case "box":
|
|
16599
|
-
return /* @__PURE__ */
|
|
16655
|
+
return /* @__PURE__ */ jsx105(
|
|
16600
16656
|
DynamicBox_default,
|
|
16601
16657
|
{
|
|
16602
16658
|
component,
|
|
@@ -16610,18 +16666,18 @@ function DynamicLayout(props) {
|
|
|
16610
16666
|
getKey(component)
|
|
16611
16667
|
);
|
|
16612
16668
|
case "decision":
|
|
16613
|
-
return /* @__PURE__ */
|
|
16669
|
+
return /* @__PURE__ */ jsx105(DynamicDecision_default, { component, onAction }, getKey(component));
|
|
16614
16670
|
case "external":
|
|
16615
|
-
return /* @__PURE__ */
|
|
16671
|
+
return /* @__PURE__ */ jsx105(DynamicExternal_default, { component, onAction }, getKey(component));
|
|
16616
16672
|
case "list":
|
|
16617
16673
|
case "status-list":
|
|
16618
|
-
return /* @__PURE__ */
|
|
16674
|
+
return /* @__PURE__ */ jsx105(DynamicStatusList_default, { component, onAction }, getKey(component));
|
|
16619
16675
|
case "loading-indicator":
|
|
16620
|
-
return /* @__PURE__ */
|
|
16676
|
+
return /* @__PURE__ */ jsx105(DynamicLoadingIndicator_default, { component }, getKey(component));
|
|
16621
16677
|
case "search":
|
|
16622
|
-
return /* @__PURE__ */
|
|
16678
|
+
return /* @__PURE__ */ jsx105(DynamicSearch_default, { component, onAction }, getKey(component));
|
|
16623
16679
|
case "modal":
|
|
16624
|
-
return /* @__PURE__ */
|
|
16680
|
+
return /* @__PURE__ */ jsx105(
|
|
16625
16681
|
DynamicModal_default,
|
|
16626
16682
|
{
|
|
16627
16683
|
component,
|
|
@@ -16635,22 +16691,22 @@ function DynamicLayout(props) {
|
|
|
16635
16691
|
getKey(component)
|
|
16636
16692
|
);
|
|
16637
16693
|
default:
|
|
16638
|
-
return /* @__PURE__ */
|
|
16694
|
+
return /* @__PURE__ */ jsx105("div", {}, getKey(component));
|
|
16639
16695
|
}
|
|
16640
16696
|
};
|
|
16641
16697
|
if (useHasHttpClientProvider() || baseUrl == null) {
|
|
16642
|
-
return /* @__PURE__ */
|
|
16698
|
+
return /* @__PURE__ */ jsx105(Fragment20, { children: components.map(renderComponent) });
|
|
16643
16699
|
}
|
|
16644
|
-
return /* @__PURE__ */
|
|
16700
|
+
return /* @__PURE__ */ jsx105(HttpClientProviderFromBaseUrl, { baseUrl, children: components.map(renderComponent) });
|
|
16645
16701
|
}
|
|
16646
16702
|
var DynamicLayout_default = DynamicLayout;
|
|
16647
16703
|
|
|
16648
16704
|
// src/legacy/layout/list/DynamicStatusList.tsx
|
|
16649
16705
|
import { Header as Header11, Summary as Summary2 } from "@transferwise/components";
|
|
16650
|
-
import { jsx as
|
|
16706
|
+
import { jsx as jsx106, jsxs as jsxs38 } from "react/jsx-runtime";
|
|
16651
16707
|
var DynamicStatusList = ({ component }) => {
|
|
16652
|
-
return /* @__PURE__ */
|
|
16653
|
-
component.title ? /* @__PURE__ */
|
|
16708
|
+
return /* @__PURE__ */ jsxs38("div", { className: getMargin2(component.margin || "md"), children: [
|
|
16709
|
+
component.title ? /* @__PURE__ */ jsx106(Header11, { title: component.title }) : null,
|
|
16654
16710
|
component.items.map(mapListItemToSummary)
|
|
16655
16711
|
] });
|
|
16656
16712
|
};
|
|
@@ -16659,8 +16715,8 @@ var mapListItemToSummary = ({ title, description, icon, status }) => {
|
|
|
16659
16715
|
key: `${title}/${description || ""}`,
|
|
16660
16716
|
title,
|
|
16661
16717
|
description
|
|
16662
|
-
}, (icon == null ? void 0 : icon.name) ? { icon: /* @__PURE__ */
|
|
16663
|
-
return /* @__PURE__ */
|
|
16718
|
+
}, (icon == null ? void 0 : icon.name) ? { icon: /* @__PURE__ */ jsx106(DynamicIcon_default2, { type: icon.name }) } : {}), status ? { status: statusMap[status] } : {});
|
|
16719
|
+
return /* @__PURE__ */ jsx106(Summary2, __spreadValues({}, props));
|
|
16664
16720
|
};
|
|
16665
16721
|
var statusListMap = {
|
|
16666
16722
|
done: "done",
|
|
@@ -16677,10 +16733,10 @@ var DynamicStatusList_default = DynamicStatusList;
|
|
|
16677
16733
|
|
|
16678
16734
|
// src/legacy/layout/loadingIndicator/DynamicLoadingIndicator.tsx
|
|
16679
16735
|
import { Loader as Loader3 } from "@transferwise/components";
|
|
16680
|
-
import { jsx as
|
|
16736
|
+
import { jsx as jsx107 } from "react/jsx-runtime";
|
|
16681
16737
|
var DynamicLoadingIndicator = ({ component }) => {
|
|
16682
16738
|
const { margin = "md", size = "md" } = component;
|
|
16683
|
-
return /* @__PURE__ */
|
|
16739
|
+
return /* @__PURE__ */ jsx107(
|
|
16684
16740
|
Loader3,
|
|
16685
16741
|
{
|
|
16686
16742
|
size,
|
|
@@ -16708,12 +16764,12 @@ function noop3() {
|
|
|
16708
16764
|
}
|
|
16709
16765
|
|
|
16710
16766
|
// src/legacy/layout/paragraph/DynamicParagraph.tsx
|
|
16711
|
-
import { jsx as
|
|
16767
|
+
import { jsx as jsx108, jsxs as jsxs39 } from "react/jsx-runtime";
|
|
16712
16768
|
function DynamicParagraph({ component }) {
|
|
16713
|
-
return component.control === "copyable" ? /* @__PURE__ */
|
|
16769
|
+
return component.control === "copyable" ? /* @__PURE__ */ jsx108(CopyableDynamicParagraph, { component }) : /* @__PURE__ */ jsx108(BasicDynamicParagraph, { component });
|
|
16714
16770
|
}
|
|
16715
16771
|
function BasicDynamicParagraph({ component }) {
|
|
16716
|
-
return /* @__PURE__ */
|
|
16772
|
+
return /* @__PURE__ */ jsxs39("p", { className: getTextAlignmentAndMargin2(component), children: [
|
|
16717
16773
|
" ",
|
|
16718
16774
|
component.text,
|
|
16719
16775
|
" "
|
|
@@ -16731,8 +16787,8 @@ function CopyableDynamicParagraph({ component }) {
|
|
|
16731
16787
|
align: component.align,
|
|
16732
16788
|
margin: "sm"
|
|
16733
16789
|
})} form-control`;
|
|
16734
|
-
return /* @__PURE__ */
|
|
16735
|
-
/* @__PURE__ */
|
|
16790
|
+
return /* @__PURE__ */ jsxs39("div", { className: getTextAlignmentAndMargin2(component), children: [
|
|
16791
|
+
/* @__PURE__ */ jsx108(
|
|
16736
16792
|
"input",
|
|
16737
16793
|
{
|
|
16738
16794
|
type: "text",
|
|
@@ -16742,7 +16798,7 @@ function CopyableDynamicParagraph({ component }) {
|
|
|
16742
16798
|
style: { textOverflow: "ellipsis" }
|
|
16743
16799
|
}
|
|
16744
16800
|
),
|
|
16745
|
-
/* @__PURE__ */
|
|
16801
|
+
/* @__PURE__ */ jsx108(Button8, { block: true, onClick: copy, children: formatMessage(paragraph_messages_default.copy) })
|
|
16746
16802
|
] });
|
|
16747
16803
|
}
|
|
16748
16804
|
function noop4() {
|
|
@@ -16751,7 +16807,7 @@ var DynamicParagraph_default = DynamicParagraph;
|
|
|
16751
16807
|
|
|
16752
16808
|
// src/legacy/layout/review/DynamicReview.tsx
|
|
16753
16809
|
import { DefinitionList as DefinitionList3, Header as Header12 } from "@transferwise/components";
|
|
16754
|
-
import { Fragment as
|
|
16810
|
+
import { Fragment as Fragment21, jsx as jsx109, jsxs as jsxs40 } from "react/jsx-runtime";
|
|
16755
16811
|
var getDefinitions = (orientation, review) => review.fields.map(({ label, value, help }, index) => ({
|
|
16756
16812
|
key: String(index),
|
|
16757
16813
|
title: label,
|
|
@@ -16759,14 +16815,14 @@ var getDefinitions = (orientation, review) => review.fields.map(({ label, value,
|
|
|
16759
16815
|
}));
|
|
16760
16816
|
var getFieldValue2 = (value, help, orientation) => {
|
|
16761
16817
|
if (help) {
|
|
16762
|
-
return orientation === "HORIZONTAL_RIGHT_ALIGNED" ? /* @__PURE__ */
|
|
16763
|
-
/* @__PURE__ */
|
|
16818
|
+
return orientation === "HORIZONTAL_RIGHT_ALIGNED" ? /* @__PURE__ */ jsxs40(Fragment21, { children: [
|
|
16819
|
+
/* @__PURE__ */ jsx109(Help_default2, { help }),
|
|
16764
16820
|
" ",
|
|
16765
16821
|
value
|
|
16766
|
-
] }) : /* @__PURE__ */
|
|
16822
|
+
] }) : /* @__PURE__ */ jsxs40(Fragment21, { children: [
|
|
16767
16823
|
value,
|
|
16768
16824
|
" ",
|
|
16769
|
-
/* @__PURE__ */
|
|
16825
|
+
/* @__PURE__ */ jsx109(Help_default2, { help })
|
|
16770
16826
|
] });
|
|
16771
16827
|
}
|
|
16772
16828
|
return value;
|
|
@@ -16791,9 +16847,9 @@ function DynamicReview(props) {
|
|
|
16791
16847
|
const orientation = getReviewLayout(review);
|
|
16792
16848
|
const callToAction = review.callToAction ? getReviewAction2(review.callToAction.title, review.callToAction.action) : null;
|
|
16793
16849
|
const legacyCallToAction = !callToAction && review.action ? getReviewAction2(review.action.title || "", review.action) : null;
|
|
16794
|
-
return /* @__PURE__ */
|
|
16795
|
-
review.title && /* @__PURE__ */
|
|
16796
|
-
/* @__PURE__ */
|
|
16850
|
+
return /* @__PURE__ */ jsxs40("div", { className: margin, children: [
|
|
16851
|
+
review.title && /* @__PURE__ */ jsx109(Header12, { title: review.title, action: callToAction || legacyCallToAction || void 0 }),
|
|
16852
|
+
/* @__PURE__ */ jsx109("div", { className: margin, children: /* @__PURE__ */ jsx109(DefinitionList3, { layout: orientation, definitions: getDefinitions(orientation, review) }) })
|
|
16797
16853
|
] });
|
|
16798
16854
|
}
|
|
16799
16855
|
var DynamicReview_default = DynamicReview;
|
|
@@ -16804,11 +16860,11 @@ import { Search as Search2 } from "@transferwise/icons";
|
|
|
16804
16860
|
|
|
16805
16861
|
// src/legacy/layout/search/SearchInput.tsx
|
|
16806
16862
|
import { Input as Input7 } from "@transferwise/components";
|
|
16807
|
-
import { jsx as
|
|
16863
|
+
import { jsx as jsx110, jsxs as jsxs41 } from "react/jsx-runtime";
|
|
16808
16864
|
var SearchInput = ({ title, value, onFocus, onChange }) => {
|
|
16809
|
-
return /* @__PURE__ */
|
|
16865
|
+
return /* @__PURE__ */ jsxs41("label", { className: "control-label d-inline", children: [
|
|
16810
16866
|
title,
|
|
16811
|
-
/* @__PURE__ */
|
|
16867
|
+
/* @__PURE__ */ jsx110(
|
|
16812
16868
|
Input7,
|
|
16813
16869
|
{
|
|
16814
16870
|
type: "text",
|
|
@@ -16824,12 +16880,12 @@ var SearchInput = ({ title, value, onFocus, onChange }) => {
|
|
|
16824
16880
|
// src/legacy/layout/search/SearchResults.tsx
|
|
16825
16881
|
import { NavigationOption as NavigationOption7, NavigationOptionsList as NavigationOptionsList4 } from "@transferwise/components";
|
|
16826
16882
|
import { useIntl as useIntl17 } from "react-intl";
|
|
16827
|
-
import { jsx as
|
|
16883
|
+
import { jsx as jsx111, jsxs as jsxs42 } from "react/jsx-runtime";
|
|
16828
16884
|
function SearchResults2({ results, emptyMessage, onSelect }) {
|
|
16829
16885
|
if (results.length === 0) {
|
|
16830
|
-
return /* @__PURE__ */
|
|
16886
|
+
return /* @__PURE__ */ jsx111("p", { className: "m-t-2", children: emptyMessage });
|
|
16831
16887
|
}
|
|
16832
|
-
return /* @__PURE__ */
|
|
16888
|
+
return /* @__PURE__ */ jsx111(NavigationOptionsList4, { children: results.map((result) => /* @__PURE__ */ jsx111(
|
|
16833
16889
|
NavigationOption7,
|
|
16834
16890
|
{
|
|
16835
16891
|
title: result.title,
|
|
@@ -16844,10 +16900,10 @@ function SearchResults2({ results, emptyMessage, onSelect }) {
|
|
|
16844
16900
|
}
|
|
16845
16901
|
function ErrorResult2({ onRetrySearch }) {
|
|
16846
16902
|
const intl = useIntl17();
|
|
16847
|
-
return /* @__PURE__ */
|
|
16903
|
+
return /* @__PURE__ */ jsxs42("p", { className: "m-t-2", children: [
|
|
16848
16904
|
intl.formatMessage(generic_error_messages_default.genericError),
|
|
16849
16905
|
"\xA0",
|
|
16850
|
-
/* @__PURE__ */
|
|
16906
|
+
/* @__PURE__ */ jsx111(
|
|
16851
16907
|
"a",
|
|
16852
16908
|
{
|
|
16853
16909
|
href: "/",
|
|
@@ -16933,7 +16989,7 @@ var addQueryParameter2 = (url, key, value) => {
|
|
|
16933
16989
|
// src/legacy/layout/search/DynamicSearch.tsx
|
|
16934
16990
|
var import_classnames15 = __toESM(require_classnames());
|
|
16935
16991
|
import { Markdown as Markdown8, Typeahead as Typeahead2 } from "@transferwise/components";
|
|
16936
|
-
import { jsx as
|
|
16992
|
+
import { jsx as jsx112, jsxs as jsxs43 } from "react/jsx-runtime";
|
|
16937
16993
|
var DEBOUNCE_TIME2 = 400;
|
|
16938
16994
|
function DynamicSearch({ component, onAction }) {
|
|
16939
16995
|
const [query, setQuery] = useState24("");
|
|
@@ -16969,16 +17025,16 @@ function DynamicSearch({ component, onAction }) {
|
|
|
16969
17025
|
void search(query);
|
|
16970
17026
|
};
|
|
16971
17027
|
if (control === "inline") {
|
|
16972
|
-
return /* @__PURE__ */
|
|
17028
|
+
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: [
|
|
16973
17029
|
title,
|
|
16974
|
-
/* @__PURE__ */
|
|
17030
|
+
/* @__PURE__ */ jsx112("div", { className: "m-t-1", children: /* @__PURE__ */ jsx112(
|
|
16975
17031
|
Typeahead2,
|
|
16976
17032
|
{
|
|
16977
17033
|
id: "typeahead-input-id",
|
|
16978
17034
|
name: "typeahead-input-name",
|
|
16979
17035
|
size: "md",
|
|
16980
17036
|
maxHeight: 100,
|
|
16981
|
-
footer: /* @__PURE__ */
|
|
17037
|
+
footer: /* @__PURE__ */ jsx112(
|
|
16982
17038
|
TypeaheadFooter2,
|
|
16983
17039
|
{
|
|
16984
17040
|
state: status,
|
|
@@ -16989,7 +17045,7 @@ function DynamicSearch({ component, onAction }) {
|
|
|
16989
17045
|
),
|
|
16990
17046
|
multiple: false,
|
|
16991
17047
|
clearable: false,
|
|
16992
|
-
addon: /* @__PURE__ */
|
|
17048
|
+
addon: /* @__PURE__ */ jsx112(Search2, { size: 24 }),
|
|
16993
17049
|
options: results.map(mapResultToTypeaheadOption2),
|
|
16994
17050
|
onChange: (values) => {
|
|
16995
17051
|
if (values.length > 0) {
|
|
@@ -17004,11 +17060,11 @@ function DynamicSearch({ component, onAction }) {
|
|
|
17004
17060
|
) })
|
|
17005
17061
|
] }) });
|
|
17006
17062
|
}
|
|
17007
|
-
return /* @__PURE__ */
|
|
17008
|
-
/* @__PURE__ */
|
|
17009
|
-
status === "loading" && /* @__PURE__ */
|
|
17010
|
-
status === "error" && /* @__PURE__ */
|
|
17011
|
-
status === "success" && /* @__PURE__ */
|
|
17063
|
+
return /* @__PURE__ */ jsxs43("div", { className: getMargin2(margin != null ? margin : "md"), children: [
|
|
17064
|
+
/* @__PURE__ */ jsx112(SearchInput, { title, value: query, onChange, onFocus: onSearchStart }),
|
|
17065
|
+
status === "loading" && /* @__PURE__ */ jsx112(DynamicLoadingIndicator_default, { component: { type: "loading-indicator", size: "sm" } }),
|
|
17066
|
+
status === "error" && /* @__PURE__ */ jsx112(ErrorResult2, { onRetrySearch }),
|
|
17067
|
+
status === "success" && /* @__PURE__ */ jsx112(SearchResults2, { results, emptyMessage, onSelect: onResultSelected })
|
|
17012
17068
|
] });
|
|
17013
17069
|
}
|
|
17014
17070
|
function mapResultToTypeaheadOption2(result) {
|
|
@@ -17027,13 +17083,13 @@ function TypeaheadFooter2({
|
|
|
17027
17083
|
emptyMessage
|
|
17028
17084
|
}) {
|
|
17029
17085
|
if (state === "success" && results.length === 0) {
|
|
17030
|
-
return /* @__PURE__ */
|
|
17086
|
+
return /* @__PURE__ */ jsx112(Markdown8, { className: "m-t-2 m-x-2", config: { link: { target: "_blank" } }, children: emptyMessage });
|
|
17031
17087
|
}
|
|
17032
17088
|
if (state === "error" && results.length === 0) {
|
|
17033
|
-
return /* @__PURE__ */
|
|
17089
|
+
return /* @__PURE__ */ jsx112("div", { className: "m-t-2 m-x-2", children: /* @__PURE__ */ jsx112(ErrorResult2, { onRetrySearch }) });
|
|
17034
17090
|
}
|
|
17035
17091
|
if (state === "loading" || results.length === 0) {
|
|
17036
|
-
return /* @__PURE__ */
|
|
17092
|
+
return /* @__PURE__ */ jsx112("p", { className: "m-t-2 m-x-2", children: "Loading..." });
|
|
17037
17093
|
}
|
|
17038
17094
|
return null;
|
|
17039
17095
|
}
|
|
@@ -17042,20 +17098,20 @@ var DynamicSearch_default = DynamicSearch;
|
|
|
17042
17098
|
// src/legacy/layout/modal/DynamicModal.tsx
|
|
17043
17099
|
import { Button as Button9, Modal as Modal4 } from "@transferwise/components";
|
|
17044
17100
|
import { useState as useState25 } from "react";
|
|
17045
|
-
import { jsx as
|
|
17101
|
+
import { jsx as jsx113, jsxs as jsxs44 } from "react/jsx-runtime";
|
|
17046
17102
|
function DynamicModal(props) {
|
|
17047
17103
|
const [visible, isVisible] = useState25(false);
|
|
17048
17104
|
const { component, onAction } = props;
|
|
17049
17105
|
const { margin = "md" } = component;
|
|
17050
|
-
return /* @__PURE__ */
|
|
17051
|
-
/* @__PURE__ */
|
|
17052
|
-
/* @__PURE__ */
|
|
17106
|
+
return /* @__PURE__ */ jsxs44("div", { className: getTextAlignmentAndMargin2({ margin }), children: [
|
|
17107
|
+
/* @__PURE__ */ jsx113(Button9, { priority: "tertiary", block: true, onClick: () => isVisible(true), children: component.trigger.title }),
|
|
17108
|
+
/* @__PURE__ */ jsx113(
|
|
17053
17109
|
Modal4,
|
|
17054
17110
|
{
|
|
17055
17111
|
scroll: "content",
|
|
17056
17112
|
open: visible,
|
|
17057
17113
|
size: "lg",
|
|
17058
|
-
body: /* @__PURE__ */
|
|
17114
|
+
body: /* @__PURE__ */ jsx113(
|
|
17059
17115
|
DynamicLayout_default,
|
|
17060
17116
|
__spreadProps(__spreadValues({}, props), {
|
|
17061
17117
|
components: component.content.components,
|
|
@@ -17073,7 +17129,7 @@ function DynamicModal(props) {
|
|
|
17073
17129
|
var DynamicModal_default = DynamicModal;
|
|
17074
17130
|
|
|
17075
17131
|
// src/legacy/jsonSchemaForm/basicTypeSchema/BasicTypeSchema.tsx
|
|
17076
|
-
import { Fragment as
|
|
17132
|
+
import { Fragment as Fragment22, jsx as jsx114, jsxs as jsxs45 } from "react/jsx-runtime";
|
|
17077
17133
|
var isNullish3 = (value) => isNull3(value) || isUndefined3(value);
|
|
17078
17134
|
var getDefaultValue = (schema) => {
|
|
17079
17135
|
return schema.type === "boolean" && isNullish3(schema.default) ? false : schema.default;
|
|
@@ -17132,9 +17188,9 @@ var BasicTypeSchema = (props) => {
|
|
|
17132
17188
|
};
|
|
17133
17189
|
const isConst = props.schema.const;
|
|
17134
17190
|
const isHidden = props.schema.hidden || isConst;
|
|
17135
|
-
|
|
17136
|
-
|
|
17137
|
-
|
|
17191
|
+
useEffect17(refreshValidations, [props.model, props.submitted]);
|
|
17192
|
+
useEffect17(onSchemaChange, [props.schema]);
|
|
17193
|
+
useEffect17(() => {
|
|
17138
17194
|
var _a2;
|
|
17139
17195
|
const newModel = (_a2 = props.model) != null ? _a2 : null;
|
|
17140
17196
|
if (newModel !== model) {
|
|
@@ -17149,15 +17205,15 @@ var BasicTypeSchema = (props) => {
|
|
|
17149
17205
|
const showLabel = props.schema.format !== "file" && props.schema.type !== "boolean";
|
|
17150
17206
|
const schemaHelp = props.schema.help;
|
|
17151
17207
|
const feedbackId = `${id}-feedback`;
|
|
17152
|
-
return !isHidden ? /* @__PURE__ */
|
|
17153
|
-
props.schema.alert && /* @__PURE__ */
|
|
17154
|
-
/* @__PURE__ */
|
|
17155
|
-
showLabel && /* @__PURE__ */
|
|
17156
|
-
/* @__PURE__ */
|
|
17157
|
-
!!schemaHelp && /* @__PURE__ */
|
|
17208
|
+
return !isHidden ? /* @__PURE__ */ jsxs45(Fragment22, { children: [
|
|
17209
|
+
props.schema.alert && /* @__PURE__ */ jsx114(DynamicAlert_default, { component: props.schema.alert }),
|
|
17210
|
+
/* @__PURE__ */ jsxs45("div", { className: (0, import_classnames16.default)(formGroupClasses), children: [
|
|
17211
|
+
showLabel && /* @__PURE__ */ jsxs45("div", { className: "d-inline-block m-b-1", children: [
|
|
17212
|
+
/* @__PURE__ */ jsx114("label", { className: "control-label d-inline", htmlFor: id, children: props.schema.title }),
|
|
17213
|
+
!!schemaHelp && /* @__PURE__ */ jsx114(Help_default2, { help: schemaHelp })
|
|
17158
17214
|
] }),
|
|
17159
|
-
!showLabel && !!schemaHelp && /* @__PURE__ */
|
|
17160
|
-
/* @__PURE__ */
|
|
17215
|
+
!showLabel && !!schemaHelp && /* @__PURE__ */ jsx114(Help_default2, { help: schemaHelp }),
|
|
17216
|
+
/* @__PURE__ */ jsx114(
|
|
17161
17217
|
SchemaFormControl_default,
|
|
17162
17218
|
{
|
|
17163
17219
|
id,
|
|
@@ -17170,7 +17226,7 @@ var BasicTypeSchema = (props) => {
|
|
|
17170
17226
|
describedBy: feedbackId
|
|
17171
17227
|
}
|
|
17172
17228
|
),
|
|
17173
|
-
/* @__PURE__ */
|
|
17229
|
+
/* @__PURE__ */ jsx114(
|
|
17174
17230
|
ControlFeedback_default,
|
|
17175
17231
|
{
|
|
17176
17232
|
id: feedbackId,
|
|
@@ -17195,7 +17251,7 @@ BasicTypeSchema.defaultProps = {
|
|
|
17195
17251
|
var BasicTypeSchema_default = BasicTypeSchema;
|
|
17196
17252
|
|
|
17197
17253
|
// src/legacy/jsonSchemaForm/persistAsyncSchema/persistAsyncBasicSchema/PersistAsyncBasicSchema.tsx
|
|
17198
|
-
import { jsx as
|
|
17254
|
+
import { jsx as jsx115 } from "react/jsx-runtime";
|
|
17199
17255
|
var getIdFromResponse = (idProperty, response) => response[idProperty];
|
|
17200
17256
|
var getErrorFromResponse = (errorProperty, response) => {
|
|
17201
17257
|
var _a;
|
|
@@ -17218,7 +17274,7 @@ function PersistAsyncBasicSchema(props) {
|
|
|
17218
17274
|
const [persistAsyncError, setPersistAsyncError] = useState27(null);
|
|
17219
17275
|
const [fieldSubmitted, setFieldSubmitted] = useState27(false);
|
|
17220
17276
|
const [abortController, setAbortController] = useState27(null);
|
|
17221
|
-
|
|
17277
|
+
useEffect18(() => {
|
|
17222
17278
|
if (controlTypesWithPersistOnChange.has(
|
|
17223
17279
|
// TODO: LOW avoid type assertion below -- control type may be nullish. consider ?? ''
|
|
17224
17280
|
getControlType(schema.persistAsync.schema)
|
|
@@ -17285,7 +17341,7 @@ function PersistAsyncBasicSchema(props) {
|
|
|
17285
17341
|
setPersistAsyncModel(newPersistAsyncModel);
|
|
17286
17342
|
}
|
|
17287
17343
|
};
|
|
17288
|
-
return /* @__PURE__ */
|
|
17344
|
+
return /* @__PURE__ */ jsx115(
|
|
17289
17345
|
BasicTypeSchema_default,
|
|
17290
17346
|
{
|
|
17291
17347
|
required,
|
|
@@ -17385,7 +17441,7 @@ function hasStringMessage(value) {
|
|
|
17385
17441
|
}
|
|
17386
17442
|
|
|
17387
17443
|
// src/legacy/common/hooks/usePolling/usePolling.tsx
|
|
17388
|
-
import { useEffect as
|
|
17444
|
+
import { useEffect as useEffect19, useMemo as useMemo18, useRef as useRef5 } from "react";
|
|
17389
17445
|
function usePolling({
|
|
17390
17446
|
asyncFn,
|
|
17391
17447
|
interval,
|
|
@@ -17406,7 +17462,7 @@ function usePolling({
|
|
|
17406
17462
|
),
|
|
17407
17463
|
[asyncFn, maxAttempts, maxConsecutiveFails]
|
|
17408
17464
|
);
|
|
17409
|
-
|
|
17465
|
+
useEffect19(() => {
|
|
17410
17466
|
if (interval > 0) {
|
|
17411
17467
|
const intervalReference = setInterval(() => {
|
|
17412
17468
|
poll();
|
|
@@ -17414,7 +17470,7 @@ function usePolling({
|
|
|
17414
17470
|
return () => clearInterval(intervalReference);
|
|
17415
17471
|
}
|
|
17416
17472
|
}, [poll, interval]);
|
|
17417
|
-
|
|
17473
|
+
useEffect19(() => {
|
|
17418
17474
|
onPollingResponseReference.current = onPollingResponse;
|
|
17419
17475
|
onFailureReference.current = onFailure;
|
|
17420
17476
|
}, [onPollingResponse, onFailure]);
|
|
@@ -17445,10 +17501,10 @@ function createPollingClosure(asyncFn, maxAttempts, maxConsecutiveFails, onPolli
|
|
|
17445
17501
|
}
|
|
17446
17502
|
|
|
17447
17503
|
// src/legacy/common/hooks/usePrevious/usePrevious.js
|
|
17448
|
-
import { useEffect as
|
|
17504
|
+
import { useEffect as useEffect20, useRef as useRef6 } from "react";
|
|
17449
17505
|
var usePrevious = (value) => {
|
|
17450
17506
|
const reference = useRef6();
|
|
17451
|
-
|
|
17507
|
+
useEffect20(() => {
|
|
17452
17508
|
reference.current = value;
|
|
17453
17509
|
}, [value]);
|
|
17454
17510
|
return reference.current;
|
|
@@ -17496,7 +17552,7 @@ function useStepPolling(polling, onAction) {
|
|
|
17496
17552
|
}
|
|
17497
17553
|
|
|
17498
17554
|
// src/legacy/step/layoutStep/LayoutStep.tsx
|
|
17499
|
-
import { jsx as
|
|
17555
|
+
import { jsx as jsx116 } from "react/jsx-runtime";
|
|
17500
17556
|
var getComponents = (step, options) => {
|
|
17501
17557
|
var _a;
|
|
17502
17558
|
if (isEmpty(step)) {
|
|
@@ -17519,7 +17575,7 @@ var LayoutStep = (props) => {
|
|
|
17519
17575
|
onEvent("Dynamic Flow - onAction supressed", { reason: "LayoutStep - loading state" });
|
|
17520
17576
|
};
|
|
17521
17577
|
useStepPolling(stepSpecification.polling, onAction);
|
|
17522
|
-
return /* @__PURE__ */
|
|
17578
|
+
return /* @__PURE__ */ jsx116(
|
|
17523
17579
|
DynamicLayout_default,
|
|
17524
17580
|
{
|
|
17525
17581
|
components,
|
|
@@ -17535,10 +17591,10 @@ var LayoutStep = (props) => {
|
|
|
17535
17591
|
var LayoutStep_default = LayoutStep;
|
|
17536
17592
|
|
|
17537
17593
|
// src/legacy/step/cameraStep/CameraStep.tsx
|
|
17538
|
-
import { useEffect as
|
|
17594
|
+
import { useEffect as useEffect25, useState as useState31 } from "react";
|
|
17539
17595
|
|
|
17540
17596
|
// src/legacy/step/cameraStep/cameraCapture/CameraCapture.tsx
|
|
17541
|
-
import { useCallback as useCallback10, useEffect as
|
|
17597
|
+
import { useCallback as useCallback10, useEffect as useEffect24, useMemo as useMemo20, useRef as useRef8, useState as useState30 } from "react";
|
|
17542
17598
|
import { useIntl as useIntl22 } from "react-intl";
|
|
17543
17599
|
import Webcam from "react-webcam";
|
|
17544
17600
|
|
|
@@ -17605,15 +17661,15 @@ var CameraCapture_messages_default = defineMessages13({
|
|
|
17605
17661
|
// src/legacy/step/cameraStep/cameraCapture/components/bottomBar/BottomBar.tsx
|
|
17606
17662
|
import { Button as Button10, ControlType, Priority, Size as Size3 } from "@transferwise/components";
|
|
17607
17663
|
import { useIntl as useIntl20 } from "react-intl";
|
|
17608
|
-
import { jsx as
|
|
17609
|
-
var CaptureBottomBar = ({ onCapture }) => /* @__PURE__ */
|
|
17664
|
+
import { jsx as jsx117, jsxs as jsxs46 } from "react/jsx-runtime";
|
|
17665
|
+
var CaptureBottomBar = ({ onCapture }) => /* @__PURE__ */ jsx117("div", { className: "bottom-bar", children: /* @__PURE__ */ jsx117(CaptureButton, { onClick: onCapture }) });
|
|
17610
17666
|
var ReviewBottomBar = ({
|
|
17611
17667
|
onSubmit,
|
|
17612
17668
|
onRetry
|
|
17613
17669
|
}) => {
|
|
17614
17670
|
const intl = useIntl20();
|
|
17615
|
-
return /* @__PURE__ */
|
|
17616
|
-
/* @__PURE__ */
|
|
17671
|
+
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: [
|
|
17672
|
+
/* @__PURE__ */ jsx117(
|
|
17617
17673
|
Button10,
|
|
17618
17674
|
{
|
|
17619
17675
|
className: "m-b-1",
|
|
@@ -17624,7 +17680,7 @@ var ReviewBottomBar = ({
|
|
|
17624
17680
|
children: intl.formatMessage(CameraCapture_messages_default.reviewSubmit)
|
|
17625
17681
|
}
|
|
17626
17682
|
),
|
|
17627
|
-
/* @__PURE__ */
|
|
17683
|
+
/* @__PURE__ */ jsx117(
|
|
17628
17684
|
Button10,
|
|
17629
17685
|
{
|
|
17630
17686
|
className: "m-b-2",
|
|
@@ -17638,14 +17694,14 @@ var ReviewBottomBar = ({
|
|
|
17638
17694
|
)
|
|
17639
17695
|
] }) }) });
|
|
17640
17696
|
};
|
|
17641
|
-
var CaptureButton = ({ onClick }) => /* @__PURE__ */
|
|
17697
|
+
var CaptureButton = ({ onClick }) => /* @__PURE__ */ jsx117(
|
|
17642
17698
|
"button",
|
|
17643
17699
|
{
|
|
17644
17700
|
type: "button",
|
|
17645
17701
|
className: "camera-capture-btn m-b-2",
|
|
17646
17702
|
"data-testid": "camera-capture-button",
|
|
17647
17703
|
onClick,
|
|
17648
|
-
children: /* @__PURE__ */
|
|
17704
|
+
children: /* @__PURE__ */ jsx117("span", { className: "camera-capture-btn-inner" })
|
|
17649
17705
|
}
|
|
17650
17706
|
);
|
|
17651
17707
|
|
|
@@ -17663,11 +17719,11 @@ var OrientationLockOverlay_messages_default = defineMessages14({
|
|
|
17663
17719
|
});
|
|
17664
17720
|
|
|
17665
17721
|
// src/legacy/step/cameraStep/cameraCapture/components/orientationLockOverlay/OrientationLockOverlay.tsx
|
|
17666
|
-
import { jsx as
|
|
17722
|
+
import { jsx as jsx118, jsxs as jsxs47 } from "react/jsx-runtime";
|
|
17667
17723
|
function OrientationLockOverlay() {
|
|
17668
17724
|
const intl = useIntl21();
|
|
17669
|
-
return /* @__PURE__ */
|
|
17670
|
-
/* @__PURE__ */
|
|
17725
|
+
return /* @__PURE__ */ jsxs47("div", { className: "orientation-lock-overlay", children: [
|
|
17726
|
+
/* @__PURE__ */ jsx118(
|
|
17671
17727
|
"img",
|
|
17672
17728
|
{
|
|
17673
17729
|
className: "m-b-3",
|
|
@@ -17677,26 +17733,26 @@ function OrientationLockOverlay() {
|
|
|
17677
17733
|
alt: ""
|
|
17678
17734
|
}
|
|
17679
17735
|
),
|
|
17680
|
-
/* @__PURE__ */
|
|
17736
|
+
/* @__PURE__ */ jsx118("p", { className: "text-center m-b-0", children: intl.formatMessage(OrientationLockOverlay_messages_default.text) })
|
|
17681
17737
|
] });
|
|
17682
17738
|
}
|
|
17683
17739
|
var OrientationLockOverlay_default = OrientationLockOverlay;
|
|
17684
17740
|
|
|
17685
17741
|
// src/legacy/step/cameraStep/cameraCapture/screens/cameraErrorScreen/CameraErrorScreen.tsx
|
|
17686
17742
|
import { Button as Button11 } from "@transferwise/components";
|
|
17687
|
-
import { jsx as
|
|
17743
|
+
import { jsx as jsx119, jsxs as jsxs48 } from "react/jsx-runtime";
|
|
17688
17744
|
function CameraErrorScreen({ title, description, actionButton, onAction }) {
|
|
17689
|
-
return /* @__PURE__ */
|
|
17690
|
-
/* @__PURE__ */
|
|
17691
|
-
/* @__PURE__ */
|
|
17692
|
-
onAction && actionButton && /* @__PURE__ */
|
|
17745
|
+
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: [
|
|
17746
|
+
/* @__PURE__ */ jsx119("h2", { className: "text-xs-center m-b-3", children: title }),
|
|
17747
|
+
/* @__PURE__ */ jsx119("p", { className: "text-xs-center m-b-5", children: description }),
|
|
17748
|
+
onAction && actionButton && /* @__PURE__ */ jsx119(Button11, { block: true, onClick: onAction, children: actionButton })
|
|
17693
17749
|
] }) }) });
|
|
17694
17750
|
}
|
|
17695
17751
|
var CameraErrorScreen_default = CameraErrorScreen;
|
|
17696
17752
|
|
|
17697
17753
|
// src/legacy/step/cameraStep/cameraCapture/hooks/useFullScreenOrientationLock.ts
|
|
17698
17754
|
var import_screenfull = __toESM(require_screenfull());
|
|
17699
|
-
import { useCallback as useCallback9, useEffect as
|
|
17755
|
+
import { useCallback as useCallback9, useEffect as useEffect21 } from "react";
|
|
17700
17756
|
|
|
17701
17757
|
// src/legacy/step/cameraStep/cameraCapture/utils/index.ts
|
|
17702
17758
|
var isSelfieCamera = (stream) => {
|
|
@@ -17809,7 +17865,7 @@ var useFullScreenOrientationLock = (shouldLockOrientation, onEvent) => {
|
|
|
17809
17865
|
},
|
|
17810
17866
|
[onEvent]
|
|
17811
17867
|
);
|
|
17812
|
-
|
|
17868
|
+
useEffect21(() => {
|
|
17813
17869
|
var _a, _b;
|
|
17814
17870
|
if (shouldLockOrientation) {
|
|
17815
17871
|
(_b = (_a = window.screen) == null ? void 0 : _a.orientation) == null ? void 0 : _b.addEventListener(
|
|
@@ -17832,7 +17888,7 @@ var noop5 = () => {
|
|
|
17832
17888
|
};
|
|
17833
17889
|
|
|
17834
17890
|
// src/legacy/step/cameraStep/cameraCapture/hooks/useVideoConstraints.ts
|
|
17835
|
-
import { useEffect as
|
|
17891
|
+
import { useEffect as useEffect22, useState as useState29 } from "react";
|
|
17836
17892
|
var useVideoConstraints = (direction) => {
|
|
17837
17893
|
const [videoConstraints, setVideoConstraints] = useState29();
|
|
17838
17894
|
const defaultVideoConstraints = {
|
|
@@ -17842,7 +17898,7 @@ var useVideoConstraints = (direction) => {
|
|
|
17842
17898
|
frameRate: 30,
|
|
17843
17899
|
aspectRatio: 16 / 9
|
|
17844
17900
|
};
|
|
17845
|
-
|
|
17901
|
+
useEffect22(() => {
|
|
17846
17902
|
void getVideoConstraints(direction).then(setVideoConstraints);
|
|
17847
17903
|
}, [direction]);
|
|
17848
17904
|
const getVideoConstraints = async (direction2) => {
|
|
@@ -17860,8 +17916,8 @@ var useVideoConstraints = (direction) => {
|
|
|
17860
17916
|
};
|
|
17861
17917
|
|
|
17862
17918
|
// src/legacy/step/cameraStep/cameraCapture/overlay/Overlay.tsx
|
|
17863
|
-
import { useEffect as
|
|
17864
|
-
import { Fragment as
|
|
17919
|
+
import { useEffect as useEffect23, useRef as useRef7 } from "react";
|
|
17920
|
+
import { Fragment as Fragment23, jsx as jsx120, jsxs as jsxs49 } from "react/jsx-runtime";
|
|
17865
17921
|
var captureButtonHeight = 92;
|
|
17866
17922
|
var reviewButtonsHeight = 120;
|
|
17867
17923
|
var imageHeight = 40;
|
|
@@ -17871,7 +17927,7 @@ var reviewInstructionsHeight = 40;
|
|
|
17871
17927
|
var overlayMaxWidth = 800;
|
|
17872
17928
|
function Overlay({ overlay, outline, imageUrl, title, instructions, reviewInstructions }) {
|
|
17873
17929
|
const svgReference = useRef7(null);
|
|
17874
|
-
|
|
17930
|
+
useEffect23(() => {
|
|
17875
17931
|
const listener = debounce2(() => {
|
|
17876
17932
|
var _a;
|
|
17877
17933
|
if ((_a = svgReference.current) == null ? void 0 : _a.innerHTML) {
|
|
@@ -17883,18 +17939,18 @@ function Overlay({ overlay, outline, imageUrl, title, instructions, reviewInstru
|
|
|
17883
17939
|
return () => window.removeEventListener("resize", listener);
|
|
17884
17940
|
});
|
|
17885
17941
|
let helperBoxHeight = (imageUrl ? imageHeight : 0) + (title ? titleHeight : 0) + (instructions ? instructionsHeight : 0);
|
|
17886
|
-
let helperBox = /* @__PURE__ */
|
|
17887
|
-
imageUrl && /* @__PURE__ */
|
|
17888
|
-
title && /* @__PURE__ */
|
|
17889
|
-
instructions && /* @__PURE__ */
|
|
17942
|
+
let helperBox = /* @__PURE__ */ jsxs49(Fragment23, { children: [
|
|
17943
|
+
imageUrl && /* @__PURE__ */ jsx120("img", { className: "camera-capture-img", src: imageUrl, alt: "" }),
|
|
17944
|
+
title && /* @__PURE__ */ jsx120("h4", { className: "camera-capture-title", children: title }),
|
|
17945
|
+
instructions && /* @__PURE__ */ jsx120("small", { className: "camera-capture-instructions", children: instructions })
|
|
17890
17946
|
] });
|
|
17891
17947
|
const frameBottomMargin = captureButtonHeight + helperBoxHeight;
|
|
17892
17948
|
if (reviewInstructions) {
|
|
17893
17949
|
helperBoxHeight = frameBottomMargin - reviewButtonsHeight;
|
|
17894
|
-
helperBox = /* @__PURE__ */
|
|
17950
|
+
helperBox = /* @__PURE__ */ jsx120("small", { className: "camera-capture-instructions", children: reviewInstructions });
|
|
17895
17951
|
const frameWithReviewInstructionsMinBottomMargin = reviewButtonsHeight + reviewInstructionsHeight;
|
|
17896
17952
|
if (frameBottomMargin < frameWithReviewInstructionsMinBottomMargin) {
|
|
17897
|
-
helperBox = /* @__PURE__ */
|
|
17953
|
+
helperBox = /* @__PURE__ */ jsx120(Fragment23, {});
|
|
17898
17954
|
}
|
|
17899
17955
|
}
|
|
17900
17956
|
const framePosition = {
|
|
@@ -17912,20 +17968,20 @@ function Overlay({ overlay, outline, imageUrl, title, instructions, reviewInstru
|
|
|
17912
17968
|
width: "90%"
|
|
17913
17969
|
}
|
|
17914
17970
|
};
|
|
17915
|
-
return /* @__PURE__ */
|
|
17916
|
-
/* @__PURE__ */
|
|
17917
|
-
/* @__PURE__ */
|
|
17918
|
-
/* @__PURE__ */
|
|
17971
|
+
return /* @__PURE__ */ jsxs49("svg", { ref: svgReference, xmlns: "http://www.w3.org/2000/svg", children: [
|
|
17972
|
+
/* @__PURE__ */ jsx120("defs", { children: /* @__PURE__ */ jsxs49("mask", { id: "mask", children: [
|
|
17973
|
+
/* @__PURE__ */ jsx120("rect", { width: "100%", height: "100%", fill: "#fff" }),
|
|
17974
|
+
/* @__PURE__ */ jsx120("image", __spreadValues({ href: overlay }, framePosition))
|
|
17919
17975
|
] }) }),
|
|
17920
|
-
overlay && /* @__PURE__ */
|
|
17921
|
-
outline && /* @__PURE__ */
|
|
17922
|
-
/* @__PURE__ */
|
|
17976
|
+
overlay && /* @__PURE__ */ jsx120("rect", { width: "100%", height: "100%", mask: "url(#mask)", fillOpacity: "0.72" }),
|
|
17977
|
+
outline && /* @__PURE__ */ jsx120("image", __spreadValues({ href: outline }, framePosition)),
|
|
17978
|
+
/* @__PURE__ */ jsx120("foreignObject", { width: "100%", height: "100%", children: /* @__PURE__ */ jsx120("div", __spreadProps(__spreadValues({ className: "camera-capture-text-and-image-container" }, helperBoxPosition), { children: helperBox })) })
|
|
17923
17979
|
] });
|
|
17924
17980
|
}
|
|
17925
17981
|
var Overlay_default = Overlay;
|
|
17926
17982
|
|
|
17927
17983
|
// src/legacy/step/cameraStep/cameraCapture/CameraCapture.tsx
|
|
17928
|
-
import { jsx as
|
|
17984
|
+
import { jsx as jsx121, jsxs as jsxs50 } from "react/jsx-runtime";
|
|
17929
17985
|
function CameraCapture({
|
|
17930
17986
|
direction = "back",
|
|
17931
17987
|
overlay = "",
|
|
@@ -18028,13 +18084,13 @@ function CameraCapture({
|
|
|
18028
18084
|
setReviewImage(void 0);
|
|
18029
18085
|
};
|
|
18030
18086
|
const handleRetryCameraAccess = () => setMode("CAPTURE" /* CAPTURE */);
|
|
18031
|
-
|
|
18087
|
+
useEffect24(() => {
|
|
18032
18088
|
if (mode !== "CAPTURE" /* CAPTURE */) {
|
|
18033
18089
|
exitFullScreen();
|
|
18034
18090
|
}
|
|
18035
18091
|
}, [mode, exitFullScreen]);
|
|
18036
|
-
const captureScreen = /* @__PURE__ */
|
|
18037
|
-
videoConstraints && /* @__PURE__ */
|
|
18092
|
+
const captureScreen = /* @__PURE__ */ jsxs50("div", { className: "camera-capture", children: [
|
|
18093
|
+
videoConstraints && /* @__PURE__ */ jsx121(
|
|
18038
18094
|
Webcam,
|
|
18039
18095
|
{
|
|
18040
18096
|
ref: webcamReference,
|
|
@@ -18045,7 +18101,7 @@ function CameraCapture({
|
|
|
18045
18101
|
onUserMedia: handleUserMedia
|
|
18046
18102
|
}
|
|
18047
18103
|
),
|
|
18048
|
-
/* @__PURE__ */
|
|
18104
|
+
/* @__PURE__ */ jsx121(
|
|
18049
18105
|
Overlay_default,
|
|
18050
18106
|
{
|
|
18051
18107
|
overlay,
|
|
@@ -18055,8 +18111,8 @@ function CameraCapture({
|
|
|
18055
18111
|
instructions
|
|
18056
18112
|
}
|
|
18057
18113
|
),
|
|
18058
|
-
shouldLockOrientation && /* @__PURE__ */
|
|
18059
|
-
ready && /* @__PURE__ */
|
|
18114
|
+
shouldLockOrientation && /* @__PURE__ */ jsx121(OrientationLockOverlay_default, {}),
|
|
18115
|
+
ready && /* @__PURE__ */ jsx121(
|
|
18060
18116
|
CaptureBottomBar,
|
|
18061
18117
|
{
|
|
18062
18118
|
onCapture: () => {
|
|
@@ -18065,9 +18121,9 @@ function CameraCapture({
|
|
|
18065
18121
|
}
|
|
18066
18122
|
)
|
|
18067
18123
|
] });
|
|
18068
|
-
const reviewScreen = /* @__PURE__ */
|
|
18069
|
-
/* @__PURE__ */
|
|
18070
|
-
/* @__PURE__ */
|
|
18124
|
+
const reviewScreen = /* @__PURE__ */ jsxs50("div", { className: "camera-capture", children: [
|
|
18125
|
+
/* @__PURE__ */ jsx121("img", { className: "review-image", src: reviewImage == null ? void 0 : reviewImage.source, alt: "" }),
|
|
18126
|
+
/* @__PURE__ */ jsx121(
|
|
18071
18127
|
Overlay_default,
|
|
18072
18128
|
{
|
|
18073
18129
|
overlay,
|
|
@@ -18077,18 +18133,18 @@ function CameraCapture({
|
|
|
18077
18133
|
reviewInstructions: intl.formatMessage(CameraCapture_messages_default.reviewInstructions)
|
|
18078
18134
|
}
|
|
18079
18135
|
),
|
|
18080
|
-
/* @__PURE__ */
|
|
18136
|
+
/* @__PURE__ */ jsx121(ReviewBottomBar, { onSubmit: handleReviewSubmit, onRetry: handleReviewRetry })
|
|
18081
18137
|
] });
|
|
18082
|
-
return /* @__PURE__ */
|
|
18138
|
+
return /* @__PURE__ */ jsxs50("section", { children: [
|
|
18083
18139
|
mode === "CAPTURE" /* CAPTURE */ && captureScreen,
|
|
18084
18140
|
mode === "REVIEW" /* REVIEW */ && reviewScreen,
|
|
18085
|
-
mode === "ERROR" /* ERROR */ && cameraError && /* @__PURE__ */
|
|
18141
|
+
mode === "ERROR" /* ERROR */ && cameraError && /* @__PURE__ */ jsx121(CameraErrorScreen_default, __spreadValues({}, cameraError))
|
|
18086
18142
|
] });
|
|
18087
18143
|
}
|
|
18088
18144
|
var CameraCapture_default = CameraCapture;
|
|
18089
18145
|
|
|
18090
18146
|
// src/legacy/step/cameraStep/CameraStep.tsx
|
|
18091
|
-
import { jsx as
|
|
18147
|
+
import { jsx as jsx122 } from "react/jsx-runtime";
|
|
18092
18148
|
function blobToBase64(blob) {
|
|
18093
18149
|
return new Promise((resolve, _) => {
|
|
18094
18150
|
const reader = new FileReader();
|
|
@@ -18107,7 +18163,7 @@ function CameraStep(props) {
|
|
|
18107
18163
|
const { overlay, outline } = assets || {};
|
|
18108
18164
|
const { url: imageUrl } = image || {};
|
|
18109
18165
|
const [captureClicked, setCaptureClicked] = useState31(false);
|
|
18110
|
-
|
|
18166
|
+
useEffect25(() => {
|
|
18111
18167
|
if (captureClicked) {
|
|
18112
18168
|
onAction(action);
|
|
18113
18169
|
}
|
|
@@ -18126,7 +18182,7 @@ function CameraStep(props) {
|
|
|
18126
18182
|
});
|
|
18127
18183
|
}
|
|
18128
18184
|
};
|
|
18129
|
-
return /* @__PURE__ */
|
|
18185
|
+
return /* @__PURE__ */ jsx122(
|
|
18130
18186
|
CameraCapture_default,
|
|
18131
18187
|
{
|
|
18132
18188
|
overlay,
|
|
@@ -18176,12 +18232,12 @@ function getFirstAction(step) {
|
|
|
18176
18232
|
|
|
18177
18233
|
// src/legacy/step/externalConfirmationStep/ExternalConfirmationStep.tsx
|
|
18178
18234
|
import { useIntl as useIntl23 } from "react-intl";
|
|
18179
|
-
import { jsx as
|
|
18235
|
+
import { jsx as jsx123 } from "react/jsx-runtime";
|
|
18180
18236
|
var noop6 = () => {
|
|
18181
18237
|
};
|
|
18182
18238
|
function ExternalConfirmationStep({ url, onClose }) {
|
|
18183
18239
|
const { formatMessage } = useIntl23();
|
|
18184
|
-
return /* @__PURE__ */
|
|
18240
|
+
return /* @__PURE__ */ jsx123(
|
|
18185
18241
|
DynamicLayout_default,
|
|
18186
18242
|
{
|
|
18187
18243
|
components: [
|
|
@@ -18248,9 +18304,9 @@ function getOrigin2(url) {
|
|
|
18248
18304
|
// src/legacy/dynamicFlow/BackButton.tsx
|
|
18249
18305
|
import { Avatar as Avatar7 } from "@transferwise/components";
|
|
18250
18306
|
import { ArrowLeft as ArrowLeft2 } from "@transferwise/icons";
|
|
18251
|
-
import { jsx as
|
|
18307
|
+
import { jsx as jsx124, jsxs as jsxs51 } from "react/jsx-runtime";
|
|
18252
18308
|
function BackButton2({ title, action, onAction }) {
|
|
18253
|
-
return /* @__PURE__ */
|
|
18309
|
+
return /* @__PURE__ */ jsxs51(
|
|
18254
18310
|
"a",
|
|
18255
18311
|
{
|
|
18256
18312
|
href: "/",
|
|
@@ -18261,8 +18317,8 @@ function BackButton2({ title, action, onAction }) {
|
|
|
18261
18317
|
onAction(__spreadProps(__spreadValues({}, action), { skipValidation: true }));
|
|
18262
18318
|
},
|
|
18263
18319
|
children: [
|
|
18264
|
-
/* @__PURE__ */
|
|
18265
|
-
/* @__PURE__ */
|
|
18320
|
+
/* @__PURE__ */ jsx124("span", { className: "sr-only", children: title }),
|
|
18321
|
+
/* @__PURE__ */ jsx124(Avatar7, { type: "icon", children: /* @__PURE__ */ jsx124(ArrowLeft2, { size: "24" }) })
|
|
18266
18322
|
]
|
|
18267
18323
|
}
|
|
18268
18324
|
);
|
|
@@ -18270,7 +18326,7 @@ function BackButton2({ title, action, onAction }) {
|
|
|
18270
18326
|
var BackButton_default2 = BackButton2;
|
|
18271
18327
|
|
|
18272
18328
|
// src/legacy/dynamicFlow/DynamicFlowStep.tsx
|
|
18273
|
-
import { Fragment as
|
|
18329
|
+
import { Fragment as Fragment24, jsx as jsx125, jsxs as jsxs52 } from "react/jsx-runtime";
|
|
18274
18330
|
function DynamicFlowStep(props) {
|
|
18275
18331
|
var _a, _b, _c;
|
|
18276
18332
|
const { step, globalError, onAction } = props;
|
|
@@ -18279,20 +18335,20 @@ function DynamicFlowStep(props) {
|
|
|
18279
18335
|
const { requiresManualTrigger, dismissConfirmation } = useExternal2(externalUrl);
|
|
18280
18336
|
if (step === void 0) {
|
|
18281
18337
|
if (globalError) {
|
|
18282
|
-
return /* @__PURE__ */
|
|
18338
|
+
return /* @__PURE__ */ jsx125(DynamicAlert_default, { component: { context: "negative", markdown: globalError, margin: "lg" } });
|
|
18283
18339
|
}
|
|
18284
18340
|
return null;
|
|
18285
18341
|
}
|
|
18286
18342
|
if (externalUrl && requiresManualTrigger) {
|
|
18287
|
-
return /* @__PURE__ */
|
|
18343
|
+
return /* @__PURE__ */ jsx125(ExternalConfirmationStep_default, { url: externalUrl, onClose: dismissConfirmation });
|
|
18288
18344
|
}
|
|
18289
18345
|
if (isCameraStep(step)) {
|
|
18290
|
-
return /* @__PURE__ */
|
|
18346
|
+
return /* @__PURE__ */ jsx125(CameraStep_default, __spreadProps(__spreadValues({}, props), { step }));
|
|
18291
18347
|
}
|
|
18292
|
-
return /* @__PURE__ */
|
|
18293
|
-
backButton && /* @__PURE__ */
|
|
18294
|
-
globalError ? /* @__PURE__ */
|
|
18295
|
-
/* @__PURE__ */
|
|
18348
|
+
return /* @__PURE__ */ jsxs52(Fragment24, { children: [
|
|
18349
|
+
backButton && /* @__PURE__ */ jsx125(BackButton_default2, __spreadProps(__spreadValues({}, backButton), { onAction })),
|
|
18350
|
+
globalError ? /* @__PURE__ */ jsx125(DynamicAlert_default, { component: { context: "negative", markdown: globalError, margin: "lg" } }) : null,
|
|
18351
|
+
/* @__PURE__ */ jsx125(LayoutStep_default, __spreadProps(__spreadValues({}, props), { stepSpecification: step }))
|
|
18296
18352
|
] });
|
|
18297
18353
|
}
|
|
18298
18354
|
|
|
@@ -18441,7 +18497,7 @@ var isInlineSchema = (schema) => schema !== void 0 && typeof schema === "object"
|
|
|
18441
18497
|
// src/legacy/dynamicFlow/utils/useLoader.tsx
|
|
18442
18498
|
import { Loader as Loader4, Size as Size4 } from "@transferwise/components";
|
|
18443
18499
|
import { useState as useState33 } from "react";
|
|
18444
|
-
import { jsx as
|
|
18500
|
+
import { jsx as jsx126 } from "react/jsx-runtime";
|
|
18445
18501
|
function useLoader(loaderConfig, initialState) {
|
|
18446
18502
|
const config = __spreadValues({
|
|
18447
18503
|
size: Size4.EXTRA_LARGE,
|
|
@@ -18450,7 +18506,7 @@ function useLoader(loaderConfig, initialState) {
|
|
|
18450
18506
|
}, loaderConfig);
|
|
18451
18507
|
const [loadingState, setLoadingState] = useState33(initialState);
|
|
18452
18508
|
const shouldDisplayLoader = config.initial && loadingState === "initial" || config.submission && loadingState === "submission";
|
|
18453
|
-
const loader = shouldDisplayLoader ? /* @__PURE__ */
|
|
18509
|
+
const loader = shouldDisplayLoader ? /* @__PURE__ */ jsx126(
|
|
18454
18510
|
Loader4,
|
|
18455
18511
|
{
|
|
18456
18512
|
size: config.size,
|
|
@@ -18553,7 +18609,7 @@ var assertResponseIsValid2 = (response) => {
|
|
|
18553
18609
|
var isResponse2 = (response) => typeof response === "object" && response !== null && "clone" in response && "bodyUsed" in response;
|
|
18554
18610
|
|
|
18555
18611
|
// src/legacy/dynamicFlow/DynamicFlow.tsx
|
|
18556
|
-
import { jsx as
|
|
18612
|
+
import { jsx as jsx127 } from "react/jsx-runtime";
|
|
18557
18613
|
var noop7 = () => {
|
|
18558
18614
|
};
|
|
18559
18615
|
var DynamicFlowComponent = ({
|
|
@@ -18637,7 +18693,7 @@ var DynamicFlowComponent = ({
|
|
|
18637
18693
|
await handleExitResponse(response, action.result);
|
|
18638
18694
|
return;
|
|
18639
18695
|
}
|
|
18640
|
-
await handleResponse(response, "submission");
|
|
18696
|
+
await handleResponse(response, "submission", action.result);
|
|
18641
18697
|
} catch (error) {
|
|
18642
18698
|
completeWithError(
|
|
18643
18699
|
error,
|
|
@@ -18668,10 +18724,10 @@ var DynamicFlowComponent = ({
|
|
|
18668
18724
|
},
|
|
18669
18725
|
[onCompletion, dispatchEvent]
|
|
18670
18726
|
);
|
|
18671
|
-
|
|
18727
|
+
useEffect26(() => {
|
|
18672
18728
|
dispatchEvent("Dynamic Flow - Flow Started", {});
|
|
18673
18729
|
}, []);
|
|
18674
|
-
|
|
18730
|
+
useEffect26(() => {
|
|
18675
18731
|
if (!initialStep) {
|
|
18676
18732
|
const action = __spreadValues({
|
|
18677
18733
|
id: "#initial-step-request",
|
|
@@ -18683,7 +18739,7 @@ var DynamicFlowComponent = ({
|
|
|
18683
18739
|
warnIfNoStepLayout(initialStep);
|
|
18684
18740
|
}
|
|
18685
18741
|
}, [httpClient, JSON.stringify(initialStep), JSON.stringify(initialAction)]);
|
|
18686
|
-
const handleResponse = async (response, fetchType) => {
|
|
18742
|
+
const handleResponse = async (response, fetchType, actionResult) => {
|
|
18687
18743
|
try {
|
|
18688
18744
|
if (response.status === 304) {
|
|
18689
18745
|
setLoadingState("idle");
|
|
@@ -18698,7 +18754,9 @@ var DynamicFlowComponent = ({
|
|
|
18698
18754
|
if (result.type === "action") {
|
|
18699
18755
|
void performAction(result.action, result.action.data);
|
|
18700
18756
|
} else if (result.type === "exit") {
|
|
18701
|
-
dispatchEventAndComplete(
|
|
18757
|
+
dispatchEventAndComplete(
|
|
18758
|
+
isObject2(actionResult) ? __spreadValues(__spreadValues({}, result.result), actionResult) : result.result
|
|
18759
|
+
);
|
|
18702
18760
|
} else {
|
|
18703
18761
|
updateStep(result.step, result.etag, fetchType);
|
|
18704
18762
|
}
|
|
@@ -18789,7 +18847,7 @@ var DynamicFlowComponent = ({
|
|
|
18789
18847
|
await performAction(action);
|
|
18790
18848
|
}
|
|
18791
18849
|
};
|
|
18792
|
-
return /* @__PURE__ */
|
|
18850
|
+
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(
|
|
18793
18851
|
DynamicFlowStep,
|
|
18794
18852
|
{
|
|
18795
18853
|
step,
|
|
@@ -18806,7 +18864,7 @@ var DynamicFlowComponent = ({
|
|
|
18806
18864
|
) }) }) }) }) });
|
|
18807
18865
|
};
|
|
18808
18866
|
function DynamicFlow(props) {
|
|
18809
|
-
return /* @__PURE__ */
|
|
18867
|
+
return /* @__PURE__ */ jsx127(ErrorBoundary_default, { onError: props.onError, children: /* @__PURE__ */ jsx127(DynamicFlowComponent, __spreadValues({}, props)) });
|
|
18810
18868
|
}
|
|
18811
18869
|
var DynamicFlow_default = DynamicFlow;
|
|
18812
18870
|
var combineModels2 = (formModels) => Object.values(formModels).reduce((previous, model) => __spreadValues(__spreadValues({}, previous), model), {});
|
|
@@ -18823,19 +18881,19 @@ var shouldTriggerRefresh = (props) => {
|
|
|
18823
18881
|
};
|
|
18824
18882
|
|
|
18825
18883
|
// src/legacy/jsonSchemaForm/JsonSchemaForm.tsx
|
|
18826
|
-
import { jsx as
|
|
18884
|
+
import { jsx as jsx128 } from "react/jsx-runtime";
|
|
18827
18885
|
function JsonSchemaForm(props) {
|
|
18828
18886
|
const schemaProps = __spreadValues({
|
|
18829
18887
|
model: null,
|
|
18830
18888
|
errors: null
|
|
18831
18889
|
}, props);
|
|
18832
18890
|
const { baseUrl = "", onEvent = noop8, onLog = noop8 } = props;
|
|
18833
|
-
return /* @__PURE__ */
|
|
18891
|
+
return /* @__PURE__ */ jsx128(LogProvider, { flowId: "JsonSchemaForm", stepId: "JsonSchemaForm", onLog, children: /* @__PURE__ */ jsx128(
|
|
18834
18892
|
EventsContextProvider,
|
|
18835
18893
|
{
|
|
18836
18894
|
metadata: { flowId: "JsonSchemaForm", stepId: "JsonSchemaForm" },
|
|
18837
18895
|
onEvent,
|
|
18838
|
-
children: /* @__PURE__ */
|
|
18896
|
+
children: /* @__PURE__ */ jsx128(HttpClientProviderFromBaseUrl, { baseUrl, children: /* @__PURE__ */ jsx128(GenericSchema_default, __spreadValues({}, schemaProps)) })
|
|
18839
18897
|
}
|
|
18840
18898
|
) });
|
|
18841
18899
|
}
|