@zat-design/sisyphus-react 3.13.13 → 3.13.14-beta.2
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/es/ProForm/utils/index.js +1 -1
- package/es/ProTable/hooks/useAntdTable.d.ts +3 -0
- package/es/ProTable/hooks/useAntdTable.js +90 -63
- package/es/ProTable/index.d.ts +3 -0
- package/es/ProTable/index.js +4 -1
- package/es/ProTable/propsType.d.ts +1 -1
- package/lib/ProForm/utils/index.js +1 -1
- package/lib/ProTable/hooks/useAntdTable.d.ts +3 -0
- package/lib/ProTable/hooks/useAntdTable.js +91 -64
- package/lib/ProTable/index.d.ts +3 -0
- package/lib/ProTable/index.js +5 -1
- package/lib/ProTable/propsType.d.ts +1 -1
- package/package.json +2 -3
@@ -145,7 +145,7 @@ var _filterInternalFields = function filterInternalFields(values, optimize) {
|
|
145
145
|
if (_isObject(nextValues)) {
|
146
146
|
var result = {};
|
147
147
|
Object.keys(nextValues).forEach(function (key) {
|
148
|
-
if (key.includes('-')) return;
|
148
|
+
if (key.includes('-') || key.startsWith('__')) return;
|
149
149
|
result[key] = _filterInternalFields(nextValues[key]);
|
150
150
|
});
|
151
151
|
return result;
|
@@ -1,4 +1,7 @@
|
|
1
1
|
import { useRequest } from 'ahooks';
|
2
2
|
import type { ProTableRequestOptionsType, ProTableServiceType } from '../propsType';
|
3
|
+
export declare const SELECTION_ALL = "SELECTION_ALL";
|
4
|
+
export declare const CURRENT_PAGE = "CURRENT_PAGE";
|
5
|
+
export declare const UNCHECK_ALL = "UNCHECK_ALL";
|
3
6
|
declare function useAntdTable<I, R extends Record<string, any>, S extends ProTableServiceType<I, R>>(service: S, options?: ProTableRequestOptionsType<I, R>, useRequestOptions?: Parameters<typeof useRequest>[1]): any;
|
4
7
|
export default useAntdTable;
|
@@ -32,6 +32,9 @@ var useDefaultOptions = function useDefaultOptions(options) {
|
|
32
32
|
});
|
33
33
|
};
|
34
34
|
var previousSearchValues = null;
|
35
|
+
export var SELECTION_ALL = 'SELECTION_ALL';
|
36
|
+
export var CURRENT_PAGE = 'CURRENT_PAGE';
|
37
|
+
export var UNCHECK_ALL = 'UNCHECK_ALL';
|
35
38
|
function useAntdTable(service, options, useRequestOptions) {
|
36
39
|
var _locale$ProTable2, _locale$ProTable3, _locale$ProTable4, _locale$ProTable5, _result$params, _form$getFieldsValue3;
|
37
40
|
var _useSetState = useSetState({
|
@@ -339,6 +342,92 @@ function useAntdTable(service, options, useRequestOptions) {
|
|
339
342
|
return _ref4.apply(this, arguments);
|
340
343
|
};
|
341
344
|
}();
|
345
|
+
// 内置选择下拉
|
346
|
+
var defaultSelections = [{
|
347
|
+
key: 'currentPage',
|
348
|
+
text: formatMessage(locale === null || locale === void 0 ? void 0 : (_locale$ProTable2 = locale.ProTable) === null || _locale$ProTable2 === void 0 ? void 0 : _locale$ProTable2.selectCurPage, {
|
349
|
+
total: (data === null || data === void 0 ? void 0 : data.length) || 0
|
350
|
+
}),
|
351
|
+
onSelect: function onSelect(changeableRowKeys) {
|
352
|
+
setState({
|
353
|
+
allSelected: false,
|
354
|
+
selectedRecords: _toConsumableArray(data),
|
355
|
+
selectedRowKeys: changeableRowKeys
|
356
|
+
});
|
357
|
+
}
|
358
|
+
}, {
|
359
|
+
key: 'all',
|
360
|
+
text: formatMessage(locale === null || locale === void 0 ? void 0 : (_locale$ProTable3 = locale.ProTable) === null || _locale$ProTable3 === void 0 ? void 0 : _locale$ProTable3.selectAll, {
|
361
|
+
total: total
|
362
|
+
}),
|
363
|
+
onSelect: function () {
|
364
|
+
var _onSelect = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2(changeableRowKeys) {
|
365
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
366
|
+
while (1) switch (_context2.prev = _context2.next) {
|
367
|
+
case 0:
|
368
|
+
setState({
|
369
|
+
allSelected: true,
|
370
|
+
selectedRecords: _toConsumableArray(data),
|
371
|
+
selectedRowKeys: changeableRowKeys
|
372
|
+
});
|
373
|
+
case 1:
|
374
|
+
case "end":
|
375
|
+
return _context2.stop();
|
376
|
+
}
|
377
|
+
}, _callee2);
|
378
|
+
}));
|
379
|
+
function onSelect(_x) {
|
380
|
+
return _onSelect.apply(this, arguments);
|
381
|
+
}
|
382
|
+
return onSelect;
|
383
|
+
}()
|
384
|
+
}, {
|
385
|
+
key: 'uncheckAll',
|
386
|
+
text: locale === null || locale === void 0 ? void 0 : (_locale$ProTable4 = locale.ProTable) === null || _locale$ProTable4 === void 0 ? void 0 : _locale$ProTable4.deselect,
|
387
|
+
onSelect: function () {
|
388
|
+
var _onSelect2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
|
389
|
+
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
390
|
+
while (1) switch (_context3.prev = _context3.next) {
|
391
|
+
case 0:
|
392
|
+
setState({
|
393
|
+
allSelected: false,
|
394
|
+
selectedRecords: [],
|
395
|
+
selectedRowKeys: []
|
396
|
+
});
|
397
|
+
case 1:
|
398
|
+
case "end":
|
399
|
+
return _context3.stop();
|
400
|
+
}
|
401
|
+
}, _callee3);
|
402
|
+
}));
|
403
|
+
function onSelect() {
|
404
|
+
return _onSelect2.apply(this, arguments);
|
405
|
+
}
|
406
|
+
return onSelect;
|
407
|
+
}()
|
408
|
+
}];
|
409
|
+
var selections = useMemo(function () {
|
410
|
+
if (rowSelections === true) {
|
411
|
+
return defaultSelections;
|
412
|
+
}
|
413
|
+
if (Array.isArray(rowSelections)) {
|
414
|
+
return rowSelections.map(function (item) {
|
415
|
+
if (typeof item === 'string') {
|
416
|
+
if (item === CURRENT_PAGE) {
|
417
|
+
return defaultSelections[0];
|
418
|
+
}
|
419
|
+
if (item === SELECTION_ALL) {
|
420
|
+
return defaultSelections[1];
|
421
|
+
}
|
422
|
+
if (item === UNCHECK_ALL) {
|
423
|
+
return defaultSelections[2];
|
424
|
+
}
|
425
|
+
}
|
426
|
+
return item;
|
427
|
+
});
|
428
|
+
}
|
429
|
+
return false;
|
430
|
+
}, [rowSelections]);
|
342
431
|
var _rowSelection = {
|
343
432
|
fixed: true,
|
344
433
|
type: rowSelectType,
|
@@ -386,69 +475,7 @@ function useAntdTable(service, options, useRequestOptions) {
|
|
386
475
|
className: allSelected && rowSelections ? 'checkbox-disabled' : ''
|
387
476
|
};
|
388
477
|
},
|
389
|
-
selections:
|
390
|
-
key: 'currentPage',
|
391
|
-
text: formatMessage(locale === null || locale === void 0 ? void 0 : (_locale$ProTable2 = locale.ProTable) === null || _locale$ProTable2 === void 0 ? void 0 : _locale$ProTable2.selectCurPage, {
|
392
|
-
total: (data === null || data === void 0 ? void 0 : data.length) || 0
|
393
|
-
}),
|
394
|
-
onSelect: function onSelect(changeableRowKeys) {
|
395
|
-
setState({
|
396
|
-
allSelected: false,
|
397
|
-
selectedRecords: _toConsumableArray(data),
|
398
|
-
selectedRowKeys: changeableRowKeys
|
399
|
-
});
|
400
|
-
}
|
401
|
-
}, {
|
402
|
-
key: 'all',
|
403
|
-
text: formatMessage(locale === null || locale === void 0 ? void 0 : (_locale$ProTable3 = locale.ProTable) === null || _locale$ProTable3 === void 0 ? void 0 : _locale$ProTable3.selectAll, {
|
404
|
-
total: total
|
405
|
-
}),
|
406
|
-
onSelect: function () {
|
407
|
-
var _onSelect = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2(changeableRowKeys) {
|
408
|
-
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
409
|
-
while (1) switch (_context2.prev = _context2.next) {
|
410
|
-
case 0:
|
411
|
-
setState({
|
412
|
-
allSelected: true,
|
413
|
-
selectedRecords: _toConsumableArray(data),
|
414
|
-
selectedRowKeys: changeableRowKeys
|
415
|
-
});
|
416
|
-
case 1:
|
417
|
-
case "end":
|
418
|
-
return _context2.stop();
|
419
|
-
}
|
420
|
-
}, _callee2);
|
421
|
-
}));
|
422
|
-
function onSelect(_x) {
|
423
|
-
return _onSelect.apply(this, arguments);
|
424
|
-
}
|
425
|
-
return onSelect;
|
426
|
-
}()
|
427
|
-
}, {
|
428
|
-
key: 'uncheckAll',
|
429
|
-
text: locale === null || locale === void 0 ? void 0 : (_locale$ProTable4 = locale.ProTable) === null || _locale$ProTable4 === void 0 ? void 0 : _locale$ProTable4.deselect,
|
430
|
-
onSelect: function () {
|
431
|
-
var _onSelect2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
|
432
|
-
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
433
|
-
while (1) switch (_context3.prev = _context3.next) {
|
434
|
-
case 0:
|
435
|
-
setState({
|
436
|
-
allSelected: false,
|
437
|
-
selectedRecords: [],
|
438
|
-
selectedRowKeys: []
|
439
|
-
});
|
440
|
-
case 1:
|
441
|
-
case "end":
|
442
|
-
return _context3.stop();
|
443
|
-
}
|
444
|
-
}, _callee3);
|
445
|
-
}));
|
446
|
-
function onSelect() {
|
447
|
-
return _onSelect2.apply(this, arguments);
|
448
|
-
}
|
449
|
-
return onSelect;
|
450
|
-
}()
|
451
|
-
}] : false
|
478
|
+
selections: selections
|
452
479
|
};
|
453
480
|
var rowSelection = _isObject(returnRowSelection) ? _merge(_rowSelection, returnRowSelection) : _rowSelection;
|
454
481
|
if (_isObject(returnRowSelection) && !_isEqual(rowSelection, _rowSelection)) {
|
package/es/ProTable/index.d.ts
CHANGED
package/es/ProTable/index.js
CHANGED
@@ -19,7 +19,7 @@ import { useDebounceEffect, useDeepCompareEffect, useSetState } from 'ahooks';
|
|
19
19
|
import classnames from 'classnames';
|
20
20
|
import { useProConfig } from '../index';
|
21
21
|
import { RenderTableHeader, RenderFooter, RenderTabs } from './components';
|
22
|
-
import useAntdTable from './hooks/useAntdTable';
|
22
|
+
import useAntdTable, { CURRENT_PAGE, SELECTION_ALL, UNCHECK_ALL } from './hooks/useAntdTable';
|
23
23
|
import { BaseTable, DraggableTable } from './components/RcTable';
|
24
24
|
import { formatColumn } from './components/FormatColumn';
|
25
25
|
import empty from '../assets/empty.png';
|
@@ -469,4 +469,7 @@ ProTable.defaultProps = {
|
|
469
469
|
isView: false
|
470
470
|
};
|
471
471
|
ProTable.useAntdTable = useAntdTable;
|
472
|
+
ProTable.SELECTION_ALL = SELECTION_ALL;
|
473
|
+
ProTable.CURRENT_PAGE = CURRENT_PAGE;
|
474
|
+
ProTable.UNCHECK_ALL = UNCHECK_ALL;
|
472
475
|
export default ProTable;
|
@@ -609,7 +609,7 @@ export interface ProTableRequestOptionsType<T, R> {
|
|
609
609
|
* @description 启用选择当前页、选择全部、取消选择下拉菜单
|
610
610
|
* @default false
|
611
611
|
*/
|
612
|
-
rowSelections?: boolean;
|
612
|
+
rowSelections?: boolean | object[];
|
613
613
|
/**
|
614
614
|
* 额外参数
|
615
615
|
* @description 无法通过搜索表单设置的值,此值变更时也会重新发起请求,重置表单不会被清空
|
@@ -161,7 +161,7 @@ var _filterInternalFields = exports.filterInternalFields = function filterIntern
|
|
161
161
|
if ((0, _isObject2.default)(nextValues)) {
|
162
162
|
var result = {};
|
163
163
|
Object.keys(nextValues).forEach(function (key) {
|
164
|
-
if (key.includes('-')) return;
|
164
|
+
if (key.includes('-') || key.startsWith('__')) return;
|
165
165
|
result[key] = _filterInternalFields(nextValues[key]);
|
166
166
|
});
|
167
167
|
return result;
|
@@ -1,4 +1,7 @@
|
|
1
1
|
import { useRequest } from 'ahooks';
|
2
2
|
import type { ProTableRequestOptionsType, ProTableServiceType } from '../propsType';
|
3
|
+
export declare const SELECTION_ALL = "SELECTION_ALL";
|
4
|
+
export declare const CURRENT_PAGE = "CURRENT_PAGE";
|
5
|
+
export declare const UNCHECK_ALL = "UNCHECK_ALL";
|
3
6
|
declare function useAntdTable<I, R extends Record<string, any>, S extends ProTableServiceType<I, R>>(service: S, options?: ProTableRequestOptionsType<I, R>, useRequestOptions?: Parameters<typeof useRequest>[1]): any;
|
4
7
|
export default useAntdTable;
|
@@ -5,7 +5,7 @@ var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWild
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
6
6
|
value: true
|
7
7
|
});
|
8
|
-
exports.default = void 0;
|
8
|
+
exports.default = exports.UNCHECK_ALL = exports.SELECTION_ALL = exports.CURRENT_PAGE = void 0;
|
9
9
|
var _regeneratorRuntime2 = _interopRequireDefault(require("@babel/runtime/helpers/regeneratorRuntime"));
|
10
10
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
11
11
|
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
@@ -40,6 +40,9 @@ var useDefaultOptions = function useDefaultOptions(options) {
|
|
40
40
|
});
|
41
41
|
};
|
42
42
|
var previousSearchValues = null;
|
43
|
+
var SELECTION_ALL = exports.SELECTION_ALL = 'SELECTION_ALL';
|
44
|
+
var CURRENT_PAGE = exports.CURRENT_PAGE = 'CURRENT_PAGE';
|
45
|
+
var UNCHECK_ALL = exports.UNCHECK_ALL = 'UNCHECK_ALL';
|
43
46
|
function useAntdTable(service, options, useRequestOptions) {
|
44
47
|
var _locale$ProTable2, _locale$ProTable3, _locale$ProTable4, _locale$ProTable5, _result$params, _form$getFieldsValue3;
|
45
48
|
var _useSetState = (0, _ahooks.useSetState)({
|
@@ -347,6 +350,92 @@ function useAntdTable(service, options, useRequestOptions) {
|
|
347
350
|
return _ref4.apply(this, arguments);
|
348
351
|
};
|
349
352
|
}();
|
353
|
+
// 内置选择下拉
|
354
|
+
var defaultSelections = [{
|
355
|
+
key: 'currentPage',
|
356
|
+
text: (0, _locale.formatMessage)(_locale.default === null || _locale.default === void 0 ? void 0 : (_locale$ProTable2 = _locale.default.ProTable) === null || _locale$ProTable2 === void 0 ? void 0 : _locale$ProTable2.selectCurPage, {
|
357
|
+
total: (data === null || data === void 0 ? void 0 : data.length) || 0
|
358
|
+
}),
|
359
|
+
onSelect: function onSelect(changeableRowKeys) {
|
360
|
+
setState({
|
361
|
+
allSelected: false,
|
362
|
+
selectedRecords: (0, _toConsumableArray2.default)(data),
|
363
|
+
selectedRowKeys: changeableRowKeys
|
364
|
+
});
|
365
|
+
}
|
366
|
+
}, {
|
367
|
+
key: 'all',
|
368
|
+
text: (0, _locale.formatMessage)(_locale.default === null || _locale.default === void 0 ? void 0 : (_locale$ProTable3 = _locale.default.ProTable) === null || _locale$ProTable3 === void 0 ? void 0 : _locale$ProTable3.selectAll, {
|
369
|
+
total: total
|
370
|
+
}),
|
371
|
+
onSelect: function () {
|
372
|
+
var _onSelect = (0, _asyncToGenerator2.default)(/*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee2(changeableRowKeys) {
|
373
|
+
return (0, _regeneratorRuntime2.default)().wrap(function _callee2$(_context2) {
|
374
|
+
while (1) switch (_context2.prev = _context2.next) {
|
375
|
+
case 0:
|
376
|
+
setState({
|
377
|
+
allSelected: true,
|
378
|
+
selectedRecords: (0, _toConsumableArray2.default)(data),
|
379
|
+
selectedRowKeys: changeableRowKeys
|
380
|
+
});
|
381
|
+
case 1:
|
382
|
+
case "end":
|
383
|
+
return _context2.stop();
|
384
|
+
}
|
385
|
+
}, _callee2);
|
386
|
+
}));
|
387
|
+
function onSelect(_x) {
|
388
|
+
return _onSelect.apply(this, arguments);
|
389
|
+
}
|
390
|
+
return onSelect;
|
391
|
+
}()
|
392
|
+
}, {
|
393
|
+
key: 'uncheckAll',
|
394
|
+
text: _locale.default === null || _locale.default === void 0 ? void 0 : (_locale$ProTable4 = _locale.default.ProTable) === null || _locale$ProTable4 === void 0 ? void 0 : _locale$ProTable4.deselect,
|
395
|
+
onSelect: function () {
|
396
|
+
var _onSelect2 = (0, _asyncToGenerator2.default)(/*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee3() {
|
397
|
+
return (0, _regeneratorRuntime2.default)().wrap(function _callee3$(_context3) {
|
398
|
+
while (1) switch (_context3.prev = _context3.next) {
|
399
|
+
case 0:
|
400
|
+
setState({
|
401
|
+
allSelected: false,
|
402
|
+
selectedRecords: [],
|
403
|
+
selectedRowKeys: []
|
404
|
+
});
|
405
|
+
case 1:
|
406
|
+
case "end":
|
407
|
+
return _context3.stop();
|
408
|
+
}
|
409
|
+
}, _callee3);
|
410
|
+
}));
|
411
|
+
function onSelect() {
|
412
|
+
return _onSelect2.apply(this, arguments);
|
413
|
+
}
|
414
|
+
return onSelect;
|
415
|
+
}()
|
416
|
+
}];
|
417
|
+
var selections = (0, _react.useMemo)(function () {
|
418
|
+
if (rowSelections === true) {
|
419
|
+
return defaultSelections;
|
420
|
+
}
|
421
|
+
if (Array.isArray(rowSelections)) {
|
422
|
+
return rowSelections.map(function (item) {
|
423
|
+
if (typeof item === 'string') {
|
424
|
+
if (item === CURRENT_PAGE) {
|
425
|
+
return defaultSelections[0];
|
426
|
+
}
|
427
|
+
if (item === SELECTION_ALL) {
|
428
|
+
return defaultSelections[1];
|
429
|
+
}
|
430
|
+
if (item === UNCHECK_ALL) {
|
431
|
+
return defaultSelections[2];
|
432
|
+
}
|
433
|
+
}
|
434
|
+
return item;
|
435
|
+
});
|
436
|
+
}
|
437
|
+
return false;
|
438
|
+
}, [rowSelections]);
|
350
439
|
var _rowSelection = {
|
351
440
|
fixed: true,
|
352
441
|
type: rowSelectType,
|
@@ -394,69 +483,7 @@ function useAntdTable(service, options, useRequestOptions) {
|
|
394
483
|
className: allSelected && rowSelections ? 'checkbox-disabled' : ''
|
395
484
|
};
|
396
485
|
},
|
397
|
-
selections:
|
398
|
-
key: 'currentPage',
|
399
|
-
text: (0, _locale.formatMessage)(_locale.default === null || _locale.default === void 0 ? void 0 : (_locale$ProTable2 = _locale.default.ProTable) === null || _locale$ProTable2 === void 0 ? void 0 : _locale$ProTable2.selectCurPage, {
|
400
|
-
total: (data === null || data === void 0 ? void 0 : data.length) || 0
|
401
|
-
}),
|
402
|
-
onSelect: function onSelect(changeableRowKeys) {
|
403
|
-
setState({
|
404
|
-
allSelected: false,
|
405
|
-
selectedRecords: (0, _toConsumableArray2.default)(data),
|
406
|
-
selectedRowKeys: changeableRowKeys
|
407
|
-
});
|
408
|
-
}
|
409
|
-
}, {
|
410
|
-
key: 'all',
|
411
|
-
text: (0, _locale.formatMessage)(_locale.default === null || _locale.default === void 0 ? void 0 : (_locale$ProTable3 = _locale.default.ProTable) === null || _locale$ProTable3 === void 0 ? void 0 : _locale$ProTable3.selectAll, {
|
412
|
-
total: total
|
413
|
-
}),
|
414
|
-
onSelect: function () {
|
415
|
-
var _onSelect = (0, _asyncToGenerator2.default)(/*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee2(changeableRowKeys) {
|
416
|
-
return (0, _regeneratorRuntime2.default)().wrap(function _callee2$(_context2) {
|
417
|
-
while (1) switch (_context2.prev = _context2.next) {
|
418
|
-
case 0:
|
419
|
-
setState({
|
420
|
-
allSelected: true,
|
421
|
-
selectedRecords: (0, _toConsumableArray2.default)(data),
|
422
|
-
selectedRowKeys: changeableRowKeys
|
423
|
-
});
|
424
|
-
case 1:
|
425
|
-
case "end":
|
426
|
-
return _context2.stop();
|
427
|
-
}
|
428
|
-
}, _callee2);
|
429
|
-
}));
|
430
|
-
function onSelect(_x) {
|
431
|
-
return _onSelect.apply(this, arguments);
|
432
|
-
}
|
433
|
-
return onSelect;
|
434
|
-
}()
|
435
|
-
}, {
|
436
|
-
key: 'uncheckAll',
|
437
|
-
text: _locale.default === null || _locale.default === void 0 ? void 0 : (_locale$ProTable4 = _locale.default.ProTable) === null || _locale$ProTable4 === void 0 ? void 0 : _locale$ProTable4.deselect,
|
438
|
-
onSelect: function () {
|
439
|
-
var _onSelect2 = (0, _asyncToGenerator2.default)(/*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee3() {
|
440
|
-
return (0, _regeneratorRuntime2.default)().wrap(function _callee3$(_context3) {
|
441
|
-
while (1) switch (_context3.prev = _context3.next) {
|
442
|
-
case 0:
|
443
|
-
setState({
|
444
|
-
allSelected: false,
|
445
|
-
selectedRecords: [],
|
446
|
-
selectedRowKeys: []
|
447
|
-
});
|
448
|
-
case 1:
|
449
|
-
case "end":
|
450
|
-
return _context3.stop();
|
451
|
-
}
|
452
|
-
}, _callee3);
|
453
|
-
}));
|
454
|
-
function onSelect() {
|
455
|
-
return _onSelect2.apply(this, arguments);
|
456
|
-
}
|
457
|
-
return onSelect;
|
458
|
-
}()
|
459
|
-
}] : false
|
486
|
+
selections: selections
|
460
487
|
};
|
461
488
|
var rowSelection = (0, _isObject2.default)(returnRowSelection) ? (0, _merge2.default)(_rowSelection, returnRowSelection) : _rowSelection;
|
462
489
|
if ((0, _isObject2.default)(returnRowSelection) && !(0, _isEqual2.default)(rowSelection, _rowSelection)) {
|
package/lib/ProTable/index.d.ts
CHANGED
package/lib/ProTable/index.js
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
"use strict";
|
2
2
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
4
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
4
5
|
Object.defineProperty(exports, "__esModule", {
|
5
6
|
value: true
|
6
7
|
});
|
@@ -24,7 +25,7 @@ var _ahooks = require("ahooks");
|
|
24
25
|
var _classnames2 = _interopRequireDefault(require("classnames"));
|
25
26
|
var _index = require("../index");
|
26
27
|
var _components = require("./components");
|
27
|
-
var _useAntdTable =
|
28
|
+
var _useAntdTable = _interopRequireWildcard(require("./hooks/useAntdTable"));
|
28
29
|
var _RcTable = require("./components/RcTable");
|
29
30
|
var _FormatColumn = require("./components/FormatColumn");
|
30
31
|
var _empty = _interopRequireDefault(require("../assets/empty.png"));
|
@@ -476,4 +477,7 @@ ProTable.defaultProps = {
|
|
476
477
|
isView: false
|
477
478
|
};
|
478
479
|
ProTable.useAntdTable = _useAntdTable.default;
|
480
|
+
ProTable.SELECTION_ALL = _useAntdTable.SELECTION_ALL;
|
481
|
+
ProTable.CURRENT_PAGE = _useAntdTable.CURRENT_PAGE;
|
482
|
+
ProTable.UNCHECK_ALL = _useAntdTable.UNCHECK_ALL;
|
479
483
|
var _default = exports.default = ProTable;
|
@@ -609,7 +609,7 @@ export interface ProTableRequestOptionsType<T, R> {
|
|
609
609
|
* @description 启用选择当前页、选择全部、取消选择下拉菜单
|
610
610
|
* @default false
|
611
611
|
*/
|
612
|
-
rowSelections?: boolean;
|
612
|
+
rowSelections?: boolean | object[];
|
613
613
|
/**
|
614
614
|
* 额外参数
|
615
615
|
* @description 无法通过搜索表单设置的值,此值变更时也会重新发起请求,重置表单不会被清空
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@zat-design/sisyphus-react",
|
3
|
-
"version": "3.13.
|
3
|
+
"version": "3.13.14-beta.2",
|
4
4
|
"license": "MIT",
|
5
5
|
"main": "lib/index.js",
|
6
6
|
"module": "es/index.js",
|
@@ -82,8 +82,7 @@
|
|
82
82
|
"peerDependencies": {
|
83
83
|
"antd": "^4.24.8",
|
84
84
|
"react": "^17.0.0 || ^18.0.0",
|
85
|
-
"react-dom": "^17.0.0 || ^18.0.0"
|
86
|
-
"react-router-dom": "^5.1.7"
|
85
|
+
"react-dom": "^17.0.0 || ^18.0.0"
|
87
86
|
},
|
88
87
|
"devDependencies": {
|
89
88
|
"@commitlint/cli": "^12.1.1",
|