@rjsf/react-bootstrap 6.0.0-beta.9 → 6.0.0

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.
Files changed (86) hide show
  1. package/README.md +2 -0
  2. package/dist/{index.js → index.cjs} +178 -86
  3. package/dist/index.cjs.map +7 -0
  4. package/dist/react-bootstrap.esm.js +177 -85
  5. package/dist/react-bootstrap.esm.js.map +4 -4
  6. package/dist/react-bootstrap.umd.js +125 -44
  7. package/lib/AddButton/AddButton.js +1 -1
  8. package/lib/AddButton/AddButton.js.map +1 -1
  9. package/lib/ArrayFieldItemTemplate/ArrayFieldItemTemplate.d.ts +2 -2
  10. package/lib/ArrayFieldItemTemplate/ArrayFieldItemTemplate.js.map +1 -1
  11. package/lib/ArrayFieldTemplate/ArrayFieldTemplate.js +3 -4
  12. package/lib/ArrayFieldTemplate/ArrayFieldTemplate.js.map +1 -1
  13. package/lib/BaseInputTemplate/BaseInputTemplate.d.ts +1 -1
  14. package/lib/BaseInputTemplate/BaseInputTemplate.js +2 -2
  15. package/lib/BaseInputTemplate/BaseInputTemplate.js.map +1 -1
  16. package/lib/CheckboxWidget/CheckboxWidget.js +2 -2
  17. package/lib/CheckboxWidget/CheckboxWidget.js.map +1 -1
  18. package/lib/CheckboxesWidget/CheckboxesWidget.d.ts +1 -1
  19. package/lib/CheckboxesWidget/CheckboxesWidget.js +2 -2
  20. package/lib/CheckboxesWidget/CheckboxesWidget.js.map +1 -1
  21. package/lib/FieldErrorTemplate/FieldErrorTemplate.js +2 -2
  22. package/lib/FieldErrorTemplate/FieldErrorTemplate.js.map +1 -1
  23. package/lib/FieldHelpTemplate/FieldHelpTemplate.js +2 -2
  24. package/lib/FieldHelpTemplate/FieldHelpTemplate.js.map +1 -1
  25. package/lib/FieldTemplate/FieldTemplate.d.ts +1 -1
  26. package/lib/FieldTemplate/FieldTemplate.js +2 -2
  27. package/lib/FieldTemplate/FieldTemplate.js.map +1 -1
  28. package/lib/IconButton/IconButton.d.ts +6 -5
  29. package/lib/IconButton/IconButton.js +1 -1
  30. package/lib/IconButton/IconButton.js.map +1 -1
  31. package/lib/MultiSchemaFieldTemplate/MultiSchemaFieldTemplate.d.ts +2 -0
  32. package/lib/MultiSchemaFieldTemplate/MultiSchemaFieldTemplate.js +6 -0
  33. package/lib/MultiSchemaFieldTemplate/MultiSchemaFieldTemplate.js.map +1 -0
  34. package/lib/MultiSchemaFieldTemplate/index.d.ts +2 -0
  35. package/lib/MultiSchemaFieldTemplate/index.js +3 -0
  36. package/lib/MultiSchemaFieldTemplate/index.js.map +1 -0
  37. package/lib/ObjectFieldTemplate/ObjectFieldTemplate.d.ts +1 -1
  38. package/lib/ObjectFieldTemplate/ObjectFieldTemplate.js +3 -2
  39. package/lib/ObjectFieldTemplate/ObjectFieldTemplate.js.map +1 -1
  40. package/lib/OptionalDataControlsTemplate/OptionalDataControlsTemplate.d.ts +10 -0
  41. package/lib/OptionalDataControlsTemplate/OptionalDataControlsTemplate.js +22 -0
  42. package/lib/OptionalDataControlsTemplate/OptionalDataControlsTemplate.js.map +1 -0
  43. package/lib/OptionalDataControlsTemplate/index.d.ts +2 -0
  44. package/lib/OptionalDataControlsTemplate/index.js +3 -0
  45. package/lib/OptionalDataControlsTemplate/index.js.map +1 -0
  46. package/lib/RadioWidget/RadioWidget.d.ts +1 -1
  47. package/lib/RadioWidget/RadioWidget.js +2 -2
  48. package/lib/RadioWidget/RadioWidget.js.map +1 -1
  49. package/lib/SelectWidget/SelectWidget.d.ts +1 -1
  50. package/lib/SelectWidget/SelectWidget.js +2 -2
  51. package/lib/SelectWidget/SelectWidget.js.map +1 -1
  52. package/lib/Templates/Templates.js +4 -0
  53. package/lib/Templates/Templates.js.map +1 -1
  54. package/lib/TextareaWidget/TextareaWidget.d.ts +1 -1
  55. package/lib/TextareaWidget/TextareaWidget.js +2 -2
  56. package/lib/TextareaWidget/TextareaWidget.js.map +1 -1
  57. package/lib/TitleField/TitleField.d.ts +1 -1
  58. package/lib/TitleField/TitleField.js +9 -2
  59. package/lib/TitleField/TitleField.js.map +1 -1
  60. package/lib/WrapIfAdditionalTemplate/WrapIfAdditionalTemplate.d.ts +1 -1
  61. package/lib/WrapIfAdditionalTemplate/WrapIfAdditionalTemplate.js +2 -3
  62. package/lib/WrapIfAdditionalTemplate/WrapIfAdditionalTemplate.js.map +1 -1
  63. package/lib/tsconfig.tsbuildinfo +1 -1
  64. package/package.json +16 -16
  65. package/src/AddButton/AddButton.tsx +1 -1
  66. package/src/ArrayFieldItemTemplate/ArrayFieldItemTemplate.tsx +2 -2
  67. package/src/ArrayFieldTemplate/ArrayFieldTemplate.tsx +22 -16
  68. package/src/BaseInputTemplate/BaseInputTemplate.tsx +5 -4
  69. package/src/CheckboxWidget/CheckboxWidget.tsx +4 -3
  70. package/src/CheckboxesWidget/CheckboxesWidget.tsx +15 -3
  71. package/src/FieldErrorTemplate/FieldErrorTemplate.tsx +2 -2
  72. package/src/FieldHelpTemplate/FieldHelpTemplate.tsx +2 -2
  73. package/src/FieldTemplate/FieldTemplate.tsx +6 -4
  74. package/src/IconButton/IconButton.tsx +12 -6
  75. package/src/MultiSchemaFieldTemplate/MultiSchemaFieldTemplate.tsx +15 -0
  76. package/src/MultiSchemaFieldTemplate/index.ts +2 -0
  77. package/src/ObjectFieldTemplate/ObjectFieldTemplate.tsx +10 -6
  78. package/src/OptionalDataControlsTemplate/OptionalDataControlsTemplate.tsx +47 -0
  79. package/src/OptionalDataControlsTemplate/index.ts +2 -0
  80. package/src/RadioWidget/RadioWidget.tsx +3 -2
  81. package/src/SelectWidget/SelectWidget.tsx +3 -2
  82. package/src/Templates/Templates.ts +4 -0
  83. package/src/TextareaWidget/TextareaWidget.tsx +3 -2
  84. package/src/TitleField/TitleField.tsx +19 -2
  85. package/src/WrapIfAdditionalTemplate/WrapIfAdditionalTemplate.tsx +5 -7
  86. package/dist/index.js.map +0 -7
@@ -15,10 +15,10 @@ function AddButton({
15
15
  return /* @__PURE__ */ jsx(
16
16
  Button,
17
17
  {
18
+ title: translateString(TranslatableString.AddItemButton),
18
19
  ...props,
19
20
  style: { width: "100%" },
20
21
  className: `ml-1 ${props.className}`,
21
- title: translateString(TranslatableString.AddItemButton),
22
22
  children: /* @__PURE__ */ jsx(BsPlus, {})
23
23
  }
24
24
  );
@@ -63,23 +63,32 @@ import {
63
63
  } from "@rjsf/utils";
64
64
  import { jsx as jsx3, jsxs as jsxs2 } from "react/jsx-runtime";
65
65
  function ArrayFieldTemplate(props) {
66
- const { canAdd, disabled, idSchema, uiSchema, items, onAddClick, readonly, registry, required, schema, title } = props;
66
+ const {
67
+ canAdd,
68
+ disabled,
69
+ fieldPathId,
70
+ uiSchema,
71
+ items,
72
+ optionalDataControl,
73
+ onAddClick,
74
+ readonly,
75
+ registry,
76
+ required,
77
+ schema,
78
+ title
79
+ } = props;
67
80
  const uiOptions = getUiOptions2(uiSchema);
68
81
  const ArrayFieldDescriptionTemplate = getTemplate2(
69
82
  "ArrayFieldDescriptionTemplate",
70
83
  registry,
71
84
  uiOptions
72
85
  );
73
- const ArrayFieldItemTemplate2 = getTemplate2(
74
- "ArrayFieldItemTemplate",
75
- registry,
76
- uiOptions
77
- );
78
86
  const ArrayFieldTitleTemplate = getTemplate2(
79
87
  "ArrayFieldTitleTemplate",
80
88
  registry,
81
89
  uiOptions
82
90
  );
91
+ const showOptionalDataControlInTitle = !readonly && !disabled;
83
92
  const {
84
93
  ButtonTemplates: { AddButton: AddButton2 }
85
94
  } = registry.templates;
@@ -87,18 +96,19 @@ function ArrayFieldTemplate(props) {
87
96
  /* @__PURE__ */ jsx3(
88
97
  ArrayFieldTitleTemplate,
89
98
  {
90
- idSchema,
99
+ fieldPathId,
91
100
  title: uiOptions.title || title,
92
101
  schema,
93
102
  uiSchema,
94
103
  required,
95
- registry
104
+ registry,
105
+ optionalDataControl: showOptionalDataControlInTitle ? optionalDataControl : void 0
96
106
  }
97
107
  ),
98
108
  /* @__PURE__ */ jsx3(
99
109
  ArrayFieldDescriptionTemplate,
100
110
  {
101
- idSchema,
111
+ fieldPathId,
102
112
  description: uiOptions.description || schema.description,
103
113
  schema,
104
114
  uiSchema,
@@ -106,13 +116,14 @@ function ArrayFieldTemplate(props) {
106
116
  }
107
117
  ),
108
118
  /* @__PURE__ */ jsxs2(Container, { fluid: true, className: "p-0 m-0", children: [
109
- items && items.map(({ key, ...itemProps }) => /* @__PURE__ */ jsx3(ArrayFieldItemTemplate2, { ...itemProps }, key)),
119
+ !showOptionalDataControlInTitle ? optionalDataControl : void 0,
120
+ items,
110
121
  canAdd && /* @__PURE__ */ jsx3(Container, { className: "", children: /* @__PURE__ */ jsxs2(Row2, { className: "mt-2", children: [
111
122
  /* @__PURE__ */ jsx3(Col2, { xs: 9 }),
112
123
  /* @__PURE__ */ jsx3(Col2, { xs: 3, className: "py-4 col-lg-3 col-3", children: /* @__PURE__ */ jsx3(
113
124
  AddButton2,
114
125
  {
115
- id: buttonId(idSchema, "add"),
126
+ id: buttonId(fieldPathId, "add"),
116
127
  className: "rjsf-array-item-add",
117
128
  onClick: onAddClick,
118
129
  disabled: disabled || readonly,
@@ -121,7 +132,7 @@ function ArrayFieldTemplate(props) {
121
132
  }
122
133
  ) })
123
134
  ] }) })
124
- ] }, `array-item-list-${idSchema.$id}`)
135
+ ] }, `array-item-list-${fieldPathId.$id}`)
125
136
  ] }) }) });
126
137
  }
127
138
 
@@ -135,6 +146,7 @@ import {
135
146
  import { Fragment, jsx as jsx4, jsxs as jsxs3 } from "react/jsx-runtime";
136
147
  function BaseInputTemplate({
137
148
  id,
149
+ htmlName,
138
150
  placeholder,
139
151
  required,
140
152
  readonly,
@@ -164,7 +176,7 @@ function BaseInputTemplate({
164
176
  Form.Control,
165
177
  {
166
178
  id,
167
- name: id,
179
+ name: htmlName || id,
168
180
  placeholder,
169
181
  autoFocus: autofocus,
170
182
  required,
@@ -253,8 +265,8 @@ function RemoveButton(props) {
253
265
  IconButton,
254
266
  {
255
267
  title: translateString(TranslatableString3.RemoveButton),
256
- ...props,
257
268
  variant: "danger",
269
+ ...props,
258
270
  icon: /* @__PURE__ */ jsx7(IoIosRemove, {})
259
271
  }
260
272
  );
@@ -265,11 +277,11 @@ import { errorId } from "@rjsf/utils";
265
277
  import ListGroup2 from "react-bootstrap/ListGroup";
266
278
  import { jsx as jsx8 } from "react/jsx-runtime";
267
279
  function FieldErrorTemplate(props) {
268
- const { errors = [], idSchema } = props;
280
+ const { errors = [], fieldPathId } = props;
269
281
  if (errors.length === 0) {
270
282
  return null;
271
283
  }
272
- const id = errorId(idSchema);
284
+ const id = errorId(fieldPathId);
273
285
  return /* @__PURE__ */ jsx8(ListGroup2, { as: "ul", id, children: errors.map((error, i) => {
274
286
  return /* @__PURE__ */ jsx8(ListGroup2.Item, { as: "li", className: "border-0 m-0 p-0", children: /* @__PURE__ */ jsx8("small", { className: "m-0 text-danger", children: error }) }, i);
275
287
  }) });
@@ -280,11 +292,11 @@ import { helpId } from "@rjsf/utils";
280
292
  import Form2 from "react-bootstrap/Form";
281
293
  import { jsx as jsx9 } from "react/jsx-runtime";
282
294
  function FieldHelpTemplate(props) {
283
- const { idSchema, help, hasErrors } = props;
295
+ const { fieldPathId, help, hasErrors } = props;
284
296
  if (!help) {
285
297
  return null;
286
298
  }
287
- const id = helpId(idSchema);
299
+ const id = helpId(fieldPathId);
288
300
  return /* @__PURE__ */ jsx9(Form2.Text, { className: hasErrors ? "text-danger" : "text-muted", id, children: help });
289
301
  }
290
302
 
@@ -309,8 +321,9 @@ function FieldTemplate({
309
321
  disabled,
310
322
  label,
311
323
  hidden,
312
- onDropPropertyClick,
313
- onKeyChange,
324
+ onKeyRename,
325
+ onKeyRenameBlur,
326
+ onRemoveProperty,
314
327
  readonly,
315
328
  required,
316
329
  schema,
@@ -334,8 +347,9 @@ function FieldTemplate({
334
347
  disabled,
335
348
  id,
336
349
  label,
337
- onDropPropertyClick,
338
- onKeyChange,
350
+ onKeyRename,
351
+ onKeyRenameBlur,
352
+ onRemoveProperty,
339
353
  readonly,
340
354
  required,
341
355
  schema,
@@ -367,6 +381,16 @@ function GridTemplate(props) {
367
381
  return /* @__PURE__ */ jsx11(Row3, { ...rest, children });
368
382
  }
369
383
 
384
+ // src/MultiSchemaFieldTemplate/MultiSchemaFieldTemplate.tsx
385
+ import Card2 from "react-bootstrap/Card";
386
+ import { jsx as jsx12, jsxs as jsxs6 } from "react/jsx-runtime";
387
+ function MultiSchemaFieldTemplate({ selector, optionSchemaField }) {
388
+ return /* @__PURE__ */ jsxs6(Card2, { style: { marginBottom: "1rem" }, children: [
389
+ /* @__PURE__ */ jsx12(Card2.Body, { children: selector }),
390
+ /* @__PURE__ */ jsx12(Card2.Body, { children: optionSchemaField })
391
+ ] });
392
+ }
393
+
370
394
  // src/ObjectFieldTemplate/ObjectFieldTemplate.tsx
371
395
  import Row4 from "react-bootstrap/Row";
372
396
  import Col4 from "react-bootstrap/Col";
@@ -379,17 +403,18 @@ import {
379
403
  getUiOptions as getUiOptions4,
380
404
  titleId
381
405
  } from "@rjsf/utils";
382
- import { Fragment as Fragment2, jsx as jsx12, jsxs as jsxs6 } from "react/jsx-runtime";
406
+ import { Fragment as Fragment2, jsx as jsx13, jsxs as jsxs7 } from "react/jsx-runtime";
383
407
  function ObjectFieldTemplate({
384
408
  description,
385
409
  title,
386
410
  properties,
387
411
  required,
388
412
  uiSchema,
389
- idSchema,
413
+ fieldPathId,
390
414
  schema,
391
415
  formData,
392
- onAddClick,
416
+ optionalDataControl,
417
+ onAddProperty,
393
418
  disabled,
394
419
  readonly,
395
420
  registry
@@ -401,41 +426,44 @@ function ObjectFieldTemplate({
401
426
  registry,
402
427
  uiOptions
403
428
  );
429
+ const showOptionalDataControlInTitle = !readonly && !disabled;
404
430
  const {
405
431
  ButtonTemplates: { AddButton: AddButton2 }
406
432
  } = registry.templates;
407
- return /* @__PURE__ */ jsxs6(Fragment2, { children: [
408
- title && /* @__PURE__ */ jsx12(
433
+ return /* @__PURE__ */ jsxs7(Fragment2, { children: [
434
+ title && /* @__PURE__ */ jsx13(
409
435
  TitleFieldTemplate,
410
436
  {
411
- id: titleId(idSchema),
437
+ id: titleId(fieldPathId),
412
438
  title,
413
439
  required,
414
440
  schema,
415
441
  uiSchema,
416
- registry
442
+ registry,
443
+ optionalDataControl: showOptionalDataControlInTitle ? optionalDataControl : void 0
417
444
  }
418
445
  ),
419
- description && /* @__PURE__ */ jsx12(
446
+ description && /* @__PURE__ */ jsx13(
420
447
  DescriptionFieldTemplate,
421
448
  {
422
- id: descriptionId(idSchema),
449
+ id: descriptionId(fieldPathId),
423
450
  description,
424
451
  schema,
425
452
  uiSchema,
426
453
  registry
427
454
  }
428
455
  ),
429
- /* @__PURE__ */ jsxs6(Container2, { fluid: true, className: "p-0", children: [
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: [
456
+ /* @__PURE__ */ jsxs7(Container2, { fluid: true, className: "p-0", children: [
457
+ !showOptionalDataControlInTitle ? optionalDataControl : void 0,
458
+ properties.map((element, index) => /* @__PURE__ */ jsx13(Row4, { style: { marginBottom: "10px" }, className: element.hidden ? "d-none" : void 0, children: /* @__PURE__ */ jsxs7(Col4, { xs: 12, children: [
431
459
  " ",
432
460
  element.content
433
461
  ] }) }, index)),
434
- canExpand(schema, uiSchema, formData) ? /* @__PURE__ */ jsx12(Row4, { children: /* @__PURE__ */ jsx12(Col4, { xs: { offset: 9, span: 3 }, className: "py-4", children: /* @__PURE__ */ jsx12(
462
+ canExpand(schema, uiSchema, formData) ? /* @__PURE__ */ jsx13(Row4, { children: /* @__PURE__ */ jsx13(Col4, { xs: { offset: 9, span: 3 }, className: "py-4", children: /* @__PURE__ */ jsx13(
435
463
  AddButton2,
436
464
  {
437
- id: buttonId2(idSchema, "add"),
438
- onClick: onAddClick(schema),
465
+ id: buttonId2(fieldPathId, "add"),
466
+ onClick: onAddProperty,
439
467
  disabled: disabled || readonly,
440
468
  className: "rjsf-object-property-expand",
441
469
  uiSchema,
@@ -446,30 +474,77 @@ function ObjectFieldTemplate({
446
474
  ] });
447
475
  }
448
476
 
477
+ // src/OptionalDataControlsTemplate/OptionalDataControlsTemplate.tsx
478
+ import { BsPlus as BsPlus2 } from "@react-icons/all-files/bs/BsPlus";
479
+ import { jsx as jsx14 } from "react/jsx-runtime";
480
+ function OptionalDataControlsTemplate(props) {
481
+ const { id, registry, label, onAddClick, onRemoveClick } = props;
482
+ if (onAddClick) {
483
+ return /* @__PURE__ */ jsx14(
484
+ IconButton,
485
+ {
486
+ id,
487
+ registry,
488
+ className: "rjsf-add-optional-data",
489
+ icon: /* @__PURE__ */ jsx14(BsPlus2, {}),
490
+ onClick: onAddClick,
491
+ title: label,
492
+ size: "sm",
493
+ variant: "secondary"
494
+ }
495
+ );
496
+ } else if (onRemoveClick) {
497
+ return /* @__PURE__ */ jsx14(
498
+ RemoveButton,
499
+ {
500
+ id,
501
+ registry,
502
+ className: "rjsf-remove-optional-data",
503
+ onClick: onRemoveClick,
504
+ title: label,
505
+ size: "sm",
506
+ variant: "secondary"
507
+ }
508
+ );
509
+ }
510
+ return /* @__PURE__ */ jsx14("em", { id, children: label });
511
+ }
512
+
449
513
  // src/SubmitButton/SubmitButton.tsx
450
514
  import Button3 from "react-bootstrap/Button";
451
515
  import { getSubmitButtonOptions } from "@rjsf/utils";
452
- import { jsx as jsx13 } from "react/jsx-runtime";
516
+ import { jsx as jsx15 } from "react/jsx-runtime";
453
517
  function SubmitButton(props) {
454
518
  const { submitText, norender, props: submitButtonProps } = getSubmitButtonOptions(props.uiSchema);
455
519
  if (norender) {
456
520
  return null;
457
521
  }
458
- return /* @__PURE__ */ jsx13("div", { children: /* @__PURE__ */ jsx13(Button3, { variant: "primary", type: "submit", ...submitButtonProps, children: submitText }) });
522
+ return /* @__PURE__ */ jsx15("div", { children: /* @__PURE__ */ jsx15(Button3, { variant: "primary", type: "submit", ...submitButtonProps, children: submitText }) });
459
523
  }
460
524
 
461
525
  // src/TitleField/TitleField.tsx
462
526
  import { getUiOptions as getUiOptions5 } from "@rjsf/utils";
463
- import { jsx as jsx14, jsxs as jsxs7 } from "react/jsx-runtime";
527
+ import Row5 from "react-bootstrap/Row";
528
+ import Col5 from "react-bootstrap/Col";
529
+ import Container3 from "react-bootstrap/Container";
530
+ import { jsx as jsx16, jsxs as jsxs8 } from "react/jsx-runtime";
464
531
  function TitleField({
465
532
  id,
466
533
  title,
467
- uiSchema
534
+ uiSchema,
535
+ optionalDataControl
468
536
  }) {
469
537
  const uiOptions = getUiOptions5(uiSchema);
470
- return /* @__PURE__ */ jsxs7("div", { id, className: "my-1", children: [
471
- /* @__PURE__ */ jsx14("h5", { children: uiOptions.title || title }),
472
- /* @__PURE__ */ jsx14("hr", { className: "border-0 bg-secondary", style: { height: "1px" } })
538
+ let heading = /* @__PURE__ */ jsx16("h5", { children: uiOptions.title || title });
539
+ if (optionalDataControl) {
540
+ heading = /* @__PURE__ */ jsx16(Container3, { fluid: true, className: "p-0", children: /* @__PURE__ */ jsxs8(Row5, { children: [
541
+ /* @__PURE__ */ jsx16(Col5, { xs: "11", children: heading }),
542
+ /* @__PURE__ */ jsx16(Col5, { xs: "1", style: { marginLeft: "-5px" }, children: optionalDataControl })
543
+ ] }) });
544
+ }
545
+ return /* @__PURE__ */ jsxs8("div", { id, className: "my-1", children: [
546
+ heading,
547
+ /* @__PURE__ */ jsx16("hr", { className: "border-0 bg-secondary mt-0", style: { height: "1px" } })
473
548
  ] });
474
549
  }
475
550
 
@@ -479,10 +554,10 @@ import {
479
554
  buttonId as buttonId3,
480
555
  TranslatableString as TranslatableString4
481
556
  } from "@rjsf/utils";
482
- import Row5 from "react-bootstrap/Row";
483
- import Col5 from "react-bootstrap/Col";
557
+ import Row6 from "react-bootstrap/Row";
558
+ import Col6 from "react-bootstrap/Col";
484
559
  import Form4 from "react-bootstrap/Form";
485
- import { jsx as jsx15, jsxs as jsxs8 } from "react/jsx-runtime";
560
+ import { jsx as jsx17, jsxs as jsxs9 } from "react/jsx-runtime";
486
561
  function WrapIfAdditionalTemplate({
487
562
  classNames,
488
563
  style,
@@ -490,8 +565,8 @@ function WrapIfAdditionalTemplate({
490
565
  disabled,
491
566
  id,
492
567
  label,
493
- onDropPropertyClick,
494
- onKeyChange,
568
+ onRemoveProperty,
569
+ onKeyRenameBlur,
495
570
  readonly,
496
571
  required,
497
572
  schema,
@@ -503,14 +578,13 @@ function WrapIfAdditionalTemplate({
503
578
  const keyLabel = translateString(TranslatableString4.KeyLabel, [label]);
504
579
  const additional = ADDITIONAL_PROPERTY_FLAG in schema;
505
580
  if (!additional) {
506
- return /* @__PURE__ */ jsx15("div", { className: classNames, style, children });
581
+ return /* @__PURE__ */ jsx17("div", { className: classNames, style, children });
507
582
  }
508
- const handleBlur = ({ target }) => onKeyChange(target.value);
509
583
  const keyId = `${id}-key`;
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(
584
+ return /* @__PURE__ */ jsxs9(Row6, { className: classNames, style, children: [
585
+ /* @__PURE__ */ jsx17(Col6, { xs: 5, children: /* @__PURE__ */ jsxs9(Form4.Group, { children: [
586
+ /* @__PURE__ */ jsx17(Form4.Label, { htmlFor: keyId, children: keyLabel }),
587
+ /* @__PURE__ */ jsx17(
514
588
  Form4.Control,
515
589
  {
516
590
  required,
@@ -518,19 +592,19 @@ function WrapIfAdditionalTemplate({
518
592
  disabled: disabled || readonly,
519
593
  id: keyId,
520
594
  name: keyId,
521
- onBlur: !readonly ? handleBlur : void 0,
595
+ onBlur: !readonly ? onKeyRenameBlur : void 0,
522
596
  type: "text"
523
597
  }
524
598
  )
525
599
  ] }) }),
526
- /* @__PURE__ */ jsx15(Col5, { xs: 5, children }),
527
- /* @__PURE__ */ jsx15(Col5, { xs: 2, className: "py-4 d-grid gap-2", children: /* @__PURE__ */ jsx15(
600
+ /* @__PURE__ */ jsx17(Col6, { xs: 5, children }),
601
+ /* @__PURE__ */ jsx17(Col6, { xs: 2, className: "py-4 d-grid gap-2", children: /* @__PURE__ */ jsx17(
528
602
  RemoveButton2,
529
603
  {
530
604
  id: buttonId3(id, "remove"),
531
605
  className: "rjsf-object-property-remove w-100",
532
606
  disabled: disabled || readonly,
533
- onClick: onDropPropertyClick(label),
607
+ onClick: onRemoveProperty,
534
608
  uiSchema,
535
609
  registry
536
610
  }
@@ -558,7 +632,9 @@ function generateTemplates() {
558
632
  FieldHelpTemplate,
559
633
  FieldTemplate,
560
634
  GridTemplate,
635
+ MultiSchemaFieldTemplate,
561
636
  ObjectFieldTemplate,
637
+ OptionalDataControlsTemplate,
562
638
  TitleFieldTemplate: TitleField,
563
639
  WrapIfAdditionalTemplate
564
640
  };
@@ -574,10 +650,11 @@ import {
574
650
  schemaRequiresTrueValue
575
651
  } from "@rjsf/utils";
576
652
  import Form5 from "react-bootstrap/Form";
577
- import { jsx as jsx16, jsxs as jsxs9 } from "react/jsx-runtime";
653
+ import { jsx as jsx18, jsxs as jsxs10 } from "react/jsx-runtime";
578
654
  function CheckboxWidget(props) {
579
655
  const {
580
656
  id,
657
+ htmlName,
581
658
  value,
582
659
  disabled,
583
660
  readonly,
@@ -602,8 +679,8 @@ function CheckboxWidget(props) {
602
679
  const _onBlur = ({ target }) => onBlur(id, target && target.checked);
603
680
  const _onFocus = ({ target }) => onFocus(id, target && target.checked);
604
681
  const description = options.description || schema.description;
605
- return /* @__PURE__ */ jsxs9(Form5.Group, { className: disabled || readonly ? "disabled" : "", "aria-describedby": ariaDescribedByIds2(id), children: [
606
- !hideLabel && description && /* @__PURE__ */ jsx16(
682
+ return /* @__PURE__ */ jsxs10(Form5.Group, { className: disabled || readonly ? "disabled" : "", "aria-describedby": ariaDescribedByIds2(id), children: [
683
+ !hideLabel && description && /* @__PURE__ */ jsx18(
607
684
  DescriptionFieldTemplate,
608
685
  {
609
686
  id: descriptionId2(id),
@@ -613,11 +690,11 @@ function CheckboxWidget(props) {
613
690
  registry
614
691
  }
615
692
  ),
616
- /* @__PURE__ */ jsx16(
693
+ /* @__PURE__ */ jsx18(
617
694
  Form5.Check,
618
695
  {
619
696
  id,
620
- name: id,
697
+ name: htmlName || id,
621
698
  label: labelValue(label, hideLabel || !label),
622
699
  checked: typeof value === "undefined" ? false : value,
623
700
  required,
@@ -642,8 +719,20 @@ import {
642
719
  enumOptionsValueForIndex,
643
720
  optionId
644
721
  } from "@rjsf/utils";
645
- import { jsx as jsx17 } from "react/jsx-runtime";
646
- function CheckboxesWidget({ id, disabled, options, value, autofocus, readonly, required, onChange, onBlur, onFocus }) {
722
+ import { jsx as jsx19 } from "react/jsx-runtime";
723
+ function CheckboxesWidget({
724
+ id,
725
+ htmlName,
726
+ disabled,
727
+ options,
728
+ value,
729
+ autofocus,
730
+ readonly,
731
+ required,
732
+ onChange,
733
+ onBlur,
734
+ onFocus
735
+ }) {
647
736
  const { enumOptions, enumDisabled, inline, emptyValue } = options;
648
737
  const checkboxesValues = Array.isArray(value) ? value : [value];
649
738
  const _onChange = (index) => ({ target: { checked } }) => {
@@ -655,10 +744,10 @@ function CheckboxesWidget({ id, disabled, options, value, autofocus, readonly, r
655
744
  };
656
745
  const _onBlur = ({ target }) => onBlur(id, enumOptionsValueForIndex(target && target.value, enumOptions, emptyValue));
657
746
  const _onFocus = ({ target }) => onFocus(id, enumOptionsValueForIndex(target && target.value, enumOptions, emptyValue));
658
- return /* @__PURE__ */ jsx17(Form6.Group, { children: Array.isArray(enumOptions) && enumOptions.map((option, index) => {
747
+ return /* @__PURE__ */ jsx19(Form6.Group, { children: Array.isArray(enumOptions) && enumOptions.map((option, index) => {
659
748
  const checked = enumOptionsIsSelected(option.value, checkboxesValues);
660
749
  const itemDisabled = Array.isArray(enumDisabled) && enumDisabled.indexOf(option.value) !== -1;
661
- return /* @__PURE__ */ jsx17(
750
+ return /* @__PURE__ */ jsx19(
662
751
  Form6.Check,
663
752
  {
664
753
  inline,
@@ -667,7 +756,7 @@ function CheckboxesWidget({ id, disabled, options, value, autofocus, readonly, r
667
756
  className: "bg-transparent border-0",
668
757
  type: "checkbox",
669
758
  id: optionId(id, index),
670
- name: id,
759
+ name: htmlName || id,
671
760
  label: option.label,
672
761
  autoFocus: autofocus && index === 0,
673
762
  onChange: _onChange(index),
@@ -689,9 +778,10 @@ import {
689
778
  enumOptionsValueForIndex as enumOptionsValueForIndex2,
690
779
  optionId as optionId2
691
780
  } from "@rjsf/utils";
692
- import { jsx as jsx18 } from "react/jsx-runtime";
781
+ import { jsx as jsx20 } from "react/jsx-runtime";
693
782
  function RadioWidget({
694
783
  id,
784
+ htmlName,
695
785
  options,
696
786
  value,
697
787
  required,
@@ -706,16 +796,16 @@ function RadioWidget({
706
796
  const _onBlur = ({ target }) => onBlur(id, enumOptionsValueForIndex2(target && target.value, enumOptions, emptyValue));
707
797
  const _onFocus = ({ target }) => onFocus(id, enumOptionsValueForIndex2(target && target.value, enumOptions, emptyValue));
708
798
  const inline = Boolean(options && options.inline);
709
- return /* @__PURE__ */ jsx18(Form7.Group, { className: "mb-0", children: Array.isArray(enumOptions) && enumOptions.map((option, index) => {
799
+ return /* @__PURE__ */ jsx20(Form7.Group, { className: "mb-0", children: Array.isArray(enumOptions) && enumOptions.map((option, index) => {
710
800
  const itemDisabled = Array.isArray(enumDisabled) && enumDisabled.indexOf(option.value) !== -1;
711
801
  const checked = enumOptionsIsSelected2(option.value, value);
712
- const radio = /* @__PURE__ */ jsx18(
802
+ const radio = /* @__PURE__ */ jsx20(
713
803
  Form7.Check,
714
804
  {
715
805
  inline,
716
806
  label: option.label,
717
807
  id: optionId2(id, index),
718
- name: id,
808
+ name: htmlName || id,
719
809
  type: "radio",
720
810
  disabled: disabled || itemDisabled || readonly,
721
811
  checked,
@@ -735,7 +825,7 @@ function RadioWidget({
735
825
  // src/RangeWidget/RangeWidget.tsx
736
826
  import { rangeSpec } from "@rjsf/utils";
737
827
  import FormRange from "react-bootstrap/FormRange";
738
- import { Fragment as Fragment3, jsx as jsx19, jsxs as jsxs10 } from "react/jsx-runtime";
828
+ import { Fragment as Fragment3, jsx as jsx21, jsxs as jsxs11 } from "react/jsx-runtime";
739
829
  function RangeWidget(props) {
740
830
  const { id, value, disabled, onChange, onBlur, onFocus, schema } = props;
741
831
  const _onChange = ({ target: { value: value2 } }) => onChange(value2);
@@ -751,9 +841,9 @@ function RangeWidget(props) {
751
841
  onFocus: _onFocus,
752
842
  ...rangeSpec(schema)
753
843
  };
754
- return /* @__PURE__ */ jsxs10(Fragment3, { children: [
755
- /* @__PURE__ */ jsx19(FormRange, { ...rangeProps }),
756
- /* @__PURE__ */ jsx19("span", { className: "range-view", children: value })
844
+ return /* @__PURE__ */ jsxs11(Fragment3, { children: [
845
+ /* @__PURE__ */ jsx21(FormRange, { ...rangeProps }),
846
+ /* @__PURE__ */ jsx21("span", { className: "range-view", children: value })
757
847
  ] });
758
848
  }
759
849
 
@@ -764,10 +854,11 @@ import {
764
854
  enumOptionsIndexForValue,
765
855
  enumOptionsValueForIndex as enumOptionsValueForIndex3
766
856
  } from "@rjsf/utils";
767
- import { jsx as jsx20, jsxs as jsxs11 } from "react/jsx-runtime";
857
+ import { jsx as jsx22, jsxs as jsxs12 } from "react/jsx-runtime";
768
858
  function SelectWidget({
769
859
  schema,
770
860
  id,
861
+ htmlName,
771
862
  options,
772
863
  required,
773
864
  disabled,
@@ -792,11 +883,11 @@ function SelectWidget({
792
883
  }
793
884
  const selectedIndexes = enumOptionsIndexForValue(value, enumOptions, multiple);
794
885
  const showPlaceholderOption = !multiple && schema.default === void 0;
795
- return /* @__PURE__ */ jsxs11(
886
+ return /* @__PURE__ */ jsxs12(
796
887
  FormSelect,
797
888
  {
798
889
  id,
799
- name: id,
890
+ name: htmlName || id,
800
891
  value: typeof selectedIndexes === "undefined" ? emptyValue : selectedIndexes,
801
892
  required,
802
893
  multiple,
@@ -817,10 +908,10 @@ function SelectWidget({
817
908
  },
818
909
  "aria-describedby": ariaDescribedByIds5(id),
819
910
  children: [
820
- showPlaceholderOption && /* @__PURE__ */ jsx20("option", { value: "", children: placeholder }),
911
+ showPlaceholderOption && /* @__PURE__ */ jsx22("option", { value: "", children: placeholder }),
821
912
  enumOptions.map(({ value: value2, label }, i) => {
822
913
  const disabled2 = Array.isArray(enumDisabled) && enumDisabled.indexOf(value2) != -1;
823
- return /* @__PURE__ */ jsx20("option", { id: label, value: String(i), disabled: disabled2, children: label }, i);
914
+ return /* @__PURE__ */ jsx22("option", { id: label, value: String(i), disabled: disabled2, children: label }, i);
824
915
  })
825
916
  ]
826
917
  }
@@ -831,9 +922,10 @@ function SelectWidget({
831
922
  import { ariaDescribedByIds as ariaDescribedByIds6 } from "@rjsf/utils";
832
923
  import FormControl from "react-bootstrap/FormControl";
833
924
  import InputGroup from "react-bootstrap/InputGroup";
834
- import { jsx as jsx21 } from "react/jsx-runtime";
925
+ import { jsx as jsx23 } from "react/jsx-runtime";
835
926
  function TextareaWidget({
836
927
  id,
928
+ htmlName,
837
929
  placeholder,
838
930
  value,
839
931
  required,
@@ -848,11 +940,11 @@ function TextareaWidget({
848
940
  const _onChange = ({ target: { value: value2 } }) => onChange(value2 === "" ? options.emptyValue : value2);
849
941
  const _onBlur = ({ target }) => onBlur(id, target && target.value);
850
942
  const _onFocus = ({ target }) => onFocus(id, target && target.value);
851
- return /* @__PURE__ */ jsx21(InputGroup, { children: /* @__PURE__ */ jsx21(
943
+ return /* @__PURE__ */ jsx23(InputGroup, { children: /* @__PURE__ */ jsx23(
852
944
  FormControl,
853
945
  {
854
946
  id,
855
- name: id,
947
+ name: htmlName || id,
856
948
  as: "textarea",
857
949
  placeholder,
858
950
  disabled,