@snowpact/react-tanstack-query-table 1.6.3 → 1.7.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 +54 -35
- package/dist/index.cjs +6 -6
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +21 -6
- package/dist/index.js +1519 -1527
- package/dist/index.js.map +1 -1
- package/dist/styles.css +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -5,16 +5,12 @@ import { JSX } from 'react/jsx-runtime';
|
|
|
5
5
|
import { OnChangeFn } from '@tanstack/react-table';
|
|
6
6
|
import { PaginationState } from '@tanstack/react-table';
|
|
7
7
|
import { ReactNode } from 'react';
|
|
8
|
+
import { ReactPortal } from 'react';
|
|
8
9
|
import { SortingState } from '@tanstack/react-table';
|
|
9
10
|
import { SVGProps } from 'react';
|
|
10
11
|
import { Table } from '@tanstack/react-table';
|
|
11
12
|
import { VisibilityState } from '@tanstack/react-table';
|
|
12
13
|
|
|
13
|
-
/**
|
|
14
|
-
* Button variants supported by actions
|
|
15
|
-
*/
|
|
16
|
-
export declare type ActionButtonVariant = 'default' | 'warning' | 'danger' | 'info' | 'success';
|
|
17
|
-
|
|
18
14
|
export declare const ActionCell: typeof ActionCellInner;
|
|
19
15
|
|
|
20
16
|
declare function ActionCellInner<T, K>({ item, actions, onAction }: ActionCellProps<T, K>): JSX.Element;
|
|
@@ -28,7 +24,7 @@ declare interface ActionCellProps<T, K> {
|
|
|
28
24
|
export declare type BaseAction = {
|
|
29
25
|
icon: IconComponent;
|
|
30
26
|
label: string;
|
|
31
|
-
|
|
27
|
+
className?: string;
|
|
32
28
|
display?: 'button' | 'dropdown';
|
|
33
29
|
hidden?: boolean;
|
|
34
30
|
disabled?: boolean;
|
|
@@ -365,6 +361,19 @@ export declare interface SortButtonProps {
|
|
|
365
361
|
|
|
366
362
|
export declare type TableAction<T, K = unknown> = ClickAction<T> | LinkAction<T> | EndpointAction<T, K> | ((item: T) => ClickAction<T>) | ((item: T) => LinkAction<T>) | ((item: T) => EndpointAction<T, K>);
|
|
367
363
|
|
|
364
|
+
/** Tooltip component rendered via portal */
|
|
365
|
+
export declare function Tooltip({ label, x, y }: TooltipState): ReactPortal;
|
|
366
|
+
|
|
367
|
+
/**
|
|
368
|
+
* Custom hook for tooltip positioning and state management
|
|
369
|
+
* Handles edge detection to prevent tooltip overflow
|
|
370
|
+
*/
|
|
371
|
+
export declare interface TooltipState {
|
|
372
|
+
label: string;
|
|
373
|
+
x: number;
|
|
374
|
+
y: number;
|
|
375
|
+
}
|
|
376
|
+
|
|
368
377
|
/**
|
|
369
378
|
* Shared hook for building columns and handling actions in SnowClientDataTable and SnowServerDataTable.
|
|
370
379
|
*
|
|
@@ -415,4 +424,10 @@ declare interface UseTableStatePersistOptions {
|
|
|
415
424
|
defaultSortOrder?: 'asc' | 'desc';
|
|
416
425
|
}
|
|
417
426
|
|
|
427
|
+
export declare function useTooltip(): {
|
|
428
|
+
state: TooltipState | null;
|
|
429
|
+
show: (label: string, element: HTMLElement) => void;
|
|
430
|
+
hide: () => void;
|
|
431
|
+
};
|
|
432
|
+
|
|
418
433
|
export { }
|