@forgeroute/ui 0.5.18 → 0.5.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (35) hide show
  1. package/fesm2022/forgeroute-ui-boards.mjs +2 -2
  2. package/fesm2022/forgeroute-ui-boards.mjs.map +1 -1
  3. package/fesm2022/forgeroute-ui-chip.mjs +25 -6
  4. package/fesm2022/forgeroute-ui-chip.mjs.map +1 -1
  5. package/fesm2022/{forgeroute-ui-core-ui-labels.es-Woi3az70.mjs → forgeroute-ui-core-ui-labels.es-ChTmqFlw.mjs} +37 -10
  6. package/fesm2022/forgeroute-ui-core-ui-labels.es-ChTmqFlw.mjs.map +1 -0
  7. package/fesm2022/forgeroute-ui-core.mjs +94 -19
  8. package/fesm2022/forgeroute-ui-core.mjs.map +1 -1
  9. package/fesm2022/forgeroute-ui-data-table-core.mjs +217 -26
  10. package/fesm2022/forgeroute-ui-data-table-core.mjs.map +1 -1
  11. package/fesm2022/forgeroute-ui-messaging.mjs +19 -2
  12. package/fesm2022/forgeroute-ui-messaging.mjs.map +1 -1
  13. package/fesm2022/forgeroute-ui-more-menu.mjs +61 -8
  14. package/fesm2022/forgeroute-ui-more-menu.mjs.map +1 -1
  15. package/fesm2022/forgeroute-ui-multi-select.mjs +2 -1
  16. package/fesm2022/forgeroute-ui-multi-select.mjs.map +1 -1
  17. package/fesm2022/forgeroute-ui-payments.mjs +870 -57
  18. package/fesm2022/forgeroute-ui-payments.mjs.map +1 -1
  19. package/fesm2022/forgeroute-ui-quickbooks.mjs.map +1 -1
  20. package/fesm2022/forgeroute-ui-square.mjs.map +1 -1
  21. package/fesm2022/forgeroute-ui-stripe.mjs +815 -49
  22. package/fesm2022/forgeroute-ui-stripe.mjs.map +1 -1
  23. package/fesm2022/forgeroute-ui-table-types.mjs.map +1 -1
  24. package/package.json +2 -6
  25. package/types/forgeroute-ui-chip.d.ts +11 -1
  26. package/types/forgeroute-ui-core.d.ts +65 -12
  27. package/types/forgeroute-ui-data-table-core.d.ts +60 -1
  28. package/types/forgeroute-ui-messaging.d.ts +15 -5
  29. package/types/forgeroute-ui-more-menu.d.ts +7 -0
  30. package/types/forgeroute-ui-payments.d.ts +332 -8
  31. package/types/forgeroute-ui-quickbooks.d.ts +2 -2
  32. package/types/forgeroute-ui-square.d.ts +1 -1
  33. package/types/forgeroute-ui-stripe.d.ts +293 -20
  34. package/types/forgeroute-ui-table-types.d.ts +29 -0
  35. package/fesm2022/forgeroute-ui-core-ui-labels.es-Woi3az70.mjs.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"forgeroute-ui-boards.mjs","names":[],"sources":["../../../projects/forgeroute-ui/boards/src/lib/board/board.component.ts","../../../projects/forgeroute-ui/boards/src/lib/kanban-board/kanban-geometry.ts","../../../projects/forgeroute-ui/boards/src/lib/kanban-board/kanban-board.component.ts"],"sourcesContent":["import {\n Component, ChangeDetectionStrategy, ViewEncapsulation, Directive, TemplateRef, contentChild, inject, ElementRef, input, output, signal, linkedSignal, computed, effect,\n} from '@angular/core';\nimport { NgTemplateOutlet } from '@angular/common';\nimport { RowAction } from '@forgeroute/ui/table-types';\nimport { ButtonComponent } from '@forgeroute/ui/core';\nimport { MoreMenuComponent } from '@forgeroute/ui/more-menu';\nimport { UiLabelsService } from '@forgeroute/ui/core';\n\n/** One column (stage) of a [ui-board]. `items` are the host's own records; the board never reads their fields. */\nexport interface BoardColumn<T = unknown> {\n /** Unique id of the column (the stage key); reported in `from` / `to` of a move. */\n key: string;\n /** Column title (shown uppercase). */\n label: string;\n items: T[];\n /** Dot colour: a CSS colour, or one of blue / cyan / green / teal / amber / orange / red / pink / slate / gray. */\n color?: string;\n /** Small line under the title, e.g. a pre-formatted total (\"$120,000\"). */\n summary?: string;\n /** Spoken version of `summary` (aria-label). Defaults to the summary text. */\n summaryLabel?: string;\n /** 'success' = green column and green card edge (a won / done stage). */\n tone?: 'default' | 'success';\n /** true = display-only column: items can't be dropped into it. */\n dropDisabled?: boolean;\n /** Text of the empty column; defaults to the board's `emptyColumnText`. */\n emptyText?: string;\n}\n\n/** Fired when the user moves a card to another column (drag and drop, or Shift + Arrow keys on a focused card). */\nexport interface BoardMoveEvent<T = unknown> {\n item: T;\n from: string;\n to: string;\n /** The board has ALREADY moved the card on screen. Call this if the host's save fails to put it back. */\n revert: () => void;\n}\n\nexport interface BoardCardActionEvent<T = unknown> {\n type: string;\n item: T;\n}\n\n/** Context of the card template: `<ng-template uiBoardCard let-item let-column=\"column\" let-menu=\"menu\">`. */\nexport interface BoardCardContext<T = unknown> {\n $implicit: T;\n column: BoardColumn<T>;\n /** Template of the card's \"⋮\" menu (renders nothing without `cardActions`). Output it with `{ $implicit: item }` in the card's top row. */\n menu: TemplateRef<{ $implicit: T }>;\n}\n\n/**\n * Marks the template that renders the INSIDE of a card (the board draws the card frame, menu and drag handling).\n * Bind the board's columns to type the card item: `<ng-template [uiBoardCard]=\"columns()\" let-lead>` gives `lead` the\n * columns' item type. The bare `<ng-template uiBoardCard let-item>` still works; `item` is then `unknown`.\n */\n@Directive({ selector: 'ng-template[uiBoardCard]', standalone: true })\nexport class BoardCardDirective<T = unknown> {\n /** Only used to infer the item type in the template; the value is never read. */\n readonly typeFrom = input<BoardColumn<T>[] | ''>('', { alias: 'uiBoardCard' });\n readonly template = inject<TemplateRef<BoardCardContext<T>>>(TemplateRef);\n static ngTemplateContextGuard<T>(_dir: BoardCardDirective<T>, _ctx: unknown): _ctx is BoardCardContext<T> { return true; }\n}\n\n/** Menu item types for \"Move to <column>\" (the board handles them itself; the host never sees them). */\nconst MOVE_PREFIX = 'ub-move:';\n// One arrow for every \"Move to\" item (a board can have many columns, so they cannot all differ): the group is told apart by its labels.\nconst MOVE_ICON = 'M4 12h12m0 0l-4-4m4 4l-4 4M20 5v14';\n\nlet nextBoardId = 0;\n\nconst DOT_COLORS: Record<string, string> = {\n blue: '#3b82f6', cyan: '#06b6d4', green: '#22c55e', teal: '#14b8a6', amber: '#f59e0b',\n orange: '#f97316', red: '#ef4444', pink: '#ec4899', slate: '#64748b', gray: '#6b7280',\n};\n\n/**\n * Kanban board: columns of cards that can be dragged between columns. Data and saving stay with the host.\n *\n * <ui-board [columns]=\"columns()\" [itemKey]=\"key\" [itemLabel]=\"label\" [cardActions]=\"actions\" [readOnly]=\"perm() !== 'full'\"\n * [loading]=\"loading()\" [error]=\"error()\" (retry)=\"load()\"\n * (cardClick)=\"open($event)\" (cardAction)=\"onAction($event)\" (itemMove)=\"onMove($event)\">\n * <ng-template [uiBoardCard]=\"columns()\" let-deal let-menu=\"menu\">\n * <div class=\"ub-card__top\"><span class=\"ub-card__title\">{{ deal.title }}</span>\n * <ng-container [ngTemplateOutlet]=\"menu\" [ngTemplateOutletContext]=\"{ $implicit: deal }\" /></div>\n * <div class=\"ub-card__contact\">{{ deal.contactName }}</div>\n * </ng-template>\n * </ui-board>\n *\n * - A drop moves the card on screen at once and emits `itemMove`; the host saves it and calls `event.revert()` if that fails.\n * - Keyboard: Enter / Space opens a card; Shift + ← / → moves it to the neighbouring column (announced to screen readers).\n * - `readOnly` removes dragging and keyboard moves. On phones (≤640px) the columns stack.\n */\n@Component({\n selector: 'ui-board',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n imports: [NgTemplateOutlet, ButtonComponent, MoreMenuComponent],\n template: `\n <!-- The card's \"⋮\" menu. Place it in the card's top row: <ng-container [ngTemplateOutlet]=\"menu\" [ngTemplateOutletContext]=\"{ $implicit: item }\" /> -->\n <ng-template #menuTpl let-item>\n @let actions = menuActions().get(itemKey()(item)) ?? cardActions();\n @if (actions.length) {\n <div class=\"ub-card__top-right\" (click)=\"$event.stopPropagation()\" (keydown)=\"$event.stopPropagation()\">\n <ui-more-menu [actions]=\"actions\" [ariaLabel]=\"labels.t('board.actionsFor', { name: itemLabel()(item) })\"\n (actionClick)=\"onMenuAction($event, item)\" />\n </div>\n }\n </ng-template>\n <div class=\"ub-wrap\">\n @if (loading()) {\n <div class=\"ub-skeleton\" role=\"status\" [attr.aria-label]=\"labels.t('board.loadingNamed', { name: ariaLabel() })\">\n @for (n of skeletonColumns(); track n) {\n <div class=\"ub-col-skeleton\" aria-hidden=\"true\">\n <div class=\"ub-col-skeleton__header\"></div>\n @for (c of [1, 2, 3]; track c) { <div class=\"ub-col-skeleton__card\"></div> }\n </div>\n }\n </div>\n } @else if (error()) {\n <div class=\"ub-message\" role=\"alert\">\n <p>{{ error() }}</p>\n <ui-button variant=\"secondary\" size=\"sm\" (click)=\"retry.emit()\">{{ retryLabel() }}</ui-button>\n </div>\n } @else if (cols().length === 0) {\n <div class=\"ub-message\" role=\"status\"><p>{{ emptyMessage() }}</p></div>\n } @else {\n <div class=\"ub-board\" role=\"region\" [attr.aria-label]=\"ariaLabel()\" [attr.aria-describedby]=\"canDrag() ? hintId : null\">\n @for (view of shownCols(); track view.col.key) {\n @let col = view.col;\n <div class=\"ub-col\"\n [class.ub-col--over]=\"overKey() === col.key\"\n [class.ub-col--success]=\"col.tone === 'success'\"\n role=\"group\"\n [attr.aria-label]=\"col.label + ' — ' + col.items.length + ' ' + (col.items.length === 1 ? itemNoun() : itemNounPlural())\"\n (dragover)=\"onDragOver($event, col)\"\n (dragleave)=\"onDragLeave($event, col)\"\n (drop)=\"onDrop($event, col)\">\n <div class=\"ub-col__header\">\n <div class=\"ub-col__title\">\n <span class=\"ub-col__dot\" [style.background]=\"dot(col.color)\" aria-hidden=\"true\"></span>\n <span class=\"ub-col__label\">{{ col.label }}</span>\n <span class=\"ub-col__count\" aria-hidden=\"true\">{{ col.items.length }}</span>\n </div>\n @if (col.summary) {\n <div class=\"ub-col__summary\"><span aria-hidden=\"true\">{{ col.summary }}</span><span class=\"ub-sr-only\">{{ col.summaryLabel || col.summary }}</span></div>\n }\n </div>\n <div class=\"ub-col__cards\" [attr.role]=\"col.items.length ? 'list' : null\">\n @for (item of view.shown; track itemKey()(item)) {\n @let key = itemKey()(item);\n <div class=\"ub-card\"\n [class.ub-card--success]=\"col.tone === 'success'\"\n [class.ub-card--dragging]=\"draggingKey() === key\"\n role=\"listitem\"\n tabindex=\"0\"\n [attr.data-board-key]=\"key\"\n [attr.aria-label]=\"itemLabel()(item)\"\n [attr.aria-keyshortcuts]=\"canDrag() ? 'Shift+ArrowLeft Shift+ArrowRight' : null\"\n [attr.draggable]=\"canDrag() ? 'true' : null\"\n (dragstart)=\"onDragStart($event, item, col)\"\n (dragend)=\"onDragEnd()\"\n (click)=\"cardClick.emit(item)\"\n (keydown)=\"onCardKey($event, item, col)\">\n @if (card(); as tpl) {\n <ng-container [ngTemplateOutlet]=\"tpl.template\" [ngTemplateOutletContext]=\"{ $implicit: item, column: col, menu: menuTpl }\" />\n }\n </div>\n }\n @if (view.hidden > 0) {\n <div class=\"ub-col__more\" role=\"listitem\">\n <button type=\"button\" class=\"ub-more-btn\" [attr.aria-label]=\"labels.t('board.showMore', { next: view.next, hidden: view.hidden }) + ', ' + col.label\" (click)=\"showMore(col.key)\">{{ labels.t('board.showMore', { next: view.next, hidden: view.hidden }) }}</button>\n </div>\n }\n @if (col.items.length === 0) {\n <div class=\"ub-col__empty\" role=\"status\">{{ col.emptyText || emptyColumnText() }}</div>\n }\n </div>\n </div>\n }\n </div>\n @if (canDrag()) {\n <p class=\"ub-sr-only\" [id]=\"hintId\">{{ labels.t('board.dragACardToAnother') }}</p>\n }\n <div class=\"ub-sr-only\" role=\"status\" aria-live=\"polite\">{{ announcement() }}</div>\n }\n </div>\n `,\n styles: [`\n ui-board { display: flex; flex-direction: column; flex: 1; min-height: 0; }\n .ub-wrap { flex: 1; min-height: 0; overflow: hidden; display: flex; flex-direction: column; }\n\n .ub-board { display: flex; gap: 12px; padding: 0 0 16px; overflow-x: auto; overflow-y: hidden; height: 100%; align-items: stretch; }\n .ub-board::-webkit-scrollbar { height: 6px; }\n .ub-board::-webkit-scrollbar-track { background: #f1f5f9; border-radius: 3px; }\n .ub-board::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }\n\n .ub-col { flex: 0 0 280px; min-width: 280px; max-width: 280px; display: flex; flex-direction: column; background: #f8fafc;\n border: 1.5px solid #e2e8f0; border-radius: 10px; min-height: 0; transition: border-color .15s, background .15s; }\n .ub-col--over { border-color: #3b82f6; background: #eff6ff; }\n .ub-col--success { background: #f0fdf4; border-color: #bbf7d0; }\n .ub-col--success.ub-col--over { border-color: #22c55e; background: #dcfce7; }\n\n .ub-col__header { padding: 12px 14px 10px; border-bottom: 1px solid #e2e8f0; flex-shrink: 0; }\n .ub-col__title { display: flex; align-items: center; gap: 7px; margin-bottom: 2px; }\n .ub-col__dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }\n .ub-col__label { font-size: 12px; font-weight: 700; color: #374151; text-transform: uppercase; letter-spacing: .04em; flex: 1;\n white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }\n .ub-col__count { font-size: 11px; font-weight: 600; color: #fff; background: #64748b; border-radius: 10px; padding: 1px 7px; flex-shrink: 0; }\n .ub-col__summary { font-size: 11px; color: #64748b; font-weight: 500; margin-top: 2px; }\n\n .ub-col__cards { flex: 1; overflow-y: auto; padding: 10px; display: flex; flex-direction: column; gap: 8px; min-height: 60px; }\n .ub-col__cards::-webkit-scrollbar { width: 4px; }\n .ub-col__cards::-webkit-scrollbar-track { background: transparent; }\n .ub-col__cards::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 2px; }\n .ub-col__more { flex-shrink: 0; }\n .ub-more-btn { width: 100%; padding: 8px 10px; font: inherit; font-size: 12px; font-weight: 600; color: #475569; background: #fff;\n border: 1.5px dashed #cbd5e1; border-radius: 8px; cursor: pointer; }\n .ub-more-btn:hover { background: #f1f5f9; border-color: #94a3b8; }\n .ub-more-btn:focus-visible { outline: 2px solid #3b82f6; outline-offset: 2px; }\n .ub-col__empty { text-align: center; padding: 24px 12px; color: #64748b; font-size: 12px; border: 1.5px dashed #e2e8f0; border-radius: 8px; margin: 4px 0; }\n\n .ub-card { position: relative; background: #fff; border: 1.5px solid #e2e8f0; border-radius: 8px; padding: 11px 12px; cursor: pointer;\n -webkit-user-select: none; user-select: none; transition: box-shadow .12s, border-color .12s, opacity .12s, transform .12s; }\n .ub-card[draggable='true'] { cursor: grab; }\n .ub-card[draggable='true']:active { cursor: grabbing; }\n .ub-card:hover { border-color: #94a3b8; box-shadow: 0 2px 8px rgba(0, 0, 0, .07); }\n .ub-card:focus-visible { outline: 2px solid #3b82f6; outline-offset: 2px; }\n .ub-card--dragging { opacity: .4; transform: scale(.98); box-shadow: none; }\n .ub-card--success { border-left: 3px solid #22c55e; }\n\n /* Card building blocks (the same look as the Pipeline board): use them inside the uiBoardCard template. */\n .ub-card__top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; margin-bottom: 4px; }\n .ub-card__title { font-size: 13px; font-weight: 600; color: #1e293b; line-height: 1.35; flex: 1; min-width: 0; word-break: break-word; }\n .ub-card:hover .ub-card__title { color: #2563eb; }\n .ub-card__top-right { flex-shrink: 0; margin-top: -2px; }\n .ub-card__status-row { margin-bottom: 5px; }\n .ub-card__contact { font-size: 12px; color: #475569; margin-bottom: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }\n .ub-card__property { font-size: 11px; color: #64748b; margin-bottom: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }\n .ub-card__next-step { display: flex; align-items: flex-start; gap: 4px; font-size: 11px; color: #64748b; margin-bottom: 6px; line-height: 1.4; }\n .ub-card__next-step svg { flex-shrink: 0; margin-top: 1px; color: #94a3b8; }\n .ub-card__footer { display: flex; align-items: center; justify-content: space-between; margin-top: 6px; padding-top: 6px; border-top: 1px solid #f1f5f9; }\n .ub-card__value { font-size: 12px; font-weight: 700; color: #0f172a; }\n .ub-card__activity { font-size: 11px; color: #64748b; }\n .ub-card__activity--stale { color: #b45309; font-weight: 600; }\n\n .ub-skeleton { display: flex; gap: 12px; padding-bottom: 16px; }\n .ub-col-skeleton { flex: 0 0 280px; background: #f8fafc; border: 1.5px solid #e2e8f0; border-radius: 10px; padding: 12px; display: flex; flex-direction: column; gap: 10px; }\n .ub-col-skeleton__header, .ub-col-skeleton__card { background: linear-gradient(90deg, #e2e8f0 25%, #f1f5f9 50%, #e2e8f0 75%); background-size: 200% 100%; animation: ub-shimmer 1.4s infinite; }\n .ub-col-skeleton__header { height: 32px; border-radius: 6px; }\n .ub-col-skeleton__card { height: 90px; border-radius: 8px; }\n @keyframes ub-shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }\n @media (prefers-reduced-motion: reduce) { .ub-col-skeleton__header, .ub-col-skeleton__card { animation: none; } .ub-card, .ub-col { transition: none; } .ub-card--dragging { transform: none; } }\n @media (pointer: coarse) { .ub-more-btn { min-height: 44px; } }\n\n .ub-message { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 48px; color: #64748b; font-size: 14px; text-align: center; }\n .ub-message p { margin: 0; }\n .ub-sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }\n\n @media (max-width: 640px) {\n .ub-board { flex-direction: column; overflow-x: hidden; overflow-y: auto; height: auto; align-items: stretch; }\n .ub-col { flex: none; min-width: 0; max-width: 100%; width: 100%; max-height: none; }\n .ub-skeleton { flex-direction: column; }\n .ub-col-skeleton { flex: none; width: 100%; }\n }\n `],\n})\nexport class BoardComponent<T = unknown> {\n protected readonly labels = inject(UiLabelsService);\n /** The columns in display order, each with its items. A new value replaces the board's content (and any on-screen move). */\n readonly columns = input.required<BoardColumn<T>[]>();\n /** Stable unique id of a card (used to track cards between renders, to find its menu and to move it). Must be unique across the whole board. */\n readonly itemKey = input.required<(item: T) => string>();\n /** Spoken name of a card: title, who, status, value... The card's visible content is the `uiBoardCard` template. */\n readonly itemLabel = input.required<(item: T) => string>();\n /** Menu on every card (the \"⋮\" button). Empty = no menu. Handle the pick in `(cardAction)`. */\n readonly cardActions = input<RowAction[]>([]);\n /**\n * Adds \"Move to <column>\" to every card's menu (one item per column the card may be moved to), so a card can be moved\n * without dragging - by touch, with a screen reader or with the mouse alone. Only while cards can be moved (not read-only,\n * not `moveDisabled`) and only to columns that accept the card (`canMove`, `dropDisabled`). Set false to leave the menu to `cardActions`.\n */\n readonly moveMenu = input(true);\n readonly loading = input(false);\n /** Error text: replaces the board with the message and a Retry button. */\n readonly error = input<string | null>(null);\n /** true = no dragging, no keyboard moves. */\n readonly readOnly = input(false);\n /** true = moves are paused (e.g. a save is running) so a second card can't be moved before the first is saved. */\n readonly moveDisabled = input(false);\n /** Optional rule: may this card go from this column to that one? A refused drop does nothing. */\n readonly canMove = input<((item: T, from: string, to: string) => boolean) | null>(null);\n readonly ariaLabelInput = input<string | null>(null, { alias: 'ariaLabel' });\n readonly ariaLabel = computed(() => this.ariaLabelInput() ?? this.labels.t('board.ariaLabel'));\n readonly emptyMessageInput = input<string | null>(null, { alias: 'emptyMessage' });\n readonly emptyMessage = computed(() => this.emptyMessageInput() ?? this.labels.t('board.emptyMessage'));\n readonly emptyColumnTextInput = input<string | null>(null, { alias: 'emptyColumnText' });\n readonly emptyColumnText = computed(() => this.emptyColumnTextInput() ?? this.labels.t('board.emptyColumnText'));\n /** Singular / plural noun for the column's spoken count (\"3 deals\"). */\n readonly itemNounInput = input<string | null>(null, { alias: 'itemNoun' });\n readonly itemNoun = computed(() => this.itemNounInput() ?? this.labels.t('board.itemNoun'));\n readonly itemNounPluralInput = input<string | null>(null, { alias: 'itemNounPlural' });\n readonly itemNounPlural = computed(() => this.itemNounPluralInput() ?? this.labels.t('board.itemNounPlural'));\n readonly retryLabelInput = input<string | null>(null, { alias: 'retryLabel' });\n readonly retryLabel = computed(() => this.retryLabelInput() ?? this.labels.t('board.retryLabel'));\n /**\n * Cards drawn per column at first, and added by each \"Show more\" click (0 = draw every card). The board loads every item\n * at once, so drawing only a page of each column keeps the first paint fast however many items there are. Column counts\n * and summaries still cover every item; a card moved into a column is drawn at its top, so it is always on screen.\n */\n readonly pageSize = input(50);\n\n readonly cardClick = output<T>();\n readonly cardAction = output<BoardCardActionEvent<T>>();\n readonly itemMove = output<BoardMoveEvent<T>>();\n readonly retry = output<void>();\n\n protected readonly card = contentChild(BoardCardDirective<T>);\n\n /** The columns as shown: the host's value, plus any move not yet replaced by new data. */\n protected readonly cols = linkedSignal(() => this.columns());\n /** Cards drawn per column. Kept when the host re-sends columns (a saved move, a search), so the board never jumps back; back to the first page on a reload (`loading`). */\n private readonly drawn = signal<Record<string, number>>({});\n /** The card the user last moved and where it went: it stays drawn even if the host re-sends it far down the column. */\n private readonly movedTo = signal<{ key: string; to: string } | null>(null);\n protected readonly shownCols = computed(() => {\n const size = this.pageSize() > 0 ? Math.floor(this.pageSize()) : 0;\n return this.cols().map(col => {\n const limit = this.limitOf(col);\n const hidden = Math.max(0, col.items.length - limit);\n return { col, shown: hidden ? col.items.slice(0, limit) : col.items, hidden, next: Math.min(size, hidden) };\n });\n });\n /** How many cards of `col` are drawn: the pages shown so far, extended so the card the user moved is always on screen. */\n private limitOf(col: BoardColumn<T>): number {\n const size = this.pageSize() > 0 ? Math.floor(this.pageSize()) : 0;\n if (!size) return col.items.length;\n let limit = this.drawn()[col.key] ?? size;\n const moved = this.movedTo();\n if (moved?.to === col.key) limit = Math.max(limit, col.items.findIndex(i => this.itemKey()(i) === moved.key) + 1);\n return limit;\n }\n protected showMore(key: string): void {\n const size = Math.floor(this.pageSize());\n const col = this.cols().find(c => c.key === key);\n if (!col || size < 1) return;\n const limit = Math.min(col.items.length, this.limitOf(col) + size);\n this.drawn.update(d => ({ ...d, [key]: limit }));\n this.announcement.set(this.labels.t('board.showingOf', { limit, total: col.items.length, noun: this.itemNounPlural(), column: col.label }));\n }\n /** Id of the keyboard-move hint that describes the board region. */\n protected readonly hintId = `ub-hint-${nextBoardId++}`;\n protected readonly overKey = signal<string | null>(null);\n protected readonly draggingKey = signal<string | null>(null);\n protected readonly announcement = signal('');\n\n private readonly host = inject<ElementRef<HTMLElement>>(ElementRef);\n\n constructor() {\n effect(() => { if (this.loading()) { this.drawn.set({}); this.movedTo.set(null); } });\n }\n private drag: { item: T; from: string } | null = null;\n\n protected readonly skeletonColumns = computed(() => Array.from({ length: Math.max(this.columns().length, 4) }, (_, i) => i));\n protected readonly canDrag = computed(() => !this.readOnly() && !this.moveDisabled());\n\n protected dot(color?: string): string { return (color && DOT_COLORS[color]) || color || '#3b82f6'; }\n\n // ─── Drag & drop ───────────────────────────────────────────\n\n protected onDragStart(event: DragEvent, item: T, col: BoardColumn<T>): void {\n if (!this.canDrag()) { event.preventDefault(); return; }\n this.drag = { item, from: col.key };\n this.draggingKey.set(this.itemKey()(item));\n if (event.dataTransfer) {\n event.dataTransfer.effectAllowed = 'move';\n event.dataTransfer.setData('text/plain', this.itemKey()(item)); // Firefox needs data to start a drag\n }\n }\n\n protected onDragEnd(): void {\n this.drag = null;\n this.draggingKey.set(null);\n this.overKey.set(null);\n }\n\n protected onDragOver(event: DragEvent, col: BoardColumn<T>): void {\n if (!this.drag || !this.accepts(this.drag.item, this.drag.from, col)) {\n if (event.dataTransfer) event.dataTransfer.dropEffect = 'none';\n return;\n }\n event.preventDefault();\n if (event.dataTransfer) event.dataTransfer.dropEffect = 'move';\n if (this.overKey() !== col.key) this.overKey.set(col.key);\n }\n\n protected onDragLeave(event: DragEvent, col: BoardColumn<T>): void {\n const related = event.relatedTarget as Node | null;\n if ((!related || !(event.currentTarget as HTMLElement).contains(related)) && this.overKey() === col.key) this.overKey.set(null);\n }\n\n protected onDrop(event: DragEvent, col: BoardColumn<T>): void {\n event.preventDefault();\n const drag = this.drag;\n this.onDragEnd();\n if (drag && this.accepts(drag.item, drag.from, col)) this.move(drag.item, drag.from, col.key);\n }\n\n // ─── Keyboard ──────────────────────────────────────────────\n\n protected onCardKey(event: KeyboardEvent, item: T, col: BoardColumn<T>): void {\n if (event.target !== event.currentTarget) return; // keys inside the card's own controls (the menu) are theirs\n if (event.key === 'Enter' || event.key === ' ') {\n event.preventDefault();\n this.cardClick.emit(item);\n return;\n }\n if (!event.shiftKey || (event.key !== 'ArrowLeft' && event.key !== 'ArrowRight')) return;\n event.preventDefault();\n if (!this.canDrag()) return;\n const cols = this.cols();\n const step = event.key === 'ArrowRight' ? 1 : -1;\n for (let i = cols.findIndex(c => c.key === col.key) + step; i >= 0 && i < cols.length; i += step) {\n if (this.accepts(item, col.key, cols[i])) {\n this.move(item, col.key, cols[i].key);\n this.announcement.set(this.labels.t('board.movedTo', { item: this.itemLabel()(item), column: cols[i].label }));\n this.focusCard(item);\n return;\n }\n }\n }\n\n // ─── Card menu ─────────────────────────────────────────────\n\n /** The menu of each card by item key: the host's `cardActions`, then \"Move to <column>\" for each column that accepts the card (one shared array per column when the host has no `canMove` rule). */\n protected readonly menuActions = computed(() => {\n const out = new Map<string, RowAction[]>();\n const own = this.cardActions();\n if (!this.moveMenu() || !this.canDrag()) return out;\n const cols = this.cols();\n const shared = new Map<string, RowAction[]>(); // without a canMove rule the targets only depend on the column\n for (const from of cols) {\n for (const item of from.items) {\n let list = this.canMove() ? undefined : shared.get(from.key);\n if (!list) {\n const moves = cols.filter(to => this.accepts(item, from.key, to)).map(to => ({ type: MOVE_PREFIX + to.key, label: this.labels.t('board.moveTo', { column: to.label }), icon: MOVE_ICON }));\n list = moves.length ? [...own, ...moves] : own;\n if (!this.canMove()) shared.set(from.key, list);\n }\n out.set(this.itemKey()(item), list);\n }\n }\n return out;\n });\n\n protected onMenuAction(type: string, item: T): void {\n if (!type.startsWith(MOVE_PREFIX)) { this.cardAction.emit({ type, item }); return; }\n const key = this.itemKey()(item);\n const from = this.cols().find(c => c.items.some(i => this.itemKey()(i) === key));\n const to = this.cols().find(c => c.key === type.slice(MOVE_PREFIX.length));\n if (!from || !to || !this.accepts(item, from.key, to)) return;\n this.move(item, from.key, to.key);\n this.announcement.set(this.labels.t('board.movedTo', { item: this.itemLabel()(item), column: to.label }));\n this.focusCard(item);\n }\n\n /** The card is re-created in its new column: put the focus back on it once it is drawn. */\n private focusCard(item: T): void {\n const key = this.itemKey()(item);\n setTimeout(() => {\n const cards = this.host.nativeElement.querySelectorAll<HTMLElement>('.ub-card');\n Array.from(cards).find(c => c.dataset['boardKey'] === key)?.focus();\n });\n }\n\n // ─── Moving ────────────────────────────────────────────────\n\n private accepts(item: T, from: string, to: BoardColumn<T>): boolean {\n if (from === to.key || to.dropDisabled || this.moveDisabled() || this.readOnly()) return false;\n const rule = this.canMove();\n return !rule || rule(item, from, to.key);\n }\n\n private move(item: T, from: string, to: string): void {\n const before = this.cols();\n const key = this.itemKey()(item);\n this.cols.set(before.map(c => {\n if (c.key === from) return { ...c, items: c.items.filter(i => this.itemKey()(i) !== key) };\n if (c.key === to) return { ...c, items: [item, ...c.items] };\n return c;\n }));\n this.movedTo.set({ key, to });\n this.itemMove.emit({ item, from, to, revert: () => { this.cols.set(before); this.movedTo.set(null); } });\n }\n}\n","/** The screen box of one column (viewport coordinates, like `getBoundingClientRect()`). */\nexport interface KanbanColumnRect { key: string; left: number; right: number; top: number; bottom: number }\n\n/** The column whose box holds the point (edges count), or null when the point is over none of them. The first match wins. */\nexport function columnAtPoint(rects: readonly KanbanColumnRect[], x: number, y: number): string | null {\n for (const r of rects) if (x >= r.left && x <= r.right && y >= r.top && y <= r.bottom) return r.key;\n return null;\n}\n\n/**\n * Where a dragged card lands in a column: the number of cards (the dragged one excluded) whose vertical middle is above the pointer. `middles` are the\n * middles of the column's cards from top to bottom, so the result is the final index of the dragged card in that column (0 = first, length = last).\n */\nexport function dropIndexAt(middles: readonly number[], y: number): number {\n let index = 0;\n for (const m of middles) if (m < y) index++;\n return index;\n}\n\n/**\n * How far to scroll per frame while dragging near an edge of a scroll area: negative near the start edge, positive near the end edge, 0 elsewhere.\n * The speed grows from 0 at `edge` px from the border to `maxSpeed` at (or beyond) the border.\n */\nexport function autoScrollDelta(pos: number, start: number, end: number, edge = 48, maxSpeed = 18): number {\n if (end - start <= 0) return 0;\n const zone = Math.min(edge, (end - start) / 2);\n if (pos < start + zone) return -Math.round(maxSpeed * Math.min(1, (start + zone - pos) / zone));\n if (pos > end - zone) return Math.round(maxSpeed * Math.min(1, (pos - (end - zone)) / zone));\n return 0;\n}\n\nexport function clamp(n: number, min: number, max: number): number {\n return Math.min(max, Math.max(min, n));\n}\n","import {\n ChangeDetectionStrategy, Component, DestroyRef, Directive, ElementRef, Injector, NgZone, TemplateRef, afterNextRender, computed, contentChild, inject,\n input, linkedSignal, output, signal, untracked, effect,\n} from '@angular/core';\nimport { DOCUMENT, NgTemplateOutlet } from '@angular/common';\nimport { RowAction } from '@forgeroute/ui/table-types';\nimport { ButtonComponent } from '@forgeroute/ui/core';\nimport { MoreMenuComponent } from '@forgeroute/ui/more-menu';\nimport { UiLabelsService } from '@forgeroute/ui/core';\nimport { autoScrollDelta, clamp, columnAtPoint, dropIndexAt } from './kanban-geometry';\n\n/** One column (stage) of a [ui-kanban-board]. */\nexport interface KanbanColumn {\n /** Unique id of the column; what `columnFn` returns for the cards that belong to it, and `fromColumn` / `toColumn` of a move. */\n key: string;\n /** Column title. */\n label: string;\n /** Dot colour: a CSS colour or one of blue / cyan / green / teal / amber / orange / red / pink / slate / gray. */\n color?: string;\n /** Chance (0 to 100) that a card in this stage closes, shown as a chip next to the count (\"60%\"). */\n probability?: number;\n /** Pre-formatted value shown at the foot of the column, e.g. a weighted total (\"$1.2M weighted\"). */\n footer?: string;\n /** Spoken version of `footer`. Defaults to the footer text. */\n footerLabel?: string;\n /** Text of the empty column; defaults to the board's `emptyText`. */\n emptyText?: string;\n /** true = cards can be dragged out of this column but never dropped into it. */\n disabled?: boolean;\n /**\n * Cards of this column the host has NOT loaded into `items` yet (server-side paging of a long column). They are added to the count chip and the spoken count, and once\n * every loaded card is drawn the column offers a \"Show more\" button that emits `columnMore` so the host can load the next page. A card the user moves out of or into the column\n * changes the count by itself (only the loaded cards move), so the host keeps `remaining` = server total minus the loaded cards of the column.\n */\n remaining?: number;\n /** true while the host loads the next page of this column (the \"Show more\" button shows its spinner and ignores clicks). */\n loadingMore?: boolean;\n /** How many cards the host's next page adds, for the \"Show N more\" label (never more than `remaining`). Default: the board's `pageSize`, or all `remaining` cards when the board draws everything (pageSize 0). */\n nextCount?: number;\n}\n\n/** Fired when the user drops a card somewhere new (drag, keyboard or the \"Move to\" menu). The board has ALREADY moved the card on screen. */\nexport interface KanbanMove<T = unknown> {\n /** Unique per move; `revert(move)` uses it. */\n id: number;\n item: T;\n fromColumn: string;\n toColumn: string;\n /** Position (0-based) in the column the card came from. */\n fromIndex: number;\n /** Final position (0-based) in the column it went to. */\n toIndex: number;\n /** Same as `board.revert(move)`: call it when the host's save failed to put the card back where it was. */\n revert: () => void;\n}\n\n/** Context of the card template: `<ng-template [uiKanbanCard]=\"items()\" let-deal let-column=\"column\">`. */\nexport interface KanbanCardContext<T = unknown> {\n $implicit: T;\n column: KanbanColumn;\n /** Position of the card in its column (0-based). */\n index: number;\n}\n\n/**\n * Marks the template that renders the INSIDE of a card (the board draws the frame, the grip, the \"Move to\" menu and the drag handling).\n * Bind the board's items to type the card: `<ng-template [uiKanbanCard]=\"items()\" let-deal>`; the bare `<ng-template uiKanbanCard let-item>` still works\n * (`item` is then `unknown`).\n */\n@Directive({ selector: 'ng-template[uiKanbanCard]', standalone: true })\nexport class KanbanCardDirective<T = unknown> {\n /** Only used to infer the item type in the template; the value is never read. */\n readonly typeFrom = input<readonly T[] | ''>('', { alias: 'uiKanbanCard' });\n readonly template = inject<TemplateRef<KanbanCardContext<T>>>(TemplateRef);\n static ngTemplateContextGuard<T>(_dir: KanbanCardDirective<T>, _ctx: unknown): _ctx is KanbanCardContext<T> { return true; }\n}\n\n/** Where a card is while it is being moved: the column and the final position it would have if dropped now. */\ninterface MoveSession<T> {\n mode: 'keyboard' | 'pointer';\n item: T;\n key: string;\n fromCol: string;\n fromIndex: number;\n /** Target column, or null while the pointer is over none. */\n col: string | null;\n /** Final index in the target column (the dragged card excluded from the count). */\n index: number;\n}\n\ninterface PointerDrag<T> {\n id: number;\n startX: number;\n startY: number;\n x: number;\n y: number;\n item: T;\n key: string;\n col: string;\n index: number;\n el: HTMLElement;\n ghost: HTMLElement | null;\n offX: number;\n offY: number;\n started: boolean;\n raf: number;\n}\n\nconst MOVE_PREFIX = 'kb-move:';\n/** One arrow for every \"Move to\" item: the items are told apart by their labels. */\nconst MOVE_ICON = 'M4 12h12m0 0l-4-4m4 4l-4 4M20 5v14';\n/** Pixels the pointer must travel before a press becomes a drag (a click that wobbles a little stays a click). */\nconst DRAG_THRESHOLD_PX = 5;\n\nconst DOT_COLORS: Record<string, string> = {\n blue: '#3b82f6', cyan: '#06b6d4', green: '#22c55e', teal: '#14b8a6', amber: '#f59e0b',\n orange: '#f97316', red: '#ef4444', pink: '#ec4899', slate: '#64748b', gray: '#6b7280',\n};\n\nlet nextBoardId = 0;\n\n/**\n * Kanban board with positional drag and drop: columns of cards that can be moved between and within columns. Data and saving stay with the host.\n *\n * <ui-kanban-board [columns]=\"columns()\" [items]=\"deals()\" [columnFn]=\"stageOf\" [cardId]=\"idOf\" [cardLabel]=\"nameOf\"\n * [canDrop]=\"canDrop\" [readOnly]=\"perm() !== 'full'\" [disabled]=\"saving()\" [loading]=\"loading()\"\n * (cardMove)=\"save($event)\" (cardClick)=\"open($event)\">\n * <ng-template [uiKanbanCard]=\"deals()\" let-deal let-column=\"column\"> ...card content... </ng-template>\n * </ui-kanban-board>\n *\n * - A drop moves the card on screen at once and emits `cardMove`; the host saves it and calls `board.revert(move)` (or `move.revert()`) if that fails.\n * - Pointer: drag a card (the mouse anywhere on it, touch from its grip). Keyboard: focus a card, Space picks it up, the arrow keys move it\n * (left / right = column, up / down = position), Space or Enter drops it, Escape cancels; every step is announced in a polite live region\n * (\"Moved Oak Plaza to Negotiation, position 2 of 5\"). Enter on a card that is not picked up emits `cardClick`. Arrow keys on a card that is\n * not picked up move the focus between cards.\n * - Touch-safe alternative: every card has a \"Move to\" menu (`moveMenu`), which also serves screen readers and mouse users who do not drag.\n * - `canDrop(item, fromColumn, toColumn)` forbids moves the backend would refuse: blocked columns are marked while a card is held (a visible\n * \"Not allowed\" badge, `aria-disabled`, announced), the drop is refused and the \"Move to\" menu leaves them out.\n * - `readOnly` removes the grips, the menu and every move; `disabled` pauses moves (e.g. while a save runs) and marks the board busy.\n * - On phones (<=640px) the columns scroll sideways with snap points.\n */\n@Component({\n selector: 'ui-kanban-board',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [NgTemplateOutlet, ButtonComponent, MoreMenuComponent],\n template: `\n <div class=\"kb-wrap\">\n @if (loading()) {\n <div class=\"kb-skeleton\" role=\"status\" [attr.aria-label]=\"labels.t('kanban.loading', { name: ariaLabel() })\">\n @for (n of skeletonColumns(); track n) {\n <div class=\"kb-col-skeleton\" aria-hidden=\"true\">\n <div class=\"kb-col-skeleton__header\"></div>\n @for (c of [1, 2, 3]; track c) { <div class=\"kb-col-skeleton__card\"></div> }\n </div>\n }\n </div>\n } @else {\n <div class=\"kb-board\" role=\"region\" [attr.aria-label]=\"ariaLabel()\" [attr.aria-describedby]=\"canDrag() ? hintId : null\"\n [attr.aria-busy]=\"disabled() ? 'true' : null\" [class.kb-board--dragging]=\"pointerDragging()\">\n @for (view of views(); track view.col.key) {\n @let col = view.col;\n <div class=\"kb-col\"\n role=\"group\"\n [class.kb-col--target]=\"isTarget(col.key)\"\n [class.kb-col--blocked]=\"isBlocked(col.key)\"\n [attr.data-kb-col]=\"col.key\"\n [attr.aria-disabled]=\"isBlocked(col.key) ? 'true' : null\"\n [attr.aria-label]=\"columnLabel(col, view.count)\">\n <div class=\"kb-col__header\">\n <span class=\"kb-col__dot\" [style.background]=\"dot(col.color)\" aria-hidden=\"true\"></span>\n <span class=\"kb-col__title\">{{ col.label }}</span>\n @if (col.probability !== undefined && col.probability !== null) {\n <span class=\"kb-col__prob\" aria-hidden=\"true\">{{ percent(col.probability) }}</span>\n <span class=\"kb-sr\">{{ labels.t('kanban.probability', { percent: percent(col.probability) }) }}</span>\n }\n <span class=\"kb-col__count\" aria-hidden=\"true\">{{ view.count }}</span>\n @if (isBlocked(col.key)) { <span class=\"kb-col__blocked\">{{ labels.t('kanban.blocked') }}</span> }\n </div>\n <div class=\"kb-col__cards\" [attr.role]=\"view.list.length || view.remaining > 0 ? 'list' : null\">\n @for (item of view.shown; track cardId()(item); let i = $index) {\n @let key = cardId()(item);\n @if (slotBefore(col.key, key)) { <div class=\"kb-slot\" aria-hidden=\"true\"></div> }\n <div class=\"kb-card\"\n role=\"listitem\"\n [class.kb-card--lifted]=\"liftedKey() === key\"\n [class.kb-card--movable]=\"canDrag()\"\n [attr.data-kb-key]=\"key\"\n [attr.tabindex]=\"key === tabbableKey() ? 0 : -1\"\n [attr.aria-label]=\"cardLabel()(item)\"\n [attr.aria-keyshortcuts]=\"canDrag() ? pickUpKeys : null\"\n (focus)=\"tabKey.set(key)\"\n (focusout)=\"onCardFocusOut($event, key)\"\n (keydown)=\"onCardKey($event, item, col, i)\"\n (click)=\"onCardClick(item)\"\n (dragstart)=\"$event.preventDefault()\"\n (pointerdown)=\"onPointerDown($event, item, col.key, i)\">\n @if (canDrag()) {\n <span class=\"kb-handle\" aria-hidden=\"true\">\n <svg width=\"12\" height=\"16\" viewBox=\"0 0 12 16\" fill=\"currentColor\" focusable=\"false\"><circle cx=\"3\" cy=\"3\" r=\"1.4\"/><circle cx=\"9\" cy=\"3\" r=\"1.4\"/><circle cx=\"3\" cy=\"8\" r=\"1.4\"/><circle cx=\"9\" cy=\"8\" r=\"1.4\"/><circle cx=\"3\" cy=\"13\" r=\"1.4\"/><circle cx=\"9\" cy=\"13\" r=\"1.4\"/></svg>\n </span>\n }\n <div class=\"kb-card__body\">\n @if (card(); as tpl) {\n <ng-container [ngTemplateOutlet]=\"tpl.template\" [ngTemplateOutletContext]=\"{ $implicit: item, column: col, index: i }\" />\n }\n </div>\n @if (canDrag() && moveMenu()) {\n @let actions = moveActions(item, col.key);\n @if (actions.length) {\n <div class=\"kb-card__menu\" (click)=\"$event.stopPropagation()\" (keydown)=\"$event.stopPropagation()\" (pointerdown)=\"$event.stopPropagation()\">\n <ui-more-menu [actions]=\"actions\" [ariaLabel]=\"labels.t('kanban.moveMenu', { name: cardLabel()(item) })\"\n (actionClick)=\"onMenuAction($event, item, col.key)\" />\n </div>\n }\n }\n </div>\n }\n @if (slotBefore(col.key, null)) { <div class=\"kb-slot\" aria-hidden=\"true\"></div> }\n @if (view.hidden > 0) {\n <div class=\"kb-more\" role=\"listitem\">\n <ui-button variant=\"secondary\" size=\"sm\" [fullWidth]=\"true\" (click)=\"showMore(col.key)\"\n [ariaLabel]=\"labels.t('kanban.showMore', { next: view.next, hidden: view.hidden }) + ', ' + col.label\">{{ labels.t('kanban.showMore', { next: view.next, hidden: view.hidden }) }}</ui-button>\n </div>\n }\n @if (view.hidden === 0 && view.remaining > 0) {\n <div class=\"kb-more kb-more--server\" role=\"listitem\">\n <ui-button variant=\"secondary\" size=\"sm\" [fullWidth]=\"true\" [loading]=\"!!col.loadingMore\" (click)=\"loadMore(col)\"\n [ariaLabel]=\"labels.t('kanban.showMore', { next: view.nextRemote, hidden: view.remaining }) + ', ' + col.label\">{{ labels.t('kanban.showMore', { next: view.nextRemote, hidden: view.remaining }) }}</ui-button>\n </div>\n }\n @if (view.list.length === 0 && view.remaining === 0 && !slotBefore(col.key, null)) {\n <div class=\"kb-col__empty\" role=\"status\">{{ col.emptyText || emptyText() }}</div>\n }\n </div>\n @if (col.footer) {\n <div class=\"kb-col__footer\"><span aria-hidden=\"true\">{{ col.footer }}</span><span class=\"kb-sr\">{{ col.footerLabel || col.footer }}</span></div>\n }\n </div>\n }\n </div>\n @if (canDrag()) { <p class=\"kb-sr\" [id]=\"hintId\">{{ labels.t('kanban.hint') }}</p> }\n <div class=\"kb-sr\" role=\"status\" aria-live=\"polite\" aria-atomic=\"true\">{{ announcement() }}</div>\n }\n </div>\n `,\n styles: [`\n /* min-width: 0 keeps the board as wide as its parent (a row-flex parent would otherwise grow it to its content's 4 x 283 px and the board would never scroll) */\n :host { display: flex; flex-direction: column; flex: 1; min-height: 0; min-width: 0; max-width: 100%; }\n .kb-wrap { flex: 1; min-height: 0; min-width: 0; display: flex; flex-direction: column; position: relative; }\n .kb-sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }\n\n .kb-board { display: flex; align-items: stretch; gap: 12px; flex: 1; min-height: 0; padding: 0 0 16px; overflow-x: auto; overflow-y: hidden;\n -webkit-overflow-scrolling: touch; scroll-snap-type: x proximity; }\n /* While a card is dragged the board scrolls by itself near its edges: snap points would pull every step back, so they are off until the drop. */\n .kb-board.kb-board--dragging { scroll-snap-type: none; }\n .kb-col { flex: 0 0 280px; width: 280px; display: flex; flex-direction: column; min-height: 0; background: #f8fafc; border: 1.5px solid #e2e8f0;\n border-radius: 10px; scroll-snap-align: start; transition: border-color .15s, background-color .15s; }\n .kb-col--target { border-color: #2563eb; background: #eff6ff; }\n .kb-col--blocked { border-style: dashed; border-color: #b91c1c; background: #fef2f2; }\n\n .kb-col__header { display: flex; align-items: center; gap: 7px; padding: 12px 14px 10px; border-bottom: 1px solid #e2e8f0; flex-shrink: 0; min-width: 0; }\n .kb-col__dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }\n .kb-col__title { flex: 1; min-width: 0; font-size: 12px; font-weight: 700; color: #374151; text-transform: uppercase; letter-spacing: .04em;\n white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }\n .kb-col__prob { font-size: 11px; font-weight: 600; color: #1e293b; background: #e2e8f0; border-radius: 10px; padding: 1px 7px; flex-shrink: 0; }\n .kb-col__count { font-size: 11px; font-weight: 600; color: #fff; background: #475569; border-radius: 10px; padding: 1px 7px; flex-shrink: 0; }\n .kb-col__blocked { font-size: 11px; font-weight: 700; color: #991b1b; flex-shrink: 0; }\n .kb-col__footer { padding: 8px 14px; border-top: 1px solid #e2e8f0; font-size: 12px; font-weight: 600; color: #334155; flex-shrink: 0; }\n\n .kb-col__cards { flex: 1; min-height: 60px; overflow-y: auto; padding: 10px; display: flex; flex-direction: column; gap: 8px; }\n .kb-col__empty { text-align: center; padding: 24px 12px; color: #475569; font-size: 12px; border: 1.5px dashed #cbd5e1; border-radius: 8px; }\n .kb-more { flex-shrink: 0; }\n .kb-slot { flex-shrink: 0; height: 56px; border: 2px dashed #2563eb; border-radius: 8px; background: #dbeafe; }\n\n .kb-card { position: relative; background: #fff; border: 1.5px solid #e2e8f0; border-radius: 8px; padding: 10px 36px 10px 12px; cursor: pointer;\n -webkit-user-select: none; user-select: none; transition: box-shadow .12s, border-color .12s, opacity .12s; }\n .kb-card--movable { padding-left: 26px; cursor: grab; }\n .kb-card:hover { border-color: #94a3b8; box-shadow: 0 2px 8px rgba(0, 0, 0, .07); }\n .kb-card:focus-visible { outline: 2px solid var(--ui-focus, #3b82f6); outline-offset: 2px; }\n .kb-card--lifted { opacity: .45; border-style: dashed; }\n .kb-card__body { min-width: 0; }\n .kb-card__menu { position: absolute; top: 4px; right: 4px; }\n /* The grip: the only place a finger can start a drag (so a swipe over a card still scrolls the board). */\n .kb-handle { position: absolute; left: 4px; top: 50%; transform: translateY(-50%); width: 18px; height: 28px; display: flex; align-items: center; justify-content: center;\n color: #64748b; touch-action: none; cursor: grab; }\n .kb-handle::after { content: ''; position: absolute; inset: -8px -6px; }\n .kb-ghost { position: fixed; left: 0; top: 0; margin: 0; z-index: 1000; pointer-events: none; opacity: .95; box-shadow: 0 10px 24px rgba(15, 23, 42, .28);\n transition: none; cursor: grabbing; }\n\n .kb-skeleton { display: flex; gap: 12px; padding-bottom: 16px; }\n .kb-col-skeleton { flex: 0 0 280px; background: #f8fafc; border: 1.5px solid #e2e8f0; border-radius: 10px; padding: 12px; display: flex; flex-direction: column; gap: 10px; }\n .kb-col-skeleton__header, .kb-col-skeleton__card { background: linear-gradient(90deg, #e2e8f0 25%, #f1f5f9 50%, #e2e8f0 75%); background-size: 200% 100%; animation: kb-shimmer 1.4s infinite; }\n .kb-col-skeleton__header { height: 32px; border-radius: 6px; }\n .kb-col-skeleton__card { height: 90px; border-radius: 8px; }\n @keyframes kb-shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }\n\n @media (prefers-reduced-motion: reduce) {\n .kb-col-skeleton__header, .kb-col-skeleton__card { animation: none; }\n .kb-card, .kb-col { transition: none; }\n .kb-board { scroll-behavior: auto; }\n }\n @media (forced-colors: active) {\n .kb-card, .kb-col { border: 1px solid CanvasText; }\n .kb-col--target { outline: 3px solid Highlight; outline-offset: -3px; }\n .kb-col--blocked { border-style: dashed; outline: 3px dashed CanvasText; outline-offset: -3px; }\n .kb-card:focus-visible { outline: 3px solid Highlight; }\n .kb-slot { border: 2px dashed Highlight; background: Canvas; }\n .kb-card--lifted { border-style: dashed; opacity: 1; }\n .kb-col__count, .kb-col__prob { border: 1px solid CanvasText; background: Canvas; color: CanvasText; }\n }\n @media (pointer: coarse) {\n .kb-handle { width: 32px; height: 44px; left: 0; }\n .kb-card--movable { padding-left: 36px; }\n .kb-card__menu { top: 0; right: 0; }\n }\n @media (max-width: 640px) {\n .kb-board { scroll-snap-type: x mandatory; scroll-padding: 0 12px; padding-left: 12px; padding-right: 12px; }\n .kb-board.kb-board--dragging { scroll-snap-type: none; }\n .kb-col { flex: 0 0 85%; width: 85%; }\n .kb-col-skeleton { flex: 0 0 85%; }\n }\n `],\n})\nexport class KanbanBoardComponent<T = unknown> {\n protected readonly labels = inject(UiLabelsService);\n private readonly host = inject<ElementRef<HTMLElement>>(ElementRef);\n private readonly doc = inject(DOCUMENT);\n private readonly injector = inject(Injector);\n private readonly zone = inject(NgZone);\n\n /** The columns in display order. */\n readonly columns = input.required<readonly KanbanColumn[]>();\n /** Every card of the board, in the order they should appear inside their column. Cards whose column is not in `columns` are not shown. */\n readonly items = input.required<readonly T[]>();\n /** The column key a card belongs to. */\n readonly columnFn = input.required<(item: T) => string>();\n /** Stable unique id of a card (tracks it between renders and finds it for focus and revert). Unique across the whole board. */\n readonly cardId = input.required<(item: T) => string>();\n /** Spoken name of a card (\"Oak Plaza, $1.2M\"): its accessible name and what the announcements say. The visible content is the `uiKanbanCard` template. */\n readonly cardLabel = input.required<(item: T) => string>();\n /** Rule for moves between columns: may this card go from this column to that one? Refused targets are marked, announced and left out of the menu. Not called for a move inside one column. */\n readonly canDrop = input<((item: T, fromColumn: string, toColumn: string) => boolean) | null>(null);\n /** false = cards can only change column, never position inside one (use it for a board the host sorts itself, e.g. by value). */\n readonly reorderable = input(true);\n /** Adds the \"Move to <column>\" menu to every card: the touch-, screen-reader- and mouse-friendly alternative to dragging. */\n readonly moveMenu = input(true);\n readonly loading = input(false);\n /** true = no grips, no menu, no drag, no keyboard moves (a read-only user). Cards still open. */\n readonly readOnly = input(false);\n /** true = moves are paused (a save is running): like `readOnly` (no grips, no menu, a drag in progress is cancelled) and the board is marked busy. */\n readonly disabled = input(false);\n /** Cards drawn per column at first and added by each \"Show more\" (0 = all). Counts and footers always cover every card. */\n readonly pageSize = input(50);\n readonly ariaLabelInput = input<string | null>(null, { alias: 'ariaLabel' });\n protected readonly ariaLabel = computed(() => this.ariaLabelInput() ?? this.labels.t('kanban.ariaLabel'));\n readonly emptyTextInput = input<string | null>(null, { alias: 'emptyText' });\n protected readonly emptyText = computed(() => this.emptyTextInput() ?? this.labels.t('kanban.emptyColumnText'));\n\n /** A card was dropped somewhere new. */\n readonly cardMove = output<KanbanMove<T>>();\n /** A card was clicked, or Enter was pressed on it. */\n readonly cardClick = output<T>();\n /** The \"Show more\" button of a column that has `remaining` unloaded cards was pressed: the host loads the next page of that column (the payload is the column key). */\n readonly columnMore = output<string>();\n\n protected readonly card = contentChild(KanbanCardDirective<T>);\n\n protected readonly hintId = `kb-hint-${nextBoardId++}`;\n /** `aria-keyshortcuts` of a movable card: the key that picks it up. */\n protected readonly pickUpKeys = 'Space';\n protected readonly announcement = signal('');\n protected readonly tabKey = signal<string | null>(null);\n protected readonly canDrag = computed(() => !this.readOnly() && !this.disabled());\n protected readonly skeletonColumns = computed(() => Array.from({ length: Math.max(this.columns().length, 4) }, (_, i) => i));\n\n /** The cards of every column in display order: the host's items, plus any move not yet replaced by new items. */\n private readonly layout = linkedSignal<Map<string, T[]>>(() => this.group(this.items(), this.columnKeys(), this.columnFn()));\n /** The column keys in order. A host that re-sends `columns` with new footers or counts must not reset a move that is still being saved, so the layout depends on the keys only. */\n private readonly columnKeys = computed(() => this.columns().map(c => c.key).join('\\u0000'), { equal: (a, b) => a === b });\n private readonly session = signal<MoveSession<T> | null>(null);\n private readonly drawn = signal<Record<string, number>>({});\n /** The key of the last moved card: whichever column it is in draws at least up to it, so a card dropped deep in a long column stays on screen (until the next move starts). */\n private readonly movedKey = signal<string | null>(null);\n private readonly history = new Map<number, { key: string; fromCol: string; fromIndex: number }>();\n private moveSeq = 0;\n private pointer: PointerDrag<T> | null = null;\n private suppressClick = false;\n\n protected readonly liftedKey = computed(() => this.session()?.key ?? null);\n protected readonly pointerDragging = computed(() => this.session()?.mode === 'pointer');\n\n /**\n * What each column draws. A column draws its first `pageSize` cards (\"Show more\" adds more) PLUS whatever must be on screen: the card that was last moved\n * (wherever the host put it), the card being moved in its own column, and - while a card is held with the keyboard - the whole of its own column and of the target\n * column (so End, the slot and the announcement are exact; this is bounded by the size of one column). A pointer drag never widens a column: the drop position\n * is counted among the cards drawn, so hovering a 600-card column does not render 600 cards.\n */\n protected readonly views = computed(() => {\n const size = this.pageSize() > 0 ? Math.floor(this.pageSize()) : 0;\n const session = this.session();\n const held = session?.mode === 'keyboard' ? session : null;\n const movedKey = this.movedKey();\n return this.columns().map(col => {\n const list = this.layout().get(col.key) ?? [];\n const whole = !size || (held !== null && (held.fromCol === col.key || held.col === col.key));\n let limit = whole ? list.length : Math.min(list.length, this.drawn()[col.key] ?? size);\n if (!whole) {\n if (session && session.fromCol === col.key) limit = Math.max(limit, Math.min(list.length, session.fromIndex + 1));\n if (movedKey !== null) {\n const at = list.findIndex(i => this.cardId()(i) === movedKey);\n if (at >= 0) limit = Math.max(limit, at + 1);\n }\n }\n const hidden = list.length - limit;\n const remaining = Math.max(0, Math.floor(col.remaining ?? 0));\n return {\n col, list, shown: hidden > 0 ? list.slice(0, limit) : list, hidden, next: Math.min(size, hidden),\n remaining, count: list.length + remaining, nextRemote: Math.min(remaining, Math.max(1, Math.floor(col.nextCount ?? (size > 0 ? size : remaining)))),\n };\n });\n });\n\n /** The card the Tab key reaches (one tab stop for the whole board): the last focused one, else the first card of the first column that has one. */\n protected readonly tabbableKey = computed(() => {\n const keys = new Set<string>();\n for (const list of this.layout().values()) for (const i of list) keys.add(this.cardId()(i));\n const wanted = this.tabKey();\n if (wanted && keys.has(wanted)) return wanted;\n for (const col of this.columns()) {\n const first = this.layout().get(col.key)?.[0];\n if (first !== undefined) return this.cardId()(first);\n }\n return null;\n });\n\n /** Where the drop slot is drawn: in `col`, before the card `beforeKey` (null = at the end). Null while nothing is held or the target is refused. */\n private readonly slot = computed(() => {\n const s = this.session();\n if (!s || s.col === null || !this.targetAllowed(s)) return null;\n const preview = (this.layout().get(s.col) ?? []).filter(i => this.cardId()(i) !== s.key);\n const before = preview[s.index];\n return { col: s.col, beforeKey: before === undefined ? null : this.cardId()(before) };\n });\n\n /** \"Move to\" menus, built on demand and rebuilt when the columns, the rule or the language change. */\n private readonly menuMemo = computed(() => {\n this.columns(); this.canDrop(); this.canDrag(); this.layout();\n void this.labels.t('kanban.moveTo', { column: '' });\n return new Map<string, RowAction[]>();\n });\n\n constructor() {\n // new items from the host replace the board: an older revert is moot and a move still being held (a polling refresh) is let go\n // (the last moved card stays drawn: the host usually re-sends its items right after a drop, and the card must not vanish from a long column)\n effect(() => { this.items(); untracked(() => { this.history.clear(); this.letGo(); }); });\n effect(() => { if (this.loading()) untracked(() => { this.drawn.set({}); this.movedKey.set(null); this.letGo(); }); });\n effect(() => { if (!this.canDrag()) untracked(() => this.letGo()); });\n inject(DestroyRef).onDestroy(() => this.endPointer(false, false));\n }\n\n /** Ends any move in progress without a drop and without an announcement (the board changed under it). */\n private letGo(): void {\n this.endPointer(false, false);\n if (this.session() !== null) this.session.set(null);\n }\n\n // ─── Template helpers ─────────────────────────────────────\n\n protected dot(color?: string): string { return (color && DOT_COLORS[color]) || color || '#3b82f6'; }\n protected percent(p: number): string { return this.labels.formatNumber(p / 100, { style: 'percent', maximumFractionDigits: 1 }); }\n protected columnLabel(col: KanbanColumn, count: number): string {\n return this.labels.t(count === 1 ? 'kanban.columnLabel_one' : 'kanban.columnLabel_other', { column: col.label, count });\n }\n protected isTarget(key: string): boolean {\n const s = this.session();\n return !!s && s.col === key && this.targetAllowed(s);\n }\n /** While a card is held, a column that cannot take it. */\n protected isBlocked(key: string): boolean {\n const s = this.session();\n if (!s || key === s.fromCol) return false;\n const col = this.columns().find(c => c.key === key);\n return !!col && !this.accepts(s.item, s.fromCol, col);\n }\n protected slotBefore(colKey: string, beforeKey: string | null): boolean {\n const slot = this.slot();\n return !!slot && slot.col === colKey && slot.beforeKey === beforeKey;\n }\n protected loadMore(col: KanbanColumn): void {\n if (col.loadingMore) return;\n this.columnMore.emit(col.key);\n }\n protected showMore(colKey: string): void {\n const size = Math.floor(this.pageSize());\n const view = this.views().find(v => v.col.key === colKey);\n if (!view || size < 1) return;\n const limit = Math.min(view.list.length, view.shown.length + size);\n this.drawn.update(d => ({ ...d, [colKey]: limit }));\n this.announce(this.labels.t('kanban.showingOf', { limit, total: view.list.length, column: view.col.label }));\n }\n\n // ─── Public API ───────────────────────────────────────────\n\n /**\n * Puts a card back where it was before `move` (call it when the host's save failed). Does nothing when the host has already replaced `items`\n * (the new data wins; a host that updates its own items inside `cardMove` must revert its own data) or the move was reverted before. When the same card\n * was moved again after `move`, reverting the OLDER move puts the card at the older origin and makes the later move's revert a no-op; reverting the later move\n * first puts it at the later origin (and the older revert still works).\n */\n revert(move: KanbanMove<T>): void {\n const rec = this.history.get(move.id);\n if (!rec) return;\n // the card is back at the place this move took it from, so any LATER move of the same card (still being saved) no longer describes where it is: its revert is moot\n for (const [id, other] of this.history) if (other.key === rec.key && id >= move.id) this.history.delete(id);\n const next = new Map(this.layout());\n for (const [colKey, list] of next) {\n if (list.some(i => this.cardId()(i) === rec.key)) next.set(colKey, list.filter(i => this.cardId()(i) !== rec.key));\n }\n const target = [...(next.get(rec.fromCol) ?? [])];\n const at = clamp(rec.fromIndex, 0, target.length);\n target.splice(at, 0, move.item);\n next.set(rec.fromCol, target);\n this.layout.set(next);\n this.movedKey.set(rec.key);\n this.announce(this.labels.t('kanban.reverted', { item: this.cardLabel()(move.item), column: this.colLabelOf(rec.fromCol), position: at + 1, total: target.length }));\n this.focusCard(rec.key);\n }\n\n // ─── Rules ────────────────────────────────────────────────\n\n private group(items: readonly T[], columnKeys: string, columnOf: (item: T) => string): Map<string, T[]> {\n const map = new Map<string, T[]>(columnKeys.split('\\u0000').map(k => [k, [] as T[]]));\n for (const item of items) map.get(columnOf(item))?.push(item);\n return map;\n }\n\n /** May the card leave `from` for column `to` (a different column)? */\n private accepts(item: T, from: string, to: KanbanColumn): boolean {\n if (to.key === from || to.disabled || !this.canDrag()) return false;\n const rule = this.canDrop();\n return !rule || rule(item, from, to.key);\n }\n\n private targetAllowed(s: MoveSession<T>): boolean {\n if (s.col === null) return false;\n // dropping a card where it started is always fine (it changes nothing); a new position in the same column needs `reorderable`\n if (s.col === s.fromCol) return this.reorderable() || s.index === s.fromIndex;\n const col = this.columns().find(c => c.key === s.col);\n return !!col && this.accepts(s.item, s.fromCol, col);\n }\n\n private previewLength(s: MoveSession<T>, colKey: string): number {\n return (this.layout().get(colKey)?.length ?? 0) - (colKey === s.fromCol ? 1 : 0);\n }\n\n private colLabelOf(key: string): string { return this.columns().find(c => c.key === key)?.label ?? key; }\n\n private announce(text: string): void {\n // an identical message is not re-read by a live region: alternate a no-break space so a repeated move is spoken again\n this.announcement.set(text === this.announcement() ? text + '\\u00A0' : text);\n }\n\n // ─── Keyboard ─────────────────────────────────────────────\n\n protected onCardClick(item: T): void {\n if (this.suppressClick) return;\n this.cardClick.emit(item);\n }\n\n protected onCardKey(event: KeyboardEvent, item: T, col: KanbanColumn, index: number): void {\n if (event.target !== event.currentTarget) return; // keys inside the card's own controls (links, the menu) are theirs\n if (event.altKey || event.ctrlKey || event.metaKey) return;\n const key = this.cardId()(item);\n const s = this.session();\n if (s) {\n if (s.mode === 'keyboard' && s.key === key) this.onHeldKey(event, s);\n return;\n }\n switch (event.key) {\n case 'Enter':\n event.preventDefault();\n this.cardClick.emit(item);\n return;\n case ' ':\n event.preventDefault();\n if (this.canDrag()) this.pickUp(item, key, col.key, index);\n else this.cardClick.emit(item);\n return;\n case 'ArrowDown': case 'ArrowUp': case 'Home': case 'End': case 'ArrowLeft': case 'ArrowRight':\n event.preventDefault();\n this.moveFocus(event.key, key, col.key, index);\n return;\n }\n }\n\n protected onCardFocusOut(event: FocusEvent, key: string): void {\n const s = this.session();\n if (!s || s.mode !== 'keyboard' || s.key !== key) return;\n const next = event.relatedTarget as Node | null;\n if (next && (event.currentTarget as HTMLElement).contains(next)) return;\n this.cancelSession();\n }\n\n private pickUp(item: T, key: string, colKey: string, index: number): void {\n this.movedKey.set(null);\n this.session.set({ mode: 'keyboard', item, key, fromCol: colKey, fromIndex: index, col: colKey, index });\n this.announce(this.labels.t('kanban.pickedUp', {\n item: this.cardLabel()(item), column: this.colLabelOf(colKey), position: index + 1, total: this.layout().get(colKey)?.length ?? 0,\n }));\n }\n\n private onHeldKey(event: KeyboardEvent, s: MoveSession<T>): void {\n const cols = this.columns();\n const at = cols.findIndex(c => c.key === s.col);\n switch (event.key) {\n case 'ArrowLeft': case 'ArrowRight': {\n event.preventDefault();\n const to = cols[clamp(at + (event.key === 'ArrowRight' ? 1 : -1), 0, cols.length - 1)];\n if (to.key === s.col) return;\n // back in the column it came from, a board that cannot reorder puts the card on its own place again\n const back = to.key === s.fromCol && !this.reorderable();\n this.target(s, to.key, back ? s.fromIndex : clamp(s.index, 0, this.previewLength(s, to.key)));\n return;\n }\n case 'ArrowUp': case 'ArrowDown': {\n event.preventDefault();\n const col = s.col ?? s.fromCol;\n if (!this.reorderable() && col === s.fromCol) return;\n this.target(s, col, clamp(s.index + (event.key === 'ArrowDown' ? 1 : -1), 0, this.previewLength(s, col)));\n return;\n }\n case 'Home': case 'End': {\n event.preventDefault();\n const col = s.col ?? s.fromCol;\n if (!this.reorderable() && col === s.fromCol) return;\n this.target(s, col, event.key === 'Home' ? 0 : this.previewLength(s, col));\n return;\n }\n case 'Enter': case ' ':\n event.preventDefault();\n this.drop();\n return;\n case 'Escape':\n event.preventDefault();\n this.cancelSession();\n return;\n }\n }\n\n /** Moves the held card's target and says where it is now (or that the place refuses it). */\n private target(s: MoveSession<T>, col: string, index: number): void {\n const next: MoveSession<T> = { ...s, col, index };\n if (next.col === s.col && next.index === s.index) return;\n this.session.set(next);\n const item = this.cardLabel()(s.item);\n const column = this.colLabelOf(col);\n this.showTarget();\n if (this.targetAllowed(next)) this.announce(this.labels.t('kanban.movingOver', { item, column, position: index + 1, total: this.previewLength(next, col) + 1 }));\n else this.announce(this.labels.t('kanban.movingOverBlocked', { item, column }));\n }\n\n /** Keeps the held card's target on screen: after the new slot (or the refused column) is drawn, scroll it into view (sideways to the column, down to the slot). */\n private showTarget(): void {\n afterNextRender(() => {\n const s = this.session();\n if (!s || s.col === null) return;\n const root = this.host.nativeElement;\n const col = Array.from(root.querySelectorAll<HTMLElement>('.kb-col')).find(c => c.dataset['kbCol'] === s.col);\n const slot = col?.querySelector<HTMLElement>('.kb-slot');\n (slot ?? col)?.scrollIntoView({ block: 'nearest', inline: 'nearest' });\n }, { injector: this.injector });\n }\n\n private moveFocus(key: string, cardKey: string, colKey: string, index: number): void {\n const views = this.views();\n const at = views.findIndex(v => v.col.key === colKey);\n const here = views[at];\n let target: string | null = null;\n if (key === 'ArrowDown') target = this.keyAt(here.shown, index + 1);\n else if (key === 'ArrowUp') target = this.keyAt(here.shown, index - 1);\n else if (key === 'Home') target = this.keyAt(here.shown, 0);\n else if (key === 'End') target = this.keyAt(here.shown, here.shown.length - 1);\n else {\n const step = key === 'ArrowRight' ? 1 : -1;\n for (let i = at + step; i >= 0 && i < views.length; i += step) {\n if (views[i].shown.length) { target = this.keyAt(views[i].shown, Math.min(index, views[i].shown.length - 1)); break; }\n }\n }\n if (target && target !== cardKey) this.focusNow(target);\n }\n\n private keyAt(list: readonly T[], i: number): string | null {\n const item = list[i];\n return item === undefined ? null : this.cardId()(item);\n }\n\n // ─── Pointer drag ─────────────────────────────────────────\n\n protected onPointerDown(event: PointerEvent, item: T, colKey: string, index: number): void {\n if (!this.canDrag() || this.session() || this.pointer || event.isPrimary === false) return;\n if (event.pointerType === 'mouse' && event.button !== 0) return;\n const target = event.target as HTMLElement | null;\n if (!target || target.closest('button, a, input, select, textarea, [contenteditable], [data-kanban-nodrag], .kb-card__menu')) return;\n // a finger or a pen drags from the grip only, so a swipe over a card still scrolls the board\n if (event.pointerType !== 'mouse' && !target.closest('.kb-handle')) return;\n const el = event.currentTarget as HTMLElement;\n const rect = el.getBoundingClientRect();\n this.pointer = {\n id: event.pointerId, startX: event.clientX, startY: event.clientY, x: event.clientX, y: event.clientY, item, key: this.cardId()(item), col: colKey, index,\n el, ghost: null, offX: event.clientX - rect.left, offY: event.clientY - rect.top, started: false, raf: 0,\n };\n this.doc.addEventListener('pointermove', this.onDocMove);\n this.doc.addEventListener('pointerup', this.onDocUp);\n this.doc.addEventListener('pointercancel', this.onDocCancel);\n this.doc.addEventListener('keydown', this.onDocKey);\n this.doc.addEventListener('selectstart', this.onSelectStart);\n }\n\n private readonly onDocMove = (event: PointerEvent): void => {\n const p = this.pointer;\n if (!p || event.pointerId !== p.id) return;\n p.x = event.clientX;\n p.y = event.clientY;\n if (!p.started) {\n if (Math.hypot(p.x - p.startX, p.y - p.startY) < DRAG_THRESHOLD_PX) return;\n this.startDrag(p);\n }\n event.preventDefault();\n this.placeGhost(p);\n this.retarget(p);\n };\n\n private readonly onDocUp = (event: PointerEvent): void => {\n if (this.pointer && event.pointerId === this.pointer.id) this.endPointer(true, true);\n };\n\n private readonly onDocCancel = (event: PointerEvent): void => {\n if (this.pointer && event.pointerId === this.pointer.id) this.endPointer(false, true);\n };\n\n /** A drag across the page must not select text on the way. */\n private readonly onSelectStart = (event: Event): void => { if (this.pointer) event.preventDefault(); };\n\n private readonly onDocKey = (event: KeyboardEvent): void => {\n if (event.key === 'Escape' && this.pointer) { event.preventDefault(); this.endPointer(false, true); }\n };\n\n private startDrag(p: PointerDrag<T>): void {\n p.started = true;\n this.movedKey.set(null);\n this.session.set({ mode: 'pointer', item: p.item, key: p.key, fromCol: p.col, fromIndex: p.index, col: p.col, index: p.index });\n const rect = p.el.getBoundingClientRect();\n const ghost = p.el.cloneNode(true) as HTMLElement;\n ghost.classList.add('kb-ghost');\n ghost.removeAttribute('tabindex');\n ghost.removeAttribute('data-kb-key');\n // a picture of the card, nothing more: not read, not focusable, no duplicate ids, no menu\n ghost.setAttribute('aria-hidden', 'true');\n ghost.setAttribute('inert', '');\n ghost.querySelectorAll('.kb-card__menu').forEach(n => n.remove());\n ghost.querySelectorAll('[id]').forEach(n => n.removeAttribute('id'));\n ghost.querySelectorAll('a, button, input, select, textarea, iframe, [tabindex], [contenteditable]').forEach(n => n.setAttribute('tabindex', '-1'));\n ghost.style.boxSizing = 'border-box';\n ghost.style.width = `${rect.width}px`;\n ghost.style.height = `${rect.height}px`;\n // fixed positioning inside a transformed ancestor would be relative to that ancestor, so the picture lives on the body; it keeps the card's text style\n const look = this.doc.defaultView?.getComputedStyle(p.el);\n if (look) { ghost.style.font = look.font; ghost.style.color = look.color; }\n this.doc.body.appendChild(ghost);\n p.ghost = ghost;\n this.scheduleScroll(p);\n }\n\n private placeGhost(p: PointerDrag<T>): void {\n if (p.ghost) p.ghost.style.transform = `translate3d(${p.x - p.offX}px, ${p.y - p.offY}px, 0)`;\n }\n\n /** Finds the column under the pointer and the position among its cards. */\n private retarget(p: PointerDrag<T>): void {\n const s = this.session();\n if (!s || s.mode !== 'pointer') return;\n const cols = Array.from(this.host.nativeElement.querySelectorAll<HTMLElement>('.kb-col'));\n const rects = cols.map(c => { const r = c.getBoundingClientRect(); return { key: c.dataset['kbCol'] ?? '', left: r.left, right: r.right, top: r.top, bottom: r.bottom }; });\n const key = columnAtPoint(rects, p.x, p.y);\n if (key === null) {\n if (s.col !== null) this.session.set({ ...s, col: null });\n return;\n }\n const colEl = cols[rects.findIndex(r => r.key === key)];\n // The drop slot pushes the cards after it down; measure them where they would be without it, or the slot itself would move the target (a flicker).\n const slotEl = colEl.querySelector<HTMLElement>('.kb-slot');\n const list = colEl.querySelector<HTMLElement>('.kb-col__cards');\n const push = slotEl ? slotEl.getBoundingClientRect().height + (parseFloat(this.doc.defaultView?.getComputedStyle(list ?? colEl).rowGap ?? '') || 0) : 0;\n const middles = Array.from(colEl.querySelectorAll<HTMLElement>('.kb-card:not(.kb-ghost)'))\n .filter(c => c.dataset['kbKey'] !== p.key)\n .map(c => {\n const r = c.getBoundingClientRect();\n const after = slotEl && (slotEl.compareDocumentPosition(c) & Node.DOCUMENT_POSITION_FOLLOWING) !== 0;\n return r.top + r.height / 2 - (after ? push : 0);\n });\n const index = dropIndexAt(middles, p.y);\n if (s.col !== key || s.index !== index) this.session.set({ ...s, col: key, index });\n }\n\n private scheduleScroll(p: PointerDrag<T>): void {\n const win = this.doc.defaultView;\n if (!win) return;\n const step = (): void => {\n if (this.pointer !== p) return;\n const board = this.host.nativeElement.querySelector<HTMLElement>('.kb-board');\n if (board) {\n const r = board.getBoundingClientRect();\n const dx = autoScrollDelta(p.x, r.left, r.right);\n if (dx) board.scrollLeft += dx;\n const s = this.session();\n const list = s?.col ? this.host.nativeElement.querySelector<HTMLElement>(`.kb-col[data-kb-col=\"${s.col.replace(/[\"\\\\]/g, '\\\\$&')}\"] .kb-col__cards`) : null;\n let dy = 0;\n if (list) {\n const lr = list.getBoundingClientRect();\n dy = autoScrollDelta(p.y, lr.top, lr.bottom);\n if (dy) list.scrollTop += dy;\n }\n // the content moved under a still pointer: find the column / position again, also when the pointer was over no column (a gap) before the scroll\n if (dx || dy) this.retarget(p);\n }\n p.raf = win.requestAnimationFrame(step);\n };\n // the frame loop runs outside Angular's zone: a loop that lives as long as the drag must not keep the zone busy or run a change detection every frame (signals still schedule one when a retarget changes the view)\n this.zone.runOutsideAngular(() => { p.raf = win.requestAnimationFrame(step); });\n }\n\n /** Ends a press: `commit` drops the card where it is held, otherwise it stays. `say` = announce a cancel. */\n private endPointer(commit: boolean, say: boolean): void {\n const p = this.pointer;\n if (!p) return;\n this.pointer = null;\n this.doc.removeEventListener('pointermove', this.onDocMove);\n this.doc.removeEventListener('pointerup', this.onDocUp);\n this.doc.removeEventListener('pointercancel', this.onDocCancel);\n this.doc.removeEventListener('keydown', this.onDocKey);\n this.doc.removeEventListener('selectstart', this.onSelectStart);\n this.doc.defaultView?.cancelAnimationFrame(p.raf);\n p.ghost?.remove();\n if (!p.started) return;\n // the click that follows a drag must not open the card\n this.suppressClick = true;\n setTimeout(() => { this.suppressClick = false; });\n if (commit) this.drop();\n else if (say) this.cancelSession();\n else this.session.set(null);\n }\n\n // ─── Dropping, cancelling, menu ───────────────────────────\n\n /** Drops the held card at its target: a refused target announces why (a held card stays held, a dragged one goes home). */\n private drop(): void {\n const s = this.session();\n if (!s) return;\n if (s.col === null) { this.cancelSession(); return; }\n if (!this.targetAllowed(s)) {\n this.announce(this.labels.t('kanban.dropBlocked', { item: this.cardLabel()(s.item), column: this.colLabelOf(s.col) }));\n if (s.mode === 'pointer') this.session.set(null);\n return;\n }\n this.session.set(null);\n if (s.col === s.fromCol && s.index === s.fromIndex) {\n this.announce(this.labels.t('kanban.unchanged', {\n item: this.cardLabel()(s.item), column: this.colLabelOf(s.col), position: s.index + 1, total: this.layout().get(s.col)?.length ?? 0,\n }));\n this.focusCard(s.key);\n return;\n }\n this.applyMove(s.item, s.key, s.fromCol, s.fromIndex, s.col, s.index);\n }\n\n private cancelSession(): void {\n const s = this.session();\n if (!s) return;\n this.session.set(null);\n this.announce(this.labels.t('kanban.cancelled', {\n item: this.cardLabel()(s.item), column: this.colLabelOf(s.fromCol), position: s.fromIndex + 1, total: this.layout().get(s.fromCol)?.length ?? 0,\n }));\n this.focusCard(s.key);\n }\n\n /** The \"Move to\" menu of a card: one item per column that accepts it. */\n protected moveActions(item: T, fromCol: string): RowAction[] {\n if (!this.canDrag()) return [];\n const memo = this.menuMemo();\n const rule = this.canDrop();\n const memoKey = rule ? `${fromCol}|${this.cardId()(item)}` : fromCol;\n let actions = memo.get(memoKey);\n if (!actions) {\n actions = this.columns()\n .filter(to => this.accepts(item, fromCol, to))\n .map(to => ({ type: MOVE_PREFIX + to.key, label: this.labels.t('kanban.moveTo', { column: to.label }), icon: MOVE_ICON }));\n memo.set(memoKey, actions);\n }\n return actions;\n }\n\n protected onMenuAction(type: string, item: T, fromCol: string): void {\n if (!type.startsWith(MOVE_PREFIX) || !this.canDrag()) return;\n const to = this.columns().find(c => c.key === type.slice(MOVE_PREFIX.length));\n if (!to || !this.accepts(item, fromCol, to)) return;\n const key = this.cardId()(item);\n const fromIndex = (this.layout().get(fromCol) ?? []).findIndex(i => this.cardId()(i) === key);\n if (fromIndex < 0) return;\n this.applyMove(item, key, fromCol, fromIndex, to.key, 0);\n }\n\n private applyMove(item: T, key: string, fromCol: string, fromIndex: number, toCol: string, toIndex: number): void {\n const before = this.layout();\n const next = new Map(before);\n const source = (before.get(fromCol) ?? []).filter(i => this.cardId()(i) !== key);\n const dest = fromCol === toCol ? source : [...(before.get(toCol) ?? [])];\n const at = clamp(toIndex, 0, dest.length);\n const placed = [...dest];\n placed.splice(at, 0, item);\n if (fromCol !== toCol) next.set(fromCol, source);\n next.set(toCol, placed);\n this.layout.set(next);\n this.movedKey.set(key);\n const id = ++this.moveSeq;\n this.history.set(id, { key, fromCol, fromIndex });\n this.announce(this.labels.t('kanban.moved', { item: this.cardLabel()(item), column: this.colLabelOf(toCol), position: at + 1, total: placed.length }));\n this.focusCard(key);\n const move: KanbanMove<T> = { id, item, fromColumn: fromCol, toColumn: toCol, fromIndex, toIndex: at, revert: () => this.revert(move) };\n this.cardMove.emit(move);\n }\n\n // ─── Focus ────────────────────────────────────────────────\n\n private findCard(key: string): HTMLElement | undefined {\n return Array.from(this.host.nativeElement.querySelectorAll<HTMLElement>('.kb-card:not(.kb-ghost)')).find(c => c.dataset['kbKey'] === key);\n }\n\n private focusNow(key: string): void { this.findCard(key)?.focus(); }\n\n /** A moved card is drawn again in its new place: put the focus back on it once it is there. */\n private focusCard(key: string): void {\n this.tabKey.set(key);\n afterNextRender(() => this.findCard(key)?.focus(), { injector: this.injector });\n }\n}\n"],"mappings":";;;;;AA0DA,IAAa,qBAAb,MAAa,mBAAkB;CAD/B,cAAA;EAGW,KAAA,WAAW,MAA6B,IAAE;GAAA,GAAA,YAAA,EAAA,WAAA,WAAA,+BAAA,CAAA;GAAI,OAAO;EAAa,CAAA;EAClE,KAAA,WAAW,OAAyC,WAAW;CAEzE;CADC,OAAO,uBAA0B,MAA6B,MAAa;EAAiC,OAAO;CAAM;CAJ9G;EAAA,KAAA,OAAA,GAAA,mBAAA;GAAA,YAAA;GAAA,SAAA;GAAA,UAAA;GAAA,MAAA;GAAkB,MAAA,CAAA;GAAA,QAAA,GAAA,gBAAA;EAAA,CAAA;CAAA;CAAlB;EAAA,KAAA,OAAA,GAAA,qBAAA;GAAA,YAAA;GAAA,SAAA;GAAA,MAAA;GAAkB,cAAA;GAAA,UAAA;GAAA,QAAA,EAAA,UAAA;IAAA,mBAAA;IAAA,YAAA;IAAA,UAAA;IAAA,YAAA;IAAA,mBAAA;GAAA,EAAA;GAAA,UAAA;EAAA,CAAA;CAAA;;AAAlB,GAAA,yBAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAAkB,YAAA,CAAA;EAD9B,MAAA;EAAU,MAAA,CAAA;GAAE,UAAU;GAA4B,YAAY;EAAI,CAAE;;;;;;;;;;;AASrE,MAAM,gBAAc;AAEpB,MAAM,cAAY;AAElB,IAAI,gBAAc;AAElB,MAAM,eAAq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A;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,UAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,UAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,gBAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,gBAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,UAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA,UAAA;EAAA,CAAA;EAAA,WAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA,WAAA;EAAA,CAAA;EAAA,YAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA,YAAA;EAAA,CAAA;EAAA,MAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA,GAAA,iBAAA,mBAAsB,GAAA,EAAA,UAAA,KAAA,CAAA;EAAA,CAAA;CAAA;AAAA,CAAA"}
1
+ {"version":3,"file":"forgeroute-ui-boards.mjs","names":[],"sources":["../../../projects/forgeroute-ui/boards/src/lib/board/board.component.ts","../../../projects/forgeroute-ui/boards/src/lib/kanban-board/kanban-geometry.ts","../../../projects/forgeroute-ui/boards/src/lib/kanban-board/kanban-board.component.ts"],"sourcesContent":["import {\n Component, ChangeDetectionStrategy, ViewEncapsulation, Directive, TemplateRef, contentChild, inject, ElementRef, input, output, signal, linkedSignal, computed, effect,\n} from '@angular/core';\nimport { NgTemplateOutlet } from '@angular/common';\nimport { RowAction } from '@forgeroute/ui/table-types';\nimport { ButtonComponent } from '@forgeroute/ui/core';\nimport { MoreMenuComponent } from '@forgeroute/ui/more-menu';\nimport { UiLabelsService } from '@forgeroute/ui/core';\n\n/** One column (stage) of a [ui-board]. `items` are the host's own records; the board never reads their fields. */\nexport interface BoardColumn<T = unknown> {\n /** Unique id of the column (the stage key); reported in `from` / `to` of a move. */\n key: string;\n /** Column title (shown uppercase). */\n label: string;\n items: T[];\n /** Dot colour: a CSS colour, or one of blue / cyan / green / teal / amber / orange / red / pink / slate / gray. */\n color?: string;\n /** Small line under the title, e.g. a pre-formatted total (\"$120,000\"). */\n summary?: string;\n /** Spoken version of `summary` (aria-label). Defaults to the summary text. */\n summaryLabel?: string;\n /** 'success' = green column and green card edge (a won / done stage). */\n tone?: 'default' | 'success';\n /** true = display-only column: items can't be dropped into it. */\n dropDisabled?: boolean;\n /** Text of the empty column; defaults to the board's `emptyColumnText`. */\n emptyText?: string;\n}\n\n/** Fired when the user moves a card to another column (drag and drop, or Shift + Arrow keys on a focused card). */\nexport interface BoardMoveEvent<T = unknown> {\n item: T;\n from: string;\n to: string;\n /** The board has ALREADY moved the card on screen. Call this if the host's save fails to put it back. */\n revert: () => void;\n}\n\nexport interface BoardCardActionEvent<T = unknown> {\n type: string;\n item: T;\n}\n\n/** Context of the card template: `<ng-template uiBoardCard let-item let-column=\"column\" let-menu=\"menu\">`. */\nexport interface BoardCardContext<T = unknown> {\n $implicit: T;\n column: BoardColumn<T>;\n /** Template of the card's \"⋮\" menu (renders nothing without `cardActions`). Output it with `{ $implicit: item }` in the card's top row. */\n menu: TemplateRef<{ $implicit: T }>;\n}\n\n/**\n * Marks the template that renders the INSIDE of a card (the board draws the card frame, menu and drag handling).\n * Bind the board's columns to type the card item: `<ng-template [uiBoardCard]=\"columns()\" let-lead>` gives `lead` the\n * columns' item type. The bare `<ng-template uiBoardCard let-item>` still works; `item` is then `unknown`.\n */\n@Directive({ selector: 'ng-template[uiBoardCard]', standalone: true })\nexport class BoardCardDirective<T = unknown> {\n /** Only used to infer the item type in the template; the value is never read. */\n readonly typeFrom = input<BoardColumn<T>[] | ''>('', { alias: 'uiBoardCard' });\n readonly template = inject<TemplateRef<BoardCardContext<T>>>(TemplateRef);\n static ngTemplateContextGuard<T>(_dir: BoardCardDirective<T>, _ctx: unknown): _ctx is BoardCardContext<T> { return true; }\n}\n\n/** Menu item types for \"Move to <column>\" (the board handles them itself; the host never sees them). */\nconst MOVE_PREFIX = 'ub-move:';\n// One arrow for every \"Move to\" item (a board can have many columns, so they cannot all differ): the group is told apart by its labels.\nconst MOVE_ICON = 'M4 12h12m0 0l-4-4m4 4l-4 4M20 5v14';\n\nlet nextBoardId = 0;\n\nconst DOT_COLORS: Record<string, string> = {\n blue: '#3b82f6', cyan: '#06b6d4', green: '#22c55e', teal: '#14b8a6', amber: '#f59e0b',\n orange: '#f97316', red: '#ef4444', pink: '#ec4899', slate: '#64748b', gray: '#6b7280',\n};\n\n/**\n * Kanban board: columns of cards that can be dragged between columns. Data and saving stay with the host.\n *\n * <ui-board [columns]=\"columns()\" [itemKey]=\"key\" [itemLabel]=\"label\" [cardActions]=\"actions\" [readOnly]=\"perm() !== 'full'\"\n * [loading]=\"loading()\" [error]=\"error()\" (retry)=\"load()\"\n * (cardClick)=\"open($event)\" (cardAction)=\"onAction($event)\" (itemMove)=\"onMove($event)\">\n * <ng-template [uiBoardCard]=\"columns()\" let-deal let-menu=\"menu\">\n * <div class=\"ub-card__top\"><span class=\"ub-card__title\">{{ deal.title }}</span>\n * <ng-container [ngTemplateOutlet]=\"menu\" [ngTemplateOutletContext]=\"{ $implicit: deal }\" /></div>\n * <div class=\"ub-card__contact\">{{ deal.contactName }}</div>\n * </ng-template>\n * </ui-board>\n *\n * - A drop moves the card on screen at once and emits `itemMove`; the host saves it and calls `event.revert()` if that fails.\n * - Keyboard: Enter / Space opens a card; Shift + ← / → moves it to the neighbouring column (announced to screen readers).\n * - `readOnly` removes dragging and keyboard moves. On phones (≤640px) the columns stack.\n */\n@Component({\n selector: 'ui-board',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n imports: [NgTemplateOutlet, ButtonComponent, MoreMenuComponent],\n template: `\n <!-- The card's \"⋮\" menu. Place it in the card's top row: <ng-container [ngTemplateOutlet]=\"menu\" [ngTemplateOutletContext]=\"{ $implicit: item }\" /> -->\n <ng-template #menuTpl let-item>\n @let actions = menuActions().get(itemKey()(item)) ?? cardActions();\n @if (actions.length) {\n <div class=\"ub-card__top-right\" (click)=\"$event.stopPropagation()\" (keydown)=\"$event.stopPropagation()\">\n <ui-more-menu [actions]=\"actions\" [ariaLabel]=\"labels.t('board.actionsFor', { name: itemLabel()(item) })\"\n (actionClick)=\"onMenuAction($event, item)\" />\n </div>\n }\n </ng-template>\n <div class=\"ub-wrap\">\n @if (loading()) {\n <div class=\"ub-skeleton\" role=\"status\" [attr.aria-label]=\"labels.t('board.loadingNamed', { name: ariaLabel() })\">\n @for (n of skeletonColumns(); track n) {\n <div class=\"ub-col-skeleton\" aria-hidden=\"true\">\n <div class=\"ub-col-skeleton__header\"></div>\n @for (c of [1, 2, 3]; track c) { <div class=\"ub-col-skeleton__card\"></div> }\n </div>\n }\n </div>\n } @else if (error()) {\n <div class=\"ub-message\" role=\"alert\">\n <p>{{ error() }}</p>\n <ui-button variant=\"secondary\" size=\"sm\" (click)=\"retry.emit()\">{{ retryLabel() }}</ui-button>\n </div>\n } @else if (cols().length === 0) {\n <div class=\"ub-message\" role=\"status\"><p>{{ emptyMessage() }}</p></div>\n } @else {\n <div class=\"ub-board\" role=\"region\" [attr.aria-label]=\"ariaLabel()\" [attr.aria-describedby]=\"canDrag() ? hintId : null\">\n @for (view of shownCols(); track view.col.key) {\n @let col = view.col;\n <div class=\"ub-col\"\n [class.ub-col--over]=\"overKey() === col.key\"\n [class.ub-col--success]=\"col.tone === 'success'\"\n role=\"group\"\n [attr.aria-label]=\"col.label + ' — ' + col.items.length + ' ' + (col.items.length === 1 ? itemNoun() : itemNounPlural())\"\n (dragover)=\"onDragOver($event, col)\"\n (dragleave)=\"onDragLeave($event, col)\"\n (drop)=\"onDrop($event, col)\">\n <div class=\"ub-col__header\">\n <div class=\"ub-col__title\">\n <span class=\"ub-col__dot\" [style.background]=\"dot(col.color)\" aria-hidden=\"true\"></span>\n <span class=\"ub-col__label\">{{ col.label }}</span>\n <span class=\"ub-col__count\" aria-hidden=\"true\">{{ col.items.length }}</span>\n </div>\n @if (col.summary) {\n <div class=\"ub-col__summary\"><span aria-hidden=\"true\">{{ col.summary }}</span><span class=\"ub-sr-only\">{{ col.summaryLabel || col.summary }}</span></div>\n }\n </div>\n <div class=\"ub-col__cards\" [attr.role]=\"col.items.length ? 'list' : null\">\n @for (item of view.shown; track itemKey()(item)) {\n @let key = itemKey()(item);\n <div class=\"ub-card\"\n [class.ub-card--success]=\"col.tone === 'success'\"\n [class.ub-card--dragging]=\"draggingKey() === key\"\n role=\"listitem\"\n tabindex=\"0\"\n [attr.data-board-key]=\"key\"\n [attr.aria-label]=\"itemLabel()(item)\"\n [attr.aria-keyshortcuts]=\"canDrag() ? 'Shift+ArrowLeft Shift+ArrowRight' : null\"\n [attr.draggable]=\"canDrag() ? 'true' : null\"\n (dragstart)=\"onDragStart($event, item, col)\"\n (dragend)=\"onDragEnd()\"\n (click)=\"cardClick.emit(item)\"\n (keydown)=\"onCardKey($event, item, col)\">\n @if (card(); as tpl) {\n <ng-container [ngTemplateOutlet]=\"tpl.template\" [ngTemplateOutletContext]=\"{ $implicit: item, column: col, menu: menuTpl }\" />\n }\n </div>\n }\n @if (view.hidden > 0) {\n <div class=\"ub-col__more\" role=\"listitem\">\n <button type=\"button\" class=\"ub-more-btn\" [attr.aria-label]=\"labels.t('board.showMore', { next: view.next, hidden: view.hidden }) + ', ' + col.label\" (click)=\"showMore(col.key)\">{{ labels.t('board.showMore', { next: view.next, hidden: view.hidden }) }}</button>\n </div>\n }\n @if (col.items.length === 0) {\n <div class=\"ub-col__empty\" role=\"status\">{{ col.emptyText || emptyColumnText() }}</div>\n }\n </div>\n </div>\n }\n </div>\n @if (canDrag()) {\n <p class=\"ub-sr-only\" [id]=\"hintId\">{{ labels.t('board.dragACardToAnother') }}</p>\n }\n <div class=\"ub-sr-only\" role=\"status\" aria-live=\"polite\">{{ announcement() }}</div>\n }\n </div>\n `,\n styles: [`\n ui-board { display: flex; flex-direction: column; flex: 1; min-height: 0; }\n .ub-wrap { flex: 1; min-height: 0; overflow: hidden; display: flex; flex-direction: column; }\n\n .ub-board { display: flex; gap: 12px; padding: 0 0 16px; overflow-x: auto; overflow-y: hidden; height: 100%; align-items: stretch; }\n .ub-board::-webkit-scrollbar { height: 6px; }\n .ub-board::-webkit-scrollbar-track { background: #f1f5f9; border-radius: 3px; }\n .ub-board::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }\n\n .ub-col { flex: 0 0 280px; min-width: 280px; max-width: 280px; display: flex; flex-direction: column; background: #f8fafc;\n border: 1.5px solid #e2e8f0; border-radius: 10px; min-height: 0; transition: border-color .15s, background .15s; }\n .ub-col--over { border-color: #3b82f6; background: #eff6ff; }\n .ub-col--success { background: #f0fdf4; border-color: #bbf7d0; }\n .ub-col--success.ub-col--over { border-color: #22c55e; background: #dcfce7; }\n\n .ub-col__header { padding: 12px 14px 10px; border-bottom: 1px solid #e2e8f0; flex-shrink: 0; }\n .ub-col__title { display: flex; align-items: center; gap: 7px; margin-bottom: 2px; }\n .ub-col__dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }\n .ub-col__label { font-size: 12px; font-weight: 700; color: #374151; text-transform: uppercase; letter-spacing: .04em; flex: 1;\n white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }\n .ub-col__count { font-size: 11px; font-weight: 600; color: #fff; background: #64748b; border-radius: 10px; padding: 1px 7px; flex-shrink: 0; }\n .ub-col__summary { font-size: 11px; color: #64748b; font-weight: 500; margin-top: 2px; }\n\n .ub-col__cards { flex: 1; overflow-y: auto; padding: 10px; display: flex; flex-direction: column; gap: 8px; min-height: 60px; }\n .ub-col__cards::-webkit-scrollbar { width: 4px; }\n .ub-col__cards::-webkit-scrollbar-track { background: transparent; }\n .ub-col__cards::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 2px; }\n .ub-col__more { flex-shrink: 0; }\n .ub-more-btn { width: 100%; padding: 8px 10px; font: inherit; font-size: 12px; font-weight: 600; color: #475569; background: #fff;\n border: 1.5px dashed #cbd5e1; border-radius: 8px; cursor: pointer; }\n .ub-more-btn:hover { background: #f1f5f9; border-color: #94a3b8; }\n .ub-more-btn:focus-visible { outline: 2px solid #3b82f6; outline-offset: 2px; }\n .ub-col__empty { text-align: center; padding: 24px 12px; color: #64748b; font-size: 12px; border: 1.5px dashed #e2e8f0; border-radius: 8px; margin: 4px 0; }\n\n .ub-card { position: relative; background: #fff; border: 1.5px solid #e2e8f0; border-radius: 8px; padding: 11px 12px; cursor: pointer;\n -webkit-user-select: none; user-select: none; transition: box-shadow .12s, border-color .12s, opacity .12s, transform .12s; }\n .ub-card[draggable='true'] { cursor: grab; }\n .ub-card[draggable='true']:active { cursor: grabbing; }\n .ub-card:hover { border-color: #94a3b8; box-shadow: 0 2px 8px rgba(0, 0, 0, .07); }\n .ub-card:focus-visible { outline: 2px solid #3b82f6; outline-offset: 2px; }\n .ub-card--dragging { opacity: .4; transform: scale(.98); box-shadow: none; }\n .ub-card--success { border-left: 3px solid #22c55e; }\n\n /* Card building blocks (the same look as the Pipeline board): use them inside the uiBoardCard template. */\n .ub-card__top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; margin-bottom: 4px; }\n .ub-card__title { font-size: 13px; font-weight: 600; color: #1e293b; line-height: 1.35; flex: 1; min-width: 0; word-break: break-word; }\n .ub-card:hover .ub-card__title { color: #2563eb; }\n .ub-card__top-right { flex-shrink: 0; margin-top: -2px; }\n .ub-card__status-row { margin-bottom: 5px; }\n .ub-card__contact { font-size: 12px; color: #475569; margin-bottom: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }\n .ub-card__property { font-size: 11px; color: #64748b; margin-bottom: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }\n .ub-card__next-step { display: flex; align-items: flex-start; gap: 4px; font-size: 11px; color: #64748b; margin-bottom: 6px; line-height: 1.4; }\n .ub-card__next-step svg { flex-shrink: 0; margin-top: 1px; color: #94a3b8; }\n .ub-card__footer { display: flex; align-items: center; justify-content: space-between; margin-top: 6px; padding-top: 6px; border-top: 1px solid #f1f5f9; }\n .ub-card__value { font-size: 12px; font-weight: 700; color: #0f172a; }\n .ub-card__activity { font-size: 11px; color: #64748b; }\n .ub-card__activity--stale { color: #b45309; font-weight: 600; }\n\n .ub-skeleton { display: flex; gap: 12px; padding-bottom: 16px; }\n .ub-col-skeleton { flex: 0 0 280px; background: #f8fafc; border: 1.5px solid #e2e8f0; border-radius: 10px; padding: 12px; display: flex; flex-direction: column; gap: 10px; }\n .ub-col-skeleton__header, .ub-col-skeleton__card { background: linear-gradient(90deg, #e2e8f0 25%, #f1f5f9 50%, #e2e8f0 75%); background-size: 200% 100%; animation: ub-shimmer 1.4s infinite; }\n .ub-col-skeleton__header { height: 32px; border-radius: 6px; }\n .ub-col-skeleton__card { height: 90px; border-radius: 8px; }\n @keyframes ub-shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }\n @media (prefers-reduced-motion: reduce) { .ub-col-skeleton__header, .ub-col-skeleton__card { animation: none; } .ub-card, .ub-col { transition: none; } .ub-card--dragging { transform: none; } }\n @media (pointer: coarse) { .ub-more-btn { min-height: 44px; } }\n\n .ub-message { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 48px; color: #64748b; font-size: 14px; text-align: center; }\n .ub-message p { margin: 0; }\n .ub-sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }\n\n @media (max-width: 640px) {\n .ub-board { flex-direction: column; overflow-x: hidden; overflow-y: auto; height: auto; align-items: stretch; }\n .ub-col { flex: none; min-width: 0; max-width: 100%; width: 100%; max-height: none; }\n .ub-skeleton { flex-direction: column; }\n .ub-col-skeleton { flex: none; width: 100%; }\n }\n `],\n})\nexport class BoardComponent<T = unknown> {\n protected readonly labels = inject(UiLabelsService);\n /** The columns in display order, each with its items. A new value replaces the board's content (and any on-screen move). */\n readonly columns = input.required<BoardColumn<T>[]>();\n /** Stable unique id of a card (used to track cards between renders, to find its menu and to move it). Must be unique across the whole board. */\n readonly itemKey = input.required<(item: T) => string>();\n /** Spoken name of a card: title, who, status, value... The card's visible content is the `uiBoardCard` template. */\n readonly itemLabel = input.required<(item: T) => string>();\n /** Menu on every card (the \"⋮\" button). Empty = no menu. Handle the pick in `(cardAction)`. */\n readonly cardActions = input<RowAction[]>([]);\n /**\n * Adds \"Move to <column>\" to every card's menu (one item per column the card may be moved to), so a card can be moved\n * without dragging - by touch, with a screen reader or with the mouse alone. Only while cards can be moved (not read-only,\n * not `moveDisabled`) and only to columns that accept the card (`canMove`, `dropDisabled`). Set false to leave the menu to `cardActions`.\n */\n readonly moveMenu = input(true);\n readonly loading = input(false);\n /** Error text: replaces the board with the message and a Retry button. */\n readonly error = input<string | null>(null);\n /** true = no dragging, no keyboard moves. */\n readonly readOnly = input(false);\n /** true = moves are paused (e.g. a save is running) so a second card can't be moved before the first is saved. */\n readonly moveDisabled = input(false);\n /** Optional rule: may this card go from this column to that one? A refused drop does nothing. */\n readonly canMove = input<((item: T, from: string, to: string) => boolean) | null>(null);\n readonly ariaLabelInput = input<string | null>(null, { alias: 'ariaLabel' });\n readonly ariaLabel = computed(() => this.ariaLabelInput() ?? this.labels.t('board.ariaLabel'));\n readonly emptyMessageInput = input<string | null>(null, { alias: 'emptyMessage' });\n readonly emptyMessage = computed(() => this.emptyMessageInput() ?? this.labels.t('board.emptyMessage'));\n readonly emptyColumnTextInput = input<string | null>(null, { alias: 'emptyColumnText' });\n readonly emptyColumnText = computed(() => this.emptyColumnTextInput() ?? this.labels.t('board.emptyColumnText'));\n /** Singular / plural noun for the column's spoken count (\"3 deals\"). */\n readonly itemNounInput = input<string | null>(null, { alias: 'itemNoun' });\n readonly itemNoun = computed(() => this.itemNounInput() ?? this.labels.t('board.itemNoun'));\n readonly itemNounPluralInput = input<string | null>(null, { alias: 'itemNounPlural' });\n readonly itemNounPlural = computed(() => this.itemNounPluralInput() ?? this.labels.t('board.itemNounPlural'));\n readonly retryLabelInput = input<string | null>(null, { alias: 'retryLabel' });\n readonly retryLabel = computed(() => this.retryLabelInput() ?? this.labels.t('board.retryLabel'));\n /**\n * Cards drawn per column at first, and added by each \"Show more\" click (0 = draw every card). The board loads every item\n * at once, so drawing only a page of each column keeps the first paint fast however many items there are. Column counts\n * and summaries still cover every item; a card moved into a column is drawn at its top, so it is always on screen.\n */\n readonly pageSize = input(50);\n\n readonly cardClick = output<T>();\n readonly cardAction = output<BoardCardActionEvent<T>>();\n readonly itemMove = output<BoardMoveEvent<T>>();\n readonly retry = output<void>();\n\n protected readonly card = contentChild(BoardCardDirective<T>);\n\n /** The columns as shown: the host's value, plus any move not yet replaced by new data. */\n protected readonly cols = linkedSignal(() => this.columns());\n /** Cards drawn per column. Kept when the host re-sends columns (a saved move, a search), so the board never jumps back; back to the first page on a reload (`loading`). */\n private readonly drawn = signal<Record<string, number>>({});\n /** The card the user last moved and where it went: it stays drawn even if the host re-sends it far down the column. */\n private readonly movedTo = signal<{ key: string; to: string } | null>(null);\n protected readonly shownCols = computed(() => {\n const size = this.pageSize() > 0 ? Math.floor(this.pageSize()) : 0;\n return this.cols().map(col => {\n const limit = this.limitOf(col);\n const hidden = Math.max(0, col.items.length - limit);\n return { col, shown: hidden ? col.items.slice(0, limit) : col.items, hidden, next: Math.min(size, hidden) };\n });\n });\n /** How many cards of `col` are drawn: the pages shown so far, extended so the card the user moved is always on screen. */\n private limitOf(col: BoardColumn<T>): number {\n const size = this.pageSize() > 0 ? Math.floor(this.pageSize()) : 0;\n if (!size) return col.items.length;\n let limit = this.drawn()[col.key] ?? size;\n const moved = this.movedTo();\n if (moved?.to === col.key) limit = Math.max(limit, col.items.findIndex(i => this.itemKey()(i) === moved.key) + 1);\n return limit;\n }\n protected showMore(key: string): void {\n const size = Math.floor(this.pageSize());\n const col = this.cols().find(c => c.key === key);\n if (!col || size < 1) return;\n const limit = Math.min(col.items.length, this.limitOf(col) + size);\n this.drawn.update(d => ({ ...d, [key]: limit }));\n this.announcement.set(this.labels.t('board.showingOf', { limit, total: col.items.length, noun: this.itemNounPlural(), column: col.label }));\n }\n /** Id of the keyboard-move hint that describes the board region. */\n protected readonly hintId = `ub-hint-${nextBoardId++}`;\n protected readonly overKey = signal<string | null>(null);\n protected readonly draggingKey = signal<string | null>(null);\n protected readonly announcement = signal('');\n\n private readonly host = inject<ElementRef<HTMLElement>>(ElementRef);\n\n constructor() {\n effect(() => { if (this.loading()) { this.drawn.set({}); this.movedTo.set(null); } });\n }\n private drag: { item: T; from: string } | null = null;\n\n protected readonly skeletonColumns = computed(() => Array.from({ length: Math.max(this.columns().length, 4) }, (_, i) => i));\n protected readonly canDrag = computed(() => !this.readOnly() && !this.moveDisabled());\n\n protected dot(color?: string): string { return (color && DOT_COLORS[color]) || color || '#3b82f6'; }\n\n // ─── Drag & drop ───────────────────────────────────────────\n\n protected onDragStart(event: DragEvent, item: T, col: BoardColumn<T>): void {\n if (!this.canDrag()) { event.preventDefault(); return; }\n this.drag = { item, from: col.key };\n this.draggingKey.set(this.itemKey()(item));\n if (event.dataTransfer) {\n event.dataTransfer.effectAllowed = 'move';\n event.dataTransfer.setData('text/plain', this.itemKey()(item)); // Firefox needs data to start a drag\n }\n }\n\n protected onDragEnd(): void {\n this.drag = null;\n this.draggingKey.set(null);\n this.overKey.set(null);\n }\n\n protected onDragOver(event: DragEvent, col: BoardColumn<T>): void {\n if (!this.drag || !this.accepts(this.drag.item, this.drag.from, col)) {\n if (event.dataTransfer) event.dataTransfer.dropEffect = 'none';\n return;\n }\n event.preventDefault();\n if (event.dataTransfer) event.dataTransfer.dropEffect = 'move';\n if (this.overKey() !== col.key) this.overKey.set(col.key);\n }\n\n protected onDragLeave(event: DragEvent, col: BoardColumn<T>): void {\n const related = event.relatedTarget as Node | null;\n if ((!related || !(event.currentTarget as HTMLElement).contains(related)) && this.overKey() === col.key) this.overKey.set(null);\n }\n\n protected onDrop(event: DragEvent, col: BoardColumn<T>): void {\n event.preventDefault();\n const drag = this.drag;\n this.onDragEnd();\n if (drag && this.accepts(drag.item, drag.from, col)) this.move(drag.item, drag.from, col.key);\n }\n\n // ─── Keyboard ──────────────────────────────────────────────\n\n protected onCardKey(event: KeyboardEvent, item: T, col: BoardColumn<T>): void {\n if (event.target !== event.currentTarget) return; // keys inside the card's own controls (the menu) are theirs\n if (event.key === 'Enter' || event.key === ' ') {\n event.preventDefault();\n this.cardClick.emit(item);\n return;\n }\n if (!event.shiftKey || (event.key !== 'ArrowLeft' && event.key !== 'ArrowRight')) return;\n event.preventDefault();\n if (!this.canDrag()) return;\n const cols = this.cols();\n const step = event.key === 'ArrowRight' ? 1 : -1;\n for (let i = cols.findIndex(c => c.key === col.key) + step; i >= 0 && i < cols.length; i += step) {\n if (this.accepts(item, col.key, cols[i])) {\n this.move(item, col.key, cols[i].key);\n this.announcement.set(this.labels.t('board.movedTo', { item: this.itemLabel()(item), column: cols[i].label }));\n this.focusCard(item);\n return;\n }\n }\n }\n\n // ─── Card menu ─────────────────────────────────────────────\n\n /** The menu of each card by item key: the host's `cardActions`, then \"Move to <column>\" for each column that accepts the card (one shared array per column when the host has no `canMove` rule). */\n protected readonly menuActions = computed(() => {\n const out = new Map<string, RowAction[]>();\n const own = this.cardActions();\n if (!this.moveMenu() || !this.canDrag()) return out;\n const cols = this.cols();\n const shared = new Map<string, RowAction[]>(); // without a canMove rule the targets only depend on the column\n for (const from of cols) {\n for (const item of from.items) {\n let list = this.canMove() ? undefined : shared.get(from.key);\n if (!list) {\n const moves = cols.filter(to => this.accepts(item, from.key, to)).map(to => ({ type: MOVE_PREFIX + to.key, label: this.labels.t('board.moveTo', { column: to.label }), icon: MOVE_ICON }));\n list = moves.length ? [...own, ...moves] : own;\n if (!this.canMove()) shared.set(from.key, list);\n }\n out.set(this.itemKey()(item), list);\n }\n }\n return out;\n });\n\n protected onMenuAction(type: string, item: T): void {\n if (!type.startsWith(MOVE_PREFIX)) { this.cardAction.emit({ type, item }); return; }\n const key = this.itemKey()(item);\n const from = this.cols().find(c => c.items.some(i => this.itemKey()(i) === key));\n const to = this.cols().find(c => c.key === type.slice(MOVE_PREFIX.length));\n if (!from || !to || !this.accepts(item, from.key, to)) return;\n this.move(item, from.key, to.key);\n this.announcement.set(this.labels.t('board.movedTo', { item: this.itemLabel()(item), column: to.label }));\n this.focusCard(item);\n }\n\n /** The card is re-created in its new column: put the focus back on it once it is drawn. */\n private focusCard(item: T): void {\n const key = this.itemKey()(item);\n setTimeout(() => {\n const cards = this.host.nativeElement.querySelectorAll<HTMLElement>('.ub-card');\n Array.from(cards).find(c => c.dataset['boardKey'] === key)?.focus();\n });\n }\n\n // ─── Moving ────────────────────────────────────────────────\n\n private accepts(item: T, from: string, to: BoardColumn<T>): boolean {\n if (from === to.key || to.dropDisabled || this.moveDisabled() || this.readOnly()) return false;\n const rule = this.canMove();\n return !rule || rule(item, from, to.key);\n }\n\n private move(item: T, from: string, to: string): void {\n const before = this.cols();\n const key = this.itemKey()(item);\n this.cols.set(before.map(c => {\n if (c.key === from) return { ...c, items: c.items.filter(i => this.itemKey()(i) !== key) };\n if (c.key === to) return { ...c, items: [item, ...c.items] };\n return c;\n }));\n this.movedTo.set({ key, to });\n this.itemMove.emit({ item, from, to, revert: () => { this.cols.set(before); this.movedTo.set(null); } });\n }\n}\n","/** The screen box of one column (viewport coordinates, like `getBoundingClientRect()`). */\nexport interface KanbanColumnRect { key: string; left: number; right: number; top: number; bottom: number }\n\n/** The column whose box holds the point (edges count), or null when the point is over none of them. The first match wins. */\nexport function columnAtPoint(rects: readonly KanbanColumnRect[], x: number, y: number): string | null {\n for (const r of rects) if (x >= r.left && x <= r.right && y >= r.top && y <= r.bottom) return r.key;\n return null;\n}\n\n/**\n * Where a dragged card lands in a column: the number of cards (the dragged one excluded) whose vertical middle is above the pointer. `middles` are the\n * middles of the column's cards from top to bottom, so the result is the final index of the dragged card in that column (0 = first, length = last).\n */\nexport function dropIndexAt(middles: readonly number[], y: number): number {\n let index = 0;\n for (const m of middles) if (m < y) index++;\n return index;\n}\n\n/**\n * How far to scroll per frame while dragging near an edge of a scroll area: negative near the start edge, positive near the end edge, 0 elsewhere.\n * The speed grows from 0 at `edge` px from the border to `maxSpeed` at (or beyond) the border.\n */\nexport function autoScrollDelta(pos: number, start: number, end: number, edge = 48, maxSpeed = 18): number {\n if (end - start <= 0) return 0;\n const zone = Math.min(edge, (end - start) / 2);\n if (pos < start + zone) return -Math.round(maxSpeed * Math.min(1, (start + zone - pos) / zone));\n if (pos > end - zone) return Math.round(maxSpeed * Math.min(1, (pos - (end - zone)) / zone));\n return 0;\n}\n\nexport function clamp(n: number, min: number, max: number): number {\n return Math.min(max, Math.max(min, n));\n}\n","import {\n ChangeDetectionStrategy, Component, DestroyRef, Directive, ElementRef, Injector, NgZone, TemplateRef, afterNextRender, computed, contentChild, inject,\n input, linkedSignal, output, signal, untracked, effect,\n} from '@angular/core';\nimport { DOCUMENT, NgTemplateOutlet } from '@angular/common';\nimport { RowAction } from '@forgeroute/ui/table-types';\nimport { ButtonComponent } from '@forgeroute/ui/core';\nimport { MoreMenuComponent } from '@forgeroute/ui/more-menu';\nimport { UiLabelsService } from '@forgeroute/ui/core';\nimport { autoScrollDelta, clamp, columnAtPoint, dropIndexAt } from './kanban-geometry';\n\n/** One column (stage) of a [ui-kanban-board]. */\nexport interface KanbanColumn {\n /** Unique id of the column; what `columnFn` returns for the cards that belong to it, and `fromColumn` / `toColumn` of a move. */\n key: string;\n /** Column title. */\n label: string;\n /** Dot colour: a CSS colour or one of blue / cyan / green / teal / amber / orange / red / pink / slate / gray. */\n color?: string;\n /** Chance (0 to 100) that a card in this stage closes, shown as a chip next to the count (\"60%\"). */\n probability?: number;\n /** Pre-formatted value shown at the foot of the column, e.g. a weighted total (\"$1.2M weighted\"). */\n footer?: string;\n /** Spoken version of `footer`. Defaults to the footer text. */\n footerLabel?: string;\n /** Text of the empty column; defaults to the board's `emptyText`. */\n emptyText?: string;\n /** true = cards can be dragged out of this column but never dropped into it. */\n disabled?: boolean;\n /**\n * Cards of this column the host has NOT loaded into `items` yet (server-side paging of a long column). They are added to the count chip and the spoken count, and once\n * every loaded card is drawn the column offers a \"Show more\" button that emits `columnMore` so the host can load the next page. A card the user moves out of or into the column\n * changes the count by itself (only the loaded cards move), so the host keeps `remaining` = server total minus the loaded cards of the column.\n */\n remaining?: number;\n /** true while the host loads the next page of this column (the \"Show more\" button shows its spinner and ignores clicks). */\n loadingMore?: boolean;\n /** How many cards the host's next page adds, for the \"Show N more\" label (never more than `remaining`). Default: the board's `pageSize`, or all `remaining` cards when the board draws everything (pageSize 0). */\n nextCount?: number;\n}\n\n/** Fired when the user drops a card somewhere new (drag, keyboard or the \"Move to\" menu). The board has ALREADY moved the card on screen. */\nexport interface KanbanMove<T = unknown> {\n /** Unique per move; `revert(move)` uses it. */\n id: number;\n item: T;\n fromColumn: string;\n toColumn: string;\n /** Position (0-based) in the column the card came from. */\n fromIndex: number;\n /** Final position (0-based) in the column it went to. */\n toIndex: number;\n /** Same as `board.revert(move)`: call it when the host's save failed to put the card back where it was. */\n revert: () => void;\n}\n\n/** Context of the card template: `<ng-template [uiKanbanCard]=\"items()\" let-deal let-column=\"column\">`. */\nexport interface KanbanCardContext<T = unknown> {\n $implicit: T;\n column: KanbanColumn;\n /** Position of the card in its column (0-based). */\n index: number;\n}\n\n/**\n * Marks the template that renders the INSIDE of a card (the board draws the frame, the grip, the \"Move to\" menu and the drag handling).\n * Bind the board's items to type the card: `<ng-template [uiKanbanCard]=\"items()\" let-deal>`; the bare `<ng-template uiKanbanCard let-item>` still works\n * (`item` is then `unknown`).\n */\n@Directive({ selector: 'ng-template[uiKanbanCard]', standalone: true })\nexport class KanbanCardDirective<T = unknown> {\n /** Only used to infer the item type in the template; the value is never read. */\n readonly typeFrom = input<readonly T[] | ''>('', { alias: 'uiKanbanCard' });\n readonly template = inject<TemplateRef<KanbanCardContext<T>>>(TemplateRef);\n static ngTemplateContextGuard<T>(_dir: KanbanCardDirective<T>, _ctx: unknown): _ctx is KanbanCardContext<T> { return true; }\n}\n\n/** Where a card is while it is being moved: the column and the final position it would have if dropped now. */\ninterface MoveSession<T> {\n mode: 'keyboard' | 'pointer';\n item: T;\n key: string;\n fromCol: string;\n fromIndex: number;\n /** Target column, or null while the pointer is over none. */\n col: string | null;\n /** Final index in the target column (the dragged card excluded from the count). */\n index: number;\n}\n\ninterface PointerDrag<T> {\n id: number;\n startX: number;\n startY: number;\n x: number;\n y: number;\n item: T;\n key: string;\n col: string;\n index: number;\n el: HTMLElement;\n ghost: HTMLElement | null;\n offX: number;\n offY: number;\n started: boolean;\n raf: number;\n}\n\nconst MOVE_PREFIX = 'kb-move:';\n/** One arrow for every \"Move to\" item: the items are told apart by their labels. */\nconst MOVE_ICON = 'M4 12h12m0 0l-4-4m4 4l-4 4M20 5v14';\n/** Pixels the pointer must travel before a press becomes a drag (a click that wobbles a little stays a click). */\nconst DRAG_THRESHOLD_PX = 5;\n\nconst DOT_COLORS: Record<string, string> = {\n blue: '#3b82f6', cyan: '#06b6d4', green: '#22c55e', teal: '#14b8a6', amber: '#f59e0b',\n orange: '#f97316', red: '#ef4444', pink: '#ec4899', slate: '#64748b', gray: '#6b7280',\n};\n\nlet nextBoardId = 0;\n\n/**\n * Kanban board with positional drag and drop: columns of cards that can be moved between and within columns. Data and saving stay with the host.\n *\n * <ui-kanban-board [columns]=\"columns()\" [items]=\"deals()\" [columnFn]=\"stageOf\" [cardId]=\"idOf\" [cardLabel]=\"nameOf\"\n * [canDrop]=\"canDrop\" [readOnly]=\"perm() !== 'full'\" [disabled]=\"saving()\" [loading]=\"loading()\"\n * (cardMove)=\"save($event)\" (cardClick)=\"open($event)\">\n * <ng-template [uiKanbanCard]=\"deals()\" let-deal let-column=\"column\"> ...card content... </ng-template>\n * </ui-kanban-board>\n *\n * - A drop moves the card on screen at once and emits `cardMove`; the host saves it and calls `board.revert(move)` (or `move.revert()`) if that fails.\n * - Pointer: drag a card (the mouse anywhere on it, touch from its grip). Keyboard: focus a card, Space picks it up, the arrow keys move it\n * (left / right = column, up / down = position), Space or Enter drops it, Escape cancels; every step is announced in a polite live region\n * (\"Moved Oak Plaza to Negotiation, position 2 of 5\"). Enter on a card that is not picked up emits `cardClick`. Arrow keys on a card that is\n * not picked up move the focus between cards.\n * - Touch-safe alternative: every card has a \"Move to\" menu (`moveMenu`), which also serves screen readers and mouse users who do not drag.\n * - `canDrop(item, fromColumn, toColumn)` forbids moves the backend would refuse: blocked columns are marked while a card is held (a visible\n * \"Not allowed\" badge, `aria-disabled`, announced), the drop is refused and the \"Move to\" menu leaves them out.\n * - `readOnly` removes the grips, the menu and every move; `disabled` pauses moves (e.g. while a save runs) and marks the board busy.\n * - On phones (<=640px) the columns scroll sideways with snap points.\n */\n@Component({\n selector: 'ui-kanban-board',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [NgTemplateOutlet, ButtonComponent, MoreMenuComponent],\n template: `\n <div class=\"kb-wrap\">\n @if (loading()) {\n <div class=\"kb-skeleton\" role=\"status\" [attr.aria-label]=\"labels.t('kanban.loading', { name: ariaLabel() })\">\n @for (n of skeletonColumns(); track n) {\n <div class=\"kb-col-skeleton\" aria-hidden=\"true\">\n <div class=\"kb-col-skeleton__header\"></div>\n @for (c of [1, 2, 3]; track c) { <div class=\"kb-col-skeleton__card\"></div> }\n </div>\n }\n </div>\n } @else {\n <div class=\"kb-board\" role=\"region\" [attr.aria-label]=\"ariaLabel()\" [attr.aria-describedby]=\"canDrag() ? hintId : null\"\n [attr.aria-busy]=\"disabled() ? 'true' : null\" [class.kb-board--dragging]=\"pointerDragging()\">\n @for (view of views(); track view.col.key) {\n @let col = view.col;\n <div class=\"kb-col\"\n role=\"group\"\n [class.kb-col--target]=\"isTarget(col.key)\"\n [class.kb-col--blocked]=\"isBlocked(col.key)\"\n [attr.data-kb-col]=\"col.key\"\n [attr.aria-disabled]=\"isBlocked(col.key) ? 'true' : null\"\n [attr.aria-label]=\"columnLabel(col, view.count)\">\n <div class=\"kb-col__header\">\n <span class=\"kb-col__dot\" [style.background]=\"dot(col.color)\" aria-hidden=\"true\"></span>\n <span class=\"kb-col__title\">{{ col.label }}</span>\n @if (col.probability !== undefined && col.probability !== null) {\n <span class=\"kb-col__prob\" aria-hidden=\"true\">{{ percent(col.probability) }}</span>\n <span class=\"kb-sr\">{{ labels.t('kanban.probability', { percent: percent(col.probability) }) }}</span>\n }\n <span class=\"kb-col__count\" aria-hidden=\"true\">{{ view.count }}</span>\n @if (isBlocked(col.key)) { <span class=\"kb-col__blocked\">{{ labels.t('kanban.blocked') }}</span> }\n </div>\n <div class=\"kb-col__cards\" [attr.role]=\"view.list.length || view.remaining > 0 ? 'list' : null\">\n @for (item of view.shown; track cardId()(item); let i = $index) {\n @let key = cardId()(item);\n @if (slotBefore(col.key, key)) { <div class=\"kb-slot\" aria-hidden=\"true\"></div> }\n <div class=\"kb-card\"\n role=\"listitem\"\n [class.kb-card--lifted]=\"liftedKey() === key\"\n [class.kb-card--movable]=\"canDrag()\"\n [attr.data-kb-key]=\"key\"\n [attr.tabindex]=\"key === tabbableKey() ? 0 : -1\"\n [attr.aria-label]=\"cardLabel()(item)\"\n [attr.aria-keyshortcuts]=\"canDrag() ? pickUpKeys : null\"\n (focus)=\"tabKey.set(key)\"\n (focusout)=\"onCardFocusOut($event, key)\"\n (keydown)=\"onCardKey($event, item, col, i)\"\n (click)=\"onCardClick(item)\"\n (dragstart)=\"$event.preventDefault()\"\n (pointerdown)=\"onPointerDown($event, item, col.key, i)\">\n @if (canDrag()) {\n <span class=\"kb-handle\" aria-hidden=\"true\">\n <svg width=\"12\" height=\"16\" viewBox=\"0 0 12 16\" fill=\"currentColor\" focusable=\"false\"><circle cx=\"3\" cy=\"3\" r=\"1.4\"/><circle cx=\"9\" cy=\"3\" r=\"1.4\"/><circle cx=\"3\" cy=\"8\" r=\"1.4\"/><circle cx=\"9\" cy=\"8\" r=\"1.4\"/><circle cx=\"3\" cy=\"13\" r=\"1.4\"/><circle cx=\"9\" cy=\"13\" r=\"1.4\"/></svg>\n </span>\n }\n <div class=\"kb-card__body\">\n @if (card(); as tpl) {\n <ng-container [ngTemplateOutlet]=\"tpl.template\" [ngTemplateOutletContext]=\"{ $implicit: item, column: col, index: i }\" />\n }\n </div>\n @if (canDrag() && moveMenu()) {\n @let actions = moveActions(item, col.key);\n @if (actions.length) {\n <div class=\"kb-card__menu\" (click)=\"$event.stopPropagation()\" (keydown)=\"$event.stopPropagation()\" (pointerdown)=\"$event.stopPropagation()\">\n <ui-more-menu [actions]=\"actions\" [ariaLabel]=\"labels.t('kanban.moveMenu', { name: cardLabel()(item) })\"\n (actionClick)=\"onMenuAction($event, item, col.key)\" />\n </div>\n }\n }\n </div>\n }\n @if (slotBefore(col.key, null)) { <div class=\"kb-slot\" aria-hidden=\"true\"></div> }\n @if (view.hidden > 0) {\n <div class=\"kb-more\" role=\"listitem\">\n <ui-button variant=\"secondary\" size=\"sm\" [fullWidth]=\"true\" (click)=\"showMore(col.key)\"\n [ariaLabel]=\"labels.t('kanban.showMore', { next: view.next, hidden: view.hidden }) + ', ' + col.label\">{{ labels.t('kanban.showMore', { next: view.next, hidden: view.hidden }) }}</ui-button>\n </div>\n }\n @if (view.hidden === 0 && view.remaining > 0) {\n <div class=\"kb-more kb-more--server\" role=\"listitem\">\n <ui-button variant=\"secondary\" size=\"sm\" [fullWidth]=\"true\" [loading]=\"!!col.loadingMore\" (click)=\"loadMore(col)\"\n [ariaLabel]=\"labels.t('kanban.showMore', { next: view.nextRemote, hidden: view.remaining }) + ', ' + col.label\">{{ labels.t('kanban.showMore', { next: view.nextRemote, hidden: view.remaining }) }}</ui-button>\n </div>\n }\n @if (view.list.length === 0 && view.remaining === 0 && !slotBefore(col.key, null)) {\n <div class=\"kb-col__empty\" role=\"status\">{{ col.emptyText || emptyText() }}</div>\n }\n </div>\n @if (col.footer) {\n <div class=\"kb-col__footer\"><span aria-hidden=\"true\">{{ col.footer }}</span><span class=\"kb-sr\">{{ col.footerLabel || col.footer }}</span></div>\n }\n </div>\n }\n </div>\n @if (canDrag()) { <p class=\"kb-sr\" [id]=\"hintId\">{{ labels.t('kanban.hint') }}</p> }\n <div class=\"kb-sr\" role=\"status\" aria-live=\"polite\" aria-atomic=\"true\">{{ announcement() }}</div>\n }\n </div>\n `,\n styles: [`\n /* min-width: 0 keeps the board as wide as its parent (a row-flex parent would otherwise grow it to its content's 4 x 283 px and the board would never scroll) */\n :host { display: flex; flex-direction: column; flex: 1; min-height: 0; min-width: 0; max-width: 100%; }\n .kb-wrap { flex: 1; min-height: 0; min-width: 0; display: flex; flex-direction: column; position: relative; }\n .kb-sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }\n\n .kb-board { display: flex; align-items: stretch; gap: 12px; flex: 1; min-height: 0; padding: 0 0 16px; overflow-x: auto; overflow-y: hidden;\n -webkit-overflow-scrolling: touch; scroll-snap-type: x proximity; }\n /* While a card is dragged the board scrolls by itself near its edges: snap points would pull every step back, so they are off until the drop. */\n .kb-board.kb-board--dragging { scroll-snap-type: none; }\n .kb-col { flex: 0 0 280px; width: 280px; display: flex; flex-direction: column; min-height: 0; background: #f8fafc; border: 1.5px solid #e2e8f0;\n border-radius: 10px; scroll-snap-align: start; transition: border-color .15s, background-color .15s; }\n .kb-col--target { border-color: #2563eb; background: #eff6ff; }\n .kb-col--blocked { border-style: dashed; border-color: #b91c1c; background: #fef2f2; }\n\n .kb-col__header { display: flex; align-items: center; gap: 7px; padding: 12px 14px 10px; border-bottom: 1px solid #e2e8f0; flex-shrink: 0; min-width: 0; }\n .kb-col__dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }\n .kb-col__title { flex: 1; min-width: 0; font-size: 12px; font-weight: 700; color: #374151; text-transform: uppercase; letter-spacing: .04em;\n white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }\n .kb-col__prob { font-size: 11px; font-weight: 600; color: #1e293b; background: #e2e8f0; border-radius: 10px; padding: 1px 7px; flex-shrink: 0; }\n .kb-col__count { font-size: 11px; font-weight: 600; color: #fff; background: #475569; border-radius: 10px; padding: 1px 7px; flex-shrink: 0; }\n .kb-col__blocked { font-size: 11px; font-weight: 700; color: #991b1b; flex-shrink: 0; }\n .kb-col__footer { padding: 8px 14px; border-top: 1px solid #e2e8f0; font-size: 12px; font-weight: 600; color: #334155; flex-shrink: 0; }\n\n .kb-col__cards { flex: 1; min-height: 60px; overflow-y: auto; padding: 10px; display: flex; flex-direction: column; gap: 8px; }\n .kb-col__empty { text-align: center; padding: 24px 12px; color: #475569; font-size: 12px; border: 1.5px dashed #cbd5e1; border-radius: 8px; }\n .kb-more { flex-shrink: 0; }\n .kb-slot { flex-shrink: 0; height: 56px; border: 2px dashed #2563eb; border-radius: 8px; background: #dbeafe; }\n\n .kb-card { position: relative; background: #fff; border: 1.5px solid #e2e8f0; border-radius: 8px; padding: 10px 36px 10px 12px; cursor: pointer;\n -webkit-user-select: none; user-select: none; transition: box-shadow .12s, border-color .12s, opacity .12s; }\n .kb-card--movable { padding-left: 26px; cursor: grab; }\n .kb-card:hover { border-color: #94a3b8; box-shadow: 0 2px 8px rgba(0, 0, 0, .07); }\n .kb-card:focus-visible { outline: 2px solid var(--ui-focus, #3b82f6); outline-offset: 2px; }\n .kb-card--lifted { opacity: .45; border-style: dashed; }\n .kb-card__body { min-width: 0; }\n .kb-card__menu { position: absolute; top: 4px; right: 4px; }\n /* The grip: the only place a finger can start a drag (so a swipe over a card still scrolls the board). */\n .kb-handle { position: absolute; left: 4px; top: 50%; transform: translateY(-50%); width: 18px; height: 28px; display: flex; align-items: center; justify-content: center;\n color: #64748b; touch-action: none; cursor: grab; }\n .kb-handle::after { content: ''; position: absolute; inset: -8px -6px; }\n .kb-ghost { position: fixed; left: 0; top: 0; margin: 0; z-index: 1000; pointer-events: none; opacity: .95; box-shadow: 0 10px 24px rgba(15, 23, 42, .28);\n transition: none; cursor: grabbing; }\n\n .kb-skeleton { display: flex; gap: 12px; padding-bottom: 16px; }\n .kb-col-skeleton { flex: 0 0 280px; background: #f8fafc; border: 1.5px solid #e2e8f0; border-radius: 10px; padding: 12px; display: flex; flex-direction: column; gap: 10px; }\n .kb-col-skeleton__header, .kb-col-skeleton__card { background: linear-gradient(90deg, #e2e8f0 25%, #f1f5f9 50%, #e2e8f0 75%); background-size: 200% 100%; animation: kb-shimmer 1.4s infinite; }\n .kb-col-skeleton__header { height: 32px; border-radius: 6px; }\n .kb-col-skeleton__card { height: 90px; border-radius: 8px; }\n @keyframes kb-shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }\n\n @media (prefers-reduced-motion: reduce) {\n .kb-col-skeleton__header, .kb-col-skeleton__card { animation: none; }\n .kb-card, .kb-col { transition: none; }\n .kb-board { scroll-behavior: auto; }\n }\n @media (forced-colors: active) {\n .kb-card, .kb-col { border: 1px solid CanvasText; }\n .kb-col--target { outline: 3px solid Highlight; outline-offset: -3px; }\n .kb-col--blocked { border-style: dashed; outline: 3px dashed CanvasText; outline-offset: -3px; }\n .kb-card:focus-visible { outline: 3px solid Highlight; }\n .kb-slot { border: 2px dashed Highlight; background: Canvas; }\n .kb-card--lifted { border-style: dashed; opacity: 1; }\n .kb-col__count, .kb-col__prob { border: 1px solid CanvasText; background: Canvas; color: CanvasText; }\n }\n @media (pointer: coarse) {\n .kb-handle { width: 32px; height: 44px; left: 0; }\n .kb-card--movable { padding-left: 36px; }\n .kb-card__menu { top: 0; right: 0; }\n }\n @media (max-width: 640px) {\n .kb-board { scroll-snap-type: x mandatory; scroll-padding: 0 12px; padding-left: 12px; padding-right: 12px; }\n .kb-board.kb-board--dragging { scroll-snap-type: none; }\n .kb-col { flex: 0 0 85%; width: 85%; }\n .kb-col-skeleton { flex: 0 0 85%; }\n }\n `],\n})\nexport class KanbanBoardComponent<T = unknown> {\n protected readonly labels = inject(UiLabelsService);\n private readonly host = inject<ElementRef<HTMLElement>>(ElementRef);\n private readonly doc = inject(DOCUMENT);\n private readonly injector = inject(Injector);\n private readonly zone = inject(NgZone);\n\n /** The columns in display order. */\n readonly columns = input.required<readonly KanbanColumn[]>();\n /** Every card of the board, in the order they should appear inside their column. Cards whose column is not in `columns` are not shown. */\n readonly items = input.required<readonly T[]>();\n /** The column key a card belongs to. */\n readonly columnFn = input.required<(item: T) => string>();\n /** Stable unique id of a card (tracks it between renders and finds it for focus and revert). Unique across the whole board. */\n readonly cardId = input.required<(item: T) => string>();\n /** Spoken name of a card (\"Oak Plaza, $1.2M\"): its accessible name and what the announcements say. The visible content is the `uiKanbanCard` template. */\n readonly cardLabel = input.required<(item: T) => string>();\n /** Rule for moves between columns: may this card go from this column to that one? Refused targets are marked, announced and left out of the menu. Not called for a move inside one column. */\n readonly canDrop = input<((item: T, fromColumn: string, toColumn: string) => boolean) | null>(null);\n /** false = cards can only change column, never position inside one (use it for a board the host sorts itself, e.g. by value). */\n readonly reorderable = input(true);\n /** Adds the \"Move to <column>\" menu to every card: the touch-, screen-reader- and mouse-friendly alternative to dragging. */\n readonly moveMenu = input(true);\n readonly loading = input(false);\n /** true = no grips, no menu, no drag, no keyboard moves (a read-only user). Cards still open. */\n readonly readOnly = input(false);\n /** true = moves are paused (a save is running): like `readOnly` (no grips, no menu, a drag in progress is cancelled) and the board is marked busy. */\n readonly disabled = input(false);\n /** Cards drawn per column at first and added by each \"Show more\" (0 = all). Counts and footers always cover every card. */\n readonly pageSize = input(50);\n readonly ariaLabelInput = input<string | null>(null, { alias: 'ariaLabel' });\n protected readonly ariaLabel = computed(() => this.ariaLabelInput() ?? this.labels.t('kanban.ariaLabel'));\n readonly emptyTextInput = input<string | null>(null, { alias: 'emptyText' });\n protected readonly emptyText = computed(() => this.emptyTextInput() ?? this.labels.t('kanban.emptyColumnText'));\n\n /** A card was dropped somewhere new. */\n readonly cardMove = output<KanbanMove<T>>();\n /** A card was clicked, or Enter was pressed on it. */\n readonly cardClick = output<T>();\n /** The \"Show more\" button of a column that has `remaining` unloaded cards was pressed: the host loads the next page of that column (the payload is the column key). */\n readonly columnMore = output<string>();\n\n protected readonly card = contentChild(KanbanCardDirective<T>);\n\n protected readonly hintId = `kb-hint-${nextBoardId++}`;\n /** `aria-keyshortcuts` of a movable card: the key that picks it up. */\n protected readonly pickUpKeys = 'Space';\n protected readonly announcement = signal('');\n protected readonly tabKey = signal<string | null>(null);\n protected readonly canDrag = computed(() => !this.readOnly() && !this.disabled());\n protected readonly skeletonColumns = computed(() => Array.from({ length: Math.max(this.columns().length, 4) }, (_, i) => i));\n\n /** The cards of every column in display order: the host's items, plus any move not yet replaced by new items. */\n private readonly layout = linkedSignal<Map<string, T[]>>(() => this.group(this.items(), this.columnKeys(), this.columnFn()));\n /** The column keys in order. A host that re-sends `columns` with new footers or counts must not reset a move that is still being saved, so the layout depends on the keys only. */\n private readonly columnKeys = computed(() => this.columns().map(c => c.key).join('\\u0000'), { equal: (a, b) => a === b });\n private readonly session = signal<MoveSession<T> | null>(null);\n private readonly drawn = signal<Record<string, number>>({});\n /** The key of the last moved card: whichever column it is in draws at least up to it, so a card dropped deep in a long column stays on screen (until the next move starts). */\n private readonly movedKey = signal<string | null>(null);\n private readonly history = new Map<number, { key: string; fromCol: string; fromIndex: number }>();\n private moveSeq = 0;\n private pointer: PointerDrag<T> | null = null;\n private suppressClick = false;\n\n protected readonly liftedKey = computed(() => this.session()?.key ?? null);\n protected readonly pointerDragging = computed(() => this.session()?.mode === 'pointer');\n\n /**\n * What each column draws. A column draws its first `pageSize` cards (\"Show more\" adds more) PLUS whatever must be on screen: the card that was last moved\n * (wherever the host put it), the card being moved in its own column, and - while a card is held with the keyboard - the whole of its own column and of the target\n * column (so End, the slot and the announcement are exact; this is bounded by the size of one column). A pointer drag never widens a column: the drop position\n * is counted among the cards drawn, so hovering a 600-card column does not render 600 cards.\n */\n protected readonly views = computed(() => {\n const size = this.pageSize() > 0 ? Math.floor(this.pageSize()) : 0;\n const session = this.session();\n const held = session?.mode === 'keyboard' ? session : null;\n const movedKey = this.movedKey();\n return this.columns().map(col => {\n const list = this.layout().get(col.key) ?? [];\n const whole = !size || (held !== null && (held.fromCol === col.key || held.col === col.key));\n let limit = whole ? list.length : Math.min(list.length, this.drawn()[col.key] ?? size);\n if (!whole) {\n if (session && session.fromCol === col.key) limit = Math.max(limit, Math.min(list.length, session.fromIndex + 1));\n if (movedKey !== null) {\n const at = list.findIndex(i => this.cardId()(i) === movedKey);\n if (at >= 0) limit = Math.max(limit, at + 1);\n }\n }\n const hidden = list.length - limit;\n const remaining = Math.max(0, Math.floor(col.remaining ?? 0));\n return {\n col, list, shown: hidden > 0 ? list.slice(0, limit) : list, hidden, next: Math.min(size, hidden),\n remaining, count: list.length + remaining, nextRemote: Math.min(remaining, Math.max(1, Math.floor(col.nextCount ?? (size > 0 ? size : remaining)))),\n };\n });\n });\n\n /** The card the Tab key reaches (one tab stop for the whole board): the last focused one, else the first card of the first column that has one. */\n protected readonly tabbableKey = computed(() => {\n const keys = new Set<string>();\n for (const list of this.layout().values()) for (const i of list) keys.add(this.cardId()(i));\n const wanted = this.tabKey();\n if (wanted && keys.has(wanted)) return wanted;\n for (const col of this.columns()) {\n const first = this.layout().get(col.key)?.[0];\n if (first !== undefined) return this.cardId()(first);\n }\n return null;\n });\n\n /** Where the drop slot is drawn: in `col`, before the card `beforeKey` (null = at the end). Null while nothing is held or the target is refused. */\n private readonly slot = computed(() => {\n const s = this.session();\n if (!s || s.col === null || !this.targetAllowed(s)) return null;\n const preview = (this.layout().get(s.col) ?? []).filter(i => this.cardId()(i) !== s.key);\n const before = preview[s.index];\n return { col: s.col, beforeKey: before === undefined ? null : this.cardId()(before) };\n });\n\n /** \"Move to\" menus, built on demand and rebuilt when the columns, the rule or the language change. */\n private readonly menuMemo = computed(() => {\n this.columns(); this.canDrop(); this.canDrag(); this.layout();\n void this.labels.t('kanban.moveTo', { column: '' });\n return new Map<string, RowAction[]>();\n });\n\n constructor() {\n // new items from the host replace the board: an older revert is moot and a move still being held (a polling refresh) is let go\n // (the last moved card stays drawn: the host usually re-sends its items right after a drop, and the card must not vanish from a long column)\n effect(() => { this.items(); untracked(() => { this.history.clear(); this.letGo(); }); });\n effect(() => { if (this.loading()) untracked(() => { this.drawn.set({}); this.movedKey.set(null); this.letGo(); }); });\n effect(() => { if (!this.canDrag()) untracked(() => this.letGo()); });\n inject(DestroyRef).onDestroy(() => this.endPointer(false, false));\n }\n\n /** Ends any move in progress without a drop and without an announcement (the board changed under it). */\n private letGo(): void {\n this.endPointer(false, false);\n if (this.session() !== null) this.session.set(null);\n }\n\n // ─── Template helpers ─────────────────────────────────────\n\n protected dot(color?: string): string { return (color && DOT_COLORS[color]) || color || '#3b82f6'; }\n protected percent(p: number): string { return this.labels.formatNumber(p / 100, { style: 'percent', maximumFractionDigits: 1 }); }\n protected columnLabel(col: KanbanColumn, count: number): string {\n return this.labels.t(count === 1 ? 'kanban.columnLabel_one' : 'kanban.columnLabel_other', { column: col.label, count });\n }\n protected isTarget(key: string): boolean {\n const s = this.session();\n return !!s && s.col === key && this.targetAllowed(s);\n }\n /** While a card is held, a column that cannot take it. */\n protected isBlocked(key: string): boolean {\n const s = this.session();\n if (!s || key === s.fromCol) return false;\n const col = this.columns().find(c => c.key === key);\n return !!col && !this.accepts(s.item, s.fromCol, col);\n }\n protected slotBefore(colKey: string, beforeKey: string | null): boolean {\n const slot = this.slot();\n return !!slot && slot.col === colKey && slot.beforeKey === beforeKey;\n }\n protected loadMore(col: KanbanColumn): void {\n if (col.loadingMore) return;\n this.columnMore.emit(col.key);\n }\n protected showMore(colKey: string): void {\n const size = Math.floor(this.pageSize());\n const view = this.views().find(v => v.col.key === colKey);\n if (!view || size < 1) return;\n const limit = Math.min(view.list.length, view.shown.length + size);\n this.drawn.update(d => ({ ...d, [colKey]: limit }));\n this.announce(this.labels.t('kanban.showingOf', { limit, total: view.list.length, column: view.col.label }));\n }\n\n // ─── Public API ───────────────────────────────────────────\n\n /**\n * Puts a card back where it was before `move` (call it when the host's save failed). Does nothing when the host has already replaced `items`\n * (the new data wins; a host that updates its own items inside `cardMove` must revert its own data) or the move was reverted before. When the same card\n * was moved again after `move`, reverting the OLDER move puts the card at the older origin and makes the later move's revert a no-op; reverting the later move\n * first puts it at the later origin (and the older revert still works).\n */\n revert(move: KanbanMove<T>): void {\n const rec = this.history.get(move.id);\n if (!rec) return;\n // the card is back at the place this move took it from, so any LATER move of the same card (still being saved) no longer describes where it is: its revert is moot\n for (const [id, other] of this.history) if (other.key === rec.key && id >= move.id) this.history.delete(id);\n const next = new Map(this.layout());\n for (const [colKey, list] of next) {\n if (list.some(i => this.cardId()(i) === rec.key)) next.set(colKey, list.filter(i => this.cardId()(i) !== rec.key));\n }\n const target = [...(next.get(rec.fromCol) ?? [])];\n const at = clamp(rec.fromIndex, 0, target.length);\n target.splice(at, 0, move.item);\n next.set(rec.fromCol, target);\n this.layout.set(next);\n this.movedKey.set(rec.key);\n this.announce(this.labels.t('kanban.reverted', { item: this.cardLabel()(move.item), column: this.colLabelOf(rec.fromCol), position: at + 1, total: target.length }));\n this.focusCard(rec.key);\n }\n\n // ─── Rules ────────────────────────────────────────────────\n\n private group(items: readonly T[], columnKeys: string, columnOf: (item: T) => string): Map<string, T[]> {\n const map = new Map<string, T[]>(columnKeys.split('\\u0000').map(k => [k, [] as T[]]));\n for (const item of items) map.get(columnOf(item))?.push(item);\n return map;\n }\n\n /** May the card leave `from` for column `to` (a different column)? */\n private accepts(item: T, from: string, to: KanbanColumn): boolean {\n if (to.key === from || to.disabled || !this.canDrag()) return false;\n const rule = this.canDrop();\n return !rule || rule(item, from, to.key);\n }\n\n private targetAllowed(s: MoveSession<T>): boolean {\n if (s.col === null) return false;\n // dropping a card where it started is always fine (it changes nothing); a new position in the same column needs `reorderable`\n if (s.col === s.fromCol) return this.reorderable() || s.index === s.fromIndex;\n const col = this.columns().find(c => c.key === s.col);\n return !!col && this.accepts(s.item, s.fromCol, col);\n }\n\n private previewLength(s: MoveSession<T>, colKey: string): number {\n return (this.layout().get(colKey)?.length ?? 0) - (colKey === s.fromCol ? 1 : 0);\n }\n\n private colLabelOf(key: string): string { return this.columns().find(c => c.key === key)?.label ?? key; }\n\n private announce(text: string): void {\n // an identical message is not re-read by a live region: alternate a no-break space so a repeated move is spoken again\n this.announcement.set(text === this.announcement() ? text + '\\u00A0' : text);\n }\n\n // ─── Keyboard ─────────────────────────────────────────────\n\n protected onCardClick(item: T): void {\n if (this.suppressClick) return;\n this.cardClick.emit(item);\n }\n\n protected onCardKey(event: KeyboardEvent, item: T, col: KanbanColumn, index: number): void {\n if (event.target !== event.currentTarget) return; // keys inside the card's own controls (links, the menu) are theirs\n if (event.altKey || event.ctrlKey || event.metaKey) return;\n const key = this.cardId()(item);\n const s = this.session();\n if (s) {\n if (s.mode === 'keyboard' && s.key === key) this.onHeldKey(event, s);\n return;\n }\n switch (event.key) {\n case 'Enter':\n event.preventDefault();\n this.cardClick.emit(item);\n return;\n case ' ':\n event.preventDefault();\n if (this.canDrag()) this.pickUp(item, key, col.key, index);\n else this.cardClick.emit(item);\n return;\n case 'ArrowDown': case 'ArrowUp': case 'Home': case 'End': case 'ArrowLeft': case 'ArrowRight':\n event.preventDefault();\n this.moveFocus(event.key, key, col.key, index);\n return;\n }\n }\n\n protected onCardFocusOut(event: FocusEvent, key: string): void {\n const s = this.session();\n if (!s || s.mode !== 'keyboard' || s.key !== key) return;\n const next = event.relatedTarget as Node | null;\n if (next && (event.currentTarget as HTMLElement).contains(next)) return;\n this.cancelSession();\n }\n\n private pickUp(item: T, key: string, colKey: string, index: number): void {\n this.movedKey.set(null);\n this.session.set({ mode: 'keyboard', item, key, fromCol: colKey, fromIndex: index, col: colKey, index });\n this.announce(this.labels.t('kanban.pickedUp', {\n item: this.cardLabel()(item), column: this.colLabelOf(colKey), position: index + 1, total: this.layout().get(colKey)?.length ?? 0,\n }));\n }\n\n private onHeldKey(event: KeyboardEvent, s: MoveSession<T>): void {\n const cols = this.columns();\n const at = cols.findIndex(c => c.key === s.col);\n switch (event.key) {\n case 'ArrowLeft': case 'ArrowRight': {\n event.preventDefault();\n const to = cols[clamp(at + (event.key === 'ArrowRight' ? 1 : -1), 0, cols.length - 1)];\n if (to.key === s.col) return;\n // back in the column it came from, a board that cannot reorder puts the card on its own place again\n const back = to.key === s.fromCol && !this.reorderable();\n this.target(s, to.key, back ? s.fromIndex : clamp(s.index, 0, this.previewLength(s, to.key)));\n return;\n }\n case 'ArrowUp': case 'ArrowDown': {\n event.preventDefault();\n const col = s.col ?? s.fromCol;\n if (!this.reorderable() && col === s.fromCol) return;\n this.target(s, col, clamp(s.index + (event.key === 'ArrowDown' ? 1 : -1), 0, this.previewLength(s, col)));\n return;\n }\n case 'Home': case 'End': {\n event.preventDefault();\n const col = s.col ?? s.fromCol;\n if (!this.reorderable() && col === s.fromCol) return;\n this.target(s, col, event.key === 'Home' ? 0 : this.previewLength(s, col));\n return;\n }\n case 'Enter': case ' ':\n event.preventDefault();\n this.drop();\n return;\n case 'Escape':\n event.preventDefault();\n this.cancelSession();\n return;\n }\n }\n\n /** Moves the held card's target and says where it is now (or that the place refuses it). */\n private target(s: MoveSession<T>, col: string, index: number): void {\n const next: MoveSession<T> = { ...s, col, index };\n if (next.col === s.col && next.index === s.index) return;\n this.session.set(next);\n const item = this.cardLabel()(s.item);\n const column = this.colLabelOf(col);\n this.showTarget();\n if (this.targetAllowed(next)) this.announce(this.labels.t('kanban.movingOver', { item, column, position: index + 1, total: this.previewLength(next, col) + 1 }));\n else this.announce(this.labels.t('kanban.movingOverBlocked', { item, column }));\n }\n\n /** Keeps the held card's target on screen: after the new slot (or the refused column) is drawn, scroll it into view (sideways to the column, down to the slot). */\n private showTarget(): void {\n afterNextRender(() => {\n const s = this.session();\n if (!s || s.col === null) return;\n const root = this.host.nativeElement;\n const col = Array.from(root.querySelectorAll<HTMLElement>('.kb-col')).find(c => c.dataset['kbCol'] === s.col);\n const slot = col?.querySelector<HTMLElement>('.kb-slot');\n (slot ?? col)?.scrollIntoView({ block: 'nearest', inline: 'nearest' });\n }, { injector: this.injector });\n }\n\n private moveFocus(key: string, cardKey: string, colKey: string, index: number): void {\n const views = this.views();\n const at = views.findIndex(v => v.col.key === colKey);\n const here = views[at];\n let target: string | null = null;\n if (key === 'ArrowDown') target = this.keyAt(here.shown, index + 1);\n else if (key === 'ArrowUp') target = this.keyAt(here.shown, index - 1);\n else if (key === 'Home') target = this.keyAt(here.shown, 0);\n else if (key === 'End') target = this.keyAt(here.shown, here.shown.length - 1);\n else {\n const step = key === 'ArrowRight' ? 1 : -1;\n for (let i = at + step; i >= 0 && i < views.length; i += step) {\n if (views[i].shown.length) { target = this.keyAt(views[i].shown, Math.min(index, views[i].shown.length - 1)); break; }\n }\n }\n if (target && target !== cardKey) this.focusNow(target);\n }\n\n private keyAt(list: readonly T[], i: number): string | null {\n const item = list[i];\n return item === undefined ? null : this.cardId()(item);\n }\n\n // ─── Pointer drag ─────────────────────────────────────────\n\n protected onPointerDown(event: PointerEvent, item: T, colKey: string, index: number): void {\n if (!this.canDrag() || this.session() || this.pointer || event.isPrimary === false) return;\n if (event.pointerType === 'mouse' && event.button !== 0) return;\n const target = event.target as HTMLElement | null;\n if (!target || target.closest('button, a, input, select, textarea, [contenteditable], [data-kanban-nodrag], .kb-card__menu')) return;\n // a finger or a pen drags from the grip only, so a swipe over a card still scrolls the board\n if (event.pointerType !== 'mouse' && !target.closest('.kb-handle')) return;\n const el = event.currentTarget as HTMLElement;\n const rect = el.getBoundingClientRect();\n this.pointer = {\n id: event.pointerId, startX: event.clientX, startY: event.clientY, x: event.clientX, y: event.clientY, item, key: this.cardId()(item), col: colKey, index,\n el, ghost: null, offX: event.clientX - rect.left, offY: event.clientY - rect.top, started: false, raf: 0,\n };\n this.doc.addEventListener('pointermove', this.onDocMove);\n this.doc.addEventListener('pointerup', this.onDocUp);\n this.doc.addEventListener('pointercancel', this.onDocCancel);\n this.doc.addEventListener('keydown', this.onDocKey);\n this.doc.addEventListener('selectstart', this.onSelectStart);\n }\n\n private readonly onDocMove = (event: PointerEvent): void => {\n const p = this.pointer;\n if (!p || event.pointerId !== p.id) return;\n p.x = event.clientX;\n p.y = event.clientY;\n if (!p.started) {\n if (Math.hypot(p.x - p.startX, p.y - p.startY) < DRAG_THRESHOLD_PX) return;\n this.startDrag(p);\n }\n event.preventDefault();\n this.placeGhost(p);\n this.retarget(p);\n };\n\n private readonly onDocUp = (event: PointerEvent): void => {\n if (this.pointer && event.pointerId === this.pointer.id) this.endPointer(true, true);\n };\n\n private readonly onDocCancel = (event: PointerEvent): void => {\n if (this.pointer && event.pointerId === this.pointer.id) this.endPointer(false, true);\n };\n\n /** A drag across the page must not select text on the way. */\n private readonly onSelectStart = (event: Event): void => { if (this.pointer) event.preventDefault(); };\n\n private readonly onDocKey = (event: KeyboardEvent): void => {\n if (event.key === 'Escape' && this.pointer) { event.preventDefault(); this.endPointer(false, true); }\n };\n\n private startDrag(p: PointerDrag<T>): void {\n p.started = true;\n this.movedKey.set(null);\n this.session.set({ mode: 'pointer', item: p.item, key: p.key, fromCol: p.col, fromIndex: p.index, col: p.col, index: p.index });\n const rect = p.el.getBoundingClientRect();\n const ghost = p.el.cloneNode(true) as HTMLElement;\n ghost.classList.add('kb-ghost');\n ghost.removeAttribute('tabindex');\n ghost.removeAttribute('data-kb-key');\n // a picture of the card, nothing more: not read, not focusable, no duplicate ids, no menu\n ghost.setAttribute('aria-hidden', 'true');\n ghost.setAttribute('inert', '');\n ghost.querySelectorAll('.kb-card__menu').forEach(n => n.remove());\n ghost.querySelectorAll('[id]').forEach(n => n.removeAttribute('id'));\n ghost.querySelectorAll('a, button, input, select, textarea, iframe, [tabindex], [contenteditable]').forEach(n => n.setAttribute('tabindex', '-1'));\n ghost.style.boxSizing = 'border-box';\n ghost.style.width = `${rect.width}px`;\n ghost.style.height = `${rect.height}px`;\n // fixed positioning inside a transformed ancestor would be relative to that ancestor, so the picture lives on the body; it keeps the card's text style\n const look = this.doc.defaultView?.getComputedStyle(p.el);\n if (look) { ghost.style.font = look.font; ghost.style.color = look.color; }\n this.doc.body.appendChild(ghost);\n p.ghost = ghost;\n this.scheduleScroll(p);\n }\n\n private placeGhost(p: PointerDrag<T>): void {\n if (p.ghost) p.ghost.style.transform = `translate3d(${p.x - p.offX}px, ${p.y - p.offY}px, 0)`;\n }\n\n /** Finds the column under the pointer and the position among its cards. */\n private retarget(p: PointerDrag<T>): void {\n const s = this.session();\n if (!s || s.mode !== 'pointer') return;\n const cols = Array.from(this.host.nativeElement.querySelectorAll<HTMLElement>('.kb-col'));\n const rects = cols.map(c => { const r = c.getBoundingClientRect(); return { key: c.dataset['kbCol'] ?? '', left: r.left, right: r.right, top: r.top, bottom: r.bottom }; });\n const key = columnAtPoint(rects, p.x, p.y);\n if (key === null) {\n if (s.col !== null) this.session.set({ ...s, col: null });\n return;\n }\n const colEl = cols[rects.findIndex(r => r.key === key)];\n // The drop slot pushes the cards after it down; measure them where they would be without it, or the slot itself would move the target (a flicker).\n const slotEl = colEl.querySelector<HTMLElement>('.kb-slot');\n const list = colEl.querySelector<HTMLElement>('.kb-col__cards');\n const push = slotEl ? slotEl.getBoundingClientRect().height + (parseFloat(this.doc.defaultView?.getComputedStyle(list ?? colEl).rowGap ?? '') || 0) : 0;\n const middles = Array.from(colEl.querySelectorAll<HTMLElement>('.kb-card:not(.kb-ghost)'))\n .filter(c => c.dataset['kbKey'] !== p.key)\n .map(c => {\n const r = c.getBoundingClientRect();\n const after = slotEl && (slotEl.compareDocumentPosition(c) & Node.DOCUMENT_POSITION_FOLLOWING) !== 0;\n return r.top + r.height / 2 - (after ? push : 0);\n });\n const index = dropIndexAt(middles, p.y);\n if (s.col !== key || s.index !== index) this.session.set({ ...s, col: key, index });\n }\n\n private scheduleScroll(p: PointerDrag<T>): void {\n const win = this.doc.defaultView;\n if (!win) return;\n const step = (): void => {\n if (this.pointer !== p) return;\n const board = this.host.nativeElement.querySelector<HTMLElement>('.kb-board');\n if (board) {\n const r = board.getBoundingClientRect();\n const dx = autoScrollDelta(p.x, r.left, r.right);\n if (dx) board.scrollLeft += dx;\n const s = this.session();\n const list = s?.col ? this.host.nativeElement.querySelector<HTMLElement>(`.kb-col[data-kb-col=\"${s.col.replace(/[\"\\\\]/g, '\\\\$&')}\"] .kb-col__cards`) : null;\n let dy = 0;\n if (list) {\n const lr = list.getBoundingClientRect();\n dy = autoScrollDelta(p.y, lr.top, lr.bottom);\n if (dy) list.scrollTop += dy;\n }\n // the content moved under a still pointer: find the column / position again, also when the pointer was over no column (a gap) before the scroll\n if (dx || dy) this.retarget(p);\n }\n p.raf = win.requestAnimationFrame(step);\n };\n // the frame loop runs outside Angular's zone: a loop that lives as long as the drag must not keep the zone busy or run a change detection every frame (signals still schedule one when a retarget changes the view)\n this.zone.runOutsideAngular(() => { p.raf = win.requestAnimationFrame(step); });\n }\n\n /** Ends a press: `commit` drops the card where it is held, otherwise it stays. `say` = announce a cancel. */\n private endPointer(commit: boolean, say: boolean): void {\n const p = this.pointer;\n if (!p) return;\n this.pointer = null;\n this.doc.removeEventListener('pointermove', this.onDocMove);\n this.doc.removeEventListener('pointerup', this.onDocUp);\n this.doc.removeEventListener('pointercancel', this.onDocCancel);\n this.doc.removeEventListener('keydown', this.onDocKey);\n this.doc.removeEventListener('selectstart', this.onSelectStart);\n this.doc.defaultView?.cancelAnimationFrame(p.raf);\n p.ghost?.remove();\n if (!p.started) return;\n // the click that follows a drag must not open the card\n this.suppressClick = true;\n setTimeout(() => { this.suppressClick = false; });\n if (commit) this.drop();\n else if (say) this.cancelSession();\n else this.session.set(null);\n }\n\n // ─── Dropping, cancelling, menu ───────────────────────────\n\n /** Drops the held card at its target: a refused target announces why (a held card stays held, a dragged one goes home). */\n private drop(): void {\n const s = this.session();\n if (!s) return;\n if (s.col === null) { this.cancelSession(); return; }\n if (!this.targetAllowed(s)) {\n this.announce(this.labels.t('kanban.dropBlocked', { item: this.cardLabel()(s.item), column: this.colLabelOf(s.col) }));\n if (s.mode === 'pointer') this.session.set(null);\n return;\n }\n this.session.set(null);\n if (s.col === s.fromCol && s.index === s.fromIndex) {\n this.announce(this.labels.t('kanban.unchanged', {\n item: this.cardLabel()(s.item), column: this.colLabelOf(s.col), position: s.index + 1, total: this.layout().get(s.col)?.length ?? 0,\n }));\n this.focusCard(s.key);\n return;\n }\n this.applyMove(s.item, s.key, s.fromCol, s.fromIndex, s.col, s.index);\n }\n\n private cancelSession(): void {\n const s = this.session();\n if (!s) return;\n this.session.set(null);\n this.announce(this.labels.t('kanban.cancelled', {\n item: this.cardLabel()(s.item), column: this.colLabelOf(s.fromCol), position: s.fromIndex + 1, total: this.layout().get(s.fromCol)?.length ?? 0,\n }));\n this.focusCard(s.key);\n }\n\n /** The \"Move to\" menu of a card: one item per column that accepts it. */\n protected moveActions(item: T, fromCol: string): RowAction[] {\n if (!this.canDrag()) return [];\n const memo = this.menuMemo();\n const rule = this.canDrop();\n const memoKey = rule ? `${fromCol}|${this.cardId()(item)}` : fromCol;\n let actions = memo.get(memoKey);\n if (!actions) {\n actions = this.columns()\n .filter(to => this.accepts(item, fromCol, to))\n .map(to => ({ type: MOVE_PREFIX + to.key, label: this.labels.t('kanban.moveTo', { column: to.label }), icon: MOVE_ICON }));\n memo.set(memoKey, actions);\n }\n return actions;\n }\n\n protected onMenuAction(type: string, item: T, fromCol: string): void {\n if (!type.startsWith(MOVE_PREFIX) || !this.canDrag()) return;\n const to = this.columns().find(c => c.key === type.slice(MOVE_PREFIX.length));\n if (!to || !this.accepts(item, fromCol, to)) return;\n const key = this.cardId()(item);\n const fromIndex = (this.layout().get(fromCol) ?? []).findIndex(i => this.cardId()(i) === key);\n if (fromIndex < 0) return;\n this.applyMove(item, key, fromCol, fromIndex, to.key, 0);\n }\n\n private applyMove(item: T, key: string, fromCol: string, fromIndex: number, toCol: string, toIndex: number): void {\n const before = this.layout();\n const next = new Map(before);\n const source = (before.get(fromCol) ?? []).filter(i => this.cardId()(i) !== key);\n const dest = fromCol === toCol ? source : [...(before.get(toCol) ?? [])];\n const at = clamp(toIndex, 0, dest.length);\n const placed = [...dest];\n placed.splice(at, 0, item);\n if (fromCol !== toCol) next.set(fromCol, source);\n next.set(toCol, placed);\n this.layout.set(next);\n this.movedKey.set(key);\n const id = ++this.moveSeq;\n this.history.set(id, { key, fromCol, fromIndex });\n this.announce(this.labels.t('kanban.moved', { item: this.cardLabel()(item), column: this.colLabelOf(toCol), position: at + 1, total: placed.length }));\n this.focusCard(key);\n const move: KanbanMove<T> = { id, item, fromColumn: fromCol, toColumn: toCol, fromIndex, toIndex: at, revert: () => this.revert(move) };\n this.cardMove.emit(move);\n }\n\n // ─── Focus ────────────────────────────────────────────────\n\n private findCard(key: string): HTMLElement | undefined {\n return Array.from(this.host.nativeElement.querySelectorAll<HTMLElement>('.kb-card:not(.kb-ghost)')).find(c => c.dataset['kbKey'] === key);\n }\n\n private focusNow(key: string): void { this.findCard(key)?.focus(); }\n\n /** A moved card is drawn again in its new place: put the focus back on it once it is there. */\n private focusCard(key: string): void {\n this.tabKey.set(key);\n afterNextRender(() => this.findCard(key)?.focus(), { injector: this.injector });\n }\n}\n"],"mappings":";;;;;AA0DA,IAAa,qBAAb,MAAa,mBAAkB;CAD/B,cAAA;EAGW,KAAA,WAAW,MAA6B,IAAE;GAAA,GAAA,YAAA,EAAA,WAAA,WAAA,+BAAA,CAAA;GAAI,OAAO;EAAa,CAAA;EAClE,KAAA,WAAW,OAAyC,WAAW;CAEzE;CADC,OAAO,uBAA0B,MAA6B,MAAa;EAAiC,OAAO;CAAM;CAJ9G;EAAA,KAAA,OAAA,GAAA,mBAAA;GAAA,YAAA;GAAA,SAAA;GAA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