@rjsf/core 6.0.0-alpha.0 → 6.0.0-beta.2

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 (301) hide show
  1. package/dist/core.umd.js +1680 -809
  2. package/dist/index.esm.js +2166 -1198
  3. package/dist/index.esm.js.map +4 -4
  4. package/dist/index.js +2221 -1299
  5. package/dist/index.js.map +4 -4
  6. package/lib/components/Form.d.ts +22 -9
  7. package/lib/components/Form.d.ts.map +1 -0
  8. package/lib/components/Form.js +368 -312
  9. package/lib/components/RichDescription.d.ts +20 -0
  10. package/lib/components/RichDescription.d.ts.map +1 -0
  11. package/lib/components/RichDescription.js +17 -0
  12. package/lib/components/fields/ArrayField.d.ts +20 -9
  13. package/lib/components/fields/ArrayField.d.ts.map +1 -0
  14. package/lib/components/fields/ArrayField.js +212 -206
  15. package/lib/components/fields/BooleanField.d.ts +1 -0
  16. package/lib/components/fields/BooleanField.d.ts.map +1 -0
  17. package/lib/components/fields/BooleanField.js +6 -14
  18. package/lib/components/fields/LayoutGridField.d.ts +480 -0
  19. package/lib/components/fields/LayoutGridField.d.ts.map +1 -0
  20. package/lib/components/fields/LayoutGridField.js +711 -0
  21. package/lib/components/fields/LayoutHeaderField.d.ts +12 -0
  22. package/lib/components/fields/LayoutHeaderField.d.ts.map +1 -0
  23. package/lib/components/fields/LayoutHeaderField.js +23 -0
  24. package/lib/components/fields/LayoutMultiSchemaField.d.ts +28 -0
  25. package/lib/components/fields/LayoutMultiSchemaField.d.ts.map +1 -0
  26. package/lib/components/fields/LayoutMultiSchemaField.js +114 -0
  27. package/lib/components/fields/MultiSchemaField.d.ts +1 -0
  28. package/lib/components/fields/MultiSchemaField.d.ts.map +1 -0
  29. package/lib/components/fields/MultiSchemaField.js +31 -31
  30. package/lib/components/fields/NullField.d.ts +1 -0
  31. package/lib/components/fields/NullField.d.ts.map +1 -0
  32. package/lib/components/fields/NullField.js +0 -1
  33. package/lib/components/fields/NumberField.d.ts +1 -0
  34. package/lib/components/fields/NumberField.d.ts.map +1 -0
  35. package/lib/components/fields/NumberField.js +2 -3
  36. package/lib/components/fields/ObjectField.d.ts +1 -0
  37. package/lib/components/fields/ObjectField.d.ts.map +1 -0
  38. package/lib/components/fields/ObjectField.js +146 -141
  39. package/lib/components/fields/SchemaField.d.ts +1 -0
  40. package/lib/components/fields/SchemaField.d.ts.map +1 -0
  41. package/lib/components/fields/SchemaField.js +10 -20
  42. package/lib/components/fields/StringField.d.ts +1 -0
  43. package/lib/components/fields/StringField.d.ts.map +1 -0
  44. package/lib/components/fields/StringField.js +1 -3
  45. package/lib/components/fields/index.d.ts +1 -0
  46. package/lib/components/fields/index.d.ts.map +1 -0
  47. package/lib/components/fields/index.js +14 -9
  48. package/lib/components/templates/ArrayFieldDescriptionTemplate.d.ts +1 -0
  49. package/lib/components/templates/ArrayFieldDescriptionTemplate.d.ts.map +1 -0
  50. package/lib/components/templates/ArrayFieldDescriptionTemplate.js +0 -1
  51. package/lib/components/templates/ArrayFieldItemButtonsTemplate.d.ts +8 -0
  52. package/lib/components/templates/ArrayFieldItemButtonsTemplate.d.ts.map +1 -0
  53. package/lib/components/templates/ArrayFieldItemButtonsTemplate.js +17 -0
  54. package/lib/components/templates/ArrayFieldItemTemplate.d.ts +4 -3
  55. package/lib/components/templates/ArrayFieldItemTemplate.d.ts.map +1 -0
  56. package/lib/components/templates/ArrayFieldItemTemplate.js +7 -6
  57. package/lib/components/templates/ArrayFieldTemplate.d.ts +2 -1
  58. package/lib/components/templates/ArrayFieldTemplate.d.ts.map +1 -0
  59. package/lib/components/templates/ArrayFieldTemplate.js +3 -4
  60. package/lib/components/templates/ArrayFieldTitleTemplate.d.ts +1 -0
  61. package/lib/components/templates/ArrayFieldTitleTemplate.d.ts.map +1 -0
  62. package/lib/components/templates/ArrayFieldTitleTemplate.js +0 -1
  63. package/lib/components/templates/BaseInputTemplate.d.ts +1 -0
  64. package/lib/components/templates/BaseInputTemplate.d.ts.map +1 -0
  65. package/lib/components/templates/BaseInputTemplate.js +0 -1
  66. package/lib/components/templates/ButtonTemplates/AddButton.d.ts +1 -0
  67. package/lib/components/templates/ButtonTemplates/AddButton.d.ts.map +1 -0
  68. package/lib/components/templates/ButtonTemplates/AddButton.js +1 -2
  69. package/lib/components/templates/ButtonTemplates/IconButton.d.ts +1 -0
  70. package/lib/components/templates/ButtonTemplates/IconButton.d.ts.map +1 -0
  71. package/lib/components/templates/ButtonTemplates/IconButton.js +4 -5
  72. package/lib/components/templates/ButtonTemplates/SubmitButton.d.ts +1 -0
  73. package/lib/components/templates/ButtonTemplates/SubmitButton.d.ts.map +1 -0
  74. package/lib/components/templates/ButtonTemplates/SubmitButton.js +0 -1
  75. package/lib/components/templates/ButtonTemplates/index.d.ts +1 -0
  76. package/lib/components/templates/ButtonTemplates/index.d.ts.map +1 -0
  77. package/lib/components/templates/ButtonTemplates/index.js +3 -4
  78. package/lib/components/templates/DescriptionField.d.ts +1 -0
  79. package/lib/components/templates/DescriptionField.d.ts.map +1 -0
  80. package/lib/components/templates/DescriptionField.js +3 -8
  81. package/lib/components/templates/ErrorList.d.ts +1 -0
  82. package/lib/components/templates/ErrorList.d.ts.map +1 -0
  83. package/lib/components/templates/ErrorList.js +0 -1
  84. package/lib/components/templates/FieldErrorTemplate.d.ts +1 -0
  85. package/lib/components/templates/FieldErrorTemplate.d.ts.map +1 -0
  86. package/lib/components/templates/FieldErrorTemplate.js +0 -1
  87. package/lib/components/templates/FieldHelpTemplate.d.ts +1 -0
  88. package/lib/components/templates/FieldHelpTemplate.d.ts.map +1 -0
  89. package/lib/components/templates/FieldHelpTemplate.js +0 -1
  90. package/lib/components/templates/FieldTemplate/FieldTemplate.d.ts +1 -0
  91. package/lib/components/templates/FieldTemplate/FieldTemplate.d.ts.map +1 -0
  92. package/lib/components/templates/FieldTemplate/FieldTemplate.js +1 -2
  93. package/lib/components/templates/FieldTemplate/Label.d.ts +1 -0
  94. package/lib/components/templates/FieldTemplate/Label.d.ts.map +1 -0
  95. package/lib/components/templates/FieldTemplate/Label.js +0 -1
  96. package/lib/components/templates/FieldTemplate/index.d.ts +2 -1
  97. package/lib/components/templates/FieldTemplate/index.d.ts.map +1 -0
  98. package/lib/components/templates/FieldTemplate/index.js +1 -2
  99. package/lib/components/templates/GridTemplate.d.ts +8 -0
  100. package/lib/components/templates/GridTemplate.d.ts.map +1 -0
  101. package/lib/components/templates/GridTemplate.js +10 -0
  102. package/lib/components/templates/ObjectFieldTemplate.d.ts +1 -0
  103. package/lib/components/templates/ObjectFieldTemplate.d.ts.map +1 -0
  104. package/lib/components/templates/ObjectFieldTemplate.js +2 -3
  105. package/lib/components/templates/TitleField.d.ts +1 -0
  106. package/lib/components/templates/TitleField.d.ts.map +1 -0
  107. package/lib/components/templates/TitleField.js +0 -1
  108. package/lib/components/templates/UnsupportedField.d.ts +1 -0
  109. package/lib/components/templates/UnsupportedField.d.ts.map +1 -0
  110. package/lib/components/templates/UnsupportedField.js +0 -1
  111. package/lib/components/templates/WrapIfAdditionalTemplate.d.ts +1 -0
  112. package/lib/components/templates/WrapIfAdditionalTemplate.d.ts.map +1 -0
  113. package/lib/components/templates/WrapIfAdditionalTemplate.js +10 -6
  114. package/lib/components/templates/index.d.ts +1 -0
  115. package/lib/components/templates/index.d.ts.map +1 -0
  116. package/lib/components/templates/index.js +19 -16
  117. package/lib/components/widgets/AltDateTimeWidget.d.ts +1 -0
  118. package/lib/components/widgets/AltDateTimeWidget.d.ts.map +1 -0
  119. package/lib/components/widgets/AltDateTimeWidget.js +0 -1
  120. package/lib/components/widgets/AltDateWidget.d.ts +1 -0
  121. package/lib/components/widgets/AltDateWidget.d.ts.map +1 -0
  122. package/lib/components/widgets/AltDateWidget.js +0 -1
  123. package/lib/components/widgets/CheckboxWidget.d.ts +1 -0
  124. package/lib/components/widgets/CheckboxWidget.d.ts.map +1 -0
  125. package/lib/components/widgets/CheckboxWidget.js +2 -4
  126. package/lib/components/widgets/CheckboxesWidget.d.ts +1 -0
  127. package/lib/components/widgets/CheckboxesWidget.d.ts.map +1 -0
  128. package/lib/components/widgets/CheckboxesWidget.js +0 -1
  129. package/lib/components/widgets/ColorWidget.d.ts +1 -0
  130. package/lib/components/widgets/ColorWidget.d.ts.map +1 -0
  131. package/lib/components/widgets/ColorWidget.js +0 -1
  132. package/lib/components/widgets/DateTimeWidget.d.ts +1 -0
  133. package/lib/components/widgets/DateTimeWidget.d.ts.map +1 -0
  134. package/lib/components/widgets/DateTimeWidget.js +0 -1
  135. package/lib/components/widgets/DateWidget.d.ts +1 -0
  136. package/lib/components/widgets/DateWidget.d.ts.map +1 -0
  137. package/lib/components/widgets/DateWidget.js +0 -1
  138. package/lib/components/widgets/EmailWidget.d.ts +1 -0
  139. package/lib/components/widgets/EmailWidget.d.ts.map +1 -0
  140. package/lib/components/widgets/EmailWidget.js +0 -1
  141. package/lib/components/widgets/FileWidget.d.ts +1 -0
  142. package/lib/components/widgets/FileWidget.d.ts.map +1 -0
  143. package/lib/components/widgets/FileWidget.js +3 -5
  144. package/lib/components/widgets/HiddenWidget.d.ts +1 -0
  145. package/lib/components/widgets/HiddenWidget.d.ts.map +1 -0
  146. package/lib/components/widgets/HiddenWidget.js +0 -1
  147. package/lib/components/widgets/PasswordWidget.d.ts +1 -0
  148. package/lib/components/widgets/PasswordWidget.d.ts.map +1 -0
  149. package/lib/components/widgets/PasswordWidget.js +0 -1
  150. package/lib/components/widgets/RadioWidget.d.ts +1 -0
  151. package/lib/components/widgets/RadioWidget.d.ts.map +1 -0
  152. package/lib/components/widgets/RadioWidget.js +3 -4
  153. package/lib/components/widgets/RangeWidget.d.ts +1 -0
  154. package/lib/components/widgets/RangeWidget.d.ts.map +1 -0
  155. package/lib/components/widgets/RangeWidget.js +0 -1
  156. package/lib/components/widgets/RatingWidget.d.ts +15 -0
  157. package/lib/components/widgets/RatingWidget.d.ts.map +1 -0
  158. package/lib/components/widgets/RatingWidget.js +63 -0
  159. package/lib/components/widgets/SelectWidget.d.ts +1 -0
  160. package/lib/components/widgets/SelectWidget.d.ts.map +1 -0
  161. package/lib/components/widgets/SelectWidget.js +4 -5
  162. package/lib/components/widgets/TextWidget.d.ts +1 -0
  163. package/lib/components/widgets/TextWidget.d.ts.map +1 -0
  164. package/lib/components/widgets/TextWidget.js +0 -1
  165. package/lib/components/widgets/TextareaWidget.d.ts +1 -0
  166. package/lib/components/widgets/TextareaWidget.d.ts.map +1 -0
  167. package/lib/components/widgets/TextareaWidget.js +0 -1
  168. package/lib/components/widgets/TimeWidget.d.ts +1 -0
  169. package/lib/components/widgets/TimeWidget.d.ts.map +1 -0
  170. package/lib/components/widgets/TimeWidget.js +0 -1
  171. package/lib/components/widgets/URLWidget.d.ts +1 -0
  172. package/lib/components/widgets/URLWidget.d.ts.map +1 -0
  173. package/lib/components/widgets/URLWidget.js +0 -1
  174. package/lib/components/widgets/UpDownWidget.d.ts +1 -0
  175. package/lib/components/widgets/UpDownWidget.d.ts.map +1 -0
  176. package/lib/components/widgets/UpDownWidget.js +0 -1
  177. package/lib/components/widgets/index.d.ts +1 -0
  178. package/lib/components/widgets/index.d.ts.map +1 -0
  179. package/lib/components/widgets/index.js +21 -20
  180. package/lib/getDefaultRegistry.d.ts +1 -0
  181. package/lib/getDefaultRegistry.d.ts.map +1 -0
  182. package/lib/getDefaultRegistry.js +3 -4
  183. package/lib/index.d.ts +7 -5
  184. package/lib/index.d.ts.map +1 -0
  185. package/lib/index.js +5 -5
  186. package/lib/tsconfig.tsbuildinfo +1 -1
  187. package/lib/withTheme.d.ts +2 -1
  188. package/lib/withTheme.d.ts.map +1 -0
  189. package/lib/withTheme.js +7 -8
  190. package/package.json +46 -37
  191. package/src/components/Form.tsx +127 -41
  192. package/src/components/RichDescription.tsx +50 -0
  193. package/src/components/fields/ArrayField.tsx +34 -24
  194. package/src/components/fields/BooleanField.tsx +6 -14
  195. package/src/components/fields/LayoutGridField.tsx +967 -0
  196. package/src/components/fields/LayoutHeaderField.tsx +49 -0
  197. package/src/components/fields/LayoutMultiSchemaField.tsx +228 -0
  198. package/src/components/fields/MultiSchemaField.tsx +9 -4
  199. package/src/components/fields/NullField.tsx +1 -1
  200. package/src/components/fields/NumberField.tsx +5 -5
  201. package/src/components/fields/ObjectField.tsx +32 -24
  202. package/src/components/fields/SchemaField.tsx +17 -30
  203. package/src/components/fields/StringField.tsx +2 -2
  204. package/src/components/fields/index.ts +7 -1
  205. package/src/components/templates/ArrayFieldDescriptionTemplate.tsx +2 -2
  206. package/src/components/templates/ArrayFieldItemButtonsTemplate.tsx +85 -0
  207. package/src/components/templates/ArrayFieldItemTemplate.tsx +18 -57
  208. package/src/components/templates/ArrayFieldTemplate.tsx +10 -8
  209. package/src/components/templates/ArrayFieldTitleTemplate.tsx +2 -2
  210. package/src/components/templates/BaseInputTemplate.tsx +4 -4
  211. package/src/components/templates/ButtonTemplates/IconButton.tsx +9 -36
  212. package/src/components/templates/ButtonTemplates/SubmitButton.tsx +1 -1
  213. package/src/components/templates/ButtonTemplates/index.ts +1 -1
  214. package/src/components/templates/DescriptionField.tsx +9 -15
  215. package/src/components/templates/FieldErrorTemplate.tsx +1 -1
  216. package/src/components/templates/FieldHelpTemplate.tsx +1 -1
  217. package/src/components/templates/FieldTemplate/FieldTemplate.tsx +2 -2
  218. package/src/components/templates/GridTemplate.tsx +15 -0
  219. package/src/components/templates/ObjectFieldTemplate.tsx +5 -3
  220. package/src/components/templates/TitleField.tsx +1 -1
  221. package/src/components/templates/UnsupportedField.tsx +1 -1
  222. package/src/components/templates/WrapIfAdditionalTemplate.tsx +14 -4
  223. package/src/components/templates/index.ts +4 -0
  224. package/src/components/widgets/AltDateWidget.tsx +9 -6
  225. package/src/components/widgets/CheckboxWidget.tsx +5 -5
  226. package/src/components/widgets/CheckboxesWidget.tsx +2 -2
  227. package/src/components/widgets/ColorWidget.tsx +1 -1
  228. package/src/components/widgets/DateTimeWidget.tsx +1 -1
  229. package/src/components/widgets/DateWidget.tsx +1 -1
  230. package/src/components/widgets/EmailWidget.tsx +1 -1
  231. package/src/components/widgets/FileWidget.tsx +5 -5
  232. package/src/components/widgets/PasswordWidget.tsx +1 -1
  233. package/src/components/widgets/RadioWidget.tsx +3 -3
  234. package/src/components/widgets/RangeWidget.tsx +1 -1
  235. package/src/components/widgets/RatingWidget.tsx +129 -0
  236. package/src/components/widgets/SelectWidget.tsx +4 -3
  237. package/src/components/widgets/TextWidget.tsx +1 -1
  238. package/src/components/widgets/TextareaWidget.tsx +3 -3
  239. package/src/components/widgets/TimeWidget.tsx +1 -1
  240. package/src/components/widgets/URLWidget.tsx +1 -1
  241. package/src/components/widgets/UpDownWidget.tsx +1 -1
  242. package/src/components/widgets/index.ts +3 -1
  243. package/src/getDefaultRegistry.ts +1 -1
  244. package/src/index.ts +3 -2
  245. package/src/tsconfig.json +14 -6
  246. package/src/withTheme.tsx +4 -3
  247. package/LICENSE.md +0 -201
  248. package/lib/components/Form.js.map +0 -1
  249. package/lib/components/fields/ArrayField.js.map +0 -1
  250. package/lib/components/fields/BooleanField.js.map +0 -1
  251. package/lib/components/fields/MultiSchemaField.js.map +0 -1
  252. package/lib/components/fields/NullField.js.map +0 -1
  253. package/lib/components/fields/NumberField.js.map +0 -1
  254. package/lib/components/fields/ObjectField.js.map +0 -1
  255. package/lib/components/fields/SchemaField.js.map +0 -1
  256. package/lib/components/fields/StringField.js.map +0 -1
  257. package/lib/components/fields/index.js.map +0 -1
  258. package/lib/components/templates/ArrayFieldDescriptionTemplate.js.map +0 -1
  259. package/lib/components/templates/ArrayFieldItemTemplate.js.map +0 -1
  260. package/lib/components/templates/ArrayFieldTemplate.js.map +0 -1
  261. package/lib/components/templates/ArrayFieldTitleTemplate.js.map +0 -1
  262. package/lib/components/templates/BaseInputTemplate.js.map +0 -1
  263. package/lib/components/templates/ButtonTemplates/AddButton.js.map +0 -1
  264. package/lib/components/templates/ButtonTemplates/IconButton.js.map +0 -1
  265. package/lib/components/templates/ButtonTemplates/SubmitButton.js.map +0 -1
  266. package/lib/components/templates/ButtonTemplates/index.js.map +0 -1
  267. package/lib/components/templates/DescriptionField.js.map +0 -1
  268. package/lib/components/templates/ErrorList.js.map +0 -1
  269. package/lib/components/templates/FieldErrorTemplate.js.map +0 -1
  270. package/lib/components/templates/FieldHelpTemplate.js.map +0 -1
  271. package/lib/components/templates/FieldTemplate/FieldTemplate.js.map +0 -1
  272. package/lib/components/templates/FieldTemplate/Label.js.map +0 -1
  273. package/lib/components/templates/FieldTemplate/index.js.map +0 -1
  274. package/lib/components/templates/ObjectFieldTemplate.js.map +0 -1
  275. package/lib/components/templates/TitleField.js.map +0 -1
  276. package/lib/components/templates/UnsupportedField.js.map +0 -1
  277. package/lib/components/templates/WrapIfAdditionalTemplate.js.map +0 -1
  278. package/lib/components/templates/index.js.map +0 -1
  279. package/lib/components/widgets/AltDateTimeWidget.js.map +0 -1
  280. package/lib/components/widgets/AltDateWidget.js.map +0 -1
  281. package/lib/components/widgets/CheckboxWidget.js.map +0 -1
  282. package/lib/components/widgets/CheckboxesWidget.js.map +0 -1
  283. package/lib/components/widgets/ColorWidget.js.map +0 -1
  284. package/lib/components/widgets/DateTimeWidget.js.map +0 -1
  285. package/lib/components/widgets/DateWidget.js.map +0 -1
  286. package/lib/components/widgets/EmailWidget.js.map +0 -1
  287. package/lib/components/widgets/FileWidget.js.map +0 -1
  288. package/lib/components/widgets/HiddenWidget.js.map +0 -1
  289. package/lib/components/widgets/PasswordWidget.js.map +0 -1
  290. package/lib/components/widgets/RadioWidget.js.map +0 -1
  291. package/lib/components/widgets/RangeWidget.js.map +0 -1
  292. package/lib/components/widgets/SelectWidget.js.map +0 -1
  293. package/lib/components/widgets/TextWidget.js.map +0 -1
  294. package/lib/components/widgets/TextareaWidget.js.map +0 -1
  295. package/lib/components/widgets/TimeWidget.js.map +0 -1
  296. package/lib/components/widgets/URLWidget.js.map +0 -1
  297. package/lib/components/widgets/UpDownWidget.js.map +0 -1
  298. package/lib/components/widgets/index.js.map +0 -1
  299. package/lib/getDefaultRegistry.js.map +0 -1
  300. package/lib/index.js.map +0 -1
  301. package/lib/withTheme.js.map +0 -1
@@ -0,0 +1,12 @@
1
+ import { FieldProps, FormContextType, RJSFSchema, StrictRJSFSchema } from '@rjsf/utils';
2
+ /** The `LayoutHeaderField` component renders a `TitleFieldTemplate` with an `id` derived from the `idSchema`
3
+ * and whether it is `required` from the props. The `title` is derived from the props as follows:
4
+ * - If there is a title in the `uiSchema`, it is displayed
5
+ * - Else, if there is an explicit `title` passed in the props, it is displayed
6
+ * - Otherwise, if there is a title in the `schema`, it is displayed
7
+ * - Finally, the `name` prop is displayed as the title
8
+ *
9
+ * @param props - The `LayoutHeaderField` for the component
10
+ */
11
+ export default function LayoutHeaderField<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>(props: FieldProps<T, S, F>): import("react/jsx-runtime").JSX.Element | null;
12
+ //# sourceMappingURL=LayoutHeaderField.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LayoutHeaderField.d.ts","sourceRoot":"","sources":["../../../src/components/fields/LayoutHeaderField.tsx"],"names":[],"mappings":"AAAA,OAAO,EAIL,UAAU,EACV,eAAe,EACf,UAAU,EACV,gBAAgB,EAEjB,MAAM,aAAa,CAAC;AAErB;;;;;;;;GAQG;AACH,MAAM,CAAC,OAAO,UAAU,iBAAiB,CACvC,CAAC,GAAG,GAAG,EACP,CAAC,SAAS,gBAAgB,GAAG,UAAU,EACvC,CAAC,SAAS,eAAe,GAAG,GAAG,EAC/B,KAAK,EAAE,UAAU,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,kDAwB3B"}
@@ -0,0 +1,23 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { getTemplate, getUiOptions, titleId, } from '@rjsf/utils';
3
+ /** The `LayoutHeaderField` component renders a `TitleFieldTemplate` with an `id` derived from the `idSchema`
4
+ * and whether it is `required` from the props. The `title` is derived from the props as follows:
5
+ * - If there is a title in the `uiSchema`, it is displayed
6
+ * - Else, if there is an explicit `title` passed in the props, it is displayed
7
+ * - Otherwise, if there is a title in the `schema`, it is displayed
8
+ * - Finally, the `name` prop is displayed as the title
9
+ *
10
+ * @param props - The `LayoutHeaderField` for the component
11
+ */
12
+ export default function LayoutHeaderField(props) {
13
+ const { idSchema, title, schema, uiSchema, required, registry, name } = props;
14
+ const options = getUiOptions(uiSchema, registry.globalUiOptions);
15
+ const { title: uiTitle } = options;
16
+ const { title: schemaTitle } = schema;
17
+ const fieldTitle = uiTitle || title || schemaTitle || name;
18
+ if (!fieldTitle) {
19
+ return null;
20
+ }
21
+ const TitleFieldTemplate = getTemplate('TitleFieldTemplate', registry, options);
22
+ return (_jsx(TitleFieldTemplate, { id: titleId(idSchema), title: fieldTitle, required: required, schema: schema, uiSchema: uiSchema, registry: registry }));
23
+ }
@@ -0,0 +1,28 @@
1
+ import { EnumOptionsType, FieldProps, FormContextType, RJSFSchema, SchemaUtilsType, StrictRJSFSchema, UiSchema } from '@rjsf/utils';
2
+ /** Gets the selected option from the list of `options`, using the `selectorField` to search inside each `option` for
3
+ * the `properties[selectorField].default(or const)` that matches the given `value`.
4
+ *
5
+ * @param options - The list of schemas each representing a choice in the `oneOf`
6
+ * @param selectorField - The name of the field that is common in all of the schemas that represents the selector field
7
+ * @param value - The current value of the selector field from the data
8
+ */
9
+ export declare function getSelectedOption<S extends StrictRJSFSchema = RJSFSchema>(options: EnumOptionsType<S>[], selectorField: string, value: unknown): S | undefined;
10
+ /** Computes the `enumOptions` array from the schema and options.
11
+ *
12
+ * @param schema - The schema that contains the `options`
13
+ * @param options - The options from the `schema`
14
+ * @param schemaUtils - The SchemaUtilsType object used to call retrieveSchema,
15
+ * @param [uiSchema] - The optional uiSchema for the schema
16
+ * @param [formData] - The optional formData associated with the schema
17
+ * @returns - The list of enumOptions for the `schema` and `options`
18
+ * @throws - Error when no enum options were computed
19
+ */
20
+ export declare function computeEnumOptions<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>(schema: S, options: S[], schemaUtils: SchemaUtilsType<T, S, F>, uiSchema?: UiSchema<T, S, F>, formData?: T): EnumOptionsType<S>[];
21
+ /** The `LayoutMultiSchemaField` is an adaptation of the `MultiSchemaField` but changed considerably to only
22
+ * support `anyOf`/`oneOf` fields that are being displayed in a `LayoutGridField` where the field selection is shown as
23
+ * a radio group by default. It expects that a `selectorField` is provided (either directly via the `discriminator`
24
+ * field or indirectly via `ui:optionsSchemaSelector` in the `uiSchema`) to help determine which `anyOf`/`oneOf` schema
25
+ * is active. If no `selectorField` is specified, then an error is thrown.
26
+ */
27
+ export default function LayoutMultiSchemaField<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>(props: FieldProps<T, S, F>): import("react/jsx-runtime").JSX.Element;
28
+ //# sourceMappingURL=LayoutMultiSchemaField.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LayoutMultiSchemaField.d.ts","sourceRoot":"","sources":["../../../src/components/fields/LayoutMultiSchemaField.tsx"],"names":[],"mappings":"AACA,OAAO,EAIL,eAAe,EAEf,UAAU,EACV,eAAe,EAOf,UAAU,EAIV,eAAe,EACf,gBAAgB,EAChB,QAAQ,EACT,MAAM,aAAa,CAAC;AAQrB;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAAC,CAAC,SAAS,gBAAgB,GAAG,UAAU,EACvE,OAAO,EAAE,eAAe,CAAC,CAAC,CAAC,EAAE,EAC7B,aAAa,EAAE,MAAM,EACrB,KAAK,EAAE,OAAO,GACb,CAAC,GAAG,SAAS,CAQf;AAED;;;;;;;;;GASG;AACH,wBAAgB,kBAAkB,CAAC,CAAC,GAAG,GAAG,EAAE,CAAC,SAAS,gBAAgB,GAAG,UAAU,EAAE,CAAC,SAAS,eAAe,GAAG,GAAG,EAClH,MAAM,EAAE,CAAC,EACT,OAAO,EAAE,CAAC,EAAE,EACZ,WAAW,EAAE,eAAe,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EACrC,QAAQ,CAAC,EAAE,QAAQ,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAC5B,QAAQ,CAAC,EAAE,CAAC,GACX,eAAe,CAAC,CAAC,CAAC,EAAE,CAatB;AAED;;;;;GAKG;AACH,MAAM,CAAC,OAAO,UAAU,sBAAsB,CAC5C,CAAC,GAAG,GAAG,EACP,CAAC,SAAS,gBAAgB,GAAG,UAAU,EACvC,CAAC,SAAS,eAAe,GAAG,GAAG,EAC/B,KAAK,EAAE,UAAU,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,2CAuI3B"}
@@ -0,0 +1,114 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { useState, useEffect } from 'react';
3
+ import { ANY_OF_KEY, CONST_KEY, DEFAULT_KEY, ERRORS_KEY, getDiscriminatorFieldFromSchema, hashObject, ID_KEY, ONE_OF_KEY, optionsList, PROPERTIES_KEY, getTemplate, getUiOptions, getWidget, } from '@rjsf/utils';
4
+ import get from 'lodash-es/get.js';
5
+ import has from 'lodash-es/has.js';
6
+ import isEmpty from 'lodash-es/isEmpty.js';
7
+ import noop from 'lodash-es/noop.js';
8
+ import omit from 'lodash-es/omit.js';
9
+ import set from 'lodash-es/set.js';
10
+ /** Gets the selected option from the list of `options`, using the `selectorField` to search inside each `option` for
11
+ * the `properties[selectorField].default(or const)` that matches the given `value`.
12
+ *
13
+ * @param options - The list of schemas each representing a choice in the `oneOf`
14
+ * @param selectorField - The name of the field that is common in all of the schemas that represents the selector field
15
+ * @param value - The current value of the selector field from the data
16
+ */
17
+ export function getSelectedOption(options, selectorField, value) {
18
+ const defaultValue = '!@#!@$@#$!@$#';
19
+ const schemaOptions = options.map(({ schema }) => schema);
20
+ return schemaOptions.find((option) => {
21
+ const selector = get(option, [PROPERTIES_KEY, selectorField]);
22
+ const result = get(selector, DEFAULT_KEY, get(selector, CONST_KEY, defaultValue));
23
+ return result === value;
24
+ });
25
+ }
26
+ /** Computes the `enumOptions` array from the schema and options.
27
+ *
28
+ * @param schema - The schema that contains the `options`
29
+ * @param options - The options from the `schema`
30
+ * @param schemaUtils - The SchemaUtilsType object used to call retrieveSchema,
31
+ * @param [uiSchema] - The optional uiSchema for the schema
32
+ * @param [formData] - The optional formData associated with the schema
33
+ * @returns - The list of enumOptions for the `schema` and `options`
34
+ * @throws - Error when no enum options were computed
35
+ */
36
+ export function computeEnumOptions(schema, options, schemaUtils, uiSchema, formData) {
37
+ const realOptions = options.map((opt) => schemaUtils.retrieveSchema(opt, formData));
38
+ let tempSchema = schema;
39
+ if (has(schema, ONE_OF_KEY)) {
40
+ tempSchema = { ...schema, [ONE_OF_KEY]: realOptions };
41
+ }
42
+ else if (has(schema, ANY_OF_KEY)) {
43
+ tempSchema = { ...schema, [ANY_OF_KEY]: realOptions };
44
+ }
45
+ const enumOptions = optionsList(tempSchema, uiSchema);
46
+ if (!enumOptions) {
47
+ throw new Error(`No enumOptions were computed from the schema ${JSON.stringify(tempSchema)}`);
48
+ }
49
+ return enumOptions;
50
+ }
51
+ /** The `LayoutMultiSchemaField` is an adaptation of the `MultiSchemaField` but changed considerably to only
52
+ * support `anyOf`/`oneOf` fields that are being displayed in a `LayoutGridField` where the field selection is shown as
53
+ * a radio group by default. It expects that a `selectorField` is provided (either directly via the `discriminator`
54
+ * field or indirectly via `ui:optionsSchemaSelector` in the `uiSchema`) to help determine which `anyOf`/`oneOf` schema
55
+ * is active. If no `selectorField` is specified, then an error is thrown.
56
+ */
57
+ export default function LayoutMultiSchemaField(props) {
58
+ const { name, baseType, disabled = false, formData, idSchema, onBlur, onChange, options, onFocus, registry, uiSchema, schema, formContext, autofocus, readonly, required, errorSchema, hideError = false, } = props;
59
+ const { widgets, schemaUtils, globalUiOptions } = registry;
60
+ const [enumOptions, setEnumOptions] = useState(computeEnumOptions(schema, options, schemaUtils, uiSchema, formData));
61
+ const id = get(idSchema, ID_KEY);
62
+ const discriminator = getDiscriminatorFieldFromSchema(schema);
63
+ const FieldErrorTemplate = getTemplate('FieldErrorTemplate', registry, options);
64
+ const FieldTemplate = getTemplate('FieldTemplate', registry, options);
65
+ const schemaHash = hashObject(schema);
66
+ const optionsHash = hashObject(options);
67
+ const uiSchemaHash = uiSchema ? hashObject(uiSchema) : '';
68
+ const formDataHash = formData ? hashObject(formData) : '';
69
+ useEffect(() => {
70
+ setEnumOptions(computeEnumOptions(schema, options, schemaUtils, uiSchema, formData));
71
+ // We are using hashes in place of the dependencies
72
+ // eslint-disable-next-line react-hooks/exhaustive-deps
73
+ }, [schemaHash, optionsHash, schemaUtils, uiSchemaHash, formDataHash]);
74
+ const { widget = discriminator ? 'radio' : 'select', title = '', placeholder = '', optionsSchemaSelector: selectorField = discriminator, hideError: uiSchemaHideError, ...uiOptions } = getUiOptions(uiSchema);
75
+ if (!selectorField) {
76
+ throw new Error('No selector field provided for the LayoutMultiSchemaField');
77
+ }
78
+ const selectedOption = get(formData, selectorField);
79
+ let optionSchema = get(enumOptions[0]?.schema, [PROPERTIES_KEY, selectorField], {});
80
+ const option = getSelectedOption(enumOptions, selectorField, selectedOption);
81
+ // If the subschema doesn't declare a type, infer the type from the parent schema
82
+ optionSchema = optionSchema?.type ? optionSchema : { ...optionSchema, type: option?.type || baseType };
83
+ const Widget = getWidget(optionSchema, widget, widgets);
84
+ // The following code was copied from `@rjsf`'s `SchemaField`
85
+ // Set hideError to the value provided in the uiSchema, otherwise stick with the prop to propagate to children
86
+ const hideFieldError = uiSchemaHideError === undefined ? hideError : Boolean(uiSchemaHideError);
87
+ const rawErrors = get(errorSchema, [ERRORS_KEY], []);
88
+ const fieldErrorSchema = omit(errorSchema, [ERRORS_KEY]);
89
+ const displayLabel = schemaUtils.getDisplayLabel(schema, uiSchema, globalUiOptions);
90
+ /** Callback function that updates the selected option and adjusts the form data based on the structure of the new
91
+ * option, calling the `onChange` callback with the adjusted formData.
92
+ *
93
+ * @param opt - If the option is undefined, we are going to clear the selection otherwise we
94
+ * will use it as the index of the new option to select
95
+ */
96
+ const onOptionChange = (opt) => {
97
+ const newOption = getSelectedOption(enumOptions, selectorField, opt);
98
+ const oldOption = getSelectedOption(enumOptions, selectorField, selectedOption);
99
+ let newFormData = schemaUtils.sanitizeDataForNewSchema(newOption, oldOption, formData);
100
+ if (newFormData && newOption) {
101
+ // Call getDefaultFormState to make sure defaults are populated on change.
102
+ newFormData = schemaUtils.getDefaultFormState(newOption, newFormData, 'excludeObjectChildren');
103
+ }
104
+ if (newFormData) {
105
+ set(newFormData, selectorField, opt);
106
+ }
107
+ onChange(newFormData, undefined, id);
108
+ };
109
+ // filtering the options based on the type of widget because `selectField` does not recognize the `convertOther` prop
110
+ const widgetOptions = { enumOptions, ...uiOptions };
111
+ const errors = !hideFieldError && rawErrors.length > 0 ? (_jsx(FieldErrorTemplate, { idSchema: idSchema, schema: schema, errors: rawErrors, registry: registry })) : undefined;
112
+ const ignored = (value) => noop;
113
+ return (_jsx(FieldTemplate, { id: id, schema: schema, label: (title || schema.title) ?? '', disabled: disabled || (Array.isArray(enumOptions) && isEmpty(enumOptions)), uiSchema: uiSchema, formContext: formContext, required: required, readonly: !!readonly, registry: registry, displayLabel: displayLabel, errors: errors, onChange: onChange, onDropPropertyClick: ignored, onKeyChange: ignored, children: _jsx(Widget, { id: id, name: name, schema: schema, label: (title || schema.title) ?? '', disabled: disabled || (Array.isArray(enumOptions) && isEmpty(enumOptions)), uiSchema: uiSchema, formContext: formContext, autofocus: autofocus, readonly: readonly, required: required, registry: registry, multiple: false, rawErrors: rawErrors, hideError: hideFieldError, hideLabel: !displayLabel, errorSchema: fieldErrorSchema, placeholder: placeholder, onChange: onOptionChange, onBlur: onBlur, onFocus: onFocus, value: selectedOption, options: widgetOptions }) }));
114
+ }
@@ -45,3 +45,4 @@ declare class AnyOfField<T = any, S extends StrictRJSFSchema = RJSFSchema, F ext
45
45
  render(): import("react/jsx-runtime").JSX.Element;
46
46
  }
47
47
  export default AnyOfField;
48
+ //# sourceMappingURL=MultiSchemaField.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MultiSchemaField.d.ts","sourceRoot":"","sources":["../../../src/components/fields/MultiSchemaField.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAIlC,OAAO,EAIL,UAAU,EACV,eAAe,EAMf,UAAU,EACV,gBAAgB,EAGjB,MAAM,aAAa,CAAC;AAErB,4DAA4D;AAC5D,KAAK,eAAe,CAAC,CAAC,SAAS,gBAAgB,GAAG,UAAU,IAAI;IAC9D,oCAAoC;IACpC,cAAc,EAAE,MAAM,CAAC;IACvB,oDAAoD;IACpD,gBAAgB,EAAE,CAAC,EAAE,CAAC;CACvB,CAAC;AAEF;;;;GAIG;AACH,cAAM,UAAU,CAAC,CAAC,GAAG,GAAG,EAAE,CAAC,SAAS,gBAAgB,GAAG,UAAU,EAAE,CAAC,SAAS,eAAe,GAAG,GAAG,CAAE,SAAQ,SAAS,CACnH,UAAU,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EACnB,eAAe,CAAC,CAAC,CAAC,CACnB;IACC;;;OAGG;gBACS,KAAK,EAAE,UAAU,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;IAiBtC;;;;;OAKG;IACH,kBAAkB,CAAC,SAAS,EAAE,QAAQ,CAAC,UAAU,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,QAAQ,CAAC,eAAe,CAAC;IAyBjG;;;;;OAKG;IACH,iBAAiB,CAAC,cAAc,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,GAAG,SAAS,EAAE,OAAO,EAAE,CAAC,EAAE;IAW/E;;;;;OAKG;IACH,cAAc,GAAI,SAAS,MAAM,UAqB/B;IAEF,UAAU;IAKV;OACG;IACH,MAAM;CA0GP;AAED,eAAe,UAAU,CAAC"}
@@ -1,8 +1,8 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { Component } from 'react';
3
- import get from 'lodash/get';
4
- import isEmpty from 'lodash/isEmpty';
5
- import omit from 'lodash/omit';
3
+ import get from 'lodash-es/get.js';
4
+ import isEmpty from 'lodash-es/isEmpty.js';
5
+ import omit from 'lodash-es/omit.js';
6
6
  import { ANY_OF_KEY, deepEquals, ERRORS_KEY, getDiscriminatorFieldFromSchema, getUiOptions, getWidget, mergeSchemas, ONE_OF_KEY, TranslatableString, } from '@rjsf/utils';
7
7
  /** The `AnyOfField` component is used to render a field in the schema that is an `anyOf`, `allOf` or `oneOf`. It tracks
8
8
  * the currently selected option and cleans up any irrelevant data in `formData`.
@@ -16,31 +16,6 @@ class AnyOfField extends Component {
16
16
  */
17
17
  constructor(props) {
18
18
  super(props);
19
- /** Callback handler to remember what the currently selected option is. In addition to that the `formData` is updated
20
- * to remove properties that are not part of the newly selected option schema, and then the updated data is passed to
21
- * the `onChange` handler.
22
- *
23
- * @param option - The new option value being selected
24
- */
25
- this.onOptionChange = (option) => {
26
- const { selectedOption, retrievedOptions } = this.state;
27
- const { formData, onChange, registry } = this.props;
28
- const { schemaUtils } = registry;
29
- const intOption = option !== undefined ? parseInt(option, 10) : -1;
30
- if (intOption === selectedOption) {
31
- return;
32
- }
33
- const newOption = intOption >= 0 ? retrievedOptions[intOption] : undefined;
34
- const oldOption = selectedOption >= 0 ? retrievedOptions[selectedOption] : undefined;
35
- let newFormData = schemaUtils.sanitizeDataForNewSchema(newOption, oldOption, formData);
36
- if (newFormData && newOption) {
37
- // Call getDefaultFormState to make sure defaults are populated on change. Pass "excludeObjectChildren"
38
- // so that only the root objects themselves are created without adding undefined children properties
39
- newFormData = schemaUtils.getDefaultFormState(newOption, newFormData, 'excludeObjectChildren');
40
- }
41
- onChange(newFormData, undefined, this.getFieldId());
42
- this.setState({ selectedOption: intOption });
43
- };
44
19
  const { formData, options, registry: { schemaUtils }, } = this.props;
45
20
  // cache the retrieved options in state in case they have $refs to save doing it later
46
21
  const retrievedOptions = options.map((opt) => schemaUtils.retrieveSchema(opt, formData));
@@ -88,6 +63,32 @@ class AnyOfField extends Component {
88
63
  const option = schemaUtils.getClosestMatchingOption(formData, options, selectedOption, discriminator);
89
64
  return option;
90
65
  }
66
+ /** Callback handler to remember what the currently selected option is. In addition to that the `formData` is updated
67
+ * to remove properties that are not part of the newly selected option schema, and then the updated data is passed to
68
+ * the `onChange` handler.
69
+ *
70
+ * @param option - The new option value being selected
71
+ */
72
+ onOptionChange = (option) => {
73
+ const { selectedOption, retrievedOptions } = this.state;
74
+ const { formData, onChange, registry } = this.props;
75
+ const { schemaUtils } = registry;
76
+ const intOption = option !== undefined ? parseInt(option, 10) : -1;
77
+ if (intOption === selectedOption) {
78
+ return;
79
+ }
80
+ const newOption = intOption >= 0 ? retrievedOptions[intOption] : undefined;
81
+ const oldOption = selectedOption >= 0 ? retrievedOptions[selectedOption] : undefined;
82
+ let newFormData = schemaUtils.sanitizeDataForNewSchema(newOption, oldOption, formData);
83
+ if (newOption) {
84
+ // Call getDefaultFormState to make sure defaults are populated on change. Pass "excludeObjectChildren"
85
+ // so that only the root objects themselves are created without adding undefined children properties
86
+ newFormData = schemaUtils.getDefaultFormState(newOption, newFormData, 'excludeObjectChildren');
87
+ }
88
+ this.setState({ selectedOption: intOption }, () => {
89
+ onChange(newFormData, undefined, this.getFieldId());
90
+ });
91
+ };
91
92
  getFieldId() {
92
93
  const { idSchema, schema } = this.props;
93
94
  return `${idSchema.$id}${schema.oneOf ? '__oneof_select' : '__anyof_select'}`;
@@ -95,7 +96,7 @@ class AnyOfField extends Component {
95
96
  /** Renders the `AnyOfField` selector along with a `SchemaField` for the value of the `formData`
96
97
  */
97
98
  render() {
98
- const { name, disabled = false, errorSchema = {}, formContext, onBlur, onFocus, registry, schema, uiSchema, } = this.props;
99
+ const { name, disabled = false, errorSchema = {}, formContext, onBlur, onFocus, readonly, registry, schema, uiSchema, } = this.props;
99
100
  const { widgets, fields, translateString, globalUiOptions, schemaUtils } = registry;
100
101
  const { SchemaField: _SchemaField } = fields;
101
102
  const { selectedOption, retrievedOptions } = this.state;
@@ -147,8 +148,7 @@ class AnyOfField extends Component {
147
148
  value: index,
148
149
  };
149
150
  });
150
- return (_jsxs("div", { className: 'panel panel-default panel-body', children: [_jsx("div", { className: 'form-group', children: _jsx(Widget, { id: this.getFieldId(), name: `${name}${schema.oneOf ? '__oneof_select' : '__anyof_select'}`, schema: { type: 'number', default: 0 }, onChange: this.onOptionChange, onBlur: onBlur, onFocus: onFocus, disabled: disabled || isEmpty(enumOptions), multiple: false, rawErrors: rawErrors, errorSchema: fieldErrorSchema, value: selectedOption >= 0 ? selectedOption : undefined, options: { enumOptions, ...uiOptions }, registry: registry, formContext: formContext, placeholder: placeholder, autocomplete: autocomplete, autofocus: autofocus, label: title !== null && title !== void 0 ? title : name, hideLabel: !displayLabel }) }), optionSchema && _jsx(_SchemaField, { ...this.props, schema: optionSchema, uiSchema: optionUiSchema })] }));
151
+ return (_jsxs("div", { className: 'panel panel-default panel-body', children: [_jsx("div", { className: 'form-group', children: _jsx(Widget, { id: this.getFieldId(), name: `${name}${schema.oneOf ? '__oneof_select' : '__anyof_select'}`, schema: { type: 'number', default: 0 }, onChange: this.onOptionChange, onBlur: onBlur, onFocus: onFocus, disabled: disabled || isEmpty(enumOptions), multiple: false, rawErrors: rawErrors, errorSchema: fieldErrorSchema, value: selectedOption >= 0 ? selectedOption : undefined, options: { enumOptions, ...uiOptions }, registry: registry, formContext: formContext, placeholder: placeholder, autocomplete: autocomplete, autofocus: autofocus, label: title ?? name, hideLabel: !displayLabel, readonly: readonly }) }), optionSchema && optionSchema.type !== 'null' && (_jsx(_SchemaField, { ...this.props, schema: optionSchema, uiSchema: optionUiSchema }))] }));
151
152
  }
152
153
  }
153
154
  export default AnyOfField;
154
- //# sourceMappingURL=MultiSchemaField.js.map
@@ -6,3 +6,4 @@ import { FieldProps, FormContextType, RJSFSchema, StrictRJSFSchema } from '@rjsf
6
6
  */
7
7
  declare function NullField<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>(props: FieldProps<T, S, F>): null;
8
8
  export default NullField;
9
+ //# sourceMappingURL=NullField.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NullField.d.ts","sourceRoot":"","sources":["../../../src/components/fields/NullField.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAExF;;;;GAIG;AACH,iBAAS,SAAS,CAAC,CAAC,GAAG,GAAG,EAAE,CAAC,SAAS,gBAAgB,GAAG,UAAU,EAAE,CAAC,SAAS,eAAe,GAAG,GAAG,EAClG,KAAK,EAAE,UAAU,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,QAU3B;AAED,eAAe,SAAS,CAAC"}
@@ -14,4 +14,3 @@ function NullField(props) {
14
14
  return null;
15
15
  }
16
16
  export default NullField;
17
- //# sourceMappingURL=NullField.js.map
@@ -18,3 +18,4 @@ import { FieldProps, FormContextType, RJSFSchema, StrictRJSFSchema } from '@rjsf
18
18
  */
19
19
  declare function NumberField<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>(props: FieldProps<T, S, F>): import("react/jsx-runtime").JSX.Element;
20
20
  export default NumberField;
21
+ //# sourceMappingURL=NumberField.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NumberField.d.ts","sourceRoot":"","sources":["../../../src/components/fields/NumberField.tsx"],"names":[],"mappings":"AACA,OAAO,EAAyB,UAAU,EAAE,eAAe,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAc/G;;;;;;;;;;;;;;;;GAgBG;AACH,iBAAS,WAAW,CAAC,CAAC,GAAG,GAAG,EAAE,CAAC,SAAS,gBAAgB,GAAG,UAAU,EAAE,CAAC,SAAS,eAAe,GAAG,GAAG,EACpG,KAAK,EAAE,UAAU,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,2CAkD3B;AAED,eAAe,WAAW,CAAC"}
@@ -37,7 +37,7 @@ function NumberField(props) {
37
37
  *
38
38
  * @param value - The current value for the change occurring
39
39
  */
40
- const handleChange = useCallback((value) => {
40
+ const handleChange = useCallback((value, errorSchema, id) => {
41
41
  // Cache the original value in component state
42
42
  setLastValue(value);
43
43
  // Normalize decimals that don't start with a zero character in advance so
@@ -51,7 +51,7 @@ function NumberField(props) {
51
51
  const processed = typeof value === 'string' && value.match(trailingCharMatcherWithPrefix)
52
52
  ? asNumber(value.replace(trailingCharMatcher, ''))
53
53
  : asNumber(value);
54
- onChange(processed);
54
+ onChange(processed, errorSchema, id);
55
55
  }, [onChange]);
56
56
  if (typeof lastValue === 'string' && typeof value === 'number') {
57
57
  // Construct a regular expression that checks for a string that consists
@@ -67,4 +67,3 @@ function NumberField(props) {
67
67
  return _jsx(StringField, { ...props, formData: value, onChange: handleChange });
68
68
  }
69
69
  export default NumberField;
70
- //# sourceMappingURL=NumberField.js.map
@@ -71,3 +71,4 @@ declare class ObjectField<T = any, S extends StrictRJSFSchema = RJSFSchema, F ex
71
71
  render(): import("react/jsx-runtime").JSX.Element;
72
72
  }
73
73
  export default ObjectField;
74
+ //# sourceMappingURL=ObjectField.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ObjectField.d.ts","sourceRoot":"","sources":["../../../src/components/fields/ObjectField.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAClC,OAAO,EAIL,WAAW,EACX,UAAU,EACV,eAAe,EAGf,UAAU,EACV,gBAAgB,EAOjB,MAAM,aAAa,CAAC;AAQrB,6DAA6D;AAC7D,KAAK,gBAAgB,GAAG;IACtB,sEAAsE;IACtE,sBAAsB,EAAE,OAAO,CAAC;IAChC,uCAAuC;IACvC,oBAAoB,EAAE,MAAM,CAAC;CAC9B,CAAC;AAEF;;;;GAIG;AACH,cAAM,WAAW,CAAC,CAAC,GAAG,GAAG,EAAE,CAAC,SAAS,gBAAgB,GAAG,UAAU,EAAE,CAAC,SAAS,eAAe,GAAG,GAAG,CAAE,SAAQ,SAAS,CACpH,UAAU,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EACnB,gBAAgB,CACjB;IACC,+BAA+B;IAC/B,KAAK;;;MAGH;IAEF;;;;OAIG;IACH,UAAU,CAAC,IAAI,EAAE,MAAM;IAKvB;;;;;;;OAOG;IACH,gBAAgB,GAAI,MAAM,MAAM,EAAE,qCAAmC,MAC3D,OAAO,CAAC,GAAG,SAAS,EAAE,iBAAiB,WAAW,CAAC,CAAC,CAAC,EAAE,KAAK,MAAM,UAuB1E;IAEF;;;;;OAKG;IACH,mBAAmB,GAAI,KAAK,MAAM,MACxB,OAAO,SAAS,UAOxB;IAEF;;;;;;OAMG;IACH,eAAe,GAAI,cAAc,MAAM,EAAE,WAAW,CAAC,YAUnD;IAEF;;;;;OAKG;IACH,WAAW,GAAI,UAAU,GAAG,MAClB,OAAO,GAAG,EAAE,gBAAgB,WAAW,CAAC,CAAC,CAAC,UA4BlD;IAEF;;;OAGG;IACH,eAAe,CAAC,IAAI,CAAC,EAAE,UAAU,CAAC,MAAM,CAAC;IAsBzC;;;;OAIG;IACH,cAAc,GAAI,QAAQ,CAAC,gBAqCzB;IAEF;OACG;IACH,MAAM;CAuGP;AAED,eAAe,WAAW,CAAC"}