@rjsf/primereact 6.0.0-beta.20 → 6.0.0-beta.21
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/index.cjs +129 -70
- package/dist/index.cjs.map +4 -4
- package/dist/primereact.esm.js +121 -62
- package/dist/primereact.esm.js.map +4 -4
- package/dist/primereact.umd.js +75 -19
- package/lib/ArrayFieldTemplate/ArrayFieldTemplate.js +4 -4
- package/lib/ArrayFieldTemplate/ArrayFieldTemplate.js.map +1 -1
- package/lib/ArrayFieldTitleTemplate/ArrayFieldTitleTemplate.d.ts +1 -1
- package/lib/ArrayFieldTitleTemplate/ArrayFieldTitleTemplate.js +7 -3
- package/lib/ArrayFieldTitleTemplate/ArrayFieldTitleTemplate.js.map +1 -1
- package/lib/IconButton/IconButton.d.ts +7 -6
- package/lib/IconButton/IconButton.js +1 -2
- package/lib/IconButton/IconButton.js.map +1 -1
- package/lib/ObjectFieldTemplate/ObjectFieldTemplate.js +3 -2
- package/lib/ObjectFieldTemplate/ObjectFieldTemplate.js.map +1 -1
- package/lib/OptionalDataControlsTemplate/OptionalDataControlsTemplate.d.ts +10 -0
- package/lib/OptionalDataControlsTemplate/OptionalDataControlsTemplate.js +21 -0
- package/lib/OptionalDataControlsTemplate/OptionalDataControlsTemplate.js.map +1 -0
- package/lib/OptionalDataControlsTemplate/index.d.ts +2 -0
- package/lib/OptionalDataControlsTemplate/index.js +3 -0
- package/lib/OptionalDataControlsTemplate/index.js.map +1 -0
- package/lib/Templates/Templates.js +2 -0
- package/lib/Templates/Templates.js.map +1 -1
- package/lib/TitleField/TitleField.d.ts +1 -1
- package/lib/TitleField/TitleField.js +6 -2
- package/lib/TitleField/TitleField.js.map +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/package.json +7 -7
- package/src/ArrayFieldTemplate/ArrayFieldTemplate.tsx +13 -10
- package/src/ArrayFieldTitleTemplate/ArrayFieldTitleTemplate.tsx +11 -2
- package/src/IconButton/IconButton.tsx +13 -9
- package/src/ObjectFieldTemplate/ObjectFieldTemplate.tsx +4 -0
- package/src/OptionalDataControlsTemplate/OptionalDataControlsTemplate.tsx +44 -0
- package/src/OptionalDataControlsTemplate/index.ts +2 -0
- package/src/Templates/Templates.ts +2 -0
- package/src/TitleField/TitleField.tsx +15 -3
package/dist/index.cjs
CHANGED
|
@@ -88,6 +88,7 @@ function ArrayFieldTemplate(props) {
|
|
|
88
88
|
className,
|
|
89
89
|
disabled,
|
|
90
90
|
items,
|
|
91
|
+
optionalDataControl,
|
|
91
92
|
onAddClick,
|
|
92
93
|
readonly,
|
|
93
94
|
schema,
|
|
@@ -112,6 +113,7 @@ function ArrayFieldTemplate(props) {
|
|
|
112
113
|
registry,
|
|
113
114
|
uiOptions
|
|
114
115
|
);
|
|
116
|
+
const showOptionalDataControlInTitle = !readonly && !disabled;
|
|
115
117
|
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_jsx_runtime3.Fragment, { children: [
|
|
116
118
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
117
119
|
ArrayFieldTitleTemplate2,
|
|
@@ -121,7 +123,8 @@ function ArrayFieldTemplate(props) {
|
|
|
121
123
|
schema,
|
|
122
124
|
uiSchema,
|
|
123
125
|
required,
|
|
124
|
-
registry
|
|
126
|
+
registry,
|
|
127
|
+
optionalDataControl: showOptionalDataControlInTitle ? optionalDataControl : void 0
|
|
125
128
|
}
|
|
126
129
|
),
|
|
127
130
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
|
|
@@ -142,15 +145,18 @@ function ArrayFieldTemplate(props) {
|
|
|
142
145
|
}
|
|
143
146
|
),
|
|
144
147
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { children: [
|
|
145
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
...itemUiSchema
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
148
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { children: [
|
|
149
|
+
!showOptionalDataControlInTitle ? optionalDataControl : void 0,
|
|
150
|
+
items.map(({ key, uiSchema: itemUiSchema = {}, ...props2 }) => {
|
|
151
|
+
const mergedUiSchema = {
|
|
152
|
+
...itemUiSchema,
|
|
153
|
+
[import_utils3.UI_OPTIONS_KEY]: {
|
|
154
|
+
...itemUiSchema[import_utils3.UI_OPTIONS_KEY]
|
|
155
|
+
}
|
|
156
|
+
};
|
|
157
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(ArrayFieldItemTemplate2, { ...props2, uiSchema: mergedUiSchema }, key);
|
|
158
|
+
})
|
|
159
|
+
] }),
|
|
154
160
|
canAdd && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
155
161
|
"div",
|
|
156
162
|
{
|
|
@@ -403,6 +409,7 @@ var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
|
403
409
|
function ObjectFieldTemplate(props) {
|
|
404
410
|
const {
|
|
405
411
|
description,
|
|
412
|
+
optionalDataControl,
|
|
406
413
|
onAddClick,
|
|
407
414
|
title,
|
|
408
415
|
properties,
|
|
@@ -422,6 +429,7 @@ function ObjectFieldTemplate(props) {
|
|
|
422
429
|
registry,
|
|
423
430
|
uiOptions
|
|
424
431
|
);
|
|
432
|
+
const showOptionalDataControlInTitle = !readonly && !disabled;
|
|
425
433
|
const {
|
|
426
434
|
ButtonTemplates: { AddButton: AddButton2 }
|
|
427
435
|
} = registry.templates;
|
|
@@ -434,7 +442,8 @@ function ObjectFieldTemplate(props) {
|
|
|
434
442
|
required,
|
|
435
443
|
schema,
|
|
436
444
|
uiSchema,
|
|
437
|
-
registry
|
|
445
|
+
registry,
|
|
446
|
+
optionalDataControl: showOptionalDataControlInTitle ? optionalDataControl : void 0
|
|
438
447
|
}
|
|
439
448
|
),
|
|
440
449
|
description && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { style: { marginBottom: "1rem" }, children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
@@ -447,6 +456,7 @@ function ObjectFieldTemplate(props) {
|
|
|
447
456
|
registry
|
|
448
457
|
}
|
|
449
458
|
) }),
|
|
459
|
+
!showOptionalDataControlInTitle ? optionalDataControl : void 0,
|
|
450
460
|
properties.map((prop) => prop.content),
|
|
451
461
|
(0, import_utils10.canExpand)(schema, uiSchema, formData) && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { style: { marginTop: "1rem", textAlign: "right" }, children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
452
462
|
AddButton2,
|
|
@@ -462,43 +472,84 @@ function ObjectFieldTemplate(props) {
|
|
|
462
472
|
] });
|
|
463
473
|
}
|
|
464
474
|
|
|
475
|
+
// src/OptionalDataControlsTemplate/OptionalDataControlsTemplate.tsx
|
|
476
|
+
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
477
|
+
function OptionalDataControlsTemplate(props) {
|
|
478
|
+
const { id, registry, label, onAddClick, onRemoveClick } = props;
|
|
479
|
+
if (onAddClick) {
|
|
480
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
481
|
+
IconButton,
|
|
482
|
+
{
|
|
483
|
+
id,
|
|
484
|
+
registry,
|
|
485
|
+
className: "rjsf-add-optional-data",
|
|
486
|
+
onClick: onAddClick,
|
|
487
|
+
title: label,
|
|
488
|
+
icon: "pi pi-plus",
|
|
489
|
+
style: { height: "1.5rem", width: "1.5rem" }
|
|
490
|
+
}
|
|
491
|
+
);
|
|
492
|
+
} else if (onRemoveClick) {
|
|
493
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
494
|
+
RemoveButton,
|
|
495
|
+
{
|
|
496
|
+
id,
|
|
497
|
+
registry,
|
|
498
|
+
className: "rjsf-remove-optional-data",
|
|
499
|
+
onClick: onRemoveClick,
|
|
500
|
+
title: label,
|
|
501
|
+
style: { height: "1.5rem", width: "1.5rem" }
|
|
502
|
+
}
|
|
503
|
+
);
|
|
504
|
+
}
|
|
505
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("em", { id, children: label });
|
|
506
|
+
}
|
|
507
|
+
|
|
465
508
|
// src/SubmitButton/SubmitButton.tsx
|
|
466
509
|
var import_button3 = require("primereact/button");
|
|
467
510
|
var import_utils11 = require("@rjsf/utils");
|
|
468
|
-
var
|
|
511
|
+
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
469
512
|
function SubmitButton({ uiSchema }) {
|
|
470
513
|
const { submitText, norender, props: submitButtonProps = {} } = (0, import_utils11.getSubmitButtonOptions)(uiSchema);
|
|
471
514
|
if (norender) {
|
|
472
515
|
return null;
|
|
473
516
|
}
|
|
474
|
-
return /* @__PURE__ */ (0,
|
|
517
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_button3.Button, { type: "submit", label: submitText, ...submitButtonProps });
|
|
475
518
|
}
|
|
476
519
|
|
|
477
520
|
// src/TitleField/TitleField.tsx
|
|
478
521
|
var import_divider = require("primereact/divider");
|
|
479
522
|
var import_utils12 = require("@rjsf/utils");
|
|
480
|
-
var
|
|
523
|
+
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
481
524
|
function TitleField({
|
|
482
525
|
id,
|
|
483
526
|
title,
|
|
484
527
|
uiSchema,
|
|
485
|
-
required
|
|
528
|
+
required,
|
|
529
|
+
optionalDataControl
|
|
486
530
|
}) {
|
|
487
531
|
const uiOptions = (0, import_utils12.getUiOptions)(uiSchema);
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
/* @__PURE__ */ (0,
|
|
532
|
+
let heading = /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("h5", { style: { margin: 0, fontSize: id === (0, import_utils12.titleId)("root") ? "1.5rem" : "1.2rem" }, children: [
|
|
533
|
+
uiOptions.title || title,
|
|
534
|
+
" ",
|
|
535
|
+
required ? "*" : ""
|
|
536
|
+
] });
|
|
537
|
+
if (optionalDataControl) {
|
|
538
|
+
heading = /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { style: { display: "flex" }, children: [
|
|
539
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { style: { flexGrow: 1 }, children: heading }),
|
|
540
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { style: { marginLeft: "-5px" }, children: optionalDataControl })
|
|
541
|
+
] });
|
|
542
|
+
}
|
|
543
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { id, children: [
|
|
544
|
+
heading,
|
|
545
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_divider.Divider, { pt: { root: { style: { marginTop: "0.5rem" } } } })
|
|
495
546
|
] });
|
|
496
547
|
}
|
|
497
548
|
|
|
498
549
|
// src/WrapIfAdditionalTemplate/WrapIfAdditionalTemplate.tsx
|
|
499
550
|
var import_utils13 = require("@rjsf/utils");
|
|
500
551
|
var import_inputtext2 = require("primereact/inputtext");
|
|
501
|
-
var
|
|
552
|
+
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
502
553
|
function WrapIfAdditionalTemplate({
|
|
503
554
|
classNames,
|
|
504
555
|
style,
|
|
@@ -518,18 +569,18 @@ function WrapIfAdditionalTemplate({
|
|
|
518
569
|
const keyLabel = translateString(import_utils13.TranslatableString.KeyLabel, [label]);
|
|
519
570
|
const additional = import_utils13.ADDITIONAL_PROPERTY_FLAG in schema;
|
|
520
571
|
if (!additional) {
|
|
521
|
-
return /* @__PURE__ */ (0,
|
|
572
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: classNames, style, children });
|
|
522
573
|
}
|
|
523
574
|
const handleBlur = ({ target }) => onKeyChange(target.value);
|
|
524
|
-
return /* @__PURE__ */ (0,
|
|
575
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
|
|
525
576
|
"div",
|
|
526
577
|
{
|
|
527
578
|
className: classNames,
|
|
528
579
|
style: { ...style, display: "flex", alignItems: "center", gap: "1rem" },
|
|
529
580
|
children: [
|
|
530
|
-
/* @__PURE__ */ (0,
|
|
531
|
-
/* @__PURE__ */ (0,
|
|
532
|
-
/* @__PURE__ */ (0,
|
|
581
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { style: { flex: 1 }, children: [
|
|
582
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("label", { htmlFor: `${id}-key`, style: { display: "block", marginBottom: "0.5rem" }, children: keyLabel }),
|
|
583
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
533
584
|
import_inputtext2.InputText,
|
|
534
585
|
{
|
|
535
586
|
id: `${id}-key`,
|
|
@@ -542,8 +593,8 @@ function WrapIfAdditionalTemplate({
|
|
|
542
593
|
}
|
|
543
594
|
)
|
|
544
595
|
] }),
|
|
545
|
-
/* @__PURE__ */ (0,
|
|
546
|
-
/* @__PURE__ */ (0,
|
|
596
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { style: { flex: 1 }, children }),
|
|
597
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
547
598
|
RemoveButton2,
|
|
548
599
|
{
|
|
549
600
|
id: (0, import_utils13.buttonId)(id, "remove"),
|
|
@@ -561,19 +612,26 @@ function WrapIfAdditionalTemplate({
|
|
|
561
612
|
|
|
562
613
|
// src/ArrayFieldTitleTemplate/ArrayFieldTitleTemplate.tsx
|
|
563
614
|
var import_utils14 = require("@rjsf/utils");
|
|
564
|
-
var
|
|
565
|
-
function ArrayFieldTitleTemplate({ title, uiSchema, required, fieldPathId }) {
|
|
615
|
+
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
616
|
+
function ArrayFieldTitleTemplate({ title, uiSchema, required, fieldPathId, optionalDataControl }) {
|
|
566
617
|
const uiOptions = (0, import_utils14.getUiOptions)(uiSchema);
|
|
567
|
-
|
|
618
|
+
let heading = /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("h5", { id: (0, import_utils14.titleId)(fieldPathId), style: { margin: 0, fontSize: "1.5rem", marginBottom: "0.2rem" }, children: [
|
|
568
619
|
uiOptions.title || title,
|
|
569
620
|
" ",
|
|
570
621
|
required ? "*" : ""
|
|
571
622
|
] });
|
|
623
|
+
if (optionalDataControl) {
|
|
624
|
+
heading = /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { style: { display: "flex" }, children: [
|
|
625
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { style: { flexGrow: 1 }, children: heading }),
|
|
626
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { children: optionalDataControl })
|
|
627
|
+
] });
|
|
628
|
+
}
|
|
629
|
+
return heading;
|
|
572
630
|
}
|
|
573
631
|
|
|
574
632
|
// src/GridTemplate/GridTemplate.tsx
|
|
575
633
|
var import_react = require("react");
|
|
576
|
-
var
|
|
634
|
+
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
577
635
|
var breakpoints = {
|
|
578
636
|
xs: 0,
|
|
579
637
|
sm: 576,
|
|
@@ -610,7 +668,7 @@ function GridTemplateRow(props) {
|
|
|
610
668
|
const layoutGrid = uiSchema?.["ui:layoutGrid"] ?? {};
|
|
611
669
|
const totalColumns = layoutGrid.columns ?? 12;
|
|
612
670
|
const gap = layoutGrid.gap ?? "16px";
|
|
613
|
-
return /* @__PURE__ */ (0,
|
|
671
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
614
672
|
"div",
|
|
615
673
|
{
|
|
616
674
|
style: {
|
|
@@ -637,7 +695,7 @@ function GridTemplateColumn(props) {
|
|
|
637
695
|
return () => window.removeEventListener("resize", handleResize);
|
|
638
696
|
}, []);
|
|
639
697
|
const span = getResponsiveSpan(props, breakpoint);
|
|
640
|
-
return /* @__PURE__ */ (0,
|
|
698
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { style: { gridColumn: `span ${span} / span ${span}`, ...style ?? {} }, ...rest, children });
|
|
641
699
|
}
|
|
642
700
|
|
|
643
701
|
// src/Templates/Templates.ts
|
|
@@ -662,6 +720,7 @@ function generateTemplates() {
|
|
|
662
720
|
FieldTemplate,
|
|
663
721
|
MultiSchemaFieldTemplate,
|
|
664
722
|
ObjectFieldTemplate,
|
|
723
|
+
OptionalDataControlsTemplate,
|
|
665
724
|
TitleFieldTemplate: TitleField,
|
|
666
725
|
WrapIfAdditionalTemplate,
|
|
667
726
|
GridTemplate
|
|
@@ -673,7 +732,7 @@ var Templates_default = generateTemplates();
|
|
|
673
732
|
var import_react2 = require("react");
|
|
674
733
|
var import_utils15 = require("@rjsf/utils");
|
|
675
734
|
var import_autocomplete = require("primereact/autocomplete");
|
|
676
|
-
var
|
|
735
|
+
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
677
736
|
function AutoCompleteWidget(props) {
|
|
678
737
|
const {
|
|
679
738
|
id,
|
|
@@ -704,7 +763,7 @@ function AutoCompleteWidget(props) {
|
|
|
704
763
|
const search = (event) => {
|
|
705
764
|
setItems(examples.filter((example) => example.toString().toLowerCase().includes(event.query.toLowerCase())));
|
|
706
765
|
};
|
|
707
|
-
return /* @__PURE__ */ (0,
|
|
766
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
708
767
|
import_autocomplete.AutoComplete,
|
|
709
768
|
{
|
|
710
769
|
id,
|
|
@@ -712,7 +771,7 @@ function AutoCompleteWidget(props) {
|
|
|
712
771
|
placeholder,
|
|
713
772
|
...primeProps,
|
|
714
773
|
...inputProps,
|
|
715
|
-
loadingIcon: /* @__PURE__ */ (0,
|
|
774
|
+
loadingIcon: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_jsx_runtime20.Fragment, {}),
|
|
716
775
|
required,
|
|
717
776
|
autoFocus: autofocus,
|
|
718
777
|
disabled: disabled || readonly,
|
|
@@ -747,7 +806,7 @@ function AutoCompleteWidget(props) {
|
|
|
747
806
|
// src/CheckboxWidget/CheckboxWidget.tsx
|
|
748
807
|
var import_utils16 = require("@rjsf/utils");
|
|
749
808
|
var import_checkbox = require("primereact/checkbox");
|
|
750
|
-
var
|
|
809
|
+
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
751
810
|
function CheckboxWidget(props) {
|
|
752
811
|
const {
|
|
753
812
|
id,
|
|
@@ -777,8 +836,8 @@ function CheckboxWidget(props) {
|
|
|
777
836
|
const _onFocus = () => onFocus && onFocus(id, value);
|
|
778
837
|
const description = options.description ?? schema.description;
|
|
779
838
|
const primeProps = options.prime || {};
|
|
780
|
-
return /* @__PURE__ */ (0,
|
|
781
|
-
!hideLabel && !!description && /* @__PURE__ */ (0,
|
|
839
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(import_jsx_runtime21.Fragment, { children: [
|
|
840
|
+
!hideLabel && !!description && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
782
841
|
DescriptionFieldTemplate,
|
|
783
842
|
{
|
|
784
843
|
id: (0, import_utils16.descriptionId)(id),
|
|
@@ -788,8 +847,8 @@ function CheckboxWidget(props) {
|
|
|
788
847
|
registry
|
|
789
848
|
}
|
|
790
849
|
),
|
|
791
|
-
/* @__PURE__ */ (0,
|
|
792
|
-
/* @__PURE__ */ (0,
|
|
850
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { style: { display: "flex", flexDirection: "row", gap: "0.5rem", alignItems: "center" }, children: [
|
|
851
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
793
852
|
import_checkbox.Checkbox,
|
|
794
853
|
{
|
|
795
854
|
inputId: id,
|
|
@@ -805,7 +864,7 @@ function CheckboxWidget(props) {
|
|
|
805
864
|
"aria-describedby": (0, import_utils16.ariaDescribedByIds)(id)
|
|
806
865
|
}
|
|
807
866
|
),
|
|
808
|
-
(0, import_utils16.labelValue)(/* @__PURE__ */ (0,
|
|
867
|
+
(0, import_utils16.labelValue)(/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Label, { id, text: label }), hideLabel, false)
|
|
809
868
|
] })
|
|
810
869
|
] });
|
|
811
870
|
}
|
|
@@ -813,7 +872,7 @@ function CheckboxWidget(props) {
|
|
|
813
872
|
// src/CheckboxesWidget/CheckboxesWidget.tsx
|
|
814
873
|
var import_checkbox2 = require("primereact/checkbox");
|
|
815
874
|
var import_utils17 = require("@rjsf/utils");
|
|
816
|
-
var
|
|
875
|
+
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
817
876
|
function CheckboxesWidget(props) {
|
|
818
877
|
const {
|
|
819
878
|
id,
|
|
@@ -848,13 +907,13 @@ function CheckboxesWidget(props) {
|
|
|
848
907
|
const _onBlur = () => onBlur(id, value);
|
|
849
908
|
const _onFocus = () => onFocus(id, value);
|
|
850
909
|
const description = options.description ?? schema.description;
|
|
851
|
-
return /* @__PURE__ */ (0,
|
|
910
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
|
|
852
911
|
"div",
|
|
853
912
|
{
|
|
854
913
|
id,
|
|
855
914
|
style: { display: "flex", flexDirection: "column", gap: "1rem", marginTop: "0.5rem", marginBottom: "0.5rem" },
|
|
856
915
|
children: [
|
|
857
|
-
!hideLabel && !!description && /* @__PURE__ */ (0,
|
|
916
|
+
!hideLabel && !!description && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
858
917
|
DescriptionFieldTemplate,
|
|
859
918
|
{
|
|
860
919
|
id: (0, import_utils17.descriptionId)(id),
|
|
@@ -867,8 +926,8 @@ function CheckboxesWidget(props) {
|
|
|
867
926
|
Array.isArray(enumOptions) && enumOptions.map((option, index) => {
|
|
868
927
|
const checked = (0, import_utils17.enumOptionsIsSelected)(option.value, checkboxesValues);
|
|
869
928
|
const itemDisabled = Array.isArray(enumDisabled) && enumDisabled.indexOf(option.value) !== -1;
|
|
870
|
-
return /* @__PURE__ */ (0,
|
|
871
|
-
/* @__PURE__ */ (0,
|
|
929
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { style: { display: "flex", flexDirection: "row", gap: "0.5rem", alignItems: "center" }, children: [
|
|
930
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
872
931
|
import_checkbox2.Checkbox,
|
|
873
932
|
{
|
|
874
933
|
inputId: (0, import_utils17.optionId)(id, index),
|
|
@@ -884,7 +943,7 @@ function CheckboxesWidget(props) {
|
|
|
884
943
|
"aria-describedby": (0, import_utils17.ariaDescribedByIds)(id)
|
|
885
944
|
}
|
|
886
945
|
),
|
|
887
|
-
/* @__PURE__ */ (0,
|
|
946
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(Label, { id: (0, import_utils17.optionId)(id, index), text: option.label })
|
|
888
947
|
] }, index);
|
|
889
948
|
})
|
|
890
949
|
]
|
|
@@ -895,7 +954,7 @@ function CheckboxesWidget(props) {
|
|
|
895
954
|
// src/ColorWidget/ColorWidget.tsx
|
|
896
955
|
var import_utils18 = require("@rjsf/utils");
|
|
897
956
|
var import_colorpicker = require("primereact/colorpicker");
|
|
898
|
-
var
|
|
957
|
+
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
899
958
|
function ColorWidget(props) {
|
|
900
959
|
const {
|
|
901
960
|
id,
|
|
@@ -919,7 +978,7 @@ function ColorWidget(props) {
|
|
|
919
978
|
const _onChange = ({ target: { value: value2 } }) => onChange(value2 === "" ? options.emptyValue : value2);
|
|
920
979
|
const _onBlur = () => onBlur && onBlur(id, value);
|
|
921
980
|
const _onFocus = () => onFocus && onFocus(id, value);
|
|
922
|
-
return /* @__PURE__ */ (0,
|
|
981
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
923
982
|
import_colorpicker.ColorPicker,
|
|
924
983
|
{
|
|
925
984
|
id,
|
|
@@ -943,7 +1002,7 @@ function ColorWidget(props) {
|
|
|
943
1002
|
// src/PasswordWidget/PasswordWidget.tsx
|
|
944
1003
|
var import_utils19 = require("@rjsf/utils");
|
|
945
1004
|
var import_password = require("primereact/password");
|
|
946
|
-
var
|
|
1005
|
+
var import_jsx_runtime24 = require("react/jsx-runtime");
|
|
947
1006
|
function PasswordWidget(props) {
|
|
948
1007
|
const {
|
|
949
1008
|
id,
|
|
@@ -967,7 +1026,7 @@ function PasswordWidget(props) {
|
|
|
967
1026
|
const _onChange = ({ target: { value: value2 } }) => onChange(value2 === "" ? options.emptyValue : value2);
|
|
968
1027
|
const _onBlur = () => onBlur && onBlur(id, value);
|
|
969
1028
|
const _onFocus = () => onFocus && onFocus(id, value);
|
|
970
|
-
return /* @__PURE__ */ (0,
|
|
1029
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
971
1030
|
import_password.Password,
|
|
972
1031
|
{
|
|
973
1032
|
id,
|
|
@@ -992,7 +1051,7 @@ function PasswordWidget(props) {
|
|
|
992
1051
|
// src/RadioWidget/RadioWidget.tsx
|
|
993
1052
|
var import_utils20 = require("@rjsf/utils");
|
|
994
1053
|
var import_radiobutton = require("primereact/radiobutton");
|
|
995
|
-
var
|
|
1054
|
+
var import_jsx_runtime25 = require("react/jsx-runtime");
|
|
996
1055
|
function RadioWidget(props) {
|
|
997
1056
|
const { id, value, disabled, readonly, onChange, onBlur, onFocus, options } = props;
|
|
998
1057
|
const primeProps = options.prime || {};
|
|
@@ -1002,11 +1061,11 @@ function RadioWidget(props) {
|
|
|
1002
1061
|
};
|
|
1003
1062
|
const _onBlur = () => onBlur(id, value);
|
|
1004
1063
|
const _onFocus = () => onFocus(id, value);
|
|
1005
|
-
return /* @__PURE__ */ (0,
|
|
1064
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { style: { display: "flex", flexDirection: "row", gap: "1rem" }, children: Array.isArray(enumOptions) && enumOptions.map((option, index) => {
|
|
1006
1065
|
const checked = (0, import_utils20.enumOptionsIsSelected)(option.value, value);
|
|
1007
1066
|
const itemDisabled = Array.isArray(enumDisabled) && enumDisabled.indexOf(option.value) !== -1;
|
|
1008
|
-
return /* @__PURE__ */ (0,
|
|
1009
|
-
/* @__PURE__ */ (0,
|
|
1067
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { style: { display: "flex", alignItems: "center" }, children: [
|
|
1068
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
1010
1069
|
import_radiobutton.RadioButton,
|
|
1011
1070
|
{
|
|
1012
1071
|
inputId: (0, import_utils20.optionId)(id, index),
|
|
@@ -1021,7 +1080,7 @@ function RadioWidget(props) {
|
|
|
1021
1080
|
"aria-describedby": (0, import_utils20.ariaDescribedByIds)(id)
|
|
1022
1081
|
}
|
|
1023
1082
|
),
|
|
1024
|
-
/* @__PURE__ */ (0,
|
|
1083
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("label", { htmlFor: (0, import_utils20.optionId)(id, index), style: { marginLeft: "8px" }, children: option.label })
|
|
1025
1084
|
] }, index);
|
|
1026
1085
|
}) });
|
|
1027
1086
|
}
|
|
@@ -1029,7 +1088,7 @@ function RadioWidget(props) {
|
|
|
1029
1088
|
// src/RangeWidget/RangeWidget.tsx
|
|
1030
1089
|
var import_slider = require("primereact/slider");
|
|
1031
1090
|
var import_utils21 = require("@rjsf/utils");
|
|
1032
|
-
var
|
|
1091
|
+
var import_jsx_runtime26 = require("react/jsx-runtime");
|
|
1033
1092
|
function RangeWidget(props) {
|
|
1034
1093
|
const { value, readonly, disabled, onBlur, onFocus, options, schema, onChange, id } = props;
|
|
1035
1094
|
const primeProps = options.prime || {};
|
|
@@ -1039,7 +1098,7 @@ function RangeWidget(props) {
|
|
|
1039
1098
|
};
|
|
1040
1099
|
const _onBlur = ({ target }) => onBlur(id, target && target.value);
|
|
1041
1100
|
const _onFocus = ({ target }) => onFocus(id, target && target.value);
|
|
1042
|
-
return /* @__PURE__ */ (0,
|
|
1101
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_jsx_runtime26.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
1043
1102
|
import_slider.Slider,
|
|
1044
1103
|
{
|
|
1045
1104
|
...primeProps,
|
|
@@ -1058,10 +1117,10 @@ function RangeWidget(props) {
|
|
|
1058
1117
|
var import_dropdown = require("primereact/dropdown");
|
|
1059
1118
|
var import_utils22 = require("@rjsf/utils");
|
|
1060
1119
|
var import_multiselect = require("primereact/multiselect");
|
|
1061
|
-
var
|
|
1120
|
+
var import_jsx_runtime27 = require("react/jsx-runtime");
|
|
1062
1121
|
function SelectWidget(props) {
|
|
1063
1122
|
const { multiple = false } = props;
|
|
1064
|
-
return multiple ? /* @__PURE__ */ (0,
|
|
1123
|
+
return multiple ? /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(MultiSelectWidget, { ...props }) : /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(SingleSelectWidget, { ...props });
|
|
1065
1124
|
}
|
|
1066
1125
|
function SingleSelectWidget({
|
|
1067
1126
|
schema,
|
|
@@ -1099,7 +1158,7 @@ function SingleSelectWidget({
|
|
|
1099
1158
|
const _onFocus = ({ target }) => onFocus(id, (0, import_utils22.enumOptionsValueForIndex)(target && target.value, enumOptions, optEmptyVal));
|
|
1100
1159
|
const selectedIndexes = (0, import_utils22.enumOptionsIndexForValue)(value, enumOptions, multiple);
|
|
1101
1160
|
const { ...dropdownRemainingProps } = dropdownProps;
|
|
1102
|
-
return /* @__PURE__ */ (0,
|
|
1161
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
1103
1162
|
import_dropdown.Dropdown,
|
|
1104
1163
|
{
|
|
1105
1164
|
id,
|
|
@@ -1143,7 +1202,7 @@ function MultiSelectWidget({
|
|
|
1143
1202
|
const _onBlur = ({ target }) => onBlur(id, (0, import_utils22.enumOptionsValueForIndex)(target && target.value, enumOptions, optEmptyVal));
|
|
1144
1203
|
const _onFocus = ({ target }) => onFocus(id, (0, import_utils22.enumOptionsValueForIndex)(target && target.value, enumOptions, optEmptyVal));
|
|
1145
1204
|
const selectedIndexes = (0, import_utils22.enumOptionsIndexForValue)(value, enumOptions, multiple);
|
|
1146
|
-
return /* @__PURE__ */ (0,
|
|
1205
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
1147
1206
|
import_multiselect.MultiSelect,
|
|
1148
1207
|
{
|
|
1149
1208
|
id,
|
|
@@ -1170,7 +1229,7 @@ function MultiSelectWidget({
|
|
|
1170
1229
|
|
|
1171
1230
|
// src/TextareaWidget/TextareaWidget.tsx
|
|
1172
1231
|
var import_inputtextarea = require("primereact/inputtextarea");
|
|
1173
|
-
var
|
|
1232
|
+
var import_jsx_runtime28 = require("react/jsx-runtime");
|
|
1174
1233
|
function TextareaWidget(props) {
|
|
1175
1234
|
const { id, value, required, disabled, readonly, autofocus, onChange, onBlur, onFocus, options } = props;
|
|
1176
1235
|
const primeProps = options.prime || {};
|
|
@@ -1181,7 +1240,7 @@ function TextareaWidget(props) {
|
|
|
1181
1240
|
const handleChange = (event) => {
|
|
1182
1241
|
onChange(event.target.value === "" ? options.emptyValue : event.target.value);
|
|
1183
1242
|
};
|
|
1184
|
-
return /* @__PURE__ */ (0,
|
|
1243
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
1185
1244
|
import_inputtextarea.InputTextarea,
|
|
1186
1245
|
{
|
|
1187
1246
|
id,
|
|
@@ -1201,7 +1260,7 @@ function TextareaWidget(props) {
|
|
|
1201
1260
|
// src/UpDownWidget/UpDownWidget.tsx
|
|
1202
1261
|
var import_utils23 = require("@rjsf/utils");
|
|
1203
1262
|
var import_inputnumber = require("primereact/inputnumber");
|
|
1204
|
-
var
|
|
1263
|
+
var import_jsx_runtime29 = require("react/jsx-runtime");
|
|
1205
1264
|
function UpDownWidget(props) {
|
|
1206
1265
|
const {
|
|
1207
1266
|
id,
|
|
@@ -1226,7 +1285,7 @@ function UpDownWidget(props) {
|
|
|
1226
1285
|
const _onChange = (event) => onChange(event.value === null ? options.emptyValue : value);
|
|
1227
1286
|
const _onBlur = () => onBlur && onBlur(id, value);
|
|
1228
1287
|
const _onFocus = () => onFocus && onFocus(id, value);
|
|
1229
|
-
return /* @__PURE__ */ (0,
|
|
1288
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
1230
1289
|
import_inputnumber.InputNumber,
|
|
1231
1290
|
{
|
|
1232
1291
|
id,
|