@rjsf/core 6.7.1 → 6.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (200) hide show
  1. package/dist/core.umd.js +199 -155
  2. package/dist/index.cjs +195 -193
  3. package/dist/index.cjs.map +3 -3
  4. package/dist/index.esm.js +225 -201
  5. package/dist/index.esm.js.map +3 -3
  6. package/lib/components/Form.d.ts +3 -2
  7. package/lib/components/Form.d.ts.map +1 -1
  8. package/lib/components/Form.js +62 -45
  9. package/lib/components/Form.js.map +1 -0
  10. package/lib/components/RichDescription.js +1 -0
  11. package/lib/components/RichDescription.js.map +1 -0
  12. package/lib/components/RichHelp.js +1 -0
  13. package/lib/components/RichHelp.js.map +1 -0
  14. package/lib/components/SchemaExamples.js +1 -0
  15. package/lib/components/SchemaExamples.js.map +1 -0
  16. package/lib/components/constants.js +1 -0
  17. package/lib/components/constants.js.map +1 -0
  18. package/lib/components/fields/ArrayField.d.ts.map +1 -1
  19. package/lib/components/fields/ArrayField.js +16 -17
  20. package/lib/components/fields/ArrayField.js.map +1 -0
  21. package/lib/components/fields/BooleanField.d.ts.map +1 -1
  22. package/lib/components/fields/BooleanField.js +2 -2
  23. package/lib/components/fields/BooleanField.js.map +1 -0
  24. package/lib/components/fields/CyclicSchemaField.js +1 -0
  25. package/lib/components/fields/CyclicSchemaField.js.map +1 -0
  26. package/lib/components/fields/FallbackField.js +1 -0
  27. package/lib/components/fields/FallbackField.js.map +1 -0
  28. package/lib/components/fields/LayoutGridField.d.ts +61 -1
  29. package/lib/components/fields/LayoutGridField.d.ts.map +1 -1
  30. package/lib/components/fields/LayoutGridField.js +50 -63
  31. package/lib/components/fields/LayoutGridField.js.map +1 -0
  32. package/lib/components/fields/LayoutHeaderField.js +1 -0
  33. package/lib/components/fields/LayoutHeaderField.js.map +1 -0
  34. package/lib/components/fields/LayoutMultiSchemaField.d.ts.map +1 -1
  35. package/lib/components/fields/LayoutMultiSchemaField.js +14 -18
  36. package/lib/components/fields/LayoutMultiSchemaField.js.map +1 -0
  37. package/lib/components/fields/MultiSchemaField.d.ts.map +1 -1
  38. package/lib/components/fields/MultiSchemaField.js +6 -7
  39. package/lib/components/fields/MultiSchemaField.js.map +1 -0
  40. package/lib/components/fields/NullField.js +1 -0
  41. package/lib/components/fields/NullField.js.map +1 -0
  42. package/lib/components/fields/NumberField.js +1 -0
  43. package/lib/components/fields/NumberField.js.map +1 -0
  44. package/lib/components/fields/ObjectField.d.ts.map +1 -1
  45. package/lib/components/fields/ObjectField.js +20 -25
  46. package/lib/components/fields/ObjectField.js.map +1 -0
  47. package/lib/components/fields/OptionalDataControlsField.js +1 -0
  48. package/lib/components/fields/OptionalDataControlsField.js.map +1 -0
  49. package/lib/components/fields/SchemaField.d.ts.map +1 -1
  50. package/lib/components/fields/SchemaField.js +5 -5
  51. package/lib/components/fields/SchemaField.js.map +1 -0
  52. package/lib/components/fields/StringField.js +1 -0
  53. package/lib/components/fields/StringField.js.map +1 -0
  54. package/lib/components/fields/index.js +15 -14
  55. package/lib/components/fields/index.js.map +1 -0
  56. package/lib/components/templates/ArrayFieldDescriptionTemplate.js +1 -0
  57. package/lib/components/templates/ArrayFieldDescriptionTemplate.js.map +1 -0
  58. package/lib/components/templates/ArrayFieldItemButtonsTemplate.js +1 -0
  59. package/lib/components/templates/ArrayFieldItemButtonsTemplate.js.map +1 -0
  60. package/lib/components/templates/ArrayFieldItemTemplate.js +1 -0
  61. package/lib/components/templates/ArrayFieldItemTemplate.js.map +1 -0
  62. package/lib/components/templates/ArrayFieldTemplate.js +1 -0
  63. package/lib/components/templates/ArrayFieldTemplate.js.map +1 -0
  64. package/lib/components/templates/ArrayFieldTitleTemplate.js +1 -0
  65. package/lib/components/templates/ArrayFieldTitleTemplate.js.map +1 -0
  66. package/lib/components/templates/BaseInputTemplate.js +3 -2
  67. package/lib/components/templates/BaseInputTemplate.js.map +1 -0
  68. package/lib/components/templates/ButtonTemplates/AddButton.js +2 -1
  69. package/lib/components/templates/ButtonTemplates/AddButton.js.map +1 -0
  70. package/lib/components/templates/ButtonTemplates/IconButton.js +1 -0
  71. package/lib/components/templates/ButtonTemplates/IconButton.js.map +1 -0
  72. package/lib/components/templates/ButtonTemplates/SubmitButton.js +1 -0
  73. package/lib/components/templates/ButtonTemplates/SubmitButton.js.map +1 -0
  74. package/lib/components/templates/ButtonTemplates/index.js +4 -3
  75. package/lib/components/templates/ButtonTemplates/index.js.map +1 -0
  76. package/lib/components/templates/CyclicSchemaExpandTemplate.js +1 -0
  77. package/lib/components/templates/CyclicSchemaExpandTemplate.js.map +1 -0
  78. package/lib/components/templates/DescriptionField.js +2 -1
  79. package/lib/components/templates/DescriptionField.js.map +1 -0
  80. package/lib/components/templates/ErrorList.js +1 -0
  81. package/lib/components/templates/ErrorList.js.map +1 -0
  82. package/lib/components/templates/FallbackFieldTemplate.js +1 -0
  83. package/lib/components/templates/FallbackFieldTemplate.js.map +1 -0
  84. package/lib/components/templates/FieldErrorTemplate.js +1 -0
  85. package/lib/components/templates/FieldErrorTemplate.js.map +1 -0
  86. package/lib/components/templates/FieldHelpTemplate.js +2 -1
  87. package/lib/components/templates/FieldHelpTemplate.js.map +1 -0
  88. package/lib/components/templates/FieldTemplate/FieldTemplate.js +2 -1
  89. package/lib/components/templates/FieldTemplate/FieldTemplate.js.map +1 -0
  90. package/lib/components/templates/FieldTemplate/Label.js +1 -0
  91. package/lib/components/templates/FieldTemplate/Label.js.map +1 -0
  92. package/lib/components/templates/FieldTemplate/index.d.ts +1 -1
  93. package/lib/components/templates/FieldTemplate/index.d.ts.map +1 -1
  94. package/lib/components/templates/FieldTemplate/index.js +2 -1
  95. package/lib/components/templates/FieldTemplate/index.js.map +1 -0
  96. package/lib/components/templates/GridTemplate.js +1 -0
  97. package/lib/components/templates/GridTemplate.js.map +1 -0
  98. package/lib/components/templates/MultiSchemaFieldTemplate.js +1 -0
  99. package/lib/components/templates/MultiSchemaFieldTemplate.js.map +1 -0
  100. package/lib/components/templates/ObjectFieldTemplate.js +1 -0
  101. package/lib/components/templates/ObjectFieldTemplate.js.map +1 -0
  102. package/lib/components/templates/OptionalDataControlsTemplate.js +2 -1
  103. package/lib/components/templates/OptionalDataControlsTemplate.js.map +1 -0
  104. package/lib/components/templates/TitleField.js +1 -0
  105. package/lib/components/templates/TitleField.js.map +1 -0
  106. package/lib/components/templates/UnsupportedField.js +1 -0
  107. package/lib/components/templates/UnsupportedField.js.map +1 -0
  108. package/lib/components/templates/WrapIfAdditionalTemplate.js +2 -1
  109. package/lib/components/templates/WrapIfAdditionalTemplate.js.map +1 -0
  110. package/lib/components/templates/index.js +22 -21
  111. package/lib/components/templates/index.js.map +1 -0
  112. package/lib/components/widgets/AltDateTimeWidget.js +1 -0
  113. package/lib/components/widgets/AltDateTimeWidget.js.map +1 -0
  114. package/lib/components/widgets/AltDateWidget.js +1 -0
  115. package/lib/components/widgets/AltDateWidget.js.map +1 -0
  116. package/lib/components/widgets/CheckboxWidget.d.ts +1 -1
  117. package/lib/components/widgets/CheckboxWidget.d.ts.map +1 -1
  118. package/lib/components/widgets/CheckboxWidget.js +4 -3
  119. package/lib/components/widgets/CheckboxWidget.js.map +1 -0
  120. package/lib/components/widgets/CheckboxesWidget.js +1 -0
  121. package/lib/components/widgets/CheckboxesWidget.js.map +1 -0
  122. package/lib/components/widgets/ColorWidget.js +1 -0
  123. package/lib/components/widgets/ColorWidget.js.map +1 -0
  124. package/lib/components/widgets/DateTimeWidget.js +1 -0
  125. package/lib/components/widgets/DateTimeWidget.js.map +1 -0
  126. package/lib/components/widgets/DateWidget.js +1 -0
  127. package/lib/components/widgets/DateWidget.js.map +1 -0
  128. package/lib/components/widgets/EmailWidget.js +1 -0
  129. package/lib/components/widgets/EmailWidget.js.map +1 -0
  130. package/lib/components/widgets/FileWidget.js +1 -0
  131. package/lib/components/widgets/FileWidget.js.map +1 -0
  132. package/lib/components/widgets/HiddenWidget.js +1 -0
  133. package/lib/components/widgets/HiddenWidget.js.map +1 -0
  134. package/lib/components/widgets/PasswordWidget.js +1 -0
  135. package/lib/components/widgets/PasswordWidget.js.map +1 -0
  136. package/lib/components/widgets/RadioWidget.js +1 -0
  137. package/lib/components/widgets/RadioWidget.js.map +1 -0
  138. package/lib/components/widgets/RangeWidget.js +1 -0
  139. package/lib/components/widgets/RangeWidget.js.map +1 -0
  140. package/lib/components/widgets/RatingWidget.d.ts +1 -1
  141. package/lib/components/widgets/RatingWidget.d.ts.map +1 -1
  142. package/lib/components/widgets/RatingWidget.js +2 -1
  143. package/lib/components/widgets/RatingWidget.js.map +1 -0
  144. package/lib/components/widgets/SelectWidget.js +1 -0
  145. package/lib/components/widgets/SelectWidget.js.map +1 -0
  146. package/lib/components/widgets/TextWidget.js +1 -0
  147. package/lib/components/widgets/TextWidget.js.map +1 -0
  148. package/lib/components/widgets/TextareaWidget.js +1 -0
  149. package/lib/components/widgets/TextareaWidget.js.map +1 -0
  150. package/lib/components/widgets/TimeWidget.d.ts.map +1 -1
  151. package/lib/components/widgets/TimeWidget.js +16 -3
  152. package/lib/components/widgets/TimeWidget.js.map +1 -0
  153. package/lib/components/widgets/URLWidget.js +1 -0
  154. package/lib/components/widgets/URLWidget.js.map +1 -0
  155. package/lib/components/widgets/UpDownWidget.js +1 -0
  156. package/lib/components/widgets/UpDownWidget.js.map +1 -0
  157. package/lib/components/widgets/index.js +21 -20
  158. package/lib/components/widgets/index.js.map +1 -0
  159. package/lib/getDefaultRegistry.js +4 -3
  160. package/lib/getDefaultRegistry.js.map +1 -0
  161. package/lib/getTestRegistry.js +2 -1
  162. package/lib/getTestRegistry.js.map +1 -0
  163. package/lib/index.d.ts +12 -12
  164. package/lib/index.d.ts.map +1 -1
  165. package/lib/index.js +8 -7
  166. package/lib/index.js.map +1 -0
  167. package/lib/withTheme.d.ts +1 -1
  168. package/lib/withTheme.d.ts.map +1 -1
  169. package/lib/withTheme.js +2 -1
  170. package/lib/withTheme.js.map +1 -0
  171. package/package.json +13 -18
  172. package/src/components/Form.tsx +68 -47
  173. package/src/components/fields/ArrayField.tsx +17 -19
  174. package/src/components/fields/BooleanField.tsx +1 -2
  175. package/src/components/fields/LayoutGridField.tsx +57 -65
  176. package/src/components/fields/LayoutMultiSchemaField.tsx +18 -18
  177. package/src/components/fields/MultiSchemaField.tsx +6 -8
  178. package/src/components/fields/ObjectField.tsx +26 -27
  179. package/src/components/fields/SchemaField.tsx +13 -4
  180. package/src/components/fields/index.ts +14 -14
  181. package/src/components/templates/BaseInputTemplate.tsx +2 -2
  182. package/src/components/templates/ButtonTemplates/AddButton.tsx +1 -1
  183. package/src/components/templates/ButtonTemplates/index.ts +3 -3
  184. package/src/components/templates/DescriptionField.tsx +1 -1
  185. package/src/components/templates/FieldHelpTemplate.tsx +1 -1
  186. package/src/components/templates/FieldTemplate/FieldTemplate.tsx +1 -1
  187. package/src/components/templates/FieldTemplate/index.ts +1 -1
  188. package/src/components/templates/OptionalDataControlsTemplate.tsx +1 -1
  189. package/src/components/templates/WrapIfAdditionalTemplate.tsx +1 -1
  190. package/src/components/templates/index.ts +21 -21
  191. package/src/components/widgets/CheckboxWidget.tsx +9 -2
  192. package/src/components/widgets/RatingWidget.tsx +0 -1
  193. package/src/components/widgets/TimeWidget.tsx +18 -3
  194. package/src/components/widgets/index.ts +20 -20
  195. package/src/getDefaultRegistry.ts +3 -3
  196. package/src/getTestRegistry.tsx +1 -1
  197. package/src/index.ts +12 -12
  198. package/src/withTheme.tsx +2 -2
  199. package/lib/tsconfig.tsbuildinfo +0 -1
  200. package/src/tsconfig.json +0 -30
package/dist/core.umd.js CHANGED
@@ -1,12 +1,14 @@
1
1
  (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('react'), require('@rjsf/utils'), require('lodash/cloneDeep'), require('lodash/get'), require('lodash/isEmpty'), require('lodash/pick'), require('lodash/set'), require('lodash/toPath'), require('lodash/unset'), require('lodash/isObject'), require('lodash/uniqueId'), require('react/jsx-runtime'), require('lodash/each'), require('lodash/flatten'), require('lodash/has'), require('lodash/includes'), require('lodash/intersection'), require('lodash/isEqual'), require('lodash/isFunction'), require('lodash/isPlainObject'), require('lodash/isString'), require('lodash/isUndefined'), require('lodash/last'), require('lodash/noop'), require('lodash/omit'), require('markdown-to-jsx/react'), require('@rjsf/validator-ajv8')) :
3
- typeof define === 'function' && define.amd ? define(['exports', 'react', '@rjsf/utils', 'lodash/cloneDeep', 'lodash/get', 'lodash/isEmpty', 'lodash/pick', 'lodash/set', 'lodash/toPath', 'lodash/unset', 'lodash/isObject', 'lodash/uniqueId', 'react/jsx-runtime', 'lodash/each', 'lodash/flatten', 'lodash/has', 'lodash/includes', 'lodash/intersection', 'lodash/isEqual', 'lodash/isFunction', 'lodash/isPlainObject', 'lodash/isString', 'lodash/isUndefined', 'lodash/last', 'lodash/noop', 'lodash/omit', 'markdown-to-jsx/react', '@rjsf/validator-ajv8'], factory) :
4
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.JSONSchemaForm = {}, global.react, global.utils, global._cloneDeep, global.get, global.isEmpty, global._pick, global.set, global._toPath, global._unset, global.isObject, global.uniqueId, global.jsxRuntime, global.each, global.flatten, global.has, global.includes, global.intersection, global.isEqual, global.isFunction, global.isPlainObject, global.isString, global.isUndefined, global.last, global.noop, global.omit3, global.react$1, global.validator));
5
- })(this, (function (exports, react, utils, _cloneDeep, get, isEmpty, _pick, set, _toPath, _unset, isObject, uniqueId, jsxRuntime, each, flatten, has, includes, intersection, isEqual, isFunction, isPlainObject, isString, isUndefined, last, noop, omit3, react$1, validator) { 'use strict';
2
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('react'), require('@rjsf/utils'), require('react/jsx-runtime'), require('markdown-to-jsx/react'), require('@rjsf/validator-ajv8')) :
3
+ typeof define === 'function' && define.amd ? define(['exports', 'react', '@rjsf/utils', 'react/jsx-runtime', 'markdown-to-jsx/react', '@rjsf/validator-ajv8'], factory) :
4
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.JSONSchemaForm = {}, global.react, global.utils, global.jsxRuntime, global.react$1, global.validator));
5
+ })(this, (function (exports, react, utils, jsxRuntime, react$1, validator) { 'use strict';
6
6
 
7
7
  // src/components/Form.tsx
8
+ var rowIdCounter = 0;
8
9
  function generateRowId() {
9
- return uniqueId("rjsf-array-item-");
10
+ rowIdCounter += 1;
11
+ return `rjsf-array-item-${rowIdCounter}`;
10
12
  }
11
13
  function generateKeyedFormData(formData) {
12
14
  return !Array.isArray(formData) ? [] : formData.map((item) => ({
@@ -269,14 +271,14 @@
269
271
  const { description } = utils.getUiOptions(itemUiSchema);
270
272
  const hasDescription = !!description || !!itemSchema.description;
271
273
  const { orderable = true, removable = true, copyable = false } = uiOptions;
272
- const has4 = {
274
+ const has = {
273
275
  moveUp: orderable && canMoveUp,
274
276
  moveDown: orderable && canMoveDown,
275
277
  copy: copyable && canAdd,
276
278
  remove: removable && canRemove,
277
279
  toolbar: false
278
280
  };
279
- has4.toolbar = Object.keys(has4).some((key) => has4[key]);
281
+ has.toolbar = Object.keys(has).some((key) => has[key]);
280
282
  const onAddItem = react.useCallback(
281
283
  (event) => {
282
284
  handleAddItem(event, index + 1);
@@ -336,10 +338,10 @@
336
338
  disabled,
337
339
  readonly,
338
340
  canAdd,
339
- hasCopy: has4.copy,
340
- hasMoveUp: has4.moveUp,
341
- hasMoveDown: has4.moveDown,
342
- hasRemove: has4.remove,
341
+ hasCopy: has.copy,
342
+ hasMoveUp: has.moveUp,
343
+ hasMoveDown: has.moveDown,
344
+ hasRemove: has.remove,
343
345
  index,
344
346
  totalItems,
345
347
  onAddItem,
@@ -354,7 +356,7 @@
354
356
  itemKey,
355
357
  className: "rjsf-array-item",
356
358
  disabled,
357
- hasToolbar: has4.toolbar,
359
+ hasToolbar: has.toolbar,
358
360
  index,
359
361
  totalItems,
360
362
  readonly,
@@ -397,7 +399,7 @@
397
399
  const { schemaUtils, fields: fields2, formContext, globalUiOptions } = registry;
398
400
  const { OptionalDataControlsField: OptionalDataControlsField2 } = fields2;
399
401
  const uiOptions = react.useMemo(() => utils.getUiOptions(uiSchema, globalUiOptions), [uiSchema, globalUiOptions]);
400
- const schemaItems = react.useMemo(() => isObject(schema.items) ? schema.items : {}, [schema.items]);
402
+ const schemaItems = react.useMemo(() => utils.isObject(schema.items) ? schema.items : {}, [schema.items]);
401
403
  const itemsSchema = react.useMemo(() => schemaUtils.retrieveSchema(schemaItems), [schemaUtils, schemaItems]);
402
404
  const formData = react.useMemo(() => keyedToPlainFormData(keyedFormData), [keyedFormData]);
403
405
  const renderOptionalField = utils.shouldRenderOptionalField(registry, schema, required, uiSchema);
@@ -499,11 +501,8 @@
499
501
  const { OptionalDataControlsField: OptionalDataControlsField2 } = fields2;
500
502
  const renderOptionalField = utils.shouldRenderOptionalField(registry, schema, required, uiSchema);
501
503
  const hasFormData = utils.isFormDataAvailable(formData);
502
- const schemaItems = react.useMemo(
503
- () => isObject(schema.items) ? schema.items : [],
504
- [schema.items]
505
- );
506
- const hasAdditionalItems = isObject(schema.additionalItems);
504
+ const schemaItems = react.useMemo(() => Array.isArray(schema.items) ? schema.items : [], [schema.items]);
505
+ const hasAdditionalItems = utils.isObject(schema.additionalItems);
507
506
  const childFieldPathId = props.childFieldPathId ?? fieldPathId;
508
507
  if (items.length < schemaItems.length) {
509
508
  items = items.concat(new Array(schemaItems.length - items.length));
@@ -522,7 +521,7 @@
522
521
  const { key, item } = keyedItem;
523
522
  const itemCast = item;
524
523
  const additional = index >= schemaItems.length;
525
- const rawItemSchema = (additional && isObject(schema.additionalItems) ? schema.additionalItems : schemaItems[index]) || {};
524
+ const rawItemSchema = (additional && utils.isObject(schema.additionalItems) ? schema.additionalItems : schemaItems[index]) || {};
526
525
  let itemUiSchema;
527
526
  if (additional) {
528
527
  itemUiSchema = uiSchema.additionalItems;
@@ -625,9 +624,9 @@
625
624
  for (const idx of Object.keys(errorSchemaRef.current)) {
626
625
  const i = parseInt(idx, 10);
627
626
  if (index === void 0 || i < index) {
628
- set(newErrorSchema, [i], errorSchemaRef.current[i]);
627
+ utils.setByPath(newErrorSchema, i, errorSchemaRef.current[i]);
629
628
  } else if (i >= index) {
630
- set(newErrorSchema, [i + 1], errorSchemaRef.current[i]);
629
+ utils.setByPath(newErrorSchema, i + 1, errorSchemaRef.current[i]);
631
630
  }
632
631
  }
633
632
  }
@@ -656,15 +655,15 @@
656
655
  for (const idx of Object.keys(errorSchemaRef.current)) {
657
656
  const i = parseInt(idx, 10);
658
657
  if (i <= index) {
659
- set(newErrorSchema, [i], errorSchemaRef.current[i]);
658
+ utils.setByPath(newErrorSchema, i, errorSchemaRef.current[i]);
660
659
  } else if (i > index) {
661
- set(newErrorSchema, [i + 1], errorSchemaRef.current[i]);
660
+ utils.setByPath(newErrorSchema, i + 1, errorSchemaRef.current[i]);
662
661
  }
663
662
  }
664
663
  }
665
664
  const newKeyedFormDataRow = {
666
665
  key: generateRowId(),
667
- item: _cloneDeep(keyedFormDataRef.current[index].item)
666
+ item: structuredClone(keyedFormDataRef.current[index].item)
668
667
  };
669
668
  const newKeyedFormData = [...keyedFormDataRef.current];
670
669
  if (index !== void 0) {
@@ -687,9 +686,9 @@
687
686
  for (const idx of Object.keys(errorSchemaRef.current)) {
688
687
  const i = parseInt(idx, 10);
689
688
  if (i < index) {
690
- set(newErrorSchema, [i], errorSchemaRef.current[i]);
689
+ utils.setByPath(newErrorSchema, i, errorSchemaRef.current[i]);
691
690
  } else if (i > index) {
692
- set(newErrorSchema, [i - 1], errorSchemaRef.current[i]);
691
+ utils.setByPath(newErrorSchema, i - 1, errorSchemaRef.current[i]);
693
692
  }
694
693
  }
695
694
  }
@@ -710,11 +709,11 @@
710
709
  for (const idx of Object.keys(errorSchemaRef.current)) {
711
710
  const i = parseInt(idx, 10);
712
711
  if (i === index) {
713
- set(newErrorSchema, [newIndex], errorSchemaRef.current[index]);
712
+ utils.setByPath(newErrorSchema, newIndex, errorSchemaRef.current[index]);
714
713
  } else if (i === newIndex) {
715
- set(newErrorSchema, [index], errorSchemaRef.current[newIndex]);
714
+ utils.setByPath(newErrorSchema, index, errorSchemaRef.current[newIndex]);
716
715
  } else {
717
- set(newErrorSchema, [idx], errorSchemaRef.current[i]);
716
+ utils.setByPath(newErrorSchema, idx, errorSchemaRef.current[i]);
718
717
  }
719
718
  }
720
719
  }
@@ -839,7 +838,7 @@
839
838
  enumOptions = utils.optionsList(
840
839
  {
841
840
  oneOf: schema.oneOf.map((option) => {
842
- if (isObject(option)) {
841
+ if (utils.isObject(option)) {
843
842
  return {
844
843
  ...option,
845
844
  title: option.title || (option.const === true ? yes : no)
@@ -1051,37 +1050,38 @@
1051
1050
  }
1052
1051
  var LAYOUT_GRID_FIELD_TEST_IDS = utils.getTestIds();
1053
1052
  function computeFieldUiSchema(field, uiProps, uiSchema, schemaReadonly, forceReadonly) {
1054
- const globalUiOptions = get(uiSchema, [utils.UI_GLOBAL_OPTIONS_KEY], {});
1055
- const localUiSchema = get(uiSchema, field);
1056
- const localUiOptions = { ...get(localUiSchema, [utils.UI_OPTIONS_KEY], {}), ...uiProps, ...globalUiOptions };
1053
+ const globalUiOptions = uiSchema?.[utils.UI_GLOBAL_OPTIONS_KEY] ?? {};
1054
+ const localUiSchema = utils.getByPath(uiSchema, utils.toPath(field));
1055
+ const localUiOptions = { ...localUiSchema?.[utils.UI_OPTIONS_KEY] ?? {}, ...uiProps, ...globalUiOptions };
1057
1056
  const fieldUiSchema = { ...localUiSchema };
1058
- if (!isEmpty(localUiOptions)) {
1059
- set(fieldUiSchema, [utils.UI_OPTIONS_KEY], localUiOptions);
1057
+ if (Object.keys(localUiOptions).length > 0) {
1058
+ fieldUiSchema[utils.UI_OPTIONS_KEY] = localUiOptions;
1060
1059
  }
1061
- if (!isEmpty(globalUiOptions)) {
1062
- set(fieldUiSchema, [utils.UI_GLOBAL_OPTIONS_KEY], globalUiOptions);
1060
+ if (Object.keys(globalUiOptions).length > 0) {
1061
+ fieldUiSchema[utils.UI_GLOBAL_OPTIONS_KEY] = globalUiOptions;
1063
1062
  }
1064
1063
  let { readonly: uiReadonly } = utils.getUiOptions(fieldUiSchema);
1065
- if (forceReadonly === true || isUndefined(uiReadonly) && schemaReadonly === true) {
1064
+ if (forceReadonly === true || uiReadonly === void 0 && schemaReadonly === true) {
1066
1065
  uiReadonly = true;
1067
- if (has(localUiOptions, utils.READONLY_KEY)) {
1068
- set(fieldUiSchema, [utils.UI_OPTIONS_KEY, utils.READONLY_KEY], true);
1066
+ const fieldUiOptions = fieldUiSchema[utils.UI_OPTIONS_KEY];
1067
+ if (fieldUiOptions && utils.READONLY_KEY in fieldUiOptions) {
1068
+ fieldUiOptions[utils.READONLY_KEY] = true;
1069
1069
  } else {
1070
- set(fieldUiSchema, `ui:${utils.READONLY_KEY}`, true);
1070
+ fieldUiSchema[`ui:${utils.READONLY_KEY}`] = true;
1071
1071
  }
1072
1072
  }
1073
1073
  return { fieldUiSchema, uiReadonly };
1074
1074
  }
1075
1075
  function conditionMatches(operator, datum, value = "$0m3tH1nG Un3xP3cT3d") {
1076
- const data = flatten([datum]).sort();
1077
- const values = flatten([value]).sort();
1076
+ const data = [datum].flat().sort();
1077
+ const values = [value].flat().sort();
1078
1078
  switch (operator) {
1079
1079
  case "all" /* ALL */:
1080
- return isEqual(data, values);
1080
+ return utils.deepEquals(data, values);
1081
1081
  case "some" /* SOME */:
1082
- return intersection(data, values).length > 0;
1082
+ return data.some((entry) => values.includes(entry));
1083
1083
  case "none" /* NONE */:
1084
- return intersection(data, values).length === 0;
1084
+ return !data.some((entry) => values.includes(entry));
1085
1085
  default:
1086
1086
  return false;
1087
1087
  }
@@ -1089,7 +1089,7 @@
1089
1089
  function findChildrenAndProps(layoutGridSchema, schemaKey, registry) {
1090
1090
  let gridProps = {};
1091
1091
  let children = layoutGridSchema[schemaKey];
1092
- if (isPlainObject(children)) {
1092
+ if (utils.isPlainObject(children)) {
1093
1093
  const { children: elements, className: toMapClassNames, ...otherProps } = children;
1094
1094
  children = elements;
1095
1095
  if (toMapClassNames) {
@@ -1108,12 +1108,12 @@
1108
1108
  function computeArraySchemasIfPresent(schema, fieldPathId, potentialIndex) {
1109
1109
  let rawSchema;
1110
1110
  let resultPathId = fieldPathId;
1111
- if (isNumericIndex(potentialIndex) && schema && schema?.type === "array" && has(schema, utils.ITEMS_KEY)) {
1111
+ if (isNumericIndex(potentialIndex) && schema && schema?.type === "array" && utils.ITEMS_KEY in schema) {
1112
1112
  const index = Number(potentialIndex);
1113
1113
  const items = schema[utils.ITEMS_KEY];
1114
1114
  if (Array.isArray(items)) {
1115
1115
  if (index > items.length) {
1116
- rawSchema = last(items);
1116
+ rawSchema = items.at(-1);
1117
1117
  } else {
1118
1118
  rawSchema = items[index];
1119
1119
  }
@@ -1138,44 +1138,45 @@
1138
1138
  let isReadonly = schema.readOnly;
1139
1139
  parts.forEach((part) => {
1140
1140
  fieldPathId = utils.toFieldPathId(part, globalFormOptions, fieldPathId);
1141
- if (has(schema, utils.PROPERTIES_KEY)) {
1142
- rawSchema = get(schema, [utils.PROPERTIES_KEY, part], {});
1143
- } else if (schema && (has(schema, utils.ONE_OF_KEY) || has(schema, utils.ANY_OF_KEY))) {
1144
- const xxx = has(schema, utils.ONE_OF_KEY) ? utils.ONE_OF_KEY : utils.ANY_OF_KEY;
1141
+ const schemaProperties = schema?.[utils.PROPERTIES_KEY];
1142
+ if (schemaProperties) {
1143
+ rawSchema = schemaProperties[part] ?? {};
1144
+ } else if (schema && (utils.ONE_OF_KEY in schema || utils.ANY_OF_KEY in schema)) {
1145
+ const xxx = utils.ONE_OF_KEY in schema ? utils.ONE_OF_KEY : utils.ANY_OF_KEY;
1145
1146
  const selectedSchema = schemaUtils.findSelectedOptionInXxxOf(schema, part, xxx, innerData);
1146
- rawSchema = get(selectedSchema, [utils.PROPERTIES_KEY, part], {});
1147
+ rawSchema = utils.getPropertySchema(selectedSchema, part);
1147
1148
  } else {
1148
1149
  const result = computeArraySchemasIfPresent(schema, fieldPathId, part);
1149
1150
  rawSchema = result.rawSchema ?? {};
1150
1151
  fieldPathId = result.fieldPathId;
1151
1152
  }
1152
- innerData = get(innerData, part, {});
1153
+ innerData = utils.getByPath(innerData, part, {});
1153
1154
  schema = schemaUtils.retrieveSchema(rawSchema, innerData);
1154
1155
  isReadonly = getNonNullishValue(schema.readOnly, isReadonly);
1155
1156
  });
1156
1157
  let optionsInfo;
1157
1158
  let isRequired2 = false;
1158
- if (isEmpty(schema)) {
1159
+ if (!schema || Object.keys(schema).length === 0) {
1159
1160
  schema = void 0;
1160
1161
  }
1161
1162
  if (schema && leafPath) {
1162
- if (schema && (has(schema, utils.ONE_OF_KEY) || has(schema, utils.ANY_OF_KEY))) {
1163
- const xxx = has(schema, utils.ONE_OF_KEY) ? utils.ONE_OF_KEY : utils.ANY_OF_KEY;
1163
+ if (schema && (utils.ONE_OF_KEY in schema || utils.ANY_OF_KEY in schema)) {
1164
+ const xxx = utils.ONE_OF_KEY in schema ? utils.ONE_OF_KEY : utils.ANY_OF_KEY;
1164
1165
  schema = schemaUtils.findSelectedOptionInXxxOf(schema, leafPath, xxx, innerData);
1165
1166
  }
1166
1167
  fieldPathId = utils.toFieldPathId(leafPath, globalFormOptions, fieldPathId);
1167
- isRequired2 = schema !== void 0 && Array.isArray(schema.required) && includes(schema.required, leafPath);
1168
+ isRequired2 = schema !== void 0 && Array.isArray(schema.required) && schema.required.includes(leafPath);
1168
1169
  const result = computeArraySchemasIfPresent(schema, fieldPathId, leafPath);
1169
1170
  if (result.rawSchema) {
1170
1171
  schema = result.rawSchema;
1171
1172
  fieldPathId = result.fieldPathId;
1172
1173
  } else {
1173
- schema = get(schema, [utils.PROPERTIES_KEY, leafPath]);
1174
+ schema = schema?.[utils.PROPERTIES_KEY]?.[leafPath];
1174
1175
  schema = schema ? schemaUtils.retrieveSchema(schema) : schema;
1175
1176
  }
1176
1177
  isReadonly = getNonNullishValue(schema?.readOnly, isReadonly);
1177
- if (schema && (has(schema, utils.ONE_OF_KEY) || has(schema, utils.ANY_OF_KEY))) {
1178
- const xxx = has(schema, utils.ONE_OF_KEY) ? utils.ONE_OF_KEY : utils.ANY_OF_KEY;
1178
+ if (schema && (utils.ONE_OF_KEY in schema || utils.ANY_OF_KEY in schema)) {
1179
+ const xxx = utils.ONE_OF_KEY in schema ? utils.ONE_OF_KEY : utils.ANY_OF_KEY;
1179
1180
  const discriminator = utils.getDiscriminatorFieldFromSchema(schema);
1180
1181
  optionsInfo = { options: schema[xxx], hasDiscriminator: !!discriminator };
1181
1182
  }
@@ -1184,10 +1185,10 @@
1184
1185
  }
1185
1186
  function getCustomRenderComponent(render, registry) {
1186
1187
  let customRenderer = render;
1187
- if (isString(customRenderer)) {
1188
+ if (typeof customRenderer === "string") {
1188
1189
  customRenderer = utils.lookupFromFormContext(registry, customRenderer);
1189
1190
  }
1190
- if (isFunction(customRenderer)) {
1191
+ if (typeof customRenderer === "function") {
1191
1192
  return customRenderer;
1192
1193
  }
1193
1194
  return null;
@@ -1197,23 +1198,21 @@
1197
1198
  let UIComponent = null;
1198
1199
  let uiProps = {};
1199
1200
  let rendered;
1200
- if (isString(gridSchema) || isUndefined(gridSchema)) {
1201
+ if (typeof gridSchema === "string" || gridSchema === void 0) {
1201
1202
  name = gridSchema ?? "";
1202
1203
  } else {
1203
1204
  const { name: innerName = "", render, ...innerProps } = gridSchema;
1204
1205
  name = innerName;
1205
1206
  uiProps = innerProps;
1206
- if (!isEmpty(uiProps)) {
1207
- each(uiProps, (prop, key) => {
1208
- if (isString(prop)) {
1209
- const match = LOOKUP_REGEX.exec(prop);
1210
- if (Array.isArray(match) && match.length > 1) {
1211
- const lookupName = match[1];
1212
- uiProps[key] = utils.lookupFromFormContext(registry, lookupName, lookupName);
1213
- }
1207
+ Object.entries(uiProps).forEach(([key, prop]) => {
1208
+ if (typeof prop === "string") {
1209
+ const match = LOOKUP_REGEX.exec(prop);
1210
+ if (Array.isArray(match) && match.length > 1) {
1211
+ const lookupName = match[1];
1212
+ uiProps[key] = utils.lookupFromFormContext(registry, lookupName, lookupName);
1214
1213
  }
1215
- });
1216
- }
1214
+ }
1215
+ });
1217
1216
  UIComponent = getCustomRenderComponent(render, registry);
1218
1217
  if (!innerName && UIComponent) {
1219
1218
  rendered = /* @__PURE__ */ jsxRuntime.jsx(UIComponent, { ...innerProps, "data-testid": LAYOUT_GRID_FIELD_TEST_IDS.uiComponent });
@@ -1241,7 +1240,7 @@
1241
1240
  const { formData, registry } = layoutGridFieldProps;
1242
1241
  const { children, gridProps } = findChildrenAndProps(layoutGridSchema, "ui:condition" /* CONDITION */, registry);
1243
1242
  const { operator, field = "", value } = gridProps;
1244
- const fieldData = get(formData, field, null);
1243
+ const fieldData = utils.getByPath(formData, utils.toPath(field), null);
1245
1244
  if (conditionMatches(operator, fieldData, value)) {
1246
1245
  return /* @__PURE__ */ jsxRuntime.jsx(LayoutGridFieldChildren, { ...layoutGridFieldProps, childrenLayoutGridSchemaId: children });
1247
1246
  }
@@ -1315,6 +1314,7 @@
1315
1314
  if (schema) {
1316
1315
  const Field = optionsInfo?.hasDiscriminator ? LayoutMultiSchemaField2 : SchemaField2;
1317
1316
  const { fieldUiSchema, uiReadonly } = computeFieldUiSchema(name, uiProps, uiSchema, isReadonly, readonly);
1317
+ const namePath = utils.toPath(name);
1318
1318
  return /* @__PURE__ */ jsxRuntime.jsx(
1319
1319
  Field,
1320
1320
  {
@@ -1325,9 +1325,9 @@
1325
1325
  readonly: uiReadonly,
1326
1326
  schema,
1327
1327
  uiSchema: fieldUiSchema,
1328
- errorSchema: get(errorSchema, name),
1328
+ errorSchema: utils.getByPath(errorSchema, namePath),
1329
1329
  fieldPathId: memoFieldPathId,
1330
- formData: get(formData, name),
1330
+ formData: utils.getByPath(formData, namePath),
1331
1331
  onChange,
1332
1332
  onBlur,
1333
1333
  onFocus,
@@ -1363,10 +1363,10 @@
1363
1363
  const { uiSchema } = props;
1364
1364
  let { layoutGridSchema } = props;
1365
1365
  const uiOptions = utils.getUiOptions(uiSchema);
1366
- if (!layoutGridSchema && LAYOUT_GRID_UI_OPTION in uiOptions && isObject(uiOptions[LAYOUT_GRID_UI_OPTION])) {
1366
+ if (!layoutGridSchema && LAYOUT_GRID_UI_OPTION in uiOptions && utils.isObject(uiOptions[LAYOUT_GRID_UI_OPTION])) {
1367
1367
  layoutGridSchema = uiOptions[LAYOUT_GRID_UI_OPTION];
1368
1368
  }
1369
- if (isObject(layoutGridSchema)) {
1369
+ if (utils.isObject(layoutGridSchema)) {
1370
1370
  if ("ui:row" /* ROW */ in layoutGridSchema) {
1371
1371
  return /* @__PURE__ */ jsxRuntime.jsx(LayoutGridRow, { ...props, layoutGridSchema });
1372
1372
  }
@@ -1413,17 +1413,17 @@
1413
1413
  const defaultValue = "!@#!@$@#$!@$#";
1414
1414
  const schemaOptions = options.map(({ schema }) => schema);
1415
1415
  return schemaOptions.find((option) => {
1416
- const selector = get(option, [utils.PROPERTIES_KEY, selectorField]);
1417
- const result = get(selector, utils.DEFAULT_KEY, get(selector, utils.CONST_KEY, defaultValue));
1416
+ const selector = option[utils.PROPERTIES_KEY]?.[selectorField];
1417
+ const result = utils.getByPath(selector, utils.DEFAULT_KEY, utils.getByPath(selector, utils.CONST_KEY, defaultValue));
1418
1418
  return result === value;
1419
1419
  });
1420
1420
  }
1421
1421
  function computeEnumOptions(schema, options, schemaUtils, uiSchema, formData) {
1422
1422
  const realOptions = options.map((opt) => schemaUtils.retrieveSchema(opt, formData));
1423
1423
  let tempSchema = schema;
1424
- if (has(schema, utils.ONE_OF_KEY)) {
1424
+ if (utils.ONE_OF_KEY in schema) {
1425
1425
  tempSchema = { ...schema, [utils.ONE_OF_KEY]: realOptions };
1426
- } else if (has(schema, utils.ANY_OF_KEY)) {
1426
+ } else if (utils.ANY_OF_KEY in schema) {
1427
1427
  tempSchema = { ...schema, [utils.ANY_OF_KEY]: realOptions };
1428
1428
  }
1429
1429
  const enumOptions = utils.optionsList(tempSchema, uiSchema);
@@ -1454,7 +1454,7 @@
1454
1454
  } = props;
1455
1455
  const { widgets: widgets2, schemaUtils, globalUiOptions } = registry;
1456
1456
  const [enumOptions, setEnumOptions] = react.useState(computeEnumOptions(schema, options, schemaUtils, uiSchema, formData));
1457
- const id = get(fieldPathId, utils.ID_KEY);
1457
+ const id = fieldPathId[utils.ID_KEY];
1458
1458
  const discriminator = utils.getDiscriminatorFieldFromSchema(schema);
1459
1459
  const FieldErrorTemplate2 = utils.getTemplate("FieldErrorTemplate", registry, options);
1460
1460
  const FieldTemplate2 = utils.getTemplate("FieldTemplate", registry, options);
@@ -1476,14 +1476,15 @@
1476
1476
  if (!selectorField) {
1477
1477
  throw new Error("No selector field provided for the LayoutMultiSchemaField");
1478
1478
  }
1479
- const selectedOption = get(formData, selectorField);
1480
- let optionSchema = get(enumOptions[0]?.schema, [utils.PROPERTIES_KEY, selectorField], {});
1479
+ const selectedOption = utils.getByPath(formData, selectorField);
1480
+ let optionSchema = utils.getPropertySchema(enumOptions[0]?.schema, selectorField);
1481
1481
  const option = getSelectedOption(enumOptions, selectorField, selectedOption);
1482
1482
  optionSchema = optionSchema?.type ? optionSchema : { ...optionSchema, type: option?.type || baseType };
1483
1483
  const Widget = utils.getWidget(optionSchema, widget, widgets2);
1484
1484
  const hideFieldError = uiSchemaHideError === void 0 ? hideError : Boolean(uiSchemaHideError);
1485
- const rawErrors = get(errorSchema, [utils.ERRORS_KEY], []);
1486
- const fieldErrorSchema = omit3(errorSchema, [utils.ERRORS_KEY]);
1485
+ const rawErrors = errorSchema?.[utils.ERRORS_KEY] ?? [];
1486
+ const fieldErrorSchema = { ...errorSchema };
1487
+ delete fieldErrorSchema[utils.ERRORS_KEY];
1487
1488
  const displayLabel = schemaUtils.getDisplayLabel(schema, uiSchema, globalUiOptions);
1488
1489
  const onOptionChange = (opt) => {
1489
1490
  if (disabled || readonly) {
@@ -1496,7 +1497,7 @@
1496
1497
  newFormData = schemaUtils.getDefaultFormState(newOption, newFormData, "excludeObjectChildren");
1497
1498
  }
1498
1499
  if (newFormData) {
1499
- set(newFormData, selectorField, opt);
1500
+ utils.setByPath(newFormData, selectorField, opt);
1500
1501
  }
1501
1502
  onChange(newFormData, fieldPathId.path, void 0, id);
1502
1503
  };
@@ -1509,7 +1510,7 @@
1509
1510
  id,
1510
1511
  schema,
1511
1512
  label: (title || schema.title) ?? "",
1512
- disabled: disabled || Array.isArray(enumOptions) && isEmpty(enumOptions),
1513
+ disabled: disabled || Array.isArray(enumOptions) && enumOptions.length === 0,
1513
1514
  uiSchema,
1514
1515
  required,
1515
1516
  readonly: !!readonly,
@@ -1517,9 +1518,9 @@
1517
1518
  displayLabel,
1518
1519
  errors,
1519
1520
  onChange,
1520
- onKeyRename: noop,
1521
- onKeyRenameBlur: noop,
1522
- onRemoveProperty: noop,
1521
+ onKeyRename: utils.noop,
1522
+ onKeyRenameBlur: utils.noop,
1523
+ onRemoveProperty: utils.noop,
1523
1524
  children: /* @__PURE__ */ jsxRuntime.jsx(
1524
1525
  Widget,
1525
1526
  {
@@ -1527,7 +1528,7 @@
1527
1528
  name,
1528
1529
  schema,
1529
1530
  label: (title || schema.title) ?? "",
1530
- disabled: disabled || Array.isArray(enumOptions) && isEmpty(enumOptions),
1531
+ disabled: disabled || Array.isArray(enumOptions) && enumOptions.length === 0,
1531
1532
  uiSchema,
1532
1533
  autofocus,
1533
1534
  readonly,
@@ -1554,7 +1555,7 @@
1554
1555
  const {
1555
1556
  name,
1556
1557
  disabled = false,
1557
- errorSchema = {},
1558
+ errorSchema,
1558
1559
  formData,
1559
1560
  fieldPathId,
1560
1561
  onBlur,
@@ -1644,8 +1645,9 @@
1644
1645
  ...uiOptions
1645
1646
  } = utils.getUiOptions(uiSchema, globalUiOptions);
1646
1647
  const Widget = utils.getWidget({ type: "number" }, widget, widgets2);
1647
- const rawErrors = get(errorSchema, utils.ERRORS_KEY, []);
1648
- const fieldErrorSchema = omit3(errorSchema, [utils.ERRORS_KEY]);
1648
+ const rawErrors = errorSchema?.[utils.ERRORS_KEY] ?? [];
1649
+ const fieldErrorSchema = { ...errorSchema };
1650
+ delete fieldErrorSchema[utils.ERRORS_KEY];
1649
1651
  const displayLabel = schemaUtils.getDisplayLabel(schema, uiSchema, globalUiOptions);
1650
1652
  const option = selectedOption >= 0 ? retrievedOptions[selectedOption] || null : null;
1651
1653
  let optionSchema;
@@ -1696,7 +1698,7 @@
1696
1698
  onChange: onOptionChange,
1697
1699
  onBlur,
1698
1700
  onFocus,
1699
- disabled: disabled || isEmpty(enumOptions),
1701
+ disabled: disabled || enumOptions.length === 0,
1700
1702
  multiple: false,
1701
1703
  rawErrors,
1702
1704
  errorSchema: fieldErrorSchema,
@@ -1832,12 +1834,12 @@
1832
1834
  const onPropertyChange = react.useCallback(
1833
1835
  (value, path, newErrorSchema, id) => {
1834
1836
  let normalizedValue = value;
1835
- if (value === void 0 && addedByAdditionalProperties) {
1837
+ if (value === void 0 && addedByAdditionalProperties && utils.deepEquals(path, innerFieldIdPathId.path)) {
1836
1838
  normalizedValue = "";
1837
1839
  }
1838
1840
  onChange(normalizedValue, path, newErrorSchema, id);
1839
1841
  },
1840
- [onChange, addedByAdditionalProperties]
1842
+ [onChange, addedByAdditionalProperties, innerFieldIdPathId]
1841
1843
  );
1842
1844
  const onKeyRename = react.useCallback(
1843
1845
  (value) => {
@@ -1932,7 +1934,7 @@
1932
1934
  const { duplicateKeySuffixSeparator = "-" } = utils.getUiOptions(uiSchema, globalUiOptions);
1933
1935
  let index = 0;
1934
1936
  let newKey = preferredKey;
1935
- while (has(existingFormData, newKey)) {
1937
+ while (utils.hasByPath(existingFormData, newKey)) {
1936
1938
  index += 1;
1937
1939
  newKey = `${preferredKey}${duplicateKeySuffixSeparator}${index}`;
1938
1940
  }
@@ -1947,12 +1949,12 @@
1947
1949
  const newFormData = { ...formData };
1948
1950
  const newKey = getAvailableKey("newKey", newFormData);
1949
1951
  if (schema.patternProperties) {
1950
- set(newFormData, newKey, null);
1952
+ utils.setByPath(newFormData, newKey, null);
1951
1953
  } else {
1952
1954
  let type = void 0;
1953
1955
  let constValue = void 0;
1954
1956
  let defaultValue = void 0;
1955
- if (isObject(schema.additionalProperties)) {
1957
+ if (utils.isObject(schema.additionalProperties)) {
1956
1958
  type = schema.additionalProperties.type;
1957
1959
  constValue = schema.additionalProperties.const;
1958
1960
  defaultValue = schema.additionalProperties.default;
@@ -1968,7 +1970,7 @@
1968
1970
  }
1969
1971
  }
1970
1972
  const newValue = constValue ?? defaultValue ?? getDefaultValue(translateString, type);
1971
- set(newFormData, newKey, newValue);
1973
+ utils.setByPath(newFormData, newKey, newValue);
1972
1974
  }
1973
1975
  if (lastRenamedProperty.current.previousKey === newKey) {
1974
1976
  lastRenamedProperty.current.currentKey = newKey;
@@ -2044,11 +2046,11 @@
2044
2046
  {
2045
2047
  propertyName,
2046
2048
  required: isRequired(schema, propertyName),
2047
- schema: get(schema, [utils.PROPERTIES_KEY, propertyName], {}),
2049
+ schema: utils.getPropertySchema(schema, propertyName),
2048
2050
  uiSchema: fieldUiSchema,
2049
- errorSchema: get(errorSchema, [propertyName]),
2051
+ errorSchema: utils.getByPath(errorSchema, propertyName),
2050
2052
  fieldPathId: childFieldPathId,
2051
- formData: get(formData, [propertyName]),
2053
+ formData: utils.getByPath(formData, propertyName),
2052
2054
  handleKeyRename,
2053
2055
  handleRemoveProperty,
2054
2056
  addedByAdditionalProperties,
@@ -2232,12 +2234,12 @@
2232
2234
  if (schema[utils.ANY_OF_KEY]) {
2233
2235
  XxxOfField = _AnyOfField;
2234
2236
  XxxOfOptions = schema[utils.ANY_OF_KEY].map(
2235
- (xxxOfSchema) => schemaUtils.retrieveSchema(isObject(xxxOfSchema) ? xxxOfSchema : {}, formData)
2237
+ (xxxOfSchema) => schemaUtils.retrieveSchema(utils.isObject(xxxOfSchema) ? xxxOfSchema : {}, formData)
2236
2238
  );
2237
2239
  } else if (schema[utils.ONE_OF_KEY]) {
2238
2240
  XxxOfField = _OneOfField;
2239
2241
  XxxOfOptions = schema[utils.ONE_OF_KEY].map(
2240
- (xxxOfSchema) => schemaUtils.retrieveSchema(isObject(xxxOfSchema) ? xxxOfSchema : {}, formData)
2242
+ (xxxOfSchema) => schemaUtils.retrieveSchema(utils.isObject(xxxOfSchema) ? xxxOfSchema : {}, formData)
2241
2243
  );
2242
2244
  }
2243
2245
  const isOptionalRender = utils.shouldRenderOptionalField(registry, schema, required, uiSchema);
@@ -2251,9 +2253,19 @@
2251
2253
  };
2252
2254
  }
2253
2255
  const { __errors, ...fieldErrorSchema } = errorSchema || {};
2254
- const fieldUiSchema = omit3(uiSchema, ["ui:classNames", "classNames", "ui:style"]);
2256
+ const {
2257
+ "ui:classNames": consumedUiClassNames,
2258
+ classNames: consumedClassNames,
2259
+ "ui:style": consumedUiStyle,
2260
+ ...fieldUiSchema
2261
+ } = uiSchema;
2255
2262
  if (utils.UI_OPTIONS_KEY in fieldUiSchema) {
2256
- fieldUiSchema[utils.UI_OPTIONS_KEY] = omit3(fieldUiSchema[utils.UI_OPTIONS_KEY], ["classNames", "style"]);
2263
+ const {
2264
+ classNames: consumedOptionClassNames,
2265
+ style: consumedOptionStyle,
2266
+ ...fieldUiOptions
2267
+ } = fieldUiSchema[utils.UI_OPTIONS_KEY];
2268
+ fieldUiSchema[utils.UI_OPTIONS_KEY] = fieldUiOptions;
2257
2269
  }
2258
2270
  const field = /* @__PURE__ */ jsxRuntime.jsx(
2259
2271
  FieldComponent,
@@ -2738,7 +2750,7 @@
2738
2750
  (e) => {
2739
2751
  e.preventDefault();
2740
2752
  e.stopPropagation();
2741
- onChange(options.emptyValue ?? "");
2753
+ onChange(options.emptyValue);
2742
2754
  },
2743
2755
  [onChange, options.emptyValue]
2744
2756
  );
@@ -3346,14 +3358,15 @@
3346
3358
  onFocus,
3347
3359
  onChange,
3348
3360
  registry,
3349
- htmlName
3361
+ htmlName,
3362
+ required
3350
3363
  }) {
3351
3364
  const DescriptionFieldTemplate = utils.getTemplate(
3352
3365
  "DescriptionFieldTemplate",
3353
3366
  registry,
3354
3367
  options
3355
3368
  );
3356
- const required = utils.schemaRequiresTrueValue(schema);
3369
+ const trueValueRequired = utils.schemaRequiresTrueValue(schema) && required;
3357
3370
  const handleChange = react.useCallback(
3358
3371
  (event) => onChange(event.target.checked),
3359
3372
  [onChange]
@@ -3397,7 +3410,13 @@
3397
3410
  "aria-describedby": utils.ariaDescribedByIds(id)
3398
3411
  }
3399
3412
  ),
3400
- utils.labelValue(/* @__PURE__ */ jsxRuntime.jsx("span", { children: label }), hideLabel)
3413
+ utils.labelValue(
3414
+ /* @__PURE__ */ jsxRuntime.jsxs("span", { children: [
3415
+ label,
3416
+ trueValueRequired && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "required", children: "*" })
3417
+ ] }),
3418
+ hideLabel
3419
+ )
3401
3420
  ] })
3402
3421
  ] });
3403
3422
  }
@@ -3592,7 +3611,6 @@
3592
3611
  required,
3593
3612
  disabled,
3594
3613
  readonly,
3595
- autofocus,
3596
3614
  onChange,
3597
3615
  onFocus,
3598
3616
  onBlur,
@@ -3838,10 +3856,23 @@
3838
3856
  return /* @__PURE__ */ jsxRuntime.jsx(BaseInputTemplate2, { ...props });
3839
3857
  }
3840
3858
  function TimeWidget(props) {
3841
- const { onChange, options, registry } = props;
3859
+ const { onChange, options, registry, schema, value } = props;
3842
3860
  const BaseInputTemplate2 = utils.getTemplate("BaseInputTemplate", registry, options);
3843
- const handleChange = react.useCallback((value) => onChange(value ? `${value}:00` : void 0), [onChange]);
3844
- return /* @__PURE__ */ jsxRuntime.jsx(BaseInputTemplate2, { type: "time", ...props, onChange: handleChange });
3861
+ const hasSecondPrecision = typeof schema.multipleOf === "number" && Number.isFinite(schema.multipleOf) && schema.multipleOf < 60;
3862
+ const handleChange = react.useCallback(
3863
+ (newValue) => {
3864
+ if (!newValue) {
3865
+ onChange(void 0);
3866
+ } else if (hasSecondPrecision) {
3867
+ onChange(newValue);
3868
+ } else {
3869
+ onChange(`${newValue}:00`);
3870
+ }
3871
+ },
3872
+ [hasSecondPrecision, onChange]
3873
+ );
3874
+ const displayValue = typeof value === "string" && !hasSecondPrecision && /^\d{2}:\d{2}:00$/.test(value) ? value.slice(0, -3) : value;
3875
+ return /* @__PURE__ */ jsxRuntime.jsx(BaseInputTemplate2, { type: "time", ...props, value: displayValue, onChange: handleChange });
3845
3876
  }
3846
3877
  function UpDownWidget(props) {
3847
3878
  const { options, registry } = props;
@@ -3898,8 +3929,16 @@
3898
3929
  };
3899
3930
  }
3900
3931
  function toIChangeEvent(state, status) {
3932
+ const { schema, uiSchema, fieldPathId, schemaUtils, formData, edit, errors, errorSchema } = state;
3901
3933
  return {
3902
- ..._pick(state, ["schema", "uiSchema", "fieldPathId", "schemaUtils", "formData", "edit", "errors", "errorSchema"]),
3934
+ schema,
3935
+ uiSchema,
3936
+ fieldPathId,
3937
+ schemaUtils,
3938
+ formData,
3939
+ edit,
3940
+ errors,
3941
+ errorSchema,
3903
3942
  ...status !== void 0 && { status }
3904
3943
  };
3905
3944
  }
@@ -3998,7 +4037,9 @@
3998
4037
  // match one of the subSchemas, the retrieved schema must be updated.
3999
4038
  isSchemaChanged || isFormDataChanged ? void 0 : this.state.retrievedSchema,
4000
4039
  isSchemaChanged,
4001
- formDataChangedFields,
4040
+ // Only the error clearing needs the path of each changed field, and it runs only when live validation does
4041
+ // not, so the walk that produces them is left for `getStateFromProps` to ask for
4042
+ () => utils.getChangedFields(this.props.formData, prevProps.formData, true),
4002
4043
  // Skip live validation for this request if no form data has changed from the last state
4003
4044
  !isStateDataChanged
4004
4045
  );
@@ -4042,12 +4083,13 @@
4042
4083
  * @param inputFormData - The new or current data for the `Form`
4043
4084
  * @param retrievedSchema - An expanded schema, if not provided, it will be retrieved from the `schema` and `formData`.
4044
4085
  * @param [isSchemaChanged=false] - A flag indicating whether the schema has changed.
4045
- * @param [formDataChangedFields=[]] - The changed fields of `formData`
4086
+ * @param [getFormDataChangedFields=() => []] - Optional function returning the path of each `formData` field that
4087
+ * changed, only called when those paths are needed, which is when live validation is not going to run
4046
4088
  * @param [skipLiveValidate=false] - Optional flag, if true, means that we are not running live validation
4047
4089
  * @param [shouldSanitize=false] - Optional flag, if true, means that we should attempt to sanitize formData
4048
4090
  * @returns - The new state for the `Form`
4049
4091
  */
4050
- getStateFromProps(props, inputFormData, retrievedSchema, isSchemaChanged = false, formDataChangedFields = [], skipLiveValidate = false, shouldSanitize = false) {
4092
+ getStateFromProps(props, inputFormData, retrievedSchema, isSchemaChanged = false, getFormDataChangedFields = () => [], skipLiveValidate = false, shouldSanitize = false) {
4051
4093
  const state = this.state || {};
4052
4094
  const schema = "schema" in props ? props.schema : this.props.schema;
4053
4095
  const validator2 = "validator" in props ? props.validator : this.props.validator;
@@ -4152,17 +4194,23 @@
4152
4194
  const currentErrors = getCurrentErrors();
4153
4195
  errors = currentErrors.errors;
4154
4196
  errorSchema = currentErrors.errorSchema;
4155
- if (formDataChangedFields.length > 0 && !mustValidate) {
4156
- const newErrorSchema = formDataChangedFields.reduce((acc, key) => {
4157
- acc[key] = void 0;
4158
- return acc;
4159
- }, {});
4160
- schemaValidationErrorSchema = utils.mergeObjects(
4161
- currentErrors.errorSchema,
4162
- newErrorSchema,
4163
- "preventDuplicates"
4164
- );
4165
- errorSchema = schemaValidationErrorSchema;
4197
+ if (!mustValidate) {
4198
+ const formDataChangedFields = getFormDataChangedFields();
4199
+ if (formDataChangedFields.length > 0) {
4200
+ const newErrorSchema = formDataChangedFields.reduce((acc, path) => {
4201
+ const pathOfField = utils.toPath(path);
4202
+ for (let i = 1; i < pathOfField.length; i++) {
4203
+ utils.setByPath(acc, [...pathOfField.slice(0, i), utils.ERRORS_KEY], void 0, true);
4204
+ }
4205
+ return utils.setByPath(acc, pathOfField, void 0, true);
4206
+ }, {});
4207
+ schemaValidationErrorSchema = utils.mergeObjects(
4208
+ currentErrors.errorSchema,
4209
+ newErrorSchema,
4210
+ "preventDuplicates"
4211
+ );
4212
+ errorSchema = schemaValidationErrorSchema;
4213
+ }
4166
4214
  }
4167
4215
  const mergedErrors = _Form.mergeErrors({ errorSchema, errors }, props.extraErrors, state.customErrors);
4168
4216
  errors = mergedErrors.errors;
@@ -4360,14 +4408,14 @@
4360
4408
  let mergeBaseErrorSchema = schemaValidationErrorSchema;
4361
4409
  const rootPathId = fieldPathId.path[0] || "";
4362
4410
  const isRootPath = !path || path.length === 0 || path.length === 1 && path[0] === rootPathId;
4363
- let formData = isRootPath ? newValue : _cloneDeep(oldFormData);
4411
+ let formData = isRootPath ? newValue : structuredClone(oldFormData);
4364
4412
  const hasOnlyUndefinedValues = utils.isObject(formData) && Object.keys(formData).length > 0 && Object.values(formData).every((v) => v === void 0);
4365
4413
  const wasPreviouslyNull = oldFormData === null || oldFormData === void 0;
4366
4414
  const inputForDefaults = hasOnlyUndefinedValues && wasPreviouslyNull ? void 0 : formData;
4367
4415
  if (utils.isObject(formData) || Array.isArray(formData)) {
4368
4416
  let plainLeafWasCleared = false;
4369
4417
  if (newValue === ADDITIONAL_PROPERTY_KEY_REMOVE) {
4370
- _unset(formData, path);
4418
+ utils.unsetByPath(formData, path);
4371
4419
  } else if (!isRootPath) {
4372
4420
  let valueForPath = newValue;
4373
4421
  if (newValue === void 0) {
@@ -4384,9 +4432,9 @@
4384
4432
  }
4385
4433
  }
4386
4434
  if (plainLeafWasCleared) {
4387
- set(formData, path, void 0);
4435
+ utils.setByPath(formData, path, void 0);
4388
4436
  } else {
4389
- set(formData, path, valueForPath);
4437
+ utils.setByPath(formData, path, valueForPath);
4390
4438
  }
4391
4439
  }
4392
4440
  const shouldSanitize = retrievedSchema && !isRootPath && !utils.isObject(newValue) && !Array.isArray(newValue) && !disabled && !readonly;
@@ -4402,7 +4450,7 @@
4402
4450
  formData = newState.formData;
4403
4451
  retrievedSchema = newState.retrievedSchema;
4404
4452
  if (plainLeafWasCleared && formData) {
4405
- set(formData, path, void 0);
4453
+ utils.setByPath(formData, path, void 0);
4406
4454
  }
4407
4455
  }
4408
4456
  const mustValidate = !noValidate && (liveValidate === true || liveValidate === "onChange");
@@ -4413,11 +4461,11 @@
4413
4461
  state = { ...state, formData: newFormData };
4414
4462
  }
4415
4463
  if (newErrorSchema) {
4416
- const oldValidationError = !isRootPath ? get(schemaValidationErrorSchema, path) : schemaValidationErrorSchema;
4417
- if (!isEmpty(oldValidationError)) {
4464
+ const oldValidationError = !isRootPath ? utils.getByPath(schemaValidationErrorSchema, path) : schemaValidationErrorSchema;
4465
+ if (oldValidationError && Object.keys(oldValidationError).length > 0) {
4418
4466
  if (!isRootPath) {
4419
- mergeBaseErrorSchema = _cloneDeep(schemaValidationErrorSchema);
4420
- set(mergeBaseErrorSchema, path, newErrorSchema);
4467
+ mergeBaseErrorSchema = structuredClone(schemaValidationErrorSchema);
4468
+ utils.setByPath(mergeBaseErrorSchema, path, newErrorSchema, true);
4421
4469
  } else {
4422
4470
  mergeBaseErrorSchema = newErrorSchema;
4423
4471
  }
@@ -4426,15 +4474,15 @@
4426
4474
  customErrors = new utils.ErrorSchemaBuilder();
4427
4475
  }
4428
4476
  if (isRootPath) {
4429
- const pathErrors = get(newErrorSchema, utils.ERRORS_KEY);
4477
+ const pathErrors = newErrorSchema[utils.ERRORS_KEY];
4430
4478
  if (pathErrors) {
4431
4479
  customErrors.setErrors(pathErrors);
4432
4480
  }
4433
4481
  } else {
4434
- set(customErrors.ErrorSchema, path, newErrorSchema);
4482
+ utils.setByPath(customErrors.ErrorSchema, path, newErrorSchema, true);
4435
4483
  }
4436
4484
  }
4437
- } else if (customErrors && get(customErrors.ErrorSchema, [...path, utils.ERRORS_KEY])) {
4485
+ } else if (customErrors && utils.getByPath(customErrors.ErrorSchema, [...path, utils.ERRORS_KEY])) {
4438
4486
  customErrors.clearErrors(path);
4439
4487
  }
4440
4488
  if (mustValidate && this.pendingChanges.length === 1) {
@@ -4540,8 +4588,8 @@
4540
4588
  state = { formData: newFormData, ...liveValidation, customErrors };
4541
4589
  }
4542
4590
  const hasChanges = Object.keys(state).filter((key) => !key.startsWith("schemaValidation")).some((key) => {
4543
- const oldData = get(this.state, key);
4544
- const newData = get(state, key);
4591
+ const oldData = this.state[key];
4592
+ const newData = state[key];
4545
4593
  return !utils.deepEquals(oldData, newData);
4546
4594
  });
4547
4595
  this.setState(state, () => {
@@ -4669,12 +4717,8 @@
4669
4717
  focusOnError(error) {
4670
4718
  const { idPrefix = "root", idSeparator = "_" } = this.props;
4671
4719
  const { property } = error;
4672
- const path = _toPath(property);
4673
- if (path[0] === "") {
4674
- path[0] = idPrefix;
4675
- } else {
4676
- path.unshift(idPrefix);
4677
- }
4720
+ const path = utils.toPath(property ?? "");
4721
+ path.unshift(idPrefix);
4678
4722
  const elementId = path.join(idSeparator);
4679
4723
  let field = this.formElement.current.elements[elementId];
4680
4724
  if (!field) {