@nccirtu/tablefy 0.1.7 → 0.5.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 +20 -4
- package/cli/templates/tablefy/avatar-list.tsx +51 -0
- package/cli/templates/tablefy/data-table-empty.tsx +77 -0
- package/cli/templates/tablefy/data-table-header.tsx +208 -0
- package/cli/templates/tablefy/data-table-pagination.tsx +137 -0
- package/cli/templates/tablefy/data-table-schema.tsx +13 -0
- package/cli/templates/tablefy/data-table.tsx +222 -0
- package/dist/cli/index.js +475 -0
- package/dist/columns/avatar-group-column.d.ts +1 -1
- package/dist/columns/columns/avatar-group-column.d.ts +1 -1
- package/dist/columns/index.d.ts +2 -2
- package/dist/columns/index.esm.js +153 -7921
- package/dist/columns/index.esm.js.map +1 -1
- package/dist/columns/index.js +214 -8000
- package/dist/columns/index.js.map +1 -1
- package/dist/columns/lib/builders/empty-state.d.ts +19 -0
- package/dist/columns/lib/builders/table-schema.d.ts +71 -2
- package/dist/columns/tablefy/avatar-list.d.ts +15 -0
- package/dist/columns/{components/ui/data-table → tablefy}/data-table-header.d.ts +1 -1
- package/dist/columns/{components/ui/data-table → tablefy}/data-table-pagination.d.ts +1 -1
- package/dist/columns/tablefy/data-table-schema.d.ts +1 -0
- package/dist/columns/tablefy/index.d.ts +6 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.esm.js +238 -7827
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +270 -7877
- package/dist/index.js.map +1 -1
- package/dist/lib/builders/empty-state.d.ts +19 -0
- package/dist/lib/builders/table-schema.d.ts +71 -2
- package/dist/tablefy/avatar-list.d.ts +15 -0
- package/dist/{components/ui/data-table → tablefy}/data-table-header.d.ts +1 -1
- package/dist/{components/ui/data-table → tablefy}/data-table-pagination.d.ts +1 -1
- package/dist/tablefy/data-table-schema.d.ts +1 -0
- package/dist/tablefy/index.d.ts +6 -0
- package/package.json +46 -13
- package/dist/columns/components/animata/list/avatar-list.d.ts +0 -12
- package/dist/columns/components/ui/badge.d.ts +0 -9
- package/dist/columns/components/ui/button.d.ts +0 -10
- package/dist/columns/components/ui/checkbox.d.ts +0 -4
- package/dist/columns/components/ui/data-table/data-table-schema.d.ts +0 -5
- package/dist/columns/components/ui/dropdown-menu.d.ts +0 -25
- package/dist/columns/components/ui/input.d.ts +0 -3
- package/dist/columns/components/ui/progress.d.ts +0 -4
- package/dist/columns/components/ui/select.d.ts +0 -15
- package/dist/columns/components/ui/table.d.ts +0 -10
- package/dist/columns/components/ui/tooltip.d.ts +0 -7
- package/dist/components/animata/list/avatar-list.d.ts +0 -12
- package/dist/components/ui/badge.d.ts +0 -9
- package/dist/components/ui/button.d.ts +0 -10
- package/dist/components/ui/checkbox.d.ts +0 -4
- package/dist/components/ui/data-table/data-table-schema.d.ts +0 -5
- package/dist/components/ui/dropdown-menu.d.ts +0 -25
- package/dist/components/ui/input.d.ts +0 -3
- package/dist/components/ui/progress.d.ts +0 -4
- package/dist/components/ui/select.d.ts +0 -15
- package/dist/components/ui/table.d.ts +0 -10
- package/dist/components/ui/tooltip.d.ts +0 -7
- package/dist/lib/table/schema/empty-state.d.ts +0 -23
- package/dist/lib/table/types.d.ts +0 -76
- package/dist/schema/data-table-schema.d.ts +0 -75
- package/dist/schema/empty-state.d.ts +0 -45
- package/dist/schema/table-schema.d.ts +0 -44
- package/dist/schema.d.ts +0 -11
- package/dist/src/columns/actions-column.d.ts +0 -26
- package/dist/src/columns/avatar-group-column.d.ts +0 -38
- package/dist/src/columns/badge-column.d.ts +0 -22
- package/dist/src/columns/base-column.d.ts +0 -19
- package/dist/src/columns/button-column.d.ts +0 -14
- package/dist/src/columns/checkbox-column.d.ts +0 -5
- package/dist/src/columns/date-column.d.ts +0 -24
- package/dist/src/columns/dropdown-column.d.ts +0 -17
- package/dist/src/columns/icon-column.d.ts +0 -58
- package/dist/src/columns/image-column.d.ts +0 -21
- package/dist/src/columns/index.d.ts +0 -13
- package/dist/src/columns/input-column.d.ts +0 -14
- package/dist/src/columns/link-column.d.ts +0 -27
- package/dist/src/columns/number-column.d.ts +0 -23
- package/dist/src/columns/progress-column.d.ts +0 -30
- package/dist/src/columns/select-column.d.ts +0 -19
- package/dist/src/columns/text-column.d.ts +0 -14
- package/dist/src/columns/types.d.ts +0 -37
- package/dist/src/components/animata/list/avatar-list.d.ts +0 -12
- package/dist/src/components/ui/badge.d.ts +0 -9
- package/dist/src/components/ui/button.d.ts +0 -10
- package/dist/src/components/ui/checkbox.d.ts +0 -4
- package/dist/src/components/ui/data-table/data-table-empty.d.ts +0 -8
- package/dist/src/components/ui/data-table/data-table-header.d.ts +0 -15
- package/dist/src/components/ui/data-table/data-table-pagination.d.ts +0 -9
- package/dist/src/components/ui/data-table/data-table-schema.d.ts +0 -5
- package/dist/src/components/ui/data-table/data-table.d.ts +0 -13
- package/dist/src/components/ui/dropdown-menu.d.ts +0 -25
- package/dist/src/components/ui/input.d.ts +0 -3
- package/dist/src/components/ui/progress.d.ts +0 -4
- package/dist/src/components/ui/select.d.ts +0 -15
- package/dist/src/components/ui/table.d.ts +0 -10
- package/dist/src/components/ui/tooltip.d.ts +0 -7
- package/dist/src/index.d.ts +0 -15
- package/dist/src/lib/table/schema/empty-state.d.ts +0 -23
- package/dist/src/lib/table/types.d.ts +0 -76
- package/dist/src/lib/utils.d.ts +0 -1
- package/dist/src/schema/data-table-schema.d.ts +0 -75
- package/dist/src/schema/empty-state.d.ts +0 -45
- package/dist/src/schema/table-schema.d.ts +0 -44
- package/dist/src/schema.d.ts +0 -11
- package/dist/src/types.d.ts +0 -76
- package/dist/types.d.ts +0 -76
- /package/dist/columns/{components/ui/data-table → tablefy}/data-table-empty.d.ts +0 -0
- /package/dist/columns/{components/ui/data-table → tablefy}/data-table.d.ts +0 -0
- /package/dist/{components/ui/data-table → tablefy}/data-table-empty.d.ts +0 -0
- /package/dist/{components/ui/data-table → tablefy}/data-table.d.ts +0 -0
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { EmptyStateConfig } from "@/lib/table/types";
|
|
2
|
-
interface DataTableEmptyProps {
|
|
3
|
-
config: EmptyStateConfig;
|
|
4
|
-
colSpan: number;
|
|
5
|
-
className?: string;
|
|
6
|
-
}
|
|
7
|
-
export declare function DataTableEmpty({ config, colSpan, className, }: DataTableEmptyProps): import("react/jsx-runtime").JSX.Element;
|
|
8
|
-
export {};
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { Table as TanstackTable } from "@tanstack/react-table";
|
|
2
|
-
import { HeaderAction, SearchConfig } from "@/lib/table/types";
|
|
3
|
-
interface DataTableHeaderProps<TData> {
|
|
4
|
-
title?: string;
|
|
5
|
-
description?: string;
|
|
6
|
-
actions?: HeaderAction<TData>[];
|
|
7
|
-
search?: SearchConfig;
|
|
8
|
-
searchValue?: string;
|
|
9
|
-
onSearchChange?: (value: string) => void;
|
|
10
|
-
table?: TanstackTable<TData>;
|
|
11
|
-
selectedCount?: number;
|
|
12
|
-
className?: string;
|
|
13
|
-
}
|
|
14
|
-
export declare function DataTableHeader<TData>({ title, description, actions, search, searchValue, onSearchChange, table, selectedCount, className, }: DataTableHeaderProps<TData>): import("react/jsx-runtime").JSX.Element | null;
|
|
15
|
-
export {};
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { Table as TanstackTable } from "@tanstack/react-table";
|
|
2
|
-
import { PaginationConfig } from "@/lib/table/types";
|
|
3
|
-
interface DataTablePaginationProps<TData> {
|
|
4
|
-
table: TanstackTable<TData>;
|
|
5
|
-
config?: PaginationConfig;
|
|
6
|
-
className?: string;
|
|
7
|
-
}
|
|
8
|
-
export declare function DataTablePagination<TData>({ table, config, className, }: DataTablePaginationProps<TData>): import("react/jsx-runtime").JSX.Element | null;
|
|
9
|
-
export {};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { ColumnDef } from "@tanstack/react-table";
|
|
2
|
-
import { DataTableConfig } from "@/lib/table/types";
|
|
3
|
-
interface DataTableProps<TData, TValue> {
|
|
4
|
-
columns: ColumnDef<TData, TValue>[];
|
|
5
|
-
data: TData[];
|
|
6
|
-
config?: DataTableConfig<TData>;
|
|
7
|
-
className?: string;
|
|
8
|
-
isLoading?: boolean;
|
|
9
|
-
isError?: boolean;
|
|
10
|
-
onRetry?: () => void;
|
|
11
|
-
}
|
|
12
|
-
export declare function DataTable<TData, TValue>({ columns, data, config, className, isLoading, isError, onRetry, }: DataTableProps<TData, TValue>): import("react/jsx-runtime").JSX.Element;
|
|
13
|
-
export {};
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import { DropdownMenu as DropdownMenuPrimitive } from "radix-ui";
|
|
3
|
-
declare function DropdownMenu({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
|
|
4
|
-
declare function DropdownMenuPortal({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Portal>): import("react/jsx-runtime").JSX.Element;
|
|
5
|
-
declare function DropdownMenuTrigger({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Trigger>): import("react/jsx-runtime").JSX.Element;
|
|
6
|
-
declare function DropdownMenuContent({ className, align, sideOffset, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Content>): import("react/jsx-runtime").JSX.Element;
|
|
7
|
-
declare function DropdownMenuGroup({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Group>): import("react/jsx-runtime").JSX.Element;
|
|
8
|
-
declare function DropdownMenuItem({ className, inset, variant, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Item> & {
|
|
9
|
-
inset?: boolean;
|
|
10
|
-
variant?: "default" | "destructive";
|
|
11
|
-
}): import("react/jsx-runtime").JSX.Element;
|
|
12
|
-
declare function DropdownMenuCheckboxItem({ className, children, checked, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.CheckboxItem>): import("react/jsx-runtime").JSX.Element;
|
|
13
|
-
declare function DropdownMenuRadioGroup({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.RadioGroup>): import("react/jsx-runtime").JSX.Element;
|
|
14
|
-
declare function DropdownMenuRadioItem({ className, children, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.RadioItem>): import("react/jsx-runtime").JSX.Element;
|
|
15
|
-
declare function DropdownMenuLabel({ className, inset, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Label> & {
|
|
16
|
-
inset?: boolean;
|
|
17
|
-
}): import("react/jsx-runtime").JSX.Element;
|
|
18
|
-
declare function DropdownMenuSeparator({ className, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Separator>): import("react/jsx-runtime").JSX.Element;
|
|
19
|
-
declare function DropdownMenuShortcut({ className, ...props }: React.ComponentProps<"span">): import("react/jsx-runtime").JSX.Element;
|
|
20
|
-
declare function DropdownMenuSub({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Sub>): import("react/jsx-runtime").JSX.Element;
|
|
21
|
-
declare function DropdownMenuSubTrigger({ className, inset, children, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.SubTrigger> & {
|
|
22
|
-
inset?: boolean;
|
|
23
|
-
}): import("react/jsx-runtime").JSX.Element;
|
|
24
|
-
declare function DropdownMenuSubContent({ className, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.SubContent>): import("react/jsx-runtime").JSX.Element;
|
|
25
|
-
export { DropdownMenu, DropdownMenuPortal, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuGroup, DropdownMenuLabel, DropdownMenuItem, DropdownMenuCheckboxItem, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubTrigger, DropdownMenuSubContent, };
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import { Select as SelectPrimitive } from "radix-ui";
|
|
3
|
-
declare function Select({ ...props }: React.ComponentProps<typeof SelectPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
|
|
4
|
-
declare function SelectGroup({ className, ...props }: React.ComponentProps<typeof SelectPrimitive.Group>): import("react/jsx-runtime").JSX.Element;
|
|
5
|
-
declare function SelectValue({ ...props }: React.ComponentProps<typeof SelectPrimitive.Value>): import("react/jsx-runtime").JSX.Element;
|
|
6
|
-
declare function SelectTrigger({ className, size, children, ...props }: React.ComponentProps<typeof SelectPrimitive.Trigger> & {
|
|
7
|
-
size?: "sm" | "default";
|
|
8
|
-
}): import("react/jsx-runtime").JSX.Element;
|
|
9
|
-
declare function SelectContent({ className, children, position, align, ...props }: React.ComponentProps<typeof SelectPrimitive.Content>): import("react/jsx-runtime").JSX.Element;
|
|
10
|
-
declare function SelectLabel({ className, ...props }: React.ComponentProps<typeof SelectPrimitive.Label>): import("react/jsx-runtime").JSX.Element;
|
|
11
|
-
declare function SelectItem({ className, children, ...props }: React.ComponentProps<typeof SelectPrimitive.Item>): import("react/jsx-runtime").JSX.Element;
|
|
12
|
-
declare function SelectSeparator({ className, ...props }: React.ComponentProps<typeof SelectPrimitive.Separator>): import("react/jsx-runtime").JSX.Element;
|
|
13
|
-
declare function SelectScrollUpButton({ className, ...props }: React.ComponentProps<typeof SelectPrimitive.ScrollUpButton>): import("react/jsx-runtime").JSX.Element;
|
|
14
|
-
declare function SelectScrollDownButton({ className, ...props }: React.ComponentProps<typeof SelectPrimitive.ScrollDownButton>): import("react/jsx-runtime").JSX.Element;
|
|
15
|
-
export { Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, };
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
declare function Table({ className, ...props }: React.ComponentProps<"table">): import("react/jsx-runtime").JSX.Element;
|
|
3
|
-
declare function TableHeader({ className, ...props }: React.ComponentProps<"thead">): import("react/jsx-runtime").JSX.Element;
|
|
4
|
-
declare function TableBody({ className, ...props }: React.ComponentProps<"tbody">): import("react/jsx-runtime").JSX.Element;
|
|
5
|
-
declare function TableFooter({ className, ...props }: React.ComponentProps<"tfoot">): import("react/jsx-runtime").JSX.Element;
|
|
6
|
-
declare function TableRow({ className, ...props }: React.ComponentProps<"tr">): import("react/jsx-runtime").JSX.Element;
|
|
7
|
-
declare function TableHead({ className, ...props }: React.ComponentProps<"th">): import("react/jsx-runtime").JSX.Element;
|
|
8
|
-
declare function TableCell({ className, ...props }: React.ComponentProps<"td">): import("react/jsx-runtime").JSX.Element;
|
|
9
|
-
declare function TableCaption({ className, ...props }: React.ComponentProps<"caption">): import("react/jsx-runtime").JSX.Element;
|
|
10
|
-
export { Table, TableHeader, TableBody, TableFooter, TableHead, TableRow, TableCell, TableCaption, };
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import { Tooltip as TooltipPrimitive } from "radix-ui";
|
|
3
|
-
declare function TooltipProvider({ delayDuration, ...props }: React.ComponentProps<typeof TooltipPrimitive.Provider>): import("react/jsx-runtime").JSX.Element;
|
|
4
|
-
declare function Tooltip({ ...props }: React.ComponentProps<typeof TooltipPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
|
|
5
|
-
declare function TooltipTrigger({ ...props }: React.ComponentProps<typeof TooltipPrimitive.Trigger>): import("react/jsx-runtime").JSX.Element;
|
|
6
|
-
declare function TooltipContent({ className, sideOffset, children, ...props }: React.ComponentProps<typeof TooltipPrimitive.Content>): import("react/jsx-runtime").JSX.Element;
|
|
7
|
-
export { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger };
|
package/dist/src/index.d.ts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
export { DataTable } from "./components/ui/data-table/data-table";
|
|
2
|
-
export { TableSchema } from "./schema";
|
|
3
|
-
export { DataTableSchema } from "./components/ui/data-table/data-table-schema";
|
|
4
|
-
export { EmptyStateBuilder } from "./lib/table/schema/empty-state";
|
|
5
|
-
export { AvatarGroupColumn as avatarGroupColumn } from "./columns/avatar-group-column";
|
|
6
|
-
export { BadgeColumn as badgeColumn } from "./columns/badge-column";
|
|
7
|
-
export { ButtonColumn as buttonColumn } from "./columns/button-column";
|
|
8
|
-
export { CheckboxColumn as checkboxColumn } from "./columns/checkbox-column";
|
|
9
|
-
export { DateColumn as dateColumn } from "./columns/date-column";
|
|
10
|
-
export { DropdownColumn as dropdownColumn } from "./columns/dropdown-column";
|
|
11
|
-
export { IconColumn as iconColumn } from "./columns/icon-column";
|
|
12
|
-
export { InputColumn as inputColumn } from "./columns/input-column";
|
|
13
|
-
export { ProgressColumn as progressColumn } from "./columns/progress-column";
|
|
14
|
-
export { SelectColumn as selectColumn } from "./columns/select-column";
|
|
15
|
-
export { TextColumn as textColumn } from "./columns/text-column";
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { EmptyStateConfig } from "../types";
|
|
2
|
-
import React from "react";
|
|
3
|
-
export declare class EmptyStateBuilder {
|
|
4
|
-
private config;
|
|
5
|
-
static make(): EmptyStateBuilder;
|
|
6
|
-
title(title: string): this;
|
|
7
|
-
description(description: string): this;
|
|
8
|
-
icon(icon: React.ReactNode): this;
|
|
9
|
-
imageUrl(imageUrl: string): this;
|
|
10
|
-
action(label: string, onClick?: () => void, href?: string, icon?: React.ReactNode): this;
|
|
11
|
-
variant(variant: "default" | "search" | "filter" | "error" | "custom"): this;
|
|
12
|
-
error(params?: {
|
|
13
|
-
onRetry?: () => void;
|
|
14
|
-
}): this;
|
|
15
|
-
noSearchResults(params?: {
|
|
16
|
-
onClear?: () => void;
|
|
17
|
-
}): this;
|
|
18
|
-
noFilterResults(params?: {
|
|
19
|
-
onReset?: () => void;
|
|
20
|
-
}): this;
|
|
21
|
-
noData(): this;
|
|
22
|
-
build(): EmptyStateConfig;
|
|
23
|
-
}
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
import { ReactNode } from "react";
|
|
2
|
-
export interface HeaderAction<TData = unknown> {
|
|
3
|
-
id: string;
|
|
4
|
-
label: string;
|
|
5
|
-
icon?: ReactNode;
|
|
6
|
-
variant?: "default" | "secondary" | "outline" | "ghost" | "destructive";
|
|
7
|
-
size?: "default" | "sm" | "lg" | "icon";
|
|
8
|
-
onClick?: () => void;
|
|
9
|
-
href?: string;
|
|
10
|
-
disabled?: boolean;
|
|
11
|
-
loading?: boolean;
|
|
12
|
-
bulk?: boolean;
|
|
13
|
-
bulkOnClick?: (selectedRows: TData[]) => void;
|
|
14
|
-
hidden?: boolean;
|
|
15
|
-
children?: Omit<HeaderAction<TData>, "children" | "bulk">[];
|
|
16
|
-
}
|
|
17
|
-
export interface EmptyStateConfig {
|
|
18
|
-
icon?: ReactNode;
|
|
19
|
-
imageUrl?: string;
|
|
20
|
-
title: string;
|
|
21
|
-
description?: string;
|
|
22
|
-
action?: {
|
|
23
|
-
label: string;
|
|
24
|
-
onClick?: () => void;
|
|
25
|
-
href?: string;
|
|
26
|
-
icon?: ReactNode;
|
|
27
|
-
};
|
|
28
|
-
variant?: "default" | "search" | "filter" | "error" | "custom";
|
|
29
|
-
}
|
|
30
|
-
export interface FilterConfig {
|
|
31
|
-
id: string;
|
|
32
|
-
label: string;
|
|
33
|
-
type: "text" | "select" | "multi-select" | "date" | "date-range" | "boolean";
|
|
34
|
-
column: string;
|
|
35
|
-
placeholder?: string;
|
|
36
|
-
options?: Array<{
|
|
37
|
-
label: string;
|
|
38
|
-
value: string;
|
|
39
|
-
}>;
|
|
40
|
-
}
|
|
41
|
-
export interface SearchConfig {
|
|
42
|
-
enabled: boolean;
|
|
43
|
-
placeholder?: string;
|
|
44
|
-
columns?: string[];
|
|
45
|
-
debounce?: number;
|
|
46
|
-
}
|
|
47
|
-
export interface PaginationConfig {
|
|
48
|
-
enabled: boolean;
|
|
49
|
-
pageSize?: number;
|
|
50
|
-
pageSizeOptions?: number[];
|
|
51
|
-
showPageInfo?: boolean;
|
|
52
|
-
showPageSizeSelector?: boolean;
|
|
53
|
-
}
|
|
54
|
-
export interface DataTableConfig<TData> {
|
|
55
|
-
title?: string;
|
|
56
|
-
description?: string;
|
|
57
|
-
headerActions?: HeaderAction<TData>[];
|
|
58
|
-
emptyState?: EmptyStateConfig;
|
|
59
|
-
searchEmptyState?: EmptyStateConfig;
|
|
60
|
-
filterEmptyState?: EmptyStateConfig;
|
|
61
|
-
search?: SearchConfig;
|
|
62
|
-
filters?: FilterConfig[];
|
|
63
|
-
pagination?: PaginationConfig;
|
|
64
|
-
enableRowSelection?: boolean;
|
|
65
|
-
enableMultiRowSelection?: boolean;
|
|
66
|
-
enableSorting?: boolean;
|
|
67
|
-
defaultSort?: {
|
|
68
|
-
id: string;
|
|
69
|
-
desc: boolean;
|
|
70
|
-
};
|
|
71
|
-
enableColumnVisibility?: boolean;
|
|
72
|
-
density?: "compact" | "default" | "comfortable";
|
|
73
|
-
bordered?: boolean;
|
|
74
|
-
striped?: boolean;
|
|
75
|
-
hoverable?: boolean;
|
|
76
|
-
}
|
package/dist/src/lib/utils.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function cn(...inputs: Array<string | boolean | undefined | null>): string;
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
import { ColumnDef } from '@tanstack/react-table';
|
|
2
|
-
import { ReactNode } from 'react';
|
|
3
|
-
import { DataTableConfig, EmptyStateConfig, HeaderAction } from '../types';
|
|
4
|
-
type ColumnBuilder<TData> = {
|
|
5
|
-
build(): ColumnDef<TData, unknown>;
|
|
6
|
-
};
|
|
7
|
-
export declare class DataTableSchema<TData> {
|
|
8
|
-
private config;
|
|
9
|
-
private columnBuilders;
|
|
10
|
-
static make<TData>(): DataTableSchema<TData>;
|
|
11
|
-
title(title: string): this;
|
|
12
|
-
description(description: string): this;
|
|
13
|
-
headerActions(builder: (b: HeaderActionsBuilder<TData>) => HeaderActionsBuilder<TData>): this;
|
|
14
|
-
emptyState(config: EmptyStateConfig): this;
|
|
15
|
-
searchEmptyState(config: EmptyStateConfig): this;
|
|
16
|
-
filterEmptyState(config: EmptyStateConfig): this;
|
|
17
|
-
searchable(config?: {
|
|
18
|
-
placeholder?: string;
|
|
19
|
-
columns?: string[];
|
|
20
|
-
debounce?: number;
|
|
21
|
-
}): this;
|
|
22
|
-
paginated(config?: {
|
|
23
|
-
pageSize?: number;
|
|
24
|
-
pageSizeOptions?: number[];
|
|
25
|
-
}): this;
|
|
26
|
-
selectable(multi?: boolean): this;
|
|
27
|
-
sortable(defaultSort?: {
|
|
28
|
-
id: string;
|
|
29
|
-
desc: boolean;
|
|
30
|
-
}): this;
|
|
31
|
-
bordered(bordered?: boolean): this;
|
|
32
|
-
striped(striped?: boolean): this;
|
|
33
|
-
hoverable(hoverable?: boolean): this;
|
|
34
|
-
density(density: 'compact' | 'default' | 'comfortable'): this;
|
|
35
|
-
columns(...builders: ColumnBuilder<TData>[]): this;
|
|
36
|
-
build(): {
|
|
37
|
-
columns: ColumnDef<TData, unknown>[];
|
|
38
|
-
config: DataTableConfig<TData>;
|
|
39
|
-
};
|
|
40
|
-
}
|
|
41
|
-
declare class HeaderActionsBuilder<TData> {
|
|
42
|
-
private actions;
|
|
43
|
-
create(config: {
|
|
44
|
-
label: string;
|
|
45
|
-
href?: string;
|
|
46
|
-
onClick?: () => void;
|
|
47
|
-
icon?: ReactNode;
|
|
48
|
-
}): this;
|
|
49
|
-
export(config: {
|
|
50
|
-
label: string;
|
|
51
|
-
icon?: ReactNode;
|
|
52
|
-
formats?: Array<{
|
|
53
|
-
label: string;
|
|
54
|
-
onClick: () => void;
|
|
55
|
-
}>;
|
|
56
|
-
}): this;
|
|
57
|
-
import(config: {
|
|
58
|
-
label: string;
|
|
59
|
-
icon?: ReactNode;
|
|
60
|
-
onClick?: () => void;
|
|
61
|
-
}): this;
|
|
62
|
-
bulkExport(config: {
|
|
63
|
-
label: string;
|
|
64
|
-
icon?: ReactNode;
|
|
65
|
-
onExport: (rows: TData[]) => void;
|
|
66
|
-
}): this;
|
|
67
|
-
bulkDelete(config: {
|
|
68
|
-
label: string;
|
|
69
|
-
icon?: ReactNode;
|
|
70
|
-
onDelete: (rows: TData[]) => void;
|
|
71
|
-
}): this;
|
|
72
|
-
action(config: HeaderAction<TData>): this;
|
|
73
|
-
build(): HeaderAction<TData>[];
|
|
74
|
-
}
|
|
75
|
-
export { HeaderActionsBuilder };
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
2
|
-
import { EmptyStateConfig } from '../types';
|
|
3
|
-
export declare class EmptyStateBuilder {
|
|
4
|
-
private config;
|
|
5
|
-
static make(): EmptyStateBuilder;
|
|
6
|
-
title(title: string): this;
|
|
7
|
-
description(description: string): this;
|
|
8
|
-
icon(icon: ReactNode): this;
|
|
9
|
-
imageUrl(imageUrl: string): this;
|
|
10
|
-
variant(variant: EmptyStateConfig['variant']): this;
|
|
11
|
-
action(config: {
|
|
12
|
-
label: string;
|
|
13
|
-
onClick?: () => void;
|
|
14
|
-
href?: string;
|
|
15
|
-
icon?: ReactNode;
|
|
16
|
-
}): this;
|
|
17
|
-
static noData(config?: {
|
|
18
|
-
title?: string;
|
|
19
|
-
description?: string;
|
|
20
|
-
createLabel?: string;
|
|
21
|
-
onCreate?: () => void;
|
|
22
|
-
createHref?: string;
|
|
23
|
-
}): EmptyStateBuilder;
|
|
24
|
-
static noSearchResults(config?: {
|
|
25
|
-
title?: string;
|
|
26
|
-
description?: string;
|
|
27
|
-
onClear?: () => void;
|
|
28
|
-
}): EmptyStateBuilder;
|
|
29
|
-
static noFilterResults(config?: {
|
|
30
|
-
title?: string;
|
|
31
|
-
description?: string;
|
|
32
|
-
onClear?: () => void;
|
|
33
|
-
}): EmptyStateBuilder;
|
|
34
|
-
static error(config?: {
|
|
35
|
-
title?: string;
|
|
36
|
-
description?: string;
|
|
37
|
-
onRetry?: () => void;
|
|
38
|
-
}): EmptyStateBuilder;
|
|
39
|
-
private createInboxIcon;
|
|
40
|
-
private createSearchIcon;
|
|
41
|
-
private createFilterIcon;
|
|
42
|
-
private createAlertIcon;
|
|
43
|
-
private createPlusIcon;
|
|
44
|
-
build(): EmptyStateConfig;
|
|
45
|
-
}
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
2
|
-
import { EmptyStateConfig } from '../types';
|
|
3
|
-
export declare class EmptyStateBuilder {
|
|
4
|
-
private config;
|
|
5
|
-
static make(): EmptyStateBuilder;
|
|
6
|
-
title(title: string): this;
|
|
7
|
-
description(description: string): this;
|
|
8
|
-
icon(icon: ReactNode): this;
|
|
9
|
-
variant(variant: EmptyStateConfig['variant']): this;
|
|
10
|
-
action(config: {
|
|
11
|
-
label: string;
|
|
12
|
-
onClick?: () => void;
|
|
13
|
-
href?: string;
|
|
14
|
-
icon?: ReactNode;
|
|
15
|
-
}): this;
|
|
16
|
-
static noData(config?: {
|
|
17
|
-
title?: string;
|
|
18
|
-
description?: string;
|
|
19
|
-
createLabel?: string;
|
|
20
|
-
onCreate?: () => void;
|
|
21
|
-
createHref?: string;
|
|
22
|
-
}): EmptyStateBuilder;
|
|
23
|
-
static noSearchResults(config?: {
|
|
24
|
-
title?: string;
|
|
25
|
-
description?: string;
|
|
26
|
-
onClear?: () => void;
|
|
27
|
-
}): EmptyStateBuilder;
|
|
28
|
-
static noFilterResults(config?: {
|
|
29
|
-
title?: string;
|
|
30
|
-
description?: string;
|
|
31
|
-
onClear?: () => void;
|
|
32
|
-
}): EmptyStateBuilder;
|
|
33
|
-
static error(config?: {
|
|
34
|
-
title?: string;
|
|
35
|
-
description?: string;
|
|
36
|
-
onRetry?: () => void;
|
|
37
|
-
}): EmptyStateBuilder;
|
|
38
|
-
private createInboxIcon;
|
|
39
|
-
private createSearchIcon;
|
|
40
|
-
private createFilterIcon;
|
|
41
|
-
private createAlertIcon;
|
|
42
|
-
private createPlusIcon;
|
|
43
|
-
build(): EmptyStateConfig;
|
|
44
|
-
}
|
package/dist/src/schema.d.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { ColumnDef } from '@tanstack/react-table';
|
|
2
|
-
type ColumnBuilder<TData> = {
|
|
3
|
-
build(): ColumnDef<TData, unknown>;
|
|
4
|
-
};
|
|
5
|
-
export declare class TableSchema<TData> {
|
|
6
|
-
private columnBuilders;
|
|
7
|
-
static make<TData>(): TableSchema<TData>;
|
|
8
|
-
columns(...builders: ColumnBuilder<TData>[]): this;
|
|
9
|
-
build(): ColumnDef<TData, unknown>[];
|
|
10
|
-
}
|
|
11
|
-
export {};
|
package/dist/src/types.d.ts
DELETED
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
import { ReactNode } from "react";
|
|
2
|
-
export interface HeaderAction<TData = unknown> {
|
|
3
|
-
id: string;
|
|
4
|
-
label: string;
|
|
5
|
-
icon?: ReactNode;
|
|
6
|
-
variant?: "default" | "secondary" | "outline" | "ghost" | "destructive";
|
|
7
|
-
size?: "default" | "sm" | "lg" | "icon";
|
|
8
|
-
onClick?: () => void;
|
|
9
|
-
href?: string;
|
|
10
|
-
disabled?: boolean;
|
|
11
|
-
loading?: boolean;
|
|
12
|
-
bulk?: boolean;
|
|
13
|
-
bulkOnClick?: (selectedRows: TData[]) => void;
|
|
14
|
-
hidden?: boolean;
|
|
15
|
-
children?: Omit<HeaderAction<TData>, "children" | "bulk">[];
|
|
16
|
-
}
|
|
17
|
-
export interface EmptyStateConfig {
|
|
18
|
-
icon?: ReactNode;
|
|
19
|
-
imageUrl?: string;
|
|
20
|
-
title: string;
|
|
21
|
-
description?: string;
|
|
22
|
-
action?: {
|
|
23
|
-
label: string;
|
|
24
|
-
onClick?: () => void;
|
|
25
|
-
href?: string;
|
|
26
|
-
icon?: ReactNode;
|
|
27
|
-
};
|
|
28
|
-
variant?: "default" | "search" | "filter" | "error" | "custom";
|
|
29
|
-
}
|
|
30
|
-
export interface FilterConfig {
|
|
31
|
-
id: string;
|
|
32
|
-
label: string;
|
|
33
|
-
type: "text" | "select" | "multi-select" | "date" | "date-range" | "boolean";
|
|
34
|
-
column: string;
|
|
35
|
-
placeholder?: string;
|
|
36
|
-
options?: Array<{
|
|
37
|
-
label: string;
|
|
38
|
-
value: string;
|
|
39
|
-
}>;
|
|
40
|
-
}
|
|
41
|
-
export interface SearchConfig {
|
|
42
|
-
enabled: boolean;
|
|
43
|
-
placeholder?: string;
|
|
44
|
-
columns?: string[];
|
|
45
|
-
debounce?: number;
|
|
46
|
-
}
|
|
47
|
-
export interface PaginationConfig {
|
|
48
|
-
enabled: boolean;
|
|
49
|
-
pageSize?: number;
|
|
50
|
-
pageSizeOptions?: number[];
|
|
51
|
-
showPageInfo?: boolean;
|
|
52
|
-
showPageSizeSelector?: boolean;
|
|
53
|
-
}
|
|
54
|
-
export interface DataTableConfig<TData> {
|
|
55
|
-
title?: string;
|
|
56
|
-
description?: string;
|
|
57
|
-
headerActions?: HeaderAction<TData>[];
|
|
58
|
-
emptyState?: EmptyStateConfig;
|
|
59
|
-
searchEmptyState?: EmptyStateConfig;
|
|
60
|
-
filterEmptyState?: EmptyStateConfig;
|
|
61
|
-
search?: SearchConfig;
|
|
62
|
-
filters?: FilterConfig[];
|
|
63
|
-
pagination?: PaginationConfig;
|
|
64
|
-
enableRowSelection?: boolean;
|
|
65
|
-
enableMultiRowSelection?: boolean;
|
|
66
|
-
enableSorting?: boolean;
|
|
67
|
-
defaultSort?: {
|
|
68
|
-
id: string;
|
|
69
|
-
desc: boolean;
|
|
70
|
-
};
|
|
71
|
-
enableColumnVisibility?: boolean;
|
|
72
|
-
density?: "compact" | "default" | "comfortable";
|
|
73
|
-
bordered?: boolean;
|
|
74
|
-
striped?: boolean;
|
|
75
|
-
hoverable?: boolean;
|
|
76
|
-
}
|
package/dist/types.d.ts
DELETED
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
import { ReactNode } from "react";
|
|
2
|
-
export interface HeaderAction<TData = unknown> {
|
|
3
|
-
id: string;
|
|
4
|
-
label: string;
|
|
5
|
-
icon?: ReactNode;
|
|
6
|
-
variant?: "default" | "secondary" | "outline" | "ghost" | "destructive";
|
|
7
|
-
size?: "default" | "sm" | "lg" | "icon";
|
|
8
|
-
onClick?: () => void;
|
|
9
|
-
href?: string;
|
|
10
|
-
disabled?: boolean;
|
|
11
|
-
loading?: boolean;
|
|
12
|
-
bulk?: boolean;
|
|
13
|
-
bulkOnClick?: (selectedRows: TData[]) => void;
|
|
14
|
-
hidden?: boolean;
|
|
15
|
-
children?: Omit<HeaderAction<TData>, "children" | "bulk">[];
|
|
16
|
-
}
|
|
17
|
-
export interface EmptyStateConfig {
|
|
18
|
-
icon?: ReactNode;
|
|
19
|
-
imageUrl?: string;
|
|
20
|
-
title: string;
|
|
21
|
-
description?: string;
|
|
22
|
-
action?: {
|
|
23
|
-
label: string;
|
|
24
|
-
onClick?: () => void;
|
|
25
|
-
href?: string;
|
|
26
|
-
icon?: ReactNode;
|
|
27
|
-
};
|
|
28
|
-
variant?: "default" | "search" | "filter" | "error" | "custom";
|
|
29
|
-
}
|
|
30
|
-
export interface FilterConfig {
|
|
31
|
-
id: string;
|
|
32
|
-
label: string;
|
|
33
|
-
type: "text" | "select" | "multi-select" | "date" | "date-range" | "boolean";
|
|
34
|
-
column: string;
|
|
35
|
-
placeholder?: string;
|
|
36
|
-
options?: Array<{
|
|
37
|
-
label: string;
|
|
38
|
-
value: string;
|
|
39
|
-
}>;
|
|
40
|
-
}
|
|
41
|
-
export interface SearchConfig {
|
|
42
|
-
enabled: boolean;
|
|
43
|
-
placeholder?: string;
|
|
44
|
-
columns?: string[];
|
|
45
|
-
debounce?: number;
|
|
46
|
-
}
|
|
47
|
-
export interface PaginationConfig {
|
|
48
|
-
enabled: boolean;
|
|
49
|
-
pageSize?: number;
|
|
50
|
-
pageSizeOptions?: number[];
|
|
51
|
-
showPageInfo?: boolean;
|
|
52
|
-
showPageSizeSelector?: boolean;
|
|
53
|
-
}
|
|
54
|
-
export interface DataTableConfig<TData> {
|
|
55
|
-
title?: string;
|
|
56
|
-
description?: string;
|
|
57
|
-
headerActions?: HeaderAction<TData>[];
|
|
58
|
-
emptyState?: EmptyStateConfig;
|
|
59
|
-
searchEmptyState?: EmptyStateConfig;
|
|
60
|
-
filterEmptyState?: EmptyStateConfig;
|
|
61
|
-
search?: SearchConfig;
|
|
62
|
-
filters?: FilterConfig[];
|
|
63
|
-
pagination?: PaginationConfig;
|
|
64
|
-
enableRowSelection?: boolean;
|
|
65
|
-
enableMultiRowSelection?: boolean;
|
|
66
|
-
enableSorting?: boolean;
|
|
67
|
-
defaultSort?: {
|
|
68
|
-
id: string;
|
|
69
|
-
desc: boolean;
|
|
70
|
-
};
|
|
71
|
-
enableColumnVisibility?: boolean;
|
|
72
|
-
density?: "compact" | "default" | "comfortable";
|
|
73
|
-
bordered?: boolean;
|
|
74
|
-
striped?: boolean;
|
|
75
|
-
hoverable?: boolean;
|
|
76
|
-
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|