@ox0/data-grid 0.1.21 → 0.1.22
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 +1 -1
- package/dist/774.js +586 -0
- package/dist/components/ColumnChooser.d.ts +9 -9
- package/dist/components/ColumnChooser.d.ts.map +1 -1
- package/dist/components/ColumnResizeHandle.d.ts +25 -0
- package/dist/components/ColumnResizeHandle.d.ts.map +1 -0
- package/dist/components/DataCell.d.ts +38 -0
- package/dist/components/DataCell.d.ts.map +1 -0
- package/dist/components/DataGrid.aggregate.test.d.ts +2 -0
- package/dist/components/DataGrid.aggregate.test.d.ts.map +1 -0
- package/dist/components/DataGrid.d.ts +6 -3
- package/dist/components/DataGrid.d.ts.map +1 -1
- package/dist/components/DataGrid.export.test.d.ts +2 -0
- package/dist/components/DataGrid.export.test.d.ts.map +1 -0
- package/dist/components/DataGrid.group.test.d.ts +2 -0
- package/dist/components/DataGrid.group.test.d.ts.map +1 -0
- package/dist/components/DataGrid.keyboard.test.d.ts +2 -0
- package/dist/components/DataGrid.keyboard.test.d.ts.map +1 -0
- package/dist/components/DataGrid.midnight.test.d.ts +2 -0
- package/dist/components/DataGrid.midnight.test.d.ts.map +1 -0
- package/dist/components/DataGrid.select.test.d.ts +2 -0
- package/dist/components/DataGrid.select.test.d.ts.map +1 -0
- package/dist/components/DataGrid.server.test.d.ts +2 -0
- package/dist/components/DataGrid.server.test.d.ts.map +1 -0
- package/dist/components/DataGrid.views.test.d.ts +2 -0
- package/dist/components/DataGrid.views.test.d.ts.map +1 -0
- package/dist/components/ExportButton.d.ts +14 -0
- package/dist/components/ExportButton.d.ts.map +1 -0
- package/dist/components/OverflowTooltip.d.ts +15 -0
- package/dist/components/OverflowTooltip.d.ts.map +1 -0
- package/dist/components/Pager.d.ts +22 -0
- package/dist/components/Pager.d.ts.map +1 -0
- package/dist/components/ViewsMenu.d.ts +19 -0
- package/dist/components/ViewsMenu.d.ts.map +1 -0
- package/dist/components/VirtualScroller.d.ts +13 -24
- package/dist/components/VirtualScroller.d.ts.map +1 -1
- package/dist/components/auto-width.d.ts +29 -0
- package/dist/components/auto-width.d.ts.map +1 -0
- package/dist/components/auto-width.test.d.ts +2 -0
- package/dist/components/auto-width.test.d.ts.map +1 -0
- package/dist/components/column-layout.d.ts +45 -3
- package/dist/components/column-layout.d.ts.map +1 -1
- package/dist/components/format.d.ts +7 -0
- package/dist/components/format.d.ts.map +1 -0
- package/dist/components/numbers.d.ts +12 -0
- package/dist/components/numbers.d.ts.map +1 -0
- package/dist/components/numbers.test.d.ts +2 -0
- package/dist/components/numbers.test.d.ts.map +1 -0
- package/dist/hooks/create-engine.d.ts +16 -0
- package/dist/hooks/create-engine.d.ts.map +1 -0
- package/dist/hooks/create-engine.test.d.ts +2 -0
- package/dist/hooks/create-engine.test.d.ts.map +1 -0
- package/dist/hooks/midnight.d.ts +21 -0
- package/dist/hooks/midnight.d.ts.map +1 -0
- package/dist/hooks/midnight.test.d.ts +2 -0
- package/dist/hooks/midnight.test.d.ts.map +1 -0
- package/dist/hooks/stabilize.d.ts +13 -0
- package/dist/hooks/stabilize.d.ts.map +1 -0
- package/dist/hooks/stabilize.test.d.ts +2 -0
- package/dist/hooks/stabilize.test.d.ts.map +1 -0
- package/dist/hooks/use-column-reorder.d.ts +33 -0
- package/dist/hooks/use-column-reorder.d.ts.map +1 -0
- package/dist/hooks/use-grid-worker.test.d.ts +2 -0
- package/dist/hooks/use-grid-worker.test.d.ts.map +1 -0
- package/dist/hooks/use-grid.d.ts +65 -10
- package/dist/hooks/use-grid.d.ts.map +1 -1
- package/dist/hooks/use-row-reorder.d.ts +38 -0
- package/dist/hooks/use-row-reorder.d.ts.map +1 -0
- package/dist/hooks/use-row-reorder.test.d.ts +2 -0
- package/dist/hooks/use-row-reorder.test.d.ts.map +1 -0
- package/dist/hooks/use-views.d.ts +40 -0
- package/dist/hooks/use-views.d.ts.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5717 -1011
- package/dist/ingest.d.ts +11 -0
- package/dist/ingest.d.ts.map +1 -1
- package/dist/omnibar/highlight.d.ts +19 -0
- package/dist/omnibar/highlight.d.ts.map +1 -0
- package/dist/omnibar/highlight.test.d.ts +2 -0
- package/dist/omnibar/highlight.test.d.ts.map +1 -0
- package/dist/omnibar/query-schema.d.ts +16 -0
- package/dist/omnibar/query-schema.d.ts.map +1 -0
- package/dist/rslib-runtime.js +46 -0
- package/dist/server/server-engine.d.ts +42 -0
- package/dist/server/server-engine.d.ts.map +1 -0
- package/dist/server/server-engine.group.test.d.ts +2 -0
- package/dist/server/server-engine.group.test.d.ts.map +1 -0
- package/dist/server/server-engine.test.d.ts +2 -0
- package/dist/server/server-engine.test.d.ts.map +1 -0
- package/dist/spawn-worker.d.ts +11 -0
- package/dist/spawn-worker.d.ts.map +1 -0
- package/dist/store/column-state.d.ts +41 -0
- package/dist/store/column-state.d.ts.map +1 -0
- package/dist/store/column-state.test.d.ts +2 -0
- package/dist/store/column-state.test.d.ts.map +1 -0
- package/dist/store/grid-store.d.ts +31 -2
- package/dist/store/grid-store.d.ts.map +1 -1
- package/dist/test-worker.d.ts +15 -0
- package/dist/test-worker.d.ts.map +1 -0
- package/dist/types.d.ts +10 -63
- package/dist/types.d.ts.map +1 -1
- package/dist/worker/aggregate.d.ts +18 -0
- package/dist/worker/aggregate.d.ts.map +1 -0
- package/dist/worker/aggregate.test.d.ts +2 -0
- package/dist/worker/aggregate.test.d.ts.map +1 -0
- package/dist/worker/dataset.d.ts +28 -2
- package/dist/worker/dataset.d.ts.map +1 -1
- package/dist/worker/dataset.test.d.ts +2 -0
- package/dist/worker/dataset.test.d.ts.map +1 -0
- package/dist/worker/engine-client.d.ts +15 -0
- package/dist/worker/engine-client.d.ts.map +1 -0
- package/dist/worker/engine.d.ts +2 -0
- package/dist/worker/engine.d.ts.map +1 -0
- package/dist/worker/engine.js +4 -0
- package/dist/worker/filter.d.ts +8 -4
- package/dist/worker/filter.d.ts.map +1 -1
- package/dist/worker/fraction-digits.d.ts +11 -0
- package/dist/worker/fraction-digits.d.ts.map +1 -0
- package/dist/worker/group.d.ts +45 -0
- package/dist/worker/group.d.ts.map +1 -0
- package/dist/worker/group.test.d.ts +2 -0
- package/dist/worker/group.test.d.ts.map +1 -0
- package/dist/worker/handle-message.d.ts +9 -0
- package/dist/worker/handle-message.d.ts.map +1 -0
- package/dist/worker/protocol.d.ts +121 -0
- package/dist/worker/protocol.d.ts.map +1 -0
- package/dist/worker/sort.d.ts +27 -0
- package/dist/worker/sort.d.ts.map +1 -1
- package/dist/worker/sync-engine.d.ts +4 -4
- package/dist/worker/sync-engine.d.ts.map +1 -1
- package/dist/worker/types.d.ts +91 -14
- package/dist/worker/types.d.ts.map +1 -1
- package/package.json +6 -5
- package/dist/worker/date.d.ts +0 -10
- package/dist/worker/date.d.ts.map +0 -1
- package/dist/worker/date.test.d.ts +0 -2
- package/dist/worker/date.test.d.ts.map +0 -1
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { type CSSProperties, type ReactNode } from "react";
|
|
2
|
+
import type { ColumnMarks, HighlightTerms } from "../omnibar/highlight";
|
|
3
|
+
import type { CellRow, ColumnDef, DerivedColumnDef, KeyColumnDef } from "../types";
|
|
4
|
+
export declare function isKeyColumnDef<Row extends object>(column: ColumnDef<Row>): column is KeyColumnDef<Row>;
|
|
5
|
+
export declare function isDerivedColumnDef<Row extends object>(column: ColumnDef<Row>): column is DerivedColumnDef<Row>;
|
|
6
|
+
/**
|
|
7
|
+
* A column's highlight terms (architecture doc "Match highlighting"): null where only the root
|
|
8
|
+
* provider's free-text terms apply (a searchable column with no field filter of its own), else
|
|
9
|
+
* the terms in scope for it alone.
|
|
10
|
+
*/
|
|
11
|
+
export declare function marksFor<Row extends object>(column: ColumnDef<Row>, highlight: HighlightTerms): ColumnMarks | null;
|
|
12
|
+
export type DataCellProps<Row extends object> = {
|
|
13
|
+
readonly column: ColumnDef<Row>;
|
|
14
|
+
readonly row: CellRow<Row>;
|
|
15
|
+
readonly rowIndex: number;
|
|
16
|
+
readonly colIndex: number;
|
|
17
|
+
readonly isSelected: boolean;
|
|
18
|
+
readonly isDetailOpen: boolean;
|
|
19
|
+
readonly pinned: "left" | "right" | null;
|
|
20
|
+
readonly offset: number;
|
|
21
|
+
readonly width: number;
|
|
22
|
+
readonly align: "start" | "end";
|
|
23
|
+
readonly fractionDigits: number;
|
|
24
|
+
readonly highlight: HighlightTerms;
|
|
25
|
+
};
|
|
26
|
+
/**
|
|
27
|
+
* One data cell. Memoized: every prop is a primitive or a reference that only changes when the
|
|
28
|
+
* cell's content can (the column definition, the row object — kept across refetches while its
|
|
29
|
+
* fields are unchanged, see `stabilizeEntries` — and the memoized highlight terms), so a row
|
|
30
|
+
* re-rendering for its selection, focus, or position doesn't re-render its cells, and scrolling
|
|
31
|
+
* only renders the rows that come into view. Cells hold no grid handlers, so a skipped render
|
|
32
|
+
* can't leave a stale one behind.
|
|
33
|
+
*/
|
|
34
|
+
declare function DataCellImpl<Row extends object>({ column, row, rowIndex, colIndex, isSelected, isDetailOpen, pinned, offset, width, align, fractionDigits, highlight, }: DataCellProps<Row>): ReactNode;
|
|
35
|
+
export declare const DataCell: typeof DataCellImpl;
|
|
36
|
+
export declare function pinnedCellStyle(pinned: "left" | "right" | null, offset: number, width: number): CSSProperties;
|
|
37
|
+
export {};
|
|
38
|
+
//# sourceMappingURL=DataCell.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DataCell.d.ts","sourceRoot":"","sources":["../../src/components/DataCell.tsx"],"names":[],"mappings":"AACA,OAAO,EAAQ,KAAK,aAAa,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAA;AAEhE,OAAO,KAAK,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AACvE,OAAO,KAAK,EAAY,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAA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EACR,UAAU,EACV,YAAY,EACZ,MAAM,EACN,MAAM,EACN,KAAK,EACL,KAAK,EACL,cAAc,EACd,SAAS,GACV,EAAE,aAAa,CAAC,GAAG,CAAC,GAAG,SAAS,CA0ChC;AAGD,eAAO,MAAM,QAAQ,EAAyB,OAAO,YAAY,CAAA;AAEjE,wBAAgB,eAAe,CAC7B,MAAM,EAAE,MAAM,GAAG,OAAO,GAAG,IAAI,EAC/B,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,MAAM,GACZ,aAAa,CAMf"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DataGrid.aggregate.test.d.ts","sourceRoot":"","sources":["../../src/components/DataGrid.aggregate.test.tsx"],"names":[],"mappings":""}
|
|
@@ -6,9 +6,12 @@ import type { DataGridProps } from "../types";
|
|
|
6
6
|
* `overflow: "wrap"` columns is Phase 2). Sorting, simple filtering, match highlighting,
|
|
7
7
|
* single-select + row detail, and column show/hide/reorder/pin via the `ColumnChooser` popover are
|
|
8
8
|
* wired. Column resize, header-cell drag-and-drop reorder, multi-select, grouping, views, export,
|
|
9
|
-
* and server mode are not.
|
|
10
|
-
*
|
|
11
|
-
*
|
|
9
|
+
* and server mode are not.
|
|
10
|
+
*
|
|
11
|
+
* Row data comes from the engine asynchronously (a Web Worker, or the sync engine where there is
|
|
12
|
+
* none): the scroller reports its visible range, `useGrid` fetches rows around it, and any row
|
|
13
|
+
* not loaded yet renders as a placeholder. Until the first count arrives the grid shows a loading
|
|
14
|
+
* skeleton — which is also what SSR renders.
|
|
12
15
|
*/
|
|
13
16
|
export declare function DataGrid<Row extends object>(props: DataGridProps<Row>): ReactNode;
|
|
14
17
|
//# sourceMappingURL=DataGrid.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DataGrid.d.ts","sourceRoot":"","sources":["../../src/components/DataGrid.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"DataGrid.d.ts","sourceRoot":"","sources":["../../src/components/DataGrid.tsx"],"names":[],"mappings":"AAeA,OAAO,EAYL,KAAK,SAAS,EACf,MAAM,OAAO,CAAA;AAWd,OAAO,KAAK,EAIV,aAAa,EAQd,MAAM,UAAU,CAAA;AA4OjB;;;;;;;;;;;;GAYG;AACH,wBAAgB,QAAQ,CAAC,GAAG,SAAS,MAAM,EAAE,KAAK,EAAE,aAAa,CAAC,GAAG,CAAC,GAAG,SAAS,CAymEjF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DataGrid.export.test.d.ts","sourceRoot":"","sources":["../../src/components/DataGrid.export.test.tsx"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DataGrid.group.test.d.ts","sourceRoot":"","sources":["../../src/components/DataGrid.group.test.tsx"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DataGrid.keyboard.test.d.ts","sourceRoot":"","sources":["../../src/components/DataGrid.keyboard.test.tsx"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DataGrid.midnight.test.d.ts","sourceRoot":"","sources":["../../src/components/DataGrid.midnight.test.tsx"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DataGrid.select.test.d.ts","sourceRoot":"","sources":["../../src/components/DataGrid.select.test.tsx"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DataGrid.server.test.d.ts","sourceRoot":"","sources":["../../src/components/DataGrid.server.test.tsx"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DataGrid.views.test.d.ts","sourceRoot":"","sources":["../../src/components/DataGrid.views.test.tsx"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
export type ExportFormat = "csv" | "excel";
|
|
3
|
+
export type ExportButtonProps = {
|
|
4
|
+
readonly formats: readonly ExportFormat[];
|
|
5
|
+
readonly isBusy: boolean;
|
|
6
|
+
readonly onExport: (format: ExportFormat) => void;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* The status row's Export (spec "Toolbar"): a quiet download icon — one format exports at once,
|
|
10
|
+
* several open a menu.
|
|
11
|
+
* Busy — a spinner, disabled — while the caller's `onExport` promise is pending.
|
|
12
|
+
*/
|
|
13
|
+
export declare function ExportButton({ formats, isBusy, onExport }: ExportButtonProps): ReactNode;
|
|
14
|
+
//# sourceMappingURL=ExportButton.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ExportButton.d.ts","sourceRoot":"","sources":["../../src/components/ExportButton.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAEtC,MAAM,MAAM,YAAY,GAAG,KAAK,GAAG,OAAO,CAAA;AAE1C,MAAM,MAAM,iBAAiB,GAAG;IAC9B,QAAQ,CAAC,OAAO,EAAE,SAAS,YAAY,EAAE,CAAA;IACzC,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAA;IACxB,QAAQ,CAAC,QAAQ,EAAE,CAAC,MAAM,EAAE,YAAY,KAAK,IAAI,CAAA;CAClD,CAAA;AAID;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,EAAE,iBAAiB,GAAG,SAAS,CA6BxF"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { type ReactNode, type RefObject } from "react";
|
|
2
|
+
export type OverflowTooltipApi = {
|
|
3
|
+
/** Shows the full text of `element` if it is truncated; `null` hides it. */
|
|
4
|
+
readonly show: (element: HTMLElement | null) => void;
|
|
5
|
+
};
|
|
6
|
+
/**
|
|
7
|
+
* The full value of a truncated cell on hover (spec "Overflow policy"). One tooltip for the whole
|
|
8
|
+
* grid, driven imperatively through `apiRef`, so hovering from cell to cell re-renders this and
|
|
9
|
+
* nothing else. Only cells whose text is actually cut off get one; touch is ignored, like every
|
|
10
|
+
* tooltip.
|
|
11
|
+
*/
|
|
12
|
+
export declare function OverflowTooltip({ apiRef, }: {
|
|
13
|
+
readonly apiRef: RefObject<OverflowTooltipApi | null>;
|
|
14
|
+
}): ReactNode;
|
|
15
|
+
//# sourceMappingURL=OverflowTooltip.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OverflowTooltip.d.ts","sourceRoot":"","sources":["../../src/components/OverflowTooltip.tsx"],"names":[],"mappings":"AACA,OAAO,EAAuB,KAAK,SAAS,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAA;AAE3E,MAAM,MAAM,kBAAkB,GAAG;IAC/B,4EAA4E;IAC5E,QAAQ,CAAC,IAAI,EAAE,CAAC,OAAO,EAAE,WAAW,GAAG,IAAI,KAAK,IAAI,CAAA;CACrD,CAAA;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,EAC9B,MAAM,GACP,EAAE;IACD,QAAQ,CAAC,MAAM,EAAE,SAAS,CAAC,kBAAkB,GAAG,IAAI,CAAC,CAAA;CACtD,GAAG,SAAS,CAoBZ"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
export type PagerProps = {
|
|
3
|
+
/** 0-based page shown. */
|
|
4
|
+
readonly pageIndex: number;
|
|
5
|
+
readonly pageSize: number;
|
|
6
|
+
/** Rows on the page shown. */
|
|
7
|
+
readonly rowCount: number;
|
|
8
|
+
/** The server's total; -1 when unknown. */
|
|
9
|
+
readonly totalCount: number;
|
|
10
|
+
readonly hasNext: boolean;
|
|
11
|
+
readonly hasPrevious: boolean;
|
|
12
|
+
/** Show numbered page buttons (spec: only when `pageJump` is supported and the total is known). */
|
|
13
|
+
readonly canJump: boolean;
|
|
14
|
+
readonly isBusy: boolean;
|
|
15
|
+
readonly onPage: (index: number) => void;
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* Server pagination (spec "Pagination mode"): Previous / Next, the range shown ("101–200 of
|
|
19
|
+
* 4,210"), and — when the backend can jump and the total is known — page numbers.
|
|
20
|
+
*/
|
|
21
|
+
export declare function Pager({ pageIndex, pageSize, rowCount, totalCount, hasNext, hasPrevious, canJump, isBusy, onPage, }: PagerProps): ReactNode;
|
|
22
|
+
//# sourceMappingURL=Pager.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Pager.d.ts","sourceRoot":"","sources":["../../src/components/Pager.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAMtC,MAAM,MAAM,UAAU,GAAG;IACvB,0BAA0B;IAC1B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;IAC1B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAA;IACzB,8BAA8B;IAC9B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAA;IACzB,2CAA2C;IAC3C,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAA;IAC3B,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAA;IACzB,QAAQ,CAAC,WAAW,EAAE,OAAO,CAAA;IAC7B,mGAAmG;IACnG,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAA;IACzB,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAA;IACxB,QAAQ,CAAC,MAAM,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;CACzC,CAAA;AAgBD;;;GAGG;AACH,wBAAgB,KAAK,CAAC,EACpB,SAAS,EACT,QAAQ,EACR,QAAQ,EACR,UAAU,EACV,OAAO,EACP,WAAW,EACX,OAAO,EACP,MAAM,EACN,MAAM,GACP,EAAE,UAAU,GAAG,SAAS,CAqDxB"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
import type { ViewsApi } from "../hooks/use-views";
|
|
3
|
+
import type { GridViewSummary } from "../types";
|
|
4
|
+
export type ViewsMenuProps = {
|
|
5
|
+
readonly views: readonly GridViewSummary[];
|
|
6
|
+
readonly api: ViewsApi;
|
|
7
|
+
/** Offer "Include current filters" when saving: a structured filter is applied. */
|
|
8
|
+
readonly canIncludeFilters: boolean;
|
|
9
|
+
/** `onViewDelete` was given. */
|
|
10
|
+
readonly canDelete: boolean;
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* The toolbar's saved-views control (spec "Views menu interactions"): the active view's name (and
|
|
14
|
+
* "Modified" when it has unsaved changes) on a button that opens the view list, with Save, Save as
|
|
15
|
+
* new view…, Reset to default, and per-view Rename / Delete. The views list comes from the caller;
|
|
16
|
+
* this only asks for changes through `api`.
|
|
17
|
+
*/
|
|
18
|
+
export declare function ViewsMenu({ views, api, canIncludeFilters, canDelete }: ViewsMenuProps): ReactNode;
|
|
19
|
+
//# sourceMappingURL=ViewsMenu.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ViewsMenu.d.ts","sourceRoot":"","sources":["../../src/components/ViewsMenu.tsx"],"names":[],"mappings":"AAUA,OAAO,EAA4B,KAAK,SAAS,EAAE,MAAM,OAAO,CAAA;AAEhE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAA;AAClD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;AAI/C,MAAM,MAAM,cAAc,GAAG;IAC3B,QAAQ,CAAC,KAAK,EAAE,SAAS,eAAe,EAAE,CAAA;IAC1C,QAAQ,CAAC,GAAG,EAAE,QAAQ,CAAA;IACtB,mFAAmF;IACnF,QAAQ,CAAC,iBAAiB,EAAE,OAAO,CAAA;IACnC,gCAAgC;IAChC,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAA;CAC5B,CAAA;AAWD;;;;;GAKG;AACH,wBAAgB,SAAS,CAAC,EAAE,KAAK,EAAE,GAAG,EAAE,iBAAiB,EAAE,SAAS,EAAE,EAAE,cAAc,GAAG,SAAS,CA+LjG"}
|
|
@@ -1,29 +1,10 @@
|
|
|
1
1
|
import { type ReactNode } from "react";
|
|
2
|
-
/**
|
|
3
|
-
* The scroll container. Owns virtual row positioning with no React state on the hot scroll path
|
|
4
|
-
* (see docs/llm/data-grid-architecture.md "VirtualScroller"). Fixed-height rows only for now —
|
|
5
|
-
* `measureElement`/variable height for `overflow: "wrap"` columns is a Phase 2 addition.
|
|
6
|
-
*
|
|
7
|
-
* `heightMode: "total"` sizes the scrollable spacer from `rowCount * rowHeight` (client mode, and
|
|
8
|
-
* server mode with a known total). `"loaded"` sizes it from `loadedRowCount * rowHeight` instead —
|
|
9
|
-
* the fallback for server responses that cannot report a total up front (Phase 3). Phase 1 only
|
|
10
|
-
* ever passes `"total"`; the branch exists now so Phase 3 does not require a spacer-model rewrite.
|
|
11
|
-
*
|
|
12
|
-
* `height="fill"` sizes this element to `100%` of its layout parent (a flex/grid ancestor with
|
|
13
|
-
* `flex: 1; min-height: 0` — see data-grid.module.css `.scroller`) rather than measuring anything
|
|
14
|
-
* itself: CSS already resolves "fill the remaining space" declaratively. A ResizeObserver here only
|
|
15
|
-
* watches for the spec's 0-height case (an unbounded parent) to log the dev warning and render
|
|
16
|
-
* nothing, per spec "Grid viewport sizing".
|
|
17
|
-
*
|
|
18
|
-
* `rowWidth` sizes the row content wider than the viewport when columns don't all fit — the
|
|
19
|
-
* scroll container's own `overflow: auto` handles horizontal scrolling too (no separate axis
|
|
20
|
-
* setup needed). The header row lives outside this component (kept out of virtualization) but
|
|
21
|
-
* needs to scroll in lockstep — `onScroll` forwards `scrollLeft` for the caller to mirror onto it.
|
|
22
|
-
*/
|
|
23
2
|
export type VirtualScrollerApi = {
|
|
24
3
|
readonly scrollToIndex: (index: number, options?: {
|
|
25
4
|
readonly align?: "start" | "center" | "end" | "auto";
|
|
26
5
|
}) => void;
|
|
6
|
+
/** The scroll container, for input that arrives elsewhere (the header) to scroll it. */
|
|
7
|
+
readonly scrollElement: () => HTMLDivElement | null;
|
|
27
8
|
};
|
|
28
9
|
export type VirtualScrollerProps = {
|
|
29
10
|
readonly height: number | "fill";
|
|
@@ -32,11 +13,19 @@ export type VirtualScrollerProps = {
|
|
|
32
13
|
readonly heightMode: "total" | "loaded";
|
|
33
14
|
readonly renderRow: (index: number, style: {
|
|
34
15
|
readonly transform: string;
|
|
35
|
-
}) => ReactNode;
|
|
16
|
+
}, measure?: (element: Element | null) => void) => ReactNode;
|
|
17
|
+
readonly variableHeight?: boolean;
|
|
18
|
+
readonly rowKey?: (index: number) => string | number;
|
|
36
19
|
readonly className?: string;
|
|
37
20
|
readonly apiRef?: React.RefObject<VirtualScrollerApi | null>;
|
|
38
21
|
readonly rowWidth?: number;
|
|
39
|
-
readonly onScroll?: (
|
|
22
|
+
readonly onScroll?: (scroller: HTMLDivElement) => void;
|
|
23
|
+
readonly onRangeChange?: (start: number, end: number) => void;
|
|
24
|
+
readonly centerColumns?: {
|
|
25
|
+
readonly widths: readonly number[];
|
|
26
|
+
readonly offsetLeft: number;
|
|
27
|
+
};
|
|
28
|
+
readonly onColumnRangeChange?: (start: number, end: number) => void;
|
|
40
29
|
};
|
|
41
|
-
export declare function VirtualScroller({ height, rowHeight, rowCount, heightMode, renderRow, className, apiRef, rowWidth, onScroll, }: VirtualScrollerProps): ReactNode;
|
|
30
|
+
export declare function VirtualScroller({ height, rowHeight, rowCount, heightMode, renderRow, className, apiRef, rowWidth, onScroll, onRangeChange, variableHeight, rowKey, centerColumns, onColumnRangeChange, }: VirtualScrollerProps): ReactNode;
|
|
42
31
|
//# sourceMappingURL=VirtualScroller.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VirtualScroller.d.ts","sourceRoot":"","sources":["../../src/components/VirtualScroller.tsx"],"names":[],"mappings":"AACA,OAAO,EAA+B,KAAK,SAAS,EAAE,MAAM,OAAO,C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AE,MAAM,CAAA;IAG1B,QAAQ,CAAC,QAAQ,CAAC,EAAE,CAAC,QAAQ,EAAE,cAAc,KAAK,IAAI,CAAA;IAItD,QAAQ,CAAC,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,KAAK,IAAI,CAAA;IAK7D,QAAQ,CAAC,aAAa,CAAC,EAAE;QAAE,QAAQ,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC;QAAC,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAA;KAAE,CAAA;IAC5F,QAAQ,CAAC,mBAAmB,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,KAAK,IAAI,CAAA;CACpE,CAAA;AAED,wBAAgB,eAAe,CAAC,EAC9B,MAAM,EACN,SAAS,EACT,QAAQ,EACR,UAAU,EACV,SAAS,EACT,SAAS,EACT,MAAM,EACN,QAAQ,EACR,QAAQ,EACR,aAAa,EACb,cAAsB,EACtB,MAAM,EACN,aAAa,EACb,mBAAmB,GACpB,EAAE,oBAAoB,GAAG,SAAS,CA0GlC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { ColumnDef } from "../types";
|
|
2
|
+
/** Width in px of `text` drawn in a CSS `font`. */
|
|
3
|
+
export type MeasureText = (text: string, font: string) => number;
|
|
4
|
+
/**
|
|
5
|
+
* `measureText` on one shared, never-mounted canvas — no layout, no DOM writes. Null where there
|
|
6
|
+
* is no 2D canvas (SSR, test environments); `"auto"` columns then keep the default width.
|
|
7
|
+
*/
|
|
8
|
+
export declare function createCanvasMeasurer(): MeasureText | null;
|
|
9
|
+
export type AutoWidthInput<Row extends object> = {
|
|
10
|
+
readonly columns: readonly ColumnDef<Row>[];
|
|
11
|
+
/** The cell text of each loaded row, by column id — the sample set. */
|
|
12
|
+
readonly sampleText: (column: ColumnDef<Row>) => readonly string[];
|
|
13
|
+
readonly measure: MeasureText;
|
|
14
|
+
readonly cellFont: string;
|
|
15
|
+
readonly headerFont: string;
|
|
16
|
+
/** Left + right padding of a body cell and of a header cell, px. */
|
|
17
|
+
readonly cellPadding: number;
|
|
18
|
+
readonly headerPadding: number;
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* Measured widths for `"auto"` columns (architecture doc "Auto-width measurement"): the widest of
|
|
22
|
+
* the header label and every sampled cell's text, each with its own padding. Clamping to `minWidth`/`maxWidth`
|
|
23
|
+
* happens in layout. A best fit over loaded rows, not a promise about rows not loaded yet.
|
|
24
|
+
*
|
|
25
|
+
* Only the built-in text cell is measured. A column with a custom `cell` renderer is left out —
|
|
26
|
+
* its content is arbitrary React — and keeps the default width; give it an explicit `width`.
|
|
27
|
+
*/
|
|
28
|
+
export declare function measureAutoWidths<Row extends object>(input: AutoWidthInput<Row>): Map<string, number>;
|
|
29
|
+
//# sourceMappingURL=auto-width.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auto-width.d.ts","sourceRoot":"","sources":["../../src/components/auto-width.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAA;AAEzC,mDAAmD;AACnD,MAAM,MAAM,WAAW,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,KAAK,MAAM,CAAA;AAKhE;;;GAGG;AACH,wBAAgB,oBAAoB,IAAI,WAAW,GAAG,IAAI,CAczD;AAED,MAAM,MAAM,cAAc,CAAC,GAAG,SAAS,MAAM,IAAI;IAC/C,QAAQ,CAAC,OAAO,EAAE,SAAS,SAAS,CAAC,GAAG,CAAC,EAAE,CAAA;IAC3C,uEAAuE;IACvE,QAAQ,CAAC,UAAU,EAAE,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,CAAC,KAAK,SAAS,MAAM,EAAE,CAAA;IAClE,QAAQ,CAAC,OAAO,EAAE,WAAW,CAAA;IAC7B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAA;IACzB,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAA;IAC3B,oEAAoE;IACpE,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAA;IAC5B,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAA;CAC/B,CAAA;AAED;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,CAAC,GAAG,SAAS,MAAM,EAClD,KAAK,EAAE,cAAc,CAAC,GAAG,CAAC,GACzB,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAgBrB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auto-width.test.d.ts","sourceRoot":"","sources":["../../src/components/auto-width.test.ts"],"names":[],"mappings":""}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { ColumnDef, ColumnState } from "../types";
|
|
2
2
|
export declare const DEFAULT_AUTO_WIDTH = 150;
|
|
3
|
+
export declare const DEFAULT_MIN_WIDTH = 40;
|
|
3
4
|
export type LayoutColumn<Row extends object> = {
|
|
4
5
|
readonly def: ColumnDef<Row>;
|
|
5
6
|
readonly width: number;
|
|
@@ -18,14 +19,55 @@ export type ColumnLayout<Row extends object> = {
|
|
|
18
19
|
* supplies everything else (header, cell renderer, ...). A state with no matching def (a stale
|
|
19
20
|
* entry from a since-removed column) is skipped.
|
|
20
21
|
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
22
|
+
* An `"auto"` width resolves to its measured width from `autoWidths` (keyed by column id), or
|
|
23
|
+
* `DEFAULT_AUTO_WIDTH` until measured, clamped to the column's `minWidth`/`maxWidth`. The store
|
|
24
|
+
* keeps `"auto"`; only layout sees the number (architecture doc "Auto-width measurement").
|
|
25
|
+
* Center columns carry their offset from the start of the center region, for horizontal
|
|
26
|
+
* virtualization (`planColumns`).
|
|
23
27
|
*/
|
|
24
|
-
export declare function layoutColumns<Row extends object>(columnDefs: readonly ColumnDef<Row>[], columnStates: readonly ColumnState[]): ColumnLayout<Row>;
|
|
28
|
+
export declare function layoutColumns<Row extends object>(columnDefs: readonly ColumnDef<Row>[], columnStates: readonly ColumnState[], autoWidths?: ReadonlyMap<string, number>): ColumnLayout<Row>;
|
|
25
29
|
export type FlatLayoutColumn<Row extends object> = LayoutColumn<Row> & {
|
|
26
30
|
readonly pinned: "left" | "right" | null;
|
|
27
31
|
};
|
|
28
32
|
/** Left-to-right rendering/reading order across all three regions — for `aria-colindex` and a
|
|
29
33
|
* single render loop instead of three. */
|
|
30
34
|
export declare function flattenLayout<Row extends object>(layout: ColumnLayout<Row>): readonly FlatLayoutColumn<Row>[];
|
|
35
|
+
/** A visible range of center columns, end exclusive. */
|
|
36
|
+
export type ColumnRange = {
|
|
37
|
+
readonly start: number;
|
|
38
|
+
readonly end: number;
|
|
39
|
+
};
|
|
40
|
+
export type PlannedCell<Row extends object> = {
|
|
41
|
+
readonly kind: "column";
|
|
42
|
+
readonly column: FlatLayoutColumn<Row>;
|
|
43
|
+
readonly colIndex: number;
|
|
44
|
+
} | {
|
|
45
|
+
readonly kind: "spacer";
|
|
46
|
+
readonly key: string;
|
|
47
|
+
readonly width: number;
|
|
48
|
+
};
|
|
49
|
+
/**
|
|
50
|
+
* What a row (or the header) renders left to right with horizontal virtualization: every pinned
|
|
51
|
+
* column, the center columns in `range` plus any `overflow: "wrap"` ones, and a spacer for each run
|
|
52
|
+
* of unmounted center columns — so flex layout and sticky pinned columns work unchanged, and each
|
|
53
|
+
* mounted cell keeps its real `aria-colindex`.
|
|
54
|
+
*/
|
|
55
|
+
export declare function planColumns<Row extends object>(layout: ColumnLayout<Row>, range: ColumnRange): readonly PlannedCell<Row>[];
|
|
56
|
+
/** One cell of the spanning-header row: a group's run of visible columns, or ungrouped filler. */
|
|
57
|
+
export type GroupHeaderSegment = {
|
|
58
|
+
readonly key: string;
|
|
59
|
+
readonly groupId: string | null;
|
|
60
|
+
readonly width: number;
|
|
61
|
+
readonly pinned: "left" | "right" | null;
|
|
62
|
+
readonly offset: number;
|
|
63
|
+
readonly colIndex: number;
|
|
64
|
+
readonly colSpan: number;
|
|
65
|
+
};
|
|
66
|
+
/**
|
|
67
|
+
* The spanning-header row (spec "Column groups"): each run of adjacent visible columns that share a
|
|
68
|
+
* `groupId` within one region becomes one segment spanning them — so a pinned member leaves its
|
|
69
|
+
* group's span, and a group split across regions shows a header in each. Ungrouped runs become
|
|
70
|
+
* filler segments. Not virtualized: there are few segments, each one wide cell.
|
|
71
|
+
*/
|
|
72
|
+
export declare function groupHeaderSegments<Row extends object>(layout: ColumnLayout<Row>): readonly GroupHeaderSegment[];
|
|
31
73
|
//# sourceMappingURL=column-layout.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"column-layout.d.ts","sourceRoot":"","sources":["../../src/components/column-layout.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,UAAU,CAAA;
|
|
1
|
+
{"version":3,"file":"column-layout.d.ts","sourceRoot":"","sources":["../../src/components/column-layout.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,UAAU,CAAA;AAItD,eAAO,MAAM,kBAAkB,MAAM,CAAA;AAErC,eAAO,MAAM,iBAAiB,KAAK,CAAA;AAEnC,MAAM,MAAM,YAAY,CAAC,GAAG,SAAS,MAAM,IAAI;IAC7C,QAAQ,CAAC,GAAG,EAAE,SAAS,CAAC,GAAG,CAAC,CAAA;IAC5B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IAGtB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;CACxB,CAAA;AAED,MAAM,MAAM,YAAY,CAAC,GAAG,SAAS,MAAM,IAAI;IAC7C,QAAQ,CAAC,UAAU,EAAE,SAAS,YAAY,CAAC,GAAG,CAAC,EAAE,CAAA;IACjD,QAAQ,CAAC,MAAM,EAAE,SAAS,YAAY,CAAC,GAAG,CAAC,EAAE,CAAA;IAC7C,QAAQ,CAAC,WAAW,EAAE,SAAS,YAAY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,MAAM,EAAE,YAAY,CAAC,GAAG,CAAC,EACzB,KAAK,EAAE,WAAW,GACjB,SAAS,WAAW,CAAC,GAAG,CAAC,EAAE,CA2B7B;AAED,kGAAkG;AAClG,MAAM,MAAM,kBAAkB,GAAG;IAC/B,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAA;IACpB,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAA;IAC/B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,GAAG,IAAI,CAAA;IAExC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;IAEvB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAA;IACzB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;CACzB,CAAA;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,GAAG,SAAS,MAAM,EACpD,MAAM,EAAE,YAAY,CAAC,GAAG,CAAC,GACxB,SAAS,kBAAkB,EAAE,CA8B/B"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/** A count for display: grouped by the browser's locale ("100,000"). */
|
|
2
|
+
export declare function formatCount(value: number): string;
|
|
3
|
+
/** The decimal separator `formatStat` writes ("." or ","), for lining up points. */
|
|
4
|
+
export declare const statDecimalSeparator: string;
|
|
5
|
+
/** A computed stat (a mean, a sum) for display: grouped, at most two decimals ("1,234.57"). */
|
|
6
|
+
export declare function formatStat(value: number): string;
|
|
7
|
+
//# sourceMappingURL=format.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"format.d.ts","sourceRoot":"","sources":["../../src/components/format.ts"],"names":[],"mappings":"AAKA,wEAAwE;AACxE,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAEjD;AAKD,oFAAoF;AACpF,eAAO,MAAM,oBAAoB,QACoD,CAAA;AAErF,+FAA+F;AAC/F,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAEhD"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { ColumnDef } from "../types";
|
|
2
|
+
/** Where a column's cells, header, and stats sit: numeric columns end-aligned unless told not to. */
|
|
3
|
+
export declare function columnAlign<Row extends object>(column: ColumnDef<Row>): "start" | "end";
|
|
4
|
+
/**
|
|
5
|
+
* Pads a number's text on the right to `fractionDigits` digits after its point, so right-aligned
|
|
6
|
+
* values line their points up: "12" → "12" + punctuation space + 2 figure spaces next to "3.14".
|
|
7
|
+
* Text with as many digits or more, or anything that isn't a plain number, is left alone.
|
|
8
|
+
*/
|
|
9
|
+
export declare function alignDecimal(text: string, fractionDigits: number, separator?: string): string;
|
|
10
|
+
/** The digits after `separator` in a number's text (0 without one). */
|
|
11
|
+
export declare function fractionDigitsIn(text: string, separator?: string): number;
|
|
12
|
+
//# sourceMappingURL=numbers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"numbers.d.ts","sourceRoot":"","sources":["../../src/components/numbers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAA;AAOzC,qGAAqG;AACrG,wBAAgB,WAAW,CAAC,GAAG,SAAS,MAAM,EAAE,MAAM,EAAE,SAAS,CAAC,GAAG,CAAC,GAAG,OAAO,GAAG,KAAK,CAEvF;AAED;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,EAAE,SAAS,SAAM,GAAG,MAAM,CAM1F;AAED,uEAAuE;AACvE,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,SAAM,GAAG,MAAM,CAGtE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"numbers.test.d.ts","sourceRoot":"","sources":["../../src/components/numbers.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { DataEngineInterface } from "../worker/types";
|
|
2
|
+
export type EngineKind = DataEngineInterface<unknown>["kind"];
|
|
3
|
+
/**
|
|
4
|
+
* Picks the engine, in the priority order of docs/llm/data-grid-architecture.md "Worker-less
|
|
5
|
+
* engine for SSR and tests": an explicit choice, then sync without a Worker API, then sync in
|
|
6
|
+
* tests, otherwise the worker. A Worker constructor that throws is handled by `createEngine`.
|
|
7
|
+
*/
|
|
8
|
+
export declare function chooseEngineKind(explicit: EngineKind | undefined): EngineKind;
|
|
9
|
+
/**
|
|
10
|
+
* The worker engine. A worker that fails to load or start (no chunk emitted by the consumer's
|
|
11
|
+
* bundler, a CSP without `worker-src 'self'`) reports a fatal error event, which `useGrid` answers
|
|
12
|
+
* by switching to the sync engine.
|
|
13
|
+
*/
|
|
14
|
+
export declare function createWorkerEngine<Row>(worker: Worker): DataEngineInterface<Row>;
|
|
15
|
+
export declare function createEngine<Row>(kind: EngineKind): DataEngineInterface<Row>;
|
|
16
|
+
//# sourceMappingURL=create-engine.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-engine.d.ts","sourceRoot":"","sources":["../../src/hooks/create-engine.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAA;AAE1D,MAAM,MAAM,UAAU,GAAG,mBAAmB,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,CAAA;AAS7D;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,UAAU,GAAG,SAAS,GAAG,UAAU,CAK7E;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,GAAG,mBAAmB,CAAC,GAAG,CAAC,CAuBhF;AAED,wBAAgB,YAAY,CAAC,GAAG,EAAE,IAAI,EAAE,UAAU,GAAG,mBAAmB,CAAC,GAAG,CAAC,CAS5E"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-engine.test.d.ts","sourceRoot":"","sources":["../../src/hooks/create-engine.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { FilterToken } from "../types";
|
|
2
|
+
/** Whether a filter's matches depend on what "today" is: a relative date or an open end. */
|
|
3
|
+
export declare function dependsOnToday(tokens: readonly FilterToken[]): boolean;
|
|
4
|
+
/** The calendar day (`YYYY-MM-DD`) an instant falls on in `timeZone`. */
|
|
5
|
+
export declare function dayIn(instant: number, timeZone: string): string;
|
|
6
|
+
/**
|
|
7
|
+
* Milliseconds from `now` to the next midnight in `timeZone`. A day of 23 or 25 hours (a DST
|
|
8
|
+
* change) is corrected for by checking where the first guess lands.
|
|
9
|
+
*/
|
|
10
|
+
export declare function msUntilMidnight(now: number, timeZone: string): number;
|
|
11
|
+
/**
|
|
12
|
+
* Calls `onNewDay` at each midnight in `timeZone`, by `clock` (epoch ms), until cancelled. Timers
|
|
13
|
+
* pause while a device sleeps, so a page that becomes visible again on a later day catches up at
|
|
14
|
+
* once.
|
|
15
|
+
*/
|
|
16
|
+
export declare function scheduleMidnight(options: {
|
|
17
|
+
readonly timeZone: string;
|
|
18
|
+
readonly clock: () => number;
|
|
19
|
+
readonly onNewDay: () => void;
|
|
20
|
+
}): () => void;
|
|
21
|
+
//# sourceMappingURL=midnight.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"midnight.d.ts","sourceRoot":"","sources":["../../src/hooks/midnight.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,UAAU,CAAA;AAI3C,4FAA4F;AAC5F,wBAAgB,cAAc,CAAC,MAAM,EAAE,SAAS,WAAW,EAAE,GAAG,OAAO,CAStE;AAqCD,yEAAyE;AACzE,wBAAgB,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAE/D;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAKrE;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE;IACxC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAA;IACzB,QAAQ,CAAC,KAAK,EAAE,MAAM,MAAM,CAAA;IAC5B,QAAQ,CAAC,QAAQ,EAAE,MAAM,IAAI,CAAA;CAC9B,GAAG,MAAM,IAAI,CA4Bb"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"midnight.test.d.ts","sourceRoot":"","sources":["../../src/hooks/midnight.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { IndexEntry } from "../worker/types";
|
|
2
|
+
/**
|
|
3
|
+
* The identity map (architecture doc "Server-mode identity map", here for both modes): every
|
|
4
|
+
* slice arrives as new objects — structured-cloned from the worker, or a fresh server page — so
|
|
5
|
+
* each entry whose fields are shallowly unchanged since the last slice keeps its previous object.
|
|
6
|
+
* Memoized cells compare the row by reference, so only rows that changed (or came into view)
|
|
7
|
+
* re-render. Returns the entries to use and the map for the next slice.
|
|
8
|
+
*/
|
|
9
|
+
export declare function stabilizeEntries<Row>(previous: ReadonlyMap<string, IndexEntry<Row>>, entries: readonly IndexEntry<Row>[]): {
|
|
10
|
+
entries: readonly IndexEntry<Row>[];
|
|
11
|
+
byKey: Map<string, IndexEntry<Row>>;
|
|
12
|
+
};
|
|
13
|
+
//# sourceMappingURL=stabilize.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stabilize.d.ts","sourceRoot":"","sources":["../../src/hooks/stabilize.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AA+BjD;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAClC,QAAQ,EAAE,WAAW,CAAC,MAAM,EAAE,UAAU,CAAC,GAAG,CAAC,CAAC,EAC9C,OAAO,EAAE,SAAS,UAAU,CAAC,GAAG,CAAC,EAAE,GAClC;IAAE,OAAO,EAAE,SAAS,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC;IAAC,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE,UAAU,CAAC,GAAG,CAAC,CAAC,CAAA;CAAE,CAU9E"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stabilize.test.d.ts","sourceRoot":"","sources":["../../src/hooks/stabilize.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { type PointerEvent as ReactPointerEvent, type RefObject } from "react";
|
|
2
|
+
import type { ColumnDrop } from "../store/column-state";
|
|
3
|
+
export type ColumnReorderOptions = {
|
|
4
|
+
readonly viewportRef: RefObject<HTMLDivElement | null>;
|
|
5
|
+
/** Follows the pointer during a drag, showing the column's header. */
|
|
6
|
+
readonly ghostRef: RefObject<HTMLDivElement | null>;
|
|
7
|
+
/** The insertion line, or — over a pin hot-zone — the highlighted pin band. */
|
|
8
|
+
readonly indicatorRef: RefObject<HTMLDivElement | null>;
|
|
9
|
+
readonly onDrop: (id: string, drop: ColumnDrop) => void;
|
|
10
|
+
};
|
|
11
|
+
export type DraggableColumn = {
|
|
12
|
+
readonly id: string;
|
|
13
|
+
readonly header: string;
|
|
14
|
+
readonly pinned: "left" | "right" | null;
|
|
15
|
+
readonly reorderable: boolean;
|
|
16
|
+
readonly pinnable: boolean;
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* Drag a column header to reorder it, or to either edge of the grid to pin it (architecture doc
|
|
20
|
+
* "Column reorder" / "Column pinning (drag to edge)"). Pointer events only, so mouse, touch, and pen
|
|
21
|
+
* share one path with no long-press. Nothing re-renders during the drag: the ghost and the
|
|
22
|
+
* indicator are moved through refs, and the layout is committed once, on release.
|
|
23
|
+
*
|
|
24
|
+
* Spread the returned handlers on each header cell; the cell needs `data-column-id` and
|
|
25
|
+
* `data-pinned` so drop targets can be found among the mounted headers.
|
|
26
|
+
*/
|
|
27
|
+
export declare function useColumnReorder({ viewportRef, ghostRef, indicatorRef, onDrop, }: ColumnReorderOptions): {
|
|
28
|
+
onPointerDown: (event: ReactPointerEvent<HTMLElement>, column: DraggableColumn) => void;
|
|
29
|
+
onPointerMove: (event: ReactPointerEvent<HTMLElement>) => void;
|
|
30
|
+
onPointerUp: (event: ReactPointerEvent<HTMLElement>) => void;
|
|
31
|
+
onPointerCancel: () => void;
|
|
32
|
+
};
|
|
33
|
+
//# sourceMappingURL=use-column-reorder.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-column-reorder.d.ts","sourceRoot":"","sources":["../../src/hooks/use-column-reorder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAU,KAAK,YAAY,IAAI,iBAAiB,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAA;AAEtF,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAA;AAOvD,MAAM,MAAM,oBAAoB,GAAG;IACjC,QAAQ,CAAC,WAAW,EAAE,SAAS,CAAC,cAAc,GAAG,IAAI,CAAC,CAAA;IACtD,sEAAsE;IACtE,QAAQ,CAAC,QAAQ,EAAE,SAAS,CAAC,cAAc,GAAG,IAAI,CAAC,CAAA;IACnD,+EAA+E;IAC/E,QAAQ,CAAC,YAAY,EAAE,SAAS,CAAC,cAAc,GAAG,IAAI,CAAC,CAAA;IACvD,QAAQ,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,UAAU,KAAK,IAAI,CAAA;CACxD,CAAA;AAED,MAAM,MAAM,eAAe,GAAG;IAC5B,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAA;IACnB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;IACvB,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,GAAG,IAAI,CAAA;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