intelica-library-ui 0.1.129 → 0.1.130

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.
@@ -2030,13 +2030,20 @@ class TreeTableComponent {
2030
2030
  ClassName = "";
2031
2031
  groupRowsBy = "";
2032
2032
  dataKey = "";
2033
+ DefaultSortField = "";
2033
2034
  Columns;
2034
2035
  ColumnGroups;
2036
+ EmitSortEvent = new EventEmitter();
2037
+ ListDataFilter = [];
2035
2038
  ColumnList = [];
2036
2039
  ColumnGroupList = [];
2037
2040
  MaxLevel = 0;
2038
2041
  Levels = [];
2039
- ngOnChanges() { }
2042
+ SortOrder = 1;
2043
+ SortField = null;
2044
+ ngOnChanges() {
2045
+ this.ListDataFilter = [...this.ListData];
2046
+ }
2040
2047
  ngAfterContentInit() {
2041
2048
  this.ColumnList = this.Columns.toArray();
2042
2049
  this.ColumnGroupList = this.ColumnGroups.toArray();
@@ -2048,12 +2055,34 @@ class TreeTableComponent {
2048
2055
  return "";
2049
2056
  return String.fromCharCode(97 + index);
2050
2057
  }
2058
+ OnSort(field) {
2059
+ if (this.SortField === field) {
2060
+ this.SortOrder *= -1;
2061
+ }
2062
+ else {
2063
+ this.SortField = field;
2064
+ this.SortOrder = 1;
2065
+ }
2066
+ this.SortPages();
2067
+ }
2068
+ SortPages() {
2069
+ const order = this.SortOrder === 1 ? "asc" : "desc";
2070
+ const field = this.SortField;
2071
+ const sampleValue = this.ListDataFilter.find(item => item[field] !== null && item[field] !== undefined)?.[field];
2072
+ if (typeof sampleValue === "number") {
2073
+ this.ListDataFilter = this.SharedService.SortRecursiveNumber([...this.ListDataFilter], field, order);
2074
+ }
2075
+ else {
2076
+ this.ListDataFilter = this.SharedService.SortRecursivePrimeNg([...this.ListDataFilter], field, order);
2077
+ }
2078
+ this.EmitSortEvent.emit([{ sortOrder: this.SortOrder, sortField: this.SortField?.toString() ?? "" }]);
2079
+ }
2051
2080
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: TreeTableComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
2052
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.1", type: TreeTableComponent, isStandalone: true, selector: "intelica-tree-table", inputs: { ComponentId: "ComponentId", ListData: "ListData", ClassName: "ClassName", groupRowsBy: "groupRowsBy", dataKey: "dataKey" }, queries: [{ propertyName: "Columns", predicate: TreeColumnComponent }, { propertyName: "ColumnGroups", predicate: TreeColumnGroupComponent }], usesOnChanges: true, ngImport: i0, template: "<div class=\"prTable\">\r\n\t<p-table class=\"prTableBasic\" [value]=\"ListData\" [ngClass]=\"ClassName\" responsiveLayout=\"scroll\" [sortOrder]=\"-1\" [groupRowsBy]=\"groupRowsBy\" dataKey=\"dataKey\">\r\n\t\t<ng-template pTemplate=\"header\">\r\n\t\t\t@for (level of Levels; track $index) {\r\n\r\n\t\t\t<tr>\r\n\t\t\t\t@for (col of ColumnGroupList; track $index) { @if (col.level === level) {\r\n\r\n\t\t\t\t<th [attr.colspan]=\"col.colspan\" [attr.rowspan]=\"col.rowspan\" [style.min-width]=\"col.minWidth\">\r\n\t\t\t\t\t<div>\r\n\t\t\t\t\t\t<span pTooltip=\"{{ col.header }}\">{{ col.header }}</span>\r\n\t\t\t\t\t</div>\r\n\t\t\t\t</th>\r\n\t\t\t\t} }\r\n\t\t\t</tr>\r\n\t\t\t}\r\n\t\t\t<tr>\r\n\t\t\t\t@for (col of ColumnList; track $index) { @if(col.showHeader ){\r\n\t\t\t\t<th [class]=\"col.className\" [style.width]=\"col.width\" [style.min-width]=\"col.minWidth\">\r\n\t\t\t\t\t<div>\r\n\t\t\t\t\t\t<span pTooltip=\"{{ col.headerTooltip }}\" tooltipPosition=\"{{ col.headerTooltipPosition }}\">{{ col.header }}</span>\r\n\t\t\t\t\t</div>\r\n\t\t\t\t</th>\r\n\t\t\t\t} }\r\n\t\t\t</tr>\r\n\t\t</ng-template>\r\n\t\t<ng-template pTemplate=\"body\" let-rowData let-rowIndex=\"rowIndex\" let-expanded=\"expanded\">\r\n\t\t\t<tr>\r\n\t\t\t\t@for (col of ColumnList; track $index) {\r\n\t\t\t\t<td [ngClass]=\"col.className\">\r\n\t\t\t\t\t@if (col.field === 'name' && rowData.children && rowData.children.length > 0) {\r\n\t\t\t\t\t<!-- Bot\u00F3n de expansi\u00F3n -->\r\n\t\t\t\t\t<div class=\"prTable__expandToggleRow\">\r\n\t\t\t\t\t\t<!-- <p-button type=\"button\" pRipple [pRowToggler]=\"rowData\" [text]=\"true\" [rounded]=\"true\" [plain]=\"true\" [icon]=\"expanded ? 'pi pi-chevron-down' : 'pi pi-chevron-right'\"></p-button> -->\r\n\t\t\t\t\t\t<p-button [pRowToggler]=\"rowData\" class=\"prButton prButton--icon prButton--iconBlue\">\r\n\t\t\t\t\t\t\t<i [class]=\"expanded ? 'icon icon-collapse-rows' : 'icon icon-expand-rows'\"></i>\r\n\t\t\t\t\t\t</p-button>\r\n\r\n\t\t\t\t\t\t<!-- Texto de la columna \"name\" -->\r\n\t\t\t\t\t\t<span class=\"text-breakWord\" pTooltip=\"{{ col.tooltip }}\" tooltipPosition=\"{{ col.tooltipPosition }}\">\r\n\t\t\t\t\t\t\t{{ rowData[col.field] }}\r\n\t\t\t\t\t\t</span>\r\n\t\t\t\t\t</div>\r\n\t\t\t\t\t} @else {\r\n\t\t\t\t\t<!-- Otras columnas -->\r\n\t\t\t\t\t@if (col.templateRef) {\r\n\t\t\t\t\t<ng-container *ngTemplateOutlet=\"col.templateRef; context: { $implicit: rowData }\"></ng-container>\r\n\t\t\t\t\t} @else {\r\n\t\t\t\t\t<span class=\"text-breakWord\" pTooltip=\"{{ col.tooltip }}\" tooltipPosition=\"{{ col.tooltipPosition }}\">\r\n\t\t\t\t\t\t{{ rowData[col.field] }}\r\n\t\t\t\t\t</span>\r\n\t\t\t\t\t} }\r\n\t\t\t\t</td>\r\n\r\n\t\t\t\t}\r\n\t\t\t</tr>\r\n\t\t</ng-template>\r\n\t\t<ng-template pTemplate=\"expandedrow\" let-rowData let-rowIndex=\"rowIndex\">\r\n\t\t\t<ng-container *ngIf=\"rowData.children?.length\">\r\n\t\t\t\t<tr *ngFor=\"let childRow of rowData.children; let i = index\" class=\"subRow\">\r\n\t\t\t\t\t<td *ngFor=\"let col of ColumnList; let j = index\" [ngClass]=\"col.className\">\r\n\t\t\t\t\t\t<span class=\"text-breakWord\" pTooltip=\"{{ col.tooltip }}\" tooltipPosition=\"{{ col.tooltipPosition }}\">\r\n\t\t\t\t\t\t\t<ng-container *ngIf=\"col.showIndex && j === 0; else normalCell\">\r\n\t\t\t\t\t\t\t\t<!-- \u00CDndice tipo 4.a, 4.b, etc -->\r\n\t\t\t\t\t\t\t\t{{ rowIndex + 1 + \".\" + getLetter(i) }}\r\n\t\t\t\t\t\t\t</ng-container>\r\n\t\t\t\t\t\t\t<ng-template #normalCell>\r\n\t\t\t\t\t\t\t\t<!-- {{ col.field === \"id\" && i < 26 ? childRow[col.field] + \".\" + getLetter(i) : childRow[col.field] }} -->\r\n\t\t\t\t\t\t\t\t@if(col.field === \"id\" && i < 26) {\r\n\t\t\t\t\t\t\t\t<span>{{ childRow[col.field] + \".\" + getLetter(i) }}</span>\r\n\t\t\t\t\t\t\t\t} @else {\r\n\t\t\t\t\t\t\t\t<span [class]=\"col.field === 'name' ? 'prTable__expandIdentText' : ''\">{{ childRow[col.field] }}</span>\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t</ng-template>\r\n\t\t\t\t\t\t</span>\r\n\t\t\t\t\t</td>\r\n\t\t\t\t</tr>\r\n\t\t\t</ng-container>\r\n\t\t</ng-template>\r\n\r\n\t\t<ng-template #emptymessage>\r\n\t\t\t<tr>\r\n\t\t\t\t<td [attr.colspan]=\"ColumnList.length\" class=\"text-center\">\r\n\t\t\t\t\t{{ \"Nodata\" | term : GlobalTermService.languageCode }}\r\n\t\t\t\t</td>\r\n\t\t\t</tr>\r\n\t\t</ng-template>\r\n\t</p-table>\r\n</div>\r\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "ngmodule", type: TableModule }, { kind: "component", type: i2$1.Table, selector: "p-table", inputs: ["frozenColumns", "frozenValue", "style", "styleClass", "tableStyle", "tableStyleClass", "paginator", "pageLinks", "rowsPerPageOptions", "alwaysShowPaginator", "paginatorPosition", "paginatorStyleClass", "paginatorDropdownAppendTo", "paginatorDropdownScrollHeight", "currentPageReportTemplate", "showCurrentPageReport", "showJumpToPageDropdown", "showJumpToPageInput", "showFirstLastIcon", "showPageLinks", "defaultSortOrder", "sortMode", "resetPageOnSort", "selectionMode", "selectionPageOnly", "contextMenuSelection", "contextMenuSelectionMode", "dataKey", "metaKeySelection", "rowSelectable", "rowTrackBy", "lazy", "lazyLoadOnInit", "compareSelectionBy", "csvSeparator", "exportFilename", "filters", "globalFilterFields", "filterDelay", "filterLocale", "expandedRowKeys", "editingRowKeys", "rowExpandMode", "scrollable", "scrollDirection", "rowGroupMode", "scrollHeight", "virtualScroll", "virtualScrollItemSize", "virtualScrollOptions", "virtualScrollDelay", "frozenWidth", "responsive", "contextMenu", "resizableColumns", "columnResizeMode", "reorderableColumns", "loading", "loadingIcon", "showLoader", "rowHover", "customSort", "showInitialSortBadge", "autoLayout", "exportFunction", "exportHeader", "stateKey", "stateStorage", "editMode", "groupRowsBy", "size", "showGridlines", "stripedRows", "groupRowsByOrder", "responsiveLayout", "breakpoint", "paginatorLocale", "value", "columns", "first", "rows", "totalRecords", "sortField", "sortOrder", "multiSortMeta", "selection", "virtualRowHeight", "selectAll"], outputs: ["contextMenuSelectionChange", "selectAllChange", "selectionChange", "onRowSelect", "onRowUnselect", "onPage", "onSort", "onFilter", "onLazyLoad", "onRowExpand", "onRowCollapse", "onContextMenuSelect", "onColResize", "onColReorder", "onRowReorder", "onEditInit", "onEditComplete", "onEditCancel", "onHeaderCheckboxToggle", "sortFunction", "firstChange", "rowsChange", "onStateSave", "onStateRestore"] }, { kind: "directive", type: i3$1.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { kind: "directive", type: i2$1.RowToggler, selector: "[pRowToggler]", inputs: ["pRowToggler", "pRowTogglerDisabled"] }, { kind: "ngmodule", type: BadgeModule }, { kind: "ngmodule", type: TooltipModule }, { kind: "directive", type: i4.Tooltip, selector: "[pTooltip]", inputs: ["tooltipPosition", "tooltipEvent", "appendTo", "positionStyle", "tooltipStyleClass", "tooltipZIndex", "escape", "showDelay", "hideDelay", "life", "positionTop", "positionLeft", "autoHide", "fitContent", "hideOnEscape", "pTooltip", "tooltipDisabled", "tooltipOptions"] }, { kind: "pipe", type: TermPipe, name: "term" }, { kind: "ngmodule", type: CheckboxModule }, { kind: "ngmodule", type: FormsModule }, { kind: "ngmodule", type: ButtonModule }, { kind: "component", type: i2.Button, selector: "p-button", inputs: ["type", "iconPos", "icon", "badge", "label", "disabled", "loading", "loadingIcon", "raised", "rounded", "text", "plain", "severity", "outlined", "link", "tabindex", "size", "variant", "style", "styleClass", "badgeClass", "badgeSeverity", "ariaLabel", "autofocus", "fluid", "buttonProps"], outputs: ["onClick", "onFocus", "onBlur"] }] });
2081
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.1", type: TreeTableComponent, isStandalone: true, selector: "intelica-tree-table", inputs: { ComponentId: "ComponentId", ListData: "ListData", ClassName: "ClassName", groupRowsBy: "groupRowsBy", dataKey: "dataKey", DefaultSortField: "DefaultSortField" }, outputs: { EmitSortEvent: "EmitSortEvent" }, queries: [{ propertyName: "Columns", predicate: TreeColumnComponent }, { propertyName: "ColumnGroups", predicate: TreeColumnGroupComponent }], usesOnChanges: true, ngImport: i0, template: "<div class=\"prTable\">\r\n\t<p-table class=\"prTableBasic\" [value]=\"ListDataFilter\" [ngClass]=\"ClassName\" responsiveLayout=\"scroll\" [sortOrder]=\"-1\" [groupRowsBy]=\"groupRowsBy\" dataKey=\"dataKey\">\r\n\t\t<ng-template pTemplate=\"header\">\r\n\t\t\t@for (level of Levels; track $index) {\r\n\r\n\t\t\t<tr>\r\n\t\t\t\t@for (col of ColumnGroupList; track $index) { @if (col.level === level) {\r\n\r\n\t\t\t\t<th [attr.colspan]=\"col.colspan\" [attr.rowspan]=\"col.rowspan\" [style.min-width]=\"col.minWidth\">\r\n\t\t\t\t\t<div>\r\n\t\t\t\t\t\t<span pTooltip=\"{{ col.header }}\">{{ col.header }}</span>\r\n\t\t\t\t\t</div>\r\n\t\t\t\t</th>\r\n\t\t\t\t} }\r\n\t\t\t</tr>\r\n\t\t\t}\r\n\t\t\t<tr>\r\n\t\t\t\t@for (col of ColumnList; track $index) { @if(col.showHeader ){\r\n\t\t\t\t<th [class]=\"col.className\" [pSortableColumn]=\"col.sortable ? col.field : ''\" [style.width]=\"col.width\" [style.min-width]=\"col.minWidth\" (click)=\"col.sortable && OnSort(col.field)\">\r\n\t\t\t\t\t<div>\r\n\t\t\t\t\t\t<span pTooltip=\"{{ col.headerTooltip }}\" tooltipPosition=\"{{ col.headerTooltipPosition }}\">{{ col.header }}</span>\r\n\t\t\t\t\t\t<p-sortIcon *ngIf=\"col.sortable\" [field]=\"col.field\"></p-sortIcon>\r\n\t\t\t\t\t</div>\r\n\t\t\t\t</th>\r\n\t\t\t\t} }\r\n\t\t\t</tr>\r\n\t\t</ng-template>\r\n\t\t<ng-template pTemplate=\"body\" let-rowData let-rowIndex=\"rowIndex\" let-expanded=\"expanded\">\r\n\t\t\t<tr>\r\n\t\t\t\t@for (col of ColumnList; track $index) {\r\n\t\t\t\t<td [ngClass]=\"col.className\">\r\n\t\t\t\t\t@if (col.field === 'name' && rowData.children && rowData.children.length > 0) {\r\n\t\t\t\t\t<!-- Bot\u00F3n de expansi\u00F3n -->\r\n\t\t\t\t\t<div class=\"prTable__expandToggleRow\">\r\n\t\t\t\t\t\t<!-- <p-button type=\"button\" pRipple [pRowToggler]=\"rowData\" [text]=\"true\" [rounded]=\"true\" [plain]=\"true\" [icon]=\"expanded ? 'pi pi-chevron-down' : 'pi pi-chevron-right'\"></p-button> -->\r\n\t\t\t\t\t\t<p-button [pRowToggler]=\"rowData\" class=\"prButton prButton--icon prButton--iconBlue\">\r\n\t\t\t\t\t\t\t<i [class]=\"expanded ? 'icon icon-collapse-rows' : 'icon icon-expand-rows'\"></i>\r\n\t\t\t\t\t\t</p-button>\r\n\r\n\t\t\t\t\t\t<!-- Texto de la columna \"name\" -->\r\n\t\t\t\t\t\t<span class=\"text-breakWord\" pTooltip=\"{{ col.tooltip }}\" tooltipPosition=\"{{ col.tooltipPosition }}\">\r\n\t\t\t\t\t\t\t{{ rowData[col.field] }}\r\n\t\t\t\t\t\t</span>\r\n\t\t\t\t\t</div>\r\n\t\t\t\t\t} @else {\r\n\t\t\t\t\t<!-- Otras columnas -->\r\n\t\t\t\t\t@if (col.templateRef) {\r\n\t\t\t\t\t<ng-container *ngTemplateOutlet=\"col.templateRef; context: { $implicit: rowData }\"></ng-container>\r\n\t\t\t\t\t} @else {\r\n\t\t\t\t\t<span class=\"text-breakWord\" pTooltip=\"{{ col.tooltip }}\" tooltipPosition=\"{{ col.tooltipPosition }}\">\r\n\t\t\t\t\t\t{{ rowData[col.field] }}\r\n\t\t\t\t\t</span>\r\n\t\t\t\t\t} }\r\n\t\t\t\t</td>\r\n\r\n\t\t\t\t}\r\n\t\t\t</tr>\r\n\t\t</ng-template>\r\n\t\t<ng-template pTemplate=\"expandedrow\" let-rowData let-rowIndex=\"rowIndex\">\r\n\t\t\t<ng-container *ngIf=\"rowData.children?.length\">\r\n\t\t\t\t<tr *ngFor=\"let childRow of rowData.children; let i = index\" class=\"subRow\">\r\n\t\t\t\t\t<td *ngFor=\"let col of ColumnList; let j = index\" [ngClass]=\"col.className\">\r\n\t\t\t\t\t\t<span class=\"text-breakWord\" pTooltip=\"{{ col.tooltip }}\" tooltipPosition=\"{{ col.tooltipPosition }}\">\r\n\t\t\t\t\t\t\t<ng-container *ngIf=\"col.showIndex && j === 0; else normalCell\">\r\n\t\t\t\t\t\t\t\t<!-- \u00CDndice tipo 4.a, 4.b, etc -->\r\n\t\t\t\t\t\t\t\t{{ rowIndex + 1 + \".\" + getLetter(i) }}\r\n\t\t\t\t\t\t\t</ng-container>\r\n\t\t\t\t\t\t\t<ng-template #normalCell>\r\n\t\t\t\t\t\t\t\t<!-- {{ col.field === \"id\" && i < 26 ? childRow[col.field] + \".\" + getLetter(i) : childRow[col.field] }} -->\r\n\t\t\t\t\t\t\t\t@if(col.field === \"id\" && i < 26) {\r\n\t\t\t\t\t\t\t\t<span>{{ childRow[col.field] + \".\" + getLetter(i) }}</span>\r\n\t\t\t\t\t\t\t\t} @else {\r\n\t\t\t\t\t\t\t\t<span [class]=\"col.field === 'name' ? 'prTable__expandIdentText' : ''\">{{ childRow[col.field] }}</span>\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t</ng-template>\r\n\t\t\t\t\t\t</span>\r\n\t\t\t\t\t</td>\r\n\t\t\t\t</tr>\r\n\t\t\t</ng-container>\r\n\t\t</ng-template>\r\n\r\n\t\t<ng-template #emptymessage>\r\n\t\t\t<tr>\r\n\t\t\t\t<td [attr.colspan]=\"ColumnList.length\" class=\"text-center\">\r\n\t\t\t\t\t{{ \"Nodata\" | term : GlobalTermService.languageCode }}\r\n\t\t\t\t</td>\r\n\t\t\t</tr>\r\n\t\t</ng-template>\r\n\t</p-table>\r\n</div>\r\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "ngmodule", type: TableModule }, { kind: "component", type: i2$1.Table, selector: "p-table", inputs: ["frozenColumns", "frozenValue", "style", "styleClass", "tableStyle", "tableStyleClass", "paginator", "pageLinks", "rowsPerPageOptions", "alwaysShowPaginator", "paginatorPosition", "paginatorStyleClass", "paginatorDropdownAppendTo", "paginatorDropdownScrollHeight", "currentPageReportTemplate", "showCurrentPageReport", "showJumpToPageDropdown", "showJumpToPageInput", "showFirstLastIcon", "showPageLinks", "defaultSortOrder", "sortMode", "resetPageOnSort", "selectionMode", "selectionPageOnly", "contextMenuSelection", "contextMenuSelectionMode", "dataKey", "metaKeySelection", "rowSelectable", "rowTrackBy", "lazy", "lazyLoadOnInit", "compareSelectionBy", "csvSeparator", "exportFilename", "filters", "globalFilterFields", "filterDelay", "filterLocale", "expandedRowKeys", "editingRowKeys", "rowExpandMode", "scrollable", "scrollDirection", "rowGroupMode", "scrollHeight", "virtualScroll", "virtualScrollItemSize", "virtualScrollOptions", "virtualScrollDelay", "frozenWidth", "responsive", "contextMenu", "resizableColumns", "columnResizeMode", "reorderableColumns", "loading", "loadingIcon", "showLoader", "rowHover", "customSort", "showInitialSortBadge", "autoLayout", "exportFunction", "exportHeader", "stateKey", "stateStorage", "editMode", "groupRowsBy", "size", "showGridlines", "stripedRows", "groupRowsByOrder", "responsiveLayout", "breakpoint", "paginatorLocale", "value", "columns", "first", "rows", "totalRecords", "sortField", "sortOrder", "multiSortMeta", "selection", "virtualRowHeight", "selectAll"], outputs: ["contextMenuSelectionChange", "selectAllChange", "selectionChange", "onRowSelect", "onRowUnselect", "onPage", "onSort", "onFilter", "onLazyLoad", "onRowExpand", "onRowCollapse", "onContextMenuSelect", "onColResize", "onColReorder", "onRowReorder", "onEditInit", "onEditComplete", "onEditCancel", "onHeaderCheckboxToggle", "sortFunction", "firstChange", "rowsChange", "onStateSave", "onStateRestore"] }, { kind: "directive", type: i3$1.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { kind: "directive", type: i2$1.SortableColumn, selector: "[pSortableColumn]", inputs: ["pSortableColumn", "pSortableColumnDisabled"] }, { kind: "directive", type: i2$1.RowToggler, selector: "[pRowToggler]", inputs: ["pRowToggler", "pRowTogglerDisabled"] }, { kind: "component", type: i2$1.SortIcon, selector: "p-sortIcon", inputs: ["field"] }, { kind: "ngmodule", type: BadgeModule }, { kind: "ngmodule", type: TooltipModule }, { kind: "directive", type: i4.Tooltip, selector: "[pTooltip]", inputs: ["tooltipPosition", "tooltipEvent", "appendTo", "positionStyle", "tooltipStyleClass", "tooltipZIndex", "escape", "showDelay", "hideDelay", "life", "positionTop", "positionLeft", "autoHide", "fitContent", "hideOnEscape", "pTooltip", "tooltipDisabled", "tooltipOptions"] }, { kind: "pipe", type: TermPipe, name: "term" }, { kind: "ngmodule", type: CheckboxModule }, { kind: "ngmodule", type: FormsModule }, { kind: "ngmodule", type: ButtonModule }, { kind: "component", type: i2.Button, selector: "p-button", inputs: ["type", "iconPos", "icon", "badge", "label", "disabled", "loading", "loadingIcon", "raised", "rounded", "text", "plain", "severity", "outlined", "link", "tabindex", "size", "variant", "style", "styleClass", "badgeClass", "badgeSeverity", "ariaLabel", "autofocus", "fluid", "buttonProps"], outputs: ["onClick", "onFocus", "onBlur"] }] });
2053
2082
  }
2054
2083
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: TreeTableComponent, decorators: [{
2055
2084
  type: Component,
2056
- args: [{ selector: "intelica-tree-table", standalone: true, imports: [CommonModule, TableModule, BadgeModule, TooltipModule, TermPipe, CheckboxModule, FormsModule, ButtonModule], template: "<div class=\"prTable\">\r\n\t<p-table class=\"prTableBasic\" [value]=\"ListData\" [ngClass]=\"ClassName\" responsiveLayout=\"scroll\" [sortOrder]=\"-1\" [groupRowsBy]=\"groupRowsBy\" dataKey=\"dataKey\">\r\n\t\t<ng-template pTemplate=\"header\">\r\n\t\t\t@for (level of Levels; track $index) {\r\n\r\n\t\t\t<tr>\r\n\t\t\t\t@for (col of ColumnGroupList; track $index) { @if (col.level === level) {\r\n\r\n\t\t\t\t<th [attr.colspan]=\"col.colspan\" [attr.rowspan]=\"col.rowspan\" [style.min-width]=\"col.minWidth\">\r\n\t\t\t\t\t<div>\r\n\t\t\t\t\t\t<span pTooltip=\"{{ col.header }}\">{{ col.header }}</span>\r\n\t\t\t\t\t</div>\r\n\t\t\t\t</th>\r\n\t\t\t\t} }\r\n\t\t\t</tr>\r\n\t\t\t}\r\n\t\t\t<tr>\r\n\t\t\t\t@for (col of ColumnList; track $index) { @if(col.showHeader ){\r\n\t\t\t\t<th [class]=\"col.className\" [style.width]=\"col.width\" [style.min-width]=\"col.minWidth\">\r\n\t\t\t\t\t<div>\r\n\t\t\t\t\t\t<span pTooltip=\"{{ col.headerTooltip }}\" tooltipPosition=\"{{ col.headerTooltipPosition }}\">{{ col.header }}</span>\r\n\t\t\t\t\t</div>\r\n\t\t\t\t</th>\r\n\t\t\t\t} }\r\n\t\t\t</tr>\r\n\t\t</ng-template>\r\n\t\t<ng-template pTemplate=\"body\" let-rowData let-rowIndex=\"rowIndex\" let-expanded=\"expanded\">\r\n\t\t\t<tr>\r\n\t\t\t\t@for (col of ColumnList; track $index) {\r\n\t\t\t\t<td [ngClass]=\"col.className\">\r\n\t\t\t\t\t@if (col.field === 'name' && rowData.children && rowData.children.length > 0) {\r\n\t\t\t\t\t<!-- Bot\u00F3n de expansi\u00F3n -->\r\n\t\t\t\t\t<div class=\"prTable__expandToggleRow\">\r\n\t\t\t\t\t\t<!-- <p-button type=\"button\" pRipple [pRowToggler]=\"rowData\" [text]=\"true\" [rounded]=\"true\" [plain]=\"true\" [icon]=\"expanded ? 'pi pi-chevron-down' : 'pi pi-chevron-right'\"></p-button> -->\r\n\t\t\t\t\t\t<p-button [pRowToggler]=\"rowData\" class=\"prButton prButton--icon prButton--iconBlue\">\r\n\t\t\t\t\t\t\t<i [class]=\"expanded ? 'icon icon-collapse-rows' : 'icon icon-expand-rows'\"></i>\r\n\t\t\t\t\t\t</p-button>\r\n\r\n\t\t\t\t\t\t<!-- Texto de la columna \"name\" -->\r\n\t\t\t\t\t\t<span class=\"text-breakWord\" pTooltip=\"{{ col.tooltip }}\" tooltipPosition=\"{{ col.tooltipPosition }}\">\r\n\t\t\t\t\t\t\t{{ rowData[col.field] }}\r\n\t\t\t\t\t\t</span>\r\n\t\t\t\t\t</div>\r\n\t\t\t\t\t} @else {\r\n\t\t\t\t\t<!-- Otras columnas -->\r\n\t\t\t\t\t@if (col.templateRef) {\r\n\t\t\t\t\t<ng-container *ngTemplateOutlet=\"col.templateRef; context: { $implicit: rowData }\"></ng-container>\r\n\t\t\t\t\t} @else {\r\n\t\t\t\t\t<span class=\"text-breakWord\" pTooltip=\"{{ col.tooltip }}\" tooltipPosition=\"{{ col.tooltipPosition }}\">\r\n\t\t\t\t\t\t{{ rowData[col.field] }}\r\n\t\t\t\t\t</span>\r\n\t\t\t\t\t} }\r\n\t\t\t\t</td>\r\n\r\n\t\t\t\t}\r\n\t\t\t</tr>\r\n\t\t</ng-template>\r\n\t\t<ng-template pTemplate=\"expandedrow\" let-rowData let-rowIndex=\"rowIndex\">\r\n\t\t\t<ng-container *ngIf=\"rowData.children?.length\">\r\n\t\t\t\t<tr *ngFor=\"let childRow of rowData.children; let i = index\" class=\"subRow\">\r\n\t\t\t\t\t<td *ngFor=\"let col of ColumnList; let j = index\" [ngClass]=\"col.className\">\r\n\t\t\t\t\t\t<span class=\"text-breakWord\" pTooltip=\"{{ col.tooltip }}\" tooltipPosition=\"{{ col.tooltipPosition }}\">\r\n\t\t\t\t\t\t\t<ng-container *ngIf=\"col.showIndex && j === 0; else normalCell\">\r\n\t\t\t\t\t\t\t\t<!-- \u00CDndice tipo 4.a, 4.b, etc -->\r\n\t\t\t\t\t\t\t\t{{ rowIndex + 1 + \".\" + getLetter(i) }}\r\n\t\t\t\t\t\t\t</ng-container>\r\n\t\t\t\t\t\t\t<ng-template #normalCell>\r\n\t\t\t\t\t\t\t\t<!-- {{ col.field === \"id\" && i < 26 ? childRow[col.field] + \".\" + getLetter(i) : childRow[col.field] }} -->\r\n\t\t\t\t\t\t\t\t@if(col.field === \"id\" && i < 26) {\r\n\t\t\t\t\t\t\t\t<span>{{ childRow[col.field] + \".\" + getLetter(i) }}</span>\r\n\t\t\t\t\t\t\t\t} @else {\r\n\t\t\t\t\t\t\t\t<span [class]=\"col.field === 'name' ? 'prTable__expandIdentText' : ''\">{{ childRow[col.field] }}</span>\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t</ng-template>\r\n\t\t\t\t\t\t</span>\r\n\t\t\t\t\t</td>\r\n\t\t\t\t</tr>\r\n\t\t\t</ng-container>\r\n\t\t</ng-template>\r\n\r\n\t\t<ng-template #emptymessage>\r\n\t\t\t<tr>\r\n\t\t\t\t<td [attr.colspan]=\"ColumnList.length\" class=\"text-center\">\r\n\t\t\t\t\t{{ \"Nodata\" | term : GlobalTermService.languageCode }}\r\n\t\t\t\t</td>\r\n\t\t\t</tr>\r\n\t\t</ng-template>\r\n\t</p-table>\r\n</div>\r\n" }]
2085
+ args: [{ selector: "intelica-tree-table", standalone: true, imports: [CommonModule, TableModule, BadgeModule, TooltipModule, TermPipe, CheckboxModule, FormsModule, ButtonModule], template: "<div class=\"prTable\">\r\n\t<p-table class=\"prTableBasic\" [value]=\"ListDataFilter\" [ngClass]=\"ClassName\" responsiveLayout=\"scroll\" [sortOrder]=\"-1\" [groupRowsBy]=\"groupRowsBy\" dataKey=\"dataKey\">\r\n\t\t<ng-template pTemplate=\"header\">\r\n\t\t\t@for (level of Levels; track $index) {\r\n\r\n\t\t\t<tr>\r\n\t\t\t\t@for (col of ColumnGroupList; track $index) { @if (col.level === level) {\r\n\r\n\t\t\t\t<th [attr.colspan]=\"col.colspan\" [attr.rowspan]=\"col.rowspan\" [style.min-width]=\"col.minWidth\">\r\n\t\t\t\t\t<div>\r\n\t\t\t\t\t\t<span pTooltip=\"{{ col.header }}\">{{ col.header }}</span>\r\n\t\t\t\t\t</div>\r\n\t\t\t\t</th>\r\n\t\t\t\t} }\r\n\t\t\t</tr>\r\n\t\t\t}\r\n\t\t\t<tr>\r\n\t\t\t\t@for (col of ColumnList; track $index) { @if(col.showHeader ){\r\n\t\t\t\t<th [class]=\"col.className\" [pSortableColumn]=\"col.sortable ? col.field : ''\" [style.width]=\"col.width\" [style.min-width]=\"col.minWidth\" (click)=\"col.sortable && OnSort(col.field)\">\r\n\t\t\t\t\t<div>\r\n\t\t\t\t\t\t<span pTooltip=\"{{ col.headerTooltip }}\" tooltipPosition=\"{{ col.headerTooltipPosition }}\">{{ col.header }}</span>\r\n\t\t\t\t\t\t<p-sortIcon *ngIf=\"col.sortable\" [field]=\"col.field\"></p-sortIcon>\r\n\t\t\t\t\t</div>\r\n\t\t\t\t</th>\r\n\t\t\t\t} }\r\n\t\t\t</tr>\r\n\t\t</ng-template>\r\n\t\t<ng-template pTemplate=\"body\" let-rowData let-rowIndex=\"rowIndex\" let-expanded=\"expanded\">\r\n\t\t\t<tr>\r\n\t\t\t\t@for (col of ColumnList; track $index) {\r\n\t\t\t\t<td [ngClass]=\"col.className\">\r\n\t\t\t\t\t@if (col.field === 'name' && rowData.children && rowData.children.length > 0) {\r\n\t\t\t\t\t<!-- Bot\u00F3n de expansi\u00F3n -->\r\n\t\t\t\t\t<div class=\"prTable__expandToggleRow\">\r\n\t\t\t\t\t\t<!-- <p-button type=\"button\" pRipple [pRowToggler]=\"rowData\" [text]=\"true\" [rounded]=\"true\" [plain]=\"true\" [icon]=\"expanded ? 'pi pi-chevron-down' : 'pi pi-chevron-right'\"></p-button> -->\r\n\t\t\t\t\t\t<p-button [pRowToggler]=\"rowData\" class=\"prButton prButton--icon prButton--iconBlue\">\r\n\t\t\t\t\t\t\t<i [class]=\"expanded ? 'icon icon-collapse-rows' : 'icon icon-expand-rows'\"></i>\r\n\t\t\t\t\t\t</p-button>\r\n\r\n\t\t\t\t\t\t<!-- Texto de la columna \"name\" -->\r\n\t\t\t\t\t\t<span class=\"text-breakWord\" pTooltip=\"{{ col.tooltip }}\" tooltipPosition=\"{{ col.tooltipPosition }}\">\r\n\t\t\t\t\t\t\t{{ rowData[col.field] }}\r\n\t\t\t\t\t\t</span>\r\n\t\t\t\t\t</div>\r\n\t\t\t\t\t} @else {\r\n\t\t\t\t\t<!-- Otras columnas -->\r\n\t\t\t\t\t@if (col.templateRef) {\r\n\t\t\t\t\t<ng-container *ngTemplateOutlet=\"col.templateRef; context: { $implicit: rowData }\"></ng-container>\r\n\t\t\t\t\t} @else {\r\n\t\t\t\t\t<span class=\"text-breakWord\" pTooltip=\"{{ col.tooltip }}\" tooltipPosition=\"{{ col.tooltipPosition }}\">\r\n\t\t\t\t\t\t{{ rowData[col.field] }}\r\n\t\t\t\t\t</span>\r\n\t\t\t\t\t} }\r\n\t\t\t\t</td>\r\n\r\n\t\t\t\t}\r\n\t\t\t</tr>\r\n\t\t</ng-template>\r\n\t\t<ng-template pTemplate=\"expandedrow\" let-rowData let-rowIndex=\"rowIndex\">\r\n\t\t\t<ng-container *ngIf=\"rowData.children?.length\">\r\n\t\t\t\t<tr *ngFor=\"let childRow of rowData.children; let i = index\" class=\"subRow\">\r\n\t\t\t\t\t<td *ngFor=\"let col of ColumnList; let j = index\" [ngClass]=\"col.className\">\r\n\t\t\t\t\t\t<span class=\"text-breakWord\" pTooltip=\"{{ col.tooltip }}\" tooltipPosition=\"{{ col.tooltipPosition }}\">\r\n\t\t\t\t\t\t\t<ng-container *ngIf=\"col.showIndex && j === 0; else normalCell\">\r\n\t\t\t\t\t\t\t\t<!-- \u00CDndice tipo 4.a, 4.b, etc -->\r\n\t\t\t\t\t\t\t\t{{ rowIndex + 1 + \".\" + getLetter(i) }}\r\n\t\t\t\t\t\t\t</ng-container>\r\n\t\t\t\t\t\t\t<ng-template #normalCell>\r\n\t\t\t\t\t\t\t\t<!-- {{ col.field === \"id\" && i < 26 ? childRow[col.field] + \".\" + getLetter(i) : childRow[col.field] }} -->\r\n\t\t\t\t\t\t\t\t@if(col.field === \"id\" && i < 26) {\r\n\t\t\t\t\t\t\t\t<span>{{ childRow[col.field] + \".\" + getLetter(i) }}</span>\r\n\t\t\t\t\t\t\t\t} @else {\r\n\t\t\t\t\t\t\t\t<span [class]=\"col.field === 'name' ? 'prTable__expandIdentText' : ''\">{{ childRow[col.field] }}</span>\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t</ng-template>\r\n\t\t\t\t\t\t</span>\r\n\t\t\t\t\t</td>\r\n\t\t\t\t</tr>\r\n\t\t\t</ng-container>\r\n\t\t</ng-template>\r\n\r\n\t\t<ng-template #emptymessage>\r\n\t\t\t<tr>\r\n\t\t\t\t<td [attr.colspan]=\"ColumnList.length\" class=\"text-center\">\r\n\t\t\t\t\t{{ \"Nodata\" | term : GlobalTermService.languageCode }}\r\n\t\t\t\t</td>\r\n\t\t\t</tr>\r\n\t\t</ng-template>\r\n\t</p-table>\r\n</div>\r\n" }]
2057
2086
  }], propDecorators: { ComponentId: [{
2058
2087
  type: Input
2059
2088
  }], ListData: [{
@@ -2064,12 +2093,16 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImpor
2064
2093
  type: Input
2065
2094
  }], dataKey: [{
2066
2095
  type: Input
2096
+ }], DefaultSortField: [{
2097
+ type: Input
2067
2098
  }], Columns: [{
2068
2099
  type: ContentChildren,
2069
2100
  args: [TreeColumnComponent]
2070
2101
  }], ColumnGroups: [{
2071
2102
  type: ContentChildren,
2072
2103
  args: [TreeColumnGroupComponent]
2104
+ }], EmitSortEvent: [{
2105
+ type: Output
2073
2106
  }] } });
2074
2107
 
2075
2108
  class MatrixColumnComponent {