keevo-components 1.8.458 → 1.8.460
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm2022/lib/api/services/image.cutter.service.mjs +71 -455
- package/esm2022/lib/components/kv-tree-table/kv-tree-table.component.mjs +5 -5
- package/fesm2022/keevo-components.mjs +79 -458
- package/fesm2022/keevo-components.mjs.map +1 -1
- package/lib/api/base-components/base-component-dropdown.d.ts +1 -1
- package/lib/components/kv-table/kv-table.component.d.ts +1 -1
- package/lib/components/kv-table-expandable/kv-table-expandable.component.d.ts +1 -1
- package/lib/components/kv-tree-table/kv-tree-table.component.d.ts +1 -3
- package/package.json +3 -2
|
@@ -48,16 +48,14 @@ import * as i1$4 from '@angular/common/http';
|
|
|
48
48
|
import { HttpHeaders } from '@angular/common/http';
|
|
49
49
|
import { filter as filter$1 } from 'rxjs/operators';
|
|
50
50
|
import { DialogModule } from 'primeng/dialog';
|
|
51
|
-
import
|
|
52
|
-
import { SliderModule } from 'primeng/slider';
|
|
53
|
-
import { FileUploadModule } from 'primeng/fileupload';
|
|
51
|
+
import { ImageCropperComponent } from 'ngx-image-cropper';
|
|
54
52
|
import { AccordionModule } from 'primeng/accordion';
|
|
55
53
|
import { BadgeModule } from 'primeng/badge';
|
|
56
54
|
import * as i5$9 from 'primeng/breadcrumb';
|
|
57
55
|
import { BreadcrumbModule } from 'primeng/breadcrumb';
|
|
58
56
|
import * as i5$4 from 'primeng/calendar';
|
|
59
57
|
import { CalendarModule } from 'primeng/calendar';
|
|
60
|
-
import * as i2$
|
|
58
|
+
import * as i2$2 from 'primeng/carousel';
|
|
61
59
|
import { CarouselModule, Carousel } from 'primeng/carousel';
|
|
62
60
|
import { ChipModule } from 'primeng/chip';
|
|
63
61
|
import { ConfirmDialogModule } from 'primeng/confirmdialog';
|
|
@@ -65,8 +63,9 @@ import * as i7$3 from 'primeng/contextmenu';
|
|
|
65
63
|
import { ContextMenuModule } from 'primeng/contextmenu';
|
|
66
64
|
import { DataViewModule } from 'primeng/dataview';
|
|
67
65
|
import { EditorModule } from 'primeng/editor';
|
|
68
|
-
import * as i2$
|
|
66
|
+
import * as i2$4 from 'primeng/fieldset';
|
|
69
67
|
import { FieldsetModule } from 'primeng/fieldset';
|
|
68
|
+
import { FileUploadModule } from 'primeng/fileupload';
|
|
70
69
|
import { ImageModule } from 'primeng/image';
|
|
71
70
|
import * as i5$5 from 'primeng/inputmask';
|
|
72
71
|
import { InputMaskModule } from 'primeng/inputmask';
|
|
@@ -107,7 +106,7 @@ import { ToastModule } from 'primeng/toast';
|
|
|
107
106
|
import { ToolbarModule } from 'primeng/toolbar';
|
|
108
107
|
import * as i1$6 from 'primeng/tree';
|
|
109
108
|
import { TreeModule } from 'primeng/tree';
|
|
110
|
-
import * as i2$
|
|
109
|
+
import * as i2$3 from 'primeng/selectbutton';
|
|
111
110
|
import { SelectButtonModule } from 'primeng/selectbutton';
|
|
112
111
|
import * as i3$2 from 'primeng/stepper';
|
|
113
112
|
import { StepperModule } from 'primeng/stepper';
|
|
@@ -115,6 +114,7 @@ import { InputGroupModule } from 'primeng/inputgroup';
|
|
|
115
114
|
import { InputGroupAddonModule } from 'primeng/inputgroupaddon';
|
|
116
115
|
import * as i7$2 from 'primeng/treeselect';
|
|
117
116
|
import { TreeSelectModule } from 'primeng/treeselect';
|
|
117
|
+
import { SliderModule } from 'primeng/slider';
|
|
118
118
|
import * as i1$5 from 'ngx-loading';
|
|
119
119
|
import { NgxLoadingModule } from 'ngx-loading';
|
|
120
120
|
import Quill from 'quill';
|
|
@@ -2091,8 +2091,8 @@ class KvTreetableComponent {
|
|
|
2091
2091
|
this.onNodeSelect = new EventEmitter();
|
|
2092
2092
|
this.onNodeUnselect = new EventEmitter();
|
|
2093
2093
|
this.onDropItem = new EventEmitter();
|
|
2094
|
-
this.selectionKeys = model({});
|
|
2095
2094
|
}
|
|
2095
|
+
// public readonly selectionKeys = model<TreeTableKeys>({});
|
|
2096
2096
|
ngOnInit() {
|
|
2097
2097
|
this.tamanhoTela = window.innerWidth;
|
|
2098
2098
|
if (this.ordenacao) {
|
|
@@ -2284,11 +2284,11 @@ class KvTreetableComponent {
|
|
|
2284
2284
|
this.inputBusca.nativeElement.value = '';
|
|
2285
2285
|
}
|
|
2286
2286
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.8", ngImport: i0, type: KvTreetableComponent, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2287
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.3.8", type: KvTreetableComponent, selector: "kv-tree-table", inputs: { disableRowNodeSticky: { classPropertyName: "disableRowNodeSticky", publicName: "disableRowNodeSticky", isSignal: false, isRequired: false, transformFunction: null }, config: { classPropertyName: "config", publicName: "config", isSignal: false, isRequired: false, transformFunction: null }, dataSource: { classPropertyName: "dataSource", publicName: "dataSource", isSignal: false, isRequired: false, transformFunction: null }, gridLines: { classPropertyName: "gridLines", publicName: "gridLines", isSignal: false, isRequired: false, transformFunction: null }, tableCaptalized: { classPropertyName: "tableCaptalized", publicName: "tableCaptalized", isSignal: false, isRequired: false, transformFunction: null }, selectedItems: { classPropertyName: "selectedItems", publicName: "selectedItems", isSignal: false, isRequired: false, transformFunction: null }, paginator: { classPropertyName: "paginator", publicName: "paginator", isSignal: false, isRequired: false, transformFunction: null }, rows: { classPropertyName: "rows", publicName: "rows", isSignal: false, isRequired: false, transformFunction: null }, treeTableDraggable: { classPropertyName: "treeTableDraggable", publicName: "treeTableDraggable", isSignal: false, isRequired: false, transformFunction: null }, transferArrayItem: { classPropertyName: "transferArrayItem", publicName: "transferArrayItem", isSignal: false, isRequired: false, transformFunction: null }, ordenacao: { classPropertyName: "ordenacao", publicName: "ordenacao", isSignal: false, isRequired: false, transformFunction: null }, totalRecords: { classPropertyName: "totalRecords", publicName: "totalRecords", isSignal: false, isRequired: false, transformFunction: null }, textoEmptyMessage: { classPropertyName: "textoEmptyMessage", publicName: "textoEmptyMessage", isSignal: false, isRequired: false, transformFunction: null }, childrenRecoil: { classPropertyName: "childrenRecoil", publicName: "childrenRecoil", isSignal: false, isRequired: false, transformFunction: null }, showHeader: { classPropertyName: "showHeader", publicName: "showHeader", isSignal: false, isRequired: false, transformFunction: null }, scrollHeight: { classPropertyName: "scrollHeight", publicName: "scrollHeight", isSignal: false, isRequired: false, transformFunction: null }, pageLinksOptions: { classPropertyName: "pageLinksOptions", publicName: "pageLinksOptions", isSignal: false, isRequired: false, transformFunction: null }, pageLinks: { classPropertyName: "pageLinks", publicName: "pageLinks", isSignal: false, isRequired: false, transformFunction: null }, showFirstLastIcon: { classPropertyName: "showFirstLastIcon", publicName: "showFirstLastIcon", isSignal: false, isRequired: false, transformFunction: null }, selectionKeys: { classPropertyName: "selectionKeys", publicName: "selectionKeys", isSignal: true, isRequired: false, transformFunction: null }, _templates: { classPropertyName: "_templates", publicName: "templates", isSignal: false, isRequired: false, transformFunction: null } }, outputs: { onFilter: "onFilter", onPaginate: "onPaginate", onActiveItem: "onActiveItem", onActiveItemLote: "onActiveItemLote", doubleClickEvent: "doubleClickEvent", onNodeSelect: "onNodeSelect", onNodeUnselect: "onNodeUnselect", onDropItem: "onDropItem", selectionKeys: "selectionKeysChange" }, host: { listeners: { "window:resize": "onWindowResize($event)" } }, queries: [{ propertyName: "templates", predicate: TemplateDirective }], viewQueries: [{ propertyName: "pTreeTable", first: true, predicate: TreeTable, descendants: true }, { propertyName: "inputBusca", first: true, predicate: ["inputBusca"], descendants: true }], ngImport: i0, template: "<div>\r\n <p-treeTable\r\n #tt\r\n cdkDropList\r\n class=\"example-list\"\r\n (cdkDropListDropped)=\"drop($event)\"\r\n [value]=\"dataSource\"\r\n [columns]=\"config.columns\"\r\n [resizableColumns]=\"true\"\r\n [tableStyle]=\"{ 'min-width': '50rem' }\"\r\n [resizableColumns]=\"true\"\r\n [paginator]=\"paginator\"\r\n [rows]=\"rows\"\r\n [totalRecords]=\"totalRecords\"\r\n [rowsPerPageOptions]=\"[5, 10, 15, 25, 50]\"\r\n [showFirstLastIcon]=\"tamanhoTela > 960 ? true : false\"\r\n [pageLinks]=\"tamanhoTela > 960 ? 2 : 1\"\r\n [styleClass]=\"gridLines ? 'p-treetable-gridlines' : ''\"\r\n [(selection)]=\"selectedItems\"\r\n [selectionKeys]=\"selectionKeys()\"\r\n (selectionKeysChange)=\"selectionKeys.set($event)\"\r\n [lazy]=\"config.lazy\"\r\n (onLazyLoad)=\"paginate($event)\"\r\n (onNodeSelect)=\"onNodeSelected($event)\"\r\n (onNodeUnselect)=\"onNodeUnselected($event)\"\r\n [showCurrentPageReport]=\"true\"\r\n currentPageReportTemplate=\"{first} - {last} de {totalRecords}\"\r\n [scrollHeight]=\"scrollHeight\"\r\n >\r\n <ng-template pTemplate=\"caption\" *ngIf=\"config.enableCation\">\r\n <div\r\n class=\"flex flex-row flex-wrap justify-content-between align-items-center grid formgrid p-fluid col-12 m-0 p-1\"\r\n style=\"background-color: #eaeaea\"\r\n >\r\n <div class=\"col-12 flex flex-column\">\r\n <div *ngIf=\"config.title\" class=\"text-md font-bold my-3\">\r\n {{ config.title }}\r\n </div>\r\n <div *ngIf=\"config.subtitle\" class=\"text-sm mb-4 font-medium\">\r\n {{ config.subtitle }}\r\n </div>\r\n </div>\r\n\r\n <div\r\n class=\"flex flex-row align-items-center col-10 p-0 md:col-6 lg:col-4 justify-content-center {{\r\n tamanhoTela < 768 ? '' : 'input-search'\r\n }}\"\r\n >\r\n <span *ngIf=\"config.enableFilter\" class=\"p-input-icon-left\">\r\n <i class=\"pi pi-search\"></i>\r\n\r\n <input\r\n pInputText\r\n pAutoFocus\r\n [autofocus]=\"true\"\r\n type=\"text\"\r\n (input)=\"onGlobalFilter(tt, $event)\"\r\n placeholder=\"Pesquisar...\"\r\n class=\"h-2rem\"\r\n #inputBusca\r\n />\r\n </span>\r\n </div>\r\n\r\n <div class=\"flex flex-row col-1 justify-content-end p-0\">\r\n <div class=\"flex flex-row gap-2 btns-options\">\r\n @for (action of config.actionsLote; track $index) {\r\n @if((selectedItems.length > 0 || action.showAcoesLote) &&\r\n exibirCampo(action, this.action)) {\r\n <kv-button\r\n (onClick)=\"action?.command(); activeItemLote(selectedItems)\"\r\n [pTooltip]=\"getOrExecute(action.tooltip, selectedItems)\"\r\n [tooltipPosition]=\"'bottom'\"\r\n [size]=\"'small'\"\r\n [disabled]=\"getOrExecute(action.disabled, selectedItems) || false\"\r\n [icon]=\"getOrExecute(action.icon, selectedItems)\"\r\n [severity]=\"action.severity || 'tertiary'\"\r\n />\r\n } }\r\n </div>\r\n </div>\r\n </div>\r\n </ng-template>\r\n\r\n @if(showHeader){\r\n <ng-template pTemplate=\"header\" let-columns>\r\n <tr>\r\n @for(col of columns; track $index){\r\n <th\r\n [ttSortableColumn]=\"col.field\"\r\n [ttSortableColumnDisabled]=\"col.sortable === false\"\r\n [style.width]=\"col.width\"\r\n >\r\n <div>\r\n <div [ngClass]=\"{ flex: $index == 0, 'gap-3': $index == 0 }\">\r\n <div *ngIf=\"$index == 0 && config.enableSelect\">\r\n <p-treeTableHeaderCheckbox\r\n (click)=\"activeItemLote(selectedItems)\"\r\n />\r\n </div>\r\n\r\n <div class=\"flex flex-row align-items-center {{ align(col) }}\">\r\n <span class=\"text-xs\">{{ col.header }}</span>\r\n\r\n @if(col.sortable) {\r\n <p-treeTableSortIcon [field]=\"col.field\" class=\"pb-1\" />\r\n\r\n }\r\n\r\n <span\r\n *ngIf=\"col.headerTooltip\"\r\n class=\"material-symbols-outlined flex align-items-center\"\r\n [pTooltip]=\"col.headerTooltip\"\r\n >info</span\r\n >\r\n </div>\r\n </div>\r\n </div>\r\n </th>\r\n @if (config.actions?.length ?? 0 > 0) {\r\n <th [style.width]=\"5\"></th>\r\n } }\r\n </tr>\r\n </ng-template>\r\n\r\n <ng-template pTemplate=\"header\" let-columns>\r\n <tr>\r\n @for (col of columns; track $index) {\r\n <th\r\n [ttSortableColumn]=\"col.field\"\r\n [ttSortableColumnDisabled]=\"col.sortable === false\"\r\n [style.width]=\"col.width\"\r\n >\r\n <div class=\"flex flex-row align-items-center {{ align(col) }}\">\r\n <span class=\"text-xs\">{{ col.header }}</span>\r\n\r\n @if(col.sortable) {\r\n <p-treeTableSortIcon [field]=\"col.field\" class=\"pb-1\" />\r\n }\r\n </div>\r\n </th>\r\n } @if (config.actions?.length ?? 0 > 0) {\r\n <th [style.width]=\"5\"></th>\r\n }\r\n </tr>\r\n </ng-template>\r\n }\r\n\r\n <ng-template\r\n pTemplate=\"body\"\r\n let-rowNode\r\n let-rowData=\"rowData\"\r\n let-columns=\"columns\"\r\n >\r\n @if(treeTableDraggable) {\r\n <tr\r\n cdkDrag\r\n cdkDragLockAxis=\"y\"\r\n [cdkDragData]=\"rowNode\"\r\n [ttRow]=\"rowNode\"\r\n (dblclick)=\"doubleClick($event, rowData)\"\r\n [ngClass]=\"{ capitalize: tableCaptalized }\"\r\n >\r\n @for(col of columns; track $index){\r\n <td\r\n class=\"draggable-cell\"\r\n [style.position]=\"\r\n !disableRowNodeSticky && rowNode.level !== 0 ? 'sticky' : null\r\n \"\r\n >\r\n <!-- [style.left.px]=\"\r\n childrenRecoil && rowNode.level !== 0 ? rowNode.level * 30 : null\r\n \" -->\r\n\r\n <div class=\"flex flex-row {{ align(col) }}\">\r\n <div\r\n class=\"w-full-h-full flex align-items-center\"\r\n *ngIf=\"$index == 0\"\r\n >\r\n <span\r\n class=\"material-symbols-outlined drag-icon\"\r\n style=\"\r\n cursor: grab;\r\n font-size: 25px;\r\n color: #6b7280;\r\n opacity: 0.9;\r\n \"\r\n cdkDragHandle\r\n >\r\n drag_indicator\r\n </span>\r\n <p-treeTableToggler class=\"hiddenVisible\" [rowNode]=\"rowNode\" />\r\n\r\n @if(config.enableSelect) {\r\n <p-treeTableCheckbox\r\n [disabled]=\"isDisabledCheckbox(rowData, rowNode)\"\r\n (click)=\"activeItemLote(selectedItems)\"\r\n [value]=\"rowNode\"\r\n [ngStyle]=\"{\r\n display: isSelectEnabled(rowData, rowNode) ? 'block' : 'none',\r\n 'margin-left': config.visibleCheckboxFunction\r\n ? '-34px'\r\n : '0px'\r\n }\"\r\n />\r\n }\r\n </div>\r\n\r\n <div class=\"flex flex-row align-items-center w-full\">\r\n @if (col.template && validateShowTemplate(rowNode, col)) {\r\n <span class=\"w-full\">\r\n <ng-container\r\n *ngIf=\"getCustomTemplate(col.template.name)\"\r\n [ngTemplateOutlet]=\"getCustomTemplate(col.template.name)\"\r\n [ngTemplateOutletContext]=\"{ $implicit: rowData }\"\r\n >\r\n </ng-container>\r\n </span>\r\n } @else {\r\n <div\r\n class=\"flex flex-row align-items-center {{(col.boolean || col.centralize) && 'justify-content-center'}} gap-2 w-full\"\r\n >\r\n @if(col.tagColor) {\r\n <div\r\n class=\"tag\"\r\n [pTooltip]=\"\r\n col.tooltipTag &&\r\n col.tooltipTag(rowData, col, rowData[col.field])\r\n \"\r\n [style.background-color]=\"\r\n col.tagColor(rowData, col, rowData[col.field])\r\n \"\r\n ></div>\r\n\r\n }\r\n\r\n <i\r\n *ngIf=\"col.boolean\"\r\n class=\"pi {{\r\n rowData[col.field] ? 'pi-check text-green-300' : ''\r\n }}\"\r\n style=\"font-size: 1rem; font-weight: 700;\"\r\n ></i>\r\n\r\n <div class=\"flex flex-column\" *ngIf=\"!col.boolean\">\r\n <span class=\"m-0 text-xs\">{{ rowData[col.field] }}</span>\r\n\r\n <p *ngIf=\"col.subtitle\" class=\"m-0 text-xs font-semibold\">\r\n {{ rowData[col.subtitle] }}\r\n </p>\r\n </div>\r\n </div>\r\n }\r\n </div>\r\n </div>\r\n </td>\r\n }\r\n\r\n <td\r\n style=\"border-left: none; text-align: center; width: 0\"\r\n *ngIf=\"(config.actions?.length ?? 0 > 0) || config.actionsPai\"\r\n [style.borderRight]=\"rowNode.level === 0 ? 'none' : ''\"\r\n [style.borderLeft]=\"rowNode.level === 0 ? 'none' : ''\"\r\n >\r\n <div\r\n *ngIf=\"\r\n (config.actions?.length ?? 0 > 0) &&\r\n validateActionPosition(rowNode)\r\n \"\r\n class=\"flex align-items-center justify-content-center\"\r\n >\r\n <span\r\n class=\"material-symbols-outlined cursor-pointer icon-more-horiz\"\r\n style=\"font-size: 20px; padding: 0.1rem\"\r\n (click)=\"menu.toggle($event); activeItem(rowData)\"\r\n >\r\n more_horiz\r\n </span>\r\n\r\n @for(action of config.actions; track $index) {\r\n {{ criarMenusModal(rowData) }}\r\n }\r\n\r\n <p-menu\r\n #menu\r\n [popup]=\"true\"\r\n [model]=\"menuItems\"\r\n appendTo=\"body\"\r\n ></p-menu>\r\n </div>\r\n\r\n @if(config.actionsPai?.length ?? 0 > 0 && rowNode.level == 0){\r\n <div class=\"flex justify-content-end align-items-center\">\r\n @for (actionPai of config.actionsPai; track $index) {\r\n @if(getOrExecute(actionPai.visible, rowData) ?? true) {\r\n <kv-button\r\n (onClick)=\"activeItem(rowData); actionPai.command($event)\"\r\n [type]=\"'text'\"\r\n [icon]=\"actionPai.icon\"\r\n [severity]=\"actionPai.severity || 'tertiary'\"\r\n />\r\n\r\n } }\r\n </div>\r\n }\r\n </td>\r\n </tr>\r\n } @else {\r\n <tr\r\n [ttRow]=\"rowNode\"\r\n (dblclick)=\"doubleClick($event, rowData)\"\r\n [ngClass]=\"{ capitalize: tableCaptalized }\"\r\n >\r\n @for(col of columns; track $index){\r\n <td\r\n [style.position]=\"rowNode.level !== 0 ? 'sticky' : null\"\r\n [style.left.px]=\"\r\n childrenRecoil && rowNode.level !== 0 ? rowNode.level * 30 : null\r\n \"\r\n [style.borderRight]=\"rowNode.level === 0 ? 'none' : ''\"\r\n [style.borderLeft]=\"\r\n rowNode.level === 0 && col.field != config.columns[0].field\r\n ? 'none'\r\n : ''\r\n \"\r\n >\r\n <div class=\"flex flex-row {{ align(col) }}\">\r\n <div\r\n class=\"w-full-h-full flex align-items-center\"\r\n *ngIf=\"$index == 0\"\r\n >\r\n <p-treeTableToggler class=\"hiddenVisible\" [rowNode]=\"rowNode\" />\r\n\r\n @if(config.enableSelect) {\r\n <p-treeTableCheckbox\r\n [disabled]=\"isDisabledCheckbox(rowData, rowNode)\"\r\n (click)=\"activeItemLote(selectedItems)\"\r\n [value]=\"rowNode\"\r\n [ngStyle]=\"{\r\n display: isSelectEnabled(rowData, rowNode) ? 'block' : 'none',\r\n 'margin-left': config.visibleCheckboxFunction\r\n ? '-34px'\r\n : '0px'\r\n }\"\r\n />\r\n }\r\n </div>\r\n <div class=\"flex flex-row align-items-center w-full\">\r\n @if (col.template && validateShowTemplate(rowNode, col)) {\r\n <span class=\"w-full\">\r\n <ng-container\r\n *ngIf=\"getCustomTemplate(col.template.name)\"\r\n [ngTemplateOutlet]=\"getCustomTemplate(col.template.name)\"\r\n [ngTemplateOutletContext]=\"{ $implicit: rowData }\"\r\n >\r\n </ng-container>\r\n </span>\r\n } @else {\r\n <div\r\n class=\"flex flex-row align-items-center {{(col.boolean || col.centralize) && 'justify-content-center'}} gap-2 w-full\"\r\n >\r\n @if(col.tagColor) {\r\n <div\r\n class=\"tag\"\r\n [pTooltip]=\"\r\n col.tooltipTag &&\r\n col.tooltipTag(rowData, col, rowData[col.field])\r\n \"\r\n [style.background-color]=\"\r\n col.tagColor(rowData, col, rowData[col.field])\r\n \"\r\n ></div>\r\n\r\n }\r\n <i\r\n *ngIf=\"col.boolean\"\r\n class=\"pi {{\r\n rowData[col.field] ? 'pi-check text-green-300' : ''\r\n }}\"\r\n style=\"font-size: 1rem; font-weight: 700;\"\r\n ></i>\r\n\r\n <div class=\"flex flex-column\" *ngIf=\"!col.boolean\">\r\n <span class=\"m-0 text-xs\">{{ rowData[col.field] }}</span>\r\n\r\n <p *ngIf=\"col.subtitle\" class=\"m-0 text-xs font-semibold\">\r\n {{ rowData[col.subtitle] }}\r\n </p>\r\n </div>\r\n </div>\r\n }\r\n </div>\r\n </div>\r\n </td>\r\n }\r\n\r\n <td\r\n style=\"border-left: none; text-align: center\"\r\n *ngIf=\"(config.actions?.length ?? 0 > 0) || config.actionsPai\"\r\n >\r\n <div\r\n *ngIf=\"\r\n (config.actions?.length ?? 0 > 0) &&\r\n validateActionPosition(rowNode)\r\n \"\r\n >\r\n <span\r\n class=\"material-symbols-outlined cursor-pointer icon-more-horiz\"\r\n style=\"font-size: 20px; padding: 0.1rem\"\r\n (click)=\"menu.toggle($event); activeItem(rowData)\"\r\n >\r\n more_horiz\r\n </span>\r\n\r\n @for(action of config.actions; track $index) {\r\n {{ criarMenusModal(rowData) }}\r\n }\r\n\r\n <p-menu\r\n #menu\r\n [popup]=\"true\"\r\n [model]=\"menuItems\"\r\n appendTo=\"body\"\r\n ></p-menu>\r\n </div>\r\n\r\n @if(config.actionsPai?.length ?? 0 > 0 && rowNode.level == 0){\r\n <div class=\"flex justify-content-end\">\r\n @for (actionPai of config.actionsPai; track $index) { @if\r\n (getOrExecute(actionPai.visible, rowData) ?? true) {\r\n <kv-button\r\n (onClick)=\"activeItem(rowData); actionPai.command($event)\"\r\n [type]=\"'text'\"\r\n [icon]=\"actionPai.icon\"\r\n [severity]=\"actionPai.severity || 'tertiary'\"\r\n />\r\n } }\r\n </div>\r\n }\r\n </td>\r\n </tr>\r\n }\r\n </ng-template>\r\n <ng-template pTemplate=\"emptymessage\">\r\n <tr>\r\n <td\r\n [attr.colspan]=\"config.columns.length + 1\"\r\n style=\"text-align: center\"\r\n class=\"text-sm\"\r\n >\r\n {{ textoEmptyMessage }}\r\n </td>\r\n </tr>\r\n </ng-template>\r\n </p-treeTable>\r\n</div>\r\n", styles: ["@charset \"UTF-8\";::ng-deep .p-treetable .p-treetable-tbody>tr>td{padding:.2rem}::ng-deep .p-treetable .p-treetable-header{padding:0rem}span{font-size:14px}:host ::ng-deep .p-treetable table{table-layout:auto!important}::ng-deep .p-checkbox .p-checkbox-box{width:1.125rem;height:1.125rem}::ng-deep .p-checkbox{display:flex;align-items:center}::ng-deep .p-treetable .p-paginator{scale:.75}.icon-more-horiz{font-weight:700}.icon-more-horiz:hover,.icon-more-horiz:focus{color:#5e5e5e;transition:color .3s,transform .3s;background-color:#eaeaea;border-radius:50%}::ng-deep .p-treetable .p-treetable-thead>tr>th{background-color:#eaeaea;padding:.3rem}:host ::ng-deep .treetabledraggable .p-treetable .p-treetable-tbody>tr>td .p-treetable-toggler{width:1rem;height:1rem}.tag{width:5px;height:20px;border-radius:.25rem}:host ::ng-deep .draggable-cell .drag-icon{visibility:hidden}:host ::ng-deep .draggable-cell:hover .drag-icon{visibility:visible}.cdk-drag-preview{display:flex;align-items:center;justify-content:space-between;border-radius:10px!important}.cdk-drop-list-dragging{cursor:grabbing}:host ::ng-deep .cdk-drop-list-dragging .cdk-drag{transition:transform .25s cubic-bezier(0,0,.2,1)}:host ::ng-deep .cdk-drag-animating{transition:transform .3s cubic-bezier(0,0,.2,1)}::ng-deep svg.p-icon{width:.65rem;height:.65rem}::ng-deep .p-checkbox .p-checkbox-box.p-highlight{border-color:#004172;background:#004172}::ng-deep .p-checkbox .p-checkbox-box.p-highlight:hover{background-color:#002542}::ng-deep .p-checkbox .p-checkbox-box.p-highlight:active{background-color:#002542}::ng-deep .p-checkbox .p-checkbox-box.p-highlight:disabled{background-color:#002542;opacity:.4;cursor:auto}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "directive", type: i1$2.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { kind: "directive", type: i5$2.AutoFocus, selector: "[pAutoFocus]", inputs: ["autofocus"] }, { kind: "directive", type: i6.Tooltip, selector: "[pTooltip]", inputs: ["tooltipPosition", "tooltipEvent", "appendTo", "positionStyle", "tooltipStyleClass", "tooltipZIndex", "escape", "showDelay", "hideDelay", "life", "positionTop", "positionLeft", "autoHide", "fitContent", "hideOnEscape", "pTooltip", "tooltipDisabled", "tooltipOptions"] }, { kind: "directive", type: i5$3.InputText, selector: "[pInputText]", inputs: ["variant"] }, { kind: "component", type: i5.Menu, selector: "p-menu", inputs: ["model", "popup", "style", "styleClass", "appendTo", "autoZIndex", "baseZIndex", "showTransitionOptions", "hideTransitionOptions", "ariaLabel", "ariaLabelledBy", "id", "tabindex"], outputs: ["onShow", "onHide", "onBlur", "onFocus"] }, { kind: "directive", type: i7.CdkDropList, selector: "[cdkDropList], cdk-drop-list", inputs: ["cdkDropListConnectedTo", "cdkDropListData", "cdkDropListOrientation", "id", "cdkDropListLockAxis", "cdkDropListDisabled", "cdkDropListSortingDisabled", "cdkDropListEnterPredicate", "cdkDropListSortPredicate", "cdkDropListAutoScrollDisabled", "cdkDropListAutoScrollStep"], outputs: ["cdkDropListDropped", "cdkDropListEntered", "cdkDropListExited", "cdkDropListSorted"], exportAs: ["cdkDropList"] }, { kind: "directive", type: i7.CdkDrag, selector: "[cdkDrag]", inputs: ["cdkDragData", "cdkDragLockAxis", "cdkDragRootElement", "cdkDragBoundary", "cdkDragStartDelay", "cdkDragFreeDragPosition", "cdkDragDisabled", "cdkDragConstrainPosition", "cdkDragPreviewClass", "cdkDragPreviewContainer"], outputs: ["cdkDragStarted", "cdkDragReleased", "cdkDragEnded", "cdkDragEntered", "cdkDragExited", "cdkDragDropped", "cdkDragMoved"], exportAs: ["cdkDrag"] }, { kind: "directive", type: i7.CdkDragHandle, selector: "[cdkDragHandle]", inputs: ["cdkDragHandleDisabled"] }, { kind: "component", type: i8$2.TreeTable, selector: "p-treeTable", inputs: ["columns", "style", "styleClass", "tableStyle", "tableStyleClass", "autoLayout", "lazy", "lazyLoadOnInit", "paginator", "rows", "first", "pageLinks", "rowsPerPageOptions", "alwaysShowPaginator", "paginatorPosition", "paginatorStyleClass", "paginatorDropdownAppendTo", "currentPageReportTemplate", "showCurrentPageReport", "showJumpToPageDropdown", "showFirstLastIcon", "showPageLinks", "defaultSortOrder", "sortMode", "resetPageOnSort", "customSort", "selectionMode", "contextMenuSelection", "contextMenuSelectionMode", "dataKey", "metaKeySelection", "compareSelectionBy", "rowHover", "loading", "loadingIcon", "showLoader", "scrollable", "scrollHeight", "virtualScroll", "virtualScrollItemSize", "virtualScrollOptions", "virtualScrollDelay", "frozenWidth", "frozenColumns", "resizableColumns", "columnResizeMode", "reorderableColumns", "contextMenu", "rowTrackBy", "filters", "globalFilterFields", "filterDelay", "filterMode", "filterLocale", "paginatorLocale", "totalRecords", "sortField", "sortOrder", "multiSortMeta", "selection", "value", "virtualRowHeight", "selectionKeys"], outputs: ["selectionChange", "contextMenuSelectionChange", "onFilter", "onNodeExpand", "onNodeCollapse", "onPage", "onSort", "onLazyLoad", "sortFunction", "onColResize", "onColReorder", "onNodeSelect", "onNodeUnselect", "onContextMenuSelect", "onHeaderCheckboxToggle", "onEditInit", "onEditComplete", "onEditCancel", "selectionKeysChange"] }, { kind: "component", type: i8$2.TreeTableToggler, selector: "p-treeTableToggler", inputs: ["rowNode"] }, { kind: "directive", type: i8$2.TTSortableColumn, selector: "[ttSortableColumn]", inputs: ["ttSortableColumn", "ttSortableColumnDisabled"] }, { kind: "component", type: i8$2.TTSortIcon, selector: "p-treeTableSortIcon", inputs: ["field", "ariaLabelDesc", "ariaLabelAsc"] }, { kind: "directive", type: i8$2.TTRow, selector: "[ttRow]", inputs: ["ttRow"] }, { kind: "component", type: i8$2.TTCheckbox, selector: "p-treeTableCheckbox", inputs: ["disabled", "value"] }, { kind: "component", type: i8$2.TTHeaderCheckbox, selector: "p-treeTableHeaderCheckbox" }, { kind: "component", type: KvButtonComponent, selector: "kv-button", inputs: ["fullWidth", "type", "loading", "severity", "size", "icon", "label", "disabled"], outputs: ["onClick"] }] }); }
|
|
2287
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.3.8", type: KvTreetableComponent, selector: "kv-tree-table", inputs: { disableRowNodeSticky: "disableRowNodeSticky", config: "config", dataSource: "dataSource", gridLines: "gridLines", tableCaptalized: "tableCaptalized", selectedItems: "selectedItems", paginator: "paginator", rows: "rows", treeTableDraggable: "treeTableDraggable", transferArrayItem: "transferArrayItem", ordenacao: "ordenacao", totalRecords: "totalRecords", textoEmptyMessage: "textoEmptyMessage", childrenRecoil: "childrenRecoil", showHeader: "showHeader", scrollHeight: "scrollHeight", pageLinksOptions: "pageLinksOptions", pageLinks: "pageLinks", showFirstLastIcon: "showFirstLastIcon", _templates: ["templates", "_templates"] }, outputs: { onFilter: "onFilter", onPaginate: "onPaginate", onActiveItem: "onActiveItem", onActiveItemLote: "onActiveItemLote", doubleClickEvent: "doubleClickEvent", onNodeSelect: "onNodeSelect", onNodeUnselect: "onNodeUnselect", onDropItem: "onDropItem" }, host: { listeners: { "window:resize": "onWindowResize($event)" } }, queries: [{ propertyName: "templates", predicate: TemplateDirective }], viewQueries: [{ propertyName: "pTreeTable", first: true, predicate: TreeTable, descendants: true }, { propertyName: "inputBusca", first: true, predicate: ["inputBusca"], descendants: true }], ngImport: i0, template: "<div>\r\n <p-treeTable\r\n #tt\r\n cdkDropList\r\n class=\"example-list\"\r\n (cdkDropListDropped)=\"drop($event)\"\r\n [value]=\"dataSource\"\r\n [columns]=\"config.columns\"\r\n [resizableColumns]=\"true\"\r\n [tableStyle]=\"{ 'min-width': '50rem' }\"\r\n [resizableColumns]=\"true\"\r\n [paginator]=\"paginator\"\r\n [rows]=\"rows\"\r\n [totalRecords]=\"totalRecords\"\r\n [rowsPerPageOptions]=\"[5, 10, 15, 25, 50]\"\r\n [showFirstLastIcon]=\"tamanhoTela > 960 ? true : false\"\r\n [pageLinks]=\"tamanhoTela > 960 ? 2 : 1\"\r\n [styleClass]=\"gridLines ? 'p-treetable-gridlines' : ''\"\r\n [(selection)]=\"selectedItems\"\r\n [lazy]=\"config.lazy\"\r\n (onLazyLoad)=\"paginate($event)\"\r\n (onNodeSelect)=\"onNodeSelected($event)\"\r\n (onNodeUnselect)=\"onNodeUnselected($event)\"\r\n [showCurrentPageReport]=\"true\"\r\n currentPageReportTemplate=\"{first} - {last} de {totalRecords}\"\r\n [scrollHeight]=\"scrollHeight\"\r\n >\r\n <ng-template pTemplate=\"caption\" *ngIf=\"config.enableCation\">\r\n <div\r\n class=\"flex flex-row flex-wrap justify-content-between align-items-center grid formgrid p-fluid col-12 m-0 p-1\"\r\n style=\"background-color: #eaeaea\"\r\n >\r\n <div class=\"col-12 flex flex-column\">\r\n <div *ngIf=\"config.title\" class=\"text-md font-bold my-3\">\r\n {{ config.title }}\r\n </div>\r\n <div *ngIf=\"config.subtitle\" class=\"text-sm mb-4 font-medium\">\r\n {{ config.subtitle }}\r\n </div>\r\n </div>\r\n\r\n <div\r\n class=\"flex flex-row align-items-center col-10 p-0 md:col-6 lg:col-4 justify-content-center {{\r\n tamanhoTela < 768 ? '' : 'input-search'\r\n }}\"\r\n >\r\n <span *ngIf=\"config.enableFilter\" class=\"p-input-icon-left\">\r\n <i class=\"pi pi-search\"></i>\r\n\r\n <input\r\n pInputText\r\n pAutoFocus\r\n [autofocus]=\"true\"\r\n type=\"text\"\r\n (input)=\"onGlobalFilter(tt, $event)\"\r\n placeholder=\"Pesquisar...\"\r\n class=\"h-2rem\"\r\n #inputBusca\r\n />\r\n </span>\r\n </div>\r\n\r\n <div class=\"flex flex-row col-1 justify-content-end p-0\">\r\n <div class=\"flex flex-row gap-2 btns-options\">\r\n @for (action of config.actionsLote; track $index) {\r\n @if((selectedItems.length > 0 || action.showAcoesLote) &&\r\n exibirCampo(action, this.action)) {\r\n <kv-button\r\n (onClick)=\"action?.command(); activeItemLote(selectedItems)\"\r\n [pTooltip]=\"getOrExecute(action.tooltip, selectedItems)\"\r\n [tooltipPosition]=\"'bottom'\"\r\n [size]=\"'small'\"\r\n [disabled]=\"getOrExecute(action.disabled, selectedItems) || false\"\r\n [icon]=\"getOrExecute(action.icon, selectedItems)\"\r\n [severity]=\"action.severity || 'tertiary'\"\r\n />\r\n } }\r\n </div>\r\n </div>\r\n </div>\r\n </ng-template>\r\n\r\n @if(showHeader){\r\n <ng-template pTemplate=\"header\" let-columns>\r\n <tr>\r\n @for(col of columns; track $index){\r\n <th\r\n [ttSortableColumn]=\"col.field\"\r\n [ttSortableColumnDisabled]=\"col.sortable === false\"\r\n [style.width]=\"col.width\"\r\n >\r\n <div>\r\n <div [ngClass]=\"{ flex: $index == 0, 'gap-3': $index == 0 }\">\r\n <div *ngIf=\"$index == 0 && config.enableSelect\">\r\n <p-treeTableHeaderCheckbox\r\n (click)=\"activeItemLote(selectedItems)\"\r\n />\r\n </div>\r\n\r\n <div class=\"flex flex-row align-items-center {{ align(col) }}\">\r\n <span class=\"text-xs\">{{ col.header }}</span>\r\n\r\n @if(col.sortable) {\r\n <p-treeTableSortIcon [field]=\"col.field\" class=\"pb-1\" />\r\n\r\n }\r\n\r\n <span\r\n *ngIf=\"col.headerTooltip\"\r\n class=\"material-symbols-outlined flex align-items-center\"\r\n [pTooltip]=\"col.headerTooltip\"\r\n >info</span\r\n >\r\n </div>\r\n </div>\r\n </div>\r\n </th>\r\n @if (config.actions?.length ?? 0 > 0) {\r\n <th [style.width]=\"5\"></th>\r\n } }\r\n </tr>\r\n </ng-template>\r\n\r\n <ng-template pTemplate=\"header\" let-columns>\r\n <tr>\r\n @for (col of columns; track $index) {\r\n <th\r\n [ttSortableColumn]=\"col.field\"\r\n [ttSortableColumnDisabled]=\"col.sortable === false\"\r\n [style.width]=\"col.width\"\r\n >\r\n <div class=\"flex flex-row align-items-center {{ align(col) }}\">\r\n <span class=\"text-xs\">{{ col.header }}</span>\r\n\r\n @if(col.sortable) {\r\n <p-treeTableSortIcon [field]=\"col.field\" class=\"pb-1\" />\r\n }\r\n </div>\r\n </th>\r\n } @if (config.actions?.length ?? 0 > 0) {\r\n <th [style.width]=\"5\"></th>\r\n }\r\n </tr>\r\n </ng-template>\r\n }\r\n\r\n <ng-template\r\n pTemplate=\"body\"\r\n let-rowNode\r\n let-rowData=\"rowData\"\r\n let-columns=\"columns\"\r\n >\r\n @if(treeTableDraggable) {\r\n <tr\r\n cdkDrag\r\n cdkDragLockAxis=\"y\"\r\n [cdkDragData]=\"rowNode\"\r\n [ttRow]=\"rowNode\"\r\n (dblclick)=\"doubleClick($event, rowData)\"\r\n [ngClass]=\"{ capitalize: tableCaptalized }\"\r\n >\r\n @for(col of columns; track $index){\r\n <td\r\n class=\"draggable-cell\"\r\n [style.position]=\"\r\n !disableRowNodeSticky && rowNode.level !== 0 ? 'sticky' : null\r\n \"\r\n >\r\n <!-- [style.left.px]=\"\r\n childrenRecoil && rowNode.level !== 0 ? rowNode.level * 30 : null\r\n \" -->\r\n\r\n <div class=\"flex flex-row {{ align(col) }}\">\r\n <div\r\n class=\"w-full-h-full flex align-items-center\"\r\n *ngIf=\"$index == 0\"\r\n >\r\n <span\r\n class=\"material-symbols-outlined drag-icon\"\r\n style=\"\r\n cursor: grab;\r\n font-size: 25px;\r\n color: #6b7280;\r\n opacity: 0.9;\r\n \"\r\n cdkDragHandle\r\n >\r\n drag_indicator\r\n </span>\r\n <p-treeTableToggler class=\"hiddenVisible\" [rowNode]=\"rowNode\" />\r\n\r\n @if(config.enableSelect) {\r\n <p-treeTableCheckbox\r\n [disabled]=\"isDisabledCheckbox(rowData, rowNode)\"\r\n (click)=\"activeItemLote(selectedItems)\"\r\n [value]=\"rowNode\"\r\n [ngStyle]=\"{\r\n display: isSelectEnabled(rowData, rowNode) ? 'block' : 'none',\r\n 'margin-left': config.visibleCheckboxFunction\r\n ? '-34px'\r\n : '0px'\r\n }\"\r\n />\r\n }\r\n </div>\r\n\r\n <div class=\"flex flex-row align-items-center w-full\">\r\n @if (col.template && validateShowTemplate(rowNode, col)) {\r\n <span class=\"w-full\">\r\n <ng-container\r\n *ngIf=\"getCustomTemplate(col.template.name)\"\r\n [ngTemplateOutlet]=\"getCustomTemplate(col.template.name)\"\r\n [ngTemplateOutletContext]=\"{ $implicit: rowData }\"\r\n >\r\n </ng-container>\r\n </span>\r\n } @else {\r\n <div\r\n class=\"flex flex-row align-items-center {{(col.boolean || col.centralize) && 'justify-content-center'}} gap-2 w-full\"\r\n >\r\n @if(col.tagColor) {\r\n <div\r\n class=\"tag\"\r\n [pTooltip]=\"\r\n col.tooltipTag &&\r\n col.tooltipTag(rowData, col, rowData[col.field])\r\n \"\r\n [style.background-color]=\"\r\n col.tagColor(rowData, col, rowData[col.field])\r\n \"\r\n ></div>\r\n\r\n }\r\n\r\n <i\r\n *ngIf=\"col.boolean\"\r\n class=\"pi {{\r\n rowData[col.field] ? 'pi-check text-green-300' : ''\r\n }}\"\r\n style=\"font-size: 1rem; font-weight: 700;\"\r\n ></i>\r\n\r\n <div class=\"flex flex-column\" *ngIf=\"!col.boolean\">\r\n <span class=\"m-0 text-xs\">{{ rowData[col.field] }}</span>\r\n\r\n <p *ngIf=\"col.subtitle\" class=\"m-0 text-xs font-semibold\">\r\n {{ rowData[col.subtitle] }}\r\n </p>\r\n </div>\r\n </div>\r\n }\r\n </div>\r\n </div>\r\n </td>\r\n }\r\n\r\n <td\r\n style=\"border-left: none; text-align: center; width: 0\"\r\n *ngIf=\"(config.actions?.length ?? 0 > 0) || config.actionsPai\"\r\n [style.borderRight]=\"rowNode.level === 0 ? 'none' : ''\"\r\n [style.borderLeft]=\"rowNode.level === 0 ? 'none' : ''\"\r\n >\r\n <div\r\n *ngIf=\"\r\n (config.actions?.length ?? 0 > 0) &&\r\n validateActionPosition(rowNode)\r\n \"\r\n class=\"flex align-items-center justify-content-center\"\r\n >\r\n <span\r\n class=\"material-symbols-outlined cursor-pointer icon-more-horiz\"\r\n style=\"font-size: 20px; padding: 0.1rem\"\r\n (click)=\"menu.toggle($event); activeItem(rowData)\"\r\n >\r\n more_horiz\r\n </span>\r\n\r\n @for(action of config.actions; track $index) {\r\n {{ criarMenusModal(rowData) }}\r\n }\r\n\r\n <p-menu\r\n #menu\r\n [popup]=\"true\"\r\n [model]=\"menuItems\"\r\n appendTo=\"body\"\r\n ></p-menu>\r\n </div>\r\n\r\n @if(config.actionsPai?.length ?? 0 > 0 && rowNode.level == 0){\r\n <div class=\"flex justify-content-end align-items-center\">\r\n @for (actionPai of config.actionsPai; track $index) {\r\n @if(getOrExecute(actionPai.visible, rowData) ?? true) {\r\n <kv-button\r\n (onClick)=\"activeItem(rowData); actionPai.command($event)\"\r\n [type]=\"'text'\"\r\n [icon]=\"actionPai.icon\"\r\n [severity]=\"actionPai.severity || 'tertiary'\"\r\n />\r\n\r\n } }\r\n </div>\r\n }\r\n </td>\r\n </tr>\r\n } @else {\r\n <tr\r\n [ttRow]=\"rowNode\"\r\n (dblclick)=\"doubleClick($event, rowData)\"\r\n [ngClass]=\"{ capitalize: tableCaptalized }\"\r\n >\r\n @for(col of columns; track $index){\r\n <td\r\n [style.position]=\"rowNode.level !== 0 ? 'sticky' : null\"\r\n [style.left.px]=\"\r\n childrenRecoil && rowNode.level !== 0 ? rowNode.level * 30 : null\r\n \"\r\n [style.borderRight]=\"rowNode.level === 0 ? 'none' : ''\"\r\n [style.borderLeft]=\"\r\n rowNode.level === 0 && col.field != config.columns[0].field\r\n ? 'none'\r\n : ''\r\n \"\r\n >\r\n <div class=\"flex flex-row {{ align(col) }}\">\r\n <div\r\n class=\"w-full-h-full flex align-items-center\"\r\n *ngIf=\"$index == 0\"\r\n >\r\n <p-treeTableToggler class=\"hiddenVisible\" [rowNode]=\"rowNode\" />\r\n\r\n @if(config.enableSelect) {\r\n <p-treeTableCheckbox\r\n [disabled]=\"isDisabledCheckbox(rowData, rowNode)\"\r\n (click)=\"activeItemLote(selectedItems)\"\r\n [value]=\"rowNode\"\r\n [ngStyle]=\"{\r\n display: isSelectEnabled(rowData, rowNode) ? 'block' : 'none',\r\n 'margin-left': config.visibleCheckboxFunction\r\n ? '-34px'\r\n : '0px'\r\n }\"\r\n />\r\n }\r\n </div>\r\n <div class=\"flex flex-row align-items-center w-full\">\r\n @if (col.template && validateShowTemplate(rowNode, col)) {\r\n <span class=\"w-full\">\r\n <ng-container\r\n *ngIf=\"getCustomTemplate(col.template.name)\"\r\n [ngTemplateOutlet]=\"getCustomTemplate(col.template.name)\"\r\n [ngTemplateOutletContext]=\"{ $implicit: rowData }\"\r\n >\r\n </ng-container>\r\n </span>\r\n } @else {\r\n <div\r\n class=\"flex flex-row align-items-center {{(col.boolean || col.centralize) && 'justify-content-center'}} gap-2 w-full\"\r\n >\r\n @if(col.tagColor) {\r\n <div\r\n class=\"tag\"\r\n [pTooltip]=\"\r\n col.tooltipTag &&\r\n col.tooltipTag(rowData, col, rowData[col.field])\r\n \"\r\n [style.background-color]=\"\r\n col.tagColor(rowData, col, rowData[col.field])\r\n \"\r\n ></div>\r\n\r\n }\r\n <i\r\n *ngIf=\"col.boolean\"\r\n class=\"pi {{\r\n rowData[col.field] ? 'pi-check text-green-300' : ''\r\n }}\"\r\n style=\"font-size: 1rem; font-weight: 700;\"\r\n ></i>\r\n\r\n <div class=\"flex flex-column\" *ngIf=\"!col.boolean\">\r\n <span class=\"m-0 text-xs\">{{ rowData[col.field] }}</span>\r\n\r\n <p *ngIf=\"col.subtitle\" class=\"m-0 text-xs font-semibold\">\r\n {{ rowData[col.subtitle] }}\r\n </p>\r\n </div>\r\n </div>\r\n }\r\n </div>\r\n </div>\r\n </td>\r\n }\r\n\r\n <td\r\n style=\"border-left: none; text-align: center; width: 0\"\r\n *ngIf=\"(config.actions?.length ?? 0 > 0) || config.actionsPai\"\r\n >\r\n <div\r\n *ngIf=\"\r\n (config.actions?.length ?? 0 > 0) &&\r\n validateActionPosition(rowNode)\r\n \"\r\n >\r\n <span\r\n class=\"material-symbols-outlined cursor-pointer icon-more-horiz\"\r\n style=\"font-size: 20px; padding: 0.1rem\"\r\n (click)=\"menu.toggle($event); activeItem(rowData)\"\r\n >\r\n more_horiz\r\n </span>\r\n\r\n @for(action of config.actions; track $index) {\r\n {{ criarMenusModal(rowData) }}\r\n }\r\n\r\n <p-menu\r\n #menu\r\n [popup]=\"true\"\r\n [model]=\"menuItems\"\r\n appendTo=\"body\"\r\n ></p-menu>\r\n </div>\r\n\r\n @if(config.actionsPai?.length ?? 0 > 0 && rowNode.level == 0){\r\n <div class=\"flex justify-content-end\">\r\n @for (actionPai of config.actionsPai; track $index) { @if\r\n (getOrExecute(actionPai.visible, rowData) ?? true) {\r\n <kv-button\r\n (onClick)=\"activeItem(rowData); actionPai.command($event)\"\r\n [type]=\"'text'\"\r\n [icon]=\"actionPai.icon\"\r\n [severity]=\"actionPai.severity || 'tertiary'\"\r\n />\r\n } }\r\n </div>\r\n }\r\n </td>\r\n </tr>\r\n }\r\n </ng-template>\r\n <ng-template pTemplate=\"emptymessage\">\r\n <tr>\r\n <td\r\n [attr.colspan]=\"config.columns.length + 1\"\r\n style=\"text-align: center\"\r\n class=\"text-sm\"\r\n >\r\n {{ textoEmptyMessage }}\r\n </td>\r\n </tr>\r\n </ng-template>\r\n </p-treeTable>\r\n</div>\r\n", styles: ["@charset \"UTF-8\";::ng-deep .p-treetable .p-treetable-tbody>tr>td{padding:.2rem}::ng-deep .p-treetable .p-treetable-header{padding:0rem}span{font-size:14px}:host ::ng-deep .p-treetable table{table-layout:auto!important}::ng-deep .p-checkbox .p-checkbox-box{width:1.125rem;height:1.125rem}::ng-deep .p-checkbox{display:flex;align-items:center}::ng-deep .p-treetable .p-paginator{scale:.75}.icon-more-horiz{font-weight:700}.icon-more-horiz:hover,.icon-more-horiz:focus{color:#5e5e5e;transition:color .3s,transform .3s;background-color:#eaeaea;border-radius:50%}::ng-deep .p-treetable .p-treetable-thead>tr>th{background-color:#eaeaea;padding:.3rem}:host ::ng-deep .treetabledraggable .p-treetable .p-treetable-tbody>tr>td .p-treetable-toggler{width:1rem;height:1rem}.tag{width:5px;height:20px;border-radius:.25rem}:host ::ng-deep .draggable-cell .drag-icon{visibility:hidden}:host ::ng-deep .draggable-cell:hover .drag-icon{visibility:visible}.cdk-drag-preview{display:flex;align-items:center;justify-content:space-between;border-radius:10px!important}.cdk-drop-list-dragging{cursor:grabbing}:host ::ng-deep .cdk-drop-list-dragging .cdk-drag{transition:transform .25s cubic-bezier(0,0,.2,1)}:host ::ng-deep .cdk-drag-animating{transition:transform .3s cubic-bezier(0,0,.2,1)}::ng-deep svg.p-icon{width:.65rem;height:.65rem}::ng-deep .p-checkbox .p-checkbox-box.p-highlight{border-color:#004172;background:#004172}::ng-deep .p-checkbox .p-checkbox-box.p-highlight:hover{background-color:#002542}::ng-deep .p-checkbox .p-checkbox-box.p-highlight:active{background-color:#002542}::ng-deep .p-checkbox .p-checkbox-box.p-highlight:disabled{background-color:#002542;opacity:.4;cursor:auto}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "directive", type: i1$2.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { kind: "directive", type: i5$2.AutoFocus, selector: "[pAutoFocus]", inputs: ["autofocus"] }, { kind: "directive", type: i6.Tooltip, selector: "[pTooltip]", inputs: ["tooltipPosition", "tooltipEvent", "appendTo", "positionStyle", "tooltipStyleClass", "tooltipZIndex", "escape", "showDelay", "hideDelay", "life", "positionTop", "positionLeft", "autoHide", "fitContent", "hideOnEscape", "pTooltip", "tooltipDisabled", "tooltipOptions"] }, { kind: "directive", type: i5$3.InputText, selector: "[pInputText]", inputs: ["variant"] }, { kind: "component", type: i5.Menu, selector: "p-menu", inputs: ["model", "popup", "style", "styleClass", "appendTo", "autoZIndex", "baseZIndex", "showTransitionOptions", "hideTransitionOptions", "ariaLabel", "ariaLabelledBy", "id", "tabindex"], outputs: ["onShow", "onHide", "onBlur", "onFocus"] }, { kind: "directive", type: i7.CdkDropList, selector: "[cdkDropList], cdk-drop-list", inputs: ["cdkDropListConnectedTo", "cdkDropListData", "cdkDropListOrientation", "id", "cdkDropListLockAxis", "cdkDropListDisabled", "cdkDropListSortingDisabled", "cdkDropListEnterPredicate", "cdkDropListSortPredicate", "cdkDropListAutoScrollDisabled", "cdkDropListAutoScrollStep"], outputs: ["cdkDropListDropped", "cdkDropListEntered", "cdkDropListExited", "cdkDropListSorted"], exportAs: ["cdkDropList"] }, { kind: "directive", type: i7.CdkDrag, selector: "[cdkDrag]", inputs: ["cdkDragData", "cdkDragLockAxis", "cdkDragRootElement", "cdkDragBoundary", "cdkDragStartDelay", "cdkDragFreeDragPosition", "cdkDragDisabled", "cdkDragConstrainPosition", "cdkDragPreviewClass", "cdkDragPreviewContainer"], outputs: ["cdkDragStarted", "cdkDragReleased", "cdkDragEnded", "cdkDragEntered", "cdkDragExited", "cdkDragDropped", "cdkDragMoved"], exportAs: ["cdkDrag"] }, { kind: "directive", type: i7.CdkDragHandle, selector: "[cdkDragHandle]", inputs: ["cdkDragHandleDisabled"] }, { kind: "component", type: i8$2.TreeTable, selector: "p-treeTable", inputs: ["columns", "style", "styleClass", "tableStyle", "tableStyleClass", "autoLayout", "lazy", "lazyLoadOnInit", "paginator", "rows", "first", "pageLinks", "rowsPerPageOptions", "alwaysShowPaginator", "paginatorPosition", "paginatorStyleClass", "paginatorDropdownAppendTo", "currentPageReportTemplate", "showCurrentPageReport", "showJumpToPageDropdown", "showFirstLastIcon", "showPageLinks", "defaultSortOrder", "sortMode", "resetPageOnSort", "customSort", "selectionMode", "contextMenuSelection", "contextMenuSelectionMode", "dataKey", "metaKeySelection", "compareSelectionBy", "rowHover", "loading", "loadingIcon", "showLoader", "scrollable", "scrollHeight", "virtualScroll", "virtualScrollItemSize", "virtualScrollOptions", "virtualScrollDelay", "frozenWidth", "frozenColumns", "resizableColumns", "columnResizeMode", "reorderableColumns", "contextMenu", "rowTrackBy", "filters", "globalFilterFields", "filterDelay", "filterMode", "filterLocale", "paginatorLocale", "totalRecords", "sortField", "sortOrder", "multiSortMeta", "selection", "value", "virtualRowHeight", "selectionKeys"], outputs: ["selectionChange", "contextMenuSelectionChange", "onFilter", "onNodeExpand", "onNodeCollapse", "onPage", "onSort", "onLazyLoad", "sortFunction", "onColResize", "onColReorder", "onNodeSelect", "onNodeUnselect", "onContextMenuSelect", "onHeaderCheckboxToggle", "onEditInit", "onEditComplete", "onEditCancel", "selectionKeysChange"] }, { kind: "component", type: i8$2.TreeTableToggler, selector: "p-treeTableToggler", inputs: ["rowNode"] }, { kind: "directive", type: i8$2.TTSortableColumn, selector: "[ttSortableColumn]", inputs: ["ttSortableColumn", "ttSortableColumnDisabled"] }, { kind: "component", type: i8$2.TTSortIcon, selector: "p-treeTableSortIcon", inputs: ["field", "ariaLabelDesc", "ariaLabelAsc"] }, { kind: "directive", type: i8$2.TTRow, selector: "[ttRow]", inputs: ["ttRow"] }, { kind: "component", type: i8$2.TTCheckbox, selector: "p-treeTableCheckbox", inputs: ["disabled", "value"] }, { kind: "component", type: i8$2.TTHeaderCheckbox, selector: "p-treeTableHeaderCheckbox" }, { kind: "component", type: KvButtonComponent, selector: "kv-button", inputs: ["fullWidth", "type", "loading", "severity", "size", "icon", "label", "disabled"], outputs: ["onClick"] }] }); }
|
|
2288
2288
|
}
|
|
2289
2289
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.8", ngImport: i0, type: KvTreetableComponent, decorators: [{
|
|
2290
2290
|
type: Component,
|
|
2291
|
-
args: [{ selector: 'kv-tree-table', template: "<div>\r\n <p-treeTable\r\n #tt\r\n cdkDropList\r\n class=\"example-list\"\r\n (cdkDropListDropped)=\"drop($event)\"\r\n [value]=\"dataSource\"\r\n [columns]=\"config.columns\"\r\n [resizableColumns]=\"true\"\r\n [tableStyle]=\"{ 'min-width': '50rem' }\"\r\n [resizableColumns]=\"true\"\r\n [paginator]=\"paginator\"\r\n [rows]=\"rows\"\r\n [totalRecords]=\"totalRecords\"\r\n [rowsPerPageOptions]=\"[5, 10, 15, 25, 50]\"\r\n [showFirstLastIcon]=\"tamanhoTela > 960 ? true : false\"\r\n [pageLinks]=\"tamanhoTela > 960 ? 2 : 1\"\r\n [styleClass]=\"gridLines ? 'p-treetable-gridlines' : ''\"\r\n [(selection)]=\"selectedItems\"\r\n [selectionKeys]=\"selectionKeys()\"\r\n (selectionKeysChange)=\"selectionKeys.set($event)\"\r\n [lazy]=\"config.lazy\"\r\n (onLazyLoad)=\"paginate($event)\"\r\n (onNodeSelect)=\"onNodeSelected($event)\"\r\n (onNodeUnselect)=\"onNodeUnselected($event)\"\r\n [showCurrentPageReport]=\"true\"\r\n currentPageReportTemplate=\"{first} - {last} de {totalRecords}\"\r\n [scrollHeight]=\"scrollHeight\"\r\n >\r\n <ng-template pTemplate=\"caption\" *ngIf=\"config.enableCation\">\r\n <div\r\n class=\"flex flex-row flex-wrap justify-content-between align-items-center grid formgrid p-fluid col-12 m-0 p-1\"\r\n style=\"background-color: #eaeaea\"\r\n >\r\n <div class=\"col-12 flex flex-column\">\r\n <div *ngIf=\"config.title\" class=\"text-md font-bold my-3\">\r\n {{ config.title }}\r\n </div>\r\n <div *ngIf=\"config.subtitle\" class=\"text-sm mb-4 font-medium\">\r\n {{ config.subtitle }}\r\n </div>\r\n </div>\r\n\r\n <div\r\n class=\"flex flex-row align-items-center col-10 p-0 md:col-6 lg:col-4 justify-content-center {{\r\n tamanhoTela < 768 ? '' : 'input-search'\r\n }}\"\r\n >\r\n <span *ngIf=\"config.enableFilter\" class=\"p-input-icon-left\">\r\n <i class=\"pi pi-search\"></i>\r\n\r\n <input\r\n pInputText\r\n pAutoFocus\r\n [autofocus]=\"true\"\r\n type=\"text\"\r\n (input)=\"onGlobalFilter(tt, $event)\"\r\n placeholder=\"Pesquisar...\"\r\n class=\"h-2rem\"\r\n #inputBusca\r\n />\r\n </span>\r\n </div>\r\n\r\n <div class=\"flex flex-row col-1 justify-content-end p-0\">\r\n <div class=\"flex flex-row gap-2 btns-options\">\r\n @for (action of config.actionsLote; track $index) {\r\n @if((selectedItems.length > 0 || action.showAcoesLote) &&\r\n exibirCampo(action, this.action)) {\r\n <kv-button\r\n (onClick)=\"action?.command(); activeItemLote(selectedItems)\"\r\n [pTooltip]=\"getOrExecute(action.tooltip, selectedItems)\"\r\n [tooltipPosition]=\"'bottom'\"\r\n [size]=\"'small'\"\r\n [disabled]=\"getOrExecute(action.disabled, selectedItems) || false\"\r\n [icon]=\"getOrExecute(action.icon, selectedItems)\"\r\n [severity]=\"action.severity || 'tertiary'\"\r\n />\r\n } }\r\n </div>\r\n </div>\r\n </div>\r\n </ng-template>\r\n\r\n @if(showHeader){\r\n <ng-template pTemplate=\"header\" let-columns>\r\n <tr>\r\n @for(col of columns; track $index){\r\n <th\r\n [ttSortableColumn]=\"col.field\"\r\n [ttSortableColumnDisabled]=\"col.sortable === false\"\r\n [style.width]=\"col.width\"\r\n >\r\n <div>\r\n <div [ngClass]=\"{ flex: $index == 0, 'gap-3': $index == 0 }\">\r\n <div *ngIf=\"$index == 0 && config.enableSelect\">\r\n <p-treeTableHeaderCheckbox\r\n (click)=\"activeItemLote(selectedItems)\"\r\n />\r\n </div>\r\n\r\n <div class=\"flex flex-row align-items-center {{ align(col) }}\">\r\n <span class=\"text-xs\">{{ col.header }}</span>\r\n\r\n @if(col.sortable) {\r\n <p-treeTableSortIcon [field]=\"col.field\" class=\"pb-1\" />\r\n\r\n }\r\n\r\n <span\r\n *ngIf=\"col.headerTooltip\"\r\n class=\"material-symbols-outlined flex align-items-center\"\r\n [pTooltip]=\"col.headerTooltip\"\r\n >info</span\r\n >\r\n </div>\r\n </div>\r\n </div>\r\n </th>\r\n @if (config.actions?.length ?? 0 > 0) {\r\n <th [style.width]=\"5\"></th>\r\n } }\r\n </tr>\r\n </ng-template>\r\n\r\n <ng-template pTemplate=\"header\" let-columns>\r\n <tr>\r\n @for (col of columns; track $index) {\r\n <th\r\n [ttSortableColumn]=\"col.field\"\r\n [ttSortableColumnDisabled]=\"col.sortable === false\"\r\n [style.width]=\"col.width\"\r\n >\r\n <div class=\"flex flex-row align-items-center {{ align(col) }}\">\r\n <span class=\"text-xs\">{{ col.header }}</span>\r\n\r\n @if(col.sortable) {\r\n <p-treeTableSortIcon [field]=\"col.field\" class=\"pb-1\" />\r\n }\r\n </div>\r\n </th>\r\n } @if (config.actions?.length ?? 0 > 0) {\r\n <th [style.width]=\"5\"></th>\r\n }\r\n </tr>\r\n </ng-template>\r\n }\r\n\r\n <ng-template\r\n pTemplate=\"body\"\r\n let-rowNode\r\n let-rowData=\"rowData\"\r\n let-columns=\"columns\"\r\n >\r\n @if(treeTableDraggable) {\r\n <tr\r\n cdkDrag\r\n cdkDragLockAxis=\"y\"\r\n [cdkDragData]=\"rowNode\"\r\n [ttRow]=\"rowNode\"\r\n (dblclick)=\"doubleClick($event, rowData)\"\r\n [ngClass]=\"{ capitalize: tableCaptalized }\"\r\n >\r\n @for(col of columns; track $index){\r\n <td\r\n class=\"draggable-cell\"\r\n [style.position]=\"\r\n !disableRowNodeSticky && rowNode.level !== 0 ? 'sticky' : null\r\n \"\r\n >\r\n <!-- [style.left.px]=\"\r\n childrenRecoil && rowNode.level !== 0 ? rowNode.level * 30 : null\r\n \" -->\r\n\r\n <div class=\"flex flex-row {{ align(col) }}\">\r\n <div\r\n class=\"w-full-h-full flex align-items-center\"\r\n *ngIf=\"$index == 0\"\r\n >\r\n <span\r\n class=\"material-symbols-outlined drag-icon\"\r\n style=\"\r\n cursor: grab;\r\n font-size: 25px;\r\n color: #6b7280;\r\n opacity: 0.9;\r\n \"\r\n cdkDragHandle\r\n >\r\n drag_indicator\r\n </span>\r\n <p-treeTableToggler class=\"hiddenVisible\" [rowNode]=\"rowNode\" />\r\n\r\n @if(config.enableSelect) {\r\n <p-treeTableCheckbox\r\n [disabled]=\"isDisabledCheckbox(rowData, rowNode)\"\r\n (click)=\"activeItemLote(selectedItems)\"\r\n [value]=\"rowNode\"\r\n [ngStyle]=\"{\r\n display: isSelectEnabled(rowData, rowNode) ? 'block' : 'none',\r\n 'margin-left': config.visibleCheckboxFunction\r\n ? '-34px'\r\n : '0px'\r\n }\"\r\n />\r\n }\r\n </div>\r\n\r\n <div class=\"flex flex-row align-items-center w-full\">\r\n @if (col.template && validateShowTemplate(rowNode, col)) {\r\n <span class=\"w-full\">\r\n <ng-container\r\n *ngIf=\"getCustomTemplate(col.template.name)\"\r\n [ngTemplateOutlet]=\"getCustomTemplate(col.template.name)\"\r\n [ngTemplateOutletContext]=\"{ $implicit: rowData }\"\r\n >\r\n </ng-container>\r\n </span>\r\n } @else {\r\n <div\r\n class=\"flex flex-row align-items-center {{(col.boolean || col.centralize) && 'justify-content-center'}} gap-2 w-full\"\r\n >\r\n @if(col.tagColor) {\r\n <div\r\n class=\"tag\"\r\n [pTooltip]=\"\r\n col.tooltipTag &&\r\n col.tooltipTag(rowData, col, rowData[col.field])\r\n \"\r\n [style.background-color]=\"\r\n col.tagColor(rowData, col, rowData[col.field])\r\n \"\r\n ></div>\r\n\r\n }\r\n\r\n <i\r\n *ngIf=\"col.boolean\"\r\n class=\"pi {{\r\n rowData[col.field] ? 'pi-check text-green-300' : ''\r\n }}\"\r\n style=\"font-size: 1rem; font-weight: 700;\"\r\n ></i>\r\n\r\n <div class=\"flex flex-column\" *ngIf=\"!col.boolean\">\r\n <span class=\"m-0 text-xs\">{{ rowData[col.field] }}</span>\r\n\r\n <p *ngIf=\"col.subtitle\" class=\"m-0 text-xs font-semibold\">\r\n {{ rowData[col.subtitle] }}\r\n </p>\r\n </div>\r\n </div>\r\n }\r\n </div>\r\n </div>\r\n </td>\r\n }\r\n\r\n <td\r\n style=\"border-left: none; text-align: center; width: 0\"\r\n *ngIf=\"(config.actions?.length ?? 0 > 0) || config.actionsPai\"\r\n [style.borderRight]=\"rowNode.level === 0 ? 'none' : ''\"\r\n [style.borderLeft]=\"rowNode.level === 0 ? 'none' : ''\"\r\n >\r\n <div\r\n *ngIf=\"\r\n (config.actions?.length ?? 0 > 0) &&\r\n validateActionPosition(rowNode)\r\n \"\r\n class=\"flex align-items-center justify-content-center\"\r\n >\r\n <span\r\n class=\"material-symbols-outlined cursor-pointer icon-more-horiz\"\r\n style=\"font-size: 20px; padding: 0.1rem\"\r\n (click)=\"menu.toggle($event); activeItem(rowData)\"\r\n >\r\n more_horiz\r\n </span>\r\n\r\n @for(action of config.actions; track $index) {\r\n {{ criarMenusModal(rowData) }}\r\n }\r\n\r\n <p-menu\r\n #menu\r\n [popup]=\"true\"\r\n [model]=\"menuItems\"\r\n appendTo=\"body\"\r\n ></p-menu>\r\n </div>\r\n\r\n @if(config.actionsPai?.length ?? 0 > 0 && rowNode.level == 0){\r\n <div class=\"flex justify-content-end align-items-center\">\r\n @for (actionPai of config.actionsPai; track $index) {\r\n @if(getOrExecute(actionPai.visible, rowData) ?? true) {\r\n <kv-button\r\n (onClick)=\"activeItem(rowData); actionPai.command($event)\"\r\n [type]=\"'text'\"\r\n [icon]=\"actionPai.icon\"\r\n [severity]=\"actionPai.severity || 'tertiary'\"\r\n />\r\n\r\n } }\r\n </div>\r\n }\r\n </td>\r\n </tr>\r\n } @else {\r\n <tr\r\n [ttRow]=\"rowNode\"\r\n (dblclick)=\"doubleClick($event, rowData)\"\r\n [ngClass]=\"{ capitalize: tableCaptalized }\"\r\n >\r\n @for(col of columns; track $index){\r\n <td\r\n [style.position]=\"rowNode.level !== 0 ? 'sticky' : null\"\r\n [style.left.px]=\"\r\n childrenRecoil && rowNode.level !== 0 ? rowNode.level * 30 : null\r\n \"\r\n [style.borderRight]=\"rowNode.level === 0 ? 'none' : ''\"\r\n [style.borderLeft]=\"\r\n rowNode.level === 0 && col.field != config.columns[0].field\r\n ? 'none'\r\n : ''\r\n \"\r\n >\r\n <div class=\"flex flex-row {{ align(col) }}\">\r\n <div\r\n class=\"w-full-h-full flex align-items-center\"\r\n *ngIf=\"$index == 0\"\r\n >\r\n <p-treeTableToggler class=\"hiddenVisible\" [rowNode]=\"rowNode\" />\r\n\r\n @if(config.enableSelect) {\r\n <p-treeTableCheckbox\r\n [disabled]=\"isDisabledCheckbox(rowData, rowNode)\"\r\n (click)=\"activeItemLote(selectedItems)\"\r\n [value]=\"rowNode\"\r\n [ngStyle]=\"{\r\n display: isSelectEnabled(rowData, rowNode) ? 'block' : 'none',\r\n 'margin-left': config.visibleCheckboxFunction\r\n ? '-34px'\r\n : '0px'\r\n }\"\r\n />\r\n }\r\n </div>\r\n <div class=\"flex flex-row align-items-center w-full\">\r\n @if (col.template && validateShowTemplate(rowNode, col)) {\r\n <span class=\"w-full\">\r\n <ng-container\r\n *ngIf=\"getCustomTemplate(col.template.name)\"\r\n [ngTemplateOutlet]=\"getCustomTemplate(col.template.name)\"\r\n [ngTemplateOutletContext]=\"{ $implicit: rowData }\"\r\n >\r\n </ng-container>\r\n </span>\r\n } @else {\r\n <div\r\n class=\"flex flex-row align-items-center {{(col.boolean || col.centralize) && 'justify-content-center'}} gap-2 w-full\"\r\n >\r\n @if(col.tagColor) {\r\n <div\r\n class=\"tag\"\r\n [pTooltip]=\"\r\n col.tooltipTag &&\r\n col.tooltipTag(rowData, col, rowData[col.field])\r\n \"\r\n [style.background-color]=\"\r\n col.tagColor(rowData, col, rowData[col.field])\r\n \"\r\n ></div>\r\n\r\n }\r\n <i\r\n *ngIf=\"col.boolean\"\r\n class=\"pi {{\r\n rowData[col.field] ? 'pi-check text-green-300' : ''\r\n }}\"\r\n style=\"font-size: 1rem; font-weight: 700;\"\r\n ></i>\r\n\r\n <div class=\"flex flex-column\" *ngIf=\"!col.boolean\">\r\n <span class=\"m-0 text-xs\">{{ rowData[col.field] }}</span>\r\n\r\n <p *ngIf=\"col.subtitle\" class=\"m-0 text-xs font-semibold\">\r\n {{ rowData[col.subtitle] }}\r\n </p>\r\n </div>\r\n </div>\r\n }\r\n </div>\r\n </div>\r\n </td>\r\n }\r\n\r\n <td\r\n style=\"border-left: none; text-align: center\"\r\n *ngIf=\"(config.actions?.length ?? 0 > 0) || config.actionsPai\"\r\n >\r\n <div\r\n *ngIf=\"\r\n (config.actions?.length ?? 0 > 0) &&\r\n validateActionPosition(rowNode)\r\n \"\r\n >\r\n <span\r\n class=\"material-symbols-outlined cursor-pointer icon-more-horiz\"\r\n style=\"font-size: 20px; padding: 0.1rem\"\r\n (click)=\"menu.toggle($event); activeItem(rowData)\"\r\n >\r\n more_horiz\r\n </span>\r\n\r\n @for(action of config.actions; track $index) {\r\n {{ criarMenusModal(rowData) }}\r\n }\r\n\r\n <p-menu\r\n #menu\r\n [popup]=\"true\"\r\n [model]=\"menuItems\"\r\n appendTo=\"body\"\r\n ></p-menu>\r\n </div>\r\n\r\n @if(config.actionsPai?.length ?? 0 > 0 && rowNode.level == 0){\r\n <div class=\"flex justify-content-end\">\r\n @for (actionPai of config.actionsPai; track $index) { @if\r\n (getOrExecute(actionPai.visible, rowData) ?? true) {\r\n <kv-button\r\n (onClick)=\"activeItem(rowData); actionPai.command($event)\"\r\n [type]=\"'text'\"\r\n [icon]=\"actionPai.icon\"\r\n [severity]=\"actionPai.severity || 'tertiary'\"\r\n />\r\n } }\r\n </div>\r\n }\r\n </td>\r\n </tr>\r\n }\r\n </ng-template>\r\n <ng-template pTemplate=\"emptymessage\">\r\n <tr>\r\n <td\r\n [attr.colspan]=\"config.columns.length + 1\"\r\n style=\"text-align: center\"\r\n class=\"text-sm\"\r\n >\r\n {{ textoEmptyMessage }}\r\n </td>\r\n </tr>\r\n </ng-template>\r\n </p-treeTable>\r\n</div>\r\n", styles: ["@charset \"UTF-8\";::ng-deep .p-treetable .p-treetable-tbody>tr>td{padding:.2rem}::ng-deep .p-treetable .p-treetable-header{padding:0rem}span{font-size:14px}:host ::ng-deep .p-treetable table{table-layout:auto!important}::ng-deep .p-checkbox .p-checkbox-box{width:1.125rem;height:1.125rem}::ng-deep .p-checkbox{display:flex;align-items:center}::ng-deep .p-treetable .p-paginator{scale:.75}.icon-more-horiz{font-weight:700}.icon-more-horiz:hover,.icon-more-horiz:focus{color:#5e5e5e;transition:color .3s,transform .3s;background-color:#eaeaea;border-radius:50%}::ng-deep .p-treetable .p-treetable-thead>tr>th{background-color:#eaeaea;padding:.3rem}:host ::ng-deep .treetabledraggable .p-treetable .p-treetable-tbody>tr>td .p-treetable-toggler{width:1rem;height:1rem}.tag{width:5px;height:20px;border-radius:.25rem}:host ::ng-deep .draggable-cell .drag-icon{visibility:hidden}:host ::ng-deep .draggable-cell:hover .drag-icon{visibility:visible}.cdk-drag-preview{display:flex;align-items:center;justify-content:space-between;border-radius:10px!important}.cdk-drop-list-dragging{cursor:grabbing}:host ::ng-deep .cdk-drop-list-dragging .cdk-drag{transition:transform .25s cubic-bezier(0,0,.2,1)}:host ::ng-deep .cdk-drag-animating{transition:transform .3s cubic-bezier(0,0,.2,1)}::ng-deep svg.p-icon{width:.65rem;height:.65rem}::ng-deep .p-checkbox .p-checkbox-box.p-highlight{border-color:#004172;background:#004172}::ng-deep .p-checkbox .p-checkbox-box.p-highlight:hover{background-color:#002542}::ng-deep .p-checkbox .p-checkbox-box.p-highlight:active{background-color:#002542}::ng-deep .p-checkbox .p-checkbox-box.p-highlight:disabled{background-color:#002542;opacity:.4;cursor:auto}\n"] }]
|
|
2291
|
+
args: [{ selector: 'kv-tree-table', template: "<div>\r\n <p-treeTable\r\n #tt\r\n cdkDropList\r\n class=\"example-list\"\r\n (cdkDropListDropped)=\"drop($event)\"\r\n [value]=\"dataSource\"\r\n [columns]=\"config.columns\"\r\n [resizableColumns]=\"true\"\r\n [tableStyle]=\"{ 'min-width': '50rem' }\"\r\n [resizableColumns]=\"true\"\r\n [paginator]=\"paginator\"\r\n [rows]=\"rows\"\r\n [totalRecords]=\"totalRecords\"\r\n [rowsPerPageOptions]=\"[5, 10, 15, 25, 50]\"\r\n [showFirstLastIcon]=\"tamanhoTela > 960 ? true : false\"\r\n [pageLinks]=\"tamanhoTela > 960 ? 2 : 1\"\r\n [styleClass]=\"gridLines ? 'p-treetable-gridlines' : ''\"\r\n [(selection)]=\"selectedItems\"\r\n [lazy]=\"config.lazy\"\r\n (onLazyLoad)=\"paginate($event)\"\r\n (onNodeSelect)=\"onNodeSelected($event)\"\r\n (onNodeUnselect)=\"onNodeUnselected($event)\"\r\n [showCurrentPageReport]=\"true\"\r\n currentPageReportTemplate=\"{first} - {last} de {totalRecords}\"\r\n [scrollHeight]=\"scrollHeight\"\r\n >\r\n <ng-template pTemplate=\"caption\" *ngIf=\"config.enableCation\">\r\n <div\r\n class=\"flex flex-row flex-wrap justify-content-between align-items-center grid formgrid p-fluid col-12 m-0 p-1\"\r\n style=\"background-color: #eaeaea\"\r\n >\r\n <div class=\"col-12 flex flex-column\">\r\n <div *ngIf=\"config.title\" class=\"text-md font-bold my-3\">\r\n {{ config.title }}\r\n </div>\r\n <div *ngIf=\"config.subtitle\" class=\"text-sm mb-4 font-medium\">\r\n {{ config.subtitle }}\r\n </div>\r\n </div>\r\n\r\n <div\r\n class=\"flex flex-row align-items-center col-10 p-0 md:col-6 lg:col-4 justify-content-center {{\r\n tamanhoTela < 768 ? '' : 'input-search'\r\n }}\"\r\n >\r\n <span *ngIf=\"config.enableFilter\" class=\"p-input-icon-left\">\r\n <i class=\"pi pi-search\"></i>\r\n\r\n <input\r\n pInputText\r\n pAutoFocus\r\n [autofocus]=\"true\"\r\n type=\"text\"\r\n (input)=\"onGlobalFilter(tt, $event)\"\r\n placeholder=\"Pesquisar...\"\r\n class=\"h-2rem\"\r\n #inputBusca\r\n />\r\n </span>\r\n </div>\r\n\r\n <div class=\"flex flex-row col-1 justify-content-end p-0\">\r\n <div class=\"flex flex-row gap-2 btns-options\">\r\n @for (action of config.actionsLote; track $index) {\r\n @if((selectedItems.length > 0 || action.showAcoesLote) &&\r\n exibirCampo(action, this.action)) {\r\n <kv-button\r\n (onClick)=\"action?.command(); activeItemLote(selectedItems)\"\r\n [pTooltip]=\"getOrExecute(action.tooltip, selectedItems)\"\r\n [tooltipPosition]=\"'bottom'\"\r\n [size]=\"'small'\"\r\n [disabled]=\"getOrExecute(action.disabled, selectedItems) || false\"\r\n [icon]=\"getOrExecute(action.icon, selectedItems)\"\r\n [severity]=\"action.severity || 'tertiary'\"\r\n />\r\n } }\r\n </div>\r\n </div>\r\n </div>\r\n </ng-template>\r\n\r\n @if(showHeader){\r\n <ng-template pTemplate=\"header\" let-columns>\r\n <tr>\r\n @for(col of columns; track $index){\r\n <th\r\n [ttSortableColumn]=\"col.field\"\r\n [ttSortableColumnDisabled]=\"col.sortable === false\"\r\n [style.width]=\"col.width\"\r\n >\r\n <div>\r\n <div [ngClass]=\"{ flex: $index == 0, 'gap-3': $index == 0 }\">\r\n <div *ngIf=\"$index == 0 && config.enableSelect\">\r\n <p-treeTableHeaderCheckbox\r\n (click)=\"activeItemLote(selectedItems)\"\r\n />\r\n </div>\r\n\r\n <div class=\"flex flex-row align-items-center {{ align(col) }}\">\r\n <span class=\"text-xs\">{{ col.header }}</span>\r\n\r\n @if(col.sortable) {\r\n <p-treeTableSortIcon [field]=\"col.field\" class=\"pb-1\" />\r\n\r\n }\r\n\r\n <span\r\n *ngIf=\"col.headerTooltip\"\r\n class=\"material-symbols-outlined flex align-items-center\"\r\n [pTooltip]=\"col.headerTooltip\"\r\n >info</span\r\n >\r\n </div>\r\n </div>\r\n </div>\r\n </th>\r\n @if (config.actions?.length ?? 0 > 0) {\r\n <th [style.width]=\"5\"></th>\r\n } }\r\n </tr>\r\n </ng-template>\r\n\r\n <ng-template pTemplate=\"header\" let-columns>\r\n <tr>\r\n @for (col of columns; track $index) {\r\n <th\r\n [ttSortableColumn]=\"col.field\"\r\n [ttSortableColumnDisabled]=\"col.sortable === false\"\r\n [style.width]=\"col.width\"\r\n >\r\n <div class=\"flex flex-row align-items-center {{ align(col) }}\">\r\n <span class=\"text-xs\">{{ col.header }}</span>\r\n\r\n @if(col.sortable) {\r\n <p-treeTableSortIcon [field]=\"col.field\" class=\"pb-1\" />\r\n }\r\n </div>\r\n </th>\r\n } @if (config.actions?.length ?? 0 > 0) {\r\n <th [style.width]=\"5\"></th>\r\n }\r\n </tr>\r\n </ng-template>\r\n }\r\n\r\n <ng-template\r\n pTemplate=\"body\"\r\n let-rowNode\r\n let-rowData=\"rowData\"\r\n let-columns=\"columns\"\r\n >\r\n @if(treeTableDraggable) {\r\n <tr\r\n cdkDrag\r\n cdkDragLockAxis=\"y\"\r\n [cdkDragData]=\"rowNode\"\r\n [ttRow]=\"rowNode\"\r\n (dblclick)=\"doubleClick($event, rowData)\"\r\n [ngClass]=\"{ capitalize: tableCaptalized }\"\r\n >\r\n @for(col of columns; track $index){\r\n <td\r\n class=\"draggable-cell\"\r\n [style.position]=\"\r\n !disableRowNodeSticky && rowNode.level !== 0 ? 'sticky' : null\r\n \"\r\n >\r\n <!-- [style.left.px]=\"\r\n childrenRecoil && rowNode.level !== 0 ? rowNode.level * 30 : null\r\n \" -->\r\n\r\n <div class=\"flex flex-row {{ align(col) }}\">\r\n <div\r\n class=\"w-full-h-full flex align-items-center\"\r\n *ngIf=\"$index == 0\"\r\n >\r\n <span\r\n class=\"material-symbols-outlined drag-icon\"\r\n style=\"\r\n cursor: grab;\r\n font-size: 25px;\r\n color: #6b7280;\r\n opacity: 0.9;\r\n \"\r\n cdkDragHandle\r\n >\r\n drag_indicator\r\n </span>\r\n <p-treeTableToggler class=\"hiddenVisible\" [rowNode]=\"rowNode\" />\r\n\r\n @if(config.enableSelect) {\r\n <p-treeTableCheckbox\r\n [disabled]=\"isDisabledCheckbox(rowData, rowNode)\"\r\n (click)=\"activeItemLote(selectedItems)\"\r\n [value]=\"rowNode\"\r\n [ngStyle]=\"{\r\n display: isSelectEnabled(rowData, rowNode) ? 'block' : 'none',\r\n 'margin-left': config.visibleCheckboxFunction\r\n ? '-34px'\r\n : '0px'\r\n }\"\r\n />\r\n }\r\n </div>\r\n\r\n <div class=\"flex flex-row align-items-center w-full\">\r\n @if (col.template && validateShowTemplate(rowNode, col)) {\r\n <span class=\"w-full\">\r\n <ng-container\r\n *ngIf=\"getCustomTemplate(col.template.name)\"\r\n [ngTemplateOutlet]=\"getCustomTemplate(col.template.name)\"\r\n [ngTemplateOutletContext]=\"{ $implicit: rowData }\"\r\n >\r\n </ng-container>\r\n </span>\r\n } @else {\r\n <div\r\n class=\"flex flex-row align-items-center {{(col.boolean || col.centralize) && 'justify-content-center'}} gap-2 w-full\"\r\n >\r\n @if(col.tagColor) {\r\n <div\r\n class=\"tag\"\r\n [pTooltip]=\"\r\n col.tooltipTag &&\r\n col.tooltipTag(rowData, col, rowData[col.field])\r\n \"\r\n [style.background-color]=\"\r\n col.tagColor(rowData, col, rowData[col.field])\r\n \"\r\n ></div>\r\n\r\n }\r\n\r\n <i\r\n *ngIf=\"col.boolean\"\r\n class=\"pi {{\r\n rowData[col.field] ? 'pi-check text-green-300' : ''\r\n }}\"\r\n style=\"font-size: 1rem; font-weight: 700;\"\r\n ></i>\r\n\r\n <div class=\"flex flex-column\" *ngIf=\"!col.boolean\">\r\n <span class=\"m-0 text-xs\">{{ rowData[col.field] }}</span>\r\n\r\n <p *ngIf=\"col.subtitle\" class=\"m-0 text-xs font-semibold\">\r\n {{ rowData[col.subtitle] }}\r\n </p>\r\n </div>\r\n </div>\r\n }\r\n </div>\r\n </div>\r\n </td>\r\n }\r\n\r\n <td\r\n style=\"border-left: none; text-align: center; width: 0\"\r\n *ngIf=\"(config.actions?.length ?? 0 > 0) || config.actionsPai\"\r\n [style.borderRight]=\"rowNode.level === 0 ? 'none' : ''\"\r\n [style.borderLeft]=\"rowNode.level === 0 ? 'none' : ''\"\r\n >\r\n <div\r\n *ngIf=\"\r\n (config.actions?.length ?? 0 > 0) &&\r\n validateActionPosition(rowNode)\r\n \"\r\n class=\"flex align-items-center justify-content-center\"\r\n >\r\n <span\r\n class=\"material-symbols-outlined cursor-pointer icon-more-horiz\"\r\n style=\"font-size: 20px; padding: 0.1rem\"\r\n (click)=\"menu.toggle($event); activeItem(rowData)\"\r\n >\r\n more_horiz\r\n </span>\r\n\r\n @for(action of config.actions; track $index) {\r\n {{ criarMenusModal(rowData) }}\r\n }\r\n\r\n <p-menu\r\n #menu\r\n [popup]=\"true\"\r\n [model]=\"menuItems\"\r\n appendTo=\"body\"\r\n ></p-menu>\r\n </div>\r\n\r\n @if(config.actionsPai?.length ?? 0 > 0 && rowNode.level == 0){\r\n <div class=\"flex justify-content-end align-items-center\">\r\n @for (actionPai of config.actionsPai; track $index) {\r\n @if(getOrExecute(actionPai.visible, rowData) ?? true) {\r\n <kv-button\r\n (onClick)=\"activeItem(rowData); actionPai.command($event)\"\r\n [type]=\"'text'\"\r\n [icon]=\"actionPai.icon\"\r\n [severity]=\"actionPai.severity || 'tertiary'\"\r\n />\r\n\r\n } }\r\n </div>\r\n }\r\n </td>\r\n </tr>\r\n } @else {\r\n <tr\r\n [ttRow]=\"rowNode\"\r\n (dblclick)=\"doubleClick($event, rowData)\"\r\n [ngClass]=\"{ capitalize: tableCaptalized }\"\r\n >\r\n @for(col of columns; track $index){\r\n <td\r\n [style.position]=\"rowNode.level !== 0 ? 'sticky' : null\"\r\n [style.left.px]=\"\r\n childrenRecoil && rowNode.level !== 0 ? rowNode.level * 30 : null\r\n \"\r\n [style.borderRight]=\"rowNode.level === 0 ? 'none' : ''\"\r\n [style.borderLeft]=\"\r\n rowNode.level === 0 && col.field != config.columns[0].field\r\n ? 'none'\r\n : ''\r\n \"\r\n >\r\n <div class=\"flex flex-row {{ align(col) }}\">\r\n <div\r\n class=\"w-full-h-full flex align-items-center\"\r\n *ngIf=\"$index == 0\"\r\n >\r\n <p-treeTableToggler class=\"hiddenVisible\" [rowNode]=\"rowNode\" />\r\n\r\n @if(config.enableSelect) {\r\n <p-treeTableCheckbox\r\n [disabled]=\"isDisabledCheckbox(rowData, rowNode)\"\r\n (click)=\"activeItemLote(selectedItems)\"\r\n [value]=\"rowNode\"\r\n [ngStyle]=\"{\r\n display: isSelectEnabled(rowData, rowNode) ? 'block' : 'none',\r\n 'margin-left': config.visibleCheckboxFunction\r\n ? '-34px'\r\n : '0px'\r\n }\"\r\n />\r\n }\r\n </div>\r\n <div class=\"flex flex-row align-items-center w-full\">\r\n @if (col.template && validateShowTemplate(rowNode, col)) {\r\n <span class=\"w-full\">\r\n <ng-container\r\n *ngIf=\"getCustomTemplate(col.template.name)\"\r\n [ngTemplateOutlet]=\"getCustomTemplate(col.template.name)\"\r\n [ngTemplateOutletContext]=\"{ $implicit: rowData }\"\r\n >\r\n </ng-container>\r\n </span>\r\n } @else {\r\n <div\r\n class=\"flex flex-row align-items-center {{(col.boolean || col.centralize) && 'justify-content-center'}} gap-2 w-full\"\r\n >\r\n @if(col.tagColor) {\r\n <div\r\n class=\"tag\"\r\n [pTooltip]=\"\r\n col.tooltipTag &&\r\n col.tooltipTag(rowData, col, rowData[col.field])\r\n \"\r\n [style.background-color]=\"\r\n col.tagColor(rowData, col, rowData[col.field])\r\n \"\r\n ></div>\r\n\r\n }\r\n <i\r\n *ngIf=\"col.boolean\"\r\n class=\"pi {{\r\n rowData[col.field] ? 'pi-check text-green-300' : ''\r\n }}\"\r\n style=\"font-size: 1rem; font-weight: 700;\"\r\n ></i>\r\n\r\n <div class=\"flex flex-column\" *ngIf=\"!col.boolean\">\r\n <span class=\"m-0 text-xs\">{{ rowData[col.field] }}</span>\r\n\r\n <p *ngIf=\"col.subtitle\" class=\"m-0 text-xs font-semibold\">\r\n {{ rowData[col.subtitle] }}\r\n </p>\r\n </div>\r\n </div>\r\n }\r\n </div>\r\n </div>\r\n </td>\r\n }\r\n\r\n <td\r\n style=\"border-left: none; text-align: center; width: 0\"\r\n *ngIf=\"(config.actions?.length ?? 0 > 0) || config.actionsPai\"\r\n >\r\n <div\r\n *ngIf=\"\r\n (config.actions?.length ?? 0 > 0) &&\r\n validateActionPosition(rowNode)\r\n \"\r\n >\r\n <span\r\n class=\"material-symbols-outlined cursor-pointer icon-more-horiz\"\r\n style=\"font-size: 20px; padding: 0.1rem\"\r\n (click)=\"menu.toggle($event); activeItem(rowData)\"\r\n >\r\n more_horiz\r\n </span>\r\n\r\n @for(action of config.actions; track $index) {\r\n {{ criarMenusModal(rowData) }}\r\n }\r\n\r\n <p-menu\r\n #menu\r\n [popup]=\"true\"\r\n [model]=\"menuItems\"\r\n appendTo=\"body\"\r\n ></p-menu>\r\n </div>\r\n\r\n @if(config.actionsPai?.length ?? 0 > 0 && rowNode.level == 0){\r\n <div class=\"flex justify-content-end\">\r\n @for (actionPai of config.actionsPai; track $index) { @if\r\n (getOrExecute(actionPai.visible, rowData) ?? true) {\r\n <kv-button\r\n (onClick)=\"activeItem(rowData); actionPai.command($event)\"\r\n [type]=\"'text'\"\r\n [icon]=\"actionPai.icon\"\r\n [severity]=\"actionPai.severity || 'tertiary'\"\r\n />\r\n } }\r\n </div>\r\n }\r\n </td>\r\n </tr>\r\n }\r\n </ng-template>\r\n <ng-template pTemplate=\"emptymessage\">\r\n <tr>\r\n <td\r\n [attr.colspan]=\"config.columns.length + 1\"\r\n style=\"text-align: center\"\r\n class=\"text-sm\"\r\n >\r\n {{ textoEmptyMessage }}\r\n </td>\r\n </tr>\r\n </ng-template>\r\n </p-treeTable>\r\n</div>\r\n", styles: ["@charset \"UTF-8\";::ng-deep .p-treetable .p-treetable-tbody>tr>td{padding:.2rem}::ng-deep .p-treetable .p-treetable-header{padding:0rem}span{font-size:14px}:host ::ng-deep .p-treetable table{table-layout:auto!important}::ng-deep .p-checkbox .p-checkbox-box{width:1.125rem;height:1.125rem}::ng-deep .p-checkbox{display:flex;align-items:center}::ng-deep .p-treetable .p-paginator{scale:.75}.icon-more-horiz{font-weight:700}.icon-more-horiz:hover,.icon-more-horiz:focus{color:#5e5e5e;transition:color .3s,transform .3s;background-color:#eaeaea;border-radius:50%}::ng-deep .p-treetable .p-treetable-thead>tr>th{background-color:#eaeaea;padding:.3rem}:host ::ng-deep .treetabledraggable .p-treetable .p-treetable-tbody>tr>td .p-treetable-toggler{width:1rem;height:1rem}.tag{width:5px;height:20px;border-radius:.25rem}:host ::ng-deep .draggable-cell .drag-icon{visibility:hidden}:host ::ng-deep .draggable-cell:hover .drag-icon{visibility:visible}.cdk-drag-preview{display:flex;align-items:center;justify-content:space-between;border-radius:10px!important}.cdk-drop-list-dragging{cursor:grabbing}:host ::ng-deep .cdk-drop-list-dragging .cdk-drag{transition:transform .25s cubic-bezier(0,0,.2,1)}:host ::ng-deep .cdk-drag-animating{transition:transform .3s cubic-bezier(0,0,.2,1)}::ng-deep svg.p-icon{width:.65rem;height:.65rem}::ng-deep .p-checkbox .p-checkbox-box.p-highlight{border-color:#004172;background:#004172}::ng-deep .p-checkbox .p-checkbox-box.p-highlight:hover{background-color:#002542}::ng-deep .p-checkbox .p-checkbox-box.p-highlight:active{background-color:#002542}::ng-deep .p-checkbox .p-checkbox-box.p-highlight:disabled{background-color:#002542;opacity:.4;cursor:auto}\n"] }]
|
|
2292
2292
|
}], ctorParameters: () => [{ type: i0.ElementRef }], propDecorators: { disableRowNodeSticky: [{
|
|
2293
2293
|
type: Input
|
|
2294
2294
|
}], config: [{
|
|
@@ -4260,158 +4260,39 @@ class ImageCutterService {
|
|
|
4260
4260
|
}
|
|
4261
4261
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.8", ngImport: i0, type: ImageCutterService, decorators: [{
|
|
4262
4262
|
type: Injectable,
|
|
4263
|
-
args: [{
|
|
4264
|
-
providedIn: 'root'
|
|
4265
|
-
}]
|
|
4263
|
+
args: [{ providedIn: 'root' }]
|
|
4266
4264
|
}], ctorParameters: () => [{ type: i1$3.DialogService }] });
|
|
4267
4265
|
class SimpleComponent {
|
|
4268
4266
|
constructor(dynamicDialogRef, dialogService) {
|
|
4269
4267
|
this.dynamicDialogRef = dynamicDialogRef;
|
|
4270
4268
|
this.dialogService = dialogService;
|
|
4271
|
-
|
|
4269
|
+
this.imageChangedEvent = null;
|
|
4270
|
+
this.croppedImage = '';
|
|
4271
|
+
//#region Variáveis de controle
|
|
4272
4272
|
this._variaviesDialog = signal(null);
|
|
4273
|
-
|
|
4274
|
-
this.canvas = signal(null);
|
|
4275
|
-
this.ctx = signal(null);
|
|
4276
|
-
this._Image = signal(new Image());
|
|
4277
|
-
//? Coordenadas iniciais e finais do desenho
|
|
4278
|
-
this.startX = 0;
|
|
4279
|
-
this.startY = 0;
|
|
4280
|
-
//? Fator de escala da imagem e zoom
|
|
4281
|
-
this.scaleFactorReadOnly = computed(() => {
|
|
4282
|
-
return Math.min(this.scaleFactor(), this.scaleFactorInicial() + 5);
|
|
4283
|
-
});
|
|
4284
|
-
this.scaleFactorInicial = signal(null);
|
|
4285
|
-
this.scaleFactor = signal(null);
|
|
4286
|
-
this.scaleFactorModel = 0;
|
|
4287
|
-
this.imageX = 0;
|
|
4288
|
-
this.imageY = 0;
|
|
4289
|
-
//#region Propriedades computadas de tamanho do canvas e da imagem
|
|
4290
|
-
//? Largura e altura do canvas baseado na tamanho da tela
|
|
4291
|
-
this.canvasWidth = computed(() => this.widthTela() * 0.5);
|
|
4292
|
-
this.canvasHeight = computed(() => this.heigthTela() * 0.5);
|
|
4293
|
-
//? Largura e altura da área de corte
|
|
4294
|
-
this.cutWidth = computed(() => {
|
|
4295
|
-
if (this._variaviesDialog()?.indCircle) {
|
|
4296
|
-
return this.radius() * 2;
|
|
4297
|
-
}
|
|
4298
|
-
else {
|
|
4299
|
-
const canvasWidth = this.canvasWidth();
|
|
4300
|
-
const maxWidth = canvasWidth * 0.8;
|
|
4301
|
-
const proportionalHeight = maxWidth * this.proporcaoImagem();
|
|
4302
|
-
return proportionalHeight > this.canvasHeight() * 0.8 ? this.canvasHeight() * 0.8 / this.proporcaoImagem() : maxWidth;
|
|
4303
|
-
}
|
|
4304
|
-
});
|
|
4305
|
-
this.cutHeight = computed(() => {
|
|
4306
|
-
if (this._variaviesDialog()?.indCircle) {
|
|
4307
|
-
return this.radius() * 2;
|
|
4308
|
-
}
|
|
4309
|
-
else {
|
|
4310
|
-
const canvasHeight = this.canvasHeight();
|
|
4311
|
-
const maxHeight = canvasHeight * 0.8;
|
|
4312
|
-
const proportionalWidth = maxHeight / this.proporcaoImagem();
|
|
4313
|
-
return proportionalWidth > this.canvasWidth() * 0.8 ? this.canvasWidth() * 0.8 * this.proporcaoImagem() : maxHeight;
|
|
4314
|
-
}
|
|
4315
|
-
});
|
|
4316
|
-
//? Largura e altura da imagem no canvas (baseado na escala) - tamanho real da imagem
|
|
4317
|
-
this.canvaImageWidth = computed(() => {
|
|
4318
|
-
return this._Image().width * this.scaleFactorReadOnly();
|
|
4319
|
-
});
|
|
4320
|
-
this.canvaImageHeight = computed(() => {
|
|
4321
|
-
return this._Image().height * this.scaleFactorReadOnly();
|
|
4322
|
-
});
|
|
4323
|
-
this.proporcaoImagem = computed(() => {
|
|
4324
|
-
return this._variaviesDialog()?.height / this._variaviesDialog()?.width;
|
|
4325
|
-
});
|
|
4326
|
-
this.radius = computed(() => {
|
|
4327
|
-
const minSize = Math.min(this.canvasHeight() * 0.8, this.canvasWidth() * 0.8);
|
|
4328
|
-
return minSize / 2;
|
|
4329
|
-
});
|
|
4330
|
-
//#endregion
|
|
4331
|
-
// #region Limites de movimentação da imagem
|
|
4332
|
-
//? Limites de movimentação da imagem
|
|
4333
|
-
this.indCircle = computed(() => {
|
|
4334
|
-
return this._variaviesDialog()?.indCircle;
|
|
4335
|
-
});
|
|
4336
|
-
this.xMin = computed(() => {
|
|
4337
|
-
return !this._variaviesDialog()?.indCircle ? (this.canvasWidth() - this.cutWidth()) / 2 : (this.canvasWidth() - (this.radius() * 2)) / 2;
|
|
4338
|
-
});
|
|
4339
|
-
this.yMin = computed(() => {
|
|
4340
|
-
return !this._variaviesDialog()?.indCircle ? (this.canvasHeight() - this.cutHeight()) / 2 : (this.canvasHeight() - (this.radius() * 2)) / 2;
|
|
4341
|
-
});
|
|
4342
|
-
this.xMax = computed(() => {
|
|
4343
|
-
return !this._variaviesDialog()?.indCircle ? -(this.canvaImageWidth() - (this.xMin()) - this.cutWidth()) : -(this.canvaImageWidth() - (this.xMin()) - (this.radius() * 2));
|
|
4344
|
-
});
|
|
4345
|
-
this.yMax = computed(() => {
|
|
4346
|
-
return !this._variaviesDialog()?.indCircle ? -(this.canvaImageHeight() - (this.yMin()) - this.cutHeight()) : -(this.canvaImageHeight() - (this.yMin()) - (this.radius() * 2));
|
|
4347
|
-
});
|
|
4348
|
-
// #endregion
|
|
4349
|
-
//? Proporção da imagem
|
|
4350
|
-
this.widthTela = signal(0);
|
|
4351
|
-
this.heigthTela = signal(0);
|
|
4352
|
-
//#endregion
|
|
4353
|
-
//#region handlers de eventos
|
|
4354
|
-
this.comparadorOnZoomChange = this.scaleFactorInicial();
|
|
4355
|
-
this.atualizaTamanhoTela();
|
|
4356
|
-
}
|
|
4357
|
-
setScaleFactorModel(valor) {
|
|
4358
|
-
this.scaleFactorModel = valor - this.scaleFactorInicial();
|
|
4359
|
-
this.scaleFactor.set(valor);
|
|
4273
|
+
this.aspectRatio = signal(1 / 1);
|
|
4360
4274
|
}
|
|
4361
|
-
|
|
4362
|
-
this.
|
|
4363
|
-
this.updateCanvasSize();
|
|
4364
|
-
this.atualizaCutBorder();
|
|
4275
|
+
fileChangeEvent(event) {
|
|
4276
|
+
this.imageChangedEvent = event;
|
|
4365
4277
|
}
|
|
4366
|
-
|
|
4367
|
-
this.
|
|
4368
|
-
this.heigthTela.set(window.innerHeight);
|
|
4278
|
+
imageCropped(event) {
|
|
4279
|
+
this.croppedImage = event.base64;
|
|
4369
4280
|
}
|
|
4370
|
-
|
|
4281
|
+
imageLoaded(image) { }
|
|
4282
|
+
cropperReady() { }
|
|
4283
|
+
loadImageFailed() { }
|
|
4284
|
+
//#endregion
|
|
4285
|
+
ngAfterContentInit() {
|
|
4371
4286
|
this.recuperarVariaviesDialog();
|
|
4372
|
-
this.
|
|
4373
|
-
this.
|
|
4374
|
-
}
|
|
4375
|
-
inciarReferencias() {
|
|
4376
|
-
this.canvas.set(this.cropCanvas.nativeElement);
|
|
4377
|
-
this.ctx.set(this.canvas().getContext('2d'));
|
|
4378
|
-
this._Image().src = this._variaviesDialog()?.imagem;
|
|
4379
|
-
}
|
|
4380
|
-
iniciarCanvas() {
|
|
4381
|
-
this._Image().onload = () => {
|
|
4382
|
-
//? Define o tamanho do canvas
|
|
4383
|
-
this.canvas().height = this.canvasHeight();
|
|
4384
|
-
this.canvas().width = this.canvasWidth();
|
|
4385
|
-
this.ajustarZommEPosicaoInicial();
|
|
4386
|
-
this.initializeImageMove(this.canvas(), this.ctx(), this._Image());
|
|
4387
|
-
this.initializeMouseWheel(this.canvas(), this.ctx(), this._Image());
|
|
4388
|
-
this.redrawCanvas(this.ctx(), this._Image());
|
|
4389
|
-
};
|
|
4287
|
+
this.recuperaInstanciaDialog();
|
|
4288
|
+
this.setAspectRatio();
|
|
4390
4289
|
}
|
|
4391
|
-
|
|
4392
|
-
const
|
|
4393
|
-
const
|
|
4394
|
-
const
|
|
4395
|
-
const
|
|
4396
|
-
|
|
4397
|
-
if (this._variaviesDialog()?.indCircle) {
|
|
4398
|
-
const scaleFactor = (this.radius() * 2) / Math.min(imageWidth, imageHeight);
|
|
4399
|
-
this.scaleFactorInicial.set(scaleFactor);
|
|
4400
|
-
this.setScaleFactorModel(scaleFactor);
|
|
4401
|
-
}
|
|
4402
|
-
else {
|
|
4403
|
-
const scaleFactor = this.cutHeight() === this.cutWidth()
|
|
4404
|
-
? this._Image().width > this._Image().height
|
|
4405
|
-
? this.cutHeight() / imageHeight
|
|
4406
|
-
: this.cutWidth() / imageWidth
|
|
4407
|
-
: this.cutHeight() > this.cutWidth()
|
|
4408
|
-
? this.cutHeight() / imageHeight
|
|
4409
|
-
: this.cutWidth() / imageWidth;
|
|
4410
|
-
this.scaleFactorInicial.set(scaleFactor);
|
|
4411
|
-
this.setScaleFactorModel(scaleFactor);
|
|
4412
|
-
}
|
|
4413
|
-
this.imageX = Math.max((this.canvas().width - imageWidth * this.scaleFactorReadOnly()) / 2, this.xMin());
|
|
4414
|
-
this.imageY = Math.max((this.canvasHeight() - imageHeight * this.scaleFactorReadOnly()) / 2, this.yMin());
|
|
4290
|
+
setAspectRatio(width = this._variaviesDialog()?.width, height = this._variaviesDialog()?.height) {
|
|
4291
|
+
const gcd = (a, b) => (b === 0 ? a : gcd(b, a % b));
|
|
4292
|
+
const divisor = gcd(width, height);
|
|
4293
|
+
const aspectWidth = width / divisor;
|
|
4294
|
+
const aspectHeight = height / divisor;
|
|
4295
|
+
this.aspectRatio.set(aspectWidth / aspectHeight);
|
|
4415
4296
|
}
|
|
4416
4297
|
//#region Métodos de recuperação de dados
|
|
4417
4298
|
recuperaInstanciaDialog() {
|
|
@@ -4427,273 +4308,13 @@ class SimpleComponent {
|
|
|
4427
4308
|
this._variaviesDialog.set(this.recuperaInstanciaDialog().data.id);
|
|
4428
4309
|
}
|
|
4429
4310
|
//#endregion
|
|
4430
|
-
//#region Métodos de atualizacao do canvas
|
|
4431
|
-
//? Atualiza o tamanho do canvas
|
|
4432
|
-
updateCanvasSize() {
|
|
4433
|
-
this.imageX = (this.canvas().width - this._Image().width * this.scaleFactorReadOnly()) / 2;
|
|
4434
|
-
this.imageY = (this.canvasHeight() / 2) - (this._Image().height * this.scaleFactorReadOnly()) / 2;
|
|
4435
|
-
this.canvas().height = this.canvasHeight();
|
|
4436
|
-
this.canvas().width = this.canvasWidth();
|
|
4437
|
-
this.redrawCanvas(this.ctx(), this._Image());
|
|
4438
|
-
}
|
|
4439
|
-
redrawCanvas(ctx, img) {
|
|
4440
|
-
if (!ctx)
|
|
4441
|
-
return;
|
|
4442
|
-
this.drawCropArea(ctx);
|
|
4443
|
-
ctx.clearRect(0, 0, ctx.canvas.width, ctx.canvas.height);
|
|
4444
|
-
ctx.filter = 'blur(5px) opacity(0.9)';
|
|
4445
|
-
ctx.drawImage(img, this.imageX, this.imageY, img.width * this.scaleFactorReadOnly(), img.height * this.scaleFactorReadOnly());
|
|
4446
|
-
ctx.filter = 'none';
|
|
4447
|
-
this.drawImageInCropArea(ctx, img);
|
|
4448
|
-
}
|
|
4449
|
-
//? Desenha a área de corte
|
|
4450
|
-
drawCropArea(ctx) {
|
|
4451
|
-
if (!ctx)
|
|
4452
|
-
return;
|
|
4453
|
-
this.atualizaCutBorder();
|
|
4454
|
-
const cropX = ctx.canvas.width / 2 - this.cutWidth() / 2;
|
|
4455
|
-
const cropY = ctx.canvas.height / 2 - this.cutHeight() / 2;
|
|
4456
|
-
const cropXCircle = ctx.canvas.width / 2 - this.radius() / 2;
|
|
4457
|
-
const cropYCircle = ctx.canvas.height / 2 - this.radius() / 2;
|
|
4458
|
-
ctx.beginPath();
|
|
4459
|
-
ctx.strokeStyle = 'transparent';
|
|
4460
|
-
ctx.lineWidth = 2;
|
|
4461
|
-
if (this._variaviesDialog()?.indCircle) {
|
|
4462
|
-
ctx.arc(cropXCircle, cropYCircle, this.radius(), 0, Math.PI * 2, true);
|
|
4463
|
-
}
|
|
4464
|
-
else {
|
|
4465
|
-
ctx.rect(cropX, cropY, this.cutWidth(), this.cutHeight());
|
|
4466
|
-
}
|
|
4467
|
-
ctx.stroke();
|
|
4468
|
-
}
|
|
4469
|
-
//? Desenha a imagem na área de corte
|
|
4470
|
-
drawImageInCropArea(ctx, img) {
|
|
4471
|
-
if (!ctx)
|
|
4472
|
-
return;
|
|
4473
|
-
const cropX = (ctx.canvas.width - this.cutWidth()) / 2;
|
|
4474
|
-
const cropY = (ctx.canvas.height - this.cutHeight()) / 2;
|
|
4475
|
-
ctx.save();
|
|
4476
|
-
ctx.beginPath();
|
|
4477
|
-
if (this._variaviesDialog()?.indCircle) {
|
|
4478
|
-
ctx.arc(ctx.canvas.width / 2, ctx.canvas.height / 2, this.radius(), 0, Math.PI * 2, true);
|
|
4479
|
-
}
|
|
4480
|
-
else {
|
|
4481
|
-
ctx.rect(cropX, cropY, this.cutWidth(), this.cutHeight());
|
|
4482
|
-
}
|
|
4483
|
-
ctx.clip();
|
|
4484
|
-
ctx.drawImage(img, this.imageX, this.imageY, img.width * this.scaleFactorReadOnly(), img.height * this.scaleFactorReadOnly());
|
|
4485
|
-
ctx.restore();
|
|
4486
|
-
}
|
|
4487
|
-
atualizaCutBorder() {
|
|
4488
|
-
if (this.cropBorder && this.cropBorder.nativeElement) {
|
|
4489
|
-
const cropBorderElement = this.cropBorder.nativeElement;
|
|
4490
|
-
if (this._variaviesDialog()?.indCircle) {
|
|
4491
|
-
cropBorderElement.style.borderRadius = this.radius() * 2 + 'px';
|
|
4492
|
-
cropBorderElement.style.width = this.radius() * 2 + 'px';
|
|
4493
|
-
cropBorderElement.style.height = this.radius() * 2 + 'px';
|
|
4494
|
-
}
|
|
4495
|
-
else {
|
|
4496
|
-
cropBorderElement.style.width = this.cutWidth() + 'px';
|
|
4497
|
-
cropBorderElement.style.height = this.cutHeight() + 'px';
|
|
4498
|
-
}
|
|
4499
|
-
}
|
|
4500
|
-
}
|
|
4501
|
-
onZoomChange(e) {
|
|
4502
|
-
const prevZoom = this.comparadorOnZoomChange;
|
|
4503
|
-
const zoomValue = e.value;
|
|
4504
|
-
this.comparadorOnZoomChange = e.value;
|
|
4505
|
-
const direction = prevZoom < zoomValue ? 'up' : 'down';
|
|
4506
|
-
this.ajustarZoom(direction, e.value);
|
|
4507
|
-
}
|
|
4508
|
-
initializeMouseWheel(canvas, ctx, img) {
|
|
4509
|
-
canvas.onwheel = (e) => {
|
|
4510
|
-
e.preventDefault();
|
|
4511
|
-
//? Recuperando os valores de zoom e delta atuais
|
|
4512
|
-
const direction = e.deltaY > 0 ? 'down' : 'up';
|
|
4513
|
-
this.ajustarZoom(direction);
|
|
4514
|
-
};
|
|
4515
|
-
}
|
|
4516
|
-
ajustarZoom(direction, value) {
|
|
4517
|
-
const prevScaleFactor = this.scaleFactorReadOnly();
|
|
4518
|
-
const delta = direction == 'down' ? -0.015 : 0.015;
|
|
4519
|
-
let scaleFactor = prevScaleFactor + (delta * 1.4);
|
|
4520
|
-
if (value)
|
|
4521
|
-
scaleFactor = value + this.scaleFactorInicial();
|
|
4522
|
-
const newHeight = this._Image().height * scaleFactor;
|
|
4523
|
-
const newWidth = this._Image().width * scaleFactor;
|
|
4524
|
-
if (this._variaviesDialog()?.indCircle) {
|
|
4525
|
-
if (newHeight < this.radius() * 2 || newWidth < this.radius() * 2) {
|
|
4526
|
-
scaleFactor = prevScaleFactor;
|
|
4527
|
-
}
|
|
4528
|
-
else {
|
|
4529
|
-
this.scaleFactor.set(scaleFactor);
|
|
4530
|
-
this.setScaleFactorModel(scaleFactor);
|
|
4531
|
-
}
|
|
4532
|
-
}
|
|
4533
|
-
else {
|
|
4534
|
-
if (newHeight < this.cutHeight() || newWidth < this.cutWidth()) {
|
|
4535
|
-
scaleFactor = prevScaleFactor;
|
|
4536
|
-
}
|
|
4537
|
-
else {
|
|
4538
|
-
this.scaleFactor.set(scaleFactor);
|
|
4539
|
-
this.setScaleFactorModel(scaleFactor);
|
|
4540
|
-
}
|
|
4541
|
-
}
|
|
4542
|
-
this.scaleFactor.set(scaleFactor);
|
|
4543
|
-
this.setScaleFactorModel(scaleFactor);
|
|
4544
|
-
const canvas = this.cropCanvas.nativeElement;
|
|
4545
|
-
const canvasWidth = canvas.offsetWidth;
|
|
4546
|
-
const canvasHeight = canvas.offsetHeight;
|
|
4547
|
-
const centerX = canvasWidth / 2;
|
|
4548
|
-
const centerY = canvasHeight / 2;
|
|
4549
|
-
const newCanvasX = centerX - (centerX - this.imageX) * (scaleFactor / prevScaleFactor);
|
|
4550
|
-
const newCanvasY = centerY - (centerY - this.imageY) * (scaleFactor / prevScaleFactor);
|
|
4551
|
-
this.imageX = newCanvasX;
|
|
4552
|
-
this.imageY = newCanvasY;
|
|
4553
|
-
if (!this.verificaImagemdentroDosLimiteXmin()) {
|
|
4554
|
-
const diffXmin = this.retornaDiffXmax();
|
|
4555
|
-
this.moveImage(this.imageX - diffXmin);
|
|
4556
|
-
}
|
|
4557
|
-
if (!this.verificaImagemdentroDosLimiteXmax()) {
|
|
4558
|
-
const diffXmax = this.retornaDiffXmin();
|
|
4559
|
-
this.moveImage(this.imageX + diffXmax);
|
|
4560
|
-
}
|
|
4561
|
-
if (!this.verificaImagemdentroDosLimiteYmax()) {
|
|
4562
|
-
const diffYmax = this.retornaDiffYmin();
|
|
4563
|
-
this.moveImage(undefined, this.imageY + diffYmax);
|
|
4564
|
-
}
|
|
4565
|
-
if (!this.verificaImagemdentroDosLimiteYmin()) {
|
|
4566
|
-
const diffYmin = this.retornaDiffYmax();
|
|
4567
|
-
this.moveImage(undefined, this.imageY - diffYmin);
|
|
4568
|
-
}
|
|
4569
|
-
this.redrawCanvas(this.ctx(), this._Image());
|
|
4570
|
-
}
|
|
4571
|
-
verificaImagemdentroDosLimiteXmin() {
|
|
4572
|
-
const newImageX = this.imageX;
|
|
4573
|
-
return newImageX < this.xMin();
|
|
4574
|
-
}
|
|
4575
|
-
verificaImagemdentroDosLimiteXmax() {
|
|
4576
|
-
const newImageX = this.imageX;
|
|
4577
|
-
return newImageX > this.xMax();
|
|
4578
|
-
}
|
|
4579
|
-
verificaImagemdentroDosLimiteYmin() {
|
|
4580
|
-
const newImageY = this.imageY;
|
|
4581
|
-
return newImageY < this.yMin();
|
|
4582
|
-
}
|
|
4583
|
-
verificaImagemdentroDosLimiteYmax() {
|
|
4584
|
-
const newImageY = this.imageY;
|
|
4585
|
-
return newImageY > this.yMax();
|
|
4586
|
-
}
|
|
4587
|
-
retornaDiffXmin() {
|
|
4588
|
-
const newImageX = this.imageX;
|
|
4589
|
-
return this.xMin() - newImageX;
|
|
4590
|
-
}
|
|
4591
|
-
retornaDiffXmax() {
|
|
4592
|
-
const newImageX = this.imageX;
|
|
4593
|
-
return newImageX - this.xMax();
|
|
4594
|
-
}
|
|
4595
|
-
retornaDiffYmin() {
|
|
4596
|
-
const newImageY = this.imageY;
|
|
4597
|
-
return this.yMin() - newImageY;
|
|
4598
|
-
}
|
|
4599
|
-
retornaDiffYmax() {
|
|
4600
|
-
const newImageY = this.imageY;
|
|
4601
|
-
return newImageY - this.yMax();
|
|
4602
|
-
}
|
|
4603
|
-
initializeImageMove(canvas, ctx, img) {
|
|
4604
|
-
let isDragging = false;
|
|
4605
|
-
canvas.style.cursor = 'grab';
|
|
4606
|
-
canvas.onmousedown = (e) => {
|
|
4607
|
-
isDragging = true;
|
|
4608
|
-
canvas.style.cursor = 'grabbing';
|
|
4609
|
-
this.startX = e.offsetX - this.imageX;
|
|
4610
|
-
this.startY = e.offsetY - this.imageY;
|
|
4611
|
-
};
|
|
4612
|
-
canvas.onmouseup = () => {
|
|
4613
|
-
isDragging = false;
|
|
4614
|
-
canvas.style.cursor = 'grab';
|
|
4615
|
-
};
|
|
4616
|
-
canvas.onmouseout = () => {
|
|
4617
|
-
isDragging = false;
|
|
4618
|
-
canvas.style.cursor = 'grab';
|
|
4619
|
-
};
|
|
4620
|
-
canvas.onmousemove = (e) => {
|
|
4621
|
-
if (isDragging) {
|
|
4622
|
-
// Calcula o novo posicionamento da imagem
|
|
4623
|
-
let newImageX = e.offsetX - this.startX;
|
|
4624
|
-
let newImageY = e.offsetY - this.startY;
|
|
4625
|
-
if (newImageX < this.xMin() && newImageX > this.xMax()) {
|
|
4626
|
-
this.moveImage(newImageX);
|
|
4627
|
-
}
|
|
4628
|
-
if (newImageY < this.yMin() && newImageY > this.yMax()) {
|
|
4629
|
-
this.moveImage(undefined, newImageY);
|
|
4630
|
-
}
|
|
4631
|
-
this.redrawCanvas(ctx, img);
|
|
4632
|
-
}
|
|
4633
|
-
};
|
|
4634
|
-
}
|
|
4635
|
-
moveImage(dx, dy) {
|
|
4636
|
-
this.imageX = (dx ?? this.imageX);
|
|
4637
|
-
this.imageY = (dy ?? this.imageY);
|
|
4638
|
-
}
|
|
4639
|
-
//#endregion
|
|
4640
4311
|
//#region Métodos de corte e fechamento do modal
|
|
4641
4312
|
cropImage() {
|
|
4642
|
-
|
|
4643
|
-
|
|
4644
|
-
|
|
4645
|
-
|
|
4646
|
-
|
|
4647
|
-
let imageData;
|
|
4648
|
-
const cropX = (ctx.canvas.width - this.cutWidth()) / 2;
|
|
4649
|
-
const cropY = (ctx.canvas.height - this.cutHeight()) / 2;
|
|
4650
|
-
if (this._variaviesDialog()?.indCircle) {
|
|
4651
|
-
// Create a new canvas with the same dimensions as the circle
|
|
4652
|
-
const circleCanvas = document.createElement('canvas');
|
|
4653
|
-
const circleCtx = circleCanvas.getContext('2d');
|
|
4654
|
-
circleCanvas.width = this.radius() * 2;
|
|
4655
|
-
circleCanvas.height = this.radius() * 2;
|
|
4656
|
-
// Draw the circle on the new canvas
|
|
4657
|
-
circleCtx.beginPath();
|
|
4658
|
-
circleCtx.arc(this.radius(), this.radius(), this.radius(), 0, 2 * Math.PI);
|
|
4659
|
-
circleCtx.fill();
|
|
4660
|
-
// Set the composite operation to 'destination-in' to cut out the circle
|
|
4661
|
-
ctx.globalCompositeOperation = 'destination-in';
|
|
4662
|
-
// Draw the image on the main canvas using the circle as a mask
|
|
4663
|
-
ctx.drawImage(circleCanvas, cropX, cropY);
|
|
4664
|
-
// Reset the composite operation to the default value
|
|
4665
|
-
ctx.globalCompositeOperation = 'source-over';
|
|
4666
|
-
// Get the image data of the cropped circle
|
|
4667
|
-
imageData = ctx.getImageData(cropX, cropY, this.radius() * 2, this.radius() * 2);
|
|
4668
|
-
}
|
|
4669
|
-
else {
|
|
4670
|
-
imageData = ctx.getImageData(cropX, cropY, this.cutWidth(), this.cutHeight());
|
|
4671
|
-
}
|
|
4672
|
-
// Obter os valores de width e height da variável _variaviesDialog
|
|
4673
|
-
const variaveisDialog = this._variaviesDialog();
|
|
4674
|
-
if (variaveisDialog) {
|
|
4675
|
-
const { width, height } = variaveisDialog;
|
|
4676
|
-
// Criar um novo canvas e contexto com os valores de width e height
|
|
4677
|
-
const newCanvas = document.createElement('canvas');
|
|
4678
|
-
const newCtx = newCanvas.getContext('2d');
|
|
4679
|
-
newCanvas.width = width;
|
|
4680
|
-
newCanvas.height = height;
|
|
4681
|
-
if (newCtx) {
|
|
4682
|
-
// Redimensionar a imagem para o tamanho especificado
|
|
4683
|
-
const tempCanvas = document.createElement('canvas');
|
|
4684
|
-
const tempCtx = tempCanvas.getContext('2d');
|
|
4685
|
-
tempCanvas.width = this.cutWidth();
|
|
4686
|
-
tempCanvas.height = this.cutHeight();
|
|
4687
|
-
tempCtx.putImageData(imageData, 0, 0);
|
|
4688
|
-
newCtx.drawImage(tempCanvas, 0, 0, width, height);
|
|
4689
|
-
window.dispatchEvent(new CustomEvent('cropImage', { detail: {
|
|
4690
|
-
result: Promise.resolve(newCanvas.toDataURL()),
|
|
4691
|
-
status: true
|
|
4692
|
-
} }));
|
|
4693
|
-
this.closeCropModal();
|
|
4694
|
-
}
|
|
4695
|
-
}
|
|
4696
|
-
}
|
|
4313
|
+
window.dispatchEvent(new CustomEvent('cropImage', { detail: {
|
|
4314
|
+
result: this.croppedImage,
|
|
4315
|
+
status: true
|
|
4316
|
+
} }));
|
|
4317
|
+
this.closeCropModal();
|
|
4697
4318
|
}
|
|
4698
4319
|
closeCropModal() {
|
|
4699
4320
|
this.dialogInstance.close();
|
|
@@ -4706,75 +4327,75 @@ class SimpleComponent {
|
|
|
4706
4327
|
this.closeCropModal();
|
|
4707
4328
|
}
|
|
4708
4329
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.8", ngImport: i0, type: SimpleComponent, deps: [{ token: i1$3.DynamicDialogRef }, { token: i1$3.DialogService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
4709
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.8", type: SimpleComponent, isStandalone: true, selector: "app-simple-component",
|
|
4330
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.8", type: SimpleComponent, isStandalone: true, selector: "app-simple-component", ngImport: i0, template: `
|
|
4710
4331
|
<div class="modal-content">
|
|
4711
|
-
<div class="crop-container">
|
|
4712
|
-
<canvas #cropCanvas class="crop-canvas"></canvas>
|
|
4713
|
-
<div #cropBorder class="crop-border"></div>
|
|
4714
|
-
</div>
|
|
4715
4332
|
|
|
4716
|
-
|
|
4717
|
-
|
|
4718
|
-
|
|
4719
|
-
|
|
4333
|
+
<image-cropper
|
|
4334
|
+
[imageBase64]="_variaviesDialog()?.imagem"
|
|
4335
|
+
(imageCropped)="imageCropped($event)"
|
|
4336
|
+
[aspectRatio]="aspectRatio()"
|
|
4337
|
+
(imageLoaded)="imageLoaded($event)"
|
|
4338
|
+
(cropperReady)="cropperReady()"
|
|
4339
|
+
(loadImageFailed)="loadImageFailed()"
|
|
4340
|
+
[roundCropper]="this._variaviesDialog()?.indCircle"
|
|
4341
|
+
[maintainAspectRatio]="true"
|
|
4342
|
+
[imageQuality]="100"
|
|
4343
|
+
format="jpeg"
|
|
4344
|
+
output='base64'
|
|
4345
|
+
alignImage="center"
|
|
4346
|
+
/>
|
|
4720
4347
|
|
|
4721
|
-
|
|
4348
|
+
|
|
4349
|
+
</div>
|
|
4350
|
+
<div class="button-container">
|
|
4722
4351
|
<kv-button label="Cancelar" severity="tertiary" icon="close" (click)="cancel()"></kv-button>
|
|
4723
4352
|
<kv-button label="Recortar" severity="primary" icon="crop" (click)="cropImage()" class="ml-2"></kv-button>
|
|
4724
4353
|
</div>
|
|
4725
4354
|
|
|
4726
|
-
</div>
|
|
4727
|
-
|
|
4728
4355
|
|
|
4729
4356
|
|
|
4730
|
-
`, isInline: true, styles: ["img{border-style:solid;border-width:2px;border-radius:50%;object-fit:cover}i{font-size:22px}.botao-alterar-foto{border-style:none;width:max-content;background-color:#002542;color:#000;font-weight:700;cursor:pointer;padding:7px 9px}.botao-alterar-foto i{color:#fff}.botao-excluir-foto{border-style:none;width:max-content;background-color:#002542;color:#000;font-weight:700;cursor:pointer;padding:7px 9px}.botao-excluir-foto i{color:#fff}.btn{position:absolute;top:87%;left:87%;transform:translate(-50%,-50%)}.image-container{display:inline-block;position:relative}.modal-content{position:relative;background-color:#fefefe;margin:1% auto;padding:20px;width:80%;max-width:fit-content;text-align:center;border-radius:12px}.crop-container{display:flex;justify-content:center;align-items:center}.crop-canvas{border:1px solid #d1d5db;border-radius:12px;width:100%;height:auto}.crop-border{position:absolute;border:2px dashed #9ca3af;pointer-events:none}.zoom-container{padding-top:20px;padding-bottom:20px}.button-container{display:flex;align-items:center;justify-content:flex-end;flex-direction:row;margin-top:24px}\n"], dependencies: [{ kind: "ngmodule", type:
|
|
4357
|
+
`, isInline: true, styles: ["img{border-style:solid;border-width:2px;border-radius:50%;object-fit:cover}i{font-size:22px}.botao-alterar-foto{border-style:none;width:max-content;background-color:#002542;color:#000;font-weight:700;cursor:pointer;padding:7px 9px}.botao-alterar-foto i{color:#fff}.botao-excluir-foto{border-style:none;width:max-content;background-color:#002542;color:#000;font-weight:700;cursor:pointer;padding:7px 9px}.botao-excluir-foto i{color:#fff}.btn{position:absolute;top:87%;left:87%;transform:translate(-50%,-50%)}.image-container{display:inline-block;position:relative}.modal-content{height:60vh;position:relative;background-color:#fefefe;margin:1% auto;padding:20px;width:80%;max-width:fit-content;text-align:center;border-radius:12px;display:flex;align-items:center;justify-content:center}.crop-container{display:flex;justify-content:center;align-items:center}.crop-canvas{border:1px solid #d1d5db;border-radius:12px;width:100%;height:auto}.crop-border{position:absolute;border:2px dashed #9ca3af;pointer-events:none}.zoom-container{padding-top:20px;padding-bottom:20px}.button-container{display:flex;align-items:center;justify-content:flex-end;flex-direction:row;margin-top:24px;position:fixed;bottom:0;background:#fff;width:90%;padding:15px}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: DialogModule }, { kind: "ngmodule", type: KvModalModule }, { kind: "ngmodule", type: FormsModule }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "ngmodule", type: KvButtonModule }, { kind: "component", type: KvButtonComponent, selector: "kv-button", inputs: ["fullWidth", "type", "loading", "severity", "size", "icon", "label", "disabled"], outputs: ["onClick"] }, { kind: "ngmodule", type: KvLabelModule }, { kind: "component", type: ImageCropperComponent, selector: "image-cropper", inputs: ["imageChangedEvent", "imageURL", "imageBase64", "imageFile", "imageAltText", "options", "cropperFrameAriaLabel", "output", "format", "autoCrop", "cropper", "transform", "maintainAspectRatio", "aspectRatio", "resetCropOnAspectRatioChange", "resizeToWidth", "resizeToHeight", "cropperMinWidth", "cropperMinHeight", "cropperMaxHeight", "cropperMaxWidth", "cropperStaticWidth", "cropperStaticHeight", "canvasRotation", "initialStepSize", "roundCropper", "onlyScaleDown", "imageQuality", "backgroundColor", "containWithinAspectRatio", "hideResizeSquares", "allowMoveImage", "checkImageType", "alignImage", "disabled", "hidden"], outputs: ["imageCropped", "startCropImage", "imageLoaded", "cropperReady", "loadImageFailed", "transformChange", "cropperChange"] }] }); }
|
|
4731
4358
|
}
|
|
4732
4359
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.8", ngImport: i0, type: SimpleComponent, decorators: [{
|
|
4733
4360
|
type: Component,
|
|
4734
4361
|
args: [{ selector: 'app-simple-component', template: `
|
|
4735
4362
|
<div class="modal-content">
|
|
4736
|
-
<div class="crop-container">
|
|
4737
|
-
<canvas #cropCanvas class="crop-canvas"></canvas>
|
|
4738
|
-
<div #cropBorder class="crop-border"></div>
|
|
4739
|
-
</div>
|
|
4740
4363
|
|
|
4741
|
-
|
|
4742
|
-
|
|
4743
|
-
|
|
4744
|
-
|
|
4364
|
+
<image-cropper
|
|
4365
|
+
[imageBase64]="_variaviesDialog()?.imagem"
|
|
4366
|
+
(imageCropped)="imageCropped($event)"
|
|
4367
|
+
[aspectRatio]="aspectRatio()"
|
|
4368
|
+
(imageLoaded)="imageLoaded($event)"
|
|
4369
|
+
(cropperReady)="cropperReady()"
|
|
4370
|
+
(loadImageFailed)="loadImageFailed()"
|
|
4371
|
+
[roundCropper]="this._variaviesDialog()?.indCircle"
|
|
4372
|
+
[maintainAspectRatio]="true"
|
|
4373
|
+
[imageQuality]="100"
|
|
4374
|
+
format="jpeg"
|
|
4375
|
+
output='base64'
|
|
4376
|
+
alignImage="center"
|
|
4377
|
+
/>
|
|
4745
4378
|
|
|
4746
|
-
|
|
4379
|
+
|
|
4380
|
+
</div>
|
|
4381
|
+
<div class="button-container">
|
|
4747
4382
|
<kv-button label="Cancelar" severity="tertiary" icon="close" (click)="cancel()"></kv-button>
|
|
4748
4383
|
<kv-button label="Recortar" severity="primary" icon="crop" (click)="cropImage()" class="ml-2"></kv-button>
|
|
4749
4384
|
</div>
|
|
4750
4385
|
|
|
4751
|
-
</div>
|
|
4752
|
-
|
|
4753
4386
|
|
|
4754
4387
|
|
|
4755
4388
|
`, standalone: true, imports: [
|
|
4389
|
+
CommonModule,
|
|
4756
4390
|
DialogModule,
|
|
4757
4391
|
KvModalModule,
|
|
4758
|
-
SliderModule,
|
|
4759
|
-
CommonModule,
|
|
4760
|
-
ButtonModule,
|
|
4761
|
-
FileUploadModule,
|
|
4762
|
-
SliderModule,
|
|
4763
4392
|
FormsModule,
|
|
4764
4393
|
ReactiveFormsModule,
|
|
4765
4394
|
KvButtonModule,
|
|
4766
4395
|
KvLabelModule,
|
|
4767
|
-
|
|
4768
|
-
|
|
4769
|
-
|
|
4770
|
-
args: ['cropCanvas']
|
|
4771
|
-
}], cropBorder: [{
|
|
4772
|
-
type: ViewChild,
|
|
4773
|
-
args: ['cropBorder']
|
|
4774
|
-
}], onWindowResize: [{
|
|
4775
|
-
type: HostListener,
|
|
4776
|
-
args: ['window:resize', ['$event']]
|
|
4777
|
-
}] } });
|
|
4396
|
+
ImageCropperComponent
|
|
4397
|
+
], styles: ["img{border-style:solid;border-width:2px;border-radius:50%;object-fit:cover}i{font-size:22px}.botao-alterar-foto{border-style:none;width:max-content;background-color:#002542;color:#000;font-weight:700;cursor:pointer;padding:7px 9px}.botao-alterar-foto i{color:#fff}.botao-excluir-foto{border-style:none;width:max-content;background-color:#002542;color:#000;font-weight:700;cursor:pointer;padding:7px 9px}.botao-excluir-foto i{color:#fff}.btn{position:absolute;top:87%;left:87%;transform:translate(-50%,-50%)}.image-container{display:inline-block;position:relative}.modal-content{height:60vh;position:relative;background-color:#fefefe;margin:1% auto;padding:20px;width:80%;max-width:fit-content;text-align:center;border-radius:12px;display:flex;align-items:center;justify-content:center}.crop-container{display:flex;justify-content:center;align-items:center}.crop-canvas{border:1px solid #d1d5db;border-radius:12px;width:100%;height:auto}.crop-border{position:absolute;border:2px dashed #9ca3af;pointer-events:none}.zoom-container{padding-top:20px;padding-bottom:20px}.button-container{display:flex;align-items:center;justify-content:flex-end;flex-direction:row;margin-top:24px;position:fixed;bottom:0;background:#fff;width:90%;padding:15px}\n"] }]
|
|
4398
|
+
}], ctorParameters: () => [{ type: i1$3.DynamicDialogRef }, { type: i1$3.DialogService }] });
|
|
4778
4399
|
|
|
4779
4400
|
class KvAvatarComponent {
|
|
4780
4401
|
constructor(imageService, notificationService, imageCutterService) {
|
|
@@ -5070,7 +4691,7 @@ class KvCarouselComponent {
|
|
|
5070
4691
|
window.open(link, '_blank');
|
|
5071
4692
|
}
|
|
5072
4693
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.8", ngImport: i0, type: KvCarouselComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
5073
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "17.3.8", type: KvCarouselComponent, selector: "kv-carousel", inputs: { heightCarousel: { classPropertyName: "heightCarousel", publicName: "heightCarousel", isSignal: true, isRequired: false, transformFunction: null }, carouselData: { classPropertyName: "carouselData", publicName: "carouselData", isSignal: false, isRequired: false, transformFunction: null }, autoplayInterval: { classPropertyName: "autoplayInterval", publicName: "autoplayInterval", isSignal: false, isRequired: false, transformFunction: null } }, viewQueries: [{ propertyName: "carouselContainer", first: true, predicate: Carousel, descendants: true, isSignal: true }], ngImport: i0, template: "<p-carousel\r\n [value]=\"carouselData\"\r\n [indicatorStyleClass]=\"'carousel-indicator'\"\r\n [autoplayInterval]=\"autoplayInterval\"\r\n [showIndicators]=\"true\"\r\n [showNavigators]=\"false\"\r\n [numVisible]=\"1\"\r\n [numScroll]=\"1\"\r\n [circular]=\"true\"\r\n styleClass=\"h-full\"\r\n>\r\n >\r\n <ng-template\r\n pTemplate=\"item\"\r\n let-banner\r\n class=\"justify-content-center align-items-center\"\r\n >\r\n <img\r\n [src]=\"banner.img\"\r\n class=\"w-full border-round-banner\"\r\n [style.height.px]=\"heightComputed()\"\r\n (click)=\"navigateToLink(banner.link)\"\r\n />\r\n </ng-template>\r\n</p-carousel>\r\n", styles: ["::ng-deep .p-carousel-indicators{position:absolute;left:50%;transform:translate(-50%);bottom:-1rem}::ng-deep .carousel-indicator{width:15px!important;height:4px!important;margin:-3px!important;padding:0!important;background-color:#eeeeeed0}::ng-deep .carousel-indicator:hover{background-color:#efefef}button.p-carousel-indicator.p-link{background-color:#f0f8ff!important}::ng-deep .p-carousel .p-carousel-content{overflow:hidden!important;position:relative}::ng-deep .border-round-banner{border-radius:20px!important;max-height:500px}\n"], dependencies: [{ kind: "directive", type: i1$2.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { kind: "component", type: i2$
|
|
4694
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "17.3.8", type: KvCarouselComponent, selector: "kv-carousel", inputs: { heightCarousel: { classPropertyName: "heightCarousel", publicName: "heightCarousel", isSignal: true, isRequired: false, transformFunction: null }, carouselData: { classPropertyName: "carouselData", publicName: "carouselData", isSignal: false, isRequired: false, transformFunction: null }, autoplayInterval: { classPropertyName: "autoplayInterval", publicName: "autoplayInterval", isSignal: false, isRequired: false, transformFunction: null } }, viewQueries: [{ propertyName: "carouselContainer", first: true, predicate: Carousel, descendants: true, isSignal: true }], ngImport: i0, template: "<p-carousel\r\n [value]=\"carouselData\"\r\n [indicatorStyleClass]=\"'carousel-indicator'\"\r\n [autoplayInterval]=\"autoplayInterval\"\r\n [showIndicators]=\"true\"\r\n [showNavigators]=\"false\"\r\n [numVisible]=\"1\"\r\n [numScroll]=\"1\"\r\n [circular]=\"true\"\r\n styleClass=\"h-full\"\r\n>\r\n >\r\n <ng-template\r\n pTemplate=\"item\"\r\n let-banner\r\n class=\"justify-content-center align-items-center\"\r\n >\r\n <img\r\n [src]=\"banner.img\"\r\n class=\"w-full border-round-banner\"\r\n [style.height.px]=\"heightComputed()\"\r\n (click)=\"navigateToLink(banner.link)\"\r\n />\r\n </ng-template>\r\n</p-carousel>\r\n", styles: ["::ng-deep .p-carousel-indicators{position:absolute;left:50%;transform:translate(-50%);bottom:-1rem}::ng-deep .carousel-indicator{width:15px!important;height:4px!important;margin:-3px!important;padding:0!important;background-color:#eeeeeed0}::ng-deep .carousel-indicator:hover{background-color:#efefef}button.p-carousel-indicator.p-link{background-color:#f0f8ff!important}::ng-deep .p-carousel .p-carousel-content{overflow:hidden!important;position:relative}::ng-deep .border-round-banner{border-radius:20px!important;max-height:500px}\n"], dependencies: [{ kind: "directive", type: i1$2.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { kind: "component", type: i2$2.Carousel, selector: "p-carousel", inputs: ["page", "numVisible", "numScroll", "responsiveOptions", "orientation", "verticalViewPortHeight", "contentClass", "indicatorsContentClass", "indicatorsContentStyle", "indicatorStyleClass", "indicatorStyle", "value", "circular", "showIndicators", "showNavigators", "autoplayInterval", "style", "styleClass"], outputs: ["onPage"] }] }); }
|
|
5074
4695
|
}
|
|
5075
4696
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.8", ngImport: i0, type: KvCarouselComponent, decorators: [{
|
|
5076
4697
|
type: Component,
|
|
@@ -5748,7 +5369,7 @@ class KvSelectButtonComponent {
|
|
|
5748
5369
|
this.optionClick.emit(event);
|
|
5749
5370
|
}
|
|
5750
5371
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.8", ngImport: i0, type: KvSelectButtonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
5751
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.3.8", type: KvSelectButtonComponent, selector: "kv-select-button", inputs: { formGroup: "formGroup", formControlName: "formControlName", options: "options", optionLabel: "optionLabel", optionValue: "optionValue", mutiple: "mutiple", disabled: "disabled", value: "value" }, outputs: { onSelectionChange: "onSelectionChange", optionClick: "optionClick" }, ngImport: i0, template: "@if(value) {\r\n<p-selectButton\r\n [options]=\"options\"\r\n [optionLabel]=\"optionLabel\"\r\n [optionValue]=\"optionValue\"\r\n (onChange)=\"selectionChange($event)\"\r\n (onOptionClick)=\"onOptionClick($event)\"\r\n [multiple]=\"mutiple\"\r\n [disabled]=\"disabled\"\r\n [(ngModel)]=\"value\"\r\n/>\r\n} @else {\r\n<div [formGroup]=\"formGroup\">\r\n <p-selectButton\r\n [options]=\"options\"\r\n [optionLabel]=\"optionLabel\"\r\n [optionValue]=\"optionValue\"\r\n (onChange)=\"selectionChange($event)\"\r\n (onOptionClick)=\"onOptionClick($event)\"\r\n [multiple]=\"mutiple\"\r\n [disabled]=\"disabled\"\r\n [formControlName]=\"formControlName\"\r\n [(ngModel)]=\"value\"\r\n />\r\n</div>\r\n}", styles: [":host ::ng-deep .p-selectbutton .p-button.p-highlight{background:#183462!important;border:#183462;box-shadow:0 4px 10px #00000008,0 0 2px #0000000f,0 2px 6px #0000001f}\n"], dependencies: [{ kind: "directive", type: i2$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i2$
|
|
5372
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.3.8", type: KvSelectButtonComponent, selector: "kv-select-button", inputs: { formGroup: "formGroup", formControlName: "formControlName", options: "options", optionLabel: "optionLabel", optionValue: "optionValue", mutiple: "mutiple", disabled: "disabled", value: "value" }, outputs: { onSelectionChange: "onSelectionChange", optionClick: "optionClick" }, ngImport: i0, template: "@if(value) {\r\n<p-selectButton\r\n [options]=\"options\"\r\n [optionLabel]=\"optionLabel\"\r\n [optionValue]=\"optionValue\"\r\n (onChange)=\"selectionChange($event)\"\r\n (onOptionClick)=\"onOptionClick($event)\"\r\n [multiple]=\"mutiple\"\r\n [disabled]=\"disabled\"\r\n [(ngModel)]=\"value\"\r\n/>\r\n} @else {\r\n<div [formGroup]=\"formGroup\">\r\n <p-selectButton\r\n [options]=\"options\"\r\n [optionLabel]=\"optionLabel\"\r\n [optionValue]=\"optionValue\"\r\n (onChange)=\"selectionChange($event)\"\r\n (onOptionClick)=\"onOptionClick($event)\"\r\n [multiple]=\"mutiple\"\r\n [disabled]=\"disabled\"\r\n [formControlName]=\"formControlName\"\r\n [(ngModel)]=\"value\"\r\n />\r\n</div>\r\n}", styles: [":host ::ng-deep .p-selectbutton .p-button.p-highlight{background:#183462!important;border:#183462;box-shadow:0 4px 10px #00000008,0 0 2px #0000000f,0 2px 6px #0000001f}\n"], dependencies: [{ kind: "directive", type: i2$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i2$3.SelectButton, selector: "p-selectButton", inputs: ["options", "optionLabel", "optionValue", "optionDisabled", "unselectable", "tabindex", "multiple", "allowEmpty", "style", "styleClass", "ariaLabelledBy", "disabled", "dataKey", "autofocus"], outputs: ["onOptionClick", "onChange"] }, { kind: "directive", type: i2$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i2$1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }] }); }
|
|
5752
5373
|
}
|
|
5753
5374
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.8", ngImport: i0, type: KvSelectButtonComponent, decorators: [{
|
|
5754
5375
|
type: Component,
|
|
@@ -8966,7 +8587,7 @@ class KvFilterFieldsetComponent {
|
|
|
8966
8587
|
this.collapsedEvent.emit(this.isCollapsed);
|
|
8967
8588
|
}
|
|
8968
8589
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.8", ngImport: i0, type: KvFilterFieldsetComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
8969
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.3.8", type: KvFilterFieldsetComponent, selector: "kv-filter-fieldset", inputs: { isExpandable: "isExpandable" }, outputs: { collapsedEvent: "collapsedEvent" }, ngImport: i0, template: "<p-fieldset styleClass=\"p-0 mb-2\">\r\n <ng-template pTemplate=\"header\">\r\n @if(isExpandable) {\r\n <div\r\n class=\"flex flex-row align-items-center justify-content-center {{\r\n isExpandable && 'cursor-pointer'\r\n }}\"\r\n (click)=\"toggleField()\"\r\n >\r\n <span\r\n class=\"material-symbols-outlined flex align-items-center justify-content-center mr-1\"\r\n style=\"font-size: 1.2rem\"\r\n >\r\n {{ isCollapsed ? \"remove\" : \"add\" }}\r\n </span>\r\n\r\n <span class=\"text-xs\"> Filtros </span>\r\n </div>\r\n } @if(!isExpandable) {\r\n <span class=\"text-xs\"> Filtros </span>\r\n }\r\n </ng-template>\r\n\r\n <ng-content></ng-content>\r\n</p-fieldset>\r\n", styles: ["::ng-deep .p-fieldset .p-fieldset-legend{padding:.1rem .1rem 0rem!important;margin-left:1rem}::ng-deep .p-fieldset .p-fieldset-legend{background-color:#fff;border:none}::ng-deep .p-fieldset .p-fieldset-legend:hover{background-color:#f5f5f5}::ng-deep .p-fieldset .p-fieldset-legend:active{background-color:#e0e0e0}::ng-deep .p-fieldset .p-fieldset-content{padding:0 .5rem .5rem}\n"], dependencies: [{ kind: "directive", type: i1$2.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { kind: "component", type: i2$
|
|
8590
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.3.8", type: KvFilterFieldsetComponent, selector: "kv-filter-fieldset", inputs: { isExpandable: "isExpandable" }, outputs: { collapsedEvent: "collapsedEvent" }, ngImport: i0, template: "<p-fieldset styleClass=\"p-0 mb-2\">\r\n <ng-template pTemplate=\"header\">\r\n @if(isExpandable) {\r\n <div\r\n class=\"flex flex-row align-items-center justify-content-center {{\r\n isExpandable && 'cursor-pointer'\r\n }}\"\r\n (click)=\"toggleField()\"\r\n >\r\n <span\r\n class=\"material-symbols-outlined flex align-items-center justify-content-center mr-1\"\r\n style=\"font-size: 1.2rem\"\r\n >\r\n {{ isCollapsed ? \"remove\" : \"add\" }}\r\n </span>\r\n\r\n <span class=\"text-xs\"> Filtros </span>\r\n </div>\r\n } @if(!isExpandable) {\r\n <span class=\"text-xs\"> Filtros </span>\r\n }\r\n </ng-template>\r\n\r\n <ng-content></ng-content>\r\n</p-fieldset>\r\n", styles: ["::ng-deep .p-fieldset .p-fieldset-legend{padding:.1rem .1rem 0rem!important;margin-left:1rem}::ng-deep .p-fieldset .p-fieldset-legend{background-color:#fff;border:none}::ng-deep .p-fieldset .p-fieldset-legend:hover{background-color:#f5f5f5}::ng-deep .p-fieldset .p-fieldset-legend:active{background-color:#e0e0e0}::ng-deep .p-fieldset .p-fieldset-content{padding:0 .5rem .5rem}\n"], dependencies: [{ kind: "directive", type: i1$2.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { kind: "component", type: i2$4.Fieldset, selector: "p-fieldset", inputs: ["legend", "toggleable", "collapsed", "style", "styleClass", "transitionOptions"], outputs: ["collapsedChange", "onBeforeToggle", "onAfterToggle"] }] }); }
|
|
8970
8591
|
}
|
|
8971
8592
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.8", ngImport: i0, type: KvFilterFieldsetComponent, decorators: [{
|
|
8972
8593
|
type: Component,
|