@qsxy/element-plus-react 1.0.2 → 1.0.3
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/Alert/Alert.d.ts +7 -0
- package/dist/Alert/Alert.js +98 -0
- package/dist/Alert/index.d.ts +2 -0
- package/dist/Alert/index.js +1 -0
- package/dist/Alert/typings.d.ts +45 -0
- package/dist/Alert/typings.js +1 -0
- package/dist/Card/Card.js +5 -3
- package/dist/Cascader/useCascader.d.ts +0 -14
- package/dist/Cascader/useCascader.js +33 -32
- package/dist/Checkbox/Checkbox.js +3 -2
- package/dist/ConfigProvider/ConfigProvider.js +2 -24
- package/dist/ConfigProvider/ConfigProviderContext.js +1 -1
- package/dist/ConfigProvider/typings.d.ts +1 -1
- package/dist/Container/Main.d.ts +1 -1
- package/dist/Container/typings.d.ts +1 -1
- package/dist/Dialog/Dialog.js +5 -12
- package/dist/Input/Input.js +68 -43
- package/dist/Input/TextArea.js +1 -1
- package/dist/Input/typings.d.ts +42 -1
- package/dist/Input/utils.d.ts +1 -0
- package/dist/Input/utils.js +5 -1
- package/dist/InputNumber/InputNumber.js +351 -141
- package/dist/InputNumber/typings.d.ts +15 -1
- package/dist/Loading/Loading.js +5 -2
- package/dist/Menu/Menu.js +25 -1
- package/dist/Menu/MenuItem.js +4 -2
- package/dist/Menu/SubMenu.js +2 -2
- package/dist/Menu/SubMenuCollapseTransition.js +14 -9
- package/dist/Menu/typings.d.ts +2 -1
- package/dist/Message/Message.js +51 -23
- package/dist/Message/index.js +8 -10
- package/dist/Message/typings.d.ts +8 -5
- package/dist/MessageBox/MessageBox.js +52 -30
- package/dist/MessageBox/index.d.ts +2 -1
- package/dist/MessageBox/index.js +4 -2
- package/dist/MessageBox/typings.d.ts +3 -0
- package/dist/Notification/Notification.js +26 -19
- package/dist/Select/SelectContext.d.ts +2 -1
- package/dist/Select/SelectContext.js +2 -1
- package/dist/Select/SelectCore.js +13 -7
- package/dist/Select/SelectDropdown.js +23 -15
- package/dist/Select/index.d.ts +1 -1
- package/dist/Select/typings.d.ts +13 -9
- package/dist/Select/useSelect.d.ts +13 -10
- package/dist/Select/useSelect.js +34 -26
- package/dist/Space/Space.d.ts +4 -0
- package/dist/Space/Space.js +128 -0
- package/dist/Space/SpaceItem.d.ts +7 -0
- package/dist/Space/SpaceItem.js +14 -0
- package/dist/Space/index.d.ts +3 -0
- package/dist/Space/index.js +2 -0
- package/dist/Space/typings.d.ts +26 -0
- package/dist/Space/typings.js +1 -0
- package/dist/Space/useSpace.d.ts +7 -0
- package/dist/Space/useSpace.js +104 -0
- package/dist/Statistic/Statistic.d.ts +4 -0
- package/dist/Statistic/Statistic.js +92 -0
- package/dist/Statistic/index.d.ts +2 -0
- package/dist/Statistic/index.js +1 -0
- package/dist/Statistic/typings.d.ts +28 -0
- package/dist/Statistic/typings.js +1 -0
- package/dist/Switch/Switch.js +2 -2
- package/dist/Table/Table.js +3 -0
- package/dist/Table/typings.d.ts +2 -0
- package/dist/Tag/typings.d.ts +1 -1
- package/dist/Text/Text.d.ts +4 -0
- package/dist/Text/Text.js +84 -0
- package/dist/Text/index.d.ts +2 -0
- package/dist/Text/index.js +1 -0
- package/dist/Text/typings.d.ts +15 -0
- package/dist/Text/typings.js +1 -0
- package/dist/Tree/CollapseTransition.d.ts +7 -0
- package/dist/Tree/CollapseTransition.js +60 -0
- package/dist/Tree/Tree.d.ts +3 -140
- package/dist/Tree/Tree.js +350 -77
- package/dist/Tree/TreeContext.d.ts +9 -0
- package/dist/Tree/TreeContext.js +14 -0
- package/dist/Tree/TreeNode.d.ts +5 -3
- package/dist/Tree/TreeNode.js +321 -331
- package/dist/Tree/TreeNodeContent.d.ts +9 -0
- package/dist/Tree/TreeNodeContent.js +22 -0
- package/dist/Tree/index.d.ts +3 -8
- package/dist/Tree/index.js +1 -4
- package/dist/Tree/model/node.d.ts +62 -0
- package/dist/Tree/model/node.js +601 -0
- package/dist/Tree/model/tree-store.d.ts +52 -0
- package/dist/Tree/model/tree-store.js +510 -0
- package/dist/Tree/model/useDragNode.d.ts +30 -0
- package/dist/Tree/model/useDragNode.js +293 -0
- package/dist/Tree/model/useKeydown.d.ts +0 -0
- package/dist/Tree/model/useKeydown.js +104 -0
- package/dist/Tree/model/useNodeExpandEventBroadcast.d.ts +15 -0
- package/dist/Tree/model/useNodeExpandEventBroadcast.js +54 -0
- package/dist/Tree/model/util.d.ts +7 -0
- package/dist/Tree/model/util.js +24 -0
- package/dist/Tree/typings.d.ts +225 -114
- package/dist/TreeSelect/TreeSelect.d.ts +2 -10
- package/dist/TreeSelect/TreeSelect.js +90 -566
- package/dist/TreeSelect/TreeSelectOption.d.ts +6 -0
- package/dist/TreeSelect/TreeSelectOption.js +62 -0
- package/dist/TreeSelect/cacheOptions.d.ts +9 -0
- package/dist/TreeSelect/cacheOptions.js +22 -0
- package/dist/TreeSelect/index.d.ts +0 -1
- package/dist/TreeSelect/typings.d.ts +11 -63
- package/dist/TreeSelect/useSelect.d.ts +125 -0
- package/dist/TreeSelect/useSelect.js +104 -0
- package/dist/TreeSelect/useTree.d.ts +130 -0
- package/dist/TreeSelect/useTree.js +285 -0
- package/dist/TreeSelect/utils.d.ts +10 -0
- package/dist/TreeSelect/utils.js +38 -0
- package/dist/Upload/UploadContent.js +2 -0
- package/dist/Upload/ajax.js +3 -0
- package/dist/Upload/typings.d.ts +4 -0
- package/dist/Util/aria.js +12 -12
- package/dist/Util/base.d.ts +5 -0
- package/dist/Util/base.js +140 -1
- package/dist/config/Constants.d.ts +3 -0
- package/dist/config/Constants.js +8 -0
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/index.js +1 -0
- package/dist/hooks/popperPropsUtils.js +1 -1
- package/dist/hooks/treePropsUtils.d.ts +3 -3
- package/dist/hooks/treePropsUtils.js +2 -2
- package/dist/hooks/useConfigProvider.d.ts +27 -0
- package/dist/hooks/useConfigProvider.js +78 -0
- package/dist/hooks/useResizeObserver.js +6 -6
- package/dist/index.css +1 -1
- package/dist/index.d.ts +18 -11
- package/dist/index.js +11 -5
- package/package.json +1 -1
- package/theme-chalk/alert.scss +115 -0
- package/theme-chalk/aside.scss +8 -8
- package/theme-chalk/button-group.scss +80 -80
- package/theme-chalk/button.scss +304 -304
- package/theme-chalk/calendar/date-table.scss +164 -164
- package/theme-chalk/checkbox.scss +34 -0
- package/theme-chalk/color/index.scss +20 -20
- package/theme-chalk/common/transition.scss +142 -142
- package/theme-chalk/container.scss +14 -14
- package/theme-chalk/dark/css-vars.scss +39 -39
- package/theme-chalk/dark/var.scss +225 -225
- package/theme-chalk/date-picker.scss +12 -12
- package/theme-chalk/drawer.scss +1 -0
- package/theme-chalk/footer.scss +12 -12
- package/theme-chalk/header.scss +12 -12
- package/theme-chalk/index.scss +4 -0
- package/theme-chalk/input/input-range.scss +2 -1
- package/theme-chalk/input/input.scss +439 -424
- package/theme-chalk/input-number.bak +172 -0
- package/theme-chalk/input-number.scss +192 -172
- package/theme-chalk/link.scss +87 -87
- package/theme-chalk/main.scss +14 -14
- package/theme-chalk/menu.scss +353 -353
- package/theme-chalk/message.scss +104 -178
- package/theme-chalk/mixins/_button.scss +224 -224
- package/theme-chalk/mixins/_col.scss +33 -33
- package/theme-chalk/mixins/_var.scss +67 -67
- package/theme-chalk/mixins/config.scss +5 -5
- package/theme-chalk/mixins/function.scss +99 -99
- package/theme-chalk/mixins/mixins.scss +240 -240
- package/theme-chalk/mixins/utils.scss +39 -39
- package/theme-chalk/notification.bak +156 -0
- package/theme-chalk/notification.scss +109 -156
- package/theme-chalk/popper.scss +104 -104
- package/theme-chalk/radio-button.scss +169 -169
- package/theme-chalk/select/index.scss +278 -272
- package/theme-chalk/space.scss +20 -0
- package/theme-chalk/statistic.scss +35 -0
- package/theme-chalk/switch.scss +300 -300
- package/theme-chalk/tag.scss +181 -181
- package/theme-chalk/text.scss +48 -0
- package/theme-chalk/transition.scss +34 -4
- package/theme-chalk/tree-select.scss +41 -25
- package/theme-chalk/tree.scss +136 -0
- package/theme-chalk/var.scss +83 -83
- package/dist/Input/Input.1.d.ts +0 -16
- package/dist/Input/Input.1.js +0 -376
- package/dist/Tree/DirectoryTree.d.ts +0 -15
- package/dist/Tree/DirectoryTree.js +0 -183
- package/dist/Tree/DropIndicator.d.ts +0 -8
- package/dist/Tree/DropIndicator.js +0 -34
- package/dist/Tree/Indent.d.ts +0 -9
- package/dist/Tree/Indent.js +0 -25
- package/dist/Tree/MotionTreeNode.d.ts +0 -14
- package/dist/Tree/MotionTreeNode.js +0 -125
- package/dist/Tree/NodeList.d.ts +0 -50
- package/dist/Tree/NodeList.js +0 -301
- package/dist/Tree/RCTree.d.ts +0 -248
- package/dist/Tree/RCTree.js +0 -1216
- package/dist/Tree/contextTypes.d.ts +0 -69
- package/dist/Tree/contextTypes.js +0 -9
- package/dist/Tree/typings.tsx--bak +0 -245
- package/dist/Tree/useUnmount.d.ts +0 -5
- package/dist/Tree/useUnmount.js +0 -34
- package/dist/Tree/util.d.ts +0 -51
- package/dist/Tree/util.js +0 -303
- package/dist/Tree/utils/conductUtil.d.ts +0 -17
- package/dist/Tree/utils/conductUtil.js +0 -209
- package/dist/Tree/utils/dictUtil.d.ts +0 -13
- package/dist/Tree/utils/dictUtil.js +0 -75
- package/dist/Tree/utils/diffUtil.d.ts +0 -7
- package/dist/Tree/utils/diffUtil.js +0 -48
- package/dist/Tree/utils/dropIndicator.d.ts +0 -11
- package/dist/Tree/utils/dropIndicator.js +0 -36
- package/dist/Tree/utils/iconUtil.d.ts +0 -5
- package/dist/Tree/utils/iconUtil.js +0 -62
- package/dist/Tree/utils/keyUtil.d.ts +0 -2
- package/dist/Tree/utils/keyUtil.js +0 -3
- package/dist/Tree/utils/motion.d.ts +0 -10
- package/dist/Tree/utils/motion.js +0 -54
- package/dist/Tree/utils/pickAttrs.d.ts +0 -11
- package/dist/Tree/utils/pickAttrs.js +0 -51
- package/dist/Tree/utils/treeUtil.d.ts +0 -86
- package/dist/Tree/utils/treeUtil.js +0 -364
- package/dist/TreeSelect/Utils.d.ts +0 -3
- package/dist/TreeSelect/Utils.js +0 -20
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
var _templateObject;
|
|
2
|
+
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
3
|
+
import { useMount } from 'ahooks';
|
|
4
|
+
import classNames from 'classnames';
|
|
5
|
+
import React, { useCallback, useContext, useMemo, useRef } from 'react';
|
|
6
|
+
import { SelectContext } from "../Select/SelectContext";
|
|
7
|
+
import { useClassNames } from "../hooks";
|
|
8
|
+
var TreeSelectOption = function TreeSelectOption(props) {
|
|
9
|
+
var _useClassNames = useClassNames('select-dropdown'),
|
|
10
|
+
e = _useClassNames.e,
|
|
11
|
+
is = _useClassNames.is;
|
|
12
|
+
var _useContext = useContext(SelectContext),
|
|
13
|
+
selectedValue = _useContext.value,
|
|
14
|
+
hoverValue = _useContext.hover,
|
|
15
|
+
setHover = _useContext.setHover,
|
|
16
|
+
multiple = _useContext.multiple,
|
|
17
|
+
cachedOptions = _useContext.cachedOptions;
|
|
18
|
+
var value = props.value,
|
|
19
|
+
label = props.label,
|
|
20
|
+
disabled = props.disabled;
|
|
21
|
+
var elRef = useRef(null);
|
|
22
|
+
useMount(function () {
|
|
23
|
+
cachedOptions.current.set(value, {
|
|
24
|
+
value: value,
|
|
25
|
+
label: label,
|
|
26
|
+
disabled: disabled
|
|
27
|
+
});
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
/** 选中回调 */
|
|
31
|
+
var handleOnClick = useCallback(function (event) {
|
|
32
|
+
event.stopPropagation();
|
|
33
|
+
elRef.current.parentElement.click();
|
|
34
|
+
}, []);
|
|
35
|
+
|
|
36
|
+
/** 是否已选中 */
|
|
37
|
+
var selected = useMemo(function () {
|
|
38
|
+
if (multiple && selectedValue instanceof Array) {
|
|
39
|
+
return selectedValue.includes(value);
|
|
40
|
+
}
|
|
41
|
+
return value === selectedValue;
|
|
42
|
+
}, [multiple, value, selectedValue]);
|
|
43
|
+
return /*#__PURE__*/React.createElement("li", {
|
|
44
|
+
className: classNames(e(_templateObject || (_templateObject = _taggedTemplateLiteral(["item"]))), is({
|
|
45
|
+
disabled: disabled,
|
|
46
|
+
selected: selected,
|
|
47
|
+
hovering: value === hoverValue
|
|
48
|
+
}), props.className),
|
|
49
|
+
style: props.style,
|
|
50
|
+
title: label + '',
|
|
51
|
+
onClick: handleOnClick,
|
|
52
|
+
onMouseEnter: function onMouseEnter() {
|
|
53
|
+
return setHover(value);
|
|
54
|
+
},
|
|
55
|
+
onMouseLeave: function onMouseLeave() {
|
|
56
|
+
return setHover(selectedValue);
|
|
57
|
+
},
|
|
58
|
+
ref: elRef
|
|
59
|
+
}, props.children || /*#__PURE__*/React.createElement("span", null, label));
|
|
60
|
+
};
|
|
61
|
+
TreeSelectOption.displayName = 'ElOption';
|
|
62
|
+
export default TreeSelectOption;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React, { RefObject } from 'react';
|
|
2
|
+
import { SelectRef } from '../Select';
|
|
3
|
+
import { CacheOption } from './typings';
|
|
4
|
+
interface Props {
|
|
5
|
+
data: CacheOption[];
|
|
6
|
+
select: RefObject<SelectRef>;
|
|
7
|
+
}
|
|
8
|
+
declare const CacheOptions: (props: Props) => React.JSX.Element;
|
|
9
|
+
export default CacheOptions;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import React, { useEffect } from 'react';
|
|
2
|
+
var CacheOptions = function CacheOptions(props) {
|
|
3
|
+
useEffect(function () {
|
|
4
|
+
props.data.forEach(function (item) {
|
|
5
|
+
// @ts-ignore
|
|
6
|
+
if (!props.select.current.cachedOptions.current.has(item.value)) {
|
|
7
|
+
// TODO: the type of 'item' is not compatible with the type of 'cachedOptions',
|
|
8
|
+
// which may indicate potential runtime issues.
|
|
9
|
+
// @ts-expect-error
|
|
10
|
+
props.select.current.cachedOptions.current.set(item.value, item);
|
|
11
|
+
}
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
// fork from packages/select/src/useSelect.ts#330
|
|
15
|
+
// const inputs = selectRef.current.?.querySelectorAll('input') || [];
|
|
16
|
+
// if (isClient && !Array.from(inputs).includes(document.activeElement as HTMLInputElement)) {
|
|
17
|
+
// select.setSelected();
|
|
18
|
+
// }
|
|
19
|
+
}, [props.data]);
|
|
20
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null);
|
|
21
|
+
};
|
|
22
|
+
export default CacheOptions;
|
|
@@ -1,65 +1,13 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
export type ValueType = React.AllHTMLAttributes<HTMLInputElement>['value'];
|
|
7
|
-
export type TreeSelectRef = {
|
|
8
|
-
inputInstance?: InputRef;
|
|
9
|
-
searchInstance?: InputRef;
|
|
10
|
-
popperInstRef: PopperOptionRef;
|
|
11
|
-
label: string | string[];
|
|
12
|
-
setLabel: (label: string) => void;
|
|
13
|
-
getValue: () => ValueType;
|
|
14
|
-
setValue: (value: ValueType) => void;
|
|
15
|
-
onClear: (event?: any) => void;
|
|
16
|
-
setVisible: (value: boolean) => void;
|
|
17
|
-
};
|
|
18
|
-
export interface TreeSelectProps<T = DataNode, V = ValueType> extends Omit<FormControlBaseProps<V>, 'onChange'>, Omit<TreeProps<T>, 'children' | 'style'>, Omit<BaseProps, 'children'>, NativeProps, AnimationEventProps {
|
|
19
|
-
/** 表单提交给后台表示节点名称的name */
|
|
20
|
-
labelName?: string;
|
|
21
|
-
/** 是否可以清空选项 */
|
|
22
|
-
clearable?: boolean;
|
|
23
|
-
/** 占位符 */
|
|
24
|
-
placeholder?: string;
|
|
25
|
-
filterable?: boolean;
|
|
26
|
-
/** 选择任意级别 */
|
|
27
|
-
checkStrictly?: boolean;
|
|
28
|
-
/** 多选时是否将选中值按文字的形式展示 */
|
|
29
|
-
collapseTags?: boolean;
|
|
30
|
-
/** 是否纯文本模式,即无边框 */
|
|
31
|
-
plain?: boolean;
|
|
32
|
-
/** */
|
|
33
|
-
required?: boolean;
|
|
34
|
-
/** 下拉项最大宽度 */
|
|
35
|
-
maxWidth?: number;
|
|
36
|
-
/** 表单校验错误提示 */
|
|
37
|
-
error?: boolean;
|
|
38
|
-
/** 表单校验警告提示 */
|
|
39
|
-
warning?: boolean;
|
|
40
|
-
/** 表是否加载中 */
|
|
41
|
-
loading?: boolean;
|
|
42
|
-
/** 输入框前置内容,只对 type="text" 有效 */
|
|
43
|
-
prepend?: React.ReactElement<any> | string | number;
|
|
44
|
-
/** 输入框后置内容,只对 type="text" 有效 */
|
|
45
|
-
append?: React.ReactElement | string | number;
|
|
46
|
-
/** 选项为空时显示的文字 */
|
|
47
|
-
noDataText?: React.ReactElement | string;
|
|
48
|
-
/** 远程加载时显示的文字 */
|
|
49
|
-
loadingText?: React.ReactElement | string;
|
|
50
|
-
/** 点击节点前的回调,返回true触发onClick事件和onSelect事件 */
|
|
51
|
-
onBeforeClick?: (node: T, event: React.MouseEvent<any>) => boolean;
|
|
52
|
-
/** 点击节点事件 */
|
|
53
|
-
onClickNode?: (node: T, event: React.MouseEvent<any>) => boolean;
|
|
54
|
-
/** 选中值发生变化时触发 */
|
|
55
|
-
onChange?: (value: ValueType | Key[], label?: string | string[]) => void;
|
|
56
|
-
/** 数据加载成功时调用 */
|
|
57
|
-
onLoadSuccess?: (value: ValueType | Key[], label?: string[]) => void;
|
|
1
|
+
import { SelectProps, SelectRef } from '../Select';
|
|
2
|
+
import { TreeProps, TreeRef } from '../Tree/typings';
|
|
3
|
+
export interface TreeSelectProps extends Omit<TreeProps, 'children'>, SelectProps {
|
|
4
|
+
/** 懒加载节点的缓存数据,结构与数据相同,用于获取未加载数据的标签 */
|
|
5
|
+
cacheData?: any[];
|
|
58
6
|
}
|
|
59
|
-
export type
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
nativeEvent: React.MouseEvent<any>;
|
|
7
|
+
export type CacheOption = {
|
|
8
|
+
value: string | number | boolean | object;
|
|
9
|
+
currentLabel: string | number;
|
|
10
|
+
label: string | number;
|
|
11
|
+
isDisabled: boolean;
|
|
65
12
|
};
|
|
13
|
+
export type TreeSelectRef = Pick<TreeRef, 'filter' | 'updateKeyChildren' | 'getCheckedNodes' | 'setCheckedNodes' | 'getCheckedKeys' | 'setCheckedKeys' | 'setChecked' | 'getHalfCheckedNodes' | 'getHalfCheckedKeys' | 'getCurrentKey' | 'getCurrentNode' | 'setCurrentKey' | 'setCurrentNode' | 'getNode' | 'remove' | 'append' | 'insertBefore' | 'insertAfter'> & Pick<SelectRef, 'getValue' | 'setVisible'>;
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import { RefObject } from 'react';
|
|
2
|
+
import { SelectRef } from '../Select';
|
|
3
|
+
import { TreeRef } from '../Tree/typings';
|
|
4
|
+
import { TreeSelectProps } from './typings';
|
|
5
|
+
declare const useSelect: (props: TreeSelectProps, { selectRef, treeRef, key }: {
|
|
6
|
+
selectRef: RefObject<SelectRef>;
|
|
7
|
+
treeRef: RefObject<TreeRef>;
|
|
8
|
+
key: string;
|
|
9
|
+
}) => {
|
|
10
|
+
className: string;
|
|
11
|
+
style: import("react").CSSProperties & Partial<Record<never, string>>;
|
|
12
|
+
valueKey: string;
|
|
13
|
+
popperClass: string;
|
|
14
|
+
filterMethod: (keyword?: string) => void;
|
|
15
|
+
cacheData?: any[];
|
|
16
|
+
data?: import("../Tree/typings").TreeData;
|
|
17
|
+
draggable?: boolean;
|
|
18
|
+
icon?: import("..").IconName;
|
|
19
|
+
classPrefix?: string;
|
|
20
|
+
popperStyle?: import("react").CSSProperties;
|
|
21
|
+
props?: import("../Tree/typings").TreeOptionProps;
|
|
22
|
+
indent?: number;
|
|
23
|
+
load?: import("../Tree/typings").LoadFunction;
|
|
24
|
+
lazy?: boolean;
|
|
25
|
+
accordion?: boolean;
|
|
26
|
+
emptyText?: string;
|
|
27
|
+
defaultExpandAll?: boolean;
|
|
28
|
+
onCurrentChange?: (nodeData: import("../Tree/typings").TreeNodeData, node: import("..").TreeNode) => void;
|
|
29
|
+
renderAfterExpand?: boolean;
|
|
30
|
+
nodeKey?: string;
|
|
31
|
+
checkStrictly?: boolean;
|
|
32
|
+
expandOnClickNode?: boolean;
|
|
33
|
+
checkOnClickNode?: boolean;
|
|
34
|
+
checkOnClickLeaf?: boolean;
|
|
35
|
+
checkDescendants?: boolean;
|
|
36
|
+
autoExpandParent?: boolean;
|
|
37
|
+
defaultCheckedKeys?: import("../Tree/typings").TreeKey[];
|
|
38
|
+
defaultExpandedKeys?: import("../Tree/typings").TreeKey[];
|
|
39
|
+
currentNodeKey?: import("../Tree/typings").TreeKey;
|
|
40
|
+
renderContent?: import("../Tree/typings").RenderContentFunction;
|
|
41
|
+
showCheckbox?: boolean;
|
|
42
|
+
allowDrag?: import("../Tree/typings").AllowDragFunction;
|
|
43
|
+
allowDrop?: import("../Tree/typings").AllowDropFunction;
|
|
44
|
+
highlightCurrent?: boolean;
|
|
45
|
+
filterNodeMethod?: import("../Tree/typings").FilterNodeMethodFunction;
|
|
46
|
+
renderEmpty?: () => import("react").ReactNode;
|
|
47
|
+
onNodeClick?: (nodeData: import("../Tree/typings").TreeNodeData, node: import("..").TreeNode, instance: RefObject<import("../Tree/typings").TreeNodeRef>, e: import("react").MouseEvent<HTMLDivElement, MouseEvent>) => void;
|
|
48
|
+
onNodeContextmenu?: (event: import("react").MouseEvent<HTMLDivElement, MouseEvent>, nodeData: import("../Tree/typings").TreeNodeData, node: import("..").TreeNode, instance: RefObject<import("../Tree/typings").TreeNodeRef>) => void;
|
|
49
|
+
onCheckChange?: (nodeData: import("../Tree/typings").TreeNodeData, checked: boolean, indeterminate: boolean) => void;
|
|
50
|
+
onCheck?: (nodeData: import("../Tree/typings").TreeNodeData, checkedInfo: import("../Tree/typings").CheckedInfo) => void;
|
|
51
|
+
onNodeExpand?: (nodeData: import("../Tree/typings").TreeNodeData, node: import("..").TreeNode, instance: RefObject<import("../Tree/typings").TreeNodeRef>) => void;
|
|
52
|
+
onNodeCollapse?: (nodeData: import("../Tree/typings").TreeNodeData, node: import("..").TreeNode, instance: RefObject<import("../Tree/typings").TreeNodeRef>) => void;
|
|
53
|
+
onNodeDragStart?: (draggingNode: import("..").TreeNode, event: import("react").DragEvent<HTMLDivElement>) => void;
|
|
54
|
+
onNodeDragEnter?: (draggingNode: import("..").TreeNode, dropNode: import("..").TreeNode, event: import("react").DragEvent<HTMLDivElement>) => void;
|
|
55
|
+
onNodeDragLeave?: (draggingNode: import("..").TreeNode, dropNode: import("..").TreeNode, event: import("react").DragEvent<HTMLDivElement>) => void;
|
|
56
|
+
onNodeDragOver?: (draggingNode: import("..").TreeNode, dropNode: import("..").TreeNode, event: import("react").DragEvent<HTMLDivElement>) => void;
|
|
57
|
+
onNodeDragEnd?: (draggingNode: import("..").TreeNode, dropNode: import("..").TreeNode, dropType: import("../Tree/typings").NodeDropType, event: import("react").DragEvent<HTMLDivElement>) => void;
|
|
58
|
+
onNodeDrop?: (draggingNode: import("..").TreeNode, dropNode: import("..").TreeNode, dropType: import("../Tree/typings").NodeDropType, event: import("react").DragEvent<HTMLDivElement>) => void;
|
|
59
|
+
multiple?: boolean;
|
|
60
|
+
disabled?: boolean;
|
|
61
|
+
clearable?: boolean;
|
|
62
|
+
clearIcon?: import("..").IconName;
|
|
63
|
+
placeholder?: string;
|
|
64
|
+
filterable?: boolean;
|
|
65
|
+
noDataText?: string;
|
|
66
|
+
noMatchText?: string;
|
|
67
|
+
loading?: boolean;
|
|
68
|
+
loadingText?: string;
|
|
69
|
+
loadingIcon?: import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
|
|
70
|
+
max?: boolean;
|
|
71
|
+
showArrow?: boolean;
|
|
72
|
+
required?: boolean;
|
|
73
|
+
error?: boolean;
|
|
74
|
+
warning?: boolean;
|
|
75
|
+
maxWidth?: number;
|
|
76
|
+
collapseTags?: boolean;
|
|
77
|
+
maxCollapseTags?: number;
|
|
78
|
+
collapseTagsTooltip?: boolean;
|
|
79
|
+
collapseTips?: (collapseNum: number, total: number) => string;
|
|
80
|
+
allowCreate?: boolean;
|
|
81
|
+
plain?: boolean;
|
|
82
|
+
prepend?: string | number | import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
|
|
83
|
+
append?: string | number | import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
|
|
84
|
+
size?: import("..").TypeAttributes.Size;
|
|
85
|
+
appendToBody?: boolean;
|
|
86
|
+
remote?: boolean;
|
|
87
|
+
remoteMethod?: (searchText: string) => void;
|
|
88
|
+
remoteShowSuffix?: boolean;
|
|
89
|
+
suffixIcon?: import("..").IconName;
|
|
90
|
+
tagType?: import("..").TypeAttributes.Appearance;
|
|
91
|
+
tagEffect?: "light" | "dark" | "plain";
|
|
92
|
+
labelFormat?: (index: number, value: import("../Select/typings").OptionValue, label?: import("../Select/typings").OptionValue) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
|
|
93
|
+
onChange?: <T = any>(value: import("../Select/typings").ValueType, data?: import("../Select/typings").OptionData<T> | import("../Select/typings").OptionData<T>[]) => void;
|
|
94
|
+
onVisibleChange?: (visible: boolean) => void;
|
|
95
|
+
onRemoveTag?: (tagValue: any) => void;
|
|
96
|
+
onClear?: () => void;
|
|
97
|
+
automaticDropdown?: boolean;
|
|
98
|
+
header?: import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
|
|
99
|
+
footer?: import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
|
|
100
|
+
tag?: <T_1 = any>(params: {
|
|
101
|
+
data: import("../Select/typings").OptionData<T_1>[];
|
|
102
|
+
selectDisabled: boolean;
|
|
103
|
+
deleteTag: (event: import("react").MouseEvent<HTMLElement, MouseEvent>, tag: import("../Select/typings").OptionData<T_1>) => void;
|
|
104
|
+
}) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
|
|
105
|
+
unmountOnExit?: boolean;
|
|
106
|
+
name?: string;
|
|
107
|
+
readOnly?: boolean;
|
|
108
|
+
value?: import("../Select/typings").ValueType;
|
|
109
|
+
defaultValue?: import("../Select/typings").ValueType;
|
|
110
|
+
children?: (import("react").ReactElement<import("../Select/typings").SelectOptionGroupProps | import("../Select/typings").SelectOptionProps, string | import("react").JSXElementConstructor<any>> | import("react").ReactElement<import("../Select/typings").SelectOptionGroupProps | import("../Select/typings").SelectOptionProps, string | import("react").JSXElementConstructor<any>>[]) | (import("react").ReactElement<import("../Select/typings").SelectOptionGroupProps | import("../Select/typings").SelectOptionProps, string | import("react").JSXElementConstructor<any>> | import("react").ReactElement<import("../Select/typings").SelectOptionGroupProps | import("../Select/typings").SelectOptionProps, string | import("react").JSXElementConstructor<any>>[])[];
|
|
111
|
+
beforeEnter?: (node?: HTMLElement | Text) => void;
|
|
112
|
+
onEnter?: (node?: HTMLElement | Text) => void;
|
|
113
|
+
afterEnter?: (node?: HTMLElement | Text) => void;
|
|
114
|
+
beforeLeave?: (node?: HTMLElement | Text) => void;
|
|
115
|
+
onLeave?: (node?: HTMLElement | Text) => void;
|
|
116
|
+
afterLeave?: (node?: HTMLElement | Text) => void;
|
|
117
|
+
popperInstRef?: import("react").MutableRefObject<import("..").PopperOptionRef>;
|
|
118
|
+
offset?: number;
|
|
119
|
+
placement?: import("@popperjs/core").Placement;
|
|
120
|
+
arrowOffset?: number;
|
|
121
|
+
effect?: string;
|
|
122
|
+
popperOptions?: import("@popperjs/core").Options;
|
|
123
|
+
fallbackPlacements?: import("@popperjs/core").Placement[] | ((placement?: import("@popperjs/core").Placement) => import("@popperjs/core").Placement[]);
|
|
124
|
+
};
|
|
125
|
+
export default useSelect;
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
5
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
6
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
7
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
8
|
+
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
9
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
10
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
11
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
12
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
13
|
+
import pick from 'lodash/pick';
|
|
14
|
+
import { useEffect, useMemo } from 'react';
|
|
15
|
+
|
|
16
|
+
// 假设这些工具函数和常量已存在
|
|
17
|
+
import classNames from 'classnames';
|
|
18
|
+
import { nextTick } from "../Util";
|
|
19
|
+
import { useClassNames } from "../hooks";
|
|
20
|
+
import { popperAllProps } from "../hooks/popperPropsUtils";
|
|
21
|
+
var formControlBaseKeys = ['name', 'value', 'defaultValue', 'disabled', 'size', 'readOnly', 'classPrefix', 'className', 'style'];
|
|
22
|
+
var animationEventKeys = ['beforeEnter', 'onEnter', 'afterEnter', 'beforeLeave', 'onLeave', 'afterLeave'];
|
|
23
|
+
var selectKeys = [].concat(formControlBaseKeys, animationEventKeys, ['multiple', 'disabled', 'valueKey', 'clearable', 'clearIcon', 'placeholder', 'filterable', 'filterMethod', 'noDataText', 'noMatchText', 'loading', 'loadingText', 'loadingIcon', 'max', 'showArrow', 'required', 'error', 'warning', 'maxWidth', 'collapseTags', 'maxCollapseTags', 'collapseTagsTooltip', 'collapseTips', 'allowCreate', 'plain', 'prepend', 'append', 'size', 'appendToBody', 'remote', 'remoteMethod', 'remoteShowSuffix', 'suffixIcon', 'tagType', 'tagEffect', 'labelFormat', 'onChange', 'onVisibleChange', 'onRemoveTag', 'onClear', 'automaticDropdown', 'header', 'footer', 'tag'], _toConsumableArray(popperAllProps));
|
|
24
|
+
var useSelect = function useSelect(props, _ref) {
|
|
25
|
+
var selectRef = _ref.selectRef,
|
|
26
|
+
treeRef = _ref.treeRef,
|
|
27
|
+
key = _ref.key;
|
|
28
|
+
var ns = useClassNames('tree-select');
|
|
29
|
+
|
|
30
|
+
// 监听 props.data 变化并更新树节点
|
|
31
|
+
useEffect(function () {
|
|
32
|
+
if (props.filterable) {
|
|
33
|
+
nextTick().then(function () {
|
|
34
|
+
var _selectRef$current;
|
|
35
|
+
if (((_selectRef$current = selectRef.current) === null || _selectRef$current === void 0 ? void 0 : _selectRef$current.getValue()) !== undefined) {
|
|
36
|
+
var _treeRef$current, _selectRef$current2;
|
|
37
|
+
(_treeRef$current = treeRef.current) === null || _treeRef$current === void 0 || _treeRef$current.filter((_selectRef$current2 = selectRef.current) === null || _selectRef$current2 === void 0 ? void 0 : _selectRef$current2.getValue());
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
}, [props.data]);
|
|
42
|
+
|
|
43
|
+
// // 聚焦到最后一个节点的逻辑
|
|
44
|
+
// const focusLastNode = (listNode: any[]) => {
|
|
45
|
+
// const lastNode = listNode[listNode.length - 1];
|
|
46
|
+
// if (lastNode.expanded && lastNode.childNodes?.[lastNode.childNodes.length - 1]) {
|
|
47
|
+
// focusLastNode([lastNode.childNodes[lastNode.childNodes.length - 1]]);
|
|
48
|
+
// } else {
|
|
49
|
+
// const el = treeRef.current?.el$?.querySelector(`[data-key="${lastNode.key}"]`);
|
|
50
|
+
// el?.focus({ preventScroll: true });
|
|
51
|
+
// }
|
|
52
|
+
// };
|
|
53
|
+
|
|
54
|
+
// // 键盘事件处理
|
|
55
|
+
// useEffect(() => {
|
|
56
|
+
// const handleKeyDown = async (evt: KeyboardEvent) => {
|
|
57
|
+
// const code = getEventCode(evt);
|
|
58
|
+
// const dropdownMenuVisible = selectRef.current?.dropdownMenuVisible;
|
|
59
|
+
|
|
60
|
+
// if ([EVENT_CODE.down, EVENT_CODE.up].includes(code) && dropdownMenuVisible) {
|
|
61
|
+
// await new Promise(resolve => setTimeout(resolve, 0)); // 等待异步操作完成
|
|
62
|
+
// if (code === EVENT_CODE.up) {
|
|
63
|
+
// const listNode = treeRef.current?.store.root.childNodes;
|
|
64
|
+
// focusLastNode(listNode);
|
|
65
|
+
// } else {
|
|
66
|
+
// const hoveringIndex = selectRef.current?.states.hoveringIndex;
|
|
67
|
+
// selectRef.current?.optionsArray[hoveringIndex]?.$el?.parentNode?.parentNode?.focus({
|
|
68
|
+
// preventScroll: true,
|
|
69
|
+
// });
|
|
70
|
+
// }
|
|
71
|
+
// }
|
|
72
|
+
// };
|
|
73
|
+
|
|
74
|
+
// const el = selectRef.current?.$el;
|
|
75
|
+
// if (el) {
|
|
76
|
+
// el.addEventListener('keydown', handleKeyDown, { capture: true });
|
|
77
|
+
// return () => el.removeEventListener('keydown', handleKeyDown, { capture: true });
|
|
78
|
+
// }
|
|
79
|
+
// }, []);
|
|
80
|
+
|
|
81
|
+
// 返回结果对象
|
|
82
|
+
var result = useMemo(function () {
|
|
83
|
+
return _objectSpread(_objectSpread({}, pick(props, selectKeys)), {}, {
|
|
84
|
+
className: props.popperClass,
|
|
85
|
+
style: props.style,
|
|
86
|
+
// onUpdateModelValue: (value: any) => props.onUpdateModelValue?.(value),
|
|
87
|
+
valueKey: key,
|
|
88
|
+
popperClass: classNames(ns.e('popper'), props.popperClass),
|
|
89
|
+
filterMethod: function filterMethod() {
|
|
90
|
+
var keyword = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
|
|
91
|
+
if (props.filterMethod) {
|
|
92
|
+
props.filterMethod(keyword);
|
|
93
|
+
} else if (props.remoteMethod) {
|
|
94
|
+
props.remoteMethod(keyword);
|
|
95
|
+
} else {
|
|
96
|
+
var _treeRef$current2;
|
|
97
|
+
(_treeRef$current2 = treeRef.current) === null || _treeRef$current2 === void 0 || _treeRef$current2.filter(keyword);
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
});
|
|
101
|
+
}, [key, ns, props, treeRef]);
|
|
102
|
+
return result;
|
|
103
|
+
};
|
|
104
|
+
export default useSelect;
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
import React, { RefObject } from 'react';
|
|
2
|
+
import { SelectRef } from '../Select';
|
|
3
|
+
import { OptionData } from '../Select/typings';
|
|
4
|
+
import { TreeNode } from '../Tree';
|
|
5
|
+
import { TreeKey, TreeNodeData, TreeNodeRef, TreeRef } from '../Tree/typings';
|
|
6
|
+
import { CacheOption, TreeSelectProps } from './typings';
|
|
7
|
+
declare const useTree: (props: TreeSelectProps, { selectRef, treeRef, key, value, setValue }: {
|
|
8
|
+
selectRef: RefObject<SelectRef>;
|
|
9
|
+
treeRef: RefObject<TreeRef>;
|
|
10
|
+
key: string;
|
|
11
|
+
value: any;
|
|
12
|
+
setValue: (value: any) => void;
|
|
13
|
+
}) => {
|
|
14
|
+
nodeKey: string;
|
|
15
|
+
expandOnClickNode: boolean;
|
|
16
|
+
defaultExpandedKeys: any[];
|
|
17
|
+
renderContent: ({ node, data, store }: any) => React.FunctionComponentElement<any>;
|
|
18
|
+
filterNodeMethod: (val: string, data: TreeNodeData, node: TreeNode) => boolean;
|
|
19
|
+
onNodeClick: (data: TreeNodeData, node: TreeNode, treeNodeRef: RefObject<TreeNodeRef>, e: React.MouseEvent<HTMLDivElement, MouseEvent>) => void;
|
|
20
|
+
onCheck: (data: TreeNodeData, params: any) => void;
|
|
21
|
+
onNodeExpand: (data: TreeNodeData, node: TreeNode, treeNodeRef: RefObject<TreeNodeRef>) => void;
|
|
22
|
+
cacheOptions: CacheOption[];
|
|
23
|
+
cacheData?: any[];
|
|
24
|
+
style?: React.CSSProperties & Partial<Record<never, string>>;
|
|
25
|
+
data?: import("../Tree/typings").TreeData;
|
|
26
|
+
className?: string;
|
|
27
|
+
draggable?: boolean;
|
|
28
|
+
icon?: import("..").IconName;
|
|
29
|
+
classPrefix?: string;
|
|
30
|
+
popperStyle?: React.CSSProperties;
|
|
31
|
+
props?: import("../Tree").TreeOptionProps;
|
|
32
|
+
indent?: number;
|
|
33
|
+
load?: import("../Tree").LoadFunction;
|
|
34
|
+
lazy?: boolean;
|
|
35
|
+
accordion?: boolean;
|
|
36
|
+
emptyText?: string;
|
|
37
|
+
defaultExpandAll?: boolean;
|
|
38
|
+
onCurrentChange?: (nodeData: TreeNodeData, node: TreeNode) => void;
|
|
39
|
+
renderAfterExpand?: boolean;
|
|
40
|
+
checkStrictly?: boolean;
|
|
41
|
+
checkOnClickNode?: boolean;
|
|
42
|
+
checkOnClickLeaf?: boolean;
|
|
43
|
+
checkDescendants?: boolean;
|
|
44
|
+
autoExpandParent?: boolean;
|
|
45
|
+
defaultCheckedKeys?: TreeKey[];
|
|
46
|
+
currentNodeKey?: TreeKey;
|
|
47
|
+
showCheckbox?: boolean;
|
|
48
|
+
allowDrag?: import("../Tree").AllowDragFunction;
|
|
49
|
+
allowDrop?: import("../Tree").AllowDropFunction;
|
|
50
|
+
highlightCurrent?: boolean;
|
|
51
|
+
renderEmpty?: () => React.ReactNode;
|
|
52
|
+
onNodeContextmenu?: (event: React.MouseEvent<HTMLDivElement, MouseEvent>, nodeData: TreeNodeData, node: TreeNode, instance: React.RefObject<TreeNodeRef>) => void;
|
|
53
|
+
onCheckChange?: (nodeData: TreeNodeData, checked: boolean, indeterminate: boolean) => void;
|
|
54
|
+
onNodeCollapse?: (nodeData: TreeNodeData, node: TreeNode, instance: React.RefObject<TreeNodeRef>) => void;
|
|
55
|
+
onNodeDragStart?: (draggingNode: TreeNode, event: React.DragEvent<HTMLDivElement>) => void;
|
|
56
|
+
onNodeDragEnter?: (draggingNode: TreeNode, dropNode: TreeNode, event: React.DragEvent<HTMLDivElement>) => void;
|
|
57
|
+
onNodeDragLeave?: (draggingNode: TreeNode, dropNode: TreeNode, event: React.DragEvent<HTMLDivElement>) => void;
|
|
58
|
+
onNodeDragOver?: (draggingNode: TreeNode, dropNode: TreeNode, event: React.DragEvent<HTMLDivElement>) => void;
|
|
59
|
+
onNodeDragEnd?: (draggingNode: TreeNode, dropNode: TreeNode, dropType: import("../Tree").NodeDropType, event: React.DragEvent<HTMLDivElement>) => void;
|
|
60
|
+
onNodeDrop?: (draggingNode: TreeNode, dropNode: TreeNode, dropType: import("../Tree").NodeDropType, event: React.DragEvent<HTMLDivElement>) => void;
|
|
61
|
+
multiple?: boolean;
|
|
62
|
+
disabled?: boolean;
|
|
63
|
+
valueKey?: string;
|
|
64
|
+
clearable?: boolean;
|
|
65
|
+
clearIcon?: import("..").IconName;
|
|
66
|
+
placeholder?: string;
|
|
67
|
+
filterable?: boolean;
|
|
68
|
+
filterMethod?: (searchText: string) => void;
|
|
69
|
+
noDataText?: string;
|
|
70
|
+
noMatchText?: string;
|
|
71
|
+
loading?: boolean;
|
|
72
|
+
loadingText?: string;
|
|
73
|
+
loadingIcon?: React.ReactElement<any, string | React.JSXElementConstructor<any>>;
|
|
74
|
+
max?: boolean;
|
|
75
|
+
showArrow?: boolean;
|
|
76
|
+
required?: boolean;
|
|
77
|
+
error?: boolean;
|
|
78
|
+
warning?: boolean;
|
|
79
|
+
maxWidth?: number;
|
|
80
|
+
collapseTags?: boolean;
|
|
81
|
+
maxCollapseTags?: number;
|
|
82
|
+
collapseTagsTooltip?: boolean;
|
|
83
|
+
collapseTips?: (collapseNum: number, total: number) => string;
|
|
84
|
+
allowCreate?: boolean;
|
|
85
|
+
plain?: boolean;
|
|
86
|
+
prepend?: string | number | React.ReactElement<any, string | React.JSXElementConstructor<any>>;
|
|
87
|
+
append?: string | number | React.ReactElement<any, string | React.JSXElementConstructor<any>>;
|
|
88
|
+
size?: import("..").TypeAttributes.Size;
|
|
89
|
+
appendToBody?: boolean;
|
|
90
|
+
remote?: boolean;
|
|
91
|
+
remoteMethod?: (searchText: string) => void;
|
|
92
|
+
remoteShowSuffix?: boolean;
|
|
93
|
+
suffixIcon?: import("..").IconName;
|
|
94
|
+
tagType?: import("..").TypeAttributes.Appearance;
|
|
95
|
+
tagEffect?: "light" | "dark" | "plain";
|
|
96
|
+
labelFormat?: (index: number, value: import("../Select/typings").OptionValue, label?: import("../Select/typings").OptionValue) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
|
|
97
|
+
onChange?: <T = any>(value: import("../Select/typings").ValueType, data?: OptionData<T> | OptionData<T>[]) => void;
|
|
98
|
+
onVisibleChange?: (visible: boolean) => void;
|
|
99
|
+
onRemoveTag?: (tagValue: any) => void;
|
|
100
|
+
onClear?: () => void;
|
|
101
|
+
automaticDropdown?: boolean;
|
|
102
|
+
header?: React.ReactElement<any, string | React.JSXElementConstructor<any>>;
|
|
103
|
+
footer?: React.ReactElement<any, string | React.JSXElementConstructor<any>>;
|
|
104
|
+
tag?: <T_1 = any>(params: {
|
|
105
|
+
data: OptionData<T_1>[];
|
|
106
|
+
selectDisabled: boolean;
|
|
107
|
+
deleteTag: (event: React.MouseEvent<HTMLElement, MouseEvent>, tag: OptionData<T_1>) => void;
|
|
108
|
+
}) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
|
|
109
|
+
unmountOnExit?: boolean;
|
|
110
|
+
name?: string;
|
|
111
|
+
readOnly?: boolean;
|
|
112
|
+
value?: import("../Select/typings").ValueType;
|
|
113
|
+
defaultValue?: import("../Select/typings").ValueType;
|
|
114
|
+
children?: (React.ReactElement<import("../Select").SelectOptionGroupProps | import("../Select").SelectOptionProps, string | React.JSXElementConstructor<any>> | React.ReactElement<import("../Select").SelectOptionGroupProps | import("../Select").SelectOptionProps, string | React.JSXElementConstructor<any>>[]) | (React.ReactElement<import("../Select").SelectOptionGroupProps | import("../Select").SelectOptionProps, string | React.JSXElementConstructor<any>> | React.ReactElement<import("../Select").SelectOptionGroupProps | import("../Select").SelectOptionProps, string | React.JSXElementConstructor<any>>[])[];
|
|
115
|
+
beforeEnter?: (node?: HTMLElement | Text) => void;
|
|
116
|
+
onEnter?: (node?: HTMLElement | Text) => void;
|
|
117
|
+
afterEnter?: (node?: HTMLElement | Text) => void;
|
|
118
|
+
beforeLeave?: (node?: HTMLElement | Text) => void;
|
|
119
|
+
onLeave?: (node?: HTMLElement | Text) => void;
|
|
120
|
+
afterLeave?: (node?: HTMLElement | Text) => void;
|
|
121
|
+
popperInstRef?: React.MutableRefObject<import("..").PopperOptionRef>;
|
|
122
|
+
offset?: number;
|
|
123
|
+
placement?: import("@popperjs/core").Placement;
|
|
124
|
+
arrowOffset?: number;
|
|
125
|
+
popperClass?: string;
|
|
126
|
+
effect?: string;
|
|
127
|
+
popperOptions?: import("@popperjs/core").Options;
|
|
128
|
+
fallbackPlacements?: import("@popperjs/core").Placement[] | ((placement?: import("@popperjs/core").Placement) => import("@popperjs/core").Placement[]);
|
|
129
|
+
};
|
|
130
|
+
export default useTree;
|