@ztwoint/z-ui 0.1.106 → 0.1.108
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/dist/components/dynamic-table/index.d.ts +4 -0
- package/dist/components/dynamic-table/util/command.d.ts +18 -0
- package/dist/components/dynamic-table/util/seperator.d.ts +4 -0
- package/dist/components/dynamic-table/z2-column-header.d.ts +12 -0
- package/dist/components/dynamic-table/z2-column-header.js +186 -0
- package/dist/components/dynamic-table/z2-table-context.d.ts +87 -0
- package/dist/components/dynamic-table/z2-table-context.js +98 -0
- package/dist/components/dynamic-table/z2-table-filter.d.ts +15 -0
- package/dist/components/dynamic-table/z2-table-pagination.d.ts +19 -0
- package/dist/components/dynamic-table/z2-table-pagination.js +124 -0
- package/dist/components/dynamic-table/z2-table-visibility.d.ts +7 -0
- package/dist/components/dynamic-table/z2-table.d.ts +59 -0
- package/dist/components/dynamic-table/z2-table.js +408 -0
- package/dist/components/scroll-area/scoll-area.d.ts +5 -0
- package/dist/components/skeleton/skeleton.d.ts +2 -0
- package/dist/components/skeleton/skeleton.js +16 -0
- package/dist/components/table/components/cell/avatar-cell.js +4 -2
- package/dist/components/table/table-provider.js +2 -0
- package/dist/components/table-card/table-card.js +11 -9
- package/dist/css/styles/tailwind.css +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +207 -180
- package/dist/routes/data-table.d.ts +2 -0
- package/dist/types/components/dynamic-table/index.d.ts +4 -0
- package/dist/types/components/dynamic-table/util/command.d.ts +18 -0
- package/dist/types/components/dynamic-table/util/seperator.d.ts +4 -0
- package/dist/types/components/dynamic-table/z2-column-header.d.ts +12 -0
- package/dist/types/components/dynamic-table/z2-table-context.d.ts +87 -0
- package/dist/types/components/dynamic-table/z2-table-filter.d.ts +15 -0
- package/dist/types/components/dynamic-table/z2-table-pagination.d.ts +19 -0
- package/dist/types/components/dynamic-table/z2-table-visibility.d.ts +7 -0
- package/dist/types/components/dynamic-table/z2-table.d.ts +59 -0
- package/dist/types/components/scroll-area/scoll-area.d.ts +5 -0
- package/dist/types/components/skeleton/skeleton.d.ts +2 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/routes/data-table.d.ts +2 -0
- package/package.json +3 -1
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { ColumnFiltersState, RowData, SortingState, Table } from '@tanstack/react-table';
|
|
3
|
+
declare module '@tanstack/react-table' {
|
|
4
|
+
interface ColumnMeta<TData extends RowData, TValue> {
|
|
5
|
+
headerTitle?: string;
|
|
6
|
+
headerClassName?: string;
|
|
7
|
+
cellClassName?: string;
|
|
8
|
+
skeleton?: ReactNode;
|
|
9
|
+
expandedContent?: (row: TData) => ReactNode;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
export type Z2TableApiFetchParams = {
|
|
13
|
+
pageIndex: number;
|
|
14
|
+
pageSize: number;
|
|
15
|
+
sorting?: SortingState;
|
|
16
|
+
filters?: ColumnFiltersState;
|
|
17
|
+
searchQuery?: string;
|
|
18
|
+
};
|
|
19
|
+
export type Z2TableApiResponse<T> = {
|
|
20
|
+
data: T[];
|
|
21
|
+
empty: boolean;
|
|
22
|
+
pagination: {
|
|
23
|
+
total: number;
|
|
24
|
+
page: number;
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
export interface Z2TableContextProps<TData extends object> {
|
|
28
|
+
props: Z2TableProps<TData>;
|
|
29
|
+
table: Table<TData>;
|
|
30
|
+
recordCount: number;
|
|
31
|
+
isLoading: boolean;
|
|
32
|
+
}
|
|
33
|
+
export type Z2TableRequestParams = {
|
|
34
|
+
pageIndex: number;
|
|
35
|
+
pageSize: number;
|
|
36
|
+
sorting?: SortingState;
|
|
37
|
+
columnFilters?: ColumnFiltersState;
|
|
38
|
+
};
|
|
39
|
+
export interface Z2TableProps<TData extends object> {
|
|
40
|
+
className?: string;
|
|
41
|
+
table?: Table<TData>;
|
|
42
|
+
recordCount: number;
|
|
43
|
+
children?: ReactNode;
|
|
44
|
+
onRowClick?: (row: TData) => void;
|
|
45
|
+
isLoading?: boolean;
|
|
46
|
+
loadingMode?: 'skeleton' | 'spinner';
|
|
47
|
+
loadingMessage?: ReactNode | string;
|
|
48
|
+
emptyMessage?: ReactNode | string;
|
|
49
|
+
tableLayout?: {
|
|
50
|
+
dense?: boolean;
|
|
51
|
+
cellBorder?: boolean;
|
|
52
|
+
rowBorder?: boolean;
|
|
53
|
+
rowRounded?: boolean;
|
|
54
|
+
stripped?: boolean;
|
|
55
|
+
headerBackground?: boolean;
|
|
56
|
+
headerBorder?: boolean;
|
|
57
|
+
headerSticky?: boolean;
|
|
58
|
+
width?: 'auto' | 'fixed';
|
|
59
|
+
columnsVisibility?: boolean;
|
|
60
|
+
columnsResizable?: boolean;
|
|
61
|
+
columnsPinnable?: boolean;
|
|
62
|
+
columnsMovable?: boolean;
|
|
63
|
+
columnsDraggable?: boolean;
|
|
64
|
+
rowsDraggable?: boolean;
|
|
65
|
+
};
|
|
66
|
+
tableClassNames?: {
|
|
67
|
+
base?: string;
|
|
68
|
+
header?: string;
|
|
69
|
+
headerRow?: string;
|
|
70
|
+
headerSticky?: string;
|
|
71
|
+
body?: string;
|
|
72
|
+
bodyRow?: string;
|
|
73
|
+
footer?: string;
|
|
74
|
+
edgeCell?: string;
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
declare function useZ2Table(): Z2TableContextProps<any>;
|
|
78
|
+
declare function Z2TableProvider<TData extends object>({ children, table, ...props }: Z2TableProps<TData> & {
|
|
79
|
+
table: Table<TData>;
|
|
80
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
81
|
+
declare function Z2TableRoot<TData extends object>({ children, table, ...props }: Z2TableProps<TData>): import("react/jsx-runtime").JSX.Element;
|
|
82
|
+
declare function Z2TableContainer({ children, className, border, }: {
|
|
83
|
+
children: ReactNode;
|
|
84
|
+
className?: string;
|
|
85
|
+
border?: boolean;
|
|
86
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
87
|
+
export { useZ2Table, Z2TableProvider, Z2TableRoot, Z2TableContainer };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { Column } from '@tanstack/react-table';
|
|
3
|
+
interface Z2TableColumnFilterProps<TData, TValue> {
|
|
4
|
+
column?: Column<TData, TValue>;
|
|
5
|
+
title?: string;
|
|
6
|
+
options: {
|
|
7
|
+
label: string;
|
|
8
|
+
value: string;
|
|
9
|
+
icon?: React.ComponentType<{
|
|
10
|
+
className?: string;
|
|
11
|
+
}>;
|
|
12
|
+
}[];
|
|
13
|
+
}
|
|
14
|
+
declare function Z2TableColumnFilter<TData, TValue>({ column, title, options, }: Z2TableColumnFilterProps<TData, TValue>): import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
export { Z2TableColumnFilter, type Z2TableColumnFilterProps };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
interface Z2TablePaginationProps {
|
|
3
|
+
sizes?: number[];
|
|
4
|
+
sizesInfo?: string;
|
|
5
|
+
sizesLabel?: string;
|
|
6
|
+
sizesDescription?: string;
|
|
7
|
+
sizesSkeleton?: ReactNode;
|
|
8
|
+
more?: boolean;
|
|
9
|
+
moreLimit?: number;
|
|
10
|
+
info?: string;
|
|
11
|
+
infoSkeleton?: ReactNode;
|
|
12
|
+
className?: string;
|
|
13
|
+
rowsPerPageLabel?: string;
|
|
14
|
+
previousPageLabel?: string;
|
|
15
|
+
nextPageLabel?: string;
|
|
16
|
+
ellipsisText?: string;
|
|
17
|
+
}
|
|
18
|
+
declare function Z2TablePagination(props: Z2TablePaginationProps): import("react/jsx-runtime").JSX.Element;
|
|
19
|
+
export { Z2TablePagination, type Z2TablePaginationProps };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { Table } from '@tanstack/react-table';
|
|
3
|
+
declare function Z2TableColumnVisibility<TData>({ table, trigger, }: {
|
|
4
|
+
table: Table<TData>;
|
|
5
|
+
trigger: ReactNode;
|
|
6
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export { Z2TableColumnVisibility };
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { CSSProperties, ReactNode } from 'react';
|
|
3
|
+
import { Cell, Column, Header, HeaderGroup, Row } from '@tanstack/react-table';
|
|
4
|
+
declare function Z2TableBase({ children }: {
|
|
5
|
+
children: ReactNode;
|
|
6
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
declare function Z2TableHead({ children }: {
|
|
8
|
+
children: ReactNode;
|
|
9
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
declare function Z2TableHeadRow<TData>({ children, headerGroup, }: {
|
|
11
|
+
children: ReactNode;
|
|
12
|
+
headerGroup: HeaderGroup<TData>;
|
|
13
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
declare function Z2TableHeadRowCell<TData>({ children, header, dndRef, dndStyle, }: {
|
|
15
|
+
children: ReactNode;
|
|
16
|
+
header: Header<TData, unknown>;
|
|
17
|
+
dndRef?: React.Ref<HTMLTableCellElement>;
|
|
18
|
+
dndStyle?: CSSProperties;
|
|
19
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
20
|
+
declare function Z2TableHeadRowCellResize<TData>({ header }: {
|
|
21
|
+
header: Header<TData, unknown>;
|
|
22
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
23
|
+
declare function Z2TableRowSpacer(): import("react/jsx-runtime").JSX.Element;
|
|
24
|
+
declare function Z2TableBody({ children }: {
|
|
25
|
+
children: ReactNode;
|
|
26
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
27
|
+
declare function Z2TableBodyRowSkeleton({ children }: {
|
|
28
|
+
children: ReactNode;
|
|
29
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
30
|
+
declare function Z2TableBodyRowSkeletonCell<TData>({ children, column, }: {
|
|
31
|
+
children: ReactNode;
|
|
32
|
+
column: Column<TData>;
|
|
33
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
34
|
+
declare function Z2TableBodyRow<TData>({ children, row, dndRef, dndStyle, }: {
|
|
35
|
+
children: ReactNode;
|
|
36
|
+
row: Row<TData>;
|
|
37
|
+
dndRef?: React.Ref<HTMLTableRowElement>;
|
|
38
|
+
dndStyle?: CSSProperties;
|
|
39
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
40
|
+
declare function Z2TableBodyRowExpandded<TData>({ row }: {
|
|
41
|
+
row: Row<TData>;
|
|
42
|
+
}): import("react/jsx-runtime").JSX.Element | null;
|
|
43
|
+
declare function Z2TableBodyRowCell<TData>({ children, cell, dndRef, dndStyle, }: {
|
|
44
|
+
children: ReactNode;
|
|
45
|
+
cell: Cell<TData, unknown>;
|
|
46
|
+
dndRef?: React.Ref<HTMLTableCellElement>;
|
|
47
|
+
dndStyle?: CSSProperties;
|
|
48
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
49
|
+
declare function Z2TableEmpty(): import("react/jsx-runtime").JSX.Element;
|
|
50
|
+
declare function Z2TableLoader(): import("react/jsx-runtime").JSX.Element;
|
|
51
|
+
declare function Z2TableRowSelect<TData>({ row, }: {
|
|
52
|
+
row: Row<TData>;
|
|
53
|
+
size?: 'sm' | 'md' | 'lg';
|
|
54
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
55
|
+
declare function Z2TableRowSelectAll(_props: {
|
|
56
|
+
size?: 'sm' | 'md' | 'lg';
|
|
57
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
58
|
+
declare function Z2Table<TData>(): import("react/jsx-runtime").JSX.Element;
|
|
59
|
+
export { Z2Table, Z2TableBase, Z2TableBody, Z2TableBodyRow, Z2TableBodyRowCell, Z2TableBodyRowExpandded, Z2TableBodyRowSkeleton, Z2TableBodyRowSkeletonCell, Z2TableEmpty, Z2TableHead, Z2TableHeadRow, Z2TableHeadRowCell, Z2TableHeadRowCellResize, Z2TableLoader, Z2TableRowSelect, Z2TableRowSelectAll, Z2TableRowSpacer, };
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import * as ScrollAreaPrimitive from '@radix-ui/react-scroll-area';
|
|
3
|
+
declare function ScrollArea({ className, children, ...props }: React.ComponentProps<typeof ScrollAreaPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
declare function ScrollBar({ className, orientation, ...props }: React.ComponentProps<typeof ScrollAreaPrimitive.ScrollAreaScrollbar>): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
export { ScrollArea, ScrollBar };
|
package/dist/types/index.d.ts
CHANGED
|
@@ -27,5 +27,6 @@ export * from './components/radio/z2-radio';
|
|
|
27
27
|
export * from './components/assets/icons';
|
|
28
28
|
export * from './components/segmented-control';
|
|
29
29
|
export * from './components/popover/popover';
|
|
30
|
+
export * from './components/dynamic-table';
|
|
30
31
|
export * from './lib/theme.hook';
|
|
31
32
|
export * from './lib/utils';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ztwoint/z-ui",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.108",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.js",
|
|
@@ -96,11 +96,13 @@
|
|
|
96
96
|
"@radix-ui/react-slot": "^1.2.3",
|
|
97
97
|
"@radix-ui/react-tabs": "^1.1.12",
|
|
98
98
|
"@radix-ui/react-tooltip": "^1.2.7",
|
|
99
|
+
"@tanstack/react-table": "^8.21.3",
|
|
99
100
|
"class-variance-authority": "^0.7.1",
|
|
100
101
|
"classnames": "^2.5.1",
|
|
101
102
|
"clsx": "^2.1.1",
|
|
102
103
|
"cmdk": "^1.1.1",
|
|
103
104
|
"lucide-react": "^0.525.0",
|
|
105
|
+
"radix-ui": "^1.4.3",
|
|
104
106
|
"react-country-flag": "^3.1.0",
|
|
105
107
|
"react-router-dom": "^7.7.1",
|
|
106
108
|
"react-virtuoso": "^4.14.0",
|