@wise/dynamic-flow-client 3.20.0 → 3.20.2
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 +74 -114
- package/build/main.min.js +1 -1
- package/build/main.mjs +74 -114
- 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 +17 -18
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,
|
|
@@ -6121,12 +6123,6 @@ var decisionLayoutOptionSchema = z.object({
|
|
|
6121
6123
|
icon: iconSchema.optional(),
|
|
6122
6124
|
image: imageLayoutSchema.optional()
|
|
6123
6125
|
});
|
|
6124
|
-
var statusListLayoutItemSchema = z.object({
|
|
6125
|
-
title: z.string(),
|
|
6126
|
-
description: z.string().optional(),
|
|
6127
|
-
icon: iconSchema,
|
|
6128
|
-
status: statusListLayoutStatusSchema.optional()
|
|
6129
|
-
});
|
|
6130
6126
|
var instructionsLayoutSchema = z.object({
|
|
6131
6127
|
type: z.literal("instructions"),
|
|
6132
6128
|
title: z.string().optional(),
|
|
@@ -6134,6 +6130,10 @@ var instructionsLayoutSchema = z.object({
|
|
|
6134
6130
|
control: z.string().optional(),
|
|
6135
6131
|
margin: sizeSchema.optional()
|
|
6136
6132
|
});
|
|
6133
|
+
var behaviorSchema = z.object({
|
|
6134
|
+
action: actionSchema.optional(),
|
|
6135
|
+
link: linkSchema.optional()
|
|
6136
|
+
});
|
|
6137
6137
|
var buttonLayoutSchema = z.object({
|
|
6138
6138
|
type: z.literal("button"),
|
|
6139
6139
|
size: sizeSchema.optional(),
|
|
@@ -6150,10 +6150,6 @@ var reviewLayoutFieldSchema = z.object({
|
|
|
6150
6150
|
value: z.string(),
|
|
6151
6151
|
help: helpSchema.optional()
|
|
6152
6152
|
});
|
|
6153
|
-
var behaviorSchema = z.object({
|
|
6154
|
-
action: actionSchema.optional(),
|
|
6155
|
-
link: linkSchema.optional()
|
|
6156
|
-
});
|
|
6157
6153
|
var searchResultSearchSchema = z.object({
|
|
6158
6154
|
type: z.literal("search"),
|
|
6159
6155
|
title: z.string(),
|
|
@@ -6214,12 +6210,10 @@ var decisionLayoutSchema = z.object({
|
|
|
6214
6210
|
control: z.string().optional(),
|
|
6215
6211
|
margin: sizeSchema.optional()
|
|
6216
6212
|
});
|
|
6217
|
-
var
|
|
6218
|
-
|
|
6219
|
-
|
|
6220
|
-
|
|
6221
|
-
control: z.string().optional(),
|
|
6222
|
-
margin: sizeSchema.optional()
|
|
6213
|
+
var itemCallToActionSchema = z.object({
|
|
6214
|
+
title: z.string(),
|
|
6215
|
+
accessibilityDescription: z.string().optional(),
|
|
6216
|
+
behavior: behaviorSchema
|
|
6223
6217
|
});
|
|
6224
6218
|
var reviewLayoutSchema = z.object({
|
|
6225
6219
|
type: z.literal("review"),
|
|
@@ -6253,6 +6247,13 @@ var alertLayoutSchema = z.object({
|
|
|
6253
6247
|
margin: sizeSchema.optional(),
|
|
6254
6248
|
callToAction: alertLayoutCallToActionSchema.optional()
|
|
6255
6249
|
});
|
|
6250
|
+
var statusListLayoutItemSchema = z.object({
|
|
6251
|
+
title: z.string(),
|
|
6252
|
+
description: z.string().optional(),
|
|
6253
|
+
icon: iconSchema,
|
|
6254
|
+
status: statusListLayoutStatusSchema.optional(),
|
|
6255
|
+
callToAction: itemCallToActionSchema.optional()
|
|
6256
|
+
});
|
|
6256
6257
|
var searchResponseBodySchema = z.object({
|
|
6257
6258
|
results: z.array(searchResultSchema)
|
|
6258
6259
|
});
|
|
@@ -6294,6 +6295,13 @@ var constSchemaSchema = z.object({
|
|
|
6294
6295
|
analyticsId: z.string().optional(),
|
|
6295
6296
|
disabled: z.boolean().optional()
|
|
6296
6297
|
});
|
|
6298
|
+
var statusListLayoutSchema = z.object({
|
|
6299
|
+
type: z.literal("status-list"),
|
|
6300
|
+
items: z.array(statusListLayoutItemSchema),
|
|
6301
|
+
title: z.string().optional(),
|
|
6302
|
+
control: z.string().optional(),
|
|
6303
|
+
margin: sizeSchema.optional()
|
|
6304
|
+
});
|
|
6297
6305
|
var layoutSchema = z.lazy(
|
|
6298
6306
|
() => z.union([
|
|
6299
6307
|
alertLayoutSchema,
|
|
@@ -11396,8 +11404,8 @@ var DateInputRenderer_default = DateInputRenderer;
|
|
|
11396
11404
|
// ../renderers/src/DecisionRenderer.tsx
|
|
11397
11405
|
import { NavigationOptionsList, NavigationOption, Header } from "@transferwise/components";
|
|
11398
11406
|
|
|
11399
|
-
// ../../node_modules/.pnpm/@wise+art@2.
|
|
11400
|
-
|
|
11407
|
+
// ../../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
|
|
11408
|
+
init_index_a91e5689_esm();
|
|
11401
11409
|
init_clsx();
|
|
11402
11410
|
import "react";
|
|
11403
11411
|
import "react/jsx-runtime";
|
|
@@ -14912,6 +14920,7 @@ var getSchemaColumnClasses = (width) => ({
|
|
|
14912
14920
|
"col-sm-4": width === "sm"
|
|
14913
14921
|
});
|
|
14914
14922
|
function AllOfSchema(props) {
|
|
14923
|
+
const { disabled = false } = props;
|
|
14915
14924
|
const onChangeModelIndex = (index, onChangeProps) => {
|
|
14916
14925
|
const modelSchema = props.schema.allOf[index];
|
|
14917
14926
|
models[index] = getValidObjectModelParts(onChangeProps.model, modelSchema) || {};
|
|
@@ -14931,7 +14940,7 @@ function AllOfSchema(props) {
|
|
|
14931
14940
|
model: models[index],
|
|
14932
14941
|
errors: props.errors,
|
|
14933
14942
|
submitted: props.submitted,
|
|
14934
|
-
disabled
|
|
14943
|
+
disabled,
|
|
14935
14944
|
onChange: (onChangeProps) => onChangeModelIndex(index, __spreadProps(__spreadValues({}, onChangeProps), {
|
|
14936
14945
|
// We can safely assume that the model here is going to be of the same type as the model prop
|
|
14937
14946
|
model: onChangeProps.model
|
|
@@ -14942,9 +14951,6 @@ function AllOfSchema(props) {
|
|
|
14942
14951
|
)) })
|
|
14943
14952
|
] });
|
|
14944
14953
|
}
|
|
14945
|
-
AllOfSchema.defaultProps = {
|
|
14946
|
-
disabled: false
|
|
14947
|
-
};
|
|
14948
14954
|
var AllOfSchema_default = AllOfSchema;
|
|
14949
14955
|
|
|
14950
14956
|
// src/legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/MultipleFileUploadSchema.tsx
|
|
@@ -14961,28 +14967,22 @@ import { formatDate as formatDate3 } from "@transferwise/formatting";
|
|
|
14961
14967
|
import { useIntl as useIntl11 } from "react-intl";
|
|
14962
14968
|
import { jsx as jsx78, jsxs as jsxs27 } from "react/jsx-runtime";
|
|
14963
14969
|
function ControlFeedback(props) {
|
|
14964
|
-
|
|
14970
|
+
const { errors = "", validations = [], validationMessages = {} } = props;
|
|
14965
14971
|
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(
|
|
14972
|
+
const mergedValidationMessages = __spreadValues(__spreadValues(__spreadValues({}, defaultValidationMessages), validationMessages), props.schema.validationMessages);
|
|
14973
|
+
const isErrorVisible = (props.submitted || !props.changed) && Boolean(errors);
|
|
14974
|
+
const isValidationVisible = !isErrorVisible && (props.submitted || props.changed && props.blurred) && Boolean(validations == null ? void 0 : validations.length);
|
|
14969
14975
|
const isDescriptionVisible = props.schema.type !== "boolean" && props.schema.description && !isErrorVisible && !isValidationVisible;
|
|
14970
14976
|
const hasInfoMessage = Boolean(props.infoMessage);
|
|
14971
14977
|
return /* @__PURE__ */ jsxs27("div", { id: props.id, children: [
|
|
14972
|
-
isErrorVisible ? /* @__PURE__ */ jsx78(InlineAlert3, { type: "error", children:
|
|
14973
|
-
isValidationVisible ? /* @__PURE__ */ jsx78(InlineAlert3, { type: "error", children:
|
|
14978
|
+
isErrorVisible ? /* @__PURE__ */ jsx78(InlineAlert3, { type: "error", children: errors }) : null,
|
|
14979
|
+
isValidationVisible ? /* @__PURE__ */ jsx78(InlineAlert3, { type: "error", children: validations.map((validation) => /* @__PURE__ */ jsx78("div", { children: mergedValidationMessages[validation] }, validation)) }) : null,
|
|
14974
14980
|
(isDescriptionVisible || hasInfoMessage) && /* @__PURE__ */ jsxs27(InlineAlert3, { type: "info", children: [
|
|
14975
14981
|
isDescriptionVisible && /* @__PURE__ */ jsx78("div", { children: props.schema.description }),
|
|
14976
14982
|
hasInfoMessage && /* @__PURE__ */ jsx78("div", { children: props.infoMessage })
|
|
14977
14983
|
] })
|
|
14978
14984
|
] });
|
|
14979
14985
|
}
|
|
14980
|
-
ControlFeedback.defaultProps = {
|
|
14981
|
-
errors: "",
|
|
14982
|
-
validations: [],
|
|
14983
|
-
validationMessages: {},
|
|
14984
|
-
validationAsyncSuccessMessage: null
|
|
14985
|
-
};
|
|
14986
14986
|
function useDefaultValidationMessages(schema) {
|
|
14987
14987
|
const { formatMessage, locale } = useIntl11();
|
|
14988
14988
|
const formattedMessages = {
|
|
@@ -15102,7 +15102,7 @@ function useFormattedDefaultErrorMessages({
|
|
|
15102
15102
|
import { jsx as jsx79, jsxs as jsxs28 } from "react/jsx-runtime";
|
|
15103
15103
|
function MultipleFileUploadSchema(props) {
|
|
15104
15104
|
var _a, _b;
|
|
15105
|
-
const { onChange, schema } = props;
|
|
15105
|
+
const { onChange, errors = null, schema, required = false } = props;
|
|
15106
15106
|
const onEvent = useEventDispatcher();
|
|
15107
15107
|
const defaultErrorMessages = useFormattedDefaultErrorMessages(schema);
|
|
15108
15108
|
const uid = useMemo12(() => schema.$id || generateRandomId(), [schema.$id]);
|
|
@@ -15139,8 +15139,8 @@ function MultipleFileUploadSchema(props) {
|
|
|
15139
15139
|
}
|
|
15140
15140
|
const validFiles = getSuccessfullyProcessedFiles(files);
|
|
15141
15141
|
const fileIds = validFiles.map((file) => file.id);
|
|
15142
|
-
const fileListValidationFailures = getArrayValidationFailures(fileIds, schema,
|
|
15143
|
-
const showError = Boolean(
|
|
15142
|
+
const fileListValidationFailures = getArrayValidationFailures(fileIds, schema, required);
|
|
15143
|
+
const showError = Boolean(errors) || (inputChanged || props.submitted) && Boolean(fileListValidationFailures.length);
|
|
15144
15144
|
const accepts = "accepts" in fileSchemaDescriptor && fileSchemaDescriptor.accepts;
|
|
15145
15145
|
const maxSize = "maxSize" in fileSchemaDescriptor && fileSchemaDescriptor.maxSize;
|
|
15146
15146
|
const uploadInputProps = __spreadProps(__spreadValues(__spreadValues({
|
|
@@ -15169,14 +15169,10 @@ function MultipleFileUploadSchema(props) {
|
|
|
15169
15169
|
id: feedbackId,
|
|
15170
15170
|
changed: inputChanged,
|
|
15171
15171
|
submitted: props.submitted,
|
|
15172
|
-
errors
|
|
15172
|
+
errors,
|
|
15173
15173
|
schema: props.schema,
|
|
15174
15174
|
validations: fileListValidationFailures,
|
|
15175
|
-
validationMessages: getValidationMessages(
|
|
15176
|
-
schema,
|
|
15177
|
-
Boolean(props.required),
|
|
15178
|
-
defaultErrorMessages
|
|
15179
|
-
),
|
|
15175
|
+
validationMessages: getValidationMessages(schema, Boolean(required), defaultErrorMessages),
|
|
15180
15176
|
infoMessage: null,
|
|
15181
15177
|
focused: false,
|
|
15182
15178
|
blurred: true
|
|
@@ -15184,10 +15180,6 @@ function MultipleFileUploadSchema(props) {
|
|
|
15184
15180
|
)
|
|
15185
15181
|
] });
|
|
15186
15182
|
}
|
|
15187
|
-
MultipleFileUploadSchema.defaultProps = {
|
|
15188
|
-
errors: null,
|
|
15189
|
-
required: false
|
|
15190
|
-
};
|
|
15191
15183
|
var MultipleFileUploadSchema_default = MultipleFileUploadSchema;
|
|
15192
15184
|
function getSuccessfullyProcessedFiles(allFiles) {
|
|
15193
15185
|
return allFiles.filter((file) => !file.error && file.status === "succeeded");
|
|
@@ -15884,22 +15876,18 @@ var RepeatableSchema_default = RepeatableSchema;
|
|
|
15884
15876
|
// src/legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/ArrayListSchema.tsx
|
|
15885
15877
|
import { jsx as jsx85 } from "react/jsx-runtime";
|
|
15886
15878
|
function ArrayListSchema(props) {
|
|
15887
|
-
const { schema } = props;
|
|
15879
|
+
const { errors = null, schema } = props;
|
|
15888
15880
|
if (isMultipleFileUploadSchema(schema)) {
|
|
15889
|
-
return /* @__PURE__ */ jsx85(MultipleFileUploadSchema_default, __spreadProps(__spreadValues({}, props), { schema }));
|
|
15881
|
+
return /* @__PURE__ */ jsx85(MultipleFileUploadSchema_default, __spreadProps(__spreadValues({}, props), { errors, schema }));
|
|
15890
15882
|
}
|
|
15891
15883
|
if (isMultiSelectConstSchema(schema)) {
|
|
15892
|
-
return /* @__PURE__ */ jsx85(MultiSelectSchema, __spreadProps(__spreadValues({}, props), { schema }));
|
|
15884
|
+
return /* @__PURE__ */ jsx85(MultiSelectSchema, __spreadProps(__spreadValues({}, props), { errors, schema }));
|
|
15893
15885
|
}
|
|
15894
15886
|
if (isListArraySchema(schema)) {
|
|
15895
|
-
return /* @__PURE__ */ jsx85(RepeatableSchema_default, __spreadProps(__spreadValues({}, props), { schema }));
|
|
15887
|
+
return /* @__PURE__ */ jsx85(RepeatableSchema_default, __spreadProps(__spreadValues({}, props), { errors, schema }));
|
|
15896
15888
|
}
|
|
15897
15889
|
throw new Error("Invalid array list schema");
|
|
15898
15890
|
}
|
|
15899
|
-
ArrayListSchema.defaultProps = {
|
|
15900
|
-
errors: null,
|
|
15901
|
-
required: false
|
|
15902
|
-
};
|
|
15903
15891
|
var ArrayListSchema_default = ArrayListSchema;
|
|
15904
15892
|
|
|
15905
15893
|
// src/legacy/jsonSchemaForm/arrayTypeSchema/ArraySchema.tsx
|
|
@@ -15911,9 +15899,6 @@ var ArraySchema = (props) => {
|
|
|
15911
15899
|
}
|
|
15912
15900
|
throw new Error("Not implemented");
|
|
15913
15901
|
};
|
|
15914
|
-
ArraySchema.defaultProps = {
|
|
15915
|
-
required: false
|
|
15916
|
-
};
|
|
15917
15902
|
var ArraySchema_default = ArraySchema;
|
|
15918
15903
|
|
|
15919
15904
|
// src/legacy/jsonSchemaForm/objectSchema/ObjectSchema.tsx
|
|
@@ -15927,6 +15912,7 @@ var getSchemaColumnClasses2 = (width) => ({
|
|
|
15927
15912
|
"col-sm-4": width === "sm"
|
|
15928
15913
|
});
|
|
15929
15914
|
function ObjectSchema(props) {
|
|
15915
|
+
const { disabled = false, hideTitle = false } = props;
|
|
15930
15916
|
const [model, setModel] = useState17(() => __spreadValues({}, getValidObjectModelParts(props.model, props.schema)));
|
|
15931
15917
|
const onChangeProperty = (propertyName, onChangeProps) => {
|
|
15932
15918
|
if (onChangeProps.model !== null) {
|
|
@@ -15959,8 +15945,8 @@ function ObjectSchema(props) {
|
|
|
15959
15945
|
return /* @__PURE__ */ jsxs31(Fragment13, { children: [
|
|
15960
15946
|
props.schema.alert && /* @__PURE__ */ jsx87(DynamicAlert_default, { component: props.schema.alert }),
|
|
15961
15947
|
/* @__PURE__ */ jsxs31("fieldset", { children: [
|
|
15962
|
-
props.schema.title && !
|
|
15963
|
-
props.schema.description && !
|
|
15948
|
+
props.schema.title && !hideTitle && /* @__PURE__ */ jsx87(Header10, { title: props.schema.title, as: "legend" }),
|
|
15949
|
+
props.schema.description && !hideTitle && /* @__PURE__ */ jsxs31("p", { children: [
|
|
15964
15950
|
" ",
|
|
15965
15951
|
props.schema.description,
|
|
15966
15952
|
" "
|
|
@@ -15979,7 +15965,7 @@ function ObjectSchema(props) {
|
|
|
15979
15965
|
errors: propsErrors == null ? void 0 : propsErrors[propertyName],
|
|
15980
15966
|
submitted: props.submitted,
|
|
15981
15967
|
required: isRequired(propertyName),
|
|
15982
|
-
disabled
|
|
15968
|
+
disabled,
|
|
15983
15969
|
onChange: (onChangeProps) => onChangeProperty(propertyName, onChangeProps),
|
|
15984
15970
|
onPersistAsync: props.onPersistAsync
|
|
15985
15971
|
}
|
|
@@ -15990,10 +15976,6 @@ function ObjectSchema(props) {
|
|
|
15990
15976
|
] })
|
|
15991
15977
|
] });
|
|
15992
15978
|
}
|
|
15993
|
-
ObjectSchema.defaultProps = {
|
|
15994
|
-
hideTitle: false,
|
|
15995
|
-
disabled: false
|
|
15996
|
-
};
|
|
15997
15979
|
var ObjectSchema_default = ObjectSchema;
|
|
15998
15980
|
|
|
15999
15981
|
// src/legacy/jsonSchemaForm/oneOfSchema/OneOfSchema.tsx
|
|
@@ -16335,7 +16317,7 @@ var _FormControl = class _FormControl extends PureComponent {
|
|
|
16335
16317
|
UNSAFE_inputAttributes: {
|
|
16336
16318
|
id,
|
|
16337
16319
|
"aria-invalid": invalid,
|
|
16338
|
-
"aria-labelledby":
|
|
16320
|
+
"aria-labelledby": labelledBy,
|
|
16339
16321
|
"aria-describedby": describedBy
|
|
16340
16322
|
},
|
|
16341
16323
|
onChange: this.handleOnChange
|
|
@@ -16367,7 +16349,7 @@ var _FormControl = class _FormControl extends PureComponent {
|
|
|
16367
16349
|
UNSAFE_triggerButtonProps: {
|
|
16368
16350
|
id,
|
|
16369
16351
|
"aria-invalid": invalid,
|
|
16370
|
-
"aria-labelledby":
|
|
16352
|
+
"aria-labelledby": labelledBy,
|
|
16371
16353
|
"aria-describedby": describedBy
|
|
16372
16354
|
},
|
|
16373
16355
|
items: items.map((value2) => ({
|
|
@@ -16740,8 +16722,8 @@ function SchemaFormControl(props) {
|
|
|
16740
16722
|
const {
|
|
16741
16723
|
id,
|
|
16742
16724
|
schema,
|
|
16743
|
-
value,
|
|
16744
|
-
disabled,
|
|
16725
|
+
value = null,
|
|
16726
|
+
disabled = false,
|
|
16745
16727
|
invalid,
|
|
16746
16728
|
required,
|
|
16747
16729
|
onChange,
|
|
@@ -16791,13 +16773,6 @@ function SchemaFormControl(props) {
|
|
|
16791
16773
|
};
|
|
16792
16774
|
return /* @__PURE__ */ jsx90("div", { "aria-describedby": describedBy, children: /* @__PURE__ */ jsx90(FormControl, __spreadValues(__spreadValues({ type: controlType, value: safeValue }, events), controlProps)) });
|
|
16793
16775
|
}
|
|
16794
|
-
SchemaFormControl.defaultProps = {
|
|
16795
|
-
value: null,
|
|
16796
|
-
onFocus: null,
|
|
16797
|
-
onBlur: null,
|
|
16798
|
-
onSearchChange: null,
|
|
16799
|
-
disabled: false
|
|
16800
|
-
};
|
|
16801
16776
|
var warnIfInvalidSchema = (schema, log, controlType) => {
|
|
16802
16777
|
if (isOneOfSchema2(schema) && schema.oneOf.length === 2 && !schema.control) {
|
|
16803
16778
|
log.warning(
|
|
@@ -16824,6 +16799,7 @@ function OneOfSchema(props) {
|
|
|
16824
16799
|
const [changed, setChanged] = useState18(false);
|
|
16825
16800
|
const [focused, setFocused] = useState18(false);
|
|
16826
16801
|
const [blurred, setBlurred] = useState18(false);
|
|
16802
|
+
const { disabled = false, required = false } = props;
|
|
16827
16803
|
const id = useMemo15(() => props.schema.$id || generateRandomId(), [props.schema.$id]);
|
|
16828
16804
|
const [schemaIndex, setSchemaIndex] = useState18(
|
|
16829
16805
|
getActiveSchemaIndex(props.schema, props.model)
|
|
@@ -16894,21 +16870,23 @@ function OneOfSchema(props) {
|
|
|
16894
16870
|
"has-error": !changed && props.errors && !isEmpty(props.errors) || (props.submitted || changed && blurred) && validations.length
|
|
16895
16871
|
};
|
|
16896
16872
|
const feedbackId = `${id}-feedback`;
|
|
16873
|
+
const labelId = `${id}-label`;
|
|
16897
16874
|
return /* @__PURE__ */ jsxs32(Fragment15, { children: [
|
|
16898
16875
|
(props.schema.oneOf.length > 1 || isConstSchema2(props.schema.oneOf[0])) && /* @__PURE__ */ jsxs32(Fragment15, { children: [
|
|
16899
16876
|
props.schema.alert && /* @__PURE__ */ jsx91(DynamicAlert_default, { component: props.schema.alert }),
|
|
16900
16877
|
/* @__PURE__ */ jsxs32("div", { className: (0, import_classnames11.default)(formGroupClasses), children: [
|
|
16901
|
-
getTitleAndHelp(props.schema, id),
|
|
16878
|
+
getTitleAndHelp(props.schema, id, labelId),
|
|
16902
16879
|
/* @__PURE__ */ jsx91(
|
|
16903
16880
|
SchemaFormControl_default,
|
|
16904
16881
|
{
|
|
16905
16882
|
id,
|
|
16906
16883
|
schema: schemaForSelect,
|
|
16907
16884
|
value: schemaIndex,
|
|
16908
|
-
disabled
|
|
16885
|
+
disabled,
|
|
16909
16886
|
invalid: !isEmpty(props.errors) || validations.length > 0,
|
|
16910
16887
|
describedBy: feedbackId,
|
|
16911
|
-
|
|
16888
|
+
labelledBy: labelId,
|
|
16889
|
+
required,
|
|
16912
16890
|
onChange: onChooseNewSchema,
|
|
16913
16891
|
onFocus,
|
|
16914
16892
|
onBlur,
|
|
@@ -16939,17 +16917,17 @@ function OneOfSchema(props) {
|
|
|
16939
16917
|
errors: props.errors,
|
|
16940
16918
|
submitted: props.submitted,
|
|
16941
16919
|
hideTitle: true,
|
|
16942
|
-
disabled
|
|
16920
|
+
disabled,
|
|
16943
16921
|
onChange: (parameters) => onChildModelChange(schemaIndex, parameters),
|
|
16944
16922
|
onPersistAsync: props.onPersistAsync
|
|
16945
16923
|
}
|
|
16946
16924
|
)
|
|
16947
16925
|
] });
|
|
16948
16926
|
}
|
|
16949
|
-
function getTitleAndHelp(schema, forId) {
|
|
16927
|
+
function getTitleAndHelp(schema, forId, labelId) {
|
|
16950
16928
|
var _a;
|
|
16951
16929
|
const helpElement = schema.help ? /* @__PURE__ */ jsx91(Help_default2, { help: schema.help }) : null;
|
|
16952
|
-
const titleElement = isConstSchema2(schema.oneOf[0]) ? /* @__PURE__ */ jsx91("div", { className: "m-b-1", children: /* @__PURE__ */ jsxs32("label", { className: "control-label d-inline", htmlFor: forId, children: [
|
|
16930
|
+
const titleElement = isConstSchema2(schema.oneOf[0]) ? /* @__PURE__ */ jsx91("div", { className: "m-b-1", children: /* @__PURE__ */ jsxs32("label", { className: "control-label d-inline", id: labelId, htmlFor: forId, children: [
|
|
16953
16931
|
schema.title,
|
|
16954
16932
|
" ",
|
|
16955
16933
|
helpElement
|
|
@@ -16961,12 +16939,13 @@ function getTitleAndHelp(schema, forId) {
|
|
|
16961
16939
|
return schema.title ? titleElement : helpElement;
|
|
16962
16940
|
}
|
|
16963
16941
|
function getValidations(props, schemaIndex) {
|
|
16964
|
-
const
|
|
16942
|
+
const { schema, required = false } = props;
|
|
16943
|
+
const selectedSchema = schema.oneOf[schemaIndex != null ? schemaIndex : -1];
|
|
16965
16944
|
if (isConstSchema2(selectedSchema)) {
|
|
16966
|
-
return getValidationFailures(selectedSchema.const,
|
|
16945
|
+
return getValidationFailures(selectedSchema.const, schema, Boolean(required));
|
|
16967
16946
|
}
|
|
16968
16947
|
if (schemaIndex === null || schemaIndex < 0) {
|
|
16969
|
-
return getValidationFailures(null,
|
|
16948
|
+
return getValidationFailures(null, schema, Boolean(required));
|
|
16970
16949
|
}
|
|
16971
16950
|
return [];
|
|
16972
16951
|
}
|
|
@@ -16986,10 +16965,6 @@ function mapOneOfToConst(schema, index) {
|
|
|
16986
16965
|
const { title, description, disabled = false, icon, image, keywords } = schema;
|
|
16987
16966
|
return { title, description, disabled, icon, image, const: index, keywords };
|
|
16988
16967
|
}
|
|
16989
|
-
OneOfSchema.defaultProps = {
|
|
16990
|
-
required: false,
|
|
16991
|
-
disabled: false
|
|
16992
|
-
};
|
|
16993
16968
|
var OneOfSchema_default = OneOfSchema;
|
|
16994
16969
|
|
|
16995
16970
|
// src/legacy/jsonSchemaForm/persistAsyncSchema/persistAsyncBlobSchema/PersistAsyncBlobSchema.tsx
|
|
@@ -17057,7 +17032,7 @@ function UploadInputAdapter(props) {
|
|
|
17057
17032
|
// src/legacy/jsonSchemaForm/persistAsyncSchema/persistAsyncBlobSchema/PersistAsyncBlobSchema.tsx
|
|
17058
17033
|
import { jsx as jsx93, jsxs as jsxs33 } from "react/jsx-runtime";
|
|
17059
17034
|
function PersistAsyncBlobSchema(props) {
|
|
17060
|
-
const { model, schema, submitted, required, errors, onChange } = props;
|
|
17035
|
+
const { model, schema, submitted, required = false, errors, onChange } = props;
|
|
17061
17036
|
const [persistAsyncValidationMessages, setPersistAsyncValidationMessages] = useState19({});
|
|
17062
17037
|
const [persistAsyncValidations, setPersistAsyncValidations] = useState19(null);
|
|
17063
17038
|
const [validations, setValidations] = useState19([]);
|
|
@@ -17141,9 +17116,6 @@ function PersistAsyncBlobSchema(props) {
|
|
|
17141
17116
|
)
|
|
17142
17117
|
] });
|
|
17143
17118
|
}
|
|
17144
|
-
PersistAsyncBlobSchema.defaultProps = {
|
|
17145
|
-
required: false
|
|
17146
|
-
};
|
|
17147
17119
|
var PersistAsyncBlobSchema_default = PersistAsyncBlobSchema;
|
|
17148
17120
|
|
|
17149
17121
|
// src/legacy/jsonSchemaForm/persistAsyncSchema/PersistAsyncSchema.tsx
|
|
@@ -17159,9 +17131,6 @@ function PersistAsyncSchema(props) {
|
|
|
17159
17131
|
}
|
|
17160
17132
|
return /* @__PURE__ */ jsx94(PersistAsyncBasicSchema_default, __spreadValues({}, props));
|
|
17161
17133
|
}
|
|
17162
|
-
PersistAsyncSchema.defaultProps = {
|
|
17163
|
-
required: false
|
|
17164
|
-
};
|
|
17165
17134
|
var PersistAsyncSchema_default = PersistAsyncSchema;
|
|
17166
17135
|
|
|
17167
17136
|
// src/legacy/jsonSchemaForm/promotedOneOfSchema/PromotedOneOfSchema.tsx
|
|
@@ -17191,7 +17160,6 @@ var PromotedOneOfCheckboxControl = (props) => {
|
|
|
17191
17160
|
};
|
|
17192
17161
|
return /* @__PURE__ */ jsx95("div", { className: "form-group", children: /* @__PURE__ */ jsx95(Checkbox3, { id, label: title, checked, onChange: toggleSelection }) });
|
|
17193
17162
|
};
|
|
17194
|
-
PromotedOneOfCheckboxControl.defaultProps = {};
|
|
17195
17163
|
var PromotedOneOfCheckboxControl_default = PromotedOneOfCheckboxControl;
|
|
17196
17164
|
|
|
17197
17165
|
// src/legacy/jsonSchemaForm/promotedOneOfSchema/promotedOneOfControl/PromotedOneOfRadioControl.tsx
|
|
@@ -17375,7 +17343,7 @@ function getValueFromOption(option) {
|
|
|
17375
17343
|
import { useEffect as useEffect14, useRef as useRef3, useState as useState21 } from "react";
|
|
17376
17344
|
import { jsx as jsx100 } from "react/jsx-runtime";
|
|
17377
17345
|
function ValidationAsyncSchema(props) {
|
|
17378
|
-
const { schema, model, required, submitted, errors, onChange } = props;
|
|
17346
|
+
const { schema, model, required = false, submitted, errors, onChange } = props;
|
|
17379
17347
|
const [validationAsyncModel, setValidationAsyncModel] = useState21(model);
|
|
17380
17348
|
const previousRequestedModelReference = useRef3(null);
|
|
17381
17349
|
const [validationAsyncSuccessMessage, setValidationAsyncSuccessMessage] = useState21(
|
|
@@ -17459,7 +17427,6 @@ function ValidationAsyncSchema(props) {
|
|
|
17459
17427
|
};
|
|
17460
17428
|
return /* @__PURE__ */ jsx100(BasicTypeSchema_default, __spreadValues({}, basicTypeSchemaProps));
|
|
17461
17429
|
}
|
|
17462
|
-
ValidationAsyncSchema.defaultProps = { required: false };
|
|
17463
17430
|
var ValidationAsyncSchema_default = ValidationAsyncSchema;
|
|
17464
17431
|
|
|
17465
17432
|
// src/legacy/jsonSchemaForm/genericSchema/GenericSchema.tsx
|
|
@@ -18242,11 +18209,12 @@ var getDefaultValue = (schema) => {
|
|
|
18242
18209
|
};
|
|
18243
18210
|
var BasicTypeSchema = (props) => {
|
|
18244
18211
|
var _a, _b, _c;
|
|
18212
|
+
const { disabled = false, required = false } = props;
|
|
18245
18213
|
const onChange = (newModel, _type, metadata) => {
|
|
18246
18214
|
setChanged(true);
|
|
18247
18215
|
setModelAndBroadcast(sanitiseModel(newModel), "user", metadata);
|
|
18248
18216
|
};
|
|
18249
|
-
const getValidationKeys = (newModel) => getValidationFailures(newModel, props.schema,
|
|
18217
|
+
const getValidationKeys = (newModel) => getValidationFailures(newModel, props.schema, required);
|
|
18250
18218
|
const setModelAndBroadcast = (newModel, type, metadata) => {
|
|
18251
18219
|
setModel(newModel);
|
|
18252
18220
|
const validationKeys = getValidationKeys(newModel);
|
|
@@ -18326,7 +18294,7 @@ var BasicTypeSchema = (props) => {
|
|
|
18326
18294
|
id,
|
|
18327
18295
|
schema: props.schema,
|
|
18328
18296
|
value: model,
|
|
18329
|
-
disabled: !!
|
|
18297
|
+
disabled: !!disabled,
|
|
18330
18298
|
onChange,
|
|
18331
18299
|
onFocus,
|
|
18332
18300
|
onBlur,
|
|
@@ -18351,11 +18319,6 @@ var BasicTypeSchema = (props) => {
|
|
|
18351
18319
|
] })
|
|
18352
18320
|
] }) : null;
|
|
18353
18321
|
};
|
|
18354
|
-
BasicTypeSchema.defaultProps = {
|
|
18355
|
-
required: false,
|
|
18356
|
-
disabled: false,
|
|
18357
|
-
onBlur: null
|
|
18358
|
-
};
|
|
18359
18322
|
var BasicTypeSchema_default = BasicTypeSchema;
|
|
18360
18323
|
|
|
18361
18324
|
// src/legacy/jsonSchemaForm/persistAsyncSchema/persistAsyncBasicSchema/PersistAsyncBasicSchema.tsx
|
|
@@ -18373,7 +18336,7 @@ var controlTypesWithPersistOnChange = /* @__PURE__ */ new Set([
|
|
|
18373
18336
|
FormControlType.UPLOAD
|
|
18374
18337
|
]);
|
|
18375
18338
|
function PersistAsyncBasicSchema(props) {
|
|
18376
|
-
const { schema, required, submitted, errors, onChange, onPersistAsync } = props;
|
|
18339
|
+
const { schema, required = false, submitted, errors, onChange, onPersistAsync } = props;
|
|
18377
18340
|
const intl = useIntl23();
|
|
18378
18341
|
const httpClient = useHttpClient();
|
|
18379
18342
|
const onEvent = useEventDispatcher();
|
|
@@ -18463,9 +18426,6 @@ function PersistAsyncBasicSchema(props) {
|
|
|
18463
18426
|
}
|
|
18464
18427
|
);
|
|
18465
18428
|
}
|
|
18466
|
-
PersistAsyncBasicSchema.defaultProps = {
|
|
18467
|
-
required: false
|
|
18468
|
-
};
|
|
18469
18429
|
var PersistAsyncBasicSchema_default = PersistAsyncBasicSchema;
|
|
18470
18430
|
|
|
18471
18431
|
// 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;
|