intelica-library-ui 0.1.193 → 0.1.195
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.
|
@@ -2586,6 +2586,7 @@ class TreeTableComponent {
|
|
|
2586
2586
|
SelectedIdentifier = null;
|
|
2587
2587
|
ListSearchOptions = [];
|
|
2588
2588
|
ShowRowPerPage = true;
|
|
2589
|
+
ExpandedColumnIdent = "";
|
|
2589
2590
|
EmitSelectedItem = new EventEmitter();
|
|
2590
2591
|
EmitListDataFilter = new EventEmitter();
|
|
2591
2592
|
EmitSearchEvent = new EventEmitter();
|
|
@@ -2789,7 +2790,7 @@ class TreeTableComponent {
|
|
|
2789
2790
|
this.ResetTable();
|
|
2790
2791
|
}
|
|
2791
2792
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: TreeTableComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2792
|
-
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", DefaultSortOrder: "DefaultSortOrder", scrollHeight: "scrollHeight", scrollable: "scrollable", tableStyle: "tableStyle", ShowSearch: "ShowSearch", ShowPagination: "ShowPagination", RowsPerPage: "RowsPerPage", AllowedPageSizes: "AllowedPageSizes", ShowCheckbox: "ShowCheckbox", ShowIndex: "ShowIndex", ShowSearchTooltip: "ShowSearchTooltip", ListDataSelected: "ListDataSelected", SelectedIdentifier: "SelectedIdentifier", ListSearchOptions: "ListSearchOptions", ShowRowPerPage: "ShowRowPerPage" }, outputs: { EmitSelectedItem: "EmitSelectedItem", EmitListDataFilter: "EmitListDataFilter", EmitSearchEvent: "EmitSearchEvent", EmitSortEvent: "EmitSortEvent" }, providers: [FormatCellPipe, DatePipe], queries: [{ propertyName: "AdditionalTemplate", first: true, predicate: ["additionalTemplate"], descendants: true }, { propertyName: "AdditionalCentralTemplate", first: true, predicate: ["additionalCentralTemplate"], descendants: true }, { propertyName: "AdditionalExtendedTemplate", first: true, predicate: ["additionalExtendedTemplate"], descendants: true }, { propertyName: "Columns", predicate: TreeColumnComponent }, { propertyName: "ColumnGroups", predicate: TreeColumnGroupComponent }, { propertyName: "RowResumenGroups", predicate: RowResumenTreeComponent }], viewQueries: [{ propertyName: "PaginatorTable", first: true, predicate: ["paginatorTable"], descendants: true }, { propertyName: "SearchTable", first: true, predicate: ["searchTable"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "<div class=\"prTable\">\r\n <div class=\"prTableTools\">\r\n <div class=\"prTableTools__new prTableTools__new--left\">\r\n @if (AdditionalTemplate) {\r\n <ng-container *ngTemplateOutlet=\"AdditionalTemplate\"></ng-container>\r\n }\r\n </div>\r\n\r\n @if (ShowSearch) {\r\n <intelica-search\r\n #searchTable\r\n [ComponentId]=\"ComponentId + 'Search'\"\r\n (OnSearch)=\"ExecuteSearch($event)\"\r\n [SearchFieldOptions]=\"ListSearchOptionsSimple\"\r\n [SearchOnKeyup]=\"false\"\r\n [SimpleSearchInput]=\"false\"\r\n [ShowTooltip]=\"ShowSearchTooltip\"\r\n ></intelica-search>\r\n } @if (AdditionalCentralTemplate) {\r\n <div class=\"prTableTools__new prTableTools__new--right\">\r\n <ng-container\r\n *ngTemplateOutlet=\"AdditionalCentralTemplate\"\r\n ></ng-container>\r\n </div>\r\n }\r\n </div>\r\n @if (AdditionalExtendedTemplate) {\r\n <div class=\"prTableTools justify-content-start\">\r\n <ng-container *ngTemplateOutlet=\"AdditionalExtendedTemplate\"></ng-container>\r\n </div>\r\n\r\n }\r\n <p-table\r\n class=\"prTableBasic\"\r\n [value]=\"ListDataTable\"\r\n [ngClass]=\"ClassName\"\r\n responsiveLayout=\"scroll\"\r\n [(selection)]=\"ListDataSelected\"\r\n (onHeaderCheckboxToggle)=\"SelectAll($event)\"\r\n (onRowSelect)=\"OnRowSelect($event)\"\r\n (onRowUnselect)=\"OnRowUnselect($event)\"\r\n [groupRowsBy]=\"groupRowsBy\"\r\n [dataKey]=\"dataKey\"\r\n [sortField]=\"DefaultSortField\"\r\n [scrollable]=\"scrollable\"\r\n [scrollHeight]=\"scrollable ? scrollHeight : 'auto'\"\r\n [tableStyle]=\"tableStyle\"\r\n [sortOrder]=\"SortOrder\"\r\n >\r\n <ng-template pTemplate=\"header\">\r\n @for (level of Levels; track $index) {\r\n <tr>\r\n @for (col of ColumnGroupList; track $index) { @if (col.level === level)\r\n {\r\n <th\r\n [attr.colspan]=\"col.colspan\"\r\n [attr.rowspan]=\"col.rowspan\"\r\n [pSortableColumn]=\"col.sortable ? col.field : ''\"\r\n [style.min-width]=\"col.minWidth\"\r\n (click)=\"col.sortable && OnSort(col.field)\"\r\n >\r\n <div>\r\n <span pTooltip=\"{{ col.header }}\">{{ col.header }}</span>\r\n <p-sortIcon *ngIf=\"col.sortable\" [field]=\"col.field\"></p-sortIcon>\r\n </div>\r\n </th>\r\n } } @if (ShowCheckbox && level === 0 && ColumnGroupList.length != 0) {\r\n <th\r\n class=\"text-center\"\r\n style=\"width: 4%\"\r\n [attr.rowspan]=\"MaxLevel === 1 ? 2 : MaxLevel\"\r\n >\r\n <p-tableHeaderCheckbox\r\n class=\"prCheckbox\"\r\n [ngClass]=\"{\r\n 'prCheckbox--indeterminate':\r\n ListDataSelectedTemp.length > 0 &&\r\n ListDataSelectedTemp.length < ListDataFilter.length\r\n }\"\r\n />\r\n </th>\r\n }\r\n </tr>\r\n }\r\n\r\n <tr>\r\n @for (col of ColumnList; track $index) { @if(col.showHeader) {\r\n <th\r\n [class]=\"col.className\"\r\n [pSortableColumn]=\"\r\n !col.isChecboxColumn && col.sortable ? col.field : ''\r\n \"\r\n [style.width]=\"col.width\"\r\n [style.min-width]=\"col.minWidth\"\r\n (click)=\"!col.isChecboxColumn && col.sortable && OnSort(col.field)\"\r\n >\r\n <div>\r\n <span [pTooltip]=\"col.headerTooltip?.trim() ? col.headerTooltip : undefined\"\r\n [tooltipPosition]=\"col.headerTooltipPosition || 'top'\">\r\n {{ col.header }}\r\n </span>\r\n \r\n @if (!col.showIndex) { @if (col.isChecboxColumn) {\r\n <br />\r\n <p-checkbox\r\n [binary]=\"true\"\r\n (click)=\"$event.stopPropagation()\"\r\n (onChange)=\"OnHeaderCheckboxChange($event, col.field)\"\r\n [attr.data-check]=\"col.field\"\r\n ></p-checkbox>\r\n } @else {\r\n <p-sortIcon *ngIf=\"col.sortable\" [field]=\"col.field\"></p-sortIcon>\r\n } }\r\n </div>\r\n </th>\r\n } } @if (ShowCheckbox && ColumnGroupList.length == 0) {\r\n <th class=\"text-center\" style=\"width: 4%\">\r\n <p-tableHeaderCheckbox\r\n class=\"prCheckbox\"\r\n [ngClass]=\"{\r\n 'prCheckbox--indeterminate':\r\n ListDataSelectedTemp.length > 0 &&\r\n ListDataSelectedTemp.length < ListDataFilter.length\r\n }\"\r\n />\r\n </th>\r\n }\r\n </tr>\r\n\r\n @if (ListDataFilter.length > 0) {\r\n <tr class=\"fixedRow\">\r\n @for (col of RowResumenList; track $index) {\r\n <td\r\n [ngClass]=\"col.className\"\r\n [attr.colspan]=\"col.colspan\"\r\n [attr.rowspan]=\"col.rowspan\"\r\n >\r\n @if (col.templateRef) {\r\n <span\r\n ><ng-container *ngTemplateOutlet=\"col.templateRef\"></ng-container\r\n ></span>\r\n } @else {\r\n <ng-template #defaultContent></ng-template>\r\n }\r\n </td>\r\n }\r\n </tr>\r\n }\r\n </ng-template>\r\n\r\n <ng-template\r\n pTemplate=\"body\"\r\n let-rowData\r\n let-rowIndex=\"rowIndex\"\r\n let-expanded=\"expanded\"\r\n >\r\n <tr>\r\n @for (col of ColumnList; track $index) {\r\n <td [ngClass]=\"col.className\">\r\n @if (col.showIndex) {\r\n {{ rowIndex + 1 + (CurrentPage - 1) * RowsPerPage }}\r\n } @else if (col.field === 'name' && rowData.children &&\r\n rowData.children.length > 0) {\r\n <div class=\"prTable__expandToggleRow\">\r\n <p-button\r\n [pRowToggler]=\"rowData\"\r\n class=\"prButton prButton--icon prButton--iconBlue\"\r\n >\r\n <i\r\n [class]=\"\r\n expanded ? 'icon icon-collapse-rows' : 'icon icon-expand-rows'\r\n \"\r\n ></i>\r\n </p-button>\r\n <span\r\n class=\"text-breakWord\"\r\n pTooltip=\"{{ col.tooltip }}\"\r\n tooltipPosition=\"{{ col.tooltipPosition }}\"\r\n >\r\n {{ rowData[col.field] | formatCell : col.formatType }}\r\n </span>\r\n </div>\r\n } @else { @if (col.templateRef) {\r\n <ng-container\r\n *ngTemplateOutlet=\"col.templateRef; context: { $implicit: rowData }\"\r\n ></ng-container>\r\n } @else if (col.isChecboxColumn) {\r\n <p-checkbox\r\n [binary]=\"true\"\r\n [(ngModel)]=\"rowData[col.field]\"\r\n (onChange)=\"IsInderteminate(col.field)\"\r\n ></p-checkbox>\r\n } @else {\r\n <span\r\n class=\"text-breakWord\"\r\n pTooltip=\"{{ col.tooltip }}\"\r\n tooltipPosition=\"{{ col.tooltipPosition }}\"\r\n >\r\n {{ rowData[col.field] | formatCell : col.formatType }}\r\n </span>\r\n } }\r\n </td>\r\n } @if (ShowCheckbox) {\r\n <td class=\"text-center\">\r\n <p-tableCheckbox [value]=\"rowData\" class=\"prCheckbox\" />\r\n </td>\r\n }\r\n </tr>\r\n </ng-template>\r\n\r\n <ng-template pTemplate=\"expandedrow\" let-rowData let-rowIndex=\"rowIndex\">\r\n <ng-container *ngIf=\"rowData.children?.length\">\r\n <tr\r\n *ngFor=\"let childRow of rowData.children; let i = index\"\r\n class=\"subRow\"\r\n >\r\n <td\r\n *ngFor=\"let col of ColumnList; let j = index\"\r\n [ngClass]=\"col.className\"\r\n >\r\n <span\r\n class=\"text-breakWord\"\r\n pTooltip=\"{{ col.tooltip }}\"\r\n tooltipPosition=\"{{ col.tooltipPosition }}\"\r\n >\r\n <ng-container *ngIf=\"col.showIndex && j === 0; else normalCell\">\r\n {{ rowIndex + 1 + \".\" + getLetter(i) }}\r\n </ng-container>\r\n <ng-template #normalCell>\r\n @if (col.field === \"id\" && i < 26) {\r\n <span>{{ childRow[col.field] + \".\" + getLetter(i) }}</span>\r\n } @else {\r\n <ng-container *ngIf=\"col.templateRef; else defaultExpandedContent\">\r\n <ng-container *ngTemplateOutlet=\"col.templateRef; context: { $implicit: childRow }\"></ng-container>\r\n </ng-container>\r\n <ng-template #defaultExpandedContent>\r\n <span [class]=\"col.field === 'name' ? 'prTable__expandIdentText' : ''\">\r\n {{ childRow[col.field] | formatCell : col.formatType }}\r\n </span>\r\n </ng-template> \r\n }\r\n </ng-template>\r\n </span>\r\n </td>\r\n </tr>\r\n </ng-container>\r\n </ng-template>\r\n\r\n <ng-template #emptymessage>\r\n <tr>\r\n <td\r\n [attr.colspan]=\"ColumnList.length + (ShowCheckbox ? 1 : 0)\"\r\n class=\"text-center\"\r\n >\r\n {{ \"Nodata\" | term : GlobalTermService.languageCode }}\r\n </td>\r\n </tr>\r\n </ng-template>\r\n </p-table>\r\n\r\n <div class=\"prTableToolsBottom\">\r\n @if(TotalRecords !== 0){\r\n @if (ShowRowPerPage) {\r\n <div class=\"prTableToolsBottom__itemPerPage\">\r\n {{ \"ItemPerPage\" | term : GlobalTermService.languageCode }}\r\n <p-select\r\n [options]=\"AllowedPageSizes\"\r\n [ngModel]=\"RowsPerPage\"\r\n appendTo=\"body\"\r\n (onChange)=\"OnRowsPerPageChange($event.value)\"\r\n />\r\n <label for=\"pageSize\" class=\"control-label\">\r\n {{ 1 + RowsPerPage * (CurrentPage - 1) }} -\r\n {{\r\n CurrentPage * RowsPerPage >= TotalRecords\r\n ? TotalRecords\r\n : CurrentPage * RowsPerPage\r\n }}\r\n {{ \"Of\" | term : GlobalTermService.languageCode }} {{ TotalRecords }}\r\n {{ \"Items\" | term : GlobalTermService.languageCode }}\r\n </label>\r\n </div>\r\n } @if (ShowPagination) {\r\n <intelica-paginator\r\n #paginatorTable\r\n [TotalItems]=\"ListDataFilter.length\"\r\n [ItemsPerPage]=\"RowsPerPage\"\r\n (PageChange)=\"OnPageChange($event)\"\r\n >\r\n </intelica-paginator>\r\n }\r\n }\r\n </div>\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: "component", type: SearchComponent, selector: "intelica-search", inputs: ["ComponentId", "ShowTooltip", "SearchFieldOptions", "SearchOnKeyup", "SimpleSearchInput", "Placeholder"], outputs: ["OnSearch"] }, { kind: "component", type: PaginatorComponent, selector: "intelica-paginator", inputs: ["TotalItems", "CurrentPage", "ItemsPerPage"], outputs: ["PageChange"] }, { kind: "component", type: Select, selector: "p-select", inputs: ["id", "scrollHeight", "filter", "name", "style", "panelStyle", "styleClass", "panelStyleClass", "readonly", "required", "editable", "appendTo", "tabindex", "placeholder", "loadingIcon", "filterPlaceholder", "filterLocale", "variant", "inputId", "dataKey", "filterBy", "filterFields", "autofocus", "resetFilterOnHide", "checkmark", "dropdownIcon", "loading", "optionLabel", "optionValue", "optionDisabled", "optionGroupLabel", "optionGroupChildren", "autoDisplayFirst", "group", "showClear", "emptyFilterMessage", "emptyMessage", "lazy", "virtualScroll", "virtualScrollItemSize", "virtualScrollOptions", "size", "overlayOptions", "ariaFilterLabel", "ariaLabel", "ariaLabelledBy", "filterMatchMode", "maxlength", "tooltip", "tooltipPosition", "tooltipPositionStyle", "tooltipStyleClass", "focusOnHover", "selectOnFocus", "autoOptionFocus", "autofocusFilter", "fluid", "disabled", "itemSize", "autoZIndex", "baseZIndex", "showTransitionOptions", "hideTransitionOptions", "filterValue", "options"], outputs: ["onChange", "onFilter", "onFocus", "onBlur", "onClick", "onShow", "onHide", "onClear", "onLazyLoad"] }, { 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: "component", type: i2$1.TableCheckbox, selector: "p-tableCheckbox", inputs: ["disabled", "value", "index", "inputId", "name", "required", "ariaLabel"] }, { kind: "component", type: i2$1.TableHeaderCheckbox, selector: "p-tableHeaderCheckbox", inputs: ["disabled", "inputId", "name", "ariaLabel"] }, { 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: "component", type: i5.Checkbox, selector: "p-checkbox, p-checkBox, p-check-box", inputs: ["value", "name", "disabled", "binary", "ariaLabelledBy", "ariaLabel", "tabindex", "inputId", "style", "inputStyle", "styleClass", "inputClass", "indeterminate", "size", "formControl", "checkboxIcon", "readonly", "required", "autofocus", "trueValue", "falseValue", "variant"], outputs: ["onChange", "onFocus", "onBlur"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { 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"] }, { kind: "pipe", type: FormatCellPipe, name: "formatCell" }] });
|
|
2793
|
+
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", DefaultSortOrder: "DefaultSortOrder", scrollHeight: "scrollHeight", scrollable: "scrollable", tableStyle: "tableStyle", ShowSearch: "ShowSearch", ShowPagination: "ShowPagination", RowsPerPage: "RowsPerPage", AllowedPageSizes: "AllowedPageSizes", ShowCheckbox: "ShowCheckbox", ShowIndex: "ShowIndex", ShowSearchTooltip: "ShowSearchTooltip", ListDataSelected: "ListDataSelected", SelectedIdentifier: "SelectedIdentifier", ListSearchOptions: "ListSearchOptions", ShowRowPerPage: "ShowRowPerPage", ExpandedColumnIdent: "ExpandedColumnIdent" }, outputs: { EmitSelectedItem: "EmitSelectedItem", EmitListDataFilter: "EmitListDataFilter", EmitSearchEvent: "EmitSearchEvent", EmitSortEvent: "EmitSortEvent" }, providers: [FormatCellPipe, DatePipe], queries: [{ propertyName: "AdditionalTemplate", first: true, predicate: ["additionalTemplate"], descendants: true }, { propertyName: "AdditionalCentralTemplate", first: true, predicate: ["additionalCentralTemplate"], descendants: true }, { propertyName: "AdditionalExtendedTemplate", first: true, predicate: ["additionalExtendedTemplate"], descendants: true }, { propertyName: "Columns", predicate: TreeColumnComponent }, { propertyName: "ColumnGroups", predicate: TreeColumnGroupComponent }, { propertyName: "RowResumenGroups", predicate: RowResumenTreeComponent }], viewQueries: [{ propertyName: "PaginatorTable", first: true, predicate: ["paginatorTable"], descendants: true }, { propertyName: "SearchTable", first: true, predicate: ["searchTable"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "<div class=\"prTable\">\r\n <div class=\"prTableTools\">\r\n <div class=\"prTableTools__new prTableTools__new--left\">\r\n @if (AdditionalTemplate) {\r\n <ng-container *ngTemplateOutlet=\"AdditionalTemplate\"></ng-container>\r\n }\r\n </div>\r\n\r\n @if (ShowSearch) {\r\n <intelica-search\r\n #searchTable\r\n [ComponentId]=\"ComponentId + 'Search'\"\r\n (OnSearch)=\"ExecuteSearch($event)\"\r\n [SearchFieldOptions]=\"ListSearchOptionsSimple\"\r\n [SearchOnKeyup]=\"false\"\r\n [SimpleSearchInput]=\"false\"\r\n [ShowTooltip]=\"ShowSearchTooltip\"\r\n ></intelica-search>\r\n } @if (AdditionalCentralTemplate) {\r\n <div class=\"prTableTools__new prTableTools__new--right\">\r\n <ng-container\r\n *ngTemplateOutlet=\"AdditionalCentralTemplate\"\r\n ></ng-container>\r\n </div>\r\n }\r\n </div>\r\n @if (AdditionalExtendedTemplate) {\r\n <div class=\"prTableTools justify-content-start\">\r\n <ng-container *ngTemplateOutlet=\"AdditionalExtendedTemplate\"></ng-container>\r\n </div>\r\n\r\n }\r\n <p-table\r\n class=\"prTableBasic\"\r\n [value]=\"ListDataTable\"\r\n [ngClass]=\"ClassName\"\r\n responsiveLayout=\"scroll\"\r\n [(selection)]=\"ListDataSelected\"\r\n (onHeaderCheckboxToggle)=\"SelectAll($event)\"\r\n (onRowSelect)=\"OnRowSelect($event)\"\r\n (onRowUnselect)=\"OnRowUnselect($event)\"\r\n [groupRowsBy]=\"groupRowsBy\"\r\n [dataKey]=\"dataKey\"\r\n [sortField]=\"DefaultSortField\"\r\n [scrollable]=\"scrollable\"\r\n [scrollHeight]=\"scrollable ? scrollHeight : 'auto'\"\r\n [tableStyle]=\"tableStyle\"\r\n [sortOrder]=\"SortOrder\"\r\n >\r\n <ng-template pTemplate=\"header\">\r\n @for (level of Levels; track $index) {\r\n <tr>\r\n @for (col of ColumnGroupList; track $index) { @if (col.level === level)\r\n {\r\n <th\r\n [attr.colspan]=\"col.colspan\"\r\n [attr.rowspan]=\"col.rowspan\"\r\n [pSortableColumn]=\"col.sortable ? col.field : ''\"\r\n [style.min-width]=\"col.minWidth\"\r\n (click)=\"col.sortable && OnSort(col.field)\"\r\n >\r\n <div>\r\n <span pTooltip=\"{{ col.header }}\">{{ col.header }}</span>\r\n <p-sortIcon *ngIf=\"col.sortable\" [field]=\"col.field\"></p-sortIcon>\r\n </div>\r\n </th>\r\n } } @if (ShowCheckbox && level === 0 && ColumnGroupList.length != 0) {\r\n <th\r\n class=\"text-center\"\r\n style=\"width: 4%\"\r\n [attr.rowspan]=\"MaxLevel === 1 ? 2 : MaxLevel\"\r\n >\r\n <p-tableHeaderCheckbox\r\n class=\"prCheckbox\"\r\n [ngClass]=\"{\r\n 'prCheckbox--indeterminate':\r\n ListDataSelectedTemp.length > 0 &&\r\n ListDataSelectedTemp.length < ListDataFilter.length\r\n }\"\r\n />\r\n </th>\r\n }\r\n </tr>\r\n }\r\n\r\n <tr>\r\n @for (col of ColumnList; track $index) { @if(col.showHeader) {\r\n <th\r\n [class]=\"col.className\"\r\n [pSortableColumn]=\"\r\n !col.isChecboxColumn && col.sortable ? col.field : ''\r\n \"\r\n [style.width]=\"col.width\"\r\n [style.min-width]=\"col.minWidth\"\r\n (click)=\"!col.isChecboxColumn && col.sortable && OnSort(col.field)\"\r\n >\r\n <div>\r\n <span [pTooltip]=\"col.headerTooltip?.trim() ? col.headerTooltip : undefined\"\r\n [tooltipPosition]=\"col.headerTooltipPosition || 'top'\">\r\n {{ col.header }}\r\n </span>\r\n \r\n @if (!col.showIndex) { @if (col.isChecboxColumn) {\r\n <br />\r\n <p-checkbox\r\n [binary]=\"true\"\r\n (click)=\"$event.stopPropagation()\"\r\n (onChange)=\"OnHeaderCheckboxChange($event, col.field)\"\r\n [attr.data-check]=\"col.field\"\r\n ></p-checkbox>\r\n } @else {\r\n <p-sortIcon *ngIf=\"col.sortable\" [field]=\"col.field\"></p-sortIcon>\r\n } }\r\n </div>\r\n </th>\r\n } } @if (ShowCheckbox && ColumnGroupList.length == 0) {\r\n <th class=\"text-center\" style=\"width: 4%\">\r\n <p-tableHeaderCheckbox\r\n class=\"prCheckbox\"\r\n [ngClass]=\"{\r\n 'prCheckbox--indeterminate':\r\n ListDataSelectedTemp.length > 0 &&\r\n ListDataSelectedTemp.length < ListDataFilter.length\r\n }\"\r\n />\r\n </th>\r\n }\r\n </tr>\r\n\r\n @if (ListDataFilter.length > 0) {\r\n <tr class=\"fixedRow\">\r\n @for (col of RowResumenList; track $index) {\r\n <td\r\n [ngClass]=\"col.className\"\r\n [attr.colspan]=\"col.colspan\"\r\n [attr.rowspan]=\"col.rowspan\"\r\n >\r\n @if (col.templateRef) {\r\n <span\r\n ><ng-container *ngTemplateOutlet=\"col.templateRef\"></ng-container\r\n ></span>\r\n } @else {\r\n <ng-template #defaultContent></ng-template>\r\n }\r\n </td>\r\n }\r\n </tr>\r\n }\r\n </ng-template>\r\n\r\n <ng-template\r\n pTemplate=\"body\"\r\n let-rowData\r\n let-rowIndex=\"rowIndex\"\r\n let-expanded=\"expanded\"\r\n >\r\n <tr>\r\n @for (col of ColumnList; track $index) {\r\n <td [ngClass]=\"col.className\">\r\n @if (col.showIndex) {\r\n {{ rowIndex + 1 + (CurrentPage - 1) * RowsPerPage }}\r\n } @else if ((col.field === (ExpandedColumnIdent?.trim() || 'name')) && (rowData.children?.length ?? 0) > 0\r\n ) {\r\n <div class=\"prTable__expandToggleRow\">\r\n <p-button\r\n [pRowToggler]=\"rowData\"\r\n class=\"prButton prButton--icon prButton--iconBlue\"\r\n >\r\n <i\r\n [class]=\"\r\n expanded ? 'icon icon-collapse-rows' : 'icon icon-expand-rows'\r\n \"\r\n ></i>\r\n </p-button>\r\n <span\r\n class=\"text-breakWord\"\r\n pTooltip=\"{{ col.tooltip }}\"\r\n tooltipPosition=\"{{ col.tooltipPosition }}\"\r\n >\r\n {{ rowData[col.field] | formatCell : col.formatType }}\r\n </span>\r\n </div>\r\n } @else { @if (col.templateRef) {\r\n <ng-container\r\n *ngTemplateOutlet=\"col.templateRef; context: { $implicit: rowData }\"\r\n ></ng-container>\r\n } @else if (col.isChecboxColumn) {\r\n <p-checkbox\r\n [binary]=\"true\"\r\n [(ngModel)]=\"rowData[col.field]\"\r\n (onChange)=\"IsInderteminate(col.field)\"\r\n ></p-checkbox>\r\n } @else {\r\n <span\r\n class=\"text-breakWord\"\r\n pTooltip=\"{{ col.tooltip }}\"\r\n tooltipPosition=\"{{ col.tooltipPosition }}\"\r\n >\r\n {{ rowData[col.field] | formatCell : col.formatType }}\r\n </span>\r\n } }\r\n </td>\r\n } @if (ShowCheckbox) {\r\n <td class=\"text-center\">\r\n <p-tableCheckbox [value]=\"rowData\" class=\"prCheckbox\" />\r\n </td>\r\n }\r\n </tr>\r\n </ng-template>\r\n\r\n <ng-template pTemplate=\"expandedrow\" let-rowData let-rowIndex=\"rowIndex\">\r\n <ng-container *ngIf=\"rowData.children?.length\">\r\n <tr\r\n *ngFor=\"let childRow of rowData.children; let i = index\"\r\n class=\"subRow\"\r\n >\r\n <td\r\n *ngFor=\"let col of ColumnList; let j = index\"\r\n [ngClass]=\"col.className\"\r\n >\r\n <span\r\n class=\"text-breakWord\"\r\n pTooltip=\"{{ col.tooltip }}\"\r\n tooltipPosition=\"{{ col.tooltipPosition }}\"\r\n >\r\n <ng-container *ngIf=\"col.showIndex && j === 0; else normalCell\">\r\n {{ rowIndex + 1 + \".\" + getLetter(i) }}\r\n </ng-container>\r\n <ng-template #normalCell>\r\n @if (col.field === \"id\" && i < 26) {\r\n <span>{{ childRow[col.field] + \".\" + getLetter(i) }}</span>\r\n } @else {\r\n <ng-container *ngIf=\"col.templateRef; else defaultExpandedContent\">\r\n <ng-container *ngTemplateOutlet=\"col.templateRef; context: { $implicit: childRow }\"></ng-container>\r\n </ng-container>\r\n <ng-template #defaultExpandedContent>\r\n <span [class]=\"col.field === (ExpandedColumnIdent || 'name') ? 'prTable__expandIdentText' : ''\">\r\n {{ childRow[col.field] | formatCell : col.formatType }}\r\n </span>\r\n </ng-template> \r\n }\r\n </ng-template>\r\n </span>\r\n </td>\r\n </tr>\r\n </ng-container>\r\n </ng-template>\r\n\r\n <ng-template #emptymessage>\r\n <tr>\r\n <td\r\n [attr.colspan]=\"ColumnList.length + (ShowCheckbox ? 1 : 0)\"\r\n class=\"text-center\"\r\n >\r\n {{ \"Nodata\" | term : GlobalTermService.languageCode }}\r\n </td>\r\n </tr>\r\n </ng-template>\r\n </p-table>\r\n\r\n <div class=\"prTableToolsBottom\">\r\n @if(TotalRecords !== 0){\r\n @if (ShowRowPerPage) {\r\n <div class=\"prTableToolsBottom__itemPerPage\">\r\n {{ \"ItemPerPage\" | term : GlobalTermService.languageCode }}\r\n <p-select\r\n [options]=\"AllowedPageSizes\"\r\n [ngModel]=\"RowsPerPage\"\r\n appendTo=\"body\"\r\n (onChange)=\"OnRowsPerPageChange($event.value)\"\r\n />\r\n <label for=\"pageSize\" class=\"control-label\">\r\n {{ 1 + RowsPerPage * (CurrentPage - 1) }} -\r\n {{\r\n CurrentPage * RowsPerPage >= TotalRecords\r\n ? TotalRecords\r\n : CurrentPage * RowsPerPage\r\n }}\r\n {{ \"Of\" | term : GlobalTermService.languageCode }} {{ TotalRecords }}\r\n {{ \"Items\" | term : GlobalTermService.languageCode }}\r\n </label>\r\n </div>\r\n } @if (ShowPagination) {\r\n <intelica-paginator\r\n #paginatorTable\r\n [TotalItems]=\"ListDataFilter.length\"\r\n [ItemsPerPage]=\"RowsPerPage\"\r\n (PageChange)=\"OnPageChange($event)\"\r\n >\r\n </intelica-paginator>\r\n }\r\n }\r\n </div>\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: "component", type: SearchComponent, selector: "intelica-search", inputs: ["ComponentId", "ShowTooltip", "SearchFieldOptions", "SearchOnKeyup", "SimpleSearchInput", "Placeholder"], outputs: ["OnSearch"] }, { kind: "component", type: PaginatorComponent, selector: "intelica-paginator", inputs: ["TotalItems", "CurrentPage", "ItemsPerPage"], outputs: ["PageChange"] }, { kind: "component", type: Select, selector: "p-select", inputs: ["id", "scrollHeight", "filter", "name", "style", "panelStyle", "styleClass", "panelStyleClass", "readonly", "required", "editable", "appendTo", "tabindex", "placeholder", "loadingIcon", "filterPlaceholder", "filterLocale", "variant", "inputId", "dataKey", "filterBy", "filterFields", "autofocus", "resetFilterOnHide", "checkmark", "dropdownIcon", "loading", "optionLabel", "optionValue", "optionDisabled", "optionGroupLabel", "optionGroupChildren", "autoDisplayFirst", "group", "showClear", "emptyFilterMessage", "emptyMessage", "lazy", "virtualScroll", "virtualScrollItemSize", "virtualScrollOptions", "size", "overlayOptions", "ariaFilterLabel", "ariaLabel", "ariaLabelledBy", "filterMatchMode", "maxlength", "tooltip", "tooltipPosition", "tooltipPositionStyle", "tooltipStyleClass", "focusOnHover", "selectOnFocus", "autoOptionFocus", "autofocusFilter", "fluid", "disabled", "itemSize", "autoZIndex", "baseZIndex", "showTransitionOptions", "hideTransitionOptions", "filterValue", "options"], outputs: ["onChange", "onFilter", "onFocus", "onBlur", "onClick", "onShow", "onHide", "onClear", "onLazyLoad"] }, { 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: "component", type: i2$1.TableCheckbox, selector: "p-tableCheckbox", inputs: ["disabled", "value", "index", "inputId", "name", "required", "ariaLabel"] }, { kind: "component", type: i2$1.TableHeaderCheckbox, selector: "p-tableHeaderCheckbox", inputs: ["disabled", "inputId", "name", "ariaLabel"] }, { 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: "component", type: i5.Checkbox, selector: "p-checkbox, p-checkBox, p-check-box", inputs: ["value", "name", "disabled", "binary", "ariaLabelledBy", "ariaLabel", "tabindex", "inputId", "style", "inputStyle", "styleClass", "inputClass", "indeterminate", "size", "formControl", "checkboxIcon", "readonly", "required", "autofocus", "trueValue", "falseValue", "variant"], outputs: ["onChange", "onFocus", "onBlur"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { 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"] }, { kind: "pipe", type: FormatCellPipe, name: "formatCell" }] });
|
|
2793
2794
|
}
|
|
2794
2795
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: TreeTableComponent, decorators: [{
|
|
2795
2796
|
type: Component,
|
|
@@ -2806,7 +2807,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImpor
|
|
|
2806
2807
|
FormsModule,
|
|
2807
2808
|
ButtonModule,
|
|
2808
2809
|
FormatCellPipe,
|
|
2809
|
-
], providers: [FormatCellPipe, DatePipe], template: "<div class=\"prTable\">\r\n <div class=\"prTableTools\">\r\n <div class=\"prTableTools__new prTableTools__new--left\">\r\n @if (AdditionalTemplate) {\r\n <ng-container *ngTemplateOutlet=\"AdditionalTemplate\"></ng-container>\r\n }\r\n </div>\r\n\r\n @if (ShowSearch) {\r\n <intelica-search\r\n #searchTable\r\n [ComponentId]=\"ComponentId + 'Search'\"\r\n (OnSearch)=\"ExecuteSearch($event)\"\r\n [SearchFieldOptions]=\"ListSearchOptionsSimple\"\r\n [SearchOnKeyup]=\"false\"\r\n [SimpleSearchInput]=\"false\"\r\n [ShowTooltip]=\"ShowSearchTooltip\"\r\n ></intelica-search>\r\n } @if (AdditionalCentralTemplate) {\r\n <div class=\"prTableTools__new prTableTools__new--right\">\r\n <ng-container\r\n *ngTemplateOutlet=\"AdditionalCentralTemplate\"\r\n ></ng-container>\r\n </div>\r\n }\r\n </div>\r\n @if (AdditionalExtendedTemplate) {\r\n <div class=\"prTableTools justify-content-start\">\r\n <ng-container *ngTemplateOutlet=\"AdditionalExtendedTemplate\"></ng-container>\r\n </div>\r\n\r\n }\r\n <p-table\r\n class=\"prTableBasic\"\r\n [value]=\"ListDataTable\"\r\n [ngClass]=\"ClassName\"\r\n responsiveLayout=\"scroll\"\r\n [(selection)]=\"ListDataSelected\"\r\n (onHeaderCheckboxToggle)=\"SelectAll($event)\"\r\n (onRowSelect)=\"OnRowSelect($event)\"\r\n (onRowUnselect)=\"OnRowUnselect($event)\"\r\n [groupRowsBy]=\"groupRowsBy\"\r\n [dataKey]=\"dataKey\"\r\n [sortField]=\"DefaultSortField\"\r\n [scrollable]=\"scrollable\"\r\n [scrollHeight]=\"scrollable ? scrollHeight : 'auto'\"\r\n [tableStyle]=\"tableStyle\"\r\n [sortOrder]=\"SortOrder\"\r\n >\r\n <ng-template pTemplate=\"header\">\r\n @for (level of Levels; track $index) {\r\n <tr>\r\n @for (col of ColumnGroupList; track $index) { @if (col.level === level)\r\n {\r\n <th\r\n [attr.colspan]=\"col.colspan\"\r\n [attr.rowspan]=\"col.rowspan\"\r\n [pSortableColumn]=\"col.sortable ? col.field : ''\"\r\n [style.min-width]=\"col.minWidth\"\r\n (click)=\"col.sortable && OnSort(col.field)\"\r\n >\r\n <div>\r\n <span pTooltip=\"{{ col.header }}\">{{ col.header }}</span>\r\n <p-sortIcon *ngIf=\"col.sortable\" [field]=\"col.field\"></p-sortIcon>\r\n </div>\r\n </th>\r\n } } @if (ShowCheckbox && level === 0 && ColumnGroupList.length != 0) {\r\n <th\r\n class=\"text-center\"\r\n style=\"width: 4%\"\r\n [attr.rowspan]=\"MaxLevel === 1 ? 2 : MaxLevel\"\r\n >\r\n <p-tableHeaderCheckbox\r\n class=\"prCheckbox\"\r\n [ngClass]=\"{\r\n 'prCheckbox--indeterminate':\r\n ListDataSelectedTemp.length > 0 &&\r\n ListDataSelectedTemp.length < ListDataFilter.length\r\n }\"\r\n />\r\n </th>\r\n }\r\n </tr>\r\n }\r\n\r\n <tr>\r\n @for (col of ColumnList; track $index) { @if(col.showHeader) {\r\n <th\r\n [class]=\"col.className\"\r\n [pSortableColumn]=\"\r\n !col.isChecboxColumn && col.sortable ? col.field : ''\r\n \"\r\n [style.width]=\"col.width\"\r\n [style.min-width]=\"col.minWidth\"\r\n (click)=\"!col.isChecboxColumn && col.sortable && OnSort(col.field)\"\r\n >\r\n <div>\r\n <span [pTooltip]=\"col.headerTooltip?.trim() ? col.headerTooltip : undefined\"\r\n [tooltipPosition]=\"col.headerTooltipPosition || 'top'\">\r\n {{ col.header }}\r\n </span>\r\n \r\n @if (!col.showIndex) { @if (col.isChecboxColumn) {\r\n <br />\r\n <p-checkbox\r\n [binary]=\"true\"\r\n (click)=\"$event.stopPropagation()\"\r\n (onChange)=\"OnHeaderCheckboxChange($event, col.field)\"\r\n [attr.data-check]=\"col.field\"\r\n ></p-checkbox>\r\n } @else {\r\n <p-sortIcon *ngIf=\"col.sortable\" [field]=\"col.field\"></p-sortIcon>\r\n } }\r\n </div>\r\n </th>\r\n } } @if (ShowCheckbox && ColumnGroupList.length == 0) {\r\n <th class=\"text-center\" style=\"width: 4%\">\r\n <p-tableHeaderCheckbox\r\n class=\"prCheckbox\"\r\n [ngClass]=\"{\r\n 'prCheckbox--indeterminate':\r\n ListDataSelectedTemp.length > 0 &&\r\n ListDataSelectedTemp.length < ListDataFilter.length\r\n }\"\r\n />\r\n </th>\r\n }\r\n </tr>\r\n\r\n @if (ListDataFilter.length > 0) {\r\n <tr class=\"fixedRow\">\r\n @for (col of RowResumenList; track $index) {\r\n <td\r\n [ngClass]=\"col.className\"\r\n [attr.colspan]=\"col.colspan\"\r\n [attr.rowspan]=\"col.rowspan\"\r\n >\r\n @if (col.templateRef) {\r\n <span\r\n ><ng-container *ngTemplateOutlet=\"col.templateRef\"></ng-container\r\n ></span>\r\n } @else {\r\n <ng-template #defaultContent></ng-template>\r\n }\r\n </td>\r\n }\r\n </tr>\r\n }\r\n </ng-template>\r\n\r\n <ng-template\r\n pTemplate=\"body\"\r\n let-rowData\r\n let-rowIndex=\"rowIndex\"\r\n let-expanded=\"expanded\"\r\n >\r\n <tr>\r\n @for (col of ColumnList; track $index) {\r\n <td [ngClass]=\"col.className\">\r\n @if (col.showIndex) {\r\n {{ rowIndex + 1 + (CurrentPage - 1) * RowsPerPage }}\r\n } @else if (col.field === 'name' && rowData.children &&\r\n rowData.children.length > 0) {\r\n <div class=\"prTable__expandToggleRow\">\r\n <p-button\r\n [pRowToggler]=\"rowData\"\r\n class=\"prButton prButton--icon prButton--iconBlue\"\r\n >\r\n <i\r\n [class]=\"\r\n expanded ? 'icon icon-collapse-rows' : 'icon icon-expand-rows'\r\n \"\r\n ></i>\r\n </p-button>\r\n <span\r\n class=\"text-breakWord\"\r\n pTooltip=\"{{ col.tooltip }}\"\r\n tooltipPosition=\"{{ col.tooltipPosition }}\"\r\n >\r\n {{ rowData[col.field] | formatCell : col.formatType }}\r\n </span>\r\n </div>\r\n } @else { @if (col.templateRef) {\r\n <ng-container\r\n *ngTemplateOutlet=\"col.templateRef; context: { $implicit: rowData }\"\r\n ></ng-container>\r\n } @else if (col.isChecboxColumn) {\r\n <p-checkbox\r\n [binary]=\"true\"\r\n [(ngModel)]=\"rowData[col.field]\"\r\n (onChange)=\"IsInderteminate(col.field)\"\r\n ></p-checkbox>\r\n } @else {\r\n <span\r\n class=\"text-breakWord\"\r\n pTooltip=\"{{ col.tooltip }}\"\r\n tooltipPosition=\"{{ col.tooltipPosition }}\"\r\n >\r\n {{ rowData[col.field] | formatCell : col.formatType }}\r\n </span>\r\n } }\r\n </td>\r\n } @if (ShowCheckbox) {\r\n <td class=\"text-center\">\r\n <p-tableCheckbox [value]=\"rowData\" class=\"prCheckbox\" />\r\n </td>\r\n }\r\n </tr>\r\n </ng-template>\r\n\r\n <ng-template pTemplate=\"expandedrow\" let-rowData let-rowIndex=\"rowIndex\">\r\n <ng-container *ngIf=\"rowData.children?.length\">\r\n <tr\r\n *ngFor=\"let childRow of rowData.children; let i = index\"\r\n class=\"subRow\"\r\n >\r\n <td\r\n *ngFor=\"let col of ColumnList; let j = index\"\r\n [ngClass]=\"col.className\"\r\n >\r\n <span\r\n class=\"text-breakWord\"\r\n pTooltip=\"{{ col.tooltip }}\"\r\n tooltipPosition=\"{{ col.tooltipPosition }}\"\r\n >\r\n <ng-container *ngIf=\"col.showIndex && j === 0; else normalCell\">\r\n {{ rowIndex + 1 + \".\" + getLetter(i) }}\r\n </ng-container>\r\n <ng-template #normalCell>\r\n @if (col.field === \"id\" && i < 26) {\r\n <span>{{ childRow[col.field] + \".\" + getLetter(i) }}</span>\r\n } @else {\r\n <ng-container *ngIf=\"col.templateRef; else defaultExpandedContent\">\r\n <ng-container *ngTemplateOutlet=\"col.templateRef; context: { $implicit: childRow }\"></ng-container>\r\n </ng-container>\r\n <ng-template #defaultExpandedContent>\r\n <span [class]=\"col.field === 'name' ? 'prTable__expandIdentText' : ''\">\r\n {{ childRow[col.field] | formatCell : col.formatType }}\r\n </span>\r\n </ng-template> \r\n }\r\n </ng-template>\r\n </span>\r\n </td>\r\n </tr>\r\n </ng-container>\r\n </ng-template>\r\n\r\n <ng-template #emptymessage>\r\n <tr>\r\n <td\r\n [attr.colspan]=\"ColumnList.length + (ShowCheckbox ? 1 : 0)\"\r\n class=\"text-center\"\r\n >\r\n {{ \"Nodata\" | term : GlobalTermService.languageCode }}\r\n </td>\r\n </tr>\r\n </ng-template>\r\n </p-table>\r\n\r\n <div class=\"prTableToolsBottom\">\r\n @if(TotalRecords !== 0){\r\n @if (ShowRowPerPage) {\r\n <div class=\"prTableToolsBottom__itemPerPage\">\r\n {{ \"ItemPerPage\" | term : GlobalTermService.languageCode }}\r\n <p-select\r\n [options]=\"AllowedPageSizes\"\r\n [ngModel]=\"RowsPerPage\"\r\n appendTo=\"body\"\r\n (onChange)=\"OnRowsPerPageChange($event.value)\"\r\n />\r\n <label for=\"pageSize\" class=\"control-label\">\r\n {{ 1 + RowsPerPage * (CurrentPage - 1) }} -\r\n {{\r\n CurrentPage * RowsPerPage >= TotalRecords\r\n ? TotalRecords\r\n : CurrentPage * RowsPerPage\r\n }}\r\n {{ \"Of\" | term : GlobalTermService.languageCode }} {{ TotalRecords }}\r\n {{ \"Items\" | term : GlobalTermService.languageCode }}\r\n </label>\r\n </div>\r\n } @if (ShowPagination) {\r\n <intelica-paginator\r\n #paginatorTable\r\n [TotalItems]=\"ListDataFilter.length\"\r\n [ItemsPerPage]=\"RowsPerPage\"\r\n (PageChange)=\"OnPageChange($event)\"\r\n >\r\n </intelica-paginator>\r\n }\r\n }\r\n </div>\r\n</div>\r\n" }]
|
|
2810
|
+
], providers: [FormatCellPipe, DatePipe], template: "<div class=\"prTable\">\r\n <div class=\"prTableTools\">\r\n <div class=\"prTableTools__new prTableTools__new--left\">\r\n @if (AdditionalTemplate) {\r\n <ng-container *ngTemplateOutlet=\"AdditionalTemplate\"></ng-container>\r\n }\r\n </div>\r\n\r\n @if (ShowSearch) {\r\n <intelica-search\r\n #searchTable\r\n [ComponentId]=\"ComponentId + 'Search'\"\r\n (OnSearch)=\"ExecuteSearch($event)\"\r\n [SearchFieldOptions]=\"ListSearchOptionsSimple\"\r\n [SearchOnKeyup]=\"false\"\r\n [SimpleSearchInput]=\"false\"\r\n [ShowTooltip]=\"ShowSearchTooltip\"\r\n ></intelica-search>\r\n } @if (AdditionalCentralTemplate) {\r\n <div class=\"prTableTools__new prTableTools__new--right\">\r\n <ng-container\r\n *ngTemplateOutlet=\"AdditionalCentralTemplate\"\r\n ></ng-container>\r\n </div>\r\n }\r\n </div>\r\n @if (AdditionalExtendedTemplate) {\r\n <div class=\"prTableTools justify-content-start\">\r\n <ng-container *ngTemplateOutlet=\"AdditionalExtendedTemplate\"></ng-container>\r\n </div>\r\n\r\n }\r\n <p-table\r\n class=\"prTableBasic\"\r\n [value]=\"ListDataTable\"\r\n [ngClass]=\"ClassName\"\r\n responsiveLayout=\"scroll\"\r\n [(selection)]=\"ListDataSelected\"\r\n (onHeaderCheckboxToggle)=\"SelectAll($event)\"\r\n (onRowSelect)=\"OnRowSelect($event)\"\r\n (onRowUnselect)=\"OnRowUnselect($event)\"\r\n [groupRowsBy]=\"groupRowsBy\"\r\n [dataKey]=\"dataKey\"\r\n [sortField]=\"DefaultSortField\"\r\n [scrollable]=\"scrollable\"\r\n [scrollHeight]=\"scrollable ? scrollHeight : 'auto'\"\r\n [tableStyle]=\"tableStyle\"\r\n [sortOrder]=\"SortOrder\"\r\n >\r\n <ng-template pTemplate=\"header\">\r\n @for (level of Levels; track $index) {\r\n <tr>\r\n @for (col of ColumnGroupList; track $index) { @if (col.level === level)\r\n {\r\n <th\r\n [attr.colspan]=\"col.colspan\"\r\n [attr.rowspan]=\"col.rowspan\"\r\n [pSortableColumn]=\"col.sortable ? col.field : ''\"\r\n [style.min-width]=\"col.minWidth\"\r\n (click)=\"col.sortable && OnSort(col.field)\"\r\n >\r\n <div>\r\n <span pTooltip=\"{{ col.header }}\">{{ col.header }}</span>\r\n <p-sortIcon *ngIf=\"col.sortable\" [field]=\"col.field\"></p-sortIcon>\r\n </div>\r\n </th>\r\n } } @if (ShowCheckbox && level === 0 && ColumnGroupList.length != 0) {\r\n <th\r\n class=\"text-center\"\r\n style=\"width: 4%\"\r\n [attr.rowspan]=\"MaxLevel === 1 ? 2 : MaxLevel\"\r\n >\r\n <p-tableHeaderCheckbox\r\n class=\"prCheckbox\"\r\n [ngClass]=\"{\r\n 'prCheckbox--indeterminate':\r\n ListDataSelectedTemp.length > 0 &&\r\n ListDataSelectedTemp.length < ListDataFilter.length\r\n }\"\r\n />\r\n </th>\r\n }\r\n </tr>\r\n }\r\n\r\n <tr>\r\n @for (col of ColumnList; track $index) { @if(col.showHeader) {\r\n <th\r\n [class]=\"col.className\"\r\n [pSortableColumn]=\"\r\n !col.isChecboxColumn && col.sortable ? col.field : ''\r\n \"\r\n [style.width]=\"col.width\"\r\n [style.min-width]=\"col.minWidth\"\r\n (click)=\"!col.isChecboxColumn && col.sortable && OnSort(col.field)\"\r\n >\r\n <div>\r\n <span [pTooltip]=\"col.headerTooltip?.trim() ? col.headerTooltip : undefined\"\r\n [tooltipPosition]=\"col.headerTooltipPosition || 'top'\">\r\n {{ col.header }}\r\n </span>\r\n \r\n @if (!col.showIndex) { @if (col.isChecboxColumn) {\r\n <br />\r\n <p-checkbox\r\n [binary]=\"true\"\r\n (click)=\"$event.stopPropagation()\"\r\n (onChange)=\"OnHeaderCheckboxChange($event, col.field)\"\r\n [attr.data-check]=\"col.field\"\r\n ></p-checkbox>\r\n } @else {\r\n <p-sortIcon *ngIf=\"col.sortable\" [field]=\"col.field\"></p-sortIcon>\r\n } }\r\n </div>\r\n </th>\r\n } } @if (ShowCheckbox && ColumnGroupList.length == 0) {\r\n <th class=\"text-center\" style=\"width: 4%\">\r\n <p-tableHeaderCheckbox\r\n class=\"prCheckbox\"\r\n [ngClass]=\"{\r\n 'prCheckbox--indeterminate':\r\n ListDataSelectedTemp.length > 0 &&\r\n ListDataSelectedTemp.length < ListDataFilter.length\r\n }\"\r\n />\r\n </th>\r\n }\r\n </tr>\r\n\r\n @if (ListDataFilter.length > 0) {\r\n <tr class=\"fixedRow\">\r\n @for (col of RowResumenList; track $index) {\r\n <td\r\n [ngClass]=\"col.className\"\r\n [attr.colspan]=\"col.colspan\"\r\n [attr.rowspan]=\"col.rowspan\"\r\n >\r\n @if (col.templateRef) {\r\n <span\r\n ><ng-container *ngTemplateOutlet=\"col.templateRef\"></ng-container\r\n ></span>\r\n } @else {\r\n <ng-template #defaultContent></ng-template>\r\n }\r\n </td>\r\n }\r\n </tr>\r\n }\r\n </ng-template>\r\n\r\n <ng-template\r\n pTemplate=\"body\"\r\n let-rowData\r\n let-rowIndex=\"rowIndex\"\r\n let-expanded=\"expanded\"\r\n >\r\n <tr>\r\n @for (col of ColumnList; track $index) {\r\n <td [ngClass]=\"col.className\">\r\n @if (col.showIndex) {\r\n {{ rowIndex + 1 + (CurrentPage - 1) * RowsPerPage }}\r\n } @else if ((col.field === (ExpandedColumnIdent?.trim() || 'name')) && (rowData.children?.length ?? 0) > 0\r\n ) {\r\n <div class=\"prTable__expandToggleRow\">\r\n <p-button\r\n [pRowToggler]=\"rowData\"\r\n class=\"prButton prButton--icon prButton--iconBlue\"\r\n >\r\n <i\r\n [class]=\"\r\n expanded ? 'icon icon-collapse-rows' : 'icon icon-expand-rows'\r\n \"\r\n ></i>\r\n </p-button>\r\n <span\r\n class=\"text-breakWord\"\r\n pTooltip=\"{{ col.tooltip }}\"\r\n tooltipPosition=\"{{ col.tooltipPosition }}\"\r\n >\r\n {{ rowData[col.field] | formatCell : col.formatType }}\r\n </span>\r\n </div>\r\n } @else { @if (col.templateRef) {\r\n <ng-container\r\n *ngTemplateOutlet=\"col.templateRef; context: { $implicit: rowData }\"\r\n ></ng-container>\r\n } @else if (col.isChecboxColumn) {\r\n <p-checkbox\r\n [binary]=\"true\"\r\n [(ngModel)]=\"rowData[col.field]\"\r\n (onChange)=\"IsInderteminate(col.field)\"\r\n ></p-checkbox>\r\n } @else {\r\n <span\r\n class=\"text-breakWord\"\r\n pTooltip=\"{{ col.tooltip }}\"\r\n tooltipPosition=\"{{ col.tooltipPosition }}\"\r\n >\r\n {{ rowData[col.field] | formatCell : col.formatType }}\r\n </span>\r\n } }\r\n </td>\r\n } @if (ShowCheckbox) {\r\n <td class=\"text-center\">\r\n <p-tableCheckbox [value]=\"rowData\" class=\"prCheckbox\" />\r\n </td>\r\n }\r\n </tr>\r\n </ng-template>\r\n\r\n <ng-template pTemplate=\"expandedrow\" let-rowData let-rowIndex=\"rowIndex\">\r\n <ng-container *ngIf=\"rowData.children?.length\">\r\n <tr\r\n *ngFor=\"let childRow of rowData.children; let i = index\"\r\n class=\"subRow\"\r\n >\r\n <td\r\n *ngFor=\"let col of ColumnList; let j = index\"\r\n [ngClass]=\"col.className\"\r\n >\r\n <span\r\n class=\"text-breakWord\"\r\n pTooltip=\"{{ col.tooltip }}\"\r\n tooltipPosition=\"{{ col.tooltipPosition }}\"\r\n >\r\n <ng-container *ngIf=\"col.showIndex && j === 0; else normalCell\">\r\n {{ rowIndex + 1 + \".\" + getLetter(i) }}\r\n </ng-container>\r\n <ng-template #normalCell>\r\n @if (col.field === \"id\" && i < 26) {\r\n <span>{{ childRow[col.field] + \".\" + getLetter(i) }}</span>\r\n } @else {\r\n <ng-container *ngIf=\"col.templateRef; else defaultExpandedContent\">\r\n <ng-container *ngTemplateOutlet=\"col.templateRef; context: { $implicit: childRow }\"></ng-container>\r\n </ng-container>\r\n <ng-template #defaultExpandedContent>\r\n <span [class]=\"col.field === (ExpandedColumnIdent || 'name') ? 'prTable__expandIdentText' : ''\">\r\n {{ childRow[col.field] | formatCell : col.formatType }}\r\n </span>\r\n </ng-template> \r\n }\r\n </ng-template>\r\n </span>\r\n </td>\r\n </tr>\r\n </ng-container>\r\n </ng-template>\r\n\r\n <ng-template #emptymessage>\r\n <tr>\r\n <td\r\n [attr.colspan]=\"ColumnList.length + (ShowCheckbox ? 1 : 0)\"\r\n class=\"text-center\"\r\n >\r\n {{ \"Nodata\" | term : GlobalTermService.languageCode }}\r\n </td>\r\n </tr>\r\n </ng-template>\r\n </p-table>\r\n\r\n <div class=\"prTableToolsBottom\">\r\n @if(TotalRecords !== 0){\r\n @if (ShowRowPerPage) {\r\n <div class=\"prTableToolsBottom__itemPerPage\">\r\n {{ \"ItemPerPage\" | term : GlobalTermService.languageCode }}\r\n <p-select\r\n [options]=\"AllowedPageSizes\"\r\n [ngModel]=\"RowsPerPage\"\r\n appendTo=\"body\"\r\n (onChange)=\"OnRowsPerPageChange($event.value)\"\r\n />\r\n <label for=\"pageSize\" class=\"control-label\">\r\n {{ 1 + RowsPerPage * (CurrentPage - 1) }} -\r\n {{\r\n CurrentPage * RowsPerPage >= TotalRecords\r\n ? TotalRecords\r\n : CurrentPage * RowsPerPage\r\n }}\r\n {{ \"Of\" | term : GlobalTermService.languageCode }} {{ TotalRecords }}\r\n {{ \"Items\" | term : GlobalTermService.languageCode }}\r\n </label>\r\n </div>\r\n } @if (ShowPagination) {\r\n <intelica-paginator\r\n #paginatorTable\r\n [TotalItems]=\"ListDataFilter.length\"\r\n [ItemsPerPage]=\"RowsPerPage\"\r\n (PageChange)=\"OnPageChange($event)\"\r\n >\r\n </intelica-paginator>\r\n }\r\n }\r\n </div>\r\n</div>\r\n" }]
|
|
2810
2811
|
}], propDecorators: { ComponentId: [{
|
|
2811
2812
|
type: Input
|
|
2812
2813
|
}], ListData: [{
|
|
@@ -2849,6 +2850,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImpor
|
|
|
2849
2850
|
type: Input
|
|
2850
2851
|
}], ShowRowPerPage: [{
|
|
2851
2852
|
type: Input
|
|
2853
|
+
}], ExpandedColumnIdent: [{
|
|
2854
|
+
type: Input
|
|
2852
2855
|
}], EmitSelectedItem: [{
|
|
2853
2856
|
type: Output
|
|
2854
2857
|
}], EmitListDataFilter: [{
|
|
@@ -6433,7 +6436,9 @@ class HtmlToExcelService {
|
|
|
6433
6436
|
return;
|
|
6434
6437
|
Table.innerHTML = "";
|
|
6435
6438
|
Table.innerHTML += html;
|
|
6436
|
-
const ws = XLSX.utils.table_to_sheet(Table, {
|
|
6439
|
+
const ws = XLSX.utils.table_to_sheet(Table, {
|
|
6440
|
+
raw: false,
|
|
6441
|
+
});
|
|
6437
6442
|
const wb = XLSX.utils.book_new();
|
|
6438
6443
|
XLSX.utils.book_append_sheet(wb, ws, tabname);
|
|
6439
6444
|
XLSX.writeFile(wb, filename + "." + extension);
|
|
@@ -6444,23 +6449,48 @@ class HtmlToExcelService {
|
|
|
6444
6449
|
horizontal: "center",
|
|
6445
6450
|
wrapText: true,
|
|
6446
6451
|
};
|
|
6447
|
-
async ExportToExcel(
|
|
6452
|
+
async ExportToExcel(excelNameOrOptions, reportTitle, filterTitle, rowsSerializate, columns, filters, subtitles = [], showTotalRow = false, headerGroups = [], childKey, SheetName = "") {
|
|
6453
|
+
let options;
|
|
6454
|
+
if (typeof excelNameOrOptions === "string") {
|
|
6455
|
+
options = {
|
|
6456
|
+
excelName: excelNameOrOptions,
|
|
6457
|
+
reportTitle: reportTitle,
|
|
6458
|
+
filterTitle: filterTitle,
|
|
6459
|
+
rowsSerializate: rowsSerializate,
|
|
6460
|
+
columns: columns,
|
|
6461
|
+
filters: filters,
|
|
6462
|
+
subtitles,
|
|
6463
|
+
showTotalRow,
|
|
6464
|
+
headerGroups,
|
|
6465
|
+
childKey,
|
|
6466
|
+
SheetName,
|
|
6467
|
+
};
|
|
6468
|
+
}
|
|
6469
|
+
else {
|
|
6470
|
+
options = {
|
|
6471
|
+
subtitles: [],
|
|
6472
|
+
showTotalRow: false,
|
|
6473
|
+
headerGroups: [],
|
|
6474
|
+
SheetName: "",
|
|
6475
|
+
...excelNameOrOptions,
|
|
6476
|
+
};
|
|
6477
|
+
}
|
|
6448
6478
|
const workbook = new Workbook();
|
|
6449
|
-
const worksheet = workbook.addWorksheet(reportTitle);
|
|
6479
|
+
const worksheet = workbook.addWorksheet(options.SheetName || options.reportTitle);
|
|
6450
6480
|
worksheet.views = [{ showGridLines: false }];
|
|
6451
6481
|
const imageId = workbook.addImage({
|
|
6452
6482
|
base64: this.Logo,
|
|
6453
6483
|
extension: "png",
|
|
6454
6484
|
});
|
|
6455
|
-
this.SetReportPage(rowsSerializate, worksheet, columns, imageId, subtitles, showTotalRow, headerGroups, childKey);
|
|
6456
|
-
this.SetTitle(worksheet, reportTitle);
|
|
6457
|
-
if (filters.length > 0) {
|
|
6458
|
-
const worksheetFilter = workbook.addWorksheet(filterTitle);
|
|
6485
|
+
this.SetReportPage(options.rowsSerializate, worksheet, options.columns, imageId, options.subtitles, options.showTotalRow, options.headerGroups, options.childKey);
|
|
6486
|
+
this.SetTitle(worksheet, options.reportTitle);
|
|
6487
|
+
if (options.filters.length > 0) {
|
|
6488
|
+
const worksheetFilter = workbook.addWorksheet(options.filterTitle);
|
|
6459
6489
|
worksheetFilter.views = [{ showGridLines: false }];
|
|
6460
|
-
this.SetFilterPage(filterTitle, worksheetFilter, filters);
|
|
6490
|
+
this.SetFilterPage(options.filterTitle, worksheetFilter, options.filters);
|
|
6461
6491
|
}
|
|
6462
6492
|
const buffer = await workbook.xlsx.writeBuffer();
|
|
6463
|
-
saveAs(new Blob([buffer]), excelName);
|
|
6493
|
+
saveAs(new Blob([buffer]), options.excelName);
|
|
6464
6494
|
}
|
|
6465
6495
|
SetTitle(worksheet, reportTitle) {
|
|
6466
6496
|
worksheet.mergeCells("D1:I5");
|
|
@@ -6555,12 +6585,17 @@ class HtmlToExcelService {
|
|
|
6555
6585
|
else
|
|
6556
6586
|
startRow += 1;
|
|
6557
6587
|
if (showTotalRow) {
|
|
6558
|
-
const sums = columns.map(col => {
|
|
6588
|
+
const sums = columns.map((col) => {
|
|
6559
6589
|
if (col.columnName === "")
|
|
6560
6590
|
return "Total";
|
|
6561
6591
|
if (!col.totalRowValue)
|
|
6562
6592
|
return null;
|
|
6563
|
-
return col.totalRowValue
|
|
6593
|
+
return col.totalRowValue
|
|
6594
|
+
? {
|
|
6595
|
+
formula: `"${col.totalRowValue}"`,
|
|
6596
|
+
result: col.totalRowValue,
|
|
6597
|
+
}
|
|
6598
|
+
: null;
|
|
6564
6599
|
});
|
|
6565
6600
|
const insertedRow = worksheet.insertRow(startRow, sums);
|
|
6566
6601
|
insertedRow.eachCell((cell, colNumber) => {
|
|
@@ -6575,7 +6610,9 @@ class HtmlToExcelService {
|
|
|
6575
6610
|
vertical: "middle",
|
|
6576
6611
|
horizontal: column?.alignHorizontal ?? "left",
|
|
6577
6612
|
};
|
|
6578
|
-
cell.border = {
|
|
6613
|
+
cell.border = {
|
|
6614
|
+
bottom: { style: "thin", color: { argb: "FF7F00" } },
|
|
6615
|
+
};
|
|
6579
6616
|
if (typeof cell.value === "number") {
|
|
6580
6617
|
cell.numFmt = "0.00";
|
|
6581
6618
|
}
|
|
@@ -6593,18 +6630,20 @@ class HtmlToExcelService {
|
|
|
6593
6630
|
vertical: "middle",
|
|
6594
6631
|
horizontal: col.alignHorizontal ?? "left",
|
|
6595
6632
|
};
|
|
6596
|
-
cell.border = {
|
|
6633
|
+
cell.border = {
|
|
6634
|
+
bottom: { style: "thin", color: { argb: "FF7F00" } },
|
|
6635
|
+
};
|
|
6597
6636
|
});
|
|
6598
6637
|
startRow++;
|
|
6599
6638
|
}
|
|
6600
6639
|
//Inserción de filas
|
|
6601
6640
|
const numberColIdx = (() => {
|
|
6602
|
-
const byEmpty = columns.findIndex(c => (c.columnName ?? "").trim() === "");
|
|
6641
|
+
const byEmpty = columns.findIndex((c) => (c.columnName ?? "").trim() === "");
|
|
6603
6642
|
if (byEmpty !== -1)
|
|
6604
6643
|
return byEmpty;
|
|
6605
6644
|
const isNumDisplay = (s) => (s ?? "").trim().toLowerCase().replace("º", "°") === "n°";
|
|
6606
|
-
const byDisplay = columns.findIndex(c => isNumDisplay(c.displayColumnName));
|
|
6607
|
-
const byColumnName = columns.findIndex(c => isNumDisplay(c.columnName));
|
|
6645
|
+
const byDisplay = columns.findIndex((c) => isNumDisplay(c.displayColumnName));
|
|
6646
|
+
const byColumnName = columns.findIndex((c) => isNumDisplay(c.columnName));
|
|
6608
6647
|
const i = byDisplay !== -1 ? byDisplay : byColumnName;
|
|
6609
6648
|
return i; // -1 si no hay numeración
|
|
6610
6649
|
})(); // Detecta la columna de numeración ("", "N°" o "Nº") si existe
|
|
@@ -6615,7 +6654,7 @@ class HtmlToExcelService {
|
|
|
6615
6654
|
indentColIdx = numberColIdx + 1;
|
|
6616
6655
|
}
|
|
6617
6656
|
else {
|
|
6618
|
-
const nameIdx = columns.findIndex(c => (c.columnName ?? "").trim().toLowerCase() === "name" ||
|
|
6657
|
+
const nameIdx = columns.findIndex((c) => (c.columnName ?? "").trim().toLowerCase() === "name" ||
|
|
6619
6658
|
(c.displayColumnName ?? "").trim().toLowerCase().includes("name"));
|
|
6620
6659
|
if (nameIdx !== -1)
|
|
6621
6660
|
indentColIdx = nameIdx;
|
|
@@ -6624,7 +6663,7 @@ class HtmlToExcelService {
|
|
|
6624
6663
|
const rowValues = [];
|
|
6625
6664
|
for (let colIndex = 0; colIndex < columns.length; colIndex++) {
|
|
6626
6665
|
if (hasNumbering && colIndex === numberColIdx) {
|
|
6627
|
-
rowValues.push(isHierarchical ? rows[rowIndex].__hier :
|
|
6666
|
+
rowValues.push(isHierarchical ? rows[rowIndex].__hier : rowIndex + 1);
|
|
6628
6667
|
}
|
|
6629
6668
|
else {
|
|
6630
6669
|
rowValues.push(rows[rowIndex][columns[colIndex].columnName] ?? "");
|
|
@@ -6645,7 +6684,9 @@ class HtmlToExcelService {
|
|
|
6645
6684
|
};
|
|
6646
6685
|
});
|
|
6647
6686
|
// Indentación: si hay jerarquía y hay columna definida para indentar
|
|
6648
|
-
if (isHierarchical &&
|
|
6687
|
+
if (isHierarchical &&
|
|
6688
|
+
indentColIdx !== null &&
|
|
6689
|
+
indentColIdx < columns.length) {
|
|
6649
6690
|
const indentCell = insertedRow.getCell(indentColIdx + 1); // 1-based
|
|
6650
6691
|
indentCell.alignment = {
|
|
6651
6692
|
...(indentCell.alignment ?? {}),
|
|
@@ -6654,7 +6695,7 @@ class HtmlToExcelService {
|
|
|
6654
6695
|
}
|
|
6655
6696
|
}
|
|
6656
6697
|
//Formato nombre de columnas
|
|
6657
|
-
columnsCell.forEach(cellRef => {
|
|
6698
|
+
columnsCell.forEach((cellRef) => {
|
|
6658
6699
|
const cell = worksheet.getCell(cellRef);
|
|
6659
6700
|
cell.fill = {
|
|
6660
6701
|
type: "pattern",
|
|
@@ -6675,7 +6716,7 @@ class HtmlToExcelService {
|
|
|
6675
6716
|
if (rowIndex < firstDataRow)
|
|
6676
6717
|
return;
|
|
6677
6718
|
const isEven = (rowIndex - firstDataRow) % 2 === 0;
|
|
6678
|
-
row.eachCell(cell => {
|
|
6719
|
+
row.eachCell((cell) => {
|
|
6679
6720
|
if (!isEven) {
|
|
6680
6721
|
cell.fill = {
|
|
6681
6722
|
type: "pattern",
|
|
@@ -6728,12 +6769,12 @@ class HtmlToExcelService {
|
|
|
6728
6769
|
let widtFilter = 30;
|
|
6729
6770
|
worksheetFilter.addRow([filterTitle]);
|
|
6730
6771
|
worksheetFilter.mergeCells(["A1", "B2"]);
|
|
6731
|
-
worksheetFilter.columns.forEach(column => {
|
|
6772
|
+
worksheetFilter.columns.forEach((column) => {
|
|
6732
6773
|
column.width = widtFilter;
|
|
6733
6774
|
column.alignment = this.ColumnAligment;
|
|
6734
6775
|
widtFilter *= 3;
|
|
6735
6776
|
});
|
|
6736
|
-
["A1", "B1"].map(key => {
|
|
6777
|
+
["A1", "B1"].map((key) => {
|
|
6737
6778
|
worksheetFilter.getCell(key).fill = {
|
|
6738
6779
|
type: "pattern",
|
|
6739
6780
|
pattern: "solid",
|
|
@@ -6750,7 +6791,7 @@ class HtmlToExcelService {
|
|
|
6750
6791
|
filters.forEach((element, index) => {
|
|
6751
6792
|
let row = worksheetFilter.addRow([element.key, element.value]);
|
|
6752
6793
|
let color = index % 2 === 1 ? "D9D9D9" : "FFFFFF";
|
|
6753
|
-
row.eachCell(cell => {
|
|
6794
|
+
row.eachCell((cell) => {
|
|
6754
6795
|
cell.fill = {
|
|
6755
6796
|
type: "pattern",
|
|
6756
6797
|
pattern: "solid",
|
|
@@ -6772,7 +6813,10 @@ class HtmlToExcelService {
|
|
|
6772
6813
|
return;
|
|
6773
6814
|
if (columns[index] == undefined)
|
|
6774
6815
|
return;
|
|
6775
|
-
let columnWidth = columns[index].width ??
|
|
6816
|
+
let columnWidth = columns[index].width ??
|
|
6817
|
+
Math.max(...column.values
|
|
6818
|
+
.map((v) => (v ? v.toString().length : 0))
|
|
6819
|
+
.filter((v) => typeof v === "number"), columns[index].displayColumnName.length) * 1.4;
|
|
6776
6820
|
column.width = Math.min(Math.max(columnWidth, 5), 100);
|
|
6777
6821
|
});
|
|
6778
6822
|
worksheet.eachRow((row, rowIndex) => {
|
|
@@ -6781,7 +6825,9 @@ class HtmlToExcelService {
|
|
|
6781
6825
|
let maxLines = 1;
|
|
6782
6826
|
row.eachCell((cell, colNumber) => {
|
|
6783
6827
|
if (cell.value) {
|
|
6784
|
-
let text = typeof cell.value === "object"
|
|
6828
|
+
let text = typeof cell.value === "object"
|
|
6829
|
+
? cell.text
|
|
6830
|
+
: cell.value.toString();
|
|
6785
6831
|
let columnWidth = worksheet.getColumn(colNumber).width ?? 10;
|
|
6786
6832
|
let charsPerLine = columnWidth * 1.2;
|
|
6787
6833
|
let estimatedLines = Math.ceil(text.length / charsPerLine);
|
|
@@ -6791,12 +6837,14 @@ class HtmlToExcelService {
|
|
|
6791
6837
|
row.height = Math.min(Math.max(15 * maxLines, 15), 30);
|
|
6792
6838
|
});
|
|
6793
6839
|
}
|
|
6794
|
-
async ExportToExcelRawData({ excelName, reportTitle, filterTitle, rowsSerializate, columns, filters, orderColumn = false }) {
|
|
6840
|
+
async ExportToExcelRawData({ excelName, reportTitle, filterTitle, rowsSerializate, columns, filters, orderColumn = false, }) {
|
|
6795
6841
|
const workbook = new Workbook();
|
|
6796
6842
|
const worksheet = workbook.addWorksheet(reportTitle);
|
|
6797
6843
|
const rows = JSON.parse(rowsSerializate);
|
|
6798
6844
|
worksheet.views = [{ showGridLines: false }];
|
|
6799
|
-
const allColumns = orderColumn
|
|
6845
|
+
const allColumns = orderColumn
|
|
6846
|
+
? [{ displayColumnName: "N°" }, ...columns]
|
|
6847
|
+
: columns;
|
|
6800
6848
|
allColumns.forEach((col, index) => {
|
|
6801
6849
|
const columnLetter = this.GetExcelColumnLetter(index);
|
|
6802
6850
|
const headerCell = worksheet.getCell(`${columnLetter}1`);
|
|
@@ -6804,14 +6852,14 @@ class HtmlToExcelService {
|
|
|
6804
6852
|
headerCell.alignment = { horizontal: "center", vertical: "middle" };
|
|
6805
6853
|
headerCell.font = { name: "Arial", bold: true, size: 10 };
|
|
6806
6854
|
});
|
|
6807
|
-
const maxLengths = allColumns.map(col => col.displayColumnName.length);
|
|
6855
|
+
const maxLengths = allColumns.map((col) => col.displayColumnName.length);
|
|
6808
6856
|
rows.forEach((rowData, rowIndex) => {
|
|
6809
6857
|
const rowValues = allColumns.map((col, colIndex) => {
|
|
6810
6858
|
if (orderColumn && colIndex === 0) {
|
|
6811
|
-
return
|
|
6859
|
+
return rowIndex + 1;
|
|
6812
6860
|
}
|
|
6813
6861
|
const originalColIndex = orderColumn ? colIndex - 1 : colIndex;
|
|
6814
|
-
return rowData[columns[originalColIndex].columnName]?.toString() || "";
|
|
6862
|
+
return (rowData[columns[originalColIndex].columnName]?.toString() || "");
|
|
6815
6863
|
});
|
|
6816
6864
|
rowValues.forEach((value, i) => {
|
|
6817
6865
|
const length = value.length;
|
|
@@ -6834,9 +6882,11 @@ class HtmlToExcelService {
|
|
|
6834
6882
|
}
|
|
6835
6883
|
async ExportToCSVRaw(excelName, rowsSerializate) {
|
|
6836
6884
|
const rows = JSON.parse(rowsSerializate);
|
|
6837
|
-
const csvLines = rows.map(r => r.linea);
|
|
6885
|
+
const csvLines = rows.map((r) => r.linea);
|
|
6838
6886
|
const csvContent = csvLines.join("\n");
|
|
6839
|
-
const blob = new Blob(["\uFEFF" + csvContent], {
|
|
6887
|
+
const blob = new Blob(["\uFEFF" + csvContent], {
|
|
6888
|
+
type: "text/csv;charset=utf-8;",
|
|
6889
|
+
});
|
|
6840
6890
|
saveAs(blob, excelName.endsWith(".csv") ? excelName : `${excelName}.csv`);
|
|
6841
6891
|
}
|
|
6842
6892
|
GetExcelColumnLetter(columnNumber) {
|
|
@@ -6867,7 +6917,7 @@ class HtmlToExcelService {
|
|
|
6867
6917
|
...copy,
|
|
6868
6918
|
__hier: seq.join("."), // "1" | "1.1" | "2.2.1" ...
|
|
6869
6919
|
__level: seq.length - 1, // 0 = raíz, 1 = hijo, 2 = nieto...
|
|
6870
|
-
__hasChildren: hasChildren // para formateo en negrita
|
|
6920
|
+
__hasChildren: hasChildren, // para formateo en negrita
|
|
6871
6921
|
});
|
|
6872
6922
|
if (hasChildren) {
|
|
6873
6923
|
flat.push(...this.FlattenRowsForHierarchy(item[childKey], childKey, seq));
|
|
@@ -6876,7 +6926,7 @@ class HtmlToExcelService {
|
|
|
6876
6926
|
return flat;
|
|
6877
6927
|
}
|
|
6878
6928
|
DetectsHierarchy(rows, childKey = "details") {
|
|
6879
|
-
return rows?.some(r => Array.isArray(r?.[childKey]) && r[childKey].length > 0) ?? false;
|
|
6929
|
+
return (rows?.some((r) => Array.isArray(r?.[childKey]) && r[childKey].length > 0) ?? false);
|
|
6880
6930
|
}
|
|
6881
6931
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: HtmlToExcelService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
6882
6932
|
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: HtmlToExcelService, providedIn: "root" });
|