yukit-web 0.8.2 → 0.8.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/fesm2022/yukit-web.mjs
CHANGED
|
@@ -534,7 +534,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImpo
|
|
|
534
534
|
args: [{}]
|
|
535
535
|
}], propDecorators: { autocomplete: [{ type: i0.Input, args: [{ isSignal: true, alias: "autocomplete", required: false }] }], name: [{ type: i0.Input, args: [{ isSignal: true, alias: "name", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], readonly: [{ type: i0.Input, args: [{ isSignal: true, alias: "readonly", required: false }] }], required: [{ type: i0.Input, args: [{ isSignal: true, alias: "required", required: false }] }], committed: [{ type: i0.Output, args: ["committed"] }] } });
|
|
536
536
|
|
|
537
|
-
const YUW_DEFAULT_PAGE_SIZE =
|
|
537
|
+
const YUW_DEFAULT_PAGE_SIZE = 15;
|
|
538
538
|
/** `pageIndex` returns to 0 whenever `pageSize` or any of `resetSignals` changes. */
|
|
539
539
|
function createPagination(pageSize, ...resetSignals) {
|
|
540
540
|
return linkedSignal(() => {
|
|
@@ -554,7 +554,7 @@ function debouncedSignal(source, ms) {
|
|
|
554
554
|
});
|
|
555
555
|
}
|
|
556
556
|
|
|
557
|
-
const PAGE_SIZES = [
|
|
557
|
+
const PAGE_SIZES = [100, 50, 30, 15];
|
|
558
558
|
const SEARCH_DEBOUNCE_MS = 300;
|
|
559
559
|
/**
|
|
560
560
|
* State of a list paged at the source and the query derived from it. Changing search, filters,
|
|
@@ -4518,7 +4518,7 @@ const DATATABLE_WRAP_CONTENT_CLASS = 'whitespace-normal max-w-0';
|
|
|
4518
4518
|
* - `emptyText`: Message shown when data is empty or filtered to nothing. User-facing text the
|
|
4519
4519
|
* consuming app is responsible for translating.
|
|
4520
4520
|
* - `loading`: Renders skeleton rows instead of data. The pagination footer stays visible (with
|
|
4521
|
-
* its buttons disabled) so the layout doesn't jump.
|
|
4521
|
+
* its buttons disabled) so the layout doesn't jump, and the header is inert: neither sorting nor select-all reacts.
|
|
4522
4522
|
* - `loadingRows`: Number of skeleton rows to show while `loading`. Default is `5`.
|
|
4523
4523
|
* - `previousPageLabel` (required): Accessible name for the footer's previous-page button.
|
|
4524
4524
|
* User-facing text the consuming app is responsible for translating.
|
|
@@ -4561,7 +4561,7 @@ const DATATABLE_WRAP_CONTENT_CLASS = 'whitespace-normal max-w-0';
|
|
|
4561
4561
|
* - `columnVisibility`: Two-way column visibility state (`ColumnVisibilityState`).
|
|
4562
4562
|
* - `rowSelection`: Two-way row selection state (`RowSelectionState`). It is cleared whenever `data` changes: TanStack
|
|
4563
4563
|
* keys it by row index, so a kept selection would point at whatever rows the new data put there.
|
|
4564
|
-
* - `pagination`: Two-way pagination state (`PaginationState`). Default is `{ pageIndex: 0, pageSize:
|
|
4564
|
+
* - `pagination`: Two-way pagination state (`PaginationState`). Default is `{ pageIndex: 0, pageSize: YUW_DEFAULT_PAGE_SIZE }`.
|
|
4565
4565
|
* - `totalItems`: Total row count across all pages, for server-side pagination where `data` holds
|
|
4566
4566
|
* only the current page. When set, pagination becomes manual — TanStack stops slicing `data`
|
|
4567
4567
|
* itself and `getPageCount()` is derived from this count instead of `data.length`. Leave unset
|
|
@@ -4631,7 +4631,7 @@ class YuwDatatableComponent {
|
|
|
4631
4631
|
this.loadingRows = input(5, { ...(ngDevMode ? { debugName: "loadingRows" } : /* istanbul ignore next */ {}), transform: numberAttribute });
|
|
4632
4632
|
this.nextPageLabel = input.required(...(ngDevMode ? [{ debugName: "nextPageLabel" }] : /* istanbul ignore next */ []));
|
|
4633
4633
|
this.paginated = input(false, { ...(ngDevMode ? { debugName: "paginated" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
4634
|
-
this.pagination = model({ pageIndex: 0, pageSize:
|
|
4634
|
+
this.pagination = model({ pageIndex: 0, pageSize: YUW_DEFAULT_PAGE_SIZE }, ...(ngDevMode ? [{ debugName: "pagination" }] : /* istanbul ignore next */ []));
|
|
4635
4635
|
this.paginationAriaLabel = input.required(...(ngDevMode ? [{ debugName: "paginationAriaLabel" }] : /* istanbul ignore next */ []));
|
|
4636
4636
|
this.paginationEllipsisSrText = input.required(...(ngDevMode ? [{ debugName: "paginationEllipsisSrText" }] : /* istanbul ignore next */ []));
|
|
4637
4637
|
this.previousPageLabel = input.required(...(ngDevMode ? [{ debugName: "previousPageLabel" }] : /* istanbul ignore next */ []));
|
|
@@ -4749,13 +4749,13 @@ class YuwDatatableComponent {
|
|
|
4749
4749
|
this._selectionData = data;
|
|
4750
4750
|
}
|
|
4751
4751
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: YuwDatatableComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
4752
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.22", type: YuwDatatableComponent, isStandalone: true, selector: "yuw-datatable", inputs: { appearance: { classPropertyName: "appearance", publicName: "appearance", isSignal: true, isRequired: false, transformFunction: null }, caption: { classPropertyName: "caption", publicName: "caption", isSignal: true, isRequired: false, transformFunction: null }, cellClass: { classPropertyName: "cellClass", publicName: "cellClass", isSignal: true, isRequired: false, transformFunction: null }, columnFilters: { classPropertyName: "columnFilters", publicName: "columnFilters", isSignal: true, isRequired: false, transformFunction: null }, columns: { classPropertyName: "columns", publicName: "columns", isSignal: true, isRequired: false, transformFunction: null }, columnVisibility: { classPropertyName: "columnVisibility", publicName: "columnVisibility", isSignal: true, isRequired: false, transformFunction: null }, data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: false, transformFunction: null }, emptyText: { classPropertyName: "emptyText", publicName: "emptyText", isSignal: true, isRequired: false, transformFunction: null }, loading: { classPropertyName: "loading", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null }, loadingRows: { classPropertyName: "loadingRows", publicName: "loadingRows", isSignal: true, isRequired: false, transformFunction: null }, nextPageLabel: { classPropertyName: "nextPageLabel", publicName: "nextPageLabel", isSignal: true, isRequired: true, transformFunction: null }, paginated: { classPropertyName: "paginated", publicName: "paginated", isSignal: true, isRequired: false, transformFunction: null }, pagination: { classPropertyName: "pagination", publicName: "pagination", isSignal: true, isRequired: false, transformFunction: null }, paginationAriaLabel: { classPropertyName: "paginationAriaLabel", publicName: "paginationAriaLabel", isSignal: true, isRequired: true, transformFunction: null }, paginationEllipsisSrText: { classPropertyName: "paginationEllipsisSrText", publicName: "paginationEllipsisSrText", isSignal: true, isRequired: true, transformFunction: null }, previousPageLabel: { classPropertyName: "previousPageLabel", publicName: "previousPageLabel", isSignal: true, isRequired: true, transformFunction: null }, rowClass: { classPropertyName: "rowClass", publicName: "rowClass", isSignal: true, isRequired: false, transformFunction: null }, rowSelection: { classPropertyName: "rowSelection", publicName: "rowSelection", isSignal: true, isRequired: false, transformFunction: null }, selectable: { classPropertyName: "selectable", publicName: "selectable", isSignal: true, isRequired: false, transformFunction: null }, sortable: { classPropertyName: "sortable", publicName: "sortable", isSignal: true, isRequired: false, transformFunction: null }, sorting: { classPropertyName: "sorting", publicName: "sorting", isSignal: true, isRequired: false, transformFunction: null }, tableClass: { classPropertyName: "tableClass", publicName: "tableClass", isSignal: true, isRequired: false, transformFunction: null }, totalItems: { classPropertyName: "totalItems", publicName: "totalItems", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { columnFilters: "columnFiltersChange", columnVisibility: "columnVisibilityChange", pagination: "paginationChange", rowSelection: "rowSelectionChange", sorting: "sortingChange", rowClicked: "rowClicked", selectedRowsChange: "selectedRowsChange" }, host: { classAttribute: "contents" }, providers: [provideIcons({ lucideChevronDown, lucideChevronUp, lucideChevronsUpDown })], queries: [{ propertyName: "customPagination", first: true, predicate: YuwDatatablePaginationDirective, descendants: true, isSignal: true }], viewQueries: [{ propertyName: "_table", first: true, predicate: ["tableElement"], descendants: true, isSignal: true }], ngImport: i0, template: "<div yuwTableContainer [class]=\"_containerClass()\">\n <table #tableElement yuwTable [class]=\"_tableClass()\">\n @if (caption()) {\n <caption yuwCaption>{{ caption() }}</caption>\n }\n\n <thead yuwTHead [class]=\"_headClass()\">\n @for (headerGroup of table.getHeaderGroups(); track headerGroup.id) {\n <tr yuwTr [class]=\"_rowClass()\">\n @for (header of headerGroup.headers; track header.id) {\n @let sorted = header.column.getIsSorted();\n @let headerClasses = _cellClasses().get(header.column.id);\n <th\n yuwTh\n scope=\"col\"\n [attr.colspan]=\"header.colSpan\"\n [attr.aria-sort]=\"sorted ? _ariaSort[sorted] : null\"\n [class]=\"headerClasses?.header\"\n >\n @if (!header.isPlaceholder) {\n @if (sortable() && header.column.getCanSort()) {\n <button\n type=\"button\"\n class=\"inline-flex items-center gap-1 select-none hover:text-foreground/80\"\n (click)=\"header.column.toggleSorting()\"\n >\n <ng-container\n *flexRender=\"header.column.columnDef.header; props: header.getContext(); let rendered\"\n >\n {{ rendered }}\n </ng-container>\n\n <ng-icon [name]=\"_sortIcon[sorted || 'none']\" class=\"shrink-0 text-xs\" aria-hidden=\"true\" />\n </button>\n } @else {\n <ng-container *flexRender=\"header.column.columnDef.header; props: header.getContext(); let rendered\">\n {{ rendered }}\n </ng-container>\n }\n }\n </th>\n }\n </tr>\n }\n </thead>\n\n <tbody yuwTBody>\n @if (loading()) {\n @for (row of _skeletonRows(); track row) {\n <tr yuwTr [class]=\"_rowClass()\">\n @for (column of table.getVisibleLeafColumns(); track column.id) {\n <td yuwTd [class]=\"_cellClasses().get(column.id)?.cell\">\n <span yuwSkeleton class=\"block h-4 w-full\"></span>\n </td>\n }\n </tr>\n }\n } @else if (_isEmpty()) {\n <tr yuwTr [class]=\"_rowClass()\">\n <td yuwTd [attr.colspan]=\"_columnCount()\" class=\"h-24 text-center text-muted-foreground\">\n {{ emptyText() ?? '' }}\n </td>\n </tr>\n } @else {\n @for (row of table.getRowModel().rows; track row.id) {\n <tr\n yuwTr\n [class]=\"_rowClasses().get(row.id)\"\n [attr.data-state]=\"row.getIsSelected() ? 'selected' : null\"\n role=\"button\"\n tabindex=\"0\"\n (click)=\"onRowClick(row.original)\"\n (keydown)=\"onRowKeydown($event, row.original)\"\n >\n @for (cell of row.getVisibleCells(); track cell.id) {\n <td yuwTd [class]=\"_cellClasses().get(cell.column.id)?.cell\">\n <ng-container *flexRender=\"cell.column.columnDef.cell; props: cell.getContext(); let rendered\">\n {{ rendered }}\n </ng-container>\n </td>\n }\n </tr>\n }\n }\n </tbody>\n </table>\n</div>\n\n@if (paginated()) {\n <div class=\"flex items-center flex-wrap justify-end gap-4 py-3 px-1 max-lg:justify-center\">\n @if (customPagination()) {\n <ng-content select=\"[yuwDatatablePagination]\" />\n }\n <yuw-pagination\n [page]=\"currentPage()\"\n (pageChange)=\"onPageChange($event)\"\n [totalPages]=\"table.getPageCount() || 1\"\n [previousLabel]=\"previousPageLabel()\"\n [nextLabel]=\"nextPageLabel()\"\n [ellipsisSrText]=\"paginationEllipsisSrText()\"\n [ariaLabel]=\"paginationAriaLabel()\"\n color=\"neutral\"\n size=\"icon-sm\"\n class=\"flex\"\n />\n </div>\n}\n", dependencies: [{ kind: "directive", type: YuwTableContainerDirective, selector: "[yuwTableContainer]" }, { kind: "directive", type: YuwTableDirective, selector: "[yuwTable]" }, { kind: "directive", type: YuwTHeadDirective, selector: "[yuwTHead]" }, { kind: "directive", type: YuwTBodyDirective, selector: "[yuwTBody]" }, { kind: "directive", type: YuwTrDirective, selector: "[yuwTr]" }, { kind: "directive", type: YuwThDirective, selector: "[yuwTh]" }, { kind: "directive", type: YuwTdDirective, selector: "[yuwTd]" }, { kind: "directive", type: YuwCaptionDirective, selector: "[yuwCaption]" }, { kind: "component", type: YuwPaginationComponent, selector: "yuw-pagination", inputs: ["ariaLabel", "color", "ellipsisSrText", "nextLabel", "page", "previousLabel", "size", "totalPages"], outputs: ["pageChange"] }, { kind: "directive", type: YuwSkeletonDirective, selector: "[yuwSkeleton]" }, { kind: "directive", type: FlexRenderDirective, selector: "ng-template[flexRender]", inputs: ["flexRender", "flexRenderProps", "flexRenderInjector"] }, { kind: "component", type: NgIcon, selector: "ng-icon", inputs: ["name", "svg", "size", "strokeWidth", "color"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
4752
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.22", type: YuwDatatableComponent, isStandalone: true, selector: "yuw-datatable", inputs: { appearance: { classPropertyName: "appearance", publicName: "appearance", isSignal: true, isRequired: false, transformFunction: null }, caption: { classPropertyName: "caption", publicName: "caption", isSignal: true, isRequired: false, transformFunction: null }, cellClass: { classPropertyName: "cellClass", publicName: "cellClass", isSignal: true, isRequired: false, transformFunction: null }, columnFilters: { classPropertyName: "columnFilters", publicName: "columnFilters", isSignal: true, isRequired: false, transformFunction: null }, columns: { classPropertyName: "columns", publicName: "columns", isSignal: true, isRequired: false, transformFunction: null }, columnVisibility: { classPropertyName: "columnVisibility", publicName: "columnVisibility", isSignal: true, isRequired: false, transformFunction: null }, data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: false, transformFunction: null }, emptyText: { classPropertyName: "emptyText", publicName: "emptyText", isSignal: true, isRequired: false, transformFunction: null }, loading: { classPropertyName: "loading", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null }, loadingRows: { classPropertyName: "loadingRows", publicName: "loadingRows", isSignal: true, isRequired: false, transformFunction: null }, nextPageLabel: { classPropertyName: "nextPageLabel", publicName: "nextPageLabel", isSignal: true, isRequired: true, transformFunction: null }, paginated: { classPropertyName: "paginated", publicName: "paginated", isSignal: true, isRequired: false, transformFunction: null }, pagination: { classPropertyName: "pagination", publicName: "pagination", isSignal: true, isRequired: false, transformFunction: null }, paginationAriaLabel: { classPropertyName: "paginationAriaLabel", publicName: "paginationAriaLabel", isSignal: true, isRequired: true, transformFunction: null }, paginationEllipsisSrText: { classPropertyName: "paginationEllipsisSrText", publicName: "paginationEllipsisSrText", isSignal: true, isRequired: true, transformFunction: null }, previousPageLabel: { classPropertyName: "previousPageLabel", publicName: "previousPageLabel", isSignal: true, isRequired: true, transformFunction: null }, rowClass: { classPropertyName: "rowClass", publicName: "rowClass", isSignal: true, isRequired: false, transformFunction: null }, rowSelection: { classPropertyName: "rowSelection", publicName: "rowSelection", isSignal: true, isRequired: false, transformFunction: null }, selectable: { classPropertyName: "selectable", publicName: "selectable", isSignal: true, isRequired: false, transformFunction: null }, sortable: { classPropertyName: "sortable", publicName: "sortable", isSignal: true, isRequired: false, transformFunction: null }, sorting: { classPropertyName: "sorting", publicName: "sorting", isSignal: true, isRequired: false, transformFunction: null }, tableClass: { classPropertyName: "tableClass", publicName: "tableClass", isSignal: true, isRequired: false, transformFunction: null }, totalItems: { classPropertyName: "totalItems", publicName: "totalItems", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { columnFilters: "columnFiltersChange", columnVisibility: "columnVisibilityChange", pagination: "paginationChange", rowSelection: "rowSelectionChange", sorting: "sortingChange", rowClicked: "rowClicked", selectedRowsChange: "selectedRowsChange" }, host: { classAttribute: "contents" }, providers: [provideIcons({ lucideChevronDown, lucideChevronUp, lucideChevronsUpDown })], queries: [{ propertyName: "customPagination", first: true, predicate: YuwDatatablePaginationDirective, descendants: true, isSignal: true }], viewQueries: [{ propertyName: "_table", first: true, predicate: ["tableElement"], descendants: true, isSignal: true }], ngImport: i0, template: "<div yuwTableContainer [class]=\"_containerClass()\">\n <table #tableElement yuwTable [class]=\"_tableClass()\">\n @if (caption()) {\n <caption yuwCaption>{{ caption() }}</caption>\n }\n\n <thead yuwTHead [class]=\"_headClass()\" [attr.inert]=\"loading() ? '' : null\">\n @for (headerGroup of table.getHeaderGroups(); track headerGroup.id) {\n <tr yuwTr [class]=\"_rowClass()\">\n @for (header of headerGroup.headers; track header.id) {\n @let sorted = header.column.getIsSorted();\n @let headerClasses = _cellClasses().get(header.column.id);\n <th\n yuwTh\n scope=\"col\"\n [attr.colspan]=\"header.colSpan\"\n [attr.aria-sort]=\"sorted ? _ariaSort[sorted] : null\"\n [class]=\"headerClasses?.header\"\n >\n @if (!header.isPlaceholder) {\n @if (sortable() && header.column.getCanSort()) {\n <button\n type=\"button\"\n class=\"inline-flex items-center gap-1 select-none hover:text-foreground/80\"\n (click)=\"header.column.toggleSorting()\"\n >\n <ng-container\n *flexRender=\"header.column.columnDef.header; props: header.getContext(); let rendered\"\n >\n {{ rendered }}\n </ng-container>\n\n <ng-icon [name]=\"_sortIcon[sorted || 'none']\" class=\"shrink-0 text-xs\" aria-hidden=\"true\" />\n </button>\n } @else {\n <ng-container *flexRender=\"header.column.columnDef.header; props: header.getContext(); let rendered\">\n {{ rendered }}\n </ng-container>\n }\n }\n </th>\n }\n </tr>\n }\n </thead>\n\n <tbody yuwTBody>\n @if (loading()) {\n @for (row of _skeletonRows(); track row) {\n <tr yuwTr [class]=\"_rowClass()\">\n @for (column of table.getVisibleLeafColumns(); track column.id) {\n <td yuwTd [class]=\"_cellClasses().get(column.id)?.cell\">\n <span yuwSkeleton class=\"block h-4 w-full\"></span>\n </td>\n }\n </tr>\n }\n } @else if (_isEmpty()) {\n <tr yuwTr [class]=\"_rowClass()\">\n <td yuwTd [attr.colspan]=\"_columnCount()\" class=\"h-24 text-center text-muted-foreground\">\n {{ emptyText() ?? '' }}\n </td>\n </tr>\n } @else {\n @for (row of table.getRowModel().rows; track row.id) {\n <tr\n yuwTr\n [class]=\"_rowClasses().get(row.id)\"\n [attr.data-state]=\"row.getIsSelected() ? 'selected' : null\"\n role=\"button\"\n tabindex=\"0\"\n (click)=\"onRowClick(row.original)\"\n (keydown)=\"onRowKeydown($event, row.original)\"\n >\n @for (cell of row.getVisibleCells(); track cell.id) {\n <td yuwTd [class]=\"_cellClasses().get(cell.column.id)?.cell\">\n <ng-container *flexRender=\"cell.column.columnDef.cell; props: cell.getContext(); let rendered\">\n {{ rendered }}\n </ng-container>\n </td>\n }\n </tr>\n }\n }\n </tbody>\n </table>\n</div>\n\n@if (paginated()) {\n <div class=\"flex items-center flex-wrap justify-end gap-4 py-3 px-1 max-lg:justify-center\">\n @if (customPagination()) {\n <ng-content select=\"[yuwDatatablePagination]\" />\n }\n <yuw-pagination\n [page]=\"currentPage()\"\n (pageChange)=\"onPageChange($event)\"\n [totalPages]=\"table.getPageCount() || 1\"\n [previousLabel]=\"previousPageLabel()\"\n [nextLabel]=\"nextPageLabel()\"\n [ellipsisSrText]=\"paginationEllipsisSrText()\"\n [ariaLabel]=\"paginationAriaLabel()\"\n color=\"neutral\"\n size=\"icon-sm\"\n class=\"flex\"\n />\n </div>\n}\n", dependencies: [{ kind: "directive", type: YuwTableContainerDirective, selector: "[yuwTableContainer]" }, { kind: "directive", type: YuwTableDirective, selector: "[yuwTable]" }, { kind: "directive", type: YuwTHeadDirective, selector: "[yuwTHead]" }, { kind: "directive", type: YuwTBodyDirective, selector: "[yuwTBody]" }, { kind: "directive", type: YuwTrDirective, selector: "[yuwTr]" }, { kind: "directive", type: YuwThDirective, selector: "[yuwTh]" }, { kind: "directive", type: YuwTdDirective, selector: "[yuwTd]" }, { kind: "directive", type: YuwCaptionDirective, selector: "[yuwCaption]" }, { kind: "component", type: YuwPaginationComponent, selector: "yuw-pagination", inputs: ["ariaLabel", "color", "ellipsisSrText", "nextLabel", "page", "previousLabel", "size", "totalPages"], outputs: ["pageChange"] }, { kind: "directive", type: YuwSkeletonDirective, selector: "[yuwSkeleton]" }, { kind: "directive", type: FlexRenderDirective, selector: "ng-template[flexRender]", inputs: ["flexRender", "flexRenderProps", "flexRenderInjector"] }, { kind: "component", type: NgIcon, selector: "ng-icon", inputs: ["name", "svg", "size", "strokeWidth", "color"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
4753
4753
|
}
|
|
4754
4754
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: YuwDatatableComponent, decorators: [{
|
|
4755
4755
|
type: Component,
|
|
4756
4756
|
args: [{ selector: 'yuw-datatable', imports: [...YuwTableImports, YuwPaginationComponent, YuwSkeletonDirective, FlexRenderDirective, NgIcon], providers: [provideIcons({ lucideChevronDown, lucideChevronUp, lucideChevronsUpDown })], host: {
|
|
4757
4757
|
class: 'contents',
|
|
4758
|
-
}, changeDetection: ChangeDetectionStrategy.OnPush, template: "<div yuwTableContainer [class]=\"_containerClass()\">\n <table #tableElement yuwTable [class]=\"_tableClass()\">\n @if (caption()) {\n <caption yuwCaption>{{ caption() }}</caption>\n }\n\n <thead yuwTHead [class]=\"_headClass()\">\n @for (headerGroup of table.getHeaderGroups(); track headerGroup.id) {\n <tr yuwTr [class]=\"_rowClass()\">\n @for (header of headerGroup.headers; track header.id) {\n @let sorted = header.column.getIsSorted();\n @let headerClasses = _cellClasses().get(header.column.id);\n <th\n yuwTh\n scope=\"col\"\n [attr.colspan]=\"header.colSpan\"\n [attr.aria-sort]=\"sorted ? _ariaSort[sorted] : null\"\n [class]=\"headerClasses?.header\"\n >\n @if (!header.isPlaceholder) {\n @if (sortable() && header.column.getCanSort()) {\n <button\n type=\"button\"\n class=\"inline-flex items-center gap-1 select-none hover:text-foreground/80\"\n (click)=\"header.column.toggleSorting()\"\n >\n <ng-container\n *flexRender=\"header.column.columnDef.header; props: header.getContext(); let rendered\"\n >\n {{ rendered }}\n </ng-container>\n\n <ng-icon [name]=\"_sortIcon[sorted || 'none']\" class=\"shrink-0 text-xs\" aria-hidden=\"true\" />\n </button>\n } @else {\n <ng-container *flexRender=\"header.column.columnDef.header; props: header.getContext(); let rendered\">\n {{ rendered }}\n </ng-container>\n }\n }\n </th>\n }\n </tr>\n }\n </thead>\n\n <tbody yuwTBody>\n @if (loading()) {\n @for (row of _skeletonRows(); track row) {\n <tr yuwTr [class]=\"_rowClass()\">\n @for (column of table.getVisibleLeafColumns(); track column.id) {\n <td yuwTd [class]=\"_cellClasses().get(column.id)?.cell\">\n <span yuwSkeleton class=\"block h-4 w-full\"></span>\n </td>\n }\n </tr>\n }\n } @else if (_isEmpty()) {\n <tr yuwTr [class]=\"_rowClass()\">\n <td yuwTd [attr.colspan]=\"_columnCount()\" class=\"h-24 text-center text-muted-foreground\">\n {{ emptyText() ?? '' }}\n </td>\n </tr>\n } @else {\n @for (row of table.getRowModel().rows; track row.id) {\n <tr\n yuwTr\n [class]=\"_rowClasses().get(row.id)\"\n [attr.data-state]=\"row.getIsSelected() ? 'selected' : null\"\n role=\"button\"\n tabindex=\"0\"\n (click)=\"onRowClick(row.original)\"\n (keydown)=\"onRowKeydown($event, row.original)\"\n >\n @for (cell of row.getVisibleCells(); track cell.id) {\n <td yuwTd [class]=\"_cellClasses().get(cell.column.id)?.cell\">\n <ng-container *flexRender=\"cell.column.columnDef.cell; props: cell.getContext(); let rendered\">\n {{ rendered }}\n </ng-container>\n </td>\n }\n </tr>\n }\n }\n </tbody>\n </table>\n</div>\n\n@if (paginated()) {\n <div class=\"flex items-center flex-wrap justify-end gap-4 py-3 px-1 max-lg:justify-center\">\n @if (customPagination()) {\n <ng-content select=\"[yuwDatatablePagination]\" />\n }\n <yuw-pagination\n [page]=\"currentPage()\"\n (pageChange)=\"onPageChange($event)\"\n [totalPages]=\"table.getPageCount() || 1\"\n [previousLabel]=\"previousPageLabel()\"\n [nextLabel]=\"nextPageLabel()\"\n [ellipsisSrText]=\"paginationEllipsisSrText()\"\n [ariaLabel]=\"paginationAriaLabel()\"\n color=\"neutral\"\n size=\"icon-sm\"\n class=\"flex\"\n />\n </div>\n}\n" }]
|
|
4758
|
+
}, changeDetection: ChangeDetectionStrategy.OnPush, template: "<div yuwTableContainer [class]=\"_containerClass()\">\n <table #tableElement yuwTable [class]=\"_tableClass()\">\n @if (caption()) {\n <caption yuwCaption>{{ caption() }}</caption>\n }\n\n <thead yuwTHead [class]=\"_headClass()\" [attr.inert]=\"loading() ? '' : null\">\n @for (headerGroup of table.getHeaderGroups(); track headerGroup.id) {\n <tr yuwTr [class]=\"_rowClass()\">\n @for (header of headerGroup.headers; track header.id) {\n @let sorted = header.column.getIsSorted();\n @let headerClasses = _cellClasses().get(header.column.id);\n <th\n yuwTh\n scope=\"col\"\n [attr.colspan]=\"header.colSpan\"\n [attr.aria-sort]=\"sorted ? _ariaSort[sorted] : null\"\n [class]=\"headerClasses?.header\"\n >\n @if (!header.isPlaceholder) {\n @if (sortable() && header.column.getCanSort()) {\n <button\n type=\"button\"\n class=\"inline-flex items-center gap-1 select-none hover:text-foreground/80\"\n (click)=\"header.column.toggleSorting()\"\n >\n <ng-container\n *flexRender=\"header.column.columnDef.header; props: header.getContext(); let rendered\"\n >\n {{ rendered }}\n </ng-container>\n\n <ng-icon [name]=\"_sortIcon[sorted || 'none']\" class=\"shrink-0 text-xs\" aria-hidden=\"true\" />\n </button>\n } @else {\n <ng-container *flexRender=\"header.column.columnDef.header; props: header.getContext(); let rendered\">\n {{ rendered }}\n </ng-container>\n }\n }\n </th>\n }\n </tr>\n }\n </thead>\n\n <tbody yuwTBody>\n @if (loading()) {\n @for (row of _skeletonRows(); track row) {\n <tr yuwTr [class]=\"_rowClass()\">\n @for (column of table.getVisibleLeafColumns(); track column.id) {\n <td yuwTd [class]=\"_cellClasses().get(column.id)?.cell\">\n <span yuwSkeleton class=\"block h-4 w-full\"></span>\n </td>\n }\n </tr>\n }\n } @else if (_isEmpty()) {\n <tr yuwTr [class]=\"_rowClass()\">\n <td yuwTd [attr.colspan]=\"_columnCount()\" class=\"h-24 text-center text-muted-foreground\">\n {{ emptyText() ?? '' }}\n </td>\n </tr>\n } @else {\n @for (row of table.getRowModel().rows; track row.id) {\n <tr\n yuwTr\n [class]=\"_rowClasses().get(row.id)\"\n [attr.data-state]=\"row.getIsSelected() ? 'selected' : null\"\n role=\"button\"\n tabindex=\"0\"\n (click)=\"onRowClick(row.original)\"\n (keydown)=\"onRowKeydown($event, row.original)\"\n >\n @for (cell of row.getVisibleCells(); track cell.id) {\n <td yuwTd [class]=\"_cellClasses().get(cell.column.id)?.cell\">\n <ng-container *flexRender=\"cell.column.columnDef.cell; props: cell.getContext(); let rendered\">\n {{ rendered }}\n </ng-container>\n </td>\n }\n </tr>\n }\n }\n </tbody>\n </table>\n</div>\n\n@if (paginated()) {\n <div class=\"flex items-center flex-wrap justify-end gap-4 py-3 px-1 max-lg:justify-center\">\n @if (customPagination()) {\n <ng-content select=\"[yuwDatatablePagination]\" />\n }\n <yuw-pagination\n [page]=\"currentPage()\"\n (pageChange)=\"onPageChange($event)\"\n [totalPages]=\"table.getPageCount() || 1\"\n [previousLabel]=\"previousPageLabel()\"\n [nextLabel]=\"nextPageLabel()\"\n [ellipsisSrText]=\"paginationEllipsisSrText()\"\n [ariaLabel]=\"paginationAriaLabel()\"\n color=\"neutral\"\n size=\"icon-sm\"\n class=\"flex\"\n />\n </div>\n}\n" }]
|
|
4759
4759
|
}], ctorParameters: () => [], propDecorators: { _table: [{ type: i0.ViewChild, args: ['tableElement', { isSignal: true }] }], customPagination: [{ type: i0.ContentChild, args: [i0.forwardRef(() => YuwDatatablePaginationDirective), { isSignal: true }] }], appearance: [{ type: i0.Input, args: [{ isSignal: true, alias: "appearance", required: false }] }], caption: [{ type: i0.Input, args: [{ isSignal: true, alias: "caption", required: false }] }], cellClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "cellClass", required: false }] }], columnFilters: [{ type: i0.Input, args: [{ isSignal: true, alias: "columnFilters", required: false }] }, { type: i0.Output, args: ["columnFiltersChange"] }], columns: [{ type: i0.Input, args: [{ isSignal: true, alias: "columns", required: false }] }], columnVisibility: [{ type: i0.Input, args: [{ isSignal: true, alias: "columnVisibility", required: false }] }, { type: i0.Output, args: ["columnVisibilityChange"] }], data: [{ type: i0.Input, args: [{ isSignal: true, alias: "data", required: false }] }], emptyText: [{ type: i0.Input, args: [{ isSignal: true, alias: "emptyText", required: false }] }], loading: [{ type: i0.Input, args: [{ isSignal: true, alias: "loading", required: false }] }], loadingRows: [{ type: i0.Input, args: [{ isSignal: true, alias: "loadingRows", required: false }] }], nextPageLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "nextPageLabel", required: true }] }], paginated: [{ type: i0.Input, args: [{ isSignal: true, alias: "paginated", required: false }] }], pagination: [{ type: i0.Input, args: [{ isSignal: true, alias: "pagination", required: false }] }, { type: i0.Output, args: ["paginationChange"] }], paginationAriaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "paginationAriaLabel", required: true }] }], paginationEllipsisSrText: [{ type: i0.Input, args: [{ isSignal: true, alias: "paginationEllipsisSrText", required: true }] }], previousPageLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "previousPageLabel", required: true }] }], rowClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "rowClass", required: false }] }], rowSelection: [{ type: i0.Input, args: [{ isSignal: true, alias: "rowSelection", required: false }] }, { type: i0.Output, args: ["rowSelectionChange"] }], selectable: [{ type: i0.Input, args: [{ isSignal: true, alias: "selectable", required: false }] }], sortable: [{ type: i0.Input, args: [{ isSignal: true, alias: "sortable", required: false }] }], sorting: [{ type: i0.Input, args: [{ isSignal: true, alias: "sorting", required: false }] }, { type: i0.Output, args: ["sortingChange"] }], tableClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "tableClass", required: false }] }], totalItems: [{ type: i0.Input, args: [{ isSignal: true, alias: "totalItems", required: false }] }], rowClicked: [{ type: i0.Output, args: ["rowClicked"] }], selectedRowsChange: [{ type: i0.Output, args: ["selectedRowsChange"] }] } });
|
|
4760
4760
|
|
|
4761
4761
|
/**
|
|
@@ -7646,25 +7646,29 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImpo
|
|
|
7646
7646
|
*
|
|
7647
7647
|
* Inputs:
|
|
7648
7648
|
* - `action` (required): Callback run on click. An input because `flexRenderComponent` does not subscribe outputs.
|
|
7649
|
+
* - `destructive`: Paints the icon in the destructive color, for an action that removes. Default is `false`.
|
|
7649
7650
|
* - `icon` (required): SVG markup of the icon.
|
|
7650
7651
|
* - `label` (required): Accessible name of the button. The consuming app translates it.
|
|
7651
7652
|
*/
|
|
7653
|
+
const DESTRUCTIVE_CLASS = 'text-destructive hover:bg-destructive/10 hover:text-destructive';
|
|
7652
7654
|
class YuwsIconActionCellComponent {
|
|
7653
7655
|
constructor() {
|
|
7654
7656
|
this.action = input.required(...(ngDevMode ? [{ debugName: "action" }] : /* istanbul ignore next */ []));
|
|
7657
|
+
this.destructive = input(false, ...(ngDevMode ? [{ debugName: "destructive" }] : /* istanbul ignore next */ []));
|
|
7655
7658
|
this.icon = input.required(...(ngDevMode ? [{ debugName: "icon" }] : /* istanbul ignore next */ []));
|
|
7656
7659
|
this.label = input.required(...(ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []));
|
|
7660
|
+
this.buttonClass = computed(() => (this.destructive() ? DESTRUCTIVE_CLASS : ''), ...(ngDevMode ? [{ debugName: "buttonClass" }] : /* istanbul ignore next */ []));
|
|
7657
7661
|
}
|
|
7658
7662
|
run() {
|
|
7659
7663
|
this.action()();
|
|
7660
7664
|
}
|
|
7661
7665
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: YuwsIconActionCellComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
7662
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.22", type: YuwsIconActionCellComponent, isStandalone: true, selector: "yuws-icon-action-cell", inputs: { action: { classPropertyName: "action", publicName: "action", isSignal: true, isRequired: true, transformFunction: null }, icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: true, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: true, transformFunction: null } }, host: { listeners: { "click": "$event.stopPropagation()" }, classAttribute: "yuw-reveal" }, ngImport: i0, template: "<yuw-button variant=\"ghost\" size=\"icon\" [ariaLabel]=\"label()\" (clicked)=\"run()\">\n <ng-icon [svg]=\"icon()\" size=\"16\" />\n</yuw-button>\n", dependencies: [{ kind: "component", type: NgIcon, selector: "ng-icon", inputs: ["name", "svg", "size", "strokeWidth", "color"] }, { kind: "component", type: YuwButtonComponent, selector: "yuw-button", inputs: ["animationDisabled", "ariaLabel", "color", "disabled", "href", "size", "target", "transparent", "type", "class", "variant", "yuwDropdownMenuAlign", "yuwDropdownMenuTrigger"], outputs: ["clicked"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
7666
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.22", type: YuwsIconActionCellComponent, isStandalone: true, selector: "yuws-icon-action-cell", inputs: { action: { classPropertyName: "action", publicName: "action", isSignal: true, isRequired: true, transformFunction: null }, destructive: { classPropertyName: "destructive", publicName: "destructive", isSignal: true, isRequired: false, transformFunction: null }, icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: true, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: true, transformFunction: null } }, host: { listeners: { "click": "$event.stopPropagation()" }, classAttribute: "yuw-reveal" }, ngImport: i0, template: "<yuw-button variant=\"ghost\" size=\"icon\" [class]=\"buttonClass()\" [ariaLabel]=\"label()\" (clicked)=\"run()\">\n <ng-icon [svg]=\"icon()\" size=\"16\" />\n</yuw-button>\n", dependencies: [{ kind: "component", type: NgIcon, selector: "ng-icon", inputs: ["name", "svg", "size", "strokeWidth", "color"] }, { kind: "component", type: YuwButtonComponent, selector: "yuw-button", inputs: ["animationDisabled", "ariaLabel", "color", "disabled", "href", "size", "target", "transparent", "type", "class", "variant", "yuwDropdownMenuAlign", "yuwDropdownMenuTrigger"], outputs: ["clicked"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
7663
7667
|
}
|
|
7664
7668
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: YuwsIconActionCellComponent, decorators: [{
|
|
7665
7669
|
type: Component,
|
|
7666
|
-
args: [{ selector: 'yuws-icon-action-cell', changeDetection: ChangeDetectionStrategy.OnPush, imports: [NgIcon, YuwButtonComponent], host: { class: 'yuw-reveal', '(click)': '$event.stopPropagation()' }, template: "<yuw-button variant=\"ghost\" size=\"icon\" [ariaLabel]=\"label()\" (clicked)=\"run()\">\n <ng-icon [svg]=\"icon()\" size=\"16\" />\n</yuw-button>\n" }]
|
|
7667
|
-
}], propDecorators: { action: [{ type: i0.Input, args: [{ isSignal: true, alias: "action", required: true }] }], icon: [{ type: i0.Input, args: [{ isSignal: true, alias: "icon", required: true }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: true }] }] } });
|
|
7670
|
+
args: [{ selector: 'yuws-icon-action-cell', changeDetection: ChangeDetectionStrategy.OnPush, imports: [NgIcon, YuwButtonComponent], host: { class: 'yuw-reveal', '(click)': '$event.stopPropagation()' }, template: "<yuw-button variant=\"ghost\" size=\"icon\" [class]=\"buttonClass()\" [ariaLabel]=\"label()\" (clicked)=\"run()\">\n <ng-icon [svg]=\"icon()\" size=\"16\" />\n</yuw-button>\n" }]
|
|
7671
|
+
}], propDecorators: { action: [{ type: i0.Input, args: [{ isSignal: true, alias: "action", required: true }] }], destructive: [{ type: i0.Input, args: [{ isSignal: true, alias: "destructive", required: false }] }], icon: [{ type: i0.Input, args: [{ isSignal: true, alias: "icon", required: true }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: true }] }] } });
|
|
7668
7672
|
|
|
7669
7673
|
const SIZE_CLASS = {
|
|
7670
7674
|
md: 'h-11.25 w-11.25',
|
|
@@ -7744,7 +7748,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImpo
|
|
|
7744
7748
|
const HOVER_CLOSE_DELAY_MS = 150;
|
|
7745
7749
|
/**
|
|
7746
7750
|
* Table cell with the first of a row's `items` and a `+N` badge counting the rest. The whole cell is the trigger of a
|
|
7747
|
-
* popover centred under it that lists every item; with a single item it is plain text with no popover.
|
|
7751
|
+
* popover centred under it that lists every item; with a single item it is plain text with no popover. The trigger's
|
|
7752
|
+
* `::after` stretches over the whole `<td>` (made `relative` by `theme/components/overflow-list-cell.css`), so a click
|
|
7753
|
+
* anywhere in the cell opens it and never reaches a clickable row.
|
|
7748
7754
|
*
|
|
7749
7755
|
* Only a click opens it. A mouse closes it on leaving the cell and the panel, after a short delay that lets the pointer
|
|
7750
7756
|
* cross between them; an outside click or Escape closes it too, which is the only way on touch. The host stops the
|
|
@@ -7782,7 +7788,7 @@ class YuwsOverflowListCellComponent {
|
|
|
7782
7788
|
this._closeTimer = undefined;
|
|
7783
7789
|
}
|
|
7784
7790
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: YuwsOverflowListCellComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
7785
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.22", type: YuwsOverflowListCellComponent, isStandalone: true, selector: "yuws-overflow-list-cell", inputs: { items: { classPropertyName: "items", publicName: "items", isSignal: true, isRequired: true, transformFunction: null } }, host: { listeners: { "click": "$event.stopPropagation()", "keydown": "$event.stopPropagation()" }, classAttribute: "flex min-w-0 [&_yuw-button]:w-full" }, ngImport: i0, template: "@if (overflows()) {\n <yuw-popover\n triggerTransparent\n triggerClass=\"h-auto w-full min-w-0 justify-start gap-2 px-0 py-0 font-normal\"\n panelClass=\"w-auto min-w-48 max-w-80 gap-0 p-1\"\n [open]=\"open()\"\n (openChange)=\"onOpenChange($event)\"\n (pointerenter)=\"onPointerEnter($event)\"\n (pointerleave)=\"onPointerLeave($event)\"\n >\n <ng-container yuwPopoverTrigger>\n <span class=\"min-w-0 truncate\">{{ first() }}</span>\n <yuw-badge variant=\"outline\" color=\"neutral\" class=\"shrink-0 rounded-full px-1.5 font-normal\">\n {{ hiddenCount() }}\n </yuw-badge>\n </ng-container>\n\n <ul class=\"flex flex-col\" (pointerenter)=\"onPointerEnter($event)\" (pointerleave)=\"onPointerLeave($event)\">\n @for (item of items(); track $index) {\n <li class=\"rounded-sm px-2 py-1.5\">{{ item }}</li>\n }\n </ul>\n </yuw-popover>\n} @else {\n <span class=\"min-w-0 truncate\">{{ first() }}</span>\n}\n", dependencies: [{ kind: "component", type: YuwBadgeComponent, selector: "yuw-badge", inputs: ["color", "dot", "removeLabel", "variant"], outputs: ["removed"] }, { kind: "component", type: YuwPopoverComponent, selector: "yuw-popover", inputs: ["align", "description", "offsetX", "open", "panelClass", "showTrigger", "sideOffset", "title", "triggerClass", "triggerColor", "triggerSize", "triggerTransparent", "triggerVariant"], outputs: ["openChange"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
7791
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.22", type: YuwsOverflowListCellComponent, isStandalone: true, selector: "yuws-overflow-list-cell", inputs: { items: { classPropertyName: "items", publicName: "items", isSignal: true, isRequired: true, transformFunction: null } }, host: { listeners: { "click": "$event.stopPropagation()", "keydown": "$event.stopPropagation()" }, classAttribute: "flex min-w-0 [&_yuw-button]:w-full" }, ngImport: i0, template: "@if (overflows()) {\n <yuw-popover\n triggerTransparent\n triggerClass=\"h-auto w-full min-w-0 justify-start gap-2 px-0 py-0 font-normal after:absolute after:inset-0 after:content-['']\"\n panelClass=\"w-auto min-w-48 max-w-80 gap-0 p-1\"\n [open]=\"open()\"\n (openChange)=\"onOpenChange($event)\"\n (pointerenter)=\"onPointerEnter($event)\"\n (pointerleave)=\"onPointerLeave($event)\"\n >\n <ng-container yuwPopoverTrigger>\n <span class=\"min-w-0 truncate\">{{ first() }}</span>\n <yuw-badge variant=\"outline\" color=\"neutral\" class=\"shrink-0 rounded-full px-1.5 font-normal\">\n {{ hiddenCount() }}\n </yuw-badge>\n </ng-container>\n\n <ul class=\"flex flex-col\" (pointerenter)=\"onPointerEnter($event)\" (pointerleave)=\"onPointerLeave($event)\">\n @for (item of items(); track $index) {\n <li class=\"rounded-sm px-2 py-1.5\">{{ item }}</li>\n }\n </ul>\n </yuw-popover>\n} @else {\n <span class=\"min-w-0 truncate\">{{ first() }}</span>\n}\n", dependencies: [{ kind: "component", type: YuwBadgeComponent, selector: "yuw-badge", inputs: ["color", "dot", "removeLabel", "variant"], outputs: ["removed"] }, { kind: "component", type: YuwPopoverComponent, selector: "yuw-popover", inputs: ["align", "description", "offsetX", "open", "panelClass", "showTrigger", "sideOffset", "title", "triggerClass", "triggerColor", "triggerSize", "triggerTransparent", "triggerVariant"], outputs: ["openChange"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
7786
7792
|
}
|
|
7787
7793
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: YuwsOverflowListCellComponent, decorators: [{
|
|
7788
7794
|
type: Component,
|
|
@@ -7790,13 +7796,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImpo
|
|
|
7790
7796
|
class: 'flex min-w-0 [&_yuw-button]:w-full',
|
|
7791
7797
|
'(click)': '$event.stopPropagation()',
|
|
7792
7798
|
'(keydown)': '$event.stopPropagation()',
|
|
7793
|
-
}, template: "@if (overflows()) {\n <yuw-popover\n triggerTransparent\n triggerClass=\"h-auto w-full min-w-0 justify-start gap-2 px-0 py-0 font-normal\"\n panelClass=\"w-auto min-w-48 max-w-80 gap-0 p-1\"\n [open]=\"open()\"\n (openChange)=\"onOpenChange($event)\"\n (pointerenter)=\"onPointerEnter($event)\"\n (pointerleave)=\"onPointerLeave($event)\"\n >\n <ng-container yuwPopoverTrigger>\n <span class=\"min-w-0 truncate\">{{ first() }}</span>\n <yuw-badge variant=\"outline\" color=\"neutral\" class=\"shrink-0 rounded-full px-1.5 font-normal\">\n {{ hiddenCount() }}\n </yuw-badge>\n </ng-container>\n\n <ul class=\"flex flex-col\" (pointerenter)=\"onPointerEnter($event)\" (pointerleave)=\"onPointerLeave($event)\">\n @for (item of items(); track $index) {\n <li class=\"rounded-sm px-2 py-1.5\">{{ item }}</li>\n }\n </ul>\n </yuw-popover>\n} @else {\n <span class=\"min-w-0 truncate\">{{ first() }}</span>\n}\n" }]
|
|
7799
|
+
}, template: "@if (overflows()) {\n <yuw-popover\n triggerTransparent\n triggerClass=\"h-auto w-full min-w-0 justify-start gap-2 px-0 py-0 font-normal after:absolute after:inset-0 after:content-['']\"\n panelClass=\"w-auto min-w-48 max-w-80 gap-0 p-1\"\n [open]=\"open()\"\n (openChange)=\"onOpenChange($event)\"\n (pointerenter)=\"onPointerEnter($event)\"\n (pointerleave)=\"onPointerLeave($event)\"\n >\n <ng-container yuwPopoverTrigger>\n <span class=\"min-w-0 truncate\">{{ first() }}</span>\n <yuw-badge variant=\"outline\" color=\"neutral\" class=\"shrink-0 rounded-full px-1.5 font-normal\">\n {{ hiddenCount() }}\n </yuw-badge>\n </ng-container>\n\n <ul class=\"flex flex-col\" (pointerenter)=\"onPointerEnter($event)\" (pointerleave)=\"onPointerLeave($event)\">\n @for (item of items(); track $index) {\n <li class=\"rounded-sm px-2 py-1.5\">{{ item }}</li>\n }\n </ul>\n </yuw-popover>\n} @else {\n <span class=\"min-w-0 truncate\">{{ first() }}</span>\n}\n" }]
|
|
7794
7800
|
}], ctorParameters: () => [], propDecorators: { items: [{ type: i0.Input, args: [{ isSignal: true, alias: "items", required: true }] }] } });
|
|
7795
7801
|
|
|
7796
7802
|
/**
|
|
7797
7803
|
* Selection checkbox of a row, hidden until the row is hovered or keyboard-focused like the button of
|
|
7798
7804
|
* `buildYuwsMenuActionsColumn`; touch devices keep it visible. Once any row is selected, `revealed` keeps every
|
|
7799
|
-
* checkbox of the table visible. Built by `buildYuwsSelectColumn
|
|
7805
|
+
* checkbox of the table visible. Built by `buildYuwsSelectColumn`, whose `relative` cell the host fills, so a click
|
|
7806
|
+
* anywhere in the cell toggles the row instead of opening it.
|
|
7800
7807
|
*
|
|
7801
7808
|
* Inputs:
|
|
7802
7809
|
* - `checked` (required): Whether the row is selected.
|
|
@@ -7812,12 +7819,20 @@ class YuwsSelectCellComponent {
|
|
|
7812
7819
|
this.onToggle = input.required(...(ngDevMode ? [{ debugName: "onToggle" }] : /* istanbul ignore next */ []));
|
|
7813
7820
|
this.revealed = input.required(...(ngDevMode ? [{ debugName: "revealed" }] : /* istanbul ignore next */ []));
|
|
7814
7821
|
}
|
|
7822
|
+
onCellClick(event) {
|
|
7823
|
+
event.stopPropagation();
|
|
7824
|
+
this.onToggle()();
|
|
7825
|
+
}
|
|
7815
7826
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: YuwsSelectCellComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
7816
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.22", type: YuwsSelectCellComponent, isStandalone: true, selector: "yuws-select-cell", inputs: { checked: { classPropertyName: "checked", publicName: "checked", isSignal: true, isRequired: true, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: true, transformFunction: null }, onToggle: { classPropertyName: "onToggle", publicName: "onToggle", isSignal: true, isRequired: true, transformFunction: null }, revealed: { classPropertyName: "revealed", publicName: "revealed", isSignal: true, isRequired: true, transformFunction: null } }, host: { properties: { "class.yuw-reveal": "!revealed()" }, classAttribute: "
|
|
7827
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.22", type: YuwsSelectCellComponent, isStandalone: true, selector: "yuws-select-cell", inputs: { checked: { classPropertyName: "checked", publicName: "checked", isSignal: true, isRequired: true, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: true, transformFunction: null }, onToggle: { classPropertyName: "onToggle", publicName: "onToggle", isSignal: true, isRequired: true, transformFunction: null }, revealed: { classPropertyName: "revealed", publicName: "revealed", isSignal: true, isRequired: true, transformFunction: null } }, host: { listeners: { "click": "onCellClick($event)" }, properties: { "class.yuw-reveal": "!revealed()" }, classAttribute: "absolute inset-0 flex cursor-pointer items-center px-2" }, ngImport: i0, template: "<yuw-datatable-row-select [checked]=\"checked()\" [label]=\"label()\" [onToggle]=\"onToggle()\" />\n", dependencies: [{ kind: "component", type: YuwDatatableRowSelect, selector: "yuw-datatable-row-select", inputs: ["checked", "indeterminate", "label", "onToggle"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
7817
7828
|
}
|
|
7818
7829
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: YuwsSelectCellComponent, decorators: [{
|
|
7819
7830
|
type: Component,
|
|
7820
|
-
args: [{ selector: 'yuws-select-cell', changeDetection: ChangeDetectionStrategy.OnPush, imports: [YuwDatatableRowSelect], host: {
|
|
7831
|
+
args: [{ selector: 'yuws-select-cell', changeDetection: ChangeDetectionStrategy.OnPush, imports: [YuwDatatableRowSelect], host: {
|
|
7832
|
+
class: 'absolute inset-0 flex cursor-pointer items-center px-2',
|
|
7833
|
+
'[class.yuw-reveal]': '!revealed()',
|
|
7834
|
+
'(click)': 'onCellClick($event)',
|
|
7835
|
+
}, template: "<yuw-datatable-row-select [checked]=\"checked()\" [label]=\"label()\" [onToggle]=\"onToggle()\" />\n" }]
|
|
7821
7836
|
}], propDecorators: { checked: [{ type: i0.Input, args: [{ isSignal: true, alias: "checked", required: true }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: true }] }], onToggle: [{ type: i0.Input, args: [{ isSignal: true, alias: "onToggle", required: true }] }], revealed: [{ type: i0.Input, args: [{ isSignal: true, alias: "revealed", required: true }] }] } });
|
|
7822
7837
|
|
|
7823
7838
|
/**
|
|
@@ -7943,7 +7958,12 @@ function buildYuwsIconActionColumn(column) {
|
|
|
7943
7958
|
meta: { align: 'end', cellClass: 'w-12' },
|
|
7944
7959
|
cell: ({ row }) => (column.visible?.(row.original) ?? true)
|
|
7945
7960
|
? flexRenderComponent(YuwsIconActionCellComponent, {
|
|
7946
|
-
inputs: {
|
|
7961
|
+
inputs: {
|
|
7962
|
+
icon: column.icon,
|
|
7963
|
+
label: column.label,
|
|
7964
|
+
destructive: column.destructive ?? false,
|
|
7965
|
+
action: () => column.onAction(row.original),
|
|
7966
|
+
},
|
|
7947
7967
|
})
|
|
7948
7968
|
: '',
|
|
7949
7969
|
};
|
|
@@ -7987,7 +8007,7 @@ function buildYuwsSelectColumn(labels) {
|
|
|
7987
8007
|
},
|
|
7988
8008
|
enableSorting: false,
|
|
7989
8009
|
enableHiding: false,
|
|
7990
|
-
meta: { cellClass: 'w-
|
|
8010
|
+
meta: { cellClass: 'relative w-12' },
|
|
7991
8011
|
cell: ({ row, table }) => flexRenderComponent(YuwsSelectCellComponent, {
|
|
7992
8012
|
inputs: {
|
|
7993
8013
|
checked: row.getIsSelected(),
|