@aloudata/aloudata-design 2.0.0-beta.4 → 2.0.0-beta.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.
- package/dist/Dropdown/style/index.less +2 -0
- package/dist/Empty/image/Search.js +2 -2
- package/dist/Empty/image/SearchSmall.js +2 -2
- package/dist/Input/style/reset.less +0 -2
- package/dist/MemberPicker/components/MultipleOption.js +2 -3
- package/dist/MemberPicker/index.js +2 -0
- package/dist/MemberPicker/interface.d.ts +1 -0
- package/dist/MemberPicker/style/index.less +5 -1
- package/dist/Pagination/index.d.ts +1 -1
- package/dist/Pagination/index.js +7 -1
- package/dist/Pagination/types.d.ts +1 -0
- package/dist/Select/index.js +0 -1
- package/dist/Select/style/index.less +1 -0
- package/dist/Spin/style/index.less +8 -0
- package/dist/Table/components/Pagination/index.js +3 -1
- package/dist/Table/index.js +1 -1
- package/dist/TextLink/index.js +2 -1
- package/dist/Tree/DirectoryTree.js +0 -12
- package/dist/Tree/Tree.js +1 -1
- package/dist/Tree/demo/directoryTree/index.d.ts +3 -0
- package/dist/Tree/demo/directoryTree/index.js +44 -0
- package/dist/Tree/style/index.less +28 -8
- package/dist/ald.min.css +1 -1
- package/package.json +1 -1
|
@@ -78,6 +78,8 @@
|
|
|
78
78
|
box-shadow: 0 4px 6px -2px rgba(0, 0, 0, 0.05),
|
|
79
79
|
0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 0 0 1px rgba(0, 0, 0, 0.05);
|
|
80
80
|
overflow: hidden;
|
|
81
|
+
padding: 4px 0;
|
|
82
|
+
background-color: var(--alias-colors-bg-skeleton-subtler, #fff);
|
|
81
83
|
}
|
|
82
84
|
// dropdown的容器
|
|
83
85
|
.ant-dropdown.ant-dropdown {
|
|
@@ -10,9 +10,9 @@ var Search = function Search() {
|
|
|
10
10
|
}, /*#__PURE__*/React.createElement("rect", {
|
|
11
11
|
width: "240",
|
|
12
12
|
height: "240",
|
|
13
|
-
fill: "url(#
|
|
13
|
+
fill: "url(#patternSearch)"
|
|
14
14
|
}), /*#__PURE__*/React.createElement("defs", null, /*#__PURE__*/React.createElement("pattern", {
|
|
15
|
-
id: "
|
|
15
|
+
id: "patternSearch",
|
|
16
16
|
patternContentUnits: "objectBoundingBox",
|
|
17
17
|
width: "1",
|
|
18
18
|
height: "1"
|
|
@@ -9,9 +9,9 @@ var SearchSmall = function SearchSmall() {
|
|
|
9
9
|
}, /*#__PURE__*/React.createElement("rect", {
|
|
10
10
|
width: "40",
|
|
11
11
|
height: "40",
|
|
12
|
-
fill: "url(#
|
|
12
|
+
fill: "url(#patternSmall)"
|
|
13
13
|
}), /*#__PURE__*/React.createElement("defs", null, /*#__PURE__*/React.createElement("pattern", {
|
|
14
|
-
id: "
|
|
14
|
+
id: "patternSmall",
|
|
15
15
|
patternContentUnits: "objectBoundingBox",
|
|
16
16
|
width: "1",
|
|
17
17
|
height: "1"
|
|
@@ -2,12 +2,10 @@
|
|
|
2
2
|
// 纯input 输入框,比如普通的<Input /> <Input.textarea />
|
|
3
3
|
&:not(.ant-input-affix-wrapper) {
|
|
4
4
|
box-shadow: none;
|
|
5
|
-
width: auto;
|
|
6
5
|
}
|
|
7
6
|
// 带有其他内容的输入框,比如带 allowClear图标、prefix、suffix、密码图标等。
|
|
8
7
|
&.ant-input-affix-wrapper {
|
|
9
8
|
box-shadow: none;
|
|
10
|
-
width: auto;
|
|
11
9
|
// 输入框
|
|
12
10
|
.ant-input.ant-input {
|
|
13
11
|
color: inherit;
|
|
@@ -4,8 +4,8 @@ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _ty
|
|
|
4
4
|
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); }
|
|
5
5
|
import classnames from 'classnames';
|
|
6
6
|
import React from 'react';
|
|
7
|
-
import Button from "../../Button";
|
|
8
7
|
import Checkbox from "../../Checkbox";
|
|
8
|
+
import TextLink from "../../TextLink/index";
|
|
9
9
|
import { getAccount, getId, getPhoto } from "../utils";
|
|
10
10
|
import { isUserGroup } from "../utils/getUsersWithUserId";
|
|
11
11
|
import NickLabel from "./NickLabel";
|
|
@@ -36,8 +36,7 @@ export default function MultipleList(params) {
|
|
|
36
36
|
name: user.name,
|
|
37
37
|
photo: getPhoto(user),
|
|
38
38
|
account: getAccount(user)
|
|
39
|
-
})), isUserGroup(user) && hasNextLevel && /*#__PURE__*/React.createElement(
|
|
40
|
-
type: "link",
|
|
39
|
+
})), isUserGroup(user) && hasNextLevel && /*#__PURE__*/React.createElement(TextLink, {
|
|
41
40
|
className: "ald-member-picker-btn",
|
|
42
41
|
onClick: function onClick(e) {
|
|
43
42
|
onNextLevel === null || onNextLevel === void 0 ? void 0 : onNextLevel(user);
|
|
@@ -35,6 +35,7 @@ var Component = function Component(_ref) {
|
|
|
35
35
|
disabled = _ref.disabled,
|
|
36
36
|
_onClear = _ref.onClear,
|
|
37
37
|
size = _ref.size,
|
|
38
|
+
selectType = _ref.selectType,
|
|
38
39
|
_ref$lockedIds = _ref.lockedIds,
|
|
39
40
|
lockedIds = _ref$lockedIds === void 0 ? [] : _ref$lockedIds;
|
|
40
41
|
var _ConfigProvider$useGe = ConfigProvider.useGetUserList(),
|
|
@@ -185,6 +186,7 @@ var Component = function Component(_ref) {
|
|
|
185
186
|
return /*#__PURE__*/React.createElement(Select, {
|
|
186
187
|
prefix: prefix,
|
|
187
188
|
size: size,
|
|
189
|
+
type: selectType,
|
|
188
190
|
className: classNames('ald-member-picker-select', className),
|
|
189
191
|
value: selectedUserList.map(function (item) {
|
|
190
192
|
if (item.type === EUserType.USER_GROUP) {
|
|
@@ -15,6 +15,7 @@ export interface IBaseMemberSelectorProps extends Pick<ISelectProps, 'allowClear
|
|
|
15
15
|
open?: boolean;
|
|
16
16
|
onOpenChange?: (open: boolean) => void;
|
|
17
17
|
type?: EMemberPicker;
|
|
18
|
+
selectType?: ISelectProps['type'];
|
|
18
19
|
lockedIds?: Array<TUserValue | TUserGroupValue>;
|
|
19
20
|
}
|
|
20
21
|
export interface IMultipleMemberSelectorProps extends IBaseMemberSelectorProps {
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
@import '../../Empty/style/index.less';
|
|
7
7
|
@import '../../message/style/index.less';
|
|
8
8
|
@import '../../Spin/style/index.less';
|
|
9
|
+
@import '../../TextLink/style/index.less';
|
|
9
10
|
|
|
10
11
|
@btnWidth: 30px;
|
|
11
12
|
|
|
@@ -308,8 +309,11 @@
|
|
|
308
309
|
align-items: center;
|
|
309
310
|
}
|
|
310
311
|
|
|
311
|
-
.ald-select-popup.ald-member-picker-popup.ald-member-picker-popup {
|
|
312
|
+
.ald-select-popup.ald-member-picker-popup.ald-member-picker-popup.ald-member-picker-popup {
|
|
312
313
|
border: none;
|
|
313
314
|
background-color: transparent;
|
|
314
315
|
overflow: hidden;
|
|
316
|
+
padding: 0;
|
|
317
|
+
box-shadow: none;
|
|
318
|
+
border-radius: 0;
|
|
315
319
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { IPaginationProps } from './types';
|
|
3
|
-
declare function Pagination(props: IPaginationProps): React.JSX.Element;
|
|
3
|
+
declare function Pagination(props: IPaginationProps): React.JSX.Element | null;
|
|
4
4
|
export default Pagination;
|
|
5
5
|
/**
|
|
6
6
|
* 获取在安全范围内的当前页数
|
package/dist/Pagination/index.js
CHANGED
|
@@ -18,7 +18,8 @@ function Pagination(props) {
|
|
|
18
18
|
currPage = _props$current === void 0 ? 1 : _props$current,
|
|
19
19
|
pageSize = props.pageSize,
|
|
20
20
|
total = props.total,
|
|
21
|
-
onChange = props.onChange
|
|
21
|
+
onChange = props.onChange,
|
|
22
|
+
hideOnSinglePage = props.hideOnSinglePage;
|
|
22
23
|
var totalPage = getTotalPage(total, pageSize);
|
|
23
24
|
var _useState = useState(getSafeCurrent(totalPage, currPage)),
|
|
24
25
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -41,6 +42,11 @@ function Pagination(props) {
|
|
|
41
42
|
};
|
|
42
43
|
}, [onChange, current]);
|
|
43
44
|
var pageRange = getPaginationRange(totalPage, current);
|
|
45
|
+
if (hideOnSinglePage) {
|
|
46
|
+
if (totalPage <= 1) {
|
|
47
|
+
return null;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
44
50
|
return /*#__PURE__*/React.createElement("div", {
|
|
45
51
|
className: prefixCls('container')
|
|
46
52
|
}, /*#__PURE__*/React.createElement(Button, {
|
package/dist/Select/index.js
CHANGED
|
@@ -364,7 +364,6 @@ var Select = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
364
364
|
updatedRef.current = true;
|
|
365
365
|
}
|
|
366
366
|
}, [value, innerOptions, isMultiple, defaultValue]);
|
|
367
|
-
console.log(value, !_.isEmpty(value !== null && value !== void 0 ? value : currentValue), 'value');
|
|
368
367
|
return /*#__PURE__*/React.createElement("div", {
|
|
369
368
|
onMouseDown: function onMouseDown() {
|
|
370
369
|
if (disabled) return;
|
|
@@ -20,7 +20,9 @@ export default function TablePagination(props) {
|
|
|
20
20
|
}, [scrollToFirstRow, scroll, pagination]);
|
|
21
21
|
return pagination && /*#__PURE__*/React.createElement("div", {
|
|
22
22
|
className: prefixCls('pagination')
|
|
23
|
-
}, /*#__PURE__*/React.createElement(Pagination, _extends({
|
|
23
|
+
}, /*#__PURE__*/React.createElement(Pagination, _extends({
|
|
24
|
+
hideOnSinglePage: true
|
|
25
|
+
}, pagination, {
|
|
24
26
|
onChange: onChangePage
|
|
25
27
|
})));
|
|
26
28
|
}
|
package/dist/Table/index.js
CHANGED
|
@@ -18,7 +18,7 @@ import Pagination from "./components/Pagination";
|
|
|
18
18
|
import { getTableColumns, prefixCls } from "./helper";
|
|
19
19
|
import useScrollX from "./hooks/useScroll";
|
|
20
20
|
// 32 行高 + 1 底线高度
|
|
21
|
-
var HEADER_HEIGHT =
|
|
21
|
+
var HEADER_HEIGHT = 41;
|
|
22
22
|
function Table(props, ref) {
|
|
23
23
|
var _classnames;
|
|
24
24
|
var columns = props.columns,
|
package/dist/TextLink/index.js
CHANGED
|
@@ -7,7 +7,8 @@ import React from 'react';
|
|
|
7
7
|
function TextLink(props) {
|
|
8
8
|
var _classNames;
|
|
9
9
|
var propsSize = props.size,
|
|
10
|
-
type = props.type,
|
|
10
|
+
_props$type = props.type,
|
|
11
|
+
type = _props$type === void 0 ? 'primary' : _props$type,
|
|
11
12
|
underline = props.underline,
|
|
12
13
|
disabled = props.disabled,
|
|
13
14
|
_props$icon = props.icon,
|
|
@@ -19,9 +19,6 @@ function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefine
|
|
|
19
19
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
20
20
|
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; }
|
|
21
21
|
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; }
|
|
22
|
-
import FileOutlined from '@ant-design/icons/FileOutlined';
|
|
23
|
-
import FolderOpenOutlined from '@ant-design/icons/FolderOpenOutlined';
|
|
24
|
-
import FolderOutlined from '@ant-design/icons/FolderOutlined';
|
|
25
22
|
import classNames from 'classnames';
|
|
26
23
|
import { conductExpandParent } from 'rc-tree/lib/util';
|
|
27
24
|
import { convertDataToEntities, convertTreeToData } from 'rc-tree/lib/utils/treeUtil';
|
|
@@ -29,14 +26,6 @@ import * as React from 'react';
|
|
|
29
26
|
import { ConfigContext } from "../ConfigProvider";
|
|
30
27
|
import Tree from "./Tree";
|
|
31
28
|
import { calcRangeKeys, convertDirectoryKeysToNodes } from "./utils/dictUtil";
|
|
32
|
-
function getIcon(props) {
|
|
33
|
-
var isLeaf = props.isLeaf,
|
|
34
|
-
expanded = props.expanded;
|
|
35
|
-
if (isLeaf) {
|
|
36
|
-
return /*#__PURE__*/React.createElement(FileOutlined, null);
|
|
37
|
-
}
|
|
38
|
-
return expanded ? /*#__PURE__*/React.createElement(FolderOpenOutlined, null) : /*#__PURE__*/React.createElement(FolderOutlined, null);
|
|
39
|
-
}
|
|
40
29
|
function getTreeData(_ref) {
|
|
41
30
|
var treeData = _ref.treeData,
|
|
42
31
|
children = _ref.children;
|
|
@@ -154,7 +143,6 @@ var DirectoryTree = function DirectoryTree(_ref2, ref) {
|
|
|
154
143
|
var prefixCls = getPrefixCls('tree', customizePrefixCls);
|
|
155
144
|
var connectClassName = classNames("".concat(prefixCls, "-directory"), _defineProperty({}, "".concat(prefixCls, "-directory-rtl"), direction === 'rtl'), className);
|
|
156
145
|
return /*#__PURE__*/React.createElement(Tree, _extends({
|
|
157
|
-
icon: getIcon,
|
|
158
146
|
ref: ref,
|
|
159
147
|
blockNode: true
|
|
160
148
|
}, otherProps, {
|
package/dist/Tree/Tree.js
CHANGED
|
@@ -25,7 +25,7 @@ var Tree = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
25
25
|
getPrefixCls = _React$useContext.getPrefixCls,
|
|
26
26
|
direction = _React$useContext.direction,
|
|
27
27
|
virtual = _React$useContext.virtual;
|
|
28
|
-
var size = props.size || '
|
|
28
|
+
var size = props.size || 'large';
|
|
29
29
|
var className = props.className,
|
|
30
30
|
_props$showIcon = props.showIcon,
|
|
31
31
|
showIcon = _props$showIcon === void 0 ? false : _props$showIcon,
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { Tree } from "../../..";
|
|
2
|
+
import React from 'react';
|
|
3
|
+
var DirectoryTree = Tree.DirectoryTree;
|
|
4
|
+
var treeData = [{
|
|
5
|
+
title: 'parent 0',
|
|
6
|
+
key: '0-0',
|
|
7
|
+
children: [{
|
|
8
|
+
title: 'leaf 0-0',
|
|
9
|
+
key: '0-0-0',
|
|
10
|
+
isLeaf: true
|
|
11
|
+
}, {
|
|
12
|
+
title: 'leaf 0-1',
|
|
13
|
+
key: '0-0-1',
|
|
14
|
+
isLeaf: true
|
|
15
|
+
}]
|
|
16
|
+
}, {
|
|
17
|
+
title: 'parent 1',
|
|
18
|
+
key: '0-1',
|
|
19
|
+
children: [{
|
|
20
|
+
title: 'leaf 1-0',
|
|
21
|
+
key: '0-1-0',
|
|
22
|
+
isLeaf: true
|
|
23
|
+
}, {
|
|
24
|
+
title: 'leaf 1-1',
|
|
25
|
+
key: '0-1-1',
|
|
26
|
+
isLeaf: true
|
|
27
|
+
}]
|
|
28
|
+
}];
|
|
29
|
+
var App = function App() {
|
|
30
|
+
var onSelect = function onSelect(keys, info) {
|
|
31
|
+
console.log('Trigger Select', keys, info);
|
|
32
|
+
};
|
|
33
|
+
var onExpand = function onExpand(keys, info) {
|
|
34
|
+
console.log('Trigger Expand', keys, info);
|
|
35
|
+
};
|
|
36
|
+
return /*#__PURE__*/React.createElement(DirectoryTree, {
|
|
37
|
+
multiple: true,
|
|
38
|
+
defaultExpandAll: true,
|
|
39
|
+
onSelect: onSelect,
|
|
40
|
+
onExpand: onExpand,
|
|
41
|
+
treeData: treeData
|
|
42
|
+
});
|
|
43
|
+
};
|
|
44
|
+
export default App;
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
@import './reset.less';
|
|
7
7
|
@import './checkbox.less';
|
|
8
8
|
|
|
9
|
-
@tree-font-size-large:
|
|
9
|
+
@tree-font-size-large: 14px;
|
|
10
10
|
@tree-padding-large: 6px 4px;
|
|
11
11
|
@tree-line-height-large: 20px;
|
|
12
12
|
|
|
@@ -22,6 +22,10 @@
|
|
|
22
22
|
.ald-tree {
|
|
23
23
|
padding: 3px 0;
|
|
24
24
|
|
|
25
|
+
&.draggable-tree {
|
|
26
|
+
padding: 0;
|
|
27
|
+
}
|
|
28
|
+
|
|
25
29
|
.ald-tree-treenode.ald-tree-treenode-draggable {
|
|
26
30
|
.ald-tree-draggable-icon {
|
|
27
31
|
opacity: 1;
|
|
@@ -34,8 +38,7 @@
|
|
|
34
38
|
align-items: center;
|
|
35
39
|
font-size: @tree-font-size-default;
|
|
36
40
|
font-weight: 400;
|
|
37
|
-
color: #
|
|
38
|
-
width: 100%;
|
|
41
|
+
color: var(--alias-colors-text-default, #1f2937);
|
|
39
42
|
|
|
40
43
|
.ald-tree-draggable-icon {
|
|
41
44
|
display: inline-flex;
|
|
@@ -59,6 +62,7 @@
|
|
|
59
62
|
flex: 1;
|
|
60
63
|
display: flex;
|
|
61
64
|
align-items: center;
|
|
65
|
+
border-radius: 4px;
|
|
62
66
|
// stylelint-disable-next-line
|
|
63
67
|
.ald-tree-iconEle {
|
|
64
68
|
display: inline-flex;
|
|
@@ -71,11 +75,9 @@
|
|
|
71
75
|
|
|
72
76
|
.ald-tree-title {
|
|
73
77
|
line-height: @tree-line-height-default;
|
|
74
|
-
border-radius: 2px;
|
|
75
78
|
display: inline-flex;
|
|
76
79
|
align-items: center;
|
|
77
80
|
justify-content: space-between;
|
|
78
|
-
color: #171717;
|
|
79
81
|
flex: 1;
|
|
80
82
|
|
|
81
83
|
.ald-tree-tab-leader {
|
|
@@ -87,13 +89,24 @@
|
|
|
87
89
|
}
|
|
88
90
|
|
|
89
91
|
&:hover {
|
|
90
|
-
background: var(--colors-
|
|
92
|
+
background: var(--alias-colors-bg-interaction-hover, rgba(0, 0, 0, 0.05));
|
|
91
93
|
mix-blend-mode: multiply;
|
|
92
94
|
}
|
|
93
95
|
|
|
94
96
|
&.ald-tree-node-selected {
|
|
95
|
-
|
|
96
|
-
|
|
97
|
+
background: var(--alias-colors-bg-selected-default, #e8f2fe);
|
|
98
|
+
color: var(--alias-colors-text-selected, #126fdd);
|
|
99
|
+
font-size: 12px;
|
|
100
|
+
font-weight: 400;
|
|
101
|
+
line-height: 16px;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
&.ald-tree-treenode-disabled {
|
|
106
|
+
.ald-tree-node-content-wrapper {
|
|
107
|
+
&:hover {
|
|
108
|
+
background: inherit;
|
|
109
|
+
}
|
|
97
110
|
}
|
|
98
111
|
}
|
|
99
112
|
}
|
|
@@ -109,10 +122,17 @@
|
|
|
109
122
|
|
|
110
123
|
.ald-tree-node-content-wrapper {
|
|
111
124
|
padding: @tree-padding-large;
|
|
125
|
+
border-radius: var(--alias-radius-75, 6px);
|
|
112
126
|
|
|
113
127
|
.ald-tree-title {
|
|
114
128
|
line-height: @tree-line-height-large;
|
|
115
129
|
}
|
|
130
|
+
|
|
131
|
+
&.ald-tree-node-selected {
|
|
132
|
+
font-size: 14px;
|
|
133
|
+
font-weight: 500;
|
|
134
|
+
line-height: 20px;
|
|
135
|
+
}
|
|
116
136
|
}
|
|
117
137
|
}
|
|
118
138
|
}
|