@rjsf/core 4.1.1 → 4.2.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.
- package/dist/components/AddButton.d.ts +5 -0
- package/dist/components/ErrorList.d.ts +1 -0
- package/dist/components/Form.d.ts +48 -0
- package/dist/components/IconButton.d.ts +1 -0
- package/dist/components/fields/ArrayField.d.ts +51 -0
- package/dist/components/fields/BooleanField.d.ts +45 -0
- package/dist/components/fields/DescriptionField.d.ts +9 -0
- package/dist/components/fields/MultiSchemaField.d.ts +40 -0
- package/dist/components/fields/NullField.d.ts +6 -0
- package/dist/components/fields/NumberField.d.ts +63 -0
- package/dist/components/fields/ObjectField.d.ts +22 -0
- package/dist/components/fields/SchemaField.d.ts +39 -0
- package/dist/components/fields/StringField.d.ts +45 -0
- package/dist/components/fields/TitleField.d.ts +10 -0
- package/dist/components/fields/UnsupportedField.d.ts +14 -0
- package/dist/components/fields/index.d.ts +26 -0
- package/dist/components/widgets/AltDateTimeWidget.d.ts +22 -0
- package/dist/components/widgets/AltDateWidget.d.ts +22 -0
- package/dist/components/widgets/BaseInput.d.ts +23 -0
- package/dist/components/widgets/CheckboxWidget.d.ts +18 -0
- package/dist/components/widgets/CheckboxesWidget.d.ts +26 -0
- package/dist/components/widgets/ColorWidget.d.ts +15 -0
- package/dist/components/widgets/DateTimeWidget.d.ts +8 -0
- package/dist/components/widgets/DateWidget.d.ts +8 -0
- package/dist/components/widgets/EmailWidget.d.ts +8 -0
- package/dist/components/widgets/FileWidget.d.ts +19 -0
- package/dist/components/widgets/HiddenWidget.d.ts +12 -0
- package/dist/components/widgets/PasswordWidget.d.ts +8 -0
- package/dist/components/widgets/RadioWidget.d.ts +22 -0
- package/dist/components/widgets/RangeWidget.d.ts +8 -0
- package/dist/components/widgets/SelectWidget.d.ts +24 -0
- package/dist/components/widgets/SubmitButton.d.ts +3 -0
- package/dist/components/widgets/TextWidget.d.ts +9 -0
- package/dist/components/widgets/TextareaWidget.d.ts +25 -0
- package/dist/components/widgets/URLWidget.d.ts +8 -0
- package/dist/components/widgets/UpDownWidget.d.ts +8 -0
- package/dist/components/widgets/index.d.ts +43 -0
- package/dist/core.cjs.development.js +5714 -0
- package/dist/core.cjs.development.js.map +1 -0
- package/dist/core.cjs.production.min.js +2 -0
- package/dist/core.cjs.production.min.js.map +1 -0
- package/dist/core.esm.js +5706 -0
- package/dist/core.esm.js.map +1 -0
- package/dist/defaultRegistry.d.ts +41 -0
- package/dist/index.d.ts +71 -0
- package/dist/index.js +8 -0
- package/dist/react-jsonschema-form.js +18 -3
- package/dist/react-jsonschema-form.js.map +1 -1
- package/dist/types.d.ts +50 -0
- package/dist/utils.d.ts +81 -0
- package/dist/validate.d.ts +21 -0
- package/dist/withTheme.d.ts +10 -0
- package/index.d.ts +35 -14
- package/package.json +23 -24
- package/dist/cjs/components/AddButton.js +0 -32
- package/dist/cjs/components/ErrorList.js +0 -29
- package/dist/cjs/components/Form.js +0 -576
- package/dist/cjs/components/IconButton.js +0 -32
- package/dist/cjs/components/fields/ArrayField.js +0 -916
- package/dist/cjs/components/fields/BooleanField.js +0 -105
- package/dist/cjs/components/fields/DescriptionField.js +0 -44
- package/dist/cjs/components/fields/MultiSchemaField.js +0 -265
- package/dist/cjs/components/fields/NullField.js +0 -66
- package/dist/cjs/components/fields/NumberField.js +0 -153
- package/dist/cjs/components/fields/ObjectField.js +0 -345
- package/dist/cjs/components/fields/SchemaField.js +0 -475
- package/dist/cjs/components/fields/StringField.js +0 -96
- package/dist/cjs/components/fields/TitleField.js +0 -37
- package/dist/cjs/components/fields/UnsupportedField.js +0 -33
- package/dist/cjs/components/fields/index.js +0 -47
- package/dist/cjs/components/widgets/AltDateTimeWidget.js +0 -45
- package/dist/cjs/components/widgets/AltDateWidget.js +0 -282
- package/dist/cjs/components/widgets/BaseInput.js +0 -144
- package/dist/cjs/components/widgets/CheckboxWidget.js +0 -74
- package/dist/cjs/components/widgets/CheckboxesWidget.js +0 -106
- package/dist/cjs/components/widgets/ColorWidget.js +0 -42
- package/dist/cjs/components/widgets/DateTimeWidget.js +0 -40
- package/dist/cjs/components/widgets/DateWidget.js +0 -36
- package/dist/cjs/components/widgets/EmailWidget.js +0 -31
- package/dist/cjs/components/widgets/FileWidget.js +0 -198
- package/dist/cjs/components/widgets/HiddenWidget.js +0 -33
- package/dist/cjs/components/widgets/PasswordWidget.js +0 -31
- package/dist/cjs/components/widgets/RadioWidget.js +0 -92
- package/dist/cjs/components/widgets/RangeWidget.js +0 -39
- package/dist/cjs/components/widgets/SelectWidget.js +0 -143
- package/dist/cjs/components/widgets/TextWidget.js +0 -28
- package/dist/cjs/components/widgets/TextareaWidget.js +0 -78
- package/dist/cjs/components/widgets/URLWidget.js +0 -31
- package/dist/cjs/components/widgets/UpDownWidget.js +0 -33
- package/dist/cjs/components/widgets/index.js +0 -70
- package/dist/cjs/index.js +0 -28
- package/dist/cjs/types.js +0 -47
- package/dist/cjs/utils.js +0 -1381
- package/dist/cjs/validate.js +0 -354
- package/dist/cjs/withTheme.js +0 -50
- package/dist/es/components/AddButton.js +0 -21
- package/dist/es/components/ErrorList.js +0 -19
- package/dist/es/components/Form.js +0 -561
- package/dist/es/components/IconButton.js +0 -22
- package/dist/es/components/fields/ArrayField.js +0 -898
- package/dist/es/components/fields/BooleanField.js +0 -91
- package/dist/es/components/fields/DescriptionField.js +0 -33
- package/dist/es/components/fields/MultiSchemaField.js +0 -251
- package/dist/es/components/fields/NullField.js +0 -55
- package/dist/es/components/fields/NumberField.js +0 -138
- package/dist/es/components/fields/ObjectField.js +0 -330
- package/dist/es/components/fields/SchemaField.js +0 -457
- package/dist/es/components/fields/StringField.js +0 -82
- package/dist/es/components/fields/TitleField.js +0 -25
- package/dist/es/components/fields/UnsupportedField.js +0 -22
- package/dist/es/components/fields/index.js +0 -26
- package/dist/es/components/widgets/AltDateTimeWidget.js +0 -33
- package/dist/es/components/widgets/AltDateWidget.js +0 -268
- package/dist/es/components/widgets/BaseInput.js +0 -133
- package/dist/es/components/widgets/CheckboxWidget.js +0 -62
- package/dist/es/components/widgets/CheckboxesWidget.js +0 -93
- package/dist/es/components/widgets/ColorWidget.js +0 -31
- package/dist/es/components/widgets/DateTimeWidget.js +0 -28
- package/dist/es/components/widgets/DateWidget.js +0 -25
- package/dist/es/components/widgets/EmailWidget.js +0 -20
- package/dist/es/components/widgets/FileWidget.js +0 -184
- package/dist/es/components/widgets/HiddenWidget.js +0 -22
- package/dist/es/components/widgets/PasswordWidget.js +0 -20
- package/dist/es/components/widgets/RadioWidget.js +0 -79
- package/dist/es/components/widgets/RangeWidget.js +0 -27
- package/dist/es/components/widgets/SelectWidget.js +0 -130
- package/dist/es/components/widgets/TextWidget.js +0 -17
- package/dist/es/components/widgets/TextareaWidget.js +0 -67
- package/dist/es/components/widgets/URLWidget.js +0 -20
- package/dist/es/components/widgets/UpDownWidget.js +0 -21
- package/dist/es/components/widgets/index.js +0 -41
- package/dist/es/index.js +0 -6
- package/dist/es/types.js +0 -34
- package/dist/es/utils.js +0 -1281
- package/dist/es/validate.js +0 -338
- package/dist/es/withTheme.js +0 -36
- package/lib/components/AddButton.js +0 -21
- package/lib/components/ErrorList.js +0 -19
- package/lib/components/Form.js +0 -561
- package/lib/components/IconButton.js +0 -22
- package/lib/components/fields/ArrayField.js +0 -898
- package/lib/components/fields/BooleanField.js +0 -91
- package/lib/components/fields/DescriptionField.js +0 -33
- package/lib/components/fields/MultiSchemaField.js +0 -251
- package/lib/components/fields/NullField.js +0 -55
- package/lib/components/fields/NumberField.js +0 -138
- package/lib/components/fields/ObjectField.js +0 -330
- package/lib/components/fields/SchemaField.js +0 -457
- package/lib/components/fields/StringField.js +0 -82
- package/lib/components/fields/TitleField.js +0 -25
- package/lib/components/fields/UnsupportedField.js +0 -22
- package/lib/components/fields/index.js +0 -26
- package/lib/components/widgets/AltDateTimeWidget.js +0 -33
- package/lib/components/widgets/AltDateWidget.js +0 -268
- package/lib/components/widgets/BaseInput.js +0 -133
- package/lib/components/widgets/CheckboxWidget.js +0 -62
- package/lib/components/widgets/CheckboxesWidget.js +0 -93
- package/lib/components/widgets/ColorWidget.js +0 -31
- package/lib/components/widgets/DateTimeWidget.js +0 -28
- package/lib/components/widgets/DateWidget.js +0 -25
- package/lib/components/widgets/EmailWidget.js +0 -20
- package/lib/components/widgets/FileWidget.js +0 -184
- package/lib/components/widgets/HiddenWidget.js +0 -22
- package/lib/components/widgets/PasswordWidget.js +0 -20
- package/lib/components/widgets/RadioWidget.js +0 -79
- package/lib/components/widgets/RangeWidget.js +0 -27
- package/lib/components/widgets/SelectWidget.js +0 -130
- package/lib/components/widgets/TextWidget.js +0 -17
- package/lib/components/widgets/TextareaWidget.js +0 -67
- package/lib/components/widgets/URLWidget.js +0 -20
- package/lib/components/widgets/UpDownWidget.js +0 -21
- package/lib/components/widgets/index.js +0 -41
- package/lib/index.js +0 -6
- package/lib/types.js +0 -34
- package/lib/utils.js +0 -1281
- package/lib/validate.js +0 -338
- package/lib/withTheme.js +0 -36
package/dist/types.d.ts
ADDED
|
@@ -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";
|
package/dist/utils.d.ts
ADDED
|
@@ -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
|
@@ -12,7 +12,7 @@ declare module '@rjsf/core' {
|
|
|
12
12
|
acceptcharset?: string;
|
|
13
13
|
action?: string;
|
|
14
14
|
additionalMetaSchemas?: ReadonlyArray<object>;
|
|
15
|
-
ArrayFieldTemplate?: React.
|
|
15
|
+
ArrayFieldTemplate?: React.FunctionComponent<ArrayFieldTemplateProps>;
|
|
16
16
|
autoComplete?: string;
|
|
17
17
|
autocomplete?: string; // deprecated
|
|
18
18
|
children?: React.ReactNode;
|
|
@@ -23,9 +23,9 @@ declare module '@rjsf/core' {
|
|
|
23
23
|
hideError?: boolean;
|
|
24
24
|
enctype?: string;
|
|
25
25
|
extraErrors?: any;
|
|
26
|
-
ErrorList?: React.
|
|
26
|
+
ErrorList?: React.FunctionComponent<ErrorListProps>;
|
|
27
27
|
fields?: { [name: string]: Field };
|
|
28
|
-
FieldTemplate?: React.
|
|
28
|
+
FieldTemplate?: React.FunctionComponent<FieldTemplateProps>;
|
|
29
29
|
formContext?: any;
|
|
30
30
|
formData?: T;
|
|
31
31
|
id?: string;
|
|
@@ -37,7 +37,7 @@ declare module '@rjsf/core' {
|
|
|
37
37
|
name?: string;
|
|
38
38
|
noHtml5Validate?: boolean;
|
|
39
39
|
noValidate?: boolean;
|
|
40
|
-
ObjectFieldTemplate?: React.
|
|
40
|
+
ObjectFieldTemplate?: React.FunctionComponent<ObjectFieldTemplateProps>;
|
|
41
41
|
omitExtraData?: boolean;
|
|
42
42
|
onBlur?: (id: string, value: any) => void;
|
|
43
43
|
onChange?: (e: IChangeEvent<T>, es?: ErrorSchema) => any;
|
|
@@ -71,15 +71,26 @@ declare module '@rjsf/core' {
|
|
|
71
71
|
submit: () => void;
|
|
72
72
|
}
|
|
73
73
|
|
|
74
|
+
export type UISchemaSubmitButtonOptions = {
|
|
75
|
+
submitText?: string;
|
|
76
|
+
norender?: boolean;
|
|
77
|
+
props?: {
|
|
78
|
+
disabled?:boolean;
|
|
79
|
+
className?:string;
|
|
80
|
+
[name: string]: any;
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
|
|
74
84
|
export type UiSchema = {
|
|
75
85
|
'ui:field'?: Field | string;
|
|
76
86
|
'ui:widget'?: Widget | string;
|
|
77
87
|
'ui:options'?: { [key: string]: boolean | number | string | object | any[] | null };
|
|
78
88
|
'ui:order'?: string[];
|
|
79
|
-
'ui:FieldTemplate'?: React.
|
|
80
|
-
'ui:ArrayFieldTemplate'?: React.
|
|
81
|
-
'ui:ObjectFieldTemplate'?: React.
|
|
89
|
+
'ui:FieldTemplate'?: React.FunctionComponent<FieldTemplateProps>;
|
|
90
|
+
'ui:ArrayFieldTemplate'?: React.FunctionComponent<ArrayFieldTemplateProps>;
|
|
91
|
+
'ui:ObjectFieldTemplate'?: React.FunctionComponent<ObjectFieldTemplateProps>;
|
|
82
92
|
[name: string]: any;
|
|
93
|
+
'ui:submitButtonOptions'?: UISchemaSubmitButtonOptions;
|
|
83
94
|
};
|
|
84
95
|
|
|
85
96
|
export type FieldId = {
|
|
@@ -126,7 +137,7 @@ declare module '@rjsf/core' {
|
|
|
126
137
|
[prop: string]: any; // Allow for other props
|
|
127
138
|
}
|
|
128
139
|
|
|
129
|
-
export type Widget = React.
|
|
140
|
+
export type Widget = React.FunctionComponent<WidgetProps> | React.ComponentClass<WidgetProps>;
|
|
130
141
|
|
|
131
142
|
export interface Registry {
|
|
132
143
|
fields: { [name: string]: Field };
|
|
@@ -156,7 +167,7 @@ declare module '@rjsf/core' {
|
|
|
156
167
|
[prop: string]: any; // Allow for other props
|
|
157
168
|
}
|
|
158
169
|
|
|
159
|
-
export type Field = React.
|
|
170
|
+
export type Field = React.FunctionComponent<FieldProps> | React.ComponentClass<FieldProps>;
|
|
160
171
|
|
|
161
172
|
export type FieldTemplateProps<T = any> = {
|
|
162
173
|
id: string;
|
|
@@ -186,8 +197,8 @@ declare module '@rjsf/core' {
|
|
|
186
197
|
};
|
|
187
198
|
|
|
188
199
|
export type ArrayFieldTemplateProps<T = any> = {
|
|
189
|
-
DescriptionField: React.
|
|
190
|
-
TitleField: React.
|
|
200
|
+
DescriptionField: React.FunctionComponent<{ id: string; description: string | React.ReactElement }>;
|
|
201
|
+
TitleField: React.FunctionComponent<{ id: string; title: string; required: boolean }>;
|
|
191
202
|
canAdd: boolean;
|
|
192
203
|
className: string;
|
|
193
204
|
disabled: boolean;
|
|
@@ -219,8 +230,8 @@ declare module '@rjsf/core' {
|
|
|
219
230
|
};
|
|
220
231
|
|
|
221
232
|
export type ObjectFieldTemplateProps<T = any> = {
|
|
222
|
-
DescriptionField: React.
|
|
223
|
-
TitleField: React.
|
|
233
|
+
DescriptionField: React.FunctionComponent<{ id: string; description: string | React.ReactElement }>;
|
|
234
|
+
TitleField: React.FunctionComponent<{ id: string; title: string; required: boolean }>;
|
|
224
235
|
title: string;
|
|
225
236
|
description: string;
|
|
226
237
|
disabled: boolean;
|
|
@@ -290,7 +301,7 @@ declare module '@rjsf/core' {
|
|
|
290
301
|
|
|
291
302
|
export function withTheme<T = any>(
|
|
292
303
|
themeProps: ThemeProps<T>,
|
|
293
|
-
): React.ComponentClass<FormProps<T>> | React.
|
|
304
|
+
): React.ComponentClass<FormProps<T>> | React.FunctionComponent<FormProps<T>>;
|
|
294
305
|
|
|
295
306
|
export type AddButtonProps = {
|
|
296
307
|
className: string;
|
|
@@ -337,6 +348,8 @@ declare module '@rjsf/core' {
|
|
|
337
348
|
|
|
338
349
|
export function getUiOptions(uiSchema: UiSchema): UiSchema['ui:options'];
|
|
339
350
|
|
|
351
|
+
export function getSubmitButtonOptions(uiSchema: UiSchema): UISchemaSubmitButtonOptions;
|
|
352
|
+
|
|
340
353
|
export function getDisplayLabel(schema: JSONSchema7, uiSchema: UiSchema, rootSchema?: JSONSchema7): boolean;
|
|
341
354
|
|
|
342
355
|
export function isObject(thing: any): boolean;
|
|
@@ -464,6 +477,14 @@ declare module '@rjsf/core/lib/components/fields/SchemaField' {
|
|
|
464
477
|
export default class SchemaField extends React.Component<SchemaFieldProps> {}
|
|
465
478
|
}
|
|
466
479
|
|
|
480
|
+
declare module '@rjsf/core/lib/components/fields/ObjectField' {
|
|
481
|
+
import { FieldProps } from '@rjsf/core';
|
|
482
|
+
|
|
483
|
+
export type ObjectFieldProps<T = any> = FieldProps<T>;
|
|
484
|
+
|
|
485
|
+
export default class ObjectField extends React.Component<ObjectFieldProps> {}
|
|
486
|
+
}
|
|
487
|
+
|
|
467
488
|
declare module '@rjsf/core/lib/validate' {
|
|
468
489
|
import { JSONSchema7Definition } from 'json-schema';
|
|
469
490
|
import { AjvError, ErrorSchema, FormProps } from '@rjsf/core';
|
package/package.json
CHANGED
|
@@ -1,23 +1,20 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rjsf/core",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.2.2",
|
|
4
4
|
"description": "A simple React component capable of building HTML forms out of a JSON schema.",
|
|
5
5
|
"scripts": {
|
|
6
|
-
"build": "
|
|
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": "
|
|
17
|
-
"
|
|
18
|
-
"test": "
|
|
19
|
-
"test
|
|
20
|
-
"test-
|
|
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"
|
|
21
18
|
},
|
|
22
19
|
"lint-staged": {
|
|
23
20
|
"{src,test}/**/*.js": [
|
|
@@ -25,8 +22,9 @@
|
|
|
25
22
|
"prettier --write"
|
|
26
23
|
]
|
|
27
24
|
},
|
|
28
|
-
"main": "dist/
|
|
29
|
-
"module": "dist/
|
|
25
|
+
"main": "dist/index.js",
|
|
26
|
+
"module": "dist/core.esm.js",
|
|
27
|
+
"typings": "index.d.ts",
|
|
30
28
|
"files": [
|
|
31
29
|
"dist",
|
|
32
30
|
"lib",
|
|
@@ -46,9 +44,10 @@
|
|
|
46
44
|
"json-schema-merge-allof": "^0.6.0",
|
|
47
45
|
"jsonpointer": "^5.0.0",
|
|
48
46
|
"lodash": "^4.17.15",
|
|
47
|
+
"lodash-es": "^4.17.15",
|
|
49
48
|
"nanoid": "^3.1.23",
|
|
50
49
|
"prop-types": "^15.7.2",
|
|
51
|
-
"react-is": "
|
|
50
|
+
"react-is": "16.9.0"
|
|
52
51
|
},
|
|
53
52
|
"devDependencies": {
|
|
54
53
|
"@babel/cli": "^7.4.4",
|
|
@@ -60,19 +59,21 @@
|
|
|
60
59
|
"@babel/preset-env": "^7.4.5",
|
|
61
60
|
"@babel/preset-react": "^7.0.0",
|
|
62
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",
|
|
63
66
|
"atob": "^2.0.3",
|
|
64
|
-
"babel-eslint": "^10.0.1",
|
|
65
67
|
"babel-loader": "^8.0.6",
|
|
66
68
|
"chai": "^3.3.0",
|
|
67
69
|
"concurrently": "^5.1.0",
|
|
68
70
|
"cross-env": "^7.0.2",
|
|
69
71
|
"css-loader": "^0.23.1",
|
|
70
|
-
"eslint": "^
|
|
71
|
-
"eslint-
|
|
72
|
-
"eslint-plugin-
|
|
73
|
-
"eslint-plugin-
|
|
74
|
-
"eslint-plugin-
|
|
75
|
-
"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",
|
|
76
77
|
"estraverse": "^4.2.0",
|
|
77
78
|
"estraverse-fb": "^1.3.1",
|
|
78
79
|
"express": "^4.14.0",
|
|
@@ -96,8 +97,6 @@
|
|
|
96
97
|
"rimraf": "^2.5.4",
|
|
97
98
|
"sinon": "^9.0.2",
|
|
98
99
|
"style-loader": "^2.0.0",
|
|
99
|
-
"webpack": "^4.42.1",
|
|
100
|
-
"webpack-cli": "^3.1.2",
|
|
101
100
|
"webpack-dev-middleware": "^3.4.0",
|
|
102
101
|
"webpack-hot-middleware": "^2.13.2"
|
|
103
102
|
},
|
|
@@ -119,5 +118,5 @@
|
|
|
119
118
|
"publishConfig": {
|
|
120
119
|
"access": "public"
|
|
121
120
|
},
|
|
122
|
-
"gitHead": "
|
|
121
|
+
"gitHead": "e4f1545e7a658ad6a0de476682131680c04982f9"
|
|
123
122
|
}
|
|
@@ -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,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9jb21wb25lbnRzL0FkZEJ1dHRvbi5qcyJdLCJuYW1lcyI6WyJBZGRCdXR0b24iLCJjbGFzc05hbWUiLCJvbkNsaWNrIiwiZGlzYWJsZWQiXSwibWFwcGluZ3MiOiI7Ozs7Ozs7QUFBQTs7QUFDQTs7OztBQUVlLFNBQVNBLFNBQVQsT0FBcUQ7QUFBQSxNQUFoQ0MsU0FBZ0M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BvbkNsaWNrPXtvbkNsaWNrfVxuICAgICAgICAgIGRpc2FibGVkPXtkaXNhYmxlZH1cbiAgICAgICAgLz5cbiAgICAgIDwvcD5cbiAgICA8L2Rpdj5cbiAgKTtcbn1cbiJdfQ==
|
|
@@ -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,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9jb21wb25lbnRzL0Vycm9yTGlzdC5qcyJdLCJuYW1lcyI6WyJFcnJvckxpc3QiLCJwcm9wcyIsImVycm9ycyIsIm1hcCIsImVycm9yIiwiaSIsInN0YWNrIl0sIm1hcHBpbmdzIjoiOzs7Ozs7O0FBQUE7Ozs7QUFFZSxTQUFTQSxTQUFULENBQW1CQyxLQUFuQixFQUEwQjtBQUFBLE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