@rjsf/core 4.2.0 → 4.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (180) hide show
  1. package/dist/components/AddButton.d.ts +5 -0
  2. package/dist/components/ErrorList.d.ts +1 -0
  3. package/dist/components/Form.d.ts +48 -0
  4. package/dist/components/IconButton.d.ts +1 -0
  5. package/dist/components/fields/ArrayField.d.ts +51 -0
  6. package/dist/components/fields/BooleanField.d.ts +45 -0
  7. package/dist/components/fields/DescriptionField.d.ts +9 -0
  8. package/dist/components/fields/MultiSchemaField.d.ts +40 -0
  9. package/dist/components/fields/NullField.d.ts +6 -0
  10. package/dist/components/fields/NumberField.d.ts +63 -0
  11. package/dist/components/fields/ObjectField.d.ts +22 -0
  12. package/dist/components/fields/SchemaField.d.ts +39 -0
  13. package/dist/components/fields/StringField.d.ts +45 -0
  14. package/dist/components/fields/TitleField.d.ts +10 -0
  15. package/dist/components/fields/UnsupportedField.d.ts +14 -0
  16. package/dist/components/fields/index.d.ts +26 -0
  17. package/dist/components/widgets/AltDateTimeWidget.d.ts +22 -0
  18. package/dist/components/widgets/AltDateWidget.d.ts +22 -0
  19. package/dist/components/widgets/BaseInput.d.ts +23 -0
  20. package/dist/components/widgets/CheckboxWidget.d.ts +18 -0
  21. package/dist/components/widgets/CheckboxesWidget.d.ts +26 -0
  22. package/dist/components/widgets/ColorWidget.d.ts +15 -0
  23. package/dist/components/widgets/DateTimeWidget.d.ts +8 -0
  24. package/dist/components/widgets/DateWidget.d.ts +8 -0
  25. package/dist/components/widgets/EmailWidget.d.ts +8 -0
  26. package/dist/components/widgets/FileWidget.d.ts +19 -0
  27. package/dist/components/widgets/HiddenWidget.d.ts +12 -0
  28. package/dist/components/widgets/PasswordWidget.d.ts +8 -0
  29. package/dist/components/widgets/RadioWidget.d.ts +22 -0
  30. package/dist/components/widgets/RangeWidget.d.ts +8 -0
  31. package/dist/components/widgets/SelectWidget.d.ts +24 -0
  32. package/dist/components/widgets/SubmitButton.d.ts +3 -0
  33. package/dist/components/widgets/TextWidget.d.ts +9 -0
  34. package/dist/components/widgets/TextareaWidget.d.ts +25 -0
  35. package/dist/components/widgets/URLWidget.d.ts +8 -0
  36. package/dist/components/widgets/UpDownWidget.d.ts +8 -0
  37. package/dist/components/widgets/index.d.ts +43 -0
  38. package/dist/core.cjs.development.js +5714 -0
  39. package/dist/core.cjs.development.js.map +1 -0
  40. package/dist/core.cjs.production.min.js +2 -0
  41. package/dist/core.cjs.production.min.js.map +1 -0
  42. package/dist/core.esm.js +5706 -0
  43. package/dist/core.esm.js.map +1 -0
  44. package/dist/defaultRegistry.d.ts +41 -0
  45. package/dist/index.d.ts +71 -0
  46. package/dist/index.js +8 -0
  47. package/dist/types.d.ts +50 -0
  48. package/dist/utils.d.ts +81 -0
  49. package/dist/validate.d.ts +21 -0
  50. package/dist/withTheme.d.ts +10 -0
  51. package/index.d.ts +3 -3
  52. package/package.json +23 -24
  53. package/dist/cjs/components/AddButton.js +0 -32
  54. package/dist/cjs/components/ErrorList.js +0 -29
  55. package/dist/cjs/components/Form.js +0 -576
  56. package/dist/cjs/components/IconButton.js +0 -32
  57. package/dist/cjs/components/fields/ArrayField.js +0 -917
  58. package/dist/cjs/components/fields/BooleanField.js +0 -105
  59. package/dist/cjs/components/fields/DescriptionField.js +0 -44
  60. package/dist/cjs/components/fields/MultiSchemaField.js +0 -265
  61. package/dist/cjs/components/fields/NullField.js +0 -66
  62. package/dist/cjs/components/fields/NumberField.js +0 -153
  63. package/dist/cjs/components/fields/ObjectField.js +0 -345
  64. package/dist/cjs/components/fields/SchemaField.js +0 -475
  65. package/dist/cjs/components/fields/StringField.js +0 -96
  66. package/dist/cjs/components/fields/TitleField.js +0 -37
  67. package/dist/cjs/components/fields/UnsupportedField.js +0 -33
  68. package/dist/cjs/components/fields/index.js +0 -47
  69. package/dist/cjs/components/widgets/AltDateTimeWidget.js +0 -45
  70. package/dist/cjs/components/widgets/AltDateWidget.js +0 -282
  71. package/dist/cjs/components/widgets/BaseInput.js +0 -144
  72. package/dist/cjs/components/widgets/CheckboxWidget.js +0 -74
  73. package/dist/cjs/components/widgets/CheckboxesWidget.js +0 -106
  74. package/dist/cjs/components/widgets/ColorWidget.js +0 -42
  75. package/dist/cjs/components/widgets/DateTimeWidget.js +0 -40
  76. package/dist/cjs/components/widgets/DateWidget.js +0 -36
  77. package/dist/cjs/components/widgets/EmailWidget.js +0 -31
  78. package/dist/cjs/components/widgets/FileWidget.js +0 -198
  79. package/dist/cjs/components/widgets/HiddenWidget.js +0 -33
  80. package/dist/cjs/components/widgets/PasswordWidget.js +0 -31
  81. package/dist/cjs/components/widgets/RadioWidget.js +0 -92
  82. package/dist/cjs/components/widgets/RangeWidget.js +0 -39
  83. package/dist/cjs/components/widgets/SelectWidget.js +0 -143
  84. package/dist/cjs/components/widgets/SubmitButton.js +0 -30
  85. package/dist/cjs/components/widgets/TextWidget.js +0 -28
  86. package/dist/cjs/components/widgets/TextareaWidget.js +0 -78
  87. package/dist/cjs/components/widgets/URLWidget.js +0 -31
  88. package/dist/cjs/components/widgets/UpDownWidget.js +0 -33
  89. package/dist/cjs/components/widgets/index.js +0 -73
  90. package/dist/cjs/index.js +0 -28
  91. package/dist/cjs/types.js +0 -47
  92. package/dist/cjs/utils.js +0 -1419
  93. package/dist/cjs/validate.js +0 -354
  94. package/dist/cjs/withTheme.js +0 -50
  95. package/dist/es/components/AddButton.js +0 -21
  96. package/dist/es/components/ErrorList.js +0 -19
  97. package/dist/es/components/Form.js +0 -561
  98. package/dist/es/components/IconButton.js +0 -22
  99. package/dist/es/components/fields/ArrayField.js +0 -899
  100. package/dist/es/components/fields/BooleanField.js +0 -91
  101. package/dist/es/components/fields/DescriptionField.js +0 -33
  102. package/dist/es/components/fields/MultiSchemaField.js +0 -251
  103. package/dist/es/components/fields/NullField.js +0 -55
  104. package/dist/es/components/fields/NumberField.js +0 -138
  105. package/dist/es/components/fields/ObjectField.js +0 -330
  106. package/dist/es/components/fields/SchemaField.js +0 -457
  107. package/dist/es/components/fields/StringField.js +0 -82
  108. package/dist/es/components/fields/TitleField.js +0 -25
  109. package/dist/es/components/fields/UnsupportedField.js +0 -22
  110. package/dist/es/components/fields/index.js +0 -26
  111. package/dist/es/components/widgets/AltDateTimeWidget.js +0 -33
  112. package/dist/es/components/widgets/AltDateWidget.js +0 -268
  113. package/dist/es/components/widgets/BaseInput.js +0 -133
  114. package/dist/es/components/widgets/CheckboxWidget.js +0 -62
  115. package/dist/es/components/widgets/CheckboxesWidget.js +0 -93
  116. package/dist/es/components/widgets/ColorWidget.js +0 -31
  117. package/dist/es/components/widgets/DateTimeWidget.js +0 -28
  118. package/dist/es/components/widgets/DateWidget.js +0 -25
  119. package/dist/es/components/widgets/EmailWidget.js +0 -20
  120. package/dist/es/components/widgets/FileWidget.js +0 -184
  121. package/dist/es/components/widgets/HiddenWidget.js +0 -22
  122. package/dist/es/components/widgets/PasswordWidget.js +0 -20
  123. package/dist/es/components/widgets/RadioWidget.js +0 -79
  124. package/dist/es/components/widgets/RangeWidget.js +0 -27
  125. package/dist/es/components/widgets/SelectWidget.js +0 -130
  126. package/dist/es/components/widgets/SubmitButton.js +0 -19
  127. package/dist/es/components/widgets/TextWidget.js +0 -17
  128. package/dist/es/components/widgets/TextareaWidget.js +0 -67
  129. package/dist/es/components/widgets/URLWidget.js +0 -20
  130. package/dist/es/components/widgets/UpDownWidget.js +0 -21
  131. package/dist/es/components/widgets/index.js +0 -43
  132. package/dist/es/index.js +0 -6
  133. package/dist/es/types.js +0 -34
  134. package/dist/es/utils.js +0 -1317
  135. package/dist/es/validate.js +0 -338
  136. package/dist/es/withTheme.js +0 -36
  137. package/dist/react-jsonschema-form.js +0 -11
  138. package/dist/react-jsonschema-form.js.map +0 -1
  139. package/lib/components/AddButton.js +0 -21
  140. package/lib/components/ErrorList.js +0 -19
  141. package/lib/components/Form.js +0 -561
  142. package/lib/components/IconButton.js +0 -22
  143. package/lib/components/fields/ArrayField.js +0 -899
  144. package/lib/components/fields/BooleanField.js +0 -91
  145. package/lib/components/fields/DescriptionField.js +0 -33
  146. package/lib/components/fields/MultiSchemaField.js +0 -251
  147. package/lib/components/fields/NullField.js +0 -55
  148. package/lib/components/fields/NumberField.js +0 -138
  149. package/lib/components/fields/ObjectField.js +0 -330
  150. package/lib/components/fields/SchemaField.js +0 -457
  151. package/lib/components/fields/StringField.js +0 -82
  152. package/lib/components/fields/TitleField.js +0 -25
  153. package/lib/components/fields/UnsupportedField.js +0 -22
  154. package/lib/components/fields/index.js +0 -26
  155. package/lib/components/widgets/AltDateTimeWidget.js +0 -33
  156. package/lib/components/widgets/AltDateWidget.js +0 -268
  157. package/lib/components/widgets/BaseInput.js +0 -133
  158. package/lib/components/widgets/CheckboxWidget.js +0 -62
  159. package/lib/components/widgets/CheckboxesWidget.js +0 -93
  160. package/lib/components/widgets/ColorWidget.js +0 -31
  161. package/lib/components/widgets/DateTimeWidget.js +0 -28
  162. package/lib/components/widgets/DateWidget.js +0 -25
  163. package/lib/components/widgets/EmailWidget.js +0 -20
  164. package/lib/components/widgets/FileWidget.js +0 -184
  165. package/lib/components/widgets/HiddenWidget.js +0 -22
  166. package/lib/components/widgets/PasswordWidget.js +0 -20
  167. package/lib/components/widgets/RadioWidget.js +0 -79
  168. package/lib/components/widgets/RangeWidget.js +0 -27
  169. package/lib/components/widgets/SelectWidget.js +0 -130
  170. package/lib/components/widgets/SubmitButton.js +0 -19
  171. package/lib/components/widgets/TextWidget.js +0 -17
  172. package/lib/components/widgets/TextareaWidget.js +0 -67
  173. package/lib/components/widgets/URLWidget.js +0 -20
  174. package/lib/components/widgets/UpDownWidget.js +0 -21
  175. package/lib/components/widgets/index.js +0 -43
  176. package/lib/index.js +0 -6
  177. package/lib/types.js +0 -34
  178. package/lib/utils.js +0 -1317
  179. package/lib/validate.js +0 -338
  180. package/lib/withTheme.js +0 -36
@@ -0,0 +1,41 @@
1
+ export function getDefaultRegistry(): {
2
+ fields: {
3
+ AnyOfField: typeof import("./components/fields/MultiSchemaField").default;
4
+ ArrayField: typeof import("./components/fields/ArrayField").default;
5
+ BooleanField: typeof import("./components/fields/BooleanField").default;
6
+ DescriptionField: typeof import("./components/fields/DescriptionField").default;
7
+ NumberField: typeof import("./components/fields/NumberField").default;
8
+ ObjectField: typeof import("./components/fields/ObjectField").default;
9
+ OneOfField: typeof import("./components/fields/MultiSchemaField").default;
10
+ SchemaField: typeof import("./components/fields/SchemaField").default;
11
+ StringField: typeof import("./components/fields/StringField").default;
12
+ TitleField: typeof import("./components/fields/TitleField").default;
13
+ NullField: typeof import("./components/fields/NullField").default;
14
+ UnsupportedField: typeof import("./components/fields/UnsupportedField").default;
15
+ };
16
+ widgets: {
17
+ BaseInput: typeof import("./components/widgets/BaseInput").default;
18
+ PasswordWidget: typeof import("./components/widgets/PasswordWidget").default;
19
+ RadioWidget: typeof import("./components/widgets/RadioWidget").default;
20
+ UpDownWidget: typeof import("./components/widgets/UpDownWidget").default;
21
+ RangeWidget: typeof import("./components/widgets/RangeWidget").default;
22
+ SelectWidget: typeof import("./components/widgets/SelectWidget").default;
23
+ TextWidget: typeof import("./components/widgets/TextWidget").default;
24
+ DateWidget: typeof import("./components/widgets/DateWidget").default;
25
+ DateTimeWidget: typeof import("./components/widgets/DateTimeWidget").default;
26
+ AltDateWidget: typeof import("./components/widgets/AltDateWidget").default;
27
+ AltDateTimeWidget: typeof import("./components/widgets/AltDateTimeWidget").default;
28
+ EmailWidget: typeof import("./components/widgets/EmailWidget").default;
29
+ URLWidget: typeof import("./components/widgets/URLWidget").default;
30
+ TextareaWidget: typeof import("./components/widgets/TextareaWidget").default;
31
+ HiddenWidget: typeof import("./components/widgets/HiddenWidget").default;
32
+ ColorWidget: typeof import("./components/widgets/ColorWidget").default;
33
+ FileWidget: typeof import("./components/widgets/FileWidget").default;
34
+ CheckboxWidget: typeof import("./components/widgets/CheckboxWidget").default;
35
+ CheckboxesWidget: typeof import("./components/widgets/CheckboxesWidget").default;
36
+ SubmitButton: typeof import("./components/widgets/SubmitButton").default;
37
+ };
38
+ definitions: {};
39
+ rootSchema: {};
40
+ formContext: {};
41
+ };
@@ -0,0 +1,71 @@
1
+ export default Form;
2
+ import withTheme from "./withTheme";
3
+ export const utils: {
4
+ getDefaultRegistry: typeof getDefaultRegistry;
5
+ canExpand(schema: any, uiSchema: any, formData: any): any;
6
+ getSchemaType(schema: any): any;
7
+ getWidget(schema: any, widget: any, registeredWidgets?: {}): any;
8
+ hasWidget(schema: any, widget: any, registeredWidgets?: {}): boolean;
9
+ getDefaultFormState(_schema: any, formData: any, rootSchema?: {}, includeUndefinedValues?: boolean): any;
10
+ mergeDefaultsWithFormData(defaults: any, formData: any): any;
11
+ getUiOptions(uiSchema: any): {};
12
+ getSubmitButtonOptions(uiSchema: any): any;
13
+ getDisplayLabel(schema: any, uiSchema: any, rootSchema: any): any;
14
+ isObject(thing: any): boolean;
15
+ mergeObjects(obj1: any, obj2: any, concatArrays?: boolean): any;
16
+ asNumber(value: any): any;
17
+ orderProperties(properties: any, order: any): any;
18
+ isConstant(schema: any): any;
19
+ toConstant(schema: any): any;
20
+ isSelect(_schema: any, rootSchema?: {}): boolean;
21
+ isMultiSelect(schema: any, rootSchema?: {}): boolean;
22
+ isFilesArray(schema: any, uiSchema: any, rootSchema?: {}): boolean;
23
+ isFixedItems(schema: any): any;
24
+ isCustomWidget(uiSchema: any): boolean;
25
+ allowAdditionalItems(schema: any): boolean;
26
+ optionsList(schema: any): any;
27
+ findSchemaDefinition($ref: any, rootSchema?: {}): any;
28
+ stubExistingAdditionalProperties(schema: any, rootSchema?: {}, formData?: {}): any;
29
+ resolveSchema(schema: any, rootSchema?: {}, formData?: {}): any;
30
+ retrieveSchema(schema: any, rootSchema?: {}, formData?: {}): any;
31
+ mergeSchemas(obj1: any, obj2: any): any;
32
+ deepEquals(a: any, b: any, ca?: any[], cb?: any[]): any;
33
+ shouldRender(comp: any, nextProps: any, nextState: any): boolean;
34
+ toIdSchema(schema: any, id: any, rootSchema: any, formData?: {}, idPrefix?: string, idSeparator?: string): any;
35
+ toPathSchema(schema: any, name: string | undefined, rootSchema: any, formData?: {}): any;
36
+ parseDateString(dateString: any, includeTime?: boolean): {
37
+ year: number;
38
+ month: number;
39
+ day: number;
40
+ hour: number;
41
+ minute: number;
42
+ second: number;
43
+ };
44
+ toDateString({ year, month, day, hour, minute, second }: {
45
+ year: any;
46
+ month: any;
47
+ day: any;
48
+ hour?: number | undefined;
49
+ minute?: number | undefined;
50
+ second?: number | undefined;
51
+ }, time?: boolean): string;
52
+ utcToLocal(jsonDate: any): string;
53
+ localToUTC(dateString: any): string | undefined;
54
+ pad(num: any, size: any): string;
55
+ dataURItoBlob(dataURI: any): {
56
+ blob: Blob;
57
+ name: any;
58
+ };
59
+ rangeSpec(schema: any): {
60
+ step: any;
61
+ min: any;
62
+ max: any;
63
+ };
64
+ getMatchingOption(formData: any, options: any, rootSchema: any): number;
65
+ schemaRequiresTrueValue(schema: any): any;
66
+ ADDITIONAL_PROPERTY_FLAG: "__additional_property";
67
+ guessType: (value: any) => "array" | "string" | "null" | "boolean" | "number" | "object";
68
+ };
69
+ import Form from "./components/Form";
70
+ import { getDefaultRegistry } from "./defaultRegistry";
71
+ export { withTheme };
package/dist/index.js ADDED
@@ -0,0 +1,8 @@
1
+
2
+ 'use strict'
3
+
4
+ if (process.env.NODE_ENV === 'production') {
5
+ module.exports = require('./core.cjs.production.min.js')
6
+ } else {
7
+ module.exports = require('./core.cjs.development.js')
8
+ }
@@ -0,0 +1,50 @@
1
+ export const registry: PropTypes.Requireable<PropTypes.InferProps<{
2
+ ArrayFieldTemplate: PropTypes.Requireable<PropTypes.ReactComponentLike>;
3
+ FieldTemplate: PropTypes.Requireable<PropTypes.ReactComponentLike>;
4
+ ObjectFieldTemplate: PropTypes.Requireable<PropTypes.ReactComponentLike>;
5
+ definitions: PropTypes.Validator<object>;
6
+ rootSchema: PropTypes.Requireable<object>;
7
+ fields: PropTypes.Validator<{
8
+ [x: string]: string | ((props: any, context?: any) => any) | (new (props: any, context?: any) => any) | null | undefined;
9
+ }>;
10
+ formContext: PropTypes.Validator<object>;
11
+ widgets: PropTypes.Validator<{
12
+ [x: string]: object | null | undefined;
13
+ }>;
14
+ }>>;
15
+ export const fieldProps: {
16
+ autofocus: PropTypes.Requireable<boolean>;
17
+ disabled: PropTypes.Requireable<boolean>;
18
+ errorSchema: PropTypes.Requireable<object>;
19
+ formData: PropTypes.Requireable<any>;
20
+ idSchema: PropTypes.Requireable<object>;
21
+ onBlur: PropTypes.Requireable<(...args: any[]) => any>;
22
+ onChange: PropTypes.Validator<(...args: any[]) => any>;
23
+ onFocus: PropTypes.Requireable<(...args: any[]) => any>;
24
+ rawErrors: PropTypes.Requireable<(string | null | undefined)[]>;
25
+ readonly: PropTypes.Requireable<boolean>;
26
+ registry: PropTypes.Validator<PropTypes.InferProps<{
27
+ ArrayFieldTemplate: PropTypes.Requireable<PropTypes.ReactComponentLike>;
28
+ FieldTemplate: PropTypes.Requireable<PropTypes.ReactComponentLike>;
29
+ ObjectFieldTemplate: PropTypes.Requireable<PropTypes.ReactComponentLike>;
30
+ definitions: PropTypes.Validator<object>;
31
+ rootSchema: PropTypes.Requireable<object>;
32
+ fields: PropTypes.Validator<{
33
+ [x: string]: string | ((props: any, context?: any) => any) | (new (props: any, context?: any) => any) | null | undefined;
34
+ }>;
35
+ formContext: PropTypes.Validator<object>;
36
+ widgets: PropTypes.Validator<{
37
+ [x: string]: object | null | undefined;
38
+ }>;
39
+ }>>;
40
+ required: PropTypes.Requireable<boolean>;
41
+ schema: PropTypes.Validator<object>;
42
+ uiSchema: PropTypes.Requireable<PropTypes.InferProps<{
43
+ "ui:options": PropTypes.Requireable<PropTypes.InferProps<{
44
+ addable: PropTypes.Requireable<boolean>;
45
+ orderable: PropTypes.Requireable<boolean>;
46
+ removable: PropTypes.Requireable<boolean>;
47
+ }>>;
48
+ }>>;
49
+ };
50
+ import PropTypes from "prop-types";
@@ -0,0 +1,81 @@
1
+ export function canExpand(schema: any, uiSchema: any, formData: any): any;
2
+ export function getSchemaType(schema: any): any;
3
+ export function getWidget(schema: any, widget: any, registeredWidgets?: {}): any;
4
+ export function hasWidget(schema: any, widget: any, registeredWidgets?: {}): boolean;
5
+ export function getDefaultFormState(_schema: any, formData: any, rootSchema?: {}, includeUndefinedValues?: boolean): any;
6
+ /**
7
+ * When merging defaults and form data, we want to merge in this specific way:
8
+ * - objects are deeply merged
9
+ * - arrays are merged in such a way that:
10
+ * - when the array is set in form data, only array entries set in form data
11
+ * are deeply merged; additional entries from the defaults are ignored
12
+ * - when the array is not set in form data, the default is copied over
13
+ * - scalars are overwritten/set by form data
14
+ */
15
+ export function mergeDefaultsWithFormData(defaults: any, formData: any): any;
16
+ export function getUiOptions(uiSchema: any): {};
17
+ export function getSubmitButtonOptions(uiSchema: any): any;
18
+ export function getDisplayLabel(schema: any, uiSchema: any, rootSchema: any): any;
19
+ export function isObject(thing: any): boolean;
20
+ export function mergeObjects(obj1: any, obj2: any, concatArrays?: boolean): any;
21
+ export function asNumber(value: any): any;
22
+ export function orderProperties(properties: any, order: any): any;
23
+ /**
24
+ * This function checks if the given schema matches a single
25
+ * constant value.
26
+ */
27
+ export function isConstant(schema: any): any;
28
+ export function toConstant(schema: any): any;
29
+ export function isSelect(_schema: any, rootSchema?: {}): boolean;
30
+ export function isMultiSelect(schema: any, rootSchema?: {}): boolean;
31
+ export function isFilesArray(schema: any, uiSchema: any, rootSchema?: {}): boolean;
32
+ export function isFixedItems(schema: any): any;
33
+ export function isCustomWidget(uiSchema: any): boolean;
34
+ export function allowAdditionalItems(schema: any): boolean;
35
+ export function optionsList(schema: any): any;
36
+ export function findSchemaDefinition($ref: any, rootSchema?: {}): any;
37
+ export function stubExistingAdditionalProperties(schema: any, rootSchema?: {}, formData?: {}): any;
38
+ /**
39
+ * Resolves references and dependencies within a schema and its 'allOf' children.
40
+ *
41
+ * Called internally by retrieveSchema.
42
+ */
43
+ export function resolveSchema(schema: any, rootSchema?: {}, formData?: {}): any;
44
+ export function retrieveSchema(schema: any, rootSchema?: {}, formData?: {}): any;
45
+ export function mergeSchemas(obj1: any, obj2: any): any;
46
+ export function deepEquals(a: any, b: any, ca?: any[], cb?: any[]): any;
47
+ export function shouldRender(comp: any, nextProps: any, nextState: any): boolean;
48
+ export function toIdSchema(schema: any, id: any, rootSchema: any, formData?: {}, idPrefix?: string, idSeparator?: string): any;
49
+ export function toPathSchema(schema: any, name: string | undefined, rootSchema: any, formData?: {}): any;
50
+ export function parseDateString(dateString: any, includeTime?: boolean): {
51
+ year: number;
52
+ month: number;
53
+ day: number;
54
+ hour: number;
55
+ minute: number;
56
+ second: number;
57
+ };
58
+ export function toDateString({ year, month, day, hour, minute, second }: {
59
+ year: any;
60
+ month: any;
61
+ day: any;
62
+ hour?: number | undefined;
63
+ minute?: number | undefined;
64
+ second?: number | undefined;
65
+ }, time?: boolean): string;
66
+ export function utcToLocal(jsonDate: any): string;
67
+ export function localToUTC(dateString: any): string | undefined;
68
+ export function pad(num: any, size: any): string;
69
+ export function dataURItoBlob(dataURI: any): {
70
+ blob: Blob;
71
+ name: any;
72
+ };
73
+ export function rangeSpec(schema: any): {
74
+ step: any;
75
+ min: any;
76
+ max: any;
77
+ };
78
+ export function getMatchingOption(formData: any, options: any, rootSchema: any): number;
79
+ export function schemaRequiresTrueValue(schema: any): any;
80
+ export const ADDITIONAL_PROPERTY_FLAG: "__additional_property";
81
+ export function guessType(value: any): "array" | "string" | "null" | "boolean" | "number" | "object";
@@ -0,0 +1,21 @@
1
+ export function toErrorList(errorSchema: any, fieldName?: string): any[];
2
+ /**
3
+ * This function processes the formData with a user `validate` contributed
4
+ * function, which receives the form data and an `errorHandler` object that
5
+ * will be used to add custom validation errors for each field.
6
+ */
7
+ export default function validateFormData(formData: any, schema: any, customValidate: any, transformErrors: any, additionalMetaSchemas?: any[], customFormats?: {}): {
8
+ errors: any[];
9
+ errorSchema: any;
10
+ };
11
+ /**
12
+ * Recursively prefixes all $ref's in a schema with `ROOT_SCHEMA_PREFIX`
13
+ * This is used in isValid to make references to the rootSchema
14
+ */
15
+ export function withIdRefPrefix(schemaNode: any): any;
16
+ /**
17
+ * Validates data against a schema, returning true if the data is valid, or
18
+ * false otherwise. If the schema is invalid, then this function will return
19
+ * false.
20
+ */
21
+ export function isValid(schema: any, data: any, rootSchema: any): boolean | PromiseLike<any>;
@@ -0,0 +1,10 @@
1
+ export default withTheme;
2
+ declare function withTheme(themeProps: any): React.ForwardRefExoticComponent<React.RefAttributes<any>>;
3
+ declare namespace withTheme {
4
+ export namespace propTypes {
5
+ export const widgets: PropTypes.Requireable<object>;
6
+ export const fields: PropTypes.Requireable<object>;
7
+ }
8
+ }
9
+ import React from "react";
10
+ import PropTypes from "prop-types";
package/index.d.ts CHANGED
@@ -72,9 +72,9 @@ declare module '@rjsf/core' {
72
72
  }
73
73
 
74
74
  export type UISchemaSubmitButtonOptions = {
75
- submitText: string;
76
- norender: boolean;
77
- props: {
75
+ submitText?: string;
76
+ norender?: boolean;
77
+ props?: {
78
78
  disabled?:boolean;
79
79
  className?:string;
80
80
  [name: string]: any;
package/package.json CHANGED
@@ -1,24 +1,20 @@
1
1
  {
2
2
  "name": "@rjsf/core",
3
- "version": "4.2.0",
3
+ "version": "4.2.1",
4
4
  "description": "A simple React component capable of building HTML forms out of a JSON schema.",
5
5
  "scripts": {
6
- "build": "npm run dist:build:umd && npm run build:cjs && npm run build:es && npm run build:es:lib",
7
- "build:cjs": "cross-env NODE_ENV=production BABEL_ENV=cjs babel --extensions \".js,.jsx,.ts,.tsx\" ./src --out-dir ./dist/cjs",
8
- "build:es": "cross-env NODE_ENV=production BABEL_ENV=es babel --extensions \".js,.jsx,.ts,.tsx\" ./src --out-dir ./dist/es",
9
- "build:es:lib": "cross-env NODE_ENV=production BABEL_ENV=es babel --extensions \".js,.jsx,.ts,.tsx\" ./src --out-dir ./lib",
10
- "dist:build:umd": "rimraf dist && cross-env NODE_ENV=production BABEL_ENV=umd webpack --config webpack.config.dist.js",
6
+ "build": "rimraf dist && tsdx build --format cjs,es && cross-env NODE_ENV=production BABEL_ENV=umd webpack --config webpack.config.dist.js",
11
7
  "cs-check": "prettier -l \"{src,test}/**/*.js\"",
12
8
  "cs-format": "prettier \"{src,test}/**/*.js\" --write",
13
9
  "lint": "eslint src test",
14
10
  "precommit": "lint-staged",
15
11
  "publish-to-npm": "npm run build && npm publish",
16
- "start": "concurrently \"npm:build:* -- --watch\"",
17
- "tdd": "cross-env NODE_ENV=test mocha --require @babel/register --watch --require ./test/setup-jsdom.js test/**/*_test.js",
18
- "test": "cross-env BABEL_ENV=test NODE_ENV=test mocha --require @babel/register --require ./test/setup-jsdom.js test/**/*_test.js",
19
- "test:form": "cross-env BABEL_ENV=test NODE_ENV=test mocha --require @babel/register --require ./test/setup-jsdom.js test/**/Form_test.js",
20
- "test-coverage": "cross-env NODE_ENV=test nyc --reporter=lcov mocha --require @babel/register --require ./test/setup-jsdom.js test/**/*_test.js",
21
- "test-debug": "cross-env NODE_ENV=test mocha --require @babel/register --require ./test/setup-jsdom.js --inspect-brk --inspect test/Form_test.js"
12
+ "start": "tsdx watch",
13
+ "test": "tsdx test",
14
+ "test:watch": "tsdx test --watch",
15
+ "test:update": "tsdx test --u",
16
+ "test-old": "cross-env BABEL_ENV=test NODE_ENV=test mocha --require @babel/register --require ./test/setup-jsdom.js test/**/*_test.js",
17
+ "test-coverage": "tsdx test --coverage"
22
18
  },
23
19
  "lint-staged": {
24
20
  "{src,test}/**/*.js": [
@@ -26,8 +22,9 @@
26
22
  "prettier --write"
27
23
  ]
28
24
  },
29
- "main": "dist/cjs/index.js",
30
- "module": "dist/es/index.js",
25
+ "main": "dist/index.js",
26
+ "module": "dist/core.esm.js",
27
+ "typings": "index.d.ts",
31
28
  "files": [
32
29
  "dist",
33
30
  "lib",
@@ -47,9 +44,10 @@
47
44
  "json-schema-merge-allof": "^0.6.0",
48
45
  "jsonpointer": "^5.0.0",
49
46
  "lodash": "^4.17.15",
47
+ "lodash-es": "^4.17.15",
50
48
  "nanoid": "^3.1.23",
51
49
  "prop-types": "^15.7.2",
52
- "react-is": "^16.9.0"
50
+ "react-is": "16.9.0"
53
51
  },
54
52
  "devDependencies": {
55
53
  "@babel/cli": "^7.4.4",
@@ -61,19 +59,21 @@
61
59
  "@babel/preset-env": "^7.4.5",
62
60
  "@babel/preset-react": "^7.0.0",
63
61
  "@babel/register": "^7.4.4",
62
+ "@types/react": "^17.0.39",
63
+ "@types/react-dom": "^17.0.11",
64
+ "@typescript-eslint/eslint-plugin": "^5.18.0",
65
+ "@typescript-eslint/parser": "^5.18.0",
64
66
  "atob": "^2.0.3",
65
- "babel-eslint": "^10.0.1",
66
67
  "babel-loader": "^8.0.6",
67
68
  "chai": "^3.3.0",
68
69
  "concurrently": "^5.1.0",
69
70
  "cross-env": "^7.0.2",
70
71
  "css-loader": "^0.23.1",
71
- "eslint": "^4.9.0",
72
- "eslint-config-react-app": "^2.0.1",
73
- "eslint-plugin-flowtype": "^2.39.1",
74
- "eslint-plugin-import": "^2.7.0",
75
- "eslint-plugin-jsx-a11y": "^5.1.1",
76
- "eslint-plugin-react": "^7.4.0",
72
+ "eslint": "^8.13.0",
73
+ "eslint-plugin-flowtype": "^8.0.3",
74
+ "eslint-plugin-import": "^2.26.0",
75
+ "eslint-plugin-jsx-a11y": "^6.5.1",
76
+ "eslint-plugin-react": "^7.29.4",
77
77
  "estraverse": "^4.2.0",
78
78
  "estraverse-fb": "^1.3.1",
79
79
  "express": "^4.14.0",
@@ -97,7 +97,6 @@
97
97
  "rimraf": "^2.5.4",
98
98
  "sinon": "^9.0.2",
99
99
  "style-loader": "^2.0.0",
100
- "webpack": "^4.42.1",
101
100
  "webpack-cli": "^3.1.2",
102
101
  "webpack-dev-middleware": "^3.4.0",
103
102
  "webpack-hot-middleware": "^2.13.2"
@@ -120,5 +119,5 @@
120
119
  "publishConfig": {
121
120
  "access": "public"
122
121
  },
123
- "gitHead": "c9141f76e236bfab629eba685c5d8eb803ab7305"
122
+ "gitHead": "d355518abef3706fdb4e9ff9ffe51efb4af73438"
124
123
  }
@@ -1,32 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports["default"] = AddButton;
7
-
8
- var _react = _interopRequireDefault(require("react"));
9
-
10
- var _IconButton = _interopRequireDefault(require("./IconButton"));
11
-
12
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
13
-
14
- function AddButton(_ref) {
15
- var className = _ref.className,
16
- onClick = _ref.onClick,
17
- disabled = _ref.disabled;
18
- return _react["default"].createElement("div", {
19
- className: "row"
20
- }, _react["default"].createElement("p", {
21
- className: "col-xs-3 col-xs-offset-9 text-right ".concat(className)
22
- }, _react["default"].createElement(_IconButton["default"], {
23
- type: "info",
24
- icon: "plus",
25
- className: "btn-add col-xs-12",
26
- "aria-label": "Add",
27
- tabIndex: "0",
28
- onClick: onClick,
29
- disabled: disabled
30
- })));
31
- }
32
- //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9jb21wb25lbnRzL0FkZEJ1dHRvbi5qcyJdLCJuYW1lcyI6WyJBZGRCdXR0b24iLCJjbGFzc05hbWUiLCJvbkNsaWNrIiwiZGlzYWJsZWQiXSwibWFwcGluZ3MiOiI7Ozs7Ozs7QUFBQTs7QUFDQTs7OztBQUVlLFNBQVNBLFNBQVQsT0FBcUQ7QUFBQSxNQUFoQ0MsU0FBZ0MsUUFBaENBLFNBQWdDO0FBQUEsTUFBckJDLE9BQXFCLFFBQXJCQSxPQUFxQjtBQUFBLE1BQVpDLFFBQVksUUFBWkEsUUFBWTtBQUNsRSxTQUNFO0FBQUssSUFBQSxTQUFTLEVBQUM7QUFBZixLQUNFO0FBQUcsSUFBQSxTQUFTLGdEQUF5Q0YsU0FBekM7QUFBWixLQUNFLGdDQUFDLHNCQUFEO0FBQ0UsSUFBQSxJQUFJLEVBQUMsTUFEUDtBQUVFLElBQUEsSUFBSSxFQUFDLE1BRlA7QUFHRSxJQUFBLFNBQVMsRUFBQyxtQkFIWjtBQUlFLGtCQUFXLEtBSmI7QUFLRSxJQUFBLFFBQVEsRUFBQyxHQUxYO0FBTUUsSUFBQSxPQUFPLEVBQUVDLE9BTlg7QUFPRSxJQUFBLFFBQVEsRUFBRUM7QUFQWixJQURGLENBREYsQ0FERjtBQWVEIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IFJlYWN0IGZyb20gXCJyZWFjdFwiO1xuaW1wb3J0IEljb25CdXR0b24gZnJvbSBcIi4vSWNvbkJ1dHRvblwiO1xuXG5leHBvcnQgZGVmYXVsdCBmdW5jdGlvbiBBZGRCdXR0b24oeyBjbGFzc05hbWUsIG9uQ2xpY2ssIGRpc2FibGVkIH0pIHtcbiAgcmV0dXJuIChcbiAgICA8ZGl2IGNsYXNzTmFtZT1cInJvd1wiPlxuICAgICAgPHAgY2xhc3NOYW1lPXtgY29sLXhzLTMgY29sLXhzLW9mZnNldC05IHRleHQtcmlnaHQgJHtjbGFzc05hbWV9YH0+XG4gICAgICAgIDxJY29uQnV0dG9uXG4gICAgICAgICAgdHlwZT1cImluZm9cIlxuICAgICAgICAgIGljb249XCJwbHVzXCJcbiAgICAgICAgICBjbGFzc05hbWU9XCJidG4tYWRkIGNvbC14cy0xMlwiXG4gICAgICAgICAgYXJpYS1sYWJlbD1cIkFkZFwiXG4gICAgICAgICAgdGFiSW5kZXg9XCIwXCJcbiAgICAgICAgICBvbkNsaWNrPXtvbkNsaWNrfVxuICAgICAgICAgIGRpc2FibGVkPXtkaXNhYmxlZH1cbiAgICAgICAgLz5cbiAgICAgIDwvcD5cbiAgICA8L2Rpdj5cbiAgKTtcbn1cbiJdfQ==
@@ -1,29 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports["default"] = ErrorList;
7
-
8
- var _react = _interopRequireDefault(require("react"));
9
-
10
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
11
-
12
- function ErrorList(props) {
13
- var errors = props.errors;
14
- return _react["default"].createElement("div", {
15
- className: "panel panel-danger errors"
16
- }, _react["default"].createElement("div", {
17
- className: "panel-heading"
18
- }, _react["default"].createElement("h3", {
19
- className: "panel-title"
20
- }, "Errors")), _react["default"].createElement("ul", {
21
- className: "list-group"
22
- }, errors.map(function (error, i) {
23
- return _react["default"].createElement("li", {
24
- key: i,
25
- className: "list-group-item text-danger"
26
- }, error.stack);
27
- })));
28
- }
29
- //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9jb21wb25lbnRzL0Vycm9yTGlzdC5qcyJdLCJuYW1lcyI6WyJFcnJvckxpc3QiLCJwcm9wcyIsImVycm9ycyIsIm1hcCIsImVycm9yIiwiaSIsInN0YWNrIl0sIm1hcHBpbmdzIjoiOzs7Ozs7O0FBQUE7Ozs7QUFFZSxTQUFTQSxTQUFULENBQW1CQyxLQUFuQixFQUEwQjtBQUFBLE1BQy9CQyxNQUQrQixHQUNwQkQsS0FEb0IsQ0FDL0JDLE1BRCtCO0FBRXZDLFNBQ0U7QUFBSyxJQUFBLFNBQVMsRUFBQztBQUFmLEtBQ0U7QUFBSyxJQUFBLFNBQVMsRUFBQztBQUFmLEtBQ0U7QUFBSSxJQUFBLFNBQVMsRUFBQztBQUFkLGNBREYsQ0FERixFQUlFO0FBQUksSUFBQSxTQUFTLEVBQUM7QUFBZCxLQUNHQSxNQUFNLENBQUNDLEdBQVAsQ0FBVyxVQUFDQyxLQUFELEVBQVFDLENBQVIsRUFBYztBQUN4QixXQUNFO0FBQUksTUFBQSxHQUFHLEVBQUVBLENBQVQ7QUFBWSxNQUFBLFNBQVMsRUFBQztBQUF0QixPQUNHRCxLQUFLLENBQUNFLEtBRFQsQ0FERjtBQUtELEdBTkEsQ0FESCxDQUpGLENBREY7QUFnQkQiLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgUmVhY3QgZnJvbSBcInJlYWN0XCI7XG5cbmV4cG9ydCBkZWZhdWx0IGZ1bmN0aW9uIEVycm9yTGlzdChwcm9wcykge1xuICBjb25zdCB7IGVycm9ycyB9ID0gcHJvcHM7XG4gIHJldHVybiAoXG4gICAgPGRpdiBjbGFzc05hbWU9XCJwYW5lbCBwYW5lbC1kYW5nZXIgZXJyb3JzXCI+XG4gICAgICA8ZGl2IGNsYXNzTmFtZT1cInBhbmVsLWhlYWRpbmdcIj5cbiAgICAgICAgPGgzIGNsYXNzTmFtZT1cInBhbmVsLXRpdGxlXCI+RXJyb3JzPC9oMz5cbiAgICAgIDwvZGl2PlxuICAgICAgPHVsIGNsYXNzTmFtZT1cImxpc3QtZ3JvdXBcIj5cbiAgICAgICAge2Vycm9ycy5tYXAoKGVycm9yLCBpKSA9PiB7XG4gICAgICAgICAgcmV0dXJuIChcbiAgICAgICAgICAgIDxsaSBrZXk9e2l9IGNsYXNzTmFtZT1cImxpc3QtZ3JvdXAtaXRlbSB0ZXh0LWRhbmdlclwiPlxuICAgICAgICAgICAgICB7ZXJyb3Iuc3RhY2t9XG4gICAgICAgICAgICA8L2xpPlxuICAgICAgICAgICk7XG4gICAgICAgIH0pfVxuICAgICAgPC91bD5cbiAgICA8L2Rpdj5cbiAgKTtcbn1cbiJdfQ==