@wise/dynamic-flow-client 3.20.0 → 3.20.1
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 +45 -93
- package/build/main.min.js +1 -1
- package/build/main.mjs +45 -93
- package/build/types/legacy/jsonSchemaForm/allOfSchema/AllOfSchema.d.ts +0 -5
- package/build/types/legacy/jsonSchemaForm/arrayTypeSchema/ArraySchema.d.ts +1 -6
- package/build/types/legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/ArrayListSchema.d.ts +0 -6
- package/build/types/legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/MultipleFileUploadSchema.d.ts +0 -6
- package/build/types/legacy/jsonSchemaForm/basicTypeSchema/BasicTypeSchema.d.ts +1 -8
- package/build/types/legacy/jsonSchemaForm/controlFeedback/ControlFeedback.d.ts +0 -8
- package/build/types/legacy/jsonSchemaForm/objectSchema/ObjectSchema.d.ts +0 -6
- package/build/types/legacy/jsonSchemaForm/oneOfSchema/OneOfSchema.d.ts +0 -6
- package/build/types/legacy/jsonSchemaForm/persistAsyncSchema/PersistAsyncSchema.d.ts +0 -5
- package/build/types/legacy/jsonSchemaForm/persistAsyncSchema/persistAsyncBasicSchema/PersistAsyncBasicSchema.d.ts +0 -5
- package/build/types/legacy/jsonSchemaForm/persistAsyncSchema/persistAsyncBlobSchema/PersistAsyncBlobSchema.d.ts +0 -5
- package/build/types/legacy/jsonSchemaForm/promotedOneOfSchema/promotedOneOfControl/PromotedOneOfCheckboxControl.d.ts +1 -4
- package/build/types/legacy/jsonSchemaForm/schemaFormControl/SchemaFormControl.d.ts +0 -9
- package/build/types/legacy/jsonSchemaForm/validationAsyncSchema/ValidationAsyncSchema.d.ts +0 -5
- package/package.json +16 -17
package/build/main.mjs
CHANGED
|
@@ -138,19 +138,20 @@ var init_clsx = __esm({
|
|
|
138
138
|
}
|
|
139
139
|
});
|
|
140
140
|
|
|
141
|
-
// ../../node_modules/.pnpm/@wise+art@2.
|
|
141
|
+
// ../../node_modules/.pnpm/@wise+art@2.15.0_@transferwise+neptune-css@14.18.0_@types+react@18.3.8_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@wise/art/dist/index-a91e5689.esm.js
|
|
142
142
|
import { useState as useState2, useEffect as useEffect2, forwardRef, Suspense, lazy } from "react";
|
|
143
143
|
import { jsx as jsx17, jsxs as jsxs4, Fragment as Fragment3 } from "react/jsx-runtime";
|
|
144
144
|
var unknownFlagName, Flag, Sizes, ImageSizes, imageSizes, Assets, RenderMode;
|
|
145
|
-
var
|
|
146
|
-
"../../node_modules/.pnpm/@wise+art@2.
|
|
145
|
+
var init_index_a91e5689_esm = __esm({
|
|
146
|
+
"../../node_modules/.pnpm/@wise+art@2.15.0_@transferwise+neptune-css@14.18.0_@types+react@18.3.8_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@wise/art/dist/index-a91e5689.esm.js"() {
|
|
147
147
|
"use strict";
|
|
148
148
|
init_clsx();
|
|
149
149
|
unknownFlagName = "wise";
|
|
150
150
|
Flag = ({
|
|
151
151
|
code,
|
|
152
152
|
intrinsicSize = 64,
|
|
153
|
-
className = void 0
|
|
153
|
+
className = void 0,
|
|
154
|
+
loading = "lazy"
|
|
154
155
|
}) => {
|
|
155
156
|
const [fallback, setFallback] = useState2(null);
|
|
156
157
|
useEffect2(() => {
|
|
@@ -161,6 +162,7 @@ var init_index_93a0c34e_esm = __esm({
|
|
|
161
162
|
return /* @__PURE__ */ jsx17("img", {
|
|
162
163
|
className: clsx(`wds-flag wds-flag-${name}`, className),
|
|
163
164
|
src: `https://wise.com/web-art/assets/flags/${name}.svg`,
|
|
165
|
+
loading,
|
|
164
166
|
alt: "",
|
|
165
167
|
width: intrinsicSize,
|
|
166
168
|
height: intrinsicSize,
|
|
@@ -11396,8 +11398,8 @@ var DateInputRenderer_default = DateInputRenderer;
|
|
|
11396
11398
|
// ../renderers/src/DecisionRenderer.tsx
|
|
11397
11399
|
import { NavigationOptionsList, NavigationOption, Header } from "@transferwise/components";
|
|
11398
11400
|
|
|
11399
|
-
// ../../node_modules/.pnpm/@wise+art@2.
|
|
11400
|
-
|
|
11401
|
+
// ../../node_modules/.pnpm/@wise+art@2.15.0_@transferwise+neptune-css@14.18.0_@types+react@18.3.8_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@wise/art/dist/index.esm.js
|
|
11402
|
+
init_index_a91e5689_esm();
|
|
11401
11403
|
init_clsx();
|
|
11402
11404
|
import "react";
|
|
11403
11405
|
import "react/jsx-runtime";
|
|
@@ -14912,6 +14914,7 @@ var getSchemaColumnClasses = (width) => ({
|
|
|
14912
14914
|
"col-sm-4": width === "sm"
|
|
14913
14915
|
});
|
|
14914
14916
|
function AllOfSchema(props) {
|
|
14917
|
+
const { disabled = false } = props;
|
|
14915
14918
|
const onChangeModelIndex = (index, onChangeProps) => {
|
|
14916
14919
|
const modelSchema = props.schema.allOf[index];
|
|
14917
14920
|
models[index] = getValidObjectModelParts(onChangeProps.model, modelSchema) || {};
|
|
@@ -14931,7 +14934,7 @@ function AllOfSchema(props) {
|
|
|
14931
14934
|
model: models[index],
|
|
14932
14935
|
errors: props.errors,
|
|
14933
14936
|
submitted: props.submitted,
|
|
14934
|
-
disabled
|
|
14937
|
+
disabled,
|
|
14935
14938
|
onChange: (onChangeProps) => onChangeModelIndex(index, __spreadProps(__spreadValues({}, onChangeProps), {
|
|
14936
14939
|
// We can safely assume that the model here is going to be of the same type as the model prop
|
|
14937
14940
|
model: onChangeProps.model
|
|
@@ -14942,9 +14945,6 @@ function AllOfSchema(props) {
|
|
|
14942
14945
|
)) })
|
|
14943
14946
|
] });
|
|
14944
14947
|
}
|
|
14945
|
-
AllOfSchema.defaultProps = {
|
|
14946
|
-
disabled: false
|
|
14947
|
-
};
|
|
14948
14948
|
var AllOfSchema_default = AllOfSchema;
|
|
14949
14949
|
|
|
14950
14950
|
// src/legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/MultipleFileUploadSchema.tsx
|
|
@@ -14961,28 +14961,22 @@ import { formatDate as formatDate3 } from "@transferwise/formatting";
|
|
|
14961
14961
|
import { useIntl as useIntl11 } from "react-intl";
|
|
14962
14962
|
import { jsx as jsx78, jsxs as jsxs27 } from "react/jsx-runtime";
|
|
14963
14963
|
function ControlFeedback(props) {
|
|
14964
|
-
|
|
14964
|
+
const { errors = "", validations = [], validationMessages = {} } = props;
|
|
14965
14965
|
const defaultValidationMessages = useDefaultValidationMessages(props.schema);
|
|
14966
|
-
const
|
|
14967
|
-
const isErrorVisible = (props.submitted || !props.changed) && Boolean(
|
|
14968
|
-
const isValidationVisible = !isErrorVisible && (props.submitted || props.changed && props.blurred) && Boolean(
|
|
14966
|
+
const mergedValidationMessages = __spreadValues(__spreadValues(__spreadValues({}, defaultValidationMessages), validationMessages), props.schema.validationMessages);
|
|
14967
|
+
const isErrorVisible = (props.submitted || !props.changed) && Boolean(errors);
|
|
14968
|
+
const isValidationVisible = !isErrorVisible && (props.submitted || props.changed && props.blurred) && Boolean(validations == null ? void 0 : validations.length);
|
|
14969
14969
|
const isDescriptionVisible = props.schema.type !== "boolean" && props.schema.description && !isErrorVisible && !isValidationVisible;
|
|
14970
14970
|
const hasInfoMessage = Boolean(props.infoMessage);
|
|
14971
14971
|
return /* @__PURE__ */ jsxs27("div", { id: props.id, children: [
|
|
14972
|
-
isErrorVisible ? /* @__PURE__ */ jsx78(InlineAlert3, { type: "error", children:
|
|
14973
|
-
isValidationVisible ? /* @__PURE__ */ jsx78(InlineAlert3, { type: "error", children:
|
|
14972
|
+
isErrorVisible ? /* @__PURE__ */ jsx78(InlineAlert3, { type: "error", children: errors }) : null,
|
|
14973
|
+
isValidationVisible ? /* @__PURE__ */ jsx78(InlineAlert3, { type: "error", children: validations.map((validation) => /* @__PURE__ */ jsx78("div", { children: mergedValidationMessages[validation] }, validation)) }) : null,
|
|
14974
14974
|
(isDescriptionVisible || hasInfoMessage) && /* @__PURE__ */ jsxs27(InlineAlert3, { type: "info", children: [
|
|
14975
14975
|
isDescriptionVisible && /* @__PURE__ */ jsx78("div", { children: props.schema.description }),
|
|
14976
14976
|
hasInfoMessage && /* @__PURE__ */ jsx78("div", { children: props.infoMessage })
|
|
14977
14977
|
] })
|
|
14978
14978
|
] });
|
|
14979
14979
|
}
|
|
14980
|
-
ControlFeedback.defaultProps = {
|
|
14981
|
-
errors: "",
|
|
14982
|
-
validations: [],
|
|
14983
|
-
validationMessages: {},
|
|
14984
|
-
validationAsyncSuccessMessage: null
|
|
14985
|
-
};
|
|
14986
14980
|
function useDefaultValidationMessages(schema) {
|
|
14987
14981
|
const { formatMessage, locale } = useIntl11();
|
|
14988
14982
|
const formattedMessages = {
|
|
@@ -15102,7 +15096,7 @@ function useFormattedDefaultErrorMessages({
|
|
|
15102
15096
|
import { jsx as jsx79, jsxs as jsxs28 } from "react/jsx-runtime";
|
|
15103
15097
|
function MultipleFileUploadSchema(props) {
|
|
15104
15098
|
var _a, _b;
|
|
15105
|
-
const { onChange, schema } = props;
|
|
15099
|
+
const { onChange, errors = null, schema, required = false } = props;
|
|
15106
15100
|
const onEvent = useEventDispatcher();
|
|
15107
15101
|
const defaultErrorMessages = useFormattedDefaultErrorMessages(schema);
|
|
15108
15102
|
const uid = useMemo12(() => schema.$id || generateRandomId(), [schema.$id]);
|
|
@@ -15139,8 +15133,8 @@ function MultipleFileUploadSchema(props) {
|
|
|
15139
15133
|
}
|
|
15140
15134
|
const validFiles = getSuccessfullyProcessedFiles(files);
|
|
15141
15135
|
const fileIds = validFiles.map((file) => file.id);
|
|
15142
|
-
const fileListValidationFailures = getArrayValidationFailures(fileIds, schema,
|
|
15143
|
-
const showError = Boolean(
|
|
15136
|
+
const fileListValidationFailures = getArrayValidationFailures(fileIds, schema, required);
|
|
15137
|
+
const showError = Boolean(errors) || (inputChanged || props.submitted) && Boolean(fileListValidationFailures.length);
|
|
15144
15138
|
const accepts = "accepts" in fileSchemaDescriptor && fileSchemaDescriptor.accepts;
|
|
15145
15139
|
const maxSize = "maxSize" in fileSchemaDescriptor && fileSchemaDescriptor.maxSize;
|
|
15146
15140
|
const uploadInputProps = __spreadProps(__spreadValues(__spreadValues({
|
|
@@ -15169,14 +15163,10 @@ function MultipleFileUploadSchema(props) {
|
|
|
15169
15163
|
id: feedbackId,
|
|
15170
15164
|
changed: inputChanged,
|
|
15171
15165
|
submitted: props.submitted,
|
|
15172
|
-
errors
|
|
15166
|
+
errors,
|
|
15173
15167
|
schema: props.schema,
|
|
15174
15168
|
validations: fileListValidationFailures,
|
|
15175
|
-
validationMessages: getValidationMessages(
|
|
15176
|
-
schema,
|
|
15177
|
-
Boolean(props.required),
|
|
15178
|
-
defaultErrorMessages
|
|
15179
|
-
),
|
|
15169
|
+
validationMessages: getValidationMessages(schema, Boolean(required), defaultErrorMessages),
|
|
15180
15170
|
infoMessage: null,
|
|
15181
15171
|
focused: false,
|
|
15182
15172
|
blurred: true
|
|
@@ -15184,10 +15174,6 @@ function MultipleFileUploadSchema(props) {
|
|
|
15184
15174
|
)
|
|
15185
15175
|
] });
|
|
15186
15176
|
}
|
|
15187
|
-
MultipleFileUploadSchema.defaultProps = {
|
|
15188
|
-
errors: null,
|
|
15189
|
-
required: false
|
|
15190
|
-
};
|
|
15191
15177
|
var MultipleFileUploadSchema_default = MultipleFileUploadSchema;
|
|
15192
15178
|
function getSuccessfullyProcessedFiles(allFiles) {
|
|
15193
15179
|
return allFiles.filter((file) => !file.error && file.status === "succeeded");
|
|
@@ -15884,22 +15870,18 @@ var RepeatableSchema_default = RepeatableSchema;
|
|
|
15884
15870
|
// src/legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/ArrayListSchema.tsx
|
|
15885
15871
|
import { jsx as jsx85 } from "react/jsx-runtime";
|
|
15886
15872
|
function ArrayListSchema(props) {
|
|
15887
|
-
const { schema } = props;
|
|
15873
|
+
const { errors = null, schema } = props;
|
|
15888
15874
|
if (isMultipleFileUploadSchema(schema)) {
|
|
15889
|
-
return /* @__PURE__ */ jsx85(MultipleFileUploadSchema_default, __spreadProps(__spreadValues({}, props), { schema }));
|
|
15875
|
+
return /* @__PURE__ */ jsx85(MultipleFileUploadSchema_default, __spreadProps(__spreadValues({}, props), { errors, schema }));
|
|
15890
15876
|
}
|
|
15891
15877
|
if (isMultiSelectConstSchema(schema)) {
|
|
15892
|
-
return /* @__PURE__ */ jsx85(MultiSelectSchema, __spreadProps(__spreadValues({}, props), { schema }));
|
|
15878
|
+
return /* @__PURE__ */ jsx85(MultiSelectSchema, __spreadProps(__spreadValues({}, props), { errors, schema }));
|
|
15893
15879
|
}
|
|
15894
15880
|
if (isListArraySchema(schema)) {
|
|
15895
|
-
return /* @__PURE__ */ jsx85(RepeatableSchema_default, __spreadProps(__spreadValues({}, props), { schema }));
|
|
15881
|
+
return /* @__PURE__ */ jsx85(RepeatableSchema_default, __spreadProps(__spreadValues({}, props), { errors, schema }));
|
|
15896
15882
|
}
|
|
15897
15883
|
throw new Error("Invalid array list schema");
|
|
15898
15884
|
}
|
|
15899
|
-
ArrayListSchema.defaultProps = {
|
|
15900
|
-
errors: null,
|
|
15901
|
-
required: false
|
|
15902
|
-
};
|
|
15903
15885
|
var ArrayListSchema_default = ArrayListSchema;
|
|
15904
15886
|
|
|
15905
15887
|
// src/legacy/jsonSchemaForm/arrayTypeSchema/ArraySchema.tsx
|
|
@@ -15911,9 +15893,6 @@ var ArraySchema = (props) => {
|
|
|
15911
15893
|
}
|
|
15912
15894
|
throw new Error("Not implemented");
|
|
15913
15895
|
};
|
|
15914
|
-
ArraySchema.defaultProps = {
|
|
15915
|
-
required: false
|
|
15916
|
-
};
|
|
15917
15896
|
var ArraySchema_default = ArraySchema;
|
|
15918
15897
|
|
|
15919
15898
|
// src/legacy/jsonSchemaForm/objectSchema/ObjectSchema.tsx
|
|
@@ -15927,6 +15906,7 @@ var getSchemaColumnClasses2 = (width) => ({
|
|
|
15927
15906
|
"col-sm-4": width === "sm"
|
|
15928
15907
|
});
|
|
15929
15908
|
function ObjectSchema(props) {
|
|
15909
|
+
const { disabled = false, hideTitle = false } = props;
|
|
15930
15910
|
const [model, setModel] = useState17(() => __spreadValues({}, getValidObjectModelParts(props.model, props.schema)));
|
|
15931
15911
|
const onChangeProperty = (propertyName, onChangeProps) => {
|
|
15932
15912
|
if (onChangeProps.model !== null) {
|
|
@@ -15959,8 +15939,8 @@ function ObjectSchema(props) {
|
|
|
15959
15939
|
return /* @__PURE__ */ jsxs31(Fragment13, { children: [
|
|
15960
15940
|
props.schema.alert && /* @__PURE__ */ jsx87(DynamicAlert_default, { component: props.schema.alert }),
|
|
15961
15941
|
/* @__PURE__ */ jsxs31("fieldset", { children: [
|
|
15962
|
-
props.schema.title && !
|
|
15963
|
-
props.schema.description && !
|
|
15942
|
+
props.schema.title && !hideTitle && /* @__PURE__ */ jsx87(Header10, { title: props.schema.title, as: "legend" }),
|
|
15943
|
+
props.schema.description && !hideTitle && /* @__PURE__ */ jsxs31("p", { children: [
|
|
15964
15944
|
" ",
|
|
15965
15945
|
props.schema.description,
|
|
15966
15946
|
" "
|
|
@@ -15979,7 +15959,7 @@ function ObjectSchema(props) {
|
|
|
15979
15959
|
errors: propsErrors == null ? void 0 : propsErrors[propertyName],
|
|
15980
15960
|
submitted: props.submitted,
|
|
15981
15961
|
required: isRequired(propertyName),
|
|
15982
|
-
disabled
|
|
15962
|
+
disabled,
|
|
15983
15963
|
onChange: (onChangeProps) => onChangeProperty(propertyName, onChangeProps),
|
|
15984
15964
|
onPersistAsync: props.onPersistAsync
|
|
15985
15965
|
}
|
|
@@ -15990,10 +15970,6 @@ function ObjectSchema(props) {
|
|
|
15990
15970
|
] })
|
|
15991
15971
|
] });
|
|
15992
15972
|
}
|
|
15993
|
-
ObjectSchema.defaultProps = {
|
|
15994
|
-
hideTitle: false,
|
|
15995
|
-
disabled: false
|
|
15996
|
-
};
|
|
15997
15973
|
var ObjectSchema_default = ObjectSchema;
|
|
15998
15974
|
|
|
15999
15975
|
// src/legacy/jsonSchemaForm/oneOfSchema/OneOfSchema.tsx
|
|
@@ -16740,8 +16716,8 @@ function SchemaFormControl(props) {
|
|
|
16740
16716
|
const {
|
|
16741
16717
|
id,
|
|
16742
16718
|
schema,
|
|
16743
|
-
value,
|
|
16744
|
-
disabled,
|
|
16719
|
+
value = null,
|
|
16720
|
+
disabled = false,
|
|
16745
16721
|
invalid,
|
|
16746
16722
|
required,
|
|
16747
16723
|
onChange,
|
|
@@ -16791,13 +16767,6 @@ function SchemaFormControl(props) {
|
|
|
16791
16767
|
};
|
|
16792
16768
|
return /* @__PURE__ */ jsx90("div", { "aria-describedby": describedBy, children: /* @__PURE__ */ jsx90(FormControl, __spreadValues(__spreadValues({ type: controlType, value: safeValue }, events), controlProps)) });
|
|
16793
16769
|
}
|
|
16794
|
-
SchemaFormControl.defaultProps = {
|
|
16795
|
-
value: null,
|
|
16796
|
-
onFocus: null,
|
|
16797
|
-
onBlur: null,
|
|
16798
|
-
onSearchChange: null,
|
|
16799
|
-
disabled: false
|
|
16800
|
-
};
|
|
16801
16770
|
var warnIfInvalidSchema = (schema, log, controlType) => {
|
|
16802
16771
|
if (isOneOfSchema2(schema) && schema.oneOf.length === 2 && !schema.control) {
|
|
16803
16772
|
log.warning(
|
|
@@ -16824,6 +16793,7 @@ function OneOfSchema(props) {
|
|
|
16824
16793
|
const [changed, setChanged] = useState18(false);
|
|
16825
16794
|
const [focused, setFocused] = useState18(false);
|
|
16826
16795
|
const [blurred, setBlurred] = useState18(false);
|
|
16796
|
+
const { disabled = false, required = false } = props;
|
|
16827
16797
|
const id = useMemo15(() => props.schema.$id || generateRandomId(), [props.schema.$id]);
|
|
16828
16798
|
const [schemaIndex, setSchemaIndex] = useState18(
|
|
16829
16799
|
getActiveSchemaIndex(props.schema, props.model)
|
|
@@ -16905,10 +16875,10 @@ function OneOfSchema(props) {
|
|
|
16905
16875
|
id,
|
|
16906
16876
|
schema: schemaForSelect,
|
|
16907
16877
|
value: schemaIndex,
|
|
16908
|
-
disabled
|
|
16878
|
+
disabled,
|
|
16909
16879
|
invalid: !isEmpty(props.errors) || validations.length > 0,
|
|
16910
16880
|
describedBy: feedbackId,
|
|
16911
|
-
required
|
|
16881
|
+
required,
|
|
16912
16882
|
onChange: onChooseNewSchema,
|
|
16913
16883
|
onFocus,
|
|
16914
16884
|
onBlur,
|
|
@@ -16939,7 +16909,7 @@ function OneOfSchema(props) {
|
|
|
16939
16909
|
errors: props.errors,
|
|
16940
16910
|
submitted: props.submitted,
|
|
16941
16911
|
hideTitle: true,
|
|
16942
|
-
disabled
|
|
16912
|
+
disabled,
|
|
16943
16913
|
onChange: (parameters) => onChildModelChange(schemaIndex, parameters),
|
|
16944
16914
|
onPersistAsync: props.onPersistAsync
|
|
16945
16915
|
}
|
|
@@ -16961,12 +16931,13 @@ function getTitleAndHelp(schema, forId) {
|
|
|
16961
16931
|
return schema.title ? titleElement : helpElement;
|
|
16962
16932
|
}
|
|
16963
16933
|
function getValidations(props, schemaIndex) {
|
|
16964
|
-
const
|
|
16934
|
+
const { schema, required = false } = props;
|
|
16935
|
+
const selectedSchema = schema.oneOf[schemaIndex != null ? schemaIndex : -1];
|
|
16965
16936
|
if (isConstSchema2(selectedSchema)) {
|
|
16966
|
-
return getValidationFailures(selectedSchema.const,
|
|
16937
|
+
return getValidationFailures(selectedSchema.const, schema, Boolean(required));
|
|
16967
16938
|
}
|
|
16968
16939
|
if (schemaIndex === null || schemaIndex < 0) {
|
|
16969
|
-
return getValidationFailures(null,
|
|
16940
|
+
return getValidationFailures(null, schema, Boolean(required));
|
|
16970
16941
|
}
|
|
16971
16942
|
return [];
|
|
16972
16943
|
}
|
|
@@ -16986,10 +16957,6 @@ function mapOneOfToConst(schema, index) {
|
|
|
16986
16957
|
const { title, description, disabled = false, icon, image, keywords } = schema;
|
|
16987
16958
|
return { title, description, disabled, icon, image, const: index, keywords };
|
|
16988
16959
|
}
|
|
16989
|
-
OneOfSchema.defaultProps = {
|
|
16990
|
-
required: false,
|
|
16991
|
-
disabled: false
|
|
16992
|
-
};
|
|
16993
16960
|
var OneOfSchema_default = OneOfSchema;
|
|
16994
16961
|
|
|
16995
16962
|
// src/legacy/jsonSchemaForm/persistAsyncSchema/persistAsyncBlobSchema/PersistAsyncBlobSchema.tsx
|
|
@@ -17057,7 +17024,7 @@ function UploadInputAdapter(props) {
|
|
|
17057
17024
|
// src/legacy/jsonSchemaForm/persistAsyncSchema/persistAsyncBlobSchema/PersistAsyncBlobSchema.tsx
|
|
17058
17025
|
import { jsx as jsx93, jsxs as jsxs33 } from "react/jsx-runtime";
|
|
17059
17026
|
function PersistAsyncBlobSchema(props) {
|
|
17060
|
-
const { model, schema, submitted, required, errors, onChange } = props;
|
|
17027
|
+
const { model, schema, submitted, required = false, errors, onChange } = props;
|
|
17061
17028
|
const [persistAsyncValidationMessages, setPersistAsyncValidationMessages] = useState19({});
|
|
17062
17029
|
const [persistAsyncValidations, setPersistAsyncValidations] = useState19(null);
|
|
17063
17030
|
const [validations, setValidations] = useState19([]);
|
|
@@ -17141,9 +17108,6 @@ function PersistAsyncBlobSchema(props) {
|
|
|
17141
17108
|
)
|
|
17142
17109
|
] });
|
|
17143
17110
|
}
|
|
17144
|
-
PersistAsyncBlobSchema.defaultProps = {
|
|
17145
|
-
required: false
|
|
17146
|
-
};
|
|
17147
17111
|
var PersistAsyncBlobSchema_default = PersistAsyncBlobSchema;
|
|
17148
17112
|
|
|
17149
17113
|
// src/legacy/jsonSchemaForm/persistAsyncSchema/PersistAsyncSchema.tsx
|
|
@@ -17159,9 +17123,6 @@ function PersistAsyncSchema(props) {
|
|
|
17159
17123
|
}
|
|
17160
17124
|
return /* @__PURE__ */ jsx94(PersistAsyncBasicSchema_default, __spreadValues({}, props));
|
|
17161
17125
|
}
|
|
17162
|
-
PersistAsyncSchema.defaultProps = {
|
|
17163
|
-
required: false
|
|
17164
|
-
};
|
|
17165
17126
|
var PersistAsyncSchema_default = PersistAsyncSchema;
|
|
17166
17127
|
|
|
17167
17128
|
// src/legacy/jsonSchemaForm/promotedOneOfSchema/PromotedOneOfSchema.tsx
|
|
@@ -17191,7 +17152,6 @@ var PromotedOneOfCheckboxControl = (props) => {
|
|
|
17191
17152
|
};
|
|
17192
17153
|
return /* @__PURE__ */ jsx95("div", { className: "form-group", children: /* @__PURE__ */ jsx95(Checkbox3, { id, label: title, checked, onChange: toggleSelection }) });
|
|
17193
17154
|
};
|
|
17194
|
-
PromotedOneOfCheckboxControl.defaultProps = {};
|
|
17195
17155
|
var PromotedOneOfCheckboxControl_default = PromotedOneOfCheckboxControl;
|
|
17196
17156
|
|
|
17197
17157
|
// src/legacy/jsonSchemaForm/promotedOneOfSchema/promotedOneOfControl/PromotedOneOfRadioControl.tsx
|
|
@@ -17375,7 +17335,7 @@ function getValueFromOption(option) {
|
|
|
17375
17335
|
import { useEffect as useEffect14, useRef as useRef3, useState as useState21 } from "react";
|
|
17376
17336
|
import { jsx as jsx100 } from "react/jsx-runtime";
|
|
17377
17337
|
function ValidationAsyncSchema(props) {
|
|
17378
|
-
const { schema, model, required, submitted, errors, onChange } = props;
|
|
17338
|
+
const { schema, model, required = false, submitted, errors, onChange } = props;
|
|
17379
17339
|
const [validationAsyncModel, setValidationAsyncModel] = useState21(model);
|
|
17380
17340
|
const previousRequestedModelReference = useRef3(null);
|
|
17381
17341
|
const [validationAsyncSuccessMessage, setValidationAsyncSuccessMessage] = useState21(
|
|
@@ -17459,7 +17419,6 @@ function ValidationAsyncSchema(props) {
|
|
|
17459
17419
|
};
|
|
17460
17420
|
return /* @__PURE__ */ jsx100(BasicTypeSchema_default, __spreadValues({}, basicTypeSchemaProps));
|
|
17461
17421
|
}
|
|
17462
|
-
ValidationAsyncSchema.defaultProps = { required: false };
|
|
17463
17422
|
var ValidationAsyncSchema_default = ValidationAsyncSchema;
|
|
17464
17423
|
|
|
17465
17424
|
// src/legacy/jsonSchemaForm/genericSchema/GenericSchema.tsx
|
|
@@ -18242,11 +18201,12 @@ var getDefaultValue = (schema) => {
|
|
|
18242
18201
|
};
|
|
18243
18202
|
var BasicTypeSchema = (props) => {
|
|
18244
18203
|
var _a, _b, _c;
|
|
18204
|
+
const { disabled = false, required = false } = props;
|
|
18245
18205
|
const onChange = (newModel, _type, metadata) => {
|
|
18246
18206
|
setChanged(true);
|
|
18247
18207
|
setModelAndBroadcast(sanitiseModel(newModel), "user", metadata);
|
|
18248
18208
|
};
|
|
18249
|
-
const getValidationKeys = (newModel) => getValidationFailures(newModel, props.schema,
|
|
18209
|
+
const getValidationKeys = (newModel) => getValidationFailures(newModel, props.schema, required);
|
|
18250
18210
|
const setModelAndBroadcast = (newModel, type, metadata) => {
|
|
18251
18211
|
setModel(newModel);
|
|
18252
18212
|
const validationKeys = getValidationKeys(newModel);
|
|
@@ -18326,7 +18286,7 @@ var BasicTypeSchema = (props) => {
|
|
|
18326
18286
|
id,
|
|
18327
18287
|
schema: props.schema,
|
|
18328
18288
|
value: model,
|
|
18329
|
-
disabled: !!
|
|
18289
|
+
disabled: !!disabled,
|
|
18330
18290
|
onChange,
|
|
18331
18291
|
onFocus,
|
|
18332
18292
|
onBlur,
|
|
@@ -18351,11 +18311,6 @@ var BasicTypeSchema = (props) => {
|
|
|
18351
18311
|
] })
|
|
18352
18312
|
] }) : null;
|
|
18353
18313
|
};
|
|
18354
|
-
BasicTypeSchema.defaultProps = {
|
|
18355
|
-
required: false,
|
|
18356
|
-
disabled: false,
|
|
18357
|
-
onBlur: null
|
|
18358
|
-
};
|
|
18359
18314
|
var BasicTypeSchema_default = BasicTypeSchema;
|
|
18360
18315
|
|
|
18361
18316
|
// src/legacy/jsonSchemaForm/persistAsyncSchema/persistAsyncBasicSchema/PersistAsyncBasicSchema.tsx
|
|
@@ -18373,7 +18328,7 @@ var controlTypesWithPersistOnChange = /* @__PURE__ */ new Set([
|
|
|
18373
18328
|
FormControlType.UPLOAD
|
|
18374
18329
|
]);
|
|
18375
18330
|
function PersistAsyncBasicSchema(props) {
|
|
18376
|
-
const { schema, required, submitted, errors, onChange, onPersistAsync } = props;
|
|
18331
|
+
const { schema, required = false, submitted, errors, onChange, onPersistAsync } = props;
|
|
18377
18332
|
const intl = useIntl23();
|
|
18378
18333
|
const httpClient = useHttpClient();
|
|
18379
18334
|
const onEvent = useEventDispatcher();
|
|
@@ -18463,9 +18418,6 @@ function PersistAsyncBasicSchema(props) {
|
|
|
18463
18418
|
}
|
|
18464
18419
|
);
|
|
18465
18420
|
}
|
|
18466
|
-
PersistAsyncBasicSchema.defaultProps = {
|
|
18467
|
-
required: false
|
|
18468
|
-
};
|
|
18469
18421
|
var PersistAsyncBasicSchema_default = PersistAsyncBasicSchema;
|
|
18470
18422
|
|
|
18471
18423
|
// src/legacy/common/hooks/usePersistAsync/usePersistAsync.ts
|
|
@@ -1,11 +1,6 @@
|
|
|
1
1
|
import type { AllOfSchema as AllOfSchemaType, ObjectModel } from '@wise/dynamic-flow-types';
|
|
2
2
|
import type { GenericSchemaProps } from '../genericSchema/GenericSchema';
|
|
3
3
|
declare function AllOfSchema(props: AllOfSchemaProps): import("react/jsx-runtime").JSX.Element;
|
|
4
|
-
declare namespace AllOfSchema {
|
|
5
|
-
var defaultProps: {
|
|
6
|
-
disabled: boolean;
|
|
7
|
-
};
|
|
8
|
-
}
|
|
9
4
|
export type AllOfSchemaProps = Omit<GenericSchemaProps, 'schema' | 'model'> & {
|
|
10
5
|
schema: AllOfSchemaType;
|
|
11
6
|
model: ObjectModel;
|
|
@@ -1,11 +1,6 @@
|
|
|
1
1
|
import { ArrayModel, ArraySchema as ArraySchemaType } from '@wise/dynamic-flow-types';
|
|
2
2
|
import { GenericSchemaProps } from '../genericSchema/GenericSchema';
|
|
3
|
-
declare const ArraySchema:
|
|
4
|
-
(props: ArraySchemaProps): import("react/jsx-runtime").JSX.Element;
|
|
5
|
-
defaultProps: {
|
|
6
|
-
required: boolean;
|
|
7
|
-
};
|
|
8
|
-
};
|
|
3
|
+
declare const ArraySchema: (props: ArraySchemaProps) => import("react/jsx-runtime").JSX.Element;
|
|
9
4
|
export type ArraySchemaProps = GenericSchemaProps & {
|
|
10
5
|
schema: ArraySchemaType;
|
|
11
6
|
model: ArrayModel | null;
|
package/build/types/legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/ArrayListSchema.d.ts
CHANGED
|
@@ -6,10 +6,4 @@ type ArrayListSchemaProps = GenericSchemaProps & {
|
|
|
6
6
|
model: ArrayModel | null;
|
|
7
7
|
};
|
|
8
8
|
declare function ArrayListSchema(props: ArrayListSchemaProps): import("react/jsx-runtime").JSX.Element;
|
|
9
|
-
declare namespace ArrayListSchema {
|
|
10
|
-
var defaultProps: {
|
|
11
|
-
errors: null;
|
|
12
|
-
required: boolean;
|
|
13
|
-
};
|
|
14
|
-
}
|
|
15
9
|
export default ArrayListSchema;
|
|
@@ -1,12 +1,6 @@
|
|
|
1
1
|
import type { ArrayModel, MultipleFileUploadSchema as MultipleFileUploadSchemaType } from '@wise/dynamic-flow-types';
|
|
2
2
|
import type { GenericSchemaProps } from '../../../genericSchema/GenericSchema';
|
|
3
3
|
declare function MultipleFileUploadSchema(props: Props): import("react/jsx-runtime").JSX.Element;
|
|
4
|
-
declare namespace MultipleFileUploadSchema {
|
|
5
|
-
var defaultProps: {
|
|
6
|
-
errors: null;
|
|
7
|
-
required: boolean;
|
|
8
|
-
};
|
|
9
|
-
}
|
|
10
4
|
type Props = Omit<GenericSchemaProps, 'model'> & {
|
|
11
5
|
schema: MultipleFileUploadSchemaType;
|
|
12
6
|
model: ArrayModel | null;
|
|
@@ -1,14 +1,7 @@
|
|
|
1
1
|
import { BasicModel, BasicSchema } from '@wise/dynamic-flow-types';
|
|
2
2
|
import { OnChange } from '../JsonSchemaForm';
|
|
3
3
|
import { GenericSchemaProps } from '../genericSchema/GenericSchema';
|
|
4
|
-
declare const BasicTypeSchema:
|
|
5
|
-
(props: BasicTypeSchemaProps): import("react/jsx-runtime").JSX.Element | null;
|
|
6
|
-
defaultProps: {
|
|
7
|
-
required: boolean;
|
|
8
|
-
disabled: boolean;
|
|
9
|
-
onBlur: null;
|
|
10
|
-
};
|
|
11
|
-
};
|
|
4
|
+
declare const BasicTypeSchema: (props: BasicTypeSchemaProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
12
5
|
export type BasicTypeSchemaProps = Omit<GenericSchemaProps, 'schema' | 'model' | 'onChange' | 'errors' | 'onPersistAsync'> & {
|
|
13
6
|
schema: BasicSchema;
|
|
14
7
|
model: BasicModel | null;
|
|
@@ -1,13 +1,5 @@
|
|
|
1
1
|
import type { Schema } from '@wise/dynamic-flow-types';
|
|
2
2
|
declare function ControlFeedback(props: ControlFeedbackProps): import("react/jsx-runtime").JSX.Element;
|
|
3
|
-
declare namespace ControlFeedback {
|
|
4
|
-
var defaultProps: {
|
|
5
|
-
errors: string;
|
|
6
|
-
validations: never[];
|
|
7
|
-
validationMessages: {};
|
|
8
|
-
validationAsyncSuccessMessage: null;
|
|
9
|
-
};
|
|
10
|
-
}
|
|
11
3
|
type ValidationMessages = {
|
|
12
4
|
minimum?: string;
|
|
13
5
|
maximum?: string;
|
|
@@ -1,12 +1,6 @@
|
|
|
1
1
|
import type { ObjectModel, ObjectSchema as ObjectSchemaType } from '@wise/dynamic-flow-types';
|
|
2
2
|
import type { GenericSchemaProps } from '../genericSchema/GenericSchema';
|
|
3
3
|
declare function ObjectSchema(props: ObjectSchemaProps): import("react/jsx-runtime").JSX.Element;
|
|
4
|
-
declare namespace ObjectSchema {
|
|
5
|
-
var defaultProps: {
|
|
6
|
-
hideTitle: boolean;
|
|
7
|
-
disabled: boolean;
|
|
8
|
-
};
|
|
9
|
-
}
|
|
10
4
|
export type ObjectSchemaProps = GenericSchemaProps & {
|
|
11
5
|
schema: ObjectSchemaType;
|
|
12
6
|
model: ObjectModel | null;
|
|
@@ -1,12 +1,6 @@
|
|
|
1
1
|
import type { OneOfSchema as OneOfSchemaType } from '@wise/dynamic-flow-types';
|
|
2
2
|
import type { GenericSchemaProps } from '../genericSchema/GenericSchema';
|
|
3
3
|
declare function OneOfSchema(props: OneOfSchemaProps): import("react/jsx-runtime").JSX.Element | null;
|
|
4
|
-
declare namespace OneOfSchema {
|
|
5
|
-
var defaultProps: {
|
|
6
|
-
required: boolean;
|
|
7
|
-
disabled: boolean;
|
|
8
|
-
};
|
|
9
|
-
}
|
|
10
4
|
export type OneOfSchemaProps = Omit<GenericSchemaProps, 'schema'> & {
|
|
11
5
|
schema: OneOfSchemaType;
|
|
12
6
|
required?: boolean;
|
|
@@ -1,11 +1,6 @@
|
|
|
1
1
|
import type { PersistAsyncSchema as PersistAsyncSchemaType } from '@wise/dynamic-flow-types';
|
|
2
2
|
import type { GenericSchemaProps } from '../genericSchema/GenericSchema';
|
|
3
3
|
declare function PersistAsyncSchema(props: PersistAsyncSchemaProps): import("react/jsx-runtime").JSX.Element;
|
|
4
|
-
declare namespace PersistAsyncSchema {
|
|
5
|
-
var defaultProps: {
|
|
6
|
-
required: boolean;
|
|
7
|
-
};
|
|
8
|
-
}
|
|
9
4
|
export type PersistAsyncSchemaProps = Omit<GenericSchemaProps, 'schema' | 'model' | 'errors'> & {
|
|
10
5
|
schema: PersistAsyncSchemaType;
|
|
11
6
|
model: string | null;
|
|
@@ -5,11 +5,6 @@ export declare const getErrorFromResponse: (errorProperty: string, response: {
|
|
|
5
5
|
validation?: Record<string, unknown>;
|
|
6
6
|
}) => unknown;
|
|
7
7
|
declare function PersistAsyncBasicSchema(props: PersistAsyncBasicSchemaProps): import("react/jsx-runtime").JSX.Element;
|
|
8
|
-
declare namespace PersistAsyncBasicSchema {
|
|
9
|
-
var defaultProps: {
|
|
10
|
-
required: boolean;
|
|
11
|
-
};
|
|
12
|
-
}
|
|
13
8
|
type PersistAsyncBasicSchemaProps = Omit<GenericSchemaProps, 'schema'> & {
|
|
14
9
|
schema: Schema & {
|
|
15
10
|
persistAsync: PersistAsync;
|
|
@@ -1,11 +1,6 @@
|
|
|
1
1
|
import type { BlobSchema, PersistAsync, Schema } from '@wise/dynamic-flow-types';
|
|
2
2
|
import type { GenericSchemaProps } from '../../genericSchema/GenericSchema';
|
|
3
3
|
declare function PersistAsyncBlobSchema(props: PersistAsyncBlobSchemaProps): import("react/jsx-runtime").JSX.Element;
|
|
4
|
-
declare namespace PersistAsyncBlobSchema {
|
|
5
|
-
var defaultProps: {
|
|
6
|
-
required: boolean;
|
|
7
|
-
};
|
|
8
|
-
}
|
|
9
4
|
type PersistAsyncBlobSchemaProps = Omit<GenericSchemaProps, 'model'> & {
|
|
10
5
|
schema: Schema & {
|
|
11
6
|
persistAsync: PersistAsync & {
|
|
@@ -1,6 +1,3 @@
|
|
|
1
1
|
import { PromotedOneOfControlProps } from './PromotedOneOfControl';
|
|
2
|
-
declare const PromotedOneOfCheckboxControl:
|
|
3
|
-
(props: PromotedOneOfControlProps): import("react/jsx-runtime").JSX.Element;
|
|
4
|
-
defaultProps: {};
|
|
5
|
-
};
|
|
2
|
+
declare const PromotedOneOfCheckboxControl: (props: PromotedOneOfControlProps) => import("react/jsx-runtime").JSX.Element;
|
|
6
3
|
export default PromotedOneOfCheckboxControl;
|
|
@@ -4,15 +4,6 @@ import type { OnChangeProps } from '../JsonSchemaForm';
|
|
|
4
4
|
export declare const getControlType: (schema: Schema) => (typeof FormControlType)[keyof typeof FormControlType] | undefined;
|
|
5
5
|
export declare const getStringSchemaControlType: ({ format, control, displayFormat, }: StringSchema) => (typeof FormControlType)[keyof typeof FormControlType] | undefined;
|
|
6
6
|
declare function SchemaFormControl(props: SchemaFormControlProps): import("react/jsx-runtime").JSX.Element;
|
|
7
|
-
declare namespace SchemaFormControl {
|
|
8
|
-
var defaultProps: {
|
|
9
|
-
value: null;
|
|
10
|
-
onFocus: null;
|
|
11
|
-
onBlur: null;
|
|
12
|
-
onSearchChange: null;
|
|
13
|
-
disabled: boolean;
|
|
14
|
-
};
|
|
15
|
-
}
|
|
16
7
|
export type SchemaFormControlProps = {
|
|
17
8
|
id: string;
|
|
18
9
|
value: BasicModel | null;
|
|
@@ -1,11 +1,6 @@
|
|
|
1
1
|
import type { BasicModel, ValidationAsyncSchema as ValidationAsyncSchemaType } from '@wise/dynamic-flow-types';
|
|
2
2
|
import type { GenericSchemaProps } from '../genericSchema/GenericSchema';
|
|
3
3
|
declare function ValidationAsyncSchema(props: ValidationAsyncSchemaProps): import("react/jsx-runtime").JSX.Element;
|
|
4
|
-
declare namespace ValidationAsyncSchema {
|
|
5
|
-
var defaultProps: {
|
|
6
|
-
required: boolean;
|
|
7
|
-
};
|
|
8
|
-
}
|
|
9
4
|
export type ValidationAsyncSchemaProps = Omit<GenericSchemaProps, 'schema' | 'model' | 'errors'> & {
|
|
10
5
|
schema: ValidationAsyncSchemaType;
|
|
11
6
|
model: BasicModel | null;
|