@wise/dynamic-flow-client-internal 3.21.2 → 3.22.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/main.css +14 -0
- package/build/main.js +402 -225
- package/build/main.min.js +1 -1
- package/build/main.mjs +365 -188
- package/package.json +4 -4
package/build/main.mjs
CHANGED
|
@@ -965,10 +965,29 @@ function LabelContentWithHelp({ text, help }) {
|
|
|
965
965
|
|
|
966
966
|
// ../renderers/src/components/FieldInput.tsx
|
|
967
967
|
import { jsx as jsx5 } from "react/jsx-runtime";
|
|
968
|
-
function FieldInput({ id, children, label,
|
|
968
|
+
function FieldInput({ id, children, label, validation, description, help }) {
|
|
969
969
|
const labelContent = label && help ? /* @__PURE__ */ jsx5(LabelContentWithHelp, { text: label, help }) : label;
|
|
970
|
-
return /* @__PURE__ */ jsx5(
|
|
970
|
+
return /* @__PURE__ */ jsx5(
|
|
971
|
+
Field,
|
|
972
|
+
{
|
|
973
|
+
id,
|
|
974
|
+
label: labelContent,
|
|
975
|
+
description,
|
|
976
|
+
message: validation == null ? void 0 : validation.message,
|
|
977
|
+
sentiment: mapStatusToSentiment(validation),
|
|
978
|
+
children
|
|
979
|
+
}
|
|
980
|
+
);
|
|
971
981
|
}
|
|
982
|
+
var mapStatusToSentiment = (validation) => {
|
|
983
|
+
if (validation) {
|
|
984
|
+
if (validation.status === "valid") {
|
|
985
|
+
return "positive";
|
|
986
|
+
}
|
|
987
|
+
return "negative";
|
|
988
|
+
}
|
|
989
|
+
return void 0;
|
|
990
|
+
};
|
|
972
991
|
var FieldInput_default = FieldInput;
|
|
973
992
|
|
|
974
993
|
// ../renderers/src/BooleanInputRenderer.tsx
|
|
@@ -977,9 +996,27 @@ import { jsx as jsx6 } from "react/jsx-runtime";
|
|
|
977
996
|
var BooleanInputRenderer = {
|
|
978
997
|
canRenderType: "input-boolean",
|
|
979
998
|
render: (props) => {
|
|
980
|
-
const _a = props, {
|
|
999
|
+
const _a = props, {
|
|
1000
|
+
id,
|
|
1001
|
+
control,
|
|
1002
|
+
label = "",
|
|
1003
|
+
description,
|
|
1004
|
+
help,
|
|
1005
|
+
type,
|
|
1006
|
+
validationState,
|
|
1007
|
+
value
|
|
1008
|
+
} = _a, rest = __objRest(_a, [
|
|
1009
|
+
"id",
|
|
1010
|
+
"control",
|
|
1011
|
+
"label",
|
|
1012
|
+
"description",
|
|
1013
|
+
"help",
|
|
1014
|
+
"type",
|
|
1015
|
+
"validationState",
|
|
1016
|
+
"value"
|
|
1017
|
+
]);
|
|
981
1018
|
const checkboxProps = __spreadProps(__spreadValues({}, rest), { label, secondary: description, checked: value });
|
|
982
|
-
return /* @__PURE__ */ jsx6(FieldInput_default, { id, label: "", description: "",
|
|
1019
|
+
return /* @__PURE__ */ jsx6(FieldInput_default, { id, label: "", description: "", validation: validationState, help, children: /* @__PURE__ */ jsx6(Checkbox, __spreadValues({ id }, checkboxProps)) });
|
|
983
1020
|
}
|
|
984
1021
|
};
|
|
985
1022
|
var BooleanInputRenderer_default = BooleanInputRenderer;
|
|
@@ -1204,23 +1241,33 @@ var DateInputRenderer = {
|
|
|
1204
1241
|
control,
|
|
1205
1242
|
label,
|
|
1206
1243
|
description,
|
|
1207
|
-
error,
|
|
1208
1244
|
type,
|
|
1209
1245
|
help,
|
|
1246
|
+
validationState,
|
|
1210
1247
|
value: initialValue
|
|
1211
1248
|
} = _a, rest = __objRest(_a, [
|
|
1212
1249
|
"id",
|
|
1213
1250
|
"control",
|
|
1214
1251
|
"label",
|
|
1215
1252
|
"description",
|
|
1216
|
-
"error",
|
|
1217
1253
|
"type",
|
|
1218
1254
|
"help",
|
|
1255
|
+
"validationState",
|
|
1219
1256
|
"value"
|
|
1220
1257
|
]);
|
|
1221
1258
|
const value = initialValue != null ? initialValue : "";
|
|
1222
1259
|
const inputProps = __spreadProps(__spreadValues({}, rest), { value, id });
|
|
1223
|
-
return /* @__PURE__ */ jsx11(
|
|
1260
|
+
return /* @__PURE__ */ jsx11(
|
|
1261
|
+
FieldInput_default,
|
|
1262
|
+
{
|
|
1263
|
+
id,
|
|
1264
|
+
label,
|
|
1265
|
+
description,
|
|
1266
|
+
validation: validationState,
|
|
1267
|
+
help,
|
|
1268
|
+
children: /* @__PURE__ */ jsx11(VariableDateInput_default, { control, inputProps })
|
|
1269
|
+
}
|
|
1270
|
+
);
|
|
1224
1271
|
}
|
|
1225
1272
|
};
|
|
1226
1273
|
var DateInputRenderer_default = DateInputRenderer;
|
|
@@ -1508,23 +1555,33 @@ import { jsx as jsx24 } from "react/jsx-runtime";
|
|
|
1508
1555
|
var IntegerInputRenderer = {
|
|
1509
1556
|
canRenderType: "input-integer",
|
|
1510
1557
|
render: (props) => {
|
|
1511
|
-
const _a = props, { id, label,
|
|
1512
|
-
return /* @__PURE__ */ jsx24(
|
|
1513
|
-
|
|
1514
|
-
|
|
1558
|
+
const _a = props, { id, label, description, help, type, validationState, value, onChange } = _a, rest = __objRest(_a, ["id", "label", "description", "help", "type", "validationState", "value", "onChange"]);
|
|
1559
|
+
return /* @__PURE__ */ jsx24(
|
|
1560
|
+
FieldInput_default,
|
|
1561
|
+
{
|
|
1515
1562
|
id,
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1563
|
+
label,
|
|
1564
|
+
description,
|
|
1565
|
+
validation: validationState,
|
|
1566
|
+
help,
|
|
1567
|
+
children: /* @__PURE__ */ jsx24(
|
|
1568
|
+
Input,
|
|
1569
|
+
__spreadValues({
|
|
1570
|
+
id,
|
|
1571
|
+
name: id,
|
|
1572
|
+
type: "number",
|
|
1573
|
+
step: "1",
|
|
1574
|
+
pattern: "\\d+",
|
|
1575
|
+
value: value != null ? value : "",
|
|
1576
|
+
onChange: ({ target: { value: newValue } }) => {
|
|
1577
|
+
const parsedValue = Number.parseInt(newValue, 10);
|
|
1578
|
+
onChange(Number.isNaN(parsedValue) ? null : parsedValue);
|
|
1579
|
+
},
|
|
1580
|
+
onWheel
|
|
1581
|
+
}, rest)
|
|
1582
|
+
)
|
|
1583
|
+
}
|
|
1584
|
+
);
|
|
1528
1585
|
}
|
|
1529
1586
|
};
|
|
1530
1587
|
var IntegerInputRenderer_default = IntegerInputRenderer;
|
|
@@ -1630,10 +1687,10 @@ function MultiSelectInputRendererComponent(props) {
|
|
|
1630
1687
|
disabled,
|
|
1631
1688
|
label,
|
|
1632
1689
|
help,
|
|
1633
|
-
error,
|
|
1634
1690
|
options,
|
|
1635
1691
|
placeholder,
|
|
1636
1692
|
selectedIndices,
|
|
1693
|
+
validationState,
|
|
1637
1694
|
onSelect
|
|
1638
1695
|
} = props;
|
|
1639
1696
|
const mergedIndices = stagedIndices != null ? stagedIndices : selectedIndices;
|
|
@@ -1664,39 +1721,49 @@ function MultiSelectInputRendererComponent(props) {
|
|
|
1664
1721
|
};
|
|
1665
1722
|
return /* @__PURE__ */ jsx29(SelectInputOptionContent, __spreadValues({}, contentProps));
|
|
1666
1723
|
};
|
|
1667
|
-
return /* @__PURE__ */ jsx29(
|
|
1668
|
-
|
|
1724
|
+
return /* @__PURE__ */ jsx29(
|
|
1725
|
+
FieldInput_default,
|
|
1669
1726
|
{
|
|
1670
1727
|
id,
|
|
1671
|
-
|
|
1672
|
-
|
|
1673
|
-
|
|
1674
|
-
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
|
|
1681
|
-
|
|
1682
|
-
|
|
1683
|
-
|
|
1684
|
-
|
|
1685
|
-
|
|
1686
|
-
|
|
1687
|
-
|
|
1688
|
-
|
|
1689
|
-
|
|
1690
|
-
|
|
1691
|
-
|
|
1692
|
-
|
|
1693
|
-
|
|
1694
|
-
|
|
1695
|
-
|
|
1728
|
+
label,
|
|
1729
|
+
help,
|
|
1730
|
+
description,
|
|
1731
|
+
validation: validationState,
|
|
1732
|
+
children: /* @__PURE__ */ jsx29(
|
|
1733
|
+
SelectInput,
|
|
1734
|
+
{
|
|
1735
|
+
id,
|
|
1736
|
+
items: options.map((option, index) => {
|
|
1737
|
+
var _a, _b, _c;
|
|
1738
|
+
return {
|
|
1739
|
+
type: "option",
|
|
1740
|
+
value: index,
|
|
1741
|
+
filterMatchers: [
|
|
1742
|
+
...(_a = option.keywords) != null ? _a : [],
|
|
1743
|
+
(_b = option.title) != null ? _b : "",
|
|
1744
|
+
(_c = option.description) != null ? _c : ""
|
|
1745
|
+
],
|
|
1746
|
+
disabled: option.disabled
|
|
1747
|
+
};
|
|
1748
|
+
}),
|
|
1749
|
+
disabled,
|
|
1750
|
+
placeholder,
|
|
1751
|
+
value: mergedIndices,
|
|
1752
|
+
renderValue,
|
|
1753
|
+
multiple: true,
|
|
1754
|
+
onChange: (values) => {
|
|
1755
|
+
setStagedIndices(values);
|
|
1756
|
+
},
|
|
1757
|
+
onClose: () => {
|
|
1758
|
+
if (stagedIndices) {
|
|
1759
|
+
onSelect(stagedIndices);
|
|
1760
|
+
setStagedIndices(void 0);
|
|
1761
|
+
}
|
|
1762
|
+
}
|
|
1696
1763
|
}
|
|
1697
|
-
|
|
1764
|
+
)
|
|
1698
1765
|
}
|
|
1699
|
-
)
|
|
1766
|
+
);
|
|
1700
1767
|
}
|
|
1701
1768
|
var MultiSelectInputRenderer_default = MultiSelectInputRenderer;
|
|
1702
1769
|
|
|
@@ -1712,8 +1779,8 @@ function UploadFieldInput({
|
|
|
1712
1779
|
children,
|
|
1713
1780
|
label,
|
|
1714
1781
|
description,
|
|
1715
|
-
|
|
1716
|
-
|
|
1782
|
+
help,
|
|
1783
|
+
validation
|
|
1717
1784
|
}) {
|
|
1718
1785
|
const labelContent = label && help ? /* @__PURE__ */ jsx30(LabelContentWithHelp, { text: label, help }) : label;
|
|
1719
1786
|
const descriptionId = description ? `${id}-description` : void 0;
|
|
@@ -1721,12 +1788,12 @@ function UploadFieldInput({
|
|
|
1721
1788
|
"div",
|
|
1722
1789
|
{
|
|
1723
1790
|
className: (0, import_classnames3.default)("form-group d-block", {
|
|
1724
|
-
"has-error":
|
|
1791
|
+
"has-error": (validation == null ? void 0 : validation.status) === "invalid"
|
|
1725
1792
|
}),
|
|
1726
1793
|
children: [
|
|
1727
1794
|
/* @__PURE__ */ jsx30("label", { htmlFor: id, className: "control-label", children: labelContent }),
|
|
1728
1795
|
children,
|
|
1729
|
-
|
|
1796
|
+
(validation == null ? void 0 : validation.status) === "invalid" && /* @__PURE__ */ jsx30(InlineAlert, { type: "negative", id: descriptionId, children: validation.message })
|
|
1730
1797
|
]
|
|
1731
1798
|
}
|
|
1732
1799
|
);
|
|
@@ -1769,10 +1836,10 @@ var MultiUploadInputRenderer = {
|
|
|
1769
1836
|
label,
|
|
1770
1837
|
description,
|
|
1771
1838
|
disabled,
|
|
1772
|
-
error,
|
|
1773
1839
|
maxSize,
|
|
1774
1840
|
maxItems,
|
|
1775
1841
|
uploadLabel,
|
|
1842
|
+
validationState,
|
|
1776
1843
|
onUpload,
|
|
1777
1844
|
onDelete
|
|
1778
1845
|
} = props;
|
|
@@ -1785,22 +1852,32 @@ var MultiUploadInputRenderer = {
|
|
|
1785
1852
|
};
|
|
1786
1853
|
const onDeleteFile = async (fileId) => onDelete(String(fileId));
|
|
1787
1854
|
const descriptionId = description ? `${id}-description` : void 0;
|
|
1788
|
-
return /* @__PURE__ */ jsx31(
|
|
1789
|
-
|
|
1855
|
+
return /* @__PURE__ */ jsx31(
|
|
1856
|
+
UploadFieldInput_default,
|
|
1790
1857
|
{
|
|
1791
1858
|
id,
|
|
1792
|
-
|
|
1859
|
+
label,
|
|
1793
1860
|
description,
|
|
1794
|
-
|
|
1795
|
-
|
|
1796
|
-
|
|
1797
|
-
|
|
1798
|
-
|
|
1799
|
-
|
|
1800
|
-
|
|
1801
|
-
|
|
1861
|
+
validation: validationState,
|
|
1862
|
+
help,
|
|
1863
|
+
children: /* @__PURE__ */ jsx31(
|
|
1864
|
+
UploadInput,
|
|
1865
|
+
{
|
|
1866
|
+
id,
|
|
1867
|
+
"aria-describedby": descriptionId,
|
|
1868
|
+
description,
|
|
1869
|
+
disabled,
|
|
1870
|
+
fileTypes: getAcceptsString(accepts),
|
|
1871
|
+
maxFiles: maxItems,
|
|
1872
|
+
multiple: true,
|
|
1873
|
+
sizeLimit: maxSize ? toKilobytes(maxSize) : void 0,
|
|
1874
|
+
uploadButtonTitle: uploadLabel,
|
|
1875
|
+
onDeleteFile,
|
|
1876
|
+
onUploadFile
|
|
1877
|
+
}
|
|
1878
|
+
)
|
|
1802
1879
|
}
|
|
1803
|
-
)
|
|
1880
|
+
);
|
|
1804
1881
|
}
|
|
1805
1882
|
};
|
|
1806
1883
|
var MultiUploadInputRenderer_default = MultiUploadInputRenderer;
|
|
@@ -1811,21 +1888,31 @@ import { jsx as jsx32 } from "react/jsx-runtime";
|
|
|
1811
1888
|
var NumberInputRenderer = {
|
|
1812
1889
|
canRenderType: "input-number",
|
|
1813
1890
|
render: (props) => {
|
|
1814
|
-
const _a = props, { id, label,
|
|
1815
|
-
return /* @__PURE__ */ jsx32(
|
|
1816
|
-
|
|
1817
|
-
|
|
1891
|
+
const _a = props, { id, label, description, help, type, validationState, value, onChange } = _a, rest = __objRest(_a, ["id", "label", "description", "help", "type", "validationState", "value", "onChange"]);
|
|
1892
|
+
return /* @__PURE__ */ jsx32(
|
|
1893
|
+
FieldInput_default,
|
|
1894
|
+
{
|
|
1818
1895
|
id,
|
|
1819
|
-
|
|
1820
|
-
|
|
1821
|
-
|
|
1822
|
-
|
|
1823
|
-
|
|
1824
|
-
|
|
1825
|
-
|
|
1826
|
-
|
|
1827
|
-
|
|
1828
|
-
|
|
1896
|
+
label,
|
|
1897
|
+
description,
|
|
1898
|
+
validation: validationState,
|
|
1899
|
+
help,
|
|
1900
|
+
children: /* @__PURE__ */ jsx32(
|
|
1901
|
+
Input2,
|
|
1902
|
+
__spreadValues({
|
|
1903
|
+
id,
|
|
1904
|
+
name: id,
|
|
1905
|
+
type: "number",
|
|
1906
|
+
value: value != null ? value : "",
|
|
1907
|
+
onChange: ({ target: { value: newValue } }) => {
|
|
1908
|
+
const parsedValue = Number.parseFloat(newValue);
|
|
1909
|
+
onChange(Number.isNaN(parsedValue) ? null : parsedValue);
|
|
1910
|
+
},
|
|
1911
|
+
onWheel
|
|
1912
|
+
}, rest)
|
|
1913
|
+
)
|
|
1914
|
+
}
|
|
1915
|
+
);
|
|
1829
1916
|
}
|
|
1830
1917
|
};
|
|
1831
1918
|
var NumberInputRenderer_default = NumberInputRenderer;
|
|
@@ -1945,9 +2032,9 @@ function Repeatable(props) {
|
|
|
1945
2032
|
description,
|
|
1946
2033
|
editableItem,
|
|
1947
2034
|
editItemTitle,
|
|
1948
|
-
error,
|
|
1949
2035
|
items,
|
|
1950
2036
|
title,
|
|
2037
|
+
validationState,
|
|
1951
2038
|
onEdit,
|
|
1952
2039
|
onAdd,
|
|
1953
2040
|
onSave,
|
|
@@ -1983,7 +2070,7 @@ function Repeatable(props) {
|
|
|
1983
2070
|
"div",
|
|
1984
2071
|
{
|
|
1985
2072
|
className: (0, import_classnames5.default)("form-group", {
|
|
1986
|
-
"has-error":
|
|
2073
|
+
"has-error": (validationState == null ? void 0 : validationState.status) === "invalid"
|
|
1987
2074
|
}),
|
|
1988
2075
|
children: [
|
|
1989
2076
|
items == null ? void 0 : items.map((item, index) => /* @__PURE__ */ jsx34(ItemSummaryOption, { item, onClick: () => onEditItem(index) }, item.id)),
|
|
@@ -1996,7 +2083,7 @@ function Repeatable(props) {
|
|
|
1996
2083
|
onClick: () => onAddItem()
|
|
1997
2084
|
}
|
|
1998
2085
|
),
|
|
1999
|
-
|
|
2086
|
+
(validationState == null ? void 0 : validationState.status) === "invalid" && /* @__PURE__ */ jsx34(InlineAlert2, { type: "negative", children: validationState.message })
|
|
2000
2087
|
]
|
|
2001
2088
|
}
|
|
2002
2089
|
),
|
|
@@ -2061,22 +2148,26 @@ var generic_error_messages_default = defineMessages5({
|
|
|
2061
2148
|
});
|
|
2062
2149
|
|
|
2063
2150
|
// ../renderers/src/SearchRenderer/ErrorResult.tsx
|
|
2151
|
+
import { Button as Button5 } from "@transferwise/components";
|
|
2064
2152
|
import { jsx as jsx35, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
2065
2153
|
function ErrorResult({ state }) {
|
|
2066
2154
|
const intl = useIntl5();
|
|
2155
|
+
const buttonVisualProps = {
|
|
2156
|
+
priority: "tertiary",
|
|
2157
|
+
size: "sm",
|
|
2158
|
+
style: { marginTop: "-2px", padding: "0", width: "auto", display: "inline" }
|
|
2159
|
+
};
|
|
2067
2160
|
return /* @__PURE__ */ jsxs11("p", { className: "m-t-2", children: [
|
|
2068
2161
|
intl.formatMessage(generic_error_messages_default.genericError),
|
|
2069
2162
|
"\xA0",
|
|
2070
2163
|
/* @__PURE__ */ jsx35(
|
|
2071
|
-
|
|
2072
|
-
{
|
|
2073
|
-
|
|
2074
|
-
onClick: (e) => {
|
|
2075
|
-
e.preventDefault();
|
|
2164
|
+
Button5,
|
|
2165
|
+
__spreadProps(__spreadValues({}, buttonVisualProps), {
|
|
2166
|
+
onClick: () => {
|
|
2076
2167
|
state.onRetry();
|
|
2077
2168
|
},
|
|
2078
2169
|
children: intl.formatMessage(generic_error_messages_default.retry)
|
|
2079
|
-
}
|
|
2170
|
+
})
|
|
2080
2171
|
)
|
|
2081
2172
|
] });
|
|
2082
2173
|
}
|
|
@@ -2096,7 +2187,7 @@ function BlockSearchRendererComponent({
|
|
|
2096
2187
|
const [hasSearched, setHasSearched] = useState6(false);
|
|
2097
2188
|
const trackEvent = useTrackEvent();
|
|
2098
2189
|
return /* @__PURE__ */ jsxs12("div", { className: getMargin(margin), children: [
|
|
2099
|
-
/* @__PURE__ */ jsx36(FieldInput_default, { id, description: "",
|
|
2190
|
+
/* @__PURE__ */ jsx36(FieldInput_default, { id, description: "", validation: void 0, help: "", label: title, children: /* @__PURE__ */ jsx36(
|
|
2100
2191
|
Input4,
|
|
2101
2192
|
{
|
|
2102
2193
|
id,
|
|
@@ -2179,7 +2270,7 @@ function InlineSearchRenderer({
|
|
|
2179
2270
|
const [hasSearched, setHasSearched] = useState7(false);
|
|
2180
2271
|
const trackEvent = useTrackEvent();
|
|
2181
2272
|
const intl = useIntl6();
|
|
2182
|
-
return /* @__PURE__ */ jsx37("div", { className: getMargin(margin), children: /* @__PURE__ */ jsx37(FieldInput_default, { id, description: "",
|
|
2273
|
+
return /* @__PURE__ */ jsx37("div", { className: getMargin(margin), children: /* @__PURE__ */ jsx37(FieldInput_default, { id, description: "", validation: void 0, help: "", label: title, children: /* @__PURE__ */ jsx37(
|
|
2183
2274
|
Typeahead,
|
|
2184
2275
|
{
|
|
2185
2276
|
id: "typeahead-input-id",
|
|
@@ -2255,30 +2346,40 @@ function RadioInputRendererComponent(props) {
|
|
|
2255
2346
|
children,
|
|
2256
2347
|
description,
|
|
2257
2348
|
disabled,
|
|
2258
|
-
error,
|
|
2259
2349
|
help,
|
|
2260
2350
|
label,
|
|
2261
2351
|
options,
|
|
2262
2352
|
selectedIndex,
|
|
2353
|
+
validationState,
|
|
2263
2354
|
onSelect
|
|
2264
2355
|
} = props;
|
|
2265
2356
|
return /* @__PURE__ */ jsxs13(Fragment4, { children: [
|
|
2266
|
-
/* @__PURE__ */ jsx39(
|
|
2267
|
-
|
|
2357
|
+
/* @__PURE__ */ jsx39(
|
|
2358
|
+
FieldInput_default,
|
|
2268
2359
|
{
|
|
2269
|
-
|
|
2270
|
-
|
|
2271
|
-
|
|
2272
|
-
|
|
2273
|
-
|
|
2274
|
-
|
|
2275
|
-
|
|
2276
|
-
|
|
2277
|
-
|
|
2278
|
-
|
|
2279
|
-
|
|
2280
|
-
|
|
2281
|
-
|
|
2360
|
+
id,
|
|
2361
|
+
label,
|
|
2362
|
+
help,
|
|
2363
|
+
description,
|
|
2364
|
+
validation: validationState,
|
|
2365
|
+
children: /* @__PURE__ */ jsx39("span", { children: /* @__PURE__ */ jsx39(
|
|
2366
|
+
RadioGroup,
|
|
2367
|
+
{
|
|
2368
|
+
name: id,
|
|
2369
|
+
radios: options.map((option, index) => ({
|
|
2370
|
+
label: option.title,
|
|
2371
|
+
value: index,
|
|
2372
|
+
secondary: option.description,
|
|
2373
|
+
disabled: option.disabled || disabled,
|
|
2374
|
+
avatar: /* @__PURE__ */ jsx39(OptionMedia, { icon: option.icon, image: option.image })
|
|
2375
|
+
})),
|
|
2376
|
+
selectedValue: selectedIndex != null ? selectedIndex : void 0,
|
|
2377
|
+
onChange: onSelect
|
|
2378
|
+
},
|
|
2379
|
+
`${id}-${selectedIndex}`
|
|
2380
|
+
) })
|
|
2381
|
+
}
|
|
2382
|
+
),
|
|
2282
2383
|
children
|
|
2283
2384
|
] });
|
|
2284
2385
|
}
|
|
@@ -2293,11 +2394,11 @@ function TabInputRendererComponent(props) {
|
|
|
2293
2394
|
children,
|
|
2294
2395
|
description,
|
|
2295
2396
|
disabled,
|
|
2296
|
-
error,
|
|
2297
2397
|
help,
|
|
2298
2398
|
label,
|
|
2299
2399
|
options,
|
|
2300
2400
|
selectedIndex,
|
|
2401
|
+
validationState,
|
|
2301
2402
|
onSelect
|
|
2302
2403
|
} = props;
|
|
2303
2404
|
useEffect3(() => {
|
|
@@ -2306,21 +2407,31 @@ function TabInputRendererComponent(props) {
|
|
|
2306
2407
|
}
|
|
2307
2408
|
}, [selectedIndex, onSelect, options.length]);
|
|
2308
2409
|
return /* @__PURE__ */ jsxs14(Fragment5, { children: [
|
|
2309
|
-
/* @__PURE__ */ jsx40(
|
|
2310
|
-
|
|
2410
|
+
/* @__PURE__ */ jsx40(
|
|
2411
|
+
FieldInput_default,
|
|
2311
2412
|
{
|
|
2312
|
-
|
|
2313
|
-
|
|
2314
|
-
|
|
2315
|
-
|
|
2316
|
-
|
|
2317
|
-
|
|
2318
|
-
|
|
2319
|
-
|
|
2320
|
-
|
|
2321
|
-
|
|
2413
|
+
id,
|
|
2414
|
+
label,
|
|
2415
|
+
help,
|
|
2416
|
+
description,
|
|
2417
|
+
validation: validationState,
|
|
2418
|
+
children: /* @__PURE__ */ jsx40(
|
|
2419
|
+
Tabs,
|
|
2420
|
+
{
|
|
2421
|
+
name: id,
|
|
2422
|
+
selected: selectedIndex != null ? selectedIndex : 0,
|
|
2423
|
+
tabs: options.map((option) => ({
|
|
2424
|
+
title: option.title,
|
|
2425
|
+
// if we pass null, we get some props-types console errors
|
|
2426
|
+
// eslint-disable-next-line react/jsx-no-useless-fragment
|
|
2427
|
+
content: /* @__PURE__ */ jsx40(Fragment5, {}),
|
|
2428
|
+
disabled: option.disabled || disabled
|
|
2429
|
+
})),
|
|
2430
|
+
onTabSelect: onSelect
|
|
2431
|
+
}
|
|
2432
|
+
)
|
|
2322
2433
|
}
|
|
2323
|
-
)
|
|
2434
|
+
),
|
|
2324
2435
|
children
|
|
2325
2436
|
] });
|
|
2326
2437
|
}
|
|
@@ -2353,13 +2464,13 @@ function SelectInputRendererComponent(props) {
|
|
|
2353
2464
|
children,
|
|
2354
2465
|
description,
|
|
2355
2466
|
disabled,
|
|
2356
|
-
error,
|
|
2357
2467
|
help,
|
|
2358
2468
|
label,
|
|
2359
2469
|
options,
|
|
2360
2470
|
placeholder,
|
|
2361
2471
|
required,
|
|
2362
2472
|
selectedIndex,
|
|
2473
|
+
validationState,
|
|
2363
2474
|
onSelect
|
|
2364
2475
|
} = props;
|
|
2365
2476
|
const items = options.map(
|
|
@@ -2390,20 +2501,30 @@ function SelectInputRendererComponent(props) {
|
|
|
2390
2501
|
return /* @__PURE__ */ jsx42(SelectInputOptionContent2, __spreadValues({}, contentProps));
|
|
2391
2502
|
};
|
|
2392
2503
|
return /* @__PURE__ */ jsxs15(Fragment6, { children: [
|
|
2393
|
-
/* @__PURE__ */ jsx42(
|
|
2394
|
-
|
|
2504
|
+
/* @__PURE__ */ jsx42(
|
|
2505
|
+
FieldInput_default,
|
|
2395
2506
|
{
|
|
2396
|
-
|
|
2397
|
-
|
|
2398
|
-
|
|
2399
|
-
|
|
2400
|
-
|
|
2401
|
-
|
|
2402
|
-
|
|
2403
|
-
|
|
2404
|
-
|
|
2507
|
+
id,
|
|
2508
|
+
label,
|
|
2509
|
+
help,
|
|
2510
|
+
description,
|
|
2511
|
+
validation: validationState,
|
|
2512
|
+
children: /* @__PURE__ */ jsx42(
|
|
2513
|
+
SelectInput2,
|
|
2514
|
+
{
|
|
2515
|
+
name: id,
|
|
2516
|
+
placeholder,
|
|
2517
|
+
items,
|
|
2518
|
+
disabled,
|
|
2519
|
+
value: selectedIndex,
|
|
2520
|
+
renderValue,
|
|
2521
|
+
filterable: items.length >= 8,
|
|
2522
|
+
onChange: onSelect,
|
|
2523
|
+
onClear: required ? void 0 : () => onSelect(null)
|
|
2524
|
+
}
|
|
2525
|
+
)
|
|
2405
2526
|
}
|
|
2406
|
-
)
|
|
2527
|
+
),
|
|
2407
2528
|
children
|
|
2408
2529
|
] });
|
|
2409
2530
|
}
|
|
@@ -2413,28 +2534,48 @@ import { useEffect as useEffect4 } from "react";
|
|
|
2413
2534
|
import { SegmentedControl } from "@transferwise/components";
|
|
2414
2535
|
import { Fragment as Fragment7, jsx as jsx43, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
2415
2536
|
function SegmentedInputRendererComponent(props) {
|
|
2416
|
-
const {
|
|
2537
|
+
const {
|
|
2538
|
+
id,
|
|
2539
|
+
children,
|
|
2540
|
+
description,
|
|
2541
|
+
help,
|
|
2542
|
+
label,
|
|
2543
|
+
options,
|
|
2544
|
+
selectedIndex,
|
|
2545
|
+
validationState,
|
|
2546
|
+
onSelect
|
|
2547
|
+
} = props;
|
|
2417
2548
|
useEffect4(() => {
|
|
2418
2549
|
if (!isValidIndex2(selectedIndex, options.length)) {
|
|
2419
2550
|
onSelect(0);
|
|
2420
2551
|
}
|
|
2421
2552
|
}, [selectedIndex, onSelect, options.length]);
|
|
2422
2553
|
return /* @__PURE__ */ jsxs16(Fragment7, { children: [
|
|
2423
|
-
/* @__PURE__ */ jsx43(
|
|
2424
|
-
|
|
2554
|
+
/* @__PURE__ */ jsx43(
|
|
2555
|
+
FieldInput_default,
|
|
2425
2556
|
{
|
|
2426
|
-
|
|
2427
|
-
|
|
2428
|
-
|
|
2429
|
-
|
|
2430
|
-
|
|
2431
|
-
|
|
2432
|
-
|
|
2433
|
-
|
|
2434
|
-
|
|
2435
|
-
|
|
2557
|
+
id,
|
|
2558
|
+
label,
|
|
2559
|
+
help,
|
|
2560
|
+
description,
|
|
2561
|
+
validation: validationState,
|
|
2562
|
+
children: /* @__PURE__ */ jsx43(
|
|
2563
|
+
SegmentedControl,
|
|
2564
|
+
{
|
|
2565
|
+
name: `${id}-segmented-control`,
|
|
2566
|
+
value: String(selectedIndex),
|
|
2567
|
+
mode: "view",
|
|
2568
|
+
segments: options.map((option, index) => ({
|
|
2569
|
+
id: String(index),
|
|
2570
|
+
value: String(index),
|
|
2571
|
+
label: option.title,
|
|
2572
|
+
controls: `${id}-children`
|
|
2573
|
+
})),
|
|
2574
|
+
onChange: (value) => onSelect(Number(value))
|
|
2575
|
+
}
|
|
2576
|
+
)
|
|
2436
2577
|
}
|
|
2437
|
-
)
|
|
2578
|
+
),
|
|
2438
2579
|
/* @__PURE__ */ jsx43("div", { id: `${id}-children`, children })
|
|
2439
2580
|
] });
|
|
2440
2581
|
}
|
|
@@ -2467,15 +2608,22 @@ var StatusListRenderer = {
|
|
|
2467
2608
|
canRenderType: "status-list",
|
|
2468
2609
|
render: ({ margin, items, title }) => /* @__PURE__ */ jsxs17("div", { className: getMargin(margin), children: [
|
|
2469
2610
|
title ? /* @__PURE__ */ jsx45(Header5, { title }) : null,
|
|
2470
|
-
items.map(({ description, icon, status, title: itemTitle }) => /* @__PURE__ */ jsx45(
|
|
2611
|
+
items.map(({ callToAction, description, icon, status, title: itemTitle }) => /* @__PURE__ */ jsx45(
|
|
2471
2612
|
Summary,
|
|
2472
2613
|
{
|
|
2473
2614
|
title: itemTitle,
|
|
2474
2615
|
description,
|
|
2475
2616
|
icon: icon && "name" in icon ? /* @__PURE__ */ jsx45(DynamicIcon_default, { name: icon.name }) : null,
|
|
2476
|
-
status: mapStatus(status)
|
|
2617
|
+
status: mapStatus(status),
|
|
2618
|
+
action: callToAction ? {
|
|
2619
|
+
"aria-label": callToAction.accessibilityDescription,
|
|
2620
|
+
href: callToAction.href,
|
|
2621
|
+
text: callToAction.title,
|
|
2622
|
+
target: callToAction.href ? "_blank" : void 0,
|
|
2623
|
+
onClick: callToAction.href ? void 0 : callToAction.onClick
|
|
2624
|
+
} : void 0
|
|
2477
2625
|
},
|
|
2478
|
-
`${
|
|
2626
|
+
`${itemTitle}/${description || ""}`
|
|
2479
2627
|
))
|
|
2480
2628
|
] })
|
|
2481
2629
|
};
|
|
@@ -2577,6 +2725,7 @@ var TextInputRenderer = {
|
|
|
2577
2725
|
maxLength,
|
|
2578
2726
|
minLength,
|
|
2579
2727
|
type,
|
|
2728
|
+
validationState,
|
|
2580
2729
|
value: initialValue
|
|
2581
2730
|
} = _a, rest = __objRest(_a, [
|
|
2582
2731
|
"id",
|
|
@@ -2588,11 +2737,22 @@ var TextInputRenderer = {
|
|
|
2588
2737
|
"maxLength",
|
|
2589
2738
|
"minLength",
|
|
2590
2739
|
"type",
|
|
2740
|
+
"validationState",
|
|
2591
2741
|
"value"
|
|
2592
2742
|
]);
|
|
2593
2743
|
const value = initialValue != null ? initialValue : "";
|
|
2594
2744
|
const inputProps = __spreadProps(__spreadValues({}, rest), { value, id });
|
|
2595
|
-
return /* @__PURE__ */ jsx47(
|
|
2745
|
+
return /* @__PURE__ */ jsx47(
|
|
2746
|
+
FieldInput_default,
|
|
2747
|
+
{
|
|
2748
|
+
id,
|
|
2749
|
+
label,
|
|
2750
|
+
description,
|
|
2751
|
+
validation: validationState,
|
|
2752
|
+
help,
|
|
2753
|
+
children: /* @__PURE__ */ jsx47(VariableTextInput_default, { control, inputProps })
|
|
2754
|
+
}
|
|
2755
|
+
);
|
|
2596
2756
|
}
|
|
2597
2757
|
};
|
|
2598
2758
|
var TextInputRenderer_default = TextInputRenderer;
|
|
@@ -2603,7 +2763,7 @@ import { jsx as jsx48 } from "react/jsx-runtime";
|
|
|
2603
2763
|
var UploadInputRenderer = {
|
|
2604
2764
|
canRenderType: "input-upload",
|
|
2605
2765
|
render: (props) => {
|
|
2606
|
-
const { id, accepts,
|
|
2766
|
+
const { id, accepts, label, description, disabled, maxSize, validationState, onUpload } = props;
|
|
2607
2767
|
const onUploadFile = async (formData) => {
|
|
2608
2768
|
const file = formData.get("file");
|
|
2609
2769
|
return onUpload(file).then(() => ({
|
|
@@ -2615,19 +2775,28 @@ var UploadInputRenderer = {
|
|
|
2615
2775
|
};
|
|
2616
2776
|
return (
|
|
2617
2777
|
// We don't pass help here as there is no sensible place to display it
|
|
2618
|
-
/* @__PURE__ */ jsx48(
|
|
2619
|
-
|
|
2778
|
+
/* @__PURE__ */ jsx48(
|
|
2779
|
+
UploadFieldInput_default,
|
|
2620
2780
|
{
|
|
2621
2781
|
id,
|
|
2622
|
-
|
|
2623
|
-
|
|
2624
|
-
|
|
2625
|
-
|
|
2626
|
-
|
|
2627
|
-
|
|
2628
|
-
|
|
2782
|
+
label: void 0,
|
|
2783
|
+
description: void 0,
|
|
2784
|
+
validation: validationState,
|
|
2785
|
+
children: /* @__PURE__ */ jsx48(
|
|
2786
|
+
UploadInput2,
|
|
2787
|
+
{
|
|
2788
|
+
id,
|
|
2789
|
+
description,
|
|
2790
|
+
disabled,
|
|
2791
|
+
fileTypes: getAcceptsString(accepts),
|
|
2792
|
+
sizeLimit: maxSize ? toKilobytes(maxSize) : void 0,
|
|
2793
|
+
uploadButtonTitle: label,
|
|
2794
|
+
onDeleteFile,
|
|
2795
|
+
onUploadFile
|
|
2796
|
+
}
|
|
2797
|
+
)
|
|
2629
2798
|
}
|
|
2630
|
-
)
|
|
2799
|
+
)
|
|
2631
2800
|
);
|
|
2632
2801
|
}
|
|
2633
2802
|
};
|
|
@@ -2642,10 +2811,10 @@ var LargeUploadRenderer = {
|
|
|
2642
2811
|
label,
|
|
2643
2812
|
description,
|
|
2644
2813
|
disabled,
|
|
2645
|
-
error,
|
|
2646
2814
|
help,
|
|
2647
2815
|
maxSize,
|
|
2648
2816
|
type,
|
|
2817
|
+
validationState,
|
|
2649
2818
|
onUpload
|
|
2650
2819
|
} = _a, rest = __objRest(_a, [
|
|
2651
2820
|
"id",
|
|
@@ -2654,10 +2823,10 @@ var LargeUploadRenderer = {
|
|
|
2654
2823
|
"label",
|
|
2655
2824
|
"description",
|
|
2656
2825
|
"disabled",
|
|
2657
|
-
"error",
|
|
2658
2826
|
"help",
|
|
2659
2827
|
"maxSize",
|
|
2660
2828
|
"type",
|
|
2829
|
+
"validationState",
|
|
2661
2830
|
"onUpload"
|
|
2662
2831
|
]);
|
|
2663
2832
|
const uploadProps = __spreadProps(__spreadValues({}, rest), { id, name: id });
|
|
@@ -2670,16 +2839,26 @@ var LargeUploadRenderer = {
|
|
|
2670
2839
|
throw e;
|
|
2671
2840
|
}
|
|
2672
2841
|
};
|
|
2673
|
-
return /* @__PURE__ */ jsx48(
|
|
2674
|
-
|
|
2675
|
-
|
|
2676
|
-
|
|
2677
|
-
|
|
2678
|
-
|
|
2679
|
-
|
|
2680
|
-
|
|
2681
|
-
|
|
2682
|
-
|
|
2842
|
+
return /* @__PURE__ */ jsx48(
|
|
2843
|
+
FieldInput_default,
|
|
2844
|
+
{
|
|
2845
|
+
id,
|
|
2846
|
+
label,
|
|
2847
|
+
description,
|
|
2848
|
+
validation: validationState,
|
|
2849
|
+
help,
|
|
2850
|
+
children: /* @__PURE__ */ jsx48(
|
|
2851
|
+
Upload,
|
|
2852
|
+
__spreadProps(__spreadValues({}, uploadProps), {
|
|
2853
|
+
usAccept: getAcceptsString(accepts),
|
|
2854
|
+
usDisabled: disabled,
|
|
2855
|
+
onSuccess: onUploadFile,
|
|
2856
|
+
onFailure: async () => onUpload(null),
|
|
2857
|
+
onCancel: async () => onUpload(null)
|
|
2858
|
+
})
|
|
2859
|
+
)
|
|
2860
|
+
}
|
|
2861
|
+
);
|
|
2683
2862
|
}
|
|
2684
2863
|
};
|
|
2685
2864
|
|
|
@@ -2776,7 +2955,7 @@ var external_confirmation_messages_default = defineMessages6({
|
|
|
2776
2955
|
});
|
|
2777
2956
|
|
|
2778
2957
|
// ../renderers/src/step/ExternalConfirmationDialog.tsx
|
|
2779
|
-
import { Button as
|
|
2958
|
+
import { Button as Button6, Markdown as Markdown5 } from "@transferwise/components";
|
|
2780
2959
|
import { jsx as jsx50, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
2781
2960
|
function ExternalConfirmationDialog({
|
|
2782
2961
|
external,
|
|
@@ -2788,7 +2967,7 @@ function ExternalConfirmationDialog({
|
|
|
2788
2967
|
/* @__PURE__ */ jsx50(Markdown5, { config: { link: { target: "_blank" } }, className: "text-xs-center m-b-5", children: formatMessage(external_confirmation_messages_default.description, { origin: getOrigin(external.url) }) }),
|
|
2789
2968
|
/* @__PURE__ */ jsx50("div", { className: "df-box-renderer-fixed-width", children: /* @__PURE__ */ jsxs19("div", { className: "df-box-renderer-width-lg", children: [
|
|
2790
2969
|
/* @__PURE__ */ jsx50(
|
|
2791
|
-
|
|
2970
|
+
Button6,
|
|
2792
2971
|
{
|
|
2793
2972
|
block: true,
|
|
2794
2973
|
className: "m-b-2",
|
|
@@ -2801,7 +2980,7 @@ function ExternalConfirmationDialog({
|
|
|
2801
2980
|
children: formatMessage(external_confirmation_messages_default.open)
|
|
2802
2981
|
}
|
|
2803
2982
|
),
|
|
2804
|
-
/* @__PURE__ */ jsx50(
|
|
2983
|
+
/* @__PURE__ */ jsx50(Button6, { block: true, className: "m-b-2", priority: "tertiary", size: "md", onClick: onClose, children: formatMessage(external_confirmation_messages_default.cancel) })
|
|
2805
2984
|
] }) })
|
|
2806
2985
|
] }) });
|
|
2807
2986
|
}
|
|
@@ -2835,15 +3014,13 @@ import { ArrowLeft } from "@transferwise/icons";
|
|
|
2835
3014
|
import { jsx as jsx51, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
2836
3015
|
function BackButton({ title, onClick }) {
|
|
2837
3016
|
return /* @__PURE__ */ jsx51("div", { className: "m-b-2", children: /* @__PURE__ */ jsxs20(
|
|
2838
|
-
"
|
|
3017
|
+
"button",
|
|
2839
3018
|
{
|
|
2840
|
-
|
|
3019
|
+
type: "button",
|
|
2841
3020
|
className: "df-back-btn",
|
|
3021
|
+
title,
|
|
2842
3022
|
"aria-label": title,
|
|
2843
|
-
onClick
|
|
2844
|
-
event.preventDefault();
|
|
2845
|
-
onClick();
|
|
2846
|
-
},
|
|
3023
|
+
onClick,
|
|
2847
3024
|
children: [
|
|
2848
3025
|
/* @__PURE__ */ jsx51("span", { className: "sr-only", children: title }),
|
|
2849
3026
|
/* @__PURE__ */ jsx51(Avatar4, { type: "icon", children: /* @__PURE__ */ jsx51(ArrowLeft, { size: "24" }) })
|