lib-portal-angular 0.0.84 → 0.0.86
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/components/components.module.mjs +42 -37
- package/esm2022/lib/components/drag-drop-list/drag-drop-list.component.mjs +91 -0
- package/esm2022/lib/components/tables/data-table.component.mjs +13 -7
- package/esm2022/lib/lib-portal-angular.module.mjs +4 -1
- package/esm2022/public-api.mjs +7 -27
- package/fesm2022/lib-portal-angular.mjs +297 -201
- package/fesm2022/lib-portal-angular.mjs.map +1 -1
- package/lib/components/components.module.d.ts +8 -7
- package/lib/components/drag-drop-list/drag-drop-list.component.d.ts +35 -0
- package/lib/components/tables/data-table.component.d.ts +9 -7
- package/package.json +1 -1
- package/public-api.d.ts +4 -26
@@ -1525,6 +1525,192 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
1525
1525
|
type: Output
|
1526
1526
|
}] } });
|
1527
1527
|
|
1528
|
+
class DragDropListComponent {
|
1529
|
+
constructor() {
|
1530
|
+
this.nonSelectedList = [];
|
1531
|
+
this.nonSelectedButtonClick = new EventEmitter();
|
1532
|
+
this.nonSelectedInputChanged = new EventEmitter();
|
1533
|
+
this.selectedList = [];
|
1534
|
+
this.selectedButtonClick = new EventEmitter();
|
1535
|
+
this.selectedInputChanged = new EventEmitter();
|
1536
|
+
this.nonSelectedListInputSubject = new Subject();
|
1537
|
+
this.selectedListInputSubject = new Subject();
|
1538
|
+
this.ButtonClasses = ButtonClasses; // Adicione a enumeração ao componente
|
1539
|
+
this.draggedItem = null;
|
1540
|
+
this.nonSelectedListInputSubject.pipe(debounceTime(2000)).subscribe((value) => {
|
1541
|
+
this.nonSelectedInputChanged.emit(value);
|
1542
|
+
});
|
1543
|
+
this.selectedListInputSubject.pipe(debounceTime(2000)).subscribe((value) => {
|
1544
|
+
this.selectedInputChanged.emit(value);
|
1545
|
+
});
|
1546
|
+
}
|
1547
|
+
onDragStart(item) {
|
1548
|
+
this.draggedItem = item;
|
1549
|
+
}
|
1550
|
+
onDragOver(event) {
|
1551
|
+
event.preventDefault();
|
1552
|
+
}
|
1553
|
+
onDrop(list, event) {
|
1554
|
+
event.preventDefault();
|
1555
|
+
if (this.draggedItem) {
|
1556
|
+
const index = list.indexOf(this.draggedItem);
|
1557
|
+
if (index === -1) {
|
1558
|
+
this.removeItem(this.draggedItem);
|
1559
|
+
list.push(this.draggedItem);
|
1560
|
+
}
|
1561
|
+
this.draggedItem = null;
|
1562
|
+
}
|
1563
|
+
}
|
1564
|
+
removeItem(item) {
|
1565
|
+
[this.nonSelectedList, this.selectedList].forEach((list) => {
|
1566
|
+
const index = list.indexOf(item);
|
1567
|
+
if (index !== -1) {
|
1568
|
+
list.splice(index, 1);
|
1569
|
+
}
|
1570
|
+
});
|
1571
|
+
}
|
1572
|
+
nonSelectedListInputChange(event) {
|
1573
|
+
this.nonSelectedListInputSubject.next(event.target.value);
|
1574
|
+
}
|
1575
|
+
selectedListInputChange(event) {
|
1576
|
+
this.selectedListInputSubject.next(event.target.value);
|
1577
|
+
}
|
1578
|
+
selButtonClick() {
|
1579
|
+
this.selectedButtonClick.emit();
|
1580
|
+
}
|
1581
|
+
nonSelButtonClick() {
|
1582
|
+
this.nonSelectedButtonClick.emit();
|
1583
|
+
}
|
1584
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DragDropListComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
1585
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: DragDropListComponent, selector: "argenta-drag-drop-list", inputs: { nonSelectedTitle: "nonSelectedTitle", nonSelectedList: "nonSelectedList", nonSelectedButtonLabel: "nonSelectedButtonLabel", selectedTitle: "selectedTitle", selectedList: "selectedList", selectedButtonLabel: "selectedButtonLabel" }, outputs: { nonSelectedButtonClick: "nonSelectedButtonClick", nonSelectedInputChanged: "nonSelectedInputChanged", selectedButtonClick: "selectedButtonClick", selectedInputChanged: "selectedInputChanged" }, ngImport: i0, template: "<!-- Cont\u00EAiner externo para dar a apar\u00EAncia de grupo -->\n<div class=\"group-container\">\n <div class=\"container\">\n <!-- Lista 1 com input -->\n <div\n class=\"list\"\n (dragover)=\"onDragOver($event)\"\n (drop)=\"onDrop(nonSelectedList, $event)\"\n >\n <div class=\"row\">\n <h6 class=\"col-md-8\">{{ nonSelectedTitle }}</h6>\n <div *ngIf=\"nonSelectedButtonLabel\" class=\"col-md-4 align-end\">\n <argenta-custom-button\n label=\"{{ nonSelectedButtonLabel }}\"\n (onButtonClick)=\"nonSelButtonClick()\"\n class=\"align-end\"\n [btnClass]=\"ButtonClasses.Primary\"\n >\n </argenta-custom-button>\n </div>\n </div>\n <input\n type=\"text\"\n class=\"list-input\"\n (input)=\"nonSelectedListInputChange($event)\"\n />\n <div\n *ngFor=\"let item of nonSelectedList\"\n class=\"item-card\"\n draggable=\"true\"\n (dragstart)=\"onDragStart(item)\"\n >\n {{ item.descricao }}\n </div>\n </div>\n\n <!-- Lista 2 com input -->\n <div\n class=\"list\"\n (dragover)=\"onDragOver($event)\"\n (drop)=\"onDrop(selectedList, $event)\"\n >\n <div class=\"row\">\n <h6 class=\"col-md-8\">{{ selectedTitle }}</h6>\n <div *ngIf=\"selectedButtonLabel\" class=\"col-md-4 align-end\">\n <argenta-custom-button\n label=\"{{ selectedButtonLabel }}\"\n (onButtonClick)=\"selButtonClick()\"\n class=\"align-end\"\n [btnClass]=\"ButtonClasses.Primary\"\n >\n </argenta-custom-button>\n </div>\n </div>\n <input\n type=\"text\"\n class=\"list-input\"\n (input)=\"selectedListInputChange($event)\"\n />\n <div\n *ngFor=\"let item of selectedList\"\n class=\"item-card\"\n draggable=\"true\"\n (dragstart)=\"onDragStart(item)\"\n >\n {{ item.descricao }}\n </div>\n </div>\n </div>\n</div>\n", styles: ["@charset \"UTF-8\";.group-container{display:flex;justify-content:center;padding:20px;background-color:#fff;border-radius:12px;box-shadow:0 4px 8px #0000001a;width:80%;margin:auto}.container{display:flex;gap:20px;width:100%}.list{flex:1;padding:10px;background-color:#f0f0f0;border-radius:8px;display:flex;flex-direction:column;align-items:flex-start;gap:10px}.list-input{width:100%;height:40px;margin-bottom:15px;border-radius:4px;border:1px solid #ccc;outline:none;font-size:1rem;resize:none}.item-card{width:100%;padding:15px;background-color:#fff;border-radius:8px;box-shadow:0 2px 5px #0003;cursor:move;display:flex;align-items:center;justify-content:center;text-align:center;font-family:var(--font-family);font-weight:500;font-size:1.1rem;color:#333}.row{display:flex;justify-content:space-between;align-items:center;width:100%;max-height:50px;height:50px}.align-end{display:flex;justify-content:flex-end}\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: "component", type: ButtonComponent, selector: "argenta-custom-button", inputs: ["type", "label", "btnClass", "fontSize", "disabled", "autofocus", "form", "formaction", "formenctype", "formmethod", "formnovalidate", "formtarget", "name", "value", "permissions"], outputs: ["onButtonClick"] }] }); }
|
1586
|
+
}
|
1587
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DragDropListComponent, decorators: [{
|
1588
|
+
type: Component,
|
1589
|
+
args: [{ selector: "argenta-drag-drop-list", template: "<!-- Cont\u00EAiner externo para dar a apar\u00EAncia de grupo -->\n<div class=\"group-container\">\n <div class=\"container\">\n <!-- Lista 1 com input -->\n <div\n class=\"list\"\n (dragover)=\"onDragOver($event)\"\n (drop)=\"onDrop(nonSelectedList, $event)\"\n >\n <div class=\"row\">\n <h6 class=\"col-md-8\">{{ nonSelectedTitle }}</h6>\n <div *ngIf=\"nonSelectedButtonLabel\" class=\"col-md-4 align-end\">\n <argenta-custom-button\n label=\"{{ nonSelectedButtonLabel }}\"\n (onButtonClick)=\"nonSelButtonClick()\"\n class=\"align-end\"\n [btnClass]=\"ButtonClasses.Primary\"\n >\n </argenta-custom-button>\n </div>\n </div>\n <input\n type=\"text\"\n class=\"list-input\"\n (input)=\"nonSelectedListInputChange($event)\"\n />\n <div\n *ngFor=\"let item of nonSelectedList\"\n class=\"item-card\"\n draggable=\"true\"\n (dragstart)=\"onDragStart(item)\"\n >\n {{ item.descricao }}\n </div>\n </div>\n\n <!-- Lista 2 com input -->\n <div\n class=\"list\"\n (dragover)=\"onDragOver($event)\"\n (drop)=\"onDrop(selectedList, $event)\"\n >\n <div class=\"row\">\n <h6 class=\"col-md-8\">{{ selectedTitle }}</h6>\n <div *ngIf=\"selectedButtonLabel\" class=\"col-md-4 align-end\">\n <argenta-custom-button\n label=\"{{ selectedButtonLabel }}\"\n (onButtonClick)=\"selButtonClick()\"\n class=\"align-end\"\n [btnClass]=\"ButtonClasses.Primary\"\n >\n </argenta-custom-button>\n </div>\n </div>\n <input\n type=\"text\"\n class=\"list-input\"\n (input)=\"selectedListInputChange($event)\"\n />\n <div\n *ngFor=\"let item of selectedList\"\n class=\"item-card\"\n draggable=\"true\"\n (dragstart)=\"onDragStart(item)\"\n >\n {{ item.descricao }}\n </div>\n </div>\n </div>\n</div>\n", styles: ["@charset \"UTF-8\";.group-container{display:flex;justify-content:center;padding:20px;background-color:#fff;border-radius:12px;box-shadow:0 4px 8px #0000001a;width:80%;margin:auto}.container{display:flex;gap:20px;width:100%}.list{flex:1;padding:10px;background-color:#f0f0f0;border-radius:8px;display:flex;flex-direction:column;align-items:flex-start;gap:10px}.list-input{width:100%;height:40px;margin-bottom:15px;border-radius:4px;border:1px solid #ccc;outline:none;font-size:1rem;resize:none}.item-card{width:100%;padding:15px;background-color:#fff;border-radius:8px;box-shadow:0 2px 5px #0003;cursor:move;display:flex;align-items:center;justify-content:center;text-align:center;font-family:var(--font-family);font-weight:500;font-size:1.1rem;color:#333}.row{display:flex;justify-content:space-between;align-items:center;width:100%;max-height:50px;height:50px}.align-end{display:flex;justify-content:flex-end}\n"] }]
|
1590
|
+
}], ctorParameters: function () { return []; }, propDecorators: { nonSelectedTitle: [{
|
1591
|
+
type: Input
|
1592
|
+
}], nonSelectedList: [{
|
1593
|
+
type: Input
|
1594
|
+
}], nonSelectedButtonLabel: [{
|
1595
|
+
type: Input
|
1596
|
+
}], nonSelectedButtonClick: [{
|
1597
|
+
type: Output
|
1598
|
+
}], nonSelectedInputChanged: [{
|
1599
|
+
type: Output
|
1600
|
+
}], selectedTitle: [{
|
1601
|
+
type: Input
|
1602
|
+
}], selectedList: [{
|
1603
|
+
type: Input
|
1604
|
+
}], selectedButtonLabel: [{
|
1605
|
+
type: Input
|
1606
|
+
}], selectedButtonClick: [{
|
1607
|
+
type: Output
|
1608
|
+
}], selectedInputChanged: [{
|
1609
|
+
type: Output
|
1610
|
+
}] } });
|
1611
|
+
|
1612
|
+
class DynamicModalComponent {
|
1613
|
+
constructor() {
|
1614
|
+
this.modalTitle = "Modal Title";
|
1615
|
+
this.modalSizeClass = "";
|
1616
|
+
this.modalId = "dynamicModal"; // ID único para cada modal
|
1617
|
+
}
|
1618
|
+
openModal() {
|
1619
|
+
const modalElement = document.getElementById(this.modalId);
|
1620
|
+
if (modalElement) {
|
1621
|
+
modalElement.classList.add("show");
|
1622
|
+
modalElement.setAttribute("aria-hidden", "false");
|
1623
|
+
modalElement.style.display = "block";
|
1624
|
+
document.body.classList.add("modal-open");
|
1625
|
+
// Adiciona o backdrop manualmente se não existir
|
1626
|
+
if (!document.querySelector(`.modal-backdrop[data-modal-id="${this.modalId}"]`)) {
|
1627
|
+
const backdrop = document.createElement("div");
|
1628
|
+
backdrop.className = "modal-backdrop fade show";
|
1629
|
+
backdrop.setAttribute("data-modal-id", this.modalId);
|
1630
|
+
document.body.appendChild(backdrop);
|
1631
|
+
}
|
1632
|
+
}
|
1633
|
+
}
|
1634
|
+
closeModal() {
|
1635
|
+
const modalElement = document.getElementById(this.modalId);
|
1636
|
+
if (modalElement) {
|
1637
|
+
modalElement.classList.remove("show");
|
1638
|
+
modalElement.setAttribute("aria-hidden", "true");
|
1639
|
+
modalElement.style.display = "none";
|
1640
|
+
document.body.classList.remove("modal-open");
|
1641
|
+
document
|
1642
|
+
.querySelector(`.modal-backdrop[data-modal-id="${this.modalId}"]`)
|
1643
|
+
?.remove();
|
1644
|
+
}
|
1645
|
+
}
|
1646
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DynamicModalComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
1647
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: DynamicModalComponent, selector: "argenta-dynamic-modal", inputs: { modalTitle: "modalTitle", modalSizeClass: "modalSizeClass", modalId: "modalId" }, ngImport: i0, template: "<div\n class=\"modal fade\"\n [id]=\"modalId\"\n tabindex=\"-1\"\n [attr.aria-labelledby]=\"modalId + 'Label'\"\n aria-hidden=\"true\"\n>\n <div class=\"modal-dialog\" [ngClass]=\"modalSizeClass\">\n <div class=\"modal-content\">\n <div class=\"modal-header custom-header\">\n <h5 class=\"modal-title custom-modal-title\" [id]=\"modalId + 'Label'\">\n {{ modalTitle }}\n </h5>\n <button\n type=\"button\"\n class=\"custom-close-button\"\n (click)=\"closeModal()\"\n aria-label=\"Close\"\n >\n ×\n </button>\n </div>\n <div class=\"modal-body custom-body\">\n <ng-content select=\"[modal-body]\"></ng-content>\n </div>\n <div class=\"modal-footer custom-footer\">\n <ng-content select=\"[modal-footer]\"></ng-content>\n </div>\n </div>\n </div>\n</div>\n", styles: [".custom-header{background-color:var(--primary-color)!important;color:var(--text-color)!important;font-size:1.25rem!important;font-family:var(--font-family)!important;padding:1rem;position:relative}.custom-header .custom-close-button{position:absolute;right:1rem;background:none;border:none;font-size:2.5rem;color:var(--text-color);cursor:pointer}.custom-header .custom-close-button:hover{color:var(--danger-color)}.custom-modal-title{color:var(--text-color)!important;font-size:1.8rem!important;font-family:var(--font-family)!important}.custom-body{background-color:#fff;padding:1rem}.custom-footer{background-color:#fff;padding:.75rem;display:flex;justify-content:flex-end;gap:.5rem}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }] }); }
|
1648
|
+
}
|
1649
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DynamicModalComponent, decorators: [{
|
1650
|
+
type: Component,
|
1651
|
+
args: [{ selector: "argenta-dynamic-modal", template: "<div\n class=\"modal fade\"\n [id]=\"modalId\"\n tabindex=\"-1\"\n [attr.aria-labelledby]=\"modalId + 'Label'\"\n aria-hidden=\"true\"\n>\n <div class=\"modal-dialog\" [ngClass]=\"modalSizeClass\">\n <div class=\"modal-content\">\n <div class=\"modal-header custom-header\">\n <h5 class=\"modal-title custom-modal-title\" [id]=\"modalId + 'Label'\">\n {{ modalTitle }}\n </h5>\n <button\n type=\"button\"\n class=\"custom-close-button\"\n (click)=\"closeModal()\"\n aria-label=\"Close\"\n >\n ×\n </button>\n </div>\n <div class=\"modal-body custom-body\">\n <ng-content select=\"[modal-body]\"></ng-content>\n </div>\n <div class=\"modal-footer custom-footer\">\n <ng-content select=\"[modal-footer]\"></ng-content>\n </div>\n </div>\n </div>\n</div>\n", styles: [".custom-header{background-color:var(--primary-color)!important;color:var(--text-color)!important;font-size:1.25rem!important;font-family:var(--font-family)!important;padding:1rem;position:relative}.custom-header .custom-close-button{position:absolute;right:1rem;background:none;border:none;font-size:2.5rem;color:var(--text-color);cursor:pointer}.custom-header .custom-close-button:hover{color:var(--danger-color)}.custom-modal-title{color:var(--text-color)!important;font-size:1.8rem!important;font-family:var(--font-family)!important}.custom-body{background-color:#fff;padding:1rem}.custom-footer{background-color:#fff;padding:.75rem;display:flex;justify-content:flex-end;gap:.5rem}\n"] }]
|
1652
|
+
}], propDecorators: { modalTitle: [{
|
1653
|
+
type: Input
|
1654
|
+
}], modalSizeClass: [{
|
1655
|
+
type: Input
|
1656
|
+
}], modalId: [{
|
1657
|
+
type: Input
|
1658
|
+
}] } });
|
1659
|
+
|
1660
|
+
class DynamicTableComponent {
|
1661
|
+
constructor() {
|
1662
|
+
this.itemsPerPageOptions = [10, 20, 50];
|
1663
|
+
this.showPageInfo = true;
|
1664
|
+
this.currentPage = 1;
|
1665
|
+
this.itemsPerPage = 10;
|
1666
|
+
}
|
1667
|
+
get totalItems() {
|
1668
|
+
return this.config.totalItems ?? this.config.data.length;
|
1669
|
+
}
|
1670
|
+
get paginatedData() {
|
1671
|
+
if (!this.config.pagination) {
|
1672
|
+
// Retorna todos os dados se a paginação estiver desativada
|
1673
|
+
return this.config.data;
|
1674
|
+
}
|
1675
|
+
const itemsPerPage = this.config.itemsPerPage || this.itemsPerPage;
|
1676
|
+
const startIndex = (this.currentPage - 1) * itemsPerPage;
|
1677
|
+
return this.config.data.slice(startIndex, startIndex + itemsPerPage);
|
1678
|
+
}
|
1679
|
+
ngOnInit() {
|
1680
|
+
if (!this.config || !this.config.columns || !this.config.data) {
|
1681
|
+
throw new Error("DynamicTableComponent: Configuração inválida.");
|
1682
|
+
}
|
1683
|
+
// Define valores padrão se não especificados
|
1684
|
+
this.config.showHeader = this.config.showHeader ?? true; // Exibe o cabeçalho por padrão
|
1685
|
+
this.config.pagination = this.config.pagination ?? true; // Ativa paginação por padrão
|
1686
|
+
this.itemsPerPage = this.config.itemsPerPage || 10;
|
1687
|
+
}
|
1688
|
+
onPageChange(newPage) {
|
1689
|
+
this.currentPage = newPage;
|
1690
|
+
}
|
1691
|
+
onItemsPerPageChange(event) {
|
1692
|
+
const target = event.target;
|
1693
|
+
this.itemsPerPage = +target.value;
|
1694
|
+
this.currentPage = 1; // Reinicia a paginação ao alterar os itens por página
|
1695
|
+
}
|
1696
|
+
// Getter para garantir que totalItems nunca seja undefined
|
1697
|
+
get safeTotalItems() {
|
1698
|
+
return this.totalItems || 0;
|
1699
|
+
}
|
1700
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DynamicTableComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
1701
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: DynamicTableComponent, selector: "argenta-dynamic-table", inputs: { config: "config", itemsPerPageOptions: "itemsPerPageOptions", showPageInfo: "showPageInfo" }, ngImport: i0, template: "<table class=\"table\" [ngClass]=\"{ nested: config.isNested }\">\n <thead *ngIf=\"config.showHeader\">\n <tr>\n <th *ngFor=\"let column of config.columns\">{{ column.header }}</th>\n </tr>\n </thead>\n <tbody>\n <tr *ngFor=\"let row of paginatedData\">\n <td *ngFor=\"let column of config.columns\">\n <ng-container [ngSwitch]=\"column.type\">\n <span *ngSwitchCase=\"'text'\">{{ row[column.key] }}</span>\n <ng-container *ngSwitchCase=\"'template'\">\n <ng-container\n *ngTemplateOutlet=\"\n column.template || null;\n context: { $implicit: row }\n \"\n ></ng-container>\n </ng-container>\n </ng-container>\n </td>\n </tr>\n </tbody>\n</table>\n\n<div\n class=\"text-center pagination-controls\"\n [ngClass]=\"{ nested: config.isNested }\"\n *ngIf=\"config.pagination\"\n>\n <custom-pagination\n [totalItems]=\"safeTotalItems\"\n [itemsPerPage]=\"itemsPerPage\"\n [currentPage]=\"currentPage\"\n [showPageInfo]=\"showPageInfo\"\n (pageChange)=\"onPageChange($event)\"\n >\n </custom-pagination>\n</div>\n", styles: ["@charset \"UTF-8\";.table{width:100%;border-collapse:collapse;border-spacing:0}.table{width:100%;border-collapse:separate;border-spacing:0;overflow:hidden}.table thead th{background-color:var(--primary-color);color:var(--text-color);font-family:var(--font-family);font-size:14px;font-weight:600;padding:10px;border-bottom:.1rem solid #dcdcdc;text-align:center;line-height:2.5}.table thead th:first-child{border-top-left-radius:10px}.table thead th:last-child{border-top-right-radius:10px}.table.nested thead th{font-size:.7rem;padding:7px;line-height:.8}.table tbody td{font-family:var(--font-family);font-size:14px;color:#737b7b;padding:10px;border-bottom:.1rem solid #dcdcdc;text-align:center}.table tbody td:first-child{text-align:left;padding-left:1.4rem}.table.nested tbody td:first-child{padding-left:1rem}.table tbody tr:hover{background-color:#f5f5f5!important;transition:background-color .3s ease}.table.nested tbody tr:hover{background-color:#f0f0f0!important}.pagination-controls{display:flex;justify-content:center;align-items:center;margin-top:1rem}.pagination-controls.nested{font-size:.7rem;transform:scale(.7);margin-top:.5rem}.data-table-header{display:flex;justify-content:space-between;align-items:center;margin-bottom:1rem}.left-section{display:flex;align-items:center}.items-per-page-label{font-family:var(--font-family);font-size:14px;color:#666;margin-right:.5rem}.custom-select{font-family:var(--font-family);font-size:14px;padding:.375rem 1.75rem .375rem .75rem;border:1px solid #ccc;border-radius:.25rem;appearance:none;background:#fff url('data:image/svg+xml;charset=US-ASCII,<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 4 5\"><path fill=\"#666\" d=\"M2 0L0 2h4L2 0zM2 5l2-2H0l2 2z\"/></svg>') no-repeat right .75rem center/8px 10px}.custom-select:focus{border-color:#80bdff;outline:none;box-shadow:0 0 0 .2rem #007bff40}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i1.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { kind: "directive", type: i1.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { kind: "component", type: CustomPaginationComponent, selector: "custom-pagination", inputs: ["totalItems", "itemsPerPage", "currentPage", "showPageInfo"], outputs: ["pageChange"] }] }); }
|
1702
|
+
}
|
1703
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DynamicTableComponent, decorators: [{
|
1704
|
+
type: Component,
|
1705
|
+
args: [{ selector: "argenta-dynamic-table", template: "<table class=\"table\" [ngClass]=\"{ nested: config.isNested }\">\n <thead *ngIf=\"config.showHeader\">\n <tr>\n <th *ngFor=\"let column of config.columns\">{{ column.header }}</th>\n </tr>\n </thead>\n <tbody>\n <tr *ngFor=\"let row of paginatedData\">\n <td *ngFor=\"let column of config.columns\">\n <ng-container [ngSwitch]=\"column.type\">\n <span *ngSwitchCase=\"'text'\">{{ row[column.key] }}</span>\n <ng-container *ngSwitchCase=\"'template'\">\n <ng-container\n *ngTemplateOutlet=\"\n column.template || null;\n context: { $implicit: row }\n \"\n ></ng-container>\n </ng-container>\n </ng-container>\n </td>\n </tr>\n </tbody>\n</table>\n\n<div\n class=\"text-center pagination-controls\"\n [ngClass]=\"{ nested: config.isNested }\"\n *ngIf=\"config.pagination\"\n>\n <custom-pagination\n [totalItems]=\"safeTotalItems\"\n [itemsPerPage]=\"itemsPerPage\"\n [currentPage]=\"currentPage\"\n [showPageInfo]=\"showPageInfo\"\n (pageChange)=\"onPageChange($event)\"\n >\n </custom-pagination>\n</div>\n", styles: ["@charset \"UTF-8\";.table{width:100%;border-collapse:collapse;border-spacing:0}.table{width:100%;border-collapse:separate;border-spacing:0;overflow:hidden}.table thead th{background-color:var(--primary-color);color:var(--text-color);font-family:var(--font-family);font-size:14px;font-weight:600;padding:10px;border-bottom:.1rem solid #dcdcdc;text-align:center;line-height:2.5}.table thead th:first-child{border-top-left-radius:10px}.table thead th:last-child{border-top-right-radius:10px}.table.nested thead th{font-size:.7rem;padding:7px;line-height:.8}.table tbody td{font-family:var(--font-family);font-size:14px;color:#737b7b;padding:10px;border-bottom:.1rem solid #dcdcdc;text-align:center}.table tbody td:first-child{text-align:left;padding-left:1.4rem}.table.nested tbody td:first-child{padding-left:1rem}.table tbody tr:hover{background-color:#f5f5f5!important;transition:background-color .3s ease}.table.nested tbody tr:hover{background-color:#f0f0f0!important}.pagination-controls{display:flex;justify-content:center;align-items:center;margin-top:1rem}.pagination-controls.nested{font-size:.7rem;transform:scale(.7);margin-top:.5rem}.data-table-header{display:flex;justify-content:space-between;align-items:center;margin-bottom:1rem}.left-section{display:flex;align-items:center}.items-per-page-label{font-family:var(--font-family);font-size:14px;color:#666;margin-right:.5rem}.custom-select{font-family:var(--font-family);font-size:14px;padding:.375rem 1.75rem .375rem .75rem;border:1px solid #ccc;border-radius:.25rem;appearance:none;background:#fff url('data:image/svg+xml;charset=US-ASCII,<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 4 5\"><path fill=\"#666\" d=\"M2 0L0 2h4L2 0zM2 5l2-2H0l2 2z\"/></svg>') no-repeat right .75rem center/8px 10px}.custom-select:focus{border-color:#80bdff;outline:none;box-shadow:0 0 0 .2rem #007bff40}\n"] }]
|
1706
|
+
}], ctorParameters: function () { return []; }, propDecorators: { config: [{
|
1707
|
+
type: Input
|
1708
|
+
}], itemsPerPageOptions: [{
|
1709
|
+
type: Input
|
1710
|
+
}], showPageInfo: [{
|
1711
|
+
type: Input
|
1712
|
+
}] } });
|
1713
|
+
|
1528
1714
|
class FileUploadComponent {
|
1529
1715
|
constructor(authService) {
|
1530
1716
|
this.authService = authService;
|
@@ -2056,6 +2242,98 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
2056
2242
|
type: Output
|
2057
2243
|
}] } });
|
2058
2244
|
|
2245
|
+
class JsonViewerComponent {
|
2246
|
+
constructor() {
|
2247
|
+
this.isRoot = true;
|
2248
|
+
this.allExpanded = true;
|
2249
|
+
this.expandedMap = new Map();
|
2250
|
+
}
|
2251
|
+
toggleAll() {
|
2252
|
+
this.allExpanded = !this.allExpanded;
|
2253
|
+
this.expandedMap.clear();
|
2254
|
+
}
|
2255
|
+
toggleExpand(key) {
|
2256
|
+
const currentState = this.isExpanded(key);
|
2257
|
+
this.expandedMap.set(key, !currentState);
|
2258
|
+
}
|
2259
|
+
isObject(val) {
|
2260
|
+
return val !== null && typeof val === 'object';
|
2261
|
+
}
|
2262
|
+
objectKeys(obj) {
|
2263
|
+
return Object.keys(obj);
|
2264
|
+
}
|
2265
|
+
isExpanded(key) {
|
2266
|
+
return this.expandedMap.has(key) ? this.expandedMap.get(key) : this.allExpanded;
|
2267
|
+
}
|
2268
|
+
copyJson() {
|
2269
|
+
const jsonString = JSON.stringify(this.jsonData, null, 2);
|
2270
|
+
navigator.clipboard.writeText(jsonString).then(() => {
|
2271
|
+
alert('JSON copiado com sucesso!');
|
2272
|
+
}).catch(err => {
|
2273
|
+
console.error('Error copying JSON to clipboard:', err);
|
2274
|
+
});
|
2275
|
+
}
|
2276
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: JsonViewerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
2277
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: JsonViewerComponent, selector: "argenta-json-viewer", inputs: { jsonData: "jsonData", isRoot: "isRoot", copyLabel: "copyLabel", showLabel: "showLabel", hideLabel: "hideLabel" }, ngImport: i0, template: "<div class=\"json-viewer-box\">\n <div class=\"toolbar\">\n <button\n *ngIf=\"isRoot\"\n class=\"action-button copy-button\"\n (click)=\"copyJson()\"\n >\n {{ copyLabel }}\n </button>\n <button\n *ngIf=\"isRoot\"\n class=\"action-button toggle-button\"\n (click)=\"toggleAll()\"\n >\n {{ allExpanded ? \"\u25BC \" + hideLabel : \"\u25BA \" + showLabel }}\n </button>\n </div>\n\n <div class=\"json-content\">\n <div *ngIf=\"isObject(jsonData)\">\n <div class=\"json-pair\" *ngFor=\"let key of objectKeys(jsonData)\">\n <span class=\"key\">\n {{ key }}:\n <button class=\"minimal-toggle-button\" (click)=\"toggleExpand(key)\">\n {{ isExpanded(key) ? \"\u25BC\" : \"\u25BA\" }}\n </button>\n </span>\n\n <div class=\"nested-json\" *ngIf=\"isExpanded(key)\">\n <argenta-json-viewer\n [jsonData]=\"jsonData[key]\"\n [isRoot]=\"false\"\n ></argenta-json-viewer>\n </div>\n <span *ngIf=\"!isExpanded(key) && isObject(jsonData[key])\">[...]</span>\n </div>\n </div>\n <span *ngIf=\"!isObject(jsonData)\">\n {{ jsonData }}\n </span>\n </div>\n</div>\n", styles: [".json-viewer-box{border:1px solid #ccc;padding:10px;border-radius:8px;font-family:Arial,sans-serif;background-color:#f9f9f9}.json-viewer-box .toolbar{display:flex;justify-content:space-between;align-items:center;margin-bottom:10px;padding-bottom:5px;border-bottom:1px solid #ddd}.json-viewer-box .action-button{background-color:#4caf50;color:#fff;border:none;padding:8px 16px;font-size:14px;border-radius:4px;cursor:pointer;transition:background-color .3s ease}.json-viewer-box .action-button:hover{background-color:#45a049}.json-viewer-box .minimal-toggle-button{background:none;border:none;color:#007bff;cursor:pointer;font-size:12px;margin-left:5px;padding:0;line-height:1}.json-viewer-box .minimal-toggle-button:hover{color:#0056b3}.json-viewer-box .json-content{margin-top:10px}.json-viewer-box .json-content .json-pair{margin-bottom:5px}.json-viewer-box .json-content .json-pair .key{font-weight:700;margin-right:5px;display:flex;align-items:center}\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: "component", type: JsonViewerComponent, selector: "argenta-json-viewer", inputs: ["jsonData", "isRoot", "copyLabel", "showLabel", "hideLabel"] }] }); }
|
2278
|
+
}
|
2279
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: JsonViewerComponent, decorators: [{
|
2280
|
+
type: Component,
|
2281
|
+
args: [{ selector: 'argenta-json-viewer', template: "<div class=\"json-viewer-box\">\n <div class=\"toolbar\">\n <button\n *ngIf=\"isRoot\"\n class=\"action-button copy-button\"\n (click)=\"copyJson()\"\n >\n {{ copyLabel }}\n </button>\n <button\n *ngIf=\"isRoot\"\n class=\"action-button toggle-button\"\n (click)=\"toggleAll()\"\n >\n {{ allExpanded ? \"\u25BC \" + hideLabel : \"\u25BA \" + showLabel }}\n </button>\n </div>\n\n <div class=\"json-content\">\n <div *ngIf=\"isObject(jsonData)\">\n <div class=\"json-pair\" *ngFor=\"let key of objectKeys(jsonData)\">\n <span class=\"key\">\n {{ key }}:\n <button class=\"minimal-toggle-button\" (click)=\"toggleExpand(key)\">\n {{ isExpanded(key) ? \"\u25BC\" : \"\u25BA\" }}\n </button>\n </span>\n\n <div class=\"nested-json\" *ngIf=\"isExpanded(key)\">\n <argenta-json-viewer\n [jsonData]=\"jsonData[key]\"\n [isRoot]=\"false\"\n ></argenta-json-viewer>\n </div>\n <span *ngIf=\"!isExpanded(key) && isObject(jsonData[key])\">[...]</span>\n </div>\n </div>\n <span *ngIf=\"!isObject(jsonData)\">\n {{ jsonData }}\n </span>\n </div>\n</div>\n", styles: [".json-viewer-box{border:1px solid #ccc;padding:10px;border-radius:8px;font-family:Arial,sans-serif;background-color:#f9f9f9}.json-viewer-box .toolbar{display:flex;justify-content:space-between;align-items:center;margin-bottom:10px;padding-bottom:5px;border-bottom:1px solid #ddd}.json-viewer-box .action-button{background-color:#4caf50;color:#fff;border:none;padding:8px 16px;font-size:14px;border-radius:4px;cursor:pointer;transition:background-color .3s ease}.json-viewer-box .action-button:hover{background-color:#45a049}.json-viewer-box .minimal-toggle-button{background:none;border:none;color:#007bff;cursor:pointer;font-size:12px;margin-left:5px;padding:0;line-height:1}.json-viewer-box .minimal-toggle-button:hover{color:#0056b3}.json-viewer-box .json-content{margin-top:10px}.json-viewer-box .json-content .json-pair{margin-bottom:5px}.json-viewer-box .json-content .json-pair .key{font-weight:700;margin-right:5px;display:flex;align-items:center}\n"] }]
|
2282
|
+
}], propDecorators: { jsonData: [{
|
2283
|
+
type: Input
|
2284
|
+
}], isRoot: [{
|
2285
|
+
type: Input
|
2286
|
+
}], copyLabel: [{
|
2287
|
+
type: Input
|
2288
|
+
}], showLabel: [{
|
2289
|
+
type: Input
|
2290
|
+
}], hideLabel: [{
|
2291
|
+
type: Input
|
2292
|
+
}] } });
|
2293
|
+
|
2294
|
+
class ModalComponent {
|
2295
|
+
constructor(activeModal) {
|
2296
|
+
this.activeModal = activeModal;
|
2297
|
+
this.onButtonClick = new EventEmitter(); // Novo evento
|
2298
|
+
}
|
2299
|
+
ngOnInit() {
|
2300
|
+
const componentRef = this.dynamicComponent.createComponent(this.component);
|
2301
|
+
const instance = componentRef.instance;
|
2302
|
+
if (this.componentInputs) {
|
2303
|
+
Object.keys(this.componentInputs).forEach(inputName => {
|
2304
|
+
instance[inputName] = this.componentInputs[inputName];
|
2305
|
+
});
|
2306
|
+
}
|
2307
|
+
}
|
2308
|
+
closeModal() {
|
2309
|
+
this.activeModal.close();
|
2310
|
+
}
|
2311
|
+
buttonClicked() {
|
2312
|
+
this.onButtonClick.emit(); // Emitindo o evento
|
2313
|
+
}
|
2314
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: ModalComponent, deps: [{ token: i1$1.NgbActiveModal }], target: i0.ɵɵFactoryTarget.Component }); }
|
2315
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: ModalComponent, selector: "argenta-modal", inputs: { title: "title", component: "component", componentInputs: "componentInputs", closeButtonLabel: "closeButtonLabel", buttonLabel: "buttonLabel" }, outputs: { onButtonClick: "onButtonClick" }, viewQueries: [{ propertyName: "dynamicComponent", first: true, predicate: ["dynamicComponent"], descendants: true, read: ViewContainerRef, static: true }], ngImport: i0, template: "<div class=\"modal-header custom-modal-header\">\n <h4 class=\"modal-title\">{{ title }}</h4>\n <p class=\"float-right close-modal\" (click)=\"closeModal()\">X</p>\n</div>\n<div class=\"modal-body\">\n <ng-container #dynamicComponent></ng-container>\n</div>\n<div class=\"modal-footer\">\n <button class=\"btn btn-secondary\" (click)=\"closeModal()\">\n {{ closeButtonLabel }}\n </button>\n <button *ngIf=\"buttonLabel\" class=\"btn btn-custom\" (click)=\"buttonClicked()\">\n {{ buttonLabel }}\n </button>\n</div>\n", styles: [".modal-content{border-radius:15px;overflow:hidden}.custom-modal-header{background-color:var(--primary-color);color:var(--text-color);border-bottom:none;font-family:var(--font-family);display:flex;justify-content:space-between;align-items:center;padding:1rem}.modal-title{color:var(--text-color);font-size:20px}.close-modal{margin:0;cursor:pointer;font-size:1.5rem;color:var(--text-color)}.close-modal:hover{color:#ccc}.modal-footer{border-top:none}.btn-custom{background-color:var(--primary-color);color:var(--text-color);border-bottom:none}\n"], dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] }); }
|
2316
|
+
}
|
2317
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: ModalComponent, decorators: [{
|
2318
|
+
type: Component,
|
2319
|
+
args: [{ selector: 'argenta-modal', template: "<div class=\"modal-header custom-modal-header\">\n <h4 class=\"modal-title\">{{ title }}</h4>\n <p class=\"float-right close-modal\" (click)=\"closeModal()\">X</p>\n</div>\n<div class=\"modal-body\">\n <ng-container #dynamicComponent></ng-container>\n</div>\n<div class=\"modal-footer\">\n <button class=\"btn btn-secondary\" (click)=\"closeModal()\">\n {{ closeButtonLabel }}\n </button>\n <button *ngIf=\"buttonLabel\" class=\"btn btn-custom\" (click)=\"buttonClicked()\">\n {{ buttonLabel }}\n </button>\n</div>\n", styles: [".modal-content{border-radius:15px;overflow:hidden}.custom-modal-header{background-color:var(--primary-color);color:var(--text-color);border-bottom:none;font-family:var(--font-family);display:flex;justify-content:space-between;align-items:center;padding:1rem}.modal-title{color:var(--text-color);font-size:20px}.close-modal{margin:0;cursor:pointer;font-size:1.5rem;color:var(--text-color)}.close-modal:hover{color:#ccc}.modal-footer{border-top:none}.btn-custom{background-color:var(--primary-color);color:var(--text-color);border-bottom:none}\n"] }]
|
2320
|
+
}], ctorParameters: function () { return [{ type: i1$1.NgbActiveModal }]; }, propDecorators: { title: [{
|
2321
|
+
type: Input
|
2322
|
+
}], component: [{
|
2323
|
+
type: Input
|
2324
|
+
}], componentInputs: [{
|
2325
|
+
type: Input
|
2326
|
+
}], closeButtonLabel: [{
|
2327
|
+
type: Input
|
2328
|
+
}], buttonLabel: [{
|
2329
|
+
type: Input
|
2330
|
+
}], onButtonClick: [{
|
2331
|
+
type: Output
|
2332
|
+
}], dynamicComponent: [{
|
2333
|
+
type: ViewChild,
|
2334
|
+
args: ['dynamicComponent', { read: ViewContainerRef, static: true }]
|
2335
|
+
}] } });
|
2336
|
+
|
2059
2337
|
class MultiSelectComponent {
|
2060
2338
|
constructor(authService, http) {
|
2061
2339
|
this.authService = authService;
|
@@ -2814,6 +3092,8 @@ class DataTableComponent {
|
|
2814
3092
|
this.buttonLabel = "";
|
2815
3093
|
this.pagedData = [];
|
2816
3094
|
this.initialFilterField = null;
|
3095
|
+
this.buttonList = [];
|
3096
|
+
this.sortChange = new EventEmitter();
|
2817
3097
|
this.pageChange = new EventEmitter();
|
2818
3098
|
this.itemsPerPageChange = new EventEmitter();
|
2819
3099
|
this.onEditTable = new EventEmitter();
|
@@ -3007,11 +3287,11 @@ class DataTableComponent {
|
|
3007
3287
|
this.onButtonClick.emit(); // Emitindo o evento
|
3008
3288
|
}
|
3009
3289
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DataTableComponent, deps: [{ token: i0.ChangeDetectorRef }, { token: AuthService }, { token: RefreshService }], target: i0.ɵɵFactoryTarget.Component }); }
|
3010
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: DataTableComponent, selector: "argenta-list-data-table", inputs: { columns: "columns", hiddenColumns: "hiddenColumns", defaultItemsPerPage: "defaultItemsPerPage", itemsPerPageLabel: "itemsPerPageLabel", showActionColumn: "showActionColumn", actionColumnLabel: "actionColumnLabel", totalItems: "totalItems", fetchDataFunction: "fetchDataFunction", editPermissions: "editPermissions", deletePermissions: "deletePermissions", viewPermissions: "viewPermissions", showPageInfo: "showPageInfo", pageText: "pageText", ofText: "ofText", filterDescription: "filterDescription", buttonLabel: "buttonLabel", pagedData: "pagedData", initialFilterField: "initialFilterField" }, outputs: { pageChange: "pageChange", itemsPerPageChange: "itemsPerPageChange", onEditTable: "onEditTable", onDeleteTable: "onDeleteTable", onViewTable: "onViewTable", onButtonClick: "onButtonClick", filterFieldChange: "filterFieldChange" }, ngImport: i0, template: "<div class=\"data-table-header\" style=\"margin-top: 2.5rem\">\n <div class=\"left-section\">\n <div class=\"form-group\">\n <label for=\"itemsPerPageSelect\" class=\"items-per-page-label\">{{\n itemsPerPageLabel\n }}</label>\n <select\n id=\"itemsPerPageSelect\"\n class=\"form-control form-control-sm d-inline-block w-auto custom-select\"\n [(ngModel)]=\"defaultItemsPerPage\"\n (ngModelChange)=\"onItemsPerPageChange()\"\n >\n <option *ngFor=\"let option of itemsPerPageOptions\" [value]=\"option\">\n {{ option }}\n </option>\n </select>\n </div>\n </div>\n <div *ngIf=\"buttonLabel && buttonLabel.length > 0\" class=\"right-section\">\n <button class=\"custom-button\" (click)=\"onNewButtonClick()\">\n <lucide-icon name=\"plus\" [size]=\"28\" [strokeWidth]=\"1.75\"></lucide-icon>\n {{ buttonLabel }}\n </button>\n </div>\n</div>\n\n<div class=\"search-input-container\">\n <argenta-search-input\n id=\"search\"\n label=\"\"\n placeholder=\"Buscar\"\n [(ngModel)]=\"filterDescription\"\n (search)=\"onSearch($event)\"\n ></argenta-search-input>\n</div>\n\n<div class=\"table-responsive\" style=\"margin-top: 1rem\">\n <table class=\"table table-hover\">\n <thead>\n <tr>\n <ng-container *ngFor=\"let column of columns\">\n <th\n *ngIf=\"!isColumnHidden(column.prop)\"\n (click)=\"onSelectSearchField(column.prop)\"\n >\n {{ column.label }}\n <span>\n <i-lucide\n name=\"arrow-up\"\n [size]=\"14\"\n [class.selected]=\"\n column.isSearchSelected && sortDirection === 'asc'\n \"\n ></i-lucide>\n <i-lucide\n name=\"arrow-down\"\n [size]=\"14\"\n [class.selected]=\"\n column.isSearchSelected && sortDirection === 'desc'\n \"\n ></i-lucide>\n </span>\n </th>\n </ng-container>\n <th\n *ngIf=\"showActionColumn\"\n class=\"text-end\"\n style=\"padding-right: 6.3rem\"\n >\n {{ actionColumnLabel }}\n </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 {{ getNestedProperty(item, column.prop) }}\n </td>\n </ng-container>\n <td *ngIf=\"showActionColumn\" class=\"text-end\">\n <div class=\"d-flex justify-content-end\">\n <div\n *ngIf=\"\n hasPermission(editPermissions) &&\n onEditTable.observers.length > 0\n \"\n (click)=\"handleAction('edit', item, i)\"\n class=\"clickable-icon\"\n style=\"margin-right: 1.5rem\"\n >\n <lucide-icon\n name=\"square-pen\"\n [size]=\"20\"\n color=\"#2CA58D\"\n [strokeWidth]=\"1.75\"\n ></lucide-icon>\n </div>\n <div\n *ngIf=\"\n hasPermission(viewPermissions) &&\n onViewTable.observers.length > 0\n \"\n (click)=\"handleAction('view', item, i)\"\n class=\"clickable-icon\"\n style=\"margin-right: 1.5rem\"\n >\n <lucide-icon\n name=\"user-round\"\n [size]=\"20\"\n color=\"#2CA58D\"\n [strokeWidth]=\"1.75\"\n ></lucide-icon>\n </div>\n <div\n *ngIf=\"\n hasPermission(deletePermissions) &&\n onDeleteTable.observers.length > 0\n \"\n (click)=\"handleAction('delete', item, i)\"\n class=\"clickable-icon\"\n style=\"margin-right: 1.5rem\"\n >\n <i-lucide\n name=\"trash-2\"\n [size]=\"20\"\n color=\"#F26E6E\"\n [strokeWidth]=\"1.75\"\n ></i-lucide>\n </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 (pageChange)=\"onPageChange($event)\"\n >\n </custom-pagination>\n</div>\n", styles: ["@charset \"UTF-8\";.clickable-icon{cursor:pointer}:host{font-family:var(--font-family)}.data-table-header{display:flex;justify-content:space-between;align-items:center;margin-bottom:-.2rem}.left-section,.right-section{display:flex;align-items:center}.search-input-container{display:flex;justify-content:flex-start}.left-section .form-group{display:flex;align-items:center}.items-per-page-label{font-family:var(--font-family);font-size:14px;color:#666;margin-right:.2rem}.custom-select{font-family:var(--font-family);font-size:14px;color:#666;background:#fff url('data:image/svg+xml;charset=US-ASCII,<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 4 5\"><path fill=\"#666\" d=\"M2 0L0 2h4L2 0zM2 5l2-2H0l2 2z\"/></svg>') no-repeat right .75rem center/8px 10px;border:1px solid #ccc;border-radius:.25rem;padding:.375rem 1.75rem .375rem .75rem;appearance:none;-webkit-appearance:none;-moz-appearance:none}.custom-select:focus{border-color:#80bdff;outline:0;box-shadow:0 0 0 .2rem #007bff40}.table{font-family:var(--font-family);font-size:var(--table-font-size, 14px);color:var(--table-font-color, #737b7b);border-collapse:separate;border-spacing:0;border-radius:8px;overflow:hidden}.table thead tr{height:60px}.table thead th{background-color:var(--primary-color);color:var(--text-color);font-family:var(--font-family);font-size:14px;font-weight:600;padding:10px;border-bottom:.1rem solid #dcdcdc;text-align:center;line-height:2.5}.table thead th:first-child{text-align:left;padding-left:1.4rem}.table tbody td{font-family:var(--font-family);font-size:14px;color:#737b7b;padding:10px;border-bottom:.1rem solid #dcdcdc;text-align:center}.table tbody td:first-child{text-align:left;padding-left:1.4rem}.table tbody tr:last-child td{border-bottom:.1rem solid #dcdcdc}.table tbody td{border-right:none;border-left: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:0}.table tbody tr:last-child td:last-child{border-bottom-right-radius:0}.btn-icon{width:24px;height:24px;background-size:cover;display:inline-block;cursor:pointer;margin-right:16px}.pagination-controls{display:flex;justify-content:center;align-items:center;margin-top:1rem}.custom-button{display:flex;align-items:center;padding:.5rem 1rem .5rem .5rem;border-radius:.25rem;transition:background-color .3s,border-color .3s,filter .3s;font-family:var(--font-family);font-size:16px;font-weight:600;height:40px;letter-spacing:.005em;text-align:left;color:#fff;background-color:var(--secondary-color);border:none;cursor:pointer}.custom-button lucide-icon{margin-right:.5rem}.custom-button:hover{box-shadow:0 0 0 .15rem var(--secondary-color)}.custom-button:active{background-color:var(--secondary-color)}.custom-button:focus{outline:none;box-shadow:0 0 0 .15rem var(--secondary-color)}.selected{color:var(--secondary-color);stroke-width:8}\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: 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: i3.LucideAngularComponent, selector: "lucide-angular, lucide-icon, i-lucide, span-lucide", inputs: ["class", "name", "img", "color", "absoluteStrokeWidth", "size", "strokeWidth"] }, { kind: "component", type: CustomPaginationComponent, selector: "custom-pagination", inputs: ["totalItems", "itemsPerPage", "currentPage", "showPageInfo"], outputs: ["pageChange"] }, { kind: "component", type: SearchInputComponent, selector: "argenta-search-input", inputs: ["id", "label", "type", "placeholder", "value", "disabled", "readonly", "autofocus", "maxlength", "minlength", "required", "pattern", "debounceTime"], outputs: ["search", "inputChange", "change", "focus", "blur", "keyup", "keydown", "keypress"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
3290
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: DataTableComponent, selector: "argenta-list-data-table", inputs: { columns: "columns", hiddenColumns: "hiddenColumns", defaultItemsPerPage: "defaultItemsPerPage", itemsPerPageLabel: "itemsPerPageLabel", showActionColumn: "showActionColumn", actionColumnLabel: "actionColumnLabel", totalItems: "totalItems", fetchDataFunction: "fetchDataFunction", editPermissions: "editPermissions", deletePermissions: "deletePermissions", viewPermissions: "viewPermissions", showPageInfo: "showPageInfo", pageText: "pageText", ofText: "ofText", filterDescription: "filterDescription", buttonLabel: "buttonLabel", pagedData: "pagedData", initialFilterField: "initialFilterField", buttonList: "buttonList" }, outputs: { sortChange: "sortChange", pageChange: "pageChange", itemsPerPageChange: "itemsPerPageChange", onEditTable: "onEditTable", onDeleteTable: "onDeleteTable", onViewTable: "onViewTable", onButtonClick: "onButtonClick", filterFieldChange: "filterFieldChange" }, ngImport: i0, template: "<div class=\"data-table-header\" style=\"margin-top: 2.5rem\">\n <div class=\"left-section\">\n <div class=\"form-group\">\n <label for=\"itemsPerPageSelect\" class=\"items-per-page-label\">{{\n itemsPerPageLabel\n }}</label>\n <select\n id=\"itemsPerPageSelect\"\n class=\"form-control form-control-sm d-inline-block w-auto custom-select\"\n [(ngModel)]=\"defaultItemsPerPage\"\n (ngModelChange)=\"onItemsPerPageChange()\"\n >\n <option *ngFor=\"let option of itemsPerPageOptions\" [value]=\"option\">\n {{ option }}\n </option>\n </select>\n </div>\n </div>\n <div class=\"right-section\">\n <div *ngIf=\"buttonList && buttonList.length > 0\" class=\"ng-button-row\">\n <ng-container *ngFor=\"let buttonTemplate of buttonList\">\n <ng-container\n *ngTemplateOutlet=\"buttonTemplate\"\n class=\"ng-button\"\n ></ng-container>\n </ng-container>\n </div>\n <button\n *ngIf=\"buttonLabel && buttonLabel.length > 0\"\n class=\"custom-button\"\n (click)=\"onNewButtonClick()\"\n >\n <lucide-icon name=\"plus\" [size]=\"28\" [strokeWidth]=\"1.75\"></lucide-icon>\n {{ buttonLabel }}\n </button>\n </div>\n</div>\n\n<div class=\"search-input-container\">\n <argenta-search-input\n id=\"search\"\n label=\"\"\n placeholder=\"Buscar\"\n [(ngModel)]=\"filterDescription\"\n (search)=\"onSearch($event)\"\n ></argenta-search-input>\n</div>\n\n<div class=\"table-responsive\" style=\"margin-top: 1rem\">\n <table class=\"table table-hover\">\n <thead>\n <tr>\n <ng-container *ngFor=\"let column of columns\">\n <th\n *ngIf=\"!isColumnHidden(column.prop)\"\n (click)=\"onSelectSearchField(column.prop)\"\n >\n {{ column.label }}\n <span>\n <i-lucide\n name=\"arrow-up\"\n [size]=\"14\"\n [class.selected]=\"\n column.isSearchSelected && sortDirection === 'asc'\n \"\n ></i-lucide>\n <i-lucide\n name=\"arrow-down\"\n [size]=\"14\"\n [class.selected]=\"\n column.isSearchSelected && sortDirection === 'desc'\n \"\n ></i-lucide>\n </span>\n </th>\n </ng-container>\n <th\n *ngIf=\"showActionColumn\"\n class=\"text-end\"\n style=\"padding-right: 6.3rem\"\n >\n {{ actionColumnLabel }}\n </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 {{ getNestedProperty(item, column.prop) }}\n </td>\n </ng-container>\n <td *ngIf=\"showActionColumn\" class=\"text-end\">\n <div class=\"d-flex justify-content-end\">\n <div\n *ngIf=\"\n hasPermission(editPermissions) &&\n onEditTable.observers.length > 0\n \"\n (click)=\"handleAction('edit', item, i)\"\n class=\"clickable-icon\"\n style=\"margin-right: 1.5rem\"\n >\n <lucide-icon\n name=\"square-pen\"\n [size]=\"20\"\n color=\"#2CA58D\"\n [strokeWidth]=\"1.75\"\n ></lucide-icon>\n </div>\n <div\n *ngIf=\"\n hasPermission(viewPermissions) &&\n onViewTable.observers.length > 0\n \"\n (click)=\"handleAction('view', item, i)\"\n class=\"clickable-icon\"\n style=\"margin-right: 1.5rem\"\n >\n <lucide-icon\n name=\"user-round\"\n [size]=\"20\"\n color=\"#2CA58D\"\n [strokeWidth]=\"1.75\"\n ></lucide-icon>\n </div>\n <div\n *ngIf=\"\n hasPermission(deletePermissions) &&\n onDeleteTable.observers.length > 0\n \"\n (click)=\"handleAction('delete', item, i)\"\n class=\"clickable-icon\"\n style=\"margin-right: 1.5rem\"\n >\n <i-lucide\n name=\"trash-2\"\n [size]=\"20\"\n color=\"#F26E6E\"\n [strokeWidth]=\"1.75\"\n ></i-lucide>\n </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 (pageChange)=\"onPageChange($event)\"\n >\n </custom-pagination>\n</div>\n", styles: ["@charset \"UTF-8\";.clickable-icon{cursor:pointer}:host{font-family:var(--font-family)}.data-table-header{display:flex;justify-content:space-between;align-items:center;margin-bottom:-.2rem}.left-section,.right-section{display:flex;align-items:center}.search-input-container{display:flex;justify-content:flex-start}.left-section .form-group{display:flex;align-items:center}.items-per-page-label{font-family:var(--font-family);font-size:14px;color:#666;margin-right:.2rem}.custom-select{font-family:var(--font-family);font-size:14px;color:#666;background:#fff url('data:image/svg+xml;charset=US-ASCII,<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 4 5\"><path fill=\"#666\" d=\"M2 0L0 2h4L2 0zM2 5l2-2H0l2 2z\"/></svg>') no-repeat right .75rem center/8px 10px;border:1px solid #ccc;border-radius:.25rem;padding:.375rem 1.75rem .375rem .75rem;appearance:none;-webkit-appearance:none;-moz-appearance:none}.custom-select:focus{border-color:#80bdff;outline:0;box-shadow:0 0 0 .2rem #007bff40}.table{font-family:var(--font-family);font-size:var(--table-font-size, 14px);color:var(--table-font-color, #737b7b);border-collapse:separate;border-spacing:0;border-radius:8px;overflow:hidden}.table thead tr{height:60px}.table thead th{background-color:var(--primary-color);color:var(--text-color);font-family:var(--font-family);font-size:14px;font-weight:600;padding:10px;border-bottom:.1rem solid #dcdcdc;text-align:center;line-height:2.5}.table thead th:first-child{text-align:left;padding-left:1.4rem}.table tbody td{font-family:var(--font-family);font-size:14px;color:#737b7b;padding:10px;border-bottom:.1rem solid #dcdcdc;text-align:center}.table tbody td:first-child{text-align:left;padding-left:1.4rem}.table tbody tr:last-child td{border-bottom:.1rem solid #dcdcdc}.table tbody td{border-right:none;border-left: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:0}.table tbody tr:last-child td:last-child{border-bottom-right-radius:0}.btn-icon{width:24px;height:24px;background-size:cover;display:inline-block;cursor:pointer;margin-right:16px}.pagination-controls{display:flex;justify-content:center;align-items:center;margin-top:1rem}.custom-button{display:flex;align-items:center;padding:.5rem 1rem .5rem .5rem;border-radius:.25rem;transition:background-color .3s,border-color .3s,filter .3s;font-family:var(--font-family);font-size:16px;font-weight:600;height:40px;letter-spacing:.005em;text-align:left;color:#fff;background-color:var(--secondary-color);border:none;cursor:pointer}.custom-button lucide-icon{margin-right:.5rem}.custom-button:hover{box-shadow:0 0 0 .15rem var(--secondary-color)}.custom-button:active{background-color:var(--secondary-color)}.custom-button:focus{outline:none;box-shadow:0 0 0 .15rem var(--secondary-color)}.selected{color:var(--secondary-color);stroke-width:8}.ng-button-row{display:flex;gap:10px;margin-right:10px;margin-left:10px}\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.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { 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: i3.LucideAngularComponent, selector: "lucide-angular, lucide-icon, i-lucide, span-lucide", inputs: ["class", "name", "img", "color", "absoluteStrokeWidth", "size", "strokeWidth"] }, { kind: "component", type: CustomPaginationComponent, selector: "custom-pagination", inputs: ["totalItems", "itemsPerPage", "currentPage", "showPageInfo"], outputs: ["pageChange"] }, { kind: "component", type: SearchInputComponent, selector: "argenta-search-input", inputs: ["id", "label", "type", "placeholder", "value", "disabled", "readonly", "autofocus", "maxlength", "minlength", "required", "pattern", "debounceTime"], outputs: ["search", "inputChange", "change", "focus", "blur", "keyup", "keydown", "keypress"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
3011
3291
|
}
|
3012
3292
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DataTableComponent, decorators: [{
|
3013
3293
|
type: Component,
|
3014
|
-
args: [{ selector: "argenta-list-data-table", changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"data-table-header\" style=\"margin-top: 2.5rem\">\n <div class=\"left-section\">\n <div class=\"form-group\">\n <label for=\"itemsPerPageSelect\" class=\"items-per-page-label\">{{\n itemsPerPageLabel\n }}</label>\n <select\n id=\"itemsPerPageSelect\"\n class=\"form-control form-control-sm d-inline-block w-auto custom-select\"\n [(ngModel)]=\"defaultItemsPerPage\"\n (ngModelChange)=\"onItemsPerPageChange()\"\n >\n <option *ngFor=\"let option of itemsPerPageOptions\" [value]=\"option\">\n {{ option }}\n </option>\n </select>\n </div>\n </div>\n <div *ngIf=\"
|
3294
|
+
args: [{ selector: "argenta-list-data-table", changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"data-table-header\" style=\"margin-top: 2.5rem\">\n <div class=\"left-section\">\n <div class=\"form-group\">\n <label for=\"itemsPerPageSelect\" class=\"items-per-page-label\">{{\n itemsPerPageLabel\n }}</label>\n <select\n id=\"itemsPerPageSelect\"\n class=\"form-control form-control-sm d-inline-block w-auto custom-select\"\n [(ngModel)]=\"defaultItemsPerPage\"\n (ngModelChange)=\"onItemsPerPageChange()\"\n >\n <option *ngFor=\"let option of itemsPerPageOptions\" [value]=\"option\">\n {{ option }}\n </option>\n </select>\n </div>\n </div>\n <div class=\"right-section\">\n <div *ngIf=\"buttonList && buttonList.length > 0\" class=\"ng-button-row\">\n <ng-container *ngFor=\"let buttonTemplate of buttonList\">\n <ng-container\n *ngTemplateOutlet=\"buttonTemplate\"\n class=\"ng-button\"\n ></ng-container>\n </ng-container>\n </div>\n <button\n *ngIf=\"buttonLabel && buttonLabel.length > 0\"\n class=\"custom-button\"\n (click)=\"onNewButtonClick()\"\n >\n <lucide-icon name=\"plus\" [size]=\"28\" [strokeWidth]=\"1.75\"></lucide-icon>\n {{ buttonLabel }}\n </button>\n </div>\n</div>\n\n<div class=\"search-input-container\">\n <argenta-search-input\n id=\"search\"\n label=\"\"\n placeholder=\"Buscar\"\n [(ngModel)]=\"filterDescription\"\n (search)=\"onSearch($event)\"\n ></argenta-search-input>\n</div>\n\n<div class=\"table-responsive\" style=\"margin-top: 1rem\">\n <table class=\"table table-hover\">\n <thead>\n <tr>\n <ng-container *ngFor=\"let column of columns\">\n <th\n *ngIf=\"!isColumnHidden(column.prop)\"\n (click)=\"onSelectSearchField(column.prop)\"\n >\n {{ column.label }}\n <span>\n <i-lucide\n name=\"arrow-up\"\n [size]=\"14\"\n [class.selected]=\"\n column.isSearchSelected && sortDirection === 'asc'\n \"\n ></i-lucide>\n <i-lucide\n name=\"arrow-down\"\n [size]=\"14\"\n [class.selected]=\"\n column.isSearchSelected && sortDirection === 'desc'\n \"\n ></i-lucide>\n </span>\n </th>\n </ng-container>\n <th\n *ngIf=\"showActionColumn\"\n class=\"text-end\"\n style=\"padding-right: 6.3rem\"\n >\n {{ actionColumnLabel }}\n </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 {{ getNestedProperty(item, column.prop) }}\n </td>\n </ng-container>\n <td *ngIf=\"showActionColumn\" class=\"text-end\">\n <div class=\"d-flex justify-content-end\">\n <div\n *ngIf=\"\n hasPermission(editPermissions) &&\n onEditTable.observers.length > 0\n \"\n (click)=\"handleAction('edit', item, i)\"\n class=\"clickable-icon\"\n style=\"margin-right: 1.5rem\"\n >\n <lucide-icon\n name=\"square-pen\"\n [size]=\"20\"\n color=\"#2CA58D\"\n [strokeWidth]=\"1.75\"\n ></lucide-icon>\n </div>\n <div\n *ngIf=\"\n hasPermission(viewPermissions) &&\n onViewTable.observers.length > 0\n \"\n (click)=\"handleAction('view', item, i)\"\n class=\"clickable-icon\"\n style=\"margin-right: 1.5rem\"\n >\n <lucide-icon\n name=\"user-round\"\n [size]=\"20\"\n color=\"#2CA58D\"\n [strokeWidth]=\"1.75\"\n ></lucide-icon>\n </div>\n <div\n *ngIf=\"\n hasPermission(deletePermissions) &&\n onDeleteTable.observers.length > 0\n \"\n (click)=\"handleAction('delete', item, i)\"\n class=\"clickable-icon\"\n style=\"margin-right: 1.5rem\"\n >\n <i-lucide\n name=\"trash-2\"\n [size]=\"20\"\n color=\"#F26E6E\"\n [strokeWidth]=\"1.75\"\n ></i-lucide>\n </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 (pageChange)=\"onPageChange($event)\"\n >\n </custom-pagination>\n</div>\n", styles: ["@charset \"UTF-8\";.clickable-icon{cursor:pointer}:host{font-family:var(--font-family)}.data-table-header{display:flex;justify-content:space-between;align-items:center;margin-bottom:-.2rem}.left-section,.right-section{display:flex;align-items:center}.search-input-container{display:flex;justify-content:flex-start}.left-section .form-group{display:flex;align-items:center}.items-per-page-label{font-family:var(--font-family);font-size:14px;color:#666;margin-right:.2rem}.custom-select{font-family:var(--font-family);font-size:14px;color:#666;background:#fff url('data:image/svg+xml;charset=US-ASCII,<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 4 5\"><path fill=\"#666\" d=\"M2 0L0 2h4L2 0zM2 5l2-2H0l2 2z\"/></svg>') no-repeat right .75rem center/8px 10px;border:1px solid #ccc;border-radius:.25rem;padding:.375rem 1.75rem .375rem .75rem;appearance:none;-webkit-appearance:none;-moz-appearance:none}.custom-select:focus{border-color:#80bdff;outline:0;box-shadow:0 0 0 .2rem #007bff40}.table{font-family:var(--font-family);font-size:var(--table-font-size, 14px);color:var(--table-font-color, #737b7b);border-collapse:separate;border-spacing:0;border-radius:8px;overflow:hidden}.table thead tr{height:60px}.table thead th{background-color:var(--primary-color);color:var(--text-color);font-family:var(--font-family);font-size:14px;font-weight:600;padding:10px;border-bottom:.1rem solid #dcdcdc;text-align:center;line-height:2.5}.table thead th:first-child{text-align:left;padding-left:1.4rem}.table tbody td{font-family:var(--font-family);font-size:14px;color:#737b7b;padding:10px;border-bottom:.1rem solid #dcdcdc;text-align:center}.table tbody td:first-child{text-align:left;padding-left:1.4rem}.table tbody tr:last-child td{border-bottom:.1rem solid #dcdcdc}.table tbody td{border-right:none;border-left: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:0}.table tbody tr:last-child td:last-child{border-bottom-right-radius:0}.btn-icon{width:24px;height:24px;background-size:cover;display:inline-block;cursor:pointer;margin-right:16px}.pagination-controls{display:flex;justify-content:center;align-items:center;margin-top:1rem}.custom-button{display:flex;align-items:center;padding:.5rem 1rem .5rem .5rem;border-radius:.25rem;transition:background-color .3s,border-color .3s,filter .3s;font-family:var(--font-family);font-size:16px;font-weight:600;height:40px;letter-spacing:.005em;text-align:left;color:#fff;background-color:var(--secondary-color);border:none;cursor:pointer}.custom-button lucide-icon{margin-right:.5rem}.custom-button:hover{box-shadow:0 0 0 .15rem var(--secondary-color)}.custom-button:active{background-color:var(--secondary-color)}.custom-button:focus{outline:none;box-shadow:0 0 0 .15rem var(--secondary-color)}.selected{color:var(--secondary-color);stroke-width:8}.ng-button-row{display:flex;gap:10px;margin-right:10px;margin-left:10px}\n"] }]
|
3015
3295
|
}], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }, { type: AuthService }, { type: RefreshService }]; }, propDecorators: { columns: [{
|
3016
3296
|
type: Input
|
3017
3297
|
}], hiddenColumns: [{
|
@@ -3048,6 +3328,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
3048
3328
|
type: Input
|
3049
3329
|
}], initialFilterField: [{
|
3050
3330
|
type: Input
|
3331
|
+
}], buttonList: [{
|
3332
|
+
type: Input
|
3333
|
+
}], sortChange: [{
|
3334
|
+
type: Output
|
3051
3335
|
}], pageChange: [{
|
3052
3336
|
type: Output
|
3053
3337
|
}], itemsPerPageChange: [{
|
@@ -3307,200 +3591,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
3307
3591
|
type: Output
|
3308
3592
|
}] } });
|
3309
3593
|
|
3310
|
-
class JsonViewerComponent {
|
3311
|
-
constructor() {
|
3312
|
-
this.isRoot = true;
|
3313
|
-
this.allExpanded = true;
|
3314
|
-
this.expandedMap = new Map();
|
3315
|
-
}
|
3316
|
-
toggleAll() {
|
3317
|
-
this.allExpanded = !this.allExpanded;
|
3318
|
-
this.expandedMap.clear();
|
3319
|
-
}
|
3320
|
-
toggleExpand(key) {
|
3321
|
-
const currentState = this.isExpanded(key);
|
3322
|
-
this.expandedMap.set(key, !currentState);
|
3323
|
-
}
|
3324
|
-
isObject(val) {
|
3325
|
-
return val !== null && typeof val === 'object';
|
3326
|
-
}
|
3327
|
-
objectKeys(obj) {
|
3328
|
-
return Object.keys(obj);
|
3329
|
-
}
|
3330
|
-
isExpanded(key) {
|
3331
|
-
return this.expandedMap.has(key) ? this.expandedMap.get(key) : this.allExpanded;
|
3332
|
-
}
|
3333
|
-
copyJson() {
|
3334
|
-
const jsonString = JSON.stringify(this.jsonData, null, 2);
|
3335
|
-
navigator.clipboard.writeText(jsonString).then(() => {
|
3336
|
-
alert('JSON copiado com sucesso!');
|
3337
|
-
}).catch(err => {
|
3338
|
-
console.error('Error copying JSON to clipboard:', err);
|
3339
|
-
});
|
3340
|
-
}
|
3341
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: JsonViewerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
3342
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: JsonViewerComponent, selector: "argenta-json-viewer", inputs: { jsonData: "jsonData", isRoot: "isRoot", copyLabel: "copyLabel", showLabel: "showLabel", hideLabel: "hideLabel" }, ngImport: i0, template: "<div class=\"json-viewer-box\">\n <div class=\"toolbar\">\n <button\n *ngIf=\"isRoot\"\n class=\"action-button copy-button\"\n (click)=\"copyJson()\"\n >\n {{ copyLabel }}\n </button>\n <button\n *ngIf=\"isRoot\"\n class=\"action-button toggle-button\"\n (click)=\"toggleAll()\"\n >\n {{ allExpanded ? \"\u25BC \" + hideLabel : \"\u25BA \" + showLabel }}\n </button>\n </div>\n\n <div class=\"json-content\">\n <div *ngIf=\"isObject(jsonData)\">\n <div class=\"json-pair\" *ngFor=\"let key of objectKeys(jsonData)\">\n <span class=\"key\">\n {{ key }}:\n <button class=\"minimal-toggle-button\" (click)=\"toggleExpand(key)\">\n {{ isExpanded(key) ? \"\u25BC\" : \"\u25BA\" }}\n </button>\n </span>\n\n <div class=\"nested-json\" *ngIf=\"isExpanded(key)\">\n <argenta-json-viewer\n [jsonData]=\"jsonData[key]\"\n [isRoot]=\"false\"\n ></argenta-json-viewer>\n </div>\n <span *ngIf=\"!isExpanded(key) && isObject(jsonData[key])\">[...]</span>\n </div>\n </div>\n <span *ngIf=\"!isObject(jsonData)\">\n {{ jsonData }}\n </span>\n </div>\n</div>\n", styles: [".json-viewer-box{border:1px solid #ccc;padding:10px;border-radius:8px;font-family:Arial,sans-serif;background-color:#f9f9f9}.json-viewer-box .toolbar{display:flex;justify-content:space-between;align-items:center;margin-bottom:10px;padding-bottom:5px;border-bottom:1px solid #ddd}.json-viewer-box .action-button{background-color:#4caf50;color:#fff;border:none;padding:8px 16px;font-size:14px;border-radius:4px;cursor:pointer;transition:background-color .3s ease}.json-viewer-box .action-button:hover{background-color:#45a049}.json-viewer-box .minimal-toggle-button{background:none;border:none;color:#007bff;cursor:pointer;font-size:12px;margin-left:5px;padding:0;line-height:1}.json-viewer-box .minimal-toggle-button:hover{color:#0056b3}.json-viewer-box .json-content{margin-top:10px}.json-viewer-box .json-content .json-pair{margin-bottom:5px}.json-viewer-box .json-content .json-pair .key{font-weight:700;margin-right:5px;display:flex;align-items:center}\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: "component", type: JsonViewerComponent, selector: "argenta-json-viewer", inputs: ["jsonData", "isRoot", "copyLabel", "showLabel", "hideLabel"] }] }); }
|
3343
|
-
}
|
3344
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: JsonViewerComponent, decorators: [{
|
3345
|
-
type: Component,
|
3346
|
-
args: [{ selector: 'argenta-json-viewer', template: "<div class=\"json-viewer-box\">\n <div class=\"toolbar\">\n <button\n *ngIf=\"isRoot\"\n class=\"action-button copy-button\"\n (click)=\"copyJson()\"\n >\n {{ copyLabel }}\n </button>\n <button\n *ngIf=\"isRoot\"\n class=\"action-button toggle-button\"\n (click)=\"toggleAll()\"\n >\n {{ allExpanded ? \"\u25BC \" + hideLabel : \"\u25BA \" + showLabel }}\n </button>\n </div>\n\n <div class=\"json-content\">\n <div *ngIf=\"isObject(jsonData)\">\n <div class=\"json-pair\" *ngFor=\"let key of objectKeys(jsonData)\">\n <span class=\"key\">\n {{ key }}:\n <button class=\"minimal-toggle-button\" (click)=\"toggleExpand(key)\">\n {{ isExpanded(key) ? \"\u25BC\" : \"\u25BA\" }}\n </button>\n </span>\n\n <div class=\"nested-json\" *ngIf=\"isExpanded(key)\">\n <argenta-json-viewer\n [jsonData]=\"jsonData[key]\"\n [isRoot]=\"false\"\n ></argenta-json-viewer>\n </div>\n <span *ngIf=\"!isExpanded(key) && isObject(jsonData[key])\">[...]</span>\n </div>\n </div>\n <span *ngIf=\"!isObject(jsonData)\">\n {{ jsonData }}\n </span>\n </div>\n</div>\n", styles: [".json-viewer-box{border:1px solid #ccc;padding:10px;border-radius:8px;font-family:Arial,sans-serif;background-color:#f9f9f9}.json-viewer-box .toolbar{display:flex;justify-content:space-between;align-items:center;margin-bottom:10px;padding-bottom:5px;border-bottom:1px solid #ddd}.json-viewer-box .action-button{background-color:#4caf50;color:#fff;border:none;padding:8px 16px;font-size:14px;border-radius:4px;cursor:pointer;transition:background-color .3s ease}.json-viewer-box .action-button:hover{background-color:#45a049}.json-viewer-box .minimal-toggle-button{background:none;border:none;color:#007bff;cursor:pointer;font-size:12px;margin-left:5px;padding:0;line-height:1}.json-viewer-box .minimal-toggle-button:hover{color:#0056b3}.json-viewer-box .json-content{margin-top:10px}.json-viewer-box .json-content .json-pair{margin-bottom:5px}.json-viewer-box .json-content .json-pair .key{font-weight:700;margin-right:5px;display:flex;align-items:center}\n"] }]
|
3347
|
-
}], propDecorators: { jsonData: [{
|
3348
|
-
type: Input
|
3349
|
-
}], isRoot: [{
|
3350
|
-
type: Input
|
3351
|
-
}], copyLabel: [{
|
3352
|
-
type: Input
|
3353
|
-
}], showLabel: [{
|
3354
|
-
type: Input
|
3355
|
-
}], hideLabel: [{
|
3356
|
-
type: Input
|
3357
|
-
}] } });
|
3358
|
-
|
3359
|
-
class ModalComponent {
|
3360
|
-
constructor(activeModal) {
|
3361
|
-
this.activeModal = activeModal;
|
3362
|
-
this.onButtonClick = new EventEmitter(); // Novo evento
|
3363
|
-
}
|
3364
|
-
ngOnInit() {
|
3365
|
-
const componentRef = this.dynamicComponent.createComponent(this.component);
|
3366
|
-
const instance = componentRef.instance;
|
3367
|
-
if (this.componentInputs) {
|
3368
|
-
Object.keys(this.componentInputs).forEach(inputName => {
|
3369
|
-
instance[inputName] = this.componentInputs[inputName];
|
3370
|
-
});
|
3371
|
-
}
|
3372
|
-
}
|
3373
|
-
closeModal() {
|
3374
|
-
this.activeModal.close();
|
3375
|
-
}
|
3376
|
-
buttonClicked() {
|
3377
|
-
this.onButtonClick.emit(); // Emitindo o evento
|
3378
|
-
}
|
3379
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: ModalComponent, deps: [{ token: i1$1.NgbActiveModal }], target: i0.ɵɵFactoryTarget.Component }); }
|
3380
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: ModalComponent, selector: "argenta-modal", inputs: { title: "title", component: "component", componentInputs: "componentInputs", closeButtonLabel: "closeButtonLabel", buttonLabel: "buttonLabel" }, outputs: { onButtonClick: "onButtonClick" }, viewQueries: [{ propertyName: "dynamicComponent", first: true, predicate: ["dynamicComponent"], descendants: true, read: ViewContainerRef, static: true }], ngImport: i0, template: "<div class=\"modal-header custom-modal-header\">\n <h4 class=\"modal-title\">{{ title }}</h4>\n <p class=\"float-right close-modal\" (click)=\"closeModal()\">X</p>\n</div>\n<div class=\"modal-body\">\n <ng-container #dynamicComponent></ng-container>\n</div>\n<div class=\"modal-footer\">\n <button class=\"btn btn-secondary\" (click)=\"closeModal()\">\n {{ closeButtonLabel }}\n </button>\n <button *ngIf=\"buttonLabel\" class=\"btn btn-custom\" (click)=\"buttonClicked()\">\n {{ buttonLabel }}\n </button>\n</div>\n", styles: [".modal-content{border-radius:15px;overflow:hidden}.custom-modal-header{background-color:var(--primary-color);color:var(--text-color);border-bottom:none;font-family:var(--font-family);display:flex;justify-content:space-between;align-items:center;padding:1rem}.modal-title{color:var(--text-color);font-size:20px}.close-modal{margin:0;cursor:pointer;font-size:1.5rem;color:var(--text-color)}.close-modal:hover{color:#ccc}.modal-footer{border-top:none}.btn-custom{background-color:var(--primary-color);color:var(--text-color);border-bottom:none}\n"], dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] }); }
|
3381
|
-
}
|
3382
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: ModalComponent, decorators: [{
|
3383
|
-
type: Component,
|
3384
|
-
args: [{ selector: 'argenta-modal', template: "<div class=\"modal-header custom-modal-header\">\n <h4 class=\"modal-title\">{{ title }}</h4>\n <p class=\"float-right close-modal\" (click)=\"closeModal()\">X</p>\n</div>\n<div class=\"modal-body\">\n <ng-container #dynamicComponent></ng-container>\n</div>\n<div class=\"modal-footer\">\n <button class=\"btn btn-secondary\" (click)=\"closeModal()\">\n {{ closeButtonLabel }}\n </button>\n <button *ngIf=\"buttonLabel\" class=\"btn btn-custom\" (click)=\"buttonClicked()\">\n {{ buttonLabel }}\n </button>\n</div>\n", styles: [".modal-content{border-radius:15px;overflow:hidden}.custom-modal-header{background-color:var(--primary-color);color:var(--text-color);border-bottom:none;font-family:var(--font-family);display:flex;justify-content:space-between;align-items:center;padding:1rem}.modal-title{color:var(--text-color);font-size:20px}.close-modal{margin:0;cursor:pointer;font-size:1.5rem;color:var(--text-color)}.close-modal:hover{color:#ccc}.modal-footer{border-top:none}.btn-custom{background-color:var(--primary-color);color:var(--text-color);border-bottom:none}\n"] }]
|
3385
|
-
}], ctorParameters: function () { return [{ type: i1$1.NgbActiveModal }]; }, propDecorators: { title: [{
|
3386
|
-
type: Input
|
3387
|
-
}], component: [{
|
3388
|
-
type: Input
|
3389
|
-
}], componentInputs: [{
|
3390
|
-
type: Input
|
3391
|
-
}], closeButtonLabel: [{
|
3392
|
-
type: Input
|
3393
|
-
}], buttonLabel: [{
|
3394
|
-
type: Input
|
3395
|
-
}], onButtonClick: [{
|
3396
|
-
type: Output
|
3397
|
-
}], dynamicComponent: [{
|
3398
|
-
type: ViewChild,
|
3399
|
-
args: ['dynamicComponent', { read: ViewContainerRef, static: true }]
|
3400
|
-
}] } });
|
3401
|
-
|
3402
|
-
class DynamicModalComponent {
|
3403
|
-
constructor() {
|
3404
|
-
this.modalTitle = "Modal Title";
|
3405
|
-
this.modalSizeClass = "";
|
3406
|
-
this.modalId = "dynamicModal"; // ID único para cada modal
|
3407
|
-
}
|
3408
|
-
openModal() {
|
3409
|
-
const modalElement = document.getElementById(this.modalId);
|
3410
|
-
if (modalElement) {
|
3411
|
-
modalElement.classList.add("show");
|
3412
|
-
modalElement.setAttribute("aria-hidden", "false");
|
3413
|
-
modalElement.style.display = "block";
|
3414
|
-
document.body.classList.add("modal-open");
|
3415
|
-
// Adiciona o backdrop manualmente se não existir
|
3416
|
-
if (!document.querySelector(`.modal-backdrop[data-modal-id="${this.modalId}"]`)) {
|
3417
|
-
const backdrop = document.createElement("div");
|
3418
|
-
backdrop.className = "modal-backdrop fade show";
|
3419
|
-
backdrop.setAttribute("data-modal-id", this.modalId);
|
3420
|
-
document.body.appendChild(backdrop);
|
3421
|
-
}
|
3422
|
-
}
|
3423
|
-
}
|
3424
|
-
closeModal() {
|
3425
|
-
const modalElement = document.getElementById(this.modalId);
|
3426
|
-
if (modalElement) {
|
3427
|
-
modalElement.classList.remove("show");
|
3428
|
-
modalElement.setAttribute("aria-hidden", "true");
|
3429
|
-
modalElement.style.display = "none";
|
3430
|
-
document.body.classList.remove("modal-open");
|
3431
|
-
document
|
3432
|
-
.querySelector(`.modal-backdrop[data-modal-id="${this.modalId}"]`)
|
3433
|
-
?.remove();
|
3434
|
-
}
|
3435
|
-
}
|
3436
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DynamicModalComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
3437
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: DynamicModalComponent, selector: "argenta-dynamic-modal", inputs: { modalTitle: "modalTitle", modalSizeClass: "modalSizeClass", modalId: "modalId" }, ngImport: i0, template: "<div\n class=\"modal fade\"\n [id]=\"modalId\"\n tabindex=\"-1\"\n [attr.aria-labelledby]=\"modalId + 'Label'\"\n aria-hidden=\"true\"\n>\n <div class=\"modal-dialog\" [ngClass]=\"modalSizeClass\">\n <div class=\"modal-content\">\n <div class=\"modal-header custom-header\">\n <h5 class=\"modal-title custom-modal-title\" [id]=\"modalId + 'Label'\">\n {{ modalTitle }}\n </h5>\n <button\n type=\"button\"\n class=\"custom-close-button\"\n (click)=\"closeModal()\"\n aria-label=\"Close\"\n >\n ×\n </button>\n </div>\n <div class=\"modal-body custom-body\">\n <ng-content select=\"[modal-body]\"></ng-content>\n </div>\n <div class=\"modal-footer custom-footer\">\n <ng-content select=\"[modal-footer]\"></ng-content>\n </div>\n </div>\n </div>\n</div>\n", styles: [".custom-header{background-color:var(--primary-color)!important;color:var(--text-color)!important;font-size:1.25rem!important;font-family:var(--font-family)!important;padding:1rem;position:relative}.custom-header .custom-close-button{position:absolute;right:1rem;background:none;border:none;font-size:2.5rem;color:var(--text-color);cursor:pointer}.custom-header .custom-close-button:hover{color:var(--danger-color)}.custom-modal-title{color:var(--text-color)!important;font-size:1.8rem!important;font-family:var(--font-family)!important}.custom-body{background-color:#fff;padding:1rem}.custom-footer{background-color:#fff;padding:.75rem;display:flex;justify-content:flex-end;gap:.5rem}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }] }); }
|
3438
|
-
}
|
3439
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DynamicModalComponent, decorators: [{
|
3440
|
-
type: Component,
|
3441
|
-
args: [{ selector: "argenta-dynamic-modal", template: "<div\n class=\"modal fade\"\n [id]=\"modalId\"\n tabindex=\"-1\"\n [attr.aria-labelledby]=\"modalId + 'Label'\"\n aria-hidden=\"true\"\n>\n <div class=\"modal-dialog\" [ngClass]=\"modalSizeClass\">\n <div class=\"modal-content\">\n <div class=\"modal-header custom-header\">\n <h5 class=\"modal-title custom-modal-title\" [id]=\"modalId + 'Label'\">\n {{ modalTitle }}\n </h5>\n <button\n type=\"button\"\n class=\"custom-close-button\"\n (click)=\"closeModal()\"\n aria-label=\"Close\"\n >\n ×\n </button>\n </div>\n <div class=\"modal-body custom-body\">\n <ng-content select=\"[modal-body]\"></ng-content>\n </div>\n <div class=\"modal-footer custom-footer\">\n <ng-content select=\"[modal-footer]\"></ng-content>\n </div>\n </div>\n </div>\n</div>\n", styles: [".custom-header{background-color:var(--primary-color)!important;color:var(--text-color)!important;font-size:1.25rem!important;font-family:var(--font-family)!important;padding:1rem;position:relative}.custom-header .custom-close-button{position:absolute;right:1rem;background:none;border:none;font-size:2.5rem;color:var(--text-color);cursor:pointer}.custom-header .custom-close-button:hover{color:var(--danger-color)}.custom-modal-title{color:var(--text-color)!important;font-size:1.8rem!important;font-family:var(--font-family)!important}.custom-body{background-color:#fff;padding:1rem}.custom-footer{background-color:#fff;padding:.75rem;display:flex;justify-content:flex-end;gap:.5rem}\n"] }]
|
3442
|
-
}], propDecorators: { modalTitle: [{
|
3443
|
-
type: Input
|
3444
|
-
}], modalSizeClass: [{
|
3445
|
-
type: Input
|
3446
|
-
}], modalId: [{
|
3447
|
-
type: Input
|
3448
|
-
}] } });
|
3449
|
-
|
3450
|
-
class DynamicTableComponent {
|
3451
|
-
constructor() {
|
3452
|
-
this.itemsPerPageOptions = [10, 20, 50];
|
3453
|
-
this.showPageInfo = true;
|
3454
|
-
this.currentPage = 1;
|
3455
|
-
this.itemsPerPage = 10;
|
3456
|
-
}
|
3457
|
-
get totalItems() {
|
3458
|
-
return this.config.totalItems ?? this.config.data.length;
|
3459
|
-
}
|
3460
|
-
get paginatedData() {
|
3461
|
-
if (!this.config.pagination) {
|
3462
|
-
// Retorna todos os dados se a paginação estiver desativada
|
3463
|
-
return this.config.data;
|
3464
|
-
}
|
3465
|
-
const itemsPerPage = this.config.itemsPerPage || this.itemsPerPage;
|
3466
|
-
const startIndex = (this.currentPage - 1) * itemsPerPage;
|
3467
|
-
return this.config.data.slice(startIndex, startIndex + itemsPerPage);
|
3468
|
-
}
|
3469
|
-
ngOnInit() {
|
3470
|
-
if (!this.config || !this.config.columns || !this.config.data) {
|
3471
|
-
throw new Error("DynamicTableComponent: Configuração inválida.");
|
3472
|
-
}
|
3473
|
-
// Define valores padrão se não especificados
|
3474
|
-
this.config.showHeader = this.config.showHeader ?? true; // Exibe o cabeçalho por padrão
|
3475
|
-
this.config.pagination = this.config.pagination ?? true; // Ativa paginação por padrão
|
3476
|
-
this.itemsPerPage = this.config.itemsPerPage || 10;
|
3477
|
-
}
|
3478
|
-
onPageChange(newPage) {
|
3479
|
-
this.currentPage = newPage;
|
3480
|
-
}
|
3481
|
-
onItemsPerPageChange(event) {
|
3482
|
-
const target = event.target;
|
3483
|
-
this.itemsPerPage = +target.value;
|
3484
|
-
this.currentPage = 1; // Reinicia a paginação ao alterar os itens por página
|
3485
|
-
}
|
3486
|
-
// Getter para garantir que totalItems nunca seja undefined
|
3487
|
-
get safeTotalItems() {
|
3488
|
-
return this.totalItems || 0;
|
3489
|
-
}
|
3490
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DynamicTableComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
3491
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: DynamicTableComponent, selector: "argenta-dynamic-table", inputs: { config: "config", itemsPerPageOptions: "itemsPerPageOptions", showPageInfo: "showPageInfo" }, ngImport: i0, template: "<table class=\"table\" [ngClass]=\"{ nested: config.isNested }\">\n <thead *ngIf=\"config.showHeader\">\n <tr>\n <th *ngFor=\"let column of config.columns\">{{ column.header }}</th>\n </tr>\n </thead>\n <tbody>\n <tr *ngFor=\"let row of paginatedData\">\n <td *ngFor=\"let column of config.columns\">\n <ng-container [ngSwitch]=\"column.type\">\n <span *ngSwitchCase=\"'text'\">{{ row[column.key] }}</span>\n <ng-container *ngSwitchCase=\"'template'\">\n <ng-container\n *ngTemplateOutlet=\"\n column.template || null;\n context: { $implicit: row }\n \"\n ></ng-container>\n </ng-container>\n </ng-container>\n </td>\n </tr>\n </tbody>\n</table>\n\n<div\n class=\"text-center pagination-controls\"\n [ngClass]=\"{ nested: config.isNested }\"\n *ngIf=\"config.pagination\"\n>\n <custom-pagination\n [totalItems]=\"safeTotalItems\"\n [itemsPerPage]=\"itemsPerPage\"\n [currentPage]=\"currentPage\"\n [showPageInfo]=\"showPageInfo\"\n (pageChange)=\"onPageChange($event)\"\n >\n </custom-pagination>\n</div>\n", styles: ["@charset \"UTF-8\";.table{width:100%;border-collapse:collapse;border-spacing:0}.table{width:100%;border-collapse:separate;border-spacing:0;overflow:hidden}.table thead th{background-color:var(--primary-color);color:var(--text-color);font-family:var(--font-family);font-size:14px;font-weight:600;padding:10px;border-bottom:.1rem solid #dcdcdc;text-align:center;line-height:2.5}.table thead th:first-child{border-top-left-radius:10px}.table thead th:last-child{border-top-right-radius:10px}.table.nested thead th{font-size:.7rem;padding:7px;line-height:.8}.table tbody td{font-family:var(--font-family);font-size:14px;color:#737b7b;padding:10px;border-bottom:.1rem solid #dcdcdc;text-align:center}.table tbody td:first-child{text-align:left;padding-left:1.4rem}.table.nested tbody td:first-child{padding-left:1rem}.table tbody tr:hover{background-color:#f5f5f5!important;transition:background-color .3s ease}.table.nested tbody tr:hover{background-color:#f0f0f0!important}.pagination-controls{display:flex;justify-content:center;align-items:center;margin-top:1rem}.pagination-controls.nested{font-size:.7rem;transform:scale(.7);margin-top:.5rem}.data-table-header{display:flex;justify-content:space-between;align-items:center;margin-bottom:1rem}.left-section{display:flex;align-items:center}.items-per-page-label{font-family:var(--font-family);font-size:14px;color:#666;margin-right:.5rem}.custom-select{font-family:var(--font-family);font-size:14px;padding:.375rem 1.75rem .375rem .75rem;border:1px solid #ccc;border-radius:.25rem;appearance:none;background:#fff url('data:image/svg+xml;charset=US-ASCII,<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 4 5\"><path fill=\"#666\" d=\"M2 0L0 2h4L2 0zM2 5l2-2H0l2 2z\"/></svg>') no-repeat right .75rem center/8px 10px}.custom-select:focus{border-color:#80bdff;outline:none;box-shadow:0 0 0 .2rem #007bff40}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i1.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { kind: "directive", type: i1.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { kind: "component", type: CustomPaginationComponent, selector: "custom-pagination", inputs: ["totalItems", "itemsPerPage", "currentPage", "showPageInfo"], outputs: ["pageChange"] }] }); }
|
3492
|
-
}
|
3493
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DynamicTableComponent, decorators: [{
|
3494
|
-
type: Component,
|
3495
|
-
args: [{ selector: "argenta-dynamic-table", template: "<table class=\"table\" [ngClass]=\"{ nested: config.isNested }\">\n <thead *ngIf=\"config.showHeader\">\n <tr>\n <th *ngFor=\"let column of config.columns\">{{ column.header }}</th>\n </tr>\n </thead>\n <tbody>\n <tr *ngFor=\"let row of paginatedData\">\n <td *ngFor=\"let column of config.columns\">\n <ng-container [ngSwitch]=\"column.type\">\n <span *ngSwitchCase=\"'text'\">{{ row[column.key] }}</span>\n <ng-container *ngSwitchCase=\"'template'\">\n <ng-container\n *ngTemplateOutlet=\"\n column.template || null;\n context: { $implicit: row }\n \"\n ></ng-container>\n </ng-container>\n </ng-container>\n </td>\n </tr>\n </tbody>\n</table>\n\n<div\n class=\"text-center pagination-controls\"\n [ngClass]=\"{ nested: config.isNested }\"\n *ngIf=\"config.pagination\"\n>\n <custom-pagination\n [totalItems]=\"safeTotalItems\"\n [itemsPerPage]=\"itemsPerPage\"\n [currentPage]=\"currentPage\"\n [showPageInfo]=\"showPageInfo\"\n (pageChange)=\"onPageChange($event)\"\n >\n </custom-pagination>\n</div>\n", styles: ["@charset \"UTF-8\";.table{width:100%;border-collapse:collapse;border-spacing:0}.table{width:100%;border-collapse:separate;border-spacing:0;overflow:hidden}.table thead th{background-color:var(--primary-color);color:var(--text-color);font-family:var(--font-family);font-size:14px;font-weight:600;padding:10px;border-bottom:.1rem solid #dcdcdc;text-align:center;line-height:2.5}.table thead th:first-child{border-top-left-radius:10px}.table thead th:last-child{border-top-right-radius:10px}.table.nested thead th{font-size:.7rem;padding:7px;line-height:.8}.table tbody td{font-family:var(--font-family);font-size:14px;color:#737b7b;padding:10px;border-bottom:.1rem solid #dcdcdc;text-align:center}.table tbody td:first-child{text-align:left;padding-left:1.4rem}.table.nested tbody td:first-child{padding-left:1rem}.table tbody tr:hover{background-color:#f5f5f5!important;transition:background-color .3s ease}.table.nested tbody tr:hover{background-color:#f0f0f0!important}.pagination-controls{display:flex;justify-content:center;align-items:center;margin-top:1rem}.pagination-controls.nested{font-size:.7rem;transform:scale(.7);margin-top:.5rem}.data-table-header{display:flex;justify-content:space-between;align-items:center;margin-bottom:1rem}.left-section{display:flex;align-items:center}.items-per-page-label{font-family:var(--font-family);font-size:14px;color:#666;margin-right:.5rem}.custom-select{font-family:var(--font-family);font-size:14px;padding:.375rem 1.75rem .375rem .75rem;border:1px solid #ccc;border-radius:.25rem;appearance:none;background:#fff url('data:image/svg+xml;charset=US-ASCII,<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 4 5\"><path fill=\"#666\" d=\"M2 0L0 2h4L2 0zM2 5l2-2H0l2 2z\"/></svg>') no-repeat right .75rem center/8px 10px}.custom-select:focus{border-color:#80bdff;outline:none;box-shadow:0 0 0 .2rem #007bff40}\n"] }]
|
3496
|
-
}], ctorParameters: function () { return []; }, propDecorators: { config: [{
|
3497
|
-
type: Input
|
3498
|
-
}], itemsPerPageOptions: [{
|
3499
|
-
type: Input
|
3500
|
-
}], showPageInfo: [{
|
3501
|
-
type: Input
|
3502
|
-
}] } });
|
3503
|
-
|
3504
3594
|
// Select some icons (use an object, not an array)
|
3505
3595
|
class LucideIconsModule {
|
3506
3596
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: LucideIconsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
@@ -3548,6 +3638,7 @@ class ComponentsModule {
|
|
3548
3638
|
AccordionArgentaComponent,
|
3549
3639
|
JsonViewerComponent,
|
3550
3640
|
ModalComponent,
|
3641
|
+
DragDropListComponent,
|
3551
3642
|
DynamicModalComponent,
|
3552
3643
|
DynamicTableComponent], imports: [CommonModule,
|
3553
3644
|
FormsModule,
|
@@ -3588,6 +3679,7 @@ class ComponentsModule {
|
|
3588
3679
|
AccordionArgentaComponent,
|
3589
3680
|
JsonViewerComponent,
|
3590
3681
|
ModalComponent,
|
3682
|
+
DragDropListComponent,
|
3591
3683
|
DynamicModalComponent,
|
3592
3684
|
DynamicTableComponent] }); }
|
3593
3685
|
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: ComponentsModule, imports: [CommonModule,
|
@@ -3634,6 +3726,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
3634
3726
|
AccordionArgentaComponent,
|
3635
3727
|
JsonViewerComponent,
|
3636
3728
|
ModalComponent,
|
3729
|
+
DragDropListComponent,
|
3637
3730
|
DynamicModalComponent,
|
3638
3731
|
DynamicTableComponent,
|
3639
3732
|
],
|
@@ -3680,6 +3773,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
3680
3773
|
AccordionArgentaComponent,
|
3681
3774
|
JsonViewerComponent,
|
3682
3775
|
ModalComponent,
|
3776
|
+
DragDropListComponent,
|
3683
3777
|
DynamicModalComponent,
|
3684
3778
|
DynamicTableComponent,
|
3685
3779
|
],
|
@@ -3815,6 +3909,7 @@ class LibPortalAngularModule {
|
|
3815
3909
|
DataPaginateService,
|
3816
3910
|
RefreshService,
|
3817
3911
|
RouterParameterService,
|
3912
|
+
// ExcelService,
|
3818
3913
|
], imports: [ComponentsModule, ComponentsModule] }); }
|
3819
3914
|
}
|
3820
3915
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: LibPortalAngularModule, decorators: [{
|
@@ -3832,10 +3927,15 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
3832
3927
|
DataPaginateService,
|
3833
3928
|
RefreshService,
|
3834
3929
|
RouterParameterService,
|
3930
|
+
// ExcelService,
|
3835
3931
|
],
|
3836
3932
|
}]
|
3837
3933
|
}] });
|
3838
3934
|
|
3935
|
+
function convertToSnakeCase(input) {
|
3936
|
+
return input.replace(/([A-Z])/g, "_$1").toLowerCase();
|
3937
|
+
}
|
3938
|
+
|
3839
3939
|
function setThemeColors(config) {
|
3840
3940
|
if (config.primary) {
|
3841
3941
|
document.documentElement.style.setProperty("--primary-color", config.primary);
|
@@ -3875,10 +3975,6 @@ function setThemeColors(config) {
|
|
3875
3975
|
}
|
3876
3976
|
}
|
3877
3977
|
|
3878
|
-
function convertToSnakeCase(input) {
|
3879
|
-
return input.replace(/([A-Z])/g, "_$1").toLowerCase();
|
3880
|
-
}
|
3881
|
-
|
3882
3978
|
/*
|
3883
3979
|
* Public API Surface of sim-lib
|
3884
3980
|
*
|
@@ -3891,5 +3987,5 @@ function convertToSnakeCase(input) {
|
|
3891
3987
|
* Generated bundle index. Do not edit.
|
3892
3988
|
*/
|
3893
3989
|
|
3894
|
-
export { AccordionArgentaComponent, AlertComponent, AppBackgroundComponent, AutofocusDirective, BadgeComponent, BasicRegistrationComponent, ButtonClasses, ButtonComponent, CalendarArgentaComponent, CardComponent, CepMaskDirective, CheckboxComponent, CnpjMaskDirective, CodeHighlightComponent, ComponentsModule, ConfirmationComponent, ConfirmationService, CpfMaskDirective, CustomPaginationComponent, CustomSwitchComponent, DataPaginateService, DataTableComponent, DynamicModalComponent, DynamicTableComponent, FileUploadComponent, InputComponent, JsonViewerComponent, LibPortalAngularModule, LucideIconsModule, ModalComponent, MultiSelectCategoryComponent, MultiSelectComponent, NotificationService, RadioComponent, RefreshService, RouterParameterService, SearchCustomerComponent, SearchInputComponent, SelectComponent, TabComponent, TextareaComponent, TreeNodeComponent, convertToSnakeCase, setThemeColors };
|
3990
|
+
export { AccordionArgentaComponent, AlertComponent, AppBackgroundComponent, AutofocusDirective, BadgeComponent, BasicRegistrationComponent, ButtonClasses, ButtonComponent, CalendarArgentaComponent, CardComponent, CepMaskDirective, CheckboxComponent, CnpjMaskDirective, CodeHighlightComponent, ComponentsModule, ConfirmationComponent, ConfirmationService, CpfMaskDirective, CustomPaginationComponent, CustomSwitchComponent, DataPaginateService, DataTableComponent, DragDropListComponent, DynamicModalComponent, DynamicTableComponent, FileUploadComponent, InputComponent, JsonViewerComponent, LibPortalAngularModule, LucideIconsModule, ModalComponent, MultiSelectCategoryComponent, MultiSelectComponent, NotificationService, RadioComponent, RefreshService, RouterParameterService, SearchCustomerComponent, SearchInputComponent, SelectComponent, TabComponent, TextareaComponent, TreeNodeComponent, convertToSnakeCase, setThemeColors };
|
3895
3991
|
//# sourceMappingURL=lib-portal-angular.mjs.map
|