lib-portal-angular 0.0.36 → 0.0.37
Sign up to get free protection for your applications and to get access to all the features.
- package/esm2022/lib/components/tables/data-paginate.service.mjs +37 -0
- package/esm2022/lib/components/tables/data-table.component.mjs +43 -26
- package/esm2022/lib/lib-portal-angular.module.mjs +6 -3
- package/esm2022/public-api.mjs +2 -1
- package/fesm2022/lib-portal-angular.mjs +82 -29
- package/fesm2022/lib-portal-angular.mjs.map +1 -1
- package/lib/components/tables/data-paginate.service.d.ts +21 -0
- package/lib/components/tables/data-table.component.d.ts +10 -8
- package/package.json +1 -1
- package/public-api.d.ts +1 -0
@@ -6,9 +6,12 @@ import * as i2 from '@angular/forms';
|
|
6
6
|
import { NG_VALUE_ACCESSOR, FormsModule, ReactiveFormsModule } from '@angular/forms';
|
7
7
|
import hljs from 'highlight.js';
|
8
8
|
import * as i1$1 from '@ng-bootstrap/ng-bootstrap';
|
9
|
-
import { of, Subject } from 'rxjs';
|
9
|
+
import { of, Observable, Subject } from 'rxjs';
|
10
10
|
import * as i3 from '@ng-select/ng-select';
|
11
11
|
import { NgSelectModule } from '@ng-select/ng-select';
|
12
|
+
import * as i1$2 from '@angular/common/http';
|
13
|
+
import { HttpParams } from '@angular/common/http';
|
14
|
+
import { map } from 'rxjs/operators';
|
12
15
|
|
13
16
|
class AlertComponent {
|
14
17
|
constructor() {
|
@@ -1390,7 +1393,7 @@ class DataTableComponent {
|
|
1390
1393
|
constructor(cdr) {
|
1391
1394
|
this.cdr = cdr;
|
1392
1395
|
this.columns = [];
|
1393
|
-
this.
|
1396
|
+
this.hiddenColumns = []; // Novo input para colunas escondidas
|
1394
1397
|
this.itemsPerPageOptions = [5, 10, 15, 20];
|
1395
1398
|
this.defaultItemsPerPage = 10;
|
1396
1399
|
this.itemsPerPageLabel = 'Items per page:';
|
@@ -1404,15 +1407,15 @@ class DataTableComponent {
|
|
1404
1407
|
this.tableFontColor = '#000';
|
1405
1408
|
this.tableFontSize = '14px';
|
1406
1409
|
this.fetchDataFunction = () => {
|
1407
|
-
return
|
1408
|
-
};
|
1410
|
+
return new Observable(subscriber => subscriber.error('Implement the fetchDataFunction to fetch paginated data from the back-end.'));
|
1411
|
+
};
|
1409
1412
|
this.editPermissions = [];
|
1410
1413
|
this.deletePermissions = [];
|
1411
1414
|
this.viewPermissions = [];
|
1412
1415
|
this.userPermissions = [];
|
1413
|
-
this.showPageInfo = true;
|
1414
|
-
this.pageText = 'Page';
|
1415
|
-
this.ofText = 'of';
|
1416
|
+
this.showPageInfo = true;
|
1417
|
+
this.pageText = 'Page';
|
1418
|
+
this.ofText = 'of';
|
1416
1419
|
this.sortChange = new EventEmitter();
|
1417
1420
|
this.pageChange = new EventEmitter();
|
1418
1421
|
this.itemsPerPageChange = new EventEmitter();
|
@@ -1420,6 +1423,8 @@ class DataTableComponent {
|
|
1420
1423
|
this.onDeleteTable = new EventEmitter();
|
1421
1424
|
this.onViewTable = new EventEmitter();
|
1422
1425
|
this.currentPage = 1;
|
1426
|
+
this.sortColumn = '';
|
1427
|
+
this.sortDirection = 'asc';
|
1423
1428
|
this.pagedData = [];
|
1424
1429
|
this.isLoading = false;
|
1425
1430
|
this.labelStyle = {
|
@@ -1433,7 +1438,7 @@ class DataTableComponent {
|
|
1433
1438
|
this.setDefaultPermissions();
|
1434
1439
|
}
|
1435
1440
|
ngOnChanges(changes) {
|
1436
|
-
if (changes['totalItems'] || changes['defaultItemsPerPage'] || changes['currentPage'] || changes['
|
1441
|
+
if (changes['totalItems'] || changes['defaultItemsPerPage'] || changes['currentPage'] || changes['fetchDataFunction']) {
|
1437
1442
|
this.fetchData();
|
1438
1443
|
}
|
1439
1444
|
}
|
@@ -1442,33 +1447,44 @@ class DataTableComponent {
|
|
1442
1447
|
this.userPermissions = ['edit', 'delete', 'view'];
|
1443
1448
|
}
|
1444
1449
|
}
|
1445
|
-
|
1450
|
+
fetchData() {
|
1446
1451
|
if (this.fetchDataFunction) {
|
1447
1452
|
this.isLoading = true;
|
1448
|
-
|
1449
|
-
|
1450
|
-
this.
|
1451
|
-
this.
|
1452
|
-
|
1453
|
-
|
1454
|
-
|
1455
|
-
|
1456
|
-
|
1453
|
+
const params = {
|
1454
|
+
descricao: '',
|
1455
|
+
pageNumber: this.currentPage,
|
1456
|
+
pageSize: this.defaultItemsPerPage,
|
1457
|
+
sortColumn: this.sortColumn,
|
1458
|
+
sortDirection: this.sortDirection
|
1459
|
+
};
|
1460
|
+
this.fetchDataFunction(params).subscribe({
|
1461
|
+
next: (result) => {
|
1462
|
+
this.pagedData = result.items;
|
1463
|
+
this.totalItems = result.totalItems;
|
1464
|
+
this.isLoading = false;
|
1465
|
+
this.cdr.markForCheck();
|
1466
|
+
},
|
1467
|
+
error: (error) => {
|
1468
|
+
console.error('Error fetching data:', error);
|
1469
|
+
this.isLoading = false;
|
1470
|
+
}
|
1471
|
+
});
|
1457
1472
|
}
|
1458
1473
|
}
|
1459
1474
|
onSort(column) {
|
1460
|
-
this.
|
1475
|
+
this.sortColumn = column;
|
1476
|
+
this.sortDirection = this.sortDirection === 'asc' ? 'desc' : 'asc';
|
1477
|
+
this.sortChange.emit({ column, direction: this.sortDirection });
|
1478
|
+
this.fetchData();
|
1461
1479
|
}
|
1462
1480
|
onPageChange(page) {
|
1463
1481
|
this.currentPage = page;
|
1464
1482
|
this.pageChange.emit(page);
|
1465
1483
|
this.fetchData();
|
1466
1484
|
}
|
1467
|
-
onItemsPerPageChange(
|
1468
|
-
const itemsPerPage = parseInt(event, 10);
|
1469
|
-
this.defaultItemsPerPage = itemsPerPage;
|
1485
|
+
onItemsPerPageChange() {
|
1470
1486
|
this.currentPage = 1;
|
1471
|
-
this.itemsPerPageChange.emit(
|
1487
|
+
this.itemsPerPageChange.emit(this.defaultItemsPerPage);
|
1472
1488
|
this.fetchData();
|
1473
1489
|
}
|
1474
1490
|
handleAction(action, item, index) {
|
@@ -1490,15 +1506,18 @@ class DataTableComponent {
|
|
1490
1506
|
}
|
1491
1507
|
return requiredPermissions.every(permission => this.userPermissions.includes(permission));
|
1492
1508
|
}
|
1509
|
+
isColumnHidden(columnProp) {
|
1510
|
+
return this.hiddenColumns.includes(columnProp);
|
1511
|
+
}
|
1493
1512
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DataTableComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component }); }
|
1494
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: DataTableComponent, selector: "sim-data-table", inputs: { columns: "columns", data: "data", itemsPerPageOptions: "itemsPerPageOptions", defaultItemsPerPage: "defaultItemsPerPage", itemsPerPageLabel: "itemsPerPageLabel", marginTop: "marginTop", marginBottom: "marginBottom", marginLeft: "marginLeft", marginRight: "marginRight", showActionColumn: "showActionColumn", actionColumnLabel: "actionColumnLabel", totalItems: "totalItems", tableFontColor: "tableFontColor", tableFontSize: "tableFontSize", fetchDataFunction: "fetchDataFunction", editPermissions: "editPermissions", deletePermissions: "deletePermissions", viewPermissions: "viewPermissions", userPermissions: "userPermissions", showPageInfo: "showPageInfo", pageText: "pageText", ofText: "ofText" }, outputs: { sortChange: "sortChange", pageChange: "pageChange", itemsPerPageChange: "itemsPerPageChange", onEditTable: "onEditTable", onDeleteTable: "onDeleteTable", onViewTable: "onViewTable" }, usesOnChanges: true, ngImport: i0, template: "<div class=\"form-group\" [ngStyle]=\"{\n 'margin-top': marginTop + 'rem',\n 'margin-bottom': marginBottom + 'rem',\n 'margin-left': marginLeft + 'rem',\n 'margin-right': marginRight + 'rem'\n}\" style=\"text-align: right;\">\n <label for=\"itemsPerPageSelect\" style=\"margin-right: 0.5rem; margin-bottom: 0.7rem;\" [ngStyle]=\"labelStyle\">{{ itemsPerPageLabel }}</label>\n <select\n id=\"itemsPerPageSelect\"\n class=\"form-control form-control-sm d-inline-block w-auto\"\n [(ngModel)]=\"defaultItemsPerPage\"\n (ngModelChange)=\"onItemsPerPageChange($event)\">\n <option *ngFor=\"let option of itemsPerPageOptions\" [value]=\"option\">{{ option }}</option>\n </select>\n</div>\n\n<div class=\"table-responsive\">\n <table class=\"table table-hover\" [ngStyle]=\"{ 'color': tableFontColor, 'font-size': tableFontSize }\">\n <thead>\n <tr>\n <ng-container *ngFor=\"let column of columns\">\n <th *ngIf=\"hasPermission(column.permissions || [])\" (click)=\"onSort(column.prop)\">\n {{ column.label }}\n </th>\n </ng-container>\n <th *ngIf=\"showActionColumn\">{{ actionColumnLabel }}</th>\n </tr>\n </thead>\n <tbody>\n <tr *ngFor=\"let item of pagedData; let i = index\">\n <ng-container *ngFor=\"let column of columns\">\n <td *ngIf=\"hasPermission(column.permissions || [])\">\n {{ item[column.prop] }}\n </td>\n </ng-container>\n <td *ngIf=\"showActionColumn\">\n <div class=\"d-flex justify-content-center\">\n <div *ngIf=\"hasPermission(editPermissions)\" (click)=\"handleAction('edit', item, i)\" class=\"btn-icon edit mx-1\"></div>\n <div *ngIf=\"hasPermission(deletePermissions)\" (click)=\"handleAction('delete', item, i)\" class=\"btn-icon delete mx-1\"></div>\n <div *ngIf=\"hasPermission(viewPermissions)\" (click)=\"handleAction('view', item, i)\" class=\"btn-icon view mx-1\"></div>\n </div>\n </td>\n </tr>\n </tbody>\n </table>\n</div>\n\n<div class=\"text-center pagination-controls\">\n <custom-pagination\n [totalItems]=\"totalItems\"\n [itemsPerPage]=\"defaultItemsPerPage\"\n [currentPage]=\"currentPage\"\n [showPageInfo]=\"showPageInfo\"\n [pageText]=\"pageText\"\n [ofText]=\"ofText\"\n (pageChange)=\"onPageChange($event)\">\n </custom-pagination>\n</div>\n", styles: ["@charset \"UTF-8\";@import\"https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap\";:host{font-family:Inter,Arial,sans-serif}.label-style{font-family:Inter,Arial,sans-serif;font-size:14px;color:#000}.table{font-family:Inter,Arial,sans-serif;color:var(--table-font-color, #000);font-size:var(--table-font-size, 14px);border-collapse:separate;border-spacing:0;border-radius:8px;overflow:hidden;border:.13rem solid #00444C}.table thead th{background-color:#00444c;color:#fff;padding:10px;border-bottom:1rem solid rgba(0,68,76,.8);border-right:1rem solid rgba(0,68,76,.8);border-radius:0}.table thead th:last-child{border-right:none}.table tbody td{padding:10px;border-bottom:.1rem solid rgba(0,68,76,.8);border-right:.1rem solid rgba(0,68,76,.8)}.table tbody tr:last-child td{border-bottom:none}.table tbody td:last-child{border-right:none}.table thead th:first-child{border-top-left-radius:0}.table thead th:last-child{border-top-right-radius:0}.table tbody tr:last-child td:first-child{border-bottom-left-radius:8px}.table tbody tr:last-child td:last-child{border-bottom-right-radius:8px}.btn-icon{width:24px;height:24px;background-size:cover;display:inline-block;cursor:pointer;margin-right:16px}.btn-icon.edit{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAACXBIWXMAAAsTAAALEwEAmpwYAAABrUlEQVR4nGNgoDI44+PD9b++nona5jLsSC4UupOauvpVVdXLJ4WF128mJkZSzfCdxfViG5dueHtswcr/3/v7wfhxYeF1qvikuLtbbMXG/WduPPvy/+K9t/8PLVwFtuBlZeVLUHBRZHhMdzF3Wk//7XN3Xv27+fzrfxC+dPfNf5BP7qanr6DYcL2CxF2MLj7/oxp7/1+4+wZsCcgnm5Zuersls0KQIsP185N2gwxngOLw+p7/IJ8s37Tv4sbWVnGquJwBCYP4qb199/ImTKDQ8MKEndgM1y9MPOjXWcpLkeFGxYl7GF3pbLjBkHW5/sg1vL47Q8y6JOE0zQwPqEl8h244g6vPf928hH0UGQ4CU2akHbLOjcN0eX7intApWTwUGb6221vn0d7KD5s2VP93LEyAG+5UGn+bYsNBYM/chFlfz7X+B+Etm6r/OxQm/A+oTnpXPyVegmLDMzJcxULDgn883F8PtuDR3oqPs2enHaickEx+wYUMcpKDNps5+P4PDQv+uW9e8sIVfYFGDNQC/xkYGIOD/Z8nxwfujIvzlqaawTBQz8DABMJUNxgKAOk7VoIIOJGlAAAAAElFTkSuQmCC)}.btn-icon.delete{background-image:url(\"data:image/svg+xml,%3Csvg xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22 xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22 viewBox%3D%220%2C0%2C256%2C256%22 width%3D%2224px%22 height%3D%2224px%22%3E%3Cg fill%3D%22%23fb0909%22 fill-rule%3D%22nonzero%22 stroke%3D%22none%22 stroke-width%3D%221%22 stroke-linecap%3D%22butt%22 stroke-linejoin%3D%22miter%22 stroke-miterlimit%3D%2210%22 stroke-dasharray%3D%22%22 stroke-dashoffset%3D%220%22 font-family%3D%22none%22 font-weight%3D%22none%22 font-size%3D%22none%22 text-anchor%3D%22none%22 style%3D%22mix-blend-mode%3A normal%22%3E%3Cg transform%3D%22scale(2%2C2)%22%3E%3Cpath d%3D%22M49%2C1c-1.66%2C0 -3%2C1.34 -3%2C3c0%2C1.66 1.34%2C3 3%2C3h30c1.66%2C0 3%2C-1.34 3%2C-3c0%2C-1.66 -1.34%2C-3 -3%2C-3zM24%2C15c-7.17%2C0 -13%2C5.83 -13%2C13c0%2C7.17 5.83%2C13 13%2C13h77v63c0%2C9.37 -7.63%2C17 -17%2C17h-40c-9.37%2C0 -17%2C-7.63 -17%2C-17v-52c0%2C-1.66 -1.34%2C-3 -3%2C-3c-1.66%2C0 -3%2C1.34 -3%2C3v52c0%2C12.68 10.32%2C23 23%2C23h40c12.68%2C0 23%2C-10.32 23%2C-23v-63.35937c5.72%2C-1.36 10%2C-6.50062 10%2C-12.64062c0%2C-7.17 -5.83%2C-13 -13%2C-13zM24%2C21h80c3.86%2C0 7%2C3.14 7%2C7c0%2C3.86 -3.14%2C7 -7%2C7h-80c-3.86%2C0 -7%2C-3.14 -7%2C-7c0%2C-3.86 3.14%2C-7 7%2C-7zM50%2C55c-1.66%2C0 -3%2C1.34 -3%2C3v46c0%2C1.66 1.34%2C3 3%2C3c1.66%2C0 3%2C-1.34 3%2C-3v-46c0%2C-1.66 -1.34%2C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P/wrK/gm1OyTLy1wBN7aAClNXOSyOaLMbHMErj1sBFviqsqcBR6refhO0QNct8KZb45gS0ZTjWDD3VLVP6OC3xNz7FXPfTisCxDujnwo8/1C5e0GZn1PqJovCJ/jEHzZmVn24LGCLQyQaZTTBg8TcP9wa9MS4E80OnBdBR6NgjJiITtykUPwu+3Dg4RS7LR1XiBTbNldekEyVBXRJhMwfMoY4ZEGpCrycysDJHTkHHSxTzSLGklR0FimgyakF8iErEhPO/DHuT2bJoNGPDSFbjgpFgN+0t1i4LFqStLgTooS7l/2GBu8miidnZDwzogG4GNl6EadGAwgs9UmeBWagRYiZQ8zAcPv4ggvoYgOCU1I7Z4bZE6PqQn/1318rvip1gK+cJgJjsDjk6T4WBDnk6NMd7gX+eXgEVTCON7w6xKvwwn/I3Ay8JgFPFYOEqEhYXt8oP1gRxEliGE3Aprq0NFZc8k0mjcYM9TEDjdacQo9NEBILSSDL+7YtdMol8vh+x3bIV8bB2na2HpFSkzGL5pocjFFnn7lM2ji57lUlIdME/aevTPDnAwYT/n6+n6EwCsw/Ga5fCAo8Pi5vPT4D4V+r2gMQODxGB6pF+nb8XqvmAw4hFTp5+e3ejzf+z+xmopYfAdAyAAAAABJRU5ErkJggg==)}\n"], dependencies: [{ kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "directive", type: i2.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i2.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i2.SelectControlValueAccessor, selector: "select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]", inputs: ["compareWith"] }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: CustomPaginationComponent, selector: "custom-pagination", inputs: ["totalItems", "itemsPerPage", "currentPage", "maxSize", "pageText", "ofText", "showPageInfo"], outputs: ["pageChange"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
1513
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: DataTableComponent, selector: "sim-data-table", inputs: { columns: "columns", hiddenColumns: "hiddenColumns", itemsPerPageOptions: "itemsPerPageOptions", defaultItemsPerPage: "defaultItemsPerPage", itemsPerPageLabel: "itemsPerPageLabel", marginTop: "marginTop", marginBottom: "marginBottom", marginLeft: "marginLeft", marginRight: "marginRight", showActionColumn: "showActionColumn", actionColumnLabel: "actionColumnLabel", totalItems: "totalItems", tableFontColor: "tableFontColor", tableFontSize: "tableFontSize", fetchDataFunction: "fetchDataFunction", editPermissions: "editPermissions", deletePermissions: "deletePermissions", viewPermissions: "viewPermissions", userPermissions: "userPermissions", showPageInfo: "showPageInfo", pageText: "pageText", ofText: "ofText" }, outputs: { sortChange: "sortChange", pageChange: "pageChange", itemsPerPageChange: "itemsPerPageChange", onEditTable: "onEditTable", onDeleteTable: "onDeleteTable", onViewTable: "onViewTable" }, usesOnChanges: true, ngImport: i0, template: "<div class=\"form-group\" [ngStyle]=\"{\n 'margin-top': marginTop + 'rem',\n 'margin-bottom': marginBottom + 'rem',\n 'margin-left': marginLeft + 'rem',\n 'margin-right': marginRight + 'rem'\n}\" style=\"text-align: right;\">\n <label for=\"itemsPerPageSelect\" style=\"margin-right: 0.5rem; margin-bottom: 0.7rem;\" [ngStyle]=\"labelStyle\">{{ itemsPerPageLabel }}</label>\n <select\n id=\"itemsPerPageSelect\"\n class=\"form-control form-control-sm d-inline-block w-auto\"\n [(ngModel)]=\"defaultItemsPerPage\"\n (ngModelChange)=\"onItemsPerPageChange()\">\n <option *ngFor=\"let option of itemsPerPageOptions\" [value]=\"option\">{{ option }}</option>\n </select>\n</div>\n\n<div class=\"table-responsive\">\n <table class=\"table table-hover\" [ngStyle]=\"{ 'color': tableFontColor, 'font-size': tableFontSize }\">\n <thead>\n <tr>\n <ng-container *ngFor=\"let column of columns\">\n <th *ngIf=\"!isColumnHidden(column.prop)\" (click)=\"onSort(column.prop)\">\n {{ column.label }}\n </th>\n </ng-container>\n <th *ngIf=\"showActionColumn\">{{ actionColumnLabel }}</th>\n </tr>\n </thead>\n <tbody>\n <tr *ngFor=\"let item of pagedData; let i = index\">\n <ng-container *ngFor=\"let column of columns\">\n <td *ngIf=\"!isColumnHidden(column.prop)\">\n {{ item[column.prop] }}\n </td>\n </ng-container>\n <td *ngIf=\"showActionColumn\">\n <div class=\"d-flex justify-content-center\">\n <div *ngIf=\"hasPermission(editPermissions)\" (click)=\"handleAction('edit', item, i)\" class=\"btn-icon edit mx-1\"></div>\n <div *ngIf=\"hasPermission(deletePermissions)\" (click)=\"handleAction('delete', item, i)\" class=\"btn-icon delete mx-1\"></div>\n <div *ngIf=\"hasPermission(viewPermissions)\" (click)=\"handleAction('view', item, i)\" class=\"btn-icon view mx-1\"></div>\n </div>\n </td>\n </tr>\n </tbody>\n </table>\n</div>\n\n<div class=\"text-center pagination-controls\">\n <custom-pagination\n [totalItems]=\"totalItems\"\n [itemsPerPage]=\"defaultItemsPerPage\"\n [currentPage]=\"currentPage\"\n [showPageInfo]=\"showPageInfo\"\n [pageText]=\"pageText\"\n [ofText]=\"ofText\"\n (pageChange)=\"onPageChange($event)\">\n </custom-pagination>\n</div>\n", styles: ["@charset \"UTF-8\";@import\"https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap\";:host{font-family:Inter,Arial,sans-serif}.label-style{font-family:Inter,Arial,sans-serif;font-size:14px;color:#000}.table{font-family:Inter,Arial,sans-serif;color:var(--table-font-color, #000);font-size:var(--table-font-size, 14px);border-collapse:separate;border-spacing:0;border-radius:8px;overflow:hidden;border:.13rem solid #00444C}.table thead th{background-color:#00444c;color:#fff;padding:10px;border-bottom:1rem solid rgba(0,68,76,.8);border-right:1rem solid rgba(0,68,76,.8);border-radius:0}.table thead th:last-child{border-right:none}.table tbody td{padding:10px;border-bottom:.1rem solid rgba(0,68,76,.8);border-right:.1rem solid rgba(0,68,76,.8)}.table tbody tr:last-child td{border-bottom:none}.table tbody td:last-child{border-right:none}.table thead th:first-child{border-top-left-radius:0}.table thead th:last-child{border-top-right-radius:0}.table tbody tr:last-child td:first-child{border-bottom-left-radius:8px}.table tbody tr:last-child td:last-child{border-bottom-right-radius:8px}.btn-icon{width:24px;height:24px;background-size:cover;display:inline-block;cursor:pointer;margin-right:16px}.btn-icon.edit{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAACXBIWXMAAAsTAAALEwEAmpwYAAABrUlEQVR4nGNgoDI44+PD9b++nona5jLsSC4UupOauvpVVdXLJ4WF128mJkZSzfCdxfViG5dueHtswcr/3/v7wfhxYeF1qvikuLtbbMXG/WduPPvy/+K9t/8PLVwFtuBlZeVLUHBRZHhMdzF3Wk//7XN3Xv27+fzrfxC+dPfNf5BP7qanr6DYcL2CxF2MLj7/oxp7/1+4+wZsCcgnm5Zuersls0KQIsP185N2gwxngOLw+p7/IJ8s37Tv4sbWVnGquJwBCYP4qb199/ImTKDQ8MKEndgM1y9MPOjXWcpLkeFGxYl7GF3pbLjBkHW5/sg1vL47Q8y6JOE0zQwPqEl8h244g6vPf928hH0UGQ4CU2akHbLOjcN0eX7intApWTwUGb6221vn0d7KD5s2VP93LEyAG+5UGn+bYsNBYM/chFlfz7X+B+Etm6r/OxQm/A+oTnpXPyVegmLDMzJcxULDgn883F8PtuDR3oqPs2enHaickEx+wYUMcpKDNps5+P4PDQv+uW9e8sIVfYFGDNQC/xkYGIOD/Z8nxwfujIvzlqaawTBQz8DABMJUNxgKAOk7VoIIOJGlAAAAAElFTkSuQmCC)}.btn-icon.delete{background-image:url(\"data:image/svg+xml,%3Csvg xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22 xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22 viewBox%3D%220%2C0%2C256%2C256%22 width%3D%2224px%22 height%3D%2224px%22%3E%3Cg fill%3D%22%23fb0909%22 fill-rule%3D%22nonzero%22 stroke%3D%22none%22 stroke-width%3D%221%22 stroke-linecap%3D%22butt%22 stroke-linejoin%3D%22miter%22 stroke-miterlimit%3D%2210%22 stroke-dasharray%3D%22%22 stroke-dashoffset%3D%220%22 font-family%3D%22none%22 font-weight%3D%22none%22 font-size%3D%22none%22 text-anchor%3D%22none%22 style%3D%22mix-blend-mode%3A normal%22%3E%3Cg transform%3D%22scale(2%2C2)%22%3E%3Cpath d%3D%22M49%2C1c-1.66%2C0 -3%2C1.34 -3%2C3c0%2C1.66 1.34%2C3 3%2C3h30c1.66%2C0 3%2C-1.34 3%2C-3c0%2C-1.66 -1.34%2C-3 -3%2C-3zM24%2C15c-7.17%2C0 -13%2C5.83 -13%2C13c0%2C7.17 5.83%2C13 13%2C13h77v63c0%2C9.37 -7.63%2C17 -17%2C17h-40c-9.37%2C0 -17%2C-7.63 -17%2C-17v-52c0%2C-1.66 -1.34%2C-3 -3%2C-3c-1.66%2C0 -3%2C1.34 -3%2C3v52c0%2C12.68 10.32%2C23 23%2C23h40c12.68%2C0 23%2C-10.32 23%2C-23v-63.35937c5.72%2C-1.36 10%2C-6.50062 10%2C-12.64062c0%2C-7.17 -5.83%2C-13 -13%2C-13zM24%2C21h80c3.86%2C0 7%2C3.14 7%2C7c0%2C3.86 -3.14%2C7 -7%2C7h-80c-3.86%2C0 -7%2C-3.14 -7%2C-7c0%2C-3.86 3.14%2C-7 7%2C-7zM50%2C55c-1.66%2C0 -3%2C1.34 -3%2C3v46c0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vMniK8k4yralv0YLjpYRO+6sYqrvCOG4A3PbKrPhhSoS8yjfG4ZbCFw9aU0e9AQ30+P/wrK/gm1OyTLy1wBN7aAClNXOSyOaLMbHMErj1sBFviqsqcBR6refhO0QNct8KZb45gS0ZTjWDD3VLVP6OC3xNz7FXPfTisCxDujnwo8/1C5e0GZn1PqJovCJ/jEHzZmVn24LGCLQyQaZTTBg8TcP9wa9MS4E80OnBdBR6NgjJiITtykUPwu+3Dg4RS7LR1XiBTbNldekEyVBXRJhMwfMoY4ZEGpCrycysDJHTkHHSxTzSLGklR0FimgyakF8iErEhPO/DHuT2bJoNGPDSFbjgpFgN+0t1i4LFqStLgTooS7l/2GBu8miidnZDwzogG4GNl6EadGAwgs9UmeBWagRYiZQ8zAcPv4ggvoYgOCU1I7Z4bZE6PqQn/1318rvip1gK+cJgJjsDjk6T4WBDnk6NMd7gX+eXgEVTCON7w6xKvwwn/I3Ay8JgFPFYOEqEhYXt8oP1gRxEliGE3Aprq0NFZc8k0mjcYM9TEDjdacQo9NEBILSSDL+7YtdMol8vh+x3bIV8bB2na2HpFSkzGL5pocjFFnn7lM2ji57lUlIdME/aevTPDnAwYT/n6+n6EwCsw/Ga5fCAo8Pi5vPT4D4V+r2gMQODxGB6pF+nb8XqvmAw4hFTp5+e3ejzf+z+xmopYfAdAyAAAAABJRU5ErkJggg==)}\n"], dependencies: [{ kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "directive", type: i2.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i2.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i2.SelectControlValueAccessor, selector: "select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]", inputs: ["compareWith"] }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: CustomPaginationComponent, selector: "custom-pagination", inputs: ["totalItems", "itemsPerPage", "currentPage", "maxSize", "pageText", "ofText", "showPageInfo"], outputs: ["pageChange"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
1495
1514
|
}
|
1496
1515
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DataTableComponent, decorators: [{
|
1497
1516
|
type: Component,
|
1498
|
-
args: [{ selector: 'sim-data-table', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"form-group\" [ngStyle]=\"{\n 'margin-top': marginTop + 'rem',\n 'margin-bottom': marginBottom + 'rem',\n 'margin-left': marginLeft + 'rem',\n 'margin-right': marginRight + 'rem'\n}\" style=\"text-align: right;\">\n <label for=\"itemsPerPageSelect\" style=\"margin-right: 0.5rem; margin-bottom: 0.7rem;\" [ngStyle]=\"labelStyle\">{{ itemsPerPageLabel }}</label>\n <select\n id=\"itemsPerPageSelect\"\n class=\"form-control form-control-sm d-inline-block w-auto\"\n [(ngModel)]=\"defaultItemsPerPage\"\n (ngModelChange)=\"onItemsPerPageChange(
|
1517
|
+
args: [{ selector: 'sim-data-table', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"form-group\" [ngStyle]=\"{\n 'margin-top': marginTop + 'rem',\n 'margin-bottom': marginBottom + 'rem',\n 'margin-left': marginLeft + 'rem',\n 'margin-right': marginRight + 'rem'\n}\" style=\"text-align: right;\">\n <label for=\"itemsPerPageSelect\" style=\"margin-right: 0.5rem; margin-bottom: 0.7rem;\" [ngStyle]=\"labelStyle\">{{ itemsPerPageLabel }}</label>\n <select\n id=\"itemsPerPageSelect\"\n class=\"form-control form-control-sm d-inline-block w-auto\"\n [(ngModel)]=\"defaultItemsPerPage\"\n (ngModelChange)=\"onItemsPerPageChange()\">\n <option *ngFor=\"let option of itemsPerPageOptions\" [value]=\"option\">{{ option }}</option>\n </select>\n</div>\n\n<div class=\"table-responsive\">\n <table class=\"table table-hover\" [ngStyle]=\"{ 'color': tableFontColor, 'font-size': tableFontSize }\">\n <thead>\n <tr>\n <ng-container *ngFor=\"let column of columns\">\n <th *ngIf=\"!isColumnHidden(column.prop)\" (click)=\"onSort(column.prop)\">\n {{ column.label }}\n </th>\n </ng-container>\n <th *ngIf=\"showActionColumn\">{{ actionColumnLabel }}</th>\n </tr>\n </thead>\n <tbody>\n <tr *ngFor=\"let item of pagedData; let i = index\">\n <ng-container *ngFor=\"let column of columns\">\n <td *ngIf=\"!isColumnHidden(column.prop)\">\n {{ item[column.prop] }}\n </td>\n </ng-container>\n <td *ngIf=\"showActionColumn\">\n <div class=\"d-flex justify-content-center\">\n <div *ngIf=\"hasPermission(editPermissions)\" (click)=\"handleAction('edit', item, i)\" class=\"btn-icon edit mx-1\"></div>\n <div *ngIf=\"hasPermission(deletePermissions)\" (click)=\"handleAction('delete', item, i)\" class=\"btn-icon delete mx-1\"></div>\n <div *ngIf=\"hasPermission(viewPermissions)\" (click)=\"handleAction('view', item, i)\" class=\"btn-icon view mx-1\"></div>\n </div>\n </td>\n </tr>\n </tbody>\n </table>\n</div>\n\n<div class=\"text-center pagination-controls\">\n <custom-pagination\n [totalItems]=\"totalItems\"\n [itemsPerPage]=\"defaultItemsPerPage\"\n [currentPage]=\"currentPage\"\n [showPageInfo]=\"showPageInfo\"\n [pageText]=\"pageText\"\n [ofText]=\"ofText\"\n (pageChange)=\"onPageChange($event)\">\n </custom-pagination>\n</div>\n", styles: ["@charset \"UTF-8\";@import\"https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap\";:host{font-family:Inter,Arial,sans-serif}.label-style{font-family:Inter,Arial,sans-serif;font-size:14px;color:#000}.table{font-family:Inter,Arial,sans-serif;color:var(--table-font-color, #000);font-size:var(--table-font-size, 14px);border-collapse:separate;border-spacing:0;border-radius:8px;overflow:hidden;border:.13rem solid #00444C}.table thead th{background-color:#00444c;color:#fff;padding:10px;border-bottom:1rem solid rgba(0,68,76,.8);border-right:1rem solid rgba(0,68,76,.8);border-radius:0}.table thead th:last-child{border-right:none}.table tbody td{padding:10px;border-bottom:.1rem solid rgba(0,68,76,.8);border-right:.1rem solid rgba(0,68,76,.8)}.table tbody tr:last-child td{border-bottom:none}.table tbody td:last-child{border-right:none}.table thead th:first-child{border-top-left-radius:0}.table thead th:last-child{border-top-right-radius:0}.table tbody tr:last-child td:first-child{border-bottom-left-radius:8px}.table tbody tr:last-child td:last-child{border-bottom-right-radius:8px}.btn-icon{width:24px;height:24px;background-size:cover;display:inline-block;cursor:pointer;margin-right:16px}.btn-icon.edit{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAACXBIWXMAAAsTAAALEwEAmpwYAAABrUlEQVR4nGNgoDI44+PD9b++nona5jLsSC4UupOauvpVVdXLJ4WF128mJkZSzfCdxfViG5dueHtswcr/3/v7wfhxYeF1qvikuLtbbMXG/WduPPvy/+K9t/8PLVwFtuBlZeVLUHBRZHhMdzF3Wk//7XN3Xv27+fzrfxC+dPfNf5BP7qanr6DYcL2CxF2MLj7/oxp7/1+4+wZsCcgnm5Zuersls0KQIsP185N2gwxngOLw+p7/IJ8s37Tv4sbWVnGquJwBCYP4qb199/ImTKDQ8MKEndgM1y9MPOjXWcpLkeFGxYl7GF3pbLjBkHW5/sg1vL47Q8y6JOE0zQwPqEl8h244g6vPf928hH0UGQ4CU2akHbLOjcN0eX7intApWTwUGb6221vn0d7KD5s2VP93LEyAG+5UGn+bYsNBYM/chFlfz7X+B+Etm6r/OxQm/A+oTnpXPyVegmLDMzJcxULDgn883F8PtuDR3oqPs2enHaickEx+wYUMcpKDNps5+P4PDQv+uW9e8sIVfYFGDNQC/xkYGIOD/Z8nxwfujIvzlqaawTBQz8DABMJUNxgKAOk7VoIIOJGlAAAAAElFTkSuQmCC)}.btn-icon.delete{background-image:url(\"data:image/svg+xml,%3Csvg xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22 xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22 viewBox%3D%220%2C0%2C256%2C256%22 width%3D%2224px%22 height%3D%2224px%22%3E%3Cg fill%3D%22%23fb0909%22 fill-rule%3D%22nonzero%22 stroke%3D%22none%22 stroke-width%3D%221%22 stroke-linecap%3D%22butt%22 stroke-linejoin%3D%22miter%22 stroke-miterlimit%3D%2210%22 stroke-dasharray%3D%22%22 stroke-dashoffset%3D%220%22 font-family%3D%22none%22 font-weight%3D%22none%22 font-size%3D%22none%22 text-anchor%3D%22none%22 style%3D%22mix-blend-mode%3A normal%22%3E%3Cg transform%3D%22scale(2%2C2)%22%3E%3Cpath d%3D%22M49%2C1c-1.66%2C0 -3%2C1.34 -3%2C3c0%2C1.66 1.34%2C3 3%2C3h30c1.66%2C0 3%2C-1.34 3%2C-3c0%2C-1.66 -1.34%2C-3 -3%2C-3zM24%2C15c-7.17%2C0 -13%2C5.83 -13%2C13c0%2C7.17 5.83%2C13 13%2C13h77v63c0%2C9.37 -7.63%2C17 -17%2C17h-40c-9.37%2C0 -17%2C-7.63 -17%2C-17v-52c0%2C-1.66 -1.34%2C-3 -3%2C-3c-1.66%2C0 -3%2C1.34 -3%2C3v52c0%2C12.68 10.32%2C23 23%2C23h40c12.68%2C0 23%2C-10.32 23%2C-23v-63.35937c5.72%2C-1.36 10%2C-6.50062 10%2C-12.64062c0%2C-7.17 -5.83%2C-13 -13%2C-13zM24%2C21h80c3.86%2C0 7%2C3.14 7%2C7c0%2C3.86 -3.14%2C7 -7%2C7h-80c-3.86%2C0 -7%2C-3.14 -7%2C-7c0%2C-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HzA2QEe0pxV8W+hMqItczQXecQMah2q2taeb2RMwvCYfor7OfDgkHAO4tJgNujvMniK8k4yralv0YLjpYRO+6sYqrvCOG4A3PbKrPhhSoS8yjfG4ZbCFw9aU0e9AQ30+P/wrK/gm1OyTLy1wBN7aAClNXOSyOaLMbHMErj1sBFviqsqcBR6refhO0QNct8KZb45gS0ZTjWDD3VLVP6OC3xNz7FXPfTisCxDujnwo8/1C5e0GZn1PqJovCJ/jEHzZmVn24LGCLQyQaZTTBg8TcP9wa9MS4E80OnBdBR6NgjJiITtykUPwu+3Dg4RS7LR1XiBTbNldekEyVBXRJhMwfMoY4ZEGpCrycysDJHTkHHSxTzSLGklR0FimgyakF8iErEhPO/DHuT2bJoNGPDSFbjgpFgN+0t1i4LFqStLgTooS7l/2GBu8miidnZDwzogG4GNl6EadGAwgs9UmeBWagRYiZQ8zAcPv4ggvoYgOCU1I7Z4bZE6PqQn/1318rvip1gK+cJgJjsDjk6T4WBDnk6NMd7gX+eXgEVTCON7w6xKvwwn/I3Ay8JgFPFYOEqEhYXt8oP1gRxEliGE3Aprq0NFZc8k0mjcYM9TEDjdacQo9NEBILSSDL+7YtdMol8vh+x3bIV8bB2na2HpFSkzGL5pocjFFnn7lM2ji57lUlIdME/aevTPDnAwYT/n6+n6EwCsw/Ga5fCAo8Pi5vPT4D4V+r2gMQODxGB6pF+nb8XqvmAw4hFTp5+e3ejzf+z+xmopYfAdAyAAAAABJRU5ErkJggg==)}\n"] }]
|
1499
1518
|
}], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }]; }, propDecorators: { columns: [{
|
1500
1519
|
type: Input
|
1501
|
-
}],
|
1520
|
+
}], hiddenColumns: [{
|
1502
1521
|
type: Input
|
1503
1522
|
}], itemsPerPageOptions: [{
|
1504
1523
|
type: Input
|
@@ -1946,12 +1965,45 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
1946
1965
|
}]
|
1947
1966
|
}], ctorParameters: function () { return [{ type: i1$1.NgbModal }]; } });
|
1948
1967
|
|
1968
|
+
class DataPaginateService {
|
1969
|
+
constructor(http) {
|
1970
|
+
this.http = http;
|
1971
|
+
}
|
1972
|
+
fetchData(url, params) {
|
1973
|
+
let httpParams = new HttpParams()
|
1974
|
+
.set('page', params.pageNumber.toString())
|
1975
|
+
.set('limit', params.pageSize.toString())
|
1976
|
+
.set('sort', params.sortColumn)
|
1977
|
+
.set('order', params.sortDirection);
|
1978
|
+
if (params.descricao) {
|
1979
|
+
httpParams = httpParams.set('descricao', params.descricao);
|
1980
|
+
}
|
1981
|
+
return this.http.get(url, { params: httpParams }).pipe(map(response => {
|
1982
|
+
const items = response.data || [];
|
1983
|
+
const totalItems = response.meta.total || 0;
|
1984
|
+
return {
|
1985
|
+
items,
|
1986
|
+
totalItems
|
1987
|
+
};
|
1988
|
+
}));
|
1989
|
+
}
|
1990
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DataPaginateService, deps: [{ token: i1$2.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
1991
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DataPaginateService, providedIn: 'root' }); }
|
1992
|
+
}
|
1993
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DataPaginateService, decorators: [{
|
1994
|
+
type: Injectable,
|
1995
|
+
args: [{
|
1996
|
+
providedIn: 'root'
|
1997
|
+
}]
|
1998
|
+
}], ctorParameters: function () { return [{ type: i1$2.HttpClient }]; } });
|
1999
|
+
|
1949
2000
|
class LibPortalAngularModule {
|
1950
2001
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: LibPortalAngularModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
1951
2002
|
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.2.12", ngImport: i0, type: LibPortalAngularModule, imports: [ComponentsModule], exports: [ComponentsModule] }); }
|
1952
2003
|
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: LibPortalAngularModule, providers: [
|
1953
2004
|
NotificationService,
|
1954
|
-
ConfirmationService
|
2005
|
+
ConfirmationService,
|
2006
|
+
DataPaginateService,
|
1955
2007
|
], imports: [ComponentsModule, ComponentsModule] }); }
|
1956
2008
|
}
|
1957
2009
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: LibPortalAngularModule, decorators: [{
|
@@ -1965,7 +2017,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
1965
2017
|
],
|
1966
2018
|
providers: [
|
1967
2019
|
NotificationService,
|
1968
|
-
ConfirmationService
|
2020
|
+
ConfirmationService,
|
2021
|
+
DataPaginateService,
|
1969
2022
|
],
|
1970
2023
|
}]
|
1971
2024
|
}] });
|
@@ -1982,5 +2035,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
1982
2035
|
* Generated bundle index. Do not edit.
|
1983
2036
|
*/
|
1984
2037
|
|
1985
|
-
export { AlertComponent, BadgeComponent, ButtonClasses, ButtonComponent, CardComponent, CheckboxComponent, CodeHighlightComponent, ComponentsModule, ConfirmationComponent, ConfirmationService, CustomPaginationComponent, DataTableComponent, FormComponent, InputComponent, LibPortalAngularModule, MultiSelectComponent, NotificationService, RadioComponent, SelectComponent, TextareaComponent, TreeNodeComponent };
|
2038
|
+
export { AlertComponent, BadgeComponent, ButtonClasses, ButtonComponent, CardComponent, CheckboxComponent, CodeHighlightComponent, ComponentsModule, ConfirmationComponent, ConfirmationService, CustomPaginationComponent, DataPaginateService, DataTableComponent, FormComponent, InputComponent, LibPortalAngularModule, MultiSelectComponent, NotificationService, RadioComponent, SelectComponent, TextareaComponent, TreeNodeComponent };
|
1986
2039
|
//# sourceMappingURL=lib-portal-angular.mjs.map
|