@hi-ui/tag-input 4.1.1-alpha.0 → 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 CHANGED
@@ -1,16 +1,21 @@
1
1
  # @hi-ui/tag-input
2
2
 
3
- ## 4.1.1-alpha.0
3
+ ## 4.1.2
4
4
 
5
5
  ### Patch Changes
6
6
 
7
- - 1a00f9fc4: build: style-inject(node 环境下有问题) 替换为 @hi-ui/style-inject
8
- - Updated dependencies [1a00f9fc4]
9
- - @hi-ui/env@4.0.5-alpha.0
10
- - @hi-ui/icons@4.0.19-alpha.0
11
- - @hi-ui/classname@4.0.5-alpha.0
12
- - @hi-ui/core@4.0.9-alpha.0
13
- - @hi-ui/func-utils@4.0.5-alpha.0
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
+
9
+ ## 4.1.1
10
+
11
+ ### Patch Changes
12
+
13
+ - [#2791](https://github.com/XiaoMi/hiui/pull/2791) [`1a00f9fc4`](https://github.com/XiaoMi/hiui/commit/1a00f9fc4a44619059d7852e846b54fedbd56715) Thanks [@zyprepare](https://github.com/zyprepare)! - build: style-inject(node 环境下有问题) 替换为 @hi-ui/style-inject
14
+
15
+ - Updated dependencies [[`1a00f9fc4`](https://github.com/XiaoMi/hiui/commit/1a00f9fc4a44619059d7852e846b54fedbd56715)]:
16
+ - @hi-ui/env@4.0.5
17
+ - @hi-ui/icons@4.0.19
18
+ - @hi-ui/classname@4.0.5
14
19
 
15
20
  ## 4.1.0
16
21
 
@@ -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 data.find(function (item) {
84
- return item.id === id;
85
- }) || {
86
+ return dataMap.get(id) || {
86
87
  id: id,
87
88
  title: id
88
89
  };
@@ -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 data.find(function (item) {
71
- return item.id === id;
72
- }) || {
73
+ return dataMap.get(id) || {
73
74
  id: id,
74
75
  title: id
75
76
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hi-ui/tag-input",
3
- "version": "4.1.1-alpha.0",
3
+ "version": "4.1.2",
4
4
  "description": "A sub-package for @hi-ui/hiui.",
5
5
  "keywords": [],
6
6
  "author": "HiUI <mi-hiui@xiaomi.com>",
@@ -43,10 +43,10 @@
43
43
  "url": "https://github.com/XiaoMi/hiui/issues"
44
44
  },
45
45
  "dependencies": {
46
- "@hi-ui/classname": "^4.0.5-alpha.0",
47
- "@hi-ui/env": "^4.0.5-alpha.0",
48
- "@hi-ui/func-utils": "^4.0.5-alpha.0",
49
- "@hi-ui/icons": "^4.0.19-alpha.0",
46
+ "@hi-ui/classname": "^4.0.5",
47
+ "@hi-ui/env": "^4.0.5",
48
+ "@hi-ui/func-utils": "^4.0.4",
49
+ "@hi-ui/icons": "^4.0.19",
50
50
  "@hi-ui/type-assertion": "^4.0.4",
51
51
  "@hi-ui/use-latest": "^4.0.4",
52
52
  "@hi-ui/use-merge-refs": "^4.0.4",
@@ -55,12 +55,12 @@
55
55
  "react-resize-detector": "^6.7.6"
56
56
  },
57
57
  "peerDependencies": {
58
- "@hi-ui/core": ">=4.0.9-alpha.0",
58
+ "@hi-ui/core": ">=4.0.8",
59
59
  "react": ">=16.8.6",
60
60
  "react-dom": ">=16.8.6"
61
61
  },
62
62
  "devDependencies": {
63
- "@hi-ui/core": "^4.0.9-alpha.0",
63
+ "@hi-ui/core": "^4.0.8",
64
64
  "@hi-ui/core-css": "^4.1.5",
65
65
  "react": "^17.0.1",
66
66
  "react-dom": "^17.0.1"