@hw-component/table 1.9.30 → 1.9.32

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.
@@ -142,13 +142,10 @@ var RowSelectionBox = function RowSelectionBox(_ref5) {
142
142
  };
143
143
  var cancel = function cancel() {
144
144
  var newKeys = _toConsumableArray(keys);
145
+ var newRowData = _toConsumableArray(rowData);
145
146
  var keyIndex = _indexOfInstanceProperty(newKeys).call(newKeys, key);
146
147
  _spliceInstanceProperty(newKeys).call(newKeys, keyIndex, 1);
147
- var newRowData = rowData === null || rowData === void 0 ? void 0 : _filterInstanceProperty(rowData).call(rowData, function (item) {
148
- var rowId = item[key];
149
- var index = _indexOfInstanceProperty(newKeys).call(newKeys, rowId);
150
- return index !== -1;
151
- });
148
+ _spliceInstanceProperty(newRowData).call(newRowData, keyIndex, 1);
152
149
  rowOnChange(newKeys, newRowData);
153
150
  onChange === null || onChange === void 0 || onChange(newKeys, newRowData);
154
151
  };
@@ -164,6 +161,7 @@ var RowSelectionBox = function RowSelectionBox(_ref5) {
164
161
  _ref6$disabled = _ref6.disabled,
165
162
  disabled = _ref6$disabled === void 0 ? false : _ref6$disabled;
166
163
  var checked = _indexOfInstanceProperty(keys).call(keys, key) !== -1;
164
+ console.log(keys, rowData, "keys,rowData");
167
165
  return jsx(Checkbox, {
168
166
  checked: checked,
169
167
  onChange: check,
@@ -11,6 +11,7 @@ var useRowObj = (function () {
11
11
  selectAll = _selectedRowData$sele === void 0 ? false : _selectedRowData$sele;
12
12
  useMemo(function () {}, []);
13
13
  var rowOnChange = function rowOnChange(keys, rowData) {
14
+ console.log(keys, rowData, "rowOnChange");
14
15
  setSelectedRowData({
15
16
  keys: keys,
16
17
  rowData: rowData
@@ -143,13 +143,10 @@ var RowSelectionBox = function RowSelectionBox(_ref5) {
143
143
  };
144
144
  var cancel = function cancel() {
145
145
  var newKeys = _toConsumableArray(keys);
146
+ var newRowData = _toConsumableArray(rowData);
146
147
  var keyIndex = _indexOfInstanceProperty(newKeys).call(newKeys, key);
147
148
  _spliceInstanceProperty(newKeys).call(newKeys, keyIndex, 1);
148
- var newRowData = rowData === null || rowData === void 0 ? void 0 : _filterInstanceProperty(rowData).call(rowData, function (item) {
149
- var rowId = item[key];
150
- var index = _indexOfInstanceProperty(newKeys).call(newKeys, rowId);
151
- return index !== -1;
152
- });
149
+ _spliceInstanceProperty(newRowData).call(newRowData, keyIndex, 1);
153
150
  rowOnChange(newKeys, newRowData);
154
151
  onChange === null || onChange === void 0 || onChange(newKeys, newRowData);
155
152
  };
@@ -165,6 +162,7 @@ var RowSelectionBox = function RowSelectionBox(_ref5) {
165
162
  _ref6$disabled = _ref6.disabled,
166
163
  disabled = _ref6$disabled === void 0 ? false : _ref6$disabled;
167
164
  var checked = _indexOfInstanceProperty(keys).call(keys, key) !== -1;
165
+ console.log(keys, rowData, "keys,rowData");
168
166
  return jsxRuntime.jsx(antd.Checkbox, {
169
167
  checked: checked,
170
168
  onChange: check,
@@ -14,6 +14,7 @@ var useRowObj = (function () {
14
14
  selectAll = _selectedRowData$sele === void 0 ? false : _selectedRowData$sele;
15
15
  React.useMemo(function () {}, []);
16
16
  var rowOnChange = function rowOnChange(keys, rowData) {
17
+ console.log(keys, rowData, "rowOnChange");
17
18
  setSelectedRowData({
18
19
  keys: keys,
19
20
  rowData: rowData
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hw-component/table",
3
- "version": "1.9.30",
3
+ "version": "1.9.32",
4
4
  "description": "基于antd二次开发table组件",
5
5
  "keywords": [
6
6
  "table"
@@ -129,13 +129,10 @@ export const RowSelectionBox = ({
129
129
  }
130
130
  const cancel=()=>{
131
131
  const newKeys = [...keys];
132
+ const newRowData=[...rowData];
132
133
  const keyIndex = newKeys.indexOf(key);
133
134
  newKeys.splice(keyIndex, 1);
134
- const newRowData = rowData?.filter((item)=>{
135
- const rowId=item[key];
136
- const index=newKeys.indexOf(rowId);
137
- return index!==-1;
138
- });
135
+ newRowData.splice(keyIndex,1);
139
136
  rowOnChange(newKeys, newRowData);
140
137
  onChange?.(newKeys, newRowData);
141
138
  }
@@ -149,6 +146,7 @@ export const RowSelectionBox = ({
149
146
  };
150
147
  const { disabled = false } = getCheckboxProps?.(data) || {};
151
148
  const checked=keys.indexOf(key) !== -1;
149
+ console.log(keys,rowData,"keys,rowData");
152
150
  return (
153
151
  <Checkbox
154
152
  checked={checked}
@@ -7,6 +7,7 @@ export default () => {
7
7
  const { selectAll = false } = selectedRowData;
8
8
  const selectedRowDataSource = useMemo(() => {}, []);
9
9
  const rowOnChange = (keys: React.Key[], rowData: any[]) => {
10
+ console.log(keys,rowData,"rowOnChange")
10
11
  setSelectedRowData({
11
12
  keys,
12
13
  rowData,