@rjsf/react-bootstrap 6.0.0-beta.9 → 6.0.1
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 +2 -0
- package/dist/{index.js → index.cjs} +178 -86
- package/dist/index.cjs.map +7 -0
- package/dist/react-bootstrap.esm.js +177 -85
- package/dist/react-bootstrap.esm.js.map +4 -4
- package/dist/react-bootstrap.umd.js +125 -44
- 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/FieldErrorTemplate/FieldErrorTemplate.js +2 -2
- package/lib/FieldErrorTemplate/FieldErrorTemplate.js.map +1 -1
- package/lib/FieldHelpTemplate/FieldHelpTemplate.js +2 -2
- package/lib/FieldHelpTemplate/FieldHelpTemplate.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/MultiSchemaFieldTemplate/MultiSchemaFieldTemplate.d.ts +2 -0
- package/lib/MultiSchemaFieldTemplate/MultiSchemaFieldTemplate.js +6 -0
- package/lib/MultiSchemaFieldTemplate/MultiSchemaFieldTemplate.js.map +1 -0
- package/lib/MultiSchemaFieldTemplate/index.d.ts +2 -0
- package/lib/MultiSchemaFieldTemplate/index.js +3 -0
- package/lib/MultiSchemaFieldTemplate/index.js.map +1 -0
- 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 +4 -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 +16 -16
- package/src/AddButton/AddButton.tsx +1 -1
- package/src/ArrayFieldItemTemplate/ArrayFieldItemTemplate.tsx +2 -2
- package/src/ArrayFieldTemplate/ArrayFieldTemplate.tsx +22 -16
- package/src/BaseInputTemplate/BaseInputTemplate.tsx +5 -4
- package/src/CheckboxWidget/CheckboxWidget.tsx +4 -3
- package/src/CheckboxesWidget/CheckboxesWidget.tsx +15 -3
- package/src/FieldErrorTemplate/FieldErrorTemplate.tsx +2 -2
- package/src/FieldHelpTemplate/FieldHelpTemplate.tsx +2 -2
- package/src/FieldTemplate/FieldTemplate.tsx +6 -4
- package/src/IconButton/IconButton.tsx +12 -6
- package/src/MultiSchemaFieldTemplate/MultiSchemaFieldTemplate.tsx +15 -0
- package/src/MultiSchemaFieldTemplate/index.ts +2 -0
- package/src/ObjectFieldTemplate/ObjectFieldTemplate.tsx +10 -6
- package/src/OptionalDataControlsTemplate/OptionalDataControlsTemplate.tsx +47 -0
- package/src/OptionalDataControlsTemplate/index.ts +2 -0
- package/src/RadioWidget/RadioWidget.tsx +3 -2
- package/src/SelectWidget/SelectWidget.tsx +3 -2
- package/src/Templates/Templates.ts +4 -0
- package/src/TextareaWidget/TextareaWidget.tsx +3 -2
- package/src/TitleField/TitleField.tsx +19 -2
- package/src/WrapIfAdditionalTemplate/WrapIfAdditionalTemplate.tsx +5 -7
- package/dist/index.js.map +0 -7
|
@@ -14,10 +14,10 @@
|
|
|
14
14
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
15
15
|
Button,
|
|
16
16
|
{
|
|
17
|
+
title: translateString(utils.TranslatableString.AddItemButton),
|
|
17
18
|
...props,
|
|
18
19
|
style: { width: "100%" },
|
|
19
20
|
className: `ml-1 ${props.className}`,
|
|
20
|
-
title: translateString(utils.TranslatableString.AddItemButton),
|
|
21
21
|
children: /* @__PURE__ */ jsxRuntime.jsx(BsPlus.BsPlus, {})
|
|
22
22
|
}
|
|
23
23
|
);
|
|
@@ -42,23 +42,32 @@
|
|
|
42
42
|
] }) });
|
|
43
43
|
}
|
|
44
44
|
function ArrayFieldTemplate(props) {
|
|
45
|
-
const {
|
|
45
|
+
const {
|
|
46
|
+
canAdd,
|
|
47
|
+
disabled,
|
|
48
|
+
fieldPathId,
|
|
49
|
+
uiSchema,
|
|
50
|
+
items,
|
|
51
|
+
optionalDataControl,
|
|
52
|
+
onAddClick,
|
|
53
|
+
readonly,
|
|
54
|
+
registry,
|
|
55
|
+
required,
|
|
56
|
+
schema,
|
|
57
|
+
title
|
|
58
|
+
} = props;
|
|
46
59
|
const uiOptions = utils.getUiOptions(uiSchema);
|
|
47
60
|
const ArrayFieldDescriptionTemplate = utils.getTemplate(
|
|
48
61
|
"ArrayFieldDescriptionTemplate",
|
|
49
62
|
registry,
|
|
50
63
|
uiOptions
|
|
51
64
|
);
|
|
52
|
-
const ArrayFieldItemTemplate2 = utils.getTemplate(
|
|
53
|
-
"ArrayFieldItemTemplate",
|
|
54
|
-
registry,
|
|
55
|
-
uiOptions
|
|
56
|
-
);
|
|
57
65
|
const ArrayFieldTitleTemplate = utils.getTemplate(
|
|
58
66
|
"ArrayFieldTitleTemplate",
|
|
59
67
|
registry,
|
|
60
68
|
uiOptions
|
|
61
69
|
);
|
|
70
|
+
const showOptionalDataControlInTitle = !readonly && !disabled;
|
|
62
71
|
const {
|
|
63
72
|
ButtonTemplates: { AddButton: AddButton2 }
|
|
64
73
|
} = registry.templates;
|
|
@@ -66,18 +75,19 @@
|
|
|
66
75
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
67
76
|
ArrayFieldTitleTemplate,
|
|
68
77
|
{
|
|
69
|
-
|
|
78
|
+
fieldPathId,
|
|
70
79
|
title: uiOptions.title || title,
|
|
71
80
|
schema,
|
|
72
81
|
uiSchema,
|
|
73
82
|
required,
|
|
74
|
-
registry
|
|
83
|
+
registry,
|
|
84
|
+
optionalDataControl: showOptionalDataControlInTitle ? optionalDataControl : void 0
|
|
75
85
|
}
|
|
76
86
|
),
|
|
77
87
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
78
88
|
ArrayFieldDescriptionTemplate,
|
|
79
89
|
{
|
|
80
|
-
|
|
90
|
+
fieldPathId,
|
|
81
91
|
description: uiOptions.description || schema.description,
|
|
82
92
|
schema,
|
|
83
93
|
uiSchema,
|
|
@@ -85,13 +95,14 @@
|
|
|
85
95
|
}
|
|
86
96
|
),
|
|
87
97
|
/* @__PURE__ */ jsxRuntime.jsxs(Container, { fluid: true, className: "p-0 m-0", children: [
|
|
88
|
-
|
|
98
|
+
!showOptionalDataControlInTitle ? optionalDataControl : void 0,
|
|
99
|
+
items,
|
|
89
100
|
canAdd && /* @__PURE__ */ jsxRuntime.jsx(Container, { className: "", children: /* @__PURE__ */ jsxRuntime.jsxs(Row2, { className: "mt-2", children: [
|
|
90
101
|
/* @__PURE__ */ jsxRuntime.jsx(Col2, { xs: 9 }),
|
|
91
102
|
/* @__PURE__ */ jsxRuntime.jsx(Col2, { xs: 3, className: "py-4 col-lg-3 col-3", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
92
103
|
AddButton2,
|
|
93
104
|
{
|
|
94
|
-
id: utils.buttonId(
|
|
105
|
+
id: utils.buttonId(fieldPathId, "add"),
|
|
95
106
|
className: "rjsf-array-item-add",
|
|
96
107
|
onClick: onAddClick,
|
|
97
108
|
disabled: disabled || readonly,
|
|
@@ -100,11 +111,12 @@
|
|
|
100
111
|
}
|
|
101
112
|
) })
|
|
102
113
|
] }) })
|
|
103
|
-
] }, `array-item-list-${
|
|
114
|
+
] }, `array-item-list-${fieldPathId.$id}`)
|
|
104
115
|
] }) }) });
|
|
105
116
|
}
|
|
106
117
|
function BaseInputTemplate({
|
|
107
118
|
id,
|
|
119
|
+
htmlName,
|
|
108
120
|
placeholder,
|
|
109
121
|
required,
|
|
110
122
|
readonly,
|
|
@@ -134,7 +146,7 @@
|
|
|
134
146
|
Form3.Control,
|
|
135
147
|
{
|
|
136
148
|
id,
|
|
137
|
-
name: id,
|
|
149
|
+
name: htmlName || id,
|
|
138
150
|
placeholder,
|
|
139
151
|
autoFocus: autofocus,
|
|
140
152
|
required,
|
|
@@ -204,28 +216,28 @@
|
|
|
204
216
|
IconButton,
|
|
205
217
|
{
|
|
206
218
|
title: translateString(utils.TranslatableString.RemoveButton),
|
|
207
|
-
...props,
|
|
208
219
|
variant: "danger",
|
|
220
|
+
...props,
|
|
209
221
|
icon: /* @__PURE__ */ jsxRuntime.jsx(IoIosRemove.IoIosRemove, {})
|
|
210
222
|
}
|
|
211
223
|
);
|
|
212
224
|
}
|
|
213
225
|
function FieldErrorTemplate(props) {
|
|
214
|
-
const { errors = [],
|
|
226
|
+
const { errors = [], fieldPathId } = props;
|
|
215
227
|
if (errors.length === 0) {
|
|
216
228
|
return null;
|
|
217
229
|
}
|
|
218
|
-
const id = utils.errorId(
|
|
230
|
+
const id = utils.errorId(fieldPathId);
|
|
219
231
|
return /* @__PURE__ */ jsxRuntime.jsx(ListGroup, { as: "ul", id, children: errors.map((error, i) => {
|
|
220
232
|
return /* @__PURE__ */ jsxRuntime.jsx(ListGroup.Item, { as: "li", className: "border-0 m-0 p-0", children: /* @__PURE__ */ jsxRuntime.jsx("small", { className: "m-0 text-danger", children: error }) }, i);
|
|
221
233
|
}) });
|
|
222
234
|
}
|
|
223
235
|
function FieldHelpTemplate(props) {
|
|
224
|
-
const {
|
|
236
|
+
const { fieldPathId, help, hasErrors } = props;
|
|
225
237
|
if (!help) {
|
|
226
238
|
return null;
|
|
227
239
|
}
|
|
228
|
-
const id = utils.helpId(
|
|
240
|
+
const id = utils.helpId(fieldPathId);
|
|
229
241
|
return /* @__PURE__ */ jsxRuntime.jsx(Form3.Text, { className: hasErrors ? "text-danger" : "text-muted", id, children: help });
|
|
230
242
|
}
|
|
231
243
|
function FieldTemplate({
|
|
@@ -242,8 +254,9 @@
|
|
|
242
254
|
disabled,
|
|
243
255
|
label,
|
|
244
256
|
hidden,
|
|
245
|
-
|
|
246
|
-
|
|
257
|
+
onKeyRename,
|
|
258
|
+
onKeyRenameBlur,
|
|
259
|
+
onRemoveProperty,
|
|
247
260
|
readonly,
|
|
248
261
|
required,
|
|
249
262
|
schema,
|
|
@@ -267,8 +280,9 @@
|
|
|
267
280
|
disabled,
|
|
268
281
|
id,
|
|
269
282
|
label,
|
|
270
|
-
|
|
271
|
-
|
|
283
|
+
onKeyRename,
|
|
284
|
+
onKeyRenameBlur,
|
|
285
|
+
onRemoveProperty,
|
|
272
286
|
readonly,
|
|
273
287
|
required,
|
|
274
288
|
schema,
|
|
@@ -294,16 +308,23 @@
|
|
|
294
308
|
}
|
|
295
309
|
return /* @__PURE__ */ jsxRuntime.jsx(Row2, { ...rest, children });
|
|
296
310
|
}
|
|
311
|
+
function MultiSchemaFieldTemplate({ selector, optionSchemaField }) {
|
|
312
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(Card, { style: { marginBottom: "1rem" }, children: [
|
|
313
|
+
/* @__PURE__ */ jsxRuntime.jsx(Card.Body, { children: selector }),
|
|
314
|
+
/* @__PURE__ */ jsxRuntime.jsx(Card.Body, { children: optionSchemaField })
|
|
315
|
+
] });
|
|
316
|
+
}
|
|
297
317
|
function ObjectFieldTemplate({
|
|
298
318
|
description,
|
|
299
319
|
title,
|
|
300
320
|
properties,
|
|
301
321
|
required,
|
|
302
322
|
uiSchema,
|
|
303
|
-
|
|
323
|
+
fieldPathId,
|
|
304
324
|
schema,
|
|
305
325
|
formData,
|
|
306
|
-
|
|
326
|
+
optionalDataControl,
|
|
327
|
+
onAddProperty,
|
|
307
328
|
disabled,
|
|
308
329
|
readonly,
|
|
309
330
|
registry
|
|
@@ -315,6 +336,7 @@
|
|
|
315
336
|
registry,
|
|
316
337
|
uiOptions
|
|
317
338
|
);
|
|
339
|
+
const showOptionalDataControlInTitle = !readonly && !disabled;
|
|
318
340
|
const {
|
|
319
341
|
ButtonTemplates: { AddButton: AddButton2 }
|
|
320
342
|
} = registry.templates;
|
|
@@ -322,18 +344,19 @@
|
|
|
322
344
|
title && /* @__PURE__ */ jsxRuntime.jsx(
|
|
323
345
|
TitleFieldTemplate,
|
|
324
346
|
{
|
|
325
|
-
id: utils.titleId(
|
|
347
|
+
id: utils.titleId(fieldPathId),
|
|
326
348
|
title,
|
|
327
349
|
required,
|
|
328
350
|
schema,
|
|
329
351
|
uiSchema,
|
|
330
|
-
registry
|
|
352
|
+
registry,
|
|
353
|
+
optionalDataControl: showOptionalDataControlInTitle ? optionalDataControl : void 0
|
|
331
354
|
}
|
|
332
355
|
),
|
|
333
356
|
description && /* @__PURE__ */ jsxRuntime.jsx(
|
|
334
357
|
DescriptionFieldTemplate,
|
|
335
358
|
{
|
|
336
|
-
id: utils.descriptionId(
|
|
359
|
+
id: utils.descriptionId(fieldPathId),
|
|
337
360
|
description,
|
|
338
361
|
schema,
|
|
339
362
|
uiSchema,
|
|
@@ -341,6 +364,7 @@
|
|
|
341
364
|
}
|
|
342
365
|
),
|
|
343
366
|
/* @__PURE__ */ jsxRuntime.jsxs(Container, { fluid: true, className: "p-0", children: [
|
|
367
|
+
!showOptionalDataControlInTitle ? optionalDataControl : void 0,
|
|
344
368
|
properties.map((element, index) => /* @__PURE__ */ jsxRuntime.jsx(Row2, { style: { marginBottom: "10px" }, className: element.hidden ? "d-none" : void 0, children: /* @__PURE__ */ jsxRuntime.jsxs(Col2, { xs: 12, children: [
|
|
345
369
|
" ",
|
|
346
370
|
element.content
|
|
@@ -348,8 +372,8 @@
|
|
|
348
372
|
utils.canExpand(schema, uiSchema, formData) ? /* @__PURE__ */ jsxRuntime.jsx(Row2, { children: /* @__PURE__ */ jsxRuntime.jsx(Col2, { xs: { offset: 9, span: 3 }, className: "py-4", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
349
373
|
AddButton2,
|
|
350
374
|
{
|
|
351
|
-
id: utils.buttonId(
|
|
352
|
-
onClick:
|
|
375
|
+
id: utils.buttonId(fieldPathId, "add"),
|
|
376
|
+
onClick: onAddProperty,
|
|
353
377
|
disabled: disabled || readonly,
|
|
354
378
|
className: "rjsf-object-property-expand",
|
|
355
379
|
uiSchema,
|
|
@@ -359,6 +383,38 @@
|
|
|
359
383
|
] })
|
|
360
384
|
] });
|
|
361
385
|
}
|
|
386
|
+
function OptionalDataControlsTemplate(props) {
|
|
387
|
+
const { id, registry, label, onAddClick, onRemoveClick } = props;
|
|
388
|
+
if (onAddClick) {
|
|
389
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
390
|
+
IconButton,
|
|
391
|
+
{
|
|
392
|
+
id,
|
|
393
|
+
registry,
|
|
394
|
+
className: "rjsf-add-optional-data",
|
|
395
|
+
icon: /* @__PURE__ */ jsxRuntime.jsx(BsPlus.BsPlus, {}),
|
|
396
|
+
onClick: onAddClick,
|
|
397
|
+
title: label,
|
|
398
|
+
size: "sm",
|
|
399
|
+
variant: "secondary"
|
|
400
|
+
}
|
|
401
|
+
);
|
|
402
|
+
} else if (onRemoveClick) {
|
|
403
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
404
|
+
RemoveButton,
|
|
405
|
+
{
|
|
406
|
+
id,
|
|
407
|
+
registry,
|
|
408
|
+
className: "rjsf-remove-optional-data",
|
|
409
|
+
onClick: onRemoveClick,
|
|
410
|
+
title: label,
|
|
411
|
+
size: "sm",
|
|
412
|
+
variant: "secondary"
|
|
413
|
+
}
|
|
414
|
+
);
|
|
415
|
+
}
|
|
416
|
+
return /* @__PURE__ */ jsxRuntime.jsx("em", { id, children: label });
|
|
417
|
+
}
|
|
362
418
|
function SubmitButton(props) {
|
|
363
419
|
const { submitText, norender, props: submitButtonProps } = utils.getSubmitButtonOptions(props.uiSchema);
|
|
364
420
|
if (norender) {
|
|
@@ -369,12 +425,20 @@
|
|
|
369
425
|
function TitleField({
|
|
370
426
|
id,
|
|
371
427
|
title,
|
|
372
|
-
uiSchema
|
|
428
|
+
uiSchema,
|
|
429
|
+
optionalDataControl
|
|
373
430
|
}) {
|
|
374
431
|
const uiOptions = utils.getUiOptions(uiSchema);
|
|
432
|
+
let heading = /* @__PURE__ */ jsxRuntime.jsx("h5", { children: uiOptions.title || title });
|
|
433
|
+
if (optionalDataControl) {
|
|
434
|
+
heading = /* @__PURE__ */ jsxRuntime.jsx(Container, { fluid: true, className: "p-0", children: /* @__PURE__ */ jsxRuntime.jsxs(Row2, { children: [
|
|
435
|
+
/* @__PURE__ */ jsxRuntime.jsx(Col2, { xs: "11", children: heading }),
|
|
436
|
+
/* @__PURE__ */ jsxRuntime.jsx(Col2, { xs: "1", style: { marginLeft: "-5px" }, children: optionalDataControl })
|
|
437
|
+
] }) });
|
|
438
|
+
}
|
|
375
439
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { id, className: "my-1", children: [
|
|
376
|
-
|
|
377
|
-
/* @__PURE__ */ jsxRuntime.jsx("hr", { className: "border-0 bg-secondary", style: { height: "1px" } })
|
|
440
|
+
heading,
|
|
441
|
+
/* @__PURE__ */ jsxRuntime.jsx("hr", { className: "border-0 bg-secondary mt-0", style: { height: "1px" } })
|
|
378
442
|
] });
|
|
379
443
|
}
|
|
380
444
|
function WrapIfAdditionalTemplate({
|
|
@@ -384,8 +448,8 @@
|
|
|
384
448
|
disabled,
|
|
385
449
|
id,
|
|
386
450
|
label,
|
|
387
|
-
|
|
388
|
-
|
|
451
|
+
onRemoveProperty,
|
|
452
|
+
onKeyRenameBlur,
|
|
389
453
|
readonly,
|
|
390
454
|
required,
|
|
391
455
|
schema,
|
|
@@ -399,7 +463,6 @@
|
|
|
399
463
|
if (!additional) {
|
|
400
464
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: classNames, style, children });
|
|
401
465
|
}
|
|
402
|
-
const handleBlur = ({ target }) => onKeyChange(target.value);
|
|
403
466
|
const keyId = `${id}-key`;
|
|
404
467
|
return /* @__PURE__ */ jsxRuntime.jsxs(Row2, { className: classNames, style, children: [
|
|
405
468
|
/* @__PURE__ */ jsxRuntime.jsx(Col2, { xs: 5, children: /* @__PURE__ */ jsxRuntime.jsxs(Form3.Group, { children: [
|
|
@@ -412,7 +475,7 @@
|
|
|
412
475
|
disabled: disabled || readonly,
|
|
413
476
|
id: keyId,
|
|
414
477
|
name: keyId,
|
|
415
|
-
onBlur: !readonly ?
|
|
478
|
+
onBlur: !readonly ? onKeyRenameBlur : void 0,
|
|
416
479
|
type: "text"
|
|
417
480
|
}
|
|
418
481
|
)
|
|
@@ -424,7 +487,7 @@
|
|
|
424
487
|
id: utils.buttonId(id, "remove"),
|
|
425
488
|
className: "rjsf-object-property-remove w-100",
|
|
426
489
|
disabled: disabled || readonly,
|
|
427
|
-
onClick:
|
|
490
|
+
onClick: onRemoveProperty,
|
|
428
491
|
uiSchema,
|
|
429
492
|
registry
|
|
430
493
|
}
|
|
@@ -452,7 +515,9 @@
|
|
|
452
515
|
FieldHelpTemplate,
|
|
453
516
|
FieldTemplate,
|
|
454
517
|
GridTemplate,
|
|
518
|
+
MultiSchemaFieldTemplate,
|
|
455
519
|
ObjectFieldTemplate,
|
|
520
|
+
OptionalDataControlsTemplate,
|
|
456
521
|
TitleFieldTemplate: TitleField,
|
|
457
522
|
WrapIfAdditionalTemplate
|
|
458
523
|
};
|
|
@@ -461,6 +526,7 @@
|
|
|
461
526
|
function CheckboxWidget(props) {
|
|
462
527
|
const {
|
|
463
528
|
id,
|
|
529
|
+
htmlName,
|
|
464
530
|
value,
|
|
465
531
|
disabled,
|
|
466
532
|
readonly,
|
|
@@ -500,7 +566,7 @@
|
|
|
500
566
|
Form3.Check,
|
|
501
567
|
{
|
|
502
568
|
id,
|
|
503
|
-
name: id,
|
|
569
|
+
name: htmlName || id,
|
|
504
570
|
label: utils.labelValue(label, hideLabel || !label),
|
|
505
571
|
checked: typeof value === "undefined" ? false : value,
|
|
506
572
|
required,
|
|
@@ -514,7 +580,19 @@
|
|
|
514
580
|
)
|
|
515
581
|
] });
|
|
516
582
|
}
|
|
517
|
-
function CheckboxesWidget({
|
|
583
|
+
function CheckboxesWidget({
|
|
584
|
+
id,
|
|
585
|
+
htmlName,
|
|
586
|
+
disabled,
|
|
587
|
+
options,
|
|
588
|
+
value,
|
|
589
|
+
autofocus,
|
|
590
|
+
readonly,
|
|
591
|
+
required,
|
|
592
|
+
onChange,
|
|
593
|
+
onBlur,
|
|
594
|
+
onFocus
|
|
595
|
+
}) {
|
|
518
596
|
const { enumOptions, enumDisabled, inline, emptyValue } = options;
|
|
519
597
|
const checkboxesValues = Array.isArray(value) ? value : [value];
|
|
520
598
|
const _onChange = (index) => ({ target: { checked } }) => {
|
|
@@ -538,7 +616,7 @@
|
|
|
538
616
|
className: "bg-transparent border-0",
|
|
539
617
|
type: "checkbox",
|
|
540
618
|
id: utils.optionId(id, index),
|
|
541
|
-
name: id,
|
|
619
|
+
name: htmlName || id,
|
|
542
620
|
label: option.label,
|
|
543
621
|
autoFocus: autofocus && index === 0,
|
|
544
622
|
onChange: _onChange(index),
|
|
@@ -553,6 +631,7 @@
|
|
|
553
631
|
}
|
|
554
632
|
function RadioWidget({
|
|
555
633
|
id,
|
|
634
|
+
htmlName,
|
|
556
635
|
options,
|
|
557
636
|
value,
|
|
558
637
|
required,
|
|
@@ -576,7 +655,7 @@
|
|
|
576
655
|
inline,
|
|
577
656
|
label: option.label,
|
|
578
657
|
id: utils.optionId(id, index),
|
|
579
|
-
name: id,
|
|
658
|
+
name: htmlName || id,
|
|
580
659
|
type: "radio",
|
|
581
660
|
disabled: disabled || itemDisabled || readonly,
|
|
582
661
|
checked,
|
|
@@ -615,6 +694,7 @@
|
|
|
615
694
|
function SelectWidget({
|
|
616
695
|
schema,
|
|
617
696
|
id,
|
|
697
|
+
htmlName,
|
|
618
698
|
options,
|
|
619
699
|
required,
|
|
620
700
|
disabled,
|
|
@@ -643,7 +723,7 @@
|
|
|
643
723
|
FormSelect,
|
|
644
724
|
{
|
|
645
725
|
id,
|
|
646
|
-
name: id,
|
|
726
|
+
name: htmlName || id,
|
|
647
727
|
value: typeof selectedIndexes === "undefined" ? emptyValue : selectedIndexes,
|
|
648
728
|
required,
|
|
649
729
|
multiple,
|
|
@@ -675,6 +755,7 @@
|
|
|
675
755
|
}
|
|
676
756
|
function TextareaWidget({
|
|
677
757
|
id,
|
|
758
|
+
htmlName,
|
|
678
759
|
placeholder,
|
|
679
760
|
value,
|
|
680
761
|
required,
|
|
@@ -693,7 +774,7 @@
|
|
|
693
774
|
FormControl,
|
|
694
775
|
{
|
|
695
776
|
id,
|
|
696
|
-
name: id,
|
|
777
|
+
name: htmlName || id,
|
|
697
778
|
as: "textarea",
|
|
698
779
|
placeholder,
|
|
699
780
|
disabled,
|
|
@@ -4,6 +4,6 @@ import Button from 'react-bootstrap/Button';
|
|
|
4
4
|
import { BsPlus } from '@react-icons/all-files/bs/BsPlus';
|
|
5
5
|
export default function AddButton({ uiSchema, registry, ...props }) {
|
|
6
6
|
const { translateString } = registry;
|
|
7
|
-
return (_jsx(Button, { ...props, style: { width: '100%' }, className: `ml-1 ${props.className}`,
|
|
7
|
+
return (_jsx(Button, { title: translateString(TranslatableString.AddItemButton), ...props, style: { width: '100%' }, className: `ml-1 ${props.className}`, children: _jsx(BsPlus, {}) }));
|
|
8
8
|
}
|
|
9
9
|
//# sourceMappingURL=AddButton.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AddButton.js","sourceRoot":"","sources":["../../src/AddButton/AddButton.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAkE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AACjH,OAAO,MAAM,MAAM,wBAAwB,CAAC;AAC5C,OAAO,EAAE,MAAM,EAAE,MAAM,kCAAkC,CAAC;AAE1D,MAAM,CAAC,OAAO,UAAU,SAAS,CAAoF,EACnH,QAAQ,EACR,QAAQ,EACR,GAAG,KAAK,EACiB;IACzB,MAAM,EAAE,eAAe,EAAE,GAAG,QAAQ,CAAC;IACrC,OAAO,CACL,KAAC,MAAM,
|
|
1
|
+
{"version":3,"file":"AddButton.js","sourceRoot":"","sources":["../../src/AddButton/AddButton.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAkE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AACjH,OAAO,MAAM,MAAM,wBAAwB,CAAC;AAC5C,OAAO,EAAE,MAAM,EAAE,MAAM,kCAAkC,CAAC;AAE1D,MAAM,CAAC,OAAO,UAAU,SAAS,CAAoF,EACnH,QAAQ,EACR,QAAQ,EACR,GAAG,KAAK,EACiB;IACzB,MAAM,EAAE,eAAe,EAAE,GAAG,QAAQ,CAAC;IACrC,OAAO,CACL,KAAC,MAAM,IACL,KAAK,EAAE,eAAe,CAAC,kBAAkB,CAAC,aAAa,CAAC,KACpD,KAAK,EACT,KAAK,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,EACxB,SAAS,EAAE,QAAQ,KAAK,CAAC,SAAS,EAAE,YAEpC,KAAC,MAAM,KAAG,GACH,CACV,CAAC;AACJ,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export default function ArrayFieldItemTemplate<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>(props:
|
|
1
|
+
import { ArrayFieldItemTemplateProps, FormContextType, RJSFSchema, StrictRJSFSchema } from '@rjsf/utils';
|
|
2
|
+
export default function ArrayFieldItemTemplate<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>(props: ArrayFieldItemTemplateProps<T, S, F>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ArrayFieldItemTemplate.js","sourceRoot":"","sources":["../../src/ArrayFieldItemTemplate/ArrayFieldItemTemplate.tsx"],"names":[],"mappings":";AACA,OAAO,GAAG,MAAM,qBAAqB,CAAC;AACtC,OAAO,GAAG,MAAM,qBAAqB,CAAC;AACtC,OAAO,EAGL,WAAW,EACX,YAAY,GAGb,MAAM,aAAa,CAAC;AAErB,MAAM,CAAC,OAAO,UAAU,sBAAsB,CAI5C,
|
|
1
|
+
{"version":3,"file":"ArrayFieldItemTemplate.js","sourceRoot":"","sources":["../../src/ArrayFieldItemTemplate/ArrayFieldItemTemplate.tsx"],"names":[],"mappings":";AACA,OAAO,GAAG,MAAM,qBAAqB,CAAC;AACtC,OAAO,GAAG,MAAM,qBAAqB,CAAC;AACtC,OAAO,EAGL,WAAW,EACX,YAAY,GAGb,MAAM,aAAa,CAAC;AAErB,MAAM,CAAC,OAAO,UAAU,sBAAsB,CAI5C,KAA2C;IAC3C,MAAM,EAAE,QAAQ,EAAE,YAAY,EAAE,UAAU,EAAE,QAAQ,EAAE,QAAQ,EAAE,GAAG,KAAK,CAAC;IACzE,MAAM,SAAS,GAAG,YAAY,CAAU,QAAQ,CAAC,CAAC;IAClD,MAAM,6BAA6B,GAAG,WAAW,CAC/C,+BAA+B,EAC/B,QAAQ,EACR,SAAS,CACV,CAAC;IACF,MAAM,QAAQ,GAAkB;QAC9B,IAAI,EAAE,CAAC;QACP,WAAW,EAAE,CAAC;QACd,YAAY,EAAE,CAAC;QACf,UAAU,EAAE,MAAM;KACnB,CAAC;IACF,OAAO,CACL,wBACE,MAAC,GAAG,IAAC,SAAS,EAAC,iCAAiC,aAC9C,KAAC,GAAG,IAAC,EAAE,EAAC,GAAG,EAAC,EAAE,EAAC,GAAG,YACf,QAAQ,GACL,EACN,KAAC,GAAG,IAAC,EAAE,EAAC,GAAG,EAAC,EAAE,EAAC,GAAG,EAAC,SAAS,EAAC,MAAM,YAChC,UAAU,IAAI,CACb,cAAK,SAAS,EAAC,iBAAiB,YAC9B,KAAC,6BAA6B,OAAK,YAAY,EAAE,KAAK,EAAE,QAAQ,GAAI,GAChE,CACP,GACG,IACF,GACF,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -4,14 +4,13 @@ import Col from 'react-bootstrap/Col';
|
|
|
4
4
|
import Container from 'react-bootstrap/Container';
|
|
5
5
|
import { buttonId, getTemplate, getUiOptions, } from '@rjsf/utils';
|
|
6
6
|
export default function ArrayFieldTemplate(props) {
|
|
7
|
-
const { canAdd, disabled,
|
|
7
|
+
const { canAdd, disabled, fieldPathId, uiSchema, items, optionalDataControl, onAddClick, readonly, registry, required, schema, title, } = props;
|
|
8
8
|
const uiOptions = getUiOptions(uiSchema);
|
|
9
9
|
const ArrayFieldDescriptionTemplate = getTemplate('ArrayFieldDescriptionTemplate', registry, uiOptions);
|
|
10
|
-
const ArrayFieldItemTemplate = getTemplate('ArrayFieldItemTemplate', registry, uiOptions);
|
|
11
10
|
const ArrayFieldTitleTemplate = getTemplate('ArrayFieldTitleTemplate', registry, uiOptions);
|
|
11
|
+
const showOptionalDataControlInTitle = !readonly && !disabled;
|
|
12
12
|
// Button templates are not overridden in the uiSchema
|
|
13
13
|
const { ButtonTemplates: { AddButton }, } = registry.templates;
|
|
14
|
-
return (_jsx("div", { children: _jsx(Row, { className: 'p-0 m-0', children: _jsxs(Col, { className: 'p-0 m-0', children: [_jsx(ArrayFieldTitleTemplate, {
|
|
15
|
-
items.map(({ key, ...itemProps }) => (_jsx(ArrayFieldItemTemplate, { ...itemProps }, key))), canAdd && (_jsx(Container, { className: '', children: _jsxs(Row, { className: 'mt-2', children: [_jsx(Col, { xs: 9 }), _jsx(Col, { xs: 3, className: 'py-4 col-lg-3 col-3', children: _jsx(AddButton, { id: buttonId(idSchema, 'add'), className: 'rjsf-array-item-add', onClick: onAddClick, disabled: disabled || readonly, uiSchema: uiSchema, registry: registry }) })] }) }))] }, `array-item-list-${idSchema.$id}`)] }) }) }));
|
|
14
|
+
return (_jsx("div", { children: _jsx(Row, { className: 'p-0 m-0', children: _jsxs(Col, { className: 'p-0 m-0', children: [_jsx(ArrayFieldTitleTemplate, { fieldPathId: fieldPathId, title: uiOptions.title || title, schema: schema, uiSchema: uiSchema, required: required, registry: registry, optionalDataControl: showOptionalDataControlInTitle ? optionalDataControl : undefined }), _jsx(ArrayFieldDescriptionTemplate, { fieldPathId: fieldPathId, description: uiOptions.description || schema.description, schema: schema, uiSchema: uiSchema, registry: registry }), _jsxs(Container, { fluid: true, className: 'p-0 m-0', children: [!showOptionalDataControlInTitle ? optionalDataControl : undefined, items, canAdd && (_jsx(Container, { className: '', children: _jsxs(Row, { className: 'mt-2', children: [_jsx(Col, { xs: 9 }), _jsx(Col, { xs: 3, className: 'py-4 col-lg-3 col-3', children: _jsx(AddButton, { id: buttonId(fieldPathId, 'add'), className: 'rjsf-array-item-add', onClick: onAddClick, disabled: disabled || readonly, uiSchema: uiSchema, registry: registry }) })] }) }))] }, `array-item-list-${fieldPathId.$id}`)] }) }) }));
|
|
16
15
|
}
|
|
17
16
|
//# sourceMappingURL=ArrayFieldTemplate.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ArrayFieldTemplate.js","sourceRoot":"","sources":["../../src/ArrayFieldTemplate/ArrayFieldTemplate.tsx"],"names":[],"mappings":";AAAA,OAAO,GAAG,MAAM,qBAAqB,CAAC;AACtC,OAAO,GAAG,MAAM,qBAAqB,CAAC;AACtC,OAAO,SAAS,MAAM,2BAA2B,CAAC;AAClD,OAAO,
|
|
1
|
+
{"version":3,"file":"ArrayFieldTemplate.js","sourceRoot":"","sources":["../../src/ArrayFieldTemplate/ArrayFieldTemplate.tsx"],"names":[],"mappings":";AAAA,OAAO,GAAG,MAAM,qBAAqB,CAAC;AACtC,OAAO,GAAG,MAAM,qBAAqB,CAAC;AACtC,OAAO,SAAS,MAAM,2BAA2B,CAAC;AAClD,OAAO,EAEL,QAAQ,EAER,WAAW,EACX,YAAY,GAGb,MAAM,aAAa,CAAC;AAErB,MAAM,CAAC,OAAO,UAAU,kBAAkB,CAIxC,KAAuC;IACvC,MAAM,EACJ,MAAM,EACN,QAAQ,EACR,WAAW,EACX,QAAQ,EACR,KAAK,EACL,mBAAmB,EACnB,UAAU,EACV,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,MAAM,EACN,KAAK,GACN,GAAG,KAAK,CAAC;IACV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AAQ,EAClB,KAAC,GAAG,IAAC,EAAE,EAAE,CAAC,EAAE,SAAS,EAAC,qBAAqB,YACzC,KAAC,SAAS,IACR,EAAE,EAAE,QAAQ,CAAC,WAAW,EAAE,KAAK,CAAC,EAChC,SAAS,EAAC,qBAAqB,EAC/B,OAAO,EAAE,UAAU,EACnB,QAAQ,EAAE,QAAQ,IAAI,QAAQ,EAC9B,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,QAAQ,GAClB,GACE,IACF,GACI,CACb,KAnBmB,mBAAmB,WAAW,CAAC,GAAG,EAAE,CAoB9C,IACR,GACF,GACF,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { BaseInputTemplateProps, FormContextType, RJSFSchema, StrictRJSFSchema } from '@rjsf/utils';
|
|
2
|
-
export default function BaseInputTemplate<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>({ id, placeholder, required, readonly, disabled, type, value, onChange, onChangeOverride, onBlur, onFocus, autofocus, options, schema, rawErrors, children, extraProps, }: BaseInputTemplateProps<T, S, F>): import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
export default function BaseInputTemplate<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>({ id, htmlName, placeholder, required, readonly, disabled, type, value, onChange, onChangeOverride, onBlur, onFocus, autofocus, options, schema, rawErrors, children, extraProps, }: BaseInputTemplateProps<T, S, F>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import Form from 'react-bootstrap/Form';
|
|
3
3
|
import { ariaDescribedByIds, examplesId, getInputProps, } from '@rjsf/utils';
|
|
4
|
-
export default function BaseInputTemplate({ id, placeholder, required, readonly, disabled, type, value, onChange, onChangeOverride, onBlur, onFocus, autofocus, options, schema, rawErrors = [], children, extraProps, }) {
|
|
4
|
+
export default function BaseInputTemplate({ id, htmlName, placeholder, required, readonly, disabled, type, value, onChange, onChangeOverride, onBlur, onFocus, autofocus, options, schema, rawErrors = [], children, extraProps, }) {
|
|
5
5
|
const inputProps = {
|
|
6
6
|
...extraProps,
|
|
7
7
|
...getInputProps(schema, type, options),
|
|
@@ -10,7 +10,7 @@ export default function BaseInputTemplate({ id, placeholder, required, readonly,
|
|
|
10
10
|
const _onBlur = ({ target }) => onBlur(id, target && target.value);
|
|
11
11
|
const _onFocus = ({ target }) => onFocus(id, target && target.value);
|
|
12
12
|
// const classNames = [rawErrors.length > 0 ? "is-invalid" : "", type === 'file' ? 'custom-file-label': ""]
|
|
13
|
-
return (_jsxs(_Fragment, { children: [_jsx(Form.Control, { id: id, name: id, placeholder: placeholder, autoFocus: autofocus, required: required, disabled: disabled, readOnly: readonly, className: rawErrors.length > 0 ? 'is-invalid' : '', list: schema.examples ? examplesId(id) : undefined, ...inputProps, value: value || value === 0 ? value : '', onChange: onChangeOverride || _onChange, onBlur: _onBlur, onFocus: _onFocus, "aria-describedby": ariaDescribedByIds(id, !!schema.examples) }), children, Array.isArray(schema.examples) ? (_jsx("datalist", { id: examplesId(id), children: schema.examples
|
|
13
|
+
return (_jsxs(_Fragment, { children: [_jsx(Form.Control, { id: id, name: htmlName || id, placeholder: placeholder, autoFocus: autofocus, required: required, disabled: disabled, readOnly: readonly, className: rawErrors.length > 0 ? 'is-invalid' : '', list: schema.examples ? examplesId(id) : undefined, ...inputProps, value: value || value === 0 ? value : '', onChange: onChangeOverride || _onChange, onBlur: _onBlur, onFocus: _onFocus, "aria-describedby": ariaDescribedByIds(id, !!schema.examples) }), children, Array.isArray(schema.examples) ? (_jsx("datalist", { id: examplesId(id), children: schema.examples
|
|
14
14
|
.concat(schema.default && !schema.examples.includes(schema.default) ? [schema.default] : [])
|
|
15
15
|
.map((example) => {
|
|
16
16
|
return _jsx("option", { value: example }, example);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BaseInputTemplate.js","sourceRoot":"","sources":["../../src/BaseInputTemplate/BaseInputTemplate.tsx"],"names":[],"mappings":";AACA,OAAO,IAAI,MAAM,sBAAsB,CAAC;AACxC,OAAO,EACL,kBAAkB,EAElB,UAAU,EAEV,aAAa,GAGd,MAAM,aAAa,CAAC;AAErB,MAAM,CAAC,OAAO,UAAU,iBAAiB,CAIvC,EACA,EAAE,EACF,WAAW,EACX,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,IAAI,EACJ,KAAK,EACL,QAAQ,EACR,gBAAgB,EAChB,MAAM,EACN,OAAO,EACP,SAAS,EACT,OAAO,EACP,MAAM,EACN,SAAS,GAAG,EAAE,EACd,QAAQ,EACR,UAAU,GACsB;IAChC,MAAM,UAAU,GAAG;QACjB,GAAG,UAAU;QACb,GAAG,aAAa,CAAU,MAAM,EAAE,IAAI,EAAE,OAAO,CAAC;KACjD,CAAC;IACF,MAAM,SAAS,GAAG,CAAC,EAAE,MAAM,EAAE,EAAE,KAAK,EAAE,EAAiC,EAAE,EAAE,CACzE,QAAQ,CAAC,KAAK,KAAK,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;IACtD,MAAM,OAAO,GAAG,CAAC,EAAE,MAAM,EAAgC,EAAE,EAAE,CAAC,MAAM,CAAC,EAAE,EAAE,MAAM,IAAI,MAAM,CAAC,KAAK,CAAC,CAAC;IACjG,MAAM,QAAQ,GAAG,CAAC,EAAE,MAAM,EAAgC,EAAE,EAAE,CAAC,OAAO,CAAC,EAAE,EAAE,MAAM,IAAI,MAAM,CAAC,KAAK,CAAC,CAAC;IAEnG,2GAA2G;IAC3G,OAAO,CACL,8BACE,KAAC,IAAI,CAAC,OAAO,IACX,EAAE,EAAE,EAAE,EACN,IAAI,EAAE,EAAE,
|
|
1
|
+
{"version":3,"file":"BaseInputTemplate.js","sourceRoot":"","sources":["../../src/BaseInputTemplate/BaseInputTemplate.tsx"],"names":[],"mappings":";AAC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C,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,EAAE,EACnD,IAAI,EAAE,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,SAAS,KAC9C,UAAU,EACd,KAAK,EAAE,KAAK,IAAI,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EACxC,QAAQ,EAAE,gBAAgB,IAAI,SAAS,EACvC,MAAM,EAAE,OAAO,EACf,OAAO,EAAE,QAAQ,sBACC,kBAAkB,CAAC,EAAE,EAAE,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,GAC3D,EACD,QAAQ,EACR,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAChC,mBAAU,EAAE,EAAE,UAAU,CAAC,EAAE,CAAC,YACxB,MAAM,CAAC,QAAqB;qBAC3B,MAAM,CAAC,MAAM,CAAC,OAAO,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,CAAE,CAAC,MAAM,CAAC,OAAO,CAAc,CAAC,CAAC,CAAC,EAAE,CAAC;qBACzG,GAAG,CAAC,CAAC,OAAY,EAAE,EAAE;oBACpB,OAAO,iBAAsB,KAAK,EAAE,OAAO,IAAvB,OAAO,CAAoB,CAAC;gBAClD,CAAC,CAAC,GACK,CACZ,CAAC,CAAC,CAAC,IAAI,IACP,CACJ,CAAC;AACJ,CAAC"}
|
|
@@ -2,7 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { ariaDescribedByIds, descriptionId, getTemplate, labelValue, schemaRequiresTrueValue, } from '@rjsf/utils';
|
|
3
3
|
import Form from 'react-bootstrap/Form';
|
|
4
4
|
export default function CheckboxWidget(props) {
|
|
5
|
-
const { id, value, disabled, readonly, label, hideLabel, schema, autofocus, options, onChange, onBlur, onFocus, registry, uiSchema, } = props;
|
|
5
|
+
const { id, htmlName, value, disabled, readonly, label, hideLabel, schema, autofocus, options, onChange, onBlur, onFocus, registry, uiSchema, } = props;
|
|
6
6
|
// Because an unchecked checkbox will cause html5 validation to fail, only add
|
|
7
7
|
// the "required" attribute if the field value must be "true", due to the
|
|
8
8
|
// "const" or "enum" keywords
|
|
@@ -12,6 +12,6 @@ export default function CheckboxWidget(props) {
|
|
|
12
12
|
const _onBlur = ({ target }) => onBlur(id, target && target.checked);
|
|
13
13
|
const _onFocus = ({ target }) => onFocus(id, target && target.checked);
|
|
14
14
|
const description = options.description || schema.description;
|
|
15
|
-
return (_jsxs(Form.Group, { className: disabled || readonly ? 'disabled' : '', "aria-describedby": ariaDescribedByIds(id), children: [!hideLabel && description && (_jsx(DescriptionFieldTemplate, { id: descriptionId(id), description: description, schema: schema, uiSchema: uiSchema, registry: registry })), _jsx(Form.Check, { id: id, name: id, label: labelValue(label, hideLabel || !label), checked: typeof value === 'undefined' ? false : value, required: required, disabled: disabled || readonly, autoFocus: autofocus, onChange: _onChange, type: 'checkbox', onBlur: _onBlur, onFocus: _onFocus })] }));
|
|
15
|
+
return (_jsxs(Form.Group, { className: disabled || readonly ? 'disabled' : '', "aria-describedby": ariaDescribedByIds(id), children: [!hideLabel && description && (_jsx(DescriptionFieldTemplate, { id: descriptionId(id), description: description, schema: schema, uiSchema: uiSchema, registry: registry })), _jsx(Form.Check, { id: id, name: htmlName || id, label: labelValue(label, hideLabel || !label), checked: typeof value === 'undefined' ? false : value, required: required, disabled: disabled || readonly, autoFocus: autofocus, onChange: _onChange, type: 'checkbox', onBlur: _onBlur, onFocus: _onFocus })] }));
|
|
16
16
|
}
|
|
17
17
|
//# sourceMappingURL=CheckboxWidget.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CheckboxWidget.js","sourceRoot":"","sources":["../../src/CheckboxWidget/CheckboxWidget.tsx"],"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BAAoB,kBAAkB,CAAC,EAAE,CAAC,aACpG,CAAC,SAAS,IAAI,WAAW,IAAI,CAC5B,KAAC,wBAAwB,IACvB,EAAE,EAAE,aAAa,CAAC,EAAE,CAAC,EACrB,WAAW,EAAE,WAAW,EACxB,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,QAAQ,GAClB,CACH,EACD,KAAC,IAAI,CAAC,KAAK,IACT,EAAE,EAAE,EAAE,EACN,IAAI,EAAE,QAAQ,IAAI,EAAE,EACpB,KAAK,EAAE,UAAU,CAAC,KAAK,EAAE,SAAS,IAAI,CAAC,KAAK,CAAC,EAC7C,OAAO,EAAE,OAAO,KAAK,KAAK,WAAW,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,EACrD,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,QAAQ,IAAI,QAAQ,EAC9B,SAAS,EAAE,SAAS,EACpB,QAAQ,EAAE,SAAS,EACnB,IAAI,EAAC,UAAU,EACf,MAAM,EAAE,OAAO,EACf,OAAO,EAAE,QAAQ,GACjB,IACS,CACd,CAAC;AACJ,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { FormContextType, RJSFSchema, StrictRJSFSchema, WidgetProps } from '@rjsf/utils';
|
|
2
|
-
export default function CheckboxesWidget<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>({ id, disabled, options, value, autofocus, readonly, required, onChange, onBlur, onFocus }: WidgetProps<T, S, F>): import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
export default function CheckboxesWidget<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>({ id, htmlName, disabled, options, value, autofocus, readonly, required, onChange, onBlur, onFocus, }: WidgetProps<T, S, F>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import Form from 'react-bootstrap/Form';
|
|
3
3
|
import { ariaDescribedByIds, enumOptionsDeselectValue, enumOptionsIsSelected, enumOptionsSelectValue, enumOptionsValueForIndex, optionId, } from '@rjsf/utils';
|
|
4
|
-
export default function CheckboxesWidget({ id, disabled, options, value, autofocus, readonly, required, onChange, onBlur, onFocus }) {
|
|
4
|
+
export default function CheckboxesWidget({ id, htmlName, disabled, options, value, autofocus, readonly, required, onChange, onBlur, onFocus, }) {
|
|
5
5
|
const { enumOptions, enumDisabled, inline, emptyValue } = options;
|
|
6
6
|
const checkboxesValues = Array.isArray(value) ? value : [value];
|
|
7
7
|
const _onChange = (index) => ({ target: { checked } }) => {
|
|
@@ -18,7 +18,7 @@ export default function CheckboxesWidget({ id, disabled, options, value, autofoc
|
|
|
18
18
|
enumOptions.map((option, index) => {
|
|
19
19
|
const checked = enumOptionsIsSelected(option.value, checkboxesValues);
|
|
20
20
|
const itemDisabled = Array.isArray(enumDisabled) && enumDisabled.indexOf(option.value) !== -1;
|
|
21
|
-
return (_jsx(Form.Check, { inline: inline, required: required, checked: checked, className: 'bg-transparent border-0', type: 'checkbox', id: optionId(id, index), name: id, label: option.label, autoFocus: autofocus && index === 0, onChange: _onChange(index), onBlur: _onBlur, onFocus: _onFocus, disabled: disabled || itemDisabled || readonly, "aria-describedby": ariaDescribedByIds(id) }, option.value));
|
|
21
|
+
return (_jsx(Form.Check, { inline: inline, required: required, checked: checked, className: 'bg-transparent border-0', type: 'checkbox', id: optionId(id, index), name: htmlName || id, label: option.label, autoFocus: autofocus && index === 0, onChange: _onChange(index), onBlur: _onBlur, onFocus: _onFocus, disabled: disabled || itemDisabled || readonly, "aria-describedby": ariaDescribedByIds(id) }, option.value));
|
|
22
22
|
}) }));
|
|
23
23
|
}
|
|
24
24
|
//# sourceMappingURL=CheckboxesWidget.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CheckboxesWidget.js","sourceRoot":"","sources":["../../src/CheckboxesWidget/CheckboxesWidget.tsx"],"names":[],"mappings":";AACA,OAAO,IAAI,MAAM,sBAAsB,CAAC;AACxC,OAAO,EACL,kBAAkB,EAClB,wBAAwB,EACxB,qBAAqB,EACrB,sBAAsB,EACtB,wBAAwB,EACxB,QAAQ,GAKT,MAAM,aAAa,CAAC;AAErB,MAAM,CAAC,OAAO,UAAU,gBAAgB,CAItC,
|
|
1
|
+
{"version":3,"file":"CheckboxesWidget.js","sourceRoot":"","sources":["../../src/CheckboxesWidget/CheckboxesWidget.tsx"],"names":[],"mappings":";AACA,OAAO,IAAI,MAAM,sBAAsB,CAAC;AACxC,OAAO,EACL,kBAAkB,EAClB,wBAAwB,EACxB,qBAAqB,EACrB,sBAAsB,EACtB,wBAAwB,EACxB,QAAQ,GAKT,MAAM,aAAa,CAAC;AAErB,MAAM,CAAC,OAAO,UAAU,gBAAgB,CAItC,EACA,EAAE,EACF,QAAQ,EACR,QAAQ,EACR,OAAO,EACP,KAAK,EACL,SAAS,EACT,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,MAAM,EACN,OAAO,GACc;IACrB,MAAM,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,EAAE,UAAU,EAAE,GAAG,OAAO,CAAC;IAClE,MAAM,gBAAgB,GAAG,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;IAEhE,MAAM,SAAS,GACb,CAAC,KAAa,EAAE,EAAE,CAClB,CAAC,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,EAAiC,EAAE,EAAE;QACzD,IAAI,OAAO,EAAE,CAAC;YACZ,QAAQ,CAAC,sBAAsB,CAAI,KAAK,EAAE,gBAAgB,EAAE,WAAW,CAAC,CAAC,CAAC;QAC5E,CAAC;aAAM,CAAC;YACN,QAAQ,CAAC,wBAAwB,CAAI,KAAK,EAAE,gBAAgB,EAAE,WAAW,CAAC,CAAC,CAAC;QAC9E,CAAC;IACH,CAAC,CAAC;IAE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kB,CAAC,EAAE,CAAC,IAdnC,MAAM,CAAC,KAAK,CAejB,CACH,CAAC;YACJ,CAAC,CAAC,GACO,CACd,CAAC;AACJ,CAAC"}
|
|
@@ -6,11 +6,11 @@ import ListGroup from 'react-bootstrap/ListGroup';
|
|
|
6
6
|
* @param props - The `FieldErrorProps` for the errors being rendered
|
|
7
7
|
*/
|
|
8
8
|
export default function FieldErrorTemplate(props) {
|
|
9
|
-
const { errors = [],
|
|
9
|
+
const { errors = [], fieldPathId } = props;
|
|
10
10
|
if (errors.length === 0) {
|
|
11
11
|
return null;
|
|
12
12
|
}
|
|
13
|
-
const id = errorId(
|
|
13
|
+
const id = errorId(fieldPathId);
|
|
14
14
|
return (_jsx(ListGroup, { as: 'ul', id: id, children: errors.map((error, i) => {
|
|
15
15
|
return (_jsx(ListGroup.Item, { as: 'li', className: 'border-0 m-0 p-0', children: _jsx("small", { className: 'm-0 text-danger', children: error }) }, i));
|
|
16
16
|
}) }));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FieldErrorTemplate.js","sourceRoot":"","sources":["../../src/FieldErrorTemplate/FieldErrorTemplate.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAkE,OAAO,EAAE,MAAM,aAAa,CAAC;AACtG,OAAO,SAAS,MAAM,2BAA2B,CAAC;AAElD;;;GAGG;AACH,MAAM,CAAC,OAAO,UAAU,kBAAkB,CAIxC,KAA+B;IAC/B,MAAM,EAAE,MAAM,GAAG,EAAE,EAAE,
|
|
1
|
+
{"version":3,"file":"FieldErrorTemplate.js","sourceRoot":"","sources":["../../src/FieldErrorTemplate/FieldErrorTemplate.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAkE,OAAO,EAAE,MAAM,aAAa,CAAC;AACtG,OAAO,SAAS,MAAM,2BAA2B,CAAC;AAElD;;;GAGG;AACH,MAAM,CAAC,OAAO,UAAU,kBAAkB,CAIxC,KAA+B;IAC/B,MAAM,EAAE,MAAM,GAAG,EAAE,EAAE,WAAW,EAAE,GAAG,KAAK,CAAC;IAC3C,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACxB,OAAO,IAAI,CAAC;IACd,CAAC;IACD,MAAM,EAAE,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC;IAEhC,OAAO,CACL,KAAC,SAAS,IAAC,EAAE,EAAC,IAAI,EAAC,EAAE,EAAE,EAAE,YACtB,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,CAAC,EAAE,EAAE;YACvB,OAAO,CACL,KAAC,SAAS,CAAC,IAAI,IAAC,EAAE,EAAC,IAAI,EAAS,SAAS,EAAC,kBAAkB,YAC1D,gBAAO,SAAS,EAAC,iBAAiB,YAAE,KAAK,GAAS,IADvB,CAAC,CAEb,CAClB,CAAC;QACJ,CAAC,CAAC,GACQ,CACb,CAAC;AACJ,CAAC"}
|