@papernote/ui 2.0.4 → 2.0.5
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/DataTable.d.ts +29 -11
- package/dist/components/DataTable.d.ts.map +1 -1
- package/dist/index.d.ts +27 -9
- package/dist/index.esm.js +408 -275
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +408 -275
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/DataTable.tsx +993 -647
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import React from
|
|
2
|
-
import { CardViewConfig } from
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { CardViewConfig } from "./DataTableCardView";
|
|
3
3
|
/**
|
|
4
4
|
* Base data item interface - all data items must have an id
|
|
5
5
|
*
|
|
@@ -33,14 +33,32 @@ export interface DataTableColumn<T> {
|
|
|
33
33
|
render?: (item: T, value: any) => React.ReactNode;
|
|
34
34
|
/** Secondary line content (smaller, muted text below primary) */
|
|
35
35
|
renderSecondary?: (item: T, value: any) => React.ReactNode;
|
|
36
|
+
/**
|
|
37
|
+
* Header text for the secondary line. Surfaced as the cell's native
|
|
38
|
+
* tooltip on hover so users can identify the field even though the
|
|
39
|
+
* column header above only labels the primary row.
|
|
40
|
+
*/
|
|
41
|
+
secondaryHeader?: string;
|
|
42
|
+
/**
|
|
43
|
+
* Custom tooltip resolver for the primary cell. Receives item + value;
|
|
44
|
+
* return a plain string. Falls back to `String(value)` when omitted so
|
|
45
|
+
* users hovering a truncated cell can still read the full value.
|
|
46
|
+
*/
|
|
47
|
+
tooltip?: (item: T, value: any) => string | undefined;
|
|
48
|
+
/**
|
|
49
|
+
* Custom tooltip resolver for the secondary cell. When omitted, the
|
|
50
|
+
* tooltip becomes `${secondaryHeader}: ${value}` so the otherwise-
|
|
51
|
+
* unlabeled second row stays self-describing.
|
|
52
|
+
*/
|
|
53
|
+
secondaryTooltip?: (item: T, value: any) => string | undefined;
|
|
36
54
|
/** Enable sorting for this column */
|
|
37
55
|
sortable?: boolean;
|
|
38
56
|
/** Additional CSS classes for column cells */
|
|
39
57
|
className?: string;
|
|
40
58
|
/** Horizontal text alignment in column */
|
|
41
|
-
align?:
|
|
59
|
+
align?: "left" | "center" | "right";
|
|
42
60
|
/** Vertical alignment of cell content - useful when rows have varying heights */
|
|
43
|
-
verticalAlign?:
|
|
61
|
+
verticalAlign?: "top" | "middle" | "bottom";
|
|
44
62
|
}
|
|
45
63
|
/**
|
|
46
64
|
* Sort configuration
|
|
@@ -51,7 +69,7 @@ export interface SortConfig {
|
|
|
51
69
|
/** Column key being sorted */
|
|
52
70
|
key: string;
|
|
53
71
|
/** Sort direction */
|
|
54
|
-
direction:
|
|
72
|
+
direction: "asc" | "desc";
|
|
55
73
|
/** Optional display label for sort indicator */
|
|
56
74
|
label?: string;
|
|
57
75
|
}
|
|
@@ -67,7 +85,7 @@ export interface DataTableAction<T> {
|
|
|
67
85
|
/** Click handler receives the row item */
|
|
68
86
|
onClick: (item: T) => void;
|
|
69
87
|
/** Button styling variant */
|
|
70
|
-
variant?:
|
|
88
|
+
variant?: "primary" | "secondary" | "ghost" | "danger";
|
|
71
89
|
/** Optional conditional visibility */
|
|
72
90
|
show?: (item: T) => boolean;
|
|
73
91
|
/** Optional tooltip text */
|
|
@@ -76,7 +94,7 @@ export interface DataTableAction<T> {
|
|
|
76
94
|
/**
|
|
77
95
|
* Expansion mode types
|
|
78
96
|
*/
|
|
79
|
-
export type ExpansionMode =
|
|
97
|
+
export type ExpansionMode = "edit" | "details" | string;
|
|
80
98
|
/**
|
|
81
99
|
* Configuration for different expansion modes
|
|
82
100
|
*/
|
|
@@ -169,11 +187,11 @@ interface DataTableProps<T extends BaseDataItem = BaseDataItem> {
|
|
|
169
187
|
/** Show the expand chevron column - hidden by default when using expandedRowConfig with double-click or menu */
|
|
170
188
|
showExpandChevron?: boolean;
|
|
171
189
|
/** Enable zebra striping - true for default, 'odd' or 'even' for specific rows */
|
|
172
|
-
striped?: boolean |
|
|
190
|
+
striped?: boolean | "odd" | "even";
|
|
173
191
|
/** Custom color for striped rows (Tailwind class like 'bg-primary-50' or 'bg-accent-50') */
|
|
174
192
|
stripedColor?: string;
|
|
175
193
|
/** Row density - affects padding and text size */
|
|
176
|
-
density?:
|
|
194
|
+
density?: "compact" | "normal" | "comfortable";
|
|
177
195
|
/** Custom class name for rows - static string or function returning class per row */
|
|
178
196
|
rowClassName?: string | ((item: T, index: number) => string);
|
|
179
197
|
/** Conditional row highlighting - returns color class (e.g., 'bg-warning-50') */
|
|
@@ -227,11 +245,11 @@ interface DataTableProps<T extends BaseDataItem = BaseDataItem> {
|
|
|
227
245
|
/** Show page size selector (default: true when paginated) */
|
|
228
246
|
showPageSizeSelector?: boolean;
|
|
229
247
|
/** Mobile view mode: 'auto' (detect viewport), 'card' (always cards), 'table' (always table) */
|
|
230
|
-
mobileView?:
|
|
248
|
+
mobileView?: "auto" | "card" | "table";
|
|
231
249
|
/** Configuration for card view layout */
|
|
232
250
|
cardConfig?: CardViewConfig<T>;
|
|
233
251
|
/** Gap between cards in card view */
|
|
234
|
-
cardGap?:
|
|
252
|
+
cardGap?: "sm" | "md" | "lg";
|
|
235
253
|
/** Custom class name for cards */
|
|
236
254
|
cardClassName?: string;
|
|
237
255
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DataTable.d.ts","sourceRoot":"","sources":["../../src/components/DataTable.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"DataTable.d.ts","sourceRoot":"","sources":["../../src/components/DataTable.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmD,MAAM,OAAO,CAAC;AAYxE,OAA0B,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAGxE;;;;;GAKG;AACH,MAAM,WAAW,YAAY;IAC3B,0CAA0C;IAC1C,EAAE,EAAE,MAAM,GAAG,MAAM,CAAC;CACrB;AAED;;;;;GAKG;AACH,MAAM,WAAW,eAAe,CAAC,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A2CG;AACH,MAAM,CAAC,OAAO,UAAU,SAAS,CAAC,CAAC,SAAS,YAAY,GAAG,YAAY,EAAE,EACvE,IAAI,EACJ,OAAO,EACP,OAAe,EACf,KAAY,EACZ,YAAkC,EAClC,WAAe,EACf,SAAc,EACd,YAAY,EACZ,WAAkB,EAClB,MAAM,EACN,QAAQ,EACR,OAAY,EACZ,iBAAwB,EACxB,UAAU,EACV,gBAAgB,EAChB,UAAkB,EAClB,YAAY,EAAE,oBAAoB,EAClC,WAAW,EACX,YAAY,EACZ,UAAkB,EAClB,YAAY,EAAE,oBAAoB,EAClC,iBAAiB,EACjB,iBAAiB,EACjB,iBAAyB,EAEzB,OAAe,EACf,YAAY,EACZ,OAAkB,EAClB,YAAY,EACZ,YAAY,EACZ,gBAAgB,EAChB,eAAoB,EACpB,iBAAwB,EACxB,QAAgB,EAChB,WAAgC,EAChC,YAAoB,EACpB,aAAkB,EAClB,eAAoB,EACpB,gBAAgB,EAAE,sBAAsB,EACxC,SAAiB,EACjB,cAAc,EACd,WAAmB,EACnB,eAAe,EACf,WAAmB,EACnB,aAAuB,EACvB,gBAAqB,EAErB,SAAiB,EACjB,WAAe,EACf,QAAa,EACb,UAAU,EACV,YAAY,EACZ,eAAmC,EACnC,gBAAgB,EAChB,oBAA2B,EAE3B,UAAmB,EACnB,UAAU,EACV,OAAc,EACd,aAAa,GACd,EAAE,cAAc,CAAC,CAAC,CAAC,2CAmnDnB"}
|
package/dist/index.d.ts
CHANGED
|
@@ -5958,14 +5958,32 @@ interface DataTableColumn<T> {
|
|
|
5958
5958
|
render?: (item: T, value: any) => React__default.ReactNode;
|
|
5959
5959
|
/** Secondary line content (smaller, muted text below primary) */
|
|
5960
5960
|
renderSecondary?: (item: T, value: any) => React__default.ReactNode;
|
|
5961
|
+
/**
|
|
5962
|
+
* Header text for the secondary line. Surfaced as the cell's native
|
|
5963
|
+
* tooltip on hover so users can identify the field even though the
|
|
5964
|
+
* column header above only labels the primary row.
|
|
5965
|
+
*/
|
|
5966
|
+
secondaryHeader?: string;
|
|
5967
|
+
/**
|
|
5968
|
+
* Custom tooltip resolver for the primary cell. Receives item + value;
|
|
5969
|
+
* return a plain string. Falls back to `String(value)` when omitted so
|
|
5970
|
+
* users hovering a truncated cell can still read the full value.
|
|
5971
|
+
*/
|
|
5972
|
+
tooltip?: (item: T, value: any) => string | undefined;
|
|
5973
|
+
/**
|
|
5974
|
+
* Custom tooltip resolver for the secondary cell. When omitted, the
|
|
5975
|
+
* tooltip becomes `${secondaryHeader}: ${value}` so the otherwise-
|
|
5976
|
+
* unlabeled second row stays self-describing.
|
|
5977
|
+
*/
|
|
5978
|
+
secondaryTooltip?: (item: T, value: any) => string | undefined;
|
|
5961
5979
|
/** Enable sorting for this column */
|
|
5962
5980
|
sortable?: boolean;
|
|
5963
5981
|
/** Additional CSS classes for column cells */
|
|
5964
5982
|
className?: string;
|
|
5965
5983
|
/** Horizontal text alignment in column */
|
|
5966
|
-
align?:
|
|
5984
|
+
align?: "left" | "center" | "right";
|
|
5967
5985
|
/** Vertical alignment of cell content - useful when rows have varying heights */
|
|
5968
|
-
verticalAlign?:
|
|
5986
|
+
verticalAlign?: "top" | "middle" | "bottom";
|
|
5969
5987
|
}
|
|
5970
5988
|
/**
|
|
5971
5989
|
* Sort configuration
|
|
@@ -5976,7 +5994,7 @@ interface SortConfig$1 {
|
|
|
5976
5994
|
/** Column key being sorted */
|
|
5977
5995
|
key: string;
|
|
5978
5996
|
/** Sort direction */
|
|
5979
|
-
direction:
|
|
5997
|
+
direction: "asc" | "desc";
|
|
5980
5998
|
/** Optional display label for sort indicator */
|
|
5981
5999
|
label?: string;
|
|
5982
6000
|
}
|
|
@@ -5992,7 +6010,7 @@ interface DataTableAction<T> {
|
|
|
5992
6010
|
/** Click handler receives the row item */
|
|
5993
6011
|
onClick: (item: T) => void;
|
|
5994
6012
|
/** Button styling variant */
|
|
5995
|
-
variant?:
|
|
6013
|
+
variant?: "primary" | "secondary" | "ghost" | "danger";
|
|
5996
6014
|
/** Optional conditional visibility */
|
|
5997
6015
|
show?: (item: T) => boolean;
|
|
5998
6016
|
/** Optional tooltip text */
|
|
@@ -6001,7 +6019,7 @@ interface DataTableAction<T> {
|
|
|
6001
6019
|
/**
|
|
6002
6020
|
* Expansion mode types
|
|
6003
6021
|
*/
|
|
6004
|
-
type ExpansionMode =
|
|
6022
|
+
type ExpansionMode = "edit" | "details" | string;
|
|
6005
6023
|
/**
|
|
6006
6024
|
* Configuration for different expansion modes
|
|
6007
6025
|
*/
|
|
@@ -6094,11 +6112,11 @@ interface DataTableProps<T extends BaseDataItem$1 = BaseDataItem$1> {
|
|
|
6094
6112
|
/** Show the expand chevron column - hidden by default when using expandedRowConfig with double-click or menu */
|
|
6095
6113
|
showExpandChevron?: boolean;
|
|
6096
6114
|
/** Enable zebra striping - true for default, 'odd' or 'even' for specific rows */
|
|
6097
|
-
striped?: boolean |
|
|
6115
|
+
striped?: boolean | "odd" | "even";
|
|
6098
6116
|
/** Custom color for striped rows (Tailwind class like 'bg-primary-50' or 'bg-accent-50') */
|
|
6099
6117
|
stripedColor?: string;
|
|
6100
6118
|
/** Row density - affects padding and text size */
|
|
6101
|
-
density?:
|
|
6119
|
+
density?: "compact" | "normal" | "comfortable";
|
|
6102
6120
|
/** Custom class name for rows - static string or function returning class per row */
|
|
6103
6121
|
rowClassName?: string | ((item: T, index: number) => string);
|
|
6104
6122
|
/** Conditional row highlighting - returns color class (e.g., 'bg-warning-50') */
|
|
@@ -6152,11 +6170,11 @@ interface DataTableProps<T extends BaseDataItem$1 = BaseDataItem$1> {
|
|
|
6152
6170
|
/** Show page size selector (default: true when paginated) */
|
|
6153
6171
|
showPageSizeSelector?: boolean;
|
|
6154
6172
|
/** Mobile view mode: 'auto' (detect viewport), 'card' (always cards), 'table' (always table) */
|
|
6155
|
-
mobileView?:
|
|
6173
|
+
mobileView?: "auto" | "card" | "table";
|
|
6156
6174
|
/** Configuration for card view layout */
|
|
6157
6175
|
cardConfig?: CardViewConfig<T>;
|
|
6158
6176
|
/** Gap between cards in card view */
|
|
6159
|
-
cardGap?:
|
|
6177
|
+
cardGap?: "sm" | "md" | "lg";
|
|
6160
6178
|
/** Custom class name for cards */
|
|
6161
6179
|
cardClassName?: string;
|
|
6162
6180
|
}
|