@aaamb/ngx-design-system 1.6.0 → 1.7.1
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.
|
@@ -2811,8 +2811,19 @@ class SideNavComponent {
|
|
|
2811
2811
|
? this.isRouteActive(option.url)
|
|
2812
2812
|
: false;
|
|
2813
2813
|
const isChildActive = option.children?.some((child) => this.isRouteActive(child.url)) ?? false;
|
|
2814
|
+
// Compact highlights only the active child while it is visible, so the
|
|
2815
|
+
// parent does not compete with it.
|
|
2816
|
+
if (this.isCompact() && this.expandedMenus()[option.name]) {
|
|
2817
|
+
return isCurrentUrlActive;
|
|
2818
|
+
}
|
|
2814
2819
|
return isCurrentUrlActive || isChildActive;
|
|
2815
2820
|
}
|
|
2821
|
+
childListClasses() {
|
|
2822
|
+
if (this.isCompact()) {
|
|
2823
|
+
return this.isCollapsed() ? 'items-center gap-1 mt-1' : 'pl-6 gap-1 mt-1';
|
|
2824
|
+
}
|
|
2825
|
+
return this.isCollapsed() ? 'items-center gap-2 mt-2' : 'pl-8 gap-4 mt-2';
|
|
2826
|
+
}
|
|
2816
2827
|
isPathActive(path) {
|
|
2817
2828
|
return this.isRouteActive(path);
|
|
2818
2829
|
}
|
|
@@ -2838,13 +2849,18 @@ class SideNavComponent {
|
|
|
2838
2849
|
return `${base}${badge} hover:bg-[#006761]`;
|
|
2839
2850
|
}
|
|
2840
2851
|
childButtonClasses(path, collapsed) {
|
|
2852
|
+
// Compact children read like the other options: same size, weight and shape.
|
|
2853
|
+
if (this.isCompact() && !collapsed) {
|
|
2854
|
+
const compact = 'w-full px-3 rounded-lg text-sm font-medium whitespace-nowrap';
|
|
2855
|
+
return this.isPathActive(path)
|
|
2856
|
+
? `${compact} bg-green-6 text-green-base`
|
|
2857
|
+
: `${compact} bg-transparent text-neutral-light-text hover:bg-white/10`;
|
|
2858
|
+
}
|
|
2841
2859
|
const base = collapsed
|
|
2842
|
-
? 'justify-center bg-transparent p-0 w-5 h-5'
|
|
2843
|
-
: 'text-base font-normal px-4';
|
|
2860
|
+
? 'justify-center bg-transparent p-0 w-5 h-5 rounded-[44px]'
|
|
2861
|
+
: 'text-base font-normal px-4 rounded-[44px]';
|
|
2844
2862
|
if (this.isPathActive(path)) {
|
|
2845
|
-
return collapsed
|
|
2846
|
-
? 'justify-center bg-transparent p-0 w-5 h-5'
|
|
2847
|
-
: `${base} bg-white text-green-base`;
|
|
2863
|
+
return collapsed ? base : `${base} bg-white text-green-base`;
|
|
2848
2864
|
}
|
|
2849
2865
|
return collapsed
|
|
2850
2866
|
? base
|
|
@@ -3005,8 +3021,8 @@ class SideNavComponent {
|
|
|
3005
3021
|
|
|
3006
3022
|
@if (option.children?.length && expandedMenus()[option.name]) {
|
|
3007
3023
|
<div
|
|
3008
|
-
class="flex flex-col w-full
|
|
3009
|
-
[ngClass]="
|
|
3024
|
+
class="flex flex-col w-full"
|
|
3025
|
+
[ngClass]="childListClasses()"
|
|
3010
3026
|
animate.enter="fade-in"
|
|
3011
3027
|
>
|
|
3012
3028
|
@for (
|
|
@@ -3017,7 +3033,7 @@ class SideNavComponent {
|
|
|
3017
3033
|
<button
|
|
3018
3034
|
type="button"
|
|
3019
3035
|
nz-tooltip
|
|
3020
|
-
class="cursor-pointer
|
|
3036
|
+
class="cursor-pointer h-9 flex items-center transition-colors duration-300 border-none outline-none"
|
|
3021
3037
|
[ngClass]="childButtonClasses(child.url, isCollapsed())"
|
|
3022
3038
|
[attr.data-testid]="
|
|
3023
3039
|
'side-nav-sub-option-' + idx + '-' + subIdx
|
|
@@ -3266,8 +3282,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.11", ngImpo
|
|
|
3266
3282
|
|
|
3267
3283
|
@if (option.children?.length && expandedMenus()[option.name]) {
|
|
3268
3284
|
<div
|
|
3269
|
-
class="flex flex-col w-full
|
|
3270
|
-
[ngClass]="
|
|
3285
|
+
class="flex flex-col w-full"
|
|
3286
|
+
[ngClass]="childListClasses()"
|
|
3271
3287
|
animate.enter="fade-in"
|
|
3272
3288
|
>
|
|
3273
3289
|
@for (
|
|
@@ -3278,7 +3294,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.11", ngImpo
|
|
|
3278
3294
|
<button
|
|
3279
3295
|
type="button"
|
|
3280
3296
|
nz-tooltip
|
|
3281
|
-
class="cursor-pointer
|
|
3297
|
+
class="cursor-pointer h-9 flex items-center transition-colors duration-300 border-none outline-none"
|
|
3282
3298
|
[ngClass]="childButtonClasses(child.url, isCollapsed())"
|
|
3283
3299
|
[attr.data-testid]="
|
|
3284
3300
|
'side-nav-sub-option-' + idx + '-' + subIdx
|
|
@@ -4030,6 +4046,8 @@ class TableComponent {
|
|
|
4030
4046
|
statusStateStyles = this.defaultStatusStateStyles;
|
|
4031
4047
|
activeStateStyles = this.defaultActiveStateStyles;
|
|
4032
4048
|
selectable = false;
|
|
4049
|
+
/** Keeps the actions column pinned to the right edge, above the other columns, while scrolling horizontally. */
|
|
4050
|
+
stickyActions = false;
|
|
4033
4051
|
headerRenderVersion = 0;
|
|
4034
4052
|
constructor(hostTestId) {
|
|
4035
4053
|
this.hostTestId = hostTestId;
|
|
@@ -4324,7 +4342,7 @@ class TableComponent {
|
|
|
4324
4342
|
this.selectionChange.emit(this.table?.getSelectedRowModel?.()?.rows.map((row) => row.original) ?? []);
|
|
4325
4343
|
}
|
|
4326
4344
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.11", ngImport: i0, type: TableComponent, deps: [{ token: 'data-testid', attribute: true }], target: i0.ɵɵFactoryTarget.Component });
|
|
4327
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.11", type: TableComponent, isStandalone: true, selector: "ads-table", inputs: { table: "table", isLoading: "isLoading", selectedSortingHeader: "selectedSortingHeader", sortDirection: "sortDirection", showButtons: "showButtons", allContentLeft: "allContentLeft", totalRegisters: "totalRegisters", minH: ["min-h", "minH"], areColumnsDraggable: "areColumnsDraggable", currentPage: "currentPage", totalPages: "totalPages", pageSize: "pageSize", enableMultiSort: "enableMultiSort", multiSortCriteria: "multiSortCriteria", actionButtons: "actionButtons", statusStateStyles: "statusStateStyles", activeStateStyles: "activeStateStyles", selectable: "selectable" }, outputs: { sortEvent: "sortEvent", columnOrderChange: "columnOrderChange", pageChange: "pageChange", columnSizingChange: "columnSizingChange", pageSizeChange: "pageSizeChange", multiSortEvent: "multiSortEvent", selectionChange: "selectionChange" }, ngImport: i0, template: "@if (getRows().length > 0 || isLoading) {\n <!-- Main table layout: data grid + footer pagination area -->\n <div\n class=\"flex w-full flex-col justify-between gap-4\"\n [ngClass]=\"{ 'min-h-[60vh]': minH }\"\n >\n <div class=\"relative min-h-40 w-full overflow-x-auto\">\n <table\n [attr.data-testid]=\"contentTestId\"\n class=\"min-w-full table-fixed border-separate border-spacing-0\"\n >\n <!-- Interactive header row: sorting, drag-and-drop, and column resizing -->\n <thead class=\"bg-green-1 text-white-base\">\n <tr\n cdkDropList\n cdkDropListOrientation=\"horizontal\"\n class=\"h-10 min-h-10 max-h-11.25\"\n (cdkDropListDropped)=\"drop($event)\"\n [ngStyle]=\"allContentLeft ? { 'text-align': 'left' } : null\"\n >\n @if (selectable) {\n <!-- Checkbox selection column header: select all rows -->\n <th\n class=\"relative h-10 min-h-10 max-h-11.25 w-10 px-3 text-center align-middle border-r border-white/20 first:rounded-l-2xl\"\n [attr.data-testid]=\"contentTestId + '-header-select-all'\"\n >\n <div class=\"flex h-full w-full items-center justify-center\">\n <ads-checkbox\n controlColor=\"white\"\n [checked]=\"isAllSelected()\"\n [indeterminate]=\"isSomeSelected() && !isAllSelected()\"\n (checkedChange)=\"toggleSelectAll()\"\n ></ads-checkbox>\n </div>\n </th>\n }\n @for (\n column of getHeaderCells();\n track column.id + \"-\" + headerRenderVersion\n ) {\n @if (isColumnSortable(column)) {\n @if (areColumnsDraggable) {\n <!-- Sortable + draggable header cell -->\n <th\n cdkDrag\n cdkDragLockAxis=\"x\"\n [ngStyle]=\"getColumnHeaderStyles(column)\"\n class=\"relative h-10 min-h-10 max-h-11.25 select-none border-r border-white/20 font-medium first:rounded-l-2xl last:rounded-r-2xl last:border-r-0 overflow-hidden cursor-grab active:cursor-grabbing\"\n [attr.data-testid]=\"getHeaderTestId(column)\"\n >\n <button\n type=\"button\"\n cdkDragHandle\n class=\"group flex h-full w-full cursor-pointer items-center gap-3 px-3 transition-colors duration-200 border-none outline-0 bg-transparent hover:bg-white/10\"\n [ngClass]=\"headerAlignmentClass(column)\"\n (click)=\"sort(column, $event)\"\n [title]=\"\n enableMultiSort ? 'Shift+click to add to sort' : null\n \"\n >\n <!-- When right-aligned, the sort indicator is shown before the header text -->\n @if (getSortEntry(column); as entry) {\n @if (isSortIconLeading(column)) {\n @if (multiSortCriteria.length > 1) {\n <span\n class=\"inline-flex h-4 min-w-4 items-center justify-center rounded-full bg-white/25 px-1 text-[0.65rem] font-bold text-white-base leading-px\"\n >\n {{ entry.index + 1 }}\n </span>\n }\n <ads-icon\n class=\"text-current transition-transform duration-200 -rotate-90\"\n [class.rotate-90]=\"entry.direction === 'ASC'\"\n [iconName]=\"'arrow_right'\"\n [size]=\"16\"\n ></ads-icon>\n }\n }\n <span class=\"truncate\">{{\n column.column.columnDef.header\n }}</span>\n <!-- For left/center aligned headers, the sort indicator is shown after the text -->\n @if (getSortEntry(column); as entry) {\n @if (!isSortIconLeading(column)) {\n @if (multiSortCriteria.length > 1) {\n <span\n class=\"inline-flex h-4 min-w-4 items-center justify-center rounded-full bg-white/25 px-1 text-[0.65rem] font-bold text-white-base leading-px\"\n >\n {{ entry.index + 1 }}\n </span>\n }\n <ads-icon\n class=\"text-current transition-transform duration-200 -rotate-90\"\n [class.rotate-90]=\"entry.direction === 'ASC'\"\n [iconName]=\"'arrow_right'\"\n [size]=\"16\"\n ></ads-icon>\n }\n }\n </button>\n <div\n class=\"absolute right-0 top-0 bottom-0 z-3 w-1 cursor-col-resize select-none bg-green-1 transition-colors hover:bg-green-1\"\n (mousedown)=\"startResize($event, column)\"\n (touchstart)=\"startResize($event, column)\"\n ></div>\n </th>\n } @else {\n <!-- Sortable header cell without drag-and-drop -->\n <th\n [ngStyle]=\"getColumnHeaderStyles(column)\"\n class=\"relative h-10 min-h-10 max-h-11.25 select-none border-r border-white/20 font-medium first:rounded-l-2xl last:rounded-r-2xl last:border-r-0\"\n [attr.data-testid]=\"getHeaderTestId(column)\"\n >\n <button\n type=\"button\"\n class=\"flex h-full w-full cursor-pointer items-center gap-3 px-3 transition-colors duration-200 hover:bg-white/10 bg-green-base\"\n [ngClass]=\"headerAlignmentClass(column)\"\n (click)=\"sort(column, $event)\"\n [title]=\"\n enableMultiSort ? 'Shift+click to add to sort' : null\n \"\n >\n @if (getSortEntry(column); as entry) {\n @if (isSortIconLeading(column)) {\n @if (multiSortCriteria.length > 1) {\n <span\n class=\"inline-flex h-4 min-w-4 items-center justify-center rounded-full bg-white/25 px-1 text-[0.65rem] font-bold leading-none text-white-base\"\n >\n {{ entry.index + 1 }}\n </span>\n }\n <ads-icon\n class=\"text-current transition-transform duration-200 -rotate-90\"\n [class.rotate-90]=\"entry.direction === 'ASC'\"\n [iconName]=\"'arrow_right'\"\n [size]=\"16\"\n ></ads-icon>\n }\n }\n <span class=\"truncate\">{{\n column.column.columnDef.header\n }}</span>\n @if (getSortEntry(column); as entry) {\n @if (!isSortIconLeading(column)) {\n @if (multiSortCriteria.length > 1) {\n <span\n class=\"inline-flex h-4 min-w-4 items-center justify-center rounded-full bg-white/25 px-1 text-[0.65rem] font-bold leading-none text-white-base\"\n >\n {{ entry.index + 1 }}\n </span>\n }\n <ads-icon\n class=\"text-current transition-transform duration-200 -rotate-90\"\n [class.rotate-90]=\"entry.direction === 'ASC'\"\n [iconName]=\"'arrow_right'\"\n [size]=\"16\"\n ></ads-icon>\n }\n }\n </button>\n <div\n class=\"absolute right-0 top-0 bottom-0 z-3 w-1 cursor-col-resize select-none bg-green-1 transition-colors hover:bg-green-1\"\n (mousedown)=\"startResize($event, column)\"\n (touchstart)=\"startResize($event, column)\"\n ></div>\n </th>\n }\n } @else {\n @if (areColumnsDraggable) {\n <!-- Non-sortable but draggable header cell -->\n <th\n cdkDrag\n cdkDragLockAxis=\"x\"\n [ngStyle]=\"getColumnHeaderStyles(column)\"\n class=\"relative h-10 min-h-10 max-h-11.25 select-none border-r border-white/20 font-medium first:rounded-l-2xl last:rounded-r-2xl last:border-r-0\"\n [attr.data-testid]=\"getHeaderTestId(column)\"\n >\n <div\n cdkDragHandle\n class=\"flex h-full w-full items-center px-3\"\n [ngClass]=\"headerAlignmentClass(column)\"\n >\n <span class=\"truncate\">{{\n column.column.columnDef.header\n }}</span>\n </div>\n <div\n class=\"absolute right-0 top-0 bottom-0 z-3 w-1 cursor-col-resize select-none bg-green-1 transition-colors hover:bg-green-1\"\n (mousedown)=\"startResize($event, column)\"\n (touchstart)=\"startResize($event, column)\"\n ></div>\n </th>\n } @else {\n <!-- Plain header cell (no sort, no drag) -->\n <th\n [ngStyle]=\"getColumnHeaderStyles(column)\"\n class=\"relative h-10 min-h-10 max-h-11.25 select-none border-r border-white/20 font-medium first:rounded-l-2xl last:rounded-r-2xl last:border-r-0\"\n [attr.data-testid]=\"getHeaderTestId(column)\"\n >\n <div\n class=\"flex h-full w-full items-center px-3\"\n [ngClass]=\"headerAlignmentClass(column)\"\n >\n <span class=\"truncate\">{{\n column.column.columnDef.header\n }}</span>\n </div>\n <div\n class=\"absolute right-0 top-0 bottom-0 z-3 w-1 cursor-col-resize select-none bg-green-1 transition-colors hover:bg-green-1\"\n (mousedown)=\"startResize($event, column)\"\n (touchstart)=\"startResize($event, column)\"\n ></div>\n </th>\n }\n }\n }\n\n @if (showButtons) {\n <!-- Optional actions column header -->\n <th\n [attr.data-testid]=\"contentTestId + '-header-actions'\"\n class=\"h-10 min-h-10 max-h-11.25 px-3 text-center font-medium whitespace-nowrap rounded-r-2xl\"\n [ngStyle]=\"{ width: '1%' }\"\n >\n Actions\n </th>\n }\n </tr>\n </thead>\n\n <tbody class=\"relative\">\n @if (isLoading && getRows().length === 0) {\n <tr>\n <td [attr.colspan]=\"getEmptyColspan()\" class=\"p-0\">\n <div\n class=\"flex min-h-40 items-center justify-center rounded-b-2xl bg-white-base/45 backdrop-blur-sm\"\n aria-live=\"polite\"\n aria-busy=\"true\"\n >\n <span\n class=\"h-10 w-10 animate-spin rounded-full border-4 border-green-1/20 border-t-green-1\"\n aria-hidden=\"true\"\n ></span>\n <span class=\"sr-only\">Loading table data</span>\n </div>\n </td>\n </tr>\n }\n\n <!-- Data rows -->\n @for (row of getRows(); track trackByFn($index, row)) {\n <tr\n [attr.data-testid]=\"getRowTestId(row, $index)\"\n class=\"h-10 min-h-10 max-h-11.25\"\n >\n @if (selectable) {\n <!-- Optional row selection checkbox -->\n <td\n class=\"border-b border-[#aedad8] px-3 py-0 align-middle text-center\"\n >\n <div class=\"flex h-full w-full items-center justify-center\">\n <ads-checkbox\n [checked]=\"isRowSelected(row)\"\n (checkedChange)=\"toggleRowSelection(row)\"\n ></ads-checkbox>\n </div>\n </td>\n }\n @for (cell of row.getVisibleCells(); track cell.id) {\n <td\n class=\"border-b border-[#aedad8] px-3 py-0 text-sm whitespace-pre-line wrap-break-word text-black-base\"\n [ngClass]=\"cellAlignmentClass(cell)\"\n [ngStyle]=\"allContentLeft ? { padding: '0' } : null\"\n >\n @if (isStateCell(cell)) {\n <!-- State-like values (status/active) are rendered with ads-state for a consistent visual token -->\n <ads-state\n [shape]=\"getStateStyle(cell).shape ?? statusShape\"\n [containerShapes]=\"\n getStateStyle(cell).shape ?? statusShape\n \"\n [borderColor]=\"getStateStyle(cell).borderColor\"\n [bgColor]=\"getStateStyle(cell).bgColor\"\n [textColor]=\"getStateStyle(cell).textColor\"\n [text]=\"getStateText(cell)\"\n [fullWidth]=\"getStateStyle(cell).fullWidth ?? false\"\n [boldText]=\"getStateStyle(cell).boldText ?? true\"\n ></ads-state>\n } @else {\n <!-- Generic cell rendering for non-state columns via TanStack flexRender output -->\n <ng-container\n *flexRender=\"\n cell.column.columnDef.cell;\n props: cell.getContext();\n let renderedCell\n \"\n >\n <div\n [innerHTML]=\"renderedCell\"\n [ngStyle]=\"\n allContentLeft ? { 'text-align': 'left' } : null\n \"\n ></div>\n </ng-container>\n }\n </td>\n }\n\n @if (showButtons && actionButtons.length > 0) {\n <!-- Optional row action buttons -->\n <td\n class=\"border-b border-[#aedad8] px-1 py-1 align-middle text-center whitespace-nowrap\"\n >\n <div\n class=\"flex w-full items-center justify-center gap-1 p-0\"\n >\n @for (button of actionButtons; track $index) {\n @if (\n !button.condition || button.condition(row.original)\n ) {\n <button\n nz-tooltip\n [nzTooltipTitle]=\"\n getTooltipText(button, row.original)\n \"\n ads-button\n type=\"button\"\n [onlyIconButton]=\"true\"\n color=\"text\"\n [attr.data-testid]=\"\n getActionButtonTestId(row, button, $index)\n \"\n [title]=\"getTooltipText(button, row.original)\"\n [disabled]=\"\n isActionButtonDisabled(button, row.original)\n \"\n (click)=\"button.callback(row.original)\"\n >\n <ads-icon\n [ngClass]=\"\n isActionButtonDisabled(button, row.original)\n ? 'text-neutral-disabled-text'\n : 'text-green-1'\n \"\n [iconName]=\"iconNameFor(button.icon)\"\n [size]=\"16\"\n ></ads-icon>\n </button>\n }\n }\n </div>\n </td>\n }\n </tr>\n }\n\n @if (isLoading && getRows().length > 0) {\n <tr class=\"absolute inset-0 z-10 block\">\n <td [attr.colspan]=\"getEmptyColspan()\" class=\"block h-full p-0\">\n <div\n class=\"flex h-full min-h-40 items-center justify-center rounded-b-2xl bg-white-base/45 backdrop-blur-sm\"\n aria-live=\"polite\"\n aria-busy=\"true\"\n >\n <span\n class=\"h-10 w-10 animate-spin rounded-full border-4 border-green-1/20 border-t-green-1\"\n aria-hidden=\"true\"\n ></span>\n <span class=\"sr-only\">Loading table data</span>\n </div>\n </td>\n </tr>\n }\n </tbody>\n </table>\n </div>\n\n <!-- Footer controls: page size selector, page navigation, and total record counter -->\n <div class=\"flex w-full flex-wrap items-center justify-end gap-4 py-2\">\n <div class=\"mr-auto flex items-center gap-2 text-sm text-green-1\">\n <span class=\"whitespace-nowrap font-medium\">Rows per page</span>\n <select\n class=\"h-8 cursor-pointer rounded border border-aqua-1 bg-white-base px-2 text-sm text-green-1 outline-none transition hover:border-green-1 focus:border-green-1 focus:ring-2 focus:ring-green-1/20\"\n [value]=\"pageSize\"\n (change)=\"onPageSizeChange($event)\"\n [attr.data-testid]=\"contentTestId + '-page-size-select'\"\n >\n <option value=\"10\">10</option>\n <option value=\"25\">25</option>\n <option value=\"50\">50</option>\n <option value=\"100\">100</option>\n </select>\n </div>\n\n <div class=\"flex w-fit items-center justify-center gap-1\">\n <button\n type=\"button\"\n class=\"inline-flex h-8 items-center justify-center gap-1 rounded px-3 text-sm font-medium text-neutral-disabled-text transition hover:text-green-1 disabled:cursor-default disabled:opacity-50 border-none outline-0 bg-transparent\"\n [disabled]=\"currentPage === 1\"\n (click)=\"previousPage()\"\n [attr.data-testid]=\"contentTestId + '-pagination-previous'\"\n >\n <span class=\"text-lg leading-none\">\u2039</span>\n Previous\n </button>\n\n <div class=\"flex items-center justify-center gap-1\">\n @for (page of getPageNumbers(); track $index) {\n @if (page === null) {\n <span\n class=\"inline-flex h-8 min-w-8 select-none items-center justify-center px-2 font-medium text-neutral-disabled-text\"\n >...</span\n >\n } @else {\n <button\n type=\"button\"\n class=\"inline-flex h-8 min-w-8 items-center justify-center rounded px-2 font-medium text-neutral-disabled-text transition hover:text-green-1 disabled:cursor-default disabled:opacity-50 outline-0 border-none\"\n [ngClass]=\"{\n 'bg-green-1 text-white-base hover:text-white-base':\n currentPage === page,\n 'bg-transparent': currentPage !== page,\n }\"\n [disabled]=\"false\"\n (click)=\"goToPage(page)\"\n [attr.data-testid]=\"contentTestId + '-pagination-page-' + page\"\n >\n {{ page }}\n </button>\n }\n }\n </div>\n\n <button\n type=\"button\"\n class=\"inline-flex h-8 items-center justify-center gap-1 rounded px-3 text-sm font-medium text-neutral-disabled-text transition hover:text-green-1 disabled:cursor-default disabled:opacity-50 border-none outline-0 bg-transparent\"\n [disabled]=\"currentPage === totalPages\"\n (click)=\"nextPage()\"\n [attr.data-testid]=\"contentTestId + '-pagination-next'\"\n >\n Next\n <span class=\"text-lg leading-none\">\u203A</span>\n </button>\n </div>\n\n @if (totalRegisters) {\n <div\n class=\"w-fit min-w-20 text-sm font-medium text-neutral-disabled-text\"\n [attr.data-testid]=\"contentTestId + '-pagination-info'\"\n >\n Total Records: {{ totalRegisters }}\n </div>\n }\n </div>\n </div>\n} @else {\n <!-- Empty state layout when there are no rows to display -->\n <div class=\"w-full overflow-x-auto\">\n <table\n [attr.data-testid]=\"contentTestId\"\n class=\"min-w-full table-fixed border-separate border-spacing-0\"\n >\n <thead class=\"bg-green-1 text-white-base\">\n <tr class=\"h-10 min-h-10 max-h-11.25\">\n @if (selectable) {\n <th\n class=\"h-10 min-h-10 max-h-11.25 w-10 px-3 text-center first:rounded-l-2xl\"\n ></th>\n }\n @for (column of getHeaderCells(); track column.id) {\n <th\n class=\"h-10 min-h-10 max-h-11.25 px-3 text-left font-medium first:rounded-l-2xl\"\n >\n {{ column.column.columnDef.header }}\n </th>\n }\n @if (showButtons) {\n <th\n class=\"h-10 min-h-10 max-h-11.25 px-3 text-center font-medium rounded-r-2xl\"\n >\n Options\n </th>\n }\n </tr>\n </thead>\n <tbody>\n <tr>\n <td [attr.colspan]=\"getEmptyColspan()\" class=\"py-2\">\n <div\n class=\"flex flex-col items-center justify-center gap-2 rounded-xl border border-dashed border-aqua-2 bg-aqua-5/40 px-6 py-5 text-center\"\n >\n <span class=\"text-base font-semibold text-green-1\"\n >No available data</span\n >\n <span class=\"text-sm text-neutral-disabled-text\"\n >No data to display right now.</span\n >\n </div>\n </td>\n </tr>\n </tbody>\n </table>\n </div>\n}\n", styles: [":host ::ng-deep .cdk-drag-preview{background-color:#014744!important;color:#fff!important;border-radius:1rem!important;border-right:1px solid rgba(255,255,255,.2)!important;box-shadow:0 12px 28px #01474447!important;overflow:hidden!important}:host ::ng-deep .cdk-drag-placeholder{opacity:0}:host ::ng-deep .cdk-drop-list-dragging th.cdk-drag:not(.cdk-drag-placeholder){transition:transform .22s cubic-bezier(.2,0,0,1)}:host ::ng-deep th.cdk-drag-animating{transition:transform .22s cubic-bezier(.2,0,0,1)}::ng-deep .cdk-drag-preview{background:#014743a9!important;color:#fff!important;box-shadow:none!important;border:none!important;border-radius:10rem!important}\n"], dependencies: [{ kind: "ngmodule", type: DragDropModule }, { kind: "directive", type: i1$3.CdkDropList, selector: "[cdkDropList], cdk-drop-list", inputs: ["cdkDropListConnectedTo", "cdkDropListData", "cdkDropListOrientation", "id", "cdkDropListLockAxis", "cdkDropListDisabled", "cdkDropListSortingDisabled", "cdkDropListEnterPredicate", "cdkDropListSortPredicate", "cdkDropListAutoScrollDisabled", "cdkDropListAutoScrollStep", "cdkDropListElementContainer", "cdkDropListHasAnchor"], outputs: ["cdkDropListDropped", "cdkDropListEntered", "cdkDropListExited", "cdkDropListSorted"], exportAs: ["cdkDropList"] }, { kind: "directive", type: i1$3.CdkDrag, selector: "[cdkDrag]", inputs: ["cdkDragData", "cdkDragLockAxis", "cdkDragRootElement", "cdkDragBoundary", "cdkDragStartDelay", "cdkDragFreeDragPosition", "cdkDragDisabled", "cdkDragConstrainPosition", "cdkDragPreviewClass", "cdkDragPreviewContainer", "cdkDragScale"], outputs: ["cdkDragStarted", "cdkDragReleased", "cdkDragEnded", "cdkDragEntered", "cdkDragExited", "cdkDragDropped", "cdkDragMoved"], exportAs: ["cdkDrag"] }, { kind: "directive", type: i1$3.CdkDragHandle, selector: "[cdkDragHandle]", inputs: ["cdkDragHandleDisabled"] }, { kind: "directive", type: FlexRenderDirective, selector: "[flexRender]", inputs: ["flexRender", "flexRenderProps", "flexRenderInjector"] }, { kind: "component", type: CheckboxComponent, selector: "ads-checkbox", inputs: ["appearance", "label", "labelPosition", "labelColor", "controlColor", "checked", "indeterminate", "disabled"], outputs: ["checkedChange"] }, { kind: "component", type: IconComponent, selector: "ads-icon", inputs: ["iconName", "size", "title", "color"] }, { kind: "component", type: ButtonComponent, selector: "button[ads-button]", inputs: ["variant", "color", "buttonType", "disabled", "fullWidth", "iconButton", "onlyIconButton", "iconColor"], outputs: ["clicked"] }, { kind: "component", type: StateComponent, selector: "ads-state", inputs: ["boldText", "fullWidth", "shape", "text", "borderColor", "bgColor", "textColor", "containerShapes"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "ngmodule", type: NzTooltipModule }, { kind: "directive", type: i1$2.NzTooltipDirective, selector: "[nz-tooltip]", inputs: ["nzTooltipTitle", "nzTooltipTitleContext", "nz-tooltip", "nzTooltipTrigger", "nzTooltipPlacement", "nzTooltipOrigin", "nzTooltipVisible", "nzTooltipMouseEnterDelay", "nzTooltipMouseLeaveDelay", "nzTooltipOverlayClassName", "nzTooltipOverlayStyle", "nzTooltipArrowPointAtCenter", "cdkConnectedOverlayPush", "nzTooltipColor"], outputs: ["nzTooltipVisibleChange"], exportAs: ["nzTooltip"] }] });
|
|
4345
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.11", type: TableComponent, isStandalone: true, selector: "ads-table", inputs: { table: "table", isLoading: "isLoading", selectedSortingHeader: "selectedSortingHeader", sortDirection: "sortDirection", showButtons: "showButtons", allContentLeft: "allContentLeft", totalRegisters: "totalRegisters", minH: ["min-h", "minH"], areColumnsDraggable: "areColumnsDraggable", currentPage: "currentPage", totalPages: "totalPages", pageSize: "pageSize", enableMultiSort: "enableMultiSort", multiSortCriteria: "multiSortCriteria", actionButtons: "actionButtons", statusStateStyles: "statusStateStyles", activeStateStyles: "activeStateStyles", selectable: "selectable", stickyActions: "stickyActions" }, outputs: { sortEvent: "sortEvent", columnOrderChange: "columnOrderChange", pageChange: "pageChange", columnSizingChange: "columnSizingChange", pageSizeChange: "pageSizeChange", multiSortEvent: "multiSortEvent", selectionChange: "selectionChange" }, ngImport: i0, template: "@if (getRows().length > 0 || isLoading) {\n <!-- Main table layout: data grid + footer pagination area -->\n <div\n class=\"flex w-full flex-col justify-between gap-4\"\n [ngClass]=\"{ 'min-h-[60vh]': minH }\"\n >\n <div class=\"relative min-h-40 w-full overflow-x-auto\">\n <table\n [attr.data-testid]=\"contentTestId\"\n class=\"min-w-full table-fixed border-separate border-spacing-0\"\n >\n <!-- Interactive header row: sorting, drag-and-drop, and column resizing -->\n <thead class=\"bg-green-1 text-white-base\">\n <tr\n cdkDropList\n cdkDropListOrientation=\"horizontal\"\n class=\"h-10 min-h-10 max-h-11.25\"\n (cdkDropListDropped)=\"drop($event)\"\n [ngStyle]=\"allContentLeft ? { 'text-align': 'left' } : null\"\n >\n @if (selectable) {\n <!-- Checkbox selection column header: select all rows -->\n <th\n class=\"relative h-10 min-h-10 max-h-11.25 w-10 px-3 text-center align-middle border-r border-white/20 first:rounded-l-2xl\"\n [attr.data-testid]=\"contentTestId + '-header-select-all'\"\n >\n <div class=\"flex h-full w-full items-center justify-center\">\n <ads-checkbox\n controlColor=\"white\"\n [checked]=\"isAllSelected()\"\n [indeterminate]=\"isSomeSelected() && !isAllSelected()\"\n (checkedChange)=\"toggleSelectAll()\"\n ></ads-checkbox>\n </div>\n </th>\n }\n @for (\n column of getHeaderCells();\n track column.id + \"-\" + headerRenderVersion\n ) {\n @if (isColumnSortable(column)) {\n @if (areColumnsDraggable) {\n <!-- Sortable + draggable header cell -->\n <th\n cdkDrag\n cdkDragLockAxis=\"x\"\n [ngStyle]=\"getColumnHeaderStyles(column)\"\n class=\"relative h-10 min-h-10 max-h-11.25 select-none border-r border-white/20 font-medium first:rounded-l-2xl last:rounded-r-2xl last:border-r-0 overflow-hidden cursor-grab active:cursor-grabbing\"\n [attr.data-testid]=\"getHeaderTestId(column)\"\n >\n <button\n type=\"button\"\n cdkDragHandle\n class=\"group flex h-full w-full cursor-pointer items-center gap-3 px-3 transition-colors duration-200 border-none outline-0 bg-transparent hover:bg-white/10\"\n [ngClass]=\"headerAlignmentClass(column)\"\n (click)=\"sort(column, $event)\"\n [title]=\"\n enableMultiSort ? 'Shift+click to add to sort' : null\n \"\n >\n <!-- When right-aligned, the sort indicator is shown before the header text -->\n @if (getSortEntry(column); as entry) {\n @if (isSortIconLeading(column)) {\n @if (multiSortCriteria.length > 1) {\n <span\n class=\"inline-flex h-4 min-w-4 items-center justify-center rounded-full bg-white/25 px-1 text-[0.65rem] font-bold text-white-base leading-px\"\n >\n {{ entry.index + 1 }}\n </span>\n }\n <ads-icon\n class=\"text-current transition-transform duration-200 -rotate-90\"\n [class.rotate-90]=\"entry.direction === 'ASC'\"\n [iconName]=\"'arrow_right'\"\n [size]=\"16\"\n ></ads-icon>\n }\n }\n <span class=\"truncate\">{{\n column.column.columnDef.header\n }}</span>\n <!-- For left/center aligned headers, the sort indicator is shown after the text -->\n @if (getSortEntry(column); as entry) {\n @if (!isSortIconLeading(column)) {\n @if (multiSortCriteria.length > 1) {\n <span\n class=\"inline-flex h-4 min-w-4 items-center justify-center rounded-full bg-white/25 px-1 text-[0.65rem] font-bold text-white-base leading-px\"\n >\n {{ entry.index + 1 }}\n </span>\n }\n <ads-icon\n class=\"text-current transition-transform duration-200 -rotate-90\"\n [class.rotate-90]=\"entry.direction === 'ASC'\"\n [iconName]=\"'arrow_right'\"\n [size]=\"16\"\n ></ads-icon>\n }\n }\n </button>\n <div\n class=\"absolute right-0 top-0 bottom-0 z-3 w-1 cursor-col-resize select-none bg-green-1 transition-colors hover:bg-green-1\"\n (mousedown)=\"startResize($event, column)\"\n (touchstart)=\"startResize($event, column)\"\n ></div>\n </th>\n } @else {\n <!-- Sortable header cell without drag-and-drop -->\n <th\n [ngStyle]=\"getColumnHeaderStyles(column)\"\n class=\"relative h-10 min-h-10 max-h-11.25 select-none border-r border-white/20 font-medium first:rounded-l-2xl last:rounded-r-2xl last:border-r-0\"\n [attr.data-testid]=\"getHeaderTestId(column)\"\n >\n <button\n type=\"button\"\n class=\"flex h-full w-full cursor-pointer items-center gap-3 px-3 transition-colors duration-200 hover:bg-white/10 bg-green-base\"\n [ngClass]=\"headerAlignmentClass(column)\"\n (click)=\"sort(column, $event)\"\n [title]=\"\n enableMultiSort ? 'Shift+click to add to sort' : null\n \"\n >\n @if (getSortEntry(column); as entry) {\n @if (isSortIconLeading(column)) {\n @if (multiSortCriteria.length > 1) {\n <span\n class=\"inline-flex h-4 min-w-4 items-center justify-center rounded-full bg-white/25 px-1 text-[0.65rem] font-bold leading-none text-white-base\"\n >\n {{ entry.index + 1 }}\n </span>\n }\n <ads-icon\n class=\"text-current transition-transform duration-200 -rotate-90\"\n [class.rotate-90]=\"entry.direction === 'ASC'\"\n [iconName]=\"'arrow_right'\"\n [size]=\"16\"\n ></ads-icon>\n }\n }\n <span class=\"truncate\">{{\n column.column.columnDef.header\n }}</span>\n @if (getSortEntry(column); as entry) {\n @if (!isSortIconLeading(column)) {\n @if (multiSortCriteria.length > 1) {\n <span\n class=\"inline-flex h-4 min-w-4 items-center justify-center rounded-full bg-white/25 px-1 text-[0.65rem] font-bold leading-none text-white-base\"\n >\n {{ entry.index + 1 }}\n </span>\n }\n <ads-icon\n class=\"text-current transition-transform duration-200 -rotate-90\"\n [class.rotate-90]=\"entry.direction === 'ASC'\"\n [iconName]=\"'arrow_right'\"\n [size]=\"16\"\n ></ads-icon>\n }\n }\n </button>\n <div\n class=\"absolute right-0 top-0 bottom-0 z-3 w-1 cursor-col-resize select-none bg-green-1 transition-colors hover:bg-green-1\"\n (mousedown)=\"startResize($event, column)\"\n (touchstart)=\"startResize($event, column)\"\n ></div>\n </th>\n }\n } @else {\n @if (areColumnsDraggable) {\n <!-- Non-sortable but draggable header cell -->\n <th\n cdkDrag\n cdkDragLockAxis=\"x\"\n [ngStyle]=\"getColumnHeaderStyles(column)\"\n class=\"relative h-10 min-h-10 max-h-11.25 select-none border-r border-white/20 font-medium first:rounded-l-2xl last:rounded-r-2xl last:border-r-0\"\n [attr.data-testid]=\"getHeaderTestId(column)\"\n >\n <div\n cdkDragHandle\n class=\"flex h-full w-full items-center px-3\"\n [ngClass]=\"headerAlignmentClass(column)\"\n >\n <span class=\"truncate\">{{\n column.column.columnDef.header\n }}</span>\n </div>\n <div\n class=\"absolute right-0 top-0 bottom-0 z-3 w-1 cursor-col-resize select-none bg-green-1 transition-colors hover:bg-green-1\"\n (mousedown)=\"startResize($event, column)\"\n (touchstart)=\"startResize($event, column)\"\n ></div>\n </th>\n } @else {\n <!-- Plain header cell (no sort, no drag) -->\n <th\n [ngStyle]=\"getColumnHeaderStyles(column)\"\n class=\"relative h-10 min-h-10 max-h-11.25 select-none border-r border-white/20 font-medium first:rounded-l-2xl last:rounded-r-2xl last:border-r-0\"\n [attr.data-testid]=\"getHeaderTestId(column)\"\n >\n <div\n class=\"flex h-full w-full items-center px-3\"\n [ngClass]=\"headerAlignmentClass(column)\"\n >\n <span class=\"truncate\">{{\n column.column.columnDef.header\n }}</span>\n </div>\n <div\n class=\"absolute right-0 top-0 bottom-0 z-3 w-1 cursor-col-resize select-none bg-green-1 transition-colors hover:bg-green-1\"\n (mousedown)=\"startResize($event, column)\"\n (touchstart)=\"startResize($event, column)\"\n ></div>\n </th>\n }\n }\n }\n\n @if (showButtons) {\n <!-- Optional actions column header -->\n <th\n [attr.data-testid]=\"contentTestId + '-header-actions'\"\n class=\"h-10 min-h-10 max-h-11.25 px-3 text-center font-medium whitespace-nowrap rounded-r-2xl\"\n [class.sticky-actions]=\"stickyActions\"\n [ngStyle]=\"{ width: '1%' }\"\n >\n Actions\n </th>\n }\n </tr>\n </thead>\n\n <tbody class=\"relative\">\n @if (isLoading && getRows().length === 0) {\n <tr>\n <td [attr.colspan]=\"getEmptyColspan()\" class=\"p-0\">\n <div\n class=\"flex min-h-40 items-center justify-center rounded-b-2xl bg-white-base/45 backdrop-blur-sm\"\n aria-live=\"polite\"\n aria-busy=\"true\"\n >\n <span\n class=\"h-10 w-10 animate-spin rounded-full border-4 border-green-1/20 border-t-green-1\"\n aria-hidden=\"true\"\n ></span>\n <span class=\"sr-only\">Loading table data</span>\n </div>\n </td>\n </tr>\n }\n\n <!-- Data rows -->\n @for (row of getRows(); track trackByFn($index, row)) {\n <tr\n [attr.data-testid]=\"getRowTestId(row, $index)\"\n class=\"h-10 min-h-10 max-h-11.25\"\n >\n @if (selectable) {\n <!-- Optional row selection checkbox -->\n <td\n class=\"border-b border-[#aedad8] px-3 py-0 align-middle text-center\"\n >\n <div class=\"flex h-full w-full items-center justify-center\">\n <ads-checkbox\n [checked]=\"isRowSelected(row)\"\n (checkedChange)=\"toggleRowSelection(row)\"\n ></ads-checkbox>\n </div>\n </td>\n }\n @for (cell of row.getVisibleCells(); track cell.id) {\n <td\n class=\"border-b border-[#aedad8] px-3 py-0 text-sm whitespace-pre-line wrap-break-word text-black-base\"\n [ngClass]=\"cellAlignmentClass(cell)\"\n [ngStyle]=\"allContentLeft ? { padding: '0' } : null\"\n >\n @if (isStateCell(cell)) {\n <!-- State-like values (status/active) are rendered with ads-state for a consistent visual token -->\n <ads-state\n [shape]=\"getStateStyle(cell).shape ?? statusShape\"\n [containerShapes]=\"\n getStateStyle(cell).shape ?? statusShape\n \"\n [borderColor]=\"getStateStyle(cell).borderColor\"\n [bgColor]=\"getStateStyle(cell).bgColor\"\n [textColor]=\"getStateStyle(cell).textColor\"\n [text]=\"getStateText(cell)\"\n [fullWidth]=\"getStateStyle(cell).fullWidth ?? false\"\n [boldText]=\"getStateStyle(cell).boldText ?? true\"\n ></ads-state>\n } @else {\n <!-- Generic cell rendering for non-state columns via TanStack flexRender output -->\n <ng-container\n *flexRender=\"\n cell.column.columnDef.cell;\n props: cell.getContext();\n let renderedCell\n \"\n >\n <div\n [innerHTML]=\"renderedCell\"\n [ngStyle]=\"\n allContentLeft ? { 'text-align': 'left' } : null\n \"\n ></div>\n </ng-container>\n }\n </td>\n }\n\n @if (showButtons && actionButtons.length > 0) {\n <!-- Optional row action buttons -->\n <td\n class=\"border-b border-[#aedad8] px-1 py-1 align-middle text-center whitespace-nowrap\"\n [class.sticky-actions]=\"stickyActions\"\n >\n <div\n class=\"flex w-full items-center justify-center gap-1 p-0\"\n >\n @for (button of actionButtons; track $index) {\n @if (\n !button.condition || button.condition(row.original)\n ) {\n <button\n nz-tooltip\n [nzTooltipTitle]=\"\n getTooltipText(button, row.original)\n \"\n ads-button\n type=\"button\"\n [onlyIconButton]=\"true\"\n color=\"text\"\n [attr.data-testid]=\"\n getActionButtonTestId(row, button, $index)\n \"\n [title]=\"getTooltipText(button, row.original)\"\n [disabled]=\"\n isActionButtonDisabled(button, row.original)\n \"\n (click)=\"button.callback(row.original)\"\n >\n <ads-icon\n [ngClass]=\"\n isActionButtonDisabled(button, row.original)\n ? 'text-neutral-disabled-text'\n : 'text-green-1'\n \"\n [iconName]=\"iconNameFor(button.icon)\"\n [size]=\"16\"\n ></ads-icon>\n </button>\n }\n }\n </div>\n </td>\n }\n </tr>\n }\n\n @if (isLoading && getRows().length > 0) {\n <tr class=\"absolute inset-0 z-10 block\">\n <td [attr.colspan]=\"getEmptyColspan()\" class=\"block h-full p-0\">\n <div\n class=\"flex h-full min-h-40 items-center justify-center rounded-b-2xl bg-white-base/45 backdrop-blur-sm\"\n aria-live=\"polite\"\n aria-busy=\"true\"\n >\n <span\n class=\"h-10 w-10 animate-spin rounded-full border-4 border-green-1/20 border-t-green-1\"\n aria-hidden=\"true\"\n ></span>\n <span class=\"sr-only\">Loading table data</span>\n </div>\n </td>\n </tr>\n }\n </tbody>\n </table>\n </div>\n\n <!-- Footer controls: page size selector, page navigation, and total record counter -->\n <div class=\"flex w-full flex-wrap items-center justify-end gap-4 py-2\">\n <div class=\"mr-auto flex items-center gap-2 text-sm text-green-1\">\n <span class=\"whitespace-nowrap font-medium\">Rows per page</span>\n <select\n class=\"h-8 cursor-pointer rounded border border-aqua-1 bg-white-base px-2 text-sm text-green-1 outline-none transition hover:border-green-1 focus:border-green-1 focus:ring-2 focus:ring-green-1/20\"\n [value]=\"pageSize\"\n (change)=\"onPageSizeChange($event)\"\n [attr.data-testid]=\"contentTestId + '-page-size-select'\"\n >\n <option value=\"10\">10</option>\n <option value=\"25\">25</option>\n <option value=\"50\">50</option>\n <option value=\"100\">100</option>\n </select>\n </div>\n\n <div class=\"flex w-fit items-center justify-center gap-1\">\n <button\n type=\"button\"\n class=\"inline-flex h-8 items-center justify-center gap-1 rounded px-3 text-sm font-medium text-neutral-disabled-text transition hover:text-green-1 disabled:cursor-default disabled:opacity-50 border-none outline-0 bg-transparent\"\n [disabled]=\"currentPage === 1\"\n (click)=\"previousPage()\"\n [attr.data-testid]=\"contentTestId + '-pagination-previous'\"\n >\n <span class=\"text-lg leading-none\">\u2039</span>\n Previous\n </button>\n\n <div class=\"flex items-center justify-center gap-1\">\n @for (page of getPageNumbers(); track $index) {\n @if (page === null) {\n <span\n class=\"inline-flex h-8 min-w-8 select-none items-center justify-center px-2 font-medium text-neutral-disabled-text\"\n >...</span\n >\n } @else {\n <button\n type=\"button\"\n class=\"inline-flex h-8 min-w-8 items-center justify-center rounded px-2 font-medium text-neutral-disabled-text transition hover:text-green-1 disabled:cursor-default disabled:opacity-50 outline-0 border-none\"\n [ngClass]=\"{\n 'bg-green-1 text-white-base hover:text-white-base':\n currentPage === page,\n 'bg-transparent': currentPage !== page,\n }\"\n [disabled]=\"false\"\n (click)=\"goToPage(page)\"\n [attr.data-testid]=\"contentTestId + '-pagination-page-' + page\"\n >\n {{ page }}\n </button>\n }\n }\n </div>\n\n <button\n type=\"button\"\n class=\"inline-flex h-8 items-center justify-center gap-1 rounded px-3 text-sm font-medium text-neutral-disabled-text transition hover:text-green-1 disabled:cursor-default disabled:opacity-50 border-none outline-0 bg-transparent\"\n [disabled]=\"currentPage === totalPages\"\n (click)=\"nextPage()\"\n [attr.data-testid]=\"contentTestId + '-pagination-next'\"\n >\n Next\n <span class=\"text-lg leading-none\">\u203A</span>\n </button>\n </div>\n\n @if (totalRegisters) {\n <div\n class=\"w-fit min-w-20 text-sm font-medium text-neutral-disabled-text\"\n [attr.data-testid]=\"contentTestId + '-pagination-info'\"\n >\n Total Records: {{ totalRegisters }}\n </div>\n }\n </div>\n </div>\n} @else {\n <!-- Empty state layout when there are no rows to display -->\n <div class=\"w-full overflow-x-auto\">\n <table\n [attr.data-testid]=\"contentTestId\"\n class=\"min-w-full table-fixed border-separate border-spacing-0\"\n >\n <thead class=\"bg-green-1 text-white-base\">\n <tr class=\"h-10 min-h-10 max-h-11.25\">\n @if (selectable) {\n <th\n class=\"h-10 min-h-10 max-h-11.25 w-10 px-3 text-center first:rounded-l-2xl\"\n ></th>\n }\n @for (column of getHeaderCells(); track column.id) {\n <th\n class=\"h-10 min-h-10 max-h-11.25 px-3 text-left font-medium first:rounded-l-2xl\"\n >\n {{ column.column.columnDef.header }}\n </th>\n }\n @if (showButtons) {\n <th\n class=\"h-10 min-h-10 max-h-11.25 px-3 text-center font-medium rounded-r-2xl\"\n >\n Options\n </th>\n }\n </tr>\n </thead>\n <tbody>\n <tr>\n <td [attr.colspan]=\"getEmptyColspan()\" class=\"py-2\">\n <div\n class=\"flex flex-col items-center justify-center gap-2 rounded-xl border border-dashed border-aqua-2 bg-aqua-5/40 px-6 py-5 text-center\"\n >\n <span class=\"text-base font-semibold text-green-1\"\n >No available data</span\n >\n <span class=\"text-sm text-neutral-disabled-text\"\n >No data to display right now.</span\n >\n </div>\n </td>\n </tr>\n </tbody>\n </table>\n </div>\n}\n", styles: [".sticky-actions{position:sticky;right:0;z-index:5}th.sticky-actions{background-color:var(--color-green-1, #014744)}td.sticky-actions{background-color:var(--ads-table-sticky-actions-bg, transparent)}:host ::ng-deep .cdk-drag-preview{background-color:#014744!important;color:#fff!important;border-radius:1rem!important;border-right:1px solid rgba(255,255,255,.2)!important;box-shadow:0 12px 28px #01474447!important;overflow:hidden!important}:host ::ng-deep .cdk-drag-placeholder{opacity:0}:host ::ng-deep .cdk-drop-list-dragging th.cdk-drag:not(.cdk-drag-placeholder){transition:transform .22s cubic-bezier(.2,0,0,1)}:host ::ng-deep th.cdk-drag-animating{transition:transform .22s cubic-bezier(.2,0,0,1)}::ng-deep .cdk-drag-preview{background:#014743a9!important;color:#fff!important;box-shadow:none!important;border:none!important;border-radius:10rem!important}\n"], dependencies: [{ kind: "ngmodule", type: DragDropModule }, { kind: "directive", type: i1$3.CdkDropList, selector: "[cdkDropList], cdk-drop-list", inputs: ["cdkDropListConnectedTo", "cdkDropListData", "cdkDropListOrientation", "id", "cdkDropListLockAxis", "cdkDropListDisabled", "cdkDropListSortingDisabled", "cdkDropListEnterPredicate", "cdkDropListSortPredicate", "cdkDropListAutoScrollDisabled", "cdkDropListAutoScrollStep", "cdkDropListElementContainer", "cdkDropListHasAnchor"], outputs: ["cdkDropListDropped", "cdkDropListEntered", "cdkDropListExited", "cdkDropListSorted"], exportAs: ["cdkDropList"] }, { kind: "directive", type: i1$3.CdkDrag, selector: "[cdkDrag]", inputs: ["cdkDragData", "cdkDragLockAxis", "cdkDragRootElement", "cdkDragBoundary", "cdkDragStartDelay", "cdkDragFreeDragPosition", "cdkDragDisabled", "cdkDragConstrainPosition", "cdkDragPreviewClass", "cdkDragPreviewContainer", "cdkDragScale"], outputs: ["cdkDragStarted", "cdkDragReleased", "cdkDragEnded", "cdkDragEntered", "cdkDragExited", "cdkDragDropped", "cdkDragMoved"], exportAs: ["cdkDrag"] }, { kind: "directive", type: i1$3.CdkDragHandle, selector: "[cdkDragHandle]", inputs: ["cdkDragHandleDisabled"] }, { kind: "directive", type: FlexRenderDirective, selector: "[flexRender]", inputs: ["flexRender", "flexRenderProps", "flexRenderInjector"] }, { kind: "component", type: CheckboxComponent, selector: "ads-checkbox", inputs: ["appearance", "label", "labelPosition", "labelColor", "controlColor", "checked", "indeterminate", "disabled"], outputs: ["checkedChange"] }, { kind: "component", type: IconComponent, selector: "ads-icon", inputs: ["iconName", "size", "title", "color"] }, { kind: "component", type: ButtonComponent, selector: "button[ads-button]", inputs: ["variant", "color", "buttonType", "disabled", "fullWidth", "iconButton", "onlyIconButton", "iconColor"], outputs: ["clicked"] }, { kind: "component", type: StateComponent, selector: "ads-state", inputs: ["boldText", "fullWidth", "shape", "text", "borderColor", "bgColor", "textColor", "containerShapes"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "ngmodule", type: NzTooltipModule }, { kind: "directive", type: i1$2.NzTooltipDirective, selector: "[nz-tooltip]", inputs: ["nzTooltipTitle", "nzTooltipTitleContext", "nz-tooltip", "nzTooltipTrigger", "nzTooltipPlacement", "nzTooltipOrigin", "nzTooltipVisible", "nzTooltipMouseEnterDelay", "nzTooltipMouseLeaveDelay", "nzTooltipOverlayClassName", "nzTooltipOverlayStyle", "nzTooltipArrowPointAtCenter", "cdkConnectedOverlayPush", "nzTooltipColor"], outputs: ["nzTooltipVisibleChange"], exportAs: ["nzTooltip"] }] });
|
|
4328
4346
|
}
|
|
4329
4347
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.11", ngImport: i0, type: TableComponent, decorators: [{
|
|
4330
4348
|
type: Component,
|
|
@@ -4340,7 +4358,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.11", ngImpo
|
|
|
4340
4358
|
CdkDrag,
|
|
4341
4359
|
CdkDropList,
|
|
4342
4360
|
NzTooltipModule
|
|
4343
|
-
], template: "@if (getRows().length > 0 || isLoading) {\n <!-- Main table layout: data grid + footer pagination area -->\n <div\n class=\"flex w-full flex-col justify-between gap-4\"\n [ngClass]=\"{ 'min-h-[60vh]': minH }\"\n >\n <div class=\"relative min-h-40 w-full overflow-x-auto\">\n <table\n [attr.data-testid]=\"contentTestId\"\n class=\"min-w-full table-fixed border-separate border-spacing-0\"\n >\n <!-- Interactive header row: sorting, drag-and-drop, and column resizing -->\n <thead class=\"bg-green-1 text-white-base\">\n <tr\n cdkDropList\n cdkDropListOrientation=\"horizontal\"\n class=\"h-10 min-h-10 max-h-11.25\"\n (cdkDropListDropped)=\"drop($event)\"\n [ngStyle]=\"allContentLeft ? { 'text-align': 'left' } : null\"\n >\n @if (selectable) {\n <!-- Checkbox selection column header: select all rows -->\n <th\n class=\"relative h-10 min-h-10 max-h-11.25 w-10 px-3 text-center align-middle border-r border-white/20 first:rounded-l-2xl\"\n [attr.data-testid]=\"contentTestId + '-header-select-all'\"\n >\n <div class=\"flex h-full w-full items-center justify-center\">\n <ads-checkbox\n controlColor=\"white\"\n [checked]=\"isAllSelected()\"\n [indeterminate]=\"isSomeSelected() && !isAllSelected()\"\n (checkedChange)=\"toggleSelectAll()\"\n ></ads-checkbox>\n </div>\n </th>\n }\n @for (\n column of getHeaderCells();\n track column.id + \"-\" + headerRenderVersion\n ) {\n @if (isColumnSortable(column)) {\n @if (areColumnsDraggable) {\n <!-- Sortable + draggable header cell -->\n <th\n cdkDrag\n cdkDragLockAxis=\"x\"\n [ngStyle]=\"getColumnHeaderStyles(column)\"\n class=\"relative h-10 min-h-10 max-h-11.25 select-none border-r border-white/20 font-medium first:rounded-l-2xl last:rounded-r-2xl last:border-r-0 overflow-hidden cursor-grab active:cursor-grabbing\"\n [attr.data-testid]=\"getHeaderTestId(column)\"\n >\n <button\n type=\"button\"\n cdkDragHandle\n class=\"group flex h-full w-full cursor-pointer items-center gap-3 px-3 transition-colors duration-200 border-none outline-0 bg-transparent hover:bg-white/10\"\n [ngClass]=\"headerAlignmentClass(column)\"\n (click)=\"sort(column, $event)\"\n [title]=\"\n enableMultiSort ? 'Shift+click to add to sort' : null\n \"\n >\n <!-- When right-aligned, the sort indicator is shown before the header text -->\n @if (getSortEntry(column); as entry) {\n @if (isSortIconLeading(column)) {\n @if (multiSortCriteria.length > 1) {\n <span\n class=\"inline-flex h-4 min-w-4 items-center justify-center rounded-full bg-white/25 px-1 text-[0.65rem] font-bold text-white-base leading-px\"\n >\n {{ entry.index + 1 }}\n </span>\n }\n <ads-icon\n class=\"text-current transition-transform duration-200 -rotate-90\"\n [class.rotate-90]=\"entry.direction === 'ASC'\"\n [iconName]=\"'arrow_right'\"\n [size]=\"16\"\n ></ads-icon>\n }\n }\n <span class=\"truncate\">{{\n column.column.columnDef.header\n }}</span>\n <!-- For left/center aligned headers, the sort indicator is shown after the text -->\n @if (getSortEntry(column); as entry) {\n @if (!isSortIconLeading(column)) {\n @if (multiSortCriteria.length > 1) {\n <span\n class=\"inline-flex h-4 min-w-4 items-center justify-center rounded-full bg-white/25 px-1 text-[0.65rem] font-bold text-white-base leading-px\"\n >\n {{ entry.index + 1 }}\n </span>\n }\n <ads-icon\n class=\"text-current transition-transform duration-200 -rotate-90\"\n [class.rotate-90]=\"entry.direction === 'ASC'\"\n [iconName]=\"'arrow_right'\"\n [size]=\"16\"\n ></ads-icon>\n }\n }\n </button>\n <div\n class=\"absolute right-0 top-0 bottom-0 z-3 w-1 cursor-col-resize select-none bg-green-1 transition-colors hover:bg-green-1\"\n (mousedown)=\"startResize($event, column)\"\n (touchstart)=\"startResize($event, column)\"\n ></div>\n </th>\n } @else {\n <!-- Sortable header cell without drag-and-drop -->\n <th\n [ngStyle]=\"getColumnHeaderStyles(column)\"\n class=\"relative h-10 min-h-10 max-h-11.25 select-none border-r border-white/20 font-medium first:rounded-l-2xl last:rounded-r-2xl last:border-r-0\"\n [attr.data-testid]=\"getHeaderTestId(column)\"\n >\n <button\n type=\"button\"\n class=\"flex h-full w-full cursor-pointer items-center gap-3 px-3 transition-colors duration-200 hover:bg-white/10 bg-green-base\"\n [ngClass]=\"headerAlignmentClass(column)\"\n (click)=\"sort(column, $event)\"\n [title]=\"\n enableMultiSort ? 'Shift+click to add to sort' : null\n \"\n >\n @if (getSortEntry(column); as entry) {\n @if (isSortIconLeading(column)) {\n @if (multiSortCriteria.length > 1) {\n <span\n class=\"inline-flex h-4 min-w-4 items-center justify-center rounded-full bg-white/25 px-1 text-[0.65rem] font-bold leading-none text-white-base\"\n >\n {{ entry.index + 1 }}\n </span>\n }\n <ads-icon\n class=\"text-current transition-transform duration-200 -rotate-90\"\n [class.rotate-90]=\"entry.direction === 'ASC'\"\n [iconName]=\"'arrow_right'\"\n [size]=\"16\"\n ></ads-icon>\n }\n }\n <span class=\"truncate\">{{\n column.column.columnDef.header\n }}</span>\n @if (getSortEntry(column); as entry) {\n @if (!isSortIconLeading(column)) {\n @if (multiSortCriteria.length > 1) {\n <span\n class=\"inline-flex h-4 min-w-4 items-center justify-center rounded-full bg-white/25 px-1 text-[0.65rem] font-bold leading-none text-white-base\"\n >\n {{ entry.index + 1 }}\n </span>\n }\n <ads-icon\n class=\"text-current transition-transform duration-200 -rotate-90\"\n [class.rotate-90]=\"entry.direction === 'ASC'\"\n [iconName]=\"'arrow_right'\"\n [size]=\"16\"\n ></ads-icon>\n }\n }\n </button>\n <div\n class=\"absolute right-0 top-0 bottom-0 z-3 w-1 cursor-col-resize select-none bg-green-1 transition-colors hover:bg-green-1\"\n (mousedown)=\"startResize($event, column)\"\n (touchstart)=\"startResize($event, column)\"\n ></div>\n </th>\n }\n } @else {\n @if (areColumnsDraggable) {\n <!-- Non-sortable but draggable header cell -->\n <th\n cdkDrag\n cdkDragLockAxis=\"x\"\n [ngStyle]=\"getColumnHeaderStyles(column)\"\n class=\"relative h-10 min-h-10 max-h-11.25 select-none border-r border-white/20 font-medium first:rounded-l-2xl last:rounded-r-2xl last:border-r-0\"\n [attr.data-testid]=\"getHeaderTestId(column)\"\n >\n <div\n cdkDragHandle\n class=\"flex h-full w-full items-center px-3\"\n [ngClass]=\"headerAlignmentClass(column)\"\n >\n <span class=\"truncate\">{{\n column.column.columnDef.header\n }}</span>\n </div>\n <div\n class=\"absolute right-0 top-0 bottom-0 z-3 w-1 cursor-col-resize select-none bg-green-1 transition-colors hover:bg-green-1\"\n (mousedown)=\"startResize($event, column)\"\n (touchstart)=\"startResize($event, column)\"\n ></div>\n </th>\n } @else {\n <!-- Plain header cell (no sort, no drag) -->\n <th\n [ngStyle]=\"getColumnHeaderStyles(column)\"\n class=\"relative h-10 min-h-10 max-h-11.25 select-none border-r border-white/20 font-medium first:rounded-l-2xl last:rounded-r-2xl last:border-r-0\"\n [attr.data-testid]=\"getHeaderTestId(column)\"\n >\n <div\n class=\"flex h-full w-full items-center px-3\"\n [ngClass]=\"headerAlignmentClass(column)\"\n >\n <span class=\"truncate\">{{\n column.column.columnDef.header\n }}</span>\n </div>\n <div\n class=\"absolute right-0 top-0 bottom-0 z-3 w-1 cursor-col-resize select-none bg-green-1 transition-colors hover:bg-green-1\"\n (mousedown)=\"startResize($event, column)\"\n (touchstart)=\"startResize($event, column)\"\n ></div>\n </th>\n }\n }\n }\n\n @if (showButtons) {\n <!-- Optional actions column header -->\n <th\n [attr.data-testid]=\"contentTestId + '-header-actions'\"\n class=\"h-10 min-h-10 max-h-11.25 px-3 text-center font-medium whitespace-nowrap rounded-r-2xl\"\n [ngStyle]=\"{ width: '1%' }\"\n >\n Actions\n </th>\n }\n </tr>\n </thead>\n\n <tbody class=\"relative\">\n @if (isLoading && getRows().length === 0) {\n <tr>\n <td [attr.colspan]=\"getEmptyColspan()\" class=\"p-0\">\n <div\n class=\"flex min-h-40 items-center justify-center rounded-b-2xl bg-white-base/45 backdrop-blur-sm\"\n aria-live=\"polite\"\n aria-busy=\"true\"\n >\n <span\n class=\"h-10 w-10 animate-spin rounded-full border-4 border-green-1/20 border-t-green-1\"\n aria-hidden=\"true\"\n ></span>\n <span class=\"sr-only\">Loading table data</span>\n </div>\n </td>\n </tr>\n }\n\n <!-- Data rows -->\n @for (row of getRows(); track trackByFn($index, row)) {\n <tr\n [attr.data-testid]=\"getRowTestId(row, $index)\"\n class=\"h-10 min-h-10 max-h-11.25\"\n >\n @if (selectable) {\n <!-- Optional row selection checkbox -->\n <td\n class=\"border-b border-[#aedad8] px-3 py-0 align-middle text-center\"\n >\n <div class=\"flex h-full w-full items-center justify-center\">\n <ads-checkbox\n [checked]=\"isRowSelected(row)\"\n (checkedChange)=\"toggleRowSelection(row)\"\n ></ads-checkbox>\n </div>\n </td>\n }\n @for (cell of row.getVisibleCells(); track cell.id) {\n <td\n class=\"border-b border-[#aedad8] px-3 py-0 text-sm whitespace-pre-line wrap-break-word text-black-base\"\n [ngClass]=\"cellAlignmentClass(cell)\"\n [ngStyle]=\"allContentLeft ? { padding: '0' } : null\"\n >\n @if (isStateCell(cell)) {\n <!-- State-like values (status/active) are rendered with ads-state for a consistent visual token -->\n <ads-state\n [shape]=\"getStateStyle(cell).shape ?? statusShape\"\n [containerShapes]=\"\n getStateStyle(cell).shape ?? statusShape\n \"\n [borderColor]=\"getStateStyle(cell).borderColor\"\n [bgColor]=\"getStateStyle(cell).bgColor\"\n [textColor]=\"getStateStyle(cell).textColor\"\n [text]=\"getStateText(cell)\"\n [fullWidth]=\"getStateStyle(cell).fullWidth ?? false\"\n [boldText]=\"getStateStyle(cell).boldText ?? true\"\n ></ads-state>\n } @else {\n <!-- Generic cell rendering for non-state columns via TanStack flexRender output -->\n <ng-container\n *flexRender=\"\n cell.column.columnDef.cell;\n props: cell.getContext();\n let renderedCell\n \"\n >\n <div\n [innerHTML]=\"renderedCell\"\n [ngStyle]=\"\n allContentLeft ? { 'text-align': 'left' } : null\n \"\n ></div>\n </ng-container>\n }\n </td>\n }\n\n @if (showButtons && actionButtons.length > 0) {\n <!-- Optional row action buttons -->\n <td\n class=\"border-b border-[#aedad8] px-1 py-1 align-middle text-center whitespace-nowrap\"\n >\n <div\n class=\"flex w-full items-center justify-center gap-1 p-0\"\n >\n @for (button of actionButtons; track $index) {\n @if (\n !button.condition || button.condition(row.original)\n ) {\n <button\n nz-tooltip\n [nzTooltipTitle]=\"\n getTooltipText(button, row.original)\n \"\n ads-button\n type=\"button\"\n [onlyIconButton]=\"true\"\n color=\"text\"\n [attr.data-testid]=\"\n getActionButtonTestId(row, button, $index)\n \"\n [title]=\"getTooltipText(button, row.original)\"\n [disabled]=\"\n isActionButtonDisabled(button, row.original)\n \"\n (click)=\"button.callback(row.original)\"\n >\n <ads-icon\n [ngClass]=\"\n isActionButtonDisabled(button, row.original)\n ? 'text-neutral-disabled-text'\n : 'text-green-1'\n \"\n [iconName]=\"iconNameFor(button.icon)\"\n [size]=\"16\"\n ></ads-icon>\n </button>\n }\n }\n </div>\n </td>\n }\n </tr>\n }\n\n @if (isLoading && getRows().length > 0) {\n <tr class=\"absolute inset-0 z-10 block\">\n <td [attr.colspan]=\"getEmptyColspan()\" class=\"block h-full p-0\">\n <div\n class=\"flex h-full min-h-40 items-center justify-center rounded-b-2xl bg-white-base/45 backdrop-blur-sm\"\n aria-live=\"polite\"\n aria-busy=\"true\"\n >\n <span\n class=\"h-10 w-10 animate-spin rounded-full border-4 border-green-1/20 border-t-green-1\"\n aria-hidden=\"true\"\n ></span>\n <span class=\"sr-only\">Loading table data</span>\n </div>\n </td>\n </tr>\n }\n </tbody>\n </table>\n </div>\n\n <!-- Footer controls: page size selector, page navigation, and total record counter -->\n <div class=\"flex w-full flex-wrap items-center justify-end gap-4 py-2\">\n <div class=\"mr-auto flex items-center gap-2 text-sm text-green-1\">\n <span class=\"whitespace-nowrap font-medium\">Rows per page</span>\n <select\n class=\"h-8 cursor-pointer rounded border border-aqua-1 bg-white-base px-2 text-sm text-green-1 outline-none transition hover:border-green-1 focus:border-green-1 focus:ring-2 focus:ring-green-1/20\"\n [value]=\"pageSize\"\n (change)=\"onPageSizeChange($event)\"\n [attr.data-testid]=\"contentTestId + '-page-size-select'\"\n >\n <option value=\"10\">10</option>\n <option value=\"25\">25</option>\n <option value=\"50\">50</option>\n <option value=\"100\">100</option>\n </select>\n </div>\n\n <div class=\"flex w-fit items-center justify-center gap-1\">\n <button\n type=\"button\"\n class=\"inline-flex h-8 items-center justify-center gap-1 rounded px-3 text-sm font-medium text-neutral-disabled-text transition hover:text-green-1 disabled:cursor-default disabled:opacity-50 border-none outline-0 bg-transparent\"\n [disabled]=\"currentPage === 1\"\n (click)=\"previousPage()\"\n [attr.data-testid]=\"contentTestId + '-pagination-previous'\"\n >\n <span class=\"text-lg leading-none\">\u2039</span>\n Previous\n </button>\n\n <div class=\"flex items-center justify-center gap-1\">\n @for (page of getPageNumbers(); track $index) {\n @if (page === null) {\n <span\n class=\"inline-flex h-8 min-w-8 select-none items-center justify-center px-2 font-medium text-neutral-disabled-text\"\n >...</span\n >\n } @else {\n <button\n type=\"button\"\n class=\"inline-flex h-8 min-w-8 items-center justify-center rounded px-2 font-medium text-neutral-disabled-text transition hover:text-green-1 disabled:cursor-default disabled:opacity-50 outline-0 border-none\"\n [ngClass]=\"{\n 'bg-green-1 text-white-base hover:text-white-base':\n currentPage === page,\n 'bg-transparent': currentPage !== page,\n }\"\n [disabled]=\"false\"\n (click)=\"goToPage(page)\"\n [attr.data-testid]=\"contentTestId + '-pagination-page-' + page\"\n >\n {{ page }}\n </button>\n }\n }\n </div>\n\n <button\n type=\"button\"\n class=\"inline-flex h-8 items-center justify-center gap-1 rounded px-3 text-sm font-medium text-neutral-disabled-text transition hover:text-green-1 disabled:cursor-default disabled:opacity-50 border-none outline-0 bg-transparent\"\n [disabled]=\"currentPage === totalPages\"\n (click)=\"nextPage()\"\n [attr.data-testid]=\"contentTestId + '-pagination-next'\"\n >\n Next\n <span class=\"text-lg leading-none\">\u203A</span>\n </button>\n </div>\n\n @if (totalRegisters) {\n <div\n class=\"w-fit min-w-20 text-sm font-medium text-neutral-disabled-text\"\n [attr.data-testid]=\"contentTestId + '-pagination-info'\"\n >\n Total Records: {{ totalRegisters }}\n </div>\n }\n </div>\n </div>\n} @else {\n <!-- Empty state layout when there are no rows to display -->\n <div class=\"w-full overflow-x-auto\">\n <table\n [attr.data-testid]=\"contentTestId\"\n class=\"min-w-full table-fixed border-separate border-spacing-0\"\n >\n <thead class=\"bg-green-1 text-white-base\">\n <tr class=\"h-10 min-h-10 max-h-11.25\">\n @if (selectable) {\n <th\n class=\"h-10 min-h-10 max-h-11.25 w-10 px-3 text-center first:rounded-l-2xl\"\n ></th>\n }\n @for (column of getHeaderCells(); track column.id) {\n <th\n class=\"h-10 min-h-10 max-h-11.25 px-3 text-left font-medium first:rounded-l-2xl\"\n >\n {{ column.column.columnDef.header }}\n </th>\n }\n @if (showButtons) {\n <th\n class=\"h-10 min-h-10 max-h-11.25 px-3 text-center font-medium rounded-r-2xl\"\n >\n Options\n </th>\n }\n </tr>\n </thead>\n <tbody>\n <tr>\n <td [attr.colspan]=\"getEmptyColspan()\" class=\"py-2\">\n <div\n class=\"flex flex-col items-center justify-center gap-2 rounded-xl border border-dashed border-aqua-2 bg-aqua-5/40 px-6 py-5 text-center\"\n >\n <span class=\"text-base font-semibold text-green-1\"\n >No available data</span\n >\n <span class=\"text-sm text-neutral-disabled-text\"\n >No data to display right now.</span\n >\n </div>\n </td>\n </tr>\n </tbody>\n </table>\n </div>\n}\n", styles: [":host ::ng-deep .cdk-drag-preview{background-color:#014744!important;color:#fff!important;border-radius:1rem!important;border-right:1px solid rgba(255,255,255,.2)!important;box-shadow:0 12px 28px #01474447!important;overflow:hidden!important}:host ::ng-deep .cdk-drag-placeholder{opacity:0}:host ::ng-deep .cdk-drop-list-dragging th.cdk-drag:not(.cdk-drag-placeholder){transition:transform .22s cubic-bezier(.2,0,0,1)}:host ::ng-deep th.cdk-drag-animating{transition:transform .22s cubic-bezier(.2,0,0,1)}::ng-deep .cdk-drag-preview{background:#014743a9!important;color:#fff!important;box-shadow:none!important;border:none!important;border-radius:10rem!important}\n"] }]
|
|
4361
|
+
], template: "@if (getRows().length > 0 || isLoading) {\n <!-- Main table layout: data grid + footer pagination area -->\n <div\n class=\"flex w-full flex-col justify-between gap-4\"\n [ngClass]=\"{ 'min-h-[60vh]': minH }\"\n >\n <div class=\"relative min-h-40 w-full overflow-x-auto\">\n <table\n [attr.data-testid]=\"contentTestId\"\n class=\"min-w-full table-fixed border-separate border-spacing-0\"\n >\n <!-- Interactive header row: sorting, drag-and-drop, and column resizing -->\n <thead class=\"bg-green-1 text-white-base\">\n <tr\n cdkDropList\n cdkDropListOrientation=\"horizontal\"\n class=\"h-10 min-h-10 max-h-11.25\"\n (cdkDropListDropped)=\"drop($event)\"\n [ngStyle]=\"allContentLeft ? { 'text-align': 'left' } : null\"\n >\n @if (selectable) {\n <!-- Checkbox selection column header: select all rows -->\n <th\n class=\"relative h-10 min-h-10 max-h-11.25 w-10 px-3 text-center align-middle border-r border-white/20 first:rounded-l-2xl\"\n [attr.data-testid]=\"contentTestId + '-header-select-all'\"\n >\n <div class=\"flex h-full w-full items-center justify-center\">\n <ads-checkbox\n controlColor=\"white\"\n [checked]=\"isAllSelected()\"\n [indeterminate]=\"isSomeSelected() && !isAllSelected()\"\n (checkedChange)=\"toggleSelectAll()\"\n ></ads-checkbox>\n </div>\n </th>\n }\n @for (\n column of getHeaderCells();\n track column.id + \"-\" + headerRenderVersion\n ) {\n @if (isColumnSortable(column)) {\n @if (areColumnsDraggable) {\n <!-- Sortable + draggable header cell -->\n <th\n cdkDrag\n cdkDragLockAxis=\"x\"\n [ngStyle]=\"getColumnHeaderStyles(column)\"\n class=\"relative h-10 min-h-10 max-h-11.25 select-none border-r border-white/20 font-medium first:rounded-l-2xl last:rounded-r-2xl last:border-r-0 overflow-hidden cursor-grab active:cursor-grabbing\"\n [attr.data-testid]=\"getHeaderTestId(column)\"\n >\n <button\n type=\"button\"\n cdkDragHandle\n class=\"group flex h-full w-full cursor-pointer items-center gap-3 px-3 transition-colors duration-200 border-none outline-0 bg-transparent hover:bg-white/10\"\n [ngClass]=\"headerAlignmentClass(column)\"\n (click)=\"sort(column, $event)\"\n [title]=\"\n enableMultiSort ? 'Shift+click to add to sort' : null\n \"\n >\n <!-- When right-aligned, the sort indicator is shown before the header text -->\n @if (getSortEntry(column); as entry) {\n @if (isSortIconLeading(column)) {\n @if (multiSortCriteria.length > 1) {\n <span\n class=\"inline-flex h-4 min-w-4 items-center justify-center rounded-full bg-white/25 px-1 text-[0.65rem] font-bold text-white-base leading-px\"\n >\n {{ entry.index + 1 }}\n </span>\n }\n <ads-icon\n class=\"text-current transition-transform duration-200 -rotate-90\"\n [class.rotate-90]=\"entry.direction === 'ASC'\"\n [iconName]=\"'arrow_right'\"\n [size]=\"16\"\n ></ads-icon>\n }\n }\n <span class=\"truncate\">{{\n column.column.columnDef.header\n }}</span>\n <!-- For left/center aligned headers, the sort indicator is shown after the text -->\n @if (getSortEntry(column); as entry) {\n @if (!isSortIconLeading(column)) {\n @if (multiSortCriteria.length > 1) {\n <span\n class=\"inline-flex h-4 min-w-4 items-center justify-center rounded-full bg-white/25 px-1 text-[0.65rem] font-bold text-white-base leading-px\"\n >\n {{ entry.index + 1 }}\n </span>\n }\n <ads-icon\n class=\"text-current transition-transform duration-200 -rotate-90\"\n [class.rotate-90]=\"entry.direction === 'ASC'\"\n [iconName]=\"'arrow_right'\"\n [size]=\"16\"\n ></ads-icon>\n }\n }\n </button>\n <div\n class=\"absolute right-0 top-0 bottom-0 z-3 w-1 cursor-col-resize select-none bg-green-1 transition-colors hover:bg-green-1\"\n (mousedown)=\"startResize($event, column)\"\n (touchstart)=\"startResize($event, column)\"\n ></div>\n </th>\n } @else {\n <!-- Sortable header cell without drag-and-drop -->\n <th\n [ngStyle]=\"getColumnHeaderStyles(column)\"\n class=\"relative h-10 min-h-10 max-h-11.25 select-none border-r border-white/20 font-medium first:rounded-l-2xl last:rounded-r-2xl last:border-r-0\"\n [attr.data-testid]=\"getHeaderTestId(column)\"\n >\n <button\n type=\"button\"\n class=\"flex h-full w-full cursor-pointer items-center gap-3 px-3 transition-colors duration-200 hover:bg-white/10 bg-green-base\"\n [ngClass]=\"headerAlignmentClass(column)\"\n (click)=\"sort(column, $event)\"\n [title]=\"\n enableMultiSort ? 'Shift+click to add to sort' : null\n \"\n >\n @if (getSortEntry(column); as entry) {\n @if (isSortIconLeading(column)) {\n @if (multiSortCriteria.length > 1) {\n <span\n class=\"inline-flex h-4 min-w-4 items-center justify-center rounded-full bg-white/25 px-1 text-[0.65rem] font-bold leading-none text-white-base\"\n >\n {{ entry.index + 1 }}\n </span>\n }\n <ads-icon\n class=\"text-current transition-transform duration-200 -rotate-90\"\n [class.rotate-90]=\"entry.direction === 'ASC'\"\n [iconName]=\"'arrow_right'\"\n [size]=\"16\"\n ></ads-icon>\n }\n }\n <span class=\"truncate\">{{\n column.column.columnDef.header\n }}</span>\n @if (getSortEntry(column); as entry) {\n @if (!isSortIconLeading(column)) {\n @if (multiSortCriteria.length > 1) {\n <span\n class=\"inline-flex h-4 min-w-4 items-center justify-center rounded-full bg-white/25 px-1 text-[0.65rem] font-bold leading-none text-white-base\"\n >\n {{ entry.index + 1 }}\n </span>\n }\n <ads-icon\n class=\"text-current transition-transform duration-200 -rotate-90\"\n [class.rotate-90]=\"entry.direction === 'ASC'\"\n [iconName]=\"'arrow_right'\"\n [size]=\"16\"\n ></ads-icon>\n }\n }\n </button>\n <div\n class=\"absolute right-0 top-0 bottom-0 z-3 w-1 cursor-col-resize select-none bg-green-1 transition-colors hover:bg-green-1\"\n (mousedown)=\"startResize($event, column)\"\n (touchstart)=\"startResize($event, column)\"\n ></div>\n </th>\n }\n } @else {\n @if (areColumnsDraggable) {\n <!-- Non-sortable but draggable header cell -->\n <th\n cdkDrag\n cdkDragLockAxis=\"x\"\n [ngStyle]=\"getColumnHeaderStyles(column)\"\n class=\"relative h-10 min-h-10 max-h-11.25 select-none border-r border-white/20 font-medium first:rounded-l-2xl last:rounded-r-2xl last:border-r-0\"\n [attr.data-testid]=\"getHeaderTestId(column)\"\n >\n <div\n cdkDragHandle\n class=\"flex h-full w-full items-center px-3\"\n [ngClass]=\"headerAlignmentClass(column)\"\n >\n <span class=\"truncate\">{{\n column.column.columnDef.header\n }}</span>\n </div>\n <div\n class=\"absolute right-0 top-0 bottom-0 z-3 w-1 cursor-col-resize select-none bg-green-1 transition-colors hover:bg-green-1\"\n (mousedown)=\"startResize($event, column)\"\n (touchstart)=\"startResize($event, column)\"\n ></div>\n </th>\n } @else {\n <!-- Plain header cell (no sort, no drag) -->\n <th\n [ngStyle]=\"getColumnHeaderStyles(column)\"\n class=\"relative h-10 min-h-10 max-h-11.25 select-none border-r border-white/20 font-medium first:rounded-l-2xl last:rounded-r-2xl last:border-r-0\"\n [attr.data-testid]=\"getHeaderTestId(column)\"\n >\n <div\n class=\"flex h-full w-full items-center px-3\"\n [ngClass]=\"headerAlignmentClass(column)\"\n >\n <span class=\"truncate\">{{\n column.column.columnDef.header\n }}</span>\n </div>\n <div\n class=\"absolute right-0 top-0 bottom-0 z-3 w-1 cursor-col-resize select-none bg-green-1 transition-colors hover:bg-green-1\"\n (mousedown)=\"startResize($event, column)\"\n (touchstart)=\"startResize($event, column)\"\n ></div>\n </th>\n }\n }\n }\n\n @if (showButtons) {\n <!-- Optional actions column header -->\n <th\n [attr.data-testid]=\"contentTestId + '-header-actions'\"\n class=\"h-10 min-h-10 max-h-11.25 px-3 text-center font-medium whitespace-nowrap rounded-r-2xl\"\n [class.sticky-actions]=\"stickyActions\"\n [ngStyle]=\"{ width: '1%' }\"\n >\n Actions\n </th>\n }\n </tr>\n </thead>\n\n <tbody class=\"relative\">\n @if (isLoading && getRows().length === 0) {\n <tr>\n <td [attr.colspan]=\"getEmptyColspan()\" class=\"p-0\">\n <div\n class=\"flex min-h-40 items-center justify-center rounded-b-2xl bg-white-base/45 backdrop-blur-sm\"\n aria-live=\"polite\"\n aria-busy=\"true\"\n >\n <span\n class=\"h-10 w-10 animate-spin rounded-full border-4 border-green-1/20 border-t-green-1\"\n aria-hidden=\"true\"\n ></span>\n <span class=\"sr-only\">Loading table data</span>\n </div>\n </td>\n </tr>\n }\n\n <!-- Data rows -->\n @for (row of getRows(); track trackByFn($index, row)) {\n <tr\n [attr.data-testid]=\"getRowTestId(row, $index)\"\n class=\"h-10 min-h-10 max-h-11.25\"\n >\n @if (selectable) {\n <!-- Optional row selection checkbox -->\n <td\n class=\"border-b border-[#aedad8] px-3 py-0 align-middle text-center\"\n >\n <div class=\"flex h-full w-full items-center justify-center\">\n <ads-checkbox\n [checked]=\"isRowSelected(row)\"\n (checkedChange)=\"toggleRowSelection(row)\"\n ></ads-checkbox>\n </div>\n </td>\n }\n @for (cell of row.getVisibleCells(); track cell.id) {\n <td\n class=\"border-b border-[#aedad8] px-3 py-0 text-sm whitespace-pre-line wrap-break-word text-black-base\"\n [ngClass]=\"cellAlignmentClass(cell)\"\n [ngStyle]=\"allContentLeft ? { padding: '0' } : null\"\n >\n @if (isStateCell(cell)) {\n <!-- State-like values (status/active) are rendered with ads-state for a consistent visual token -->\n <ads-state\n [shape]=\"getStateStyle(cell).shape ?? statusShape\"\n [containerShapes]=\"\n getStateStyle(cell).shape ?? statusShape\n \"\n [borderColor]=\"getStateStyle(cell).borderColor\"\n [bgColor]=\"getStateStyle(cell).bgColor\"\n [textColor]=\"getStateStyle(cell).textColor\"\n [text]=\"getStateText(cell)\"\n [fullWidth]=\"getStateStyle(cell).fullWidth ?? false\"\n [boldText]=\"getStateStyle(cell).boldText ?? true\"\n ></ads-state>\n } @else {\n <!-- Generic cell rendering for non-state columns via TanStack flexRender output -->\n <ng-container\n *flexRender=\"\n cell.column.columnDef.cell;\n props: cell.getContext();\n let renderedCell\n \"\n >\n <div\n [innerHTML]=\"renderedCell\"\n [ngStyle]=\"\n allContentLeft ? { 'text-align': 'left' } : null\n \"\n ></div>\n </ng-container>\n }\n </td>\n }\n\n @if (showButtons && actionButtons.length > 0) {\n <!-- Optional row action buttons -->\n <td\n class=\"border-b border-[#aedad8] px-1 py-1 align-middle text-center whitespace-nowrap\"\n [class.sticky-actions]=\"stickyActions\"\n >\n <div\n class=\"flex w-full items-center justify-center gap-1 p-0\"\n >\n @for (button of actionButtons; track $index) {\n @if (\n !button.condition || button.condition(row.original)\n ) {\n <button\n nz-tooltip\n [nzTooltipTitle]=\"\n getTooltipText(button, row.original)\n \"\n ads-button\n type=\"button\"\n [onlyIconButton]=\"true\"\n color=\"text\"\n [attr.data-testid]=\"\n getActionButtonTestId(row, button, $index)\n \"\n [title]=\"getTooltipText(button, row.original)\"\n [disabled]=\"\n isActionButtonDisabled(button, row.original)\n \"\n (click)=\"button.callback(row.original)\"\n >\n <ads-icon\n [ngClass]=\"\n isActionButtonDisabled(button, row.original)\n ? 'text-neutral-disabled-text'\n : 'text-green-1'\n \"\n [iconName]=\"iconNameFor(button.icon)\"\n [size]=\"16\"\n ></ads-icon>\n </button>\n }\n }\n </div>\n </td>\n }\n </tr>\n }\n\n @if (isLoading && getRows().length > 0) {\n <tr class=\"absolute inset-0 z-10 block\">\n <td [attr.colspan]=\"getEmptyColspan()\" class=\"block h-full p-0\">\n <div\n class=\"flex h-full min-h-40 items-center justify-center rounded-b-2xl bg-white-base/45 backdrop-blur-sm\"\n aria-live=\"polite\"\n aria-busy=\"true\"\n >\n <span\n class=\"h-10 w-10 animate-spin rounded-full border-4 border-green-1/20 border-t-green-1\"\n aria-hidden=\"true\"\n ></span>\n <span class=\"sr-only\">Loading table data</span>\n </div>\n </td>\n </tr>\n }\n </tbody>\n </table>\n </div>\n\n <!-- Footer controls: page size selector, page navigation, and total record counter -->\n <div class=\"flex w-full flex-wrap items-center justify-end gap-4 py-2\">\n <div class=\"mr-auto flex items-center gap-2 text-sm text-green-1\">\n <span class=\"whitespace-nowrap font-medium\">Rows per page</span>\n <select\n class=\"h-8 cursor-pointer rounded border border-aqua-1 bg-white-base px-2 text-sm text-green-1 outline-none transition hover:border-green-1 focus:border-green-1 focus:ring-2 focus:ring-green-1/20\"\n [value]=\"pageSize\"\n (change)=\"onPageSizeChange($event)\"\n [attr.data-testid]=\"contentTestId + '-page-size-select'\"\n >\n <option value=\"10\">10</option>\n <option value=\"25\">25</option>\n <option value=\"50\">50</option>\n <option value=\"100\">100</option>\n </select>\n </div>\n\n <div class=\"flex w-fit items-center justify-center gap-1\">\n <button\n type=\"button\"\n class=\"inline-flex h-8 items-center justify-center gap-1 rounded px-3 text-sm font-medium text-neutral-disabled-text transition hover:text-green-1 disabled:cursor-default disabled:opacity-50 border-none outline-0 bg-transparent\"\n [disabled]=\"currentPage === 1\"\n (click)=\"previousPage()\"\n [attr.data-testid]=\"contentTestId + '-pagination-previous'\"\n >\n <span class=\"text-lg leading-none\">\u2039</span>\n Previous\n </button>\n\n <div class=\"flex items-center justify-center gap-1\">\n @for (page of getPageNumbers(); track $index) {\n @if (page === null) {\n <span\n class=\"inline-flex h-8 min-w-8 select-none items-center justify-center px-2 font-medium text-neutral-disabled-text\"\n >...</span\n >\n } @else {\n <button\n type=\"button\"\n class=\"inline-flex h-8 min-w-8 items-center justify-center rounded px-2 font-medium text-neutral-disabled-text transition hover:text-green-1 disabled:cursor-default disabled:opacity-50 outline-0 border-none\"\n [ngClass]=\"{\n 'bg-green-1 text-white-base hover:text-white-base':\n currentPage === page,\n 'bg-transparent': currentPage !== page,\n }\"\n [disabled]=\"false\"\n (click)=\"goToPage(page)\"\n [attr.data-testid]=\"contentTestId + '-pagination-page-' + page\"\n >\n {{ page }}\n </button>\n }\n }\n </div>\n\n <button\n type=\"button\"\n class=\"inline-flex h-8 items-center justify-center gap-1 rounded px-3 text-sm font-medium text-neutral-disabled-text transition hover:text-green-1 disabled:cursor-default disabled:opacity-50 border-none outline-0 bg-transparent\"\n [disabled]=\"currentPage === totalPages\"\n (click)=\"nextPage()\"\n [attr.data-testid]=\"contentTestId + '-pagination-next'\"\n >\n Next\n <span class=\"text-lg leading-none\">\u203A</span>\n </button>\n </div>\n\n @if (totalRegisters) {\n <div\n class=\"w-fit min-w-20 text-sm font-medium text-neutral-disabled-text\"\n [attr.data-testid]=\"contentTestId + '-pagination-info'\"\n >\n Total Records: {{ totalRegisters }}\n </div>\n }\n </div>\n </div>\n} @else {\n <!-- Empty state layout when there are no rows to display -->\n <div class=\"w-full overflow-x-auto\">\n <table\n [attr.data-testid]=\"contentTestId\"\n class=\"min-w-full table-fixed border-separate border-spacing-0\"\n >\n <thead class=\"bg-green-1 text-white-base\">\n <tr class=\"h-10 min-h-10 max-h-11.25\">\n @if (selectable) {\n <th\n class=\"h-10 min-h-10 max-h-11.25 w-10 px-3 text-center first:rounded-l-2xl\"\n ></th>\n }\n @for (column of getHeaderCells(); track column.id) {\n <th\n class=\"h-10 min-h-10 max-h-11.25 px-3 text-left font-medium first:rounded-l-2xl\"\n >\n {{ column.column.columnDef.header }}\n </th>\n }\n @if (showButtons) {\n <th\n class=\"h-10 min-h-10 max-h-11.25 px-3 text-center font-medium rounded-r-2xl\"\n >\n Options\n </th>\n }\n </tr>\n </thead>\n <tbody>\n <tr>\n <td [attr.colspan]=\"getEmptyColspan()\" class=\"py-2\">\n <div\n class=\"flex flex-col items-center justify-center gap-2 rounded-xl border border-dashed border-aqua-2 bg-aqua-5/40 px-6 py-5 text-center\"\n >\n <span class=\"text-base font-semibold text-green-1\"\n >No available data</span\n >\n <span class=\"text-sm text-neutral-disabled-text\"\n >No data to display right now.</span\n >\n </div>\n </td>\n </tr>\n </tbody>\n </table>\n </div>\n}\n", styles: [".sticky-actions{position:sticky;right:0;z-index:5}th.sticky-actions{background-color:var(--color-green-1, #014744)}td.sticky-actions{background-color:var(--ads-table-sticky-actions-bg, transparent)}:host ::ng-deep .cdk-drag-preview{background-color:#014744!important;color:#fff!important;border-radius:1rem!important;border-right:1px solid rgba(255,255,255,.2)!important;box-shadow:0 12px 28px #01474447!important;overflow:hidden!important}:host ::ng-deep .cdk-drag-placeholder{opacity:0}:host ::ng-deep .cdk-drop-list-dragging th.cdk-drag:not(.cdk-drag-placeholder){transition:transform .22s cubic-bezier(.2,0,0,1)}:host ::ng-deep th.cdk-drag-animating{transition:transform .22s cubic-bezier(.2,0,0,1)}::ng-deep .cdk-drag-preview{background:#014743a9!important;color:#fff!important;box-shadow:none!important;border:none!important;border-radius:10rem!important}\n"] }]
|
|
4344
4362
|
}], ctorParameters: () => [{ type: undefined, decorators: [{
|
|
4345
4363
|
type: Attribute,
|
|
4346
4364
|
args: ['data-testid']
|
|
@@ -4395,6 +4413,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.11", ngImpo
|
|
|
4395
4413
|
type: Input
|
|
4396
4414
|
}], selectable: [{
|
|
4397
4415
|
type: Input
|
|
4416
|
+
}], stickyActions: [{
|
|
4417
|
+
type: Input
|
|
4398
4418
|
}] } });
|
|
4399
4419
|
|
|
4400
4420
|
/**
|