@nccirtu/tablefy 0.6.3 → 0.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 +34 -0
- package/cli/templates/tablefy/data-table-empty.tsx +0 -1
- package/cli/templates/tablefy/data-table-header.tsx +0 -1
- package/cli/templates/tablefy/data-table-pagination.tsx +0 -1
- package/dist/columns/actions-column.d.ts +3 -3
- package/dist/columns/base-column.d.ts +2 -2
- package/dist/columns/checkbox-column.d.ts +1 -1
- package/dist/columns/columns/actions-column.d.ts +3 -3
- package/dist/columns/columns/base-column.d.ts +2 -2
- package/dist/columns/columns/checkbox-column.d.ts +1 -1
- package/dist/columns/columns/date-column.d.ts +5 -5
- package/dist/columns/columns/icon-column.d.ts +7 -7
- package/dist/columns/columns/image-column.d.ts +7 -7
- package/dist/columns/columns/link-column.d.ts +6 -6
- package/dist/columns/columns/number-column.d.ts +3 -3
- package/dist/columns/columns/progress-column.d.ts +7 -7
- package/dist/columns/columns/text-column.d.ts +3 -3
- package/dist/columns/columns/types.d.ts +5 -5
- package/dist/columns/date-column.d.ts +5 -5
- package/dist/columns/icon-column.d.ts +7 -7
- package/dist/columns/image-column.d.ts +7 -7
- package/dist/columns/index.esm.js +189 -167
- package/dist/columns/index.esm.js.map +1 -1
- package/dist/columns/index.js +189 -167
- package/dist/columns/index.js.map +1 -1
- package/dist/columns/link-column.d.ts +6 -6
- package/dist/columns/number-column.d.ts +3 -3
- package/dist/columns/progress-column.d.ts +7 -7
- package/dist/columns/text-column.d.ts +3 -3
- package/dist/columns/types.d.ts +5 -5
- package/dist/index.esm.js +189 -167
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +189 -167
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { ColumnDef } from
|
|
2
|
-
import { ReactNode } from
|
|
3
|
-
import { BaseColumn } from
|
|
4
|
-
import { BaseColumnConfig } from
|
|
1
|
+
import { ColumnDef } from "@tanstack/react-table";
|
|
2
|
+
import { ReactNode } from "react";
|
|
3
|
+
import { BaseColumn } from "./base-column";
|
|
4
|
+
import { BaseColumnConfig } from "./types";
|
|
5
5
|
interface LinkColumnConfig<TData> extends BaseColumnConfig<TData> {
|
|
6
6
|
href?: string | ((row: TData) => string);
|
|
7
7
|
external?: boolean;
|
|
8
8
|
icon?: ReactNode;
|
|
9
9
|
showExternalIcon?: boolean;
|
|
10
|
-
underline?:
|
|
10
|
+
underline?: "always" | "hover" | "never";
|
|
11
11
|
openInNewTab?: boolean;
|
|
12
12
|
onClick?: (row: TData) => void;
|
|
13
13
|
}
|
|
@@ -19,7 +19,7 @@ export declare class LinkColumn<TData> extends BaseColumn<TData, LinkColumnConfi
|
|
|
19
19
|
external(external?: boolean): this;
|
|
20
20
|
icon(icon: ReactNode): this;
|
|
21
21
|
showExternalIcon(show?: boolean): this;
|
|
22
|
-
underline(style:
|
|
22
|
+
underline(style: "always" | "hover" | "never"): this;
|
|
23
23
|
openInNewTab(open?: boolean): this;
|
|
24
24
|
onClick(handler: (row: TData) => void): this;
|
|
25
25
|
build(): ColumnDef<TData, unknown>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { ColumnDef } from
|
|
2
|
-
import { BaseColumn } from
|
|
3
|
-
import { BaseColumnConfig } from
|
|
1
|
+
import { ColumnDef } from "@tanstack/react-table";
|
|
2
|
+
import { BaseColumn } from "./base-column";
|
|
3
|
+
import { BaseColumnConfig } from "./types";
|
|
4
4
|
interface NumberColumnConfig<TData> extends BaseColumnConfig<TData> {
|
|
5
5
|
decimals?: number;
|
|
6
6
|
locale?: string;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { ColumnDef } from
|
|
2
|
-
import { BaseColumn } from
|
|
3
|
-
import { BaseColumnConfig } from
|
|
1
|
+
import { ColumnDef } from "@tanstack/react-table";
|
|
2
|
+
import { BaseColumn } from "./base-column";
|
|
3
|
+
import { BaseColumnConfig } from "./types";
|
|
4
4
|
interface ProgressColumnConfig<TData> extends BaseColumnConfig<TData> {
|
|
5
5
|
max?: number;
|
|
6
6
|
showValue?: boolean;
|
|
7
7
|
showPercentage?: boolean;
|
|
8
|
-
size?:
|
|
9
|
-
color?:
|
|
8
|
+
size?: "sm" | "md" | "lg";
|
|
9
|
+
color?: "default" | "success" | "warning" | "danger" | ((value: number, max: number) => string);
|
|
10
10
|
thresholds?: {
|
|
11
11
|
warning?: number;
|
|
12
12
|
danger?: number;
|
|
@@ -20,8 +20,8 @@ export declare class ProgressColumn<TData> extends BaseColumn<TData, ProgressCol
|
|
|
20
20
|
showValue(show?: boolean): this;
|
|
21
21
|
showPercentage(show?: boolean): this;
|
|
22
22
|
hideLabel(): this;
|
|
23
|
-
size(size:
|
|
24
|
-
color(color:
|
|
23
|
+
size(size: "sm" | "md" | "lg"): this;
|
|
24
|
+
color(color: "default" | "success" | "warning" | "danger"): this;
|
|
25
25
|
colorByThreshold(warning?: number, danger?: number): this;
|
|
26
26
|
colorByThresholdInverse(warning?: number, danger?: number): this;
|
|
27
27
|
format(fn: (value: number, max: number) => string): this;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { ColumnDef, Row } from
|
|
2
|
-
import { BaseColumn } from
|
|
3
|
-
import { FormattedColumnConfig } from
|
|
1
|
+
import { ColumnDef, Row } from "@tanstack/react-table";
|
|
2
|
+
import { BaseColumn } from "./base-column";
|
|
3
|
+
import { FormattedColumnConfig } from "./types";
|
|
4
4
|
export declare class TextColumn<TData> extends BaseColumn<TData, FormattedColumnConfig<TData>> {
|
|
5
5
|
static make<TData>(accessor: keyof TData | string): TextColumn<TData>;
|
|
6
6
|
formatter(fn: (value: unknown, row: Row<TData>) => React.ReactNode): this;
|
package/dist/columns/types.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { Row } from
|
|
2
|
-
import { ReactNode } from
|
|
1
|
+
import { Row } from "@tanstack/react-table";
|
|
2
|
+
import { ReactNode } from "react";
|
|
3
3
|
export interface BaseColumnConfig<TData> {
|
|
4
4
|
accessor: keyof TData | string;
|
|
5
5
|
label?: string;
|
|
6
6
|
sortable?: boolean;
|
|
7
7
|
searchable?: boolean;
|
|
8
8
|
hidden?: boolean;
|
|
9
|
-
align?:
|
|
9
|
+
align?: "left" | "center" | "right";
|
|
10
10
|
width?: string | number;
|
|
11
11
|
className?: string;
|
|
12
12
|
headerClassName?: string;
|
|
@@ -21,7 +21,7 @@ export interface FormattedColumnConfig<TData> extends BaseColumnConfig<TData> {
|
|
|
21
21
|
export interface BadgeColumnConfig<TData> extends BaseColumnConfig<TData> {
|
|
22
22
|
variants?: Record<string, {
|
|
23
23
|
label?: string;
|
|
24
|
-
variant?:
|
|
24
|
+
variant?: "default" | "secondary" | "destructive" | "outline" | "success" | "warning" | "info" | "muted";
|
|
25
25
|
className?: string;
|
|
26
26
|
icon?: ReactNode;
|
|
27
27
|
}>;
|
|
@@ -31,7 +31,7 @@ export interface ActionConfig<TData> {
|
|
|
31
31
|
icon?: ReactNode;
|
|
32
32
|
onClick?: (row: TData) => void;
|
|
33
33
|
href?: (row: TData) => string;
|
|
34
|
-
variant?:
|
|
34
|
+
variant?: "default" | "destructive" | "ghost";
|
|
35
35
|
hidden?: (row: TData) => boolean;
|
|
36
36
|
disabled?: (row: TData) => boolean;
|
|
37
37
|
}
|