@aloudata/aloudata-design 1.10.4 → 1.10.5
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/Icon/components/Loading2Line.d.ts +11 -0
- package/dist/Icon/components/Loading2Line.js +35 -0
- package/dist/Icon/index.d.ts +1 -0
- package/dist/Icon/index.js +1 -0
- package/dist/Icon/svg/loading-2-line.svg +6 -0
- package/dist/MemberPicker/index.d.ts +3 -2
- package/dist/MemberPicker/index.js +5 -3
- package/dist/Tree/Tree.js +1 -1
- package/dist/Tree/demo/asyncLoad/index.d.ts +3 -0
- package/dist/Tree/demo/asyncLoad/index.js +76 -0
- package/dist/Tree/style/index.less +9 -0
- package/dist/Tree/utils/iconUtil.d.ts +1 -1
- package/dist/Tree/utils/iconUtil.js +6 -4
- package/package.json +1 -1
|
@@ -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;
|
package/dist/Icon/index.d.ts
CHANGED
|
@@ -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';
|
package/dist/Icon/index.js
CHANGED
|
@@ -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
|
|
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
|
-
|
|
233
|
-
|
|
233
|
+
var MemberSelector = Component;
|
|
234
|
+
MemberSelector.MemberPanel = MemberPanel;
|
|
235
|
+
export default MemberSelector;
|
package/dist/Tree/Tree.js
CHANGED
|
@@ -124,7 +124,7 @@ var Tree = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
124
124
|
return /*#__PURE__*/React.createElement(React.Fragment, null, renderIndent(nodeProps), renderSwitcherIcon(prefixCls, /*#__PURE__*/React.createElement(ChevronDownLine, {
|
|
125
125
|
size: size === 'small' ? TREE_SWITCH_CION_SIZE : TREE_SWITCH_LARGE_ICON_SIZE,
|
|
126
126
|
color: '#B1B1B1'
|
|
127
|
-
}, "\u5C55\u5F00"), showLine, nodeProps));
|
|
127
|
+
}, "\u5C55\u5F00"), showLine, nodeProps, size === 'small' ? TREE_SWITCH_CION_SIZE : TREE_SWITCH_LARGE_ICON_SIZE));
|
|
128
128
|
},
|
|
129
129
|
draggable: draggableConfig
|
|
130
130
|
}), children);
|
|
@@ -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;
|
|
@@ -38,6 +38,11 @@
|
|
|
38
38
|
.ald-tree-switcher {
|
|
39
39
|
display: inline-flex;
|
|
40
40
|
align-items: center;
|
|
41
|
+
font-size: 16px;
|
|
42
|
+
|
|
43
|
+
.ald-tree-switcher-loading-icon {
|
|
44
|
+
animation: loading-circle 1s infinite linear;
|
|
45
|
+
}
|
|
41
46
|
}
|
|
42
47
|
|
|
43
48
|
.ald-tree-node-content-wrapper {
|
|
@@ -77,6 +82,10 @@
|
|
|
77
82
|
.ald-tree-treenode {
|
|
78
83
|
font-size: @tree-font-size-large;
|
|
79
84
|
|
|
85
|
+
.ald-tree-switcher {
|
|
86
|
+
font-size: 20px;
|
|
87
|
+
}
|
|
88
|
+
|
|
80
89
|
.ald-tree-node-content-wrapper {
|
|
81
90
|
.ald-tree-title {
|
|
82
91
|
display: flex;
|
|
@@ -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(
|
|
16
|
-
|
|
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;
|