@aloudata/aloudata-design 2.15.11 → 2.15.13
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/Button/style/index.less +14 -0
- package/dist/Checkbox/style/index.less +6 -5
- package/dist/MemberPicker/components/MemberSelection.d.ts +1 -0
- package/dist/MemberPicker/components/MemberSelection.js +15 -6
- package/dist/MemberPicker/components/UserGroupSelection.d.ts +2 -1
- package/dist/MemberPicker/components/UserGroupSelection.js +8 -2
- package/dist/MemberPicker/index.js +7 -1
- package/dist/MemberPicker/interface.d.ts +1 -0
- package/dist/Steps/style/index.less +11 -6
- package/dist/ald.min.css +1 -1
- package/dist/index.less +1 -0
- package/dist/style/mixins/index.less +0 -1
- package/package.json +1 -1
- package/dist/style/mixins/animate.css +0 -13
|
@@ -91,7 +91,7 @@
|
|
|
91
91
|
|
|
92
92
|
.ant-checkbox-checked.ant-checkbox-disabled {
|
|
93
93
|
.ant-checkbox-inner[class][class] {
|
|
94
|
-
background:
|
|
94
|
+
background: #93c5fd;
|
|
95
95
|
}
|
|
96
96
|
}
|
|
97
97
|
|
|
@@ -118,7 +118,8 @@
|
|
|
118
118
|
|
|
119
119
|
.ant-checkbox-checked.ant-checkbox-disabled {
|
|
120
120
|
.ant-checkbox-inner[class][class] {
|
|
121
|
-
background:
|
|
121
|
+
background: #93c5fd;
|
|
122
|
+
border: 1px solid rgba(0, 0, 0, 0.2);
|
|
122
123
|
}
|
|
123
124
|
}
|
|
124
125
|
|
|
@@ -174,13 +175,13 @@
|
|
|
174
175
|
background-color: @checkbox-inner-bgc-disabled;
|
|
175
176
|
|
|
176
177
|
&::after {
|
|
177
|
-
top:
|
|
178
|
-
left:
|
|
178
|
+
top: 2px;
|
|
179
|
+
left: 1px;
|
|
179
180
|
z-index: 10;
|
|
180
181
|
width: 10px;
|
|
181
182
|
height: 8px;
|
|
182
183
|
/* stylelint-disable-next-line plugin/no-unsupported-browser-features */
|
|
183
|
-
background: url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTAiIGhlaWdodD0iOCIgdmlld0JveD0iMCAwIDEwIDgiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+
|
|
184
|
+
background: url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTAiIGhlaWdodD0iOCIgdmlld0JveD0iMCAwIDEwIDgiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CjxwYXRoIGlkPSJJY29uIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTkuNTMwMzMgMC45Njk2N0M5LjgyMzIyIDEuMjYyNTYgOS44MjMyMiAxLjczNzQ0IDkuNTMwMzMgMi4wMzAzM0w0LjUzMDMzIDcuMDMwMzNDNC4yMzc0NCA3LjMyMzIyIDMuNzYyNTYgNy4zMjMyMiAzLjQ2OTY3IDcuMDMwMzNMMC45Njk2NyA0LjUzMDMzQzAuNjc2Nzc3IDQuMjM3NDQgMC42NzY3NzcgMy43NjI1NiAwLjk2OTY3IDMuNDY5NjdDMS4yNjI1NiAzLjE3Njc4IDEuNzM3NDQgMy4xNzY3OCAyLjAzMDMzIDMuNDY5NjdMNCA1LjQzOTM0TDguNDY5NjcgMC45Njk2N0M4Ljc2MjU2IDAuNjc2Nzc3IDkuMjM3NDQgMC42NzY3NzcgOS41MzAzMyAwLjk2OTY3WiIgZmlsbD0id2hpdGUiLz4KPC9zdmc+Cg==')
|
|
184
185
|
no-repeat;
|
|
185
186
|
background-size: 100%, 100%;
|
|
186
187
|
border-width: 0;
|
|
@@ -7,7 +7,7 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
|
7
7
|
import { useVirtualizer } from '@tanstack/react-virtual';
|
|
8
8
|
import classNames from 'classnames';
|
|
9
9
|
import _ from 'lodash';
|
|
10
|
-
import React, { useContext, useDeferredValue, useEffect, useState } from 'react';
|
|
10
|
+
import React, { useContext, useDeferredValue, useEffect, useMemo, useState } from 'react';
|
|
11
11
|
import Empty from "../../Empty";
|
|
12
12
|
import { SearchLine } from "../../Icon";
|
|
13
13
|
import Input from "../../Input";
|
|
@@ -30,12 +30,21 @@ export default function MemberSelection(props) {
|
|
|
30
30
|
onSearchValueChange = props.onSearchValueChange,
|
|
31
31
|
loading = props.loading,
|
|
32
32
|
width = props.width,
|
|
33
|
-
lockedIds = props.lockedIds
|
|
33
|
+
lockedIds = props.lockedIds,
|
|
34
|
+
filterItem = props.filterItem;
|
|
35
|
+
var filteredList = useMemo(function () {
|
|
36
|
+
return userList.filter(function (item) {
|
|
37
|
+
if (filterItem) {
|
|
38
|
+
return filterItem(item);
|
|
39
|
+
}
|
|
40
|
+
return true;
|
|
41
|
+
});
|
|
42
|
+
}, [userList, filterItem]);
|
|
34
43
|
var parentRef = React.useRef(null);
|
|
35
44
|
|
|
36
45
|
// The virtualizer
|
|
37
46
|
var rowVirtualizer = useVirtualizer({
|
|
38
|
-
count:
|
|
47
|
+
count: filteredList.length,
|
|
39
48
|
getScrollElement: function getScrollElement() {
|
|
40
49
|
return parentRef.current;
|
|
41
50
|
},
|
|
@@ -66,7 +75,7 @@ export default function MemberSelection(props) {
|
|
|
66
75
|
onChange: function onChange(e) {
|
|
67
76
|
setSearchValue(e.target.value);
|
|
68
77
|
}
|
|
69
|
-
}),
|
|
78
|
+
}), filteredList.length === 0 && !loading && /*#__PURE__*/React.createElement(Empty, {
|
|
70
79
|
title: t.MemberPicker.noData,
|
|
71
80
|
size: "small",
|
|
72
81
|
image: Empty.PRESENTED_IMAGE_SEARCH,
|
|
@@ -84,7 +93,7 @@ export default function MemberSelection(props) {
|
|
|
84
93
|
overflowX: 'hidden'
|
|
85
94
|
},
|
|
86
95
|
className: classNames('ald-member-picker-member-list', {
|
|
87
|
-
'ald-member-picker-member-list-null':
|
|
96
|
+
'ald-member-picker-member-list-null': filteredList.length === 0 && !loading
|
|
88
97
|
})
|
|
89
98
|
// innerClassName="ald-member-picker-member-scroll"
|
|
90
99
|
}, /*#__PURE__*/React.createElement("div", {
|
|
@@ -96,7 +105,7 @@ export default function MemberSelection(props) {
|
|
|
96
105
|
height: "".concat(rowVirtualizer.getTotalSize(), "px")
|
|
97
106
|
}
|
|
98
107
|
}, rowVirtualizer.getVirtualItems().map(function (virtualItem) {
|
|
99
|
-
var user =
|
|
108
|
+
var user = filteredList[virtualItem.index];
|
|
100
109
|
var isSelected = selectedUsers.some(function (selectedUser) {
|
|
101
110
|
return selectedUser.userId === user.userId;
|
|
102
111
|
});
|
|
@@ -10,6 +10,7 @@ interface IProps {
|
|
|
10
10
|
onSearchValueChange?: (value: string) => void;
|
|
11
11
|
width: number;
|
|
12
12
|
lockedIds: Array<TUserValue | TUserGroupValue>;
|
|
13
|
+
filterItem?: (item: IUserGroup) => boolean;
|
|
13
14
|
}
|
|
14
|
-
declare const UserGroupSelection: ({ className, userGroupList, multiple, onChange, selectedUsersGroup: selectedUsersGroups, loading, width, lockedIds, }: IProps) => React.JSX.Element;
|
|
15
|
+
declare const UserGroupSelection: ({ className, userGroupList, multiple, onChange, selectedUsersGroup: selectedUsersGroups, loading, width, lockedIds, filterItem, }: IProps) => React.JSX.Element;
|
|
15
16
|
export default UserGroupSelection;
|
|
@@ -34,7 +34,8 @@ var UserGroupSelection = function UserGroupSelection(_ref) {
|
|
|
34
34
|
selectedUsersGroups = _ref.selectedUsersGroup,
|
|
35
35
|
loading = _ref.loading,
|
|
36
36
|
width = _ref.width,
|
|
37
|
-
lockedIds = _ref.lockedIds
|
|
37
|
+
lockedIds = _ref.lockedIds,
|
|
38
|
+
filterItem = _ref.filterItem;
|
|
38
39
|
var _useContext = useContext(LocaleContext),
|
|
39
40
|
locale = _useContext.locale;
|
|
40
41
|
var t = getTranslator(locale);
|
|
@@ -85,7 +86,12 @@ var UserGroupSelection = function UserGroupSelection(_ref) {
|
|
|
85
86
|
})), [userGroupList, groupPath, searchKey, getNextLevelGroup]);
|
|
86
87
|
useEffect(function () {
|
|
87
88
|
getFilterUserList().then(function (userGroups) {
|
|
88
|
-
setFilterUserList(userGroups)
|
|
89
|
+
setFilterUserList(userGroups.filter(function (userGroup) {
|
|
90
|
+
if (filterItem) {
|
|
91
|
+
return filterItem(userGroup);
|
|
92
|
+
}
|
|
93
|
+
return true;
|
|
94
|
+
}));
|
|
89
95
|
});
|
|
90
96
|
}, [getFilterUserList]);
|
|
91
97
|
return /*#__PURE__*/React.createElement("div", {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var _excluded = ["value", "type", "onChange", "multiple", "dropdownWidth", "open", "onOpenChange", "placeholder", "className", "allowClear", "disabled", "onClear", "size", "prefix", "lockedIds", "footer", "onCancel"];
|
|
1
|
+
var _excluded = ["value", "type", "onChange", "multiple", "dropdownWidth", "open", "onOpenChange", "placeholder", "className", "allowClear", "disabled", "onClear", "size", "prefix", "lockedIds", "footer", "onCancel", "filterItem"];
|
|
2
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
3
|
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(_e2) { throw _e2; }, 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(_e3) { didErr = true; err = _e3; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
|
|
4
4
|
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
@@ -53,6 +53,7 @@ var Component = function Component(props) {
|
|
|
53
53
|
lockedIds = _props$lockedIds === void 0 ? [] : _props$lockedIds,
|
|
54
54
|
footer = props.footer,
|
|
55
55
|
_onCancel = props.onCancel,
|
|
56
|
+
filterItem = props.filterItem,
|
|
56
57
|
restProps = _objectWithoutProperties(props, _excluded);
|
|
57
58
|
var _ConfigProvider$useGe = ConfigProvider.useGetUserList(),
|
|
58
59
|
getUsersByIds = _ConfigProvider$useGe.getUsersByIds,
|
|
@@ -129,6 +130,11 @@ var Component = function Component(props) {
|
|
|
129
130
|
return _.uniqBy(totalUsers, function (data) {
|
|
130
131
|
if (data.type === EUserType.USER) return data.userId;
|
|
131
132
|
return data.groupId;
|
|
133
|
+
}).filter(function (item) {
|
|
134
|
+
if (filterItem) {
|
|
135
|
+
return filterItem(item);
|
|
136
|
+
}
|
|
137
|
+
return true;
|
|
132
138
|
});
|
|
133
139
|
}, [searchString, searchUserList, selectedUserList]);
|
|
134
140
|
useEffect(function () {
|
|
@@ -20,6 +20,7 @@ export interface IBaseMemberSelectorProps extends Omit<ISelectProps, 'type'> {
|
|
|
20
20
|
lockedIds?: Array<TUserValue | TUserGroupValue>;
|
|
21
21
|
footer?: ReactNode;
|
|
22
22
|
onCancel?: () => void;
|
|
23
|
+
filterItem?: (item: IUser | IUserGroup) => boolean;
|
|
23
24
|
}
|
|
24
25
|
export interface IMultipleMemberSelectorProps extends IBaseMemberSelectorProps {
|
|
25
26
|
multiple: true | Mode;
|
|
@@ -142,6 +142,8 @@
|
|
|
142
142
|
height: 100%;
|
|
143
143
|
|
|
144
144
|
.ant-steps-item .ant-steps-item-container .ant-steps-item-icon {
|
|
145
|
+
position: absolute;
|
|
146
|
+
top: 10px;
|
|
145
147
|
margin: 0 8px 10px 0;
|
|
146
148
|
font-size: 12px;
|
|
147
149
|
line-height: 24px;
|
|
@@ -155,11 +157,12 @@
|
|
|
155
157
|
align-items: center;
|
|
156
158
|
|
|
157
159
|
.ant-steps-item-content {
|
|
160
|
+
padding-left: 32px;
|
|
158
161
|
display: flex;
|
|
162
|
+
min-height: 20px;
|
|
159
163
|
flex-direction: column;
|
|
160
164
|
align-items: flex-start;
|
|
161
165
|
justify-content: center;
|
|
162
|
-
margin-top: -11px;
|
|
163
166
|
margin-left: -4px;
|
|
164
167
|
|
|
165
168
|
.ant-steps-item-title {
|
|
@@ -170,13 +173,13 @@
|
|
|
170
173
|
|
|
171
174
|
.ant-steps-item-description {
|
|
172
175
|
max-width: 264px;
|
|
173
|
-
height: 16px;
|
|
174
|
-
|
|
176
|
+
// height: 16px;
|
|
177
|
+
height: fit-content;
|
|
178
|
+
max-height: fit-content;
|
|
175
179
|
margin-top: 3px;
|
|
180
|
+
overflow: visible;
|
|
176
181
|
padding: 0;
|
|
177
|
-
overflow: hidden;
|
|
178
182
|
font-size: 12px;
|
|
179
|
-
line-height: 16px;
|
|
180
183
|
text-overflow: ellipsis;
|
|
181
184
|
word-wrap: break-word;
|
|
182
185
|
color: #4b5563;
|
|
@@ -203,6 +206,8 @@
|
|
|
203
206
|
|
|
204
207
|
// 常规step
|
|
205
208
|
.ant-steps-item {
|
|
209
|
+
padding: 8px 0 !important;
|
|
210
|
+
|
|
206
211
|
&:last-child {
|
|
207
212
|
flex: 0 0 auto;
|
|
208
213
|
}
|
|
@@ -210,7 +215,7 @@
|
|
|
210
215
|
.ant-steps-item-container {
|
|
211
216
|
.ant-steps-item-tail {
|
|
212
217
|
position: absolute;
|
|
213
|
-
top:
|
|
218
|
+
top: 10px !important;
|
|
214
219
|
left: 4px;
|
|
215
220
|
width: 2px;
|
|
216
221
|
height: 100%;
|