@ecoding/components.antd 0.4.10 → 0.4.11

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.
@@ -28,6 +28,7 @@ interface IProps extends SelectProps<any> {
28
28
  iface?: IFace;
29
29
  data?: IData;
30
30
  searchIface?: IFace;
31
+ emptyType?: 'null' | 'undefined' | '';
31
32
  onChange?: any;
32
33
  onChangeOpts?: any;
33
34
  }
@@ -137,6 +137,15 @@ const AsyncSelect = memo((props) => {
137
137
  timeout = setTimeout(innerEx, 300);
138
138
  });
139
139
  const changeHandler = (v, opts) => {
140
+ if (props.emptyType === 'null') {
141
+ v = v || null;
142
+ }
143
+ else if (props.emptyType === 'undefined') {
144
+ v = v || undefined;
145
+ }
146
+ else {
147
+ v = v || '';
148
+ }
140
149
  props.onChange(v);
141
150
  props.onChangeOpts && props.onChangeOpts(opts);
142
151
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ecoding/components.antd",
3
- "version": "0.4.10",
3
+ "version": "0.4.11",
4
4
  "author": "cxc",
5
5
  "homepage": "",
6
6
  "license": "MIT",
@@ -47,5 +47,5 @@
47
47
  "antd": "5.27.0",
48
48
  "axios": "^1.1.2"
49
49
  },
50
- "gitHead": "5dbebb1bdb179383358acbd1e860ac05f4affb15"
50
+ "gitHead": "b5d55fd3c64fccf0e70aa9e151a1f0ba58738cfc"
51
51
  }