ztxkui 4.2.23-2 → 4.2.23-21

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.
Files changed (86) hide show
  1. package/dist/DemoCom/PrintContainerDemo.js +223 -70
  2. package/dist/TableDemo/data.js +1 -1
  3. package/dist/UI/Basic/index.d.ts +2 -0
  4. package/dist/UI/Basic/index.js +18 -0
  5. package/dist/UI/Form/index.d.ts +3 -0
  6. package/dist/UI/Form/index.js +187 -0
  7. package/dist/UI/Modal/hooks.d.ts +15 -0
  8. package/dist/UI/Modal/hooks.js +172 -0
  9. package/dist/UI/Modal/index.d.ts +3 -0
  10. package/dist/UI/Modal/index.js +46 -0
  11. package/dist/UI/Table/DefaultTable.d.ts +2 -0
  12. package/dist/UI/Table/DefaultTable.js +49 -0
  13. package/dist/UI/Table/EditTable.d.ts +2 -0
  14. package/dist/UI/Table/EditTable.js +259 -0
  15. package/dist/UI/Table/data.d.ts +10 -0
  16. package/dist/UI/Table/data.js +14 -0
  17. package/dist/UI/Table/index.d.ts +2 -0
  18. package/dist/UI/Table/index.js +5 -0
  19. package/dist/UI/index.d.ts +2 -0
  20. package/dist/UI/index.js +26 -0
  21. package/dist/components/EnhanceSelect/index.js +4 -0
  22. package/dist/components/Input/input.js +38 -13
  23. package/dist/components/PrintContainer/print-container.js +70 -30
  24. package/dist/components/ProForm/hooks.d.ts +23 -0
  25. package/dist/components/ProForm/hooks.js +209 -0
  26. package/dist/components/ProForm/index.d.ts +6 -0
  27. package/dist/components/ProForm/index.js +87 -0
  28. package/dist/components/ProForm/interface.d.ts +116 -0
  29. package/dist/components/ProForm/interface.js +1 -0
  30. package/dist/components/ProForm/items.d.ts +5 -0
  31. package/dist/components/ProForm/items.js +136 -0
  32. package/dist/components/ProForm/search-drawer.d.ts +11 -0
  33. package/dist/components/ProForm/search-drawer.js +76 -0
  34. package/dist/components/ProForm/setting.d.ts +5 -0
  35. package/dist/components/ProForm/setting.js +13 -0
  36. package/dist/components/ProFormList/index.d.ts +12 -0
  37. package/dist/components/ProFormList/index.js +34 -0
  38. package/dist/components/ProModal/ModalForm.d.ts +8 -0
  39. package/dist/components/ProModal/ModalForm.js +32 -0
  40. package/dist/components/ProModal/ModalTable.d.ts +8 -0
  41. package/dist/components/ProModal/ModalTable.js +32 -0
  42. package/dist/components/ProModal/hooks.d.ts +33 -0
  43. package/dist/components/ProModal/hooks.js +193 -0
  44. package/dist/components/ProModal/index.d.ts +17 -0
  45. package/dist/components/ProModal/index.js +80 -0
  46. package/dist/components/ProModal/interface.d.ts +47 -0
  47. package/dist/components/ProModal/interface.js +1 -0
  48. package/dist/components/ProTable/hooks.d.ts +28 -0
  49. package/dist/components/ProTable/hooks.js +272 -0
  50. package/dist/components/ProTable/index.d.ts +8 -0
  51. package/dist/components/ProTable/index.js +76 -0
  52. package/dist/components/ProTable/interface.d.ts +51 -0
  53. package/dist/components/ProTable/interface.js +1 -0
  54. package/dist/components/Table/hooks/useColumns.d.ts +4 -4
  55. package/dist/components/Table/hooks/useColumns.js +227 -169
  56. package/dist/components/Table/hooks/useInnerPagination.js +1 -0
  57. package/dist/components/Table/table-adddel-column.d.ts +2 -1
  58. package/dist/components/Table/table-adddel-column.js +5 -3
  59. package/dist/components/Table/table-enhance-cell.d.ts +6 -3
  60. package/dist/components/Table/table-enhance-cell.js +119 -110
  61. package/dist/components/Table/table-enhance-row.d.ts +3 -4
  62. package/dist/components/Table/table-enhance-row.js +6 -10
  63. package/dist/components/Table/table-resizable-title.d.ts +4 -5
  64. package/dist/components/Table/table-resizable-title.js +31 -6
  65. package/dist/components/Table/table.d.ts +2 -0
  66. package/dist/components/Table/table.js +154 -150
  67. package/dist/components/Table/utils/shallowEqual.d.ts +2 -0
  68. package/dist/components/Table/utils/shallowEqual.js +34 -0
  69. package/dist/components/Table/utils/validate.js +0 -3
  70. package/dist/components/Tabs/DraggableTabNode.d.ts +7 -0
  71. package/dist/components/Tabs/DraggableTabNode.js +33 -0
  72. package/dist/components/Tabs/hooks.d.ts +3 -0
  73. package/dist/components/Tabs/hooks.js +59 -0
  74. package/dist/components/Tabs/tabs.d.ts +3 -0
  75. package/dist/components/Tabs/tabs.js +8 -2
  76. package/dist/components/business/Footer/index.d.ts +1 -0
  77. package/dist/components/business/Footer/index.js +18 -4
  78. package/dist/components/business/Signatures/components/QunjSeal.js +3 -2
  79. package/dist/components/business/Signatures/index.js +13 -14
  80. package/dist/constants.d.ts +1 -1
  81. package/dist/constants.js +1 -1
  82. package/dist/index.css +327 -0
  83. package/dist/index.css.map +1 -1
  84. package/dist/index.d.ts +4 -0
  85. package/dist/index.js +9 -1
  86. package/package.json +4 -4
@@ -14,7 +14,8 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from) {
14
14
  to[j] = from[i];
15
15
  return to;
16
16
  };
17
- import React, { useCallback, useEffect, useState, useRef } from 'react';
17
+ import React, { useCallback, useState, useRef, useMemo } from 'react';
18
+ import { unstable_batchedUpdates } from 'react-dom';
18
19
  import Button from '../../Button';
19
20
  import { Popconfirm } from '../../../index';
20
21
  import { PicRightOutlined, MinusSquareOutlined } from '@ant-design/icons';
@@ -153,133 +154,113 @@ export function setDynamicKey(dynamicStorageKey, value) {
153
154
  localStorage.setItem(LOCALSTORAGE_KEY, JSON.stringify(obj));
154
155
  localStorage.setItem(LOCALSTORAGE_LRU_KEY, JSON.stringify(lruKeys));
155
156
  }
156
- function useColumns(props) {
157
- var columns = props.columns, showColumnDynamic = props.showColumnDynamic, showColumnDynamicKey = props.showColumnDynamicKey, onAddAndDelHandle = props.onAddAndDelHandle, hideAddIcon = props.hideAddIcon, showDelAllBtn = props.showDelAllBtn, delAllChange = props.delAllChange, addIconText = props.addIconText, hideDelIcon = props.hideDelIcon, delIconText = props.delIconText, showDynamicHandle = props.showDynamicHandle, onEditableSave = props.onEditableSave, configInfo = props.configInfo, copyByKey = props.copyByKey, onTableChange = props.onTableChange, currentPage = props.currentPage;
158
- var tableLayout = getStorage(showColumnDynamicKey);
159
- var newColumnsRef = useRef();
160
- // 新的columns
161
- var _a = useState(getTableLayoutFullData(columns, tableLayout)), newColumns = _a[0], setNewColumns = _a[1];
162
- // 需要动态配置的列
163
- var _b = useState(getTableLayoutFullData(columns, tableLayout)), dynamicColumns = _b[0], setDynamicColumns = _b[1];
164
- // 动态列配置显隐
165
- var ColumnDynamicCom = useCallback(function () { return (React.createElement(PicRightOutlined, { className: "zt-column--daynamic-icon", onClick: showDynamicHandle })); }, [showDynamicHandle]);
166
- // 动态列配置显隐
167
- var DelAllCom = useCallback(function () {
168
- return showDelAllBtn ? (React.createElement(Popconfirm, { title: "\u662F\u5426\u5168\u90E8\u5220\u9664", onConfirm: function () { return delAllChange && delAllChange(); } },
169
- React.createElement(MinusSquareOutlined, { className: "zt-column--daynamic-icon", style: { marginLeft: '4px' } }))) : null;
170
- }, [delAllChange, showDelAllBtn]);
171
- useEffect(function () {
172
- var tableLayout = getStorage(showColumnDynamicKey);
173
- var catchColumns = getTableLayoutFullData(columns, tableLayout);
174
- if (!Array.isArray(catchColumns)) {
175
- throw new Error('columns 必须为一个数组');
176
- }
177
- // 根据配置处理columns
178
- // 主要处理是否隐藏
179
- // 是否添加required配置
180
- var _columns = [];
181
- if (configInfo && Object.keys(configInfo).length > 0) {
182
- catchColumns.forEach(function (col) {
183
- var _a, _b, _c, _d;
184
- var _column = __assign({}, col);
185
- var dataIndex = _column.dataIndex;
186
- if (!dataIndex) {
187
- _columns.push(__assign({}, _column));
188
- }
189
- else {
190
- // 如果没有配置,或者配置isRequired为存在
191
- if (((_a = configInfo[dataIndex]) === null || _a === void 0 ? void 0 : _a.isRequired) === 1 ||
192
- ((_b = configInfo[dataIndex]) === null || _b === void 0 ? void 0 : _b.isRequired) === '1') {
193
- _column.required = true;
194
- }
195
- else {
196
- _column.validate = undefined;
197
- }
198
- // 如果没有配置,或者配置isDisplay为存在
199
- if (!configInfo[dataIndex] ||
200
- ((_c = configInfo[dataIndex]) === null || _c === void 0 ? void 0 : _c.isDisplay) === 1 ||
201
- ((_d = configInfo[dataIndex]) === null || _d === void 0 ? void 0 : _d.isDisplay) === '1') {
202
- _columns.push(__assign({}, _column));
203
- }
204
- }
205
- });
206
- }
207
- else {
208
- _columns = catchColumns;
209
- }
210
- var _newColumns = [];
211
- var _dynamicColumns = [];
212
- // 处理columns
213
- _columns.forEach(function (col) {
157
+ function getNewColumns(basicConfig, editableConfig, dynamicConfig, otherConfig) {
158
+ var columns = basicConfig.columns, newColumnsRef = basicConfig.newColumnsRef, showColumnDynamic = basicConfig.showColumnDynamic, showColumnDynamicKey = basicConfig.showColumnDynamicKey, configInfo = basicConfig.configInfo;
159
+ var onEditableSave = editableConfig.onEditableSave, onTableChange = editableConfig.onTableChange, currentPage = editableConfig.currentPage;
160
+ var ColumnDynamicCom = dynamicConfig.ColumnDynamicCom, DelAllCom = dynamicConfig.DelAllCom, onAddAndDelHandleMemo = dynamicConfig.onAddAndDelHandleMemo, onAddAndDelHandle = dynamicConfig.onAddAndDelHandle, hideAddIcon = dynamicConfig.hideAddIcon, addIconText = dynamicConfig.addIconText, hideDelIcon = dynamicConfig.hideDelIcon, delIconText = dynamicConfig.delIconText;
161
+ var copyByKey = otherConfig.copyByKey, myCatchColumns = otherConfig.myCatchColumns;
162
+ var tableLayout = showColumnDynamicKey
163
+ ? getStorage(showColumnDynamicKey)
164
+ : myCatchColumns;
165
+ var catchColumns = getTableLayoutFullData(columns, tableLayout);
166
+ if (!Array.isArray(catchColumns)) {
167
+ throw new Error('columns 必须为一个数组');
168
+ }
169
+ // 根据配置处理columns
170
+ // 主要处理是否隐藏
171
+ // 是否添加required配置
172
+ var _columns = [];
173
+ if (configInfo && Object.keys(configInfo).length > 0) {
174
+ catchColumns.forEach(function (col) {
175
+ var _a, _b, _c, _d;
214
176
  var _column = __assign({}, col);
215
- // 添加超出隐藏
216
- // !_column.render 兼容下拉框滚动行为,设置了ellipsis的话,会导致overflow:hidden,导致一些问题
217
- if (_column.ellipsis !== false) {
218
- _column.ellipsis = true;
177
+ var dataIndex = _column.dataIndex;
178
+ if (!dataIndex) {
179
+ _columns.push(__assign({}, _column));
219
180
  }
220
- // 如果列需要编辑
221
- if (_column.editable) {
222
- var title_1 = _column.title, editable_1 = _column.editable, editableConfig_1 = _column.editableConfig, dataIndex_1 = _column.dataIndex;
223
- _column = __assign(__assign({}, _column), { onCell: function (record, index) {
224
- return ({
225
- record: record,
226
- index: index,
227
- editable: editable_1,
228
- editableConfig: editableConfig_1,
229
- dataIndex: dataIndex_1,
230
- title: title_1,
231
- handleSave: onEditableSave,
232
- columns: function () { return newColumnsRef.current; },
233
- onTableChange: onTableChange,
234
- currentpage: currentPage,
235
- });
236
- } });
237
- // 兼容下拉框滚动行为
238
- if ((editableConfig_1 === null || editableConfig_1 === void 0 ? void 0 : editableConfig_1.type) === 'select') {
239
- _column.ellipsis = false;
181
+ else {
182
+ // 如果没有配置,或者配置isRequired为存在
183
+ if (((_a = configInfo[dataIndex]) === null || _a === void 0 ? void 0 : _a.isRequired) === 1 ||
184
+ ((_b = configInfo[dataIndex]) === null || _b === void 0 ? void 0 : _b.isRequired) === '1') {
185
+ _column.required = true;
240
186
  }
241
- }
242
- // 如果列需要添加复制按钮
243
- if (_column.showCopy) {
244
- if (_column.validate) {
245
- _column.validate.title = _column.validate.title
246
- ? _column.validate.title
247
- : _column.title;
187
+ else {
188
+ _column.validate = undefined;
189
+ }
190
+ // 如果没有配置,或者配置isDisplay为存在
191
+ if (!configInfo[dataIndex] ||
192
+ ((_c = configInfo[dataIndex]) === null || _c === void 0 ? void 0 : _c.isDisplay) === 1 ||
193
+ ((_d = configInfo[dataIndex]) === null || _d === void 0 ? void 0 : _d.isDisplay) === '1') {
194
+ _columns.push(__assign({}, _column));
248
195
  }
249
- _column.title = (React.createElement(React.Fragment, null,
250
- _column.title,
251
- React.createElement(Button, { type: "link", onClick: function () {
252
- copyByKey(typeof _column.showCopy === 'string'
253
- ? _column.showCopy
254
- : _column.key || _column.dataIndex);
255
- }, style: {
256
- fontSize: '13px',
257
- marginLeft: '2px',
258
- display: 'block',
259
- width: '100%',
260
- textAlign: _column.align,
261
- } }, "\u590D\u5236\u6574\u5217")));
262
196
  }
263
- // 如果配置了固定列的 不做处理
264
- if (!col.fixed) {
265
- _dynamicColumns.push(__assign({}, col));
197
+ });
198
+ }
199
+ else {
200
+ _columns = catchColumns;
201
+ }
202
+ var _newColumns = [];
203
+ var _dynamicColumns = [];
204
+ // 处理columns
205
+ _columns.forEach(function (col) {
206
+ var _column = __assign({}, col);
207
+ // 添加超出隐藏
208
+ // !_column.render 兼容下拉框滚动行为,设置了ellipsis的话,会导致overflow:hidden,导致一些问题
209
+ if (_column.ellipsis !== false) {
210
+ _column.ellipsis = true;
211
+ }
212
+ // 如果列需要编辑
213
+ if (_column.editable) {
214
+ var title_1 = _column.title, editable_1 = _column.editable, editableConfig_1 = _column.editableConfig, dataIndex_1 = _column.dataIndex;
215
+ _column = __assign(__assign({}, _column), { onCell: function (record, index) {
216
+ return ({
217
+ record: record,
218
+ index: index,
219
+ editable: editable_1,
220
+ editableConfig: editableConfig_1,
221
+ dataIndex: dataIndex_1,
222
+ title: title_1,
223
+ handleSave: onEditableSave,
224
+ columns: function () { return newColumnsRef.current; },
225
+ onTableChange: onTableChange,
226
+ currentpage: currentPage,
227
+ });
228
+ } });
229
+ // 兼容下拉框滚动行为
230
+ if ((editableConfig_1 === null || editableConfig_1 === void 0 ? void 0 : editableConfig_1.type) === 'select') {
231
+ _column.ellipsis = false;
266
232
  }
267
- // 添加必填标识
268
- if (typeof _column.required === 'function') {
269
- var res = _column.required();
270
- var _res = typeof res === 'boolean' ? res : res === 1 || res === '1';
271
- if (_res) {
272
- if (_column.validate) {
273
- _column.validate.title = _column.validate.title
274
- ? _column.validate.title
275
- : _column.title;
276
- }
277
- _column.title = (React.createElement(React.Fragment, null,
278
- React.createElement("i", { className: "zt-column--required" }, "*"),
279
- _column.title));
280
- }
233
+ }
234
+ // 如果列需要添加复制按钮
235
+ if (_column.showCopy) {
236
+ if (_column.validate) {
237
+ _column.validate.title = _column.validate.title
238
+ ? _column.validate.title
239
+ : _column.title;
281
240
  }
282
- else if (_column.required) {
241
+ _column.title = (React.createElement(React.Fragment, null,
242
+ _column.title,
243
+ React.createElement(Button, { type: "link", onClick: function () {
244
+ copyByKey(typeof _column.showCopy === 'string'
245
+ ? _column.showCopy
246
+ : _column.key || _column.dataIndex);
247
+ }, style: {
248
+ fontSize: '13px',
249
+ marginLeft: '2px',
250
+ display: 'block',
251
+ width: '100%',
252
+ textAlign: _column.align,
253
+ } }, "\u590D\u5236\u6574\u5217")));
254
+ }
255
+ // 如果配置了固定列的 不做处理
256
+ if (!col.fixed) {
257
+ _dynamicColumns.push(__assign({}, col));
258
+ }
259
+ // 添加必填标识
260
+ if (typeof _column.required === 'function') {
261
+ var res = _column.required();
262
+ var _res = typeof res === 'boolean' ? res : res === 1 || res === '1';
263
+ if (_res) {
283
264
  if (_column.validate) {
284
265
  _column.validate.title = _column.validate.title
285
266
  ? _column.validate.title
@@ -289,72 +270,149 @@ function useColumns(props) {
289
270
  React.createElement("i", { className: "zt-column--required" }, "*"),
290
271
  _column.title));
291
272
  }
292
- // 去掉不显示表头的项
293
- if (!_column.hideColumn) {
294
- _newColumns.push(_column);
295
- }
296
- // 添加render字段
297
- if (!_column.render) {
298
- _column.render = function (text, record, index) {
299
- return text == null || text === '' ? '— —' : text;
300
- };
301
- }
302
- });
303
- if (showColumnDynamic) {
304
- // 如果需要展示动态列
305
- if (!onAddAndDelHandle) {
306
- // 并且不需要展示删减功能,那么动态列,加到序号列,也就是第0项
307
- _newColumns[0].title = function () { return React.createElement(ColumnDynamicCom, null); };
308
- }
309
- else {
310
- // 需要展示删减功能
311
- var newColumn = {
312
- title: function () { return (React.createElement(React.Fragment, null,
313
- React.createElement(ColumnDynamicCom, null),
314
- React.createElement(DelAllCom, null))); },
315
- width: 52,
316
- fixed: 'left',
317
- align: 'center',
318
- render: function (text, render, index) { return (React.createElement(TableAddDelColumn, { onAddAndDelHandle: function (type) {
319
- var innerIndex = getInnerIndex(currentPage, index);
320
- onAddAndDelHandle(type, innerIndex);
321
- }, hideAddIcon: hideAddIcon, addIconText: addIconText, hideDelIcon: hideDelIcon, delIconText: delIconText })); },
322
- };
323
- _newColumns.unshift(newColumn);
273
+ }
274
+ else if (_column.required) {
275
+ if (_column.validate) {
276
+ _column.validate.title = _column.validate.title
277
+ ? _column.validate.title
278
+ : _column.title;
324
279
  }
280
+ _column.title = (React.createElement(React.Fragment, null,
281
+ React.createElement("i", { className: "zt-column--required" }, "*"),
282
+ _column.title));
283
+ }
284
+ // 去掉不显示表头的项
285
+ if (!_column.hideColumn) {
286
+ _newColumns.push(_column);
287
+ }
288
+ // 添加render字段
289
+ if (!_column.render) {
290
+ _column.render = function (text, record, index) {
291
+ return text == null || text === '' ? '— —' : text;
292
+ };
325
293
  }
326
- else if (onAddAndDelHandle) {
327
- // 没有动态列配置
294
+ });
295
+ if (showColumnDynamic) {
296
+ // 如果需要展示动态列
297
+ if (!onAddAndDelHandle) {
298
+ // 并且不需要展示删减功能,那么动态列,加到序号列,也就是第0项
299
+ _newColumns[0].title = function () { return React.createElement(ColumnDynamicCom, null); };
300
+ }
301
+ else {
302
+ // 需要展示删减功能
328
303
  var newColumn = {
329
304
  title: function () { return (React.createElement(React.Fragment, null,
305
+ React.createElement(ColumnDynamicCom, null),
330
306
  React.createElement(DelAllCom, null))); },
331
307
  width: 52,
332
308
  fixed: 'left',
333
309
  align: 'center',
334
- render: function (text, render, index) { return (React.createElement(TableAddDelColumn, { onAddAndDelHandle: function (type) {
335
- var innerIndex = getInnerIndex(currentPage, index);
336
- onAddAndDelHandle(type, innerIndex);
337
- }, hideAddIcon: hideAddIcon, addIconText: addIconText, hideDelIcon: hideDelIcon, delIconText: delIconText })); },
310
+ render: function (text, render, index) { return (React.createElement(TableAddDelColumn, { onAddAndDelHandle: onAddAndDelHandleMemo, index: index, hideAddIcon: hideAddIcon, addIconText: addIconText, hideDelIcon: hideDelIcon, delIconText: delIconText })); },
338
311
  };
339
312
  _newColumns.unshift(newColumn);
340
313
  }
341
- setNewColumns(_newColumns);
342
- setDynamicColumns(_dynamicColumns);
343
- newColumnsRef.current = _newColumns;
344
- // eslint-disable-next-line react-hooks/exhaustive-deps
314
+ }
315
+ else if (onAddAndDelHandle) {
316
+ // 没有动态列配置
317
+ var newColumn = {
318
+ title: function () { return (React.createElement(React.Fragment, null,
319
+ React.createElement(DelAllCom, null))); },
320
+ width: 52,
321
+ fixed: 'left',
322
+ align: 'center',
323
+ render: function (text, render, index) { return (React.createElement(TableAddDelColumn, { onAddAndDelHandle: onAddAndDelHandleMemo, index: index, hideAddIcon: hideAddIcon, addIconText: addIconText, hideDelIcon: hideDelIcon, delIconText: delIconText })); },
324
+ };
325
+ _newColumns.unshift(newColumn);
326
+ }
327
+ newColumnsRef.current = _newColumns;
328
+ return {
329
+ _newColumns: _newColumns,
330
+ _dynamicColumns: _dynamicColumns,
331
+ };
332
+ }
333
+ function useColumns(props) {
334
+ var columns = props.columns, hiddenColumnDynamicIcon = props.hiddenColumnDynamicIcon, showColumnDynamic = props.showColumnDynamic, showColumnDynamicKey = props.showColumnDynamicKey, onAddAndDelHandle = props.onAddAndDelHandle, hideAddIcon = props.hideAddIcon, showDelAllBtn = props.showDelAllBtn, delAllChange = props.delAllChange, addIconText = props.addIconText, hideDelIcon = props.hideDelIcon, delIconText = props.delIconText, showDynamicHandle = props.showDynamicHandle, onEditableSave = props.onEditableSave, configInfo = props.configInfo, copyByKey = props.copyByKey, onTableChange = props.onTableChange, currentPage = props.currentPage;
335
+ var newColumnsRef = useRef();
336
+ // 动态列配置显隐
337
+ var ColumnDynamicCom = useCallback(function () {
338
+ return hiddenColumnDynamicIcon ? null : (React.createElement(PicRightOutlined, { className: "zt-column--daynamic-icon", onClick: showDynamicHandle }));
339
+ }, [showDynamicHandle, hiddenColumnDynamicIcon]);
340
+ // 动态列配置显隐
341
+ var DelAllCom = useCallback(function () {
342
+ return showDelAllBtn ? (React.createElement(Popconfirm, { title: "\u662F\u5426\u5168\u90E8\u5220\u9664", onConfirm: function () { return delAllChange && delAllChange(); } },
343
+ React.createElement(MinusSquareOutlined, { className: "zt-column--daynamic-icon", style: { marginLeft: '4px' } }))) : null;
344
+ }, [delAllChange, showDelAllBtn]);
345
+ // 增减行回调
346
+ var onAddAndDelHandleMemo = useCallback(function (type, index) {
347
+ unstable_batchedUpdates(function () {
348
+ var innerIndex = getInnerIndex(currentPage, index);
349
+ onAddAndDelHandle && onAddAndDelHandle(type, innerIndex);
350
+ });
351
+ },
352
+ // eslint-disable-next-line react-hooks/exhaustive-deps
353
+ [onAddAndDelHandle]);
354
+ // 设置方法
355
+ var getNewColumnsMemo = useCallback(function (columns, refresh, myCatchColumns) {
356
+ return getNewColumns({
357
+ columns: columns,
358
+ newColumnsRef: newColumnsRef,
359
+ showColumnDynamic: showColumnDynamic,
360
+ showColumnDynamicKey: showColumnDynamicKey,
361
+ configInfo: configInfo,
362
+ }, {
363
+ onEditableSave: onEditableSave,
364
+ onTableChange: onTableChange,
365
+ currentPage: currentPage,
366
+ }, {
367
+ ColumnDynamicCom: ColumnDynamicCom,
368
+ DelAllCom: DelAllCom,
369
+ onAddAndDelHandleMemo: onAddAndDelHandleMemo,
370
+ onAddAndDelHandle: onAddAndDelHandle,
371
+ hideAddIcon: hideAddIcon,
372
+ addIconText: addIconText,
373
+ hideDelIcon: hideDelIcon,
374
+ delIconText: delIconText,
375
+ }, {
376
+ copyByKey: copyByKey,
377
+ myCatchColumns: myCatchColumns,
378
+ });
345
379
  }, [
346
- columns,
347
380
  showColumnDynamic,
381
+ showColumnDynamicKey,
382
+ configInfo,
383
+ onEditableSave,
384
+ onTableChange,
385
+ currentPage,
386
+ ColumnDynamicCom,
387
+ DelAllCom,
388
+ onAddAndDelHandleMemo,
348
389
  onAddAndDelHandle,
349
390
  hideAddIcon,
350
391
  addIconText,
351
392
  hideDelIcon,
352
393
  delIconText,
353
- ColumnDynamicCom,
354
- onEditableSave,
355
- configInfo,
356
- showColumnDynamicKey,
394
+ copyByKey,
357
395
  ]);
358
- return { newColumns: newColumns, dynamicColumns: dynamicColumns, setNewColumns: setNewColumns };
396
+ var _a = useState(false), refreshColumns = _a[0], setRefreshColumns = _a[1];
397
+ var _b = useState([]), myCatchColumns = _b[0], setMyCatchColumns = _b[1];
398
+ var refreshColumnsHandle = useCallback(function (columns) {
399
+ unstable_batchedUpdates(function () {
400
+ setRefreshColumns(function (refresh) { return !refresh; });
401
+ if (columns) {
402
+ setMyCatchColumns(columns);
403
+ }
404
+ else {
405
+ setMyCatchColumns([]);
406
+ }
407
+ });
408
+ }, []);
409
+ var calcColumns = useMemo(function () {
410
+ return getNewColumnsMemo(columns, refreshColumns, myCatchColumns);
411
+ }, [getNewColumnsMemo, columns, refreshColumns, myCatchColumns]);
412
+ return {
413
+ newColumns: calcColumns._newColumns,
414
+ dynamicColumns: calcColumns._dynamicColumns,
415
+ refreshColumnsHandle: refreshColumnsHandle,
416
+ };
359
417
  }
360
418
  export default useColumns;
@@ -37,6 +37,7 @@ export default function useInnerPagination(isShow, defaultInnerPageSize) {
37
37
  }
38
38
  },
39
39
  hideOnSinglePage: true,
40
+ position: ['bottomLeft'],
40
41
  defaultPageSize: DEFAULT_PAGESIZE,
41
42
  pageSizeOptions: ['10', '20', '30'],
42
43
  }); }, [isShow, current, pageSize]);
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  interface IProps {
3
3
  /**新增行删除行方法 */
4
- onAddAndDelHandle?: (type: 'add' | 'del') => void;
4
+ onAddAndDelHandle?: (type: 'add' | 'del', index: number) => void;
5
5
  /**隐藏新增icon */
6
6
  hideAddIcon?: boolean;
7
7
  /**新增icon提示文字 */
@@ -10,6 +10,7 @@ interface IProps {
10
10
  hideDelIcon?: boolean;
11
11
  /**删除icon提示文字 */
12
12
  delIconText?: string;
13
+ index: number;
13
14
  }
14
15
  declare const _default: React.NamedExoticComponent<IProps>;
15
16
  export default _default;
@@ -3,15 +3,17 @@ import { PlusOutlined, MinusOutlined } from '@ant-design/icons';
3
3
  import debounce from 'lodash/debounce';
4
4
  import { Popconfirm } from '../../index';
5
5
  var TableAddDelColumn = function (_a) {
6
- var onAddAndDelHandle = _a.onAddAndDelHandle, hideAddIcon = _a.hideAddIcon, addIconText = _a.addIconText, hideDelIcon = _a.hideDelIcon, _b = _a.delIconText, delIconText = _b === void 0 ? '是否删除该行?' : _b;
6
+ var onAddAndDelHandle = _a.onAddAndDelHandle, hideAddIcon = _a.hideAddIcon, addIconText = _a.addIconText, hideDelIcon = _a.hideDelIcon, _b = _a.delIconText, delIconText = _b === void 0 ? '是否删除该行?' : _b, index = _a.index;
7
7
  var onAddfn = function () {
8
- onAddAndDelHandle && onAddAndDelHandle('add');
8
+ onAddAndDelHandle && onAddAndDelHandle('add', index);
9
9
  };
10
10
  return (React.createElement(React.Fragment, null,
11
11
  hideAddIcon ? null : (React.createElement("div", { title: "\u65B0\u589E\u4E00\u884C", className: "zt-column__add-icon" },
12
12
  React.createElement(PlusOutlined, { onClick: debounce(onAddfn, 500) }))),
13
13
  hideDelIcon ? null : (React.createElement("div", { title: "\u5220\u9664\u8BE5\u884C", className: "zt-column__del-icon" },
14
- React.createElement(Popconfirm, { title: delIconText, onConfirm: function () { return onAddAndDelHandle && onAddAndDelHandle('del'); } },
14
+ React.createElement(Popconfirm, { title: delIconText, onConfirm: function () {
15
+ return onAddAndDelHandle && onAddAndDelHandle('del', index);
16
+ } },
15
17
  React.createElement(MinusOutlined, null))))));
16
18
  };
17
19
  export default memo(TableAddDelColumn);
@@ -33,10 +33,13 @@ interface IEditableCellProps {
33
33
  children: React.ReactNode;
34
34
  dataIndex: string;
35
35
  record: any;
36
- handleSave: (record: any, index: number | undefined, dataIndex: string) => void;
36
+ handleSave: (record: any, index: number | undefined, dataIndex: string, otherInfo?: {
37
+ isInner?: boolean;
38
+ }) => void;
37
39
  columns: any;
38
40
  onTableChange: any;
39
41
  currentpage: ICurrentPage;
42
+ [props: string]: any;
40
43
  }
41
- declare const TableEnhanceCell: React.FC<IEditableCellProps>;
42
- export default TableEnhanceCell;
44
+ declare const _default: React.NamedExoticComponent<IEditableCellProps>;
45
+ export default _default;