@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
package/dist/index.cjs
CHANGED
|
@@ -59,10 +59,10 @@ function AddButton({
|
|
|
59
59
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
60
60
|
import_Button.default,
|
|
61
61
|
{
|
|
62
|
+
title: translateString(import_utils.TranslatableString.AddItemButton),
|
|
62
63
|
...props,
|
|
63
64
|
style: { width: "100%" },
|
|
64
65
|
className: `ml-1 ${props.className}`,
|
|
65
|
-
title: translateString(import_utils.TranslatableString.AddItemButton),
|
|
66
66
|
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_BsPlus.BsPlus, {})
|
|
67
67
|
}
|
|
68
68
|
);
|
|
@@ -100,23 +100,32 @@ var import_Container = __toESM(require("react-bootstrap/Container"), 1);
|
|
|
100
100
|
var import_utils3 = require("@rjsf/utils");
|
|
101
101
|
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
102
102
|
function ArrayFieldTemplate(props) {
|
|
103
|
-
const {
|
|
103
|
+
const {
|
|
104
|
+
canAdd,
|
|
105
|
+
disabled,
|
|
106
|
+
fieldPathId,
|
|
107
|
+
uiSchema,
|
|
108
|
+
items,
|
|
109
|
+
optionalDataControl,
|
|
110
|
+
onAddClick,
|
|
111
|
+
readonly,
|
|
112
|
+
registry,
|
|
113
|
+
required,
|
|
114
|
+
schema,
|
|
115
|
+
title
|
|
116
|
+
} = props;
|
|
104
117
|
const uiOptions = (0, import_utils3.getUiOptions)(uiSchema);
|
|
105
118
|
const ArrayFieldDescriptionTemplate = (0, import_utils3.getTemplate)(
|
|
106
119
|
"ArrayFieldDescriptionTemplate",
|
|
107
120
|
registry,
|
|
108
121
|
uiOptions
|
|
109
122
|
);
|
|
110
|
-
const ArrayFieldItemTemplate2 = (0, import_utils3.getTemplate)(
|
|
111
|
-
"ArrayFieldItemTemplate",
|
|
112
|
-
registry,
|
|
113
|
-
uiOptions
|
|
114
|
-
);
|
|
115
123
|
const ArrayFieldTitleTemplate = (0, import_utils3.getTemplate)(
|
|
116
124
|
"ArrayFieldTitleTemplate",
|
|
117
125
|
registry,
|
|
118
126
|
uiOptions
|
|
119
127
|
);
|
|
128
|
+
const showOptionalDataControlInTitle = !readonly && !disabled;
|
|
120
129
|
const {
|
|
121
130
|
ButtonTemplates: { AddButton: AddButton2 }
|
|
122
131
|
} = registry.templates;
|
|
@@ -129,7 +138,8 @@ function ArrayFieldTemplate(props) {
|
|
|
129
138
|
schema,
|
|
130
139
|
uiSchema,
|
|
131
140
|
required,
|
|
132
|
-
registry
|
|
141
|
+
registry,
|
|
142
|
+
optionalDataControl: showOptionalDataControlInTitle ? optionalDataControl : void 0
|
|
133
143
|
}
|
|
134
144
|
),
|
|
135
145
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
@@ -143,7 +153,8 @@ function ArrayFieldTemplate(props) {
|
|
|
143
153
|
}
|
|
144
154
|
),
|
|
145
155
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_Container.default, { fluid: true, className: "p-0 m-0", children: [
|
|
146
|
-
|
|
156
|
+
!showOptionalDataControlInTitle ? optionalDataControl : void 0,
|
|
157
|
+
items,
|
|
147
158
|
canAdd && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_Container.default, { className: "", children: /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_Row2.default, { className: "mt-2", children: [
|
|
148
159
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_Col2.default, { xs: 9 }),
|
|
149
160
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_Col2.default, { xs: 3, className: "py-4 col-lg-3 col-3", children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
@@ -168,6 +179,7 @@ var import_utils4 = require("@rjsf/utils");
|
|
|
168
179
|
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
169
180
|
function BaseInputTemplate({
|
|
170
181
|
id,
|
|
182
|
+
htmlName,
|
|
171
183
|
placeholder,
|
|
172
184
|
required,
|
|
173
185
|
readonly,
|
|
@@ -197,7 +209,7 @@ function BaseInputTemplate({
|
|
|
197
209
|
import_Form.default.Control,
|
|
198
210
|
{
|
|
199
211
|
id,
|
|
200
|
-
name: id,
|
|
212
|
+
name: htmlName || id,
|
|
201
213
|
placeholder,
|
|
202
214
|
autoFocus: autofocus,
|
|
203
215
|
required,
|
|
@@ -286,8 +298,8 @@ function RemoveButton(props) {
|
|
|
286
298
|
IconButton,
|
|
287
299
|
{
|
|
288
300
|
title: translateString(import_utils6.TranslatableString.RemoveButton),
|
|
289
|
-
...props,
|
|
290
301
|
variant: "danger",
|
|
302
|
+
...props,
|
|
291
303
|
icon: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_IoIosRemove.IoIosRemove, {})
|
|
292
304
|
}
|
|
293
305
|
);
|
|
@@ -339,8 +351,9 @@ function FieldTemplate({
|
|
|
339
351
|
disabled,
|
|
340
352
|
label,
|
|
341
353
|
hidden,
|
|
342
|
-
|
|
343
|
-
|
|
354
|
+
onKeyRename,
|
|
355
|
+
onKeyRenameBlur,
|
|
356
|
+
onRemoveProperty,
|
|
344
357
|
readonly,
|
|
345
358
|
required,
|
|
346
359
|
schema,
|
|
@@ -364,8 +377,9 @@ function FieldTemplate({
|
|
|
364
377
|
disabled,
|
|
365
378
|
id,
|
|
366
379
|
label,
|
|
367
|
-
|
|
368
|
-
|
|
380
|
+
onKeyRename,
|
|
381
|
+
onKeyRenameBlur,
|
|
382
|
+
onRemoveProperty,
|
|
369
383
|
readonly,
|
|
370
384
|
required,
|
|
371
385
|
schema,
|
|
@@ -422,7 +436,8 @@ function ObjectFieldTemplate({
|
|
|
422
436
|
fieldPathId,
|
|
423
437
|
schema,
|
|
424
438
|
formData,
|
|
425
|
-
|
|
439
|
+
optionalDataControl,
|
|
440
|
+
onAddProperty,
|
|
426
441
|
disabled,
|
|
427
442
|
readonly,
|
|
428
443
|
registry
|
|
@@ -434,6 +449,7 @@ function ObjectFieldTemplate({
|
|
|
434
449
|
registry,
|
|
435
450
|
uiOptions
|
|
436
451
|
);
|
|
452
|
+
const showOptionalDataControlInTitle = !readonly && !disabled;
|
|
437
453
|
const {
|
|
438
454
|
ButtonTemplates: { AddButton: AddButton2 }
|
|
439
455
|
} = registry.templates;
|
|
@@ -446,7 +462,8 @@ function ObjectFieldTemplate({
|
|
|
446
462
|
required,
|
|
447
463
|
schema,
|
|
448
464
|
uiSchema,
|
|
449
|
-
registry
|
|
465
|
+
registry,
|
|
466
|
+
optionalDataControl: showOptionalDataControlInTitle ? optionalDataControl : void 0
|
|
450
467
|
}
|
|
451
468
|
),
|
|
452
469
|
description && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
@@ -460,6 +477,7 @@ function ObjectFieldTemplate({
|
|
|
460
477
|
}
|
|
461
478
|
),
|
|
462
479
|
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_Container2.default, { fluid: true, className: "p-0", children: [
|
|
480
|
+
!showOptionalDataControlInTitle ? optionalDataControl : void 0,
|
|
463
481
|
properties.map((element, index) => /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_Row4.default, { style: { marginBottom: "10px" }, className: element.hidden ? "d-none" : void 0, children: /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_Col4.default, { xs: 12, children: [
|
|
464
482
|
" ",
|
|
465
483
|
element.content
|
|
@@ -468,7 +486,7 @@ function ObjectFieldTemplate({
|
|
|
468
486
|
AddButton2,
|
|
469
487
|
{
|
|
470
488
|
id: (0, import_utils10.buttonId)(fieldPathId, "add"),
|
|
471
|
-
onClick:
|
|
489
|
+
onClick: onAddProperty,
|
|
472
490
|
disabled: disabled || readonly,
|
|
473
491
|
className: "rjsf-object-property-expand",
|
|
474
492
|
uiSchema,
|
|
@@ -479,39 +497,86 @@ function ObjectFieldTemplate({
|
|
|
479
497
|
] });
|
|
480
498
|
}
|
|
481
499
|
|
|
500
|
+
// src/OptionalDataControlsTemplate/OptionalDataControlsTemplate.tsx
|
|
501
|
+
var import_BsPlus2 = require("@react-icons/all-files/bs/BsPlus");
|
|
502
|
+
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
503
|
+
function OptionalDataControlsTemplate(props) {
|
|
504
|
+
const { id, registry, label, onAddClick, onRemoveClick } = props;
|
|
505
|
+
if (onAddClick) {
|
|
506
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
507
|
+
IconButton,
|
|
508
|
+
{
|
|
509
|
+
id,
|
|
510
|
+
registry,
|
|
511
|
+
className: "rjsf-add-optional-data",
|
|
512
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_BsPlus2.BsPlus, {}),
|
|
513
|
+
onClick: onAddClick,
|
|
514
|
+
title: label,
|
|
515
|
+
size: "sm",
|
|
516
|
+
variant: "secondary"
|
|
517
|
+
}
|
|
518
|
+
);
|
|
519
|
+
} else if (onRemoveClick) {
|
|
520
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
521
|
+
RemoveButton,
|
|
522
|
+
{
|
|
523
|
+
id,
|
|
524
|
+
registry,
|
|
525
|
+
className: "rjsf-remove-optional-data",
|
|
526
|
+
onClick: onRemoveClick,
|
|
527
|
+
title: label,
|
|
528
|
+
size: "sm",
|
|
529
|
+
variant: "secondary"
|
|
530
|
+
}
|
|
531
|
+
);
|
|
532
|
+
}
|
|
533
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("em", { id, children: label });
|
|
534
|
+
}
|
|
535
|
+
|
|
482
536
|
// src/SubmitButton/SubmitButton.tsx
|
|
483
537
|
var import_Button3 = __toESM(require("react-bootstrap/Button"), 1);
|
|
484
538
|
var import_utils11 = require("@rjsf/utils");
|
|
485
|
-
var
|
|
539
|
+
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
486
540
|
function SubmitButton(props) {
|
|
487
541
|
const { submitText, norender, props: submitButtonProps } = (0, import_utils11.getSubmitButtonOptions)(props.uiSchema);
|
|
488
542
|
if (norender) {
|
|
489
543
|
return null;
|
|
490
544
|
}
|
|
491
|
-
return /* @__PURE__ */ (0,
|
|
545
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_Button3.default, { variant: "primary", type: "submit", ...submitButtonProps, children: submitText }) });
|
|
492
546
|
}
|
|
493
547
|
|
|
494
548
|
// src/TitleField/TitleField.tsx
|
|
495
549
|
var import_utils12 = require("@rjsf/utils");
|
|
496
|
-
var
|
|
550
|
+
var import_Row5 = __toESM(require("react-bootstrap/Row"), 1);
|
|
551
|
+
var import_Col5 = __toESM(require("react-bootstrap/Col"), 1);
|
|
552
|
+
var import_Container3 = __toESM(require("react-bootstrap/Container"), 1);
|
|
553
|
+
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
497
554
|
function TitleField({
|
|
498
555
|
id,
|
|
499
556
|
title,
|
|
500
|
-
uiSchema
|
|
557
|
+
uiSchema,
|
|
558
|
+
optionalDataControl
|
|
501
559
|
}) {
|
|
502
560
|
const uiOptions = (0, import_utils12.getUiOptions)(uiSchema);
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
/* @__PURE__ */ (0,
|
|
561
|
+
let heading = /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("h5", { children: uiOptions.title || title });
|
|
562
|
+
if (optionalDataControl) {
|
|
563
|
+
heading = /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_Container3.default, { fluid: true, className: "p-0", children: /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_Row5.default, { children: [
|
|
564
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_Col5.default, { xs: "11", children: heading }),
|
|
565
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_Col5.default, { xs: "1", style: { marginLeft: "-5px" }, children: optionalDataControl })
|
|
566
|
+
] }) });
|
|
567
|
+
}
|
|
568
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { id, className: "my-1", children: [
|
|
569
|
+
heading,
|
|
570
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("hr", { className: "border-0 bg-secondary mt-0", style: { height: "1px" } })
|
|
506
571
|
] });
|
|
507
572
|
}
|
|
508
573
|
|
|
509
574
|
// src/WrapIfAdditionalTemplate/WrapIfAdditionalTemplate.tsx
|
|
510
575
|
var import_utils13 = require("@rjsf/utils");
|
|
511
|
-
var
|
|
512
|
-
var
|
|
576
|
+
var import_Row6 = __toESM(require("react-bootstrap/Row"), 1);
|
|
577
|
+
var import_Col6 = __toESM(require("react-bootstrap/Col"), 1);
|
|
513
578
|
var import_Form4 = __toESM(require("react-bootstrap/Form"), 1);
|
|
514
|
-
var
|
|
579
|
+
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
515
580
|
function WrapIfAdditionalTemplate({
|
|
516
581
|
classNames,
|
|
517
582
|
style,
|
|
@@ -519,8 +584,8 @@ function WrapIfAdditionalTemplate({
|
|
|
519
584
|
disabled,
|
|
520
585
|
id,
|
|
521
586
|
label,
|
|
522
|
-
|
|
523
|
-
|
|
587
|
+
onRemoveProperty,
|
|
588
|
+
onKeyRenameBlur,
|
|
524
589
|
readonly,
|
|
525
590
|
required,
|
|
526
591
|
schema,
|
|
@@ -532,14 +597,13 @@ function WrapIfAdditionalTemplate({
|
|
|
532
597
|
const keyLabel = translateString(import_utils13.TranslatableString.KeyLabel, [label]);
|
|
533
598
|
const additional = import_utils13.ADDITIONAL_PROPERTY_FLAG in schema;
|
|
534
599
|
if (!additional) {
|
|
535
|
-
return /* @__PURE__ */ (0,
|
|
600
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: classNames, style, children });
|
|
536
601
|
}
|
|
537
|
-
const handleBlur = ({ target }) => onKeyChange(target.value);
|
|
538
602
|
const keyId = `${id}-key`;
|
|
539
|
-
return /* @__PURE__ */ (0,
|
|
540
|
-
/* @__PURE__ */ (0,
|
|
541
|
-
/* @__PURE__ */ (0,
|
|
542
|
-
/* @__PURE__ */ (0,
|
|
603
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_Row6.default, { className: classNames, style, children: [
|
|
604
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_Col6.default, { xs: 5, children: /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_Form4.default.Group, { children: [
|
|
605
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_Form4.default.Label, { htmlFor: keyId, children: keyLabel }),
|
|
606
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
543
607
|
import_Form4.default.Control,
|
|
544
608
|
{
|
|
545
609
|
required,
|
|
@@ -547,19 +611,19 @@ function WrapIfAdditionalTemplate({
|
|
|
547
611
|
disabled: disabled || readonly,
|
|
548
612
|
id: keyId,
|
|
549
613
|
name: keyId,
|
|
550
|
-
onBlur: !readonly ?
|
|
614
|
+
onBlur: !readonly ? onKeyRenameBlur : void 0,
|
|
551
615
|
type: "text"
|
|
552
616
|
}
|
|
553
617
|
)
|
|
554
618
|
] }) }),
|
|
555
|
-
/* @__PURE__ */ (0,
|
|
556
|
-
/* @__PURE__ */ (0,
|
|
619
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_Col6.default, { xs: 5, children }),
|
|
620
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_Col6.default, { xs: 2, className: "py-4 d-grid gap-2", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
557
621
|
RemoveButton2,
|
|
558
622
|
{
|
|
559
623
|
id: (0, import_utils13.buttonId)(id, "remove"),
|
|
560
624
|
className: "rjsf-object-property-remove w-100",
|
|
561
625
|
disabled: disabled || readonly,
|
|
562
|
-
onClick:
|
|
626
|
+
onClick: onRemoveProperty,
|
|
563
627
|
uiSchema,
|
|
564
628
|
registry
|
|
565
629
|
}
|
|
@@ -589,6 +653,7 @@ function generateTemplates() {
|
|
|
589
653
|
GridTemplate,
|
|
590
654
|
MultiSchemaFieldTemplate,
|
|
591
655
|
ObjectFieldTemplate,
|
|
656
|
+
OptionalDataControlsTemplate,
|
|
592
657
|
TitleFieldTemplate: TitleField,
|
|
593
658
|
WrapIfAdditionalTemplate
|
|
594
659
|
};
|
|
@@ -598,10 +663,11 @@ var Templates_default = generateTemplates();
|
|
|
598
663
|
// src/CheckboxWidget/CheckboxWidget.tsx
|
|
599
664
|
var import_utils14 = require("@rjsf/utils");
|
|
600
665
|
var import_Form5 = __toESM(require("react-bootstrap/Form"), 1);
|
|
601
|
-
var
|
|
666
|
+
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
602
667
|
function CheckboxWidget(props) {
|
|
603
668
|
const {
|
|
604
669
|
id,
|
|
670
|
+
htmlName,
|
|
605
671
|
value,
|
|
606
672
|
disabled,
|
|
607
673
|
readonly,
|
|
@@ -626,8 +692,8 @@ function CheckboxWidget(props) {
|
|
|
626
692
|
const _onBlur = ({ target }) => onBlur(id, target && target.checked);
|
|
627
693
|
const _onFocus = ({ target }) => onFocus(id, target && target.checked);
|
|
628
694
|
const description = options.description || schema.description;
|
|
629
|
-
return /* @__PURE__ */ (0,
|
|
630
|
-
!hideLabel && description && /* @__PURE__ */ (0,
|
|
695
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(import_Form5.default.Group, { className: disabled || readonly ? "disabled" : "", "aria-describedby": (0, import_utils14.ariaDescribedByIds)(id), children: [
|
|
696
|
+
!hideLabel && description && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
631
697
|
DescriptionFieldTemplate,
|
|
632
698
|
{
|
|
633
699
|
id: (0, import_utils14.descriptionId)(id),
|
|
@@ -637,11 +703,11 @@ function CheckboxWidget(props) {
|
|
|
637
703
|
registry
|
|
638
704
|
}
|
|
639
705
|
),
|
|
640
|
-
/* @__PURE__ */ (0,
|
|
706
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
641
707
|
import_Form5.default.Check,
|
|
642
708
|
{
|
|
643
709
|
id,
|
|
644
|
-
name: id,
|
|
710
|
+
name: htmlName || id,
|
|
645
711
|
label: (0, import_utils14.labelValue)(label, hideLabel || !label),
|
|
646
712
|
checked: typeof value === "undefined" ? false : value,
|
|
647
713
|
required,
|
|
@@ -659,8 +725,20 @@ function CheckboxWidget(props) {
|
|
|
659
725
|
// src/CheckboxesWidget/CheckboxesWidget.tsx
|
|
660
726
|
var import_Form6 = __toESM(require("react-bootstrap/Form"), 1);
|
|
661
727
|
var import_utils15 = require("@rjsf/utils");
|
|
662
|
-
var
|
|
663
|
-
function CheckboxesWidget({
|
|
728
|
+
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
729
|
+
function CheckboxesWidget({
|
|
730
|
+
id,
|
|
731
|
+
htmlName,
|
|
732
|
+
disabled,
|
|
733
|
+
options,
|
|
734
|
+
value,
|
|
735
|
+
autofocus,
|
|
736
|
+
readonly,
|
|
737
|
+
required,
|
|
738
|
+
onChange,
|
|
739
|
+
onBlur,
|
|
740
|
+
onFocus
|
|
741
|
+
}) {
|
|
664
742
|
const { enumOptions, enumDisabled, inline, emptyValue } = options;
|
|
665
743
|
const checkboxesValues = Array.isArray(value) ? value : [value];
|
|
666
744
|
const _onChange = (index) => ({ target: { checked } }) => {
|
|
@@ -672,10 +750,10 @@ function CheckboxesWidget({ id, disabled, options, value, autofocus, readonly, r
|
|
|
672
750
|
};
|
|
673
751
|
const _onBlur = ({ target }) => onBlur(id, (0, import_utils15.enumOptionsValueForIndex)(target && target.value, enumOptions, emptyValue));
|
|
674
752
|
const _onFocus = ({ target }) => onFocus(id, (0, import_utils15.enumOptionsValueForIndex)(target && target.value, enumOptions, emptyValue));
|
|
675
|
-
return /* @__PURE__ */ (0,
|
|
753
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_Form6.default.Group, { children: Array.isArray(enumOptions) && enumOptions.map((option, index) => {
|
|
676
754
|
const checked = (0, import_utils15.enumOptionsIsSelected)(option.value, checkboxesValues);
|
|
677
755
|
const itemDisabled = Array.isArray(enumDisabled) && enumDisabled.indexOf(option.value) !== -1;
|
|
678
|
-
return /* @__PURE__ */ (0,
|
|
756
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
679
757
|
import_Form6.default.Check,
|
|
680
758
|
{
|
|
681
759
|
inline,
|
|
@@ -684,7 +762,7 @@ function CheckboxesWidget({ id, disabled, options, value, autofocus, readonly, r
|
|
|
684
762
|
className: "bg-transparent border-0",
|
|
685
763
|
type: "checkbox",
|
|
686
764
|
id: (0, import_utils15.optionId)(id, index),
|
|
687
|
-
name: id,
|
|
765
|
+
name: htmlName || id,
|
|
688
766
|
label: option.label,
|
|
689
767
|
autoFocus: autofocus && index === 0,
|
|
690
768
|
onChange: _onChange(index),
|
|
@@ -701,9 +779,10 @@ function CheckboxesWidget({ id, disabled, options, value, autofocus, readonly, r
|
|
|
701
779
|
// src/RadioWidget/RadioWidget.tsx
|
|
702
780
|
var import_Form7 = __toESM(require("react-bootstrap/Form"), 1);
|
|
703
781
|
var import_utils16 = require("@rjsf/utils");
|
|
704
|
-
var
|
|
782
|
+
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
705
783
|
function RadioWidget({
|
|
706
784
|
id,
|
|
785
|
+
htmlName,
|
|
707
786
|
options,
|
|
708
787
|
value,
|
|
709
788
|
required,
|
|
@@ -718,16 +797,16 @@ function RadioWidget({
|
|
|
718
797
|
const _onBlur = ({ target }) => onBlur(id, (0, import_utils16.enumOptionsValueForIndex)(target && target.value, enumOptions, emptyValue));
|
|
719
798
|
const _onFocus = ({ target }) => onFocus(id, (0, import_utils16.enumOptionsValueForIndex)(target && target.value, enumOptions, emptyValue));
|
|
720
799
|
const inline = Boolean(options && options.inline);
|
|
721
|
-
return /* @__PURE__ */ (0,
|
|
800
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_Form7.default.Group, { className: "mb-0", children: Array.isArray(enumOptions) && enumOptions.map((option, index) => {
|
|
722
801
|
const itemDisabled = Array.isArray(enumDisabled) && enumDisabled.indexOf(option.value) !== -1;
|
|
723
802
|
const checked = (0, import_utils16.enumOptionsIsSelected)(option.value, value);
|
|
724
|
-
const radio = /* @__PURE__ */ (0,
|
|
803
|
+
const radio = /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
725
804
|
import_Form7.default.Check,
|
|
726
805
|
{
|
|
727
806
|
inline,
|
|
728
807
|
label: option.label,
|
|
729
808
|
id: (0, import_utils16.optionId)(id, index),
|
|
730
|
-
name: id,
|
|
809
|
+
name: htmlName || id,
|
|
731
810
|
type: "radio",
|
|
732
811
|
disabled: disabled || itemDisabled || readonly,
|
|
733
812
|
checked,
|
|
@@ -747,7 +826,7 @@ function RadioWidget({
|
|
|
747
826
|
// src/RangeWidget/RangeWidget.tsx
|
|
748
827
|
var import_utils17 = require("@rjsf/utils");
|
|
749
828
|
var import_FormRange = __toESM(require("react-bootstrap/FormRange"), 1);
|
|
750
|
-
var
|
|
829
|
+
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
751
830
|
function RangeWidget(props) {
|
|
752
831
|
const { id, value, disabled, onChange, onBlur, onFocus, schema } = props;
|
|
753
832
|
const _onChange = ({ target: { value: value2 } }) => onChange(value2);
|
|
@@ -763,19 +842,20 @@ function RangeWidget(props) {
|
|
|
763
842
|
onFocus: _onFocus,
|
|
764
843
|
...(0, import_utils17.rangeSpec)(schema)
|
|
765
844
|
};
|
|
766
|
-
return /* @__PURE__ */ (0,
|
|
767
|
-
/* @__PURE__ */ (0,
|
|
768
|
-
/* @__PURE__ */ (0,
|
|
845
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(import_jsx_runtime21.Fragment, { children: [
|
|
846
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_FormRange.default, { ...rangeProps }),
|
|
847
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: "range-view", children: value })
|
|
769
848
|
] });
|
|
770
849
|
}
|
|
771
850
|
|
|
772
851
|
// src/SelectWidget/SelectWidget.tsx
|
|
773
852
|
var import_FormSelect = __toESM(require("react-bootstrap/FormSelect"), 1);
|
|
774
853
|
var import_utils18 = require("@rjsf/utils");
|
|
775
|
-
var
|
|
854
|
+
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
776
855
|
function SelectWidget({
|
|
777
856
|
schema,
|
|
778
857
|
id,
|
|
858
|
+
htmlName,
|
|
779
859
|
options,
|
|
780
860
|
required,
|
|
781
861
|
disabled,
|
|
@@ -800,11 +880,11 @@ function SelectWidget({
|
|
|
800
880
|
}
|
|
801
881
|
const selectedIndexes = (0, import_utils18.enumOptionsIndexForValue)(value, enumOptions, multiple);
|
|
802
882
|
const showPlaceholderOption = !multiple && schema.default === void 0;
|
|
803
|
-
return /* @__PURE__ */ (0,
|
|
883
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
|
|
804
884
|
import_FormSelect.default,
|
|
805
885
|
{
|
|
806
886
|
id,
|
|
807
|
-
name: id,
|
|
887
|
+
name: htmlName || id,
|
|
808
888
|
value: typeof selectedIndexes === "undefined" ? emptyValue : selectedIndexes,
|
|
809
889
|
required,
|
|
810
890
|
multiple,
|
|
@@ -825,10 +905,10 @@ function SelectWidget({
|
|
|
825
905
|
},
|
|
826
906
|
"aria-describedby": (0, import_utils18.ariaDescribedByIds)(id),
|
|
827
907
|
children: [
|
|
828
|
-
showPlaceholderOption && /* @__PURE__ */ (0,
|
|
908
|
+
showPlaceholderOption && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("option", { value: "", children: placeholder }),
|
|
829
909
|
enumOptions.map(({ value: value2, label }, i) => {
|
|
830
910
|
const disabled2 = Array.isArray(enumDisabled) && enumDisabled.indexOf(value2) != -1;
|
|
831
|
-
return /* @__PURE__ */ (0,
|
|
911
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("option", { id: label, value: String(i), disabled: disabled2, children: label }, i);
|
|
832
912
|
})
|
|
833
913
|
]
|
|
834
914
|
}
|
|
@@ -839,9 +919,10 @@ function SelectWidget({
|
|
|
839
919
|
var import_utils19 = require("@rjsf/utils");
|
|
840
920
|
var import_FormControl = __toESM(require("react-bootstrap/FormControl"), 1);
|
|
841
921
|
var import_InputGroup = __toESM(require("react-bootstrap/InputGroup"), 1);
|
|
842
|
-
var
|
|
922
|
+
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
843
923
|
function TextareaWidget({
|
|
844
924
|
id,
|
|
925
|
+
htmlName,
|
|
845
926
|
placeholder,
|
|
846
927
|
value,
|
|
847
928
|
required,
|
|
@@ -856,11 +937,11 @@ function TextareaWidget({
|
|
|
856
937
|
const _onChange = ({ target: { value: value2 } }) => onChange(value2 === "" ? options.emptyValue : value2);
|
|
857
938
|
const _onBlur = ({ target }) => onBlur(id, target && target.value);
|
|
858
939
|
const _onFocus = ({ target }) => onFocus(id, target && target.value);
|
|
859
|
-
return /* @__PURE__ */ (0,
|
|
940
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_InputGroup.default, { children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
860
941
|
import_FormControl.default,
|
|
861
942
|
{
|
|
862
943
|
id,
|
|
863
|
-
name: id,
|
|
944
|
+
name: htmlName || id,
|
|
864
945
|
as: "textarea",
|
|
865
946
|
placeholder,
|
|
866
947
|
disabled,
|