@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
|
@@ -1,36 +0,0 @@
|
|
|
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 _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; }
|
|
3
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
4
|
-
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); }
|
|
5
|
-
import React from 'react';
|
|
6
|
-
export var offset = 4;
|
|
7
|
-
var DropIndicatorRender = function DropIndicatorRender(props) {
|
|
8
|
-
var dropPosition = props.dropPosition,
|
|
9
|
-
dropLevelOffset = props.dropLevelOffset,
|
|
10
|
-
prefixCls = props.prefixCls,
|
|
11
|
-
indent = props.indent,
|
|
12
|
-
_props$direction = props.direction,
|
|
13
|
-
direction = _props$direction === void 0 ? 'ltr' : _props$direction;
|
|
14
|
-
var startPosition = direction === 'ltr' ? 'left' : 'right';
|
|
15
|
-
var endPosition = direction === 'ltr' ? 'right' : 'left';
|
|
16
|
-
var style = _defineProperty(_defineProperty({}, startPosition, -dropLevelOffset * indent + offset), endPosition, 0);
|
|
17
|
-
switch (dropPosition) {
|
|
18
|
-
case -1:
|
|
19
|
-
style.top = -3;
|
|
20
|
-
break;
|
|
21
|
-
case 1:
|
|
22
|
-
style.bottom = -3;
|
|
23
|
-
break;
|
|
24
|
-
default:
|
|
25
|
-
// dropPosition === 0
|
|
26
|
-
style.bottom = -3;
|
|
27
|
-
style[startPosition] = indent + offset;
|
|
28
|
-
break;
|
|
29
|
-
}
|
|
30
|
-
// @ts-ignore
|
|
31
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
32
|
-
style: style,
|
|
33
|
-
className: "".concat(prefixCls, "-drop-indicator")
|
|
34
|
-
});
|
|
35
|
-
};
|
|
36
|
-
export default DropIndicatorRender;
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { AntTreeNodeProps } from '../Tree';
|
|
3
|
-
export default function renderSwitcherIcon(prefixCls: string, switcherIcon: React.ReactElement | null | undefined, showLine: boolean | {
|
|
4
|
-
showLeafIcon: boolean;
|
|
5
|
-
} | undefined, { isLeaf, expanded, loading }: AntTreeNodeProps): React.JSX.Element;
|
|
@@ -1,62 +0,0 @@
|
|
|
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
|
-
import classNames from 'classnames';
|
|
3
|
-
import React, { cloneElement, isValidElement } from 'react';
|
|
4
|
-
import { Icon } from "../../Icon";
|
|
5
|
-
export default function renderSwitcherIcon(prefixCls, switcherIcon, showLine, _ref) {
|
|
6
|
-
var isLeaf = _ref.isLeaf,
|
|
7
|
-
expanded = _ref.expanded,
|
|
8
|
-
loading = _ref.loading;
|
|
9
|
-
if (loading) {
|
|
10
|
-
return /*#__PURE__*/React.createElement(Icon, {
|
|
11
|
-
prefix: "fal",
|
|
12
|
-
name: "loader",
|
|
13
|
-
spin: true,
|
|
14
|
-
className: "".concat(prefixCls, "-switcher-loading-icon")
|
|
15
|
-
});
|
|
16
|
-
}
|
|
17
|
-
var showLeafIcon;
|
|
18
|
-
if (showLine && _typeof(showLine) === 'object') {
|
|
19
|
-
showLeafIcon = showLine.showLeafIcon;
|
|
20
|
-
}
|
|
21
|
-
if (isLeaf) {
|
|
22
|
-
if (showLine) {
|
|
23
|
-
if (_typeof(showLine) === 'object' && !showLeafIcon) {
|
|
24
|
-
return /*#__PURE__*/React.createElement("span", {
|
|
25
|
-
className: "".concat(prefixCls, "-switcher-leaf-line")
|
|
26
|
-
});
|
|
27
|
-
}
|
|
28
|
-
return /*#__PURE__*/React.createElement(Icon, {
|
|
29
|
-
name: "file",
|
|
30
|
-
prefix: "fal",
|
|
31
|
-
className: "".concat(prefixCls, "-switcher-line-icon")
|
|
32
|
-
});
|
|
33
|
-
}
|
|
34
|
-
return null;
|
|
35
|
-
}
|
|
36
|
-
var switcherCls = "".concat(prefixCls, "-switcher-icon");
|
|
37
|
-
if ( /*#__PURE__*/isValidElement(switcherIcon)) {
|
|
38
|
-
return /*#__PURE__*/cloneElement(switcherIcon, {
|
|
39
|
-
// @ts-ignore
|
|
40
|
-
className: classNames(switcherIcon.props.className || '', switcherCls)
|
|
41
|
-
});
|
|
42
|
-
}
|
|
43
|
-
if (switcherIcon) {
|
|
44
|
-
return switcherIcon;
|
|
45
|
-
}
|
|
46
|
-
if (showLine) {
|
|
47
|
-
return expanded ? /*#__PURE__*/React.createElement(Icon, {
|
|
48
|
-
name: "square-minus",
|
|
49
|
-
prefix: "far",
|
|
50
|
-
className: "".concat(prefixCls, "-switcher-line-icon")
|
|
51
|
-
}) : /*#__PURE__*/React.createElement(Icon, {
|
|
52
|
-
name: "square-plus",
|
|
53
|
-
prefix: "far",
|
|
54
|
-
className: "".concat(prefixCls, "-switcher-line-icon")
|
|
55
|
-
});
|
|
56
|
-
}
|
|
57
|
-
return /*#__PURE__*/React.createElement(Icon, {
|
|
58
|
-
name: "angle-right",
|
|
59
|
-
prefix: "far",
|
|
60
|
-
className: switcherCls
|
|
61
|
-
});
|
|
62
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { TransitionProps } from '../../Transition';
|
|
2
|
-
export declare const beforeEnter: (el: any) => void;
|
|
3
|
-
export declare const onEnter: (el: HTMLElement) => void;
|
|
4
|
-
export declare const afterEnter: (el: HTMLElement) => void;
|
|
5
|
-
export declare const beforeLeave: (el: any) => void;
|
|
6
|
-
export declare const afterLeave: (el: any) => void;
|
|
7
|
-
declare const collapseMotion: TransitionProps;
|
|
8
|
-
declare const getTransitionName: (rootPrefixCls: string, motion: string, transitionName?: string) => string;
|
|
9
|
-
export { getTransitionName };
|
|
10
|
-
export default collapseMotion;
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import { addClass, removeClass } from 'dom-lib';
|
|
2
|
-
import { namespace } from "../../hooks/prefix";
|
|
3
|
-
export var beforeEnter = function beforeEnter(el) {
|
|
4
|
-
el.style.height = '0';
|
|
5
|
-
el.style.opacity = '0';
|
|
6
|
-
};
|
|
7
|
-
export var onEnter = function onEnter(el) {
|
|
8
|
-
addClass(el, "".concat(namespace, "-motion-collapse"));
|
|
9
|
-
el.dataset.oldOverflow = el.style.overflow;
|
|
10
|
-
if (el.scrollHeight !== 0) {
|
|
11
|
-
el.style.height = "".concat(el.scrollHeight, "px");
|
|
12
|
-
el.style.opacity = '1';
|
|
13
|
-
} else {
|
|
14
|
-
el.style.height = '';
|
|
15
|
-
}
|
|
16
|
-
el.style.overflow = 'hidden';
|
|
17
|
-
};
|
|
18
|
-
export var afterEnter = function afterEnter(el) {
|
|
19
|
-
removeClass(el, "".concat(namespace, "-motion-collapse"));
|
|
20
|
-
el.style.height = '';
|
|
21
|
-
el.style.overflow = el.dataset.oldOverflow;
|
|
22
|
-
};
|
|
23
|
-
export var beforeLeave = function beforeLeave(el) {
|
|
24
|
-
addClass(el, "".concat(namespace, "-motion-collapse"));
|
|
25
|
-
if (!el.dataset) {
|
|
26
|
-
el.dataset = {};
|
|
27
|
-
}
|
|
28
|
-
el.dataset.oldOverflow = el.style.overflow;
|
|
29
|
-
el.style.height = "".concat(el.scrollHeight, "px");
|
|
30
|
-
el.style.overflow = 'hidden';
|
|
31
|
-
};
|
|
32
|
-
export var afterLeave = function afterLeave(el) {
|
|
33
|
-
removeClass(el, "".concat(namespace, "-motion-collapse"));
|
|
34
|
-
el.style.height = '';
|
|
35
|
-
el.style.overflow = el.dataset.oldOverflow;
|
|
36
|
-
el.style.display = '';
|
|
37
|
-
};
|
|
38
|
-
var collapseMotion = {
|
|
39
|
-
name: "".concat(namespace, "-treenode-collapse"),
|
|
40
|
-
beforeEnter: beforeEnter,
|
|
41
|
-
onEnter: onEnter,
|
|
42
|
-
afterEnter: afterEnter,
|
|
43
|
-
beforeLeave: beforeLeave,
|
|
44
|
-
afterLeave: afterLeave,
|
|
45
|
-
duration: 300
|
|
46
|
-
};
|
|
47
|
-
var getTransitionName = function getTransitionName(rootPrefixCls, motion, transitionName) {
|
|
48
|
-
if (transitionName !== undefined) {
|
|
49
|
-
return transitionName;
|
|
50
|
-
}
|
|
51
|
-
return "".concat(rootPrefixCls, "-").concat(motion);
|
|
52
|
-
};
|
|
53
|
-
export { getTransitionName };
|
|
54
|
-
export default collapseMotion;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
export interface PickConfig {
|
|
2
|
-
aria?: boolean;
|
|
3
|
-
data?: boolean;
|
|
4
|
-
attr?: boolean;
|
|
5
|
-
}
|
|
6
|
-
/**
|
|
7
|
-
* Picker props from exist props with filter
|
|
8
|
-
* @param props Passed props
|
|
9
|
-
* @param ariaOnly boolean | { aria?: boolean; data?: boolean; attr?: boolean; } filter config
|
|
10
|
-
*/
|
|
11
|
-
export default function pickAttrs(props: object, ariaOnly?: boolean | PickConfig): {};
|
|
@@ -1,51 +0,0 @@
|
|
|
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
|
-
var attributes = "accept acceptCharset accessKey action allowFullScreen allowTransparency\n alt async autoComplete autoFocus autoPlay capture cellPadding cellSpacing challenge\n charSet checked classID className colSpan cols content contentEditable contextMenu\n controls coords crossOrigin data dateTime default defer dir disabled download draggable\n encType form formAction formEncType formMethod formNoValidate formTarget frameBorder\n headers height hidden high href hrefLang htmlFor httpEquiv icon id inputMode integrity\n is keyParams keyType kind label lang list loop low manifest marginHeight marginWidth max maxLength media\n mediaGroup method min minLength multiple muted name noValidate nonce open\n optimum pattern placeholder poster preload radioGroup readOnly rel required\n reversed role rowSpan rows sandbox scope scoped scrolling seamless selected\n shape size sizes span spellCheck src srcDoc srcLang srcSet start step style\n summary tabIndex target title type useMap value width wmode wrap";
|
|
8
|
-
var eventsName = "onCopy onCut onPaste onCompositionEnd onCompositionStart onCompositionUpdate onKeyDown\n onKeyPress onKeyUp onFocus onBlur onChange onInput onSubmit onClick onContextMenu onDoubleClick\n onDrag onDragEnd onDragEnter onDragExit onDragLeave onDragOver onDragStart onDrop onMouseDown\n onMouseEnter onMouseLeave onMouseMove onMouseOut onMouseOver onMouseUp onSelect onTouchCancel\n onTouchEnd onTouchMove onTouchStart onScroll onWheel onAbort onCanPlay onCanPlayThrough\n onDurationChange onEmptied onEncrypted onEnded onError onLoadedData onLoadedMetadata\n onLoadStart onPause onPlay onPlaying onProgress onRateChange onSeeked onSeeking onStalled onSuspend onTimeUpdate onVolumeChange onWaiting onLoad onError";
|
|
9
|
-
var propList = "".concat(attributes, " ").concat(eventsName).split(/[\s\n]+/);
|
|
10
|
-
|
|
11
|
-
/* eslint-enable max-len */
|
|
12
|
-
var ariaPrefix = 'aria-';
|
|
13
|
-
var dataPrefix = 'data-';
|
|
14
|
-
function match(key, prefix) {
|
|
15
|
-
return key.indexOf(prefix) === 0;
|
|
16
|
-
}
|
|
17
|
-
/**
|
|
18
|
-
* Picker props from exist props with filter
|
|
19
|
-
* @param props Passed props
|
|
20
|
-
* @param ariaOnly boolean | { aria?: boolean; data?: boolean; attr?: boolean; } filter config
|
|
21
|
-
*/
|
|
22
|
-
export default function pickAttrs(props) {
|
|
23
|
-
var ariaOnly = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
24
|
-
var mergedConfig;
|
|
25
|
-
if (ariaOnly === false) {
|
|
26
|
-
mergedConfig = {
|
|
27
|
-
aria: true,
|
|
28
|
-
data: true,
|
|
29
|
-
attr: true
|
|
30
|
-
};
|
|
31
|
-
} else if (ariaOnly === true) {
|
|
32
|
-
mergedConfig = {
|
|
33
|
-
aria: true
|
|
34
|
-
};
|
|
35
|
-
} else {
|
|
36
|
-
mergedConfig = _objectSpread({}, ariaOnly);
|
|
37
|
-
}
|
|
38
|
-
var attrs = {};
|
|
39
|
-
Object.keys(props).forEach(function (key) {
|
|
40
|
-
if (
|
|
41
|
-
// Aria
|
|
42
|
-
mergedConfig.aria && (key === 'role' || match(key, ariaPrefix)) ||
|
|
43
|
-
// Data
|
|
44
|
-
mergedConfig.data && match(key, dataPrefix) ||
|
|
45
|
-
// Attr
|
|
46
|
-
mergedConfig.attr && propList.includes(key)) {
|
|
47
|
-
attrs[key] = props[key];
|
|
48
|
-
}
|
|
49
|
-
});
|
|
50
|
-
return attrs;
|
|
51
|
-
}
|
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import type { BasicDataNode, DataEntity, DataNode, EventDataNode, FieldNames, FlattenNode, GetKey, Key, KeyEntities, NodeElement, TreeNodeProps } from '../typings';
|
|
3
|
-
export declare function getPosition(level: string | number, index: number): string;
|
|
4
|
-
export declare function isTreeNode(node: NodeElement): boolean;
|
|
5
|
-
export declare function getKey(key: Key, pos: string): React.Key;
|
|
6
|
-
export declare function fillFieldNames(fieldNames?: FieldNames): Required<FieldNames>;
|
|
7
|
-
/**
|
|
8
|
-
* Warning if TreeNode do not provides key
|
|
9
|
-
*/
|
|
10
|
-
export declare function warningWithoutKey(treeData: DataNode[], fieldNames: FieldNames): void;
|
|
11
|
-
/**
|
|
12
|
-
* Convert `children` of Tree into `treeData` structure.
|
|
13
|
-
*/
|
|
14
|
-
export declare function convertTreeToData(rootNodes: React.ReactNode): DataNode[];
|
|
15
|
-
/**
|
|
16
|
-
* Flat nest tree data into flatten list. This is used for virtual list render.
|
|
17
|
-
* @param treeNodeList Origin data node list
|
|
18
|
-
* @param expandedKeys
|
|
19
|
-
* need expanded keys, provides `true` means all expanded (used in `rc-tree-select`).
|
|
20
|
-
*/
|
|
21
|
-
export declare function flattenTreeData<TreeDataType extends BasicDataNode = DataNode>(treeNodeList: TreeDataType[], expandedKeys: Key[] | true, fieldNames: FieldNames): FlattenNode<TreeDataType>[];
|
|
22
|
-
type ExternalGetKey = GetKey<DataNode> | string;
|
|
23
|
-
interface TraverseDataNodesConfig {
|
|
24
|
-
childrenPropName?: string;
|
|
25
|
-
externalGetKey?: ExternalGetKey;
|
|
26
|
-
fieldNames?: FieldNames;
|
|
27
|
-
}
|
|
28
|
-
/**
|
|
29
|
-
* Traverse all the data by `treeData`.
|
|
30
|
-
* Please not use it out of the `rc-tree` since we may refactor this code.
|
|
31
|
-
*/
|
|
32
|
-
export declare function traverseDataNodes(dataNodes: DataNode[], callback: (data: {
|
|
33
|
-
node: DataNode;
|
|
34
|
-
index: number;
|
|
35
|
-
pos: string;
|
|
36
|
-
key: Key;
|
|
37
|
-
parentPos: string | number;
|
|
38
|
-
level: number;
|
|
39
|
-
nodes: DataNode[];
|
|
40
|
-
}) => void, config?: TraverseDataNodesConfig | string): void;
|
|
41
|
-
interface Wrapper {
|
|
42
|
-
posEntities: Record<string, DataEntity>;
|
|
43
|
-
keyEntities: KeyEntities;
|
|
44
|
-
}
|
|
45
|
-
/**
|
|
46
|
-
* Convert `treeData` into entity records.
|
|
47
|
-
*/
|
|
48
|
-
export declare function convertDataToEntities(dataNodes: DataNode[], { initWrapper, processEntity, onProcessFinished, externalGetKey, childrenPropName, fieldNames, }?: {
|
|
49
|
-
initWrapper?: (wrapper: Wrapper) => Wrapper;
|
|
50
|
-
processEntity?: (entity: DataEntity, wrapper: Wrapper) => void;
|
|
51
|
-
onProcessFinished?: (wrapper: Wrapper) => void;
|
|
52
|
-
externalGetKey?: ExternalGetKey;
|
|
53
|
-
childrenPropName?: string;
|
|
54
|
-
fieldNames?: FieldNames;
|
|
55
|
-
},
|
|
56
|
-
/** @deprecated Use `config.externalGetKey` instead */
|
|
57
|
-
legacyExternalGetKey?: ExternalGetKey): Wrapper;
|
|
58
|
-
export interface TreeNodeRequiredProps<TreeDataType extends BasicDataNode = DataNode> {
|
|
59
|
-
expandedKeys: Key[];
|
|
60
|
-
selectedKeys: Key[];
|
|
61
|
-
loadedKeys: Key[];
|
|
62
|
-
loadingKeys: Key[];
|
|
63
|
-
checkedKeys: Key[];
|
|
64
|
-
halfCheckedKeys: Key[];
|
|
65
|
-
dragOverNodeKey: Key;
|
|
66
|
-
dropPosition: number;
|
|
67
|
-
keyEntities: KeyEntities<TreeDataType>;
|
|
68
|
-
}
|
|
69
|
-
/**
|
|
70
|
-
* Get TreeNode props with Tree props.
|
|
71
|
-
*/
|
|
72
|
-
export declare function getTreeNodeProps<TreeDataType extends BasicDataNode = DataNode>(key: Key, { expandedKeys, selectedKeys, loadedKeys, loadingKeys, checkedKeys, halfCheckedKeys, dragOverNodeKey, dropPosition, keyEntities }: TreeNodeRequiredProps<TreeDataType>): {
|
|
73
|
-
eventKey: React.Key;
|
|
74
|
-
expanded: boolean;
|
|
75
|
-
selected: boolean;
|
|
76
|
-
loaded: boolean;
|
|
77
|
-
loading: boolean;
|
|
78
|
-
checked: boolean;
|
|
79
|
-
halfChecked: boolean;
|
|
80
|
-
pos: string;
|
|
81
|
-
dragOver: boolean;
|
|
82
|
-
dragOverGapTop: boolean;
|
|
83
|
-
dragOverGapBottom: boolean;
|
|
84
|
-
};
|
|
85
|
-
export declare function convertNodePropsToEventData<TreeDataType extends BasicDataNode = DataNode>(props: TreeNodeProps<TreeDataType>): EventDataNode<TreeDataType>;
|
|
86
|
-
export {};
|