@rjsf/react-bootstrap 6.0.0-alpha.0 → 6.0.0-beta.2
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/README.md +1 -1
- package/dist/index.js +197 -238
- package/dist/index.js.map +4 -4
- package/dist/react-bootstrap.esm.js +123 -158
- package/dist/react-bootstrap.esm.js.map +4 -4
- package/dist/react-bootstrap.umd.js +55 -103
- package/lib/ArrayFieldItemTemplate/ArrayFieldItemTemplate.d.ts +2 -2
- package/lib/ArrayFieldItemTemplate/ArrayFieldItemTemplate.js +5 -3
- package/lib/ArrayFieldItemTemplate/ArrayFieldItemTemplate.js.map +1 -1
- package/lib/ArrayFieldTemplate/ArrayFieldTemplate.js +2 -2
- package/lib/ArrayFieldTemplate/ArrayFieldTemplate.js.map +1 -1
- package/lib/CheckboxWidget/CheckboxWidget.js +1 -1
- package/lib/CheckboxWidget/CheckboxWidget.js.map +1 -1
- package/lib/CheckboxesWidget/CheckboxesWidget.js.map +1 -1
- package/lib/DescriptionField/DescriptionField.d.ts +5 -1
- package/lib/DescriptionField/DescriptionField.js +9 -4
- package/lib/DescriptionField/DescriptionField.js.map +1 -1
- package/lib/FieldErrorTemplate/FieldErrorTemplate.js.map +1 -1
- package/lib/FieldHelpTemplate/FieldHelpTemplate.js.map +1 -1
- package/lib/FieldTemplate/FieldTemplate.js.map +1 -1
- package/lib/GridTemplate/GridTemplate.d.ts +7 -0
- package/lib/GridTemplate/GridTemplate.js +16 -0
- package/lib/GridTemplate/GridTemplate.js.map +1 -0
- package/lib/GridTemplate/index.d.ts +2 -0
- package/lib/GridTemplate/index.js +3 -0
- package/lib/GridTemplate/index.js.map +1 -0
- package/lib/ObjectFieldTemplate/ObjectFieldTemplate.js +2 -2
- package/lib/ObjectFieldTemplate/ObjectFieldTemplate.js.map +1 -1
- package/lib/SelectWidget/SelectWidget.js.map +1 -1
- package/lib/SubmitButton/SubmitButton.js.map +1 -1
- package/lib/Templates/Templates.js +2 -0
- package/lib/Templates/Templates.js.map +1 -1
- package/lib/WrapIfAdditionalTemplate/WrapIfAdditionalTemplate.js +2 -2
- package/lib/WrapIfAdditionalTemplate/WrapIfAdditionalTemplate.js.map +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/package.json +41 -34
- package/src/ArrayFieldItemTemplate/ArrayFieldItemTemplate.tsx +17 -64
- package/src/ArrayFieldTemplate/ArrayFieldTemplate.tsx +9 -7
- package/src/BaseInputTemplate/BaseInputTemplate.tsx +1 -1
- package/src/CheckboxWidget/CheckboxWidget.tsx +4 -7
- package/src/CheckboxesWidget/CheckboxesWidget.tsx +1 -1
- package/src/DescriptionField/DescriptionField.tsx +16 -11
- package/src/FieldErrorTemplate/FieldErrorTemplate.tsx +1 -1
- package/src/FieldHelpTemplate/FieldHelpTemplate.tsx +1 -1
- package/src/FieldTemplate/FieldTemplate.tsx +2 -2
- package/src/Form/Form.tsx +1 -1
- package/src/GridTemplate/GridTemplate.tsx +16 -0
- package/src/GridTemplate/index.ts +2 -0
- package/src/IconButton/IconButton.tsx +5 -5
- package/src/ObjectFieldTemplate/ObjectFieldTemplate.tsx +5 -3
- package/src/RangeWidget/RangeWidget.tsx +1 -1
- package/src/SelectWidget/SelectWidget.tsx +1 -1
- package/src/SubmitButton/SubmitButton.tsx +1 -1
- package/src/Templates/Templates.ts +3 -1
- package/src/TextareaWidget/TextareaWidget.tsx +1 -1
- package/src/Theme/Theme.tsx +1 -1
- package/src/Widgets/Widgets.ts +1 -1
- package/src/WrapIfAdditionalTemplate/WrapIfAdditionalTemplate.tsx +4 -2
- package/LICENSE.md +0 -201
|
@@ -27,25 +27,19 @@ function AddButton({
|
|
|
27
27
|
// src/ArrayFieldItemTemplate/ArrayFieldItemTemplate.tsx
|
|
28
28
|
import Row from "react-bootstrap/Row";
|
|
29
29
|
import Col from "react-bootstrap/Col";
|
|
30
|
+
import {
|
|
31
|
+
getTemplate,
|
|
32
|
+
getUiOptions
|
|
33
|
+
} from "@rjsf/utils";
|
|
30
34
|
import { jsx as jsx2, jsxs } from "react/jsx-runtime";
|
|
31
35
|
function ArrayFieldItemTemplate(props) {
|
|
32
|
-
const {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
hasCopy,
|
|
37
|
-
hasMoveDown,
|
|
38
|
-
hasMoveUp,
|
|
39
|
-
hasRemove,
|
|
40
|
-
index,
|
|
41
|
-
onCopyIndexClick,
|
|
42
|
-
onDropIndexClick,
|
|
43
|
-
onReorderClick,
|
|
44
|
-
readonly,
|
|
36
|
+
const { children, buttonsProps, hasToolbar, uiSchema, registry } = props;
|
|
37
|
+
const uiOptions = getUiOptions(uiSchema);
|
|
38
|
+
const ArrayFieldItemButtonsTemplate = getTemplate(
|
|
39
|
+
"ArrayFieldItemButtonsTemplate",
|
|
45
40
|
registry,
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
const { CopyButton: CopyButton2, MoveDownButton: MoveDownButton2, MoveUpButton: MoveUpButton2, RemoveButton: RemoveButton2 } = registry.templates.ButtonTemplates;
|
|
41
|
+
uiOptions
|
|
42
|
+
);
|
|
49
43
|
const btnStyle = {
|
|
50
44
|
flex: 1,
|
|
51
45
|
paddingLeft: 6,
|
|
@@ -54,49 +48,7 @@ function ArrayFieldItemTemplate(props) {
|
|
|
54
48
|
};
|
|
55
49
|
return /* @__PURE__ */ jsx2("div", { children: /* @__PURE__ */ jsxs(Row, { className: "mb-2 d-flex align-items-center", children: [
|
|
56
50
|
/* @__PURE__ */ jsx2(Col, { xs: "9", lg: "9", children }),
|
|
57
|
-
/* @__PURE__ */ jsx2(Col, { xs: "3", lg: "3", className: "py-4", children: hasToolbar && /* @__PURE__ */
|
|
58
|
-
(hasMoveUp || hasMoveDown) && /* @__PURE__ */ jsx2("div", { className: "m-0 p-0", children: /* @__PURE__ */ jsx2(
|
|
59
|
-
MoveUpButton2,
|
|
60
|
-
{
|
|
61
|
-
className: "array-item-move-up",
|
|
62
|
-
style: btnStyle,
|
|
63
|
-
disabled: disabled || readonly || !hasMoveUp,
|
|
64
|
-
onClick: onReorderClick(index, index - 1),
|
|
65
|
-
uiSchema,
|
|
66
|
-
registry
|
|
67
|
-
}
|
|
68
|
-
) }),
|
|
69
|
-
(hasMoveUp || hasMoveDown) && /* @__PURE__ */ jsx2("div", { className: "m-0 p-0", children: /* @__PURE__ */ jsx2(
|
|
70
|
-
MoveDownButton2,
|
|
71
|
-
{
|
|
72
|
-
style: btnStyle,
|
|
73
|
-
disabled: disabled || readonly || !hasMoveDown,
|
|
74
|
-
onClick: onReorderClick(index, index + 1),
|
|
75
|
-
uiSchema,
|
|
76
|
-
registry
|
|
77
|
-
}
|
|
78
|
-
) }),
|
|
79
|
-
hasCopy && /* @__PURE__ */ jsx2("div", { className: "m-0 p-0", children: /* @__PURE__ */ jsx2(
|
|
80
|
-
CopyButton2,
|
|
81
|
-
{
|
|
82
|
-
style: btnStyle,
|
|
83
|
-
disabled: disabled || readonly,
|
|
84
|
-
onClick: onCopyIndexClick(index),
|
|
85
|
-
uiSchema,
|
|
86
|
-
registry
|
|
87
|
-
}
|
|
88
|
-
) }),
|
|
89
|
-
hasRemove && /* @__PURE__ */ jsx2("div", { className: "m-0 p-0", children: /* @__PURE__ */ jsx2(
|
|
90
|
-
RemoveButton2,
|
|
91
|
-
{
|
|
92
|
-
style: btnStyle,
|
|
93
|
-
disabled: disabled || readonly,
|
|
94
|
-
onClick: onDropIndexClick(index),
|
|
95
|
-
uiSchema,
|
|
96
|
-
registry
|
|
97
|
-
}
|
|
98
|
-
) })
|
|
99
|
-
] }) })
|
|
51
|
+
/* @__PURE__ */ jsx2(Col, { xs: "3", lg: "3", className: "py-4", children: hasToolbar && /* @__PURE__ */ jsx2("div", { className: "d-flex flex-row", children: /* @__PURE__ */ jsx2(ArrayFieldItemButtonsTemplate, { ...buttonsProps, style: btnStyle }) }) })
|
|
100
52
|
] }) });
|
|
101
53
|
}
|
|
102
54
|
|
|
@@ -105,24 +57,25 @@ import Row2 from "react-bootstrap/Row";
|
|
|
105
57
|
import Col2 from "react-bootstrap/Col";
|
|
106
58
|
import Container from "react-bootstrap/Container";
|
|
107
59
|
import {
|
|
108
|
-
|
|
109
|
-
|
|
60
|
+
buttonId,
|
|
61
|
+
getTemplate as getTemplate2,
|
|
62
|
+
getUiOptions as getUiOptions2
|
|
110
63
|
} from "@rjsf/utils";
|
|
111
64
|
import { jsx as jsx3, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
112
65
|
function ArrayFieldTemplate(props) {
|
|
113
66
|
const { canAdd, disabled, idSchema, uiSchema, items, onAddClick, readonly, registry, required, schema, title } = props;
|
|
114
|
-
const uiOptions =
|
|
115
|
-
const ArrayFieldDescriptionTemplate =
|
|
67
|
+
const uiOptions = getUiOptions2(uiSchema);
|
|
68
|
+
const ArrayFieldDescriptionTemplate = getTemplate2(
|
|
116
69
|
"ArrayFieldDescriptionTemplate",
|
|
117
70
|
registry,
|
|
118
71
|
uiOptions
|
|
119
72
|
);
|
|
120
|
-
const ArrayFieldItemTemplate2 =
|
|
73
|
+
const ArrayFieldItemTemplate2 = getTemplate2(
|
|
121
74
|
"ArrayFieldItemTemplate",
|
|
122
75
|
registry,
|
|
123
76
|
uiOptions
|
|
124
77
|
);
|
|
125
|
-
const ArrayFieldTitleTemplate =
|
|
78
|
+
const ArrayFieldTitleTemplate = getTemplate2(
|
|
126
79
|
"ArrayFieldTitleTemplate",
|
|
127
80
|
registry,
|
|
128
81
|
uiOptions
|
|
@@ -159,7 +112,8 @@ function ArrayFieldTemplate(props) {
|
|
|
159
112
|
/* @__PURE__ */ jsx3(Col2, { xs: 3, className: "py-4 col-lg-3 col-3", children: /* @__PURE__ */ jsx3(
|
|
160
113
|
AddButton2,
|
|
161
114
|
{
|
|
162
|
-
|
|
115
|
+
id: buttonId(idSchema, "add"),
|
|
116
|
+
className: "rjsf-array-item-add",
|
|
163
117
|
onClick: onAddClick,
|
|
164
118
|
disabled: disabled || readonly,
|
|
165
119
|
uiSchema,
|
|
@@ -234,12 +188,13 @@ function BaseInputTemplate({
|
|
|
234
188
|
}
|
|
235
189
|
|
|
236
190
|
// src/DescriptionField/DescriptionField.tsx
|
|
191
|
+
import { RichDescription } from "@rjsf/core";
|
|
237
192
|
import { jsx as jsx5 } from "react/jsx-runtime";
|
|
238
|
-
function DescriptionField({ id, description }) {
|
|
239
|
-
if (description) {
|
|
240
|
-
return
|
|
193
|
+
function DescriptionField({ id, description, registry, uiSchema }) {
|
|
194
|
+
if (!description) {
|
|
195
|
+
return null;
|
|
241
196
|
}
|
|
242
|
-
return
|
|
197
|
+
return /* @__PURE__ */ jsx5("div", { children: /* @__PURE__ */ jsx5("div", { id, className: "mb-3", children: /* @__PURE__ */ jsx5(RichDescription, { description, registry, uiSchema }) }) });
|
|
243
198
|
}
|
|
244
199
|
|
|
245
200
|
// src/ErrorList/ErrorList.tsx
|
|
@@ -335,8 +290,8 @@ function FieldHelpTemplate(props) {
|
|
|
335
290
|
|
|
336
291
|
// src/FieldTemplate/FieldTemplate.tsx
|
|
337
292
|
import {
|
|
338
|
-
getTemplate as
|
|
339
|
-
getUiOptions as
|
|
293
|
+
getTemplate as getTemplate3,
|
|
294
|
+
getUiOptions as getUiOptions3
|
|
340
295
|
} from "@rjsf/utils";
|
|
341
296
|
import Form3 from "react-bootstrap/Form";
|
|
342
297
|
import { jsx as jsx10, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
@@ -362,8 +317,8 @@ function FieldTemplate({
|
|
|
362
317
|
uiSchema,
|
|
363
318
|
registry
|
|
364
319
|
}) {
|
|
365
|
-
const uiOptions =
|
|
366
|
-
const WrapIfAdditionalTemplate2 =
|
|
320
|
+
const uiOptions = getUiOptions3(uiSchema);
|
|
321
|
+
const WrapIfAdditionalTemplate2 = getTemplate3(
|
|
367
322
|
"WrapIfAdditionalTemplate",
|
|
368
323
|
registry,
|
|
369
324
|
uiOptions
|
|
@@ -400,18 +355,31 @@ function FieldTemplate({
|
|
|
400
355
|
);
|
|
401
356
|
}
|
|
402
357
|
|
|
403
|
-
// src/
|
|
358
|
+
// src/GridTemplate/GridTemplate.tsx
|
|
404
359
|
import Row3 from "react-bootstrap/Row";
|
|
405
360
|
import Col3 from "react-bootstrap/Col";
|
|
361
|
+
import { jsx as jsx11 } from "react/jsx-runtime";
|
|
362
|
+
function GridTemplate(props) {
|
|
363
|
+
const { children, column, ...rest } = props;
|
|
364
|
+
if (column) {
|
|
365
|
+
return /* @__PURE__ */ jsx11(Col3, { ...rest, children });
|
|
366
|
+
}
|
|
367
|
+
return /* @__PURE__ */ jsx11(Row3, { ...rest, children });
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
// src/ObjectFieldTemplate/ObjectFieldTemplate.tsx
|
|
371
|
+
import Row4 from "react-bootstrap/Row";
|
|
372
|
+
import Col4 from "react-bootstrap/Col";
|
|
406
373
|
import Container2 from "react-bootstrap/Container";
|
|
407
374
|
import {
|
|
375
|
+
buttonId as buttonId2,
|
|
408
376
|
canExpand,
|
|
409
377
|
descriptionId,
|
|
410
|
-
getTemplate as
|
|
411
|
-
getUiOptions as
|
|
378
|
+
getTemplate as getTemplate4,
|
|
379
|
+
getUiOptions as getUiOptions4,
|
|
412
380
|
titleId
|
|
413
381
|
} from "@rjsf/utils";
|
|
414
|
-
import { Fragment as Fragment2, jsx as
|
|
382
|
+
import { Fragment as Fragment2, jsx as jsx12, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
415
383
|
function ObjectFieldTemplate({
|
|
416
384
|
description,
|
|
417
385
|
title,
|
|
@@ -426,9 +394,9 @@ function ObjectFieldTemplate({
|
|
|
426
394
|
readonly,
|
|
427
395
|
registry
|
|
428
396
|
}) {
|
|
429
|
-
const uiOptions =
|
|
430
|
-
const TitleFieldTemplate =
|
|
431
|
-
const DescriptionFieldTemplate =
|
|
397
|
+
const uiOptions = getUiOptions4(uiSchema);
|
|
398
|
+
const TitleFieldTemplate = getTemplate4("TitleFieldTemplate", registry, uiOptions);
|
|
399
|
+
const DescriptionFieldTemplate = getTemplate4(
|
|
432
400
|
"DescriptionFieldTemplate",
|
|
433
401
|
registry,
|
|
434
402
|
uiOptions
|
|
@@ -437,7 +405,7 @@ function ObjectFieldTemplate({
|
|
|
437
405
|
ButtonTemplates: { AddButton: AddButton2 }
|
|
438
406
|
} = registry.templates;
|
|
439
407
|
return /* @__PURE__ */ jsxs6(Fragment2, { children: [
|
|
440
|
-
title && /* @__PURE__ */
|
|
408
|
+
title && /* @__PURE__ */ jsx12(
|
|
441
409
|
TitleFieldTemplate,
|
|
442
410
|
{
|
|
443
411
|
id: titleId(idSchema),
|
|
@@ -448,7 +416,7 @@ function ObjectFieldTemplate({
|
|
|
448
416
|
registry
|
|
449
417
|
}
|
|
450
418
|
),
|
|
451
|
-
description && /* @__PURE__ */
|
|
419
|
+
description && /* @__PURE__ */ jsx12(
|
|
452
420
|
DescriptionFieldTemplate,
|
|
453
421
|
{
|
|
454
422
|
id: descriptionId(idSchema),
|
|
@@ -459,16 +427,17 @@ function ObjectFieldTemplate({
|
|
|
459
427
|
}
|
|
460
428
|
),
|
|
461
429
|
/* @__PURE__ */ jsxs6(Container2, { fluid: true, className: "p-0", children: [
|
|
462
|
-
properties.map((element, index) => /* @__PURE__ */
|
|
430
|
+
properties.map((element, index) => /* @__PURE__ */ jsx12(Row4, { style: { marginBottom: "10px" }, className: element.hidden ? "d-none" : void 0, children: /* @__PURE__ */ jsxs6(Col4, { xs: 12, children: [
|
|
463
431
|
" ",
|
|
464
432
|
element.content
|
|
465
433
|
] }) }, index)),
|
|
466
|
-
canExpand(schema, uiSchema, formData) ? /* @__PURE__ */
|
|
434
|
+
canExpand(schema, uiSchema, formData) ? /* @__PURE__ */ jsx12(Row4, { children: /* @__PURE__ */ jsx12(Col4, { xs: { offset: 9, span: 3 }, className: "py-4", children: /* @__PURE__ */ jsx12(
|
|
467
435
|
AddButton2,
|
|
468
436
|
{
|
|
437
|
+
id: buttonId2(idSchema, "add"),
|
|
469
438
|
onClick: onAddClick(schema),
|
|
470
439
|
disabled: disabled || readonly,
|
|
471
|
-
className: "object-property-expand",
|
|
440
|
+
className: "rjsf-object-property-expand",
|
|
472
441
|
uiSchema,
|
|
473
442
|
registry
|
|
474
443
|
}
|
|
@@ -480,39 +449,40 @@ function ObjectFieldTemplate({
|
|
|
480
449
|
// src/SubmitButton/SubmitButton.tsx
|
|
481
450
|
import Button3 from "react-bootstrap/Button";
|
|
482
451
|
import { getSubmitButtonOptions } from "@rjsf/utils";
|
|
483
|
-
import { jsx as
|
|
452
|
+
import { jsx as jsx13 } from "react/jsx-runtime";
|
|
484
453
|
function SubmitButton(props) {
|
|
485
454
|
const { submitText, norender, props: submitButtonProps } = getSubmitButtonOptions(props.uiSchema);
|
|
486
455
|
if (norender) {
|
|
487
456
|
return null;
|
|
488
457
|
}
|
|
489
|
-
return /* @__PURE__ */
|
|
458
|
+
return /* @__PURE__ */ jsx13("div", { children: /* @__PURE__ */ jsx13(Button3, { variant: "primary", type: "submit", ...submitButtonProps, children: submitText }) });
|
|
490
459
|
}
|
|
491
460
|
|
|
492
461
|
// src/TitleField/TitleField.tsx
|
|
493
|
-
import { getUiOptions as
|
|
494
|
-
import { jsx as
|
|
462
|
+
import { getUiOptions as getUiOptions5 } from "@rjsf/utils";
|
|
463
|
+
import { jsx as jsx14, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
495
464
|
function TitleField({
|
|
496
465
|
id,
|
|
497
466
|
title,
|
|
498
467
|
uiSchema
|
|
499
468
|
}) {
|
|
500
|
-
const uiOptions =
|
|
469
|
+
const uiOptions = getUiOptions5(uiSchema);
|
|
501
470
|
return /* @__PURE__ */ jsxs7("div", { id, className: "my-1", children: [
|
|
502
|
-
/* @__PURE__ */
|
|
503
|
-
/* @__PURE__ */
|
|
471
|
+
/* @__PURE__ */ jsx14("h5", { children: uiOptions.title || title }),
|
|
472
|
+
/* @__PURE__ */ jsx14("hr", { className: "border-0 bg-secondary", style: { height: "1px" } })
|
|
504
473
|
] });
|
|
505
474
|
}
|
|
506
475
|
|
|
507
476
|
// src/WrapIfAdditionalTemplate/WrapIfAdditionalTemplate.tsx
|
|
508
477
|
import {
|
|
509
478
|
ADDITIONAL_PROPERTY_FLAG,
|
|
479
|
+
buttonId as buttonId3,
|
|
510
480
|
TranslatableString as TranslatableString4
|
|
511
481
|
} from "@rjsf/utils";
|
|
512
|
-
import
|
|
513
|
-
import
|
|
482
|
+
import Row5 from "react-bootstrap/Row";
|
|
483
|
+
import Col5 from "react-bootstrap/Col";
|
|
514
484
|
import Form4 from "react-bootstrap/Form";
|
|
515
|
-
import { jsx as
|
|
485
|
+
import { jsx as jsx15, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
516
486
|
function WrapIfAdditionalTemplate({
|
|
517
487
|
classNames,
|
|
518
488
|
style,
|
|
@@ -533,14 +503,14 @@ function WrapIfAdditionalTemplate({
|
|
|
533
503
|
const keyLabel = translateString(TranslatableString4.KeyLabel, [label]);
|
|
534
504
|
const additional = ADDITIONAL_PROPERTY_FLAG in schema;
|
|
535
505
|
if (!additional) {
|
|
536
|
-
return /* @__PURE__ */
|
|
506
|
+
return /* @__PURE__ */ jsx15("div", { className: classNames, style, children });
|
|
537
507
|
}
|
|
538
508
|
const handleBlur = ({ target }) => onKeyChange(target.value);
|
|
539
509
|
const keyId = `${id}-key`;
|
|
540
|
-
return /* @__PURE__ */ jsxs8(
|
|
541
|
-
/* @__PURE__ */
|
|
542
|
-
/* @__PURE__ */
|
|
543
|
-
/* @__PURE__ */
|
|
510
|
+
return /* @__PURE__ */ jsxs8(Row5, { className: classNames, style, children: [
|
|
511
|
+
/* @__PURE__ */ jsx15(Col5, { xs: 5, children: /* @__PURE__ */ jsxs8(Form4.Group, { children: [
|
|
512
|
+
/* @__PURE__ */ jsx15(Form4.Label, { htmlFor: keyId, children: keyLabel }),
|
|
513
|
+
/* @__PURE__ */ jsx15(
|
|
544
514
|
Form4.Control,
|
|
545
515
|
{
|
|
546
516
|
required,
|
|
@@ -553,11 +523,12 @@ function WrapIfAdditionalTemplate({
|
|
|
553
523
|
}
|
|
554
524
|
)
|
|
555
525
|
] }) }),
|
|
556
|
-
/* @__PURE__ */
|
|
557
|
-
/* @__PURE__ */
|
|
526
|
+
/* @__PURE__ */ jsx15(Col5, { xs: 5, children }),
|
|
527
|
+
/* @__PURE__ */ jsx15(Col5, { xs: 2, className: "py-4 d-grid gap-2", children: /* @__PURE__ */ jsx15(
|
|
558
528
|
RemoveButton2,
|
|
559
529
|
{
|
|
560
|
-
|
|
530
|
+
id: buttonId3(id, "remove"),
|
|
531
|
+
className: "rjsf-object-property-remove w-100",
|
|
561
532
|
disabled: disabled || readonly,
|
|
562
533
|
onClick: onDropPropertyClick(label),
|
|
563
534
|
uiSchema,
|
|
@@ -586,6 +557,7 @@ function generateTemplates() {
|
|
|
586
557
|
FieldErrorTemplate,
|
|
587
558
|
FieldHelpTemplate,
|
|
588
559
|
FieldTemplate,
|
|
560
|
+
GridTemplate,
|
|
589
561
|
ObjectFieldTemplate,
|
|
590
562
|
TitleFieldTemplate: TitleField,
|
|
591
563
|
WrapIfAdditionalTemplate
|
|
@@ -597,12 +569,12 @@ var Templates_default = generateTemplates();
|
|
|
597
569
|
import {
|
|
598
570
|
ariaDescribedByIds as ariaDescribedByIds2,
|
|
599
571
|
descriptionId as descriptionId2,
|
|
600
|
-
getTemplate as
|
|
572
|
+
getTemplate as getTemplate5,
|
|
601
573
|
labelValue,
|
|
602
574
|
schemaRequiresTrueValue
|
|
603
575
|
} from "@rjsf/utils";
|
|
604
576
|
import Form5 from "react-bootstrap/Form";
|
|
605
|
-
import { jsx as
|
|
577
|
+
import { jsx as jsx16, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
606
578
|
function CheckboxWidget(props) {
|
|
607
579
|
const {
|
|
608
580
|
id,
|
|
@@ -621,7 +593,7 @@ function CheckboxWidget(props) {
|
|
|
621
593
|
uiSchema
|
|
622
594
|
} = props;
|
|
623
595
|
const required = schemaRequiresTrueValue(schema);
|
|
624
|
-
const DescriptionFieldTemplate =
|
|
596
|
+
const DescriptionFieldTemplate = getTemplate5(
|
|
625
597
|
"DescriptionFieldTemplate",
|
|
626
598
|
registry,
|
|
627
599
|
options
|
|
@@ -630,41 +602,34 @@ function CheckboxWidget(props) {
|
|
|
630
602
|
const _onBlur = ({ target }) => onBlur(id, target && target.checked);
|
|
631
603
|
const _onFocus = ({ target }) => onFocus(id, target && target.checked);
|
|
632
604
|
const description = options.description || schema.description;
|
|
633
|
-
return /* @__PURE__ */ jsxs9(
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
onBlur: _onBlur,
|
|
662
|
-
onFocus: _onFocus
|
|
663
|
-
}
|
|
664
|
-
)
|
|
665
|
-
]
|
|
666
|
-
}
|
|
667
|
-
);
|
|
605
|
+
return /* @__PURE__ */ jsxs9(Form5.Group, { className: disabled || readonly ? "disabled" : "", "aria-describedby": ariaDescribedByIds2(id), children: [
|
|
606
|
+
!hideLabel && description && /* @__PURE__ */ jsx16(
|
|
607
|
+
DescriptionFieldTemplate,
|
|
608
|
+
{
|
|
609
|
+
id: descriptionId2(id),
|
|
610
|
+
description,
|
|
611
|
+
schema,
|
|
612
|
+
uiSchema,
|
|
613
|
+
registry
|
|
614
|
+
}
|
|
615
|
+
),
|
|
616
|
+
/* @__PURE__ */ jsx16(
|
|
617
|
+
Form5.Check,
|
|
618
|
+
{
|
|
619
|
+
id,
|
|
620
|
+
name: id,
|
|
621
|
+
label: labelValue(label, hideLabel || !label),
|
|
622
|
+
checked: typeof value === "undefined" ? false : value,
|
|
623
|
+
required,
|
|
624
|
+
disabled: disabled || readonly,
|
|
625
|
+
autoFocus: autofocus,
|
|
626
|
+
onChange: _onChange,
|
|
627
|
+
type: "checkbox",
|
|
628
|
+
onBlur: _onBlur,
|
|
629
|
+
onFocus: _onFocus
|
|
630
|
+
}
|
|
631
|
+
)
|
|
632
|
+
] });
|
|
668
633
|
}
|
|
669
634
|
|
|
670
635
|
// src/CheckboxesWidget/CheckboxesWidget.tsx
|
|
@@ -677,7 +642,7 @@ import {
|
|
|
677
642
|
enumOptionsValueForIndex,
|
|
678
643
|
optionId
|
|
679
644
|
} from "@rjsf/utils";
|
|
680
|
-
import { jsx as
|
|
645
|
+
import { jsx as jsx17 } from "react/jsx-runtime";
|
|
681
646
|
function CheckboxesWidget({ id, disabled, options, value, autofocus, readonly, required, onChange, onBlur, onFocus }) {
|
|
682
647
|
const { enumOptions, enumDisabled, inline, emptyValue } = options;
|
|
683
648
|
const checkboxesValues = Array.isArray(value) ? value : [value];
|
|
@@ -690,10 +655,10 @@ function CheckboxesWidget({ id, disabled, options, value, autofocus, readonly, r
|
|
|
690
655
|
};
|
|
691
656
|
const _onBlur = ({ target }) => onBlur(id, enumOptionsValueForIndex(target && target.value, enumOptions, emptyValue));
|
|
692
657
|
const _onFocus = ({ target }) => onFocus(id, enumOptionsValueForIndex(target && target.value, enumOptions, emptyValue));
|
|
693
|
-
return /* @__PURE__ */
|
|
658
|
+
return /* @__PURE__ */ jsx17(Form6.Group, { children: Array.isArray(enumOptions) && enumOptions.map((option, index) => {
|
|
694
659
|
const checked = enumOptionsIsSelected(option.value, checkboxesValues);
|
|
695
660
|
const itemDisabled = Array.isArray(enumDisabled) && enumDisabled.indexOf(option.value) !== -1;
|
|
696
|
-
return /* @__PURE__ */
|
|
661
|
+
return /* @__PURE__ */ jsx17(
|
|
697
662
|
Form6.Check,
|
|
698
663
|
{
|
|
699
664
|
inline,
|
|
@@ -724,7 +689,7 @@ import {
|
|
|
724
689
|
enumOptionsValueForIndex as enumOptionsValueForIndex2,
|
|
725
690
|
optionId as optionId2
|
|
726
691
|
} from "@rjsf/utils";
|
|
727
|
-
import { jsx as
|
|
692
|
+
import { jsx as jsx18 } from "react/jsx-runtime";
|
|
728
693
|
function RadioWidget({
|
|
729
694
|
id,
|
|
730
695
|
options,
|
|
@@ -741,10 +706,10 @@ function RadioWidget({
|
|
|
741
706
|
const _onBlur = ({ target }) => onBlur(id, enumOptionsValueForIndex2(target && target.value, enumOptions, emptyValue));
|
|
742
707
|
const _onFocus = ({ target }) => onFocus(id, enumOptionsValueForIndex2(target && target.value, enumOptions, emptyValue));
|
|
743
708
|
const inline = Boolean(options && options.inline);
|
|
744
|
-
return /* @__PURE__ */
|
|
709
|
+
return /* @__PURE__ */ jsx18(Form7.Group, { className: "mb-0", children: Array.isArray(enumOptions) && enumOptions.map((option, index) => {
|
|
745
710
|
const itemDisabled = Array.isArray(enumDisabled) && enumDisabled.indexOf(option.value) !== -1;
|
|
746
711
|
const checked = enumOptionsIsSelected2(option.value, value);
|
|
747
|
-
const radio = /* @__PURE__ */
|
|
712
|
+
const radio = /* @__PURE__ */ jsx18(
|
|
748
713
|
Form7.Check,
|
|
749
714
|
{
|
|
750
715
|
inline,
|
|
@@ -770,7 +735,7 @@ function RadioWidget({
|
|
|
770
735
|
// src/RangeWidget/RangeWidget.tsx
|
|
771
736
|
import { rangeSpec } from "@rjsf/utils";
|
|
772
737
|
import FormRange from "react-bootstrap/FormRange";
|
|
773
|
-
import { Fragment as Fragment3, jsx as
|
|
738
|
+
import { Fragment as Fragment3, jsx as jsx19, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
774
739
|
function RangeWidget(props) {
|
|
775
740
|
const { id, value, disabled, onChange, onBlur, onFocus, schema } = props;
|
|
776
741
|
const _onChange = ({ target: { value: value2 } }) => onChange(value2);
|
|
@@ -787,8 +752,8 @@ function RangeWidget(props) {
|
|
|
787
752
|
...rangeSpec(schema)
|
|
788
753
|
};
|
|
789
754
|
return /* @__PURE__ */ jsxs10(Fragment3, { children: [
|
|
790
|
-
/* @__PURE__ */
|
|
791
|
-
/* @__PURE__ */
|
|
755
|
+
/* @__PURE__ */ jsx19(FormRange, { ...rangeProps }),
|
|
756
|
+
/* @__PURE__ */ jsx19("span", { className: "range-view", children: value })
|
|
792
757
|
] });
|
|
793
758
|
}
|
|
794
759
|
|
|
@@ -799,7 +764,7 @@ import {
|
|
|
799
764
|
enumOptionsIndexForValue,
|
|
800
765
|
enumOptionsValueForIndex as enumOptionsValueForIndex3
|
|
801
766
|
} from "@rjsf/utils";
|
|
802
|
-
import { jsx as
|
|
767
|
+
import { jsx as jsx20, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
803
768
|
function SelectWidget({
|
|
804
769
|
schema,
|
|
805
770
|
id,
|
|
@@ -852,10 +817,10 @@ function SelectWidget({
|
|
|
852
817
|
},
|
|
853
818
|
"aria-describedby": ariaDescribedByIds5(id),
|
|
854
819
|
children: [
|
|
855
|
-
showPlaceholderOption && /* @__PURE__ */
|
|
820
|
+
showPlaceholderOption && /* @__PURE__ */ jsx20("option", { value: "", children: placeholder }),
|
|
856
821
|
enumOptions.map(({ value: value2, label }, i) => {
|
|
857
822
|
const disabled2 = Array.isArray(enumDisabled) && enumDisabled.indexOf(value2) != -1;
|
|
858
|
-
return /* @__PURE__ */
|
|
823
|
+
return /* @__PURE__ */ jsx20("option", { id: label, value: String(i), disabled: disabled2, children: label }, i);
|
|
859
824
|
})
|
|
860
825
|
]
|
|
861
826
|
}
|
|
@@ -866,7 +831,7 @@ function SelectWidget({
|
|
|
866
831
|
import { ariaDescribedByIds as ariaDescribedByIds6 } from "@rjsf/utils";
|
|
867
832
|
import FormControl from "react-bootstrap/FormControl";
|
|
868
833
|
import InputGroup from "react-bootstrap/InputGroup";
|
|
869
|
-
import { jsx as
|
|
834
|
+
import { jsx as jsx21 } from "react/jsx-runtime";
|
|
870
835
|
function TextareaWidget({
|
|
871
836
|
id,
|
|
872
837
|
placeholder,
|
|
@@ -883,7 +848,7 @@ function TextareaWidget({
|
|
|
883
848
|
const _onChange = ({ target: { value: value2 } }) => onChange(value2 === "" ? options.emptyValue : value2);
|
|
884
849
|
const _onBlur = ({ target }) => onBlur(id, target && target.value);
|
|
885
850
|
const _onFocus = ({ target }) => onFocus(id, target && target.value);
|
|
886
|
-
return /* @__PURE__ */
|
|
851
|
+
return /* @__PURE__ */ jsx21(InputGroup, { children: /* @__PURE__ */ jsx21(
|
|
887
852
|
FormControl,
|
|
888
853
|
{
|
|
889
854
|
id,
|
|
@@ -933,13 +898,13 @@ function generateForm() {
|
|
|
933
898
|
var Form_default = generateForm();
|
|
934
899
|
|
|
935
900
|
// src/index.ts
|
|
936
|
-
var
|
|
901
|
+
var index_default = Form_default;
|
|
937
902
|
export {
|
|
938
903
|
Form_default as Form,
|
|
939
904
|
Templates_default as Templates,
|
|
940
905
|
Theme_default as Theme,
|
|
941
906
|
Widgets_default as Widgets,
|
|
942
|
-
|
|
907
|
+
index_default as default,
|
|
943
908
|
generateForm,
|
|
944
909
|
generateTemplates,
|
|
945
910
|
generateTheme,
|