@leancodepl/antd-table-hooks 10.1.3
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/CHANGELOG.md +19 -0
- package/LICENSE +201 -0
- package/README.md +470 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +722 -0
- package/dist/lib/filters/index.d.ts +37 -0
- package/dist/lib/filters/index.d.ts.map +1 -0
- package/dist/lib/filters/types.d.ts +37 -0
- package/dist/lib/filters/types.d.ts.map +1 -0
- package/dist/lib/filters/useFilters.d.ts +41 -0
- package/dist/lib/filters/useFilters.d.ts.map +1 -0
- package/dist/lib/index.d.ts +5 -0
- package/dist/lib/index.d.ts.map +1 -0
- package/dist/lib/pagination/index.d.ts +53 -0
- package/dist/lib/pagination/index.d.ts.map +1 -0
- package/dist/lib/sorting/index.d.ts +77 -0
- package/dist/lib/sorting/index.d.ts.map +1 -0
- package/dist/lib/table/index.d.ts +113 -0
- package/dist/lib/table/index.d.ts.map +1 -0
- package/dist/lib/types.d.ts +6 -0
- package/dist/lib/types.d.ts.map +1 -0
- package/package.json +64 -0
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { DefinedSearchSchema, FilterDefinition } from './types';
|
|
2
|
+
export * from './useFilters';
|
|
3
|
+
export * from './types';
|
|
4
|
+
/**
|
|
5
|
+
* Creates a typed filter definition factory along with a combined Zod search schema for URL param validation.
|
|
6
|
+
* Call with a query type generic, then pass an array of filter definitions (or a factory function for
|
|
7
|
+
* context-dependent filters). Returns `{ searchSchema, filters }` where `searchSchema` is used with
|
|
8
|
+
* `tableSearchSchema` for route validation.
|
|
9
|
+
*
|
|
10
|
+
* @returns A function that accepts filter definitions and returns `{ searchSchema, filters }`
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```typescript
|
|
14
|
+
* import { defineFilters, FilterDefinition } from "@leancodepl/antd-table-hooks";
|
|
15
|
+
*
|
|
16
|
+
* // Static filters
|
|
17
|
+
* const { searchSchema, filters } = defineFilters<SearchQuery>()([
|
|
18
|
+
* myTextFilter({ id: "email", tableId: "users", label: "Email", filter: (v, q) => ({ ...q, Email: v }) }),
|
|
19
|
+
* ]);
|
|
20
|
+
*
|
|
21
|
+
* // Context-dependent filters
|
|
22
|
+
* const { searchSchema, filters: filtersFn } = defineFilters<SearchQuery, { intl: IntlShape }>()(
|
|
23
|
+
* context => [
|
|
24
|
+
* myTextFilter({ id: "name", tableId: "users", label: "Name", placeholder: context?.intl.formatMessage({ defaultMessage: "Name" }) }),
|
|
25
|
+
* ],
|
|
26
|
+
* );
|
|
27
|
+
* ```
|
|
28
|
+
*/
|
|
29
|
+
export declare function defineFilters<TQuery>(): <TFilters extends FilterDefinition<TQuery, any, string>[]>(filters: TFilters) => {
|
|
30
|
+
searchSchema: DefinedSearchSchema<TFilters>;
|
|
31
|
+
filters: TFilters;
|
|
32
|
+
};
|
|
33
|
+
export declare function defineFilters<TQuery, TContext extends Record<string, unknown>>(): <TFilters extends FilterDefinition<TQuery, any, string>[]>(filters: (context?: TContext) => TFilters) => {
|
|
34
|
+
searchSchema: DefinedSearchSchema<TFilters>;
|
|
35
|
+
filters: (context?: TContext) => TFilters;
|
|
36
|
+
};
|
|
37
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lib/filters/index.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,gBAAgB,EAA4B,MAAM,SAAS,CAAA;AAEzF,cAAc,cAAc,CAAA;AAC5B,cAAc,SAAS,CAAA;AAEvB;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,aAAa,CAAC,MAAM,KAAK,CAAC,QAAQ,SAAS,gBAAgB,CAAC,MAAM,EAAE,GAAG,EAAE,MAAM,CAAC,EAAE,EAChG,OAAO,EAAE,QAAQ,KACd;IACH,YAAY,EAAE,mBAAmB,CAAC,QAAQ,CAAC,CAAA;IAC3C,OAAO,EAAE,QAAQ,CAAA;CAClB,CAAA;AACD,wBAAgB,aAAa,CAAC,MAAM,EAAE,QAAQ,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,CACjF,QAAQ,SAAS,gBAAgB,CAAC,MAAM,EAAE,GAAG,EAAE,MAAM,CAAC,EAAE,EAExD,OAAO,EAAE,CAAC,OAAO,CAAC,EAAE,QAAQ,KAAK,QAAQ,KACtC;IACH,YAAY,EAAE,mBAAmB,CAAC,QAAQ,CAAC,CAAA;IAC3C,OAAO,EAAE,CAAC,OAAO,CAAC,EAAE,QAAQ,KAAK,QAAQ,CAAA;CAC1C,CAAA"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { ComponentType } from 'react';
|
|
2
|
+
import { Observable } from 'rxjs';
|
|
3
|
+
import { z } from 'zod';
|
|
4
|
+
type FilterProps<TQuery, TSchema> = {
|
|
5
|
+
applyFilter(applyFilter: ((query: TQuery) => TQuery) | undefined, value?: unknown): void;
|
|
6
|
+
reset$: Observable<unknown>;
|
|
7
|
+
initialValue?: TSchema;
|
|
8
|
+
};
|
|
9
|
+
type SearchSchemaEntries = readonly (readonly [string, z.ZodType])[];
|
|
10
|
+
type InferSearchSchema<T extends SearchSchemaEntries> = {
|
|
11
|
+
[E in T[number] as E[0]]: z.infer<E[1]>;
|
|
12
|
+
};
|
|
13
|
+
export type FilterDefinition<TQuery, TValue = unknown, TId extends string = string, TSearchSchema extends SearchSchemaEntries = SearchSchemaEntries> = {
|
|
14
|
+
id: TId;
|
|
15
|
+
component: ComponentType<FilterProps<TQuery, TValue>>;
|
|
16
|
+
buildApplyFilter?: (value: TValue) => ((query: TQuery) => TQuery) | undefined;
|
|
17
|
+
} & ({
|
|
18
|
+
searchSchema: TSearchSchema;
|
|
19
|
+
toSearchParams: (value: TValue) => InferSearchSchema<TSearchSchema>;
|
|
20
|
+
fromSearchParams: (params: InferSearchSchema<TSearchSchema>) => TValue | undefined;
|
|
21
|
+
} | {
|
|
22
|
+
searchSchema?: undefined;
|
|
23
|
+
toSearchParams?: undefined;
|
|
24
|
+
fromSearchParams?: undefined;
|
|
25
|
+
});
|
|
26
|
+
type ExtractSearchEntries<F> = F extends {
|
|
27
|
+
searchSchema: infer SD extends SearchSchemaEntries;
|
|
28
|
+
} ? SD[number] : never;
|
|
29
|
+
export type FiltersSearchSchemaShape<TFilters extends FilterDefinition<any, any, string>[]> = {
|
|
30
|
+
[E in ExtractSearchEntries<TFilters[number]> as E[0]]: E[1];
|
|
31
|
+
};
|
|
32
|
+
export type InferFiltersSchema<TFilters extends FilterDefinition<any, any, string>[]> = {
|
|
33
|
+
[K in TFilters[number] as K extends FilterDefinition<any, any, infer Id extends string> ? Id : never]: K extends FilterDefinition<any, infer S, any> ? S : never;
|
|
34
|
+
};
|
|
35
|
+
export type DefinedSearchSchema<TFilters extends FilterDefinition<any, any, string>[]> = z.ZodObject<FiltersSearchSchemaShape<TFilters>>;
|
|
36
|
+
export {};
|
|
37
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/lib/filters/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAA;AACrC,OAAO,EAAE,UAAU,EAAE,MAAM,MAAM,CAAA;AACjC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,KAAK,WAAW,CAAC,MAAM,EAAE,OAAO,IAAI;IAClC,WAAW,CAAC,WAAW,EAAE,CAAC,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC,GAAG,SAAS,EAAE,KAAK,CAAC,EAAE,OAAO,GAAG,IAAI,CAAA;IACxF,MAAM,EAAE,UAAU,CAAC,OAAO,CAAC,CAAA;IAC3B,YAAY,CAAC,EAAE,OAAO,CAAA;CACvB,CAAA;AAED,KAAK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,gBAAgB,CAAC,GAAG,EAAE,GAAG,EAAE,MAAM,CAAC,EAAE,IAAI;KAC3F,CAAC,IAAI,oBAAoB,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAC5D,CAAA;AAED,MAAM,MAAM,kBAAkB,CAAC,QAAQ,SAAS,gBAAgB,CAAC,GAAG,EAAE,GAAG,EAAE,MAAM,CAAC,EAAE,IAAI;KACrF,CAAC,IAAI,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS,gBAAgB,CAAC,GAAG,EAAE,GAAG,EAAE,MAAM,EAAE,SAAS,MAAM,CAAC,GACnF,EAAE,GACF,KAAK,GAAG,CAAC,SAAS,gBAAgB,CAAC,GAAG,EAAE,MAAM,CAAC,EAAE,GAAG,CAAC,GAAG,CAAC,GAAG,KAAK;CACtE,CAAA;AAED,MAAM,MAAM,mBAAmB,CAAC,QAAQ,SAAS,gBAAgB,CAAC,GAAG,EAAE,GAAG,EAAE,MAAM,CAAC,EAAE,IAAI,CAAC,CAAC,SAAS,CAClG,wBAAwB,CAAC,QAAQ,CAAC,CACnC,CAAA"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { FilterDefinition } from './types';
|
|
3
|
+
export type UseFiltersProps<TQuery, TValues extends Record<string, unknown> = Record<string, unknown>> = {
|
|
4
|
+
filters: FilterDefinition<TQuery, any, string>[];
|
|
5
|
+
onFiltersChange?: (filters: Record<string, ((value: TQuery) => TQuery) | undefined>, values: TValues) => void;
|
|
6
|
+
initialValues?: Partial<TValues>;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Manages filter state and produces an `applyFilters` function that applies all active filters to a query object.
|
|
10
|
+
* Returns filter React components and helpers for resetting filters and checking if any filter is active.
|
|
11
|
+
*
|
|
12
|
+
* @param props.filters - Array of filter definitions (from `defineFilters`)
|
|
13
|
+
* @param props.onFiltersChange - Callback invoked when any filter value changes, receives all filter functions and current values
|
|
14
|
+
* @param props.initialValues - Initial filter values (e.g. restored from URL params via `useTable().filters.values`)
|
|
15
|
+
* @returns Object containing `applyFilters(query)`, `filterComponents` (React nodes), `resetFilters()`, and `anyFilterSet` boolean
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* ```typescript
|
|
19
|
+
* import { useFilters } from "@leancodepl/antd-table-hooks";
|
|
20
|
+
*
|
|
21
|
+
* const { applyFilters, filters } = useFilters({
|
|
22
|
+
* filters: userFilters,
|
|
23
|
+
* onFiltersChange: resetPage,
|
|
24
|
+
* });
|
|
25
|
+
*
|
|
26
|
+
* const query = applyFilters({ PageNumber: page, PageSize: pageSize });
|
|
27
|
+
* ```
|
|
28
|
+
*/
|
|
29
|
+
export declare function useFilters<TQuery, TValues extends Record<string, unknown> = Record<string, unknown>>({ filters, onFiltersChange, initialValues, }: UseFiltersProps<TQuery, TValues>): {
|
|
30
|
+
filterComponents: ReactNode[];
|
|
31
|
+
applyFilters: (query: TQuery) => TQuery;
|
|
32
|
+
resetFilters: () => void;
|
|
33
|
+
anyFilterSet: boolean;
|
|
34
|
+
filters: {
|
|
35
|
+
filterComponents: ReactNode[];
|
|
36
|
+
applyFilters: (query: TQuery) => TQuery;
|
|
37
|
+
resetFilters: () => void;
|
|
38
|
+
anyFilterSet: boolean;
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
//# sourceMappingURL=useFilters.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useFilters.d.ts","sourceRoot":"","sources":["../../../src/lib/filters/useFilters.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAA0C,MAAM,OAAO,CAAA;AAGzE,OAAO,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAA;AAE1C,MAAM,MAAM,eAAe,CAAC,MAAM,EAAE,OAAO,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,IAAI;IACvG,OAAO,EAAE,gBAAgB,CAAC,MAAM,EAAE,GAAG,EAAE,MAAM,CAAC,EAAE,CAAA;IAChD,eAAe,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC,GAAG,SAAS,CAAC,EAAE,MAAM,EAAE,OAAO,KAAK,IAAI,CAAA;IAC7G,aAAa,CAAC,EAAE,OAAO,CAAC,OAAO,CAAC,CAAA;CACjC,CAAA;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,UAAU,CAAC,MAAM,EAAE,OAAO,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,EACpG,OAAO,EACP,eAAe,EACf,aAAa,GACd,EAAE,eAAe,CAAC,MAAM,EAAE,OAAO,CAAC;;0BAcvB,MAAM;;;;;8BAAN,MAAM;;;;EAoCjB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/lib/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAA;AACzB,cAAc,WAAW,CAAA;AACzB,cAAc,cAAc,CAAA;AAC5B,cAAc,SAAS,CAAA"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { TablePaginationConfig } from 'antd/lib';
|
|
2
|
+
type UsePaginationProps = {
|
|
3
|
+
initialDisplayPage?: number;
|
|
4
|
+
initialPageSize?: number;
|
|
5
|
+
onPaginationChange?: (props: {
|
|
6
|
+
displayPage: number;
|
|
7
|
+
pageSize: number;
|
|
8
|
+
}) => void;
|
|
9
|
+
};
|
|
10
|
+
type QueryStatePagination = {
|
|
11
|
+
displayPage: number;
|
|
12
|
+
pageSize: number;
|
|
13
|
+
onPaginationChange: (props: {
|
|
14
|
+
displayPage: number;
|
|
15
|
+
pageSize: number;
|
|
16
|
+
}) => void;
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* Manages table pagination state with zero-indexed page output for API calls. Supports two modes:
|
|
20
|
+
* URL-driven (via `useTable().pagination`) or standalone with local state. Returns a
|
|
21
|
+
* `getTablePagination` helper that produces an Ant Design `TablePaginationConfig`.
|
|
22
|
+
*
|
|
23
|
+
* @param props - Either a `QueryStatePagination` object from `useTable().pagination`, or an optional object with `initialDisplayPage`, `initialPageSize`, and `onPaginationChange` callback
|
|
24
|
+
* @returns Object containing zero-indexed `page`, `pageSize`, `getTablePagination(total)` function, and `resetPage` function
|
|
25
|
+
*
|
|
26
|
+
* @example
|
|
27
|
+
* ```typescript
|
|
28
|
+
* import { usePagination } from "@leancodepl/antd-table-hooks";
|
|
29
|
+
*
|
|
30
|
+
* // With URL state (via useTable)
|
|
31
|
+
* const { page, pageSize, getTablePagination, resetPage } = usePagination(queryState.pagination);
|
|
32
|
+
*
|
|
33
|
+
* // Standalone
|
|
34
|
+
* const { page, pageSize, getTablePagination, resetPage } = usePagination();
|
|
35
|
+
*
|
|
36
|
+
* // Pass to Ant Design table
|
|
37
|
+
* <Table pagination={getTablePagination(data?.totalCount)} />
|
|
38
|
+
* ```
|
|
39
|
+
*/
|
|
40
|
+
export declare function usePagination(queryStatePagination: QueryStatePagination): {
|
|
41
|
+
page: number;
|
|
42
|
+
pageSize: number;
|
|
43
|
+
getTablePagination: (total?: number) => TablePaginationConfig;
|
|
44
|
+
resetPage: () => void;
|
|
45
|
+
};
|
|
46
|
+
export declare function usePagination(props?: UsePaginationProps): {
|
|
47
|
+
page: number;
|
|
48
|
+
pageSize: number;
|
|
49
|
+
getTablePagination: (total?: number) => TablePaginationConfig;
|
|
50
|
+
resetPage: () => void;
|
|
51
|
+
};
|
|
52
|
+
export {};
|
|
53
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lib/pagination/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAA;AAGhD,KAAK,kBAAkB,GAAG;IACxB,kBAAkB,CAAC,EAAE,MAAM,CAAA;IAC3B,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,kBAAkB,CAAC,EAAE,CAAC,KAAK,EAAE;QAAE,WAAW,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI,CAAA;CAChF,CAAA;AAED,KAAK,oBAAoB,GAAG;IAC1B,WAAW,EAAE,MAAM,CAAA;IACnB,QAAQ,EAAE,MAAM,CAAA;IAChB,kBAAkB,EAAE,CAAC,KAAK,EAAE;QAAE,WAAW,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI,CAAA;CAC/E,CAAA;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,aAAa,CAAC,oBAAoB,EAAE,oBAAoB,GAAG;IACzE,IAAI,EAAE,MAAM,CAAA;IACZ,QAAQ,EAAE,MAAM,CAAA;IAChB,kBAAkB,EAAE,CAAC,KAAK,CAAC,EAAE,MAAM,KAAK,qBAAqB,CAAA;IAC7D,SAAS,EAAE,MAAM,IAAI,CAAA;CACtB,CAAA;AACD,wBAAgB,aAAa,CAAC,KAAK,CAAC,EAAE,kBAAkB,GAAG;IACzD,IAAI,EAAE,MAAM,CAAA;IACZ,QAAQ,EAAE,MAAM,CAAA;IAChB,kBAAkB,EAAE,CAAC,KAAK,CAAC,EAAE,MAAM,KAAK,qBAAqB,CAAA;IAC7D,SAAS,EAAE,MAAM,IAAI,CAAA;CACtB,CAAA"}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { Key } from 'react';
|
|
2
|
+
import { SortOrder } from 'antd/es/table/interface';
|
|
3
|
+
import { SortData } from '../types';
|
|
4
|
+
type QueryStateSorting<TKey extends Key> = {
|
|
5
|
+
sortKey: TKey;
|
|
6
|
+
sortDirection: SortOrder;
|
|
7
|
+
onSortUpdate: (sortKey?: TKey, sortDirection?: SortOrder) => void;
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* Manages table column sorting state. Supports two modes: URL-driven (via `useTable().sorting`)
|
|
11
|
+
* or standalone with local state.
|
|
12
|
+
*
|
|
13
|
+
* @param props - Either a `QueryStateSorting` object from `useTable().sorting`, or an object with `defaultSortKey`, `defaultSortDirection`, and optional `onSortUpdate` callback
|
|
14
|
+
* @returns Object containing `sortData` (pass to Ant Design table's `sort` prop), current `sortKey`, `sortDirection`, and `isDescending` boolean
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* ```typescript
|
|
18
|
+
* import { useSorting } from "@leancodepl/antd-table-hooks";
|
|
19
|
+
*
|
|
20
|
+
* // With URL state (via useTable)
|
|
21
|
+
* const { sortData, sortKey, isDescending } = useSorting(queryState.sorting);
|
|
22
|
+
*
|
|
23
|
+
* // Standalone
|
|
24
|
+
* const { sortData, sortKey, isDescending } = useSorting({
|
|
25
|
+
* defaultSortKey: SortKey.Name,
|
|
26
|
+
* defaultSortDirection: "ascend",
|
|
27
|
+
* });
|
|
28
|
+
* ```
|
|
29
|
+
*/
|
|
30
|
+
export declare function useSorting<TKey extends Key, TData>(queryStateSorting: QueryStateSorting<TKey>): {
|
|
31
|
+
sortData: SortData<TData>;
|
|
32
|
+
sortKey: TKey;
|
|
33
|
+
sortDirection: SortOrder;
|
|
34
|
+
isDescending: boolean;
|
|
35
|
+
};
|
|
36
|
+
export declare function useSorting<TKey extends Key, TData>(props: {
|
|
37
|
+
defaultSortKey: TKey;
|
|
38
|
+
defaultSortDirection: SortOrder;
|
|
39
|
+
onSortUpdate?: (sortKey?: TKey, sortDirection?: SortOrder) => void;
|
|
40
|
+
}): {
|
|
41
|
+
sortData: SortData<TData>;
|
|
42
|
+
sortKey: TKey;
|
|
43
|
+
sortDirection: SortOrder;
|
|
44
|
+
isDescending: boolean;
|
|
45
|
+
};
|
|
46
|
+
export declare function useSorting<TKey extends Key, TData>(props: {
|
|
47
|
+
defaultSortKey: TKey;
|
|
48
|
+
defaultSortDirection?: SortOrder;
|
|
49
|
+
onSortUpdate?: (sortKey?: TKey, sortDirection?: SortOrder) => void;
|
|
50
|
+
}): {
|
|
51
|
+
sortData: SortData<TData>;
|
|
52
|
+
sortKey: TKey;
|
|
53
|
+
sortDirection?: SortOrder;
|
|
54
|
+
isDescending: boolean;
|
|
55
|
+
};
|
|
56
|
+
export declare function useSorting<TKey extends Key, TData>(props: {
|
|
57
|
+
defaultSortKey?: TKey;
|
|
58
|
+
defaultSortDirection: SortOrder;
|
|
59
|
+
onSortUpdate?: (sortKey?: TKey, sortDirection?: SortOrder) => void;
|
|
60
|
+
}): {
|
|
61
|
+
sortData: SortData<TData>;
|
|
62
|
+
sortKey?: TKey;
|
|
63
|
+
sortDirection: SortOrder;
|
|
64
|
+
isDescending: boolean;
|
|
65
|
+
};
|
|
66
|
+
export declare function useSorting<TKey extends Key, TData>(props: {
|
|
67
|
+
defaultSortKey?: TKey;
|
|
68
|
+
defaultSortDirection?: SortOrder;
|
|
69
|
+
onSortUpdate?: (sortKey?: TKey, sortDirection?: SortOrder) => void;
|
|
70
|
+
}): {
|
|
71
|
+
sortData: SortData<TData>;
|
|
72
|
+
sortKey?: TKey;
|
|
73
|
+
sortDirection?: SortOrder;
|
|
74
|
+
isDescending: boolean;
|
|
75
|
+
};
|
|
76
|
+
export {};
|
|
77
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lib/sorting/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAqB,MAAM,OAAO,CAAA;AAC9C,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AAEnD,OAAO,EAAE,QAAQ,EAAE,MAA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AAC,CAAC;IAAC,OAAO,EAAE,IAAI,CAAC;IAAC,aAAa,CAAC,EAAE,SAAS,CAAC;IAAC,YAAY,EAAE,OAAO,CAAA;CAAE,CAAA;AAClG,wBAAgB,UAAU,CAAC,IAAI,SAAS,GAAG,EAAE,KAAK,EAAE,KAAK,EAAE;IACzD,cAAc,CAAC,EAAE,IAAI,CAAA;IACrB,oBAAoB,EAAE,SAAS,CAAA;IAC/B,YAAY,CAAC,EAAE,CAAC,OAAO,CAAC,EAAE,IAAI,EAAE,aAAa,CAAC,EAAE,SAAS,KAAK,IAAI,CAAA;CACnE,GAAG;IAAE,QAAQ,EAAE,QAAQ,CAAC,KAAK,CAAC,CAAC;IAAC,OAAO,CAAC,EAAE,IAAI,CAAC;IAAC,aAAa,EAAE,SAAS,CAAC;IAAC,YAAY,EAAE,OAAO,CAAA;CAAE,CAAA;AAClG,wBAAgB,UAAU,CAAC,IAAI,SAAS,GAAG,EAAE,KAAK,EAAE,KAAK,EAAE;IACzD,cAAc,CAAC,EAAE,IAAI,CAAA;IACrB,oBAAoB,CAAC,EAAE,SAAS,CAAA;IAChC,YAAY,CAAC,EAAE,CAAC,OAAO,CAAC,EAAE,IAAI,EAAE,aAAa,CAAC,EAAE,SAAS,KAAK,IAAI,CAAA;CACnE,GAAG;IAAE,QAAQ,EAAE,QAAQ,CAAC,KAAK,CAAC,CAAC;IAAC,OAAO,CAAC,EAAE,IAAI,CAAC;IAAC,aAAa,CAAC,EAAE,SAAS,CAAC;IAAC,YAAY,EAAE,OAAO,CAAA;CAAE,CAAA"}
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import { Key } from 'react';
|
|
2
|
+
import { SortOrder } from 'antd/es/table/interface';
|
|
3
|
+
import { default as z } from 'zod';
|
|
4
|
+
import { DefinedSearchSchema, FilterDefinition, InferFiltersSchema } from '../filters/types';
|
|
5
|
+
type UseQueryStateProps<TQueryParams extends Record<string, unknown>, TDefined extends FilterDefinition<any, any, string>[], TSortKey extends Key> = {
|
|
6
|
+
queryParams: TQueryParams;
|
|
7
|
+
setQueryParams: (params: TQueryParams) => void;
|
|
8
|
+
definedFilters: TDefined;
|
|
9
|
+
tableId: string;
|
|
10
|
+
defaultSortKey: TSortKey;
|
|
11
|
+
defaultSortDirection: SortOrder;
|
|
12
|
+
defaultPageSize?: number;
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* Orchestrates table sorting, pagination, and filter state through URL query parameters.
|
|
16
|
+
* Reads current state from `queryParams` and writes updates via `setQueryParams`, enabling
|
|
17
|
+
* shareable links, browser navigation, and state restoration on page reload.
|
|
18
|
+
*
|
|
19
|
+
* @param props.queryParams - Current URL search params object (e.g. from TanStack Router's `useSearch`)
|
|
20
|
+
* @param props.setQueryParams - Callback to update URL search params (e.g. via `navigate({ search })`)
|
|
21
|
+
* @param props.definedFilters - Filter definitions created by `defineFilters`
|
|
22
|
+
* @param props.tableId - Unique prefix for URL params to avoid collisions between tables on the same route
|
|
23
|
+
* @param props.defaultSortKey - Initial sort column key
|
|
24
|
+
* @param props.defaultSortDirection - Initial sort direction (`"ascend"` or `"descend"`)
|
|
25
|
+
* @param props.defaultPageSize - Initial page size (defaults to 100)
|
|
26
|
+
* @returns Object with `filters`, `pagination`, and `sorting` state to pass to `useFilters`, `usePagination`, and `useSorting`
|
|
27
|
+
*
|
|
28
|
+
* @example
|
|
29
|
+
* ```typescript
|
|
30
|
+
* import { useTable, useSorting, usePagination, useFilters } from "@leancodepl/antd-table-hooks";
|
|
31
|
+
*
|
|
32
|
+
* const queryState = useTable({
|
|
33
|
+
* queryParams: search,
|
|
34
|
+
* setQueryParams: params => navigate({ search: params }),
|
|
35
|
+
* definedFilters: userFilters,
|
|
36
|
+
* tableId: "users",
|
|
37
|
+
* defaultSortKey: SortKey.CreatedAt,
|
|
38
|
+
* defaultSortDirection: "descend",
|
|
39
|
+
* });
|
|
40
|
+
*
|
|
41
|
+
* const { sortData, sortKey, isDescending } = useSorting(queryState.sorting);
|
|
42
|
+
* const { page, pageSize, getTablePagination, resetPage } = usePagination(queryState.pagination);
|
|
43
|
+
* ```
|
|
44
|
+
*/
|
|
45
|
+
export declare function useTable<TQueryParams extends Record<string, unknown>, TFilters extends FilterDefinition<any, any, string>[], TSortKey extends Key = Key>({ queryParams, setQueryParams, definedFilters, tableId, defaultSortKey, defaultSortDirection, defaultPageSize, }: UseQueryStateProps<TQueryParams, TFilters, TSortKey>): {
|
|
46
|
+
filters: {
|
|
47
|
+
values: Partial<InferFiltersSchema<TFilters>> | undefined;
|
|
48
|
+
onFiltersChange: (values?: Partial<InferFiltersSchema<TFilters>>) => void;
|
|
49
|
+
};
|
|
50
|
+
pagination: {
|
|
51
|
+
onPaginationChange: ({ displayPage, pageSize }: {
|
|
52
|
+
displayPage: number;
|
|
53
|
+
pageSize: number;
|
|
54
|
+
}) => void;
|
|
55
|
+
displayPage: number;
|
|
56
|
+
pageSize: number;
|
|
57
|
+
};
|
|
58
|
+
sorting: {
|
|
59
|
+
onSortUpdate: (sortKey?: TSortKey, sortDirection?: SortOrder) => void;
|
|
60
|
+
sortKey: TSortKey;
|
|
61
|
+
sortDirection: SortOrder;
|
|
62
|
+
};
|
|
63
|
+
};
|
|
64
|
+
/**
|
|
65
|
+
* Creates a Zod schema for pagination URL parameters (`{tableId}-displayPage`, `{tableId}-pageSize`).
|
|
66
|
+
*
|
|
67
|
+
* @param tableId - Unique table identifier used to prefix parameter names
|
|
68
|
+
* @returns Zod object schema for pagination params
|
|
69
|
+
*
|
|
70
|
+
* @example
|
|
71
|
+
* ```typescript
|
|
72
|
+
* import { buildPaginationSearchSchema } from "@leancodepl/antd-table-hooks";
|
|
73
|
+
*
|
|
74
|
+
* const paginationSchema = buildPaginationSearchSchema("users");
|
|
75
|
+
* ```
|
|
76
|
+
*/
|
|
77
|
+
export declare function buildPaginationSearchSchema<TTableId extends string>(tableId: TTableId): z.ZodObject<Record<`${TTableId}-displayPage` | `${TTableId}-pageSize`, z.ZodOptional<z.ZodCoercedNumber<unknown>>> extends infer T ? { -readonly [P in keyof T]: T[P]; } : never, z.core.$strip>;
|
|
78
|
+
/**
|
|
79
|
+
* Creates a Zod schema for sorting URL parameters (`{tableId}-sortKey`, `{tableId}-sortDescending`).
|
|
80
|
+
*
|
|
81
|
+
* @param tableId - Unique table identifier used to prefix parameter names
|
|
82
|
+
* @param sortKeySchema - Zod schema for the sort key type (e.g. `z.coerce.number()` for numeric enums)
|
|
83
|
+
* @returns Zod object schema for sorting params
|
|
84
|
+
*
|
|
85
|
+
* @example
|
|
86
|
+
* ```typescript
|
|
87
|
+
* import { buildSortingSearchSchema } from "@leancodepl/antd-table-hooks";
|
|
88
|
+
* import z from "zod";
|
|
89
|
+
*
|
|
90
|
+
* const sortingSchema = buildSortingSearchSchema("users", z.coerce.number());
|
|
91
|
+
* ```
|
|
92
|
+
*/
|
|
93
|
+
export declare function buildSortingSearchSchema<TTableId extends string, TSortKey extends z.ZodType>(tableId: TTableId, sortKeySchema: TSortKey): z.ZodObject<Record<`${TTableId}-sortDescending`, z.ZodOptional<z.ZodCoercedBoolean<unknown>>> & Record<`${TTableId}-sortKey`, z.ZodOptional<TSortKey>> extends infer T ? { -readonly [P in keyof T]: T[P]; } : never, z.core.$strip>;
|
|
94
|
+
/**
|
|
95
|
+
* Combines filter, pagination, and sorting schemas into a single Zod schema for route validation.
|
|
96
|
+
* Use the result as the `validateSearch` option in TanStack Router route definitions.
|
|
97
|
+
*
|
|
98
|
+
* @param filtersSearchSchema - Search schema returned by `defineFilters`
|
|
99
|
+
* @param tableId - Unique table identifier used to prefix parameter names
|
|
100
|
+
* @param sortKeySchema - Zod schema for the sort key type (e.g. `z.coerce.number()` for numeric enums)
|
|
101
|
+
* @returns Combined Zod object schema covering all table URL parameters
|
|
102
|
+
*
|
|
103
|
+
* @example
|
|
104
|
+
* ```typescript
|
|
105
|
+
* import { tableSearchSchema } from "@leancodepl/antd-table-hooks";
|
|
106
|
+
* import z from "zod";
|
|
107
|
+
*
|
|
108
|
+
* const searchSchema = tableSearchSchema(filtersSearchSchema, "users", z.coerce.number());
|
|
109
|
+
* ```
|
|
110
|
+
*/
|
|
111
|
+
export declare const tableSearchSchema: <TTableId extends string, TFilters extends FilterDefinition<any, any, string>[], TSortKey extends z.ZodType>(filtersSearchSchema: DefinedSearchSchema<TFilters>, tableId: TTableId, sortKeySchema: TSortKey) => z.ZodObject<import('..').FiltersSearchSchemaShape<TFilters> & (Record<`${TTableId}-displayPage` | `${TTableId}-pageSize`, z.ZodOptional<z.ZodCoercedNumber<unknown>>> extends infer T_1 ? { -readonly [P_1 in keyof T_1]: T_1[P_1]; } : never) & (Record<`${TTableId}-sortDescending`, z.ZodOptional<z.ZodCoercedBoolean<unknown>>> & Record<`${TTableId}-sortKey`, z.ZodOptional<TSortKey>> extends infer T_2 ? { -readonly [P_2 in keyof T_2]: T_2[P_2]; } : never) extends infer T ? { -readonly [P in keyof T]: T[P]; } : never, z.core.$strip>;
|
|
112
|
+
export {};
|
|
113
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lib/table/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAwB,MAAM,OAAO,CAAA;AACjD,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AACnD,OAAO,CAAC,MAAM,KAAK,CAAA;AACnB,OAAO,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAA;AAE5F,KAAK,kBAAkB,CACrB,YAAY,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC5C,QAAQ,SAAS,gBAAgB,CAAC,GAAG,EAAE,GAAG,EAAE,MAAM,CAAC,EAAE,EACrD,QAAQ,SAAS,GAAG,IAClB;IACF,WAAW,EAAE,YAAY,CAAA;IACzB,cAAc,EAAE,CAAC,MAAM,EAAE,YAAY,KAAK,IAAI,CAAA;IA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E1B,qBAAqB,mBAAmB,CAAC,QAAQ,CAAC,EAClD,SAAS,QAAQ,EACjB,eAAe,QAAQ,whBAMrB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/lib/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAA;AAEtD,MAAM,MAAM,QAAQ,CAAC,KAAK,IAAI;IAC5B,IAAI,CAAC,EAAE,YAAY,CAAC,KAAK,CAAC,CAAA;IAC1B,QAAQ,EAAE,CAAC,QAAQ,CAAC,EAAE,YAAY,CAAC,KAAK,CAAC,KAAK,IAAI,CAAA;CACnD,CAAA"}
|
package/package.json
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@leancodepl/antd-table-hooks",
|
|
3
|
+
"version": "10.1.3",
|
|
4
|
+
"license": "Apache-2.0",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./dist/index.js",
|
|
7
|
+
"module": "./dist/index.js",
|
|
8
|
+
"types": "./dist/index.d.ts",
|
|
9
|
+
"exports": {
|
|
10
|
+
"./package.json": "./package.json",
|
|
11
|
+
".": {
|
|
12
|
+
"types": "./dist/index.d.ts",
|
|
13
|
+
"import": "./dist/index.js",
|
|
14
|
+
"default": "./dist/index.js"
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
"dependencies": {
|
|
18
|
+
"@leancodepl/utils": "10.1.3",
|
|
19
|
+
"antd": "^5.0.0",
|
|
20
|
+
"rxjs": ">=7.0.0",
|
|
21
|
+
"zod": "^4.0.5"
|
|
22
|
+
},
|
|
23
|
+
"devDependencies": {
|
|
24
|
+
"@testing-library/react": "*",
|
|
25
|
+
"react": "*",
|
|
26
|
+
"vitest": "*"
|
|
27
|
+
},
|
|
28
|
+
"publishConfig": {
|
|
29
|
+
"access": "public",
|
|
30
|
+
"registry": "https://registry.npmjs.org/"
|
|
31
|
+
},
|
|
32
|
+
"engines": {
|
|
33
|
+
"node": ">=22.0.0"
|
|
34
|
+
},
|
|
35
|
+
"repository": {
|
|
36
|
+
"type": "git",
|
|
37
|
+
"url": "git+https://github.com/leancodepl/js_corelibrary.git",
|
|
38
|
+
"directory": "packages/antd-table-hooks"
|
|
39
|
+
},
|
|
40
|
+
"homepage": "https://github.com/leancodepl/js_corelibrary",
|
|
41
|
+
"bugs": {
|
|
42
|
+
"url": "https://github.com/leancodepl/js_corelibrary/issues"
|
|
43
|
+
},
|
|
44
|
+
"description": "Ant Design Table hooks for React",
|
|
45
|
+
"keywords": [
|
|
46
|
+
"antd",
|
|
47
|
+
"table",
|
|
48
|
+
"hooks",
|
|
49
|
+
"react",
|
|
50
|
+
"typescript",
|
|
51
|
+
"javascript",
|
|
52
|
+
"leancode"
|
|
53
|
+
],
|
|
54
|
+
"author": {
|
|
55
|
+
"name": "LeanCode",
|
|
56
|
+
"url": "https://leancode.co"
|
|
57
|
+
},
|
|
58
|
+
"sideEffects": false,
|
|
59
|
+
"files": [
|
|
60
|
+
"dist",
|
|
61
|
+
"CHANGELOG.md",
|
|
62
|
+
"!**/*.tsbuildinfo"
|
|
63
|
+
]
|
|
64
|
+
}
|