@sd-angular/core 1.3.239 → 1.3.240
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-export.umd.js +95 -88
- 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-table.umd.js +513 -89
- package/bundles/sd-angular-core-table.umd.js.map +1 -1
- package/bundles/sd-angular-core-table.umd.min.js +2 -2
- package/bundles/sd-angular-core-table.umd.min.js.map +1 -1
- package/esm2015/export/src/lib/export.service.js +93 -90
- package/esm2015/table/sd-angular-core-table.js +19 -18
- package/esm2015/table/src/lib/components/popup-export/popup-export.component.js +289 -0
- package/esm2015/table/src/lib/models/table-option-export.model.js +1 -1
- package/esm2015/table/src/lib/table.component.js +32 -16
- package/esm2015/table/src/lib/table.module.js +5 -1
- package/export/src/lib/export.service.d.ts +4 -0
- package/fesm2015/sd-angular-core-export.js +92 -89
- package/fesm2015/sd-angular-core-export.js.map +1 -1
- package/fesm2015/sd-angular-core-table.js +318 -17
- package/fesm2015/sd-angular-core-table.js.map +1 -1
- package/package.json +1 -1
- package/{sd-angular-core-1.3.239.tgz → sd-angular-core-1.3.240.tgz} +0 -0
- package/table/sd-angular-core-table.d.ts +18 -17
- package/table/sd-angular-core-table.metadata.json +1 -1
- package/table/src/lib/components/popup-export/popup-export.component.d.ts +56 -0
- package/table/src/lib/models/table-option-export.model.d.ts +7 -6
- package/table/src/lib/table.component.d.ts +8 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
(function (global, factory) {
|
|
2
|
-
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@sd-angular/core/common'), require('@angular/core'), require('@angular/common'), require('@angular/material/icon'), require('@angular/material/paginator'), require('@angular/material/sort'), require('@angular/material/table'), require('@angular/animations'), require('uuid'), require('rxjs'), require('@sd-angular/core/notify'), require('rxjs/operators'), require('@sd-angular/core/modal'), require('ngx-device-detector'), require('@sd-angular/core/export'), require('@sd-angular/core/setting'), require('@sd-angular/core/quick-action'), require('object-hash'), require('@angular/cdk/drag-drop'), require('@sd-angular/core/loading'), require('@angular/material/progress-spinner'), require('@angular/cdk/table'), require('@angular/material/menu'), require('@angular/material/button'), require('@sd-angular/core/service'), require('@angular/material/tooltip'), require('@angular/material/slide-toggle'), require('@sd-angular/core/form'), require('@angular/material/checkbox'), require('@angular/material/list'), require('@sd-angular/core/group')) :
|
|
3
|
-
typeof define === 'function' && define.amd ? define('@sd-angular/core/table', ['exports', '@sd-angular/core/common', '@angular/core', '@angular/common', '@angular/material/icon', '@angular/material/paginator', '@angular/material/sort', '@angular/material/table', '@angular/animations', 'uuid', 'rxjs', '@sd-angular/core/notify', 'rxjs/operators', '@sd-angular/core/modal', 'ngx-device-detector', '@sd-angular/core/export', '@sd-angular/core/setting', '@sd-angular/core/quick-action', 'object-hash', '@angular/cdk/drag-drop', '@sd-angular/core/loading', '@angular/material/progress-spinner', '@angular/cdk/table', '@angular/material/menu', '@angular/material/button', '@sd-angular/core/service', '@angular/material/tooltip', '@angular/material/slide-toggle', '@sd-angular/core/form', '@angular/material/checkbox', '@angular/material/list', '@sd-angular/core/group'], factory) :
|
|
4
|
-
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global['sd-angular'] = global['sd-angular'] || {}, global['sd-angular'].core = global['sd-angular'].core || {}, global['sd-angular'].core.table = {}), global['sd-angular'].core.common, global.ng.core, global.ng.common, global.ng.material.icon, global.ng.material.paginator, global.ng.material.sort, global.ng.material.table, global.ng.animations, global.uuid, global.rxjs, global['sd-angular'].core.notify, global.rxjs.operators, global['sd-angular'].core.modal, global['ngx-device-detector'], global['sd-angular'].core.export, global['sd-angular'].core.setting, global['sd-angular'].core['quick-action'], global['object-hash'], global.ng.cdk.dragDrop, global['sd-angular'].core.loading, global.ng.material.progressSpinner, global.ng.cdk.table, global.ng.material.menu, global.ng.material.button, global['sd-angular'].core.service, global.ng.material.tooltip, global.ng.material.slideToggle, global['sd-angular'].core.form, global.ng.material.checkbox, global.ng.material.list, global['sd-angular'].core.group));
|
|
5
|
-
}(this, (function (exports, common, core, common$1, icon, paginator, sort, table, animations, uuid, rxjs, notify, operators, modal, ngxDeviceDetector, _export, setting, quickAction, hash, dragDrop, loading, progressSpinner, table$1, menu, button, service, tooltip, slideToggle, form, checkbox, list, group) { 'use strict';
|
|
2
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@sd-angular/core/common'), require('@angular/core'), require('@angular/common'), require('@angular/material/icon'), require('@angular/material/paginator'), require('@angular/material/sort'), require('@angular/material/table'), require('@angular/animations'), require('uuid'), require('rxjs'), require('@sd-angular/core/notify'), require('rxjs/operators'), require('@sd-angular/core/modal'), require('ngx-device-detector'), require('@sd-angular/core/export'), require('@sd-angular/core/setting'), require('@sd-angular/core/quick-action'), require('object-hash'), require('@angular/cdk/drag-drop'), require('@sd-angular/core/loading'), require('@sd-angular/core/translate'), require('@angular/forms'), require('@angular/material/progress-spinner'), require('@angular/cdk/table'), require('@angular/material/menu'), require('@angular/material/button'), require('@sd-angular/core/service'), require('@angular/material/tooltip'), require('@angular/material/slide-toggle'), require('@sd-angular/core/form'), require('@angular/material/checkbox'), require('@angular/material/list'), require('@sd-angular/core/group'), require('@angular/material/chips')) :
|
|
3
|
+
typeof define === 'function' && define.amd ? define('@sd-angular/core/table', ['exports', '@sd-angular/core/common', '@angular/core', '@angular/common', '@angular/material/icon', '@angular/material/paginator', '@angular/material/sort', '@angular/material/table', '@angular/animations', 'uuid', 'rxjs', '@sd-angular/core/notify', 'rxjs/operators', '@sd-angular/core/modal', 'ngx-device-detector', '@sd-angular/core/export', '@sd-angular/core/setting', '@sd-angular/core/quick-action', 'object-hash', '@angular/cdk/drag-drop', '@sd-angular/core/loading', '@sd-angular/core/translate', '@angular/forms', '@angular/material/progress-spinner', '@angular/cdk/table', '@angular/material/menu', '@angular/material/button', '@sd-angular/core/service', '@angular/material/tooltip', '@angular/material/slide-toggle', '@sd-angular/core/form', '@angular/material/checkbox', '@angular/material/list', '@sd-angular/core/group', '@angular/material/chips'], factory) :
|
|
4
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global['sd-angular'] = global['sd-angular'] || {}, global['sd-angular'].core = global['sd-angular'].core || {}, global['sd-angular'].core.table = {}), global['sd-angular'].core.common, global.ng.core, global.ng.common, global.ng.material.icon, global.ng.material.paginator, global.ng.material.sort, global.ng.material.table, global.ng.animations, global.uuid, global.rxjs, global['sd-angular'].core.notify, global.rxjs.operators, global['sd-angular'].core.modal, global['ngx-device-detector'], global['sd-angular'].core.export, global['sd-angular'].core.setting, global['sd-angular'].core['quick-action'], global['object-hash'], global.ng.cdk.dragDrop, global['sd-angular'].core.loading, global['sd-angular'].core.translate, global.ng.forms, global.ng.material.progressSpinner, global.ng.cdk.table, global.ng.material.menu, global.ng.material.button, global['sd-angular'].core.service, global.ng.material.tooltip, global.ng.material.slideToggle, global['sd-angular'].core.form, global.ng.material.checkbox, global.ng.material.list, global['sd-angular'].core.group, global.ng.material.chips));
|
|
5
|
+
}(this, (function (exports, common, core, common$1, icon, paginator, sort, table, animations, uuid, rxjs, notify, operators, modal, ngxDeviceDetector, _export, setting, quickAction, hash, dragDrop, loading, translate, forms, progressSpinner, table$1, menu, button, service, tooltip, slideToggle, form, checkbox, list, group, chips) { 'use strict';
|
|
6
6
|
|
|
7
7
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
8
8
|
|
|
@@ -1211,7 +1211,409 @@
|
|
|
1211
1211
|
mouseUp: [{ type: core.HostListener, args: ['window:mouseup', ['$event'],] }]
|
|
1212
1212
|
};
|
|
1213
1213
|
|
|
1214
|
-
var
|
|
1214
|
+
var _getExportableColumns, _getExportColumns, _initTemplate;
|
|
1215
|
+
var SdPopupExport = /** @class */ (function () {
|
|
1216
|
+
function SdPopupExport(ref, loadingService, exportService, notifyService, translateService) {
|
|
1217
|
+
var _this = this;
|
|
1218
|
+
this.ref = ref;
|
|
1219
|
+
this.loadingService = loadingService;
|
|
1220
|
+
this.exportService = exportService;
|
|
1221
|
+
this.notifyService = notifyService;
|
|
1222
|
+
this.translateService = translateService;
|
|
1223
|
+
this.columns = [];
|
|
1224
|
+
this.enableCreating = false;
|
|
1225
|
+
this.selected = {};
|
|
1226
|
+
this.files = [];
|
|
1227
|
+
this.export = new core.EventEmitter();
|
|
1228
|
+
this.form = new forms.FormGroup({});
|
|
1229
|
+
_getExportableColumns.set(this, function () {
|
|
1230
|
+
return __spread(_this.tableColumns, _this.additionalColumns);
|
|
1231
|
+
});
|
|
1232
|
+
this.open = function () { return __awaiter(_this, void 0, void 0, function () {
|
|
1233
|
+
return __generator(this, function (_l) {
|
|
1234
|
+
if (!this.key) {
|
|
1235
|
+
this.exportDefault();
|
|
1236
|
+
return [2 /*return*/];
|
|
1237
|
+
}
|
|
1238
|
+
this.loadFiles(null);
|
|
1239
|
+
this.selected = {};
|
|
1240
|
+
this.modal.open();
|
|
1241
|
+
this.ref.detectChanges();
|
|
1242
|
+
return [2 /*return*/];
|
|
1243
|
+
});
|
|
1244
|
+
}); };
|
|
1245
|
+
_getExportColumns.set(this, function () {
|
|
1246
|
+
if (_this.configuration) {
|
|
1247
|
+
var columns_1 = __spread(_this.tableColumns);
|
|
1248
|
+
var _l = _this.configuration, firstColumns = _l.firstColumns, secondColumns = _l.secondColumns;
|
|
1249
|
+
var displayColumns = __spread(firstColumns, secondColumns).reduce(function (first, next) {
|
|
1250
|
+
var column = _this.tableOption.columns.find(function (e) { return e.field === next.field; });
|
|
1251
|
+
if (!column) {
|
|
1252
|
+
return first;
|
|
1253
|
+
}
|
|
1254
|
+
if (column.type !== 'children') {
|
|
1255
|
+
return __spread(first, [column]);
|
|
1256
|
+
}
|
|
1257
|
+
return __spread(first, column.children);
|
|
1258
|
+
}, []);
|
|
1259
|
+
var results = displayColumns
|
|
1260
|
+
.map(function (e) { return (Object.assign(Object.assign({}, e), { data: columns_1.find(function (e1) { return e1.field === e.field; }) })); })
|
|
1261
|
+
.filter(function (e) { return !!e.data; })
|
|
1262
|
+
.map(function (e) { return e.data; });
|
|
1263
|
+
return __spread(results, _this.additionalColumns);
|
|
1264
|
+
}
|
|
1265
|
+
else {
|
|
1266
|
+
return _this.columns;
|
|
1267
|
+
}
|
|
1268
|
+
});
|
|
1269
|
+
this.exportDefault = function () {
|
|
1270
|
+
_this.export.emit({
|
|
1271
|
+
file: null,
|
|
1272
|
+
columns: __classPrivateFieldGet(_this, _getExportColumns).call(_this),
|
|
1273
|
+
isCSV: false,
|
|
1274
|
+
});
|
|
1275
|
+
};
|
|
1276
|
+
this.exportCSV = function () {
|
|
1277
|
+
_this.export.emit({
|
|
1278
|
+
file: null,
|
|
1279
|
+
columns: __classPrivateFieldGet(_this, _getExportColumns).call(_this),
|
|
1280
|
+
isCSV: true,
|
|
1281
|
+
});
|
|
1282
|
+
};
|
|
1283
|
+
this.loadFiles = function (group) {
|
|
1284
|
+
if (group === void 0) { group = null; }
|
|
1285
|
+
return __awaiter(_this, void 0, void 0, function () {
|
|
1286
|
+
var _l;
|
|
1287
|
+
return __generator(this, function (_m) {
|
|
1288
|
+
switch (_m.label) {
|
|
1289
|
+
case 0:
|
|
1290
|
+
_l = this;
|
|
1291
|
+
return [4 /*yield*/, this.exportService.filesInFolder({
|
|
1292
|
+
key: this.key,
|
|
1293
|
+
group: group,
|
|
1294
|
+
})];
|
|
1295
|
+
case 1:
|
|
1296
|
+
_l.files = _m.sent();
|
|
1297
|
+
this.ref.markForCheck();
|
|
1298
|
+
return [2 /*return*/];
|
|
1299
|
+
}
|
|
1300
|
+
});
|
|
1301
|
+
});
|
|
1302
|
+
};
|
|
1303
|
+
_initTemplate.set(this, function (fileName) { return __awaiter(_this, void 0, void 0, function () {
|
|
1304
|
+
var _a, _b, _c, _d, sheets, _l, _m, sheet, _o, _p, _q, e_1_1;
|
|
1305
|
+
var e_1, _r;
|
|
1306
|
+
return __generator(this, function (_s) {
|
|
1307
|
+
switch (_s.label) {
|
|
1308
|
+
case 0:
|
|
1309
|
+
sheets = [];
|
|
1310
|
+
if (!Array.isArray((_b = (_a = this.tableOption) === null || _a === void 0 ? void 0 : _a.export) === null || _b === void 0 ? void 0 : _b.sheets)) return [3 /*break*/, 9];
|
|
1311
|
+
_s.label = 1;
|
|
1312
|
+
case 1:
|
|
1313
|
+
_s.trys.push([1, 7, 8, 9]);
|
|
1314
|
+
_l = __values(this.tableOption.export.sheets), _m = _l.next();
|
|
1315
|
+
_s.label = 2;
|
|
1316
|
+
case 2:
|
|
1317
|
+
if (!!_m.done) return [3 /*break*/, 6];
|
|
1318
|
+
sheet = _m.value;
|
|
1319
|
+
if (!(sheet.name && sheet.items && sheet.fields)) return [3 /*break*/, 5];
|
|
1320
|
+
if (!Array.isArray(sheet.items)) return [3 /*break*/, 3];
|
|
1321
|
+
sheets.push({
|
|
1322
|
+
name: sheet.name,
|
|
1323
|
+
items: sheet.items,
|
|
1324
|
+
fields: sheet.fields,
|
|
1325
|
+
});
|
|
1326
|
+
return [3 /*break*/, 5];
|
|
1327
|
+
case 3:
|
|
1328
|
+
_p = (_o = sheets).push;
|
|
1329
|
+
_q = {
|
|
1330
|
+
name: sheet.name
|
|
1331
|
+
};
|
|
1332
|
+
return [4 /*yield*/, sheet.items()];
|
|
1333
|
+
case 4:
|
|
1334
|
+
_p.apply(_o, [(_q.items = _s.sent(),
|
|
1335
|
+
_q.fields = sheet.fields,
|
|
1336
|
+
_q)]);
|
|
1337
|
+
_s.label = 5;
|
|
1338
|
+
case 5:
|
|
1339
|
+
_m = _l.next();
|
|
1340
|
+
return [3 /*break*/, 2];
|
|
1341
|
+
case 6: return [3 /*break*/, 9];
|
|
1342
|
+
case 7:
|
|
1343
|
+
e_1_1 = _s.sent();
|
|
1344
|
+
e_1 = { error: e_1_1 };
|
|
1345
|
+
return [3 /*break*/, 9];
|
|
1346
|
+
case 8:
|
|
1347
|
+
try {
|
|
1348
|
+
if (_m && !_m.done && (_r = _l.return)) _r.call(_l);
|
|
1349
|
+
}
|
|
1350
|
+
finally { if (e_1) throw e_1.error; }
|
|
1351
|
+
return [7 /*endfinally*/];
|
|
1352
|
+
case 9: return [4 /*yield*/, this.exportService.generateTemplate({
|
|
1353
|
+
fileName: fileName || ((_d = (_c = this.tableOption) === null || _c === void 0 ? void 0 : _c.export) === null || _d === void 0 ? void 0 : _d.fileName),
|
|
1354
|
+
columns: this.columns,
|
|
1355
|
+
sheets: sheets,
|
|
1356
|
+
})];
|
|
1357
|
+
case 10: return [2 /*return*/, _s.sent()];
|
|
1358
|
+
}
|
|
1359
|
+
});
|
|
1360
|
+
}); });
|
|
1361
|
+
this.generateTemplate = function () { return __awaiter(_this, void 0, void 0, function () {
|
|
1362
|
+
return __generator(this, function (_l) {
|
|
1363
|
+
switch (_l.label) {
|
|
1364
|
+
case 0:
|
|
1365
|
+
this.loadingService.start();
|
|
1366
|
+
return [4 /*yield*/, __classPrivateFieldGet(this, _initTemplate).call(this).finally(this.loadingService.stop)];
|
|
1367
|
+
case 1:
|
|
1368
|
+
_l.sent();
|
|
1369
|
+
return [2 /*return*/];
|
|
1370
|
+
}
|
|
1371
|
+
});
|
|
1372
|
+
}); };
|
|
1373
|
+
this.generateAndUploadTemplate = function (fileName) { return __awaiter(_this, void 0, void 0, function () {
|
|
1374
|
+
var _e, _f, _g, _h, _j, _k, sheets, _l, _m, sheet, _o, _p, _q, e_2_1;
|
|
1375
|
+
var e_2, _r;
|
|
1376
|
+
var _this = this;
|
|
1377
|
+
return __generator(this, function (_s) {
|
|
1378
|
+
switch (_s.label) {
|
|
1379
|
+
case 0:
|
|
1380
|
+
sheets = [];
|
|
1381
|
+
if (!Array.isArray((_f = (_e = this.tableOption) === null || _e === void 0 ? void 0 : _e.export) === null || _f === void 0 ? void 0 : _f.sheets)) return [3 /*break*/, 9];
|
|
1382
|
+
_s.label = 1;
|
|
1383
|
+
case 1:
|
|
1384
|
+
_s.trys.push([1, 7, 8, 9]);
|
|
1385
|
+
_l = __values((_h = (_g = this.tableOption) === null || _g === void 0 ? void 0 : _g.export) === null || _h === void 0 ? void 0 : _h.sheets), _m = _l.next();
|
|
1386
|
+
_s.label = 2;
|
|
1387
|
+
case 2:
|
|
1388
|
+
if (!!_m.done) return [3 /*break*/, 6];
|
|
1389
|
+
sheet = _m.value;
|
|
1390
|
+
if (!(sheet.name && sheet.items && sheet.fields)) return [3 /*break*/, 5];
|
|
1391
|
+
if (!Array.isArray(sheet.items)) return [3 /*break*/, 3];
|
|
1392
|
+
sheets.push({
|
|
1393
|
+
name: sheet.name,
|
|
1394
|
+
items: sheet.items,
|
|
1395
|
+
fields: sheet.fields,
|
|
1396
|
+
});
|
|
1397
|
+
return [3 /*break*/, 5];
|
|
1398
|
+
case 3:
|
|
1399
|
+
_p = (_o = sheets).push;
|
|
1400
|
+
_q = {
|
|
1401
|
+
name: sheet.name
|
|
1402
|
+
};
|
|
1403
|
+
return [4 /*yield*/, sheet.items()];
|
|
1404
|
+
case 4:
|
|
1405
|
+
_p.apply(_o, [(_q.items = _s.sent(),
|
|
1406
|
+
_q.fields = sheet.fields,
|
|
1407
|
+
_q)]);
|
|
1408
|
+
_s.label = 5;
|
|
1409
|
+
case 5:
|
|
1410
|
+
_m = _l.next();
|
|
1411
|
+
return [3 /*break*/, 2];
|
|
1412
|
+
case 6: return [3 /*break*/, 9];
|
|
1413
|
+
case 7:
|
|
1414
|
+
e_2_1 = _s.sent();
|
|
1415
|
+
e_2 = { error: e_2_1 };
|
|
1416
|
+
return [3 /*break*/, 9];
|
|
1417
|
+
case 8:
|
|
1418
|
+
try {
|
|
1419
|
+
if (_m && !_m.done && (_r = _l.return)) _r.call(_l);
|
|
1420
|
+
}
|
|
1421
|
+
finally { if (e_2) throw e_2.error; }
|
|
1422
|
+
return [7 /*endfinally*/];
|
|
1423
|
+
case 9: return [4 /*yield*/, this.exportService.generateUploadTemplate({
|
|
1424
|
+
key: this.key,
|
|
1425
|
+
template: {
|
|
1426
|
+
fileName: fileName || ((_k = (_j = this.tableOption) === null || _j === void 0 ? void 0 : _j.export) === null || _k === void 0 ? void 0 : _k.fileName),
|
|
1427
|
+
columns: this.columns.filter(function (e) { return _this.selected[e.field]; }),
|
|
1428
|
+
sheets: sheets,
|
|
1429
|
+
},
|
|
1430
|
+
})];
|
|
1431
|
+
case 10: return [2 /*return*/, _s.sent()];
|
|
1432
|
+
}
|
|
1433
|
+
});
|
|
1434
|
+
}); };
|
|
1435
|
+
this.onExport = function (file) {
|
|
1436
|
+
_this.export.emit({
|
|
1437
|
+
file: file,
|
|
1438
|
+
columns: _this.columns,
|
|
1439
|
+
});
|
|
1440
|
+
_this.ref.detectChanges();
|
|
1441
|
+
};
|
|
1442
|
+
this.uploadTemplate = function () { return __awaiter(_this, void 0, void 0, function () {
|
|
1443
|
+
var file;
|
|
1444
|
+
return __generator(this, function (_l) {
|
|
1445
|
+
switch (_l.label) {
|
|
1446
|
+
case 0: return [4 /*yield*/, this.exportService.uploadTemplate({
|
|
1447
|
+
key: this.key,
|
|
1448
|
+
})];
|
|
1449
|
+
case 1:
|
|
1450
|
+
file = _l.sent();
|
|
1451
|
+
if (file) {
|
|
1452
|
+
this.files = __spread(this.files, [file]);
|
|
1453
|
+
this.ref.detectChanges();
|
|
1454
|
+
}
|
|
1455
|
+
return [2 /*return*/];
|
|
1456
|
+
}
|
|
1457
|
+
});
|
|
1458
|
+
}); };
|
|
1459
|
+
this.removeFile = function (file) {
|
|
1460
|
+
_this.notifyService.confirm(_this.translateService.translate('Remove template')).then(function () {
|
|
1461
|
+
_this.exportService.removeFile({
|
|
1462
|
+
key: _this.key,
|
|
1463
|
+
fileName: file.fileName,
|
|
1464
|
+
});
|
|
1465
|
+
var idx = _this.files.indexOf(file);
|
|
1466
|
+
_this.files.splice(idx, 1);
|
|
1467
|
+
_this.files = __spread(_this.files);
|
|
1468
|
+
_this.ref.detectChanges();
|
|
1469
|
+
});
|
|
1470
|
+
};
|
|
1471
|
+
this.createTemplate = function () { return __awaiter(_this, void 0, void 0, function () {
|
|
1472
|
+
var fileName, result, file;
|
|
1473
|
+
var _this = this;
|
|
1474
|
+
return __generator(this, function (_l) {
|
|
1475
|
+
switch (_l.label) {
|
|
1476
|
+
case 0:
|
|
1477
|
+
if (this.form.invalid) {
|
|
1478
|
+
this.form.markAllAsTouched();
|
|
1479
|
+
return [2 /*return*/];
|
|
1480
|
+
}
|
|
1481
|
+
if (!this.columns.some(function (e) { return _this.selected[e.field]; })) {
|
|
1482
|
+
this.notifyService.notify.warning("Vui l\u00F2ng ch\u1ECDn c\u1ED9t d\u1EEF li\u1EC7u \u0111\u1EC3 xu\u1EA5t");
|
|
1483
|
+
return [2 /*return*/];
|
|
1484
|
+
}
|
|
1485
|
+
this.loadingService.start();
|
|
1486
|
+
fileName = this.templateName + '.xlsx';
|
|
1487
|
+
_l.label = 1;
|
|
1488
|
+
case 1:
|
|
1489
|
+
_l.trys.push([1, , 3, 4]);
|
|
1490
|
+
return [4 /*yield*/, this.generateAndUploadTemplate(fileName)];
|
|
1491
|
+
case 2:
|
|
1492
|
+
result = _l.sent();
|
|
1493
|
+
if (result === null || result === void 0 ? void 0 : result.filePath) {
|
|
1494
|
+
file = {
|
|
1495
|
+
filePath: result.filePath,
|
|
1496
|
+
fileName: result.fileName,
|
|
1497
|
+
};
|
|
1498
|
+
this.onExport(file);
|
|
1499
|
+
this.templateName = null;
|
|
1500
|
+
this.enableCreating = false;
|
|
1501
|
+
this.files = __spread(this.files, [file]);
|
|
1502
|
+
this.ref.detectChanges();
|
|
1503
|
+
}
|
|
1504
|
+
return [3 /*break*/, 4];
|
|
1505
|
+
case 3:
|
|
1506
|
+
this.loadingService.stop();
|
|
1507
|
+
return [7 /*endfinally*/];
|
|
1508
|
+
case 4: return [2 /*return*/];
|
|
1509
|
+
}
|
|
1510
|
+
});
|
|
1511
|
+
}); };
|
|
1512
|
+
this.templateNameValidator = function (val) {
|
|
1513
|
+
var translate = _this.translateService.translate;
|
|
1514
|
+
var regex = /^[A-Za-z0-9 _]*[A-Za-z0-9][A-Za-z0-9 _]*$/;
|
|
1515
|
+
if (!val) {
|
|
1516
|
+
return translate('Please enter your template name');
|
|
1517
|
+
}
|
|
1518
|
+
if (val.length > 50) {
|
|
1519
|
+
return translate('Template name is too long');
|
|
1520
|
+
}
|
|
1521
|
+
if (!regex.test(val)) {
|
|
1522
|
+
return translate('Template name only contains letters, numbers and spaces');
|
|
1523
|
+
}
|
|
1524
|
+
return null;
|
|
1525
|
+
};
|
|
1526
|
+
}
|
|
1527
|
+
Object.defineProperty(SdPopupExport.prototype, "_tableOption", {
|
|
1528
|
+
set: function (option) {
|
|
1529
|
+
this.tableOption = option;
|
|
1530
|
+
this.columns = __classPrivateFieldGet(this, _getExportableColumns).call(this);
|
|
1531
|
+
},
|
|
1532
|
+
enumerable: false,
|
|
1533
|
+
configurable: true
|
|
1534
|
+
});
|
|
1535
|
+
Object.defineProperty(SdPopupExport.prototype, "key", {
|
|
1536
|
+
get: function () {
|
|
1537
|
+
var _a, _b, _c, _d;
|
|
1538
|
+
var prefix = '93889e78-f971-4a1d-8c73-fe2321af9233';
|
|
1539
|
+
if (!((_b = (_a = this.tableOption) === null || _a === void 0 ? void 0 : _a.export) === null || _b === void 0 ? void 0 : _b.key)) {
|
|
1540
|
+
return null;
|
|
1541
|
+
}
|
|
1542
|
+
return hash__default['default']({
|
|
1543
|
+
prefix: prefix,
|
|
1544
|
+
key: (_d = (_c = this.tableOption) === null || _c === void 0 ? void 0 : _c.export) === null || _d === void 0 ? void 0 : _d.key,
|
|
1545
|
+
});
|
|
1546
|
+
},
|
|
1547
|
+
enumerable: false,
|
|
1548
|
+
configurable: true
|
|
1549
|
+
});
|
|
1550
|
+
Object.defineProperty(SdPopupExport.prototype, "tableColumns", {
|
|
1551
|
+
get: function () {
|
|
1552
|
+
var columns = [];
|
|
1553
|
+
this.tableOption.columns
|
|
1554
|
+
.filter(function (e) { var _a; return !((_a = e.export) === null || _a === void 0 ? void 0 : _a.disabled); })
|
|
1555
|
+
.forEach(function (column) {
|
|
1556
|
+
var _a;
|
|
1557
|
+
if (column.type === 'children') {
|
|
1558
|
+
(_a = column.children) === null || _a === void 0 ? void 0 : _a.filter(function (e) { var _a; return !((_a = e.export) === null || _a === void 0 ? void 0 : _a.disabled); }).forEach(function (childColumn) {
|
|
1559
|
+
columns.push(childColumn);
|
|
1560
|
+
});
|
|
1561
|
+
return;
|
|
1562
|
+
}
|
|
1563
|
+
columns.push(column);
|
|
1564
|
+
});
|
|
1565
|
+
return columns.map(function (e) { return ({
|
|
1566
|
+
field: e.field,
|
|
1567
|
+
title: e.title,
|
|
1568
|
+
description: e.description,
|
|
1569
|
+
width: e.width,
|
|
1570
|
+
}); });
|
|
1571
|
+
},
|
|
1572
|
+
enumerable: false,
|
|
1573
|
+
configurable: true
|
|
1574
|
+
});
|
|
1575
|
+
Object.defineProperty(SdPopupExport.prototype, "additionalColumns", {
|
|
1576
|
+
get: function () {
|
|
1577
|
+
var _a, _b;
|
|
1578
|
+
return (((_b = (_a = this.tableOption.export) === null || _a === void 0 ? void 0 : _a.columns) === null || _b === void 0 ? void 0 : _b.filter(function (e) { var _a; return !((_a = e.export) === null || _a === void 0 ? void 0 : _a.disabled); })) || []).map(function (e) { return ({
|
|
1579
|
+
field: e.field,
|
|
1580
|
+
title: e.title,
|
|
1581
|
+
description: e.description,
|
|
1582
|
+
width: e.width,
|
|
1583
|
+
}); });
|
|
1584
|
+
},
|
|
1585
|
+
enumerable: false,
|
|
1586
|
+
configurable: true
|
|
1587
|
+
});
|
|
1588
|
+
SdPopupExport.prototype.ngOnInit = function () { };
|
|
1589
|
+
SdPopupExport.prototype.ngAfterViewInit = function () { };
|
|
1590
|
+
return SdPopupExport;
|
|
1591
|
+
}());
|
|
1592
|
+
_getExportableColumns = new WeakMap(), _getExportColumns = new WeakMap(), _initTemplate = new WeakMap();
|
|
1593
|
+
SdPopupExport.decorators = [
|
|
1594
|
+
{ type: core.Component, args: [{
|
|
1595
|
+
selector: 'sd-popup-export',
|
|
1596
|
+
template: "<sd-modal width=\"907px\" [title]=\"'Exported template' | sdTranslate\" #modal>\r\n <sd-modal-body>\r\n <div class=\"row\">\r\n <ng-template #noSelection>\r\n <div class=\"col-12\">\r\n <ng-container *ngTemplateOutlet=\"content\"></ng-container>\r\n </div>\r\n </ng-template>\r\n <ng-template #content>\r\n <div class=\"row\">\r\n <div *ngIf=\"!files?.length\" class=\"col-12\">\r\n <div class=\"c-empty\">\r\n <img class=\"c-empty-image\" />\r\n <div class=\"T14R\">{{ 'There are no exported templates' | sdTranslate }}</div>\r\n </div>\r\n </div>\r\n <ng-container *ngIf=\"files?.length\">\r\n <div class=\"col-12\">\r\n <div class=\"c-table\" style=\"max-height: 50vh\">\r\n <table mat-table [dataSource]=\"files\">\r\n <ng-container matColumnDef=\"stt\">\r\n <th mat-header-cell class=\"c-th text-center px-5\" *matHeaderCellDef style=\"width: 50px\">#</th>\r\n <td class=\"text-center px-5\" mat-cell *matCellDef=\"let item; let idx = index\">\r\n {{ idx + 1 }}\r\n </td>\r\n </ng-container>\r\n <ng-container matColumnDef=\"fileName\">\r\n <th mat-header-cell class=\"c-th px-5\" *matHeaderCellDef>{{ 'File name' | sdTranslate }}</th>\r\n <td class=\"px-5\" mat-cell *matCellDef=\"let item\">\r\n {{ item.fileName }}\r\n </td>\r\n </ng-container>\r\n <ng-container matColumnDef=\"action\">\r\n <th mat-header-cell class=\"c-th px-5\" *matHeaderCellDef style=\"width: 80px\"></th>\r\n <td class=\"px-5\" mat-cell *matCellDef=\"let item\">\r\n <div class=\"d-flex\">\r\n <button mat-icon-button aria-label=\"delete\" (click)=\"removeFile(item)\">\r\n <mat-icon>delete</mat-icon>\r\n </button>\r\n <button mat-icon-button aria-label=\"download\" (click)=\"onExport(item)\">\r\n <mat-icon>download</mat-icon>\r\n </button>\r\n </div>\r\n </td>\r\n </ng-container>\r\n <tr mat-header-row *matHeaderRowDef=\"['stt', 'fileName', 'action']; sticky: true\"></tr>\r\n <tr mat-row *matRowDef=\"let row; columns: ['stt', 'fileName', 'action']\"></tr>\r\n </table>\r\n </div>\r\n </div>\r\n <div *ngIf=\"files.length < 5\" class=\"col-12 mt-10\">\r\n <sd-button\r\n class=\"mr-5\"\r\n [title]=\"'New template' | sdTranslate\"\r\n (action)=\"enableCreating = true\"\r\n color=\"info\"\r\n [disabled]=\"enableCreating\">\r\n </sd-button>\r\n <sd-button\r\n *ngIf=\"tableOption?.export?.enableUpload\"\r\n [title]=\"'Upload template' | sdTranslate\"\r\n (action)=\"uploadTemplate()\"\r\n type=\"outline\">\r\n </sd-button>\r\n </div>\r\n </ng-container>\r\n <ng-container *ngIf=\"enableCreating || !files?.length\">\r\n <div class=\"col-12 mt-20\">\r\n <div class=\"T14R\">{{ 'Select columns for creating template' | sdTranslate }}:</div>\r\n </div>\r\n <div class=\"col-12\">\r\n <mat-chip-list selectable=\"true\" multiple=\"true\">\r\n <ng-container *ngFor=\"let column of columns\">\r\n <mat-chip [selected]=\"selected[column.field]\" (click)=\"selected[column.field] = !selected[column.field]\">\r\n {{ column.title }}\r\n </mat-chip>\r\n </ng-container>\r\n </mat-chip-list>\r\n </div>\r\n <div class=\"col-12 row\">\r\n <div class=\"col-10\">\r\n <sd-input\r\n [form]=\"form\"\r\n [label]=\"'Template name' | sdTranslate\"\r\n [(model)]=\"templateName\"\r\n [validator]=\"templateNameValidator\"></sd-input>\r\n </div>\r\n <div class=\"col-2 mt-8\">\r\n <sd-button width=\"100%\" [title]=\"'Save' | sdTranslate\" color=\"info\" (action)=\"createTemplate()\"> </sd-button>\r\n </div>\r\n </div>\r\n </ng-container>\r\n </div>\r\n </ng-template>\r\n </div>\r\n </sd-modal-body>\r\n</sd-modal>\r\n",
|
|
1597
|
+
changeDetection: core.ChangeDetectionStrategy.OnPush,
|
|
1598
|
+
styles: [".c-radio-group{display:flex;flex-direction:column;margin:15px 0}.c-radio-button{margin:5px}.c-empty{align-items:center;background:#f6f6f6;border-radius:4px;display:flex;flex-direction:column;height:116px;justify-content:center;position:static}.c-empty .c-empty-image{content:url(\"data:image/png;base64,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\")}.c-table{overflow:auto;position:relative}.c-table table{width:100%}.c-table .c-th{color:#000;font-size:14px;font-weight:500;line-height:20px}"]
|
|
1599
|
+
},] }
|
|
1600
|
+
];
|
|
1601
|
+
SdPopupExport.ctorParameters = function () { return [
|
|
1602
|
+
{ type: core.ChangeDetectorRef },
|
|
1603
|
+
{ type: loading.SdLoadingService },
|
|
1604
|
+
{ type: _export.SdExportService },
|
|
1605
|
+
{ type: notify.SdNotifyService },
|
|
1606
|
+
{ type: translate.SdTranslateService }
|
|
1607
|
+
]; };
|
|
1608
|
+
SdPopupExport.propDecorators = {
|
|
1609
|
+
modal: [{ type: core.ViewChild, args: ['modal',] }],
|
|
1610
|
+
listGroups: [{ type: core.ViewChild, args: ['listGroups',] }],
|
|
1611
|
+
export: [{ type: core.Output }],
|
|
1612
|
+
_tableOption: [{ type: core.Input, args: ['tableOption',] }],
|
|
1613
|
+
configuration: [{ type: core.Input }]
|
|
1614
|
+
};
|
|
1615
|
+
|
|
1616
|
+
var _gridId, _optionChanges, _localItems, _paginator, _sort, _subscription$1, _reload, _loadCompleted, _cacheObjValues, _initCellDef, _initFilterDef, _initFooterDef, _filterExportInfo, _initConfiguration$1, _loadFilterRegister, _filterLocal, _getFilter, _load, _render, _exportedItems, _allColumns, _allExportedColumns, _getExportColumns$1, _updateSelectedItems, _loadValues, _format;
|
|
1215
1617
|
var SdTable = /** @class */ (function () {
|
|
1216
1618
|
function SdTable(ref, loadingService, tableConfiguration, tableConfigurationService, exportService, notifyService, gridFilterService) {
|
|
1217
1619
|
var _this = this;
|
|
@@ -1739,15 +2141,18 @@
|
|
|
1739
2141
|
var _a, _b;
|
|
1740
2142
|
return ((_b = (_a = _this.tableOption.export) === null || _a === void 0 ? void 0 : _a.columns) === null || _b === void 0 ? void 0 : _b.filter(function (e) { var _a; return !((_a = e.export) === null || _a === void 0 ? void 0 : _a.disabled); })) || [];
|
|
1741
2143
|
});
|
|
1742
|
-
|
|
1743
|
-
var _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, columns_2, pageSize_1, batch, total_1, pageNumber_1, exportItems_1, items_1, promises_1, handleData, sheets,
|
|
1744
|
-
var e_6,
|
|
2144
|
+
this.onExport = function (args) { return __awaiter(_this, void 0, void 0, function () {
|
|
2145
|
+
var _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _12, file, isCSV, columns_2, pageSize_1, batch, total_1, pageNumber_1, exportItems_1, items_1, promises_1, handleData, sheets, _13, _14, sheet, _15, _16, _17, e_6_1;
|
|
2146
|
+
var e_6, _18;
|
|
1745
2147
|
var _this = this;
|
|
1746
|
-
return __generator(this, function (
|
|
1747
|
-
switch (
|
|
2148
|
+
return __generator(this, function (_19) {
|
|
2149
|
+
switch (_19.label) {
|
|
1748
2150
|
case 0:
|
|
1749
|
-
|
|
1750
|
-
|
|
2151
|
+
_12 = Object.assign({}, args), file = _12.file, isCSV = _12.isCSV;
|
|
2152
|
+
_19.label = 1;
|
|
2153
|
+
case 1:
|
|
2154
|
+
_19.trys.push([1, , 21, 22]);
|
|
2155
|
+
columns_2 = __classPrivateFieldGet(this, _getExportColumns$1).call(this, args === null || args === void 0 ? void 0 : args.columns);
|
|
1751
2156
|
pageSize_1 = ((_k = (_j = this.tableOption) === null || _j === void 0 ? void 0 : _j.export) === null || _k === void 0 ? void 0 : _k.maxItemsPerRequest) || 1000;
|
|
1752
2157
|
batch = ((_m = (_l = this.tableOption) === null || _l === void 0 ? void 0 : _l.export) === null || _m === void 0 ? void 0 : _m.batch) || 1;
|
|
1753
2158
|
total_1 = this.total;
|
|
@@ -1965,113 +2370,126 @@
|
|
|
1965
2370
|
}
|
|
1966
2371
|
});
|
|
1967
2372
|
}); };
|
|
1968
|
-
|
|
1969
|
-
case
|
|
1970
|
-
if (!(pageNumber_1 * pageSize_1 < total_1)) return [3 /*break*/,
|
|
2373
|
+
_19.label = 2;
|
|
2374
|
+
case 2:
|
|
2375
|
+
if (!(pageNumber_1 * pageSize_1 < total_1)) return [3 /*break*/, 4];
|
|
1971
2376
|
promises_1.push(__classPrivateFieldGet(this, _exportedItems).call(this, pageNumber_1, pageSize_1));
|
|
1972
2377
|
pageNumber_1++;
|
|
1973
2378
|
if (promises_1.length < batch) {
|
|
1974
|
-
return [3 /*break*/,
|
|
2379
|
+
return [3 /*break*/, 2];
|
|
1975
2380
|
}
|
|
1976
2381
|
return [4 /*yield*/, handleData()];
|
|
1977
|
-
case 2:
|
|
1978
|
-
_18.sent();
|
|
1979
|
-
return [3 /*break*/, 1];
|
|
1980
2382
|
case 3:
|
|
1981
|
-
|
|
1982
|
-
return [
|
|
2383
|
+
_19.sent();
|
|
2384
|
+
return [3 /*break*/, 2];
|
|
1983
2385
|
case 4:
|
|
1984
|
-
|
|
1985
|
-
|
|
2386
|
+
if (!(promises_1.length > 0)) return [3 /*break*/, 6];
|
|
2387
|
+
return [4 /*yield*/, handleData()];
|
|
1986
2388
|
case 5:
|
|
1987
|
-
|
|
2389
|
+
_19.sent();
|
|
2390
|
+
_19.label = 6;
|
|
2391
|
+
case 6:
|
|
2392
|
+
if (!(file === null || file === void 0 ? void 0 : file.filePath)) return [3 /*break*/, 8];
|
|
2393
|
+
return [4 /*yield*/, this.exportService.exportByTemplate({
|
|
2394
|
+
filePath: file.filePath,
|
|
2395
|
+
fileName: file.fileName,
|
|
2396
|
+
columns: columns_2,
|
|
2397
|
+
items: items_1,
|
|
2398
|
+
})];
|
|
2399
|
+
case 7:
|
|
2400
|
+
_19.sent();
|
|
2401
|
+
return [2 /*return*/];
|
|
2402
|
+
case 8:
|
|
2403
|
+
if (!isCSV) return [3 /*break*/, 10];
|
|
1988
2404
|
return [4 /*yield*/, this.exportService.exportCSV({
|
|
1989
2405
|
columns: columns_2,
|
|
1990
2406
|
items: items_1,
|
|
1991
2407
|
fileName: (_p = (_o = this.tableOption) === null || _o === void 0 ? void 0 : _o.export) === null || _p === void 0 ? void 0 : _p.fileName,
|
|
1992
2408
|
})];
|
|
1993
|
-
case
|
|
1994
|
-
|
|
2409
|
+
case 9:
|
|
2410
|
+
_19.sent();
|
|
1995
2411
|
return [2 /*return*/];
|
|
1996
|
-
case
|
|
2412
|
+
case 10:
|
|
1997
2413
|
sheets = [];
|
|
1998
|
-
if (!Array.isArray((_r = (_q = this.tableOption) === null || _q === void 0 ? void 0 : _q.export) === null || _r === void 0 ? void 0 : _r.sheets)) return [3 /*break*/,
|
|
1999
|
-
|
|
2000
|
-
case
|
|
2001
|
-
|
|
2002
|
-
|
|
2003
|
-
|
|
2004
|
-
case
|
|
2005
|
-
if (!!
|
|
2006
|
-
sheet =
|
|
2007
|
-
if (!(sheet.name && sheet.items && sheet.fields)) return [3 /*break*/,
|
|
2008
|
-
if (!Array.isArray(sheet.items)) return [3 /*break*/,
|
|
2414
|
+
if (!Array.isArray((_r = (_q = this.tableOption) === null || _q === void 0 ? void 0 : _q.export) === null || _r === void 0 ? void 0 : _r.sheets)) return [3 /*break*/, 19];
|
|
2415
|
+
_19.label = 11;
|
|
2416
|
+
case 11:
|
|
2417
|
+
_19.trys.push([11, 17, 18, 19]);
|
|
2418
|
+
_13 = __values(this.tableOption.export.sheets), _14 = _13.next();
|
|
2419
|
+
_19.label = 12;
|
|
2420
|
+
case 12:
|
|
2421
|
+
if (!!_14.done) return [3 /*break*/, 16];
|
|
2422
|
+
sheet = _14.value;
|
|
2423
|
+
if (!(sheet.name && sheet.items && sheet.fields)) return [3 /*break*/, 15];
|
|
2424
|
+
if (!Array.isArray(sheet.items)) return [3 /*break*/, 13];
|
|
2009
2425
|
sheets.push({
|
|
2010
2426
|
name: sheet.name,
|
|
2011
2427
|
items: sheet.items,
|
|
2012
2428
|
fields: sheet.fields,
|
|
2013
2429
|
});
|
|
2014
|
-
return [3 /*break*/,
|
|
2015
|
-
case
|
|
2016
|
-
|
|
2017
|
-
|
|
2430
|
+
return [3 /*break*/, 15];
|
|
2431
|
+
case 13:
|
|
2432
|
+
_16 = (_15 = sheets).push;
|
|
2433
|
+
_17 = {
|
|
2018
2434
|
name: sheet.name
|
|
2019
2435
|
};
|
|
2020
2436
|
return [4 /*yield*/, sheet.items()];
|
|
2021
|
-
case 11:
|
|
2022
|
-
_15.apply(_14, [(_16.items = _18.sent(),
|
|
2023
|
-
_16.fields = sheet.fields,
|
|
2024
|
-
_16)]);
|
|
2025
|
-
_18.label = 12;
|
|
2026
|
-
case 12:
|
|
2027
|
-
_13 = _12.next();
|
|
2028
|
-
return [3 /*break*/, 9];
|
|
2029
|
-
case 13: return [3 /*break*/, 16];
|
|
2030
2437
|
case 14:
|
|
2031
|
-
|
|
2032
|
-
|
|
2033
|
-
|
|
2438
|
+
_16.apply(_15, [(_17.items = _19.sent(),
|
|
2439
|
+
_17.fields = sheet.fields,
|
|
2440
|
+
_17)]);
|
|
2441
|
+
_19.label = 15;
|
|
2034
2442
|
case 15:
|
|
2443
|
+
_14 = _13.next();
|
|
2444
|
+
return [3 /*break*/, 12];
|
|
2445
|
+
case 16: return [3 /*break*/, 19];
|
|
2446
|
+
case 17:
|
|
2447
|
+
e_6_1 = _19.sent();
|
|
2448
|
+
e_6 = { error: e_6_1 };
|
|
2449
|
+
return [3 /*break*/, 19];
|
|
2450
|
+
case 18:
|
|
2035
2451
|
try {
|
|
2036
|
-
if (
|
|
2452
|
+
if (_14 && !_14.done && (_18 = _13.return)) _18.call(_13);
|
|
2037
2453
|
}
|
|
2038
2454
|
finally { if (e_6) throw e_6.error; }
|
|
2039
2455
|
return [7 /*endfinally*/];
|
|
2040
|
-
case
|
|
2456
|
+
case 19: return [4 /*yield*/, this.exportService.export({
|
|
2041
2457
|
columns: columns_2,
|
|
2042
2458
|
items: items_1,
|
|
2043
2459
|
fileName: (_t = (_s = this.tableOption) === null || _s === void 0 ? void 0 : _s.export) === null || _t === void 0 ? void 0 : _t.fileName,
|
|
2044
2460
|
sheets: sheets,
|
|
2045
2461
|
})];
|
|
2046
|
-
case
|
|
2047
|
-
|
|
2462
|
+
case 20:
|
|
2463
|
+
_19.sent();
|
|
2048
2464
|
return [2 /*return*/];
|
|
2049
|
-
case
|
|
2465
|
+
case 21:
|
|
2050
2466
|
this.isExporting = false;
|
|
2051
2467
|
this.exportTitle = "Export";
|
|
2052
2468
|
this.ref.detectChanges();
|
|
2053
2469
|
return [7 /*endfinally*/];
|
|
2054
|
-
case
|
|
2470
|
+
case 22: return [2 /*return*/];
|
|
2055
2471
|
}
|
|
2056
2472
|
});
|
|
2057
|
-
}); }
|
|
2058
|
-
_getExportColumns.set(this, function () {
|
|
2473
|
+
}); };
|
|
2474
|
+
_getExportColumns$1.set(this, function (columns) {
|
|
2059
2475
|
var _a, _b;
|
|
2060
|
-
var
|
|
2476
|
+
var tableColumns = [];
|
|
2477
|
+
// Lấy column từ option
|
|
2061
2478
|
_this.tableOption.columns
|
|
2062
2479
|
.filter(function (e) { var _a; return !((_a = e.export) === null || _a === void 0 ? void 0 : _a.disabled); })
|
|
2063
2480
|
.forEach(function (column) {
|
|
2064
2481
|
var _a;
|
|
2065
2482
|
if (column.type === 'children') {
|
|
2066
2483
|
(_a = column.children) === null || _a === void 0 ? void 0 : _a.filter(function (e) { var _a; return !((_a = e.export) === null || _a === void 0 ? void 0 : _a.disabled); }).forEach(function (childColumn) {
|
|
2067
|
-
|
|
2484
|
+
tableColumns.push(childColumn);
|
|
2068
2485
|
});
|
|
2069
2486
|
return;
|
|
2070
2487
|
}
|
|
2071
|
-
|
|
2488
|
+
tableColumns.push(column);
|
|
2072
2489
|
});
|
|
2490
|
+
// Lấy columns từ configuration
|
|
2073
2491
|
if (_this.configuration) {
|
|
2074
|
-
var columns_4 = __spread(
|
|
2492
|
+
var columns_4 = __spread(tableColumns);
|
|
2075
2493
|
var _12 = _this.configuration, firstColumns = _12.firstColumns, secondColumns = _12.secondColumns;
|
|
2076
2494
|
var displayColumns = __spread(firstColumns, secondColumns).reduce(function (first, next) {
|
|
2077
2495
|
var column = _this.tableOption.columns.find(function (e) { return e.field === next.field; });
|
|
@@ -2084,18 +2502,20 @@
|
|
|
2084
2502
|
var children = column.children;
|
|
2085
2503
|
return __spread(first, children);
|
|
2086
2504
|
}, []);
|
|
2087
|
-
|
|
2505
|
+
tableColumns = displayColumns
|
|
2088
2506
|
.map(function (e) { return (Object.assign(Object.assign({}, e), { data: columns_4.find(function (e1) { return e1.field === e.field; }) })); })
|
|
2089
2507
|
.filter(function (e) { return !!e.data; })
|
|
2090
2508
|
.map(function (e) { return e.data; });
|
|
2091
2509
|
}
|
|
2092
|
-
|
|
2510
|
+
// Chỉ lấy các columns được thiết lập
|
|
2511
|
+
var columnFields = columns.map(function (e) { return e.field; });
|
|
2512
|
+
return __spread(tableColumns, (((_b = (_a = _this.tableOption.export) === null || _a === void 0 ? void 0 : _a.columns) === null || _b === void 0 ? void 0 : _b.filter(function (e) { var _a; return !((_a = e.export) === null || _a === void 0 ? void 0 : _a.disabled); })) || [])).filter(function (column) { return !(columnFields === null || columnFields === void 0 ? void 0 : columnFields.length) || columnFields.includes(column.field); });
|
|
2093
2513
|
});
|
|
2094
2514
|
this.exportExcel = function () {
|
|
2095
|
-
|
|
2515
|
+
_this.onExport();
|
|
2096
2516
|
};
|
|
2097
2517
|
this.exportCSV = function () {
|
|
2098
|
-
|
|
2518
|
+
_this.onExport({ isCSV: true });
|
|
2099
2519
|
};
|
|
2100
2520
|
this.onFilterChange = function () {
|
|
2101
2521
|
var _a, _b;
|
|
@@ -2630,11 +3050,11 @@
|
|
|
2630
3050
|
});
|
|
2631
3051
|
return SdTable;
|
|
2632
3052
|
}());
|
|
2633
|
-
_gridId = new WeakMap(), _optionChanges = new WeakMap(), _localItems = new WeakMap(), _paginator = new WeakMap(), _sort = new WeakMap(), _subscription$1 = new WeakMap(), _reload = new WeakMap(), _loadCompleted = new WeakMap(), _cacheObjValues = new WeakMap(), _initCellDef = new WeakMap(), _initFilterDef = new WeakMap(), _initFooterDef = new WeakMap(), _filterExportInfo = new WeakMap(), _initConfiguration$1 = new WeakMap(), _loadFilterRegister = new WeakMap(), _filterLocal = new WeakMap(), _getFilter = new WeakMap(), _load = new WeakMap(), _render = new WeakMap(), _exportedItems = new WeakMap(), _allColumns = new WeakMap(), _allExportedColumns = new WeakMap(),
|
|
3053
|
+
_gridId = new WeakMap(), _optionChanges = new WeakMap(), _localItems = new WeakMap(), _paginator = new WeakMap(), _sort = new WeakMap(), _subscription$1 = new WeakMap(), _reload = new WeakMap(), _loadCompleted = new WeakMap(), _cacheObjValues = new WeakMap(), _initCellDef = new WeakMap(), _initFilterDef = new WeakMap(), _initFooterDef = new WeakMap(), _filterExportInfo = new WeakMap(), _initConfiguration$1 = new WeakMap(), _loadFilterRegister = new WeakMap(), _filterLocal = new WeakMap(), _getFilter = new WeakMap(), _load = new WeakMap(), _render = new WeakMap(), _exportedItems = new WeakMap(), _allColumns = new WeakMap(), _allExportedColumns = new WeakMap(), _getExportColumns$1 = new WeakMap(), _updateSelectedItems = new WeakMap(), _loadValues = new WeakMap(), _format = new WeakMap();
|
|
2634
3054
|
SdTable.decorators = [
|
|
2635
3055
|
{ type: core.Component, args: [{
|
|
2636
3056
|
selector: 'sd-table',
|
|
2637
|
-
template: "<ng-container *ngIf=\"configuration\">\r\n <sd-table-filter\r\n *ngIf=\"!tableOption.filter?.disabled && filterRegister\"\r\n [filterRegister]=\"filterRegister\"\r\n [filter]=\"tableOption?.filter\"\r\n [columns]=\"configuration.firstColumns\"\r\n [externalFilters]=\"tableOption?.filter?.externalFilters\"\r\n [filterDefs]=\"filterDefs\">\r\n </sd-table-filter>\r\n <ng-container *ngIf=\"items | sdGroup : tableOption; $implicit as groupedItems\">\r\n <div class=\"c-container\">\r\n <div class=\"c-loading\" *ngIf=\"isLoading\">\r\n <mat-spinner></mat-spinner>\r\n </div>\r\n <ng-container>\r\n <div\r\n class=\"c-table\"\r\n sdScroll\r\n [ngStyle]=\"{\r\n 'max-height': tableOption?.style?.maxHeight,\r\n 'min-height': tableOption?.style?.minHeight\r\n }\">\r\n <table\r\n mat-table\r\n [dataSource]=\"groupedItems\"\r\n [trackBy]=\"trackBy\"\r\n matSort\r\n [matSortDisabled]=\"!tableOption.sort?.enable\"\r\n 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 <ng-container *ngIf=\"sdSubInformation?.templateRef\">\r\n <ng-container *ngIf=\"tableOption?.expand?.always; else useExpandCollapse\">\r\n <ng-container *ngTemplateOutlet=\"sdSubInformation.templateRef; context: { item: item }\"> </ng-container>\r\n </ng-container>\r\n <ng-template #useExpandCollapse>\r\n <div [@detailExpand]=\"item.isExpanded ? 'expanded' : 'collapsed'\">\r\n <ng-container *ngIf=\"item.isExpanded\">\r\n <ng-container *ngTemplateOutlet=\"sdSubInformation.templateRef; context: { item: item }\"> </ng-container>\r\n </ng-container>\r\n </div>\r\n </ng-template>\r\n </ng-container>\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\"></th>\r\n <td mat-cell *matCellDef=\"let element\">\r\n <button\r\n *ngIf=\"!element.isExpanding && !tableOption?.expand?.always\"\r\n mat-icon-button\r\n 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 p-0\" mat-header-cell *matHeaderCellDef [attr.rowspan]=\"configuration.multipleHeader ? 2 : 1\">\r\n <ng-container *ngIf=\"items | selectionVisibleSelectAll : tableOption?.selector | async\">\r\n <mat-checkbox\r\n *ngIf=\"!tableOption.selector?.single\"\r\n class=\"c-selection px-15\"\r\n style=\"width: 50px\"\r\n color=\"primary\"\r\n [(ngModel)]=\"isSelectAll\"\r\n (change)=\"onSelectAll()\">\r\n </mat-checkbox>\r\n </ng-container>\r\n </th>\r\n <td class=\"text-center p-0\" mat-cell *matCellDef=\"let item\">\r\n <ng-container *ngIf=\"item | selectionVisible : tableOption?.selector\">\r\n <mat-checkbox\r\n class=\"c-selection px-15\"\r\n style=\"width: 50px\"\r\n color=\"primary\"\r\n [(ngModel)]=\"item.meta.selector.isSelected\"\r\n (change)=\"onSelect(item)\"\r\n [disabled]=\"selectedTableItems | selectionDisable : item : tableOption?.selector\">\r\n </mat-checkbox>\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\" sticky>\r\n <th\r\n class=\"p-0\"\r\n mat-header-cell\r\n *matHeaderCellDef\r\n 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]=\"tableOption.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 matColumnDef=\"sdGroup\">\r\n <th mat-header-cell *matHeaderCellDef class=\"px-8 py-8\" [attr.rowspan]=\"configuration.multipleHeader ? 2 : 1\"></th>\r\n <td class=\"p-0\" mat-cell *matCellDef=\"let item\" [attr.colspan]=\"!item?.sdGroup ? 1 : configuration.displayedColumns.length\">\r\n <div [innerHtml]=\"item?.sdGroup?.htmlTemplate | safeHtml\"></div>\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\"\r\n [matColumnDef]=\"column.field\"\r\n [sticky]=\"configuration.fixedColumn[column.field]\">\r\n <th\r\n mat-header-cell\r\n *matHeaderCellDef\r\n class=\"px-8 py-8 c-th\"\r\n [ngStyle]=\"{ 'min-width': column.width }\"\r\n [attr.rowspan]=\"configuration.multipleHeader && column.type !== 'children-col' ? 2 : 1\"\r\n [attr.colspan]=\"column.type === 'children-col' ? column.children?.length : 1\">\r\n <div>\r\n <div\r\n aria-hidden=\"true\"\r\n mat-sort-header\r\n [disabled]=\"!column.sortable || column.type === 'children-col'\"\r\n [class.text-right]=\"column.align === 'right' || (!column.align && column.type === 'number')\"\r\n [class.text-center]=\"column.align === 'center'\"\r\n [innerHTML]=\"column.titleHtml || column.title\"></div>\r\n <sd-column-inline-filter\r\n *ngIf=\"!tableOption.filter?.disabled && !tableOption.filter?.hideInlineFilter && columnOperator\"\r\n [value]=\"columnFilter[column.field]\"\r\n [(inlineOperator)]=\"columnOperator[column.field]\"\r\n (operatorChange)=\"onOperatorChange(column, $event)\"\r\n [columnFilter]=\"columnFilter\"\r\n [cacheValues]=\"cacheValues\"\r\n [column]=\"column\"\r\n (filterChange)=\"onFilterChange()\">\r\n </sd-column-inline-filter>\r\n </div>\r\n </th>\r\n <td class=\"c-td px-0\" mat-cell *matCellDef=\"let item\">\r\n <sd-desktop-cell\r\n class=\"d-block px-8\"\r\n *ngIf=\"!item?.sdGroup\"\r\n [value]=\"item[column.field]\"\r\n [column]=\"column\"\r\n [item]=\"item\"\r\n [cellDef]=\"cellDef\">\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=\"footerDef[column.field].templateRef; context: { items: items, column: column }\">\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\" [matColumnDef]=\"column.field\">\r\n <th mat-header-cell *matHeaderCellDef mat-sort-header class=\"c-th px-8\" [ngStyle]=\"{ 'min-width': column.width }\">\r\n <div>\r\n <div\r\n [class.text-right]=\"column.align === 'right' || (!column.align && column.type === 'number')\"\r\n [class.text-center]=\"column.align === 'center'\"\r\n [innerHTML]=\"column.titleHtml || column.title\"></div>\r\n <sd-column-inline-filter\r\n *ngIf=\"!tableOption.filter?.disabled && !tableOption.filter?.hideInlineFilter && columnOperator\"\r\n [value]=\"columnFilter[column.field]\"\r\n [(inlineOperator)]=\"columnOperator[column.field]\"\r\n (operatorChange)=\"onOperatorChange(column, $event)\"\r\n [columnFilter]=\"columnFilter\"\r\n [cacheValues]=\"cacheValues\"\r\n [column]=\"column\"\r\n (filterChange)=\"onFilterChange()\">\r\n </sd-column-inline-filter>\r\n </div>\r\n </th>\r\n <td class=\"c-td px-0\" mat-cell *matCellDef=\"let item\">\r\n <sd-desktop-cell class=\"d-block px-8\" [value]=\"item[column.field]\" [column]=\"column\" [item]=\"item\" [cellDef]=\"cellDef\">\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=\"footerDef[column.field].templateRef; context: { items: items, column: column }\">\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\"></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 [class.selected]=\"row.meta.selector.isSelected\"></tr>\r\n\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 </div>\r\n </ng-container>\r\n <div class=\"c-paginator\">\r\n <div class=\"c-action\">\r\n <ng-container *sdMobileTablet>\r\n <sd-button\r\n *ngIf=\"tableFilter\"\r\n class=\"mr-8\"\r\n [title]=\"'Filter' | sdTranslate\"\r\n icon=\"filter_alt\"\r\n size=\"sm\"\r\n (action)=\"tableFilter.open()\"\r\n type=\"link\">\r\n </sd-button>\r\n </ng-container>\r\n <ng-container *sdDesktop>\r\n <sd-button\r\n *ngIf=\"tableOption.reload?.visible\"\r\n class=\"mr-8\"\r\n title=\"T\u1EA3i l\u1EA1i\"\r\n icon=\"refresh\"\r\n size=\"sm\"\r\n (action)=\"reload()\"\r\n [disabled]=\"!items?.length\"\r\n type=\"link\">\r\n </sd-button>\r\n </ng-container>\r\n <ng-container *ngIf=\"tableOption.export?.visible && items?.length\">\r\n <ng-container *ngIf=\"isExporting; else exportable\">\r\n <sd-button class=\"mr-8\" [loading]=\"isExporting\" [title]=\"exportTitle | sdTranslate\" icon=\"get_app\" size=\"sm\" type=\"link\">\r\n </sd-button>\r\n </ng-container>\r\n <ng-template #exportable>\r\n <sd-button class=\"mr-8\" [title]=\"exportTitle | sdTranslate\" icon=\"get_app\" size=\"sm\" [matMenuTriggerFor]=\"menu\" type=\"link\">\r\n </sd-button>\r\n </ng-template>\r\n <mat-menu #menu=\"matMenu\">\r\n <button mat-menu-item (click)=\"exportExcel()\" type=\"button\">\r\n <mat-icon fontSet=\"material-icons-outlined\">file_download</mat-icon>\r\n <span> Xu\u1EA5t excel</span>\r\n </button>\r\n <button mat-menu-item (click)=\"exportCSV()\" type=\"button\">\r\n <mat-icon fontSet=\"material-icons-outlined\">file_download</mat-icon>\r\n <span> Xu\u1EA5t CSV</span>\r\n </button>\r\n </mat-menu>\r\n </ng-container>\r\n <ng-container *sdDesktop>\r\n <sd-button\r\n *ngIf=\"popupConfiguration\"\r\n class=\"mr-8\"\r\n [title]=\"'Configure' | sdTranslate\"\r\n icon=\"settings\"\r\n size=\"sm\"\r\n (action)=\"popupConfiguration.open()\"\r\n type=\"link\">\r\n </sd-button>\r\n </ng-container>\r\n </div>\r\n <ng-container *sdDesktop>\r\n <mat-paginator\r\n [class.d-none]=\"tableOption.paginate?.hidden\"\r\n [length]=\"total\"\r\n [pageSize]=\"tableOption.paginate?.pageSize\"\r\n [pageSizeOptions]=\"tableOption.paginate?.pages\"\r\n [showFirstLastButtons]=\"tableOption.paginate?.showFirstLastButtons\"></mat-paginator>\r\n </ng-container>\r\n <ng-container *sdMobileTablet>\r\n <mat-paginator\r\n [class.d-none]=\"tableOption.paginate?.hidden\"\r\n [length]=\"total\"\r\n [pageSize]=\"tableOption.paginate?.pageSize\"\r\n hidePageSize=\"true\"></mat-paginator>\r\n </ng-container>\r\n </div>\r\n </div>\r\n <sd-table-quick-action [tableOption]=\"tableOption\" [selectedTableItems]=\"selectedTableItems\" (clear)=\"onClearSelection(groupedItems)\">\r\n </sd-table-quick-action>\r\n <sd-popup-configuration *ngIf=\"tableOption?.key && tableOption.config?.visible\" [tableOption]=\"tableOption\"> </sd-popup-configuration>\r\n </ng-container>\r\n</ng-container>\r\n",
|
|
3057
|
+
template: "<ng-container *ngIf=\"configuration\">\r\n <sd-table-filter\r\n *ngIf=\"!tableOption.filter?.disabled && filterRegister\"\r\n [filterRegister]=\"filterRegister\"\r\n [filter]=\"tableOption?.filter\"\r\n [columns]=\"configuration.firstColumns\"\r\n [externalFilters]=\"tableOption?.filter?.externalFilters\"\r\n [filterDefs]=\"filterDefs\">\r\n </sd-table-filter>\r\n <ng-container *ngIf=\"items | sdGroup : tableOption; $implicit as groupedItems\">\r\n <div class=\"c-container\">\r\n <div class=\"c-loading\" *ngIf=\"isLoading\">\r\n <mat-spinner></mat-spinner>\r\n </div>\r\n <ng-container>\r\n <div\r\n class=\"c-table\"\r\n sdScroll\r\n [ngStyle]=\"{\r\n 'max-height': tableOption?.style?.maxHeight,\r\n 'min-height': tableOption?.style?.minHeight\r\n }\">\r\n <table\r\n mat-table\r\n [dataSource]=\"groupedItems\"\r\n [trackBy]=\"trackBy\"\r\n matSort\r\n [matSortDisabled]=\"!tableOption.sort?.enable\"\r\n 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 <ng-container *ngIf=\"sdSubInformation?.templateRef\">\r\n <ng-container *ngIf=\"tableOption?.expand?.always; else useExpandCollapse\">\r\n <ng-container *ngTemplateOutlet=\"sdSubInformation.templateRef; context: { item: item }\"> </ng-container>\r\n </ng-container>\r\n <ng-template #useExpandCollapse>\r\n <div [@detailExpand]=\"item.isExpanded ? 'expanded' : 'collapsed'\">\r\n <ng-container *ngIf=\"item.isExpanded\">\r\n <ng-container *ngTemplateOutlet=\"sdSubInformation.templateRef; context: { item: item }\"> </ng-container>\r\n </ng-container>\r\n </div>\r\n </ng-template>\r\n </ng-container>\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\"></th>\r\n <td mat-cell *matCellDef=\"let element\">\r\n <button\r\n *ngIf=\"!element.isExpanding && !tableOption?.expand?.always\"\r\n mat-icon-button\r\n 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 p-0\" mat-header-cell *matHeaderCellDef [attr.rowspan]=\"configuration.multipleHeader ? 2 : 1\">\r\n <ng-container *ngIf=\"items | selectionVisibleSelectAll : tableOption?.selector | async\">\r\n <mat-checkbox\r\n *ngIf=\"!tableOption.selector?.single\"\r\n class=\"c-selection px-15\"\r\n style=\"width: 50px\"\r\n color=\"primary\"\r\n [(ngModel)]=\"isSelectAll\"\r\n (change)=\"onSelectAll()\">\r\n </mat-checkbox>\r\n </ng-container>\r\n </th>\r\n <td class=\"text-center p-0\" mat-cell *matCellDef=\"let item\">\r\n <ng-container *ngIf=\"item | selectionVisible : tableOption?.selector\">\r\n <mat-checkbox\r\n class=\"c-selection px-15\"\r\n style=\"width: 50px\"\r\n color=\"primary\"\r\n [(ngModel)]=\"item.meta.selector.isSelected\"\r\n (change)=\"onSelect(item)\"\r\n [disabled]=\"selectedTableItems | selectionDisable : item : tableOption?.selector\">\r\n </mat-checkbox>\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\" sticky>\r\n <th\r\n class=\"p-0\"\r\n mat-header-cell\r\n *matHeaderCellDef\r\n 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]=\"tableOption.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 matColumnDef=\"sdGroup\">\r\n <th mat-header-cell *matHeaderCellDef class=\"px-8 py-8\" [attr.rowspan]=\"configuration.multipleHeader ? 2 : 1\"></th>\r\n <td class=\"p-0\" mat-cell *matCellDef=\"let item\" [attr.colspan]=\"!item?.sdGroup ? 1 : configuration.displayedColumns.length\">\r\n <div [innerHtml]=\"item?.sdGroup?.htmlTemplate | safeHtml\"></div>\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\"\r\n [matColumnDef]=\"column.field\"\r\n [sticky]=\"configuration.fixedColumn[column.field]\">\r\n <th\r\n mat-header-cell\r\n *matHeaderCellDef\r\n class=\"px-8 py-8 c-th\"\r\n [ngStyle]=\"{ 'min-width': column.width }\"\r\n [attr.rowspan]=\"configuration.multipleHeader && column.type !== 'children-col' ? 2 : 1\"\r\n [attr.colspan]=\"column.type === 'children-col' ? column.children?.length : 1\">\r\n <div>\r\n <div\r\n aria-hidden=\"true\"\r\n mat-sort-header\r\n [disabled]=\"!column.sortable || column.type === 'children-col'\"\r\n [class.text-right]=\"column.align === 'right' || (!column.align && column.type === 'number')\"\r\n [class.text-center]=\"column.align === 'center'\"\r\n [innerHTML]=\"column.titleHtml || column.title\"></div>\r\n <sd-column-inline-filter\r\n *ngIf=\"!tableOption.filter?.disabled && !tableOption.filter?.hideInlineFilter && columnOperator\"\r\n [value]=\"columnFilter[column.field]\"\r\n [(inlineOperator)]=\"columnOperator[column.field]\"\r\n (operatorChange)=\"onOperatorChange(column, $event)\"\r\n [columnFilter]=\"columnFilter\"\r\n [cacheValues]=\"cacheValues\"\r\n [column]=\"column\"\r\n (filterChange)=\"onFilterChange()\">\r\n </sd-column-inline-filter>\r\n </div>\r\n </th>\r\n <td class=\"c-td px-0\" mat-cell *matCellDef=\"let item\">\r\n <sd-desktop-cell\r\n class=\"d-block px-8\"\r\n *ngIf=\"!item?.sdGroup\"\r\n [value]=\"item[column.field]\"\r\n [column]=\"column\"\r\n [item]=\"item\"\r\n [cellDef]=\"cellDef\">\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=\"footerDef[column.field].templateRef; context: { items: items, column: column }\">\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\" [matColumnDef]=\"column.field\">\r\n <th mat-header-cell *matHeaderCellDef mat-sort-header class=\"c-th px-8\" [ngStyle]=\"{ 'min-width': column.width }\">\r\n <div>\r\n <div\r\n [class.text-right]=\"column.align === 'right' || (!column.align && column.type === 'number')\"\r\n [class.text-center]=\"column.align === 'center'\"\r\n [innerHTML]=\"column.titleHtml || column.title\"></div>\r\n <sd-column-inline-filter\r\n *ngIf=\"!tableOption.filter?.disabled && !tableOption.filter?.hideInlineFilter && columnOperator\"\r\n [value]=\"columnFilter[column.field]\"\r\n [(inlineOperator)]=\"columnOperator[column.field]\"\r\n (operatorChange)=\"onOperatorChange(column, $event)\"\r\n [columnFilter]=\"columnFilter\"\r\n [cacheValues]=\"cacheValues\"\r\n [column]=\"column\"\r\n (filterChange)=\"onFilterChange()\">\r\n </sd-column-inline-filter>\r\n </div>\r\n </th>\r\n <td class=\"c-td px-0\" mat-cell *matCellDef=\"let item\">\r\n <sd-desktop-cell class=\"d-block px-8\" [value]=\"item[column.field]\" [column]=\"column\" [item]=\"item\" [cellDef]=\"cellDef\">\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=\"footerDef[column.field].templateRef; context: { items: items, column: column }\">\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\"></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 [class.selected]=\"row.meta.selector.isSelected\"></tr>\r\n\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 </div>\r\n </ng-container>\r\n <div class=\"c-paginator\">\r\n <div class=\"c-action\">\r\n <ng-container *sdMobileTablet>\r\n <sd-button\r\n *ngIf=\"tableFilter\"\r\n class=\"mr-8\"\r\n [title]=\"'Filter' | sdTranslate\"\r\n icon=\"filter_alt\"\r\n size=\"sm\"\r\n (action)=\"tableFilter.open()\"\r\n type=\"link\">\r\n </sd-button>\r\n </ng-container>\r\n <ng-container *sdDesktop>\r\n <sd-button\r\n *ngIf=\"tableOption.reload?.visible\"\r\n class=\"mr-8\"\r\n title=\"T\u1EA3i l\u1EA1i\"\r\n icon=\"refresh\"\r\n size=\"sm\"\r\n (action)=\"reload()\"\r\n [disabled]=\"!items?.length\"\r\n type=\"link\">\r\n </sd-button>\r\n </ng-container>\r\n <ng-container *ngIf=\"tableOption.export?.visible && items?.length\">\r\n <ng-container *ngIf=\"isExporting; else exportable\">\r\n <sd-button class=\"mr-8\" [loading]=\"isExporting\" [title]=\"exportTitle | sdTranslate\" icon=\"get_app\" size=\"sm\" type=\"link\">\r\n </sd-button>\r\n </ng-container>\r\n <ng-template #exportable>\r\n <sd-button class=\"mr-8\" [title]=\"exportTitle | sdTranslate\" icon=\"get_app\" size=\"sm\" [matMenuTriggerFor]=\"menu\" type=\"link\">\r\n </sd-button>\r\n </ng-template>\r\n <mat-menu #menu=\"matMenu\">\r\n <button mat-menu-item (click)=\"exportExcel()\" type=\"button\">\r\n <mat-icon fontSet=\"material-icons-outlined\">file_download</mat-icon>\r\n <span> Xu\u1EA5t excel</span>\r\n </button>\r\n <button mat-menu-item (click)=\"exportCSV()\" type=\"button\">\r\n <mat-icon fontSet=\"material-icons-outlined\">file_download</mat-icon>\r\n <span> Xu\u1EA5t CSV</span>\r\n </button>\r\n <button *ngIf=\"tableOption.export?.key\" mat-menu-item (click)=\"sdPopupExport.open()\" type=\"button\">\r\n <mat-icon fontSet=\"material-icons-outlined\">settings</mat-icon>\r\n <span>Thi\u1EBFt l\u1EADp</span>\r\n </button>\r\n </mat-menu>\r\n </ng-container>\r\n <ng-container *sdDesktop>\r\n <sd-button\r\n *ngIf=\"popupConfiguration\"\r\n class=\"mr-8\"\r\n [title]=\"'Configure' | sdTranslate\"\r\n icon=\"settings\"\r\n size=\"sm\"\r\n (action)=\"popupConfiguration.open()\"\r\n type=\"link\">\r\n </sd-button>\r\n </ng-container>\r\n </div>\r\n <ng-container *sdDesktop>\r\n <mat-paginator\r\n [class.d-none]=\"tableOption.paginate?.hidden\"\r\n [length]=\"total\"\r\n [pageSize]=\"tableOption.paginate?.pageSize\"\r\n [pageSizeOptions]=\"tableOption.paginate?.pages\"\r\n [showFirstLastButtons]=\"tableOption.paginate?.showFirstLastButtons\"></mat-paginator>\r\n </ng-container>\r\n <ng-container *sdMobileTablet>\r\n <mat-paginator\r\n [class.d-none]=\"tableOption.paginate?.hidden\"\r\n [length]=\"total\"\r\n [pageSize]=\"tableOption.paginate?.pageSize\"\r\n hidePageSize=\"true\"></mat-paginator>\r\n </ng-container>\r\n </div>\r\n </div>\r\n <sd-popup-export\r\n *ngIf=\"tableOption.export?.visible\"\r\n [configuration]=\"configuration\"\r\n [tableOption]=\"tableOption\"\r\n (export)=\"onExport($event)\"\r\n #sdPopupExport></sd-popup-export>\r\n <sd-table-quick-action [tableOption]=\"tableOption\" [selectedTableItems]=\"selectedTableItems\" (clear)=\"onClearSelection(groupedItems)\">\r\n </sd-table-quick-action>\r\n <sd-popup-configuration *ngIf=\"tableOption?.key && tableOption.config?.visible\" [tableOption]=\"tableOption\"> </sd-popup-configuration>\r\n </ng-container>\r\n</ng-container>\r\n",
|
|
2638
3058
|
changeDetection: core.ChangeDetectionStrategy.OnPush,
|
|
2639
3059
|
animations: [
|
|
2640
3060
|
animations.trigger('detailExpand', [
|
|
@@ -2658,6 +3078,7 @@
|
|
|
2658
3078
|
SdTable.propDecorators = {
|
|
2659
3079
|
table: [{ type: core.ViewChild, args: [table.MatTable,] }],
|
|
2660
3080
|
popupConfiguration: [{ type: core.ViewChild, args: [SdPopupConfiguration,] }],
|
|
3081
|
+
sdPopupExport: [{ type: core.ViewChild, args: [SdPopupExport,] }],
|
|
2661
3082
|
sdScroll: [{ type: core.ViewChild, args: [common.SdScrollDirective,] }],
|
|
2662
3083
|
quickAction: [{ type: core.ViewChild, args: [quickAction.SdQuickAction,] }],
|
|
2663
3084
|
tableFilter: [{ type: core.ViewChild, args: [SdTableFilter,] }],
|
|
@@ -3731,6 +4152,7 @@
|
|
|
3731
4152
|
slideToggle.MatSlideToggleModule,
|
|
3732
4153
|
checkbox.MatCheckboxModule,
|
|
3733
4154
|
list.MatListModule,
|
|
4155
|
+
chips.MatChipsModule,
|
|
3734
4156
|
table$1.CdkTableModule,
|
|
3735
4157
|
dragDrop.DragDropModule,
|
|
3736
4158
|
form.SdFormModule,
|
|
@@ -3752,6 +4174,7 @@
|
|
|
3752
4174
|
SdPopupConfiguration,
|
|
3753
4175
|
SdTableFilter,
|
|
3754
4176
|
SdPopupFilter,
|
|
4177
|
+
SdPopupExport,
|
|
3755
4178
|
// Pipes
|
|
3756
4179
|
SdCommandFilterPipe,
|
|
3757
4180
|
SdCommandDisablePipe,
|
|
@@ -3808,29 +4231,30 @@
|
|
|
3808
4231
|
exports.TABLE_CONFIG = TABLE_CONFIG;
|
|
3809
4232
|
exports.ɵa = SdTableQuickAction;
|
|
3810
4233
|
exports.ɵb = SdDesktopCell;
|
|
4234
|
+
exports.ɵba = SdGroupPipe;
|
|
3811
4235
|
exports.ɵc = SdDesktopCellView;
|
|
3812
4236
|
exports.ɵd = SdDesktopCommand;
|
|
3813
4237
|
exports.ɵe = SdColumnInlineFilter;
|
|
3814
4238
|
exports.ɵf = SdPopupConfiguration;
|
|
3815
4239
|
exports.ɵg = SdTableConfigurationService;
|
|
3816
4240
|
exports.ɵi = TABLE_CONFIG;
|
|
3817
|
-
exports.ɵj =
|
|
3818
|
-
exports.ɵk =
|
|
3819
|
-
exports.ɵl =
|
|
3820
|
-
exports.ɵm =
|
|
3821
|
-
exports.ɵn =
|
|
3822
|
-
exports.ɵo =
|
|
3823
|
-
exports.ɵp =
|
|
3824
|
-
exports.ɵq =
|
|
3825
|
-
exports.ɵr =
|
|
3826
|
-
exports.ɵs =
|
|
3827
|
-
exports.ɵt =
|
|
3828
|
-
exports.ɵu =
|
|
3829
|
-
exports.ɵv =
|
|
3830
|
-
exports.ɵw =
|
|
3831
|
-
exports.ɵx =
|
|
3832
|
-
exports.ɵy =
|
|
3833
|
-
exports.ɵz =
|
|
4241
|
+
exports.ɵj = SdPopupExport;
|
|
4242
|
+
exports.ɵk = SdTableFilter;
|
|
4243
|
+
exports.ɵl = SdPopupFilter;
|
|
4244
|
+
exports.ɵm = SdMaterialSubInformationDefDirective;
|
|
4245
|
+
exports.ɵn = SdMaterialFooterDefDirective;
|
|
4246
|
+
exports.ɵo = SdTableFilterService;
|
|
4247
|
+
exports.ɵp = SdCommandFilterPipe;
|
|
4248
|
+
exports.ɵq = SdCommandDisablePipe;
|
|
4249
|
+
exports.ɵr = SdCommandIconPipe;
|
|
4250
|
+
exports.ɵs = SdCommandTitlePipe;
|
|
4251
|
+
exports.ɵt = SdColumnTooltipPipe;
|
|
4252
|
+
exports.ɵu = SdFilterColumnPipe;
|
|
4253
|
+
exports.ɵv = SdFilterExternalPipe;
|
|
4254
|
+
exports.ɵw = SdSelectionActionFilterPipe;
|
|
4255
|
+
exports.ɵx = SdSelectionVisiblePipe;
|
|
4256
|
+
exports.ɵy = SdSelectionDisablePipe;
|
|
4257
|
+
exports.ɵz = SdSelectionVisibleSelectAllPipe;
|
|
3834
4258
|
|
|
3835
4259
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
3836
4260
|
|