@aloudata/aloudata-design 2.19.1 → 2.19.2
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/utils/commonUtil.js +10 -2
- 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/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,
|
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
|
+
}
|