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

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 (50) hide show
  1. package/dist/chakra-ui.esm.js +58 -117
  2. package/dist/chakra-ui.esm.js.map +3 -3
  3. package/dist/chakra-ui.umd.js +38 -93
  4. package/dist/index.cjs +128 -184
  5. package/dist/index.cjs.map +3 -3
  6. package/lib/AltDateTimeWidget/AltDateTimeWidget.d.ts +1 -1
  7. package/lib/AltDateTimeWidget/AltDateTimeWidget.js +2 -2
  8. package/lib/AltDateTimeWidget/AltDateTimeWidget.js.map +1 -1
  9. package/lib/AltDateWidget/AltDateWidget.d.ts +1 -1
  10. package/lib/AltDateWidget/AltDateWidget.js +8 -49
  11. package/lib/AltDateWidget/AltDateWidget.js.map +1 -1
  12. package/lib/ArrayFieldItemTemplate/ArrayFieldItemTemplate.d.ts +2 -2
  13. package/lib/ArrayFieldItemTemplate/ArrayFieldItemTemplate.js.map +1 -1
  14. package/lib/ArrayFieldTemplate/ArrayFieldTemplate.js +1 -2
  15. package/lib/ArrayFieldTemplate/ArrayFieldTemplate.js.map +1 -1
  16. package/lib/BaseInputTemplate/BaseInputTemplate.js +2 -2
  17. package/lib/BaseInputTemplate/BaseInputTemplate.js.map +1 -1
  18. package/lib/CheckboxWidget/CheckboxWidget.js +2 -2
  19. package/lib/CheckboxWidget/CheckboxWidget.js.map +1 -1
  20. package/lib/CheckboxesWidget/CheckboxesWidget.js +2 -2
  21. package/lib/CheckboxesWidget/CheckboxesWidget.js.map +1 -1
  22. package/lib/FieldTemplate/FieldTemplate.js +2 -2
  23. package/lib/FieldTemplate/FieldTemplate.js.map +1 -1
  24. package/lib/ObjectFieldTemplate/ObjectFieldTemplate.js +2 -2
  25. package/lib/ObjectFieldTemplate/ObjectFieldTemplate.js.map +1 -1
  26. package/lib/RadioWidget/RadioWidget.d.ts +1 -1
  27. package/lib/RadioWidget/RadioWidget.js +2 -2
  28. package/lib/RadioWidget/RadioWidget.js.map +1 -1
  29. package/lib/SelectWidget/SelectWidget.js +2 -2
  30. package/lib/SelectWidget/SelectWidget.js.map +1 -1
  31. package/lib/TextareaWidget/TextareaWidget.d.ts +1 -1
  32. package/lib/TextareaWidget/TextareaWidget.js +2 -2
  33. package/lib/TextareaWidget/TextareaWidget.js.map +1 -1
  34. package/lib/WrapIfAdditionalTemplate/WrapIfAdditionalTemplate.js +2 -3
  35. package/lib/WrapIfAdditionalTemplate/WrapIfAdditionalTemplate.js.map +1 -1
  36. package/lib/tsconfig.tsbuildinfo +1 -1
  37. package/package.json +7 -7
  38. package/src/AltDateTimeWidget/AltDateTimeWidget.tsx +2 -2
  39. package/src/AltDateWidget/AltDateWidget.tsx +13 -88
  40. package/src/ArrayFieldItemTemplate/ArrayFieldItemTemplate.tsx +2 -2
  41. package/src/ArrayFieldTemplate/ArrayFieldTemplate.tsx +1 -9
  42. package/src/BaseInputTemplate/BaseInputTemplate.tsx +2 -1
  43. package/src/CheckboxWidget/CheckboxWidget.tsx +2 -1
  44. package/src/CheckboxesWidget/CheckboxesWidget.tsx +2 -1
  45. package/src/FieldTemplate/FieldTemplate.tsx +6 -4
  46. package/src/ObjectFieldTemplate/ObjectFieldTemplate.tsx +2 -2
  47. package/src/RadioWidget/RadioWidget.tsx +2 -1
  48. package/src/SelectWidget/SelectWidget.tsx +2 -1
  49. package/src/TextareaWidget/TextareaWidget.tsx +2 -1
  50. 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
  }
@@ -698,101 +695,40 @@ var Templates_default = generateTemplates();
698
695
  // src/AltDateWidget/AltDateWidget.tsx
699
696
  import { Box as Box6, Button as Button3, FieldsetRoot } from "@chakra-ui/react";
700
697
  import {
701
- ariaDescribedByIds as ariaDescribedByIds2,
702
- dateRangeOptions,
703
- getDateElementProps,
704
- parseDateString,
705
- toDateString,
706
- TranslatableString as TranslatableString5
698
+ DateElement,
699
+ TranslatableString as TranslatableString5,
700
+ useAltDateWidgetProps
707
701
  } from "@rjsf/utils";
708
- import { useEffect, useState } from "react";
709
702
  import { jsx as jsx22, jsxs as jsxs12 } from "react/jsx-runtime";
710
- function DateElement(props) {
711
- const { SelectWidget: SelectWidget2 } = props.registry.widgets;
712
- const value = props.value ? props.value : void 0;
713
- return /* @__PURE__ */ jsx22(
714
- SelectWidget2,
715
- {
716
- ...props,
717
- label: "",
718
- className: "form-control",
719
- onChange: (elemValue) => props.select(props.type, elemValue),
720
- options: {
721
- enumOptions: dateRangeOptions(props.range[0], props.range[1])
722
- },
723
- placeholder: props.type,
724
- schema: { type: "integer" },
725
- value,
726
- "aria-describedby": ariaDescribedByIds2(props.name)
727
- }
728
- );
729
- }
730
- var readyForChange = (state) => {
731
- return Object.keys(state).every((key) => typeof state[key] !== "undefined" && state[key] !== -1);
732
- };
733
703
  function AltDateWidget(props) {
734
- const { autofocus, disabled, id, onBlur, onChange, onFocus, options, readonly, registry, showTime, value } = props;
704
+ const { autofocus, disabled, id, onBlur, onFocus, options, readonly, registry } = props;
735
705
  const { translateString } = registry;
736
- const [state, setState] = useState(parseDateString(value, showTime));
737
- useEffect(() => {
738
- setState(parseDateString(value, showTime));
739
- }, [showTime, value]);
740
- const handleChange = (property, nextValue) => {
741
- const nextState = {
742
- ...state,
743
- [property]: typeof nextValue === "undefined" ? -1 : nextValue
744
- };
745
- if (readyForChange(nextState)) {
746
- onChange(toDateString(nextState, showTime));
747
- } else {
748
- setState(nextState);
749
- }
750
- };
751
- const handleNow = (event) => {
752
- event.preventDefault();
753
- if (disabled || readonly) {
754
- return;
755
- }
756
- const nextState = parseDateString((/* @__PURE__ */ new Date()).toJSON(), showTime);
757
- onChange(toDateString(nextState, showTime));
758
- };
759
- const handleClear = (event) => {
760
- event.preventDefault();
761
- if (disabled || readonly) {
762
- return;
763
- }
764
- onChange(void 0);
765
- };
706
+ const { elements, handleChange, handleClear, handleSetNow } = useAltDateWidgetProps(props);
766
707
  const chakraProps = getChakra({ uiSchema: props.uiSchema });
767
708
  return /* @__PURE__ */ jsxs12(FieldsetRoot, { ...chakraProps, children: [
768
- /* @__PURE__ */ jsx22(Box6, { display: "flex", flexWrap: "wrap", alignItems: "center", children: getDateElementProps(
769
- state,
770
- showTime,
771
- options.yearsRange,
772
- options.format
773
- ).map((elemProps, i) => {
774
- const elemId = id + "_" + elemProps.type;
775
- return /* @__PURE__ */ jsx22(Box6, { mr: "2", mb: "2", children: /* @__PURE__ */ jsx22(
709
+ /* @__PURE__ */ jsx22(Box6, { display: "flex", flexWrap: "wrap", alignItems: "center", children: elements.map((elemProps, i) => {
710
+ const elemId = `${id}_${elemProps.type}`;
711
+ return /* @__PURE__ */ jsx22(Box6, { mr: "2", mb: "2", width: "20", children: /* @__PURE__ */ jsx22(
776
712
  DateElement,
777
713
  {
778
714
  ...props,
779
715
  ...elemProps,
780
716
  autofocus: autofocus && i === 0,
781
717
  disabled,
782
- id: elemId,
718
+ rootId: id,
783
719
  name: id,
784
720
  onBlur,
785
721
  onFocus,
786
722
  readonly,
787
723
  registry,
788
724
  select: handleChange,
789
- value: elemProps.value < 0 ? "" : elemProps.value
725
+ value: elemProps.value && elemProps.value < 0 ? "" : elemProps.value
790
726
  }
791
727
  ) }, elemId);
792
728
  }) }),
793
729
  /* @__PURE__ */ jsxs12(Box6, { display: "flex", children: [
794
- !options.hideNowButton && /* @__PURE__ */ jsx22(Button3, { onClick: (e) => handleNow(e), mr: "2", children: translateString(TranslatableString5.NowLabel) }),
795
- !options.hideClearButton && /* @__PURE__ */ jsx22(Button3, { onClick: (e) => handleClear(e), children: translateString(TranslatableString5.ClearLabel) })
730
+ !options.hideNowButton && /* @__PURE__ */ jsx22(Button3, { onClick: handleSetNow, mr: "2", children: translateString(TranslatableString5.NowLabel) }),
731
+ !options.hideClearButton && /* @__PURE__ */ jsx22(Button3, { onClick: handleClear, children: translateString(TranslatableString5.ClearLabel) })
796
732
  ] })
797
733
  ] });
798
734
  }
@@ -800,7 +736,7 @@ AltDateWidget.defaultProps = {
800
736
  autofocus: false,
801
737
  disabled: false,
802
738
  readonly: false,
803
- showTime: false,
739
+ time: false,
804
740
  options: {
805
741
  yearsRange: [1900, (/* @__PURE__ */ new Date()).getFullYear() + 2]
806
742
  }
@@ -811,18 +747,18 @@ var AltDateWidget_default = AltDateWidget;
811
747
  import { jsx as jsx23 } from "react/jsx-runtime";
812
748
  function AltDateTimeWidget(props) {
813
749
  const { AltDateWidget: AltDateWidget2 } = props.registry.widgets;
814
- return /* @__PURE__ */ jsx23(AltDateWidget2, { ...props, showTime: true });
750
+ return /* @__PURE__ */ jsx23(AltDateWidget2, { ...props, time: true });
815
751
  }
816
752
  AltDateTimeWidget.defaultProps = {
817
753
  ...AltDateWidget_default.defaultProps,
818
- showTime: true
754
+ time: true
819
755
  };
820
756
  var AltDateTimeWidget_default = AltDateTimeWidget;
821
757
 
822
758
  // src/CheckboxWidget/CheckboxWidget.tsx
823
759
  import { Text as Text3 } from "@chakra-ui/react";
824
760
  import {
825
- ariaDescribedByIds as ariaDescribedByIds3,
761
+ ariaDescribedByIds as ariaDescribedByIds2,
826
762
  descriptionId as descriptionId2,
827
763
  getTemplate as getTemplate5,
828
764
  labelValue as labelValue2,
@@ -847,6 +783,7 @@ import { jsx as jsx25, jsxs as jsxs14 } from "react/jsx-runtime";
847
783
  function CheckboxWidget(props) {
848
784
  const {
849
785
  id,
786
+ htmlName,
850
787
  value,
851
788
  disabled,
852
789
  readonly,
@@ -886,13 +823,13 @@ function CheckboxWidget(props) {
886
823
  Checkbox,
887
824
  {
888
825
  id,
889
- name: id,
826
+ name: htmlName || id,
890
827
  checked: typeof value === "undefined" ? false : value,
891
828
  disabled: disabled || readonly,
892
829
  onCheckedChange: _onChange,
893
830
  onBlur: _onBlur,
894
831
  onFocus: _onFocus,
895
- "aria-describedby": ariaDescribedByIds3(id),
832
+ "aria-describedby": ariaDescribedByIds2(id),
896
833
  children: labelValue2(/* @__PURE__ */ jsx25(Text3, { children: label }), hideLabel || !label)
897
834
  }
898
835
  )
@@ -902,7 +839,7 @@ function CheckboxWidget(props) {
902
839
  // src/CheckboxesWidget/CheckboxesWidget.tsx
903
840
  import { CheckboxGroup, FieldsetRoot as FieldsetRoot2, Stack, Text as Text4 } from "@chakra-ui/react";
904
841
  import {
905
- ariaDescribedByIds as ariaDescribedByIds4,
842
+ ariaDescribedByIds as ariaDescribedByIds3,
906
843
  enumOptionsIndexForValue,
907
844
  enumOptionsValueForIndex,
908
845
  labelValue as labelValue3,
@@ -912,6 +849,7 @@ import { jsx as jsx26 } from "react/jsx-runtime";
912
849
  function CheckboxesWidget(props) {
913
850
  const {
914
851
  id,
852
+ htmlName,
915
853
  disabled,
916
854
  options,
917
855
  value,
@@ -943,7 +881,7 @@ function CheckboxesWidget(props) {
943
881
  {
944
882
  onValueChange: (option) => onChange(enumOptionsValueForIndex(option, enumOptions, emptyValue)),
945
883
  value: selectedIndexes,
946
- "aria-describedby": ariaDescribedByIds4(id),
884
+ "aria-describedby": ariaDescribedByIds3(id),
947
885
  readOnly: readonly,
948
886
  required,
949
887
  label: labelValue3(label, hideLabel || !label),
@@ -953,7 +891,7 @@ function CheckboxesWidget(props) {
953
891
  Checkbox,
954
892
  {
955
893
  id: optionId(id, index),
956
- name: id,
894
+ name: htmlName || id,
957
895
  value: String(index),
958
896
  disabled: disabled || itemDisabled || readonly,
959
897
  onBlur: _onBlur,
@@ -972,7 +910,7 @@ function CheckboxesWidget(props) {
972
910
  // src/RadioWidget/RadioWidget.tsx
973
911
  import { Stack as Stack2 } from "@chakra-ui/react";
974
912
  import {
975
- ariaDescribedByIds as ariaDescribedByIds5,
913
+ ariaDescribedByIds as ariaDescribedByIds4,
976
914
  enumOptionsIndexForValue as enumOptionsIndexForValue2,
977
915
  enumOptionsValueForIndex as enumOptionsValueForIndex2,
978
916
  labelValue as labelValue4,
@@ -997,6 +935,7 @@ var RadioGroup = ChakraRadioGroup.Root;
997
935
  import { jsx as jsx28 } from "react/jsx-runtime";
998
936
  function RadioWidget({
999
937
  id,
938
+ htmlName,
1000
939
  options,
1001
940
  value,
1002
941
  required,
@@ -1032,8 +971,8 @@ function RadioWidget({
1032
971
  onBlur: _onBlur,
1033
972
  onFocus: _onFocus,
1034
973
  value: selectedIndex,
1035
- name: id,
1036
- "aria-describedby": ariaDescribedByIds5(id),
974
+ name: htmlName || id,
975
+ "aria-describedby": ariaDescribedByIds4(id),
1037
976
  children: /* @__PURE__ */ jsx28(Stack2, { direction: row ? "row" : "column", children: Array.isArray(enumOptions) && enumOptions.map((option, index) => {
1038
977
  const itemDisabled = Array.isArray(enumDisabled) && enumDisabled.indexOf(option.value) !== -1;
1039
978
  return /* @__PURE__ */ jsx28(
@@ -1055,7 +994,7 @@ function RadioWidget({
1055
994
 
1056
995
  // src/RangeWidget/RangeWidget.tsx
1057
996
  import {
1058
- ariaDescribedByIds as ariaDescribedByIds6,
997
+ ariaDescribedByIds as ariaDescribedByIds5,
1059
998
  labelValue as labelValue5,
1060
999
  rangeSpec
1061
1000
  } from "@rjsf/utils";
@@ -1133,7 +1072,7 @@ function RangeWidget({
1133
1072
  onValueChange: _onChange,
1134
1073
  onBlur: _onBlur,
1135
1074
  onFocus: _onFocus,
1136
- "aria-describedby": ariaDescribedByIds6(id)
1075
+ "aria-describedby": ariaDescribedByIds5(id)
1137
1076
  }
1138
1077
  ) });
1139
1078
  }
@@ -1141,7 +1080,7 @@ function RangeWidget({
1141
1080
  // src/SelectWidget/SelectWidget.tsx
1142
1081
  import { useMemo, useRef } from "react";
1143
1082
  import {
1144
- ariaDescribedByIds as ariaDescribedByIds7,
1083
+ ariaDescribedByIds as ariaDescribedByIds6,
1145
1084
  enumOptionsIndexForValue as enumOptionsIndexForValue3,
1146
1085
  enumOptionsValueForIndex as enumOptionsValueForIndex3,
1147
1086
  labelValue as labelValue6
@@ -1215,6 +1154,7 @@ import { jsx as jsx32, jsxs as jsxs18 } from "react/jsx-runtime";
1215
1154
  function SelectWidget(props) {
1216
1155
  const {
1217
1156
  id,
1157
+ htmlName,
1218
1158
  options,
1219
1159
  label,
1220
1160
  hideLabel,
@@ -1299,7 +1239,7 @@ function SelectWidget(props) {
1299
1239
  {
1300
1240
  collection: selectOptions,
1301
1241
  id,
1302
- name: id,
1242
+ name: htmlName || id,
1303
1243
  multiple: isMultiple,
1304
1244
  closeOnSelect: !isMultiple,
1305
1245
  onBlur: _onBlur,
@@ -1307,7 +1247,7 @@ function SelectWidget(props) {
1307
1247
  onFocus: _onFocus,
1308
1248
  autoFocus: autofocus,
1309
1249
  value: formValue,
1310
- "aria-describedby": ariaDescribedByIds7(id),
1250
+ "aria-describedby": ariaDescribedByIds6(id),
1311
1251
  positioning: { placement: "bottom" },
1312
1252
  children: [
1313
1253
  /* @__PURE__ */ jsx32(ChakraSelect2.Control, { children: /* @__PURE__ */ jsx32(SelectTrigger, { children: /* @__PURE__ */ jsx32(SelectValueText, { placeholder }) }) }),
@@ -1325,7 +1265,7 @@ function SelectWidget(props) {
1325
1265
  // src/SelectNativeWidget/NativeSelectWidget.tsx
1326
1266
  import { useMemo as useMemo2 } from "react";
1327
1267
  import {
1328
- ariaDescribedByIds as ariaDescribedByIds8,
1268
+ ariaDescribedByIds as ariaDescribedByIds7,
1329
1269
  enumOptionsIndexForValue as enumOptionsIndexForValue4,
1330
1270
  enumOptionsValueForIndex as enumOptionsValueForIndex4,
1331
1271
  labelValue as labelValue7
@@ -1410,7 +1350,7 @@ function NativeSelectWidget(props) {
1410
1350
  onFocus: _onFocus,
1411
1351
  autoFocus: autofocus,
1412
1352
  value: formValue,
1413
- "aria-describedby": ariaDescribedByIds8(id),
1353
+ "aria-describedby": ariaDescribedByIds7(id),
1414
1354
  children: selectOptions.items.map((item) => /* @__PURE__ */ jsx33("option", { value: item.value, children: item.label }, item.value))
1415
1355
  }
1416
1356
  ),
@@ -1423,12 +1363,13 @@ function NativeSelectWidget(props) {
1423
1363
  // src/TextareaWidget/TextareaWidget.tsx
1424
1364
  import { Textarea } from "@chakra-ui/react";
1425
1365
  import {
1426
- ariaDescribedByIds as ariaDescribedByIds9,
1366
+ ariaDescribedByIds as ariaDescribedByIds8,
1427
1367
  labelValue as labelValue8
1428
1368
  } from "@rjsf/utils";
1429
1369
  import { jsx as jsx34 } from "react/jsx-runtime";
1430
1370
  function TextareaWidget({
1431
1371
  id,
1372
+ htmlName,
1432
1373
  placeholder,
1433
1374
  value,
1434
1375
  label,
@@ -1462,7 +1403,7 @@ function TextareaWidget({
1462
1403
  Textarea,
1463
1404
  {
1464
1405
  id,
1465
- name: id,
1406
+ name: htmlName || id,
1466
1407
  value: value ?? "",
1467
1408
  placeholder,
1468
1409
  autoFocus: autofocus,
@@ -1470,7 +1411,7 @@ function TextareaWidget({
1470
1411
  onBlur: _onBlur,
1471
1412
  onFocus: _onFocus,
1472
1413
  rows: options.rows,
1473
- "aria-describedby": ariaDescribedByIds9(id)
1414
+ "aria-describedby": ariaDescribedByIds8(id)
1474
1415
  }
1475
1416
  )
1476
1417
  }
@@ -1479,17 +1420,17 @@ function TextareaWidget({
1479
1420
 
1480
1421
  // src/UpDownWidget/UpDownWidget.tsx
1481
1422
  import {
1482
- ariaDescribedByIds as ariaDescribedByIds10,
1423
+ ariaDescribedByIds as ariaDescribedByIds9,
1483
1424
  labelValue as labelValue9
1484
1425
  } from "@rjsf/utils";
1485
1426
 
1486
1427
  // src/components/ui/number-input.tsx
1487
- import { forwardRef as forwardRef8, useEffect as useEffect2, useRef as useRef2 } from "react";
1428
+ import { forwardRef as forwardRef8, useEffect, useRef as useRef2 } from "react";
1488
1429
  import { NumberInput as ChakraNumberInput } from "@chakra-ui/react";
1489
1430
  import { jsx as jsx35, jsxs as jsxs20 } from "react/jsx-runtime";
1490
1431
  var NumberInputRoot = forwardRef8(function NumberInput(props, ref) {
1491
1432
  const inputRef = useRef2(null);
1492
- useEffect2(() => {
1433
+ useEffect(() => {
1493
1434
  if (inputRef.current) {
1494
1435
  inputRef.current.value = props.value || "";
1495
1436
  }
@@ -1528,7 +1469,7 @@ function UpDownWidget(props) {
1528
1469
  onValueChange: _onChange,
1529
1470
  onBlur: _onBlur,
1530
1471
  onFocus: _onFocus,
1531
- "aria-describedby": ariaDescribedByIds10(id),
1472
+ "aria-describedby": ariaDescribedByIds9(id),
1532
1473
  id,
1533
1474
  name: id
1534
1475
  }