2020-10-11 21:31:57 +08:00
|
|
|
import PropTypes, { withUndefined } from '../_util/vue-types';
|
2020-10-16 18:47:28 +08:00
|
|
|
import { SelectProps } from '../select';
|
2020-10-22 10:06:57 +08:00
|
|
|
import { tuple } from '../_util/type';
|
2018-07-11 17:51:20 +08:00
|
|
|
|
|
|
|
export const TreeData = PropTypes.shape({
|
|
|
|
key: PropTypes.string,
|
|
|
|
value: PropTypes.string,
|
2020-10-22 11:35:05 +08:00
|
|
|
label: PropTypes.VNodeChild,
|
|
|
|
slots: PropTypes.object,
|
2018-07-11 17:51:20 +08:00
|
|
|
children: PropTypes.array,
|
2019-01-12 11:33:27 +08:00
|
|
|
}).loose;
|
2018-07-11 17:51:20 +08:00
|
|
|
|
|
|
|
export const TreeSelectProps = () => ({
|
2020-10-17 22:19:52 +08:00
|
|
|
...SelectProps(),
|
2020-10-10 18:16:28 +08:00
|
|
|
autofocus: PropTypes.looseBool,
|
2018-12-25 12:00:39 +08:00
|
|
|
dropdownStyle: PropTypes.object,
|
2020-10-11 21:31:57 +08:00
|
|
|
filterTreeNode: withUndefined(PropTypes.oneOfType([Function, Boolean])),
|
2018-12-25 12:00:39 +08:00
|
|
|
getPopupContainer: PropTypes.func,
|
2020-10-10 18:16:28 +08:00
|
|
|
labelInValue: PropTypes.looseBool,
|
2018-12-25 12:00:39 +08:00
|
|
|
loadData: PropTypes.func,
|
|
|
|
maxTagCount: PropTypes.number,
|
2020-10-22 11:35:05 +08:00
|
|
|
maxTagPlaceholder: PropTypes.VNodeChild,
|
2020-01-19 17:01:41 +08:00
|
|
|
value: PropTypes.oneOfType([
|
|
|
|
PropTypes.string,
|
|
|
|
PropTypes.object,
|
|
|
|
PropTypes.array,
|
|
|
|
PropTypes.number,
|
|
|
|
]),
|
|
|
|
defaultValue: PropTypes.oneOfType([
|
|
|
|
PropTypes.string,
|
|
|
|
PropTypes.object,
|
|
|
|
PropTypes.array,
|
|
|
|
PropTypes.number,
|
|
|
|
]),
|
2020-10-10 18:16:28 +08:00
|
|
|
multiple: PropTypes.looseBool,
|
2020-10-22 11:35:05 +08:00
|
|
|
notFoundContent: PropTypes.VNodeChild,
|
2018-07-11 17:51:20 +08:00
|
|
|
searchPlaceholder: PropTypes.string,
|
2019-01-07 20:59:02 +08:00
|
|
|
searchValue: PropTypes.string,
|
2020-10-22 10:06:57 +08:00
|
|
|
showCheckedStrategy: PropTypes.oneOf(tuple('SHOW_ALL', 'SHOW_PARENT', 'SHOW_CHILD')),
|
2020-10-22 11:35:05 +08:00
|
|
|
suffixIcon: PropTypes.VNodeChild,
|
2020-10-20 17:55:10 +08:00
|
|
|
treeCheckable: PropTypes.looseBool,
|
2020-10-10 18:16:28 +08:00
|
|
|
treeCheckStrictly: PropTypes.looseBool,
|
2018-12-25 12:00:39 +08:00
|
|
|
treeData: PropTypes.arrayOf(Object),
|
2020-10-11 21:31:57 +08:00
|
|
|
treeDataSimpleMode: withUndefined(PropTypes.oneOfType([PropTypes.looseBool, Object])),
|
2018-12-25 12:00:39 +08:00
|
|
|
|
2018-07-11 17:51:20 +08:00
|
|
|
dropdownClassName: PropTypes.string,
|
2020-10-10 18:16:28 +08:00
|
|
|
dropdownMatchSelectWidth: PropTypes.looseBool,
|
|
|
|
treeDefaultExpandAll: PropTypes.looseBool,
|
2018-12-26 16:33:24 +08:00
|
|
|
treeExpandedKeys: PropTypes.array,
|
2020-10-10 18:16:28 +08:00
|
|
|
treeIcon: PropTypes.looseBool,
|
2018-12-26 16:33:24 +08:00
|
|
|
treeDefaultExpandedKeys: PropTypes.array,
|
2018-07-11 17:51:20 +08:00
|
|
|
treeNodeFilterProp: PropTypes.string,
|
|
|
|
treeNodeLabelProp: PropTypes.string,
|
2020-05-19 14:40:41 +08:00
|
|
|
replaceFields: PropTypes.object.def({}),
|
2020-10-22 11:35:05 +08:00
|
|
|
clearIcon: PropTypes.VNodeChild,
|
|
|
|
removeIcon: PropTypes.VNodeChild,
|
2020-08-12 21:35:45 +08:00
|
|
|
|
|
|
|
onSelect: PropTypes.func,
|
|
|
|
onChange: PropTypes.func,
|
|
|
|
onSearch: PropTypes.func,
|
|
|
|
onTreeExpand: PropTypes.func,
|
|
|
|
'onUpdate:treeExpandedKeys': PropTypes.func,
|
|
|
|
'onUpdate:searchValue': PropTypes.func,
|
|
|
|
'onUpdate:value': PropTypes.func,
|
2019-01-12 11:33:27 +08:00
|
|
|
});
|