@ecoding/components.antd 0.2.16 → 0.2.17

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.
@@ -22,6 +22,8 @@ interface IProps extends SelectProps<any> {
22
22
  iface?: IFace;
23
23
  data?: IData;
24
24
  searchIface?: IFace;
25
+ onChange?: any;
26
+ onChangeAry?: any;
25
27
  }
26
28
  declare const AsyncSlect: React.FC<IProps>;
27
29
  export default AsyncSlect;
@@ -117,6 +117,10 @@ const AsyncSlect = memo((props) => {
117
117
  });
118
118
  timeout = setTimeout(innerEx, 300);
119
119
  });
120
+ const changeHandler = (v, ary) => {
121
+ props.onChange(v);
122
+ props.onChangeAry && props.onChangeAry(ary);
123
+ };
120
124
  const children = useMemo(() => {
121
125
  return (options &&
122
126
  options.map((item) => {
@@ -131,6 +135,6 @@ const AsyncSlect = memo((props) => {
131
135
  return option.children.join("").toLowerCase().indexOf(input.toLowerCase()) >= 0;
132
136
  }
133
137
  return option.children.toLowerCase().indexOf(input.toLowerCase()) >= 0;
134
- }, allowClear: true, showSearch: true, onSearch: handleSearch, optionFilterProp: "children" }, props), children));
138
+ }, allowClear: true, showSearch: true, onSearch: handleSearch, optionFilterProp: "children" }, props, { onChange: changeHandler }), children));
135
139
  });
136
140
  export default AsyncSlect;
@@ -24,7 +24,10 @@ const TablePro = memo(({ className, header, buttonArea, filterArea, loading, row
24
24
  setOpenFilter(false);
25
25
  };
26
26
  const showColumns = useMemo(() => {
27
- return innerColumns.filter((c) => c.checked !== false).concat(operationColumn || []);
27
+ if (dataSource && dataSource.length > 0) {
28
+ return innerColumns.filter((c) => c.checked !== false).concat(operationColumn || []);
29
+ }
30
+ return operationColumn;
28
31
  }, [innerColumns, dataSource]);
29
32
  useEffect(() => {
30
33
  if (disColumnRef.current && disColumnRef.current.length > 0 && columns.length > 0) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ecoding/components.antd",
3
- "version": "0.2.16",
3
+ "version": "0.2.17",
4
4
  "author": "cxc",
5
5
  "homepage": "",
6
6
  "license": "MIT",
@@ -44,5 +44,5 @@
44
44
  "dependencies": {
45
45
  "react-quill": "^2.0.0"
46
46
  },
47
- "gitHead": "d43fb93777143fd7818502a8cee5b53b9f6ba88d"
47
+ "gitHead": "21d4960fc01846b73155a6f41550a2e8274bfa80"
48
48
  }