@hi-ui/input 4.1.1 → 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,5 +1,11 @@
1
1
  # @hi-ui/input
2
2
 
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
+
3
9
  ## 4.1.1
4
10
 
5
11
  ### Patch Changes
@@ -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",
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>",