next-helios-fe 1.4.37 → 1.4.39

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "next-helios-fe",
3
- "version": "1.4.37",
3
+ "version": "1.4.39",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -55,12 +55,14 @@ interface TableProps {
55
55
  id: number | string;
56
56
  [key: string]: any;
57
57
  }[];
58
- onCheck?: (
59
- checked: {
60
- id: number | string;
61
- [key: string]: any;
62
- }[]
63
- ) => void;
58
+ onChange?: (e: {
59
+ target: {
60
+ checked: {
61
+ id: number | string;
62
+ [key: string]: any;
63
+ }[];
64
+ };
65
+ }) => void;
64
66
  };
65
67
  actionColumn?: (e: any) => React.ReactNode;
66
68
  }
@@ -113,9 +115,12 @@ export const Table: TableComponentProps = ({
113
115
  }, [checkbox]);
114
116
 
115
117
  useEffect(() => {
116
- if (selected.length !== 0) {
117
- checkbox?.onCheck && checkbox.onCheck(selected);
118
- }
118
+ checkbox?.onChange &&
119
+ checkbox.onChange({
120
+ target: {
121
+ checked: selected,
122
+ },
123
+ });
119
124
  }, [selected]);
120
125
 
121
126
  useEffect(() => {
@@ -394,7 +399,7 @@ export const Table: TableComponentProps = ({
394
399
  ? true
395
400
  : false
396
401
  }
397
- onChange={(e) => {
402
+ onClick={() => {
398
403
  if (
399
404
  selected.find((selectedItem) => selectedItem.id === item.id)
400
405
  ) {