@rjsf/chakra-ui 6.0.0-beta.21 → 6.0.0-beta.22

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 (42) hide show
  1. package/dist/chakra-ui.esm.js +25 -23
  2. package/dist/chakra-ui.esm.js.map +3 -3
  3. package/dist/chakra-ui.umd.js +25 -23
  4. package/dist/index.cjs +25 -23
  5. package/dist/index.cjs.map +3 -3
  6. package/lib/ArrayFieldItemTemplate/ArrayFieldItemTemplate.d.ts +2 -2
  7. package/lib/ArrayFieldItemTemplate/ArrayFieldItemTemplate.js.map +1 -1
  8. package/lib/ArrayFieldTemplate/ArrayFieldTemplate.js +1 -2
  9. package/lib/ArrayFieldTemplate/ArrayFieldTemplate.js.map +1 -1
  10. package/lib/BaseInputTemplate/BaseInputTemplate.js +2 -2
  11. package/lib/BaseInputTemplate/BaseInputTemplate.js.map +1 -1
  12. package/lib/CheckboxWidget/CheckboxWidget.js +2 -2
  13. package/lib/CheckboxWidget/CheckboxWidget.js.map +1 -1
  14. package/lib/CheckboxesWidget/CheckboxesWidget.js +2 -2
  15. package/lib/CheckboxesWidget/CheckboxesWidget.js.map +1 -1
  16. package/lib/FieldTemplate/FieldTemplate.js +2 -2
  17. package/lib/FieldTemplate/FieldTemplate.js.map +1 -1
  18. package/lib/ObjectFieldTemplate/ObjectFieldTemplate.js +2 -2
  19. package/lib/ObjectFieldTemplate/ObjectFieldTemplate.js.map +1 -1
  20. package/lib/RadioWidget/RadioWidget.d.ts +1 -1
  21. package/lib/RadioWidget/RadioWidget.js +2 -2
  22. package/lib/RadioWidget/RadioWidget.js.map +1 -1
  23. package/lib/SelectWidget/SelectWidget.js +2 -2
  24. package/lib/SelectWidget/SelectWidget.js.map +1 -1
  25. package/lib/TextareaWidget/TextareaWidget.d.ts +1 -1
  26. package/lib/TextareaWidget/TextareaWidget.js +2 -2
  27. package/lib/TextareaWidget/TextareaWidget.js.map +1 -1
  28. package/lib/WrapIfAdditionalTemplate/WrapIfAdditionalTemplate.js +2 -3
  29. package/lib/WrapIfAdditionalTemplate/WrapIfAdditionalTemplate.js.map +1 -1
  30. package/lib/tsconfig.tsbuildinfo +1 -1
  31. package/package.json +7 -7
  32. package/src/ArrayFieldItemTemplate/ArrayFieldItemTemplate.tsx +2 -2
  33. package/src/ArrayFieldTemplate/ArrayFieldTemplate.tsx +1 -9
  34. package/src/BaseInputTemplate/BaseInputTemplate.tsx +2 -1
  35. package/src/CheckboxWidget/CheckboxWidget.tsx +2 -1
  36. package/src/CheckboxesWidget/CheckboxesWidget.tsx +2 -1
  37. package/src/FieldTemplate/FieldTemplate.tsx +6 -4
  38. package/src/ObjectFieldTemplate/ObjectFieldTemplate.tsx +2 -2
  39. package/src/RadioWidget/RadioWidget.tsx +2 -1
  40. package/src/SelectWidget/SelectWidget.tsx +2 -1
  41. package/src/TextareaWidget/TextareaWidget.tsx +2 -1
  42. package/src/WrapIfAdditionalTemplate/WrapIfAdditionalTemplate.tsx +4 -7
@@ -67,11 +67,6 @@ function ArrayFieldTemplate(props) {
67
67
  registry,
68
68
  uiOptions
69
69
  );
70
- const ArrayFieldItemTemplate2 = getTemplate2(
71
- "ArrayFieldItemTemplate",
72
- registry,
73
- uiOptions
74
- );
75
70
  const ArrayFieldTitleTemplate = getTemplate2(
76
71
  "ArrayFieldTitleTemplate",
77
72
  registry,
@@ -107,7 +102,7 @@ function ArrayFieldTemplate(props) {
107
102
  /* @__PURE__ */ jsxs3(Grid, { children: [
108
103
  /* @__PURE__ */ jsxs3(GridItem, { children: [
109
104
  !showOptionalDataControlInTitle ? optionalDataControl : void 0,
110
- items.map(({ key, ...itemProps }) => /* @__PURE__ */ jsx3(ArrayFieldItemTemplate2, { ...itemProps }, key))
105
+ items
111
106
  ] }),
112
107
  canAdd && /* @__PURE__ */ jsx3(GridItem, { justifySelf: "flex-end", children: /* @__PURE__ */ jsx3(Box2, { mt: 2, children: /* @__PURE__ */ jsx3(
113
108
  AddButton2,
@@ -169,6 +164,7 @@ import { jsx as jsx5, jsxs as jsxs5 } from "react/jsx-runtime";
169
164
  function BaseInputTemplate(props) {
170
165
  const {
171
166
  id,
167
+ htmlName,
172
168
  type,
173
169
  value,
174
170
  label,
@@ -207,7 +203,7 @@ function BaseInputTemplate(props) {
207
203
  Input,
208
204
  {
209
205
  id,
210
- name: id,
206
+ name: htmlName || id,
211
207
  value: value || value === 0 ? value : "",
212
208
  onChange: onChangeOverride || _onChange,
213
209
  onBlur: _onBlur,
@@ -386,8 +382,9 @@ function FieldTemplate(props) {
386
382
  displayLabel,
387
383
  hidden,
388
384
  label,
389
- onDropPropertyClick,
390
- onKeyChange,
385
+ onKeyRename,
386
+ onKeyRenameBlur,
387
+ onRemoveProperty,
391
388
  readonly,
392
389
  registry,
393
390
  required,
@@ -416,8 +413,9 @@ function FieldTemplate(props) {
416
413
  disabled,
417
414
  id,
418
415
  label,
419
- onDropPropertyClick,
420
- onKeyChange,
416
+ onKeyRename,
417
+ onKeyRenameBlur,
418
+ onRemoveProperty,
421
419
  readonly,
422
420
  required,
423
421
  schema,
@@ -479,7 +477,7 @@ function ObjectFieldTemplate(props) {
479
477
  schema,
480
478
  formData,
481
479
  optionalDataControl,
482
- onAddClick,
480
+ onAddProperty,
483
481
  registry
484
482
  } = props;
485
483
  const uiOptions = getUiOptions4(uiSchema);
@@ -526,7 +524,7 @@ function ObjectFieldTemplate(props) {
526
524
  {
527
525
  id: buttonId2(fieldPathId, "add"),
528
526
  className: "rjsf-object-property-expand",
529
- onClick: onAddClick(schema),
527
+ onClick: onAddProperty,
530
528
  disabled: disabled || readonly,
531
529
  uiSchema,
532
530
  registry
@@ -622,8 +620,8 @@ function WrapIfAdditionalTemplate(props) {
622
620
  disabled,
623
621
  id,
624
622
  label,
625
- onDropPropertyClick,
626
- onKeyChange,
623
+ onRemoveProperty,
624
+ onKeyRenameBlur,
627
625
  readonly,
628
626
  registry,
629
627
  required,
@@ -637,7 +635,6 @@ function WrapIfAdditionalTemplate(props) {
637
635
  if (!additional) {
638
636
  return /* @__PURE__ */ jsx21("div", { className: classNames, style, children });
639
637
  }
640
- const handleBlur = ({ target }) => onKeyChange(target.value);
641
638
  return /* @__PURE__ */ jsxs11(Grid4, { className: classNames, style, alignItems: "center", gap: 2, children: [
642
639
  /* @__PURE__ */ jsx21(GridItem4, { children: /* @__PURE__ */ jsx21(Field, { required, label: keyLabel, children: /* @__PURE__ */ jsx21(
643
640
  Input2,
@@ -646,7 +643,7 @@ function WrapIfAdditionalTemplate(props) {
646
643
  disabled: disabled || readonly,
647
644
  id: `${id}-key`,
648
645
  name: `${id}-key`,
649
- onBlur: !readonly ? handleBlur : void 0,
646
+ onBlur: !readonly ? onKeyRenameBlur : void 0,
650
647
  type: "text",
651
648
  mb: 1
652
649
  }
@@ -658,7 +655,7 @@ function WrapIfAdditionalTemplate(props) {
658
655
  id: buttonId3(id, "remove"),
659
656
  className: "rjsf-object-property-remove",
660
657
  disabled: disabled || readonly,
661
- onClick: onDropPropertyClick(label),
658
+ onClick: onRemoveProperty,
662
659
  uiSchema,
663
660
  registry
664
661
  }
@@ -847,6 +844,7 @@ import { jsx as jsx25, jsxs as jsxs14 } from "react/jsx-runtime";
847
844
  function CheckboxWidget(props) {
848
845
  const {
849
846
  id,
847
+ htmlName,
850
848
  value,
851
849
  disabled,
852
850
  readonly,
@@ -886,7 +884,7 @@ function CheckboxWidget(props) {
886
884
  Checkbox,
887
885
  {
888
886
  id,
889
- name: id,
887
+ name: htmlName || id,
890
888
  checked: typeof value === "undefined" ? false : value,
891
889
  disabled: disabled || readonly,
892
890
  onCheckedChange: _onChange,
@@ -912,6 +910,7 @@ import { jsx as jsx26 } from "react/jsx-runtime";
912
910
  function CheckboxesWidget(props) {
913
911
  const {
914
912
  id,
913
+ htmlName,
915
914
  disabled,
916
915
  options,
917
916
  value,
@@ -953,7 +952,7 @@ function CheckboxesWidget(props) {
953
952
  Checkbox,
954
953
  {
955
954
  id: optionId(id, index),
956
- name: id,
955
+ name: htmlName || id,
957
956
  value: String(index),
958
957
  disabled: disabled || itemDisabled || readonly,
959
958
  onBlur: _onBlur,
@@ -997,6 +996,7 @@ var RadioGroup = ChakraRadioGroup.Root;
997
996
  import { jsx as jsx28 } from "react/jsx-runtime";
998
997
  function RadioWidget({
999
998
  id,
999
+ htmlName,
1000
1000
  options,
1001
1001
  value,
1002
1002
  required,
@@ -1032,7 +1032,7 @@ function RadioWidget({
1032
1032
  onBlur: _onBlur,
1033
1033
  onFocus: _onFocus,
1034
1034
  value: selectedIndex,
1035
- name: id,
1035
+ name: htmlName || id,
1036
1036
  "aria-describedby": ariaDescribedByIds5(id),
1037
1037
  children: /* @__PURE__ */ jsx28(Stack2, { direction: row ? "row" : "column", children: Array.isArray(enumOptions) && enumOptions.map((option, index) => {
1038
1038
  const itemDisabled = Array.isArray(enumDisabled) && enumDisabled.indexOf(option.value) !== -1;
@@ -1215,6 +1215,7 @@ import { jsx as jsx32, jsxs as jsxs18 } from "react/jsx-runtime";
1215
1215
  function SelectWidget(props) {
1216
1216
  const {
1217
1217
  id,
1218
+ htmlName,
1218
1219
  options,
1219
1220
  label,
1220
1221
  hideLabel,
@@ -1299,7 +1300,7 @@ function SelectWidget(props) {
1299
1300
  {
1300
1301
  collection: selectOptions,
1301
1302
  id,
1302
- name: id,
1303
+ name: htmlName || id,
1303
1304
  multiple: isMultiple,
1304
1305
  closeOnSelect: !isMultiple,
1305
1306
  onBlur: _onBlur,
@@ -1429,6 +1430,7 @@ import {
1429
1430
  import { jsx as jsx34 } from "react/jsx-runtime";
1430
1431
  function TextareaWidget({
1431
1432
  id,
1433
+ htmlName,
1432
1434
  placeholder,
1433
1435
  value,
1434
1436
  label,
@@ -1462,7 +1464,7 @@ function TextareaWidget({
1462
1464
  Textarea,
1463
1465
  {
1464
1466
  id,
1465
- name: id,
1467
+ name: htmlName || id,
1466
1468
  value: value ?? "",
1467
1469
  placeholder,
1468
1470
  autoFocus: autofocus,