@rjsf/primereact 6.0.0-beta.20 → 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/index.cjs +141 -91
- package/dist/index.cjs.map +4 -4
- package/dist/primereact.esm.js +133 -84
- package/dist/primereact.esm.js.map +4 -4
- package/dist/primereact.umd.js +87 -40
- package/lib/ArrayFieldItemTemplate/ArrayFieldItemTemplate.d.ts +3 -3
- package/lib/ArrayFieldItemTemplate/ArrayFieldItemTemplate.js +1 -1
- package/lib/ArrayFieldItemTemplate/ArrayFieldItemTemplate.js.map +1 -1
- package/lib/ArrayFieldTemplate/ArrayFieldTemplate.d.ts +1 -1
- package/lib/ArrayFieldTemplate/ArrayFieldTemplate.js +5 -14
- 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/BaseInputTemplate/BaseInputTemplate.js +2 -2
- package/lib/BaseInputTemplate/BaseInputTemplate.js.map +1 -1
- package/lib/CheckboxWidget/CheckboxWidget.js +2 -2
- package/lib/CheckboxWidget/CheckboxWidget.js.map +1 -1
- package/lib/CheckboxesWidget/CheckboxesWidget.js +2 -2
- package/lib/CheckboxesWidget/CheckboxesWidget.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/RadioWidget/RadioWidget.js +2 -2
- package/lib/RadioWidget/RadioWidget.js.map +1 -1
- package/lib/SelectWidget/SelectWidget.js +5 -5
- package/lib/SelectWidget/SelectWidget.js.map +1 -1
- package/lib/Templates/Templates.js +2 -0
- package/lib/Templates/Templates.js.map +1 -1
- package/lib/TextareaWidget/TextareaWidget.js +2 -2
- package/lib/TextareaWidget/TextareaWidget.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/WrapIfAdditionalTemplate/WrapIfAdditionalTemplate.d.ts +1 -1
- package/lib/WrapIfAdditionalTemplate/WrapIfAdditionalTemplate.js +2 -3
- package/lib/WrapIfAdditionalTemplate/WrapIfAdditionalTemplate.js.map +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/package.json +7 -7
- package/src/ArrayFieldItemTemplate/ArrayFieldItemTemplate.tsx +3 -3
- package/src/ArrayFieldTemplate/ArrayFieldTemplate.tsx +6 -18
- package/src/ArrayFieldTitleTemplate/ArrayFieldTitleTemplate.tsx +11 -2
- package/src/BaseInputTemplate/BaseInputTemplate.tsx +2 -1
- package/src/CheckboxWidget/CheckboxWidget.tsx +2 -1
- package/src/CheckboxesWidget/CheckboxesWidget.tsx +2 -1
- package/src/IconButton/IconButton.tsx +13 -9
- package/src/ObjectFieldTemplate/ObjectFieldTemplate.tsx +6 -2
- package/src/OptionalDataControlsTemplate/OptionalDataControlsTemplate.tsx +44 -0
- package/src/OptionalDataControlsTemplate/index.ts +2 -0
- package/src/RadioWidget/RadioWidget.tsx +2 -2
- package/src/SelectWidget/SelectWidget.tsx +4 -3
- package/src/Templates/Templates.ts +2 -0
- package/src/TextareaWidget/TextareaWidget.tsx +2 -1
- package/src/TitleField/TitleField.tsx +15 -3
- package/src/WrapIfAdditionalTemplate/WrapIfAdditionalTemplate.tsx +4 -7
package/dist/primereact.esm.js
CHANGED
|
@@ -50,7 +50,6 @@ import {
|
|
|
50
50
|
getTemplate as getTemplate2,
|
|
51
51
|
getUiOptions as getUiOptions2,
|
|
52
52
|
isFixedItems,
|
|
53
|
-
UI_OPTIONS_KEY,
|
|
54
53
|
buttonId
|
|
55
54
|
} from "@rjsf/utils";
|
|
56
55
|
import { Fieldset } from "primereact/fieldset";
|
|
@@ -63,6 +62,7 @@ function ArrayFieldTemplate(props) {
|
|
|
63
62
|
className,
|
|
64
63
|
disabled,
|
|
65
64
|
items,
|
|
65
|
+
optionalDataControl,
|
|
66
66
|
onAddClick,
|
|
67
67
|
readonly,
|
|
68
68
|
schema,
|
|
@@ -77,16 +77,12 @@ function ArrayFieldTemplate(props) {
|
|
|
77
77
|
registry,
|
|
78
78
|
uiOptions
|
|
79
79
|
);
|
|
80
|
-
const ArrayFieldItemTemplate2 = getTemplate2(
|
|
81
|
-
"ArrayFieldItemTemplate",
|
|
82
|
-
registry,
|
|
83
|
-
uiOptions
|
|
84
|
-
);
|
|
85
80
|
const ArrayFieldTitleTemplate2 = getTemplate2(
|
|
86
81
|
"ArrayFieldTitleTemplate",
|
|
87
82
|
registry,
|
|
88
83
|
uiOptions
|
|
89
84
|
);
|
|
85
|
+
const showOptionalDataControlInTitle = !readonly && !disabled;
|
|
90
86
|
return /* @__PURE__ */ jsxs2(Fragment, { children: [
|
|
91
87
|
/* @__PURE__ */ jsx3(
|
|
92
88
|
ArrayFieldTitleTemplate2,
|
|
@@ -96,7 +92,8 @@ function ArrayFieldTemplate(props) {
|
|
|
96
92
|
schema,
|
|
97
93
|
uiSchema,
|
|
98
94
|
required,
|
|
99
|
-
registry
|
|
95
|
+
registry,
|
|
96
|
+
optionalDataControl: showOptionalDataControlInTitle ? optionalDataControl : void 0
|
|
100
97
|
}
|
|
101
98
|
),
|
|
102
99
|
/* @__PURE__ */ jsxs2(
|
|
@@ -117,15 +114,10 @@ function ArrayFieldTemplate(props) {
|
|
|
117
114
|
}
|
|
118
115
|
),
|
|
119
116
|
/* @__PURE__ */ jsxs2("div", { children: [
|
|
120
|
-
/* @__PURE__ */
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
...itemUiSchema[UI_OPTIONS_KEY]
|
|
125
|
-
}
|
|
126
|
-
};
|
|
127
|
-
return /* @__PURE__ */ jsx3(ArrayFieldItemTemplate2, { ...props2, uiSchema: mergedUiSchema }, key);
|
|
128
|
-
}) }),
|
|
117
|
+
/* @__PURE__ */ jsxs2("div", { children: [
|
|
118
|
+
!showOptionalDataControlInTitle ? optionalDataControl : void 0,
|
|
119
|
+
items
|
|
120
|
+
] }),
|
|
129
121
|
canAdd && /* @__PURE__ */ jsx3(
|
|
130
122
|
"div",
|
|
131
123
|
{
|
|
@@ -165,6 +157,7 @@ import { jsx as jsx4 } from "react/jsx-runtime";
|
|
|
165
157
|
function BaseInputTemplate(props) {
|
|
166
158
|
const {
|
|
167
159
|
id,
|
|
160
|
+
htmlName,
|
|
168
161
|
placeholder,
|
|
169
162
|
value,
|
|
170
163
|
required,
|
|
@@ -194,7 +187,7 @@ function BaseInputTemplate(props) {
|
|
|
194
187
|
InputText,
|
|
195
188
|
{
|
|
196
189
|
id,
|
|
197
|
-
name: id,
|
|
190
|
+
name: htmlName || id,
|
|
198
191
|
placeholder,
|
|
199
192
|
...primeProps,
|
|
200
193
|
...inputProps,
|
|
@@ -392,7 +385,8 @@ import { Fragment as Fragment2, jsx as jsx12, jsxs as jsxs7 } from "react/jsx-ru
|
|
|
392
385
|
function ObjectFieldTemplate(props) {
|
|
393
386
|
const {
|
|
394
387
|
description,
|
|
395
|
-
|
|
388
|
+
optionalDataControl,
|
|
389
|
+
onAddProperty,
|
|
396
390
|
title,
|
|
397
391
|
properties,
|
|
398
392
|
disabled,
|
|
@@ -411,6 +405,7 @@ function ObjectFieldTemplate(props) {
|
|
|
411
405
|
registry,
|
|
412
406
|
uiOptions
|
|
413
407
|
);
|
|
408
|
+
const showOptionalDataControlInTitle = !readonly && !disabled;
|
|
414
409
|
const {
|
|
415
410
|
ButtonTemplates: { AddButton: AddButton2 }
|
|
416
411
|
} = registry.templates;
|
|
@@ -423,7 +418,8 @@ function ObjectFieldTemplate(props) {
|
|
|
423
418
|
required,
|
|
424
419
|
schema,
|
|
425
420
|
uiSchema,
|
|
426
|
-
registry
|
|
421
|
+
registry,
|
|
422
|
+
optionalDataControl: showOptionalDataControlInTitle ? optionalDataControl : void 0
|
|
427
423
|
}
|
|
428
424
|
),
|
|
429
425
|
description && /* @__PURE__ */ jsx12("div", { style: { marginBottom: "1rem" }, children: /* @__PURE__ */ jsx12(
|
|
@@ -436,6 +432,7 @@ function ObjectFieldTemplate(props) {
|
|
|
436
432
|
registry
|
|
437
433
|
}
|
|
438
434
|
) }),
|
|
435
|
+
!showOptionalDataControlInTitle ? optionalDataControl : void 0,
|
|
439
436
|
properties.map((prop) => prop.content),
|
|
440
437
|
canExpand(schema, uiSchema, formData) && /* @__PURE__ */ jsx12("div", { style: { marginTop: "1rem", textAlign: "right" }, children: /* @__PURE__ */ jsx12(
|
|
441
438
|
AddButton2,
|
|
@@ -443,7 +440,7 @@ function ObjectFieldTemplate(props) {
|
|
|
443
440
|
id: buttonId2(fieldPathId, "add"),
|
|
444
441
|
className: "rjsf-object-property-expand",
|
|
445
442
|
icon: "pi pi-plus",
|
|
446
|
-
onClick:
|
|
443
|
+
onClick: onAddProperty,
|
|
447
444
|
disabled: disabled || readonly,
|
|
448
445
|
registry
|
|
449
446
|
}
|
|
@@ -451,36 +448,77 @@ function ObjectFieldTemplate(props) {
|
|
|
451
448
|
] });
|
|
452
449
|
}
|
|
453
450
|
|
|
451
|
+
// src/OptionalDataControlsTemplate/OptionalDataControlsTemplate.tsx
|
|
452
|
+
import { jsx as jsx13 } from "react/jsx-runtime";
|
|
453
|
+
function OptionalDataControlsTemplate(props) {
|
|
454
|
+
const { id, registry, label, onAddClick, onRemoveClick } = props;
|
|
455
|
+
if (onAddClick) {
|
|
456
|
+
return /* @__PURE__ */ jsx13(
|
|
457
|
+
IconButton,
|
|
458
|
+
{
|
|
459
|
+
id,
|
|
460
|
+
registry,
|
|
461
|
+
className: "rjsf-add-optional-data",
|
|
462
|
+
onClick: onAddClick,
|
|
463
|
+
title: label,
|
|
464
|
+
icon: "pi pi-plus",
|
|
465
|
+
style: { height: "1.5rem", width: "1.5rem" }
|
|
466
|
+
}
|
|
467
|
+
);
|
|
468
|
+
} else if (onRemoveClick) {
|
|
469
|
+
return /* @__PURE__ */ jsx13(
|
|
470
|
+
RemoveButton,
|
|
471
|
+
{
|
|
472
|
+
id,
|
|
473
|
+
registry,
|
|
474
|
+
className: "rjsf-remove-optional-data",
|
|
475
|
+
onClick: onRemoveClick,
|
|
476
|
+
title: label,
|
|
477
|
+
style: { height: "1.5rem", width: "1.5rem" }
|
|
478
|
+
}
|
|
479
|
+
);
|
|
480
|
+
}
|
|
481
|
+
return /* @__PURE__ */ jsx13("em", { id, children: label });
|
|
482
|
+
}
|
|
483
|
+
|
|
454
484
|
// src/SubmitButton/SubmitButton.tsx
|
|
455
485
|
import { Button as Button3 } from "primereact/button";
|
|
456
486
|
import { getSubmitButtonOptions } from "@rjsf/utils";
|
|
457
|
-
import { jsx as
|
|
487
|
+
import { jsx as jsx14 } from "react/jsx-runtime";
|
|
458
488
|
function SubmitButton({ uiSchema }) {
|
|
459
489
|
const { submitText, norender, props: submitButtonProps = {} } = getSubmitButtonOptions(uiSchema);
|
|
460
490
|
if (norender) {
|
|
461
491
|
return null;
|
|
462
492
|
}
|
|
463
|
-
return /* @__PURE__ */
|
|
493
|
+
return /* @__PURE__ */ jsx14(Button3, { type: "submit", label: submitText, ...submitButtonProps });
|
|
464
494
|
}
|
|
465
495
|
|
|
466
496
|
// src/TitleField/TitleField.tsx
|
|
467
497
|
import { Divider } from "primereact/divider";
|
|
468
498
|
import { getUiOptions as getUiOptions5, titleId as titleId2 } from "@rjsf/utils";
|
|
469
|
-
import { jsx as
|
|
499
|
+
import { jsx as jsx15, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
470
500
|
function TitleField({
|
|
471
501
|
id,
|
|
472
502
|
title,
|
|
473
503
|
uiSchema,
|
|
474
|
-
required
|
|
504
|
+
required,
|
|
505
|
+
optionalDataControl
|
|
475
506
|
}) {
|
|
476
507
|
const uiOptions = getUiOptions5(uiSchema);
|
|
508
|
+
let heading = /* @__PURE__ */ jsxs8("h5", { style: { margin: 0, fontSize: id === titleId2("root") ? "1.5rem" : "1.2rem" }, children: [
|
|
509
|
+
uiOptions.title || title,
|
|
510
|
+
" ",
|
|
511
|
+
required ? "*" : ""
|
|
512
|
+
] });
|
|
513
|
+
if (optionalDataControl) {
|
|
514
|
+
heading = /* @__PURE__ */ jsxs8("div", { style: { display: "flex" }, children: [
|
|
515
|
+
/* @__PURE__ */ jsx15("div", { style: { flexGrow: 1 }, children: heading }),
|
|
516
|
+
/* @__PURE__ */ jsx15("div", { style: { marginLeft: "-5px" }, children: optionalDataControl })
|
|
517
|
+
] });
|
|
518
|
+
}
|
|
477
519
|
return /* @__PURE__ */ jsxs8("div", { id, children: [
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
" ",
|
|
481
|
-
required ? "*" : ""
|
|
482
|
-
] }),
|
|
483
|
-
/* @__PURE__ */ jsx14(Divider, { pt: { root: { style: { marginTop: "0.5rem" } } } })
|
|
520
|
+
heading,
|
|
521
|
+
/* @__PURE__ */ jsx15(Divider, { pt: { root: { style: { marginTop: "0.5rem" } } } })
|
|
484
522
|
] });
|
|
485
523
|
}
|
|
486
524
|
|
|
@@ -491,7 +529,7 @@ import {
|
|
|
491
529
|
TranslatableString as TranslatableString4
|
|
492
530
|
} from "@rjsf/utils";
|
|
493
531
|
import { InputText as InputText2 } from "primereact/inputtext";
|
|
494
|
-
import { jsx as
|
|
532
|
+
import { jsx as jsx16, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
495
533
|
function WrapIfAdditionalTemplate({
|
|
496
534
|
classNames,
|
|
497
535
|
style,
|
|
@@ -499,8 +537,8 @@ function WrapIfAdditionalTemplate({
|
|
|
499
537
|
disabled,
|
|
500
538
|
id,
|
|
501
539
|
label,
|
|
502
|
-
|
|
503
|
-
|
|
540
|
+
onRemoveProperty,
|
|
541
|
+
onKeyRenameBlur,
|
|
504
542
|
readonly,
|
|
505
543
|
required,
|
|
506
544
|
schema,
|
|
@@ -511,9 +549,8 @@ function WrapIfAdditionalTemplate({
|
|
|
511
549
|
const keyLabel = translateString(TranslatableString4.KeyLabel, [label]);
|
|
512
550
|
const additional = ADDITIONAL_PROPERTY_FLAG in schema;
|
|
513
551
|
if (!additional) {
|
|
514
|
-
return /* @__PURE__ */
|
|
552
|
+
return /* @__PURE__ */ jsx16("div", { className: classNames, style, children });
|
|
515
553
|
}
|
|
516
|
-
const handleBlur = ({ target }) => onKeyChange(target.value);
|
|
517
554
|
return /* @__PURE__ */ jsxs9(
|
|
518
555
|
"div",
|
|
519
556
|
{
|
|
@@ -521,28 +558,28 @@ function WrapIfAdditionalTemplate({
|
|
|
521
558
|
style: { ...style, display: "flex", alignItems: "center", gap: "1rem" },
|
|
522
559
|
children: [
|
|
523
560
|
/* @__PURE__ */ jsxs9("div", { style: { flex: 1 }, children: [
|
|
524
|
-
/* @__PURE__ */
|
|
525
|
-
/* @__PURE__ */
|
|
561
|
+
/* @__PURE__ */ jsx16("label", { htmlFor: `${id}-key`, style: { display: "block", marginBottom: "0.5rem" }, children: keyLabel }),
|
|
562
|
+
/* @__PURE__ */ jsx16(
|
|
526
563
|
InputText2,
|
|
527
564
|
{
|
|
528
565
|
id: `${id}-key`,
|
|
529
566
|
name: `${id}-key`,
|
|
530
567
|
defaultValue: label,
|
|
531
568
|
disabled: disabled || readonly,
|
|
532
|
-
onBlur: !readonly ?
|
|
569
|
+
onBlur: !readonly ? onKeyRenameBlur : void 0,
|
|
533
570
|
required,
|
|
534
571
|
style: { width: "100%" }
|
|
535
572
|
}
|
|
536
573
|
)
|
|
537
574
|
] }),
|
|
538
|
-
/* @__PURE__ */
|
|
539
|
-
/* @__PURE__ */
|
|
575
|
+
/* @__PURE__ */ jsx16("div", { style: { flex: 1 }, children }),
|
|
576
|
+
/* @__PURE__ */ jsx16("div", { children: /* @__PURE__ */ jsx16(
|
|
540
577
|
RemoveButton2,
|
|
541
578
|
{
|
|
542
579
|
id: buttonId3(id, "remove"),
|
|
543
580
|
className: "rjsf-object-property-remove",
|
|
544
581
|
disabled: disabled || readonly,
|
|
545
|
-
onClick:
|
|
582
|
+
onClick: onRemoveProperty,
|
|
546
583
|
registry
|
|
547
584
|
}
|
|
548
585
|
) })
|
|
@@ -557,19 +594,26 @@ import {
|
|
|
557
594
|
getUiOptions as getUiOptions6,
|
|
558
595
|
titleId as titleId3
|
|
559
596
|
} from "@rjsf/utils";
|
|
560
|
-
import { jsxs as jsxs10 } from "react/jsx-runtime";
|
|
561
|
-
function ArrayFieldTitleTemplate({ title, uiSchema, required, fieldPathId }) {
|
|
597
|
+
import { jsx as jsx17, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
598
|
+
function ArrayFieldTitleTemplate({ title, uiSchema, required, fieldPathId, optionalDataControl }) {
|
|
562
599
|
const uiOptions = getUiOptions6(uiSchema);
|
|
563
|
-
|
|
600
|
+
let heading = /* @__PURE__ */ jsxs10("h5", { id: titleId3(fieldPathId), style: { margin: 0, fontSize: "1.5rem", marginBottom: "0.2rem" }, children: [
|
|
564
601
|
uiOptions.title || title,
|
|
565
602
|
" ",
|
|
566
603
|
required ? "*" : ""
|
|
567
604
|
] });
|
|
605
|
+
if (optionalDataControl) {
|
|
606
|
+
heading = /* @__PURE__ */ jsxs10("div", { style: { display: "flex" }, children: [
|
|
607
|
+
/* @__PURE__ */ jsx17("div", { style: { flexGrow: 1 }, children: heading }),
|
|
608
|
+
/* @__PURE__ */ jsx17("div", { children: optionalDataControl })
|
|
609
|
+
] });
|
|
610
|
+
}
|
|
611
|
+
return heading;
|
|
568
612
|
}
|
|
569
613
|
|
|
570
614
|
// src/GridTemplate/GridTemplate.tsx
|
|
571
615
|
import { useEffect, useState } from "react";
|
|
572
|
-
import { jsx as
|
|
616
|
+
import { jsx as jsx18 } from "react/jsx-runtime";
|
|
573
617
|
var breakpoints = {
|
|
574
618
|
xs: 0,
|
|
575
619
|
sm: 576,
|
|
@@ -606,7 +650,7 @@ function GridTemplateRow(props) {
|
|
|
606
650
|
const layoutGrid = uiSchema?.["ui:layoutGrid"] ?? {};
|
|
607
651
|
const totalColumns = layoutGrid.columns ?? 12;
|
|
608
652
|
const gap = layoutGrid.gap ?? "16px";
|
|
609
|
-
return /* @__PURE__ */
|
|
653
|
+
return /* @__PURE__ */ jsx18(
|
|
610
654
|
"div",
|
|
611
655
|
{
|
|
612
656
|
style: {
|
|
@@ -633,7 +677,7 @@ function GridTemplateColumn(props) {
|
|
|
633
677
|
return () => window.removeEventListener("resize", handleResize);
|
|
634
678
|
}, []);
|
|
635
679
|
const span = getResponsiveSpan(props, breakpoint);
|
|
636
|
-
return /* @__PURE__ */
|
|
680
|
+
return /* @__PURE__ */ jsx18("div", { style: { gridColumn: `span ${span} / span ${span}`, ...style ?? {} }, ...rest, children });
|
|
637
681
|
}
|
|
638
682
|
|
|
639
683
|
// src/Templates/Templates.ts
|
|
@@ -658,6 +702,7 @@ function generateTemplates() {
|
|
|
658
702
|
FieldTemplate,
|
|
659
703
|
MultiSchemaFieldTemplate,
|
|
660
704
|
ObjectFieldTemplate,
|
|
705
|
+
OptionalDataControlsTemplate,
|
|
661
706
|
TitleFieldTemplate: TitleField,
|
|
662
707
|
WrapIfAdditionalTemplate,
|
|
663
708
|
GridTemplate
|
|
@@ -672,7 +717,7 @@ import {
|
|
|
672
717
|
getInputProps as getInputProps2
|
|
673
718
|
} from "@rjsf/utils";
|
|
674
719
|
import { AutoComplete } from "primereact/autocomplete";
|
|
675
|
-
import { Fragment as Fragment3, jsx as
|
|
720
|
+
import { Fragment as Fragment3, jsx as jsx19 } from "react/jsx-runtime";
|
|
676
721
|
function AutoCompleteWidget(props) {
|
|
677
722
|
const {
|
|
678
723
|
id,
|
|
@@ -703,7 +748,7 @@ function AutoCompleteWidget(props) {
|
|
|
703
748
|
const search = (event) => {
|
|
704
749
|
setItems(examples.filter((example) => example.toString().toLowerCase().includes(event.query.toLowerCase())));
|
|
705
750
|
};
|
|
706
|
-
return /* @__PURE__ */
|
|
751
|
+
return /* @__PURE__ */ jsx19(
|
|
707
752
|
AutoComplete,
|
|
708
753
|
{
|
|
709
754
|
id,
|
|
@@ -711,7 +756,7 @@ function AutoCompleteWidget(props) {
|
|
|
711
756
|
placeholder,
|
|
712
757
|
...primeProps,
|
|
713
758
|
...inputProps,
|
|
714
|
-
loadingIcon: /* @__PURE__ */
|
|
759
|
+
loadingIcon: /* @__PURE__ */ jsx19(Fragment3, {}),
|
|
715
760
|
required,
|
|
716
761
|
autoFocus: autofocus,
|
|
717
762
|
disabled: disabled || readonly,
|
|
@@ -752,10 +797,11 @@ import {
|
|
|
752
797
|
schemaRequiresTrueValue
|
|
753
798
|
} from "@rjsf/utils";
|
|
754
799
|
import { Checkbox } from "primereact/checkbox";
|
|
755
|
-
import { Fragment as Fragment4, jsx as
|
|
800
|
+
import { Fragment as Fragment4, jsx as jsx20, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
756
801
|
function CheckboxWidget(props) {
|
|
757
802
|
const {
|
|
758
803
|
id,
|
|
804
|
+
htmlName,
|
|
759
805
|
value,
|
|
760
806
|
disabled,
|
|
761
807
|
readonly,
|
|
@@ -783,7 +829,7 @@ function CheckboxWidget(props) {
|
|
|
783
829
|
const description = options.description ?? schema.description;
|
|
784
830
|
const primeProps = options.prime || {};
|
|
785
831
|
return /* @__PURE__ */ jsxs11(Fragment4, { children: [
|
|
786
|
-
!hideLabel && !!description && /* @__PURE__ */
|
|
832
|
+
!hideLabel && !!description && /* @__PURE__ */ jsx20(
|
|
787
833
|
DescriptionFieldTemplate,
|
|
788
834
|
{
|
|
789
835
|
id: descriptionId2(id),
|
|
@@ -794,11 +840,11 @@ function CheckboxWidget(props) {
|
|
|
794
840
|
}
|
|
795
841
|
),
|
|
796
842
|
/* @__PURE__ */ jsxs11("div", { style: { display: "flex", flexDirection: "row", gap: "0.5rem", alignItems: "center" }, children: [
|
|
797
|
-
/* @__PURE__ */
|
|
843
|
+
/* @__PURE__ */ jsx20(
|
|
798
844
|
Checkbox,
|
|
799
845
|
{
|
|
800
846
|
inputId: id,
|
|
801
|
-
name: id,
|
|
847
|
+
name: htmlName || id,
|
|
802
848
|
...primeProps,
|
|
803
849
|
disabled: disabled || readonly,
|
|
804
850
|
autoFocus: autofocus,
|
|
@@ -810,7 +856,7 @@ function CheckboxWidget(props) {
|
|
|
810
856
|
"aria-describedby": ariaDescribedByIds3(id)
|
|
811
857
|
}
|
|
812
858
|
),
|
|
813
|
-
labelValue(/* @__PURE__ */
|
|
859
|
+
labelValue(/* @__PURE__ */ jsx20(Label, { id, text: label }), hideLabel, false)
|
|
814
860
|
] })
|
|
815
861
|
] });
|
|
816
862
|
}
|
|
@@ -826,10 +872,11 @@ import {
|
|
|
826
872
|
descriptionId as descriptionId3,
|
|
827
873
|
getTemplate as getTemplate6
|
|
828
874
|
} from "@rjsf/utils";
|
|
829
|
-
import { jsx as
|
|
875
|
+
import { jsx as jsx21, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
830
876
|
function CheckboxesWidget(props) {
|
|
831
877
|
const {
|
|
832
878
|
id,
|
|
879
|
+
htmlName,
|
|
833
880
|
disabled,
|
|
834
881
|
options,
|
|
835
882
|
value,
|
|
@@ -867,7 +914,7 @@ function CheckboxesWidget(props) {
|
|
|
867
914
|
id,
|
|
868
915
|
style: { display: "flex", flexDirection: "column", gap: "1rem", marginTop: "0.5rem", marginBottom: "0.5rem" },
|
|
869
916
|
children: [
|
|
870
|
-
!hideLabel && !!description && /* @__PURE__ */
|
|
917
|
+
!hideLabel && !!description && /* @__PURE__ */ jsx21(
|
|
871
918
|
DescriptionFieldTemplate,
|
|
872
919
|
{
|
|
873
920
|
id: descriptionId3(id),
|
|
@@ -881,11 +928,11 @@ function CheckboxesWidget(props) {
|
|
|
881
928
|
const checked = enumOptionsIsSelected(option.value, checkboxesValues);
|
|
882
929
|
const itemDisabled = Array.isArray(enumDisabled) && enumDisabled.indexOf(option.value) !== -1;
|
|
883
930
|
return /* @__PURE__ */ jsxs12("div", { style: { display: "flex", flexDirection: "row", gap: "0.5rem", alignItems: "center" }, children: [
|
|
884
|
-
/* @__PURE__ */
|
|
931
|
+
/* @__PURE__ */ jsx21(
|
|
885
932
|
Checkbox2,
|
|
886
933
|
{
|
|
887
934
|
inputId: optionId(id, index),
|
|
888
|
-
name: id,
|
|
935
|
+
name: htmlName || id,
|
|
889
936
|
...primeProps,
|
|
890
937
|
value: option.value,
|
|
891
938
|
checked,
|
|
@@ -897,7 +944,7 @@ function CheckboxesWidget(props) {
|
|
|
897
944
|
"aria-describedby": ariaDescribedByIds4(id)
|
|
898
945
|
}
|
|
899
946
|
),
|
|
900
|
-
/* @__PURE__ */
|
|
947
|
+
/* @__PURE__ */ jsx21(Label, { id: optionId(id, index), text: option.label })
|
|
901
948
|
] }, index);
|
|
902
949
|
})
|
|
903
950
|
]
|
|
@@ -911,7 +958,7 @@ import {
|
|
|
911
958
|
getInputProps as getInputProps3
|
|
912
959
|
} from "@rjsf/utils";
|
|
913
960
|
import { ColorPicker } from "primereact/colorpicker";
|
|
914
|
-
import { jsx as
|
|
961
|
+
import { jsx as jsx22 } from "react/jsx-runtime";
|
|
915
962
|
function ColorWidget(props) {
|
|
916
963
|
const {
|
|
917
964
|
id,
|
|
@@ -935,7 +982,7 @@ function ColorWidget(props) {
|
|
|
935
982
|
const _onChange = ({ target: { value: value2 } }) => onChange(value2 === "" ? options.emptyValue : value2);
|
|
936
983
|
const _onBlur = () => onBlur && onBlur(id, value);
|
|
937
984
|
const _onFocus = () => onFocus && onFocus(id, value);
|
|
938
|
-
return /* @__PURE__ */
|
|
985
|
+
return /* @__PURE__ */ jsx22(
|
|
939
986
|
ColorPicker,
|
|
940
987
|
{
|
|
941
988
|
id,
|
|
@@ -962,7 +1009,7 @@ import {
|
|
|
962
1009
|
getInputProps as getInputProps4
|
|
963
1010
|
} from "@rjsf/utils";
|
|
964
1011
|
import { Password } from "primereact/password";
|
|
965
|
-
import { jsx as
|
|
1012
|
+
import { jsx as jsx23 } from "react/jsx-runtime";
|
|
966
1013
|
function PasswordWidget(props) {
|
|
967
1014
|
const {
|
|
968
1015
|
id,
|
|
@@ -986,7 +1033,7 @@ function PasswordWidget(props) {
|
|
|
986
1033
|
const _onChange = ({ target: { value: value2 } }) => onChange(value2 === "" ? options.emptyValue : value2);
|
|
987
1034
|
const _onBlur = () => onBlur && onBlur(id, value);
|
|
988
1035
|
const _onFocus = () => onFocus && onFocus(id, value);
|
|
989
|
-
return /* @__PURE__ */
|
|
1036
|
+
return /* @__PURE__ */ jsx23(
|
|
990
1037
|
Password,
|
|
991
1038
|
{
|
|
992
1039
|
id,
|
|
@@ -1016,9 +1063,9 @@ import {
|
|
|
1016
1063
|
optionId as optionId2
|
|
1017
1064
|
} from "@rjsf/utils";
|
|
1018
1065
|
import { RadioButton } from "primereact/radiobutton";
|
|
1019
|
-
import { jsx as
|
|
1066
|
+
import { jsx as jsx24, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
1020
1067
|
function RadioWidget(props) {
|
|
1021
|
-
const { id, value, disabled, readonly, onChange, onBlur, onFocus, options } = props;
|
|
1068
|
+
const { id, htmlName, value, disabled, readonly, onChange, onBlur, onFocus, options } = props;
|
|
1022
1069
|
const primeProps = options.prime || {};
|
|
1023
1070
|
const { enumOptions, enumDisabled, emptyValue } = options;
|
|
1024
1071
|
const _onChange = (e) => {
|
|
@@ -1026,15 +1073,15 @@ function RadioWidget(props) {
|
|
|
1026
1073
|
};
|
|
1027
1074
|
const _onBlur = () => onBlur(id, value);
|
|
1028
1075
|
const _onFocus = () => onFocus(id, value);
|
|
1029
|
-
return /* @__PURE__ */
|
|
1076
|
+
return /* @__PURE__ */ jsx24("div", { style: { display: "flex", flexDirection: "row", gap: "1rem" }, children: Array.isArray(enumOptions) && enumOptions.map((option, index) => {
|
|
1030
1077
|
const checked = enumOptionsIsSelected2(option.value, value);
|
|
1031
1078
|
const itemDisabled = Array.isArray(enumDisabled) && enumDisabled.indexOf(option.value) !== -1;
|
|
1032
1079
|
return /* @__PURE__ */ jsxs13("div", { style: { display: "flex", alignItems: "center" }, children: [
|
|
1033
|
-
/* @__PURE__ */
|
|
1080
|
+
/* @__PURE__ */ jsx24(
|
|
1034
1081
|
RadioButton,
|
|
1035
1082
|
{
|
|
1036
1083
|
inputId: optionId2(id, index),
|
|
1037
|
-
name: id,
|
|
1084
|
+
name: htmlName || id,
|
|
1038
1085
|
...primeProps,
|
|
1039
1086
|
onFocus: _onFocus,
|
|
1040
1087
|
onBlur: _onBlur,
|
|
@@ -1045,7 +1092,7 @@ function RadioWidget(props) {
|
|
|
1045
1092
|
"aria-describedby": ariaDescribedByIds7(id)
|
|
1046
1093
|
}
|
|
1047
1094
|
),
|
|
1048
|
-
/* @__PURE__ */
|
|
1095
|
+
/* @__PURE__ */ jsx24("label", { htmlFor: optionId2(id, index), style: { marginLeft: "8px" }, children: option.label })
|
|
1049
1096
|
] }, index);
|
|
1050
1097
|
}) });
|
|
1051
1098
|
}
|
|
@@ -1053,7 +1100,7 @@ function RadioWidget(props) {
|
|
|
1053
1100
|
// src/RangeWidget/RangeWidget.tsx
|
|
1054
1101
|
import { Slider } from "primereact/slider";
|
|
1055
1102
|
import { ariaDescribedByIds as ariaDescribedByIds8, rangeSpec } from "@rjsf/utils";
|
|
1056
|
-
import { Fragment as Fragment5, jsx as
|
|
1103
|
+
import { Fragment as Fragment5, jsx as jsx25 } from "react/jsx-runtime";
|
|
1057
1104
|
function RangeWidget(props) {
|
|
1058
1105
|
const { value, readonly, disabled, onBlur, onFocus, options, schema, onChange, id } = props;
|
|
1059
1106
|
const primeProps = options.prime || {};
|
|
@@ -1063,7 +1110,7 @@ function RangeWidget(props) {
|
|
|
1063
1110
|
};
|
|
1064
1111
|
const _onBlur = ({ target }) => onBlur(id, target && target.value);
|
|
1065
1112
|
const _onFocus = ({ target }) => onFocus(id, target && target.value);
|
|
1066
|
-
return /* @__PURE__ */
|
|
1113
|
+
return /* @__PURE__ */ jsx25(Fragment5, { children: /* @__PURE__ */ jsx25(
|
|
1067
1114
|
Slider,
|
|
1068
1115
|
{
|
|
1069
1116
|
...primeProps,
|
|
@@ -1086,14 +1133,15 @@ import {
|
|
|
1086
1133
|
enumOptionsValueForIndex as enumOptionsValueForIndex2
|
|
1087
1134
|
} from "@rjsf/utils";
|
|
1088
1135
|
import { MultiSelect } from "primereact/multiselect";
|
|
1089
|
-
import { jsx as
|
|
1136
|
+
import { jsx as jsx26 } from "react/jsx-runtime";
|
|
1090
1137
|
function SelectWidget(props) {
|
|
1091
1138
|
const { multiple = false } = props;
|
|
1092
|
-
return multiple ? /* @__PURE__ */
|
|
1139
|
+
return multiple ? /* @__PURE__ */ jsx26(MultiSelectWidget, { ...props }) : /* @__PURE__ */ jsx26(SingleSelectWidget, { ...props });
|
|
1093
1140
|
}
|
|
1094
1141
|
function SingleSelectWidget({
|
|
1095
1142
|
schema,
|
|
1096
1143
|
id,
|
|
1144
|
+
htmlName,
|
|
1097
1145
|
name,
|
|
1098
1146
|
// remove this from dropdownProps
|
|
1099
1147
|
options,
|
|
@@ -1114,7 +1162,6 @@ function SingleSelectWidget({
|
|
|
1114
1162
|
registry,
|
|
1115
1163
|
uiSchema,
|
|
1116
1164
|
hideError,
|
|
1117
|
-
formContext,
|
|
1118
1165
|
...dropdownProps
|
|
1119
1166
|
}) {
|
|
1120
1167
|
const { enumOptions, enumDisabled, emptyValue: optEmptyVal } = options;
|
|
@@ -1127,11 +1174,11 @@ function SingleSelectWidget({
|
|
|
1127
1174
|
const _onFocus = ({ target }) => onFocus(id, enumOptionsValueForIndex2(target && target.value, enumOptions, optEmptyVal));
|
|
1128
1175
|
const selectedIndexes = enumOptionsIndexForValue(value, enumOptions, multiple);
|
|
1129
1176
|
const { ...dropdownRemainingProps } = dropdownProps;
|
|
1130
|
-
return /* @__PURE__ */
|
|
1177
|
+
return /* @__PURE__ */ jsx26(
|
|
1131
1178
|
Dropdown,
|
|
1132
1179
|
{
|
|
1133
1180
|
id,
|
|
1134
|
-
name: id,
|
|
1181
|
+
name: htmlName || id,
|
|
1135
1182
|
...primeProps,
|
|
1136
1183
|
value: !isEmpty && typeof selectedIndexes !== "undefined" ? selectedIndexes : emptyValue,
|
|
1137
1184
|
options: (enumOptions ?? []).map(({ value: value2, label: label2 }, i) => ({
|
|
@@ -1152,6 +1199,7 @@ function SingleSelectWidget({
|
|
|
1152
1199
|
}
|
|
1153
1200
|
function MultiSelectWidget({
|
|
1154
1201
|
id,
|
|
1202
|
+
htmlName,
|
|
1155
1203
|
options,
|
|
1156
1204
|
disabled,
|
|
1157
1205
|
placeholder,
|
|
@@ -1171,11 +1219,11 @@ function MultiSelectWidget({
|
|
|
1171
1219
|
const _onBlur = ({ target }) => onBlur(id, enumOptionsValueForIndex2(target && target.value, enumOptions, optEmptyVal));
|
|
1172
1220
|
const _onFocus = ({ target }) => onFocus(id, enumOptionsValueForIndex2(target && target.value, enumOptions, optEmptyVal));
|
|
1173
1221
|
const selectedIndexes = enumOptionsIndexForValue(value, enumOptions, multiple);
|
|
1174
|
-
return /* @__PURE__ */
|
|
1222
|
+
return /* @__PURE__ */ jsx26(
|
|
1175
1223
|
MultiSelect,
|
|
1176
1224
|
{
|
|
1177
1225
|
id,
|
|
1178
|
-
name: id,
|
|
1226
|
+
name: htmlName || id,
|
|
1179
1227
|
...primeProps,
|
|
1180
1228
|
value: !isEmpty && typeof selectedIndexes !== "undefined" ? selectedIndexes : emptyValue,
|
|
1181
1229
|
options: (enumOptions ?? []).map(({ value: value2, label }, i) => ({
|
|
@@ -1198,9 +1246,9 @@ function MultiSelectWidget({
|
|
|
1198
1246
|
|
|
1199
1247
|
// src/TextareaWidget/TextareaWidget.tsx
|
|
1200
1248
|
import { InputTextarea } from "primereact/inputtextarea";
|
|
1201
|
-
import { jsx as
|
|
1249
|
+
import { jsx as jsx27 } from "react/jsx-runtime";
|
|
1202
1250
|
function TextareaWidget(props) {
|
|
1203
|
-
const { id, value, required, disabled, readonly, autofocus, onChange, onBlur, onFocus, options } = props;
|
|
1251
|
+
const { id, htmlName, value, required, disabled, readonly, autofocus, onChange, onBlur, onFocus, options } = props;
|
|
1204
1252
|
const primeProps = options.prime || {};
|
|
1205
1253
|
let rows = 5;
|
|
1206
1254
|
if (typeof options.rows === "string" || typeof options.rows === "number") {
|
|
@@ -1209,10 +1257,11 @@ function TextareaWidget(props) {
|
|
|
1209
1257
|
const handleChange = (event) => {
|
|
1210
1258
|
onChange(event.target.value === "" ? options.emptyValue : event.target.value);
|
|
1211
1259
|
};
|
|
1212
|
-
return /* @__PURE__ */
|
|
1260
|
+
return /* @__PURE__ */ jsx27(
|
|
1213
1261
|
InputTextarea,
|
|
1214
1262
|
{
|
|
1215
1263
|
id,
|
|
1264
|
+
name: htmlName || id,
|
|
1216
1265
|
...primeProps,
|
|
1217
1266
|
value: value || "",
|
|
1218
1267
|
required,
|
|
@@ -1232,7 +1281,7 @@ import {
|
|
|
1232
1281
|
getInputProps as getInputProps5
|
|
1233
1282
|
} from "@rjsf/utils";
|
|
1234
1283
|
import { InputNumber } from "primereact/inputnumber";
|
|
1235
|
-
import { jsx as
|
|
1284
|
+
import { jsx as jsx28 } from "react/jsx-runtime";
|
|
1236
1285
|
function UpDownWidget(props) {
|
|
1237
1286
|
const {
|
|
1238
1287
|
id,
|
|
@@ -1257,7 +1306,7 @@ function UpDownWidget(props) {
|
|
|
1257
1306
|
const _onChange = (event) => onChange(event.value === null ? options.emptyValue : value);
|
|
1258
1307
|
const _onBlur = () => onBlur && onBlur(id, value);
|
|
1259
1308
|
const _onFocus = () => onFocus && onFocus(id, value);
|
|
1260
|
-
return /* @__PURE__ */
|
|
1309
|
+
return /* @__PURE__ */ jsx28(
|
|
1261
1310
|
InputNumber,
|
|
1262
1311
|
{
|
|
1263
1312
|
id,
|