@nccirtu/tablefy 0.1.7 → 0.2.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/dist/columns/lib/builders/empty-state.d.ts +19 -0
- package/dist/columns/lib/builders/table-schema.d.ts +71 -2
- package/dist/index.esm.js +215 -2
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +215 -2
- 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/package.json +1 -1
|
@@ -24,4 +24,23 @@ export declare class EmptyStateBuilder {
|
|
|
24
24
|
}): this;
|
|
25
25
|
noData(): this;
|
|
26
26
|
build(): EmptyStateConfig;
|
|
27
|
+
static noData(config: {
|
|
28
|
+
title: string;
|
|
29
|
+
description: string;
|
|
30
|
+
createLabel?: string;
|
|
31
|
+
createHref?: string;
|
|
32
|
+
createOnClick?: () => void;
|
|
33
|
+
}): EmptyStateConfig;
|
|
34
|
+
static noSearchResults(config: {
|
|
35
|
+
title: string;
|
|
36
|
+
description: string;
|
|
37
|
+
clearLabel?: string;
|
|
38
|
+
onClear?: () => void;
|
|
39
|
+
}): EmptyStateConfig;
|
|
40
|
+
static noFilterResults(config: {
|
|
41
|
+
title: string;
|
|
42
|
+
description: string;
|
|
43
|
+
resetLabel?: string;
|
|
44
|
+
onReset?: () => void;
|
|
45
|
+
}): EmptyStateConfig;
|
|
27
46
|
}
|
|
@@ -1,15 +1,84 @@
|
|
|
1
1
|
import { ColumnDef } from "@tanstack/react-table";
|
|
2
|
+
import { DataTableConfig } from "../types/table";
|
|
3
|
+
import { HeaderAction } from "../types/actions";
|
|
4
|
+
import { EmptyStateConfig } from "../types/empty-state";
|
|
5
|
+
import React from "react";
|
|
2
6
|
type ColumnBuilder<TData> = {
|
|
3
7
|
build(): ColumnDef<TData, unknown>;
|
|
4
8
|
};
|
|
9
|
+
/**
|
|
10
|
+
* Header Actions Builder
|
|
11
|
+
* Fluent API for building header actions
|
|
12
|
+
*/
|
|
13
|
+
declare class HeaderActionsBuilder<TData> {
|
|
14
|
+
private actions;
|
|
15
|
+
create(config: {
|
|
16
|
+
label: string;
|
|
17
|
+
href?: string;
|
|
18
|
+
onClick?: () => void;
|
|
19
|
+
icon?: React.ReactNode;
|
|
20
|
+
}): this;
|
|
21
|
+
export(config: {
|
|
22
|
+
label: string;
|
|
23
|
+
icon?: React.ReactNode;
|
|
24
|
+
formats?: Array<{
|
|
25
|
+
label: string;
|
|
26
|
+
onClick: () => void;
|
|
27
|
+
}>;
|
|
28
|
+
}): this;
|
|
29
|
+
import(config: {
|
|
30
|
+
label: string;
|
|
31
|
+
icon?: React.ReactNode;
|
|
32
|
+
onClick?: () => void;
|
|
33
|
+
}): this;
|
|
34
|
+
bulkExport(config: {
|
|
35
|
+
label: string;
|
|
36
|
+
icon?: React.ReactNode;
|
|
37
|
+
onExport: (rows: TData[]) => void;
|
|
38
|
+
}): this;
|
|
39
|
+
bulkDelete(config: {
|
|
40
|
+
label: string;
|
|
41
|
+
icon?: React.ReactNode;
|
|
42
|
+
onDelete: (rows: TData[]) => void;
|
|
43
|
+
}): this;
|
|
44
|
+
custom(action: HeaderAction<TData>): this;
|
|
45
|
+
build(): HeaderAction<TData>[];
|
|
46
|
+
}
|
|
5
47
|
/**
|
|
6
48
|
* Table Schema Builder
|
|
7
|
-
* Fluent API for building table
|
|
49
|
+
* Fluent API for building complete table configurations
|
|
8
50
|
*/
|
|
9
51
|
export declare class TableSchema<TData> {
|
|
10
52
|
private columnBuilders;
|
|
53
|
+
private config;
|
|
11
54
|
static make<TData>(): TableSchema<TData>;
|
|
55
|
+
description(text: string): this;
|
|
56
|
+
title(text: string): this;
|
|
57
|
+
headerActions(builder: (b: HeaderActionsBuilder<TData>) => HeaderActionsBuilder<TData>): this;
|
|
58
|
+
emptyState(config: EmptyStateConfig): this;
|
|
59
|
+
searchEmptyState(config: EmptyStateConfig): this;
|
|
60
|
+
filterEmptyState(config: EmptyStateConfig): this;
|
|
61
|
+
searchable(config?: {
|
|
62
|
+
placeholder?: string;
|
|
63
|
+
} | boolean): this;
|
|
64
|
+
paginated(config?: {
|
|
65
|
+
pageSize?: number;
|
|
66
|
+
pageSizeOptions?: number[];
|
|
67
|
+
} | boolean): this;
|
|
68
|
+
selectable(multiSelect?: boolean): this;
|
|
69
|
+
sortable(defaultSort?: {
|
|
70
|
+
id: string;
|
|
71
|
+
desc: boolean;
|
|
72
|
+
}): this;
|
|
73
|
+
columnVisibility(enabled?: boolean): this;
|
|
74
|
+
bordered(enabled?: boolean): this;
|
|
75
|
+
striped(enabled?: boolean): this;
|
|
76
|
+
hoverable(enabled?: boolean): this;
|
|
77
|
+
density(density: "compact" | "default" | "comfortable"): this;
|
|
12
78
|
columns(...builders: ColumnBuilder<TData>[]): this;
|
|
13
|
-
build():
|
|
79
|
+
build(): {
|
|
80
|
+
columns: ColumnDef<TData, unknown>[];
|
|
81
|
+
config: DataTableConfig<TData>;
|
|
82
|
+
};
|
|
14
83
|
}
|
|
15
84
|
export {};
|
package/package.json
CHANGED