ngx-aur-mat-table 12.2.15 → 12.2.18
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/bundles/ngx-aur-mat-table.umd.js +123 -12
- package/bundles/ngx-aur-mat-table.umd.js.map +1 -1
- package/esm2015/lib/ngx-aur-mat-table.component.js +18 -9
- package/esm2015/lib/utils/ngx-aur-table-config.util.js +15 -0
- package/esm2015/public-api.js +2 -1
- package/fesm2015/ngx-aur-mat-table.js +33 -9
- package/fesm2015/ngx-aur-mat-table.js.map +1 -1
- package/lib/ngx-aur-mat-table.component.d.ts +4 -2
- package/lib/utils/ngx-aur-table-config.util.d.ts +12 -0
- package/package.json +1 -1
- package/public-api.d.ts +1 -0
|
@@ -34,6 +34,24 @@
|
|
|
34
34
|
var i6__namespace = /*#__PURE__*/_interopNamespace(i6);
|
|
35
35
|
var i10__namespace = /*#__PURE__*/_interopNamespace(i10);
|
|
36
36
|
|
|
37
|
+
var NgxAurTableConfigUtil = /** @class */ (function () {
|
|
38
|
+
function NgxAurTableConfigUtil() {
|
|
39
|
+
}
|
|
40
|
+
NgxAurTableConfigUtil.keys = function (config) {
|
|
41
|
+
return config.columnsCfg.map(function (config) { return config.key; });
|
|
42
|
+
};
|
|
43
|
+
NgxAurTableConfigUtil.namedKeys = function (config) {
|
|
44
|
+
return config.columnsCfg.map(function (cfg) { return ({ name: cfg.name, key: cfg.key }); });
|
|
45
|
+
};
|
|
46
|
+
/**
|
|
47
|
+
* @return Map where the key is 'key' and the value is 'name'
|
|
48
|
+
*/
|
|
49
|
+
NgxAurTableConfigUtil.keyNameMap = function (config) {
|
|
50
|
+
return new Map(config.columnsCfg.map(function (cfg) { return [cfg.key, cfg.name]; }));
|
|
51
|
+
};
|
|
52
|
+
return NgxAurTableConfigUtil;
|
|
53
|
+
}());
|
|
54
|
+
|
|
37
55
|
/******************************************************************************
|
|
38
56
|
Copyright (c) Microsoft Corporation.
|
|
39
57
|
|
|
@@ -48,7 +66,7 @@
|
|
|
48
66
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
49
67
|
PERFORMANCE OF THIS SOFTWARE.
|
|
50
68
|
***************************************************************************** */
|
|
51
|
-
/* global Reflect, Promise */
|
|
69
|
+
/* global Reflect, Promise, SuppressedError, Symbol */
|
|
52
70
|
var extendStatics = function (d, b) {
|
|
53
71
|
extendStatics = Object.setPrototypeOf ||
|
|
54
72
|
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
@@ -127,11 +145,11 @@
|
|
|
127
145
|
if (_ = accept(result.set))
|
|
128
146
|
descriptor.set = _;
|
|
129
147
|
if (_ = accept(result.init))
|
|
130
|
-
initializers.
|
|
148
|
+
initializers.unshift(_);
|
|
131
149
|
}
|
|
132
150
|
else if (_ = accept(result)) {
|
|
133
151
|
if (kind === "field")
|
|
134
|
-
initializers.
|
|
152
|
+
initializers.unshift(_);
|
|
135
153
|
else
|
|
136
154
|
descriptor[key] = _;
|
|
137
155
|
}
|
|
@@ -417,7 +435,86 @@
|
|
|
417
435
|
if (receiver === null || (typeof receiver !== "object" && typeof receiver !== "function"))
|
|
418
436
|
throw new TypeError("Cannot use 'in' operator on non-object");
|
|
419
437
|
return typeof state === "function" ? receiver === state : state.has(receiver);
|
|
420
|
-
}
|
|
438
|
+
}
|
|
439
|
+
function __addDisposableResource(env, value, async) {
|
|
440
|
+
if (value !== null && value !== void 0) {
|
|
441
|
+
if (typeof value !== "object")
|
|
442
|
+
throw new TypeError("Object expected.");
|
|
443
|
+
var dispose;
|
|
444
|
+
if (async) {
|
|
445
|
+
if (!Symbol.asyncDispose)
|
|
446
|
+
throw new TypeError("Symbol.asyncDispose is not defined.");
|
|
447
|
+
dispose = value[Symbol.asyncDispose];
|
|
448
|
+
}
|
|
449
|
+
if (dispose === void 0) {
|
|
450
|
+
if (!Symbol.dispose)
|
|
451
|
+
throw new TypeError("Symbol.dispose is not defined.");
|
|
452
|
+
dispose = value[Symbol.dispose];
|
|
453
|
+
}
|
|
454
|
+
if (typeof dispose !== "function")
|
|
455
|
+
throw new TypeError("Object not disposable.");
|
|
456
|
+
env.stack.push({ value: value, dispose: dispose, async: async });
|
|
457
|
+
}
|
|
458
|
+
else if (async) {
|
|
459
|
+
env.stack.push({ async: true });
|
|
460
|
+
}
|
|
461
|
+
return value;
|
|
462
|
+
}
|
|
463
|
+
var _SuppressedError = typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
|
464
|
+
var e = new Error(message);
|
|
465
|
+
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
466
|
+
};
|
|
467
|
+
function __disposeResources(env) {
|
|
468
|
+
function fail(e) {
|
|
469
|
+
env.error = env.hasError ? new _SuppressedError(e, env.error, "An error was suppressed during disposal.") : e;
|
|
470
|
+
env.hasError = true;
|
|
471
|
+
}
|
|
472
|
+
function next() {
|
|
473
|
+
while (env.stack.length) {
|
|
474
|
+
var rec = env.stack.pop();
|
|
475
|
+
try {
|
|
476
|
+
var result = rec.dispose && rec.dispose.call(rec.value);
|
|
477
|
+
if (rec.async)
|
|
478
|
+
return Promise.resolve(result).then(next, function (e) { fail(e); return next(); });
|
|
479
|
+
}
|
|
480
|
+
catch (e) {
|
|
481
|
+
fail(e);
|
|
482
|
+
}
|
|
483
|
+
}
|
|
484
|
+
if (env.hasError)
|
|
485
|
+
throw env.error;
|
|
486
|
+
}
|
|
487
|
+
return next();
|
|
488
|
+
}
|
|
489
|
+
var tslib_es6 = {
|
|
490
|
+
__extends: __extends,
|
|
491
|
+
__assign: __assign,
|
|
492
|
+
__rest: __rest,
|
|
493
|
+
__decorate: __decorate,
|
|
494
|
+
__param: __param,
|
|
495
|
+
__metadata: __metadata,
|
|
496
|
+
__awaiter: __awaiter,
|
|
497
|
+
__generator: __generator,
|
|
498
|
+
__createBinding: __createBinding,
|
|
499
|
+
__exportStar: __exportStar,
|
|
500
|
+
__values: __values,
|
|
501
|
+
__read: __read,
|
|
502
|
+
__spread: __spread,
|
|
503
|
+
__spreadArrays: __spreadArrays,
|
|
504
|
+
__spreadArray: __spreadArray,
|
|
505
|
+
__await: __await,
|
|
506
|
+
__asyncGenerator: __asyncGenerator,
|
|
507
|
+
__asyncDelegator: __asyncDelegator,
|
|
508
|
+
__asyncValues: __asyncValues,
|
|
509
|
+
__makeTemplateObject: __makeTemplateObject,
|
|
510
|
+
__importStar: __importStar,
|
|
511
|
+
__importDefault: __importDefault,
|
|
512
|
+
__classPrivateFieldGet: __classPrivateFieldGet,
|
|
513
|
+
__classPrivateFieldSet: __classPrivateFieldSet,
|
|
514
|
+
__classPrivateFieldIn: __classPrivateFieldIn,
|
|
515
|
+
__addDisposableResource: __addDisposableResource,
|
|
516
|
+
__disposeResources: __disposeResources,
|
|
517
|
+
};
|
|
421
518
|
|
|
422
519
|
var EmptyValue = /** @class */ (function () {
|
|
423
520
|
function EmptyValue() {
|
|
@@ -934,7 +1031,8 @@
|
|
|
934
1031
|
var NgxAurMatTableComponent = /** @class */ (function () {
|
|
935
1032
|
function NgxAurMatTableComponent() {
|
|
936
1033
|
this.tableDataSource = new i3.MatTableDataSource([]);
|
|
937
|
-
this.
|
|
1034
|
+
this._displayColumns = [];
|
|
1035
|
+
this._customDisplayColumnsEnabled = false;
|
|
938
1036
|
this.tableView = [];
|
|
939
1037
|
this.tableData = [];
|
|
940
1038
|
this.sort = new i0.EventEmitter();
|
|
@@ -963,8 +1061,16 @@
|
|
|
963
1061
|
this.customSortFunctions = new Map();
|
|
964
1062
|
this.filterStorage = new Map();
|
|
965
1063
|
}
|
|
1064
|
+
Object.defineProperty(NgxAurMatTableComponent.prototype, "displayColumns", {
|
|
1065
|
+
set: function (columns) {
|
|
1066
|
+
this._displayColumns = columns;
|
|
1067
|
+
this._customDisplayColumnsEnabled = columns && columns.length > 0;
|
|
1068
|
+
},
|
|
1069
|
+
enumerable: false,
|
|
1070
|
+
configurable: true
|
|
1071
|
+
});
|
|
966
1072
|
NgxAurMatTableComponent.prototype.ngOnChanges = function (changes) {
|
|
967
|
-
if (changes['tableData'] && this.tableData) {
|
|
1073
|
+
if ((changes['tableData'] && this.tableData) || (changes['displayColumns'] && this._displayColumns)) {
|
|
968
1074
|
this.prepareTableData();
|
|
969
1075
|
}
|
|
970
1076
|
if (changes['highlight'] && this.highlight) {
|
|
@@ -1030,12 +1136,12 @@
|
|
|
1030
1136
|
this.initPaginator();
|
|
1031
1137
|
this.initSortingDataAccessor();
|
|
1032
1138
|
this.indexProvider = IndexProvider.create(this.tableConfig)
|
|
1033
|
-
.addIndexColumn(this.
|
|
1139
|
+
.addIndexColumn(this._displayColumns);
|
|
1034
1140
|
this.rowActionsProvider = RowActionProvider.create(this.tableConfig)
|
|
1035
|
-
.addActionColumn(this.
|
|
1141
|
+
.addActionColumn(this._displayColumns)
|
|
1036
1142
|
.setView(this.tableDataSource.data);
|
|
1037
1143
|
this.selectionProvider = SelectionProvider.create(this.tableConfig, this.tableDataSource)
|
|
1038
|
-
.addCheckboxColumn(this.
|
|
1144
|
+
.addCheckboxColumn(this._displayColumns)
|
|
1039
1145
|
.bindEventEmitters(this.selected, this.onSelect, this.onDeselect);
|
|
1040
1146
|
this.paginationProvider = PaginationProvider.create(this.tableConfig);
|
|
1041
1147
|
this.totalRowProvider = TotalRowProvider.create(this.tableConfig, this.tableDataSource)
|
|
@@ -1051,7 +1157,9 @@
|
|
|
1051
1157
|
NgxAurMatTableComponent.prototype.initTable = function () {
|
|
1052
1158
|
this.tableDataSource = MatTableDataSourceFactory.convert(this.tableData, this.tableConfig.columnsCfg);
|
|
1053
1159
|
this.tableView = TableViewFactory.toView(this.tableDataSource.data, this.tableConfig);
|
|
1054
|
-
|
|
1160
|
+
if (!this._customDisplayColumnsEnabled) {
|
|
1161
|
+
this._displayColumns = DisplayColumnsFactory.create(this.tableConfig);
|
|
1162
|
+
}
|
|
1055
1163
|
};
|
|
1056
1164
|
NgxAurMatTableComponent.prototype.applySearchFilter = function (event) {
|
|
1057
1165
|
var filterValue = event.target.value;
|
|
@@ -1119,7 +1227,7 @@
|
|
|
1119
1227
|
return NgxAurMatTableComponent;
|
|
1120
1228
|
}());
|
|
1121
1229
|
NgxAurMatTableComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: NgxAurMatTableComponent, deps: [], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
1122
|
-
NgxAurMatTableComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: NgxAurMatTableComponent, selector: "aur-mat-table", inputs: { tableConfig: "tableConfig", tableData: "tableData", highlight: "highlight" }, outputs: { sort: "sort", onRowAction: "onRowAction", selected: "selected", onSelect: "onSelect", onDeselect: "onDeselect", onSelectedRowsAction: "onSelectedRowsAction", onRowClick: "onRowClick", onFilter: "onFilter", columnOffsets: "columnOffsets" }, viewQueries: [{ propertyName: "table", first: true, predicate: ["table"], descendants: true, read: i0.ElementRef }, { propertyName: "matPaginator", first: true, predicate: i8.MatPaginator, descendants: true }, { propertyName: "matSort", first: true, predicate: i7.MatSort, descendants: true, static: true }, { propertyName: "rows", predicate: ["rowLink"], descendants: true, read: i0.ElementRef }], usesOnChanges: true, ngImport: i0__namespace, template: "<div class=\"aur-mat-table\">\r\n <ng-container>\r\n\r\n <!-- Filter -->\r\n <ng-container *ngIf=\"tableConfig.filterCfg\">\r\n <mat-form-field>\r\n <mat-label>{{tableConfig.filterCfg?.label}}</mat-label>\r\n <input matInput (keyup)=\"applySearchFilter($event)\"\r\n placeholder=\"{{tableConfig.filterCfg?.placeholder}}\"\r\n style=\"font-size: 18px;\">\r\n <mat-icon matPrefix>search</mat-icon>\r\n </mat-form-field>\r\n </ng-container>\r\n\r\n <!-- Table -->\r\n <table #table mat-table matSort\r\n [dataSource]=\"tableDataSource\"\r\n (matSortChange)=\"sortTable($event)\"\r\n [style.height]=\"tableConfig.tableView?.height\"\r\n [style.max-height]=\"tableConfig.tableView?.maxHeight\"\r\n [style.min-height]=\"tableConfig.tableView?.minHeight\">\r\n\r\n <!-- index-column-->\r\n <ng-container *ngIf=\"indexProvider.isEnabled\" [matColumnDef]=\"indexProvider.COLUMN_NAME\">\r\n\r\n <th mat-header-cell *matHeaderCellDef>\r\n <lib-column-view [config]=\"indexProvider.headerView\">\r\n {{indexProvider.name}}\r\n </lib-column-view>\r\n </th>\r\n\r\n <td mat-cell *matCellDef=\"let element; let rowIndex = index\">\r\n {{rowIndex + indexProvider.offset}}\r\n </td>\r\n\r\n <td mat-footer-cell *matFooterCellDef>\r\n {{totalRowProvider.totals.get(indexProvider.COLUMN_NAME) || ''}}\r\n </td>\r\n </ng-container>\r\n\r\n <!-- selection-column-->\r\n <ng-container [matColumnDef]=\"selectionProvider.COLUMN_NAME\" *ngIf=\"selectionProvider.isEnabled\">\r\n <th mat-header-cell *matHeaderCellDef>\r\n <div class=\"flex-container\">\r\n <mat-checkbox (change)=\"$event ? masterToggle() : null\"\r\n [checked]=\"selectionProvider.selection.hasValue() && isAllSelected()\"\r\n [indeterminate]=\"selectionProvider.selection.hasValue() && !isAllSelected()\">\r\n </mat-checkbox>\r\n <div\r\n *ngIf=\"tableConfig.selectionCfg?.showSelectedCount && selectionProvider.selection.hasValue()\">\r\n ({{selectionProvider.selection.selected.length}}/{{tableDataSource.filteredData.length}})\r\n </div>\r\n\r\n <div *ngIf=\"selectionProvider.selection.hasValue() && tableConfig?.selectionCfg?.actions\">\r\n <button mat-icon-button\r\n (click)=\"emitSelectedRowsAction(action.action, selectionProvider.selection.selected)\"\r\n [matTooltip]=\"action.icon.tooltip || ''\"\r\n *ngFor=\"let action of tableConfig.selectionCfg!.actions\">\r\n <mat-icon [style.color]=\"action.icon.color\">\r\n {{action.icon.name}}\r\n </mat-icon>\r\n </button>\r\n </div>\r\n </div>\r\n\r\n </th>\r\n <td mat-cell *matCellDef=\"let row\">\r\n <mat-checkbox (click)=\"$event.stopPropagation()\"\r\n (change)=\"$event ? selectionProvider.selection.toggle(castSrc(row).rowSrc) : null\"\r\n [checked]=\"selectionProvider.selection.isSelected(castSrc(row).rowSrc)\">\r\n </mat-checkbox>\r\n </td>\r\n\r\n <ng-container *ngTemplateOutlet=\"footerCellTemplate; context: {$implicit: selectionProvider.COLUMN_NAME}\">\r\n </ng-container>\r\n </ng-container>\r\n\r\n <!-- action column -->\r\n <ng-container *ngIf=\"rowActionsProvider.isEnabled\" [matColumnDef]=\"rowActionsProvider.COLUMN_NAME\">\r\n <th mat-header-cell *matHeaderCellDef></th>\r\n <td mat-cell *matCellDef=\"let element\">\r\n <button mat-icon-button\r\n (click)=\"emitRowAction(action.action, element.rowSrc, $event)\"\r\n [matTooltip]=\"action.icon.tooltip || ''\"\r\n *ngFor=\"let action of rowActionsProvider.actionView.get(element.id)\">\r\n <mat-icon [style.color]=\"action.icon.color\">\r\n {{action.icon.name}}\r\n </mat-icon>\r\n </button>\r\n </td>\r\n\r\n <ng-container *ngTemplateOutlet=\"footerCellTemplate; context: {$implicit: rowActionsProvider.COLUMN_NAME}\">\r\n </ng-container>\r\n </ng-container>\r\n\r\n <!-- value-icon-->\r\n <ng-container *ngFor=\"let columnConfig of tableConfig.columnsCfg\" [matColumnDef]=\"columnConfig.key\">\r\n\r\n <!-- if sortable column header -->\r\n <ng-container *ngIf=\"columnConfig.sort && columnConfig.sort.enable; else notSortable\">\r\n <th mat-header-cell *matHeaderCellDef [mat-sort-header]=\"columnConfig.key\"\r\n [arrowPosition]=\"columnConfig.sort.position === 'right' ? 'before' : 'after'\">\r\n <ng-container *ngTemplateOutlet=\"headerValue\"></ng-container>\r\n </th>\r\n </ng-container>\r\n\r\n <!-- else not sortable -->\r\n <ng-template #notSortable>\r\n <th mat-header-cell *matHeaderCellDef>\r\n <ng-container *ngTemplateOutlet=\"headerValue\"></ng-container>\r\n </th>\r\n </ng-template>\r\n\r\n <!-- header value-->\r\n <ng-template #headerValue>\r\n <lib-column-view [config]=\"columnConfig.headerView\"\r\n [value]=\"columnConfig.name\">\r\n </lib-column-view>\r\n </ng-template>\r\n\r\n <!-- column value \u043F\u043E\u043B\u0443\u0447\u0430\u0442\u044C \u043D\u0430\u0441\u0442\u0440\u043E\u0439\u043A\u0438 \u043A\u043E\u043B\u043E\u043D\u043E\u043A \u043D\u0443\u0436\u043D\u043E \u0447\u0435\u0440\u0435\u0437 getView(rowIndex, columnConfig.key) \u0442\u0430\u043C \u043D\u0430\u0445\u043E\u0434\u044F\u0442\u0441\u044F \u0443\u0436\u0435\r\n \u043F\u043E\u0434\u0433\u043E\u0442\u043E\u0432\u043B\u0435\u043D\u043D\u044B\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u044F \u0434\u043B\u044F \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u043D\u0438\u044F-->\r\n <td mat-cell *matCellDef=\"let element;\">\r\n <lib-column-view\r\n [config]=\"tableView[element.id]?.get(columnConfig.key)\"\r\n [value]=\"element | dataPropertyGetter: columnConfig.key\">\r\n </lib-column-view>\r\n </td>\r\n\r\n <td mat-footer-cell *matFooterCellDef>\r\n {{ totalRowProvider.totals.get(columnConfig.key) || '' }}\r\n </td>\r\n\r\n </ng-container>\r\n\r\n <tr mat-header-row *matHeaderRowDef=\"displayedColumns; sticky: this.tableConfig.stickyCfg?.header\"></tr>\r\n <tr mat-row #rowLink\r\n *matRowDef=\"let row; columns: displayedColumns;\"\r\n (click)=\"rowClick(row)\"\r\n [ngClass]=\"{'pointer': tableConfig.clickCfg?.pointer || false, 'new-color': highlighted===row.rowSrc && tableConfig?.clickCfg?.highlightClicked?.color}\"\r\n [ngStyle]=\"{\r\n 'color': highlighted===row.rowSrc? tableConfig?.clickCfg?.highlightClicked?.color : undefined,\r\n 'background-color': highlighted === row.rowSrc? tableConfig?.clickCfg?.highlightClicked?.background : undefined,\r\n 'border': highlighted === row.rowSrc? tableConfig?.clickCfg?.highlightClicked?.border : undefined\r\n }\">\r\n </tr>\r\n <ng-container *ngIf=\"totalRowProvider.isEnabled\">\r\n <tr mat-footer-row *matFooterRowDef=\"displayedColumns\" [style]=\"totalRowProvider.style\"></tr>\r\n </ng-container>\r\n </table>\r\n\r\n <!-- Pagination -->\r\n <mat-paginator *ngIf=\"paginationProvider.isEnabled\"\r\n [pageSizeOptions]=\"paginationProvider.sizes\"\r\n [pageSize]=\"paginationProvider.size\"\r\n showFirstLastButtons>\r\n </mat-paginator>\r\n </ng-container>\r\n</div>\r\n\r\n<ng-template #footerCellTemplate let-columnName>\r\n <td mat-footer-cell *matFooterCellDef>\r\n {{ totalRowProvider.totals.get(columnName) || '' }}\r\n </td>\r\n</ng-template>\r\n", styles: [".aur-mat-table table{width:100%;border-collapse:collapse}.aur-mat-table th,td{padding:10px!important}.aur-mat-table .new-color td.mat-cell,.aur-mat-table .new-color td.mat-footer-cell{color:inherit}.aur-mat-table mat-form-field{width:100%}.aur-mat-table .text-right{text-align:right!important}.aur-mat-table .pointer:hover{background-color:#f2f2f2;cursor:pointer}.aur-mat-table .flex-container{display:flex;align-items:center}\n"], components: [{ type: i1__namespace$1.MatFormField, selector: "mat-form-field", inputs: ["color", "floatLabel", "appearance", "hideRequiredMarker", "hintLabel"], exportAs: ["matFormField"] }, { type: i1__namespace.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { type: i3__namespace$1.MatTable, selector: "mat-table, table[mat-table]", exportAs: ["matTable"] }, { type: ColumnViewComponent, selector: "lib-column-view", inputs: ["config", "value"] }, { type: i5__namespace.MatCheckbox, selector: "mat-checkbox", inputs: ["disableRipple", "color", "tabIndex", "aria-label", "aria-labelledby", "id", "labelPosition", "name", "required", "checked", "disabled", "indeterminate", "aria-describedby", "value"], outputs: ["change", "indeterminateChange"], exportAs: ["matCheckbox"] }, { type: i6__namespace.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { type: i7__namespace.MatSortHeader, selector: "[mat-sort-header]", inputs: ["disabled", "arrowPosition", "sortActionDescription", "disableClear", "mat-sort-header", "start"], exportAs: ["matSortHeader"] }, { type: i3__namespace$1.MatHeaderRow, selector: "mat-header-row, tr[mat-header-row]", exportAs: ["matHeaderRow"] }, { type: i3__namespace$1.MatRow, selector: "mat-row, tr[mat-row]", exportAs: ["matRow"] }, { type: i3__namespace$1.MatFooterRow, selector: "mat-footer-row, tr[mat-footer-row]", exportAs: ["matFooterRow"] }, { type: i8__namespace.MatPaginator, selector: "mat-paginator", inputs: ["disabled"], exportAs: ["matPaginator"] }], directives: [{ type: i9__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1__namespace$1.MatLabel, selector: "mat-label" }, { type: i10__namespace.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["id", "disabled", "required", "type", "value", "readonly", "placeholder", "errorStateMatcher", "aria-describedby"], exportAs: ["matInput"] }, { type: i1__namespace$1.MatPrefix, selector: "[matPrefix]" }, { type: i7__namespace.MatSort, selector: "[matSort]", inputs: ["matSortDisabled", "matSortStart", "matSortDirection", "matSortDisableClear", "matSortActive"], outputs: ["matSortChange"], exportAs: ["matSort"] }, { type: i3__namespace$1.MatColumnDef, selector: "[matColumnDef]", inputs: ["sticky", "matColumnDef"] }, { type: i3__namespace$1.MatHeaderCellDef, selector: "[matHeaderCellDef]" }, { type: i3__namespace$1.MatHeaderCell, selector: "mat-header-cell, th[mat-header-cell]" }, { type: i3__namespace$1.MatCellDef, selector: "[matCellDef]" }, { type: i3__namespace$1.MatCell, selector: "mat-cell, td[mat-cell]" }, { type: i3__namespace$1.MatFooterCellDef, selector: "[matFooterCellDef]" }, { type: i3__namespace$1.MatFooterCell, selector: "mat-footer-cell, td[mat-footer-cell]" }, { type: i9__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i3__namespace.MatTooltip, selector: "[matTooltip]", exportAs: ["matTooltip"] }, { type: i9__namespace.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }, { type: i3__namespace$1.MatHeaderRowDef, selector: "[matHeaderRowDef]", inputs: ["matHeaderRowDef", "matHeaderRowDefSticky"] }, { type: i3__namespace$1.MatRowDef, selector: "[matRowDef]", inputs: ["matRowDefColumns", "matRowDefWhen"] }, { type: i9__namespace.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i9__namespace.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { type: i3__namespace$1.MatFooterRowDef, selector: "[matFooterRowDef]", inputs: ["matFooterRowDef", "matFooterRowDefSticky"] }], pipes: { "dataPropertyGetter": DataPropertyGetterPipe }, changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush });
|
|
1230
|
+
NgxAurMatTableComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: NgxAurMatTableComponent, selector: "aur-mat-table", inputs: { displayColumns: "displayColumns", tableConfig: "tableConfig", tableData: "tableData", highlight: "highlight" }, outputs: { sort: "sort", onRowAction: "onRowAction", selected: "selected", onSelect: "onSelect", onDeselect: "onDeselect", onSelectedRowsAction: "onSelectedRowsAction", onRowClick: "onRowClick", onFilter: "onFilter", columnOffsets: "columnOffsets" }, viewQueries: [{ propertyName: "table", first: true, predicate: ["table"], descendants: true, read: i0.ElementRef }, { propertyName: "matPaginator", first: true, predicate: i8.MatPaginator, descendants: true }, { propertyName: "matSort", first: true, predicate: i7.MatSort, descendants: true, static: true }, { propertyName: "rows", predicate: ["rowLink"], descendants: true, read: i0.ElementRef }], usesOnChanges: true, ngImport: i0__namespace, template: "<div class=\"aur-mat-table\">\r\n <ng-container>\r\n\r\n <!-- Filter -->\r\n <ng-container *ngIf=\"tableConfig.filterCfg\">\r\n <mat-form-field>\r\n <mat-label>{{tableConfig.filterCfg?.label}}</mat-label>\r\n <input matInput (keyup)=\"applySearchFilter($event)\"\r\n placeholder=\"{{tableConfig.filterCfg?.placeholder}}\"\r\n style=\"font-size: 18px;\">\r\n <mat-icon matPrefix>search</mat-icon>\r\n </mat-form-field>\r\n </ng-container>\r\n\r\n <!-- Table -->\r\n <table #table mat-table matSort\r\n [dataSource]=\"tableDataSource\"\r\n (matSortChange)=\"sortTable($event)\"\r\n [style.height]=\"tableConfig.tableView?.height\"\r\n [style.max-height]=\"tableConfig.tableView?.maxHeight\"\r\n [style.min-height]=\"tableConfig.tableView?.minHeight\">\r\n\r\n <!-- index-column-->\r\n <ng-container *ngIf=\"indexProvider.isEnabled\" [matColumnDef]=\"indexProvider.COLUMN_NAME\">\r\n\r\n <th mat-header-cell *matHeaderCellDef>\r\n <lib-column-view [config]=\"indexProvider.headerView\">\r\n {{indexProvider.name}}\r\n </lib-column-view>\r\n </th>\r\n\r\n <td mat-cell *matCellDef=\"let element; let rowIndex = index\">\r\n {{rowIndex + indexProvider.offset}}\r\n </td>\r\n\r\n <td mat-footer-cell *matFooterCellDef>\r\n {{totalRowProvider.totals.get(indexProvider.COLUMN_NAME) || ''}}\r\n </td>\r\n </ng-container>\r\n\r\n <!-- selection-column-->\r\n <ng-container [matColumnDef]=\"selectionProvider.COLUMN_NAME\" *ngIf=\"selectionProvider.isEnabled\">\r\n <th mat-header-cell *matHeaderCellDef>\r\n <div class=\"flex-container\">\r\n <mat-checkbox (change)=\"$event ? masterToggle() : null\"\r\n [checked]=\"selectionProvider.selection.hasValue() && isAllSelected()\"\r\n [indeterminate]=\"selectionProvider.selection.hasValue() && !isAllSelected()\">\r\n </mat-checkbox>\r\n <div\r\n *ngIf=\"tableConfig.selectionCfg?.showSelectedCount && selectionProvider.selection.hasValue()\">\r\n ({{selectionProvider.selection.selected.length}}/{{tableDataSource.filteredData.length}})\r\n </div>\r\n\r\n <div *ngIf=\"selectionProvider.selection.hasValue() && tableConfig?.selectionCfg?.actions\">\r\n <button mat-icon-button\r\n (click)=\"emitSelectedRowsAction(action.action, selectionProvider.selection.selected)\"\r\n [matTooltip]=\"action.icon.tooltip || ''\"\r\n *ngFor=\"let action of tableConfig.selectionCfg!.actions\">\r\n <mat-icon [style.color]=\"action.icon.color\">\r\n {{action.icon.name}}\r\n </mat-icon>\r\n </button>\r\n </div>\r\n </div>\r\n\r\n </th>\r\n <td mat-cell *matCellDef=\"let row\">\r\n <mat-checkbox (click)=\"$event.stopPropagation()\"\r\n (change)=\"$event ? selectionProvider.selection.toggle(castSrc(row).rowSrc) : null\"\r\n [checked]=\"selectionProvider.selection.isSelected(castSrc(row).rowSrc)\">\r\n </mat-checkbox>\r\n </td>\r\n\r\n <ng-container *ngTemplateOutlet=\"footerCellTemplate; context: {$implicit: selectionProvider.COLUMN_NAME}\">\r\n </ng-container>\r\n </ng-container>\r\n\r\n <!-- action column -->\r\n <ng-container *ngIf=\"rowActionsProvider.isEnabled\" [matColumnDef]=\"rowActionsProvider.COLUMN_NAME\">\r\n <th mat-header-cell *matHeaderCellDef></th>\r\n <td mat-cell *matCellDef=\"let element\">\r\n <button mat-icon-button\r\n (click)=\"emitRowAction(action.action, element.rowSrc, $event)\"\r\n [matTooltip]=\"action.icon.tooltip || ''\"\r\n *ngFor=\"let action of rowActionsProvider.actionView.get(element.id)\">\r\n <mat-icon [style.color]=\"action.icon.color\">\r\n {{action.icon.name}}\r\n </mat-icon>\r\n </button>\r\n </td>\r\n\r\n <ng-container *ngTemplateOutlet=\"footerCellTemplate; context: {$implicit: rowActionsProvider.COLUMN_NAME}\">\r\n </ng-container>\r\n </ng-container>\r\n\r\n <!-- value-icon-->\r\n <ng-container *ngFor=\"let columnConfig of tableConfig.columnsCfg\" [matColumnDef]=\"columnConfig.key\">\r\n\r\n <!-- if sortable column header -->\r\n <ng-container *ngIf=\"columnConfig.sort && columnConfig.sort.enable; else notSortable\">\r\n <th mat-header-cell *matHeaderCellDef [mat-sort-header]=\"columnConfig.key\"\r\n [arrowPosition]=\"columnConfig.sort.position === 'right' ? 'before' : 'after'\">\r\n <ng-container *ngTemplateOutlet=\"headerValue\"></ng-container>\r\n </th>\r\n </ng-container>\r\n\r\n <!-- else not sortable -->\r\n <ng-template #notSortable>\r\n <th mat-header-cell *matHeaderCellDef>\r\n <ng-container *ngTemplateOutlet=\"headerValue\"></ng-container>\r\n </th>\r\n </ng-template>\r\n\r\n <!-- header value-->\r\n <ng-template #headerValue>\r\n <lib-column-view [config]=\"columnConfig.headerView\"\r\n [value]=\"columnConfig.name\">\r\n </lib-column-view>\r\n </ng-template>\r\n\r\n <!-- column value \u043F\u043E\u043B\u0443\u0447\u0430\u0442\u044C \u043D\u0430\u0441\u0442\u0440\u043E\u0439\u043A\u0438 \u043A\u043E\u043B\u043E\u043D\u043E\u043A \u043D\u0443\u0436\u043D\u043E \u0447\u0435\u0440\u0435\u0437 getView(rowIndex, columnConfig.key) \u0442\u0430\u043C \u043D\u0430\u0445\u043E\u0434\u044F\u0442\u0441\u044F \u0443\u0436\u0435\r\n \u043F\u043E\u0434\u0433\u043E\u0442\u043E\u0432\u043B\u0435\u043D\u043D\u044B\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u044F \u0434\u043B\u044F \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u043D\u0438\u044F-->\r\n <td mat-cell *matCellDef=\"let element;\">\r\n <lib-column-view\r\n [config]=\"tableView[element.id]?.get(columnConfig.key)\"\r\n [value]=\"element | dataPropertyGetter: columnConfig.key\">\r\n </lib-column-view>\r\n </td>\r\n\r\n <td mat-footer-cell *matFooterCellDef>\r\n {{ totalRowProvider.totals.get(columnConfig.key) || '' }}\r\n </td>\r\n\r\n </ng-container>\r\n\r\n <tr mat-header-row *matHeaderRowDef=\"_displayColumns; sticky: this.tableConfig.stickyCfg?.header\"></tr>\r\n <tr mat-row #rowLink\r\n *matRowDef=\"let row; columns: _displayColumns;\"\r\n (click)=\"rowClick(row)\"\r\n [ngClass]=\"{'pointer': tableConfig.clickCfg?.pointer || false, 'new-color': highlighted===row.rowSrc && tableConfig?.clickCfg?.highlightClicked?.color}\"\r\n [ngStyle]=\"{\r\n 'color': highlighted===row.rowSrc? tableConfig?.clickCfg?.highlightClicked?.color : undefined,\r\n 'background-color': highlighted === row.rowSrc? tableConfig?.clickCfg?.highlightClicked?.background : undefined,\r\n 'border': highlighted === row.rowSrc? tableConfig?.clickCfg?.highlightClicked?.border : undefined\r\n }\">\r\n </tr>\r\n <ng-container *ngIf=\"totalRowProvider.isEnabled\">\r\n <tr mat-footer-row *matFooterRowDef=\"_displayColumns\" [style]=\"totalRowProvider.style\"></tr>\r\n </ng-container>\r\n </table>\r\n\r\n <!-- Pagination -->\r\n <mat-paginator *ngIf=\"paginationProvider.isEnabled\"\r\n [pageSizeOptions]=\"paginationProvider.sizes\"\r\n [pageSize]=\"paginationProvider.size\"\r\n showFirstLastButtons>\r\n </mat-paginator>\r\n </ng-container>\r\n</div>\r\n\r\n<ng-template #footerCellTemplate let-columnName>\r\n <td mat-footer-cell *matFooterCellDef>\r\n {{ totalRowProvider.totals.get(columnName) || '' }}\r\n </td>\r\n</ng-template>\r\n", styles: [".aur-mat-table table{width:100%;border-collapse:collapse}.aur-mat-table th,td{padding:10px!important}.aur-mat-table .new-color td.mat-cell,.aur-mat-table .new-color td.mat-footer-cell{color:inherit}.aur-mat-table mat-form-field{width:100%}.aur-mat-table .text-right{text-align:right!important}.aur-mat-table .pointer:hover{background-color:#f2f2f2;cursor:pointer}.aur-mat-table .flex-container{display:flex;align-items:center}\n"], components: [{ type: i1__namespace$1.MatFormField, selector: "mat-form-field", inputs: ["color", "floatLabel", "appearance", "hideRequiredMarker", "hintLabel"], exportAs: ["matFormField"] }, { type: i1__namespace.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { type: i3__namespace$1.MatTable, selector: "mat-table, table[mat-table]", exportAs: ["matTable"] }, { type: ColumnViewComponent, selector: "lib-column-view", inputs: ["config", "value"] }, { type: i5__namespace.MatCheckbox, selector: "mat-checkbox", inputs: ["disableRipple", "color", "tabIndex", "aria-label", "aria-labelledby", "id", "labelPosition", "name", "required", "checked", "disabled", "indeterminate", "aria-describedby", "value"], outputs: ["change", "indeterminateChange"], exportAs: ["matCheckbox"] }, { type: i6__namespace.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { type: i7__namespace.MatSortHeader, selector: "[mat-sort-header]", inputs: ["disabled", "arrowPosition", "sortActionDescription", "disableClear", "mat-sort-header", "start"], exportAs: ["matSortHeader"] }, { type: i3__namespace$1.MatHeaderRow, selector: "mat-header-row, tr[mat-header-row]", exportAs: ["matHeaderRow"] }, { type: i3__namespace$1.MatRow, selector: "mat-row, tr[mat-row]", exportAs: ["matRow"] }, { type: i3__namespace$1.MatFooterRow, selector: "mat-footer-row, tr[mat-footer-row]", exportAs: ["matFooterRow"] }, { type: i8__namespace.MatPaginator, selector: "mat-paginator", inputs: ["disabled"], exportAs: ["matPaginator"] }], directives: [{ type: i9__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1__namespace$1.MatLabel, selector: "mat-label" }, { type: i10__namespace.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["id", "disabled", "required", "type", "value", "readonly", "placeholder", "errorStateMatcher", "aria-describedby"], exportAs: ["matInput"] }, { type: i1__namespace$1.MatPrefix, selector: "[matPrefix]" }, { type: i7__namespace.MatSort, selector: "[matSort]", inputs: ["matSortDisabled", "matSortStart", "matSortDirection", "matSortDisableClear", "matSortActive"], outputs: ["matSortChange"], exportAs: ["matSort"] }, { type: i3__namespace$1.MatColumnDef, selector: "[matColumnDef]", inputs: ["sticky", "matColumnDef"] }, { type: i3__namespace$1.MatHeaderCellDef, selector: "[matHeaderCellDef]" }, { type: i3__namespace$1.MatHeaderCell, selector: "mat-header-cell, th[mat-header-cell]" }, { type: i3__namespace$1.MatCellDef, selector: "[matCellDef]" }, { type: i3__namespace$1.MatCell, selector: "mat-cell, td[mat-cell]" }, { type: i3__namespace$1.MatFooterCellDef, selector: "[matFooterCellDef]" }, { type: i3__namespace$1.MatFooterCell, selector: "mat-footer-cell, td[mat-footer-cell]" }, { type: i9__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i3__namespace.MatTooltip, selector: "[matTooltip]", exportAs: ["matTooltip"] }, { type: i9__namespace.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }, { type: i3__namespace$1.MatHeaderRowDef, selector: "[matHeaderRowDef]", inputs: ["matHeaderRowDef", "matHeaderRowDefSticky"] }, { type: i3__namespace$1.MatRowDef, selector: "[matRowDef]", inputs: ["matRowDefColumns", "matRowDefWhen"] }, { type: i9__namespace.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i9__namespace.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { type: i3__namespace$1.MatFooterRowDef, selector: "[matFooterRowDef]", inputs: ["matFooterRowDef", "matFooterRowDefSticky"] }], pipes: { "dataPropertyGetter": DataPropertyGetterPipe }, changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush });
|
|
1123
1231
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: NgxAurMatTableComponent, decorators: [{
|
|
1124
1232
|
type: i0.Component,
|
|
1125
1233
|
args: [{
|
|
@@ -1128,7 +1236,9 @@
|
|
|
1128
1236
|
styleUrls: ['./ngx-aur-mat-table.component.scss'],
|
|
1129
1237
|
changeDetection: i0.ChangeDetectionStrategy.OnPush
|
|
1130
1238
|
}]
|
|
1131
|
-
}], ctorParameters: function () { return []; }, propDecorators: {
|
|
1239
|
+
}], ctorParameters: function () { return []; }, propDecorators: { displayColumns: [{
|
|
1240
|
+
type: i0.Input
|
|
1241
|
+
}], rows: [{
|
|
1132
1242
|
type: i0.ViewChildren,
|
|
1133
1243
|
args: ['rowLink', { read: i0.ElementRef }]
|
|
1134
1244
|
}], table: [{
|
|
@@ -1639,6 +1749,7 @@
|
|
|
1639
1749
|
exports.IndexProviderDummy = IndexProviderDummy;
|
|
1640
1750
|
exports.NgxAurMatTableComponent = NgxAurMatTableComponent;
|
|
1641
1751
|
exports.NgxAurMatTableModule = NgxAurMatTableModule;
|
|
1752
|
+
exports.NgxAurTableConfigUtil = NgxAurTableConfigUtil;
|
|
1642
1753
|
exports.RowActionProvider = RowActionProvider;
|
|
1643
1754
|
exports.RowActionProviderDummy = RowActionProviderDummy;
|
|
1644
1755
|
exports.SelectionProvider = SelectionProvider;
|