forked from formio/react
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtypes.js
More file actions
38 lines (31 loc) · 900 Bytes
/
types.js
File metadata and controls
38 lines (31 loc) · 900 Bytes
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
37
38
import PropTypes from 'prop-types';
export const AllItemsPerPage = 'all';
export const Column = PropTypes.shape({
key: PropTypes.string.isRequired,
sort: PropTypes.oneOfType([
PropTypes.bool,
PropTypes.string,
PropTypes.func,
]),
title: PropTypes.string,
value: PropTypes.func,
width: PropTypes.number,
});
export const Columns = PropTypes.arrayOf(Column);
export const Operation = PropTypes.shape({
action: PropTypes.string.isRequired,
buttonType: PropTypes.string,
icon: PropTypes.string,
permissionsResolver: PropTypes.func,
title: PropTypes.string,
});
export const Operations = PropTypes.arrayOf(Operation);
export const PageSize = PropTypes.oneOfType([
PropTypes.number,
PropTypes.shape({
label: PropTypes.string,
value: PropTypes.number,
}),
PropTypes.oneOf([AllItemsPerPage]),
]);
export const PageSizes = PropTypes.arrayOf(PageSize);