@rjsf/core 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 (262) hide show
  1. package/LICENSE.md +201 -0
  2. package/dist/core.umd.js +694 -584
  3. package/dist/index.cjs +1191 -1071
  4. package/dist/index.cjs.map +4 -4
  5. package/dist/index.esm.js +1030 -984
  6. package/dist/index.esm.js.map +4 -4
  7. package/lib/components/Form.d.ts +16 -13
  8. package/lib/components/Form.d.ts.map +1 -1
  9. package/lib/components/Form.js +126 -76
  10. package/lib/components/RichDescription.d.ts +3 -3
  11. package/lib/components/RichDescription.d.ts.map +1 -1
  12. package/lib/components/RichDescription.js +1 -1
  13. package/lib/components/RichHelp.d.ts +3 -3
  14. package/lib/components/RichHelp.d.ts.map +1 -1
  15. package/lib/components/RichHelp.js +1 -1
  16. package/lib/components/SchemaExamples.d.ts +2 -2
  17. package/lib/components/SchemaExamples.d.ts.map +1 -1
  18. package/lib/components/SchemaExamples.js +1 -3
  19. package/lib/components/fields/ArrayField.d.ts +2 -2
  20. package/lib/components/fields/ArrayField.d.ts.map +1 -1
  21. package/lib/components/fields/ArrayField.js +87 -88
  22. package/lib/components/fields/BooleanField.d.ts +2 -2
  23. package/lib/components/fields/BooleanField.d.ts.map +1 -1
  24. package/lib/components/fields/BooleanField.js +2 -5
  25. package/lib/components/fields/CyclicSchemaField.d.ts +8 -0
  26. package/lib/components/fields/CyclicSchemaField.d.ts.map +1 -0
  27. package/lib/components/fields/CyclicSchemaField.js +21 -0
  28. package/lib/components/fields/FallbackField.d.ts +2 -2
  29. package/lib/components/fields/FallbackField.d.ts.map +1 -1
  30. package/lib/components/fields/FallbackField.js +2 -2
  31. package/lib/components/fields/LayoutGridField.d.ts +8 -10
  32. package/lib/components/fields/LayoutGridField.d.ts.map +1 -1
  33. package/lib/components/fields/LayoutGridField.js +5 -4
  34. package/lib/components/fields/LayoutHeaderField.d.ts +2 -2
  35. package/lib/components/fields/LayoutHeaderField.d.ts.map +1 -1
  36. package/lib/components/fields/LayoutHeaderField.js +1 -1
  37. package/lib/components/fields/LayoutMultiSchemaField.d.ts +2 -2
  38. package/lib/components/fields/LayoutMultiSchemaField.d.ts.map +1 -1
  39. package/lib/components/fields/LayoutMultiSchemaField.js +4 -1
  40. package/lib/components/fields/MultiSchemaField.d.ts +2 -41
  41. package/lib/components/fields/MultiSchemaField.d.ts.map +1 -1
  42. package/lib/components/fields/MultiSchemaField.js +116 -122
  43. package/lib/components/fields/NullField.d.ts +1 -1
  44. package/lib/components/fields/NullField.d.ts.map +1 -1
  45. package/lib/components/fields/NumberField.d.ts +2 -2
  46. package/lib/components/fields/NumberField.d.ts.map +1 -1
  47. package/lib/components/fields/NumberField.js +7 -9
  48. package/lib/components/fields/ObjectField.d.ts +2 -2
  49. package/lib/components/fields/ObjectField.d.ts.map +1 -1
  50. package/lib/components/fields/ObjectField.js +28 -26
  51. package/lib/components/fields/OptionalDataControlsField.d.ts +2 -2
  52. package/lib/components/fields/OptionalDataControlsField.d.ts.map +1 -1
  53. package/lib/components/fields/SchemaField.d.ts +14 -8
  54. package/lib/components/fields/SchemaField.d.ts.map +1 -1
  55. package/lib/components/fields/SchemaField.js +43 -30
  56. package/lib/components/fields/StringField.d.ts +2 -2
  57. package/lib/components/fields/StringField.d.ts.map +1 -1
  58. package/lib/components/fields/StringField.js +2 -5
  59. package/lib/components/fields/index.d.ts +1 -1
  60. package/lib/components/fields/index.d.ts.map +1 -1
  61. package/lib/components/fields/index.js +2 -0
  62. package/lib/components/templates/ArrayFieldDescriptionTemplate.d.ts +2 -2
  63. package/lib/components/templates/ArrayFieldDescriptionTemplate.d.ts.map +1 -1
  64. package/lib/components/templates/ArrayFieldDescriptionTemplate.js +1 -1
  65. package/lib/components/templates/ArrayFieldItemButtonsTemplate.d.ts +2 -2
  66. package/lib/components/templates/ArrayFieldItemButtonsTemplate.d.ts.map +1 -1
  67. package/lib/components/templates/ArrayFieldItemButtonsTemplate.js +1 -1
  68. package/lib/components/templates/ArrayFieldItemTemplate.d.ts +2 -2
  69. package/lib/components/templates/ArrayFieldItemTemplate.d.ts.map +1 -1
  70. package/lib/components/templates/ArrayFieldItemTemplate.js +1 -1
  71. package/lib/components/templates/ArrayFieldTemplate.d.ts +2 -2
  72. package/lib/components/templates/ArrayFieldTemplate.d.ts.map +1 -1
  73. package/lib/components/templates/ArrayFieldTemplate.js +1 -1
  74. package/lib/components/templates/ArrayFieldTitleTemplate.d.ts +2 -2
  75. package/lib/components/templates/ArrayFieldTitleTemplate.d.ts.map +1 -1
  76. package/lib/components/templates/ArrayFieldTitleTemplate.js +1 -1
  77. package/lib/components/templates/BaseInputTemplate.d.ts +2 -2
  78. package/lib/components/templates/BaseInputTemplate.d.ts.map +1 -1
  79. package/lib/components/templates/BaseInputTemplate.js +7 -6
  80. package/lib/components/templates/ButtonTemplates/AddButton.d.ts +2 -2
  81. package/lib/components/templates/ButtonTemplates/AddButton.d.ts.map +1 -1
  82. package/lib/components/templates/ButtonTemplates/IconButton.d.ts +14 -7
  83. package/lib/components/templates/ButtonTemplates/IconButton.d.ts.map +1 -1
  84. package/lib/components/templates/ButtonTemplates/IconButton.js +14 -6
  85. package/lib/components/templates/ButtonTemplates/SubmitButton.d.ts +2 -2
  86. package/lib/components/templates/ButtonTemplates/SubmitButton.d.ts.map +1 -1
  87. package/lib/components/templates/ButtonTemplates/index.d.ts +1 -1
  88. package/lib/components/templates/ButtonTemplates/index.d.ts.map +1 -1
  89. package/lib/components/templates/CyclicSchemaExpandTemplate.d.ts +7 -0
  90. package/lib/components/templates/CyclicSchemaExpandTemplate.d.ts.map +1 -0
  91. package/lib/components/templates/CyclicSchemaExpandTemplate.js +12 -0
  92. package/lib/components/templates/DescriptionField.d.ts +2 -2
  93. package/lib/components/templates/DescriptionField.d.ts.map +1 -1
  94. package/lib/components/templates/ErrorList.d.ts +2 -2
  95. package/lib/components/templates/ErrorList.d.ts.map +1 -1
  96. package/lib/components/templates/ErrorList.js +2 -4
  97. package/lib/components/templates/FallbackFieldTemplate.d.ts +2 -2
  98. package/lib/components/templates/FallbackFieldTemplate.d.ts.map +1 -1
  99. package/lib/components/templates/FieldErrorTemplate.d.ts +2 -2
  100. package/lib/components/templates/FieldErrorTemplate.d.ts.map +1 -1
  101. package/lib/components/templates/FieldErrorTemplate.js +1 -3
  102. package/lib/components/templates/FieldHelpTemplate.d.ts +2 -2
  103. package/lib/components/templates/FieldHelpTemplate.d.ts.map +1 -1
  104. package/lib/components/templates/FieldTemplate/FieldTemplate.d.ts +2 -2
  105. package/lib/components/templates/FieldTemplate/FieldTemplate.d.ts.map +1 -1
  106. package/lib/components/templates/FieldTemplate/FieldTemplate.js +1 -1
  107. package/lib/components/templates/FieldTemplate/Label.d.ts +3 -3
  108. package/lib/components/templates/FieldTemplate/Label.d.ts.map +1 -1
  109. package/lib/components/templates/GridTemplate.d.ts +2 -2
  110. package/lib/components/templates/GridTemplate.d.ts.map +1 -1
  111. package/lib/components/templates/MultiSchemaFieldTemplate.d.ts +2 -2
  112. package/lib/components/templates/MultiSchemaFieldTemplate.d.ts.map +1 -1
  113. package/lib/components/templates/ObjectFieldTemplate.d.ts +2 -2
  114. package/lib/components/templates/ObjectFieldTemplate.d.ts.map +1 -1
  115. package/lib/components/templates/ObjectFieldTemplate.js +1 -1
  116. package/lib/components/templates/OptionalDataControlsTemplate.d.ts +2 -2
  117. package/lib/components/templates/OptionalDataControlsTemplate.d.ts.map +1 -1
  118. package/lib/components/templates/OptionalDataControlsTemplate.js +1 -1
  119. package/lib/components/templates/TitleField.d.ts +2 -2
  120. package/lib/components/templates/TitleField.d.ts.map +1 -1
  121. package/lib/components/templates/UnsupportedField.d.ts +2 -2
  122. package/lib/components/templates/UnsupportedField.d.ts.map +1 -1
  123. package/lib/components/templates/UnsupportedField.js +2 -2
  124. package/lib/components/templates/WrapIfAdditionalTemplate.d.ts +2 -2
  125. package/lib/components/templates/WrapIfAdditionalTemplate.d.ts.map +1 -1
  126. package/lib/components/templates/WrapIfAdditionalTemplate.js +1 -1
  127. package/lib/components/templates/index.d.ts +1 -1
  128. package/lib/components/templates/index.d.ts.map +1 -1
  129. package/lib/components/templates/index.js +2 -0
  130. package/lib/components/widgets/AltDateTimeWidget.d.ts +2 -2
  131. package/lib/components/widgets/AltDateTimeWidget.d.ts.map +1 -1
  132. package/lib/components/widgets/AltDateWidget.d.ts +2 -2
  133. package/lib/components/widgets/AltDateWidget.d.ts.map +1 -1
  134. package/lib/components/widgets/AltDateWidget.js +2 -2
  135. package/lib/components/widgets/CheckboxWidget.d.ts +2 -2
  136. package/lib/components/widgets/CheckboxWidget.d.ts.map +1 -1
  137. package/lib/components/widgets/CheckboxesWidget.d.ts +2 -2
  138. package/lib/components/widgets/CheckboxesWidget.d.ts.map +1 -1
  139. package/lib/components/widgets/CheckboxesWidget.js +4 -4
  140. package/lib/components/widgets/ColorWidget.d.ts +2 -2
  141. package/lib/components/widgets/ColorWidget.d.ts.map +1 -1
  142. package/lib/components/widgets/DateTimeWidget.d.ts +2 -2
  143. package/lib/components/widgets/DateTimeWidget.d.ts.map +1 -1
  144. package/lib/components/widgets/DateTimeWidget.js +2 -2
  145. package/lib/components/widgets/DateWidget.d.ts +2 -2
  146. package/lib/components/widgets/DateWidget.d.ts.map +1 -1
  147. package/lib/components/widgets/EmailWidget.d.ts +2 -2
  148. package/lib/components/widgets/EmailWidget.d.ts.map +1 -1
  149. package/lib/components/widgets/FileWidget.d.ts +2 -2
  150. package/lib/components/widgets/FileWidget.d.ts.map +1 -1
  151. package/lib/components/widgets/FileWidget.js +6 -4
  152. package/lib/components/widgets/HiddenWidget.d.ts +2 -2
  153. package/lib/components/widgets/HiddenWidget.d.ts.map +1 -1
  154. package/lib/components/widgets/PasswordWidget.d.ts +2 -2
  155. package/lib/components/widgets/PasswordWidget.d.ts.map +1 -1
  156. package/lib/components/widgets/RadioWidget.d.ts +2 -2
  157. package/lib/components/widgets/RadioWidget.d.ts.map +1 -1
  158. package/lib/components/widgets/RadioWidget.js +4 -4
  159. package/lib/components/widgets/RangeWidget.d.ts +2 -2
  160. package/lib/components/widgets/RangeWidget.d.ts.map +1 -1
  161. package/lib/components/widgets/RatingWidget.d.ts +2 -2
  162. package/lib/components/widgets/RatingWidget.d.ts.map +1 -1
  163. package/lib/components/widgets/RatingWidget.js +15 -15
  164. package/lib/components/widgets/SelectWidget.d.ts +2 -2
  165. package/lib/components/widgets/SelectWidget.d.ts.map +1 -1
  166. package/lib/components/widgets/SelectWidget.js +9 -8
  167. package/lib/components/widgets/TextWidget.d.ts +2 -2
  168. package/lib/components/widgets/TextWidget.d.ts.map +1 -1
  169. package/lib/components/widgets/TextareaWidget.d.ts +2 -2
  170. package/lib/components/widgets/TextareaWidget.d.ts.map +1 -1
  171. package/lib/components/widgets/TextareaWidget.js +5 -5
  172. package/lib/components/widgets/TimeWidget.d.ts +2 -2
  173. package/lib/components/widgets/TimeWidget.d.ts.map +1 -1
  174. package/lib/components/widgets/URLWidget.d.ts +2 -2
  175. package/lib/components/widgets/URLWidget.d.ts.map +1 -1
  176. package/lib/components/widgets/UpDownWidget.d.ts +2 -2
  177. package/lib/components/widgets/UpDownWidget.d.ts.map +1 -1
  178. package/lib/components/widgets/index.d.ts +1 -1
  179. package/lib/components/widgets/index.d.ts.map +1 -1
  180. package/lib/getDefaultRegistry.d.ts +1 -1
  181. package/lib/getDefaultRegistry.d.ts.map +1 -1
  182. package/lib/getDefaultRegistry.js +1 -1
  183. package/lib/getTestRegistry.d.ts +1 -1
  184. package/lib/getTestRegistry.d.ts.map +1 -1
  185. package/lib/getTestRegistry.js +1 -1
  186. package/lib/index.d.ts +10 -5
  187. package/lib/index.d.ts.map +1 -1
  188. package/lib/tsconfig.tsbuildinfo +1 -1
  189. package/lib/withTheme.d.ts +3 -3
  190. package/lib/withTheme.d.ts.map +1 -1
  191. package/lib/withTheme.js +6 -6
  192. package/package.json +28 -28
  193. package/src/components/Form.tsx +197 -111
  194. package/src/components/RichDescription.tsx +3 -10
  195. package/src/components/RichHelp.tsx +3 -10
  196. package/src/components/SchemaExamples.tsx +6 -4
  197. package/src/components/fields/ArrayField.tsx +122 -108
  198. package/src/components/fields/BooleanField.tsx +4 -9
  199. package/src/components/fields/CyclicSchemaField.tsx +40 -0
  200. package/src/components/fields/FallbackField.tsx +4 -8
  201. package/src/components/fields/LayoutGridField.tsx +21 -19
  202. package/src/components/fields/LayoutHeaderField.tsx +2 -10
  203. package/src/components/fields/LayoutMultiSchemaField.tsx +15 -10
  204. package/src/components/fields/MultiSchemaField.tsx +202 -218
  205. package/src/components/fields/NullField.tsx +1 -1
  206. package/src/components/fields/NumberField.tsx +8 -10
  207. package/src/components/fields/ObjectField.tsx +52 -40
  208. package/src/components/fields/OptionalDataControlsField.tsx +6 -4
  209. package/src/components/fields/SchemaField.tsx +66 -51
  210. package/src/components/fields/StringField.tsx +4 -15
  211. package/src/components/fields/index.ts +3 -1
  212. package/src/components/templates/ArrayFieldDescriptionTemplate.tsx +2 -9
  213. package/src/components/templates/ArrayFieldItemButtonsTemplate.tsx +2 -7
  214. package/src/components/templates/ArrayFieldItemTemplate.tsx +3 -9
  215. package/src/components/templates/ArrayFieldTemplate.tsx +2 -9
  216. package/src/components/templates/ArrayFieldTitleTemplate.tsx +2 -10
  217. package/src/components/templates/BaseInputTemplate.tsx +16 -23
  218. package/src/components/templates/ButtonTemplates/AddButton.tsx +2 -1
  219. package/src/components/templates/ButtonTemplates/IconButton.tsx +16 -7
  220. package/src/components/templates/ButtonTemplates/SubmitButton.tsx +2 -1
  221. package/src/components/templates/ButtonTemplates/index.ts +1 -1
  222. package/src/components/templates/CyclicSchemaExpandTemplate.tsx +31 -0
  223. package/src/components/templates/DescriptionField.tsx +1 -1
  224. package/src/components/templates/ErrorList.tsx +8 -15
  225. package/src/components/templates/FallbackFieldTemplate.tsx +2 -1
  226. package/src/components/templates/FieldErrorTemplate.tsx +8 -8
  227. package/src/components/templates/FieldHelpTemplate.tsx +2 -1
  228. package/src/components/templates/FieldTemplate/FieldTemplate.tsx +2 -8
  229. package/src/components/templates/FieldTemplate/Label.tsx +2 -2
  230. package/src/components/templates/GridTemplate.tsx +1 -1
  231. package/src/components/templates/MultiSchemaFieldTemplate.tsx +1 -1
  232. package/src/components/templates/ObjectFieldTemplate.tsx +2 -7
  233. package/src/components/templates/OptionalDataControlsTemplate.tsx +3 -2
  234. package/src/components/templates/TitleField.tsx +1 -1
  235. package/src/components/templates/UnsupportedField.tsx +4 -3
  236. package/src/components/templates/WrapIfAdditionalTemplate.tsx +2 -9
  237. package/src/components/templates/index.ts +3 -1
  238. package/src/components/widgets/AltDateTimeWidget.tsx +1 -1
  239. package/src/components/widgets/AltDateWidget.tsx +7 -13
  240. package/src/components/widgets/CheckboxWidget.tsx +3 -5
  241. package/src/components/widgets/CheckboxesWidget.tsx +8 -10
  242. package/src/components/widgets/ColorWidget.tsx +2 -1
  243. package/src/components/widgets/DateTimeWidget.tsx +3 -10
  244. package/src/components/widgets/DateWidget.tsx +2 -1
  245. package/src/components/widgets/EmailWidget.tsx +2 -1
  246. package/src/components/widgets/FileWidget.tsx +9 -8
  247. package/src/components/widgets/HiddenWidget.tsx +1 -1
  248. package/src/components/widgets/PasswordWidget.tsx +2 -1
  249. package/src/components/widgets/RadioWidget.tsx +8 -10
  250. package/src/components/widgets/RangeWidget.tsx +1 -1
  251. package/src/components/widgets/RatingWidget.tsx +48 -47
  252. package/src/components/widgets/SelectWidget.tsx +48 -31
  253. package/src/components/widgets/TextWidget.tsx +2 -1
  254. package/src/components/widgets/TextareaWidget.tsx +10 -7
  255. package/src/components/widgets/TimeWidget.tsx +2 -1
  256. package/src/components/widgets/URLWidget.tsx +2 -1
  257. package/src/components/widgets/UpDownWidget.tsx +2 -1
  258. package/src/components/widgets/index.ts +1 -1
  259. package/src/getDefaultRegistry.ts +2 -9
  260. package/src/getTestRegistry.tsx +2 -7
  261. package/src/index.ts +10 -5
  262. package/src/withTheme.tsx +14 -9
@@ -1,6 +1,8 @@
1
- import { FormContextType, IconButtonProps, RJSFSchema, StrictRJSFSchema, TranslatableString } from '@rjsf/utils';
1
+ import { memo } from 'react';
2
+ import type { FormContextType, IconButtonProps, RJSFSchema, StrictRJSFSchema } from '@rjsf/utils';
3
+ import { TranslatableString } from '@rjsf/utils';
2
4
 
3
- export default function IconButton<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>(
5
+ function IconButtonFn<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>(
4
6
  props: IconButtonProps<T, S, F>,
5
7
  ) {
6
8
  const { iconType = 'default', icon, className, uiSchema, registry, ...otherProps } = props;
@@ -10,8 +12,10 @@ export default function IconButton<T = any, S extends StrictRJSFSchema = RJSFSch
10
12
  </button>
11
13
  );
12
14
  }
15
+ const IconButton = memo(IconButtonFn) as typeof IconButtonFn;
16
+ export default IconButton;
13
17
 
14
- export function CopyButton<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>(
18
+ function CopyButtonFn<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>(
15
19
  props: IconButtonProps<T, S, F>,
16
20
  ) {
17
21
  const {
@@ -19,8 +23,9 @@ export function CopyButton<T = any, S extends StrictRJSFSchema = RJSFSchema, F e
19
23
  } = props;
20
24
  return <IconButton title={translateString(TranslatableString.CopyButton)} {...props} icon='copy' />;
21
25
  }
26
+ export const CopyButton = memo(CopyButtonFn) as typeof CopyButtonFn;
22
27
 
23
- export function MoveDownButton<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>(
28
+ function MoveDownButtonFn<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>(
24
29
  props: IconButtonProps<T, S, F>,
25
30
  ) {
26
31
  const {
@@ -28,8 +33,9 @@ export function MoveDownButton<T = any, S extends StrictRJSFSchema = RJSFSchema,
28
33
  } = props;
29
34
  return <IconButton title={translateString(TranslatableString.MoveDownButton)} {...props} icon='arrow-down' />;
30
35
  }
36
+ export const MoveDownButton = memo(MoveDownButtonFn) as typeof MoveDownButtonFn;
31
37
 
32
- export function MoveUpButton<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>(
38
+ function MoveUpButtonFn<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>(
33
39
  props: IconButtonProps<T, S, F>,
34
40
  ) {
35
41
  const {
@@ -37,8 +43,9 @@ export function MoveUpButton<T = any, S extends StrictRJSFSchema = RJSFSchema, F
37
43
  } = props;
38
44
  return <IconButton title={translateString(TranslatableString.MoveUpButton)} {...props} icon='arrow-up' />;
39
45
  }
46
+ export const MoveUpButton = memo(MoveUpButtonFn) as typeof MoveUpButtonFn;
40
47
 
41
- export function RemoveButton<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>(
48
+ function RemoveButtonFn<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>(
42
49
  props: IconButtonProps<T, S, F>,
43
50
  ) {
44
51
  const {
@@ -48,8 +55,9 @@ export function RemoveButton<T = any, S extends StrictRJSFSchema = RJSFSchema, F
48
55
  <IconButton title={translateString(TranslatableString.RemoveButton)} {...props} iconType='danger' icon='remove' />
49
56
  );
50
57
  }
58
+ export const RemoveButton = memo(RemoveButtonFn) as typeof RemoveButtonFn;
51
59
 
52
- export function ClearButton<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>({
60
+ function ClearButtonFn<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>({
53
61
  id,
54
62
  className,
55
63
  onClick,
@@ -72,3 +80,4 @@ export function ClearButton<T = any, S extends StrictRJSFSchema = RJSFSchema, F
72
80
  />
73
81
  );
74
82
  }
83
+ export const ClearButton = memo(ClearButtonFn) as typeof ClearButtonFn;
@@ -1,4 +1,5 @@
1
- import { getSubmitButtonOptions, FormContextType, RJSFSchema, StrictRJSFSchema, SubmitButtonProps } from '@rjsf/utils';
1
+ import type { FormContextType, RJSFSchema, StrictRJSFSchema, SubmitButtonProps } from '@rjsf/utils';
2
+ import { getSubmitButtonOptions } from '@rjsf/utils';
2
3
 
3
4
  /** The `SubmitButton` renders a button that represent the `Submit` action on a form
4
5
  */
@@ -1,4 +1,4 @@
1
- import { FormContextType, RJSFSchema, StrictRJSFSchema, TemplatesType } from '@rjsf/utils';
1
+ import type { FormContextType, RJSFSchema, StrictRJSFSchema, TemplatesType } from '@rjsf/utils';
2
2
 
3
3
  import AddButton from './AddButton';
4
4
  import { CopyButton, MoveDownButton, MoveUpButton, RemoveButton, ClearButton } from './IconButton';
@@ -0,0 +1,31 @@
1
+ import type { CyclicSchemaExpandProps, FormContextType, RJSFSchema, StrictRJSFSchema } from '@rjsf/utils';
2
+ import { ID_KEY, TranslatableString } from '@rjsf/utils';
3
+
4
+ /** The `CyclicSchemaExpandTemplate` is the template to use to render the cyclic schema expand message and controls
5
+ *
6
+ * @param props - The `DescriptionFieldProps` for this component
7
+ */
8
+ export default function CyclicSchemaExpandTemplate<
9
+ T = any,
10
+ S extends StrictRJSFSchema = RJSFSchema,
11
+ F extends FormContextType = any,
12
+ >(props: CyclicSchemaExpandProps<T, S, F>) {
13
+ const { name, fieldPathId, registry, onExpand } = props;
14
+ const { translateString } = registry;
15
+ const buttonId = `${fieldPathId[ID_KEY]}-button`;
16
+ return (
17
+ <div style={{ marginTop: '1rem' }}>
18
+ <div className='text-danger'>{translateString(TranslatableString.CycleDetected, [name])}</div>
19
+ <div>
20
+ <button
21
+ id={buttonId}
22
+ type='button'
23
+ className='btn btn-sm btn-warning'
24
+ onClick={() => onExpand(fieldPathId[ID_KEY])}
25
+ >
26
+ {translateString(TranslatableString.ExpandButton)}
27
+ </button>{' '}
28
+ </div>
29
+ </div>
30
+ );
31
+ }
@@ -1,4 +1,4 @@
1
- import { DescriptionFieldProps, FormContextType, RJSFSchema, StrictRJSFSchema } from '@rjsf/utils';
1
+ import type { DescriptionFieldProps, FormContextType, RJSFSchema, StrictRJSFSchema } from '@rjsf/utils';
2
2
 
3
3
  import RichDescription from '../RichDescription';
4
4
 
@@ -1,11 +1,5 @@
1
- import {
2
- ErrorListProps,
3
- FormContextType,
4
- RJSFValidationError,
5
- RJSFSchema,
6
- StrictRJSFSchema,
7
- TranslatableString,
8
- } from '@rjsf/utils';
1
+ import type { ErrorListProps, FormContextType, RJSFValidationError, RJSFSchema, StrictRJSFSchema } from '@rjsf/utils';
2
+ import { TranslatableString } from '@rjsf/utils';
9
3
 
10
4
  /** The `ErrorList` component is the template that renders the all the errors associated with the fields in the `Form`
11
5
  *
@@ -22,13 +16,12 @@ export default function ErrorList<T = any, S extends StrictRJSFSchema = RJSFSche
22
16
  <h3 className='panel-title'>{translateString(TranslatableString.ErrorsLabel)}</h3>
23
17
  </div>
24
18
  <ul className='list-group'>
25
- {errors.map((error: RJSFValidationError, i: number) => {
26
- return (
27
- <li key={i} className='list-group-item text-danger'>
28
- {error.stack}
29
- </li>
30
- );
31
- })}
19
+ {errors.map((error: RJSFValidationError, i: number) => (
20
+ // oxlint-disable-next-line react/no-array-index-key
21
+ <li key={i} className='list-group-item text-danger'>
22
+ {error.stack}
23
+ </li>
24
+ ))}
32
25
  </ul>
33
26
  </div>
34
27
  );
@@ -1,4 +1,5 @@
1
- import { FallbackFieldTemplateProps, FormContextType, getTemplate, RJSFSchema, StrictRJSFSchema } from '@rjsf/utils';
1
+ import type { FallbackFieldTemplateProps, FormContextType, RJSFSchema, StrictRJSFSchema } from '@rjsf/utils';
2
+ import { getTemplate } from '@rjsf/utils';
2
3
 
3
4
  /**
4
5
  * The `FallbackFieldTemplate` is used to render a field when no field matches. The field renders a type selector and
@@ -1,4 +1,5 @@
1
- import { errorId, FieldErrorProps, FormContextType, RJSFSchema, StrictRJSFSchema } from '@rjsf/utils';
1
+ import type { FieldErrorProps, FormContextType, RJSFSchema, StrictRJSFSchema } from '@rjsf/utils';
2
+ import { errorId } from '@rjsf/utils';
2
3
 
3
4
  /** The `FieldErrorTemplate` component renders the errors local to the particular field
4
5
  *
@@ -20,13 +21,12 @@ export default function FieldErrorTemplate<
20
21
  <ul id={id} className='error-detail bs-callout bs-callout-info'>
21
22
  {errors
22
23
  .filter((elem) => !!elem)
23
- .map((error, index: number) => {
24
- return (
25
- <li className='text-danger' key={index}>
26
- {error}
27
- </li>
28
- );
29
- })}
24
+ .map((error, index: number) => (
25
+ // oxlint-disable-next-line react/no-array-index-key
26
+ <li className='text-danger' key={index}>
27
+ {error}
28
+ </li>
29
+ ))}
30
30
  </ul>
31
31
  </div>
32
32
  );
@@ -1,4 +1,5 @@
1
- import { helpId, FieldHelpProps, FormContextType, RJSFSchema, StrictRJSFSchema } from '@rjsf/utils';
1
+ import type { FieldHelpProps, FormContextType, RJSFSchema, StrictRJSFSchema } from '@rjsf/utils';
2
+ import { helpId } from '@rjsf/utils';
2
3
 
3
4
  import RichHelp from '../RichHelp';
4
5
 
@@ -1,11 +1,5 @@
1
- import {
2
- FieldTemplateProps,
3
- FormContextType,
4
- RJSFSchema,
5
- StrictRJSFSchema,
6
- getTemplate,
7
- getUiOptions,
8
- } from '@rjsf/utils';
1
+ import type { FieldTemplateProps, FormContextType, RJSFSchema, StrictRJSFSchema } from '@rjsf/utils';
2
+ import { getTemplate, getUiOptions } from '@rjsf/utils';
9
3
 
10
4
  import Label from './Label';
11
5
 
@@ -1,13 +1,13 @@
1
1
  const REQUIRED_FIELD_SYMBOL = '*';
2
2
 
3
- export type LabelProps = {
3
+ export interface LabelProps {
4
4
  /** The label for the field */
5
5
  label?: string;
6
6
  /** A boolean value stating if the field is required */
7
7
  required?: boolean;
8
8
  /** The id of the input field being labeled */
9
9
  id?: string;
10
- };
10
+ }
11
11
 
12
12
  /** Renders a label for a field
13
13
  *
@@ -1,4 +1,4 @@
1
- import { GridTemplateProps } from '@rjsf/utils';
1
+ import type { GridTemplateProps } from '@rjsf/utils';
2
2
 
3
3
  /** Renders a `GridTemplate` for bootstrap 3, which is expecting the column information coming in via the `className`
4
4
  * prop. Also spreads all the other props provided by the user directly on the div.
@@ -1,4 +1,4 @@
1
- import { FormContextType, MultiSchemaFieldTemplateProps, RJSFSchema, StrictRJSFSchema } from '@rjsf/utils';
1
+ import type { FormContextType, MultiSchemaFieldTemplateProps, RJSFSchema, StrictRJSFSchema } from '@rjsf/utils';
2
2
 
3
3
  /** The `MultiSchemaFieldTemplate` component renders the layout for the MultiSchemaField, which supports choosing
4
4
  * a schema from a list of schemas defined using `anyOf` or `oneOf`.
@@ -1,16 +1,11 @@
1
- import {
1
+ import type {
2
2
  FormContextType,
3
3
  ObjectFieldTemplatePropertyType,
4
4
  ObjectFieldTemplateProps,
5
5
  RJSFSchema,
6
6
  StrictRJSFSchema,
7
- canExpand,
8
- descriptionId,
9
- getTemplate,
10
- getUiOptions,
11
- titleId,
12
- buttonId,
13
7
  } from '@rjsf/utils';
8
+ import { canExpand, descriptionId, getTemplate, getUiOptions, titleId, buttonId } from '@rjsf/utils';
14
9
 
15
10
  /** The `ObjectFieldTemplate` is the template to use to render all the inner properties of an object along with the
16
11
  * title and description if available. If the object is expandable, then an `AddButton` is also rendered after all
@@ -1,4 +1,4 @@
1
- import { FormContextType, OptionalDataControlsTemplateProps, RJSFSchema, StrictRJSFSchema } from '@rjsf/utils';
1
+ import type { FormContextType, OptionalDataControlsTemplateProps, RJSFSchema, StrictRJSFSchema } from '@rjsf/utils';
2
2
 
3
3
  import IconButton from './ButtonTemplates/IconButton';
4
4
 
@@ -27,7 +27,8 @@ export default function OptionalDataControlsTemplate<
27
27
  title={label}
28
28
  />
29
29
  );
30
- } else if (onRemoveClick) {
30
+ }
31
+ if (onRemoveClick) {
31
32
  return (
32
33
  <IconButton
33
34
  id={id}
@@ -1,4 +1,4 @@
1
- import { FormContextType, TitleFieldProps, RJSFSchema, StrictRJSFSchema } from '@rjsf/utils';
1
+ import type { FormContextType, TitleFieldProps, RJSFSchema, StrictRJSFSchema } from '@rjsf/utils';
2
2
 
3
3
  const REQUIRED_FIELD_SYMBOL = '*';
4
4
 
@@ -1,5 +1,6 @@
1
- import { FormContextType, RJSFSchema, StrictRJSFSchema, TranslatableString, UnsupportedFieldProps } from '@rjsf/utils';
2
- import { Markdown } from 'markdown-to-jsx';
1
+ import type { FormContextType, RJSFSchema, StrictRJSFSchema, UnsupportedFieldProps } from '@rjsf/utils';
2
+ import { TranslatableString } from '@rjsf/utils';
3
+ import { Markdown } from 'markdown-to-jsx/react';
3
4
 
4
5
  /** The `UnsupportedField` component is used to render a field in the schema is one that is not supported by
5
6
  * react-jsonschema-form.
@@ -13,7 +14,7 @@ function UnsupportedField<T = any, S extends StrictRJSFSchema = RJSFSchema, F ex
13
14
  const { translateString } = registry;
14
15
  let translateEnum: TranslatableString = TranslatableString.UnsupportedField;
15
16
  const translateParams: string[] = [];
16
- if (fieldPathId && fieldPathId.$id) {
17
+ if (fieldPathId?.$id) {
17
18
  translateEnum = TranslatableString.UnsupportedFieldWithId;
18
19
  translateParams.push(fieldPathId.$id);
19
20
  }
@@ -1,12 +1,5 @@
1
- import {
2
- ADDITIONAL_PROPERTY_FLAG,
3
- buttonId,
4
- FormContextType,
5
- RJSFSchema,
6
- StrictRJSFSchema,
7
- TranslatableString,
8
- WrapIfAdditionalTemplateProps,
9
- } from '@rjsf/utils';
1
+ import type { FormContextType, RJSFSchema, StrictRJSFSchema, WrapIfAdditionalTemplateProps } from '@rjsf/utils';
2
+ import { ADDITIONAL_PROPERTY_FLAG, buttonId, TranslatableString } from '@rjsf/utils';
10
3
 
11
4
  import Label from './FieldTemplate/Label';
12
5
 
@@ -1,4 +1,4 @@
1
- import { FormContextType, RJSFSchema, StrictRJSFSchema, TemplatesType } from '@rjsf/utils';
1
+ import type { FormContextType, RJSFSchema, StrictRJSFSchema, TemplatesType } from '@rjsf/utils';
2
2
 
3
3
  import ArrayFieldDescriptionTemplate from './ArrayFieldDescriptionTemplate';
4
4
  import ArrayFieldItemButtonsTemplate from './ArrayFieldItemButtonsTemplate';
@@ -7,6 +7,7 @@ import ArrayFieldTemplate from './ArrayFieldTemplate';
7
7
  import ArrayFieldTitleTemplate from './ArrayFieldTitleTemplate';
8
8
  import BaseInputTemplate from './BaseInputTemplate';
9
9
  import ButtonTemplates from './ButtonTemplates';
10
+ import CyclicSchemaExpandTemplate from './CyclicSchemaExpandTemplate';
10
11
  import DescriptionField from './DescriptionField';
11
12
  import ErrorList from './ErrorList';
12
13
  import FallbackFieldTemplate from './FallbackFieldTemplate';
@@ -34,6 +35,7 @@ function templates<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends F
34
35
  ArrayFieldTitleTemplate,
35
36
  ButtonTemplates: ButtonTemplates<T, S, F>(),
36
37
  BaseInputTemplate,
38
+ CyclicSchemaExpandTemplate,
37
39
  DescriptionFieldTemplate: DescriptionField,
38
40
  ErrorListTemplate: ErrorList,
39
41
  FallbackFieldTemplate,
@@ -1,4 +1,4 @@
1
- import { FormContextType, RJSFSchema, StrictRJSFSchema, WidgetProps } from '@rjsf/utils';
1
+ import type { FormContextType, RJSFSchema, StrictRJSFSchema, WidgetProps } from '@rjsf/utils';
2
2
 
3
3
  /** The `AltDateTimeWidget` is an alternative widget for rendering datetime properties.
4
4
  * It uses the AltDateWidget for rendering, with the `time` prop set to true by default.
@@ -1,12 +1,5 @@
1
- import {
2
- DateElement,
3
- FormContextType,
4
- RJSFSchema,
5
- StrictRJSFSchema,
6
- TranslatableString,
7
- WidgetProps,
8
- useAltDateWidgetProps,
9
- } from '@rjsf/utils';
1
+ import type { FormContextType, RJSFSchema, StrictRJSFSchema, WidgetProps } from '@rjsf/utils';
2
+ import { DateElement, TranslatableString, useAltDateWidgetProps } from '@rjsf/utils';
10
3
 
11
4
  /** The `AltDateWidget` is an alternative widget for rendering date properties.
12
5
  * @param props - The `WidgetProps` for this component
@@ -21,6 +14,7 @@ function AltDateWidget<T = any, S extends StrictRJSFSchema = RJSFSchema, F exten
21
14
  return (
22
15
  <ul className='list-inline'>
23
16
  {elements.map((elemProps, i) => (
17
+ // oxlint-disable-next-line react/no-array-index-key
24
18
  <li className='list-inline-item' key={i}>
25
19
  <DateElement
26
20
  rootId={id}
@@ -38,16 +32,16 @@ function AltDateWidget<T = any, S extends StrictRJSFSchema = RJSFSchema, F exten
38
32
  ))}
39
33
  {(options.hideNowButton !== 'undefined' ? !options.hideNowButton : true) && (
40
34
  <li className='list-inline-item'>
41
- <a href='#' className='btn btn-info btn-now' onClick={handleSetNow}>
35
+ <button type='button' className='btn btn-info btn-now' onClick={handleSetNow}>
42
36
  {translateString(TranslatableString.NowLabel)}
43
- </a>
37
+ </button>
44
38
  </li>
45
39
  )}
46
40
  {(options.hideClearButton !== 'undefined' ? !options.hideClearButton : true) && (
47
41
  <li className='list-inline-item'>
48
- <a href='#' className='btn btn-warning btn-clear' onClick={handleClear}>
42
+ <button type='button' className='btn btn-warning btn-clear' onClick={handleClear}>
49
43
  {translateString(TranslatableString.ClearLabel)}
50
- </a>
44
+ </button>
51
45
  </li>
52
46
  )}
53
47
  </ul>
@@ -1,14 +1,12 @@
1
- import { ChangeEvent, FocusEvent, useCallback } from 'react';
1
+ import type { ChangeEvent, FocusEvent } from 'react';
2
+ import { useCallback } from 'react';
3
+ import type { FormContextType, RJSFSchema, StrictRJSFSchema, WidgetProps } from '@rjsf/utils';
2
4
  import {
3
5
  ariaDescribedByIds,
4
6
  descriptionId,
5
7
  getTemplate,
6
8
  labelValue,
7
9
  schemaRequiresTrueValue,
8
- FormContextType,
9
- RJSFSchema,
10
- StrictRJSFSchema,
11
- WidgetProps,
12
10
  getUiOptions,
13
11
  } from '@rjsf/utils';
14
12
 
@@ -1,4 +1,6 @@
1
- import { ChangeEvent, FocusEvent, useCallback } from 'react';
1
+ import type { ChangeEvent, FocusEvent } from 'react';
2
+ import { useCallback } from 'react';
3
+ import type { FormContextType, WidgetProps, RJSFSchema, StrictRJSFSchema } from '@rjsf/utils';
2
4
  import {
3
5
  ariaDescribedByIds,
4
6
  enumOptionValueDecoder,
@@ -8,10 +10,6 @@ import {
8
10
  enumOptionsSelectValue,
9
11
  getOptionValueFormat,
10
12
  optionId,
11
- FormContextType,
12
- WidgetProps,
13
- RJSFSchema,
14
- StrictRJSFSchema,
15
13
  } from '@rjsf/utils';
16
14
 
17
15
  /** The `CheckboxesWidget` is a widget for rendering checkbox groups.
@@ -37,13 +35,13 @@ function CheckboxesWidget<T = any, S extends StrictRJSFSchema = RJSFSchema, F ex
37
35
 
38
36
  const handleBlur = useCallback(
39
37
  ({ target }: FocusEvent<HTMLInputElement>) =>
40
- onBlur(id, enumOptionValueDecoder<S>(target && target.value, enumOptions, optionValueFormat, emptyValue)),
38
+ onBlur(id, enumOptionValueDecoder<S>(target?.value, enumOptions, optionValueFormat, emptyValue)),
41
39
  [onBlur, id, enumOptions, emptyValue, optionValueFormat],
42
40
  );
43
41
 
44
42
  const handleFocus = useCallback(
45
43
  ({ target }: FocusEvent<HTMLInputElement>) =>
46
- onFocus(id, enumOptionValueDecoder<S>(target && target.value, enumOptions, optionValueFormat, emptyValue)),
44
+ onFocus(id, enumOptionValueDecoder<S>(target?.value, enumOptions, optionValueFormat, emptyValue)),
47
45
  [onFocus, id, enumOptions, emptyValue, optionValueFormat],
48
46
  );
49
47
 
@@ -52,7 +50,7 @@ function CheckboxesWidget<T = any, S extends StrictRJSFSchema = RJSFSchema, F ex
52
50
  {Array.isArray(enumOptions) &&
53
51
  enumOptions.map((option, index) => {
54
52
  const checked = enumOptionsIsSelected<S>(option.value, checkboxesValues);
55
- const itemDisabled = Array.isArray(enumDisabled) && enumDisabled.indexOf(option.value) !== -1;
53
+ const itemDisabled = Array.isArray(enumDisabled) && enumDisabled.includes(option.value);
56
54
  const disabledCls = disabled || itemDisabled || readonly ? 'disabled' : '';
57
55
 
58
56
  const handleChange = (event: ChangeEvent<HTMLInputElement>) => {
@@ -82,11 +80,11 @@ function CheckboxesWidget<T = any, S extends StrictRJSFSchema = RJSFSchema, F ex
82
80
  </span>
83
81
  );
84
82
  return inline ? (
85
- <label key={index} className={`checkbox-inline ${disabledCls}`}>
83
+ <label key={String(option.value)} className={`checkbox-inline ${disabledCls}`}>
86
84
  {checkbox}
87
85
  </label>
88
86
  ) : (
89
- <div key={index} className={`checkbox ${disabledCls}`}>
87
+ <div key={String(option.value)} className={`checkbox ${disabledCls}`}>
90
88
  <label>{checkbox}</label>
91
89
  </div>
92
90
  );
@@ -1,4 +1,5 @@
1
- import { getTemplate, FormContextType, RJSFSchema, StrictRJSFSchema, WidgetProps } from '@rjsf/utils';
1
+ import type { FormContextType, RJSFSchema, StrictRJSFSchema, WidgetProps } from '@rjsf/utils';
2
+ import { getTemplate } from '@rjsf/utils';
2
3
 
3
4
  /** The `ColorWidget` component uses the `BaseInputTemplate` changing the type to `color` and disables it when it is
4
5
  * either disabled or readonly.
@@ -1,12 +1,5 @@
1
- import {
2
- getTemplate,
3
- localToUTC,
4
- utcToLocal,
5
- FormContextType,
6
- RJSFSchema,
7
- StrictRJSFSchema,
8
- WidgetProps,
9
- } from '@rjsf/utils';
1
+ import type { FormContextType, RJSFSchema, StrictRJSFSchema, WidgetProps } from '@rjsf/utils';
2
+ import { getTemplate, localToUTC, utcToLocal } from '@rjsf/utils';
10
3
 
11
4
  /** The `DateTimeWidget` component uses the `BaseInputTemplate` changing the type to `datetime-local` and transforms
12
5
  * the value to/from utc using the appropriate utility functions.
@@ -25,7 +18,7 @@ export default function DateTimeWidget<
25
18
  type='datetime-local'
26
19
  {...props}
27
20
  value={utcToLocal(value)}
28
- onChange={(value) => onChange(localToUTC(value))}
21
+ onChange={(newValue) => onChange(localToUTC(newValue))}
29
22
  />
30
23
  );
31
24
  }
@@ -1,5 +1,6 @@
1
1
  import { useCallback } from 'react';
2
- import { getTemplate, FormContextType, RJSFSchema, StrictRJSFSchema, WidgetProps } from '@rjsf/utils';
2
+ import type { FormContextType, RJSFSchema, StrictRJSFSchema, WidgetProps } from '@rjsf/utils';
3
+ import { getTemplate } from '@rjsf/utils';
3
4
 
4
5
  /** The `DateWidget` component uses the `BaseInputTemplate` changing the type to `date` and transforms
5
6
  * the value to undefined when it is falsy during the `onChange` handling.
@@ -1,4 +1,5 @@
1
- import { getTemplate, FormContextType, RJSFSchema, StrictRJSFSchema, WidgetProps } from '@rjsf/utils';
1
+ import type { FormContextType, RJSFSchema, StrictRJSFSchema, WidgetProps } from '@rjsf/utils';
2
+ import { getTemplate } from '@rjsf/utils';
2
3
 
3
4
  /** The `EmailWidget` component uses the `BaseInputTemplate` changing the type to `email`.
4
5
  *
@@ -1,17 +1,15 @@
1
- import { ChangeEvent } from 'react';
2
- import {
1
+ import type { ChangeEvent } from 'react';
2
+ import type {
3
3
  FileInfoType,
4
4
  FormContextType,
5
- getTemplate,
6
5
  Registry,
7
6
  RJSFSchema,
8
7
  StrictRJSFSchema,
9
- TranslatableString,
10
8
  UIOptionsType,
11
- useFileWidgetProps,
12
9
  WidgetProps,
13
10
  } from '@rjsf/utils';
14
- import { Markdown } from 'markdown-to-jsx';
11
+ import { getTemplate, TranslatableString, useFileWidgetProps } from '@rjsf/utils';
12
+ import { Markdown } from 'markdown-to-jsx/react';
15
13
 
16
14
  function FileInfoPreview<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>({
17
15
  fileInfo,
@@ -25,12 +23,13 @@ function FileInfoPreview<T = any, S extends StrictRJSFSchema = RJSFSchema, F ext
25
23
  if (!dataURL) {
26
24
  return null;
27
25
  }
26
+ const previewLabel = translateString(TranslatableString.PreviewLabel);
28
27
 
29
28
  // If type is JPEG or PNG then show image preview.
30
29
  // Originally, any type of image was supported, but this was changed into a whitelist
31
30
  // since SVGs and animated GIFs are also images, which are generally considered a security risk.
32
31
  if (['image/jpeg', 'image/png'].includes(type)) {
33
- return <img src={dataURL} style={{ maxWidth: '100%' }} className='file-preview' />;
32
+ return <img src={dataURL} alt={previewLabel} style={{ maxWidth: '100%' }} className='file-preview' />;
34
33
  }
35
34
 
36
35
  // otherwise, let users download file
@@ -39,7 +38,7 @@ function FileInfoPreview<T = any, S extends StrictRJSFSchema = RJSFSchema, F ext
39
38
  <>
40
39
  {' '}
41
40
  <a download={`preview-${name}`} href={dataURL} className='file-download'>
42
- {translateString(TranslatableString.PreviewLabel)}
41
+ {previewLabel}
43
42
  </a>
44
43
  </>
45
44
  );
@@ -71,6 +70,7 @@ function FilesInfo<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends F
71
70
  const { name, size, type } = fileInfo;
72
71
  const handleRemove = () => onRemove(key);
73
72
  return (
73
+ // oxlint-disable-next-line react/no-array-index-key
74
74
  <li key={key}>
75
75
  <Markdown>{translateString(TranslatableString.FilesInfo, [name, type, String(size)])}</Markdown>
76
76
  {preview && <FileInfoPreview<T, S, F> fileInfo={fileInfo} registry={registry} />}
@@ -96,6 +96,7 @@ function FileWidget<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends
96
96
  const handleOnChangeEvent = (event: ChangeEvent<HTMLInputElement>) => {
97
97
  if (event.target.files) {
98
98
  // handleChange is async; DOM event handlers are void-returning, so we intentionally don't await
99
+ // oxlint-disable-next-line no-floating-promises, no-void
99
100
  void handleChange(event.target.files);
100
101
  }
101
102
  };
@@ -1,4 +1,4 @@
1
- import { FormContextType, RJSFSchema, StrictRJSFSchema, WidgetProps } from '@rjsf/utils';
1
+ import type { FormContextType, RJSFSchema, StrictRJSFSchema, WidgetProps } from '@rjsf/utils';
2
2
 
3
3
  /** The `HiddenWidget` is a widget for rendering a hidden input field.
4
4
  * It is typically used by setting type to "hidden".
@@ -1,4 +1,5 @@
1
- import { getTemplate, FormContextType, RJSFSchema, StrictRJSFSchema, WidgetProps } from '@rjsf/utils';
1
+ import type { FormContextType, RJSFSchema, StrictRJSFSchema, WidgetProps } from '@rjsf/utils';
2
+ import { getTemplate } from '@rjsf/utils';
2
3
 
3
4
  /** The `PasswordWidget` component uses the `BaseInputTemplate` changing the type to `password`.
4
5
  *