@rjsf/core 5.11.2 → 5.12.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 (232) hide show
  1. package/dist/core.umd.js +3464 -0
  2. package/dist/index.esm.js +3814 -0
  3. package/dist/index.esm.js.map +7 -0
  4. package/dist/index.js +3714 -5
  5. package/dist/index.js.map +7 -0
  6. package/{dist/index.d.ts → lib/components/Form.d.ts} +321 -337
  7. package/lib/components/Form.js +474 -0
  8. package/lib/components/Form.js.map +1 -0
  9. package/lib/components/fields/ArrayField.d.ts +179 -0
  10. package/lib/components/fields/ArrayField.js +568 -0
  11. package/lib/components/fields/ArrayField.js.map +1 -0
  12. package/lib/components/fields/BooleanField.d.ts +9 -0
  13. package/lib/components/fields/BooleanField.js +62 -0
  14. package/lib/components/fields/BooleanField.js.map +1 -0
  15. package/lib/components/fields/MultiSchemaField.d.ts +47 -0
  16. package/lib/components/fields/MultiSchemaField.js +129 -0
  17. package/lib/components/fields/MultiSchemaField.js.map +1 -0
  18. package/lib/components/fields/NullField.d.ts +8 -0
  19. package/lib/components/fields/NullField.js +17 -0
  20. package/lib/components/fields/NullField.js.map +1 -0
  21. package/lib/components/fields/NumberField.d.ts +21 -0
  22. package/lib/components/fields/NumberField.js +70 -0
  23. package/lib/components/fields/NumberField.js.map +1 -0
  24. package/lib/components/fields/ObjectField.d.ts +73 -0
  25. package/lib/components/fields/ObjectField.js +222 -0
  26. package/lib/components/fields/ObjectField.js.map +1 -0
  27. package/lib/components/fields/SchemaField.d.ts +10 -0
  28. package/lib/components/fields/SchemaField.js +172 -0
  29. package/lib/components/fields/SchemaField.js.map +1 -0
  30. package/lib/components/fields/StringField.d.ts +8 -0
  31. package/lib/components/fields/StringField.js +25 -0
  32. package/lib/components/fields/StringField.js.map +1 -0
  33. package/lib/components/fields/index.d.ts +3 -0
  34. package/lib/components/fields/index.js +24 -0
  35. package/lib/components/fields/index.js.map +1 -0
  36. package/lib/components/templates/ArrayFieldDescriptionTemplate.d.ts +8 -0
  37. package/lib/components/templates/ArrayFieldDescriptionTemplate.js +18 -0
  38. package/lib/components/templates/ArrayFieldDescriptionTemplate.js.map +1 -0
  39. package/lib/components/templates/ArrayFieldItemTemplate.d.ts +7 -0
  40. package/lib/components/templates/ArrayFieldItemTemplate.js +20 -0
  41. package/lib/components/templates/ArrayFieldItemTemplate.js.map +1 -0
  42. package/lib/components/templates/ArrayFieldTemplate.d.ts +7 -0
  43. package/lib/components/templates/ArrayFieldTemplate.js +22 -0
  44. package/lib/components/templates/ArrayFieldTemplate.js.map +1 -0
  45. package/lib/components/templates/ArrayFieldTitleTemplate.d.ts +8 -0
  46. package/lib/components/templates/ArrayFieldTitleTemplate.js +18 -0
  47. package/lib/components/templates/ArrayFieldTitleTemplate.js.map +1 -0
  48. package/lib/components/templates/BaseInputTemplate.d.ts +9 -0
  49. package/lib/components/templates/BaseInputTemplate.js +39 -0
  50. package/lib/components/templates/BaseInputTemplate.js.map +1 -0
  51. package/lib/components/templates/ButtonTemplates/AddButton.d.ts +5 -0
  52. package/lib/components/templates/ButtonTemplates/AddButton.js +10 -0
  53. package/lib/components/templates/ButtonTemplates/AddButton.js.map +1 -0
  54. package/lib/components/templates/ButtonTemplates/IconButton.d.ts +7 -0
  55. package/lib/components/templates/ButtonTemplates/IconButton.js +24 -0
  56. package/lib/components/templates/ButtonTemplates/IconButton.js.map +1 -0
  57. package/lib/components/templates/ButtonTemplates/SubmitButton.d.ts +5 -0
  58. package/lib/components/templates/ButtonTemplates/SubmitButton.js +12 -0
  59. package/lib/components/templates/ButtonTemplates/SubmitButton.js.map +1 -0
  60. package/lib/components/templates/ButtonTemplates/index.d.ts +3 -0
  61. package/lib/components/templates/ButtonTemplates/index.js +15 -0
  62. package/lib/components/templates/ButtonTemplates/index.js.map +1 -0
  63. package/lib/components/templates/DescriptionField.d.ts +7 -0
  64. package/lib/components/templates/DescriptionField.js +18 -0
  65. package/lib/components/templates/DescriptionField.js.map +1 -0
  66. package/lib/components/templates/ErrorList.d.ts +7 -0
  67. package/lib/components/templates/ErrorList.js +13 -0
  68. package/lib/components/templates/ErrorList.js.map +1 -0
  69. package/lib/components/templates/FieldErrorTemplate.d.ts +7 -0
  70. package/lib/components/templates/FieldErrorTemplate.js +19 -0
  71. package/lib/components/templates/FieldErrorTemplate.js.map +1 -0
  72. package/lib/components/templates/FieldHelpTemplate.d.ts +7 -0
  73. package/lib/components/templates/FieldHelpTemplate.js +18 -0
  74. package/lib/components/templates/FieldHelpTemplate.js.map +1 -0
  75. package/lib/components/templates/FieldTemplate/FieldTemplate.d.ts +8 -0
  76. package/lib/components/templates/FieldTemplate/FieldTemplate.js +18 -0
  77. package/lib/components/templates/FieldTemplate/FieldTemplate.js.map +1 -0
  78. package/lib/components/templates/FieldTemplate/Label.d.ts +14 -0
  79. package/lib/components/templates/FieldTemplate/Label.js +14 -0
  80. package/lib/components/templates/FieldTemplate/Label.js.map +1 -0
  81. package/lib/components/templates/FieldTemplate/index.d.ts +2 -0
  82. package/lib/components/templates/FieldTemplate/index.js +3 -0
  83. package/lib/components/templates/FieldTemplate/index.js.map +1 -0
  84. package/lib/components/templates/ObjectFieldTemplate.d.ts +9 -0
  85. package/lib/components/templates/ObjectFieldTemplate.js +18 -0
  86. package/lib/components/templates/ObjectFieldTemplate.js.map +1 -0
  87. package/lib/components/templates/TitleField.d.ts +7 -0
  88. package/lib/components/templates/TitleField.js +11 -0
  89. package/lib/components/templates/TitleField.js.map +1 -0
  90. package/lib/components/templates/UnsupportedField.d.ts +9 -0
  91. package/lib/components/templates/UnsupportedField.js +28 -0
  92. package/lib/components/templates/UnsupportedField.js.map +1 -0
  93. package/lib/components/templates/WrapIfAdditionalTemplate.d.ts +8 -0
  94. package/lib/components/templates/WrapIfAdditionalTemplate.js +21 -0
  95. package/lib/components/templates/WrapIfAdditionalTemplate.js.map +1 -0
  96. package/lib/components/templates/index.d.ts +3 -0
  97. package/lib/components/templates/index.js +36 -0
  98. package/lib/components/templates/index.js.map +1 -0
  99. package/lib/components/widgets/AltDateTimeWidget.d.ts +9 -0
  100. package/lib/components/widgets/AltDateTimeWidget.js +14 -0
  101. package/lib/components/widgets/AltDateTimeWidget.js.map +1 -0
  102. package/lib/components/widgets/AltDateWidget.d.ts +7 -0
  103. package/lib/components/widgets/AltDateWidget.js +77 -0
  104. package/lib/components/widgets/AltDateWidget.js.map +1 -0
  105. package/lib/components/widgets/CheckboxWidget.d.ts +9 -0
  106. package/lib/components/widgets/CheckboxWidget.js +23 -0
  107. package/lib/components/widgets/CheckboxWidget.js.map +1 -0
  108. package/lib/components/widgets/CheckboxesWidget.d.ts +9 -0
  109. package/lib/components/widgets/CheckboxesWidget.js +31 -0
  110. package/lib/components/widgets/CheckboxesWidget.js.map +1 -0
  111. package/lib/components/widgets/ColorWidget.d.ts +8 -0
  112. package/lib/components/widgets/ColorWidget.js +13 -0
  113. package/lib/components/widgets/ColorWidget.js.map +1 -0
  114. package/lib/components/widgets/DateTimeWidget.d.ts +8 -0
  115. package/lib/components/widgets/DateTimeWidget.js +13 -0
  116. package/lib/components/widgets/DateTimeWidget.js.map +1 -0
  117. package/lib/components/widgets/DateWidget.d.ts +8 -0
  118. package/lib/components/widgets/DateWidget.js +15 -0
  119. package/lib/components/widgets/DateWidget.js.map +1 -0
  120. package/lib/components/widgets/EmailWidget.d.ts +7 -0
  121. package/lib/components/widgets/EmailWidget.js +12 -0
  122. package/lib/components/widgets/EmailWidget.js.map +1 -0
  123. package/lib/components/widgets/FileWidget.d.ts +8 -0
  124. package/lib/components/widgets/FileWidget.js +105 -0
  125. package/lib/components/widgets/FileWidget.js.map +1 -0
  126. package/lib/components/widgets/HiddenWidget.d.ts +9 -0
  127. package/lib/components/widgets/HiddenWidget.js +11 -0
  128. package/lib/components/widgets/HiddenWidget.js.map +1 -0
  129. package/lib/components/widgets/PasswordWidget.d.ts +7 -0
  130. package/lib/components/widgets/PasswordWidget.js +12 -0
  131. package/lib/components/widgets/PasswordWidget.js.map +1 -0
  132. package/lib/components/widgets/RadioWidget.d.ts +9 -0
  133. package/lib/components/widgets/RadioWidget.js +24 -0
  134. package/lib/components/widgets/RadioWidget.js.map +1 -0
  135. package/lib/components/widgets/RangeWidget.d.ts +8 -0
  136. package/lib/components/widgets/RangeWidget.js +11 -0
  137. package/lib/components/widgets/RangeWidget.js.map +1 -0
  138. package/lib/components/widgets/SelectWidget.d.ts +9 -0
  139. package/lib/components/widgets/SelectWidget.js +41 -0
  140. package/lib/components/widgets/SelectWidget.js.map +1 -0
  141. package/lib/components/widgets/TextWidget.d.ts +7 -0
  142. package/lib/components/widgets/TextWidget.js +12 -0
  143. package/lib/components/widgets/TextWidget.js.map +1 -0
  144. package/lib/components/widgets/TextareaWidget.d.ts +14 -0
  145. package/lib/components/widgets/TextareaWidget.js +19 -0
  146. package/lib/components/widgets/TextareaWidget.js.map +1 -0
  147. package/lib/components/widgets/TimeWidget.d.ts +8 -0
  148. package/lib/components/widgets/TimeWidget.js +15 -0
  149. package/lib/components/widgets/TimeWidget.js.map +1 -0
  150. package/lib/components/widgets/URLWidget.d.ts +7 -0
  151. package/lib/components/widgets/URLWidget.js +12 -0
  152. package/lib/components/widgets/URLWidget.js.map +1 -0
  153. package/lib/components/widgets/UpDownWidget.d.ts +7 -0
  154. package/lib/components/widgets/UpDownWidget.js +12 -0
  155. package/lib/components/widgets/UpDownWidget.js.map +1 -0
  156. package/lib/components/widgets/index.d.ts +3 -0
  157. package/lib/components/widgets/index.js +44 -0
  158. package/lib/components/widgets/index.js.map +1 -0
  159. package/lib/getDefaultRegistry.d.ts +6 -0
  160. package/lib/getDefaultRegistry.js +19 -0
  161. package/lib/getDefaultRegistry.js.map +1 -0
  162. package/lib/index.d.ts +6 -0
  163. package/lib/index.js +6 -0
  164. package/lib/index.js.map +1 -0
  165. package/lib/withTheme.d.ts +9 -0
  166. package/lib/withTheme.js +16 -0
  167. package/lib/withTheme.js.map +1 -0
  168. package/package.json +23 -16
  169. package/src/components/Form.tsx +853 -0
  170. package/src/components/fields/ArrayField.tsx +875 -0
  171. package/src/components/fields/BooleanField.tsx +114 -0
  172. package/src/components/fields/MultiSchemaField.tsx +221 -0
  173. package/src/components/fields/NullField.tsx +22 -0
  174. package/src/components/fields/NumberField.tsx +86 -0
  175. package/src/components/fields/ObjectField.tsx +331 -0
  176. package/src/components/fields/SchemaField.tsx +360 -0
  177. package/src/components/fields/StringField.tsx +71 -0
  178. package/src/components/fields/index.ts +31 -0
  179. package/src/components/templates/ArrayFieldDescriptionTemplate.tsx +41 -0
  180. package/src/components/templates/ArrayFieldItemTemplate.tsx +90 -0
  181. package/src/components/templates/ArrayFieldTemplate.tsx +88 -0
  182. package/src/components/templates/ArrayFieldTitleTemplate.tsx +43 -0
  183. package/src/components/templates/BaseInputTemplate.tsx +102 -0
  184. package/src/components/templates/ButtonTemplates/AddButton.tsx +29 -0
  185. package/src/components/templates/ButtonTemplates/IconButton.tsx +77 -0
  186. package/src/components/templates/ButtonTemplates/SubmitButton.tsx +21 -0
  187. package/src/components/templates/ButtonTemplates/index.ts +22 -0
  188. package/src/components/templates/DescriptionField.tsx +29 -0
  189. package/src/components/templates/ErrorList.tsx +35 -0
  190. package/src/components/templates/FieldErrorTemplate.tsx +33 -0
  191. package/src/components/templates/FieldHelpTemplate.tsx +29 -0
  192. package/src/components/templates/FieldTemplate/FieldTemplate.tsx +41 -0
  193. package/src/components/templates/FieldTemplate/Label.tsx +27 -0
  194. package/src/components/templates/FieldTemplate/index.ts +3 -0
  195. package/src/components/templates/ObjectFieldTemplate.tsx +83 -0
  196. package/src/components/templates/TitleField.tsx +19 -0
  197. package/src/components/templates/UnsupportedField.tsx +37 -0
  198. package/src/components/templates/WrapIfAdditionalTemplate.tsx +80 -0
  199. package/src/components/templates/index.ts +43 -0
  200. package/src/components/widgets/AltDateTimeWidget.tsx +16 -0
  201. package/src/components/widgets/AltDateWidget.tsx +198 -0
  202. package/src/components/widgets/CheckboxWidget.tsx +92 -0
  203. package/src/components/widgets/CheckboxesWidget.tsx +92 -0
  204. package/src/components/widgets/ColorWidget.tsx +14 -0
  205. package/src/components/widgets/DateTimeWidget.tsx +31 -0
  206. package/src/components/widgets/DateWidget.tsx +17 -0
  207. package/src/components/widgets/EmailWidget.tsx +13 -0
  208. package/src/components/widgets/FileWidget.tsx +178 -0
  209. package/src/components/widgets/HiddenWidget.tsx +15 -0
  210. package/src/components/widgets/PasswordWidget.tsx +15 -0
  211. package/src/components/widgets/RadioWidget.tsx +88 -0
  212. package/src/components/widgets/RangeWidget.tsx +23 -0
  213. package/src/components/widgets/SelectWidget.tsx +100 -0
  214. package/src/components/widgets/TextWidget.tsx +13 -0
  215. package/src/components/widgets/TextareaWidget.tsx +61 -0
  216. package/src/components/widgets/TimeWidget.tsx +17 -0
  217. package/src/components/widgets/URLWidget.tsx +13 -0
  218. package/src/components/widgets/UpDownWidget.tsx +13 -0
  219. package/src/components/widgets/index.ts +51 -0
  220. package/src/getDefaultRegistry.ts +24 -0
  221. package/src/index.ts +8 -0
  222. package/src/withTheme.tsx +42 -0
  223. package/dist/core.cjs.development.js +0 -4403
  224. package/dist/core.cjs.development.js.map +0 -1
  225. package/dist/core.cjs.production.min.js +0 -2
  226. package/dist/core.cjs.production.min.js.map +0 -1
  227. package/dist/core.esm.js +0 -4383
  228. package/dist/core.esm.js.map +0 -1
  229. package/dist/core.umd.development.js +0 -4393
  230. package/dist/core.umd.development.js.map +0 -1
  231. package/dist/core.umd.production.min.js +0 -2
  232. package/dist/core.umd.production.min.js.map +0 -1
@@ -0,0 +1,8 @@
1
+ /// <reference types="react" />
2
+ import { FormContextType, RJSFSchema, StrictRJSFSchema, WidgetProps } from '@rjsf/utils';
3
+ /** The `RangeWidget` component uses the `BaseInputTemplate` changing the type to `range` and wrapping the result
4
+ * in a div, with the value along side it.
5
+ *
6
+ * @param props - The `WidgetProps` for this component
7
+ */
8
+ export default function RangeWidget<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>(props: WidgetProps<T, S, F>): JSX.Element;
@@ -0,0 +1,11 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ /** The `RangeWidget` component uses the `BaseInputTemplate` changing the type to `range` and wrapping the result
3
+ * in a div, with the value along side it.
4
+ *
5
+ * @param props - The `WidgetProps` for this component
6
+ */
7
+ export default function RangeWidget(props) {
8
+ const { value, registry: { templates: { BaseInputTemplate }, }, } = props;
9
+ return (_jsxs("div", Object.assign({ className: 'field-range-wrapper' }, { children: [_jsx(BaseInputTemplate, Object.assign({ type: 'range' }, props)), _jsx("span", Object.assign({ className: 'range-view' }, { children: value }))] })));
10
+ }
11
+ //# sourceMappingURL=RangeWidget.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RangeWidget.js","sourceRoot":"","sources":["../../../src/components/widgets/RangeWidget.tsx"],"names":[],"mappings":";AAEA;;;;GAIG;AACH,MAAM,CAAC,OAAO,UAAU,WAAW,CACjC,KAA2B;IAE3B,MAAM,EACJ,KAAK,EACL,QAAQ,EAAE,EACR,SAAS,EAAE,EAAE,iBAAiB,EAAE,GACjC,GACF,GAAG,KAAK,CAAC;IACV,OAAO,CACL,6BAAK,SAAS,EAAC,qBAAqB,iBAClC,KAAC,iBAAiB,kBAAC,IAAI,EAAC,OAAO,IAAK,KAAK,EAAI,EAC7C,6BAAM,SAAS,EAAC,YAAY,gBAAE,KAAK,IAAQ,KACvC,CACP,CAAC;AACJ,CAAC"}
@@ -0,0 +1,9 @@
1
+ /// <reference types="react" />
2
+ import { FormContextType, RJSFSchema, StrictRJSFSchema, WidgetProps } from '@rjsf/utils';
3
+ /** The `SelectWidget` is a widget for rendering dropdowns.
4
+ * It is typically used with string properties constrained with enum options.
5
+ *
6
+ * @param props - The `WidgetProps` for this component
7
+ */
8
+ declare function SelectWidget<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>({ schema, id, options, value, required, disabled, readonly, multiple, autofocus, onChange, onBlur, onFocus, placeholder, }: WidgetProps<T, S, F>): JSX.Element;
9
+ export default SelectWidget;
@@ -0,0 +1,41 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useCallback } from 'react';
3
+ import { ariaDescribedByIds, enumOptionsIndexForValue, enumOptionsValueForIndex, } from '@rjsf/utils';
4
+ function getValue(event, multiple) {
5
+ if (multiple) {
6
+ return Array.from(event.target.options)
7
+ .slice()
8
+ .filter((o) => o.selected)
9
+ .map((o) => o.value);
10
+ }
11
+ return event.target.value;
12
+ }
13
+ /** The `SelectWidget` is a widget for rendering dropdowns.
14
+ * It is typically used with string properties constrained with enum options.
15
+ *
16
+ * @param props - The `WidgetProps` for this component
17
+ */
18
+ function SelectWidget({ schema, id, options, value, required, disabled, readonly, multiple = false, autofocus = false, onChange, onBlur, onFocus, placeholder, }) {
19
+ const { enumOptions, enumDisabled, emptyValue: optEmptyVal } = options;
20
+ const emptyValue = multiple ? [] : '';
21
+ const handleFocus = useCallback((event) => {
22
+ const newValue = getValue(event, multiple);
23
+ return onFocus(id, enumOptionsValueForIndex(newValue, enumOptions, optEmptyVal));
24
+ }, [onFocus, id, schema, multiple, options]);
25
+ const handleBlur = useCallback((event) => {
26
+ const newValue = getValue(event, multiple);
27
+ return onBlur(id, enumOptionsValueForIndex(newValue, enumOptions, optEmptyVal));
28
+ }, [onBlur, id, schema, multiple, options]);
29
+ const handleChange = useCallback((event) => {
30
+ const newValue = getValue(event, multiple);
31
+ return onChange(enumOptionsValueForIndex(newValue, enumOptions, optEmptyVal));
32
+ }, [onChange, schema, multiple, options]);
33
+ const selectedIndexes = enumOptionsIndexForValue(value, enumOptions, multiple);
34
+ return (_jsxs("select", Object.assign({ id: id, name: id, multiple: multiple, className: 'form-control', value: typeof selectedIndexes === 'undefined' ? emptyValue : selectedIndexes, required: required, disabled: disabled || readonly, autoFocus: autofocus, onBlur: handleBlur, onFocus: handleFocus, onChange: handleChange, "aria-describedby": ariaDescribedByIds(id) }, { children: [!multiple && schema.default === undefined && _jsx("option", Object.assign({ value: '' }, { children: placeholder })), Array.isArray(enumOptions) &&
35
+ enumOptions.map(({ value, label }, i) => {
36
+ const disabled = enumDisabled && enumDisabled.indexOf(value) !== -1;
37
+ return (_jsx("option", Object.assign({ value: String(i), disabled: disabled }, { children: label }), i));
38
+ })] })));
39
+ }
40
+ export default SelectWidget;
41
+ //# sourceMappingURL=SelectWidget.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SelectWidget.js","sourceRoot":"","sources":["../../../src/components/widgets/SelectWidget.tsx"],"names":[],"mappings":"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"}
@@ -0,0 +1,7 @@
1
+ /// <reference types="react" />
2
+ import { FormContextType, RJSFSchema, StrictRJSFSchema, WidgetProps } from '@rjsf/utils';
3
+ /** The `TextWidget` component uses the `BaseInputTemplate`.
4
+ *
5
+ * @param props - The `WidgetProps` for this component
6
+ */
7
+ export default function TextWidget<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>(props: WidgetProps<T, S, F>): JSX.Element;
@@ -0,0 +1,12 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { getTemplate } from '@rjsf/utils';
3
+ /** The `TextWidget` component uses the `BaseInputTemplate`.
4
+ *
5
+ * @param props - The `WidgetProps` for this component
6
+ */
7
+ export default function TextWidget(props) {
8
+ const { options, registry } = props;
9
+ const BaseInputTemplate = getTemplate('BaseInputTemplate', registry, options);
10
+ return _jsx(BaseInputTemplate, Object.assign({}, props));
11
+ }
12
+ //# sourceMappingURL=TextWidget.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TextWidget.js","sourceRoot":"","sources":["../../../src/components/widgets/TextWidget.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,WAAW,EAA8D,MAAM,aAAa,CAAC;AAEtG;;;GAGG;AACH,MAAM,CAAC,OAAO,UAAU,UAAU,CAChC,KAA2B;IAE3B,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,GAAG,KAAK,CAAC;IACpC,MAAM,iBAAiB,GAAG,WAAW,CAA+B,mBAAmB,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAC;IAC5G,OAAO,KAAC,iBAAiB,oBAAK,KAAK,EAAI,CAAC;AAC1C,CAAC"}
@@ -0,0 +1,14 @@
1
+ /// <reference types="react" />
2
+ import { FormContextType, RJSFSchema, StrictRJSFSchema, WidgetProps } from '@rjsf/utils';
3
+ /** The `TextareaWidget` is a widget for rendering input fields as textarea.
4
+ *
5
+ * @param props - The `WidgetProps` for this component
6
+ */
7
+ declare function TextareaWidget<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>({ id, options, placeholder, value, required, disabled, readonly, autofocus, onChange, onBlur, onFocus, }: WidgetProps<T, S, F>): JSX.Element;
8
+ declare namespace TextareaWidget {
9
+ var defaultProps: {
10
+ autofocus: boolean;
11
+ options: {};
12
+ };
13
+ }
14
+ export default TextareaWidget;
@@ -0,0 +1,19 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { useCallback } from 'react';
3
+ import { ariaDescribedByIds } from '@rjsf/utils';
4
+ /** The `TextareaWidget` is a widget for rendering input fields as textarea.
5
+ *
6
+ * @param props - The `WidgetProps` for this component
7
+ */
8
+ function TextareaWidget({ id, options = {}, placeholder, value, required, disabled, readonly, autofocus = false, onChange, onBlur, onFocus, }) {
9
+ const handleChange = useCallback(({ target: { value } }) => onChange(value === '' ? options.emptyValue : value), [onChange, options.emptyValue]);
10
+ const handleBlur = useCallback(({ target: { value } }) => onBlur(id, value), [onBlur, id]);
11
+ const handleFocus = useCallback(({ target: { value } }) => onFocus(id, value), [id, onFocus]);
12
+ return (_jsx("textarea", { id: id, name: id, className: 'form-control', value: value ? value : '', placeholder: placeholder, required: required, disabled: disabled, readOnly: readonly, autoFocus: autofocus, rows: options.rows, onBlur: handleBlur, onFocus: handleFocus, onChange: handleChange, "aria-describedby": ariaDescribedByIds(id) }));
13
+ }
14
+ TextareaWidget.defaultProps = {
15
+ autofocus: false,
16
+ options: {},
17
+ };
18
+ export default TextareaWidget;
19
+ //# sourceMappingURL=TextareaWidget.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TextareaWidget.js","sourceRoot":"","sources":["../../../src/components/widgets/TextareaWidget.tsx"],"names":[],"mappings":";AAAA,OAAO,EAA2B,WAAW,EAAE,MAAM,OAAO,CAAC;AAC7D,OAAO,EAAE,kBAAkB,EAA8D,MAAM,aAAa,CAAC;AAE7G;;;GAGG;AACH,SAAS,cAAc,CAAoF,EACzG,EAAE,EACF,OAAO,GAAG,EAAE,EACZ,WAAW,EACX,KAAK,EACL,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,SAAS,GAAG,KAAK,EACjB,QAAQ,EACR,MAAM,EACN,OAAO,GACc;IACrB,MAAM,YAAY,GAAG,WAAW,CAC9B,CAAC,EAAE,MAAM,EAAE,EAAE,KAAK,EAAE,EAAoC,EAAE,EAAE,CAAC,QAAQ,CAAC,KAAK,KAAK,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC,KAAK,CAAC,EAChH,CAAC,QAAQ,EAAE,OAAO,CAAC,UAAU,CAAC,CAC/B,CAAC;IAEF,MAAM,UAAU,GAAG,WAAW,CAC5B,CAAC,EAAE,MAAM,EAAE,EAAE,KAAK,EAAE,EAAmC,EAAE,EAAE,CAAC,MAAM,CAAC,EAAE,EAAE,KAAK,CAAC,EAC7E,CAAC,MAAM,EAAE,EAAE,CAAC,CACb,CAAC;IAEF,MAAM,WAAW,GAAG,WAAW,CAC7B,CAAC,EAAE,MAAM,EAAE,EAAE,KAAK,EAAE,EAAmC,EAAE,EAAE,CAAC,OAAO,CAAC,EAAE,EAAE,KAAK,CAAC,EAC9E,CAAC,EAAE,EAAE,OAAO,CAAC,CACd,CAAC;IAEF,OAAO,CACL,mBACE,EAAE,EAAE,EAAE,EACN,IAAI,EAAE,EAAE,EACR,SAAS,EAAC,cAAc,EACxB,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EACzB,WAAW,EAAE,WAAW,EACxB,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,QAAQ,EAClB,SAAS,EAAE,SAAS,EACpB,IAAI,EAAE,OAAO,CAAC,IAAI,EAClB,MAAM,EAAE,UAAU,EAClB,OAAO,EAAE,WAAW,EACpB,QAAQ,EAAE,YAAY,sBACJ,kBAAkB,CAAI,EAAE,CAAC,GAC3C,CACH,CAAC;AACJ,CAAC;AAED,cAAc,CAAC,YAAY,GAAG;IAC5B,SAAS,EAAE,KAAK;IAChB,OAAO,EAAE,EAAE;CACZ,CAAC;AAEF,eAAe,cAAc,CAAC"}
@@ -0,0 +1,8 @@
1
+ /// <reference types="react" />
2
+ import { FormContextType, RJSFSchema, StrictRJSFSchema, WidgetProps } from '@rjsf/utils';
3
+ /** The `TimeWidget` component uses the `BaseInputTemplate` changing the type to `time` and transforms
4
+ * the value to undefined when it is falsy during the `onChange` handling.
5
+ *
6
+ * @param props - The `WidgetProps` for this component
7
+ */
8
+ export default function TimeWidget<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>(props: WidgetProps<T, S, F>): JSX.Element;
@@ -0,0 +1,15 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { useCallback } from 'react';
3
+ import { getTemplate } from '@rjsf/utils';
4
+ /** The `TimeWidget` component uses the `BaseInputTemplate` changing the type to `time` and transforms
5
+ * the value to undefined when it is falsy during the `onChange` handling.
6
+ *
7
+ * @param props - The `WidgetProps` for this component
8
+ */
9
+ export default function TimeWidget(props) {
10
+ const { onChange, options, registry } = props;
11
+ const BaseInputTemplate = getTemplate('BaseInputTemplate', registry, options);
12
+ const handleChange = useCallback((value) => onChange(value ? `${value}:00` : undefined), [onChange]);
13
+ return _jsx(BaseInputTemplate, Object.assign({ type: 'time' }, props, { onChange: handleChange }));
14
+ }
15
+ //# sourceMappingURL=TimeWidget.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TimeWidget.js","sourceRoot":"","sources":["../../../src/components/widgets/TimeWidget.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AACpC,OAAO,EAAE,WAAW,EAA8D,MAAM,aAAa,CAAC;AAEtG;;;;GAIG;AACH,MAAM,CAAC,OAAO,UAAU,UAAU,CAChC,KAA2B;IAE3B,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,QAAQ,EAAE,GAAG,KAAK,CAAC;IAC9C,MAAM,iBAAiB,GAAG,WAAW,CAA+B,mBAAmB,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAC;IAC5G,MAAM,YAAY,GAAG,WAAW,CAAC,CAAC,KAAU,EAAE,EAAE,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,KAAK,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC;IAE1G,OAAO,KAAC,iBAAiB,kBAAC,IAAI,EAAC,MAAM,IAAK,KAAK,IAAE,QAAQ,EAAE,YAAY,IAAI,CAAC;AAC9E,CAAC"}
@@ -0,0 +1,7 @@
1
+ /// <reference types="react" />
2
+ import { FormContextType, RJSFSchema, StrictRJSFSchema, WidgetProps } from '@rjsf/utils';
3
+ /** The `URLWidget` component uses the `BaseInputTemplate` changing the type to `url`.
4
+ *
5
+ * @param props - The `WidgetProps` for this component
6
+ */
7
+ export default function URLWidget<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>(props: WidgetProps<T, S, F>): JSX.Element;
@@ -0,0 +1,12 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { getTemplate } from '@rjsf/utils';
3
+ /** The `URLWidget` component uses the `BaseInputTemplate` changing the type to `url`.
4
+ *
5
+ * @param props - The `WidgetProps` for this component
6
+ */
7
+ export default function URLWidget(props) {
8
+ const { options, registry } = props;
9
+ const BaseInputTemplate = getTemplate('BaseInputTemplate', registry, options);
10
+ return _jsx(BaseInputTemplate, Object.assign({ type: 'url' }, props));
11
+ }
12
+ //# sourceMappingURL=URLWidget.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"URLWidget.js","sourceRoot":"","sources":["../../../src/components/widgets/URLWidget.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,WAAW,EAA8D,MAAM,aAAa,CAAC;AAEtG;;;GAGG;AACH,MAAM,CAAC,OAAO,UAAU,SAAS,CAC/B,KAA2B;IAE3B,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,GAAG,KAAK,CAAC;IACpC,MAAM,iBAAiB,GAAG,WAAW,CAA+B,mBAAmB,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAC;IAC5G,OAAO,KAAC,iBAAiB,kBAAC,IAAI,EAAC,KAAK,IAAK,KAAK,EAAI,CAAC;AACrD,CAAC"}
@@ -0,0 +1,7 @@
1
+ /// <reference types="react" />
2
+ import { FormContextType, RJSFSchema, StrictRJSFSchema, WidgetProps } from '@rjsf/utils';
3
+ /** The `UpDownWidget` component uses the `BaseInputTemplate` changing the type to `number`.
4
+ *
5
+ * @param props - The `WidgetProps` for this component
6
+ */
7
+ export default function UpDownWidget<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>(props: WidgetProps<T, S, F>): JSX.Element;
@@ -0,0 +1,12 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { getTemplate } from '@rjsf/utils';
3
+ /** The `UpDownWidget` component uses the `BaseInputTemplate` changing the type to `number`.
4
+ *
5
+ * @param props - The `WidgetProps` for this component
6
+ */
7
+ export default function UpDownWidget(props) {
8
+ const { options, registry } = props;
9
+ const BaseInputTemplate = getTemplate('BaseInputTemplate', registry, options);
10
+ return _jsx(BaseInputTemplate, Object.assign({ type: 'number' }, props));
11
+ }
12
+ //# sourceMappingURL=UpDownWidget.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"UpDownWidget.js","sourceRoot":"","sources":["../../../src/components/widgets/UpDownWidget.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,WAAW,EAA8D,MAAM,aAAa,CAAC;AAEtG;;;GAGG;AACH,MAAM,CAAC,OAAO,UAAU,YAAY,CAClC,KAA2B;IAE3B,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,GAAG,KAAK,CAAC;IACpC,MAAM,iBAAiB,GAAG,WAAW,CAA+B,mBAAmB,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAC;IAC5G,OAAO,KAAC,iBAAiB,kBAAC,IAAI,EAAC,QAAQ,IAAK,KAAK,EAAI,CAAC;AACxD,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { FormContextType, RegistryWidgetsType, RJSFSchema, StrictRJSFSchema } from '@rjsf/utils';
2
+ declare function widgets<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>(): RegistryWidgetsType<T, S, F>;
3
+ export default widgets;
@@ -0,0 +1,44 @@
1
+ import AltDateWidget from './AltDateWidget';
2
+ import AltDateTimeWidget from './AltDateTimeWidget';
3
+ import CheckboxWidget from './CheckboxWidget';
4
+ import CheckboxesWidget from './CheckboxesWidget';
5
+ import ColorWidget from './ColorWidget';
6
+ import DateWidget from './DateWidget';
7
+ import DateTimeWidget from './DateTimeWidget';
8
+ import EmailWidget from './EmailWidget';
9
+ import FileWidget from './FileWidget';
10
+ import HiddenWidget from './HiddenWidget';
11
+ import PasswordWidget from './PasswordWidget';
12
+ import RadioWidget from './RadioWidget';
13
+ import RangeWidget from './RangeWidget';
14
+ import SelectWidget from './SelectWidget';
15
+ import TextareaWidget from './TextareaWidget';
16
+ import TextWidget from './TextWidget';
17
+ import TimeWidget from './TimeWidget';
18
+ import URLWidget from './URLWidget';
19
+ import UpDownWidget from './UpDownWidget';
20
+ function widgets() {
21
+ return {
22
+ AltDateWidget,
23
+ AltDateTimeWidget,
24
+ CheckboxWidget,
25
+ CheckboxesWidget,
26
+ ColorWidget,
27
+ DateWidget,
28
+ DateTimeWidget,
29
+ EmailWidget,
30
+ FileWidget,
31
+ HiddenWidget,
32
+ PasswordWidget,
33
+ RadioWidget,
34
+ RangeWidget,
35
+ SelectWidget,
36
+ TextWidget,
37
+ TextareaWidget,
38
+ TimeWidget,
39
+ UpDownWidget,
40
+ URLWidget,
41
+ };
42
+ }
43
+ export default widgets;
44
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/widgets/index.ts"],"names":[],"mappings":"AAEA,OAAO,aAAa,MAAM,iBAAiB,CAAC;AAC5C,OAAO,iBAAiB,MAAM,qBAAqB,CAAC;AACpD,OAAO,cAAc,MAAM,kBAAkB,CAAC;AAC9C,OAAO,gBAAgB,MAAM,oBAAoB,CAAC;AAClD,OAAO,WAAW,MAAM,eAAe,CAAC;AACxC,OAAO,UAAU,MAAM,cAAc,CAAC;AACtC,OAAO,cAAc,MAAM,kBAAkB,CAAC;AAC9C,OAAO,WAAW,MAAM,eAAe,CAAC;AACxC,OAAO,UAAU,MAAM,cAAc,CAAC;AACtC,OAAO,YAAY,MAAM,gBAAgB,CAAC;AAC1C,OAAO,cAAc,MAAM,kBAAkB,CAAC;AAC9C,OAAO,WAAW,MAAM,eAAe,CAAC;AACxC,OAAO,WAAW,MAAM,eAAe,CAAC;AACxC,OAAO,YAAY,MAAM,gBAAgB,CAAC;AAC1C,OAAO,cAAc,MAAM,kBAAkB,CAAC;AAC9C,OAAO,UAAU,MAAM,cAAc,CAAC;AACtC,OAAO,UAAU,MAAM,cAAc,CAAC;AACtC,OAAO,SAAS,MAAM,aAAa,CAAC;AACpC,OAAO,YAAY,MAAM,gBAAgB,CAAC;AAE1C,SAAS,OAAO;IAKd,OAAO;QACL,aAAa;QACb,iBAAiB;QACjB,cAAc;QACd,gBAAgB;QAChB,WAAW;QACX,UAAU;QACV,cAAc;QACd,WAAW;QACX,UAAU;QACV,YAAY;QACZ,cAAc;QACd,WAAW;QACX,WAAW;QACX,YAAY;QACZ,UAAU;QACV,cAAc;QACd,UAAU;QACV,YAAY;QACZ,SAAS;KACV,CAAC;AACJ,CAAC;AAED,eAAe,OAAO,CAAC"}
@@ -0,0 +1,6 @@
1
+ import { FormContextType, Registry, RJSFSchema, StrictRJSFSchema } from '@rjsf/utils';
2
+ /** The default registry consists of all the fields, templates and widgets provided in the core implementation,
3
+ * plus an empty `rootSchema` and `formContext. We omit schemaUtils here because it cannot be defaulted without a
4
+ * rootSchema and validator. It will be added into the computed registry later in the Form.
5
+ */
6
+ export default function getDefaultRegistry<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>(): Omit<Registry<T, S, F>, 'schemaUtils'>;
@@ -0,0 +1,19 @@
1
+ import { englishStringTranslator } from '@rjsf/utils';
2
+ import fields from './components/fields';
3
+ import templates from './components/templates';
4
+ import widgets from './components/widgets';
5
+ /** The default registry consists of all the fields, templates and widgets provided in the core implementation,
6
+ * plus an empty `rootSchema` and `formContext. We omit schemaUtils here because it cannot be defaulted without a
7
+ * rootSchema and validator. It will be added into the computed registry later in the Form.
8
+ */
9
+ export default function getDefaultRegistry() {
10
+ return {
11
+ fields: fields(),
12
+ templates: templates(),
13
+ widgets: widgets(),
14
+ rootSchema: {},
15
+ formContext: {},
16
+ translateString: englishStringTranslator,
17
+ };
18
+ }
19
+ //# sourceMappingURL=getDefaultRegistry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getDefaultRegistry.js","sourceRoot":"","sources":["../src/getDefaultRegistry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAA2D,MAAM,aAAa,CAAC;AAE/G,OAAO,MAAM,MAAM,qBAAqB,CAAC;AACzC,OAAO,SAAS,MAAM,wBAAwB,CAAC;AAC/C,OAAO,OAAO,MAAM,sBAAsB,CAAC;AAE3C;;;GAGG;AACH,MAAM,CAAC,OAAO,UAAU,kBAAkB;IAKxC,OAAO;QACL,MAAM,EAAE,MAAM,EAAW;QACzB,SAAS,EAAE,SAAS,EAAW;QAC/B,OAAO,EAAE,OAAO,EAAW;QAC3B,UAAU,EAAE,EAAO;QACnB,WAAW,EAAE,EAAO;QACpB,eAAe,EAAE,uBAAuB;KACzC,CAAC;AACJ,CAAC"}
package/lib/index.d.ts ADDED
@@ -0,0 +1,6 @@
1
+ import Form, { FormProps, FormState, IChangeEvent } from './components/Form';
2
+ import withTheme, { ThemeProps } from './withTheme';
3
+ import getDefaultRegistry from './getDefaultRegistry';
4
+ export type { FormProps, FormState, IChangeEvent, ThemeProps };
5
+ export { withTheme, getDefaultRegistry };
6
+ export default Form;
package/lib/index.js ADDED
@@ -0,0 +1,6 @@
1
+ import Form from './components/Form';
2
+ import withTheme from './withTheme';
3
+ import getDefaultRegistry from './getDefaultRegistry';
4
+ export { withTheme, getDefaultRegistry };
5
+ export default Form;
6
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,IAA4C,MAAM,mBAAmB,CAAC;AAC7E,OAAO,SAAyB,MAAM,aAAa,CAAC;AACpD,OAAO,kBAAkB,MAAM,sBAAsB,CAAC;AAItD,OAAO,EAAE,SAAS,EAAE,kBAAkB,EAAE,CAAC;AACzC,eAAe,IAAI,CAAC"}
@@ -0,0 +1,9 @@
1
+ import { ComponentType } from 'react';
2
+ import { FormProps } from './components/Form';
3
+ import { FormContextType, RJSFSchema, StrictRJSFSchema } from '@rjsf/utils';
4
+ /** The properties for the `withTheme` function, essentially a subset of properties from the `FormProps` that can be
5
+ * overridden while creating a theme
6
+ */
7
+ export type ThemeProps<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any> = Pick<FormProps<T, S, F>, 'fields' | 'templates' | 'widgets' | '_internalFormWrapper'>;
8
+ /** A Higher-Order component that creates a wrapper around a `Form` with the overrides from the `WithThemeProps` */
9
+ export default function withTheme<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>(themeProps: ThemeProps<T, S, F>): ComponentType<FormProps<T, S, F>>;
@@ -0,0 +1,16 @@
1
+ import { __rest } from "tslib";
2
+ import { jsx as _jsx } from "react/jsx-runtime";
3
+ import { forwardRef } from 'react';
4
+ import Form from './components/Form';
5
+ /** A Higher-Order component that creates a wrapper around a `Form` with the overrides from the `WithThemeProps` */
6
+ export default function withTheme(themeProps) {
7
+ return forwardRef((_a, ref) => {
8
+ var _b;
9
+ var { fields, widgets, templates } = _a, directProps = __rest(_a, ["fields", "widgets", "templates"]);
10
+ fields = Object.assign(Object.assign({}, themeProps === null || themeProps === void 0 ? void 0 : themeProps.fields), fields);
11
+ widgets = Object.assign(Object.assign({}, themeProps === null || themeProps === void 0 ? void 0 : themeProps.widgets), widgets);
12
+ templates = Object.assign(Object.assign(Object.assign({}, themeProps === null || themeProps === void 0 ? void 0 : themeProps.templates), templates), { ButtonTemplates: Object.assign(Object.assign({}, (_b = themeProps === null || themeProps === void 0 ? void 0 : themeProps.templates) === null || _b === void 0 ? void 0 : _b.ButtonTemplates), templates === null || templates === void 0 ? void 0 : templates.ButtonTemplates) });
13
+ return (_jsx(Form, Object.assign({}, themeProps, directProps, { fields: fields, widgets: widgets, templates: templates, ref: ref })));
14
+ });
15
+ }
16
+ //# sourceMappingURL=withTheme.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"withTheme.js","sourceRoot":"","sources":["../src/withTheme.tsx"],"names":[],"mappings":";;AAAA,OAAO,EAA+B,UAAU,EAAE,MAAM,OAAO,CAAC;AAChE,OAAO,IAAmB,MAAM,mBAAmB,CAAC;AAWpD,mHAAmH;AACnH,MAAM,CAAC,OAAO,UAAU,SAAS,CAC/B,UAA+B;IAE/B,OAAO,UAAU,CACf,CAAC,EAAkE,EAAE,GAAgC,EAAE,EAAE;;YAAxG,EAAE,MAAM,EAAE,OAAO,EAAE,SAAS,OAAsC,EAAjC,WAAW,cAA5C,kCAA8C,CAAF;QAC3C,MAAM,mCAAQ,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,MAAM,GAAK,MAAM,CAAE,CAAC;QAC9C,OAAO,mCAAQ,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,OAAO,GAAK,OAAO,CAAE,CAAC;QACjD,SAAS,iDACJ,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,SAAS,GACrB,SAAS,KACZ,eAAe,kCACV,MAAA,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,SAAS,0CAAE,eAAe,GACtC,SAAS,aAAT,SAAS,uBAAT,SAAS,CAAE,eAAe,IAEhC,CAAC;QAEF,OAAO,CACL,KAAC,IAAI,oBACC,UAAU,EACV,WAAW,IACf,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,OAAO,EAChB,SAAS,EAAE,SAAS,EACpB,GAAG,EAAE,GAAG,IACR,CACH,CAAC;IACJ,CAAC,CACF,CAAC;AACJ,CAAC"}
package/package.json CHANGED
@@ -1,9 +1,13 @@
1
1
  {
2
2
  "name": "@rjsf/core",
3
- "version": "5.11.2",
3
+ "version": "5.12.0",
4
4
  "description": "A simple React component capable of building HTML forms out of a JSON schema.",
5
5
  "scripts": {
6
- "build": "rimraf dist && dts build --rollupTypes --format cjs,esm,umd",
6
+ "build:ts": "rimraf lib && tsc",
7
+ "build:cjs": "esbuild ./src/index.ts --bundle --outfile=dist/index.js --sourcemap --packages=external --format=cjs",
8
+ "build:esm": "esbuild ./src/index.ts --bundle --outfile=dist/index.esm.js --sourcemap --packages=external --format=esm",
9
+ "build:umd": "rollup dist/index.esm.js --format=umd --file=dist/core.umd.js --name=JSONSchemaForm",
10
+ "build": "rimraf dist && npm run build:ts && npm run build:cjs && npm run build:esm && npm run build:umd",
7
11
  "cs-check": "prettier -l \"{src,test,testSnap}/**/*.[jt]s?(x)\"",
8
12
  "cs-format": "prettier \"{src,test,testSnap}/**/*.[jt]s?(x)\" --write",
9
13
  "lint": "eslint src test",
@@ -22,11 +26,12 @@
22
26
  ]
23
27
  },
24
28
  "main": "dist/index.js",
25
- "module": "dist/core.esm.js",
26
- "typings": "dist/index.d.ts",
29
+ "module": "lib/index.js",
30
+ "typings": "lib/index.d.ts",
27
31
  "files": [
28
32
  "dist",
29
- "lib"
33
+ "lib",
34
+ "src"
30
35
  ],
31
36
  "engineStrict": false,
32
37
  "engines": {
@@ -39,7 +44,7 @@
39
44
  "dependencies": {
40
45
  "lodash": "^4.17.21",
41
46
  "lodash-es": "^4.17.21",
42
- "markdown-to-jsx": "^7.2.1",
47
+ "markdown-to-jsx": "^7.3.2",
43
48
  "nanoid": "^3.3.6",
44
49
  "prop-types": "^15.8.1"
45
50
  },
@@ -50,21 +55,21 @@
50
55
  "@babel/preset-env": "^7.22.9",
51
56
  "@babel/preset-react": "^7.22.5",
52
57
  "@babel/preset-typescript": "^7.22.5",
53
- "@rjsf/utils": "^5.11.2",
54
- "@rjsf/validator-ajv6": "^5.11.2",
55
- "@rjsf/validator-ajv8": "^5.11.2",
56
- "@types/lodash": "^4.14.195",
58
+ "@rjsf/utils": "^5.12.0",
59
+ "@rjsf/validator-ajv6": "^5.12.0",
60
+ "@rjsf/validator-ajv8": "^5.12.0",
61
+ "@types/lodash": "^4.14.196",
57
62
  "@types/react": "^17.0.62",
58
63
  "@types/react-dom": "^17.0.20",
59
64
  "@types/react-test-renderer": "^17.0.2",
60
65
  "ajv": "^8.12.0",
61
66
  "atob": "^2.1.2",
62
- "babel-jest": "^29.6.1",
67
+ "babel-jest": "^29.6.2",
63
68
  "chai": "^3.5.0",
64
- "dts-cli": "^1.6.3",
65
- "eslint": "^8.44.0",
69
+ "esbuild": "^0.18.19",
70
+ "eslint": "^8.46.0",
66
71
  "html": "^1.0.0",
67
- "jest": "^29.6.1",
72
+ "jest": "^29.6.2",
68
73
  "jest-environment-jsdom": "^29.6.1",
69
74
  "jsdom": "^20.0.3",
70
75
  "mocha": "^10.2.0",
@@ -73,7 +78,9 @@
73
78
  "react-portal": "^4.2.2",
74
79
  "react-test-renderer": "^17.0.2",
75
80
  "rimraf": "^5.0.1",
76
- "sinon": "^9.2.4"
81
+ "rollup": "^3.27.2",
82
+ "sinon": "^9.2.4",
83
+ "typescript": "^4.9.5"
77
84
  },
78
85
  "directories": {
79
86
  "test": "test"
@@ -96,5 +103,5 @@
96
103
  "publishConfig": {
97
104
  "access": "public"
98
105
  },
99
- "gitHead": "2fafced84e18aa2cd487715d11d2730cd23333f3"
106
+ "gitHead": "bab797c43a34e5ec68a84b2bdabb3c377e46b092"
100
107
  }