@yusr_systems/ui 6.0.6 → 6.0.7
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/dist/index.d.ts +15 -1
- package/dist/yusr-ui.js +19 -16
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -419,7 +419,19 @@ export declare function createGenericEntitySlice<T extends BaseEntity, CR extend
|
|
|
419
419
|
isLoading: boolean;
|
|
420
420
|
currentPage: number;
|
|
421
421
|
rowsPerPage: number;
|
|
422
|
+
filterTypes?: number[] | undefined;
|
|
422
423
|
}, action: PayloadAction<number>) => void;
|
|
424
|
+
setFilterTypes: (state: {
|
|
425
|
+
entities: {
|
|
426
|
+
data: Draft<T>[] | undefined;
|
|
427
|
+
count: number;
|
|
428
|
+
};
|
|
429
|
+
isLoaded: boolean;
|
|
430
|
+
isLoading: boolean;
|
|
431
|
+
currentPage: number;
|
|
432
|
+
rowsPerPage: number;
|
|
433
|
+
filterTypes?: number[] | undefined;
|
|
434
|
+
}, action: PayloadAction<number[]>) => void;
|
|
423
435
|
refresh: (state: {
|
|
424
436
|
entities: {
|
|
425
437
|
data: Draft<T>[] | undefined;
|
|
@@ -429,6 +441,7 @@ export declare function createGenericEntitySlice<T extends BaseEntity, CR extend
|
|
|
429
441
|
isLoading: boolean;
|
|
430
442
|
currentPage: number;
|
|
431
443
|
rowsPerPage: number;
|
|
444
|
+
filterTypes?: number[] | undefined;
|
|
432
445
|
}, action: PayloadAction<{
|
|
433
446
|
data?: T;
|
|
434
447
|
deletedId?: number;
|
|
@@ -706,7 +719,7 @@ declare const fieldVariants: (props?: ({
|
|
|
706
719
|
orientation?: "horizontal" | "vertical" | "responsive" | null | undefined;
|
|
707
720
|
} & ClassProp) | undefined) => string;
|
|
708
721
|
|
|
709
|
-
declare type FilterMethodType<T> = (pageNumber: number, rowsPerPage: number, condition?: FilterCondition | undefined) => Promise<RequestResult<FilterResult<T>>> | undefined;
|
|
722
|
+
declare type FilterMethodType<T> = (pageNumber: number, rowsPerPage: number, condition?: FilterCondition | undefined, filterTypes?: number[]) => Promise<RequestResult<FilterResult<T>>> | undefined;
|
|
710
723
|
|
|
711
724
|
export declare function FormField({ label, error, isInvalid, children, required }: FormFieldProps): JSX.Element;
|
|
712
725
|
|
|
@@ -736,6 +749,7 @@ export declare interface IEntityState<T> {
|
|
|
736
749
|
isLoading: boolean;
|
|
737
750
|
currentPage: number;
|
|
738
751
|
rowsPerPage: number;
|
|
752
|
+
filterTypes?: number[];
|
|
739
753
|
}
|
|
740
754
|
|
|
741
755
|
export declare function Input({ className, type, ...props }: React_2.ComponentProps<"input">): JSX.Element;
|
package/dist/yusr-ui.js
CHANGED
|
@@ -5283,19 +5283,25 @@ var Dc = (e) => e;
|
|
|
5283
5283
|
//#endregion
|
|
5284
5284
|
//#region src/state/generics/genericEntitySlice.ts
|
|
5285
5285
|
function Oc(e, t, n, r) {
|
|
5286
|
-
let i =
|
|
5287
|
-
|
|
5288
|
-
|
|
5289
|
-
|
|
5290
|
-
data: [],
|
|
5291
|
-
count: 0
|
|
5292
|
-
},
|
|
5293
|
-
isLoaded: !1,
|
|
5294
|
-
isLoading: !1,
|
|
5295
|
-
currentPage: 1,
|
|
5296
|
-
rowsPerPage: 100
|
|
5286
|
+
let i = {
|
|
5287
|
+
entities: {
|
|
5288
|
+
data: [],
|
|
5289
|
+
count: 0
|
|
5297
5290
|
},
|
|
5291
|
+
isLoaded: !1,
|
|
5292
|
+
isLoading: !1,
|
|
5293
|
+
currentPage: 1,
|
|
5294
|
+
rowsPerPage: 100
|
|
5295
|
+
}, a = rt(`${e}/filter`, async (r, { getState: i }) => {
|
|
5296
|
+
let a = i()[e], o;
|
|
5297
|
+
return o = n ? await n(a.currentPage, a.rowsPerPage, r, a.filterTypes) : await t.Filter(a.currentPage, a.rowsPerPage, r), o?.data;
|
|
5298
|
+
}), o = it({
|
|
5299
|
+
name: e,
|
|
5300
|
+
initialState: i,
|
|
5298
5301
|
reducers: {
|
|
5302
|
+
setFilterTypes: (e, t) => {
|
|
5303
|
+
e.filterTypes = t.payload;
|
|
5304
|
+
},
|
|
5299
5305
|
setCurrentPage: (e, t) => {
|
|
5300
5306
|
e.currentPage = t.payload;
|
|
5301
5307
|
},
|
|
@@ -5318,14 +5324,11 @@ function Oc(e, t, n, r) {
|
|
|
5318
5324
|
e.isLoading = !1;
|
|
5319
5325
|
});
|
|
5320
5326
|
}
|
|
5321
|
-
}), a = rt(`${e}/filter`, async (r, { getState: i }) => {
|
|
5322
|
-
let a = i()[e], o;
|
|
5323
|
-
return o = n ? await n(a.currentPage, a.rowsPerPage, r) : await t.Filter(a.currentPage, a.rowsPerPage, r), o?.data;
|
|
5324
5327
|
});
|
|
5325
5328
|
return {
|
|
5326
|
-
reducer:
|
|
5329
|
+
reducer: o.reducer,
|
|
5327
5330
|
actions: {
|
|
5328
|
-
...
|
|
5331
|
+
...o.actions,
|
|
5329
5332
|
filter: a
|
|
5330
5333
|
}
|
|
5331
5334
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yusr_systems/ui",
|
|
3
|
-
"version": "6.0.
|
|
3
|
+
"version": "6.0.7",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public",
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"@radix-ui/react-toggle-group": "^1.1.11",
|
|
42
42
|
"@radix-ui/react-tooltip": "^1.2.8",
|
|
43
43
|
"@reduxjs/toolkit": "^2.0.0",
|
|
44
|
-
"@yusr_systems/core": "^6.0.
|
|
44
|
+
"@yusr_systems/core": "^6.0.7",
|
|
45
45
|
"class-variance-authority": "^0.7.1",
|
|
46
46
|
"clsx": "^2.1.1",
|
|
47
47
|
"cmdk": "^1.1.1",
|