@rjsf/fluentui-rc 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.
Files changed (84) hide show
  1. package/README.md +2 -0
  2. package/dist/core.umd.js +129 -51
  3. package/dist/{index.js → index.cjs} +210 -123
  4. package/dist/index.cjs.map +7 -0
  5. package/dist/index.esm.js +192 -105
  6. package/dist/index.esm.js.map +4 -4
  7. package/lib/AddButton/AddButton.js +1 -1
  8. package/lib/AddButton/AddButton.js.map +1 -1
  9. package/lib/ArrayFieldItemTemplate/ArrayFieldItemTemplate.d.ts +3 -3
  10. package/lib/ArrayFieldItemTemplate/ArrayFieldItemTemplate.js +1 -1
  11. package/lib/ArrayFieldItemTemplate/ArrayFieldItemTemplate.js.map +1 -1
  12. package/lib/ArrayFieldTemplate/ArrayFieldTemplate.d.ts +1 -1
  13. package/lib/ArrayFieldTemplate/ArrayFieldTemplate.js +4 -5
  14. package/lib/ArrayFieldTemplate/ArrayFieldTemplate.js.map +1 -1
  15. package/lib/BaseInputTemplate/BaseInputTemplate.js +2 -2
  16. package/lib/BaseInputTemplate/BaseInputTemplate.js.map +1 -1
  17. package/lib/CheckboxWidget/CheckboxWidget.js +4 -4
  18. package/lib/CheckboxWidget/CheckboxWidget.js.map +1 -1
  19. package/lib/CheckboxesWidget/CheckboxesWidget.d.ts +1 -1
  20. package/lib/CheckboxesWidget/CheckboxesWidget.js +2 -2
  21. package/lib/CheckboxesWidget/CheckboxesWidget.js.map +1 -1
  22. package/lib/FieldErrorTemplate/FieldErrorTemplate.js +2 -2
  23. package/lib/FieldErrorTemplate/FieldErrorTemplate.js.map +1 -1
  24. package/lib/FieldHelpTemplate/FieldHelpTemplate.js +2 -2
  25. package/lib/FieldHelpTemplate/FieldHelpTemplate.js.map +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 +7 -5
  29. package/lib/IconButton/IconButton.js.map +1 -1
  30. package/lib/MultiSchemaFieldTemplate/MultiSchemaFieldTemplate.d.ts +2 -0
  31. package/lib/MultiSchemaFieldTemplate/MultiSchemaFieldTemplate.js +13 -0
  32. package/lib/MultiSchemaFieldTemplate/MultiSchemaFieldTemplate.js.map +1 -0
  33. package/lib/MultiSchemaFieldTemplate/index.d.ts +2 -0
  34. package/lib/MultiSchemaFieldTemplate/index.js +3 -0
  35. package/lib/MultiSchemaFieldTemplate/index.js.map +1 -0
  36. package/lib/ObjectFieldTemplate/ObjectFieldTemplate.js +4 -3
  37. package/lib/ObjectFieldTemplate/ObjectFieldTemplate.js.map +1 -1
  38. package/lib/OptionalDataControlsTemplate/OptionalDataControlsTemplate.d.ts +10 -0
  39. package/lib/OptionalDataControlsTemplate/OptionalDataControlsTemplate.js +22 -0
  40. package/lib/OptionalDataControlsTemplate/OptionalDataControlsTemplate.js.map +1 -0
  41. package/lib/OptionalDataControlsTemplate/index.d.ts +2 -0
  42. package/lib/OptionalDataControlsTemplate/index.js +3 -0
  43. package/lib/OptionalDataControlsTemplate/index.js.map +1 -0
  44. package/lib/RadioWidget/RadioWidget.d.ts +1 -1
  45. package/lib/RadioWidget/RadioWidget.js +2 -2
  46. package/lib/RadioWidget/RadioWidget.js.map +1 -1
  47. package/lib/RangeWidget/RangeWidget.js.map +1 -1
  48. package/lib/SelectWidget/SelectWidget.d.ts +1 -1
  49. package/lib/SelectWidget/SelectWidget.js +2 -2
  50. package/lib/SelectWidget/SelectWidget.js.map +1 -1
  51. package/lib/Templates/Templates.js +4 -0
  52. package/lib/Templates/Templates.js.map +1 -1
  53. package/lib/TextareaWidget/TextareaWidget.js +2 -2
  54. package/lib/TextareaWidget/TextareaWidget.js.map +1 -1
  55. package/lib/TitleField/TitleField.d.ts +1 -1
  56. package/lib/TitleField/TitleField.js +7 -2
  57. package/lib/TitleField/TitleField.js.map +1 -1
  58. package/lib/WrapIfAdditionalTemplate/WrapIfAdditionalTemplate.js +3 -4
  59. package/lib/WrapIfAdditionalTemplate/WrapIfAdditionalTemplate.js.map +1 -1
  60. package/lib/tsconfig.tsbuildinfo +1 -1
  61. package/package.json +18 -18
  62. package/src/AddButton/AddButton.tsx +1 -1
  63. package/src/ArrayFieldItemTemplate/ArrayFieldItemTemplate.tsx +3 -3
  64. package/src/ArrayFieldTemplate/ArrayFieldTemplate.tsx +23 -17
  65. package/src/BaseInputTemplate/BaseInputTemplate.tsx +5 -4
  66. package/src/CheckboxWidget/CheckboxWidget.tsx +6 -5
  67. package/src/CheckboxesWidget/CheckboxesWidget.tsx +3 -2
  68. package/src/FieldErrorTemplate/FieldErrorTemplate.tsx +2 -2
  69. package/src/FieldHelpTemplate/FieldHelpTemplate.tsx +2 -2
  70. package/src/FieldTemplate/FieldTemplate.tsx +6 -4
  71. package/src/IconButton/IconButton.tsx +12 -6
  72. package/src/MultiSchemaFieldTemplate/MultiSchemaFieldTemplate.tsx +25 -0
  73. package/src/MultiSchemaFieldTemplate/index.ts +2 -0
  74. package/src/ObjectFieldTemplate/ObjectFieldTemplate.tsx +10 -6
  75. package/src/OptionalDataControlsTemplate/OptionalDataControlsTemplate.tsx +48 -0
  76. package/src/OptionalDataControlsTemplate/index.ts +2 -0
  77. package/src/RadioWidget/RadioWidget.tsx +3 -2
  78. package/src/RangeWidget/RangeWidget.tsx +1 -1
  79. package/src/SelectWidget/SelectWidget.tsx +3 -2
  80. package/src/Templates/Templates.ts +4 -0
  81. package/src/TextareaWidget/TextareaWidget.tsx +3 -2
  82. package/src/TitleField/TitleField.tsx +16 -3
  83. package/src/WrapIfAdditionalTemplate/WrapIfAdditionalTemplate.tsx +6 -7
  84. package/dist/index.js.map +0 -7
package/README.md CHANGED
@@ -47,6 +47,8 @@
47
47
 
48
48
  Fluent UI React Components (v9) theme, fields and widgets for `react-jsonschema-form`.
49
49
 
50
+ [<img src="./screenshot.png" alt="product-screenshot" width="800" />](https://rjsf-team.github.io/@rjsf/fluentui-rc)
51
+
50
52
  ### Built With
51
53
 
52
54
  - [react-jsonschema-form](https://github.com/rjsf-team/react-jsonschema-form/)
package/dist/core.umd.js CHANGED
@@ -32,7 +32,7 @@
32
32
  ...props
33
33
  }) {
34
34
  const { translateString } = registry;
35
- return /* @__PURE__ */ jsxRuntime.jsx(reactComponents.Button, { ...props, icon: /* @__PURE__ */ jsxRuntime.jsx(reactIcons.AddRegular, {}), title: translateString(utils.TranslatableString.AddItemButton) });
35
+ return /* @__PURE__ */ jsxRuntime.jsx(reactComponents.Button, { title: translateString(utils.TranslatableString.AddItemButton), ...props, icon: /* @__PURE__ */ jsxRuntime.jsx(reactIcons.AddRegular, {}) });
36
36
  }
37
37
  var useStyles2 = reactComponents.makeStyles({
38
38
  arrayItemList: {
@@ -40,7 +40,20 @@
40
40
  }
41
41
  });
42
42
  function ArrayFieldTemplate(props) {
43
- const { canAdd, disabled, idSchema, uiSchema, items, onAddClick, readonly, registry, required, schema, title } = props;
43
+ const {
44
+ canAdd,
45
+ disabled,
46
+ fieldPathId,
47
+ uiSchema,
48
+ items,
49
+ optionalDataControl,
50
+ onAddClick,
51
+ readonly,
52
+ registry,
53
+ required,
54
+ schema,
55
+ title
56
+ } = props;
44
57
  const classes = useStyles2();
45
58
  const uiOptions = utils.getUiOptions(uiSchema);
46
59
  const ArrayFieldDescriptionTemplate = utils.getTemplate(
@@ -48,16 +61,12 @@
48
61
  registry,
49
62
  uiOptions
50
63
  );
51
- const ArrayFieldItemTemplate2 = utils.getTemplate(
52
- "ArrayFieldItemTemplate",
53
- registry,
54
- uiOptions
55
- );
56
64
  const ArrayFieldTitleTemplate = utils.getTemplate(
57
65
  "ArrayFieldTitleTemplate",
58
66
  registry,
59
67
  uiOptions
60
68
  );
69
+ const showOptionalDataControlInTitle = !readonly && !disabled;
61
70
  const {
62
71
  ButtonTemplates: { AddButton: AddButton2 }
63
72
  } = registry.templates;
@@ -65,18 +74,19 @@
65
74
  /* @__PURE__ */ jsxRuntime.jsx(
66
75
  ArrayFieldTitleTemplate,
67
76
  {
68
- idSchema,
77
+ fieldPathId,
69
78
  title: uiOptions.title || title,
70
79
  schema,
71
80
  uiSchema,
72
81
  required,
73
- registry
82
+ registry,
83
+ optionalDataControl: showOptionalDataControlInTitle ? optionalDataControl : void 0
74
84
  }
75
85
  ),
76
86
  /* @__PURE__ */ jsxRuntime.jsx(
77
87
  ArrayFieldDescriptionTemplate,
78
88
  {
79
- idSchema,
89
+ fieldPathId,
80
90
  description: uiOptions.description || schema.description,
81
91
  schema,
82
92
  uiSchema,
@@ -84,11 +94,12 @@
84
94
  }
85
95
  ),
86
96
  /* @__PURE__ */ jsxRuntime.jsxs(reactMigrationV0V9.Flex, { column: true, className: classes.arrayItemList, children: [
87
- items && items.map(({ key, ...itemProps }) => /* @__PURE__ */ jsxRuntime.jsx(ArrayFieldItemTemplate2, { ...itemProps }, key)),
97
+ !showOptionalDataControlInTitle ? optionalDataControl : void 0,
98
+ items,
88
99
  canAdd && /* @__PURE__ */ jsxRuntime.jsx(reactMigrationV0V9.Flex, { hAlign: "end", children: /* @__PURE__ */ jsxRuntime.jsx(
89
100
  AddButton2,
90
101
  {
91
- id: utils.buttonId(idSchema, "add"),
102
+ id: utils.buttonId(fieldPathId, "add"),
92
103
  className: "rjsf-array-item-add",
93
104
  onClick: onAddClick,
94
105
  disabled: disabled || readonly,
@@ -96,7 +107,7 @@
96
107
  registry
97
108
  }
98
109
  ) })
99
- ] }, `array-item-list-${idSchema.$id}`)
110
+ ] }, `array-item-list-${fieldPathId.$id}`)
100
111
  ] });
101
112
  }
102
113
  var useStyles3 = reactComponents.makeStyles({
@@ -112,6 +123,7 @@
112
123
  function BaseInputTemplate(props) {
113
124
  const {
114
125
  id,
126
+ htmlName,
115
127
  placeholder,
116
128
  required,
117
129
  readonly,
@@ -142,7 +154,7 @@
142
154
  reactComponents.Input,
143
155
  {
144
156
  id,
145
- name: id,
157
+ name: htmlName || id,
146
158
  placeholder,
147
159
  autoFocus: autofocus,
148
160
  required,
@@ -271,22 +283,22 @@
271
283
  errorLabel: { color: reactComponents.tokens.colorPaletteRedForeground1 }
272
284
  });
273
285
  function FieldErrorTemplate(props) {
274
- const { errors = [], idSchema } = props;
286
+ const { errors = [], fieldPathId } = props;
275
287
  const classes = useStyles6();
276
288
  if (errors.length === 0) {
277
289
  return null;
278
290
  }
279
- const id = utils.errorId(idSchema);
291
+ const id = utils.errorId(fieldPathId);
280
292
  return /* @__PURE__ */ jsxRuntime.jsx("ul", { className: classes.list, children: errors.map((error, i) => {
281
293
  return /* @__PURE__ */ jsxRuntime.jsx("li", { className: classes.listItem, children: /* @__PURE__ */ jsxRuntime.jsx("small", { className: classes.errorLabel, id, children: error }) }, i);
282
294
  }) });
283
295
  }
284
296
  function FieldHelpTemplate(props) {
285
- const { idSchema, help } = props;
297
+ const { fieldPathId, help } = props;
286
298
  if (!help) {
287
299
  return null;
288
300
  }
289
- const id = utils.helpId(idSchema);
301
+ const id = utils.helpId(fieldPathId);
290
302
  return /* @__PURE__ */ jsxRuntime.jsx(reactComponents.Caption1, { id, children: help });
291
303
  }
292
304
  function FieldTemplate(props) {
@@ -299,8 +311,9 @@
299
311
  displayLabel,
300
312
  hidden,
301
313
  label,
302
- onDropPropertyClick,
303
- onKeyChange,
314
+ onKeyRename,
315
+ onKeyRenameBlur,
316
+ onRemoveProperty,
304
317
  readonly,
305
318
  required,
306
319
  rawErrors = [],
@@ -329,8 +342,9 @@
329
342
  disabled,
330
343
  id,
331
344
  label,
332
- onDropPropertyClick,
333
- onKeyChange,
345
+ onKeyRename,
346
+ onKeyRenameBlur,
347
+ onRemoveProperty,
334
348
  readonly,
335
349
  required,
336
350
  schema,
@@ -357,6 +371,19 @@
357
371
  }
358
372
  return /* @__PURE__ */ jsxRuntime.jsx("div", { style, ...rest, children });
359
373
  }
374
+ var useStyles7 = reactComponents.makeStyles({
375
+ root: {
376
+ "> div": { marginBottom: "4px" }
377
+ }
378
+ });
379
+ function MultiSchemaFieldTemplate(props) {
380
+ const { selector, optionSchemaField } = props;
381
+ const styles = useStyles7();
382
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: styles.root, children: [
383
+ /* @__PURE__ */ jsxRuntime.jsx("div", { children: selector }),
384
+ optionSchemaField
385
+ ] });
386
+ }
360
387
  function ObjectFieldTemplate(props) {
361
388
  const {
362
389
  description,
@@ -366,10 +393,11 @@
366
393
  disabled,
367
394
  readonly,
368
395
  uiSchema,
369
- idSchema,
396
+ fieldPathId,
370
397
  schema,
371
398
  formData,
372
- onAddClick,
399
+ optionalDataControl,
400
+ onAddProperty,
373
401
  registry
374
402
  } = props;
375
403
  const uiOptions = utils.getUiOptions(uiSchema);
@@ -379,6 +407,7 @@
379
407
  registry,
380
408
  uiOptions
381
409
  );
410
+ const showOptionalDataControlInTitle = !readonly && !disabled;
382
411
  const {
383
412
  ButtonTemplates: { AddButton: AddButton2 }
384
413
  } = registry.templates;
@@ -386,18 +415,19 @@
386
415
  title && /* @__PURE__ */ jsxRuntime.jsx(
387
416
  TitleFieldTemplate,
388
417
  {
389
- id: utils.titleId(idSchema),
418
+ id: utils.titleId(fieldPathId),
390
419
  title,
391
420
  required,
392
421
  schema,
393
422
  uiSchema,
394
- registry
423
+ registry,
424
+ optionalDataControl: showOptionalDataControlInTitle ? optionalDataControl : void 0
395
425
  }
396
426
  ),
397
427
  description && /* @__PURE__ */ jsxRuntime.jsx(
398
428
  DescriptionFieldTemplate,
399
429
  {
400
- id: utils.descriptionId(idSchema),
430
+ id: utils.descriptionId(fieldPathId),
401
431
  description,
402
432
  schema,
403
433
  uiSchema,
@@ -405,6 +435,7 @@
405
435
  }
406
436
  ),
407
437
  /* @__PURE__ */ jsxRuntime.jsxs(reactMigrationV0V9.Flex, { fill: true, column: true, gap: "gap.medium", children: [
438
+ !showOptionalDataControlInTitle ? optionalDataControl : void 0,
408
439
  properties.map(
409
440
  (element, index) => (
410
441
  // Remove the <Grid> if the inner element is hidden as the <Grid>
@@ -415,9 +446,9 @@
415
446
  utils.canExpand(schema, uiSchema, formData) && /* @__PURE__ */ jsxRuntime.jsx(reactMigrationV0V9.Flex, { hAlign: "end", children: /* @__PURE__ */ jsxRuntime.jsx(
416
447
  AddButton2,
417
448
  {
418
- id: utils.buttonId(idSchema, "add"),
449
+ id: utils.buttonId(fieldPathId, "add"),
419
450
  className: "rjsf-object-property-expand",
420
- onClick: onAddClick(schema),
451
+ onClick: onAddProperty,
421
452
  disabled: disabled || readonly,
422
453
  uiSchema,
423
454
  registry
@@ -426,20 +457,53 @@
426
457
  ] })
427
458
  ] });
428
459
  }
429
- var useStyles7 = reactComponents.makeStyles({
460
+ function OptionalDataControlsTemplate(props) {
461
+ const { id, registry, label, onAddClick, onRemoveClick } = props;
462
+ if (onAddClick) {
463
+ return /* @__PURE__ */ jsxRuntime.jsx(
464
+ FluentIconButton,
465
+ {
466
+ id,
467
+ registry,
468
+ icon: /* @__PURE__ */ jsxRuntime.jsx(reactIcons.AddSquareMultipleRegular, {}),
469
+ className: "rjsf-add-optional-data",
470
+ onClick: onAddClick,
471
+ title: label,
472
+ size: "small",
473
+ appearance: "secondary"
474
+ }
475
+ );
476
+ } else if (onRemoveClick) {
477
+ return /* @__PURE__ */ jsxRuntime.jsx(
478
+ FluentIconButton,
479
+ {
480
+ id,
481
+ registry,
482
+ icon: /* @__PURE__ */ jsxRuntime.jsx(reactIcons.SubtractSquareMultipleRegular, {}),
483
+ className: "rjsf-remove-optional-data",
484
+ onClick: onRemoveClick,
485
+ title: label,
486
+ size: "small",
487
+ appearance: "secondary"
488
+ }
489
+ );
490
+ }
491
+ return /* @__PURE__ */ jsxRuntime.jsx("em", { id, children: label });
492
+ }
493
+ var useStyles8 = reactComponents.makeStyles({
430
494
  buttonRow: {
431
495
  marginTop: reactComponents.tokens.spacingVerticalL
432
496
  }
433
497
  });
434
498
  function SubmitButton({ uiSchema }) {
435
- const classes = useStyles7();
499
+ const classes = useStyles8();
436
500
  const { submitText, norender, props: submitButtonProps } = utils.getSubmitButtonOptions(uiSchema);
437
501
  if (norender) {
438
502
  return null;
439
503
  }
440
504
  return /* @__PURE__ */ jsxRuntime.jsx("div", { className: classes.buttonRow, children: /* @__PURE__ */ jsxRuntime.jsx(reactComponents.Button, { appearance: "primary", type: "submit", ...submitButtonProps, children: submitText }) });
441
505
  }
442
- var useStyles8 = reactComponents.makeStyles({
506
+ var useStyles9 = reactComponents.makeStyles({
443
507
  root: {
444
508
  marginTop: "8px",
445
509
  marginBottom: "8px"
@@ -447,15 +511,23 @@
447
511
  });
448
512
  function TitleField({
449
513
  id,
450
- title
514
+ title,
515
+ optionalDataControl
451
516
  }) {
452
- const classes = useStyles8();
517
+ const classes = useStyles9();
518
+ let heading = /* @__PURE__ */ jsxRuntime.jsx(reactComponents.Text, { as: "h5", size: 600, style: { marginBlock: 0 }, children: title });
519
+ if (optionalDataControl) {
520
+ heading = /* @__PURE__ */ jsxRuntime.jsxs(reactMigrationV0V9.Flex, { children: [
521
+ /* @__PURE__ */ jsxRuntime.jsx(reactMigrationV0V9.Flex, { fill: true, children: heading }),
522
+ /* @__PURE__ */ jsxRuntime.jsx(reactMigrationV0V9.Flex, { hAlign: "end", children: optionalDataControl })
523
+ ] });
524
+ }
453
525
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { id, className: classes.root, children: [
454
- /* @__PURE__ */ jsxRuntime.jsx(reactComponents.Text, { as: "h5", size: 600, children: title }),
526
+ heading,
455
527
  /* @__PURE__ */ jsxRuntime.jsx(reactComponents.Divider, {})
456
528
  ] });
457
529
  }
458
- var useStyles9 = reactComponents.makeStyles({
530
+ var useStyles10 = reactComponents.makeStyles({
459
531
  input: {
460
532
  width: "100%"
461
533
  },
@@ -471,8 +543,8 @@
471
543
  disabled,
472
544
  id,
473
545
  label,
474
- onDropPropertyClick,
475
- onKeyChange,
546
+ onRemoveProperty,
547
+ onKeyRenameBlur,
476
548
  readonly,
477
549
  required,
478
550
  schema,
@@ -480,7 +552,7 @@
480
552
  registry
481
553
  } = props;
482
554
  const { templates, translateString } = registry;
483
- const classes = useStyles9();
555
+ const classes = useStyles10();
484
556
  const { RemoveButton: RemoveButton2 } = templates.ButtonTemplates;
485
557
  const keyLabel = translateString(utils.TranslatableString.KeyLabel, [label]);
486
558
  const additional = utils.ADDITIONAL_PROPERTY_FLAG in schema;
@@ -493,7 +565,6 @@
493
565
  if (!additional) {
494
566
  return /* @__PURE__ */ jsxRuntime.jsx("div", { className: classNames, style, children });
495
567
  }
496
- const handleBlur = ({ target }) => onKeyChange(target.value);
497
568
  return /* @__PURE__ */ jsxRuntime.jsxs(reactMigrationV0V9.Flex, { gap: "gap.medium", vAlign: "center", className: classNames, style, children: [
498
569
  /* @__PURE__ */ jsxRuntime.jsx("div", { children: /* @__PURE__ */ jsxRuntime.jsx(reactComponents.Field, { label: keyLabel, required, children: /* @__PURE__ */ jsxRuntime.jsx(
499
570
  reactComponents.Input,
@@ -503,7 +574,7 @@
503
574
  disabled: disabled || readonly,
504
575
  id: `${id}-key`,
505
576
  name: `${id}-key`,
506
- onBlur: !readonly ? handleBlur : void 0,
577
+ onBlur: !readonly ? onKeyRenameBlur : void 0,
507
578
  type: "text",
508
579
  input: {
509
580
  className: classes.input
@@ -519,7 +590,7 @@
519
590
  className: "rjsf-object-property-remove",
520
591
  style: btnStyle,
521
592
  disabled: disabled || readonly,
522
- onClick: onDropPropertyClick(label),
593
+ onClick: onRemoveProperty,
523
594
  uiSchema,
524
595
  registry
525
596
  }
@@ -547,7 +618,9 @@
547
618
  FieldHelpTemplate,
548
619
  FieldTemplate,
549
620
  GridTemplate,
621
+ MultiSchemaFieldTemplate,
550
622
  ObjectFieldTemplate,
623
+ OptionalDataControlsTemplate,
551
624
  TitleFieldTemplate: TitleField,
552
625
  WrapIfAdditionalTemplate
553
626
  };
@@ -557,6 +630,7 @@
557
630
  const {
558
631
  schema,
559
632
  id,
633
+ htmlName,
560
634
  value,
561
635
  disabled,
562
636
  readonly,
@@ -577,8 +651,8 @@
577
651
  );
578
652
  const required = utils.schemaRequiresTrueValue(schema);
579
653
  const _onChange = ({ target: { checked } }) => onChange(checked);
580
- const _onBlur = ({ target }) => onBlur(id, target && target.value);
581
- const _onFocus = ({ target }) => onFocus(id, target && target.value);
654
+ const _onBlur = ({ target }) => onBlur(id, target && target.checked);
655
+ const _onFocus = ({ target }) => onFocus(id, target && target.checked);
582
656
  const description = options.description ?? schema.description;
583
657
  return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
584
658
  !hideLabel && description && /* @__PURE__ */ jsxRuntime.jsx(
@@ -595,7 +669,7 @@
595
669
  reactComponents.Checkbox,
596
670
  {
597
671
  id,
598
- name: id,
672
+ name: htmlName || id,
599
673
  label,
600
674
  checked: typeof value === "undefined" ? false : Boolean(value),
601
675
  required,
@@ -613,6 +687,7 @@
613
687
  label,
614
688
  hideLabel,
615
689
  id,
690
+ htmlName,
616
691
  disabled,
617
692
  options,
618
693
  value,
@@ -646,7 +721,7 @@
646
721
  reactComponents.Checkbox,
647
722
  {
648
723
  id: utils.optionId(id, index),
649
- name: id,
724
+ name: htmlName || id,
650
725
  label: option.label,
651
726
  checked,
652
727
  disabled: disabled || itemDisabled || readonly,
@@ -663,6 +738,7 @@
663
738
  }
664
739
  function RadioWidget({
665
740
  id,
741
+ htmlName,
666
742
  options,
667
743
  value,
668
744
  required,
@@ -688,7 +764,7 @@
688
764
  reactComponents.RadioGroup,
689
765
  {
690
766
  id,
691
- name: id,
767
+ name: htmlName || id,
692
768
  layout: inline ? "horizontal" : "vertical",
693
769
  value: selectedIndex,
694
770
  onChange: _onChange,
@@ -746,6 +822,7 @@
746
822
  }
747
823
  function SelectWidget({
748
824
  id,
825
+ htmlName,
749
826
  options,
750
827
  label,
751
828
  hideLabel,
@@ -788,7 +865,7 @@
788
865
  reactComponents.Dropdown,
789
866
  {
790
867
  id,
791
- name: id,
868
+ name: htmlName || id,
792
869
  multiselect: multiple,
793
870
  className: "form-control",
794
871
  value: dropdownValue,
@@ -812,7 +889,7 @@
812
889
  );
813
890
  }
814
891
  var SelectWidget_default = SelectWidget;
815
- var useStyles10 = reactComponents.makeStyles({
892
+ var useStyles11 = reactComponents.makeStyles({
816
893
  label: {
817
894
  paddingTop: "2px",
818
895
  paddingBottom: "2px",
@@ -822,6 +899,7 @@
822
899
  function TextareaWidget(props) {
823
900
  const {
824
901
  id,
902
+ htmlName,
825
903
  placeholder,
826
904
  required,
827
905
  readonly,
@@ -837,7 +915,7 @@
837
915
  options,
838
916
  schema
839
917
  } = props;
840
- const classes = useStyles10();
918
+ const classes = useStyles11();
841
919
  const _onChange = ({ target: { value: value2 } }) => onChange(value2 === "" ? options.emptyValue : value2);
842
920
  const _onBlur = ({ target }) => onBlur(id, target && target.value);
843
921
  const _onFocus = ({ target }) => onFocus(id, target && target.value);
@@ -854,7 +932,7 @@
854
932
  reactComponents.Textarea,
855
933
  {
856
934
  id,
857
- name: id,
935
+ name: htmlName || id,
858
936
  placeholder,
859
937
  autoFocus: autofocus,
860
938
  required,