@rjsf/daisyui 6.0.1 → 6.1.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.
- package/dist/chakra-ui.esm.js +29 -12
- package/dist/chakra-ui.esm.js.map +2 -2
- package/dist/chakra-ui.umd.js +27 -12
- package/dist/index.cjs +66 -49
- package/dist/index.cjs.map +3 -3
- package/lib/templates/ArrayFieldItemTemplate/ArrayFieldItemTemplate.js +2 -2
- package/lib/templates/ArrayFieldItemTemplate/ArrayFieldItemTemplate.js.map +1 -1
- package/lib/templates/BaseInputTemplate/BaseInputTemplate.js +2 -2
- package/lib/templates/BaseInputTemplate/BaseInputTemplate.js.map +1 -1
- package/lib/templates/FieldHelpTemplate/FieldHelpTemplate.d.ts +1 -1
- package/lib/templates/FieldHelpTemplate/FieldHelpTemplate.js +7 -2
- package/lib/templates/FieldHelpTemplate/FieldHelpTemplate.js.map +1 -1
- package/lib/templates/FieldTemplate/FieldTemplate.js +1 -1
- package/lib/templates/FieldTemplate/FieldTemplate.js.map +1 -1
- package/lib/templates/WrapIfAdditionalTemplate/WrapIfAdditionalTemplate.js +5 -3
- package/lib/templates/WrapIfAdditionalTemplate/WrapIfAdditionalTemplate.js.map +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/templates/ArrayFieldItemTemplate/ArrayFieldItemTemplate.tsx +5 -4
- package/src/templates/BaseInputTemplate/BaseInputTemplate.tsx +2 -2
- package/src/templates/FieldHelpTemplate/FieldHelpTemplate.tsx +8 -4
- package/src/templates/FieldTemplate/FieldTemplate.tsx +2 -0
- package/src/templates/WrapIfAdditionalTemplate/WrapIfAdditionalTemplate.tsx +11 -5
package/dist/chakra-ui.umd.js
CHANGED
|
@@ -76,7 +76,7 @@
|
|
|
76
76
|
return renderMany ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "join", children: buttons }) : buttons;
|
|
77
77
|
}
|
|
78
78
|
function ArrayFieldItemTemplate(props) {
|
|
79
|
-
const { children, buttonsProps, hasToolbar, registry, uiSchema, index, totalItems } = props;
|
|
79
|
+
const { children, buttonsProps, displayLabel, hasToolbar, registry, uiSchema, index, totalItems } = props;
|
|
80
80
|
const uiOptions = utils.getUiOptions(uiSchema);
|
|
81
81
|
const ArrayFieldItemButtonsTemplate2 = utils.getTemplate(
|
|
82
82
|
"ArrayFieldItemButtonsTemplate",
|
|
@@ -88,10 +88,16 @@
|
|
|
88
88
|
const borderRadius = isFirstItem ? "rounded-t-lg" : isLastItem ? "rounded-b-lg" : "";
|
|
89
89
|
const marginBottom = isLastItem ? "" : "mb-[-1px]";
|
|
90
90
|
const zIndex = index === void 0 ? "" : "z-" + (10 - Math.min(index, 9));
|
|
91
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
91
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
92
|
+
"fieldset",
|
|
93
|
+
{
|
|
94
|
+
className: `fieldset bg-base-100 border border-base-300 p-4 flex ${borderRadius} ${marginBottom} ${zIndex}`,
|
|
95
|
+
children: [
|
|
96
|
+
children,
|
|
97
|
+
hasToolbar && /* @__PURE__ */ jsxRuntime.jsx("div", { className: `flex justify-end ${displayLabel ? "mt-5" : "mt-1"}`, children: /* @__PURE__ */ jsxRuntime.jsx(ArrayFieldItemButtonsTemplate2, { ...buttonsProps }) })
|
|
98
|
+
]
|
|
99
|
+
}
|
|
100
|
+
);
|
|
95
101
|
}
|
|
96
102
|
function ArrayFieldTemplate(props) {
|
|
97
103
|
const {
|
|
@@ -196,11 +202,11 @@
|
|
|
196
202
|
placeholder
|
|
197
203
|
} = props;
|
|
198
204
|
const inputProps = utils.getInputProps(schema, type, options);
|
|
199
|
-
let className = "input input-bordered";
|
|
205
|
+
let className = "input input-bordered w-full";
|
|
200
206
|
let isMulti = multiple;
|
|
201
207
|
if (type === "file") {
|
|
202
208
|
isMulti = schema.type === "array" || Boolean(options.multiple);
|
|
203
|
-
className = "file-input
|
|
209
|
+
className = "file-input";
|
|
204
210
|
}
|
|
205
211
|
const { step, min, max, accept, ...rest } = inputProps;
|
|
206
212
|
const htmlInputProps = { step, min, max, accept, ...schema.examples ? { list: utils.examplesId(id) } : void 0 };
|
|
@@ -351,8 +357,11 @@
|
|
|
351
357
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "rjsf-field-error-template text-red-600", children: /* @__PURE__ */ jsxRuntime.jsx("ul", { className: "list-disc list-inside", children: errors?.map((error, index) => /* @__PURE__ */ jsxRuntime.jsx("li", { children: error }, index)) ?? [] }) });
|
|
352
358
|
}
|
|
353
359
|
function FieldHelpTemplate(props) {
|
|
354
|
-
const { help } = props;
|
|
355
|
-
|
|
360
|
+
const { help, uiSchema, registry, fieldPathId } = props;
|
|
361
|
+
if (!help) {
|
|
362
|
+
return null;
|
|
363
|
+
}
|
|
364
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { id: utils.helpId(fieldPathId), className: "rjsf-field-help-template text-gray-500 text-sm", children: /* @__PURE__ */ jsxRuntime.jsx(core.RichHelp, { help, registry, uiSchema }) });
|
|
356
365
|
}
|
|
357
366
|
function FieldTemplate(props) {
|
|
358
367
|
const {
|
|
@@ -396,6 +405,7 @@
|
|
|
396
405
|
disabled: divProps.disabled,
|
|
397
406
|
id,
|
|
398
407
|
label,
|
|
408
|
+
displayLabel,
|
|
399
409
|
onKeyRename,
|
|
400
410
|
onKeyRenameBlur,
|
|
401
411
|
onRemoveProperty,
|
|
@@ -410,6 +420,7 @@
|
|
|
410
420
|
required && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-error ml-1", children: "*" })
|
|
411
421
|
] }) }),
|
|
412
422
|
children,
|
|
423
|
+
displayLabel && description ? description : null,
|
|
413
424
|
errors,
|
|
414
425
|
help
|
|
415
426
|
] })
|
|
@@ -558,6 +569,7 @@
|
|
|
558
569
|
disabled,
|
|
559
570
|
id,
|
|
560
571
|
label,
|
|
572
|
+
displayLabel,
|
|
561
573
|
readonly,
|
|
562
574
|
required,
|
|
563
575
|
schema,
|
|
@@ -565,6 +577,7 @@
|
|
|
565
577
|
onKeyRename,
|
|
566
578
|
onKeyRenameBlur,
|
|
567
579
|
onRemoveProperty,
|
|
580
|
+
rawDescription,
|
|
568
581
|
registry,
|
|
569
582
|
...rest
|
|
570
583
|
} = props;
|
|
@@ -572,12 +585,14 @@
|
|
|
572
585
|
const { templates, translateString } = registry;
|
|
573
586
|
const { RemoveButton: RemoveButton2 } = templates.ButtonTemplates;
|
|
574
587
|
const keyLabel = translateString(utils.TranslatableString.KeyLabel, [label]);
|
|
588
|
+
const marginDesc = rawDescription ? 10 : 0;
|
|
589
|
+
const margin = displayLabel ? 32 + marginDesc : 10;
|
|
575
590
|
if (!additional) {
|
|
576
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: classNames
|
|
591
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: `flex-grow ${classNames}`, children });
|
|
577
592
|
}
|
|
578
593
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: `wrap-if-additional-template ${classNames}`, ...rest, children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-baseline", style: { justifyContent: "space-between" }, children: [
|
|
579
594
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
580
|
-
/* @__PURE__ */ jsxRuntime.jsx("label", { htmlFor: `${id}-key`, className: "label", children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "label-text", children: keyLabel }) }),
|
|
595
|
+
displayLabel && /* @__PURE__ */ jsxRuntime.jsx("label", { htmlFor: `${id}-key`, className: "label", children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "label-text", children: keyLabel }) }),
|
|
581
596
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
582
597
|
"input",
|
|
583
598
|
{
|
|
@@ -591,7 +606,7 @@
|
|
|
591
606
|
)
|
|
592
607
|
] }),
|
|
593
608
|
children,
|
|
594
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex self-
|
|
609
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex self-start", style: { marginTop: `${margin}px` }, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
595
610
|
RemoveButton2,
|
|
596
611
|
{
|
|
597
612
|
id: utils.buttonId(id, "remove"),
|
package/dist/index.cjs
CHANGED
|
@@ -31,11 +31,11 @@ __export(index_exports, {
|
|
|
31
31
|
useTheme: () => useTheme
|
|
32
32
|
});
|
|
33
33
|
module.exports = __toCommonJS(index_exports);
|
|
34
|
-
var
|
|
34
|
+
var import_core5 = require("@rjsf/core");
|
|
35
35
|
|
|
36
36
|
// src/theme/Theme.tsx
|
|
37
37
|
var import_react15 = require("react");
|
|
38
|
-
var
|
|
38
|
+
var import_core3 = require("@rjsf/core");
|
|
39
39
|
|
|
40
40
|
// src/templates/ArrayFieldItemButtonsTemplate/ArrayFieldItemButtonsTemplate.tsx
|
|
41
41
|
var import_utils = require("@rjsf/utils");
|
|
@@ -115,7 +115,7 @@ function ArrayFieldItemButtonsTemplate(props) {
|
|
|
115
115
|
var import_utils2 = require("@rjsf/utils");
|
|
116
116
|
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
117
117
|
function ArrayFieldItemTemplate(props) {
|
|
118
|
-
const { children, buttonsProps, hasToolbar, registry, uiSchema, index, totalItems } = props;
|
|
118
|
+
const { children, buttonsProps, displayLabel, hasToolbar, registry, uiSchema, index, totalItems } = props;
|
|
119
119
|
const uiOptions = (0, import_utils2.getUiOptions)(uiSchema);
|
|
120
120
|
const ArrayFieldItemButtonsTemplate2 = (0, import_utils2.getTemplate)(
|
|
121
121
|
"ArrayFieldItemButtonsTemplate",
|
|
@@ -127,10 +127,16 @@ function ArrayFieldItemTemplate(props) {
|
|
|
127
127
|
const borderRadius = isFirstItem ? "rounded-t-lg" : isLastItem ? "rounded-b-lg" : "";
|
|
128
128
|
const marginBottom = isLastItem ? "" : "mb-[-1px]";
|
|
129
129
|
const zIndex = index === void 0 ? "" : "z-" + (10 - Math.min(index, 9));
|
|
130
|
-
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
130
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
|
|
131
|
+
"fieldset",
|
|
132
|
+
{
|
|
133
|
+
className: `fieldset bg-base-100 border border-base-300 p-4 flex ${borderRadius} ${marginBottom} ${zIndex}`,
|
|
134
|
+
children: [
|
|
135
|
+
children,
|
|
136
|
+
hasToolbar && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: `flex justify-end ${displayLabel ? "mt-5" : "mt-1"}`, children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(ArrayFieldItemButtonsTemplate2, { ...buttonsProps }) })
|
|
137
|
+
]
|
|
138
|
+
}
|
|
139
|
+
);
|
|
134
140
|
}
|
|
135
141
|
|
|
136
142
|
// src/templates/ArrayFieldTemplate/ArrayFieldTemplate.tsx
|
|
@@ -245,11 +251,11 @@ function BaseInputTemplate(props) {
|
|
|
245
251
|
placeholder
|
|
246
252
|
} = props;
|
|
247
253
|
const inputProps = (0, import_utils4.getInputProps)(schema, type, options);
|
|
248
|
-
let className = "input input-bordered";
|
|
254
|
+
let className = "input input-bordered w-full";
|
|
249
255
|
let isMulti = multiple;
|
|
250
256
|
if (type === "file") {
|
|
251
257
|
isMulti = schema.type === "array" || Boolean(options.multiple);
|
|
252
|
-
className = "file-input
|
|
258
|
+
className = "file-input";
|
|
253
259
|
}
|
|
254
260
|
const { step, min, max, accept, ...rest } = inputProps;
|
|
255
261
|
const htmlInputProps = { step, min, max, accept, ...schema.examples ? { list: (0, import_utils4.examplesId)(id) } : void 0 };
|
|
@@ -433,14 +439,19 @@ function FieldErrorTemplate(props) {
|
|
|
433
439
|
}
|
|
434
440
|
|
|
435
441
|
// src/templates/FieldHelpTemplate/FieldHelpTemplate.tsx
|
|
442
|
+
var import_utils8 = require("@rjsf/utils");
|
|
443
|
+
var import_core2 = require("@rjsf/core");
|
|
436
444
|
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
437
445
|
function FieldHelpTemplate(props) {
|
|
438
|
-
const { help } = props;
|
|
439
|
-
|
|
446
|
+
const { help, uiSchema, registry, fieldPathId } = props;
|
|
447
|
+
if (!help) {
|
|
448
|
+
return null;
|
|
449
|
+
}
|
|
450
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { id: (0, import_utils8.helpId)(fieldPathId), className: "rjsf-field-help-template text-gray-500 text-sm", children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_core2.RichHelp, { help, registry, uiSchema }) });
|
|
440
451
|
}
|
|
441
452
|
|
|
442
453
|
// src/templates/FieldTemplate/FieldTemplate.tsx
|
|
443
|
-
var
|
|
454
|
+
var import_utils9 = require("@rjsf/utils");
|
|
444
455
|
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
445
456
|
function FieldTemplate(props) {
|
|
446
457
|
const {
|
|
@@ -471,8 +482,8 @@ function FieldTemplate(props) {
|
|
|
471
482
|
...divProps
|
|
472
483
|
} = props;
|
|
473
484
|
const isCheckbox = schema.type === "boolean";
|
|
474
|
-
const uiOptions = (0,
|
|
475
|
-
const WrapIfAdditionalTemplate2 = (0,
|
|
485
|
+
const uiOptions = (0, import_utils9.getUiOptions)(uiSchema);
|
|
486
|
+
const WrapIfAdditionalTemplate2 = (0, import_utils9.getTemplate)(
|
|
476
487
|
"WrapIfAdditionalTemplate",
|
|
477
488
|
registry,
|
|
478
489
|
uiOptions
|
|
@@ -484,6 +495,7 @@ function FieldTemplate(props) {
|
|
|
484
495
|
disabled: divProps.disabled,
|
|
485
496
|
id,
|
|
486
497
|
label,
|
|
498
|
+
displayLabel,
|
|
487
499
|
onKeyRename,
|
|
488
500
|
onKeyRenameBlur,
|
|
489
501
|
onRemoveProperty,
|
|
@@ -498,6 +510,7 @@ function FieldTemplate(props) {
|
|
|
498
510
|
required && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "text-error ml-1", children: "*" })
|
|
499
511
|
] }) }),
|
|
500
512
|
children,
|
|
513
|
+
displayLabel && description ? description : null,
|
|
501
514
|
errors,
|
|
502
515
|
help
|
|
503
516
|
] })
|
|
@@ -526,7 +539,7 @@ function MultiSchemaFieldTemplate(props) {
|
|
|
526
539
|
}
|
|
527
540
|
|
|
528
541
|
// src/templates/ObjectFieldTemplate/ObjectFieldTemplate.tsx
|
|
529
|
-
var
|
|
542
|
+
var import_utils10 = require("@rjsf/utils");
|
|
530
543
|
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
531
544
|
function ObjectFieldTemplate(props) {
|
|
532
545
|
const {
|
|
@@ -544,9 +557,9 @@ function ObjectFieldTemplate(props) {
|
|
|
544
557
|
onAddProperty,
|
|
545
558
|
registry
|
|
546
559
|
} = props;
|
|
547
|
-
const uiOptions = (0,
|
|
548
|
-
const TitleFieldTemplate = (0,
|
|
549
|
-
const DescriptionFieldTemplate = (0,
|
|
560
|
+
const uiOptions = (0, import_utils10.getUiOptions)(uiSchema);
|
|
561
|
+
const TitleFieldTemplate = (0, import_utils10.getTemplate)("TitleFieldTemplate", registry, uiOptions);
|
|
562
|
+
const DescriptionFieldTemplate = (0, import_utils10.getTemplate)(
|
|
550
563
|
"DescriptionFieldTemplate",
|
|
551
564
|
registry,
|
|
552
565
|
uiOptions
|
|
@@ -560,7 +573,7 @@ function ObjectFieldTemplate(props) {
|
|
|
560
573
|
title && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
561
574
|
TitleFieldTemplate,
|
|
562
575
|
{
|
|
563
|
-
id: (0,
|
|
576
|
+
id: (0, import_utils10.titleId)(fieldPathId),
|
|
564
577
|
title,
|
|
565
578
|
required,
|
|
566
579
|
schema,
|
|
@@ -572,7 +585,7 @@ function ObjectFieldTemplate(props) {
|
|
|
572
585
|
description && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
573
586
|
DescriptionFieldTemplate,
|
|
574
587
|
{
|
|
575
|
-
id: (0,
|
|
588
|
+
id: (0, import_utils10.descriptionId)(fieldPathId),
|
|
576
589
|
description,
|
|
577
590
|
schema,
|
|
578
591
|
uiSchema,
|
|
@@ -591,10 +604,10 @@ function ObjectFieldTemplate(props) {
|
|
|
591
604
|
`${fieldPathId.$id}-${element.name}-${index}`
|
|
592
605
|
)
|
|
593
606
|
),
|
|
594
|
-
(0,
|
|
607
|
+
(0, import_utils10.canExpand)(schema, uiSchema, formData) && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: "flex justify-end", children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
595
608
|
AddButton2,
|
|
596
609
|
{
|
|
597
|
-
id: (0,
|
|
610
|
+
id: (0, import_utils10.buttonId)(fieldPathId, "add"),
|
|
598
611
|
className: "rjsf-object-property-expand btn btn-primary btn-sm",
|
|
599
612
|
onClick: onAddProperty,
|
|
600
613
|
disabled: disabled || readonly,
|
|
@@ -640,11 +653,11 @@ function OptionalDataControlsTemplate(props) {
|
|
|
640
653
|
}
|
|
641
654
|
|
|
642
655
|
// src/templates/TitleField/TitleField.tsx
|
|
643
|
-
var
|
|
656
|
+
var import_utils11 = require("@rjsf/utils");
|
|
644
657
|
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
645
658
|
function TitleField(props) {
|
|
646
659
|
const { id, title, uiSchema, optionalDataControl } = props;
|
|
647
|
-
const uiOptions = (0,
|
|
660
|
+
const uiOptions = (0, import_utils11.getUiOptions)(uiSchema);
|
|
648
661
|
let heading = /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("h2", { className: "text-3xl font-bold text-primary mb-2", children: uiOptions.title || title });
|
|
649
662
|
if (optionalDataControl) {
|
|
650
663
|
heading = /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "flex", children: [
|
|
@@ -659,7 +672,7 @@ function TitleField(props) {
|
|
|
659
672
|
}
|
|
660
673
|
|
|
661
674
|
// src/templates/WrapIfAdditionalTemplate/WrapIfAdditionalTemplate.tsx
|
|
662
|
-
var
|
|
675
|
+
var import_utils12 = require("@rjsf/utils");
|
|
663
676
|
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
664
677
|
function WrapIfAdditionalTemplate(props) {
|
|
665
678
|
const {
|
|
@@ -668,6 +681,7 @@ function WrapIfAdditionalTemplate(props) {
|
|
|
668
681
|
disabled,
|
|
669
682
|
id,
|
|
670
683
|
label,
|
|
684
|
+
displayLabel,
|
|
671
685
|
readonly,
|
|
672
686
|
required,
|
|
673
687
|
schema,
|
|
@@ -675,19 +689,22 @@ function WrapIfAdditionalTemplate(props) {
|
|
|
675
689
|
onKeyRename,
|
|
676
690
|
onKeyRenameBlur,
|
|
677
691
|
onRemoveProperty,
|
|
692
|
+
rawDescription,
|
|
678
693
|
registry,
|
|
679
694
|
...rest
|
|
680
695
|
} = props;
|
|
681
|
-
const additional =
|
|
696
|
+
const additional = import_utils12.ADDITIONAL_PROPERTY_FLAG in schema;
|
|
682
697
|
const { templates, translateString } = registry;
|
|
683
698
|
const { RemoveButton: RemoveButton2 } = templates.ButtonTemplates;
|
|
684
|
-
const keyLabel = translateString(
|
|
699
|
+
const keyLabel = translateString(import_utils12.TranslatableString.KeyLabel, [label]);
|
|
700
|
+
const marginDesc = rawDescription ? 10 : 0;
|
|
701
|
+
const margin = displayLabel ? 32 + marginDesc : 10;
|
|
685
702
|
if (!additional) {
|
|
686
|
-
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: classNames
|
|
703
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: `flex-grow ${classNames}`, children });
|
|
687
704
|
}
|
|
688
705
|
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: `wrap-if-additional-template ${classNames}`, ...rest, children: /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "flex items-baseline", style: { justifyContent: "space-between" }, children: [
|
|
689
706
|
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { children: [
|
|
690
|
-
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("label", { htmlFor: `${id}-key`, className: "label", children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: "label-text", children: keyLabel }) }),
|
|
707
|
+
displayLabel && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("label", { htmlFor: `${id}-key`, className: "label", children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: "label-text", children: keyLabel }) }),
|
|
691
708
|
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
692
709
|
"input",
|
|
693
710
|
{
|
|
@@ -701,10 +718,10 @@ function WrapIfAdditionalTemplate(props) {
|
|
|
701
718
|
)
|
|
702
719
|
] }),
|
|
703
720
|
children,
|
|
704
|
-
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: "flex self-
|
|
721
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: "flex self-start", style: { marginTop: `${margin}px` }, children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
705
722
|
RemoveButton2,
|
|
706
723
|
{
|
|
707
|
-
id: (0,
|
|
724
|
+
id: (0, import_utils12.buttonId)(id, "remove"),
|
|
708
725
|
className: "rjsf-object-property-remove",
|
|
709
726
|
disabled: disabled || readonly,
|
|
710
727
|
onClick: onRemoveProperty,
|
|
@@ -757,7 +774,7 @@ function AltDateTimeWidget({
|
|
|
757
774
|
var AltDateTimeWidget_default = AltDateTimeWidget;
|
|
758
775
|
|
|
759
776
|
// src/widgets/AltDateWidget/AltDateWidget.tsx
|
|
760
|
-
var
|
|
777
|
+
var import_utils13 = require("@rjsf/utils");
|
|
761
778
|
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
762
779
|
function AltDateWidget(props) {
|
|
763
780
|
const {
|
|
@@ -772,12 +789,12 @@ function AltDateWidget(props) {
|
|
|
772
789
|
onFocus
|
|
773
790
|
} = props;
|
|
774
791
|
const { translateString } = registry;
|
|
775
|
-
const { elements, handleChange, handleClear, handleSetNow } = (0,
|
|
792
|
+
const { elements, handleChange, handleClear, handleSetNow } = (0, import_utils13.useAltDateWidgetProps)(props);
|
|
776
793
|
return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "space-y-3", children: [
|
|
777
794
|
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: "grid grid-cols-3 gap-2", children: elements.map((elemProps, i) => /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "form-control", children: [
|
|
778
795
|
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("label", { className: "label", children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: "label-text capitalize", children: elemProps.type }) }),
|
|
779
796
|
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
780
|
-
|
|
797
|
+
import_utils13.DateElement,
|
|
781
798
|
{
|
|
782
799
|
rootId: id,
|
|
783
800
|
name,
|
|
@@ -803,7 +820,7 @@ function AltDateWidget(props) {
|
|
|
803
820
|
className: "btn btn-sm btn-primary",
|
|
804
821
|
onClick: handleSetNow,
|
|
805
822
|
disabled: disabled || readonly,
|
|
806
|
-
children: translateString(
|
|
823
|
+
children: translateString(import_utils13.TranslatableString.NowLabel)
|
|
807
824
|
}
|
|
808
825
|
),
|
|
809
826
|
(options.hideClearButton !== void 0 ? !options.hideClearButton : true) && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
@@ -813,7 +830,7 @@ function AltDateWidget(props) {
|
|
|
813
830
|
className: "btn btn-sm btn-secondary",
|
|
814
831
|
onClick: handleClear,
|
|
815
832
|
disabled: disabled || readonly,
|
|
816
|
-
children: translateString(
|
|
833
|
+
children: translateString(import_utils13.TranslatableString.ClearLabel)
|
|
817
834
|
}
|
|
818
835
|
)
|
|
819
836
|
] })
|
|
@@ -822,7 +839,7 @@ function AltDateWidget(props) {
|
|
|
822
839
|
|
|
823
840
|
// src/widgets/CheckboxWidget/CheckboxWidget.tsx
|
|
824
841
|
var import_react4 = require("react");
|
|
825
|
-
var
|
|
842
|
+
var import_utils14 = require("@rjsf/utils");
|
|
826
843
|
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
827
844
|
function CheckboxWidget(props) {
|
|
828
845
|
const {
|
|
@@ -842,7 +859,7 @@ function CheckboxWidget(props) {
|
|
|
842
859
|
onFocus,
|
|
843
860
|
onBlur
|
|
844
861
|
} = props;
|
|
845
|
-
const DescriptionFieldTemplate = (0,
|
|
862
|
+
const DescriptionFieldTemplate = (0, import_utils14.getTemplate)(
|
|
846
863
|
"DescriptionFieldTemplate",
|
|
847
864
|
registry,
|
|
848
865
|
options
|
|
@@ -883,7 +900,7 @@ function CheckboxWidget(props) {
|
|
|
883
900
|
!hideLabel && description && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
884
901
|
DescriptionFieldTemplate,
|
|
885
902
|
{
|
|
886
|
-
id: (0,
|
|
903
|
+
id: (0, import_utils14.descriptionId)(id),
|
|
887
904
|
description,
|
|
888
905
|
schema,
|
|
889
906
|
uiSchema,
|
|
@@ -1716,7 +1733,7 @@ function RatingWidget({
|
|
|
1716
1733
|
|
|
1717
1734
|
// src/widgets/SelectWidget/SelectWidget.tsx
|
|
1718
1735
|
var import_react11 = require("react");
|
|
1719
|
-
var
|
|
1736
|
+
var import_utils15 = require("@rjsf/utils");
|
|
1720
1737
|
var import_jsx_runtime29 = require("react/jsx-runtime");
|
|
1721
1738
|
function SelectWidget({
|
|
1722
1739
|
schema,
|
|
@@ -1755,12 +1772,12 @@ function SelectWidget({
|
|
|
1755
1772
|
}
|
|
1756
1773
|
if (multiple) {
|
|
1757
1774
|
const currentValue = Array.isArray(value) ? value : [];
|
|
1758
|
-
const optionValue = isEnumeratedObject ? enumOptions[index].value : (0,
|
|
1775
|
+
const optionValue = isEnumeratedObject ? enumOptions[index].value : (0, import_utils15.enumOptionsValueForIndex)(String(index), enumOptions, optEmptyVal);
|
|
1759
1776
|
const newValue = currentValue.includes(optionValue) ? currentValue.filter((v) => v !== optionValue) : [...currentValue, optionValue];
|
|
1760
1777
|
onChange(newValue);
|
|
1761
1778
|
} else {
|
|
1762
1779
|
onChange(
|
|
1763
|
-
isEnumeratedObject ? enumOptions[index].value : (0,
|
|
1780
|
+
isEnumeratedObject ? enumOptions[index].value : (0, import_utils15.enumOptionsValueForIndex)(String(index), enumOptions, optEmptyVal)
|
|
1764
1781
|
);
|
|
1765
1782
|
}
|
|
1766
1783
|
},
|
|
@@ -1770,7 +1787,7 @@ function SelectWidget({
|
|
|
1770
1787
|
({ target }) => {
|
|
1771
1788
|
const dataValue = target?.getAttribute("data-value");
|
|
1772
1789
|
if (dataValue !== null) {
|
|
1773
|
-
onBlur(id, (0,
|
|
1790
|
+
onBlur(id, (0, import_utils15.enumOptionsValueForIndex)(dataValue, enumOptions, optEmptyVal));
|
|
1774
1791
|
}
|
|
1775
1792
|
},
|
|
1776
1793
|
[onBlur, id, enumOptions, optEmptyVal]
|
|
@@ -1779,12 +1796,12 @@ function SelectWidget({
|
|
|
1779
1796
|
({ target }) => {
|
|
1780
1797
|
const dataValue = target?.getAttribute("data-value");
|
|
1781
1798
|
if (dataValue !== null) {
|
|
1782
|
-
onFocus(id, (0,
|
|
1799
|
+
onFocus(id, (0, import_utils15.enumOptionsValueForIndex)(dataValue, enumOptions, optEmptyVal));
|
|
1783
1800
|
}
|
|
1784
1801
|
},
|
|
1785
1802
|
[onFocus, id, enumOptions, optEmptyVal]
|
|
1786
1803
|
);
|
|
1787
|
-
const selectedIndexes = (0,
|
|
1804
|
+
const selectedIndexes = (0, import_utils15.enumOptionsIndexForValue)(value, enumOptions, multiple);
|
|
1788
1805
|
const selectedValues = Array.isArray(selectedIndexes) ? selectedIndexes : [selectedIndexes];
|
|
1789
1806
|
const optionsList = enumOptions || (Array.isArray(schema.examples) ? schema.examples.map((example) => ({ value: example, label: example })) : []);
|
|
1790
1807
|
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { className: "form-control w-full", children: /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: "dropdown w-full", children: [
|
|
@@ -1981,7 +1998,7 @@ var Widgets_default = generateWidgets;
|
|
|
1981
1998
|
// src/theme/Theme.tsx
|
|
1982
1999
|
var import_jsx_runtime33 = require("react/jsx-runtime");
|
|
1983
2000
|
function generateTheme() {
|
|
1984
|
-
const { fields } = (0,
|
|
2001
|
+
const { fields } = (0, import_core3.getDefaultRegistry)();
|
|
1985
2002
|
const generatedWidgets = generateWidgets();
|
|
1986
2003
|
const templates = generateTemplates();
|
|
1987
2004
|
return {
|
|
@@ -2020,8 +2037,8 @@ function ThemeProvider({ children }) {
|
|
|
2020
2037
|
var useTheme = () => (0, import_react15.useContext)(ThemeContext);
|
|
2021
2038
|
|
|
2022
2039
|
// src/DaisyUIForm.tsx
|
|
2023
|
-
var
|
|
2024
|
-
var DaisyUIForm = (0,
|
|
2040
|
+
var import_core4 = require("@rjsf/core");
|
|
2041
|
+
var DaisyUIForm = (0, import_core4.withTheme)(Theme_default);
|
|
2025
2042
|
var DaisyUIForm_default = DaisyUIForm;
|
|
2026
2043
|
|
|
2027
2044
|
// src/DaisyUIFrameProvider.tsx
|
|
@@ -2084,5 +2101,5 @@ var __createDaisyUIFrameProvider = (props) => {
|
|
|
2084
2101
|
};
|
|
2085
2102
|
|
|
2086
2103
|
// src/index.ts
|
|
2087
|
-
var index_default = (0,
|
|
2104
|
+
var index_default = (0, import_core5.withTheme)(Theme_default);
|
|
2088
2105
|
//# sourceMappingURL=index.cjs.map
|