@rjsf/daisyui 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 (44) hide show
  1. package/dist/chakra-ui.esm.js +102 -113
  2. package/dist/chakra-ui.esm.js.map +3 -3
  3. package/dist/chakra-ui.umd.js +35 -44
  4. package/dist/index.cjs +140 -151
  5. package/dist/index.cjs.map +3 -3
  6. package/lib/templates/ArrayFieldItemButtonsTemplate/ArrayFieldItemButtonsTemplate.d.ts +2 -2
  7. package/lib/templates/ArrayFieldItemButtonsTemplate/ArrayFieldItemButtonsTemplate.js +2 -7
  8. package/lib/templates/ArrayFieldItemButtonsTemplate/ArrayFieldItemButtonsTemplate.js.map +1 -1
  9. package/lib/templates/ArrayFieldItemTemplate/ArrayFieldItemTemplate.d.ts +3 -3
  10. package/lib/templates/ArrayFieldItemTemplate/ArrayFieldItemTemplate.js +1 -1
  11. package/lib/templates/ArrayFieldItemTemplate/ArrayFieldItemTemplate.js.map +1 -1
  12. package/lib/templates/ArrayFieldTemplate/ArrayFieldTemplate.js +1 -2
  13. package/lib/templates/ArrayFieldTemplate/ArrayFieldTemplate.js.map +1 -1
  14. package/lib/templates/BaseInputTemplate/BaseInputTemplate.js +2 -2
  15. package/lib/templates/BaseInputTemplate/BaseInputTemplate.js.map +1 -1
  16. package/lib/templates/FieldTemplate/FieldTemplate.js +3 -3
  17. package/lib/templates/FieldTemplate/FieldTemplate.js.map +1 -1
  18. package/lib/templates/ObjectFieldTemplate/ObjectFieldTemplate.js +2 -2
  19. package/lib/templates/ObjectFieldTemplate/ObjectFieldTemplate.js.map +1 -1
  20. package/lib/templates/WrapIfAdditionalTemplate/WrapIfAdditionalTemplate.js +2 -9
  21. package/lib/templates/WrapIfAdditionalTemplate/WrapIfAdditionalTemplate.js.map +1 -1
  22. package/lib/tsconfig.tsbuildinfo +1 -1
  23. package/lib/widgets/CheckboxWidget/CheckboxWidget.js +2 -2
  24. package/lib/widgets/CheckboxWidget/CheckboxWidget.js.map +1 -1
  25. package/lib/widgets/CheckboxesWidget/CheckboxesWidget.d.ts +1 -1
  26. package/lib/widgets/CheckboxesWidget/CheckboxesWidget.js +2 -2
  27. package/lib/widgets/CheckboxesWidget/CheckboxesWidget.js.map +1 -1
  28. package/lib/widgets/RadioWidget/RadioWidget.d.ts +1 -1
  29. package/lib/widgets/RadioWidget/RadioWidget.js +2 -2
  30. package/lib/widgets/RadioWidget/RadioWidget.js.map +1 -1
  31. package/lib/widgets/TextareaWidget/TextareaWidget.js +2 -2
  32. package/lib/widgets/TextareaWidget/TextareaWidget.js.map +1 -1
  33. package/package.json +7 -7
  34. package/src/templates/ArrayFieldItemButtonsTemplate/ArrayFieldItemButtonsTemplate.tsx +10 -15
  35. package/src/templates/ArrayFieldItemTemplate/ArrayFieldItemTemplate.tsx +3 -3
  36. package/src/templates/ArrayFieldTemplate/ArrayFieldTemplate.tsx +1 -8
  37. package/src/templates/BaseInputTemplate/BaseInputTemplate.tsx +2 -1
  38. package/src/templates/FieldTemplate/FieldTemplate.tsx +9 -7
  39. package/src/templates/ObjectFieldTemplate/ObjectFieldTemplate.tsx +2 -2
  40. package/src/templates/WrapIfAdditionalTemplate/WrapIfAdditionalTemplate.tsx +5 -16
  41. package/src/widgets/CheckboxWidget/CheckboxWidget.tsx +2 -0
  42. package/src/widgets/CheckboxesWidget/CheckboxesWidget.tsx +2 -1
  43. package/src/widgets/RadioWidget/RadioWidget.tsx +2 -1
  44. package/src/widgets/TextareaWidget/TextareaWidget.tsx +2 -1
@@ -2,11 +2,10 @@
2
2
  import { withTheme as withTheme2 } from "@rjsf/core";
3
3
 
4
4
  // src/theme/Theme.tsx
5
- import { createContext, useCallback as useCallback17, useContext, useState as useState4 } from "react";
5
+ import { createContext, useCallback as useCallback16, useContext, useState as useState4 } from "react";
6
6
  import { getDefaultRegistry } from "@rjsf/core";
7
7
 
8
8
  // src/templates/ArrayFieldItemButtonsTemplate/ArrayFieldItemButtonsTemplate.tsx
9
- import { useMemo } from "react";
10
9
  import {
11
10
  buttonId
12
11
  } from "@rjsf/utils";
@@ -19,19 +18,15 @@ function ArrayFieldItemButtonsTemplate(props) {
19
18
  hasMoveUp,
20
19
  hasRemove,
21
20
  fieldPathId,
22
- index,
23
- onCopyIndexClick,
24
- onDropIndexClick,
25
- onReorderClick,
21
+ onCopyItem,
22
+ onRemoveItem,
23
+ onMoveDownItem,
24
+ onMoveUpItem,
26
25
  readonly,
27
26
  registry,
28
27
  uiSchema
29
28
  } = props;
30
29
  const { CopyButton: CopyButton2, MoveDownButton: MoveDownButton2, MoveUpButton: MoveUpButton2, RemoveButton: RemoveButton2 } = registry.templates.ButtonTemplates;
31
- const onCopyClick = useMemo(() => onCopyIndexClick(index), [index, onCopyIndexClick]);
32
- const onRemoveClick = useMemo(() => onDropIndexClick(index), [index, onDropIndexClick]);
33
- const onArrowUpClick = useMemo(() => onReorderClick(index, index - 1), [index, onReorderClick]);
34
- const onArrowDownClick = useMemo(() => onReorderClick(index, index + 1), [index, onReorderClick]);
35
30
  const renderMany = [hasMoveUp || hasMoveDown, hasCopy, hasRemove].filter(Boolean).length > 1;
36
31
  const btnClass = renderMany ? "join-item btn btn-sm px-2" : "btn btn-sm px-2 rounded-sm";
37
32
  const removeBtnClass = renderMany ? "join-item btn btn-sm btn-error px-2" : "btn btn-sm btn-error px-2 rounded-sm";
@@ -43,7 +38,7 @@ function ArrayFieldItemButtonsTemplate(props) {
43
38
  id: buttonId(fieldPathId, "moveUp"),
44
39
  className: `rjsf-array-item-move-up ${btnClass}`,
45
40
  disabled: disabled || readonly || !hasMoveUp,
46
- onClick: onArrowUpClick,
41
+ onClick: onMoveUpItem,
47
42
  uiSchema,
48
43
  registry
49
44
  }
@@ -54,7 +49,7 @@ function ArrayFieldItemButtonsTemplate(props) {
54
49
  id: buttonId(fieldPathId, "moveDown"),
55
50
  className: `rjsf-array-item-move-down ${btnClass}`,
56
51
  disabled: disabled || readonly || !hasMoveDown,
57
- onClick: onArrowDownClick,
52
+ onClick: onMoveDownItem,
58
53
  uiSchema,
59
54
  registry
60
55
  }
@@ -66,7 +61,7 @@ function ArrayFieldItemButtonsTemplate(props) {
66
61
  id: buttonId(fieldPathId, "copy"),
67
62
  className: `rjsf-array-item-copy ${btnClass}`,
68
63
  disabled: disabled || readonly,
69
- onClick: onCopyClick,
64
+ onClick: onCopyItem,
70
65
  uiSchema,
71
66
  registry
72
67
  }
@@ -77,7 +72,7 @@ function ArrayFieldItemButtonsTemplate(props) {
77
72
  id: buttonId(fieldPathId, "remove"),
78
73
  className: `rjsf-array-item-remove ${removeBtnClass}`,
79
74
  disabled: disabled || readonly,
80
- onClick: onRemoveClick,
75
+ onClick: onRemoveItem,
81
76
  uiSchema,
82
77
  registry
83
78
  }
@@ -142,11 +137,6 @@ function ArrayFieldTemplate(props) {
142
137
  registry,
143
138
  uiOptions
144
139
  );
145
- const ArrayFieldItemTemplate2 = getTemplate2(
146
- "ArrayFieldItemTemplate",
147
- registry,
148
- uiOptions
149
- );
150
140
  const ArrayFieldTitleTemplate = getTemplate2(
151
141
  "ArrayFieldTitleTemplate",
152
142
  registry,
@@ -190,7 +180,7 @@ function ArrayFieldTemplate(props) {
190
180
  /* @__PURE__ */ jsxs3("div", { className: "flex flex-col gap-4", children: [
191
181
  !showOptionalDataControlInTitle ? optionalDataControl : void 0,
192
182
  /* @__PURE__ */ jsxs3("div", { className: "rjsf-array-item-list", children: [
193
- items.map(({ key, ...itemProps }, index) => /* @__PURE__ */ jsx3(ArrayFieldItemTemplate2, { ...itemProps, index, totalItems: items.length }, key)),
183
+ items,
194
184
  items && items.length === 0 && canAdd && /* @__PURE__ */ jsx3("div", { className: "text-center italic text-base-content/70", children: TranslatableString.EmptyArray })
195
185
  ] }),
196
186
  canAdd && /* @__PURE__ */ jsx3("div", { className: "flex justify-end", children: /* @__PURE__ */ jsx3(
@@ -219,6 +209,7 @@ import { Fragment as Fragment2, jsx as jsx4, jsxs as jsxs4 } from "react/jsx-run
219
209
  function BaseInputTemplate(props) {
220
210
  const {
221
211
  id,
212
+ htmlName,
222
213
  value,
223
214
  required,
224
215
  disabled,
@@ -256,7 +247,7 @@ function BaseInputTemplate(props) {
256
247
  "input",
257
248
  {
258
249
  id,
259
- name: id,
250
+ name: htmlName || id,
260
251
  value: value || value === 0 ? value : "",
261
252
  placeholder,
262
253
  required,
@@ -438,21 +429,22 @@ function FieldTemplate(props) {
438
429
  help,
439
430
  hideError,
440
431
  displayLabel,
432
+ onKeyRename,
433
+ onKeyRenameBlur,
434
+ onRemoveProperty,
441
435
  classNames,
442
- // Destructure props we don't want to pass to div
443
- description,
444
- onKeyChange,
445
- onDropPropertyClick,
446
436
  uiSchema,
447
437
  schema,
448
438
  readonly,
449
439
  required,
440
+ registry,
441
+ // Destructure props we don't want to pass to div
442
+ description,
450
443
  rawErrors,
451
444
  rawHelp,
452
445
  rawDescription,
453
446
  hidden,
454
447
  onChange,
455
- registry,
456
448
  ...divProps
457
449
  } = props;
458
450
  const isCheckbox = schema.type === "boolean";
@@ -469,8 +461,9 @@ function FieldTemplate(props) {
469
461
  disabled: divProps.disabled,
470
462
  id,
471
463
  label,
472
- onDropPropertyClick,
473
- onKeyChange,
464
+ onKeyRename,
465
+ onKeyRenameBlur,
466
+ onRemoveProperty,
474
467
  readonly,
475
468
  required,
476
469
  schema,
@@ -532,7 +525,7 @@ function ObjectFieldTemplate(props) {
532
525
  schema,
533
526
  formData,
534
527
  optionalDataControl,
535
- onAddClick,
528
+ onAddProperty,
536
529
  registry
537
530
  } = props;
538
531
  const uiOptions = getUiOptions4(uiSchema);
@@ -587,7 +580,7 @@ function ObjectFieldTemplate(props) {
587
580
  {
588
581
  id: buttonId3(fieldPathId, "add"),
589
582
  className: "rjsf-object-property-expand btn btn-primary btn-sm",
590
- onClick: onAddClick(schema),
583
+ onClick: onAddProperty,
591
584
  disabled: disabled || readonly,
592
585
  uiSchema,
593
586
  registry
@@ -650,7 +643,6 @@ function TitleField(props) {
650
643
  }
651
644
 
652
645
  // src/templates/WrapIfAdditionalTemplate/WrapIfAdditionalTemplate.tsx
653
- import { useCallback as useCallback3 } from "react";
654
646
  import {
655
647
  buttonId as buttonId4,
656
648
  ADDITIONAL_PROPERTY_FLAG,
@@ -668,8 +660,9 @@ function WrapIfAdditionalTemplate(props) {
668
660
  required,
669
661
  schema,
670
662
  uiSchema,
671
- onKeyChange,
672
- onDropPropertyClick,
663
+ onKeyRename,
664
+ onKeyRenameBlur,
665
+ onRemoveProperty,
673
666
  registry,
674
667
  ...rest
675
668
  } = props;
@@ -677,15 +670,6 @@ function WrapIfAdditionalTemplate(props) {
677
670
  const { templates, translateString } = registry;
678
671
  const { RemoveButton: RemoveButton2 } = templates.ButtonTemplates;
679
672
  const keyLabel = translateString(TranslatableString4.KeyLabel, [label]);
680
- const handleBlur = useCallback3(
681
- (event) => {
682
- onKeyChange(event.target.value);
683
- },
684
- [onKeyChange]
685
- );
686
- const handleRemove = useCallback3(() => {
687
- onDropPropertyClick(label)();
688
- }, [onDropPropertyClick, label]);
689
673
  if (!additional) {
690
674
  return /* @__PURE__ */ jsx19("div", { className: classNames, children });
691
675
  }
@@ -698,7 +682,7 @@ function WrapIfAdditionalTemplate(props) {
698
682
  type: "text",
699
683
  className: "input input-bordered",
700
684
  id: `${id}-key`,
701
- onBlur: handleBlur,
685
+ onBlur: onKeyRenameBlur,
702
686
  defaultValue: label,
703
687
  disabled: disabled || readonly
704
688
  }
@@ -711,7 +695,7 @@ function WrapIfAdditionalTemplate(props) {
711
695
  id: buttonId4(id, "remove"),
712
696
  className: "rjsf-object-property-remove",
713
697
  disabled: disabled || readonly,
714
- onClick: handleRemove,
698
+ onClick: onRemoveProperty,
715
699
  uiSchema,
716
700
  registry
717
701
  }
@@ -761,7 +745,7 @@ function AltDateTimeWidget({
761
745
  var AltDateTimeWidget_default = AltDateTimeWidget;
762
746
 
763
747
  // src/widgets/AltDateWidget/AltDateWidget.tsx
764
- import { useCallback as useCallback4, useEffect, useReducer, useState } from "react";
748
+ import { useCallback as useCallback3, useEffect, useReducer, useState } from "react";
765
749
  import {
766
750
  ariaDescribedByIds as ariaDescribedByIds2,
767
751
  TranslatableString as TranslatableString5,
@@ -810,7 +794,7 @@ function DateElement({
810
794
  }) {
811
795
  const id = `${rootId}_${type}`;
812
796
  const { SelectWidget: SelectWidget2 } = registry.widgets;
813
- const handleChange = useCallback4(
797
+ const handleChange = useCallback3(
814
798
  (value2) => {
815
799
  select(type, value2);
816
800
  },
@@ -880,10 +864,10 @@ function AltDateWidget({
880
864
  setState(parseDateString(value, time));
881
865
  }
882
866
  }, [time, value, onChange, state, lastValue]);
883
- const handleChange = useCallback4((property, value2) => {
867
+ const handleChange = useCallback3((property, value2) => {
884
868
  setState({ [property]: value2 });
885
869
  }, []);
886
- const handleSetNow = useCallback4(
870
+ const handleSetNow = useCallback3(
887
871
  (event) => {
888
872
  event.preventDefault();
889
873
  if (disabled || readonly) {
@@ -895,7 +879,7 @@ function AltDateWidget({
895
879
  },
896
880
  [disabled, readonly, time, onChange]
897
881
  );
898
- const handleClear = useCallback4(
882
+ const handleClear = useCallback3(
899
883
  (event) => {
900
884
  event.preventDefault();
901
885
  if (disabled || readonly) {
@@ -957,12 +941,13 @@ function AltDateWidget({
957
941
  }
958
942
 
959
943
  // src/widgets/CheckboxWidget/CheckboxWidget.tsx
960
- import { useCallback as useCallback5 } from "react";
944
+ import { useCallback as useCallback4 } from "react";
961
945
  import { getTemplate as getTemplate5, descriptionId as descriptionId2 } from "@rjsf/utils";
962
946
  import { jsx as jsx22, jsxs as jsxs11 } from "react/jsx-runtime";
963
947
  function CheckboxWidget(props) {
964
948
  const {
965
949
  id,
950
+ htmlName,
966
951
  value,
967
952
  required,
968
953
  disabled,
@@ -983,17 +968,17 @@ function CheckboxWidget(props) {
983
968
  options
984
969
  );
985
970
  const description = options.description || schema.description;
986
- const handleFocus = useCallback5(() => {
971
+ const handleFocus = useCallback4(() => {
987
972
  if (onFocus) {
988
973
  onFocus(id, value);
989
974
  }
990
975
  }, [onFocus, id, value]);
991
- const handleBlur = useCallback5(() => {
976
+ const handleBlur = useCallback4(() => {
992
977
  if (onBlur) {
993
978
  onBlur(id, value);
994
979
  }
995
980
  }, [onBlur, id, value]);
996
- const handleChange = useCallback5(
981
+ const handleChange = useCallback4(
997
982
  (event) => {
998
983
  onChange(event.target.checked);
999
984
  },
@@ -1004,6 +989,7 @@ function CheckboxWidget(props) {
1004
989
  {
1005
990
  type: "checkbox",
1006
991
  id,
992
+ name: htmlName || id,
1007
993
  checked: value,
1008
994
  required,
1009
995
  disabled: disabled || readonly,
@@ -1035,10 +1021,11 @@ function CheckboxWidget(props) {
1035
1021
  }
1036
1022
 
1037
1023
  // src/widgets/CheckboxesWidget/CheckboxesWidget.tsx
1038
- import { useCallback as useCallback6 } from "react";
1024
+ import { useCallback as useCallback5 } from "react";
1039
1025
  import { jsx as jsx23, jsxs as jsxs12 } from "react/jsx-runtime";
1040
1026
  function CheckboxesWidget({
1041
1027
  id,
1028
+ htmlName,
1042
1029
  disabled,
1043
1030
  options,
1044
1031
  value,
@@ -1050,7 +1037,7 @@ function CheckboxesWidget({
1050
1037
  }) {
1051
1038
  const { enumOptions } = options;
1052
1039
  const isEnumeratedObject = enumOptions && enumOptions[0]?.value && typeof enumOptions[0].value === "object";
1053
- const isChecked = useCallback6(
1040
+ const isChecked = useCallback5(
1054
1041
  (option) => {
1055
1042
  if (!Array.isArray(value)) {
1056
1043
  return false;
@@ -1062,7 +1049,7 @@ function CheckboxesWidget({
1062
1049
  },
1063
1050
  [value, isEnumeratedObject]
1064
1051
  );
1065
- const handleChange = useCallback6(
1052
+ const handleChange = useCallback5(
1066
1053
  (event) => {
1067
1054
  const index = Number(event.target.dataset.index);
1068
1055
  const option = enumOptions?.[index];
@@ -1079,7 +1066,7 @@ function CheckboxesWidget({
1079
1066
  },
1080
1067
  [onChange, value, isChecked, isEnumeratedObject, enumOptions]
1081
1068
  );
1082
- const handleFocus = useCallback6(
1069
+ const handleFocus = useCallback5(
1083
1070
  (event) => {
1084
1071
  if (onFocus) {
1085
1072
  const index = Number(event.target.dataset.index);
@@ -1091,7 +1078,7 @@ function CheckboxesWidget({
1091
1078
  },
1092
1079
  [onFocus, id, enumOptions]
1093
1080
  );
1094
- const handleBlur = useCallback6(
1081
+ const handleBlur = useCallback5(
1095
1082
  (event) => {
1096
1083
  if (onBlur) {
1097
1084
  const index = Number(event.target.dataset.index);
@@ -1110,7 +1097,7 @@ function CheckboxesWidget({
1110
1097
  type: "checkbox",
1111
1098
  id: `${id}-${option.value}`,
1112
1099
  className: "checkbox",
1113
- name: id,
1100
+ name: htmlName || id,
1114
1101
  checked: isChecked(option),
1115
1102
  required,
1116
1103
  disabled: disabled || readonly,
@@ -1125,7 +1112,7 @@ function CheckboxesWidget({
1125
1112
  }
1126
1113
 
1127
1114
  // src/widgets/DateTimeWidget/DateTimeWidget.tsx
1128
- import { memo as memo2, useCallback as useCallback7, useEffect as useEffect2, useMemo as useMemo2, useRef, useState as useState2 } from "react";
1115
+ import { memo as memo2, useCallback as useCallback6, useEffect as useEffect2, useMemo, useRef, useState as useState2 } from "react";
1129
1116
  import { faCalendar } from "@fortawesome/free-solid-svg-icons";
1130
1117
  import { FontAwesomeIcon as FontAwesomeIcon2 } from "@fortawesome/react-fontawesome";
1131
1118
  import { format, isSameDay, isToday, isValid } from "date-fns";
@@ -1183,7 +1170,7 @@ function DateTimePickerPopup({ selectedDate, month, onMonthChange, onSelect, onT
1183
1170
  ...dayPickerStyles.modifiers,
1184
1171
  "custom-today": "btn btn-outline btn-info min-h-0 h-full"
1185
1172
  };
1186
- const handleClick = useCallback7((e) => {
1173
+ const handleClick = useCallback6((e) => {
1187
1174
  e.stopPropagation();
1188
1175
  }, []);
1189
1176
  return /* @__PURE__ */ jsxs13("div", { className: "p-3", children: [
@@ -1222,7 +1209,7 @@ function DateTimePickerPopup({ selectedDate, month, onMonthChange, onSelect, onT
1222
1209
  var MemoizedDateTimePickerPopup = memo2(DateTimePickerPopup);
1223
1210
  function DateTimeWidget(props) {
1224
1211
  const { id, value, onChange, onFocus, onBlur, schema } = props;
1225
- const initialDate = useMemo2(() => value ? new Date(value) : void 0, [value]);
1212
+ const initialDate = useMemo(() => value ? new Date(value) : void 0, [value]);
1226
1213
  const [localDate, setLocalDate] = useState2(initialDate);
1227
1214
  useEffect2(() => {
1228
1215
  setLocalDate(initialDate);
@@ -1244,8 +1231,8 @@ function DateTimeWidget(props) {
1244
1231
  setMonth(localDate);
1245
1232
  }
1246
1233
  }, [localDate, setMonth]);
1247
- const handleMonthChange = useCallback7((date) => setMonth(date), [setMonth]);
1248
- const handleSelect = useCallback7(
1234
+ const handleMonthChange = useCallback6((date) => setMonth(date), [setMonth]);
1235
+ const handleSelect = useCallback6(
1249
1236
  (date) => {
1250
1237
  if (date) {
1251
1238
  if (localDate) {
@@ -1256,7 +1243,7 @@ function DateTimeWidget(props) {
1256
1243
  },
1257
1244
  [localDate]
1258
1245
  );
1259
- const handleTimeChange = useCallback7(
1246
+ const handleTimeChange = useCallback6(
1260
1247
  (e) => {
1261
1248
  if (localDate) {
1262
1249
  const [hours, minutes] = e.target.value.split(":");
@@ -1267,7 +1254,7 @@ function DateTimeWidget(props) {
1267
1254
  },
1268
1255
  [localDate]
1269
1256
  );
1270
- const togglePicker = useCallback7(
1257
+ const togglePicker = useCallback6(
1271
1258
  (e) => {
1272
1259
  e.stopPropagation();
1273
1260
  setIsOpen((prev) => !prev);
@@ -1277,17 +1264,17 @@ function DateTimeWidget(props) {
1277
1264
  },
1278
1265
  [isOpen, id, onFocus, setIsOpen, value]
1279
1266
  );
1280
- const handleFocus = useCallback7(() => {
1267
+ const handleFocus = useCallback6(() => {
1281
1268
  if (onFocus) {
1282
1269
  onFocus(id, value);
1283
1270
  }
1284
1271
  }, [id, onFocus, value]);
1285
- const handleBlur = useCallback7(() => {
1272
+ const handleBlur = useCallback6(() => {
1286
1273
  if (!isOpen && onBlur) {
1287
1274
  onBlur(id, value);
1288
1275
  }
1289
1276
  }, [id, onBlur, value, isOpen]);
1290
- const handleKeyDown = useCallback7(
1277
+ const handleKeyDown = useCallback6(
1291
1278
  (e) => {
1292
1279
  if (e.key === "Enter" || e.key === " ") {
1293
1280
  togglePicker(e);
@@ -1295,7 +1282,7 @@ function DateTimeWidget(props) {
1295
1282
  },
1296
1283
  [togglePicker]
1297
1284
  );
1298
- const handleContainerClick = useCallback7((e) => {
1285
+ const handleContainerClick = useCallback6((e) => {
1299
1286
  e.stopPropagation();
1300
1287
  }, []);
1301
1288
  useEffect2(() => {
@@ -1310,7 +1297,7 @@ function DateTimeWidget(props) {
1310
1297
  document.addEventListener("keydown", handleEscape);
1311
1298
  return () => document.removeEventListener("keydown", handleEscape);
1312
1299
  }, [id, isOpen, setIsOpen, onBlur, value]);
1313
- const handleDoneClick = useCallback7(() => {
1300
+ const handleDoneClick = useCallback6(() => {
1314
1301
  setIsOpen(false);
1315
1302
  onChange(localDate ? localDate.toISOString() : "");
1316
1303
  if (onBlur) {
@@ -1371,7 +1358,7 @@ function DateTimeWidget(props) {
1371
1358
  }
1372
1359
 
1373
1360
  // src/widgets/DateWidget/DateWidget.tsx
1374
- import { memo as memo3, useCallback as useCallback8, useEffect as useEffect3, useMemo as useMemo3, useRef as useRef2, useState as useState3 } from "react";
1361
+ import { memo as memo3, useCallback as useCallback7, useEffect as useEffect3, useMemo as useMemo2, useRef as useRef2, useState as useState3 } from "react";
1375
1362
  import { faCalendar as faCalendar2 } from "@fortawesome/free-solid-svg-icons";
1376
1363
  import { FontAwesomeIcon as FontAwesomeIcon3 } from "@fortawesome/react-fontawesome";
1377
1364
  import { format as format2, isSameDay as isSameDay2, isToday as isToday2, isValid as isValid2 } from "date-fns";
@@ -1450,7 +1437,7 @@ function DatePickerPopup({ selectedDate, month, onMonthChange, onSelect }) {
1450
1437
  var MemoizedDatePickerPopup = memo3(DatePickerPopup);
1451
1438
  function DateWidget(props) {
1452
1439
  const { id, value, onChange, onFocus, onBlur, schema } = props;
1453
- const initialDate = useMemo3(() => value ? new Date(value) : void 0, [value]);
1440
+ const initialDate = useMemo2(() => value ? new Date(value) : void 0, [value]);
1454
1441
  const [localDate, setLocalDate] = useState3(initialDate);
1455
1442
  useEffect3(() => {
1456
1443
  setLocalDate(initialDate);
@@ -1472,8 +1459,8 @@ function DateWidget(props) {
1472
1459
  setMonth(localDate);
1473
1460
  }
1474
1461
  }, [localDate, setMonth]);
1475
- const handleMonthChange = useCallback8((date) => setMonth(date), [setMonth]);
1476
- const handleSelect = useCallback8((date) => {
1462
+ const handleMonthChange = useCallback7((date) => setMonth(date), [setMonth]);
1463
+ const handleSelect = useCallback7((date) => {
1477
1464
  if (date) {
1478
1465
  date.setHours(0, 0, 0, 0);
1479
1466
  setLocalDate(date);
@@ -1511,7 +1498,7 @@ function DateWidget(props) {
1511
1498
  }
1512
1499
  return { doc, win };
1513
1500
  };
1514
- const renderCalendar = useCallback8(() => {
1501
+ const renderCalendar = useCallback7(() => {
1515
1502
  if (!containerRef.current || !inputRef.current) {
1516
1503
  return;
1517
1504
  }
@@ -1541,7 +1528,7 @@ function DateWidget(props) {
1541
1528
  window.removeEventListener("scroll", renderCalendar);
1542
1529
  };
1543
1530
  }, [isOpen, renderCalendar]);
1544
- const togglePicker = useCallback8(
1531
+ const togglePicker = useCallback7(
1545
1532
  (e) => {
1546
1533
  e.stopPropagation();
1547
1534
  setIsOpen((prev) => !prev);
@@ -1551,12 +1538,12 @@ function DateWidget(props) {
1551
1538
  },
1552
1539
  [isOpen, id, onFocus, setIsOpen, value]
1553
1540
  );
1554
- const handleFocus = useCallback8(() => {
1541
+ const handleFocus = useCallback7(() => {
1555
1542
  if (onFocus) {
1556
1543
  onFocus(id, value);
1557
1544
  }
1558
1545
  }, [id, onFocus, value]);
1559
- const handleBlur = useCallback8(() => {
1546
+ const handleBlur = useCallback7(() => {
1560
1547
  if (!isOpen && onBlur) {
1561
1548
  onBlur(id, value);
1562
1549
  }
@@ -1573,7 +1560,7 @@ function DateWidget(props) {
1573
1560
  document.addEventListener("keydown", handleEscape);
1574
1561
  return () => document.removeEventListener("keydown", handleEscape);
1575
1562
  }, [id, isOpen, setIsOpen, onBlur, value]);
1576
- const handleDoneClick = useCallback8(() => {
1563
+ const handleDoneClick = useCallback7(() => {
1577
1564
  setIsOpen(false);
1578
1565
  onChange(localDate ? localDate.toISOString() : "");
1579
1566
  if (onBlur) {
@@ -1641,13 +1628,13 @@ function DateWidget(props) {
1641
1628
  }
1642
1629
 
1643
1630
  // src/widgets/FileWidget/FileWidget.tsx
1644
- import { useCallback as useCallback9 } from "react";
1631
+ import { useCallback as useCallback8 } from "react";
1645
1632
  import { jsx as jsx26 } from "react/jsx-runtime";
1646
1633
  function FileWidget(props) {
1647
1634
  const { id, required, disabled, readonly, schema, onChange, onFocus, onBlur, options = {} } = props;
1648
1635
  const isMulti = schema.type === "array" || Boolean(options.multiple);
1649
1636
  const accept = typeof options.accept === "string" ? options.accept : void 0;
1650
- const handleChange = useCallback9(
1637
+ const handleChange = useCallback8(
1651
1638
  (event) => {
1652
1639
  if (!event.target.files) {
1653
1640
  return;
@@ -1661,7 +1648,7 @@ function FileWidget(props) {
1661
1648
  },
1662
1649
  [onChange, isMulti]
1663
1650
  );
1664
- const handleFocus = useCallback9(
1651
+ const handleFocus = useCallback8(
1665
1652
  (event) => {
1666
1653
  if (onFocus) {
1667
1654
  onFocus(id, event.target.files ? Array.from(event.target.files) : null);
@@ -1669,7 +1656,7 @@ function FileWidget(props) {
1669
1656
  },
1670
1657
  [onFocus, id]
1671
1658
  );
1672
- const handleBlur = useCallback9(
1659
+ const handleBlur = useCallback8(
1673
1660
  (event) => {
1674
1661
  if (onBlur) {
1675
1662
  onBlur(id, event.target.files ? Array.from(event.target.files) : null);
@@ -1695,10 +1682,11 @@ function FileWidget(props) {
1695
1682
  }
1696
1683
 
1697
1684
  // src/widgets/RadioWidget/RadioWidget.tsx
1698
- import { useCallback as useCallback10 } from "react";
1685
+ import { useCallback as useCallback9 } from "react";
1699
1686
  import { jsx as jsx27, jsxs as jsxs15 } from "react/jsx-runtime";
1700
1687
  function RadioWidget({
1701
1688
  id,
1689
+ htmlName,
1702
1690
  options,
1703
1691
  value,
1704
1692
  required,
@@ -1719,7 +1707,7 @@ function RadioWidget({
1719
1707
  }
1720
1708
  return value === option.value;
1721
1709
  };
1722
- const handleFocus = useCallback10(
1710
+ const handleFocus = useCallback9(
1723
1711
  (event) => {
1724
1712
  if (onFocus) {
1725
1713
  const index = Number(event.target.dataset.index);
@@ -1729,7 +1717,7 @@ function RadioWidget({
1729
1717
  },
1730
1718
  [onFocus, id, enumOptions]
1731
1719
  );
1732
- const handleBlur = useCallback10(
1720
+ const handleBlur = useCallback9(
1733
1721
  (event) => {
1734
1722
  if (onBlur) {
1735
1723
  const index = Number(event.target.dataset.index);
@@ -1739,7 +1727,7 @@ function RadioWidget({
1739
1727
  },
1740
1728
  [onBlur, id, enumOptions]
1741
1729
  );
1742
- const handleChange = useCallback10(
1730
+ const handleChange = useCallback9(
1743
1731
  (event) => {
1744
1732
  const index = Number(event.target.dataset.index);
1745
1733
  const option = enumOptions?.[index];
@@ -1757,7 +1745,7 @@ function RadioWidget({
1757
1745
  type: "radio",
1758
1746
  id: `${id}-${option.value}`,
1759
1747
  className: "radio",
1760
- name: id,
1748
+ name: htmlName || id,
1761
1749
  value: getValue(option),
1762
1750
  checked: isChecked(option),
1763
1751
  required,
@@ -1773,7 +1761,7 @@ function RadioWidget({
1773
1761
  }
1774
1762
 
1775
1763
  // src/widgets/RangeWidget/RangeWidget.tsx
1776
- import { useCallback as useCallback11 } from "react";
1764
+ import { useCallback as useCallback10 } from "react";
1777
1765
  import { jsx as jsx28, jsxs as jsxs16 } from "react/jsx-runtime";
1778
1766
  function RangeWidget({
1779
1767
  id,
@@ -1796,7 +1784,7 @@ function RangeWidget({
1796
1784
  onBlur(id, event.target.value);
1797
1785
  }
1798
1786
  };
1799
- const handleChange = useCallback11(
1787
+ const handleChange = useCallback10(
1800
1788
  (event) => {
1801
1789
  onChange(event.target.value);
1802
1790
  },
@@ -1825,7 +1813,7 @@ function RangeWidget({
1825
1813
  }
1826
1814
 
1827
1815
  // src/widgets/RatingWidget/RatingWidget.tsx
1828
- import { useCallback as useCallback12 } from "react";
1816
+ import { useCallback as useCallback11 } from "react";
1829
1817
  import { jsx as jsx29 } from "react/jsx-runtime";
1830
1818
  function RatingWidget({
1831
1819
  id,
@@ -1845,13 +1833,13 @@ function RatingWidget({
1845
1833
  const min = schema.minimum || 0;
1846
1834
  const maskClass = shape === "heart" ? "mask-heart" : "mask-star-2";
1847
1835
  const sizeClass = size === "md" ? "" : `rating-${size}`;
1848
- const _onChange = useCallback12(
1836
+ const _onChange = useCallback11(
1849
1837
  ({ target: { value: value2 } }) => {
1850
1838
  onChange(parseInt(value2));
1851
1839
  },
1852
1840
  [onChange]
1853
1841
  );
1854
- const handleFocus = useCallback12(
1842
+ const handleFocus = useCallback11(
1855
1843
  (event) => {
1856
1844
  if (onFocus) {
1857
1845
  const starValue = Number(event.target.value);
@@ -1860,7 +1848,7 @@ function RatingWidget({
1860
1848
  },
1861
1849
  [onFocus, id]
1862
1850
  );
1863
- const handleBlur = useCallback12(
1851
+ const handleBlur = useCallback11(
1864
1852
  (event) => {
1865
1853
  if (onBlur) {
1866
1854
  const starValue = Number(event.target.value);
@@ -1901,7 +1889,7 @@ function RatingWidget({
1901
1889
  }
1902
1890
 
1903
1891
  // src/widgets/SelectWidget/SelectWidget.tsx
1904
- import { useCallback as useCallback13 } from "react";
1892
+ import { useCallback as useCallback12 } from "react";
1905
1893
  import {
1906
1894
  enumOptionsIndexForValue,
1907
1895
  enumOptionsValueForIndex
@@ -1936,7 +1924,7 @@ function SelectWidget({
1936
1924
  return String(val);
1937
1925
  };
1938
1926
  const isEnumeratedObject = enumOptions && enumOptions[0]?.value && typeof enumOptions[0].value === "object";
1939
- const handleOptionClick = useCallback13(
1927
+ const handleOptionClick = useCallback12(
1940
1928
  (event) => {
1941
1929
  const index = Number(event.currentTarget.dataset.value);
1942
1930
  if (isNaN(index)) {
@@ -1955,7 +1943,7 @@ function SelectWidget({
1955
1943
  },
1956
1944
  [value, multiple, isEnumeratedObject, enumOptions, optEmptyVal, onChange]
1957
1945
  );
1958
- const _onBlur = useCallback13(
1946
+ const _onBlur = useCallback12(
1959
1947
  ({ target }) => {
1960
1948
  const dataValue = target?.getAttribute("data-value");
1961
1949
  if (dataValue !== null) {
@@ -1964,7 +1952,7 @@ function SelectWidget({
1964
1952
  },
1965
1953
  [onBlur, id, enumOptions, optEmptyVal]
1966
1954
  );
1967
- const _onFocus = useCallback13(
1955
+ const _onFocus = useCallback12(
1968
1956
  ({ target }) => {
1969
1957
  const dataValue = target?.getAttribute("data-value");
1970
1958
  if (dataValue !== null) {
@@ -2018,11 +2006,11 @@ function SelectWidget({
2018
2006
  }
2019
2007
 
2020
2008
  // src/widgets/TextareaWidget/TextareaWidget.tsx
2021
- import { useCallback as useCallback14 } from "react";
2009
+ import { useCallback as useCallback13 } from "react";
2022
2010
  import { jsx as jsx31 } from "react/jsx-runtime";
2023
2011
  function TextareaWidget(props) {
2024
- const { id, value, required, disabled, readonly, onChange, onFocus, onBlur, options } = props;
2025
- const handleFocus = useCallback14(
2012
+ const { id, htmlName, value, required, disabled, readonly, onChange, onFocus, onBlur, options } = props;
2013
+ const handleFocus = useCallback13(
2026
2014
  (event) => {
2027
2015
  if (onFocus) {
2028
2016
  onFocus(id, event.target.value);
@@ -2030,7 +2018,7 @@ function TextareaWidget(props) {
2030
2018
  },
2031
2019
  [onFocus, id]
2032
2020
  );
2033
- const handleBlur = useCallback14(
2021
+ const handleBlur = useCallback13(
2034
2022
  (event) => {
2035
2023
  if (onBlur) {
2036
2024
  onBlur(id, event.target.value);
@@ -2038,7 +2026,7 @@ function TextareaWidget(props) {
2038
2026
  },
2039
2027
  [onBlur, id]
2040
2028
  );
2041
- const handleChange = useCallback14(
2029
+ const handleChange = useCallback13(
2042
2030
  (event) => {
2043
2031
  onChange(event.target.value);
2044
2032
  },
@@ -2049,6 +2037,7 @@ function TextareaWidget(props) {
2049
2037
  "textarea",
2050
2038
  {
2051
2039
  id,
2040
+ name: htmlName || id,
2052
2041
  value: value || "",
2053
2042
  required,
2054
2043
  disabled: disabled || readonly,
@@ -2063,11 +2052,11 @@ function TextareaWidget(props) {
2063
2052
  }
2064
2053
 
2065
2054
  // src/widgets/TimeWidget/TimeWidget.tsx
2066
- import { useCallback as useCallback15 } from "react";
2055
+ import { useCallback as useCallback14 } from "react";
2067
2056
  import { jsx as jsx32 } from "react/jsx-runtime";
2068
2057
  function TimeWidget(props) {
2069
2058
  const { id, value, onChange, onFocus, onBlur, required, disabled, readonly } = props;
2070
- const handleFocus = useCallback15(
2059
+ const handleFocus = useCallback14(
2071
2060
  (event) => {
2072
2061
  if (onFocus) {
2073
2062
  onFocus(id, event.target.value);
@@ -2075,7 +2064,7 @@ function TimeWidget(props) {
2075
2064
  },
2076
2065
  [onFocus, id]
2077
2066
  );
2078
- const handleBlur = useCallback15(
2067
+ const handleBlur = useCallback14(
2079
2068
  (event) => {
2080
2069
  if (onBlur) {
2081
2070
  onBlur(id, event.target.value);
@@ -2083,7 +2072,7 @@ function TimeWidget(props) {
2083
2072
  },
2084
2073
  [onBlur, id]
2085
2074
  );
2086
- const handleChange = useCallback15(
2075
+ const handleChange = useCallback14(
2087
2076
  (event) => {
2088
2077
  onChange(event.target.value);
2089
2078
  },
@@ -2107,19 +2096,19 @@ function TimeWidget(props) {
2107
2096
  }
2108
2097
 
2109
2098
  // src/widgets/ToggleWidget/ToggleWidget.tsx
2110
- import { useCallback as useCallback16 } from "react";
2099
+ import { useCallback as useCallback15 } from "react";
2111
2100
  import { jsx as jsx33, jsxs as jsxs18 } from "react/jsx-runtime";
2112
2101
  function ToggleWidget({ id, value, required, disabled, readonly, autofocus, onChange, onFocus, onBlur, options }) {
2113
- const _onChange = useCallback16(
2102
+ const _onChange = useCallback15(
2114
2103
  ({ target: { checked } }) => onChange(checked),
2115
2104
  [onChange]
2116
2105
  );
2117
- const handleFocus = useCallback16(() => {
2106
+ const handleFocus = useCallback15(() => {
2118
2107
  if (onFocus) {
2119
2108
  onFocus(id, value);
2120
2109
  }
2121
2110
  }, [onFocus, id, value]);
2122
- const handleBlur = useCallback16(() => {
2111
+ const handleBlur = useCallback15(() => {
2123
2112
  if (onBlur) {
2124
2113
  onBlur(id, value);
2125
2114
  }
@@ -2197,7 +2186,7 @@ function ThemeProvider({ children }) {
2197
2186
  return "cupcake";
2198
2187
  }
2199
2188
  });
2200
- const handleSetTheme = useCallback17((newTheme) => {
2189
+ const handleSetTheme = useCallback16((newTheme) => {
2201
2190
  try {
2202
2191
  localStorage.setItem("daisyui-theme", newTheme);
2203
2192
  setTheme(newTheme);