@tots/table 15.0.0 → 15.0.2
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/esm2020/lib/columns/base-print-column/base-print-column.component.mjs +5 -2
- package/esm2020/lib/columns/more-menu-column/more-menu-column.component.mjs +21 -0
- package/esm2020/lib/columns/tots-base-column.component.mjs +4 -2
- package/esm2020/lib/components/tots-table/tots-table.component.mjs +11 -4
- package/esm2020/lib/components/tots-table-api/tots-table-api.component.mjs +6 -2
- package/esm2020/lib/table.module.mjs +21 -6
- package/esm2020/public-api.mjs +3 -1
- package/fesm2015/tots-table.mjs +70 -23
- package/fesm2015/tots-table.mjs.map +1 -1
- package/fesm2020/tots-table.mjs +70 -23
- package/fesm2020/tots-table.mjs.map +1 -1
- package/lib/columns/base-print-column/base-print-column.component.d.ts +4 -1
- package/lib/columns/more-menu-column/more-menu-column.component.d.ts +7 -0
- package/lib/columns/tots-base-column.component.d.ts +4 -1
- package/lib/components/tots-table/tots-table.component.d.ts +4 -1
- package/lib/components/tots-table-api/tots-table-api.component.d.ts +2 -1
- package/lib/table.module.d.ts +8 -4
- package/package.json +1 -1
- package/public-api.d.ts +2 -0
|
@@ -8,10 +8,11 @@ export class BasePrintColumnComponent {
|
|
|
8
8
|
const view = this.viewContainerRef.createComponent(this.column.component);
|
|
9
9
|
view.instance.column = this.column;
|
|
10
10
|
view.instance.item = this.item;
|
|
11
|
+
view.instance.onAction = this.onAction;
|
|
11
12
|
}
|
|
12
13
|
}
|
|
13
14
|
BasePrintColumnComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.3", ngImport: i0, type: BasePrintColumnComponent, deps: [{ token: i0.ViewContainerRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
14
|
-
BasePrintColumnComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.0.3", type: BasePrintColumnComponent, selector: "tots-base-print-column", inputs: { column: "column", item: "item" }, ngImport: i0, template: "<div #contentColumn></div>", styles: [""] });
|
|
15
|
+
BasePrintColumnComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.0.3", type: BasePrintColumnComponent, selector: "tots-base-print-column", inputs: { column: "column", item: "item", onAction: "onAction" }, ngImport: i0, template: "<div #contentColumn></div>", styles: [""] });
|
|
15
16
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.3", ngImport: i0, type: BasePrintColumnComponent, decorators: [{
|
|
16
17
|
type: Component,
|
|
17
18
|
args: [{ selector: 'tots-base-print-column', template: "<div #contentColumn></div>" }]
|
|
@@ -19,5 +20,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.3", ngImpor
|
|
|
19
20
|
type: Input
|
|
20
21
|
}], item: [{
|
|
21
22
|
type: Input
|
|
23
|
+
}], onAction: [{
|
|
24
|
+
type: Input
|
|
22
25
|
}] } });
|
|
23
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
26
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYmFzZS1wcmludC1jb2x1bW4uY29tcG9uZW50LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vLi4vcHJvamVjdHMvdG90cy90YWJsZS9zcmMvbGliL2NvbHVtbnMvYmFzZS1wcmludC1jb2x1bW4vYmFzZS1wcmludC1jb2x1bW4uY29tcG9uZW50LnRzIiwiLi4vLi4vLi4vLi4vLi4vLi4vLi4vcHJvamVjdHMvdG90cy90YWJsZS9zcmMvbGliL2NvbHVtbnMvYmFzZS1wcmludC1jb2x1bW4vYmFzZS1wcmludC1jb2x1bW4uY29tcG9uZW50Lmh0bWwiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLFNBQVMsRUFBRSxLQUFLLEVBQW9CLE1BQU0sZUFBZSxDQUF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0b3RzLWJhc2UtcHJpbnQtY29sdW1uJyxcbiAgdGVtcGxhdGVVcmw6ICcuL2Jhc2UtcHJpbnQtY29sdW1uLmNvbXBvbmVudC5odG1sJyxcbiAgc3R5bGVVcmxzOiBbJy4vYmFzZS1wcmludC1jb2x1bW4uY29tcG9uZW50LmNzcyddXG59KVxuZXhwb3J0IGNsYXNzIEJhc2VQcmludENvbHVtbkNvbXBvbmVudCB7XG5cbiAgQElucHV0KCkgY29sdW1uITogVG90c0NvbHVtbjtcbiAgQElucHV0KCkgaXRlbTogYW55O1xuICBASW5wdXQoKSBvbkFjdGlvbiE6IFN1YmplY3Q8VG90c0FjdGlvblRhYmxlPjtcblxuICBjb25zdHJ1Y3RvcihcbiAgICBwcm90ZWN0ZWQgdmlld0NvbnRhaW5lclJlZjogVmlld0NvbnRhaW5lclJlZlxuICApIHsgfVxuXG4gIG5nT25Jbml0KCk6IHZvaWQge1xuICAgIGNvbnN0IHZpZXcgPSB0aGlzLnZpZXdDb250YWluZXJSZWYuY3JlYXRlQ29tcG9uZW50KHRoaXMuY29sdW1uLmNvbXBvbmVudCk7XG4gICAgKDxhbnk+dmlldy5pbnN0YW5jZSkuY29sdW1uID0gdGhpcy5jb2x1bW47XG4gICAgKDxhbnk+dmlldy5pbnN0YW5jZSkuaXRlbSA9IHRoaXMuaXRlbTtcbiAgICAoPGFueT52aWV3Lmluc3RhbmNlKS5vbkFjdGlvbiA9IHRoaXMub25BY3Rpb247XG4gIH1cbn1cbiIsIjxkaXYgI2NvbnRlbnRDb2x1bW4+PC9kaXY+Il19
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Component } from '@angular/core';
|
|
2
|
+
import { TotsBaseColumnComponent } from '../tots-base-column.component';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
import * as i1 from "@angular/common";
|
|
5
|
+
import * as i2 from "@angular/material/icon";
|
|
6
|
+
import * as i3 from "@angular/material/button";
|
|
7
|
+
import * as i4 from "@angular/material/menu";
|
|
8
|
+
export class MoreMenuColumnComponent extends TotsBaseColumnComponent {
|
|
9
|
+
clickButton(itemAction, $event) {
|
|
10
|
+
this.onAction.next({ key: itemAction.key, item: this.item });
|
|
11
|
+
$event.preventDefault();
|
|
12
|
+
return false;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
MoreMenuColumnComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.3", ngImport: i0, type: MoreMenuColumnComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
16
|
+
MoreMenuColumnComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.0.3", type: MoreMenuColumnComponent, selector: "tots-more-menu-column", usesInheritance: true, ngImport: i0, template: "<button mat-icon-button [matMenuTriggerFor]=\"actions\" (click)=\"$event.stopPropagation()\"><mat-icon>more_vert</mat-icon></button>\n<mat-menu #actions=\"matMenu\">\n <button mat-menu-item *ngFor=\"let button of column.extra?.actions\" (click)=\"clickButton(button, $event)\">\n <mat-icon *ngIf=\"button.icon\">{{ button.icon }}</mat-icon> {{ button.title }}\n </button>\n</mat-menu>", styles: [""], 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: i2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: i3.MatIconButton, selector: "button[mat-icon-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: i4.MatMenu, selector: "mat-menu", exportAs: ["matMenu"] }, { kind: "component", type: i4.MatMenuItem, selector: "[mat-menu-item]", inputs: ["disabled", "disableRipple", "role"], exportAs: ["matMenuItem"] }, { kind: "directive", type: i4.MatMenuTrigger, selector: "[mat-menu-trigger-for], [matMenuTriggerFor]", exportAs: ["matMenuTrigger"] }] });
|
|
17
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.3", ngImport: i0, type: MoreMenuColumnComponent, decorators: [{
|
|
18
|
+
type: Component,
|
|
19
|
+
args: [{ selector: 'tots-more-menu-column', template: "<button mat-icon-button [matMenuTriggerFor]=\"actions\" (click)=\"$event.stopPropagation()\"><mat-icon>more_vert</mat-icon></button>\n<mat-menu #actions=\"matMenu\">\n <button mat-menu-item *ngFor=\"let button of column.extra?.actions\" (click)=\"clickButton(button, $event)\">\n <mat-icon *ngIf=\"button.icon\">{{ button.icon }}</mat-icon> {{ button.title }}\n </button>\n</mat-menu>" }]
|
|
20
|
+
}] });
|
|
21
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibW9yZS1tZW51LWNvbHVtbi5jb21wb25lbnQuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi8uLi9wcm9qZWN0cy90b3RzL3RhYmxlL3NyYy9saWIvY29sdW1ucy9tb3JlLW1lbnUtY29sdW1uL21vcmUtbWVudS1jb2x1bW4uY29tcG9uZW50LnRzIiwiLi4vLi4vLi4vLi4vLi4vLi4vLi4vcHJvamVjdHMvdG90cy90YWJsZS9zcmMvbGliL2NvbHVtbnMvbW9yZS1tZW51LWNvbHVtbi9tb3JlLW1lbnUtY29sdW1uLmNvbXBvbmVudC5odG1sIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxTQUFTLEVBQUUsTUFBTSxlQUFlLENBQUM7QUFFMUMsT0FBTyxFQUFFLHVCQUF1QixFQUFFLE1BQU0sK0JBQStCLENBQUM7Ozs7OztBQU94RSxNQUFNLE9BQU8sdUJBQXdCLFNBQVEsdUJBQXVCO0lBRWxFLFdBQVcsQ0FBQyxVQUFlLEVBQUUsTUFBZTtRQUMx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uICAgICRldmVudC5wcmV2ZW50RGVmYXVsdCgpO1xuICAgIHJldHVybiBmYWxzZTtcbiAgfVxufVxuIiwiPGJ1dHRvbiBtYXQtaWNvbi1idXR0b24gW21hdE1lbnVUcmlnZ2VyRm9yXT1cImFjdGlvbnNcIiAoY2xpY2spPVwiJGV2ZW50LnN0b3BQcm9wYWdhdGlvbigpXCI+PG1hdC1pY29uPm1vcmVfdmVydDwvbWF0LWljb24+PC9idXR0b24+XG48bWF0LW1lbnUgI2FjdGlvbnM9XCJtYXRNZW51XCI+XG4gICAgPGJ1dHRvbiBtYXQtbWVudS1pdGVtICpuZ0Zvcj1cImxldCBidXR0b24gb2YgY29sdW1uLmV4dHJhPy5hY3Rpb25zXCIgKGNsaWNrKT1cImNsaWNrQnV0dG9uKGJ1dHRvbiwgJGV2ZW50KVwiPlxuICAgICAgICA8bWF0LWljb24gKm5nSWY9XCJidXR0b24uaWNvblwiPnt7IGJ1dHRvbi5pY29uIH19PC9tYXQtaWNvbj4ge3sgYnV0dG9uLnRpdGxlIH19XG4gICAgPC9idXR0b24+XG48L21hdC1tZW51PiJdfQ==
|
|
@@ -7,7 +7,7 @@ export class TotsBaseColumnComponent {
|
|
|
7
7
|
}
|
|
8
8
|
}
|
|
9
9
|
TotsBaseColumnComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.3", ngImport: i0, type: TotsBaseColumnComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
10
|
-
TotsBaseColumnComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.0.3", type: TotsBaseColumnComponent, selector: "tots-base-column", inputs: { column: "column", item: "item" }, ngImport: i0, template: '', isInline: true });
|
|
10
|
+
TotsBaseColumnComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.0.3", type: TotsBaseColumnComponent, selector: "tots-base-column", inputs: { column: "column", item: "item", onAction: "onAction" }, ngImport: i0, template: '', isInline: true });
|
|
11
11
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.3", ngImport: i0, type: TotsBaseColumnComponent, decorators: [{
|
|
12
12
|
type: Component,
|
|
13
13
|
args: [{
|
|
@@ -18,5 +18,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.3", ngImpor
|
|
|
18
18
|
type: Input
|
|
19
19
|
}], item: [{
|
|
20
20
|
type: Input
|
|
21
|
+
}], onAction: [{
|
|
22
|
+
type: Input
|
|
21
23
|
}] } });
|
|
22
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
24
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidG90cy1iYXNlLWNvbHVtbi5jb21wb25lbnQuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi9wcm9qZWN0cy90b3RzL3RhYmxlL3NyYy9saWIvY29sdW1ucy90b3RzLWJhc2UtY29sdW1uLmNvbXBvbmVudC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUsU0FBUyxFQUFnQixLQUFLLEVBQVUsTUFBTSxlQUFlLENBQUM7QUFJdkUsT0FBTyxFQUFFLGVBQWUsRUFBRSxNQUFNLDhCQUE4QixDQUFDOztBQU0vRCxNQUFNLE9BQU8sdUJBQXVCO0lBTWhDLFlBQVk7UUFDUixPQUFPLGVBQWUsQ0FBQyxpQkFBaUIsQ0FBQyxJQUFJLENBQUMsSUFBSSxFQUFFLElBQUksQ0FBQyxNQUFNLENBQUMsU0FBUyxDQUFDLENBQUM7SUFDL0UsQ0FBQzs7b0hBUlEsdUJBQXVCO3dHQUF2Qix1QkFBdUIsMEhBRnRCLEVBQUU7MkZBRUgsdUJBQXVCO2tCQUpuQyxTQUFTO21CQUFDO29CQUNQLFFBQVEsRUFBRSxrQkFBa0I7b0JBQzVCLFFBQVEsRUFBRSxFQ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-
import { tap } from 'rxjs';
|
|
2
|
+
import { Subject, tap } from 'rxjs';
|
|
3
3
|
import { TotsTableConfig } from '../../entities/tots-table-config';
|
|
4
4
|
import * as i0 from "@angular/core";
|
|
5
5
|
import * as i1 from "@angular/common";
|
|
@@ -11,7 +11,9 @@ export class TotsTableComponent {
|
|
|
11
11
|
this.config = new TotsTableConfig();
|
|
12
12
|
this.pageIndex = 0;
|
|
13
13
|
this.pageSize = 50;
|
|
14
|
+
this.hasPagination = true;
|
|
14
15
|
this.onAction = new EventEmitter();
|
|
16
|
+
this.privateActions = new Subject();
|
|
15
17
|
this.isLoading = true;
|
|
16
18
|
this.displayColumns = [];
|
|
17
19
|
}
|
|
@@ -34,23 +36,28 @@ export class TotsTableComponent {
|
|
|
34
36
|
}
|
|
35
37
|
loadConfig() {
|
|
36
38
|
this.loadColumns();
|
|
39
|
+
this.privateActions.subscribe(action => {
|
|
40
|
+
this.onAction.emit(action);
|
|
41
|
+
});
|
|
37
42
|
}
|
|
38
43
|
loadColumns() {
|
|
39
44
|
this.displayColumns = this.config.columns.filter(c => c.is_show || c.is_show == undefined).map(c => c.key);
|
|
40
45
|
}
|
|
41
46
|
}
|
|
42
47
|
TotsTableComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.3", ngImport: i0, type: TotsTableComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
43
|
-
TotsTableComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.0.3", type: TotsTableComponent, selector: "tots-table", inputs: { config: "config", pageIndex: "pageIndex", pageSize: "pageSize" }, outputs: { onAction: "onAction" }, ngImport: i0, template: "<div class=\"tots-table-container\">\n <table *ngIf=\"dataItems\" mat-table [dataSource]=\"dataItems!.data\">\n \n <ng-container *ngFor=\"let column of config.columns\" [matColumnDef]=\"column.key\">\n <!-- TH-->\n <th mat-header-cell *matHeaderCellDef>{{ column.title }}</th>\n <!-- TD -->\n <td mat-cell *matCellDef=\"let item\"><tots-base-print-column [column]=\"column\" [item]=\"item\"></tots-base-print-column></td>\n </ng-container>\n\n <tr mat-header-row *matHeaderRowDef=\"displayColumns\"></tr>\n <tr mat-row *matRowDef=\"let row; columns: displayColumns;\" (click)=\"onClickRow(row)\"></tr>\n \n <!-- Row shown when there is no matching data. -->\n <tr class=\"mat-row\" *matNoDataRow><td class=\"mat-cell\" colspan=\"100\">No data matching</td></tr>\n\n <!-- Paginator -->\n <mat-paginator *ngIf=\"dataItems\" [pageIndex]=\"pageIndex\" [length]=\"dataItems!.total\" [pageSize]=\"pageSize\" [pageSizeOptions]=\"[5, 10, 25, 50, 100]\" (page)=\"onPageChange($event)\"></mat-paginator>\n </table>\n</div>", styles: [""], 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: i2.MatTable, selector: "mat-table, table[mat-table]", exportAs: ["matTable"] }, { kind: "directive", type: i2.MatHeaderCellDef, selector: "[matHeaderCellDef]" }, { kind: "directive", type: i2.MatHeaderRowDef, selector: "[matHeaderRowDef]", inputs: ["matHeaderRowDef", "matHeaderRowDefSticky"] }, { kind: "directive", type: i2.MatColumnDef, selector: "[matColumnDef]", inputs: ["sticky", "matColumnDef"] }, { kind: "directive", type: i2.MatCellDef, selector: "[matCellDef]" }, { kind: "directive", type: i2.MatRowDef, selector: "[matRowDef]", inputs: ["matRowDefColumns", "matRowDefWhen"] }, { kind: "directive", type: i2.MatHeaderCell, selector: "mat-header-cell, th[mat-header-cell]" }, { kind: "directive", type: i2.MatCell, selector: "mat-cell, td[mat-cell]" }, { kind: "component", type: i2.MatHeaderRow, selector: "mat-header-row, tr[mat-header-row]", exportAs: ["matHeaderRow"] }, { kind: "component", type: i2.MatRow, selector: "mat-row, tr[mat-row]", exportAs: ["matRow"] }, { kind: "directive", type: i2.MatNoDataRow, selector: "ng-template[matNoDataRow]" }, { kind: "component", type: i3.MatPaginator, selector: "mat-paginator", inputs: ["disabled"], exportAs: ["matPaginator"] }, { kind: "component", type: i4.BasePrintColumnComponent, selector: "tots-base-print-column", inputs: ["column", "item"] }] });
|
|
48
|
+
TotsTableComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.0.3", type: TotsTableComponent, selector: "tots-table", inputs: { config: "config", pageIndex: "pageIndex", pageSize: "pageSize", hasPagination: "hasPagination" }, outputs: { onAction: "onAction" }, ngImport: i0, template: "<div class=\"tots-table-container\">\n <table *ngIf=\"dataItems\" mat-table [dataSource]=\"dataItems!.data\">\n \n <ng-container *ngFor=\"let column of config.columns\" [matColumnDef]=\"column.key\">\n <!-- TH-->\n <th mat-header-cell *matHeaderCellDef>{{ column.title }}</th>\n <!-- TD -->\n <td mat-cell *matCellDef=\"let item\"><tots-base-print-column [column]=\"column\" [item]=\"item\"></tots-base-print-column></td>\n </ng-container>\n\n <tr mat-header-row *matHeaderRowDef=\"displayColumns\"></tr>\n <tr mat-row *matRowDef=\"let row; columns: displayColumns;\" (click)=\"onClickRow(row)\"></tr>\n \n <!-- Row shown when there is no matching data. -->\n <tr class=\"mat-row\" *matNoDataRow><td class=\"mat-cell\" colspan=\"100\">No data matching</td></tr>\n\n <!-- Paginator -->\n <mat-paginator *ngIf=\"dataItems && hasPagination\" [pageIndex]=\"pageIndex\" [length]=\"dataItems!.total\" [pageSize]=\"pageSize\" [pageSizeOptions]=\"[5, 10, 25, 50, 100]\" (page)=\"onPageChange($event)\"></mat-paginator>\n </table>\n</div>", styles: [""], 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: i2.MatTable, selector: "mat-table, table[mat-table]", exportAs: ["matTable"] }, { kind: "directive", type: i2.MatHeaderCellDef, selector: "[matHeaderCellDef]" }, { kind: "directive", type: i2.MatHeaderRowDef, selector: "[matHeaderRowDef]", inputs: ["matHeaderRowDef", "matHeaderRowDefSticky"] }, { kind: "directive", type: i2.MatColumnDef, selector: "[matColumnDef]", inputs: ["sticky", "matColumnDef"] }, { kind: "directive", type: i2.MatCellDef, selector: "[matCellDef]" }, { kind: "directive", type: i2.MatRowDef, selector: "[matRowDef]", inputs: ["matRowDefColumns", "matRowDefWhen"] }, { kind: "directive", type: i2.MatHeaderCell, selector: "mat-header-cell, th[mat-header-cell]" }, { kind: "directive", type: i2.MatCell, selector: "mat-cell, td[mat-cell]" }, { kind: "component", type: i2.MatHeaderRow, selector: "mat-header-row, tr[mat-header-row]", exportAs: ["matHeaderRow"] }, { kind: "component", type: i2.MatRow, selector: "mat-row, tr[mat-row]", exportAs: ["matRow"] }, { kind: "directive", type: i2.MatNoDataRow, selector: "ng-template[matNoDataRow]" }, { kind: "component", type: i3.MatPaginator, selector: "mat-paginator", inputs: ["disabled"], exportAs: ["matPaginator"] }, { kind: "component", type: i4.BasePrintColumnComponent, selector: "tots-base-print-column", inputs: ["column", "item", "onAction"] }] });
|
|
44
49
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.3", ngImport: i0, type: TotsTableComponent, decorators: [{
|
|
45
50
|
type: Component,
|
|
46
|
-
args: [{ selector: 'tots-table', template: "<div class=\"tots-table-container\">\n <table *ngIf=\"dataItems\" mat-table [dataSource]=\"dataItems!.data\">\n \n <ng-container *ngFor=\"let column of config.columns\" [matColumnDef]=\"column.key\">\n <!-- TH-->\n <th mat-header-cell *matHeaderCellDef>{{ column.title }}</th>\n <!-- TD -->\n <td mat-cell *matCellDef=\"let item\"><tots-base-print-column [column]=\"column\" [item]=\"item\"></tots-base-print-column></td>\n </ng-container>\n\n <tr mat-header-row *matHeaderRowDef=\"displayColumns\"></tr>\n <tr mat-row *matRowDef=\"let row; columns: displayColumns;\" (click)=\"onClickRow(row)\"></tr>\n \n <!-- Row shown when there is no matching data. -->\n <tr class=\"mat-row\" *matNoDataRow><td class=\"mat-cell\" colspan=\"100\">No data matching</td></tr>\n\n <!-- Paginator -->\n <mat-paginator *ngIf=\"dataItems\" [pageIndex]=\"pageIndex\" [length]=\"dataItems!.total\" [pageSize]=\"pageSize\" [pageSizeOptions]=\"[5, 10, 25, 50, 100]\" (page)=\"onPageChange($event)\"></mat-paginator>\n </table>\n</div>" }]
|
|
51
|
+
args: [{ selector: 'tots-table', template: "<div class=\"tots-table-container\">\n <table *ngIf=\"dataItems\" mat-table [dataSource]=\"dataItems!.data\">\n \n <ng-container *ngFor=\"let column of config.columns\" [matColumnDef]=\"column.key\">\n <!-- TH-->\n <th mat-header-cell *matHeaderCellDef>{{ column.title }}</th>\n <!-- TD -->\n <td mat-cell *matCellDef=\"let item\"><tots-base-print-column [column]=\"column\" [item]=\"item\"></tots-base-print-column></td>\n </ng-container>\n\n <tr mat-header-row *matHeaderRowDef=\"displayColumns\"></tr>\n <tr mat-row *matRowDef=\"let row; columns: displayColumns;\" (click)=\"onClickRow(row)\"></tr>\n \n <!-- Row shown when there is no matching data. -->\n <tr class=\"mat-row\" *matNoDataRow><td class=\"mat-cell\" colspan=\"100\">No data matching</td></tr>\n\n <!-- Paginator -->\n <mat-paginator *ngIf=\"dataItems && hasPagination\" [pageIndex]=\"pageIndex\" [length]=\"dataItems!.total\" [pageSize]=\"pageSize\" [pageSizeOptions]=\"[5, 10, 25, 50, 100]\" (page)=\"onPageChange($event)\"></mat-paginator>\n </table>\n</div>" }]
|
|
47
52
|
}], propDecorators: { config: [{
|
|
48
53
|
type: Input
|
|
49
54
|
}], pageIndex: [{
|
|
50
55
|
type: Input
|
|
51
56
|
}], pageSize: [{
|
|
52
57
|
type: Input
|
|
58
|
+
}], hasPagination: [{
|
|
59
|
+
type: Input
|
|
53
60
|
}], onAction: [{
|
|
54
61
|
type: Output
|
|
55
62
|
}] } });
|
|
56
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
63
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidG90cy10YWJsZS5jb21wb25lbnQuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi8uLi9wcm9qZWN0cy90b3RzL3RhYmxlL3NyYy9saWIvY29tcG9uZW50cy90b3RzLXRhYmxlL3RvdHMtdGFibGUuY29tcG9uZW50LnRzIiwiLi4vLi4vLi4vLi4vLi4vLi4vLi4vcHJvamVjdHMvdG90cy90YWJsZS9zcmMvbGliL2NvbXBvbmVudHMvdG90cy10YWJsZS90b3RzLXRhYmxlLmNvbXBvbmVudC5odG1sIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxTQUFTLEVBQUUsWUFBWSxFQUFFLEtBQUssRUFBVSxNQUFNLEVBQUUsTUFBTSxlQUFlLENBQUM7QUFHL0UsT0FBTyxFQUFFLE9BQU8sRUFBRSxHQUFHLEVBQUUsTUFBTSxNQUFNLENBQUM7QUFFcEMsT0FBTyxFQUFFLGVBQWUsRUFBRSxNQUFNLGtDQUFrQyxDQUFDOzs7Ozs7QUFPbkUsTUFBTSxPQUFPLGtCQUFrQjtJQUwvQjtRQU9XLFdBQU0sR0FBRyxJQUFJLGVBQWUsRUFBRSxDQUFDO1FBQy9CLGNBQVMsR0FBVyxDQUFDLENBQUM7UUFDdEIsYUFBUSxHQUFXLEVBQUUsQ0FBQztRQUN0QixrQkFBYSxHQUFZLElBQUksQ0FBQztRQUU3QixhQUFRLEdBQUcsSUFBSSxZQUFZLEVBQW1CLENBQUM7UUFDekQsbUJBQWMsR0FBRyxJQUFJLE9BQU8sRUFBbUIsQ0FBQztRQUVoRCxjQUFTLEdBQUcsSUFBSSxDQUFDO1FBRWpCLG1CQUFjLEdBQWtCLEVBQUUsQ0FBQztLQWtDcEM7SUFo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2Rpdj4iXX0=
|
|
@@ -6,6 +6,7 @@ import * as i1 from "../tots-table/tots-table.component";
|
|
|
6
6
|
export class TotsTableApiComponent {
|
|
7
7
|
constructor() {
|
|
8
8
|
this.config = new TotsTableApiConfig();
|
|
9
|
+
this.hasPagination = true;
|
|
9
10
|
this.onAction = new EventEmitter();
|
|
10
11
|
this.configTable = new TotsTableConfig();
|
|
11
12
|
}
|
|
@@ -17,6 +18,7 @@ export class TotsTableApiComponent {
|
|
|
17
18
|
this.config.query.per_page = action.item.pageSize;
|
|
18
19
|
this.config.query.page = action.item.pageIndex + 1;
|
|
19
20
|
}
|
|
21
|
+
this.onAction.emit(action);
|
|
20
22
|
}
|
|
21
23
|
loadConfig() {
|
|
22
24
|
this.configTable.id = this.config.id;
|
|
@@ -25,13 +27,15 @@ export class TotsTableApiComponent {
|
|
|
25
27
|
}
|
|
26
28
|
}
|
|
27
29
|
TotsTableApiComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.3", ngImport: i0, type: TotsTableApiComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
28
|
-
TotsTableApiComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.0.3", type: TotsTableApiComponent, selector: "tots-table-api", inputs: { config: "config" }, outputs: { onAction: "onAction" }, ngImport: i0, template: "<tots-table #tableComp [config]=\"configTable\" [pageIndex]=\"config.query.page\" [pageSize]=\"config.query.per_page\" (onAction)=\"onTableAction($event)\"></tots-table>\n", styles: [""], dependencies: [{ kind: "component", type: i1.TotsTableComponent, selector: "tots-table", inputs: ["config", "pageIndex", "pageSize"], outputs: ["onAction"] }] });
|
|
30
|
+
TotsTableApiComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.0.3", type: TotsTableApiComponent, selector: "tots-table-api", inputs: { config: "config", hasPagination: "hasPagination" }, outputs: { onAction: "onAction" }, ngImport: i0, template: "<tots-table #tableComp [config]=\"configTable\" [pageIndex]=\"config.query.page\" [pageSize]=\"config.query.per_page\" (onAction)=\"onTableAction($event)\"></tots-table>\n", styles: [""], dependencies: [{ kind: "component", type: i1.TotsTableComponent, selector: "tots-table", inputs: ["config", "pageIndex", "pageSize", "hasPagination"], outputs: ["onAction"] }] });
|
|
29
31
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.3", ngImport: i0, type: TotsTableApiComponent, decorators: [{
|
|
30
32
|
type: Component,
|
|
31
33
|
args: [{ selector: 'tots-table-api', template: "<tots-table #tableComp [config]=\"configTable\" [pageIndex]=\"config.query.page\" [pageSize]=\"config.query.per_page\" (onAction)=\"onTableAction($event)\"></tots-table>\n" }]
|
|
32
34
|
}], propDecorators: { config: [{
|
|
33
35
|
type: Input
|
|
36
|
+
}], hasPagination: [{
|
|
37
|
+
type: Input
|
|
34
38
|
}], onAction: [{
|
|
35
39
|
type: Output
|
|
36
40
|
}] } });
|
|
37
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
41
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidG90cy10YWJsZS1hcGkuY29tcG9uZW50LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vLi4vcHJvamVjdHMvdG90cy90YWJsZS9zcmMvbGliL2NvbXBvbmVudHMvdG90cy10YWJsZS1hcGkvdG90cy10YWJsZS1hcGkuY29tcG9uZW50LnRzIiwiLi4vLi4vLi4vLi4vLi4vLi4vLi4vcHJvamVjdHMvdG90cy90YWJsZS9zcmMvbGliL2NvbXBvbmVudHMvdG90cy10YWJsZS1hcGkvdG90cy10YWJsZS1hcGkuY29tcG9uZW50Lmh0bWwiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLFNBQVMsRUFBRSxZQUFZLEVBQUUsS0FBSyxFQUFVLE1BQU0sRUFBRSxNQUFNLGVBQWUsQ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PC90b3RzLXRhYmxlPlxuIl19
|
|
@@ -1,14 +1,18 @@
|
|
|
1
1
|
import { NgModule } from '@angular/core';
|
|
2
2
|
import { CommonModule } from '@angular/common';
|
|
3
3
|
/** Angular Material */
|
|
4
|
+
import { MatIconModule } from '@angular/material/icon';
|
|
5
|
+
import { MatButtonModule } from '@angular/material/button';
|
|
4
6
|
import { MatTableModule } from '@angular/material/table';
|
|
5
7
|
import { MatPaginatorModule } from '@angular/material/paginator';
|
|
8
|
+
import { MatMenuModule } from '@angular/material/menu';
|
|
6
9
|
/** Components */
|
|
7
10
|
import { TotsTableComponent } from './components/tots-table/tots-table.component';
|
|
8
11
|
import { TotsTableApiComponent } from './components/tots-table-api/tots-table-api.component';
|
|
9
12
|
/** Columns */
|
|
10
13
|
import { BasePrintColumnComponent } from './columns/base-print-column/base-print-column.component';
|
|
11
14
|
import { StringColumnComponent } from './columns/string-column/string-column.component';
|
|
15
|
+
import { MoreMenuColumnComponent } from './columns/more-menu-column/more-menu-column.component';
|
|
12
16
|
import * as i0 from "@angular/core";
|
|
13
17
|
export class TotsTableModule {
|
|
14
18
|
}
|
|
@@ -16,15 +20,22 @@ TotsTableModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version:
|
|
|
16
20
|
TotsTableModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.0.3", ngImport: i0, type: TotsTableModule, declarations: [TotsTableComponent,
|
|
17
21
|
BasePrintColumnComponent,
|
|
18
22
|
StringColumnComponent,
|
|
19
|
-
TotsTableApiComponent
|
|
23
|
+
TotsTableApiComponent,
|
|
24
|
+
MoreMenuColumnComponent], imports: [CommonModule,
|
|
20
25
|
// Angular Material
|
|
26
|
+
MatIconModule,
|
|
21
27
|
MatTableModule,
|
|
22
|
-
MatPaginatorModule
|
|
28
|
+
MatPaginatorModule,
|
|
29
|
+
MatButtonModule,
|
|
30
|
+
MatMenuModule], exports: [TotsTableComponent,
|
|
23
31
|
TotsTableApiComponent] });
|
|
24
32
|
TotsTableModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.0.3", ngImport: i0, type: TotsTableModule, imports: [CommonModule,
|
|
25
33
|
// Angular Material
|
|
34
|
+
MatIconModule,
|
|
26
35
|
MatTableModule,
|
|
27
|
-
MatPaginatorModule
|
|
36
|
+
MatPaginatorModule,
|
|
37
|
+
MatButtonModule,
|
|
38
|
+
MatMenuModule] });
|
|
28
39
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.3", ngImport: i0, type: TotsTableModule, decorators: [{
|
|
29
40
|
type: NgModule,
|
|
30
41
|
args: [{
|
|
@@ -32,13 +43,17 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.3", ngImpor
|
|
|
32
43
|
TotsTableComponent,
|
|
33
44
|
BasePrintColumnComponent,
|
|
34
45
|
StringColumnComponent,
|
|
35
|
-
TotsTableApiComponent
|
|
46
|
+
TotsTableApiComponent,
|
|
47
|
+
MoreMenuColumnComponent
|
|
36
48
|
],
|
|
37
49
|
imports: [
|
|
38
50
|
CommonModule,
|
|
39
51
|
// Angular Material
|
|
52
|
+
MatIconModule,
|
|
40
53
|
MatTableModule,
|
|
41
|
-
MatPaginatorModule
|
|
54
|
+
MatPaginatorModule,
|
|
55
|
+
MatButtonModule,
|
|
56
|
+
MatMenuModule,
|
|
42
57
|
],
|
|
43
58
|
exports: [
|
|
44
59
|
TotsTableComponent,
|
|
@@ -46,4 +61,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.3", ngImpor
|
|
|
46
61
|
]
|
|
47
62
|
}]
|
|
48
63
|
}] });
|
|
49
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
64
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidGFibGUubW9kdWxlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4v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W5ndWxhciBNYXRlcmlhbFxuICAgIE1hdEljb25Nb2R1bGUsXG4gICAgTWF0VGFibGVNb2R1bGUsXG4gICAgTWF0UGFnaW5hdG9yTW9kdWxlLFxuICAgIE1hdEJ1dHRvbk1vZHVsZSxcbiAgICBNYXRNZW51TW9kdWxlLFxuICBdLFxuICBleHBvcnRzOiBbXG4gICAgVG90c1RhYmxlQ29tcG9uZW50LFxuICAgIFRvdHNUYWJsZUFwaUNvbXBvbmVudFxuICBdXG59KVxuZXhwb3J0IGNsYXNzIFRvdHNUYWJsZU1vZHVsZSB7IH1cbiJdfQ==
|
package/esm2020/public-api.mjs
CHANGED
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
export * from './lib/entities/tots-column';
|
|
8
8
|
export * from './lib/entities/tots-table-config';
|
|
9
9
|
export * from './lib/entities/tots-action-table';
|
|
10
|
+
export * from './lib/entities/tots-table-api-config';
|
|
10
11
|
/**
|
|
11
12
|
* Helpers
|
|
12
13
|
*/
|
|
@@ -16,6 +17,7 @@ export * from './lib/helpers/tots-table-helper';
|
|
|
16
17
|
*/
|
|
17
18
|
export * from './lib/columns/tots-base-column.component';
|
|
18
19
|
export * from './lib/columns/string-column/string-column.component';
|
|
20
|
+
export * from './lib/columns/more-menu-column/more-menu-column.component';
|
|
19
21
|
/**
|
|
20
22
|
* Components
|
|
21
23
|
*/
|
|
@@ -25,4 +27,4 @@ export * from './lib/components/tots-table-api/tots-table-api.component';
|
|
|
25
27
|
* Modules
|
|
26
28
|
*/
|
|
27
29
|
export * from './lib/table.module';
|
|
28
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
30
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHVibGljLWFwaS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3Byb2plY3RzL3RvdHMvdGFibGUvc3JjL3B1YmxpYy1hcGkudHMiXSwibmFtZXMiOltdLCJtY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1bW4vc3RyaW5nLWNvbHVtbi5jb21wb25lbnQnO1xuZXhwb3J0ICogZnJvbSAnLi9saWIvY29sdW1ucy9tb3JlLW1lbnUtY29sdW1uL21vcmUtbWVudS1jb2x1bW4uY29tcG9uZW50JztcblxuLyoqXG4gKiBDb21wb25lbnRzXG4gKi9cbmV4cG9ydCAqIGZyb20gJy4vbGliL2NvbXBvbmVudHMvdG90cy10YWJsZS90b3RzLXRhYmxlLmNvbXBvbmVudCc7XG5leHBvcnQgKiBmcm9tICcuL2xpYi9jb21wb25lbnRzL3RvdHMtdGFibGUtYXBpL3RvdHMtdGFibGUtYXBpLmNvbXBvbmVudCc7XG5cbi8qKlxuICogTW9kdWxlc1xuICovXG5leHBvcnQgKiBmcm9tICcuL2xpYi90YWJsZS5tb2R1bGUnO1xuIl19
|
package/fesm2015/tots-table.mjs
CHANGED
|
@@ -1,13 +1,19 @@
|
|
|
1
|
+
import { TotsQuery } from '@tots/core';
|
|
1
2
|
import * as i0 from '@angular/core';
|
|
2
3
|
import { Component, Input, EventEmitter, Output, NgModule } from '@angular/core';
|
|
3
|
-
import { tap } from 'rxjs';
|
|
4
4
|
import * as i1 from '@angular/common';
|
|
5
5
|
import { CommonModule } from '@angular/common';
|
|
6
|
-
import * as i2 from '@angular/material/
|
|
6
|
+
import * as i2 from '@angular/material/icon';
|
|
7
|
+
import { MatIconModule } from '@angular/material/icon';
|
|
8
|
+
import * as i3 from '@angular/material/button';
|
|
9
|
+
import { MatButtonModule } from '@angular/material/button';
|
|
10
|
+
import * as i4 from '@angular/material/menu';
|
|
11
|
+
import { MatMenuModule } from '@angular/material/menu';
|
|
12
|
+
import { Subject, tap } from 'rxjs';
|
|
13
|
+
import * as i2$1 from '@angular/material/table';
|
|
7
14
|
import { MatTableModule } from '@angular/material/table';
|
|
8
|
-
import * as i3 from '@angular/material/paginator';
|
|
15
|
+
import * as i3$1 from '@angular/material/paginator';
|
|
9
16
|
import { MatPaginatorModule } from '@angular/material/paginator';
|
|
10
|
-
import { TotsQuery } from '@tots/core';
|
|
11
17
|
|
|
12
18
|
class TotsColumn {
|
|
13
19
|
constructor() {
|
|
@@ -30,6 +36,14 @@ class TotsActionTable {
|
|
|
30
36
|
}
|
|
31
37
|
}
|
|
32
38
|
|
|
39
|
+
class TotsTableApiConfig {
|
|
40
|
+
constructor() {
|
|
41
|
+
this.id = '';
|
|
42
|
+
this.columns = [];
|
|
43
|
+
this.query = new TotsQuery();
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
33
47
|
class TotsTableHelper {
|
|
34
48
|
/**
|
|
35
49
|
* Obtiene el valor de un objeto a traves de la KEY
|
|
@@ -61,7 +75,7 @@ class TotsBaseColumnComponent {
|
|
|
61
75
|
}
|
|
62
76
|
}
|
|
63
77
|
TotsBaseColumnComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.3", ngImport: i0, type: TotsBaseColumnComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
64
|
-
TotsBaseColumnComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.0.3", type: TotsBaseColumnComponent, selector: "tots-base-column", inputs: { column: "column", item: "item" }, ngImport: i0, template: '', isInline: true });
|
|
78
|
+
TotsBaseColumnComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.0.3", type: TotsBaseColumnComponent, selector: "tots-base-column", inputs: { column: "column", item: "item", onAction: "onAction" }, ngImport: i0, template: '', isInline: true });
|
|
65
79
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.3", ngImport: i0, type: TotsBaseColumnComponent, decorators: [{
|
|
66
80
|
type: Component,
|
|
67
81
|
args: [{
|
|
@@ -72,6 +86,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.3", ngImpor
|
|
|
72
86
|
type: Input
|
|
73
87
|
}], item: [{
|
|
74
88
|
type: Input
|
|
89
|
+
}], onAction: [{
|
|
90
|
+
type: Input
|
|
75
91
|
}] } });
|
|
76
92
|
|
|
77
93
|
class StringColumnComponent extends TotsBaseColumnComponent {
|
|
@@ -83,6 +99,20 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.3", ngImpor
|
|
|
83
99
|
args: [{ selector: 'tots-string-column', template: "{{getItemValue()}}" }]
|
|
84
100
|
}] });
|
|
85
101
|
|
|
102
|
+
class MoreMenuColumnComponent extends TotsBaseColumnComponent {
|
|
103
|
+
clickButton(itemAction, $event) {
|
|
104
|
+
this.onAction.next({ key: itemAction.key, item: this.item });
|
|
105
|
+
$event.preventDefault();
|
|
106
|
+
return false;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
MoreMenuColumnComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.3", ngImport: i0, type: MoreMenuColumnComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
110
|
+
MoreMenuColumnComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.0.3", type: MoreMenuColumnComponent, selector: "tots-more-menu-column", usesInheritance: true, ngImport: i0, template: "<button mat-icon-button [matMenuTriggerFor]=\"actions\" (click)=\"$event.stopPropagation()\"><mat-icon>more_vert</mat-icon></button>\n<mat-menu #actions=\"matMenu\">\n <button mat-menu-item *ngFor=\"let button of column.extra?.actions\" (click)=\"clickButton(button, $event)\">\n <mat-icon *ngIf=\"button.icon\">{{ button.icon }}</mat-icon> {{ button.title }}\n </button>\n</mat-menu>", styles: [""], 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: i2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: i3.MatIconButton, selector: "button[mat-icon-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: i4.MatMenu, selector: "mat-menu", exportAs: ["matMenu"] }, { kind: "component", type: i4.MatMenuItem, selector: "[mat-menu-item]", inputs: ["disabled", "disableRipple", "role"], exportAs: ["matMenuItem"] }, { kind: "directive", type: i4.MatMenuTrigger, selector: "[mat-menu-trigger-for], [matMenuTriggerFor]", exportAs: ["matMenuTrigger"] }] });
|
|
111
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.3", ngImport: i0, type: MoreMenuColumnComponent, decorators: [{
|
|
112
|
+
type: Component,
|
|
113
|
+
args: [{ selector: 'tots-more-menu-column', template: "<button mat-icon-button [matMenuTriggerFor]=\"actions\" (click)=\"$event.stopPropagation()\"><mat-icon>more_vert</mat-icon></button>\n<mat-menu #actions=\"matMenu\">\n <button mat-menu-item *ngFor=\"let button of column.extra?.actions\" (click)=\"clickButton(button, $event)\">\n <mat-icon *ngIf=\"button.icon\">{{ button.icon }}</mat-icon> {{ button.title }}\n </button>\n</mat-menu>" }]
|
|
114
|
+
}] });
|
|
115
|
+
|
|
86
116
|
class BasePrintColumnComponent {
|
|
87
117
|
constructor(viewContainerRef) {
|
|
88
118
|
this.viewContainerRef = viewContainerRef;
|
|
@@ -91,10 +121,11 @@ class BasePrintColumnComponent {
|
|
|
91
121
|
const view = this.viewContainerRef.createComponent(this.column.component);
|
|
92
122
|
view.instance.column = this.column;
|
|
93
123
|
view.instance.item = this.item;
|
|
124
|
+
view.instance.onAction = this.onAction;
|
|
94
125
|
}
|
|
95
126
|
}
|
|
96
127
|
BasePrintColumnComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.3", ngImport: i0, type: BasePrintColumnComponent, deps: [{ token: i0.ViewContainerRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
97
|
-
BasePrintColumnComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.0.3", type: BasePrintColumnComponent, selector: "tots-base-print-column", inputs: { column: "column", item: "item" }, ngImport: i0, template: "<div #contentColumn></div>", styles: [""] });
|
|
128
|
+
BasePrintColumnComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.0.3", type: BasePrintColumnComponent, selector: "tots-base-print-column", inputs: { column: "column", item: "item", onAction: "onAction" }, ngImport: i0, template: "<div #contentColumn></div>", styles: [""] });
|
|
98
129
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.3", ngImport: i0, type: BasePrintColumnComponent, decorators: [{
|
|
99
130
|
type: Component,
|
|
100
131
|
args: [{ selector: 'tots-base-print-column', template: "<div #contentColumn></div>" }]
|
|
@@ -102,6 +133,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.3", ngImpor
|
|
|
102
133
|
type: Input
|
|
103
134
|
}], item: [{
|
|
104
135
|
type: Input
|
|
136
|
+
}], onAction: [{
|
|
137
|
+
type: Input
|
|
105
138
|
}] } });
|
|
106
139
|
|
|
107
140
|
class TotsTableComponent {
|
|
@@ -109,7 +142,9 @@ class TotsTableComponent {
|
|
|
109
142
|
this.config = new TotsTableConfig();
|
|
110
143
|
this.pageIndex = 0;
|
|
111
144
|
this.pageSize = 50;
|
|
145
|
+
this.hasPagination = true;
|
|
112
146
|
this.onAction = new EventEmitter();
|
|
147
|
+
this.privateActions = new Subject();
|
|
113
148
|
this.isLoading = true;
|
|
114
149
|
this.displayColumns = [];
|
|
115
150
|
}
|
|
@@ -131,37 +166,35 @@ class TotsTableComponent {
|
|
|
131
166
|
}
|
|
132
167
|
loadConfig() {
|
|
133
168
|
this.loadColumns();
|
|
169
|
+
this.privateActions.subscribe(action => {
|
|
170
|
+
this.onAction.emit(action);
|
|
171
|
+
});
|
|
134
172
|
}
|
|
135
173
|
loadColumns() {
|
|
136
174
|
this.displayColumns = this.config.columns.filter(c => c.is_show || c.is_show == undefined).map(c => c.key);
|
|
137
175
|
}
|
|
138
176
|
}
|
|
139
177
|
TotsTableComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.3", ngImport: i0, type: TotsTableComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
140
|
-
TotsTableComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.0.3", type: TotsTableComponent, selector: "tots-table", inputs: { config: "config", pageIndex: "pageIndex", pageSize: "pageSize" }, outputs: { onAction: "onAction" }, ngImport: i0, template: "<div class=\"tots-table-container\">\n <table *ngIf=\"dataItems\" mat-table [dataSource]=\"dataItems!.data\">\n \n <ng-container *ngFor=\"let column of config.columns\" [matColumnDef]=\"column.key\">\n <!-- TH-->\n <th mat-header-cell *matHeaderCellDef>{{ column.title }}</th>\n <!-- TD -->\n <td mat-cell *matCellDef=\"let item\"><tots-base-print-column [column]=\"column\" [item]=\"item\"></tots-base-print-column></td>\n </ng-container>\n\n <tr mat-header-row *matHeaderRowDef=\"displayColumns\"></tr>\n <tr mat-row *matRowDef=\"let row; columns: displayColumns;\" (click)=\"onClickRow(row)\"></tr>\n \n <!-- Row shown when there is no matching data. -->\n <tr class=\"mat-row\" *matNoDataRow><td class=\"mat-cell\" colspan=\"100\">No data matching</td></tr>\n\n <!-- Paginator -->\n <mat-paginator *ngIf=\"dataItems\" [pageIndex]=\"pageIndex\" [length]=\"dataItems!.total\" [pageSize]=\"pageSize\" [pageSizeOptions]=\"[5, 10, 25, 50, 100]\" (page)=\"onPageChange($event)\"></mat-paginator>\n </table>\n</div>", styles: [""], 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: i2.MatTable, selector: "mat-table, table[mat-table]", exportAs: ["matTable"] }, { kind: "directive", type: i2.MatHeaderCellDef, selector: "[matHeaderCellDef]" }, { kind: "directive", type: i2.MatHeaderRowDef, selector: "[matHeaderRowDef]", inputs: ["matHeaderRowDef", "matHeaderRowDefSticky"] }, { kind: "directive", type: i2.MatColumnDef, selector: "[matColumnDef]", inputs: ["sticky", "matColumnDef"] }, { kind: "directive", type: i2.MatCellDef, selector: "[matCellDef]" }, { kind: "directive", type: i2.MatRowDef, selector: "[matRowDef]", inputs: ["matRowDefColumns", "matRowDefWhen"] }, { kind: "directive", type: i2.MatHeaderCell, selector: "mat-header-cell, th[mat-header-cell]" }, { kind: "directive", type: i2.MatCell, selector: "mat-cell, td[mat-cell]" }, { kind: "component", type: i2.MatHeaderRow, selector: "mat-header-row, tr[mat-header-row]", exportAs: ["matHeaderRow"] }, { kind: "component", type: i2.MatRow, selector: "mat-row, tr[mat-row]", exportAs: ["matRow"] }, { kind: "directive", type: i2.MatNoDataRow, selector: "ng-template[matNoDataRow]" }, { kind: "component", type: i3.MatPaginator, selector: "mat-paginator", inputs: ["disabled"], exportAs: ["matPaginator"] }, { kind: "component", type: BasePrintColumnComponent, selector: "tots-base-print-column", inputs: ["column", "item"] }] });
|
|
178
|
+
TotsTableComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.0.3", type: TotsTableComponent, selector: "tots-table", inputs: { config: "config", pageIndex: "pageIndex", pageSize: "pageSize", hasPagination: "hasPagination" }, outputs: { onAction: "onAction" }, ngImport: i0, template: "<div class=\"tots-table-container\">\n <table *ngIf=\"dataItems\" mat-table [dataSource]=\"dataItems!.data\">\n \n <ng-container *ngFor=\"let column of config.columns\" [matColumnDef]=\"column.key\">\n <!-- TH-->\n <th mat-header-cell *matHeaderCellDef>{{ column.title }}</th>\n <!-- TD -->\n <td mat-cell *matCellDef=\"let item\"><tots-base-print-column [column]=\"column\" [item]=\"item\"></tots-base-print-column></td>\n </ng-container>\n\n <tr mat-header-row *matHeaderRowDef=\"displayColumns\"></tr>\n <tr mat-row *matRowDef=\"let row; columns: displayColumns;\" (click)=\"onClickRow(row)\"></tr>\n \n <!-- Row shown when there is no matching data. -->\n <tr class=\"mat-row\" *matNoDataRow><td class=\"mat-cell\" colspan=\"100\">No data matching</td></tr>\n\n <!-- Paginator -->\n <mat-paginator *ngIf=\"dataItems && hasPagination\" [pageIndex]=\"pageIndex\" [length]=\"dataItems!.total\" [pageSize]=\"pageSize\" [pageSizeOptions]=\"[5, 10, 25, 50, 100]\" (page)=\"onPageChange($event)\"></mat-paginator>\n </table>\n</div>", styles: [""], 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: i2$1.MatTable, selector: "mat-table, table[mat-table]", exportAs: ["matTable"] }, { kind: "directive", type: i2$1.MatHeaderCellDef, selector: "[matHeaderCellDef]" }, { kind: "directive", type: i2$1.MatHeaderRowDef, selector: "[matHeaderRowDef]", inputs: ["matHeaderRowDef", "matHeaderRowDefSticky"] }, { kind: "directive", type: i2$1.MatColumnDef, selector: "[matColumnDef]", inputs: ["sticky", "matColumnDef"] }, { kind: "directive", type: i2$1.MatCellDef, selector: "[matCellDef]" }, { kind: "directive", type: i2$1.MatRowDef, selector: "[matRowDef]", inputs: ["matRowDefColumns", "matRowDefWhen"] }, { kind: "directive", type: i2$1.MatHeaderCell, selector: "mat-header-cell, th[mat-header-cell]" }, { kind: "directive", type: i2$1.MatCell, selector: "mat-cell, td[mat-cell]" }, { kind: "component", type: i2$1.MatHeaderRow, selector: "mat-header-row, tr[mat-header-row]", exportAs: ["matHeaderRow"] }, { kind: "component", type: i2$1.MatRow, selector: "mat-row, tr[mat-row]", exportAs: ["matRow"] }, { kind: "directive", type: i2$1.MatNoDataRow, selector: "ng-template[matNoDataRow]" }, { kind: "component", type: i3$1.MatPaginator, selector: "mat-paginator", inputs: ["disabled"], exportAs: ["matPaginator"] }, { kind: "component", type: BasePrintColumnComponent, selector: "tots-base-print-column", inputs: ["column", "item", "onAction"] }] });
|
|
141
179
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.3", ngImport: i0, type: TotsTableComponent, decorators: [{
|
|
142
180
|
type: Component,
|
|
143
|
-
args: [{ selector: 'tots-table', template: "<div class=\"tots-table-container\">\n <table *ngIf=\"dataItems\" mat-table [dataSource]=\"dataItems!.data\">\n \n <ng-container *ngFor=\"let column of config.columns\" [matColumnDef]=\"column.key\">\n <!-- TH-->\n <th mat-header-cell *matHeaderCellDef>{{ column.title }}</th>\n <!-- TD -->\n <td mat-cell *matCellDef=\"let item\"><tots-base-print-column [column]=\"column\" [item]=\"item\"></tots-base-print-column></td>\n </ng-container>\n\n <tr mat-header-row *matHeaderRowDef=\"displayColumns\"></tr>\n <tr mat-row *matRowDef=\"let row; columns: displayColumns;\" (click)=\"onClickRow(row)\"></tr>\n \n <!-- Row shown when there is no matching data. -->\n <tr class=\"mat-row\" *matNoDataRow><td class=\"mat-cell\" colspan=\"100\">No data matching</td></tr>\n\n <!-- Paginator -->\n <mat-paginator *ngIf=\"dataItems\" [pageIndex]=\"pageIndex\" [length]=\"dataItems!.total\" [pageSize]=\"pageSize\" [pageSizeOptions]=\"[5, 10, 25, 50, 100]\" (page)=\"onPageChange($event)\"></mat-paginator>\n </table>\n</div>" }]
|
|
181
|
+
args: [{ selector: 'tots-table', template: "<div class=\"tots-table-container\">\n <table *ngIf=\"dataItems\" mat-table [dataSource]=\"dataItems!.data\">\n \n <ng-container *ngFor=\"let column of config.columns\" [matColumnDef]=\"column.key\">\n <!-- TH-->\n <th mat-header-cell *matHeaderCellDef>{{ column.title }}</th>\n <!-- TD -->\n <td mat-cell *matCellDef=\"let item\"><tots-base-print-column [column]=\"column\" [item]=\"item\"></tots-base-print-column></td>\n </ng-container>\n\n <tr mat-header-row *matHeaderRowDef=\"displayColumns\"></tr>\n <tr mat-row *matRowDef=\"let row; columns: displayColumns;\" (click)=\"onClickRow(row)\"></tr>\n \n <!-- Row shown when there is no matching data. -->\n <tr class=\"mat-row\" *matNoDataRow><td class=\"mat-cell\" colspan=\"100\">No data matching</td></tr>\n\n <!-- Paginator -->\n <mat-paginator *ngIf=\"dataItems && hasPagination\" [pageIndex]=\"pageIndex\" [length]=\"dataItems!.total\" [pageSize]=\"pageSize\" [pageSizeOptions]=\"[5, 10, 25, 50, 100]\" (page)=\"onPageChange($event)\"></mat-paginator>\n </table>\n</div>" }]
|
|
144
182
|
}], propDecorators: { config: [{
|
|
145
183
|
type: Input
|
|
146
184
|
}], pageIndex: [{
|
|
147
185
|
type: Input
|
|
148
186
|
}], pageSize: [{
|
|
149
187
|
type: Input
|
|
188
|
+
}], hasPagination: [{
|
|
189
|
+
type: Input
|
|
150
190
|
}], onAction: [{
|
|
151
191
|
type: Output
|
|
152
192
|
}] } });
|
|
153
193
|
|
|
154
|
-
class TotsTableApiConfig {
|
|
155
|
-
constructor() {
|
|
156
|
-
this.id = '';
|
|
157
|
-
this.columns = [];
|
|
158
|
-
this.query = new TotsQuery();
|
|
159
|
-
}
|
|
160
|
-
}
|
|
161
|
-
|
|
162
194
|
class TotsTableApiComponent {
|
|
163
195
|
constructor() {
|
|
164
196
|
this.config = new TotsTableApiConfig();
|
|
197
|
+
this.hasPagination = true;
|
|
165
198
|
this.onAction = new EventEmitter();
|
|
166
199
|
this.configTable = new TotsTableConfig();
|
|
167
200
|
}
|
|
@@ -173,6 +206,7 @@ class TotsTableApiComponent {
|
|
|
173
206
|
this.config.query.per_page = action.item.pageSize;
|
|
174
207
|
this.config.query.page = action.item.pageIndex + 1;
|
|
175
208
|
}
|
|
209
|
+
this.onAction.emit(action);
|
|
176
210
|
}
|
|
177
211
|
loadConfig() {
|
|
178
212
|
this.configTable.id = this.config.id;
|
|
@@ -181,12 +215,14 @@ class TotsTableApiComponent {
|
|
|
181
215
|
}
|
|
182
216
|
}
|
|
183
217
|
TotsTableApiComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.3", ngImport: i0, type: TotsTableApiComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
184
|
-
TotsTableApiComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.0.3", type: TotsTableApiComponent, selector: "tots-table-api", inputs: { config: "config" }, outputs: { onAction: "onAction" }, ngImport: i0, template: "<tots-table #tableComp [config]=\"configTable\" [pageIndex]=\"config.query.page\" [pageSize]=\"config.query.per_page\" (onAction)=\"onTableAction($event)\"></tots-table>\n", styles: [""], dependencies: [{ kind: "component", type: TotsTableComponent, selector: "tots-table", inputs: ["config", "pageIndex", "pageSize"], outputs: ["onAction"] }] });
|
|
218
|
+
TotsTableApiComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.0.3", type: TotsTableApiComponent, selector: "tots-table-api", inputs: { config: "config", hasPagination: "hasPagination" }, outputs: { onAction: "onAction" }, ngImport: i0, template: "<tots-table #tableComp [config]=\"configTable\" [pageIndex]=\"config.query.page\" [pageSize]=\"config.query.per_page\" (onAction)=\"onTableAction($event)\"></tots-table>\n", styles: [""], dependencies: [{ kind: "component", type: TotsTableComponent, selector: "tots-table", inputs: ["config", "pageIndex", "pageSize", "hasPagination"], outputs: ["onAction"] }] });
|
|
185
219
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.3", ngImport: i0, type: TotsTableApiComponent, decorators: [{
|
|
186
220
|
type: Component,
|
|
187
221
|
args: [{ selector: 'tots-table-api', template: "<tots-table #tableComp [config]=\"configTable\" [pageIndex]=\"config.query.page\" [pageSize]=\"config.query.per_page\" (onAction)=\"onTableAction($event)\"></tots-table>\n" }]
|
|
188
222
|
}], propDecorators: { config: [{
|
|
189
223
|
type: Input
|
|
224
|
+
}], hasPagination: [{
|
|
225
|
+
type: Input
|
|
190
226
|
}], onAction: [{
|
|
191
227
|
type: Output
|
|
192
228
|
}] } });
|
|
@@ -197,15 +233,22 @@ TotsTableModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version:
|
|
|
197
233
|
TotsTableModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.0.3", ngImport: i0, type: TotsTableModule, declarations: [TotsTableComponent,
|
|
198
234
|
BasePrintColumnComponent,
|
|
199
235
|
StringColumnComponent,
|
|
200
|
-
TotsTableApiComponent
|
|
236
|
+
TotsTableApiComponent,
|
|
237
|
+
MoreMenuColumnComponent], imports: [CommonModule,
|
|
201
238
|
// Angular Material
|
|
239
|
+
MatIconModule,
|
|
202
240
|
MatTableModule,
|
|
203
|
-
MatPaginatorModule
|
|
241
|
+
MatPaginatorModule,
|
|
242
|
+
MatButtonModule,
|
|
243
|
+
MatMenuModule], exports: [TotsTableComponent,
|
|
204
244
|
TotsTableApiComponent] });
|
|
205
245
|
TotsTableModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.0.3", ngImport: i0, type: TotsTableModule, imports: [CommonModule,
|
|
206
246
|
// Angular Material
|
|
247
|
+
MatIconModule,
|
|
207
248
|
MatTableModule,
|
|
208
|
-
MatPaginatorModule
|
|
249
|
+
MatPaginatorModule,
|
|
250
|
+
MatButtonModule,
|
|
251
|
+
MatMenuModule] });
|
|
209
252
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.3", ngImport: i0, type: TotsTableModule, decorators: [{
|
|
210
253
|
type: NgModule,
|
|
211
254
|
args: [{
|
|
@@ -213,13 +256,17 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.3", ngImpor
|
|
|
213
256
|
TotsTableComponent,
|
|
214
257
|
BasePrintColumnComponent,
|
|
215
258
|
StringColumnComponent,
|
|
216
|
-
TotsTableApiComponent
|
|
259
|
+
TotsTableApiComponent,
|
|
260
|
+
MoreMenuColumnComponent
|
|
217
261
|
],
|
|
218
262
|
imports: [
|
|
219
263
|
CommonModule,
|
|
220
264
|
// Angular Material
|
|
265
|
+
MatIconModule,
|
|
221
266
|
MatTableModule,
|
|
222
|
-
MatPaginatorModule
|
|
267
|
+
MatPaginatorModule,
|
|
268
|
+
MatButtonModule,
|
|
269
|
+
MatMenuModule,
|
|
223
270
|
],
|
|
224
271
|
exports: [
|
|
225
272
|
TotsTableComponent,
|
|
@@ -236,5 +283,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.3", ngImpor
|
|
|
236
283
|
* Generated bundle index. Do not edit.
|
|
237
284
|
*/
|
|
238
285
|
|
|
239
|
-
export { StringColumnComponent, TotsActionTable, TotsBaseColumnComponent, TotsColumn, TotsTableApiComponent, TotsTableComponent, TotsTableConfig, TotsTableHelper, TotsTableModule };
|
|
286
|
+
export { MoreMenuColumnComponent, StringColumnComponent, TotsActionTable, TotsBaseColumnComponent, TotsColumn, TotsTableApiComponent, TotsTableApiConfig, TotsTableComponent, TotsTableConfig, TotsTableHelper, TotsTableModule };
|
|
240
287
|
//# sourceMappingURL=tots-table.mjs.map
|