mn-angular-lib 2.0.49 → 2.0.50
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.
|
@@ -1704,7 +1704,7 @@ var MnTable = class MnTable extends MnSelectableCollectionBase {
|
|
|
1704
1704
|
],
|
|
1705
1705
|
usesInheritance: true,
|
|
1706
1706
|
ngImport: i0,
|
|
1707
|
-
template: "<!-- Everything that reflows lives inside a @container, so the breakpoints below\n measure the table's own width rather than the window's. A table in a modal,\n a sidebar or a narrow grid cell is far narrower than the viewport, and\n viewport breakpoints would hand it a desktop layout it has no room for. -->\n<div class=\"@container\">\n <!-- Selection summary: the whole selection, never paged, filtered or sorted. The\n table below answers \"what could I pick?\", which is why it is searched and paged;\n this answers \"what did I pick?\", which a paginated list cannot without hiding\n most of the answer on some other page. -->\n @if (showSelectionSummary) {\n <div class=\"flex flex-col gap-2 rounded-md border border-base-300 bg-base-200/50 p-3 mb-3\">\n <div class=\"flex items-center justify-between gap-2\">\n <span class=\"text-sm font-medium text-base-content\">{{ selectionSummaryTitle }}</span>\n <button\n (click)=\"clearSelection()\"\n [data]=\"{ variant: 'text', color: 'gray', size: 'sm', borderRadius: 'md', hover: true }\"\n class=\"gap-1 shrink-0\"\n mnButton\n type=\"button\"\n >\n <svg [size]=\"14\" [lucideIcon]=\"icons.X\"></svg>\n <span>{{ selectionClearAllLabel }}</span>\n </button>\n </div>\n <!-- Only the first few tags render; the rest collapse behind a \"+N more\" control.\n The heading's count always states the true total, so this hides tags, never\n information. Expanded, the list is height-capped and scrolls, so even a\n selection of hundreds cannot push the table off screen. -->\n <ul\n [class.max-h-28]=\"selectionSummaryExpanded\"\n [class.overflow-y-auto]=\"selectionSummaryExpanded\"\n class=\"flex flex-wrap gap-1.5 list-none m-0 p-0\"\n >\n @for (row of visibleSelectionRows; track dataSource.getID(row)) {\n <li\n class=\"inline-flex items-center gap-1 rounded-full bg-base-100 border border-base-300 pl-2.5 pr-1 py-0.5 text-xs text-base-content max-w-full\">\n <span [attr.title]=\"selectionLabelFor(row)\" class=\"truncate\">{{ selectionLabelFor(row) }}</span>\n <button\n (click)=\"removeSelection(row)\"\n [attr.aria-label]=\"selectionRemoveLabel(row)\"\n class=\"shrink-0 rounded-full p-0.5 hover:bg-base-300 transition-colors cursor-pointer\"\n type=\"button\"\n >\n <svg [size]=\"12\" [lucideIcon]=\"icons.X\"></svg>\n </button>\n </li>\n }\n @if (hiddenSelectionCount > 0 || selectionSummaryExpanded) {\n <li>\n <button\n (click)=\"toggleSelectionSummary()\"\n [attr.aria-expanded]=\"selectionSummaryExpanded\"\n [data]=\"{ variant: 'text', color: 'primary', size: 'sm', borderRadius: 'md', hover: true }\"\n class=\"text-xs\"\n mnButton\n type=\"button\"\n >\n {{ selectionSummaryToggleLabel }}\n </button>\n </li>\n }\n </ul>\n </div>\n }\n\n <!-- Toolbar: custom toolbar template + search. Only rendered when it has content,\n so an unsearchable table without toolbar templates emits no empty spacer. -->\n@if (showsSearch || dataSource.toolbarLeftTemplate || dataSource.toolbarRightTemplate || showsFilterButton) {\n <div class=\"flex flex-col @min-[420px]:flex-row @min-[420px]:items-center justify-between gap-2 mb-3\">\n <!-- The left slot only when it has content: an empty one still took a flex gap, which\n pushed the search 8px in from the page edge. ml-auto keeps the search on the right. -->\n @if (dataSource.toolbarLeftTemplate) {\n <div class=\"flex items-center gap-2 w-full @min-[420px]:w-auto\">\n <div class=\"flex flex-col w-full @min-[420px]:w-auto @min-[420px]:flex-row\">\n <ng-container [ngTemplateOutlet]=\"dataSource.toolbarLeftTemplate\"></ng-container>\n </div>\n </div>\n }\n <div\n class=\"flex flex-col @min-[420px]:flex-row @min-[420px]:items-center gap-2 w-full @min-[420px]:flex-1 @min-[420px]:ml-auto @min-[560px]:flex-none @min-[560px]:w-auto\">\n <!-- Search and the filter button share one row: two full-width bars stacked above the\n first row pushed the content a whole screen down on a phone. -->\n @if (showsSearch || showsFilterButton) {\n <div class=\"flex items-center gap-2 w-full @min-[420px]:flex-1 @min-[560px]:flex-none\">\n @if (showsSearch) {\n <!-- Enter must not submit a surrounding form: the search box belongs to the\n table's chrome, not to whatever form the table happens to sit in. -->\n <mn-lib-input-field\n (keydown.enter)=\"$event.preventDefault()\"\n class=\"min-w-0 flex-1 @min-[560px]:flex-none @min-[560px]:min-w-64\"\n [props]=\"{\n id: 'mn-table-search',\n type: 'search',\n label: '',\n ariaLabel: searchPlaceholderLabel,\n placeholder: searchPlaceholderLabel,\n size: 'sm',\n borderRadius: 'md',\n fullWidth: true\n }\"\n [ngModel]=\"searchValue\"\n (ngModelChange)=\"onSearch($event)\"\n ></mn-lib-input-field>\n }\n <!-- Below 640px the header row with its sort buttons and the inline filter row are\n gone; this one button opens both, with a count while filters are set. -->\n @if (showsFilterButton) {\n <button\n type=\"button\"\n mnButton\n [data]=\"{ variant: 'outline', color: 'primary', size: 'md', borderRadius: 'md', hover: true }\"\n class=\"shrink-0 gap-1.5 px-2.5\"\n [class.ml-auto]=\"!showsSearch\"\n [attr.aria-label]=\"filtersButtonAriaLabel\"\n [attr.title]=\"filterSheetLabel\"\n [attr.aria-expanded]=\"filtersPanelOpen\"\n aria-controls=\"mn-table-filters-panel\"\n (click)=\"openFiltersPanel()\"\n >\n <svg [lucideIcon]=\"icons.Funnel\" [size]=\"17\"></svg>\n <!-- The count sits inside the button: a badge hanging off its corner reached past the\n table's right edge and gave a container that clips or scrolls a sideways scroll. -->\n @if (activeFilterCount > 0) {\n <span class=\"text-sm font-semibold leading-none tabular-nums\" aria-hidden=\"true\">{{ activeFilterCount }}</span>\n }\n </button>\n }\n </div>\n }\n @if (dataSource.toolbarRightTemplate) {\n <div class=\"flex flex-col w-full @min-[420px]:w-auto @min-[420px]:flex-row\">\n <ng-container [ngTemplateOutlet]=\"dataSource.toolbarRightTemplate\"></ng-container>\n </div>\n }\n </div>\n</div>\n}\n\n<!-- Small-screen filters: full-width fields decoupled from column widths, presented\n as a bottom sheet so they overlay rather than push the table down. -->\n@if (showsFilterButton && filtersPanelOpen) {\n <mn-bottom-sheet\n #filtersSheet\n (dismiss)=\"filtersPanelOpen = false\"\n [ariaLabel]=\"filterSheetLabel\"\n [growWithKeyboard]=\"true\"\n [maxHeightVh]=\"80\"\n >\n <div id=\"mn-table-filters-panel\" class=\"flex flex-col gap-3 px-4 pb-4\">\n <span class=\"text-base font-semibold text-base-content\">{{ filterSheetLabel }}</span>\n <!-- Sorting lives here below 640px: the header row whose buttons sorted is not rendered.\n The choices are inline radios, not a select: a select opens its own bottom sheet on a\n phone, which stacked a second sheet on this one and cut its list off. One row per\n column, the direction as a separate switch once a column is picked. -->\n @if (sortableColumns.length > 0) {\n <fieldset class=\"m-0 flex flex-col gap-2 border-0 p-0\">\n <legend\n class=\"mb-1 p-0 text-xs font-medium text-base-content/70\"\n [class.sr-only]=\"!hasColumnFilters\"\n >{{ sortByLabel }}</legend>\n <div class=\"flex flex-col\">\n <label class=\"flex min-h-11 cursor-pointer items-center gap-3 text-sm text-base-content\">\n <input\n type=\"radio\"\n class=\"size-[1.125rem] shrink-0 cursor-pointer appearance-none rounded-full border-2 border-base-content/40 bg-base-100 transition-[border] checked:border-[0.3125rem] checked:border-primary focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary\"\n [name]=\"sortGroupName\"\n value=\"\"\n [checked]=\"!currentSort\"\n (change)=\"onSortColumn('')\"\n />\n <span>{{ sortDefaultLabel }}</span>\n </label>\n @for (column of sortableColumns; track column.key) {\n <!-- The chosen column carries its own direction button at the row's end: it sits\n inside a row that is already there, so picking a column never grows the sheet,\n and no greyed-out switch shows while the default order is chosen. -->\n <div class=\"flex min-h-11 items-center gap-2\">\n <label class=\"flex min-w-0 flex-1 cursor-pointer items-center gap-3 self-stretch text-sm text-base-content\">\n <input\n type=\"radio\"\n class=\"size-[1.125rem] shrink-0 cursor-pointer appearance-none rounded-full border-2 border-base-content/40 bg-base-100 transition-[border] checked:border-[0.3125rem] checked:border-primary focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary\"\n [name]=\"sortGroupName\"\n [value]=\"column.key\"\n [checked]=\"currentSort?.columnKey === column.key\"\n (change)=\"onSortColumn(column.key)\"\n />\n <span class=\"truncate\">{{ headerText(column) || column.key }}</span>\n </label>\n @if (currentSort?.columnKey === column.key) {\n <button\n type=\"button\"\n mnButton\n [data]=\"{ variant: 'outline', color: 'primary', size: 'sm', borderRadius: 'md', hover: true }\"\n class=\"shrink-0 gap-1.5\"\n [attr.aria-label]=\"sortDirectionButtonLabel\"\n (click)=\"toggleSortDirection()\"\n >\n <svg [lucideIcon]=\"currentSort.direction === 'desc' ? icons.ArrowDown : icons.ArrowUp\" [size]=\"15\"></svg>\n <span>{{ sortDirectionLabel }}</span>\n </button>\n }\n </div>\n }\n </div>\n </fieldset>\n @if (hasColumnFilters) {\n <div class=\"border-t border-base-300\" aria-hidden=\"true\"></div>\n }\n }\n @for (column of dataSource.columns; track column.key) {\n @if (column.filterable) {\n <div class=\"flex flex-col gap-1\">\n <label\n class=\"text-xs font-medium text-base-content/70\"\n [attr.for]=\"'mn-table-filter-panel-' + column.key\"\n >\n @if (isTemplateRef(column.header)) {\n <ng-container [ngTemplateOutlet]=\"$any(column.header)\"></ng-container>\n } @else {\n {{ headerText(column) }}\n }\n </label>\n <!-- The field template is declared outside the sheet, so it would inject from there;\n this injector tells its selects they are in a sheet (no second sheet on top). -->\n <ng-container\n [ngTemplateOutletContext]=\"{ $implicit: column, idScope: 'panel' }\"\n [ngTemplateOutletInjector]=\"inSheetInjector\"\n [ngTemplateOutlet]=\"filterField\"\n ></ng-container>\n </div>\n }\n }\n @if (hasActiveFilters) {\n <button\n type=\"button\"\n mnButton\n [data]=\"{ variant: 'text', color: 'gray', size: 'sm', borderRadius: 'md', hover: true }\"\n class=\"self-start gap-1\"\n (click)=\"clearAllFilters()\"\n >\n <svg [lucideIcon]=\"icons.X\" [size]=\"14\"></svg>\n <span>{{ clearFiltersButtonLabel }}</span>\n </button>\n }\n <div class=\"mt-1 flex min-[400px]:justify-end\">\n <button\n type=\"button\"\n mnButton\n [data]=\"{ variant: 'fill', color: 'primary', size: 'md', borderRadius: 'md', hover: true }\"\n class=\"w-full min-[400px]:w-auto\"\n (click)=\"closeFiltersPanel()\"\n >\n <span>{{ filtersCloseLabel }}</span>\n </button>\n </div>\n </div>\n </mn-bottom-sheet>\n}\n\n<!-- Detail sheet (below 640px): the whole record of one row — title and right-side value as the\n heading, every other column as a label/value list, then the actions. It is the only place a\n column the composed row could not show, or an action, is reachable on a phone. -->\n@if (detailRow !== null) {\n @let row = detailRow;\n <mn-bottom-sheet\n #detailSheet\n (dismiss)=\"onDetailDismissed()\"\n [ariaLabel]=\"rowLabel(row)\"\n [maxHeightVh]=\"85\"\n >\n <!-- Escape closes it: the sheet itself only handles the backdrop and the drag. Focus is\n moved inside on open, so the key arrives here by bubbling. -->\n <!-- eslint-disable-next-line @angular-eslint/template/interactive-supports-focus -->\n <div class=\"flex flex-col gap-4 px-4 pb-4\" (keydown.escape)=\"closeDetail()\">\n <div class=\"flex items-start gap-3\">\n <h2\n #detailHeading\n class=\"m-0 min-w-0 flex-1 text-lg font-semibold leading-snug text-base-content outline-none [overflow-wrap:anywhere]\"\n tabindex=\"-1\"\n >\n @if (rowLayout.title; as title) {\n <ng-container [ngTemplateOutlet]=\"fullCell\" [ngTemplateOutletContext]=\"{ $implicit: title, row: row }\"></ng-container>\n }\n </h2>\n @if (rowLayout.trailing && !rowValueEmpty(rowLayout.trailing, row)) {\n @let trailing = rowLayout.trailing;\n <span class=\"flex shrink-0 flex-col items-end gap-0.5 text-right\">\n @if (rowSlotLabel(trailing); as trailingLabel) {\n <span class=\"text-xs text-(--color-base-content-muted,color-mix(in_oklab,var(--color-base-content)_65%,transparent))\">{{ trailingLabel }}</span>\n }\n <span class=\"text-lg font-semibold tabular-nums text-base-content\">\n <ng-container [ngTemplateOutlet]=\"fullCell\" [ngTemplateOutletContext]=\"{ $implicit: trailing, row: row }\"></ng-container>\n </span>\n </span>\n }\n </div>\n @if (detailColumns.length > 0) {\n <dl class=\"m-0 grid grid-cols-[minmax(0,8rem)_minmax(0,1fr)] gap-x-3 gap-y-2.5 border-t border-base-300 pt-4 text-sm\">\n @for (column of detailColumns; track column.key) {\n <!-- An empty value or a lone dash says nothing here either (\"Beschrijving: -\"). -->\n @if (!rowValueEmpty(column, row)) {\n <dt class=\"text-(--color-base-content-muted,color-mix(in_oklab,var(--color-base-content)_65%,transparent))\">\n @if (isTemplateRef(column.header)) {\n <ng-container [ngTemplateOutlet]=\"$any(column.header)\"></ng-container>\n } @else {\n {{ headerText(column) }}\n }\n </dt>\n <dd class=\"m-0 min-w-0 text-base-content [overflow-wrap:anywhere]\">\n <ng-container [ngTemplateOutlet]=\"fullCell\" [ngTemplateOutletContext]=\"{ $implicit: column, row: row }\"></ng-container>\n </dd>\n }\n }\n </dl>\n }\n @if (rowHasAnyActions(row)) {\n <div class=\"flex flex-col gap-2 border-t border-base-300 pt-4\">\n @for (column of rowLayout.actions; track column.key) {\n @for (action of visibleRowActions(column, row); track $index) {\n <button\n mnButton\n type=\"button\"\n [data]=\"{\n variant: 'outline',\n color: rowActionColor(action, row),\n size: 'md',\n borderRadius: 'md',\n hover: true,\n disabled: isRowActionDisabled(action, row)\n }\"\n class=\"w-full gap-2\"\n [attr.aria-disabled]=\"isRowActionDisabled(action, row) || null\"\n (click)=\"runDetailAction(action, row)\"\n >\n @let icon = rowActionIcon(action, row);\n @if (icon) {\n <span class=\"inline-flex shrink-0 items-center\">\n @if (isTemplateRef(icon)) {\n <ng-container [ngTemplateOutlet]=\"icon\"></ng-container>\n } @else {\n <svg [lucideIcon]=\"$any(icon)\" [size]=\"17\"></svg>\n }\n </span>\n }\n <span>{{ rowActionLabel(action, row) }}</span>\n </button>\n }\n }\n </div>\n }\n </div>\n </mn-bottom-sheet>\n}\n\n<!-- Announces loading. The skeletons are aria-hidden, so without this a screen reader hears\n nothing while rows load. The region stays in the DOM and only its text changes, which is\n what makes assistive tech read it; one inserted with its text already set is often missed. -->\n<span class=\"sr-only\" role=\"status\">{{ isLoadingState ? loadingLabel : '' }}</span>\n\n<!-- Table wrapper with horizontal scroll -->\n <div #collectionBody [attr.aria-busy]=\"isLoadingState || null\" [attr.aria-label]=\"tableRegionLabel\" [style.min-height.px]=\"bodyMinHeight\"\n class=\"overflow-x-auto\"\n role=\"region\">\n @if (rowMode) {\n <!-- Below 640px every row is a composed line (see resolveRowLayout): the columns that\n would not fit as cells become a title, a second line and a value on the right, and\n the rest waits in the detail sheet a tap opens. A list, not a table: there are no\n columns left for a screen reader to navigate. -->\n <ul class=\"m-0 list-none p-0\">\n <!-- A \"Load more\" refetch keeps the rows it is adding to (see loadMorePhoneRows). -->\n @if (isLoadingState && !phoneLoadingMore) {\n @for (_ of skeletonRows; track $index) {\n <li aria-hidden=\"true\" class=\"flex items-center gap-3 border-b border-base-300 bg-base-100 px-2 py-3\">\n <div class=\"flex flex-1 flex-col gap-2\">\n <mn-skeleton [data]=\"{ shape: 'text', width: '60%' }\"></mn-skeleton>\n <mn-skeleton [data]=\"{ shape: 'text', width: '40%', height: '0.75rem' }\"></mn-skeleton>\n </div>\n </li>\n }\n } @else if (isErrorState) {\n <li class=\"bg-base-100 py-8 text-center text-xs\">\n <ng-container [ngTemplateOutlet]=\"errorContent\"></ng-container>\n </li>\n } @else {\n @if (filteredItems.length === 0) {\n <li class=\"bg-base-100 text-center text-xs\">\n <ng-container [ngTemplateOutlet]=\"emptyContent\"></ng-container>\n </li>\n }\n @for (row of paginatedItems; track trackByID($index, row)) {\n @let tap = rowTap(row);\n <li\n class=\"flex items-stretch border-b border-base-300 bg-base-100\"\n [ngClass]=\"{ 'bg-primary/10': isSelected(row) }\"\n >\n @if (hasSelection) {\n <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events,@angular-eslint/template/interactive-supports-focus -->\n <div class=\"flex shrink-0 items-center pl-2\" (click)=\"$event.stopPropagation()\">\n <mn-lib-checkbox\n (checkedChange)=\"toggle(row)\"\n [checked]=\"isSelected(row)\"\n [props]=\"{ id: 'mn-table-row-' + $index, size: 'sm' }\"\n ></mn-lib-checkbox>\n </div>\n }\n @if (tap === 'detail' || tap === 'click') {\n <button\n type=\"button\"\n class=\"flex min-w-0 flex-1 cursor-pointer items-start gap-3 px-2 py-3 text-left transition-colors duration-150 hover:bg-base-200 focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-primary\"\n [attr.aria-haspopup]=\"tap === 'detail' ? 'dialog' : null\"\n (click)=\"onRowTap(row, $event)\"\n >\n <ng-container [ngTemplateOutlet]=\"rowBody\" [ngTemplateOutletContext]=\"{ $implicit: row, chevron: true }\"></ng-container>\n </button>\n } @else {\n <!-- A selection row toggles on a click anywhere, as the wide table's row does; the\n checkbox is its keyboard control, so this area needs no focus of its own. -->\n <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events,@angular-eslint/template/interactive-supports-focus -->\n <div\n class=\"flex min-w-0 flex-1 items-start gap-3 px-2 py-3\"\n [class.cursor-pointer]=\"tap === 'select'\"\n (click)=\"tap === 'select' && onRowClick(row)\"\n >\n <ng-container [ngTemplateOutlet]=\"rowBody\" [ngTemplateOutletContext]=\"{ $implicit: row, chevron: false }\"></ng-container>\n </div>\n }\n @if (showsRowMore(row)) {\n <button\n type=\"button\"\n class=\"flex w-11 shrink-0 cursor-pointer items-center justify-center text-base-content/70 transition-colors hover:bg-base-200 focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-primary\"\n aria-haspopup=\"dialog\"\n [attr.aria-label]=\"rowDetailsLabel(row)\"\n (click)=\"openDetail(row, $any($event.currentTarget))\"\n >\n <svg [lucideIcon]=\"icons.Ellipsis\" [size]=\"18\"></svg>\n </button>\n }\n @if (showsRowMenu(row)) {\n @for (column of rowLayout.actions; track column.key) {\n @if (hasRowActions(column, row)) {\n <div class=\"flex shrink-0 items-center pr-1\">\n <mn-lib-dropdown [datasource]=\"{\n id: actionsDropdownId(column, row),\n actions: rowDropdownActions(column, row),\n menuLabel: headerText(column),\n size: 'sm'\n }\"></mn-lib-dropdown>\n </div>\n }\n }\n }\n </li>\n }\n }\n </ul>\n } @else {\n <table [class]=\"tableClasses\">\n <thead>\n <tr class=\"bg-base-100\">\n <!-- Selection column header. It always carries a screen-reader-only name: a single-select\n table has nothing else in this cell, and a multi-select one only a checkbox, so\n without it the column is announced as a nameless header (axe empty-table-header). -->\n @if (hasSelection) {\n <th class=\"w-10 text-center text-sm px-2 py-2\">\n <span class=\"sr-only\">{{ selectionColumnLabel }}</span>\n @if (isMultiSelect) {\n <mn-lib-checkbox\n (checkedChange)=\"toggleAll()\"\n [checked]=\"allSelected\"\n [props]=\"{ id: 'mn-table-select-all', size: 'sm' }\"\n ></mn-lib-checkbox>\n }\n </th>\n }\n\n <!-- Data columns -->\n @for (column of dataSource.columns; track column.key) {\n <th\n [attr.data-column-key]=\"column.key\"\n [class.truncate]=\"widthsArePinned\"\n [class.cursor-pointer]=\"isSortable(column)\"\n [class.select-none]=\"isSortable(column)\"\n [class.hover:bg-base-200]=\"isSortable(column)\"\n [class.text-left]=\"(column.align ?? 'left') === 'left'\"\n [class.text-center]=\"column.align === 'center'\"\n [class.text-right]=\"column.align === 'right'\"\n [mnHiddenBelow]=\"column.hiddenBelow\"\n [style.width]=\"columnWidth(column)\"\n [attr.aria-sort]=\"currentSort?.columnKey === column.key ? (currentSort!.direction === 'asc' ? 'ascending' : 'descending') : null\"\n class=\"text-sm px-2 py-1 @min-[640px]:px-4 @min-[640px]:py-2 whitespace-nowrap\"\n (click)=\"sort(column)\"\n >\n <!-- The header content is declared once; a sortable column wraps it in a real button so\n the sort is reachable by keyboard. The button's click stops there, so the th's own\n click (which keeps the cell padding clickable) does not sort a second time. -->\n <ng-template #headerContent>\n @if (isTemplateRef(column.header)) {\n <ng-container [ngTemplateOutlet]=\"$any(column.header)\"></ng-container>\n } @else {\n <span>{{ headerText(column) }}</span>\n }\n @if (isSortable(column)) {\n <span class=\"text-[0.65rem] opacity-70 min-w-3 inline-block\" aria-hidden=\"true\">{{ getSortIcon(column) }}</span>\n }\n </ng-template>\n @if (isSortable(column)) {\n <button type=\"button\" class=\"inline-flex items-center gap-1 cursor-pointer\" (click)=\"$event.stopPropagation(); sort(column)\">\n <ng-container [ngTemplateOutlet]=\"headerContent\"></ng-container>\n </button>\n } @else {\n <span class=\"inline-flex items-center gap-1\">\n <ng-container [ngTemplateOutlet]=\"headerContent\"></ng-container>\n </span>\n }\n </th>\n }\n\n </tr>\n\n <!-- Per-column filter row (wide screens only; collapses into a panel below 640px).\n The cells are `td`, not `th`: they hold form controls, not headings, and a\n column without a filter would otherwise be an empty header, which assistive tech\n announces as a nameless column (axe `empty-table-header`). `font-normal` stays\n so a consumer's thead styling cannot make the controls bold. -->\n @if (hasColumnFilters && !filtersCollapsed) {\n <tr class=\"bg-base-100 border-b border-base-300 font-normal\">\n @if (hasSelection) {\n <td class=\"px-2 py-1 font-normal\"></td>\n }\n @for (column of dataSource.columns; track column.key) {\n <td\n class=\"px-4 py-2 font-normal\"\n [mnHiddenBelow]=\"column.hiddenBelow\"\n >\n @if (column.filterable) {\n <!-- Every filter renders as an ordinary control right under its\n header. The rich types used to hide behind a button that opened\n a floating panel, which cost a click to discover, a click to\n apply, and hid whether a column was even filterable. -->\n <ng-container\n [ngTemplateOutletContext]=\"{ $implicit: column, idScope: 'inline' }\"\n [ngTemplateOutlet]=\"filterField\"\n ></ng-container>\n }\n </td>\n }\n </tr>\n }\n </thead>\n\n <tbody>\n <!-- Loading state -->\n @if (isLoadingState) {\n @for (_ of skeletonRows; track $index) {\n <tr>\n @if (hasSelection) {\n <td class=\"px-2 py-3\">\n <mn-skeleton [data]=\"{ shape: 'rectangle', width: '1rem', height: '1rem' }\"></mn-skeleton>\n </td>\n }\n @for (column of dataSource.columns; track column.key) {\n <td class=\"px-4 py-3\"\n [mnHiddenBelow]=\"column.hiddenBelow\"\n [style.width]=\"columnWidth(column)\"\n >\n @if (isTemplateRef(column.skeleton)) {\n <ng-container [ngTemplateOutlet]=\"$any(column.skeleton)\"></ng-container>\n } @else {\n <mn-skeleton [data]=\"getColumnSkeletonData(column)\"></mn-skeleton>\n }\n </td>\n }\n </tr>\n }\n } @else if (isErrorState) {\n <!-- Error state -->\n <tr class=\"bg-base-100\">\n <td [attr.colspan]=\"totalColumnCount\" class=\"text-center text-xs py-8\">\n <ng-container [ngTemplateOutlet]=\"errorContent\"></ng-container>\n </td>\n </tr>\n } @else {\n <!-- Empty state -->\n @if (filteredItems.length === 0) {\n <tr class=\"bg-base-100\">\n <td [attr.colspan]=\"totalColumnCount\" class=\"text-center text-xs py-8\">\n <ng-container [ngTemplateOutlet]=\"emptyContent\"></ng-container>\n </td>\n </tr>\n }\n\n <!-- Data rows -->\n @for (row of paginatedItems; track trackByID($index, row); let odd = $odd; let last = $last) {\n <!-- The wash and the pointer promise that a click does something, so only a clickable row gets them. -->\n <tr\n class=\"bg-base-100 transition-colors duration-150 border-b border-base-300\"\n [ngClass]=\"{'bg-primary/10': isSelected(row)}\"\n [class.bg-base-200]=\"!isSelected(row) && odd && dataSource.appearance?.striped\"\n [class.hover:bg-base-200]=\"rowsClickable && dataSource.appearance?.hover !== false\"\n [class.cursor-pointer]=\"rowsClickable\"\n (click)=\"onRowClick(row)\"\n >\n <!-- Selection checkbox -->\n @if (hasSelection) {\n <td (click)=\"$event.stopPropagation()\" class=\"w-10 text-center px-2 py-2\">\n <mn-lib-checkbox\n (checkedChange)=\"toggle(row)\"\n [checked]=\"isSelected(row)\"\n [props]=\"{ id: 'mn-table-row-' + $index, size: 'sm' }\"\n ></mn-lib-checkbox>\n </td>\n }\n\n <!-- Data cells -->\n @for (column of dataSource.columns; track column.key) {\n <td\n [attr.title]=\"cellTitle(column, row)\"\n [class.text-left]=\"(column.align ?? 'left') === 'left'\"\n [class.text-center]=\"column.align === 'center'\"\n [class.text-right]=\"column.align === 'right'\"\n [class.truncate]=\"widthsArePinned\"\n [mnHiddenBelow]=\"column.hiddenBelow\"\n [style.width]=\"columnWidth(column)\"\n class=\"text-xs px-2 py-1 @min-[640px]:px-4 @min-[640px]:py-2\"\n >\n @if (column.actions) {\n <!-- Actions column: inline command buttons. The grid only renders at 640px\n and wider, where they fit; below that the actions move into the row's\n detail sheet. A row with no visible actions renders nothing. -->\n @if (hasRowActions(column, row)) {\n <div class=\"inline-flex items-center gap-1\"\n [class.justify-end]=\"(column.align ?? 'left') === 'right'\">\n <span class=\"inline-flex items-center gap-1\">\n <ng-container [ngTemplateOutletContext]=\"{ column: column, row: row }\"\n [ngTemplateOutlet]=\"actionButtons\"></ng-container>\n </span>\n </div>\n }\n } @else if (column.cellSm) {\n <!-- Default cell: hidden below the cellSm breakpoint -->\n <span [mnShowAbove]=\"column.cellSm.below\">\n @if (isTemplateRef(column.cell)) {\n <ng-container [ngTemplateOutletContext]=\"{ $implicit: row, data: row }\"\n [ngTemplateOutlet]=\"$any(column.cell)\"></ng-container>\n } @else {\n {{ getCellValue(column, row) }}\n }\n </span>\n <!-- Small cell: shown only below the cellSm breakpoint -->\n <span [mnShowBelow]=\"column.cellSm.below\">\n @if (isTemplateRef(column.cellSm.cell)) {\n <ng-container [ngTemplateOutletContext]=\"{ $implicit: row, data: row }\"\n [ngTemplateOutlet]=\"$any(column.cellSm.cell)\"></ng-container>\n } @else {\n {{ getCellSmValue(column, row) }}\n }\n </span>\n } @else {\n @if (isTemplateRef(column.cell)) {\n <ng-container [ngTemplateOutletContext]=\"{ $implicit: row, data: row }\"\n [ngTemplateOutlet]=\"$any(column.cell)\"></ng-container>\n } @else {\n {{ getCellValue(column, row) }}\n }\n }\n </td>\n }\n\n </tr>\n }\n }\n </tbody>\n </table>\n }\n</div>\n\n<!-- Below 640px a paginated table grows instead of paging (see showsPhoneLoadMore). -->\n@if (showsPhoneLoadMore) {\n <div class=\"flex flex-col items-center gap-2 px-2 pb-1 pt-3\">\n <span class=\"text-xs text-(--color-base-content-muted,color-mix(in_oklab,var(--color-base-content)_65%,transparent))\" aria-live=\"polite\">{{ phoneLoadedLabel }}</span>\n <button\n mnButton\n type=\"button\"\n [data]=\"{ variant: 'outline', color: 'primary', size: 'md', borderRadius: 'md', hover: true, disabled: phoneLoadingMore }\"\n class=\"w-full gap-2\"\n [attr.aria-disabled]=\"phoneLoadingMore || null\"\n (click)=\"loadMorePhoneRows()\"\n >\n @if (phoneLoadingMore) {\n <span aria-hidden=\"true\" class=\"inline-block size-3.5 animate-spin rounded-full border-2 border-current border-t-transparent\"></span>\n }\n {{ phoneLoadMoreLabel }}\n </button>\n </div>\n}\n\n<!-- Load more + pagination (not for a single page below 640px, see showsPagination) -->\n@if (showsPagination) {\n<mn-collection-pagination\n (loadMore)=\"loadMoreRows()\"\n (pageChange)=\"goToPage($event)\"\n (pageSizeChange)=\"onPageSizeChange($event)\"\n [currentPage]=\"currentPage\"\n [isPaginated]=\"isPaginated\"\n [isServerPaginated]=\"isServerPaginated\"\n [labels]=\"dataSource.labels\"\n [loadingMoreRows]=\"loadingMoreRows\"\n [pageSizeSelectOptions]=\"pageSizeSelectOptions\"\n [pageSize]=\"pageSize\"\n [showLoadMore]=\"showLoadMore\"\n [totalItemCount]=\"totalItemCount\"\n [totalPages]=\"totalPages\"\n [visiblePages]=\"visiblePages\"\n idPrefix=\"mn-table\"\n></mn-collection-pagination>\n}\n</div>\n\n<!-- Single source of truth for every filter control, reused by the inline header\n row and the small-screen panel. `idScope` keeps element ids unique across\n both placements. -->\n<ng-template #filterField let-column let-idScope=\"idScope\">\n @switch (filterTypeOf(column)) {\n @case ('select') {\n <mn-lib-select\n (ngModelChange)=\"onColumnFilter(column, $event)\"\n [disabled]=\"column.filterDisabled ?? false\"\n [ngModel]=\"textFilterValue(column)\"\n [props]=\"{\n id: 'mn-table-filter-' + idScope + '-' + column.key,\n ariaLabel: filterLabel(column),\n options: getFilterSelectOptions(column),\n placeholder: filterAllLabel(column),\n size: 'sm',\n fullWidth: true\n }\"\n ></mn-lib-select>\n }\n @case ('multi-select') {\n <mn-lib-multi-select\n (ngModelChange)=\"onColumnFilter(column, $event)\"\n [disabled]=\"column.filterDisabled ?? false\"\n [ngModel]=\"multiFilterValue(column)\"\n [props]=\"{\n id: 'mn-table-filter-' + idScope + '-' + column.key,\n ariaLabel: filterLabel(column),\n options: getFilterMultiSelectOptions(column),\n placeholder: column.filterPlaceholder ?? '',\n collapsePlaceholder: filterSelectedLabel,\n collapseThreshold: 1,\n size: 'sm',\n fullWidth: true\n }\"\n ></mn-lib-multi-select>\n }\n @case ('boolean') {\n <mn-lib-select\n (ngModelChange)=\"onBooleanFilter(column, $event)\"\n [disabled]=\"column.filterDisabled ?? false\"\n [ngModel]=\"booleanFilterValue(column)\"\n [props]=\"{\n id: 'mn-table-filter-' + idScope + '-' + column.key,\n ariaLabel: filterLabel(column),\n options: getBooleanFilterOptions(column),\n size: 'sm',\n fullWidth: true\n }\"\n ></mn-lib-select>\n }\n @default {\n <mn-lib-input-field\n (keydown.enter)=\"$event.preventDefault()\"\n (ngModelChange)=\"onColumnFilter(column, $event)\"\n [disabled]=\"column.filterDisabled ?? false\"\n [ngModel]=\"textFilterValue(column)\"\n [props]=\"{\n id: 'mn-table-filter-' + idScope + '-' + column.key,\n type: 'text',\n label: '',\n placeholder: column.filterPlaceholder ?? '',\n ariaLabel: column.filterPlaceholder ?? '',\n autocomplete: column.filterAutocomplete ?? undefined,\n size: 'sm',\n borderRadius: 'md',\n fullWidth: true,\n hover: true\n }\"\n ></mn-lib-input-field>\n }\n }\n</ng-template>\n\n<!-- One composed row (below 640px): the leading block, the title (two lines at most) over the\n second line, the right-side value, and a chevron when a tap opens something. The slots\n come from rowLayout; a column renders its cellSm form here when it has one. -->\n<ng-template #rowBody let-row let-chevron=\"chevron\">\n @let layout = rowLayout;\n @if (layout.leading; as leading) {\n <span class=\"flex h-8 min-w-8 shrink-0 items-center justify-center rounded-md bg-primary/10 px-1.5 text-sm font-semibold tabular-nums text-primary\">\n <ng-container [ngTemplateOutlet]=\"rowCell\" [ngTemplateOutletContext]=\"{ $implicit: leading, row: row }\"></ng-container>\n </span>\n }\n <span class=\"flex min-w-0 flex-1 flex-col gap-1\">\n @if (layout.title; as title) {\n <span class=\"line-clamp-2 text-sm font-semibold leading-snug text-base-content [overflow-wrap:anywhere]\">\n <ng-container [ngTemplateOutlet]=\"rowCell\" [ngTemplateOutletContext]=\"{ $implicit: title, row: row }\"></ng-container>\n </span>\n }\n @let meta = rowMeta(row);\n @if (meta.length > 0) {\n <span class=\"flex flex-wrap items-center gap-x-3 gap-y-1 text-xs text-(--color-base-content-muted,color-mix(in_oklab,var(--color-base-content)_65%,transparent))\">\n @for (column of meta; track column.key) {\n <!-- Bare values, no column names: on a 375px line a name like \"Goedgekeurd door\" took\n half the room and cut off the value it described. Only the right side is labelled. -->\n <span class=\"min-w-0 max-w-full truncate\">\n <ng-container [ngTemplateOutlet]=\"rowCell\" [ngTemplateOutletContext]=\"{ $implicit: column, row: row }\"></ng-container>\n </span>\n }\n </span>\n }\n </span>\n @if (layout.trailing; as trailing) {\n @if (!rowValueEmpty(trailing, row)) {\n <!-- The right-side value with its column name above it, small: \"1-12-2023\" or \"535\" alone\n does not say whether it is a join date or a score. One line: a date that wrapped\n (\"7 oktober 2026 om / 21:00\") doubled the row's height. Past 45% of the row the value\n is cut short with an ellipsis rather than squeezing the title into two lines. -->\n <span class=\"flex min-w-0 max-w-[45%] shrink-0 flex-col items-end gap-0.5 text-right\">\n @let trailingLabel = rowSlotLabel(trailing);\n @if (trailingLabel) {\n <span class=\"max-w-full truncate text-[0.6875rem] leading-tight text-(--color-base-content-muted,color-mix(in_oklab,var(--color-base-content)_65%,transparent))\">{{ trailingLabel }}</span>\n }\n <span class=\"max-w-full truncate whitespace-nowrap text-sm font-semibold tabular-nums text-base-content\">\n <ng-container [ngTemplateOutlet]=\"rowCell\" [ngTemplateOutletContext]=\"{ $implicit: trailing, row: row }\"></ng-container>\n </span>\n </span>\n }\n }\n @if (chevron) {\n <svg [lucideIcon]=\"icons.ChevronRight\" [size]=\"16\" aria-hidden=\"true\" class=\"mt-0.5 shrink-0 opacity-50\"></svg>\n }\n</ng-template>\n\n<!-- A cell as a composed row shows it: cellSm first. Its column name is the caller's (rowSlotLabel). -->\n<ng-template #rowCell let-column let-row=\"row\">\n @let template = rowCellTemplate(column);\n @if (template) {\n <ng-container [ngTemplateOutletContext]=\"{ $implicit: row, data: row }\" [ngTemplateOutlet]=\"template\"></ng-container>\n } @else {\n {{ rowCellText(column, row) }}\n }\n</ng-template>\n\n<!-- A cell in full, as the wide table shows it: the detail sheet is where the long form belongs. -->\n<ng-template #fullCell let-column let-row=\"row\">\n @if (isTemplateRef(column.cell)) {\n <ng-container [ngTemplateOutletContext]=\"{ $implicit: row, data: row }\" [ngTemplateOutlet]=\"$any(column.cell)\"></ng-container>\n } @else {\n {{ getCellValue(column, row) }}\n }\n</ng-template>\n\n<!-- Empty and error content, shared by the grid and the composed rows. -->\n<ng-template #emptyContent>\n @if (dataSource.emptyTemplate) {\n <ng-container [ngTemplateOutlet]=\"dataSource.emptyTemplate\"></ng-container>\n } @else {\n <!-- The same look as a section's empty state, so a page with both reads as one:\n a faint icon over a medium line in the consumer's muted text colour. -->\n <div class=\"flex flex-col items-center gap-3 py-16 text-(--color-base-content-muted,color-mix(in_oklab,var(--color-base-content)_65%,transparent))\">\n @if (dataSource.emptyIcon !== null) {\n <svg [lucideIcon]=\"dataSource.emptyIcon ?? defaultEmptyIcon\" [size]=\"26\" class=\"opacity-30\"></svg>\n }\n <p class=\"text-base font-medium\">{{ dataSource.emptyMessage }}</p>\n </div>\n }\n</ng-template>\n\n<ng-template #errorContent>\n @if (dataSource.errorTemplate) {\n <ng-container [ngTemplateOutlet]=\"dataSource.errorTemplate\"></ng-container>\n } @else {\n <div class=\"flex flex-col items-center gap-2 text-error\">\n <p class=\"text-sm\">{{ dataSource.errorMessage }}</p>\n </div>\n }\n</ng-template>\n\n<!-- Inline action buttons for an actions column on the wide table. Below 640px the same\n actions render in the detail sheet (or a modal's ⋯ menu). -->\n<ng-template #actionButtons let-column=\"column\" let-row=\"row\">\n <!-- A placeholder (a hidden keepSlot action) is the same button, invisible and inert:\n it holds the column so the actions after it line up with the rows above. -->\n @for (slot of inlineRowActions(column, row); track $index) {\n @let action = slot.action;\n <button\n mnButton\n type=\"button\"\n [data]=\"{\n size: 'sm',\n variant: 'text',\n color: rowActionColor(action, row),\n disabled: isRowActionDisabled(action, row) || slot.placeholder\n }\"\n class=\"cursor-pointer\"\n [class.invisible]=\"slot.placeholder\"\n [attr.inert]=\"slot.placeholder ? '' : null\"\n [attr.aria-hidden]=\"slot.placeholder ? 'true' : null\"\n (click)=\"$event.stopPropagation(); slot.placeholder || runRowAction(action, row)\"\n [attr.aria-label]=\"rowActionLabel(action, row)\"\n [attr.title]=\"showActionLabel(column, action, row) ? null : rowActionLabel(action, row)\"\n >\n @if (showActionIcon(column, action, row)) {\n <span class=\"inline-flex items-center shrink-0\">\n @let icon = rowActionIcon(action, row);\n @if (isTemplateRef(icon)) {\n <ng-container [ngTemplateOutlet]=\"icon\"></ng-container>\n } @else {\n <!-- Data icon: sized here to match the sm button's text, so a caller can\n declare the action in TypeScript without owning a template. -->\n <svg [lucideIcon]=\"$any(icon)\" [size]=\"17\"></svg>\n }\n </span>\n }\n @if (showActionLabel(column, action, row)) {\n <span>{{ rowActionLabel(action, row) }}</span>\n }\n </button>\n }\n</ng-template>\n",
|
|
1707
|
+
template: "<!-- Everything that reflows lives inside a @container, so the breakpoints below\n measure the table's own width rather than the window's. A table in a modal,\n a sidebar or a narrow grid cell is far narrower than the viewport, and\n viewport breakpoints would hand it a desktop layout it has no room for. -->\n<div class=\"@container\">\n <!-- Selection summary: the whole selection, never paged, filtered or sorted. The\n table below answers \"what could I pick?\", which is why it is searched and paged;\n this answers \"what did I pick?\", which a paginated list cannot without hiding\n most of the answer on some other page. -->\n @if (showSelectionSummary) {\n <div class=\"flex flex-col gap-2 rounded-md border border-base-300 bg-base-200/50 p-3 mb-3\">\n <div class=\"flex items-center justify-between gap-2\">\n <span class=\"text-sm font-medium text-base-content\">{{ selectionSummaryTitle }}</span>\n <button\n (click)=\"clearSelection()\"\n [data]=\"{ variant: 'text', color: 'gray', size: 'sm', borderRadius: 'md', hover: true }\"\n class=\"gap-1 shrink-0\"\n mnButton\n type=\"button\"\n >\n <svg [size]=\"14\" [lucideIcon]=\"icons.X\"></svg>\n <span>{{ selectionClearAllLabel }}</span>\n </button>\n </div>\n <!-- Only the first few tags render; the rest collapse behind a \"+N more\" control.\n The heading's count always states the true total, so this hides tags, never\n information. Expanded, the list is height-capped and scrolls, so even a\n selection of hundreds cannot push the table off screen. -->\n <ul\n [class.max-h-28]=\"selectionSummaryExpanded\"\n [class.overflow-y-auto]=\"selectionSummaryExpanded\"\n class=\"flex flex-wrap gap-1.5 list-none m-0 p-0\"\n >\n @for (row of visibleSelectionRows; track dataSource.getID(row)) {\n <li\n class=\"inline-flex items-center gap-1 rounded-full bg-base-100 border border-base-300 pl-2.5 pr-1 py-0.5 text-xs text-base-content max-w-full\">\n <span [attr.title]=\"selectionLabelFor(row)\" class=\"truncate\">{{ selectionLabelFor(row) }}</span>\n <button\n (click)=\"removeSelection(row)\"\n [attr.aria-label]=\"selectionRemoveLabel(row)\"\n class=\"shrink-0 rounded-full p-0.5 hover:bg-base-300 transition-colors cursor-pointer\"\n type=\"button\"\n >\n <svg [size]=\"12\" [lucideIcon]=\"icons.X\"></svg>\n </button>\n </li>\n }\n @if (hiddenSelectionCount > 0 || selectionSummaryExpanded) {\n <li>\n <button\n (click)=\"toggleSelectionSummary()\"\n [attr.aria-expanded]=\"selectionSummaryExpanded\"\n [data]=\"{ variant: 'text', color: 'primary', size: 'sm', borderRadius: 'md', hover: true }\"\n class=\"text-xs\"\n mnButton\n type=\"button\"\n >\n {{ selectionSummaryToggleLabel }}\n </button>\n </li>\n }\n </ul>\n </div>\n }\n\n <!-- Toolbar: custom toolbar template + search. Only rendered when it has content,\n so an unsearchable table without toolbar templates emits no empty spacer. -->\n@if (showsSearch || dataSource.toolbarLeftTemplate || dataSource.toolbarRightTemplate || showsFilterButton) {\n <!-- spYV0YV5 / GRRU8s1V / D2NV3xS9: wrap at ~600px so search + Filters never force\n page-level horizontal scroll. min-w-0 lets flex children shrink inside the page. -->\n <div class=\"mb-3 flex min-w-0 flex-col flex-wrap justify-between gap-2 @min-[420px]:flex-row @min-[420px]:items-center\">\n <!-- The left slot only when it has content: an empty one still took a flex gap, which\n pushed the search 8px in from the page edge. ml-auto keeps the search on the right. -->\n @if (dataSource.toolbarLeftTemplate) {\n <div class=\"flex min-w-0 w-full items-center gap-2 @min-[420px]:w-auto\">\n <div class=\"flex min-w-0 w-full flex-col @min-[420px]:w-auto @min-[420px]:flex-row\">\n <ng-container [ngTemplateOutlet]=\"dataSource.toolbarLeftTemplate\"></ng-container>\n </div>\n </div>\n }\n <div\n class=\"flex min-w-0 w-full flex-col flex-wrap gap-2 @min-[420px]:ml-auto @min-[420px]:flex-1 @min-[420px]:flex-row @min-[420px]:items-center @min-[720px]:w-auto @min-[720px]:flex-none\">\n <!-- Search and the filter button share one row: two full-width bars stacked above the\n first row pushed the content a whole screen down on a phone. -->\n @if (showsSearch || showsFilterButton) {\n <div class=\"flex min-w-0 w-full items-center gap-2 @min-[420px]:flex-1 @min-[720px]:flex-none\">\n @if (showsSearch) {\n <!-- Enter must not submit a surrounding form: the search box belongs to the\n table's chrome, not to whatever form the table happens to sit in. -->\n <mn-lib-input-field\n (keydown.enter)=\"$event.preventDefault()\"\n class=\"min-w-0 flex-1 @min-[720px]:flex-none @min-[720px]:min-w-64\"\n [props]=\"{\n id: 'mn-table-search',\n type: 'search',\n label: '',\n ariaLabel: searchPlaceholderLabel,\n placeholder: searchPlaceholderLabel,\n size: 'sm',\n borderRadius: 'md',\n fullWidth: true\n }\"\n [ngModel]=\"searchValue\"\n (ngModelChange)=\"onSearch($event)\"\n ></mn-lib-input-field>\n }\n <!-- Below 640px the header row with its sort buttons and the inline filter row are\n gone; this one button opens both, with a count while filters are set. -->\n @if (showsFilterButton) {\n <button\n type=\"button\"\n mnButton\n [data]=\"{ variant: 'outline', color: 'primary', size: 'md', borderRadius: 'md', hover: true }\"\n class=\"shrink-0 gap-1.5 px-2.5\"\n [class.ml-auto]=\"!showsSearch\"\n [attr.aria-label]=\"filtersButtonAriaLabel\"\n [attr.title]=\"filterSheetLabel\"\n [attr.aria-expanded]=\"filtersPanelOpen\"\n aria-controls=\"mn-table-filters-panel\"\n (click)=\"openFiltersPanel()\"\n >\n <svg [lucideIcon]=\"icons.Funnel\" [size]=\"17\"></svg>\n <!-- The count sits inside the button: a badge hanging off its corner reached past the\n table's right edge and gave a container that clips or scrolls a sideways scroll. -->\n @if (activeFilterCount > 0) {\n <span class=\"text-sm font-semibold leading-none tabular-nums\" aria-hidden=\"true\">{{ activeFilterCount }}</span>\n }\n </button>\n }\n </div>\n }\n @if (dataSource.toolbarRightTemplate) {\n <div class=\"flex min-w-0 w-full flex-col @min-[420px]:w-auto @min-[420px]:flex-row\">\n <ng-container [ngTemplateOutlet]=\"dataSource.toolbarRightTemplate\"></ng-container>\n </div>\n }\n </div>\n</div>\n}\n\n<!-- Small-screen filters: full-width fields decoupled from column widths, presented\n as a bottom sheet so they overlay rather than push the table down. -->\n@if (showsFilterButton && filtersPanelOpen) {\n <mn-bottom-sheet\n #filtersSheet\n (dismiss)=\"filtersPanelOpen = false\"\n [ariaLabel]=\"filterSheetLabel\"\n [growWithKeyboard]=\"true\"\n [maxHeightVh]=\"80\"\n >\n <div id=\"mn-table-filters-panel\" class=\"flex flex-col gap-3 px-4 pb-4\">\n <span class=\"text-base font-semibold text-base-content\">{{ filterSheetLabel }}</span>\n <!-- Sorting lives here below 640px: the header row whose buttons sorted is not rendered.\n The choices are inline radios, not a select: a select opens its own bottom sheet on a\n phone, which stacked a second sheet on this one and cut its list off. One row per\n column, the direction as a separate switch once a column is picked. -->\n @if (sortableColumns.length > 0) {\n <fieldset class=\"m-0 flex flex-col gap-2 border-0 p-0\">\n <legend\n class=\"mb-1 p-0 text-xs font-medium text-base-content/70\"\n [class.sr-only]=\"!hasColumnFilters\"\n >{{ sortByLabel }}</legend>\n <div class=\"flex flex-col\">\n <label class=\"flex min-h-11 cursor-pointer items-center gap-3 text-sm text-base-content\">\n <input\n type=\"radio\"\n class=\"size-[1.125rem] shrink-0 cursor-pointer appearance-none rounded-full border-2 border-base-content/40 bg-base-100 transition-[border] checked:border-[0.3125rem] checked:border-primary focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary\"\n [name]=\"sortGroupName\"\n value=\"\"\n [checked]=\"!currentSort\"\n (change)=\"onSortColumn('')\"\n />\n <span>{{ sortDefaultLabel }}</span>\n </label>\n @for (column of sortableColumns; track column.key) {\n <!-- The chosen column carries its own direction button at the row's end: it sits\n inside a row that is already there, so picking a column never grows the sheet,\n and no greyed-out switch shows while the default order is chosen. -->\n <div class=\"flex min-h-11 items-center gap-2\">\n <label class=\"flex min-w-0 flex-1 cursor-pointer items-center gap-3 self-stretch text-sm text-base-content\">\n <input\n type=\"radio\"\n class=\"size-[1.125rem] shrink-0 cursor-pointer appearance-none rounded-full border-2 border-base-content/40 bg-base-100 transition-[border] checked:border-[0.3125rem] checked:border-primary focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary\"\n [name]=\"sortGroupName\"\n [value]=\"column.key\"\n [checked]=\"currentSort?.columnKey === column.key\"\n (change)=\"onSortColumn(column.key)\"\n />\n <span class=\"truncate\">{{ headerText(column) || column.key }}</span>\n </label>\n @if (currentSort?.columnKey === column.key) {\n <button\n type=\"button\"\n mnButton\n [data]=\"{ variant: 'outline', color: 'primary', size: 'sm', borderRadius: 'md', hover: true }\"\n class=\"shrink-0 gap-1.5\"\n [attr.aria-label]=\"sortDirectionButtonLabel\"\n (click)=\"toggleSortDirection()\"\n >\n <svg [lucideIcon]=\"currentSort.direction === 'desc' ? icons.ArrowDown : icons.ArrowUp\" [size]=\"15\"></svg>\n <span>{{ sortDirectionLabel }}</span>\n </button>\n }\n </div>\n }\n </div>\n </fieldset>\n @if (hasColumnFilters) {\n <div class=\"border-t border-base-300\" aria-hidden=\"true\"></div>\n }\n }\n @for (column of dataSource.columns; track column.key) {\n @if (column.filterable) {\n <div class=\"flex flex-col gap-1\">\n <label\n class=\"text-xs font-medium text-base-content/70\"\n [attr.for]=\"'mn-table-filter-panel-' + column.key\"\n >\n @if (isTemplateRef(column.header)) {\n <ng-container [ngTemplateOutlet]=\"$any(column.header)\"></ng-container>\n } @else {\n {{ headerText(column) }}\n }\n </label>\n <!-- The field template is declared outside the sheet, so it would inject from there;\n this injector tells its selects they are in a sheet (no second sheet on top). -->\n <ng-container\n [ngTemplateOutletContext]=\"{ $implicit: column, idScope: 'panel' }\"\n [ngTemplateOutletInjector]=\"inSheetInjector\"\n [ngTemplateOutlet]=\"filterField\"\n ></ng-container>\n </div>\n }\n }\n @if (hasActiveFilters) {\n <button\n type=\"button\"\n mnButton\n [data]=\"{ variant: 'text', color: 'gray', size: 'sm', borderRadius: 'md', hover: true }\"\n class=\"self-start gap-1\"\n (click)=\"clearAllFilters()\"\n >\n <svg [lucideIcon]=\"icons.X\" [size]=\"14\"></svg>\n <span>{{ clearFiltersButtonLabel }}</span>\n </button>\n }\n <div class=\"mt-1 flex min-[400px]:justify-end\">\n <button\n type=\"button\"\n mnButton\n [data]=\"{ variant: 'fill', color: 'primary', size: 'md', borderRadius: 'md', hover: true }\"\n class=\"w-full min-[400px]:w-auto\"\n (click)=\"closeFiltersPanel()\"\n >\n <span>{{ filtersCloseLabel }}</span>\n </button>\n </div>\n </div>\n </mn-bottom-sheet>\n}\n\n<!-- Detail sheet (below 640px): the whole record of one row — title and right-side value as the\n heading, every other column as a label/value list, then the actions. It is the only place a\n column the composed row could not show, or an action, is reachable on a phone. -->\n@if (detailRow !== null) {\n @let row = detailRow;\n <mn-bottom-sheet\n #detailSheet\n (dismiss)=\"onDetailDismissed()\"\n [ariaLabel]=\"rowLabel(row)\"\n [maxHeightVh]=\"85\"\n >\n <!-- Escape closes it: the sheet itself only handles the backdrop and the drag. Focus is\n moved inside on open, so the key arrives here by bubbling. -->\n <!-- eslint-disable-next-line @angular-eslint/template/interactive-supports-focus -->\n <div class=\"flex flex-col gap-4 px-4 pb-4\" (keydown.escape)=\"closeDetail()\">\n <div class=\"flex items-start gap-3\">\n <h2\n #detailHeading\n class=\"m-0 min-w-0 flex-1 text-lg font-semibold leading-snug text-base-content outline-none [overflow-wrap:anywhere]\"\n tabindex=\"-1\"\n >\n @if (rowLayout.title; as title) {\n <ng-container [ngTemplateOutlet]=\"fullCell\" [ngTemplateOutletContext]=\"{ $implicit: title, row: row }\"></ng-container>\n }\n </h2>\n @if (rowLayout.trailing && !rowValueEmpty(rowLayout.trailing, row)) {\n @let trailing = rowLayout.trailing;\n <span class=\"flex shrink-0 flex-col items-end gap-0.5 text-right\">\n @if (rowSlotLabel(trailing); as trailingLabel) {\n <span class=\"text-xs text-(--color-base-content-muted,color-mix(in_oklab,var(--color-base-content)_65%,transparent))\">{{ trailingLabel }}</span>\n }\n <span class=\"text-lg font-semibold tabular-nums text-base-content\">\n <ng-container [ngTemplateOutlet]=\"fullCell\" [ngTemplateOutletContext]=\"{ $implicit: trailing, row: row }\"></ng-container>\n </span>\n </span>\n }\n </div>\n @if (detailColumns.length > 0) {\n <dl class=\"m-0 grid grid-cols-[minmax(0,8rem)_minmax(0,1fr)] gap-x-3 gap-y-2.5 border-t border-base-300 pt-4 text-sm\">\n @for (column of detailColumns; track column.key) {\n <!-- An empty value or a lone dash says nothing here either (\"Beschrijving: -\"). -->\n @if (!rowValueEmpty(column, row)) {\n <dt class=\"text-(--color-base-content-muted,color-mix(in_oklab,var(--color-base-content)_65%,transparent))\">\n @if (isTemplateRef(column.header)) {\n <ng-container [ngTemplateOutlet]=\"$any(column.header)\"></ng-container>\n } @else {\n {{ headerText(column) }}\n }\n </dt>\n <dd class=\"m-0 min-w-0 text-base-content [overflow-wrap:anywhere]\">\n <ng-container [ngTemplateOutlet]=\"fullCell\" [ngTemplateOutletContext]=\"{ $implicit: column, row: row }\"></ng-container>\n </dd>\n }\n }\n </dl>\n }\n @if (rowHasAnyActions(row)) {\n <div class=\"flex flex-col gap-2 border-t border-base-300 pt-4\">\n @for (column of rowLayout.actions; track column.key) {\n @for (action of visibleRowActions(column, row); track $index) {\n <button\n mnButton\n type=\"button\"\n [data]=\"{\n variant: 'outline',\n color: rowActionColor(action, row),\n size: 'md',\n borderRadius: 'md',\n hover: true,\n disabled: isRowActionDisabled(action, row)\n }\"\n class=\"w-full gap-2\"\n [attr.aria-disabled]=\"isRowActionDisabled(action, row) || null\"\n (click)=\"runDetailAction(action, row)\"\n >\n @let icon = rowActionIcon(action, row);\n @if (icon) {\n <span class=\"inline-flex shrink-0 items-center\">\n @if (isTemplateRef(icon)) {\n <ng-container [ngTemplateOutlet]=\"icon\"></ng-container>\n } @else {\n <svg [lucideIcon]=\"$any(icon)\" [size]=\"17\"></svg>\n }\n </span>\n }\n <span>{{ rowActionLabel(action, row) }}</span>\n </button>\n }\n }\n </div>\n }\n </div>\n </mn-bottom-sheet>\n}\n\n<!-- Announces loading. The skeletons are aria-hidden, so without this a screen reader hears\n nothing while rows load. The region stays in the DOM and only its text changes, which is\n what makes assistive tech read it; one inserted with its text already set is often missed. -->\n<span class=\"sr-only\" role=\"status\">{{ isLoadingState ? loadingLabel : '' }}</span>\n\n<!-- Table wrapper with horizontal scroll -->\n <div #collectionBody [attr.aria-busy]=\"isLoadingState || null\" [attr.aria-label]=\"tableRegionLabel\" [style.min-height.px]=\"bodyMinHeight\"\n class=\"overflow-x-auto\"\n role=\"region\">\n @if (rowMode) {\n <!-- Below 640px every row is a composed line (see resolveRowLayout): the columns that\n would not fit as cells become a title, a second line and a value on the right, and\n the rest waits in the detail sheet a tap opens. A list, not a table: there are no\n columns left for a screen reader to navigate. -->\n <ul class=\"m-0 list-none p-0\">\n <!-- A \"Load more\" refetch keeps the rows it is adding to (see loadMorePhoneRows). -->\n @if (isLoadingState && !phoneLoadingMore) {\n @for (_ of skeletonRows; track $index) {\n <li aria-hidden=\"true\" class=\"flex items-center gap-3 border-b border-base-300 bg-base-100 px-2 py-3\">\n <div class=\"flex flex-1 flex-col gap-2\">\n <mn-skeleton [data]=\"{ shape: 'text', width: '60%' }\"></mn-skeleton>\n <mn-skeleton [data]=\"{ shape: 'text', width: '40%', height: '0.75rem' }\"></mn-skeleton>\n </div>\n </li>\n }\n } @else if (isErrorState) {\n <li class=\"bg-base-100 py-8 text-center text-xs\">\n <ng-container [ngTemplateOutlet]=\"errorContent\"></ng-container>\n </li>\n } @else {\n @if (filteredItems.length === 0) {\n <li class=\"bg-base-100 text-center text-xs\">\n <ng-container [ngTemplateOutlet]=\"emptyContent\"></ng-container>\n </li>\n }\n @for (row of paginatedItems; track trackByID($index, row)) {\n @let tap = rowTap(row);\n <li\n class=\"flex items-stretch border-b border-base-300 bg-base-100\"\n [ngClass]=\"{ 'bg-primary/10': isSelected(row) }\"\n >\n @if (hasSelection) {\n <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events,@angular-eslint/template/interactive-supports-focus -->\n <div class=\"flex shrink-0 items-center pl-2\" (click)=\"$event.stopPropagation()\">\n <mn-lib-checkbox\n (checkedChange)=\"toggle(row)\"\n [checked]=\"isSelected(row)\"\n [props]=\"{ id: 'mn-table-row-' + $index, size: 'sm' }\"\n ></mn-lib-checkbox>\n </div>\n }\n @if (tap === 'detail' || tap === 'click') {\n <button\n type=\"button\"\n class=\"flex min-w-0 flex-1 cursor-pointer items-start gap-3 px-2 py-3 text-left transition-colors duration-150 hover:bg-base-200 focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-primary\"\n [attr.aria-haspopup]=\"tap === 'detail' ? 'dialog' : null\"\n (click)=\"onRowTap(row, $event)\"\n >\n <ng-container [ngTemplateOutlet]=\"rowBody\" [ngTemplateOutletContext]=\"{ $implicit: row, chevron: true }\"></ng-container>\n </button>\n } @else {\n <!-- A selection row toggles on a click anywhere, as the wide table's row does; the\n checkbox is its keyboard control, so this area needs no focus of its own. -->\n <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events,@angular-eslint/template/interactive-supports-focus -->\n <div\n class=\"flex min-w-0 flex-1 items-start gap-3 px-2 py-3\"\n [class.cursor-pointer]=\"tap === 'select'\"\n (click)=\"tap === 'select' && onRowClick(row)\"\n >\n <ng-container [ngTemplateOutlet]=\"rowBody\" [ngTemplateOutletContext]=\"{ $implicit: row, chevron: false }\"></ng-container>\n </div>\n }\n @if (showsRowMore(row)) {\n <button\n type=\"button\"\n class=\"flex w-11 shrink-0 cursor-pointer items-center justify-center text-base-content/70 transition-colors hover:bg-base-200 focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-primary\"\n aria-haspopup=\"dialog\"\n [attr.aria-label]=\"rowDetailsLabel(row)\"\n (click)=\"openDetail(row, $any($event.currentTarget))\"\n >\n <svg [lucideIcon]=\"icons.Ellipsis\" [size]=\"18\"></svg>\n </button>\n }\n @if (showsRowMenu(row)) {\n @for (column of rowLayout.actions; track column.key) {\n @if (hasRowActions(column, row)) {\n <div class=\"flex shrink-0 items-center pr-1\">\n <mn-lib-dropdown [datasource]=\"{\n id: actionsDropdownId(column, row),\n actions: rowDropdownActions(column, row),\n menuLabel: headerText(column),\n size: 'sm'\n }\"></mn-lib-dropdown>\n </div>\n }\n }\n }\n </li>\n }\n }\n </ul>\n } @else {\n <table [class]=\"tableClasses\">\n <thead>\n <tr class=\"bg-base-100\">\n <!-- Selection column header. It always carries a screen-reader-only name: a single-select\n table has nothing else in this cell, and a multi-select one only a checkbox, so\n without it the column is announced as a nameless header (axe empty-table-header). -->\n @if (hasSelection) {\n <th class=\"w-10 text-center text-sm px-2 py-2\">\n <span class=\"sr-only\">{{ selectionColumnLabel }}</span>\n @if (isMultiSelect) {\n <mn-lib-checkbox\n (checkedChange)=\"toggleAll()\"\n [checked]=\"allSelected\"\n [props]=\"{ id: 'mn-table-select-all', size: 'sm' }\"\n ></mn-lib-checkbox>\n }\n </th>\n }\n\n <!-- Data columns -->\n @for (column of dataSource.columns; track column.key) {\n <th\n [attr.data-column-key]=\"column.key\"\n [class.truncate]=\"widthsArePinned\"\n [class.cursor-pointer]=\"isSortable(column)\"\n [class.select-none]=\"isSortable(column)\"\n [class.hover:bg-base-200]=\"isSortable(column)\"\n [class.text-left]=\"(column.align ?? 'left') === 'left'\"\n [class.text-center]=\"column.align === 'center'\"\n [class.text-right]=\"column.align === 'right'\"\n [mnHiddenBelow]=\"column.hiddenBelow\"\n [style.width]=\"columnWidth(column)\"\n [attr.aria-sort]=\"currentSort?.columnKey === column.key ? (currentSort!.direction === 'asc' ? 'ascending' : 'descending') : null\"\n class=\"text-sm px-2 py-1 @min-[640px]:px-4 @min-[640px]:py-2 whitespace-nowrap\"\n (click)=\"sort(column)\"\n >\n <!-- The header content is declared once; a sortable column wraps it in a real button so\n the sort is reachable by keyboard. The button's click stops there, so the th's own\n click (which keeps the cell padding clickable) does not sort a second time. -->\n <ng-template #headerContent>\n @if (isTemplateRef(column.header)) {\n <ng-container [ngTemplateOutlet]=\"$any(column.header)\"></ng-container>\n } @else {\n <span>{{ headerText(column) }}</span>\n }\n @if (isSortable(column)) {\n <span class=\"text-[0.65rem] opacity-70 min-w-3 inline-block\" aria-hidden=\"true\">{{ getSortIcon(column) }}</span>\n }\n </ng-template>\n @if (isSortable(column)) {\n <button type=\"button\" class=\"inline-flex items-center gap-1 cursor-pointer\" (click)=\"$event.stopPropagation(); sort(column)\">\n <ng-container [ngTemplateOutlet]=\"headerContent\"></ng-container>\n </button>\n } @else {\n <span class=\"inline-flex items-center gap-1\">\n <ng-container [ngTemplateOutlet]=\"headerContent\"></ng-container>\n </span>\n }\n </th>\n }\n\n </tr>\n\n <!-- Per-column filter row (wide screens only; collapses into a panel below 640px).\n The cells are `td`, not `th`: they hold form controls, not headings, and a\n column without a filter would otherwise be an empty header, which assistive tech\n announces as a nameless column (axe `empty-table-header`). `font-normal` stays\n so a consumer's thead styling cannot make the controls bold. -->\n @if (hasColumnFilters && !filtersCollapsed) {\n <tr class=\"bg-base-100 border-b border-base-300 font-normal\">\n @if (hasSelection) {\n <td class=\"px-2 py-1 font-normal\"></td>\n }\n @for (column of dataSource.columns; track column.key) {\n <td\n class=\"px-4 py-2 font-normal\"\n [mnHiddenBelow]=\"column.hiddenBelow\"\n >\n @if (column.filterable) {\n <!-- Every filter renders as an ordinary control right under its\n header. The rich types used to hide behind a button that opened\n a floating panel, which cost a click to discover, a click to\n apply, and hid whether a column was even filterable. -->\n <ng-container\n [ngTemplateOutletContext]=\"{ $implicit: column, idScope: 'inline' }\"\n [ngTemplateOutlet]=\"filterField\"\n ></ng-container>\n }\n </td>\n }\n </tr>\n }\n </thead>\n\n <tbody>\n <!-- Loading state -->\n @if (isLoadingState) {\n @for (_ of skeletonRows; track $index) {\n <tr>\n @if (hasSelection) {\n <td class=\"px-2 py-3\">\n <mn-skeleton [data]=\"{ shape: 'rectangle', width: '1rem', height: '1rem' }\"></mn-skeleton>\n </td>\n }\n @for (column of dataSource.columns; track column.key) {\n <td class=\"px-4 py-3\"\n [mnHiddenBelow]=\"column.hiddenBelow\"\n [style.width]=\"columnWidth(column)\"\n >\n @if (isTemplateRef(column.skeleton)) {\n <ng-container [ngTemplateOutlet]=\"$any(column.skeleton)\"></ng-container>\n } @else {\n <mn-skeleton [data]=\"getColumnSkeletonData(column)\"></mn-skeleton>\n }\n </td>\n }\n </tr>\n }\n } @else if (isErrorState) {\n <!-- Error state -->\n <tr class=\"bg-base-100\">\n <td [attr.colspan]=\"totalColumnCount\" class=\"text-center text-xs py-8\">\n <ng-container [ngTemplateOutlet]=\"errorContent\"></ng-container>\n </td>\n </tr>\n } @else {\n <!-- Empty state -->\n @if (filteredItems.length === 0) {\n <tr class=\"bg-base-100\">\n <td [attr.colspan]=\"totalColumnCount\" class=\"text-center text-xs py-8\">\n <ng-container [ngTemplateOutlet]=\"emptyContent\"></ng-container>\n </td>\n </tr>\n }\n\n <!-- Data rows -->\n @for (row of paginatedItems; track trackByID($index, row); let odd = $odd; let last = $last) {\n <!-- The wash and the pointer promise that a click does something, so only a clickable row gets them. -->\n <tr\n class=\"bg-base-100 transition-colors duration-150 border-b border-base-300\"\n [ngClass]=\"{'bg-primary/10': isSelected(row)}\"\n [class.bg-base-200]=\"!isSelected(row) && odd && dataSource.appearance?.striped\"\n [class.hover:bg-base-200]=\"rowsClickable && dataSource.appearance?.hover !== false\"\n [class.cursor-pointer]=\"rowsClickable\"\n (click)=\"onRowClick(row)\"\n >\n <!-- Selection checkbox -->\n @if (hasSelection) {\n <td (click)=\"$event.stopPropagation()\" class=\"w-10 text-center px-2 py-2\">\n <mn-lib-checkbox\n (checkedChange)=\"toggle(row)\"\n [checked]=\"isSelected(row)\"\n [props]=\"{ id: 'mn-table-row-' + $index, size: 'sm' }\"\n ></mn-lib-checkbox>\n </td>\n }\n\n <!-- Data cells -->\n @for (column of dataSource.columns; track column.key) {\n <td\n [attr.title]=\"cellTitle(column, row)\"\n [class.text-left]=\"(column.align ?? 'left') === 'left'\"\n [class.text-center]=\"column.align === 'center'\"\n [class.text-right]=\"column.align === 'right'\"\n [class.truncate]=\"widthsArePinned\"\n [mnHiddenBelow]=\"column.hiddenBelow\"\n [style.width]=\"columnWidth(column)\"\n class=\"text-xs px-2 py-1 @min-[640px]:px-4 @min-[640px]:py-2\"\n >\n @if (column.actions) {\n <!-- Actions column: inline command buttons. The grid only renders at 640px\n and wider, where they fit; below that the actions move into the row's\n detail sheet. A row with no visible actions renders nothing. -->\n @if (hasRowActions(column, row)) {\n <div class=\"inline-flex items-center gap-1\"\n [class.justify-end]=\"(column.align ?? 'left') === 'right'\">\n <span class=\"inline-flex items-center gap-1\">\n <ng-container [ngTemplateOutletContext]=\"{ column: column, row: row }\"\n [ngTemplateOutlet]=\"actionButtons\"></ng-container>\n </span>\n </div>\n }\n } @else if (column.cellSm) {\n <!-- Default cell: hidden below the cellSm breakpoint -->\n <span [mnShowAbove]=\"column.cellSm.below\">\n @if (isTemplateRef(column.cell)) {\n <ng-container [ngTemplateOutletContext]=\"{ $implicit: row, data: row }\"\n [ngTemplateOutlet]=\"$any(column.cell)\"></ng-container>\n } @else {\n {{ getCellValue(column, row) }}\n }\n </span>\n <!-- Small cell: shown only below the cellSm breakpoint -->\n <span [mnShowBelow]=\"column.cellSm.below\">\n @if (isTemplateRef(column.cellSm.cell)) {\n <ng-container [ngTemplateOutletContext]=\"{ $implicit: row, data: row }\"\n [ngTemplateOutlet]=\"$any(column.cellSm.cell)\"></ng-container>\n } @else {\n {{ getCellSmValue(column, row) }}\n }\n </span>\n } @else {\n @if (isTemplateRef(column.cell)) {\n <ng-container [ngTemplateOutletContext]=\"{ $implicit: row, data: row }\"\n [ngTemplateOutlet]=\"$any(column.cell)\"></ng-container>\n } @else {\n {{ getCellValue(column, row) }}\n }\n }\n </td>\n }\n\n </tr>\n }\n }\n </tbody>\n </table>\n }\n</div>\n\n<!-- Below 640px a paginated table grows instead of paging (see showsPhoneLoadMore). -->\n@if (showsPhoneLoadMore) {\n <div class=\"flex flex-col items-center gap-2 px-2 pb-1 pt-3\">\n <span class=\"text-xs text-(--color-base-content-muted,color-mix(in_oklab,var(--color-base-content)_65%,transparent))\" aria-live=\"polite\">{{ phoneLoadedLabel }}</span>\n <button\n mnButton\n type=\"button\"\n [data]=\"{ variant: 'outline', color: 'primary', size: 'md', borderRadius: 'md', hover: true, disabled: phoneLoadingMore }\"\n class=\"w-full gap-2\"\n [attr.aria-disabled]=\"phoneLoadingMore || null\"\n (click)=\"loadMorePhoneRows()\"\n >\n @if (phoneLoadingMore) {\n <span aria-hidden=\"true\" class=\"inline-block size-3.5 animate-spin rounded-full border-2 border-current border-t-transparent\"></span>\n }\n {{ phoneLoadMoreLabel }}\n </button>\n </div>\n}\n\n<!-- Load more + pagination (not for a single page below 640px, see showsPagination) -->\n@if (showsPagination) {\n<mn-collection-pagination\n (loadMore)=\"loadMoreRows()\"\n (pageChange)=\"goToPage($event)\"\n (pageSizeChange)=\"onPageSizeChange($event)\"\n [currentPage]=\"currentPage\"\n [isPaginated]=\"isPaginated\"\n [isServerPaginated]=\"isServerPaginated\"\n [labels]=\"dataSource.labels\"\n [loadingMoreRows]=\"loadingMoreRows\"\n [pageSizeSelectOptions]=\"pageSizeSelectOptions\"\n [pageSize]=\"pageSize\"\n [showLoadMore]=\"showLoadMore\"\n [totalItemCount]=\"totalItemCount\"\n [totalPages]=\"totalPages\"\n [visiblePages]=\"visiblePages\"\n idPrefix=\"mn-table\"\n></mn-collection-pagination>\n}\n</div>\n\n<!-- Single source of truth for every filter control, reused by the inline header\n row and the small-screen panel. `idScope` keeps element ids unique across\n both placements. -->\n<ng-template #filterField let-column let-idScope=\"idScope\">\n @switch (filterTypeOf(column)) {\n @case ('select') {\n <mn-lib-select\n (ngModelChange)=\"onColumnFilter(column, $event)\"\n [disabled]=\"column.filterDisabled ?? false\"\n [ngModel]=\"textFilterValue(column)\"\n [props]=\"{\n id: 'mn-table-filter-' + idScope + '-' + column.key,\n ariaLabel: filterLabel(column),\n options: getFilterSelectOptions(column),\n placeholder: filterAllLabel(column),\n size: 'sm',\n fullWidth: true\n }\"\n ></mn-lib-select>\n }\n @case ('multi-select') {\n <mn-lib-multi-select\n (ngModelChange)=\"onColumnFilter(column, $event)\"\n [disabled]=\"column.filterDisabled ?? false\"\n [ngModel]=\"multiFilterValue(column)\"\n [props]=\"{\n id: 'mn-table-filter-' + idScope + '-' + column.key,\n ariaLabel: filterLabel(column),\n options: getFilterMultiSelectOptions(column),\n placeholder: column.filterPlaceholder ?? '',\n collapsePlaceholder: filterSelectedLabel,\n collapseThreshold: 1,\n size: 'sm',\n fullWidth: true\n }\"\n ></mn-lib-multi-select>\n }\n @case ('boolean') {\n <mn-lib-select\n (ngModelChange)=\"onBooleanFilter(column, $event)\"\n [disabled]=\"column.filterDisabled ?? false\"\n [ngModel]=\"booleanFilterValue(column)\"\n [props]=\"{\n id: 'mn-table-filter-' + idScope + '-' + column.key,\n ariaLabel: filterLabel(column),\n options: getBooleanFilterOptions(column),\n size: 'sm',\n fullWidth: true\n }\"\n ></mn-lib-select>\n }\n @default {\n <mn-lib-input-field\n (keydown.enter)=\"$event.preventDefault()\"\n (ngModelChange)=\"onColumnFilter(column, $event)\"\n [disabled]=\"column.filterDisabled ?? false\"\n [ngModel]=\"textFilterValue(column)\"\n [props]=\"{\n id: 'mn-table-filter-' + idScope + '-' + column.key,\n type: 'text',\n label: '',\n placeholder: column.filterPlaceholder ?? '',\n ariaLabel: column.filterPlaceholder ?? '',\n autocomplete: column.filterAutocomplete ?? undefined,\n size: 'sm',\n borderRadius: 'md',\n fullWidth: true,\n hover: true\n }\"\n ></mn-lib-input-field>\n }\n }\n</ng-template>\n\n<!-- One composed row (below 640px): the leading block, the title (two lines at most) over the\n second line, the right-side value, and a chevron when a tap opens something. The slots\n come from rowLayout; a column renders its cellSm form here when it has one. -->\n<ng-template #rowBody let-row let-chevron=\"chevron\">\n @let layout = rowLayout;\n @if (layout.leading; as leading) {\n <span class=\"flex h-8 min-w-8 shrink-0 items-center justify-center rounded-md bg-primary/10 px-1.5 text-sm font-semibold tabular-nums text-primary\">\n <ng-container [ngTemplateOutlet]=\"rowCell\" [ngTemplateOutletContext]=\"{ $implicit: leading, row: row }\"></ng-container>\n </span>\n }\n <span class=\"flex min-w-0 flex-1 flex-col gap-1\">\n @if (layout.title; as title) {\n <span class=\"line-clamp-2 text-sm font-semibold leading-snug text-base-content [overflow-wrap:anywhere]\">\n <ng-container [ngTemplateOutlet]=\"rowCell\" [ngTemplateOutletContext]=\"{ $implicit: title, row: row }\"></ng-container>\n </span>\n }\n @let meta = rowMeta(row);\n @if (meta.length > 0) {\n <span class=\"flex flex-wrap items-center gap-x-3 gap-y-1 text-xs text-(--color-base-content-muted,color-mix(in_oklab,var(--color-base-content)_65%,transparent))\">\n @for (column of meta; track column.key) {\n <!-- Bare values, no column names: on a 375px line a name like \"Goedgekeurd door\" took\n half the room and cut off the value it described. Only the right side is labelled. -->\n <span class=\"min-w-0 max-w-full truncate\">\n <ng-container [ngTemplateOutlet]=\"rowCell\" [ngTemplateOutletContext]=\"{ $implicit: column, row: row }\"></ng-container>\n </span>\n }\n </span>\n }\n </span>\n @if (layout.trailing; as trailing) {\n @if (!rowValueEmpty(trailing, row)) {\n <!-- The right-side value with its column name above it, small: \"1-12-2023\" or \"535\" alone\n does not say whether it is a join date or a score. One line: a date that wrapped\n (\"7 oktober 2026 om / 21:00\") doubled the row's height. Past 45% of the row the value\n is cut short with an ellipsis rather than squeezing the title into two lines. -->\n <span class=\"flex min-w-0 max-w-[45%] shrink-0 flex-col items-end gap-0.5 text-right\">\n @let trailingLabel = rowSlotLabel(trailing);\n @if (trailingLabel) {\n <span class=\"max-w-full truncate text-[0.6875rem] leading-tight text-(--color-base-content-muted,color-mix(in_oklab,var(--color-base-content)_65%,transparent))\">{{ trailingLabel }}</span>\n }\n <span class=\"max-w-full truncate whitespace-nowrap text-sm font-semibold tabular-nums text-base-content\">\n <ng-container [ngTemplateOutlet]=\"rowCell\" [ngTemplateOutletContext]=\"{ $implicit: trailing, row: row }\"></ng-container>\n </span>\n </span>\n }\n }\n @if (chevron) {\n <svg [lucideIcon]=\"icons.ChevronRight\" [size]=\"16\" aria-hidden=\"true\" class=\"mt-0.5 shrink-0 opacity-50\"></svg>\n }\n</ng-template>\n\n<!-- A cell as a composed row shows it: cellSm first. Its column name is the caller's (rowSlotLabel). -->\n<ng-template #rowCell let-column let-row=\"row\">\n @let template = rowCellTemplate(column);\n @if (template) {\n <ng-container [ngTemplateOutletContext]=\"{ $implicit: row, data: row }\" [ngTemplateOutlet]=\"template\"></ng-container>\n } @else {\n {{ rowCellText(column, row) }}\n }\n</ng-template>\n\n<!-- A cell in full, as the wide table shows it: the detail sheet is where the long form belongs. -->\n<ng-template #fullCell let-column let-row=\"row\">\n @if (isTemplateRef(column.cell)) {\n <ng-container [ngTemplateOutletContext]=\"{ $implicit: row, data: row }\" [ngTemplateOutlet]=\"$any(column.cell)\"></ng-container>\n } @else {\n {{ getCellValue(column, row) }}\n }\n</ng-template>\n\n<!-- Empty and error content, shared by the grid and the composed rows. -->\n<ng-template #emptyContent>\n @if (dataSource.emptyTemplate) {\n <ng-container [ngTemplateOutlet]=\"dataSource.emptyTemplate\"></ng-container>\n } @else {\n <!-- The same look as a section's empty state, so a page with both reads as one:\n a faint icon over a medium line in the consumer's muted text colour. -->\n <div class=\"flex flex-col items-center gap-3 py-16 text-(--color-base-content-muted,color-mix(in_oklab,var(--color-base-content)_65%,transparent))\">\n @if (dataSource.emptyIcon !== null) {\n <svg [lucideIcon]=\"dataSource.emptyIcon ?? defaultEmptyIcon\" [size]=\"26\" class=\"opacity-30\"></svg>\n }\n <p class=\"text-base font-medium\">{{ dataSource.emptyMessage }}</p>\n </div>\n }\n</ng-template>\n\n<ng-template #errorContent>\n @if (dataSource.errorTemplate) {\n <ng-container [ngTemplateOutlet]=\"dataSource.errorTemplate\"></ng-container>\n } @else {\n <div class=\"flex flex-col items-center gap-2 text-error\">\n <p class=\"text-sm\">{{ dataSource.errorMessage }}</p>\n </div>\n }\n</ng-template>\n\n<!-- Inline action buttons for an actions column on the wide table. Below 640px the same\n actions render in the detail sheet (or a modal's ⋯ menu). -->\n<ng-template #actionButtons let-column=\"column\" let-row=\"row\">\n <!-- A placeholder (a hidden keepSlot action) is the same button, invisible and inert:\n it holds the column so the actions after it line up with the rows above. -->\n @for (slot of inlineRowActions(column, row); track $index) {\n @let action = slot.action;\n <button\n mnButton\n type=\"button\"\n [data]=\"{\n size: 'sm',\n variant: 'text',\n color: rowActionColor(action, row),\n disabled: isRowActionDisabled(action, row) || slot.placeholder\n }\"\n class=\"cursor-pointer\"\n [class.invisible]=\"slot.placeholder\"\n [attr.inert]=\"slot.placeholder ? '' : null\"\n [attr.aria-hidden]=\"slot.placeholder ? 'true' : null\"\n (click)=\"$event.stopPropagation(); slot.placeholder || runRowAction(action, row)\"\n [attr.aria-label]=\"rowActionLabel(action, row)\"\n [attr.title]=\"showActionLabel(column, action, row) ? null : rowActionLabel(action, row)\"\n >\n @if (showActionIcon(column, action, row)) {\n <span class=\"inline-flex items-center shrink-0\">\n @let icon = rowActionIcon(action, row);\n @if (isTemplateRef(icon)) {\n <ng-container [ngTemplateOutlet]=\"icon\"></ng-container>\n } @else {\n <!-- Data icon: sized here to match the sm button's text, so a caller can\n declare the action in TypeScript without owning a template. -->\n <svg [lucideIcon]=\"$any(icon)\" [size]=\"17\"></svg>\n }\n </span>\n }\n @if (showActionLabel(column, action, row)) {\n <span>{{ rowActionLabel(action, row) }}</span>\n }\n </button>\n }\n</ng-template>\n",
|
|
1708
1708
|
dependencies: [
|
|
1709
1709
|
{
|
|
1710
1710
|
kind: "directive",
|
|
@@ -1887,7 +1887,7 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
1887
1887
|
],
|
|
1888
1888
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
1889
1889
|
host: { class: "block" },
|
|
1890
|
-
template: "<!-- Everything that reflows lives inside a @container, so the breakpoints below\n measure the table's own width rather than the window's. A table in a modal,\n a sidebar or a narrow grid cell is far narrower than the viewport, and\n viewport breakpoints would hand it a desktop layout it has no room for. -->\n<div class=\"@container\">\n <!-- Selection summary: the whole selection, never paged, filtered or sorted. The\n table below answers \"what could I pick?\", which is why it is searched and paged;\n this answers \"what did I pick?\", which a paginated list cannot without hiding\n most of the answer on some other page. -->\n @if (showSelectionSummary) {\n <div class=\"flex flex-col gap-2 rounded-md border border-base-300 bg-base-200/50 p-3 mb-3\">\n <div class=\"flex items-center justify-between gap-2\">\n <span class=\"text-sm font-medium text-base-content\">{{ selectionSummaryTitle }}</span>\n <button\n (click)=\"clearSelection()\"\n [data]=\"{ variant: 'text', color: 'gray', size: 'sm', borderRadius: 'md', hover: true }\"\n class=\"gap-1 shrink-0\"\n mnButton\n type=\"button\"\n >\n <svg [size]=\"14\" [lucideIcon]=\"icons.X\"></svg>\n <span>{{ selectionClearAllLabel }}</span>\n </button>\n </div>\n <!-- Only the first few tags render; the rest collapse behind a \"+N more\" control.\n The heading's count always states the true total, so this hides tags, never\n information. Expanded, the list is height-capped and scrolls, so even a\n selection of hundreds cannot push the table off screen. -->\n <ul\n [class.max-h-28]=\"selectionSummaryExpanded\"\n [class.overflow-y-auto]=\"selectionSummaryExpanded\"\n class=\"flex flex-wrap gap-1.5 list-none m-0 p-0\"\n >\n @for (row of visibleSelectionRows; track dataSource.getID(row)) {\n <li\n class=\"inline-flex items-center gap-1 rounded-full bg-base-100 border border-base-300 pl-2.5 pr-1 py-0.5 text-xs text-base-content max-w-full\">\n <span [attr.title]=\"selectionLabelFor(row)\" class=\"truncate\">{{ selectionLabelFor(row) }}</span>\n <button\n (click)=\"removeSelection(row)\"\n [attr.aria-label]=\"selectionRemoveLabel(row)\"\n class=\"shrink-0 rounded-full p-0.5 hover:bg-base-300 transition-colors cursor-pointer\"\n type=\"button\"\n >\n <svg [size]=\"12\" [lucideIcon]=\"icons.X\"></svg>\n </button>\n </li>\n }\n @if (hiddenSelectionCount > 0 || selectionSummaryExpanded) {\n <li>\n <button\n (click)=\"toggleSelectionSummary()\"\n [attr.aria-expanded]=\"selectionSummaryExpanded\"\n [data]=\"{ variant: 'text', color: 'primary', size: 'sm', borderRadius: 'md', hover: true }\"\n class=\"text-xs\"\n mnButton\n type=\"button\"\n >\n {{ selectionSummaryToggleLabel }}\n </button>\n </li>\n }\n </ul>\n </div>\n }\n\n <!-- Toolbar: custom toolbar template + search. Only rendered when it has content,\n so an unsearchable table without toolbar templates emits no empty spacer. -->\n@if (showsSearch || dataSource.toolbarLeftTemplate || dataSource.toolbarRightTemplate || showsFilterButton) {\n <div class=\"flex flex-col @min-[420px]:flex-row @min-[420px]:items-center justify-between gap-2 mb-3\">\n <!-- The left slot only when it has content: an empty one still took a flex gap, which\n pushed the search 8px in from the page edge. ml-auto keeps the search on the right. -->\n @if (dataSource.toolbarLeftTemplate) {\n <div class=\"flex items-center gap-2 w-full @min-[420px]:w-auto\">\n <div class=\"flex flex-col w-full @min-[420px]:w-auto @min-[420px]:flex-row\">\n <ng-container [ngTemplateOutlet]=\"dataSource.toolbarLeftTemplate\"></ng-container>\n </div>\n </div>\n }\n <div\n class=\"flex flex-col @min-[420px]:flex-row @min-[420px]:items-center gap-2 w-full @min-[420px]:flex-1 @min-[420px]:ml-auto @min-[560px]:flex-none @min-[560px]:w-auto\">\n <!-- Search and the filter button share one row: two full-width bars stacked above the\n first row pushed the content a whole screen down on a phone. -->\n @if (showsSearch || showsFilterButton) {\n <div class=\"flex items-center gap-2 w-full @min-[420px]:flex-1 @min-[560px]:flex-none\">\n @if (showsSearch) {\n <!-- Enter must not submit a surrounding form: the search box belongs to the\n table's chrome, not to whatever form the table happens to sit in. -->\n <mn-lib-input-field\n (keydown.enter)=\"$event.preventDefault()\"\n class=\"min-w-0 flex-1 @min-[560px]:flex-none @min-[560px]:min-w-64\"\n [props]=\"{\n id: 'mn-table-search',\n type: 'search',\n label: '',\n ariaLabel: searchPlaceholderLabel,\n placeholder: searchPlaceholderLabel,\n size: 'sm',\n borderRadius: 'md',\n fullWidth: true\n }\"\n [ngModel]=\"searchValue\"\n (ngModelChange)=\"onSearch($event)\"\n ></mn-lib-input-field>\n }\n <!-- Below 640px the header row with its sort buttons and the inline filter row are\n gone; this one button opens both, with a count while filters are set. -->\n @if (showsFilterButton) {\n <button\n type=\"button\"\n mnButton\n [data]=\"{ variant: 'outline', color: 'primary', size: 'md', borderRadius: 'md', hover: true }\"\n class=\"shrink-0 gap-1.5 px-2.5\"\n [class.ml-auto]=\"!showsSearch\"\n [attr.aria-label]=\"filtersButtonAriaLabel\"\n [attr.title]=\"filterSheetLabel\"\n [attr.aria-expanded]=\"filtersPanelOpen\"\n aria-controls=\"mn-table-filters-panel\"\n (click)=\"openFiltersPanel()\"\n >\n <svg [lucideIcon]=\"icons.Funnel\" [size]=\"17\"></svg>\n <!-- The count sits inside the button: a badge hanging off its corner reached past the\n table's right edge and gave a container that clips or scrolls a sideways scroll. -->\n @if (activeFilterCount > 0) {\n <span class=\"text-sm font-semibold leading-none tabular-nums\" aria-hidden=\"true\">{{ activeFilterCount }}</span>\n }\n </button>\n }\n </div>\n }\n @if (dataSource.toolbarRightTemplate) {\n <div class=\"flex flex-col w-full @min-[420px]:w-auto @min-[420px]:flex-row\">\n <ng-container [ngTemplateOutlet]=\"dataSource.toolbarRightTemplate\"></ng-container>\n </div>\n }\n </div>\n</div>\n}\n\n<!-- Small-screen filters: full-width fields decoupled from column widths, presented\n as a bottom sheet so they overlay rather than push the table down. -->\n@if (showsFilterButton && filtersPanelOpen) {\n <mn-bottom-sheet\n #filtersSheet\n (dismiss)=\"filtersPanelOpen = false\"\n [ariaLabel]=\"filterSheetLabel\"\n [growWithKeyboard]=\"true\"\n [maxHeightVh]=\"80\"\n >\n <div id=\"mn-table-filters-panel\" class=\"flex flex-col gap-3 px-4 pb-4\">\n <span class=\"text-base font-semibold text-base-content\">{{ filterSheetLabel }}</span>\n <!-- Sorting lives here below 640px: the header row whose buttons sorted is not rendered.\n The choices are inline radios, not a select: a select opens its own bottom sheet on a\n phone, which stacked a second sheet on this one and cut its list off. One row per\n column, the direction as a separate switch once a column is picked. -->\n @if (sortableColumns.length > 0) {\n <fieldset class=\"m-0 flex flex-col gap-2 border-0 p-0\">\n <legend\n class=\"mb-1 p-0 text-xs font-medium text-base-content/70\"\n [class.sr-only]=\"!hasColumnFilters\"\n >{{ sortByLabel }}</legend>\n <div class=\"flex flex-col\">\n <label class=\"flex min-h-11 cursor-pointer items-center gap-3 text-sm text-base-content\">\n <input\n type=\"radio\"\n class=\"size-[1.125rem] shrink-0 cursor-pointer appearance-none rounded-full border-2 border-base-content/40 bg-base-100 transition-[border] checked:border-[0.3125rem] checked:border-primary focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary\"\n [name]=\"sortGroupName\"\n value=\"\"\n [checked]=\"!currentSort\"\n (change)=\"onSortColumn('')\"\n />\n <span>{{ sortDefaultLabel }}</span>\n </label>\n @for (column of sortableColumns; track column.key) {\n <!-- The chosen column carries its own direction button at the row's end: it sits\n inside a row that is already there, so picking a column never grows the sheet,\n and no greyed-out switch shows while the default order is chosen. -->\n <div class=\"flex min-h-11 items-center gap-2\">\n <label class=\"flex min-w-0 flex-1 cursor-pointer items-center gap-3 self-stretch text-sm text-base-content\">\n <input\n type=\"radio\"\n class=\"size-[1.125rem] shrink-0 cursor-pointer appearance-none rounded-full border-2 border-base-content/40 bg-base-100 transition-[border] checked:border-[0.3125rem] checked:border-primary focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary\"\n [name]=\"sortGroupName\"\n [value]=\"column.key\"\n [checked]=\"currentSort?.columnKey === column.key\"\n (change)=\"onSortColumn(column.key)\"\n />\n <span class=\"truncate\">{{ headerText(column) || column.key }}</span>\n </label>\n @if (currentSort?.columnKey === column.key) {\n <button\n type=\"button\"\n mnButton\n [data]=\"{ variant: 'outline', color: 'primary', size: 'sm', borderRadius: 'md', hover: true }\"\n class=\"shrink-0 gap-1.5\"\n [attr.aria-label]=\"sortDirectionButtonLabel\"\n (click)=\"toggleSortDirection()\"\n >\n <svg [lucideIcon]=\"currentSort.direction === 'desc' ? icons.ArrowDown : icons.ArrowUp\" [size]=\"15\"></svg>\n <span>{{ sortDirectionLabel }}</span>\n </button>\n }\n </div>\n }\n </div>\n </fieldset>\n @if (hasColumnFilters) {\n <div class=\"border-t border-base-300\" aria-hidden=\"true\"></div>\n }\n }\n @for (column of dataSource.columns; track column.key) {\n @if (column.filterable) {\n <div class=\"flex flex-col gap-1\">\n <label\n class=\"text-xs font-medium text-base-content/70\"\n [attr.for]=\"'mn-table-filter-panel-' + column.key\"\n >\n @if (isTemplateRef(column.header)) {\n <ng-container [ngTemplateOutlet]=\"$any(column.header)\"></ng-container>\n } @else {\n {{ headerText(column) }}\n }\n </label>\n <!-- The field template is declared outside the sheet, so it would inject from there;\n this injector tells its selects they are in a sheet (no second sheet on top). -->\n <ng-container\n [ngTemplateOutletContext]=\"{ $implicit: column, idScope: 'panel' }\"\n [ngTemplateOutletInjector]=\"inSheetInjector\"\n [ngTemplateOutlet]=\"filterField\"\n ></ng-container>\n </div>\n }\n }\n @if (hasActiveFilters) {\n <button\n type=\"button\"\n mnButton\n [data]=\"{ variant: 'text', color: 'gray', size: 'sm', borderRadius: 'md', hover: true }\"\n class=\"self-start gap-1\"\n (click)=\"clearAllFilters()\"\n >\n <svg [lucideIcon]=\"icons.X\" [size]=\"14\"></svg>\n <span>{{ clearFiltersButtonLabel }}</span>\n </button>\n }\n <div class=\"mt-1 flex min-[400px]:justify-end\">\n <button\n type=\"button\"\n mnButton\n [data]=\"{ variant: 'fill', color: 'primary', size: 'md', borderRadius: 'md', hover: true }\"\n class=\"w-full min-[400px]:w-auto\"\n (click)=\"closeFiltersPanel()\"\n >\n <span>{{ filtersCloseLabel }}</span>\n </button>\n </div>\n </div>\n </mn-bottom-sheet>\n}\n\n<!-- Detail sheet (below 640px): the whole record of one row — title and right-side value as the\n heading, every other column as a label/value list, then the actions. It is the only place a\n column the composed row could not show, or an action, is reachable on a phone. -->\n@if (detailRow !== null) {\n @let row = detailRow;\n <mn-bottom-sheet\n #detailSheet\n (dismiss)=\"onDetailDismissed()\"\n [ariaLabel]=\"rowLabel(row)\"\n [maxHeightVh]=\"85\"\n >\n <!-- Escape closes it: the sheet itself only handles the backdrop and the drag. Focus is\n moved inside on open, so the key arrives here by bubbling. -->\n <!-- eslint-disable-next-line @angular-eslint/template/interactive-supports-focus -->\n <div class=\"flex flex-col gap-4 px-4 pb-4\" (keydown.escape)=\"closeDetail()\">\n <div class=\"flex items-start gap-3\">\n <h2\n #detailHeading\n class=\"m-0 min-w-0 flex-1 text-lg font-semibold leading-snug text-base-content outline-none [overflow-wrap:anywhere]\"\n tabindex=\"-1\"\n >\n @if (rowLayout.title; as title) {\n <ng-container [ngTemplateOutlet]=\"fullCell\" [ngTemplateOutletContext]=\"{ $implicit: title, row: row }\"></ng-container>\n }\n </h2>\n @if (rowLayout.trailing && !rowValueEmpty(rowLayout.trailing, row)) {\n @let trailing = rowLayout.trailing;\n <span class=\"flex shrink-0 flex-col items-end gap-0.5 text-right\">\n @if (rowSlotLabel(trailing); as trailingLabel) {\n <span class=\"text-xs text-(--color-base-content-muted,color-mix(in_oklab,var(--color-base-content)_65%,transparent))\">{{ trailingLabel }}</span>\n }\n <span class=\"text-lg font-semibold tabular-nums text-base-content\">\n <ng-container [ngTemplateOutlet]=\"fullCell\" [ngTemplateOutletContext]=\"{ $implicit: trailing, row: row }\"></ng-container>\n </span>\n </span>\n }\n </div>\n @if (detailColumns.length > 0) {\n <dl class=\"m-0 grid grid-cols-[minmax(0,8rem)_minmax(0,1fr)] gap-x-3 gap-y-2.5 border-t border-base-300 pt-4 text-sm\">\n @for (column of detailColumns; track column.key) {\n <!-- An empty value or a lone dash says nothing here either (\"Beschrijving: -\"). -->\n @if (!rowValueEmpty(column, row)) {\n <dt class=\"text-(--color-base-content-muted,color-mix(in_oklab,var(--color-base-content)_65%,transparent))\">\n @if (isTemplateRef(column.header)) {\n <ng-container [ngTemplateOutlet]=\"$any(column.header)\"></ng-container>\n } @else {\n {{ headerText(column) }}\n }\n </dt>\n <dd class=\"m-0 min-w-0 text-base-content [overflow-wrap:anywhere]\">\n <ng-container [ngTemplateOutlet]=\"fullCell\" [ngTemplateOutletContext]=\"{ $implicit: column, row: row }\"></ng-container>\n </dd>\n }\n }\n </dl>\n }\n @if (rowHasAnyActions(row)) {\n <div class=\"flex flex-col gap-2 border-t border-base-300 pt-4\">\n @for (column of rowLayout.actions; track column.key) {\n @for (action of visibleRowActions(column, row); track $index) {\n <button\n mnButton\n type=\"button\"\n [data]=\"{\n variant: 'outline',\n color: rowActionColor(action, row),\n size: 'md',\n borderRadius: 'md',\n hover: true,\n disabled: isRowActionDisabled(action, row)\n }\"\n class=\"w-full gap-2\"\n [attr.aria-disabled]=\"isRowActionDisabled(action, row) || null\"\n (click)=\"runDetailAction(action, row)\"\n >\n @let icon = rowActionIcon(action, row);\n @if (icon) {\n <span class=\"inline-flex shrink-0 items-center\">\n @if (isTemplateRef(icon)) {\n <ng-container [ngTemplateOutlet]=\"icon\"></ng-container>\n } @else {\n <svg [lucideIcon]=\"$any(icon)\" [size]=\"17\"></svg>\n }\n </span>\n }\n <span>{{ rowActionLabel(action, row) }}</span>\n </button>\n }\n }\n </div>\n }\n </div>\n </mn-bottom-sheet>\n}\n\n<!-- Announces loading. The skeletons are aria-hidden, so without this a screen reader hears\n nothing while rows load. The region stays in the DOM and only its text changes, which is\n what makes assistive tech read it; one inserted with its text already set is often missed. -->\n<span class=\"sr-only\" role=\"status\">{{ isLoadingState ? loadingLabel : '' }}</span>\n\n<!-- Table wrapper with horizontal scroll -->\n <div #collectionBody [attr.aria-busy]=\"isLoadingState || null\" [attr.aria-label]=\"tableRegionLabel\" [style.min-height.px]=\"bodyMinHeight\"\n class=\"overflow-x-auto\"\n role=\"region\">\n @if (rowMode) {\n <!-- Below 640px every row is a composed line (see resolveRowLayout): the columns that\n would not fit as cells become a title, a second line and a value on the right, and\n the rest waits in the detail sheet a tap opens. A list, not a table: there are no\n columns left for a screen reader to navigate. -->\n <ul class=\"m-0 list-none p-0\">\n <!-- A \"Load more\" refetch keeps the rows it is adding to (see loadMorePhoneRows). -->\n @if (isLoadingState && !phoneLoadingMore) {\n @for (_ of skeletonRows; track $index) {\n <li aria-hidden=\"true\" class=\"flex items-center gap-3 border-b border-base-300 bg-base-100 px-2 py-3\">\n <div class=\"flex flex-1 flex-col gap-2\">\n <mn-skeleton [data]=\"{ shape: 'text', width: '60%' }\"></mn-skeleton>\n <mn-skeleton [data]=\"{ shape: 'text', width: '40%', height: '0.75rem' }\"></mn-skeleton>\n </div>\n </li>\n }\n } @else if (isErrorState) {\n <li class=\"bg-base-100 py-8 text-center text-xs\">\n <ng-container [ngTemplateOutlet]=\"errorContent\"></ng-container>\n </li>\n } @else {\n @if (filteredItems.length === 0) {\n <li class=\"bg-base-100 text-center text-xs\">\n <ng-container [ngTemplateOutlet]=\"emptyContent\"></ng-container>\n </li>\n }\n @for (row of paginatedItems; track trackByID($index, row)) {\n @let tap = rowTap(row);\n <li\n class=\"flex items-stretch border-b border-base-300 bg-base-100\"\n [ngClass]=\"{ 'bg-primary/10': isSelected(row) }\"\n >\n @if (hasSelection) {\n <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events,@angular-eslint/template/interactive-supports-focus -->\n <div class=\"flex shrink-0 items-center pl-2\" (click)=\"$event.stopPropagation()\">\n <mn-lib-checkbox\n (checkedChange)=\"toggle(row)\"\n [checked]=\"isSelected(row)\"\n [props]=\"{ id: 'mn-table-row-' + $index, size: 'sm' }\"\n ></mn-lib-checkbox>\n </div>\n }\n @if (tap === 'detail' || tap === 'click') {\n <button\n type=\"button\"\n class=\"flex min-w-0 flex-1 cursor-pointer items-start gap-3 px-2 py-3 text-left transition-colors duration-150 hover:bg-base-200 focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-primary\"\n [attr.aria-haspopup]=\"tap === 'detail' ? 'dialog' : null\"\n (click)=\"onRowTap(row, $event)\"\n >\n <ng-container [ngTemplateOutlet]=\"rowBody\" [ngTemplateOutletContext]=\"{ $implicit: row, chevron: true }\"></ng-container>\n </button>\n } @else {\n <!-- A selection row toggles on a click anywhere, as the wide table's row does; the\n checkbox is its keyboard control, so this area needs no focus of its own. -->\n <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events,@angular-eslint/template/interactive-supports-focus -->\n <div\n class=\"flex min-w-0 flex-1 items-start gap-3 px-2 py-3\"\n [class.cursor-pointer]=\"tap === 'select'\"\n (click)=\"tap === 'select' && onRowClick(row)\"\n >\n <ng-container [ngTemplateOutlet]=\"rowBody\" [ngTemplateOutletContext]=\"{ $implicit: row, chevron: false }\"></ng-container>\n </div>\n }\n @if (showsRowMore(row)) {\n <button\n type=\"button\"\n class=\"flex w-11 shrink-0 cursor-pointer items-center justify-center text-base-content/70 transition-colors hover:bg-base-200 focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-primary\"\n aria-haspopup=\"dialog\"\n [attr.aria-label]=\"rowDetailsLabel(row)\"\n (click)=\"openDetail(row, $any($event.currentTarget))\"\n >\n <svg [lucideIcon]=\"icons.Ellipsis\" [size]=\"18\"></svg>\n </button>\n }\n @if (showsRowMenu(row)) {\n @for (column of rowLayout.actions; track column.key) {\n @if (hasRowActions(column, row)) {\n <div class=\"flex shrink-0 items-center pr-1\">\n <mn-lib-dropdown [datasource]=\"{\n id: actionsDropdownId(column, row),\n actions: rowDropdownActions(column, row),\n menuLabel: headerText(column),\n size: 'sm'\n }\"></mn-lib-dropdown>\n </div>\n }\n }\n }\n </li>\n }\n }\n </ul>\n } @else {\n <table [class]=\"tableClasses\">\n <thead>\n <tr class=\"bg-base-100\">\n <!-- Selection column header. It always carries a screen-reader-only name: a single-select\n table has nothing else in this cell, and a multi-select one only a checkbox, so\n without it the column is announced as a nameless header (axe empty-table-header). -->\n @if (hasSelection) {\n <th class=\"w-10 text-center text-sm px-2 py-2\">\n <span class=\"sr-only\">{{ selectionColumnLabel }}</span>\n @if (isMultiSelect) {\n <mn-lib-checkbox\n (checkedChange)=\"toggleAll()\"\n [checked]=\"allSelected\"\n [props]=\"{ id: 'mn-table-select-all', size: 'sm' }\"\n ></mn-lib-checkbox>\n }\n </th>\n }\n\n <!-- Data columns -->\n @for (column of dataSource.columns; track column.key) {\n <th\n [attr.data-column-key]=\"column.key\"\n [class.truncate]=\"widthsArePinned\"\n [class.cursor-pointer]=\"isSortable(column)\"\n [class.select-none]=\"isSortable(column)\"\n [class.hover:bg-base-200]=\"isSortable(column)\"\n [class.text-left]=\"(column.align ?? 'left') === 'left'\"\n [class.text-center]=\"column.align === 'center'\"\n [class.text-right]=\"column.align === 'right'\"\n [mnHiddenBelow]=\"column.hiddenBelow\"\n [style.width]=\"columnWidth(column)\"\n [attr.aria-sort]=\"currentSort?.columnKey === column.key ? (currentSort!.direction === 'asc' ? 'ascending' : 'descending') : null\"\n class=\"text-sm px-2 py-1 @min-[640px]:px-4 @min-[640px]:py-2 whitespace-nowrap\"\n (click)=\"sort(column)\"\n >\n <!-- The header content is declared once; a sortable column wraps it in a real button so\n the sort is reachable by keyboard. The button's click stops there, so the th's own\n click (which keeps the cell padding clickable) does not sort a second time. -->\n <ng-template #headerContent>\n @if (isTemplateRef(column.header)) {\n <ng-container [ngTemplateOutlet]=\"$any(column.header)\"></ng-container>\n } @else {\n <span>{{ headerText(column) }}</span>\n }\n @if (isSortable(column)) {\n <span class=\"text-[0.65rem] opacity-70 min-w-3 inline-block\" aria-hidden=\"true\">{{ getSortIcon(column) }}</span>\n }\n </ng-template>\n @if (isSortable(column)) {\n <button type=\"button\" class=\"inline-flex items-center gap-1 cursor-pointer\" (click)=\"$event.stopPropagation(); sort(column)\">\n <ng-container [ngTemplateOutlet]=\"headerContent\"></ng-container>\n </button>\n } @else {\n <span class=\"inline-flex items-center gap-1\">\n <ng-container [ngTemplateOutlet]=\"headerContent\"></ng-container>\n </span>\n }\n </th>\n }\n\n </tr>\n\n <!-- Per-column filter row (wide screens only; collapses into a panel below 640px).\n The cells are `td`, not `th`: they hold form controls, not headings, and a\n column without a filter would otherwise be an empty header, which assistive tech\n announces as a nameless column (axe `empty-table-header`). `font-normal` stays\n so a consumer's thead styling cannot make the controls bold. -->\n @if (hasColumnFilters && !filtersCollapsed) {\n <tr class=\"bg-base-100 border-b border-base-300 font-normal\">\n @if (hasSelection) {\n <td class=\"px-2 py-1 font-normal\"></td>\n }\n @for (column of dataSource.columns; track column.key) {\n <td\n class=\"px-4 py-2 font-normal\"\n [mnHiddenBelow]=\"column.hiddenBelow\"\n >\n @if (column.filterable) {\n <!-- Every filter renders as an ordinary control right under its\n header. The rich types used to hide behind a button that opened\n a floating panel, which cost a click to discover, a click to\n apply, and hid whether a column was even filterable. -->\n <ng-container\n [ngTemplateOutletContext]=\"{ $implicit: column, idScope: 'inline' }\"\n [ngTemplateOutlet]=\"filterField\"\n ></ng-container>\n }\n </td>\n }\n </tr>\n }\n </thead>\n\n <tbody>\n <!-- Loading state -->\n @if (isLoadingState) {\n @for (_ of skeletonRows; track $index) {\n <tr>\n @if (hasSelection) {\n <td class=\"px-2 py-3\">\n <mn-skeleton [data]=\"{ shape: 'rectangle', width: '1rem', height: '1rem' }\"></mn-skeleton>\n </td>\n }\n @for (column of dataSource.columns; track column.key) {\n <td class=\"px-4 py-3\"\n [mnHiddenBelow]=\"column.hiddenBelow\"\n [style.width]=\"columnWidth(column)\"\n >\n @if (isTemplateRef(column.skeleton)) {\n <ng-container [ngTemplateOutlet]=\"$any(column.skeleton)\"></ng-container>\n } @else {\n <mn-skeleton [data]=\"getColumnSkeletonData(column)\"></mn-skeleton>\n }\n </td>\n }\n </tr>\n }\n } @else if (isErrorState) {\n <!-- Error state -->\n <tr class=\"bg-base-100\">\n <td [attr.colspan]=\"totalColumnCount\" class=\"text-center text-xs py-8\">\n <ng-container [ngTemplateOutlet]=\"errorContent\"></ng-container>\n </td>\n </tr>\n } @else {\n <!-- Empty state -->\n @if (filteredItems.length === 0) {\n <tr class=\"bg-base-100\">\n <td [attr.colspan]=\"totalColumnCount\" class=\"text-center text-xs py-8\">\n <ng-container [ngTemplateOutlet]=\"emptyContent\"></ng-container>\n </td>\n </tr>\n }\n\n <!-- Data rows -->\n @for (row of paginatedItems; track trackByID($index, row); let odd = $odd; let last = $last) {\n <!-- The wash and the pointer promise that a click does something, so only a clickable row gets them. -->\n <tr\n class=\"bg-base-100 transition-colors duration-150 border-b border-base-300\"\n [ngClass]=\"{'bg-primary/10': isSelected(row)}\"\n [class.bg-base-200]=\"!isSelected(row) && odd && dataSource.appearance?.striped\"\n [class.hover:bg-base-200]=\"rowsClickable && dataSource.appearance?.hover !== false\"\n [class.cursor-pointer]=\"rowsClickable\"\n (click)=\"onRowClick(row)\"\n >\n <!-- Selection checkbox -->\n @if (hasSelection) {\n <td (click)=\"$event.stopPropagation()\" class=\"w-10 text-center px-2 py-2\">\n <mn-lib-checkbox\n (checkedChange)=\"toggle(row)\"\n [checked]=\"isSelected(row)\"\n [props]=\"{ id: 'mn-table-row-' + $index, size: 'sm' }\"\n ></mn-lib-checkbox>\n </td>\n }\n\n <!-- Data cells -->\n @for (column of dataSource.columns; track column.key) {\n <td\n [attr.title]=\"cellTitle(column, row)\"\n [class.text-left]=\"(column.align ?? 'left') === 'left'\"\n [class.text-center]=\"column.align === 'center'\"\n [class.text-right]=\"column.align === 'right'\"\n [class.truncate]=\"widthsArePinned\"\n [mnHiddenBelow]=\"column.hiddenBelow\"\n [style.width]=\"columnWidth(column)\"\n class=\"text-xs px-2 py-1 @min-[640px]:px-4 @min-[640px]:py-2\"\n >\n @if (column.actions) {\n <!-- Actions column: inline command buttons. The grid only renders at 640px\n and wider, where they fit; below that the actions move into the row's\n detail sheet. A row with no visible actions renders nothing. -->\n @if (hasRowActions(column, row)) {\n <div class=\"inline-flex items-center gap-1\"\n [class.justify-end]=\"(column.align ?? 'left') === 'right'\">\n <span class=\"inline-flex items-center gap-1\">\n <ng-container [ngTemplateOutletContext]=\"{ column: column, row: row }\"\n [ngTemplateOutlet]=\"actionButtons\"></ng-container>\n </span>\n </div>\n }\n } @else if (column.cellSm) {\n <!-- Default cell: hidden below the cellSm breakpoint -->\n <span [mnShowAbove]=\"column.cellSm.below\">\n @if (isTemplateRef(column.cell)) {\n <ng-container [ngTemplateOutletContext]=\"{ $implicit: row, data: row }\"\n [ngTemplateOutlet]=\"$any(column.cell)\"></ng-container>\n } @else {\n {{ getCellValue(column, row) }}\n }\n </span>\n <!-- Small cell: shown only below the cellSm breakpoint -->\n <span [mnShowBelow]=\"column.cellSm.below\">\n @if (isTemplateRef(column.cellSm.cell)) {\n <ng-container [ngTemplateOutletContext]=\"{ $implicit: row, data: row }\"\n [ngTemplateOutlet]=\"$any(column.cellSm.cell)\"></ng-container>\n } @else {\n {{ getCellSmValue(column, row) }}\n }\n </span>\n } @else {\n @if (isTemplateRef(column.cell)) {\n <ng-container [ngTemplateOutletContext]=\"{ $implicit: row, data: row }\"\n [ngTemplateOutlet]=\"$any(column.cell)\"></ng-container>\n } @else {\n {{ getCellValue(column, row) }}\n }\n }\n </td>\n }\n\n </tr>\n }\n }\n </tbody>\n </table>\n }\n</div>\n\n<!-- Below 640px a paginated table grows instead of paging (see showsPhoneLoadMore). -->\n@if (showsPhoneLoadMore) {\n <div class=\"flex flex-col items-center gap-2 px-2 pb-1 pt-3\">\n <span class=\"text-xs text-(--color-base-content-muted,color-mix(in_oklab,var(--color-base-content)_65%,transparent))\" aria-live=\"polite\">{{ phoneLoadedLabel }}</span>\n <button\n mnButton\n type=\"button\"\n [data]=\"{ variant: 'outline', color: 'primary', size: 'md', borderRadius: 'md', hover: true, disabled: phoneLoadingMore }\"\n class=\"w-full gap-2\"\n [attr.aria-disabled]=\"phoneLoadingMore || null\"\n (click)=\"loadMorePhoneRows()\"\n >\n @if (phoneLoadingMore) {\n <span aria-hidden=\"true\" class=\"inline-block size-3.5 animate-spin rounded-full border-2 border-current border-t-transparent\"></span>\n }\n {{ phoneLoadMoreLabel }}\n </button>\n </div>\n}\n\n<!-- Load more + pagination (not for a single page below 640px, see showsPagination) -->\n@if (showsPagination) {\n<mn-collection-pagination\n (loadMore)=\"loadMoreRows()\"\n (pageChange)=\"goToPage($event)\"\n (pageSizeChange)=\"onPageSizeChange($event)\"\n [currentPage]=\"currentPage\"\n [isPaginated]=\"isPaginated\"\n [isServerPaginated]=\"isServerPaginated\"\n [labels]=\"dataSource.labels\"\n [loadingMoreRows]=\"loadingMoreRows\"\n [pageSizeSelectOptions]=\"pageSizeSelectOptions\"\n [pageSize]=\"pageSize\"\n [showLoadMore]=\"showLoadMore\"\n [totalItemCount]=\"totalItemCount\"\n [totalPages]=\"totalPages\"\n [visiblePages]=\"visiblePages\"\n idPrefix=\"mn-table\"\n></mn-collection-pagination>\n}\n</div>\n\n<!-- Single source of truth for every filter control, reused by the inline header\n row and the small-screen panel. `idScope` keeps element ids unique across\n both placements. -->\n<ng-template #filterField let-column let-idScope=\"idScope\">\n @switch (filterTypeOf(column)) {\n @case ('select') {\n <mn-lib-select\n (ngModelChange)=\"onColumnFilter(column, $event)\"\n [disabled]=\"column.filterDisabled ?? false\"\n [ngModel]=\"textFilterValue(column)\"\n [props]=\"{\n id: 'mn-table-filter-' + idScope + '-' + column.key,\n ariaLabel: filterLabel(column),\n options: getFilterSelectOptions(column),\n placeholder: filterAllLabel(column),\n size: 'sm',\n fullWidth: true\n }\"\n ></mn-lib-select>\n }\n @case ('multi-select') {\n <mn-lib-multi-select\n (ngModelChange)=\"onColumnFilter(column, $event)\"\n [disabled]=\"column.filterDisabled ?? false\"\n [ngModel]=\"multiFilterValue(column)\"\n [props]=\"{\n id: 'mn-table-filter-' + idScope + '-' + column.key,\n ariaLabel: filterLabel(column),\n options: getFilterMultiSelectOptions(column),\n placeholder: column.filterPlaceholder ?? '',\n collapsePlaceholder: filterSelectedLabel,\n collapseThreshold: 1,\n size: 'sm',\n fullWidth: true\n }\"\n ></mn-lib-multi-select>\n }\n @case ('boolean') {\n <mn-lib-select\n (ngModelChange)=\"onBooleanFilter(column, $event)\"\n [disabled]=\"column.filterDisabled ?? false\"\n [ngModel]=\"booleanFilterValue(column)\"\n [props]=\"{\n id: 'mn-table-filter-' + idScope + '-' + column.key,\n ariaLabel: filterLabel(column),\n options: getBooleanFilterOptions(column),\n size: 'sm',\n fullWidth: true\n }\"\n ></mn-lib-select>\n }\n @default {\n <mn-lib-input-field\n (keydown.enter)=\"$event.preventDefault()\"\n (ngModelChange)=\"onColumnFilter(column, $event)\"\n [disabled]=\"column.filterDisabled ?? false\"\n [ngModel]=\"textFilterValue(column)\"\n [props]=\"{\n id: 'mn-table-filter-' + idScope + '-' + column.key,\n type: 'text',\n label: '',\n placeholder: column.filterPlaceholder ?? '',\n ariaLabel: column.filterPlaceholder ?? '',\n autocomplete: column.filterAutocomplete ?? undefined,\n size: 'sm',\n borderRadius: 'md',\n fullWidth: true,\n hover: true\n }\"\n ></mn-lib-input-field>\n }\n }\n</ng-template>\n\n<!-- One composed row (below 640px): the leading block, the title (two lines at most) over the\n second line, the right-side value, and a chevron when a tap opens something. The slots\n come from rowLayout; a column renders its cellSm form here when it has one. -->\n<ng-template #rowBody let-row let-chevron=\"chevron\">\n @let layout = rowLayout;\n @if (layout.leading; as leading) {\n <span class=\"flex h-8 min-w-8 shrink-0 items-center justify-center rounded-md bg-primary/10 px-1.5 text-sm font-semibold tabular-nums text-primary\">\n <ng-container [ngTemplateOutlet]=\"rowCell\" [ngTemplateOutletContext]=\"{ $implicit: leading, row: row }\"></ng-container>\n </span>\n }\n <span class=\"flex min-w-0 flex-1 flex-col gap-1\">\n @if (layout.title; as title) {\n <span class=\"line-clamp-2 text-sm font-semibold leading-snug text-base-content [overflow-wrap:anywhere]\">\n <ng-container [ngTemplateOutlet]=\"rowCell\" [ngTemplateOutletContext]=\"{ $implicit: title, row: row }\"></ng-container>\n </span>\n }\n @let meta = rowMeta(row);\n @if (meta.length > 0) {\n <span class=\"flex flex-wrap items-center gap-x-3 gap-y-1 text-xs text-(--color-base-content-muted,color-mix(in_oklab,var(--color-base-content)_65%,transparent))\">\n @for (column of meta; track column.key) {\n <!-- Bare values, no column names: on a 375px line a name like \"Goedgekeurd door\" took\n half the room and cut off the value it described. Only the right side is labelled. -->\n <span class=\"min-w-0 max-w-full truncate\">\n <ng-container [ngTemplateOutlet]=\"rowCell\" [ngTemplateOutletContext]=\"{ $implicit: column, row: row }\"></ng-container>\n </span>\n }\n </span>\n }\n </span>\n @if (layout.trailing; as trailing) {\n @if (!rowValueEmpty(trailing, row)) {\n <!-- The right-side value with its column name above it, small: \"1-12-2023\" or \"535\" alone\n does not say whether it is a join date or a score. One line: a date that wrapped\n (\"7 oktober 2026 om / 21:00\") doubled the row's height. Past 45% of the row the value\n is cut short with an ellipsis rather than squeezing the title into two lines. -->\n <span class=\"flex min-w-0 max-w-[45%] shrink-0 flex-col items-end gap-0.5 text-right\">\n @let trailingLabel = rowSlotLabel(trailing);\n @if (trailingLabel) {\n <span class=\"max-w-full truncate text-[0.6875rem] leading-tight text-(--color-base-content-muted,color-mix(in_oklab,var(--color-base-content)_65%,transparent))\">{{ trailingLabel }}</span>\n }\n <span class=\"max-w-full truncate whitespace-nowrap text-sm font-semibold tabular-nums text-base-content\">\n <ng-container [ngTemplateOutlet]=\"rowCell\" [ngTemplateOutletContext]=\"{ $implicit: trailing, row: row }\"></ng-container>\n </span>\n </span>\n }\n }\n @if (chevron) {\n <svg [lucideIcon]=\"icons.ChevronRight\" [size]=\"16\" aria-hidden=\"true\" class=\"mt-0.5 shrink-0 opacity-50\"></svg>\n }\n</ng-template>\n\n<!-- A cell as a composed row shows it: cellSm first. Its column name is the caller's (rowSlotLabel). -->\n<ng-template #rowCell let-column let-row=\"row\">\n @let template = rowCellTemplate(column);\n @if (template) {\n <ng-container [ngTemplateOutletContext]=\"{ $implicit: row, data: row }\" [ngTemplateOutlet]=\"template\"></ng-container>\n } @else {\n {{ rowCellText(column, row) }}\n }\n</ng-template>\n\n<!-- A cell in full, as the wide table shows it: the detail sheet is where the long form belongs. -->\n<ng-template #fullCell let-column let-row=\"row\">\n @if (isTemplateRef(column.cell)) {\n <ng-container [ngTemplateOutletContext]=\"{ $implicit: row, data: row }\" [ngTemplateOutlet]=\"$any(column.cell)\"></ng-container>\n } @else {\n {{ getCellValue(column, row) }}\n }\n</ng-template>\n\n<!-- Empty and error content, shared by the grid and the composed rows. -->\n<ng-template #emptyContent>\n @if (dataSource.emptyTemplate) {\n <ng-container [ngTemplateOutlet]=\"dataSource.emptyTemplate\"></ng-container>\n } @else {\n <!-- The same look as a section's empty state, so a page with both reads as one:\n a faint icon over a medium line in the consumer's muted text colour. -->\n <div class=\"flex flex-col items-center gap-3 py-16 text-(--color-base-content-muted,color-mix(in_oklab,var(--color-base-content)_65%,transparent))\">\n @if (dataSource.emptyIcon !== null) {\n <svg [lucideIcon]=\"dataSource.emptyIcon ?? defaultEmptyIcon\" [size]=\"26\" class=\"opacity-30\"></svg>\n }\n <p class=\"text-base font-medium\">{{ dataSource.emptyMessage }}</p>\n </div>\n }\n</ng-template>\n\n<ng-template #errorContent>\n @if (dataSource.errorTemplate) {\n <ng-container [ngTemplateOutlet]=\"dataSource.errorTemplate\"></ng-container>\n } @else {\n <div class=\"flex flex-col items-center gap-2 text-error\">\n <p class=\"text-sm\">{{ dataSource.errorMessage }}</p>\n </div>\n }\n</ng-template>\n\n<!-- Inline action buttons for an actions column on the wide table. Below 640px the same\n actions render in the detail sheet (or a modal's ⋯ menu). -->\n<ng-template #actionButtons let-column=\"column\" let-row=\"row\">\n <!-- A placeholder (a hidden keepSlot action) is the same button, invisible and inert:\n it holds the column so the actions after it line up with the rows above. -->\n @for (slot of inlineRowActions(column, row); track $index) {\n @let action = slot.action;\n <button\n mnButton\n type=\"button\"\n [data]=\"{\n size: 'sm',\n variant: 'text',\n color: rowActionColor(action, row),\n disabled: isRowActionDisabled(action, row) || slot.placeholder\n }\"\n class=\"cursor-pointer\"\n [class.invisible]=\"slot.placeholder\"\n [attr.inert]=\"slot.placeholder ? '' : null\"\n [attr.aria-hidden]=\"slot.placeholder ? 'true' : null\"\n (click)=\"$event.stopPropagation(); slot.placeholder || runRowAction(action, row)\"\n [attr.aria-label]=\"rowActionLabel(action, row)\"\n [attr.title]=\"showActionLabel(column, action, row) ? null : rowActionLabel(action, row)\"\n >\n @if (showActionIcon(column, action, row)) {\n <span class=\"inline-flex items-center shrink-0\">\n @let icon = rowActionIcon(action, row);\n @if (isTemplateRef(icon)) {\n <ng-container [ngTemplateOutlet]=\"icon\"></ng-container>\n } @else {\n <!-- Data icon: sized here to match the sm button's text, so a caller can\n declare the action in TypeScript without owning a template. -->\n <svg [lucideIcon]=\"$any(icon)\" [size]=\"17\"></svg>\n }\n </span>\n }\n @if (showActionLabel(column, action, row)) {\n <span>{{ rowActionLabel(action, row) }}</span>\n }\n </button>\n }\n</ng-template>\n"
|
|
1890
|
+
template: "<!-- Everything that reflows lives inside a @container, so the breakpoints below\n measure the table's own width rather than the window's. A table in a modal,\n a sidebar or a narrow grid cell is far narrower than the viewport, and\n viewport breakpoints would hand it a desktop layout it has no room for. -->\n<div class=\"@container\">\n <!-- Selection summary: the whole selection, never paged, filtered or sorted. The\n table below answers \"what could I pick?\", which is why it is searched and paged;\n this answers \"what did I pick?\", which a paginated list cannot without hiding\n most of the answer on some other page. -->\n @if (showSelectionSummary) {\n <div class=\"flex flex-col gap-2 rounded-md border border-base-300 bg-base-200/50 p-3 mb-3\">\n <div class=\"flex items-center justify-between gap-2\">\n <span class=\"text-sm font-medium text-base-content\">{{ selectionSummaryTitle }}</span>\n <button\n (click)=\"clearSelection()\"\n [data]=\"{ variant: 'text', color: 'gray', size: 'sm', borderRadius: 'md', hover: true }\"\n class=\"gap-1 shrink-0\"\n mnButton\n type=\"button\"\n >\n <svg [size]=\"14\" [lucideIcon]=\"icons.X\"></svg>\n <span>{{ selectionClearAllLabel }}</span>\n </button>\n </div>\n <!-- Only the first few tags render; the rest collapse behind a \"+N more\" control.\n The heading's count always states the true total, so this hides tags, never\n information. Expanded, the list is height-capped and scrolls, so even a\n selection of hundreds cannot push the table off screen. -->\n <ul\n [class.max-h-28]=\"selectionSummaryExpanded\"\n [class.overflow-y-auto]=\"selectionSummaryExpanded\"\n class=\"flex flex-wrap gap-1.5 list-none m-0 p-0\"\n >\n @for (row of visibleSelectionRows; track dataSource.getID(row)) {\n <li\n class=\"inline-flex items-center gap-1 rounded-full bg-base-100 border border-base-300 pl-2.5 pr-1 py-0.5 text-xs text-base-content max-w-full\">\n <span [attr.title]=\"selectionLabelFor(row)\" class=\"truncate\">{{ selectionLabelFor(row) }}</span>\n <button\n (click)=\"removeSelection(row)\"\n [attr.aria-label]=\"selectionRemoveLabel(row)\"\n class=\"shrink-0 rounded-full p-0.5 hover:bg-base-300 transition-colors cursor-pointer\"\n type=\"button\"\n >\n <svg [size]=\"12\" [lucideIcon]=\"icons.X\"></svg>\n </button>\n </li>\n }\n @if (hiddenSelectionCount > 0 || selectionSummaryExpanded) {\n <li>\n <button\n (click)=\"toggleSelectionSummary()\"\n [attr.aria-expanded]=\"selectionSummaryExpanded\"\n [data]=\"{ variant: 'text', color: 'primary', size: 'sm', borderRadius: 'md', hover: true }\"\n class=\"text-xs\"\n mnButton\n type=\"button\"\n >\n {{ selectionSummaryToggleLabel }}\n </button>\n </li>\n }\n </ul>\n </div>\n }\n\n <!-- Toolbar: custom toolbar template + search. Only rendered when it has content,\n so an unsearchable table without toolbar templates emits no empty spacer. -->\n@if (showsSearch || dataSource.toolbarLeftTemplate || dataSource.toolbarRightTemplate || showsFilterButton) {\n <!-- spYV0YV5 / GRRU8s1V / D2NV3xS9: wrap at ~600px so search + Filters never force\n page-level horizontal scroll. min-w-0 lets flex children shrink inside the page. -->\n <div class=\"mb-3 flex min-w-0 flex-col flex-wrap justify-between gap-2 @min-[420px]:flex-row @min-[420px]:items-center\">\n <!-- The left slot only when it has content: an empty one still took a flex gap, which\n pushed the search 8px in from the page edge. ml-auto keeps the search on the right. -->\n @if (dataSource.toolbarLeftTemplate) {\n <div class=\"flex min-w-0 w-full items-center gap-2 @min-[420px]:w-auto\">\n <div class=\"flex min-w-0 w-full flex-col @min-[420px]:w-auto @min-[420px]:flex-row\">\n <ng-container [ngTemplateOutlet]=\"dataSource.toolbarLeftTemplate\"></ng-container>\n </div>\n </div>\n }\n <div\n class=\"flex min-w-0 w-full flex-col flex-wrap gap-2 @min-[420px]:ml-auto @min-[420px]:flex-1 @min-[420px]:flex-row @min-[420px]:items-center @min-[720px]:w-auto @min-[720px]:flex-none\">\n <!-- Search and the filter button share one row: two full-width bars stacked above the\n first row pushed the content a whole screen down on a phone. -->\n @if (showsSearch || showsFilterButton) {\n <div class=\"flex min-w-0 w-full items-center gap-2 @min-[420px]:flex-1 @min-[720px]:flex-none\">\n @if (showsSearch) {\n <!-- Enter must not submit a surrounding form: the search box belongs to the\n table's chrome, not to whatever form the table happens to sit in. -->\n <mn-lib-input-field\n (keydown.enter)=\"$event.preventDefault()\"\n class=\"min-w-0 flex-1 @min-[720px]:flex-none @min-[720px]:min-w-64\"\n [props]=\"{\n id: 'mn-table-search',\n type: 'search',\n label: '',\n ariaLabel: searchPlaceholderLabel,\n placeholder: searchPlaceholderLabel,\n size: 'sm',\n borderRadius: 'md',\n fullWidth: true\n }\"\n [ngModel]=\"searchValue\"\n (ngModelChange)=\"onSearch($event)\"\n ></mn-lib-input-field>\n }\n <!-- Below 640px the header row with its sort buttons and the inline filter row are\n gone; this one button opens both, with a count while filters are set. -->\n @if (showsFilterButton) {\n <button\n type=\"button\"\n mnButton\n [data]=\"{ variant: 'outline', color: 'primary', size: 'md', borderRadius: 'md', hover: true }\"\n class=\"shrink-0 gap-1.5 px-2.5\"\n [class.ml-auto]=\"!showsSearch\"\n [attr.aria-label]=\"filtersButtonAriaLabel\"\n [attr.title]=\"filterSheetLabel\"\n [attr.aria-expanded]=\"filtersPanelOpen\"\n aria-controls=\"mn-table-filters-panel\"\n (click)=\"openFiltersPanel()\"\n >\n <svg [lucideIcon]=\"icons.Funnel\" [size]=\"17\"></svg>\n <!-- The count sits inside the button: a badge hanging off its corner reached past the\n table's right edge and gave a container that clips or scrolls a sideways scroll. -->\n @if (activeFilterCount > 0) {\n <span class=\"text-sm font-semibold leading-none tabular-nums\" aria-hidden=\"true\">{{ activeFilterCount }}</span>\n }\n </button>\n }\n </div>\n }\n @if (dataSource.toolbarRightTemplate) {\n <div class=\"flex min-w-0 w-full flex-col @min-[420px]:w-auto @min-[420px]:flex-row\">\n <ng-container [ngTemplateOutlet]=\"dataSource.toolbarRightTemplate\"></ng-container>\n </div>\n }\n </div>\n</div>\n}\n\n<!-- Small-screen filters: full-width fields decoupled from column widths, presented\n as a bottom sheet so they overlay rather than push the table down. -->\n@if (showsFilterButton && filtersPanelOpen) {\n <mn-bottom-sheet\n #filtersSheet\n (dismiss)=\"filtersPanelOpen = false\"\n [ariaLabel]=\"filterSheetLabel\"\n [growWithKeyboard]=\"true\"\n [maxHeightVh]=\"80\"\n >\n <div id=\"mn-table-filters-panel\" class=\"flex flex-col gap-3 px-4 pb-4\">\n <span class=\"text-base font-semibold text-base-content\">{{ filterSheetLabel }}</span>\n <!-- Sorting lives here below 640px: the header row whose buttons sorted is not rendered.\n The choices are inline radios, not a select: a select opens its own bottom sheet on a\n phone, which stacked a second sheet on this one and cut its list off. One row per\n column, the direction as a separate switch once a column is picked. -->\n @if (sortableColumns.length > 0) {\n <fieldset class=\"m-0 flex flex-col gap-2 border-0 p-0\">\n <legend\n class=\"mb-1 p-0 text-xs font-medium text-base-content/70\"\n [class.sr-only]=\"!hasColumnFilters\"\n >{{ sortByLabel }}</legend>\n <div class=\"flex flex-col\">\n <label class=\"flex min-h-11 cursor-pointer items-center gap-3 text-sm text-base-content\">\n <input\n type=\"radio\"\n class=\"size-[1.125rem] shrink-0 cursor-pointer appearance-none rounded-full border-2 border-base-content/40 bg-base-100 transition-[border] checked:border-[0.3125rem] checked:border-primary focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary\"\n [name]=\"sortGroupName\"\n value=\"\"\n [checked]=\"!currentSort\"\n (change)=\"onSortColumn('')\"\n />\n <span>{{ sortDefaultLabel }}</span>\n </label>\n @for (column of sortableColumns; track column.key) {\n <!-- The chosen column carries its own direction button at the row's end: it sits\n inside a row that is already there, so picking a column never grows the sheet,\n and no greyed-out switch shows while the default order is chosen. -->\n <div class=\"flex min-h-11 items-center gap-2\">\n <label class=\"flex min-w-0 flex-1 cursor-pointer items-center gap-3 self-stretch text-sm text-base-content\">\n <input\n type=\"radio\"\n class=\"size-[1.125rem] shrink-0 cursor-pointer appearance-none rounded-full border-2 border-base-content/40 bg-base-100 transition-[border] checked:border-[0.3125rem] checked:border-primary focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary\"\n [name]=\"sortGroupName\"\n [value]=\"column.key\"\n [checked]=\"currentSort?.columnKey === column.key\"\n (change)=\"onSortColumn(column.key)\"\n />\n <span class=\"truncate\">{{ headerText(column) || column.key }}</span>\n </label>\n @if (currentSort?.columnKey === column.key) {\n <button\n type=\"button\"\n mnButton\n [data]=\"{ variant: 'outline', color: 'primary', size: 'sm', borderRadius: 'md', hover: true }\"\n class=\"shrink-0 gap-1.5\"\n [attr.aria-label]=\"sortDirectionButtonLabel\"\n (click)=\"toggleSortDirection()\"\n >\n <svg [lucideIcon]=\"currentSort.direction === 'desc' ? icons.ArrowDown : icons.ArrowUp\" [size]=\"15\"></svg>\n <span>{{ sortDirectionLabel }}</span>\n </button>\n }\n </div>\n }\n </div>\n </fieldset>\n @if (hasColumnFilters) {\n <div class=\"border-t border-base-300\" aria-hidden=\"true\"></div>\n }\n }\n @for (column of dataSource.columns; track column.key) {\n @if (column.filterable) {\n <div class=\"flex flex-col gap-1\">\n <label\n class=\"text-xs font-medium text-base-content/70\"\n [attr.for]=\"'mn-table-filter-panel-' + column.key\"\n >\n @if (isTemplateRef(column.header)) {\n <ng-container [ngTemplateOutlet]=\"$any(column.header)\"></ng-container>\n } @else {\n {{ headerText(column) }}\n }\n </label>\n <!-- The field template is declared outside the sheet, so it would inject from there;\n this injector tells its selects they are in a sheet (no second sheet on top). -->\n <ng-container\n [ngTemplateOutletContext]=\"{ $implicit: column, idScope: 'panel' }\"\n [ngTemplateOutletInjector]=\"inSheetInjector\"\n [ngTemplateOutlet]=\"filterField\"\n ></ng-container>\n </div>\n }\n }\n @if (hasActiveFilters) {\n <button\n type=\"button\"\n mnButton\n [data]=\"{ variant: 'text', color: 'gray', size: 'sm', borderRadius: 'md', hover: true }\"\n class=\"self-start gap-1\"\n (click)=\"clearAllFilters()\"\n >\n <svg [lucideIcon]=\"icons.X\" [size]=\"14\"></svg>\n <span>{{ clearFiltersButtonLabel }}</span>\n </button>\n }\n <div class=\"mt-1 flex min-[400px]:justify-end\">\n <button\n type=\"button\"\n mnButton\n [data]=\"{ variant: 'fill', color: 'primary', size: 'md', borderRadius: 'md', hover: true }\"\n class=\"w-full min-[400px]:w-auto\"\n (click)=\"closeFiltersPanel()\"\n >\n <span>{{ filtersCloseLabel }}</span>\n </button>\n </div>\n </div>\n </mn-bottom-sheet>\n}\n\n<!-- Detail sheet (below 640px): the whole record of one row — title and right-side value as the\n heading, every other column as a label/value list, then the actions. It is the only place a\n column the composed row could not show, or an action, is reachable on a phone. -->\n@if (detailRow !== null) {\n @let row = detailRow;\n <mn-bottom-sheet\n #detailSheet\n (dismiss)=\"onDetailDismissed()\"\n [ariaLabel]=\"rowLabel(row)\"\n [maxHeightVh]=\"85\"\n >\n <!-- Escape closes it: the sheet itself only handles the backdrop and the drag. Focus is\n moved inside on open, so the key arrives here by bubbling. -->\n <!-- eslint-disable-next-line @angular-eslint/template/interactive-supports-focus -->\n <div class=\"flex flex-col gap-4 px-4 pb-4\" (keydown.escape)=\"closeDetail()\">\n <div class=\"flex items-start gap-3\">\n <h2\n #detailHeading\n class=\"m-0 min-w-0 flex-1 text-lg font-semibold leading-snug text-base-content outline-none [overflow-wrap:anywhere]\"\n tabindex=\"-1\"\n >\n @if (rowLayout.title; as title) {\n <ng-container [ngTemplateOutlet]=\"fullCell\" [ngTemplateOutletContext]=\"{ $implicit: title, row: row }\"></ng-container>\n }\n </h2>\n @if (rowLayout.trailing && !rowValueEmpty(rowLayout.trailing, row)) {\n @let trailing = rowLayout.trailing;\n <span class=\"flex shrink-0 flex-col items-end gap-0.5 text-right\">\n @if (rowSlotLabel(trailing); as trailingLabel) {\n <span class=\"text-xs text-(--color-base-content-muted,color-mix(in_oklab,var(--color-base-content)_65%,transparent))\">{{ trailingLabel }}</span>\n }\n <span class=\"text-lg font-semibold tabular-nums text-base-content\">\n <ng-container [ngTemplateOutlet]=\"fullCell\" [ngTemplateOutletContext]=\"{ $implicit: trailing, row: row }\"></ng-container>\n </span>\n </span>\n }\n </div>\n @if (detailColumns.length > 0) {\n <dl class=\"m-0 grid grid-cols-[minmax(0,8rem)_minmax(0,1fr)] gap-x-3 gap-y-2.5 border-t border-base-300 pt-4 text-sm\">\n @for (column of detailColumns; track column.key) {\n <!-- An empty value or a lone dash says nothing here either (\"Beschrijving: -\"). -->\n @if (!rowValueEmpty(column, row)) {\n <dt class=\"text-(--color-base-content-muted,color-mix(in_oklab,var(--color-base-content)_65%,transparent))\">\n @if (isTemplateRef(column.header)) {\n <ng-container [ngTemplateOutlet]=\"$any(column.header)\"></ng-container>\n } @else {\n {{ headerText(column) }}\n }\n </dt>\n <dd class=\"m-0 min-w-0 text-base-content [overflow-wrap:anywhere]\">\n <ng-container [ngTemplateOutlet]=\"fullCell\" [ngTemplateOutletContext]=\"{ $implicit: column, row: row }\"></ng-container>\n </dd>\n }\n }\n </dl>\n }\n @if (rowHasAnyActions(row)) {\n <div class=\"flex flex-col gap-2 border-t border-base-300 pt-4\">\n @for (column of rowLayout.actions; track column.key) {\n @for (action of visibleRowActions(column, row); track $index) {\n <button\n mnButton\n type=\"button\"\n [data]=\"{\n variant: 'outline',\n color: rowActionColor(action, row),\n size: 'md',\n borderRadius: 'md',\n hover: true,\n disabled: isRowActionDisabled(action, row)\n }\"\n class=\"w-full gap-2\"\n [attr.aria-disabled]=\"isRowActionDisabled(action, row) || null\"\n (click)=\"runDetailAction(action, row)\"\n >\n @let icon = rowActionIcon(action, row);\n @if (icon) {\n <span class=\"inline-flex shrink-0 items-center\">\n @if (isTemplateRef(icon)) {\n <ng-container [ngTemplateOutlet]=\"icon\"></ng-container>\n } @else {\n <svg [lucideIcon]=\"$any(icon)\" [size]=\"17\"></svg>\n }\n </span>\n }\n <span>{{ rowActionLabel(action, row) }}</span>\n </button>\n }\n }\n </div>\n }\n </div>\n </mn-bottom-sheet>\n}\n\n<!-- Announces loading. The skeletons are aria-hidden, so without this a screen reader hears\n nothing while rows load. The region stays in the DOM and only its text changes, which is\n what makes assistive tech read it; one inserted with its text already set is often missed. -->\n<span class=\"sr-only\" role=\"status\">{{ isLoadingState ? loadingLabel : '' }}</span>\n\n<!-- Table wrapper with horizontal scroll -->\n <div #collectionBody [attr.aria-busy]=\"isLoadingState || null\" [attr.aria-label]=\"tableRegionLabel\" [style.min-height.px]=\"bodyMinHeight\"\n class=\"overflow-x-auto\"\n role=\"region\">\n @if (rowMode) {\n <!-- Below 640px every row is a composed line (see resolveRowLayout): the columns that\n would not fit as cells become a title, a second line and a value on the right, and\n the rest waits in the detail sheet a tap opens. A list, not a table: there are no\n columns left for a screen reader to navigate. -->\n <ul class=\"m-0 list-none p-0\">\n <!-- A \"Load more\" refetch keeps the rows it is adding to (see loadMorePhoneRows). -->\n @if (isLoadingState && !phoneLoadingMore) {\n @for (_ of skeletonRows; track $index) {\n <li aria-hidden=\"true\" class=\"flex items-center gap-3 border-b border-base-300 bg-base-100 px-2 py-3\">\n <div class=\"flex flex-1 flex-col gap-2\">\n <mn-skeleton [data]=\"{ shape: 'text', width: '60%' }\"></mn-skeleton>\n <mn-skeleton [data]=\"{ shape: 'text', width: '40%', height: '0.75rem' }\"></mn-skeleton>\n </div>\n </li>\n }\n } @else if (isErrorState) {\n <li class=\"bg-base-100 py-8 text-center text-xs\">\n <ng-container [ngTemplateOutlet]=\"errorContent\"></ng-container>\n </li>\n } @else {\n @if (filteredItems.length === 0) {\n <li class=\"bg-base-100 text-center text-xs\">\n <ng-container [ngTemplateOutlet]=\"emptyContent\"></ng-container>\n </li>\n }\n @for (row of paginatedItems; track trackByID($index, row)) {\n @let tap = rowTap(row);\n <li\n class=\"flex items-stretch border-b border-base-300 bg-base-100\"\n [ngClass]=\"{ 'bg-primary/10': isSelected(row) }\"\n >\n @if (hasSelection) {\n <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events,@angular-eslint/template/interactive-supports-focus -->\n <div class=\"flex shrink-0 items-center pl-2\" (click)=\"$event.stopPropagation()\">\n <mn-lib-checkbox\n (checkedChange)=\"toggle(row)\"\n [checked]=\"isSelected(row)\"\n [props]=\"{ id: 'mn-table-row-' + $index, size: 'sm' }\"\n ></mn-lib-checkbox>\n </div>\n }\n @if (tap === 'detail' || tap === 'click') {\n <button\n type=\"button\"\n class=\"flex min-w-0 flex-1 cursor-pointer items-start gap-3 px-2 py-3 text-left transition-colors duration-150 hover:bg-base-200 focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-primary\"\n [attr.aria-haspopup]=\"tap === 'detail' ? 'dialog' : null\"\n (click)=\"onRowTap(row, $event)\"\n >\n <ng-container [ngTemplateOutlet]=\"rowBody\" [ngTemplateOutletContext]=\"{ $implicit: row, chevron: true }\"></ng-container>\n </button>\n } @else {\n <!-- A selection row toggles on a click anywhere, as the wide table's row does; the\n checkbox is its keyboard control, so this area needs no focus of its own. -->\n <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events,@angular-eslint/template/interactive-supports-focus -->\n <div\n class=\"flex min-w-0 flex-1 items-start gap-3 px-2 py-3\"\n [class.cursor-pointer]=\"tap === 'select'\"\n (click)=\"tap === 'select' && onRowClick(row)\"\n >\n <ng-container [ngTemplateOutlet]=\"rowBody\" [ngTemplateOutletContext]=\"{ $implicit: row, chevron: false }\"></ng-container>\n </div>\n }\n @if (showsRowMore(row)) {\n <button\n type=\"button\"\n class=\"flex w-11 shrink-0 cursor-pointer items-center justify-center text-base-content/70 transition-colors hover:bg-base-200 focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-primary\"\n aria-haspopup=\"dialog\"\n [attr.aria-label]=\"rowDetailsLabel(row)\"\n (click)=\"openDetail(row, $any($event.currentTarget))\"\n >\n <svg [lucideIcon]=\"icons.Ellipsis\" [size]=\"18\"></svg>\n </button>\n }\n @if (showsRowMenu(row)) {\n @for (column of rowLayout.actions; track column.key) {\n @if (hasRowActions(column, row)) {\n <div class=\"flex shrink-0 items-center pr-1\">\n <mn-lib-dropdown [datasource]=\"{\n id: actionsDropdownId(column, row),\n actions: rowDropdownActions(column, row),\n menuLabel: headerText(column),\n size: 'sm'\n }\"></mn-lib-dropdown>\n </div>\n }\n }\n }\n </li>\n }\n }\n </ul>\n } @else {\n <table [class]=\"tableClasses\">\n <thead>\n <tr class=\"bg-base-100\">\n <!-- Selection column header. It always carries a screen-reader-only name: a single-select\n table has nothing else in this cell, and a multi-select one only a checkbox, so\n without it the column is announced as a nameless header (axe empty-table-header). -->\n @if (hasSelection) {\n <th class=\"w-10 text-center text-sm px-2 py-2\">\n <span class=\"sr-only\">{{ selectionColumnLabel }}</span>\n @if (isMultiSelect) {\n <mn-lib-checkbox\n (checkedChange)=\"toggleAll()\"\n [checked]=\"allSelected\"\n [props]=\"{ id: 'mn-table-select-all', size: 'sm' }\"\n ></mn-lib-checkbox>\n }\n </th>\n }\n\n <!-- Data columns -->\n @for (column of dataSource.columns; track column.key) {\n <th\n [attr.data-column-key]=\"column.key\"\n [class.truncate]=\"widthsArePinned\"\n [class.cursor-pointer]=\"isSortable(column)\"\n [class.select-none]=\"isSortable(column)\"\n [class.hover:bg-base-200]=\"isSortable(column)\"\n [class.text-left]=\"(column.align ?? 'left') === 'left'\"\n [class.text-center]=\"column.align === 'center'\"\n [class.text-right]=\"column.align === 'right'\"\n [mnHiddenBelow]=\"column.hiddenBelow\"\n [style.width]=\"columnWidth(column)\"\n [attr.aria-sort]=\"currentSort?.columnKey === column.key ? (currentSort!.direction === 'asc' ? 'ascending' : 'descending') : null\"\n class=\"text-sm px-2 py-1 @min-[640px]:px-4 @min-[640px]:py-2 whitespace-nowrap\"\n (click)=\"sort(column)\"\n >\n <!-- The header content is declared once; a sortable column wraps it in a real button so\n the sort is reachable by keyboard. The button's click stops there, so the th's own\n click (which keeps the cell padding clickable) does not sort a second time. -->\n <ng-template #headerContent>\n @if (isTemplateRef(column.header)) {\n <ng-container [ngTemplateOutlet]=\"$any(column.header)\"></ng-container>\n } @else {\n <span>{{ headerText(column) }}</span>\n }\n @if (isSortable(column)) {\n <span class=\"text-[0.65rem] opacity-70 min-w-3 inline-block\" aria-hidden=\"true\">{{ getSortIcon(column) }}</span>\n }\n </ng-template>\n @if (isSortable(column)) {\n <button type=\"button\" class=\"inline-flex items-center gap-1 cursor-pointer\" (click)=\"$event.stopPropagation(); sort(column)\">\n <ng-container [ngTemplateOutlet]=\"headerContent\"></ng-container>\n </button>\n } @else {\n <span class=\"inline-flex items-center gap-1\">\n <ng-container [ngTemplateOutlet]=\"headerContent\"></ng-container>\n </span>\n }\n </th>\n }\n\n </tr>\n\n <!-- Per-column filter row (wide screens only; collapses into a panel below 640px).\n The cells are `td`, not `th`: they hold form controls, not headings, and a\n column without a filter would otherwise be an empty header, which assistive tech\n announces as a nameless column (axe `empty-table-header`). `font-normal` stays\n so a consumer's thead styling cannot make the controls bold. -->\n @if (hasColumnFilters && !filtersCollapsed) {\n <tr class=\"bg-base-100 border-b border-base-300 font-normal\">\n @if (hasSelection) {\n <td class=\"px-2 py-1 font-normal\"></td>\n }\n @for (column of dataSource.columns; track column.key) {\n <td\n class=\"px-4 py-2 font-normal\"\n [mnHiddenBelow]=\"column.hiddenBelow\"\n >\n @if (column.filterable) {\n <!-- Every filter renders as an ordinary control right under its\n header. The rich types used to hide behind a button that opened\n a floating panel, which cost a click to discover, a click to\n apply, and hid whether a column was even filterable. -->\n <ng-container\n [ngTemplateOutletContext]=\"{ $implicit: column, idScope: 'inline' }\"\n [ngTemplateOutlet]=\"filterField\"\n ></ng-container>\n }\n </td>\n }\n </tr>\n }\n </thead>\n\n <tbody>\n <!-- Loading state -->\n @if (isLoadingState) {\n @for (_ of skeletonRows; track $index) {\n <tr>\n @if (hasSelection) {\n <td class=\"px-2 py-3\">\n <mn-skeleton [data]=\"{ shape: 'rectangle', width: '1rem', height: '1rem' }\"></mn-skeleton>\n </td>\n }\n @for (column of dataSource.columns; track column.key) {\n <td class=\"px-4 py-3\"\n [mnHiddenBelow]=\"column.hiddenBelow\"\n [style.width]=\"columnWidth(column)\"\n >\n @if (isTemplateRef(column.skeleton)) {\n <ng-container [ngTemplateOutlet]=\"$any(column.skeleton)\"></ng-container>\n } @else {\n <mn-skeleton [data]=\"getColumnSkeletonData(column)\"></mn-skeleton>\n }\n </td>\n }\n </tr>\n }\n } @else if (isErrorState) {\n <!-- Error state -->\n <tr class=\"bg-base-100\">\n <td [attr.colspan]=\"totalColumnCount\" class=\"text-center text-xs py-8\">\n <ng-container [ngTemplateOutlet]=\"errorContent\"></ng-container>\n </td>\n </tr>\n } @else {\n <!-- Empty state -->\n @if (filteredItems.length === 0) {\n <tr class=\"bg-base-100\">\n <td [attr.colspan]=\"totalColumnCount\" class=\"text-center text-xs py-8\">\n <ng-container [ngTemplateOutlet]=\"emptyContent\"></ng-container>\n </td>\n </tr>\n }\n\n <!-- Data rows -->\n @for (row of paginatedItems; track trackByID($index, row); let odd = $odd; let last = $last) {\n <!-- The wash and the pointer promise that a click does something, so only a clickable row gets them. -->\n <tr\n class=\"bg-base-100 transition-colors duration-150 border-b border-base-300\"\n [ngClass]=\"{'bg-primary/10': isSelected(row)}\"\n [class.bg-base-200]=\"!isSelected(row) && odd && dataSource.appearance?.striped\"\n [class.hover:bg-base-200]=\"rowsClickable && dataSource.appearance?.hover !== false\"\n [class.cursor-pointer]=\"rowsClickable\"\n (click)=\"onRowClick(row)\"\n >\n <!-- Selection checkbox -->\n @if (hasSelection) {\n <td (click)=\"$event.stopPropagation()\" class=\"w-10 text-center px-2 py-2\">\n <mn-lib-checkbox\n (checkedChange)=\"toggle(row)\"\n [checked]=\"isSelected(row)\"\n [props]=\"{ id: 'mn-table-row-' + $index, size: 'sm' }\"\n ></mn-lib-checkbox>\n </td>\n }\n\n <!-- Data cells -->\n @for (column of dataSource.columns; track column.key) {\n <td\n [attr.title]=\"cellTitle(column, row)\"\n [class.text-left]=\"(column.align ?? 'left') === 'left'\"\n [class.text-center]=\"column.align === 'center'\"\n [class.text-right]=\"column.align === 'right'\"\n [class.truncate]=\"widthsArePinned\"\n [mnHiddenBelow]=\"column.hiddenBelow\"\n [style.width]=\"columnWidth(column)\"\n class=\"text-xs px-2 py-1 @min-[640px]:px-4 @min-[640px]:py-2\"\n >\n @if (column.actions) {\n <!-- Actions column: inline command buttons. The grid only renders at 640px\n and wider, where they fit; below that the actions move into the row's\n detail sheet. A row with no visible actions renders nothing. -->\n @if (hasRowActions(column, row)) {\n <div class=\"inline-flex items-center gap-1\"\n [class.justify-end]=\"(column.align ?? 'left') === 'right'\">\n <span class=\"inline-flex items-center gap-1\">\n <ng-container [ngTemplateOutletContext]=\"{ column: column, row: row }\"\n [ngTemplateOutlet]=\"actionButtons\"></ng-container>\n </span>\n </div>\n }\n } @else if (column.cellSm) {\n <!-- Default cell: hidden below the cellSm breakpoint -->\n <span [mnShowAbove]=\"column.cellSm.below\">\n @if (isTemplateRef(column.cell)) {\n <ng-container [ngTemplateOutletContext]=\"{ $implicit: row, data: row }\"\n [ngTemplateOutlet]=\"$any(column.cell)\"></ng-container>\n } @else {\n {{ getCellValue(column, row) }}\n }\n </span>\n <!-- Small cell: shown only below the cellSm breakpoint -->\n <span [mnShowBelow]=\"column.cellSm.below\">\n @if (isTemplateRef(column.cellSm.cell)) {\n <ng-container [ngTemplateOutletContext]=\"{ $implicit: row, data: row }\"\n [ngTemplateOutlet]=\"$any(column.cellSm.cell)\"></ng-container>\n } @else {\n {{ getCellSmValue(column, row) }}\n }\n </span>\n } @else {\n @if (isTemplateRef(column.cell)) {\n <ng-container [ngTemplateOutletContext]=\"{ $implicit: row, data: row }\"\n [ngTemplateOutlet]=\"$any(column.cell)\"></ng-container>\n } @else {\n {{ getCellValue(column, row) }}\n }\n }\n </td>\n }\n\n </tr>\n }\n }\n </tbody>\n </table>\n }\n</div>\n\n<!-- Below 640px a paginated table grows instead of paging (see showsPhoneLoadMore). -->\n@if (showsPhoneLoadMore) {\n <div class=\"flex flex-col items-center gap-2 px-2 pb-1 pt-3\">\n <span class=\"text-xs text-(--color-base-content-muted,color-mix(in_oklab,var(--color-base-content)_65%,transparent))\" aria-live=\"polite\">{{ phoneLoadedLabel }}</span>\n <button\n mnButton\n type=\"button\"\n [data]=\"{ variant: 'outline', color: 'primary', size: 'md', borderRadius: 'md', hover: true, disabled: phoneLoadingMore }\"\n class=\"w-full gap-2\"\n [attr.aria-disabled]=\"phoneLoadingMore || null\"\n (click)=\"loadMorePhoneRows()\"\n >\n @if (phoneLoadingMore) {\n <span aria-hidden=\"true\" class=\"inline-block size-3.5 animate-spin rounded-full border-2 border-current border-t-transparent\"></span>\n }\n {{ phoneLoadMoreLabel }}\n </button>\n </div>\n}\n\n<!-- Load more + pagination (not for a single page below 640px, see showsPagination) -->\n@if (showsPagination) {\n<mn-collection-pagination\n (loadMore)=\"loadMoreRows()\"\n (pageChange)=\"goToPage($event)\"\n (pageSizeChange)=\"onPageSizeChange($event)\"\n [currentPage]=\"currentPage\"\n [isPaginated]=\"isPaginated\"\n [isServerPaginated]=\"isServerPaginated\"\n [labels]=\"dataSource.labels\"\n [loadingMoreRows]=\"loadingMoreRows\"\n [pageSizeSelectOptions]=\"pageSizeSelectOptions\"\n [pageSize]=\"pageSize\"\n [showLoadMore]=\"showLoadMore\"\n [totalItemCount]=\"totalItemCount\"\n [totalPages]=\"totalPages\"\n [visiblePages]=\"visiblePages\"\n idPrefix=\"mn-table\"\n></mn-collection-pagination>\n}\n</div>\n\n<!-- Single source of truth for every filter control, reused by the inline header\n row and the small-screen panel. `idScope` keeps element ids unique across\n both placements. -->\n<ng-template #filterField let-column let-idScope=\"idScope\">\n @switch (filterTypeOf(column)) {\n @case ('select') {\n <mn-lib-select\n (ngModelChange)=\"onColumnFilter(column, $event)\"\n [disabled]=\"column.filterDisabled ?? false\"\n [ngModel]=\"textFilterValue(column)\"\n [props]=\"{\n id: 'mn-table-filter-' + idScope + '-' + column.key,\n ariaLabel: filterLabel(column),\n options: getFilterSelectOptions(column),\n placeholder: filterAllLabel(column),\n size: 'sm',\n fullWidth: true\n }\"\n ></mn-lib-select>\n }\n @case ('multi-select') {\n <mn-lib-multi-select\n (ngModelChange)=\"onColumnFilter(column, $event)\"\n [disabled]=\"column.filterDisabled ?? false\"\n [ngModel]=\"multiFilterValue(column)\"\n [props]=\"{\n id: 'mn-table-filter-' + idScope + '-' + column.key,\n ariaLabel: filterLabel(column),\n options: getFilterMultiSelectOptions(column),\n placeholder: column.filterPlaceholder ?? '',\n collapsePlaceholder: filterSelectedLabel,\n collapseThreshold: 1,\n size: 'sm',\n fullWidth: true\n }\"\n ></mn-lib-multi-select>\n }\n @case ('boolean') {\n <mn-lib-select\n (ngModelChange)=\"onBooleanFilter(column, $event)\"\n [disabled]=\"column.filterDisabled ?? false\"\n [ngModel]=\"booleanFilterValue(column)\"\n [props]=\"{\n id: 'mn-table-filter-' + idScope + '-' + column.key,\n ariaLabel: filterLabel(column),\n options: getBooleanFilterOptions(column),\n size: 'sm',\n fullWidth: true\n }\"\n ></mn-lib-select>\n }\n @default {\n <mn-lib-input-field\n (keydown.enter)=\"$event.preventDefault()\"\n (ngModelChange)=\"onColumnFilter(column, $event)\"\n [disabled]=\"column.filterDisabled ?? false\"\n [ngModel]=\"textFilterValue(column)\"\n [props]=\"{\n id: 'mn-table-filter-' + idScope + '-' + column.key,\n type: 'text',\n label: '',\n placeholder: column.filterPlaceholder ?? '',\n ariaLabel: column.filterPlaceholder ?? '',\n autocomplete: column.filterAutocomplete ?? undefined,\n size: 'sm',\n borderRadius: 'md',\n fullWidth: true,\n hover: true\n }\"\n ></mn-lib-input-field>\n }\n }\n</ng-template>\n\n<!-- One composed row (below 640px): the leading block, the title (two lines at most) over the\n second line, the right-side value, and a chevron when a tap opens something. The slots\n come from rowLayout; a column renders its cellSm form here when it has one. -->\n<ng-template #rowBody let-row let-chevron=\"chevron\">\n @let layout = rowLayout;\n @if (layout.leading; as leading) {\n <span class=\"flex h-8 min-w-8 shrink-0 items-center justify-center rounded-md bg-primary/10 px-1.5 text-sm font-semibold tabular-nums text-primary\">\n <ng-container [ngTemplateOutlet]=\"rowCell\" [ngTemplateOutletContext]=\"{ $implicit: leading, row: row }\"></ng-container>\n </span>\n }\n <span class=\"flex min-w-0 flex-1 flex-col gap-1\">\n @if (layout.title; as title) {\n <span class=\"line-clamp-2 text-sm font-semibold leading-snug text-base-content [overflow-wrap:anywhere]\">\n <ng-container [ngTemplateOutlet]=\"rowCell\" [ngTemplateOutletContext]=\"{ $implicit: title, row: row }\"></ng-container>\n </span>\n }\n @let meta = rowMeta(row);\n @if (meta.length > 0) {\n <span class=\"flex flex-wrap items-center gap-x-3 gap-y-1 text-xs text-(--color-base-content-muted,color-mix(in_oklab,var(--color-base-content)_65%,transparent))\">\n @for (column of meta; track column.key) {\n <!-- Bare values, no column names: on a 375px line a name like \"Goedgekeurd door\" took\n half the room and cut off the value it described. Only the right side is labelled. -->\n <span class=\"min-w-0 max-w-full truncate\">\n <ng-container [ngTemplateOutlet]=\"rowCell\" [ngTemplateOutletContext]=\"{ $implicit: column, row: row }\"></ng-container>\n </span>\n }\n </span>\n }\n </span>\n @if (layout.trailing; as trailing) {\n @if (!rowValueEmpty(trailing, row)) {\n <!-- The right-side value with its column name above it, small: \"1-12-2023\" or \"535\" alone\n does not say whether it is a join date or a score. One line: a date that wrapped\n (\"7 oktober 2026 om / 21:00\") doubled the row's height. Past 45% of the row the value\n is cut short with an ellipsis rather than squeezing the title into two lines. -->\n <span class=\"flex min-w-0 max-w-[45%] shrink-0 flex-col items-end gap-0.5 text-right\">\n @let trailingLabel = rowSlotLabel(trailing);\n @if (trailingLabel) {\n <span class=\"max-w-full truncate text-[0.6875rem] leading-tight text-(--color-base-content-muted,color-mix(in_oklab,var(--color-base-content)_65%,transparent))\">{{ trailingLabel }}</span>\n }\n <span class=\"max-w-full truncate whitespace-nowrap text-sm font-semibold tabular-nums text-base-content\">\n <ng-container [ngTemplateOutlet]=\"rowCell\" [ngTemplateOutletContext]=\"{ $implicit: trailing, row: row }\"></ng-container>\n </span>\n </span>\n }\n }\n @if (chevron) {\n <svg [lucideIcon]=\"icons.ChevronRight\" [size]=\"16\" aria-hidden=\"true\" class=\"mt-0.5 shrink-0 opacity-50\"></svg>\n }\n</ng-template>\n\n<!-- A cell as a composed row shows it: cellSm first. Its column name is the caller's (rowSlotLabel). -->\n<ng-template #rowCell let-column let-row=\"row\">\n @let template = rowCellTemplate(column);\n @if (template) {\n <ng-container [ngTemplateOutletContext]=\"{ $implicit: row, data: row }\" [ngTemplateOutlet]=\"template\"></ng-container>\n } @else {\n {{ rowCellText(column, row) }}\n }\n</ng-template>\n\n<!-- A cell in full, as the wide table shows it: the detail sheet is where the long form belongs. -->\n<ng-template #fullCell let-column let-row=\"row\">\n @if (isTemplateRef(column.cell)) {\n <ng-container [ngTemplateOutletContext]=\"{ $implicit: row, data: row }\" [ngTemplateOutlet]=\"$any(column.cell)\"></ng-container>\n } @else {\n {{ getCellValue(column, row) }}\n }\n</ng-template>\n\n<!-- Empty and error content, shared by the grid and the composed rows. -->\n<ng-template #emptyContent>\n @if (dataSource.emptyTemplate) {\n <ng-container [ngTemplateOutlet]=\"dataSource.emptyTemplate\"></ng-container>\n } @else {\n <!-- The same look as a section's empty state, so a page with both reads as one:\n a faint icon over a medium line in the consumer's muted text colour. -->\n <div class=\"flex flex-col items-center gap-3 py-16 text-(--color-base-content-muted,color-mix(in_oklab,var(--color-base-content)_65%,transparent))\">\n @if (dataSource.emptyIcon !== null) {\n <svg [lucideIcon]=\"dataSource.emptyIcon ?? defaultEmptyIcon\" [size]=\"26\" class=\"opacity-30\"></svg>\n }\n <p class=\"text-base font-medium\">{{ dataSource.emptyMessage }}</p>\n </div>\n }\n</ng-template>\n\n<ng-template #errorContent>\n @if (dataSource.errorTemplate) {\n <ng-container [ngTemplateOutlet]=\"dataSource.errorTemplate\"></ng-container>\n } @else {\n <div class=\"flex flex-col items-center gap-2 text-error\">\n <p class=\"text-sm\">{{ dataSource.errorMessage }}</p>\n </div>\n }\n</ng-template>\n\n<!-- Inline action buttons for an actions column on the wide table. Below 640px the same\n actions render in the detail sheet (or a modal's ⋯ menu). -->\n<ng-template #actionButtons let-column=\"column\" let-row=\"row\">\n <!-- A placeholder (a hidden keepSlot action) is the same button, invisible and inert:\n it holds the column so the actions after it line up with the rows above. -->\n @for (slot of inlineRowActions(column, row); track $index) {\n @let action = slot.action;\n <button\n mnButton\n type=\"button\"\n [data]=\"{\n size: 'sm',\n variant: 'text',\n color: rowActionColor(action, row),\n disabled: isRowActionDisabled(action, row) || slot.placeholder\n }\"\n class=\"cursor-pointer\"\n [class.invisible]=\"slot.placeholder\"\n [attr.inert]=\"slot.placeholder ? '' : null\"\n [attr.aria-hidden]=\"slot.placeholder ? 'true' : null\"\n (click)=\"$event.stopPropagation(); slot.placeholder || runRowAction(action, row)\"\n [attr.aria-label]=\"rowActionLabel(action, row)\"\n [attr.title]=\"showActionLabel(column, action, row) ? null : rowActionLabel(action, row)\"\n >\n @if (showActionIcon(column, action, row)) {\n <span class=\"inline-flex items-center shrink-0\">\n @let icon = rowActionIcon(action, row);\n @if (isTemplateRef(icon)) {\n <ng-container [ngTemplateOutlet]=\"icon\"></ng-container>\n } @else {\n <!-- Data icon: sized here to match the sm button's text, so a caller can\n declare the action in TypeScript without owning a template. -->\n <svg [lucideIcon]=\"$any(icon)\" [size]=\"17\"></svg>\n }\n </span>\n }\n @if (showActionLabel(column, action, row)) {\n <span>{{ rowActionLabel(action, row) }}</span>\n }\n </button>\n }\n</ng-template>\n"
|
|
1891
1891
|
}]
|
|
1892
1892
|
}],
|
|
1893
1893
|
ctorParameters: () => [],
|