ngx-aur-mat-table 0.1.61 → 0.1.63

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.
@@ -77,10 +77,394 @@
77
77
  return SelectionProvider;
78
78
  }());
79
79
 
80
+ /******************************************************************************
81
+ Copyright (c) Microsoft Corporation.
82
+
83
+ Permission to use, copy, modify, and/or distribute this software for any
84
+ purpose with or without fee is hereby granted.
85
+
86
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
87
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
88
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
89
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
90
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
91
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
92
+ PERFORMANCE OF THIS SOFTWARE.
93
+ ***************************************************************************** */
94
+ /* global Reflect, Promise */
95
+ var extendStatics = function (d, b) {
96
+ extendStatics = Object.setPrototypeOf ||
97
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
98
+ function (d, b) { for (var p in b)
99
+ if (Object.prototype.hasOwnProperty.call(b, p))
100
+ d[p] = b[p]; };
101
+ return extendStatics(d, b);
102
+ };
103
+ function __extends(d, b) {
104
+ if (typeof b !== "function" && b !== null)
105
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
106
+ extendStatics(d, b);
107
+ function __() { this.constructor = d; }
108
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
109
+ }
110
+ var __assign = function () {
111
+ __assign = Object.assign || function __assign(t) {
112
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
113
+ s = arguments[i];
114
+ for (var p in s)
115
+ if (Object.prototype.hasOwnProperty.call(s, p))
116
+ t[p] = s[p];
117
+ }
118
+ return t;
119
+ };
120
+ return __assign.apply(this, arguments);
121
+ };
122
+ function __rest(s, e) {
123
+ var t = {};
124
+ for (var p in s)
125
+ if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
126
+ t[p] = s[p];
127
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
128
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
129
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
130
+ t[p[i]] = s[p[i]];
131
+ }
132
+ return t;
133
+ }
134
+ function __decorate(decorators, target, key, desc) {
135
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
136
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
137
+ r = Reflect.decorate(decorators, target, key, desc);
138
+ else
139
+ for (var i = decorators.length - 1; i >= 0; i--)
140
+ if (d = decorators[i])
141
+ r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
142
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
143
+ }
144
+ function __param(paramIndex, decorator) {
145
+ return function (target, key) { decorator(target, key, paramIndex); };
146
+ }
147
+ function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
148
+ function accept(f) { if (f !== void 0 && typeof f !== "function")
149
+ throw new TypeError("Function expected"); return f; }
150
+ var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
151
+ var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
152
+ var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
153
+ var _, done = false;
154
+ for (var i = decorators.length - 1; i >= 0; i--) {
155
+ var context = {};
156
+ for (var p in contextIn)
157
+ context[p] = p === "access" ? {} : contextIn[p];
158
+ for (var p in contextIn.access)
159
+ context.access[p] = contextIn.access[p];
160
+ context.addInitializer = function (f) { if (done)
161
+ throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); };
162
+ var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
163
+ if (kind === "accessor") {
164
+ if (result === void 0)
165
+ continue;
166
+ if (result === null || typeof result !== "object")
167
+ throw new TypeError("Object expected");
168
+ if (_ = accept(result.get))
169
+ descriptor.get = _;
170
+ if (_ = accept(result.set))
171
+ descriptor.set = _;
172
+ if (_ = accept(result.init))
173
+ initializers.push(_);
174
+ }
175
+ else if (_ = accept(result)) {
176
+ if (kind === "field")
177
+ initializers.push(_);
178
+ else
179
+ descriptor[key] = _;
180
+ }
181
+ }
182
+ if (target)
183
+ Object.defineProperty(target, contextIn.name, descriptor);
184
+ done = true;
185
+ }
186
+ ;
187
+ function __runInitializers(thisArg, initializers, value) {
188
+ var useValue = arguments.length > 2;
189
+ for (var i = 0; i < initializers.length; i++) {
190
+ value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
191
+ }
192
+ return useValue ? value : void 0;
193
+ }
194
+ ;
195
+ function __propKey(x) {
196
+ return typeof x === "symbol" ? x : "".concat(x);
197
+ }
198
+ ;
199
+ function __setFunctionName(f, name, prefix) {
200
+ if (typeof name === "symbol")
201
+ name = name.description ? "[".concat(name.description, "]") : "";
202
+ return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name });
203
+ }
204
+ ;
205
+ function __metadata(metadataKey, metadataValue) {
206
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
207
+ return Reflect.metadata(metadataKey, metadataValue);
208
+ }
209
+ function __awaiter(thisArg, _arguments, P, generator) {
210
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
211
+ return new (P || (P = Promise))(function (resolve, reject) {
212
+ function fulfilled(value) { try {
213
+ step(generator.next(value));
214
+ }
215
+ catch (e) {
216
+ reject(e);
217
+ } }
218
+ function rejected(value) { try {
219
+ step(generator["throw"](value));
220
+ }
221
+ catch (e) {
222
+ reject(e);
223
+ } }
224
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
225
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
226
+ });
227
+ }
228
+ function __generator(thisArg, body) {
229
+ var _ = { label: 0, sent: function () { if (t[0] & 1)
230
+ throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
231
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function () { return this; }), g;
232
+ function verb(n) { return function (v) { return step([n, v]); }; }
233
+ function step(op) {
234
+ if (f)
235
+ throw new TypeError("Generator is already executing.");
236
+ while (g && (g = 0, op[0] && (_ = 0)), _)
237
+ try {
238
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done)
239
+ return t;
240
+ if (y = 0, t)
241
+ op = [op[0] & 2, t.value];
242
+ switch (op[0]) {
243
+ case 0:
244
+ case 1:
245
+ t = op;
246
+ break;
247
+ case 4:
248
+ _.label++;
249
+ return { value: op[1], done: false };
250
+ case 5:
251
+ _.label++;
252
+ y = op[1];
253
+ op = [0];
254
+ continue;
255
+ case 7:
256
+ op = _.ops.pop();
257
+ _.trys.pop();
258
+ continue;
259
+ default:
260
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
261
+ _ = 0;
262
+ continue;
263
+ }
264
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) {
265
+ _.label = op[1];
266
+ break;
267
+ }
268
+ if (op[0] === 6 && _.label < t[1]) {
269
+ _.label = t[1];
270
+ t = op;
271
+ break;
272
+ }
273
+ if (t && _.label < t[2]) {
274
+ _.label = t[2];
275
+ _.ops.push(op);
276
+ break;
277
+ }
278
+ if (t[2])
279
+ _.ops.pop();
280
+ _.trys.pop();
281
+ continue;
282
+ }
283
+ op = body.call(thisArg, _);
284
+ }
285
+ catch (e) {
286
+ op = [6, e];
287
+ y = 0;
288
+ }
289
+ finally {
290
+ f = t = 0;
291
+ }
292
+ if (op[0] & 5)
293
+ throw op[1];
294
+ return { value: op[0] ? op[1] : void 0, done: true };
295
+ }
296
+ }
297
+ var __createBinding = Object.create ? (function (o, m, k, k2) {
298
+ if (k2 === undefined)
299
+ k2 = k;
300
+ var desc = Object.getOwnPropertyDescriptor(m, k);
301
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
302
+ desc = { enumerable: true, get: function () { return m[k]; } };
303
+ }
304
+ Object.defineProperty(o, k2, desc);
305
+ }) : (function (o, m, k, k2) {
306
+ if (k2 === undefined)
307
+ k2 = k;
308
+ o[k2] = m[k];
309
+ });
310
+ function __exportStar(m, o) {
311
+ for (var p in m)
312
+ if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p))
313
+ __createBinding(o, m, p);
314
+ }
315
+ function __values(o) {
316
+ var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
317
+ if (m)
318
+ return m.call(o);
319
+ if (o && typeof o.length === "number")
320
+ return {
321
+ next: function () {
322
+ if (o && i >= o.length)
323
+ o = void 0;
324
+ return { value: o && o[i++], done: !o };
325
+ }
326
+ };
327
+ throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
328
+ }
329
+ function __read(o, n) {
330
+ var m = typeof Symbol === "function" && o[Symbol.iterator];
331
+ if (!m)
332
+ return o;
333
+ var i = m.call(o), r, ar = [], e;
334
+ try {
335
+ while ((n === void 0 || n-- > 0) && !(r = i.next()).done)
336
+ ar.push(r.value);
337
+ }
338
+ catch (error) {
339
+ e = { error: error };
340
+ }
341
+ finally {
342
+ try {
343
+ if (r && !r.done && (m = i["return"]))
344
+ m.call(i);
345
+ }
346
+ finally {
347
+ if (e)
348
+ throw e.error;
349
+ }
350
+ }
351
+ return ar;
352
+ }
353
+ /** @deprecated */
354
+ function __spread() {
355
+ for (var ar = [], i = 0; i < arguments.length; i++)
356
+ ar = ar.concat(__read(arguments[i]));
357
+ return ar;
358
+ }
359
+ /** @deprecated */
360
+ function __spreadArrays() {
361
+ for (var s = 0, i = 0, il = arguments.length; i < il; i++)
362
+ s += arguments[i].length;
363
+ for (var r = Array(s), k = 0, i = 0; i < il; i++)
364
+ for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
365
+ r[k] = a[j];
366
+ return r;
367
+ }
368
+ function __spreadArray(to, from, pack) {
369
+ if (pack || arguments.length === 2)
370
+ for (var i = 0, l = from.length, ar; i < l; i++) {
371
+ if (ar || !(i in from)) {
372
+ if (!ar)
373
+ ar = Array.prototype.slice.call(from, 0, i);
374
+ ar[i] = from[i];
375
+ }
376
+ }
377
+ return to.concat(ar || Array.prototype.slice.call(from));
378
+ }
379
+ function __await(v) {
380
+ return this instanceof __await ? (this.v = v, this) : new __await(v);
381
+ }
382
+ function __asyncGenerator(thisArg, _arguments, generator) {
383
+ if (!Symbol.asyncIterator)
384
+ throw new TypeError("Symbol.asyncIterator is not defined.");
385
+ var g = generator.apply(thisArg, _arguments || []), i, q = [];
386
+ return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
387
+ function verb(n) { if (g[n])
388
+ i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
389
+ function resume(n, v) { try {
390
+ step(g[n](v));
391
+ }
392
+ catch (e) {
393
+ settle(q[0][3], e);
394
+ } }
395
+ function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
396
+ function fulfill(value) { resume("next", value); }
397
+ function reject(value) { resume("throw", value); }
398
+ function settle(f, v) { if (f(v), q.shift(), q.length)
399
+ resume(q[0][0], q[0][1]); }
400
+ }
401
+ function __asyncDelegator(o) {
402
+ var i, p;
403
+ return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
404
+ function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }
405
+ }
406
+ function __asyncValues(o) {
407
+ if (!Symbol.asyncIterator)
408
+ throw new TypeError("Symbol.asyncIterator is not defined.");
409
+ var m = o[Symbol.asyncIterator], i;
410
+ return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
411
+ function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
412
+ function settle(resolve, reject, d, v) { Promise.resolve(v).then(function (v) { resolve({ value: v, done: d }); }, reject); }
413
+ }
414
+ function __makeTemplateObject(cooked, raw) {
415
+ if (Object.defineProperty) {
416
+ Object.defineProperty(cooked, "raw", { value: raw });
417
+ }
418
+ else {
419
+ cooked.raw = raw;
420
+ }
421
+ return cooked;
422
+ }
423
+ ;
424
+ var __setModuleDefault = Object.create ? (function (o, v) {
425
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
426
+ }) : function (o, v) {
427
+ o["default"] = v;
428
+ };
429
+ function __importStar(mod) {
430
+ if (mod && mod.__esModule)
431
+ return mod;
432
+ var result = {};
433
+ if (mod != null)
434
+ for (var k in mod)
435
+ if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k))
436
+ __createBinding(result, mod, k);
437
+ __setModuleDefault(result, mod);
438
+ return result;
439
+ }
440
+ function __importDefault(mod) {
441
+ return (mod && mod.__esModule) ? mod : { default: mod };
442
+ }
443
+ function __classPrivateFieldGet(receiver, state, kind, f) {
444
+ if (kind === "a" && !f)
445
+ throw new TypeError("Private accessor was defined without a getter");
446
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
447
+ throw new TypeError("Cannot read private member from an object whose class did not declare it");
448
+ return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
449
+ }
450
+ function __classPrivateFieldSet(receiver, state, value, kind, f) {
451
+ if (kind === "m")
452
+ throw new TypeError("Private method is not writable");
453
+ if (kind === "a" && !f)
454
+ throw new TypeError("Private accessor was defined without a setter");
455
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
456
+ throw new TypeError("Cannot write private member to an object whose class did not declare it");
457
+ return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
458
+ }
459
+ function __classPrivateFieldIn(state, receiver) {
460
+ if (receiver === null || (typeof receiver !== "object" && typeof receiver !== "function"))
461
+ throw new TypeError("Cannot use 'in' operator on non-object");
462
+ return typeof state === "function" ? receiver === state : state.has(receiver);
463
+ }
464
+
80
465
  var RowActionProvider = /** @class */ (function () {
81
466
  function RowActionProvider(ctx, columns) {
82
467
  this.COLUMN_NAME = 'tbl_actions';
83
- this.config = ctx;
84
468
  if (ctx.position === 'start') {
85
469
  columns.unshift(this.COLUMN_NAME);
86
470
  }
@@ -88,6 +472,53 @@
88
472
  columns.push(this.COLUMN_NAME);
89
473
  }
90
474
  }
475
+ /**
476
+ * Convert rows and actions to a view format.
477
+ * @param rows - The data rows to be converted.
478
+ * @param actionConfig - Configuration for actions on rows.
479
+ * @return Map of row IDs to their associated action views.
480
+ */
481
+ RowActionProvider.prototype.toView = function (rows, actionConfig) {
482
+ var e_1, _a;
483
+ var result = new Map();
484
+ try {
485
+ for (var rows_1 = __values(rows), rows_1_1 = rows_1.next(); !rows_1_1.done; rows_1_1 = rows_1.next()) {
486
+ var row = rows_1_1.value;
487
+ result.set(row.id, this.prepareActionsForRow(row, actionConfig));
488
+ }
489
+ }
490
+ catch (e_1_1) { e_1 = { error: e_1_1 }; }
491
+ finally {
492
+ try {
493
+ if (rows_1_1 && !rows_1_1.done && (_a = rows_1.return)) _a.call(rows_1);
494
+ }
495
+ finally { if (e_1) throw e_1.error; }
496
+ }
497
+ return result;
498
+ };
499
+ /**
500
+ * Prepare the actions for a specific row based on the action configuration.
501
+ * @param row - The data row for which actions need to be prepared.
502
+ * @param actionConfig - Configuration for actions on rows.
503
+ * @return Array of actions for the row.
504
+ */
505
+ RowActionProvider.prototype.prepareActionsForRow = function (row, actionConfig) {
506
+ var _this = this;
507
+ return actionConfig.actions.map(function (action) {
508
+ var actionPrepared = action.action(row.rowSrc);
509
+ var iconPrepared = _this.iconConfig(action.icon, row.rowSrc);
510
+ return { action: actionPrepared, icon: iconPrepared };
511
+ });
512
+ };
513
+ RowActionProvider.prototype.iconConfig = function (iconSource, value) {
514
+ return {
515
+ name: iconSource.name(value),
516
+ color: iconSource.color ? iconSource.color(value) : undefined,
517
+ tooltip: iconSource.tooltip ? iconSource.tooltip(value) : undefined,
518
+ position: iconSource.position,
519
+ wrapper: iconSource.wrapper ? { color: iconSource.wrapper.color(value) } : undefined
520
+ };
521
+ };
91
522
  return RowActionProvider;
92
523
  }());
93
524
 
@@ -246,6 +677,8 @@
246
677
  this.tableDataSource = new i3$1.MatTableDataSource([]);
247
678
  this.displayedColumns = [];
248
679
  this.tableView = [];
680
+ // number rowId
681
+ this.actionView = new Map();
249
682
  this.tableData = [];
250
683
  this.sort = new i0.EventEmitter();
251
684
  // events if enabled actions
@@ -318,6 +751,7 @@
318
751
  }
319
752
  if (this.tableConfig.actionCfg) {
320
753
  this.rowActionsProvider = new RowActionProvider(this.tableConfig.actionCfg, this.displayedColumns);
754
+ this.actionView = this.rowActionsProvider.toView(this.tableDataSource.data, this.tableConfig.actionCfg);
321
755
  }
322
756
  if (this.tableConfig.selectionCfg && this.tableConfig.selectionCfg.enable) {
323
757
  this.selectionProvider = new SelectionProvider(this.tableConfig.selectionCfg, this.displayedColumns, this.tableDataSource);
@@ -357,6 +791,9 @@
357
791
  NgxAurMatTableComponent.prototype.getView = function (row, columnKey) {
358
792
  return this.tableView[row.id] ? this.tableView[row.id].get(columnKey) : undefined;
359
793
  };
794
+ NgxAurMatTableComponent.prototype.getActionsView = function (row) {
795
+ return this.actionView.get(row.id) ? this.actionView.get(row.id) : undefined;
796
+ };
360
797
  NgxAurMatTableComponent.prototype.rowClick = function (row) {
361
798
  var _a;
362
799
  if (row.rowSrc !== this.highlighted || (row.rowSrc === this.highlighted && !((_a = this.tableConfig.clickCfg) === null || _a === void 0 ? void 0 : _a.cancelable))) {
@@ -375,7 +812,7 @@
375
812
  return NgxAurMatTableComponent;
376
813
  }());
377
814
  NgxAurMatTableComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: NgxAurMatTableComponent, deps: [], target: i0__namespace.ɵɵFactoryTarget.Component });
378
- 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", 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)=\"applyFilter($event)\" placeholder=\"{{tableConfig.filterCfg?.placeholder}}\">\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\r\n #table\r\n mat-table\r\n 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\r\n <!-- index-column-->\r\n <ng-container *ngIf=\"indexProvider\" [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 </ng-container>\r\n\r\n <!-- selection-column-->\r\n <ng-container [matColumnDef]=\"selectionProvider.COLUMN_NAME\" *ngIf=\"selectionProvider\">\r\n <th mat-header-cell *matHeaderCellDef>\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 </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 </ng-container>\r\n\r\n <!-- action column -->\r\n <ng-container *ngIf=\"rowActionsProvider\" [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, castSrc(element).rowSrc, $event)\"\r\n [matTooltip]=\"action.icon.tooltip || ''\"\r\n *ngFor=\"let action of rowActionsProvider.config.actions\">\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 </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; 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 >\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]=\"getView(element, columnConfig.key)\"\r\n [value]=\"element | dataPropertyGetter: columnConfig.key\"\r\n >\r\n </lib-column-view>\r\n </td>\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\r\n (click)=\"rowClick(row)\"\r\n *matRowDef=\"let row; columns: displayedColumns;\"\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 #rowLink\r\n ></tr>\r\n </table>\r\n\r\n <!-- Pagination -->\r\n <mat-paginator *ngIf=\"paginationProvider\"\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", 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}\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: 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: 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"] }], pipes: { "dataPropertyGetter": DataPropertyGetterPipe } });
815
+ 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", 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)=\"applyFilter($event)\" placeholder=\"{{tableConfig.filterCfg?.placeholder}}\">\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\r\n #table\r\n mat-table\r\n 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\r\n <!-- index-column-->\r\n <ng-container *ngIf=\"indexProvider\" [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 </ng-container>\r\n\r\n <!-- selection-column-->\r\n <ng-container [matColumnDef]=\"selectionProvider.COLUMN_NAME\" *ngIf=\"selectionProvider\">\r\n <th mat-header-cell *matHeaderCellDef>\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 </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 </ng-container>\r\n\r\n <!-- action column -->\r\n <ng-container *ngIf=\"rowActionsProvider\" [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, castSrc(element).rowSrc, $event)\"\r\n [matTooltip]=\"action.icon.tooltip || ''\"\r\n *ngFor=\"let action of getActionsView(castSrc(element))\">\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 </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; 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 >\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]=\"getView(element, columnConfig.key)\"\r\n [value]=\"element | dataPropertyGetter: columnConfig.key\"\r\n >\r\n </lib-column-view>\r\n </td>\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\r\n (click)=\"rowClick(row)\"\r\n *matRowDef=\"let row; columns: displayedColumns;\"\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 #rowLink\r\n ></tr>\r\n </table>\r\n\r\n <!-- Pagination -->\r\n <mat-paginator *ngIf=\"paginationProvider\"\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", 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}\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: 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: 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"] }], pipes: { "dataPropertyGetter": DataPropertyGetterPipe } });
379
816
  i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: NgxAurMatTableComponent, decorators: [{
380
817
  type: i0.Component,
381
818
  args: [{