@forgeroute/ui 0.5.27 → 0.5.29
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/fesm2022/forgeroute-ui-calendar.mjs +103 -4
- package/fesm2022/forgeroute-ui-calendar.mjs.map +1 -1
- package/fesm2022/forgeroute-ui-card-list-item.mjs +191 -43
- package/fesm2022/forgeroute-ui-card-list-item.mjs.map +1 -1
- package/fesm2022/forgeroute-ui-contact-picker.mjs +2 -2
- package/fesm2022/forgeroute-ui-contact-picker.mjs.map +1 -1
- package/fesm2022/{forgeroute-ui-core-ui-labels.es-Dzvm992V.mjs → forgeroute-ui-core-ui-labels.es-BViJSCO-.mjs} +4 -1
- package/fesm2022/{forgeroute-ui-core-ui-labels.es-Dzvm992V.mjs.map → forgeroute-ui-core-ui-labels.es-BViJSCO-.mjs.map} +1 -1
- package/fesm2022/forgeroute-ui-core.mjs +4 -1
- package/fesm2022/forgeroute-ui-core.mjs.map +1 -1
- package/fesm2022/forgeroute-ui-data-table-core.mjs +59 -28
- package/fesm2022/forgeroute-ui-data-table-core.mjs.map +1 -1
- package/fesm2022/forgeroute-ui-kpi-card.mjs +2 -2
- package/fesm2022/forgeroute-ui-kpi-card.mjs.map +1 -1
- package/fesm2022/forgeroute-ui-notes.mjs +20 -22
- package/fesm2022/forgeroute-ui-notes.mjs.map +1 -1
- package/fesm2022/forgeroute-ui-panel-info-list.mjs +26 -4
- package/fesm2022/forgeroute-ui-panel-info-list.mjs.map +1 -1
- package/fesm2022/forgeroute-ui-payments.mjs +2 -1
- package/fesm2022/forgeroute-ui-payments.mjs.map +1 -1
- package/fesm2022/forgeroute-ui-setup.mjs +2 -1
- package/fesm2022/forgeroute-ui-setup.mjs.map +1 -1
- package/fesm2022/forgeroute-ui-stripe.mjs +78 -6
- package/fesm2022/forgeroute-ui-stripe.mjs.map +1 -1
- package/fesm2022/forgeroute-ui-table-types.mjs.map +1 -1
- package/package.json +1 -1
- package/types/forgeroute-ui-calendar.d.ts +28 -1
- package/types/forgeroute-ui-card-list-item.d.ts +37 -11
- package/types/forgeroute-ui-core.d.ts +3 -0
- package/types/forgeroute-ui-data-table-core.d.ts +10 -1
- package/types/forgeroute-ui-messaging.d.ts +1 -1
- package/types/forgeroute-ui-panel-info-list.d.ts +11 -0
- package/types/forgeroute-ui-quickbooks.d.ts +1 -1
- package/types/forgeroute-ui-square.d.ts +3 -3
- package/types/forgeroute-ui-stripe.d.ts +31 -1
- package/types/forgeroute-ui-table-types.d.ts +5 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"forgeroute-ui-table-types.mjs","names":[],"sources":["../../../projects/forgeroute-ui/table-types/src/lib/data-table/data-table.types.ts"],"sourcesContent":["import { InjectionToken, WritableSignal } from '@angular/core';\nimport { uiLocale } from '@forgeroute/ui/core';\n\nexport type SortDir = 'asc' | 'desc';\n\n/**\n * Shared signal provided at the DataTableComponent level.\n * Holds the ID of the currently-open dropdown. When any dropdown\n * opens it sets this to its own ID — all others react and close.\n */\nexport const DROPDOWN_GROUP = new InjectionToken<WritableSignal<string>>('DROPDOWN_GROUP');\n\n// ── Badge ──────────────────────────────────────────────────────\nexport type BadgeVariant =\n | 'green' | 'blue' | 'red' | 'amber' | 'purple' | 'gray' | 'teal' | 'pink'\n | 'indigo' | 'orange' | 'cyan' | 'lime' | 'rose' | 'slate'\n | 'emerald' | 'sky' | 'fuchsia' | 'yellow' | 'violet' | 'stone'\n | 'mint' | 'steel' | 'bronze' | 'plum' | 'sage' | 'coral' | 'sand' | 'ocean' | 'pewter'\n | 'gold' | 'jade' | 'sienna' | 'mauve' | 'walnut' | 'navy';\n\nexport const BADGE_VARIANT_STYLES: Record<BadgeVariant, { bg: string; color: string }> = {\n green: { bg: '#dcfce7', color: '#166534' },\n blue: { bg: '#dbeafe', color: '#1e40af' },\n red: { bg: '#fee2e2', color: '#991b1b' },\n amber: { bg: '#fef3c7', color: '#92400e' },\n purple: { bg: '#fff1f2', color: '#881337' },\n gray: { bg: '#f1f5f9', color: '#475569' },\n teal: { bg: '#ccfbf1', color: '#115e59' },\n pink: { bg: '#fce7f3', color: '#be185d' },\n indigo: { bg: '#bfdbfe', color: '#1e3a8a' },\n orange: { bg: '#ffedd5', color: '#9a3412' },\n cyan: { bg: '#cffafe', color: '#155e75' },\n lime: { bg: '#ecfccb', color: '#3f6212' },\n rose: { bg: '#ffe4e6', color: '#9f1239' },\n slate: { bg: '#e2e8f0', color: '#334155' },\n emerald: { bg: '#d1fae5', color: '#065f46' },\n sky: { bg: '#e0f2fe', color: '#0c4a6e' },\n fuchsia: { bg: '#fdf4ff', color: '#a21caf' },\n yellow: { bg: '#fef9c3', color: '#854d0e' },\n violet: { bg: '#fefce8', color: '#713f12' },\n stone: { bg: '#f5f5f4', color: '#57534e' },\n mint: { bg: '#d1fae5', color: '#047857' },\n steel: { bg: '#cbd5e1', color: '#1e293b' },\n bronze: { bg: '#fde68a', color: '#78350f' },\n plum: { bg: '#f5f5f4', color: '#44403c' },\n sage: { bg: '#d9f99d', color: '#4d7c0f' },\n coral: { bg: '#fecdd3', color: '#be123c' },\n sand: { bg: '#e7e5e4', color: '#44403c' },\n ocean: { bg: '#bae6fd', color: '#075985' },\n pewter: { bg: '#d4d4d8', color: '#3f3f46' },\n gold: { bg: '#fbbf24', color: '#78350f' },\n jade: { bg: '#6ee7b7', color: '#064e3b' },\n sienna: { bg: '#f0cfb8', color: '#7c2d12' },\n mauve: { bg: '#f0d9e0', color: '#6b2d3e' },\n walnut: { bg: '#d4a27a', color: '#1c0f09' },\n navy: { bg: '#93c5fd', color: '#172554' },\n};\n\n/**\n * Global semantic map — same label always gets the same color across every\n * table in the app, regardless of which page or column it appears in. The keys are the ENGLISH labels (the exported constant stays English for API\n * compatibility); Spanish labels are matched by `SEMANTIC_BADGE_MAP_ES` through `semanticBadgeVariant()`, which the badge and the data table use.\n */\nexport const SEMANTIC_BADGE_MAP: Readonly<Record<string, BadgeVariant>> = {\n // Active/Inactive states\n 'Active': 'green',\n 'Inactive': 'gray',\n 'Off': 'gray',\n 'Disabled': 'red',\n 'Paused': 'amber',\n // Workflow\n 'Pending': 'blue',\n 'In Progress': 'cyan',\n 'Completed': 'emerald',\n 'Resolved': 'green',\n 'Draft': 'slate',\n 'Voided': 'slate',\n // Audit\n 'Created': 'green',\n 'Updated': 'blue',\n 'Deleted': 'red',\n 'Login': 'amber',\n 'Logout': 'gray',\n 'Exported': 'pink',\n 'Imported': 'orange',\n // Comms delivery\n 'Sent': 'blue',\n 'Delivered': 'green',\n 'Opened': 'teal',\n 'Clicked': 'emerald',\n 'Bounced': 'amber',\n 'Scheduled': 'sky',\n // Terminal/negative\n 'Failed': 'red',\n 'Cancelled': 'gray',\n 'Expired': 'orange',\n 'Declined': 'red',\n 'Signed': 'emerald',\n 'Paid': 'green',\n // Priority\n 'High': 'red',\n 'Medium': 'amber',\n 'Low': 'slate',\n // Direction\n 'Inbound': 'cyan',\n 'Outbound': 'teal',\n // Boolean/consent\n 'Yes': 'green',\n 'No': 'gray',\n 'Opted In': 'green',\n 'Opted Out': 'red',\n // Channel\n 'Text': 'indigo',\n 'Email': 'sky',\n};\n\n/**\n * Spanish aliases of the labels in `SEMANTIC_BADGE_MAP`: a Spanish status keeps the colour its English twin has (\"Activo\" is green like \"Active\", \"Pagado\"\n * green like \"Paid\"), so the same meaning has the same colour in either language. Looked up by `semanticBadgeVariant` after the exact English match.\n */\nexport const SEMANTIC_BADGE_MAP_ES: Readonly<Record<string, BadgeVariant>> = {\n 'Activo': 'green', 'Inactivo': 'gray', 'Apagado': 'gray', 'Desactivado': 'red', 'Deshabilitado': 'red', 'Pausado': 'amber',\n 'Pendiente': 'blue', 'En progreso': 'cyan', 'Completado': 'emerald', 'Resuelto': 'green', 'Borrador': 'slate', 'Anulado': 'slate',\n 'Creado': 'green', 'Actualizado': 'blue', 'Eliminado': 'red', 'Inicio de sesión': 'amber', 'Cierre de sesión': 'gray', 'Exportado': 'pink', 'Importado': 'orange',\n 'Enviado': 'blue', 'Entregado': 'green', 'Abierto': 'teal', 'Con clic': 'emerald', 'Rebotado': 'amber', 'Programado': 'sky',\n 'Fallido': 'red', 'Cancelado': 'gray', 'Vencido': 'orange', 'Rechazado': 'red', 'Firmado': 'emerald', 'Pagado': 'green',\n 'Alta': 'red', 'Media': 'amber', 'Baja': 'slate',\n 'Entrante': 'cyan', 'Saliente': 'teal',\n 'Sí': 'green', 'Aceptó': 'green', 'No aceptó': 'red',\n 'Texto': 'indigo', 'Correo electrónico': 'sky',\n};\n\nconst foldLabel = (label: string): string => label.normalize('NFD').replace(/[\\u0300-\\u036f]/g, '').trim().toLowerCase();\nconst SEMANTIC_ES_FOLDED: ReadonlyMap<string, BadgeVariant> = new Map(Object.entries(SEMANTIC_BADGE_MAP_ES).map(([k, v]) => [foldLabel(k), v]));\n\n/**\n * The semantic colour of a label, or `undefined` when it has none: the exact English entry of `SEMANTIC_BADGE_MAP` first, then - only while the app's\n * active locale is Spanish (the Spanish dictionary or `setLocale('es-..')`) - the Spanish alias, ignoring case and accents (\"ACTIVO\", \"sí\" and \"si\" are\n * all green). An English app never reaches the Spanish table, so an English label such as \"Media\" keeps its hash colour exactly as before.\n */\nexport function semanticBadgeVariant(label: string | null | undefined, locale: string = uiLocale()): BadgeVariant | undefined {\n if (!label) return undefined;\n const exact = SEMANTIC_BADGE_MAP[label];\n if (exact) return exact;\n return locale.toLowerCase().startsWith('es') ? SEMANTIC_ES_FOLDED.get(foldLabel(label)) : undefined;\n}\n\n/** Visually distinct variants used for auto-color assignment. */\nconst AUTO_COLOR_PALETTE: BadgeVariant[] = [\n 'green', 'blue', 'teal', 'pink', 'sky', 'ocean', 'cyan', 'rose',\n 'amber', 'purple', 'orange', 'sage', 'indigo', 'emerald', 'violet',\n 'lime', 'steel', 'coral', 'plum', 'slate', 'fuchsia', 'jade', 'navy',\n 'sienna', 'mauve', 'gold', 'bronze', 'walnut',\n];\n\n/**\n * Deterministic color from a string value — same value always gets the\n * same color, and adjacent values in the palette are visually distinct.\n */\nexport function autoVariant(value: string): BadgeVariant {\n let hash = 0;\n for (let i = 0; i < value.length; i++) {\n hash = (hash * 31 + value.charCodeAt(i)) & 0xffff;\n }\n return AUTO_COLOR_PALETTE[Math.abs(hash) % AUTO_COLOR_PALETTE.length];\n}\n\nexport interface BadgeConfig {\n label: string;\n variant: BadgeVariant;\n}\n\n// ── Toolbar actions ────────────────────────────────────────────\nexport interface ToolbarAction {\n type: string;\n label: string;\n /** SVG path data for an icon (optional) */\n icon?: string;\n /** 'primary' = blue standalone button, 'secondary' = gray outlined standalone button, omit = inside More Actions dropdown */\n variant?: 'primary' | 'secondary';\n /** Optional count badge shown on the button */\n badge?: number;\n /** Hide this action entirely */\n hidden?: boolean;\n /** Documentation of intent: marks a mutating action (\"Add …\", bulk mutations). It does not change behavior - the table hides\n * EVERY page-defined toolbar action for any `permission` other than 'full', unless it is marked `allowReadOnly`. */\n requiresFull?: boolean;\n /**\n * Keep this action when the table is empty and unfiltered. By default only `variant: 'primary'` buttons survive that\n * state; set this on secondary buttons and More Actions items that must stay reachable on an empty table (e.g. an\n * \"Import\" or \"Invite\" that is how the first record gets created). A kept More Actions item brings the More Actions\n * menu back (with its usual items).\n */\n keepWhenEmpty?: boolean;\n /**\n * Keep this action for a read-only table (`permission` other than 'full'). By default a read-only table drops every\n * page-defined toolbar action and keeps only Export; set this on a PURE READ - e.g. a \"Board View\" / \"List View\" switch\n * that changes what is shown but writes nothing. Never set it on an action that creates, changes or deletes a record.\n * On an empty, unfiltered table only primary buttons survive: add `keepWhenEmpty` as well to keep a view switch there.\n */\n allowReadOnly?: boolean;\n /**\n * Standalone toggle buttons (e.g. \"Assigned to Me\"): true / false renders `aria-pressed` so screen readers announce\n * the on / off state. Leave unset for ordinary buttons (no attribute).\n */\n pressed?: boolean;\n /**\n * Optional confirmation before the click is reported (library source 2026-11-05, not yet published). Set it ONLY on an action that needs a\n * confirm dialog (pause / run now / send to all): the table shows its confirm modal first, emits `(tableButtonClick)` only when the user\n * confirms, and emits nothing on Cancel / Escape / backdrop. An action without `confirm` behaves exactly as before. Not used for the\n * table's own Import and Export. Same copy fields as a row action's `modal` (`message` may be a function read at click time, for text that\n * depends on the host's current state); say what happens before -> after and what is NOT affected.\n */\n confirm?: ToolbarConfirm;\n}\n\n/** Confirm dialog copy of a toolbar action (see `ToolbarAction.confirm`). */\nexport interface ToolbarConfirm {\n title: string;\n message: string | (() => string);\n confirmLabel?: string;\n cancelLabel?: string;\n variant?: 'danger' | 'primary' | 'warning';\n details?: string[];\n}\n\n// ── Confirm config (used by RowAction.modal and ConfirmService) ─\nexport interface ConfirmConfig {\n title: string;\n /** Message text. In actionsFn context item is already in scope so a plain string is fine.\n * Pass a function when defining actions as a static array outside actionsFn. */\n message: string | ((item: any) => string);\n confirmLabel?: string; // default 'Confirm'\n cancelLabel?: string; // default 'Cancel'\n variant?: 'danger' | 'primary' | 'warning'; // default 'danger'; 'warning' makes the confirm button amber\n /** Bullet list shown under the message (consequences, what is NOT affected, undoable or not). Plain text only (never HTML).\n * Rendered by the confirm dialog (`data-testid=\"confirm-details\"`, aria-label \"What will happen\") and by the built-in row delete. */\n details?: string[];\n}\n\n// ── Row actions (for actions cell type) ───────────────────────\nexport interface RowAction {\n type: string;\n label: string;\n /** SVG path data string (the <path> or <line> etc. content only, no outer <svg>) */\n icon?: string;\n variant?: 'default' | 'danger';\n hidden?: (item: any) => boolean;\n disabled?: (item: any) => boolean;\n /**\n * Why a disabled action is disabled (library source 2026-11-21, additive). Shown in the row menu as visible text under the action's label, linked to it with `aria-describedby` and also set as its `title`.\n * A function receives the row (inside `<ui-data-table>`; a standalone `ui-more-menu` calls it with `null`); `null` / `undefined` / empty = no reason. Only used while the action is disabled. An action with a\n * reason stays focusable (`aria-disabled`, so a screen-reader user can reach it and hear the reason) but never runs, and is never clickable.\n */\n disabledReason?: string | ((item: any) => string | null | undefined);\n /** How the table handles this action when clicked.\n * 'modal' — table shows a built-in confirm modal; onAction is called only if confirmed.\n * 'panel' — table emits (panelActionClick); host component opens the right panel or form modal.\n * Omit — onAction is called directly (navigate, toggle, call, etc.) */\n opens?: 'modal' | 'panel';\n /** Required when opens === 'modal'. Drives the confirm dialog shown by the table. */\n modal?: ConfirmConfig;\n /** Documentation of intent: marks a mutating action (edit, delete, ...). It does not change behavior - for any `permission`\n * other than 'full' the table offers only View and actions marked `allowReadOnly`, with or without this flag.\n * The built-in `type: 'delete'` action is never offered to read-only users. */\n requiresFull?: boolean;\n /** Keep this action for read-only users too (download, preview: reads that change nothing). Without it a read-only table offers only\n * View. Never applies to the built-in delete, and the table still drops the Actions column when no row has any visible action. */\n allowReadOnly?: boolean;\n}\n\n/** Page-level permission passed to `<ui-data-table [permission]>`. Anything other than 'full' is read-only\n * (apps use values like 'read-only' / 'hidden'). */\nexport type TablePermission = 'full' | 'read' | 'read-only' | 'none' | 'hidden';\n\n// ── Cell types ────────────────────────────────────────────────\nexport type CellType =\n | 'text' // default — renders item[col.key] as string\n | 'badge' // renders a colored badge pill\n | 'date' // formats a date value\n | 'phone' // formats a phone number\n | 'number' // right-aligns header + cell; renders via render() or item[col.key]\n | 'avatar-name' // avatar circle + full name\n | 'days-ago' // \"Xd ago\" / \"Never\" with overdue styling\n | 'progress' // progress bar + label, driven by progressFn\n | 'tags' // first tag badge + \"+N more\"\n | 'image' // thumbnail driven by imageFn (placeholder icon when there is no URL / it fails to load)\n | 'link' // real <a> driven by linkFn (mailto:, tel:, http(s):, or an in-app route); plain text when linkFn gives no target\n | 'actions'; // more-menu dropdown\n\n// ── Link cells ────────────────────────────────────────────────\n/**\n * Where a `cellType: 'link'` cell points. Return a plain string from `linkFn` as shorthand for `{ href }`.\n *\n * - `routerLink` (+ `queryParams`) is an in-app route: the anchor gets the real URL as its `href` (so right-click,\n * middle-click, ctrl/cmd-click, \"open in new tab\" and \"copy link address\" all work) and a plain left click\n * navigates through the Angular `Router` without a page reload. `routerLink` wins when `href` is also set.\n * - `href` accepts ONLY `mailto:`, `tel:`, `http:`, `https:` and root-relative paths (`/cases/12`). Anything else\n * (`javascript:`, `data:`, `//host`, empty, control characters) is never rendered as an href: the cell shows plain\n * text. A root-relative `href` is a normal link (full page load); use `routerLink` for in-app navigation.\n * - `target: '_blank'` (default `'_self'`) adds `rel=\"noopener noreferrer\"` and a \"(opens in a new tab)\" screen-reader\n * hint. `http(s):` hrefs always get the same `rel`.\n * - `label` is the link text when the cell has no text of its own (`render` and `item[key]` are empty).\n * - `ariaLabel` replaces the link's accessible name (default: its text).\n * - `download` adds the `download` attribute.\n */\nexport interface LinkTarget {\n href?: string;\n routerLink?: string | readonly any[];\n queryParams?: Record<string, any>;\n target?: '_self' | '_blank';\n label?: string;\n ariaLabel?: string;\n download?: boolean;\n}\n\n/** Payload of `(linkClick)`: a link cell's anchor was activated by a click (the row click is NOT also emitted). */\nexport interface LinkClickEvent<T = any> {\n item: T;\n column: ColumnDef;\n /** The anchor's href (null only for a routerLink that could not be resolved, which renders no anchor anyway). */\n href: string | null;\n}\n\n// ── Column definition ─────────────────────────────────────────\nexport interface ColumnDef {\n key: string;\n label: string;\n sortable?: boolean;\n defaultVisible?: boolean;\n /**\n * Wire name of this column's FILTER, when it must differ from `key`. Defaults to `key` (unset = unchanged behaviour).\n * Replaces `key` only for: the column-filter query param on rows and export requests, the key read from the\n * `/filter-counts` response for this column's options/counts (also the bulk \"Change <column>\" options), and the key\n * stored in saved views (a view saved under the plain `key` still restores). Everything else stays on `key`:\n * sort (`sort=<key>`), cell values, visibility, `lockedColumn`, `searchFields`, `bulkUpdateOptions` and the\n * `/bulk/<field>` request body. It also names the header filter and the phone-card filter chips' request param. It must not equal a reserved table param (`page`, `size`, `search`, `searchFields`, `sort`, `direction`, `filter`) nor an `Object.prototype` member name such as `constructor` — there is no runtime guard. Example: `{ key: 'direction', filterParam: 'messageDirection' }` keeps the filter\n * from colliding with the table's own `direction=asc|desc` sort param.\n */\n filterParam?: string;\n /** If true, this column's label appears in the search input placeholder when the column is visible. */\n searchable?: boolean;\n /** Values a bulk \"Change <label>\" may set. When omitted the options come from /filter-counts.\n * Use it when only some values are user-settable or when a valid value may currently have no rows. */\n bulkOptions?: string[];\n /** Fixed column width (any CSS length, e.g. '140px'). Applied as width, min-width and max-width; cell text longer than\n * it is cut with an ellipsis. Omit for an automatic width. Not applied to the Actions column's cell clipping. */\n width?: string;\n align?: 'left' | 'right' | 'center';\n headerAlign?: 'left' | 'right' | 'center';\n\n /** How to render cell content. Defaults to 'text'. */\n cellType?: CellType;\n\n // ── badge ──\n /**\n * Maps a cell value (or full item) to a { label, variant } config.\n * When omitted, auto-color is applied using the value string.\n * Return null to render a plain '—' instead of a badge (e.g. for an empty value).\n */\n badgeFn?: (value: any, item?: any) => BadgeConfig | null;\n\n // ── star (text cells, e.g. the name column) ──\n /**\n * Puts a gold `<ui-star>` to the LEFT of the cell's text when it returns a non-empty string; that string is the star's tooltip\n * (hover / keyboard focus) and accessible name. Return null / undefined / '' for no star. The star is always gold.\n * Applies to plain text cells (and the title of the phone card); the row's accessible name is unchanged (`nameFn` / `render`).\n * Example: `{ key: 'name', label: 'Name', starFn: (doc) => doc.isAuthForm ? 'Authorization Form' : null }`\n */\n starFn?: (item: any) => string | null | undefined;\n\n // ── leading icon (text-like cells) ──\n /**\n * Library source 2026-11-05, not yet published. Draws a small decorative icon (16px, `aria-hidden`, currentColor, on the first text line, never shrinks)\n * to the LEFT of the cell text, in desktop cells and in the phone card (title, badge pills, detail rows). Returns a `<ui-icon>` key (see `iconPath()`) or a\n * raw 24x24 stroke SVG path (drawing commands and numbers only, same rule as ui-radio's `icon`); null / undefined / '' / anything else draws nothing.\n * Applies to text, badge, date, phone and number cells; never to avatar-name, link, tags, progress, image, days-ago or actions. The cell's text and the row's\n * accessible name are unchanged (see `iconLabelFn` for meaningful icons). Placed before a `starFn` star.\n * Example: `{ key: 'name', label: 'Name', iconFn: (r) => r.kind === 'rental' ? 'wrench' : 'cup' }`\n */\n iconFn?: (item: any) => string | null | undefined;\n /**\n * Library source 2026-11-05, not yet published. Accessible text for a MEANINGFUL `iconFn` icon: rendered as visually hidden text right after the icon\n * (the icon stays `aria-hidden`). Default (absent / null / '') = the icon is decorative. Ignored when no icon is drawn for the row.\n */\n iconLabelFn?: (item: any) => string | null | undefined;\n\n // ── footer totals ──\n /**\n * Footer text for this column, from the table's `totalsEndpoint` response (shown only while the table has rows and the totals loaded).\n * Return null / undefined / '' for an empty footer cell. `cellType: 'number'` columns are right-aligned like their body cells.\n * The table's `totalsLabel` goes in the footer cell of the first visible column; when that column has a `footerFn` too, the label is\n * kept as visually hidden text before the value (\"Total: $1,200\") so it is still announced once.\n * Example: `{ key: 'amount', label: 'Amount', cellType: 'number', footerFn: t => t['amount'] == null ? null : '$' + t['amount'] }`\n */\n footerFn?: (totals: Record<string, string | number | null>) => string | null | undefined;\n\n // ── date ──\n /** Date format string. Default: 'MMM d, y' */\n dateFormat?: string;\n\n // ── avatar-name ──\n /** Returns the display name for the row. Default: item[col.key] */\n nameFn?: (item: any) => string;\n /** Returns initials for the avatar. Default: first char of nameFn result */\n initialsFn?: (item: any) => string;\n\n // ── days-ago ──\n /** Key in item holding the days-since count. Defaults to col.key. */\n daysKey?: string;\n /** Days after which the cell is styled as overdue. Default: 30 */\n overdueThreshold?: number;\n\n // ── progress ──\n /**\n * Maps a row to a progress bar. Return null to render a plain '—' (e.g. nothing to track).\n * `label` is the text beside the bar (e.g. \"3/5\"); `tooltip` is the hover text. `ariaLabel` is the bar's accessible name (e.g. the row's name + \" cap progress\"); leave it out and the bar is named by its `label` text — which, with only \"80%\" to go on, tells a screen-reader user nothing about WHICH row it belongs to, so set it whenever several rows show a bar. Leave `variant` out and the bar colors itself by completion (red / amber / blue / green).\n */\n progressFn?: (item: any) => { value: number; max: number; label?: string; variant?: 'blue' | 'green' | 'amber' | 'red' | 'slate'; tooltip?: string; ariaLabel?: string } | null;\n\n // ── tags ──\n /** Key in item holding the tags array. Defaults to col.key.\n * Expected shape: { name: string; variant?: BadgeVariant; color?: string; colorName?: string }[]. `colorName` is the colour (or state) in words, e.g. 'red' or 'error': it is read by screen readers after the tag name (hidden visually) so the colour is never the only signal; omit it and nothing changes. `color` is a custom hex colour (`#rgb` / `#rrggbb`,\n * e.g. the colour a user picked for the tag): it becomes the chip background with dark or white text for contrast and wins over `variant`;\n * an invalid value is ignored. */\n tagsKey?: string;\n\n // ── link ──\n /**\n * `cellType: 'link'` — returns where the cell points for a row (`value` is `item[key]`), or null / undefined /\n * '' for no link (the cell then shows plain text). A string is shorthand for `{ href }`. See {@link LinkTarget}\n * for the contract and the allowed schemes. Text shown: `render(item)` if set, else `item[key]`, else the\n * target's `label`, else '—'. The text is always escaped. A throwing `linkFn` renders plain text.\n * Sorting, search, filters and export are independent of the link (export uses the host's `exportRow`).\n * Clicking or keying the anchor never emits `rowClick`; it emits `(linkClick)`.\n */\n linkFn?: (item: any, value: any) => LinkTarget | string | null | undefined;\n\n // ── image ──\n /** Returns the image URL for the row. A falsy value (null / undefined / '') shows the placeholder icon. */\n imageFn?: (item: any) => string | null | undefined;\n /** Focal point (percent, 50/50 = centered) of the cropped image, applied as CSS object-position. */\n imagePositionFn?: (item: any) => { x: number | null | undefined; y: number | null | undefined } | null | undefined;\n /** Alt text for the row's image. When omitted the image is decorative (`alt=\"\"`). */\n imageAlt?: (item: any) => string;\n /** 'circle' (default) or 'rounded' (3:2 rounded rectangle). */\n imageShape?: 'circle' | 'rounded';\n /** 'md' (default) or 'sm'. circle: 40px / 28px; rounded: 48x32 / 36x24. */\n imageSize?: 'sm' | 'md';\n /** Neutral icon shown when there is no URL or the image fails to load. Default: 'image'. */\n imagePlaceholder?: 'person' | 'image';\n\n // ── actions ──\n /** Returns the list of actions for a given row item. */\n actionsFn?: (item: any) => RowAction[];\n /** Called when the user clicks an action. */\n onAction?: (type: string, item: any) => void;\n\n // ── fallback ──\n /** Custom plain-text render function. Only used for 'text' type. */\n render?: (item: any) => string;\n\n // ── mobile ──\n /** Hide this column in the card-view detail rows on mobile (≤640px).\n * The title (avatar-name) and badge columns are always shown. */\n mobileHidden?: boolean;\n}\n\n// ── Quick filter tab ──────────────────────────────────────────\nexport interface QuickFilterTab {\n value: string;\n label: string;\n /** When true, the tab is shown as informational only and cannot be clicked. */\n disabled?: boolean;\n}\n\n// ── Column filter ─────────────────────────────────────────────\nexport interface FilterOption {\n value: string;\n label: string;\n color?: string;\n count?: number;\n}\n\n// ── Saved view ────────────────────────────────────────────────\nexport interface SavedView {\n id: string;\n name: string;\n isSystem?: boolean;\n /** Active quick-filter tab value at time of save */\n quickFilter?: string | null;\n /** Active sort column key at time of save */\n sortField?: string | null;\n /** Sort direction at time of save */\n sortDir?: string | null;\n /** Visible column keys at time of save (empty = use defaultVisible) */\n visibleColumns?: string[];\n /**\n * Active column filters at time of save: column key → comma-joined selected values (the same wire format the\n * table sends as query params). `undefined`/`null` (views saved before this existed, or a backend that doesn't\n * store it) leaves the current column filters untouched on load; `{}` clears them.\n */\n columnFilters?: Record<string, string> | null;\n /**\n * Active numeric range filters at save time (only tables with `rangeFilters`): column key -> `{ min, max }` (a bound is a number or\n * absent). Written only when a range is set. `undefined` / `null` (views saved before ranges existed, or a backend that doesn't store\n * it) leaves the current ranges untouched on load; `{}` clears them.\n */\n rangeFilters?: Record<string, { min?: number | null; max?: number | null }> | null;\n}\n\n// ── Numeric range column filter ───────────────────────────────\n\n/**\n * One `<ui-data-table [rangeFilters]>` entry: gives the visible column `key` a numeric Min / Max filter (same funnel icon and popover as\n * the value-list filter). Opt-in at the TABLE: a column that is not listed (or is hidden) has no range filter, and an empty list changes\n * nothing. When applied, the table sends `<minParam>=<n>` and `<maxParam>=<n>` (a bound that is empty is omitted) on the rows, export and\n * totals requests (not on /counts or /filter-counts, like every column filter); the BACKEND does the filtering.\n *\n * readonly rangeFilters: RangeFilterConfig[] = [{ key: 'rentableSf', minParam: 'rentableSfMin', maxParam: 'rentableSfMax', min: 0, step: 100, format: 'number' }];\n */\nexport interface RangeFilterConfig {\n /** Key of a column of the table. */\n key: string;\n /** Query param for the lower bound. Default `<key>Min`. */\n minParam?: string;\n /** Query param for the upper bound. Default `<key>Max`. */\n maxParam?: string;\n /** Lowest value the user may enter (default 0, so negatives are refused; pass a negative number to allow them). */\n min?: number;\n /** Highest value the user may enter (default: no limit). */\n max?: number;\n /** Step of the number fields; also sets the decimals allowed (step 0.01 = 2 decimals, whole-number steps = whole numbers). Default 1. */\n step?: number;\n /** How bounds are written in the chip / active label: plain number (default), US dollars or a percent. Values sent are always plain numbers. */\n format?: 'number' | 'currency' | 'percent';\n /** Text appended to a bound in the label when `format` is 'number' (e.g. 'SF'). */\n unit?: string;\n}\n\n// ── Bulk actions ──────────────────────────────────────────────\n\n/**\n * Declares a bulk action available in the table's selection bar.\n * Options for select-based actions are derived automatically from the table's\n * column configuration (columnFilters → quickFilterTabs → filterCounts → distinct values).\n */\n/**\n * One `bulkUpdateOptions` entry:\n * - `'delete'` — the built-in bulk delete;\n * - a column key (e.g. `'status'`) — \"Change <column label>\" with options from /filter-counts;\n * - `{ field, exclude }` — the same, minus values users can't set by hand (e.g. a status only the\n * system sets). Excluded values are left out of the bulk select only — the column filter, quick-filter\n * tabs and counts still show them. Matching ignores case, spaces, dashes and underscores.\n *\n * readonly bulkUpdateOptions: BulkUpdateOption[] = [{ field: 'status', exclude: ['EXPIRED'] }, 'delete'];\n * - `{ field, allowedFrom }` — the status workflow: a map of TARGET value -> the values a row may currently\n * have to move to it, e.g. `{ SENT: ['DRAFT'], VOIDED: ['DRAFT', 'SENT'] }`. The bulk select then offers only\n * targets that at least one selected row can legally move to (a target with no entry is not selectable), and rows\n * whose current value is not in the target's list are skipped (counted, never sent). Without `allowedFrom` every\n * row can move to any value it does not already have. Combine with `exclude` freely (exact, case-sensitive values).\n *\n * { field: 'status', allowedFrom: { SENT: ['DRAFT'], VOIDED: ['DRAFT', 'SENT'] } }\n */\nexport type BulkUpdateOption<T = any> = string | {\n field: string;\n /**\n * Field changes (`{ field, label }`): the bulk bar button text instead of \"Change <column label>\", e.g. `{ field: 'state', label: 'Archive / Restore' }`.\n * It is also the inline select's accessible name, the default confirm's title and confirm button, and the default confirm message reads\n * \"<label>: <option> for N items?\" (instead of \"Change <column> to <option> for N items?\"). Host `confirm` copy still wins; its\n * `ctx.columnLabel` stays the column's label. Trimmed; blank = ignored. Ignored for the reserved `delete` key. Omit it and nothing changes.\n * Direct actions (`action: true`): the bar button text, default confirm title and confirm button (required in practice; trimmed,\n * blank = the key split on `_`, `-` and camelCase with only the first word capitalised: 'resend' -> 'Resend', 'send_reminder' / 'sendReminder' -> 'Send reminder'); `ctx.columnLabel` is this label.\n *\n * { field: 'state', label: 'Archive / Restore' }\n */\n label?: string;\n exclude?: string[];\n allowedFrom?: Record<string, string[]>;\n /**\n * Host-written confirm copy (see `BulkConfirmFn`): one function for every target value, or a map target value -> function\n * (a target without an entry keeps the library's default wording). For the reserved delete key use\n * `{ field: 'delete', confirm }`. Omit it and the confirm keeps today's default wording.\n */\n confirm?: BulkConfirmFn<T> | Record<string, BulkConfirmFn<T>>;\n /**\n * Bulk Delete only (`{ field: 'delete', deletable }`): true when the server will accept deleting this row. Keep it identical\n * to the backend rule. Only deletable rows are counted in the confirm, sent to `/bulk/delete` and shown as deleted; the others\n * are skipped (\"N selected rows can't be deleted and will be skipped.\"). The Delete button is disabled (with a reason) when\n * no selected row is deletable. Omit it and every selected row is sent, as before.\n *\n * { field: 'delete', deletable: (row: Invoice) => row.status === 'DRAFT' }\n */\n deletable?: (row: T) => boolean;\n /**\n * Field changes (`{ field, canChange }`): true when the server will accept moving THIS row to `target` (a value the select offers).\n * For rules the field values alone can't express, e.g. a draft can only be sent when it has a document and a recipient. Keep it\n * identical to the backend rule. Rows it refuses are skipped like rows `allowedFrom` refuses (\"N selected rows can't be changed to X\n * and will be skipped.\" / `ctx.skippedBlocked` + `ctx.skippedRows` for host `confirm` copy), are never sent, and a target is offered\n * only while some selected row can move to it. It runs after `allowedFrom` and only sees rows on the loaded page. Omit it and\n * nothing changes.\n *\n * { field: 'status', allowedFrom: { SENT: ['DRAFT'] }, canChange: (row, target) => target !== 'SENT' || canSend(row) }\n */\n canChange?: (row: T, target: string) => boolean;\n /**\n * Field changes (`{ field, skipReason }`): WHY a row is skipped, in the host's words. Called for every selected row that will be skipped because it cannot move to `target`\n * (`allowedFrom` / `canChange` refused it; a row that already holds the target is NOT asked: the standard \"already has this value\" wording covers it) with the row and the\n * target value. Return a short plain sentence (\"Needs a document and a recipient first.\") or `null` / `''` for no reason. A function that throws counts as no reason.\n * The reasons are grouped (the same text is one line with the number of rows: \"Needs a document and a recipient first. (3)\"), listed as bullets in the confirm (`confirm-details`,\n * after the host's own `details`), and passed to a host `confirm` function as `ctx.skippedReasons` (one entry per row, so the copy can name them). It only sees rows on the loaded\n * page. It changes no rule: it never makes a row skipped or eligible. Omit it and nothing changes.\n *\n * { field: 'status', allowedFrom: { SENT: ['DRAFT'] }, canChange: (row, target) => target !== 'SENT' || canSend(row),\n * skipReason: (row, target) => (target === 'SENT' && row.status === 'DRAFT' && !canSend(row)) ? 'Needs a document and a recipient first.' : null }\n */\n skipReason?: (row: T, target: string) => string | null | undefined;\n /**\n * Field changes (`{ field, canApply }`): a rule on the WHOLE selection, in addition to the per-row `allowedFrom` / `canChange`. Called with every\n * selected row of the loaded page and the target value; return `true` to allow, `false` (generic reason) or a string (the reason shown to the\n * user) to refuse. Use it for a rule no single row can express (\"an Archived invoice batch must all belong to one customer\", \"all rows must\n * share the same status\"). Keep it identical to the backend rule. A target it refuses is listed in the select but disabled, with a visible\n * \"<option>: <reason>\" hint, and Apply re-checks it (a refused target is never confirmed or sent; the reason is shown as an error toast). A function that throws counts as\n * refused. It only sees rows on the loaded page. Ignored for Delete and direct actions. Omit it and nothing changes.\n *\n * { field: 'status', canApply: (rows, target) => target !== 'MERGED' || new Set(rows.map(r => r.customerId)).size === 1 || 'Rows must belong to one customer.' }\n */\n canApply?: (rows: T[], target: string) => boolean | string;\n /**\n * Field changes (`{ field, listAll }`): list the FULL set of values in the \"Change <column>\" select instead of only the values the\n * /filter-counts response currently carries (which omits values no row has yet). `true` = the filter-count values plus every target of\n * `allowedFrom` that is not already listed; a list of values = exactly that set, in that order (labelled through the column's `badgeFn`). The\n * `exclude`, `allowedFrom`, `canChange` and `canApply` rules and the \"not already held by every selected row\" rule still apply, so listing a\n * value never offers a change the table knows the server refuses. An empty list is ignored. Omit it and nothing changes.\n *\n * { field: 'status', listAll: ['DRAFT', 'SENT', 'SIGNED', 'VOIDED'], allowedFrom: { SENT: ['DRAFT'], SIGNED: ['SENT'], VOIDED: ['DRAFT', 'SENT'] } }\n */\n listAll?: true | readonly string[];\n /**\n * Field changes (`{ field, order }`): the order of the \"Change <column>\" select. Values listed in `order` come first, in that order (matched\n * exactly to the option values, case-sensitive); the remaining options follow in their existing order. Values in `order` that are not among\n * the options are ignored (nothing is added). It only sorts: `exclude`, `allowedFrom`, `canChange`, `canApply`, `listAll` and the \"not already\n * held by every selected row\" rule decide WHICH options appear. Ignored for Delete and direct actions. Omit it and nothing changes.\n *\n * { field: 'type', order: ['office', 'retail', 'industrial', 'multifamily'] }\n */\n order?: readonly string[];\n /**\n * Direct bulk action (`{ field: 'resend', action: true, label: 'Resend' }`): a bulk-bar button that is neither a field change nor\n * Delete. `field` is the action key (no column needed), the button type is `action-<field>` and there is no inline select.\n * Clicking it opens the library confirm, then POSTs `<endpoint>/bulk/<field>` with exactly `{ ids }` (the eligible rows). The response is\n * handled like a field change (`updated`, `skipped`, `notAllowed`, readable `message`). Ignored for the reserved `delete` key.\n * Read-only users get no bulk bar, so nothing changes for them. Omit it and nothing changes.\n * `confirm` on an action takes only the function form; a map (target value -> function) is ignored and the default copy is used.\n *\n * { field: 'resend', action: true, label: 'Resend', eligible: (row: Request) => row.status === 'PENDING' }\n */\n action?: boolean;\n /** Direct action only: button style, default 'secondary'. 'danger' also makes the default confirm button red. */\n variant?: 'secondary' | 'danger';\n /**\n * Direct action only: true when the server will accept the action for this row (keep it identical to the backend rule). Rows it\n * refuses are skipped (counted, NEVER sent; \"N selected rows don't qualify for <label lower-cased> and will be skipped.\"). When no selected loaded row passes,\n * the button is disabled with a visible reason (\"None of the selected rows qualify for <label lower-cased>.\"). Omit it and every selected row is sent. A predicate that throws counts as \"row not eligible\" (never breaks rendering).\n */\n eligible?: (row: T) => boolean;\n /**\n * Direct action only: the past-tense word in the result toast. \"N <doneLabel>, M skipped.\" when anything was skipped / not allowed,\n * else \"N <itemLabel>(s) <doneLabel>.\". Default 'updated'.\n * English keeps the past-tense word ('resent' -> \"N contacts resent.\"). In Spanish the summary reads \"<doneLabel>: N <items>.\" and the word is\n * a capitalised NOUN, not a participle: pass 'Reenvío' (\"Reenvío: 3 contactos.\"), not 'enviados' (\"enviados: 3 contactos.\"). The built-in\n * default ('updated') is translated by the dictionary and needs nothing.\n */\n doneLabel?: string;\n /**\n * Direct action only: the request returns a FILE instead of JSON (a ZIP of PDFs, a CSV...). The table still confirms first and POSTs\n * `<endpoint>/bulk/<field>` with exactly `{ ids }`, but asks for a blob response and saves it as one download (one file, so browsers do not\n * block it the way several automatic downloads are blocked). The file name is the response's `Content-Disposition` filename, else\n * `fileName`, else the action key. The toast reads \"N <itemLabel>(s) <doneLabel>.\" (`doneLabel` defaults to 'downloaded' here); the server may\n * send an `X-Skipped-Count` header with the number of selected rows it left out of the file (\"N downloaded, M skipped.\"). The rows do not change,\n * so the table is not refreshed; the selection is cleared and `(bulkAction)` is emitted. An error response is read as `{ message }` JSON and shown\n * in an error toast. Omit it and the action expects JSON as before.\n *\n * { field: 'download-pdfs', action: true, label: 'Download PDFs', download: { fileName: 'inspections.zip' } }\n */\n download?: { fileName?: string };\n /**\n * Direct action only (`opens: 'panel'`): the button does not confirm and does not POST. It emits `(bulkPanelClick)` with the\n * eligible rows and the host opens its own panel or form (compose an e-mail, add a charge...) and does the work itself.\n * The host calls `clearSelection()` and `refresh()` on the table when it is done. `confirm` and `doneLabel` are ignored for a panel action (no confirm is shown; `variant: 'danger'` still colours the button); `eligible` still applies (refused rows are never passed on). Omit it and nothing changes.\n *\n * { field: 'email', action: true, opens: 'panel', label: 'Email', eligible: (r: Resident) => !!r.email }\n */\n opens?: 'panel';\n /**\n * Panel action only (`opens: 'panel'`): true while the action is not available right now (e.g. text messaging is switched off). The button is\n * then not shown at all. Read every time the bar renders, so it can read signals; a function that throws counts as \"not hidden\". A panel\n * action is also not shown while none of the selected rows is `eligible`. Omit it and the button shows whenever a selected row is eligible.\n */\n hidden?: () => boolean;\n};\n\n/** What a bulk confirm function receives. For a direct bulk action: `columnLabel` is the action label, `targetValue`/`targetLabel` are '', `rows`/`skippedRows` the eligible / refused selected rows. For bulk Delete: `targetValue`/`targetLabel` are '', `columnLabel` is 'Delete', skipped counts are 0. */\nexport interface BulkConfirmContext<T = any> {\n /** Rows that WILL be sent (eligible). For Delete: the selected count. */\n count: number;\n /** Selected rows skipped because they already hold the target value. */\n skippedAlready: number;\n /** Selected rows skipped because `allowedFrom` does not allow the move. */\n skippedBlocked: number;\n /** Everything the user selected (`count + skippedAlready + skippedBlocked`). */\n selectedCount: number;\n /** Singular / plural item label (the table's `itemLabel` / `itemLabelPlural`). */\n itemLabel: string;\n itemLabelPlural: string;\n /** Label of the column being changed (\"Status\"). */\n columnLabel: string;\n /** Raw target value (\"APPROVED\") and its display label (\"Approved\"). */\n targetValue: string;\n targetLabel: string;\n /**\n * The eligible row objects (name records, show before -> after). A selection never spans pages (any reload clears it and\n * select-all takes the loaded page), so these are every row that will be sent.\n */\n rows: T[];\n /** The selected rows that will be skipped. */\n skippedRows: T[];\n /**\n * Field changes with a `skipReason` callback: one `{ row, reason }` per skipped row the callback gave a reason for (trimmed, single line, at most 300 characters; rows that already hold the\n * target value are not asked). Empty when the entry has no `skipReason`; always `[]` for Delete and direct actions. The library already lists the grouped reasons in the confirm; use this to\n * word the message yourself (`omitSkippedNote`).\n */\n skippedReasons?: { row: T; reason: string }[];\n}\n\n/** Host copy for one bulk confirm. Plain text only (never HTML); `\\n` in `message` shows as a line break. */\nexport interface BulkConfirmCopy {\n /** Default: the action label (\"Change Status\") / \"Delete <Items>\" built from the table's item label (\"template\" → \"Delete Templates\"). */\n title?: string;\n message: string;\n /** Rendered as a bullet list under the message (consequences, what is NOT affected, undoable or not). */\n details?: string[];\n /** Default: the action label / \"Delete\". */\n confirmLabel?: string;\n /** Default: 'primary' for a field change, 'danger' for Delete. 'danger' makes the confirm button red. */\n variant?: 'primary' | 'danger' | 'warning';\n /** By default the library appends its standard \"N selected rows ... will be skipped.\" sentence (change actions); set true to write it yourself. */\n omitSkippedNote?: boolean;\n}\n\nexport type BulkConfirmFn<T = any> = (ctx: BulkConfirmContext<T>) => BulkConfirmCopy | string;\n\nexport interface BulkActionDef {\n /** Action key — passed through to the (bulkAction) event. */\n type: string;\n /** Button label shown in the bulk bar. */\n label: string;\n /** True when `label` came from the entry's custom `label` (the default confirm message then reads \"<label>: <option> for N items?\"). Only set then. */\n customLabel?: boolean;\n /** Button style. Default: 'secondary'. Use 'danger' for destructive actions. */\n variant?: 'secondary' | 'danger';\n /** Values left out of this field's bulk select (from a `{ field, exclude }` bulkUpdateOptions entry). */\n exclude?: string[];\n /** Workflow rules (from `{ field, allowedFrom }`): target value -> source values a row may move from. */\n allowedFrom?: Record<string, string[]>;\n /** Host confirm copy (from `{ field, confirm }`). */\n confirm?: BulkConfirmFn | Record<string, BulkConfirmFn>;\n /** Bulk Delete only: which rows the server will delete (from `{ field: 'delete', deletable }`). */\n deletable?: (row: any) => boolean;\n /** Field changes: per-row check that the server will accept the move to a target (from `{ field, canChange }`). */\n canChange?: (row: any, target: string) => boolean;\n /** Field changes: why a skipped row is skipped (from `{ field, skipReason }`). */\n skipReason?: (row: any, target: string) => string | null | undefined;\n /** Field changes: rule on the whole selection (from `{ field, canApply }`): true = allowed, false / a string = refused (the string is the reason). */\n canApply?: (rows: any[], target: string) => boolean | string;\n /** Field changes: list the full value set (from `{ field, listAll }`): `true` or the exact list of values. */\n listAll?: true | readonly string[];\n /** Field changes: option order (from `{ field, order }`): these values first, in this order. */\n order?: readonly string[];\n /** True for a direct bulk action (from `{ field, action: true, label }`); `type` is `action-<key>` and `field` is not set (no inline select). */\n action?: boolean;\n /** Direct action: which rows the server will accept (from `{ field, action: true, eligible }`). */\n eligible?: (row: any) => boolean;\n /** Direct action: past-tense word in the result toast (from `{ doneLabel }`), default 'updated'. */\n doneLabel?: string;\n /** Direct action that returns a file (from `{ download }`): the response is saved as a download instead of read as JSON. */\n download?: { fileName?: string };\n /** True for a direct action that opens a host panel instead of confirming and POSTing (from `{ opens: 'panel' }`). */\n opensPanel?: boolean;\n /** Panel action: true while it is not available (from `{ hidden }`); the button is not shown. */\n hidden?: () => boolean;\n /**\n * The item field this action targets (e.g. 'status', 'type').\n * When set the table shows an inline select populated from the column's option sources.\n * Omit for direct actions like delete that need no value selection.\n */\n field?: string;\n}\n\n/** Emitted by (bulkAction) after the user selects a value and clicks Apply. */\nexport interface BulkActionEvent {\n type: string;\n ids: string[];\n value?: string;\n skippedCount: number;\n}\n\n/** Emitted by (bulkPanelClick) when the user clicks a bulk action declared with `opens: 'panel'`. */\nexport interface BulkPanelEvent<T = any> {\n /** `action-<key>` of the clicked bulk option. */\n type: string;\n /** The option's `field` (its key), e.g. 'email'. */\n key: string;\n /** Ids of the eligible selected rows. */\n ids: string[];\n /** The eligible selected rows (loaded page). */\n rows: T[];\n /** Selected rows the option's `eligible` refused. */\n skippedCount: number;\n}\n\n/** Emitted by (rowReorder) after the user moves a row (`reorderable`). */\nexport interface TableRowReorderEvent<T = any> {\n /** The row that was moved. */\n item: T;\n /** Its index on the page before and after the move (0-based). */\n from: number;\n to: number;\n /** The rows on the page in their new order. */\n items: T[];\n /** How many rows come before this page (0 on the first page), so `offset + to` is the row's position in the whole list. */\n offset: number;\n}\n\n// ── Page response from backend ────────────────────────────────\nexport interface PageResponse<T> {\n content: T[];\n totalElements: number;\n totalPages: number;\n number: number;\n size: number;\n}\n"],"mappings":";;AAUA,MAAa,iBAAiB,IAAI,eAAuC,gBAAgB;AAUzF,MAAa,uBAA4E;CACvF,OAAS;EAAE,IAAI;EAAW,OAAO;CAAS;CAC1C,MAAS;EAAE,IAAI;EAAW,OAAO;CAAS;CAC1C,KAAS;EAAE,IAAI;EAAW,OAAO;CAAS;CAC1C,OAAS;EAAE,IAAI;EAAW,OAAO;CAAS;CAC1C,QAAS;EAAE,IAAI;EAAW,OAAO;CAAS;CAC1C,MAAS;EAAE,IAAI;EAAW,OAAO;CAAS;CAC1C,MAAS;EAAE,IAAI;EAAW,OAAO;CAAS;CAC1C,MAAS;EAAE,IAAI;EAAW,OAAO;CAAS;CAC1C,QAAS;EAAE,IAAI;EAAW,OAAO;CAAS;CAC1C,QAAS;EAAE,IAAI;EAAW,OAAO;CAAS;CAC1C,MAAS;EAAE,IAAI;EAAW,OAAO;CAAS;CAC1C,MAAS;EAAE,IAAI;EAAW,OAAO;CAAS;CAC1C,MAAS;EAAE,IAAI;EAAW,OAAO;CAAS;CAC1C,OAAS;EAAE,IAAI;EAAW,OAAO;CAAS;CAC1C,SAAS;EAAE,IAAI;EAAW,OAAO;CAAS;CAC1C,KAAS;EAAE,IAAI;EAAW,OAAO;CAAS;CAC1C,SAAS;EAAE,IAAI;EAAW,OAAO;CAAS;CAC1C,QAAS;EAAE,IAAI;EAAW,OAAO;CAAS;CAC1C,QAAS;EAAE,IAAI;EAAW,OAAO;CAAS;CAC1C,OAAS;EAAE,IAAI;EAAW,OAAO;CAAS;CAC1C,MAAS;EAAE,IAAI;EAAW,OAAO;CAAS;CAC1C,OAAS;EAAE,IAAI;EAAW,OAAO;CAAS;CAC1C,QAAS;EAAE,IAAI;EAAW,OAAO;CAAS;CAC1C,MAAS;EAAE,IAAI;EAAW,OAAO;CAAS;CAC1C,MAAS;EAAE,IAAI;EAAW,OAAO;CAAS;CAC1C,OAAS;EAAE,IAAI;EAAW,OAAO;CAAS;CAC1C,MAAS;EAAE,IAAI;EAAW,OAAO;CAAS;CAC1C,OAAS;EAAE,IAAI;EAAW,OAAO;CAAS;CAC1C,QAAS;EAAE,IAAI;EAAW,OAAO;CAAS;CAC1C,MAAS;EAAE,IAAI;EAAW,OAAO;CAAS;CAC1C,MAAS;EAAE,IAAI;EAAW,OAAO;CAAS;CAC1C,QAAS;EAAE,IAAI;EAAW,OAAO;CAAS;CAC1C,OAAS;EAAE,IAAI;EAAW,OAAO;CAAS;CAC1C,QAAS;EAAE,IAAI;EAAW,OAAO;CAAS;CAC1C,MAAS;EAAE,IAAI;EAAW,OAAO;CAAS;AAC3C;AAOD,MAAa,qBAA6D;CAExE,UAAoB;CACpB,YAAoB;CACpB,OAAoB;CACpB,YAAoB;CACpB,UAAoB;CAEpB,WAAoB;CACpB,eAAoB;CACpB,aAAoB;CACpB,YAAoB;CACpB,SAAoB;CACpB,UAAoB;CAEpB,WAAoB;CACpB,WAAoB;CACpB,WAAoB;CACpB,SAAoB;CACpB,UAAoB;CACpB,YAAoB;CACpB,YAAoB;CAEpB,QAAoB;CACpB,aAAoB;CACpB,UAAoB;CACpB,WAAoB;CACpB,WAAoB;CACpB,aAAoB;CAEpB,UAAoB;CACpB,aAAoB;CACpB,WAAoB;CACpB,YAAoB;CACpB,UAAoB;CACpB,QAAoB;CAEpB,QAAoB;CACpB,UAAoB;CACpB,OAAoB;CAEpB,WAAoB;CACpB,YAAoB;CAEpB,OAAoB;CACpB,MAAoB;CACpB,YAAoB;CACpB,aAAoB;CAEpB,QAAoB;CACpB,SAAoB;AACrB;AAMD,MAAa,wBAAgE;CAC3E,UAAU;CAAS,YAAY;CAAQ,WAAW;CAAQ,eAAe;CAAO,iBAAiB;CAAO,WAAW;CACnH,aAAa;CAAQ,eAAe;CAAQ,cAAc;CAAW,YAAY;CAAS,YAAY;CAAS,WAAW;CAC1H,UAAU;CAAS,eAAe;CAAQ,aAAa;CAAO,oBAAoB;CAAS,oBAAoB;CAAQ,aAAa;CAAQ,aAAa;CACzJ,WAAW;CAAQ,aAAa;CAAS,WAAW;CAAQ,YAAY;CAAW,YAAY;CAAS,cAAc;CACtH,WAAW;CAAO,aAAa;CAAQ,WAAW;CAAU,aAAa;CAAO,WAAW;CAAW,UAAU;CAChH,QAAQ;CAAO,SAAS;CAAS,QAAQ;CACzC,YAAY;CAAQ,YAAY;CAChC,MAAM;CAAS,UAAU;CAAS,aAAa;CAC/C,SAAS;CAAU,sBAAsB;AAC1C;AAED,MAAM,aAAa,UAA0B,MAAM,UAAU,KAAK,CAAC,CAAC,QAAQ,oBAAoB,EAAE,CAAC,CAAC,KAAI,CAAE,CAAC,YAAW;AACtH,MAAM,qBAAwD,IAAI,IAAI,OAAO,QAAQ,qBAAqB,CAAC,CAAC,KAAK,CAAC,GAAG,OAAO,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC;AAO9I,SAAgB,qBAAqB,OAAkC,SAAiB,SAAQ,GAAE;CAChG,IAAI,CAAC,OAAO,OAAO;CACnB,MAAM,QAAQ,mBAAmB;CACjC,IAAI,OAAO,OAAO;CAClB,OAAO,OAAO,YAAW,CAAE,CAAC,WAAW,IAAI,IAAI,mBAAmB,IAAI,UAAU,KAAK,CAAC,IAAI;AAC5F;AAGA,MAAM,qBAAqC;CACzC;CAAS;CAAQ;CAAQ;CAAQ;CAAO;CAAS;CAAQ;CACzD;CAAS;CAAU;CAAU;CAAQ;CAAU;CAAW;CAC1D;CAAQ;CAAS;CAAS;CAAQ;CAAS;CAAW;CAAQ;CAC9D;CAAU;CAAS;CAAQ;CAAU;AACtC;AAMD,SAAgB,YAAY,OAAa;CACvC,IAAI,OAAO;CACX,KAAK,IAAI,IAAI,GAAG,IAAI,MAAM,QAAQ,KAChC,OAAQ,OAAO,KAAK,MAAM,WAAW,CAAC,IAAK;CAE7C,OAAO,mBAAmB,KAAK,IAAI,IAAI,IAAI,mBAAmB;AAChE"}
|
|
1
|
+
{"version":3,"file":"forgeroute-ui-table-types.mjs","names":[],"sources":["../../../projects/forgeroute-ui/table-types/src/lib/data-table/data-table.types.ts"],"sourcesContent":["import { InjectionToken, WritableSignal } from '@angular/core';\nimport { uiLocale } from '@forgeroute/ui/core';\n\nexport type SortDir = 'asc' | 'desc';\n\n/**\n * Shared signal provided at the DataTableComponent level.\n * Holds the ID of the currently-open dropdown. When any dropdown\n * opens it sets this to its own ID — all others react and close.\n */\nexport const DROPDOWN_GROUP = new InjectionToken<WritableSignal<string>>('DROPDOWN_GROUP');\n\n// ── Badge ──────────────────────────────────────────────────────\nexport type BadgeVariant =\n | 'green' | 'blue' | 'red' | 'amber' | 'purple' | 'gray' | 'teal' | 'pink'\n | 'indigo' | 'orange' | 'cyan' | 'lime' | 'rose' | 'slate'\n | 'emerald' | 'sky' | 'fuchsia' | 'yellow' | 'violet' | 'stone'\n | 'mint' | 'steel' | 'bronze' | 'plum' | 'sage' | 'coral' | 'sand' | 'ocean' | 'pewter'\n | 'gold' | 'jade' | 'sienna' | 'mauve' | 'walnut' | 'navy';\n\nexport const BADGE_VARIANT_STYLES: Record<BadgeVariant, { bg: string; color: string }> = {\n green: { bg: '#dcfce7', color: '#166534' },\n blue: { bg: '#dbeafe', color: '#1e40af' },\n red: { bg: '#fee2e2', color: '#991b1b' },\n amber: { bg: '#fef3c7', color: '#92400e' },\n purple: { bg: '#fff1f2', color: '#881337' },\n gray: { bg: '#f1f5f9', color: '#475569' },\n teal: { bg: '#ccfbf1', color: '#115e59' },\n pink: { bg: '#fce7f3', color: '#be185d' },\n indigo: { bg: '#bfdbfe', color: '#1e3a8a' },\n orange: { bg: '#ffedd5', color: '#9a3412' },\n cyan: { bg: '#cffafe', color: '#155e75' },\n lime: { bg: '#ecfccb', color: '#3f6212' },\n rose: { bg: '#ffe4e6', color: '#9f1239' },\n slate: { bg: '#e2e8f0', color: '#334155' },\n emerald: { bg: '#d1fae5', color: '#065f46' },\n sky: { bg: '#e0f2fe', color: '#0c4a6e' },\n fuchsia: { bg: '#fdf4ff', color: '#a21caf' },\n yellow: { bg: '#fef9c3', color: '#854d0e' },\n violet: { bg: '#fefce8', color: '#713f12' },\n stone: { bg: '#f5f5f4', color: '#57534e' },\n mint: { bg: '#d1fae5', color: '#047857' },\n steel: { bg: '#cbd5e1', color: '#1e293b' },\n bronze: { bg: '#fde68a', color: '#78350f' },\n plum: { bg: '#f5f5f4', color: '#44403c' },\n sage: { bg: '#d9f99d', color: '#4d7c0f' },\n coral: { bg: '#fecdd3', color: '#be123c' },\n sand: { bg: '#e7e5e4', color: '#44403c' },\n ocean: { bg: '#bae6fd', color: '#075985' },\n pewter: { bg: '#d4d4d8', color: '#3f3f46' },\n gold: { bg: '#fbbf24', color: '#78350f' },\n jade: { bg: '#6ee7b7', color: '#064e3b' },\n sienna: { bg: '#f0cfb8', color: '#7c2d12' },\n mauve: { bg: '#f0d9e0', color: '#6b2d3e' },\n walnut: { bg: '#d4a27a', color: '#1c0f09' },\n navy: { bg: '#93c5fd', color: '#172554' },\n};\n\n/**\n * Global semantic map — same label always gets the same color across every\n * table in the app, regardless of which page or column it appears in. The keys are the ENGLISH labels (the exported constant stays English for API\n * compatibility); Spanish labels are matched by `SEMANTIC_BADGE_MAP_ES` through `semanticBadgeVariant()`, which the badge and the data table use.\n */\nexport const SEMANTIC_BADGE_MAP: Readonly<Record<string, BadgeVariant>> = {\n // Active/Inactive states\n 'Active': 'green',\n 'Inactive': 'gray',\n 'Off': 'gray',\n 'Disabled': 'red',\n 'Paused': 'amber',\n // Workflow\n 'Pending': 'blue',\n 'In Progress': 'cyan',\n 'Completed': 'emerald',\n 'Resolved': 'green',\n 'Draft': 'slate',\n 'Voided': 'slate',\n // Audit\n 'Created': 'green',\n 'Updated': 'blue',\n 'Deleted': 'red',\n 'Login': 'amber',\n 'Logout': 'gray',\n 'Exported': 'pink',\n 'Imported': 'orange',\n // Comms delivery\n 'Sent': 'blue',\n 'Delivered': 'green',\n 'Opened': 'teal',\n 'Clicked': 'emerald',\n 'Bounced': 'amber',\n 'Scheduled': 'sky',\n // Terminal/negative\n 'Failed': 'red',\n 'Cancelled': 'gray',\n 'Expired': 'orange',\n 'Declined': 'red',\n 'Signed': 'emerald',\n 'Paid': 'green',\n // Priority\n 'High': 'red',\n 'Medium': 'amber',\n 'Low': 'slate',\n // Direction\n 'Inbound': 'cyan',\n 'Outbound': 'teal',\n // Boolean/consent\n 'Yes': 'green',\n 'No': 'gray',\n 'Opted In': 'green',\n 'Opted Out': 'red',\n // Channel\n 'Text': 'indigo',\n 'Email': 'sky',\n};\n\n/**\n * Spanish aliases of the labels in `SEMANTIC_BADGE_MAP`: a Spanish status keeps the colour its English twin has (\"Activo\" is green like \"Active\", \"Pagado\"\n * green like \"Paid\"), so the same meaning has the same colour in either language. Looked up by `semanticBadgeVariant` after the exact English match.\n */\nexport const SEMANTIC_BADGE_MAP_ES: Readonly<Record<string, BadgeVariant>> = {\n 'Activo': 'green', 'Inactivo': 'gray', 'Apagado': 'gray', 'Desactivado': 'red', 'Deshabilitado': 'red', 'Pausado': 'amber',\n 'Pendiente': 'blue', 'En progreso': 'cyan', 'Completado': 'emerald', 'Resuelto': 'green', 'Borrador': 'slate', 'Anulado': 'slate',\n 'Creado': 'green', 'Actualizado': 'blue', 'Eliminado': 'red', 'Inicio de sesión': 'amber', 'Cierre de sesión': 'gray', 'Exportado': 'pink', 'Importado': 'orange',\n 'Enviado': 'blue', 'Entregado': 'green', 'Abierto': 'teal', 'Con clic': 'emerald', 'Rebotado': 'amber', 'Programado': 'sky',\n 'Fallido': 'red', 'Cancelado': 'gray', 'Vencido': 'orange', 'Rechazado': 'red', 'Firmado': 'emerald', 'Pagado': 'green',\n 'Alta': 'red', 'Media': 'amber', 'Baja': 'slate',\n 'Entrante': 'cyan', 'Saliente': 'teal',\n 'Sí': 'green', 'Aceptó': 'green', 'No aceptó': 'red',\n 'Texto': 'indigo', 'Correo electrónico': 'sky',\n};\n\nconst foldLabel = (label: string): string => label.normalize('NFD').replace(/[\\u0300-\\u036f]/g, '').trim().toLowerCase();\nconst SEMANTIC_ES_FOLDED: ReadonlyMap<string, BadgeVariant> = new Map(Object.entries(SEMANTIC_BADGE_MAP_ES).map(([k, v]) => [foldLabel(k), v]));\n\n/**\n * The semantic colour of a label, or `undefined` when it has none: the exact English entry of `SEMANTIC_BADGE_MAP` first, then - only while the app's\n * active locale is Spanish (the Spanish dictionary or `setLocale('es-..')`) - the Spanish alias, ignoring case and accents (\"ACTIVO\", \"sí\" and \"si\" are\n * all green). An English app never reaches the Spanish table, so an English label such as \"Media\" keeps its hash colour exactly as before.\n */\nexport function semanticBadgeVariant(label: string | null | undefined, locale: string = uiLocale()): BadgeVariant | undefined {\n if (!label) return undefined;\n const exact = SEMANTIC_BADGE_MAP[label];\n if (exact) return exact;\n return locale.toLowerCase().startsWith('es') ? SEMANTIC_ES_FOLDED.get(foldLabel(label)) : undefined;\n}\n\n/** Visually distinct variants used for auto-color assignment. */\nconst AUTO_COLOR_PALETTE: BadgeVariant[] = [\n 'green', 'blue', 'teal', 'pink', 'sky', 'ocean', 'cyan', 'rose',\n 'amber', 'purple', 'orange', 'sage', 'indigo', 'emerald', 'violet',\n 'lime', 'steel', 'coral', 'plum', 'slate', 'fuchsia', 'jade', 'navy',\n 'sienna', 'mauve', 'gold', 'bronze', 'walnut',\n];\n\n/**\n * Deterministic color from a string value — same value always gets the\n * same color, and adjacent values in the palette are visually distinct.\n */\nexport function autoVariant(value: string): BadgeVariant {\n let hash = 0;\n for (let i = 0; i < value.length; i++) {\n hash = (hash * 31 + value.charCodeAt(i)) & 0xffff;\n }\n return AUTO_COLOR_PALETTE[Math.abs(hash) % AUTO_COLOR_PALETTE.length];\n}\n\nexport interface BadgeConfig {\n label: string;\n variant: BadgeVariant;\n}\n\n// ── Toolbar actions ────────────────────────────────────────────\nexport interface ToolbarAction {\n type: string;\n label: string;\n /** SVG path data for an icon (optional) */\n icon?: string;\n /** 'primary' = blue standalone button, 'secondary' = gray outlined standalone button, omit = inside More Actions dropdown */\n variant?: 'primary' | 'secondary';\n /** Optional count badge shown on the button */\n badge?: number;\n /** Hide this action entirely */\n hidden?: boolean;\n /** Documentation of intent: marks a mutating action (\"Add …\", bulk mutations). It does not change behavior - the table hides\n * EVERY page-defined toolbar action for any `permission` other than 'full', unless it is marked `allowReadOnly`. */\n requiresFull?: boolean;\n /**\n * Keep this action when the table is empty and unfiltered. By default only `variant: 'primary'` buttons survive that\n * state; set this on secondary buttons and More Actions items that must stay reachable on an empty table (e.g. an\n * \"Import\" or \"Invite\" that is how the first record gets created). A kept More Actions item brings the More Actions\n * menu back (with its usual items).\n */\n keepWhenEmpty?: boolean;\n /**\n * Keep this action for a read-only table (`permission` other than 'full'). By default a read-only table drops every\n * page-defined toolbar action and keeps only Export; set this on a PURE READ - e.g. a \"Board View\" / \"List View\" switch\n * that changes what is shown but writes nothing. Never set it on an action that creates, changes or deletes a record.\n * On an empty, unfiltered table only primary buttons survive: add `keepWhenEmpty` as well to keep a view switch there.\n */\n allowReadOnly?: boolean;\n /**\n * Standalone toggle buttons (e.g. \"Assigned to Me\"): true / false renders `aria-pressed` so screen readers announce\n * the on / off state. Leave unset for ordinary buttons (no attribute).\n */\n pressed?: boolean;\n /**\n * Optional confirmation before the click is reported (library source 2026-11-05, not yet published). Set it ONLY on an action that needs a\n * confirm dialog (pause / run now / send to all): the table shows its confirm modal first, emits `(tableButtonClick)` only when the user\n * confirms, and emits nothing on Cancel / Escape / backdrop. An action without `confirm` behaves exactly as before. Not used for the\n * table's own Import and Export. Same copy fields as a row action's `modal` (`message` may be a function read at click time, for text that\n * depends on the host's current state); say what happens before -> after and what is NOT affected.\n */\n confirm?: ToolbarConfirm;\n}\n\n/** Confirm dialog copy of a toolbar action (see `ToolbarAction.confirm`). */\nexport interface ToolbarConfirm {\n title: string;\n message: string | (() => string);\n confirmLabel?: string;\n cancelLabel?: string;\n variant?: 'danger' | 'primary' | 'warning';\n details?: string[];\n}\n\n// ── Confirm config (used by RowAction.modal and ConfirmService) ─\nexport interface ConfirmConfig {\n title: string;\n /** Message text. In actionsFn context item is already in scope so a plain string is fine.\n * Pass a function when defining actions as a static array outside actionsFn. */\n message: string | ((item: any) => string);\n confirmLabel?: string; // default 'Confirm'\n cancelLabel?: string; // default 'Cancel'\n variant?: 'danger' | 'primary' | 'warning'; // default 'danger'; 'warning' makes the confirm button amber\n /** Bullet list shown under the message (consequences, what is NOT affected, undoable or not). Plain text only (never HTML).\n * Rendered by the confirm dialog (`data-testid=\"confirm-details\"`, aria-label \"What will happen\") and by the built-in row delete. */\n details?: string[];\n}\n\n// ── Row actions (for actions cell type) ───────────────────────\nexport interface RowAction {\n type: string;\n label: string;\n /** SVG path data string (the <path> or <line> etc. content only, no outer <svg>) */\n icon?: string;\n variant?: 'default' | 'danger';\n hidden?: (item: any) => boolean;\n disabled?: (item: any) => boolean;\n /**\n * Why a disabled action is disabled (library source 2026-11-21, additive). Shown in the row menu as visible text under the action's label, linked to it with `aria-describedby` and also set as its `title`.\n * A function receives the row (inside `<ui-data-table>`; a standalone `ui-more-menu` calls it with `null`); `null` / `undefined` / empty = no reason. Only used while the action is disabled. An action with a\n * reason stays focusable (`aria-disabled`, so a screen-reader user can reach it and hear the reason) but never runs, and is never clickable.\n */\n disabledReason?: string | ((item: any) => string | null | undefined);\n /** How the table handles this action when clicked.\n * 'modal' — table shows a built-in confirm modal; onAction is called only if confirmed.\n * 'panel' — table emits (panelActionClick); host component opens the right panel or form modal.\n * Omit — onAction is called directly (navigate, toggle, call, etc.) */\n opens?: 'modal' | 'panel';\n /** Required when opens === 'modal'. Drives the confirm dialog shown by the table. */\n modal?: ConfirmConfig;\n /** Documentation of intent: marks a mutating action (edit, delete, ...). It does not change behavior - for any `permission`\n * other than 'full' the table offers only View and actions marked `allowReadOnly`, with or without this flag.\n * The built-in `type: 'delete'` action is never offered to read-only users. */\n requiresFull?: boolean;\n /** Keep this action for read-only users too (download, preview: reads that change nothing). Without it a read-only table offers only\n * View. Never applies to the built-in delete, and the table still drops the Actions column when no row has any visible action. */\n allowReadOnly?: boolean;\n}\n\n/** Page-level permission passed to `<ui-data-table [permission]>`. Anything other than 'full' is read-only\n * (apps use values like 'read-only' / 'hidden'). */\nexport type TablePermission = 'full' | 'read' | 'read-only' | 'none' | 'hidden';\n\n// ── Cell types ────────────────────────────────────────────────\nexport type CellType =\n | 'text' // default — renders item[col.key] as string\n | 'badge' // renders a colored badge pill\n | 'date' // formats a date value\n | 'phone' // formats a phone number\n | 'number' // right-aligns header + cell; renders via render() or item[col.key]\n | 'avatar-name' // avatar circle + full name\n | 'days-ago' // \"Xd ago\" / \"Never\" with overdue styling\n | 'progress' // progress bar + label, driven by progressFn\n | 'tags' // first tag badge + \"+N more\"\n | 'image' // thumbnail driven by imageFn (placeholder icon when there is no URL / it fails to load)\n | 'link' // real <a> driven by linkFn (mailto:, tel:, http(s):, or an in-app route); plain text when linkFn gives no target\n | 'actions'; // more-menu dropdown\n\n// ── Link cells ────────────────────────────────────────────────\n/**\n * Where a `cellType: 'link'` cell points. Return a plain string from `linkFn` as shorthand for `{ href }`.\n *\n * - `routerLink` (+ `queryParams`) is an in-app route: the anchor gets the real URL as its `href` (so right-click,\n * middle-click, ctrl/cmd-click, \"open in new tab\" and \"copy link address\" all work) and a plain left click\n * navigates through the Angular `Router` without a page reload. `routerLink` wins when `href` is also set.\n * - `href` accepts ONLY `mailto:`, `tel:`, `http:`, `https:` and root-relative paths (`/cases/12`). Anything else\n * (`javascript:`, `data:`, `//host`, empty, control characters) is never rendered as an href: the cell shows plain\n * text. A root-relative `href` is a normal link (full page load); use `routerLink` for in-app navigation.\n * - `target: '_blank'` (default `'_self'`) adds `rel=\"noopener noreferrer\"` and a \"(opens in a new tab)\" screen-reader\n * hint. `http(s):` hrefs always get the same `rel`.\n * - `label` is the link text when the cell has no text of its own (`render` and `item[key]` are empty).\n * - `ariaLabel` replaces the link's accessible name (default: its text).\n * - `download` adds the `download` attribute.\n */\nexport interface LinkTarget {\n href?: string;\n routerLink?: string | readonly any[];\n queryParams?: Record<string, any>;\n target?: '_self' | '_blank';\n label?: string;\n ariaLabel?: string;\n download?: boolean;\n}\n\n/** Payload of `(linkClick)`: a link cell's anchor was activated by a click (the row click is NOT also emitted). */\nexport interface LinkClickEvent<T = any> {\n item: T;\n column: ColumnDef;\n /** The anchor's href (null only for a routerLink that could not be resolved, which renders no anchor anyway). */\n href: string | null;\n}\n\n// ── Column definition ─────────────────────────────────────────\nexport interface ColumnDef {\n key: string;\n label: string;\n sortable?: boolean;\n defaultVisible?: boolean;\n /**\n * Wire name of this column's FILTER, when it must differ from `key`. Defaults to `key` (unset = unchanged behaviour).\n * Replaces `key` only for: the column-filter query param on rows and export requests, the key read from the\n * `/filter-counts` response for this column's options/counts (also the bulk \"Change <column>\" options), and the key\n * stored in saved views (a view saved under the plain `key` still restores). Everything else stays on `key`:\n * sort (`sort=<key>`), cell values, visibility, `lockedColumn`, `searchFields`, `bulkUpdateOptions` and the\n * `/bulk/<field>` request body. It also names the header filter and the phone-card filter chips' request param. It must not equal a reserved table param (`page`, `size`, `search`, `searchFields`, `sort`, `direction`, `filter`) nor an `Object.prototype` member name such as `constructor` — there is no runtime guard. Example: `{ key: 'direction', filterParam: 'messageDirection' }` keeps the filter\n * from colliding with the table's own `direction=asc|desc` sort param.\n */\n filterParam?: string;\n /** If true, this column's label appears in the search input placeholder when the column is visible. */\n searchable?: boolean;\n /** Values a bulk \"Change <label>\" may set. When omitted the options come from /filter-counts.\n * Use it when only some values are user-settable or when a valid value may currently have no rows. */\n bulkOptions?: string[];\n /** Fixed column width (any CSS length, e.g. '140px'). Applied as width, min-width and max-width; cell text longer than\n * it is cut with an ellipsis. Omit for an automatic width. Not applied to the Actions column's cell clipping. */\n width?: string;\n align?: 'left' | 'right' | 'center';\n headerAlign?: 'left' | 'right' | 'center';\n\n /** How to render cell content. Defaults to 'text'. */\n cellType?: CellType;\n\n // ── badge ──\n /**\n * Maps a cell value (or full item) to a { label, variant } config.\n * When omitted, auto-color is applied using the value string.\n * Return null to render a plain '—' instead of a badge (e.g. for an empty value).\n */\n badgeFn?: (value: any, item?: any) => BadgeConfig | null;\n\n // ── star (text cells, e.g. the name column) ──\n /**\n * Puts a gold `<ui-star>` to the LEFT of the cell's text when it returns a non-empty string; that string is the star's tooltip\n * (hover / keyboard focus) and accessible name. Return null / undefined / '' for no star. The star is always gold.\n * Applies to plain text cells (and the title of the phone card); the row's accessible name is unchanged (`nameFn` / `render`).\n * Example: `{ key: 'name', label: 'Name', starFn: (doc) => doc.isAuthForm ? 'Authorization Form' : null }`\n */\n starFn?: (item: any) => string | null | undefined;\n\n // ── leading icon (text-like cells) ──\n /**\n * Library source 2026-11-05, not yet published. Draws a small decorative icon (16px, `aria-hidden`, currentColor, on the first text line, never shrinks)\n * to the LEFT of the cell text, in desktop cells and in the phone card (title, badge pills, detail rows). Returns a `<ui-icon>` key (see `iconPath()`) or a\n * raw 24x24 stroke SVG path (drawing commands and numbers only, same rule as ui-radio's `icon`); null / undefined / '' / anything else draws nothing.\n * Applies to text, badge, date, phone and number cells; never to avatar-name, link, tags, progress, image, days-ago or actions. The cell's text and the row's\n * accessible name are unchanged (see `iconLabelFn` for meaningful icons). Placed before a `starFn` star.\n * Example: `{ key: 'name', label: 'Name', iconFn: (r) => r.kind === 'rental' ? 'wrench' : 'cup' }`\n */\n iconFn?: (item: any) => string | null | undefined;\n /**\n * Library source 2026-11-05, not yet published. Accessible text for a MEANINGFUL `iconFn` icon: rendered as visually hidden text right after the icon\n * (the icon stays `aria-hidden`). Default (absent / null / '') = the icon is decorative. Ignored when no icon is drawn for the row.\n */\n iconLabelFn?: (item: any) => string | null | undefined;\n\n // ── footer totals ──\n /**\n * Footer text for this column, from the table's `totalsEndpoint` response (shown only while the table has rows and the totals loaded).\n * Return null / undefined / '' for an empty footer cell. `cellType: 'number'` columns are right-aligned like their body cells.\n * The table's `totalsLabel` goes in the footer cell of the first visible column; when that column has a `footerFn` too, the label is\n * kept as visually hidden text before the value (\"Total: $1,200\") so it is still announced once.\n * Example: `{ key: 'amount', label: 'Amount', cellType: 'number', footerFn: t => t['amount'] == null ? null : '$' + t['amount'] }`\n */\n footerFn?: (totals: Record<string, string | number | null>) => string | null | undefined;\n\n // ── date ──\n /** Date format string. Default: 'MMM d, y' */\n dateFormat?: string;\n\n // ── avatar-name ──\n /** Returns the display name for the row. Default: item[col.key] */\n nameFn?: (item: any) => string;\n /** Returns initials for the avatar. Default: first char of nameFn result */\n initialsFn?: (item: any) => string;\n\n // ── days-ago ──\n /** Key in item holding the days-since count. Defaults to col.key. */\n daysKey?: string;\n /** Days after which the cell is styled as overdue. Default: 30 */\n overdueThreshold?: number;\n\n // ── progress ──\n /**\n * Maps a row to a progress bar. Return null to render a plain '—' (e.g. nothing to track).\n * `label` is the text beside the bar (e.g. \"3/5\"); `tooltip` is the hover text. `ariaLabel` is the bar's accessible name (e.g. the row's name + \" cap progress\"); leave it out and the bar is named by its `label` text — which, with only \"80%\" to go on, tells a screen-reader user nothing about WHICH row it belongs to, so set it whenever several rows show a bar. Leave `variant` out and the bar colors itself by completion (red / amber / blue / green).\n */\n progressFn?: (item: any) => { value: number; max: number; label?: string; variant?: 'blue' | 'green' | 'amber' | 'red' | 'slate'; tooltip?: string; ariaLabel?: string } | null;\n\n // ── tags ──\n /** Key in item holding the tags array. Defaults to col.key.\n * Expected shape: { name: string; variant?: BadgeVariant; color?: string; colorName?: string }[]. `colorName` is the colour (or state) in words, e.g. 'red' or 'error': it is read by screen readers after the tag name (hidden visually) so the colour is never the only signal; omit it and nothing changes. `color` is a custom hex colour (`#rgb` / `#rrggbb`,\n * e.g. the colour a user picked for the tag): it becomes the chip background with dark or white text for contrast and wins over `variant`;\n * an invalid value is ignored. */\n tagsKey?: string;\n\n // ── link ──\n /**\n * `cellType: 'link'` — returns where the cell points for a row (`value` is `item[key]`), or null / undefined /\n * '' for no link (the cell then shows plain text). A string is shorthand for `{ href }`. See {@link LinkTarget}\n * for the contract and the allowed schemes. Text shown: `render(item)` if set, else `item[key]`, else the\n * target's `label`, else '—'. The text is always escaped. A throwing `linkFn` renders plain text.\n * Sorting, search, filters and export are independent of the link (export uses the host's `exportRow`).\n * Clicking or keying the anchor never emits `rowClick`; it emits `(linkClick)`.\n */\n linkFn?: (item: any, value: any) => LinkTarget | string | null | undefined;\n\n // ── image ──\n /** Returns the image URL for the row. A falsy value (null / undefined / '') shows the placeholder icon. */\n imageFn?: (item: any) => string | null | undefined;\n /** Focal point (percent, 50/50 = centered) of the cropped image, applied as CSS object-position. */\n imagePositionFn?: (item: any) => { x: number | null | undefined; y: number | null | undefined } | null | undefined;\n /** Alt text for the row's image. When omitted the image is decorative (`alt=\"\"`). */\n imageAlt?: (item: any) => string;\n /** 'circle' (default) or 'rounded' (3:2 rounded rectangle). */\n imageShape?: 'circle' | 'rounded';\n /** 'md' (default) or 'sm'. circle: 40px / 28px; rounded: 48x32 / 36x24. */\n imageSize?: 'sm' | 'md';\n /** Neutral icon shown when there is no URL or the image fails to load. Default: 'image'. */\n imagePlaceholder?: 'person' | 'image';\n\n // ── actions ──\n /** Returns the list of actions for a given row item. */\n actionsFn?: (item: any) => RowAction[];\n /** Called when the user clicks an action. */\n onAction?: (type: string, item: any) => void;\n\n // ── fallback ──\n /** Custom plain-text render function. Only used for 'text' type. */\n render?: (item: any) => string;\n\n // ── mobile ──\n /** Hide this column in the card-view detail rows on mobile (≤640px).\n * The title (avatar-name) and badge columns are always shown. */\n mobileHidden?: boolean;\n}\n\n// ── Quick filter tab ──────────────────────────────────────────\nexport interface QuickFilterTab {\n value: string;\n label: string;\n /** When true, the tab is shown as informational only and cannot be clicked. */\n disabled?: boolean;\n}\n\n// ── Column filter ─────────────────────────────────────────────\nexport interface FilterOption {\n value: string;\n label: string;\n color?: string;\n count?: number;\n}\n\n// ── Saved view ────────────────────────────────────────────────\nexport interface SavedView {\n id: string;\n name: string;\n isSystem?: boolean;\n /** Active quick-filter tab value at time of save */\n quickFilter?: string | null;\n /** Active sort column key at time of save */\n sortField?: string | null;\n /** Sort direction at time of save */\n sortDir?: string | null;\n /** Visible column keys at time of save (empty = use defaultVisible) */\n visibleColumns?: string[];\n /**\n * Active column filters at time of save: column key → comma-joined selected values (the same wire format the\n * table sends as query params). `undefined`/`null` (views saved before this existed, or a backend that doesn't\n * store it) leaves the current column filters untouched on load; `{}` clears them.\n */\n columnFilters?: Record<string, string> | null;\n /**\n * Active numeric range filters at save time (only tables with `rangeFilters`): column key -> `{ min, max }` (a bound is a number or\n * absent). Written only when a range is set. `undefined` / `null` (views saved before ranges existed, or a backend that doesn't store\n * it) leaves the current ranges untouched on load; `{}` clears them.\n */\n rangeFilters?: Record<string, { min?: number | null; max?: number | null }> | null;\n}\n\n// ── Numeric range column filter ───────────────────────────────\n\n/**\n * One `<ui-data-table [rangeFilters]>` entry: gives the visible column `key` a numeric Min / Max filter (same funnel icon and popover as\n * the value-list filter). Opt-in at the TABLE: a column that is not listed (or is hidden) has no range filter, and an empty list changes\n * nothing. When applied, the table sends `<minParam>=<n>` and `<maxParam>=<n>` (a bound that is empty is omitted) on the rows, export and\n * totals requests (not on /counts or /filter-counts, like every column filter); the BACKEND does the filtering.\n *\n * readonly rangeFilters: RangeFilterConfig[] = [{ key: 'rentableSf', minParam: 'rentableSfMin', maxParam: 'rentableSfMax', min: 0, step: 100, format: 'number' }];\n */\nexport interface RangeFilterConfig {\n /** Key of a column of the table. */\n key: string;\n /** Query param for the lower bound. Default `<key>Min`. */\n minParam?: string;\n /** Query param for the upper bound. Default `<key>Max`. */\n maxParam?: string;\n /** Lowest value the user may enter (default 0, so negatives are refused; pass a negative number to allow them). */\n min?: number;\n /** Highest value the user may enter (default: no limit). */\n max?: number;\n /** Step of the number fields; also sets the decimals allowed (step 0.01 = 2 decimals, whole-number steps = whole numbers). Default 1. */\n step?: number;\n /** How bounds are written in the chip / active label: plain number (default), US dollars or a percent. Values sent are always plain numbers. */\n format?: 'number' | 'currency' | 'percent';\n /** Text appended to a bound in the label when `format` is 'number' (e.g. 'SF'). */\n unit?: string;\n}\n\n// ── Bulk actions ──────────────────────────────────────────────\n\n/**\n * Declares a bulk action available in the table's selection bar.\n * Options for select-based actions are derived automatically from the table's\n * column configuration (columnFilters → quickFilterTabs → filterCounts → distinct values).\n */\n/**\n * One `bulkUpdateOptions` entry:\n * - `'delete'` — the built-in bulk delete;\n * - a column key (e.g. `'status'`) — \"Change <column label>\" with options from /filter-counts;\n * - `{ field, exclude }` — the same, minus values users can't set by hand (e.g. a status only the\n * system sets). Excluded values are left out of the bulk select only — the column filter, quick-filter\n * tabs and counts still show them. Matching ignores case, spaces, dashes and underscores.\n *\n * readonly bulkUpdateOptions: BulkUpdateOption[] = [{ field: 'status', exclude: ['EXPIRED'] }, 'delete'];\n * - `{ field, allowedFrom }` — the status workflow: a map of TARGET value -> the values a row may currently\n * have to move to it, e.g. `{ SENT: ['DRAFT'], VOIDED: ['DRAFT', 'SENT'] }`. The bulk select then offers only\n * targets that at least one selected row can legally move to (a target with no entry is not selectable), and rows\n * whose current value is not in the target's list are skipped (counted, never sent). Without `allowedFrom` every\n * row can move to any value it does not already have. Combine with `exclude` freely (exact, case-sensitive values).\n *\n * { field: 'status', allowedFrom: { SENT: ['DRAFT'], VOIDED: ['DRAFT', 'SENT'] } }\n */\nexport type BulkUpdateOption<T = any> = string | {\n field: string;\n /**\n * Field changes (`{ field, label }`): the bulk bar button text instead of \"Change <column label>\", e.g. `{ field: 'state', label: 'Archive / Restore' }`.\n * It is also the inline select's accessible name, the default confirm's title and confirm button, and the default confirm message reads\n * \"<label>: <option> for N items?\" (instead of \"Change <column> to <option> for N items?\"). Host `confirm` copy still wins; its\n * `ctx.columnLabel` stays the column's label. Trimmed; blank = ignored. Ignored for the reserved `delete` key. Omit it and nothing changes.\n * Direct actions (`action: true`): the bar button text, default confirm title and confirm button (required in practice; trimmed,\n * blank = the key split on `_`, `-` and camelCase with only the first word capitalised: 'resend' -> 'Resend', 'send_reminder' / 'sendReminder' -> 'Send reminder'); `ctx.columnLabel` is this label.\n *\n * { field: 'state', label: 'Archive / Restore' }\n */\n label?: string;\n exclude?: string[];\n allowedFrom?: Record<string, string[]>;\n /**\n * Host-written confirm copy (see `BulkConfirmFn`): one function for every target value, or a map target value -> function\n * (a target without an entry keeps the library's default wording). For the reserved delete key use\n * `{ field: 'delete', confirm }`. Omit it and the confirm keeps today's default wording.\n */\n confirm?: BulkConfirmFn<T> | Record<string, BulkConfirmFn<T>>;\n /**\n * Bulk Delete only (`{ field: 'delete', deletable }`): true when the server will accept deleting this row. Keep it identical\n * to the backend rule. Only deletable rows are counted in the confirm, sent to `/bulk/delete` and shown as deleted; the others\n * are skipped (\"N selected rows can't be deleted and will be skipped.\"). The Delete button is disabled (with a reason) when\n * no selected row is deletable. Omit it and every selected row is sent, as before.\n *\n * { field: 'delete', deletable: (row: Invoice) => row.status === 'DRAFT' }\n */\n deletable?: (row: T) => boolean;\n /**\n * Field changes (`{ field, canChange }`): true when the server will accept moving THIS row to `target` (a value the select offers).\n * For rules the field values alone can't express, e.g. a draft can only be sent when it has a document and a recipient. Keep it\n * identical to the backend rule. Rows it refuses are skipped like rows `allowedFrom` refuses (\"N selected rows can't be changed to X\n * and will be skipped.\" / `ctx.skippedBlocked` + `ctx.skippedRows` for host `confirm` copy), are never sent, and a target is offered\n * only while some selected row can move to it. It runs after `allowedFrom` and only sees rows on the loaded page. Omit it and\n * nothing changes.\n *\n * { field: 'status', allowedFrom: { SENT: ['DRAFT'] }, canChange: (row, target) => target !== 'SENT' || canSend(row) }\n */\n canChange?: (row: T, target: string) => boolean;\n /**\n * Field changes (`{ field, skipReason }`): WHY a row is skipped, in the host's words. Called for every selected row that will be skipped because it cannot move to `target`\n * (`allowedFrom` / `canChange` refused it; a row that already holds the target is NOT asked: the standard \"already has this value\" wording covers it) with the row and the\n * target value. Return a short plain sentence (\"Needs a document and a recipient first.\") or `null` / `''` for no reason. A function that throws counts as no reason.\n * The reasons are grouped (the same text is one line with the number of rows: \"Needs a document and a recipient first. (3)\"), listed as bullets in the confirm (`confirm-details`,\n * after the host's own `details`), and passed to a host `confirm` function as `ctx.skippedReasons` (one entry per row, so the copy can name them). It only sees rows on the loaded\n * page. It changes no rule: it never makes a row skipped or eligible. Omit it and nothing changes.\n *\n * { field: 'status', allowedFrom: { SENT: ['DRAFT'] }, canChange: (row, target) => target !== 'SENT' || canSend(row),\n * skipReason: (row, target) => (target === 'SENT' && row.status === 'DRAFT' && !canSend(row)) ? 'Needs a document and a recipient first.' : null }\n */\n skipReason?: (row: T, target: string) => string | null | undefined;\n /**\n * Field changes (`{ field, canApply }`): a rule on the WHOLE selection, in addition to the per-row `allowedFrom` / `canChange`. Called with every\n * selected row of the loaded page and the target value; return `true` to allow, `false` (generic reason) or a string (the reason shown to the\n * user) to refuse. Use it for a rule no single row can express (\"an Archived invoice batch must all belong to one customer\", \"all rows must\n * share the same status\"). Keep it identical to the backend rule. A target it refuses is listed in the select but disabled, with a visible\n * \"<option>: <reason>\" hint, and Apply re-checks it (a refused target is never confirmed or sent; the reason is shown as an error toast). A function that throws counts as\n * refused. It only sees rows on the loaded page. Ignored for Delete and direct actions. Omit it and nothing changes.\n *\n * { field: 'status', canApply: (rows, target) => target !== 'MERGED' || new Set(rows.map(r => r.customerId)).size === 1 || 'Rows must belong to one customer.' }\n */\n canApply?: (rows: T[], target: string) => boolean | string;\n /**\n * Field changes (`{ field, listAll }`): list the FULL set of values in the \"Change <column>\" select instead of only the values the\n * /filter-counts response currently carries (which omits values no row has yet). `true` = the filter-count values plus every target of\n * `allowedFrom` that is not already listed; a list of values = exactly that set, in that order (labelled through the column's `badgeFn`). The\n * `exclude`, `allowedFrom`, `canChange` and `canApply` rules and the \"not already held by every selected row\" rule still apply, so listing a\n * value never offers a change the table knows the server refuses. An empty list is ignored. Omit it and nothing changes.\n *\n * { field: 'status', listAll: ['DRAFT', 'SENT', 'SIGNED', 'VOIDED'], allowedFrom: { SENT: ['DRAFT'], SIGNED: ['SENT'], VOIDED: ['DRAFT', 'SENT'] } }\n */\n listAll?: true | readonly string[];\n /**\n * Field changes (`{ field, order }`): the order of the \"Change <column>\" select. Values listed in `order` come first, in that order (matched\n * exactly to the option values, case-sensitive); the remaining options follow in their existing order. Values in `order` that are not among\n * the options are ignored (nothing is added). It only sorts: `exclude`, `allowedFrom`, `canChange`, `canApply`, `listAll` and the \"not already\n * held by every selected row\" rule decide WHICH options appear. Ignored for Delete and direct actions. Omit it and nothing changes.\n *\n * { field: 'type', order: ['office', 'retail', 'industrial', 'multifamily'] }\n */\n order?: readonly string[];\n /**\n * Direct bulk action (`{ field: 'resend', action: true, label: 'Resend' }`): a bulk-bar button that is neither a field change nor\n * Delete. `field` is the action key (no column needed), the button type is `action-<field>` and there is no inline select.\n * Clicking it opens the library confirm, then POSTs `<endpoint>/bulk/<field>` with exactly `{ ids }` (the eligible rows). The response is\n * handled like a field change (`updated`, `skipped`, `notAllowed`, readable `message`). Ignored for the reserved `delete` key.\n * Read-only users get no bulk bar, so nothing changes for them. Omit it and nothing changes.\n * `confirm` on an action takes only the function form; a map (target value -> function) is ignored and the default copy is used.\n *\n * { field: 'resend', action: true, label: 'Resend', eligible: (row: Request) => row.status === 'PENDING' }\n */\n action?: boolean;\n /** Direct action only: button style, default 'secondary'. 'danger' also makes the default confirm button red. */\n variant?: 'secondary' | 'danger';\n /**\n * Direct action only: true when the server will accept the action for this row (keep it identical to the backend rule). Rows it\n * refuses are skipped (counted, NEVER sent; \"N selected rows don't qualify for <label lower-cased> and will be skipped.\"). When no selected loaded row passes,\n * the button is disabled with a visible reason (\"None of the selected rows qualify for <label lower-cased>.\"). Omit it and every selected row is sent. A predicate that throws counts as \"row not eligible\" (never breaks rendering).\n */\n eligible?: (row: T) => boolean;\n /**\n * Direct action only: the past-tense word in the result toast. \"N <doneLabel>, M skipped.\" when anything was skipped / not allowed,\n * else \"N <itemLabel>(s) <doneLabel>.\". Default 'updated'.\n * English keeps the past-tense word ('resent' -> \"N contacts resent.\"). In Spanish the summary reads \"<doneLabel>: N <items>.\" and the word is\n * a capitalised NOUN, not a participle: pass 'Reenvío' (\"Reenvío: 3 contactos.\"), not 'enviados' (\"enviados: 3 contactos.\"). The built-in\n * default ('updated') is translated by the dictionary and needs nothing.\n */\n doneLabel?: string;\n /**\n * Direct action only: the request returns a FILE instead of JSON (a ZIP of PDFs, a CSV...). The table still confirms first and POSTs\n * `<endpoint>/bulk/<field>` with exactly `{ ids }`, but asks for a blob response and saves it as one download (one file, so browsers do not\n * block it the way several automatic downloads are blocked). The file name is the response's `Content-Disposition` filename, else\n * `fileName`, else the action key. The toast reads \"N <itemLabel>(s) <doneLabel>.\" (`doneLabel` defaults to 'downloaded' here); the server may\n * send an `X-Skipped-Count` header with the number of selected rows it left out of the file (\"N downloaded, M skipped.\"). The rows do not change,\n * so the table is not refreshed; the selection is cleared and `(bulkAction)` is emitted. An error response is read as `{ message }` JSON and shown\n * in an error toast. Omit it and the action expects JSON as before.\n *\n * { field: 'download-pdfs', action: true, label: 'Download PDFs', download: { fileName: 'inspections.zip' } }\n */\n download?: { fileName?: string };\n /**\n * Direct action only (`opens: 'panel'`): the button does not confirm and does not POST. It emits `(bulkPanelClick)` with the\n * eligible rows and the host opens its own panel or form (compose an e-mail, add a charge...) and does the work itself.\n * The host calls `clearSelection()` and `refresh()` on the table when it is done. `confirm` and `doneLabel` are ignored for a panel action (no confirm is shown; `variant: 'danger'` still colours the button); `eligible` still applies (refused rows are never passed on). Omit it and nothing changes.\n *\n * { field: 'email', action: true, opens: 'panel', label: 'Email', eligible: (r: Resident) => !!r.email }\n */\n opens?: 'panel';\n /**\n * Panel action only (`opens: 'panel'`): true while the action is not available right now (e.g. text messaging is switched off). The button is\n * then not shown at all. Read every time the bar renders, so it can read signals; a function that throws counts as \"not hidden\". A panel\n * action is also not shown while none of the selected rows is `eligible`. Omit it and the button shows whenever a selected row is eligible.\n */\n hidden?: () => boolean;\n};\n\n/** What a bulk confirm function receives. For a direct bulk action: `columnLabel` is the action label, `targetValue`/`targetLabel` are '', `rows`/`skippedRows` the eligible / refused selected rows. For bulk Delete: `targetValue`/`targetLabel` are '', `columnLabel` is 'Delete', skipped counts are 0. */\nexport interface BulkConfirmContext<T = any> {\n /** Rows that WILL be sent (eligible). For Delete: the selected count. */\n count: number;\n /** Selected rows skipped because they already hold the target value. */\n skippedAlready: number;\n /** Selected rows skipped because `allowedFrom` does not allow the move. */\n skippedBlocked: number;\n /** Everything the user selected (`count + skippedAlready + skippedBlocked`). */\n selectedCount: number;\n /** Singular / plural item label (the table's `itemLabel` / `itemLabelPlural`). */\n itemLabel: string;\n itemLabelPlural: string;\n /** Label of the column being changed (\"Status\"). */\n columnLabel: string;\n /** Raw target value (\"APPROVED\") and its display label (\"Approved\"). */\n targetValue: string;\n targetLabel: string;\n /**\n * The eligible row objects (name records, show before -> after). A selection never spans pages (any reload clears it and\n * select-all takes the loaded page), so these are every row that will be sent.\n */\n rows: T[];\n /** The selected rows that will be skipped. */\n skippedRows: T[];\n /**\n * Field changes with a `skipReason` callback: one `{ row, reason }` per skipped row the callback gave a reason for (trimmed, single line, at most 300 characters; rows that already hold the\n * target value are not asked). Empty when the entry has no `skipReason`; always `[]` for Delete and direct actions. The library already lists the grouped reasons in the confirm; use this to\n * word the message yourself (`omitSkippedNote`).\n */\n skippedReasons?: { row: T; reason: string }[];\n}\n\n/** Host copy for one bulk confirm. Plain text only (never HTML); `\\n` in `message` shows as a line break. */\nexport interface BulkConfirmCopy {\n /** Default: the action label (\"Change Status\") / \"Delete <Items>\" built from the table's item label (\"template\" → \"Delete Templates\"). */\n title?: string;\n message: string;\n /** Rendered as a bullet list under the message (consequences, what is NOT affected, undoable or not). */\n details?: string[];\n /** Default: the action label / \"Delete\". */\n confirmLabel?: string;\n /** Default: 'primary' for a field change, 'danger' for Delete. 'danger' makes the confirm button red. */\n variant?: 'primary' | 'danger' | 'warning';\n /** By default the library appends its standard \"N selected rows ... will be skipped.\" sentence (change actions); set true to write it yourself. */\n omitSkippedNote?: boolean;\n}\n\nexport type BulkConfirmFn<T = any> = (ctx: BulkConfirmContext<T>) => BulkConfirmCopy | string;\n\nexport interface BulkActionDef {\n /** Action key — passed through to the (bulkAction) event. */\n type: string;\n /** Button label shown in the bulk bar. */\n label: string;\n /** True when `label` came from the entry's custom `label` (the default confirm message then reads \"<label>: <option> for N items?\"). Only set then. */\n customLabel?: boolean;\n /** Button style. Default: 'secondary'. Use 'danger' for destructive actions. */\n variant?: 'secondary' | 'danger';\n /** Values left out of this field's bulk select (from a `{ field, exclude }` bulkUpdateOptions entry). */\n exclude?: string[];\n /** Workflow rules (from `{ field, allowedFrom }`): target value -> source values a row may move from. */\n allowedFrom?: Record<string, string[]>;\n /** Host confirm copy (from `{ field, confirm }`). */\n confirm?: BulkConfirmFn | Record<string, BulkConfirmFn>;\n /** Bulk Delete only: which rows the server will delete (from `{ field: 'delete', deletable }`). */\n deletable?: (row: any) => boolean;\n /** Field changes: per-row check that the server will accept the move to a target (from `{ field, canChange }`). */\n canChange?: (row: any, target: string) => boolean;\n /** Field changes: why a skipped row is skipped (from `{ field, skipReason }`). */\n skipReason?: (row: any, target: string) => string | null | undefined;\n /** Field changes: rule on the whole selection (from `{ field, canApply }`): true = allowed, false / a string = refused (the string is the reason). */\n canApply?: (rows: any[], target: string) => boolean | string;\n /** Field changes: list the full value set (from `{ field, listAll }`): `true` or the exact list of values. */\n listAll?: true | readonly string[];\n /** Field changes: option order (from `{ field, order }`): these values first, in this order. */\n order?: readonly string[];\n /** True for a direct bulk action (from `{ field, action: true, label }`); `type` is `action-<key>` and `field` is not set (no inline select). */\n action?: boolean;\n /** Direct action: which rows the server will accept (from `{ field, action: true, eligible }`). */\n eligible?: (row: any) => boolean;\n /** Direct action: past-tense word in the result toast (from `{ doneLabel }`), default 'updated'. */\n doneLabel?: string;\n /** Direct action that returns a file (from `{ download }`): the response is saved as a download instead of read as JSON. */\n download?: { fileName?: string };\n /** True for a direct action that opens a host panel instead of confirming and POSTing (from `{ opens: 'panel' }`). */\n opensPanel?: boolean;\n /** Panel action: true while it is not available (from `{ hidden }`); the button is not shown. */\n hidden?: () => boolean;\n /**\n * The item field this action targets (e.g. 'status', 'type').\n * When set the table shows an inline select populated from the column's option sources.\n * Omit for direct actions like delete that need no value selection.\n */\n field?: string;\n}\n\n/** Emitted by (bulkAction) after the user selects a value and clicks Apply. */\nexport interface BulkActionEvent {\n type: string;\n ids: string[];\n value?: string;\n skippedCount: number;\n /**\n * Rows the backend did not change because another save held them at that moment (its `busy` count; retry later). NOT part of `skippedCount`. Only present when the\n * response reported a number above 0 (an absent / 0 / non-numeric `busy` leaves the field out, so existing payloads are unchanged).\n */\n busyCount?: number;\n}\n\n/** Emitted by (bulkPanelClick) when the user clicks a bulk action declared with `opens: 'panel'`. */\nexport interface BulkPanelEvent<T = any> {\n /** `action-<key>` of the clicked bulk option. */\n type: string;\n /** The option's `field` (its key), e.g. 'email'. */\n key: string;\n /** Ids of the eligible selected rows. */\n ids: string[];\n /** The eligible selected rows (loaded page). */\n rows: T[];\n /** Selected rows the option's `eligible` refused. */\n skippedCount: number;\n}\n\n/** Emitted by (rowReorder) after the user moves a row (`reorderable`). */\nexport interface TableRowReorderEvent<T = any> {\n /** The row that was moved. */\n item: T;\n /** Its index on the page before and after the move (0-based). */\n from: number;\n to: number;\n /** The rows on the page in their new order. */\n items: T[];\n /** How many rows come before this page (0 on the first page), so `offset + to` is the row's position in the whole list. */\n offset: number;\n}\n\n// ── Page response from backend ────────────────────────────────\nexport interface PageResponse<T> {\n content: T[];\n totalElements: number;\n totalPages: number;\n number: number;\n size: number;\n}\n"],"mappings":"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"}
|
package/package.json
CHANGED
|
@@ -30,6 +30,16 @@ declare function toDateStr(d: Date): string;
|
|
|
30
30
|
declare function fromDateStr(dateStr: string): Date;
|
|
31
31
|
/** True for a real calendar day written as `YYYY-MM-DD` (rejects `2026-02-30`, `2026-1-5`, non-ISO text). */
|
|
32
32
|
declare function isValidDateStr(dateStr: string): boolean;
|
|
33
|
+
/** True when `zone` is an IANA time zone name this browser knows ("America/Denver"). Never throws; an empty or unknown name is false. */
|
|
34
|
+
declare function isValidTimeZone(zone: string | null | undefined): boolean;
|
|
35
|
+
/**
|
|
36
|
+
* The calendar date (`YYYY-MM-DD`) it is right now in the IANA time zone `zone` ("Pacific/Kiritimati"), or null when the zone is empty / unknown
|
|
37
|
+
* (the caller then uses the browser's date). Uses `Intl.DateTimeFormat#formatToParts` with explicit numeric parts, never a parsed non-ISO string
|
|
38
|
+
* (Safari). Not exported: hosts that need the same date for `periodGroup(...)` use `todayInTimezone(zone)` from `@forgeroute/ui/utils`. `now` is only for tests.
|
|
39
|
+
*/
|
|
40
|
+
declare function zoneDateStr(zone: string | null | undefined, now?: Date): string | null;
|
|
41
|
+
/** Milliseconds until one second after the next midnight in `zone`, never more than an hour (so a daylight-saving change or a changed system clock is caught within an hour), or null for an unknown zone. */
|
|
42
|
+
declare function msUntilZoneMidnight(zone: string | null | undefined, now?: Date): number | null;
|
|
33
43
|
/** The 42 cells (6 weeks, Sunday first) of the month grid containing `anchor`. */
|
|
34
44
|
declare function buildMonthCells(anchor: Date, todayStr: string): CalendarDay[];
|
|
35
45
|
/** The 7 days (Sunday first) of the week containing `anchor`. */
|
|
@@ -215,6 +225,8 @@ export declare class CalendarComponent {
|
|
|
215
225
|
* goes). The calendar cannot count projected content, so this is a number: default 2; 0 draws none. Not used after the first load.
|
|
216
226
|
*/
|
|
217
227
|
readonly loadingActions: import("@angular/core").InputSignalWithTransform<number, unknown>;
|
|
228
|
+
/** The anchor used when the host binds none; kept to tell "the host never set the anchor" (this very object) from a date the host or the user chose. */
|
|
229
|
+
private readonly defaultAnchor;
|
|
218
230
|
/** Active view; two-way bindable. A value that is not in `views` is replaced by the first allowed view. */
|
|
219
231
|
readonly view: import("@angular/core").ModelSignal<CalendarViewMode>;
|
|
220
232
|
/** Views the switcher offers. One entry hides the switcher. */
|
|
@@ -236,6 +248,12 @@ export declare class CalendarComponent {
|
|
|
236
248
|
/** Overrides "today" (`YYYY-MM-DD`): the highlighted day, `disablePast`, the agenda "Today" badge and what the Today button jumps to.
|
|
237
249
|
* Use it when the server's date, not the browser's, decides what today is. Null / invalid = the browser clock. */
|
|
238
250
|
readonly today: import("@angular/core").InputSignal<string | null>;
|
|
251
|
+
/**
|
|
252
|
+
* Optional IANA time zone ("America/Denver", "Pacific/Kiritimati") whose calendar date is "today": the highlighted day (`today` class, `aria-current="date"`), the Today button's target,
|
|
253
|
+
* `disablePast`, the agenda "Today" badge and, when the host binds no `anchorDate`, the initially visible period. It rolls over at midnight IN THAT ZONE. Default `''` = the browser's zone (unchanged
|
|
254
|
+
* behaviour). An unknown name never throws: the browser date is used. The `today` input, when valid, still wins over this. Feed `periodGroup(...)` with the same zone's date (`todayInTimezone(zone)` from `@forgeroute/ui/utils`).
|
|
255
|
+
*/
|
|
256
|
+
readonly timeZone: import("@angular/core").InputSignal<string>;
|
|
239
257
|
/** Items shown per month cell before "+N more". */
|
|
240
258
|
readonly maxVisible: import("@angular/core").InputSignal<number>;
|
|
241
259
|
/** `inline`: time and title on one line. `stacked`: time on the first line, title below it (title hidden on phones). */
|
|
@@ -295,7 +313,11 @@ export declare class CalendarComponent {
|
|
|
295
313
|
protected formatHour(h: number): string;
|
|
296
314
|
/** The browser clock's today as `YYYY-MM-DD`; refreshed at local midnight, when the tab becomes visible again and when the user presses Today. */
|
|
297
315
|
private readonly clockToday;
|
|
298
|
-
/**
|
|
316
|
+
/** Bumped whenever the clock is re-read (midnight timer, tab visible, Today) so a zone-derived "today" is recomputed. */
|
|
317
|
+
private readonly clockTick;
|
|
318
|
+
/** The `timeZone` input when it names a real IANA zone, else '' (the browser's zone). */
|
|
319
|
+
private readonly effectiveZone;
|
|
320
|
+
/** Today as `YYYY-MM-DD`: the `today` input when it is a valid date, else the date in the `timeZone` zone, else the browser clock. */
|
|
299
321
|
protected readonly todayStr: import("@angular/core").Signal<string>;
|
|
300
322
|
/** The month-grid day that holds the roving tab stop. */
|
|
301
323
|
protected readonly focusedDate: import("@angular/core").WritableSignal<string | null>;
|
|
@@ -479,6 +501,11 @@ export declare class CalendarComponent {
|
|
|
479
501
|
"required": false;
|
|
480
502
|
"isSignal": true;
|
|
481
503
|
};
|
|
504
|
+
"timeZone": {
|
|
505
|
+
"alias": "timeZone";
|
|
506
|
+
"required": false;
|
|
507
|
+
"isSignal": true;
|
|
508
|
+
};
|
|
482
509
|
"maxVisible": {
|
|
483
510
|
"alias": "maxVisible";
|
|
484
511
|
"required": false;
|
|
@@ -1,15 +1,30 @@
|
|
|
1
1
|
import { BadgeVariant } from "@forgeroute/ui/table-types";
|
|
2
2
|
import { UiLabelsService } from "@forgeroute/ui/core";
|
|
3
3
|
import * as i0 from "@angular/core";
|
|
4
|
+
import * as i1 from "@forgeroute/ui/tooltip";
|
|
4
5
|
/** Colour of the priority dot (`high` red, `medium` amber, `low` grey, `blue`, `green`); `none` = no dot. */
|
|
5
6
|
export type CardListIndicator = 'high' | 'medium' | 'low' | 'blue' | 'green' | 'none';
|
|
6
7
|
/** Icon of the round marker on the left. */
|
|
7
8
|
export type CardListIcon = 'call' | 'email' | 'sms' | 'task' | 'doc' | 'money' | 'deal' | 'survey' | 'property' | 'search' | 'heart' | 'calc' | 'repeat';
|
|
9
|
+
/**
|
|
10
|
+
* Internal: wraps ONE projected `[card-list-action]` element (a link or a button the app owns) so the library draws it as an icon right of the title
|
|
11
|
+
* and gives it the `uiTooltip` bubble. Never used by apps.
|
|
12
|
+
*/
|
|
13
|
+
export declare class CardListActionWrapComponent {
|
|
14
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<CardListActionWrapComponent, never>;
|
|
15
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<CardListActionWrapComponent, "ui-card-list-action-wrap", never, {}, {}, never, ["*"], true, [{
|
|
16
|
+
directive: typeof i1.TooltipDirective;
|
|
17
|
+
inputs: {
|
|
18
|
+
"uiTooltip": "uiTooltip";
|
|
19
|
+
};
|
|
20
|
+
outputs: {};
|
|
21
|
+
}]>;
|
|
22
|
+
}
|
|
8
23
|
/**
|
|
9
24
|
* Record row for the cards of a detail page (tasks, documents, deals, expenses, matches, surveys...). The layout is fixed;
|
|
10
25
|
* pass inputs only:
|
|
11
26
|
*
|
|
12
|
-
* [dot | round icon] [title] [
|
|
27
|
+
* [dot | round icon] [title] [edit] [view] [action] [delete] [type badge] [status badge]
|
|
13
28
|
* [description] [inline link]
|
|
14
29
|
* [calendar icon + date]
|
|
15
30
|
*
|
|
@@ -20,22 +35,34 @@ export type CardListIcon = 'call' | 'email' | 'sms' | 'task' | 'doc' | 'money' |
|
|
|
20
35
|
* [editButton]="true" (editClick)="edit(t)" [viewButton]="true" (viewClick)="view(t)" />
|
|
21
36
|
*
|
|
22
37
|
* Links: the library has no router, so a link is content you project and the app owns (`routerLink` etc.):
|
|
23
|
-
* - `<a card-list-action class="cli-chip cli-chip--view" routerLink="/x">View</a
|
|
38
|
+
* - `<a card-list-action class="cli-chip cli-chip--view" routerLink="/x">View</a>`: the library draws it as the same eye icon button as `[viewButton]` (the word is not painted; the `aria-label` is the tooltip via `uiTooltip` and the accessible name) right of the title, next to the other icon actions. Any other projected `[card-list-action]` element (an icon `ui-button`...) is placed there too with a tooltip from its aria-label / title. Apps change nothing;
|
|
24
39
|
* - `<a card-list-inline class="cli-inline-link" routerLink="/x">View ...</a>` at the end of the description line.
|
|
25
|
-
* Other projected content (default slot) shows
|
|
40
|
+
* Other projected content (default slot) shows at the row end; `[card-stats]` and `[card-detail]` add a footer row
|
|
26
41
|
* under the row (use the `.cli-stat`, `.cli-stat-label`, `.cli-stat-value`, `.cli-stat-divider` classes inside `[card-stats]`).
|
|
27
42
|
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
* - `
|
|
43
|
+
* Actions are ICONS, never text buttons: Edit, View, a generic action and Delete are small icon buttons to the right of the title (in that order), each with a tooltip
|
|
44
|
+
* (the `uiTooltip` directive) that says what it is, so the icon alone is always clear on hover and keyboard focus. The tooltip text is also the accessible name.
|
|
45
|
+
* - `[editButton]="true"` -> `(editClick)`; `editAriaLabel` names it ("Edit task Call John"), default "Edit".
|
|
46
|
+
* - `[viewButton]="true"` -> `(viewClick)`; `viewAriaLabel`, default "View".
|
|
47
|
+
* - `actionLabel="Download"` -> `(action)`: the label is the tooltip and the accessible name (`actionAriaLabel` wins when given); `actionIcon` (the `d` of a 24x24 stroke path)
|
|
48
|
+
* is its icon (a right arrow when none is given: always pass one); `actionTestId` sets its `data-testid`.
|
|
49
|
+
* - `[deletable]="true"` -> `(delete)`; `deleteLabel` names it (default "Delete"), `deleteTestId` sets its `data-testid`. The page owns the confirmation (the component never deletes anything itself).
|
|
32
50
|
*
|
|
33
|
-
* Accessibility:
|
|
34
|
-
* ("Edit task Call John")
|
|
51
|
+
* Accessibility: every icon is a real button with an accessible name; give it a longer one with `editAriaLabel` / `viewAriaLabel` / `deleteLabel`
|
|
52
|
+
* ("Edit task Call John") to tell the rows of a list apart. The priority dot (`high`/`medium`/`low`) has a tooltip and an
|
|
35
53
|
* accessible name (`High priority`, ...), is focusable so the tooltip works by keyboard; `blue`/`green` dots are decorative. The icon circle is decorative.
|
|
36
54
|
*/
|
|
37
55
|
export declare class CardListItemComponent {
|
|
38
56
|
protected readonly labels: UiLabelsService;
|
|
57
|
+
private readonly host;
|
|
58
|
+
private readonly destroyRef;
|
|
59
|
+
private readonly actionSlot;
|
|
60
|
+
private readonly actionStage;
|
|
61
|
+
private readonly wraps;
|
|
62
|
+
constructor();
|
|
63
|
+
/** The text a projected action is named by: its aria-label (or the host attribute of a `ui-button`), else its title, else its text. */
|
|
64
|
+
private static actionLabelOf;
|
|
65
|
+
private adopt;
|
|
39
66
|
readonly title: import("@angular/core").InputSignal<string>;
|
|
40
67
|
readonly description: import("@angular/core").InputSignal<string | undefined>;
|
|
41
68
|
/** Date text with a small calendar icon, e.g. "Due Aug 21, 2026". Pre-formatted by the page. */
|
|
@@ -71,8 +98,6 @@ export declare class CardListItemComponent {
|
|
|
71
98
|
readonly actionIcon: import("@angular/core").InputSignal<string>;
|
|
72
99
|
readonly actionTestId: import("@angular/core").InputSignal<string>;
|
|
73
100
|
readonly actionAriaLabel: import("@angular/core").InputSignal<string>;
|
|
74
|
-
/** A built-in Edit / View / action / delete button shows (the row then keeps a minimum height so a badge and a chip never overlap). */
|
|
75
|
-
protected readonly hasBuiltInChip: import("@angular/core").Signal<boolean>;
|
|
76
101
|
readonly editClick: import("@angular/core").OutputEmitterRef<void>;
|
|
77
102
|
readonly viewClick: import("@angular/core").OutputEmitterRef<void>;
|
|
78
103
|
readonly delete: import("@angular/core").OutputEmitterRef<void>;
|
|
@@ -80,6 +105,7 @@ export declare class CardListItemComponent {
|
|
|
80
105
|
protected readonly calendarPath = "M5 4h14a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2z M16 2v4 M8 2v4 M3 10h18";
|
|
81
106
|
protected readonly editPath = "M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7 M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z";
|
|
82
107
|
protected readonly eyePath = "M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z M12 9a3 3 0 1 0 0 6 3 3 0 0 0 0-6z";
|
|
108
|
+
protected readonly actionFallbackPath = "M5 12h14 M12 5l7 7-7 7";
|
|
83
109
|
protected readonly trashPath = "M3 6h18 M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2 M19 6l-1 14a2 2 0 0 1-2 2H8a2 2 0 0 1-2-2L5 6 M10 11v6 M14 11v6";
|
|
84
110
|
protected readonly iconPath: import("@angular/core").Signal<string | null>;
|
|
85
111
|
protected readonly indicatorLabel: import("@angular/core").Signal<string>;
|
|
@@ -1827,6 +1827,9 @@ export declare const UI_DEFAULT_LABELS: {
|
|
|
1827
1827
|
readonly 'dataTable.summaryDone': "{{ count }} {{ done }}";
|
|
1828
1828
|
readonly 'dataTable.summarySkipped': "{{ count }} skipped";
|
|
1829
1829
|
readonly 'dataTable.summaryNotAllowed': "{{ count }} not allowed";
|
|
1830
|
+
readonly 'dataTable.summaryBusy': "{{ count }} busy (try again)";
|
|
1831
|
+
readonly 'dataTable.summaryBusyOnly_one': "{{ count }} {{ item }} is busy: another save was in progress, try again.";
|
|
1832
|
+
readonly 'dataTable.summaryBusyOnly_other': "{{ count }} {{ item }} are busy: another save was in progress, try again.";
|
|
1830
1833
|
readonly 'dataTable.summaryUsesCountAgreement': "no";
|
|
1831
1834
|
readonly 'dataTable.summaryAll_one': "{{ count }} {{ item }}(s) {{ done }}.";
|
|
1832
1835
|
readonly 'dataTable.summaryAll_other': "{{ count }} {{ item }}(s) {{ done }}.";
|
|
@@ -367,8 +367,17 @@ export declare class DataTableComponent<T extends Record<string, any>> implement
|
|
|
367
367
|
protected _selectedText(): string;
|
|
368
368
|
/** `<base>_one` / `<base>_other` label for a count, with `count` (and any `extra` placeholders) filled in. */
|
|
369
369
|
private _plural;
|
|
370
|
-
/**
|
|
370
|
+
/**
|
|
371
|
+
* "3 updated, 1 skipped, 2 not allowed, 4 busy (try again)." when some rows were left out ("Actualización: 3, omisiones: 1, sin permiso: 2, en uso: 4 (intente de nuevo)." in Spanish), else "3 item(s) updated.".
|
|
372
|
+
* `busy` = rows another save held at that moment (the backend's `busy`, not part of `skipped`); when ONLY busy rows exist the sentence is "4 contacts are busy: another save was in progress, try again.".
|
|
373
|
+
*/
|
|
371
374
|
private _resultSummary;
|
|
375
|
+
/** The response's `busy`: a finite number above 0 (whole rows), else 0 (absent, 0, negative, text, NaN: ignored). */
|
|
376
|
+
private _busyOf;
|
|
377
|
+
/** Every row that was sent was busy (nothing updated / skipped / refused): the selection (and an open "Change <field>" select) is kept so the user can simply try again. */
|
|
378
|
+
private _allBusy;
|
|
379
|
+
/** The toast of a finished bulk request: busy rows with nothing changed = an amber warning (polite live region, retry needed); a server `message` with nothing changed = an error; otherwise the success toast. */
|
|
380
|
+
private _toastBulkResult;
|
|
372
381
|
/** "3 item(s) updated." in English (the singular word and "(s)"); "Actualización: 3 contactos." in a language whose dictionary turns `dataTable.summaryUsesCountAgreement` on (the word agrees with the count). */
|
|
373
382
|
private _summaryAll;
|
|
374
383
|
/** Default bulk-Delete confirm title: "Delete " + the title-cased plural item label ("template" → "Delete Templates", "lien waiver" → "Delete Lien Waivers"). */
|
|
@@ -629,7 +629,7 @@ export declare class DocumentSendOptionsComponent implements UiFieldValidity {
|
|
|
629
629
|
/** Roles of documents whose row had no `signerRoles` and that the host resolves (`signers().resolveRoles`). */
|
|
630
630
|
readonly roleStates: import("@angular/core").WritableSignal<Record<string, RoleState>>;
|
|
631
631
|
/** The envelope's documents: `loading` / `error` while the panel reads them (`loadDocuments`), `ready` once known. */
|
|
632
|
-
readonly envelopeStatus: import("@angular/core").WritableSignal<"
|
|
632
|
+
readonly envelopeStatus: import("@angular/core").WritableSignal<"idle" | "loading" | "ready" | "error">;
|
|
633
633
|
private envelopeSub;
|
|
634
634
|
private readonly roleSubs;
|
|
635
635
|
/** The sender opened the collapsed "Signing options" line. */
|
|
@@ -100,6 +100,12 @@ export declare class PanelInfoListComponent {
|
|
|
100
100
|
* one grid row end at the same height; with one section, that section's box fills the height. Default false = as tall as its content.
|
|
101
101
|
*/
|
|
102
102
|
readonly fill: import("@angular/core").InputSignal<boolean>;
|
|
103
|
+
/**
|
|
104
|
+
* For a list placed inside a card (`ui-detail-card`, a side panel) that already has a box: no card within a card. Draws the list
|
|
105
|
+
* without its own border and rounded box, and each row as a small capital label above a bold value with a thin divider between rows.
|
|
106
|
+
* Default false = the bordered box with the label left and the value right, as before.
|
|
107
|
+
*/
|
|
108
|
+
readonly flat: import("@angular/core").InputSignal<boolean>;
|
|
103
109
|
readonly displaySections: import("@angular/core").Signal<PanelInfoSection[]>;
|
|
104
110
|
/**
|
|
105
111
|
* The safe href of an item, or null: `href` first, else `mailto:`/`tel:` built from `email`/`phone`. Only mailto, tel, http and https
|
|
@@ -143,5 +149,10 @@ export declare class PanelInfoListComponent {
|
|
|
143
149
|
"required": false;
|
|
144
150
|
"isSignal": true;
|
|
145
151
|
};
|
|
152
|
+
"flat": {
|
|
153
|
+
"alias": "flat";
|
|
154
|
+
"required": false;
|
|
155
|
+
"isSignal": true;
|
|
156
|
+
};
|
|
146
157
|
}, {}, never, never, true, never>;
|
|
147
158
|
}
|
|
@@ -792,7 +792,7 @@ export declare class QboConnectComponent {
|
|
|
792
792
|
readonly loading: import("@angular/core").ModelSignal<boolean>;
|
|
793
793
|
protected readonly awaiting: import("@angular/core").WritableSignal<boolean>;
|
|
794
794
|
protected readonly confirming: import("@angular/core").WritableSignal<boolean>;
|
|
795
|
-
protected readonly state: import("@angular/core").Signal<"
|
|
795
|
+
protected readonly state: import("@angular/core").Signal<"none" | "connected" | "reconnect">;
|
|
796
796
|
protected readonly company: import("@angular/core").Signal<string>;
|
|
797
797
|
protected readonly connectedOn: import("@angular/core").Signal<string>;
|
|
798
798
|
/** What the persistent status region says: the current state, plus "Loading." while a request runs. */
|