-
Notifications
You must be signed in to change notification settings - Fork 2.2k
/
Copy pathtypes.js
36 lines (34 loc) · 1.05 KB
/
types.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import PropTypes from "prop-types";
export const registry = PropTypes.shape({
ArrayFieldTemplate: PropTypes.func,
FieldTemplate: PropTypes.func,
ObjectFieldTemplate: PropTypes.func,
definitions: PropTypes.object.isRequired,
fields: PropTypes.objectOf(PropTypes.func).isRequired,
formContext: PropTypes.object.isRequired,
widgets: PropTypes.objectOf(
PropTypes.oneOfType([PropTypes.func, PropTypes.object])
).isRequired,
});
export const fieldProps = {
autofocus: PropTypes.bool,
disabled: PropTypes.bool,
errorSchema: PropTypes.object,
formData: PropTypes.any,
idSchema: PropTypes.object,
onBlur: PropTypes.func,
onChange: PropTypes.func.isRequired,
onFocus: PropTypes.func,
rawErrors: PropTypes.arrayOf(PropTypes.string),
readonly: PropTypes.bool,
registry: registry.isRequired,
required: PropTypes.bool,
schema: PropTypes.object.isRequired,
uiSchema: PropTypes.shape({
"ui:options": PropTypes.shape({
addable: PropTypes.bool,
orderable: PropTypes.bool,
removable: PropTypes.bool,
}),
}),
};