@rjsf/mantine 6.6.1 → 6.7.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 (144) hide show
  1. package/LICENSE.md +201 -0
  2. package/dist/index.cjs +356 -302
  3. package/dist/index.cjs.map +4 -4
  4. package/dist/mantine.esm.js +218 -226
  5. package/dist/mantine.esm.js.map +4 -4
  6. package/dist/mantine.umd.js +175 -127
  7. package/lib/Form/index.d.ts +3 -3
  8. package/lib/Form/index.js.map +1 -1
  9. package/lib/Theme/index.d.ts +2 -2
  10. package/lib/templates/ArrayFieldItemTemplate.d.ts +2 -2
  11. package/lib/templates/ArrayFieldItemTemplate.js +1 -1
  12. package/lib/templates/ArrayFieldItemTemplate.js.map +1 -1
  13. package/lib/templates/ArrayFieldTemplate.d.ts +2 -2
  14. package/lib/templates/ArrayFieldTemplate.js +1 -1
  15. package/lib/templates/ArrayFieldTemplate.js.map +1 -1
  16. package/lib/templates/ArrayFieldTitleTemplate.d.ts +2 -2
  17. package/lib/templates/ArrayFieldTitleTemplate.js +1 -1
  18. package/lib/templates/ArrayFieldTitleTemplate.js.map +1 -1
  19. package/lib/templates/BaseInputTemplate.d.ts +2 -2
  20. package/lib/templates/BaseInputTemplate.js +9 -7
  21. package/lib/templates/BaseInputTemplate.js.map +1 -1
  22. package/lib/templates/ButtonTemplates/AddButton.d.ts +2 -2
  23. package/lib/templates/ButtonTemplates/AddButton.js.map +1 -1
  24. package/lib/templates/ButtonTemplates/IconButton.d.ts +15 -8
  25. package/lib/templates/ButtonTemplates/IconButton.js +14 -6
  26. package/lib/templates/ButtonTemplates/IconButton.js.map +1 -1
  27. package/lib/templates/ButtonTemplates/SubmitButton.d.ts +2 -2
  28. package/lib/templates/ButtonTemplates/SubmitButton.js.map +1 -1
  29. package/lib/templates/ButtonTemplates/index.d.ts +1 -1
  30. package/lib/templates/CyclicSchemaExpandTemplate.d.ts +6 -0
  31. package/lib/templates/CyclicSchemaExpandTemplate.js +15 -0
  32. package/lib/templates/CyclicSchemaExpandTemplate.js.map +1 -0
  33. package/lib/templates/DescriptionField.d.ts +2 -2
  34. package/lib/templates/ErrorList.d.ts +2 -2
  35. package/lib/templates/ErrorList.js.map +1 -1
  36. package/lib/templates/FieldErrorTemplate.d.ts +2 -2
  37. package/lib/templates/FieldErrorTemplate.js +1 -1
  38. package/lib/templates/FieldErrorTemplate.js.map +1 -1
  39. package/lib/templates/FieldHelpTemplate.d.ts +2 -2
  40. package/lib/templates/FieldHelpTemplate.js.map +1 -1
  41. package/lib/templates/FieldTemplate.d.ts +2 -2
  42. package/lib/templates/FieldTemplate.js +1 -1
  43. package/lib/templates/FieldTemplate.js.map +1 -1
  44. package/lib/templates/GridTemplate.d.ts +2 -2
  45. package/lib/templates/MultiSchemaFieldTemplate.d.ts +2 -2
  46. package/lib/templates/ObjectFieldTemplate.d.ts +2 -2
  47. package/lib/templates/ObjectFieldTemplate.js +1 -1
  48. package/lib/templates/ObjectFieldTemplate.js.map +1 -1
  49. package/lib/templates/OptionalDataControlsTemplate.d.ts +2 -2
  50. package/lib/templates/OptionalDataControlsTemplate.js +1 -1
  51. package/lib/templates/OptionalDataControlsTemplate.js.map +1 -1
  52. package/lib/templates/TitleField.d.ts +2 -2
  53. package/lib/templates/WrapIfAdditionalTemplate.d.ts +2 -2
  54. package/lib/templates/WrapIfAdditionalTemplate.js +1 -1
  55. package/lib/templates/WrapIfAdditionalTemplate.js.map +1 -1
  56. package/lib/templates/icons.d.ts +7 -7
  57. package/lib/templates/index.d.ts +1 -1
  58. package/lib/templates/index.js +2 -0
  59. package/lib/templates/index.js.map +1 -1
  60. package/lib/tsconfig.tsbuildinfo +1 -1
  61. package/lib/utils.d.ts +1 -1
  62. package/lib/utils.js.map +1 -1
  63. package/lib/widgets/CheckboxWidget.d.ts +2 -2
  64. package/lib/widgets/CheckboxWidget.js +1 -1
  65. package/lib/widgets/CheckboxWidget.js.map +1 -1
  66. package/lib/widgets/CheckboxesWidget.d.ts +2 -2
  67. package/lib/widgets/CheckboxesWidget.js +1 -1
  68. package/lib/widgets/CheckboxesWidget.js.map +1 -1
  69. package/lib/widgets/ColorWidget.d.ts +2 -2
  70. package/lib/widgets/ColorWidget.js +3 -3
  71. package/lib/widgets/ColorWidget.js.map +1 -1
  72. package/lib/widgets/DateTime/AltDateTimeWidget.d.ts +2 -2
  73. package/lib/widgets/DateTime/AltDateWidget.d.ts +2 -2
  74. package/lib/widgets/DateTime/AltDateWidget.js +1 -1
  75. package/lib/widgets/DateTime/AltDateWidget.js.map +1 -1
  76. package/lib/widgets/DateTime/DateTimeInput.d.ts +2 -2
  77. package/lib/widgets/DateTime/DateTimeInput.js +1 -1
  78. package/lib/widgets/DateTime/DateTimeInput.js.map +1 -1
  79. package/lib/widgets/DateTime/DateTimeWidget.d.ts +2 -2
  80. package/lib/widgets/DateTime/DateWidget.d.ts +2 -2
  81. package/lib/widgets/DateTime/TimeWidget.d.ts +2 -2
  82. package/lib/widgets/DateTime/TimeWidget.js +3 -3
  83. package/lib/widgets/DateTime/TimeWidget.js.map +1 -1
  84. package/lib/widgets/FileWidget.d.ts +2 -2
  85. package/lib/widgets/FileWidget.js +2 -1
  86. package/lib/widgets/FileWidget.js.map +1 -1
  87. package/lib/widgets/PasswordWidget.d.ts +2 -2
  88. package/lib/widgets/PasswordWidget.js +4 -4
  89. package/lib/widgets/PasswordWidget.js.map +1 -1
  90. package/lib/widgets/RadioWidget.d.ts +2 -2
  91. package/lib/widgets/RadioWidget.js +3 -3
  92. package/lib/widgets/RadioWidget.js.map +1 -1
  93. package/lib/widgets/RangeWidget.d.ts +2 -2
  94. package/lib/widgets/RangeWidget.js +1 -1
  95. package/lib/widgets/RangeWidget.js.map +1 -1
  96. package/lib/widgets/SelectWidget.d.ts +2 -2
  97. package/lib/widgets/SelectWidget.js +8 -7
  98. package/lib/widgets/SelectWidget.js.map +1 -1
  99. package/lib/widgets/TextareaWidget.d.ts +2 -2
  100. package/lib/widgets/TextareaWidget.js +3 -3
  101. package/lib/widgets/TextareaWidget.js.map +1 -1
  102. package/lib/widgets/index.d.ts +1 -1
  103. package/package.json +27 -24
  104. package/src/Form/index.ts +4 -3
  105. package/src/Theme/index.ts +2 -2
  106. package/src/templates/ArrayFieldItemTemplate.tsx +2 -8
  107. package/src/templates/ArrayFieldTemplate.tsx +2 -9
  108. package/src/templates/ArrayFieldTitleTemplate.tsx +2 -8
  109. package/src/templates/BaseInputTemplate.tsx +10 -17
  110. package/src/templates/ButtonTemplates/AddButton.tsx +2 -1
  111. package/src/templates/ButtonTemplates/IconButton.tsx +19 -10
  112. package/src/templates/ButtonTemplates/SubmitButton.tsx +2 -1
  113. package/src/templates/ButtonTemplates/index.ts +1 -1
  114. package/src/templates/CyclicSchemaExpandTemplate.tsx +34 -0
  115. package/src/templates/DescriptionField.tsx +1 -1
  116. package/src/templates/ErrorList.tsx +3 -1
  117. package/src/templates/FieldErrorTemplate.tsx +4 -2
  118. package/src/templates/FieldHelpTemplate.tsx +2 -1
  119. package/src/templates/FieldTemplate.tsx +2 -8
  120. package/src/templates/GridTemplate.tsx +1 -1
  121. package/src/templates/MultiSchemaFieldTemplate.tsx +1 -1
  122. package/src/templates/ObjectFieldTemplate.tsx +4 -8
  123. package/src/templates/OptionalDataControlsTemplate.tsx +3 -2
  124. package/src/templates/TitleField.tsx +1 -1
  125. package/src/templates/WrapIfAdditionalTemplate.tsx +2 -10
  126. package/src/templates/icons.tsx +1 -1
  127. package/src/templates/index.ts +3 -1
  128. package/src/utils.ts +2 -2
  129. package/src/widgets/CheckboxWidget.tsx +4 -11
  130. package/src/widgets/CheckboxesWidget.tsx +5 -7
  131. package/src/widgets/ColorWidget.tsx +6 -11
  132. package/src/widgets/DateTime/AltDateTimeWidget.tsx +1 -1
  133. package/src/widgets/DateTime/AltDateWidget.tsx +4 -12
  134. package/src/widgets/DateTime/DateTimeInput.tsx +2 -8
  135. package/src/widgets/DateTime/DateTimeWidget.tsx +1 -1
  136. package/src/widgets/DateTime/DateWidget.tsx +1 -1
  137. package/src/widgets/DateTime/TimeWidget.tsx +6 -11
  138. package/src/widgets/FileWidget.tsx +4 -9
  139. package/src/widgets/PasswordWidget.tsx +7 -12
  140. package/src/widgets/RadioWidget.tsx +7 -9
  141. package/src/widgets/RangeWidget.tsx +3 -9
  142. package/src/widgets/SelectWidget.tsx +25 -18
  143. package/src/widgets/TextareaWidget.tsx +6 -11
  144. package/src/widgets/index.ts +1 -1
@@ -3,10 +3,7 @@ import { withTheme } from "@rjsf/core";
3
3
 
4
4
  // src/templates/ArrayFieldItemTemplate.tsx
5
5
  import { Box, Flex, Group } from "@mantine/core";
6
- import {
7
- getTemplate,
8
- getUiOptions
9
- } from "@rjsf/utils";
6
+ import { getTemplate, getUiOptions } from "@rjsf/utils";
10
7
  import { jsx, jsxs } from "react/jsx-runtime";
11
8
  function ArrayFieldItemTemplate(props) {
12
9
  const { buttonsProps, className, hasToolbar, index, uiSchema, registry, children } = props;
@@ -24,11 +21,7 @@ function ArrayFieldItemTemplate(props) {
24
21
 
25
22
  // src/templates/ArrayFieldTemplate.tsx
26
23
  import { Fieldset, Box as Box2, Group as Group2 } from "@mantine/core";
27
- import {
28
- getTemplate as getTemplate2,
29
- getUiOptions as getUiOptions2,
30
- buttonId
31
- } from "@rjsf/utils";
24
+ import { getTemplate as getTemplate2, getUiOptions as getUiOptions2, buttonId } from "@rjsf/utils";
32
25
  import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
33
26
  function ArrayFieldTemplate(props) {
34
27
  const {
@@ -105,10 +98,7 @@ function ArrayFieldTemplate(props) {
105
98
 
106
99
  // src/templates/ArrayFieldTitleTemplate.tsx
107
100
  import { Grid, Title } from "@mantine/core";
108
- import {
109
- getUiOptions as getUiOptions3,
110
- titleId
111
- } from "@rjsf/utils";
101
+ import { getUiOptions as getUiOptions3, titleId } from "@rjsf/utils";
112
102
  import { jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
113
103
  function ArrayFieldTitleTemplate(props) {
114
104
  const { fieldPathId, title, uiSchema, registry, optionalDataControl } = props;
@@ -131,12 +121,7 @@ function ArrayFieldTitleTemplate(props) {
131
121
  import { useCallback } from "react";
132
122
  import { TextInput, NumberInput } from "@mantine/core";
133
123
  import { SchemaExamples } from "@rjsf/core";
134
- import {
135
- ariaDescribedByIds,
136
- examplesId,
137
- getInputProps,
138
- labelValue
139
- } from "@rjsf/utils";
124
+ import { ariaDescribedByIds, examplesId, getInputProps, labelValue } from "@rjsf/utils";
140
125
 
141
126
  // src/utils.ts
142
127
  var uiOptionsKeys = [
@@ -206,24 +191,24 @@ function BaseInputTemplate(props) {
206
191
  const inputProps = getInputProps(schema, type, options, false);
207
192
  const description = hideLabel ? void 0 : options.description || schema.description;
208
193
  const themeProps = cleanupOptions(options);
209
- const handleNumberChange = useCallback((value2) => onChange(value2), [onChange]);
194
+ const handleNumberChange = useCallback((newValue) => onChange(newValue), [onChange]);
210
195
  const handleChange = useCallback(
211
196
  (e) => {
212
- const handler = onChangeOverride ? onChangeOverride : onChange;
213
- const value2 = e.target.value === "" ? options.emptyValue : e.target.value;
214
- handler(value2);
197
+ const handler = onChangeOverride || onChange;
198
+ const newValue = e.target.value === "" ? options.emptyValue : e.target.value;
199
+ handler(newValue);
215
200
  },
216
201
  [onChange, onChangeOverride, options]
217
202
  );
218
203
  const handleBlur = useCallback(
219
204
  (e) => {
220
- onBlur(id, e.target && e.target.value);
205
+ onBlur(id, e.target?.value);
221
206
  },
222
207
  [onBlur, id]
223
208
  );
224
209
  const handleFocus = useCallback(
225
210
  (e) => {
226
- onFocus(id, e.target && e.target.value);
211
+ onFocus(id, e.target?.value);
227
212
  },
228
213
  [onFocus, id]
229
214
  );
@@ -433,10 +418,11 @@ function ExclamationCircle({ size, style, ...others }) {
433
418
  }
434
419
 
435
420
  // src/templates/ButtonTemplates/IconButton.tsx
421
+ import { memo } from "react";
436
422
  import { ActionIcon } from "@mantine/core";
437
423
  import { TranslatableString } from "@rjsf/utils";
438
424
  import { jsx as jsx6 } from "react/jsx-runtime";
439
- function IconButton(props) {
425
+ function IconButtonFn(props) {
440
426
  const { icon, iconType = "sm", color, onClick, uiSchema, registry, ...otherProps } = props;
441
427
  return /* @__PURE__ */ jsx6(
442
428
  ActionIcon,
@@ -449,13 +435,16 @@ function IconButton(props) {
449
435
  }
450
436
  );
451
437
  }
452
- function CopyButton(props) {
438
+ var IconButton = memo(IconButtonFn);
439
+ var IconButton_default = IconButton;
440
+ function CopyButtonFn(props) {
453
441
  const {
454
442
  registry: { translateString }
455
443
  } = props;
456
444
  return /* @__PURE__ */ jsx6(IconButton, { title: translateString(TranslatableString.CopyButton), variant: "subtle", ...props, icon: /* @__PURE__ */ jsx6(Copy, {}) });
457
445
  }
458
- function MoveDownButton(props) {
446
+ var CopyButton = memo(CopyButtonFn);
447
+ function MoveDownButtonFn(props) {
459
448
  const {
460
449
  registry: { translateString }
461
450
  } = props;
@@ -469,7 +458,8 @@ function MoveDownButton(props) {
469
458
  }
470
459
  );
471
460
  }
472
- function MoveUpButton(props) {
461
+ var MoveDownButton = memo(MoveDownButtonFn);
462
+ function MoveUpButtonFn(props) {
473
463
  const {
474
464
  registry: { translateString }
475
465
  } = props;
@@ -483,7 +473,8 @@ function MoveUpButton(props) {
483
473
  }
484
474
  );
485
475
  }
486
- function RemoveButton(props) {
476
+ var MoveUpButton = memo(MoveUpButtonFn);
477
+ function RemoveButtonFn(props) {
487
478
  const {
488
479
  registry: { translateString }
489
480
  } = props;
@@ -498,12 +489,14 @@ function RemoveButton(props) {
498
489
  }
499
490
  );
500
491
  }
501
- function ClearButton(props) {
492
+ var RemoveButton = memo(RemoveButtonFn);
493
+ function ClearButtonFn(props) {
502
494
  const {
503
495
  registry: { translateString }
504
496
  } = props;
505
497
  return /* @__PURE__ */ jsx6(IconButton, { title: translateString(TranslatableString.ClearButton), variant: "subtle", ...props, icon: /* @__PURE__ */ jsx6(X, {}) });
506
498
  }
499
+ var ClearButton = memo(ClearButtonFn);
507
500
 
508
501
  // src/templates/ButtonTemplates/AddButton.tsx
509
502
  import { jsx as jsx7 } from "react/jsx-runtime";
@@ -511,7 +504,7 @@ function AddButton(props) {
511
504
  const {
512
505
  registry: { translateString }
513
506
  } = props;
514
- return /* @__PURE__ */ jsx7(IconButton, { title: translateString(TranslatableString2.AddItemButton), variant: "subtle", ...props, icon: /* @__PURE__ */ jsx7(Plus, {}) });
507
+ return /* @__PURE__ */ jsx7(IconButton_default, { title: translateString(TranslatableString2.AddItemButton), variant: "subtle", ...props, icon: /* @__PURE__ */ jsx7(Plus, {}) });
515
508
  }
516
509
 
517
510
  // src/templates/ButtonTemplates/SubmitButton.tsx
@@ -540,35 +533,59 @@ function buttonTemplates() {
540
533
  }
541
534
  var ButtonTemplates_default = buttonTemplates;
542
535
 
536
+ // src/templates/CyclicSchemaExpandTemplate.tsx
537
+ import { Alert, Button as Button2, Group as Group3 } from "@mantine/core";
538
+ import { ID_KEY, TranslatableString as TranslatableString3 } from "@rjsf/utils";
539
+ import { jsx as jsx9 } from "react/jsx-runtime";
540
+ function CyclicSchemaExpandTemplate(props) {
541
+ const { name, fieldPathId, registry, onExpand } = props;
542
+ const { translateString } = registry;
543
+ const buttonId4 = `${fieldPathId[ID_KEY]}-button`;
544
+ return /* @__PURE__ */ jsx9(
545
+ Alert,
546
+ {
547
+ color: "yellow",
548
+ variant: "transparent",
549
+ title: translateString(TranslatableString3.CycleDetected, [name]),
550
+ icon: /* @__PURE__ */ jsx9(ExclamationCircle, {}),
551
+ mt: "md",
552
+ children: /* @__PURE__ */ jsx9(Group3, { children: /* @__PURE__ */ jsx9(Button2, { id: buttonId4, size: "xs", variant: "outline", color: "yellow", onClick: () => onExpand(fieldPathId[ID_KEY]), children: translateString(TranslatableString3.ExpandButton) }) })
553
+ }
554
+ );
555
+ }
556
+
543
557
  // src/templates/DescriptionField.tsx
544
558
  import { Text } from "@mantine/core";
545
559
  import { RichDescription } from "@rjsf/core";
546
- import { jsx as jsx9 } from "react/jsx-runtime";
560
+ import { jsx as jsx10 } from "react/jsx-runtime";
547
561
  function DescriptionField(props) {
548
562
  const { id, description, registry, uiSchema } = props;
549
563
  if (description) {
550
- return /* @__PURE__ */ jsx9(Text, { id, mt: 3, mb: "sm", children: /* @__PURE__ */ jsx9(RichDescription, { description, registry, uiSchema }) });
564
+ return /* @__PURE__ */ jsx10(Text, { id, mt: 3, mb: "sm", children: /* @__PURE__ */ jsx10(RichDescription, { description, registry, uiSchema }) });
551
565
  }
552
566
  return null;
553
567
  }
554
568
 
555
569
  // src/templates/ErrorList.tsx
556
- import { Alert, Title as Title2, List } from "@mantine/core";
557
- import { TranslatableString as TranslatableString3 } from "@rjsf/utils";
558
- import { jsx as jsx10 } from "react/jsx-runtime";
570
+ import { Alert as Alert2, Title as Title2, List } from "@mantine/core";
571
+ import { TranslatableString as TranslatableString4 } from "@rjsf/utils";
572
+ import { jsx as jsx11 } from "react/jsx-runtime";
559
573
  function ErrorList({
560
574
  errors,
561
575
  registry
562
576
  }) {
563
577
  const { translateString } = registry;
564
- return /* @__PURE__ */ jsx10(
565
- Alert,
578
+ return /* @__PURE__ */ jsx11(
579
+ Alert2,
566
580
  {
567
581
  color: "red",
568
582
  variant: "transparent",
569
- title: /* @__PURE__ */ jsx10(Title2, { order: 5, fw: "normal", children: translateString(TranslatableString3.ErrorsLabel) }),
570
- icon: /* @__PURE__ */ jsx10(ExclamationCircle, {}),
571
- children: /* @__PURE__ */ jsx10(List, { children: errors.map((error, index) => /* @__PURE__ */ jsx10(List.Item, { c: "red", children: error.stack }, `error-${index}`)) })
583
+ title: /* @__PURE__ */ jsx11(Title2, { order: 5, fw: "normal", children: translateString(TranslatableString4.ErrorsLabel) }),
584
+ icon: /* @__PURE__ */ jsx11(ExclamationCircle, {}),
585
+ children: /* @__PURE__ */ jsx11(List, { children: errors.map((error, index) => (
586
+ // oxlint-disable-next-line react/no-array-index-key
587
+ /* @__PURE__ */ jsx11(List.Item, { c: "red", children: error.stack }, `error-${index}`)
588
+ )) })
572
589
  }
573
590
  );
574
591
  }
@@ -576,35 +593,35 @@ function ErrorList({
576
593
  // src/templates/FieldErrorTemplate.tsx
577
594
  import { Box as Box3, List as List2 } from "@mantine/core";
578
595
  import { errorId } from "@rjsf/utils";
579
- import { jsx as jsx11 } from "react/jsx-runtime";
596
+ import { jsx as jsx12 } from "react/jsx-runtime";
580
597
  function FieldErrorTemplate({ errors, fieldPathId }) {
581
- if (!errors || !errors.length) {
598
+ if (!errors?.length) {
582
599
  return null;
583
600
  }
584
601
  const id = errorId(fieldPathId);
585
- return /* @__PURE__ */ jsx11(Box3, { id, c: "red", display: "none", children: /* @__PURE__ */ jsx11(List2, { children: errors.map((error, index) => /* @__PURE__ */ jsx11(List2.Item, { children: error }, `field-error-${index}`)) }) });
602
+ return /* @__PURE__ */ jsx12(Box3, { id, c: "red", display: "none", children: /* @__PURE__ */ jsx12(List2, { children: errors.map((error, index) => (
603
+ // oxlint-disable-next-line react/no-array-index-key
604
+ /* @__PURE__ */ jsx12(List2.Item, { children: error }, `field-error-${index}`)
605
+ )) }) });
586
606
  }
587
607
 
588
608
  // src/templates/FieldHelpTemplate.tsx
589
609
  import { Text as Text2 } from "@mantine/core";
590
610
  import { RichHelp } from "@rjsf/core";
591
611
  import { helpId } from "@rjsf/utils";
592
- import { jsx as jsx12 } from "react/jsx-runtime";
612
+ import { jsx as jsx13 } from "react/jsx-runtime";
593
613
  function FieldHelpTemplate(props) {
594
614
  const { fieldPathId, help, uiSchema, registry } = props;
595
615
  if (!help) {
596
616
  return null;
597
617
  }
598
- return /* @__PURE__ */ jsx12(Text2, { id: helpId(fieldPathId), size: "sm", my: "xs", c: "dimmed", children: /* @__PURE__ */ jsx12(RichHelp, { help, registry, uiSchema }) });
618
+ return /* @__PURE__ */ jsx13(Text2, { id: helpId(fieldPathId), size: "sm", my: "xs", c: "dimmed", children: /* @__PURE__ */ jsx13(RichHelp, { help, registry, uiSchema }) });
599
619
  }
600
620
 
601
621
  // src/templates/FieldTemplate.tsx
602
622
  import { Box as Box4 } from "@mantine/core";
603
- import {
604
- getTemplate as getTemplate3,
605
- getUiOptions as getUiOptions4
606
- } from "@rjsf/utils";
607
- import { jsx as jsx13, jsxs as jsxs6 } from "react/jsx-runtime";
623
+ import { getTemplate as getTemplate3, getUiOptions as getUiOptions4 } from "@rjsf/utils";
624
+ import { jsx as jsx14, jsxs as jsxs6 } from "react/jsx-runtime";
608
625
  function FieldTemplate(props) {
609
626
  const {
610
627
  id,
@@ -630,7 +647,7 @@ function FieldTemplate(props) {
630
647
  uiOptions
631
648
  );
632
649
  if (hidden) {
633
- return /* @__PURE__ */ jsx13(Box4, { display: "none", children });
650
+ return /* @__PURE__ */ jsx14(Box4, { display: "none", children });
634
651
  }
635
652
  return /* @__PURE__ */ jsxs6(
636
653
  WrapIfAdditionalTemplate2,
@@ -656,16 +673,16 @@ function FieldTemplate(props) {
656
673
 
657
674
  // src/templates/GridTemplate.tsx
658
675
  import { Container, Grid as Grid2 } from "@mantine/core";
659
- import { jsx as jsx14 } from "react/jsx-runtime";
676
+ import { jsx as jsx15 } from "react/jsx-runtime";
660
677
  function GridTemplate(props) {
661
678
  const { children, column, fluid = true, ...rest } = props;
662
679
  if (column) {
663
- return /* @__PURE__ */ jsx14(Grid2.Col, { ...rest, children });
680
+ return /* @__PURE__ */ jsx15(Grid2.Col, { ...rest, children });
664
681
  }
665
682
  if (fluid) {
666
- return /* @__PURE__ */ jsx14(Container, { p: "4", mx: 0, w: "100%", children: /* @__PURE__ */ jsx14(Grid2, { ...rest, children }) });
683
+ return /* @__PURE__ */ jsx15(Container, { p: "4", mx: 0, w: "100%", children: /* @__PURE__ */ jsx15(Grid2, { ...rest, children }) });
667
684
  }
668
- return /* @__PURE__ */ jsx14(Grid2, { grow: true, ...rest, children });
685
+ return /* @__PURE__ */ jsx15(Grid2, { grow: true, ...rest, children });
669
686
  }
670
687
 
671
688
  // src/templates/MultiSchemaFieldTemplate.tsx
@@ -679,16 +696,9 @@ function MultiSchemaFieldTemplate({ selector, optionSchemaField }) {
679
696
  }
680
697
 
681
698
  // src/templates/ObjectFieldTemplate.tsx
682
- import { Box as Box5, Container as Container2, Group as Group3, SimpleGrid } from "@mantine/core";
683
- import {
684
- buttonId as buttonId2,
685
- canExpand,
686
- descriptionId,
687
- getTemplate as getTemplate4,
688
- getUiOptions as getUiOptions5,
689
- titleId as titleId2
690
- } from "@rjsf/utils";
691
- import { jsx as jsx15, jsxs as jsxs8 } from "react/jsx-runtime";
699
+ import { Box as Box5, Container as Container2, Group as Group4, SimpleGrid } from "@mantine/core";
700
+ import { buttonId as buttonId2, canExpand, descriptionId, getTemplate as getTemplate4, getUiOptions as getUiOptions5, titleId as titleId2 } from "@rjsf/utils";
701
+ import { jsx as jsx16, jsxs as jsxs8 } from "react/jsx-runtime";
692
702
  function ObjectFieldTemplate(props) {
693
703
  const {
694
704
  title,
@@ -720,7 +730,7 @@ function ObjectFieldTemplate(props) {
720
730
  const gridSpacing = uiOptions?.gridSpacing;
721
731
  const gridVerticalSpacing = uiOptions?.gridVerticalSpacing;
722
732
  return /* @__PURE__ */ jsxs8(Container2, { id: fieldPathId.$id, p: 0, children: [
723
- title && /* @__PURE__ */ jsx15(
733
+ title && /* @__PURE__ */ jsx16(
724
734
  TitleFieldTemplate,
725
735
  {
726
736
  id: titleId2(fieldPathId),
@@ -732,7 +742,7 @@ function ObjectFieldTemplate(props) {
732
742
  optionalDataControl: showOptionalDataControlInTitle ? optionalDataControl : void 0
733
743
  }
734
744
  ),
735
- description && /* @__PURE__ */ jsx15(
745
+ description && /* @__PURE__ */ jsx16(
736
746
  DescriptionFieldTemplate,
737
747
  {
738
748
  id: descriptionId(fieldPathId),
@@ -751,11 +761,11 @@ function ObjectFieldTemplate(props) {
751
761
  mb: "sm",
752
762
  children: [
753
763
  !showOptionalDataControlInTitle ? optionalDataControl : void 0,
754
- properties.filter((e) => !e.hidden).map((element) => /* @__PURE__ */ jsx15(Box5, { children: element.content }, element.name))
764
+ properties.filter((e) => !e.hidden).map((element) => /* @__PURE__ */ jsx16(Box5, { children: element.content }, element.name))
755
765
  ]
756
766
  }
757
767
  ),
758
- canExpand(schema, uiSchema, formData) && /* @__PURE__ */ jsx15(Group3, { mt: "xs", justify: "flex-end", children: /* @__PURE__ */ jsx15(
768
+ canExpand(schema, uiSchema, formData) && /* @__PURE__ */ jsx16(Group4, { mt: "xs", justify: "flex-end", children: /* @__PURE__ */ jsx16(
759
769
  AddButton2,
760
770
  {
761
771
  id: buttonId2(fieldPathId, "add"),
@@ -770,11 +780,11 @@ function ObjectFieldTemplate(props) {
770
780
  }
771
781
 
772
782
  // src/templates/OptionalDataControlsTemplate.tsx
773
- import { jsx as jsx16 } from "react/jsx-runtime";
783
+ import { jsx as jsx17 } from "react/jsx-runtime";
774
784
  function OptionalDataControlsTemplate(props) {
775
785
  const { id, registry, label, onAddClick, onRemoveClick } = props;
776
786
  if (onAddClick) {
777
- return /* @__PURE__ */ jsx16(
787
+ return /* @__PURE__ */ jsx17(
778
788
  AddButton,
779
789
  {
780
790
  id,
@@ -785,8 +795,9 @@ function OptionalDataControlsTemplate(props) {
785
795
  title: label
786
796
  }
787
797
  );
788
- } else if (onRemoveClick) {
789
- return /* @__PURE__ */ jsx16(
798
+ }
799
+ if (onRemoveClick) {
800
+ return /* @__PURE__ */ jsx17(
790
801
  RemoveButton,
791
802
  {
792
803
  id,
@@ -798,19 +809,19 @@ function OptionalDataControlsTemplate(props) {
798
809
  }
799
810
  );
800
811
  }
801
- return /* @__PURE__ */ jsx16("em", { id, children: label });
812
+ return /* @__PURE__ */ jsx17("em", { id, children: label });
802
813
  }
803
814
 
804
815
  // src/templates/TitleField.tsx
805
816
  import { Grid as Grid3, Title as Title3 } from "@mantine/core";
806
- import { jsx as jsx17, jsxs as jsxs9 } from "react/jsx-runtime";
817
+ import { jsx as jsx18, jsxs as jsxs9 } from "react/jsx-runtime";
807
818
  function TitleField(props) {
808
819
  const { id, title, optionalDataControl } = props;
809
- let heading = title ? /* @__PURE__ */ jsx17(Title3, { id, order: 3, fw: "normal", children: title }) : null;
820
+ let heading = title ? /* @__PURE__ */ jsx18(Title3, { id, order: 3, fw: "normal", children: title }) : null;
810
821
  if (optionalDataControl) {
811
822
  heading = /* @__PURE__ */ jsxs9(Grid3, { children: [
812
- /* @__PURE__ */ jsx17(Grid3.Col, { span: "auto", children: heading }),
813
- /* @__PURE__ */ jsx17(Grid3.Col, { span: "content", children: optionalDataControl })
823
+ /* @__PURE__ */ jsx18(Grid3.Col, { span: "auto", children: heading }),
824
+ /* @__PURE__ */ jsx18(Grid3.Col, { span: "content", children: optionalDataControl })
814
825
  ] });
815
826
  }
816
827
  return heading;
@@ -818,13 +829,8 @@ function TitleField(props) {
818
829
 
819
830
  // src/templates/WrapIfAdditionalTemplate.tsx
820
831
  import { Flex as Flex2, Grid as Grid4, TextInput as TextInput2 } from "@mantine/core";
821
- import {
822
- ADDITIONAL_PROPERTY_FLAG,
823
- UI_OPTIONS_KEY,
824
- buttonId as buttonId3,
825
- TranslatableString as TranslatableString4
826
- } from "@rjsf/utils";
827
- import { jsx as jsx18, jsxs as jsxs10 } from "react/jsx-runtime";
832
+ import { ADDITIONAL_PROPERTY_FLAG, UI_OPTIONS_KEY, buttonId as buttonId3, TranslatableString as TranslatableString5 } from "@rjsf/utils";
833
+ import { jsx as jsx19, jsxs as jsxs10 } from "react/jsx-runtime";
828
834
  function WrapIfAdditionalTemplate(props) {
829
835
  const {
830
836
  id,
@@ -845,19 +851,19 @@ function WrapIfAdditionalTemplate(props) {
845
851
  } = props;
846
852
  const { templates, translateString } = registry;
847
853
  const { RemoveButton: RemoveButton2 } = templates.ButtonTemplates;
848
- const keyLabel = translateString(TranslatableString4.KeyLabel, [label]);
854
+ const keyLabel = translateString(TranslatableString5.KeyLabel, [label]);
849
855
  const additional = ADDITIONAL_PROPERTY_FLAG in schema;
850
856
  if (!additional) {
851
- return /* @__PURE__ */ jsx18("div", { className: classNames, style, children });
857
+ return /* @__PURE__ */ jsx19("div", { className: classNames, style, children });
852
858
  }
853
859
  const uiOptions = uiSchema ? uiSchema[UI_OPTIONS_KEY] : {};
854
860
  const buttonUiOptions = {
855
861
  ...uiSchema,
856
862
  [UI_OPTIONS_KEY]: { ...uiOptions, block: true }
857
863
  };
858
- return /* @__PURE__ */ jsx18("div", { className: classNames, style, children: /* @__PURE__ */ jsxs10(Flex2, { gap: "xs", align: "end", justify: "center", children: [
864
+ return /* @__PURE__ */ jsx19("div", { className: classNames, style, children: /* @__PURE__ */ jsxs10(Flex2, { gap: "xs", align: "end", justify: "center", children: [
859
865
  /* @__PURE__ */ jsxs10(Grid4, { w: "100%", align: "center", children: [
860
- /* @__PURE__ */ jsx18(Grid4.Col, { span: 6, className: "form-additional", children: /* @__PURE__ */ jsx18(
866
+ /* @__PURE__ */ jsx19(Grid4.Col, { span: 6, className: "form-additional", children: /* @__PURE__ */ jsx19(
861
867
  TextInput2,
862
868
  {
863
869
  className: "form-group",
@@ -872,9 +878,9 @@ function WrapIfAdditionalTemplate(props) {
872
878
  },
873
879
  label
874
880
  ) }),
875
- /* @__PURE__ */ jsx18(Grid4.Col, { span: 6, className: "form-additional", children })
881
+ /* @__PURE__ */ jsx19(Grid4.Col, { span: 6, className: "form-additional", children })
876
882
  ] }),
877
- /* @__PURE__ */ jsx18("div", { children: /* @__PURE__ */ jsx18(
883
+ /* @__PURE__ */ jsx19("div", { children: /* @__PURE__ */ jsx19(
878
884
  RemoveButton2,
879
885
  {
880
886
  id: buttonId3(id, "remove"),
@@ -896,6 +902,7 @@ function generateTemplates() {
896
902
  ArrayFieldTemplate,
897
903
  ArrayFieldTitleTemplate,
898
904
  BaseInputTemplate,
905
+ CyclicSchemaExpandTemplate,
899
906
  ButtonTemplates: ButtonTemplates_default(),
900
907
  DescriptionFieldTemplate: DescriptionField,
901
908
  ErrorListTemplate: ErrorList,
@@ -928,7 +935,7 @@ import {
928
935
  optionId,
929
936
  titleId as titleId3
930
937
  } from "@rjsf/utils";
931
- import { Fragment as Fragment2, jsx as jsx19, jsxs as jsxs11 } from "react/jsx-runtime";
938
+ import { Fragment as Fragment2, jsx as jsx20, jsxs as jsxs11 } from "react/jsx-runtime";
932
939
  function CheckboxesWidget(props) {
933
940
  const {
934
941
  id,
@@ -975,8 +982,8 @@ function CheckboxesWidget(props) {
975
982
  );
976
983
  const selectedIndexes = enumOptionsIndexForValue(value, enumOptions, true);
977
984
  return Array.isArray(enumOptions) && enumOptions.length > 0 ? /* @__PURE__ */ jsxs11(Fragment2, { children: [
978
- !hideLabel && !!label && /* @__PURE__ */ jsx19(Input.Label, { id: titleId3(id), required, children: label }),
979
- /* @__PURE__ */ jsx19(
985
+ !hideLabel && !!label && /* @__PURE__ */ jsx20(Input.Label, { id: titleId3(id), required, children: label }),
986
+ /* @__PURE__ */ jsx20(
980
987
  Checkbox.Group,
981
988
  {
982
989
  id,
@@ -987,19 +994,19 @@ function CheckboxesWidget(props) {
987
994
  error: rawErrors && rawErrors.length > 0 ? rawErrors.join("\n") : void 0,
988
995
  "aria-describedby": ariaDescribedByIds2(id),
989
996
  ...themeProps,
990
- children: Array.isArray(enumOptions) ? /* @__PURE__ */ jsx19(Flex3, { mt: "xs", direction: inline ? "row" : "column", gap: "xs", wrap: "wrap", children: enumOptions.map((option, i) => /* @__PURE__ */ jsx19(
997
+ children: Array.isArray(enumOptions) ? /* @__PURE__ */ jsx20(Flex3, { mt: "xs", direction: inline ? "row" : "column", gap: "xs", wrap: "wrap", children: enumOptions.map((option, i) => /* @__PURE__ */ jsx20(
991
998
  Checkbox,
992
999
  {
993
1000
  id: optionId(id, i),
994
1001
  name: htmlName || id,
995
1002
  value: enumOptionValueEncoder(option.value, i, optionValueFormat),
996
1003
  label: option.label,
997
- disabled: Array.isArray(enumDisabled) && enumDisabled.indexOf(option.value) !== -1,
1004
+ disabled: Array.isArray(enumDisabled) && enumDisabled.includes(option.value),
998
1005
  autoFocus: i === 0 && autofocus,
999
1006
  onBlur: handleBlur,
1000
1007
  onFocus: handleFocus
1001
1008
  },
1002
- i
1009
+ String(option.value)
1003
1010
  )) }) : null
1004
1011
  }
1005
1012
  )
@@ -1009,13 +1016,8 @@ function CheckboxesWidget(props) {
1009
1016
  // src/widgets/CheckboxWidget.tsx
1010
1017
  import { useCallback as useCallback3 } from "react";
1011
1018
  import { Checkbox as Checkbox2 } from "@mantine/core";
1012
- import {
1013
- descriptionId as descriptionId2,
1014
- getTemplate as getTemplate5,
1015
- labelValue as labelValue2,
1016
- ariaDescribedByIds as ariaDescribedByIds3
1017
- } from "@rjsf/utils";
1018
- import { Fragment as Fragment3, jsx as jsx20, jsxs as jsxs12 } from "react/jsx-runtime";
1019
+ import { descriptionId as descriptionId2, getTemplate as getTemplate5, labelValue as labelValue2, ariaDescribedByIds as ariaDescribedByIds3 } from "@rjsf/utils";
1020
+ import { Fragment as Fragment3, jsx as jsx21, jsxs as jsxs12 } from "react/jsx-runtime";
1019
1021
  function CheckboxWidget(props) {
1020
1022
  const {
1021
1023
  id,
@@ -1068,7 +1070,7 @@ function CheckboxWidget(props) {
1068
1070
  );
1069
1071
  const description = options.description || schema.description;
1070
1072
  return /* @__PURE__ */ jsxs12(Fragment3, { children: [
1071
- !hideLabel && !!description && /* @__PURE__ */ jsx20(
1073
+ !hideLabel && !!description && /* @__PURE__ */ jsx21(
1072
1074
  DescriptionFieldTemplate,
1073
1075
  {
1074
1076
  id: descriptionId2(id),
@@ -1078,7 +1080,7 @@ function CheckboxWidget(props) {
1078
1080
  registry
1079
1081
  }
1080
1082
  ),
1081
- /* @__PURE__ */ jsx20(
1083
+ /* @__PURE__ */ jsx21(
1082
1084
  Checkbox2,
1083
1085
  {
1084
1086
  id,
@@ -1101,11 +1103,8 @@ function CheckboxWidget(props) {
1101
1103
  // src/widgets/ColorWidget.tsx
1102
1104
  import { useCallback as useCallback4 } from "react";
1103
1105
  import { ColorInput } from "@mantine/core";
1104
- import {
1105
- labelValue as labelValue3,
1106
- ariaDescribedByIds as ariaDescribedByIds4
1107
- } from "@rjsf/utils";
1108
- import { jsx as jsx21 } from "react/jsx-runtime";
1106
+ import { labelValue as labelValue3, ariaDescribedByIds as ariaDescribedByIds4 } from "@rjsf/utils";
1107
+ import { jsx as jsx22 } from "react/jsx-runtime";
1109
1108
  function ColorWidget(props) {
1110
1109
  const {
1111
1110
  id,
@@ -1134,7 +1133,7 @@ function ColorWidget(props) {
1134
1133
  const handleBlur = useCallback4(
1135
1134
  ({ target }) => {
1136
1135
  if (onBlur) {
1137
- onBlur(id, target && target.value);
1136
+ onBlur(id, target?.value);
1138
1137
  }
1139
1138
  },
1140
1139
  [onBlur, id]
@@ -1142,12 +1141,12 @@ function ColorWidget(props) {
1142
1141
  const handleFocus = useCallback4(
1143
1142
  ({ target }) => {
1144
1143
  if (onFocus) {
1145
- onFocus(id, target && target.value);
1144
+ onFocus(id, target?.value);
1146
1145
  }
1147
1146
  },
1148
1147
  [onFocus, id]
1149
1148
  );
1150
- return /* @__PURE__ */ jsx21(
1149
+ return /* @__PURE__ */ jsx22(
1151
1150
  ColorInput,
1152
1151
  {
1153
1152
  id,
@@ -1170,66 +1169,63 @@ function ColorWidget(props) {
1170
1169
  }
1171
1170
 
1172
1171
  // src/widgets/DateTime/AltDateTimeWidget.tsx
1173
- import { jsx as jsx22 } from "react/jsx-runtime";
1172
+ import { jsx as jsx23 } from "react/jsx-runtime";
1174
1173
  function AltDateTimeWidget(props) {
1175
1174
  const { AltDateWidget: AltDateWidget2 } = props.registry.widgets;
1176
- return /* @__PURE__ */ jsx22(AltDateWidget2, { time: true, ...props });
1175
+ return /* @__PURE__ */ jsx23(AltDateWidget2, { time: true, ...props });
1177
1176
  }
1178
1177
 
1179
1178
  // src/widgets/DateTime/AltDateWidget.tsx
1180
- import { Flex as Flex4, Box as Box6, Group as Group4, Button as Button2, Select, Input as Input2 } from "@mantine/core";
1181
- import {
1182
- ariaDescribedByIds as ariaDescribedByIds5,
1183
- dateRangeOptions,
1184
- titleId as titleId4,
1185
- TranslatableString as TranslatableString5,
1186
- useAltDateWidgetProps
1187
- } from "@rjsf/utils";
1188
- import { Fragment as Fragment4, jsx as jsx23, jsxs as jsxs13 } from "react/jsx-runtime";
1179
+ import { Flex as Flex4, Box as Box6, Group as Group5, Button as Button3, Select, Input as Input2 } from "@mantine/core";
1180
+ import { ariaDescribedByIds as ariaDescribedByIds5, dateRangeOptions, titleId as titleId4, TranslatableString as TranslatableString6, useAltDateWidgetProps } from "@rjsf/utils";
1181
+ import { Fragment as Fragment4, jsx as jsx24, jsxs as jsxs13 } from "react/jsx-runtime";
1189
1182
  function AltDateWidget(props) {
1190
1183
  const { id, required, disabled, readonly, label, hideLabel, rawErrors, options, registry } = props;
1191
1184
  const { translateString } = registry;
1192
1185
  const { elements, handleChange, handleClear, handleSetNow } = useAltDateWidgetProps(props);
1193
1186
  return /* @__PURE__ */ jsxs13(Fragment4, { children: [
1194
- !hideLabel && !!label && /* @__PURE__ */ jsx23(Input2.Label, { id: titleId4(id), required, children: label }),
1187
+ !hideLabel && !!label && /* @__PURE__ */ jsx24(Input2.Label, { id: titleId4(id), required, children: label }),
1195
1188
  /* @__PURE__ */ jsxs13(Flex4, { gap: "xs", align: "center", wrap: "nowrap", children: [
1196
1189
  elements.map((elemProps, i) => {
1197
1190
  const elemId = `${id}_${elemProps.type}`;
1198
- return /* @__PURE__ */ jsx23(Box6, { children: /* @__PURE__ */ jsx23(
1199
- Select,
1200
- {
1201
- id: elemId,
1202
- name: elemId,
1203
- placeholder: elemProps.type,
1204
- disabled: disabled || readonly,
1205
- data: dateRangeOptions(elemProps.range[0], elemProps.range[1]).map((item) => item.value.toString()),
1206
- value: !elemProps.value || elemProps.value < 0 ? null : elemProps.value.toString(),
1207
- onChange: (v) => handleChange(elemProps.type, v || void 0),
1208
- searchable: false,
1209
- allowDeselect: false,
1210
- comboboxProps: { withinPortal: false },
1211
- "aria-describedby": ariaDescribedByIds5(elemId)
1212
- }
1213
- ) }, i);
1191
+ return (
1192
+ // oxlint-disable-next-line react/no-array-index-key
1193
+ /* @__PURE__ */ jsx24(Box6, { children: /* @__PURE__ */ jsx24(
1194
+ Select,
1195
+ {
1196
+ id: elemId,
1197
+ name: elemId,
1198
+ placeholder: elemProps.type,
1199
+ disabled: disabled || readonly,
1200
+ data: dateRangeOptions(elemProps.range[0], elemProps.range[1]).map((item) => item.value.toString()),
1201
+ value: !elemProps.value || elemProps.value < 0 ? null : elemProps.value.toString(),
1202
+ onChange: (v) => handleChange(elemProps.type, v || void 0),
1203
+ searchable: false,
1204
+ allowDeselect: false,
1205
+ comboboxProps: { withinPortal: false },
1206
+ "aria-describedby": ariaDescribedByIds5(elemId)
1207
+ }
1208
+ ) }, i)
1209
+ );
1214
1210
  }),
1215
- /* @__PURE__ */ jsxs13(Group4, { wrap: "nowrap", gap: 3, children: [
1216
- (options.hideNowButton !== "undefined" ? !options.hideNowButton : true) && /* @__PURE__ */ jsx23(Button2, { variant: "subtle", size: "xs", onClick: handleSetNow, children: translateString(TranslatableString5.NowLabel) }),
1217
- (options.hideClearButton !== "undefined" ? !options.hideClearButton : true) && /* @__PURE__ */ jsx23(Button2, { variant: "subtle", size: "xs", onClick: handleClear, children: translateString(TranslatableString5.ClearLabel) })
1211
+ /* @__PURE__ */ jsxs13(Group5, { wrap: "nowrap", gap: 3, children: [
1212
+ (options.hideNowButton !== "undefined" ? !options.hideNowButton : true) && /* @__PURE__ */ jsx24(Button3, { variant: "subtle", size: "xs", onClick: handleSetNow, children: translateString(TranslatableString6.NowLabel) }),
1213
+ (options.hideClearButton !== "undefined" ? !options.hideClearButton : true) && /* @__PURE__ */ jsx24(Button3, { variant: "subtle", size: "xs", onClick: handleClear, children: translateString(TranslatableString6.ClearLabel) })
1218
1214
  ] })
1219
1215
  ] }),
1220
- rawErrors && rawErrors?.length > 0 && rawErrors.map((error, index) => /* @__PURE__ */ jsx23(Input2.Error, { children: error }, `alt-date-widget-input-errors-${index}`))
1216
+ rawErrors && rawErrors?.length > 0 && rawErrors.map((error, index) => (
1217
+ // oxlint-disable-next-line react/no-array-index-key
1218
+ /* @__PURE__ */ jsx24(Input2.Error, { children: error }, `alt-date-widget-input-errors-${index}`)
1219
+ ))
1221
1220
  ] });
1222
1221
  }
1223
1222
 
1224
1223
  // src/widgets/DateTime/DateTimeInput.tsx
1225
1224
  import { useCallback as useCallback5 } from "react";
1226
1225
  import { DateInput } from "@mantine/dates";
1227
- import {
1228
- ariaDescribedByIds as ariaDescribedByIds6,
1229
- labelValue as labelValue4
1230
- } from "@rjsf/utils";
1226
+ import { ariaDescribedByIds as ariaDescribedByIds6, labelValue as labelValue4 } from "@rjsf/utils";
1231
1227
  import dayjs from "dayjs";
1232
- import { jsx as jsx24 } from "react/jsx-runtime";
1228
+ import { jsx as jsx25 } from "react/jsx-runtime";
1233
1229
  var dateParser = (input, format) => {
1234
1230
  if (!input) {
1235
1231
  return null;
@@ -1279,7 +1275,7 @@ function DateTimeInput(props) {
1279
1275
  onFocus(id, value);
1280
1276
  }
1281
1277
  }, [onFocus, id, value]);
1282
- return /* @__PURE__ */ jsx24(
1278
+ return /* @__PURE__ */ jsx25(
1283
1279
  DateInput,
1284
1280
  {
1285
1281
  id,
@@ -1305,10 +1301,10 @@ function DateTimeInput(props) {
1305
1301
  }
1306
1302
 
1307
1303
  // src/widgets/DateTime/DateWidget.tsx
1308
- import { jsx as jsx25 } from "react/jsx-runtime";
1304
+ import { jsx as jsx26 } from "react/jsx-runtime";
1309
1305
  function DateWidget(props) {
1310
1306
  const { valueFormat = "YYYY-MM-DD", displayFormat, ...otherOptions } = props.options;
1311
- return /* @__PURE__ */ jsx25(
1307
+ return /* @__PURE__ */ jsx26(
1312
1308
  DateTimeInput,
1313
1309
  {
1314
1310
  ...props,
@@ -1320,10 +1316,10 @@ function DateWidget(props) {
1320
1316
  }
1321
1317
 
1322
1318
  // src/widgets/DateTime/DateTimeWidget.tsx
1323
- import { jsx as jsx26 } from "react/jsx-runtime";
1319
+ import { jsx as jsx27 } from "react/jsx-runtime";
1324
1320
  function DateTimeWidget(props) {
1325
1321
  const { valueFormat = "YYYY-MM-DD HH:mm:ss", displayFormat, ...otherOptions } = props.options;
1326
- return /* @__PURE__ */ jsx26(
1322
+ return /* @__PURE__ */ jsx27(
1327
1323
  DateTimeInput,
1328
1324
  {
1329
1325
  ...props,
@@ -1337,11 +1333,8 @@ function DateTimeWidget(props) {
1337
1333
  // src/widgets/DateTime/TimeWidget.tsx
1338
1334
  import { useCallback as useCallback6 } from "react";
1339
1335
  import { TimeInput } from "@mantine/dates";
1340
- import {
1341
- labelValue as labelValue5,
1342
- ariaDescribedByIds as ariaDescribedByIds7
1343
- } from "@rjsf/utils";
1344
- import { jsx as jsx27 } from "react/jsx-runtime";
1336
+ import { labelValue as labelValue5, ariaDescribedByIds as ariaDescribedByIds7 } from "@rjsf/utils";
1337
+ import { jsx as jsx28 } from "react/jsx-runtime";
1345
1338
  function TimeWidget(props) {
1346
1339
  const {
1347
1340
  id,
@@ -1370,7 +1363,7 @@ function TimeWidget(props) {
1370
1363
  const handleBlur = useCallback6(
1371
1364
  ({ target }) => {
1372
1365
  if (onBlur) {
1373
- onBlur(id, target && target.value);
1366
+ onBlur(id, target?.value);
1374
1367
  }
1375
1368
  },
1376
1369
  [onBlur, id]
@@ -1378,12 +1371,12 @@ function TimeWidget(props) {
1378
1371
  const handleFocus = useCallback6(
1379
1372
  ({ target }) => {
1380
1373
  if (onFocus) {
1381
- onFocus(id, target && target.value);
1374
+ onFocus(id, target?.value);
1382
1375
  }
1383
1376
  },
1384
1377
  [onFocus, id]
1385
1378
  );
1386
- return /* @__PURE__ */ jsx27(
1379
+ return /* @__PURE__ */ jsx28(
1387
1380
  TimeInput,
1388
1381
  {
1389
1382
  id,
@@ -1408,12 +1401,8 @@ function TimeWidget(props) {
1408
1401
  // src/widgets/FileWidget.tsx
1409
1402
  import { useCallback as useCallback7 } from "react";
1410
1403
  import { FileInput, Pill } from "@mantine/core";
1411
- import {
1412
- ariaDescribedByIds as ariaDescribedByIds8,
1413
- labelValue as labelValue6,
1414
- useFileWidgetProps
1415
- } from "@rjsf/utils";
1416
- import { jsx as jsx28 } from "react/jsx-runtime";
1404
+ import { ariaDescribedByIds as ariaDescribedByIds8, labelValue as labelValue6, useFileWidgetProps } from "@rjsf/utils";
1405
+ import { jsx as jsx29 } from "react/jsx-runtime";
1417
1406
  function FileWidget(props) {
1418
1407
  const {
1419
1408
  id,
@@ -1443,11 +1432,14 @@ function FileWidget(props) {
1443
1432
  );
1444
1433
  const ValueComponent = useCallback7(() => {
1445
1434
  if (Array.isArray(filesInfo) && filesInfo.length > 0) {
1446
- return /* @__PURE__ */ jsx28(Pill.Group, { children: filesInfo.map((file, index) => /* @__PURE__ */ jsx28(Pill, { withRemoveButton: true, onRemove: () => handleRemove(index), children: file.name }, index)) });
1435
+ return /* @__PURE__ */ jsx29(Pill.Group, { children: filesInfo.map((file, index) => (
1436
+ // oxlint-disable-next-line react/no-array-index-key
1437
+ /* @__PURE__ */ jsx29(Pill, { withRemoveButton: true, onRemove: () => handleRemove(index), children: file.name }, index)
1438
+ )) });
1447
1439
  }
1448
1440
  return null;
1449
1441
  }, [handleRemove, filesInfo]);
1450
- return /* @__PURE__ */ jsx28(
1442
+ return /* @__PURE__ */ jsx29(
1451
1443
  FileInput,
1452
1444
  {
1453
1445
  id,
@@ -1471,11 +1463,8 @@ function FileWidget(props) {
1471
1463
  // src/widgets/PasswordWidget.tsx
1472
1464
  import { useCallback as useCallback8 } from "react";
1473
1465
  import { PasswordInput } from "@mantine/core";
1474
- import {
1475
- ariaDescribedByIds as ariaDescribedByIds9,
1476
- labelValue as labelValue7
1477
- } from "@rjsf/utils";
1478
- import { jsx as jsx29 } from "react/jsx-runtime";
1466
+ import { ariaDescribedByIds as ariaDescribedByIds9, labelValue as labelValue7 } from "@rjsf/utils";
1467
+ import { jsx as jsx30 } from "react/jsx-runtime";
1479
1468
  function PasswordWidget(props) {
1480
1469
  const {
1481
1470
  id,
@@ -1494,7 +1483,7 @@ function PasswordWidget(props) {
1494
1483
  onBlur,
1495
1484
  onFocus
1496
1485
  } = props;
1497
- const emptyValue = options.emptyValue;
1486
+ const { emptyValue } = options;
1498
1487
  const themeProps = cleanupOptions(options);
1499
1488
  const handleChange = useCallback8(
1500
1489
  (e) => {
@@ -1505,7 +1494,7 @@ function PasswordWidget(props) {
1505
1494
  const handleBlur = useCallback8(
1506
1495
  ({ target }) => {
1507
1496
  if (onBlur) {
1508
- onBlur(id, target && target.value);
1497
+ onBlur(id, target?.value);
1509
1498
  }
1510
1499
  },
1511
1500
  [onBlur, id]
@@ -1513,12 +1502,12 @@ function PasswordWidget(props) {
1513
1502
  const handleFocus = useCallback8(
1514
1503
  ({ target }) => {
1515
1504
  if (onFocus) {
1516
- onFocus(id, target && target.value);
1505
+ onFocus(id, target?.value);
1517
1506
  }
1518
1507
  },
1519
1508
  [onFocus, id]
1520
1509
  );
1521
- return /* @__PURE__ */ jsx29(
1510
+ return /* @__PURE__ */ jsx30(
1522
1511
  PasswordInput,
1523
1512
  {
1524
1513
  id,
@@ -1550,7 +1539,7 @@ import {
1550
1539
  getOptionValueFormat as getOptionValueFormat2,
1551
1540
  optionId as optionId2
1552
1541
  } from "@rjsf/utils";
1553
- import { jsx as jsx30 } from "react/jsx-runtime";
1542
+ import { jsx as jsx31 } from "react/jsx-runtime";
1554
1543
  function RadioWidget(props) {
1555
1544
  const {
1556
1545
  id,
@@ -1582,7 +1571,7 @@ function RadioWidget(props) {
1582
1571
  const handleBlur = useCallback9(
1583
1572
  ({ target }) => {
1584
1573
  if (onBlur) {
1585
- onBlur(id, enumOptionValueDecoder2(target && target.value, enumOptions, optionValueFormat, emptyValue));
1574
+ onBlur(id, enumOptionValueDecoder2(target?.value, enumOptions, optionValueFormat, emptyValue));
1586
1575
  }
1587
1576
  },
1588
1577
  [onBlur, id, enumOptions, emptyValue, optionValueFormat]
@@ -1590,13 +1579,13 @@ function RadioWidget(props) {
1590
1579
  const handleFocus = useCallback9(
1591
1580
  ({ target }) => {
1592
1581
  if (onFocus) {
1593
- onFocus(id, enumOptionValueDecoder2(target && target.value, enumOptions, optionValueFormat, emptyValue));
1582
+ onFocus(id, enumOptionValueDecoder2(target?.value, enumOptions, optionValueFormat, emptyValue));
1594
1583
  }
1595
1584
  },
1596
1585
  [onFocus, id, enumOptions, emptyValue, optionValueFormat]
1597
1586
  );
1598
1587
  const selected = enumOptionsIndexForValue2(value, enumOptions);
1599
- return /* @__PURE__ */ jsx30(
1588
+ return /* @__PURE__ */ jsx31(
1600
1589
  Radio.Group,
1601
1590
  {
1602
1591
  id,
@@ -1609,18 +1598,18 @@ function RadioWidget(props) {
1609
1598
  error: rawErrors && rawErrors.length > 0 ? rawErrors.join("\n") : void 0,
1610
1599
  "aria-describedby": ariaDescribedByIds10(id),
1611
1600
  ...themeProps,
1612
- children: Array.isArray(enumOptions) ? /* @__PURE__ */ jsx30(Flex5, { mt: "xs", direction: inline ? "row" : "column", gap: "xs", wrap: "wrap", children: enumOptions.map((option, i) => /* @__PURE__ */ jsx30(
1601
+ children: Array.isArray(enumOptions) ? /* @__PURE__ */ jsx31(Flex5, { mt: "xs", direction: inline ? "row" : "column", gap: "xs", wrap: "wrap", children: enumOptions.map((option, i) => /* @__PURE__ */ jsx31(
1613
1602
  Radio,
1614
1603
  {
1615
1604
  id: optionId2(id, i),
1616
1605
  value: enumOptionValueEncoder2(option.value, i, optionValueFormat),
1617
1606
  label: option.label,
1618
- disabled: Array.isArray(enumDisabled) && enumDisabled.indexOf(option.value) !== -1,
1607
+ disabled: Array.isArray(enumDisabled) && enumDisabled.includes(option.value),
1619
1608
  autoFocus: i === 0 && autofocus,
1620
1609
  onBlur: handleBlur,
1621
1610
  onFocus: handleFocus
1622
1611
  },
1623
- i
1612
+ String(option.value)
1624
1613
  )) }) : null
1625
1614
  }
1626
1615
  );
@@ -1629,12 +1618,8 @@ function RadioWidget(props) {
1629
1618
  // src/widgets/RangeWidget.tsx
1630
1619
  import { useCallback as useCallback10 } from "react";
1631
1620
  import { Slider, Input as Input3 } from "@mantine/core";
1632
- import {
1633
- ariaDescribedByIds as ariaDescribedByIds11,
1634
- rangeSpec,
1635
- titleId as titleId5
1636
- } from "@rjsf/utils";
1637
- import { Fragment as Fragment5, jsx as jsx31, jsxs as jsxs14 } from "react/jsx-runtime";
1621
+ import { ariaDescribedByIds as ariaDescribedByIds11, rangeSpec, titleId as titleId5 } from "@rjsf/utils";
1622
+ import { Fragment as Fragment5, jsx as jsx32, jsxs as jsxs14 } from "react/jsx-runtime";
1638
1623
  function RangeWidget(props) {
1639
1624
  const {
1640
1625
  id,
@@ -1674,9 +1659,9 @@ function RangeWidget(props) {
1674
1659
  }
1675
1660
  }, [onFocus, id, value]);
1676
1661
  return /* @__PURE__ */ jsxs14(Fragment5, { children: [
1677
- !hideLabel && !!label && /* @__PURE__ */ jsx31(Input3.Label, { id: titleId5(id), required, children: label }),
1678
- options?.description && /* @__PURE__ */ jsx31(Input3.Description, { children: options.description }),
1679
- /* @__PURE__ */ jsx31(
1662
+ !hideLabel && !!label && /* @__PURE__ */ jsx32(Input3.Label, { id: titleId5(id), required, children: label }),
1663
+ options?.description && /* @__PURE__ */ jsx32(Input3.Description, { children: options.description }),
1664
+ /* @__PURE__ */ jsx32(
1680
1665
  Slider,
1681
1666
  {
1682
1667
  id,
@@ -1694,7 +1679,10 @@ function RangeWidget(props) {
1694
1679
  "aria-describedby": ariaDescribedByIds11(id)
1695
1680
  }
1696
1681
  ),
1697
- rawErrors && rawErrors?.length > 0 && rawErrors.map((error, index) => /* @__PURE__ */ jsx31(Input3.Error, { children: error }, `range-widget-input-errors-${index}`))
1682
+ rawErrors && rawErrors?.length > 0 && rawErrors.map((error, index) => (
1683
+ // oxlint-disable-next-line react/no-array-index-key
1684
+ /* @__PURE__ */ jsx32(Input3.Error, { children: error }, `range-widget-input-errors-${index}`)
1685
+ ))
1698
1686
  ] });
1699
1687
  }
1700
1688
 
@@ -1707,9 +1695,11 @@ import {
1707
1695
  enumOptionValueDecoder as enumOptionValueDecoder3,
1708
1696
  enumOptionValueEncoder as enumOptionValueEncoder3,
1709
1697
  getOptionValueFormat as getOptionValueFormat3,
1710
- labelValue as labelValue8
1698
+ labelValue as labelValue8,
1699
+ logUnsupportedDefaultForEnum,
1700
+ SelectedOptionDescription
1711
1701
  } from "@rjsf/utils";
1712
- import { jsx as jsx32 } from "react/jsx-runtime";
1702
+ import { Fragment as Fragment6, jsx as jsx33, jsxs as jsxs15 } from "react/jsx-runtime";
1713
1703
  function SelectWidget(props) {
1714
1704
  const {
1715
1705
  id,
@@ -1724,6 +1714,7 @@ function SelectWidget(props) {
1724
1714
  hideLabel,
1725
1715
  multiple,
1726
1716
  rawErrors,
1717
+ schema,
1727
1718
  options,
1728
1719
  onChange,
1729
1720
  onBlur,
@@ -1732,6 +1723,7 @@ function SelectWidget(props) {
1732
1723
  const { enumOptions, enumDisabled, emptyValue } = options;
1733
1724
  const optionValueFormat = getOptionValueFormat3(options);
1734
1725
  const themeProps = cleanupOptions(options);
1726
+ logUnsupportedDefaultForEnum(id, schema, enumOptions, multiple);
1735
1727
  const handleChange = useCallback11(
1736
1728
  (nextValue) => {
1737
1729
  if (!disabled && !readonly && onChange) {
@@ -1743,7 +1735,7 @@ function SelectWidget(props) {
1743
1735
  const handleBlur = useCallback11(
1744
1736
  ({ target }) => {
1745
1737
  if (onBlur) {
1746
- onBlur(id, enumOptionValueDecoder3(target && target.value, enumOptions, optionValueFormat, emptyValue));
1738
+ onBlur(id, enumOptionValueDecoder3(target?.value, enumOptions, optionValueFormat, emptyValue));
1747
1739
  }
1748
1740
  },
1749
1741
  [onBlur, id, enumOptions, emptyValue, optionValueFormat]
@@ -1751,7 +1743,7 @@ function SelectWidget(props) {
1751
1743
  const handleFocus = useCallback11(
1752
1744
  ({ target }) => {
1753
1745
  if (onFocus) {
1754
- onFocus(id, enumOptionValueDecoder3(target && target.value, enumOptions, optionValueFormat, emptyValue));
1746
+ onFocus(id, enumOptionValueDecoder3(target?.value, enumOptions, optionValueFormat, emptyValue));
1755
1747
  }
1756
1748
  },
1757
1749
  [onFocus, id, enumOptions, emptyValue, optionValueFormat]
@@ -1762,7 +1754,7 @@ function SelectWidget(props) {
1762
1754
  key: String(index),
1763
1755
  value: enumOptionValueEncoder3(option.value, index, optionValueFormat),
1764
1756
  label: option.label,
1765
- disabled: Array.isArray(enumDisabled) && enumDisabled.indexOf(option.value) !== -1
1757
+ disabled: Array.isArray(enumDisabled) && enumDisabled.includes(option.value)
1766
1758
  }));
1767
1759
  }
1768
1760
  return [];
@@ -1785,29 +1777,29 @@ function SelectWidget(props) {
1785
1777
  comboboxProps: { withinPortal: false },
1786
1778
  ...themeProps
1787
1779
  };
1788
- return multiple ? /* @__PURE__ */ jsx32(
1789
- MultiSelect,
1790
- {
1791
- ...sharedProps,
1792
- value: enumOptionSelectedValue(value, enumOptions, true, optionValueFormat, [])
1793
- }
1794
- ) : /* @__PURE__ */ jsx32(
1795
- Select2,
1796
- {
1797
- ...sharedProps,
1798
- value: enumOptionSelectedValue(value, enumOptions, false, optionValueFormat, null)
1799
- }
1800
- );
1780
+ return /* @__PURE__ */ jsxs15(Fragment6, { children: [
1781
+ /* @__PURE__ */ jsx33(SelectedOptionDescription, { ...props }),
1782
+ multiple ? /* @__PURE__ */ jsx33(
1783
+ MultiSelect,
1784
+ {
1785
+ ...sharedProps,
1786
+ value: enumOptionSelectedValue(value, enumOptions, true, optionValueFormat, [])
1787
+ }
1788
+ ) : /* @__PURE__ */ jsx33(
1789
+ Select2,
1790
+ {
1791
+ ...sharedProps,
1792
+ value: enumOptionSelectedValue(value, enumOptions, false, optionValueFormat, null)
1793
+ }
1794
+ )
1795
+ ] });
1801
1796
  }
1802
1797
 
1803
1798
  // src/widgets/TextareaWidget.tsx
1804
1799
  import { useCallback as useCallback12 } from "react";
1805
1800
  import { Textarea } from "@mantine/core";
1806
- import {
1807
- labelValue as labelValue9,
1808
- ariaDescribedByIds as ariaDescribedByIds13
1809
- } from "@rjsf/utils";
1810
- import { jsx as jsx33 } from "react/jsx-runtime";
1801
+ import { labelValue as labelValue9, ariaDescribedByIds as ariaDescribedByIds13 } from "@rjsf/utils";
1802
+ import { jsx as jsx34 } from "react/jsx-runtime";
1811
1803
  function TextareaWidget(props) {
1812
1804
  const {
1813
1805
  id,
@@ -1838,7 +1830,7 @@ function TextareaWidget(props) {
1838
1830
  const handleBlur = useCallback12(
1839
1831
  ({ target }) => {
1840
1832
  if (onBlur) {
1841
- onBlur(id, target && target.value);
1833
+ onBlur(id, target?.value);
1842
1834
  }
1843
1835
  },
1844
1836
  [onBlur, id]
@@ -1846,12 +1838,12 @@ function TextareaWidget(props) {
1846
1838
  const handleFocus = useCallback12(
1847
1839
  ({ target }) => {
1848
1840
  if (onFocus) {
1849
- onFocus(id, target && target.value);
1841
+ onFocus(id, target?.value);
1850
1842
  }
1851
1843
  },
1852
1844
  [onFocus, id]
1853
1845
  );
1854
- return /* @__PURE__ */ jsx33(
1846
+ return /* @__PURE__ */ jsx34(
1855
1847
  Textarea,
1856
1848
  {
1857
1849
  id,