@wise/dynamic-flow-client-internal 5.31.0-experimental-a2135d6 → 5.31.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/dynamicFlow/DynamicFlow.js +11 -0
- package/build/dynamicFlow/DynamicFlowModal.js +21 -0
- package/build/dynamicFlow/DynamicFlowWiseProps.js +1 -0
- package/build/dynamicFlow/DynamicFlowWithRef.js +19 -0
- package/build/dynamicFlow/context-menu/useContextMenu.js +33 -0
- package/build/dynamicFlow/context-menu/useDFContextMenu.js +135 -0
- package/build/dynamicFlow/context-menu/useDFContextMenu.test.js +101 -0
- package/build/dynamicFlow/getMergedRenderers.js +36 -0
- package/build/dynamicFlow/messages.js +13 -0
- package/build/dynamicFlow/renderers.js +10 -0
- package/build/dynamicFlow/telemetry/app-version.js +4 -0
- package/build/dynamicFlow/telemetry/dispatchAnalyticsEvent.js +8 -0
- package/build/dynamicFlow/telemetry/getLogEvent.js +22 -0
- package/build/dynamicFlow/telemetry/getTrackEvent.js +39 -0
- package/build/dynamicFlow/telemetry/index.js +2 -0
- package/build/dynamicFlow/useCreateSnackBar.js +9 -0
- package/build/dynamicFlow/useOnCopy.js +16 -0
- package/build/dynamicFlow/useWiseHttpClient.js +24 -0
- package/build/dynamicFlow/useWiseToCoreProps.js +42 -0
- package/build/i18n/en.json +0 -2
- package/build/i18n/index.js +43 -0
- package/build/index.js +6 -0
- package/build/main.js +67 -296
- package/build/main.mjs +56 -286
- package/build/stories/ButtonLoader.story.js +109 -0
- package/build/stories/ContainerQueries.story.js +74 -0
- package/build/stories/DynamicFlow.story.js +37 -0
- package/build/stories/DynamicFlowWithRef.story.js +72 -0
- package/build/stories/Editable.story.js +58 -0
- package/build/stories/Initialisation.story.js +33 -0
- package/build/stories/PinnedButtons.story.js +94 -0
- package/build/stories/SCAIntegration.story.js +67 -0
- package/build/stories/utils/fixtureHttpClient.js +59 -0
- package/build/test-utils/NeptuneProviders.js +11 -0
- package/build/test-utils/index.js +4 -0
- package/build/test-utils/respond-with.js +6 -0
- package/build/test-utils/rtl-utils.js +7 -0
- package/build/test-utils/wait.js +3 -0
- package/build/tests/DynamicFlow.test.js +177 -0
- package/build/tests/HideStepTitle.test.js +58 -0
- package/build/tests/RequestCache.test.js +34 -0
- package/build/tests/SCARejectionHandling.test.js +71 -0
- package/build/tests/Subflow.Wise.test.js +650 -0
- package/build/tests/events.test.js +124 -0
- package/build/tests/logging.test.js +12 -0
- package/build/tests/onNotification.test.js +96 -0
- package/build/tests/renderers/ControlAndTags.test.js +225 -0
- package/build/tests/renderers/ImageRenderer.test.js +129 -0
- package/build/tests/renderers/RadioInputRendererComponent.test.js +89 -0
- package/build/tests/renderers/ReviewRenderer.test.js +41 -0
- package/build/tests/renderers/TextInputRenderer.test.js +44 -0
- package/build/tests/renderers/TimeZoneHeader.test.js +19 -0
- package/build/tests/renderers/UploadInputRenderer.maxSize.test.js +22 -0
- package/build/tests/renderers/value-utils.test.js +24 -0
- package/build/tsconfig.types.tsbuildinfo +1 -1
- package/package.json +4 -4
package/build/main.js
CHANGED
|
@@ -146,7 +146,7 @@ var import_dynamic_flow_client4 = require("@wise/dynamic-flow-client");
|
|
|
146
146
|
// src/dynamicFlow/telemetry/app-version.ts
|
|
147
147
|
var appVersion = (
|
|
148
148
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
|
149
|
-
typeof process !== "undefined" ? "5.
|
|
149
|
+
typeof process !== "undefined" ? "5.31.0" : "0.0.0"
|
|
150
150
|
);
|
|
151
151
|
|
|
152
152
|
// src/dynamicFlow/context-menu/useContextMenu.tsx
|
|
@@ -336,7 +336,7 @@ var recursivelyRemoveNullish = (element) => {
|
|
|
336
336
|
};
|
|
337
337
|
|
|
338
338
|
// src/dynamicFlow/useWiseToCoreProps.tsx
|
|
339
|
-
var
|
|
339
|
+
var import_react30 = require("react");
|
|
340
340
|
|
|
341
341
|
// src/dynamicFlow/getMergedRenderers.tsx
|
|
342
342
|
var import_dynamic_flow_client2 = require("@wise/dynamic-flow-client");
|
|
@@ -6779,101 +6779,9 @@ function ChipsTabsRendererComponent({ margin, tabs, control, tags }) {
|
|
|
6779
6779
|
|
|
6780
6780
|
// ../renderers/src/TextInputRenderer.tsx
|
|
6781
6781
|
var import_components69 = require("@transferwise/components");
|
|
6782
|
-
var import_react28 = require("react");
|
|
6783
6782
|
|
|
6784
6783
|
// ../renderers/src/components/VariableTextInput.tsx
|
|
6785
6784
|
var import_components68 = require("@transferwise/components");
|
|
6786
|
-
var import_icons7 = require("@transferwise/icons");
|
|
6787
|
-
var import_react_intl36 = require("react-intl");
|
|
6788
|
-
var import_react27 = require("react");
|
|
6789
|
-
|
|
6790
|
-
// ../renderers/src/messages/ssn-input.messages.ts
|
|
6791
|
-
var import_react_intl35 = require("react-intl");
|
|
6792
|
-
var ssn_input_messages_default = (0, import_react_intl35.defineMessages)({
|
|
6793
|
-
showValue: {
|
|
6794
|
-
id: "df.wise.ssnInput.showValue",
|
|
6795
|
-
defaultMessage: "Show value",
|
|
6796
|
-
description: "Accessible label for showing a masked SSN or SIN value"
|
|
6797
|
-
},
|
|
6798
|
-
hideValue: {
|
|
6799
|
-
id: "df.wise.ssnInput.hideValue",
|
|
6800
|
-
defaultMessage: "Hide value",
|
|
6801
|
-
description: "Accessible label for hiding an SSN or SIN value"
|
|
6802
|
-
}
|
|
6803
|
-
});
|
|
6804
|
-
|
|
6805
|
-
// ../renderers/src/components/ssnInputUtils.ts
|
|
6806
|
-
function formatSsnValue(rawValue, displayFormat, isVisible) {
|
|
6807
|
-
if (!displayFormat) {
|
|
6808
|
-
return isVisible ? rawValue : "\u2022".repeat(rawValue.length);
|
|
6809
|
-
}
|
|
6810
|
-
const formattedValue = displayFormat.split("").reduce(
|
|
6811
|
-
({ display, digitsUsed }, character) => {
|
|
6812
|
-
if (character === "*") {
|
|
6813
|
-
return digitsUsed < rawValue.length ? {
|
|
6814
|
-
display: `${display}${isVisible ? rawValue[digitsUsed] : "\u2022"}`,
|
|
6815
|
-
digitsUsed: digitsUsed + 1
|
|
6816
|
-
} : { display, digitsUsed };
|
|
6817
|
-
}
|
|
6818
|
-
return digitsUsed > 0 && digitsUsed < rawValue.length ? { display: `${display}${character}`, digitsUsed } : { display, digitsUsed };
|
|
6819
|
-
},
|
|
6820
|
-
{ display: "", digitsUsed: 0 }
|
|
6821
|
-
).display;
|
|
6822
|
-
const displayFormatDigitCount = displayFormat.split("").filter((character) => character === "*").length;
|
|
6823
|
-
const extraValue = rawValue.slice(displayFormatDigitCount);
|
|
6824
|
-
return `${formattedValue}${isVisible ? extraValue : "\u2022".repeat(extraValue.length)}`;
|
|
6825
|
-
}
|
|
6826
|
-
function getRawOffset(displayValue, displayOffset, rawValueLength) {
|
|
6827
|
-
return Math.min(
|
|
6828
|
-
displayValue.slice(0, displayOffset).split("").filter((character) => character === "\u2022" || /\d/.test(character)).length,
|
|
6829
|
-
rawValueLength
|
|
6830
|
-
);
|
|
6831
|
-
}
|
|
6832
|
-
function replaceSsnSelection(rawValue, displayValue, insertedValue, start, end) {
|
|
6833
|
-
const startOffset = getRawOffset(displayValue, start, rawValue.length);
|
|
6834
|
-
const endOffset = getRawOffset(displayValue, end, rawValue.length);
|
|
6835
|
-
if (!insertedValue) {
|
|
6836
|
-
return void 0;
|
|
6837
|
-
}
|
|
6838
|
-
return {
|
|
6839
|
-
value: `${rawValue.slice(0, startOffset)}${insertedValue}${rawValue.slice(endOffset)}`,
|
|
6840
|
-
caret: startOffset + insertedValue.length
|
|
6841
|
-
};
|
|
6842
|
-
}
|
|
6843
|
-
function deleteSsnSelection(rawValue, displayValue, start, end, backward) {
|
|
6844
|
-
let startOffset = getRawOffset(displayValue, start, rawValue.length);
|
|
6845
|
-
let endOffset = getRawOffset(displayValue, end, rawValue.length);
|
|
6846
|
-
if (startOffset === endOffset) {
|
|
6847
|
-
if (backward) {
|
|
6848
|
-
startOffset = Math.max(0, startOffset - 1);
|
|
6849
|
-
} else {
|
|
6850
|
-
endOffset = Math.min(rawValue.length, endOffset + 1);
|
|
6851
|
-
}
|
|
6852
|
-
}
|
|
6853
|
-
return {
|
|
6854
|
-
value: `${rawValue.slice(0, startOffset)}${rawValue.slice(endOffset)}`,
|
|
6855
|
-
caret: startOffset
|
|
6856
|
-
};
|
|
6857
|
-
}
|
|
6858
|
-
function getDisplayOffset(displayValue, rawOffset) {
|
|
6859
|
-
if (rawOffset === 0) {
|
|
6860
|
-
return 0;
|
|
6861
|
-
}
|
|
6862
|
-
let displayOffset = 0;
|
|
6863
|
-
let digitsSeen = 0;
|
|
6864
|
-
for (const character of displayValue) {
|
|
6865
|
-
if (character === "\u2022" || /\d/.test(character)) {
|
|
6866
|
-
digitsSeen += 1;
|
|
6867
|
-
if (digitsSeen === rawOffset) {
|
|
6868
|
-
return displayOffset + 1;
|
|
6869
|
-
}
|
|
6870
|
-
}
|
|
6871
|
-
displayOffset += 1;
|
|
6872
|
-
}
|
|
6873
|
-
return displayOffset;
|
|
6874
|
-
}
|
|
6875
|
-
|
|
6876
|
-
// ../renderers/src/components/VariableTextInput.tsx
|
|
6877
6785
|
var import_jsx_runtime100 = require("react/jsx-runtime");
|
|
6878
6786
|
var commonKeys = [
|
|
6879
6787
|
"autoComplete",
|
|
@@ -6889,15 +6797,13 @@ var commonKeys = [
|
|
|
6889
6797
|
"value"
|
|
6890
6798
|
];
|
|
6891
6799
|
function VariableTextInput(inputProps) {
|
|
6892
|
-
const { id, value, control, onChange
|
|
6800
|
+
const { id, value, control, onChange } = inputProps;
|
|
6893
6801
|
const commonProps = __spreadProps(__spreadValues({}, pick(inputProps, ...commonKeys)), { name: id });
|
|
6894
6802
|
switch (control) {
|
|
6895
6803
|
case "email":
|
|
6896
6804
|
return /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(TextInput, __spreadProps(__spreadValues({}, commonProps), { type: "email", onChange }));
|
|
6897
6805
|
case "password":
|
|
6898
6806
|
return /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(TextInput, __spreadProps(__spreadValues({}, commonProps), { type: "password", onChange }));
|
|
6899
|
-
case "ssn-input":
|
|
6900
|
-
return /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(SsnInput, __spreadProps(__spreadValues({}, commonProps), { isVisible: isSsnVisible, onChange }));
|
|
6901
6807
|
case "numeric": {
|
|
6902
6808
|
const numericProps = __spreadProps(__spreadValues({}, commonProps), { type: "number", onWheel });
|
|
6903
6809
|
return /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(
|
|
@@ -6917,198 +6823,65 @@ function VariableTextInput(inputProps) {
|
|
|
6917
6823
|
}
|
|
6918
6824
|
}
|
|
6919
6825
|
}
|
|
6920
|
-
function SsnInputToggle({
|
|
6921
|
-
isVisible,
|
|
6922
|
-
onClick
|
|
6923
|
-
}) {
|
|
6924
|
-
const { formatMessage } = (0, import_react_intl36.useIntl)();
|
|
6925
|
-
return /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(
|
|
6926
|
-
import_components68.IconButton,
|
|
6927
|
-
{
|
|
6928
|
-
priority: "minimal",
|
|
6929
|
-
size: 24,
|
|
6930
|
-
"aria-label": formatMessage(isVisible ? ssn_input_messages_default.hideValue : ssn_input_messages_default.showValue),
|
|
6931
|
-
"aria-pressed": isVisible,
|
|
6932
|
-
onClick,
|
|
6933
|
-
children: isVisible ? /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(import_icons7.EyeShut, { size: 24 }) : /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(import_icons7.Eye, { size: 24 })
|
|
6934
|
-
}
|
|
6935
|
-
);
|
|
6936
|
-
}
|
|
6937
6826
|
function TextInput(props) {
|
|
6938
|
-
const _a = props, { control, displayFormat, onChange
|
|
6827
|
+
const _a = props, { control, displayFormat, onChange } = _a, commonProps = __objRest(_a, ["control", "displayFormat", "onChange"]);
|
|
6939
6828
|
const InputWithPattern = control === "textarea" ? import_components68.TextareaWithDisplayFormat : import_components68.InputWithDisplayFormat;
|
|
6940
6829
|
const InputWithoutPattern = control === "textarea" ? import_components68.TextArea : import_components68.Input;
|
|
6941
|
-
return displayFormat ? /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(InputWithPattern, __spreadProps(__spreadValues({ displayPattern: displayFormat }, commonProps), { onChange })) : /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(InputWithoutPattern, __spreadProps(__spreadValues({}, commonProps), {
|
|
6942
|
-
}
|
|
6943
|
-
function SsnInput(props) {
|
|
6944
|
-
const _a = props, { displayFormat = "", isVisible = false, onChange, value = "" } = _a, commonProps = __objRest(_a, ["displayFormat", "isVisible", "onChange", "value"]);
|
|
6945
|
-
const [editVersion, setEditVersion] = (0, import_react27.useState)(0);
|
|
6946
|
-
const inputRef = (0, import_react27.useRef)(null);
|
|
6947
|
-
const selection = (0, import_react27.useRef)({ start: 0, end: 0 });
|
|
6948
|
-
const pendingCaret = (0, import_react27.useRef)(null);
|
|
6949
|
-
const rawValue = value.replace(/\D/g, "");
|
|
6950
|
-
const formattedValue = formatSsnValue(rawValue, displayFormat, isVisible);
|
|
6951
|
-
const scheduleCaret = (rawOffset) => {
|
|
6952
|
-
pendingCaret.current = rawOffset;
|
|
6953
|
-
setEditVersion((version) => version + 1);
|
|
6954
|
-
};
|
|
6955
|
-
const replaceSelection = (insertedValue, start, end) => {
|
|
6956
|
-
const result = replaceSsnSelection(rawValue, formattedValue, insertedValue, start, end);
|
|
6957
|
-
if (!result) {
|
|
6958
|
-
return;
|
|
6959
|
-
}
|
|
6960
|
-
scheduleCaret(result.caret);
|
|
6961
|
-
onChange(result.value);
|
|
6962
|
-
};
|
|
6963
|
-
const deleteSelection = (start, end, backward) => {
|
|
6964
|
-
const result = deleteSsnSelection(rawValue, formattedValue, start, end, backward);
|
|
6965
|
-
scheduleCaret(result.caret);
|
|
6966
|
-
onChange(result.value);
|
|
6967
|
-
};
|
|
6968
|
-
(0, import_react27.useLayoutEffect)(() => {
|
|
6969
|
-
if (pendingCaret.current === null || !inputRef.current) {
|
|
6970
|
-
return;
|
|
6971
|
-
}
|
|
6972
|
-
inputRef.current.setSelectionRange(
|
|
6973
|
-
getDisplayOffset(formattedValue, pendingCaret.current),
|
|
6974
|
-
getDisplayOffset(formattedValue, pendingCaret.current)
|
|
6975
|
-
);
|
|
6976
|
-
pendingCaret.current = null;
|
|
6977
|
-
}, [editVersion, formattedValue, rawValue]);
|
|
6978
|
-
return /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(
|
|
6979
|
-
"input",
|
|
6980
|
-
__spreadProps(__spreadValues({
|
|
6981
|
-
ref: inputRef
|
|
6982
|
-
}, commonProps), {
|
|
6983
|
-
className: "form-control np-form-control np-input np-input--shape-rectangle",
|
|
6984
|
-
type: "text",
|
|
6985
|
-
inputMode: "numeric",
|
|
6986
|
-
value: formattedValue,
|
|
6987
|
-
onChange: (event) => {
|
|
6988
|
-
const nextValue = event.currentTarget.value;
|
|
6989
|
-
const inputType = event.nativeEvent.inputType;
|
|
6990
|
-
const start = selection.current.start;
|
|
6991
|
-
const end = selection.current.end;
|
|
6992
|
-
if (isVisible || /^\d+$/.test(nextValue)) {
|
|
6993
|
-
const nextRawValue = nextValue.replace(/\D/g, "");
|
|
6994
|
-
scheduleCaret(nextRawValue.length);
|
|
6995
|
-
onChange(nextRawValue);
|
|
6996
|
-
} else if ((inputType == null ? void 0 : inputType.startsWith("delete")) || nextValue.length < formattedValue.length) {
|
|
6997
|
-
deleteSelection(start, end, inputType === "deleteContentBackward");
|
|
6998
|
-
} else {
|
|
6999
|
-
replaceSelection(nextValue.replace(/\D/g, ""), start, end);
|
|
7000
|
-
}
|
|
7001
|
-
},
|
|
7002
|
-
onSelect: (event) => {
|
|
7003
|
-
var _a2, _b;
|
|
7004
|
-
selection.current = {
|
|
7005
|
-
start: (_a2 = event.currentTarget.selectionStart) != null ? _a2 : 0,
|
|
7006
|
-
end: (_b = event.currentTarget.selectionEnd) != null ? _b : 0
|
|
7007
|
-
};
|
|
7008
|
-
},
|
|
7009
|
-
onKeyDown: (event) => {
|
|
7010
|
-
var _a2, _b;
|
|
7011
|
-
selection.current = {
|
|
7012
|
-
start: (_a2 = event.currentTarget.selectionStart) != null ? _a2 : 0,
|
|
7013
|
-
end: (_b = event.currentTarget.selectionEnd) != null ? _b : 0
|
|
7014
|
-
};
|
|
7015
|
-
if (/^\d$/.test(event.key)) {
|
|
7016
|
-
event.preventDefault();
|
|
7017
|
-
replaceSelection(event.key, selection.current.start, selection.current.end);
|
|
7018
|
-
} else if (event.key === "Backspace") {
|
|
7019
|
-
event.preventDefault();
|
|
7020
|
-
deleteSelection(selection.current.start, selection.current.end, true);
|
|
7021
|
-
} else if (event.key === "Delete") {
|
|
7022
|
-
event.preventDefault();
|
|
7023
|
-
deleteSelection(selection.current.start, selection.current.end, false);
|
|
7024
|
-
}
|
|
7025
|
-
},
|
|
7026
|
-
onPaste: (event) => {
|
|
7027
|
-
var _a2, _b;
|
|
7028
|
-
event.preventDefault();
|
|
7029
|
-
selection.current = {
|
|
7030
|
-
start: (_a2 = event.currentTarget.selectionStart) != null ? _a2 : 0,
|
|
7031
|
-
end: (_b = event.currentTarget.selectionEnd) != null ? _b : 0
|
|
7032
|
-
};
|
|
7033
|
-
const pastedValue = event.clipboardData.getData("text").replace(/\D/g, "");
|
|
7034
|
-
replaceSelection(pastedValue, selection.current.start, selection.current.end);
|
|
7035
|
-
}
|
|
7036
|
-
})
|
|
7037
|
-
);
|
|
6830
|
+
return displayFormat ? /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(InputWithPattern, __spreadProps(__spreadValues({ displayPattern: displayFormat }, commonProps), { onChange })) : /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(InputWithoutPattern, __spreadProps(__spreadValues({}, commonProps), { onChange: (e) => onChange(e.target.value) }));
|
|
7038
6831
|
}
|
|
7039
6832
|
|
|
7040
6833
|
// ../renderers/src/TextInputRenderer.tsx
|
|
7041
6834
|
var import_jsx_runtime101 = require("react/jsx-runtime");
|
|
7042
6835
|
var TextInputRenderer = {
|
|
7043
6836
|
canRenderType: "input-text",
|
|
7044
|
-
render: (props) =>
|
|
7045
|
-
|
|
7046
|
-
function TextInputRendererComponent(props) {
|
|
7047
|
-
const [isSsnVisible, setIsSsnVisible] = (0, import_react28.useState)(false);
|
|
7048
|
-
const _a = props, {
|
|
7049
|
-
id,
|
|
7050
|
-
title,
|
|
7051
|
-
description,
|
|
7052
|
-
help,
|
|
7053
|
-
media,
|
|
7054
|
-
validationState,
|
|
7055
|
-
value: initialValue,
|
|
7056
|
-
onChange
|
|
7057
|
-
} = _a, rest = __objRest(_a, [
|
|
7058
|
-
"id",
|
|
7059
|
-
"title",
|
|
7060
|
-
"description",
|
|
7061
|
-
"help",
|
|
7062
|
-
"media",
|
|
7063
|
-
"validationState",
|
|
7064
|
-
"value",
|
|
7065
|
-
"onChange"
|
|
7066
|
-
]);
|
|
7067
|
-
const value = initialValue != null ? initialValue : "";
|
|
7068
|
-
const isSsnInput = props.control === "ssn-input";
|
|
7069
|
-
const inputProps = __spreadProps(__spreadValues({}, rest), {
|
|
7070
|
-
value,
|
|
7071
|
-
id,
|
|
7072
|
-
isSsnVisible,
|
|
7073
|
-
onChange: (newValue) => {
|
|
7074
|
-
if ((value != null ? value : "") !== (newValue != null ? newValue : "")) {
|
|
7075
|
-
onChange(newValue);
|
|
7076
|
-
}
|
|
7077
|
-
}
|
|
7078
|
-
});
|
|
7079
|
-
return /* @__PURE__ */ (0, import_jsx_runtime101.jsx)(
|
|
7080
|
-
FieldInput_default,
|
|
7081
|
-
{
|
|
6837
|
+
render: (props) => {
|
|
6838
|
+
const _a = props, {
|
|
7082
6839
|
id,
|
|
7083
|
-
|
|
6840
|
+
title,
|
|
7084
6841
|
description,
|
|
7085
|
-
validation: validationState,
|
|
7086
|
-
inlineAlert: props.inlineAlert,
|
|
7087
|
-
loadingState: props.fieldLoadingState,
|
|
7088
6842
|
help,
|
|
7089
|
-
|
|
7090
|
-
|
|
7091
|
-
|
|
7092
|
-
|
|
7093
|
-
|
|
7094
|
-
|
|
7095
|
-
|
|
7096
|
-
|
|
7097
|
-
|
|
7098
|
-
|
|
7099
|
-
|
|
7100
|
-
|
|
7101
|
-
|
|
7102
|
-
|
|
7103
|
-
|
|
7104
|
-
|
|
7105
|
-
|
|
7106
|
-
|
|
6843
|
+
media,
|
|
6844
|
+
validationState,
|
|
6845
|
+
value: initialValue,
|
|
6846
|
+
onChange
|
|
6847
|
+
} = _a, rest = __objRest(_a, [
|
|
6848
|
+
"id",
|
|
6849
|
+
"title",
|
|
6850
|
+
"description",
|
|
6851
|
+
"help",
|
|
6852
|
+
"media",
|
|
6853
|
+
"validationState",
|
|
6854
|
+
"value",
|
|
6855
|
+
"onChange"
|
|
6856
|
+
]);
|
|
6857
|
+
const value = initialValue != null ? initialValue : "";
|
|
6858
|
+
const inputProps = __spreadProps(__spreadValues({}, rest), {
|
|
6859
|
+
value,
|
|
6860
|
+
id,
|
|
6861
|
+
onChange: (newValue) => {
|
|
6862
|
+
if ((value != null ? value : "") !== (newValue != null ? newValue : "")) {
|
|
6863
|
+
onChange(newValue);
|
|
7107
6864
|
}
|
|
7108
|
-
|
|
7109
|
-
}
|
|
7110
|
-
|
|
7111
|
-
|
|
6865
|
+
}
|
|
6866
|
+
});
|
|
6867
|
+
return /* @__PURE__ */ (0, import_jsx_runtime101.jsx)(
|
|
6868
|
+
FieldInput_default,
|
|
6869
|
+
{
|
|
6870
|
+
id,
|
|
6871
|
+
label: title,
|
|
6872
|
+
description,
|
|
6873
|
+
validation: validationState,
|
|
6874
|
+
inlineAlert: props.inlineAlert,
|
|
6875
|
+
loadingState: props.fieldLoadingState,
|
|
6876
|
+
help,
|
|
6877
|
+
features: props.features,
|
|
6878
|
+
control: props.control,
|
|
6879
|
+
tags: props.tags,
|
|
6880
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime101.jsx)(import_components69.InputGroup, { addonStart: getInputGroupAddonStart(media), children: /* @__PURE__ */ (0, import_jsx_runtime101.jsx)(VariableTextInput, __spreadValues({}, inputProps)) })
|
|
6881
|
+
}
|
|
6882
|
+
);
|
|
6883
|
+
}
|
|
6884
|
+
};
|
|
7112
6885
|
var TextInputRenderer_default = TextInputRenderer;
|
|
7113
6886
|
|
|
7114
6887
|
// ../renderers/src/UpdatableRenderer.tsx
|
|
@@ -7266,7 +7039,7 @@ var LargeUploadRenderer = {
|
|
|
7266
7039
|
// ../renderers/src/UpsellRenderer.tsx
|
|
7267
7040
|
var import_components71 = require("@transferwise/components");
|
|
7268
7041
|
var import_classnames35 = __toESM(require_classnames());
|
|
7269
|
-
var
|
|
7042
|
+
var import_react27 = require("react");
|
|
7270
7043
|
var import_jsx_runtime104 = require("react/jsx-runtime");
|
|
7271
7044
|
var UpsellRenderer = {
|
|
7272
7045
|
canRenderType: "upsell",
|
|
@@ -7274,7 +7047,7 @@ var UpsellRenderer = {
|
|
|
7274
7047
|
};
|
|
7275
7048
|
function UpsellRendererComponent(props) {
|
|
7276
7049
|
const { text, callToAction, media, margin, onDismiss, control, tags } = props;
|
|
7277
|
-
const [isVisible, setIsVisible] = (0,
|
|
7050
|
+
const [isVisible, setIsVisible] = (0, import_react27.useState)(true);
|
|
7278
7051
|
return isVisible ? /* @__PURE__ */ (0, import_jsx_runtime104.jsx)(
|
|
7279
7052
|
import_components71.Nudge,
|
|
7280
7053
|
{
|
|
@@ -7503,12 +7276,12 @@ var customEventsToAnalytics = {
|
|
|
7503
7276
|
};
|
|
7504
7277
|
|
|
7505
7278
|
// src/dynamicFlow/useOnCopy.tsx
|
|
7506
|
-
var
|
|
7507
|
-
var
|
|
7279
|
+
var import_react28 = require("react");
|
|
7280
|
+
var import_react_intl36 = require("react-intl");
|
|
7508
7281
|
|
|
7509
7282
|
// src/dynamicFlow/messages.ts
|
|
7510
|
-
var
|
|
7511
|
-
var messages_default = (0,
|
|
7283
|
+
var import_react_intl35 = require("react-intl");
|
|
7284
|
+
var messages_default = (0, import_react_intl35.defineMessages)({
|
|
7512
7285
|
copied: {
|
|
7513
7286
|
id: "df.wise.CopyFeedback.copy",
|
|
7514
7287
|
defaultMessage: "Copied to clipboard",
|
|
@@ -7523,9 +7296,9 @@ var messages_default = (0, import_react_intl37.defineMessages)({
|
|
|
7523
7296
|
|
|
7524
7297
|
// src/dynamicFlow/useOnCopy.tsx
|
|
7525
7298
|
var useOnCopy = () => {
|
|
7526
|
-
const { formatMessage } = (0,
|
|
7299
|
+
const { formatMessage } = (0, import_react_intl36.useIntl)();
|
|
7527
7300
|
const createSnackBar = useSnackBarIfAvailable();
|
|
7528
|
-
return (0,
|
|
7301
|
+
return (0, import_react28.useCallback)(
|
|
7529
7302
|
(copiedContent) => {
|
|
7530
7303
|
if (copiedContent) {
|
|
7531
7304
|
createSnackBar({ text: formatMessage(messages_default.copied) });
|
|
@@ -7538,11 +7311,11 @@ var useOnCopy = () => {
|
|
|
7538
7311
|
};
|
|
7539
7312
|
|
|
7540
7313
|
// src/dynamicFlow/useWiseHttpClient.tsx
|
|
7541
|
-
var
|
|
7542
|
-
var
|
|
7314
|
+
var import_react29 = require("react");
|
|
7315
|
+
var import_react_intl37 = require("react-intl");
|
|
7543
7316
|
var useWiseHttpClient = (httpClient) => {
|
|
7544
|
-
const { locale } = (0,
|
|
7545
|
-
return (0,
|
|
7317
|
+
const { locale } = (0, import_react_intl37.useIntl)();
|
|
7318
|
+
return (0, import_react29.useCallback)(
|
|
7546
7319
|
async (input, init = {}) => {
|
|
7547
7320
|
const headers = new Headers(init.headers);
|
|
7548
7321
|
headers.set("accept-language", locale);
|
|
@@ -7583,10 +7356,10 @@ var useWiseToCoreProps = (props) => {
|
|
|
7583
7356
|
onLog
|
|
7584
7357
|
} = props;
|
|
7585
7358
|
const httpClient = useWiseHttpClient(customFetch);
|
|
7586
|
-
const mergedRenderers = (0,
|
|
7359
|
+
const mergedRenderers = (0, import_react30.useMemo)(() => getMergedRenderers(props), [renderers]);
|
|
7587
7360
|
const createSnackBar = useCreateSnackBar();
|
|
7588
|
-
const logEvent = (0,
|
|
7589
|
-
const trackEvent = (0,
|
|
7361
|
+
const logEvent = (0, import_react30.useMemo)(() => getLogEvent(onLog), [onLog]);
|
|
7362
|
+
const trackEvent = (0, import_react30.useMemo)(() => getTrackEvent(onEvent, onAnalytics), [onEvent, onAnalytics]);
|
|
7590
7363
|
const onCopy = useOnCopy();
|
|
7591
7364
|
return __spreadProps(__spreadValues({}, props), {
|
|
7592
7365
|
httpClient,
|
|
@@ -7634,14 +7407,14 @@ function DynamicFlow(props) {
|
|
|
7634
7407
|
}
|
|
7635
7408
|
|
|
7636
7409
|
// src/dynamicFlow/DynamicFlowWithRef.tsx
|
|
7637
|
-
var
|
|
7410
|
+
var import_react31 = require("react");
|
|
7638
7411
|
var import_dynamic_flow_client5 = require("@wise/dynamic-flow-client");
|
|
7639
7412
|
var import_jsx_runtime109 = require("react/jsx-runtime");
|
|
7640
|
-
var DynamicFlowWithRef = (0,
|
|
7413
|
+
var DynamicFlowWithRef = (0, import_react31.forwardRef)(function DynamicFlowWithRef2(props, ref) {
|
|
7641
7414
|
const { className = "" } = props;
|
|
7642
7415
|
const dfProps = useWiseToCoreProps(props);
|
|
7643
7416
|
const df = (0, import_dynamic_flow_client5.useDynamicFlow)(dfProps);
|
|
7644
|
-
(0,
|
|
7417
|
+
(0, import_react31.useImperativeHandle)(
|
|
7645
7418
|
ref,
|
|
7646
7419
|
() => ({
|
|
7647
7420
|
getValue: () => {
|
|
@@ -7814,8 +7587,6 @@ var en_default = {
|
|
|
7814
7587
|
"df.wise.group.currencies-with-account-details": "Currencies with account details",
|
|
7815
7588
|
"df.wise.group.popular": "Popular",
|
|
7816
7589
|
"df.wise.group.recent": "Recent",
|
|
7817
|
-
"df.wise.ssnInput.hideValue": "Hide value",
|
|
7818
|
-
"df.wise.ssnInput.showValue": "Show value",
|
|
7819
7590
|
"df.wise.step.scrollToBottom": "Scroll to bottom"
|
|
7820
7591
|
};
|
|
7821
7592
|
|