@rjsf/react-bootstrap 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 +147 -66
- package/dist/index.cjs.map +4 -4
- package/dist/react-bootstrap.esm.js +143 -62
- package/dist/react-bootstrap.esm.js.map +4 -4
- package/dist/react-bootstrap.umd.js +106 -32
- package/lib/AddButton/AddButton.js +1 -1
- package/lib/AddButton/AddButton.js.map +1 -1
- package/lib/ArrayFieldItemTemplate/ArrayFieldItemTemplate.d.ts +2 -2
- package/lib/ArrayFieldItemTemplate/ArrayFieldItemTemplate.js.map +1 -1
- package/lib/ArrayFieldTemplate/ArrayFieldTemplate.js +3 -4
- package/lib/ArrayFieldTemplate/ArrayFieldTemplate.js.map +1 -1
- package/lib/BaseInputTemplate/BaseInputTemplate.d.ts +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.d.ts +1 -1
- package/lib/CheckboxesWidget/CheckboxesWidget.js +2 -2
- package/lib/CheckboxesWidget/CheckboxesWidget.js.map +1 -1
- package/lib/FieldTemplate/FieldTemplate.d.ts +1 -1
- package/lib/FieldTemplate/FieldTemplate.js +2 -2
- package/lib/FieldTemplate/FieldTemplate.js.map +1 -1
- package/lib/IconButton/IconButton.d.ts +6 -5
- package/lib/IconButton/IconButton.js +1 -1
- package/lib/IconButton/IconButton.js.map +1 -1
- package/lib/ObjectFieldTemplate/ObjectFieldTemplate.d.ts +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 +22 -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.d.ts +1 -1
- package/lib/RadioWidget/RadioWidget.js +2 -2
- package/lib/RadioWidget/RadioWidget.js.map +1 -1
- package/lib/SelectWidget/SelectWidget.d.ts +1 -1
- package/lib/SelectWidget/SelectWidget.js +2 -2
- 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.d.ts +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 +9 -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/AddButton/AddButton.tsx +1 -1
- package/src/ArrayFieldItemTemplate/ArrayFieldItemTemplate.tsx +2 -2
- package/src/ArrayFieldTemplate/ArrayFieldTemplate.tsx +18 -12
- package/src/BaseInputTemplate/BaseInputTemplate.tsx +2 -1
- package/src/CheckboxWidget/CheckboxWidget.tsx +2 -1
- package/src/CheckboxesWidget/CheckboxesWidget.tsx +14 -2
- package/src/FieldTemplate/FieldTemplate.tsx +6 -4
- package/src/IconButton/IconButton.tsx +12 -6
- package/src/ObjectFieldTemplate/ObjectFieldTemplate.tsx +6 -2
- package/src/OptionalDataControlsTemplate/OptionalDataControlsTemplate.tsx +47 -0
- package/src/OptionalDataControlsTemplate/index.ts +2 -0
- package/src/RadioWidget/RadioWidget.tsx +2 -1
- package/src/SelectWidget/SelectWidget.tsx +2 -1
- package/src/Templates/Templates.ts +2 -0
- package/src/TextareaWidget/TextareaWidget.tsx +2 -1
- package/src/TitleField/TitleField.tsx +19 -2
- package/src/WrapIfAdditionalTemplate/WrapIfAdditionalTemplate.tsx +4 -6
|
@@ -15,10 +15,10 @@ function AddButton({
|
|
|
15
15
|
return /* @__PURE__ */ jsx(
|
|
16
16
|
Button,
|
|
17
17
|
{
|
|
18
|
+
title: translateString(TranslatableString.AddItemButton),
|
|
18
19
|
...props,
|
|
19
20
|
style: { width: "100%" },
|
|
20
21
|
className: `ml-1 ${props.className}`,
|
|
21
|
-
title: translateString(TranslatableString.AddItemButton),
|
|
22
22
|
children: /* @__PURE__ */ jsx(BsPlus, {})
|
|
23
23
|
}
|
|
24
24
|
);
|
|
@@ -63,23 +63,32 @@ import {
|
|
|
63
63
|
} from "@rjsf/utils";
|
|
64
64
|
import { jsx as jsx3, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
65
65
|
function ArrayFieldTemplate(props) {
|
|
66
|
-
const {
|
|
66
|
+
const {
|
|
67
|
+
canAdd,
|
|
68
|
+
disabled,
|
|
69
|
+
fieldPathId,
|
|
70
|
+
uiSchema,
|
|
71
|
+
items,
|
|
72
|
+
optionalDataControl,
|
|
73
|
+
onAddClick,
|
|
74
|
+
readonly,
|
|
75
|
+
registry,
|
|
76
|
+
required,
|
|
77
|
+
schema,
|
|
78
|
+
title
|
|
79
|
+
} = props;
|
|
67
80
|
const uiOptions = getUiOptions2(uiSchema);
|
|
68
81
|
const ArrayFieldDescriptionTemplate = getTemplate2(
|
|
69
82
|
"ArrayFieldDescriptionTemplate",
|
|
70
83
|
registry,
|
|
71
84
|
uiOptions
|
|
72
85
|
);
|
|
73
|
-
const ArrayFieldItemTemplate2 = getTemplate2(
|
|
74
|
-
"ArrayFieldItemTemplate",
|
|
75
|
-
registry,
|
|
76
|
-
uiOptions
|
|
77
|
-
);
|
|
78
86
|
const ArrayFieldTitleTemplate = getTemplate2(
|
|
79
87
|
"ArrayFieldTitleTemplate",
|
|
80
88
|
registry,
|
|
81
89
|
uiOptions
|
|
82
90
|
);
|
|
91
|
+
const showOptionalDataControlInTitle = !readonly && !disabled;
|
|
83
92
|
const {
|
|
84
93
|
ButtonTemplates: { AddButton: AddButton2 }
|
|
85
94
|
} = registry.templates;
|
|
@@ -92,7 +101,8 @@ function ArrayFieldTemplate(props) {
|
|
|
92
101
|
schema,
|
|
93
102
|
uiSchema,
|
|
94
103
|
required,
|
|
95
|
-
registry
|
|
104
|
+
registry,
|
|
105
|
+
optionalDataControl: showOptionalDataControlInTitle ? optionalDataControl : void 0
|
|
96
106
|
}
|
|
97
107
|
),
|
|
98
108
|
/* @__PURE__ */ jsx3(
|
|
@@ -106,7 +116,8 @@ function ArrayFieldTemplate(props) {
|
|
|
106
116
|
}
|
|
107
117
|
),
|
|
108
118
|
/* @__PURE__ */ jsxs2(Container, { fluid: true, className: "p-0 m-0", children: [
|
|
109
|
-
|
|
119
|
+
!showOptionalDataControlInTitle ? optionalDataControl : void 0,
|
|
120
|
+
items,
|
|
110
121
|
canAdd && /* @__PURE__ */ jsx3(Container, { className: "", children: /* @__PURE__ */ jsxs2(Row2, { className: "mt-2", children: [
|
|
111
122
|
/* @__PURE__ */ jsx3(Col2, { xs: 9 }),
|
|
112
123
|
/* @__PURE__ */ jsx3(Col2, { xs: 3, className: "py-4 col-lg-3 col-3", children: /* @__PURE__ */ jsx3(
|
|
@@ -135,6 +146,7 @@ import {
|
|
|
135
146
|
import { Fragment, jsx as jsx4, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
136
147
|
function BaseInputTemplate({
|
|
137
148
|
id,
|
|
149
|
+
htmlName,
|
|
138
150
|
placeholder,
|
|
139
151
|
required,
|
|
140
152
|
readonly,
|
|
@@ -164,7 +176,7 @@ function BaseInputTemplate({
|
|
|
164
176
|
Form.Control,
|
|
165
177
|
{
|
|
166
178
|
id,
|
|
167
|
-
name: id,
|
|
179
|
+
name: htmlName || id,
|
|
168
180
|
placeholder,
|
|
169
181
|
autoFocus: autofocus,
|
|
170
182
|
required,
|
|
@@ -253,8 +265,8 @@ function RemoveButton(props) {
|
|
|
253
265
|
IconButton,
|
|
254
266
|
{
|
|
255
267
|
title: translateString(TranslatableString3.RemoveButton),
|
|
256
|
-
...props,
|
|
257
268
|
variant: "danger",
|
|
269
|
+
...props,
|
|
258
270
|
icon: /* @__PURE__ */ jsx7(IoIosRemove, {})
|
|
259
271
|
}
|
|
260
272
|
);
|
|
@@ -309,8 +321,9 @@ function FieldTemplate({
|
|
|
309
321
|
disabled,
|
|
310
322
|
label,
|
|
311
323
|
hidden,
|
|
312
|
-
|
|
313
|
-
|
|
324
|
+
onKeyRename,
|
|
325
|
+
onKeyRenameBlur,
|
|
326
|
+
onRemoveProperty,
|
|
314
327
|
readonly,
|
|
315
328
|
required,
|
|
316
329
|
schema,
|
|
@@ -334,8 +347,9 @@ function FieldTemplate({
|
|
|
334
347
|
disabled,
|
|
335
348
|
id,
|
|
336
349
|
label,
|
|
337
|
-
|
|
338
|
-
|
|
350
|
+
onKeyRename,
|
|
351
|
+
onKeyRenameBlur,
|
|
352
|
+
onRemoveProperty,
|
|
339
353
|
readonly,
|
|
340
354
|
required,
|
|
341
355
|
schema,
|
|
@@ -399,7 +413,8 @@ function ObjectFieldTemplate({
|
|
|
399
413
|
fieldPathId,
|
|
400
414
|
schema,
|
|
401
415
|
formData,
|
|
402
|
-
|
|
416
|
+
optionalDataControl,
|
|
417
|
+
onAddProperty,
|
|
403
418
|
disabled,
|
|
404
419
|
readonly,
|
|
405
420
|
registry
|
|
@@ -411,6 +426,7 @@ function ObjectFieldTemplate({
|
|
|
411
426
|
registry,
|
|
412
427
|
uiOptions
|
|
413
428
|
);
|
|
429
|
+
const showOptionalDataControlInTitle = !readonly && !disabled;
|
|
414
430
|
const {
|
|
415
431
|
ButtonTemplates: { AddButton: AddButton2 }
|
|
416
432
|
} = registry.templates;
|
|
@@ -423,7 +439,8 @@ function ObjectFieldTemplate({
|
|
|
423
439
|
required,
|
|
424
440
|
schema,
|
|
425
441
|
uiSchema,
|
|
426
|
-
registry
|
|
442
|
+
registry,
|
|
443
|
+
optionalDataControl: showOptionalDataControlInTitle ? optionalDataControl : void 0
|
|
427
444
|
}
|
|
428
445
|
),
|
|
429
446
|
description && /* @__PURE__ */ jsx13(
|
|
@@ -437,6 +454,7 @@ function ObjectFieldTemplate({
|
|
|
437
454
|
}
|
|
438
455
|
),
|
|
439
456
|
/* @__PURE__ */ jsxs7(Container2, { fluid: true, className: "p-0", children: [
|
|
457
|
+
!showOptionalDataControlInTitle ? optionalDataControl : void 0,
|
|
440
458
|
properties.map((element, index) => /* @__PURE__ */ jsx13(Row4, { style: { marginBottom: "10px" }, className: element.hidden ? "d-none" : void 0, children: /* @__PURE__ */ jsxs7(Col4, { xs: 12, children: [
|
|
441
459
|
" ",
|
|
442
460
|
element.content
|
|
@@ -445,7 +463,7 @@ function ObjectFieldTemplate({
|
|
|
445
463
|
AddButton2,
|
|
446
464
|
{
|
|
447
465
|
id: buttonId2(fieldPathId, "add"),
|
|
448
|
-
onClick:
|
|
466
|
+
onClick: onAddProperty,
|
|
449
467
|
disabled: disabled || readonly,
|
|
450
468
|
className: "rjsf-object-property-expand",
|
|
451
469
|
uiSchema,
|
|
@@ -456,30 +474,77 @@ function ObjectFieldTemplate({
|
|
|
456
474
|
] });
|
|
457
475
|
}
|
|
458
476
|
|
|
477
|
+
// src/OptionalDataControlsTemplate/OptionalDataControlsTemplate.tsx
|
|
478
|
+
import { BsPlus as BsPlus2 } from "@react-icons/all-files/bs/BsPlus";
|
|
479
|
+
import { jsx as jsx14 } from "react/jsx-runtime";
|
|
480
|
+
function OptionalDataControlsTemplate(props) {
|
|
481
|
+
const { id, registry, label, onAddClick, onRemoveClick } = props;
|
|
482
|
+
if (onAddClick) {
|
|
483
|
+
return /* @__PURE__ */ jsx14(
|
|
484
|
+
IconButton,
|
|
485
|
+
{
|
|
486
|
+
id,
|
|
487
|
+
registry,
|
|
488
|
+
className: "rjsf-add-optional-data",
|
|
489
|
+
icon: /* @__PURE__ */ jsx14(BsPlus2, {}),
|
|
490
|
+
onClick: onAddClick,
|
|
491
|
+
title: label,
|
|
492
|
+
size: "sm",
|
|
493
|
+
variant: "secondary"
|
|
494
|
+
}
|
|
495
|
+
);
|
|
496
|
+
} else if (onRemoveClick) {
|
|
497
|
+
return /* @__PURE__ */ jsx14(
|
|
498
|
+
RemoveButton,
|
|
499
|
+
{
|
|
500
|
+
id,
|
|
501
|
+
registry,
|
|
502
|
+
className: "rjsf-remove-optional-data",
|
|
503
|
+
onClick: onRemoveClick,
|
|
504
|
+
title: label,
|
|
505
|
+
size: "sm",
|
|
506
|
+
variant: "secondary"
|
|
507
|
+
}
|
|
508
|
+
);
|
|
509
|
+
}
|
|
510
|
+
return /* @__PURE__ */ jsx14("em", { id, children: label });
|
|
511
|
+
}
|
|
512
|
+
|
|
459
513
|
// src/SubmitButton/SubmitButton.tsx
|
|
460
514
|
import Button3 from "react-bootstrap/Button";
|
|
461
515
|
import { getSubmitButtonOptions } from "@rjsf/utils";
|
|
462
|
-
import { jsx as
|
|
516
|
+
import { jsx as jsx15 } from "react/jsx-runtime";
|
|
463
517
|
function SubmitButton(props) {
|
|
464
518
|
const { submitText, norender, props: submitButtonProps } = getSubmitButtonOptions(props.uiSchema);
|
|
465
519
|
if (norender) {
|
|
466
520
|
return null;
|
|
467
521
|
}
|
|
468
|
-
return /* @__PURE__ */
|
|
522
|
+
return /* @__PURE__ */ jsx15("div", { children: /* @__PURE__ */ jsx15(Button3, { variant: "primary", type: "submit", ...submitButtonProps, children: submitText }) });
|
|
469
523
|
}
|
|
470
524
|
|
|
471
525
|
// src/TitleField/TitleField.tsx
|
|
472
526
|
import { getUiOptions as getUiOptions5 } from "@rjsf/utils";
|
|
473
|
-
import
|
|
527
|
+
import Row5 from "react-bootstrap/Row";
|
|
528
|
+
import Col5 from "react-bootstrap/Col";
|
|
529
|
+
import Container3 from "react-bootstrap/Container";
|
|
530
|
+
import { jsx as jsx16, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
474
531
|
function TitleField({
|
|
475
532
|
id,
|
|
476
533
|
title,
|
|
477
|
-
uiSchema
|
|
534
|
+
uiSchema,
|
|
535
|
+
optionalDataControl
|
|
478
536
|
}) {
|
|
479
537
|
const uiOptions = getUiOptions5(uiSchema);
|
|
538
|
+
let heading = /* @__PURE__ */ jsx16("h5", { children: uiOptions.title || title });
|
|
539
|
+
if (optionalDataControl) {
|
|
540
|
+
heading = /* @__PURE__ */ jsx16(Container3, { fluid: true, className: "p-0", children: /* @__PURE__ */ jsxs8(Row5, { children: [
|
|
541
|
+
/* @__PURE__ */ jsx16(Col5, { xs: "11", children: heading }),
|
|
542
|
+
/* @__PURE__ */ jsx16(Col5, { xs: "1", style: { marginLeft: "-5px" }, children: optionalDataControl })
|
|
543
|
+
] }) });
|
|
544
|
+
}
|
|
480
545
|
return /* @__PURE__ */ jsxs8("div", { id, className: "my-1", children: [
|
|
481
|
-
|
|
482
|
-
/* @__PURE__ */
|
|
546
|
+
heading,
|
|
547
|
+
/* @__PURE__ */ jsx16("hr", { className: "border-0 bg-secondary mt-0", style: { height: "1px" } })
|
|
483
548
|
] });
|
|
484
549
|
}
|
|
485
550
|
|
|
@@ -489,10 +554,10 @@ import {
|
|
|
489
554
|
buttonId as buttonId3,
|
|
490
555
|
TranslatableString as TranslatableString4
|
|
491
556
|
} from "@rjsf/utils";
|
|
492
|
-
import
|
|
493
|
-
import
|
|
557
|
+
import Row6 from "react-bootstrap/Row";
|
|
558
|
+
import Col6 from "react-bootstrap/Col";
|
|
494
559
|
import Form4 from "react-bootstrap/Form";
|
|
495
|
-
import { jsx as
|
|
560
|
+
import { jsx as jsx17, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
496
561
|
function WrapIfAdditionalTemplate({
|
|
497
562
|
classNames,
|
|
498
563
|
style,
|
|
@@ -500,8 +565,8 @@ function WrapIfAdditionalTemplate({
|
|
|
500
565
|
disabled,
|
|
501
566
|
id,
|
|
502
567
|
label,
|
|
503
|
-
|
|
504
|
-
|
|
568
|
+
onRemoveProperty,
|
|
569
|
+
onKeyRenameBlur,
|
|
505
570
|
readonly,
|
|
506
571
|
required,
|
|
507
572
|
schema,
|
|
@@ -513,14 +578,13 @@ function WrapIfAdditionalTemplate({
|
|
|
513
578
|
const keyLabel = translateString(TranslatableString4.KeyLabel, [label]);
|
|
514
579
|
const additional = ADDITIONAL_PROPERTY_FLAG in schema;
|
|
515
580
|
if (!additional) {
|
|
516
|
-
return /* @__PURE__ */
|
|
581
|
+
return /* @__PURE__ */ jsx17("div", { className: classNames, style, children });
|
|
517
582
|
}
|
|
518
|
-
const handleBlur = ({ target }) => onKeyChange(target.value);
|
|
519
583
|
const keyId = `${id}-key`;
|
|
520
|
-
return /* @__PURE__ */ jsxs9(
|
|
521
|
-
/* @__PURE__ */
|
|
522
|
-
/* @__PURE__ */
|
|
523
|
-
/* @__PURE__ */
|
|
584
|
+
return /* @__PURE__ */ jsxs9(Row6, { className: classNames, style, children: [
|
|
585
|
+
/* @__PURE__ */ jsx17(Col6, { xs: 5, children: /* @__PURE__ */ jsxs9(Form4.Group, { children: [
|
|
586
|
+
/* @__PURE__ */ jsx17(Form4.Label, { htmlFor: keyId, children: keyLabel }),
|
|
587
|
+
/* @__PURE__ */ jsx17(
|
|
524
588
|
Form4.Control,
|
|
525
589
|
{
|
|
526
590
|
required,
|
|
@@ -528,19 +592,19 @@ function WrapIfAdditionalTemplate({
|
|
|
528
592
|
disabled: disabled || readonly,
|
|
529
593
|
id: keyId,
|
|
530
594
|
name: keyId,
|
|
531
|
-
onBlur: !readonly ?
|
|
595
|
+
onBlur: !readonly ? onKeyRenameBlur : void 0,
|
|
532
596
|
type: "text"
|
|
533
597
|
}
|
|
534
598
|
)
|
|
535
599
|
] }) }),
|
|
536
|
-
/* @__PURE__ */
|
|
537
|
-
/* @__PURE__ */
|
|
600
|
+
/* @__PURE__ */ jsx17(Col6, { xs: 5, children }),
|
|
601
|
+
/* @__PURE__ */ jsx17(Col6, { xs: 2, className: "py-4 d-grid gap-2", children: /* @__PURE__ */ jsx17(
|
|
538
602
|
RemoveButton2,
|
|
539
603
|
{
|
|
540
604
|
id: buttonId3(id, "remove"),
|
|
541
605
|
className: "rjsf-object-property-remove w-100",
|
|
542
606
|
disabled: disabled || readonly,
|
|
543
|
-
onClick:
|
|
607
|
+
onClick: onRemoveProperty,
|
|
544
608
|
uiSchema,
|
|
545
609
|
registry
|
|
546
610
|
}
|
|
@@ -570,6 +634,7 @@ function generateTemplates() {
|
|
|
570
634
|
GridTemplate,
|
|
571
635
|
MultiSchemaFieldTemplate,
|
|
572
636
|
ObjectFieldTemplate,
|
|
637
|
+
OptionalDataControlsTemplate,
|
|
573
638
|
TitleFieldTemplate: TitleField,
|
|
574
639
|
WrapIfAdditionalTemplate
|
|
575
640
|
};
|
|
@@ -585,10 +650,11 @@ import {
|
|
|
585
650
|
schemaRequiresTrueValue
|
|
586
651
|
} from "@rjsf/utils";
|
|
587
652
|
import Form5 from "react-bootstrap/Form";
|
|
588
|
-
import { jsx as
|
|
653
|
+
import { jsx as jsx18, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
589
654
|
function CheckboxWidget(props) {
|
|
590
655
|
const {
|
|
591
656
|
id,
|
|
657
|
+
htmlName,
|
|
592
658
|
value,
|
|
593
659
|
disabled,
|
|
594
660
|
readonly,
|
|
@@ -614,7 +680,7 @@ function CheckboxWidget(props) {
|
|
|
614
680
|
const _onFocus = ({ target }) => onFocus(id, target && target.checked);
|
|
615
681
|
const description = options.description || schema.description;
|
|
616
682
|
return /* @__PURE__ */ jsxs10(Form5.Group, { className: disabled || readonly ? "disabled" : "", "aria-describedby": ariaDescribedByIds2(id), children: [
|
|
617
|
-
!hideLabel && description && /* @__PURE__ */
|
|
683
|
+
!hideLabel && description && /* @__PURE__ */ jsx18(
|
|
618
684
|
DescriptionFieldTemplate,
|
|
619
685
|
{
|
|
620
686
|
id: descriptionId2(id),
|
|
@@ -624,11 +690,11 @@ function CheckboxWidget(props) {
|
|
|
624
690
|
registry
|
|
625
691
|
}
|
|
626
692
|
),
|
|
627
|
-
/* @__PURE__ */
|
|
693
|
+
/* @__PURE__ */ jsx18(
|
|
628
694
|
Form5.Check,
|
|
629
695
|
{
|
|
630
696
|
id,
|
|
631
|
-
name: id,
|
|
697
|
+
name: htmlName || id,
|
|
632
698
|
label: labelValue(label, hideLabel || !label),
|
|
633
699
|
checked: typeof value === "undefined" ? false : value,
|
|
634
700
|
required,
|
|
@@ -653,8 +719,20 @@ import {
|
|
|
653
719
|
enumOptionsValueForIndex,
|
|
654
720
|
optionId
|
|
655
721
|
} from "@rjsf/utils";
|
|
656
|
-
import { jsx as
|
|
657
|
-
function CheckboxesWidget({
|
|
722
|
+
import { jsx as jsx19 } from "react/jsx-runtime";
|
|
723
|
+
function CheckboxesWidget({
|
|
724
|
+
id,
|
|
725
|
+
htmlName,
|
|
726
|
+
disabled,
|
|
727
|
+
options,
|
|
728
|
+
value,
|
|
729
|
+
autofocus,
|
|
730
|
+
readonly,
|
|
731
|
+
required,
|
|
732
|
+
onChange,
|
|
733
|
+
onBlur,
|
|
734
|
+
onFocus
|
|
735
|
+
}) {
|
|
658
736
|
const { enumOptions, enumDisabled, inline, emptyValue } = options;
|
|
659
737
|
const checkboxesValues = Array.isArray(value) ? value : [value];
|
|
660
738
|
const _onChange = (index) => ({ target: { checked } }) => {
|
|
@@ -666,10 +744,10 @@ function CheckboxesWidget({ id, disabled, options, value, autofocus, readonly, r
|
|
|
666
744
|
};
|
|
667
745
|
const _onBlur = ({ target }) => onBlur(id, enumOptionsValueForIndex(target && target.value, enumOptions, emptyValue));
|
|
668
746
|
const _onFocus = ({ target }) => onFocus(id, enumOptionsValueForIndex(target && target.value, enumOptions, emptyValue));
|
|
669
|
-
return /* @__PURE__ */
|
|
747
|
+
return /* @__PURE__ */ jsx19(Form6.Group, { children: Array.isArray(enumOptions) && enumOptions.map((option, index) => {
|
|
670
748
|
const checked = enumOptionsIsSelected(option.value, checkboxesValues);
|
|
671
749
|
const itemDisabled = Array.isArray(enumDisabled) && enumDisabled.indexOf(option.value) !== -1;
|
|
672
|
-
return /* @__PURE__ */
|
|
750
|
+
return /* @__PURE__ */ jsx19(
|
|
673
751
|
Form6.Check,
|
|
674
752
|
{
|
|
675
753
|
inline,
|
|
@@ -678,7 +756,7 @@ function CheckboxesWidget({ id, disabled, options, value, autofocus, readonly, r
|
|
|
678
756
|
className: "bg-transparent border-0",
|
|
679
757
|
type: "checkbox",
|
|
680
758
|
id: optionId(id, index),
|
|
681
|
-
name: id,
|
|
759
|
+
name: htmlName || id,
|
|
682
760
|
label: option.label,
|
|
683
761
|
autoFocus: autofocus && index === 0,
|
|
684
762
|
onChange: _onChange(index),
|
|
@@ -700,9 +778,10 @@ import {
|
|
|
700
778
|
enumOptionsValueForIndex as enumOptionsValueForIndex2,
|
|
701
779
|
optionId as optionId2
|
|
702
780
|
} from "@rjsf/utils";
|
|
703
|
-
import { jsx as
|
|
781
|
+
import { jsx as jsx20 } from "react/jsx-runtime";
|
|
704
782
|
function RadioWidget({
|
|
705
783
|
id,
|
|
784
|
+
htmlName,
|
|
706
785
|
options,
|
|
707
786
|
value,
|
|
708
787
|
required,
|
|
@@ -717,16 +796,16 @@ function RadioWidget({
|
|
|
717
796
|
const _onBlur = ({ target }) => onBlur(id, enumOptionsValueForIndex2(target && target.value, enumOptions, emptyValue));
|
|
718
797
|
const _onFocus = ({ target }) => onFocus(id, enumOptionsValueForIndex2(target && target.value, enumOptions, emptyValue));
|
|
719
798
|
const inline = Boolean(options && options.inline);
|
|
720
|
-
return /* @__PURE__ */
|
|
799
|
+
return /* @__PURE__ */ jsx20(Form7.Group, { className: "mb-0", children: Array.isArray(enumOptions) && enumOptions.map((option, index) => {
|
|
721
800
|
const itemDisabled = Array.isArray(enumDisabled) && enumDisabled.indexOf(option.value) !== -1;
|
|
722
801
|
const checked = enumOptionsIsSelected2(option.value, value);
|
|
723
|
-
const radio = /* @__PURE__ */
|
|
802
|
+
const radio = /* @__PURE__ */ jsx20(
|
|
724
803
|
Form7.Check,
|
|
725
804
|
{
|
|
726
805
|
inline,
|
|
727
806
|
label: option.label,
|
|
728
807
|
id: optionId2(id, index),
|
|
729
|
-
name: id,
|
|
808
|
+
name: htmlName || id,
|
|
730
809
|
type: "radio",
|
|
731
810
|
disabled: disabled || itemDisabled || readonly,
|
|
732
811
|
checked,
|
|
@@ -746,7 +825,7 @@ function RadioWidget({
|
|
|
746
825
|
// src/RangeWidget/RangeWidget.tsx
|
|
747
826
|
import { rangeSpec } from "@rjsf/utils";
|
|
748
827
|
import FormRange from "react-bootstrap/FormRange";
|
|
749
|
-
import { Fragment as Fragment3, jsx as
|
|
828
|
+
import { Fragment as Fragment3, jsx as jsx21, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
750
829
|
function RangeWidget(props) {
|
|
751
830
|
const { id, value, disabled, onChange, onBlur, onFocus, schema } = props;
|
|
752
831
|
const _onChange = ({ target: { value: value2 } }) => onChange(value2);
|
|
@@ -763,8 +842,8 @@ function RangeWidget(props) {
|
|
|
763
842
|
...rangeSpec(schema)
|
|
764
843
|
};
|
|
765
844
|
return /* @__PURE__ */ jsxs11(Fragment3, { children: [
|
|
766
|
-
/* @__PURE__ */
|
|
767
|
-
/* @__PURE__ */
|
|
845
|
+
/* @__PURE__ */ jsx21(FormRange, { ...rangeProps }),
|
|
846
|
+
/* @__PURE__ */ jsx21("span", { className: "range-view", children: value })
|
|
768
847
|
] });
|
|
769
848
|
}
|
|
770
849
|
|
|
@@ -775,10 +854,11 @@ import {
|
|
|
775
854
|
enumOptionsIndexForValue,
|
|
776
855
|
enumOptionsValueForIndex as enumOptionsValueForIndex3
|
|
777
856
|
} from "@rjsf/utils";
|
|
778
|
-
import { jsx as
|
|
857
|
+
import { jsx as jsx22, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
779
858
|
function SelectWidget({
|
|
780
859
|
schema,
|
|
781
860
|
id,
|
|
861
|
+
htmlName,
|
|
782
862
|
options,
|
|
783
863
|
required,
|
|
784
864
|
disabled,
|
|
@@ -807,7 +887,7 @@ function SelectWidget({
|
|
|
807
887
|
FormSelect,
|
|
808
888
|
{
|
|
809
889
|
id,
|
|
810
|
-
name: id,
|
|
890
|
+
name: htmlName || id,
|
|
811
891
|
value: typeof selectedIndexes === "undefined" ? emptyValue : selectedIndexes,
|
|
812
892
|
required,
|
|
813
893
|
multiple,
|
|
@@ -828,10 +908,10 @@ function SelectWidget({
|
|
|
828
908
|
},
|
|
829
909
|
"aria-describedby": ariaDescribedByIds5(id),
|
|
830
910
|
children: [
|
|
831
|
-
showPlaceholderOption && /* @__PURE__ */
|
|
911
|
+
showPlaceholderOption && /* @__PURE__ */ jsx22("option", { value: "", children: placeholder }),
|
|
832
912
|
enumOptions.map(({ value: value2, label }, i) => {
|
|
833
913
|
const disabled2 = Array.isArray(enumDisabled) && enumDisabled.indexOf(value2) != -1;
|
|
834
|
-
return /* @__PURE__ */
|
|
914
|
+
return /* @__PURE__ */ jsx22("option", { id: label, value: String(i), disabled: disabled2, children: label }, i);
|
|
835
915
|
})
|
|
836
916
|
]
|
|
837
917
|
}
|
|
@@ -842,9 +922,10 @@ function SelectWidget({
|
|
|
842
922
|
import { ariaDescribedByIds as ariaDescribedByIds6 } from "@rjsf/utils";
|
|
843
923
|
import FormControl from "react-bootstrap/FormControl";
|
|
844
924
|
import InputGroup from "react-bootstrap/InputGroup";
|
|
845
|
-
import { jsx as
|
|
925
|
+
import { jsx as jsx23 } from "react/jsx-runtime";
|
|
846
926
|
function TextareaWidget({
|
|
847
927
|
id,
|
|
928
|
+
htmlName,
|
|
848
929
|
placeholder,
|
|
849
930
|
value,
|
|
850
931
|
required,
|
|
@@ -859,11 +940,11 @@ function TextareaWidget({
|
|
|
859
940
|
const _onChange = ({ target: { value: value2 } }) => onChange(value2 === "" ? options.emptyValue : value2);
|
|
860
941
|
const _onBlur = ({ target }) => onBlur(id, target && target.value);
|
|
861
942
|
const _onFocus = ({ target }) => onFocus(id, target && target.value);
|
|
862
|
-
return /* @__PURE__ */
|
|
943
|
+
return /* @__PURE__ */ jsx23(InputGroup, { children: /* @__PURE__ */ jsx23(
|
|
863
944
|
FormControl,
|
|
864
945
|
{
|
|
865
946
|
id,
|
|
866
|
-
name: id,
|
|
947
|
+
name: htmlName || id,
|
|
867
948
|
as: "textarea",
|
|
868
949
|
placeholder,
|
|
869
950
|
disabled,
|