@nexgrid/react 0.2.0 → 0.2.1
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 +43 -31
- package/dist/index.cjs +463 -290
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +19 -7
- package/dist/index.d.ts +19 -7
- package/dist/index.js +483 -300
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
- package/styles.css +135 -0
package/dist/index.d.cts
CHANGED
|
@@ -35,14 +35,22 @@ type NexGridTheme = TableXTheme;
|
|
|
35
35
|
interface TableXProps<TData> {
|
|
36
36
|
/** Column definitions, in display order. */
|
|
37
37
|
columns: TableXReactColumn<TData>[];
|
|
38
|
-
/** The CURRENT page of rows
|
|
38
|
+
/** The CURRENT page of rows (server mode) or the full in-memory dataset (client-side mode). */
|
|
39
39
|
data: TData[];
|
|
40
|
-
/** Total filtered row count from the server; drives the pager. */
|
|
41
|
-
total
|
|
42
|
-
/** The query the `data`
|
|
43
|
-
query
|
|
44
|
-
/** Called with the next query whenever the user changes page/sort/search/size. */
|
|
45
|
-
onQueryChange
|
|
40
|
+
/** Total filtered row count from the server; drives the pager. In client-side mode, this is computed automatically. */
|
|
41
|
+
total?: number;
|
|
42
|
+
/** The query the `data` answers. In client-side mode, this is managed internally if omitted. */
|
|
43
|
+
query?: QueryState;
|
|
44
|
+
/** Called with the next query whenever the user changes page/sort/search/size. Optional in client-side mode. */
|
|
45
|
+
onQueryChange?: (next: QueryState) => void;
|
|
46
|
+
/**
|
|
47
|
+
* Enable client-side pagination, sorting, search, and filtering over in-memory `data`.
|
|
48
|
+
* When enabled (or when `paginationMode: "client"`), the grid manages page slicing,
|
|
49
|
+
* total counts, search, and sorting internally. Default is auto (true when onQueryChange is omitted).
|
|
50
|
+
*/
|
|
51
|
+
clientSidePagination?: boolean;
|
|
52
|
+
/** Explicit pagination mode: `"server"` (default with onQueryChange) or `"client"`. */
|
|
53
|
+
paginationMode?: "client" | "server";
|
|
46
54
|
/** Accessible name for the table. Also the default export file name and sheet title. */
|
|
47
55
|
caption: string;
|
|
48
56
|
/** Initial row density. Later changes to this prop are ignored — the user owns it from then on. Default `"default"`. */
|
|
@@ -120,6 +128,10 @@ interface TableXProps<TData> {
|
|
|
120
128
|
oldValue: unknown;
|
|
121
129
|
newValue: unknown;
|
|
122
130
|
}) => void;
|
|
131
|
+
/** Unique key to persist and restore grid state (column widths, column order, hidden columns, density) in localStorage. */
|
|
132
|
+
storageKey?: string;
|
|
133
|
+
/** Show the active filter pills bar beneath the toolbar when filters or search are active. Default `true`. */
|
|
134
|
+
showFilterPills?: boolean;
|
|
123
135
|
/** Rendered at the end of the toolbar, after the export menu. */
|
|
124
136
|
toolbarActions?: ReactNode;
|
|
125
137
|
/** Clicking a row (or a card) invokes this. Adds a pointer cursor. */
|
package/dist/index.d.ts
CHANGED
|
@@ -35,14 +35,22 @@ type NexGridTheme = TableXTheme;
|
|
|
35
35
|
interface TableXProps<TData> {
|
|
36
36
|
/** Column definitions, in display order. */
|
|
37
37
|
columns: TableXReactColumn<TData>[];
|
|
38
|
-
/** The CURRENT page of rows
|
|
38
|
+
/** The CURRENT page of rows (server mode) or the full in-memory dataset (client-side mode). */
|
|
39
39
|
data: TData[];
|
|
40
|
-
/** Total filtered row count from the server; drives the pager. */
|
|
41
|
-
total
|
|
42
|
-
/** The query the `data`
|
|
43
|
-
query
|
|
44
|
-
/** Called with the next query whenever the user changes page/sort/search/size. */
|
|
45
|
-
onQueryChange
|
|
40
|
+
/** Total filtered row count from the server; drives the pager. In client-side mode, this is computed automatically. */
|
|
41
|
+
total?: number;
|
|
42
|
+
/** The query the `data` answers. In client-side mode, this is managed internally if omitted. */
|
|
43
|
+
query?: QueryState;
|
|
44
|
+
/** Called with the next query whenever the user changes page/sort/search/size. Optional in client-side mode. */
|
|
45
|
+
onQueryChange?: (next: QueryState) => void;
|
|
46
|
+
/**
|
|
47
|
+
* Enable client-side pagination, sorting, search, and filtering over in-memory `data`.
|
|
48
|
+
* When enabled (or when `paginationMode: "client"`), the grid manages page slicing,
|
|
49
|
+
* total counts, search, and sorting internally. Default is auto (true when onQueryChange is omitted).
|
|
50
|
+
*/
|
|
51
|
+
clientSidePagination?: boolean;
|
|
52
|
+
/** Explicit pagination mode: `"server"` (default with onQueryChange) or `"client"`. */
|
|
53
|
+
paginationMode?: "client" | "server";
|
|
46
54
|
/** Accessible name for the table. Also the default export file name and sheet title. */
|
|
47
55
|
caption: string;
|
|
48
56
|
/** Initial row density. Later changes to this prop are ignored — the user owns it from then on. Default `"default"`. */
|
|
@@ -120,6 +128,10 @@ interface TableXProps<TData> {
|
|
|
120
128
|
oldValue: unknown;
|
|
121
129
|
newValue: unknown;
|
|
122
130
|
}) => void;
|
|
131
|
+
/** Unique key to persist and restore grid state (column widths, column order, hidden columns, density) in localStorage. */
|
|
132
|
+
storageKey?: string;
|
|
133
|
+
/** Show the active filter pills bar beneath the toolbar when filters or search are active. Default `true`. */
|
|
134
|
+
showFilterPills?: boolean;
|
|
123
135
|
/** Rendered at the end of the toolbar, after the export menu. */
|
|
124
136
|
toolbarActions?: ReactNode;
|
|
125
137
|
/** Clicking a row (or a card) invokes this. Adds a pointer cursor. */
|