@aloudata/aloudata-design 1.10.4 → 1.10.6

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.
@@ -0,0 +1,11 @@
1
+ import type { SVGProps } from 'react';
2
+ import * as React from 'react';
3
+ interface SVGRProps {
4
+ size?: number;
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 Loading2Line = function Loading2Line(_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: "M11.5 7V3h1v4h-1Zm0 14v-4h1v4h-1Zm5.5-9.5h4v1h-4v-1Zm-14 0h4v1H3v-1Zm15.718 6.51-2.829-2.828-.707.707 2.828 2.829.707-.708Zm-9.9-9.9L5.99 5.283l-.708.708 2.829 2.828.707-.707Zm0 7.78L5.99 18.717l-.708-.708 2.829-2.828.707.707Zm9.9-9.9-2.829 2.828-.707-.707 2.828-2.829.707.708Z",
30
+ clipRule: "evenodd"
31
+ }));
32
+ };
33
+ var ForwardRef = /*#__PURE__*/forwardRef(Loading2Line);
34
+ var Memo = /*#__PURE__*/memo(ForwardRef);
35
+ export default Memo;
@@ -15,6 +15,7 @@ export { default as FoldUpFill } from './components/FoldUpFill';
15
15
  export type { IBaseIconProps } from './components/Icon';
16
16
  export { default as InfoCircleDuotone } from './components/InfoCircleDuotone';
17
17
  export { default as InfoCircleLine } from './components/InfoCircleLine';
18
+ export { default as Loading2Line } from './components/Loading2Line';
18
19
  export { default as LoadingLine } from './components/LoadingLine';
19
20
  export { default as MoreVerticalLine } from './components/MoreVerticalLine';
20
21
  export { default as SearchLine } from './components/SearchLine';
@@ -14,6 +14,7 @@ export { default as FoldDownFill } from "./components/FoldDownFill";
14
14
  export { default as FoldUpFill } from "./components/FoldUpFill";
15
15
  export { default as InfoCircleDuotone } from "./components/InfoCircleDuotone";
16
16
  export { default as InfoCircleLine } from "./components/InfoCircleLine";
17
+ export { default as Loading2Line } from "./components/Loading2Line";
17
18
  export { default as LoadingLine } from "./components/LoadingLine";
18
19
  export { default as MoreVerticalLine } from "./components/MoreVerticalLine";
19
20
  export { default as SearchLine } from "./components/SearchLine";
@@ -0,0 +1,6 @@
1
+ <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <g id="loading2-line">
3
+ <path id="Icon" fill-rule="evenodd" clip-rule="evenodd" d="M11.5 7V3H12.5V7H11.5ZM11.5 21V17H12.5V21H11.5ZM17 11.5H21V12.5H17V11.5ZM3 11.5H7V12.5H3V11.5ZM18.7175 18.0104L15.8891 15.1819L15.182 15.8891L18.0104 18.7175L18.7175 18.0104ZM8.81802 8.11088L5.98959 5.28245L5.28249 5.98956L8.11091 8.81799L8.81802 8.11088ZM8.81802 15.8891L5.98959 18.7175L5.28249 18.0104L8.11091 15.182L8.81802 15.8891ZM18.7175 5.98961L15.8891 8.81803L15.182 8.11093L18.0104 5.2825L18.7175 5.98961Z" fill="black"/>
4
+ </g>
5
+ </svg>
6
+
@@ -1,6 +1,7 @@
1
1
  import React from 'react';
2
2
  import MemberPanel from './components/PanelWrapper';
3
3
  import { IMemberPickerProps } from './interface';
4
- declare const MemberSelector: React.FC<IMemberPickerProps>;
4
+ declare const MemberSelector: React.FC<IMemberPickerProps> & {
5
+ MemberPanel: typeof MemberPanel;
6
+ };
5
7
  export default MemberSelector;
6
- export { MemberPanel };
@@ -25,7 +25,7 @@ import MemberPanel from "./components/PanelWrapper";
25
25
  import { EMemberPicker } from "./interface";
26
26
  import { getId, getPhoto } from "./utils";
27
27
  import { isUser, isUserGroup } from "./utils/getUsersWithUserId";
28
- var MemberSelector = function MemberSelector(_ref) {
28
+ var Component = function Component(_ref) {
29
29
  var value = _ref.value,
30
30
  _ref$type = _ref.type,
31
31
  type = _ref$type === void 0 ? EMemberPicker.USER : _ref$type,
@@ -137,6 +137,7 @@ var MemberSelector = function MemberSelector(_ref) {
137
137
  var onSelectedChange = useCallback(function (users) {
138
138
  if (multiple) {
139
139
  onChange === null || onChange === void 0 ? void 0 : onChange(users);
140
+ setSelectedUserList(users);
140
141
  } else {
141
142
  onChange === null || onChange === void 0 ? void 0 : onChange(users[0]);
142
143
  }
@@ -229,5 +230,6 @@ var MemberSelector = function MemberSelector(_ref) {
229
230
  fill: "#858585"
230
231
  }))));
231
232
  };
232
- export default MemberSelector;
233
- export { MemberPanel };
233
+ var MemberSelector = Component;
234
+ MemberSelector.MemberPanel = MemberPanel;
235
+ export default MemberSelector;
package/dist/Tree/Tree.js CHANGED
@@ -12,7 +12,6 @@ import * as React from 'react';
12
12
  import { ConfigContext } from "../ConfigProvider";
13
13
  import { ChevronDownLine, DragLine } from "../Icon";
14
14
  import collapseMotion from "../_utils/motion";
15
- import theme from "../style/themes/default/themeColor.module.less";
16
15
  import dropIndicatorRender from "./utils/dropIndicator";
17
16
  import renderSwitcherIcon from "./utils/iconUtil";
18
17
  var TREE_SWITCH_LARGE_ICON_SIZE = 20;
@@ -69,7 +68,7 @@ var Tree = /*#__PURE__*/React.forwardRef(function (props, ref) {
69
68
  }
70
69
  var newIcon = /*#__PURE__*/React.createElement(DragLine, {
71
70
  size: TREE_SWITCH_CION_SIZE,
72
- color: theme.NL50
71
+ color: "#a2a2a2"
73
72
  });
74
73
  var mergedDraggable = {
75
74
  icon: newIcon
@@ -123,8 +122,8 @@ var Tree = /*#__PURE__*/React.forwardRef(function (props, ref) {
123
122
  switcherIcon: function switcherIcon(nodeProps) {
124
123
  return /*#__PURE__*/React.createElement(React.Fragment, null, renderIndent(nodeProps), renderSwitcherIcon(prefixCls, /*#__PURE__*/React.createElement(ChevronDownLine, {
125
124
  size: size === 'small' ? TREE_SWITCH_CION_SIZE : TREE_SWITCH_LARGE_ICON_SIZE,
126
- color: '#B1B1B1'
127
- }, "\u5C55\u5F00"), showLine, nodeProps));
125
+ color: '#a2a2a2'
126
+ }, "\u5C55\u5F00"), showLine, nodeProps, size === 'small' ? TREE_SWITCH_CION_SIZE : TREE_SWITCH_LARGE_ICON_SIZE));
128
127
  },
129
128
  draggable: draggableConfig
130
129
  }), children);
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ declare const App: React.FC;
3
+ export default App;
@@ -0,0 +1,76 @@
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
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
3
+ 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."); }
4
+ 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); }
5
+ 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; }
6
+ 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; } }
7
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
8
+ 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; }
9
+ 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; }
10
+ 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; }
11
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
12
+ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
13
+ import { Tree } from "../../..";
14
+ import React, { useState } from 'react';
15
+ var initTreeData = [{
16
+ title: 'Expand to load',
17
+ key: '0'
18
+ }, {
19
+ title: 'Expand to load',
20
+ key: '1'
21
+ }, {
22
+ title: 'Tree Node',
23
+ key: '2',
24
+ isLeaf: true
25
+ }];
26
+
27
+ // It's just a simple demo. You can use tree map to optimize update perf.
28
+ var updateTreeData = function updateTreeData(list, key, children) {
29
+ return list.map(function (node) {
30
+ if (node.key === key) {
31
+ return _objectSpread(_objectSpread({}, node), {}, {
32
+ children: children
33
+ });
34
+ }
35
+ if (node.children) {
36
+ return _objectSpread(_objectSpread({}, node), {}, {
37
+ children: updateTreeData(node.children, key, children)
38
+ });
39
+ }
40
+ return node;
41
+ });
42
+ };
43
+ var App = function App() {
44
+ var _useState = useState(initTreeData),
45
+ _useState2 = _slicedToArray(_useState, 2),
46
+ treeData = _useState2[0],
47
+ setTreeData = _useState2[1];
48
+ var onLoadData = function onLoadData(_ref) {
49
+ var key = _ref.key,
50
+ children = _ref.children;
51
+ return new Promise(function (resolve) {
52
+ if (children) {
53
+ resolve();
54
+ return;
55
+ }
56
+ setTimeout(function () {
57
+ setTreeData(function (origin) {
58
+ return updateTreeData(origin, key, [{
59
+ title: 'Child Node',
60
+ key: "".concat(key, "-0")
61
+ }, {
62
+ title: 'Child Node',
63
+ key: "".concat(key, "-1")
64
+ }]);
65
+ });
66
+ resolve();
67
+ }, 100000);
68
+ });
69
+ };
70
+ return /*#__PURE__*/React.createElement(Tree, {
71
+ size: "large",
72
+ loadData: onLoadData,
73
+ treeData: treeData
74
+ });
75
+ };
76
+ export default App;
@@ -2,6 +2,9 @@ import { App, Tree } from "../../..";
2
2
  import React from 'react';
3
3
  export default (function () {
4
4
  return /*#__PURE__*/React.createElement(App, null, /*#__PURE__*/React.createElement(Tree, {
5
+ size: "large",
6
+ showIcon: true,
7
+ icon: 'icon',
5
8
  treeData: [{
6
9
  title: 'Parent 1',
7
10
  key: '0-0',
@@ -21,6 +21,12 @@
21
21
 
22
22
  .ald-tree.draggable-tree {
23
23
  padding: 3px 0;
24
+
25
+ .ald-tree-treenode {
26
+ .ald-tree-draggable-icon {
27
+ opacity: 1;
28
+ }
29
+ }
24
30
  }
25
31
 
26
32
  .ald-tree-treenode {
@@ -29,29 +35,48 @@
29
35
  font-size: @tree-font-size-default;
30
36
  font-weight: 400;
31
37
  color: #171717;
38
+ width: 100%;
32
39
 
33
40
  .ald-tree-draggable-icon {
34
41
  display: inline-flex;
35
42
  align-items: center;
43
+ cursor: pointer;
36
44
  }
37
45
 
38
46
  .ald-tree-switcher {
39
47
  display: inline-flex;
40
48
  align-items: center;
49
+ font-size: 16px;
50
+
51
+ .ald-tree-switcher-loading-icon {
52
+ animation: loading-circle 1s infinite linear;
53
+ }
41
54
  }
42
55
 
43
56
  .ald-tree-node-content-wrapper {
44
- padding: 0;
57
+ padding: @tree-padding-default;
58
+ line-height: @tree-line-height-default;
45
59
  flex: 1;
60
+ display: flex;
61
+ align-items: center;
62
+ // stylelint-disable-next-line
63
+ .ald-tree-iconEle {
64
+ display: inline-flex;
65
+ align-items: center;
66
+ margin-right: 4px;
67
+ width: fit-content;
68
+ height: fit-content;
69
+ line-height: inherit;
70
+ }
46
71
 
47
72
  .ald-tree-title {
48
- padding: @tree-padding-default;
49
73
  line-height: @tree-line-height-default;
50
74
  border-radius: 2px;
51
- display: flex;
75
+ display: inline-flex;
52
76
  align-items: center;
53
77
  justify-content: space-between;
54
78
  color: #171717;
79
+ flex: 1;
55
80
 
56
81
  .ald-tree-tab-leader {
57
82
  flex: 1;
@@ -76,11 +101,16 @@
76
101
  .ald-tree-large {
77
102
  .ald-tree-treenode {
78
103
  font-size: @tree-font-size-large;
104
+ line-height: @tree-line-height-large;
105
+
106
+ .ald-tree-switcher {
107
+ font-size: 20px;
108
+ }
79
109
 
80
110
  .ald-tree-node-content-wrapper {
111
+ padding: @tree-padding-large;
112
+
81
113
  .ald-tree-title {
82
- display: flex;
83
- padding: @tree-padding-large;
84
114
  line-height: @tree-line-height-large;
85
115
  }
86
116
  }
@@ -2,4 +2,4 @@ import * as React from 'react';
2
2
  import type { AldTreeNodeProps, SwitcherIcon, TreeLeafIcon } from '../Tree';
3
3
  export default function renderSwitcherIcon(prefixCls: string, switcherIcon: SwitcherIcon, showLine: boolean | {
4
4
  showLeafIcon: boolean | TreeLeafIcon;
5
- } | undefined, treeNodeProps: AldTreeNodeProps): React.ReactNode;
5
+ } | undefined, treeNodeProps: AldTreeNodeProps, iconSize: number): React.ReactNode;
@@ -1,19 +1,21 @@
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
2
  import CaretDownFilled from '@ant-design/icons/CaretDownFilled';
3
3
  import FileOutlined from '@ant-design/icons/FileOutlined';
4
- import LoadingOutlined from '@ant-design/icons/LoadingOutlined';
5
4
  import MinusSquareOutlined from '@ant-design/icons/MinusSquareOutlined';
6
5
  import PlusSquareOutlined from '@ant-design/icons/PlusSquareOutlined';
7
6
  import classNames from 'classnames';
8
7
  import * as React from 'react';
8
+ import { Loading2Line } from "../../Icon";
9
9
  import { cloneElement, isValidElement } from "../../_utils/reactNode";
10
- export default function renderSwitcherIcon(prefixCls, switcherIcon, showLine, treeNodeProps) {
10
+ export default function renderSwitcherIcon(prefixCls, switcherIcon, showLine, treeNodeProps, iconSize) {
11
11
  var isLeaf = treeNodeProps.isLeaf,
12
12
  expanded = treeNodeProps.expanded,
13
13
  loading = treeNodeProps.loading;
14
14
  if (loading) {
15
- return /*#__PURE__*/React.createElement(LoadingOutlined, {
16
- className: "".concat(prefixCls, "-switcher-loading-icon")
15
+ return /*#__PURE__*/React.createElement(Loading2Line, {
16
+ color: '#3271c9',
17
+ size: iconSize,
18
+ className: "".concat(prefixCls, "-switcher-loading-icon ")
17
19
  });
18
20
  }
19
21
  var showLeafIcon;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aloudata/aloudata-design",
3
- "version": "1.10.4",
3
+ "version": "1.10.6",
4
4
  "description": "",
5
5
  "license": "MIT",
6
6
  "module": "dist/index.js",