@hi-ui/tag-input 4.1.1 → 4.1.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/CHANGELOG.md +6 -0
- package/lib/cjs/TagInputMock.js +4 -3
- package/lib/esm/TagInputMock.js +4 -3
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
@@ -1,5 +1,11 @@
|
|
1
1
|
# @hi-ui/tag-input
|
2
2
|
|
3
|
+
## 4.1.2
|
4
|
+
|
5
|
+
### Patch Changes
|
6
|
+
|
7
|
+
- [#3000](https://github.com/XiaoMi/hiui/pull/3000) [`908d6cd96`](https://github.com/XiaoMi/hiui/commit/908d6cd9657551203917230d9a91de45e65354c2) Thanks [@zyprepare](https://github.com/zyprepare)! - perf: 优化大数据下勾选卡顿
|
8
|
+
|
3
9
|
## 4.1.1
|
4
10
|
|
5
11
|
### Patch Changes
|
package/lib/cjs/TagInputMock.js
CHANGED
@@ -79,10 +79,11 @@ var TagInputMock = /*#__PURE__*/React.forwardRef(function (_a, ref) {
|
|
79
79
|
value = _useUncontrolledState[0],
|
80
80
|
tryChangeValue = _useUncontrolledState[1];
|
81
81
|
var tagList = React.useMemo(function () {
|
82
|
+
var dataMap = new Map(data.map(function (item) {
|
83
|
+
return [item.id, item];
|
84
|
+
}));
|
82
85
|
return value.map(function (id) {
|
83
|
-
return
|
84
|
-
return item.id === id;
|
85
|
-
}) || {
|
86
|
+
return dataMap.get(id) || {
|
86
87
|
id: id,
|
87
88
|
title: id
|
88
89
|
};
|
package/lib/esm/TagInputMock.js
CHANGED
@@ -66,10 +66,11 @@ var TagInputMock = /*#__PURE__*/forwardRef(function (_a, ref) {
|
|
66
66
|
value = _useUncontrolledState[0],
|
67
67
|
tryChangeValue = _useUncontrolledState[1];
|
68
68
|
var tagList = useMemo(function () {
|
69
|
+
var dataMap = new Map(data.map(function (item) {
|
70
|
+
return [item.id, item];
|
71
|
+
}));
|
69
72
|
return value.map(function (id) {
|
70
|
-
return
|
71
|
-
return item.id === id;
|
72
|
-
}) || {
|
73
|
+
return dataMap.get(id) || {
|
73
74
|
id: id,
|
74
75
|
title: id
|
75
76
|
};
|