@sd-angular/core 1.3.29 → 1.3.31
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundles/sd-angular-core-common.umd.js.map +1 -1
- package/bundles/sd-angular-core-common.umd.min.js.map +1 -1
- package/bundles/sd-angular-core-export.umd.js +38 -44
- package/bundles/sd-angular-core-export.umd.js.map +1 -1
- package/bundles/sd-angular-core-export.umd.min.js +1 -1
- package/bundles/sd-angular-core-export.umd.min.js.map +1 -1
- package/bundles/sd-angular-core-grid.umd.js +50 -187
- package/bundles/sd-angular-core-grid.umd.js.map +1 -1
- package/bundles/sd-angular-core-grid.umd.min.js +1 -1
- package/bundles/sd-angular-core-grid.umd.min.js.map +1 -1
- package/bundles/sd-angular-core-upload-excel.umd.js.map +1 -1
- package/bundles/sd-angular-core-upload-excel.umd.min.js.map +1 -1
- package/bundles/sd-angular-core.umd.js +4 -4
- package/bundles/sd-angular-core.umd.min.js +1 -1
- package/bundles/sd-angular-core.umd.min.js.map +1 -1
- package/common/sd-angular-core-common.metadata.json +1 -1
- package/common/src/lib/configurations/firebase.configuration.d.ts +1 -0
- package/esm2015/common/src/lib/configurations/firebase.configuration.js +1 -1
- package/esm2015/export/src/lib/export.model.js +1 -3
- package/esm2015/export/src/lib/export.service.js +25 -34
- package/esm2015/grid/src/lib/components/grid-popup-export-excel/grid-popup-export-excel.component.js +35 -27
- package/esm2015/grid/src/lib/components/grid-popup-export-excel/grid-popup-export-excel.model.js +1 -1
- package/esm2015/grid/src/lib/grid.component.js +11 -118
- package/esm2015/public-api.js +1 -3
- package/esm2015/upload-excel/src/lib/upload-excel.component.js +1 -1
- package/export/sd-angular-core-export.metadata.json +1 -1
- package/export/src/lib/export.model.d.ts +0 -15
- package/export/src/lib/export.service.d.ts +6 -4
- package/fesm2015/sd-angular-core-common.js.map +1 -1
- package/fesm2015/sd-angular-core-export.js +25 -35
- package/fesm2015/sd-angular-core-export.js.map +1 -1
- package/fesm2015/sd-angular-core-grid.js +43 -142
- package/fesm2015/sd-angular-core-grid.js.map +1 -1
- package/fesm2015/sd-angular-core-upload-excel.js.map +1 -1
- package/fesm2015/sd-angular-core.js +0 -1
- package/fesm2015/sd-angular-core.js.map +1 -1
- package/grid/sd-angular-core-grid.metadata.json +1 -1
- package/grid/src/lib/components/grid-popup-export-excel/grid-popup-export-excel.component.d.ts +12 -12
- package/grid/src/lib/components/grid-popup-export-excel/grid-popup-export-excel.model.d.ts +1 -2
- package/grid/src/lib/grid.component.d.ts +5 -6
- package/package.json +1 -1
- package/public-api.d.ts +0 -1
- package/{sd-angular-core-1.3.29.tgz → sd-angular-core-1.3.31.tgz} +0 -0
- package/upload-excel/sd-angular-core-upload-excel.metadata.json +1 -1
- package/bundles/sd-angular-core-excel.umd.js +0 -500
- package/bundles/sd-angular-core-excel.umd.js.map +0 -1
- package/bundles/sd-angular-core-excel.umd.min.js +0 -16
- package/bundles/sd-angular-core-excel.umd.min.js.map +0 -1
- package/esm2015/excel/index.js +0 -2
- package/esm2015/excel/sd-angular-core-excel.js +0 -5
- package/esm2015/excel/src/lib/excel.model.js +0 -3
- package/esm2015/excel/src/lib/excel.service.js +0 -91
- package/esm2015/excel/src/public-api.js +0 -6
- package/excel/index.d.ts +0 -1
- package/excel/package.json +0 -12
- package/excel/sd-angular-core-excel.d.ts +0 -4
- package/excel/sd-angular-core-excel.metadata.json +0 -1
- package/excel/src/lib/excel.model.d.ts +0 -65
- package/excel/src/lib/excel.service.d.ts +0 -26
- package/excel/src/public-api.d.ts +0 -2
- package/fesm2015/sd-angular-core-excel.js +0 -100
- package/fesm2015/sd-angular-core-excel.js.map +0 -1
|
@@ -18,12 +18,12 @@ import { __classPrivateFieldGet, __awaiter, __rest, __classPrivateFieldSet } fro
|
|
|
18
18
|
import { DeviceDetectorService } from 'ngx-device-detector';
|
|
19
19
|
import $ from 'jquery';
|
|
20
20
|
import { SdApiService } from '@sd-angular/core/api';
|
|
21
|
-
import { SdExcelService } from '@sd-angular/core/excel';
|
|
22
21
|
import { SdNotifyService } from '@sd-angular/core/notify';
|
|
23
22
|
import { SdLoadingService } from '@sd-angular/core/loading';
|
|
24
23
|
import { SdTranslateService } from '@sd-angular/core/translate';
|
|
25
24
|
import { Subscription, merge } from 'rxjs';
|
|
26
25
|
import { startWith } from 'rxjs/operators';
|
|
26
|
+
import { SdExportService } from '@sd-angular/core/export';
|
|
27
27
|
import { SdSettingService } from '@sd-angular/core/setting';
|
|
28
28
|
import hash from 'object-hash';
|
|
29
29
|
import { MatSelectModule } from '@angular/material/select';
|
|
@@ -523,7 +523,7 @@ HandlerDotnet.decorators = [
|
|
|
523
523
|
|
|
524
524
|
var _numberOfFooterRows, _paginator, _subscription, _setSelectedItems;
|
|
525
525
|
class SdGrid {
|
|
526
|
-
constructor(configuration, ref, deviceService, handlerLocal, handlerDotnet, translateService, datePipe, loadingService, apiService,
|
|
526
|
+
constructor(configuration, ref, deviceService, handlerLocal, handlerDotnet, translateService, datePipe, loadingService, apiService, exportService, notifyService, editorVisiblePipe) {
|
|
527
527
|
this.configuration = configuration;
|
|
528
528
|
this.ref = ref;
|
|
529
529
|
this.handlerLocal = handlerLocal;
|
|
@@ -532,7 +532,7 @@ class SdGrid {
|
|
|
532
532
|
this.datePipe = datePipe;
|
|
533
533
|
this.loadingService = loadingService;
|
|
534
534
|
this.apiService = apiService;
|
|
535
|
-
this.
|
|
535
|
+
this.exportService = exportService;
|
|
536
536
|
this.notifyService = notifyService;
|
|
537
537
|
this.editorVisiblePipe = editorVisiblePipe;
|
|
538
538
|
this.isMobileOrTablet = false;
|
|
@@ -1274,118 +1274,11 @@ class SdGrid {
|
|
|
1274
1274
|
columns.forEach(handle);
|
|
1275
1275
|
return obj;
|
|
1276
1276
|
});
|
|
1277
|
-
this.
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
let pageNumber = 1;
|
|
1283
|
-
this.loadingService.start();
|
|
1284
|
-
try {
|
|
1285
|
-
let exportItems = [];
|
|
1286
|
-
let filePath = null;
|
|
1287
|
-
let destination = null;
|
|
1288
|
-
let latestRow = 0;
|
|
1289
|
-
while (true) {
|
|
1290
|
-
if ((_p = this.gridOption.export) === null || _p === void 0 ? void 0 : _p.items) {
|
|
1291
|
-
exportItems = yield ((_q = this.gridOption.export) === null || _q === void 0 ? void 0 : _q.items(this.getFilterInfo(pageNumber, pageSize)).finally(this.loadingService.stop));
|
|
1292
|
-
}
|
|
1293
|
-
else {
|
|
1294
|
-
exportItems = yield this.getExportItems(pageNumber, pageSize).finally(this.loadingService.stop);
|
|
1295
|
-
}
|
|
1296
|
-
if ((_r = this.gridOption.export) === null || _r === void 0 ? void 0 : _r.mapping) {
|
|
1297
|
-
const results = this.gridOption.export.mapping(exportItems);
|
|
1298
|
-
if (results instanceof Promise) {
|
|
1299
|
-
exportItems = yield results;
|
|
1300
|
-
}
|
|
1301
|
-
else {
|
|
1302
|
-
exportItems = results;
|
|
1303
|
-
}
|
|
1304
|
-
}
|
|
1305
|
-
const columns = [...this.gridOption.columns, ...(((_s = this.gridOption.export) === null || _s === void 0 ? void 0 : _s.columns) || [])];
|
|
1306
|
-
const items = exportItems.map(item => {
|
|
1307
|
-
const obj = {};
|
|
1308
|
-
const handle = (column) => {
|
|
1309
|
-
if (column.type === 'children') {
|
|
1310
|
-
column.children.forEach(handle);
|
|
1311
|
-
}
|
|
1312
|
-
else if (column.transform) {
|
|
1313
|
-
obj[column.field] = column.transform(item[column.field], item);
|
|
1314
|
-
}
|
|
1315
|
-
else if (item[column.field] === undefined || item[column.field] === null || item[column.field] === '') {
|
|
1316
|
-
obj[column.field] = '';
|
|
1317
|
-
}
|
|
1318
|
-
else if (column.type === 'string' || column.type === 'number' || column.type === 'color') {
|
|
1319
|
-
// Nếu cell là string hoặc number thì gán bằng chính nó
|
|
1320
|
-
obj[column.field] = item[column.field];
|
|
1321
|
-
}
|
|
1322
|
-
else if (column.type === 'bool') {
|
|
1323
|
-
// Nếu là bool thì gán bằng giá trị trueValue và falseValue (nếu có), mặc định là TRUE/FALSE
|
|
1324
|
-
if (item[column.field]) {
|
|
1325
|
-
obj[column.field] = column.trueValue || 'True';
|
|
1326
|
-
}
|
|
1327
|
-
else {
|
|
1328
|
-
obj[column.field] = column.falseValue || 'False';
|
|
1329
|
-
}
|
|
1330
|
-
}
|
|
1331
|
-
else if (column.type === 'date') {
|
|
1332
|
-
// Nếu là date thì convert theo đúng format
|
|
1333
|
-
const date = new Date(item[column.field]);
|
|
1334
|
-
obj[column.field] = this.datePipe.transform(date, 'dd/MM/yyyy');
|
|
1335
|
-
}
|
|
1336
|
-
else if (column.type === 'datetime') {
|
|
1337
|
-
// Nếu là datetime thì convert theo đúng format
|
|
1338
|
-
const date = new Date(item[column.field]);
|
|
1339
|
-
obj[column.field] = this.datePipe.transform(date, 'dd/MM/yyyy HH:mm:ss');
|
|
1340
|
-
}
|
|
1341
|
-
else if (column.type === 'time') {
|
|
1342
|
-
// Nếu là time thì convert theo đúng format
|
|
1343
|
-
const date = new Date(item[column.field]);
|
|
1344
|
-
obj[column.field] = this.datePipe.transform(date, 'HH:mm:ss');
|
|
1345
|
-
}
|
|
1346
|
-
else if (column.type === 'values') {
|
|
1347
|
-
// Nếu là values thì lấy giá trị của value được chọn
|
|
1348
|
-
const data = column.values.find(e => e.value === item[column.field]);
|
|
1349
|
-
if (data) {
|
|
1350
|
-
obj[column.field] = data.text;
|
|
1351
|
-
}
|
|
1352
|
-
else {
|
|
1353
|
-
obj[column.field] = item[column.field];
|
|
1354
|
-
}
|
|
1355
|
-
}
|
|
1356
|
-
else if (column.type === 'radio') {
|
|
1357
|
-
const data = column.values.find(e => e[column.valueField] === item[column.field]);
|
|
1358
|
-
if (data) {
|
|
1359
|
-
obj[column.field] = data[column.displayField];
|
|
1360
|
-
}
|
|
1361
|
-
else {
|
|
1362
|
-
obj[column.field] = item[column.field];
|
|
1363
|
-
}
|
|
1364
|
-
}
|
|
1365
|
-
};
|
|
1366
|
-
columns.forEach(handle);
|
|
1367
|
-
return obj;
|
|
1368
|
-
});
|
|
1369
|
-
const result = yield this.excelService.bigExport({
|
|
1370
|
-
columns,
|
|
1371
|
-
items,
|
|
1372
|
-
latestRow,
|
|
1373
|
-
filePath,
|
|
1374
|
-
destination
|
|
1375
|
-
});
|
|
1376
|
-
latestRow = result.latestRow;
|
|
1377
|
-
filePath = result.filePath;
|
|
1378
|
-
destination = result.destination;
|
|
1379
|
-
if ((pageNumber - 1) * pageSize + items.length >= this.total) {
|
|
1380
|
-
yield this.excelService.download(filePath);
|
|
1381
|
-
break;
|
|
1382
|
-
}
|
|
1383
|
-
pageNumber++;
|
|
1384
|
-
}
|
|
1385
|
-
}
|
|
1386
|
-
finally {
|
|
1387
|
-
this.loadingService.stop();
|
|
1388
|
-
}
|
|
1277
|
+
this.exportService.exportByTemplate({
|
|
1278
|
+
filePath: params.excelConfig.fullPath,
|
|
1279
|
+
columns: params.excelColumns,
|
|
1280
|
+
items
|
|
1281
|
+
});
|
|
1389
1282
|
});
|
|
1390
1283
|
this.onEditorChange = () => {
|
|
1391
1284
|
this.ref.detectChanges();
|
|
@@ -1758,7 +1651,7 @@ _numberOfFooterRows = new WeakMap(), _paginator = new WeakMap(), _subscription =
|
|
|
1758
1651
|
SdGrid.decorators = [
|
|
1759
1652
|
{ type: Component, args: [{
|
|
1760
1653
|
selector: 'sd-grid',
|
|
1761
|
-
template: "<div class=\"clearfix\"></div>\r\n<ng-container *ngIf=\"!isMobileOrTablet && !gridOption?.filter?.disabled\">\r\n <div class=\"row mx-0 mt-5\">\r\n <div\r\n *ngIf=\"gridOption?.key && gridOption?.filter?.multiple !== false && (!gridOption?.filter?.quickFilterVisibility || gridOption?.filter?.quickFilterVisibility === 'inline')\"\r\n class=\"col-lg-2 col-md-3 col-sm-6 px-4\">\r\n <mat-form-field class=\"sd-md\" appearance=\"outline\" style=\"width: 100%;\">\r\n <mat-label>{{'Quick filters' | sdTranslate}}</mat-label>\r\n <mat-select [(ngModel)]=\"selectedQuickFilter\" (selectionChange)=\"onSelectQuickFilter($event?.value)\" #matSelect>\r\n <mat-option value=\"\">{{'Please select' | sdTranslate}}</mat-option>\r\n <mat-option *ngFor=\"let quickFilter of quickFilters\" [value]=\"quickFilter.code\">\r\n <div style=\"display:flex; justify-content: space-between\">\r\n <span>{{quickFilter.code}}</span>\r\n <div>\r\n <mat-icon class=\"mr-1 c-fa-icon\" (click)=\"onEditQuickFilter($event, quickFilter)\" fontSet=\"fa\"\r\n fontIcon=\"fa-pencil\"></mat-icon>\r\n <mat-icon class=\"mr-0 c-fa-icon\" (click)=\"onDeleteQuickFilter($event, quickFilter)\" fontSet=\"fa\"\r\n fontIcon=\"fa-trash-o\"></mat-icon>\r\n </div>\r\n </div>\r\n </mat-option>\r\n <mat-option>\r\n <div (click)=\"onCreateQuickFilter($event)\">\r\n <mat-icon class=\"mr-1\" fontSet=\"material-icons-outlined\">add</mat-icon>\r\n <span>{{'Create quick filter' | sdTranslate}}</span>\r\n </div>\r\n </mat-option>\r\n </mat-select>\r\n </mat-form-field>\r\n </div>\r\n <sd-grid-desktop-inline-filter class=\"c-display-contents\" [columns]=\"gridOption.columns\" [filter]=\"filter\"\r\n [externalFilter]=\"externalFilter\" (sdChange)=\"updateFilter()\" [inlineExternal]=\"inlineExternal\"\r\n [inlineColumn]=\"inlineColumn\" [filterOption]=\"gridOption.filter\">\r\n </sd-grid-desktop-inline-filter>\r\n </div>\r\n</ng-container>\r\n<div *ngIf=\"!isMobileOrTablet; else elseMobileOrTablet\" class=\"sd-box\"\r\n [ngClass]=\"{'box-shadow-none': gridOption.hideFooter}\">\r\n <ng-container *ngTemplateOutlet=\"gridViewContent\"></ng-container>\r\n <div [ngClass]=\"{'d-none': gridOption.hideFooter}\" class=\"sd-box-footer clearfix\">\r\n <div style=\"display: flex; align-items: center; align-content: space-between;\">\r\n <div style=\"flex: 1;\">\r\n <sd-button *ngIf=\"sdGridPopupFilter\" class=\"mr-6\" [title]=\"'Filter' | sdTranslate\" icon=\"filter_list\" size=\"sm\"\r\n (action)=\"onFilterPopup()\"></sd-button>\r\n <sd-button *ngIf=\"!gridOption?.hideReload\" class=\"mr-6\" [title]=\"'Reload' | sdTranslate\" icon=\"refresh\"\r\n size=\"sm\" (action)=\"reload()\"></sd-button>\r\n <sd-button *ngIf=\"gridOption.onImportExcel\" class=\"mr-6\" [title]=\"'Import' | sdTranslate\" icon=\"publish\"\r\n size=\"sm\" (action)=\"sdGridImportExcel.open()\"></sd-button>\r\n <ng-container *ngIf=\"sdGridPopupExportExcel\">\r\n <sd-button *ngIf=\"!gridOption.key\" class=\"mr-6\" [title]=\"'Export' | sdTranslate\" icon=\"get_app\" size=\"sm\"\r\n (action)=\"sdGridPopupExportExcel.exportDefault()\" [disabled]=\"!viewItems?.length\">\r\n </sd-button>\r\n <sd-button *ngIf=\"gridOption.key\" class=\"mr-6\" [title]=\"'Export' | sdTranslate\" icon=\"get_app\" size=\"sm\"\r\n [matMenuTriggerFor]=\"menu\" [disabled]=\"!viewItems?.length\">\r\n </sd-button>\r\n <mat-menu #menu=\"matMenu\">\r\n <button mat-menu-item (click)=\"sdGridPopupExportExcel.exportDefault()\" type=\"button\">\r\n <mat-icon>get_app</mat-icon>\r\n <span> {{'Export all columns' | sdTranslate}}</span>\r\n </button>\r\n <button mat-menu-item (click)=\"sdGridPopupExportExcel.open()\" type=\"button\">\r\n <mat-icon>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.export?.bigExport\" class=\"mr-6\" [title]=\"'Big export' | sdTranslate\" icon=\"get_app\"\r\n size=\"sm\" (action)=\"bigExport()\" [disabled]=\"!viewItems?.length\">\r\n </sd-button>\r\n <sd-button *ngIf=\"gridOption.key\" class=\"mr-6\" [title]=\"'Configure' | sdTranslate\" icon=\"settings\" size=\"sm\"\r\n (action)=\"sdGridConfig.open()\"></sd-button>\r\n </div>\r\n <div style=\"flex: 1;\">\r\n <mat-paginator [length]=\"total\" [pageSize]=\"gridOption.paginate?.pageSize\" hidePageSize>\r\n </mat-paginator>\r\n </div>\r\n </div>\r\n </div>\r\n</div>\r\n<ng-template #elseMobileOrTablet>\r\n <div class=\"sd-box c-mobile-box\">\r\n <div *ngIf=\"!gridOption?.mobileOrTablet?.useGridView\" class=\"sd-box-body c-mobile-body\"\r\n [ngClass]=\"{'c-loading': isLoading}\" #gridBody>\r\n <i [ngClass]=\"{'d-none': !isLoading}\" class=\"fa fa-4x fa-spinner fa-pulse c-loading-icon\"></i>\r\n <ng-container *ngFor=\"let item of viewItems\">\r\n <div class=\"c-mobile-item\" [ngClass]=\"{'c-mobile-item-selected':item.isChecked}\">\r\n <sd-grid-mobile-item-view [gridOption]=\"gridOption\" [item]=\"item\" (check)=\"onCheck(item)\">\r\n </sd-grid-mobile-item-view>\r\n <div class=\"p-2\" *ngIf=\"gridOption?.subInformation && item?.subInformation?.isOpened\">\r\n <sd-grid-sub-information [subItems]=\"item?.subInformation?.subItems\" [option]=\"gridOption?.subInformation\">\r\n </sd-grid-sub-information>\r\n </div>\r\n <div class=\"c-mobile-command\">\r\n <div>\r\n <i *ngIf=\"gridOption?.subInformation && item.subInformation?.isLoading\"\r\n class=\"fa fa-spinner fa-spin ml-1 c-mobile-action\" (click)=\"expandOrCollapse(item)\"></i>\r\n <i *ngIf=\"gridOption?.subInformation && !item.subInformation?.isLoading\" class=\"fa ml-1 c-mobile-action\"\r\n [ngClass]=\"{'fa-plus': !item.subInformation?.isOpened, 'fa-minus': item.subInformation?.isOpened}\"\r\n (click)=\"expandOrCollapse(item)\"></i>\r\n </div>\r\n <ng-container *ngIf=\"gridOption.commands | mobileCommandFilter:item | async; $implicit as filteredCommands\">\r\n <div *ngIf=\"filteredCommands.length\">\r\n <button [matMenuTriggerFor]=\"menu\" aria-hidden=\"true\" mat-icon-button type=\"button\">\r\n <mat-icon>more_vert</mat-icon>\r\n </button>\r\n <!-- <i [matMenuTriggerFor]=\"menu\" class=\"fa fa-navicon fa-fw c-mobile-action\"></i> -->\r\n <mat-menu #menu=\"matMenu\">\r\n <button *ngFor=\"let command of filteredCommands\" mat-menu-item (click)=\"command.click(item)\"\r\n [disabled]=\"command.disabled | commandDisabled:item\" type=\"button\">\r\n <i *ngIf=\"!command.fontSet\" class=\"{{command.icon | commandIcon:item}}\"></i>\r\n <mat-icon *ngIf=\"command.fontSet\" [fontSet]=\"command.fontSet\">{{command.icon | commandIcon:item}}\r\n </mat-icon>\r\n <span> {{command.title | commandTitle:item}}</span>\r\n </button>\r\n </mat-menu>\r\n </div>\r\n </ng-container>\r\n </div>\r\n </div>\r\n </ng-container>\r\n </div>\r\n <ng-container *ngIf=\"gridOption?.mobileOrTablet?.useGridView\">\r\n <ng-container *ngTemplateOutlet=\"gridViewContent\"></ng-container>\r\n </ng-container>\r\n <div [ngClass]=\"{'d-none': gridOption.hideFooter}\" class=\"sd-box-footer clearfix\">\r\n <sd-button icon=\"more_horiz\" size=\"sm\" [matMenuTriggerFor]=\"mobileAction\"></sd-button>\r\n <mat-menu #mobileAction=\"matMenu\">\r\n <button *ngIf=\"sdGridPopupFilter\" mat-menu-item (click)=\"onFilterPopup()\" type=\"button\">\r\n <mat-icon>filter_list</mat-icon>\r\n <span> {{'Filter' | sdTranslate}}</span>\r\n </button>\r\n <button *ngIf=\"!gridOption?.hideReload\" mat-menu-item (click)=\"reload()\" type=\"button\">\r\n <mat-icon>refresh</mat-icon>\r\n <span> {{'Reload' | sdTranslate}}</span>\r\n </button>\r\n <button *ngIf=\"gridOption.onImportExcel\" mat-menu-item (click)=\"sdGridImportExcel.open()\" type=\"button\">\r\n <mat-icon>publish</mat-icon>\r\n <span> {{'Import' | sdTranslate}}</span>\r\n </button>\r\n <button *ngIf=\"sdGridPopupExportExcel\" mat-menu-item (click)=\"sdGridPopupExportExcel.open()\" type=\"button\"\r\n [disabled]=\"!viewItems?.length\">\r\n <mat-icon>get_app</mat-icon>\r\n <span> {{'Export' | sdTranslate}}</span>\r\n </button>\r\n <button *ngIf=\"gridOption.key\" mat-menu-item (click)=\"sdGridConfig.open()\" type=\"button\">\r\n <mat-icon>settings</mat-icon>\r\n <span> {{'Configure' | sdTranslate}}</span>\r\n </button>\r\n </mat-menu>\r\n <ng-container *ngIf=\"gridOption?.key && gridOption?.filter?.multiple !== false && !gridOption?.filter?.disabled\">\r\n <sd-button icon=\"filter_list\" size=\"sm\" [matMenuTriggerFor]=\"mobileQuickFilter\"></sd-button>\r\n <mat-menu #mobileQuickFilter=\"matMenu\">\r\n <button mat-menu-item *ngFor=\"let quickFilter of quickFilters\" (click)=\"onSelectQuickFilter(quickFilter.code)\"\r\n type=\"button\" style=\"display:flex; justify-content: space-between\">\r\n <span>{{quickFilter.code}}</span>\r\n <div>\r\n <mat-icon class=\"mr-1\" (click)=\"onEditQuickFilter($event, quickFilter)\">edit</mat-icon>\r\n <mat-icon class=\"mr-0\" (click)=\"onDeleteQuickFilter($event, quickFilter)\">delete</mat-icon>\r\n </div>\r\n </button>\r\n <button mat-menu-item (click)=\"onCreateQuickFilter($event)\" type=\"button\">\r\n <mat-icon class=\"mr-1\" fontSet=\"material-icons-outlined\">add</mat-icon>\r\n <span>{{'Create quick filter' | sdTranslate}}</span>\r\n </button>\r\n </mat-menu>\r\n </ng-container>\r\n <div class=\"row mr-0 ml-0 text-right pull-right\">\r\n <mat-paginator [length]=\"total\" [pageSize]=\"gridOption.paginate?.pageSize\" hidePageSize>\r\n </mat-paginator>\r\n </div>\r\n </div>\r\n </div>\r\n</ng-template>\r\n<!-- Modal Configure Grid -->\r\n<sd-grid-config (sdChange)=\"loadConfig($event)\" #sdGridConfig></sd-grid-config>\r\n<sd-grid-popup-editor (save)=\"onSave($event)\" #sdGridPopupEditor></sd-grid-popup-editor>\r\n<!-- Import Excel -->\r\n<sd-grid-import-excel *ngIf=\"gridOption?.onImportExcel\" [key]=\"gridOption?.key\" [columns]=\"gridOption?.columns\"\r\n [accept]=\"gridOption?.onImportExcel\" #sdGridImportExcel></sd-grid-import-excel>\r\n<sd-grid-popup-export-excel *ngIf=\"!gridOption.export?.disabled\" [key]=\"gridOption?.key\" [columns]=\"gridOption?.columns\"\r\n [extendColumns]=\"gridOption?.export?.columns\" [fileName]=\"gridOption?.export?.fileName\"\r\n [exportOption]=\"gridOption?.export\" [validator]=\"gridOption?.export?.validator\"\r\n (exportByTemplate)=\"onExportByTemplate($event)\" #sdGridPopupExportExcel>\r\n</sd-grid-popup-export-excel>\r\n<sd-grid-popup-filter\r\n *ngIf=\"!gridOption?.filter?.disabled && (isMobileOrTablet || gridOption?.filter?.type === 'popup')\"\r\n [key]=\"gridOption?.key\" (accept)=\"updateFilter($event)\" [filterOption]=\"gridOption?.filter\" (clear)=\"onClearFilter()\"\r\n (loadInlineFilter)=\"onFilterConfigurationLoaded($event)\" #sdGridPopupFilter>\r\n</sd-grid-popup-filter>\r\n\r\n<ng-template #gridViewContent>\r\n <div class=\"sd-box-body p-0\">\r\n <div class=\"row mx-0\">\r\n <div [ngClass]=\"{'c-loading': isLoading}\" class=\"table-responsive\" #gridBody style=\"position: relative;\">\r\n <i [ngClass]=\"{'d-none': !isLoading}\" class=\"fa fa-5x fa-spinner fa-pulse c-loading-icon\"></i>\r\n <table *ngIf=\"gridOption\" class=\"table c-table\"\r\n [ngClass]=\"{'c-loading-margin': isLoading, 'c-bordered': configuration?.style?.bordered, 'c-stripped': configuration?.style?.bordered}\"\r\n style=\"border:0!important;\">\r\n <thead class=\"thead-light\">\r\n <tr>\r\n <th class=\"position-sticky c-sticky-all align-middle p-0\" style=\"width:4px; min-width: 4px;\" #fixedHeader>\r\n </th>\r\n <th *ngIf=\"configuration?.style?.bordered\" class=\"position-sticky h-100 p-0 c-sticky-spliter c-sticky-all\"\r\n #fixedHeader></th>\r\n <th *ngIf=\"gridOption?.subInformation\" class=\"position-sticky c-sticky-all align-middle text-center p-0\"\r\n style=\"width:30px;min-width: 30px;line-height: 3rem\" #fixedHeader>\r\n </th>\r\n <th *ngIf=\"gridOption?.subInformation && configuration?.style?.bordered\"\r\n class=\"position-sticky h-100 p-0 c-sticky-spliter c-sticky-all\" #fixedHeader></th>\r\n <th *ngIf=\"gridOption?.checkable && viewItems?.length\"\r\n class=\"position-sticky c-sticky-all align-middle text-center p-0 w-20\" style=\"width:20px;\" #fixedHeader>\r\n <mat-checkbox [color]=\"'primary'\" [(ngModel)]=\"isCheckedAll\"\r\n (change)=\"checkAll(isCheckedAll)\"></mat-checkbox>\r\n </th>\r\n <th *ngIf=\"gridOption?.checkable && viewItems?.length && configuration?.style?.bordered\"\r\n class=\"position-sticky h-100 p-0 c-sticky-spliter c-sticky-all\" #fixedHeader></th>\r\n <th *ngIf=\"gridOption?.commands?.length && viewItems?.length\"\r\n class=\"position-sticky align-middle text-center p-0 c-sticky-all c-w-1\" #fixedHeader>\r\n </th>\r\n <th *ngIf=\"gridOption.commands?.length && viewItems?.length && configuration?.style?.bordered\"\r\n class=\"position-sticky h-100 p-0 c-sticky-spliter c-sticky-all\" #fixedHeader></th>\r\n <th *ngIf=\"gridOption.editor?.addable || gridOption.editor?.editable\"\r\n class=\"position-sticky c-sticky-all align-middle text-center p-0\"\r\n style=\"width:60px;min-width:60px;max-width:60px;line-height: 1.5\" #fixedHeader>\r\n <div *ngIf=\"gridOption.editor.addable\" class=\"align-middle text-center\">\r\n <button *ngIf=\"!gridOption.editor.limit || (gridOption.editor.limit > items.length)\" type=\"button\"\r\n (click)=\"onCreate()\" aria-label=\"Add\" mat-icon-button type=\"button\">\r\n <mat-icon>add</mat-icon>\r\n </button>\r\n </div>\r\n </th>\r\n <th *ngIf=\"gridOption.editor && configuration?.style?.bordered\"\r\n class=\"position-sticky h-100 p-0 c-sticky-spliter c-sticky-all\" #fixedHeader></th>\r\n <th *ngIf=\"gridOption?.numberable\" class=\"position-sticky c-sticky-all align-middle text-center p-0\"\r\n style=\"width:20px;\" #fixedHeader>\r\n #\r\n </th>\r\n <th *ngIf=\"gridOption?.numberable && configuration?.style?.bordered\"\r\n class=\"position-sticky h-100 p-0 c-sticky-spliter c-sticky-all\" #fixedHeader></th>\r\n <ng-container *ngFor=\"let column of fixedColumns\">\r\n <th class=\"position-sticky align-middle cursor-pointer c-cell c-sticky-all\" #fixedHeader\r\n [ngStyle]=\"{'width':column.width ? column.width : '','max-width': column.width ? column.width : '','min-width': !column.width || column.width === 'auto' ? '200px' : column.width}\">\r\n <span [title]=\"column.title\" class=\"c-header-title\" (click)=\"sort(column)\">\r\n {{column.title}}\r\n <i *ngIf=\"column.type !== 'children' && column.type !== 'image' && gridOption.sortable !== false && column.sortable !== false && orderBy !== column.field\"\r\n class=\"fa fa-sort fa-fw\"></i>\r\n <i *ngIf=\"orderBy === column.field && orderDirection == 'ASC'\" class=\"fa fa-sort-asc fa-fw\"></i>\r\n <i *ngIf=\"orderBy === column.field && orderDirection == 'DESC'\" class=\"fa fa-sort-desc fa-fw\"></i>\r\n </span>\r\n <ng-container\r\n *ngIf=\"!gridOption?.filter?.disabled && gridOption?.filter?.columnInline !== 'outside' && !column?.filter?.disabled && (inlineColumn[column.field] || gridOption?.filter?.type === 'inline')\">\r\n <sd-input size=\"sm\"\r\n *ngIf=\"column.type === 'string' || column.type === 'number' || column.type === 'children'\"\r\n [(model)]=\"filter[column.field]\" (keyupEnter)=\"updateFilter()\">\r\n </sd-input>\r\n <sd-select *ngIf=\"column.type === 'bool'\" size=\"sm\" [(model)]=\"filter[column.field]\"\r\n (sdChange)=\"updateFilter()\"\r\n [items]=\"[{value: 1, display: column.trueValue || 'TRUE'}, {value: 0, display: column.falseValue || 'FALSE'}]\"\r\n valueField=\"value\" displayField=\"display\">\r\n </sd-select>\r\n <sd-select *ngIf=\"column.type === 'values'\" size=\"sm\" [(model)]=\"filter[column.field]\"\r\n (sdChange)=\"updateFilter()\" [items]=\"column.values\" valueField=\"value\" displayField=\"text\"\r\n [filtered]=\"column?.editor?.autocomplete\">\r\n </sd-select>\r\n <sd-select *ngIf=\"column.type === 'radio'\" size=\"sm\" [(model)]=\"filter[column.field]\"\r\n (sdChange)=\"updateFilter()\" [items]=\"column.values\" [valueField]=\"column.valueField\"\r\n [displayField]=\"column.displayField\">\r\n </sd-select>\r\n <sd-date-time size=\"sm\"\r\n *ngIf=\"column.type === 'date' || column.type === 'datetime' || column.type === 'time'\"\r\n [(model)]=\"filter[column.field]\" (sdChange)=\"updateFilter()\" type=\"date\">\r\n </sd-date-time>\r\n </ng-container>\r\n </th>\r\n <th *ngIf=\"configuration?.style?.bordered\"\r\n class=\"position-sticky h-100 p-0 c-sticky-spliter c-sticky-all\" #fixedHeader></th>\r\n </ng-container>\r\n <th *ngFor=\"let column of normalColumns\"\r\n class=\"position-sticky align-middle cursor-pointer border-top-0 border-bottom-0 c-cell c-sticky-top c-normal-column\"\r\n [ngStyle]=\"{'width':column.width ? column.width : '','max-width': column.width ? column.width : '','min-width': !column.width || column.width === 'auto' ? '200px' : column.width}\">\r\n <span [title]=\"column.title\" class=\"c-header-title\" (click)=\"sort(column)\">\r\n {{column.title}}\r\n <i *ngIf=\"column.type !== 'children' && gridOption.sortable !== false && column.sortable !== false && orderBy !== column.field\"\r\n class=\"fa fa-sort fa-fw\"></i>\r\n <i *ngIf=\"orderBy == column.field && orderDirection == 'ASC'\" class=\"fa fa-sort-asc fa-fw\"></i>\r\n <i *ngIf=\"orderBy == column.field && orderDirection == 'DESC'\" class=\"fa fa-sort-desc fa-fw\"></i>\r\n </span>\r\n <ng-container\r\n *ngIf=\"!gridOption?.filter?.disabled && gridOption?.filter?.columnInline !== 'outside' && !column?.filter?.disabled && (inlineColumn[column.field] || gridOption?.filter?.type === 'inline')\">\r\n <sd-input size=\"sm\"\r\n *ngIf=\"column.type === 'string' || column.type === 'number' || column.type === 'children'\"\r\n [(model)]=\"filter[column.field]\" (keyupEnter)=\"updateFilter()\">\r\n </sd-input>\r\n <sd-select *ngIf=\"column.type === 'bool'\" size=\"sm\" [(model)]=\"filter[column.field]\"\r\n (sdChange)=\"updateFilter()\"\r\n [items]=\"[{value: 1, display: column.trueValue || 'TRUE'}, {value: 0, display: column.falseValue || 'FALSE'}]\"\r\n valueField=\"value\" displayField=\"display\">\r\n </sd-select>\r\n <sd-select *ngIf=\"column.type === 'values'\" size=\"sm\" [(model)]=\"filter[column.field]\"\r\n (sdChange)=\"updateFilter()\" [items]=\"column.values\" valueField=\"value\" displayField=\"text\"\r\n [filtered]=\"column?.editor?.autocomplete\">\r\n </sd-select>\r\n <sd-select *ngIf=\"column.type === 'radio'\" size=\"sm\" [(model)]=\"filter[column.field]\"\r\n (sdChange)=\"updateFilter()\" [items]=\"column.values\" [valueField]=\"column.valueField\"\r\n [displayField]=\"column.displayField\">\r\n </sd-select>\r\n <sd-date-time size=\"sm\"\r\n *ngIf=\"column.type === 'date' || column.type === 'datetime' || column.type === 'time'\"\r\n [(model)]=\"filter[column.field]\" (sdChange)=\"updateFilter()\" type=\"date\">\r\n </sd-date-time>\r\n </ng-container>\r\n </th>\r\n </tr>\r\n </thead>\r\n <tbody>\r\n <ng-container *ngFor=\"let item of viewItems; index as idx; trackBy: trackById\">\r\n <tr>\r\n <td class=\"position-sticky c-sticky-left p-0\"\r\n [ngClass]=\"{'c-error': ((gridOption.editor?.type === 'inline' || item.editingStatus) && item.editorHandler?.errorMessage), \r\n 'c-selected': !((gridOption.editor?.type === 'inline' || item.editingStatus) && item.editorHandler?.errorMessage) && selectedItem === item}\"\r\n style=\"width:4px;min-width: 4px;left:0\" matTooltipPosition=\"after\"\r\n [matTooltip]=\"item.editingStatus ? item.editorHandler?.errorMessage:''\" #fixedBody>\r\n </td>\r\n <td *ngIf=\"configuration?.style?.bordered\"\r\n class=\"position-sticky h-100 p-0 c-sticky-spliter c-sticky-left\" #fixedBody></td>\r\n <td *ngIf=\"gridOption.subInformation\" class=\"position-sticky text-center align-middle p-0 c-sticky-left\"\r\n style=\"width:30px;min-width: 30px;line-height: 3rem\" #fixedBody>\r\n <button *ngIf=\"!item.editingStatus\" (click)=\"expandOrCollapse(item)\" type=\"button\" class=\"c-btn-icon\">\r\n <i *ngIf=\"item.subInformation?.isLoading\" class=\"fa fa-spinner fa-spin\"></i>\r\n <i *ngIf=\"!item.subInformation?.isLoading\" class=\"fa\"\r\n [ngClass]=\"{'fa-caret-right': !item.subInformation?.isOpened, 'fa-caret-down': item.subInformation?.isOpened}\"></i>\r\n </button>\r\n </td>\r\n <td *ngIf=\"gridOption.subInformation && configuration?.style?.bordered\"\r\n class=\"position-sticky h-100 p-0 c-sticky-spliter c-sticky-left\" #fixedBody></td>\r\n <td *ngIf=\"gridOption.checkable && viewItems?.length\"\r\n class=\"position-sticky c-sticky-left align-middle p-0\" #fixedBody>\r\n <div *ngIf=\"!item.editingStatus\" class=\"align-middle text-center w-20\" style=\"width:20px;\">\r\n <mat-checkbox [color]=\"'primary'\" [(ngModel)]=\"item.isChecked\"\r\n (change)=\"onCheck(item, true)\"></mat-checkbox>\r\n </div>\r\n </td>\r\n <td *ngIf=\"gridOption.checkable && viewItems?.length && configuration?.style?.bordered\"\r\n class=\"position-sticky h-100 p-0 c-sticky-spliter c-sticky-left\" #fixedBody></td>\r\n <td *ngIf=\"gridOption.commands?.length && viewItems?.length\"\r\n class=\"position-sticky align-middle px-2 py-0 c-sticky-left c-w-1\" #fixedBody>\r\n <div *ngIf=\"!item.editingStatus\" class=\"d-flex align-middle text-center justify-content-center\">\r\n <ng-container\r\n *ngIf=\"gridOption.commands | commandFilter:item | async; $implicit as filteredCommands\">\r\n <section *ngFor=\"let command of filteredCommands\">\r\n <ng-container *ngIf=\"!command.children?.length; else elseCommandChildren\">\r\n <button *ngIf=\"!command.fontSet\" (click)=\"command.click(item)\" type=\"button\"\r\n class=\"c-btn-icon\" [matTooltip]=\"command.title | commandTitle:item\"\r\n [disabled]=\"command.disabled | commandDisabled:item\">\r\n <i class=\"{{command.icon | commandIcon:item}}\" aria-hidden=\"true\"></i>\r\n </button>\r\n <button *ngIf=\"command.fontSet\" [matTooltip]=\"command.title | commandTitle:item\"\r\n [disabled]=\"command.disabled | commandDisabled:item\" (click)=\"command.click(item)\"\r\n type=\"button\" aria-hidden=\"true\" mat-icon-button>\r\n <mat-icon [fontSet]=\"command.fontSet\">{{command.icon | commandIcon:item}}</mat-icon>\r\n </button>\r\n </ng-container>\r\n <ng-template #elseCommandChildren>\r\n <button *ngIf=\"command.icon\" [matMenuTriggerFor]=\"menu\" type=\"button\" class=\"c-btn-icon\"\r\n [matTooltip]=\"command.title\" [disabled]=\"command.disabled | commandDisabled:item\">\r\n <i class=\"{{command.icon | commandIcon:item}}\" aria-hidden=\"true\"></i>\r\n </button>\r\n <button *ngIf=\"!command.icon\" mat-icon-button [matMenuTriggerFor]=\"menu\" type=\"button\"\r\n class=\"c-btn-icon-30\" [matTooltip]=\"command.title\"\r\n [disabled]=\"command.disabled | commandDisabled:item\">\r\n <mat-icon>more_vert</mat-icon>\r\n </button>\r\n <mat-menu #menu=\"matMenu\">\r\n <ng-container *ngFor=\"let childCommand of command.children\">\r\n <button *ngIf=\"!(item | commandHidden:childCommand | async)\" type=\"button\" mat-menu-item\r\n [disabled]=\"childCommand.disabled | commandDisabled:item\"\r\n (click)=\"childCommand.click(item)\">\r\n <i *ngIf=\"!childCommand.fontSet\" class=\"{{childCommand.icon | commandIcon:item}}\"></i>\r\n <mat-icon *ngIf=\"childCommand.fontSet\" [fontSet]=\"childCommand.fontSet\">\r\n {{childCommand.icon | commandIcon:item}}</mat-icon>\r\n <span> {{childCommand.title | commandTitle:item}}</span>\r\n </button>\r\n </ng-container>\r\n </mat-menu>\r\n </ng-template>\r\n </section>\r\n </ng-container>\r\n </div>\r\n </td>\r\n <td *ngIf=\"gridOption.commands?.length && viewItems?.length && configuration?.style?.bordered\"\r\n class=\"position-sticky h-100 p-0 c-sticky-spliter c-sticky-left\" #fixedBody></td>\r\n <td *ngIf=\"gridOption.editor?.addable || gridOption.editor?.editable\"\r\n class=\"position-sticky c-sticky-left align-middle p-0\" #fixedBody>\r\n <div class=\"align-middle text-center\"\r\n style=\"width:60px;min-width:60px;max-width:60px;line-height: 1.5\">\r\n <button\r\n *ngIf=\"!item.editingStatus && gridOption.editor?.type !== 'inline' && gridOption.editor?.editable\"\r\n [disabled]=\"item.editorHandler?.disabled\" (click)=\"onUpdate(item, true)\" aria-label=\"Edit\"\r\n type=\"button\" mat-icon-button>\r\n <mat-icon>edit</mat-icon>\r\n </button>\r\n <button *ngIf=\"item.editingStatus && gridOption.editor?.type !== 'inline'\"\r\n [disabled]=\"item.editorHandler?.errorMessage || item.editorHandler?.saving\" (click)=\"onSave(item)\"\r\n type=\"button\" aria-label=\"Save\" mat-icon-button>\r\n <mat-icon>save</mat-icon>\r\n </button>\r\n <button *ngIf=\"item.editingStatus || gridOption.editor?.type === 'inline'\" (click)=\"onCancel(item)\"\r\n aria-label=\"Cancel\" mat-icon-button\r\n [disabled]=\"gridOption.editor?.type === 'inline' && item.editorHandler?.disabled\" type=\"button\">\r\n <mat-icon>cancel</mat-icon>\r\n </button>\r\n </div>\r\n </td>\r\n <td *ngIf=\"gridOption.editor && configuration?.style?.bordered\"\r\n class=\"position-sticky h-100 p-0 c-sticky-spliter c-sticky-left\" #fixedBody></td>\r\n <td *ngIf=\"gridOption.numberable\" class=\"position-sticky c-sticky-left align-middle p-0\" #fixedBody>\r\n <div *ngIf=\"!item.editingStatus\" class=\"align-middle text-center\" style=\"width:20px;\">\r\n <!-- {{gridOption.paginate?.pageSize * (currentPage - 1) + idx + 1}} -->\r\n {{idx + 1}}\r\n </div>\r\n </td>\r\n <td *ngIf=\"gridOption.numberable && configuration?.style?.bordered\"\r\n class=\"position-sticky h-100 p-0 c-sticky-spliter c-sticky-left\" #fixedBody></td>\r\n <ng-template ngFor let-column [ngForOf]=\"fixedColumns\">\r\n <td class=\"position-sticky align-middle c-cell c-sticky-left\"\r\n [ngClass]=\"{'text-center': column.type !== 'string' && column.type !== 'number' && column.type !== 'children', 'text-right': column.type === 'number'}\"\r\n [ngStyle]=\"{'width':column.width ? column.width : '','min-width': !column.width || column.width === 'auto' ? '200px' : column.width}\"\r\n (click)=\"rowHandler.click(item)\" #fixedBody>\r\n <ng-container *ngIf=\"column.type !== 'children';else elseColumnChildren\">\r\n <ng-container *ngIf=\"item[column.field] | editorHandler:item:gridOption\">\r\n <div\r\n *ngIf=\"item.editorHandler[column.field].visible && gridOption.editor?.validate && !(item[column.field] | editorValidate:item:gridOption.editor.validate | async)\">\r\n </div>\r\n <ng-container *ngIf=\"item.editorHandler[column.field].visible;else columnView\">\r\n <div style=\"width: 100%\">\r\n <ng-container *ngIf=\"cellEditorDef[column.field]\">\r\n <ng-container\r\n *ngTemplateOutlet=\"cellEditorDef[column.field].templateRef;context:{item: item, idx: idx, column:column}\">\r\n </ng-container>\r\n </ng-container>\r\n <sd-grid-desktop-column-edit *ngIf=\"!cellEditorDef[column.field]\" [column]=\"column\"\r\n [item]=\"item\" (sdChange)=\"onEditorChange()\">\r\n </sd-grid-desktop-column-edit>\r\n </div>\r\n </ng-container>\r\n <ng-template #columnView>\r\n <div class=\"align-middle\" (dblclick)=\"rowHandler.dblClick(item)\">\r\n <ng-container *ngIf=\"cellDef[column.field]\">\r\n <ng-container\r\n *ngTemplateOutlet=\"cellDef[column.field].templateRef;context:{item: item, idx: idx, column:column}\">\r\n </ng-container>\r\n </ng-container>\r\n <sd-grid-desktop-column-view *ngIf=\"!cellDef[column.field]\" [column]=\"column\" [item]=\"item\">\r\n </sd-grid-desktop-column-view>\r\n </div>\r\n </ng-template>\r\n </ng-container>\r\n </ng-container>\r\n <ng-template #elseColumnChildren>\r\n <sd-grid-desktop-column-children-view [column]=\"column\" [item]=\"item\">\r\n </sd-grid-desktop-column-children-view>\r\n </ng-template>\r\n </td>\r\n <td *ngIf=\"configuration?.style?.bordered\"\r\n class=\"position-sticky h-100 p-0 c-sticky-spliter c-sticky-left\" #fixedBody></td>\r\n </ng-template>\r\n <td *ngFor=\"let column of normalColumns\" class=\"align-middle c-cell c-normal-column\"\r\n (click)=\"rowHandler.click(item)\"\r\n [ngClass]=\"{'text-center': column.type !== 'string' && column.type !== 'number' && column.type !== 'children', 'text-right': column.type === 'number'}\"\r\n (dblclick)=\"rowHandler.dblClick(item)\"\r\n [ngStyle]=\"{'width':column.width ? column.width : '', 'min-width': !column.width || column.width === 'auto' ? '200px' : column.width}\">\r\n <ng-container *ngIf=\"column.type !== 'children';else elseColumnChildren\">\r\n <ng-container *ngIf=\"item[column.field] | editorHandler:item:gridOption\">\r\n <div\r\n *ngIf=\"item.editorHandler[column.field].visible && gridOption.editor?.validate && !(item[column.field] | editorValidate:item:gridOption.editor.validate | async)\">\r\n </div>\r\n <ng-container *ngIf=\"item.editorHandler[column.field].visible;else columnView\">\r\n <div style=\"width: 100%\">\r\n <ng-container *ngIf=\"cellEditorDef[column.field]\">\r\n <ng-container\r\n *ngTemplateOutlet=\"cellEditorDef[column.field].templateRef;context:{item: item, idx: idx, column:column}\">\r\n </ng-container>\r\n </ng-container>\r\n <sd-grid-desktop-column-edit *ngIf=\"!cellEditorDef[column.field]\" [column]=\"column\"\r\n [item]=\"item\" (sdChange)=\"onEditorChange()\">\r\n </sd-grid-desktop-column-edit>\r\n </div>\r\n </ng-container>\r\n <ng-template #columnView>\r\n <div class=\"align-middle\" (dblclick)=\"rowHandler.dblClick(item)\">\r\n <ng-container *ngIf=\"cellDef[column.field]\">\r\n <ng-container\r\n *ngTemplateOutlet=\"cellDef[column.field].templateRef;context:{item: item, idx: idx, column:column}\">\r\n </ng-container>\r\n </ng-container>\r\n <sd-grid-desktop-column-view *ngIf=\"!cellDef[column.field]\" [column]=\"column\" [item]=\"item\">\r\n </sd-grid-desktop-column-view>\r\n </div>\r\n </ng-template>\r\n </ng-container>\r\n </ng-container>\r\n <ng-template #elseColumnChildren>\r\n <sd-grid-desktop-column-children-view [column]=\"column\" [item]=\"item\">\r\n </sd-grid-desktop-column-children-view>\r\n </ng-template>\r\n </td>\r\n </tr>\r\n <tr *ngIf=\"gridOption?.subInformation && item?.subInformation?.isOpened\" class=\"c-no-hover\">\r\n <td class=\"p-10\" colspan=\"100\">\r\n <sd-grid-sub-information [subItems]=\"item?.subInformation?.subItems\"\r\n [option]=\"gridOption?.subInformation\">\r\n </sd-grid-sub-information>\r\n </td>\r\n </tr>\r\n </ng-container>\r\n <ng-container *ngIf=\"viewItems?.length\">\r\n <ng-container *ngFor=\"let footerIndex of footerRows\">\r\n <tr>\r\n <td class=\"position-sticky c-sticky-left p-0\" style=\"width:4px;min-width: 4px;left:0\" #fixedBody>\r\n </td>\r\n <td *ngIf=\"configuration?.style?.bordered\"\r\n class=\"position-sticky h-100 p-0 c-sticky-spliter c-sticky-left\" #fixedBody></td>\r\n <td *ngIf=\"gridOption.subInformation\"\r\n class=\"position-sticky text-center align-middle p-0 c-sticky-left\"\r\n style=\"width:30px;min-width: 30px;line-height: 3rem\" #fixedBody>\r\n </td>\r\n <td *ngIf=\"gridOption.subInformation && configuration?.style?.bordered\"\r\n class=\"position-sticky h-100 p-0 c-sticky-spliter c-sticky-left\" #fixedBody></td>\r\n <td *ngIf=\"gridOption.checkable && viewItems?.length\"\r\n class=\"position-sticky c-sticky-left align-middle p-0\" #fixedBody>\r\n </td>\r\n <td *ngIf=\"gridOption.checkable && viewItems?.length && configuration?.style?.bordered\"\r\n class=\"position-sticky h-100 p-0 c-sticky-spliter c-sticky-left\" #fixedBody></td>\r\n <td *ngIf=\"gridOption.commands?.length && viewItems?.length\"\r\n class=\"position-sticky align-middle px-2 py-0 c-sticky-left c-w-1\" #fixedBody>\r\n </td>\r\n <td *ngIf=\"gridOption.commands?.length && viewItems?.length && configuration?.style?.bordered\"\r\n class=\"position-sticky h-100 p-0 c-sticky-spliter c-sticky-left\" #fixedBody></td>\r\n <td *ngIf=\"gridOption.editor?.addable || gridOption.editor?.editable\"\r\n class=\"position-sticky c-sticky-left align-middle p-0\" #fixedBody>\r\n </td>\r\n <td *ngIf=\"gridOption.editor && configuration?.style?.bordered\"\r\n class=\"position-sticky h-100 p-0 c-sticky-spliter c-sticky-left\" #fixedBody></td>\r\n <td *ngIf=\"gridOption.numberable\" class=\"position-sticky c-sticky-left align-middle p-0\" #fixedBody>\r\n </td>\r\n <td *ngIf=\"gridOption.numberable && configuration?.style?.bordered\"\r\n class=\"position-sticky h-100 p-0 c-sticky-spliter c-sticky-left\" #fixedBody></td>\r\n <ng-template ngFor let-column [ngForOf]=\"fixedColumns\">\r\n <td class=\"position-sticky align-middle p-0 c-sticky-left\" #fixedBody>\r\n <ng-container *ngIf=\"cellFooterDef[column.field] && cellFooterDef[column.field][footerIndex]\">\r\n <ng-container\r\n *ngTemplateOutlet=\"cellFooterDef[column.field][footerIndex].templateRef;context:{items: viewItems, column:column}\">\r\n </ng-container>\r\n </ng-container>\r\n </td>\r\n <td *ngIf=\"configuration?.style?.bordered\"\r\n class=\"position-sticky h-100 p-0 c-sticky-spliter c-sticky-left\" #fixedBody></td>\r\n </ng-template>\r\n <td *ngFor=\"let column of normalColumns\" class=\"align-middle p-0 c-normal-column\">\r\n <ng-container *ngIf=\"cellFooterDef[column.field] && cellFooterDef[column.field][footerIndex]\">\r\n <ng-container\r\n *ngTemplateOutlet=\"cellFooterDef[column.field][footerIndex].templateRef;context:{items: viewItems, column:column}\">\r\n </ng-container>\r\n </ng-container>\r\n </td>\r\n </tr>\r\n </ng-container>\r\n </ng-container>\r\n <tr *ngIf=\"!viewItems?.length && !isLoading\">\r\n <td class=\"c-empty\" colspan=\"100\">\r\n <mat-icon>cloud_off</mat-icon>\r\n </td>\r\n </tr>\r\n </tbody>\r\n </table>\r\n </div>\r\n </div>\r\n </div>\r\n</ng-template>",
|
|
1654
|
+
template: "<div class=\"clearfix\"></div>\r\n<ng-container *ngIf=\"!isMobileOrTablet && !gridOption?.filter?.disabled\">\r\n <div class=\"row mx-0 mt-5\">\r\n <div\r\n *ngIf=\"gridOption?.key && gridOption?.filter?.multiple !== false && (!gridOption?.filter?.quickFilterVisibility || gridOption?.filter?.quickFilterVisibility === 'inline')\"\r\n class=\"col-lg-2 col-md-3 col-sm-6 px-4\">\r\n <mat-form-field class=\"sd-md\" appearance=\"outline\" style=\"width: 100%;\">\r\n <mat-label>{{'Quick filters' | sdTranslate}}</mat-label>\r\n <mat-select [(ngModel)]=\"selectedQuickFilter\" (selectionChange)=\"onSelectQuickFilter($event?.value)\" #matSelect>\r\n <mat-option value=\"\">{{'Please select' | sdTranslate}}</mat-option>\r\n <mat-option *ngFor=\"let quickFilter of quickFilters\" [value]=\"quickFilter.code\">\r\n <div style=\"display:flex; justify-content: space-between\">\r\n <span>{{quickFilter.code}}</span>\r\n <div>\r\n <mat-icon class=\"mr-1 c-fa-icon\" (click)=\"onEditQuickFilter($event, quickFilter)\" fontSet=\"fa\"\r\n fontIcon=\"fa-pencil\"></mat-icon>\r\n <mat-icon class=\"mr-0 c-fa-icon\" (click)=\"onDeleteQuickFilter($event, quickFilter)\" fontSet=\"fa\"\r\n fontIcon=\"fa-trash-o\"></mat-icon>\r\n </div>\r\n </div>\r\n </mat-option>\r\n <mat-option>\r\n <div (click)=\"onCreateQuickFilter($event)\">\r\n <mat-icon class=\"mr-1\" fontSet=\"material-icons-outlined\">add</mat-icon>\r\n <span>{{'Create quick filter' | sdTranslate}}</span>\r\n </div>\r\n </mat-option>\r\n </mat-select>\r\n </mat-form-field>\r\n </div>\r\n <sd-grid-desktop-inline-filter class=\"c-display-contents\" [columns]=\"gridOption.columns\" [filter]=\"filter\"\r\n [externalFilter]=\"externalFilter\" (sdChange)=\"updateFilter()\" [inlineExternal]=\"inlineExternal\"\r\n [inlineColumn]=\"inlineColumn\" [filterOption]=\"gridOption.filter\">\r\n </sd-grid-desktop-inline-filter>\r\n </div>\r\n</ng-container>\r\n<div *ngIf=\"!isMobileOrTablet; else elseMobileOrTablet\" class=\"sd-box\"\r\n [ngClass]=\"{'box-shadow-none': gridOption.hideFooter}\">\r\n <ng-container *ngTemplateOutlet=\"gridViewContent\"></ng-container>\r\n <div [ngClass]=\"{'d-none': gridOption.hideFooter}\" class=\"sd-box-footer clearfix\">\r\n <div style=\"display: flex; align-items: center; align-content: space-between;\">\r\n <div style=\"flex: 1;\">\r\n <sd-button *ngIf=\"sdGridPopupFilter\" class=\"mr-6\" [title]=\"'Filter' | sdTranslate\" icon=\"filter_list\" size=\"sm\"\r\n (action)=\"onFilterPopup()\"></sd-button>\r\n <sd-button *ngIf=\"!gridOption?.hideReload\" class=\"mr-6\" [title]=\"'Reload' | sdTranslate\" icon=\"refresh\"\r\n size=\"sm\" (action)=\"reload()\"></sd-button>\r\n <sd-button *ngIf=\"gridOption.onImportExcel\" class=\"mr-6\" [title]=\"'Import' | sdTranslate\" icon=\"publish\"\r\n size=\"sm\" (action)=\"sdGridImportExcel.open()\"></sd-button>\r\n <ng-container *ngIf=\"sdGridPopupExportExcel\">\r\n <sd-button *ngIf=\"!gridOption.key\" class=\"mr-6\" [title]=\"'Export' | sdTranslate\" icon=\"get_app\" size=\"sm\"\r\n (action)=\"sdGridPopupExportExcel.exportDefault()\" [disabled]=\"!viewItems?.length\">\r\n </sd-button>\r\n <sd-button *ngIf=\"gridOption.key\" class=\"mr-6\" [title]=\"'Export' | sdTranslate\" icon=\"get_app\" size=\"sm\"\r\n [matMenuTriggerFor]=\"menu\" [disabled]=\"!viewItems?.length\">\r\n </sd-button>\r\n <mat-menu #menu=\"matMenu\">\r\n <button mat-menu-item (click)=\"sdGridPopupExportExcel.exportDefault()\" type=\"button\">\r\n <mat-icon>get_app</mat-icon>\r\n <span> {{'Export all columns' | sdTranslate}}</span>\r\n </button>\r\n <button mat-menu-item (click)=\"sdGridPopupExportExcel.open()\" type=\"button\">\r\n <mat-icon>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.key\" class=\"mr-6\" [title]=\"'Configure' | sdTranslate\" icon=\"settings\" size=\"sm\"\r\n (action)=\"sdGridConfig.open()\"></sd-button>\r\n </div>\r\n <div style=\"flex: 1;\">\r\n <mat-paginator [length]=\"total\" [pageSize]=\"gridOption.paginate?.pageSize\" hidePageSize>\r\n </mat-paginator>\r\n </div>\r\n </div>\r\n </div>\r\n</div>\r\n<ng-template #elseMobileOrTablet>\r\n <div class=\"sd-box c-mobile-box\">\r\n <div *ngIf=\"!gridOption?.mobileOrTablet?.useGridView\" class=\"sd-box-body c-mobile-body\"\r\n [ngClass]=\"{'c-loading': isLoading}\" #gridBody>\r\n <i [ngClass]=\"{'d-none': !isLoading}\" class=\"fa fa-4x fa-spinner fa-pulse c-loading-icon\"></i>\r\n <ng-container *ngFor=\"let item of viewItems\">\r\n <div class=\"c-mobile-item\" [ngClass]=\"{'c-mobile-item-selected':item.isChecked}\">\r\n <sd-grid-mobile-item-view [gridOption]=\"gridOption\" [item]=\"item\" (check)=\"onCheck(item)\">\r\n </sd-grid-mobile-item-view>\r\n <div class=\"p-2\" *ngIf=\"gridOption?.subInformation && item?.subInformation?.isOpened\">\r\n <sd-grid-sub-information [subItems]=\"item?.subInformation?.subItems\" [option]=\"gridOption?.subInformation\">\r\n </sd-grid-sub-information>\r\n </div>\r\n <div class=\"c-mobile-command\">\r\n <div>\r\n <i *ngIf=\"gridOption?.subInformation && item.subInformation?.isLoading\"\r\n class=\"fa fa-spinner fa-spin ml-1 c-mobile-action\" (click)=\"expandOrCollapse(item)\"></i>\r\n <i *ngIf=\"gridOption?.subInformation && !item.subInformation?.isLoading\" class=\"fa ml-1 c-mobile-action\"\r\n [ngClass]=\"{'fa-plus': !item.subInformation?.isOpened, 'fa-minus': item.subInformation?.isOpened}\"\r\n (click)=\"expandOrCollapse(item)\"></i>\r\n </div>\r\n <ng-container *ngIf=\"gridOption.commands | mobileCommandFilter:item | async; $implicit as filteredCommands\">\r\n <div *ngIf=\"filteredCommands.length\">\r\n <button [matMenuTriggerFor]=\"menu\" aria-hidden=\"true\" mat-icon-button type=\"button\">\r\n <mat-icon>more_vert</mat-icon>\r\n </button>\r\n <!-- <i [matMenuTriggerFor]=\"menu\" class=\"fa fa-navicon fa-fw c-mobile-action\"></i> -->\r\n <mat-menu #menu=\"matMenu\">\r\n <button *ngFor=\"let command of filteredCommands\" mat-menu-item (click)=\"command.click(item)\"\r\n [disabled]=\"command.disabled | commandDisabled:item\" type=\"button\">\r\n <i *ngIf=\"!command.fontSet\" class=\"{{command.icon | commandIcon:item}}\"></i>\r\n <mat-icon *ngIf=\"command.fontSet\" [fontSet]=\"command.fontSet\">{{command.icon | commandIcon:item}}\r\n </mat-icon>\r\n <span> {{command.title | commandTitle:item}}</span>\r\n </button>\r\n </mat-menu>\r\n </div>\r\n </ng-container>\r\n </div>\r\n </div>\r\n </ng-container>\r\n </div>\r\n <ng-container *ngIf=\"gridOption?.mobileOrTablet?.useGridView\">\r\n <ng-container *ngTemplateOutlet=\"gridViewContent\"></ng-container>\r\n </ng-container>\r\n <div [ngClass]=\"{'d-none': gridOption.hideFooter}\" class=\"sd-box-footer clearfix\">\r\n <sd-button icon=\"more_horiz\" size=\"sm\" [matMenuTriggerFor]=\"mobileAction\"></sd-button>\r\n <mat-menu #mobileAction=\"matMenu\">\r\n <button *ngIf=\"sdGridPopupFilter\" mat-menu-item (click)=\"onFilterPopup()\" type=\"button\">\r\n <mat-icon>filter_list</mat-icon>\r\n <span> {{'Filter' | sdTranslate}}</span>\r\n </button>\r\n <button *ngIf=\"!gridOption?.hideReload\" mat-menu-item (click)=\"reload()\" type=\"button\">\r\n <mat-icon>refresh</mat-icon>\r\n <span> {{'Reload' | sdTranslate}}</span>\r\n </button>\r\n <button *ngIf=\"gridOption.onImportExcel\" mat-menu-item (click)=\"sdGridImportExcel.open()\" type=\"button\">\r\n <mat-icon>publish</mat-icon>\r\n <span> {{'Import' | sdTranslate}}</span>\r\n </button>\r\n <button *ngIf=\"sdGridPopupExportExcel\" mat-menu-item (click)=\"sdGridPopupExportExcel.open()\" type=\"button\"\r\n [disabled]=\"!viewItems?.length\">\r\n <mat-icon>get_app</mat-icon>\r\n <span> {{'Export' | sdTranslate}}</span>\r\n </button>\r\n <button *ngIf=\"gridOption.key\" mat-menu-item (click)=\"sdGridConfig.open()\" type=\"button\">\r\n <mat-icon>settings</mat-icon>\r\n <span> {{'Configure' | sdTranslate}}</span>\r\n </button>\r\n </mat-menu>\r\n <ng-container *ngIf=\"gridOption?.key && gridOption?.filter?.multiple !== false && !gridOption?.filter?.disabled\">\r\n <sd-button icon=\"filter_list\" size=\"sm\" [matMenuTriggerFor]=\"mobileQuickFilter\"></sd-button>\r\n <mat-menu #mobileQuickFilter=\"matMenu\">\r\n <button mat-menu-item *ngFor=\"let quickFilter of quickFilters\" (click)=\"onSelectQuickFilter(quickFilter.code)\"\r\n type=\"button\" style=\"display:flex; justify-content: space-between\">\r\n <span>{{quickFilter.code}}</span>\r\n <div>\r\n <mat-icon class=\"mr-1\" (click)=\"onEditQuickFilter($event, quickFilter)\">edit</mat-icon>\r\n <mat-icon class=\"mr-0\" (click)=\"onDeleteQuickFilter($event, quickFilter)\">delete</mat-icon>\r\n </div>\r\n </button>\r\n <button mat-menu-item (click)=\"onCreateQuickFilter($event)\" type=\"button\">\r\n <mat-icon class=\"mr-1\" fontSet=\"material-icons-outlined\">add</mat-icon>\r\n <span>{{'Create quick filter' | sdTranslate}}</span>\r\n </button>\r\n </mat-menu>\r\n </ng-container>\r\n <div class=\"row mr-0 ml-0 text-right pull-right\">\r\n <mat-paginator [length]=\"total\" [pageSize]=\"gridOption.paginate?.pageSize\" hidePageSize>\r\n </mat-paginator>\r\n </div>\r\n </div>\r\n </div>\r\n</ng-template>\r\n<!-- Modal Configure Grid -->\r\n<sd-grid-config (sdChange)=\"loadConfig($event)\" #sdGridConfig></sd-grid-config>\r\n<sd-grid-popup-editor (save)=\"onSave($event)\" #sdGridPopupEditor></sd-grid-popup-editor>\r\n<!-- Import Excel -->\r\n<sd-grid-import-excel *ngIf=\"gridOption?.onImportExcel\" [key]=\"gridOption?.key\" [columns]=\"gridOption?.columns\"\r\n [accept]=\"gridOption?.onImportExcel\" #sdGridImportExcel></sd-grid-import-excel>\r\n<sd-grid-popup-export-excel *ngIf=\"!gridOption.export?.disabled\" [key]=\"gridOption?.key\" [columns]=\"gridOption?.columns\"\r\n [extendColumns]=\"gridOption?.export?.columns\" [fileName]=\"gridOption?.export?.fileName\"\r\n [exportOption]=\"gridOption?.export\" [validator]=\"gridOption?.export?.validator\"\r\n (exportByTemplate)=\"onExportByTemplate($event)\" #sdGridPopupExportExcel>\r\n</sd-grid-popup-export-excel>\r\n<sd-grid-popup-filter\r\n *ngIf=\"!gridOption?.filter?.disabled && (isMobileOrTablet || gridOption?.filter?.type === 'popup')\"\r\n [key]=\"gridOption?.key\" (accept)=\"updateFilter($event)\" [filterOption]=\"gridOption?.filter\" (clear)=\"onClearFilter()\"\r\n (loadInlineFilter)=\"onFilterConfigurationLoaded($event)\" #sdGridPopupFilter>\r\n</sd-grid-popup-filter>\r\n\r\n<ng-template #gridViewContent>\r\n <div class=\"sd-box-body p-0\">\r\n <div class=\"row mx-0\">\r\n <div [ngClass]=\"{'c-loading': isLoading}\" class=\"table-responsive\" #gridBody style=\"position: relative;\">\r\n <i [ngClass]=\"{'d-none': !isLoading}\" class=\"fa fa-5x fa-spinner fa-pulse c-loading-icon\"></i>\r\n <table *ngIf=\"gridOption\" class=\"table c-table\"\r\n [ngClass]=\"{'c-loading-margin': isLoading, 'c-bordered': configuration?.style?.bordered, 'c-stripped': configuration?.style?.bordered}\"\r\n style=\"border:0!important;\">\r\n <thead class=\"thead-light\">\r\n <tr>\r\n <th class=\"position-sticky c-sticky-all align-middle p-0\" style=\"width:4px; min-width: 4px;\" #fixedHeader>\r\n </th>\r\n <th *ngIf=\"configuration?.style?.bordered\" class=\"position-sticky h-100 p-0 c-sticky-spliter c-sticky-all\"\r\n #fixedHeader></th>\r\n <th *ngIf=\"gridOption?.subInformation\" class=\"position-sticky c-sticky-all align-middle text-center p-0\"\r\n style=\"width:30px;min-width: 30px;line-height: 3rem\" #fixedHeader>\r\n </th>\r\n <th *ngIf=\"gridOption?.subInformation && configuration?.style?.bordered\"\r\n class=\"position-sticky h-100 p-0 c-sticky-spliter c-sticky-all\" #fixedHeader></th>\r\n <th *ngIf=\"gridOption?.checkable && viewItems?.length\"\r\n class=\"position-sticky c-sticky-all align-middle text-center p-0 w-20\" style=\"width:20px;\" #fixedHeader>\r\n <mat-checkbox [color]=\"'primary'\" [(ngModel)]=\"isCheckedAll\"\r\n (change)=\"checkAll(isCheckedAll)\"></mat-checkbox>\r\n </th>\r\n <th *ngIf=\"gridOption?.checkable && viewItems?.length && configuration?.style?.bordered\"\r\n class=\"position-sticky h-100 p-0 c-sticky-spliter c-sticky-all\" #fixedHeader></th>\r\n <th *ngIf=\"gridOption?.commands?.length && viewItems?.length\"\r\n class=\"position-sticky align-middle text-center p-0 c-sticky-all c-w-1\" #fixedHeader>\r\n </th>\r\n <th *ngIf=\"gridOption.commands?.length && viewItems?.length && configuration?.style?.bordered\"\r\n class=\"position-sticky h-100 p-0 c-sticky-spliter c-sticky-all\" #fixedHeader></th>\r\n <th *ngIf=\"gridOption.editor?.addable || gridOption.editor?.editable\"\r\n class=\"position-sticky c-sticky-all align-middle text-center p-0\"\r\n style=\"width:60px;min-width:60px;max-width:60px;line-height: 1.5\" #fixedHeader>\r\n <div *ngIf=\"gridOption.editor.addable\" class=\"align-middle text-center\">\r\n <button *ngIf=\"!gridOption.editor.limit || (gridOption.editor.limit > items.length)\" type=\"button\"\r\n (click)=\"onCreate()\" aria-label=\"Add\" mat-icon-button type=\"button\">\r\n <mat-icon>add</mat-icon>\r\n </button>\r\n </div>\r\n </th>\r\n <th *ngIf=\"gridOption.editor && configuration?.style?.bordered\"\r\n class=\"position-sticky h-100 p-0 c-sticky-spliter c-sticky-all\" #fixedHeader></th>\r\n <th *ngIf=\"gridOption?.numberable\" class=\"position-sticky c-sticky-all align-middle text-center p-0\"\r\n style=\"width:20px;\" #fixedHeader>\r\n #\r\n </th>\r\n <th *ngIf=\"gridOption?.numberable && configuration?.style?.bordered\"\r\n class=\"position-sticky h-100 p-0 c-sticky-spliter c-sticky-all\" #fixedHeader></th>\r\n <ng-container *ngFor=\"let column of fixedColumns\">\r\n <th class=\"position-sticky align-middle cursor-pointer c-cell c-sticky-all\" #fixedHeader\r\n [ngStyle]=\"{'width':column.width ? column.width : '','max-width': column.width ? column.width : '','min-width': !column.width || column.width === 'auto' ? '200px' : column.width}\">\r\n <span [title]=\"column.title\" class=\"c-header-title\" (click)=\"sort(column)\">\r\n {{column.title}}\r\n <i *ngIf=\"column.type !== 'children' && column.type !== 'image' && gridOption.sortable !== false && column.sortable !== false && orderBy !== column.field\"\r\n class=\"fa fa-sort fa-fw\"></i>\r\n <i *ngIf=\"orderBy === column.field && orderDirection == 'ASC'\" class=\"fa fa-sort-asc fa-fw\"></i>\r\n <i *ngIf=\"orderBy === column.field && orderDirection == 'DESC'\" class=\"fa fa-sort-desc fa-fw\"></i>\r\n </span>\r\n <ng-container\r\n *ngIf=\"!gridOption?.filter?.disabled && gridOption?.filter?.columnInline !== 'outside' && !column?.filter?.disabled && (inlineColumn[column.field] || gridOption?.filter?.type === 'inline')\">\r\n <sd-input size=\"sm\"\r\n *ngIf=\"column.type === 'string' || column.type === 'number' || column.type === 'children'\"\r\n [(model)]=\"filter[column.field]\" (keyupEnter)=\"updateFilter()\">\r\n </sd-input>\r\n <sd-select *ngIf=\"column.type === 'bool'\" size=\"sm\" [(model)]=\"filter[column.field]\"\r\n (sdChange)=\"updateFilter()\"\r\n [items]=\"[{value: 1, display: column.trueValue || 'TRUE'}, {value: 0, display: column.falseValue || 'FALSE'}]\"\r\n valueField=\"value\" displayField=\"display\">\r\n </sd-select>\r\n <sd-select *ngIf=\"column.type === 'values'\" size=\"sm\" [(model)]=\"filter[column.field]\"\r\n (sdChange)=\"updateFilter()\" [items]=\"column.values\" valueField=\"value\" displayField=\"text\"\r\n [filtered]=\"column?.editor?.autocomplete\">\r\n </sd-select>\r\n <sd-select *ngIf=\"column.type === 'radio'\" size=\"sm\" [(model)]=\"filter[column.field]\"\r\n (sdChange)=\"updateFilter()\" [items]=\"column.values\" [valueField]=\"column.valueField\"\r\n [displayField]=\"column.displayField\">\r\n </sd-select>\r\n <sd-date-time size=\"sm\"\r\n *ngIf=\"column.type === 'date' || column.type === 'datetime' || column.type === 'time'\"\r\n [(model)]=\"filter[column.field]\" (sdChange)=\"updateFilter()\" type=\"date\">\r\n </sd-date-time>\r\n </ng-container>\r\n </th>\r\n <th *ngIf=\"configuration?.style?.bordered\"\r\n class=\"position-sticky h-100 p-0 c-sticky-spliter c-sticky-all\" #fixedHeader></th>\r\n </ng-container>\r\n <th *ngFor=\"let column of normalColumns\"\r\n class=\"position-sticky align-middle cursor-pointer border-top-0 border-bottom-0 c-cell c-sticky-top c-normal-column\"\r\n [ngStyle]=\"{'width':column.width ? column.width : '','max-width': column.width ? column.width : '','min-width': !column.width || column.width === 'auto' ? '200px' : column.width}\">\r\n <span [title]=\"column.title\" class=\"c-header-title\" (click)=\"sort(column)\">\r\n {{column.title}}\r\n <i *ngIf=\"column.type !== 'children' && gridOption.sortable !== false && column.sortable !== false && orderBy !== column.field\"\r\n class=\"fa fa-sort fa-fw\"></i>\r\n <i *ngIf=\"orderBy == column.field && orderDirection == 'ASC'\" class=\"fa fa-sort-asc fa-fw\"></i>\r\n <i *ngIf=\"orderBy == column.field && orderDirection == 'DESC'\" class=\"fa fa-sort-desc fa-fw\"></i>\r\n </span>\r\n <ng-container\r\n *ngIf=\"!gridOption?.filter?.disabled && gridOption?.filter?.columnInline !== 'outside' && !column?.filter?.disabled && (inlineColumn[column.field] || gridOption?.filter?.type === 'inline')\">\r\n <sd-input size=\"sm\"\r\n *ngIf=\"column.type === 'string' || column.type === 'number' || column.type === 'children'\"\r\n [(model)]=\"filter[column.field]\" (keyupEnter)=\"updateFilter()\">\r\n </sd-input>\r\n <sd-select *ngIf=\"column.type === 'bool'\" size=\"sm\" [(model)]=\"filter[column.field]\"\r\n (sdChange)=\"updateFilter()\"\r\n [items]=\"[{value: 1, display: column.trueValue || 'TRUE'}, {value: 0, display: column.falseValue || 'FALSE'}]\"\r\n valueField=\"value\" displayField=\"display\">\r\n </sd-select>\r\n <sd-select *ngIf=\"column.type === 'values'\" size=\"sm\" [(model)]=\"filter[column.field]\"\r\n (sdChange)=\"updateFilter()\" [items]=\"column.values\" valueField=\"value\" displayField=\"text\"\r\n [filtered]=\"column?.editor?.autocomplete\">\r\n </sd-select>\r\n <sd-select *ngIf=\"column.type === 'radio'\" size=\"sm\" [(model)]=\"filter[column.field]\"\r\n (sdChange)=\"updateFilter()\" [items]=\"column.values\" [valueField]=\"column.valueField\"\r\n [displayField]=\"column.displayField\">\r\n </sd-select>\r\n <sd-date-time size=\"sm\"\r\n *ngIf=\"column.type === 'date' || column.type === 'datetime' || column.type === 'time'\"\r\n [(model)]=\"filter[column.field]\" (sdChange)=\"updateFilter()\" type=\"date\">\r\n </sd-date-time>\r\n </ng-container>\r\n </th>\r\n </tr>\r\n </thead>\r\n <tbody>\r\n <ng-container *ngFor=\"let item of viewItems; index as idx; trackBy: trackById\">\r\n <tr>\r\n <td class=\"position-sticky c-sticky-left p-0\"\r\n [ngClass]=\"{'c-error': ((gridOption.editor?.type === 'inline' || item.editingStatus) && item.editorHandler?.errorMessage), \r\n 'c-selected': !((gridOption.editor?.type === 'inline' || item.editingStatus) && item.editorHandler?.errorMessage) && selectedItem === item}\"\r\n style=\"width:4px;min-width: 4px;left:0\" matTooltipPosition=\"after\"\r\n [matTooltip]=\"item.editingStatus ? item.editorHandler?.errorMessage:''\" #fixedBody>\r\n </td>\r\n <td *ngIf=\"configuration?.style?.bordered\"\r\n class=\"position-sticky h-100 p-0 c-sticky-spliter c-sticky-left\" #fixedBody></td>\r\n <td *ngIf=\"gridOption.subInformation\" class=\"position-sticky text-center align-middle p-0 c-sticky-left\"\r\n style=\"width:30px;min-width: 30px;line-height: 3rem\" #fixedBody>\r\n <button *ngIf=\"!item.editingStatus\" (click)=\"expandOrCollapse(item)\" type=\"button\" class=\"c-btn-icon\">\r\n <i *ngIf=\"item.subInformation?.isLoading\" class=\"fa fa-spinner fa-spin\"></i>\r\n <i *ngIf=\"!item.subInformation?.isLoading\" class=\"fa\"\r\n [ngClass]=\"{'fa-caret-right': !item.subInformation?.isOpened, 'fa-caret-down': item.subInformation?.isOpened}\"></i>\r\n </button>\r\n </td>\r\n <td *ngIf=\"gridOption.subInformation && configuration?.style?.bordered\"\r\n class=\"position-sticky h-100 p-0 c-sticky-spliter c-sticky-left\" #fixedBody></td>\r\n <td *ngIf=\"gridOption.checkable && viewItems?.length\"\r\n class=\"position-sticky c-sticky-left align-middle p-0\" #fixedBody>\r\n <div *ngIf=\"!item.editingStatus\" class=\"align-middle text-center w-20\" style=\"width:20px;\">\r\n <mat-checkbox [color]=\"'primary'\" [(ngModel)]=\"item.isChecked\"\r\n (change)=\"onCheck(item, true)\"></mat-checkbox>\r\n </div>\r\n </td>\r\n <td *ngIf=\"gridOption.checkable && viewItems?.length && configuration?.style?.bordered\"\r\n class=\"position-sticky h-100 p-0 c-sticky-spliter c-sticky-left\" #fixedBody></td>\r\n <td *ngIf=\"gridOption.commands?.length && viewItems?.length\"\r\n class=\"position-sticky align-middle px-2 py-0 c-sticky-left c-w-1\" #fixedBody>\r\n <div *ngIf=\"!item.editingStatus\" class=\"d-flex align-middle text-center justify-content-center\">\r\n <ng-container\r\n *ngIf=\"gridOption.commands | commandFilter:item | async; $implicit as filteredCommands\">\r\n <section *ngFor=\"let command of filteredCommands\">\r\n <ng-container *ngIf=\"!command.children?.length; else elseCommandChildren\">\r\n <button *ngIf=\"!command.fontSet\" (click)=\"command.click(item)\" type=\"button\"\r\n class=\"c-btn-icon\" [matTooltip]=\"command.title | commandTitle:item\"\r\n [disabled]=\"command.disabled | commandDisabled:item\">\r\n <i class=\"{{command.icon | commandIcon:item}}\" aria-hidden=\"true\"></i>\r\n </button>\r\n <button *ngIf=\"command.fontSet\" [matTooltip]=\"command.title | commandTitle:item\"\r\n [disabled]=\"command.disabled | commandDisabled:item\" (click)=\"command.click(item)\"\r\n type=\"button\" aria-hidden=\"true\" mat-icon-button>\r\n <mat-icon [fontSet]=\"command.fontSet\">{{command.icon | commandIcon:item}}</mat-icon>\r\n </button>\r\n </ng-container>\r\n <ng-template #elseCommandChildren>\r\n <button *ngIf=\"command.icon\" [matMenuTriggerFor]=\"menu\" type=\"button\" class=\"c-btn-icon\"\r\n [matTooltip]=\"command.title\" [disabled]=\"command.disabled | commandDisabled:item\">\r\n <i class=\"{{command.icon | commandIcon:item}}\" aria-hidden=\"true\"></i>\r\n </button>\r\n <button *ngIf=\"!command.icon\" mat-icon-button [matMenuTriggerFor]=\"menu\" type=\"button\"\r\n class=\"c-btn-icon-30\" [matTooltip]=\"command.title\"\r\n [disabled]=\"command.disabled | commandDisabled:item\">\r\n <mat-icon>more_vert</mat-icon>\r\n </button>\r\n <mat-menu #menu=\"matMenu\">\r\n <ng-container *ngFor=\"let childCommand of command.children\">\r\n <button *ngIf=\"!(item | commandHidden:childCommand | async)\" type=\"button\" mat-menu-item\r\n [disabled]=\"childCommand.disabled | commandDisabled:item\"\r\n (click)=\"childCommand.click(item)\">\r\n <i *ngIf=\"!childCommand.fontSet\" class=\"{{childCommand.icon | commandIcon:item}}\"></i>\r\n <mat-icon *ngIf=\"childCommand.fontSet\" [fontSet]=\"childCommand.fontSet\">\r\n {{childCommand.icon | commandIcon:item}}</mat-icon>\r\n <span> {{childCommand.title | commandTitle:item}}</span>\r\n </button>\r\n </ng-container>\r\n </mat-menu>\r\n </ng-template>\r\n </section>\r\n </ng-container>\r\n </div>\r\n </td>\r\n <td *ngIf=\"gridOption.commands?.length && viewItems?.length && configuration?.style?.bordered\"\r\n class=\"position-sticky h-100 p-0 c-sticky-spliter c-sticky-left\" #fixedBody></td>\r\n <td *ngIf=\"gridOption.editor?.addable || gridOption.editor?.editable\"\r\n class=\"position-sticky c-sticky-left align-middle p-0\" #fixedBody>\r\n <div class=\"align-middle text-center\"\r\n style=\"width:60px;min-width:60px;max-width:60px;line-height: 1.5\">\r\n <button\r\n *ngIf=\"!item.editingStatus && gridOption.editor?.type !== 'inline' && gridOption.editor?.editable\"\r\n [disabled]=\"item.editorHandler?.disabled\" (click)=\"onUpdate(item, true)\" aria-label=\"Edit\"\r\n type=\"button\" mat-icon-button>\r\n <mat-icon>edit</mat-icon>\r\n </button>\r\n <button *ngIf=\"item.editingStatus && gridOption.editor?.type !== 'inline'\"\r\n [disabled]=\"item.editorHandler?.errorMessage || item.editorHandler?.saving\" (click)=\"onSave(item)\"\r\n type=\"button\" aria-label=\"Save\" mat-icon-button>\r\n <mat-icon>save</mat-icon>\r\n </button>\r\n <button *ngIf=\"item.editingStatus || gridOption.editor?.type === 'inline'\" (click)=\"onCancel(item)\"\r\n aria-label=\"Cancel\" mat-icon-button\r\n [disabled]=\"gridOption.editor?.type === 'inline' && item.editorHandler?.disabled\" type=\"button\">\r\n <mat-icon>cancel</mat-icon>\r\n </button>\r\n </div>\r\n </td>\r\n <td *ngIf=\"gridOption.editor && configuration?.style?.bordered\"\r\n class=\"position-sticky h-100 p-0 c-sticky-spliter c-sticky-left\" #fixedBody></td>\r\n <td *ngIf=\"gridOption.numberable\" class=\"position-sticky c-sticky-left align-middle p-0\" #fixedBody>\r\n <div *ngIf=\"!item.editingStatus\" class=\"align-middle text-center\" style=\"width:20px;\">\r\n <!-- {{gridOption.paginate?.pageSize * (currentPage - 1) + idx + 1}} -->\r\n {{idx + 1}}\r\n </div>\r\n </td>\r\n <td *ngIf=\"gridOption.numberable && configuration?.style?.bordered\"\r\n class=\"position-sticky h-100 p-0 c-sticky-spliter c-sticky-left\" #fixedBody></td>\r\n <ng-template ngFor let-column [ngForOf]=\"fixedColumns\">\r\n <td class=\"position-sticky align-middle c-cell c-sticky-left\"\r\n [ngClass]=\"{'text-center': column.type !== 'string' && column.type !== 'number' && column.type !== 'children', 'text-right': column.type === 'number'}\"\r\n [ngStyle]=\"{'width':column.width ? column.width : '','min-width': !column.width || column.width === 'auto' ? '200px' : column.width}\"\r\n (click)=\"rowHandler.click(item)\" #fixedBody>\r\n <ng-container *ngIf=\"column.type !== 'children';else elseColumnChildren\">\r\n <ng-container *ngIf=\"item[column.field] | editorHandler:item:gridOption\">\r\n <div\r\n *ngIf=\"item.editorHandler[column.field].visible && gridOption.editor?.validate && !(item[column.field] | editorValidate:item:gridOption.editor.validate | async)\">\r\n </div>\r\n <ng-container *ngIf=\"item.editorHandler[column.field].visible;else columnView\">\r\n <div style=\"width: 100%\">\r\n <ng-container *ngIf=\"cellEditorDef[column.field]\">\r\n <ng-container\r\n *ngTemplateOutlet=\"cellEditorDef[column.field].templateRef;context:{item: item, idx: idx, column:column}\">\r\n </ng-container>\r\n </ng-container>\r\n <sd-grid-desktop-column-edit *ngIf=\"!cellEditorDef[column.field]\" [column]=\"column\"\r\n [item]=\"item\" (sdChange)=\"onEditorChange()\">\r\n </sd-grid-desktop-column-edit>\r\n </div>\r\n </ng-container>\r\n <ng-template #columnView>\r\n <div class=\"align-middle\" (dblclick)=\"rowHandler.dblClick(item)\">\r\n <ng-container *ngIf=\"cellDef[column.field]\">\r\n <ng-container\r\n *ngTemplateOutlet=\"cellDef[column.field].templateRef;context:{item: item, idx: idx, column:column}\">\r\n </ng-container>\r\n </ng-container>\r\n <sd-grid-desktop-column-view *ngIf=\"!cellDef[column.field]\" [column]=\"column\" [item]=\"item\">\r\n </sd-grid-desktop-column-view>\r\n </div>\r\n </ng-template>\r\n </ng-container>\r\n </ng-container>\r\n <ng-template #elseColumnChildren>\r\n <sd-grid-desktop-column-children-view [column]=\"column\" [item]=\"item\">\r\n </sd-grid-desktop-column-children-view>\r\n </ng-template>\r\n </td>\r\n <td *ngIf=\"configuration?.style?.bordered\"\r\n class=\"position-sticky h-100 p-0 c-sticky-spliter c-sticky-left\" #fixedBody></td>\r\n </ng-template>\r\n <td *ngFor=\"let column of normalColumns\" class=\"align-middle c-cell c-normal-column\"\r\n (click)=\"rowHandler.click(item)\"\r\n [ngClass]=\"{'text-center': column.type !== 'string' && column.type !== 'number' && column.type !== 'children', 'text-right': column.type === 'number'}\"\r\n (dblclick)=\"rowHandler.dblClick(item)\"\r\n [ngStyle]=\"{'width':column.width ? column.width : '', 'min-width': !column.width || column.width === 'auto' ? '200px' : column.width}\">\r\n <ng-container *ngIf=\"column.type !== 'children';else elseColumnChildren\">\r\n <ng-container *ngIf=\"item[column.field] | editorHandler:item:gridOption\">\r\n <div\r\n *ngIf=\"item.editorHandler[column.field].visible && gridOption.editor?.validate && !(item[column.field] | editorValidate:item:gridOption.editor.validate | async)\">\r\n </div>\r\n <ng-container *ngIf=\"item.editorHandler[column.field].visible;else columnView\">\r\n <div style=\"width: 100%\">\r\n <ng-container *ngIf=\"cellEditorDef[column.field]\">\r\n <ng-container\r\n *ngTemplateOutlet=\"cellEditorDef[column.field].templateRef;context:{item: item, idx: idx, column:column}\">\r\n </ng-container>\r\n </ng-container>\r\n <sd-grid-desktop-column-edit *ngIf=\"!cellEditorDef[column.field]\" [column]=\"column\"\r\n [item]=\"item\" (sdChange)=\"onEditorChange()\">\r\n </sd-grid-desktop-column-edit>\r\n </div>\r\n </ng-container>\r\n <ng-template #columnView>\r\n <div class=\"align-middle\" (dblclick)=\"rowHandler.dblClick(item)\">\r\n <ng-container *ngIf=\"cellDef[column.field]\">\r\n <ng-container\r\n *ngTemplateOutlet=\"cellDef[column.field].templateRef;context:{item: item, idx: idx, column:column}\">\r\n </ng-container>\r\n </ng-container>\r\n <sd-grid-desktop-column-view *ngIf=\"!cellDef[column.field]\" [column]=\"column\" [item]=\"item\">\r\n </sd-grid-desktop-column-view>\r\n </div>\r\n </ng-template>\r\n </ng-container>\r\n </ng-container>\r\n <ng-template #elseColumnChildren>\r\n <sd-grid-desktop-column-children-view [column]=\"column\" [item]=\"item\">\r\n </sd-grid-desktop-column-children-view>\r\n </ng-template>\r\n </td>\r\n </tr>\r\n <tr *ngIf=\"gridOption?.subInformation && item?.subInformation?.isOpened\" class=\"c-no-hover\">\r\n <td class=\"p-10\" colspan=\"100\">\r\n <sd-grid-sub-information [subItems]=\"item?.subInformation?.subItems\"\r\n [option]=\"gridOption?.subInformation\">\r\n </sd-grid-sub-information>\r\n </td>\r\n </tr>\r\n </ng-container>\r\n <ng-container *ngIf=\"viewItems?.length\">\r\n <ng-container *ngFor=\"let footerIndex of footerRows\">\r\n <tr>\r\n <td class=\"position-sticky c-sticky-left p-0\" style=\"width:4px;min-width: 4px;left:0\" #fixedBody>\r\n </td>\r\n <td *ngIf=\"configuration?.style?.bordered\"\r\n class=\"position-sticky h-100 p-0 c-sticky-spliter c-sticky-left\" #fixedBody></td>\r\n <td *ngIf=\"gridOption.subInformation\"\r\n class=\"position-sticky text-center align-middle p-0 c-sticky-left\"\r\n style=\"width:30px;min-width: 30px;line-height: 3rem\" #fixedBody>\r\n </td>\r\n <td *ngIf=\"gridOption.subInformation && configuration?.style?.bordered\"\r\n class=\"position-sticky h-100 p-0 c-sticky-spliter c-sticky-left\" #fixedBody></td>\r\n <td *ngIf=\"gridOption.checkable && viewItems?.length\"\r\n class=\"position-sticky c-sticky-left align-middle p-0\" #fixedBody>\r\n </td>\r\n <td *ngIf=\"gridOption.checkable && viewItems?.length && configuration?.style?.bordered\"\r\n class=\"position-sticky h-100 p-0 c-sticky-spliter c-sticky-left\" #fixedBody></td>\r\n <td *ngIf=\"gridOption.commands?.length && viewItems?.length\"\r\n class=\"position-sticky align-middle px-2 py-0 c-sticky-left c-w-1\" #fixedBody>\r\n </td>\r\n <td *ngIf=\"gridOption.commands?.length && viewItems?.length && configuration?.style?.bordered\"\r\n class=\"position-sticky h-100 p-0 c-sticky-spliter c-sticky-left\" #fixedBody></td>\r\n <td *ngIf=\"gridOption.editor?.addable || gridOption.editor?.editable\"\r\n class=\"position-sticky c-sticky-left align-middle p-0\" #fixedBody>\r\n </td>\r\n <td *ngIf=\"gridOption.editor && configuration?.style?.bordered\"\r\n class=\"position-sticky h-100 p-0 c-sticky-spliter c-sticky-left\" #fixedBody></td>\r\n <td *ngIf=\"gridOption.numberable\" class=\"position-sticky c-sticky-left align-middle p-0\" #fixedBody>\r\n </td>\r\n <td *ngIf=\"gridOption.numberable && configuration?.style?.bordered\"\r\n class=\"position-sticky h-100 p-0 c-sticky-spliter c-sticky-left\" #fixedBody></td>\r\n <ng-template ngFor let-column [ngForOf]=\"fixedColumns\">\r\n <td class=\"position-sticky align-middle p-0 c-sticky-left\" #fixedBody>\r\n <ng-container *ngIf=\"cellFooterDef[column.field] && cellFooterDef[column.field][footerIndex]\">\r\n <ng-container\r\n *ngTemplateOutlet=\"cellFooterDef[column.field][footerIndex].templateRef;context:{items: viewItems, column:column}\">\r\n </ng-container>\r\n </ng-container>\r\n </td>\r\n <td *ngIf=\"configuration?.style?.bordered\"\r\n class=\"position-sticky h-100 p-0 c-sticky-spliter c-sticky-left\" #fixedBody></td>\r\n </ng-template>\r\n <td *ngFor=\"let column of normalColumns\" class=\"align-middle p-0 c-normal-column\">\r\n <ng-container *ngIf=\"cellFooterDef[column.field] && cellFooterDef[column.field][footerIndex]\">\r\n <ng-container\r\n *ngTemplateOutlet=\"cellFooterDef[column.field][footerIndex].templateRef;context:{items: viewItems, column:column}\">\r\n </ng-container>\r\n </ng-container>\r\n </td>\r\n </tr>\r\n </ng-container>\r\n </ng-container>\r\n <tr *ngIf=\"!viewItems?.length && !isLoading\">\r\n <td class=\"c-empty\" colspan=\"100\">\r\n <mat-icon>cloud_off</mat-icon>\r\n </td>\r\n </tr>\r\n </tbody>\r\n </table>\r\n </div>\r\n </div>\r\n </div>\r\n</ng-template>",
|
|
1762
1655
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
1763
1656
|
styles: [".text-black400{color:#757575}.c-table.table{margin-bottom:5px}.c-table.table td.c-empty,.c-table.table th.c-empty{background-color:#fff;border:none!important;text-align:center}.c-table.table td.c-empty mat-icon,.c-table.table th.c-empty mat-icon{font-size:150px;height:auto;margin-bottom:30px;margin-top:30px;opacity:.2;width:auto}.c-table.table.c-bordered,.c-table.table.c-bordered td,.c-table.table.c-bordered th{border:1px solid #dee2e6!important}.c-table.table.c-bordered td.c-empty,.c-table.table.c-bordered th.c-empty{background-color:#fff;border:none!important;text-align:center}.c-table.table.c-bordered td.c-empty mat-icon,.c-table.table.c-bordered th.c-empty mat-icon{font-size:150px;height:auto;margin-bottom:30px;margin-top:30px;opacity:.2;width:auto}.c-table.table.c-bordered td.c-normal-column,.c-table.table.c-bordered th.c-normal-column{border-left:none!important}.c-table.table.c-bordered td.c-sticky-spliter,.c-table.table.c-bordered th.c-sticky-spliter{background-color:#dee2e6!important;border:none!important;display:table-cell;max-width:1px!important;min-width:1px!important;width:1px!important}.c-table.table.c-bordered td.c-sticky-left,.c-table.table.c-bordered th.c-sticky-left{border-left:0!important;border-right:0!important}.c-table.table.c-bordered td.c-sticky-all,.c-table.table.c-bordered th.c-sticky-all{border:0!important}.c-table.table thead.thead-light th{background-color:#eceff1;border-top:none!important;color:#2f3136;font-size:14px!important;height:40px;min-width:0}.c-table.table thead.thead-light th.c-cell{padding:3px 5px!important}.c-table.table thead.thead-light th .mat-checkbox label{margin-bottom:0}.c-table.table tbody tr:not(.c-no-hover):hover,.c-table.table tbody tr:not(.c-no-hover):hover td.c-sticky-left{background-color:#e3f2fd!important}.c-table.table tbody tr:not(.c-no-hover):nth-of-type(odd){background-color:#fafafa}.c-table.table tbody tr:not(.c-no-hover):nth-of-type(odd) .c-sticky-left{background-color:#fafafa!important}.c-table.table tbody tr:not(.c-no-hover):nth-of-type(odd) .c-sticky-left.c-sticky-spliter{background-color:#dee2e6!important;border:none!important}.c-table.table tbody tr:not(.c-no-hover):nth-of-type(odd) .c-sticky-left.c-selected{background-color:#2962ff!important}.c-table.table tbody tr:not(.c-no-hover):nth-of-type(odd) .c-sticky-left.c-error{background-color:#f82c13!important}.c-table.table tbody tr:not(.c-no-hover):nth-of-type(2n){background-color:#fff}.c-table.table tbody tr:not(.c-no-hover):nth-of-type(2n) .c-sticky-left{background-color:#fff!important}.c-table.table tbody tr:not(.c-no-hover):nth-of-type(2n) .c-sticky-left.c-sticky-spliter{background-color:#dee2e6!important;border:none!important}.c-table.table tbody tr:not(.c-no-hover):nth-of-type(2n) .c-sticky-left.c-selected{background-color:#2962ff!important}.c-table.table tbody tr:not(.c-no-hover):nth-of-type(2n) .c-sticky-left.c-error{background-color:#f82c13!important}.c-table.table tbody td{font-size:13px!important;min-height:25px;min-width:0}.c-table.table tbody td.c-cell{padding:3px 5px!important}.grid-header{overflow-x:hidden;overflow-y:hidden}.c-cell-padding{padding:3px 5px!important}.c-header-title{font-weight:500;text-transform:capitalize}span.c-header-title{display:block;overflow:hidden!important;padding:0 .3rem;text-overflow:ellipsis;white-space:nowrap}.status{border-radius:1.5rem;display:inline-block;font-weight:500;padding:4px 8px;text-align:center;text-transform:uppercase}.status.c-desktop-status{width:100%}.status.c-align-left{text-align:left!important}.status-success{color:#43a047}.status-danger{color:#f44336}.page-item{cursor:pointer}.sumarize{background-color:#00bcd4;border-radius:10rem;color:#fff;display:inline-block;font-size:12px;font-weight:500;line-height:1;padding:8px 12px;text-align:center;text-transform:uppercase;white-space:normal}.cursor-pointer{cursor:pointer}.c-overflow-x-hidden{overflow-x:hidden}.c-grid-header,.c-overflow-y-hidden{overflow-y:hidden}.c-grid-header{overflow-x:hidden}.c-input-xs{font-size:13px!important;height:28px!important;line-height:1.5!important;padding:3px!important}.c-sticky-top{top:0!important;z-index:20}.c-sticky-left{left:0;z-index:20}.c-sticky-all{left:0;top:0!important;z-index:30}.c-sticky-spliter{background-color:#dee2e6!important;border:none!important;z-index:40!important}.c-badge:not(.c-children){border-radius:10rem;display:block!important;font-size:12px;font-weight:500;margin:0 auto;max-width:80%;padding:.3rem!important}.c-badge.c-children{font-size:14px;font-weight:500;padding:5px!important}.blinker{-webkit-animation:blinker .5s linear infinite;animation:blinker .5s linear infinite;color:#1c87c9;font-weight:500}@-webkit-keyframes blinker{50%{opacity:0}}@keyframes blinker{50%{opacity:0}}.c-loading{opacity:.4}.c-loading-icon{left:calc(50% - 2.5rem);position:-webkit-sticky;position:sticky;top:calc(50% - 2.5rem)}.c-loading-margin{margin-top:-5rem}fieldset.c-fieldset-mobile{border:1px solid #e0e0e0;border-radius:5px;padding:3px 5px}legend.c-legend-mobile{border-bottom:none;font-size:16px;font-weight:500;margin:0 10px;padding:0 5px;width:auto}.c-mobile-box{border-top:none!important;box-shadow:0 0 3px 0 rgba(0,0,0,.3)}.c-mobile-body{margin-bottom:5px;margin-top:5px;overflow-x:auto}.c-mobile-item{border:1px solid #fff;border-radius:5px;box-shadow:0 0 3px 0 rgba(0,0,0,.3);margin:8px 0;padding:5px}.c-mobile-item.c-mobile-item-selected{border:2px solid #2962ff!important}.c-mobile-item:nth-of-type(odd){background-color:#fafafa}.c-mobile-item:nth-of-type(2n){background-color:#fff}.c-mobile-row{margin-bottom:3px;margin-top:0}.c-desktop-title{font-size:13px;line-height:1.7}.c-desktop-title,.c-mobile-title{color:#212529;font-weight:700;margin-right:3px}.c-mobile-title{font-size:14px}.c-children,.c-mobile-value{color:#212529;font-size:14px;overflow-wrap:break-word}.c-mobile-badge{font-size:14px;font-weight:500;padding:5px!important}.c-mobile-command{align-items:center;border-top:1px solid #f4f4f4;display:flex;justify-content:space-between;padding:5px 3px 0}.c-mobile-action{font-size:18px!important}.c-mobile-checkable{margin:5px 0 5px -5px!important}.c-m-3{margin:3px!important}.c-m-5{margin:5px!important}.c-w-1{min-width:1px;width:1px}.c-display-contents{display:contents}.w-20{width:20px!important}.c-btn-icon-30{height:30px;line-height:30px;width:30px}.c-btn-icon{background:none!important;border:none;display:inline-flex;height:16px;opacity:.8;padding:0 3px}.c-btn-icon:hover{cursor:pointer;opacity:1}.c-btn-icon:disabled{background:none!important;border:none;cursor:not-allowed;opacity:.3}:host td .mat-icon-button,:host th .mat-icon-button{height:24px;line-height:24px;width:24px}:host td .mat-icon-button .material-icons,:host th .mat-icon-button .material-icons{font-size:20px}:host ::ng-deep .mat-paginator-container{height:32px;min-height:32px}:host ::ng-deep .mat-paginator-container .mat-icon-button{height:28px;line-height:28px;width:28px}:host ::ng-deep .mat-form-field-wrapper{padding-bottom:0}:host ::ng-deep .mat-checkbox label{margin-bottom:0}"]
|
|
1764
1657
|
},] }
|
|
@@ -1773,7 +1666,7 @@ SdGrid.ctorParameters = () => [
|
|
|
1773
1666
|
{ type: DatePipe },
|
|
1774
1667
|
{ type: SdLoadingService },
|
|
1775
1668
|
{ type: SdApiService },
|
|
1776
|
-
{ type:
|
|
1669
|
+
{ type: SdExportService },
|
|
1777
1670
|
{ type: SdNotifyService },
|
|
1778
1671
|
{ type: EditorHandlerPipe }
|
|
1779
1672
|
];
|
|
@@ -2177,10 +2070,10 @@ SdGridPopupEditor.propDecorators = {
|
|
|
2177
2070
|
};
|
|
2178
2071
|
|
|
2179
2072
|
class SdGridPopupExportExcel {
|
|
2180
|
-
constructor(ref, loadingService,
|
|
2073
|
+
constructor(ref, loadingService, exportService, notifyService, translateService) {
|
|
2181
2074
|
this.ref = ref;
|
|
2182
2075
|
this.loadingService = loadingService;
|
|
2183
|
-
this.
|
|
2076
|
+
this.exportService = exportService;
|
|
2184
2077
|
this.notifyService = notifyService;
|
|
2185
2078
|
this.translateService = translateService;
|
|
2186
2079
|
this.prefix = 'Popup Export Excel';
|
|
@@ -2244,7 +2137,7 @@ class SdGridPopupExportExcel {
|
|
|
2244
2137
|
}
|
|
2245
2138
|
}
|
|
2246
2139
|
}
|
|
2247
|
-
return yield this.
|
|
2140
|
+
return yield this.exportService.generateTemplate({
|
|
2248
2141
|
fileName: fileName || this.fileName,
|
|
2249
2142
|
columns: this.generateExcelColumns(columns),
|
|
2250
2143
|
sheets
|
|
@@ -2257,10 +2150,7 @@ class SdGridPopupExportExcel {
|
|
|
2257
2150
|
});
|
|
2258
2151
|
this.generateTemplate = () => __awaiter(this, void 0, void 0, function* () {
|
|
2259
2152
|
this.loadingService.start();
|
|
2260
|
-
|
|
2261
|
-
if (result === null || result === void 0 ? void 0 : result.filePath) {
|
|
2262
|
-
this.excelService.downloadTemplate(result.filePath, `${this.fileName}.xlsx`);
|
|
2263
|
-
}
|
|
2153
|
+
yield this.initDefaultTemplate().finally(this.loadingService.stop);
|
|
2264
2154
|
});
|
|
2265
2155
|
this.generateAndUploadTemplate = (columns, fileName) => __awaiter(this, void 0, void 0, function* () {
|
|
2266
2156
|
var _b;
|
|
@@ -2285,10 +2175,13 @@ class SdGridPopupExportExcel {
|
|
|
2285
2175
|
}
|
|
2286
2176
|
}
|
|
2287
2177
|
}
|
|
2288
|
-
return yield this.
|
|
2289
|
-
|
|
2290
|
-
|
|
2291
|
-
|
|
2178
|
+
return yield this.exportService.generateUploadTemplate({
|
|
2179
|
+
key: this.fullKey,
|
|
2180
|
+
template: {
|
|
2181
|
+
fileName: fileName || this.fileName,
|
|
2182
|
+
columns: this.generateExcelColumns(columns),
|
|
2183
|
+
sheets
|
|
2184
|
+
}
|
|
2292
2185
|
});
|
|
2293
2186
|
});
|
|
2294
2187
|
this.onExportByTemplate = (excelConfig) => {
|
|
@@ -2301,21 +2194,24 @@ class SdGridPopupExportExcel {
|
|
|
2301
2194
|
this.ref.detectChanges();
|
|
2302
2195
|
};
|
|
2303
2196
|
this.uploadTemplate = () => __awaiter(this, void 0, void 0, function* () {
|
|
2304
|
-
const excelConfig = yield this.
|
|
2197
|
+
const excelConfig = yield this.exportService.uploadTemplate({
|
|
2198
|
+
key: this.fullKey,
|
|
2199
|
+
validator: this.validator
|
|
2200
|
+
});
|
|
2305
2201
|
this.excelConfigs.push({
|
|
2306
|
-
name: excelConfig.
|
|
2307
|
-
fullPath: excelConfig.
|
|
2202
|
+
name: excelConfig.fileName,
|
|
2203
|
+
fullPath: excelConfig.filePath,
|
|
2308
2204
|
removable: true
|
|
2309
2205
|
});
|
|
2310
2206
|
this.ref.detectChanges();
|
|
2311
2207
|
});
|
|
2312
2208
|
this.downloadTemplate = (excelConfig) => {
|
|
2313
|
-
this.
|
|
2209
|
+
this.exportService.download(excelConfig.fullPath, excelConfig.name);
|
|
2314
2210
|
};
|
|
2315
2211
|
this.removeTemplate = (excelConfig) => {
|
|
2316
2212
|
this.notifyService.confirm(this.translateService.translate('Remove template')).then(() => __awaiter(this, void 0, void 0, function* () {
|
|
2317
2213
|
this.loadingService.start();
|
|
2318
|
-
yield this.
|
|
2214
|
+
yield this.exportService.removeFile({ key: this.fullKey, fileName: excelConfig.name }).finally(this.loadingService.stop);
|
|
2319
2215
|
const idx = this.excelConfigs.indexOf(excelConfig);
|
|
2320
2216
|
this.excelConfigs.splice(idx, 1);
|
|
2321
2217
|
this.ref.detectChanges();
|
|
@@ -2347,13 +2243,13 @@ class SdGridPopupExportExcel {
|
|
|
2347
2243
|
});
|
|
2348
2244
|
}
|
|
2349
2245
|
}
|
|
2350
|
-
this.exportByTemplate.emit({
|
|
2351
|
-
|
|
2352
|
-
|
|
2353
|
-
|
|
2354
|
-
|
|
2355
|
-
|
|
2356
|
-
});
|
|
2246
|
+
// this.exportByTemplate.emit({
|
|
2247
|
+
// excelConfig: {
|
|
2248
|
+
// fullPath: result.filePath,
|
|
2249
|
+
// name: `[${this.fullKey}] Default.xlsx`
|
|
2250
|
+
// },
|
|
2251
|
+
// excelColumns
|
|
2252
|
+
// });
|
|
2357
2253
|
this.ref.detectChanges();
|
|
2358
2254
|
});
|
|
2359
2255
|
this.newTemplate = () => {
|
|
@@ -2442,7 +2338,12 @@ class SdGridPopupExportExcel {
|
|
|
2442
2338
|
loadConfiguration() {
|
|
2443
2339
|
return __awaiter(this, void 0, void 0, function* () {
|
|
2444
2340
|
this.excelConfigs = [];
|
|
2445
|
-
|
|
2341
|
+
const files = yield this.exportService.filesInFolder({ key: this.fullKey });
|
|
2342
|
+
this.excelConfigs = files.map(e => ({
|
|
2343
|
+
fullPath: e.filePath,
|
|
2344
|
+
name: e.fileName,
|
|
2345
|
+
removable: true
|
|
2346
|
+
}));
|
|
2446
2347
|
});
|
|
2447
2348
|
}
|
|
2448
2349
|
}
|
|
@@ -2456,7 +2357,7 @@ SdGridPopupExportExcel.decorators = [
|
|
|
2456
2357
|
SdGridPopupExportExcel.ctorParameters = () => [
|
|
2457
2358
|
{ type: ChangeDetectorRef },
|
|
2458
2359
|
{ type: SdLoadingService },
|
|
2459
|
-
{ type:
|
|
2360
|
+
{ type: SdExportService },
|
|
2460
2361
|
{ type: SdNotifyService },
|
|
2461
2362
|
{ type: SdTranslateService }
|
|
2462
2363
|
];
|