@aloudata/aloudata-design 2.0.0-beta.10 → 2.0.0-beta.11
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/ConfigProvider/index.d.ts +1 -1
- package/dist/ConfigProvider/index.js +8 -1
- package/dist/DataPreviewTable/components/Body/index.js +7 -0
- package/dist/DataPreviewTable/interface.d.ts +1 -0
- package/dist/Input/components/Input/index.js +1 -0
- package/dist/Input/components/TextArea/index.js +1 -0
- package/dist/MemberPicker/index.js +11 -1
- package/dist/MemberPicker/style/index.less +4 -2
- package/dist/Modal/style/polyfill/index.less +0 -3
- package/dist/Popconfirm/index.js +1 -1
- package/dist/Popconfirm/style/index.less +2 -4
- package/dist/Progress/style/index.less +5 -2
- package/dist/Table/style/index.less +4 -3
- package/dist/Tabs/style/index.less +1 -5
- package/dist/Tree/Tree.d.ts +2 -2
- package/dist/Tree/Tree.js +54 -0
- package/dist/Tree/demo/filter/index.d.ts +3 -0
- package/dist/Tree/demo/filter/index.js +63 -0
- package/dist/Tree/style/index.less +4 -0
- package/dist/Tree/style/mixin.less +7 -3
- package/dist/ald.min.css +1 -1
- package/dist/style/index.less +3 -3
- package/dist/style/themes/default/index.less +3 -1
- package/package.json +1 -1
|
@@ -6,7 +6,7 @@ import useGetUserList from './hooks/useGetUserList';
|
|
|
6
6
|
import SizeContext from './sizeContext';
|
|
7
7
|
export { ConfigContext } from 'antd/lib/config-provider';
|
|
8
8
|
export { ConfigConsumer } from 'antd/lib/config-provider/';
|
|
9
|
-
export type { ConfigConsumerProps,
|
|
9
|
+
export type { CSPConfig, ConfigConsumerProps, DirectionType, RenderEmptyHandler, configConsumerProps, globalConfig, } from 'antd/lib/config-provider/';
|
|
10
10
|
interface AldCustomConfigProviderProps extends ConfigProviderProps {
|
|
11
11
|
children?: React.ReactNode;
|
|
12
12
|
getUsersByIds?: getUsersByIdsType;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
1
2
|
import { ConfigProvider } from 'antd';
|
|
2
3
|
import React from 'react';
|
|
3
4
|
import getUserListContext from "./getUserList";
|
|
@@ -18,7 +19,13 @@ var AldCustomConfigProvider = function AldCustomConfigProvider(props) {
|
|
|
18
19
|
}
|
|
19
20
|
}, children);
|
|
20
21
|
}
|
|
21
|
-
return /*#__PURE__*/React.createElement(ConfigProvider,
|
|
22
|
+
return /*#__PURE__*/React.createElement(ConfigProvider, _extends({
|
|
23
|
+
theme: {
|
|
24
|
+
token: {
|
|
25
|
+
fontFamily: "Inter,'PingFang SC', system-ui, -apple-system, blinkmacsystemfont,\n 'Helvetica Neue', 'Segoe UI', helvetica, arial, 'Microsoft YaHei',\n 'WenQuanYi Micro Hei', sans-serif;"
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}, props), childNode);
|
|
22
29
|
};
|
|
23
30
|
AldCustomConfigProvider.ConfigContext = ConfigProvider.ConfigContext;
|
|
24
31
|
AldCustomConfigProvider.SizeContext = SizeContext;
|
|
@@ -33,6 +33,13 @@ function Body(props) {
|
|
|
33
33
|
position: 'absolute',
|
|
34
34
|
textAlign: columns[columnIndex].align || 'left'
|
|
35
35
|
};
|
|
36
|
+
var render = columns[columnIndex].render;
|
|
37
|
+
if (render) {
|
|
38
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
39
|
+
style: style,
|
|
40
|
+
key: columnIndex
|
|
41
|
+
}, render(cell));
|
|
42
|
+
}
|
|
36
43
|
return /*#__PURE__*/React.createElement(Cell, {
|
|
37
44
|
key: columnIndex,
|
|
38
45
|
style: style,
|
|
@@ -20,6 +20,7 @@ export interface PreviewColumn {
|
|
|
20
20
|
defaultWidth?: number;
|
|
21
21
|
renderHeader?: (column: Omit<PreviewColumn, 'render'>) => React.ReactElement;
|
|
22
22
|
align?: Align;
|
|
23
|
+
render?: (value: TValue) => React.ReactElement;
|
|
23
24
|
}
|
|
24
25
|
export type TValue = string | null | number | boolean;
|
|
25
26
|
export interface IColumnLayout {
|
|
@@ -23,6 +23,7 @@ export default /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
23
23
|
var contentSize = useContext(SizeContext);
|
|
24
24
|
var size = customSize || contentSize || 'middle';
|
|
25
25
|
return /*#__PURE__*/React.createElement(AntdTextArea, _extends({}, rest, {
|
|
26
|
+
autoComplete: "off",
|
|
26
27
|
disabled: disabled,
|
|
27
28
|
spellCheck: false,
|
|
28
29
|
className: classnames('ald-input', 'ald-input-textarea', "ald-input-textarea-".concat(getSizeType(size)), _defineProperty({}, "ald-input-disabled", disabled), className),
|
|
@@ -12,6 +12,7 @@ import _ from 'lodash';
|
|
|
12
12
|
import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
13
13
|
import ConfigProvider from "../ConfigProvider";
|
|
14
14
|
import { EUserType } from "../ConfigProvider/getUserList";
|
|
15
|
+
import { User } from "../Icon";
|
|
15
16
|
import Select from "../Select";
|
|
16
17
|
import message from "../message";
|
|
17
18
|
import Panel from "./components/Panel";
|
|
@@ -30,7 +31,6 @@ var Component = function Component(_ref) {
|
|
|
30
31
|
_ref$placeholder = _ref.placeholder,
|
|
31
32
|
placeholder = _ref$placeholder === void 0 ? '选择' : _ref$placeholder,
|
|
32
33
|
className = _ref.className,
|
|
33
|
-
prefix = _ref.prefix,
|
|
34
34
|
allowClear = _ref.allowClear,
|
|
35
35
|
disabled = _ref.disabled,
|
|
36
36
|
_onClear = _ref.onClear,
|
|
@@ -183,6 +183,16 @@ var Component = function Component(_ref) {
|
|
|
183
183
|
setDropdownOpen(open);
|
|
184
184
|
onOpenChange === null || onOpenChange === void 0 ? void 0 : onOpenChange(open);
|
|
185
185
|
}, [onOpenChange]);
|
|
186
|
+
var prefix = useMemo(function () {
|
|
187
|
+
if (multiple) return null;
|
|
188
|
+
if (type === EMemberPicker.USER) return /*#__PURE__*/React.createElement(User, {
|
|
189
|
+
size: 20
|
|
190
|
+
});
|
|
191
|
+
if (type === EMemberPicker.GROUP) return /*#__PURE__*/React.createElement(User, {
|
|
192
|
+
size: 20
|
|
193
|
+
});
|
|
194
|
+
return null;
|
|
195
|
+
}, [multiple, type]);
|
|
186
196
|
return /*#__PURE__*/React.createElement(Select, {
|
|
187
197
|
prefix: prefix,
|
|
188
198
|
size: size,
|
|
@@ -315,9 +315,11 @@
|
|
|
315
315
|
|
|
316
316
|
.ald-select-popup.ald-member-picker-popup.ald-member-picker-popup.ald-member-picker-popup {
|
|
317
317
|
border: none;
|
|
318
|
-
background-color: transparent;
|
|
319
318
|
overflow: hidden;
|
|
320
319
|
padding: 0;
|
|
321
|
-
box-shadow: none;
|
|
322
320
|
border-radius: 0;
|
|
321
|
+
border-radius: 4px;
|
|
322
|
+
background: var(--colors-neutral-white, #fff);
|
|
323
|
+
box-shadow: 0 20px 24px -4px rgba(16, 24, 40, 0.08),
|
|
324
|
+
0 8px 8px -4px rgba(16, 24, 40, 0.03);
|
|
323
325
|
}
|
|
@@ -32,9 +32,6 @@
|
|
|
32
32
|
font-size: 14px;
|
|
33
33
|
line-height: 1.5714;
|
|
34
34
|
list-style: none;
|
|
35
|
-
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
|
|
36
|
-
'Helvetica Neue', Arial, 'Noto Sans', sans-serif, 'Apple Color Emoji',
|
|
37
|
-
'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji';
|
|
38
35
|
pointer-events: none;
|
|
39
36
|
position: relative;
|
|
40
37
|
top: 100px;
|
package/dist/Popconfirm/index.js
CHANGED
|
@@ -16,7 +16,7 @@ function MyPopconfirm(props) {
|
|
|
16
16
|
rootClassName = props.rootClassName,
|
|
17
17
|
_props$icon = props.icon,
|
|
18
18
|
icon = _props$icon === void 0 ? /*#__PURE__*/React.createElement(AttentionTriangleFill, {
|
|
19
|
-
size:
|
|
19
|
+
size: 16,
|
|
20
20
|
color: "#D64343",
|
|
21
21
|
fill: "#fff"
|
|
22
22
|
}) : _props$icon,
|
|
@@ -40,16 +40,14 @@
|
|
|
40
40
|
|
|
41
41
|
.ant-popover-inner-content {
|
|
42
42
|
.ant-popconfirm-message {
|
|
43
|
-
padding-bottom:
|
|
43
|
+
padding-bottom: 8px;
|
|
44
44
|
margin-bottom: 0;
|
|
45
45
|
}
|
|
46
46
|
|
|
47
47
|
.ant-popconfirm-buttons {
|
|
48
|
-
padding-
|
|
49
|
-
padding-left: 24px;
|
|
48
|
+
padding-left: 16px;
|
|
50
49
|
display: flex;
|
|
51
50
|
align-items: center;
|
|
52
|
-
gap: 16px;
|
|
53
51
|
flex-direction: row-reverse;
|
|
54
52
|
justify-content: start;
|
|
55
53
|
}
|
|
@@ -7,11 +7,14 @@
|
|
|
7
7
|
pointer-events: none;
|
|
8
8
|
|
|
9
9
|
&-show-bg {
|
|
10
|
-
background-color:
|
|
10
|
+
background-color: var(
|
|
11
|
+
--alias-colors-bg-accent-blue-subtle-default,
|
|
12
|
+
#d4e7fd
|
|
13
|
+
);
|
|
11
14
|
}
|
|
12
15
|
|
|
13
16
|
&-inner {
|
|
14
|
-
background-color: #
|
|
17
|
+
background-color: var(--alias-colors-icon-information, #2986f4);
|
|
15
18
|
border-radius: 2px 0 0;
|
|
16
19
|
height: 100%;
|
|
17
20
|
width: 0;
|
|
@@ -13,10 +13,10 @@
|
|
|
13
13
|
|
|
14
14
|
.ald-table-main {
|
|
15
15
|
width: 100%;
|
|
16
|
-
color: #171717;
|
|
17
16
|
font-size: 13px;
|
|
18
17
|
line-height: 20px;
|
|
19
18
|
background: #fff;
|
|
19
|
+
color: var(--alias-colors-text-subtle, #4b5563);
|
|
20
20
|
|
|
21
21
|
.ald-table-content {
|
|
22
22
|
display: flex;
|
|
@@ -69,6 +69,7 @@
|
|
|
69
69
|
|
|
70
70
|
.ald-table-th-default {
|
|
71
71
|
font-weight: 500;
|
|
72
|
+
line-height: 16px;
|
|
72
73
|
padding: 0 var(--alias-spacing-200, 16px);
|
|
73
74
|
font-size: 12px;
|
|
74
75
|
overflow: hidden;
|
|
@@ -78,13 +79,13 @@
|
|
|
78
79
|
}
|
|
79
80
|
|
|
80
81
|
.ald-table-td-default {
|
|
82
|
+
line-height: 20px;
|
|
81
83
|
padding: 0 var(--alias-spacing-200, 16px);
|
|
82
84
|
display: flex;
|
|
83
85
|
align-items: center;
|
|
84
86
|
height: 100%;
|
|
85
87
|
font-size: 14px;
|
|
86
88
|
min-height: 47px;
|
|
87
|
-
font-weight: 400;
|
|
88
89
|
overflow: hidden;
|
|
89
90
|
}
|
|
90
91
|
|
|
@@ -102,7 +103,7 @@
|
|
|
102
103
|
}
|
|
103
104
|
|
|
104
105
|
.ald-table-body {
|
|
105
|
-
min-height:
|
|
106
|
+
min-height: 96px;
|
|
106
107
|
overflow: auto;
|
|
107
108
|
|
|
108
109
|
.ald-table-tr {
|
|
@@ -133,7 +133,7 @@
|
|
|
133
133
|
margin-bottom: 20px;
|
|
134
134
|
|
|
135
135
|
&::before {
|
|
136
|
-
border-color:
|
|
136
|
+
border-color: var(--alias-colors-border-default, #e5e7eb);
|
|
137
137
|
}
|
|
138
138
|
}
|
|
139
139
|
|
|
@@ -150,10 +150,6 @@
|
|
|
150
150
|
&.ald-tabs-compact {
|
|
151
151
|
.ant-tabs-nav {
|
|
152
152
|
margin-bottom: 0;
|
|
153
|
-
|
|
154
|
-
&::before {
|
|
155
|
-
border: 0;
|
|
156
|
-
}
|
|
157
153
|
}
|
|
158
154
|
}
|
|
159
155
|
}
|
package/dist/Tree/Tree.d.ts
CHANGED
|
@@ -80,7 +80,7 @@ interface DraggableConfig {
|
|
|
80
80
|
icon?: React.ReactNode | false;
|
|
81
81
|
nodeDraggable?: DraggableFn;
|
|
82
82
|
}
|
|
83
|
-
export interface TreeProps<T extends BasicDataNode = DataNode> extends Omit<RcTreeProps<T>, 'prefixCls' | 'showLine' | 'direction' | 'draggable' | 'icon' | 'switcherIcon'> {
|
|
83
|
+
export interface TreeProps<T extends BasicDataNode = DataNode> extends Omit<RcTreeProps<T>, 'prefixCls' | 'showLine' | 'direction' | 'draggable' | 'icon' | 'switcherIcon' | 'filterTreeNode'> {
|
|
84
84
|
showLine?: boolean | {
|
|
85
85
|
showLeafIcon: boolean | TreeLeafIcon;
|
|
86
86
|
};
|
|
@@ -116,7 +116,7 @@ export interface TreeProps<T extends BasicDataNode = DataNode> extends Omit<RcTr
|
|
|
116
116
|
defaultSelectedKeys?: Key[];
|
|
117
117
|
selectable?: boolean;
|
|
118
118
|
/** 点击树节点触发 */
|
|
119
|
-
|
|
119
|
+
filterTreeNode?: (node: DataNode) => boolean;
|
|
120
120
|
loadedKeys?: Key[];
|
|
121
121
|
/** 设置节点可拖拽(IE>8) */
|
|
122
122
|
draggable?: DraggableFn | boolean | DraggableConfig;
|
package/dist/Tree/Tree.js
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
|
+
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
|
|
3
|
+
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); }
|
|
4
|
+
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; }
|
|
2
5
|
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
3
6
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
4
7
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
@@ -42,6 +45,8 @@ var Tree = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
42
45
|
showTabLeader = props.showTabLeader,
|
|
43
46
|
_props$handlerRender = props.handlerRender,
|
|
44
47
|
handlerRender = _props$handlerRender === void 0 ? noop : _props$handlerRender,
|
|
48
|
+
filterTreeNode = props.filterTreeNode,
|
|
49
|
+
treeData = props.treeData,
|
|
45
50
|
_props$motion = props.motion,
|
|
46
51
|
motion = _props$motion === void 0 ? _objectSpread(_objectSpread({}, collapseMotion), {}, {
|
|
47
52
|
motionAppear: false
|
|
@@ -105,12 +110,61 @@ var Tree = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
105
110
|
}
|
|
106
111
|
});
|
|
107
112
|
};
|
|
113
|
+
var newTreeData = React.useMemo(function () {
|
|
114
|
+
if (!filterTreeNode) return treeData;
|
|
115
|
+
var processNode = function processNode(node) {
|
|
116
|
+
// 初始化一个标志来表示是否需要为当前节点及其所有子节点添加className
|
|
117
|
+
var shouldAddDisabled = true;
|
|
118
|
+
// 检查当前节点的title是否包含目标字符串,包含则不需要添加className
|
|
119
|
+
if (filterTreeNode(node)) {
|
|
120
|
+
shouldAddDisabled = false;
|
|
121
|
+
}
|
|
122
|
+
if (node.children) {
|
|
123
|
+
// 遍历当前节点的子节点
|
|
124
|
+
var _iterator = _createForOfIteratorHelper(node.children),
|
|
125
|
+
_step;
|
|
126
|
+
try {
|
|
127
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
128
|
+
var child = _step.value;
|
|
129
|
+
// 递归调用processNode函数来处理子节点,判断子节点是否需要添加className
|
|
130
|
+
var childShouldAddDisabled = processNode(child);
|
|
131
|
+
shouldAddDisabled = shouldAddDisabled && childShouldAddDisabled;
|
|
132
|
+
}
|
|
133
|
+
} catch (err) {
|
|
134
|
+
_iterator.e(err);
|
|
135
|
+
} finally {
|
|
136
|
+
_iterator.f();
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
// 如果shouldAddDisabled为true,就为当前节点添加className
|
|
141
|
+
if (shouldAddDisabled) {
|
|
142
|
+
node.className = classNames(node.className, 'ald-tree-node-disabled');
|
|
143
|
+
}
|
|
144
|
+
return shouldAddDisabled;
|
|
145
|
+
};
|
|
146
|
+
if (!treeData) return treeData;
|
|
147
|
+
var _iterator2 = _createForOfIteratorHelper(treeData),
|
|
148
|
+
_step2;
|
|
149
|
+
try {
|
|
150
|
+
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
151
|
+
var rootNode = _step2.value;
|
|
152
|
+
processNode(rootNode);
|
|
153
|
+
}
|
|
154
|
+
} catch (err) {
|
|
155
|
+
_iterator2.e(err);
|
|
156
|
+
} finally {
|
|
157
|
+
_iterator2.f();
|
|
158
|
+
}
|
|
159
|
+
return treeData;
|
|
160
|
+
}, [filterTreeNode, treeData]);
|
|
108
161
|
return /*#__PURE__*/React.createElement(RcTree, _extends({
|
|
109
162
|
itemHeight: 20,
|
|
110
163
|
ref: ref,
|
|
111
164
|
virtual: virtual
|
|
112
165
|
}, newProps, {
|
|
113
166
|
prefixCls: prefixCls,
|
|
167
|
+
treeData: newTreeData,
|
|
114
168
|
className: classNames((_classNames = {}, _defineProperty(_classNames, "".concat(prefixCls, "-icon-hide"), !showIcon), _defineProperty(_classNames, "".concat(prefixCls, "-block-node"), blockNode), _defineProperty(_classNames, "".concat(prefixCls, "-unselectable"), !selectable), _defineProperty(_classNames, "".concat(prefixCls, "-large"), size === 'large'), _defineProperty(_classNames, "".concat(prefixCls, "-rtl"), direction === 'rtl'), _defineProperty(_classNames, 'ald-draggable-tree', draggable), _classNames), className),
|
|
115
169
|
direction: direction,
|
|
116
170
|
checkable: checkable ? /*#__PURE__*/React.createElement("span", {
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
2
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
3
|
+
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); }
|
|
4
|
+
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; }
|
|
5
|
+
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
6
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
7
|
+
import { App, Input, Tree } from "../../..";
|
|
8
|
+
import React from 'react';
|
|
9
|
+
export default (function () {
|
|
10
|
+
var _React$useState = React.useState(''),
|
|
11
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
12
|
+
filterKey = _React$useState2[0],
|
|
13
|
+
setFilterKey = _React$useState2[1];
|
|
14
|
+
var _React$useState3 = React.useState([]),
|
|
15
|
+
_React$useState4 = _slicedToArray(_React$useState3, 2),
|
|
16
|
+
expandedKeys = _React$useState4[0],
|
|
17
|
+
setExpandedKeys = _React$useState4[1];
|
|
18
|
+
return /*#__PURE__*/React.createElement(App, null, /*#__PURE__*/React.createElement(Input, {
|
|
19
|
+
onChange: function onChange(v) {
|
|
20
|
+
setFilterKey(v.target.value);
|
|
21
|
+
}
|
|
22
|
+
}), /*#__PURE__*/React.createElement(Tree, {
|
|
23
|
+
size: "large",
|
|
24
|
+
showIcon: true,
|
|
25
|
+
icon: 'icon',
|
|
26
|
+
filterTreeNode: function filterTreeNode(node) {
|
|
27
|
+
var title = node.title;
|
|
28
|
+
if (typeof title === 'string') {
|
|
29
|
+
return title.includes(filterKey);
|
|
30
|
+
}
|
|
31
|
+
return false;
|
|
32
|
+
},
|
|
33
|
+
expandedKeys: expandedKeys,
|
|
34
|
+
onExpand: function onExpand(keys) {
|
|
35
|
+
setExpandedKeys(keys);
|
|
36
|
+
},
|
|
37
|
+
treeData: [{
|
|
38
|
+
title: 'Parent 1',
|
|
39
|
+
key: '0-0',
|
|
40
|
+
children: [{
|
|
41
|
+
title: 'parent 1-0',
|
|
42
|
+
key: '0-0-0',
|
|
43
|
+
children: [{
|
|
44
|
+
title: 'leaf',
|
|
45
|
+
key: '0-0-0-0',
|
|
46
|
+
isLeaf: true
|
|
47
|
+
}, {
|
|
48
|
+
title: 'leaf',
|
|
49
|
+
key: '0-0-0-1',
|
|
50
|
+
isLeaf: true
|
|
51
|
+
}]
|
|
52
|
+
}, {
|
|
53
|
+
title: 'parent 1-1',
|
|
54
|
+
key: '0-0-1',
|
|
55
|
+
children: [{
|
|
56
|
+
title: 'ssss',
|
|
57
|
+
key: '0-0-1-0',
|
|
58
|
+
disabled: true
|
|
59
|
+
}]
|
|
60
|
+
}]
|
|
61
|
+
}]
|
|
62
|
+
}));
|
|
63
|
+
});
|
|
@@ -85,8 +85,12 @@
|
|
|
85
85
|
&-disabled {
|
|
86
86
|
// >>> Title
|
|
87
87
|
.@{custom-tree-prefix-cls}-node-content-wrapper {
|
|
88
|
-
color:
|
|
89
|
-
cursor:
|
|
88
|
+
color: var(--alias-colors-text-default, #1f2937);
|
|
89
|
+
cursor: default;
|
|
90
|
+
font-size: 14px;
|
|
91
|
+
font-style: normal;
|
|
92
|
+
font-weight: 400;
|
|
93
|
+
line-height: 20px;
|
|
90
94
|
|
|
91
95
|
&:hover {
|
|
92
96
|
background: transparent;
|
|
@@ -99,8 +103,8 @@
|
|
|
99
103
|
}
|
|
100
104
|
|
|
101
105
|
&:not(&-disabled).filter-node .@{custom-tree-prefix-cls}-title {
|
|
102
|
-
color: @tree-node-highlight-color;
|
|
103
106
|
font-weight: 500;
|
|
107
|
+
color: var(--alias-colors-text-danger);
|
|
104
108
|
}
|
|
105
109
|
|
|
106
110
|
&-draggable {
|