xmirror-components 1.0.34-alpha.1 → 1.0.35
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 +58 -37
- package/build/dist/index.mjs +6899 -3129
- package/build/es/hooks/useSearchParams/index.js +3 -0
- package/build/es/index.d.ts +1 -0
- package/build/es/index.js +1 -0
- package/build/lib/hooks/useSearchParams/index.js +3 -0
- package/build/lib/index.d.ts +21 -0
- package/build/lib/index.js +3 -1
- package/build/package.json +1 -1
- package/build/types/index.d.ts +1 -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') {
|
package/build/es/index.d.ts
CHANGED
|
@@ -9,3 +9,4 @@ export { default as Table } from './components/Table';
|
|
|
9
9
|
export { default as SearchArea } from './components/SearchArea';
|
|
10
10
|
export { default as useRequest } from './hooks/useRequest';
|
|
11
11
|
export { default as useTable } from './hooks/useTable';
|
|
12
|
+
export { default as useSearchParams } from './hooks/useSearchParams';
|
package/build/es/index.js
CHANGED
|
@@ -9,3 +9,4 @@ export { default as Table } from './components/Table';
|
|
|
9
9
|
export { default as SearchArea } from './components/SearchArea';
|
|
10
10
|
export { default as useRequest } from './hooks/useRequest';
|
|
11
11
|
export { default as useTable } from './hooks/useTable';
|
|
12
|
+
export { default as useSearchParams } from './hooks/useSearchParams';
|
|
@@ -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') {
|
package/build/lib/index.d.ts
CHANGED
|
@@ -372,6 +372,25 @@ declare interface SearchAreaHooks {
|
|
|
372
372
|
toggle: () => void;
|
|
373
373
|
}
|
|
374
374
|
|
|
375
|
+
/**
|
|
376
|
+
* 搜索参数接口
|
|
377
|
+
*/
|
|
378
|
+
declare interface SearchParams<T extends SearchParamsType> {
|
|
379
|
+
/**
|
|
380
|
+
* 当前搜索参数
|
|
381
|
+
*/
|
|
382
|
+
searchParams: T;
|
|
383
|
+
/**
|
|
384
|
+
* 设置搜索参数
|
|
385
|
+
*/
|
|
386
|
+
setSearchParams: (value: T | Partial<T> | ((prev: T) => T)) => void;
|
|
387
|
+
}
|
|
388
|
+
|
|
389
|
+
/**
|
|
390
|
+
* 搜索参数类型
|
|
391
|
+
*/
|
|
392
|
+
declare type SearchParamsType = Record<string, any>;
|
|
393
|
+
|
|
375
394
|
export declare let setGlobalLoading: (_value: boolean) => void;
|
|
376
395
|
|
|
377
396
|
/**
|
|
@@ -449,6 +468,8 @@ declare interface ToggleButtonProps {
|
|
|
449
468
|
|
|
450
469
|
export declare function useRequest<TData, TParams extends unknown[]>(service: Service<TData, TParams>, options?: Options<TData, TParams>, plugins?: Array<Plugin_2<TData, TParams>>): WrappedResult<TData, TParams>;
|
|
451
470
|
|
|
471
|
+
export declare const useSearchParams: <T extends SearchParamsType>(initialValue: T, options?: UseSearchParamsOptions) => SearchParams<T>;
|
|
472
|
+
|
|
452
473
|
declare interface UseSearchParamsOptions {
|
|
453
474
|
/**
|
|
454
475
|
* 存储方式:url 参数或路由 state
|
package/build/lib/index.js
CHANGED
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.useTable = exports.useRequest = exports.SearchArea = exports.Table = exports.ConfigContext = exports.ConfigProvider = exports.setGlobalLoading = exports.GlobalLoading = exports.IconButton = exports.SwitchValue = exports.CheckboxValue = exports.IconFont = exports.modal = exports.notification = exports.message = exports.App = void 0;
|
|
6
|
+
exports.useSearchParams = exports.useTable = exports.useRequest = exports.SearchArea = exports.Table = exports.ConfigContext = exports.ConfigProvider = exports.setGlobalLoading = exports.GlobalLoading = exports.IconButton = exports.SwitchValue = exports.CheckboxValue = exports.IconFont = exports.modal = exports.notification = exports.message = exports.App = void 0;
|
|
7
7
|
var AntdApp_1 = require("./components/AntdApp");
|
|
8
8
|
Object.defineProperty(exports, "App", { enumerable: true, get: function () { return __importDefault(AntdApp_1).default; } });
|
|
9
9
|
Object.defineProperty(exports, "message", { enumerable: true, get: function () { return AntdApp_1.message; } });
|
|
@@ -31,3 +31,5 @@ var useRequest_1 = require("./hooks/useRequest");
|
|
|
31
31
|
Object.defineProperty(exports, "useRequest", { enumerable: true, get: function () { return __importDefault(useRequest_1).default; } });
|
|
32
32
|
var useTable_1 = require("./hooks/useTable");
|
|
33
33
|
Object.defineProperty(exports, "useTable", { enumerable: true, get: function () { return __importDefault(useTable_1).default; } });
|
|
34
|
+
var useSearchParams_1 = require("./hooks/useSearchParams");
|
|
35
|
+
Object.defineProperty(exports, "useSearchParams", { enumerable: true, get: function () { return __importDefault(useSearchParams_1).default; } });
|
package/build/package.json
CHANGED
package/build/types/index.d.ts
CHANGED
|
@@ -9,3 +9,4 @@ export { default as Table } from './components/Table';
|
|
|
9
9
|
export { default as SearchArea } from './components/SearchArea';
|
|
10
10
|
export { default as useRequest } from './hooks/useRequest';
|
|
11
11
|
export { default as useTable } from './hooks/useTable';
|
|
12
|
+
export { default as useSearchParams } from './hooks/useSearchParams';
|