@snowpact/react-tanstack-query-table 1.6.2 → 1.6.4
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 +14 -14
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +24 -11
- package/dist/index.js +2208 -2219
- package/dist/index.js.map +1 -1
- package/dist/styles.css +1 -1
- package/package.json +2 -4
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;
|
|
@@ -333,14 +329,12 @@ export declare type SnowColumnConfig<T extends object> = {
|
|
|
333
329
|
* Column metadata for customizing column appearance and behavior
|
|
334
330
|
*/
|
|
335
331
|
export declare type SnowColumnMeta = {
|
|
336
|
-
/** Column width (CSS value, e.g., '200px', '20%', 'auto') */
|
|
332
|
+
/** Column width (CSS value, e.g., '200px', '20%', 'auto') - only applied in desktop mode */
|
|
337
333
|
width?: string | number;
|
|
338
|
-
/** Column minimum width (CSS value) */
|
|
334
|
+
/** Column minimum width (CSS value) - only applied in desktop mode */
|
|
339
335
|
minWidth?: string | number;
|
|
340
|
-
/** Column maximum width (CSS value) */
|
|
336
|
+
/** Column maximum width (CSS value) - only applied in desktop mode */
|
|
341
337
|
maxWidth?: string | number;
|
|
342
|
-
/** Skip width/minWidth/maxWidth in responsive mode (mobile) */
|
|
343
|
-
skipWidthOnResponsive?: boolean;
|
|
344
338
|
/** Whether the column is hidden by default in column configuration */
|
|
345
339
|
defaultHidden?: boolean;
|
|
346
340
|
/** Disable row click handler for this column (e.g., for action columns) */
|
|
@@ -367,6 +361,19 @@ export declare interface SortButtonProps {
|
|
|
367
361
|
|
|
368
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>);
|
|
369
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
|
+
|
|
370
377
|
/**
|
|
371
378
|
* Shared hook for building columns and handling actions in SnowClientDataTable and SnowServerDataTable.
|
|
372
379
|
*
|
|
@@ -417,4 +424,10 @@ declare interface UseTableStatePersistOptions {
|
|
|
417
424
|
defaultSortOrder?: 'asc' | 'desc';
|
|
418
425
|
}
|
|
419
426
|
|
|
427
|
+
export declare function useTooltip(): {
|
|
428
|
+
state: TooltipState | null;
|
|
429
|
+
show: (label: string, element: HTMLElement) => void;
|
|
430
|
+
hide: () => void;
|
|
431
|
+
};
|
|
432
|
+
|
|
420
433
|
export { }
|