@snowpact/react-tanstack-query-table 1.3.0 → 1.4.0
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/README.md +183 -224
- package/dist/index.cjs +14 -17
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +8 -14
- package/dist/index.js +1999 -1981
- package/dist/index.js.map +1 -1
- package/dist/styles.css +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -3,7 +3,6 @@ import { ColumnDef } from '@tanstack/react-table';
|
|
|
3
3
|
import { ColumnMeta } from '@tanstack/react-table';
|
|
4
4
|
import { ComponentType } from 'react';
|
|
5
5
|
import { JSX } from 'react/jsx-runtime';
|
|
6
|
-
import { MouseEvent as MouseEvent_2 } from 'react';
|
|
7
6
|
import { OnChangeFn } from '@tanstack/react-table';
|
|
8
7
|
import { PaginationState } from '@tanstack/react-table';
|
|
9
8
|
import { ReactNode } from 'react';
|
|
@@ -17,7 +16,9 @@ import { VisibilityState } from '@tanstack/react-table';
|
|
|
17
16
|
*/
|
|
18
17
|
export declare type ActionButtonVariant = 'default' | 'warning' | 'danger' | 'info' | 'success';
|
|
19
18
|
|
|
20
|
-
export declare
|
|
19
|
+
export declare const ActionCell: typeof ActionCellInner;
|
|
20
|
+
|
|
21
|
+
declare function ActionCellInner<T, K>({ item, actions, onAction }: ActionCellProps<T, K>): JSX.Element;
|
|
21
22
|
|
|
22
23
|
declare interface ActionCellProps<T, K> {
|
|
23
24
|
item: T;
|
|
@@ -99,6 +100,8 @@ export declare interface ConfirmCloseHelper {
|
|
|
99
100
|
|
|
100
101
|
export declare type ConfirmContent = ReactNode | ((helpers: ConfirmCloseHelper) => ReactNode);
|
|
101
102
|
|
|
103
|
+
export declare type ConfirmFunction = (options: ConfirmOptions) => Promise<boolean>;
|
|
104
|
+
|
|
102
105
|
declare interface ConfirmOptions {
|
|
103
106
|
title: string;
|
|
104
107
|
subtitle?: string;
|
|
@@ -241,10 +244,7 @@ declare interface LinkProps {
|
|
|
241
244
|
className?: string;
|
|
242
245
|
target?: string;
|
|
243
246
|
rel?: string;
|
|
244
|
-
|
|
245
|
-
onClick?: (e: MouseEvent_2<HTMLAnchorElement>) => void;
|
|
246
|
-
onMouseEnter?: (e: MouseEvent_2<HTMLAnchorElement>) => void;
|
|
247
|
-
onMouseLeave?: () => void;
|
|
247
|
+
disabled?: boolean;
|
|
248
248
|
}
|
|
249
249
|
|
|
250
250
|
export declare function PageSizeSelector<Data extends object>({ table, paginationSizes, enableElementLabel, }: PageSizeSelectorProps<Data>): JSX.Element;
|
|
@@ -348,11 +348,9 @@ export declare interface ServerPaginatedResponse<T> {
|
|
|
348
348
|
export declare const setupSnowTable: (options: SetupSnowTableOptions) => void;
|
|
349
349
|
|
|
350
350
|
export declare interface SetupSnowTableOptions {
|
|
351
|
-
|
|
352
|
-
t: (key: string, options?: Record<string, unknown>) => string;
|
|
353
|
-
};
|
|
351
|
+
t: (key: string) => string;
|
|
354
352
|
LinkComponent: ComponentType<LinkProps>;
|
|
355
|
-
|
|
353
|
+
confirm: ConfirmFunction;
|
|
356
354
|
styles?: DeepPartial<SnowTableStyles>;
|
|
357
355
|
}
|
|
358
356
|
|
|
@@ -426,10 +424,6 @@ declare interface TabsStyles {
|
|
|
426
424
|
triggerActive: string;
|
|
427
425
|
}
|
|
428
426
|
|
|
429
|
-
declare interface UseConfirmReturn {
|
|
430
|
-
confirm: (options: ConfirmOptions) => Promise<boolean>;
|
|
431
|
-
}
|
|
432
|
-
|
|
433
427
|
/**
|
|
434
428
|
* Shared hook for building columns and handling actions in SnowClientDataTable and SnowServerDataTable.
|
|
435
429
|
*
|