{"version":3,"file":"forty-cdk-table.mjs","sources":["../../../projects/forty-cdk/table/src/flat-hierarchy.ts","../../../projects/forty-cdk/table/src/table-context.ts","../../../projects/forty-cdk/table/src/table-registry.ts","../../../projects/forty-cdk/table/src/selection-model.ts","../../../projects/forty-cdk/table/src/table-row-selection.ts","../../../projects/forty-cdk/table/src/table-expansion.ts","../../../projects/forty-cdk/table/src/table.ts","../../../projects/forty-cdk/table/src/def-registry.ts","../../../projects/forty-cdk/table/src/column-def.ts","../../../projects/forty-cdk/table/src/row-def.ts","../../../projects/forty-cdk/table/src/interactive-descendant.ts","../../../projects/forty-cdk/table/src/table-cell.ts","../../../projects/forty-cdk/table/src/table-column-reorder.ts","../../../projects/forty-cdk/table/src/table-header-cell.ts","../../../projects/forty-cdk/table/src/table-column-resizer.ts","../../../projects/forty-cdk/table/src/table-header-row.ts","../../../projects/forty-cdk/table/src/table-row.ts","../../../projects/forty-cdk/table/src/table-row-attrs.ts","../../../projects/forty-cdk/table/src/table-sort-header.ts","../../../projects/forty-cdk/table/src/table-body.ts","../../../projects/forty-cdk/table/src/table-row-selector.ts","../../../projects/forty-cdk/table/src/table-select-all.ts","../../../projects/forty-cdk/table/src/table-column-label.ts","../../../projects/forty-cdk/table/src/table-row-reorder.ts","../../../projects/forty-cdk/table/src/forty-cdk-table.ts"],"sourcesContent":["/**\n * Computes `aria-posinset` / `aria-setsize` for every node in a **flat** list of\n * hierarchical rows, where depth is given only by each node's 1-based `level`\n * (as in an ARIA treegrid: rows are DOM siblings, hierarchy lives in `aria-level`).\n *\n * For a node at level `L`, its siblings are the nodes at the same level under the\n * same parent: contiguous `level === L` entries, skipping any deeper descendants\n * between them and bounded by the first shallower (`level < L`) entry on each side.\n *\n * Returns one `{ posinset, setsize }` entry per input level, in the same order.\n * Both are 1-based. An empty input returns an empty array.\n */\nexport function computeFlatHierarchy(\n  levels: readonly number[],\n): { posinset: number; setsize: number }[] {\n  const result: { posinset: number; setsize: number }[] = new Array(levels.length);\n  const stack: { level: number; members: number[] }[] = [];\n\n  const close = (group: { level: number; members: number[] }): void => {\n    const setsize = group.members.length;\n    for (const i of group.members) {\n      result[i]!.setsize = setsize;\n    }\n  };\n\n  for (let index = 0; index < levels.length; index++) {\n    const level = levels[index]!;\n    while (stack.length > 0 && stack[stack.length - 1]!.level > level) {\n      close(stack.pop()!);\n    }\n    const top = stack[stack.length - 1];\n    if (top && top.level === level) {\n      top.members.push(index);\n      result[index] = { posinset: top.members.length, setsize: 0 };\n    } else {\n      stack.push({ level, members: [index] });\n      result[index] = { posinset: 1, setsize: 0 };\n    }\n  }\n\n  while (stack.length > 0) {\n    close(stack.pop()!);\n  }\n\n  return result;\n}\n","import { booleanAttribute, inject, InjectionToken, isDevMode, type Signal } from '@angular/core';\n\nimport {\n  assertRootContext,\n  fortyError,\n  orphanContextError,\n  TABLE_REGISTRATION_CONTEXT,\n  TABLE_ROW_REGISTRATION_CONTEXT,\n  type TableRegistrationContext,\n  type TableRowRegistrationContext,\n  type WritingDirection,\n} from 'forty-cdk/core';\n\n/** ARIA pattern the table renders as. `'table'` is the static structure; `'grid'` / `'treegrid'` add roving + 2D keyboard navigation. */\nexport type TableMode = 'table' | 'grid' | 'treegrid';\n\n/** Row-selection mode for `ForTable`. `'none'` disables selection. */\nexport type TableSelectionMode = 'none' | 'single' | 'multiple';\n\n/** How a row click mutates selection. `'toggle'` flips it; `'replace'` replaces (modifier-aware). */\nexport type TableSelectionBehavior = 'toggle' | 'replace';\n\n/** Aggregate selection state across the table's selectable rows, for the select-all tri-state. */\nexport type TableSelectAllState = 'none' | 'some' | 'all';\n\n/** Sticky placement for a cell: pinned to the start edge (`true`), the end edge (`'end'`), or not sticky (`false`). */\nexport type TableStickyValue = boolean | 'end';\n\n/**\n * Consumer-facing coordination surface owned by `ForTable`: the resolved ARIA\n * mode / direction / selection mode, the row counts, and the selection /\n * expansion commands.\n *\n * It carries neither the piece-registration protocol nor the\n * roving-grid model: how header rows, header cells, data rows, the declarative\n * body's row count, the virtualization seams and the resized column widths wire\n * themselves into the root, and where the grid's single tab stop currently\n * sits, are the library's own business and change without notice.\n */\nexport interface ForTableContext {\n  /** The resolved ARIA mode; cells derive `role` (`cell` vs `gridcell`) from it, and navigation engages when it is not `'table'`. */\n  readonly mode: Signal<TableMode>;\n  /** The resolved writing direction (flips ArrowLeft / ArrowRight in `rtl`). */\n  readonly dir: Signal<WritingDirection>;\n  /** The active row-selection mode. `'none'` means selection is disabled. */\n  readonly selectionMode: Signal<TableSelectionMode>;\n  /** Returns whether `value` is currently in the selection. */\n  isRowSelected(value: unknown): boolean;\n  /** Toggles `value` in or out of the selection, respecting `selectionMode`. No-op in `'none'` mode. */\n  toggleRowSelection(value: unknown): void;\n  /**\n   * Applies a row selection click with optional modifier keys, honoring `selectionBehavior`:\n   * `'toggle'` always flips; `'replace'` replaces (Ctrl/Cmd toggles a single item,\n   * Shift extends a range in multiple mode).\n   */\n  selectRow(\n    value: unknown,\n    modifiers?: { ctrlKey?: boolean; metaKey?: boolean; shiftKey?: boolean },\n  ): void;\n  /** Aggregate selection state across all selectable rows (`'none'` / `'some'` / `'all'`). */\n  readonly selectAllState: Signal<TableSelectAllState>;\n  /** Selects all selectable rows when not all are selected; clears when all are. No-op outside `'multiple'` mode. */\n  toggleSelectAll(): void;\n  /**\n   * The resolved true total data-row count for `aria-rowcount` and the virtualized\n   * scroll range, in resolution order: the explicit `[rowCount]` input when set,\n   * else the declarative `<for-table-body>`'s dataset length when a body has\n   * registered one, else `undefined` (readers fall back to the rendered row count).\n   */\n  readonly rowCount: Signal<number | undefined>;\n  /**\n   * The count of currently loaded data rows (the declarative `<for-table-body>`\n   * dataset length), or `undefined` when no body has registered one (raw-primitive\n   * rendering). Distinct from `rowCount`, which an explicit `[rowCount]` raises to a\n   * server-known total larger than the loaded rows; cross-window navigation clamps\n   * unmounted targets to this so a target beyond the loaded prefix cannot stash a\n   * pending focus move that resolves only when a far page later loads.\n   */\n  readonly loadedRowCount: Signal<number | undefined>;\n  /**\n   * Absolute index of the row that owns the currently roving-focused cell, or `null`\n   * when no cell is focused (or the focused row carries no `virtualIndex`). Read by\n   * `[forTableVirtualized]` to keep the focused row mounted across recycling.\n   */\n  readonly focusedRowIndex: Signal<number | null>;\n  /** Whether `value` is in the open-rows set (`treegrid` expansion). */\n  isRowExpanded(value: unknown): boolean;\n  /** Toggles a parent row's expansion in/out of `[(expanded)]`. No-op when value is undefined. */\n  toggleRowExpansion(value: unknown): void;\n}\n\n/**\n * The table's piece-coordination surface: the 2D roving grid model the rows,\n * cells and header cells resolve their `tabindex` / `data-highlighted` /\n * keydown through, and the ARIA index arithmetic derived from it.\n *\n * **Not** part of {@link ForTableContext} and never exported from\n * `public-api.ts`. A consumer reads the selection and expansion state off the\n * token; where the grid's single tab stop currently sits is the library's own\n * navigation model, refactored without notice.\n */\nexport interface TablePieceContext {\n  /**\n   * 1-based `aria-rowindex` for the header row in `grid` / `treegrid` mode (always\n   * `1`, since ARIA counts the header row as the grid's first row), or `null` in\n   * `mode=\"table\"` where no row index space exists.\n   */\n  readonly headerRowIndex: Signal<number | null>;\n  /**\n   * Offset ARIA adds to every data row's 1-based `aria-rowindex` so the numbering\n   * counts the header row: `1` when a header row participates in the row-index\n   * space (`grid` / `treegrid` mode with a registered header row), else `0`.\n   */\n  readonly dataRowIndexOffset: Signal<number>;\n  /** Roving `tabindex` (`0` for the single tab stop, `-1` otherwise) for a header cell in grid mode. */\n  headerCellTabIndex(host: HTMLElement): 0 | -1;\n  /** 0-based index of a header cell host among registered header cells in DOM order, or -1 if not registered. */\n  headerCellIndexOf(host: HTMLElement): number;\n  /**\n   * Whether the registered header cells form a complete row that joins the body's\n   * roving composite grid (`grid` / `treegrid` mode, header cell count matches the\n   * data column count). Draggable header cells (`[forTableColumnReorder]`) participate\n   * too, so a column-reorderable grid stays a single composite tab stop. `false` in\n   * `table` mode or when no header cells registered.\n   */\n  readonly headerParticipatesInRoving: Signal<boolean>;\n  /** 0-based index of a data row host in DOM order, or -1 if not registered. */\n  rowIndexOf(host: HTMLElement): number;\n  /** Roving `tabindex` (`0` for the single tab stop, `-1` otherwise) for a data cell in grid mode. */\n  cellTabIndex(host: HTMLElement): 0 | -1;\n  /** Whether a data cell is the currently roving-focused cell (drives `data-highlighted`). */\n  isCellHighlighted(host: HTMLElement): boolean;\n  /** Promotes a data cell to the active roving cell (called on the cell's `(focus)`). */\n  activateCell(host: HTMLElement): void;\n  /** Resolves and applies a keydown originating on a data cell: 2D move + focus. */\n  handleCellKeydown(event: KeyboardEvent, host: HTMLElement): void;\n  /**\n   * Resolves grid navigation for a header cell that yields its host interaction to a\n   * co-located `[forDraggable]`. `[forTableColumnReorder]` calls this from a\n   * capture-phase listener for idle header cells so Arrow / Home / End / Page keys move\n   * roving focus across the composite header + body grid, while Space / Enter fall\n   * through to the draggable's lift. Returns `true` when the key was consumed as a grid\n   * action, `false` otherwise (including outside a participating `grid` / `treegrid`).\n   */\n  handleHeaderCellKeydown(event: KeyboardEvent, host: HTMLElement): boolean;\n  /** 1-based `aria-posinset` for a row host among its same-level siblings (treegrid). */\n  rowPosinset(host: HTMLElement): number;\n  /** Total `aria-setsize` of a row host's same-level sibling set (treegrid). */\n  rowSetsize(host: HTMLElement): number;\n}\n\n/**\n * The table's internal coordination surface: everything {@link ForTableContext}\n * publishes plus the {@link TablePieceContext} grid model.\n *\n * Never exported from `public-api.ts`. It is the type the pieces read\n * {@link FOR_TABLE_CONTEXT} at, so a consumer who injects that token gets the\n * read surface while the pieces get the navigation model. `ForTable` declares\n * those members TS-`private`, which keeps them out of the emitted `.d.ts` while\n * `useExisting` still satisfies this contract at runtime.\n *\n * Distinct from the **piece-registration** protocol, which is the one surface\n * that genuinely needs a second token: it lives in `forty-cdk/core` because\n * `forty-cdk/table-virtualization` registers through it.\n */\nexport interface TableContext extends ForTableContext, TablePieceContext {}\n\n/**\n * DI token for the table's coordination surface, provided by `[forTable]`.\n *\n * Publicly typed as the read surface {@link ForTableContext}, which is the whole of what\n * the token promises a consumer. The pieces read the same token at an internal type that\n * adds the roving grid model, so a wrapper re-providing it must alias it to the root:\n * `{ provide: FOR_TABLE_CONTEXT, useExisting: MyTable }`, where `MyTable` extends\n * `ForTable`. A value that merely satisfies the declared type resolves too, and is\n * rejected in dev mode by the first piece to reach the model.\n */\nexport const FOR_TABLE_CONTEXT = new InjectionToken<ForTableContext>('FOR_TABLE_CONTEXT');\n\n/**\n * Per-row read surface owned by `ForTableRow`, injected by its data cells. The\n * cell-registration half lives on {@link TableRowContext}, so no `register*`\n * member reaches `ForTableRow`'s emitted public type.\n */\nexport interface ForTableRowContext {\n  /** 0-based index of a cell host within this row in DOM order, or -1 if not registered. */\n  cellIndexOf(host: HTMLElement): number;\n  /** The active row-selection mode from the root table. */\n  readonly selectionMode: Signal<TableSelectionMode>;\n  /** Whether this row is currently selected. */\n  readonly selected: Signal<boolean>;\n  /** Toggles this row's selection. No-op when the row has no `[value]` or mode is `'none'`. */\n  toggleSelected(): void;\n}\n\nexport const FOR_TABLE_ROW_CONTEXT = new InjectionToken<ForTableRowContext>(\n  'FOR_TABLE_ROW_CONTEXT',\n);\n\n/**\n * Coerces the `sticky` input value for header and data cells.\n * The string `'end'` pins the cell to the end edge; any other truthy value\n * (including the empty string from a bare `sticky` attribute) pins it to the\n * start edge; a falsy value means not sticky.\n */\nexport function coerceSticky(value: boolean | string): TableStickyValue {\n  return value === 'end' ? 'end' : booleanAttribute(value);\n}\n\nconst COLUMN_NAME_PATTERN = /^[-_A-Za-z0-9]+$/;\n\n/**\n * Dev-mode guard for a column name before it is interpolated into CSS. Column\n * names flow into the `--for-table-col-<name>-width` custom property and the\n * `grid-template-columns` track string, where a space, `)`, `;`, or quote would\n * silently produce an invalid declaration and collapse the layout with no error.\n * Rejects any name outside letters, digits, hyphens, and underscores. No-op in\n * production builds.\n */\nexport function assertColumnName(name: string, piece: string): void {\n  if (isDevMode() && !COLUMN_NAME_PATTERN.test(name)) {\n    throw fortyError({\n      code: 'FORCDK-TABLE-007',\n      message: `Invalid column name ${JSON.stringify(name)} declared on ${piece}.`,\n      cause:\n        'Column names are interpolated into the --for-table-col-<name>-width custom property and ' +\n        'into grid-template-columns, where anything else silently produces an invalid ' +\n        'declaration and collapses the layout.',\n      fix: 'Use only letters, digits, hyphens, and underscores.',\n    });\n  }\n}\n\nconst TRACK_BREAKOUT_PATTERN = /[;{}\"']|\\/\\*/;\n\n/**\n * Dev-mode guard for a `grid-template-columns` track fragment before it is\n * interpolated into the derived track string. Unlike a column name a track\n * fragment has an open vocabulary (`minmax()`, `fit-content()`, `calc()`,\n * `clamp()`, `var()`), so this rejects only the shapes that **escape** the value\n * they are written into and collapse the whole track with no error: an empty\n * fragment (which contributes a missing entry and shifts every later column —\n * omit the input, or pass `null`, to mean \"unset\"), a `;` / `{` / `}` / quote /\n * `/*` that terminates the declaration, and unbalanced parentheses (a stray `)`\n * in a `fallbackWidth` closes its enclosing `var(` early and swallows the rest\n * of the track). No-op in production builds.\n */\nexport function assertColumnTrack(track: string, input: string, piece: string): void {\n  if (!isDevMode()) {\n    return;\n  }\n  const reason = columnTrackDefect(track);\n  if (reason) {\n    throw fortyError({\n      code: 'FORCDK-TABLE-008',\n      message: `Invalid ${input} ${JSON.stringify(track)} declared on ${piece}: ${reason}.`,\n      cause:\n        'A track fragment is interpolated into the grid-template-columns string ForTableBody ' +\n        'derives, where a fragment that escapes its slot collapses the whole track with no error.',\n      fix: 'Use a self-contained track value, or omit the input (or pass null) to leave it unset.',\n    });\n  }\n}\n\nfunction columnTrackDefect(track: string): string | null {\n  if (track.trim() === '') {\n    return 'the fragment is empty — omit the input (or pass null) to leave the track unset';\n  }\n  if (TRACK_BREAKOUT_PATTERN.test(track)) {\n    return 'it contains a \";\", \"{\", \"}\", quote, or \"/*\" that terminates the declaration';\n  }\n  let depth = 0;\n  for (const char of track) {\n    if (char === '(') {\n      depth++;\n    } else if (char === ')' && --depth < 0) {\n      return 'its parentheses are unbalanced';\n    }\n  }\n  return depth === 0 ? null : 'its parentheses are unbalanced';\n}\n\n/**\n * Whether a header-cell host carries a drag-drop reorder affordance\n * (`[forDraggable]` or `[forFreeDrag]`). Detected by DOM marker rather than a\n * value-import of the drag-drop context, so the sort header and header cell can\n * yield their roving `tabindex` to the draggable's own tab stop without a\n * cross-primitive value dependency (only consumers importing drag-drop bundle it).\n */\nexport function hostHasDraggable(el: HTMLElement): boolean {\n  return el.hasAttribute('forDraggable') || el.hasAttribute('forFreeDrag');\n}\n\n/**\n * Whether a header-cell host carries an active sort affordance — a\n * `[forTableSortHeader]` with `sortable` currently `true`, reflected as the\n * `data-sortable` marker. Detected by DOM marker rather than a value-import of\n * the sort header, so the grid cell-entry handler can defer `Enter` to the sort\n * activation (keeping focus on the cell) without a cross-piece value dependency.\n * A non-sortable header (no marker) keeps `Enter` as its cell-entry key.\n */\nexport function hostHasSortActivation(el: HTMLElement): boolean {\n  return el.hasAttribute('data-sortable');\n}\n\nexport function injectTableContext(piece: string): TableContext {\n  const ctx = inject(FOR_TABLE_CONTEXT, { optional: true });\n  if (!ctx) {\n    throw orphanContextError({\n      code: 'FORCDK-TABLE-009',\n      piece,\n      root: '[forTable]',\n      token: 'FOR_TABLE_CONTEXT',\n    });\n  }\n  const widened = ctx as TableContext;\n  assertRootContext({\n    entryPoint: 'table',\n    token: 'FOR_TABLE_CONTEXT',\n    root: '[forTable]',\n    piece,\n    probe: () => widened.cellTabIndex,\n  });\n  return widened;\n}\n\nexport function injectTableRegistration(piece: string): TableRegistrationContext {\n  const ctx = inject(TABLE_REGISTRATION_CONTEXT, { optional: true });\n  if (!ctx) {\n    throw orphanContextError({\n      code: 'FORCDK-TABLE-010',\n      piece,\n      root: '[forTable]',\n      token: 'TABLE_REGISTRATION_CONTEXT',\n    });\n  }\n  return ctx;\n}\n\nexport function injectTableRowRegistration(piece: string): TableRowRegistrationContext {\n  const ctx = inject(TABLE_ROW_REGISTRATION_CONTEXT, { optional: true });\n  if (!ctx) {\n    throw orphanContextError({\n      code: 'FORCDK-TABLE-011',\n      piece,\n      root: '[forTableRow]',\n      token: 'TABLE_ROW_REGISTRATION_CONTEXT',\n    });\n  }\n  return ctx;\n}\n\nexport function injectTableRowContext(piece: string): ForTableRowContext {\n  const ctx = inject(FOR_TABLE_ROW_CONTEXT, { optional: true });\n  if (!ctx) {\n    throw orphanContextError({\n      code: 'FORCDK-TABLE-012',\n      piece,\n      root: '[forTableRow]',\n      token: 'FOR_TABLE_ROW_CONTEXT',\n    });\n  }\n  return ctx;\n}\n","import { ElementRef, inject, Injectable, signal, type Signal } from '@angular/core';\n\nimport {\n  Collection,\n  type ForTableCellHandle,\n  type ForTableRowHandle,\n  type TableRegistrationContext,\n  type TableVirtualRowNavigation,\n  type TableVirtualWindow,\n} from 'forty-cdk/core';\n\n/**\n * Owns the table's piece-registration state — the header row element, the header\n * cell and data row collections, the declarative body's row count, the two\n * virtualization seams, the pointer-reordered row index, and the published\n * column-width custom properties.\n *\n * It exists as its own provider rather than as methods on `ForTable` so the\n * wiring protocol never reaches the public API: `ForTable` is exported, and any\n * `register*` / `set*` method on it would be callable (and therefore\n * semver-frozen) for consumers wrapping the root with `hostDirectives` or\n * subclassing it. Pieces reach it through `TABLE_REGISTRATION_CONTEXT`, which no\n * entry point exports; `ForTable` injects the class directly for the extra\n * lookup helpers it needs to derive its own read surface.\n */\n@Injectable()\nexport class TableRegistry implements TableRegistrationContext {\n  readonly #rootEl = inject<ElementRef<HTMLElement>>(ElementRef).nativeElement;\n\n  readonly #headerRowEl = signal<HTMLElement | null>(null);\n  readonly #headerCells = new Collection<ForTableCellHandle>();\n  readonly #rows = new Collection<ForTableRowHandle>();\n  readonly #bodyRowCount = signal<Signal<number> | null>(null);\n  readonly #virtualNav = signal<TableVirtualRowNavigation | null>(null);\n  readonly #virtualWindow = signal<TableVirtualWindow | null>(null);\n  readonly #reorderingRow = signal<number | null>(null);\n\n  /** The registered header row host, or `null` when no header row is mounted. */\n  readonly headerRowEl = this.#headerRowEl.asReadonly();\n\n  /** Registered header cells in DOM order. */\n  readonly headerCells = this.#headerCells.items;\n\n  /** Registered data rows in DOM order. */\n  readonly rows = this.#rows.items;\n\n  /** The declarative `<for-table-body>`'s dataset length, or `null` when none registered. */\n  readonly bodyRowCount = this.#bodyRowCount.asReadonly();\n\n  /** The registered cross-window row-navigation delegate, or `null` when not virtualized. */\n  readonly virtualRowNavigation = this.#virtualNav.asReadonly();\n\n  /** The registered rendered virtual window, or `null` when not virtualized. */\n  readonly virtualWindow = this.#virtualWindow.asReadonly();\n\n  /** Absolute index of the row currently being pointer-reordered, or `null`. */\n  readonly reorderingRowIndex = this.#reorderingRow.asReadonly();\n\n  /** Registers the header row's host so the root can measure its height. */\n  registerHeaderRow(el: HTMLElement): void {\n    this.#headerRowEl.set(el);\n  }\n\n  /** Unregisters the header row's host. Reference-based; safe to call if never registered. */\n  unregisterHeaderRow(el: HTMLElement): void {\n    if (this.#headerRowEl() === el) {\n      this.#headerRowEl.set(null);\n    }\n  }\n\n  /** Registers a header cell so it can join the composite roving-navigation grid. */\n  registerHeaderCell(handle: ForTableCellHandle): void {\n    this.#headerCells.register(handle);\n  }\n\n  /** Unregisters a header cell. Reference-based. */\n  unregisterHeaderCell(handle: ForTableCellHandle): void {\n    this.#headerCells.unregister(handle);\n  }\n\n  /** 0-based index of a header cell host among registered header cells, or -1. */\n  headerCellIndexOf(host: HTMLElement): number {\n    return this.#headerCells.indexOfHost(host);\n  }\n\n  /** Registers a data row so it joins the row index space and the navigation grid. */\n  registerRow(handle: ForTableRowHandle): void {\n    this.#rows.register(handle);\n  }\n\n  /** Unregisters a data row. Reference-based. */\n  unregisterRow(handle: ForTableRowHandle): void {\n    this.#rows.unregister(handle);\n  }\n\n  /** 0-based index of a data row host in DOM order, or -1 if not registered. */\n  rowIndexOf(host: HTMLElement): number {\n    return this.#rows.indexOfHost(host);\n  }\n\n  /** Registers (or clears, with `null`) the declarative body's dataset length. */\n  registerBodyRowCount(count: Signal<number> | null): void {\n    this.#bodyRowCount.set(count);\n  }\n\n  /** Registers (or clears, with `null`) the cross-window row-navigation delegate. */\n  registerVirtualNavigation(navigation: TableVirtualRowNavigation | null): void {\n    this.#virtualNav.set(navigation);\n  }\n\n  /** Registers (or clears, with `null`) the rendered virtual window. */\n  registerVirtualWindow(window: TableVirtualWindow | null): void {\n    this.#virtualWindow.set(window);\n  }\n\n  /** Sets (or clears, with `null`) the absolute index of the row being pointer-reordered. */\n  setReorderingRow(index: number | null): void {\n    this.#reorderingRow.set(index);\n  }\n\n  /** Publishes a column's resolved width as `--for-table-col-<column>-width` on the root. */\n  setColumnWidth(column: string, width: number): void {\n    this.#rootEl.style.setProperty(`--for-table-col-${column}-width`, `${width}px`);\n  }\n\n  /** Removes a column's published `--for-table-col-<column>-width` custom property. */\n  removeColumnWidth(column: string): void {\n    this.#rootEl.style.removeProperty(`--for-table-col-${column}-width`);\n  }\n}\n","import { isSignal, type Signal, signal, type WritableSignal } from '@angular/core';\n\n/** Options for {@link SelectionModel}. */\nexport interface SelectionModelOptions<T> {\n  /**\n   * Allow more than one selected value. `false` (default) is single-select:\n   * `select` / `setSelection` replace the prior value. Accepts a `Signal` so a\n   * consumer whose mode is reactive (e.g. a table's `selectionMode`) can drive\n   * it without reconstructing the model.\n   */\n  readonly multiple?: boolean | Signal<boolean>;\n  /**\n   * Equality comparator used for membership and de-duplication. Defaults to\n   * `===` (correct for primitive values); supply an id-based comparator for\n   * object values: `(a, b) => a.id === b.id`.\n   */\n  readonly compareWith?: (a: T, b: T) => boolean;\n}\n\n/**\n * The table's internal signal-first selection-state helper. Single- or\n * multi-select with equality-aware membership; every mutating method returns\n * whether the selection actually changed.\n *\n * The model does **not** own its backing store: callers pass a\n * `WritableSignal<readonly T[]>` (typically their own `model()`), so there is a\n * single source of truth and no `effect()`-based sync. `selected` is a readonly\n * view of that source; mutators write through it.\n */\nexport class SelectionModel<T> {\n  readonly #source: WritableSignal<readonly T[]>;\n  readonly #multiple: Signal<boolean>;\n  readonly #compareWith: (a: T, b: T) => boolean;\n\n  /** The current selection, in insertion order. Readonly view of the backing source. */\n  readonly selected: Signal<readonly T[]>;\n\n  constructor(source: WritableSignal<readonly T[]>, options?: SelectionModelOptions<T>) {\n    this.#source = source;\n    this.selected = source.asReadonly();\n    const multiple = options?.multiple ?? false;\n    this.#multiple = isSignal(multiple) ? multiple : signal(multiple);\n    this.#compareWith = options?.compareWith ?? ((a, b) => a === b);\n  }\n\n  /** Whether `value` is currently selected (under the comparator). */\n  isSelected(value: T): boolean {\n    return this.#has(this.#source(), value);\n  }\n\n  /**\n   * Select `values`. In single mode keeps only the last given value; in multi\n   * mode appends those not already present. Returns whether anything changed.\n   */\n  select(...values: T[]): boolean {\n    if (values.length === 0) {\n      return false;\n    }\n    if (!this.#multiple()) {\n      return this.#commit([values[values.length - 1]!]);\n    }\n    const next = [...this.#source()];\n    for (const v of values) {\n      if (!this.#has(next, v)) {\n        next.push(v);\n      }\n    }\n    return this.#commit(next);\n  }\n\n  /** Deselect `values`. Returns whether anything changed. */\n  deselect(...values: T[]): boolean {\n    if (values.length === 0) {\n      return false;\n    }\n    const next = this.#source().filter((v) => !values.some((d) => this.#compareWith(v, d)));\n    return this.#commit(next);\n  }\n\n  /** Toggle a single value. Returns whether anything changed (always `true`). */\n  toggle(value: T): boolean {\n    return this.isSelected(value) ? this.deselect(value) : this.select(value);\n  }\n\n  /**\n   * Replace the entire selection with `values` (de-duplicated). In single mode\n   * keeps only the last. Returns whether anything changed.\n   */\n  setSelection(...values: T[]): boolean {\n    if (!this.#multiple() && values.length > 1) {\n      return this.#commit([values[values.length - 1]!]);\n    }\n    const next: T[] = [];\n    for (const v of values) {\n      if (!this.#has(next, v)) {\n        next.push(v);\n      }\n    }\n    return this.#commit(next);\n  }\n\n  /** Clear the selection. Returns whether anything changed. */\n  clear(): boolean {\n    return this.#commit([]);\n  }\n\n  #has(arr: readonly T[], value: T): boolean {\n    return arr.some((x) => this.#compareWith(x, value));\n  }\n\n  #commit(next: readonly T[]): boolean {\n    const current = this.#source();\n    const changed =\n      current.length !== next.length ||\n      next.some((v) => !this.#has(current, v)) ||\n      current.some((v) => !this.#has(next, v));\n    if (!changed) {\n      return false;\n    }\n    this.#source.set(next);\n    return true;\n  }\n}\n","import { computed, type Signal, signal, type WritableSignal } from '@angular/core';\n\nimport { SelectionModel } from './selection-model';\nimport type {\n  TableSelectAllState,\n  TableSelectionBehavior,\n  TableSelectionMode,\n} from './table-context';\n\n/** Modifier keys that alter a `'replace'`-behavior row click. */\nexport interface TableSelectionModifiers {\n  readonly ctrlKey?: boolean;\n  readonly metaKey?: boolean;\n  readonly shiftKey?: boolean;\n}\n\n/**\n * Dependencies for {@link TableRowSelection}. Wires the helper to `ForTable`'s\n * `[(value)]` model, its selection inputs, and the aggregate value universe.\n */\nexport interface TableRowSelectionDeps<T> {\n  /** Two-way bindable selected row values (each row's `[value]`). */\n  readonly selection: WritableSignal<readonly T[]>;\n  /** The active row-selection mode. `'none'` disables selection. */\n  readonly selectionMode: Signal<TableSelectionMode>;\n  /** How a row click mutates the selection (`'toggle'` / `'replace'`). */\n  readonly selectionBehavior: Signal<TableSelectionBehavior>;\n  /** Equality comparator for row values. */\n  readonly compareWith: Signal<(a: T, b: T) => boolean>;\n  /**\n   * Ordered universe of selectable row values for aggregate operations\n   * (range extension, select-all tri-state). Spans rows beyond the rendered\n   * window when the table is virtualized or server-paged.\n   */\n  readonly aggregateValues: Signal<readonly T[]>;\n}\n\n/**\n * Row-selection sub-model for `ForTable`. Owns the `SelectionModel`, the range\n * anchor, and the toggle / replace / range / select-all algorithms, decoupled\n * from the table root.\n *\n * Internal — not re-exported from `table/index.ts` or `public-api.ts`.\n */\nexport class TableRowSelection<T> {\n  readonly #selectionMode: Signal<TableSelectionMode>;\n  readonly #selectionBehavior: Signal<TableSelectionBehavior>;\n  readonly #compareWith: Signal<(a: T, b: T) => boolean>;\n  readonly #aggregateValues: Signal<readonly T[]>;\n\n  readonly #model: SelectionModel<T>;\n  readonly #anchor = signal<T | undefined>(undefined);\n\n  /** Aggregate selection state across all selectable rows (`'none'` / `'some'` / `'all'`). */\n  readonly selectAllState = computed<TableSelectAllState>(() => {\n    const values = this.#aggregateValues();\n    if (values.length === 0) {\n      return 'none';\n    }\n    let count = 0;\n    for (const v of values) {\n      if (this.#model.isSelected(v)) {\n        count += 1;\n      }\n    }\n    if (count === 0) {\n      return 'none';\n    }\n    return count === values.length ? 'all' : 'some';\n  });\n\n  constructor(deps: TableRowSelectionDeps<T>) {\n    this.#selectionMode = deps.selectionMode;\n    this.#selectionBehavior = deps.selectionBehavior;\n    this.#compareWith = deps.compareWith;\n    this.#aggregateValues = deps.aggregateValues;\n    this.#model = new SelectionModel<T>(deps.selection, {\n      multiple: computed(() => deps.selectionMode() === 'multiple'),\n      compareWith: (a, b) => deps.compareWith()(a, b),\n    });\n  }\n\n  /** Whether `value` is currently in the selection. */\n  isSelected(value: T): boolean {\n    return this.#model.isSelected(value);\n  }\n\n  /** Toggles `value` in or out of the selection and re-anchors. No-op in `'none'` mode. */\n  toggle(value: T): void {\n    if (this.#selectionMode() === 'none') {\n      return;\n    }\n    this.#model.toggle(value);\n    this.#anchor.set(value);\n  }\n\n  /**\n   * Applies a row selection click with optional modifier keys, honoring\n   * `selectionBehavior`: `'toggle'` always flips; `'replace'` replaces (Ctrl/Cmd\n   * toggles a single item, Shift extends a range in multiple mode).\n   */\n  select(value: T, modifiers?: TableSelectionModifiers): void {\n    const mode = this.#selectionMode();\n    if (mode === 'none') {\n      return;\n    }\n    if (this.#selectionBehavior() === 'toggle') {\n      this.#model.toggle(value);\n      this.#anchor.set(value);\n      return;\n    }\n    const multiple = mode === 'multiple';\n    if (multiple && modifiers?.shiftKey) {\n      this.#selectRange(value);\n      return;\n    }\n    if (multiple && (modifiers?.ctrlKey || modifiers?.metaKey)) {\n      this.#model.toggle(value);\n      this.#anchor.set(value);\n      return;\n    }\n    this.#model.setSelection(value);\n    this.#anchor.set(value);\n  }\n\n  /** Selects all selectable rows when not all are selected; clears when all are. No-op outside `'multiple'` mode. */\n  toggleSelectAll(): void {\n    if (this.#selectionMode() !== 'multiple') {\n      return;\n    }\n    if (this.selectAllState() === 'all') {\n      this.#model.clear();\n    } else {\n      this.#model.select(...this.#aggregateValues());\n    }\n  }\n\n  #selectRange(toValue: T): void {\n    const values = this.#aggregateValues();\n    const equals = this.#compareWith();\n    const toIdx = values.findIndex((v) => equals(v, toValue));\n    if (toIdx < 0) {\n      return;\n    }\n    const anchor = this.#anchor();\n    const anchorIdx = anchor === undefined ? -1 : values.findIndex((v) => equals(v, anchor));\n    const start = anchorIdx < 0 ? toIdx : anchorIdx;\n    const [lo, hi] = start <= toIdx ? [start, toIdx] : [toIdx, start];\n    this.#model.setSelection(...values.slice(lo, hi + 1));\n  }\n}\n","import { type Signal, type WritableSignal } from '@angular/core';\n\n/**\n * Dependencies for {@link TableExpansion}. Wires the helper to `ForTable`'s\n * `[(expanded)]` model and the row-value comparator.\n */\nexport interface TableExpansionDeps<T> {\n  /** Two-way bindable open parent-row values (each row's `[value]`). */\n  readonly expanded: WritableSignal<readonly T[]>;\n  /** Equality comparator for row values. */\n  readonly compareWith: Signal<(a: T, b: T) => boolean>;\n}\n\n/**\n * Treegrid expansion sub-model for `ForTable`. Owns the membership and mutation\n * algorithm for the `[(expanded)]` open-rows set, decoupled from the table root.\n *\n * Internal — not re-exported from `table/index.ts` or `public-api.ts`.\n */\nexport class TableExpansion<T> {\n  readonly #expanded: WritableSignal<readonly T[]>;\n  readonly #compareWith: Signal<(a: T, b: T) => boolean>;\n\n  constructor(deps: TableExpansionDeps<T>) {\n    this.#expanded = deps.expanded;\n    this.#compareWith = deps.compareWith;\n  }\n\n  /** Whether `value` is currently in the open-rows set. */\n  isExpanded(value: T): boolean {\n    return this.#expanded().some((v) => this.#compareWith()(v, value));\n  }\n\n  /**\n   * Sets a parent row's expansion in or out of the open-rows set. No-op when\n   * `value` is undefined or already in the requested state.\n   */\n  setExpanded(value: T, open: boolean): void {\n    if (value === undefined) {\n      return;\n    }\n    const current = this.#expanded();\n    const has = this.isExpanded(value);\n    if (open && !has) {\n      this.#expanded.set([...current, value]);\n    } else if (!open && has) {\n      this.#expanded.set(current.filter((v) => !this.#compareWith()(v, value)));\n    }\n  }\n\n  /** Toggles a parent row's expansion. No-op when `value` is undefined. */\n  toggle(value: T): void {\n    if (value === undefined) {\n      return;\n    }\n    this.setExpanded(value, !this.isExpanded(value));\n  }\n}\n","import {\n  computed,\n  Directive,\n  inject,\n  input,\n  model,\n  type Provider,\n  type Signal,\n  signal,\n  type Type,\n} from '@angular/core';\n\nimport {\n  injectElementSize,\n  findFirstFocusable,\n  firstEnabledHost,\n  type ForTableCellHandle,\n  type ForTableRowHandle,\n  type GridNavigationAction,\n  moveGridIndex,\n  resolveGridNavigation,\n  resolveTreegridExpandCollapse,\n  TABLE_REGISTRATION_CONTEXT,\n  type WritingDirection,\n  injectTextDirection,\n  RovingTabindex,\n  hostAriaLabel,\n} from 'forty-cdk/core';\nimport { computeFlatHierarchy } from './flat-hierarchy';\nimport {\n  FOR_TABLE_CONTEXT,\n  hostHasSortActivation,\n  type ForTableContext,\n  type TableMode,\n  type TableSelectionMode,\n  type TableSelectionBehavior,\n  type TableSelectAllState,\n} from './table-context';\nimport { TableRegistry } from './table-registry';\nimport { TableRowSelection } from './table-row-selection';\nimport { TableExpansion } from './table-expansion';\n\n/**\n * The value [ARIA reserves](https://www.w3.org/TR/wai-aria-1.2/#aria-rowcount) on\n * `aria-rowcount` / `aria-colcount` for a total the author cannot determine. It is\n * what a `grid` / `treegrid` reports when the count is genuinely unknowable rather\n * than merely zero: a `0` there would state that a grid claiming rows has no columns\n * at all (or that a windowed grid has no rows), a contradiction a screen reader\n * cannot reconcile — and `0` is itself in range, so it reads as a real answer rather\n * than as a missing one.\n *\n * The two channels qualify \"unknowable\" differently, and the asymmetry is deliberate: the row\n * channel gates on the grid being windowed, because a non-windowed grid's rendered rows *are* all\n * its rows; the column channel does not, because zero registered cells is degenerate markup rather\n * than a resolvable state. See `colCount`.\n */\nconst UNKNOWN_COUNT = -1;\n\n/** Grid actions whose target may lie on a row outside the rendered virtualized window. */\nconst ROW_CROSSING_ACTIONS: ReadonlySet<GridNavigationAction> = new Set([\n  'next-row',\n  'prev-row',\n  'first',\n  'last',\n  'page-up',\n  'page-down',\n]);\n\n/**\n * Root of the Table primitive. Sets the ARIA `role` from `mode`, reflects\n * writing direction, and publishes the `--for-table-header-height` CSS custom\n * property (driven by a `ResizeObserver` on the first registered header row)\n * so consumers can `position: sticky` header cells without hard-coding offsets.\n *\n * Implements the [WAI-ARIA Table pattern](https://www.w3.org/WAI/ARIA/apg/patterns/table/)\n * and the [WAI-ARIA Grid pattern](https://www.w3.org/WAI/ARIA/apg/patterns/grid/).\n *\n * Use `mode=\"grid\"` or `mode=\"treegrid\"` for interactive grid semantics: a\n * single-tab-stop roving group with 2D arrow navigation over data cells.\n * The default `mode=\"table\"` is the static read-only structure.\n */\n@Directive({\n  selector: '[forTable]',\n  exportAs: 'forTable',\n  host: {\n    '[attr.role]': 'mode()',\n    '[attr.aria-label]': 'resolvedAriaLabel()',\n    '[attr.dir]': 'dir()',\n    '[attr.data-mode]': 'mode()',\n    '[style.--for-table-header-height.px]': 'headerSize()?.height ?? null',\n    '[attr.aria-rowcount]': 'rowCountAttr()',\n    '[attr.aria-colcount]': 'colCountAttr()',\n    '[attr.aria-multiselectable]':\n      'mode() !== \"table\" && selectionMode() === \"multiple\" ? \"true\" : null',\n  },\n  providers: provideForTable(ForTable),\n})\nexport class ForTable<T = unknown> implements ForTableContext {\n  /**\n   * ARIA role emitted on the host. `'table'` is the default static read-only\n   * structure. `'grid'` and `'treegrid'` provide single-tab-stop roving + 2D\n   * arrow navigation over data cells.\n   */\n  readonly mode = input<TableMode>('table');\n\n  /**\n   * Accessible label for the table. When set, reflected as `aria-label`.\n   * Consumers with a visible caption should prefer pointing native\n   * `aria-labelledby` at it instead; this input is the reactive convenience\n   * hook for cases where no visible label element exists.\n   */\n  readonly ariaLabel = input<string | null>(null);\n\n  protected readonly resolvedAriaLabel = hostAriaLabel(() => this.ariaLabel() || null);\n\n  /**\n   * Writing direction. When unset (default `null`), the inherited ambient\n   * direction is resolved from the nearest ancestor carrying a `dir` attribute\n   * (or `<html dir>`), defaulting to `'ltr'`. An explicit `[dir]` always wins.\n   * The resolved value is reflected to the host `dir` attribute.\n   */\n  readonly _dirInput = input<WritingDirection | null>(null, { alias: 'dir' });\n  readonly dir = injectTextDirection(this._dirInput);\n\n  /**\n   * Explicit override for the true total data-row count (`aria-rowcount` and the\n   * virtualized scroll range). A declarative `<for-table-body>` supplies this\n   * automatically from its `rows` dataset length, so bind `[rowCount]` only for a\n   * server-known total larger than the loaded rows; when set it wins over the\n   * body-derived count. Defaults to the body count, else the rendered data-row\n   * count plus the header offset — so an empty non-virtualized grid with a header\n   * row reports `aria-rowcount=\"1\"`, because its rendered rows are all the rows it\n   * has. A **windowed** grid rendering no data row is the one shape whose total is\n   * unknowable, and there `aria-rowcount` reports `-1`, the value ARIA reserves for\n   * an unknown total. An explicit value is emitted verbatim, including `0`. Ignored\n   * in `mode=\"table\"`.\n   */\n  readonly _rowCountInput = input<number | undefined>(undefined, { alias: 'rowCount' });\n\n  readonly #registry = inject(TableRegistry);\n\n  /**\n   * Resolved true total data-row count: the explicit `[rowCount]` input when set,\n   * else the declarative `<for-table-body>`'s dataset length, else `undefined`\n   * (readers fall back to the rendered count). Feeds `aria-rowcount`, the\n   * cross-window navigation total, and the virtualizer's count.\n   */\n  readonly rowCount = computed<number | undefined>(\n    () => this._rowCountInput() ?? this.#registry.bodyRowCount()?.(),\n  );\n\n  /**\n   * The count of currently loaded data rows (the declarative `<for-table-body>`\n   * dataset length), or `undefined` when no body has registered one (raw-primitive\n   * rendering). Distinct from `rowCount`, which an explicit `[rowCount]` raises to a\n   * server-known total larger than the loaded rows; cross-window navigation clamps\n   * unmounted targets to this so a target beyond the loaded prefix cannot stash a\n   * pending focus move that resolves — and steals focus — only when a far page later\n   * loads.\n   */\n  readonly loadedRowCount = computed<number | undefined>(() => this.#registry.bodyRowCount()?.());\n\n  /**\n   * True total number of columns for `aria-colcount`. Defaults to the rendered\n   * column count (the cells of the first data row that has any, else the registered\n   * header cells) — and when no channel knows the count, `aria-colcount` reports\n   * `-1`, the value ARIA reserves for an unknown total. That is the shape a\n   * virtualized grid with no header row has until its first window resolves: no row\n   * is rendered, so no cell has registered.\n   *\n   * Unlike `aria-rowcount`, that sentinel is **unconditional** — it is not gated on\n   * the grid being windowed.\n   * A non-windowed grid with no registered cell has rows without cells, or no markup\n   * at all: degenerate either way, so there is no state where `0` is the resolved\n   * answer rather than the missing one, and emitting it would re-open exactly the\n   * \"`0` reads as a real answer\" defect the sentinel exists for.\n   *\n   * An explicit value is emitted verbatim, including `0`. Ignored in `mode=\"table\"`.\n   */\n  readonly colCount = input<number>();\n\n  /** Row selection mode. `'none'` (default) disables selection entirely. */\n  readonly selectionMode = input<TableSelectionMode>('none');\n\n  /**\n   * How a row click changes the selection. `'toggle'` (default) flips the clicked\n   * row. `'replace'` replaces the selection with the clicked row; Ctrl/Cmd-click\n   * toggles a single row and Shift-click extends a range (multiple mode only).\n   */\n  readonly selectionBehavior = input<TableSelectionBehavior>('toggle');\n\n  /**\n   * Two-way bindable selected row values (each row's `[value]`). Single mode keeps\n   * 0–1 entries. The implicit `valueChange` fires only on internal mutations\n   * (selector / row click / Space / select-all), never on consumer writes. The\n   * directive infers the row-value type `T` from this binding.\n   */\n  readonly value = model<readonly T[]>([]);\n\n  /** Equality comparator for row values. Defaults to `===`; supply id-based for objects. */\n  readonly compareWith = input<(a: T, b: T) => boolean>((a, b) => a === b);\n\n  /**\n   * Full ordered set of selectable row values (each row's `[value]`), for a\n   * virtualized or server-paged table whose aggregate selection operations must\n   * span rows beyond the rendered window. When `null` (default), the select-all\n   * tri-state, `toggleSelectAll`, and Shift-click range selection compute against\n   * the registered (rendered) rows only. When supplied, they use this set as the\n   * universe of selectable values, so a range can span unmounted rows and the\n   * tri-state reflects the true dataset. Per-row selection is unaffected.\n   */\n  readonly selectableValues = input<readonly T[] | null>(null);\n\n  /**\n   * Two-way bindable open parent-row values (each row's `[value]`), for\n   * `mode=\"treegrid\"`. The implicit `expandedChange` fires only on internal\n   * expand/collapse (ArrowRight/ArrowLeft, `toggleRowExpansion`), never on\n   * consumer writes through `[(expanded)]`. Ignored outside `treegrid` mode.\n   */\n  readonly expanded = model<readonly T[]>([]);\n\n  protected readonly headerSize = injectElementSize(this.#registry.headerRowEl);\n\n  readonly #roving = new RovingTabindex(() => this.#flatCells());\n  readonly #enteredCell = signal<HTMLElement | null>(null);\n\n  readonly #headerCellHosts = this.#registry.headerCells;\n  readonly #dataCells = computed(() => this.#registry.rows().flatMap((row) => row.cells()));\n  readonly #dataCols = computed(\n    () =>\n      this.#registry\n        .rows()\n        .find((row) => row.cells().length > 0)\n        ?.cells().length ?? 0,\n  );\n\n  /**\n   * Whether the registered header cells form a complete grid row that joins the body's\n   * roving grid as its first row. True in `grid` / `treegrid` mode when at least one\n   * header cell registered and the count matches the data column count (or there are no\n   * data rows yet). Draggable header cells (a `[forTableColumnReorder]` row) register the\n   * same way, so a column-reorderable grid still forms one composite tab stop across\n   * header and body — the reorder wrapper hands its drop-list roving over to this grid via\n   * `FOR_DROP_LIST_ROVING_DELEGATE` and routes idle header navigation through\n   * `handleHeaderCellKeydown`.\n   */\n  readonly #headerParticipates = computed(() => {\n    if (this.mode() === 'table') {\n      return false;\n    }\n    const headerCount = this.#headerCellHosts().length;\n    if (headerCount === 0) {\n      return false;\n    }\n    const dataCols = this.#dataCols();\n    return dataCols === 0 || headerCount === dataCols;\n  });\n\n  private readonly headerParticipatesInRoving = this.#headerParticipates;\n\n  /**\n   * The composite roving grid: the header cells (as grid row 0, when they form a\n   * complete row) followed by the data cells in row-major order, so the table exposes\n   * a single tab stop and arrow navigation crosses between the header and the body.\n   */\n  readonly #flatCells = computed<readonly ForTableCellHandle[]>(() =>\n    this.#headerParticipates()\n      ? [...this.#headerCellHosts(), ...this.#dataCells()]\n      : this.#dataCells(),\n  );\n  readonly #cols = computed(() => {\n    const dataCols = this.#dataCols();\n    return dataCols > 0 ? dataCols : this.#headerCellHosts().length;\n  });\n\n  /**\n   * The cell that owns the tab stop while nothing is roving-active — the first\n   * enabled cell of the composite grid.\n   *\n   * It walks the header row and then the data rows one at a time instead of\n   * reading the materialized `#flatCells`, so it stops depending on a row's\n   * `cells()` as soon as an earlier row has answered. Every cell's `tabindex`\n   * binding is a live consumer of this signal and each row registers its cells\n   * during that row's own update pass, so a dependency on the whole grid would make each\n   * registration notify every cell mounted so far, which is quadratic in grid size.\n   *\n   * The header branch's fall-through is unreachable: header cells hardcode a\n   * `false` `disabled`, and `#headerParticipates()` already rules out an empty\n   * header row. It is kept so the walk stays equivalent to the `#flatCells`\n   * concatenation if header cells ever gain a real disabled state.\n   */\n  readonly #firstEnabledCell = computed<HTMLElement | null>(() => {\n    if (this.#headerParticipates()) {\n      const fromHeader = firstEnabledHost(this.#headerCellHosts());\n      if (fromHeader !== null) {\n        return fromHeader;\n      }\n    }\n    for (const row of this.#registry.rows()) {\n      const fromRow = firstEnabledHost(row.cells());\n      if (fromRow !== null) {\n        return fromRow;\n      }\n    }\n    return null;\n  });\n\n  /** Whether the header row participates in the row-index space (a header row is registered, non-table mode). */\n  readonly #hasHeaderRowIndex = computed(\n    () => this.mode() !== 'table' && this.#registry.headerRowEl() !== null,\n  );\n\n  /** 1-based row offset ARIA applies to data rows because the header row occupies index 1. */\n  private readonly dataRowIndexOffset = computed(() => (this.#hasHeaderRowIndex() ? 1 : 0));\n\n  private readonly headerRowIndex = computed<number | null>(() =>\n    this.#hasHeaderRowIndex() ? 1 : null,\n  );\n\n  readonly #registeredValues = computed<readonly T[]>(() =>\n    this.#registry\n      .rows()\n      .map((row) => row.value() as T)\n      .filter((v) => v !== undefined),\n  );\n  readonly #aggregateValues = computed<readonly T[]>(\n    () => this.selectableValues() ?? this.#registeredValues(),\n  );\n\n  readonly #selection = new TableRowSelection<T>({\n    selection: this.value,\n    selectionMode: this.selectionMode,\n    selectionBehavior: this.selectionBehavior,\n    compareWith: this.compareWith,\n    aggregateValues: this.#aggregateValues,\n  });\n\n  readonly selectAllState: Signal<TableSelectAllState> = this.#selection.selectAllState;\n\n  readonly #expansion = new TableExpansion<T>({\n    expanded: this.expanded,\n    compareWith: this.compareWith,\n  });\n\n  readonly #rowHierarchy = computed(() =>\n    computeFlatHierarchy(this.#registry.rows().map((row) => row.level())),\n  );\n\n  #rowOfCell(cellHost: HTMLElement): ForTableRowHandle | undefined {\n    return this.#registry.rows().find((row) => row.cells().some((cell) => cell.host === cellHost));\n  }\n\n  /**\n   * Absolute index of the row that owns the currently roving-focused cell, or `null`\n   * when no cell is focused (or the focused row carries no `virtualIndex`). Used by\n   * `[forTableVirtualized]` to keep the focused row mounted across recycling.\n   */\n  readonly focusedRowIndex = computed<number | null>(() => {\n    const active = this.#roving.active();\n    if (active === null) {\n      return null;\n    }\n    return this.#rowOfCell(active)?.virtualIndex() ?? null;\n  });\n\n  /**\n   * Whether the grid is windowed — a `[forTableVirtualized]` companion has published\n   * a rendered window, so the registered rows are a slice of the dataset rather than\n   * all of it. That companion registers the window from its **constructor**, so this\n   * already answers `true` server-side and on the first frame, for the raw-primitive\n   * path as much as for `<for-table-body>`; being a signal read inside a `computed`\n   * also makes the two directives' construction order on the shared host irrelevant.\n   */\n  readonly #windowed = computed(() => this.#registry.virtualWindow() !== null);\n\n  protected readonly rowCountAttr = computed<number | null>(() => {\n    if (this.mode() === 'table') {\n      return null;\n    }\n    const total = this.rowCount();\n    if (total !== undefined) {\n      return total + this.dataRowIndexOffset();\n    }\n    const rendered = this.#registry.rows().length;\n    if (rendered === 0 && this.#windowed()) {\n      return UNKNOWN_COUNT;\n    }\n    return rendered + this.dataRowIndexOffset();\n  });\n  protected readonly colCountAttr = computed<number | null>(() => {\n    if (this.mode() === 'table') {\n      return null;\n    }\n    const total = this.colCount();\n    if (total !== undefined) {\n      return total;\n    }\n    const rendered = this.#cols();\n    return rendered === 0 ? UNKNOWN_COUNT : rendered;\n  });\n\n  isRowExpanded(value: T): boolean {\n    return this.#expansion.isExpanded(value);\n  }\n\n  toggleRowExpansion(value: T): void {\n    this.#expansion.toggle(value);\n  }\n\n  private rowPosinset(host: HTMLElement): number {\n    const index = this.#registry.rowIndexOf(host);\n    return index < 0 ? 1 : (this.#rowHierarchy()[index]?.posinset ?? 1);\n  }\n\n  private rowSetsize(host: HTMLElement): number {\n    const index = this.#registry.rowIndexOf(host);\n    return index < 0 ? 1 : (this.#rowHierarchy()[index]?.setsize ?? 1);\n  }\n\n  private rowIndexOf(host: HTMLElement): number {\n    return this.#registry.rowIndexOf(host);\n  }\n\n  private cellTabIndex(host: HTMLElement): 0 | -1 {\n    if (this.#roving.hasActive()) {\n      return this.#roving.tabindexFor(host);\n    }\n    return this.#firstEnabledCell() === host ? 0 : -1;\n  }\n\n  private headerCellTabIndex(host: HTMLElement): 0 | -1 {\n    if (!this.#headerParticipates()) {\n      return -1;\n    }\n    return this.cellTabIndex(host);\n  }\n\n  private headerCellIndexOf(host: HTMLElement): number {\n    return this.#registry.headerCellIndexOf(host);\n  }\n\n  private isCellHighlighted(host: HTMLElement): boolean {\n    return this.#roving.active() === host;\n  }\n\n  private activateCell(host: HTMLElement): void {\n    if (this.mode() !== 'table') {\n      this.#roving.setActive(host);\n    }\n  }\n\n  isRowSelected(value: T): boolean {\n    return this.#selection.isSelected(value);\n  }\n\n  toggleRowSelection(value: T): void {\n    this.#selection.toggle(value);\n  }\n\n  selectRow(\n    value: T,\n    modifiers?: { ctrlKey?: boolean; metaKey?: boolean; shiftKey?: boolean },\n  ): void {\n    this.#selection.select(value, modifiers);\n  }\n\n  toggleSelectAll(): void {\n    this.#selection.toggleSelectAll();\n  }\n\n  #rowValueOfCell(cellHost: HTMLElement): T | undefined {\n    for (const row of this.#registry.rows()) {\n      if (row.cells().some((cell) => cell.host === cellHost)) {\n        return row.value() as T;\n      }\n    }\n    return undefined;\n  }\n\n  private handleCellKeydown(event: KeyboardEvent, host: HTMLElement): void {\n    if (this.mode() === 'table') {\n      return;\n    }\n    this.#registry.virtualRowNavigation()?.clearPending();\n    if (this.#handleCellEntryKeydown(event, host)) {\n      return;\n    }\n    if (event.target !== host) {\n      return;\n    }\n    if (this.#handleSelectionKeydown(event, host)) {\n      return;\n    }\n    if (this.#handleExpansionKeydown(event, host)) {\n      return;\n    }\n    this.#handleGridNavigationKeydown(event, host);\n  }\n\n  /**\n   * Resolves grid navigation for a header cell that yields its host interaction to a\n   * co-located `[forDraggable]` (a `[forTableColumnReorder]` row). `[forTableColumnReorder]`\n   * calls this from a capture-phase listener for idle (not-lifted) header cells, so Arrow /\n   * Home / End / Page keys move roving focus across the composite header + body grid while\n   * Space / Enter still fall through to the draggable's lift. Returns `true` when the key\n   * resolved to a grid action (and was consumed), `false` otherwise. No-op (returns `false`)\n   * outside `grid` / `treegrid` mode or when the header row does not join the composite grid.\n   */\n  private handleHeaderCellKeydown(event: KeyboardEvent, host: HTMLElement): boolean {\n    if (this.mode() === 'table' || !this.#headerParticipates()) {\n      return false;\n    }\n    this.#registry.virtualRowNavigation()?.clearPending();\n    return this.#handleGridNavigationKeydown(event, host);\n  }\n\n  /**\n   * APG grid cell-entry mode: Enter or F2 on a focused cell moves focus into the\n   * cell's first interactive widget; Escape returns focus to the owning cell.\n   * Returns `true` when the event was consumed.\n   *\n   * A cell whose host carries an active sort affordance (`[forTableSortHeader]`\n   * with `sortable`, marked by `data-sortable`) defers `Enter` to the sort\n   * activation — `Enter` toggles the sort and focus stays on the cell — while\n   * `F2` remains the cell-entry key, so a sortable + resizable header does not\n   * both sort and drop focus onto the resize handle.\n   */\n  #handleCellEntryKeydown(event: KeyboardEvent, host: HTMLElement): boolean {\n    if ((event.key === 'Enter' || event.key === 'F2') && event.target === host) {\n      if (event.key === 'Enter' && hostHasSortActivation(host)) {\n        return false;\n      }\n      const target = findFirstFocusable(host);\n      if (!target) {\n        return false;\n      }\n      event.preventDefault();\n      this.#enteredCell.set(host);\n      target.focus();\n      return true;\n    }\n    if (event.key === 'Escape' && this.#enteredCell() === host && event.target !== host) {\n      event.preventDefault();\n      this.#enteredCell.set(null);\n      host.focus();\n      return true;\n    }\n    return false;\n  }\n\n  #handleSelectionKeydown(event: KeyboardEvent, host: HTMLElement): boolean {\n    if (event.key !== ' ' || event.target !== host || this.selectionMode() === 'none') {\n      return false;\n    }\n    const value = this.#rowValueOfCell(host);\n    if (value === undefined) {\n      return false;\n    }\n    event.preventDefault();\n    this.#selection.toggle(value);\n    return true;\n  }\n\n  #handleExpansionKeydown(event: KeyboardEvent, host: HTMLElement): boolean {\n    if (this.mode() !== 'treegrid') {\n      return false;\n    }\n    const intent = resolveTreegridExpandCollapse(event, this.dir());\n    if (intent === null) {\n      return false;\n    }\n    const row = this.#rowOfCell(host);\n    if (!row?.expandable()) {\n      return false;\n    }\n    const value = row.value() as T;\n    const open = this.#expansion.isExpanded(value);\n    if (intent === 'expand' && !open) {\n      event.preventDefault();\n      this.#expansion.setExpanded(value, true);\n      return true;\n    }\n    if (intent === 'collapse' && open) {\n      event.preventDefault();\n      this.#expansion.setExpanded(value, false);\n      return true;\n    }\n    return false;\n  }\n\n  #handleGridNavigationKeydown(event: KeyboardEvent, host: HTMLElement): boolean {\n    const cols = this.#cols();\n    const cells = this.#flatCells();\n    if (cols === 0 || cells.length === 0) {\n      return false;\n    }\n    const action: GridNavigationAction | null = resolveGridNavigation(event, {\n      cols,\n      dir: this.dir(),\n      pageKeys: true,\n    });\n    if (action === null) {\n      return false;\n    }\n    event.preventDefault();\n    const currentIndex = Math.max(\n      0,\n      cells.findIndex((cell) => cell.host === host),\n    );\n\n    const navigation = this.#registry.virtualRowNavigation();\n    const fromRow = this.focusedRowIndex();\n    const total = this.rowCount();\n    const pageSize = this.#pageSize();\n    const headerIsRowTarget =\n      this.#headerParticipates() && targetsHeaderRow(action, fromRow, pageSize);\n    if (headerIsRowTarget) {\n      navigation?.scrollToRow(0);\n    }\n    if (\n      navigation !== null &&\n      total !== undefined &&\n      fromRow !== null &&\n      ROW_CROSSING_ACTIONS.has(action) &&\n      !headerIsRowTarget\n    ) {\n      const col = currentIndex % cols;\n      const target = resolveCrossWindowRowTarget(action, fromRow, col, total, cols, pageSize);\n      if (target !== null) {\n        navigation.navigateTo(target.row, target.col, target.direction);\n      }\n      return true;\n    }\n\n    const next = moveGridIndex(currentIndex, cells.length, action, {\n      cols,\n      pageSize,\n      isDisabled: (i) => cells[i]!.disabled(),\n    });\n    if (next === null) {\n      return true;\n    }\n    this.#roving.focusActive(cells[next]!.host);\n    return true;\n  }\n\n  /**\n   * Rows a PageUp / PageDown moves. One page is the number of rendered data rows\n   * — in a virtualized grid that is the visible window (plus overscan), so paging\n   * a 100k-row grid advances by a screenful rather than teleporting to an end. A\n   * lone-row window still advances by at least one row.\n   */\n  #pageSize(): number {\n    return Math.max(1, this.#registry.rows().length);\n  }\n}\n\n/**\n * Resolves the absolute `(row, 0-based column)` target and travel `direction`\n * for a row-crossing grid action against the true `total` row count. Arrow\n * row-moves preserve the current column; `page-up` / `page-down` move by\n * `pageSize` rows (the caller's `#pageSize()` is already at least 1, and the\n * move is clamped to the dataset bounds) preserving the column;\n * `last` jumps to the last cell of the whole grid. The `direction` (`+1` for\n * down / first, `-1` for up / last) is threaded to the virtualization bridge so\n * it can step over full-span variant rows onto the adjacent data row. Returns\n * `null` when the move would not change the focused row. The actions\n * {@link targetsHeaderRow} claims for a participating header row — `first`,\n * plus `prev-row` / `page-up` from within the first page of data rows — are\n * routed through the non-virtualized `moveGridIndex` path instead, so this\n * resolver's `first` case applies only to a header-less grid and its `prev-row`\n * / `page-up` cases clamp at data row 0 only when the header does not\n * participate.\n */\nfunction resolveCrossWindowRowTarget(\n  action: GridNavigationAction,\n  fromRow: number,\n  col: number,\n  total: number,\n  cols: number,\n  pageSize: number,\n): { row: number; col: number; direction: 1 | -1 } | null {\n  switch (action) {\n    case 'next-row':\n      return fromRow + 1 < total ? { row: fromRow + 1, col, direction: 1 } : null;\n    case 'prev-row':\n      return fromRow - 1 >= 0 ? { row: fromRow - 1, col, direction: -1 } : null;\n    case 'page-down': {\n      const row = Math.min(total - 1, fromRow + pageSize);\n      return row > fromRow ? { row, col, direction: 1 } : null;\n    }\n    case 'page-up': {\n      const row = Math.max(0, fromRow - pageSize);\n      return row < fromRow ? { row, col, direction: -1 } : null;\n    }\n    case 'first':\n      return { row: 0, col: 0, direction: 1 };\n    case 'last':\n      return { row: total - 1, col: cols - 1, direction: -1 };\n    default:\n      return null;\n  }\n}\n\n/**\n * Whether a row-crossing action lands on the header row of the composite grid,\n * given the absolute data row the move starts from (`null` when the focused cell\n * is not in a data row — a header cell, typically). Only meaningful when the\n * header participates in roving, in which case it is the grid's row 0 and the\n * data rows start at grid row 1:\n *\n * - `first` (`Ctrl+Home`) targets the first cell of the grid, i.e. the header.\n * - `prev-row` (`ArrowUp`) from data row 0 steps above the data, into the header.\n * - `page-up` from within the first page of data rows (`fromRow < pageSize`)\n *   clamps to grid row 0, which is the header — mirroring `moveGridIndex`'s\n *   clamp exactly.\n *\n * A header target is rendered whether or not the virtual window contains data\n * row 0, so `[forTable]` resolves these through the non-virtualized\n * `moveGridIndex` path rather than through the cross-window bridge; the caller\n * still asks the virtualizer to scroll back to row 0 first, so the grid is never\n * left focused on its header while the window sits at the bottom of the dataset.\n */\nfunction targetsHeaderRow(\n  action: GridNavigationAction,\n  fromRow: number | null,\n  pageSize: number,\n): boolean {\n  if (action === 'first') {\n    return true;\n  }\n  if (fromRow === null) {\n    return false;\n  }\n  if (action === 'prev-row') {\n    return fromRow === 0;\n  }\n  return action === 'page-up' && fromRow < pageSize;\n}\n\n/**\n * The providers a `[forTable]` root installs: the public\n * {@link FOR_TABLE_CONTEXT}, aliased to `root`, plus the internal\n * piece-registration wiring the table's pieces resolve.\n *\n * `ForTable` declares its own providers through this helper, so a wrapper that\n * **subclasses** the root has a single call to keep in step with it. That\n * matters because Angular does not inherit a directive's `providers`: a subclass\n * carrying its own `@Directive` metadata replaces the array wholesale, so\n * re-providing `FOR_TABLE_CONTEXT` alone leaves the registration wiring absent\n * and every piece — down to the root's own constructor — fails to resolve it.\n * The internal providers are unnameable outside the library, which is why the\n * wrapper cannot list them by hand.\n *\n * ```ts\n * providers: provideForTable(MyTable),\n * ```\n *\n * Wrapping through `hostDirectives: [ForTable]` needs none of this — a host\n * directive brings its own providers to the element.\n */\nexport function provideForTable<T = unknown>(root: Type<ForTable<T>>): Provider[] {\n  return [\n    TableRegistry,\n    { provide: FOR_TABLE_CONTEXT, useExisting: root },\n    { provide: TABLE_REGISTRATION_CONTEXT, useExisting: TableRegistry },\n  ];\n}\n","import {\n  computed,\n  DestroyRef,\n  ElementRef,\n  inject,\n  Injectable,\n  InjectionToken,\n  type Provider,\n  type Signal,\n} from '@angular/core';\n\nimport { Collection, fortyError, isUnset } from 'forty-cdk/core';\n\nimport type {\n  ForTableColumnDef,\n  ForTableColumnDragPlaceholder,\n  ForTablePlaceholderCellDefault,\n} from './column-def';\nimport type { ForTableRowDef } from './row-def';\n\n/**\n * The def registry a `<for-table-body>` renders from — the seam that lets a\n * **scaffold wrapper** own the table shell while its consumers keep declaring\n * plain `[forTableColumnDef]` / `[forTableRowDef]` blocks.\n *\n * Defs discover their registry through DI at construction, and element DI follows\n * the **declaration** tree: a def projected through a wrapper's `<ng-content>` is\n * a child of the wrapper's host, not of the `<for-table-body>` inside the\n * wrapper's template, so it never sees the body's own registry. A wrapper\n * therefore provides its own registry with `provideForTableDefRegistry()` and\n * hands it to its inner body through `[defs]`; projected defs register with it,\n * and the body renders them exactly as if they had been declared inside its own\n * tags. See the table README for the full recipe.\n *\n * A **preset column component** (`<ds-text-column name=\"code\" …>` collapsing a\n * column's header / data templates into one line) needs none of this: the preset\n * host is declared inside the body's tags, so the def in the preset's view\n * resolves the body's registry through the element-injector chain.\n *\n * The read members here are the whole public surface. How defs wire themselves\n * into a registry is a separate, unexported protocol, so the library keeps\n * refactoring it; the only supported implementation is the one\n * `provideForTableDefRegistry()` installs, and `<for-table-body>` rejects any\n * other value bound to `[defs]`.\n */\nexport interface ForTableDefRegistry {\n  /**\n   * The `name` of every registered `[forTableColumnDef]`, in document order — the\n   * default column order a bound `<for-table-body>` renders. A wrapper can seed\n   * its own `[displayedColumns]` from it (say, to move a fixed action column to\n   * the end) without knowing which defs its consumer projected.\n   *\n   * Reading it resolves each def's `name` input, and a def whose binding is not\n   * written yet is left out, so read it from a template, a `computed`, or an\n   * `afterNextRender` — not from a constructor, where the projected defs' inputs\n   * are not bound yet and the list would come back short.\n   */\n  readonly columnNames: Signal<readonly string[]>;\n}\n\nexport const FOR_TABLE_DEF_REGISTRY = new InjectionToken<ForTableDefRegistry>(\n  'FOR_TABLE_DEF_REGISTRY',\n);\n\n/**\n * One registered def paired with the DOM node that positions it — the comment\n * anchor of its `<ng-container>`, or the element it sits on. The node orders the\n * registry in document position, so a def declared inside a preset component's\n * view (which constructs after every directly declared def) still renders in its\n * authored place.\n */\nexport interface TableDefHandle<D> {\n  /**\n   * The def's host node — the comment anchor of its `<ng-container>` /\n   * `<ng-template>`, or the element it sits on.\n   */\n  readonly host: Node;\n  /** The registered def instance. */\n  readonly def: D;\n}\n\n/**\n * The def-registration protocol: how the four declarative pieces wire themselves\n * into the registry a `<for-table-body>` reads. Kept off\n * {@link ForTableDefRegistry} — this is the surface the library refactors, and\n * nothing outside `forty-cdk/table` needs to call it.\n */\nexport interface TableDefRegistration {\n  /** Whether nothing at all has registered — the body's guard against defs registered on the wrong registry. */\n  readonly isEmpty: Signal<boolean>;\n  /** Registers a column def. */\n  registerColumnDef(handle: TableDefHandle<ForTableColumnDef>): void;\n  /** Unregisters a column def. Reference-based. */\n  unregisterColumnDef(handle: TableDefHandle<ForTableColumnDef>): void;\n  /** Registers a row variant def. */\n  registerRowDef(handle: TableDefHandle<ForTableRowDef<unknown>>): void;\n  /** Unregisters a row variant def. Reference-based. */\n  unregisterRowDef(handle: TableDefHandle<ForTableRowDef<unknown>>): void;\n  /** Registers the shared column drag placeholder template. */\n  registerColumnDragPlaceholder(handle: TableDefHandle<ForTableColumnDragPlaceholder>): void;\n  /** Unregisters the shared column drag placeholder template. Reference-based. */\n  unregisterColumnDragPlaceholder(handle: TableDefHandle<ForTableColumnDragPlaceholder>): void;\n  /** Registers the body-level default placeholder-cell template. */\n  registerPlaceholderCellDefault(handle: TableDefHandle<ForTablePlaceholderCellDefault>): void;\n  /** Unregisters the body-level default placeholder-cell template. Reference-based. */\n  unregisterPlaceholderCellDefault(handle: TableDefHandle<ForTablePlaceholderCellDefault>): void;\n}\n\nexport const TABLE_DEF_REGISTRATION = new InjectionToken<TableDefRegistration>(\n  'TABLE_DEF_REGISTRATION',\n);\n\n/**\n * Owns the registered declarative defs of one `<for-table-body>`, exposing them\n * in document order.\n *\n * Document order (rather than construction order) is what keeps the seam a\n * drop-in replacement for the content queries it replaces: a def inside a preset\n * component's view constructs after every directly declared def, an `@if`-mounted\n * def constructs whenever it mounts, and a `@for`-reordered set of defs moves its\n * nodes without re-running constructors. `Collection` resolves all three from the\n * handles' host nodes.\n */\n@Injectable()\nexport class TableDefRegistry implements ForTableDefRegistry, TableDefRegistration {\n  readonly #columns = new Collection<TableDefHandle<ForTableColumnDef>>();\n  readonly #rowDefs = new Collection<TableDefHandle<ForTableRowDef<unknown>>>();\n  readonly #dragPlaceholders = new Collection<TableDefHandle<ForTableColumnDragPlaceholder>>();\n  readonly #placeholderDefaults = new Collection<TableDefHandle<ForTablePlaceholderCellDefault>>();\n\n  /**\n   * Registered column defs, in document order.\n   *\n   * A def registers in its view's **creation** pass but has its `name` bound in\n   * that view's **update** pass, and for a def declared in a preset component's\n   * view those two passes straddle the body's own render — so a def is held back\n   * until its name can be read. Reading the unwritten input tracks it, so the\n   * binding's write folds the def in. See `unsetInput`.\n   */\n  readonly columnDefs: Signal<readonly ForTableColumnDef[]> = computed(() =>\n    this.#columns\n      .items()\n      .map((handle) => handle.def)\n      .filter((def) => !isUnset(def.name())),\n  );\n\n  /**\n   * Registered row variant defs, in document order (first match wins per datum).\n   * Held back until the def's `when` predicate can be read, exactly like\n   * {@link columnDefs}.\n   */\n  readonly rowDefs: Signal<readonly ForTableRowDef<unknown>[]> = computed(() =>\n    this.#rowDefs\n      .items()\n      .map((handle) => handle.def)\n      .filter((def) => !isUnset(def.when())),\n  );\n\n  /** The shared column drag placeholder (the first in document order), or `null`. */\n  readonly columnDragPlaceholder: Signal<ForTableColumnDragPlaceholder | null> = computed(\n    () => this.#dragPlaceholders.items()[0]?.def ?? null,\n  );\n\n  /** The body-level default placeholder-cell template (the first in document order), or `null`. */\n  readonly placeholderCellDefault: Signal<ForTablePlaceholderCellDefault | null> = computed(\n    () => this.#placeholderDefaults.items()[0]?.def ?? null,\n  );\n\n  /** The `name` of every registered column def, in document order. */\n  readonly columnNames: Signal<readonly string[]> = computed(() =>\n    this.columnDefs().map((def) => def.name()),\n  );\n\n  /** Whether no def of any kind is registered. */\n  readonly isEmpty: Signal<boolean> = computed(\n    () =>\n      this.#columns.items().length === 0 &&\n      this.#rowDefs.items().length === 0 &&\n      this.#dragPlaceholders.items().length === 0 &&\n      this.#placeholderDefaults.items().length === 0,\n  );\n\n  /** Registers a column def so it joins the rendered columns at its document position. */\n  registerColumnDef(handle: TableDefHandle<ForTableColumnDef>): void {\n    this.#columns.register(handle);\n  }\n\n  /** Unregisters a column def. Reference-based. */\n  unregisterColumnDef(handle: TableDefHandle<ForTableColumnDef>): void {\n    this.#columns.unregister(handle);\n  }\n\n  /** Registers a row variant def so its matched data rows render the variant. */\n  registerRowDef(handle: TableDefHandle<ForTableRowDef<unknown>>): void {\n    this.#rowDefs.register(handle);\n  }\n\n  /** Unregisters a row variant def. Reference-based. */\n  unregisterRowDef(handle: TableDefHandle<ForTableRowDef<unknown>>): void {\n    this.#rowDefs.unregister(handle);\n  }\n\n  /** Registers the shared drag placeholder stamped into every reorderable header cell. */\n  registerColumnDragPlaceholder(handle: TableDefHandle<ForTableColumnDragPlaceholder>): void {\n    this.#dragPlaceholders.register(handle);\n  }\n\n  /** Unregisters the shared column drag placeholder. Reference-based. */\n  unregisterColumnDragPlaceholder(handle: TableDefHandle<ForTableColumnDragPlaceholder>): void {\n    this.#dragPlaceholders.unregister(handle);\n  }\n\n  /** Registers the default placeholder-cell template columns fall back to. */\n  registerPlaceholderCellDefault(handle: TableDefHandle<ForTablePlaceholderCellDefault>): void {\n    this.#placeholderDefaults.register(handle);\n  }\n\n  /** Unregisters the default placeholder-cell template. Reference-based. */\n  unregisterPlaceholderCellDefault(handle: TableDefHandle<ForTablePlaceholderCellDefault>): void {\n    this.#placeholderDefaults.unregister(handle);\n  }\n}\n\n/**\n * The provider set installing a def registry on a host: the registry itself, the\n * public {@link FOR_TABLE_DEF_REGISTRY} read token, and the internal\n * registration protocol the declarative defs resolve.\n *\n * `<for-table-body>` declares it so defs declared inside its own tags register\n * with it. A **scaffold wrapper** declares it too, so defs its consumers project\n * through `<ng-content>` reach a registry at all, and binds\n * `inject(FOR_TABLE_DEF_REGISTRY)` to its inner body's `[defs]`.\n */\nexport function provideForTableDefRegistry(): Provider[] {\n  return [\n    TableDefRegistry,\n    { provide: FOR_TABLE_DEF_REGISTRY, useExisting: TableDefRegistry },\n    { provide: TABLE_DEF_REGISTRATION, useExisting: TableDefRegistry },\n  ];\n}\n\n/**\n * Resolves the registry `<for-table-body>`'s own `providers` install.\n *\n * The lookup is optional only so the failure can be reported in the library's own\n * vocabulary: {@link TableDefRegistry} is absent from every barrel, so\n * a bare `NG0201: No provider found for _TableDefRegistry` names a symbol the\n * consumer cannot import and suggests no repair. The only shape that reaches it is\n * a subclass declaring its own `@Component` — Angular replaces the inherited\n * `providers` array wholesale — which is not a supported way to wrap the body.\n */\nexport function injectOwnTableDefRegistry(): TableDefRegistry {\n  const registry = inject(TableDefRegistry, { optional: true });\n  if (!registry) {\n    throw fortyError({\n      code: 'FORCDK-TABLE-001',\n      message: '<for-table-body> found no def registry of its own.',\n      cause:\n        'A subclass declaring its own @Component replaces the providers it would have inherited. ' +\n        'Subclassing the body is not a supported wrapping shape anyway, because a subclass ' +\n        'inherits no template either.',\n      fix:\n        \"Compose <for-table-body> inside a wrapper's template, and give the wrapper its own \" +\n        \"provideForTableDefRegistry() bound to the body's [defs].\",\n    });\n  }\n  return registry;\n}\n\nfunction injectTableDefRegistration(piece: string): TableDefRegistration {\n  const registration = inject(TABLE_DEF_REGISTRATION, { optional: true });\n  if (!registration) {\n    throw fortyError({\n      code: 'FORCDK-TABLE-002',\n      message: `${piece} must be used inside a <for-table-body>.`,\n      cause: `No TABLE_DEF_REGISTRATION provider is visible from ${piece}.`,\n      fix:\n        `Move ${piece} inside a <for-table-body>, or into a component that provides ` +\n        \"provideForTableDefRegistry() and binds that registry to a body's [defs].\",\n    });\n  }\n  return registration;\n}\n\nfunction injectDefHost(): Node {\n  return inject<ElementRef<Node>>(ElementRef).nativeElement;\n}\n\n/**\n * Registers a `[forTableColumnDef]` with the surrounding registry for the def's\n * lifetime. Call it from the def's constructor — it resolves the registry, the\n * host node, and the `DestroyRef` from the ambient injection context.\n */\nexport function registerTableColumnDef(def: ForTableColumnDef): void {\n  const registration = injectTableDefRegistration('ForTableColumnDef');\n  const handle: TableDefHandle<ForTableColumnDef> = { host: injectDefHost(), def };\n  registration.registerColumnDef(handle);\n  inject(DestroyRef).onDestroy(() => registration.unregisterColumnDef(handle));\n}\n\n/**\n * Registers a `[forTableRowDef]` with the surrounding registry for the def's\n * lifetime, type-erased over the def's row type — the same erasure the\n * `contentChildren(ForTableRowDef)` query performed implicitly before defs registered\n * themselves. The body only ever matches a def against data from the same `rows`\n * input, so the erasure is sound.\n */\nexport function registerTableRowDef<T>(def: ForTableRowDef<T>): void {\n  const registration = injectTableDefRegistration('ForTableRowDef');\n  const handle: TableDefHandle<ForTableRowDef<unknown>> = {\n    host: injectDefHost(),\n    def: def as unknown as ForTableRowDef<unknown>,\n  };\n  registration.registerRowDef(handle);\n  inject(DestroyRef).onDestroy(() => registration.unregisterRowDef(handle));\n}\n\n/**\n * Registers a `[forTableColumnDragPlaceholder]` with the surrounding registry for the\n * template's lifetime.\n */\nexport function registerTableColumnDragPlaceholder(def: ForTableColumnDragPlaceholder): void {\n  const registration = injectTableDefRegistration('ForTableColumnDragPlaceholder');\n  const handle: TableDefHandle<ForTableColumnDragPlaceholder> = { host: injectDefHost(), def };\n  registration.registerColumnDragPlaceholder(handle);\n  inject(DestroyRef).onDestroy(() => registration.unregisterColumnDragPlaceholder(handle));\n}\n\n/**\n * Registers a `[forTablePlaceholderCellDefault]` with the surrounding registry for the\n * template's lifetime.\n */\nexport function registerTablePlaceholderCellDefault(def: ForTablePlaceholderCellDefault): void {\n  const registration = injectTableDefRegistration('ForTablePlaceholderCellDefault');\n  const handle: TableDefHandle<ForTablePlaceholderCellDefault> = { host: injectDefHost(), def };\n  registration.registerPlaceholderCellDefault(handle);\n  inject(DestroyRef).onDestroy(() => registration.unregisterPlaceholderCellDefault(handle));\n}\n\n/**\n * Narrows a `[defs]`-bound registry to the library's own implementation. The\n * registration protocol is not public, so a hand-rolled `ForTableDefRegistry` has\n * no way to receive registrations — binding one is an authoring error, not a\n * supported extension point.\n */\nexport function assertTableDefRegistry(registry: ForTableDefRegistry): TableDefRegistry {\n  if (!(registry instanceof TableDefRegistry)) {\n    throw fortyError({\n      code: 'FORCDK-TABLE-003',\n      message: '<for-table-body> [defs] was bound to a value that is not a library def registry.',\n      cause:\n        'The registration protocol is not public, so a hand-rolled ForTableDefRegistry has no way ' +\n        'to receive registrations.',\n      fix: 'Bind [defs] to the registry provideForTableDefRegistry() installs.',\n    });\n  }\n  return registry;\n}\n","import {\n  booleanAttribute,\n  contentChild,\n  Directive,\n  inject,\n  input,\n  isDevMode,\n  TemplateRef,\n} from '@angular/core';\n\nimport { assertInputBound, isUnset, unsetInput } from 'forty-cdk/core';\n\nimport {\n  registerTableColumnDef,\n  registerTableColumnDragPlaceholder,\n  registerTablePlaceholderCellDefault,\n} from './def-registry';\nimport {\n  assertColumnName,\n  assertColumnTrack,\n  coerceSticky,\n  type TableStickyValue,\n} from './table-context';\n\n/**\n * Template context handed to each `[forTableCellDef]` stamped by `ForTableBody`:\n * the row datum (`let-row`) and its 0-based dataset index (`let-i=\"index\"`).\n */\nexport interface ForTableCellDefContext<T> {\n  /** The row datum for this cell (`let-row`). */\n  $implicit: T;\n  /**\n   * 0-based dataset index of the row (`let-i=\"index\"`). In a non-virtualized\n   * table this equals the row's rendered position; under `[forTableVirtualized]`\n   * it is the **absolute** index into the full dataset, not the position within\n   * the rendered window.\n   */\n  index: number;\n}\n\n/**\n * Marks the header-cell template of a column definition. Place on an\n * `<ng-template forTableHeaderCellDef>` inside a `[forTableColumnDef]`; its content is\n * stamped into the column's `[forTableHeaderCell]` by `ForTableBody`.\n */\n@Directive({ selector: 'ng-template[forTableHeaderCellDef]' })\nexport class ForTableHeaderCellDef {\n  /** The captured header-cell template. */\n  readonly template = inject<TemplateRef<unknown>>(TemplateRef);\n}\n\n/**\n * Marks the data-cell template of a column definition. Place on an\n * `<ng-template forTableCellDef>` inside a `[forTableColumnDef]`; its content is stamped\n * into the column's `[forTableCell]` for every rendered row, with the row datum\n * and index exposed through `ForTableCellDefContext`.\n *\n * Bind `[forTableCellDefRow]` to the same array passed to `ForTableBody`'s `rows`\n * to type `let-row` — the input is read only for type inference, never at\n * runtime.\n *\n * When the row type is a discriminated union whose variant members render\n * through a `[forTableRowDef]` instead of the per-column cells, bind\n * `[forTableCellDefUnless]` to the same type guard(s) used on those defs' `[when]`\n * so `let-row` is narrowed to the variant-excluded members (`Exclude<T, V>`).\n */\n@Directive({ selector: 'ng-template[forTableCellDef]' })\nexport class ForTableCellDef<T, V extends T = never> {\n  /** The captured data-cell template, typed with `ForTableCellDefContext<T>`. */\n  readonly template = inject<TemplateRef<ForTableCellDefContext<T>>>(TemplateRef);\n\n  /**\n   * Type-inference hint: bind to the same collection as `ForTableBody`'s `rows`\n   * so `let-row` is typed as the row type. Read only by the compiler; the\n   * directive never touches its value.\n   */\n  readonly rowType = input<readonly T[]>([], { alias: 'forTableCellDefRow' });\n\n  /**\n   * Type-inference hint: bind the type guard(s) that match the variant rows\n   * rendered by `[forTableRowDef]` (the same predicate used on their `[when]`) so\n   * `let-row` is narrowed to `Exclude<T, V>` — the members this per-column\n   * template actually receives. Compose several variants into one union guard\n   * (`(r): r is A | B => …`). Read only by the compiler; the directive never\n   * touches its value. Omitting it leaves `let-row` typed as the full `T`.\n   */\n  readonly excludeType = input<((row: T, index: number) => row is V) | null>(null, {\n    alias: 'forTableCellDefUnless',\n  });\n\n  /** Narrows the template context type for `let-row` under strict template checking. */\n  static ngTemplateContextGuard<T, V extends T>(\n    _directive: ForTableCellDef<T, V>,\n    _context: unknown,\n  ): _context is ForTableCellDefContext<Exclude<T, V>> {\n    return true;\n  }\n}\n\n/**\n * Marks the placeholder/skeleton template of a column definition. Optional;\n * place on an `<ng-template forTablePlaceholderCellDef>` inside a `[forTableColumnDef]`. When\n * `ForTableBody` is in its `loading` state it stamps this into the column's\n * `[forTableCell]` for each placeholder row.\n *\n * It is the first step of a three-step resolution: a column's own\n * `[forTablePlaceholderCellDef]` wins, else the body-level\n * `[forTablePlaceholderCellDefault]`, else the cell stays empty.\n */\n@Directive({ selector: 'ng-template[forTablePlaceholderCellDef]' })\nexport class ForTablePlaceholderCellDef {\n  /** The captured placeholder-cell template. */\n  readonly template = inject<TemplateRef<unknown>>(TemplateRef);\n}\n\n/**\n * Marks the **body-level default** placeholder/skeleton template. Optional and\n * declared **once per body** (not per column); place on an\n * `<ng-template forTablePlaceholderCellDefault>` among the `[forTableColumnDef]`s.\n * `ForTableBody` stamps it into every displayed column that declares no\n * `[forTablePlaceholderCellDef]` of its own — most columns of a table share one skeleton\n * shape, so it is declared once rather than repeated per def.\n *\n * Resolution order per column, in both stamping paths (`[loading]` placeholder\n * rows and `placeholderCells` row variants): the column's own\n * `[forTablePlaceholderCellDef]` → this default → an empty cell when neither exists.\n * The template receives no context, exactly like `[forTablePlaceholderCellDef]`.\n *\n * It registers itself with the surrounding body's def registry at construction,\n * so a wrapping component can declare it (or project it) — see\n * {@link ForTableDefRegistry}. Declared outside any registry it throws.\n */\n@Directive({ selector: 'ng-template[forTablePlaceholderCellDefault]' })\nexport class ForTablePlaceholderCellDefault {\n  /** The captured default placeholder-cell template. */\n  readonly template = inject<TemplateRef<unknown>>(TemplateRef);\n\n  constructor() {\n    registerTablePlaceholderCellDefault(this);\n  }\n}\n\n/**\n * Marks the shared drag placeholder for the reorderable columns of a\n * `<for-table-body>`. Optional and declared **once per body** (not per column);\n * place on an `<ng-template forTableColumnDragPlaceholder>` among the `[forTableColumnDef]`s.\n * `ForTableBody` stamps it as every reorderable header cell's\n * `[forDragPlaceholder]`, so during a pointer reorder the dragged column's slot\n * shows this template. Omit it to keep drag-drop's default placeholder behaviour.\n *\n * It registers itself with the surrounding body's def registry at construction,\n * so a wrapping component can declare it (or project it) — see\n * {@link ForTableDefRegistry}. Declared outside any registry it throws.\n */\n@Directive({ selector: 'ng-template[forTableColumnDragPlaceholder]' })\nexport class ForTableColumnDragPlaceholder {\n  /** The captured placeholder template rendered in a reordered column's slot. */\n  readonly template = inject<TemplateRef<unknown>>(TemplateRef);\n\n  constructor() {\n    registerTableColumnDragPlaceholder(this);\n  }\n}\n\n/**\n * Declarative definition of a single table column, co-locating its header,\n * data, and (optional) placeholder templates plus its per-column config in one\n * place. Place `[forTableColumnDef]` on an `<ng-container>` inside a `<for-table-body>`;\n * the container renders nothing itself — `ForTableBody` harvests the defs and\n * stamps the header row and data rows from them.\n *\n * The def **registers itself** with the surrounding body through DI at\n * construction (and unregisters when destroyed), so it does not have to be\n * declared content of the `<for-table-body>` element: a preset column component\n * may declare it in its own view, and a scaffold wrapper may project it into a\n * body it owns. See {@link ForTableDefRegistry} for both recipes. A def with no\n * reachable registry throws.\n *\n * @example\n * ```html\n * <ng-container forTableColumnDef=\"name\" sticky sortable resizable resizeAriaLabel=\"Resize name\">\n *   <ng-template forTableHeaderCellDef>Name</ng-template>\n *   <ng-template forTableCellDef [forTableCellDefRow]=\"rows()\" let-row>{{ row.name }}</ng-template>\n * </ng-container>\n * ```\n */\n@Directive({ selector: '[forTableColumnDef]' })\nexport class ForTableColumnDef {\n  /**\n   * Column identifier — reflected as `data-column` on the stamped cells and used to key the resize\n   * width var. Mandatory — an unbound def throws in dev mode.\n   */\n  readonly name = input(unsetInput<string>(), { alias: 'forTableColumnDef' });\n\n  /**\n   * Sticky placement forwarded to both the header cell and every data cell:\n   * `true` (or the bare `sticky` attribute) pins to the start edge, `'end'` to\n   * the end edge, `false` (default) is not sticky. The consumer applies\n   * `position: sticky` + offsets in CSS off the emitted `data-sticky` hook.\n   */\n  readonly sticky = input(false as TableStickyValue, { transform: coerceSticky });\n\n  /**\n   * When set, the column's header cell becomes a sortable affordance: `ForTableBody`\n   * applies `[forTableSortHeader]`, derives its direction from the body's `sort`\n   * input, and re-emits activation through the body's `sortChange` output.\n   */\n  readonly sortable = input(false, { transform: booleanAttribute });\n\n  /**\n   * When set, `ForTableBody` renders a `[forTableColumnResizer]` inside the column's\n   * header cell and re-emits its commits through the body's `resizeCommit` output.\n   * Provide `resizeAriaLabel` so the handle is named. Tune the handle per column with\n   * `resizeMin` / `resizeMax` / `resizeStep` / `autoFit` / `fitIncludesHeader`, and\n   * seed / track its width through the body's `[(columnWidths)]`.\n   */\n  readonly resizable = input(false, { transform: booleanAttribute });\n\n  /**\n   * When set, the column's header cell becomes a drag-reorder handle: with at least\n   * one `reorderable` column, `ForTableBody` applies `[forTableColumnReorder]` to the\n   * stamped header row and `[forDraggable]` (with `[dragData]` set to this column's\n   * `name`) to this header cell, and re-emits committed reorders through the body's\n   * `columnReorder` output. Non-reorderable columns stay static (not draggable).\n   * The body bundles `forty-cdk/drag-drop` whether or not a column is `reorderable`\n   * (a measured 18.0 kB raw / 5.1 kB gzip — see the table README's bundle note).\n   */\n  readonly reorderable = input(false, { transform: booleanAttribute });\n\n  /**\n   * Accessible name for the auto-wired resize handle (only meaningful with\n   * `resizable`). Supplied by the consumer so it is localizable; `null` (default)\n   * ships no `aria-label`.\n   */\n  readonly resizeAriaLabel = input<string | null>(null);\n\n  /**\n   * Minimum width (px) the auto-wired resize handle clamps to (only meaningful with\n   * `resizable`). Forwarded to the stamped `[forTableColumnResizer]`'s `min`; drives\n   * its `aria-valuemin`. Default `0`.\n   */\n  readonly resizeMin = input<number>(0);\n\n  /**\n   * Maximum width (px) the auto-wired resize handle clamps to (only meaningful with\n   * `resizable`). Forwarded to the stamped `[forTableColumnResizer]`'s `max`; drives\n   * its `aria-valuemax` (omitted when non-finite). Default `Infinity` (no upper bound).\n   */\n  readonly resizeMax = input<number>(Infinity);\n\n  /**\n   * Pixels applied per `ArrowLeft` / `ArrowRight` press on the auto-wired resize\n   * handle (only meaningful with `resizable`). Forwarded to the stamped\n   * `[forTableColumnResizer]`'s `step`. Default `10`.\n   */\n  readonly resizeStep = input<number>(10);\n\n  /**\n   * Whether double-clicking the auto-wired resize handle fits the column to its\n   * widest content (only meaningful with `resizable`). Forwarded to the stamped\n   * `[forTableColumnResizer]`'s `autoFit`. Default `true` — the historical\n   * hardcoded behaviour; set `false` to make the double-click a no-op.\n   */\n  readonly autoFit = input(true, { transform: booleanAttribute });\n\n  /**\n   * Whether header-inclusive auto-fit also accounts for the column header's label\n   * (only meaningful with `resizable` + `autoFit`). Forwarded to the stamped\n   * `[forTableColumnResizer]`'s `fitIncludesHeader`; isolate the header text with a\n   * `[forTableColumnLabel]` inside the `[forTableHeaderCellDef]` template. Default `false`.\n   */\n  readonly fitIncludesHeader = input(false, { transform: booleanAttribute });\n\n  /**\n   * `grid-template-columns` track fragment for this column (e.g. `'160px'`,\n   * `'minmax(160px, 1fr)'`). When unset, `ForTableBody` falls back to the\n   * published `--for-table-col-<name>-width` resize var with `fallbackWidth`\n   * (or `minmax(0, 1fr)`) as the var's default, so a resized column drives its\n   * own track. A static `width` **takes precedence** over that resize var — so\n   * leave it unset on a `resizable` column whose width you drive through\n   * `resizeCommit` or the body's `[(columnWidths)]`, otherwise the pinned track\n   * ignores the resized width (the handle still reports `aria-valuenow` but the\n   * column won't move). Dev-mode-guarded against fragments that would escape the\n   * derived track string (see `fallbackWidth`).\n   */\n  readonly width = input<string | null>(null);\n\n  /**\n   * `grid-template-columns` track fragment used as the resize-var **fallback**\n   * for a column with no explicit `width` — the track the column renders before\n   * a width is committed or seeded (e.g. `'minmax(120px, 2.5fr)'` for a\n   * weighted, floor-bounded fluid column). Unlike `width` it does not pin the\n   * column, so the resizer (and the body's `[(columnWidths)]`) still drives it\n   * and the first published width snaps the column to px. Ignored when `width`\n   * is set. Defaults to `minmax(0, 1fr)`.\n   *\n   * Any open track vocabulary is accepted (`minmax()`, `fit-content()`,\n   * `calc()`, `clamp()`, `var()`), but in dev mode a fragment that would escape\n   * the derived `grid-template-columns` string throws instead of silently\n   * collapsing the layout: an empty fragment (pass `null` to leave the track\n   * unset), a `;` / `{` / `}` / quote / comment opener, or unbalanced\n   * parentheses — a stray `)` here would close the enclosing `var(` early and\n   * swallow the rest of the track.\n   */\n  readonly fallbackWidth = input<string | null>(null);\n\n  /**\n   * Static class(es) applied to this column's stamped `[forTableHeaderCell]`.\n   * `ForTableBody` owns the header cell element, so this is the styling seam a\n   * consumer (or wrapping design system) uses to reach it without scoping CSS to\n   * the body's template internals. `null` (default) adds no class attribute.\n   */\n  readonly headerClass = input<string | null>(null);\n\n  /**\n   * Static class(es) applied to this column's stamped `[forTableCell]` on every\n   * data **and** placeholder row. The styling seam for the cell box itself\n   * (padding, truncation, alignment, sticky backgrounds) that `ForTableBody`\n   * owns. Per-datum row styling is out of scope. `null` (default) adds no class\n   * attribute.\n   */\n  readonly cellClass = input<string | null>(null);\n\n  /** The column's header-cell template. */\n  readonly header = contentChild.required(ForTableHeaderCellDef);\n  /** The column's data-cell template. */\n  readonly dataCell = contentChild.required(ForTableCellDef);\n  /**\n   * The column's optional placeholder-cell template. When absent, `ForTableBody`\n   * falls back to its `[forTablePlaceholderCellDefault]`, then to an empty cell.\n   */\n  readonly placeholderCell = contentChild(ForTablePlaceholderCellDef);\n\n  constructor() {\n    assertInputBound(this.name, 'table', '[forTableColumnDef]', 'forTableColumnDef');\n    registerTableColumnDef(this);\n  }\n}\n\n/**\n * Dev-mode guard for one column definition's CSS-bound config: its `name`\n * (interpolated into the `--for-table-col-<name>-width` custom property) and\n * its `width` / `fallbackWidth` track fragments.\n *\n * Called from `ForTableBody`'s track builder — the point at which the values are\n * interpolated — rather than from an `effect` on the def, so the throw carries a\n * stack naming the render that would have produced the broken declaration and\n * no reactive node is created per def in a production build. It follows that\n * only a *displayed* column is checked, which is exactly the set whose values\n * reach CSS.\n *\n * @param def The column definition to check.\n */\nexport function assertColumnDefConfig(def: ForTableColumnDef): void {\n  if (!isDevMode()) {\n    return;\n  }\n  const name = def.name();\n  const piece = isUnset(name) ? '[forTableColumnDef]' : `forTableColumnDef=\"${name}\"`;\n  if (!isUnset(name)) {\n    assertColumnName(name, 'ForTableColumnDef');\n  }\n  const width = def.width();\n  if (width !== null) {\n    assertColumnTrack(width, 'width', piece);\n  }\n  const fallbackWidth = def.fallbackWidth();\n  if (fallbackWidth !== null) {\n    assertColumnTrack(fallbackWidth, 'fallbackWidth', piece);\n  }\n}\n","import {\n  booleanAttribute,\n  contentChild,\n  Directive,\n  inject,\n  input,\n  TemplateRef,\n} from '@angular/core';\n\nimport { assertInputBound, unsetInput } from 'forty-cdk/core';\n\nimport { type ForTableCellDefContext } from './column-def';\nimport { registerTableRowDef } from './def-registry';\n\n/**\n * Marks the content template of a full-span row variant. Place on an\n * `<ng-template forTableRowCellDef>` inside a `[forTableRowDef]`; its content is\n * stamped into a single cell that spans every column of the matched row, with the\n * row datum and its index exposed through `ForTableCellDefContext`.\n *\n * The spanning cell is presentational, so its template must **not** contain\n * interactive content (buttons, links, form controls) — the variant row stays\n * out of the grid's single-tab-stop roving order, so nested tabbables become\n * unreachable — nor a `[forTableCell]`, which would register a cell handle on\n * the variant row and make the roving grid ragged.\n *\n * Bind `[forTableRowCellDefRow]` to the same array passed to `ForTableBody`'s\n * `rows` to type `let-row` — the input is read only for type inference, never at\n * runtime.\n *\n * When the row type is a discriminated union, also bind `[forTableRowCellDefWhen]`\n * to the same type guard used on the def's `[when]` so `let-row` is narrowed to\n * the matched variant member (`V`) instead of staying the full union.\n */\n@Directive({ selector: 'ng-template[forTableRowCellDef]' })\nexport class ForTableRowCellDef<T, V extends T = T> {\n  /** The captured row-variant template, typed with `ForTableCellDefContext<T>`. */\n  readonly template = inject<TemplateRef<ForTableCellDefContext<T>>>(TemplateRef);\n\n  /**\n   * Type-inference hint: bind to the same collection as `ForTableBody`'s `rows`\n   * so `let-row` is typed as the row type. Read only by the compiler; the\n   * directive never touches its value.\n   */\n  readonly rowType = input<readonly T[]>([], { alias: 'forTableRowCellDefRow' });\n\n  /**\n   * Type-inference hint: bind the same type guard used on this def's `[when]`\n   * so `let-row` is narrowed to the matched variant member (`V`). Read only by\n   * the compiler; the directive never touches its value. Omitting it leaves\n   * `let-row` typed as the full `T`.\n   */\n  readonly narrowType = input<((row: T, index: number) => row is V) | null>(null, {\n    alias: 'forTableRowCellDefWhen',\n  });\n\n  /** Narrows the template context type for `let-row` under strict template checking. */\n  static ngTemplateContextGuard<T, V extends T>(\n    _directive: ForTableRowCellDef<T, V>,\n    _context: unknown,\n  ): _context is ForTableCellDefContext<V> {\n    return true;\n  }\n}\n\n/**\n * Declarative definition of a row variant for `<for-table-body>`. Place\n * `[forTableRowDef]` on an `<ng-container>` alongside the `[forTableColumnDef]`s and\n * bind a `[when]` predicate; for every datum the predicate matches, `ForTableBody`\n * renders this variant instead of the per-column data cells. A def comes in one of\n * two shapes, and must declare **exactly one** of them:\n *\n * - **Full-span** (a `[forTableRowCellDef]` template): the row's single cell spans every\n *   column — group headers, section separators, summary or empty-state rows. It carries\n *   the row's `role` plus `aria-colindex=\"1\"` and an `aria-colspan` equal to the column\n *   count, but registers no cell handle, so roving arrow navigation steps over the row.\n * - **Placeholder cells** (the `placeholderCells` flag, no `[forTableRowCellDef]`): the row\n *   stamps one cell per displayed column from each column's `[forTablePlaceholderCellDef]`\n *   — skeleton rows for infinite-scroll or paginated tables. These keep the roving grid\n *   rectangular, and are stamped disabled so arrow navigation steps over them.\n *\n * Either way the variant row is presentational and non-selectable — its `value` stays `undefined` —\n * while still occupying a row slot and counting towards `aria-rowindex` / `aria-rowcount`.\n *\n * When several defs match a datum the first in DOM order wins; a datum matched by none renders the\n * standard per-column row.\n *\n * Like `[forTableColumnDef]`, the def registers itself with the surrounding body through DI at\n * construction, so a preset component may declare it in its own view and a scaffold wrapper may\n * project it into a body it owns — see {@link ForTableDefRegistry}. A def with no reachable\n * registry throws.\n *\n * @example\n * ```html\n * <for-table-body [rows]=\"rows()\">\n *   <ng-container forTableColumnDef=\"name\">\n *     <ng-template forTableHeaderCellDef>Name</ng-template>\n *     <ng-template forTableCellDef [forTableCellDefRow]=\"rows()\" let-row>{{ row.name }}</ng-template>\n *     <ng-template forTablePlaceholderCellDef><span class=\"skeleton\"></span></ng-template>\n *   </ng-container>\n *\n *   <!-- full-span group header -->\n *   <ng-container forTableRowDef [when]=\"isGroupHeader\">\n *     <ng-template forTableRowCellDef [forTableRowCellDefRow]=\"rows()\" let-row>{{ row.group }}</ng-template>\n *   </ng-container>\n *\n *   <!-- per-column skeleton rows while the next page loads -->\n *   <ng-container forTableRowDef [when]=\"isPlaceholder\" placeholderCells />\n * </for-table-body>\n * ```\n */\n@Directive({ selector: '[forTableRowDef]' })\nexport class ForTableRowDef<T> {\n  /**\n   * Predicate selecting which data rows render this variant instead of the\n   * per-column row. Receives the datum and its 0-based dataset index and returns\n   * `true` to render the variant. In a non-virtualized table the index equals\n   * the row's rendered position; under `[forTableVirtualized]` it is the\n   * **absolute** index into the full dataset. Evaluated for every datum on each\n   * change-detection pass, so keep it cheap and free of side effects.\n   *\n   * Mandatory — an unbound def throws in dev mode.\n   */\n  readonly when = input(unsetInput<(row: T, index: number) => boolean>());\n\n  /**\n   * The variant's full-span content template. Present for a full-span def; absent\n   * (and unused) when `placeholderCells` is set. A def must declare exactly one of\n   * a `[forTableRowCellDef]` template or `placeholderCells` — the body validates this and\n   * throws a `[forty-cdk/table]` error otherwise.\n   */\n  readonly cell = contentChild(ForTableRowCellDef);\n\n  /**\n   * Render this variant's matched rows as **per-column placeholder cells** instead\n   * of a full-span `[forTableRowCellDef]`. Set it (the bare `placeholderCells` attribute)\n   * for interleaved / trailing skeleton rows — infinite-scroll or paginated tables\n   * that keep their loaded rows and append placeholder rows while the next page\n   * loads. The body stamps one `[forTableCell]` per displayed column from that\n   * column's `[forTablePlaceholderCellDef]` template (an empty cell when the column omits\n   * it), exactly like the `loading` state, but stamps the cells disabled so\n   * grid-mode arrow navigation steps over them and the roving grid stays\n   * rectangular.\n   *\n   * A def must declare **exactly one** of a `[forTableRowCellDef]` template or\n   * `placeholderCells`; declaring both or neither throws a `[forty-cdk/table]`\n   * error.\n   */\n  readonly placeholderCells = input(false, { transform: booleanAttribute });\n\n  constructor() {\n    assertInputBound(this.when, 'table', '[forTableRowDef]', 'when');\n    registerTableRowDef(this);\n  }\n}\n","const INTERACTIVE_ROLES = [\n  'button',\n  'link',\n  'checkbox',\n  'radio',\n  'switch',\n  'tab',\n  'menuitem',\n  'menuitemcheckbox',\n  'menuitemradio',\n  'option',\n  'textbox',\n  'searchbox',\n  'combobox',\n  'slider',\n  'spinbutton',\n  'treeitem',\n];\n\nconst INTERACTIVE_DESCENDANT_SELECTOR = [\n  'button',\n  'a[href]',\n  'input',\n  'select',\n  'textarea',\n  'summary',\n  'label',\n  'audio[controls]',\n  'video[controls]',\n  '[contenteditable=\"true\"]',\n  '[contenteditable=\"\"]',\n  '[contenteditable=\"plaintext-only\"]',\n  ...INTERACTIVE_ROLES.map((role) => `[role=\"${role}\"]`),\n].join(', ');\n\n/**\n * Whether `event` originated from an interactive element nested inside the row it\n * is bound to — a consumer-placed `button`, `a[href]`, `input`, `select`,\n * `textarea`, `summary`, `label`, `audio`/`video[controls]`, an editable\n * `contenteditable` region (`\"\"` / `\"true\"` / `\"plaintext-only\"`, but not\n * `\"false\"`), or an element carrying an interactive ARIA `role` descendant of the\n * row host. Resolves the event target's closest interactive element and reports\n * `true` only when it is a strict descendant of `event.currentTarget` (the row),\n * so a plain click on cell text, the gaps between cells, or the row host itself\n * reports `false`. Shared by the two row-interaction call sites — `ForTableBody`'s\n * whole-row activation and `ForTableRow`'s selection — so both skip firing for\n * clicks the inner control owns.\n */\nexport function eventFromInteractiveDescendant(event: Event): boolean {\n  const target = event.target;\n  const rowEl = event.currentTarget;\n  if (!(target instanceof Element) || !(rowEl instanceof HTMLElement)) {\n    return false;\n  }\n  const interactive = target.closest(INTERACTIVE_DESCENDANT_SELECTOR);\n  return interactive !== null && interactive !== rowEl && rowEl.contains(interactive);\n}\n","import {\n  booleanAttribute,\n  computed,\n  Directive,\n  ElementRef,\n  inject,\n  Injector,\n  input,\n} from '@angular/core';\n\nimport { type ForTableCellHandle, registerHandle } from 'forty-cdk/core';\nimport {\n  coerceSticky,\n  injectTableContext,\n  injectTableRowRegistration,\n  injectTableRowContext,\n  type TableStickyValue,\n} from './table-context';\n\n/**\n * Marks a data cell. The `role` is derived from the root's `mode`: `'cell'` in\n * `table` mode and `'gridcell'` in `grid` / `treegrid` mode. In grid / treegrid\n * mode the cell is a roving-tabindex target — the single active cell carries\n * `tabindex=\"0\"` (others `-1`), reflects `data-highlighted` when focused, and\n * carries a 1-based `aria-colindex`. Arrow / Home / End / Ctrl+Home / Ctrl+End /\n * PageUp / PageDown move focus between cells. Requires a `name` input that\n * identifies the column — reflected as `data-column`. Optionally sticky and\n * optionally disabled (disabled cells are skipped during navigation).\n */\n@Directive({\n  selector: '[forTableCell]',\n  exportAs: 'forTableCell',\n  host: {\n    '[attr.role]': 'role()',\n    '[attr.tabindex]': 'tabindex()',\n    '[attr.aria-colindex]': 'colIndex()',\n    '[attr.aria-disabled]': 'disabled() ? \"true\" : null',\n    '[attr.data-column]': 'name()',\n    '[attr.data-sticky]': \"sticky() ? (sticky() === 'end' ? 'end' : '') : null\",\n    '[attr.data-highlighted]': 'highlighted() ? \"\" : null',\n    '[attr.data-disabled]': 'disabled() ? \"\" : null',\n    '(focus)': 'onFocus()',\n    '(keydown)': 'onKeyDown($event)',\n  },\n})\nexport class ForTableCell {\n  protected readonly ctx = injectTableContext('ForTableCell');\n  protected readonly rowCtx = injectTableRowContext('ForTableCell');\n  readonly #rowRegistration = injectTableRowRegistration('ForTableCell');\n  readonly #host = inject<ElementRef<HTMLElement>>(ElementRef).nativeElement;\n\n  /**\n   * This cell's element injector. Exposed so a declarative renderer stamping cell\n   * content from a projected `<ng-template>` (e.g. `ForTableBody`) can pass it as\n   * `[ngTemplateOutletInjector]`, letting row-context-dependent primitives inside\n   * that content (`[forTableRowSelector]`, …) resolve their `[forTableRow]`.\n   */\n  readonly injector = inject(Injector);\n\n  protected readonly role = computed(() => (this.ctx.mode() === 'table' ? 'cell' : 'gridcell'));\n\n  /** Column identifier, reflected as `data-column`. Required by later phases (sort, resize, reorder). */\n  readonly name = input.required<string>();\n\n  /**\n   * Sticky placement for this data cell. `true` (or the bare `sticky` attribute)\n   * pins to the start edge; `'end'` pins to the end edge; `false` (default) is not\n   * sticky. The consumer applies `position: sticky` and the offsets in CSS — this\n   * input only provides the `data-sticky` hook.\n   */\n  readonly sticky = input(false as TableStickyValue, { transform: coerceSticky });\n\n  /**\n   * Whether this data cell is disabled. Disabled cells are skipped during arrow-key\n   * navigation, drop out of the tab order, and reflect `aria-disabled` / `data-disabled`.\n   * Only meaningful in `grid` / `treegrid` mode.\n   */\n  readonly disabled = input(false, { transform: booleanAttribute });\n\n  protected readonly tabindex = computed<number | null>(() => {\n    if (this.ctx.mode() === 'table') {\n      return null;\n    }\n    if (this.disabled()) {\n      return -1;\n    }\n    return this.ctx.cellTabIndex(this.#host);\n  });\n\n  protected readonly colIndex = computed<number | null>(() =>\n    this.ctx.mode() === 'table' ? null : this.rowCtx.cellIndexOf(this.#host) + 1,\n  );\n\n  protected readonly highlighted = computed(\n    () => this.ctx.mode() !== 'table' && this.ctx.isCellHighlighted(this.#host),\n  );\n\n  constructor() {\n    const handle: ForTableCellHandle = { host: this.#host, disabled: this.disabled };\n    registerHandle(\n      handle,\n      (h) => this.#rowRegistration.registerCell(h),\n      (h) => this.#rowRegistration.unregisterCell(h),\n    );\n  }\n\n  protected onFocus(): void {\n    this.ctx.activateCell(this.#host);\n  }\n\n  protected onKeyDown(event: KeyboardEvent): void {\n    this.ctx.handleCellKeydown(event, this.#host);\n  }\n}\n","import { DestroyRef, Directive, ElementRef, inject, output, PLATFORM_ID } from '@angular/core';\nimport { isPlatformBrowser } from '@angular/common';\n\nimport {\n  FOR_DRAGGABLE_LIFT_GUARD,\n  FOR_DROP_LIST_DEFAULT_ORIENTATION,\n  FOR_DROP_LIST_ROVING_DELEGATE,\n  ForDropList,\n  type ForDragDropEvent,\n  type ForDraggableLiftGuard,\n  type ForDropListRovingDelegate,\n  moveItemInArray,\n} from 'forty-cdk/drag-drop';\nimport { translateWindowReorder } from 'forty-cdk/core';\nimport { hostHasSortActivation, injectTableContext } from './table-context';\n\n/** Payload of `columnReorder`: the move's indices and the resulting column-name order. */\nexport interface TableColumnReorderDescriptor {\n  /**\n   * Previous 0-based index into the **full displayed column order**, counting\n   * non-reorderable columns; feed it (with `to`) to `moveItemInArray` over the\n   * full displayed-columns array.\n   */\n  from: number;\n  /**\n   * New 0-based index into the **full displayed column order**, counting\n   * non-reorderable columns; feed it (with `from`) to `moveItemInArray` over the\n   * full displayed-columns array.\n   */\n  to: number;\n  /**\n   * The reorderable columns in their new order, read from each draggable header\n   * cell's `dragData`. Equal to the full displayed order only when every displayed\n   * column is reorderable; otherwise it omits the non-reorderable columns.\n   */\n  columns: readonly string[];\n}\n\n/**\n * Opt-in **column reordering** for `ForTable`, composed over the drag-drop primitive.\n *\n * Apply on the `[forTableHeaderRow]` element. It wraps `[forDropList]` (via\n * `hostDirectives`) so the header cells become a reorderable list, then translates\n * drag-drop's generic drop into the table-friendly `columnReorder` output. Mark each\n * `[forTableHeaderCell]` as `[forDraggable]` with `[dragData]` set to the column name.\n * On a committed drop (pointer or keyboard) it emits the previous / new index (into the\n * full displayed column order) and the reorderable columns' new order; the consumer\n * applies it to their own column array. **It never reorders columns itself** (BYO-data).\n *\n * The wrapped list defaults to `orientation=\"horizontal\"` (a column reorder is always along\n * the row axis), so no `orientation` binding is needed. Bind `orientation=\"vertical\"` to\n * override for the rare case.\n *\n * In `mode=\"grid\"` / `mode=\"treegrid\"` the draggable header cells join the table's composite\n * roving grid as its first row, so a sortable + column-reorderable grid keeps the **single\n * tab stop** the WAI-ARIA Data Grid pattern calls for: `Tab` enters the grid once, Arrow keys\n * cross between header and body, and `Space` on a header cell lifts it for keyboard reordering.\n * It hands its drop-list roving to the grid via `FOR_DROP_LIST_ROVING_DELEGATE` and routes idle\n * header navigation through the table's grid keyboard handler.\n *\n * When a header cell is both sortable (`[forTableSortHeader]`) and reorderable, the two\n * keyboard activations split along WAI-ARIA lines so a single key never both sorts and lifts:\n * `Space` lifts the column, `Enter` toggles the sort. The split is enforced via a\n * `FOR_DRAGGABLE_LIFT_GUARD` that defers `Enter` to the sort header on cells carrying the\n * `data-sortable` marker — detected by DOM marker, so `forty-cdk/drag-drop` needs no table\n * import. A reorder-only header (no sort header) still lifts on both `Enter` and `Space`.\n *\n * @example\n * ```html\n * <div forTableHeaderRow forTableColumnReorder (columnReorder)=\"columns.set($event.columns)\">\n *   @for (col of columns(); track col) {\n *     <div forTableHeaderCell [name]=\"col\" forDraggable [dragData]=\"col\">{{ col }}</div>\n *   }\n * </div>\n * ```\n */\n@Directive({\n  selector: '[forTableColumnReorder]',\n  exportAs: 'forTableColumnReorder',\n  providers: [\n    { provide: FOR_DROP_LIST_DEFAULT_ORIENTATION, useValue: 'horizontal' },\n    {\n      provide: FOR_DROP_LIST_ROVING_DELEGATE,\n      useFactory: (): ForDropListRovingDelegate => {\n        const ctx = injectTableContext('ForTableColumnReorder');\n        return {\n          itemTabindex: (el) =>\n            ctx.headerParticipatesInRoving() ? ctx.headerCellTabIndex(el) : null,\n          isItemHighlighted: (el) =>\n            ctx.headerParticipatesInRoving() ? ctx.isCellHighlighted(el) : null,\n        };\n      },\n    },\n    {\n      provide: FOR_DRAGGABLE_LIFT_GUARD,\n      useValue: {\n        canLiftOnKey: (event, host) => !(event.key === 'Enter' && hostHasSortActivation(host)),\n      } satisfies ForDraggableLiftGuard,\n    },\n  ],\n  hostDirectives: [\n    {\n      directive: ForDropList,\n      inputs: [\n        'orientation',\n        'dir',\n        'disabled',\n        'autoScroll',\n        'animateReorder',\n        'liveSort',\n        'boundary',\n        'lockAxis',\n      ],\n    },\n  ],\n})\nexport class ForTableColumnReorder {\n  protected readonly ctx = injectTableContext('ForTableColumnReorder');\n  readonly #list = inject(ForDropList);\n  readonly #host = inject<ElementRef<HTMLElement>>(ElementRef).nativeElement;\n  readonly #isBrowser = isPlatformBrowser(inject(PLATFORM_ID));\n\n  /**\n   * Fires once per committed reorder gesture (pointer drop or keyboard drop) with the\n   * previous / new column index (into the full displayed column order, counting\n   * non-reorderable columns) and the reorderable columns' new order after the move.\n   */\n  readonly columnReorder = output<TableColumnReorderDescriptor>();\n\n  constructor() {\n    const destroyRef = inject(DestroyRef);\n    const sub = this.#list.dragDrop.subscribe((event: ForDragDropEvent) => this.#emit(event));\n    destroyRef.onDestroy(() => sub.unsubscribe());\n\n    if (this.#isBrowser) {\n      const onCaptureKeydown = (event: KeyboardEvent): void => this.#onCaptureKeydown(event);\n      const controller = new AbortController();\n      this.#host.addEventListener('keydown', onCaptureKeydown, {\n        capture: true,\n        signal: controller.signal,\n      });\n      destroyRef.onDestroy(() => controller.abort());\n    }\n  }\n\n  /**\n   * When the header row joins the composite grid, intercepts idle (not-lifted) Arrow /\n   * Home / End / Page keys on a draggable header cell in the capture phase and routes them\n   * through the table's grid navigation, then stops propagation so the draggable's own\n   * keydown does not also navigate. Space / Enter (and every key while a keyboard drag is in\n   * progress) fall through untouched, so the draggable still owns the lift / move / drop /\n   * cancel gesture — keeping the header one navigation continuum with the body while\n   * preserving column reordering.\n   */\n  #onCaptureKeydown(event: KeyboardEvent): void {\n    if (!this.ctx.headerParticipatesInRoving()) {\n      return;\n    }\n    const target = event.target;\n    if (!(target instanceof HTMLElement)) {\n      return;\n    }\n    if (\n      !this.#list.items().some((handle) => handle.host === target) ||\n      this.#list.isLifted(target)\n    ) {\n      return;\n    }\n    if (this.ctx.handleHeaderCellKeydown(event, target)) {\n      event.stopPropagation();\n    }\n  }\n\n  #emit(event: ForDragDropEvent): void {\n    const items = this.#list.items();\n    const names = items.map((handle) => String(handle.data()));\n    const columns = moveItemInArray(names, event.previousIndex, event.currentIndex);\n    const displayedIndices = items.map((handle) => this.ctx.headerCellIndexOf(handle.host));\n    const { from, to } = displayedIndices.some((index) => index < 0)\n      ? { from: event.previousIndex, to: event.currentIndex }\n      : translateWindowReorder(displayedIndices, event.previousIndex, event.currentIndex);\n    this.columnReorder.emit({ from, to, columns });\n  }\n}\n","import {\n  computed,\n  Directive,\n  ElementRef,\n  inject,\n  Injector,\n  input,\n  type Signal,\n  signal,\n} from '@angular/core';\n\nimport { type ForTableCellHandle, registerHandle } from 'forty-cdk/core';\nimport {\n  coerceSticky,\n  hostHasDraggable,\n  injectTableContext,\n  injectTableRegistration,\n  type TableStickyValue,\n} from './table-context';\n\n/**\n * Marks a header cell (`role=\"columnheader\"`). Requires a `name` input that\n * identifies the column — reflected as `data-column` for later phases (sort,\n * resize, reorder) to key off. Optionally sticky via the `sticky` input.\n *\n * In `grid` / `treegrid` mode the header cell joins the roving-navigation grid\n * as a cell of the grid's first row, so the header and body share a single\n * composite tab stop and Arrow keys navigate between them. The active header\n * cell carries `tabindex=\"0\"` (others `-1`), reflects `data-highlighted` when\n * focused, and carries a 1-based `aria-colindex`.\n *\n * When a `[forDraggable]` shares the cell (a `[forTableColumnReorder]` row) the\n * cell still participates in that composite grid — `aria-colindex` and focus\n * activation stay on the cell — but it yields the host `tabindex`, keydown, and\n * `data-highlighted` to the draggable, so the grid keeps a single tab stop and\n * `[forTableColumnReorder]` routes idle Arrow navigation across it.\n */\n@Directive({\n  selector: '[forTableHeaderCell]',\n  exportAs: 'forTableHeaderCell',\n  host: {\n    role: 'columnheader',\n    '[attr.tabindex]': 'tabindex()',\n    '[attr.aria-colindex]': 'colIndex()',\n    '[attr.data-column]': 'name()',\n    '[attr.data-sticky]': \"sticky() ? (sticky() === 'end' ? 'end' : '') : null\",\n    '[attr.data-highlighted]': 'highlighted() ? \"\" : null',\n    '(focus)': 'onFocus()',\n    '(keydown)': 'onKeyDown($event)',\n  },\n})\nexport class ForTableHeaderCell {\n  protected readonly ctx = injectTableContext('ForTableHeaderCell');\n  readonly #registration = injectTableRegistration('ForTableHeaderCell');\n\n  /**\n   * The header cell's host element (`role=\"columnheader\"`). Exposed so a descendant\n   * `[forTableColumnResizer]` can resolve the enclosing cell through DI to measure its\n   * base width — robust to `hostDirectives` composition, where the `[forTableHeaderCell]`\n   * selector attribute is not reflected onto the wrapper's host element.\n   */\n  readonly el = inject<ElementRef<HTMLElement>>(ElementRef);\n  readonly #host = this.el.nativeElement;\n\n  /**\n   * This header cell's element injector. Exposed so a declarative renderer stamping\n   * header content from a projected `<ng-template>` (e.g. `ForTableBody`) can pass it\n   * as `[ngTemplateOutletInjector]`, letting context-dependent primitives inside that\n   * content resolve this cell and the table.\n   */\n  readonly injector = inject(Injector);\n\n  /** Column identifier, reflected as `data-column`. Required by later phases (sort, resize, reorder). */\n  readonly name = input.required<string>();\n\n  readonly #labelEl = signal<HTMLElement | null>(null);\n\n  /** Header cells are never disabled; exposed so the roving grid can treat them uniformly with data cells. */\n  readonly #disabled = signal(false);\n\n  /**\n   * A co-located affordance (e.g. `[forTableSortHeader]`) that needs the header\n   * cell to be a standalone `tabindex=\"0\"` tab stop whenever it is not part of the\n   * body's roving composite grid — that is, in `mode=\"table\"`, or in a\n   * column-reorder header row where the header does not join the roving grid. The\n   * header cell is the single owner of the host `tabindex` — sibling directives\n   * never bind it — so it reflects this intent instead of letting a second\n   * `[tabindex]` binding fight it on the same element.\n   */\n  readonly #standaloneTabStop = signal<Signal<boolean> | null>(null);\n\n  /**\n   * Registers an intent that makes this header cell a `tabindex=\"0\"` tab stop when\n   * it is not participating in the roving composite grid. Called by\n   * `[forTableSortHeader]` so the two never bind `[tabindex]` on the same host.\n   */\n  registerStandaloneTabStop(active: Signal<boolean>): void {\n    this.#standaloneTabStop.set(active);\n  }\n\n  /** Clears a previously registered standalone tab-stop intent. Reference-based. */\n  unregisterStandaloneTabStop(active: Signal<boolean>): void {\n    if (this.#standaloneTabStop() === active) {\n      this.#standaloneTabStop.set(null);\n    }\n  }\n\n  /**\n   * The element a descendant `[forTableColumnLabel]` marks as this column's label\n   * text, or `null` when no marker is present. A sibling `[forTableColumnResizer]`\n   * reads it to measure the header label for header-inclusive auto-fit, isolating\n   * the label from the resize handle / sort affordance without DOM assumptions.\n   */\n  readonly labelEl = this.#labelEl.asReadonly();\n\n  /** Registers a descendant `[forTableColumnLabel]` as this header cell's label element. */\n  registerLabel(el: HTMLElement): void {\n    this.#labelEl.set(el);\n  }\n\n  /** Unregisters the label element. Reference-based; safe to call if never registered. */\n  unregisterLabel(el: HTMLElement): void {\n    if (this.#labelEl() === el) {\n      this.#labelEl.set(null);\n    }\n  }\n\n  /**\n   * Sticky placement for this header cell. `true` (or the bare `sticky`\n   * attribute) pins to the start edge; `'end'` pins to the end edge; `false`\n   * (default) is not sticky. The consumer applies `position: sticky` and the\n   * appropriate `top` / `left` / `right` offset in CSS — this input only\n   * provides the `data-sticky` hook.\n   */\n  readonly sticky = input(false as TableStickyValue, { transform: coerceSticky });\n\n  /** `true` when a `[forDraggable]` shares this cell and owns its host `tabindex` / keydown instead. */\n  readonly #yieldsToDraggable = hostHasDraggable(this.#host);\n\n  /**\n   * `true` when this header row joins the body's composite roving grid (`grid` /\n   * `treegrid` mode with a complete header row). A draggable header cell\n   * (`[forTableColumnReorder]`) still participates — it carries `aria-colindex`\n   * and activates the roving cell on focus — even though it yields the host\n   * `tabindex`, keydown, and `data-highlighted` to its co-located `[forDraggable]`.\n   */\n  readonly #participates = computed(() => this.ctx.headerParticipatesInRoving());\n\n  /** `true` when this cell owns its host `tabindex` / keydown as a plain roving grid cell (no draggable). */\n  readonly #inRovingGrid = computed(() => !this.#yieldsToDraggable && this.#participates());\n\n  protected readonly tabindex = computed<0 | -1 | null>(() => {\n    if (this.#yieldsToDraggable) {\n      return null;\n    }\n    if (this.#inRovingGrid()) {\n      return this.ctx.headerCellTabIndex(this.#host);\n    }\n    return this.#standaloneTabStop()?.() ? 0 : null;\n  });\n\n  protected readonly colIndex = computed<number | null>(() =>\n    this.#participates() ? this.ctx.headerCellIndexOf(this.#host) + 1 : null,\n  );\n\n  protected readonly highlighted = computed(\n    () =>\n      !this.#yieldsToDraggable && this.#participates() && this.ctx.isCellHighlighted(this.#host),\n  );\n\n  constructor() {\n    const handle: ForTableCellHandle = { host: this.#host, disabled: this.#disabled };\n    registerHandle(\n      handle,\n      (h) => this.#registration.registerHeaderCell(h),\n      (h) => this.#registration.unregisterHeaderCell(h),\n    );\n  }\n\n  protected onFocus(): void {\n    if (this.#participates()) {\n      this.ctx.activateCell(this.#host);\n    }\n  }\n\n  protected onKeyDown(event: KeyboardEvent): void {\n    if (this.#inRovingGrid()) {\n      this.ctx.handleCellKeydown(event, this.#host);\n    }\n  }\n}\n","import {\n  afterNextRender,\n  booleanAttribute,\n  computed,\n  DestroyRef,\n  Directive,\n  DOCUMENT,\n  effect,\n  ElementRef,\n  inject,\n  input,\n  model,\n  output,\n  PLATFORM_ID,\n  signal,\n} from '@angular/core';\nimport { isPlatformBrowser } from '@angular/common';\n\nimport {\n  clamp,\n  createPointerDragSession,\n  type PointerDragSession,\n  DRAG_DEAD_ZONE_PX,\n} from 'forty-cdk/core';\nimport { assertColumnName, injectTableContext, injectTableRegistration } from './table-context';\nimport { ForTableHeaderCell } from './table-header-cell';\n\n/** Payload of `resizeCommit`: which column was resized and its committed width (px). */\nexport interface TableResizeDescriptor {\n  column: string;\n  width: number;\n}\n\n/**\n * Turns a focusable element inside a `[forTableHeaderCell]` into a column-resize\n * handle. Supports pointer drag (with a dead-zone so a plain click is a no-op) and\n * `ArrowLeft` / `ArrowRight` keyboard resize, both constrained to `[min, max]`.\n * Pressing `Escape` (or a `pointercancel`) during a drag reverts the width to where\n * the gesture started and emits no `resizeCommit`. Being destroyed mid-drag reverts\n * too, reporting the pre-drag width through the `[widthRevert]` callback because the\n * `[(width)]` model can no longer emit during teardown.\n *\n * On every change it publishes the resolved width as the CSS custom property\n * `--for-table-col-<column>-width` on the table root, so the consumer can apply it\n * to their layout (`grid-template-columns` in `<div>` mode, a `<col>` / cell width\n * in native `<table>` mode). **It never lays out columns itself and never resizes\n * data** — it owns the affordance, accessibility, and the published width only.\n *\n * Reflects `data-resizing` (empty string) while a pointer drag is active. Carries\n * `role=\"separator\"` with `aria-orientation=\"vertical\"` and live `aria-value*`,\n * mirroring `[forPaneResizer]`. The consumer supplies `aria-label`. Before the first\n * gesture, `aria-valuenow` falls back to the header-cell width measured once on mount\n * (browser-only), so a separator with no `[width]` is never announced without a\n * current value; an explicit `[width]` always takes precedence.\n *\n * In `mode=\"grid\"` / `\"treegrid\"` it yields its tab stop to the composite roving grid\n * (`tabindex=\"-1\"`) and is reached via cell-entry (Enter / F2 focuses the first focusable\n * inside the header cell), so it must sit on a natively-focusable element (a `<button>`)\n * to stay cell-entry-reachable. In `mode=\"table\"` it is a standalone tab stop\n * (`tabindex=\"0\"`).\n *\n * Opt in to size-to-content with `[autoFit]`: double-clicking the handle then fits the\n * column to its widest data-cell content via `fitToContent()` (also callable imperatively\n * through `exportAs=\"forTableColumnResizer\"`, e.g. from a column menu). Unset (default),\n * `dblclick` is a no-op and the resize behaviour is unchanged. Add `[fitIncludesHeader]`\n * to also account for the column header's label (marked with a sibling\n * `[forTableColumnLabel]`), fitting to `max(header label, …data cells)`.\n *\n * @example\n * ```html\n * <th forTableHeaderCell name=\"name\">\n *   Name\n *   <button forTableColumnResizer column=\"name\" [(width)]=\"nameWidth\"\n *           aria-label=\"Resize Name column\"></button>\n * </th>\n * ```\n */\n@Directive({\n  selector: '[forTableColumnResizer]',\n  exportAs: 'forTableColumnResizer',\n  host: {\n    role: 'separator',\n    'aria-orientation': 'vertical',\n    '[attr.tabindex]': 'tabindex()',\n    '[attr.aria-valuenow]': 'width() ?? measuredWidth() ?? null',\n    '[attr.aria-valuemin]': 'min()',\n    '[attr.aria-valuemax]': 'ariaValueMax()',\n    '[attr.data-resizing]': 'resizing() ? \"\" : null',\n    '(keydown)': 'onKeyDown($event)',\n    '(click)': 'onClick($event)',\n    '(dblclick)': 'autoFit() && fitToContent()',\n  },\n})\nexport class ForTableColumnResizer {\n  protected readonly ctx = injectTableContext('ForTableColumnResizer');\n  readonly #registration = injectTableRegistration('ForTableColumnResizer');\n  readonly #host = inject<ElementRef<HTMLElement>>(ElementRef).nativeElement;\n  readonly #document = inject(DOCUMENT);\n  readonly #headerCell = inject(ForTableHeaderCell, { optional: true });\n\n  /** Column identity; included in the `resizeCommit` payload and the published CSS var name. */\n  readonly column = input.required<string>();\n\n  /**\n   * Current column width in pixels. Two-way bindable via `[(width)]`. Acts as both\n   * the controlled value and the base a pointer drag / arrow step is applied to.\n   * When unset, the base for the first gesture is measured from the header cell.\n   * Its implicit `widthChange` fires on every live update (drag tick, arrow press);\n   * `resizeCommit` is the distinct column-aware gesture-end event.\n   */\n  readonly width = model<number>();\n\n  /** Minimum width in pixels. Default `0`. */\n  readonly min = input<number>(0);\n\n  /** Maximum width in pixels. Default `Infinity` (no upper bound). */\n  readonly max = input<number>(Infinity);\n\n  /** Pixels applied per `ArrowLeft` / `ArrowRight` press. Default `10`. */\n  readonly step = input<number>(10);\n\n  /**\n   * Opt-in size-to-content. When set, double-clicking the handle fits the column to\n   * its widest data-cell content via `fitToContent()`. Unset (default), `dblclick` is\n   * a no-op and the resize behaviour is unchanged.\n   */\n  readonly autoFit = input(false, { transform: booleanAttribute });\n\n  /**\n   * Opt-in: also account for the column header's label width when fitting to content,\n   * so `fitToContent()` sizes to `max(header label, …data cells)` instead of data cells\n   * only. The header label is isolated through a sibling `[forTableColumnLabel]` marker\n   * (the resize handle / sort affordance are excluded). When set without a marker present,\n   * it degrades to data-cells-only. Unset (default), the header is ignored.\n   */\n  readonly fitIncludesHeader = input(false, { transform: booleanAttribute });\n\n  /**\n   * Fires once per resize gesture — at pointer-up after a drag, and on every arrow\n   * press — with the column identity and its committed width. Bind it to persist\n   * the width; live updates during a drag come through `[(width)]` / `widthChange`.\n   */\n  readonly resizeCommit = output<TableResizeDescriptor>();\n\n  /**\n   * Teardown-only revert channel. Called with the pre-drag width when the handle is\n   * destroyed mid-drag — the column is removed, or `resizable` is toggled off — so the\n   * transient drag width never survives as the consumer's persisted value. On every\n   * other revert path (`Escape`, `pointercancel`) the pre-drag width arrives through\n   * `[(width)]` / `widthChange` as usual and this callback does not fire.\n   *\n   * Bound as a function reference (`[widthRevert]=\"onRevert\"`), not as an event binding:\n   * the `[(width)]` model — like any `output()` on this directive — is already destroyed\n   * when the unmount revert happens, so an emitter-based channel cannot deliver it.\n   */\n  readonly widthRevert = input<((descriptor: TableResizeDescriptor) => void) | undefined>(\n    undefined,\n  );\n\n  /** `aria-valuemax`, omitted when `max` is non-finite (the default unbounded case). */\n  protected readonly ariaValueMax = computed<number | null>(() =>\n    Number.isFinite(this.max()) ? this.max() : null,\n  );\n\n  protected readonly tabindex = computed<0 | -1>(() => (this.ctx.mode() === 'table' ? 0 : -1));\n\n  readonly #resizing = signal(false);\n\n  /** Whether a pointer drag is currently active (drives `data-resizing`). */\n  protected readonly resizing = this.#resizing.asReadonly();\n\n  readonly #measuredWidth = signal<number | null>(null);\n\n  /**\n   * Header-cell width measured once on mount (browser-only). Backs `aria-valuenow`\n   * before any explicit `[width]` so the focusable separator never ships without a\n   * current value on the measured-fallback path; an explicit `[width]` still wins.\n   */\n  protected readonly measuredWidth = this.#measuredWidth.asReadonly();\n\n  #pointerSession: PointerDragSession | null = null;\n\n  #dragStartCoord = 0;\n  #dragStartValue = 0;\n  #dragInvert = false;\n  #dragCurrent = 0;\n\n  #publishedColumn: string | null = null;\n\n  #destroying = false;\n\n  readonly #isBrowser = isPlatformBrowser(inject(PLATFORM_ID));\n\n  constructor() {\n    const destroyRef = inject(DestroyRef);\n    effect(() => {\n      const column = this.column();\n      assertColumnName(column, 'ForTableColumnResizer');\n      const w = this.width();\n      if (this.#publishedColumn !== null && this.#publishedColumn !== column) {\n        this.#registration.removeColumnWidth(this.#publishedColumn);\n      }\n      if (w != null) {\n        this.#registration.setColumnWidth(column, w);\n        this.#publishedColumn = column;\n      } else {\n        this.#registration.removeColumnWidth(column);\n        this.#publishedColumn = null;\n      }\n    });\n    destroyRef.onDestroy(() => this.#registration.removeColumnWidth(this.column()));\n    if (this.#isBrowser) {\n      afterNextRender(() => this.#measuredWidth.set(this.#measureBaseWidth()));\n      this.#pointerSession = createPointerDragSession({\n        host: this.#host,\n        document: this.#document,\n        armThreshold: DRAG_DEAD_ZONE_PX,\n        capturePointer: true,\n        cancelOnEscape: true,\n        cancelOnDestroy: true,\n        canStart: (event) => this.#onDragStart(event),\n        onLift: () => true,\n        onMove: (event) => this.#onDragMove(event),\n        onCommit: () => this.#onDragCommit(),\n        onCancel: () => this.#onDragCancel(),\n      });\n      destroyRef.onDestroy(() => {\n        this.#destroying = true;\n        this.#pointerSession?.destroy();\n      });\n    }\n  }\n\n  /**\n   * Sizes the column to its content: measures the widest natural width across the\n   * column's data cells (resolved through the table context, browser-only) — and, when\n   * `[fitIncludesHeader]` is set with a sibling `[forTableColumnLabel]` present, the\n   * header label too, so the fit becomes `max(header label, …data cells)`. Clamps the\n   * result to `[min, max]`, applies it as the new `[(width)]`, and emits `resizeCommit`.\n   * Wired to a `dblclick` on the handle when `[autoFit]` is set, and callable\n   * imperatively (e.g. from a column menu) via `exportAs=\"forTableColumnResizer\"`.\n   * Returns the applied width; a no-op returning the current width off the browser.\n   */\n  fitToContent(): number {\n    if (!this.#isBrowser) {\n      return this.width() ?? this.min();\n    }\n    const next = clamp(this.#measureContentWidth(), this.min(), this.max());\n    this.width.set(next);\n    this.resizeCommit.emit({ column: this.column(), width: next });\n    return next;\n  }\n\n  #onDragStart(event: PointerEvent): boolean {\n    if (event.pointerType === 'mouse' && event.button !== 0) {\n      return false;\n    }\n    event.preventDefault();\n    event.stopPropagation();\n    const ltr = this.ctx.dir() !== 'rtl';\n    this.#dragInvert = !ltr;\n    this.#dragStartCoord = event.clientX;\n    this.#dragStartValue = this.width() ?? this.#measureBaseWidth();\n    this.#dragCurrent = this.#dragStartValue;\n    return true;\n  }\n\n  #onDragMove(event: PointerEvent): void {\n    let delta = event.clientX - this.#dragStartCoord;\n    if (this.#dragInvert) {\n      delta = -delta;\n    }\n    const next = clamp(this.#dragStartValue + delta, this.min(), this.max());\n    if (next === this.#dragCurrent) {\n      return;\n    }\n    this.#dragCurrent = next;\n    this.#resizing.set(true);\n    this.width.set(next);\n  }\n\n  #onDragCommit(): void {\n    this.#resizing.set(false);\n    this.resizeCommit.emit({ column: this.column(), width: this.#dragCurrent });\n  }\n\n  #onDragCancel(): void {\n    this.#resizing.set(false);\n    if (this.#dragCurrent === this.#dragStartValue) {\n      return;\n    }\n    this.#dragCurrent = this.#dragStartValue;\n    if (this.#destroying) {\n      this.widthRevert()?.({ column: this.column(), width: this.#dragStartValue });\n      return;\n    }\n    this.width.set(this.#dragStartValue);\n  }\n\n  protected onKeyDown(event: KeyboardEvent): void {\n    const ltr = this.ctx.dir() !== 'rtl';\n    const base = this.width() ?? this.#measureBaseWidth();\n    let next: number;\n    if (event.key === 'ArrowRight') {\n      next = clamp(base + (ltr ? this.step() : -this.step()), this.min(), this.max());\n    } else if (event.key === 'ArrowLeft') {\n      next = clamp(base + (ltr ? -this.step() : this.step()), this.min(), this.max());\n    } else {\n      return;\n    }\n    event.preventDefault();\n    if (next === this.width()) {\n      return;\n    }\n    this.width.set(next);\n    this.resizeCommit.emit({ column: this.column(), width: next });\n  }\n\n  protected onClick(event: MouseEvent): void {\n    event.stopPropagation();\n  }\n\n  #measureBaseWidth(): number {\n    const cell = this.#headerCell?.el.nativeElement ?? this.#host;\n    return cell.getBoundingClientRect().width;\n  }\n\n  #measureContentWidth(): number {\n    const column = this.column();\n    const cells = this.#registration\n      .rows()\n      .flatMap((row) => row.cells())\n      .map((cell) => cell.host)\n      .filter((host) => host.getAttribute('data-column') === column);\n    const headerCell = this.#headerCell?.el.nativeElement ?? null;\n    const labelEl = this.fitIncludesHeader() ? (this.#headerCell?.labelEl() ?? null) : null;\n    if (cells.length === 0 && !labelEl) {\n      return this.#measureBaseWidth();\n    }\n    const doc = this.#host.ownerDocument;\n    const root =\n      this.#host.closest<HTMLElement>('[role=\"table\"], [role=\"grid\"], [role=\"treegrid\"]') ??\n      doc.body;\n    const probe = doc.createElement('div');\n    probe.setAttribute('aria-hidden', 'true');\n    probe.style.cssText =\n      'position:absolute;top:0;left:-9999px;visibility:hidden;pointer-events:none;';\n    root.appendChild(probe);\n    try {\n      let widest = 0;\n      for (const cell of cells) {\n        widest = Math.max(widest, this.#measureClone(probe, cell));\n      }\n      if (labelEl && headerCell) {\n        widest = Math.max(\n          widest,\n          this.#measureClone(probe, labelEl) + this.#horizontalBox(headerCell),\n        );\n      }\n      return widest;\n    } finally {\n      root.removeChild(probe);\n    }\n  }\n\n  #measureClone(probe: HTMLElement, source: HTMLElement): number {\n    const clone = source.cloneNode(true) as HTMLElement;\n    const style = source.ownerDocument.defaultView?.getComputedStyle(source);\n    if (style) {\n      clone.style.fontFamily = style.fontFamily;\n      clone.style.fontSize = style.fontSize;\n      clone.style.fontWeight = style.fontWeight;\n      clone.style.fontStyle = style.fontStyle;\n      clone.style.letterSpacing = style.letterSpacing;\n      clone.style.textTransform = style.textTransform;\n    }\n    clone.style.display = 'inline-block';\n    clone.style.width = 'auto';\n    clone.style.minWidth = '0';\n    clone.style.maxWidth = 'none';\n    clone.style.whiteSpace = 'nowrap';\n    probe.appendChild(clone);\n    return clone.getBoundingClientRect().width;\n  }\n\n  #horizontalBox(el: HTMLElement): number {\n    const style = el.ownerDocument.defaultView?.getComputedStyle(el);\n    if (!style) {\n      return 0;\n    }\n    const px = (value: string): number => parseFloat(value) || 0;\n    return (\n      px(style.paddingLeft) +\n      px(style.paddingRight) +\n      px(style.borderLeftWidth) +\n      px(style.borderRightWidth)\n    );\n  }\n}\n","import { Directive, ElementRef, inject, DestroyRef } from '@angular/core';\n\nimport { injectTableContext, injectTableRegistration } from './table-context';\n\n/**\n * Marks the header row of the table (`role=\"row\"`). Registers its host\n * element with the root so `ForTable` can measure the header's height and\n * publish `--for-table-header-height` for sticky-cell CSS.\n *\n * In `grid` / `treegrid` mode the header row is the grid's first row for ARIA\n * numbering, so it emits `aria-rowindex=\"1\"` and every data row's index shifts\n * up by one (matching the APG Data Grid example, where `aria-rowcount` counts\n * the header row too).\n */\n@Directive({\n  selector: '[forTableHeaderRow]',\n  exportAs: 'forTableHeaderRow',\n  host: {\n    role: 'row',\n    '[attr.aria-rowindex]': 'rowIndex()',\n  },\n})\nexport class ForTableHeaderRow {\n  protected readonly ctx = injectTableContext('ForTableHeaderRow');\n  readonly #registration = injectTableRegistration('ForTableHeaderRow');\n  readonly #host = inject<ElementRef<HTMLElement>>(ElementRef);\n\n  /** 1-based `aria-rowindex` for the header row (`1` in grid / treegrid mode, else absent). */\n  protected readonly rowIndex = this.ctx.headerRowIndex;\n\n  constructor() {\n    const el = this.#host.nativeElement;\n    this.#registration.registerHeaderRow(el);\n    inject(DestroyRef).onDestroy(() => this.#registration.unregisterHeaderRow(el));\n  }\n}\n","import {\n  booleanAttribute,\n  computed,\n  Directive,\n  ElementRef,\n  inject,\n  Injector,\n  input,\n  numberAttribute,\n  type Signal,\n} from '@angular/core';\n\nimport {\n  Collection,\n  type ForTableCellHandle,\n  registerHandle,\n  TABLE_ROW_REGISTRATION_CONTEXT,\n} from 'forty-cdk/core';\nimport { eventFromInteractiveDescendant } from './interactive-descendant';\nimport {\n  FOR_TABLE_ROW_CONTEXT,\n  type ForTableRowContext,\n  type TableSelectionMode,\n  injectTableContext,\n  injectTableRegistration,\n} from './table-context';\n\n/**\n * Marks a data row (`role=\"row\"`). Owns the registry of its data cells (for\n * `aria-colindex`) and registers itself with the root so it joins the row index\n * space and the 2D navigation grid. In `grid`/`treegrid` mode `aria-rowindex` is\n * 1-based and counts the header row as row 1, so the first data row is row 2 when\n * a header row is present (matching the APG Data Grid numbering).\n */\n@Directive({\n  selector: '[forTableRow]',\n  exportAs: 'forTableRow',\n  host: {\n    role: 'row',\n    '[attr.aria-rowindex]': 'rowIndex()',\n    '[attr.aria-selected]': 'ariaSelected()',\n    '[attr.data-selected]': 'selected() ? \"\" : null',\n    '[attr.aria-level]': 'ariaLevel()',\n    '[attr.aria-posinset]': 'posinset()',\n    '[attr.aria-setsize]': 'setsize()',\n    '[attr.aria-expanded]': 'ariaExpanded()',\n    '[attr.data-state]': 'expandState()',\n    '(click)': 'onClick($event)',\n  },\n  providers: [\n    { provide: FOR_TABLE_ROW_CONTEXT, useExisting: ForTableRow },\n    { provide: TABLE_ROW_REGISTRATION_CONTEXT, useExisting: ForTableRow },\n  ],\n})\nexport class ForTableRow implements ForTableRowContext {\n  protected readonly ctx = injectTableContext('ForTableRow');\n  readonly #registration = injectTableRegistration('ForTableRow');\n  readonly #host = inject<ElementRef<HTMLElement>>(ElementRef).nativeElement;\n  readonly #cells = new Collection<ForTableCellHandle>();\n\n  /**\n   * This row's element injector. Exposed so a declarative renderer stamping\n   * full-span variant content from a projected `<ng-template>` (e.g.\n   * `ForTableBody`) can pass it as `[ngTemplateOutletInjector]`, letting\n   * row-context-dependent primitives inside that content resolve this row.\n   */\n  readonly injector = inject(Injector);\n\n  /** This row's selection identity, written into the table's `[(value)]`. Leave unset for non-selectable rows. */\n  readonly value = input<unknown>();\n\n  /** 1-based tree depth for `aria-level` in `mode=\"treegrid\"`. Ignored in other modes. */\n  readonly level = input(1, { transform: numberAttribute });\n\n  /** Marks this row as an expandable parent — emits `aria-expanded` + `data-state`. */\n  readonly expandable = input(false, { transform: booleanAttribute });\n\n  /**\n   * Absolute 0-based index of this row in the full virtualized dataset. Set by the\n   * consumer when rendering a window via `[forTableVirtualized]`; drives the absolute\n   * `aria-rowindex` and keeps the focused row mounted across recycling. Leave unset\n   * (default `null`) for non-virtualized tables. Ignored in `mode=\"table\"`.\n   */\n  readonly virtualIndex = input<number | null, unknown>(null, {\n    transform: (v) => (v == null ? null : numberAttribute(v)),\n  });\n\n  protected readonly rowIndex = computed<number | null>(() => {\n    if (this.ctx.mode() === 'table') {\n      return null;\n    }\n    const offset = this.ctx.dataRowIndexOffset();\n    const vi = this.virtualIndex();\n    return vi !== null ? vi + 1 + offset : this.ctx.rowIndexOf(this.#host) + 1 + offset;\n  });\n\n  readonly selectionMode: Signal<TableSelectionMode> = this.ctx.selectionMode;\n\n  readonly selected = computed(() => {\n    const v = this.value();\n    return v !== undefined && this.ctx.isRowSelected(v);\n  });\n\n  protected readonly ariaSelected = computed<'true' | 'false' | null>(() => {\n    if (\n      this.ctx.mode() === 'table' ||\n      this.ctx.selectionMode() === 'none' ||\n      this.value() === undefined\n    ) {\n      return null;\n    }\n    return this.selected() ? 'true' : 'false';\n  });\n\n  /** Whether this expandable row is currently open. False for non-expandable rows. */\n  readonly expanded = computed(() => {\n    const v = this.value();\n    return v !== undefined && this.ctx.isRowExpanded(v);\n  });\n\n  /** Toggles this row's expansion. No-op when the row is not expandable or has no `[value]`. */\n  toggleExpanded(): void {\n    if (this.expandable()) {\n      this.ctx.toggleRowExpansion(this.value());\n    }\n  }\n\n  protected readonly ariaLevel = computed<number | null>(() =>\n    this.ctx.mode() === 'treegrid' ? this.level() : null,\n  );\n  protected readonly posinset = computed<number | null>(() =>\n    this.ctx.mode() === 'treegrid' ? this.ctx.rowPosinset(this.#host) : null,\n  );\n  protected readonly setsize = computed<number | null>(() =>\n    this.ctx.mode() === 'treegrid' ? this.ctx.rowSetsize(this.#host) : null,\n  );\n  protected readonly ariaExpanded = computed<'true' | 'false' | null>(() =>\n    this.ctx.mode() === 'treegrid' && this.expandable()\n      ? this.expanded()\n        ? 'true'\n        : 'false'\n      : null,\n  );\n  protected readonly expandState = computed<'open' | 'closed' | null>(() =>\n    this.ctx.mode() === 'treegrid' && this.expandable()\n      ? this.expanded()\n        ? 'open'\n        : 'closed'\n      : null,\n  );\n\n  constructor() {\n    const handle = {\n      host: this.#host,\n      cells: this.#cells.items,\n      value: this.value,\n      level: this.level,\n      expandable: this.expandable,\n      virtualIndex: this.virtualIndex,\n    };\n    registerHandle(\n      handle,\n      (h) => this.#registration.registerRow(h),\n      (h) => this.#registration.unregisterRow(h),\n    );\n  }\n\n  private registerCell(handle: ForTableCellHandle): void {\n    this.#cells.register(handle);\n  }\n\n  private unregisterCell(handle: ForTableCellHandle): void {\n    this.#cells.unregister(handle);\n  }\n\n  cellIndexOf(host: HTMLElement): number {\n    return this.#cells.indexOfHost(host);\n  }\n\n  toggleSelected(): void {\n    const v = this.value();\n    if (v !== undefined) {\n      this.ctx.toggleRowSelection(v);\n    }\n  }\n\n  protected onClick(event: MouseEvent): void {\n    const v = this.value();\n    if (\n      this.ctx.selectionMode() === 'none' ||\n      v === undefined ||\n      eventFromInteractiveDescendant(event)\n    ) {\n      return;\n    }\n    this.ctx.selectRow(v, {\n      ctrlKey: event.ctrlKey,\n      metaKey: event.metaKey,\n      shiftKey: event.shiftKey,\n    });\n  }\n}\n","import { Directive, effect, ElementRef, inject, input } from '@angular/core';\n\n/**\n * Applies a per-row attribute map to a `<for-table-body>` stamped row. The body\n * places it on every stamped row so its `rowAttrs` hook can set or remove\n * arbitrary attributes derived from the row datum, without the body owning a\n * static list of attribute names. A key mapped to `null` (or dropped from a\n * later map) removes that attribute. Internal to `forty-cdk/table`.\n */\n@Directive({ selector: '[forTableRowAttrs]' })\nexport class ForTableRowAttrs {\n  readonly #host = inject<ElementRef<HTMLElement>>(ElementRef).nativeElement;\n\n  /** The attribute map to reflect on the row host, or `undefined` for none. */\n  readonly attrs = input<Record<string, string | null> | undefined>(undefined, {\n    alias: 'forTableRowAttrs',\n  });\n\n  constructor() {\n    let applied: readonly string[] = [];\n    effect(() => {\n      const next = this.attrs() ?? {};\n      for (const key of applied) {\n        if (!(key in next)) {\n          this.#host.removeAttribute(key);\n        }\n      }\n      const keys: string[] = [];\n      for (const [key, value] of Object.entries(next)) {\n        if (value == null) {\n          this.#host.removeAttribute(key);\n        } else {\n          this.#host.setAttribute(key, value);\n        }\n        keys.push(key);\n      }\n      applied = keys;\n    });\n  }\n}\n","import {\n  booleanAttribute,\n  computed,\n  DestroyRef,\n  Directive,\n  ElementRef,\n  inject,\n  input,\n  model,\n  output,\n} from '@angular/core';\n\nimport { eventFromInteractiveDescendant } from './interactive-descendant';\nimport { hostHasDraggable, injectTableContext } from './table-context';\nimport { ForTableHeaderCell } from './table-header-cell';\n\n/** Sort direction for a column header. `'none'` means unsorted (no aria-sort emitted). */\nexport type TableSortDirection = 'ascending' | 'descending' | 'none';\n\n/** Payload of `sortChange`: which column changed and its new direction. */\nexport interface TableSortDescriptor {\n  column: string;\n  direction: TableSortDirection;\n}\n\n/**\n * Turns a `[forTableHeaderCell]` into a sortable affordance that emits `aria-sort`\n * and fires `sortChange` on activation (click, Enter, Space). The directive is\n * **self-contained**: it owns only its own `direction` state and does NOT register\n * with the table context or auto-reset sibling headers. The \"one sorted column at a\n * time\" guarantee is the consumer's responsibility — hold a single sort descriptor\n * signal and derive each header's `direction` from it. Apply this directive on the\n * same element as `[forTableHeaderCell]`.\n *\n * The directive emits its own `tabindex=\"0\"` only in `mode=\"table\"`. In `grid` /\n * `treegrid` mode the header cell owns the roving composite tab stop, so this directive\n * emits no `tabindex`; `aria-sort` / `data-sorted` and click / keyboard activation stay\n * on the cell. When a `[forDraggable]` (column reorder) shares the same host cell — in\n * either mode — this directive also yields its `tabindex` to the draggable's roving tab\n * stop so the two never collide on the host attribute, and the keyboard activation splits\n * along WAI-ARIA lines: `Space` lifts the column for reordering while `Enter` toggles the\n * sort, so a single key press never both sorts and starts a drag-lift. The draggable is\n * detected by DOM marker (the `forDraggable` / `forFreeDrag` attribute), not by a\n * drag-drop value-import.\n *\n * While `sortable`, the directive reflects the `data-sortable` marker (a CSS styling\n * hook, absent when `sortable` is `false`). In `grid` / `treegrid` mode the header cell\n * reads that marker to defer APG cell entry on `Enter`: `Enter` toggles the sort and\n * keeps focus on the cell, while `F2` remains the cell-entry key — so a sortable +\n * resizable header does not both sort and drop focus onto the resize handle.\n *\n * Cycle (default `firstClickDirection='ascending'`): `none → ascending → descending → none`.\n * With `disableClear`: `none → ascending → descending → ascending`.\n *\n * `firstClickDirection='descending'` flips the entry pole, so a freshly activated\n * column starts descending: `none → descending → ascending → none` (and with\n * `disableClear`: `none → descending → ascending → descending`) — the descending-first\n * behavior used by single-always-active sort descriptors.\n *\n * A `click`, `Space`, or `Enter` originating from an interactive descendant of the\n * header cell — a stamped `[forTableColumnResizer]` handle, or a consumer-placed\n * `button` / `a[href]` / `input` / `select` / `textarea` / `summary` / editable\n * `contenteditable` / role-based control — does not toggle the sort and leaves the\n * descendant's own activation intact. (A non-native custom handle carrying only\n * `role=\"separator\"` / `tabindex` is not matched by the shared interactive-descendant\n * selector, so it would still bubble to sort; the stamped resize handle and the\n * documented example are native `<button>`s, so this is not a real path today.)\n */\n@Directive({\n  selector: '[forTableSortHeader]',\n  exportAs: 'forTableSortHeader',\n  host: {\n    '[attr.aria-sort]': 'activeDirection()',\n    '[attr.data-sorted]': 'activeDirection()',\n    '[attr.data-sortable]': \"sortable() ? '' : null\",\n    '(click)': 'onClick($event)',\n    '(keydown)': 'onKeyDown($event)',\n  },\n})\nexport class ForTableSortHeader {\n  protected readonly ctx = injectTableContext('ForTableSortHeader');\n  readonly #host = inject<ElementRef<HTMLElement>>(ElementRef).nativeElement;\n  readonly #headerCell = inject(ForTableHeaderCell, { self: true, optional: true });\n  readonly #hasDraggable = hostHasDraggable(this.#host);\n\n  /** Column identity included in the `sortChange` payload. */\n  readonly column = input.required<string>();\n\n  /**\n   * Current sort direction. Acts as both the controlled value and the initial value.\n   * Its implicit `directionChange` output fires on every internal update (via\n   * `[(direction)]`). `sortChange` is the primary column-aware event consumers bind:\n   * it carries a `{ column, direction }` descriptor and fires on every activation,\n   * regardless of whether the consumer uses two-way binding.\n   */\n  readonly direction = model<TableSortDirection>('none');\n\n  /**\n   * When `true`, the cycle skips the `'none'` step: `ascending → descending → ascending`.\n   * Useful when clearing the sort is not allowed.\n   */\n  readonly disableClear = input(false, { transform: booleanAttribute });\n\n  /**\n   * Direction a previously-unsorted column enters on its first activation (the\n   * `'none' → ?` step of the cycle). Defaults to `'ascending'`. Set to `'descending'`\n   * for descending-first columns. The toggle between the two sorted directions and the\n   * optional `'none'` step (`disableClear`) are unchanged.\n   */\n  readonly firstClickDirection = input<'ascending' | 'descending'>('ascending');\n\n  /**\n   * When `false`, the header is fully inert: no `tabindex`, no `aria-sort`, and click /\n   * keyboard handlers are no-ops. Defaults to `true`.\n   */\n  readonly sortable = input(true, { transform: booleanAttribute });\n\n  /**\n   * Fires on every activation with the column identity and the new direction.\n   * Consumers bind this to update their own sort descriptor and reorder rows.\n   */\n  readonly sortChange = output<TableSortDescriptor>();\n\n  /**\n   * Truthy-only `aria-sort` / `data-sorted` value: `'ascending'` or `'descending'`\n   * while sorted, `null` (absent) when `direction` is `'none'` or `sortable` is `false`.\n   */\n  protected readonly activeDirection = computed<TableSortDirection | null>(() =>\n    this.sortable() && this.direction() !== 'none' ? this.direction() : null,\n  );\n\n  /**\n   * Whether this sort header needs the host to be a standalone `tabindex=\"0\"` tab\n   * stop: a sortable, non-draggable header. The header cell honors this only when it\n   * is not part of the body's roving composite grid (`mode=\"table\"`, or a\n   * column-reorder header row); in a plain grid / treegrid header the roving grid\n   * owns the tab stop and this intent is superseded.\n   */\n  readonly #standaloneTabStop = computed(() => this.sortable() && !this.#hasDraggable);\n\n  constructor() {\n    this.#headerCell?.registerStandaloneTabStop(this.#standaloneTabStop);\n    inject(DestroyRef).onDestroy(() =>\n      this.#headerCell?.unregisterStandaloneTabStop(this.#standaloneTabStop),\n    );\n  }\n\n  /**\n   * Handles pointer activation, forwarding to `activate()` unless the click\n   * originated from an interactive descendant of the header cell (which owns its\n   * own activation).\n   */\n  protected onClick(event: MouseEvent): void {\n    if (eventFromInteractiveDescendant(event)) {\n      return;\n    }\n    this.activate();\n  }\n\n  /** Activates the sort: computes the next direction, updates the model, and emits `sortChange`. */\n  protected activate(): void {\n    if (!this.sortable()) return;\n    const next = this.#next(this.direction());\n    this.direction.set(next);\n    this.sortChange.emit({ column: this.column(), direction: next });\n  }\n\n  /**\n   * Handles Enter and Space keyboard activation, forwarding to `activate()`.\n   * When a `[forDraggable]` (column reorder) shares the host cell, the two\n   * activations split along WAI-ARIA lines: `Space` is reserved for the reorder\n   * lift, and `Enter` while a keyboard drag is in progress (`data-dragging`)\n   * for its drop, so this header only sorts on an idle `Enter`. A sort-only\n   * header (no draggable) still sorts on both keys.\n   */\n  protected onKeyDown(event: KeyboardEvent): void {\n    const isEnter = event.key === 'Enter';\n    const isSpace = event.key === ' ';\n    if (!isEnter && !isSpace) {\n      return;\n    }\n    if (eventFromInteractiveDescendant(event)) {\n      return;\n    }\n    if (this.#hasDraggable && (isSpace || this.#host.hasAttribute('data-dragging'))) {\n      return;\n    }\n    event.preventDefault();\n    this.activate();\n  }\n\n  #next(current: TableSortDirection): TableSortDirection {\n    const first = this.firstClickDirection();\n    const second = first === 'ascending' ? 'descending' : 'ascending';\n    if (current === 'none') return first;\n    if (current === first) return second;\n    return this.disableClear() ? first : 'none';\n  }\n}\n","import { NgTemplateOutlet } from '@angular/common';\nimport {\n  afterEveryRender,\n  booleanAttribute,\n  ChangeDetectionStrategy,\n  Component,\n  computed,\n  DestroyRef,\n  type ElementRef,\n  inject,\n  input,\n  model,\n  output,\n  type Signal,\n  type TemplateRef,\n  viewChildren,\n} from '@angular/core';\n\nimport { fortyError } from 'forty-cdk/core';\n\nimport { ForDraggable, ForDragPlaceholder } from 'forty-cdk/drag-drop';\n\nimport { assertColumnDefConfig, type ForTableColumnDef } from './column-def';\nimport {\n  assertTableDefRegistry,\n  type ForTableDefRegistry,\n  injectOwnTableDefRegistry,\n  provideForTableDefRegistry,\n  type TableDefRegistry,\n} from './def-registry';\nimport { eventFromInteractiveDescendant } from './interactive-descendant';\nimport { type ForTableRowDef } from './row-def';\nimport { ForTableCell } from './table-cell';\nimport { ForTableColumnReorder, type TableColumnReorderDescriptor } from './table-column-reorder';\nimport { ForTableColumnResizer, type TableResizeDescriptor } from './table-column-resizer';\nimport { injectTableContext, injectTableRegistration } from './table-context';\nimport { ForTableHeaderCell } from './table-header-cell';\nimport { ForTableHeaderRow } from './table-header-row';\nimport { ForTableRow } from './table-row';\nimport { ForTableRowAttrs } from './table-row-attrs';\nimport {\n  ForTableSortHeader,\n  type TableSortDescriptor,\n  type TableSortDirection,\n} from './table-sort-header';\n\n/**\n * Payload emitted by {@link ForTableBody.rowActivate} when a data row is\n * activated by a pointer click or the `Enter` key (whole-row navigation lists).\n */\nexport interface TableRowActivateEvent<T> {\n  /** The activated row's datum. */\n  readonly row: T;\n  /** The activated row's 0-based dataset index (absolute when virtualized). */\n  readonly index: number;\n  /** The originating DOM event — a `MouseEvent` for a click, a `KeyboardEvent` for `Enter`. */\n  readonly event: Event;\n}\n\n/**\n * Payload emitted by {@link ForTableBody.rowContextMenu} when a data row receives\n * a `contextmenu` event (right-click or the context-menu key).\n */\nexport interface TableRowContextMenuEvent<T> {\n  /** The row's datum. */\n  readonly row: T;\n  /** The row's 0-based dataset index (absolute when virtualized). */\n  readonly index: number;\n  /** The originating `contextmenu` event; call `preventDefault()` to suppress the native menu. */\n  readonly event: MouseEvent;\n}\n\n/** One row `<for-table-body>` renders, resolved from the static or virtualized path. */\ninterface RenderRow<T> {\n  /** The row datum, passed to the data-cell template as `$implicit`. */\n  readonly datum: T;\n  /** Dataset index exposed to the data-cell template as `index` (absolute when virtualized). */\n  readonly index: number;\n  /** Absolute dataset index when virtualized (drives `[virtualIndex]`), else `null`. */\n  readonly virtualIndex: number | null;\n  /** Pixel offset for `translateY` when virtualized, else `null` (static flow layout). */\n  readonly start: number | null;\n  /** Selection identity from `rowKey`, or `undefined` when the row is not selectable (or a variant). */\n  readonly value: unknown;\n  /** `@for` tracking key: the selection identity, falling back to the dataset index. */\n  readonly key: unknown;\n  /** The matched full-span row variant, or `null` for a standard per-column row. */\n  readonly variant: ForTableRowDef<unknown> | null;\n}\n\n/**\n * Ergonomic declarative renderer for the columns of a `[forTable]`.\n * Place `<for-table-body>` inside a `[forTable]` element and declare one\n * `[forTableColumnDef]` per column; the body harvests the defs and stamps the header\n * row and one data row per item out of the raw cell primitives, so a column is\n * authored in a single block instead of being smeared across header, data, and\n * placeholder rows.\n *\n * **Supported modes: `table` and `grid`.** Each stamped cell's role follows the table `mode`\n * (`cell` or `gridcell`). Choose `mode=\"grid\"` for interactive cells with roving 2D navigation, and\n * the default `mode=\"table\"` for read-only or whole-row navigation lists. `mode=\"treegrid\"` is out\n * of scope — the body stamps no expansion affordances.\n *\n * It owns only the grid **structure**: `display: grid` plus the `grid-template-columns` track\n * derived from each def's `width` and the published `--for-table-col-<name>-width` resize var. All\n * visual styling stays the consumer's, off the `data-*` and role hooks. The host is\n * `display: contents`, so it introduces no box between `[forTable]` and its rows; consumers wanting\n * full DOM control keep using the raw cell primitives.\n *\n * **Defs register themselves through DI rather than being content-queried**, so a preset column\n * component can declare a def in its own view and a scaffold wrapper can project consumer defs into\n * a body it owns (see `defs`). Registrations are exposed in document order, including defs mounted\n * later by `@if` or reordered by `@for`; `displayedColumns` pins an explicit render order on top.\n *\n * **Subclassing is not a supported wrapping shape.** Angular inherits neither `template` nor\n * `imports`, so a subclass renders nothing of the body, and its own `providers` array replaces the\n * one installing the def registry — a subclass missing `provideForTableDefRegistry()` throws a\n * `[forty-cdk/table]` error naming it. Compose the body in a wrapper's template instead.\n *\n * Sort and resize affordances are auto-wired from the per-column `sortable` / `resizable` flags.\n * Sorting stays consumer-applied: the body derives each header's `aria-sort` from `sort` and\n * re-emits activation through `sortChange`. Resize width state can be owned by the body through\n * `[(columnWidths)]`, keyed by column name, with per-def `resizeMin` / `resizeMax` / `resizeStep` /\n * `autoFit` / `fitIncludesHeader` tuning; gesture-end commits still surface through `resizeCommit`.\n * Selection stays consumer-placed — drop `[forTableRowSelector]` / `[forTableSelectAll]` into the\n * cell templates and set `rowKey` to give each row a selection identity.\n *\n * **Virtualization is transparent.** Adding `[forTableVirtualized]` to the same `[forTable]`\n * switches the body to windowed rendering: it renders only the visible slice of `rows`, sizes the\n * rowgroup to the full scroll height and positions each row at its offset. Pass the whole dataset\n * to `rows` — the total is derived from its length, so `[rowCount]` is needed only for a\n * server-known total larger than the loaded rows. Rows are fixed-size by default; set\n * `measureRows` for variable heights, which feeds each rendered row's real height back to the\n * virtualizer.\n *\n * **Row variants.** Declare one or more `[forTableRowDef]` alongside the columns; for each datum\n * the body picks the first whose `[when]` predicate returns `true`, and unmatched data renders the\n * standard per-column row. A `[forTableRowCellDef]` template stamps a full-span row whose single\n * cell spans every column, while the `placeholderCells` flag stamps per-column skeleton cells from\n * each column's `[forTablePlaceholderCellDef]`, falling back to `[forTablePlaceholderCellDefault]`.\n * Variant rows are presentational and non-selectable but still count towards `aria-rowindex` /\n * `aria-rowcount`. A full-span cell registers no cell handle, so arrow keys step over the row;\n * placeholder cells keep the grid rectangular but are stamped disabled, so navigation steps over\n * them too.\n */\n@Component({\n  selector: 'for-table-body',\n  changeDetection: ChangeDetectionStrategy.OnPush,\n  host: { style: 'display: contents' },\n  providers: provideForTableDefRegistry(),\n  imports: [\n    NgTemplateOutlet,\n    ForTableHeaderRow,\n    ForTableHeaderCell,\n    ForTableCell,\n    ForTableRow,\n    ForTableRowAttrs,\n    ForTableSortHeader,\n    ForTableColumnResizer,\n    ForTableColumnReorder,\n    ForDraggable,\n    ForDragPlaceholder,\n  ],\n  template: `\n    <ng-template #headerCellContent let-col let-cell=\"cell\">\n      <ng-container\n        [ngTemplateOutlet]=\"col.header().template\"\n        [ngTemplateOutletInjector]=\"cell.injector\"\n      />\n      @if (col.resizable()) {\n        <button\n          forTableColumnResizer\n          [column]=\"col.name()\"\n          [width]=\"columnWidths()[col.name()]\"\n          [min]=\"col.resizeMin()\"\n          [max]=\"col.resizeMax()\"\n          [step]=\"col.resizeStep()\"\n          [autoFit]=\"col.autoFit()\"\n          [fitIncludesHeader]=\"col.fitIncludesHeader()\"\n          [widthRevert]=\"onColumnWidthRevert\"\n          [attr.aria-label]=\"col.resizeAriaLabel()\"\n          (widthChange)=\"onColumnWidthChange(col.name(), $event)\"\n          (resizeCommit)=\"resizeCommit.emit($event)\"\n        ></button>\n      }\n    </ng-template>\n\n    @if (hasReorderable()) {\n      <div\n        forTableHeaderRow\n        forTableColumnReorder\n        [style.display]=\"'grid'\"\n        [style.grid-template-columns]=\"track()\"\n        (columnReorder)=\"columnReorder.emit($event)\"\n      >\n        @for (col of orderedColumns(); track col.name()) {\n          @if (col.reorderable()) {\n            <div\n              #headerCell=\"forTableHeaderCell\"\n              forTableHeaderCell\n              [name]=\"col.name()\"\n              [sticky]=\"col.sticky()\"\n              [class]=\"col.headerClass()\"\n              forTableSortHeader\n              [column]=\"col.name()\"\n              [sortable]=\"col.sortable()\"\n              [direction]=\"directionFor(col.name())\"\n              (sortChange)=\"sortChange.emit($event)\"\n              forDraggable\n              [dragData]=\"col.name()\"\n            >\n              <ng-container\n                [ngTemplateOutlet]=\"headerCellContent\"\n                [ngTemplateOutletInjector]=\"headerCell.injector\"\n                [ngTemplateOutletContext]=\"{ $implicit: col, cell: headerCell }\"\n              />\n              @if (columnDragPlaceholder(); as placeholder) {\n                <ng-template forDragPlaceholder>\n                  <ng-container [ngTemplateOutlet]=\"placeholder.template\" />\n                </ng-template>\n              }\n            </div>\n          } @else {\n            <div\n              #headerCell=\"forTableHeaderCell\"\n              forTableHeaderCell\n              [name]=\"col.name()\"\n              [sticky]=\"col.sticky()\"\n              [class]=\"col.headerClass()\"\n              forTableSortHeader\n              [column]=\"col.name()\"\n              [sortable]=\"col.sortable()\"\n              [direction]=\"directionFor(col.name())\"\n              (sortChange)=\"sortChange.emit($event)\"\n            >\n              <ng-container\n                [ngTemplateOutlet]=\"headerCellContent\"\n                [ngTemplateOutletInjector]=\"headerCell.injector\"\n                [ngTemplateOutletContext]=\"{ $implicit: col, cell: headerCell }\"\n              />\n            </div>\n          }\n        }\n      </div>\n    } @else {\n      <div forTableHeaderRow [style.display]=\"'grid'\" [style.grid-template-columns]=\"track()\">\n        @for (col of orderedColumns(); track col.name()) {\n          <div\n            #headerCell=\"forTableHeaderCell\"\n            forTableHeaderCell\n            [name]=\"col.name()\"\n            [sticky]=\"col.sticky()\"\n            [class]=\"col.headerClass()\"\n            forTableSortHeader\n            [column]=\"col.name()\"\n            [sortable]=\"col.sortable()\"\n            [direction]=\"directionFor(col.name())\"\n            (sortChange)=\"sortChange.emit($event)\"\n          >\n            <ng-container\n              [ngTemplateOutlet]=\"headerCellContent\"\n              [ngTemplateOutletInjector]=\"headerCell.injector\"\n              [ngTemplateOutletContext]=\"{ $implicit: col, cell: headerCell }\"\n            />\n          </div>\n        }\n      </div>\n    }\n    <div\n      role=\"rowgroup\"\n      [style.position]=\"sizerHeight() !== null ? 'relative' : null\"\n      [style.height.px]=\"sizerHeight()\"\n    >\n      @if (loading()) {\n        @for (placeholder of placeholderRange(); track placeholder) {\n          <div forTableRow [style.display]=\"'grid'\" [style.grid-template-columns]=\"track()\">\n            @for (col of orderedColumns(); track col.name()) {\n              <div\n                #cell=\"forTableCell\"\n                forTableCell\n                disabled\n                [name]=\"col.name()\"\n                [sticky]=\"col.sticky()\"\n                [class]=\"col.cellClass()\"\n              >\n                <ng-container\n                  [ngTemplateOutlet]=\"placeholderTemplateFor(col)\"\n                  [ngTemplateOutletInjector]=\"cell.injector\"\n                />\n              </div>\n            }\n          </div>\n        }\n      } @else {\n        @for (r of renderRows(); track r.key) {\n          <div\n            #rowRef=\"forTableRow\"\n            #rowEl\n            forTableRow\n            [value]=\"r.value\"\n            [virtualIndex]=\"r.virtualIndex\"\n            [attr.data-index]=\"r.virtualIndex\"\n            [attr.tabindex]=\"rowTabIndex(r)\"\n            [class]=\"rowClassFor(r)\"\n            [forTableRowAttrs]=\"rowAttrsFor(r)\"\n            [style.display]=\"'grid'\"\n            [style.grid-template-columns]=\"track()\"\n            [style.position]=\"r.start !== null ? 'absolute' : null\"\n            [style.left]=\"r.start !== null ? '0' : null\"\n            [style.right]=\"r.start !== null ? '0' : null\"\n            [style.transform]=\"r.start !== null ? 'translateY(' + r.start + 'px)' : null\"\n            (click)=\"onRowClick(r, $event)\"\n            (keydown.enter)=\"onRowEnter(r, $event)\"\n            (contextmenu)=\"onRowContextMenu(r, $event)\"\n          >\n            @if (r.variant; as variant) {\n              @if (variant.placeholderCells()) {\n                @for (col of orderedColumns(); track col.name()) {\n                  <div\n                    #cell=\"forTableCell\"\n                    forTableCell\n                    disabled\n                    [name]=\"col.name()\"\n                    [sticky]=\"col.sticky()\"\n                    [class]=\"col.cellClass()\"\n                  >\n                    <ng-container\n                      [ngTemplateOutlet]=\"placeholderTemplateFor(col)\"\n                      [ngTemplateOutletInjector]=\"cell.injector\"\n                    />\n                  </div>\n                }\n              } @else {\n                <div\n                  [attr.role]=\"cellRole()\"\n                  [attr.aria-colindex]=\"1\"\n                  [attr.aria-colspan]=\"orderedColumns().length\"\n                  [attr.data-row-variant]=\"''\"\n                  [style.grid-column]=\"'1 / -1'\"\n                >\n                  <ng-container\n                    [ngTemplateOutlet]=\"variant.cell()?.template ?? null\"\n                    [ngTemplateOutletInjector]=\"rowRef.injector\"\n                    [ngTemplateOutletContext]=\"{ $implicit: r.datum, index: r.index }\"\n                  />\n                </div>\n              }\n            } @else {\n              @for (col of orderedColumns(); track col.name()) {\n                <div\n                  #cell=\"forTableCell\"\n                  forTableCell\n                  [name]=\"col.name()\"\n                  [sticky]=\"col.sticky()\"\n                  [class]=\"col.cellClass()\"\n                >\n                  <ng-container\n                    [ngTemplateOutlet]=\"col.dataCell().template\"\n                    [ngTemplateOutletInjector]=\"cell.injector\"\n                    [ngTemplateOutletContext]=\"{ $implicit: r.datum, index: r.index }\"\n                  />\n                </div>\n              }\n            }\n          </div>\n        }\n      }\n    </div>\n    <ng-content />\n  `,\n})\nexport class ForTableBody<T = unknown> {\n  readonly #ctx = injectTableContext('ForTableBody');\n  readonly #registration = injectTableRegistration('ForTableBody');\n\n  private readonly rowEls = viewChildren<ElementRef<HTMLElement>>('rowEl');\n  readonly #measuredAt = new WeakMap<HTMLElement, string>();\n\n  constructor() {\n    const bodyRowCount = computed(() =>\n      this.loading() ? Math.max(0, this.placeholderRows()) : this.rows().length,\n    );\n    this.#registration.registerBodyRowCount(bodyRowCount);\n    inject(DestroyRef).onDestroy(() => this.#registration.registerBodyRowCount(null));\n\n    afterEveryRender(() => {\n      const window = this.#registration.virtualWindow();\n      if (!window || !this.measureRows()) {\n        return;\n      }\n      for (const ref of this.rowEls()) {\n        const el = ref.nativeElement;\n        const index = el.getAttribute('data-index');\n        if (index === null || this.#measuredAt.get(el) === index) {\n          continue;\n        }\n        this.#measuredAt.set(el, index);\n        window.measureRow(el);\n      }\n      window.measureRow(null);\n    });\n  }\n\n  /** The rows to render — already sorted / filtered / paged by the consumer (BYO-data). */\n  readonly rows = input.required<readonly T[]>();\n\n  /**\n   * Row identity used both for `@for` tracking and each row's selection `[value]`.\n   * Omit it for non-selectable, index-tracked tables.\n   */\n  readonly rowKey = input<(row: T, index: number) => unknown>();\n\n  /**\n   * Which columns render, in order. Defaults to every registered `[forTableColumnDef]`\n   * in document order. Names not matching a registered column are skipped.\n   */\n  readonly displayedColumns = input<readonly string[] | null>(null);\n\n  /**\n   * The single active sort descriptor. Each `sortable` column derives its\n   * `aria-sort` from it (the \"one sorted column\" rule); the consumer updates it\n   * from `sortChange` and re-sorts `rows`.\n   */\n  readonly sort = input<TableSortDescriptor | null>(null);\n\n  /**\n   * When set, render `placeholderRows` skeleton rows instead of data. Each cell\n   * stamps the column's own `[forTablePlaceholderCellDef]`, else the body-level\n   * `[forTablePlaceholderCellDefault]`, else nothing.\n   */\n  readonly loading = input(false);\n\n  /** Number of placeholder rows rendered while `loading`. Default `3`. */\n  readonly placeholderRows = input(3);\n\n  /**\n   * Opt in to **measured (variable) row heights** under `[forTableVirtualized]`.\n   * When set, the body measures each stamped row after render and feeds its real\n   * height back to the virtualizer, which replaces the `estimateRowSize` estimate\n   * and re-aligns the offsets of the rows below — so a window mixing row shapes\n   * (denser variant rows, group separators) stays contiguous after scroll.\n   *\n   * Off by default: a uniform-height table keeps the pure `estimateRowSize` fast\n   * path with no per-row measurement work. Has no effect without\n   * `[forTableVirtualized]` (there is no window to measure against).\n   *\n   * Measurement is not one-shot. The body's per-render measure is throttled per\n   * `data-index`, so it covers only a row's initial post-render measurement and any\n   * row recycled to a new index. Subsequent size changes of the **same mounted row**\n   * (async content, image load, cell reflow) are re-measured automatically by the\n   * virtualizer's own `ResizeObserver` — which re-aligns the offsets of the rows below\n   * without any consumer action — so a row whose content loads asynchronously needs no\n   * manual re-measure trigger.\n   */\n  readonly measureRows = input(false, { transform: booleanAttribute });\n\n  /** Fires when a `sortable` header is activated; forwarded from the internal `[forTableSortHeader]`. */\n  readonly sortChange = output<TableSortDescriptor>();\n\n  /** Fires when a `resizable` column commits a width; forwarded from the internal `[forTableColumnResizer]`. */\n  readonly resizeCommit = output<TableResizeDescriptor>();\n\n  /**\n   * Fires once per committed column reorder gesture (pointer drop or keyboard drop),\n   * forwarded unchanged from the internal `[forTableColumnReorder]`. Its `from` / `to`\n   * are indices into the **full displayed column order** (counting non-reorderable\n   * columns), so a table with fixed columns applies `moveItemInArray(displayedColumns,\n   * from, to)` over the whole `displayedColumns` array. Its `columns` lists the\n   * reorderable columns in their new order (equal to the full displayed order only when\n   * every displayed column is `reorderable`) — setting `displayedColumns` directly to\n   * `columns` is valid only in that all-reorderable case, otherwise the fixed columns\n   * are dropped. Only present when at least one `[forTableColumnDef]` is `reorderable`.\n   */\n  readonly columnReorder = output<TableColumnReorderDescriptor>();\n\n  /**\n   * Two-way map of column widths (px), keyed by column `name`. It seeds each\n   * `resizable` column's stamped handle `[width]` — so the `role=\"separator\"`\n   * handle exposes `aria-valuenow` from the first render and the column's grid\n   * track picks up the seeded width immediately — and is updated immutably on\n   * every live width change the handle reports (pointer drag, keyboard resize,\n   * auto-fit), including the pre-drag revert of a handle destroyed mid-drag. Only\n   * `resizable` columns participate; other names are ignored.\n   *\n   * The map is JSON-serializable, so persisting a user's column layout is\n   * `[(columnWidths)]` plus one storage write. Together with `[displayedColumns]`\n   * and `[sort]` it makes the full user-configurable table state three bindings.\n   * Its implicit `columnWidthsChange` fires only on handle-driven updates, not on\n   * consumer writes through `[(columnWidths)]`.\n   */\n  readonly columnWidths = model<Readonly<Record<string, number>>>({});\n\n  /**\n   * Opt-in whole-row interaction for **navigation lists**, active only in the\n   * default `mode=\"table\"`. When set, each data row becomes a focusable tab stop\n   * (`tabindex=\"0\"`) and a pointer click or `Enter` emits `rowActivate`, while a\n   * `contextmenu` (right-click or the context-menu key) emits `rowContextMenu`.\n   * Full-span `[forTableRowDef]` variant rows stay non-interactive. Ignored in `grid`\n   * / `treegrid` mode, where roving 2D navigation and cell-entry own the keyboard\n   * and whole-row activation would conflict.\n   *\n   * Interactive content inside a data cell owns its own events: a click or `Enter` originating from\n   * a `button`, `a[href]`, `input`, `select`, `textarea`, `summary`, `label`,\n   * `audio` / `video[controls]`, an editable `contenteditable` region, or an element carrying an\n   * interactive ARIA role does **not** emit `rowActivate`, and its native default action is left\n   * intact. The row still activates from anywhere else — cell text, the gaps between cells, or the\n   * focused row host.\n   *\n   * `rowContextMenu` is unguarded, so a right-click over an inner control still offers\n   * the row's context menu, matching native lists.\n   */\n  readonly interactiveRows = input(false, { transform: booleanAttribute });\n\n  /**\n   * Fires when a data row is activated by a pointer click or `Enter`, carrying\n   * the row datum, its dataset index, and the originating event. Requires\n   * `interactiveRows` and `mode=\"table\"`.\n   */\n  readonly rowActivate = output<TableRowActivateEvent<T>>();\n\n  /**\n   * Fires when a data row receives a `contextmenu` event (right-click or the\n   * context-menu key), carrying the row datum, its dataset index, and the event —\n   * position your own overlay from it. Requires `interactiveRows` and\n   * `mode=\"table\"`.\n   */\n  readonly rowContextMenu = output<TableRowContextMenuEvent<T>>();\n\n  /**\n   * Per-row class hook, applied to data **and** variant rows in **every** mode.\n   * Receives the row datum and its 0-based dataset index and returns the class(es)\n   * to apply — a string, a `{ className: boolean }` map, or `undefined` for none.\n   * This is the only seam for styling a body-owned row from its datum (an\n   * \"active\" / \"menu-open\" highlight, error or dimmed rows). Evaluated on every\n   * change-detection pass, so keep it cheap and free of side effects.\n   */\n  readonly rowClass =\n    input<(row: T, index: number) => string | Record<string, boolean> | undefined>();\n\n  /**\n   * Per-row attribute hook, applied to data **and** variant rows in **every**\n   * mode. Receives the row datum and its 0-based dataset index and returns an\n   * attribute map to reflect on the row host; a key mapped to `null` (or dropped\n   * from a later map) removes that attribute. Evaluated on every change-detection\n   * pass, so keep it cheap and free of side effects.\n   */\n  readonly rowAttrs = input<(row: T, index: number) => Record<string, string | null> | undefined>();\n\n  /**\n   * An external def registry to render from, for a **scaffold wrapper**: a\n   * component whose template owns the `[forTable]` shell and this body, and whose\n   * consumers declare their `[forTableColumnDef]` / `[forTableRowDef]` blocks as projected\n   * content. Those defs are content of the wrapper, not of this body, so they\n   * register with the wrapper's own registry — provide one with\n   * `provideForTableDefRegistry()` and bind `inject(FOR_TABLE_DEF_REGISTRY)` here.\n   *\n   * When set, this registry **replaces** the body's own: defs the wrapper declares\n   * inside the `<for-table-body>` tags would register with the body instead and be\n   * ignored, so the body throws rather than dropping them — declare a wrapper's\n   * own defs next to the projected ones (outside the body element), where they\n   * reach the same registry. Defaults to `null` (the body renders the defs\n   * declared in its own content).\n   */\n  readonly defs = input<ForTableDefRegistry | null>(null);\n\n  readonly #ownDefs = injectOwnTableDefRegistry();\n\n  readonly #defs = computed<TableDefRegistry>(() => {\n    const external = this.defs();\n    if (!external) {\n      return this.#ownDefs;\n    }\n    const registry = assertTableDefRegistry(external);\n    if (!this.#ownDefs.isEmpty()) {\n      throw fortyError({\n        code: 'FORCDK-TABLE-004',\n        message:\n          '<for-table-body> was given a [defs] registry and also has def(s) declared inside its ' +\n          'own tags, which are ignored.',\n        cause: 'The body renders exactly one registry: the one bound to [defs].',\n        fix:\n          'Declare those defs alongside the projected ones, outside the <for-table-body> element, ' +\n          'so they register with the same registry.',\n      });\n    }\n    return registry;\n  });\n\n  /** The registered column definitions, in document order. */\n  protected readonly columns = computed(() => this.#defs().columnDefs());\n\n  /** The registered full-span row variants, in document order (first match wins per datum). */\n  protected readonly rowDefs = computed(() => this.#defs().rowDefs());\n\n  /** The optional shared drag placeholder for reorderable columns, or `null`. */\n  protected readonly columnDragPlaceholder = computed(() => this.#defs().columnDragPlaceholder());\n\n  /** The optional body-level default placeholder-cell template, or `null`. */\n  protected readonly placeholderCellDefault = computed(() => this.#defs().placeholderCellDefault());\n\n  /**\n   * Resolves the placeholder template a column stamps into its cell, in both\n   * stamping paths: the column's own `[forTablePlaceholderCellDef]`, else the body-level\n   * `[forTablePlaceholderCellDefault]`, else `null` for an empty cell.\n   */\n  protected placeholderTemplateFor(col: ForTableColumnDef): TemplateRef<unknown> | null {\n    return col.placeholderCell()?.template ?? this.placeholderCellDefault()?.template ?? null;\n  }\n\n  /** The role a stamped cell carries: `'cell'` in `table` mode, `'gridcell'` otherwise. */\n  protected readonly cellRole = computed(() =>\n    this.#ctx.mode() === 'table' ? 'cell' : 'gridcell',\n  );\n\n  /** The columns to render, resolved from `displayedColumns` (or all defs, in order). */\n  protected readonly orderedColumns = computed<readonly ForTableColumnDef[]>(() => {\n    const defs = this.columns();\n    const order = this.displayedColumns();\n    if (!order) {\n      return defs;\n    }\n    const byName = new Map(defs.map((def) => [def.name(), def]));\n    return order\n      .map((name) => byName.get(name))\n      .filter((def): def is ForTableColumnDef => def != null);\n  });\n\n  /**\n   * `true` when at least one displayed column is `reorderable`, switching the stamped\n   * header row to the drag-reorder path (`[forTableColumnReorder]` + per-cell\n   * `[forDraggable]`). A body with no reorderable column keeps the plain header row.\n   */\n  protected readonly hasReorderable = computed(() =>\n    this.orderedColumns().some((col) => col.reorderable()),\n  );\n\n  /**\n   * The derived `grid-template-columns` track, applied to the header row and every\n   * data row and exposed for consumers who want to bind it elsewhere. Each column\n   * contributes its `width`, or the published resize var falling back to the column's\n   * `fallbackWidth` (`minmax(0, 1fr)` when that is unset too).\n   */\n  readonly track: Signal<string> = computed(() =>\n    this.orderedColumns()\n      .map((col) => {\n        assertColumnDefConfig(col);\n        return (\n          col.width() ??\n          `var(--for-table-col-${col.name()}-width, ${col.fallbackWidth() ?? 'minmax(0, 1fr)'})`\n        );\n      })\n      .join(' '),\n  );\n\n  /**\n   * The rows to render this change-detection pass. When `[forTableVirtualized]`\n   * has published a window it maps the window's slice into `rows` (absolute\n   * index + pixel offset per row); otherwise it maps every row in flow order.\n   */\n  protected readonly renderRows = computed<readonly RenderRow<T>[]>(() => {\n    const window = this.#registration.virtualWindow();\n    const data = this.rows();\n    const key = this.rowKey();\n    const variants = this.rowDefs();\n    for (const def of variants) {\n      this.#assertRowDefConfig(def);\n    }\n    const matchVariant = (datum: T, index: number): ForTableRowDef<unknown> | null =>\n      variants.find((def) => def.when()(datum, index)) ?? null;\n    if (window) {\n      const out: RenderRow<T>[] = [];\n      for (const vrow of window.rows()) {\n        const datum = data[vrow.index];\n        if (datum === undefined) {\n          continue;\n        }\n        const identity = key?.(datum, vrow.index);\n        const variant = matchVariant(datum, vrow.index);\n        out.push({\n          datum,\n          index: vrow.index,\n          virtualIndex: vrow.index,\n          start: vrow.start,\n          value: variant ? undefined : identity,\n          key: identity ?? vrow.index,\n          variant,\n        });\n      }\n      return out;\n    }\n    return data.map((datum, i) => {\n      const identity = key?.(datum, i);\n      const variant = matchVariant(datum, i);\n      return {\n        datum,\n        index: i,\n        virtualIndex: null,\n        start: null,\n        value: variant ? undefined : identity,\n        key: identity ?? i,\n        variant,\n      };\n    });\n  });\n\n  /**\n   * Enforces that each `[forTableRowDef]` declares exactly one of\n   * `[forTableRowCellDef]` / `placeholderCells`.\n   */\n  #assertRowDefConfig(def: ForTableRowDef<unknown>): void {\n    const hasCell = def.cell() != null;\n    const hasPlaceholder = def.placeholderCells();\n    if (hasCell === hasPlaceholder) {\n      throw fortyError({\n        code: 'FORCDK-TABLE-005',\n        message: `A [forTableRowDef] declares ${hasCell ? 'both' : 'neither'} of a [forTableRowCellDef] template and the placeholderCells flag.`,\n        fix: 'Declare exactly one of the two on every [forTableRowDef].',\n      });\n    }\n  }\n\n  /** Full scroll height (px) applied to the rowgroup when virtualized, else `null` (natural height). */\n  protected readonly sizerHeight = computed<number | null>(() => {\n    const window = this.#registration.virtualWindow();\n    return window && !this.loading() ? window.totalSize() : null;\n  });\n\n  protected readonly placeholderRange = computed(() =>\n    Array.from({ length: Math.max(0, this.placeholderRows()) }, (_, i) => i),\n  );\n\n  /** Resolves a `sortable` column's current direction from the single `sort` descriptor. */\n  protected directionFor(column: string): TableSortDirection {\n    const descriptor = this.sort();\n    return descriptor && descriptor.column === column ? descriptor.direction : 'none';\n  }\n\n  /** Whether whole-row interaction is active: opted in via `interactiveRows` and in `table` mode. */\n  protected readonly rowsInteractive = computed(\n    () => this.interactiveRows() && this.#ctx.mode() === 'table',\n  );\n\n  /** The `tabindex` for a stamped row: `0` for an interactive data row, `null` otherwise. */\n  protected rowTabIndex(row: RenderRow<T>): 0 | null {\n    return this.rowsInteractive() && !row.variant ? 0 : null;\n  }\n\n  /** Resolves the `rowClass` hook for a stamped row, or `undefined` when unset. */\n  protected rowClassFor(row: RenderRow<T>): string | Record<string, boolean> | undefined {\n    return this.rowClass()?.(row.datum, row.index);\n  }\n\n  /** Resolves the `rowAttrs` hook for a stamped row, or `undefined` when unset. */\n  protected rowAttrsFor(row: RenderRow<T>): Record<string, string | null> | undefined {\n    return this.rowAttrs()?.(row.datum, row.index);\n  }\n\n  /**\n   * Folds a stamped resizer's live width update into the `[(columnWidths)]` map\n   * immutably, keyed by the column name. Ignores the resizer's initial unset\n   * (`undefined`) emission and no-ops when the width is unchanged, so seeding the\n   * handle from `columnWidths` never loops back into a redundant model write.\n   */\n  protected onColumnWidthChange(column: string, width: number | undefined): void {\n    if (width === undefined) {\n      return;\n    }\n    const current = this.columnWidths();\n    if (current[column] === width) {\n      return;\n    }\n    this.columnWidths.set({ ...current, [column]: width });\n  }\n\n  /**\n   * Folds a stamped resizer's teardown revert into `[(columnWidths)]`, so a handle destroyed\n   * mid-drag — its column dropped from `displayedColumns`, or `resizable` toggled off — does not\n   * leave the transient drag width in the map.\n   *\n   * A function reference rather than an output, because the revert happens during the handle's\n   * teardown. The body outlives it, so its own `columnWidthsChange` still reaches the consumer.\n   */\n  protected readonly onColumnWidthRevert = (descriptor: TableResizeDescriptor): void => {\n    this.onColumnWidthChange(descriptor.column, descriptor.width);\n  };\n\n  protected onRowClick(row: RenderRow<T>, event: MouseEvent): void {\n    this.#activateRow(row, event);\n  }\n\n  protected onRowEnter(row: RenderRow<T>, event: Event): void {\n    if (this.#activateRow(row, event)) {\n      event.preventDefault();\n    }\n  }\n\n  protected onRowContextMenu(row: RenderRow<T>, event: MouseEvent): void {\n    if (!this.rowsInteractive() || row.variant) {\n      return;\n    }\n    this.rowContextMenu.emit({ row: row.datum, index: row.index, event });\n  }\n\n  #activateRow(row: RenderRow<T>, event: Event): boolean {\n    if (!this.rowsInteractive() || row.variant || eventFromInteractiveDescendant(event)) {\n      return false;\n    }\n    this.rowActivate.emit({ row: row.datum, index: row.index, event });\n    return true;\n  }\n}\n","import { computed, Directive, input } from '@angular/core';\n\nimport { hostAriaLabel } from 'forty-cdk/core';\n\nimport { injectTableContext, injectTableRowContext } from './table-context';\n\n/**\n * Accessible per-row selection checkbox inside a `[forTableRow]`. Renders\n * `role=\"checkbox\"` reflecting the row's selection via `aria-checked=\"true\" | \"false\"`\n * and `data-state=\"checked\" | \"unchecked\"` for styling. Clicking (or Space / Enter\n * while focused) toggles the row's selection.\n *\n * In `mode=\"table\"` it is the focusable keyboard selection path: it is a standalone\n * tab stop (`tabindex=\"0\"`), reached with `Tab` and toggled with `Space` / `Enter`.\n * In `grid` / `treegrid` mode it yields its tab stop to the composite roving grid\n * (`tabindex=\"-1\"`) — selection is driven from the cell (`Space`) — but it stays a\n * named, non-hidden checkbox in the accessibility tree.\n *\n * Give it an accessible name via `ariaLabel` (or an external label). The enclosing\n * row still owns the row-level `aria-selected`.\n */\n@Directive({\n  selector: '[forTableRowSelector]',\n  exportAs: 'forTableRowSelector',\n  host: {\n    role: 'checkbox',\n    '[attr.tabindex]': 'tabindex()',\n    '[attr.aria-checked]': 'ariaChecked()',\n    '[attr.aria-label]': 'resolvedAriaLabel()',\n    '[attr.data-state]': 'dataState()',\n    '(click)': 'onClick($event)',\n    '(keydown)': 'onKeyDown($event)',\n  },\n})\nexport class ForTableRowSelector {\n  protected readonly ctx = injectTableContext('ForTableRowSelector');\n  protected readonly row = injectTableRowContext('ForTableRowSelector');\n\n  /** Accessible label for the selection checkbox (e.g. \"Select row\"). Truthy-only. */\n  readonly ariaLabel = input<string | null>(null);\n\n  protected readonly resolvedAriaLabel = hostAriaLabel(() => this.ariaLabel() || null);\n\n  protected readonly tabindex = computed<0 | -1>(() => (this.ctx.mode() === 'table' ? 0 : -1));\n\n  protected readonly ariaChecked = computed<'true' | 'false'>(() =>\n    this.row.selected() ? 'true' : 'false',\n  );\n\n  protected readonly dataState = computed(() => (this.row.selected() ? 'checked' : 'unchecked'));\n\n  protected onClick(event: MouseEvent): void {\n    event.stopPropagation();\n    this.row.toggleSelected();\n  }\n\n  protected onKeyDown(event: KeyboardEvent): void {\n    if (event.key === ' ' || event.key === 'Enter') {\n      event.preventDefault();\n      this.row.toggleSelected();\n    }\n  }\n}\n","import { computed, Directive, input } from '@angular/core';\n\nimport { hostAriaLabel } from 'forty-cdk/core';\n\nimport { injectTableContext } from './table-context';\n\n/**\n * Header \"select all\" checkbox for a `[forTable]` in `selectionMode=\"multiple\"`.\n * Reflects `aria-checked=\"true\" | \"false\" | \"mixed\"` and\n * `data-state=\"checked\" | \"unchecked\" | \"indeterminate\"` derived from how many\n * selectable rows are selected. Clicking (or Space / Enter) selects all rows\n * when none/some are selected, and clears when all are. No-op outside multiple\n * mode.\n *\n * In `mode=\"table\"` it is a standalone tab stop (`tabindex=\"0\"`) and can sit on any\n * focusable element (a `<span>` you make tabbable, or a `<button type=\"button\">`).\n * In `mode=\"grid\"` / `\"treegrid\"` it yields its tab stop to the composite roving grid\n * (`tabindex=\"-1\"`) and is reached via cell-entry (Enter / F2), so it must sit on a\n * natively-focusable element (a `<button type=\"button\">`) — a `tabindex`-only `<span>`\n * is cell-entry-reachable only in `mode=\"table\"`.\n */\n@Directive({\n  selector: '[forTableSelectAll]',\n  exportAs: 'forTableSelectAll',\n  host: {\n    role: 'checkbox',\n    '[attr.tabindex]': 'tabindex()',\n    '[attr.aria-checked]': 'ariaChecked()',\n    '[attr.aria-label]': 'resolvedAriaLabel()',\n    '[attr.data-state]': 'dataState()',\n    '(click)': 'onClick()',\n    '(keydown)': 'onKeyDown($event)',\n  },\n})\nexport class ForTableSelectAll {\n  protected readonly ctx = injectTableContext('ForTableSelectAll');\n\n  /** Accessible label for the control (e.g. \"Select all rows\"). Truthy-only. */\n  readonly ariaLabel = input<string | null>(null);\n\n  protected readonly resolvedAriaLabel = hostAriaLabel(() => this.ariaLabel() || null);\n\n  protected readonly tabindex = computed<0 | -1>(() => (this.ctx.mode() === 'table' ? 0 : -1));\n\n  protected readonly ariaChecked = computed<'true' | 'false' | 'mixed'>(() => {\n    const state = this.ctx.selectAllState();\n    return state === 'all' ? 'true' : state === 'some' ? 'mixed' : 'false';\n  });\n\n  protected readonly dataState = computed(() => {\n    const state = this.ctx.selectAllState();\n    return state === 'all' ? 'checked' : state === 'some' ? 'indeterminate' : 'unchecked';\n  });\n\n  protected onClick(): void {\n    this.ctx.toggleSelectAll();\n  }\n\n  protected onKeyDown(event: KeyboardEvent): void {\n    if (event.key === ' ' || event.key === 'Enter') {\n      event.preventDefault();\n      this.ctx.toggleSelectAll();\n    }\n  }\n}\n","import { DestroyRef, Directive, ElementRef, inject } from '@angular/core';\n\nimport { orphanContextError } from 'forty-cdk/core';\nimport { ForTableHeaderCell } from './table-header-cell';\n\n/**\n * Marks the element inside a `[forTableHeaderCell]` that carries the column's\n * label text. It owns no role, ARIA, or DOM of its own — it is a structure-agnostic\n * hook so a sibling `[forTableColumnResizer]` with `[fitIncludesHeader]` can measure\n * the header label in isolation, ignoring the resize handle, sort affordance, and any\n * other header chrome. Wrap only the text you want the header-inclusive auto-fit to\n * account for.\n *\n * @example\n * ```html\n * <th forTableHeaderCell name=\"dept\">\n *   <span forTableColumnLabel>Department</span>\n *   <button forTableColumnResizer column=\"dept\" fitIncludesHeader [(width)]=\"deptWidth\"\n *           aria-label=\"Resize Department column\"></button>\n * </th>\n * ```\n */\n@Directive({\n  selector: '[forTableColumnLabel]',\n  exportAs: 'forTableColumnLabel',\n})\nexport class ForTableColumnLabel {\n  readonly #host = inject<ElementRef<HTMLElement>>(ElementRef).nativeElement;\n  readonly #headerCell = inject(ForTableHeaderCell, { optional: true });\n\n  constructor() {\n    if (!this.#headerCell) {\n      throw orphanContextError({\n        code: 'FORCDK-TABLE-006',\n        piece: 'ForTableColumnLabel',\n        root: '[forTableHeaderCell]',\n        token: 'ForTableHeaderCell',\n      });\n    }\n    this.#headerCell.registerLabel(this.#host);\n    inject(DestroyRef).onDestroy(() => this.#headerCell?.unregisterLabel(this.#host));\n  }\n}\n","import {\n  DestroyRef,\n  Directive,\n  DOCUMENT,\n  effect,\n  ElementRef,\n  inject,\n  output,\n  PLATFORM_ID,\n} from '@angular/core';\nimport { isPlatformBrowser } from '@angular/common';\n\nimport {\n  FOR_DRAG_DROP_DEFAULTS,\n  FOR_DROP_LIST_ROVING_DELEGATE,\n  ForDropList,\n  type ForDragDropEvent,\n  type ForDropListRovingDelegate,\n} from 'forty-cdk/drag-drop';\nimport {\n  createKeyboardDragMediator,\n  createPointerDragSession,\n  isDragLiftKey,\n  LiveAnnouncer,\n  type PointerDragSession,\n  resolveLiftedDragControl,\n  resolveScrubReorder,\n  translateWindowReorder,\n} from 'forty-cdk/core';\nimport { injectTableContext, injectTableRegistration } from './table-context';\n\nconst POINTER_ARM_THRESHOLD_PX = 5;\n\ntype ReorderMode = 'idle' | 'keyboard' | 'pointer';\n\nconst LIFTED_NAV_KEYS: ReadonlySet<string> = new Set([\n  'ArrowDown',\n  'ArrowUp',\n  'ArrowLeft',\n  'ArrowRight',\n  'Home',\n  'End',\n  'PageDown',\n  'PageUp',\n]);\n\n/** Payload of `rowReorder`: the previous and new row index. */\nexport interface TableRowReorderDescriptor {\n  /** Previous row index (0-based). Absolute (dataset) index under virtualization, else rendered order. */\n  from: number;\n  /** New row index (0-based). Absolute (dataset) index under virtualization, else rendered order. */\n  to: number;\n}\n\n/**\n * Translates a drop-list's window-relative `previousIndex` / `currentIndex` into\n * absolute dataset indices, so a virtualized table's consumer can apply\n * `moveItemInArray` over the **full** row array. `windowIndices` holds the\n * absolute `virtualIndex` of every rendered draggable row, in DOM (ascending)\n * order. Thin table-facing wrapper over the shared\n * {@link translateWindowReorder} helper, which owns the post-removal index math.\n */\nexport function translateRowReorderIndices(\n  windowIndices: readonly number[],\n  previousIndex: number,\n  currentIndex: number,\n): TableRowReorderDescriptor {\n  return translateWindowReorder(windowIndices, previousIndex, currentIndex);\n}\n\n/**\n * Opt-in **row reordering** for `ForTable`, composed over the drag-drop primitive.\n *\n * Apply on the rowgroup element that wraps the data rows (`<div role=\"rowgroup\">` in\n * `<div>` mode, `<tbody>` in native `<table>` mode). It wraps `[forDropList]` (via\n * `hostDirectives`, vertical by default) so the rows become a reorderable list, then\n * translates drag-drop's generic drop into the table-friendly `rowReorder` output. Mark\n * each `[forTableRow]` as `[forDraggable]` with a `[dragData]`. On a committed drop it\n * emits the previous / new index; the consumer applies the move to their own row array\n * (e.g. `moveItemInArray`). **It never reorders rows itself** (BYO-data).\n *\n * In `mode=\"grid\"` / `mode=\"treegrid\"` the draggable rows **yield their tab stop** to the\n * table's composite roving grid, keeping the **single tab stop** the WAI-ARIA Data Grid\n * pattern calls for. Keyboard reordering is therefore initiated from a focused **cell**:\n * press `Ctrl`/`Cmd`+`Space` on any cell to lift the enclosing row, then `ArrowUp` /\n * `ArrowDown` (`Home` / `End`, `PageUp` / `PageDown`) move the target, `Space` / `Enter`\n * drop, and `Escape` / `Tab` cancel. Idle Arrow keys stay grid navigation, and `Space` still\n * selects the row when a selection mode is set. In the static `mode=\"table\"` the rowgroup\n * keeps its own draggable-owned tab stop and the plain `Space` / `Enter` lift on a focused\n * row.\n *\n * Under `[forTableVirtualized]`, `rowReorder` emits **absolute** dataset indices so\n * `moveItemInArray` over the full array moves the right row; a non-virtualized table emits\n * rendered-order indices. Pointer drag works within the rendered window and reaches rows\n * beyond it via auto-scroll; keyboard reorder steps the target across the entire dataset,\n * scrolling unmounted rows into view. Holding **Shift** during a pointer drag engages\n * **windowed scrub** — the scroll viewport maps onto the whole dataset (top edge → row 0,\n * bottom edge → the last row) so a single gesture can drop the lifted row at an arbitrary\n * far row.\n *\n * Focus leaving the rowgroup cancels a keyboard lift. A window recycle that briefly blurs\n * the retained lifted row does not: focus returns to it once the window settles.\n *\n * **One gesture at a time.** Pointer and keyboard reorder are mutually exclusive: a live\n * keyboard lift stands the pointer channel down, and a lift key pressed during a pointer\n * drag is ignored.\n *\n * A pointer press is refused outright when the rowgroup is `disabled`, when a **mouse** press\n * uses a non-primary button (touch and pen presses keep whatever `button` their engine\n * reports), or when the pressed row carries no registered `[forDraggable]` or its draggable\n * is `[dragDisabled]`.\n *\n * @example\n * ```html\n * <div role=\"rowgroup\" forTableRowReorder (rowReorder)=\"onReorder($event)\">\n *   @for (row of rows(); track row.id) {\n *     <div forTableRow [value]=\"row.id\" forDraggable [dragData]=\"row.id\">…</div>\n *   }\n * </div>\n * ```\n */\n@Directive({\n  selector: '[forTableRowReorder]',\n  exportAs: 'forTableRowReorder',\n  providers: [\n    {\n      provide: FOR_DROP_LIST_ROVING_DELEGATE,\n      useFactory: (): ForDropListRovingDelegate => {\n        const ctx = injectTableContext('ForTableRowReorder');\n        return {\n          itemTabindex: () => (ctx.mode() !== 'table' ? -1 : null),\n          isItemHighlighted: () => (ctx.mode() !== 'table' ? false : null),\n        };\n      },\n    },\n  ],\n  hostDirectives: [\n    {\n      directive: ForDropList,\n      inputs: [\n        'dir',\n        'disabled',\n        'autoScroll',\n        'animateReorder',\n        'liveSort',\n        'boundary',\n        'lockAxis',\n      ],\n    },\n  ],\n})\nexport class ForTableRowReorder {\n  protected readonly ctx = injectTableContext('ForTableRowReorder');\n  readonly #registration = injectTableRegistration('ForTableRowReorder');\n  readonly #list = inject(ForDropList);\n  readonly #host = inject<ElementRef<HTMLElement>>(ElementRef).nativeElement;\n  readonly #document = inject(DOCUMENT);\n  readonly #isBrowser = isPlatformBrowser(inject(PLATFORM_ID));\n  readonly #announcer = inject(LiveAnnouncer);\n  readonly #dragDefaults = inject(FOR_DRAG_DROP_DEFAULTS);\n\n  #mode: ReorderMode = 'idle';\n  #kbLiftedHost: HTMLElement | null = null;\n  #kbFocusEl: HTMLElement | SVGElement | null = null;\n  #kbPath: 'virtual' | 'list' | null = null;\n  #kbFrom = 0;\n  #kbTarget = 0;\n  #pointerGrab: HTMLElement | null = null;\n  #pointerMain: number | null = null;\n  #scrubEngaged = false;\n  #pointerSession: PointerDragSession | null = null;\n\n  /** Fires once per committed reorder gesture with the previous / new row index. */\n  readonly rowReorder = output<TableRowReorderDescriptor>();\n\n  constructor() {\n    const destroyRef = inject(DestroyRef);\n    const sub = this.#list.dragDrop.subscribe((event: ForDragDropEvent) =>\n      this.rowReorder.emit(this.#resolveDescriptor(event)),\n    );\n    destroyRef.onDestroy(() => sub.unsubscribe());\n\n    if (this.#isBrowser) {\n      this.#pointerSession = createPointerDragSession({\n        host: this.#host,\n        document: this.#document,\n        armThreshold: POINTER_ARM_THRESHOLD_PX,\n        canStart: (event) => this.#trackPointerPress(event),\n        onLift: () => this.#pinOnPointerLift(),\n        onMove: (event) => this.#trackScrub(event),\n        onCommit: () => this.#endPointerSession(),\n        onCancel: () => this.#endPointerSession(),\n      });\n\n      createKeyboardDragMediator({\n        host: this.#host,\n        document: this.#document,\n        isBrowser: this.#isBrowser,\n        destroyRef,\n        isLifted: () => this.#mode === 'keyboard',\n        onIdleKeydown: (event) => this.#onIdleKeydown(event),\n        onLiftedKeydown: (event) => this.#onLiftedKeydown(event),\n        onFocusLeave: () => this.#cancelActive(),\n      });\n\n      effect(() => {\n        this.#registration.rows();\n        this.#restoreLiftedFocus();\n      });\n\n      destroyRef.onDestroy(() => {\n        this.#pointerSession?.destroy();\n        if (this.#kbLiftedHost !== null) {\n          this.#cancelActive();\n        }\n        this.#registration.setReorderingRow(null);\n      });\n    }\n  }\n\n  #gridMode(): boolean {\n    return this.ctx.mode() !== 'table';\n  }\n\n  #virtualized(): boolean {\n    return this.#registration.virtualRowNavigation() !== null;\n  }\n\n  #onIdleKeydown(event: KeyboardEvent): void {\n    if (this.#mode !== 'idle') {\n      return;\n    }\n    const lift = this.#gridMode()\n      ? isDragLiftKey(event)\n      : this.#virtualized() && (event.key === ' ' || event.key === 'Enter');\n    if (!lift) {\n      return;\n    }\n    const rowHost = this.#resolveRow(event.target);\n    if (rowHost === null) {\n      return;\n    }\n    event.preventDefault();\n    event.stopPropagation();\n    this.#lift(rowHost);\n  }\n\n  #onLiftedKeydown(event: KeyboardEvent): void {\n    const control = resolveLiftedDragControl(event);\n    if (control === 'commit') {\n      event.preventDefault();\n      event.stopPropagation();\n      this.#commitActive();\n      return;\n    }\n    if (control === 'cancel') {\n      event.preventDefault();\n      event.stopPropagation();\n      this.#cancelActive();\n      return;\n    }\n    if (!LIFTED_NAV_KEYS.has(event.key)) {\n      return;\n    }\n    event.preventDefault();\n    event.stopPropagation();\n    this.#moveActive(event.key);\n  }\n\n  #resolveRow(target: EventTarget | null): HTMLElement | null {\n    if (!(target instanceof Node)) {\n      return null;\n    }\n    const row = this.#registration.rows().find((r) => r.host === target || r.host.contains(target));\n    if (row === undefined) {\n      return null;\n    }\n    const draggable = this.#list.items().find((h) => h.host === row.host);\n    if (draggable === undefined || draggable.disabled()) {\n      return null;\n    }\n    return row.host;\n  }\n\n  #lift(rowHost: HTMLElement): void {\n    const handle = this.#registration.rows().find((r) => r.host === rowHost);\n    if (handle === undefined) {\n      return;\n    }\n    if (this.#virtualized()) {\n      const vi = handle.virtualIndex();\n      if (vi === null) {\n        return;\n      }\n      this.#kbPath = 'virtual';\n      this.#kbLift(rowHost, vi);\n      return;\n    }\n    const from = this.#list.lift(rowHost);\n    if (from < 0) {\n      return;\n    }\n    this.#mode = 'keyboard';\n    this.#kbPath = 'list';\n    this.#kbLiftedHost = rowHost;\n  }\n\n  #moveActive(key: string): void {\n    if (this.#kbPath === 'virtual') {\n      switch (key) {\n        case 'ArrowDown':\n          this.#setTarget(this.#kbTarget + 1);\n          break;\n        case 'ArrowUp':\n          this.#setTarget(this.#kbTarget - 1);\n          break;\n        case 'Home':\n          this.#setTarget(0);\n          break;\n        case 'End':\n          this.#setTarget(this.#count() - 1);\n          break;\n        case 'PageDown':\n          this.#setTarget(this.#kbTarget + this.#page());\n          break;\n        case 'PageUp':\n          this.#setTarget(this.#kbTarget - this.#page());\n          break;\n        default:\n          return;\n      }\n      this.#kbApplyTarget();\n      return;\n    }\n    if (this.#kbPath === 'list') {\n      switch (key) {\n        case 'ArrowDown':\n          this.#list.moveLifted('next');\n          break;\n        case 'ArrowUp':\n          this.#list.moveLifted('prev');\n          break;\n        case 'Home':\n        case 'PageUp':\n          this.#list.moveLifted('first');\n          break;\n        case 'End':\n        case 'PageDown':\n          this.#list.moveLifted('last');\n          break;\n        default:\n          return;\n      }\n    }\n  }\n\n  #commitActive(): void {\n    if (this.#kbPath === 'virtual') {\n      this.#kbCommit();\n    } else if (this.#kbPath === 'list') {\n      this.#list.drop();\n      this.#kbTeardown();\n    }\n  }\n\n  #cancelActive(): void {\n    if (this.#kbPath === 'virtual') {\n      this.#kbCancel();\n    } else if (this.#kbPath === 'list') {\n      this.#list.cancel();\n      this.#kbTeardown();\n    }\n  }\n\n  #restoreLiftedFocus(): void {\n    if (this.#kbPath !== 'virtual' || this.#kbLiftedHost === null) {\n      return;\n    }\n    const target = this.#kbFocusEl;\n    if (target === null || !this.#host.contains(target)) {\n      return;\n    }\n    const active = this.#document.activeElement;\n    if (active !== null && this.#host.contains(active)) {\n      return;\n    }\n    target.focus({ preventScroll: true });\n  }\n\n  #kbLift(host: HTMLElement, vi: number): void {\n    this.#mode = 'keyboard';\n    this.#kbLiftedHost = host;\n    this.#kbFocusEl = this.#resolveFocusTarget(host);\n    this.#kbFrom = vi;\n    this.#kbTarget = vi;\n    this.#registration.setReorderingRow(vi);\n    this.#list.setCoordinatorLift(host);\n    const total = this.#count();\n    this.#announcer.announce(\n      this.#dragDefaults.announceLift(this.#label(), vi + 1, total),\n      'assertive',\n    );\n  }\n\n  #kbApplyTarget(): void {\n    this.#registration.virtualRowNavigation()?.scrollToRow(this.#kbTarget);\n    this.#announcer.announce(\n      this.#dragDefaults.announceMove(this.#label(), this.#kbTarget + 1, this.#count()),\n      'polite',\n    );\n  }\n\n  #kbCommit(): void {\n    this.rowReorder.emit({ from: this.#kbFrom, to: this.#kbTarget });\n    this.#announcer.announce(\n      this.#dragDefaults.announceDrop(this.#label(), this.#kbTarget + 1, this.#count()),\n      'assertive',\n    );\n    this.#kbTeardown();\n  }\n\n  #kbCancel(): void {\n    this.#announcer.announce(this.#dragDefaults.announceCancel(this.#label()), 'assertive');\n    this.#kbTeardown();\n  }\n\n  #resolveFocusTarget(host: HTMLElement): HTMLElement | SVGElement {\n    const active = this.#document.activeElement;\n    const focusable = active instanceof HTMLElement || active instanceof SVGElement;\n    return focusable && host.contains(active) ? active : host;\n  }\n\n  #kbTeardown(): void {\n    this.#mode = 'idle';\n    this.#kbLiftedHost = null;\n    this.#kbFocusEl = null;\n    this.#kbPath = null;\n    this.#kbFrom = 0;\n    this.#kbTarget = 0;\n    this.#registration.setReorderingRow(null);\n    this.#list.setCoordinatorLift(null);\n  }\n\n  #count(): number {\n    return this.ctx.rowCount() ?? this.#list.items().length;\n  }\n\n  #page(): number {\n    return Math.max(1, this.#list.items().length);\n  }\n\n  #label(): string {\n    return (this.#kbLiftedHost?.textContent ?? '').trim();\n  }\n\n  #setTarget(value: number): void {\n    this.#kbTarget = Math.max(0, Math.min(this.#count() - 1, value));\n  }\n\n  #trackPointerPress(event: PointerEvent): boolean {\n    if (this.#list.effectiveDisabled() || (event.pointerType === 'mouse' && event.button !== 0)) {\n      return false;\n    }\n    const target = event.target;\n    if (!(target instanceof Element)) {\n      return false;\n    }\n    const rowHost = target.closest<HTMLElement>('[forTableRow]');\n    if (rowHost === null) {\n      return false;\n    }\n    const draggable = this.#list.items().find((h) => h.host === rowHost);\n    if (draggable === undefined || draggable.disabled()) {\n      return false;\n    }\n    this.#pointerMain = event.clientY;\n    this.#scrubEngaged = event.shiftKey;\n    if (this.#mode !== 'idle') {\n      this.#pointerGrab = null;\n      return false;\n    }\n    this.#pointerGrab = rowHost;\n    return true;\n  }\n\n  #pinOnPointerLift(): boolean {\n    const rowHost = this.#pointerGrab;\n    this.#pointerGrab = null;\n    if (rowHost === null || this.#mode !== 'idle') {\n      return false;\n    }\n    this.#mode = 'pointer';\n    const handle = this.#registration.rows().find((r) => r.host === rowHost);\n    this.#registration.setReorderingRow(handle?.virtualIndex() ?? null);\n    return true;\n  }\n\n  #endPointerSession(): void {\n    this.#pointerGrab = null;\n    if (this.#mode !== 'pointer') {\n      return;\n    }\n    this.#mode = 'idle';\n    this.#registration.setReorderingRow(null);\n  }\n\n  #trackScrub(event: PointerEvent): void {\n    if (!this.#list.isDragging()) {\n      return;\n    }\n    this.#pointerMain = event.clientY;\n    this.#scrubEngaged = event.shiftKey;\n  }\n\n  #resolveDescriptor(event: ForDragDropEvent): TableRowReorderDescriptor {\n    const fallback: TableRowReorderDescriptor = {\n      from: event.previousIndex,\n      to: event.currentIndex,\n    };\n    if (event.container !== event.previousContainer) {\n      return fallback;\n    }\n    const rowByHost = new Map(this.#registration.rows().map((r) => [r.host, r] as const));\n    const windowIndices: number[] = [];\n    for (const item of this.#list.items()) {\n      const index = rowByHost.get(item.host)?.virtualIndex() ?? null;\n      if (index === null) {\n        return fallback;\n      }\n      windowIndices.push(index);\n    }\n    const rect = this.#registration.virtualRowNavigation()?.scrollViewportRect() ?? null;\n    if (rect !== null) {\n      const from = windowIndices[event.previousIndex] ?? event.previousIndex;\n      const scrub = resolveScrubReorder({\n        engaged: this.#scrubEngaged,\n        pointer: this.#pointerMain ?? rect.top,\n        viewportStart: rect.top,\n        viewportEnd: rect.bottom,\n        from,\n        count: this.#count(),\n      });\n      if (scrub !== null) {\n        return scrub;\n      }\n    }\n    return translateRowReorderIndices(windowIndices, event.previousIndex, event.currentIndex);\n  }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;AAAA;;;;;;;;;;;AAWG;AACG,SAAU,oBAAoB,CAClC,MAAyB,EAAA;IAEzB,MAAM,MAAM,GAA4C,IAAI,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC;IAChF,MAAM,KAAK,GAA2C,EAAE;AAExD,IAAA,MAAM,KAAK,GAAG,CAAC,KAA2C,KAAU;AAClE,QAAA,MAAM,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC,MAAM;AACpC,QAAA,KAAK,MAAM,CAAC,IAAI,KAAK,CAAC,OAAO,EAAE;AAC7B,YAAA,MAAM,CAAC,CAAC,CAAE,CAAC,OAAO,GAAG,OAAO;QAC9B;AACF,IAAA,CAAC;AAED,IAAA,KAAK,IAAI,KAAK,GAAG,CAAC,EAAE,KAAK,GAAG,MAAM,CAAC,MAA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