@hi-ui/input 4.1.1-alpha.0 → 4.2.0

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,17 +1,21 @@
1
1
  # @hi-ui/input
2
2
 
3
- ## 4.1.1-alpha.0
3
+ ## 4.2.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#2954](https://github.com/XiaoMi/hiui/pull/2954) [`8e4eedb`](https://github.com/XiaoMi/hiui/commit/8e4eedb1bb08ef07258adec3ebdb303fbb100311) Thanks [@zyprepare](https://github.com/zyprepare)! - feat: MockInput 没有匹配到值时默认展示 value 值
8
+
9
+ ## 4.1.1
4
10
 
5
11
  ### Patch Changes
6
12
 
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/dom-utils@4.0.8-alpha.0
13
- - @hi-ui/core@4.0.9-alpha.0
14
- - @hi-ui/func-utils@4.0.5-alpha.0
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
15
19
 
16
20
  ## 4.1.0
17
21
 
@@ -75,7 +75,10 @@ var MockInput = /*#__PURE__*/React.forwardRef(function (_a, ref) {
75
75
  if (value === '') return null;
76
76
  var displayItem = data.find(function (item) {
77
77
  return item.id === value;
78
- });
78
+ }) || {
79
+ id: value,
80
+ title: value
81
+ };
79
82
  return displayItem || null;
80
83
  }, [value, data]);
81
84
  var displayValue = React.useMemo(function () {
@@ -63,7 +63,10 @@ var MockInput = /*#__PURE__*/forwardRef(function (_a, ref) {
63
63
  if (value === '') return null;
64
64
  var displayItem = data.find(function (item) {
65
65
  return item.id === value;
66
- });
66
+ }) || {
67
+ id: value,
68
+ title: value
69
+ };
67
70
  return displayItem || null;
68
71
  }, [value, data]);
69
72
  var displayValue = useMemo(function () {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hi-ui/input",
3
- "version": "4.1.1-alpha.0",
3
+ "version": "4.2.0",
4
4
  "description": "A sub-package for @hi-ui/hiui.",
5
5
  "keywords": [],
6
6
  "author": "HiUI <mi-hiui@xiaomi.com>",
@@ -43,23 +43,23 @@
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/dom-utils": "^4.0.8-alpha.0",
48
- "@hi-ui/env": "^4.0.5-alpha.0",
49
- "@hi-ui/func-utils": "^4.0.5-alpha.0",
50
- "@hi-ui/icons": "^4.0.19-alpha.0",
46
+ "@hi-ui/classname": "^4.0.5",
47
+ "@hi-ui/dom-utils": "^4.0.7",
48
+ "@hi-ui/env": "^4.0.5",
49
+ "@hi-ui/func-utils": "^4.0.4",
50
+ "@hi-ui/icons": "^4.0.19",
51
51
  "@hi-ui/type-assertion": "^4.0.4",
52
52
  "@hi-ui/use-latest": "^4.0.4",
53
53
  "@hi-ui/use-merge-refs": "^4.0.4",
54
54
  "@hi-ui/use-uncontrolled-state": "^4.0.4"
55
55
  },
56
56
  "peerDependencies": {
57
- "@hi-ui/core": ">=4.0.9-alpha.0",
57
+ "@hi-ui/core": ">=4.0.8",
58
58
  "react": ">=16.8.6",
59
59
  "react-dom": ">=16.8.6"
60
60
  },
61
61
  "devDependencies": {
62
- "@hi-ui/core": "^4.0.9-alpha.0",
62
+ "@hi-ui/core": "^4.0.8",
63
63
  "@hi-ui/core-css": "^4.1.5",
64
64
  "react": "^17.0.1",
65
65
  "react-dom": "^17.0.1"