import { o as ColumnDef } from "./types-Cqk1_BXq.js"; import { CSSProperties, ReactNode } from "react"; //#region src/columns/headerGroups.d.ts /** Pixel lock for a collapsed arrow stub — chevron only, no leftover strip. */ declare const COLUMN_GROUP_STUB_WIDTH = 36; /** Path separator inside a column-group id — labels may contain `/`. */ declare const COLUMN_GROUP_ID_SEP = "\u001F"; /** Synthetic leaf shown when a collapsed group has no summary column. */ declare const COLUMN_GROUP_STUB_PREFIX = "__groupStub:"; /** Synthetic leaf shown when a collapsed group uses `collapsedRender`. */ declare const COLUMN_GROUP_RENDER_PREFIX = "__groupRender:"; /** True when this key is a collapsed-group arrow stub. */ declare function isColumnGroupStubKey(key: string): boolean; /** True when this key is a collapsed-group `collapsedRender` column. */ declare function isColumnGroupRenderKey(key: string): boolean; /** True when this key is a stub or `collapsedRender` summary leaf. */ declare function isColumnGroupSummaryKey(key: string): boolean; /** * Inset hairline under a group title that still has child headers below. * Stops Assignment and Delivery sharing one stroke across the gap. */ declare function groupedHeaderChildRule(hairline: string): { readonly borderBottom: string; readonly backgroundImage: string; readonly backgroundPosition: string; readonly backgroundRepeat: string; readonly backgroundSize: string; }; /** One cell of a group header row. */ interface HeaderGroupCell { /** Stable key for React lists. */ key: string; /** Group label, or `null` for the gap over ungrouped columns. */ label: string | null; /** How many leaf columns this cell spans. */ span: number; /** * Stable id of this group (`path.join(COLUMN_GROUP_ID_SEP)`). * `null` on a gap cell. */ id: string | null; /** True when this group is collapsed. */ collapsed: boolean; /** True when the host armed collapse and this cell is a real group. */ collapsible: boolean; /** * Hide the visible caption (collapsed arrow stub). The name stays on * the toggle's accessible label. */ hideLabel: boolean; /** * Header alignment. Omit and {@link groupedHeaderAlign} uses `"center"`, * the previous hardcoded value. */ align?: GroupedHeaderAlign; } /** Alignment of a spanning group header. */ type GroupedHeaderAlign = "start" | "center" | "end"; /** * Size lock for a collapsed arrow-stub column. `width` alone is a hint in * auto table layout; min + max stop the table from stretching the blank * strip to a data-column width. */ declare function columnGroupStubStyle(): CSSProperties; /** * Alignment for a group header. Omit / unknown → `"center"`, so existing * tables keep the hardcoded look; pass `"start"` or `"end"` to opt out. */ declare function groupedHeaderAlign(align?: GroupedHeaderAlign): GroupedHeaderAlign; /** * Cluster for the collapse chevron + group title. A one-child group is only * as wide as that leaf, so without this the button wraps onto the line above * the caption — worst when every neighbor is also collapsed. */ declare function groupedHeaderLabelStyle(): CSSProperties; /** * Style on one HTML group header cell: inset hairline while children sit * below, and the stub lock when the caption is hidden. */ declare function groupedHeaderCellStyle(cell: Readonly<{ rowSpan: number; cell: HeaderGroupCell; }>, hairline: string): CSSProperties; /** `column.group` as a root-to-leaf path. A string is one level. */ declare function columnGroupPath(column: Pick, "group">): readonly string[]; /** Stable id for a group path. */ declare function columnGroupId(path: readonly string[]): string; /** Add or drop a group id in the collapsed set. */ declare function toggleCollapsedColumnGroup(collapsedIds: readonly string[], id: string): string[]; /** * Every group-header row, top level first. Returns `null` when no visible * column declares a group. Contiguous same-path cells merge; a reorder that * breaks adjacency splits the group rather than teleporting it. */ declare function headerGroupRows(columns: readonly ColumnDef[], collapsedIds?: readonly string[], collapsible?: boolean, groups?: ReadonlyMap): HeaderGroupCell[][] | null; /** * The top group-header row. `null` when no visible column declares a group. * Groups are adjacency-based — if the user reorders columns apart, the * group SPLITS rather than lying about the layout. */ declare function headerGroupRow(columns: readonly ColumnDef[]): HeaderGroupCell[] | null; /** Visible group caption; `null` when the collapsed stub hides the name. */ declare function columnGroupHeaderCaption(cell: HeaderGroupCell): string | null; /** * One cell in {@link htmlGroupedHeaderPlan}. Group cells span children * horizontally; leaf cells rowspan through the group band so an ungrouped * Person sits beside Delivery and its children — Ant's nested header, on * an HTML table. A collapsed `collapsedRender` / stub group rowspans the * same way: no second header row, no line under the title. `collapsedKey` * keeps the child header, so that group stays two rows. */ type HtmlGroupedHeaderCell = { readonly kind: "group"; readonly key: string; readonly colSpan: number; readonly rowSpan: number; readonly cell: HeaderGroupCell; } | { readonly kind: "leaf"; readonly key: string; readonly columnIndex: number; readonly rowSpan: number; }; /** * Header rows for HTML-table kits. `null` when no column declares a group. * Ant folds the same model into native `children`; this plan is that tree * flattened into `rowSpan` / `colSpan` so Mantine, MUI, and the rest match. */ declare function htmlGroupedHeaderPlan(columns: readonly ColumnDef[], collapsedIds?: readonly string[], collapsible?: boolean, groups?: ReadonlyMap): HtmlGroupedHeaderCell[][] | null; //#endregion //#region src/columns/columnTree.d.ts /** * A parent header with its own children. Collapse options live here, not * on the table: each group decides whether a collapsed state is an arrow * stub, a kept child, or a cell the host draws. */ interface ColumnGroupDef { /** Caption on the spanning header cell, and the group's id. */ readonly header: string; /** Nested groups or leaf columns. */ readonly children: readonly ColumnInput[]; /** * Leaf `key` to keep when this group is collapsed. Omit with * {@link ColumnGroupDef.collapsedRender} omitted for an arrow stub. */ readonly collapsedKey?: string; /** * Cell shown for every row while this group is collapsed. Takes * precedence over {@link ColumnGroupDef.collapsedKey}. */ readonly collapsedRender?: (row: TRow) => ReactNode; /** * Keep these children adjacent through reorder. Default `true` for a * tree group; the flat `column.group` shortcut still splits on drag. */ readonly marryChildren?: boolean; /** Native tooltip on the group header, when set. */ readonly headerTooltip?: string; /** * Alignment of this group's spanning header. Default `"center"` — the * value adapters used when this was hardcoded. Pass `"start"` or `"end"` * to opt out. */ readonly align?: GroupedHeaderAlign; } /** A leaf {@link ColumnDef} or a {@link ColumnGroupDef} parent. */ type ColumnInput = ColumnDef | ColumnGroupDef; /** Collapse policy recorded for one parent while flattening a tree. */ interface ColumnGroupRecord { readonly id: string; readonly label: string; readonly collapsedKey?: string; readonly collapsedRender?: (row: TRow) => ReactNode; readonly marryChildren: boolean; readonly headerTooltip?: string; readonly align?: GroupedHeaderAlign; readonly childKeys: readonly string[]; } /** True when this column input is a parent with children. */ declare function isColumnGroup(column: ColumnInput): column is ColumnGroupDef; /** * Flatten a mixed column tree into leaves. Tree parents become `group` * paths on those leaves; collapse options are in {@link FlattenedColumns.groups}. */ declare function flattenColumnTree(columns: readonly ColumnInput[]): FlattenedColumns; /** Leaves plus the parent records {@link flattenColumnTree} collected. */ interface FlattenedColumns { readonly leaves: ColumnDef[]; readonly groups: ReadonlyMap>; } /** * Hide leaves under collapsed groups according to each parent's options. * * Default (no `collapsedKey`, no `collapsedRender`, no `groupShow: "closed"` * child): a thin stub column. `collapsedRender` wins over `collapsedKey`. */ declare function applyCollapsedColumnGroups(columns: readonly ColumnDef[], collapsedIds: readonly string[], groups?: ReadonlyMap>): readonly ColumnDef[]; /** * True when `nextOrder` still keeps every married group's children in one * contiguous block. Used to reject a reorder that would split a tree group. */ declare function marriedOrderHolds(nextOrder: readonly string[], groups: ReadonlyMap>): boolean; //#endregion //#region src/columns/useColumnLayout.d.ts /** Edge a column can be pinned to — logical, so it follows the writing * direction (`"start"` is the right edge under `dir="rtl"`). */ type PinSide = "start" | "end"; /** * User-driven column layout: which columns are hidden, their order, pinning, * and widths. Keyed by column `key`. Empty `order` means "declared order". */ interface ColumnLayoutState { /** Column keys hidden by the user. */ hidden: readonly string[]; /** Explicit column order by key; empty falls back to declared order. */ order: readonly string[]; /** Per-column edge pinning. */ pinned: Readonly>; /** Per-column pixel widths. */ widths: Readonly>; /** Collapsed column-group ids. Omit or empty — every group is open. */ collapsedGroups?: readonly string[]; } /** Options for {@link useColumnLayout}. */ interface UseColumnLayoutOptions { /** All declared columns (already filtered for the current device layout). */ columns: readonly ColumnDef[]; /** Controlled layout state. Omit for uncontrolled (internal) state. */ layout?: ColumnLayoutState; /** Change handler; required for the controlled mode to update. */ onLayoutChange?: (next: ColumnLayoutState) => void; /** Initial layout for the uncontrolled mode. */ defaultColumnLayout?: Partial; /** * When true, `visibleColumns` hides leaves under a collapsed group * according to that group's collapse options. Omit and collapse is inert. */ collapsibleColumnGroups?: boolean; /** Tree-group collapse options from {@link flattenColumnTree}. */ columnGroups?: ReadonlyMap>; } /** Result of {@link useColumnLayout}. */ interface UseColumnLayoutResult { /** The current layout state (controlled value or internal). */ state: ColumnLayoutState; /** Declared columns reordered then filtered by the user's hidden set. */ visibleColumns: ColumnDef[]; /** Whether a column key is currently hidden. */ isHidden: (key: string) => boolean; /** Show/hide a single column. */ setHidden: (key: string, hidden: boolean) => void; /** Toggle a single column's visibility. */ toggleVisible: (key: string) => void; /** Pin a column to an edge, or unpin it with `undefined`. */ setPinned: (key: string, side: PinSide | undefined) => void; /** Move a column to a new index among the visible columns. */ move: (key: string, toIndex: number) => void; /** Set (or clear, with `undefined`) a column's pixel width. */ setWidth: (key: string, width: number | undefined) => void; /** Sticky inset (px) for a pinned column, by side. `undefined` if unpinned. */ pinOffset: (key: string) => PinOffset | undefined; /** Restore the empty layout (all visible, declared order). */ reset: () => void; /** Collapse or expand a column group by id. No-op unless collapse is armed. */ toggleColumnGroup: (id: string) => void; } /** A pinned column's side plus its sticky inset in px. */ interface PinOffset { side: PinSide; inset: number; } /** * Minimal sticky-positioning style for a pinned cell, from a pin offset. * Uses logical inset properties so pinning follows the writing direction: * a `"start"`-pinned column sticks to the inline START (the right edge under * `dir="rtl"`), matching antd's native `fixed` behaviour. */ interface PinnedCellStyle { position: "sticky"; insetInlineStart?: number; insetInlineEnd?: number; zIndex: number; } /** * Stacking order for sticky table cells, lowest → highest. A pinned body cell * must sit above plain scrolled cells; a sticky header above all body cells; * and a pinned header (the corner) above everything — otherwise a pinned * column's body cells paint over the sticky header on vertical scroll, and * later headers paint over a pinned header on horizontal scroll. */ declare const PIN_Z: { readonly body: 1; /** Sticky pinned rows — above scrolled body, below the header. */ readonly rowPinned: 2; /** A pinned column cell inside a pinned row. */ readonly rowPinnedColumn: 3; readonly header: 4; readonly headerPinned: 5; }; /** * Extra inset (px) the leading selection column / trailing actions column add * in front of the pinned data columns, so a start-pinned column sits just after * a pinned checkbox and an end-pinned column just before pinned actions. */ interface PinLeads { start?: number; end?: number; } /** * Build the sticky style for a pinned header/body cell from its pin offset. * Adapters spread this onto the cell and add their own opaque background. * `leads` shifts the cell past a pinned selection/actions edge column. Returns * undefined for an unpinned cell. The inset is logical (`insetInlineStart` / * `insetInlineEnd`), so the same style pins to the correct edge in RTL. */ declare function pinnedCellStyle(offset: PinOffset | undefined, zIndex?: number, leads?: PinLeads): PinnedCellStyle | undefined; /** * Sticky style for a leading/trailing non-data column (the selection checkbox * at the inline start, row actions at the inline end) so it pins flush to the * edge whenever a data column on that side is pinned. `active` is false when * nothing on that side is pinned, in which case the column stays in normal * flow. Insets are logical, so the edge follows the writing direction. */ declare function edgePinStyle(side: PinSide, active: boolean, zIndex?: number): PinnedCellStyle | undefined; /** * Headless column-layout state. Uncontrolled by default; pass `layout` + * `onLayoutChange` to control it (and persist however you like — localStorage, * URL, server). Returns the reordered, visibility-filtered columns to render. * * @typeParam TRow - The row type. */ declare function useColumnLayout({ columns, layout, onLayoutChange, defaultColumnLayout, collapsibleColumnGroups, columnGroups }: UseColumnLayoutOptions): UseColumnLayoutResult; //#endregion //#region src/rows/cellSpan.d.ts /** What {@link GetCellSpan} may return. Omitted sides default to 1. */ interface CellSpanRequest { colSpan?: number; rowSpan?: number; } /** Arguments {@link GetCellSpan} receives for one origin. */ interface GetCellSpanArgs { row: TRow; column: ColumnDef; /** Dataset-relative row index (page offset included). */ rowIndex: number; /** Index in the full visible column list. */ columnIndex: number; /** * Rows in visual body order (pinned top, then scroll, then pinned * bottom). Walk this list for a consecutive merge so pinning a teammate * does not split one Team run into two cells. */ sectionRows: readonly TRow[]; /** Index of `row` in {@link GetCellSpanArgs.sectionRows}. */ sectionRowIndex: number; } /** Host callback that decides a cell's span. */ type GetCellSpan = (args: GetCellSpanArgs) => CellSpanRequest | undefined; /** * How a spanned cell is painted. `"merged"` (the default) is the spreadsheet * look: centered content, one fill across the span. `"plain"` is geometry * only — same chrome as a 1×1 cell — so a host can draw a calendar bar * themselves. */ type CellSpanAppearance = "merged" | "plain"; /** `"2x1"` when this cell owns more than one slot; otherwise nothing. */ declare function cellSpanMark(colSpan: number, rowSpan: number): string | undefined; /** One body cell a kit renders — covered cells never appear. */ interface BodyCell { column: ColumnDef; /** Index in the full visible column list — what focus addresses. */ columnIndex: number; colSpan: number; rowSpan: number; } /** True when any origin cell is taller than one row. */ declare function bodyCellsHaveRowSpan(cellsByRow: ReadonlyMap): boolean; /** True when the host asked for any span. */ declare function spanningArmed(columns: readonly ColumnDef[], getCellSpan: GetCellSpan | undefined): boolean; /** * Per-row body cells for the visual body (pinned top, scroll, then pinned * bottom). A consecutive merge walks that whole list so pinning a teammate * does not split one Team run. HTML `rowSpan` still needs those rows in * one tbody. */ declare function buildBodyCells(options: { rows: readonly TRow[]; columns: readonly ColumnDef[]; getRowId: (row: TRow) => string; getCellSpan?: GetCellSpan; firstRowIndex?: number; pinOffset?: (key: string) => PinOffset | undefined; windowKeys?: ReadonlySet; }): ReadonlyMap[]>; /** Addresses (`row:col`, dataset-relative) covered by a span, not origins. */ declare function coveredAddressSet(options: { rows: readonly TRow[]; columns: readonly ColumnDef[]; getCellSpan?: GetCellSpan; firstRowIndex?: number; pinOffset?: (key: string) => PinOffset | undefined; }): ReadonlySet; /** Memo digest so a virtualized row repaints when its spans change. */ declare function rowSpanSignature(cells: readonly BodyCell[] | undefined): string; /** Look up a row's cells; empty when the row is unknown. */ declare function cellsForRow(cellsByRow: ReadonlyMap[]> | undefined, rowKey: string): readonly BodyCell[]; //#endregion //#region src/export/exportWriter.d.ts /** * What a structured export row is: a data leaf, a group header, or a * total. CSV ignores the distinction; a spreadsheet uses it for outline * levels and for which rows are bold. */ type ExportRowRole = "data" | "group" | "aggregate"; /** Per-row structure a writer may honour. Aligned with {@link ExportTable.rows}. */ interface ExportRowMeta { /** What this row is. */ role: ExportRowRole; /** Outline depth from zero — group headers sit at their grouping level. */ level: number; } /** * One row of a grouped or tree-shaped export, before values are resolved. * * A flat table never produces these. When they are present the file follows * the view the reader can see — headers, leaves, footers — instead of a * denormalised leaf list. */ type ExportViewEntry = { role: "data"; row: TRow; level: number; } | { role: "group" | "aggregate"; label: string; level: number; /** Column that receives the label when that cell would otherwise be empty. */ labelKey?: string; values?: Readonly>>; }; /** * An export after the scopes are applied and the cells are resolved: headers, * keys, and one row of values per exported row. */ interface ExportTable { /** Column headings, in file order. */ headers: readonly string[]; /** Column keys, in the same order — for a format that names its fields. */ keys: readonly string[]; /** One array of values per row, aligned to `headers`. */ rows: readonly (readonly unknown[])[]; /** * Structure for each row, when the export is a grouped or tree view. * Absent on a flat table, so existing writers keep seeing exactly what * they always did. */ rowMeta?: readonly ExportRowMeta[]; /** * Suggested character widths, aligned to `headers`. A column that did not * state a width is `undefined` and the writer picks its own default. */ widths?: readonly (number | undefined)[]; } /** What a writer is given: the resolved export, exactly as it will ship. */ interface ExportWriteContext { /** The values to write. */ table: ExportTable; /** The filename the file will be given — for a writer that embeds a title. */ filename: string; /** The CSV formula-injection guard; formats without the flaw ignore it. */ escapeFormulas?: boolean; } /** A built file, ready to hand to the browser. */ interface ExportPayload { /** The content, in the pieces a `Blob` takes. */ parts: readonly BlobPart[]; /** MIME type for the download. */ mimeType: string; /** * The file as text, for `onAfterExport` and for hosts that keep a copy. * Binary formats leave this empty — their bytes are in `parts`. */ text: string; } /** A file format the export button can produce. */ interface ExportWriter { /** Extension used when no filename was given, e.g. `"xlsx"`. */ extension: string; /** Build the file from the resolved values. */ build: (context: ExportWriteContext) => ExportPayload; } /** * Resolve rows and columns into the values a file carries. * * Values keep their type — a number stays a number — because a format that can * express one should say so, and text is a lossy last resort rather than the * only option. * * @typeParam TRow - The row type. * @param rows - The rows a scope resolved to, in table order. * @param columns - The columns a scope resolved to, in file order. * @returns The resolved table a writer receives. */ declare function buildExportTable(rows: readonly TRow[], columns: readonly ColumnDef[], span?: { getCellSpan?: GetCellSpan; firstRowIndex?: number; view?: readonly ExportViewEntry[]; summary?: Readonly>>; }): ExportTable; /** * The built-in writer: comma-separated text, UTF-8 with a BOM so Excel opens * unicode correctly. This is what the export button uses when no writer is * given. */ declare const csvWriter: ExportWriter; /** * Hand a built file to the browser. No-op outside it, so a server render that * reaches this does nothing rather than throwing. * * @param filename - Download name, e.g. `"people.xlsx"`. * @param payload - The file from {@link ExportWriter.build}. */ declare function downloadExportFile(filename: string, payload: ExportPayload): void; //#endregion export { groupedHeaderCellStyle as $, UseColumnLayoutResult as A, isColumnGroup as B, ColumnLayoutState as C, PinSide as D, PinOffset as E, ColumnGroupRecord as F, COLUMN_GROUP_STUB_WIDTH as G, COLUMN_GROUP_ID_SEP as H, ColumnInput as I, columnGroupHeaderCaption as J, HeaderGroupCell as K, FlattenedColumns as L, pinnedCellStyle as M, useColumnLayout as N, PinnedCellStyle as O, ColumnGroupDef as P, groupedHeaderAlign as Q, applyCollapsedColumnGroups as R, spanningArmed as S, PinLeads as T, COLUMN_GROUP_RENDER_PREFIX as U, marriedOrderHolds as V, COLUMN_GROUP_STUB_PREFIX as W, columnGroupPath as X, columnGroupId as Y, columnGroupStubStyle as Z, buildBodyCells as _, ExportViewEntry as a, isColumnGroupRenderKey as at, coveredAddressSet as b, buildExportTable as c, toggleCollapsedColumnGroup as ct, BodyCell as d, groupedHeaderChildRule as et, CellSpanAppearance as f, bodyCellsHaveRowSpan as g, GetCellSpanArgs as h, ExportTable as i, htmlGroupedHeaderPlan as it, edgePinStyle as j, UseColumnLayoutOptions as k, csvWriter as l, GetCellSpan as m, ExportRowMeta as n, headerGroupRow as nt, ExportWriteContext as o, isColumnGroupStubKey as ot, CellSpanRequest as p, HtmlGroupedHeaderCell as q, ExportRowRole as r, headerGroupRows as rt, ExportWriter as s, isColumnGroupSummaryKey as st, ExportPayload as t, groupedHeaderLabelStyle as tt, downloadExportFile as u, cellSpanMark as v, PIN_Z as w, rowSpanSignature as x, cellsForRow as y, flattenColumnTree as z }; //# sourceMappingURL=exportWriter-VdWUamzf.d.ts.map