@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.
- package/dist/chakra-ui.esm.js +102 -113
- package/dist/chakra-ui.esm.js.map +3 -3
- package/dist/chakra-ui.umd.js +35 -44
- package/dist/index.cjs +140 -151
- package/dist/index.cjs.map +3 -3
- package/lib/templates/ArrayFieldItemButtonsTemplate/ArrayFieldItemButtonsTemplate.d.ts +2 -2
- package/lib/templates/ArrayFieldItemButtonsTemplate/ArrayFieldItemButtonsTemplate.js +2 -7
- package/lib/templates/ArrayFieldItemButtonsTemplate/ArrayFieldItemButtonsTemplate.js.map +1 -1
- package/lib/templates/ArrayFieldItemTemplate/ArrayFieldItemTemplate.d.ts +3 -3
- package/lib/templates/ArrayFieldItemTemplate/ArrayFieldItemTemplate.js +1 -1
- package/lib/templates/ArrayFieldItemTemplate/ArrayFieldItemTemplate.js.map +1 -1
- package/lib/templates/ArrayFieldTemplate/ArrayFieldTemplate.js +1 -2
- package/lib/templates/ArrayFieldTemplate/ArrayFieldTemplate.js.map +1 -1
- package/lib/templates/BaseInputTemplate/BaseInputTemplate.js +2 -2
- package/lib/templates/BaseInputTemplate/BaseInputTemplate.js.map +1 -1
- package/lib/templates/FieldTemplate/FieldTemplate.js +3 -3
- package/lib/templates/FieldTemplate/FieldTemplate.js.map +1 -1
- package/lib/templates/ObjectFieldTemplate/ObjectFieldTemplate.js +2 -2
- package/lib/templates/ObjectFieldTemplate/ObjectFieldTemplate.js.map +1 -1
- package/lib/templates/WrapIfAdditionalTemplate/WrapIfAdditionalTemplate.js +2 -9
- package/lib/templates/WrapIfAdditionalTemplate/WrapIfAdditionalTemplate.js.map +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/lib/widgets/CheckboxWidget/CheckboxWidget.js +2 -2
- package/lib/widgets/CheckboxWidget/CheckboxWidget.js.map +1 -1
- package/lib/widgets/CheckboxesWidget/CheckboxesWidget.d.ts +1 -1
- package/lib/widgets/CheckboxesWidget/CheckboxesWidget.js +2 -2
- package/lib/widgets/CheckboxesWidget/CheckboxesWidget.js.map +1 -1
- package/lib/widgets/RadioWidget/RadioWidget.d.ts +1 -1
- package/lib/widgets/RadioWidget/RadioWidget.js +2 -2
- package/lib/widgets/RadioWidget/RadioWidget.js.map +1 -1
- package/lib/widgets/TextareaWidget/TextareaWidget.js +2 -2
- package/lib/widgets/TextareaWidget/TextareaWidget.js.map +1 -1
- package/package.json +7 -7
- package/src/templates/ArrayFieldItemButtonsTemplate/ArrayFieldItemButtonsTemplate.tsx +10 -15
- package/src/templates/ArrayFieldItemTemplate/ArrayFieldItemTemplate.tsx +3 -3
- package/src/templates/ArrayFieldTemplate/ArrayFieldTemplate.tsx +1 -8
- package/src/templates/BaseInputTemplate/BaseInputTemplate.tsx +2 -1
- package/src/templates/FieldTemplate/FieldTemplate.tsx +9 -7
- package/src/templates/ObjectFieldTemplate/ObjectFieldTemplate.tsx +2 -2
- package/src/templates/WrapIfAdditionalTemplate/WrapIfAdditionalTemplate.tsx +5 -16
- package/src/widgets/CheckboxWidget/CheckboxWidget.tsx +2 -0
- package/src/widgets/CheckboxesWidget/CheckboxesWidget.tsx +2 -1
- package/src/widgets/RadioWidget/RadioWidget.tsx +2 -1
- package/src/widgets/TextareaWidget/TextareaWidget.tsx +2 -1
package/dist/chakra-ui.umd.js
CHANGED
|
@@ -13,19 +13,15 @@
|
|
|
13
13
|
hasMoveUp,
|
|
14
14
|
hasRemove,
|
|
15
15
|
fieldPathId,
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
16
|
+
onCopyItem,
|
|
17
|
+
onRemoveItem,
|
|
18
|
+
onMoveDownItem,
|
|
19
|
+
onMoveUpItem,
|
|
20
20
|
readonly,
|
|
21
21
|
registry,
|
|
22
22
|
uiSchema
|
|
23
23
|
} = props;
|
|
24
24
|
const { CopyButton: CopyButton2, MoveDownButton: MoveDownButton2, MoveUpButton: MoveUpButton2, RemoveButton: RemoveButton2 } = registry.templates.ButtonTemplates;
|
|
25
|
-
const onCopyClick = react.useMemo(() => onCopyIndexClick(index), [index, onCopyIndexClick]);
|
|
26
|
-
const onRemoveClick = react.useMemo(() => onDropIndexClick(index), [index, onDropIndexClick]);
|
|
27
|
-
const onArrowUpClick = react.useMemo(() => onReorderClick(index, index - 1), [index, onReorderClick]);
|
|
28
|
-
const onArrowDownClick = react.useMemo(() => onReorderClick(index, index + 1), [index, onReorderClick]);
|
|
29
25
|
const renderMany = [hasMoveUp || hasMoveDown, hasCopy, hasRemove].filter(Boolean).length > 1;
|
|
30
26
|
const btnClass = renderMany ? "join-item btn btn-sm px-2" : "btn btn-sm px-2 rounded-sm";
|
|
31
27
|
const removeBtnClass = renderMany ? "join-item btn btn-sm btn-error px-2" : "btn btn-sm btn-error px-2 rounded-sm";
|
|
@@ -37,7 +33,7 @@
|
|
|
37
33
|
id: utils.buttonId(fieldPathId, "moveUp"),
|
|
38
34
|
className: `rjsf-array-item-move-up ${btnClass}`,
|
|
39
35
|
disabled: disabled || readonly || !hasMoveUp,
|
|
40
|
-
onClick:
|
|
36
|
+
onClick: onMoveUpItem,
|
|
41
37
|
uiSchema,
|
|
42
38
|
registry
|
|
43
39
|
}
|
|
@@ -48,7 +44,7 @@
|
|
|
48
44
|
id: utils.buttonId(fieldPathId, "moveDown"),
|
|
49
45
|
className: `rjsf-array-item-move-down ${btnClass}`,
|
|
50
46
|
disabled: disabled || readonly || !hasMoveDown,
|
|
51
|
-
onClick:
|
|
47
|
+
onClick: onMoveDownItem,
|
|
52
48
|
uiSchema,
|
|
53
49
|
registry
|
|
54
50
|
}
|
|
@@ -60,7 +56,7 @@
|
|
|
60
56
|
id: utils.buttonId(fieldPathId, "copy"),
|
|
61
57
|
className: `rjsf-array-item-copy ${btnClass}`,
|
|
62
58
|
disabled: disabled || readonly,
|
|
63
|
-
onClick:
|
|
59
|
+
onClick: onCopyItem,
|
|
64
60
|
uiSchema,
|
|
65
61
|
registry
|
|
66
62
|
}
|
|
@@ -71,7 +67,7 @@
|
|
|
71
67
|
id: utils.buttonId(fieldPathId, "remove"),
|
|
72
68
|
className: `rjsf-array-item-remove ${removeBtnClass}`,
|
|
73
69
|
disabled: disabled || readonly,
|
|
74
|
-
onClick:
|
|
70
|
+
onClick: onRemoveItem,
|
|
75
71
|
uiSchema,
|
|
76
72
|
registry
|
|
77
73
|
}
|
|
@@ -119,11 +115,6 @@
|
|
|
119
115
|
registry,
|
|
120
116
|
uiOptions
|
|
121
117
|
);
|
|
122
|
-
const ArrayFieldItemTemplate2 = utils.getTemplate(
|
|
123
|
-
"ArrayFieldItemTemplate",
|
|
124
|
-
registry,
|
|
125
|
-
uiOptions
|
|
126
|
-
);
|
|
127
118
|
const ArrayFieldTitleTemplate = utils.getTemplate(
|
|
128
119
|
"ArrayFieldTitleTemplate",
|
|
129
120
|
registry,
|
|
@@ -167,7 +158,7 @@
|
|
|
167
158
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-4", children: [
|
|
168
159
|
!showOptionalDataControlInTitle ? optionalDataControl : void 0,
|
|
169
160
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "rjsf-array-item-list", children: [
|
|
170
|
-
items
|
|
161
|
+
items,
|
|
171
162
|
items && items.length === 0 && canAdd && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-center italic text-base-content/70", children: utils.TranslatableString.EmptyArray })
|
|
172
163
|
] }),
|
|
173
164
|
canAdd && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex justify-end", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -187,6 +178,7 @@
|
|
|
187
178
|
function BaseInputTemplate(props) {
|
|
188
179
|
const {
|
|
189
180
|
id,
|
|
181
|
+
htmlName,
|
|
190
182
|
value,
|
|
191
183
|
required,
|
|
192
184
|
disabled,
|
|
@@ -224,7 +216,7 @@
|
|
|
224
216
|
"input",
|
|
225
217
|
{
|
|
226
218
|
id,
|
|
227
|
-
name: id,
|
|
219
|
+
name: htmlName || id,
|
|
228
220
|
value: value || value === 0 ? value : "",
|
|
229
221
|
placeholder,
|
|
230
222
|
required,
|
|
@@ -364,21 +356,22 @@
|
|
|
364
356
|
help,
|
|
365
357
|
hideError,
|
|
366
358
|
displayLabel,
|
|
359
|
+
onKeyRename,
|
|
360
|
+
onKeyRenameBlur,
|
|
361
|
+
onRemoveProperty,
|
|
367
362
|
classNames,
|
|
368
|
-
// Destructure props we don't want to pass to div
|
|
369
|
-
description,
|
|
370
|
-
onKeyChange,
|
|
371
|
-
onDropPropertyClick,
|
|
372
363
|
uiSchema,
|
|
373
364
|
schema,
|
|
374
365
|
readonly,
|
|
375
366
|
required,
|
|
367
|
+
registry,
|
|
368
|
+
// Destructure props we don't want to pass to div
|
|
369
|
+
description,
|
|
376
370
|
rawErrors,
|
|
377
371
|
rawHelp,
|
|
378
372
|
rawDescription,
|
|
379
373
|
hidden,
|
|
380
374
|
onChange,
|
|
381
|
-
registry,
|
|
382
375
|
...divProps
|
|
383
376
|
} = props;
|
|
384
377
|
const isCheckbox = schema.type === "boolean";
|
|
@@ -395,8 +388,9 @@
|
|
|
395
388
|
disabled: divProps.disabled,
|
|
396
389
|
id,
|
|
397
390
|
label,
|
|
398
|
-
|
|
399
|
-
|
|
391
|
+
onKeyRename,
|
|
392
|
+
onKeyRenameBlur,
|
|
393
|
+
onRemoveProperty,
|
|
400
394
|
readonly,
|
|
401
395
|
required,
|
|
402
396
|
schema,
|
|
@@ -441,7 +435,7 @@
|
|
|
441
435
|
schema,
|
|
442
436
|
formData,
|
|
443
437
|
optionalDataControl,
|
|
444
|
-
|
|
438
|
+
onAddProperty,
|
|
445
439
|
registry
|
|
446
440
|
} = props;
|
|
447
441
|
const uiOptions = utils.getUiOptions(uiSchema);
|
|
@@ -496,7 +490,7 @@
|
|
|
496
490
|
{
|
|
497
491
|
id: utils.buttonId(fieldPathId, "add"),
|
|
498
492
|
className: "rjsf-object-property-expand btn btn-primary btn-sm",
|
|
499
|
-
onClick:
|
|
493
|
+
onClick: onAddProperty,
|
|
500
494
|
disabled: disabled || readonly,
|
|
501
495
|
uiSchema,
|
|
502
496
|
registry
|
|
@@ -560,8 +554,9 @@
|
|
|
560
554
|
required,
|
|
561
555
|
schema,
|
|
562
556
|
uiSchema,
|
|
563
|
-
|
|
564
|
-
|
|
557
|
+
onKeyRename,
|
|
558
|
+
onKeyRenameBlur,
|
|
559
|
+
onRemoveProperty,
|
|
565
560
|
registry,
|
|
566
561
|
...rest
|
|
567
562
|
} = props;
|
|
@@ -569,15 +564,6 @@
|
|
|
569
564
|
const { templates, translateString } = registry;
|
|
570
565
|
const { RemoveButton: RemoveButton2 } = templates.ButtonTemplates;
|
|
571
566
|
const keyLabel = translateString(utils.TranslatableString.KeyLabel, [label]);
|
|
572
|
-
const handleBlur = react.useCallback(
|
|
573
|
-
(event) => {
|
|
574
|
-
onKeyChange(event.target.value);
|
|
575
|
-
},
|
|
576
|
-
[onKeyChange]
|
|
577
|
-
);
|
|
578
|
-
const handleRemove = react.useCallback(() => {
|
|
579
|
-
onDropPropertyClick(label)();
|
|
580
|
-
}, [onDropPropertyClick, label]);
|
|
581
567
|
if (!additional) {
|
|
582
568
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: classNames, children });
|
|
583
569
|
}
|
|
@@ -590,7 +576,7 @@
|
|
|
590
576
|
type: "text",
|
|
591
577
|
className: "input input-bordered",
|
|
592
578
|
id: `${id}-key`,
|
|
593
|
-
onBlur:
|
|
579
|
+
onBlur: onKeyRenameBlur,
|
|
594
580
|
defaultValue: label,
|
|
595
581
|
disabled: disabled || readonly
|
|
596
582
|
}
|
|
@@ -603,7 +589,7 @@
|
|
|
603
589
|
id: utils.buttonId(id, "remove"),
|
|
604
590
|
className: "rjsf-object-property-remove",
|
|
605
591
|
disabled: disabled || readonly,
|
|
606
|
-
onClick:
|
|
592
|
+
onClick: onRemoveProperty,
|
|
607
593
|
uiSchema,
|
|
608
594
|
registry
|
|
609
595
|
}
|
|
@@ -836,6 +822,7 @@
|
|
|
836
822
|
function CheckboxWidget(props) {
|
|
837
823
|
const {
|
|
838
824
|
id,
|
|
825
|
+
htmlName,
|
|
839
826
|
value,
|
|
840
827
|
required,
|
|
841
828
|
disabled,
|
|
@@ -877,6 +864,7 @@
|
|
|
877
864
|
{
|
|
878
865
|
type: "checkbox",
|
|
879
866
|
id,
|
|
867
|
+
name: htmlName || id,
|
|
880
868
|
checked: value,
|
|
881
869
|
required,
|
|
882
870
|
disabled: disabled || readonly,
|
|
@@ -908,6 +896,7 @@
|
|
|
908
896
|
}
|
|
909
897
|
function CheckboxesWidget({
|
|
910
898
|
id,
|
|
899
|
+
htmlName,
|
|
911
900
|
disabled,
|
|
912
901
|
options,
|
|
913
902
|
value,
|
|
@@ -979,7 +968,7 @@
|
|
|
979
968
|
type: "checkbox",
|
|
980
969
|
id: `${id}-${option.value}`,
|
|
981
970
|
className: "checkbox",
|
|
982
|
-
name: id,
|
|
971
|
+
name: htmlName || id,
|
|
983
972
|
checked: isChecked(option),
|
|
984
973
|
required,
|
|
985
974
|
disabled: disabled || readonly,
|
|
@@ -1542,6 +1531,7 @@
|
|
|
1542
1531
|
}
|
|
1543
1532
|
function RadioWidget({
|
|
1544
1533
|
id,
|
|
1534
|
+
htmlName,
|
|
1545
1535
|
options,
|
|
1546
1536
|
value,
|
|
1547
1537
|
required,
|
|
@@ -1600,7 +1590,7 @@
|
|
|
1600
1590
|
type: "radio",
|
|
1601
1591
|
id: `${id}-${option.value}`,
|
|
1602
1592
|
className: "radio",
|
|
1603
|
-
name: id,
|
|
1593
|
+
name: htmlName || id,
|
|
1604
1594
|
value: getValue(option),
|
|
1605
1595
|
checked: isChecked(option),
|
|
1606
1596
|
required,
|
|
@@ -1844,7 +1834,7 @@
|
|
|
1844
1834
|
] }) });
|
|
1845
1835
|
}
|
|
1846
1836
|
function TextareaWidget(props) {
|
|
1847
|
-
const { id, value, required, disabled, readonly, onChange, onFocus, onBlur, options } = props;
|
|
1837
|
+
const { id, htmlName, value, required, disabled, readonly, onChange, onFocus, onBlur, options } = props;
|
|
1848
1838
|
const handleFocus = react.useCallback(
|
|
1849
1839
|
(event) => {
|
|
1850
1840
|
if (onFocus) {
|
|
@@ -1872,6 +1862,7 @@
|
|
|
1872
1862
|
"textarea",
|
|
1873
1863
|
{
|
|
1874
1864
|
id,
|
|
1865
|
+
name: htmlName || id,
|
|
1875
1866
|
value: value || "",
|
|
1876
1867
|
required,
|
|
1877
1868
|
disabled: disabled || readonly,
|