@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.
Files changed (18) hide show
  1. package/build/main.js +45 -93
  2. package/build/main.min.js +1 -1
  3. package/build/main.mjs +45 -93
  4. package/build/types/legacy/jsonSchemaForm/allOfSchema/AllOfSchema.d.ts +0 -5
  5. package/build/types/legacy/jsonSchemaForm/arrayTypeSchema/ArraySchema.d.ts +1 -6
  6. package/build/types/legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/ArrayListSchema.d.ts +0 -6
  7. package/build/types/legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/MultipleFileUploadSchema.d.ts +0 -6
  8. package/build/types/legacy/jsonSchemaForm/basicTypeSchema/BasicTypeSchema.d.ts +1 -8
  9. package/build/types/legacy/jsonSchemaForm/controlFeedback/ControlFeedback.d.ts +0 -8
  10. package/build/types/legacy/jsonSchemaForm/objectSchema/ObjectSchema.d.ts +0 -6
  11. package/build/types/legacy/jsonSchemaForm/oneOfSchema/OneOfSchema.d.ts +0 -6
  12. package/build/types/legacy/jsonSchemaForm/persistAsyncSchema/PersistAsyncSchema.d.ts +0 -5
  13. package/build/types/legacy/jsonSchemaForm/persistAsyncSchema/persistAsyncBasicSchema/PersistAsyncBasicSchema.d.ts +0 -5
  14. package/build/types/legacy/jsonSchemaForm/persistAsyncSchema/persistAsyncBlobSchema/PersistAsyncBlobSchema.d.ts +0 -5
  15. package/build/types/legacy/jsonSchemaForm/promotedOneOfSchema/promotedOneOfControl/PromotedOneOfCheckboxControl.d.ts +1 -4
  16. package/build/types/legacy/jsonSchemaForm/schemaFormControl/SchemaFormControl.d.ts +0 -9
  17. package/build/types/legacy/jsonSchemaForm/validationAsyncSchema/ValidationAsyncSchema.d.ts +0 -5
  18. package/package.json +16 -17
package/build/main.js CHANGED
@@ -144,10 +144,10 @@ var init_clsx = __esm({
144
144
  }
145
145
  });
146
146
 
147
- // ../../node_modules/.pnpm/@wise+art@2.14.0_@transferwise+neptune-css@14.18.0_@types+react@18.3.5_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@wise/art/dist/index-93a0c34e.esm.js
147
+ // ../../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
148
148
  var import_react7, import_jsx_runtime17, unknownFlagName, Flag, Sizes, ImageSizes, imageSizes, Assets, RenderMode;
149
- var init_index_93a0c34e_esm = __esm({
150
- "../../node_modules/.pnpm/@wise+art@2.14.0_@transferwise+neptune-css@14.18.0_@types+react@18.3.5_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@wise/art/dist/index-93a0c34e.esm.js"() {
149
+ var init_index_a91e5689_esm = __esm({
150
+ "../../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"() {
151
151
  "use strict";
152
152
  init_clsx();
153
153
  import_react7 = require("react");
@@ -156,7 +156,8 @@ var init_index_93a0c34e_esm = __esm({
156
156
  Flag = ({
157
157
  code,
158
158
  intrinsicSize = 64,
159
- className = void 0
159
+ className = void 0,
160
+ loading = "lazy"
160
161
  }) => {
161
162
  const [fallback, setFallback] = (0, import_react7.useState)(null);
162
163
  (0, import_react7.useEffect)(() => {
@@ -167,6 +168,7 @@ var init_index_93a0c34e_esm = __esm({
167
168
  return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("img", {
168
169
  className: clsx(`wds-flag wds-flag-${name}`, className),
169
170
  src: `https://wise.com/web-art/assets/flags/${name}.svg`,
171
+ loading,
170
172
  alt: "",
171
173
  width: intrinsicSize,
172
174
  height: intrinsicSize,
@@ -11420,8 +11422,8 @@ var DateInputRenderer_default = DateInputRenderer;
11420
11422
  // ../renderers/src/DecisionRenderer.tsx
11421
11423
  var import_components9 = require("@transferwise/components");
11422
11424
 
11423
- // ../../node_modules/.pnpm/@wise+art@2.14.0_@transferwise+neptune-css@14.18.0_@types+react@18.3.5_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@wise/art/dist/index.esm.js
11424
- init_index_93a0c34e_esm();
11425
+ // ../../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
11426
+ init_index_a91e5689_esm();
11425
11427
  init_clsx();
11426
11428
  var import_react8 = require("react");
11427
11429
  var import_jsx_runtime18 = require("react/jsx-runtime");
@@ -14930,6 +14932,7 @@ var getSchemaColumnClasses = (width) => ({
14930
14932
  "col-sm-4": width === "sm"
14931
14933
  });
14932
14934
  function AllOfSchema(props) {
14935
+ const { disabled = false } = props;
14933
14936
  const onChangeModelIndex = (index, onChangeProps) => {
14934
14937
  const modelSchema = props.schema.allOf[index];
14935
14938
  models[index] = getValidObjectModelParts(onChangeProps.model, modelSchema) || {};
@@ -14949,7 +14952,7 @@ function AllOfSchema(props) {
14949
14952
  model: models[index],
14950
14953
  errors: props.errors,
14951
14954
  submitted: props.submitted,
14952
- disabled: props.disabled,
14955
+ disabled,
14953
14956
  onChange: (onChangeProps) => onChangeModelIndex(index, __spreadProps(__spreadValues({}, onChangeProps), {
14954
14957
  // We can safely assume that the model here is going to be of the same type as the model prop
14955
14958
  model: onChangeProps.model
@@ -14960,9 +14963,6 @@ function AllOfSchema(props) {
14960
14963
  )) })
14961
14964
  ] });
14962
14965
  }
14963
- AllOfSchema.defaultProps = {
14964
- disabled: false
14965
- };
14966
14966
  var AllOfSchema_default = AllOfSchema;
14967
14967
 
14968
14968
  // src/legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/MultipleFileUploadSchema.tsx
@@ -14976,28 +14976,22 @@ var import_formatting2 = require("@transferwise/formatting");
14976
14976
  var import_react_intl22 = require("react-intl");
14977
14977
  var import_jsx_runtime79 = require("react/jsx-runtime");
14978
14978
  function ControlFeedback(props) {
14979
- var _a;
14979
+ const { errors = "", validations = [], validationMessages = {} } = props;
14980
14980
  const defaultValidationMessages = useDefaultValidationMessages(props.schema);
14981
- const validationMessages = __spreadValues(__spreadValues(__spreadValues({}, defaultValidationMessages), props.validationMessages), props.schema.validationMessages);
14982
- const isErrorVisible = (props.submitted || !props.changed) && Boolean(props.errors);
14983
- const isValidationVisible = !isErrorVisible && (props.submitted || props.changed && props.blurred) && Boolean((_a = props.validations) == null ? void 0 : _a.length);
14981
+ const mergedValidationMessages = __spreadValues(__spreadValues(__spreadValues({}, defaultValidationMessages), validationMessages), props.schema.validationMessages);
14982
+ const isErrorVisible = (props.submitted || !props.changed) && Boolean(errors);
14983
+ const isValidationVisible = !isErrorVisible && (props.submitted || props.changed && props.blurred) && Boolean(validations == null ? void 0 : validations.length);
14984
14984
  const isDescriptionVisible = props.schema.type !== "boolean" && props.schema.description && !isErrorVisible && !isValidationVisible;
14985
14985
  const hasInfoMessage = Boolean(props.infoMessage);
14986
14986
  return /* @__PURE__ */ (0, import_jsx_runtime79.jsxs)("div", { id: props.id, children: [
14987
- isErrorVisible ? /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(import_components46.InlineAlert, { type: "error", children: props.errors }) : null,
14988
- isValidationVisible ? /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(import_components46.InlineAlert, { type: "error", children: props.validations.map((validation) => /* @__PURE__ */ (0, import_jsx_runtime79.jsx)("div", { children: validationMessages[validation] }, validation)) }) : null,
14987
+ isErrorVisible ? /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(import_components46.InlineAlert, { type: "error", children: errors }) : null,
14988
+ isValidationVisible ? /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(import_components46.InlineAlert, { type: "error", children: validations.map((validation) => /* @__PURE__ */ (0, import_jsx_runtime79.jsx)("div", { children: mergedValidationMessages[validation] }, validation)) }) : null,
14989
14989
  (isDescriptionVisible || hasInfoMessage) && /* @__PURE__ */ (0, import_jsx_runtime79.jsxs)(import_components46.InlineAlert, { type: "info", children: [
14990
14990
  isDescriptionVisible && /* @__PURE__ */ (0, import_jsx_runtime79.jsx)("div", { children: props.schema.description }),
14991
14991
  hasInfoMessage && /* @__PURE__ */ (0, import_jsx_runtime79.jsx)("div", { children: props.infoMessage })
14992
14992
  ] })
14993
14993
  ] });
14994
14994
  }
14995
- ControlFeedback.defaultProps = {
14996
- errors: "",
14997
- validations: [],
14998
- validationMessages: {},
14999
- validationAsyncSuccessMessage: null
15000
- };
15001
14995
  function useDefaultValidationMessages(schema) {
15002
14996
  const { formatMessage, locale } = (0, import_react_intl22.useIntl)();
15003
14997
  const formattedMessages = {
@@ -15117,7 +15111,7 @@ function useFormattedDefaultErrorMessages({
15117
15111
  var import_jsx_runtime80 = require("react/jsx-runtime");
15118
15112
  function MultipleFileUploadSchema(props) {
15119
15113
  var _a, _b;
15120
- const { onChange, schema } = props;
15114
+ const { onChange, errors = null, schema, required = false } = props;
15121
15115
  const onEvent = useEventDispatcher();
15122
15116
  const defaultErrorMessages = useFormattedDefaultErrorMessages(schema);
15123
15117
  const uid = (0, import_react34.useMemo)(() => schema.$id || generateRandomId(), [schema.$id]);
@@ -15154,8 +15148,8 @@ function MultipleFileUploadSchema(props) {
15154
15148
  }
15155
15149
  const validFiles = getSuccessfullyProcessedFiles(files);
15156
15150
  const fileIds = validFiles.map((file) => file.id);
15157
- const fileListValidationFailures = getArrayValidationFailures(fileIds, schema, props.required);
15158
- const showError = Boolean(props.errors) || (inputChanged || props.submitted) && Boolean(fileListValidationFailures.length);
15151
+ const fileListValidationFailures = getArrayValidationFailures(fileIds, schema, required);
15152
+ const showError = Boolean(errors) || (inputChanged || props.submitted) && Boolean(fileListValidationFailures.length);
15159
15153
  const accepts = "accepts" in fileSchemaDescriptor && fileSchemaDescriptor.accepts;
15160
15154
  const maxSize = "maxSize" in fileSchemaDescriptor && fileSchemaDescriptor.maxSize;
15161
15155
  const uploadInputProps = __spreadProps(__spreadValues(__spreadValues({
@@ -15184,14 +15178,10 @@ function MultipleFileUploadSchema(props) {
15184
15178
  id: feedbackId,
15185
15179
  changed: inputChanged,
15186
15180
  submitted: props.submitted,
15187
- errors: props.errors,
15181
+ errors,
15188
15182
  schema: props.schema,
15189
15183
  validations: fileListValidationFailures,
15190
- validationMessages: getValidationMessages(
15191
- schema,
15192
- Boolean(props.required),
15193
- defaultErrorMessages
15194
- ),
15184
+ validationMessages: getValidationMessages(schema, Boolean(required), defaultErrorMessages),
15195
15185
  infoMessage: null,
15196
15186
  focused: false,
15197
15187
  blurred: true
@@ -15199,10 +15189,6 @@ function MultipleFileUploadSchema(props) {
15199
15189
  )
15200
15190
  ] });
15201
15191
  }
15202
- MultipleFileUploadSchema.defaultProps = {
15203
- errors: null,
15204
- required: false
15205
- };
15206
15192
  var MultipleFileUploadSchema_default = MultipleFileUploadSchema;
15207
15193
  function getSuccessfullyProcessedFiles(allFiles) {
15208
15194
  return allFiles.filter((file) => !file.error && file.status === "succeeded");
@@ -15899,22 +15885,18 @@ var RepeatableSchema_default = RepeatableSchema;
15899
15885
  // src/legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/ArrayListSchema.tsx
15900
15886
  var import_jsx_runtime86 = require("react/jsx-runtime");
15901
15887
  function ArrayListSchema(props) {
15902
- const { schema } = props;
15888
+ const { errors = null, schema } = props;
15903
15889
  if (isMultipleFileUploadSchema(schema)) {
15904
- return /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(MultipleFileUploadSchema_default, __spreadProps(__spreadValues({}, props), { schema }));
15890
+ return /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(MultipleFileUploadSchema_default, __spreadProps(__spreadValues({}, props), { errors, schema }));
15905
15891
  }
15906
15892
  if (isMultiSelectConstSchema(schema)) {
15907
- return /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(MultiSelectSchema, __spreadProps(__spreadValues({}, props), { schema }));
15893
+ return /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(MultiSelectSchema, __spreadProps(__spreadValues({}, props), { errors, schema }));
15908
15894
  }
15909
15895
  if (isListArraySchema(schema)) {
15910
- return /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(RepeatableSchema_default, __spreadProps(__spreadValues({}, props), { schema }));
15896
+ return /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(RepeatableSchema_default, __spreadProps(__spreadValues({}, props), { errors, schema }));
15911
15897
  }
15912
15898
  throw new Error("Invalid array list schema");
15913
15899
  }
15914
- ArrayListSchema.defaultProps = {
15915
- errors: null,
15916
- required: false
15917
- };
15918
15900
  var ArrayListSchema_default = ArrayListSchema;
15919
15901
 
15920
15902
  // src/legacy/jsonSchemaForm/arrayTypeSchema/ArraySchema.tsx
@@ -15926,9 +15908,6 @@ var ArraySchema = (props) => {
15926
15908
  }
15927
15909
  throw new Error("Not implemented");
15928
15910
  };
15929
- ArraySchema.defaultProps = {
15930
- required: false
15931
- };
15932
15911
  var ArraySchema_default = ArraySchema;
15933
15912
 
15934
15913
  // src/legacy/jsonSchemaForm/objectSchema/ObjectSchema.tsx
@@ -15942,6 +15921,7 @@ var getSchemaColumnClasses2 = (width) => ({
15942
15921
  "col-sm-4": width === "sm"
15943
15922
  });
15944
15923
  function ObjectSchema(props) {
15924
+ const { disabled = false, hideTitle = false } = props;
15945
15925
  const [model, setModel] = (0, import_react38.useState)(() => __spreadValues({}, getValidObjectModelParts(props.model, props.schema)));
15946
15926
  const onChangeProperty = (propertyName, onChangeProps) => {
15947
15927
  if (onChangeProps.model !== null) {
@@ -15974,8 +15954,8 @@ function ObjectSchema(props) {
15974
15954
  return /* @__PURE__ */ (0, import_jsx_runtime88.jsxs)(import_jsx_runtime88.Fragment, { children: [
15975
15955
  props.schema.alert && /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(DynamicAlert_default, { component: props.schema.alert }),
15976
15956
  /* @__PURE__ */ (0, import_jsx_runtime88.jsxs)("fieldset", { children: [
15977
- props.schema.title && !props.hideTitle && /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(import_components52.Header, { title: props.schema.title, as: "legend" }),
15978
- props.schema.description && !props.hideTitle && /* @__PURE__ */ (0, import_jsx_runtime88.jsxs)("p", { children: [
15957
+ props.schema.title && !hideTitle && /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(import_components52.Header, { title: props.schema.title, as: "legend" }),
15958
+ props.schema.description && !hideTitle && /* @__PURE__ */ (0, import_jsx_runtime88.jsxs)("p", { children: [
15979
15959
  " ",
15980
15960
  props.schema.description,
15981
15961
  " "
@@ -15994,7 +15974,7 @@ function ObjectSchema(props) {
15994
15974
  errors: propsErrors == null ? void 0 : propsErrors[propertyName],
15995
15975
  submitted: props.submitted,
15996
15976
  required: isRequired(propertyName),
15997
- disabled: props.disabled,
15977
+ disabled,
15998
15978
  onChange: (onChangeProps) => onChangeProperty(propertyName, onChangeProps),
15999
15979
  onPersistAsync: props.onPersistAsync
16000
15980
  }
@@ -16005,10 +15985,6 @@ function ObjectSchema(props) {
16005
15985
  ] })
16006
15986
  ] });
16007
15987
  }
16008
- ObjectSchema.defaultProps = {
16009
- hideTitle: false,
16010
- disabled: false
16011
- };
16012
15988
  var ObjectSchema_default = ObjectSchema;
16013
15989
 
16014
15990
  // src/legacy/jsonSchemaForm/oneOfSchema/OneOfSchema.tsx
@@ -16743,8 +16719,8 @@ function SchemaFormControl(props) {
16743
16719
  const {
16744
16720
  id,
16745
16721
  schema,
16746
- value,
16747
- disabled,
16722
+ value = null,
16723
+ disabled = false,
16748
16724
  invalid,
16749
16725
  required,
16750
16726
  onChange,
@@ -16794,13 +16770,6 @@ function SchemaFormControl(props) {
16794
16770
  };
16795
16771
  return /* @__PURE__ */ (0, import_jsx_runtime91.jsx)("div", { "aria-describedby": describedBy, children: /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(FormControl, __spreadValues(__spreadValues({ type: controlType, value: safeValue }, events), controlProps)) });
16796
16772
  }
16797
- SchemaFormControl.defaultProps = {
16798
- value: null,
16799
- onFocus: null,
16800
- onBlur: null,
16801
- onSearchChange: null,
16802
- disabled: false
16803
- };
16804
16773
  var warnIfInvalidSchema = (schema, log, controlType) => {
16805
16774
  if (isOneOfSchema2(schema) && schema.oneOf.length === 2 && !schema.control) {
16806
16775
  log.warning(
@@ -16827,6 +16796,7 @@ function OneOfSchema(props) {
16827
16796
  const [changed, setChanged] = (0, import_react41.useState)(false);
16828
16797
  const [focused, setFocused] = (0, import_react41.useState)(false);
16829
16798
  const [blurred, setBlurred] = (0, import_react41.useState)(false);
16799
+ const { disabled = false, required = false } = props;
16830
16800
  const id = (0, import_react41.useMemo)(() => props.schema.$id || generateRandomId(), [props.schema.$id]);
16831
16801
  const [schemaIndex, setSchemaIndex] = (0, import_react41.useState)(
16832
16802
  getActiveSchemaIndex(props.schema, props.model)
@@ -16908,10 +16878,10 @@ function OneOfSchema(props) {
16908
16878
  id,
16909
16879
  schema: schemaForSelect,
16910
16880
  value: schemaIndex,
16911
- disabled: props.disabled,
16881
+ disabled,
16912
16882
  invalid: !isEmpty(props.errors) || validations.length > 0,
16913
16883
  describedBy: feedbackId,
16914
- required: props.required,
16884
+ required,
16915
16885
  onChange: onChooseNewSchema,
16916
16886
  onFocus,
16917
16887
  onBlur,
@@ -16942,7 +16912,7 @@ function OneOfSchema(props) {
16942
16912
  errors: props.errors,
16943
16913
  submitted: props.submitted,
16944
16914
  hideTitle: true,
16945
- disabled: props.disabled,
16915
+ disabled,
16946
16916
  onChange: (parameters) => onChildModelChange(schemaIndex, parameters),
16947
16917
  onPersistAsync: props.onPersistAsync
16948
16918
  }
@@ -16964,12 +16934,13 @@ function getTitleAndHelp(schema, forId) {
16964
16934
  return schema.title ? titleElement : helpElement;
16965
16935
  }
16966
16936
  function getValidations(props, schemaIndex) {
16967
- const selectedSchema = props.schema.oneOf[schemaIndex != null ? schemaIndex : -1];
16937
+ const { schema, required = false } = props;
16938
+ const selectedSchema = schema.oneOf[schemaIndex != null ? schemaIndex : -1];
16968
16939
  if (isConstSchema2(selectedSchema)) {
16969
- return getValidationFailures(selectedSchema.const, props.schema, Boolean(props.required));
16940
+ return getValidationFailures(selectedSchema.const, schema, Boolean(required));
16970
16941
  }
16971
16942
  if (schemaIndex === null || schemaIndex < 0) {
16972
- return getValidationFailures(null, props.schema, Boolean(props.required));
16943
+ return getValidationFailures(null, schema, Boolean(required));
16973
16944
  }
16974
16945
  return [];
16975
16946
  }
@@ -16989,10 +16960,6 @@ function mapOneOfToConst(schema, index) {
16989
16960
  const { title, description, disabled = false, icon, image, keywords } = schema;
16990
16961
  return { title, description, disabled, icon, image, const: index, keywords };
16991
16962
  }
16992
- OneOfSchema.defaultProps = {
16993
- required: false,
16994
- disabled: false
16995
- };
16996
16963
  var OneOfSchema_default = OneOfSchema;
16997
16964
 
16998
16965
  // src/legacy/jsonSchemaForm/persistAsyncSchema/persistAsyncBlobSchema/PersistAsyncBlobSchema.tsx
@@ -17060,7 +17027,7 @@ function UploadInputAdapter(props) {
17060
17027
  // src/legacy/jsonSchemaForm/persistAsyncSchema/persistAsyncBlobSchema/PersistAsyncBlobSchema.tsx
17061
17028
  var import_jsx_runtime94 = require("react/jsx-runtime");
17062
17029
  function PersistAsyncBlobSchema(props) {
17063
- const { model, schema, submitted, required, errors, onChange } = props;
17030
+ const { model, schema, submitted, required = false, errors, onChange } = props;
17064
17031
  const [persistAsyncValidationMessages, setPersistAsyncValidationMessages] = (0, import_react43.useState)({});
17065
17032
  const [persistAsyncValidations, setPersistAsyncValidations] = (0, import_react43.useState)(null);
17066
17033
  const [validations, setValidations] = (0, import_react43.useState)([]);
@@ -17144,9 +17111,6 @@ function PersistAsyncBlobSchema(props) {
17144
17111
  )
17145
17112
  ] });
17146
17113
  }
17147
- PersistAsyncBlobSchema.defaultProps = {
17148
- required: false
17149
- };
17150
17114
  var PersistAsyncBlobSchema_default = PersistAsyncBlobSchema;
17151
17115
 
17152
17116
  // src/legacy/jsonSchemaForm/persistAsyncSchema/PersistAsyncSchema.tsx
@@ -17162,9 +17126,6 @@ function PersistAsyncSchema(props) {
17162
17126
  }
17163
17127
  return /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(PersistAsyncBasicSchema_default, __spreadValues({}, props));
17164
17128
  }
17165
- PersistAsyncSchema.defaultProps = {
17166
- required: false
17167
- };
17168
17129
  var PersistAsyncSchema_default = PersistAsyncSchema;
17169
17130
 
17170
17131
  // src/legacy/jsonSchemaForm/promotedOneOfSchema/PromotedOneOfSchema.tsx
@@ -17194,7 +17155,6 @@ var PromotedOneOfCheckboxControl = (props) => {
17194
17155
  };
17195
17156
  return /* @__PURE__ */ (0, import_jsx_runtime96.jsx)("div", { className: "form-group", children: /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(import_components57.Checkbox, { id, label: title, checked, onChange: toggleSelection }) });
17196
17157
  };
17197
- PromotedOneOfCheckboxControl.defaultProps = {};
17198
17158
  var PromotedOneOfCheckboxControl_default = PromotedOneOfCheckboxControl;
17199
17159
 
17200
17160
  // src/legacy/jsonSchemaForm/promotedOneOfSchema/promotedOneOfControl/PromotedOneOfRadioControl.tsx
@@ -17378,7 +17338,7 @@ function getValueFromOption(option) {
17378
17338
  var import_react45 = require("react");
17379
17339
  var import_jsx_runtime101 = require("react/jsx-runtime");
17380
17340
  function ValidationAsyncSchema(props) {
17381
- const { schema, model, required, submitted, errors, onChange } = props;
17341
+ const { schema, model, required = false, submitted, errors, onChange } = props;
17382
17342
  const [validationAsyncModel, setValidationAsyncModel] = (0, import_react45.useState)(model);
17383
17343
  const previousRequestedModelReference = (0, import_react45.useRef)(null);
17384
17344
  const [validationAsyncSuccessMessage, setValidationAsyncSuccessMessage] = (0, import_react45.useState)(
@@ -17462,7 +17422,6 @@ function ValidationAsyncSchema(props) {
17462
17422
  };
17463
17423
  return /* @__PURE__ */ (0, import_jsx_runtime101.jsx)(BasicTypeSchema_default, __spreadValues({}, basicTypeSchemaProps));
17464
17424
  }
17465
- ValidationAsyncSchema.defaultProps = { required: false };
17466
17425
  var ValidationAsyncSchema_default = ValidationAsyncSchema;
17467
17426
 
17468
17427
  // src/legacy/jsonSchemaForm/genericSchema/GenericSchema.tsx
@@ -18245,11 +18204,12 @@ var getDefaultValue = (schema) => {
18245
18204
  };
18246
18205
  var BasicTypeSchema = (props) => {
18247
18206
  var _a, _b, _c;
18207
+ const { disabled = false, required = false } = props;
18248
18208
  const onChange = (newModel, _type, metadata) => {
18249
18209
  setChanged(true);
18250
18210
  setModelAndBroadcast(sanitiseModel(newModel), "user", metadata);
18251
18211
  };
18252
- const getValidationKeys = (newModel) => getValidationFailures(newModel, props.schema, props.required);
18212
+ const getValidationKeys = (newModel) => getValidationFailures(newModel, props.schema, required);
18253
18213
  const setModelAndBroadcast = (newModel, type, metadata) => {
18254
18214
  setModel(newModel);
18255
18215
  const validationKeys = getValidationKeys(newModel);
@@ -18329,7 +18289,7 @@ var BasicTypeSchema = (props) => {
18329
18289
  id,
18330
18290
  schema: props.schema,
18331
18291
  value: model,
18332
- disabled: !!props.disabled,
18292
+ disabled: !!disabled,
18333
18293
  onChange,
18334
18294
  onFocus,
18335
18295
  onBlur,
@@ -18354,11 +18314,6 @@ var BasicTypeSchema = (props) => {
18354
18314
  ] })
18355
18315
  ] }) : null;
18356
18316
  };
18357
- BasicTypeSchema.defaultProps = {
18358
- required: false,
18359
- disabled: false,
18360
- onBlur: null
18361
- };
18362
18317
  var BasicTypeSchema_default = BasicTypeSchema;
18363
18318
 
18364
18319
  // src/legacy/jsonSchemaForm/persistAsyncSchema/persistAsyncBasicSchema/PersistAsyncBasicSchema.tsx
@@ -18376,7 +18331,7 @@ var controlTypesWithPersistOnChange = /* @__PURE__ */ new Set([
18376
18331
  FormControlType.UPLOAD
18377
18332
  ]);
18378
18333
  function PersistAsyncBasicSchema(props) {
18379
- const { schema, required, submitted, errors, onChange, onPersistAsync } = props;
18334
+ const { schema, required = false, submitted, errors, onChange, onPersistAsync } = props;
18380
18335
  const intl = (0, import_react_intl40.useIntl)();
18381
18336
  const httpClient = useHttpClient();
18382
18337
  const onEvent = useEventDispatcher();
@@ -18466,9 +18421,6 @@ function PersistAsyncBasicSchema(props) {
18466
18421
  }
18467
18422
  );
18468
18423
  }
18469
- PersistAsyncBasicSchema.defaultProps = {
18470
- required: false
18471
- };
18472
18424
  var PersistAsyncBasicSchema_default = PersistAsyncBasicSchema;
18473
18425
 
18474
18426
  // src/legacy/common/hooks/usePersistAsync/usePersistAsync.ts