@aloudata/aloudata-design 2.19.1 → 2.19.3
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/AldSelect/Selector/MultipleResponsiveSelectedSection.d.ts +1 -1
- package/dist/AldSelect/Selector/MultipleResponsiveSelectedSection.js +3 -1
- package/dist/AldSelect/Selector/MultipleSelector.js +14 -8
- package/dist/AldSelect/Selector/index.js +5 -2
- package/dist/AldSelect/style/index.less +1 -1
- package/dist/AldSelect/utils/commonUtil.js +10 -2
- package/dist/ColorPicker/style/index.less +22 -1
- package/dist/Dropdown/index.js +8 -1
- package/dist/Icon/components/InProgressFill.d.ts +1 -2
- package/dist/Icon/components/InProgressFill.js +1 -1
- package/dist/Icon/svg/In-Progress-fill.svg +2 -2
- package/dist/InputNumber/style/index.less +51 -4
- package/dist/InputSearch/index.d.ts +3 -0
- package/dist/InputSearch/index.js +9 -2
- package/dist/MemberPicker/components/Panel.d.ts +1 -0
- package/dist/MemberPicker/components/Panel.js +4 -1
- package/dist/MemberPicker/components/PanelWrapper.d.ts +2 -1
- package/dist/MemberPicker/components/PanelWrapper.js +9 -3
- package/dist/Table/hooks/useScroll.js +12 -0
- package/dist/TextLink/style/index.less +1 -0
- package/dist/TextLink/style/type.less +0 -16
- package/dist/ald.min.css +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.js +1 -0
- package/dist/notification/demo/index.js +10 -1
- package/dist/notification/index.d.ts +1 -0
- package/dist/notification/index.js +15 -10
- package/package.json +1 -1
|
@@ -3,7 +3,7 @@ import { DisplayValueType } from '../interface';
|
|
|
3
3
|
import { RefTriggerProps } from '../SelectTrigger';
|
|
4
4
|
export default function MultipleResponsiveSelectedSection(params: {
|
|
5
5
|
displayValues: DisplayValueType[];
|
|
6
|
-
renderItem: (valueItem: DisplayValueType) => React.JSX.Element | null;
|
|
6
|
+
renderItem: (valueItem: DisplayValueType, index?: number) => React.JSX.Element | null;
|
|
7
7
|
onToggleOpen: (open: boolean) => void;
|
|
8
8
|
dropdownRef: RefObject<RefTriggerProps>;
|
|
9
9
|
maxHeight?: number;
|
|
@@ -41,7 +41,9 @@ export default function MultipleResponsiveSelectedSection(params) {
|
|
|
41
41
|
}
|
|
42
42
|
}, /*#__PURE__*/React.createElement("div", {
|
|
43
43
|
className: "beta-ald-select-selector-multiple-responsive-selected-section-tags"
|
|
44
|
-
}, displayValues.map(
|
|
44
|
+
}, displayValues.map(function (item, index) {
|
|
45
|
+
return renderItem(item, index);
|
|
46
|
+
}))), /*#__PURE__*/React.createElement(Suffix, {
|
|
45
47
|
showArrow: true,
|
|
46
48
|
allowClear: false,
|
|
47
49
|
icon: suffixIcon,
|
|
@@ -42,14 +42,14 @@ export default function MultipleSelector(props) {
|
|
|
42
42
|
_useState2 = _slicedToArray(_useState, 2),
|
|
43
43
|
showItemIndex = _useState2[0],
|
|
44
44
|
setShowItemIndex = _useState2[1];
|
|
45
|
-
var customizeRenderSelector = function customizeRenderSelector(value, content, itemDisabled, closable, onClose, isPreview) {
|
|
45
|
+
var customizeRenderSelector = function customizeRenderSelector(value, content, itemDisabled, closable, onClose, isPreview, uniqueKey) {
|
|
46
46
|
var onMouseDown = function onMouseDown(e) {
|
|
47
47
|
onPreventMouseDown(e);
|
|
48
48
|
};
|
|
49
49
|
return /*#__PURE__*/React.createElement("span", {
|
|
50
50
|
className: "beta-ald-select-custom-tag-render-wrapper",
|
|
51
51
|
onMouseDown: onMouseDown,
|
|
52
|
-
key: value
|
|
52
|
+
key: uniqueKey !== null && uniqueKey !== void 0 ? uniqueKey : value
|
|
53
53
|
}, tagRender === null || tagRender === void 0 ? void 0 : tagRender({
|
|
54
54
|
label: content,
|
|
55
55
|
value: value,
|
|
@@ -58,10 +58,10 @@ export default function MultipleSelector(props) {
|
|
|
58
58
|
onClose: onClose !== null && onClose !== void 0 ? onClose : function () {}
|
|
59
59
|
}, isPreview));
|
|
60
60
|
};
|
|
61
|
-
var defaultRenderSelector = function defaultRenderSelector(item, content, itemDisabled, closable, _onClose, isPreview) {
|
|
61
|
+
var defaultRenderSelector = function defaultRenderSelector(item, content, itemDisabled, closable, _onClose, isPreview, uniqueKey) {
|
|
62
62
|
return /*#__PURE__*/React.createElement(Tag, {
|
|
63
63
|
disabled: itemDisabled,
|
|
64
|
-
key: item === null || item === void 0 ? void 0 : item.value,
|
|
64
|
+
key: uniqueKey !== null && uniqueKey !== void 0 ? uniqueKey : item === null || item === void 0 ? void 0 : item.value,
|
|
65
65
|
size: "small",
|
|
66
66
|
closable: isPreview ? false : closable,
|
|
67
67
|
onClose: function onClose(e) {
|
|
@@ -72,7 +72,8 @@ export default function MultipleSelector(props) {
|
|
|
72
72
|
};
|
|
73
73
|
var isResponsiveMode = isResponsive(mode);
|
|
74
74
|
var showSelectedSection = isShowSelectedSection(mode);
|
|
75
|
-
var renderItem = function renderItem(valueItem) {
|
|
75
|
+
var renderItem = function renderItem(valueItem, index) {
|
|
76
|
+
var _valueItem$key;
|
|
76
77
|
var itemDisabled = valueItem.disabled,
|
|
77
78
|
label = valueItem.label,
|
|
78
79
|
value = valueItem.value;
|
|
@@ -97,7 +98,10 @@ export default function MultipleSelector(props) {
|
|
|
97
98
|
if (_.isNil(value)) {
|
|
98
99
|
return null;
|
|
99
100
|
}
|
|
100
|
-
|
|
101
|
+
|
|
102
|
+
// 生成唯一的 key,如果 value 可能重复,使用 value + index 组合
|
|
103
|
+
var uniqueKey = (_valueItem$key = valueItem.key) !== null && _valueItem$key !== void 0 ? _valueItem$key : value !== undefined && value !== null ? "".concat(value, "-").concat(index !== null && index !== void 0 ? index : '') : "item-".concat(index !== null && index !== void 0 ? index : '');
|
|
104
|
+
return typeof tagRender === 'function' ? customizeRenderSelector(value, displayLabel, !!itemDisabled, closable, onClose, isPreview, uniqueKey) : defaultRenderSelector(valueItem, displayLabel, !!itemDisabled, closable, onClose, isPreview, uniqueKey);
|
|
101
105
|
};
|
|
102
106
|
var renderRest = function renderRest(omittedValues) {
|
|
103
107
|
if (displayValues.length === 1) {
|
|
@@ -132,7 +136,7 @@ export default function MultipleSelector(props) {
|
|
|
132
136
|
className: "beta-ald-select-selector beta-ald-select-selector-multiple-responsive"
|
|
133
137
|
}, showItemIndex === -1 && displayValues.length > 0 && /*#__PURE__*/React.createElement("div", {
|
|
134
138
|
className: "beta-ald-select-selector-overflow-item-first"
|
|
135
|
-
}, renderItem(displayValues[0])), /*#__PURE__*/React.createElement(Overflow, {
|
|
139
|
+
}, renderItem(displayValues[0], 0)), /*#__PURE__*/React.createElement(Overflow, {
|
|
136
140
|
prefixCls: overflowPrefixCls,
|
|
137
141
|
data: displayValues,
|
|
138
142
|
renderItem: renderItem,
|
|
@@ -161,5 +165,7 @@ export default function MultipleSelector(props) {
|
|
|
161
165
|
}
|
|
162
166
|
}, /*#__PURE__*/React.createElement("div", {
|
|
163
167
|
className: "beta-ald-select-selector-multiple-default-tags"
|
|
164
|
-
}, displayValues.map(
|
|
168
|
+
}, displayValues.map(function (item, index) {
|
|
169
|
+
return renderItem(item, index);
|
|
170
|
+
})));
|
|
165
171
|
}
|
|
@@ -21,7 +21,10 @@ export default function Selector(props) {
|
|
|
21
21
|
}
|
|
22
22
|
return /*#__PURE__*/React.createElement("div", {
|
|
23
23
|
className: classNames('beta-ald-select-selector')
|
|
24
|
-
}, displayValues.map(function (item) {
|
|
25
|
-
|
|
24
|
+
}, displayValues.map(function (item, index) {
|
|
25
|
+
var _item$value;
|
|
26
|
+
return /*#__PURE__*/React.createElement("span", {
|
|
27
|
+
key: (_item$value = item.value) !== null && _item$value !== void 0 ? _item$value : "item-".concat(index)
|
|
28
|
+
}, item.label);
|
|
26
29
|
}));
|
|
27
30
|
}
|
|
@@ -18,11 +18,19 @@ export var toString = function toString(value) {
|
|
|
18
18
|
/** Is client side and not jsdom */
|
|
19
19
|
export var isBrowserClient = process.env.NODE_ENV !== 'test' && isClient;
|
|
20
20
|
export function convertOptionsToMenu(options, selectedKeys) {
|
|
21
|
+
// 使用 Map 来跟踪每个 key 出现的次数,确保 key 的唯一性
|
|
22
|
+
var keyCountMap = new Map();
|
|
21
23
|
return {
|
|
22
|
-
items: options.map(function (option) {
|
|
24
|
+
items: options.map(function (option, index) {
|
|
25
|
+
var _keyCountMap$get;
|
|
26
|
+
var baseKey = toString(option.value);
|
|
27
|
+
// 如果 key 已存在,添加索引后缀确保唯一性
|
|
28
|
+
var count = (_keyCountMap$get = keyCountMap.get(baseKey)) !== null && _keyCountMap$get !== void 0 ? _keyCountMap$get : 0;
|
|
29
|
+
keyCountMap.set(baseKey, count + 1);
|
|
30
|
+
var uniqueKey = count > 0 ? "".concat(baseKey, "-").concat(index) : baseKey;
|
|
23
31
|
return _objectSpread(_objectSpread({}, option), {}, {
|
|
24
32
|
label: option.label,
|
|
25
|
-
key:
|
|
33
|
+
key: uniqueKey,
|
|
26
34
|
disabled: option.disabled,
|
|
27
35
|
onClick: option.onClick,
|
|
28
36
|
className: option.className,
|
|
@@ -22,10 +22,27 @@
|
|
|
22
22
|
cursor: pointer;
|
|
23
23
|
transition: border 0.5s ease-in-out;
|
|
24
24
|
border-radius: 4px;
|
|
25
|
+
color: var(--content-primary);
|
|
25
26
|
|
|
26
27
|
&:not(.ald-color-picker-wrapper-disabled):hover {
|
|
27
28
|
border: 1px solid var(--interaction-border-normal);
|
|
28
29
|
}
|
|
30
|
+
|
|
31
|
+
&-disabled {
|
|
32
|
+
border: 1px solid var(--interaction-border-neutral-normal);
|
|
33
|
+
background: var(--global-cool-gray-alpha-50);
|
|
34
|
+
color: var(--content-primary);
|
|
35
|
+
|
|
36
|
+
&.ald-color-picker-wrapper-borderless {
|
|
37
|
+
border-color: transparent;
|
|
38
|
+
background: transparent;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
&:hover {
|
|
42
|
+
border-color: var(--interaction-border-neutral-normal);
|
|
43
|
+
background-color: var(--global-cool-gray-alpha-50);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
29
46
|
}
|
|
30
47
|
|
|
31
48
|
.ald-color-picker-wrapper-borderless {
|
|
@@ -165,5 +182,9 @@
|
|
|
165
182
|
}
|
|
166
183
|
|
|
167
184
|
.ald-color-picker-disabled {
|
|
168
|
-
|
|
185
|
+
cursor: initial;
|
|
186
|
+
|
|
187
|
+
.ald-color-picker-wrapper {
|
|
188
|
+
cursor: initial;
|
|
189
|
+
}
|
|
169
190
|
}
|
package/dist/Dropdown/index.js
CHANGED
|
@@ -79,7 +79,14 @@ export default function Dropdown(props) {
|
|
|
79
79
|
width: typeof popupMatchTriggerWidth === 'number' ? "".concat(popupMatchTriggerWidth, "px") : "".concat(rects.reference.width, "px")
|
|
80
80
|
});
|
|
81
81
|
}
|
|
82
|
-
}) :
|
|
82
|
+
}) : size({
|
|
83
|
+
apply: function apply(_ref2) {
|
|
84
|
+
var elements = _ref2.elements;
|
|
85
|
+
Object.assign(elements.floating.style, {
|
|
86
|
+
minWidth: '144px'
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
})],
|
|
83
90
|
whileElementsMounted: autoUpdatePos ? autoUpdate : undefined
|
|
84
91
|
}),
|
|
85
92
|
refs = _useFloating.refs,
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import type { SVGProps } from 'react';
|
|
2
1
|
import * as React from 'react';
|
|
3
2
|
interface SVGRProps {
|
|
4
3
|
size?: number | string;
|
|
@@ -7,5 +6,5 @@ interface SVGRProps {
|
|
|
7
6
|
desc?: string;
|
|
8
7
|
descId?: string;
|
|
9
8
|
}
|
|
10
|
-
declare const Memo: React.MemoExoticComponent<React.ForwardRefExoticComponent<Omit<SVGProps<SVGSVGElement> & SVGRProps, "ref"> & React.RefAttributes<SVGSVGElement>>>;
|
|
9
|
+
declare const Memo: React.MemoExoticComponent<React.ForwardRefExoticComponent<Omit<React.SVGProps<SVGSVGElement> & SVGRProps, "ref"> & React.RefAttributes<SVGSVGElement>>>;
|
|
11
10
|
export default Memo;
|
|
@@ -24,7 +24,7 @@ var InProgressFill = function InProgressFill(_ref, ref) {
|
|
|
24
24
|
}, desc) : null, title ? /*#__PURE__*/React.createElement("title", {
|
|
25
25
|
id: titleId
|
|
26
26
|
}, title) : null, /*#__PURE__*/React.createElement("g", {
|
|
27
|
-
fill: "
|
|
27
|
+
fill: "currentColor"
|
|
28
28
|
}, /*#__PURE__*/React.createElement("path", {
|
|
29
29
|
d: "M15 10a5 5 0 0 1-5 5V5a5 5 0 0 1 5 5Z"
|
|
30
30
|
}), /*#__PURE__*/React.createElement("path", {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
2
|
<g id=" Icon / Fill / Interface / In-Progress-fill">
|
|
3
3
|
<g id="Icon">
|
|
4
|
-
<path d="M15.0001 10C15.0001 12.7614 12.7615 15 10.0001 15V5.00001C12.7615 5.00001 15.0001 7.23858 15.0001 10Z" fill="
|
|
5
|
-
<path fill-rule="evenodd" clip-rule="evenodd" d="M18.3334 10C18.3334 14.6024 14.6025 18.3333 10.0001 18.3333C5.39771 18.3333 1.66675 14.6024 1.66675 10C1.66675 5.39763 5.39771 1.66667 10.0001 1.66667C14.6025 1.66667 18.3334 5.39763 18.3334 10ZM16.6667 10C16.6667 13.6819 13.682 16.6667 10.0001 16.6667C6.31818 16.6667 3.33341 13.6819 3.33341 10C3.33341 6.31811 6.31818 3.33334 10.0001 3.33334C13.682 3.33334 16.6667 6.31811 16.6667 10Z" fill="
|
|
4
|
+
<path d="M15.0001 10C15.0001 12.7614 12.7615 15 10.0001 15V5.00001C12.7615 5.00001 15.0001 7.23858 15.0001 10Z" fill="currentColor"/>
|
|
5
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M18.3334 10C18.3334 14.6024 14.6025 18.3333 10.0001 18.3333C5.39771 18.3333 1.66675 14.6024 1.66675 10C1.66675 5.39763 5.39771 1.66667 10.0001 1.66667C14.6025 1.66667 18.3334 5.39763 18.3334 10ZM16.6667 10C16.6667 13.6819 13.682 16.6667 10.0001 16.6667C6.31818 16.6667 3.33341 13.6819 3.33341 10C3.33341 6.31811 6.31818 3.33334 10.0001 3.33334C13.682 3.33334 16.6667 6.31811 16.6667 10Z" fill="currentColor"/>
|
|
6
6
|
</g>
|
|
7
7
|
</g>
|
|
8
8
|
</svg>
|
|
@@ -17,13 +17,18 @@
|
|
|
17
17
|
@inputNumber-padding-small: 0 7px;
|
|
18
18
|
|
|
19
19
|
//默认 - 使用CSS变量映射
|
|
20
|
-
@inputNumber-bg-color: var(--background-
|
|
21
|
-
@inputNumber-border-color: var(--border-
|
|
20
|
+
@inputNumber-bg-color: var(--interaction-background-form-field);
|
|
21
|
+
@inputNumber-border-color: var(--interaction-border-neutral-normal);
|
|
22
22
|
@inputNumber-color: var(--content-primary);
|
|
23
23
|
@inputNumber-wrapper-bg-color: var(--background-neutral-subtle);
|
|
24
|
+
|
|
25
|
+
//hover
|
|
26
|
+
@inputNumber-hover-bg-color: var(--interaction-background-form-field);
|
|
27
|
+
@inputNumber-hover-border-color: var(--interaction-border-hover);
|
|
24
28
|
//激活
|
|
25
29
|
@inputNumber-active-bg-color: var(--background-default);
|
|
26
|
-
@inputNumber-active-border-color: var(--interaction-border-
|
|
30
|
+
@inputNumber-active-border-color: var(--interaction-border-hover);
|
|
31
|
+
@inputNumber-active-outline-color: var(--global-blue-500);
|
|
27
32
|
|
|
28
33
|
//disable
|
|
29
34
|
@inputNumber-disabled-bg-color: var(--global-cool-gray-alpha-50);
|
|
@@ -47,6 +52,7 @@
|
|
|
47
52
|
background-color: @inputNumber-bg-color;
|
|
48
53
|
border-color: @inputNumber-border-color;
|
|
49
54
|
border-radius: @inputNumber-border-radius-middle;
|
|
55
|
+
overflow: hidden;
|
|
50
56
|
box-shadow: none;
|
|
51
57
|
|
|
52
58
|
.ant-input-number-input-wrap {
|
|
@@ -55,6 +61,7 @@
|
|
|
55
61
|
.ant-input-number-input {
|
|
56
62
|
height: 100%;
|
|
57
63
|
caret-color: @inputNumber-cursor-color;
|
|
64
|
+
border-radius: 0;
|
|
58
65
|
}
|
|
59
66
|
}
|
|
60
67
|
|
|
@@ -156,11 +163,16 @@
|
|
|
156
163
|
}
|
|
157
164
|
}
|
|
158
165
|
|
|
159
|
-
&:hover:not(.ald-input-number-disabled)
|
|
166
|
+
&:hover:not(.ald-input-number-disabled) {
|
|
167
|
+
background-color: @inputNumber-hover-bg-color;
|
|
168
|
+
border-color: @inputNumber-hover-border-color;
|
|
169
|
+
}
|
|
170
|
+
|
|
160
171
|
&-focused {
|
|
161
172
|
background-color: @inputNumber-active-bg-color;
|
|
162
173
|
border-color: @inputNumber-active-border-color;
|
|
163
174
|
box-shadow: none;
|
|
175
|
+
outline: @inputNumber-active-outline-color solid 1px;
|
|
164
176
|
}
|
|
165
177
|
}
|
|
166
178
|
|
|
@@ -172,6 +184,16 @@
|
|
|
172
184
|
border-color: @inputNumber-border-color;
|
|
173
185
|
box-shadow: none;
|
|
174
186
|
|
|
187
|
+
&:hover {
|
|
188
|
+
border-color: @inputNumber-hover-border-color;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
&:focus {
|
|
192
|
+
border-color: @inputNumber-active-border-color;
|
|
193
|
+
box-shadow: none;
|
|
194
|
+
outline: @inputNumber-active-outline-color solid 1px;
|
|
195
|
+
}
|
|
196
|
+
|
|
175
197
|
&.ald-input-number-large {
|
|
176
198
|
font-size: @inputNumber-font-size-large;
|
|
177
199
|
border-radius: @inputNumber-border-radius-large;
|
|
@@ -273,6 +295,18 @@
|
|
|
273
295
|
color: @inputNumber-addon-disable-color;
|
|
274
296
|
}
|
|
275
297
|
}
|
|
298
|
+
|
|
299
|
+
.ant-input-number-focused {
|
|
300
|
+
outline: none !important;
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
.ant-input-number-handler-wrap {
|
|
304
|
+
border-radius: 0 !important;
|
|
305
|
+
|
|
306
|
+
.ant-input-number-handler {
|
|
307
|
+
border-radius: 0 !important;
|
|
308
|
+
}
|
|
309
|
+
}
|
|
276
310
|
}
|
|
277
311
|
}
|
|
278
312
|
|
|
@@ -281,3 +315,16 @@
|
|
|
281
315
|
).ant-input-number.ant-input-number {
|
|
282
316
|
border-color: var(--border-negative-strong);
|
|
283
317
|
}
|
|
318
|
+
|
|
319
|
+
.ald-input-number.ant-input-number-affix-wrapper {
|
|
320
|
+
border-color: @inputNumber-border-color;
|
|
321
|
+
|
|
322
|
+
&:hover {
|
|
323
|
+
border-color: @inputNumber-hover-border-color;
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
&-focused {
|
|
327
|
+
border-color: @inputNumber-hover-border-color;
|
|
328
|
+
outline: @inputNumber-hover-border-color solid 1px;
|
|
329
|
+
}
|
|
330
|
+
}
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
export default function InputSearch(props: IProps): React.JSX.Element;
|
|
3
3
|
interface IProps {
|
|
4
|
+
/** 搜索回调,在输入完成时触发(回车、输入法结束、非输入法输入时) */
|
|
4
5
|
onSearch: (value: string) => void;
|
|
6
|
+
/** 值变化回调(受控模式时推荐使用,每次输入都触发,包括输入法期间) */
|
|
7
|
+
onChange?: (value: string) => void;
|
|
5
8
|
onBlur?: (value: string, e: React.FocusEvent<HTMLInputElement>) => void;
|
|
6
9
|
className?: string;
|
|
7
10
|
debounce?: boolean;
|
|
@@ -30,6 +30,7 @@ export default function InputSearch(props) {
|
|
|
30
30
|
locale = _useContext.locale;
|
|
31
31
|
var t = getTranslator(locale);
|
|
32
32
|
var onSearch = props.onSearch,
|
|
33
|
+
onChange = props.onChange,
|
|
33
34
|
className = props.className,
|
|
34
35
|
_props$debounce = props.debounce,
|
|
35
36
|
debounce = _props$debounce === void 0 ? true : _props$debounce,
|
|
@@ -91,6 +92,9 @@ export default function InputSearch(props) {
|
|
|
91
92
|
// 非受控模式才更新内部状态
|
|
92
93
|
if (!isControlled) {
|
|
93
94
|
setSearchValue(newValue);
|
|
95
|
+
} else {
|
|
96
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
|
|
97
|
+
return;
|
|
94
98
|
}
|
|
95
99
|
if (!isComposing.current) {
|
|
96
100
|
// 受控的时候debounce不生效
|
|
@@ -100,11 +104,14 @@ export default function InputSearch(props) {
|
|
|
100
104
|
onSearch(newValue);
|
|
101
105
|
}
|
|
102
106
|
}
|
|
103
|
-
}, [debounce, debounceSearch, onSearch, isControlled]);
|
|
107
|
+
}, [debounce, debounceSearch, onSearch, isControlled, onChange]);
|
|
104
108
|
var handleCompositionStart = useCallback(function () {
|
|
105
109
|
isComposing.current = true;
|
|
106
110
|
}, []);
|
|
107
111
|
var handleCompositionEnd = useCallback(function (e) {
|
|
112
|
+
if (isControlled) {
|
|
113
|
+
return;
|
|
114
|
+
}
|
|
108
115
|
isComposing.current = false;
|
|
109
116
|
// 在输入法结束后触发一次搜索
|
|
110
117
|
var value = e.target.value;
|
|
@@ -113,7 +120,7 @@ export default function InputSearch(props) {
|
|
|
113
120
|
} else {
|
|
114
121
|
onSearch(value);
|
|
115
122
|
}
|
|
116
|
-
}, [debounce, debounceSearch, onSearch]);
|
|
123
|
+
}, [debounce, debounceSearch, isControlled, onSearch]);
|
|
117
124
|
var iconSize = useMemo(function () {
|
|
118
125
|
if (size === 'middle' || size === 'large') {
|
|
119
126
|
return 20;
|
|
@@ -22,6 +22,7 @@ interface IPanelProps {
|
|
|
22
22
|
originNode: ReactNode;
|
|
23
23
|
}) => ReactNode;
|
|
24
24
|
renderSelectedTag?: (user: IUser | IUserGroup, originNode: ReactNode) => ReactNode;
|
|
25
|
+
filterItem?: (item: IUser | IUserGroup) => boolean;
|
|
25
26
|
}
|
|
26
27
|
export declare const userDisplayNameIsRepeated: (userList: TUser, displayName?: string) => boolean;
|
|
27
28
|
export default function Panel(props: IPanelProps): React.JSX.Element;
|
|
@@ -46,7 +46,8 @@ export default function Panel(props) {
|
|
|
46
46
|
footer = props.footer,
|
|
47
47
|
onCancel = props.onCancel,
|
|
48
48
|
renderItem = props.renderItem,
|
|
49
|
-
renderSelectedTag = props.renderSelectedTag
|
|
49
|
+
renderSelectedTag = props.renderSelectedTag,
|
|
50
|
+
filterItem = props.filterItem;
|
|
50
51
|
var _useState = useState([]),
|
|
51
52
|
_useState2 = _slicedToArray(_useState, 2),
|
|
52
53
|
selectedUsers = _useState2[0],
|
|
@@ -97,6 +98,7 @@ export default function Panel(props) {
|
|
|
97
98
|
var userSelection = /*#__PURE__*/React.createElement(MemberSelection, {
|
|
98
99
|
className: 'ald-member-picker-member-selection-multiple',
|
|
99
100
|
userList: dataList.filter(isUser),
|
|
101
|
+
filterItem: filterItem,
|
|
100
102
|
width: (panelwidth - 6) / 2,
|
|
101
103
|
selectedUsers: selectedUsers.filter(isUser),
|
|
102
104
|
onChange: onSelectionChange,
|
|
@@ -109,6 +111,7 @@ export default function Panel(props) {
|
|
|
109
111
|
var userGroupSelection = /*#__PURE__*/React.createElement(UserGroupSelection, {
|
|
110
112
|
className: 'ald-member-picker-member-selection-multiple',
|
|
111
113
|
userGroupList: dataList.filter(isUserGroup),
|
|
114
|
+
filterItem: filterItem,
|
|
112
115
|
width: (panelwidth - 6) / 2,
|
|
113
116
|
selectedUsersGroup: selectedUsers.filter(isUserGroup),
|
|
114
117
|
onChange: onSelectionChange,
|
|
@@ -20,6 +20,7 @@ interface IProps {
|
|
|
20
20
|
originNode: ReactNode;
|
|
21
21
|
}) => ReactNode;
|
|
22
22
|
renderSelectedTag?: (user: IUser | IUserGroup, originNode: ReactNode) => ReactNode;
|
|
23
|
+
filterItem?: (item: IUser | IUserGroup) => boolean;
|
|
23
24
|
}
|
|
24
|
-
export declare const PanelWrapper: ({ type, value, multiple, dropdownWidth, onChange, onCancel, className, footer, lockedIds, renderItem, renderSelectedTag, }: IProps) => React.JSX.Element;
|
|
25
|
+
export declare const PanelWrapper: ({ type, value, multiple, dropdownWidth, onChange, onCancel, className, footer, lockedIds, renderItem, renderSelectedTag, filterItem, }: IProps) => React.JSX.Element;
|
|
25
26
|
export default PanelWrapper;
|
|
@@ -26,7 +26,8 @@ export var PanelWrapper = function PanelWrapper(_ref) {
|
|
|
26
26
|
_ref$lockedIds = _ref.lockedIds,
|
|
27
27
|
lockedIds = _ref$lockedIds === void 0 ? [] : _ref$lockedIds,
|
|
28
28
|
renderItem = _ref.renderItem,
|
|
29
|
-
renderSelectedTag = _ref.renderSelectedTag
|
|
29
|
+
renderSelectedTag = _ref.renderSelectedTag,
|
|
30
|
+
filterItem = _ref.filterItem;
|
|
30
31
|
var _useContext = useContext(LocaleContext),
|
|
31
32
|
locale = _useContext.locale;
|
|
32
33
|
var t = getTranslator(locale);
|
|
@@ -88,12 +89,17 @@ export var PanelWrapper = function PanelWrapper(_ref) {
|
|
|
88
89
|
loading = _useRequest.loading,
|
|
89
90
|
run = _useRequest.run;
|
|
90
91
|
var totalUserList = useMemo(function () {
|
|
91
|
-
var totalUsers = searchUserList.concat(selectedUserList)
|
|
92
|
+
var totalUsers = searchUserList.concat(selectedUserList).filter(function (item) {
|
|
93
|
+
if (filterItem) {
|
|
94
|
+
return filterItem(item);
|
|
95
|
+
}
|
|
96
|
+
return true;
|
|
97
|
+
});
|
|
92
98
|
return _.uniqBy(totalUsers, function (data) {
|
|
93
99
|
if (data.type === EUserType.USER) return data.userId;
|
|
94
100
|
return data.groupId;
|
|
95
101
|
});
|
|
96
|
-
}, [searchUserList, selectedUserList]);
|
|
102
|
+
}, [searchUserList, selectedUserList, filterItem]);
|
|
97
103
|
useEffect(function () {
|
|
98
104
|
run();
|
|
99
105
|
}, [run, searchString]);
|
|
@@ -51,6 +51,18 @@ export default function useScroll(props) {
|
|
|
51
51
|
if (!elem) {
|
|
52
52
|
return;
|
|
53
53
|
}
|
|
54
|
+
|
|
55
|
+
// 先检查表格是否真的需要横向滚动
|
|
56
|
+
var DEVIATION = 2;
|
|
57
|
+
var needsHorizontalScroll = elem.scrollWidth > elem.clientWidth + DEVIATION;
|
|
58
|
+
if (!needsHorizontalScroll) {
|
|
59
|
+
// 表格宽度足够,不需要横向滚动,隐藏左右两侧阴影
|
|
60
|
+
setIsPingLeft(false);
|
|
61
|
+
setIsPingRight(false);
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
// 表格需要横向滚动,根据滚动位置判断是否显示阴影
|
|
54
66
|
var scrollLeft = elem.scrollLeft;
|
|
55
67
|
if (scrollLeft <= 0) {
|
|
56
68
|
setIsPingLeft(false);
|
|
@@ -20,14 +20,6 @@
|
|
|
20
20
|
color: var(--interaction-default-selected);
|
|
21
21
|
}
|
|
22
22
|
}
|
|
23
|
-
|
|
24
|
-
&.ald-text-link-disabled {
|
|
25
|
-
color: var(--alias-colors-text-disabled);
|
|
26
|
-
|
|
27
|
-
.ald-icon {
|
|
28
|
-
color: var(--alias-colors-icon-disabled);
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
23
|
}
|
|
32
24
|
|
|
33
25
|
.ald-text-link-secondary {
|
|
@@ -52,14 +44,6 @@
|
|
|
52
44
|
color: var(--interaction-default-selected);
|
|
53
45
|
}
|
|
54
46
|
}
|
|
55
|
-
|
|
56
|
-
&.ald-text-link-disabled {
|
|
57
|
-
color: var(--alias-colors-text-disabled);
|
|
58
|
-
|
|
59
|
-
.ald-icon {
|
|
60
|
-
color: var(--alias-colors-icon-disabled);
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
47
|
}
|
|
64
48
|
|
|
65
49
|
.ald-text-link-show-underline {
|