xmirror-components 1.0.34-alpha.2 → 1.0.36
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/build/dist/index.cjs +23 -23
- package/build/dist/index.mjs +999 -991
- package/build/es/hooks/useSearchParams/index.js +3 -0
- package/build/es/hooks/useTable/index.js +10 -1
- package/build/es/hooks/useTable/types.d.ts +4 -0
- package/build/lib/hooks/useSearchParams/index.js +3 -0
- package/build/lib/hooks/useTable/index.js +10 -1
- package/build/lib/index.d.ts +4 -0
- package/build/package.json +1 -1
- package/build/types/hooks/useTable/types.d.ts +4 -0
- package/package.json +1 -1
|
@@ -132,6 +132,9 @@ var useSearchParams = function (initialValue, options) {
|
|
|
132
132
|
*/
|
|
133
133
|
useBlocker(function (_a) {
|
|
134
134
|
var currentLocation = _a.currentLocation, nextLocation = _a.nextLocation, historyAction = _a.historyAction;
|
|
135
|
+
if (historyAction === 'POP') {
|
|
136
|
+
return false;
|
|
137
|
+
}
|
|
135
138
|
if (currentLocation.pathname !==
|
|
136
139
|
nextLocation.pathname) {
|
|
137
140
|
if (storage === 'url') {
|
|
@@ -295,6 +295,14 @@ function useTable(request, options) {
|
|
|
295
295
|
var currentPageSize = (_c = pagination.pageSize) !== null && _c !== void 0 ? _c : paginationRef.current.pageSize;
|
|
296
296
|
initList(currentPage, currentPageSize);
|
|
297
297
|
}, [initList, searchParams]);
|
|
298
|
+
var reset = function () {
|
|
299
|
+
setSelectedRows([]);
|
|
300
|
+
setTableData([]);
|
|
301
|
+
setPagination(__assign({ current: 1, pageSize: 10, total: 0 }, defaultPagination));
|
|
302
|
+
setLoading(false);
|
|
303
|
+
searchParams.pageNum = 1;
|
|
304
|
+
searchParams.pageSize = (defaultPagination === null || defaultPagination === void 0 ? void 0 : defaultPagination.pageSize) || 10;
|
|
305
|
+
};
|
|
298
306
|
// 初始化
|
|
299
307
|
useEffect(function () {
|
|
300
308
|
if (immediate) {
|
|
@@ -321,7 +329,8 @@ function useTable(request, options) {
|
|
|
321
329
|
pagination: pagination,
|
|
322
330
|
params: searchParams,
|
|
323
331
|
submit: search,
|
|
324
|
-
refresh: refresh
|
|
332
|
+
refresh: refresh,
|
|
333
|
+
reset: reset
|
|
325
334
|
},
|
|
326
335
|
rowSelection: {
|
|
327
336
|
selectedRows: selectedRows,
|
|
@@ -137,6 +137,9 @@ var useSearchParams = function (initialValue, options) {
|
|
|
137
137
|
*/
|
|
138
138
|
(0, react_router_dom_1.useBlocker)(function (_a) {
|
|
139
139
|
var currentLocation = _a.currentLocation, nextLocation = _a.nextLocation, historyAction = _a.historyAction;
|
|
140
|
+
if (historyAction === 'POP') {
|
|
141
|
+
return false;
|
|
142
|
+
}
|
|
140
143
|
if (currentLocation.pathname !==
|
|
141
144
|
nextLocation.pathname) {
|
|
142
145
|
if (storage === 'url') {
|
|
@@ -297,6 +297,14 @@ function useTable(request, options) {
|
|
|
297
297
|
var currentPageSize = (_c = pagination.pageSize) !== null && _c !== void 0 ? _c : paginationRef.current.pageSize;
|
|
298
298
|
initList(currentPage, currentPageSize);
|
|
299
299
|
}, [initList, searchParams]);
|
|
300
|
+
var reset = function () {
|
|
301
|
+
setSelectedRows([]);
|
|
302
|
+
setTableData([]);
|
|
303
|
+
setPagination(__assign({ current: 1, pageSize: 10, total: 0 }, defaultPagination));
|
|
304
|
+
setLoading(false);
|
|
305
|
+
searchParams.pageNum = 1;
|
|
306
|
+
searchParams.pageSize = (defaultPagination === null || defaultPagination === void 0 ? void 0 : defaultPagination.pageSize) || 10;
|
|
307
|
+
};
|
|
300
308
|
// 初始化
|
|
301
309
|
(0, react_1.useEffect)(function () {
|
|
302
310
|
if (immediate) {
|
|
@@ -323,7 +331,8 @@ function useTable(request, options) {
|
|
|
323
331
|
pagination: pagination,
|
|
324
332
|
params: searchParams,
|
|
325
333
|
submit: search,
|
|
326
|
-
refresh: refresh
|
|
334
|
+
refresh: refresh,
|
|
335
|
+
reset: reset
|
|
327
336
|
},
|
|
328
337
|
rowSelection: {
|
|
329
338
|
selectedRows: selectedRows,
|
package/build/lib/index.d.ts
CHANGED
package/build/package.json
CHANGED