@wise/dynamic-flow-client 3.9.4 → 3.10.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.js +1251 -950
- package/build/main.min.js +1 -1
- package/build/main.mjs +914 -613
- package/build/types/legacy/dynamicFlow/tests/DynamicFlow.InitialAction.spec.d.ts +1 -0
- package/build/types/legacy/dynamicFlow/tests/DynamicFlow.InitialStep.spec.d.ts +1 -0
- package/build/types/legacy/dynamicFlow/tests/DynamicFlow.LoaderConfig.spec.d.ts +1 -0
- package/build/types/legacy/dynamicFlow/tests/DynamicFlow.legacy.spec.d.ts +1 -0
- package/build/types/legacy/formControl/FormControl.spec.d.ts +1 -0
- package/build/types/legacy/jsonSchemaForm/JsonSchemaForm.spec.d.ts +1 -0
- package/build/types/legacy/jsonSchemaForm/arrayTypeSchema/ArrayTypeSchema.spec.d.ts +1 -0
- package/build/types/legacy/jsonSchemaForm/basicTypeSchema/BasicTypeSchema.errors.spec.d.ts +1 -0
- package/build/types/legacy/jsonSchemaForm/basicTypeSchema/BasicTypeSchema.spec.d.ts +1 -0
- package/build/types/legacy/jsonSchemaForm/controlFeedback/ControlFeedback.spec.d.ts +1 -0
- package/build/types/legacy/jsonSchemaForm/genericSchema/GenericSchema.spec.d.ts +1 -0
- package/build/types/legacy/jsonSchemaForm/help/Help.spec.d.ts +1 -0
- package/build/types/legacy/jsonSchemaForm/persistAsyncSchema/persistAsyncBlobSchema/UploadInputAdapter.spec.d.ts +1 -0
- package/build/types/legacy/jsonSchemaForm/promotedOneOfSchema/PromotedOneOfSchema.spec.d.ts +1 -0
- package/build/types/legacy/jsonSchemaForm/promotedOneOfSchema/promotedOneOfControl/PromotedOneOfCheckboxControl.spec.d.ts +1 -0
- package/build/types/legacy/jsonSchemaForm/promotedOneOfSchema/promotedOneOfControl/PromotedOneOfControl.spec.d.ts +1 -0
- package/build/types/legacy/jsonSchemaForm/promotedOneOfSchema/promotedOneOfControl/PromotedOneOfRadioControl.spec.d.ts +1 -0
- package/build/types/legacy/jsonSchemaForm/readOnlySchema/ReadOnlySchema.spec.d.ts +1 -0
- package/build/types/legacy/layout/DynamicLayout.end-to-end.spec.d.ts +1 -0
- package/build/types/legacy/layout/DynamicLayout.spec.d.ts +1 -0
- package/build/types/legacy/layout/alert/DynamicAlert.spec.d.ts +1 -0
- package/build/types/legacy/layout/box/DynamicBox.spec.d.ts +1 -0
- package/build/types/legacy/layout/columns/DynamicColumns.spec.d.ts +1 -0
- package/build/types/legacy/layout/decision/DynamicDecision.spec.d.ts +1 -0
- package/build/types/legacy/layout/divider/DynamicDivider.spec.d.ts +1 -0
- package/build/types/legacy/layout/external/DynamicExternal.spec.d.ts +1 -0
- package/build/types/legacy/layout/form/DynamicForm.spec.d.ts +1 -0
- package/build/types/legacy/layout/heading/DynamicHeading.spec.d.ts +1 -0
- package/build/types/legacy/layout/paragraph/DynamicParagraph.spec.d.ts +1 -0
- package/build/types/legacy/step/layoutStep/LayoutStep.spec.d.ts +1 -0
- package/build/types/revamp/domain/components/MultiSelectInputComponent.d.ts +28 -0
- package/build/types/revamp/domain/components/utils/local-value.d.ts +2 -0
- package/build/types/revamp/domain/features/persistAsync/getComponentPersistAsync.d.ts +2 -1
- package/build/types/revamp/domain/features/validationAsync/getComponentValidationAsync.d.ts +2 -1
- package/build/types/revamp/domain/mappers/schema/arraySchemaToComponent/arraySchemaToComponent.d.ts +1 -1
- package/build/types/revamp/domain/mappers/schema/arraySchemaToComponent/arraySchemaToMultiSelectComponent.d.ts +8 -0
- package/build/types/revamp/domain/types.d.ts +4 -3
- package/build/types/revamp/renderers/mappers/multiSelectComponentToProps.d.ts +3 -0
- package/build/types/revamp/renderers/types.d.ts +9 -1
- package/build/types/revamp/types.d.ts +2 -2
- package/build/types/revamp/wise/renderers/MultiSelectInputRenderer.d.ts +4 -0
- package/build/types/revamp/wise/renderers/getWiseRenderers.d.ts +1 -1
- package/package.json +4 -4
package/build/main.mjs
CHANGED
|
@@ -1685,6 +1685,17 @@ var textInputComponentToProps = (component) => __spreadProps(__spreadValues({},
|
|
|
1685
1685
|
onChange: component.onChange.bind(component)
|
|
1686
1686
|
});
|
|
1687
1687
|
|
|
1688
|
+
// src/revamp/renderers/mappers/multiSelectComponentToProps.ts
|
|
1689
|
+
var multiSelectInputComponentToProps = (component) => {
|
|
1690
|
+
const { options, selectedIndices, onSelect } = component;
|
|
1691
|
+
const _a = inputComponentToProps(component, "input-multi-select"), { value } = _a, props = __objRest(_a, ["value"]);
|
|
1692
|
+
return __spreadProps(__spreadValues({}, props), {
|
|
1693
|
+
options,
|
|
1694
|
+
selectedIndices,
|
|
1695
|
+
onSelect: onSelect.bind(component)
|
|
1696
|
+
});
|
|
1697
|
+
};
|
|
1698
|
+
|
|
1688
1699
|
// src/revamp/renderers/mappers/uploadInputComponentToProps.ts
|
|
1689
1700
|
var uploadInputComponentToProps = (component) => {
|
|
1690
1701
|
const { accepts, maxSize } = component;
|
|
@@ -1742,6 +1753,8 @@ var componentToRendererProps = (component, nestedContent) => {
|
|
|
1742
1753
|
return markdownComponentToProps(component);
|
|
1743
1754
|
case "modal":
|
|
1744
1755
|
return modalComponentToProps(component, children);
|
|
1756
|
+
case "multi-select":
|
|
1757
|
+
return multiSelectInputComponentToProps(component);
|
|
1745
1758
|
case "multi-upload":
|
|
1746
1759
|
return multiUploadInputComponentToProps(component);
|
|
1747
1760
|
case "number":
|
|
@@ -6702,6 +6715,17 @@ var abortAndResetController = (abortController) => {
|
|
|
6702
6715
|
return new AbortController();
|
|
6703
6716
|
};
|
|
6704
6717
|
|
|
6718
|
+
// src/revamp/domain/components/utils/local-value.ts
|
|
6719
|
+
var compareLocalValue = (valueA, valueB) => {
|
|
6720
|
+
if (isArrayLocalValue(valueA) && isArrayLocalValue(valueB)) {
|
|
6721
|
+
return valueA.length === valueB.length && valueA.every((value, index) => compareLocalValue(value, valueB[index]));
|
|
6722
|
+
}
|
|
6723
|
+
if (isObjectLocalValue(valueA) && isObjectLocalValue(valueB)) {
|
|
6724
|
+
return Object.keys(valueA).every((key) => compareLocalValue(valueA[key], valueB[key]));
|
|
6725
|
+
}
|
|
6726
|
+
return valueA === valueB;
|
|
6727
|
+
};
|
|
6728
|
+
|
|
6705
6729
|
// src/revamp/domain/features/persistAsync/getComponentPersistAsync.ts
|
|
6706
6730
|
var getComponentPersistAsync = (update, performPersistAsync) => (
|
|
6707
6731
|
/**
|
|
@@ -6710,7 +6734,7 @@ var getComponentPersistAsync = (update, performPersistAsync) => (
|
|
|
6710
6734
|
*/
|
|
6711
6735
|
async (persistedState, currentValue) => {
|
|
6712
6736
|
const { abortController, lastSubmitted, submission } = persistedState;
|
|
6713
|
-
if (lastSubmitted
|
|
6737
|
+
if (compareLocalValue(lastSubmitted, currentValue)) {
|
|
6714
6738
|
return submission;
|
|
6715
6739
|
}
|
|
6716
6740
|
const newAbortController = abortAndResetController(abortController);
|
|
@@ -7769,15 +7793,6 @@ var isPartialLocalValueMatch = (partialValue, component) => {
|
|
|
7769
7793
|
return compareLocalValue(partialValue, componentValue);
|
|
7770
7794
|
};
|
|
7771
7795
|
var areEquivalentFiles = (fileA, fileB) => fileA.name === fileB.name && fileA.type === fileB.type && fileA.size === fileB.size;
|
|
7772
|
-
var compareLocalValue = (valueA, valueB) => {
|
|
7773
|
-
if (isArrayLocalValue(valueA) && isArrayLocalValue(valueB)) {
|
|
7774
|
-
return valueA.length === valueB.length && valueA.every((value, index) => compareLocalValue(value, valueB[index]));
|
|
7775
|
-
}
|
|
7776
|
-
if (isObjectLocalValue(valueA) && isObjectLocalValue(valueB)) {
|
|
7777
|
-
return Object.keys(valueA).every((key) => compareLocalValue(valueA[key], valueB[key]));
|
|
7778
|
-
}
|
|
7779
|
-
return valueA === valueB;
|
|
7780
|
-
};
|
|
7781
7796
|
|
|
7782
7797
|
// src/revamp/domain/components/SelectInputComponent.ts
|
|
7783
7798
|
var createSelectInputComponent = (selectProps, updateComponent) => {
|
|
@@ -8745,6 +8760,193 @@ var getPersistAsyncConfig = (schema) => {
|
|
|
8745
8760
|
};
|
|
8746
8761
|
var getValueForPersistAsync = (localValue) => isArray(localValue) && localValue.every(isFile) ? localValue : [];
|
|
8747
8762
|
|
|
8763
|
+
// src/revamp/domain/components/MultiSelectInputComponent.ts
|
|
8764
|
+
var createMultiSelectComponent = (multiSelectProps, updateComponent) => {
|
|
8765
|
+
const _a = multiSelectProps, {
|
|
8766
|
+
uid,
|
|
8767
|
+
checks,
|
|
8768
|
+
options,
|
|
8769
|
+
initialValue,
|
|
8770
|
+
performPersistAsync,
|
|
8771
|
+
performValidationAsync,
|
|
8772
|
+
performRefresh,
|
|
8773
|
+
onValueChange
|
|
8774
|
+
} = _a, rest = __objRest(_a, [
|
|
8775
|
+
"uid",
|
|
8776
|
+
"checks",
|
|
8777
|
+
"options",
|
|
8778
|
+
"initialValue",
|
|
8779
|
+
"performPersistAsync",
|
|
8780
|
+
"performValidationAsync",
|
|
8781
|
+
"performRefresh",
|
|
8782
|
+
"onValueChange"
|
|
8783
|
+
]);
|
|
8784
|
+
const update = getInputUpdateFunction(uid, updateComponent);
|
|
8785
|
+
const children = options.map((option) => option.component);
|
|
8786
|
+
const selectedIndices = getInitialModelIndices(initialValue, children);
|
|
8787
|
+
const getValidationErrors = getLocalValueValidator(checks);
|
|
8788
|
+
const getAndSetValidationErrors = (currentValue) => {
|
|
8789
|
+
const messages = getValidationErrors(currentValue);
|
|
8790
|
+
update((draft) => {
|
|
8791
|
+
draft.errors = messages;
|
|
8792
|
+
});
|
|
8793
|
+
return messages;
|
|
8794
|
+
};
|
|
8795
|
+
const inputComponent = __spreadProps(__spreadValues({
|
|
8796
|
+
uid,
|
|
8797
|
+
type: "multi-select",
|
|
8798
|
+
children,
|
|
8799
|
+
options,
|
|
8800
|
+
selectedIndices,
|
|
8801
|
+
value: null
|
|
8802
|
+
}, rest), {
|
|
8803
|
+
onSelect(indices) {
|
|
8804
|
+
update((draft) => {
|
|
8805
|
+
draft.selectedIndices = indices;
|
|
8806
|
+
draft.errors = [];
|
|
8807
|
+
});
|
|
8808
|
+
performRefresh == null ? void 0 : performRefresh();
|
|
8809
|
+
onValueChange();
|
|
8810
|
+
getAndSetValidationErrors(this.getLocalValue());
|
|
8811
|
+
},
|
|
8812
|
+
onBlur() {
|
|
8813
|
+
},
|
|
8814
|
+
// Noop
|
|
8815
|
+
onFocus() {
|
|
8816
|
+
},
|
|
8817
|
+
// Noop
|
|
8818
|
+
getLocalValue() {
|
|
8819
|
+
var _a2, _b;
|
|
8820
|
+
return (_b = (_a2 = this.getSelectedChildren()) == null ? void 0 : _a2.map((child) => child.getLocalValue())) != null ? _b : null;
|
|
8821
|
+
},
|
|
8822
|
+
validate() {
|
|
8823
|
+
const messages = getAndSetValidationErrors(this.getLocalValue());
|
|
8824
|
+
return messages.length === 0;
|
|
8825
|
+
},
|
|
8826
|
+
async getSubmittableValue() {
|
|
8827
|
+
const selected = this.getSelectedChildren();
|
|
8828
|
+
if (selected) {
|
|
8829
|
+
return Promise.all(selected.map(async (child) => child.getSubmittableValue()));
|
|
8830
|
+
}
|
|
8831
|
+
return null;
|
|
8832
|
+
},
|
|
8833
|
+
getSummary: () => ({}),
|
|
8834
|
+
getChildren() {
|
|
8835
|
+
return this.children;
|
|
8836
|
+
},
|
|
8837
|
+
getSelectedChildren() {
|
|
8838
|
+
return this.selectedIndices.map((i) => this.children[i]);
|
|
8839
|
+
}
|
|
8840
|
+
});
|
|
8841
|
+
if (performRefresh) {
|
|
8842
|
+
return inputComponent;
|
|
8843
|
+
}
|
|
8844
|
+
if (performPersistAsync) {
|
|
8845
|
+
const persist = getComponentPersistAsync(update, performPersistAsync);
|
|
8846
|
+
return __spreadProps(__spreadValues({}, inputComponent), {
|
|
8847
|
+
isPersisted: true,
|
|
8848
|
+
onSelect(indices) {
|
|
8849
|
+
inputComponent.onSelect.call(this, indices);
|
|
8850
|
+
const isValid2 = getValidationErrors(this.getLocalValue()).length === 0;
|
|
8851
|
+
if (isValid2 && indices != null) {
|
|
8852
|
+
persist(this.persistedState, this.getLocalValue()).catch(() => {
|
|
8853
|
+
});
|
|
8854
|
+
}
|
|
8855
|
+
},
|
|
8856
|
+
async getSubmittableValue() {
|
|
8857
|
+
return persist(this.persistedState, this.getLocalValue());
|
|
8858
|
+
}
|
|
8859
|
+
});
|
|
8860
|
+
}
|
|
8861
|
+
if (performValidationAsync) {
|
|
8862
|
+
const validateAsync = getComponentValidationAsync(update, performValidationAsync);
|
|
8863
|
+
return __spreadProps(__spreadValues({}, inputComponent), {
|
|
8864
|
+
onSelect(indices) {
|
|
8865
|
+
inputComponent.onSelect.call(this, indices);
|
|
8866
|
+
if (this.validate()) {
|
|
8867
|
+
validateAsync(this.validationState, this.getLocalValue()).catch(() => {
|
|
8868
|
+
});
|
|
8869
|
+
}
|
|
8870
|
+
}
|
|
8871
|
+
});
|
|
8872
|
+
}
|
|
8873
|
+
return inputComponent;
|
|
8874
|
+
};
|
|
8875
|
+
var getInitialModelIndices = (model, options) => {
|
|
8876
|
+
if (!isArray(model)) {
|
|
8877
|
+
return [];
|
|
8878
|
+
}
|
|
8879
|
+
return model.map((m) => options.findIndex((o) => o.getLocalValue() === m)).filter((n) => n >= 0);
|
|
8880
|
+
};
|
|
8881
|
+
|
|
8882
|
+
// src/revamp/domain/mappers/schema/arraySchemaToComponent/arraySchemaToMultiSelectComponent.ts
|
|
8883
|
+
var arraySchemaToMultiSelectComponent = (schemaMapperProps, mapperProps) => {
|
|
8884
|
+
const {
|
|
8885
|
+
uid,
|
|
8886
|
+
localValue,
|
|
8887
|
+
schema,
|
|
8888
|
+
model,
|
|
8889
|
+
required = false,
|
|
8890
|
+
validationErrors: initialError
|
|
8891
|
+
} = schemaMapperProps;
|
|
8892
|
+
const initialModel = model != null ? model : null;
|
|
8893
|
+
const options = schema.items.oneOf.map((childSchema, index) => {
|
|
8894
|
+
const { title: title2 = "", description, image, icon, keywords = [] } = childSchema;
|
|
8895
|
+
return {
|
|
8896
|
+
title: title2,
|
|
8897
|
+
description,
|
|
8898
|
+
image,
|
|
8899
|
+
icon,
|
|
8900
|
+
keywords,
|
|
8901
|
+
disabled: "disabled" in childSchema ? Boolean(childSchema.disabled) : false,
|
|
8902
|
+
component: mapSchemaToComponent(
|
|
8903
|
+
{
|
|
8904
|
+
uid: `${uid}.oneOf-${index}`,
|
|
8905
|
+
schema: childSchema,
|
|
8906
|
+
model: initialModel,
|
|
8907
|
+
localValue,
|
|
8908
|
+
validationErrors: initialError,
|
|
8909
|
+
required
|
|
8910
|
+
},
|
|
8911
|
+
mapperProps
|
|
8912
|
+
)
|
|
8913
|
+
};
|
|
8914
|
+
});
|
|
8915
|
+
const { title, validationMessages } = schema;
|
|
8916
|
+
const { getErrorMessageFunctions, onRefresh, onValueChange, updateComponent } = mapperProps;
|
|
8917
|
+
const errorMessageFunctions = getErrorMessageFunctions(validationMessages);
|
|
8918
|
+
const { performPersistAsync, persistedState } = getPersistAsyncInitialState(
|
|
8919
|
+
schemaMapperProps,
|
|
8920
|
+
mapperProps
|
|
8921
|
+
);
|
|
8922
|
+
const { performValidationAsync, validationState } = getValidationAsyncInitialState(
|
|
8923
|
+
schemaMapperProps,
|
|
8924
|
+
mapperProps
|
|
8925
|
+
);
|
|
8926
|
+
const initialValue = performPersistAsync ? localValue : model != null ? model : null;
|
|
8927
|
+
return createMultiSelectComponent(
|
|
8928
|
+
__spreadProps(__spreadValues({}, mapCommonSchemaProps(schemaMapperProps)), {
|
|
8929
|
+
autoComplete: "off",
|
|
8930
|
+
checks: schema.hidden ? [] : [
|
|
8931
|
+
getRequiredCheck(required, errorMessageFunctions),
|
|
8932
|
+
getAboveMaxItemsCheck(schema, errorMessageFunctions),
|
|
8933
|
+
getBelowMinItemsCheck(schema, errorMessageFunctions)
|
|
8934
|
+
],
|
|
8935
|
+
initialValue,
|
|
8936
|
+
options,
|
|
8937
|
+
required,
|
|
8938
|
+
persistedState,
|
|
8939
|
+
performPersistAsync,
|
|
8940
|
+
title,
|
|
8941
|
+
validationState,
|
|
8942
|
+
performValidationAsync,
|
|
8943
|
+
performRefresh: getPerformRefresh(schema, onRefresh),
|
|
8944
|
+
onValueChange
|
|
8945
|
+
}),
|
|
8946
|
+
updateComponent
|
|
8947
|
+
);
|
|
8948
|
+
};
|
|
8949
|
+
|
|
8748
8950
|
// src/revamp/domain/mappers/schema/arraySchemaToComponent/arraySchemaToComponent.ts
|
|
8749
8951
|
var arraySchemaToComponent = (schemaMapperProps, mapperProps) => {
|
|
8750
8952
|
const { schema, model: originalModel } = schemaMapperProps;
|
|
@@ -8752,6 +8954,9 @@ var arraySchemaToComponent = (schemaMapperProps, mapperProps) => {
|
|
|
8752
8954
|
if (isArraySchemaListWithMultiFileUpload(schema)) {
|
|
8753
8955
|
return arraySchemaToMultiUploadComponent(__spreadProps(__spreadValues({}, schemaMapperProps), { schema, model }), mapperProps);
|
|
8754
8956
|
}
|
|
8957
|
+
if (isArraySchemaListWithMultiSelect(schema)) {
|
|
8958
|
+
return arraySchemaToMultiSelectComponent(__spreadProps(__spreadValues({}, schemaMapperProps), { schema, model }), mapperProps);
|
|
8959
|
+
}
|
|
8755
8960
|
if (isArrayListSchema(schema)) {
|
|
8756
8961
|
return arraySchemaToRepeatableComponent(__spreadProps(__spreadValues({}, schemaMapperProps), { schema, model }), mapperProps);
|
|
8757
8962
|
}
|
|
@@ -8759,6 +8964,7 @@ var arraySchemaToComponent = (schemaMapperProps, mapperProps) => {
|
|
|
8759
8964
|
};
|
|
8760
8965
|
var isArraySchemaListWithMultiFileUpload = (schema) => isArrayListSchema(schema) && (isPersistAsyncWithUploadSchema(schema.items) || isStringSchemaWithUpload(schema.items));
|
|
8761
8966
|
var isPersistAsyncWithUploadSchema = (schema) => isSchemaWithPersistAsync(schema) && (isBlobSchema(schema.persistAsync.schema) || isStringSchemaWithUpload(schema.persistAsync.schema));
|
|
8967
|
+
var isArraySchemaListWithMultiSelect = (schema) => isArrayListSchema(schema) && "oneOf" in schema.items && schema.items.oneOf.every(isConstSchema);
|
|
8762
8968
|
|
|
8763
8969
|
// src/revamp/domain/components/BooleanInputComponent.ts
|
|
8764
8970
|
var createBooleanInputComponent = (booleanInputProps, updateComponent) => {
|
|
@@ -10196,7 +10402,7 @@ function $1746a345f3d73bb7$export$f680877a34711e37(deterministicId) {
|
|
|
10196
10402
|
return deterministicId || (id ? `radix-${id}` : "");
|
|
10197
10403
|
}
|
|
10198
10404
|
|
|
10199
|
-
// ../../node_modules/.pnpm/@wise+forms@0.3.4_@transferwise+components@46.
|
|
10405
|
+
// ../../node_modules/.pnpm/@wise+forms@0.3.4_@transferwise+components@46.35.0_@types+react@18.0.29_react@18.2.0/node_modules/@wise/forms/dist/index.mjs
|
|
10200
10406
|
var import_classnames = __toESM(require_classnames(), 1);
|
|
10201
10407
|
import { InlineAlert, Sentiment as Sentiment2, Input, TextArea } from "@transferwise/components";
|
|
10202
10408
|
import { createContext as createContext2, useContext as useContext2, forwardRef } from "react";
|
|
@@ -10984,13 +11190,131 @@ function DFModal({ content, margin, trigger }) {
|
|
|
10984
11190
|
] });
|
|
10985
11191
|
}
|
|
10986
11192
|
|
|
11193
|
+
// src/revamp/wise/renderers/MultiSelectInputRenderer.tsx
|
|
11194
|
+
import { SelectInput, SelectInputOptionContent } from "@transferwise/components";
|
|
11195
|
+
|
|
11196
|
+
// src/revamp/wise/renderers/SelectInputRenderer/OptionMedia.tsx
|
|
11197
|
+
import { Avatar as Avatar2, AvatarType as AvatarType2 } from "@transferwise/components";
|
|
11198
|
+
import { jsx as jsx34 } from "react/jsx-runtime";
|
|
11199
|
+
function OptionMedia({ icon, image }) {
|
|
11200
|
+
if (image == null ? void 0 : image.url) {
|
|
11201
|
+
return /* @__PURE__ */ jsx34("img", { src: image.url, alt: image.accessibilityDescription || "", width: "64px" });
|
|
11202
|
+
}
|
|
11203
|
+
if (icon && "name" in icon) {
|
|
11204
|
+
return /* @__PURE__ */ jsx34(Avatar2, { type: AvatarType2.ICON, children: /* @__PURE__ */ jsx34(DynamicIcon_default, { name: icon.name }) });
|
|
11205
|
+
}
|
|
11206
|
+
if (icon && "text" in icon) {
|
|
11207
|
+
return /* @__PURE__ */ jsx34(Avatar2, { type: AvatarType2.INITIALS, children: icon.text });
|
|
11208
|
+
}
|
|
11209
|
+
return null;
|
|
11210
|
+
}
|
|
11211
|
+
|
|
11212
|
+
// src/revamp/wise/renderers/MultiSelectInputRenderer.tsx
|
|
11213
|
+
import { useIntl as useIntl4 } from "react-intl";
|
|
11214
|
+
|
|
11215
|
+
// src/common/messages/multi-select.messages.ts
|
|
11216
|
+
import { defineMessages as defineMessages6 } from "react-intl";
|
|
11217
|
+
var multi_select_messages_default = defineMessages6({
|
|
11218
|
+
summary: {
|
|
11219
|
+
id: "dynamicFlows.MultiSelect.summary",
|
|
11220
|
+
defaultMessage: "{first} and {count} more",
|
|
11221
|
+
description: "A summary of the multiple items selected. Showing the title of the first selected item, and the number of other items that have been selected."
|
|
11222
|
+
}
|
|
11223
|
+
});
|
|
11224
|
+
|
|
11225
|
+
// src/revamp/wise/renderers/MultiSelectInputRenderer.tsx
|
|
11226
|
+
import { useState as useState6 } from "react";
|
|
11227
|
+
import { jsx as jsx35 } from "react/jsx-runtime";
|
|
11228
|
+
var MultiSelectInputRenderer = {
|
|
11229
|
+
canRenderType: "input-multi-select",
|
|
11230
|
+
render: (props) => /* @__PURE__ */ jsx35(MultiSelectInputRendererComponent, __spreadValues({}, props))
|
|
11231
|
+
};
|
|
11232
|
+
function MultiSelectInputRendererComponent(props) {
|
|
11233
|
+
const { formatMessage } = useIntl4();
|
|
11234
|
+
const [stagedIndices, setStagedIndices] = useState6();
|
|
11235
|
+
const {
|
|
11236
|
+
id,
|
|
11237
|
+
description,
|
|
11238
|
+
disabled,
|
|
11239
|
+
label,
|
|
11240
|
+
help,
|
|
11241
|
+
error,
|
|
11242
|
+
options,
|
|
11243
|
+
placeholder,
|
|
11244
|
+
selectedIndices,
|
|
11245
|
+
onSelect
|
|
11246
|
+
} = props;
|
|
11247
|
+
const mergedIndices = stagedIndices != null ? stagedIndices : selectedIndices;
|
|
11248
|
+
const getFormattedMessage = () => {
|
|
11249
|
+
if (mergedIndices.length > 0) {
|
|
11250
|
+
if (mergedIndices.length > 1) {
|
|
11251
|
+
return formatMessage(multi_select_messages_default.summary, {
|
|
11252
|
+
first: options[mergedIndices[0]].title,
|
|
11253
|
+
count: mergedIndices.length - 1
|
|
11254
|
+
});
|
|
11255
|
+
}
|
|
11256
|
+
return options[mergedIndices[0]].title;
|
|
11257
|
+
}
|
|
11258
|
+
return void 0;
|
|
11259
|
+
};
|
|
11260
|
+
const renderValue = (index, withinTrigger) => {
|
|
11261
|
+
const option = index >= 0 ? options[index] : null;
|
|
11262
|
+
if (option === null) {
|
|
11263
|
+
return null;
|
|
11264
|
+
}
|
|
11265
|
+
if (withinTrigger) {
|
|
11266
|
+
return index === mergedIndices[0] ? getFormattedMessage() : void 0;
|
|
11267
|
+
}
|
|
11268
|
+
const contentProps = {
|
|
11269
|
+
title: option.title,
|
|
11270
|
+
description: option.description,
|
|
11271
|
+
icon: /* @__PURE__ */ jsx35(OptionMedia, { icon: option.icon, image: option.image })
|
|
11272
|
+
};
|
|
11273
|
+
return /* @__PURE__ */ jsx35(SelectInputOptionContent, __spreadValues({}, contentProps));
|
|
11274
|
+
};
|
|
11275
|
+
return /* @__PURE__ */ jsx35(FieldInput_default, { id, label, help, description, error, children: /* @__PURE__ */ jsx35(
|
|
11276
|
+
SelectInput,
|
|
11277
|
+
{
|
|
11278
|
+
id,
|
|
11279
|
+
items: options.map((option, index) => {
|
|
11280
|
+
var _a, _b, _c;
|
|
11281
|
+
return {
|
|
11282
|
+
type: "option",
|
|
11283
|
+
value: index,
|
|
11284
|
+
filterMatchers: [
|
|
11285
|
+
...(_a = option.keywords) != null ? _a : [],
|
|
11286
|
+
(_b = option.title) != null ? _b : "",
|
|
11287
|
+
(_c = option.description) != null ? _c : ""
|
|
11288
|
+
],
|
|
11289
|
+
disabled: option.disabled
|
|
11290
|
+
};
|
|
11291
|
+
}),
|
|
11292
|
+
disabled,
|
|
11293
|
+
placeholder,
|
|
11294
|
+
value: mergedIndices,
|
|
11295
|
+
renderValue,
|
|
11296
|
+
multiple: true,
|
|
11297
|
+
onChange: (values) => {
|
|
11298
|
+
setStagedIndices(values);
|
|
11299
|
+
},
|
|
11300
|
+
onClose: () => {
|
|
11301
|
+
if (stagedIndices) {
|
|
11302
|
+
onSelect(stagedIndices);
|
|
11303
|
+
setStagedIndices(void 0);
|
|
11304
|
+
}
|
|
11305
|
+
}
|
|
11306
|
+
}
|
|
11307
|
+
) });
|
|
11308
|
+
}
|
|
11309
|
+
var MultiSelectInputRenderer_default = MultiSelectInputRenderer;
|
|
11310
|
+
|
|
10987
11311
|
// src/revamp/wise/renderers/MultiUploadInputRenderer.tsx
|
|
10988
11312
|
import { UploadInput } from "@transferwise/components";
|
|
10989
11313
|
|
|
10990
11314
|
// src/revamp/wise/renderers/components/UploadFieldInput.tsx
|
|
10991
11315
|
var import_classnames4 = __toESM(require_classnames());
|
|
10992
11316
|
import { InlineAlert as InlineAlert2 } from "@transferwise/components";
|
|
10993
|
-
import { jsx as
|
|
11317
|
+
import { jsx as jsx36, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
10994
11318
|
function UploadFieldInput({
|
|
10995
11319
|
id,
|
|
10996
11320
|
children,
|
|
@@ -10999,7 +11323,7 @@ function UploadFieldInput({
|
|
|
10999
11323
|
error,
|
|
11000
11324
|
help
|
|
11001
11325
|
}) {
|
|
11002
|
-
const labelContent = label && help ? /* @__PURE__ */
|
|
11326
|
+
const labelContent = label && help ? /* @__PURE__ */ jsx36(LabelContentWithHelp, { text: label, help }) : label;
|
|
11003
11327
|
const descriptionId = description ? `${id}-description` : void 0;
|
|
11004
11328
|
return /* @__PURE__ */ jsxs9(
|
|
11005
11329
|
"div",
|
|
@@ -11008,9 +11332,9 @@ function UploadFieldInput({
|
|
|
11008
11332
|
"has-error": !!error
|
|
11009
11333
|
}),
|
|
11010
11334
|
children: [
|
|
11011
|
-
/* @__PURE__ */
|
|
11335
|
+
/* @__PURE__ */ jsx36("label", { htmlFor: id, className: "control-label", children: labelContent }),
|
|
11012
11336
|
children,
|
|
11013
|
-
error && /* @__PURE__ */
|
|
11337
|
+
error && /* @__PURE__ */ jsx36(InlineAlert2, { type: "negative", id: descriptionId, children: error })
|
|
11014
11338
|
]
|
|
11015
11339
|
}
|
|
11016
11340
|
);
|
|
@@ -11053,7 +11377,7 @@ var nanoid = (size = 21) => {
|
|
|
11053
11377
|
var getRandomId = () => nanoid(10);
|
|
11054
11378
|
|
|
11055
11379
|
// src/revamp/wise/renderers/MultiUploadInputRenderer.tsx
|
|
11056
|
-
import { jsx as
|
|
11380
|
+
import { jsx as jsx37 } from "react/jsx-runtime";
|
|
11057
11381
|
var MultiUploadInputRenderer = {
|
|
11058
11382
|
canRenderType: "input-upload-multi",
|
|
11059
11383
|
render: (props) => {
|
|
@@ -11080,7 +11404,7 @@ var MultiUploadInputRenderer = {
|
|
|
11080
11404
|
};
|
|
11081
11405
|
const onDeleteFile = async (fileId) => onDelete(String(fileId));
|
|
11082
11406
|
const descriptionId = description ? `${id}-description` : void 0;
|
|
11083
|
-
return /* @__PURE__ */
|
|
11407
|
+
return /* @__PURE__ */ jsx37(UploadFieldInput_default, { id, label, description, error, help, children: /* @__PURE__ */ jsx37(
|
|
11084
11408
|
UploadInput,
|
|
11085
11409
|
{
|
|
11086
11410
|
id,
|
|
@@ -11103,12 +11427,12 @@ var MultiUploadInputRenderer_default = MultiUploadInputRenderer;
|
|
|
11103
11427
|
|
|
11104
11428
|
// src/revamp/wise/renderers/NumberInputRenderer.tsx
|
|
11105
11429
|
import { Input as Input3 } from "@transferwise/components";
|
|
11106
|
-
import { jsx as
|
|
11430
|
+
import { jsx as jsx38 } from "react/jsx-runtime";
|
|
11107
11431
|
var NumberInputRenderer = {
|
|
11108
11432
|
canRenderType: "input-number",
|
|
11109
11433
|
render: (props) => {
|
|
11110
11434
|
const _a = props, { id, label, error, description, help, type, value, onChange } = _a, rest = __objRest(_a, ["id", "label", "error", "description", "help", "type", "value", "onChange"]);
|
|
11111
|
-
return /* @__PURE__ */
|
|
11435
|
+
return /* @__PURE__ */ jsx38(FieldInput_default, { id, label, description, error, help, children: /* @__PURE__ */ jsx38(
|
|
11112
11436
|
Input3,
|
|
11113
11437
|
__spreadValues({
|
|
11114
11438
|
id,
|
|
@@ -11127,7 +11451,7 @@ var NumberInputRenderer = {
|
|
|
11127
11451
|
var NumberInputRenderer_default = NumberInputRenderer;
|
|
11128
11452
|
|
|
11129
11453
|
// src/revamp/wise/renderers/ParagraphRenderer.tsx
|
|
11130
|
-
import { useIntl as
|
|
11454
|
+
import { useIntl as useIntl5 } from "react-intl";
|
|
11131
11455
|
|
|
11132
11456
|
// src/revamp/wise/renderers/hooks/useSnackBarIfAvailable.ts
|
|
11133
11457
|
import { SnackbarContext } from "@transferwise/components";
|
|
@@ -11143,8 +11467,8 @@ var import_classnames5 = __toESM(require_classnames());
|
|
|
11143
11467
|
import { Button as Button3, Input as Input4 } from "@transferwise/components";
|
|
11144
11468
|
|
|
11145
11469
|
// src/common/messages/paragraph.messages.ts
|
|
11146
|
-
import { defineMessages as
|
|
11147
|
-
var paragraph_messages_default =
|
|
11470
|
+
import { defineMessages as defineMessages7 } from "react-intl";
|
|
11471
|
+
var paragraph_messages_default = defineMessages7({
|
|
11148
11472
|
copy: {
|
|
11149
11473
|
id: "dynamicFlows.DynamicParagraph.copy",
|
|
11150
11474
|
defaultMessage: "Copy",
|
|
@@ -11158,24 +11482,24 @@ var paragraph_messages_default = defineMessages6({
|
|
|
11158
11482
|
});
|
|
11159
11483
|
|
|
11160
11484
|
// src/revamp/wise/renderers/ParagraphRenderer.tsx
|
|
11161
|
-
import { jsx as
|
|
11485
|
+
import { jsx as jsx39, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
11162
11486
|
var ParagraphRenderer = {
|
|
11163
11487
|
canRenderType: "paragraph",
|
|
11164
|
-
render: (props) => /* @__PURE__ */
|
|
11488
|
+
render: (props) => /* @__PURE__ */ jsx39(Paragraph, __spreadValues({}, props))
|
|
11165
11489
|
};
|
|
11166
11490
|
function Paragraph({ align, control, margin, text }) {
|
|
11167
11491
|
const className = getTextAlignmentAndMargin({ align, margin });
|
|
11168
|
-
return control === "copyable" ? /* @__PURE__ */
|
|
11492
|
+
return control === "copyable" ? /* @__PURE__ */ jsx39(CopyableParagraph, { className, align, text }) : /* @__PURE__ */ jsx39(StandardParagraph, { className, text });
|
|
11169
11493
|
}
|
|
11170
11494
|
function StandardParagraph({ text, className }) {
|
|
11171
|
-
return /* @__PURE__ */
|
|
11495
|
+
return /* @__PURE__ */ jsx39("p", { className, children: text });
|
|
11172
11496
|
}
|
|
11173
11497
|
function CopyableParagraph({
|
|
11174
11498
|
text,
|
|
11175
11499
|
align,
|
|
11176
11500
|
className
|
|
11177
11501
|
}) {
|
|
11178
|
-
const { formatMessage } =
|
|
11502
|
+
const { formatMessage } = useIntl5();
|
|
11179
11503
|
const createSnackbar = useSnackBarIfAvailable();
|
|
11180
11504
|
const copy = () => {
|
|
11181
11505
|
navigator.clipboard.writeText(text).then(() => createSnackbar({ text: formatMessage(paragraph_messages_default.copied) })).catch(() => {
|
|
@@ -11183,7 +11507,7 @@ function CopyableParagraph({
|
|
|
11183
11507
|
};
|
|
11184
11508
|
const inputAlignmentClasses = getTextAlignmentAndMargin({ align, margin: "sm" });
|
|
11185
11509
|
return /* @__PURE__ */ jsxs10("div", { className, children: [
|
|
11186
|
-
/* @__PURE__ */
|
|
11510
|
+
/* @__PURE__ */ jsx39(
|
|
11187
11511
|
Input4,
|
|
11188
11512
|
{
|
|
11189
11513
|
type: "text",
|
|
@@ -11192,20 +11516,20 @@ function CopyableParagraph({
|
|
|
11192
11516
|
className: (0, import_classnames5.default)("text-ellipsis", inputAlignmentClasses)
|
|
11193
11517
|
}
|
|
11194
11518
|
),
|
|
11195
|
-
/* @__PURE__ */
|
|
11519
|
+
/* @__PURE__ */ jsx39(Button3, { block: true, onClick: copy, children: formatMessage(paragraph_messages_default.copy) })
|
|
11196
11520
|
] });
|
|
11197
11521
|
}
|
|
11198
11522
|
var ParagraphRenderer_default = ParagraphRenderer;
|
|
11199
11523
|
|
|
11200
11524
|
// src/revamp/wise/renderers/RepeatableRenderer.tsx
|
|
11201
11525
|
import { Button as Button4, Header as Header3, Modal as Modal2, NavigationOption as NavigationOption2, InlineAlert as InlineAlert3 } from "@transferwise/components";
|
|
11202
|
-
import { useState as
|
|
11526
|
+
import { useState as useState7 } from "react";
|
|
11203
11527
|
import { Plus } from "@transferwise/icons";
|
|
11204
|
-
import { useIntl as
|
|
11528
|
+
import { useIntl as useIntl6 } from "react-intl";
|
|
11205
11529
|
|
|
11206
11530
|
// src/common/messages/repeatable.messages.ts
|
|
11207
|
-
import { defineMessages as
|
|
11208
|
-
var repeatable_messages_default =
|
|
11531
|
+
import { defineMessages as defineMessages8 } from "react-intl";
|
|
11532
|
+
var repeatable_messages_default = defineMessages8({
|
|
11209
11533
|
addItemTitle: {
|
|
11210
11534
|
id: "dynamicFlows.ArraySchema.addItemTitle",
|
|
11211
11535
|
defaultMessage: "Add Item",
|
|
@@ -11230,10 +11554,10 @@ var repeatable_messages_default = defineMessages7({
|
|
|
11230
11554
|
|
|
11231
11555
|
// src/revamp/wise/renderers/RepeatableRenderer.tsx
|
|
11232
11556
|
var import_classnames6 = __toESM(require_classnames());
|
|
11233
|
-
import { Fragment as Fragment4, jsx as
|
|
11557
|
+
import { Fragment as Fragment4, jsx as jsx40, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
11234
11558
|
var RepeatableRenderer = {
|
|
11235
11559
|
canRenderType: "repeatable",
|
|
11236
|
-
render: (props) => /* @__PURE__ */
|
|
11560
|
+
render: (props) => /* @__PURE__ */ jsx40(Repeatable, __spreadValues({}, props))
|
|
11237
11561
|
};
|
|
11238
11562
|
function Repeatable(props) {
|
|
11239
11563
|
const {
|
|
@@ -11249,8 +11573,8 @@ function Repeatable(props) {
|
|
|
11249
11573
|
onSave,
|
|
11250
11574
|
onRemove
|
|
11251
11575
|
} = props;
|
|
11252
|
-
const { formatMessage } =
|
|
11253
|
-
const [openModalType, setOpenModalType] =
|
|
11576
|
+
const { formatMessage } = useIntl6();
|
|
11577
|
+
const [openModalType, setOpenModalType] = useState7(null);
|
|
11254
11578
|
const onAddItem = () => {
|
|
11255
11579
|
onAdd();
|
|
11256
11580
|
setOpenModalType("add");
|
|
@@ -11273,8 +11597,8 @@ function Repeatable(props) {
|
|
|
11273
11597
|
setOpenModalType(null);
|
|
11274
11598
|
};
|
|
11275
11599
|
return /* @__PURE__ */ jsxs11(Fragment4, { children: [
|
|
11276
|
-
title && /* @__PURE__ */
|
|
11277
|
-
description && /* @__PURE__ */
|
|
11600
|
+
title && /* @__PURE__ */ jsx40(Header3, { title }),
|
|
11601
|
+
description && /* @__PURE__ */ jsx40("p", { children: description }),
|
|
11278
11602
|
/* @__PURE__ */ jsxs11(
|
|
11279
11603
|
"div",
|
|
11280
11604
|
{
|
|
@@ -11282,30 +11606,30 @@ function Repeatable(props) {
|
|
|
11282
11606
|
"has-error": error
|
|
11283
11607
|
}),
|
|
11284
11608
|
children: [
|
|
11285
|
-
items == null ? void 0 : items.map((item, index) => /* @__PURE__ */
|
|
11286
|
-
/* @__PURE__ */
|
|
11609
|
+
items == null ? void 0 : items.map((item, index) => /* @__PURE__ */ jsx40(ItemSummaryOption, { item, onClick: () => onEditItem(index) }, item.id)),
|
|
11610
|
+
/* @__PURE__ */ jsx40(
|
|
11287
11611
|
NavigationOption2,
|
|
11288
11612
|
{
|
|
11289
|
-
media: /* @__PURE__ */
|
|
11613
|
+
media: /* @__PURE__ */ jsx40(Plus, {}),
|
|
11290
11614
|
title: addItemTitle || formatMessage(repeatable_messages_default.addItemTitle),
|
|
11291
11615
|
showMediaAtAllSizes: true,
|
|
11292
11616
|
onClick: () => onAddItem()
|
|
11293
11617
|
}
|
|
11294
11618
|
),
|
|
11295
|
-
error && /* @__PURE__ */
|
|
11619
|
+
error && /* @__PURE__ */ jsx40(InlineAlert3, { type: "negative", children: error })
|
|
11296
11620
|
]
|
|
11297
11621
|
}
|
|
11298
11622
|
),
|
|
11299
|
-
/* @__PURE__ */
|
|
11623
|
+
/* @__PURE__ */ jsx40(
|
|
11300
11624
|
Modal2,
|
|
11301
11625
|
{
|
|
11302
11626
|
open: openModalType !== null,
|
|
11303
11627
|
title: (openModalType === "add" ? addItemTitle : editItemTitle) || formatMessage(repeatable_messages_default.addItemTitle),
|
|
11304
11628
|
body: /* @__PURE__ */ jsxs11(Fragment4, { children: [
|
|
11305
|
-
/* @__PURE__ */
|
|
11629
|
+
/* @__PURE__ */ jsx40("div", { className: "m-b-2", children: editableItem }),
|
|
11306
11630
|
/* @__PURE__ */ jsxs11("div", { children: [
|
|
11307
|
-
/* @__PURE__ */
|
|
11308
|
-
/* @__PURE__ */
|
|
11631
|
+
/* @__PURE__ */ jsx40(Button4, { priority: "primary", block: true, className: "m-b-2", onClick: () => onSaveItem(), children: formatMessage(repeatable_messages_default.addItem) }),
|
|
11632
|
+
/* @__PURE__ */ jsx40(Button4, { priority: "secondary", type: "negative", block: true, onClick: () => onRemoveItem(), children: formatMessage(repeatable_messages_default.removeItem) })
|
|
11309
11633
|
] })
|
|
11310
11634
|
] }),
|
|
11311
11635
|
onClose: () => onCancelEdit()
|
|
@@ -11317,10 +11641,10 @@ function ItemSummaryOption({
|
|
|
11317
11641
|
item,
|
|
11318
11642
|
onClick
|
|
11319
11643
|
}) {
|
|
11320
|
-
return /* @__PURE__ */
|
|
11644
|
+
return /* @__PURE__ */ jsx40(
|
|
11321
11645
|
NavigationOption2,
|
|
11322
11646
|
{
|
|
11323
|
-
media: /* @__PURE__ */
|
|
11647
|
+
media: /* @__PURE__ */ jsx40(NavigationOptionMedia, __spreadValues({}, item)),
|
|
11324
11648
|
title: item.title,
|
|
11325
11649
|
content: item.description,
|
|
11326
11650
|
showMediaAtAllSizes: true,
|
|
@@ -11334,14 +11658,14 @@ var RepeatableRenderer_default = RepeatableRenderer;
|
|
|
11334
11658
|
import { Input as Input5, Markdown as Markdown3, NavigationOption as NavigationOption3, NavigationOptionsList as NavigationOptionsList2 } from "@transferwise/components";
|
|
11335
11659
|
|
|
11336
11660
|
// src/revamp/wise/renderers/SearchRenderer/ErrorResult.tsx
|
|
11337
|
-
import { useIntl as
|
|
11338
|
-
import { jsx as
|
|
11661
|
+
import { useIntl as useIntl7 } from "react-intl";
|
|
11662
|
+
import { jsx as jsx41, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
11339
11663
|
function ErrorResult({ state }) {
|
|
11340
|
-
const intl =
|
|
11664
|
+
const intl = useIntl7();
|
|
11341
11665
|
return /* @__PURE__ */ jsxs12("p", { className: "m-t-2", children: [
|
|
11342
11666
|
intl.formatMessage(generic_error_messages_default.genericError),
|
|
11343
11667
|
"\xA0",
|
|
11344
|
-
/* @__PURE__ */
|
|
11668
|
+
/* @__PURE__ */ jsx41(
|
|
11345
11669
|
"a",
|
|
11346
11670
|
{
|
|
11347
11671
|
href: "/",
|
|
@@ -11356,8 +11680,8 @@ function ErrorResult({ state }) {
|
|
|
11356
11680
|
}
|
|
11357
11681
|
|
|
11358
11682
|
// src/revamp/wise/renderers/SearchRenderer/BlockSearchRendererComponent.tsx
|
|
11359
|
-
import { useState as
|
|
11360
|
-
import { Fragment as Fragment5, jsx as
|
|
11683
|
+
import { useState as useState8 } from "react";
|
|
11684
|
+
import { Fragment as Fragment5, jsx as jsx42, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
11361
11685
|
function BlockSearchRendererComponent({
|
|
11362
11686
|
id,
|
|
11363
11687
|
isLoading,
|
|
@@ -11367,10 +11691,10 @@ function BlockSearchRendererComponent({
|
|
|
11367
11691
|
state,
|
|
11368
11692
|
title
|
|
11369
11693
|
}) {
|
|
11370
|
-
const [hasSearched, setHasSearched] =
|
|
11694
|
+
const [hasSearched, setHasSearched] = useState8(false);
|
|
11371
11695
|
const trackEvent = useTrackEvent();
|
|
11372
11696
|
return /* @__PURE__ */ jsxs13("div", { className: getMargin(margin), children: [
|
|
11373
|
-
/* @__PURE__ */
|
|
11697
|
+
/* @__PURE__ */ jsx42(FieldInput_default, { id, description: "", error: "", help: "", label: title, children: /* @__PURE__ */ jsx42(
|
|
11374
11698
|
Input5,
|
|
11375
11699
|
{
|
|
11376
11700
|
id,
|
|
@@ -11387,7 +11711,7 @@ function BlockSearchRendererComponent({
|
|
|
11387
11711
|
}
|
|
11388
11712
|
}
|
|
11389
11713
|
) }),
|
|
11390
|
-
isLoading ? /* @__PURE__ */
|
|
11714
|
+
isLoading ? /* @__PURE__ */ jsx42(Fragment5, { children: "Loading..." }) : /* @__PURE__ */ jsx42(SearchResultContent, { state, onChange })
|
|
11391
11715
|
] });
|
|
11392
11716
|
}
|
|
11393
11717
|
function SearchResultContent({
|
|
@@ -11396,29 +11720,29 @@ function SearchResultContent({
|
|
|
11396
11720
|
}) {
|
|
11397
11721
|
switch (state.type) {
|
|
11398
11722
|
case "error":
|
|
11399
|
-
return /* @__PURE__ */
|
|
11723
|
+
return /* @__PURE__ */ jsx42(ErrorResult, { state });
|
|
11400
11724
|
case "results":
|
|
11401
|
-
return /* @__PURE__ */
|
|
11725
|
+
return /* @__PURE__ */ jsx42(SearchResults, { state, onChange });
|
|
11402
11726
|
case "noResults":
|
|
11403
|
-
return /* @__PURE__ */
|
|
11727
|
+
return /* @__PURE__ */ jsx42(EmptySearchResult, { state });
|
|
11404
11728
|
case "pending":
|
|
11405
11729
|
default:
|
|
11406
11730
|
return null;
|
|
11407
11731
|
}
|
|
11408
11732
|
}
|
|
11409
11733
|
function EmptySearchResult({ state }) {
|
|
11410
|
-
return /* @__PURE__ */
|
|
11734
|
+
return /* @__PURE__ */ jsx42(Markdown3, { className: "m-t-2", config: { link: { target: "_blank" } }, children: state.message });
|
|
11411
11735
|
}
|
|
11412
11736
|
function SearchResults({
|
|
11413
11737
|
state
|
|
11414
11738
|
}) {
|
|
11415
11739
|
const trackEvent = useTrackEvent();
|
|
11416
|
-
return /* @__PURE__ */
|
|
11740
|
+
return /* @__PURE__ */ jsx42(NavigationOptionsList2, { children: state.results.map((result) => /* @__PURE__ */ jsx42(
|
|
11417
11741
|
NavigationOption3,
|
|
11418
11742
|
{
|
|
11419
11743
|
title: result.title,
|
|
11420
11744
|
content: result.description,
|
|
11421
|
-
media: /* @__PURE__ */
|
|
11745
|
+
media: /* @__PURE__ */ jsx42(NavigationOptionMedia, __spreadValues({}, result)),
|
|
11422
11746
|
showMediaCircle: false,
|
|
11423
11747
|
showMediaAtAllSizes: true,
|
|
11424
11748
|
onClick: () => {
|
|
@@ -11436,8 +11760,8 @@ var BlockSearchRendererComponent_default = BlockSearchRendererComponent;
|
|
|
11436
11760
|
// src/revamp/wise/renderers/SearchRenderer/InlineSearchRendererComponent.tsx
|
|
11437
11761
|
import { Markdown as Markdown4, Typeahead } from "@transferwise/components";
|
|
11438
11762
|
import { Search } from "@transferwise/icons";
|
|
11439
|
-
import { useState as
|
|
11440
|
-
import { jsx as
|
|
11763
|
+
import { useState as useState9 } from "react";
|
|
11764
|
+
import { jsx as jsx43, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
11441
11765
|
function InlineSearchRenderer({
|
|
11442
11766
|
id,
|
|
11443
11767
|
isLoading,
|
|
@@ -11446,21 +11770,21 @@ function InlineSearchRenderer({
|
|
|
11446
11770
|
state,
|
|
11447
11771
|
title
|
|
11448
11772
|
}) {
|
|
11449
|
-
const [hasSearched, setHasSearched] =
|
|
11773
|
+
const [hasSearched, setHasSearched] = useState9(false);
|
|
11450
11774
|
const trackEvent = useTrackEvent();
|
|
11451
|
-
return /* @__PURE__ */
|
|
11775
|
+
return /* @__PURE__ */ jsx43("div", { className: getMargin(margin), children: /* @__PURE__ */ jsxs14(FieldInput_default, { id, description: "", error: "", help: "", label: title, children: [
|
|
11452
11776
|
id,
|
|
11453
|
-
/* @__PURE__ */
|
|
11777
|
+
/* @__PURE__ */ jsx43(
|
|
11454
11778
|
Typeahead,
|
|
11455
11779
|
{
|
|
11456
11780
|
id: "typeahead-input-id",
|
|
11457
11781
|
name: "typeahead-input-name",
|
|
11458
11782
|
size: "md",
|
|
11459
11783
|
maxHeight: 100,
|
|
11460
|
-
footer: /* @__PURE__ */
|
|
11784
|
+
footer: /* @__PURE__ */ jsx43(TypeaheadFooter, { state, isLoading }),
|
|
11461
11785
|
multiple: false,
|
|
11462
11786
|
clearable: false,
|
|
11463
|
-
addon: /* @__PURE__ */
|
|
11787
|
+
addon: /* @__PURE__ */ jsx43(Search, { size: 24 }),
|
|
11464
11788
|
options: state.type === "results" ? state.results.map(mapResultToTypeaheadOption) : [],
|
|
11465
11789
|
minQueryLength: 1,
|
|
11466
11790
|
onChange: (values) => {
|
|
@@ -11497,47 +11821,29 @@ function mapResultToTypeaheadOption(result) {
|
|
|
11497
11821
|
}
|
|
11498
11822
|
function TypeaheadFooter({ state, isLoading }) {
|
|
11499
11823
|
if (state.type === "noResults") {
|
|
11500
|
-
return /* @__PURE__ */
|
|
11824
|
+
return /* @__PURE__ */ jsx43(Markdown4, { className: "m-t-2 m-x-2", config: { link: { target: "_blank" } }, children: state.message });
|
|
11501
11825
|
}
|
|
11502
11826
|
if (state.type === "error") {
|
|
11503
|
-
return /* @__PURE__ */
|
|
11827
|
+
return /* @__PURE__ */ jsx43("div", { className: "m-t-2 m-x-2", children: /* @__PURE__ */ jsx43(ErrorResult, { state }) });
|
|
11504
11828
|
}
|
|
11505
11829
|
if (state.type === "pending" || isLoading) {
|
|
11506
|
-
return /* @__PURE__ */
|
|
11830
|
+
return /* @__PURE__ */ jsx43("p", { className: "m-t-2 m-x-2", children: "Loading..." });
|
|
11507
11831
|
}
|
|
11508
11832
|
return null;
|
|
11509
11833
|
}
|
|
11510
11834
|
var InlineSearchRendererComponent_default = InlineSearchRenderer;
|
|
11511
11835
|
|
|
11512
11836
|
// src/revamp/wise/renderers/SearchRenderer/SearchRenderer.tsx
|
|
11513
|
-
import { jsx as
|
|
11837
|
+
import { jsx as jsx44 } from "react/jsx-runtime";
|
|
11514
11838
|
var SearchRenderer = {
|
|
11515
11839
|
canRenderType: "search",
|
|
11516
|
-
render: (props) => props.control === "inline" ? /* @__PURE__ */
|
|
11840
|
+
render: (props) => props.control === "inline" ? /* @__PURE__ */ jsx44(InlineSearchRendererComponent_default, __spreadValues({}, props)) : /* @__PURE__ */ jsx44(BlockSearchRendererComponent_default, __spreadValues({}, props))
|
|
11517
11841
|
};
|
|
11518
11842
|
var SearchRenderer_default = SearchRenderer;
|
|
11519
11843
|
|
|
11520
11844
|
// src/revamp/wise/renderers/SelectInputRenderer/RadioInputRendererComponent.tsx
|
|
11521
11845
|
import { RadioGroup } from "@transferwise/components";
|
|
11522
|
-
|
|
11523
|
-
// src/revamp/wise/renderers/SelectInputRenderer/OptionMedia.tsx
|
|
11524
|
-
import { Avatar as Avatar2, AvatarType as AvatarType2 } from "@transferwise/components";
|
|
11525
|
-
import { jsx as jsx43 } from "react/jsx-runtime";
|
|
11526
|
-
function OptionMedia({ icon, image }) {
|
|
11527
|
-
if (image == null ? void 0 : image.url) {
|
|
11528
|
-
return /* @__PURE__ */ jsx43("img", { src: image.url, alt: image.accessibilityDescription || "", width: "64px" });
|
|
11529
|
-
}
|
|
11530
|
-
if (icon && "name" in icon) {
|
|
11531
|
-
return /* @__PURE__ */ jsx43(Avatar2, { type: AvatarType2.ICON, children: /* @__PURE__ */ jsx43(DynamicIcon_default, { name: icon.name }) });
|
|
11532
|
-
}
|
|
11533
|
-
if (icon && "text" in icon) {
|
|
11534
|
-
return /* @__PURE__ */ jsx43(Avatar2, { type: AvatarType2.INITIALS, children: icon.text });
|
|
11535
|
-
}
|
|
11536
|
-
return null;
|
|
11537
|
-
}
|
|
11538
|
-
|
|
11539
|
-
// src/revamp/wise/renderers/SelectInputRenderer/RadioInputRendererComponent.tsx
|
|
11540
|
-
import { Fragment as Fragment6, jsx as jsx44, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
11846
|
+
import { Fragment as Fragment6, jsx as jsx45, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
11541
11847
|
function RadioInputRendererComponent(props) {
|
|
11542
11848
|
const {
|
|
11543
11849
|
id,
|
|
@@ -11552,7 +11858,7 @@ function RadioInputRendererComponent(props) {
|
|
|
11552
11858
|
onSelect
|
|
11553
11859
|
} = props;
|
|
11554
11860
|
return /* @__PURE__ */ jsxs15(Fragment6, { children: [
|
|
11555
|
-
/* @__PURE__ */
|
|
11861
|
+
/* @__PURE__ */ jsx45(FieldInput_default, { id, label, help, description, error, children: /* @__PURE__ */ jsx45("span", { children: /* @__PURE__ */ jsx45(
|
|
11556
11862
|
RadioGroup,
|
|
11557
11863
|
{
|
|
11558
11864
|
name: id,
|
|
@@ -11561,11 +11867,12 @@ function RadioInputRendererComponent(props) {
|
|
|
11561
11867
|
value: index,
|
|
11562
11868
|
secondary: option.description,
|
|
11563
11869
|
disabled: option.disabled || disabled,
|
|
11564
|
-
avatar: /* @__PURE__ */
|
|
11870
|
+
avatar: /* @__PURE__ */ jsx45(OptionMedia, { icon: option.icon, image: option.image })
|
|
11565
11871
|
})),
|
|
11566
11872
|
selectedValue: selectedIndex != null ? selectedIndex : void 0,
|
|
11567
11873
|
onChange: onSelect
|
|
11568
|
-
}
|
|
11874
|
+
},
|
|
11875
|
+
`${id}-${selectedIndex}`
|
|
11569
11876
|
) }) }),
|
|
11570
11877
|
children
|
|
11571
11878
|
] });
|
|
@@ -11574,7 +11881,7 @@ function RadioInputRendererComponent(props) {
|
|
|
11574
11881
|
// src/revamp/wise/renderers/SelectInputRenderer/TabInputRendererComponent.tsx
|
|
11575
11882
|
import { Tabs } from "@transferwise/components";
|
|
11576
11883
|
import { useEffect as useEffect4 } from "react";
|
|
11577
|
-
import { Fragment as Fragment7, jsx as
|
|
11884
|
+
import { Fragment as Fragment7, jsx as jsx46, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
11578
11885
|
function TabInputRendererComponent(props) {
|
|
11579
11886
|
const {
|
|
11580
11887
|
id,
|
|
@@ -11594,7 +11901,7 @@ function TabInputRendererComponent(props) {
|
|
|
11594
11901
|
}
|
|
11595
11902
|
}, [selectedIndex, onSelect, options.length]);
|
|
11596
11903
|
return /* @__PURE__ */ jsxs16(Fragment7, { children: [
|
|
11597
|
-
/* @__PURE__ */
|
|
11904
|
+
/* @__PURE__ */ jsx46(FieldInput_default, { id, label, help, description, error, children: /* @__PURE__ */ jsx46(
|
|
11598
11905
|
Tabs,
|
|
11599
11906
|
{
|
|
11600
11907
|
name: id,
|
|
@@ -11603,7 +11910,7 @@ function TabInputRendererComponent(props) {
|
|
|
11603
11910
|
title: option.title,
|
|
11604
11911
|
// if we pass null, we get some props-types console errors
|
|
11605
11912
|
// eslint-disable-next-line react/jsx-no-useless-fragment
|
|
11606
|
-
content: /* @__PURE__ */
|
|
11913
|
+
content: /* @__PURE__ */ jsx46(Fragment7, {}),
|
|
11607
11914
|
disabled: option.disabled || disabled
|
|
11608
11915
|
})),
|
|
11609
11916
|
onTabSelect: onSelect
|
|
@@ -11615,26 +11922,26 @@ function TabInputRendererComponent(props) {
|
|
|
11615
11922
|
var isValidIndex = (index, options) => index !== null && index >= 0 && index < options;
|
|
11616
11923
|
|
|
11617
11924
|
// src/revamp/wise/renderers/SelectInputRenderer/SelectInputRendererComponent.tsx
|
|
11618
|
-
import { SelectInput, SelectInputOptionContent } from "@transferwise/components";
|
|
11925
|
+
import { SelectInput as SelectInput2, SelectInputOptionContent as SelectInputOptionContent2 } from "@transferwise/components";
|
|
11619
11926
|
|
|
11620
11927
|
// src/revamp/wise/renderers/SelectInputRenderer/SelectTriggerMedia.tsx
|
|
11621
11928
|
import { Avatar as Avatar3, AvatarType as AvatarType3 } from "@transferwise/components";
|
|
11622
|
-
import { jsx as
|
|
11929
|
+
import { jsx as jsx47 } from "react/jsx-runtime";
|
|
11623
11930
|
function SelectTriggerMedia({ icon, image }) {
|
|
11624
11931
|
if (image == null ? void 0 : image.url) {
|
|
11625
11932
|
return null;
|
|
11626
11933
|
}
|
|
11627
11934
|
if (icon && "name" in icon) {
|
|
11628
|
-
return /* @__PURE__ */
|
|
11935
|
+
return /* @__PURE__ */ jsx47(Avatar3, { type: AvatarType3.ICON, size: 24, children: /* @__PURE__ */ jsx47(DynamicIcon_default, { name: icon.name }) });
|
|
11629
11936
|
}
|
|
11630
11937
|
if (icon && "text" in icon) {
|
|
11631
|
-
return /* @__PURE__ */
|
|
11938
|
+
return /* @__PURE__ */ jsx47(Avatar3, { type: AvatarType3.ICON, size: 24, children: icon.text });
|
|
11632
11939
|
}
|
|
11633
11940
|
return null;
|
|
11634
11941
|
}
|
|
11635
11942
|
|
|
11636
11943
|
// src/revamp/wise/renderers/SelectInputRenderer/SelectInputRendererComponent.tsx
|
|
11637
|
-
import { Fragment as Fragment8, jsx as
|
|
11944
|
+
import { Fragment as Fragment8, jsx as jsx48, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
11638
11945
|
function SelectInputRendererComponent(props) {
|
|
11639
11946
|
const {
|
|
11640
11947
|
id,
|
|
@@ -11669,17 +11976,17 @@ function SelectInputRendererComponent(props) {
|
|
|
11669
11976
|
const contentProps = withinTrigger ? {
|
|
11670
11977
|
title: option.title,
|
|
11671
11978
|
note: option.description,
|
|
11672
|
-
icon: /* @__PURE__ */
|
|
11979
|
+
icon: /* @__PURE__ */ jsx48(SelectTriggerMedia, { icon: option.icon, image: option.image })
|
|
11673
11980
|
} : {
|
|
11674
11981
|
title: option.title,
|
|
11675
11982
|
description: option.description,
|
|
11676
|
-
icon: /* @__PURE__ */
|
|
11983
|
+
icon: /* @__PURE__ */ jsx48(OptionMedia, { icon: option.icon, image: option.image })
|
|
11677
11984
|
};
|
|
11678
|
-
return /* @__PURE__ */
|
|
11985
|
+
return /* @__PURE__ */ jsx48(SelectInputOptionContent2, __spreadValues({}, contentProps));
|
|
11679
11986
|
};
|
|
11680
11987
|
return /* @__PURE__ */ jsxs17(Fragment8, { children: [
|
|
11681
|
-
/* @__PURE__ */
|
|
11682
|
-
|
|
11988
|
+
/* @__PURE__ */ jsx48(FieldInput_default, { id, label, help, description, error, children: /* @__PURE__ */ jsx48(
|
|
11989
|
+
SelectInput2,
|
|
11683
11990
|
{
|
|
11684
11991
|
name: id,
|
|
11685
11992
|
placeholder,
|
|
@@ -11699,7 +12006,7 @@ function SelectInputRendererComponent(props) {
|
|
|
11699
12006
|
// src/revamp/wise/renderers/SelectInputRenderer/SegmentedInputRendererComponent.tsx
|
|
11700
12007
|
import { useEffect as useEffect5 } from "react";
|
|
11701
12008
|
import { SegmentedControl } from "@transferwise/components";
|
|
11702
|
-
import { Fragment as Fragment9, jsx as
|
|
12009
|
+
import { Fragment as Fragment9, jsx as jsx49, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
11703
12010
|
function SegmentedInputRendererComponent(props) {
|
|
11704
12011
|
const { id, children, description, error, help, label, options, selectedIndex, onSelect } = props;
|
|
11705
12012
|
useEffect5(() => {
|
|
@@ -11708,7 +12015,7 @@ function SegmentedInputRendererComponent(props) {
|
|
|
11708
12015
|
}
|
|
11709
12016
|
}, [selectedIndex, onSelect, options.length]);
|
|
11710
12017
|
return /* @__PURE__ */ jsxs18(Fragment9, { children: [
|
|
11711
|
-
/* @__PURE__ */
|
|
12018
|
+
/* @__PURE__ */ jsx49(FieldInput_default, { id, label, help, description, error, children: /* @__PURE__ */ jsx49(
|
|
11712
12019
|
SegmentedControl,
|
|
11713
12020
|
{
|
|
11714
12021
|
name: `${id}-segmented-control`,
|
|
@@ -11723,26 +12030,26 @@ function SegmentedInputRendererComponent(props) {
|
|
|
11723
12030
|
onChange: (value) => onSelect(Number(value))
|
|
11724
12031
|
}
|
|
11725
12032
|
) }),
|
|
11726
|
-
/* @__PURE__ */
|
|
12033
|
+
/* @__PURE__ */ jsx49("div", { id: `${id}-children`, children })
|
|
11727
12034
|
] });
|
|
11728
12035
|
}
|
|
11729
12036
|
var isValidIndex2 = (index, options) => index !== null && index >= 0 && index < options;
|
|
11730
12037
|
|
|
11731
12038
|
// src/revamp/wise/renderers/SelectInputRenderer/SelectInputRenderer.tsx
|
|
11732
|
-
import { jsx as
|
|
12039
|
+
import { jsx as jsx50 } from "react/jsx-runtime";
|
|
11733
12040
|
var SelectInputRenderer = {
|
|
11734
12041
|
canRenderType: "input-select",
|
|
11735
12042
|
render: (props) => {
|
|
11736
12043
|
switch (props.control) {
|
|
11737
12044
|
case "radio":
|
|
11738
|
-
return /* @__PURE__ */
|
|
12045
|
+
return /* @__PURE__ */ jsx50(RadioInputRendererComponent, __spreadValues({}, props));
|
|
11739
12046
|
case "tab":
|
|
11740
|
-
return props.options.length > 3 ? /* @__PURE__ */
|
|
12047
|
+
return props.options.length > 3 ? /* @__PURE__ */ jsx50(SelectInputRendererComponent, __spreadValues({}, props)) : /* @__PURE__ */ jsx50(TabInputRendererComponent, __spreadValues({}, props));
|
|
11741
12048
|
case "segmented":
|
|
11742
|
-
return props.options.length > 3 ? /* @__PURE__ */
|
|
12049
|
+
return props.options.length > 3 ? /* @__PURE__ */ jsx50(SelectInputRendererComponent, __spreadValues({}, props)) : /* @__PURE__ */ jsx50(SegmentedInputRendererComponent, __spreadValues({}, props));
|
|
11743
12050
|
case "select":
|
|
11744
12051
|
default:
|
|
11745
|
-
return /* @__PURE__ */
|
|
12052
|
+
return /* @__PURE__ */ jsx50(SelectInputRendererComponent, __spreadValues({}, props));
|
|
11746
12053
|
}
|
|
11747
12054
|
}
|
|
11748
12055
|
};
|
|
@@ -11750,17 +12057,17 @@ var SelectInputRenderer_default = SelectInputRenderer;
|
|
|
11750
12057
|
|
|
11751
12058
|
// src/revamp/wise/renderers/StatusListRenderer.tsx
|
|
11752
12059
|
import { Header as Header4, Summary } from "@transferwise/components";
|
|
11753
|
-
import { jsx as
|
|
12060
|
+
import { jsx as jsx51, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
11754
12061
|
var StatusListRenderer = {
|
|
11755
12062
|
canRenderType: "status-list",
|
|
11756
12063
|
render: ({ margin, items, title }) => /* @__PURE__ */ jsxs19("div", { className: getMargin(margin), children: [
|
|
11757
|
-
title ? /* @__PURE__ */
|
|
11758
|
-
items.map(({ description, icon, status, title: itemTitle }) => /* @__PURE__ */
|
|
12064
|
+
title ? /* @__PURE__ */ jsx51(Header4, { title }) : null,
|
|
12065
|
+
items.map(({ description, icon, status, title: itemTitle }) => /* @__PURE__ */ jsx51(
|
|
11759
12066
|
Summary,
|
|
11760
12067
|
{
|
|
11761
12068
|
title: itemTitle,
|
|
11762
12069
|
description,
|
|
11763
|
-
icon: icon && "name" in icon ? /* @__PURE__ */
|
|
12070
|
+
icon: icon && "name" in icon ? /* @__PURE__ */ jsx51(DynamicIcon_default, { name: icon.name }) : null,
|
|
11764
12071
|
status: mapStatus(status)
|
|
11765
12072
|
},
|
|
11766
12073
|
`${title}/${description || ""}`
|
|
@@ -11783,31 +12090,31 @@ import {
|
|
|
11783
12090
|
TextArea as TextArea2,
|
|
11784
12091
|
TextareaWithDisplayFormat
|
|
11785
12092
|
} from "@transferwise/components";
|
|
11786
|
-
import { jsx as
|
|
12093
|
+
import { jsx as jsx52 } from "react/jsx-runtime";
|
|
11787
12094
|
function VariableTextInput({
|
|
11788
12095
|
control,
|
|
11789
12096
|
inputProps
|
|
11790
12097
|
}) {
|
|
11791
12098
|
switch (control) {
|
|
11792
12099
|
case "password":
|
|
11793
|
-
return /* @__PURE__ */
|
|
12100
|
+
return /* @__PURE__ */ jsx52(TextInput, __spreadValues({ type: "password" }, inputProps));
|
|
11794
12101
|
case "email":
|
|
11795
|
-
return /* @__PURE__ */
|
|
12102
|
+
return /* @__PURE__ */ jsx52(TextInput, __spreadValues({ type: "email" }, inputProps));
|
|
11796
12103
|
case "textarea":
|
|
11797
|
-
return /* @__PURE__ */
|
|
12104
|
+
return /* @__PURE__ */ jsx52(TextAreaInput, __spreadValues({}, inputProps));
|
|
11798
12105
|
case "numeric":
|
|
11799
|
-
return /* @__PURE__ */
|
|
12106
|
+
return /* @__PURE__ */ jsx52(NumericInput, __spreadValues({ type: "number" }, inputProps));
|
|
11800
12107
|
case "phone-number":
|
|
11801
|
-
return /* @__PURE__ */
|
|
12108
|
+
return /* @__PURE__ */ jsx52(PhoneNumberInput, __spreadValues({}, inputProps));
|
|
11802
12109
|
default:
|
|
11803
|
-
return /* @__PURE__ */
|
|
12110
|
+
return /* @__PURE__ */ jsx52(TextInput, __spreadValues({ type: "text" }, inputProps));
|
|
11804
12111
|
}
|
|
11805
12112
|
}
|
|
11806
12113
|
function TextInput(_a) {
|
|
11807
12114
|
var _b = _a, { id, displayFormat, onChange } = _b, rest = __objRest(_b, ["id", "displayFormat", "onChange"]);
|
|
11808
12115
|
if (typeof displayFormat === "string") {
|
|
11809
12116
|
const inputProps = __spreadValues({ id, name: id, className: "form-control" }, rest);
|
|
11810
|
-
return /* @__PURE__ */
|
|
12117
|
+
return /* @__PURE__ */ jsx52(
|
|
11811
12118
|
InputWithDisplayFormat,
|
|
11812
12119
|
__spreadValues({
|
|
11813
12120
|
displayPattern: displayFormat,
|
|
@@ -11815,29 +12122,29 @@ function TextInput(_a) {
|
|
|
11815
12122
|
}, inputProps)
|
|
11816
12123
|
);
|
|
11817
12124
|
}
|
|
11818
|
-
return /* @__PURE__ */
|
|
12125
|
+
return /* @__PURE__ */ jsx52(Input6, __spreadValues({ id, name: id, onChange: (e) => onChange(e.target.value) }, rest));
|
|
11819
12126
|
}
|
|
11820
12127
|
function TextAreaInput(_a) {
|
|
11821
12128
|
var _b = _a, { id, displayFormat, onChange } = _b, rest = __objRest(_b, ["id", "displayFormat", "onChange"]);
|
|
11822
12129
|
const textAreaProps = __spreadValues({ id, name: id }, rest);
|
|
11823
|
-
return typeof displayFormat === "string" ? /* @__PURE__ */
|
|
12130
|
+
return typeof displayFormat === "string" ? /* @__PURE__ */ jsx52(
|
|
11824
12131
|
TextareaWithDisplayFormat,
|
|
11825
12132
|
__spreadValues({
|
|
11826
12133
|
displayPattern: displayFormat,
|
|
11827
12134
|
onChange: (newValue) => onChange(newValue)
|
|
11828
12135
|
}, textAreaProps)
|
|
11829
|
-
) : /* @__PURE__ */
|
|
12136
|
+
) : /* @__PURE__ */ jsx52(TextArea2, __spreadValues({ onChange: (e) => onChange(e.target.value) }, textAreaProps));
|
|
11830
12137
|
}
|
|
11831
12138
|
function NumericInput(_a) {
|
|
11832
12139
|
var _b = _a, { id, displayFormat, onChange } = _b, rest = __objRest(_b, ["id", "displayFormat", "onChange"]);
|
|
11833
12140
|
const numericProps = __spreadValues({ id, name: id, onWheel }, rest);
|
|
11834
|
-
return typeof displayFormat === "string" ? /* @__PURE__ */
|
|
12141
|
+
return typeof displayFormat === "string" ? /* @__PURE__ */ jsx52(
|
|
11835
12142
|
InputWithDisplayFormat,
|
|
11836
12143
|
__spreadValues({
|
|
11837
12144
|
displayPattern: displayFormat,
|
|
11838
12145
|
onChange: (newValue) => onChange(numericValueOrNull(newValue))
|
|
11839
12146
|
}, numericProps)
|
|
11840
|
-
) : /* @__PURE__ */
|
|
12147
|
+
) : /* @__PURE__ */ jsx52(
|
|
11841
12148
|
Input6,
|
|
11842
12149
|
__spreadValues({
|
|
11843
12150
|
onChange: ({ target: { value: newValue } }) => onChange(numericValueOrNull(newValue))
|
|
@@ -11846,12 +12153,12 @@ function NumericInput(_a) {
|
|
|
11846
12153
|
}
|
|
11847
12154
|
function PhoneNumberInput(_a) {
|
|
11848
12155
|
var _b = _a, { value } = _b, rest = __objRest(_b, ["value"]);
|
|
11849
|
-
return /* @__PURE__ */
|
|
12156
|
+
return /* @__PURE__ */ jsx52(PhoneNumber, __spreadValues({ initialValue: value }, rest));
|
|
11850
12157
|
}
|
|
11851
12158
|
var VariableTextInput_default = VariableTextInput;
|
|
11852
12159
|
|
|
11853
12160
|
// src/revamp/wise/renderers/TextInputRenderer.tsx
|
|
11854
|
-
import { jsx as
|
|
12161
|
+
import { jsx as jsx53 } from "react/jsx-runtime";
|
|
11855
12162
|
var TextInputRenderer = {
|
|
11856
12163
|
canRenderType: "input-text",
|
|
11857
12164
|
render: (props) => {
|
|
@@ -11876,14 +12183,14 @@ var TextInputRenderer = {
|
|
|
11876
12183
|
]);
|
|
11877
12184
|
const value = initialValue != null ? initialValue : "";
|
|
11878
12185
|
const inputProps = __spreadProps(__spreadValues({}, rest), { value, id });
|
|
11879
|
-
return /* @__PURE__ */
|
|
12186
|
+
return /* @__PURE__ */ jsx53(FieldInput_default, { id, label, description, error, help, children: /* @__PURE__ */ jsx53(VariableTextInput_default, { control, inputProps }) });
|
|
11880
12187
|
}
|
|
11881
12188
|
};
|
|
11882
12189
|
var TextInputRenderer_default = TextInputRenderer;
|
|
11883
12190
|
|
|
11884
12191
|
// src/revamp/wise/renderers/UploadInputRenderer.tsx
|
|
11885
12192
|
import { Upload, UploadInput as UploadInput2 } from "@transferwise/components";
|
|
11886
|
-
import { jsx as
|
|
12193
|
+
import { jsx as jsx54 } from "react/jsx-runtime";
|
|
11887
12194
|
var UploadInputRenderer = {
|
|
11888
12195
|
canRenderType: "input-upload",
|
|
11889
12196
|
render: (props) => {
|
|
@@ -11899,7 +12206,7 @@ var UploadInputRenderer = {
|
|
|
11899
12206
|
};
|
|
11900
12207
|
return (
|
|
11901
12208
|
// We don't pass help here as there is no sensible place to display it
|
|
11902
|
-
/* @__PURE__ */
|
|
12209
|
+
/* @__PURE__ */ jsx54(UploadFieldInput_default, { id, label: void 0, description: void 0, error, children: /* @__PURE__ */ jsx54(
|
|
11903
12210
|
UploadInput2,
|
|
11904
12211
|
{
|
|
11905
12212
|
id,
|
|
@@ -11954,7 +12261,7 @@ var LargeUploadRenderer = {
|
|
|
11954
12261
|
throw e;
|
|
11955
12262
|
}
|
|
11956
12263
|
};
|
|
11957
|
-
return /* @__PURE__ */
|
|
12264
|
+
return /* @__PURE__ */ jsx54(FieldInput_default, { id, label, description, error, help, children: /* @__PURE__ */ jsx54(
|
|
11958
12265
|
Upload,
|
|
11959
12266
|
__spreadProps(__spreadValues({}, uploadProps), {
|
|
11960
12267
|
usAccept: getAcceptsString(accepts),
|
|
@@ -11969,7 +12276,7 @@ var LargeUploadRenderer = {
|
|
|
11969
12276
|
|
|
11970
12277
|
// src/revamp/wise/renderers/ReviewRenderer.tsx
|
|
11971
12278
|
import { DefinitionList, Header as Header5 } from "@transferwise/components";
|
|
11972
|
-
import { Fragment as Fragment10, jsx as
|
|
12279
|
+
import { Fragment as Fragment10, jsx as jsx55, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
11973
12280
|
var ReviewRenderer = {
|
|
11974
12281
|
canRenderType: "review",
|
|
11975
12282
|
render: ({ callToAction, control, fields, margin, title }) => {
|
|
@@ -11982,8 +12289,8 @@ var ReviewRenderer = {
|
|
|
11982
12289
|
}
|
|
11983
12290
|
} : void 0;
|
|
11984
12291
|
return /* @__PURE__ */ jsxs20("div", { className: getMargin(margin), children: [
|
|
11985
|
-
(title || callToAction) && /* @__PURE__ */
|
|
11986
|
-
/* @__PURE__ */
|
|
12292
|
+
(title || callToAction) && /* @__PURE__ */ jsx55(Header5, { title: title != null ? title : "", action }),
|
|
12293
|
+
/* @__PURE__ */ jsx55("div", { className: margin, children: /* @__PURE__ */ jsx55(
|
|
11987
12294
|
DefinitionList,
|
|
11988
12295
|
{
|
|
11989
12296
|
layout: orientation,
|
|
@@ -12001,13 +12308,13 @@ var ReviewRenderer_default = ReviewRenderer;
|
|
|
12001
12308
|
var getFieldValue = (value, help, orientation) => {
|
|
12002
12309
|
if (help) {
|
|
12003
12310
|
return orientation === "HORIZONTAL_RIGHT_ALIGNED" ? /* @__PURE__ */ jsxs20(Fragment10, { children: [
|
|
12004
|
-
/* @__PURE__ */
|
|
12311
|
+
/* @__PURE__ */ jsx55(Help_default, { help }),
|
|
12005
12312
|
" ",
|
|
12006
12313
|
value
|
|
12007
12314
|
] }) : /* @__PURE__ */ jsxs20(Fragment10, { children: [
|
|
12008
12315
|
value,
|
|
12009
12316
|
" ",
|
|
12010
|
-
/* @__PURE__ */
|
|
12317
|
+
/* @__PURE__ */ jsx55(Help_default, { help })
|
|
12011
12318
|
] });
|
|
12012
12319
|
}
|
|
12013
12320
|
return value;
|
|
@@ -12017,11 +12324,11 @@ var getFieldValue = (value, help, orientation) => {
|
|
|
12017
12324
|
import { useMemo as useMemo4 } from "react";
|
|
12018
12325
|
|
|
12019
12326
|
// src/revamp/wise/renderers/step/ExternalConfirmationDialog.tsx
|
|
12020
|
-
import { useIntl as
|
|
12327
|
+
import { useIntl as useIntl8 } from "react-intl";
|
|
12021
12328
|
|
|
12022
12329
|
// src/common/messages/external-confirmation.messages.ts
|
|
12023
|
-
import { defineMessages as
|
|
12024
|
-
var external_confirmation_messages_default =
|
|
12330
|
+
import { defineMessages as defineMessages9 } from "react-intl";
|
|
12331
|
+
var external_confirmation_messages_default = defineMessages9({
|
|
12025
12332
|
title: {
|
|
12026
12333
|
id: "dynamicFlows.ExternalConfirmation.title",
|
|
12027
12334
|
defaultMessage: "Please confirm",
|
|
@@ -12046,17 +12353,17 @@ var external_confirmation_messages_default = defineMessages8({
|
|
|
12046
12353
|
|
|
12047
12354
|
// src/revamp/wise/renderers/step/ExternalConfirmationDialog.tsx
|
|
12048
12355
|
import { Button as Button5, Markdown as Markdown5 } from "@transferwise/components";
|
|
12049
|
-
import { jsx as
|
|
12356
|
+
import { jsx as jsx56, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
12050
12357
|
function ExternalConfirmationDialog({
|
|
12051
12358
|
external,
|
|
12052
12359
|
onClose
|
|
12053
12360
|
}) {
|
|
12054
|
-
const { formatMessage } =
|
|
12055
|
-
return /* @__PURE__ */
|
|
12056
|
-
/* @__PURE__ */
|
|
12057
|
-
/* @__PURE__ */
|
|
12058
|
-
/* @__PURE__ */
|
|
12059
|
-
/* @__PURE__ */
|
|
12361
|
+
const { formatMessage } = useIntl8();
|
|
12362
|
+
return /* @__PURE__ */ jsx56("div", { className: "df-box-renderer-fixed-width", children: /* @__PURE__ */ jsxs21("div", { className: "df-box-renderer-width-lg", children: [
|
|
12363
|
+
/* @__PURE__ */ jsx56("h2", { className: "text-xs-center m-b-5", children: formatMessage(external_confirmation_messages_default.title) }),
|
|
12364
|
+
/* @__PURE__ */ jsx56(Markdown5, { config: { link: { target: "_blank" } }, className: "text-xs-center m-b-5", children: formatMessage(external_confirmation_messages_default.description, { origin: getOrigin(external.url) }) }),
|
|
12365
|
+
/* @__PURE__ */ jsx56("div", { className: "df-box-renderer-fixed-width", children: /* @__PURE__ */ jsxs21("div", { className: "df-box-renderer-width-lg", children: [
|
|
12366
|
+
/* @__PURE__ */ jsx56(
|
|
12060
12367
|
Button5,
|
|
12061
12368
|
{
|
|
12062
12369
|
block: true,
|
|
@@ -12070,7 +12377,7 @@ function ExternalConfirmationDialog({
|
|
|
12070
12377
|
children: formatMessage(external_confirmation_messages_default.open)
|
|
12071
12378
|
}
|
|
12072
12379
|
),
|
|
12073
|
-
/* @__PURE__ */
|
|
12380
|
+
/* @__PURE__ */ jsx56(Button5, { block: true, className: "m-b-2", priority: "tertiary", size: "md", onClick: onClose, children: formatMessage(external_confirmation_messages_default.cancel) })
|
|
12074
12381
|
] }) })
|
|
12075
12382
|
] }) });
|
|
12076
12383
|
}
|
|
@@ -12083,10 +12390,10 @@ function getOrigin(url) {
|
|
|
12083
12390
|
}
|
|
12084
12391
|
|
|
12085
12392
|
// src/revamp/wise/renderers/step/useExternal.tsx
|
|
12086
|
-
import { useEffect as useEffect6, useState as
|
|
12393
|
+
import { useEffect as useEffect6, useState as useState10 } from "react";
|
|
12087
12394
|
function useExternal(url) {
|
|
12088
|
-
const [externalWindow, setExternalWindow] =
|
|
12089
|
-
const [hasDismissed, setHasDismissed] =
|
|
12395
|
+
const [externalWindow, setExternalWindow] = useState10(null);
|
|
12396
|
+
const [hasDismissed, setHasDismissed] = useState10(false);
|
|
12090
12397
|
const dismissConfirmation = () => setHasDismissed(true);
|
|
12091
12398
|
useEffect6(() => {
|
|
12092
12399
|
if (url) {
|
|
@@ -12101,7 +12408,7 @@ function useExternal(url) {
|
|
|
12101
12408
|
// src/revamp/wise/renderers/step/BackButton.tsx
|
|
12102
12409
|
import { Avatar as Avatar4 } from "@transferwise/components";
|
|
12103
12410
|
import { ArrowLeft } from "@transferwise/icons";
|
|
12104
|
-
import { jsx as
|
|
12411
|
+
import { jsx as jsx57, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
12105
12412
|
function BackButton({ title, onClick }) {
|
|
12106
12413
|
return /* @__PURE__ */ jsxs22(
|
|
12107
12414
|
"a",
|
|
@@ -12114,8 +12421,8 @@ function BackButton({ title, onClick }) {
|
|
|
12114
12421
|
onClick();
|
|
12115
12422
|
},
|
|
12116
12423
|
children: [
|
|
12117
|
-
/* @__PURE__ */
|
|
12118
|
-
/* @__PURE__ */
|
|
12424
|
+
/* @__PURE__ */ jsx57("span", { className: "sr-only", children: title }),
|
|
12425
|
+
/* @__PURE__ */ jsx57(Avatar4, { type: "icon", children: /* @__PURE__ */ jsx57(ArrowLeft, { size: "24" }) })
|
|
12119
12426
|
]
|
|
12120
12427
|
}
|
|
12121
12428
|
);
|
|
@@ -12123,7 +12430,7 @@ function BackButton({ title, onClick }) {
|
|
|
12123
12430
|
var BackButton_default = BackButton;
|
|
12124
12431
|
|
|
12125
12432
|
// src/revamp/wise/renderers/step/StepRenderer.tsx
|
|
12126
|
-
import { jsx as
|
|
12433
|
+
import { jsx as jsx58, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
12127
12434
|
var StepRenderer = {
|
|
12128
12435
|
canRenderType: "step",
|
|
12129
12436
|
render: StepRendererComponent
|
|
@@ -12133,10 +12440,10 @@ function StepRendererComponent(props) {
|
|
|
12133
12440
|
const value = useMemo4(() => ({ loadingState, trackEvent }), [loadingState, trackEvent]);
|
|
12134
12441
|
const { requiresUserConfirmation, dismissConfirmation } = useExternal(external == null ? void 0 : external.url);
|
|
12135
12442
|
if ((external == null ? void 0 : external.url) && requiresUserConfirmation) {
|
|
12136
|
-
return /* @__PURE__ */
|
|
12443
|
+
return /* @__PURE__ */ jsx58(ExternalConfirmationDialog, { external, onClose: dismissConfirmation });
|
|
12137
12444
|
}
|
|
12138
12445
|
return /* @__PURE__ */ jsxs23(StepRendererContextProvider, { value, children: [
|
|
12139
|
-
back ? /* @__PURE__ */
|
|
12446
|
+
back ? /* @__PURE__ */ jsx58(BackButton_default, __spreadValues({}, back)) : null,
|
|
12140
12447
|
children
|
|
12141
12448
|
] });
|
|
12142
12449
|
}
|
|
@@ -12161,6 +12468,7 @@ var getWiseRenderers = () => [
|
|
|
12161
12468
|
LoadingIndicatorRenderer_default,
|
|
12162
12469
|
MarkdownRenderer_default,
|
|
12163
12470
|
ModalRenderer_default,
|
|
12471
|
+
MultiSelectInputRenderer_default,
|
|
12164
12472
|
MultiUploadInputRenderer_default,
|
|
12165
12473
|
NumberInputRenderer_default,
|
|
12166
12474
|
ParagraphRenderer_default,
|
|
@@ -12175,18 +12483,18 @@ var getWiseRenderers = () => [
|
|
|
12175
12483
|
];
|
|
12176
12484
|
|
|
12177
12485
|
// src/revamp/DynamicFlowWise.tsx
|
|
12178
|
-
import { jsx as
|
|
12486
|
+
import { jsx as jsx59 } from "react/jsx-runtime";
|
|
12179
12487
|
var wiseRenderers = getWiseRenderers();
|
|
12180
12488
|
function DynamicFlowWise(props) {
|
|
12181
12489
|
const { httpClient, renderers } = props;
|
|
12182
12490
|
const mergedRenderers = useMemo5(() => [...renderers != null ? renderers : [], ...wiseRenderers], [renderers]);
|
|
12183
|
-
return /* @__PURE__ */
|
|
12491
|
+
return /* @__PURE__ */ jsx59(HttpClientProvider, { httpClient, children: /* @__PURE__ */ jsx59(DynamicFlowCore, __spreadProps(__spreadValues({}, props), { renderers: mergedRenderers })) });
|
|
12184
12492
|
}
|
|
12185
12493
|
var DynamicFlowWise_default = DynamicFlowWise;
|
|
12186
12494
|
|
|
12187
12495
|
// src/revamp/DynamicFragmentWise.tsx
|
|
12188
12496
|
import { forwardRef as forwardRef3, useImperativeHandle, useMemo as useMemo6 } from "react";
|
|
12189
|
-
import { jsx as
|
|
12497
|
+
import { jsx as jsx60 } from "react/jsx-runtime";
|
|
12190
12498
|
var wiseRenderers2 = getWiseRenderers();
|
|
12191
12499
|
var DynamicFragmentWise = forwardRef3(function DynamicFragmentWise2(props, ref) {
|
|
12192
12500
|
const { httpClient, onEvent, onError, renderers } = props;
|
|
@@ -12211,14 +12519,14 @@ var DynamicFragmentWise = forwardRef3(function DynamicFragmentWise2(props, ref)
|
|
|
12211
12519
|
() => getRenderFunction([CoreContainerRenderer, ...mergedRenderers, StepRenderer]),
|
|
12212
12520
|
[mergedRenderers]
|
|
12213
12521
|
);
|
|
12214
|
-
return /* @__PURE__ */
|
|
12522
|
+
return /* @__PURE__ */ jsx60(
|
|
12215
12523
|
ErrorBoundary_default,
|
|
12216
12524
|
{
|
|
12217
12525
|
onError: (error) => {
|
|
12218
12526
|
onEvent == null ? void 0 : onEvent("Dynamic Flow - Failed");
|
|
12219
12527
|
onError(error);
|
|
12220
12528
|
},
|
|
12221
|
-
children: /* @__PURE__ */
|
|
12529
|
+
children: /* @__PURE__ */ jsx60(HttpClientProvider, { httpClient, children: stepComponentRef.current ? render(stepComponentRef.current) : null })
|
|
12222
12530
|
}
|
|
12223
12531
|
);
|
|
12224
12532
|
});
|
|
@@ -12529,15 +12837,15 @@ function isReference(block) {
|
|
|
12529
12837
|
}
|
|
12530
12838
|
|
|
12531
12839
|
// src/legacy/dynamicFlow/DynamicFlow.tsx
|
|
12532
|
-
import { useCallback as useCallback11, useEffect as useEffect26, useMemo as useMemo22, useState as
|
|
12840
|
+
import { useCallback as useCallback11, useEffect as useEffect26, useMemo as useMemo22, useState as useState35 } from "react";
|
|
12533
12841
|
|
|
12534
12842
|
// src/legacy/common/contexts/dynamicFlowContexts/DynamicFlowContexts.tsx
|
|
12535
12843
|
import { createContext as createContext4, useContext as useContext5, useMemo as useMemo7 } from "react";
|
|
12536
12844
|
|
|
12537
12845
|
// src/legacy/common/contexts/dynamicFlowContexts/usePendingPromiseCounter.ts
|
|
12538
|
-
import { useCallback as useCallback3, useState as
|
|
12846
|
+
import { useCallback as useCallback3, useState as useState11 } from "react";
|
|
12539
12847
|
function usePendingPromiseCounter() {
|
|
12540
|
-
const [count, setCount] =
|
|
12848
|
+
const [count, setCount] = useState11(0);
|
|
12541
12849
|
const addPendingPromise = useCallback3(
|
|
12542
12850
|
(promise) => {
|
|
12543
12851
|
setCount((c) => c + 1);
|
|
@@ -12552,7 +12860,7 @@ var noop2 = () => {
|
|
|
12552
12860
|
};
|
|
12553
12861
|
|
|
12554
12862
|
// src/legacy/common/contexts/dynamicFlowContexts/DynamicFlowContexts.tsx
|
|
12555
|
-
import { jsx as
|
|
12863
|
+
import { jsx as jsx61 } from "react/jsx-runtime";
|
|
12556
12864
|
var defaultContextValue = {
|
|
12557
12865
|
loading: false,
|
|
12558
12866
|
registerPersistAsyncPromise: (promise) => {
|
|
@@ -12567,7 +12875,7 @@ var DynamicFlowProvider = ({ loading, children }) => {
|
|
|
12567
12875
|
registerPersistAsyncPromise: addPendingPromise
|
|
12568
12876
|
};
|
|
12569
12877
|
}, [loading, pendingPromises, addPendingPromise]);
|
|
12570
|
-
return /* @__PURE__ */
|
|
12878
|
+
return /* @__PURE__ */ jsx61(DFContext.Provider, { value: providerValue, children });
|
|
12571
12879
|
};
|
|
12572
12880
|
var useDynamicFlow = () => {
|
|
12573
12881
|
const context = useContext5(DFContext);
|
|
@@ -12576,7 +12884,7 @@ var useDynamicFlow = () => {
|
|
|
12576
12884
|
|
|
12577
12885
|
// src/legacy/common/contexts/eventsContext/EventsContext.tsx
|
|
12578
12886
|
import { createContext as createContext5, useContext as useContext6, useMemo as useMemo8 } from "react";
|
|
12579
|
-
import { jsx as
|
|
12887
|
+
import { jsx as jsx62 } from "react/jsx-runtime";
|
|
12580
12888
|
var EventsContext = createContext5({
|
|
12581
12889
|
triggerEvent: () => {
|
|
12582
12890
|
}
|
|
@@ -12586,7 +12894,7 @@ function EventsContextProvider({ metadata, children, onEvent }) {
|
|
|
12586
12894
|
() => ({ triggerEvent: getEventDispatcher(onEvent, metadata) }),
|
|
12587
12895
|
[onEvent, metadata]
|
|
12588
12896
|
);
|
|
12589
|
-
return /* @__PURE__ */
|
|
12897
|
+
return /* @__PURE__ */ jsx62(EventsContext.Provider, { value, children });
|
|
12590
12898
|
}
|
|
12591
12899
|
function useEventDispatcher() {
|
|
12592
12900
|
const { triggerEvent } = useContext6(EventsContext);
|
|
@@ -12601,7 +12909,7 @@ var getEventDispatcher = (onEvent, metadata) => (eventName, properties = {}) =>
|
|
|
12601
12909
|
|
|
12602
12910
|
// src/legacy/common/contexts/logContext/LogContext.tsx
|
|
12603
12911
|
import { createContext as createContext6, useContext as useContext7, useMemo as useMemo9 } from "react";
|
|
12604
|
-
import { jsx as
|
|
12912
|
+
import { jsx as jsx63 } from "react/jsx-runtime";
|
|
12605
12913
|
var getLogger = (level, onLog, flowId = "UNKNOWN-FLOW-ID", stepId = "UNKNOWN-FLOW-ID") => (title, description, extra) => {
|
|
12606
12914
|
try {
|
|
12607
12915
|
onLog(level, `Dynamic Flow ${level} - ${title} - ${description}`, __spreadValues({
|
|
@@ -12623,7 +12931,7 @@ function LogProvider({ flowId, stepId, children, onLog }) {
|
|
|
12623
12931
|
}),
|
|
12624
12932
|
[onLog, flowId, stepId]
|
|
12625
12933
|
);
|
|
12626
|
-
return /* @__PURE__ */
|
|
12934
|
+
return /* @__PURE__ */ jsx63(LogContext.Provider, { value, children });
|
|
12627
12935
|
}
|
|
12628
12936
|
var useLogger = () => {
|
|
12629
12937
|
const logging = useContext7(LogContext);
|
|
@@ -12637,10 +12945,10 @@ var useLogger = () => {
|
|
|
12637
12945
|
|
|
12638
12946
|
// src/legacy/common/contexts/featureContext/FeatureContext.tsx
|
|
12639
12947
|
import { createContext as createContext7, useContext as useContext8 } from "react";
|
|
12640
|
-
import { jsx as
|
|
12948
|
+
import { jsx as jsx64 } from "react/jsx-runtime";
|
|
12641
12949
|
var FeatureContext = createContext7([]);
|
|
12642
12950
|
function FeatureContextProvider({ features, children }) {
|
|
12643
|
-
return /* @__PURE__ */
|
|
12951
|
+
return /* @__PURE__ */ jsx64(FeatureContext.Provider, { value: features, children });
|
|
12644
12952
|
}
|
|
12645
12953
|
|
|
12646
12954
|
// src/legacy/common/utils/api-utils.ts
|
|
@@ -13376,10 +13684,10 @@ function useDebouncedFunction(callback, waitMs) {
|
|
|
13376
13684
|
}
|
|
13377
13685
|
|
|
13378
13686
|
// src/legacy/common/hooks/useExternal/useExternal.tsx
|
|
13379
|
-
import { useEffect as useEffect7, useState as
|
|
13687
|
+
import { useEffect as useEffect7, useState as useState12 } from "react";
|
|
13380
13688
|
function useExternal2(url) {
|
|
13381
|
-
const [externalWindow, setExternalWindow] =
|
|
13382
|
-
const [hasManuallyTriggered, setHasManuallyTriggered] =
|
|
13689
|
+
const [externalWindow, setExternalWindow] = useState12(null);
|
|
13690
|
+
const [hasManuallyTriggered, setHasManuallyTriggered] = useState12(false);
|
|
13383
13691
|
const dismissConfirmation = () => setHasManuallyTriggered(true);
|
|
13384
13692
|
useEffect7(() => {
|
|
13385
13693
|
if (url) {
|
|
@@ -13449,12 +13757,12 @@ function useExternalStepPolling(polling, onAction) {
|
|
|
13449
13757
|
}
|
|
13450
13758
|
|
|
13451
13759
|
// src/legacy/common/hooks/usePersistAsync/usePersistAsync.ts
|
|
13452
|
-
import { useState as
|
|
13453
|
-
import { useIntl as
|
|
13760
|
+
import { useState as useState29 } from "react";
|
|
13761
|
+
import { useIntl as useIntl20 } from "react-intl";
|
|
13454
13762
|
|
|
13455
13763
|
// src/legacy/jsonSchemaForm/persistAsyncSchema/persistAsyncBasicSchema/PersistAsyncBasicSchema.tsx
|
|
13456
|
-
import { useEffect as useEffect18, useState as
|
|
13457
|
-
import { useIntl as
|
|
13764
|
+
import { useEffect as useEffect18, useState as useState28 } from "react";
|
|
13765
|
+
import { useIntl as useIntl19 } from "react-intl";
|
|
13458
13766
|
|
|
13459
13767
|
// src/legacy/common/constants/DateMode.ts
|
|
13460
13768
|
var DateMode = {
|
|
@@ -13502,7 +13810,7 @@ var Size = {
|
|
|
13502
13810
|
|
|
13503
13811
|
// src/legacy/jsonSchemaForm/basicTypeSchema/BasicTypeSchema.tsx
|
|
13504
13812
|
var import_classnames16 = __toESM(require_classnames());
|
|
13505
|
-
import { useEffect as useEffect17, useMemo as useMemo17, useState as
|
|
13813
|
+
import { useEffect as useEffect17, useMemo as useMemo17, useState as useState27 } from "react";
|
|
13506
13814
|
|
|
13507
13815
|
// src/legacy/layout/alert/DynamicAlert.tsx
|
|
13508
13816
|
import { Alert as Alert3 } from "@transferwise/components";
|
|
@@ -13511,19 +13819,19 @@ import { Alert as Alert3 } from "@transferwise/components";
|
|
|
13511
13819
|
import { Avatar as Avatar5, AvatarType as AvatarType4 } from "@transferwise/components";
|
|
13512
13820
|
|
|
13513
13821
|
// src/legacy/layout/icon/FlagIcon.tsx
|
|
13514
|
-
import { jsx as
|
|
13822
|
+
import { jsx as jsx65 } from "react/jsx-runtime";
|
|
13515
13823
|
var isFlagIcon2 = (name) => name.startsWith("flag-");
|
|
13516
13824
|
function FlagIcon2({ name }) {
|
|
13517
13825
|
if (!isFlagIcon2(name)) {
|
|
13518
13826
|
return null;
|
|
13519
13827
|
}
|
|
13520
13828
|
const code = name.substring(5);
|
|
13521
|
-
return /* @__PURE__ */
|
|
13829
|
+
return /* @__PURE__ */ jsx65(Flag, { intrinsicSize: 24, code });
|
|
13522
13830
|
}
|
|
13523
13831
|
|
|
13524
13832
|
// src/legacy/layout/icon/NamedIcon.tsx
|
|
13525
13833
|
import * as icons2 from "@transferwise/icons";
|
|
13526
|
-
import { jsx as
|
|
13834
|
+
import { jsx as jsx66 } from "react/jsx-runtime";
|
|
13527
13835
|
var isNamedIcon2 = (name) => {
|
|
13528
13836
|
const iconName = toCapitalisedCamelCase2(name);
|
|
13529
13837
|
return Object.keys(icons2).includes(iconName);
|
|
@@ -13534,19 +13842,19 @@ function NamedIcon2({ name }) {
|
|
|
13534
13842
|
}
|
|
13535
13843
|
const iconName = toCapitalisedCamelCase2(name);
|
|
13536
13844
|
const Icon = icons2[iconName];
|
|
13537
|
-
return /* @__PURE__ */
|
|
13845
|
+
return /* @__PURE__ */ jsx66(Icon, { size: 24 });
|
|
13538
13846
|
}
|
|
13539
13847
|
var toCapitalisedCamelCase2 = (value) => value.split("-").map(capitaliseFirstChar2).join("");
|
|
13540
13848
|
var capitaliseFirstChar2 = (value) => `${value[0].toUpperCase()}${value.slice(1)}`;
|
|
13541
13849
|
|
|
13542
13850
|
// src/legacy/layout/icon/DynamicIcon.tsx
|
|
13543
|
-
import { jsx as
|
|
13851
|
+
import { jsx as jsx67 } from "react/jsx-runtime";
|
|
13544
13852
|
function DynamicIcon2({ type }) {
|
|
13545
13853
|
if (isFlagIcon2(type)) {
|
|
13546
|
-
return /* @__PURE__ */
|
|
13854
|
+
return /* @__PURE__ */ jsx67(FlagIcon2, { name: type });
|
|
13547
13855
|
}
|
|
13548
13856
|
if (isNamedIcon2(type)) {
|
|
13549
|
-
return /* @__PURE__ */
|
|
13857
|
+
return /* @__PURE__ */ jsx67(NamedIcon2, { name: type });
|
|
13550
13858
|
}
|
|
13551
13859
|
return null;
|
|
13552
13860
|
}
|
|
@@ -13556,17 +13864,17 @@ function isValidIconName(name) {
|
|
|
13556
13864
|
var DynamicIcon_default2 = DynamicIcon2;
|
|
13557
13865
|
|
|
13558
13866
|
// src/legacy/layout/utils/getNavigationOptionMedia.tsx
|
|
13559
|
-
import { jsx as
|
|
13867
|
+
import { jsx as jsx68 } from "react/jsx-runtime";
|
|
13560
13868
|
var getNavigationOptionMedia = ({ icon, image }) => {
|
|
13561
13869
|
if (icon == null ? void 0 : icon.name) {
|
|
13562
|
-
return /* @__PURE__ */
|
|
13870
|
+
return /* @__PURE__ */ jsx68(Avatar5, { type: AvatarType4.ICON, children: /* @__PURE__ */ jsx68(DynamicIcon_default2, { type: icon.name }) });
|
|
13563
13871
|
}
|
|
13564
13872
|
if (icon == null ? void 0 : icon.text) {
|
|
13565
|
-
return /* @__PURE__ */
|
|
13873
|
+
return /* @__PURE__ */ jsx68(Avatar5, { type: AvatarType4.INITIALS, children: icon.text });
|
|
13566
13874
|
}
|
|
13567
13875
|
if (image == null ? void 0 : image.url) {
|
|
13568
13876
|
const { url, text } = image;
|
|
13569
|
-
return /* @__PURE__ */
|
|
13877
|
+
return /* @__PURE__ */ jsx68("img", { src: url, alt: text });
|
|
13570
13878
|
}
|
|
13571
13879
|
return null;
|
|
13572
13880
|
};
|
|
@@ -13602,10 +13910,10 @@ var getTextAlignment2 = (align) => {
|
|
|
13602
13910
|
var getTextAlignmentAndMargin2 = (component) => `${getTextAlignment2(component.align)} ${getMargin2(component.margin)}`;
|
|
13603
13911
|
|
|
13604
13912
|
// src/legacy/layout/alert/DynamicAlert.tsx
|
|
13605
|
-
import { jsx as
|
|
13913
|
+
import { jsx as jsx69 } from "react/jsx-runtime";
|
|
13606
13914
|
var DynamicAlert = (props) => {
|
|
13607
13915
|
const alert = props.component;
|
|
13608
|
-
return /* @__PURE__ */
|
|
13916
|
+
return /* @__PURE__ */ jsx69(
|
|
13609
13917
|
Alert3,
|
|
13610
13918
|
{
|
|
13611
13919
|
type: mapContextToAlertType(legacy_mapContext(alert.context)),
|
|
@@ -13638,12 +13946,12 @@ var mapContextToAlertType = (context) => {
|
|
|
13638
13946
|
var DynamicAlert_default = DynamicAlert;
|
|
13639
13947
|
|
|
13640
13948
|
// src/legacy/layout/box/DynamicBox.tsx
|
|
13641
|
-
import { jsx as
|
|
13949
|
+
import { jsx as jsx70 } from "react/jsx-runtime";
|
|
13642
13950
|
var DynamicBox = (props) => {
|
|
13643
13951
|
const box = props.component;
|
|
13644
13952
|
const margin = getMargin2(box.margin || box.border ? "lg" : "xs");
|
|
13645
13953
|
if (!box.width || box.width === "xl") {
|
|
13646
|
-
return /* @__PURE__ */
|
|
13954
|
+
return /* @__PURE__ */ jsx70("div", { className: margin + getBorderClass(box.border), children: /* @__PURE__ */ jsx70(
|
|
13647
13955
|
DynamicLayout_default,
|
|
13648
13956
|
{
|
|
13649
13957
|
components: box.components,
|
|
@@ -13656,7 +13964,7 @@ var DynamicBox = (props) => {
|
|
|
13656
13964
|
}
|
|
13657
13965
|
) });
|
|
13658
13966
|
}
|
|
13659
|
-
return /* @__PURE__ */
|
|
13967
|
+
return /* @__PURE__ */ jsx70("div", { className: "row", children: /* @__PURE__ */ jsx70("div", { className: margin + getBoxWidthClasses(box), children: /* @__PURE__ */ jsx70("div", { className: getBorderClass(box.border), children: /* @__PURE__ */ jsx70(
|
|
13660
13968
|
DynamicLayout_default,
|
|
13661
13969
|
{
|
|
13662
13970
|
components: box.components,
|
|
@@ -13740,7 +14048,7 @@ var getButtonSize = (size) => {
|
|
|
13740
14048
|
};
|
|
13741
14049
|
|
|
13742
14050
|
// src/legacy/layout/button/DynamicButton.tsx
|
|
13743
|
-
import { jsx as
|
|
14051
|
+
import { jsx as jsx71 } from "react/jsx-runtime";
|
|
13744
14052
|
function DynamicButton(props) {
|
|
13745
14053
|
var _a;
|
|
13746
14054
|
const { component, onAction } = props;
|
|
@@ -13749,7 +14057,7 @@ function DynamicButton(props) {
|
|
|
13749
14057
|
const priority = getButtonPriority(component);
|
|
13750
14058
|
const { loading } = useDynamicFlow();
|
|
13751
14059
|
const className = getMargin2(component.margin || "md");
|
|
13752
|
-
return /* @__PURE__ */
|
|
14060
|
+
return /* @__PURE__ */ jsx71(
|
|
13753
14061
|
Button6,
|
|
13754
14062
|
{
|
|
13755
14063
|
size: getButtonSize(component.size),
|
|
@@ -13766,12 +14074,12 @@ function DynamicButton(props) {
|
|
|
13766
14074
|
var DynamicButton_default = DynamicButton;
|
|
13767
14075
|
|
|
13768
14076
|
// src/legacy/layout/columns/DynamicColumns.tsx
|
|
13769
|
-
import { jsx as
|
|
14077
|
+
import { jsx as jsx72, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
13770
14078
|
var DynamicColumns = (props) => {
|
|
13771
14079
|
const columns = props.component;
|
|
13772
14080
|
const { leftWidth, rightWidth } = getWidth(columns.bias);
|
|
13773
14081
|
return /* @__PURE__ */ jsxs24("div", { className: `${getMargin2(columns.margin || "xs")} row`, children: [
|
|
13774
|
-
/* @__PURE__ */
|
|
14082
|
+
/* @__PURE__ */ jsx72("div", { className: `${leftWidth} m-b-0`, children: /* @__PURE__ */ jsx72(
|
|
13775
14083
|
DynamicLayout_default,
|
|
13776
14084
|
{
|
|
13777
14085
|
components: columns.left,
|
|
@@ -13783,7 +14091,7 @@ var DynamicColumns = (props) => {
|
|
|
13783
14091
|
onPersistAsync: props.onPersistAsync
|
|
13784
14092
|
}
|
|
13785
14093
|
) }),
|
|
13786
|
-
/* @__PURE__ */
|
|
14094
|
+
/* @__PURE__ */ jsx72("div", { className: `${rightWidth} m-b-0`, children: /* @__PURE__ */ jsx72(
|
|
13787
14095
|
DynamicLayout_default,
|
|
13788
14096
|
{
|
|
13789
14097
|
components: columns.right,
|
|
@@ -13819,10 +14127,10 @@ var DynamicColumns_default = DynamicColumns;
|
|
|
13819
14127
|
|
|
13820
14128
|
// src/legacy/layout/decision/DynamicDecision.tsx
|
|
13821
14129
|
import { NavigationOption as NavigationOption4, NavigationOptionsList as NavigationOptionsList3 } from "@transferwise/components";
|
|
13822
|
-
import { jsx as
|
|
14130
|
+
import { jsx as jsx73 } from "react/jsx-runtime";
|
|
13823
14131
|
function DynamicDecision({ component, onAction }) {
|
|
13824
14132
|
const { loading } = useDynamicFlow();
|
|
13825
|
-
return /* @__PURE__ */
|
|
14133
|
+
return /* @__PURE__ */ jsx73("div", { className: getMargin2(component.margin), children: /* @__PURE__ */ jsx73(NavigationOptionsList3, { children: component.options.map((option) => /* @__PURE__ */ jsx73(
|
|
13826
14134
|
NavigationOption4,
|
|
13827
14135
|
{
|
|
13828
14136
|
title: option.title,
|
|
@@ -13839,22 +14147,22 @@ function DynamicDecision({ component, onAction }) {
|
|
|
13839
14147
|
var DynamicDecision_default = DynamicDecision;
|
|
13840
14148
|
|
|
13841
14149
|
// src/legacy/layout/divider/DynamicDivider.tsx
|
|
13842
|
-
import { jsx as
|
|
14150
|
+
import { jsx as jsx74 } from "react/jsx-runtime";
|
|
13843
14151
|
var DynamicDivider = ({ component }) => {
|
|
13844
14152
|
const margin = getMargin2(component.margin);
|
|
13845
14153
|
const className = `m-t-0 ${margin}`;
|
|
13846
|
-
return /* @__PURE__ */
|
|
14154
|
+
return /* @__PURE__ */ jsx74("hr", { className });
|
|
13847
14155
|
};
|
|
13848
14156
|
var DynamicDivider_default = DynamicDivider;
|
|
13849
14157
|
|
|
13850
14158
|
// src/legacy/layout/external/DynamicExternal.tsx
|
|
13851
14159
|
import { Button as Button7, Loader as Loader2, Size as Size2 } from "@transferwise/components";
|
|
13852
14160
|
import { useCallback as useCallback6, useEffect as useEffect8 } from "react";
|
|
13853
|
-
import { useIntl as
|
|
14161
|
+
import { useIntl as useIntl9 } from "react-intl";
|
|
13854
14162
|
|
|
13855
14163
|
// src/legacy/layout/external/DynamicExternal.messages.ts
|
|
13856
|
-
import { defineMessages as
|
|
13857
|
-
var DynamicExternal_messages_default =
|
|
14164
|
+
import { defineMessages as defineMessages10 } from "react-intl";
|
|
14165
|
+
var DynamicExternal_messages_default = defineMessages10({
|
|
13858
14166
|
retryTitle: {
|
|
13859
14167
|
id: "dynamicFlows.DynamicExternal.retryTitle",
|
|
13860
14168
|
defaultMessage: "Reopen window",
|
|
@@ -13863,10 +14171,10 @@ var DynamicExternal_messages_default = defineMessages9({
|
|
|
13863
14171
|
});
|
|
13864
14172
|
|
|
13865
14173
|
// src/legacy/layout/external/DynamicExternal.tsx
|
|
13866
|
-
import { Fragment as Fragment11, jsx as
|
|
14174
|
+
import { Fragment as Fragment11, jsx as jsx75, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
13867
14175
|
var DynamicExternal = ({ component, onAction }) => {
|
|
13868
14176
|
const { requestUrl, responseHandlers, polling, retryTitle } = component;
|
|
13869
|
-
const intl =
|
|
14177
|
+
const intl = useIntl9();
|
|
13870
14178
|
const openExternalUrl = useCallback6(
|
|
13871
14179
|
() => window.open(requestUrl, "df-external-window"),
|
|
13872
14180
|
[requestUrl]
|
|
@@ -13879,9 +14187,9 @@ var DynamicExternal = ({ component, onAction }) => {
|
|
|
13879
14187
|
}) : void 0;
|
|
13880
14188
|
useExternalStepPolling(pollingConfiguration, onAction);
|
|
13881
14189
|
return /* @__PURE__ */ jsxs25(Fragment11, { children: [
|
|
13882
|
-
/* @__PURE__ */
|
|
13883
|
-
/* @__PURE__ */
|
|
13884
|
-
/* @__PURE__ */
|
|
14190
|
+
/* @__PURE__ */ jsx75(Loader2, { size: Size2.LARGE, classNames: { "tw-loader": "tw-loader m-x-auto" } }),
|
|
14191
|
+
/* @__PURE__ */ jsx75("br", {}),
|
|
14192
|
+
/* @__PURE__ */ jsx75(Button7, { priority: "tertiary", block: true, onClick: openExternalUrl, children: retryTitle || intl.formatMessage(DynamicExternal_messages_default.retryTitle) })
|
|
13885
14193
|
] });
|
|
13886
14194
|
};
|
|
13887
14195
|
var DynamicExternal_default = DynamicExternal;
|
|
@@ -13892,8 +14200,8 @@ import { useEffect as useEffect15 } from "react";
|
|
|
13892
14200
|
// src/legacy/jsonSchemaForm/allOfSchema/AllOfSchema.tsx
|
|
13893
14201
|
var import_classnames7 = __toESM(require_classnames());
|
|
13894
14202
|
import { Header as Header6 } from "@transferwise/components";
|
|
13895
|
-
import { useState as
|
|
13896
|
-
import { Fragment as Fragment12, jsx as
|
|
14203
|
+
import { useState as useState13 } from "react";
|
|
14204
|
+
import { Fragment as Fragment12, jsx as jsx76, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
13897
14205
|
var splitModel = (model, schemas) => schemas.map((schema) => getValidObjectModelParts(model, schema) || {});
|
|
13898
14206
|
var combineModels = (models) => models.reduce((current, combined) => __spreadValues(__spreadValues({}, combined), current), {});
|
|
13899
14207
|
var getSchemaColumnClasses = (width) => ({
|
|
@@ -13908,13 +14216,13 @@ function AllOfSchema(props) {
|
|
|
13908
14216
|
setModels(models);
|
|
13909
14217
|
props.onChange(__spreadProps(__spreadValues({}, onChangeProps), { model: combineModels(models) }));
|
|
13910
14218
|
};
|
|
13911
|
-
const [models, setModels] =
|
|
14219
|
+
const [models, setModels] = useState13(splitModel(props.model, props.schema.allOf));
|
|
13912
14220
|
return /* @__PURE__ */ jsxs26(Fragment12, { children: [
|
|
13913
|
-
props.schema.title && /* @__PURE__ */
|
|
13914
|
-
props.schema.description && /* @__PURE__ */
|
|
13915
|
-
/* @__PURE__ */
|
|
14221
|
+
props.schema.title && /* @__PURE__ */ jsx76(Header6, { title: props.schema.title }),
|
|
14222
|
+
props.schema.description && /* @__PURE__ */ jsx76("p", { children: props.schema.description }),
|
|
14223
|
+
/* @__PURE__ */ jsx76("div", { className: "row", children: props.schema.allOf.map((schema, index) => (
|
|
13916
14224
|
// eslint-disable-next-line react/no-array-index-key
|
|
13917
|
-
/* @__PURE__ */
|
|
14225
|
+
/* @__PURE__ */ jsx76("div", { className: (0, import_classnames7.default)(getSchemaColumnClasses(schema.width)), children: /* @__PURE__ */ jsx76(
|
|
13918
14226
|
GenericSchema_default,
|
|
13919
14227
|
{
|
|
13920
14228
|
schema,
|
|
@@ -13943,13 +14251,13 @@ import {
|
|
|
13943
14251
|
Status,
|
|
13944
14252
|
UploadInput as UploadInput3
|
|
13945
14253
|
} from "@transferwise/components";
|
|
13946
|
-
import { useMemo as useMemo11, useState as
|
|
14254
|
+
import { useMemo as useMemo11, useState as useState14 } from "react";
|
|
13947
14255
|
|
|
13948
14256
|
// src/legacy/jsonSchemaForm/controlFeedback/ControlFeedback.tsx
|
|
13949
14257
|
import { InlineAlert as InlineAlert4 } from "@transferwise/components";
|
|
13950
14258
|
import { formatDate as formatDate3 } from "@transferwise/formatting";
|
|
13951
|
-
import { useIntl as
|
|
13952
|
-
import { jsx as
|
|
14259
|
+
import { useIntl as useIntl10 } from "react-intl";
|
|
14260
|
+
import { jsx as jsx77, jsxs as jsxs27 } from "react/jsx-runtime";
|
|
13953
14261
|
function ControlFeedback(props) {
|
|
13954
14262
|
var _a;
|
|
13955
14263
|
const defaultValidationMessages = useDefaultValidationMessages(props.schema);
|
|
@@ -13959,11 +14267,11 @@ function ControlFeedback(props) {
|
|
|
13959
14267
|
const isDescriptionVisible = props.schema.type !== "boolean" && props.schema.description && !isErrorVisible && !isValidationVisible;
|
|
13960
14268
|
const hasInfoMessage = Boolean(props.infoMessage);
|
|
13961
14269
|
return /* @__PURE__ */ jsxs27("div", { id: props.id, children: [
|
|
13962
|
-
isErrorVisible ? /* @__PURE__ */
|
|
13963
|
-
isValidationVisible ? /* @__PURE__ */
|
|
14270
|
+
isErrorVisible ? /* @__PURE__ */ jsx77(InlineAlert4, { type: "error", children: props.errors }) : null,
|
|
14271
|
+
isValidationVisible ? /* @__PURE__ */ jsx77(InlineAlert4, { type: "error", children: props.validations.map((validation) => /* @__PURE__ */ jsx77("div", { children: validationMessages[validation] }, validation)) }) : null,
|
|
13964
14272
|
(isDescriptionVisible || hasInfoMessage) && /* @__PURE__ */ jsxs27(InlineAlert4, { type: "info", children: [
|
|
13965
|
-
isDescriptionVisible && /* @__PURE__ */
|
|
13966
|
-
hasInfoMessage && /* @__PURE__ */
|
|
14273
|
+
isDescriptionVisible && /* @__PURE__ */ jsx77("div", { children: props.schema.description }),
|
|
14274
|
+
hasInfoMessage && /* @__PURE__ */ jsx77("div", { children: props.infoMessage })
|
|
13967
14275
|
] })
|
|
13968
14276
|
] });
|
|
13969
14277
|
}
|
|
@@ -13974,7 +14282,7 @@ ControlFeedback.defaultProps = {
|
|
|
13974
14282
|
validationAsyncSuccessMessage: null
|
|
13975
14283
|
};
|
|
13976
14284
|
function useDefaultValidationMessages(schema) {
|
|
13977
|
-
const { formatMessage, locale } =
|
|
14285
|
+
const { formatMessage, locale } = useIntl10();
|
|
13978
14286
|
const formattedMessages = {
|
|
13979
14287
|
type: formatMessage(validation_messages_default.type),
|
|
13980
14288
|
minimum: formatMessage(validation_messages_default.minimum, {
|
|
@@ -14061,11 +14369,11 @@ function constructUploadError(response) {
|
|
|
14061
14369
|
}
|
|
14062
14370
|
|
|
14063
14371
|
// src/legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/utils/useFormattedDefaultErrorMessages.tsx
|
|
14064
|
-
import { useIntl as
|
|
14372
|
+
import { useIntl as useIntl11 } from "react-intl";
|
|
14065
14373
|
|
|
14066
14374
|
// src/legacy/common/messages.ts
|
|
14067
|
-
import { defineMessages as
|
|
14068
|
-
var messages_default =
|
|
14375
|
+
import { defineMessages as defineMessages11 } from "react-intl";
|
|
14376
|
+
var messages_default = defineMessages11({
|
|
14069
14377
|
required: {
|
|
14070
14378
|
id: "dynamicFlows.DefaultErrorMessages.required",
|
|
14071
14379
|
defaultMessage: "Please fill out this field.",
|
|
@@ -14078,7 +14386,7 @@ function useFormattedDefaultErrorMessages({
|
|
|
14078
14386
|
maxItems,
|
|
14079
14387
|
minItems
|
|
14080
14388
|
}) {
|
|
14081
|
-
const { formatMessage } =
|
|
14389
|
+
const { formatMessage } = useIntl11();
|
|
14082
14390
|
const { maxFileSizeError, maxItemsError, minItemsError } = multi_file_upload_messages_default;
|
|
14083
14391
|
return {
|
|
14084
14392
|
maxFileSizeErrorMessage: formatMessage(maxFileSizeError),
|
|
@@ -14089,15 +14397,15 @@ function useFormattedDefaultErrorMessages({
|
|
|
14089
14397
|
}
|
|
14090
14398
|
|
|
14091
14399
|
// src/legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/MultipleFileUploadSchema.tsx
|
|
14092
|
-
import { jsx as
|
|
14400
|
+
import { jsx as jsx78, jsxs as jsxs28 } from "react/jsx-runtime";
|
|
14093
14401
|
function MultipleFileUploadSchema(props) {
|
|
14094
14402
|
var _a, _b;
|
|
14095
14403
|
const { onChange, schema } = props;
|
|
14096
14404
|
const onEvent = useEventDispatcher();
|
|
14097
14405
|
const defaultErrorMessages = useFormattedDefaultErrorMessages(schema);
|
|
14098
14406
|
const uid = useMemo11(() => schema.$id || generateRandomId(), [schema.$id]);
|
|
14099
|
-
const [inputChanged, setInputChanged] =
|
|
14100
|
-
const [files, setFiles] =
|
|
14407
|
+
const [inputChanged, setInputChanged] = useState14(false);
|
|
14408
|
+
const [files, setFiles] = useState14(() => convertFileIdsToComponentFileObjects(props.model || []));
|
|
14101
14409
|
const performPersistAsync = usePersistAsync(schema.items.persistAsync);
|
|
14102
14410
|
const fileSchemaDescriptor = schema.items.persistAsync.schema;
|
|
14103
14411
|
const isBlob = isBlobSchema2(fileSchemaDescriptor);
|
|
@@ -14152,9 +14460,9 @@ function MultipleFileUploadSchema(props) {
|
|
|
14152
14460
|
});
|
|
14153
14461
|
const feedbackId = `${uid}-feedback`;
|
|
14154
14462
|
return /* @__PURE__ */ jsxs28("div", { className: (0, import_classnames8.default)("form-group", { "has-error": showError }), children: [
|
|
14155
|
-
/* @__PURE__ */
|
|
14156
|
-
/* @__PURE__ */
|
|
14157
|
-
/* @__PURE__ */
|
|
14463
|
+
/* @__PURE__ */ jsx78("label", { className: "d-block control-label", htmlFor: uid, children: props.schema.title }),
|
|
14464
|
+
/* @__PURE__ */ jsx78("div", { "aria-describedby": feedbackId, children: /* @__PURE__ */ jsx78(UploadInput3, __spreadValues({}, uploadInputProps)) }),
|
|
14465
|
+
/* @__PURE__ */ jsx78(
|
|
14158
14466
|
ControlFeedback_default,
|
|
14159
14467
|
{
|
|
14160
14468
|
id: feedbackId,
|
|
@@ -14196,13 +14504,13 @@ function getValidationMessages(schema, required, defaultErrorMessages) {
|
|
|
14196
14504
|
|
|
14197
14505
|
// src/legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multiSelectSchema/MultiSelectSchema.tsx
|
|
14198
14506
|
var import_classnames9 = __toESM(require_classnames());
|
|
14199
|
-
import { SelectInput as
|
|
14200
|
-
import { useEffect as useEffect9, useMemo as useMemo12, useState as
|
|
14201
|
-
import { useIntl as
|
|
14507
|
+
import { SelectInput as SelectInput3, SelectInputOptionContent as SelectInputOptionContent3 } from "@transferwise/components";
|
|
14508
|
+
import { useEffect as useEffect9, useMemo as useMemo12, useState as useState15 } from "react";
|
|
14509
|
+
import { useIntl as useIntl12 } from "react-intl";
|
|
14202
14510
|
|
|
14203
14511
|
// src/legacy/jsonSchemaForm/schemaFormControl/utils/mapping-utils.tsx
|
|
14204
14512
|
import { Avatar as Avatar6, AvatarType as AvatarType5 } from "@transferwise/components";
|
|
14205
|
-
import { jsx as
|
|
14513
|
+
import { jsx as jsx79 } from "react/jsx-runtime";
|
|
14206
14514
|
var mapConstSchemaToOption = (schema, controlType) => {
|
|
14207
14515
|
switch (controlType) {
|
|
14208
14516
|
case "select":
|
|
@@ -14226,7 +14534,7 @@ var mapKeywordsToSearchStrings = (searchStrings) => isArray2(searchStrings) ? {
|
|
|
14226
14534
|
var mapImage = (image) => {
|
|
14227
14535
|
if (image == null ? void 0 : image.url) {
|
|
14228
14536
|
return {
|
|
14229
|
-
icon: /* @__PURE__ */
|
|
14537
|
+
icon: /* @__PURE__ */ jsx79("div", { className: "media", children: /* @__PURE__ */ jsx79("div", { className: "np-option__no-media-circle", children: /* @__PURE__ */ jsx79("img", { src: image.url, alt: image.name || "" }) }) }),
|
|
14230
14538
|
hideIconInTrigger: true
|
|
14231
14539
|
};
|
|
14232
14540
|
}
|
|
@@ -14235,17 +14543,17 @@ var mapImage = (image) => {
|
|
|
14235
14543
|
var getIconPropertyForSelectOption = (icon) => {
|
|
14236
14544
|
if ((icon == null ? void 0 : icon.name) && isFlagIcon2(icon.name)) {
|
|
14237
14545
|
return {
|
|
14238
|
-
icon: /* @__PURE__ */
|
|
14546
|
+
icon: /* @__PURE__ */ jsx79(Flag, { code: icon.name.substring(5), intrinsicSize: 24 })
|
|
14239
14547
|
};
|
|
14240
14548
|
}
|
|
14241
14549
|
if ((icon == null ? void 0 : icon.name) && isValidIconName(icon.name)) {
|
|
14242
14550
|
return {
|
|
14243
|
-
icon: /* @__PURE__ */
|
|
14551
|
+
icon: /* @__PURE__ */ jsx79(DynamicIcon_default2, { type: icon.name })
|
|
14244
14552
|
};
|
|
14245
14553
|
}
|
|
14246
14554
|
if (icon == null ? void 0 : icon.text) {
|
|
14247
14555
|
return {
|
|
14248
|
-
icon: /* @__PURE__ */
|
|
14556
|
+
icon: /* @__PURE__ */ jsx79("span", { children: icon.text })
|
|
14249
14557
|
};
|
|
14250
14558
|
}
|
|
14251
14559
|
return null;
|
|
@@ -14253,17 +14561,17 @@ var getIconPropertyForSelectOption = (icon) => {
|
|
|
14253
14561
|
var getAvatarPropertyForRadioOption = ({ image, icon }) => {
|
|
14254
14562
|
if (image == null ? void 0 : image.url) {
|
|
14255
14563
|
return {
|
|
14256
|
-
avatar: /* @__PURE__ */
|
|
14564
|
+
avatar: /* @__PURE__ */ jsx79(Avatar6, { type: AvatarType5.THUMBNAIL, children: /* @__PURE__ */ jsx79("img", { src: image.url, alt: "" }) })
|
|
14257
14565
|
};
|
|
14258
14566
|
}
|
|
14259
14567
|
if ((icon == null ? void 0 : icon.name) && isValidIconName(icon.name)) {
|
|
14260
14568
|
return {
|
|
14261
|
-
avatar: /* @__PURE__ */
|
|
14569
|
+
avatar: /* @__PURE__ */ jsx79(Avatar6, { type: AvatarType5.ICON, children: /* @__PURE__ */ jsx79(DynamicIcon_default2, { type: icon.name }) })
|
|
14262
14570
|
};
|
|
14263
14571
|
}
|
|
14264
14572
|
if (icon == null ? void 0 : icon.text) {
|
|
14265
14573
|
return {
|
|
14266
|
-
avatar: /* @__PURE__ */
|
|
14574
|
+
avatar: /* @__PURE__ */ jsx79(Avatar6, { type: AvatarType5.INITIALS, children: icon.text })
|
|
14267
14575
|
};
|
|
14268
14576
|
}
|
|
14269
14577
|
return null;
|
|
@@ -14291,18 +14599,8 @@ var getDisabled = (disabled) => {
|
|
|
14291
14599
|
return void 0;
|
|
14292
14600
|
};
|
|
14293
14601
|
|
|
14294
|
-
// src/common/messages/multi-select.messages.ts
|
|
14295
|
-
import { defineMessages as defineMessages11 } from "react-intl";
|
|
14296
|
-
var multi_select_messages_default = defineMessages11({
|
|
14297
|
-
summary: {
|
|
14298
|
-
id: "dynamicFlows.MultiSelect.summary",
|
|
14299
|
-
defaultMessage: "{first} and {count} more",
|
|
14300
|
-
description: "A summary of the multiple items selected. Showing the title of the first selected item, and the number of other items that have been selected."
|
|
14301
|
-
}
|
|
14302
|
-
});
|
|
14303
|
-
|
|
14304
14602
|
// src/legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multiSelectSchema/MultiSelectSchema.tsx
|
|
14305
|
-
import { jsx as
|
|
14603
|
+
import { jsx as jsx80, jsxs as jsxs29 } from "react/jsx-runtime";
|
|
14306
14604
|
function MultiSelectSchema({
|
|
14307
14605
|
schema,
|
|
14308
14606
|
model,
|
|
@@ -14311,12 +14609,12 @@ function MultiSelectSchema({
|
|
|
14311
14609
|
errors,
|
|
14312
14610
|
onChange
|
|
14313
14611
|
}) {
|
|
14314
|
-
const { formatMessage, locale } =
|
|
14612
|
+
const { formatMessage, locale } = useIntl12();
|
|
14315
14613
|
const { disabled, items, validationMessages, placeholder } = schema;
|
|
14316
14614
|
const options = items.oneOf.map((item) => mapConstSchemaToOption(item, "select"));
|
|
14317
14615
|
const id = useMemo12(() => schema.$id || generateRandomId(), [schema.$id]);
|
|
14318
|
-
const [changed, setChanged] =
|
|
14319
|
-
const [selected, setSelected] =
|
|
14616
|
+
const [changed, setChanged] = useState15(false);
|
|
14617
|
+
const [selected, setSelected] = useState15(getInitialModelIndices2(model, options));
|
|
14320
14618
|
useEffect9(
|
|
14321
14619
|
() => {
|
|
14322
14620
|
if (selected) {
|
|
@@ -14355,9 +14653,9 @@ function MultiSelectSchema({
|
|
|
14355
14653
|
"has-error": shouldShowInitialError || shouldShowValidationError
|
|
14356
14654
|
};
|
|
14357
14655
|
return /* @__PURE__ */ jsxs29("div", { className: (0, import_classnames9.default)("d-flex flex-column", formGroupClasses), children: [
|
|
14358
|
-
schema.title ? /* @__PURE__ */
|
|
14359
|
-
/* @__PURE__ */
|
|
14360
|
-
|
|
14656
|
+
schema.title ? /* @__PURE__ */ jsx80("label", { htmlFor: id, children: schema.title }) : void 0,
|
|
14657
|
+
/* @__PURE__ */ jsx80(
|
|
14658
|
+
SelectInput3,
|
|
14361
14659
|
{
|
|
14362
14660
|
id,
|
|
14363
14661
|
multiple: true,
|
|
@@ -14382,12 +14680,12 @@ function MultiSelectSchema({
|
|
|
14382
14680
|
if (withinTrigger) {
|
|
14383
14681
|
return selected && index === selected[0] ? getFormattedMessage() : void 0;
|
|
14384
14682
|
}
|
|
14385
|
-
return /* @__PURE__ */
|
|
14683
|
+
return /* @__PURE__ */ jsx80(SelectInputOptionContent3, { title: label, note: note != null ? note : secondary, icon });
|
|
14386
14684
|
},
|
|
14387
14685
|
onChange: broadcastModelChange
|
|
14388
14686
|
}
|
|
14389
14687
|
),
|
|
14390
|
-
/* @__PURE__ */
|
|
14688
|
+
/* @__PURE__ */ jsx80(
|
|
14391
14689
|
ControlFeedback_default,
|
|
14392
14690
|
{
|
|
14393
14691
|
id: `${id}-feedback`,
|
|
@@ -14404,7 +14702,7 @@ function MultiSelectSchema({
|
|
|
14404
14702
|
)
|
|
14405
14703
|
] });
|
|
14406
14704
|
}
|
|
14407
|
-
var
|
|
14705
|
+
var getInitialModelIndices2 = (model, options) => {
|
|
14408
14706
|
if (model == null) {
|
|
14409
14707
|
return null;
|
|
14410
14708
|
}
|
|
@@ -14414,14 +14712,14 @@ var getInitialModelIndices = (model, options) => {
|
|
|
14414
14712
|
// src/legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/repeatableSchema/RepeatableSchema.tsx
|
|
14415
14713
|
import { Header as Header7, Modal as Modal3, NavigationOption as NavigationOption6 } from "@transferwise/components";
|
|
14416
14714
|
import { Plus as Plus2 } from "@transferwise/icons";
|
|
14417
|
-
import { useMemo as useMemo13, useState as
|
|
14418
|
-
import { useIntl as
|
|
14715
|
+
import { useMemo as useMemo13, useState as useState17 } from "react";
|
|
14716
|
+
import { useIntl as useIntl14 } from "react-intl";
|
|
14419
14717
|
|
|
14420
14718
|
// src/legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/repeatableSchema/ItemSummary.tsx
|
|
14421
14719
|
import { NavigationOption as NavigationOption5 } from "@transferwise/components";
|
|
14422
|
-
import { jsx as
|
|
14720
|
+
import { jsx as jsx81 } from "react/jsx-runtime";
|
|
14423
14721
|
function ItemSummaryOption2({ item, onClick }) {
|
|
14424
|
-
return /* @__PURE__ */
|
|
14722
|
+
return /* @__PURE__ */ jsx81(
|
|
14425
14723
|
NavigationOption5,
|
|
14426
14724
|
{
|
|
14427
14725
|
media: getNavigationOptionMedia(item),
|
|
@@ -14434,9 +14732,9 @@ function ItemSummaryOption2({ item, onClick }) {
|
|
|
14434
14732
|
}
|
|
14435
14733
|
|
|
14436
14734
|
// src/legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/repeatableSchema/RepeatableSchemaStep.tsx
|
|
14437
|
-
import { useState as
|
|
14438
|
-
import { useIntl as
|
|
14439
|
-
import { jsx as
|
|
14735
|
+
import { useState as useState16 } from "react";
|
|
14736
|
+
import { useIntl as useIntl13 } from "react-intl";
|
|
14737
|
+
import { jsx as jsx82 } from "react/jsx-runtime";
|
|
14440
14738
|
function RepeatableSchemaStep({
|
|
14441
14739
|
type,
|
|
14442
14740
|
schema,
|
|
@@ -14446,8 +14744,8 @@ function RepeatableSchemaStep({
|
|
|
14446
14744
|
onModelChange,
|
|
14447
14745
|
onAction
|
|
14448
14746
|
}) {
|
|
14449
|
-
const { formatMessage } =
|
|
14450
|
-
const [filename, setFilename] =
|
|
14747
|
+
const { formatMessage } = useIntl13();
|
|
14748
|
+
const [filename, setFilename] = useState16(void 0);
|
|
14451
14749
|
const step = {
|
|
14452
14750
|
layout: [
|
|
14453
14751
|
{
|
|
@@ -14484,7 +14782,7 @@ function RepeatableSchemaStep({
|
|
|
14484
14782
|
}
|
|
14485
14783
|
onModelChange(__spreadProps(__spreadValues({}, modelChangeProps), { model: model2 }));
|
|
14486
14784
|
};
|
|
14487
|
-
return /* @__PURE__ */
|
|
14785
|
+
return /* @__PURE__ */ jsx82(
|
|
14488
14786
|
DynamicFlowStep,
|
|
14489
14787
|
{
|
|
14490
14788
|
step,
|
|
@@ -14690,7 +14988,7 @@ var schemaSummaryProvides = (summary, providesProp) => (
|
|
|
14690
14988
|
|
|
14691
14989
|
// src/legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/repeatableSchema/RepeatableSchema.tsx
|
|
14692
14990
|
var import_classnames10 = __toESM(require_classnames());
|
|
14693
|
-
import { jsx as
|
|
14991
|
+
import { jsx as jsx83, jsxs as jsxs30 } from "react/jsx-runtime";
|
|
14694
14992
|
function RepeatableSchema({
|
|
14695
14993
|
schema,
|
|
14696
14994
|
model,
|
|
@@ -14700,9 +14998,9 @@ function RepeatableSchema({
|
|
|
14700
14998
|
onChange
|
|
14701
14999
|
}) {
|
|
14702
15000
|
var _a;
|
|
14703
|
-
const [openModalType, setOpenModalType] =
|
|
14704
|
-
const [changed, setChanged] =
|
|
14705
|
-
const [itemSummaries, setItemSummaries] =
|
|
15001
|
+
const [openModalType, setOpenModalType] = useState17(null);
|
|
15002
|
+
const [changed, setChanged] = useState17(false);
|
|
15003
|
+
const [itemSummaries, setItemSummaries] = useState17(() => {
|
|
14706
15004
|
if (isObject2(model) && !isArray2(model)) {
|
|
14707
15005
|
throw new Error(
|
|
14708
15006
|
"RepeatableSchema does not support object models. Ensure your array schema is wrapped inside an object schema."
|
|
@@ -14710,7 +15008,7 @@ function RepeatableSchema({
|
|
|
14710
15008
|
}
|
|
14711
15009
|
return model ? model.map((item) => getItemSummaryFromSchema(schema.items, item, schema == null ? void 0 : schema.summary)) : null;
|
|
14712
15010
|
});
|
|
14713
|
-
const [editableItem, setEditableItem] =
|
|
15011
|
+
const [editableItem, setEditableItem] = useState17({ item: null, model: null });
|
|
14714
15012
|
const id = useMemo13(() => schema.$id || generateRandomId(), [schema.$id]);
|
|
14715
15013
|
const broadcastModelChange = (updatedItems) => {
|
|
14716
15014
|
const updatedModel = updatedItems ? updatedItems.map(({ value }) => value) : null;
|
|
@@ -14753,7 +15051,7 @@ function RepeatableSchema({
|
|
|
14753
15051
|
setEditableItem({ item: null, model: null });
|
|
14754
15052
|
setOpenModalType(null);
|
|
14755
15053
|
};
|
|
14756
|
-
const { formatMessage } =
|
|
15054
|
+
const { formatMessage } = useIntl14();
|
|
14757
15055
|
const validations = getValidationFailures(model, schema, required);
|
|
14758
15056
|
const base64ValidationMessages = useFormattedDefaultErrorMessages({
|
|
14759
15057
|
minItems: schema.minItems,
|
|
@@ -14768,8 +15066,8 @@ function RepeatableSchema({
|
|
|
14768
15066
|
"has-error": (_a = errors && !isEmpty(errors)) != null ? _a : submitted && validations.length
|
|
14769
15067
|
};
|
|
14770
15068
|
return /* @__PURE__ */ jsxs30("div", { id, className: (0, import_classnames10.default)(formGroupClasses), children: [
|
|
14771
|
-
schema.title && /* @__PURE__ */
|
|
14772
|
-
itemSummaries == null ? void 0 : itemSummaries.map((itemSummary) => /* @__PURE__ */
|
|
15069
|
+
schema.title && /* @__PURE__ */ jsx83(Header7, { title: schema.title }),
|
|
15070
|
+
itemSummaries == null ? void 0 : itemSummaries.map((itemSummary) => /* @__PURE__ */ jsx83(
|
|
14773
15071
|
ItemSummaryOption2,
|
|
14774
15072
|
{
|
|
14775
15073
|
item: itemSummary,
|
|
@@ -14777,21 +15075,21 @@ function RepeatableSchema({
|
|
|
14777
15075
|
},
|
|
14778
15076
|
JSON.stringify(itemSummary)
|
|
14779
15077
|
)),
|
|
14780
|
-
/* @__PURE__ */
|
|
15078
|
+
/* @__PURE__ */ jsx83(
|
|
14781
15079
|
NavigationOption6,
|
|
14782
15080
|
{
|
|
14783
|
-
media: /* @__PURE__ */
|
|
15081
|
+
media: /* @__PURE__ */ jsx83(Plus2, {}),
|
|
14784
15082
|
title: schema.addItemTitle || formatMessage(repeatable_messages_default.addItemTitle),
|
|
14785
15083
|
showMediaAtAllSizes: true,
|
|
14786
15084
|
onClick: onAddItem
|
|
14787
15085
|
}
|
|
14788
15086
|
),
|
|
14789
|
-
/* @__PURE__ */
|
|
15087
|
+
/* @__PURE__ */ jsx83(
|
|
14790
15088
|
Modal3,
|
|
14791
15089
|
{
|
|
14792
15090
|
open: openModalType !== null,
|
|
14793
15091
|
title: (openModalType === "add" ? schema.addItemTitle : schema.editItemTitle) || formatMessage(repeatable_messages_default.addItemTitle),
|
|
14794
|
-
body: /* @__PURE__ */
|
|
15092
|
+
body: /* @__PURE__ */ jsx83(
|
|
14795
15093
|
RepeatableSchemaStep_default,
|
|
14796
15094
|
{
|
|
14797
15095
|
type: openModalType != null ? openModalType : "add",
|
|
@@ -14806,7 +15104,7 @@ function RepeatableSchema({
|
|
|
14806
15104
|
onClose: onCancelEdit
|
|
14807
15105
|
}
|
|
14808
15106
|
),
|
|
14809
|
-
/* @__PURE__ */
|
|
15107
|
+
/* @__PURE__ */ jsx83(
|
|
14810
15108
|
ControlFeedback_default,
|
|
14811
15109
|
{
|
|
14812
15110
|
id: `${id}-feedback`,
|
|
@@ -14848,17 +15146,17 @@ var getUpdatedItemSummaries = (action, {
|
|
|
14848
15146
|
var RepeatableSchema_default = RepeatableSchema;
|
|
14849
15147
|
|
|
14850
15148
|
// src/legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/ArrayListSchema.tsx
|
|
14851
|
-
import { jsx as
|
|
15149
|
+
import { jsx as jsx84 } from "react/jsx-runtime";
|
|
14852
15150
|
function ArrayListSchema(props) {
|
|
14853
15151
|
const { schema } = props;
|
|
14854
15152
|
if (isMultipleFileUploadSchema(schema)) {
|
|
14855
|
-
return /* @__PURE__ */
|
|
15153
|
+
return /* @__PURE__ */ jsx84(MultipleFileUploadSchema_default, __spreadProps(__spreadValues({}, props), { schema }));
|
|
14856
15154
|
}
|
|
14857
15155
|
if (isMultiSelectConstSchema(schema)) {
|
|
14858
|
-
return /* @__PURE__ */
|
|
15156
|
+
return /* @__PURE__ */ jsx84(MultiSelectSchema, __spreadProps(__spreadValues({}, props), { schema }));
|
|
14859
15157
|
}
|
|
14860
15158
|
if (isListArraySchema(schema)) {
|
|
14861
|
-
return /* @__PURE__ */
|
|
15159
|
+
return /* @__PURE__ */ jsx84(RepeatableSchema_default, __spreadProps(__spreadValues({}, props), { schema }));
|
|
14862
15160
|
}
|
|
14863
15161
|
throw new Error("Invalid array list schema");
|
|
14864
15162
|
}
|
|
@@ -14869,11 +15167,11 @@ ArrayListSchema.defaultProps = {
|
|
|
14869
15167
|
var ArrayListSchema_default = ArrayListSchema;
|
|
14870
15168
|
|
|
14871
15169
|
// src/legacy/jsonSchemaForm/arrayTypeSchema/ArraySchema.tsx
|
|
14872
|
-
import { jsx as
|
|
15170
|
+
import { jsx as jsx85 } from "react/jsx-runtime";
|
|
14873
15171
|
var ArraySchema = (props) => {
|
|
14874
15172
|
const { schema } = props;
|
|
14875
15173
|
if (isListArraySchema(schema)) {
|
|
14876
|
-
return /* @__PURE__ */
|
|
15174
|
+
return /* @__PURE__ */ jsx85(ArrayListSchema_default, __spreadValues({}, props));
|
|
14877
15175
|
}
|
|
14878
15176
|
throw new Error("Not implemented");
|
|
14879
15177
|
};
|
|
@@ -14885,15 +15183,15 @@ var ArraySchema_default = ArraySchema;
|
|
|
14885
15183
|
// src/legacy/jsonSchemaForm/objectSchema/ObjectSchema.tsx
|
|
14886
15184
|
var import_classnames11 = __toESM(require_classnames());
|
|
14887
15185
|
import { Header as Header8 } from "@transferwise/components";
|
|
14888
|
-
import { useState as
|
|
14889
|
-
import { Fragment as Fragment13, jsx as
|
|
15186
|
+
import { useState as useState18, useEffect as useEffect10 } from "react";
|
|
15187
|
+
import { Fragment as Fragment13, jsx as jsx86, jsxs as jsxs31 } from "react/jsx-runtime";
|
|
14890
15188
|
var getSchemaColumnClasses2 = (width) => ({
|
|
14891
15189
|
"col-xs-12": true,
|
|
14892
15190
|
"col-sm-6": width === "md",
|
|
14893
15191
|
"col-sm-4": width === "sm"
|
|
14894
15192
|
});
|
|
14895
15193
|
function ObjectSchema(props) {
|
|
14896
|
-
const [model, setModel] =
|
|
15194
|
+
const [model, setModel] = useState18(() => __spreadValues({}, getValidObjectModelParts(props.model, props.schema)));
|
|
14897
15195
|
const onChangeProperty = (propertyName, onChangeProps) => {
|
|
14898
15196
|
if (onChangeProps.model !== null) {
|
|
14899
15197
|
model[propertyName] = onChangeProps.model;
|
|
@@ -14923,21 +15221,21 @@ function ObjectSchema(props) {
|
|
|
14923
15221
|
const orderedPropertyNames = Array.from(allorderedPropertiesSet).filter(isPropertyDefined);
|
|
14924
15222
|
const propsErrors = props.errors;
|
|
14925
15223
|
return /* @__PURE__ */ jsxs31(Fragment13, { children: [
|
|
14926
|
-
props.schema.alert && /* @__PURE__ */
|
|
15224
|
+
props.schema.alert && /* @__PURE__ */ jsx86(DynamicAlert_default, { component: props.schema.alert }),
|
|
14927
15225
|
/* @__PURE__ */ jsxs31("fieldset", { children: [
|
|
14928
|
-
props.schema.title && !props.hideTitle && /* @__PURE__ */
|
|
15226
|
+
props.schema.title && !props.hideTitle && /* @__PURE__ */ jsx86(Header8, { title: props.schema.title, as: "legend" }),
|
|
14929
15227
|
props.schema.description && !props.hideTitle && /* @__PURE__ */ jsxs31("p", { children: [
|
|
14930
15228
|
" ",
|
|
14931
15229
|
props.schema.description,
|
|
14932
15230
|
" "
|
|
14933
15231
|
] }),
|
|
14934
|
-
/* @__PURE__ */
|
|
15232
|
+
/* @__PURE__ */ jsx86("div", { className: "row", children: orderedPropertyNames.map((propertyName) => /* @__PURE__ */ jsx86(
|
|
14935
15233
|
"div",
|
|
14936
15234
|
{
|
|
14937
15235
|
className: (0, import_classnames11.default)(
|
|
14938
15236
|
getSchemaColumnClasses2(props.schema.properties[propertyName].width)
|
|
14939
15237
|
),
|
|
14940
|
-
children: /* @__PURE__ */
|
|
15238
|
+
children: /* @__PURE__ */ jsx86(
|
|
14941
15239
|
GenericSchema_default,
|
|
14942
15240
|
{
|
|
14943
15241
|
schema: props.schema.properties[propertyName],
|
|
@@ -14965,19 +15263,19 @@ var ObjectSchema_default = ObjectSchema;
|
|
|
14965
15263
|
// src/legacy/jsonSchemaForm/oneOfSchema/OneOfSchema.tsx
|
|
14966
15264
|
var import_classnames12 = __toESM(require_classnames());
|
|
14967
15265
|
import { Header as Header9 } from "@transferwise/components";
|
|
14968
|
-
import { useEffect as useEffect12, useMemo as useMemo14, useState as
|
|
15266
|
+
import { useEffect as useEffect12, useMemo as useMemo14, useState as useState19 } from "react";
|
|
14969
15267
|
|
|
14970
15268
|
// src/legacy/jsonSchemaForm/help/Help.tsx
|
|
14971
15269
|
import { Markdown as Markdown6, Info as Info2 } from "@transferwise/components";
|
|
14972
|
-
import { useIntl as
|
|
14973
|
-
import { jsx as
|
|
15270
|
+
import { useIntl as useIntl15 } from "react-intl";
|
|
15271
|
+
import { jsx as jsx87 } from "react/jsx-runtime";
|
|
14974
15272
|
function Help2(props) {
|
|
14975
|
-
const intl =
|
|
14976
|
-
return /* @__PURE__ */
|
|
15273
|
+
const intl = useIntl15();
|
|
15274
|
+
return /* @__PURE__ */ jsx87(
|
|
14977
15275
|
Info2,
|
|
14978
15276
|
{
|
|
14979
15277
|
className: "m-l-1",
|
|
14980
|
-
content: /* @__PURE__ */
|
|
15278
|
+
content: /* @__PURE__ */ jsx87(Markdown6, { config: { link: { target: "_blank" } }, children: props.help.markdown }),
|
|
14981
15279
|
presentation: "POPOVER",
|
|
14982
15280
|
size: "sm",
|
|
14983
15281
|
"aria-label": intl.formatMessage(help_messages_default.helpAria)
|
|
@@ -14997,8 +15295,8 @@ import {
|
|
|
14997
15295
|
InputWithDisplayFormat as InputWithDisplayFormat2,
|
|
14998
15296
|
PhoneNumberInput as PhoneNumberInput2,
|
|
14999
15297
|
RadioGroup as RadioGroup2,
|
|
15000
|
-
SelectInput as
|
|
15001
|
-
SelectInputOptionContent as
|
|
15298
|
+
SelectInput as SelectInput4,
|
|
15299
|
+
SelectInputOptionContent as SelectInputOptionContent4,
|
|
15002
15300
|
Tabs as Tabs2,
|
|
15003
15301
|
TextareaWithDisplayFormat as TextareaWithDisplayFormat2,
|
|
15004
15302
|
Upload as Upload2
|
|
@@ -15189,7 +15487,7 @@ var autocompleteTokenMap2 = {
|
|
|
15189
15487
|
};
|
|
15190
15488
|
|
|
15191
15489
|
// src/legacy/formControl/FormControl.tsx
|
|
15192
|
-
import { Fragment as Fragment14, jsx as
|
|
15490
|
+
import { Fragment as Fragment14, jsx as jsx88 } from "react/jsx-runtime";
|
|
15193
15491
|
var _FormControl = class _FormControl extends PureComponent {
|
|
15194
15492
|
constructor(props) {
|
|
15195
15493
|
super(props);
|
|
@@ -15277,7 +15575,7 @@ var _FormControl = class _FormControl extends PureComponent {
|
|
|
15277
15575
|
} = this.props;
|
|
15278
15576
|
switch (type) {
|
|
15279
15577
|
case FormControlType.RADIO:
|
|
15280
|
-
return /* @__PURE__ */
|
|
15578
|
+
return /* @__PURE__ */ jsx88(
|
|
15281
15579
|
RadioGroup2,
|
|
15282
15580
|
{
|
|
15283
15581
|
radios: options.map(this.mapOption),
|
|
@@ -15287,7 +15585,7 @@ var _FormControl = class _FormControl extends PureComponent {
|
|
|
15287
15585
|
}
|
|
15288
15586
|
);
|
|
15289
15587
|
case FormControlType.CHECKBOX:
|
|
15290
|
-
return /* @__PURE__ */
|
|
15588
|
+
return /* @__PURE__ */ jsx88(
|
|
15291
15589
|
Checkbox2,
|
|
15292
15590
|
{
|
|
15293
15591
|
checked: getSafeBooleanValue(value, { coerceValue: true }),
|
|
@@ -15305,8 +15603,8 @@ var _FormControl = class _FormControl extends PureComponent {
|
|
|
15305
15603
|
const search = options.length >= 8;
|
|
15306
15604
|
const items = options;
|
|
15307
15605
|
const selected = this.getSelectedOption(options);
|
|
15308
|
-
return /* @__PURE__ */
|
|
15309
|
-
|
|
15606
|
+
return /* @__PURE__ */ jsx88("div", { className: "d-flex flex-column", children: /* @__PURE__ */ jsx88(
|
|
15607
|
+
SelectInput4,
|
|
15310
15608
|
{
|
|
15311
15609
|
id,
|
|
15312
15610
|
items: items.map((value2) => ({
|
|
@@ -15315,8 +15613,8 @@ var _FormControl = class _FormControl extends PureComponent {
|
|
|
15315
15613
|
disabled: value2.disabled
|
|
15316
15614
|
})),
|
|
15317
15615
|
value: selected != null ? selected : null,
|
|
15318
|
-
renderValue: ({ hideIconInTrigger, icon, label: label2, note, secondary }, withinTrigger) => /* @__PURE__ */
|
|
15319
|
-
|
|
15616
|
+
renderValue: ({ hideIconInTrigger, icon, label: label2, note, secondary }, withinTrigger) => /* @__PURE__ */ jsx88(
|
|
15617
|
+
SelectInputOptionContent4,
|
|
15320
15618
|
{
|
|
15321
15619
|
title: label2,
|
|
15322
15620
|
note: withinTrigger ? note != null ? note : secondary : note,
|
|
@@ -15344,13 +15642,13 @@ var _FormControl = class _FormControl extends PureComponent {
|
|
|
15344
15642
|
) });
|
|
15345
15643
|
}
|
|
15346
15644
|
case FormControlType.TAB:
|
|
15347
|
-
return /* @__PURE__ */
|
|
15645
|
+
return /* @__PURE__ */ jsx88(
|
|
15348
15646
|
Tabs2,
|
|
15349
15647
|
{
|
|
15350
15648
|
selected: ((_a = this.getSelectedOption(options)) == null ? void 0 : _a.value) || 0,
|
|
15351
15649
|
tabs: options.map((option) => ({
|
|
15352
15650
|
title: option.label,
|
|
15353
|
-
content: /* @__PURE__ */
|
|
15651
|
+
content: /* @__PURE__ */ jsx88(Fragment14, {}),
|
|
15354
15652
|
disabled: option.disabled || false
|
|
15355
15653
|
})),
|
|
15356
15654
|
name: id,
|
|
@@ -15365,7 +15663,7 @@ var _FormControl = class _FormControl extends PureComponent {
|
|
|
15365
15663
|
);
|
|
15366
15664
|
case FormControlType.NUMERIC:
|
|
15367
15665
|
case FormControlType.NUMBER: {
|
|
15368
|
-
return /* @__PURE__ */
|
|
15666
|
+
return /* @__PURE__ */ jsx88(
|
|
15369
15667
|
"input",
|
|
15370
15668
|
{
|
|
15371
15669
|
autoComplete: this.getAutocompleteValue(),
|
|
@@ -15399,7 +15697,7 @@ var _FormControl = class _FormControl extends PureComponent {
|
|
|
15399
15697
|
);
|
|
15400
15698
|
}
|
|
15401
15699
|
case FormControlType.HIDDEN:
|
|
15402
|
-
return /* @__PURE__ */
|
|
15700
|
+
return /* @__PURE__ */ jsx88(
|
|
15403
15701
|
"input",
|
|
15404
15702
|
{
|
|
15405
15703
|
type: "hidden",
|
|
@@ -15409,7 +15707,7 @@ var _FormControl = class _FormControl extends PureComponent {
|
|
|
15409
15707
|
}
|
|
15410
15708
|
);
|
|
15411
15709
|
case FormControlType.PASSWORD:
|
|
15412
|
-
return /* @__PURE__ */
|
|
15710
|
+
return /* @__PURE__ */ jsx88(
|
|
15413
15711
|
"input",
|
|
15414
15712
|
{
|
|
15415
15713
|
autoComplete: this.getAutocompleteValue(),
|
|
@@ -15429,7 +15727,7 @@ var _FormControl = class _FormControl extends PureComponent {
|
|
|
15429
15727
|
);
|
|
15430
15728
|
case FormControlType.DATE:
|
|
15431
15729
|
case FormControlType.DATETIME:
|
|
15432
|
-
return /* @__PURE__ */
|
|
15730
|
+
return /* @__PURE__ */ jsx88(
|
|
15433
15731
|
DateInput2,
|
|
15434
15732
|
{
|
|
15435
15733
|
dayAutoComplete: this.getAutocompleteValue({ suffix: "-day" }),
|
|
@@ -15445,7 +15743,7 @@ var _FormControl = class _FormControl extends PureComponent {
|
|
|
15445
15743
|
}
|
|
15446
15744
|
);
|
|
15447
15745
|
case FormControlType.DATELOOKUP: {
|
|
15448
|
-
return /* @__PURE__ */
|
|
15746
|
+
return /* @__PURE__ */ jsx88(
|
|
15449
15747
|
DateLookup2,
|
|
15450
15748
|
{
|
|
15451
15749
|
value: getSafeDateStringValue(value),
|
|
@@ -15463,7 +15761,7 @@ var _FormControl = class _FormControl extends PureComponent {
|
|
|
15463
15761
|
);
|
|
15464
15762
|
}
|
|
15465
15763
|
case FormControlType.TEL:
|
|
15466
|
-
return /* @__PURE__ */
|
|
15764
|
+
return /* @__PURE__ */ jsx88(
|
|
15467
15765
|
PhoneNumberInput2,
|
|
15468
15766
|
{
|
|
15469
15767
|
disabled,
|
|
@@ -15495,7 +15793,7 @@ var _FormControl = class _FormControl extends PureComponent {
|
|
|
15495
15793
|
autoComplete: this.getAutocompleteValue()
|
|
15496
15794
|
};
|
|
15497
15795
|
if (this.props.displayPattern) {
|
|
15498
|
-
return /* @__PURE__ */
|
|
15796
|
+
return /* @__PURE__ */ jsx88(
|
|
15499
15797
|
TextareaWithDisplayFormat2,
|
|
15500
15798
|
__spreadProps(__spreadValues({
|
|
15501
15799
|
displayPattern: this.props.displayPattern
|
|
@@ -15504,7 +15802,7 @@ var _FormControl = class _FormControl extends PureComponent {
|
|
|
15504
15802
|
})
|
|
15505
15803
|
);
|
|
15506
15804
|
}
|
|
15507
|
-
return /* @__PURE__ */
|
|
15805
|
+
return /* @__PURE__ */ jsx88(
|
|
15508
15806
|
"textarea",
|
|
15509
15807
|
__spreadProps(__spreadValues({}, textareaProps), {
|
|
15510
15808
|
"aria-describedby": describedBy,
|
|
@@ -15517,7 +15815,7 @@ var _FormControl = class _FormControl extends PureComponent {
|
|
|
15517
15815
|
return (
|
|
15518
15816
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
15519
15817
|
// @ts-expect-error - TODO: Remove this once Upload is migrated to TypeScript
|
|
15520
|
-
/* @__PURE__ */
|
|
15818
|
+
/* @__PURE__ */ jsx88(
|
|
15521
15819
|
Upload2,
|
|
15522
15820
|
__spreadProps(__spreadValues({}, uploadProps), {
|
|
15523
15821
|
usAccept: uploadProps.usAccept || "*",
|
|
@@ -15555,7 +15853,7 @@ var _FormControl = class _FormControl extends PureComponent {
|
|
|
15555
15853
|
autoComplete: this.getAutocompleteValue()
|
|
15556
15854
|
};
|
|
15557
15855
|
if (this.props.displayPattern) {
|
|
15558
|
-
return /* @__PURE__ */
|
|
15856
|
+
return /* @__PURE__ */ jsx88(
|
|
15559
15857
|
InputWithDisplayFormat2,
|
|
15560
15858
|
__spreadProps(__spreadValues({
|
|
15561
15859
|
displayPattern: this.props.displayPattern
|
|
@@ -15564,7 +15862,7 @@ var _FormControl = class _FormControl extends PureComponent {
|
|
|
15564
15862
|
})
|
|
15565
15863
|
);
|
|
15566
15864
|
}
|
|
15567
|
-
return /* @__PURE__ */
|
|
15865
|
+
return /* @__PURE__ */ jsx88(
|
|
15568
15866
|
"input",
|
|
15569
15867
|
__spreadProps(__spreadValues({}, inputProps), {
|
|
15570
15868
|
"aria-describedby": describedBy,
|
|
@@ -15613,7 +15911,7 @@ _FormControl.defaultProps = {
|
|
|
15613
15911
|
var FormControl = _FormControl;
|
|
15614
15912
|
|
|
15615
15913
|
// src/legacy/jsonSchemaForm/schemaFormControl/SchemaFormControl.tsx
|
|
15616
|
-
import { jsx as
|
|
15914
|
+
import { jsx as jsx89 } from "react/jsx-runtime";
|
|
15617
15915
|
var isNativeInput = (propsSchemaType) => propsSchemaType === "string" || propsSchemaType === "number";
|
|
15618
15916
|
var getControlType = (schema) => {
|
|
15619
15917
|
if (isOneOfSchema2(schema)) {
|
|
@@ -15719,7 +16017,7 @@ function SchemaFormControl(props) {
|
|
|
15719
16017
|
describedBy,
|
|
15720
16018
|
required
|
|
15721
16019
|
};
|
|
15722
|
-
return /* @__PURE__ */
|
|
16020
|
+
return /* @__PURE__ */ jsx89("div", { "aria-describedby": describedBy, children: /* @__PURE__ */ jsx89(FormControl, __spreadValues(__spreadValues({ type: controlType, value: safeValue }, events), controlProps)) });
|
|
15723
16021
|
}
|
|
15724
16022
|
SchemaFormControl.defaultProps = {
|
|
15725
16023
|
value: null,
|
|
@@ -15748,17 +16046,17 @@ var warnIfInvalidSchema = (schema, log, controlType) => {
|
|
|
15748
16046
|
var SchemaFormControl_default = SchemaFormControl;
|
|
15749
16047
|
|
|
15750
16048
|
// src/legacy/jsonSchemaForm/oneOfSchema/OneOfSchema.tsx
|
|
15751
|
-
import { Fragment as Fragment15, jsx as
|
|
16049
|
+
import { Fragment as Fragment15, jsx as jsx90, jsxs as jsxs32 } from "react/jsx-runtime";
|
|
15752
16050
|
function OneOfSchema(props) {
|
|
15753
16051
|
const onEvent = useEventDispatcher();
|
|
15754
|
-
const [changed, setChanged] =
|
|
15755
|
-
const [focused, setFocused] =
|
|
15756
|
-
const [blurred, setBlurred] =
|
|
16052
|
+
const [changed, setChanged] = useState19(false);
|
|
16053
|
+
const [focused, setFocused] = useState19(false);
|
|
16054
|
+
const [blurred, setBlurred] = useState19(false);
|
|
15757
16055
|
const id = useMemo14(() => props.schema.$id || generateRandomId(), [props.schema.$id]);
|
|
15758
|
-
const [schemaIndex, setSchemaIndex] =
|
|
16056
|
+
const [schemaIndex, setSchemaIndex] = useState19(
|
|
15759
16057
|
getActiveSchemaIndex(props.schema, props.model)
|
|
15760
16058
|
);
|
|
15761
|
-
const [models, setModels] =
|
|
16059
|
+
const [models, setModels] = useState19(getModelPartsForSchemas(props.model, props.schema.oneOf));
|
|
15762
16060
|
const debouncedTrackEvent = useDebouncedFunction(onEvent, 200);
|
|
15763
16061
|
const onSearchChange = (searchValue) => {
|
|
15764
16062
|
debouncedTrackEvent("Dynamic Flow - OneOf Searched", {
|
|
@@ -15826,10 +16124,10 @@ function OneOfSchema(props) {
|
|
|
15826
16124
|
const feedbackId = `${id}-feedback`;
|
|
15827
16125
|
return /* @__PURE__ */ jsxs32(Fragment15, { children: [
|
|
15828
16126
|
(props.schema.oneOf.length > 1 || isConstSchema2(props.schema.oneOf[0])) && /* @__PURE__ */ jsxs32(Fragment15, { children: [
|
|
15829
|
-
props.schema.alert && /* @__PURE__ */
|
|
16127
|
+
props.schema.alert && /* @__PURE__ */ jsx90(DynamicAlert_default, { component: props.schema.alert }),
|
|
15830
16128
|
/* @__PURE__ */ jsxs32("div", { className: (0, import_classnames12.default)(formGroupClasses), children: [
|
|
15831
16129
|
getTitleAndHelp(props.schema, id),
|
|
15832
|
-
/* @__PURE__ */
|
|
16130
|
+
/* @__PURE__ */ jsx90(
|
|
15833
16131
|
SchemaFormControl_default,
|
|
15834
16132
|
{
|
|
15835
16133
|
id,
|
|
@@ -15844,7 +16142,7 @@ function OneOfSchema(props) {
|
|
|
15844
16142
|
onSearchChange
|
|
15845
16143
|
}
|
|
15846
16144
|
),
|
|
15847
|
-
/* @__PURE__ */
|
|
16145
|
+
/* @__PURE__ */ jsx90(
|
|
15848
16146
|
ControlFeedback_default,
|
|
15849
16147
|
{
|
|
15850
16148
|
id: feedbackId,
|
|
@@ -15860,7 +16158,7 @@ function OneOfSchema(props) {
|
|
|
15860
16158
|
)
|
|
15861
16159
|
] })
|
|
15862
16160
|
] }),
|
|
15863
|
-
isNoNConstSchema(props.schema.oneOf[schemaIndex]) && /* @__PURE__ */
|
|
16161
|
+
isNoNConstSchema(props.schema.oneOf[schemaIndex]) && /* @__PURE__ */ jsx90(
|
|
15864
16162
|
GenericSchema_default,
|
|
15865
16163
|
{
|
|
15866
16164
|
schema: props.schema.oneOf[schemaIndex],
|
|
@@ -15877,16 +16175,16 @@ function OneOfSchema(props) {
|
|
|
15877
16175
|
}
|
|
15878
16176
|
function getTitleAndHelp(schema, forId) {
|
|
15879
16177
|
var _a;
|
|
15880
|
-
const helpElement = schema.help ? /* @__PURE__ */
|
|
15881
|
-
const titleElement = isConstSchema2(schema.oneOf[0]) ? /* @__PURE__ */
|
|
16178
|
+
const helpElement = schema.help ? /* @__PURE__ */ jsx90(Help_default2, { help: schema.help }) : null;
|
|
16179
|
+
const titleElement = isConstSchema2(schema.oneOf[0]) ? /* @__PURE__ */ jsx90("div", { className: "m-b-1", children: /* @__PURE__ */ jsxs32("label", { className: "control-label d-inline", htmlFor: forId, children: [
|
|
15882
16180
|
schema.title,
|
|
15883
16181
|
" ",
|
|
15884
16182
|
helpElement
|
|
15885
|
-
] }) }) : /* @__PURE__ */
|
|
16183
|
+
] }) }) : /* @__PURE__ */ jsx90(Fragment15, { children: helpElement ? /* @__PURE__ */ jsxs32("h4", { className: "m-b-2", children: [
|
|
15886
16184
|
schema.title,
|
|
15887
16185
|
" ",
|
|
15888
16186
|
helpElement
|
|
15889
|
-
] }) : /* @__PURE__ */
|
|
16187
|
+
] }) : /* @__PURE__ */ jsx90(Header9, { title: (_a = schema.title) != null ? _a : "" }) });
|
|
15890
16188
|
return schema.title ? titleElement : helpElement;
|
|
15891
16189
|
}
|
|
15892
16190
|
function getValidations(props, schemaIndex) {
|
|
@@ -15923,12 +16221,12 @@ var OneOfSchema_default = OneOfSchema;
|
|
|
15923
16221
|
|
|
15924
16222
|
// src/legacy/jsonSchemaForm/persistAsyncSchema/persistAsyncBlobSchema/PersistAsyncBlobSchema.tsx
|
|
15925
16223
|
var import_classnames13 = __toESM(require_classnames());
|
|
15926
|
-
import { useEffect as useEffect13, useState as
|
|
16224
|
+
import { useEffect as useEffect13, useState as useState20 } from "react";
|
|
15927
16225
|
|
|
15928
16226
|
// src/legacy/jsonSchemaForm/persistAsyncSchema/persistAsyncBlobSchema/UploadInputAdapter.tsx
|
|
15929
16227
|
import { Status as Status2, UploadInput as UploadInput4 } from "@transferwise/components";
|
|
15930
16228
|
import { useMemo as useMemo15 } from "react";
|
|
15931
|
-
import { jsx as
|
|
16229
|
+
import { jsx as jsx91 } from "react/jsx-runtime";
|
|
15932
16230
|
function UploadInputAdapter(props) {
|
|
15933
16231
|
const {
|
|
15934
16232
|
id,
|
|
@@ -15961,7 +16259,7 @@ function UploadInputAdapter(props) {
|
|
|
15961
16259
|
return Promise.reject();
|
|
15962
16260
|
});
|
|
15963
16261
|
};
|
|
15964
|
-
return /* @__PURE__ */
|
|
16262
|
+
return /* @__PURE__ */ jsx91(
|
|
15965
16263
|
UploadInput4,
|
|
15966
16264
|
{
|
|
15967
16265
|
id,
|
|
@@ -15981,13 +16279,13 @@ function UploadInputAdapter(props) {
|
|
|
15981
16279
|
}
|
|
15982
16280
|
|
|
15983
16281
|
// src/legacy/jsonSchemaForm/persistAsyncSchema/persistAsyncBlobSchema/PersistAsyncBlobSchema.tsx
|
|
15984
|
-
import { jsx as
|
|
16282
|
+
import { jsx as jsx92, jsxs as jsxs33 } from "react/jsx-runtime";
|
|
15985
16283
|
function PersistAsyncBlobSchema(props) {
|
|
15986
16284
|
const { model, schema, submitted, required, errors, onChange } = props;
|
|
15987
|
-
const [persistAsyncValidationMessages, setPersistAsyncValidationMessages] =
|
|
15988
|
-
const [persistAsyncValidations, setPersistAsyncValidations] =
|
|
15989
|
-
const [validations, setValidations] =
|
|
15990
|
-
const [changed, setChanged] =
|
|
16285
|
+
const [persistAsyncValidationMessages, setPersistAsyncValidationMessages] = useState20({});
|
|
16286
|
+
const [persistAsyncValidations, setPersistAsyncValidations] = useState20(null);
|
|
16287
|
+
const [validations, setValidations] = useState20([]);
|
|
16288
|
+
const [changed, setChanged] = useState20(false);
|
|
15991
16289
|
const httpClient = useHttpClient();
|
|
15992
16290
|
const onEvent = useEventDispatcher();
|
|
15993
16291
|
useEffect13(() => {
|
|
@@ -16028,7 +16326,7 @@ function PersistAsyncBlobSchema(props) {
|
|
|
16028
16326
|
const id = schema.$id || schema.persistAsync.schema.$id || schema.persistAsync.idProperty;
|
|
16029
16327
|
const feedbackId = `${id}-feedback`;
|
|
16030
16328
|
return /* @__PURE__ */ jsxs33("div", { className: (0, import_classnames13.default)(formGroupClasses), children: [
|
|
16031
|
-
/* @__PURE__ */
|
|
16329
|
+
/* @__PURE__ */ jsx92("div", { "aria-describedby": feedbackId, children: /* @__PURE__ */ jsx92(
|
|
16032
16330
|
UploadInputAdapter,
|
|
16033
16331
|
__spreadValues({
|
|
16034
16332
|
id,
|
|
@@ -16045,7 +16343,7 @@ function PersistAsyncBlobSchema(props) {
|
|
|
16045
16343
|
onCancel
|
|
16046
16344
|
}, mapSchemaToUploadOptions(schema.persistAsync.schema))
|
|
16047
16345
|
) }),
|
|
16048
|
-
/* @__PURE__ */
|
|
16346
|
+
/* @__PURE__ */ jsx92(
|
|
16049
16347
|
ControlFeedback_default,
|
|
16050
16348
|
{
|
|
16051
16349
|
id: feedbackId,
|
|
@@ -16070,17 +16368,17 @@ PersistAsyncBlobSchema.defaultProps = {
|
|
|
16070
16368
|
var PersistAsyncBlobSchema_default = PersistAsyncBlobSchema;
|
|
16071
16369
|
|
|
16072
16370
|
// src/legacy/jsonSchemaForm/persistAsyncSchema/PersistAsyncSchema.tsx
|
|
16073
|
-
import { jsx as
|
|
16371
|
+
import { jsx as jsx93 } from "react/jsx-runtime";
|
|
16074
16372
|
function PersistAsyncSchema(props) {
|
|
16075
16373
|
const { schema } = props;
|
|
16076
16374
|
const persistAsyncSchemaType = schema.persistAsync.schema.type;
|
|
16077
16375
|
if (persistAsyncSchemaType === "blob") {
|
|
16078
|
-
return /* @__PURE__ */
|
|
16376
|
+
return /* @__PURE__ */ jsx93(
|
|
16079
16377
|
PersistAsyncBlobSchema_default,
|
|
16080
16378
|
__spreadValues({}, props)
|
|
16081
16379
|
);
|
|
16082
16380
|
}
|
|
16083
|
-
return /* @__PURE__ */
|
|
16381
|
+
return /* @__PURE__ */ jsx93(PersistAsyncBasicSchema_default, __spreadValues({}, props));
|
|
16084
16382
|
}
|
|
16085
16383
|
PersistAsyncSchema.defaultProps = {
|
|
16086
16384
|
required: false
|
|
@@ -16088,7 +16386,7 @@ PersistAsyncSchema.defaultProps = {
|
|
|
16088
16386
|
var PersistAsyncSchema_default = PersistAsyncSchema;
|
|
16089
16387
|
|
|
16090
16388
|
// src/legacy/jsonSchemaForm/promotedOneOfSchema/PromotedOneOfSchema.tsx
|
|
16091
|
-
import { useState as
|
|
16389
|
+
import { useState as useState21 } from "react";
|
|
16092
16390
|
|
|
16093
16391
|
// src/legacy/jsonSchemaForm/promotedOneOfSchema/promoted-one-of-utils.ts
|
|
16094
16392
|
var getSelectionFromModel = (schema, model) => {
|
|
@@ -16101,7 +16399,7 @@ var getSelectionFromModel = (schema, model) => {
|
|
|
16101
16399
|
|
|
16102
16400
|
// src/legacy/jsonSchemaForm/promotedOneOfSchema/promotedOneOfControl/PromotedOneOfCheckboxControl.tsx
|
|
16103
16401
|
import { Checkbox as Checkbox3 } from "@transferwise/components";
|
|
16104
|
-
import { jsx as
|
|
16402
|
+
import { jsx as jsx94 } from "react/jsx-runtime";
|
|
16105
16403
|
var PromotedOneOfCheckboxControl = (props) => {
|
|
16106
16404
|
const { id, selection, setSelection } = props;
|
|
16107
16405
|
const { promoted, other, checkedMeans } = props.promotion;
|
|
@@ -16112,14 +16410,14 @@ var PromotedOneOfCheckboxControl = (props) => {
|
|
|
16112
16410
|
const toggleSelection = () => {
|
|
16113
16411
|
setSelection(checked ? selectionWhenUnchecked : selectionWhenChecked);
|
|
16114
16412
|
};
|
|
16115
|
-
return /* @__PURE__ */
|
|
16413
|
+
return /* @__PURE__ */ jsx94("div", { className: "form-group", children: /* @__PURE__ */ jsx94(Checkbox3, { id, label: title, checked, onChange: toggleSelection }) });
|
|
16116
16414
|
};
|
|
16117
16415
|
PromotedOneOfCheckboxControl.defaultProps = {};
|
|
16118
16416
|
var PromotedOneOfCheckboxControl_default = PromotedOneOfCheckboxControl;
|
|
16119
16417
|
|
|
16120
16418
|
// src/legacy/jsonSchemaForm/promotedOneOfSchema/promotedOneOfControl/PromotedOneOfRadioControl.tsx
|
|
16121
16419
|
import { RadioGroup as RadioGroup3 } from "@transferwise/components";
|
|
16122
|
-
import { jsx as
|
|
16420
|
+
import { jsx as jsx95, jsxs as jsxs34 } from "react/jsx-runtime";
|
|
16123
16421
|
function PromotedOneOfRadioControl(props) {
|
|
16124
16422
|
var _a, _b;
|
|
16125
16423
|
const { id, selection, setSelection, promotion, promotedOneOf, title } = props;
|
|
@@ -16137,8 +16435,8 @@ function PromotedOneOfRadioControl(props) {
|
|
|
16137
16435
|
}, getAvatarPropertyForRadioOption(promotion.other))
|
|
16138
16436
|
];
|
|
16139
16437
|
return /* @__PURE__ */ jsxs34("div", { className: "form-group", children: [
|
|
16140
|
-
title && /* @__PURE__ */
|
|
16141
|
-
/* @__PURE__ */
|
|
16438
|
+
title && /* @__PURE__ */ jsx95("label", { className: "control-label", htmlFor: id, children: title }),
|
|
16439
|
+
/* @__PURE__ */ jsx95(
|
|
16142
16440
|
RadioGroup3,
|
|
16143
16441
|
{
|
|
16144
16442
|
name: "promoted-selection",
|
|
@@ -16156,16 +16454,16 @@ PromotedOneOfRadioControl.defaultProps = {
|
|
|
16156
16454
|
var PromotedOneOfRadioControl_default = PromotedOneOfRadioControl;
|
|
16157
16455
|
|
|
16158
16456
|
// src/legacy/jsonSchemaForm/promotedOneOfSchema/promotedOneOfControl/PromotedOneOfControl.tsx
|
|
16159
|
-
import { Fragment as Fragment16, jsx as
|
|
16457
|
+
import { Fragment as Fragment16, jsx as jsx96 } from "react/jsx-runtime";
|
|
16160
16458
|
function PromotedOneOfControl(props) {
|
|
16161
16459
|
const controlType = props.promotion.control || "radio";
|
|
16162
16460
|
switch (controlType) {
|
|
16163
16461
|
case "radio":
|
|
16164
|
-
return /* @__PURE__ */
|
|
16462
|
+
return /* @__PURE__ */ jsx96(PromotedOneOfRadioControl_default, __spreadValues({}, props));
|
|
16165
16463
|
case "checkbox":
|
|
16166
|
-
return /* @__PURE__ */
|
|
16464
|
+
return /* @__PURE__ */ jsx96(PromotedOneOfCheckboxControl_default, __spreadValues({}, props));
|
|
16167
16465
|
default:
|
|
16168
|
-
return /* @__PURE__ */
|
|
16466
|
+
return /* @__PURE__ */ jsx96(Fragment16, {});
|
|
16169
16467
|
}
|
|
16170
16468
|
}
|
|
16171
16469
|
PromotedOneOfControl.defaultProps = {
|
|
@@ -16175,11 +16473,11 @@ PromotedOneOfControl.defaultProps = {
|
|
|
16175
16473
|
var PromotedOneOfControl_default = PromotedOneOfControl;
|
|
16176
16474
|
|
|
16177
16475
|
// src/legacy/jsonSchemaForm/promotedOneOfSchema/PromotedOneOfSchema.tsx
|
|
16178
|
-
import { Fragment as Fragment17, jsx as
|
|
16476
|
+
import { Fragment as Fragment17, jsx as jsx97, jsxs as jsxs35 } from "react/jsx-runtime";
|
|
16179
16477
|
var isPromoted = (schema) => schema.promoted === true;
|
|
16180
16478
|
var PromotedOneOfSchema = (props) => {
|
|
16181
16479
|
var _a;
|
|
16182
|
-
const [selection, setSelection] =
|
|
16480
|
+
const [selection, setSelection] = useState21(
|
|
16183
16481
|
getSelectionFromModel(props.schema, props.model) || ((_a = props.schema.promotion) == null ? void 0 : _a.default) || "promoted"
|
|
16184
16482
|
);
|
|
16185
16483
|
const promotedAlert = props.schema.alert;
|
|
@@ -16187,8 +16485,8 @@ var PromotedOneOfSchema = (props) => {
|
|
|
16187
16485
|
const promotedObjectSchema = getPromotedObjectSchema(promotedOneOf);
|
|
16188
16486
|
const otherOneOf = getOtherOneOf(props.schema);
|
|
16189
16487
|
return /* @__PURE__ */ jsxs35(Fragment17, { children: [
|
|
16190
|
-
promotedAlert && /* @__PURE__ */
|
|
16191
|
-
/* @__PURE__ */
|
|
16488
|
+
promotedAlert && /* @__PURE__ */ jsx97(DynamicAlert_default, { component: promotedAlert }),
|
|
16489
|
+
/* @__PURE__ */ jsx97(
|
|
16192
16490
|
PromotedOneOfControl_default,
|
|
16193
16491
|
{
|
|
16194
16492
|
id: props.schema.$id,
|
|
@@ -16199,8 +16497,8 @@ var PromotedOneOfSchema = (props) => {
|
|
|
16199
16497
|
setSelection
|
|
16200
16498
|
}
|
|
16201
16499
|
),
|
|
16202
|
-
selection === "promoted" && /* @__PURE__ */
|
|
16203
|
-
selection === "other" && /* @__PURE__ */
|
|
16500
|
+
selection === "promoted" && /* @__PURE__ */ jsx97(ObjectSchema_default, __spreadProps(__spreadValues({}, props), { schema: promotedObjectSchema })),
|
|
16501
|
+
selection === "other" && /* @__PURE__ */ jsx97(GenericSchema_default, __spreadProps(__spreadValues({}, props), { schema: otherOneOf }))
|
|
16204
16502
|
] });
|
|
16205
16503
|
};
|
|
16206
16504
|
function getPromotedObjectSchema(promotedSchema) {
|
|
@@ -16231,7 +16529,7 @@ var PromotedOneOfSchema_default = PromotedOneOfSchema;
|
|
|
16231
16529
|
|
|
16232
16530
|
// src/legacy/jsonSchemaForm/readOnlySchema/ReadOnlySchema.tsx
|
|
16233
16531
|
import { DefinitionList as DefinitionList2, Layout } from "@transferwise/components";
|
|
16234
|
-
import { useIntl as
|
|
16532
|
+
import { useIntl as useIntl16 } from "react-intl";
|
|
16235
16533
|
|
|
16236
16534
|
// src/legacy/jsonSchemaForm/readOnlySchema/ReadOnlySchema.messages.ts
|
|
16237
16535
|
import { defineMessages as defineMessages12 } from "react-intl";
|
|
@@ -16249,12 +16547,12 @@ var ReadOnlySchema_messages_default = defineMessages12({
|
|
|
16249
16547
|
});
|
|
16250
16548
|
|
|
16251
16549
|
// src/legacy/jsonSchemaForm/readOnlySchema/ReadOnlySchema.tsx
|
|
16252
|
-
import { Fragment as Fragment18, jsx as
|
|
16550
|
+
import { Fragment as Fragment18, jsx as jsx98, jsxs as jsxs36 } from "react/jsx-runtime";
|
|
16253
16551
|
function ReadOnlySchema({ schema, model }) {
|
|
16254
16552
|
const { title = "" } = schema;
|
|
16255
|
-
const { formatMessage } =
|
|
16553
|
+
const { formatMessage } = useIntl16();
|
|
16256
16554
|
const value = getValueForSchema({ schema, model, formatMessage });
|
|
16257
|
-
return /* @__PURE__ */
|
|
16555
|
+
return /* @__PURE__ */ jsx98(DefinitionList2, { layout: Layout.VERTICAL_ONE_COLUMN, definitions: [{ title, value, key: "" }] });
|
|
16258
16556
|
}
|
|
16259
16557
|
var ReadOnlySchema_default = ReadOnlySchema;
|
|
16260
16558
|
function getValueForSchema({
|
|
@@ -16295,18 +16593,18 @@ function getValueFromOption(option) {
|
|
|
16295
16593
|
}
|
|
16296
16594
|
|
|
16297
16595
|
// src/legacy/jsonSchemaForm/validationAsyncSchema/ValidationAsyncSchema.tsx
|
|
16298
|
-
import { useEffect as useEffect14, useRef as useRef3, useState as
|
|
16299
|
-
import { jsx as
|
|
16596
|
+
import { useEffect as useEffect14, useRef as useRef3, useState as useState22 } from "react";
|
|
16597
|
+
import { jsx as jsx99 } from "react/jsx-runtime";
|
|
16300
16598
|
function ValidationAsyncSchema(props) {
|
|
16301
16599
|
const { schema, model, required, submitted, errors, onChange } = props;
|
|
16302
|
-
const [validationAsyncModel, setValidationAsyncModel] =
|
|
16600
|
+
const [validationAsyncModel, setValidationAsyncModel] = useState22(model);
|
|
16303
16601
|
const previousRequestedModelReference = useRef3(null);
|
|
16304
|
-
const [validationAsyncSuccessMessage, setValidationAsyncSuccessMessage] =
|
|
16602
|
+
const [validationAsyncSuccessMessage, setValidationAsyncSuccessMessage] = useState22(
|
|
16305
16603
|
null
|
|
16306
16604
|
);
|
|
16307
|
-
const [validationAsyncErrors, setValidationAsyncErrors] =
|
|
16308
|
-
const [fieldSubmitted, setFieldSubmitted] =
|
|
16309
|
-
const [abortController, setAbortController] =
|
|
16605
|
+
const [validationAsyncErrors, setValidationAsyncErrors] = useState22(null);
|
|
16606
|
+
const [fieldSubmitted, setFieldSubmitted] = useState22(false);
|
|
16607
|
+
const [abortController, setAbortController] = useState22(null);
|
|
16310
16608
|
const httpClient = useHttpClient();
|
|
16311
16609
|
const onEvent = useEventDispatcher();
|
|
16312
16610
|
const log = useLogger();
|
|
@@ -16380,13 +16678,13 @@ function ValidationAsyncSchema(props) {
|
|
|
16380
16678
|
required,
|
|
16381
16679
|
schema
|
|
16382
16680
|
};
|
|
16383
|
-
return /* @__PURE__ */
|
|
16681
|
+
return /* @__PURE__ */ jsx99(BasicTypeSchema_default, __spreadValues({}, basicTypeSchemaProps));
|
|
16384
16682
|
}
|
|
16385
16683
|
ValidationAsyncSchema.defaultProps = { required: false };
|
|
16386
16684
|
var ValidationAsyncSchema_default = ValidationAsyncSchema;
|
|
16387
16685
|
|
|
16388
16686
|
// src/legacy/jsonSchemaForm/genericSchema/GenericSchema.tsx
|
|
16389
|
-
import { Fragment as Fragment19, jsx as
|
|
16687
|
+
import { Fragment as Fragment19, jsx as jsx100 } from "react/jsx-runtime";
|
|
16390
16688
|
import { createElement } from "react";
|
|
16391
16689
|
function GenericSchemaForm(props) {
|
|
16392
16690
|
const { schema, model = null, errors = null, hideTitle = false, disabled = false } = props;
|
|
@@ -16403,29 +16701,29 @@ function GenericSchemaForm(props) {
|
|
|
16403
16701
|
}, [JSON.stringify(schema), JSON.stringify(model), JSON.stringify(errors), type, log]);
|
|
16404
16702
|
switch (type) {
|
|
16405
16703
|
case "readOnly":
|
|
16406
|
-
return /* @__PURE__ */
|
|
16704
|
+
return /* @__PURE__ */ jsx100(ReadOnlySchema_default, __spreadValues({}, schemaProps));
|
|
16407
16705
|
case "persistAsync":
|
|
16408
|
-
return /* @__PURE__ */
|
|
16706
|
+
return /* @__PURE__ */ jsx100(PersistAsyncSchema_default, __spreadValues({}, schemaProps));
|
|
16409
16707
|
case "validationAsync":
|
|
16410
|
-
return /* @__PURE__ */
|
|
16708
|
+
return /* @__PURE__ */ jsx100(ValidationAsyncSchema_default, __spreadValues({}, schemaProps));
|
|
16411
16709
|
case "basic": {
|
|
16412
16710
|
const basicTypeProps = __spreadValues({
|
|
16413
16711
|
infoMessage: null
|
|
16414
16712
|
}, schemaProps);
|
|
16415
|
-
return /* @__PURE__ */
|
|
16713
|
+
return /* @__PURE__ */ jsx100(BasicTypeSchema_default, __spreadValues({}, basicTypeProps));
|
|
16416
16714
|
}
|
|
16417
16715
|
case "object":
|
|
16418
16716
|
return /* @__PURE__ */ createElement(ObjectSchema_default, __spreadProps(__spreadValues({}, schemaProps), { key: JSON.stringify(schema) }));
|
|
16419
16717
|
case "array":
|
|
16420
|
-
return /* @__PURE__ */
|
|
16718
|
+
return /* @__PURE__ */ jsx100(ArraySchema_default, __spreadValues({}, schemaProps));
|
|
16421
16719
|
case "promotedOneOf":
|
|
16422
|
-
return /* @__PURE__ */
|
|
16720
|
+
return /* @__PURE__ */ jsx100(PromotedOneOfSchema_default, __spreadValues({}, schemaProps));
|
|
16423
16721
|
case "oneOf":
|
|
16424
|
-
return /* @__PURE__ */
|
|
16722
|
+
return /* @__PURE__ */ jsx100(OneOfSchema_default, __spreadValues({}, schemaProps));
|
|
16425
16723
|
case "allOf":
|
|
16426
|
-
return /* @__PURE__ */
|
|
16724
|
+
return /* @__PURE__ */ jsx100(AllOfSchema_default, __spreadValues({}, schemaProps));
|
|
16427
16725
|
}
|
|
16428
|
-
return /* @__PURE__ */
|
|
16726
|
+
return /* @__PURE__ */ jsx100(Fragment19, {});
|
|
16429
16727
|
}
|
|
16430
16728
|
var GenericSchema_default = GenericSchemaForm;
|
|
16431
16729
|
var isValidGenericSchema = (schema, model, errors) => {
|
|
@@ -16452,7 +16750,7 @@ var isValidGenericSchema = (schema, model, errors) => {
|
|
|
16452
16750
|
};
|
|
16453
16751
|
|
|
16454
16752
|
// src/legacy/layout/form/DynamicForm.tsx
|
|
16455
|
-
import { jsx as
|
|
16753
|
+
import { jsx as jsx101 } from "react/jsx-runtime";
|
|
16456
16754
|
function DynamicForm({
|
|
16457
16755
|
component,
|
|
16458
16756
|
model = null,
|
|
@@ -16462,7 +16760,7 @@ function DynamicForm({
|
|
|
16462
16760
|
onPersistAsync
|
|
16463
16761
|
}) {
|
|
16464
16762
|
const formSchema = component.schema;
|
|
16465
|
-
return /* @__PURE__ */
|
|
16763
|
+
return /* @__PURE__ */ jsx101("div", { className: getMargin2(component.margin || "md"), children: /* @__PURE__ */ jsx101(
|
|
16466
16764
|
GenericSchema_default,
|
|
16467
16765
|
{
|
|
16468
16766
|
schema: formSchema,
|
|
@@ -16481,61 +16779,61 @@ var DynamicForm_default = DynamicForm;
|
|
|
16481
16779
|
// src/legacy/layout/heading/DynamicHeading.tsx
|
|
16482
16780
|
var import_classnames14 = __toESM(require_classnames());
|
|
16483
16781
|
import { Display as Display2 } from "@transferwise/components";
|
|
16484
|
-
import { jsx as
|
|
16782
|
+
import { jsx as jsx102 } from "react/jsx-runtime";
|
|
16485
16783
|
var DynamicHeading = (props) => {
|
|
16486
16784
|
const { text, size = "md", align = "left", margin = "md", control } = props.component;
|
|
16487
16785
|
const classes = (0, import_classnames14.default)(getTextAlignmentAndMargin2({ align, margin }));
|
|
16488
|
-
return control === "display" ? /* @__PURE__ */
|
|
16786
|
+
return control === "display" ? /* @__PURE__ */ jsx102(DisplayHeading2, { size, text, classes }) : /* @__PURE__ */ jsx102(StandardHeading2, { size, text, classes });
|
|
16489
16787
|
};
|
|
16490
16788
|
var StandardHeading2 = ({ size, text, classes }) => {
|
|
16491
16789
|
switch (size) {
|
|
16492
16790
|
case "xs":
|
|
16493
|
-
return /* @__PURE__ */
|
|
16791
|
+
return /* @__PURE__ */ jsx102("h5", { className: classes, children: text });
|
|
16494
16792
|
case "sm":
|
|
16495
|
-
return /* @__PURE__ */
|
|
16793
|
+
return /* @__PURE__ */ jsx102("h4", { className: classes, children: text });
|
|
16496
16794
|
case "lg":
|
|
16497
|
-
return /* @__PURE__ */
|
|
16795
|
+
return /* @__PURE__ */ jsx102("h2", { className: classes, children: text });
|
|
16498
16796
|
case "xl":
|
|
16499
|
-
return /* @__PURE__ */
|
|
16797
|
+
return /* @__PURE__ */ jsx102("h1", { className: classes, children: text });
|
|
16500
16798
|
case "md":
|
|
16501
16799
|
default:
|
|
16502
|
-
return /* @__PURE__ */
|
|
16800
|
+
return /* @__PURE__ */ jsx102("h3", { className: classes, children: text });
|
|
16503
16801
|
}
|
|
16504
16802
|
};
|
|
16505
16803
|
var DisplayHeading2 = ({ size, text, classes }) => {
|
|
16506
16804
|
switch (size) {
|
|
16507
16805
|
case "xs":
|
|
16508
16806
|
case "sm":
|
|
16509
|
-
return /* @__PURE__ */
|
|
16807
|
+
return /* @__PURE__ */ jsx102(Display2, { type: "display-small", className: classes, children: text });
|
|
16510
16808
|
case "xl":
|
|
16511
16809
|
case "lg":
|
|
16512
|
-
return /* @__PURE__ */
|
|
16810
|
+
return /* @__PURE__ */ jsx102(Display2, { type: "display-large", className: classes, children: text });
|
|
16513
16811
|
case "md":
|
|
16514
16812
|
default:
|
|
16515
|
-
return /* @__PURE__ */
|
|
16813
|
+
return /* @__PURE__ */ jsx102(Display2, { type: "display-medium", className: classes, children: text });
|
|
16516
16814
|
}
|
|
16517
16815
|
};
|
|
16518
16816
|
var DynamicHeading_default = DynamicHeading;
|
|
16519
16817
|
|
|
16520
16818
|
// src/legacy/layout/markdown/DynamicMarkdown.tsx
|
|
16521
16819
|
import { Markdown as Markdown7 } from "@transferwise/components";
|
|
16522
|
-
import { jsx as
|
|
16820
|
+
import { jsx as jsx103 } from "react/jsx-runtime";
|
|
16523
16821
|
var DynamicMarkdown = ({ component }) => {
|
|
16524
16822
|
const { content, align, margin } = component;
|
|
16525
|
-
return /* @__PURE__ */
|
|
16823
|
+
return /* @__PURE__ */ jsx103("div", { className: getTextAlignmentAndMargin2({ align, margin }), children: /* @__PURE__ */ jsx103(Markdown7, { config: { link: { target: "_blank" } }, children: content }) });
|
|
16526
16824
|
};
|
|
16527
16825
|
var DynamicInfo = ({ component }) => {
|
|
16528
|
-
return /* @__PURE__ */
|
|
16826
|
+
return /* @__PURE__ */ jsx103("div", { className: getTextAlignmentAndMargin2(component), children: /* @__PURE__ */ jsx103(Markdown7, { config: { link: { target: "_blank" } }, children: component.markdown }) });
|
|
16529
16827
|
};
|
|
16530
16828
|
|
|
16531
16829
|
// src/legacy/layout/image/DynamicImage.tsx
|
|
16532
16830
|
import { Image as Image2 } from "@transferwise/components";
|
|
16533
|
-
import { useEffect as useEffect16, useState as
|
|
16534
|
-
import { jsx as
|
|
16831
|
+
import { useEffect as useEffect16, useState as useState23 } from "react";
|
|
16832
|
+
import { jsx as jsx104 } from "react/jsx-runtime";
|
|
16535
16833
|
function DynamicImage({ component: image }) {
|
|
16536
16834
|
const { url, size, text, margin, accessibilityDescription } = image;
|
|
16537
16835
|
const httpClient = useHttpClient();
|
|
16538
|
-
const [imageSource, setImageSource] =
|
|
16836
|
+
const [imageSource, setImageSource] = useState23("");
|
|
16539
16837
|
useEffect16(() => {
|
|
16540
16838
|
void getImageSource2(httpClient, url).then(setImageSource);
|
|
16541
16839
|
}, [url, httpClient]);
|
|
@@ -16548,7 +16846,7 @@ function DynamicImage({ component: image }) {
|
|
|
16548
16846
|
if (!imageSource) {
|
|
16549
16847
|
return null;
|
|
16550
16848
|
}
|
|
16551
|
-
return /* @__PURE__ */
|
|
16849
|
+
return /* @__PURE__ */ jsx104("div", { className: `df-image ${size || "md"}`, children: /* @__PURE__ */ jsx104(Image2, __spreadValues({ className: `img-responsive ${getMargin2(margin || "md")}` }, imageProps)) });
|
|
16552
16850
|
}
|
|
16553
16851
|
var readImageBlobAsDataURL2 = (imageBlob) => (
|
|
16554
16852
|
// we can safely assume the type of reader.result is string
|
|
@@ -16585,7 +16883,7 @@ var DynamicImage_default = DynamicImage;
|
|
|
16585
16883
|
|
|
16586
16884
|
// src/legacy/layout/instructions/DynamicInstructions.tsx
|
|
16587
16885
|
import { Header as Header10, InstructionsList as InstructionsList2 } from "@transferwise/components";
|
|
16588
|
-
import { jsx as
|
|
16886
|
+
import { jsx as jsx105, jsxs as jsxs37 } from "react/jsx-runtime";
|
|
16589
16887
|
var doContext2 = ["positive", "neutral"];
|
|
16590
16888
|
var dontContext2 = ["warning", "negative"];
|
|
16591
16889
|
var DynamicInstructions = ({ component }) => {
|
|
@@ -16593,39 +16891,39 @@ var DynamicInstructions = ({ component }) => {
|
|
|
16593
16891
|
const dos = items.filter((item) => doContext2.includes(item.context)).map(({ text }) => text);
|
|
16594
16892
|
const donts = items.filter((item) => dontContext2.includes(item.context)).map(({ text }) => text);
|
|
16595
16893
|
return /* @__PURE__ */ jsxs37("div", { className: getMargin2(component.margin || "md"), children: [
|
|
16596
|
-
component.title ? /* @__PURE__ */
|
|
16597
|
-
/* @__PURE__ */
|
|
16894
|
+
component.title ? /* @__PURE__ */ jsx105(Header10, { title: component.title }) : null,
|
|
16895
|
+
/* @__PURE__ */ jsx105(InstructionsList2, { dos, donts })
|
|
16598
16896
|
] });
|
|
16599
16897
|
};
|
|
16600
16898
|
var DynamicInstructions_default = DynamicInstructions;
|
|
16601
16899
|
|
|
16602
16900
|
// src/legacy/layout/DynamicLayout.tsx
|
|
16603
|
-
import { Fragment as Fragment20, jsx as
|
|
16901
|
+
import { Fragment as Fragment20, jsx as jsx106 } from "react/jsx-runtime";
|
|
16604
16902
|
var getKey = (component) => JSON.stringify(component);
|
|
16605
16903
|
function DynamicLayout(props) {
|
|
16606
16904
|
const { components, model, submitted, errors, onModelChange, onAction, onPersistAsync, baseUrl } = props;
|
|
16607
16905
|
const renderComponent = (component) => {
|
|
16608
16906
|
switch (component.type) {
|
|
16609
16907
|
case "heading":
|
|
16610
|
-
return /* @__PURE__ */
|
|
16908
|
+
return /* @__PURE__ */ jsx106(DynamicHeading_default, { component }, getKey(component));
|
|
16611
16909
|
case "paragraph":
|
|
16612
|
-
return /* @__PURE__ */
|
|
16910
|
+
return /* @__PURE__ */ jsx106(DynamicParagraph_default, { component }, getKey(component));
|
|
16613
16911
|
case "image":
|
|
16614
|
-
return /* @__PURE__ */
|
|
16912
|
+
return /* @__PURE__ */ jsx106(DynamicImage_default, { component }, getKey(component));
|
|
16615
16913
|
case "alert":
|
|
16616
|
-
return /* @__PURE__ */
|
|
16914
|
+
return /* @__PURE__ */ jsx106(DynamicAlert_default, { component }, getKey(component));
|
|
16617
16915
|
case "review":
|
|
16618
|
-
return /* @__PURE__ */
|
|
16916
|
+
return /* @__PURE__ */ jsx106(DynamicReview_default, { component, onAction }, getKey(component));
|
|
16619
16917
|
case "divider":
|
|
16620
|
-
return /* @__PURE__ */
|
|
16918
|
+
return /* @__PURE__ */ jsx106(DynamicDivider_default, { component }, getKey(component));
|
|
16621
16919
|
case "info":
|
|
16622
|
-
return /* @__PURE__ */
|
|
16920
|
+
return /* @__PURE__ */ jsx106(DynamicInfo, { component }, getKey(component));
|
|
16623
16921
|
case "instructions":
|
|
16624
|
-
return /* @__PURE__ */
|
|
16922
|
+
return /* @__PURE__ */ jsx106(DynamicInstructions_default, { component }, getKey(component));
|
|
16625
16923
|
case "markdown":
|
|
16626
|
-
return /* @__PURE__ */
|
|
16924
|
+
return /* @__PURE__ */ jsx106(DynamicMarkdown, { component }, getKey(component));
|
|
16627
16925
|
case "columns":
|
|
16628
|
-
return /* @__PURE__ */
|
|
16926
|
+
return /* @__PURE__ */ jsx106(
|
|
16629
16927
|
DynamicColumns_default,
|
|
16630
16928
|
{
|
|
16631
16929
|
component,
|
|
@@ -16639,7 +16937,7 @@ function DynamicLayout(props) {
|
|
|
16639
16937
|
getKey(component)
|
|
16640
16938
|
);
|
|
16641
16939
|
case "form":
|
|
16642
|
-
return /* @__PURE__ */
|
|
16940
|
+
return /* @__PURE__ */ jsx106(
|
|
16643
16941
|
DynamicForm_default,
|
|
16644
16942
|
{
|
|
16645
16943
|
component,
|
|
@@ -16652,9 +16950,9 @@ function DynamicLayout(props) {
|
|
|
16652
16950
|
getKey(__spreadProps(__spreadValues({}, component), { errors: errors != null ? errors : null }))
|
|
16653
16951
|
);
|
|
16654
16952
|
case "button":
|
|
16655
|
-
return /* @__PURE__ */
|
|
16953
|
+
return /* @__PURE__ */ jsx106(DynamicButton_default, { component, onAction }, getKey(component));
|
|
16656
16954
|
case "box":
|
|
16657
|
-
return /* @__PURE__ */
|
|
16955
|
+
return /* @__PURE__ */ jsx106(
|
|
16658
16956
|
DynamicBox_default,
|
|
16659
16957
|
{
|
|
16660
16958
|
component,
|
|
@@ -16668,18 +16966,18 @@ function DynamicLayout(props) {
|
|
|
16668
16966
|
getKey(component)
|
|
16669
16967
|
);
|
|
16670
16968
|
case "decision":
|
|
16671
|
-
return /* @__PURE__ */
|
|
16969
|
+
return /* @__PURE__ */ jsx106(DynamicDecision_default, { component, onAction }, getKey(component));
|
|
16672
16970
|
case "external":
|
|
16673
|
-
return /* @__PURE__ */
|
|
16971
|
+
return /* @__PURE__ */ jsx106(DynamicExternal_default, { component, onAction }, getKey(component));
|
|
16674
16972
|
case "list":
|
|
16675
16973
|
case "status-list":
|
|
16676
|
-
return /* @__PURE__ */
|
|
16974
|
+
return /* @__PURE__ */ jsx106(DynamicStatusList_default, { component, onAction }, getKey(component));
|
|
16677
16975
|
case "loading-indicator":
|
|
16678
|
-
return /* @__PURE__ */
|
|
16976
|
+
return /* @__PURE__ */ jsx106(DynamicLoadingIndicator_default, { component }, getKey(component));
|
|
16679
16977
|
case "search":
|
|
16680
|
-
return /* @__PURE__ */
|
|
16978
|
+
return /* @__PURE__ */ jsx106(DynamicSearch_default, { component, onAction }, getKey(component));
|
|
16681
16979
|
case "modal":
|
|
16682
|
-
return /* @__PURE__ */
|
|
16980
|
+
return /* @__PURE__ */ jsx106(
|
|
16683
16981
|
DynamicModal_default,
|
|
16684
16982
|
{
|
|
16685
16983
|
component,
|
|
@@ -16693,22 +16991,22 @@ function DynamicLayout(props) {
|
|
|
16693
16991
|
getKey(component)
|
|
16694
16992
|
);
|
|
16695
16993
|
default:
|
|
16696
|
-
return /* @__PURE__ */
|
|
16994
|
+
return /* @__PURE__ */ jsx106("div", {}, getKey(component));
|
|
16697
16995
|
}
|
|
16698
16996
|
};
|
|
16699
16997
|
if (useHasHttpClientProvider() || baseUrl == null) {
|
|
16700
|
-
return /* @__PURE__ */
|
|
16998
|
+
return /* @__PURE__ */ jsx106(Fragment20, { children: components.map(renderComponent) });
|
|
16701
16999
|
}
|
|
16702
|
-
return /* @__PURE__ */
|
|
17000
|
+
return /* @__PURE__ */ jsx106(HttpClientProviderFromBaseUrl, { baseUrl, children: components.map(renderComponent) });
|
|
16703
17001
|
}
|
|
16704
17002
|
var DynamicLayout_default = DynamicLayout;
|
|
16705
17003
|
|
|
16706
17004
|
// src/legacy/layout/list/DynamicStatusList.tsx
|
|
16707
17005
|
import { Header as Header11, Summary as Summary2 } from "@transferwise/components";
|
|
16708
|
-
import { jsx as
|
|
17006
|
+
import { jsx as jsx107, jsxs as jsxs38 } from "react/jsx-runtime";
|
|
16709
17007
|
var DynamicStatusList = ({ component }) => {
|
|
16710
17008
|
return /* @__PURE__ */ jsxs38("div", { className: getMargin2(component.margin || "md"), children: [
|
|
16711
|
-
component.title ? /* @__PURE__ */
|
|
17009
|
+
component.title ? /* @__PURE__ */ jsx107(Header11, { title: component.title }) : null,
|
|
16712
17010
|
component.items.map(mapListItemToSummary)
|
|
16713
17011
|
] });
|
|
16714
17012
|
};
|
|
@@ -16717,8 +17015,8 @@ var mapListItemToSummary = ({ title, description, icon, status }) => {
|
|
|
16717
17015
|
key: `${title}/${description || ""}`,
|
|
16718
17016
|
title,
|
|
16719
17017
|
description
|
|
16720
|
-
}, (icon == null ? void 0 : icon.name) ? { icon: /* @__PURE__ */
|
|
16721
|
-
return /* @__PURE__ */
|
|
17018
|
+
}, (icon == null ? void 0 : icon.name) ? { icon: /* @__PURE__ */ jsx107(DynamicIcon_default2, { type: icon.name }) } : {}), status ? { status: statusMap[status] } : {});
|
|
17019
|
+
return /* @__PURE__ */ jsx107(Summary2, __spreadValues({}, props));
|
|
16722
17020
|
};
|
|
16723
17021
|
var statusListMap = {
|
|
16724
17022
|
done: "done",
|
|
@@ -16735,10 +17033,10 @@ var DynamicStatusList_default = DynamicStatusList;
|
|
|
16735
17033
|
|
|
16736
17034
|
// src/legacy/layout/loadingIndicator/DynamicLoadingIndicator.tsx
|
|
16737
17035
|
import { Loader as Loader3 } from "@transferwise/components";
|
|
16738
|
-
import { jsx as
|
|
17036
|
+
import { jsx as jsx108 } from "react/jsx-runtime";
|
|
16739
17037
|
var DynamicLoadingIndicator = ({ component }) => {
|
|
16740
17038
|
const { margin = "md", size = "md" } = component;
|
|
16741
|
-
return /* @__PURE__ */
|
|
17039
|
+
return /* @__PURE__ */ jsx108(
|
|
16742
17040
|
Loader3,
|
|
16743
17041
|
{
|
|
16744
17042
|
size,
|
|
@@ -16753,7 +17051,7 @@ var DynamicLoadingIndicator_default = DynamicLoadingIndicator;
|
|
|
16753
17051
|
|
|
16754
17052
|
// src/legacy/layout/paragraph/DynamicParagraph.tsx
|
|
16755
17053
|
import { Button as Button8 } from "@transferwise/components";
|
|
16756
|
-
import { useIntl as
|
|
17054
|
+
import { useIntl as useIntl17 } from "react-intl";
|
|
16757
17055
|
|
|
16758
17056
|
// src/legacy/layout/paragraph/useSnackBarIfAvailable.ts
|
|
16759
17057
|
import { SnackbarContext as SnackbarContext2 } from "@transferwise/components";
|
|
@@ -16766,9 +17064,9 @@ function noop3() {
|
|
|
16766
17064
|
}
|
|
16767
17065
|
|
|
16768
17066
|
// src/legacy/layout/paragraph/DynamicParagraph.tsx
|
|
16769
|
-
import { jsx as
|
|
17067
|
+
import { jsx as jsx109, jsxs as jsxs39 } from "react/jsx-runtime";
|
|
16770
17068
|
function DynamicParagraph({ component }) {
|
|
16771
|
-
return component.control === "copyable" ? /* @__PURE__ */
|
|
17069
|
+
return component.control === "copyable" ? /* @__PURE__ */ jsx109(CopyableDynamicParagraph, { component }) : /* @__PURE__ */ jsx109(BasicDynamicParagraph, { component });
|
|
16772
17070
|
}
|
|
16773
17071
|
function BasicDynamicParagraph({ component }) {
|
|
16774
17072
|
return /* @__PURE__ */ jsxs39("p", { className: getTextAlignmentAndMargin2(component), children: [
|
|
@@ -16778,7 +17076,7 @@ function BasicDynamicParagraph({ component }) {
|
|
|
16778
17076
|
] });
|
|
16779
17077
|
}
|
|
16780
17078
|
function CopyableDynamicParagraph({ component }) {
|
|
16781
|
-
const { formatMessage } =
|
|
17079
|
+
const { formatMessage } = useIntl17();
|
|
16782
17080
|
const createSnackbar = useSnackBarIfAvailable2();
|
|
16783
17081
|
const { text } = component;
|
|
16784
17082
|
const copy = () => {
|
|
@@ -16790,7 +17088,7 @@ function CopyableDynamicParagraph({ component }) {
|
|
|
16790
17088
|
margin: "sm"
|
|
16791
17089
|
})} form-control`;
|
|
16792
17090
|
return /* @__PURE__ */ jsxs39("div", { className: getTextAlignmentAndMargin2(component), children: [
|
|
16793
|
-
/* @__PURE__ */
|
|
17091
|
+
/* @__PURE__ */ jsx109(
|
|
16794
17092
|
"input",
|
|
16795
17093
|
{
|
|
16796
17094
|
type: "text",
|
|
@@ -16800,7 +17098,7 @@ function CopyableDynamicParagraph({ component }) {
|
|
|
16800
17098
|
style: { textOverflow: "ellipsis" }
|
|
16801
17099
|
}
|
|
16802
17100
|
),
|
|
16803
|
-
/* @__PURE__ */
|
|
17101
|
+
/* @__PURE__ */ jsx109(Button8, { block: true, onClick: copy, children: formatMessage(paragraph_messages_default.copy) })
|
|
16804
17102
|
] });
|
|
16805
17103
|
}
|
|
16806
17104
|
function noop4() {
|
|
@@ -16809,7 +17107,7 @@ var DynamicParagraph_default = DynamicParagraph;
|
|
|
16809
17107
|
|
|
16810
17108
|
// src/legacy/layout/review/DynamicReview.tsx
|
|
16811
17109
|
import { DefinitionList as DefinitionList3, Header as Header12 } from "@transferwise/components";
|
|
16812
|
-
import { Fragment as Fragment21, jsx as
|
|
17110
|
+
import { Fragment as Fragment21, jsx as jsx110, jsxs as jsxs40 } from "react/jsx-runtime";
|
|
16813
17111
|
var getDefinitions = (orientation, review) => review.fields.map(({ label, value, help }, index) => ({
|
|
16814
17112
|
key: String(index),
|
|
16815
17113
|
title: label,
|
|
@@ -16818,13 +17116,13 @@ var getDefinitions = (orientation, review) => review.fields.map(({ label, value,
|
|
|
16818
17116
|
var getFieldValue2 = (value, help, orientation) => {
|
|
16819
17117
|
if (help) {
|
|
16820
17118
|
return orientation === "HORIZONTAL_RIGHT_ALIGNED" ? /* @__PURE__ */ jsxs40(Fragment21, { children: [
|
|
16821
|
-
/* @__PURE__ */
|
|
17119
|
+
/* @__PURE__ */ jsx110(Help_default2, { help }),
|
|
16822
17120
|
" ",
|
|
16823
17121
|
value
|
|
16824
17122
|
] }) : /* @__PURE__ */ jsxs40(Fragment21, { children: [
|
|
16825
17123
|
value,
|
|
16826
17124
|
" ",
|
|
16827
|
-
/* @__PURE__ */
|
|
17125
|
+
/* @__PURE__ */ jsx110(Help_default2, { help })
|
|
16828
17126
|
] });
|
|
16829
17127
|
}
|
|
16830
17128
|
return value;
|
|
@@ -16850,23 +17148,23 @@ function DynamicReview(props) {
|
|
|
16850
17148
|
const callToAction = review.callToAction ? getReviewAction2(review.callToAction.title, review.callToAction.action) : null;
|
|
16851
17149
|
const legacyCallToAction = !callToAction && review.action ? getReviewAction2(review.action.title || "", review.action) : null;
|
|
16852
17150
|
return /* @__PURE__ */ jsxs40("div", { className: margin, children: [
|
|
16853
|
-
review.title && /* @__PURE__ */
|
|
16854
|
-
/* @__PURE__ */
|
|
17151
|
+
review.title && /* @__PURE__ */ jsx110(Header12, { title: review.title, action: callToAction || legacyCallToAction || void 0 }),
|
|
17152
|
+
/* @__PURE__ */ jsx110("div", { className: margin, children: /* @__PURE__ */ jsx110(DefinitionList3, { layout: orientation, definitions: getDefinitions(orientation, review) }) })
|
|
16855
17153
|
] });
|
|
16856
17154
|
}
|
|
16857
17155
|
var DynamicReview_default = DynamicReview;
|
|
16858
17156
|
|
|
16859
17157
|
// src/legacy/layout/search/DynamicSearch.tsx
|
|
16860
|
-
import { useMemo as useMemo16, useState as
|
|
17158
|
+
import { useMemo as useMemo16, useState as useState25 } from "react";
|
|
16861
17159
|
import { Search as Search2 } from "@transferwise/icons";
|
|
16862
17160
|
|
|
16863
17161
|
// src/legacy/layout/search/SearchInput.tsx
|
|
16864
17162
|
import { Input as Input7 } from "@transferwise/components";
|
|
16865
|
-
import { jsx as
|
|
17163
|
+
import { jsx as jsx111, jsxs as jsxs41 } from "react/jsx-runtime";
|
|
16866
17164
|
var SearchInput = ({ title, value, onFocus, onChange }) => {
|
|
16867
17165
|
return /* @__PURE__ */ jsxs41("label", { className: "control-label d-inline", children: [
|
|
16868
17166
|
title,
|
|
16869
|
-
/* @__PURE__ */
|
|
17167
|
+
/* @__PURE__ */ jsx111(
|
|
16870
17168
|
Input7,
|
|
16871
17169
|
{
|
|
16872
17170
|
type: "text",
|
|
@@ -16881,13 +17179,13 @@ var SearchInput = ({ title, value, onFocus, onChange }) => {
|
|
|
16881
17179
|
|
|
16882
17180
|
// src/legacy/layout/search/SearchResults.tsx
|
|
16883
17181
|
import { NavigationOption as NavigationOption7, NavigationOptionsList as NavigationOptionsList4 } from "@transferwise/components";
|
|
16884
|
-
import { useIntl as
|
|
16885
|
-
import { jsx as
|
|
17182
|
+
import { useIntl as useIntl18 } from "react-intl";
|
|
17183
|
+
import { jsx as jsx112, jsxs as jsxs42 } from "react/jsx-runtime";
|
|
16886
17184
|
function SearchResults2({ results, emptyMessage, onSelect }) {
|
|
16887
17185
|
if (results.length === 0) {
|
|
16888
|
-
return /* @__PURE__ */
|
|
17186
|
+
return /* @__PURE__ */ jsx112("p", { className: "m-t-2", children: emptyMessage });
|
|
16889
17187
|
}
|
|
16890
|
-
return /* @__PURE__ */
|
|
17188
|
+
return /* @__PURE__ */ jsx112(NavigationOptionsList4, { children: results.map((result) => /* @__PURE__ */ jsx112(
|
|
16891
17189
|
NavigationOption7,
|
|
16892
17190
|
{
|
|
16893
17191
|
title: result.title,
|
|
@@ -16901,11 +17199,11 @@ function SearchResults2({ results, emptyMessage, onSelect }) {
|
|
|
16901
17199
|
)) });
|
|
16902
17200
|
}
|
|
16903
17201
|
function ErrorResult2({ onRetrySearch }) {
|
|
16904
|
-
const intl =
|
|
17202
|
+
const intl = useIntl18();
|
|
16905
17203
|
return /* @__PURE__ */ jsxs42("p", { className: "m-t-2", children: [
|
|
16906
17204
|
intl.formatMessage(generic_error_messages_default.genericError),
|
|
16907
17205
|
"\xA0",
|
|
16908
|
-
/* @__PURE__ */
|
|
17206
|
+
/* @__PURE__ */ jsx112(
|
|
16909
17207
|
"a",
|
|
16910
17208
|
{
|
|
16911
17209
|
href: "/",
|
|
@@ -16920,10 +17218,10 @@ function ErrorResult2({ onRetrySearch }) {
|
|
|
16920
17218
|
}
|
|
16921
17219
|
|
|
16922
17220
|
// src/legacy/layout/search/useSearch.tsx
|
|
16923
|
-
import { useCallback as useCallback7, useRef as useRef4, useState as
|
|
17221
|
+
import { useCallback as useCallback7, useRef as useRef4, useState as useState24 } from "react";
|
|
16924
17222
|
var headers = { "Content-Type": "application/json" };
|
|
16925
17223
|
var useSearch = (defaultSearchConfig) => {
|
|
16926
|
-
const [state, setState] =
|
|
17224
|
+
const [state, setState] = useState24({
|
|
16927
17225
|
status: "idle"
|
|
16928
17226
|
});
|
|
16929
17227
|
const abortControllerRef = useRef4(null);
|
|
@@ -16991,10 +17289,10 @@ var addQueryParameter2 = (url, key, value) => {
|
|
|
16991
17289
|
// src/legacy/layout/search/DynamicSearch.tsx
|
|
16992
17290
|
var import_classnames15 = __toESM(require_classnames());
|
|
16993
17291
|
import { Markdown as Markdown8, Typeahead as Typeahead2 } from "@transferwise/components";
|
|
16994
|
-
import { jsx as
|
|
17292
|
+
import { jsx as jsx113, jsxs as jsxs43 } from "react/jsx-runtime";
|
|
16995
17293
|
var DEBOUNCE_TIME2 = 400;
|
|
16996
17294
|
function DynamicSearch({ component, onAction }) {
|
|
16997
|
-
const [query, setQuery] =
|
|
17295
|
+
const [query, setQuery] = useState25("");
|
|
16998
17296
|
const { control, title, margin, url, method, param, emptyMessage } = component;
|
|
16999
17297
|
const { status, results, search } = useSearch({ url, method, param });
|
|
17000
17298
|
const onEvent = useEventDispatcher();
|
|
@@ -17027,16 +17325,16 @@ function DynamicSearch({ component, onAction }) {
|
|
|
17027
17325
|
void search(query);
|
|
17028
17326
|
};
|
|
17029
17327
|
if (control === "inline") {
|
|
17030
|
-
return /* @__PURE__ */
|
|
17328
|
+
return /* @__PURE__ */ jsx113("div", { className: (0, import_classnames15.default)(getMargin2(margin != null ? margin : "md"), "df-search-typeahead"), children: /* @__PURE__ */ jsxs43("label", { className: "control-label d-inline", children: [
|
|
17031
17329
|
title,
|
|
17032
|
-
/* @__PURE__ */
|
|
17330
|
+
/* @__PURE__ */ jsx113("div", { className: "m-t-1", children: /* @__PURE__ */ jsx113(
|
|
17033
17331
|
Typeahead2,
|
|
17034
17332
|
{
|
|
17035
17333
|
id: "typeahead-input-id",
|
|
17036
17334
|
name: "typeahead-input-name",
|
|
17037
17335
|
size: "md",
|
|
17038
17336
|
maxHeight: 100,
|
|
17039
|
-
footer: /* @__PURE__ */
|
|
17337
|
+
footer: /* @__PURE__ */ jsx113(
|
|
17040
17338
|
TypeaheadFooter2,
|
|
17041
17339
|
{
|
|
17042
17340
|
state: status,
|
|
@@ -17047,7 +17345,7 @@ function DynamicSearch({ component, onAction }) {
|
|
|
17047
17345
|
),
|
|
17048
17346
|
multiple: false,
|
|
17049
17347
|
clearable: false,
|
|
17050
|
-
addon: /* @__PURE__ */
|
|
17348
|
+
addon: /* @__PURE__ */ jsx113(Search2, { size: 24 }),
|
|
17051
17349
|
options: results.map(mapResultToTypeaheadOption2),
|
|
17052
17350
|
onChange: (values) => {
|
|
17053
17351
|
if (values.length > 0) {
|
|
@@ -17063,10 +17361,10 @@ function DynamicSearch({ component, onAction }) {
|
|
|
17063
17361
|
] }) });
|
|
17064
17362
|
}
|
|
17065
17363
|
return /* @__PURE__ */ jsxs43("div", { className: getMargin2(margin != null ? margin : "md"), children: [
|
|
17066
|
-
/* @__PURE__ */
|
|
17067
|
-
status === "loading" && /* @__PURE__ */
|
|
17068
|
-
status === "error" && /* @__PURE__ */
|
|
17069
|
-
status === "success" && /* @__PURE__ */
|
|
17364
|
+
/* @__PURE__ */ jsx113(SearchInput, { title, value: query, onChange, onFocus: onSearchStart }),
|
|
17365
|
+
status === "loading" && /* @__PURE__ */ jsx113(DynamicLoadingIndicator_default, { component: { type: "loading-indicator", size: "sm" } }),
|
|
17366
|
+
status === "error" && /* @__PURE__ */ jsx113(ErrorResult2, { onRetrySearch }),
|
|
17367
|
+
status === "success" && /* @__PURE__ */ jsx113(SearchResults2, { results, emptyMessage, onSelect: onResultSelected })
|
|
17070
17368
|
] });
|
|
17071
17369
|
}
|
|
17072
17370
|
function mapResultToTypeaheadOption2(result) {
|
|
@@ -17085,13 +17383,13 @@ function TypeaheadFooter2({
|
|
|
17085
17383
|
emptyMessage
|
|
17086
17384
|
}) {
|
|
17087
17385
|
if (state === "success" && results.length === 0) {
|
|
17088
|
-
return /* @__PURE__ */
|
|
17386
|
+
return /* @__PURE__ */ jsx113(Markdown8, { className: "m-t-2 m-x-2", config: { link: { target: "_blank" } }, children: emptyMessage });
|
|
17089
17387
|
}
|
|
17090
17388
|
if (state === "error" && results.length === 0) {
|
|
17091
|
-
return /* @__PURE__ */
|
|
17389
|
+
return /* @__PURE__ */ jsx113("div", { className: "m-t-2 m-x-2", children: /* @__PURE__ */ jsx113(ErrorResult2, { onRetrySearch }) });
|
|
17092
17390
|
}
|
|
17093
17391
|
if (state === "loading" || results.length === 0) {
|
|
17094
|
-
return /* @__PURE__ */
|
|
17392
|
+
return /* @__PURE__ */ jsx113("p", { className: "m-t-2 m-x-2", children: "Loading..." });
|
|
17095
17393
|
}
|
|
17096
17394
|
return null;
|
|
17097
17395
|
}
|
|
@@ -17099,21 +17397,21 @@ var DynamicSearch_default = DynamicSearch;
|
|
|
17099
17397
|
|
|
17100
17398
|
// src/legacy/layout/modal/DynamicModal.tsx
|
|
17101
17399
|
import { Button as Button9, Modal as Modal4 } from "@transferwise/components";
|
|
17102
|
-
import { useState as
|
|
17103
|
-
import { jsx as
|
|
17400
|
+
import { useState as useState26 } from "react";
|
|
17401
|
+
import { jsx as jsx114, jsxs as jsxs44 } from "react/jsx-runtime";
|
|
17104
17402
|
function DynamicModal(props) {
|
|
17105
|
-
const [visible, isVisible] =
|
|
17403
|
+
const [visible, isVisible] = useState26(false);
|
|
17106
17404
|
const { component, onAction } = props;
|
|
17107
17405
|
const { margin = "md" } = component;
|
|
17108
17406
|
return /* @__PURE__ */ jsxs44("div", { className: getTextAlignmentAndMargin2({ margin }), children: [
|
|
17109
|
-
/* @__PURE__ */
|
|
17110
|
-
/* @__PURE__ */
|
|
17407
|
+
/* @__PURE__ */ jsx114(Button9, { priority: "tertiary", block: true, onClick: () => isVisible(true), children: component.trigger.title }),
|
|
17408
|
+
/* @__PURE__ */ jsx114(
|
|
17111
17409
|
Modal4,
|
|
17112
17410
|
{
|
|
17113
17411
|
scroll: "content",
|
|
17114
17412
|
open: visible,
|
|
17115
17413
|
size: "lg",
|
|
17116
|
-
body: /* @__PURE__ */
|
|
17414
|
+
body: /* @__PURE__ */ jsx114(
|
|
17117
17415
|
DynamicLayout_default,
|
|
17118
17416
|
__spreadProps(__spreadValues({}, props), {
|
|
17119
17417
|
components: component.content.components,
|
|
@@ -17131,7 +17429,7 @@ function DynamicModal(props) {
|
|
|
17131
17429
|
var DynamicModal_default = DynamicModal;
|
|
17132
17430
|
|
|
17133
17431
|
// src/legacy/jsonSchemaForm/basicTypeSchema/BasicTypeSchema.tsx
|
|
17134
|
-
import { Fragment as Fragment22, jsx as
|
|
17432
|
+
import { Fragment as Fragment22, jsx as jsx115, jsxs as jsxs45 } from "react/jsx-runtime";
|
|
17135
17433
|
var isNullish3 = (value) => isNull3(value) || isUndefined3(value);
|
|
17136
17434
|
var getDefaultValue = (schema) => {
|
|
17137
17435
|
return schema.type === "boolean" && isNullish3(schema.default) ? false : schema.default;
|
|
@@ -17169,12 +17467,12 @@ var BasicTypeSchema = (props) => {
|
|
|
17169
17467
|
props.onBlur();
|
|
17170
17468
|
}
|
|
17171
17469
|
};
|
|
17172
|
-
const [model, setModel] =
|
|
17173
|
-
const [lastModel, setLastModel] =
|
|
17174
|
-
const [changed, setChanged] =
|
|
17175
|
-
const [focused, setFocused] =
|
|
17176
|
-
const [blurred, setBlurred] =
|
|
17177
|
-
const [validations, setValidations] =
|
|
17470
|
+
const [model, setModel] = useState27((_a = props.model) != null ? _a : null);
|
|
17471
|
+
const [lastModel, setLastModel] = useState27((_b = props.model) != null ? _b : null);
|
|
17472
|
+
const [changed, setChanged] = useState27(false);
|
|
17473
|
+
const [focused, setFocused] = useState27(false);
|
|
17474
|
+
const [blurred, setBlurred] = useState27(false);
|
|
17475
|
+
const [validations, setValidations] = useState27([]);
|
|
17178
17476
|
const id = useMemo17(() => props.schema.$id || generateRandomId(), [props.schema.$id]);
|
|
17179
17477
|
const onSchemaChange = () => {
|
|
17180
17478
|
const defaultValue = getDefaultValue(props.schema);
|
|
@@ -17208,14 +17506,14 @@ var BasicTypeSchema = (props) => {
|
|
|
17208
17506
|
const schemaHelp = props.schema.help;
|
|
17209
17507
|
const feedbackId = `${id}-feedback`;
|
|
17210
17508
|
return !isHidden ? /* @__PURE__ */ jsxs45(Fragment22, { children: [
|
|
17211
|
-
props.schema.alert && /* @__PURE__ */
|
|
17509
|
+
props.schema.alert && /* @__PURE__ */ jsx115(DynamicAlert_default, { component: props.schema.alert }),
|
|
17212
17510
|
/* @__PURE__ */ jsxs45("div", { className: (0, import_classnames16.default)(formGroupClasses), children: [
|
|
17213
17511
|
showLabel && /* @__PURE__ */ jsxs45("div", { className: "d-inline-block m-b-1", children: [
|
|
17214
|
-
/* @__PURE__ */
|
|
17215
|
-
!!schemaHelp && /* @__PURE__ */
|
|
17512
|
+
/* @__PURE__ */ jsx115("label", { className: "control-label d-inline", htmlFor: id, children: props.schema.title }),
|
|
17513
|
+
!!schemaHelp && /* @__PURE__ */ jsx115(Help_default2, { help: schemaHelp })
|
|
17216
17514
|
] }),
|
|
17217
|
-
!showLabel && !!schemaHelp && /* @__PURE__ */
|
|
17218
|
-
/* @__PURE__ */
|
|
17515
|
+
!showLabel && !!schemaHelp && /* @__PURE__ */ jsx115(Help_default2, { help: schemaHelp }),
|
|
17516
|
+
/* @__PURE__ */ jsx115(
|
|
17219
17517
|
SchemaFormControl_default,
|
|
17220
17518
|
{
|
|
17221
17519
|
id,
|
|
@@ -17228,7 +17526,7 @@ var BasicTypeSchema = (props) => {
|
|
|
17228
17526
|
describedBy: feedbackId
|
|
17229
17527
|
}
|
|
17230
17528
|
),
|
|
17231
|
-
/* @__PURE__ */
|
|
17529
|
+
/* @__PURE__ */ jsx115(
|
|
17232
17530
|
ControlFeedback_default,
|
|
17233
17531
|
{
|
|
17234
17532
|
id: feedbackId,
|
|
@@ -17253,7 +17551,7 @@ BasicTypeSchema.defaultProps = {
|
|
|
17253
17551
|
var BasicTypeSchema_default = BasicTypeSchema;
|
|
17254
17552
|
|
|
17255
17553
|
// src/legacy/jsonSchemaForm/persistAsyncSchema/persistAsyncBasicSchema/PersistAsyncBasicSchema.tsx
|
|
17256
|
-
import { jsx as
|
|
17554
|
+
import { jsx as jsx116 } from "react/jsx-runtime";
|
|
17257
17555
|
var getIdFromResponse = (idProperty, response) => response[idProperty];
|
|
17258
17556
|
var getErrorFromResponse = (errorProperty, response) => {
|
|
17259
17557
|
var _a;
|
|
@@ -17268,14 +17566,14 @@ var controlTypesWithPersistOnChange = /* @__PURE__ */ new Set([
|
|
|
17268
17566
|
]);
|
|
17269
17567
|
function PersistAsyncBasicSchema(props) {
|
|
17270
17568
|
const { schema, required, submitted, errors, onChange, onPersistAsync } = props;
|
|
17271
|
-
const intl =
|
|
17569
|
+
const intl = useIntl19();
|
|
17272
17570
|
const httpClient = useHttpClient();
|
|
17273
17571
|
const onEvent = useEventDispatcher();
|
|
17274
|
-
const [persistAsyncModel, setPersistAsyncModel] =
|
|
17572
|
+
const [persistAsyncModel, setPersistAsyncModel] = useState28(null);
|
|
17275
17573
|
const previousPersistAsyncModel = usePrevious(persistAsyncModel);
|
|
17276
|
-
const [persistAsyncError, setPersistAsyncError] =
|
|
17277
|
-
const [fieldSubmitted, setFieldSubmitted] =
|
|
17278
|
-
const [abortController, setAbortController] =
|
|
17574
|
+
const [persistAsyncError, setPersistAsyncError] = useState28(null);
|
|
17575
|
+
const [fieldSubmitted, setFieldSubmitted] = useState28(false);
|
|
17576
|
+
const [abortController, setAbortController] = useState28(null);
|
|
17279
17577
|
useEffect18(() => {
|
|
17280
17578
|
if (controlTypesWithPersistOnChange.has(
|
|
17281
17579
|
// TODO: LOW avoid type assertion below -- control type may be nullish. consider ?? ''
|
|
@@ -17343,7 +17641,7 @@ function PersistAsyncBasicSchema(props) {
|
|
|
17343
17641
|
setPersistAsyncModel(newPersistAsyncModel);
|
|
17344
17642
|
}
|
|
17345
17643
|
};
|
|
17346
|
-
return /* @__PURE__ */
|
|
17644
|
+
return /* @__PURE__ */ jsx116(
|
|
17347
17645
|
BasicTypeSchema_default,
|
|
17348
17646
|
{
|
|
17349
17647
|
required,
|
|
@@ -17364,9 +17662,9 @@ var PersistAsyncBasicSchema_default = PersistAsyncBasicSchema;
|
|
|
17364
17662
|
|
|
17365
17663
|
// src/legacy/common/hooks/usePersistAsync/usePersistAsync.ts
|
|
17366
17664
|
var usePersistAsync = (persistAsync) => {
|
|
17367
|
-
const [abortController, setAbortController] =
|
|
17665
|
+
const [abortController, setAbortController] = useState29(null);
|
|
17368
17666
|
const httpClient = useHttpClient();
|
|
17369
|
-
const intl =
|
|
17667
|
+
const intl = useIntl20();
|
|
17370
17668
|
const { schema } = persistAsync;
|
|
17371
17669
|
async function handlePersistAsync(model) {
|
|
17372
17670
|
const isInvalidSchema = model instanceof Blob ? !isBlobSchema2(schema) : !isValidSchema(model, schema);
|
|
@@ -17554,7 +17852,7 @@ function useStepPolling(polling, onAction) {
|
|
|
17554
17852
|
}
|
|
17555
17853
|
|
|
17556
17854
|
// src/legacy/step/layoutStep/LayoutStep.tsx
|
|
17557
|
-
import { jsx as
|
|
17855
|
+
import { jsx as jsx117 } from "react/jsx-runtime";
|
|
17558
17856
|
var getComponents = (step, options) => {
|
|
17559
17857
|
var _a;
|
|
17560
17858
|
if (isEmpty(step)) {
|
|
@@ -17577,7 +17875,7 @@ var LayoutStep = (props) => {
|
|
|
17577
17875
|
onEvent("Dynamic Flow - onAction supressed", { reason: "LayoutStep - loading state" });
|
|
17578
17876
|
};
|
|
17579
17877
|
useStepPolling(stepSpecification.polling, onAction);
|
|
17580
|
-
return /* @__PURE__ */
|
|
17878
|
+
return /* @__PURE__ */ jsx117(
|
|
17581
17879
|
DynamicLayout_default,
|
|
17582
17880
|
{
|
|
17583
17881
|
components,
|
|
@@ -17593,11 +17891,11 @@ var LayoutStep = (props) => {
|
|
|
17593
17891
|
var LayoutStep_default = LayoutStep;
|
|
17594
17892
|
|
|
17595
17893
|
// src/legacy/step/cameraStep/CameraStep.tsx
|
|
17596
|
-
import { useEffect as useEffect25, useState as
|
|
17894
|
+
import { useEffect as useEffect25, useState as useState32 } from "react";
|
|
17597
17895
|
|
|
17598
17896
|
// src/legacy/step/cameraStep/cameraCapture/CameraCapture.tsx
|
|
17599
|
-
import { useCallback as useCallback10, useEffect as useEffect24, useMemo as useMemo20, useRef as useRef8, useState as
|
|
17600
|
-
import { useIntl as
|
|
17897
|
+
import { useCallback as useCallback10, useEffect as useEffect24, useMemo as useMemo20, useRef as useRef8, useState as useState31 } from "react";
|
|
17898
|
+
import { useIntl as useIntl23 } from "react-intl";
|
|
17601
17899
|
import Webcam from "react-webcam";
|
|
17602
17900
|
|
|
17603
17901
|
// src/legacy/step/cameraStep/cameraCapture/CameraCapture.messages.ts
|
|
@@ -17662,16 +17960,16 @@ var CameraCapture_messages_default = defineMessages13({
|
|
|
17662
17960
|
|
|
17663
17961
|
// src/legacy/step/cameraStep/cameraCapture/components/bottomBar/BottomBar.tsx
|
|
17664
17962
|
import { Button as Button10, ControlType, Priority, Size as Size3 } from "@transferwise/components";
|
|
17665
|
-
import { useIntl as
|
|
17666
|
-
import { jsx as
|
|
17667
|
-
var CaptureBottomBar = ({ onCapture }) => /* @__PURE__ */
|
|
17963
|
+
import { useIntl as useIntl21 } from "react-intl";
|
|
17964
|
+
import { jsx as jsx118, jsxs as jsxs46 } from "react/jsx-runtime";
|
|
17965
|
+
var CaptureBottomBar = ({ onCapture }) => /* @__PURE__ */ jsx118("div", { className: "bottom-bar", children: /* @__PURE__ */ jsx118(CaptureButton, { onClick: onCapture }) });
|
|
17668
17966
|
var ReviewBottomBar = ({
|
|
17669
17967
|
onSubmit,
|
|
17670
17968
|
onRetry
|
|
17671
17969
|
}) => {
|
|
17672
|
-
const intl =
|
|
17673
|
-
return /* @__PURE__ */
|
|
17674
|
-
/* @__PURE__ */
|
|
17970
|
+
const intl = useIntl21();
|
|
17971
|
+
return /* @__PURE__ */ jsx118("div", { className: "bottom-bar p-x-2", children: /* @__PURE__ */ jsx118("div", { className: "row", children: /* @__PURE__ */ jsxs46("div", { className: "col-xs-12 col-md-6 col-md-offset-3", children: [
|
|
17972
|
+
/* @__PURE__ */ jsx118(
|
|
17675
17973
|
Button10,
|
|
17676
17974
|
{
|
|
17677
17975
|
className: "m-b-1",
|
|
@@ -17682,7 +17980,7 @@ var ReviewBottomBar = ({
|
|
|
17682
17980
|
children: intl.formatMessage(CameraCapture_messages_default.reviewSubmit)
|
|
17683
17981
|
}
|
|
17684
17982
|
),
|
|
17685
|
-
/* @__PURE__ */
|
|
17983
|
+
/* @__PURE__ */ jsx118(
|
|
17686
17984
|
Button10,
|
|
17687
17985
|
{
|
|
17688
17986
|
className: "m-b-2",
|
|
@@ -17696,19 +17994,19 @@ var ReviewBottomBar = ({
|
|
|
17696
17994
|
)
|
|
17697
17995
|
] }) }) });
|
|
17698
17996
|
};
|
|
17699
|
-
var CaptureButton = ({ onClick }) => /* @__PURE__ */
|
|
17997
|
+
var CaptureButton = ({ onClick }) => /* @__PURE__ */ jsx118(
|
|
17700
17998
|
"button",
|
|
17701
17999
|
{
|
|
17702
18000
|
type: "button",
|
|
17703
18001
|
className: "camera-capture-btn m-b-2",
|
|
17704
18002
|
"data-testid": "camera-capture-button",
|
|
17705
18003
|
onClick,
|
|
17706
|
-
children: /* @__PURE__ */
|
|
18004
|
+
children: /* @__PURE__ */ jsx118("span", { className: "camera-capture-btn-inner" })
|
|
17707
18005
|
}
|
|
17708
18006
|
);
|
|
17709
18007
|
|
|
17710
18008
|
// src/legacy/step/cameraStep/cameraCapture/components/orientationLockOverlay/OrientationLockOverlay.tsx
|
|
17711
|
-
import { useIntl as
|
|
18009
|
+
import { useIntl as useIntl22 } from "react-intl";
|
|
17712
18010
|
|
|
17713
18011
|
// src/legacy/step/cameraStep/cameraCapture/components/orientationLockOverlay/OrientationLockOverlay.messages.ts
|
|
17714
18012
|
import { defineMessages as defineMessages14 } from "react-intl";
|
|
@@ -17721,11 +18019,11 @@ var OrientationLockOverlay_messages_default = defineMessages14({
|
|
|
17721
18019
|
});
|
|
17722
18020
|
|
|
17723
18021
|
// src/legacy/step/cameraStep/cameraCapture/components/orientationLockOverlay/OrientationLockOverlay.tsx
|
|
17724
|
-
import { jsx as
|
|
18022
|
+
import { jsx as jsx119, jsxs as jsxs47 } from "react/jsx-runtime";
|
|
17725
18023
|
function OrientationLockOverlay() {
|
|
17726
|
-
const intl =
|
|
18024
|
+
const intl = useIntl22();
|
|
17727
18025
|
return /* @__PURE__ */ jsxs47("div", { className: "orientation-lock-overlay", children: [
|
|
17728
|
-
/* @__PURE__ */
|
|
18026
|
+
/* @__PURE__ */ jsx119(
|
|
17729
18027
|
"img",
|
|
17730
18028
|
{
|
|
17731
18029
|
className: "m-b-3",
|
|
@@ -17735,19 +18033,19 @@ function OrientationLockOverlay() {
|
|
|
17735
18033
|
alt: ""
|
|
17736
18034
|
}
|
|
17737
18035
|
),
|
|
17738
|
-
/* @__PURE__ */
|
|
18036
|
+
/* @__PURE__ */ jsx119("p", { className: "text-center m-b-0", children: intl.formatMessage(OrientationLockOverlay_messages_default.text) })
|
|
17739
18037
|
] });
|
|
17740
18038
|
}
|
|
17741
18039
|
var OrientationLockOverlay_default = OrientationLockOverlay;
|
|
17742
18040
|
|
|
17743
18041
|
// src/legacy/step/cameraStep/cameraCapture/screens/cameraErrorScreen/CameraErrorScreen.tsx
|
|
17744
18042
|
import { Button as Button11 } from "@transferwise/components";
|
|
17745
|
-
import { jsx as
|
|
18043
|
+
import { jsx as jsx120, jsxs as jsxs48 } from "react/jsx-runtime";
|
|
17746
18044
|
function CameraErrorScreen({ title, description, actionButton, onAction }) {
|
|
17747
|
-
return /* @__PURE__ */
|
|
17748
|
-
/* @__PURE__ */
|
|
17749
|
-
/* @__PURE__ */
|
|
17750
|
-
onAction && actionButton && /* @__PURE__ */
|
|
18045
|
+
return /* @__PURE__ */ jsx120("div", { className: "container p-t-5", children: /* @__PURE__ */ jsx120("div", { className: "row", children: /* @__PURE__ */ jsxs48("div", { className: "col-md-6 col-md-offset-3", children: [
|
|
18046
|
+
/* @__PURE__ */ jsx120("h2", { className: "text-xs-center m-b-3", children: title }),
|
|
18047
|
+
/* @__PURE__ */ jsx120("p", { className: "text-xs-center m-b-5", children: description }),
|
|
18048
|
+
onAction && actionButton && /* @__PURE__ */ jsx120(Button11, { block: true, onClick: onAction, children: actionButton })
|
|
17751
18049
|
] }) }) });
|
|
17752
18050
|
}
|
|
17753
18051
|
var CameraErrorScreen_default = CameraErrorScreen;
|
|
@@ -17834,7 +18132,10 @@ var trackCameraOrientationLocked = (onEvent) => {
|
|
|
17834
18132
|
var useFullScreenOrientationLock = (shouldLockOrientation, onEvent) => {
|
|
17835
18133
|
const lockOrientation = useCallback9(() => {
|
|
17836
18134
|
if (window.screen.orientation && "lock" in window.screen.orientation && typeof window.screen.orientation.lock === "function") {
|
|
17837
|
-
window.screen.orientation.lock("portrait")
|
|
18135
|
+
const lockPromise = window.screen.orientation.lock("portrait");
|
|
18136
|
+
if (lockPromise instanceof Promise) {
|
|
18137
|
+
lockPromise.then(() => trackCameraOrientationLocked(onEvent)).catch(noop5);
|
|
18138
|
+
}
|
|
17838
18139
|
}
|
|
17839
18140
|
}, [onEvent]);
|
|
17840
18141
|
const unlockOrientation = useCallback9(() => {
|
|
@@ -17890,9 +18191,9 @@ var noop5 = () => {
|
|
|
17890
18191
|
};
|
|
17891
18192
|
|
|
17892
18193
|
// src/legacy/step/cameraStep/cameraCapture/hooks/useVideoConstraints.ts
|
|
17893
|
-
import { useEffect as useEffect22, useState as
|
|
18194
|
+
import { useEffect as useEffect22, useState as useState30 } from "react";
|
|
17894
18195
|
var useVideoConstraints = (direction) => {
|
|
17895
|
-
const [videoConstraints, setVideoConstraints] =
|
|
18196
|
+
const [videoConstraints, setVideoConstraints] = useState30();
|
|
17896
18197
|
const defaultVideoConstraints = {
|
|
17897
18198
|
facingMode: direction === "front" ? "user" : "environment",
|
|
17898
18199
|
height: { min: 480, max: 1080, ideal: 720 },
|
|
@@ -17919,7 +18220,7 @@ var useVideoConstraints = (direction) => {
|
|
|
17919
18220
|
|
|
17920
18221
|
// src/legacy/step/cameraStep/cameraCapture/overlay/Overlay.tsx
|
|
17921
18222
|
import { useEffect as useEffect23, useRef as useRef7 } from "react";
|
|
17922
|
-
import { Fragment as Fragment23, jsx as
|
|
18223
|
+
import { Fragment as Fragment23, jsx as jsx121, jsxs as jsxs49 } from "react/jsx-runtime";
|
|
17923
18224
|
var captureButtonHeight = 92;
|
|
17924
18225
|
var reviewButtonsHeight = 120;
|
|
17925
18226
|
var imageHeight = 40;
|
|
@@ -17942,17 +18243,17 @@ function Overlay({ overlay, outline, imageUrl, title, instructions, reviewInstru
|
|
|
17942
18243
|
});
|
|
17943
18244
|
let helperBoxHeight = (imageUrl ? imageHeight : 0) + (title ? titleHeight : 0) + (instructions ? instructionsHeight : 0);
|
|
17944
18245
|
let helperBox = /* @__PURE__ */ jsxs49(Fragment23, { children: [
|
|
17945
|
-
imageUrl && /* @__PURE__ */
|
|
17946
|
-
title && /* @__PURE__ */
|
|
17947
|
-
instructions && /* @__PURE__ */
|
|
18246
|
+
imageUrl && /* @__PURE__ */ jsx121("img", { className: "camera-capture-img", src: imageUrl, alt: "" }),
|
|
18247
|
+
title && /* @__PURE__ */ jsx121("h4", { className: "camera-capture-title", children: title }),
|
|
18248
|
+
instructions && /* @__PURE__ */ jsx121("small", { className: "camera-capture-instructions", children: instructions })
|
|
17948
18249
|
] });
|
|
17949
18250
|
const frameBottomMargin = captureButtonHeight + helperBoxHeight;
|
|
17950
18251
|
if (reviewInstructions) {
|
|
17951
18252
|
helperBoxHeight = frameBottomMargin - reviewButtonsHeight;
|
|
17952
|
-
helperBox = /* @__PURE__ */
|
|
18253
|
+
helperBox = /* @__PURE__ */ jsx121("small", { className: "camera-capture-instructions", children: reviewInstructions });
|
|
17953
18254
|
const frameWithReviewInstructionsMinBottomMargin = reviewButtonsHeight + reviewInstructionsHeight;
|
|
17954
18255
|
if (frameBottomMargin < frameWithReviewInstructionsMinBottomMargin) {
|
|
17955
|
-
helperBox = /* @__PURE__ */
|
|
18256
|
+
helperBox = /* @__PURE__ */ jsx121(Fragment23, {});
|
|
17956
18257
|
}
|
|
17957
18258
|
}
|
|
17958
18259
|
const framePosition = {
|
|
@@ -17971,19 +18272,19 @@ function Overlay({ overlay, outline, imageUrl, title, instructions, reviewInstru
|
|
|
17971
18272
|
}
|
|
17972
18273
|
};
|
|
17973
18274
|
return /* @__PURE__ */ jsxs49("svg", { ref: svgReference, xmlns: "http://www.w3.org/2000/svg", children: [
|
|
17974
|
-
/* @__PURE__ */
|
|
17975
|
-
/* @__PURE__ */
|
|
17976
|
-
/* @__PURE__ */
|
|
18275
|
+
/* @__PURE__ */ jsx121("defs", { children: /* @__PURE__ */ jsxs49("mask", { id: "mask", children: [
|
|
18276
|
+
/* @__PURE__ */ jsx121("rect", { width: "100%", height: "100%", fill: "#fff" }),
|
|
18277
|
+
/* @__PURE__ */ jsx121("image", __spreadValues({ href: overlay }, framePosition))
|
|
17977
18278
|
] }) }),
|
|
17978
|
-
overlay && /* @__PURE__ */
|
|
17979
|
-
outline && /* @__PURE__ */
|
|
17980
|
-
/* @__PURE__ */
|
|
18279
|
+
overlay && /* @__PURE__ */ jsx121("rect", { width: "100%", height: "100%", mask: "url(#mask)", fillOpacity: "0.72" }),
|
|
18280
|
+
outline && /* @__PURE__ */ jsx121("image", __spreadValues({ href: outline }, framePosition)),
|
|
18281
|
+
/* @__PURE__ */ jsx121("foreignObject", { width: "100%", height: "100%", children: /* @__PURE__ */ jsx121("div", __spreadProps(__spreadValues({ className: "camera-capture-text-and-image-container" }, helperBoxPosition), { children: helperBox })) })
|
|
17981
18282
|
] });
|
|
17982
18283
|
}
|
|
17983
18284
|
var Overlay_default = Overlay;
|
|
17984
18285
|
|
|
17985
18286
|
// src/legacy/step/cameraStep/cameraCapture/CameraCapture.tsx
|
|
17986
|
-
import { jsx as
|
|
18287
|
+
import { jsx as jsx122, jsxs as jsxs50 } from "react/jsx-runtime";
|
|
17987
18288
|
function CameraCapture({
|
|
17988
18289
|
direction = "back",
|
|
17989
18290
|
overlay = "",
|
|
@@ -17995,11 +18296,11 @@ function CameraCapture({
|
|
|
17995
18296
|
onCapture,
|
|
17996
18297
|
onEvent
|
|
17997
18298
|
}) {
|
|
17998
|
-
const [mode, setMode] =
|
|
17999
|
-
const [cameraError, setCameraError] =
|
|
18000
|
-
const [isVideoMirrored, setIsVideoMirrored] =
|
|
18001
|
-
const [ready, setReady] =
|
|
18002
|
-
const [reviewImage, setReviewImage] =
|
|
18299
|
+
const [mode, setMode] = useState31("CAPTURE" /* CAPTURE */);
|
|
18300
|
+
const [cameraError, setCameraError] = useState31();
|
|
18301
|
+
const [isVideoMirrored, setIsVideoMirrored] = useState31(false);
|
|
18302
|
+
const [ready, setReady] = useState31(false);
|
|
18303
|
+
const [reviewImage, setReviewImage] = useState31();
|
|
18003
18304
|
const webcamReference = useRef8(null);
|
|
18004
18305
|
const { videoConstraints } = useVideoConstraints(direction);
|
|
18005
18306
|
const shouldLockOrientation = useMemo20(
|
|
@@ -18010,7 +18311,7 @@ function CameraCapture({
|
|
|
18010
18311
|
shouldLockOrientation,
|
|
18011
18312
|
onEvent
|
|
18012
18313
|
);
|
|
18013
|
-
const intl =
|
|
18314
|
+
const intl = useIntl23();
|
|
18014
18315
|
const handleCapture = useCallback10(async () => {
|
|
18015
18316
|
var _a, _b, _c, _d, _e, _f;
|
|
18016
18317
|
if (((_a = webcamReference == null ? void 0 : webcamReference.current) == null ? void 0 : _a.video) && ((_c = (_b = webcamReference == null ? void 0 : webcamReference.current) == null ? void 0 : _b.video) == null ? void 0 : _c.readyState) >= 3) {
|
|
@@ -18092,7 +18393,7 @@ function CameraCapture({
|
|
|
18092
18393
|
}
|
|
18093
18394
|
}, [mode, exitFullScreen]);
|
|
18094
18395
|
const captureScreen = /* @__PURE__ */ jsxs50("div", { className: "camera-capture", children: [
|
|
18095
|
-
videoConstraints && /* @__PURE__ */
|
|
18396
|
+
videoConstraints && /* @__PURE__ */ jsx122(
|
|
18096
18397
|
Webcam,
|
|
18097
18398
|
{
|
|
18098
18399
|
ref: webcamReference,
|
|
@@ -18103,7 +18404,7 @@ function CameraCapture({
|
|
|
18103
18404
|
onUserMedia: handleUserMedia
|
|
18104
18405
|
}
|
|
18105
18406
|
),
|
|
18106
|
-
/* @__PURE__ */
|
|
18407
|
+
/* @__PURE__ */ jsx122(
|
|
18107
18408
|
Overlay_default,
|
|
18108
18409
|
{
|
|
18109
18410
|
overlay,
|
|
@@ -18113,8 +18414,8 @@ function CameraCapture({
|
|
|
18113
18414
|
instructions
|
|
18114
18415
|
}
|
|
18115
18416
|
),
|
|
18116
|
-
shouldLockOrientation && /* @__PURE__ */
|
|
18117
|
-
ready && /* @__PURE__ */
|
|
18417
|
+
shouldLockOrientation && /* @__PURE__ */ jsx122(OrientationLockOverlay_default, {}),
|
|
18418
|
+
ready && /* @__PURE__ */ jsx122(
|
|
18118
18419
|
CaptureBottomBar,
|
|
18119
18420
|
{
|
|
18120
18421
|
onCapture: () => {
|
|
@@ -18124,8 +18425,8 @@ function CameraCapture({
|
|
|
18124
18425
|
)
|
|
18125
18426
|
] });
|
|
18126
18427
|
const reviewScreen = /* @__PURE__ */ jsxs50("div", { className: "camera-capture", children: [
|
|
18127
|
-
/* @__PURE__ */
|
|
18128
|
-
/* @__PURE__ */
|
|
18428
|
+
/* @__PURE__ */ jsx122("img", { className: "review-image", src: reviewImage == null ? void 0 : reviewImage.source, alt: "" }),
|
|
18429
|
+
/* @__PURE__ */ jsx122(
|
|
18129
18430
|
Overlay_default,
|
|
18130
18431
|
{
|
|
18131
18432
|
overlay,
|
|
@@ -18135,18 +18436,18 @@ function CameraCapture({
|
|
|
18135
18436
|
reviewInstructions: intl.formatMessage(CameraCapture_messages_default.reviewInstructions)
|
|
18136
18437
|
}
|
|
18137
18438
|
),
|
|
18138
|
-
/* @__PURE__ */
|
|
18439
|
+
/* @__PURE__ */ jsx122(ReviewBottomBar, { onSubmit: handleReviewSubmit, onRetry: handleReviewRetry })
|
|
18139
18440
|
] });
|
|
18140
18441
|
return /* @__PURE__ */ jsxs50("section", { children: [
|
|
18141
18442
|
mode === "CAPTURE" /* CAPTURE */ && captureScreen,
|
|
18142
18443
|
mode === "REVIEW" /* REVIEW */ && reviewScreen,
|
|
18143
|
-
mode === "ERROR" /* ERROR */ && cameraError && /* @__PURE__ */
|
|
18444
|
+
mode === "ERROR" /* ERROR */ && cameraError && /* @__PURE__ */ jsx122(CameraErrorScreen_default, __spreadValues({}, cameraError))
|
|
18144
18445
|
] });
|
|
18145
18446
|
}
|
|
18146
18447
|
var CameraCapture_default = CameraCapture;
|
|
18147
18448
|
|
|
18148
18449
|
// src/legacy/step/cameraStep/CameraStep.tsx
|
|
18149
|
-
import { jsx as
|
|
18450
|
+
import { jsx as jsx123 } from "react/jsx-runtime";
|
|
18150
18451
|
function blobToBase64(blob) {
|
|
18151
18452
|
return new Promise((resolve, _) => {
|
|
18152
18453
|
const reader = new FileReader();
|
|
@@ -18164,7 +18465,7 @@ function CameraStep(props) {
|
|
|
18164
18465
|
const { assets, direction, instructions } = cameraConfig || {};
|
|
18165
18466
|
const { overlay, outline } = assets || {};
|
|
18166
18467
|
const { url: imageUrl } = image || {};
|
|
18167
|
-
const [captureClicked, setCaptureClicked] =
|
|
18468
|
+
const [captureClicked, setCaptureClicked] = useState32(false);
|
|
18168
18469
|
useEffect25(() => {
|
|
18169
18470
|
if (captureClicked) {
|
|
18170
18471
|
onAction(action);
|
|
@@ -18184,7 +18485,7 @@ function CameraStep(props) {
|
|
|
18184
18485
|
});
|
|
18185
18486
|
}
|
|
18186
18487
|
};
|
|
18187
|
-
return /* @__PURE__ */
|
|
18488
|
+
return /* @__PURE__ */ jsx123(
|
|
18188
18489
|
CameraCapture_default,
|
|
18189
18490
|
{
|
|
18190
18491
|
overlay,
|
|
@@ -18233,13 +18534,13 @@ function getFirstAction(step) {
|
|
|
18233
18534
|
}
|
|
18234
18535
|
|
|
18235
18536
|
// src/legacy/step/externalConfirmationStep/ExternalConfirmationStep.tsx
|
|
18236
|
-
import { useIntl as
|
|
18237
|
-
import { jsx as
|
|
18537
|
+
import { useIntl as useIntl24 } from "react-intl";
|
|
18538
|
+
import { jsx as jsx124 } from "react/jsx-runtime";
|
|
18238
18539
|
var noop6 = () => {
|
|
18239
18540
|
};
|
|
18240
18541
|
function ExternalConfirmationStep({ url, onClose }) {
|
|
18241
|
-
const { formatMessage } =
|
|
18242
|
-
return /* @__PURE__ */
|
|
18542
|
+
const { formatMessage } = useIntl24();
|
|
18543
|
+
return /* @__PURE__ */ jsx124(
|
|
18243
18544
|
DynamicLayout_default,
|
|
18244
18545
|
{
|
|
18245
18546
|
components: [
|
|
@@ -18306,7 +18607,7 @@ function getOrigin2(url) {
|
|
|
18306
18607
|
// src/legacy/dynamicFlow/BackButton.tsx
|
|
18307
18608
|
import { Avatar as Avatar7 } from "@transferwise/components";
|
|
18308
18609
|
import { ArrowLeft as ArrowLeft2 } from "@transferwise/icons";
|
|
18309
|
-
import { jsx as
|
|
18610
|
+
import { jsx as jsx125, jsxs as jsxs51 } from "react/jsx-runtime";
|
|
18310
18611
|
function BackButton2({ title, action, onAction }) {
|
|
18311
18612
|
return /* @__PURE__ */ jsxs51(
|
|
18312
18613
|
"a",
|
|
@@ -18319,8 +18620,8 @@ function BackButton2({ title, action, onAction }) {
|
|
|
18319
18620
|
onAction(__spreadProps(__spreadValues({}, action), { skipValidation: true }));
|
|
18320
18621
|
},
|
|
18321
18622
|
children: [
|
|
18322
|
-
/* @__PURE__ */
|
|
18323
|
-
/* @__PURE__ */
|
|
18623
|
+
/* @__PURE__ */ jsx125("span", { className: "sr-only", children: title }),
|
|
18624
|
+
/* @__PURE__ */ jsx125(Avatar7, { type: "icon", children: /* @__PURE__ */ jsx125(ArrowLeft2, { size: "24" }) })
|
|
18324
18625
|
]
|
|
18325
18626
|
}
|
|
18326
18627
|
);
|
|
@@ -18328,7 +18629,7 @@ function BackButton2({ title, action, onAction }) {
|
|
|
18328
18629
|
var BackButton_default2 = BackButton2;
|
|
18329
18630
|
|
|
18330
18631
|
// src/legacy/dynamicFlow/DynamicFlowStep.tsx
|
|
18331
|
-
import { Fragment as Fragment24, jsx as
|
|
18632
|
+
import { Fragment as Fragment24, jsx as jsx126, jsxs as jsxs52 } from "react/jsx-runtime";
|
|
18332
18633
|
function DynamicFlowStep(props) {
|
|
18333
18634
|
var _a, _b, _c;
|
|
18334
18635
|
const { step, globalError, onAction } = props;
|
|
@@ -18337,20 +18638,20 @@ function DynamicFlowStep(props) {
|
|
|
18337
18638
|
const { requiresManualTrigger, dismissConfirmation } = useExternal2(externalUrl);
|
|
18338
18639
|
if (step === void 0) {
|
|
18339
18640
|
if (globalError) {
|
|
18340
|
-
return /* @__PURE__ */
|
|
18641
|
+
return /* @__PURE__ */ jsx126(DynamicAlert_default, { component: { context: "negative", markdown: globalError, margin: "lg" } });
|
|
18341
18642
|
}
|
|
18342
18643
|
return null;
|
|
18343
18644
|
}
|
|
18344
18645
|
if (externalUrl && requiresManualTrigger) {
|
|
18345
|
-
return /* @__PURE__ */
|
|
18646
|
+
return /* @__PURE__ */ jsx126(ExternalConfirmationStep_default, { url: externalUrl, onClose: dismissConfirmation });
|
|
18346
18647
|
}
|
|
18347
18648
|
if (isCameraStep(step)) {
|
|
18348
|
-
return /* @__PURE__ */
|
|
18649
|
+
return /* @__PURE__ */ jsx126(CameraStep_default, __spreadProps(__spreadValues({}, props), { step }));
|
|
18349
18650
|
}
|
|
18350
18651
|
return /* @__PURE__ */ jsxs52(Fragment24, { children: [
|
|
18351
|
-
backButton && /* @__PURE__ */
|
|
18352
|
-
globalError ? /* @__PURE__ */
|
|
18353
|
-
/* @__PURE__ */
|
|
18652
|
+
backButton && /* @__PURE__ */ jsx126(BackButton_default2, __spreadProps(__spreadValues({}, backButton), { onAction })),
|
|
18653
|
+
globalError ? /* @__PURE__ */ jsx126(DynamicAlert_default, { component: { context: "negative", markdown: globalError, margin: "lg" } }) : null,
|
|
18654
|
+
/* @__PURE__ */ jsx126(LayoutStep_default, __spreadProps(__spreadValues({}, props), { stepSpecification: step }))
|
|
18354
18655
|
] });
|
|
18355
18656
|
}
|
|
18356
18657
|
|
|
@@ -18390,12 +18691,12 @@ function useDebouncedRefresh(fetchRefresh) {
|
|
|
18390
18691
|
var shouldDebounceSchema = (schema) => getSchemaType(schema) === "basic" && schema.type !== "boolean" && schema.format !== "base64url";
|
|
18391
18692
|
|
|
18392
18693
|
// src/legacy/dynamicFlow/utils/useDynamicFlowState.ts
|
|
18393
|
-
import { useMemo as useMemo21, useState as
|
|
18694
|
+
import { useMemo as useMemo21, useState as useState33 } from "react";
|
|
18394
18695
|
var useDynamicFlowState = (initialStep) => {
|
|
18395
18696
|
var _a, _b;
|
|
18396
|
-
const [formErrors, setFormErrors] =
|
|
18397
|
-
const [globalError, setGlobalError] =
|
|
18398
|
-
const [stepAndModels, setStepAndModels] =
|
|
18697
|
+
const [formErrors, setFormErrors] = useState33((_a = initialStep == null ? void 0 : initialStep.errors) == null ? void 0 : _a.validation);
|
|
18698
|
+
const [globalError, setGlobalError] = useState33((_b = initialStep == null ? void 0 : initialStep.errors) == null ? void 0 : _b.error);
|
|
18699
|
+
const [stepAndModels, setStepAndModels] = useState33({
|
|
18399
18700
|
step: initialStep || void 0,
|
|
18400
18701
|
models: (initialStep == null ? void 0 : initialStep.model) ? buildInitialModels(initialStep.model, getAllSchemas(initialStep)) : {},
|
|
18401
18702
|
etag: void 0
|
|
@@ -18498,17 +18799,17 @@ var isInlineSchema = (schema) => schema !== void 0 && typeof schema === "object"
|
|
|
18498
18799
|
|
|
18499
18800
|
// src/legacy/dynamicFlow/utils/useLoader.tsx
|
|
18500
18801
|
import { Loader as Loader4, Size as Size4 } from "@transferwise/components";
|
|
18501
|
-
import { useState as
|
|
18502
|
-
import { jsx as
|
|
18802
|
+
import { useState as useState34 } from "react";
|
|
18803
|
+
import { jsx as jsx127 } from "react/jsx-runtime";
|
|
18503
18804
|
function useLoader(loaderConfig, initialState) {
|
|
18504
18805
|
const config = __spreadValues({
|
|
18505
18806
|
size: Size4.EXTRA_LARGE,
|
|
18506
18807
|
initial: true,
|
|
18507
18808
|
submission: false
|
|
18508
18809
|
}, loaderConfig);
|
|
18509
|
-
const [loadingState, setLoadingState] =
|
|
18810
|
+
const [loadingState, setLoadingState] = useState34(initialState);
|
|
18510
18811
|
const shouldDisplayLoader = config.initial && loadingState === "initial" || config.submission && loadingState === "submission";
|
|
18511
|
-
const loader = shouldDisplayLoader ? /* @__PURE__ */
|
|
18812
|
+
const loader = shouldDisplayLoader ? /* @__PURE__ */ jsx127(
|
|
18512
18813
|
Loader4,
|
|
18513
18814
|
{
|
|
18514
18815
|
size: config.size,
|
|
@@ -18611,9 +18912,9 @@ var assertResponseIsValid2 = (response) => {
|
|
|
18611
18912
|
var isResponse2 = (response) => typeof response === "object" && response !== null && "clone" in response && "bodyUsed" in response;
|
|
18612
18913
|
|
|
18613
18914
|
// src/legacy/dynamicFlow/utils/useErrorResponse.tsx
|
|
18614
|
-
import { useIntl as
|
|
18915
|
+
import { useIntl as useIntl25 } from "react-intl";
|
|
18615
18916
|
var useErrorResponse = () => {
|
|
18616
|
-
const { formatMessage } =
|
|
18917
|
+
const { formatMessage } = useIntl25();
|
|
18617
18918
|
return async (response, fetchType) => {
|
|
18618
18919
|
try {
|
|
18619
18920
|
const errorResponse = await parseErrorResponse(response);
|
|
@@ -18628,7 +18929,7 @@ var useErrorResponse = () => {
|
|
|
18628
18929
|
};
|
|
18629
18930
|
|
|
18630
18931
|
// src/legacy/dynamicFlow/DynamicFlow.tsx
|
|
18631
|
-
import { jsx as
|
|
18932
|
+
import { jsx as jsx128 } from "react/jsx-runtime";
|
|
18632
18933
|
var noop7 = () => {
|
|
18633
18934
|
};
|
|
18634
18935
|
var DynamicFlowComponent = ({
|
|
@@ -18656,7 +18957,7 @@ var DynamicFlowComponent = ({
|
|
|
18656
18957
|
setStepAndEtag,
|
|
18657
18958
|
setSchemaModel
|
|
18658
18959
|
} = useDynamicFlowState(initialStep);
|
|
18659
|
-
const [submitted, setSubmitted] =
|
|
18960
|
+
const [submitted, setSubmitted] = useState35(false);
|
|
18660
18961
|
const { isLoading, loader, setLoadingState } = useLoader(
|
|
18661
18962
|
loaderConfig,
|
|
18662
18963
|
initialStep ? "idle" : "initial"
|
|
@@ -18867,7 +19168,7 @@ var DynamicFlowComponent = ({
|
|
|
18867
19168
|
await performAction(action);
|
|
18868
19169
|
}
|
|
18869
19170
|
};
|
|
18870
|
-
return /* @__PURE__ */
|
|
19171
|
+
return /* @__PURE__ */ jsx128(LogProvider, { flowId, stepId: (step == null ? void 0 : step.id) || (step == null ? void 0 : step.key), onLog, children: /* @__PURE__ */ jsx128(EventsContextProvider, { metadata: analyticsMetadata, onEvent, children: /* @__PURE__ */ jsx128(DynamicFlowProvider, { loading: isLoading || isDebouncing, children: /* @__PURE__ */ jsx128(HttpClientProvider, { httpClient, children: /* @__PURE__ */ jsx128(FeatureContextProvider, { features, children: loader !== null ? loader : /* @__PURE__ */ jsx128(
|
|
18871
19172
|
DynamicFlowStep,
|
|
18872
19173
|
{
|
|
18873
19174
|
step,
|
|
@@ -18884,7 +19185,7 @@ var DynamicFlowComponent = ({
|
|
|
18884
19185
|
) }) }) }) }) });
|
|
18885
19186
|
};
|
|
18886
19187
|
function DynamicFlow(props) {
|
|
18887
|
-
return /* @__PURE__ */
|
|
19188
|
+
return /* @__PURE__ */ jsx128(ErrorBoundary_default, { onError: props.onError, children: /* @__PURE__ */ jsx128(DynamicFlowComponent, __spreadValues({}, props)) });
|
|
18888
19189
|
}
|
|
18889
19190
|
var DynamicFlow_default = DynamicFlow;
|
|
18890
19191
|
var combineModels2 = (formModels) => Object.values(formModels).reduce((previous, model) => __spreadValues(__spreadValues({}, previous), model), {});
|
|
@@ -18901,19 +19202,19 @@ var shouldTriggerRefresh = (props) => {
|
|
|
18901
19202
|
};
|
|
18902
19203
|
|
|
18903
19204
|
// src/legacy/jsonSchemaForm/JsonSchemaForm.tsx
|
|
18904
|
-
import { jsx as
|
|
19205
|
+
import { jsx as jsx129 } from "react/jsx-runtime";
|
|
18905
19206
|
function JsonSchemaForm(props) {
|
|
18906
19207
|
const schemaProps = __spreadValues({
|
|
18907
19208
|
model: null,
|
|
18908
19209
|
errors: null
|
|
18909
19210
|
}, props);
|
|
18910
19211
|
const { baseUrl = "", onEvent = noop8, onLog = noop8 } = props;
|
|
18911
|
-
return /* @__PURE__ */
|
|
19212
|
+
return /* @__PURE__ */ jsx129(LogProvider, { flowId: "JsonSchemaForm", stepId: "JsonSchemaForm", onLog, children: /* @__PURE__ */ jsx129(
|
|
18912
19213
|
EventsContextProvider,
|
|
18913
19214
|
{
|
|
18914
19215
|
metadata: { flowId: "JsonSchemaForm", stepId: "JsonSchemaForm" },
|
|
18915
19216
|
onEvent,
|
|
18916
|
-
children: /* @__PURE__ */
|
|
19217
|
+
children: /* @__PURE__ */ jsx129(HttpClientProviderFromBaseUrl, { baseUrl, children: /* @__PURE__ */ jsx129(GenericSchema_default, __spreadValues({}, schemaProps)) })
|
|
18917
19218
|
}
|
|
18918
19219
|
) });
|
|
18919
19220
|
}
|