@aloudata/aloudata-design 2.0.0-beta.11 → 2.0.0-beta.12

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.
@@ -3,3 +3,7 @@
3
3
  @import './type.less';
4
4
  @import './size.less';
5
5
  @import './reset.less';
6
+
7
+ .ant-wave {
8
+ display: none !important;
9
+ }
@@ -47,7 +47,6 @@
47
47
 
48
48
  .ald-checkbox.ald-checkbox {
49
49
  height: 20px;
50
- color: @NL0;
51
50
  font-size: 13px;
52
51
  line-height: 20px;
53
52
 
@@ -57,7 +56,6 @@
57
56
 
58
57
  &.ant-checkbox-wrapper {
59
58
  height: 20px;
60
- color: @NL0;
61
59
  font-weight: 400;
62
60
  font-size: 13px;
63
61
  line-height: 20px;
@@ -157,7 +155,6 @@
157
155
  cursor: default;
158
156
 
159
157
  & + span {
160
- color: @NL0;
161
158
  cursor: default;
162
159
  }
163
160
 
@@ -7,6 +7,7 @@
7
7
  .ald-data-preview-table {
8
8
  border: 1px solid var(--alias-colors-border-default, #e5e7eb);
9
9
  font-size: 12px;
10
+ font-variant-numeric: lining-nums tabular-nums;
10
11
  position: relative;
11
12
 
12
13
  * {
@@ -34,7 +35,7 @@
34
35
  font-weight: 500;
35
36
 
36
37
  .ald-data-preview-header-default {
37
- padding: 6px 4px;
38
+ padding: 4px 13px 3px 20px;
38
39
  height: 100%;
39
40
  width: 100%;
40
41
  line-height: 20px;
@@ -1,5 +1,5 @@
1
1
  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); }
2
- var _excluded = ["children", "open", "overlayClassName", "menu", "align", "placement"];
2
+ var _excluded = ["children", "open", "overlayClassName", "menu", "align", "placement", "trigger"];
3
3
  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); }
4
4
  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; }
5
5
  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; }
@@ -21,6 +21,8 @@ export default function Dropdown(props) {
21
21
  menu = props.menu,
22
22
  align = props.align,
23
23
  placement = props.placement,
24
+ _props$trigger = props.trigger,
25
+ trigger = _props$trigger === void 0 ? ['click'] : _props$trigger,
24
26
  otherProps = _objectWithoutProperties(props, _excluded);
25
27
  // antd 根据 open 字段是否存在来判断 open 是否是可控模式
26
28
  var antdDropdownProps = otherProps;
@@ -52,6 +54,7 @@ export default function Dropdown(props) {
52
54
  overlayClassName: classNames('ald-dropdown-overlay', overlayClassName),
53
55
  menu: menus,
54
56
  align: defaultAlign,
57
+ trigger: trigger,
55
58
  placement: placement
56
59
  }, antdDropdownProps), children);
57
60
  }
@@ -17,6 +17,17 @@
17
17
  background-color: unset;
18
18
  }
19
19
 
20
+ .ant-dropdown-menu-item-danger {
21
+ color: #b91c1c !important;
22
+
23
+ &:hover {
24
+ background: var(
25
+ --alias-colors-bg-interaction-hover,
26
+ rgba(0, 0, 0, 0.05)
27
+ ) !important;
28
+ }
29
+ }
30
+
20
31
  .ant-dropdown-menu-item,
21
32
  .ant-dropdown-menu-submenu .ant-dropdown-menu-submenu-title {
22
33
  display: flex;
@@ -38,8 +38,8 @@
38
38
  }
39
39
 
40
40
  .ald-empty-description {
41
- color: @NL40;
42
- font-size: 13px;
41
+ color: var(--alias-colors-text-subtlest, #9ca3af);
42
+ font-size: 12px;
43
43
  line-height: 20px;
44
44
  font-weight: 400;
45
45
  }
@@ -0,0 +1,11 @@
1
+ import type { SVGProps } from 'react';
2
+ import * as React from 'react';
3
+ interface SVGRProps {
4
+ size?: number | string;
5
+ title?: string;
6
+ titleId?: string;
7
+ desc?: string;
8
+ descId?: string;
9
+ }
10
+ declare const Memo: React.MemoExoticComponent<React.ForwardRefExoticComponent<Omit<SVGProps<SVGSVGElement> & SVGRProps, "ref"> & React.RefAttributes<SVGSVGElement>>>;
11
+ export default Memo;
@@ -0,0 +1,35 @@
1
+ var _excluded = ["title", "titleId", "desc", "descId"];
2
+ 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); }
3
+ function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
4
+ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
5
+ import * as React from 'react';
6
+ import { forwardRef, memo } from 'react';
7
+ var TimesLightLine = function TimesLightLine(_ref, ref) {
8
+ var title = _ref.title,
9
+ titleId = _ref.titleId,
10
+ desc = _ref.desc,
11
+ descId = _ref.descId,
12
+ props = _objectWithoutProperties(_ref, _excluded);
13
+ return /*#__PURE__*/React.createElement("svg", _extends({
14
+ xmlns: "http://www.w3.org/2000/svg",
15
+ width: props.width || props.size || 16,
16
+ height: props.height || props.size || 16,
17
+ fill: "none",
18
+ viewBox: "0 0 24 24",
19
+ ref: ref,
20
+ "aria-labelledby": titleId,
21
+ "aria-describedby": descId
22
+ }, props), desc ? /*#__PURE__*/React.createElement("desc", {
23
+ id: descId
24
+ }, desc) : null, title ? /*#__PURE__*/React.createElement("title", {
25
+ id: titleId
26
+ }, title) : null, /*#__PURE__*/React.createElement("path", {
27
+ fill: props.color || 'currentColor',
28
+ fillRule: "evenodd",
29
+ d: "M17.53 7.53a.75.75 0 1 0-1.06-1.06L12 10.94 7.53 6.47a.75.75 0 0 0-1.06 1.06L10.94 12l-4.47 4.47a.75.75 0 0 0 1.06 1.06L12 13.06l4.47 4.47a.75.75 0 0 0 1.06-1.06L13.06 12l4.47-4.47Z",
30
+ clipRule: "evenodd"
31
+ }));
32
+ };
33
+ var ForwardRef = /*#__PURE__*/forwardRef(TimesLightLine);
34
+ var Memo = /*#__PURE__*/memo(ForwardRef);
35
+ export default Memo;
@@ -33,6 +33,7 @@ export { default as LoadingDuotone } from './components/LoadingDuotone';
33
33
  export { default as LoadingLine } from './components/LoadingLine';
34
34
  export { default as MoreVerticalLine } from './components/MoreVerticalLine';
35
35
  export { default as SearchLine } from './components/SearchLine';
36
+ export { default as TimesLightLine } from './components/TimesLightLine';
36
37
  export { default as TriangleLightLine } from './components/TriangleLightLine';
37
38
  export { default as User } from './components/User';
38
39
  export { default as UserGroup } from './components/UserGroup';
@@ -33,6 +33,7 @@ export { default as LoadingDuotone } from "./components/LoadingDuotone";
33
33
  export { default as LoadingLine } from "./components/LoadingLine";
34
34
  export { default as MoreVerticalLine } from "./components/MoreVerticalLine";
35
35
  export { default as SearchLine } from "./components/SearchLine";
36
+ export { default as TimesLightLine } from "./components/TimesLightLine";
36
37
  export { default as TriangleLightLine } from "./components/TriangleLightLine";
37
38
  export { default as User } from "./components/User";
38
39
  export { default as UserGroup } from "./components/UserGroup";
@@ -0,0 +1,5 @@
1
+ <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <g id=" Icon / Light / Icon / Math / Times-light-line">
3
+ <path id="Icon" fill-rule="evenodd" clip-rule="evenodd" d="M17.5303 7.53045C17.8232 7.23756 17.8232 6.76269 17.5303 6.46979C17.2374 6.1769 16.7625 6.1769 16.4696 6.46979L12 10.9394L7.53037 6.46979C7.23747 6.1769 6.7626 6.1769 6.46971 6.46979C6.17681 6.76269 6.17681 7.23756 6.46971 7.53045L10.9393 12.0001L6.46964 16.4698C6.17675 16.7627 6.17675 17.2376 6.46964 17.5305C6.76253 17.8233 7.23741 17.8233 7.5303 17.5305L12 13.0607L16.4697 17.5305C16.7626 17.8233 17.2375 17.8233 17.5304 17.5305C17.8233 17.2376 17.8233 16.7627 17.5304 16.4698L13.0607 12.0001L17.5303 7.53045Z" fill="black"/>
4
+ </g>
5
+ </svg>
@@ -1,4 +1,4 @@
1
- var _excluded = ["icon", "onClick", "disabled", "size", "menu", "className", "onOpenChange", "tooltip", "id", "showArrow", "mode"];
1
+ var _excluded = ["icon", "onClick", "disabled", "size", "menu", "className", "onOpenChange", "tooltip", "id", "trigger", "showArrow", "mode"];
2
2
  function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
3
3
  function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
4
4
  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); }
@@ -57,6 +57,8 @@ var DropdownButton = /*#__PURE__*/forwardRef(function (props, ref) {
57
57
  onOpenChange = props.onOpenChange,
58
58
  tooltip = props.tooltip,
59
59
  id = props.id,
60
+ _props$trigger = props.trigger,
61
+ trigger = _props$trigger === void 0 ? ['click'] : _props$trigger,
60
62
  _props$showArrow = props.showArrow,
61
63
  showArrow = _props$showArrow === void 0 ? true : _props$showArrow,
62
64
  _props$mode2 = props.mode,
@@ -93,6 +95,7 @@ var DropdownButton = /*#__PURE__*/forwardRef(function (props, ref) {
93
95
  title: tooltip === null || tooltip === void 0 ? void 0 : tooltip.title
94
96
  }), /*#__PURE__*/React.createElement(Dropdown, _extends({
95
97
  menu: menu,
98
+ trigger: trigger,
96
99
  onOpenChange: onOpenChange
97
100
  }, restDropdownProps), /*#__PURE__*/React.createElement("div", {
98
101
  id: id,
@@ -47,7 +47,7 @@ var Input = /*#__PURE__*/React.forwardRef(function (props, ref) {
47
47
  allowClear: allowClear ? {
48
48
  clearIcon: /*#__PURE__*/React.createElement(CloseCircleFill, {
49
49
  size: 20,
50
- color: "#6B7280"
50
+ color: "#9CA3AF"
51
51
  })
52
52
  } : undefined,
53
53
  spellCheck: false,
@@ -1,5 +1,5 @@
1
1
  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); }
2
- var _excluded = ["bordered", "size", "disabled", "className"];
2
+ var _excluded = ["bordered", "size", "disabled", "className", "allowClear"];
3
3
  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); }
4
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
5
  function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
@@ -19,6 +19,8 @@ export default /*#__PURE__*/React.forwardRef(function (props, ref) {
19
19
  disabled = props.disabled,
20
20
  _props$className = props.className,
21
21
  className = _props$className === void 0 ? '' : _props$className,
22
+ _props$allowClear = props.allowClear,
23
+ allowClear = _props$allowClear === void 0 ? false : _props$allowClear,
22
24
  rest = _objectWithoutProperties(props, _excluded);
23
25
  var contentSize = useContext(SizeContext);
24
26
  var size = customSize || contentSize || 'middle';
@@ -27,12 +29,12 @@ export default /*#__PURE__*/React.forwardRef(function (props, ref) {
27
29
  disabled: disabled,
28
30
  spellCheck: false,
29
31
  className: classnames('ald-input', 'ald-input-textarea', "ald-input-textarea-".concat(getSizeType(size)), _defineProperty({}, "ald-input-disabled", disabled), className),
30
- allowClear: {
32
+ allowClear: allowClear ? {
31
33
  clearIcon: /*#__PURE__*/React.createElement(CloseCircleFill, {
32
34
  size: 20,
33
- color: "#6B7280"
35
+ color: "#9CA3AF"
34
36
  })
35
- },
37
+ } : false,
36
38
  ref: ref,
37
39
  bordered: bordered
38
40
  }));
@@ -10,9 +10,10 @@ import { useRequest } from 'ahooks';
10
10
  import classNames from 'classnames';
11
11
  import _ from 'lodash';
12
12
  import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react';
13
+ import Avatar from "../Avatar";
13
14
  import ConfigProvider from "../ConfigProvider";
14
15
  import { EUserType } from "../ConfigProvider/getUserList";
15
- import { User } from "../Icon";
16
+ import { UserGroup } from "../Icon";
16
17
  import Select from "../Select";
17
18
  import message from "../message";
18
19
  import Panel from "./components/Panel";
@@ -35,7 +36,9 @@ var Component = function Component(_ref) {
35
36
  disabled = _ref.disabled,
36
37
  _onClear = _ref.onClear,
37
38
  size = _ref.size,
38
- selectType = _ref.selectType,
39
+ _ref$selectType = _ref.selectType,
40
+ selectType = _ref$selectType === void 0 ? 'secondary' : _ref$selectType,
41
+ propPrefix = _ref.prefix,
39
42
  _ref$lockedIds = _ref.lockedIds,
40
43
  lockedIds = _ref$lockedIds === void 0 ? [] : _ref$lockedIds;
41
44
  var _ConfigProvider$useGe = ConfigProvider.useGetUserList(),
@@ -184,15 +187,19 @@ var Component = function Component(_ref) {
184
187
  onOpenChange === null || onOpenChange === void 0 ? void 0 : onOpenChange(open);
185
188
  }, [onOpenChange]);
186
189
  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, {
190
+ if (multiple) return propPrefix;
191
+ if (type === EMemberPicker.USER) {
192
+ var user = searchUserList[0];
193
+ return /*#__PURE__*/React.createElement(Avatar, {
194
+ src: user === null || user === void 0 ? void 0 : user.photo,
195
+ size: 20
196
+ });
197
+ }
198
+ if (type === EMemberPicker.GROUP) return /*#__PURE__*/React.createElement(UserGroup, {
192
199
  size: 20
193
200
  });
194
- return null;
195
- }, [multiple, type]);
201
+ return propPrefix;
202
+ }, [multiple, propPrefix, searchUserList, type]);
196
203
  return /*#__PURE__*/React.createElement(Select, {
197
204
  prefix: prefix,
198
205
  size: size,
@@ -19,7 +19,8 @@
19
19
  &.ald-member-picker-multiple {
20
20
  display: flex;
21
21
  flex-wrap: wrap;
22
- border-radius: 2px;
22
+ border-radius: 6px;
23
+ overflow: hidden;
23
24
  // .memberSelection {
24
25
  // }
25
26
 
@@ -29,7 +29,7 @@ import React, { forwardRef, useContext, useEffect, useImperativeHandle, useMemo,
29
29
  import { ConfigContext } from "../ConfigProvider";
30
30
  import SizeContext from "../ConfigProvider/sizeContext";
31
31
  import Empty from "../Empty";
32
- import { ArrowDownFill, CloseLightLine } from "../Icon";
32
+ import { ArrowDownFill, TimesLightLine } from "../Icon";
33
33
  import Option from "./components/Option";
34
34
  var DEFAULT_ALL_OPTION_VALUE = 'default_all_option_value';
35
35
  var DEFAULT_LIST_ITEM_HEIGHT = 36;
@@ -395,8 +395,9 @@ var Select = /*#__PURE__*/forwardRef(function (props, ref) {
395
395
  className: classNames({
396
396
  'ald-select-prefix-select': !!prefix || prefix === 0
397
397
  }),
398
- clearIcon: /*#__PURE__*/React.createElement(CloseLightLine, {
399
- className: "ald-select-clear-icon"
398
+ clearIcon: /*#__PURE__*/React.createElement(TimesLightLine, {
399
+ className: "ald-select-clear-icon",
400
+ color: "#9CA3AF"
400
401
  }),
401
402
  style: {
402
403
  width: '100%'
@@ -16,6 +16,7 @@
16
16
  cursor: pointer;
17
17
  border-width: 1px;
18
18
  border-style: solid;
19
+ min-width: 192px;
19
20
 
20
21
  .ald-select-prefix {
21
22
  color: var(--alias-colors-text-subtle, #4b5563);
@@ -27,6 +27,7 @@
27
27
  align-items: center;
28
28
  flex: none;
29
29
  right: 0;
30
+ background-color: transparent;
30
31
 
31
32
  &::before {
32
33
  position: absolute;
@@ -28,12 +28,22 @@
28
28
 
29
29
  cursor: default;
30
30
 
31
- .ant-select .ant-select-selector {
31
+ .ant-select {
32
32
  cursor: default;
33
33
 
34
+ .ant-select-selector {
35
+ cursor: default;
36
+ }
37
+
34
38
  .ant-select-selection-search input {
35
39
  cursor: default;
36
40
  }
41
+
42
+ .ant-select-arrow {
43
+ .ald-select-suffix-icon {
44
+ color: var(--alias-colors-icon-disabled, rgba(0, 0, 0, 0.25));
45
+ }
46
+ }
37
47
  }
38
48
  }
39
49
 
@@ -73,6 +83,12 @@
73
83
  .ant-select-selection-search input {
74
84
  cursor: default;
75
85
  }
86
+
87
+ .ant-select-arrow {
88
+ .ald-select-suffix-icon {
89
+ color: var(--alias-colors-icon-disabled, rgba(0, 0, 0, 0.25));
90
+ }
91
+ }
76
92
  }
77
93
  }
78
94
  }
@@ -70,7 +70,7 @@
70
70
  .ald-table-th-default {
71
71
  font-weight: 500;
72
72
  line-height: 16px;
73
- padding: 0 var(--alias-spacing-200, 16px);
73
+ padding-left: var(--alias-spacing-200, 16px);
74
74
  font-size: 12px;
75
75
  overflow: hidden;
76
76
  height: 40px;
@@ -80,7 +80,7 @@
80
80
 
81
81
  .ald-table-td-default {
82
82
  line-height: 20px;
83
- padding: 0 var(--alias-spacing-200, 16px);
83
+ padding-left: var(--alias-spacing-200, 16px);
84
84
  display: flex;
85
85
  align-items: center;
86
86
  height: 100%;
@@ -1,6 +1,6 @@
1
- import React from 'react';
2
1
  import AntdTooltip from 'antd/lib/tooltip';
3
2
  import classNames from 'classnames';
3
+ import React from 'react';
4
4
  export default function Tooltip(props) {
5
5
  var children = props.children,
6
6
  title = props.title,
@@ -9,8 +9,10 @@ export default function Tooltip(props) {
9
9
  trigger = props.trigger,
10
10
  zIndex = props.zIndex,
11
11
  placement = props.placement,
12
- mouseEnterDelay = props.mouseEnterDelay,
13
- mouseLeaveDelay = props.mouseLeaveDelay,
12
+ _props$mouseEnterDela = props.mouseEnterDelay,
13
+ mouseEnterDelay = _props$mouseEnterDela === void 0 ? 0 : _props$mouseEnterDela,
14
+ _props$mouseLeaveDela = props.mouseLeaveDelay,
15
+ mouseLeaveDelay = _props$mouseLeaveDela === void 0 ? 0 : _props$mouseLeaveDela,
14
16
  getPopupContainer = props.getPopupContainer,
15
17
  destroyTooltipOnHide = props.destroyTooltipOnHide,
16
18
  getTooltipContainer = props.getTooltipContainer,
package/dist/Tree/Tree.js CHANGED
@@ -158,6 +158,15 @@ var Tree = /*#__PURE__*/React.forwardRef(function (props, ref) {
158
158
  }
159
159
  return treeData;
160
160
  }, [filterTreeNode, treeData]);
161
+ var noChildren = React.useMemo(function () {
162
+ if (newTreeData !== null && newTreeData !== void 0 && newTreeData.length) {
163
+ return newTreeData.every(function (node) {
164
+ var _node$children;
165
+ return !((_node$children = node.children) !== null && _node$children !== void 0 && _node$children.length);
166
+ });
167
+ }
168
+ return true;
169
+ }, [newTreeData]);
161
170
  return /*#__PURE__*/React.createElement(RcTree, _extends({
162
171
  itemHeight: 20,
163
172
  ref: ref,
@@ -165,7 +174,7 @@ var Tree = /*#__PURE__*/React.forwardRef(function (props, ref) {
165
174
  }, newProps, {
166
175
  prefixCls: prefixCls,
167
176
  treeData: newTreeData,
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),
177
+ 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), _defineProperty(_classNames, "".concat(prefixCls, "-no-children"), noChildren), _classNames), className),
169
178
  direction: direction,
170
179
  checkable: checkable ? /*#__PURE__*/React.createElement("span", {
171
180
  className: "".concat(prefixCls, "-checkbox-inner")
@@ -176,7 +185,7 @@ var Tree = /*#__PURE__*/React.forwardRef(function (props, ref) {
176
185
  switcherIcon: function switcherIcon(nodeProps) {
177
186
  return /*#__PURE__*/React.createElement(React.Fragment, null, renderIndent(nodeProps), renderSwitcherIcon(prefixCls, /*#__PURE__*/React.createElement(ChevronDownLine, {
178
187
  size: size === 'small' ? TREE_SWITCH_CION_SIZE : TREE_SWITCH_LARGE_ICON_SIZE,
179
- color: '#a2a2a2'
188
+ color: '#9CA3AF'
180
189
  }, "\u5C55\u5F00"), showLine, nodeProps, size === 'small' ? TREE_SWITCH_CION_SIZE : TREE_SWITCH_LARGE_ICON_SIZE));
181
190
  },
182
191
  draggable: draggableConfig
@@ -33,6 +33,9 @@ export default (function () {
33
33
  disabled: true
34
34
  }]
35
35
  }]
36
+ }, {
37
+ title: 'Parent 2',
38
+ key: '1-1'
36
39
  }]
37
40
  }));
38
41
  });
@@ -31,6 +31,12 @@
31
31
  opacity: 1;
32
32
  }
33
33
  }
34
+
35
+ &.ald-tree-no-children {
36
+ .ald-tree-switcher {
37
+ display: none;
38
+ }
39
+ }
34
40
  }
35
41
 
36
42
  .ald-tree-treenode {