@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.
- 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/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 +3 -3
- 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 -917
- 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/SubmitButton.js +0 -30
- 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 -73
- package/dist/cjs/index.js +0 -28
- package/dist/cjs/types.js +0 -47
- package/dist/cjs/utils.js +0 -1419
- 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 -899
- 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/SubmitButton.js +0 -19
- 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 -43
- package/dist/es/index.js +0 -6
- package/dist/es/types.js +0 -34
- package/dist/es/utils.js +0 -1317
- package/dist/es/validate.js +0 -338
- package/dist/es/withTheme.js +0 -36
- package/dist/react-jsonschema-form.js +0 -11
- package/dist/react-jsonschema-form.js.map +0 -1
- 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 -899
- 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/SubmitButton.js +0 -19
- 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 -43
- package/lib/index.js +0 -6
- package/lib/types.js +0 -34
- package/lib/utils.js +0 -1317
- package/lib/validate.js +0 -338
- 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
|
+
};
|
package/dist/index.d.ts
ADDED
|
@@ -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
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
|
@@ -72,9 +72,9 @@ declare module '@rjsf/core' {
|
|
|
72
72
|
}
|
|
73
73
|
|
|
74
74
|
export type UISchemaSubmitButtonOptions = {
|
|
75
|
-
submitText
|
|
76
|
-
norender
|
|
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.
|
|
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": "
|
|
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-
|
|
21
|
-
"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"
|
|
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/
|
|
30
|
-
"module": "dist/
|
|
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": "
|
|
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": "^
|
|
72
|
-
"eslint-
|
|
73
|
-
"eslint-plugin-
|
|
74
|
-
"eslint-plugin-
|
|
75
|
-
"eslint-plugin-
|
|
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": "
|
|
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==
|