@gemologic/sheen-table 0.2.0 → 0.3.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/DataTable.d.ts +7 -0
- package/dist/DataTable.js +1154 -1624
- package/dist/DataTableToolbar.js +1 -2
- package/dist/FilterBar.d.ts +3 -0
- package/dist/FilterBar.js +127 -108
- package/dist/QueryBuilder.js +72 -68
- package/dist/cell-edit.js +1 -2
- package/dist/client-state.js +20 -21
- package/dist/client-view.js +12 -13
- package/dist/column-layout.js +1 -2
- package/dist/columns.d.ts +5 -1
- package/dist/columns.js +7 -5
- package/dist/constrained-columns.js +1 -2
- package/dist/data-table-features.d.ts +129 -0
- package/dist/data-table-features.js +550 -0
- package/dist/export.js +1 -2
- package/dist/facets.js +5 -7
- package/dist/filter-bar-state.js +14 -18
- package/dist/filter-client.js +1 -2
- package/dist/filter.js +1 -2
- package/dist/grouping.js +1 -2
- package/dist/index.js +3 -3
- package/dist/messages.d.ts +1 -1
- package/dist/messages.js +2 -3
- package/dist/pagination.js +1 -2
- package/dist/query-builder-state.js +1 -2
- package/dist/requests.js +1 -2
- package/dist/row-hierarchy.js +1 -2
- package/dist/row-identity.js +1 -2
- package/dist/saved-views.js +1 -2
- package/dist/search-controller.js +1 -2
- package/dist/search.js +1 -2
- package/dist/selection-client.js +1 -2
- package/dist/selection.d.ts +3 -0
- package/dist/selection.js +9 -2
- package/dist/server-export.js +1 -2
- package/dist/sorting.js +1 -2
- package/dist/table-state-changes.js +1 -2
- package/dist/table-state.js +1 -2
- package/dist/text-normalization.js +1 -2
- package/dist/url-state.js +1 -2
- package/package.json +5 -5
- package/src/DataTable.tsx +285 -712
- package/src/FilterBar.tsx +17 -3
- package/src/QueryBuilder.tsx +5 -5
- package/src/columns.ts +9 -3
- package/src/data-table-features.tsx +579 -0
- package/src/messages.ts +1 -1
- package/src/selection.ts +8 -0
- package/src/styles.css +17 -11
package/dist/DataTable.d.ts
CHANGED
|
@@ -8,6 +8,7 @@ import type { FilterNode } from "./filter.ts";
|
|
|
8
8
|
import type { FilterDateEditor } from "./FilterBar.tsx";
|
|
9
9
|
import type { TableExportRequest } from "./server-export.ts";
|
|
10
10
|
import type { CellCommitRequest, CellCommitResult } from "./cell-edit.ts";
|
|
11
|
+
import type { DataTableFeature } from "./data-table-features.tsx";
|
|
11
12
|
export interface DataTableResult<Row extends object> extends PageResult<Row> {
|
|
12
13
|
readonly facets?: Readonly<Record<string, Readonly<Record<string, number>>>>;
|
|
13
14
|
/** Required for delegated server grouping; describes the accepted page with full-group totals. */
|
|
@@ -111,6 +112,7 @@ interface DataTableBaseProps<Row extends object> {
|
|
|
111
112
|
readonly initialState?: DataTableInitialState;
|
|
112
113
|
/** Reactively applies an app-owned accepted filter. Use onAcceptedStateChange to keep table-authored changes synchronized. */
|
|
113
114
|
readonly filter?: FilterNode;
|
|
115
|
+
/** Row and cell height as a CSS length, such as `"2.75rem"` for two-line cells. Pair with `estimatedRowHeight` in pixels. */
|
|
114
116
|
readonly rowHeight?: string;
|
|
115
117
|
readonly variableRowHeight?: boolean;
|
|
116
118
|
readonly estimatedRowHeight?: number;
|
|
@@ -146,6 +148,7 @@ export interface ClientDataTableProps<Row extends object> extends DataTableBaseP
|
|
|
146
148
|
readonly initialResult?: never;
|
|
147
149
|
readonly onStateChange?: never;
|
|
148
150
|
readonly onExport?: never;
|
|
151
|
+
readonly refreshKey?: never;
|
|
149
152
|
}
|
|
150
153
|
export interface ServerDataTableProps<Row extends object> extends DataTableBaseProps<Row> {
|
|
151
154
|
readonly mode: "server";
|
|
@@ -153,9 +156,13 @@ export interface ServerDataTableProps<Row extends object> extends DataTableBaseP
|
|
|
153
156
|
readonly data?: never;
|
|
154
157
|
readonly initialResult?: DataTableResult<Row>;
|
|
155
158
|
readonly onStateChange: (state: TableState, signal: AbortSignal) => Promise<DataTableResult<Row>>;
|
|
159
|
+
/** Change to revalidate the latest requested/accepted query without resetting layout or scroll. Initial value does not fetch. */
|
|
160
|
+
readonly refreshKey?: string | number;
|
|
156
161
|
/** Creates a complete server-side export for the captured accepted query and selection. Without this adapter, export UI is hidden. */
|
|
157
162
|
readonly onExport?: (request: TableExportRequest, signal: AbortSignal) => Promise<Blob>;
|
|
158
163
|
}
|
|
159
164
|
export type DataTableProps<Row extends object> = ClientDataTableProps<Row> | ServerDataTableProps<Row>;
|
|
160
165
|
export declare function DataTable<Row extends object>(props: DataTableProps<Row>): JSX.Element;
|
|
166
|
+
/** Internal composition root. Features own their props, state, and rendering hooks; omitted features are not bundled. */
|
|
167
|
+
export declare function renderDataTable<Row extends object>(props: DataTableProps<Row>, features: readonly DataTableFeature[]): JSX.Element;
|
|
161
168
|
export {};
|