@snowpact/react-tanstack-query-table 1.2.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 +194 -227
- package/dist/index.cjs +8 -8
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +8 -26
- package/dist/index.js +2055 -2014
- package/dist/index.js.map +1 -1
- package/dist/styles.css +1 -0
- package/package.json +6 -3
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;
|
|
@@ -30,17 +31,6 @@ declare interface ActionCellProps<T, K> {
|
|
|
30
31
|
*/
|
|
31
32
|
export declare type ActionConfirmContent = ReactNode | ((helpers: ConfirmCloseHelper) => ReactNode);
|
|
32
33
|
|
|
33
|
-
/**
|
|
34
|
-
* Action Hover Registry
|
|
35
|
-
*
|
|
36
|
-
* Allows consumers to provide custom tooltip behavior for action buttons.
|
|
37
|
-
* The consumer handles all tooltip UI - SnowTable just notifies on hover/unhover.
|
|
38
|
-
*/
|
|
39
|
-
export declare interface ActionHoverInfo {
|
|
40
|
-
label: string;
|
|
41
|
-
element: HTMLElement;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
34
|
export declare type BaseAction = {
|
|
45
35
|
icon: IconComponent;
|
|
46
36
|
label: string;
|
|
@@ -110,6 +100,8 @@ export declare interface ConfirmCloseHelper {
|
|
|
110
100
|
|
|
111
101
|
export declare type ConfirmContent = ReactNode | ((helpers: ConfirmCloseHelper) => ReactNode);
|
|
112
102
|
|
|
103
|
+
export declare type ConfirmFunction = (options: ConfirmOptions) => Promise<boolean>;
|
|
104
|
+
|
|
113
105
|
declare interface ConfirmOptions {
|
|
114
106
|
title: string;
|
|
115
107
|
subtitle?: string;
|
|
@@ -252,9 +244,7 @@ declare interface LinkProps {
|
|
|
252
244
|
className?: string;
|
|
253
245
|
target?: string;
|
|
254
246
|
rel?: string;
|
|
255
|
-
|
|
256
|
-
onMouseEnter?: (e: MouseEvent_2<HTMLAnchorElement>) => void;
|
|
257
|
-
onMouseLeave?: () => void;
|
|
247
|
+
disabled?: boolean;
|
|
258
248
|
}
|
|
259
249
|
|
|
260
250
|
export declare function PageSizeSelector<Data extends object>({ table, paginationSizes, enableElementLabel, }: PageSizeSelectorProps<Data>): JSX.Element;
|
|
@@ -358,14 +348,10 @@ export declare interface ServerPaginatedResponse<T> {
|
|
|
358
348
|
export declare const setupSnowTable: (options: SetupSnowTableOptions) => void;
|
|
359
349
|
|
|
360
350
|
export declare interface SetupSnowTableOptions {
|
|
361
|
-
|
|
362
|
-
t: (key: string, options?: Record<string, unknown>) => string;
|
|
363
|
-
};
|
|
351
|
+
t: (key: string) => string;
|
|
364
352
|
LinkComponent: ComponentType<LinkProps>;
|
|
365
|
-
|
|
353
|
+
confirm: ConfirmFunction;
|
|
366
354
|
styles?: DeepPartial<SnowTableStyles>;
|
|
367
|
-
onActionHover?: (info: ActionHoverInfo) => void;
|
|
368
|
-
onActionUnhover?: () => void;
|
|
369
355
|
}
|
|
370
356
|
|
|
371
357
|
export declare function SingleFilterDropdown<T extends object>({ filter, selectedValues, onFilterChange, }: SingleFilterDropdownProps<T>): JSX.Element | null;
|
|
@@ -438,10 +424,6 @@ declare interface TabsStyles {
|
|
|
438
424
|
triggerActive: string;
|
|
439
425
|
}
|
|
440
426
|
|
|
441
|
-
declare interface UseConfirmReturn {
|
|
442
|
-
confirm: (options: ConfirmOptions) => Promise<boolean>;
|
|
443
|
-
}
|
|
444
|
-
|
|
445
427
|
/**
|
|
446
428
|
* Shared hook for building columns and handling actions in SnowClientDataTable and SnowServerDataTable.
|
|
447
429
|
*
|