@seniorsistemas/scala-ng 2.2.0 → 2.4.0-beta.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.
- package/README.md +2 -0
- package/esm2022/table/public-api.mjs +1 -1
- package/esm2022/table/src/components/actions-cell/table-actions-cell.component.mjs +2 -1
- package/esm2022/table/src/table/table.component.mjs +20 -5
- package/esm2022/table/src/table/table.models.mjs +1 -1
- package/fesm2022/{seniorsistemas-scala-ng-table-table-actions-cell.component-D6ffnUl1.mjs → seniorsistemas-scala-ng-table-table-actions-cell.component-C7ZnqPt9.mjs} +2 -1
- package/fesm2022/seniorsistemas-scala-ng-table-table-actions-cell.component-C7ZnqPt9.mjs.map +1 -0
- package/fesm2022/seniorsistemas-scala-ng-table.mjs +20 -5
- package/fesm2022/seniorsistemas-scala-ng-table.mjs.map +1 -1
- package/package.json +1 -1
- package/table/README.md +51 -24
- package/table/public-api.d.ts +1 -1
- package/table/src/table/table.component.d.ts +9 -3
- package/table/src/table/table.models.d.ts +13 -0
- package/fesm2022/seniorsistemas-scala-ng-table-table-actions-cell.component-D6ffnUl1.mjs.map +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export {};
|
|
2
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidGFibGUubW9kZWxzLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vcHJvamVjdHMvc2NhbGEtbmcvdGFibGUvc3JjL3RhYmxlL3RhYmxlLm1vZGVscy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiIiwic291cmNlc0NvbnRlbnQiOlsiZXhwb3J0IGludGVyZmFjZSBUYWJsZUxhenlMb2FkRXZlbnQ8VD4ge1xuICBzb3J0RmllbGQ/OiBrZXlvZiBUO1xuICBzb3J0T3JkZXI/OiBcImFzY1wiIHwgXCJkZXNjXCI7XG4gIGZpbHRlc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X0=
|
|
@@ -26,6 +26,7 @@ class SdsTableActionsCellComponent {
|
|
|
26
26
|
menuItems = computed(() => this.visibleActions().map((action) => ({
|
|
27
27
|
label: action.label,
|
|
28
28
|
icon: action.icon,
|
|
29
|
+
destructive: action.destructive ?? false,
|
|
29
30
|
disabled: action.disabled?.(this.row()) ?? false,
|
|
30
31
|
command: () => action.onClick(this.row()),
|
|
31
32
|
})));
|
|
@@ -41,4 +42,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImpo
|
|
|
41
42
|
}] });
|
|
42
43
|
|
|
43
44
|
export { SdsTableActionsCellComponent, TABLE_ACTIONS_MAX_INLINE };
|
|
44
|
-
//# sourceMappingURL=seniorsistemas-scala-ng-table-table-actions-cell.component-
|
|
45
|
+
//# sourceMappingURL=seniorsistemas-scala-ng-table-table-actions-cell.component-C7ZnqPt9.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"seniorsistemas-scala-ng-table-table-actions-cell.component-C7ZnqPt9.mjs","sources":["../../projects/scala-ng/table/src/components/actions-cell/table-actions-cell.component.ts","../../projects/scala-ng/table/src/components/actions-cell/table-actions-cell.component.html"],"sourcesContent":["import { Component, computed, input } from \"@angular/core\";\nimport { TranslatePipe } from \"@ngx-translate/core\";\nimport { SdsButtonComponent } from \"@seniorsistemas/scala-ng/button\";\nimport {\n SdsTieredMenuDirective,\n type SdsTieredMenuItem,\n} from \"@seniorsistemas/scala-ng/tiered-menu\";\nimport { SdsTooltipDirective } from \"@seniorsistemas/scala-ng/tooltip\";\nimport type { ActionButton } from \"../../table/table.models\";\n\nexport const TABLE_ACTIONS_MAX_INLINE = 3;\n\n@Component({\n selector: \"sds-table-actions-cell\",\n standalone: true,\n imports: [SdsButtonComponent, SdsTieredMenuDirective, SdsTooltipDirective, TranslatePipe],\n templateUrl: \"./table-actions-cell.component.html\",\n host: { class: \"flex items-center justify-end gap-space-0-50\" },\n})\nexport class SdsTableActionsCellComponent<T> {\n readonly actions = input.required<ActionButton<T>[]>();\n readonly row = input.required<T>();\n\n // Destructive actions go last, preserving the declared order otherwise.\n protected readonly visibleActions = computed<ActionButton<T>[]>(() => {\n const visible = this.actions().filter((action) => action.visible?.(this.row()) ?? true);\n return [\n ...visible.filter((action) => !action.destructive),\n ...visible.filter((action) => action.destructive),\n ];\n });\n\n // Inline buttons show only the icon, so an action without one would render as an empty button.\n protected readonly isInline = computed(() => {\n const visibleActions = this.visibleActions();\n return (\n visibleActions.length <= TABLE_ACTIONS_MAX_INLINE &&\n visibleActions.every((action) => !!action.icon)\n );\n });\n\n protected readonly menuItems = computed<SdsTieredMenuItem[]>(() =>\n this.visibleActions().map((action) => ({\n label: action.label,\n icon: action.icon,\n destructive: action.destructive ?? false,\n disabled: action.disabled?.(this.row()) ?? false,\n command: () => action.onClick(this.row()),\n })),\n );\n\n protected isDisabled(action: ActionButton<T>): boolean {\n return action.disabled?.(this.row()) ?? false;\n }\n}\n","@if (isInline()) {\n @for (action of visibleActions(); track action.label) {\n <button\n sdsButton\n type=\"ghost\"\n size=\"small\"\n class=\"!w-8 !p-0\"\n [destructive]=\"!!action.destructive\"\n [disabled]=\"isDisabled(action)\"\n [attr.aria-label]=\"action.label\"\n [sdsTooltip]=\"action.label\"\n (click)=\"action.onClick(row())\"\n >\n <i\n sdsLeadingIcon\n [class]=\"action.icon\"\n aria-hidden=\"true\"\n ></i>\n </button>\n }\n} @else {\n <button\n sdsButton\n type=\"ghost\"\n size=\"small\"\n class=\"!w-8 !p-0\"\n [sdsTieredMenu]=\"menuItems()\"\n [attr.aria-label]=\"'platform.scala-ng.table_actions_trigger_label' | translate\"\n [sdsTooltip]=\"'platform.scala-ng.table_actions_trigger_label' | translate\"\n >\n <i\n sdsLeadingIcon\n class=\"fa-solid fa-ellipsis\"\n aria-hidden=\"true\"\n ></i>\n </button>\n}\n"],"names":[],"mappings":";;;;;;;AAUO,MAAM,wBAAwB,GAAG,EAAE;MAS7B,4BAA4B,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AAA,EAAA,qBAAA,EAAA,wBAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,MAAA,EAAA,IAAA,EAAE,aAAa,EAAA,IAAA,EAAA,WAAA,EAAA,CAAA,EAAA,CAAA,CAAA;;4FAI7E,4BAA4B,EAAA,UAAA,EAAA,CAAA;kBAPxC,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,wBAAwB,cACtB,IAAI,EAAA,OAAA,EACP,CAAC,kBAAkB,EAAE,sBAAsB,EAAE,mBAAmB,EAAE,aAAa,CAAC,EAAA,IAAA,EAEnF,EAAE,KAAK,EAAE,8CAA8C,EAAE,EAAA,QAAA,EAAA,k8BAAA,EAAA,CAAA;;;;;"}
|
|
@@ -560,8 +560,23 @@ class SdsTableComponent {
|
|
|
560
560
|
toolbarSearch = output();
|
|
561
561
|
/** Exibe o `sds-paginator` abaixo da tabela e passa a incluir `first`/`rows`/`page` no `lazyLoad`. */
|
|
562
562
|
paginator = input(false);
|
|
563
|
-
/**
|
|
563
|
+
/**
|
|
564
|
+
* Opções exibidas no seletor "Itens por página" do paginator.
|
|
565
|
+
* @deprecated Use `paginatorConfig.pageSizeOptions`, que tem prioridade quando os dois são informados.
|
|
566
|
+
*/
|
|
564
567
|
pageSizeOptions = input([10, 25, 50, 100]);
|
|
568
|
+
/** Opções do paginator: itens por página e quais partes dele são exibidas. */
|
|
569
|
+
paginatorConfig = input({});
|
|
570
|
+
resolvedPaginatorConfig = computed(() => {
|
|
571
|
+
const config = this.paginatorConfig();
|
|
572
|
+
return {
|
|
573
|
+
pageSizeOptions: config.pageSizeOptions ?? this.pageSizeOptions(),
|
|
574
|
+
showPageSize: config.showPageSize ?? true,
|
|
575
|
+
showJumpToPage: config.showJumpToPage ?? true,
|
|
576
|
+
showCounter: config.showCounter ?? true,
|
|
577
|
+
showPageIndicator: config.showPageIndicator ?? true,
|
|
578
|
+
};
|
|
579
|
+
});
|
|
565
580
|
skeletonRows = Array.from({ length: SKELETON_ROW_COUNT });
|
|
566
581
|
radioGroupName = `sds-table-radio-${SdsTableComponent._idCounter++}`;
|
|
567
582
|
activeSort = signal(null);
|
|
@@ -580,7 +595,7 @@ class SdsTableComponent {
|
|
|
580
595
|
if (override !== null) {
|
|
581
596
|
return override;
|
|
582
597
|
}
|
|
583
|
-
const options = this.
|
|
598
|
+
const options = this.resolvedPaginatorConfig().pageSizeOptions;
|
|
584
599
|
return options.length === 0 || options.includes(DEFAULT_PAGE_SIZE)
|
|
585
600
|
? DEFAULT_PAGE_SIZE
|
|
586
601
|
: options[0];
|
|
@@ -926,9 +941,9 @@ class SdsTableComponent {
|
|
|
926
941
|
});
|
|
927
942
|
}
|
|
928
943
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: SdsTableComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
929
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", type: SdsTableComponent, isStandalone: true, selector: "sds-table", inputs: { headers: { classPropertyName: "headers", publicName: "headers", isSignal: true, isRequired: true, transformFunction: null }, data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: true, transformFunction: null }, lazy: { classPropertyName: "lazy", publicName: "lazy", isSignal: true, isRequired: false, transformFunction: null }, loading: { classPropertyName: "loading", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null }, emptyHeading: { classPropertyName: "emptyHeading", publicName: "emptyHeading", isSignal: true, isRequired: false, transformFunction: null }, emptyDescription: { classPropertyName: "emptyDescription", publicName: "emptyDescription", isSignal: true, isRequired: false, transformFunction: null }, error: { classPropertyName: "error", publicName: "error", isSignal: true, isRequired: false, transformFunction: null }, actions: { classPropertyName: "actions", publicName: "actions", isSignal: true, isRequired: false, transformFunction: null }, dataKey: { classPropertyName: "dataKey", publicName: "dataKey", isSignal: true, isRequired: false, transformFunction: null }, selectionMode: { classPropertyName: "selectionMode", publicName: "selectionMode", isSignal: true, isRequired: false, transformFunction: null }, selectedKeys: { classPropertyName: "selectedKeys", publicName: "selectedKeys", isSignal: true, isRequired: false, transformFunction: null }, allSelected: { classPropertyName: "allSelected", publicName: "allSelected", isSignal: true, isRequired: false, transformFunction: null }, totalRecords: { classPropertyName: "totalRecords", publicName: "totalRecords", isSignal: true, isRequired: false, transformFunction: null }, expandedKeys: { classPropertyName: "expandedKeys", publicName: "expandedKeys", isSignal: true, isRequired: false, transformFunction: null }, isRowExpandable: { classPropertyName: "isRowExpandable", publicName: "isRowExpandable", isSignal: true, isRequired: false, transformFunction: null }, groupBy: { classPropertyName: "groupBy", publicName: "groupBy", isSignal: true, isRequired: false, transformFunction: null }, zebra: { classPropertyName: "zebra", publicName: "zebra", isSignal: true, isRequired: false, transformFunction: null }, reorderable: { classPropertyName: "reorderable", publicName: "reorderable", isSignal: true, isRequired: false, transformFunction: null }, toolbar: { classPropertyName: "toolbar", publicName: "toolbar", isSignal: true, isRequired: false, transformFunction: null }, paginator: { classPropertyName: "paginator", publicName: "paginator", isSignal: true, isRequired: false, transformFunction: null }, pageSizeOptions: { classPropertyName: "pageSizeOptions", publicName: "pageSizeOptions", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { lazyLoad: "lazyLoad", selectedKeys: "selectedKeysChange", allSelected: "allSelectedChange", expandedKeys: "expandedKeysChange", rowReorder: "rowReorder", toolbarSearch: "toolbarSearch" }, queries: [{ propertyName: "rowDetailTemplate", first: true, predicate: ["rowDetail"], descendants: true, isSignal: true }], ngImport: i0, template: "<div class=\"flex w-full flex-col gap-space-2\">\n @if (toolbar(); as toolbarConfig) {\n <div [hidden]=\"!hasToolbarContent()\">\n @defer (on idle; prefetch on immediate) {\n <sds-table-toolbar\n [config]=\"toolbarConfig\"\n [mode]=\"toolbarMode()\"\n [selectedCount]=\"selectedKeys().size\"\n [allowSelectAllMatching]=\"selectionMode() === 'multiple'\"\n [totalRecords]=\"totalRecords() ?? rows().length\"\n [searchValue]=\"searchValue()\"\n (searchChange)=\"_onToolbarSearch($event)\"\n (filterToggle)=\"_onFilterToggle()\"\n (selectAllMatching)=\"_onSelectAllMatching()\"\n (clearSelection)=\"_onClearSelection()\"\n />\n } @placeholder {\n <div class=\"h-[56px]\"></div>\n }\n </div>\n }\n\n <div sdsTableContainer>\n <div class=\"overflow-x-auto\">\n <table sdsTableGrid>\n <colgroup>\n @if (hasSelectionColumn()) {\n <col class=\"w-[48px]\" />\n }\n @if (hasExpandColumn()) {\n <col class=\"w-[40px]\" />\n }\n @for (header of headers(); track header.field) {\n <col />\n }\n @if (hasActionsColumn()) {\n <col sdsTableActionsColumn />\n }\n </colgroup>\n @if (showHeader()) {\n <thead>\n <tr sdsTableHeaderRow>\n @if (hasSelectionColumn()) {\n <th sdsTableHeaderCell>\n @if (selectionMode() === \"multiple\") {\n <div class=\"flex items-center justify-center\">\n <sds-table-selection-cell\n mode=\"checkbox\"\n [label]=\"'platform.scala-ng.table_selection_select_all_label' | translate\"\n [checked]=\"headerSelectionState() === 'checked'\"\n [indeterminate]=\"headerSelectionState() === 'indeterminate'\"\n (checkedChange)=\"$event ? _onSelectAllChecked() : _onSelectAllUnchecked()\"\n />\n </div>\n }\n </th>\n }\n @if (hasExpandColumn()) {\n <th sdsTableHeaderCell>\n <div class=\"flex items-center justify-center\">\n <sds-table-expand-cell\n [expanded]=\"allExpanded()\"\n [label]=\"\n (allExpanded()\n ? 'platform.scala-ng.table_collapse_all_label'\n : 'platform.scala-ng.table_expand_all_label'\n ) | translate\n \"\n (toggled)=\"_onExpandAllToggle()\"\n />\n </div>\n </th>\n }\n <!-- 160px: minimum column width that keeps a label + sort icon readable before the table scrolls horizontally. -->\n @for (header of tableHeaders(); track header.field) {\n <th\n sdsTableHeaderCell\n scope=\"col\"\n class=\"min-w-[160px]\"\n [sortable]=\"header.sortable\"\n [textAlign]=\"header.textAlign\"\n [attr.aria-sort]=\"_ariaSortFor($any(header))\"\n [attr.tabindex]=\"header.sortable ? 0 : null\"\n (click)=\"_onHeaderClick($any(header))\"\n (keydown)=\"_onHeaderKeydown($event, $any(header))\"\n >\n <div\n class=\"flex min-w-0 items-center\"\n [class.justify-end]=\"header.textAlign === 'right'\"\n [class.justify-center]=\"header.textAlign === 'center'\"\n >\n <span class=\"truncate\">{{ header.label }}</span>\n @if (header.sortable) {\n <i\n class=\"fa-solid ml-space-0-50 shrink-0\"\n [class]=\"_sortIconFor($any(header))\"\n aria-hidden=\"true\"\n ></i>\n }\n </div>\n </th>\n }\n @if (hasActionsColumn()) {\n <th\n sdsTableHeaderCell\n scope=\"col\"\n >\n <span class=\"sr-only\">\n {{ \"platform.scala-ng.table_actions_column_label\" | translate }}\n </span>\n </th>\n }\n </tr>\n @if (showFilterRow()) {\n @defer (on idle; prefetch on immediate) {\n <tr\n sds-table-filter-row\n [headers]=\"headers()\"\n [hasSelectionColumn]=\"hasSelectionColumn()\"\n [hasExpandColumn]=\"hasExpandColumn()\"\n [hasActionsColumn]=\"hasActionsColumn()\"\n [values]=\"filterValues()\"\n (valueChange)=\"_onFilterValueChange($event.field, $event.value)\"\n ></tr>\n } @placeholder {\n <tr>\n <td\n class=\"h-[56px]\"\n [attr.colspan]=\"totalColumnCount()\"\n ></td>\n </tr>\n }\n }\n </thead>\n }\n <tbody\n sdsTableBody\n cdkDropList\n (cdkDropListDropped)=\"_onDrop($event)\"\n >\n @switch (state()) {\n @case (\"skeleton\") {\n <tr>\n <td\n class=\"p-0\"\n [attr.colspan]=\"totalColumnCount()\"\n >\n @for (skeletonRow of skeletonRows; track $index) {\n <div\n aria-hidden=\"true\"\n class=\"flex h-[48px] items-center gap-space-2 overflow-hidden px-space-1-5 shadow-[inset_0_-1px_0_0_var(--sds-color-border-interactive-secondary)]\"\n >\n @for (header of headers(); track header.field) {\n <span\n class=\"block h-[12px] w-[100px] shrink-0 rounded-radius-small bg-color-background-interactive-secondary-pressed\"\n ></span>\n }\n </div>\n }\n </td>\n </tr>\n }\n @case (\"error\") {\n <tr>\n <td\n class=\"p-0\"\n [attr.colspan]=\"totalColumnCount()\"\n >\n <sds-empty-state\n type=\"error\"\n [showIcon]=\"true\"\n [heading]=\"'platform.scala-ng.table_error_heading' | translate\"\n [description]=\"'platform.scala-ng.table_error_description' | translate\"\n />\n </td>\n </tr>\n }\n @case (\"empty\") {\n <tr>\n <td\n class=\"p-0\"\n [attr.colspan]=\"totalColumnCount()\"\n >\n <sds-empty-state\n [type]=\"hasActiveFilter() ? 'no-results' : 'default'\"\n [showIcon]=\"true\"\n [heading]=\"\n emptyHeading() ??\n (hasActiveFilter()\n ? ('platform.scala-ng.table_empty_no_results_heading' | translate)\n : ('platform.scala-ng.table_empty_heading' | translate))\n \"\n [description]=\"\n emptyDescription() ??\n (hasActiveFilter()\n ? ('platform.scala-ng.table_empty_no_results_description' | translate)\n : ('platform.scala-ng.table_empty_description' | translate))\n \"\n />\n </td>\n </tr>\n }\n @default {\n @for (item of renderRows(); track _trackRenderRow(item, $index); let last = $last) {\n @switch (item.kind) {\n @case (\"group\") {\n <tr\n sds-table-row-group-header\n [label]=\"item.label\"\n [count]=\"item.count\"\n [collapsed]=\"item.collapsed\"\n [colspan]=\"totalColumnCount()\"\n (toggled)=\"_onGroupToggle(item.key)\"\n ></tr>\n }\n @case (\"row\") {\n <tr\n sdsTableRow\n [selected]=\"_isRowSelected(item.key)\"\n [zebra]=\"zebra() && item.rowIndex % 2 === 0\"\n [isLast]=\"last\"\n cdkDrag\n [cdkDragDisabled]=\"!reorderable()\"\n [cdkDragData]=\"item.data\"\n >\n @if (hasSelectionColumn()) {\n <td sdsTableCell>\n <div class=\"flex items-center justify-center\">\n <sds-table-selection-cell\n [mode]=\"selectionCellMode()\"\n [label]=\"selectionCellLabelKey() | translate\"\n [checked]=\"_isRowSelected(item.key)\"\n [radioGroupName]=\"radioGroupName\"\n [radioValue]=\"item.key ?? ''\"\n [radioSelectedValue]=\"singleSelectedKey()\"\n (checkedChange)=\"_onRowCheckedChange(item.key!, $event)\"\n (radioSelected)=\"_onRowRadioSelected($event)\"\n />\n </div>\n </td>\n }\n @if (hasExpandColumn()) {\n <td sdsTableCell>\n @if (_isRowExpandableRow(item.data)) {\n <div class=\"flex items-center justify-center\">\n <sds-table-expand-cell\n [expanded]=\"_isRowExpanded(item.key)\"\n [label]=\"\n (_isRowExpanded(item.key)\n ? 'platform.scala-ng.table_collapse_row_label'\n : 'platform.scala-ng.table_expand_row_label'\n ) | translate\n \"\n (toggled)=\"_onExpandToggle(item.key!)\"\n />\n </div>\n }\n </td>\n }\n @for (header of tableHeaders(); track header.field) {\n <td\n sdsTableCell\n class=\"truncate\"\n [textAlign]=\"header.textAlign\"\n >\n <ng-container\n [sdsTableField]=\"{ header: $any(header), row: item.data }\"\n ></ng-container>\n </td>\n }\n @if (actions(); as tableActions) {\n @if (tableActions.length > 0) {\n <td\n sdsTableCell\n textAlign=\"right\"\n >\n @defer (on viewport; prefetch on idle) {\n <sds-table-actions-cell\n [actions]=\"tableActions\"\n [row]=\"item.data\"\n />\n } @placeholder {\n <!-- size-8: matches the resolved ghost small button (32px), so the row doesn't jump while the deferred content loads. -->\n <span\n class=\"ml-auto block size-8\"\n aria-hidden=\"true\"\n ></span>\n }\n </td>\n }\n }\n </tr>\n @if (rowDetailTemplate(); as detailTemplate) {\n @if (\n _isRowExpandableRow(item.data) && mountedDetailKeys().has(item.key ?? \"\")\n ) {\n <tr [hidden]=\"!_isRowExpanded(item.key)\">\n <td\n sdsTableRowDetailCell\n [attr.colspan]=\"totalColumnCount()\"\n >\n <ng-container\n [ngTemplateOutlet]=\"detailTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: item.data }\"\n ></ng-container>\n </td>\n </tr>\n }\n }\n }\n }\n }\n }\n }\n </tbody>\n </table>\n </div>\n </div>\n\n @if (paginator()) {\n <div sdsTablePaginatorContainer>\n <sds-paginator\n [page]=\"effectivePage()\"\n [pageSize]=\"pageSize()\"\n [totalItems]=\"totalRecords() ?? rows().length\"\n [pageSizeOptions]=\"pageSizeOptions()\"\n [loading]=\"loading()\"\n (pageChange)=\"_onPaginatorChange($event)\"\n />\n </div>\n }\n</div>\n", dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: CdkDropList, selector: "[cdkDropList], cdk-drop-list", inputs: ["cdkDropListConnectedTo", "cdkDropListData", "cdkDropListOrientation", "id", "cdkDropListLockAxis", "cdkDropListDisabled", "cdkDropListSortingDisabled", "cdkDropListEnterPredicate", "cdkDropListSortPredicate", "cdkDropListAutoScrollDisabled", "cdkDropListAutoScrollStep", "cdkDropListElementContainer"], outputs: ["cdkDropListDropped", "cdkDropListEntered", "cdkDropListExited", "cdkDropListSorted"], exportAs: ["cdkDropList"] }, { kind: "directive", type: 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: SdsTableGridDirective, selector: "table[sdsTableGrid]" }, { kind: "directive", type: SdsTableContainerDirective, selector: "div[sdsTableContainer]" }, { kind: "directive", type: SdsTableActionsColumnDirective, selector: "col[sdsTableActionsColumn]" }, { kind: "directive", type: SdsTableHeaderRowDirective, selector: "tr[sdsTableHeaderRow]" }, { kind: "directive", type: SdsTableHeaderCellDirective, selector: "th[sdsTableHeaderCell]", inputs: ["sortable", "textAlign"] }, { kind: "directive", type: SdsTableBodyDirective, selector: "tbody[sdsTableBody]" }, { kind: "directive", type: SdsTableRowDirective, selector: "tr[sdsTableRow]", inputs: ["selected", "zebra", "isLast"] }, { kind: "directive", type: SdsTableCellDirective, selector: "td[sdsTableCell]", inputs: ["textAlign"] }, { kind: "directive", type: SdsTableRowDetailCellDirective, selector: "td[sdsTableRowDetailCell]" }, { kind: "directive", type: SdsTablePaginatorContainerDirective, selector: "div[sdsTablePaginatorContainer]" }, { kind: "directive", type: SdsTableFieldDirective, selector: "[sdsTableField]", inputs: ["sdsTableField"] }, { kind: "component", type: SdsTableSelectionCellComponent, selector: "sds-table-selection-cell", inputs: ["mode", "label", "checked", "indeterminate", "disabled", "radioGroupName", "radioValue", "radioSelectedValue"], outputs: ["checkedChange", "radioSelected"] }, { kind: "component", type: SdsTableExpandCellComponent, selector: "sds-table-expand-cell", inputs: ["expanded", "disabled", "label"], outputs: ["toggled"] }, { kind: "component", type: SdsTableRowGroupHeaderComponent, selector: "tr[sds-table-row-group-header]", inputs: ["label", "count", "collapsed", "colspan"], outputs: ["toggled"] }, { kind: "component", type: SdsEmptyStateComponent, selector: "sds-empty-state", inputs: ["type", "heading", "description", "showIcon", "headingLevel", "primaryAction", "secondaryAction"], outputs: ["primaryActionClick", "secondaryActionClick"] }, { kind: "component", type: SdsPaginatorComponent, selector: "sds-paginator", inputs: ["page", "pageSize", "totalItems", "pageSizeOptions", "loading", "showCounter", "showPageSize", "showJumpToPage", "showPageIndicator"], outputs: ["pageChange"] }, { kind: "pipe", type: TranslatePipe, name: "translate" }], deferBlockDependencies: [() => [import('./seniorsistemas-scala-ng-table-table-toolbar.component-2YcqyPlh.mjs').then(m => m.SdsTableToolbarComponent)], () => [import('./seniorsistemas-scala-ng-table-table-filter-row.component-BgdQk6tM.mjs').then(m => m.SdsTableFilterRowComponent)], () => [import('./seniorsistemas-scala-ng-table-table-actions-cell.component-D6ffnUl1.mjs').then(m => m.SdsTableActionsCellComponent)]] });
|
|
944
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", type: SdsTableComponent, isStandalone: true, selector: "sds-table", inputs: { headers: { classPropertyName: "headers", publicName: "headers", isSignal: true, isRequired: true, transformFunction: null }, data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: true, transformFunction: null }, lazy: { classPropertyName: "lazy", publicName: "lazy", isSignal: true, isRequired: false, transformFunction: null }, loading: { classPropertyName: "loading", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null }, emptyHeading: { classPropertyName: "emptyHeading", publicName: "emptyHeading", isSignal: true, isRequired: false, transformFunction: null }, emptyDescription: { classPropertyName: "emptyDescription", publicName: "emptyDescription", isSignal: true, isRequired: false, transformFunction: null }, error: { classPropertyName: "error", publicName: "error", isSignal: true, isRequired: false, transformFunction: null }, actions: { classPropertyName: "actions", publicName: "actions", isSignal: true, isRequired: false, transformFunction: null }, dataKey: { classPropertyName: "dataKey", publicName: "dataKey", isSignal: true, isRequired: false, transformFunction: null }, selectionMode: { classPropertyName: "selectionMode", publicName: "selectionMode", isSignal: true, isRequired: false, transformFunction: null }, selectedKeys: { classPropertyName: "selectedKeys", publicName: "selectedKeys", isSignal: true, isRequired: false, transformFunction: null }, allSelected: { classPropertyName: "allSelected", publicName: "allSelected", isSignal: true, isRequired: false, transformFunction: null }, totalRecords: { classPropertyName: "totalRecords", publicName: "totalRecords", isSignal: true, isRequired: false, transformFunction: null }, expandedKeys: { classPropertyName: "expandedKeys", publicName: "expandedKeys", isSignal: true, isRequired: false, transformFunction: null }, isRowExpandable: { classPropertyName: "isRowExpandable", publicName: "isRowExpandable", isSignal: true, isRequired: false, transformFunction: null }, groupBy: { classPropertyName: "groupBy", publicName: "groupBy", isSignal: true, isRequired: false, transformFunction: null }, zebra: { classPropertyName: "zebra", publicName: "zebra", isSignal: true, isRequired: false, transformFunction: null }, reorderable: { classPropertyName: "reorderable", publicName: "reorderable", isSignal: true, isRequired: false, transformFunction: null }, toolbar: { classPropertyName: "toolbar", publicName: "toolbar", isSignal: true, isRequired: false, transformFunction: null }, paginator: { classPropertyName: "paginator", publicName: "paginator", isSignal: true, isRequired: false, transformFunction: null }, pageSizeOptions: { classPropertyName: "pageSizeOptions", publicName: "pageSizeOptions", isSignal: true, isRequired: false, transformFunction: null }, paginatorConfig: { classPropertyName: "paginatorConfig", publicName: "paginatorConfig", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { lazyLoad: "lazyLoad", selectedKeys: "selectedKeysChange", allSelected: "allSelectedChange", expandedKeys: "expandedKeysChange", rowReorder: "rowReorder", toolbarSearch: "toolbarSearch" }, queries: [{ propertyName: "rowDetailTemplate", first: true, predicate: ["rowDetail"], descendants: true, isSignal: true }], ngImport: i0, template: "<div class=\"flex w-full flex-col gap-space-2\">\n @if (toolbar(); as toolbarConfig) {\n <div [hidden]=\"!hasToolbarContent()\">\n @defer (on idle; prefetch on immediate) {\n <sds-table-toolbar\n [config]=\"toolbarConfig\"\n [mode]=\"toolbarMode()\"\n [selectedCount]=\"selectedKeys().size\"\n [allowSelectAllMatching]=\"selectionMode() === 'multiple'\"\n [totalRecords]=\"totalRecords() ?? rows().length\"\n [searchValue]=\"searchValue()\"\n (searchChange)=\"_onToolbarSearch($event)\"\n (filterToggle)=\"_onFilterToggle()\"\n (selectAllMatching)=\"_onSelectAllMatching()\"\n (clearSelection)=\"_onClearSelection()\"\n />\n } @placeholder {\n <div class=\"h-[56px]\"></div>\n }\n </div>\n }\n\n <div sdsTableContainer>\n <div class=\"overflow-x-auto\">\n <table sdsTableGrid>\n <colgroup>\n @if (hasSelectionColumn()) {\n <col class=\"w-[48px]\" />\n }\n @if (hasExpandColumn()) {\n <col class=\"w-[40px]\" />\n }\n @for (header of headers(); track header.field) {\n <col />\n }\n @if (hasActionsColumn()) {\n <col sdsTableActionsColumn />\n }\n </colgroup>\n @if (showHeader()) {\n <thead>\n <tr sdsTableHeaderRow>\n @if (hasSelectionColumn()) {\n <th sdsTableHeaderCell>\n @if (selectionMode() === \"multiple\") {\n <div class=\"flex items-center justify-center\">\n <sds-table-selection-cell\n mode=\"checkbox\"\n [label]=\"'platform.scala-ng.table_selection_select_all_label' | translate\"\n [checked]=\"headerSelectionState() === 'checked'\"\n [indeterminate]=\"headerSelectionState() === 'indeterminate'\"\n (checkedChange)=\"$event ? _onSelectAllChecked() : _onSelectAllUnchecked()\"\n />\n </div>\n }\n </th>\n }\n @if (hasExpandColumn()) {\n <th sdsTableHeaderCell>\n <div class=\"flex items-center justify-center\">\n <sds-table-expand-cell\n [expanded]=\"allExpanded()\"\n [label]=\"\n (allExpanded()\n ? 'platform.scala-ng.table_collapse_all_label'\n : 'platform.scala-ng.table_expand_all_label'\n ) | translate\n \"\n (toggled)=\"_onExpandAllToggle()\"\n />\n </div>\n </th>\n }\n <!-- 160px: minimum column width that keeps a label + sort icon readable before the table scrolls horizontally. -->\n @for (header of tableHeaders(); track header.field) {\n <th\n sdsTableHeaderCell\n scope=\"col\"\n class=\"min-w-[160px]\"\n [sortable]=\"header.sortable\"\n [textAlign]=\"header.textAlign\"\n [attr.aria-sort]=\"_ariaSortFor($any(header))\"\n [attr.tabindex]=\"header.sortable ? 0 : null\"\n (click)=\"_onHeaderClick($any(header))\"\n (keydown)=\"_onHeaderKeydown($event, $any(header))\"\n >\n <div\n class=\"flex min-w-0 items-center\"\n [class.justify-end]=\"header.textAlign === 'right'\"\n [class.justify-center]=\"header.textAlign === 'center'\"\n >\n <span class=\"truncate\">{{ header.label }}</span>\n @if (header.sortable) {\n <i\n class=\"fa-solid ml-space-0-50 shrink-0\"\n [class]=\"_sortIconFor($any(header))\"\n aria-hidden=\"true\"\n ></i>\n }\n </div>\n </th>\n }\n @if (hasActionsColumn()) {\n <th\n sdsTableHeaderCell\n scope=\"col\"\n >\n <span class=\"sr-only\">\n {{ \"platform.scala-ng.table_actions_column_label\" | translate }}\n </span>\n </th>\n }\n </tr>\n @if (showFilterRow()) {\n @defer (on idle; prefetch on immediate) {\n <tr\n sds-table-filter-row\n [headers]=\"headers()\"\n [hasSelectionColumn]=\"hasSelectionColumn()\"\n [hasExpandColumn]=\"hasExpandColumn()\"\n [hasActionsColumn]=\"hasActionsColumn()\"\n [values]=\"filterValues()\"\n (valueChange)=\"_onFilterValueChange($event.field, $event.value)\"\n ></tr>\n } @placeholder {\n <tr>\n <td\n class=\"h-[56px]\"\n [attr.colspan]=\"totalColumnCount()\"\n ></td>\n </tr>\n }\n }\n </thead>\n }\n <tbody\n sdsTableBody\n cdkDropList\n (cdkDropListDropped)=\"_onDrop($event)\"\n >\n @switch (state()) {\n @case (\"skeleton\") {\n <tr>\n <td\n class=\"p-0\"\n [attr.colspan]=\"totalColumnCount()\"\n >\n @for (skeletonRow of skeletonRows; track $index) {\n <div\n aria-hidden=\"true\"\n class=\"flex h-[48px] items-center gap-space-2 overflow-hidden px-space-1-5 shadow-[inset_0_-1px_0_0_var(--sds-color-border-interactive-secondary)]\"\n >\n @for (header of headers(); track header.field) {\n <span\n class=\"block h-[12px] w-[100px] shrink-0 rounded-radius-small bg-color-background-interactive-secondary-pressed\"\n ></span>\n }\n </div>\n }\n </td>\n </tr>\n }\n @case (\"error\") {\n <tr>\n <td\n class=\"p-0\"\n [attr.colspan]=\"totalColumnCount()\"\n >\n <sds-empty-state\n type=\"error\"\n [showIcon]=\"true\"\n [heading]=\"'platform.scala-ng.table_error_heading' | translate\"\n [description]=\"'platform.scala-ng.table_error_description' | translate\"\n />\n </td>\n </tr>\n }\n @case (\"empty\") {\n <tr>\n <td\n class=\"p-0\"\n [attr.colspan]=\"totalColumnCount()\"\n >\n <sds-empty-state\n [type]=\"hasActiveFilter() ? 'no-results' : 'default'\"\n [showIcon]=\"true\"\n [heading]=\"\n emptyHeading() ??\n (hasActiveFilter()\n ? ('platform.scala-ng.table_empty_no_results_heading' | translate)\n : ('platform.scala-ng.table_empty_heading' | translate))\n \"\n [description]=\"\n emptyDescription() ??\n (hasActiveFilter()\n ? ('platform.scala-ng.table_empty_no_results_description' | translate)\n : ('platform.scala-ng.table_empty_description' | translate))\n \"\n />\n </td>\n </tr>\n }\n @default {\n @for (item of renderRows(); track _trackRenderRow(item, $index); let last = $last) {\n @switch (item.kind) {\n @case (\"group\") {\n <tr\n sds-table-row-group-header\n [label]=\"item.label\"\n [count]=\"item.count\"\n [collapsed]=\"item.collapsed\"\n [colspan]=\"totalColumnCount()\"\n (toggled)=\"_onGroupToggle(item.key)\"\n ></tr>\n }\n @case (\"row\") {\n <tr\n sdsTableRow\n [selected]=\"_isRowSelected(item.key)\"\n [zebra]=\"zebra() && item.rowIndex % 2 === 0\"\n [isLast]=\"last\"\n cdkDrag\n [cdkDragDisabled]=\"!reorderable()\"\n [cdkDragData]=\"item.data\"\n >\n @if (hasSelectionColumn()) {\n <td sdsTableCell>\n <div class=\"flex items-center justify-center\">\n <sds-table-selection-cell\n [mode]=\"selectionCellMode()\"\n [label]=\"selectionCellLabelKey() | translate\"\n [checked]=\"_isRowSelected(item.key)\"\n [radioGroupName]=\"radioGroupName\"\n [radioValue]=\"item.key ?? ''\"\n [radioSelectedValue]=\"singleSelectedKey()\"\n (checkedChange)=\"_onRowCheckedChange(item.key!, $event)\"\n (radioSelected)=\"_onRowRadioSelected($event)\"\n />\n </div>\n </td>\n }\n @if (hasExpandColumn()) {\n <td sdsTableCell>\n @if (_isRowExpandableRow(item.data)) {\n <div class=\"flex items-center justify-center\">\n <sds-table-expand-cell\n [expanded]=\"_isRowExpanded(item.key)\"\n [label]=\"\n (_isRowExpanded(item.key)\n ? 'platform.scala-ng.table_collapse_row_label'\n : 'platform.scala-ng.table_expand_row_label'\n ) | translate\n \"\n (toggled)=\"_onExpandToggle(item.key!)\"\n />\n </div>\n }\n </td>\n }\n @for (header of tableHeaders(); track header.field) {\n <td\n sdsTableCell\n class=\"truncate\"\n [textAlign]=\"header.textAlign\"\n >\n <ng-container\n [sdsTableField]=\"{ header: $any(header), row: item.data }\"\n ></ng-container>\n </td>\n }\n @if (actions(); as tableActions) {\n @if (tableActions.length > 0) {\n <td\n sdsTableCell\n textAlign=\"right\"\n >\n @defer (on viewport; prefetch on idle) {\n <sds-table-actions-cell\n [actions]=\"tableActions\"\n [row]=\"item.data\"\n />\n } @placeholder {\n <!-- size-8: matches the resolved ghost small button (32px), so the row doesn't jump while the deferred content loads. -->\n <span\n class=\"ml-auto block size-8\"\n aria-hidden=\"true\"\n ></span>\n }\n </td>\n }\n }\n </tr>\n @if (rowDetailTemplate(); as detailTemplate) {\n @if (\n _isRowExpandableRow(item.data) && mountedDetailKeys().has(item.key ?? \"\")\n ) {\n <tr [hidden]=\"!_isRowExpanded(item.key)\">\n <td\n sdsTableRowDetailCell\n [attr.colspan]=\"totalColumnCount()\"\n >\n <ng-container\n [ngTemplateOutlet]=\"detailTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: item.data }\"\n ></ng-container>\n </td>\n </tr>\n }\n }\n }\n }\n }\n }\n }\n </tbody>\n </table>\n </div>\n </div>\n\n @if (paginator()) {\n <div sdsTablePaginatorContainer>\n <sds-paginator\n [page]=\"effectivePage()\"\n [pageSize]=\"pageSize()\"\n [totalItems]=\"totalRecords() ?? rows().length\"\n [pageSizeOptions]=\"resolvedPaginatorConfig().pageSizeOptions\"\n [loading]=\"loading()\"\n [showPageSize]=\"resolvedPaginatorConfig().showPageSize\"\n [showJumpToPage]=\"resolvedPaginatorConfig().showJumpToPage\"\n [showCounter]=\"resolvedPaginatorConfig().showCounter\"\n [showPageIndicator]=\"resolvedPaginatorConfig().showPageIndicator\"\n (pageChange)=\"_onPaginatorChange($event)\"\n />\n </div>\n }\n</div>\n", dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: CdkDropList, selector: "[cdkDropList], cdk-drop-list", inputs: ["cdkDropListConnectedTo", "cdkDropListData", "cdkDropListOrientation", "id", "cdkDropListLockAxis", "cdkDropListDisabled", "cdkDropListSortingDisabled", "cdkDropListEnterPredicate", "cdkDropListSortPredicate", "cdkDropListAutoScrollDisabled", "cdkDropListAutoScrollStep", "cdkDropListElementContainer"], outputs: ["cdkDropListDropped", "cdkDropListEntered", "cdkDropListExited", "cdkDropListSorted"], exportAs: ["cdkDropList"] }, { kind: "directive", type: 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: SdsTableGridDirective, selector: "table[sdsTableGrid]" }, { kind: "directive", type: SdsTableContainerDirective, selector: "div[sdsTableContainer]" }, { kind: "directive", type: SdsTableActionsColumnDirective, selector: "col[sdsTableActionsColumn]" }, { kind: "directive", type: SdsTableHeaderRowDirective, selector: "tr[sdsTableHeaderRow]" }, { kind: "directive", type: SdsTableHeaderCellDirective, selector: "th[sdsTableHeaderCell]", inputs: ["sortable", "textAlign"] }, { kind: "directive", type: SdsTableBodyDirective, selector: "tbody[sdsTableBody]" }, { kind: "directive", type: SdsTableRowDirective, selector: "tr[sdsTableRow]", inputs: ["selected", "zebra", "isLast"] }, { kind: "directive", type: SdsTableCellDirective, selector: "td[sdsTableCell]", inputs: ["textAlign"] }, { kind: "directive", type: SdsTableRowDetailCellDirective, selector: "td[sdsTableRowDetailCell]" }, { kind: "directive", type: SdsTablePaginatorContainerDirective, selector: "div[sdsTablePaginatorContainer]" }, { kind: "directive", type: SdsTableFieldDirective, selector: "[sdsTableField]", inputs: ["sdsTableField"] }, { kind: "component", type: SdsTableSelectionCellComponent, selector: "sds-table-selection-cell", inputs: ["mode", "label", "checked", "indeterminate", "disabled", "radioGroupName", "radioValue", "radioSelectedValue"], outputs: ["checkedChange", "radioSelected"] }, { kind: "component", type: SdsTableExpandCellComponent, selector: "sds-table-expand-cell", inputs: ["expanded", "disabled", "label"], outputs: ["toggled"] }, { kind: "component", type: SdsTableRowGroupHeaderComponent, selector: "tr[sds-table-row-group-header]", inputs: ["label", "count", "collapsed", "colspan"], outputs: ["toggled"] }, { kind: "component", type: SdsEmptyStateComponent, selector: "sds-empty-state", inputs: ["type", "heading", "description", "showIcon", "headingLevel", "primaryAction", "secondaryAction"], outputs: ["primaryActionClick", "secondaryActionClick"] }, { kind: "component", type: SdsPaginatorComponent, selector: "sds-paginator", inputs: ["page", "pageSize", "totalItems", "pageSizeOptions", "loading", "showCounter", "showPageSize", "showJumpToPage", "showPageIndicator"], outputs: ["pageChange"] }, { kind: "pipe", type: TranslatePipe, name: "translate" }], deferBlockDependencies: [() => [import('./seniorsistemas-scala-ng-table-table-toolbar.component-2YcqyPlh.mjs').then(m => m.SdsTableToolbarComponent)], () => [import('./seniorsistemas-scala-ng-table-table-filter-row.component-BgdQk6tM.mjs').then(m => m.SdsTableFilterRowComponent)], () => [import('./seniorsistemas-scala-ng-table-table-actions-cell.component-C7ZnqPt9.mjs').then(m => m.SdsTableActionsCellComponent)]] });
|
|
930
945
|
}
|
|
931
|
-
i0.ɵɵngDeclareClassMetadataAsync({ minVersion: "18.0.0", version: "18.2.14", ngImport: i0, type: SdsTableComponent, resolveDeferredDeps: () => [import('./seniorsistemas-scala-ng-table-table-toolbar.component-2YcqyPlh.mjs').then(m => m.SdsTableToolbarComponent), import('./seniorsistemas-scala-ng-table-table-filter-row.component-BgdQk6tM.mjs').then(m => m.SdsTableFilterRowComponent), import('./seniorsistemas-scala-ng-table-table-actions-cell.component-
|
|
946
|
+
i0.ɵɵngDeclareClassMetadataAsync({ minVersion: "18.0.0", version: "18.2.14", ngImport: i0, type: SdsTableComponent, resolveDeferredDeps: () => [import('./seniorsistemas-scala-ng-table-table-toolbar.component-2YcqyPlh.mjs').then(m => m.SdsTableToolbarComponent), import('./seniorsistemas-scala-ng-table-table-filter-row.component-BgdQk6tM.mjs').then(m => m.SdsTableFilterRowComponent), import('./seniorsistemas-scala-ng-table-table-actions-cell.component-C7ZnqPt9.mjs').then(m => m.SdsTableActionsCellComponent)], resolveMetadata: (SdsTableToolbarComponent, SdsTableFilterRowComponent, SdsTableActionsCellComponent) => ({ decorators: [{
|
|
932
947
|
type: Component,
|
|
933
948
|
args: [{ selector: "sds-table", standalone: true, imports: [
|
|
934
949
|
NgTemplateOutlet,
|
|
@@ -954,7 +969,7 @@ i0.ɵɵngDeclareClassMetadataAsync({ minVersion: "18.0.0", version: "18.2.14", n
|
|
|
954
969
|
SdsTableActionsCellComponent,
|
|
955
970
|
SdsPaginatorComponent,
|
|
956
971
|
TranslatePipe,
|
|
957
|
-
], template: "<div class=\"flex w-full flex-col gap-space-2\">\n @if (toolbar(); as toolbarConfig) {\n <div [hidden]=\"!hasToolbarContent()\">\n @defer (on idle; prefetch on immediate) {\n <sds-table-toolbar\n [config]=\"toolbarConfig\"\n [mode]=\"toolbarMode()\"\n [selectedCount]=\"selectedKeys().size\"\n [allowSelectAllMatching]=\"selectionMode() === 'multiple'\"\n [totalRecords]=\"totalRecords() ?? rows().length\"\n [searchValue]=\"searchValue()\"\n (searchChange)=\"_onToolbarSearch($event)\"\n (filterToggle)=\"_onFilterToggle()\"\n (selectAllMatching)=\"_onSelectAllMatching()\"\n (clearSelection)=\"_onClearSelection()\"\n />\n } @placeholder {\n <div class=\"h-[56px]\"></div>\n }\n </div>\n }\n\n <div sdsTableContainer>\n <div class=\"overflow-x-auto\">\n <table sdsTableGrid>\n <colgroup>\n @if (hasSelectionColumn()) {\n <col class=\"w-[48px]\" />\n }\n @if (hasExpandColumn()) {\n <col class=\"w-[40px]\" />\n }\n @for (header of headers(); track header.field) {\n <col />\n }\n @if (hasActionsColumn()) {\n <col sdsTableActionsColumn />\n }\n </colgroup>\n @if (showHeader()) {\n <thead>\n <tr sdsTableHeaderRow>\n @if (hasSelectionColumn()) {\n <th sdsTableHeaderCell>\n @if (selectionMode() === \"multiple\") {\n <div class=\"flex items-center justify-center\">\n <sds-table-selection-cell\n mode=\"checkbox\"\n [label]=\"'platform.scala-ng.table_selection_select_all_label' | translate\"\n [checked]=\"headerSelectionState() === 'checked'\"\n [indeterminate]=\"headerSelectionState() === 'indeterminate'\"\n (checkedChange)=\"$event ? _onSelectAllChecked() : _onSelectAllUnchecked()\"\n />\n </div>\n }\n </th>\n }\n @if (hasExpandColumn()) {\n <th sdsTableHeaderCell>\n <div class=\"flex items-center justify-center\">\n <sds-table-expand-cell\n [expanded]=\"allExpanded()\"\n [label]=\"\n (allExpanded()\n ? 'platform.scala-ng.table_collapse_all_label'\n : 'platform.scala-ng.table_expand_all_label'\n ) | translate\n \"\n (toggled)=\"_onExpandAllToggle()\"\n />\n </div>\n </th>\n }\n <!-- 160px: minimum column width that keeps a label + sort icon readable before the table scrolls horizontally. -->\n @for (header of tableHeaders(); track header.field) {\n <th\n sdsTableHeaderCell\n scope=\"col\"\n class=\"min-w-[160px]\"\n [sortable]=\"header.sortable\"\n [textAlign]=\"header.textAlign\"\n [attr.aria-sort]=\"_ariaSortFor($any(header))\"\n [attr.tabindex]=\"header.sortable ? 0 : null\"\n (click)=\"_onHeaderClick($any(header))\"\n (keydown)=\"_onHeaderKeydown($event, $any(header))\"\n >\n <div\n class=\"flex min-w-0 items-center\"\n [class.justify-end]=\"header.textAlign === 'right'\"\n [class.justify-center]=\"header.textAlign === 'center'\"\n >\n <span class=\"truncate\">{{ header.label }}</span>\n @if (header.sortable) {\n <i\n class=\"fa-solid ml-space-0-50 shrink-0\"\n [class]=\"_sortIconFor($any(header))\"\n aria-hidden=\"true\"\n ></i>\n }\n </div>\n </th>\n }\n @if (hasActionsColumn()) {\n <th\n sdsTableHeaderCell\n scope=\"col\"\n >\n <span class=\"sr-only\">\n {{ \"platform.scala-ng.table_actions_column_label\" | translate }}\n </span>\n </th>\n }\n </tr>\n @if (showFilterRow()) {\n @defer (on idle; prefetch on immediate) {\n <tr\n sds-table-filter-row\n [headers]=\"headers()\"\n [hasSelectionColumn]=\"hasSelectionColumn()\"\n [hasExpandColumn]=\"hasExpandColumn()\"\n [hasActionsColumn]=\"hasActionsColumn()\"\n [values]=\"filterValues()\"\n (valueChange)=\"_onFilterValueChange($event.field, $event.value)\"\n ></tr>\n } @placeholder {\n <tr>\n <td\n class=\"h-[56px]\"\n [attr.colspan]=\"totalColumnCount()\"\n ></td>\n </tr>\n }\n }\n </thead>\n }\n <tbody\n sdsTableBody\n cdkDropList\n (cdkDropListDropped)=\"_onDrop($event)\"\n >\n @switch (state()) {\n @case (\"skeleton\") {\n <tr>\n <td\n class=\"p-0\"\n [attr.colspan]=\"totalColumnCount()\"\n >\n @for (skeletonRow of skeletonRows; track $index) {\n <div\n aria-hidden=\"true\"\n class=\"flex h-[48px] items-center gap-space-2 overflow-hidden px-space-1-5 shadow-[inset_0_-1px_0_0_var(--sds-color-border-interactive-secondary)]\"\n >\n @for (header of headers(); track header.field) {\n <span\n class=\"block h-[12px] w-[100px] shrink-0 rounded-radius-small bg-color-background-interactive-secondary-pressed\"\n ></span>\n }\n </div>\n }\n </td>\n </tr>\n }\n @case (\"error\") {\n <tr>\n <td\n class=\"p-0\"\n [attr.colspan]=\"totalColumnCount()\"\n >\n <sds-empty-state\n type=\"error\"\n [showIcon]=\"true\"\n [heading]=\"'platform.scala-ng.table_error_heading' | translate\"\n [description]=\"'platform.scala-ng.table_error_description' | translate\"\n />\n </td>\n </tr>\n }\n @case (\"empty\") {\n <tr>\n <td\n class=\"p-0\"\n [attr.colspan]=\"totalColumnCount()\"\n >\n <sds-empty-state\n [type]=\"hasActiveFilter() ? 'no-results' : 'default'\"\n [showIcon]=\"true\"\n [heading]=\"\n emptyHeading() ??\n (hasActiveFilter()\n ? ('platform.scala-ng.table_empty_no_results_heading' | translate)\n : ('platform.scala-ng.table_empty_heading' | translate))\n \"\n [description]=\"\n emptyDescription() ??\n (hasActiveFilter()\n ? ('platform.scala-ng.table_empty_no_results_description' | translate)\n : ('platform.scala-ng.table_empty_description' | translate))\n \"\n />\n </td>\n </tr>\n }\n @default {\n @for (item of renderRows(); track _trackRenderRow(item, $index); let last = $last) {\n @switch (item.kind) {\n @case (\"group\") {\n <tr\n sds-table-row-group-header\n [label]=\"item.label\"\n [count]=\"item.count\"\n [collapsed]=\"item.collapsed\"\n [colspan]=\"totalColumnCount()\"\n (toggled)=\"_onGroupToggle(item.key)\"\n ></tr>\n }\n @case (\"row\") {\n <tr\n sdsTableRow\n [selected]=\"_isRowSelected(item.key)\"\n [zebra]=\"zebra() && item.rowIndex % 2 === 0\"\n [isLast]=\"last\"\n cdkDrag\n [cdkDragDisabled]=\"!reorderable()\"\n [cdkDragData]=\"item.data\"\n >\n @if (hasSelectionColumn()) {\n <td sdsTableCell>\n <div class=\"flex items-center justify-center\">\n <sds-table-selection-cell\n [mode]=\"selectionCellMode()\"\n [label]=\"selectionCellLabelKey() | translate\"\n [checked]=\"_isRowSelected(item.key)\"\n [radioGroupName]=\"radioGroupName\"\n [radioValue]=\"item.key ?? ''\"\n [radioSelectedValue]=\"singleSelectedKey()\"\n (checkedChange)=\"_onRowCheckedChange(item.key!, $event)\"\n (radioSelected)=\"_onRowRadioSelected($event)\"\n />\n </div>\n </td>\n }\n @if (hasExpandColumn()) {\n <td sdsTableCell>\n @if (_isRowExpandableRow(item.data)) {\n <div class=\"flex items-center justify-center\">\n <sds-table-expand-cell\n [expanded]=\"_isRowExpanded(item.key)\"\n [label]=\"\n (_isRowExpanded(item.key)\n ? 'platform.scala-ng.table_collapse_row_label'\n : 'platform.scala-ng.table_expand_row_label'\n ) | translate\n \"\n (toggled)=\"_onExpandToggle(item.key!)\"\n />\n </div>\n }\n </td>\n }\n @for (header of tableHeaders(); track header.field) {\n <td\n sdsTableCell\n class=\"truncate\"\n [textAlign]=\"header.textAlign\"\n >\n <ng-container\n [sdsTableField]=\"{ header: $any(header), row: item.data }\"\n ></ng-container>\n </td>\n }\n @if (actions(); as tableActions) {\n @if (tableActions.length > 0) {\n <td\n sdsTableCell\n textAlign=\"right\"\n >\n @defer (on viewport; prefetch on idle) {\n <sds-table-actions-cell\n [actions]=\"tableActions\"\n [row]=\"item.data\"\n />\n } @placeholder {\n <!-- size-8: matches the resolved ghost small button (32px), so the row doesn't jump while the deferred content loads. -->\n <span\n class=\"ml-auto block size-8\"\n aria-hidden=\"true\"\n ></span>\n }\n </td>\n }\n }\n </tr>\n @if (rowDetailTemplate(); as detailTemplate) {\n @if (\n _isRowExpandableRow(item.data) && mountedDetailKeys().has(item.key ?? \"\")\n ) {\n <tr [hidden]=\"!_isRowExpanded(item.key)\">\n <td\n sdsTableRowDetailCell\n [attr.colspan]=\"totalColumnCount()\"\n >\n <ng-container\n [ngTemplateOutlet]=\"detailTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: item.data }\"\n ></ng-container>\n </td>\n </tr>\n }\n }\n }\n }\n }\n }\n }\n </tbody>\n </table>\n </div>\n </div>\n\n @if (paginator()) {\n <div sdsTablePaginatorContainer>\n <sds-paginator\n [page]=\"effectivePage()\"\n [pageSize]=\"pageSize()\"\n [totalItems]=\"totalRecords() ?? rows().length\"\n [pageSizeOptions]=\"pageSizeOptions()\"\n [loading]=\"loading()\"\n (pageChange)=\"_onPaginatorChange($event)\"\n />\n </div>\n }\n</div>\n" }]
|
|
972
|
+
], template: "<div class=\"flex w-full flex-col gap-space-2\">\n @if (toolbar(); as toolbarConfig) {\n <div [hidden]=\"!hasToolbarContent()\">\n @defer (on idle; prefetch on immediate) {\n <sds-table-toolbar\n [config]=\"toolbarConfig\"\n [mode]=\"toolbarMode()\"\n [selectedCount]=\"selectedKeys().size\"\n [allowSelectAllMatching]=\"selectionMode() === 'multiple'\"\n [totalRecords]=\"totalRecords() ?? rows().length\"\n [searchValue]=\"searchValue()\"\n (searchChange)=\"_onToolbarSearch($event)\"\n (filterToggle)=\"_onFilterToggle()\"\n (selectAllMatching)=\"_onSelectAllMatching()\"\n (clearSelection)=\"_onClearSelection()\"\n />\n } @placeholder {\n <div class=\"h-[56px]\"></div>\n }\n </div>\n }\n\n <div sdsTableContainer>\n <div class=\"overflow-x-auto\">\n <table sdsTableGrid>\n <colgroup>\n @if (hasSelectionColumn()) {\n <col class=\"w-[48px]\" />\n }\n @if (hasExpandColumn()) {\n <col class=\"w-[40px]\" />\n }\n @for (header of headers(); track header.field) {\n <col />\n }\n @if (hasActionsColumn()) {\n <col sdsTableActionsColumn />\n }\n </colgroup>\n @if (showHeader()) {\n <thead>\n <tr sdsTableHeaderRow>\n @if (hasSelectionColumn()) {\n <th sdsTableHeaderCell>\n @if (selectionMode() === \"multiple\") {\n <div class=\"flex items-center justify-center\">\n <sds-table-selection-cell\n mode=\"checkbox\"\n [label]=\"'platform.scala-ng.table_selection_select_all_label' | translate\"\n [checked]=\"headerSelectionState() === 'checked'\"\n [indeterminate]=\"headerSelectionState() === 'indeterminate'\"\n (checkedChange)=\"$event ? _onSelectAllChecked() : _onSelectAllUnchecked()\"\n />\n </div>\n }\n </th>\n }\n @if (hasExpandColumn()) {\n <th sdsTableHeaderCell>\n <div class=\"flex items-center justify-center\">\n <sds-table-expand-cell\n [expanded]=\"allExpanded()\"\n [label]=\"\n (allExpanded()\n ? 'platform.scala-ng.table_collapse_all_label'\n : 'platform.scala-ng.table_expand_all_label'\n ) | translate\n \"\n (toggled)=\"_onExpandAllToggle()\"\n />\n </div>\n </th>\n }\n <!-- 160px: minimum column width that keeps a label + sort icon readable before the table scrolls horizontally. -->\n @for (header of tableHeaders(); track header.field) {\n <th\n sdsTableHeaderCell\n scope=\"col\"\n class=\"min-w-[160px]\"\n [sortable]=\"header.sortable\"\n [textAlign]=\"header.textAlign\"\n [attr.aria-sort]=\"_ariaSortFor($any(header))\"\n [attr.tabindex]=\"header.sortable ? 0 : null\"\n (click)=\"_onHeaderClick($any(header))\"\n (keydown)=\"_onHeaderKeydown($event, $any(header))\"\n >\n <div\n class=\"flex min-w-0 items-center\"\n [class.justify-end]=\"header.textAlign === 'right'\"\n [class.justify-center]=\"header.textAlign === 'center'\"\n >\n <span class=\"truncate\">{{ header.label }}</span>\n @if (header.sortable) {\n <i\n class=\"fa-solid ml-space-0-50 shrink-0\"\n [class]=\"_sortIconFor($any(header))\"\n aria-hidden=\"true\"\n ></i>\n }\n </div>\n </th>\n }\n @if (hasActionsColumn()) {\n <th\n sdsTableHeaderCell\n scope=\"col\"\n >\n <span class=\"sr-only\">\n {{ \"platform.scala-ng.table_actions_column_label\" | translate }}\n </span>\n </th>\n }\n </tr>\n @if (showFilterRow()) {\n @defer (on idle; prefetch on immediate) {\n <tr\n sds-table-filter-row\n [headers]=\"headers()\"\n [hasSelectionColumn]=\"hasSelectionColumn()\"\n [hasExpandColumn]=\"hasExpandColumn()\"\n [hasActionsColumn]=\"hasActionsColumn()\"\n [values]=\"filterValues()\"\n (valueChange)=\"_onFilterValueChange($event.field, $event.value)\"\n ></tr>\n } @placeholder {\n <tr>\n <td\n class=\"h-[56px]\"\n [attr.colspan]=\"totalColumnCount()\"\n ></td>\n </tr>\n }\n }\n </thead>\n }\n <tbody\n sdsTableBody\n cdkDropList\n (cdkDropListDropped)=\"_onDrop($event)\"\n >\n @switch (state()) {\n @case (\"skeleton\") {\n <tr>\n <td\n class=\"p-0\"\n [attr.colspan]=\"totalColumnCount()\"\n >\n @for (skeletonRow of skeletonRows; track $index) {\n <div\n aria-hidden=\"true\"\n class=\"flex h-[48px] items-center gap-space-2 overflow-hidden px-space-1-5 shadow-[inset_0_-1px_0_0_var(--sds-color-border-interactive-secondary)]\"\n >\n @for (header of headers(); track header.field) {\n <span\n class=\"block h-[12px] w-[100px] shrink-0 rounded-radius-small bg-color-background-interactive-secondary-pressed\"\n ></span>\n }\n </div>\n }\n </td>\n </tr>\n }\n @case (\"error\") {\n <tr>\n <td\n class=\"p-0\"\n [attr.colspan]=\"totalColumnCount()\"\n >\n <sds-empty-state\n type=\"error\"\n [showIcon]=\"true\"\n [heading]=\"'platform.scala-ng.table_error_heading' | translate\"\n [description]=\"'platform.scala-ng.table_error_description' | translate\"\n />\n </td>\n </tr>\n }\n @case (\"empty\") {\n <tr>\n <td\n class=\"p-0\"\n [attr.colspan]=\"totalColumnCount()\"\n >\n <sds-empty-state\n [type]=\"hasActiveFilter() ? 'no-results' : 'default'\"\n [showIcon]=\"true\"\n [heading]=\"\n emptyHeading() ??\n (hasActiveFilter()\n ? ('platform.scala-ng.table_empty_no_results_heading' | translate)\n : ('platform.scala-ng.table_empty_heading' | translate))\n \"\n [description]=\"\n emptyDescription() ??\n (hasActiveFilter()\n ? ('platform.scala-ng.table_empty_no_results_description' | translate)\n : ('platform.scala-ng.table_empty_description' | translate))\n \"\n />\n </td>\n </tr>\n }\n @default {\n @for (item of renderRows(); track _trackRenderRow(item, $index); let last = $last) {\n @switch (item.kind) {\n @case (\"group\") {\n <tr\n sds-table-row-group-header\n [label]=\"item.label\"\n [count]=\"item.count\"\n [collapsed]=\"item.collapsed\"\n [colspan]=\"totalColumnCount()\"\n (toggled)=\"_onGroupToggle(item.key)\"\n ></tr>\n }\n @case (\"row\") {\n <tr\n sdsTableRow\n [selected]=\"_isRowSelected(item.key)\"\n [zebra]=\"zebra() && item.rowIndex % 2 === 0\"\n [isLast]=\"last\"\n cdkDrag\n [cdkDragDisabled]=\"!reorderable()\"\n [cdkDragData]=\"item.data\"\n >\n @if (hasSelectionColumn()) {\n <td sdsTableCell>\n <div class=\"flex items-center justify-center\">\n <sds-table-selection-cell\n [mode]=\"selectionCellMode()\"\n [label]=\"selectionCellLabelKey() | translate\"\n [checked]=\"_isRowSelected(item.key)\"\n [radioGroupName]=\"radioGroupName\"\n [radioValue]=\"item.key ?? ''\"\n [radioSelectedValue]=\"singleSelectedKey()\"\n (checkedChange)=\"_onRowCheckedChange(item.key!, $event)\"\n (radioSelected)=\"_onRowRadioSelected($event)\"\n />\n </div>\n </td>\n }\n @if (hasExpandColumn()) {\n <td sdsTableCell>\n @if (_isRowExpandableRow(item.data)) {\n <div class=\"flex items-center justify-center\">\n <sds-table-expand-cell\n [expanded]=\"_isRowExpanded(item.key)\"\n [label]=\"\n (_isRowExpanded(item.key)\n ? 'platform.scala-ng.table_collapse_row_label'\n : 'platform.scala-ng.table_expand_row_label'\n ) | translate\n \"\n (toggled)=\"_onExpandToggle(item.key!)\"\n />\n </div>\n }\n </td>\n }\n @for (header of tableHeaders(); track header.field) {\n <td\n sdsTableCell\n class=\"truncate\"\n [textAlign]=\"header.textAlign\"\n >\n <ng-container\n [sdsTableField]=\"{ header: $any(header), row: item.data }\"\n ></ng-container>\n </td>\n }\n @if (actions(); as tableActions) {\n @if (tableActions.length > 0) {\n <td\n sdsTableCell\n textAlign=\"right\"\n >\n @defer (on viewport; prefetch on idle) {\n <sds-table-actions-cell\n [actions]=\"tableActions\"\n [row]=\"item.data\"\n />\n } @placeholder {\n <!-- size-8: matches the resolved ghost small button (32px), so the row doesn't jump while the deferred content loads. -->\n <span\n class=\"ml-auto block size-8\"\n aria-hidden=\"true\"\n ></span>\n }\n </td>\n }\n }\n </tr>\n @if (rowDetailTemplate(); as detailTemplate) {\n @if (\n _isRowExpandableRow(item.data) && mountedDetailKeys().has(item.key ?? \"\")\n ) {\n <tr [hidden]=\"!_isRowExpanded(item.key)\">\n <td\n sdsTableRowDetailCell\n [attr.colspan]=\"totalColumnCount()\"\n >\n <ng-container\n [ngTemplateOutlet]=\"detailTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: item.data }\"\n ></ng-container>\n </td>\n </tr>\n }\n }\n }\n }\n }\n }\n }\n </tbody>\n </table>\n </div>\n </div>\n\n @if (paginator()) {\n <div sdsTablePaginatorContainer>\n <sds-paginator\n [page]=\"effectivePage()\"\n [pageSize]=\"pageSize()\"\n [totalItems]=\"totalRecords() ?? rows().length\"\n [pageSizeOptions]=\"resolvedPaginatorConfig().pageSizeOptions\"\n [loading]=\"loading()\"\n [showPageSize]=\"resolvedPaginatorConfig().showPageSize\"\n [showJumpToPage]=\"resolvedPaginatorConfig().showJumpToPage\"\n [showCounter]=\"resolvedPaginatorConfig().showCounter\"\n [showPageIndicator]=\"resolvedPaginatorConfig().showPageIndicator\"\n (pageChange)=\"_onPaginatorChange($event)\"\n />\n </div>\n }\n</div>\n" }]
|
|
958
973
|
}], ctorParameters: () => [], propDecorators: null }) });
|
|
959
974
|
|
|
960
975
|
class SdsAvatarSummaryFieldTableComponent {
|