@tidbcloud/uikit 2.0.5 → 2.0.7

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,17 @@
1
1
  # @tidbcloud/uikit
2
2
 
3
+ ## 2.0.7
4
+
5
+ ### Patch Changes
6
+
7
+ - fix(uikit): pass null value for Select when value is empty string ([#454](https://github.com/tidbcloud/tidbcloud-uikit/pull/454))
8
+
9
+ ## 2.0.6
10
+
11
+ ### Patch Changes
12
+
13
+ - Fix/search area bug fix ([#452](https://github.com/tidbcloud/tidbcloud-uikit/pull/452))
14
+
3
15
  ## 2.0.5
4
16
 
5
17
  ### Patch Changes
@@ -75,7 +75,7 @@ function FormItemRender(props) {
75
75
  {
76
76
  data: props.data.data,
77
77
  name,
78
- value: keyword,
78
+ value: keyword || null,
79
79
  placeholder: placeholder ?? "",
80
80
  onChange: (val) => {
81
81
  setKeyword(val ?? "");
@@ -73,7 +73,7 @@ function FormItemRender(props) {
73
73
  {
74
74
  data: props.data.data,
75
75
  name,
76
- value: keyword,
76
+ value: keyword || null,
77
77
  placeholder: placeholder ?? "",
78
78
  onChange: (val) => {
79
79
  setKeyword(val ?? "");
@@ -15,7 +15,8 @@ function useCreateableSelect(props) {
15
15
  throw new Error("`onCreate` is required when `creatable` is true");
16
16
  }
17
17
  const [value, setValue] = useUncontrolled.useUncontrolled({
18
- value: props.value,
18
+ value: props.value || null,
19
+ // use null value to clear input
19
20
  onChange: props.onChange,
20
21
  defaultValue: props.defaultValue
21
22
  });
@@ -13,7 +13,8 @@ function useCreateableSelect(props) {
13
13
  throw new Error("`onCreate` is required when `creatable` is true");
14
14
  }
15
15
  const [value, setValue] = useUncontrolled({
16
- value: props.value,
16
+ value: props.value || null,
17
+ // use null value to clear input
17
18
  onChange: props.onChange,
18
19
  defaultValue: props.defaultValue
19
20
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tidbcloud/uikit",
3
- "version": "2.0.5",
3
+ "version": "2.0.7",
4
4
  "description": "tidbcloud uikit",
5
5
  "type": "module",
6
6
  "main": "dist/primitive/index.cjs",