@sd-angular/core 0.0.918 → 0.0.922

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.
Files changed (34) hide show
  1. package/bundles/sd-angular-core-grid-material.umd.js +383 -51
  2. package/bundles/sd-angular-core-grid-material.umd.js.map +1 -1
  3. package/bundles/sd-angular-core-grid-material.umd.min.js +2 -2
  4. package/bundles/sd-angular-core-grid-material.umd.min.js.map +1 -1
  5. package/esm2015/grid-material/sd-angular-core-grid-material.js +30 -25
  6. package/esm2015/grid-material/src/lib/components/desktop-cell/desktop-cell.component.js +20 -0
  7. package/esm2015/grid-material/src/lib/components/desktop-cell-editor/desktop-cell-editor.component.js +26 -0
  8. package/esm2015/grid-material/src/lib/components/desktop-cell-view/desktop-cell-view.component.js +4 -3
  9. package/esm2015/grid-material/src/lib/grid-material.component.js +114 -4
  10. package/esm2015/grid-material/src/lib/grid-material.module.js +12 -2
  11. package/esm2015/grid-material/src/lib/models/grid-column.model.js +1 -1
  12. package/esm2015/grid-material/src/lib/models/grid-editor.model.js +2 -0
  13. package/esm2015/grid-material/src/lib/models/grid-option.model.js +1 -1
  14. package/esm2015/grid-material/src/lib/models/grid.model.js +1 -1
  15. package/esm2015/grid-material/src/lib/pipes/editor-handler-column.pipe.js +39 -0
  16. package/esm2015/grid-material/src/lib/pipes/editor-handler-row.pipe.js +40 -0
  17. package/esm2015/grid-material/src/lib/pipes/editor-validate.pipe.js +41 -0
  18. package/esm2015/grid-material/src/lib/services/grid-configuration.service.js +13 -7
  19. package/fesm2015/sd-angular-core-grid-material.js +295 -13
  20. package/fesm2015/sd-angular-core-grid-material.js.map +1 -1
  21. package/grid-material/sd-angular-core-grid-material.d.ts +29 -24
  22. package/grid-material/sd-angular-core-grid-material.metadata.json +1 -1
  23. package/grid-material/src/lib/components/desktop-cell/desktop-cell.component.d.ts +9 -0
  24. package/grid-material/src/lib/components/desktop-cell-editor/desktop-cell-editor.component.d.ts +7 -0
  25. package/grid-material/src/lib/grid-material.component.d.ts +5 -0
  26. package/grid-material/src/lib/models/grid-column.model.d.ts +47 -0
  27. package/grid-material/src/lib/models/grid-editor.model.d.ts +22 -0
  28. package/grid-material/src/lib/models/grid-option.model.d.ts +2 -10
  29. package/grid-material/src/lib/models/grid.model.d.ts +46 -1
  30. package/grid-material/src/lib/pipes/editor-handler-column.pipe.d.ts +7 -0
  31. package/grid-material/src/lib/pipes/editor-handler-row.pipe.d.ts +6 -0
  32. package/grid-material/src/lib/pipes/editor-validate.pipe.d.ts +7 -0
  33. package/package.json +1 -1
  34. package/{sd-angular-core-0.0.918.tgz → sd-angular-core-0.0.922.tgz} +0 -0
@@ -1221,9 +1221,10 @@
1221
1221
  this.settingService = settingService;
1222
1222
  this.gridMaterialConfiguration = gridMaterialConfiguration;
1223
1223
  _COLUMNS.set(this, {
1224
+ EDITOR: 'sdEditor',
1224
1225
  SUBINFORMATION: 'sdSubInformationAction',
1225
- COMMAND: 'command',
1226
- SELECTION: 'selection'
1226
+ COMMAND: 'sdCommand',
1227
+ SELECTION: 'sdSelection'
1227
1228
  });
1228
1229
  _cache.set(this, {});
1229
1230
  this.init = function (key, gridOption) {
@@ -1276,13 +1277,13 @@
1276
1277
  _load.set(this, function (gridOption, subject) {
1277
1278
  return function () { return __awaiter(_this, void 0, void 0, function () {
1278
1279
  var get, configuration;
1279
- return __generator(this, function (_d) {
1280
- switch (_d.label) {
1280
+ return __generator(this, function (_c) {
1281
+ switch (_c.label) {
1281
1282
  case 0:
1282
1283
  get = __classPrivateFieldGet(this, _get).call(this, gridOption);
1283
1284
  return [4 /*yield*/, get()];
1284
1285
  case 1:
1285
- configuration = _d.sent();
1286
+ configuration = _c.sent();
1286
1287
  subject.next(Object.assign({}, configuration));
1287
1288
  return [2 /*return*/];
1288
1289
  }
@@ -1291,22 +1292,22 @@
1291
1292
  });
1292
1293
  _get.set(this, function (gridOption) {
1293
1294
  return function () { return __awaiter(_this, void 0, void 0, function () {
1294
- var key, columns, config, _d, get, remove, configuration;
1295
- return __generator(this, function (_e) {
1296
- switch (_e.label) {
1295
+ var key, columns, config, _c, get, remove, configuration;
1296
+ return __generator(this, function (_d) {
1297
+ switch (_d.label) {
1297
1298
  case 0:
1298
1299
  key = __classPrivateFieldGet(this, _getKey).call(this, gridOption);
1299
1300
  if (!key) {
1300
1301
  return [2 /*return*/, __classPrivateFieldGet(this, _default).call(this, gridOption)];
1301
1302
  }
1302
1303
  columns = gridOption.columns, config = gridOption.config;
1303
- _d = this.settingService.create(key, {
1304
+ _c = this.settingService.create(key, {
1304
1305
  type: config === null || config === void 0 ? void 0 : config.storage,
1305
1306
  args: config === null || config === void 0 ? void 0 : config.args
1306
- }), get = _d.get, remove = _d.remove;
1307
+ }), get = _c.get, remove = _c.remove;
1307
1308
  return [4 /*yield*/, get().catch(function () { return undefined; })];
1308
1309
  case 1:
1309
- configuration = _e.sent();
1310
+ configuration = _d.sent();
1310
1311
  if (!(configuration === null || configuration === void 0 ? void 0 : configuration.columns)) {
1311
1312
  remove().catch(console.error);
1312
1313
  return [2 /*return*/, __classPrivateFieldGet(this, _default).call(this, gridOption)];
@@ -1465,7 +1466,7 @@
1465
1466
  // }
1466
1467
  // }
1467
1468
  this.generateConfigurationResult = function (configuration, gridOption, sdSubInformation) {
1468
- var _a, _b, _c;
1469
+ var _a;
1469
1470
  var result = {
1470
1471
  column: {},
1471
1472
  fixedColumn: {},
@@ -1477,16 +1478,21 @@
1477
1478
  displayedFooters: [],
1478
1479
  multipleHeader: false
1479
1480
  };
1480
- if ((_a = gridOption === null || gridOption === void 0 ? void 0 : gridOption.selection) === null || _a === void 0 ? void 0 : _a.visible) {
1481
+ var _c = gridOption || {}, selection = _c.selection, commands = _c.commands, editor = _c.editor;
1482
+ if (selection === null || selection === void 0 ? void 0 : selection.visible) {
1481
1483
  result.firstHeaders.push(__classPrivateFieldGet(_this, _COLUMNS).SELECTION);
1482
1484
  result.displayedColumns.push(__classPrivateFieldGet(_this, _COLUMNS).SELECTION);
1483
1485
  }
1484
- if ((_b = gridOption === null || gridOption === void 0 ? void 0 : gridOption.commands) === null || _b === void 0 ? void 0 : _b.length) {
1486
+ if ((editor === null || editor === void 0 ? void 0 : editor.addable) || ((editor === null || editor === void 0 ? void 0 : editor.type) === 'inline' && (editor === null || editor === void 0 ? void 0 : editor.removable)) || ((editor === null || editor === void 0 ? void 0 : editor.type) === 'focus' && (editor === null || editor === void 0 ? void 0 : editor.editable)) || ((editor === null || editor === void 0 ? void 0 : editor.type) === 'popup' && (editor === null || editor === void 0 ? void 0 : editor.editable))) {
1487
+ result.firstHeaders.push(__classPrivateFieldGet(_this, _COLUMNS).EDITOR);
1488
+ result.displayedColumns.push(__classPrivateFieldGet(_this, _COLUMNS).EDITOR);
1489
+ }
1490
+ if (commands === null || commands === void 0 ? void 0 : commands.length) {
1485
1491
  result.firstHeaders.push(__classPrivateFieldGet(_this, _COLUMNS).COMMAND);
1486
1492
  result.displayedColumns.push(__classPrivateFieldGet(_this, _COLUMNS).COMMAND);
1487
1493
  }
1488
- (_c = configuration === null || configuration === void 0 ? void 0 : configuration.columns) === null || _c === void 0 ? void 0 : _c.filter(function (col) { return !col.invisible; }).forEach(function (col) {
1489
- var e_1, _d, e_2, _e;
1494
+ (_a = configuration === null || configuration === void 0 ? void 0 : configuration.columns) === null || _a === void 0 ? void 0 : _a.filter(function (col) { return !col.invisible; }).forEach(function (col) {
1495
+ var e_1, _c, e_2, _d;
1490
1496
  var _a;
1491
1497
  if (col.isGeneratedColumn) {
1492
1498
  result.column[col.origin.field] = {
@@ -1506,19 +1512,19 @@
1506
1512
  children: []
1507
1513
  };
1508
1514
  try {
1509
- for (var _f = __values(gridOption === null || gridOption === void 0 ? void 0 : gridOption.columns.filter(function (e1) { return col.generatedColumns.includes(e1.field); })), _g = _f.next(); !_g.done; _g = _f.next()) {
1510
- var subColumn = _g.value;
1515
+ for (var _e = __values(gridOption === null || gridOption === void 0 ? void 0 : gridOption.columns.filter(function (e1) { return col.generatedColumns.includes(e1.field); })), _f = _e.next(); !_f.done; _f = _e.next()) {
1516
+ var subColumn = _f.value;
1511
1517
  if (subColumn.type === 'children' || subColumn.type === 'children-col') {
1512
1518
  try {
1513
- for (var _h = (e_2 = void 0, __values(subColumn.children)), _j = _h.next(); !_j.done; _j = _h.next()) {
1514
- var childColumn = _j.value;
1519
+ for (var _g = (e_2 = void 0, __values(subColumn.children)), _h = _g.next(); !_h.done; _h = _g.next()) {
1520
+ var childColumn = _h.value;
1515
1521
  generatedColumn.children.push(Object.assign(Object.assign({}, childColumn), { colSpan: 2 }));
1516
1522
  }
1517
1523
  }
1518
1524
  catch (e_2_1) { e_2 = { error: e_2_1 }; }
1519
1525
  finally {
1520
1526
  try {
1521
- if (_j && !_j.done && (_e = _h.return)) _e.call(_h);
1527
+ if (_h && !_h.done && (_d = _g.return)) _d.call(_g);
1522
1528
  }
1523
1529
  finally { if (e_2) throw e_2.error; }
1524
1530
  }
@@ -1531,7 +1537,7 @@
1531
1537
  catch (e_1_1) { e_1 = { error: e_1_1 }; }
1532
1538
  finally {
1533
1539
  try {
1534
- if (_g && !_g.done && (_d = _f.return)) _d.call(_f);
1540
+ if (_f && !_f.done && (_c = _e.return)) _c.call(_e);
1535
1541
  }
1536
1542
  finally { if (e_1) throw e_1.error; }
1537
1543
  }
@@ -1652,7 +1658,7 @@
1652
1658
  { type: utility.SdUtilityService }
1653
1659
  ]; };
1654
1660
 
1655
- var _paginator, _sort, _subscription$1, _optionChanges, _initCellDef, _initFilterDef, _initFooterDef, _filterExportInfo, _initConfiguration, _filterLocal, _getFilter, _load$1, _render, _exportedItems, _allColumns, _allExportedColumns, _onExport, _updateSelectedItems;
1661
+ var _paginator, _sort, _subscription$1, _optionChanges, _initCellDef, _initFilterDef, _initFooterDef, _filterExportInfo, _initConfiguration, _filterLocal, _getFilter, _load$1, _render, _exportedItems, _allColumns, _allExportedColumns, _onExport, _updateSelectedItems, _generateEditorHanlder;
1656
1662
  var SdGridMaterial = /** @class */ (function () {
1657
1663
  function SdGridMaterial(ref, configuration, gridConfigurationService, exportService, notifyService, translateService, gridService) {
1658
1664
  var _this = this;
@@ -2359,6 +2365,129 @@
2359
2365
  var _a;
2360
2366
  (_a = _this.gridFilter) === null || _a === void 0 ? void 0 : _a.setFilter(args);
2361
2367
  };
2368
+ _generateEditorHanlder.set(this, function (item) {
2369
+ // item.editorHandler = item.editorHandler || {};
2370
+ // this.editorVisiblePipe.transform(null, item, this.gridOption);
2371
+ });
2372
+ this.onCreate = function () {
2373
+ var _a;
2374
+ var _t = _this.gridOption, type = _t.type, editor = _t.editor, columns = _t.columns;
2375
+ if (!(editor === null || editor === void 0 ? void 0 : editor.addable)) {
2376
+ return;
2377
+ }
2378
+ var item = {};
2379
+ // Gán giá trị mặc định
2380
+ columns.forEach(function (column) {
2381
+ if (column.type === 'values') {
2382
+ item[column.field] = '';
2383
+ }
2384
+ else if (column.type === 'bool') {
2385
+ item[column.field] = true;
2386
+ }
2387
+ else if (column.type === 'number') {
2388
+ item[column.field] = null;
2389
+ }
2390
+ });
2391
+ (_a = editor.onAdd) === null || _a === void 0 ? void 0 : _a.call(editor, item);
2392
+ // Đưa item lên dòng đầu tiên nếu type khác popup
2393
+ if (editor.type !== 'popup') {
2394
+ if (type === 'local') {
2395
+ _this.items.splice(0, 0, item);
2396
+ }
2397
+ // this.viewItems.splice(0, 0, item);
2398
+ }
2399
+ _this.onUpdate(item, false);
2400
+ };
2401
+ this.onUpdate = function (item, isModified) {
2402
+ var _t = _this.gridOption, editor = _t.editor, columns = _t.columns;
2403
+ item.editorHandlerRow = Object.assign(Object.assign({}, item.editorHandlerRow), { status: isModified ? 'update' : 'create', temporary: Object.assign({}, item) });
2404
+ // this.generateEditorHanlder(item);
2405
+ if (editor.type === 'popup') {
2406
+ // Xử lý case popup
2407
+ // this.sdGridPopupEditor.open(item, columns, isModified);
2408
+ }
2409
+ _this.ref.detectChanges();
2410
+ };
2411
+ this.onSave = function (item) { return __awaiter(_this, void 0, void 0, function () {
2412
+ var editor, result, message, result, err_1;
2413
+ return __generator(this, function (_t) {
2414
+ switch (_t.label) {
2415
+ case 0:
2416
+ editor = this.gridOption.editor;
2417
+ _t.label = 1;
2418
+ case 1:
2419
+ _t.trys.push([1, 7, 8, 9]);
2420
+ item.editorHandlerRow.saving = true;
2421
+ if (!editor.validate) return [3 /*break*/, 4];
2422
+ result = editor.validate(item);
2423
+ if (!(result instanceof Promise)) return [3 /*break*/, 3];
2424
+ return [4 /*yield*/, result];
2425
+ case 2:
2426
+ message = _t.sent();
2427
+ if (message) {
2428
+ throw message;
2429
+ }
2430
+ return [3 /*break*/, 4];
2431
+ case 3:
2432
+ if (result) {
2433
+ throw result;
2434
+ }
2435
+ _t.label = 4;
2436
+ case 4:
2437
+ if (!editor.onSave) return [3 /*break*/, 6];
2438
+ result = editor.onSave(item);
2439
+ if (!(result instanceof Promise)) return [3 /*break*/, 6];
2440
+ return [4 /*yield*/, result];
2441
+ case 5:
2442
+ _t.sent();
2443
+ _t.label = 6;
2444
+ case 6:
2445
+ if (item.editorHandlerRow.status === 'create' && editor.type === 'popup') {
2446
+ if (this.gridOption.type === 'local') {
2447
+ this.items.splice(0, 0, item);
2448
+ }
2449
+ // this.viewItems.splice(0, 0, item);
2450
+ }
2451
+ item.editorHandlerRow.status = undefined;
2452
+ return [3 /*break*/, 9];
2453
+ case 7:
2454
+ err_1 = _t.sent();
2455
+ this.notifyService.notify.warning(err_1);
2456
+ return [3 /*break*/, 9];
2457
+ case 8:
2458
+ item.editorHandlerRow.saving = false;
2459
+ this.ref.detectChanges();
2460
+ return [7 /*endfinally*/];
2461
+ case 9: return [2 /*return*/];
2462
+ }
2463
+ });
2464
+ }); };
2465
+ this.onCancel = function (item) {
2466
+ var editor = _this.gridOption.editor;
2467
+ if (editor.type === 'inline') {
2468
+ if (_this.gridOption.type === 'local') {
2469
+ var idx1 = _this.items.indexOf(item);
2470
+ _this.items.splice(idx1, 1);
2471
+ }
2472
+ // const idx2 = this.viewItems.indexOf(item);
2473
+ // this.viewItems.splice(idx2, 1);
2474
+ return;
2475
+ }
2476
+ if (item.editorHandlerRow.status === 'create') {
2477
+ if (editor.type !== 'popup') {
2478
+ if (_this.gridOption.type === 'local') {
2479
+ _this.items.splice(0, 1);
2480
+ }
2481
+ // this.viewItems.splice(0, 1);
2482
+ }
2483
+ }
2484
+ else {
2485
+ Object.assign(item, item.editorHandlerRow.temporary);
2486
+ item.editorHandlerRow.status = undefined;
2487
+ // this.generateEditorHanlder(item);
2488
+ _this.ref.detectChanges();
2489
+ }
2490
+ };
2362
2491
  }
2363
2492
  Object.defineProperty(SdGridMaterial.prototype, "_gridFilter", {
2364
2493
  set: function (gridFilter) {
@@ -2434,11 +2563,11 @@
2434
2563
  };
2435
2564
  return SdGridMaterial;
2436
2565
  }());
2437
- _paginator = new WeakMap(), _sort = new WeakMap(), _subscription$1 = new WeakMap(), _optionChanges = new WeakMap(), _initCellDef = new WeakMap(), _initFilterDef = new WeakMap(), _initFooterDef = new WeakMap(), _filterExportInfo = new WeakMap(), _initConfiguration = new WeakMap(), _filterLocal = new WeakMap(), _getFilter = new WeakMap(), _load$1 = new WeakMap(), _render = new WeakMap(), _exportedItems = new WeakMap(), _allColumns = new WeakMap(), _allExportedColumns = new WeakMap(), _onExport = new WeakMap(), _updateSelectedItems = new WeakMap();
2566
+ _paginator = new WeakMap(), _sort = new WeakMap(), _subscription$1 = new WeakMap(), _optionChanges = new WeakMap(), _initCellDef = new WeakMap(), _initFilterDef = new WeakMap(), _initFooterDef = new WeakMap(), _filterExportInfo = new WeakMap(), _initConfiguration = new WeakMap(), _filterLocal = new WeakMap(), _getFilter = new WeakMap(), _load$1 = new WeakMap(), _render = new WeakMap(), _exportedItems = new WeakMap(), _allColumns = new WeakMap(), _allExportedColumns = new WeakMap(), _onExport = new WeakMap(), _updateSelectedItems = new WeakMap(), _generateEditorHanlder = new WeakMap();
2438
2567
  SdGridMaterial.decorators = [
2439
2568
  { type: core.Component, args: [{
2440
2569
  selector: 'sd-grid-material',
2441
- template: "<ng-container *ngIf=\"gridConfigurationObserver | async as gridConfiguration\">\r\n <ng-container\r\n *ngIf=\"\r\n gridConfiguration\r\n | sdGridConfigurationResult\r\n : gridOption\r\n : sdSubInformation as configuration\r\n \"\r\n >\r\n <ng-container *ngIf=\"!gridOption.filter?.disabled\">\r\n <sd-grid-filter\r\n [filter]=\"gridOption?.filter\"\r\n [columns]=\"configuration.firstColumns\"\r\n [filterDefs]=\"filterDefs\"\r\n >\r\n </sd-grid-filter>\r\n </ng-container>\r\n <div\r\n class=\"c-container {{ gridOption?.style?.grid }}\"\r\n [ngClass]=\"{ 'mat-elevation-z2': gridOption?.shadow }\"\r\n >\r\n <div class=\"c-loading\" *ngIf=\"isLoading\">\r\n <mat-spinner *ngIf=\"isLoading\"></mat-spinner>\r\n </div>\r\n <ng-container>\r\n <div\r\n class=\"c-table\"\r\n [ngStyle]=\"{\r\n 'max-height': gridOption?.maxHeight,\r\n 'min-height': 'gridOption?.minHeight'\r\n }\"\r\n >\r\n <table\r\n *ngIf=\"items?.length; else elseEmpty\"\r\n mat-table\r\n [dataSource]=\"items\"\r\n matSort\r\n [matSortDisabled]=\"!gridOption.sortable\"\r\n cdkDropList\r\n cdkDropListOrientation=\"horizontal\"\r\n [cdkDropListDisabled]=\"!gridOption.dropDragColumnEnable\"\r\n (cdkDropListDropped)=\"drop($event, configuration.displayedColumns)\"\r\n multiTemplateDataRows\r\n >\r\n <ng-container matColumnDef=\"sdSubInformation\" sticky>\r\n <td\r\n class=\"p-0\"\r\n mat-cell\r\n *matCellDef=\"let item\"\r\n [attr.colspan]=\"configuration.displayedColumns.length\"\r\n >\r\n <div\r\n *ngIf=\"sdSubInformation?.templateRef\"\r\n [@detailExpand]=\"item.isExpanded ? 'expanded' : 'collapsed'\"\r\n >\r\n <ng-container *ngIf=\"item.isExpanded\">\r\n <ng-container\r\n *ngTemplateOutlet=\"\r\n sdSubInformation.templateRef;\r\n context: { item: item }\r\n \"\r\n >\r\n </ng-container>\r\n </ng-container>\r\n </div>\r\n </td>\r\n <td mat-footer-cell *matFooterCellDef></td>\r\n </ng-container>\r\n <ng-container matColumnDef=\"sdSubInformationAction\" stickyEnd>\r\n <th\r\n class=\"p-0\"\r\n mat-header-cell\r\n *matHeaderCellDef\r\n style=\"width: 1px\"\r\n [attr.rowspan]=\"configuration.multipleHeader ? 2 : 1\"\r\n ></th>\r\n <td mat-cell *matCellDef=\"let element\">\r\n <button\r\n *ngIf=\"!element.isExpanding\"\r\n mat-icon-button\r\n aria-label=\"Expand & Collapse\"\r\n (click)=\"onExpand(element)\"\r\n >\r\n <mat-icon *ngIf=\"!element.isExpanded\">expand_more</mat-icon>\r\n <mat-icon *ngIf=\"element.isExpanded\">expand_less</mat-icon>\r\n </button>\r\n <div *ngIf=\"element.isExpanding\" class=\"lds-ring\">\r\n <div></div>\r\n <div></div>\r\n <div></div>\r\n <div></div>\r\n </div>\r\n </td>\r\n </ng-container>\r\n <ng-container matColumnDef=\"selection\" sticky>\r\n <th\r\n class=\"text-center px-15\"\r\n mat-header-cell\r\n *matHeaderCellDef\r\n style=\"min-width: 50px; max-width: 50px\"\r\n [attr.rowspan]=\"configuration.multipleHeader ? 2 : 1\"\r\n >\r\n <mat-checkbox\r\n *ngIf=\"!gridOption.selection?.single\"\r\n class=\"c-selection\"\r\n color=\"primary\"\r\n [(ngModel)]=\"isSelectAll\"\r\n (change)=\"onSelectAll()\"\r\n [disabled]=\"\r\n items | selectionDisableSelectAll: gridOption?.selection\r\n \"\r\n >\r\n </mat-checkbox>\r\n </th>\r\n <td\r\n class=\"text-center px-15\"\r\n mat-cell\r\n *matCellDef=\"let item\"\r\n style=\"min-width: 50px; max-width: 50px\"\r\n >\r\n <mat-checkbox\r\n class=\"c-selection\"\r\n color=\"primary\"\r\n [(ngModel)]=\"item.isSelected\"\r\n (change)=\"onSelect(item)\"\r\n [disabled]=\"\r\n selectedItems | selectionDisable: item:gridOption?.selection\r\n \"\r\n >\r\n </mat-checkbox>\r\n </td>\r\n <td mat-footer-cell *matFooterCellDef></td>\r\n </ng-container>\r\n <ng-container matColumnDef=\"command\">\r\n <th\r\n class=\"px-8 py-8\"\r\n mat-header-cell\r\n *matHeaderCellDef\r\n style=\"width: 50px\"\r\n [attr.rowspan]=\"configuration.multipleHeader ? 2 : 1\"\r\n ></th>\r\n <td class=\"px-8\" mat-cell *matCellDef=\"let item\">\r\n <sd-desktop-command\r\n [commands]=\"gridOption.commands\"\r\n [item]=\"item\"\r\n ></sd-desktop-command>\r\n </td>\r\n <td mat-footer-cell *matFooterCellDef></td>\r\n </ng-container>\r\n <ng-container\r\n *ngFor=\"let column of configuration.firstColumns; let i = index\"\r\n [matColumnDef]=\"column.field\"\r\n [sticky]=\"configuration.fixedColumn[column.field]\"\r\n >\r\n <th\r\n mat-header-cell\r\n *matHeaderCellDef\r\n cdkDrag\r\n class=\"px-8 py-8 c-th\"\r\n [ngStyle]=\"{ 'min-width': column.width }\"\r\n [attr.rowspan]=\"\r\n configuration.multipleHeader && column.type !== 'children-col'\r\n ? 2\r\n : 1\r\n \"\r\n [attr.colspan]=\"\r\n column.type === 'children-col' ? column.children?.length : 1\r\n \"\r\n >\r\n <div>\r\n <div\r\n aria-hidden=\"false\"\r\n role=\"presentation\"\r\n mat-sort-header\r\n [disabled]=\"\r\n !column.sortable || column.type === 'children-col'\r\n \"\r\n [innerHTML]=\"column.titleHtml || column.title\"\r\n ></div>\r\n <div\r\n class=\"c-inline-column\"\r\n *ngIf=\"gridOption.filter?.inlineColumn\"\r\n >\r\n <ng-container\r\n *ngTemplateOutlet=\"\r\n inlineColumn;\r\n context: { column: column }\r\n \"\r\n ></ng-container>\r\n </div>\r\n </div>\r\n </th>\r\n <td class=\"c-td px-8\" mat-cell *matCellDef=\"let item\">\r\n <ng-container *ngIf=\"cellDef[column.field]\">\r\n <ng-container\r\n *ngTemplateOutlet=\"\r\n cellDef[column.field].templateRef;\r\n context: { item: item, column: column, idx: i }\r\n \"\r\n >\r\n </ng-container>\r\n </ng-container>\r\n <sd-desktop-cell-view\r\n *ngIf=\"!cellDef[column.field]\"\r\n [key]=\"key\"\r\n [column]=\"column\"\r\n [item]=\"item\"\r\n >\r\n </sd-desktop-cell-view>\r\n </td>\r\n <td mat-footer-cell *matFooterCellDef>\r\n <ng-container *ngIf=\"footerDef[column.field]\">\r\n <ng-container\r\n *ngTemplateOutlet=\"\r\n footerDef[column.field].templateRef;\r\n context: { items: items, column: column }\r\n \"\r\n >\r\n </ng-container>\r\n </ng-container>\r\n </td>\r\n </ng-container>\r\n <ng-container\r\n *ngFor=\"let column of configuration.secondColumns; let i = index\"\r\n [matColumnDef]=\"column.field\"\r\n >\r\n <th\r\n mat-header-cell\r\n *matHeaderCellDef\r\n mat-sort-header\r\n class=\"c-th px-8\"\r\n [ngStyle]=\"{ 'min-width': column.width }\"\r\n >\r\n <div>\r\n <div [innerHTML]=\"column.titleHtml || column.title\"></div>\r\n <div\r\n class=\"c-inline-column\"\r\n *ngIf=\"gridOption.filter?.inlineColumn\"\r\n >\r\n <ng-container\r\n *ngTemplateOutlet=\"\r\n inlineColumn;\r\n context: { column: column }\r\n \"\r\n ></ng-container>\r\n </div>\r\n </div>\r\n </th>\r\n <td class=\"c-td px-8\" mat-cell *matCellDef=\"let item\">\r\n <ng-container *ngIf=\"cellDef[column.field]\">\r\n <ng-container\r\n *ngTemplateOutlet=\"\r\n cellDef[column.field].templateRef;\r\n context: { item: item, column: column, idx: i }\r\n \"\r\n >\r\n </ng-container>\r\n </ng-container>\r\n <sd-desktop-cell-view\r\n *ngIf=\"!cellDef[column.field]\"\r\n [key]=\"key\"\r\n [column]=\"column\"\r\n [item]=\"item\"\r\n >\r\n </sd-desktop-cell-view>\r\n </td>\r\n <td mat-footer-cell *matFooterCellDef>\r\n <ng-container *ngIf=\"footerDef[column.field]\">\r\n <ng-container\r\n *ngTemplateOutlet=\"\r\n footerDef[column.field].templateRef;\r\n context: { items: items, column: column }\r\n \"\r\n >\r\n </ng-container>\r\n </ng-container>\r\n </td>\r\n </ng-container>\r\n <tr\r\n class=\"c-first-header\"\r\n mat-header-row\r\n *matHeaderRowDef=\"configuration.firstHeaders; sticky: true\"\r\n ></tr>\r\n <ng-container *ngIf=\"configuration.secondHeaders?.length\">\r\n <tr\r\n class=\"c-second-header\"\r\n mat-header-row\r\n *matHeaderRowDef=\"configuration.secondHeaders; sticky: true\"\r\n ></tr>\r\n </ng-container>\r\n <tr\r\n mat-row\r\n *matRowDef=\"let row; columns: configuration.displayedColumns\"\r\n matRipple\r\n class=\"c-row\"\r\n ></tr>\r\n <tr\r\n mat-row\r\n *matRowDef=\"let row; columns: ['sdSubInformation']\"\r\n class=\"c-detail-row\"\r\n ></tr>\r\n <ng-container\r\n *ngIf=\"hasFooter && configuration.displayedFooters?.length\"\r\n >\r\n <tr\r\n mat-footer-row\r\n *matFooterRowDef=\"configuration.displayedFooters; sticky: true\"\r\n ></tr>\r\n </ng-container>\r\n </table>\r\n <ng-template #elseEmpty>\r\n <table mat-table [dataSource]=\"[{}]\">\r\n <ng-container matColumnDef=\"selection\" sticky>\r\n <th\r\n class=\"px-15\"\r\n mat-header-cell\r\n *matHeaderCellDef\r\n style=\"min-width: 50px; max-width: 50px\"\r\n [attr.rowspan]=\"configuration.multipleHeader ? 2 : 1\"\r\n ></th>\r\n </ng-container>\r\n <ng-container matColumnDef=\"command\">\r\n <th\r\n class=\"px-8\"\r\n mat-header-cell\r\n *matHeaderCellDef\r\n style=\"min-width: 50px; max-width: 50px\"\r\n [attr.rowspan]=\"configuration.multipleHeader ? 2 : 1\"\r\n ></th>\r\n </ng-container>\r\n <ng-container matColumnDef=\"sdSubInformationAction\">\r\n <th\r\n class=\"p-0\"\r\n mat-header-cell\r\n *matHeaderCellDef\r\n style=\"width: 1px\"\r\n [attr.rowspan]=\"configuration.multipleHeader ? 2 : 1\"\r\n ></th>\r\n </ng-container>\r\n <ng-container matColumnDef=\"sdEmpty\">\r\n <td\r\n class=\"c-empty\"\r\n mat-cell\r\n *matCellDef=\"let item\"\r\n [attr.colspan]=\"configuration.displayedColumns.length\"\r\n >\r\n <ng-container\r\n *ngIf=\"sdEmptyData?.templateRef; else sdEmptyDataNoRef\"\r\n >\r\n <ng-container\r\n *ngTemplateOutlet=\"\r\n sdEmptyData.templateRef;\r\n context: { item: item }\r\n \"\r\n >\r\n </ng-container>\r\n </ng-container>\r\n <ng-template #sdEmptyDataNoRef>\r\n <mat-icon fontSet=\"material-icons-outlined\"\r\n >leaderboard</mat-icon\r\n >\r\n </ng-template>\r\n </td>\r\n </ng-container>\r\n <ng-container\r\n *ngFor=\"let column of configuration.columns\"\r\n [matColumnDef]=\"column.field\"\r\n [sticky]=\"configuration.fixedColumn[column.field]\"\r\n >\r\n <th\r\n mat-header-cell\r\n *matHeaderCellDef\r\n class=\"c-th px-8 py-8\"\r\n [ngStyle]=\"{ 'min-width': column.width }\"\r\n >\r\n <div [innerHTML]=\"column.titleHtml || column.title\"></div>\r\n </th>\r\n </ng-container>\r\n <ng-container\r\n *ngFor=\"let column of configuration.firstColumns\"\r\n [matColumnDef]=\"column.field\"\r\n [sticky]=\"configuration.fixedColumn[column.field]\"\r\n >\r\n <th\r\n mat-header-cell\r\n *matHeaderCellDef\r\n class=\"c-th px-8 py-8\"\r\n [ngStyle]=\"{ 'min-width': column.width }\"\r\n [attr.rowspan]=\"\r\n configuration.multipleHeader &&\r\n column.type !== 'children-col'\r\n ? 2\r\n : 1\r\n \"\r\n [attr.colspan]=\"\r\n column.type === 'children-col' ? column.children?.length : 1\r\n \"\r\n >\r\n <div>\r\n <div [innerHTML]=\"column.titleHtml || column.title\"></div>\r\n <div\r\n class=\"c-inline-column\"\r\n *ngIf=\"gridOption.filter?.inlineColumn\"\r\n >\r\n <ng-container\r\n *ngTemplateOutlet=\"\r\n inlineColumn;\r\n context: { column: column }\r\n \"\r\n ></ng-container>\r\n </div>\r\n </div>\r\n </th>\r\n </ng-container>\r\n <ng-container\r\n *ngFor=\"let column of configuration.secondColumns\"\r\n [matColumnDef]=\"column.field\"\r\n >\r\n <th\r\n mat-header-cell\r\n *matHeaderCellDef\r\n class=\"c-th px-8 py-8\"\r\n [ngStyle]=\"{ 'min-width': column.width }\"\r\n >\r\n <div>\r\n <div [innerHTML]=\"column.titleHtml || column.title\"></div>\r\n <div\r\n class=\"c-inline-column\"\r\n *ngIf=\"gridOption.filter?.inlineColumn\"\r\n >\r\n <ng-container\r\n *ngTemplateOutlet=\"\r\n inlineColumn;\r\n context: { column: column }\r\n \"\r\n ></ng-container>\r\n </div>\r\n </div>\r\n </th>\r\n </ng-container>\r\n <tr\r\n class=\"c-first-header\"\r\n mat-header-row\r\n *matHeaderRowDef=\"configuration.firstHeaders; sticky: true\"\r\n ></tr>\r\n <tr\r\n class=\"c-second-header\"\r\n mat-header-row\r\n *matHeaderRowDef=\"configuration.secondHeaders; sticky: true\"\r\n ></tr>\r\n <tr mat-row *matRowDef=\"let row; columns: ['sdEmpty']\"></tr>\r\n </table>\r\n </ng-template>\r\n </div>\r\n </ng-container>\r\n <div class=\"c-paginator\">\r\n <div class=\"c-action\">\r\n <sd-button\r\n *ngIf=\"\r\n !gridOption.filter?.disabled && !gridOption.filter?.inlineColumn\r\n \"\r\n class=\"mr-10\"\r\n [title]=\"'Filter' | sdTranslate\"\r\n icon=\"filter_alt\"\r\n size=\"sm\"\r\n (action)=\"gridFilter.open()\"\r\n type=\"link\"\r\n >\r\n </sd-button>\r\n <sd-button\r\n *ngIf=\"gridOption.reload?.visible\"\r\n class=\"mr-10\"\r\n [title]=\"'Reload' | sdTranslate\"\r\n icon=\"refresh\"\r\n size=\"sm\"\r\n (action)=\"reload()\"\r\n [disabled]=\"!items?.length\"\r\n type=\"link\"\r\n >\r\n </sd-button>\r\n <ng-container *ngIf=\"gridOption.export?.visible && items?.length\">\r\n <ng-container *ngIf=\"isExporting; else unExporting\">\r\n <sd-button\r\n class=\"mr-10\"\r\n [loading]=\"isExporting\"\r\n [title]=\"exportTitle | sdTranslate\"\r\n icon=\"get_app\"\r\n size=\"sm\"\r\n type=\"link\"\r\n >\r\n </sd-button>\r\n </ng-container>\r\n <ng-template #unExporting>\r\n <sd-button\r\n class=\"mr-10\"\r\n [title]=\"exportTitle | sdTranslate\"\r\n icon=\"get_app\"\r\n size=\"sm\"\r\n [matMenuTriggerFor]=\"menu\"\r\n type=\"link\"\r\n >\r\n </sd-button>\r\n </ng-template>\r\n\r\n <mat-menu #menu=\"matMenu\">\r\n <button\r\n *ngIf=\"gridOption.export?.visibleExcel !== false\"\r\n mat-menu-item\r\n (click)=\"sdPopupExport.exportDefault()\"\r\n type=\"button\"\r\n >\r\n <mat-icon fontSet=\"material-icons-outlined\"\r\n >file_download</mat-icon\r\n >\r\n <span> {{ \"Export excel\" | sdTranslate }}</span>\r\n </button>\r\n <button\r\n *ngIf=\"gridOption.export?.visibleCSV !== false\"\r\n mat-menu-item\r\n (click)=\"sdPopupExport.exportDefault(true)\"\r\n type=\"button\"\r\n >\r\n <mat-icon fontSet=\"material-icons-outlined\"\r\n >file_download</mat-icon\r\n >\r\n <span> {{ \"Export CSV\" | sdTranslate }}</span>\r\n </button>\r\n <button\r\n *ngIf=\"gridOption.export?.key\"\r\n mat-menu-item\r\n (click)=\"sdPopupExport.open()\"\r\n type=\"button\"\r\n >\r\n <mat-icon fontSet=\"material-icons-outlined\">settings</mat-icon>\r\n <span> {{ \"Configure\" | sdTranslate }}</span>\r\n </button>\r\n </mat-menu>\r\n </ng-container>\r\n <sd-button\r\n *ngIf=\"gridOption.config?.visible\"\r\n class=\"mr-10\"\r\n [title]=\"'Configure' | sdTranslate\"\r\n icon=\"settings\"\r\n size=\"sm\"\r\n (action)=\"popupGridConfiguration.open()\"\r\n type=\"link\"\r\n >\r\n </sd-button>\r\n </div>\r\n <mat-paginator\r\n [class.d-none]=\"gridOption.paginate?.hidden\"\r\n [length]=\"total\"\r\n [pageSize]=\"gridOption.paginate?.pageSize\"\r\n [pageSizeOptions]=\"gridOption.paginate?.pages\"\r\n [showFirstLastButtons]=\"gridOption.paginate?.showFirstLastButtons\"\r\n ></mat-paginator>\r\n </div>\r\n </div>\r\n <sd-popup-export\r\n *ngIf=\"gridOption.export?.visible\"\r\n [gridOption]=\"gridOption\"\r\n (export)=\"onExport($event)\"\r\n #sdPopupExport\r\n >\r\n </sd-popup-export>\r\n <sd-popup-grid-configuration\r\n [gridOption]=\"gridOption\"\r\n [key]=\"key\"\r\n #popupGridConfiguration\r\n >\r\n </sd-popup-grid-configuration>\r\n </ng-container>\r\n</ng-container>\r\n<ng-template #inlineColumn let-column=\"column\">\r\n <ng-container\r\n *ngIf=\"\r\n column.type === 'string' ||\r\n column.type === 'number' ||\r\n column.type === 'bool' ||\r\n column.type === 'values' ||\r\n column.type === 'date' ||\r\n column.type === 'datetime' ||\r\n column.type === 'time';\r\n else noFilter\r\n \"\r\n >\r\n <sd-input\r\n *ngIf=\"column.type === 'string'\"\r\n size=\"sm\"\r\n type=\"text\"\r\n [(model)]=\"columnFilter[column.field]\"\r\n (keyupEnter)=\"onFilterChange()\"\r\n [disabled]=\"column.filter?.disabled\"\r\n >\r\n </sd-input>\r\n <sd-input\r\n *ngIf=\"column.type === 'number'\"\r\n size=\"sm\"\r\n type=\"number\"\r\n [(model)]=\"columnFilter[column.field]\"\r\n (keyupEnter)=\"onFilterChange()\"\r\n [disabled]=\"column.filter?.disabled\"\r\n >\r\n </sd-input>\r\n <sd-select\r\n *ngIf=\"column.type === 'bool'\"\r\n size=\"sm\"\r\n [items]=\"[\r\n { value: '1', display: column.option?.displayOnTrue || 'True' },\r\n { value: '0', display: column.option?.displayOnFalse || 'False' }\r\n ]\"\r\n valueField=\"value\"\r\n displayField=\"display\"\r\n [(model)]=\"columnFilter[column.field]\"\r\n (sdChange)=\"onFilterChange()\"\r\n [disabled]=\"column.filter?.disabled\"\r\n >\r\n </sd-select>\r\n <sd-select\r\n *ngIf=\"\r\n column.type === 'values' && column?.option?.selection !== 'AUTOCOMPLETE'\r\n \"\r\n size=\"sm\"\r\n [items]=\"column.option.items\"\r\n [valueField]=\"column.option.valueField\"\r\n [displayField]=\"column.option.displayField\"\r\n [(model)]=\"columnFilter[column.field]\"\r\n (sdChange)=\"onFilterChange()\"\r\n [disabled]=\"column.filter?.disabled\"\r\n [multiple]=\"\r\n column?.option?.selection === 'MULTIPLE' ||\r\n column?.option?.selection === 'MULTIPLEAUTOCOMPLETE'\r\n \"\r\n [filtered]=\"column?.option?.selection === 'MULTIPLEAUTOCOMPLETE'\"\r\n >\r\n </sd-select>\r\n <sd-autocomplete\r\n *ngIf=\"\r\n column.type === 'values' && column?.option?.selection === 'AUTOCOMPLETE'\r\n \"\r\n size=\"sm\"\r\n [items]=\"column.option.items\"\r\n [valueField]=\"column.option.valueField\"\r\n [displayField]=\"column.option.displayField\"\r\n [(model)]=\"columnFilter[column.field]\"\r\n (sdChange)=\"onFilterChange()\"\r\n [disabled]=\"column.filter?.disabled\"\r\n >\r\n </sd-autocomplete>\r\n <sd-date-time\r\n *ngIf=\"\r\n column.type === 'date' ||\r\n column.type === 'datetime' ||\r\n column.type === 'time'\r\n \"\r\n size=\"sm\"\r\n [(model)]=\"columnFilter[column.field]\"\r\n [type]=\"column.type\"\r\n (sdChange)=\"onFilterChange()\"\r\n [disabled]=\"column.filter?.disabled\"\r\n >\r\n </sd-date-time>\r\n </ng-container>\r\n <ng-template #noFilter>\r\n <sd-input type=\"text\" disabled> </sd-input>\r\n </ng-template>\r\n</ng-template>\r\n\r\n<sd-quick-action\r\n *ngIf=\"\r\n selectedItems\r\n | selectionActionFilter: gridOption?.selection?.actions as actions\r\n \"\r\n [isOpened]=\"actions?.length\"\r\n>\r\n <div sdMessage>\r\n <strong class=\"text-info\">{{ selectedItems.length }}</strong>\r\n {{ gridOption?.selection?.message || (\"selected rows\" | sdTranslate) }}\r\n </div>\r\n <div class=\"d-flex align-items-center\" sdAction>\r\n <ng-container *ngFor=\"let action of actions\">\r\n <sd-button\r\n *ngIf=\"action.click\"\r\n class=\"ml-5\"\r\n [tooltip]=\"action.tooltip\"\r\n [icon]=\"action.icon\"\r\n [color]=\"action.color || 'secondary'\"\r\n [type]=\"action.type || 'light'\"\r\n [fontSet]=\"action.fontSet\"\r\n [title]=\"action.title\"\r\n size=\"sm\"\r\n (action)=\"action.click(selectedItems)\"\r\n ></sd-button>\r\n <ng-container *ngIf=\"action.children?.length\">\r\n <sd-button\r\n class=\"ml-5\"\r\n [tooltip]=\"action.tooltip\"\r\n [icon]=\"action.icon || 'more_vert'\"\r\n [color]=\"action.color || 'secondary'\"\r\n [type]=\"action.type || 'light'\"\r\n [fontSet]=\"action.fontSet\"\r\n [title]=\"action.title\"\r\n size=\"sm\"\r\n [matMenuTriggerFor]=\"menu\"\r\n >\r\n </sd-button>\r\n <mat-menu #menu=\"matMenu\">\r\n <span>\r\n <button\r\n *ngFor=\"let childAction of action.children\"\r\n mat-menu-item\r\n (click)=\"childAction.click(selectedItems)\"\r\n [disabled]=\"childAction.disabled\"\r\n >\r\n <mat-icon [fontSet]=\"childAction.fontSet\" class=\"c-icon\"\r\n >{{ childAction.icon }}\r\n </mat-icon>\r\n <span> {{ childAction.title }}</span>\r\n </button>\r\n </span>\r\n </mat-menu>\r\n </ng-container>\r\n </ng-container>\r\n </div>\r\n</sd-quick-action>\r\n",
2570
+ template: "<ng-container *ngIf=\"gridConfigurationObserver | async as gridConfiguration\">\r\n <ng-container *ngIf=\"\r\n gridConfiguration\r\n | sdGridConfigurationResult\r\n : gridOption\r\n : sdSubInformation as configuration\r\n \">\r\n <ng-container *ngIf=\"!gridOption.filter?.disabled\">\r\n <sd-grid-filter [filter]=\"gridOption?.filter\" [columns]=\"configuration.firstColumns\" [filterDefs]=\"filterDefs\">\r\n </sd-grid-filter>\r\n </ng-container>\r\n <div class=\"c-container {{ gridOption?.style?.grid }}\" [ngClass]=\"{ 'mat-elevation-z2': gridOption?.shadow }\">\r\n <div class=\"c-loading\" *ngIf=\"isLoading\">\r\n <mat-spinner *ngIf=\"isLoading\"></mat-spinner>\r\n </div>\r\n <ng-container>\r\n <div class=\"c-table\" [ngStyle]=\"{\r\n 'max-height': gridOption?.maxHeight,\r\n 'min-height': 'gridOption?.minHeight'\r\n }\">\r\n <table *ngIf=\"items?.length; else elseEmpty\" mat-table [dataSource]=\"items\" matSort\r\n [matSortDisabled]=\"!gridOption.sortable\" cdkDropList cdkDropListOrientation=\"horizontal\"\r\n [cdkDropListDisabled]=\"!gridOption.dropDragColumnEnable\"\r\n (cdkDropListDropped)=\"drop($event, configuration.displayedColumns)\" multiTemplateDataRows>\r\n <ng-container matColumnDef=\"sdSubInformation\" sticky>\r\n <td class=\"p-0\" mat-cell *matCellDef=\"let item\" [attr.colspan]=\"configuration.displayedColumns.length\">\r\n <div *ngIf=\"sdSubInformation?.templateRef\" [@detailExpand]=\"item.isExpanded ? 'expanded' : 'collapsed'\">\r\n <ng-container *ngIf=\"item.isExpanded\">\r\n <ng-container *ngTemplateOutlet=\"\r\n sdSubInformation.templateRef;\r\n context: { item: item }\r\n \">\r\n </ng-container>\r\n </ng-container>\r\n </div>\r\n </td>\r\n <td mat-footer-cell *matFooterCellDef></td>\r\n </ng-container>\r\n <ng-container matColumnDef=\"sdSubInformationAction\" stickyEnd>\r\n <th class=\"p-0\" mat-header-cell *matHeaderCellDef style=\"width: 1px\"\r\n [attr.rowspan]=\"configuration.multipleHeader ? 2 : 1\"></th>\r\n <td mat-cell *matCellDef=\"let element\">\r\n <button *ngIf=\"!element.isExpanding\" mat-icon-button aria-label=\"Expand & Collapse\"\r\n (click)=\"onExpand(element)\">\r\n <mat-icon *ngIf=\"!element.isExpanded\">expand_more</mat-icon>\r\n <mat-icon *ngIf=\"element.isExpanded\">expand_less</mat-icon>\r\n </button>\r\n <div *ngIf=\"element.isExpanding\" class=\"lds-ring\">\r\n <div></div>\r\n <div></div>\r\n <div></div>\r\n <div></div>\r\n </div>\r\n </td>\r\n </ng-container>\r\n <ng-container matColumnDef=\"sdSelection\" sticky>\r\n <th class=\"text-center px-15\" mat-header-cell *matHeaderCellDef style=\"min-width: 50px; max-width: 50px\"\r\n [attr.rowspan]=\"configuration.multipleHeader ? 2 : 1\">\r\n <mat-checkbox *ngIf=\"!gridOption.selection?.single\" class=\"c-selection\" color=\"primary\"\r\n [(ngModel)]=\"isSelectAll\" (change)=\"onSelectAll()\" [disabled]=\"\r\n items | selectionDisableSelectAll: gridOption?.selection\r\n \">\r\n </mat-checkbox>\r\n </th>\r\n <td class=\"text-center px-15\" mat-cell *matCellDef=\"let item\" style=\"min-width: 50px; max-width: 50px\">\r\n <mat-checkbox class=\"c-selection\" color=\"primary\" [(ngModel)]=\"item.isSelected\"\r\n (change)=\"onSelect(item)\" [disabled]=\"\r\n selectedItems | selectionDisable: item:gridOption?.selection\r\n \">\r\n </mat-checkbox>\r\n </td>\r\n <td mat-footer-cell *matFooterCellDef></td>\r\n </ng-container>\r\n <ng-container matColumnDef=\"sdEditor\">\r\n <th class=\"px-8 py-8\" mat-header-cell *matHeaderCellDef style=\"width: 50px\"\r\n [attr.rowspan]=\"configuration.multipleHeader ? 2 : 1\">\r\n <button\r\n *ngIf=\"gridOption.editor?.addable && (!gridOption.editor.limit || gridOption.editor.limit > items.length)\"\r\n (click)=\"onCreate()\" aria-hidden=\"true\" mat-icon-button>\r\n <mat-icon class=\"c-icon\">add</mat-icon>\r\n </button>\r\n </th>\r\n <td class=\"px-8\" mat-cell *matCellDef=\"let item\">\r\n <ng-container *sdLet=\"item | sdEditorHandlerRow:gridOption as editorHandler\">\r\n <ng-container *ngIf=\"editorHandler.visible\">\r\n <ng-container *ngIf=\"editorHandler.isInline;else notInline\">\r\n <button *ngIf=\"editorHandler.removable\" class=\"mx-2\" (click)=\"onCancel(item)\" aria-hidden=\"true\"\r\n mat-icon-button>\r\n <mat-icon class=\"c-icon\">delete</mat-icon>\r\n </button>\r\n </ng-container>\r\n <ng-template #notInline>\r\n <ng-container *ngIf=\"!editorHandler.status\">\r\n <button *ngIf=\"editorHandler.editable\" class=\"mx-2\" (click)=\"onUpdate(item, true)\" aria-hidden=\"true\"\r\n mat-icon-button>\r\n <mat-icon class=\"c-icon\">edit</mat-icon>\r\n </button>\r\n </ng-container>\r\n <ng-container *ngIf=\"editorHandler.status\">\r\n <button class=\"mx-2\" (click)=\"onSave(item)\" aria-hidden=\"true\" mat-icon-button>\r\n <mat-icon class=\"c-icon\">save</mat-icon>\r\n </button>\r\n <button class=\"mx-2\" (click)=\"onCancel(item)\" aria-hidden=\"true\" mat-icon-button>\r\n <mat-icon class=\"c-icon\">close</mat-icon>\r\n </button>\r\n </ng-container>\r\n\r\n </ng-template>\r\n </ng-container>\r\n\r\n </ng-container>\r\n </td>\r\n <td mat-footer-cell *matFooterCellDef></td>\r\n </ng-container>\r\n <ng-container matColumnDef=\"sdCommand\">\r\n <th class=\"px-8 py-8\" mat-header-cell *matHeaderCellDef style=\"width: 50px\"\r\n [attr.rowspan]=\"configuration.multipleHeader ? 2 : 1\"></th>\r\n <td class=\"px-8\" mat-cell *matCellDef=\"let item\">\r\n <sd-desktop-command [commands]=\"gridOption.commands\" [item]=\"item\"></sd-desktop-command>\r\n </td>\r\n <td mat-footer-cell *matFooterCellDef></td>\r\n </ng-container>\r\n <ng-container *ngFor=\"let column of configuration.firstColumns; let i = index\" [matColumnDef]=\"column.field\"\r\n [sticky]=\"configuration.fixedColumn[column.field]\">\r\n <th mat-header-cell *matHeaderCellDef cdkDrag class=\"px-8 py-8 c-th\"\r\n [ngStyle]=\"{ 'min-width': column.width }\" [attr.rowspan]=\"\r\n configuration.multipleHeader && column.type !== 'children-col'\r\n ? 2\r\n : 1\r\n \" [attr.colspan]=\"\r\n column.type === 'children-col' ? column.children?.length : 1\r\n \">\r\n <div>\r\n <div aria-hidden=\"false\" role=\"presentation\" mat-sort-header [disabled]=\"\r\n !column.sortable || column.type === 'children-col'\r\n \" [innerHTML]=\"column.titleHtml || column.title\"></div>\r\n <div class=\"c-inline-column\" *ngIf=\"gridOption.filter?.inlineColumn\">\r\n <ng-container *ngTemplateOutlet=\"\r\n inlineColumn;\r\n context: { column: column }\r\n \"></ng-container>\r\n </div>\r\n </div>\r\n </th>\r\n <td class=\"c-td px-8\" mat-cell *matCellDef=\"let item\">\r\n <ng-container *ngIf=\"cellDef[column.field]\">\r\n <ng-container *ngTemplateOutlet=\"\r\n cellDef[column.field].templateRef;\r\n context: { item: item, column: column, idx: i }\r\n \">\r\n </ng-container>\r\n </ng-container>\r\n <sd-desktop-cell *ngIf=\"!cellDef[column.field]\" [key]=\"key\" [column]=\"column\" [item]=\"item\"\r\n [gridOption]=\"gridOption\">\r\n </sd-desktop-cell>\r\n </td>\r\n <td mat-footer-cell *matFooterCellDef>\r\n <ng-container *ngIf=\"footerDef[column.field]\">\r\n <ng-container *ngTemplateOutlet=\"\r\n footerDef[column.field].templateRef;\r\n context: { items: items, column: column }\r\n \">\r\n </ng-container>\r\n </ng-container>\r\n </td>\r\n </ng-container>\r\n <ng-container *ngFor=\"let column of configuration.secondColumns; let i = index\"\r\n [matColumnDef]=\"column.field\">\r\n <th mat-header-cell *matHeaderCellDef mat-sort-header class=\"c-th px-8\"\r\n [ngStyle]=\"{ 'min-width': column.width }\">\r\n <div>\r\n <div [innerHTML]=\"column.titleHtml || column.title\"></div>\r\n <div class=\"c-inline-column\" *ngIf=\"gridOption.filter?.inlineColumn\">\r\n <ng-container *ngTemplateOutlet=\"\r\n inlineColumn;\r\n context: { column: column }\r\n \"></ng-container>\r\n </div>\r\n </div>\r\n </th>\r\n <td class=\"c-td px-8\" mat-cell *matCellDef=\"let item\">\r\n <ng-container *ngIf=\"cellDef[column.field]\">\r\n <ng-container *ngTemplateOutlet=\"\r\n cellDef[column.field].templateRef;\r\n context: { item: item, column: column, idx: i }\r\n \">\r\n </ng-container>\r\n </ng-container>\r\n <sd-desktop-cell *ngIf=\"!cellDef[column.field]\" [key]=\"key\" [column]=\"column\" [item]=\"item\"\r\n [gridOption]=\"gridOption\">\r\n </sd-desktop-cell>\r\n </td>\r\n <td mat-footer-cell *matFooterCellDef>\r\n <ng-container *ngIf=\"footerDef[column.field]\">\r\n <ng-container *ngTemplateOutlet=\"\r\n footerDef[column.field].templateRef;\r\n context: { items: items, column: column }\r\n \">\r\n </ng-container>\r\n </ng-container>\r\n </td>\r\n </ng-container>\r\n <tr class=\"c-first-header\" mat-header-row *matHeaderRowDef=\"configuration.firstHeaders; sticky: true\"></tr>\r\n <ng-container *ngIf=\"configuration.secondHeaders?.length\">\r\n <tr class=\"c-second-header\" mat-header-row *matHeaderRowDef=\"configuration.secondHeaders; sticky: true\">\r\n </tr>\r\n </ng-container>\r\n <tr mat-row *matRowDef=\"let row; columns: configuration.displayedColumns\" matRipple class=\"c-row\"></tr>\r\n <tr mat-row *matRowDef=\"let row; columns: ['sdSubInformation']\" class=\"c-detail-row\"></tr>\r\n <ng-container *ngIf=\"hasFooter && configuration.displayedFooters?.length\">\r\n <tr mat-footer-row *matFooterRowDef=\"configuration.displayedFooters; sticky: true\"></tr>\r\n </ng-container>\r\n </table>\r\n <ng-template #elseEmpty>\r\n <table mat-table [dataSource]=\"[{}]\">\r\n <ng-container matColumnDef=\"sdSelection\" sticky>\r\n <th class=\"px-15\" mat-header-cell *matHeaderCellDef style=\"min-width: 50px; max-width: 50px\"\r\n [attr.rowspan]=\"configuration.multipleHeader ? 2 : 1\"></th>\r\n </ng-container>\r\n <ng-container matColumnDef=\"sdEditor\">\r\n <th class=\"px-8\" mat-header-cell *matHeaderCellDef style=\"min-width: 50px; max-width: 50px\"\r\n [attr.rowspan]=\"configuration.multipleHeader ? 2 : 1\">\r\n <button\r\n *ngIf=\"gridOption.editor?.addable && (!gridOption.editor.limit || gridOption.editor.limit > items.length)\"\r\n (click)=\"onCreate()\" aria-hidden=\"true\" mat-icon-button>\r\n <mat-icon class=\"c-icon\">add</mat-icon>\r\n </button>\r\n </th>\r\n </ng-container>\r\n <ng-container matColumnDef=\"sdCommand\">\r\n <th class=\"px-8\" mat-header-cell *matHeaderCellDef style=\"min-width: 50px; max-width: 50px\"\r\n [attr.rowspan]=\"configuration.multipleHeader ? 2 : 1\"></th>\r\n </ng-container>\r\n <ng-container matColumnDef=\"sdSubInformationAction\">\r\n <th class=\"p-0\" mat-header-cell *matHeaderCellDef style=\"width: 1px\"\r\n [attr.rowspan]=\"configuration.multipleHeader ? 2 : 1\"></th>\r\n </ng-container>\r\n <ng-container matColumnDef=\"sdEmpty\">\r\n <td class=\"c-empty\" mat-cell *matCellDef=\"let item\"\r\n [attr.colspan]=\"configuration.displayedColumns.length\">\r\n <ng-container *ngIf=\"sdEmptyData?.templateRef; else sdEmptyDataNoRef\">\r\n <ng-container *ngTemplateOutlet=\"\r\n sdEmptyData.templateRef;\r\n context: { item: item }\r\n \">\r\n </ng-container>\r\n </ng-container>\r\n <ng-template #sdEmptyDataNoRef>\r\n <mat-icon fontSet=\"material-icons-outlined\">leaderboard</mat-icon>\r\n </ng-template>\r\n </td>\r\n </ng-container>\r\n <ng-container *ngFor=\"let column of configuration.columns\" [matColumnDef]=\"column.field\"\r\n [sticky]=\"configuration.fixedColumn[column.field]\">\r\n <th mat-header-cell *matHeaderCellDef class=\"c-th px-8 py-8\" [ngStyle]=\"{ 'min-width': column.width }\">\r\n <div [innerHTML]=\"column.titleHtml || column.title\"></div>\r\n </th>\r\n </ng-container>\r\n <ng-container *ngFor=\"let column of configuration.firstColumns\" [matColumnDef]=\"column.field\"\r\n [sticky]=\"configuration.fixedColumn[column.field]\">\r\n <th mat-header-cell *matHeaderCellDef class=\"c-th px-8 py-8\" [ngStyle]=\"{ 'min-width': column.width }\"\r\n [attr.rowspan]=\"\r\n configuration.multipleHeader &&\r\n column.type !== 'children-col'\r\n ? 2\r\n : 1\r\n \" [attr.colspan]=\"\r\n column.type === 'children-col' ? column.children?.length : 1\r\n \">\r\n <div>\r\n <div [innerHTML]=\"column.titleHtml || column.title\"></div>\r\n <div class=\"c-inline-column\" *ngIf=\"gridOption.filter?.inlineColumn\">\r\n <ng-container *ngTemplateOutlet=\"\r\n inlineColumn;\r\n context: { column: column }\r\n \"></ng-container>\r\n </div>\r\n </div>\r\n </th>\r\n </ng-container>\r\n <ng-container *ngFor=\"let column of configuration.secondColumns\" [matColumnDef]=\"column.field\">\r\n <th mat-header-cell *matHeaderCellDef class=\"c-th px-8 py-8\" [ngStyle]=\"{ 'min-width': column.width }\">\r\n <div>\r\n <div [innerHTML]=\"column.titleHtml || column.title\"></div>\r\n <div class=\"c-inline-column\" *ngIf=\"gridOption.filter?.inlineColumn\">\r\n <ng-container *ngTemplateOutlet=\"\r\n inlineColumn;\r\n context: { column: column }\r\n \"></ng-container>\r\n </div>\r\n </div>\r\n </th>\r\n </ng-container>\r\n <tr class=\"c-first-header\" mat-header-row *matHeaderRowDef=\"configuration.firstHeaders; sticky: true\">\r\n </tr>\r\n <tr class=\"c-second-header\" mat-header-row *matHeaderRowDef=\"configuration.secondHeaders; sticky: true\">\r\n </tr>\r\n <tr mat-row *matRowDef=\"let row; columns: ['sdEmpty']\"></tr>\r\n </table>\r\n </ng-template>\r\n </div>\r\n </ng-container>\r\n <div class=\"c-paginator\">\r\n <div class=\"c-action\">\r\n <sd-button *ngIf=\"\r\n !gridOption.filter?.disabled && !gridOption.filter?.inlineColumn\r\n \" class=\"mr-10\" [title]=\"'Filter' | sdTranslate\" icon=\"filter_alt\" size=\"sm\" (action)=\"gridFilter.open()\"\r\n type=\"link\">\r\n </sd-button>\r\n <sd-button *ngIf=\"gridOption.reload?.visible\" class=\"mr-10\" [title]=\"'Reload' | sdTranslate\" icon=\"refresh\"\r\n size=\"sm\" (action)=\"reload()\" [disabled]=\"!items?.length\" type=\"link\">\r\n </sd-button>\r\n <ng-container *ngIf=\"gridOption.export?.visible && items?.length\">\r\n <ng-container *ngIf=\"isExporting; else unExporting\">\r\n <sd-button class=\"mr-10\" [loading]=\"isExporting\" [title]=\"exportTitle | sdTranslate\" icon=\"get_app\"\r\n size=\"sm\" type=\"link\">\r\n </sd-button>\r\n </ng-container>\r\n <ng-template #unExporting>\r\n <sd-button class=\"mr-10\" [title]=\"exportTitle | sdTranslate\" icon=\"get_app\" size=\"sm\"\r\n [matMenuTriggerFor]=\"menu\" type=\"link\">\r\n </sd-button>\r\n </ng-template>\r\n\r\n <mat-menu #menu=\"matMenu\">\r\n <button *ngIf=\"gridOption.export?.visibleExcel !== false\" mat-menu-item\r\n (click)=\"sdPopupExport.exportDefault()\" type=\"button\">\r\n <mat-icon fontSet=\"material-icons-outlined\">file_download</mat-icon>\r\n <span> {{ \"Export excel\" | sdTranslate }}</span>\r\n </button>\r\n <button *ngIf=\"gridOption.export?.visibleCSV !== false\" mat-menu-item\r\n (click)=\"sdPopupExport.exportDefault(true)\" type=\"button\">\r\n <mat-icon fontSet=\"material-icons-outlined\">file_download</mat-icon>\r\n <span> {{ \"Export CSV\" | sdTranslate }}</span>\r\n </button>\r\n <button *ngIf=\"gridOption.export?.key\" mat-menu-item (click)=\"sdPopupExport.open()\" type=\"button\">\r\n <mat-icon fontSet=\"material-icons-outlined\">settings</mat-icon>\r\n <span> {{ \"Configure\" | sdTranslate }}</span>\r\n </button>\r\n </mat-menu>\r\n </ng-container>\r\n <sd-button *ngIf=\"gridOption.config?.visible\" class=\"mr-10\" [title]=\"'Configure' | sdTranslate\"\r\n icon=\"settings\" size=\"sm\" (action)=\"popupGridConfiguration.open()\" type=\"link\">\r\n </sd-button>\r\n </div>\r\n <mat-paginator [class.d-none]=\"gridOption.paginate?.hidden\" [length]=\"total\"\r\n [pageSize]=\"gridOption.paginate?.pageSize\" [pageSizeOptions]=\"gridOption.paginate?.pages\"\r\n [showFirstLastButtons]=\"gridOption.paginate?.showFirstLastButtons\"></mat-paginator>\r\n </div>\r\n </div>\r\n <sd-popup-export *ngIf=\"gridOption.export?.visible\" [gridOption]=\"gridOption\" (export)=\"onExport($event)\"\r\n #sdPopupExport>\r\n </sd-popup-export>\r\n <sd-popup-grid-configuration [gridOption]=\"gridOption\" [key]=\"key\" #popupGridConfiguration>\r\n </sd-popup-grid-configuration>\r\n </ng-container>\r\n</ng-container>\r\n<ng-template #inlineColumn let-column=\"column\">\r\n <ng-container *ngIf=\"\r\n column.type === 'string' ||\r\n column.type === 'number' ||\r\n column.type === 'bool' ||\r\n column.type === 'values' ||\r\n column.type === 'date' ||\r\n column.type === 'datetime' ||\r\n column.type === 'time';\r\n else noFilter\r\n \">\r\n <sd-input *ngIf=\"column.type === 'string'\" size=\"sm\" type=\"text\" [(model)]=\"columnFilter[column.field]\"\r\n (keyupEnter)=\"onFilterChange()\" [disabled]=\"column.filter?.disabled\">\r\n </sd-input>\r\n <sd-input *ngIf=\"column.type === 'number'\" size=\"sm\" type=\"number\" [(model)]=\"columnFilter[column.field]\"\r\n (keyupEnter)=\"onFilterChange()\" [disabled]=\"column.filter?.disabled\">\r\n </sd-input>\r\n <sd-select *ngIf=\"column.type === 'bool'\" size=\"sm\" [items]=\"[\r\n { value: '1', display: column.option?.displayOnTrue || 'True' },\r\n { value: '0', display: column.option?.displayOnFalse || 'False' }\r\n ]\" valueField=\"value\" displayField=\"display\" [(model)]=\"columnFilter[column.field]\" (sdChange)=\"onFilterChange()\"\r\n [disabled]=\"column.filter?.disabled\">\r\n </sd-select>\r\n <sd-select *ngIf=\"\r\n column.type === 'values' && column?.option?.selection !== 'AUTOCOMPLETE'\r\n \" size=\"sm\" [items]=\"column.option.items\" [valueField]=\"column.option.valueField\"\r\n [displayField]=\"column.option.displayField\" [(model)]=\"columnFilter[column.field]\" (sdChange)=\"onFilterChange()\"\r\n [disabled]=\"column.filter?.disabled\" [multiple]=\"\r\n column?.option?.selection === 'MULTIPLE' ||\r\n column?.option?.selection === 'MULTIPLEAUTOCOMPLETE'\r\n \" [filtered]=\"column?.option?.selection === 'MULTIPLEAUTOCOMPLETE'\">\r\n </sd-select>\r\n <sd-autocomplete *ngIf=\"\r\n column.type === 'values' && column?.option?.selection === 'AUTOCOMPLETE'\r\n \" size=\"sm\" [items]=\"column.option.items\" [valueField]=\"column.option.valueField\"\r\n [displayField]=\"column.option.displayField\" [(model)]=\"columnFilter[column.field]\" (sdChange)=\"onFilterChange()\"\r\n [disabled]=\"column.filter?.disabled\">\r\n </sd-autocomplete>\r\n <sd-date-time *ngIf=\"\r\n column.type === 'date' ||\r\n column.type === 'datetime' ||\r\n column.type === 'time'\r\n \" size=\"sm\" [(model)]=\"columnFilter[column.field]\" [type]=\"column.type\" (sdChange)=\"onFilterChange()\"\r\n [disabled]=\"column.filter?.disabled\">\r\n </sd-date-time>\r\n </ng-container>\r\n <ng-template #noFilter>\r\n <sd-input type=\"text\" disabled> </sd-input>\r\n </ng-template>\r\n</ng-template>\r\n\r\n<sd-quick-action *ngIf=\"\r\n selectedItems\r\n | selectionActionFilter: gridOption?.selection?.actions as actions\r\n \" [isOpened]=\"actions?.length\">\r\n <div sdMessage>\r\n <strong class=\"text-info\">{{ selectedItems.length }}</strong>\r\n {{ gridOption?.selection?.message || (\"selected rows\" | sdTranslate) }}\r\n </div>\r\n <div class=\"d-flex align-items-center\" sdAction>\r\n <ng-container *ngFor=\"let action of actions\">\r\n <sd-button *ngIf=\"action.click\" class=\"ml-5\" [tooltip]=\"action.tooltip\" [icon]=\"action.icon\"\r\n [color]=\"action.color || 'secondary'\" [type]=\"action.type || 'light'\" [fontSet]=\"action.fontSet\"\r\n [title]=\"action.title\" size=\"sm\" (action)=\"action.click(selectedItems)\"></sd-button>\r\n <ng-container *ngIf=\"action.children?.length\">\r\n <sd-button class=\"ml-5\" [tooltip]=\"action.tooltip\" [icon]=\"action.icon || 'more_vert'\"\r\n [color]=\"action.color || 'secondary'\" [type]=\"action.type || 'light'\" [fontSet]=\"action.fontSet\"\r\n [title]=\"action.title\" size=\"sm\" [matMenuTriggerFor]=\"menu\">\r\n </sd-button>\r\n <mat-menu #menu=\"matMenu\">\r\n <span>\r\n <button *ngFor=\"let childAction of action.children\" mat-menu-item (click)=\"childAction.click(selectedItems)\"\r\n [disabled]=\"childAction.disabled\">\r\n <mat-icon [fontSet]=\"childAction.fontSet\" class=\"c-icon\">{{ childAction.icon }}\r\n </mat-icon>\r\n <span> {{ childAction.title }}</span>\r\n </button>\r\n </span>\r\n </mat-menu>\r\n </ng-container>\r\n </ng-container>\r\n </div>\r\n</sd-quick-action>",
2442
2571
  animations: [
2443
2572
  animations.trigger('detailExpand', [
2444
2573
  animations.state('collapsed', animations.style({ height: '0', minHeight: '0', visibility: 'hidden' })),
@@ -2721,7 +2850,8 @@
2721
2850
  SdDesktopCellView.decorators = [
2722
2851
  { type: core.Component, args: [{
2723
2852
  selector: 'sd-desktop-cell-view',
2724
- template: "<ng-container *ngIf=\"column && item\">\r\n <ng-container *ngIf=\"column.htmlTemplate;else useDefaultView\">\r\n <div (click)=\"column.click && column.click(item[column.field], item)\" style=\"overflow-wrap: break-word;\"\r\n [ngClass]=\"{'cursor-pointer':column.click}\"\r\n [innerHTML]=\"(item[column.field] | columnHtmlTemplate:item:column) | safeHtml\">\r\n </div>\r\n </ng-container>\r\n <ng-template #useDefaultView>\r\n <ng-container *sdLet=\"item[column.field] | columnBadge:item:column as badge\">\r\n <ng-container *ngIf=\"column.type === 'string'\">\r\n <ng-container *ngIf=\"!!badge\">\r\n <div *ngIf=\"!column.badgeType\" class=\"c-badge\" style=\"overflow-wrap: break-word;\" matTooltipPosition=\"above\"\r\n [matTooltip]=\"item[column.field] | columnTooltip:item:column\"\r\n [class]=\"{'c-secondary': badge === 'normal', 'c-info': badge === 'info', 'c-success': badge === 'success', 'c-danger': badge === 'danger', 'c-warning': badge === 'warning'}\">\r\n <span *ngIf=\"column.click\" class=\"pointer\"\r\n (click)=\"column.click(item[column.field], item)\">{{item[column.field] |\r\n columnTransform:item:column}}</span>\r\n <ng-container *ngIf=\"!column.click\">{{item[column.field] | columnTransform:item:column}}</ng-container>\r\n </div>\r\n <div *ngIf=\"column.badgeType === 'circle'\" style=\"min-width: 150px\"\r\n class=\"c-badge-circle d-flex align-items-center\"\r\n [class]=\"{'c-unknown': !badge, 'c-secondary': badge === 'normal', 'c-info': badge === 'info', 'c-success': badge === 'success', 'c-danger': badge === 'danger', 'c-warning': badge === 'warning'}\">\r\n <span *ngIf=\"badge\" class=\"material-icons-round c-material-icon mr-4\">\r\n fiber_manual_record\r\n </span>\r\n <span *ngIf=\"!badge\" class=\"material-icons-outlined c-material-icon mr-4\">\r\n fiber_manual_record\r\n </span>\r\n {{item[column.field] | columnTransform:item:column}}\r\n </div>\r\n </ng-container>\r\n <ng-container *ngIf=\"!badge\">\r\n <div style=\"overflow-wrap: break-word;\" [matTooltip]=\"item[column.field] | columnTooltip:item:column\">\r\n <a *ngIf=\"column.click\" href=\"javascript:;\"\r\n (click)=\"column.click(item[column.field], item)\">{{item[column.field] | columnTransform:item:column}}</a>\r\n <ng-container *ngIf=\"!column.click\">{{item[column.field] | columnTransform:item:column}}</ng-container>\r\n </div>\r\n </ng-container>\r\n </ng-container>\r\n <div *ngIf=\"column.type === 'number'\">\r\n <a *ngIf=\"column.click\" href=\"javascript:;\"\r\n (click)=\"column.click(item[column.field], item)\">{{item[column.field] | columnTransform:item:column}}</a>\r\n <ng-container *ngIf=\"!column.click\">\r\n {{item[column.field] | columnTransform:item:column}}</ng-container>\r\n </div>\r\n <div *ngIf=\"column.type === 'date'\" matTooltipPosition=\"above\"\r\n [matTooltip]=\"item[column.field] | date:'dd/MM/yyyy'\">\r\n {{item[column.field] | sdTimeDifferent:'dd/MM/yyyy':column.option?.timeDifferent | async}}\r\n </div>\r\n <div *ngIf=\"column.type === 'datetime'\" matTooltipPosition=\"above\"\r\n [matTooltip]=\"item[column.field] | date:'dd/MM/yyyy HH:mm'\">\r\n {{item[column.field] | sdTimeDifferent:'dd/MM/yyyy HH:mm':column.option?.timeDifferent | async}}\r\n </div>\r\n <div *ngIf=\"column.type === 'time'\">\r\n {{item[column.field] | date:'HH:mm'}}\r\n </div>\r\n <div *ngIf=\"column.type === 'bool'\" class=\"align-middle text-center\">\r\n <ng-container *ngIf=\"!!badge\">\r\n <div *ngIf=\"!column.badgeType\" class=\"c-badge\" style=\"overflow-wrap: break-word;\" matTooltipPosition=\"above\"\r\n [matTooltip]=\"item[column.field] | columnTooltip:item:column\"\r\n [class]=\"{'c-secondary': badge === 'normal', 'c-info': badge === 'info', 'c-success': badge === 'success', 'c-danger': badge === 'danger', 'c-warning': badge === 'warning'}\">\r\n <span *ngIf=\"column.click\" class=\"pointer\"\r\n (click)=\"column.click(item[column.field], item)\">{{item[column.field] | columnTransform:item:column}}</span>\r\n <ng-container *ngIf=\"!column.click\">{{item[column.field] | columnTransform:item:column}}</ng-container>\r\n </div>\r\n <div *ngIf=\"column.badgeType === 'circle'\" style=\"min-width: 150px\"\r\n class=\"c-badge-circle d-flex align-items-center\"\r\n [class]=\"{'c-unknown': !badge, 'c-secondary': badge === 'normal', 'c-info': badge === 'info', 'c-success': badge === 'success', 'c-danger': badge === 'danger', 'c-warning': badge === 'warning'}\">\r\n <span *ngIf=\"badge\" class=\"material-icons-round c-material-icon mr-4\">\r\n fiber_manual_record\r\n </span>\r\n <span *ngIf=\"!badge\" class=\"material-icons-outlined c-material-icon mr-4\">\r\n fiber_manual_record\r\n </span>\r\n {{item[column.field] | columnTransform:item:column}}\r\n </div>\r\n </ng-container>\r\n <ng-container *ngIf=\"!badge\">\r\n <span *ngIf=\"item[column.field]\" class=\"font-weight-bold c-color-success\">{{item[column.field] | columnTransform:item:column}}</span>\r\n <span *ngIf=\"!item[column.field]\" class=\"font-weight-bold c-color-danger\">{{item[column.field] | columnTransform:item:column}}</span>\r\n </ng-container>\r\n </div>\r\n <div *ngIf=\"column.type === 'values'\">\r\n <ng-container *ngIf=\"column.transform\">{{item[column.field] | columnTransform:item:column}}</ng-container>\r\n <ng-container *ngIf=\"!column.transform\">\r\n <ng-container *ngIf=\"item[column.field] | columnValues:column:key | async; $implicit as valueData\">\r\n <div\r\n *ngIf=\"valueData[column.option?.colorField] || valueData[column.option?.backgroundColorField]; else elseNoStatus\"\r\n class=\"c-badge\"\r\n [ngStyle]=\"{'color':valueData[column.option?.colorField], 'background-color': valueData[column.option?.backgroundColorField]}\">\r\n {{valueData[column.option?.displayField]}}\r\n </div>\r\n <ng-template #elseNoStatus>\r\n <div class=\"text-left\">\r\n {{valueData[column.option?.displayField]}}\r\n </div>\r\n </ng-template>\r\n </ng-container>\r\n </ng-container>\r\n \r\n </div>\r\n <div *ngIf=\"column.type === 'image'\" class=\"align-middle text-center\">\r\n <img *ngIf=\"item[column.field]\" [src]=\"item[column.field] | columnTransform:item:column\"\r\n [width]=\"column.option?.width\" [height]=\"column.option?.height\" style=\"margin: 5px 0;object-fit: contain;\"\r\n (click)=\"column.click && column.click(item[column.field], item)\" [ngClass]=\"{'pointer':column.click}\">\r\n <mat-icon *ngIf=\"!item[column.field]\" class=\"c-img\" [ngClass]=\"{'pointer':column.click}\"\r\n (click)=\"column.click && column.click(item[column.field], item)\">image</mat-icon>\r\n </div>\r\n </ng-container>\r\n <sd-desktop-cell-children-view *ngIf=\"column.type === 'children'\" [key]=\"key\" [item]=\"item\" [column]=\"column\">\r\n </sd-desktop-cell-children-view>\r\n </ng-template>\r\n</ng-container>",
2853
+ template: "<ng-container *ngIf=\"column.htmlTemplate;else useDefaultView\">\r\n <div (click)=\"column.click && column.click(item[column.field], item)\" style=\"overflow-wrap: break-word;\"\r\n [ngClass]=\"{'cursor-pointer':column.click}\"\r\n [innerHTML]=\"(item[column.field] | columnHtmlTemplate:item:column) | safeHtml\">\r\n </div>\r\n</ng-container>\r\n<ng-template #useDefaultView>\r\n <ng-container *sdLet=\"item[column.field] | columnBadge:item:column as badge\">\r\n <ng-container *ngIf=\"column.type === 'string'\">\r\n <ng-container *ngIf=\"!!badge\">\r\n <div *ngIf=\"!column.badgeType\" class=\"c-badge\" style=\"overflow-wrap: break-word;\" matTooltipPosition=\"above\"\r\n [matTooltip]=\"item[column.field] | columnTooltip:item:column\"\r\n [class]=\"{'c-secondary': badge === 'normal', 'c-info': badge === 'info', 'c-success': badge === 'success', 'c-danger': badge === 'danger', 'c-warning': badge === 'warning'}\">\r\n <span *ngIf=\"column.click\" class=\"pointer\"\r\n (click)=\"column.click(item[column.field], item)\">{{item[column.field] |\r\n columnTransform:item:column}}</span>\r\n <ng-container *ngIf=\"!column.click\">{{item[column.field] | columnTransform:item:column}}</ng-container>\r\n </div>\r\n <div *ngIf=\"column.badgeType === 'circle'\" style=\"min-width: 150px\"\r\n class=\"c-badge-circle d-flex align-items-center\"\r\n [class]=\"{'c-unknown': !badge, 'c-secondary': badge === 'normal', 'c-info': badge === 'info', 'c-success': badge === 'success', 'c-danger': badge === 'danger', 'c-warning': badge === 'warning'}\">\r\n <span *ngIf=\"badge\" class=\"material-icons-round c-material-icon mr-4\">\r\n fiber_manual_record\r\n </span>\r\n <span *ngIf=\"!badge\" class=\"material-icons-outlined c-material-icon mr-4\">\r\n fiber_manual_record\r\n </span>\r\n {{item[column.field] | columnTransform:item:column}}\r\n </div>\r\n </ng-container>\r\n <ng-container *ngIf=\"!badge\">\r\n <div style=\"overflow-wrap: break-word;\" [matTooltip]=\"item[column.field] | columnTooltip:item:column\">\r\n <a *ngIf=\"column.click\" href=\"javascript:;\"\r\n (click)=\"column.click(item[column.field], item)\">{{item[column.field] | columnTransform:item:column}}</a>\r\n <ng-container *ngIf=\"!column.click\">{{item[column.field] | columnTransform:item:column}}</ng-container>\r\n </div>\r\n </ng-container>\r\n </ng-container>\r\n <div *ngIf=\"column.type === 'number'\">\r\n <a *ngIf=\"column.click\" href=\"javascript:;\" (click)=\"column.click(item[column.field], item)\">{{item[column.field]\r\n | columnTransform:item:column}}</a>\r\n <ng-container *ngIf=\"!column.click\">\r\n {{item[column.field] | columnTransform:item:column}}</ng-container>\r\n </div>\r\n <div *ngIf=\"column.type === 'date'\" matTooltipPosition=\"above\"\r\n [matTooltip]=\"item[column.field] | date:'dd/MM/yyyy'\">\r\n {{item[column.field] | sdTimeDifferent:'dd/MM/yyyy':column.option?.timeDifferent | async}}\r\n </div>\r\n <div *ngIf=\"column.type === 'datetime'\" matTooltipPosition=\"above\"\r\n [matTooltip]=\"item[column.field] | date:'dd/MM/yyyy HH:mm'\">\r\n {{item[column.field] | sdTimeDifferent:'dd/MM/yyyy HH:mm':column.option?.timeDifferent | async}}\r\n </div>\r\n <div *ngIf=\"column.type === 'time'\">\r\n {{item[column.field] | date:'HH:mm'}}\r\n </div>\r\n <div *ngIf=\"column.type === 'bool'\" class=\"align-middle text-center\">\r\n <ng-container *ngIf=\"!!badge\">\r\n <div *ngIf=\"!column.badgeType\" class=\"c-badge\" style=\"overflow-wrap: break-word;\" matTooltipPosition=\"above\"\r\n [matTooltip]=\"item[column.field] | columnTooltip:item:column\"\r\n [class]=\"{'c-secondary': badge === 'normal', 'c-info': badge === 'info', 'c-success': badge === 'success', 'c-danger': badge === 'danger', 'c-warning': badge === 'warning'}\">\r\n <span *ngIf=\"column.click\" class=\"pointer\"\r\n (click)=\"column.click(item[column.field], item)\">{{item[column.field] | columnTransform:item:column}}</span>\r\n <ng-container *ngIf=\"!column.click\">{{item[column.field] | columnTransform:item:column}}</ng-container>\r\n </div>\r\n <div *ngIf=\"column.badgeType === 'circle'\" style=\"min-width: 150px\"\r\n class=\"c-badge-circle d-flex align-items-center\"\r\n [class]=\"{'c-unknown': !badge, 'c-secondary': badge === 'normal', 'c-info': badge === 'info', 'c-success': badge === 'success', 'c-danger': badge === 'danger', 'c-warning': badge === 'warning'}\">\r\n <span *ngIf=\"badge\" class=\"material-icons-round c-material-icon mr-4\">\r\n fiber_manual_record\r\n </span>\r\n <span *ngIf=\"!badge\" class=\"material-icons-outlined c-material-icon mr-4\">\r\n fiber_manual_record\r\n </span>\r\n {{item[column.field] | columnTransform:item:column}}\r\n </div>\r\n </ng-container>\r\n <ng-container *ngIf=\"!badge\">\r\n <span *ngIf=\"item[column.field]\" class=\"font-weight-bold c-color-success\">{{item[column.field] |\r\n columnTransform:item:column}}</span>\r\n <span *ngIf=\"!item[column.field]\" class=\"font-weight-bold c-color-danger\">{{item[column.field] |\r\n columnTransform:item:column}}</span>\r\n </ng-container>\r\n </div>\r\n <div *ngIf=\"column.type === 'values'\">\r\n <ng-container *ngIf=\"column.transform\">{{item[column.field] | columnTransform:item:column}}</ng-container>\r\n <ng-container *ngIf=\"!column.transform\">\r\n <ng-container *ngIf=\"item[column.field] | columnValues:column:key | async; $implicit as valueData\">\r\n <div\r\n *ngIf=\"valueData[column.option?.colorField] || valueData[column.option?.backgroundColorField]; else elseNoStatus\"\r\n class=\"c-badge\"\r\n [ngStyle]=\"{'color':valueData[column.option?.colorField], 'background-color': valueData[column.option?.backgroundColorField]}\">\r\n {{valueData[column.option?.displayField]}}\r\n </div>\r\n <ng-template #elseNoStatus>\r\n <div class=\"text-left\">\r\n {{valueData[column.option?.displayField]}}\r\n </div>\r\n </ng-template>\r\n </ng-container>\r\n </ng-container>\r\n\r\n </div>\r\n <div *ngIf=\"column.type === 'image'\" class=\"align-middle text-center\">\r\n <img *ngIf=\"item[column.field]\" [src]=\"item[column.field] | columnTransform:item:column\"\r\n [width]=\"column.option?.width\" [height]=\"column.option?.height\" style=\"margin: 5px 0;object-fit: contain;\"\r\n (click)=\"column.click && column.click(item[column.field], item)\" [ngClass]=\"{'pointer':column.click}\">\r\n <mat-icon *ngIf=\"!item[column.field]\" class=\"c-img\" [ngClass]=\"{'pointer':column.click}\"\r\n (click)=\"column.click && column.click(item[column.field], item)\">image</mat-icon>\r\n </div>\r\n </ng-container>\r\n <sd-desktop-cell-children-view *ngIf=\"column.type === 'children'\" [key]=\"key\" [item]=\"item\" [column]=\"column\">\r\n </sd-desktop-cell-children-view>\r\n</ng-template>",
2854
+ changeDetection: core.ChangeDetectionStrategy.OnPush,
2725
2855
  styles: [".c-color-success{color:#4caf50}.c-color-danger{color:#f82c13}.c-img{font-size:30px;opacity:.5}.c-img.pointer:hover{opacity:.9}.c-badge{border-radius:20px;display:inline-block;margin-bottom:4px;padding:2px 12px;text-align:center}.c-badge.c-warning{background:#fff3e0;color:#ff9600}.c-badge.c-info{background:#e7e9ff;color:#2962ff}.c-badge.c-success{background:#e8f5e9;color:#4caf50}.c-badge.c-danger{background:#fee8e7;color:#f82c13}.c-badge.c-normal{background:rgba(0,0,0,.12);color:#000}.wes-status .c-material-icon{font-size:12px;height:12px;width:12px}.wes-status.text-secondary .c-material-icon{color:rgba(0,0,0,.5)}.c-badge-circle .c-material-icon{font-size:12px;height:12px;width:12px}.c-badge-circle.c-unknown{color:#212121}.c-badge-circle.c-unknown .c-material-icon{color:rgba(0,0,0,.5)}.c-badge-circle.c-secondary{color:#212121}.c-badge-circle.c-info{color:#2962ff}.c-badge-circle.c-success{color:#4caf50}.c-badge-circle.c-danger{color:#f82c13}.c-badge-circle.c-warning{color:#ff9600}"]
2726
2856
  },] }
2727
2857
  ];
@@ -3456,6 +3586,198 @@
3456
3586
  gridOption: [{ type: core.Input }]
3457
3587
  };
3458
3588
 
3589
+ var SdDesktopCell = /** @class */ (function () {
3590
+ function SdDesktopCell() {
3591
+ }
3592
+ return SdDesktopCell;
3593
+ }());
3594
+ SdDesktopCell.decorators = [
3595
+ { type: core.Component, args: [{
3596
+ selector: 'sd-desktop-cell',
3597
+ template: "<ng-container *ngIf=\"column && item\">\r\n <ng-container *ngIf=\"item.editorHandlerRow?.visible;else useView\">\r\n <ng-container *sdLet=\"item[column.field] | sdEditorHandlerColumn:item:column:gridOption\">\r\n <ng-container *ngIf=\"item.editorHandlerColumn[column.field]?.visible;else useView\">\r\n <sd-desktop-cell-editor [column]=\"column\" [item]=\"item\"></sd-desktop-cell-editor>\r\n </ng-container>\r\n </ng-container>\r\n </ng-container>\r\n <ng-template #useView>\r\n <sd-desktop-cell-view [key]=\"key\" [column]=\"column\" [item]=\"item\"></sd-desktop-cell-view>\r\n </ng-template>\r\n</ng-container>",
3598
+ changeDetection: core.ChangeDetectionStrategy.OnPush,
3599
+ styles: [".c-color-success{color:#4caf50}.c-color-danger{color:#f82c13}.c-img{font-size:30px;opacity:.5}.c-img.pointer:hover{opacity:.9}.c-badge{border-radius:20px;display:inline-block;margin-bottom:4px;padding:2px 12px;text-align:center}.c-badge.c-warning{background:#fff3e0;color:#ff9600}.c-badge.c-info{background:#e7e9ff;color:#2962ff}.c-badge.c-success{background:#e8f5e9;color:#4caf50}.c-badge.c-danger{background:#fee8e7;color:#f82c13}.c-badge.c-normal{background:rgba(0,0,0,.12);color:#000}.wes-status .c-material-icon{font-size:12px;height:12px;width:12px}.wes-status.text-secondary .c-material-icon{color:rgba(0,0,0,.5)}.c-badge-circle .c-material-icon{font-size:12px;height:12px;width:12px}.c-badge-circle.c-unknown{color:#212121}.c-badge-circle.c-unknown .c-material-icon{color:rgba(0,0,0,.5)}.c-badge-circle.c-secondary{color:#212121}.c-badge-circle.c-info{color:#2962ff}.c-badge-circle.c-success{color:#4caf50}.c-badge-circle.c-danger{color:#f82c13}.c-badge-circle.c-warning{color:#ff9600}"]
3600
+ },] }
3601
+ ];
3602
+ SdDesktopCell.ctorParameters = function () { return []; };
3603
+ SdDesktopCell.propDecorators = {
3604
+ key: [{ type: core.Input }],
3605
+ column: [{ type: core.Input }],
3606
+ item: [{ type: core.Input }],
3607
+ gridOption: [{ type: core.Input }]
3608
+ };
3609
+
3610
+ var SdDesktopCellEditor = /** @class */ (function () {
3611
+ function SdDesktopCellEditor() {
3612
+ var _this = this;
3613
+ this.onChange = function () {
3614
+ var _a, _b, _c;
3615
+ if (_this.column.type === 'children' || _this.column.type === 'children-col') {
3616
+ return;
3617
+ }
3618
+ (_c = (_b = (_a = _this.column) === null || _a === void 0 ? void 0 : _a.editor) === null || _b === void 0 ? void 0 : _b.change) === null || _c === void 0 ? void 0 : _c.call(_b, _this.item);
3619
+ };
3620
+ }
3621
+ return SdDesktopCellEditor;
3622
+ }());
3623
+ SdDesktopCellEditor.decorators = [
3624
+ { type: core.Component, args: [{
3625
+ selector: 'sd-desktop-cell-editor',
3626
+ template: "<sd-input *ngIf=\"column.type === 'string'\" size=\"sm\" type=\"text\" [(model)]=\"item[column.field]\" (sdChange)=\"onChange()\"\r\n [disabled]=\"column.filter?.disabled\">\r\n</sd-input>\r\n<sd-input *ngIf=\"column.type === 'number'\" size=\"sm\" type=\"number\" [(model)]=\"item[column.field]\"\r\n (sdChange)=\"onChange()\" [disabled]=\"column.filter?.disabled\">\r\n</sd-input>\r\n<sd-select *ngIf=\"column.type === 'bool'\" size=\"sm\" [items]=\"[\r\n { value: '1', display: column.option?.displayOnTrue || 'True' },\r\n { value: '0', display: column.option?.displayOnFalse || 'False' }\r\n ]\" valueField=\"value\" displayField=\"display\" [(model)]=\"item[column.field]\" (sdChange)=\"onChange()\"\r\n [disabled]=\"column.filter?.disabled\">\r\n</sd-select>\r\n<sd-select *ngIf=\"\r\n column.type === 'values' && column?.option?.selection !== 'AUTOCOMPLETE'\r\n \" size=\"sm\" [items]=\"column.option.items\" [valueField]=\"column.option.valueField\"\r\n [displayField]=\"column.option.displayField\" [(model)]=\"item[column.field]\" (sdChange)=\"onChange()\"\r\n [disabled]=\"column.filter?.disabled\" [multiple]=\"\r\n column?.option?.selection === 'MULTIPLE' ||\r\n column?.option?.selection === 'MULTIPLEAUTOCOMPLETE'\r\n \" [filtered]=\"column?.option?.selection === 'MULTIPLEAUTOCOMPLETE'\">\r\n</sd-select>\r\n<sd-autocomplete *ngIf=\"\r\n column.type === 'values' && column?.option?.selection === 'AUTOCOMPLETE'\r\n \" size=\"sm\" [items]=\"column.option.items\" [valueField]=\"column.option.valueField\"\r\n [displayField]=\"column.option.displayField\" [(model)]=\"item[column.field]\" (sdChange)=\"onChange()\"\r\n [disabled]=\"column.filter?.disabled\">\r\n</sd-autocomplete>\r\n<sd-date-time *ngIf=\"\r\n column.type === 'date' ||\r\n column.type === 'datetime' ||\r\n column.type === 'time'\r\n \" size=\"sm\" [(model)]=\"item[column.field]\" [type]=\"column.type\" (sdChange)=\"onChange()\"\r\n [disabled]=\"column.filter?.disabled\">\r\n</sd-date-time>",
3627
+ changeDetection: core.ChangeDetectionStrategy.OnPush,
3628
+ styles: [".c-color-success{color:#4caf50}.c-color-danger{color:#f82c13}.c-img{font-size:30px;opacity:.5}.c-img.pointer:hover{opacity:.9}.c-badge{border-radius:20px;display:inline-block;margin-bottom:4px;padding:2px 12px;text-align:center}.c-badge.c-warning{background:#fff3e0;color:#ff9600}.c-badge.c-info{background:#e7e9ff;color:#2962ff}.c-badge.c-success{background:#e8f5e9;color:#4caf50}.c-badge.c-danger{background:#fee8e7;color:#f82c13}.c-badge.c-normal{background:rgba(0,0,0,.12);color:#000}.wes-status .c-material-icon{font-size:12px;height:12px;width:12px}.wes-status.text-secondary .c-material-icon{color:rgba(0,0,0,.5)}.c-badge-circle .c-material-icon{font-size:12px;height:12px;width:12px}.c-badge-circle.c-unknown{color:#212121}.c-badge-circle.c-unknown .c-material-icon{color:rgba(0,0,0,.5)}.c-badge-circle.c-secondary{color:#212121}.c-badge-circle.c-info{color:#2962ff}.c-badge-circle.c-success{color:#4caf50}.c-badge-circle.c-danger{color:#f82c13}.c-badge-circle.c-warning{color:#ff9600}"]
3629
+ },] }
3630
+ ];
3631
+ SdDesktopCellEditor.ctorParameters = function () { return []; };
3632
+ SdDesktopCellEditor.propDecorators = {
3633
+ column: [{ type: core.Input }],
3634
+ item: [{ type: core.Input }]
3635
+ };
3636
+
3637
+ var SdEditorHandlerRowPipe = /** @class */ (function () {
3638
+ function SdEditorHandlerRowPipe() {
3639
+ }
3640
+ SdEditorHandlerRowPipe.prototype.transform = function (item, gridOption) {
3641
+ var editor = gridOption.editor;
3642
+ if (!editor) {
3643
+ return {
3644
+ visible: false
3645
+ };
3646
+ }
3647
+ var isDisabled = false;
3648
+ if (typeof (editor === null || editor === void 0 ? void 0 : editor.disabled) === 'function') {
3649
+ isDisabled = editor.disabled(item);
3650
+ }
3651
+ else {
3652
+ isDisabled = editor === null || editor === void 0 ? void 0 : editor.disabled;
3653
+ }
3654
+ if (editor.type === 'inline') {
3655
+ var removable = editor.removable;
3656
+ if (typeof (removable) === 'function') {
3657
+ item.editorHandlerRow = Object.assign(Object.assign({}, item.editorHandlerRow), { visible: !isDisabled, removable: removable(item), isInline: true });
3658
+ return item.editorHandlerRow;
3659
+ }
3660
+ item.editorHandlerRow = Object.assign(Object.assign({}, item.editorHandlerRow), { visible: !isDisabled, removable: removable, isInline: true });
3661
+ return item.editorHandlerRow;
3662
+ }
3663
+ var editable = editor.editable;
3664
+ if (typeof (editable) === 'function') {
3665
+ item.editorHandlerRow = Object.assign(Object.assign({}, item.editorHandlerRow), { visible: !isDisabled, editable: editable(item), isInline: false });
3666
+ return item.editorHandlerRow;
3667
+ }
3668
+ item.editorHandlerRow = Object.assign(Object.assign({}, item.editorHandlerRow), { visible: !isDisabled, editable: editable, isInline: false });
3669
+ return item.editorHandlerRow;
3670
+ };
3671
+ return SdEditorHandlerRowPipe;
3672
+ }());
3673
+ SdEditorHandlerRowPipe.decorators = [
3674
+ { type: core.Pipe, args: [{
3675
+ name: 'sdEditorHandlerRow'
3676
+ },] }
3677
+ ];
3678
+
3679
+ var SdEditorHandlerColumnPipe = /** @class */ (function () {
3680
+ function SdEditorHandlerColumnPipe() {
3681
+ }
3682
+ SdEditorHandlerColumnPipe.prototype.transform = function (value, item, column, gridOption) {
3683
+ var e_1, _c;
3684
+ if (column.type === 'children' || column.type === 'children-col') {
3685
+ return true;
3686
+ }
3687
+ var editor = gridOption.editor;
3688
+ var visible = function (col) {
3689
+ var _a;
3690
+ if (col.type === 'children' || col.type === 'children-col') {
3691
+ return false;
3692
+ }
3693
+ var isDisabled = false;
3694
+ // Kiểm tra xem có bị disabled hay không?
3695
+ if (col.editor) {
3696
+ isDisabled = typeof (col.editor.disabled) === 'function' ? col.editor.disabled(item) : col.editor.disabled;
3697
+ }
3698
+ // Nếu bị disabled return false
3699
+ if (isDisabled) {
3700
+ return false;
3701
+ }
3702
+ if (editor.type !== 'inline') {
3703
+ return !!((_a = item.editorHandlerRow) === null || _a === void 0 ? void 0 : _a.status);
3704
+ }
3705
+ return true;
3706
+ };
3707
+ item.editorHandlerColumn = item.editorHandlerColumn || {};
3708
+ try {
3709
+ for (var _d = __values(gridOption.columns.filter(function (e) { var _a, _b; return (_b = (_a = column.editor) === null || _a === void 0 ? void 0 : _a.relatedColumns) === null || _b === void 0 ? void 0 : _b.includes(e.field); })), _e = _d.next(); !_e.done; _e = _d.next()) {
3710
+ var col = _e.value;
3711
+ item.editorHandlerColumn[col.field] = Object.assign(Object.assign({}, item.editorHandlerColumn[col.field]), { visible: visible(col) });
3712
+ }
3713
+ }
3714
+ catch (e_1_1) { e_1 = { error: e_1_1 }; }
3715
+ finally {
3716
+ try {
3717
+ if (_e && !_e.done && (_c = _d.return)) _c.call(_d);
3718
+ }
3719
+ finally { if (e_1) throw e_1.error; }
3720
+ }
3721
+ return true;
3722
+ };
3723
+ return SdEditorHandlerColumnPipe;
3724
+ }());
3725
+ SdEditorHandlerColumnPipe.decorators = [
3726
+ { type: core.Pipe, args: [{
3727
+ name: 'sdEditorHandlerColumn'
3728
+ },] }
3729
+ ];
3730
+
3731
+ var SdEditorValidatePipe = /** @class */ (function () {
3732
+ function SdEditorValidatePipe() {
3733
+ this.delay = 1000; // Sau khoảng thời gian delay nếu không có thay đổi thì thì mới bắt đầu thực hiện validate
3734
+ }
3735
+ SdEditorValidatePipe.prototype.transform = function (value, item, validate) {
3736
+ var _a;
3737
+ return __awaiter(this, void 0, void 0, function () {
3738
+ var now, dif, result, _b;
3739
+ var _this = this;
3740
+ return __generator(this, function (_c) {
3741
+ switch (_c.label) {
3742
+ case 0:
3743
+ if (!((_a = item.editorHandlerRow) === null || _a === void 0 ? void 0 : _a.visible)) {
3744
+ return [2 /*return*/, true];
3745
+ }
3746
+ this.previous = new Date();
3747
+ return [4 /*yield*/, new Promise(function (resolve) { return setTimeout(resolve, _this.delay); })];
3748
+ case 1:
3749
+ _c.sent();
3750
+ now = new Date();
3751
+ dif = now.getTime() - this.previous.getTime();
3752
+ if (dif < this.delay) {
3753
+ return [2 /*return*/, true];
3754
+ }
3755
+ if (!validate) {
3756
+ item.editorHandlerRow.errorMessage = null;
3757
+ return [2 /*return*/, true];
3758
+ }
3759
+ result = validate(item);
3760
+ if (!(result instanceof Promise)) return [3 /*break*/, 3];
3761
+ _b = item.editorHandlerRow;
3762
+ return [4 /*yield*/, result];
3763
+ case 2:
3764
+ _b.errorMessage = _c.sent();
3765
+ return [2 /*return*/, true];
3766
+ case 3:
3767
+ item.editorHandlerRow.errorMessage = result;
3768
+ return [2 /*return*/, true];
3769
+ }
3770
+ });
3771
+ });
3772
+ };
3773
+ return SdEditorValidatePipe;
3774
+ }());
3775
+ SdEditorValidatePipe.decorators = [
3776
+ { type: core.Pipe, args: [{
3777
+ name: 'sdEditorValidate'
3778
+ },] }
3779
+ ];
3780
+
3459
3781
  var MatPaginatorIntlCro = /** @class */ (function (_super) {
3460
3782
  __extends(MatPaginatorIntlCro, _super);
3461
3783
  function MatPaginatorIntlCro() {
@@ -3514,6 +3836,8 @@
3514
3836
  slider.MatSliderModule
3515
3837
  ],
3516
3838
  declarations: [
3839
+ SdDesktopCell,
3840
+ SdDesktopCellEditor,
3517
3841
  SdDesktopCellView,
3518
3842
  SdDesktopCellChildrenView,
3519
3843
  SdDesktopCommand,
@@ -3546,7 +3870,10 @@
3546
3870
  SdFilterExternalPipe,
3547
3871
  SdSelectionActionFilterPipe,
3548
3872
  SdSelectionDisablePipe,
3549
- SdSelectionDisableSelectAllPipe
3873
+ SdSelectionDisableSelectAllPipe,
3874
+ SdEditorHandlerRowPipe,
3875
+ SdEditorHandlerColumnPipe,
3876
+ SdEditorValidatePipe
3550
3877
  ],
3551
3878
  exports: [
3552
3879
  SdGridMaterial,
@@ -3588,36 +3915,41 @@
3588
3915
  exports.SdMaterialSubInformationDefDirective = SdMaterialSubInformationDefDirective;
3589
3916
  exports.ɵa = MatPaginatorIntlCro;
3590
3917
  exports.ɵb = SdGridFilter;
3591
- exports.ɵba = SdColumnTooltipPipe;
3592
- exports.ɵbb = SdColumnBadgePipe;
3593
- exports.ɵbc = SdFilterColumnPipe;
3594
- exports.ɵbd = SdFilterExternalPipe;
3595
- exports.ɵbe = SdSelectionActionFilterPipe;
3596
- exports.ɵbf = SdSelectionDisablePipe;
3597
- exports.ɵbg = SdSelectionDisableSelectAllPipe;
3918
+ exports.ɵba = SdColumnHtmlTemplatePipe;
3919
+ exports.ɵbb = SdColumnTransformPipe;
3920
+ exports.ɵbc = SdColumnTooltipPipe;
3921
+ exports.ɵbd = SdColumnBadgePipe;
3922
+ exports.ɵbe = SdFilterColumnPipe;
3923
+ exports.ɵbf = SdFilterExternalPipe;
3924
+ exports.ɵbg = SdSelectionActionFilterPipe;
3925
+ exports.ɵbh = SdSelectionDisablePipe;
3926
+ exports.ɵbi = SdSelectionDisableSelectAllPipe;
3927
+ exports.ɵbj = SdEditorHandlerRowPipe;
3928
+ exports.ɵbk = SdEditorHandlerColumnPipe;
3929
+ exports.ɵbl = SdEditorValidatePipe;
3598
3930
  exports.ɵc = SdPopupFilter;
3599
3931
  exports.ɵd = SdGridFilterService;
3600
3932
  exports.ɵe = SdPopupExport;
3601
3933
  exports.ɵg = GRID_MATERIAL_CONFIG;
3602
3934
  exports.ɵh = SdGridConfigurationService;
3603
3935
  exports.ɵi = SdGridService;
3604
- exports.ɵj = SdDesktopCellView;
3605
- exports.ɵk = SdDesktopCellChildrenView;
3606
- exports.ɵl = SdDesktopCommand;
3607
- exports.ɵm = SdLetDirective;
3608
- exports.ɵn = SdPopupGridConfiguration;
3609
- exports.ɵo = SdDynamicColumn;
3610
- exports.ɵp = SdGeneratedColumnService;
3611
- exports.ɵq = SdGridConfigurationResultPipe;
3612
- exports.ɵr = SdColumnChildrenFilterPipe;
3613
- exports.ɵs = SdColumnTitlePipe;
3614
- exports.ɵt = SdCommandFilterPipe;
3615
- exports.ɵu = SdCommandDisablePipe;
3616
- exports.ɵv = SdCommandIconPipe;
3617
- exports.ɵw = SdCommandTitlePipe;
3618
- exports.ɵx = SdColumnValuesPipe;
3619
- exports.ɵy = SdColumnHtmlTemplatePipe;
3620
- exports.ɵz = SdColumnTransformPipe;
3936
+ exports.ɵj = SdDesktopCell;
3937
+ exports.ɵk = SdDesktopCellEditor;
3938
+ exports.ɵl = SdDesktopCellView;
3939
+ exports.ɵm = SdDesktopCellChildrenView;
3940
+ exports.ɵn = SdDesktopCommand;
3941
+ exports.ɵo = SdLetDirective;
3942
+ exports.ɵp = SdPopupGridConfiguration;
3943
+ exports.ɵq = SdDynamicColumn;
3944
+ exports.ɵr = SdGeneratedColumnService;
3945
+ exports.ɵs = SdGridConfigurationResultPipe;
3946
+ exports.ɵt = SdColumnChildrenFilterPipe;
3947
+ exports.ɵu = SdColumnTitlePipe;
3948
+ exports.ɵv = SdCommandFilterPipe;
3949
+ exports.ɵw = SdCommandDisablePipe;
3950
+ exports.ɵx = SdCommandIconPipe;
3951
+ exports.ɵy = SdCommandTitlePipe;
3952
+ exports.ɵz = SdColumnValuesPipe;
3621
3953
 
3622
3954
  Object.defineProperty(exports, '__esModule', { value: true });
3623
3955