@sd-angular/core 0.0.916 → 0.0.920

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 (42) hide show
  1. package/bundles/sd-angular-core-grid-material.umd.js +384 -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/bundles/sd-angular-core-select.umd.js +1 -1
  6. package/bundles/sd-angular-core-select.umd.js.map +1 -1
  7. package/bundles/sd-angular-core-select.umd.min.js +1 -1
  8. package/bundles/sd-angular-core-select.umd.min.js.map +1 -1
  9. package/esm2015/grid-material/sd-angular-core-grid-material.js +30 -25
  10. package/esm2015/grid-material/src/lib/components/desktop-cell/desktop-cell.component.js +20 -0
  11. package/esm2015/grid-material/src/lib/components/desktop-cell-editor/desktop-cell-editor.component.js +26 -0
  12. package/esm2015/grid-material/src/lib/components/desktop-cell-view/desktop-cell-view.component.js +4 -3
  13. package/esm2015/grid-material/src/lib/grid-material.component.js +115 -4
  14. package/esm2015/grid-material/src/lib/grid-material.module.js +12 -2
  15. package/esm2015/grid-material/src/lib/models/grid-column.model.js +1 -1
  16. package/esm2015/grid-material/src/lib/models/grid-editor.model.js +2 -0
  17. package/esm2015/grid-material/src/lib/models/grid-option.model.js +1 -1
  18. package/esm2015/grid-material/src/lib/models/grid.model.js +1 -1
  19. package/esm2015/grid-material/src/lib/pipes/editor-handler-column.pipe.js +39 -0
  20. package/esm2015/grid-material/src/lib/pipes/editor-handler-row.pipe.js +40 -0
  21. package/esm2015/grid-material/src/lib/pipes/editor-validate.pipe.js +41 -0
  22. package/esm2015/grid-material/src/lib/services/grid-configuration.service.js +13 -7
  23. package/esm2015/select/src/lib/select.component.js +2 -2
  24. package/fesm2015/sd-angular-core-grid-material.js +296 -13
  25. package/fesm2015/sd-angular-core-grid-material.js.map +1 -1
  26. package/fesm2015/sd-angular-core-select.js +1 -1
  27. package/fesm2015/sd-angular-core-select.js.map +1 -1
  28. package/grid-material/sd-angular-core-grid-material.d.ts +29 -24
  29. package/grid-material/sd-angular-core-grid-material.metadata.json +1 -1
  30. package/grid-material/src/lib/components/desktop-cell/desktop-cell.component.d.ts +9 -0
  31. package/grid-material/src/lib/components/desktop-cell-editor/desktop-cell-editor.component.d.ts +7 -0
  32. package/grid-material/src/lib/grid-material.component.d.ts +5 -0
  33. package/grid-material/src/lib/models/grid-column.model.d.ts +47 -0
  34. package/grid-material/src/lib/models/grid-editor.model.d.ts +22 -0
  35. package/grid-material/src/lib/models/grid-option.model.d.ts +2 -10
  36. package/grid-material/src/lib/models/grid.model.d.ts +46 -1
  37. package/grid-material/src/lib/pipes/editor-handler-column.pipe.d.ts +7 -0
  38. package/grid-material/src/lib/pipes/editor-handler-row.pipe.d.ts +6 -0
  39. package/grid-material/src/lib/pipes/editor-validate.pipe.d.ts +7 -0
  40. package/package.json +1 -1
  41. package/{sd-angular-core-0.0.916.tgz → sd-angular-core-0.0.920.tgz} +0 -0
  42. package/select/sd-angular-core-select.metadata.json +1 -1
@@ -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 (commands === null || commands === void 0 ? void 0 : commands.length) {
1485
1487
  result.firstHeaders.push(__classPrivateFieldGet(_this, _COLUMNS).COMMAND);
1486
1488
  result.displayedColumns.push(__classPrivateFieldGet(_this, _COLUMNS).COMMAND);
1487
1489
  }
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;
1490
+ if (editor.addable || (editor.type === 'inline' && editor.removable) || (editor.type !== 'inline' && editor.editable)) {
1491
+ result.firstHeaders.push(__classPrivateFieldGet(_this, _COLUMNS).EDITOR);
1492
+ result.displayedColumns.push(__classPrivateFieldGet(_this, _COLUMNS).EDITOR);
1493
+ }
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,130 @@
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.status = isModified ? 'update' : 'create';
2404
+ item.editorHandlerRow.temporary = Object.assign({}, item);
2405
+ // this.generateEditorHanlder(item);
2406
+ if (editor.type === 'popup') {
2407
+ // Xử lý case popup
2408
+ // this.sdGridPopupEditor.open(item, columns, isModified);
2409
+ }
2410
+ _this.ref.detectChanges();
2411
+ };
2412
+ this.onSave = function (item) { return __awaiter(_this, void 0, void 0, function () {
2413
+ var editor, result, message, result, err_1;
2414
+ return __generator(this, function (_t) {
2415
+ switch (_t.label) {
2416
+ case 0:
2417
+ editor = this.gridOption.editor;
2418
+ _t.label = 1;
2419
+ case 1:
2420
+ _t.trys.push([1, 7, 8, 9]);
2421
+ item.editorHandlerRow.saving = true;
2422
+ if (!editor.validate) return [3 /*break*/, 4];
2423
+ result = editor.validate(item);
2424
+ if (!(result instanceof Promise)) return [3 /*break*/, 3];
2425
+ return [4 /*yield*/, result];
2426
+ case 2:
2427
+ message = _t.sent();
2428
+ if (message) {
2429
+ throw message;
2430
+ }
2431
+ return [3 /*break*/, 4];
2432
+ case 3:
2433
+ if (result) {
2434
+ throw result;
2435
+ }
2436
+ _t.label = 4;
2437
+ case 4:
2438
+ if (!editor.onSave) return [3 /*break*/, 6];
2439
+ result = editor.onSave(item);
2440
+ if (!(result instanceof Promise)) return [3 /*break*/, 6];
2441
+ return [4 /*yield*/, result];
2442
+ case 5:
2443
+ _t.sent();
2444
+ _t.label = 6;
2445
+ case 6:
2446
+ if (item.editorHandlerRow.status === 'create' && editor.type === 'popup') {
2447
+ if (this.gridOption.type === 'local') {
2448
+ this.items.splice(0, 0, item);
2449
+ }
2450
+ // this.viewItems.splice(0, 0, item);
2451
+ }
2452
+ item.editorHandlerRow.status = undefined;
2453
+ return [3 /*break*/, 9];
2454
+ case 7:
2455
+ err_1 = _t.sent();
2456
+ this.notifyService.notify.warning(err_1);
2457
+ return [3 /*break*/, 9];
2458
+ case 8:
2459
+ item.editorHandlerRow.saving = false;
2460
+ this.ref.detectChanges();
2461
+ return [7 /*endfinally*/];
2462
+ case 9: return [2 /*return*/];
2463
+ }
2464
+ });
2465
+ }); };
2466
+ this.onCancel = function (item) {
2467
+ var editor = _this.gridOption.editor;
2468
+ if (editor.type === 'inline') {
2469
+ if (_this.gridOption.type === 'local') {
2470
+ var idx1 = _this.items.indexOf(item);
2471
+ _this.items.splice(idx1, 1);
2472
+ }
2473
+ // const idx2 = this.viewItems.indexOf(item);
2474
+ // this.viewItems.splice(idx2, 1);
2475
+ return;
2476
+ }
2477
+ if (item.editorHandlerRow.status === 'create') {
2478
+ if (editor.type !== 'popup') {
2479
+ if (_this.gridOption.type === 'local') {
2480
+ _this.items.splice(0, 1);
2481
+ }
2482
+ // this.viewItems.splice(0, 1);
2483
+ }
2484
+ }
2485
+ else {
2486
+ Object.assign(item, item.editorHandlerRow.temporary);
2487
+ item.editorHandlerRow.status = undefined;
2488
+ // this.generateEditorHanlder(item);
2489
+ _this.ref.detectChanges();
2490
+ }
2491
+ };
2362
2492
  }
2363
2493
  Object.defineProperty(SdGridMaterial.prototype, "_gridFilter", {
2364
2494
  set: function (gridFilter) {
@@ -2434,11 +2564,11 @@
2434
2564
  };
2435
2565
  return SdGridMaterial;
2436
2566
  }());
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();
2567
+ _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
2568
  SdGridMaterial.decorators = [
2439
2569
  { type: core.Component, args: [{
2440
2570
  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",
2571
+ 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)\" 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
2572
  animations: [
2443
2573
  animations.trigger('detailExpand', [
2444
2574
  animations.state('collapsed', animations.style({ height: '0', minHeight: '0', visibility: 'hidden' })),
@@ -2721,7 +2851,8 @@
2721
2851
  SdDesktopCellView.decorators = [
2722
2852
  { type: core.Component, args: [{
2723
2853
  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>",
2854
+ 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>",
2855
+ changeDetection: core.ChangeDetectionStrategy.OnPush,
2725
2856
  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
2857
  },] }
2727
2858
  ];
@@ -3456,6 +3587,198 @@
3456
3587
  gridOption: [{ type: core.Input }]
3457
3588
  };
3458
3589
 
3590
+ var SdDesktopCell = /** @class */ (function () {
3591
+ function SdDesktopCell() {
3592
+ }
3593
+ return SdDesktopCell;
3594
+ }());
3595
+ SdDesktopCell.decorators = [
3596
+ { type: core.Component, args: [{
3597
+ selector: 'sd-desktop-cell',
3598
+ 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>",
3599
+ changeDetection: core.ChangeDetectionStrategy.OnPush,
3600
+ 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}"]
3601
+ },] }
3602
+ ];
3603
+ SdDesktopCell.ctorParameters = function () { return []; };
3604
+ SdDesktopCell.propDecorators = {
3605
+ key: [{ type: core.Input }],
3606
+ column: [{ type: core.Input }],
3607
+ item: [{ type: core.Input }],
3608
+ gridOption: [{ type: core.Input }]
3609
+ };
3610
+
3611
+ var SdDesktopCellEditor = /** @class */ (function () {
3612
+ function SdDesktopCellEditor() {
3613
+ var _this = this;
3614
+ this.onChange = function () {
3615
+ var _a, _b, _c;
3616
+ if (_this.column.type === 'children' || _this.column.type === 'children-col') {
3617
+ return;
3618
+ }
3619
+ (_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);
3620
+ };
3621
+ }
3622
+ return SdDesktopCellEditor;
3623
+ }());
3624
+ SdDesktopCellEditor.decorators = [
3625
+ { type: core.Component, args: [{
3626
+ selector: 'sd-desktop-cell-editor',
3627
+ 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>",
3628
+ changeDetection: core.ChangeDetectionStrategy.OnPush,
3629
+ 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}"]
3630
+ },] }
3631
+ ];
3632
+ SdDesktopCellEditor.ctorParameters = function () { return []; };
3633
+ SdDesktopCellEditor.propDecorators = {
3634
+ column: [{ type: core.Input }],
3635
+ item: [{ type: core.Input }]
3636
+ };
3637
+
3638
+ var SdEditorHandlerRowPipe = /** @class */ (function () {
3639
+ function SdEditorHandlerRowPipe() {
3640
+ }
3641
+ SdEditorHandlerRowPipe.prototype.transform = function (item, gridOption) {
3642
+ var editor = gridOption.editor;
3643
+ if (!editor) {
3644
+ return {
3645
+ visible: false
3646
+ };
3647
+ }
3648
+ var isDisabled = false;
3649
+ if (typeof (editor === null || editor === void 0 ? void 0 : editor.disabled) === 'function') {
3650
+ isDisabled = editor.disabled(item);
3651
+ }
3652
+ else {
3653
+ isDisabled = editor === null || editor === void 0 ? void 0 : editor.disabled;
3654
+ }
3655
+ if (editor.type === 'inline') {
3656
+ var removable = editor.removable;
3657
+ if (typeof (removable) === 'function') {
3658
+ item.editorHandlerRow = Object.assign(Object.assign({}, item.editorHandlerRow), { visible: !isDisabled, removable: removable(item), isInline: true });
3659
+ return item.editorHandlerRow;
3660
+ }
3661
+ item.editorHandlerRow = Object.assign(Object.assign({}, item.editorHandlerRow), { visible: !isDisabled, removable: removable, isInline: true });
3662
+ return item.editorHandlerRow;
3663
+ }
3664
+ var editable = editor.editable;
3665
+ if (typeof (editable) === 'function') {
3666
+ item.editorHandlerRow = Object.assign(Object.assign({}, item.editorHandlerRow), { visible: !isDisabled, editable: editable(item), isInline: false });
3667
+ return item.editorHandlerRow;
3668
+ }
3669
+ item.editorHandlerRow = Object.assign(Object.assign({}, item.editorHandlerRow), { visible: !isDisabled, editable: editable, isInline: false });
3670
+ return item.editorHandlerRow;
3671
+ };
3672
+ return SdEditorHandlerRowPipe;
3673
+ }());
3674
+ SdEditorHandlerRowPipe.decorators = [
3675
+ { type: core.Pipe, args: [{
3676
+ name: 'sdEditorHandlerRow'
3677
+ },] }
3678
+ ];
3679
+
3680
+ var SdEditorHandlerColumnPipe = /** @class */ (function () {
3681
+ function SdEditorHandlerColumnPipe() {
3682
+ }
3683
+ SdEditorHandlerColumnPipe.prototype.transform = function (value, item, column, gridOption) {
3684
+ var e_1, _c;
3685
+ if (column.type === 'children' || column.type === 'children-col') {
3686
+ return true;
3687
+ }
3688
+ var editor = gridOption.editor;
3689
+ var visible = function (col) {
3690
+ var _a;
3691
+ if (col.type === 'children' || col.type === 'children-col') {
3692
+ return false;
3693
+ }
3694
+ var isDisabled = false;
3695
+ // Kiểm tra xem có bị disabled hay không?
3696
+ if (col.editor) {
3697
+ isDisabled = typeof (col.editor.disabled) === 'function' ? col.editor.disabled(item) : col.editor.disabled;
3698
+ }
3699
+ // Nếu bị disabled return false
3700
+ if (isDisabled) {
3701
+ return false;
3702
+ }
3703
+ if (editor.type !== 'inline') {
3704
+ return !!((_a = item.editorHandlerRow) === null || _a === void 0 ? void 0 : _a.status);
3705
+ }
3706
+ return true;
3707
+ };
3708
+ item.editorHandlerColumn = item.editorHandlerColumn || {};
3709
+ try {
3710
+ 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()) {
3711
+ var col = _e.value;
3712
+ item.editorHandlerColumn[col.field] = Object.assign(Object.assign({}, item.editorHandlerColumn[col.field]), { visible: visible(col) });
3713
+ }
3714
+ }
3715
+ catch (e_1_1) { e_1 = { error: e_1_1 }; }
3716
+ finally {
3717
+ try {
3718
+ if (_e && !_e.done && (_c = _d.return)) _c.call(_d);
3719
+ }
3720
+ finally { if (e_1) throw e_1.error; }
3721
+ }
3722
+ return true;
3723
+ };
3724
+ return SdEditorHandlerColumnPipe;
3725
+ }());
3726
+ SdEditorHandlerColumnPipe.decorators = [
3727
+ { type: core.Pipe, args: [{
3728
+ name: 'sdEditorHandlerColumn'
3729
+ },] }
3730
+ ];
3731
+
3732
+ var SdEditorValidatePipe = /** @class */ (function () {
3733
+ function SdEditorValidatePipe() {
3734
+ 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
3735
+ }
3736
+ SdEditorValidatePipe.prototype.transform = function (value, item, validate) {
3737
+ var _a;
3738
+ return __awaiter(this, void 0, void 0, function () {
3739
+ var now, dif, result, _b;
3740
+ var _this = this;
3741
+ return __generator(this, function (_c) {
3742
+ switch (_c.label) {
3743
+ case 0:
3744
+ if (!((_a = item.editorHandlerRow) === null || _a === void 0 ? void 0 : _a.visible)) {
3745
+ return [2 /*return*/, true];
3746
+ }
3747
+ this.previous = new Date();
3748
+ return [4 /*yield*/, new Promise(function (resolve) { return setTimeout(resolve, _this.delay); })];
3749
+ case 1:
3750
+ _c.sent();
3751
+ now = new Date();
3752
+ dif = now.getTime() - this.previous.getTime();
3753
+ if (dif < this.delay) {
3754
+ return [2 /*return*/, true];
3755
+ }
3756
+ if (!validate) {
3757
+ item.editorHandlerRow.errorMessage = null;
3758
+ return [2 /*return*/, true];
3759
+ }
3760
+ result = validate(item);
3761
+ if (!(result instanceof Promise)) return [3 /*break*/, 3];
3762
+ _b = item.editorHandlerRow;
3763
+ return [4 /*yield*/, result];
3764
+ case 2:
3765
+ _b.errorMessage = _c.sent();
3766
+ return [2 /*return*/, true];
3767
+ case 3:
3768
+ item.editorHandlerRow.errorMessage = result;
3769
+ return [2 /*return*/, true];
3770
+ }
3771
+ });
3772
+ });
3773
+ };
3774
+ return SdEditorValidatePipe;
3775
+ }());
3776
+ SdEditorValidatePipe.decorators = [
3777
+ { type: core.Pipe, args: [{
3778
+ name: 'sdEditorValidate'
3779
+ },] }
3780
+ ];
3781
+
3459
3782
  var MatPaginatorIntlCro = /** @class */ (function (_super) {
3460
3783
  __extends(MatPaginatorIntlCro, _super);
3461
3784
  function MatPaginatorIntlCro() {
@@ -3514,6 +3837,8 @@
3514
3837
  slider.MatSliderModule
3515
3838
  ],
3516
3839
  declarations: [
3840
+ SdDesktopCell,
3841
+ SdDesktopCellEditor,
3517
3842
  SdDesktopCellView,
3518
3843
  SdDesktopCellChildrenView,
3519
3844
  SdDesktopCommand,
@@ -3546,7 +3871,10 @@
3546
3871
  SdFilterExternalPipe,
3547
3872
  SdSelectionActionFilterPipe,
3548
3873
  SdSelectionDisablePipe,
3549
- SdSelectionDisableSelectAllPipe
3874
+ SdSelectionDisableSelectAllPipe,
3875
+ SdEditorHandlerRowPipe,
3876
+ SdEditorHandlerColumnPipe,
3877
+ SdEditorValidatePipe
3550
3878
  ],
3551
3879
  exports: [
3552
3880
  SdGridMaterial,
@@ -3588,36 +3916,41 @@
3588
3916
  exports.SdMaterialSubInformationDefDirective = SdMaterialSubInformationDefDirective;
3589
3917
  exports.ɵa = MatPaginatorIntlCro;
3590
3918
  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;
3919
+ exports.ɵba = SdColumnHtmlTemplatePipe;
3920
+ exports.ɵbb = SdColumnTransformPipe;
3921
+ exports.ɵbc = SdColumnTooltipPipe;
3922
+ exports.ɵbd = SdColumnBadgePipe;
3923
+ exports.ɵbe = SdFilterColumnPipe;
3924
+ exports.ɵbf = SdFilterExternalPipe;
3925
+ exports.ɵbg = SdSelectionActionFilterPipe;
3926
+ exports.ɵbh = SdSelectionDisablePipe;
3927
+ exports.ɵbi = SdSelectionDisableSelectAllPipe;
3928
+ exports.ɵbj = SdEditorHandlerRowPipe;
3929
+ exports.ɵbk = SdEditorHandlerColumnPipe;
3930
+ exports.ɵbl = SdEditorValidatePipe;
3598
3931
  exports.ɵc = SdPopupFilter;
3599
3932
  exports.ɵd = SdGridFilterService;
3600
3933
  exports.ɵe = SdPopupExport;
3601
3934
  exports.ɵg = GRID_MATERIAL_CONFIG;
3602
3935
  exports.ɵh = SdGridConfigurationService;
3603
3936
  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;
3937
+ exports.ɵj = SdDesktopCell;
3938
+ exports.ɵk = SdDesktopCellEditor;
3939
+ exports.ɵl = SdDesktopCellView;
3940
+ exports.ɵm = SdDesktopCellChildrenView;
3941
+ exports.ɵn = SdDesktopCommand;
3942
+ exports.ɵo = SdLetDirective;
3943
+ exports.ɵp = SdPopupGridConfiguration;
3944
+ exports.ɵq = SdDynamicColumn;
3945
+ exports.ɵr = SdGeneratedColumnService;
3946
+ exports.ɵs = SdGridConfigurationResultPipe;
3947
+ exports.ɵt = SdColumnChildrenFilterPipe;
3948
+ exports.ɵu = SdColumnTitlePipe;
3949
+ exports.ɵv = SdCommandFilterPipe;
3950
+ exports.ɵw = SdCommandDisablePipe;
3951
+ exports.ɵx = SdCommandIconPipe;
3952
+ exports.ɵy = SdCommandTitlePipe;
3953
+ exports.ɵz = SdColumnValuesPipe;
3621
3954
 
3622
3955
  Object.defineProperty(exports, '__esModule', { value: true });
3623
3956