@sd-angular/core 1.3.168 → 1.3.170
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-table.umd.js +202 -191
- package/bundles/sd-angular-core-table.umd.js.map +1 -1
- package/bundles/sd-angular-core-table.umd.min.js +1 -1
- package/bundles/sd-angular-core-table.umd.min.js.map +1 -1
- package/esm2015/table/src/lib/components/desktop-cell/desktop-cell.component.js +2 -4
- package/esm2015/table/src/lib/components/desktop-cell-view/desktop-cell-view.component.js +1 -3
- package/esm2015/table/src/lib/models/table-column.model.js +1 -1
- package/esm2015/table/src/lib/services/table-configuration.service.js +2 -2
- package/esm2015/table/src/lib/table.component.js +38 -14
- package/fesm2015/sd-angular-core-table.js +39 -19
- package/fesm2015/sd-angular-core-table.js.map +1 -1
- package/package.json +1 -1
- package/{sd-angular-core-1.3.168.tgz → sd-angular-core-1.3.170.tgz} +0 -0
- package/table/sd-angular-core-table.metadata.json +1 -1
- package/table/src/lib/components/desktop-cell/desktop-cell.component.d.ts +0 -2
- package/table/src/lib/components/desktop-cell-view/desktop-cell-view.component.d.ts +0 -2
- package/table/src/lib/models/table-column.model.d.ts +1 -0
|
@@ -638,7 +638,7 @@
|
|
|
638
638
|
_prefix.set(this, 'bd364e28-fe67-48b9-a537-1a306f7d195c');
|
|
639
639
|
_getSetting.set(this, function (gridOption) {
|
|
640
640
|
if (!(gridOption === null || gridOption === void 0 ? void 0 : gridOption.key)) {
|
|
641
|
-
|
|
641
|
+
return null;
|
|
642
642
|
}
|
|
643
643
|
return _this.settingService.create({ prefix: __classPrivateFieldGet(_this, _prefix), key: gridOption.key }, {
|
|
644
644
|
default: __classPrivateFieldGet(_this, _default).call(_this, gridOption),
|
|
@@ -1226,11 +1226,11 @@
|
|
|
1226
1226
|
this.cacheValues = {};
|
|
1227
1227
|
_cacheObjValues.set(this, {});
|
|
1228
1228
|
_initCellDef.set(this, function () {
|
|
1229
|
-
var e_1,
|
|
1229
|
+
var e_1, _9;
|
|
1230
1230
|
_this.cellDef = {};
|
|
1231
1231
|
try {
|
|
1232
|
-
for (var
|
|
1233
|
-
var cellDef =
|
|
1232
|
+
for (var _10 = __values(_this.sdCellDefs), _11 = _10.next(); !_11.done; _11 = _10.next()) {
|
|
1233
|
+
var cellDef = _11.value;
|
|
1234
1234
|
if (cellDef.sdTableCellDef) {
|
|
1235
1235
|
_this.cellDef[cellDef.sdTableCellDef] = cellDef;
|
|
1236
1236
|
}
|
|
@@ -1239,35 +1239,35 @@
|
|
|
1239
1239
|
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
1240
1240
|
finally {
|
|
1241
1241
|
try {
|
|
1242
|
-
if (
|
|
1242
|
+
if (_11 && !_11.done && (_9 = _10.return)) _9.call(_10);
|
|
1243
1243
|
}
|
|
1244
1244
|
finally { if (e_1) throw e_1.error; }
|
|
1245
1245
|
}
|
|
1246
1246
|
});
|
|
1247
1247
|
_initFilterDef.set(this, function () {
|
|
1248
|
-
var e_2,
|
|
1248
|
+
var e_2, _9;
|
|
1249
1249
|
_this.filterDefs = [];
|
|
1250
1250
|
try {
|
|
1251
|
-
for (var
|
|
1252
|
-
var filterDef =
|
|
1251
|
+
for (var _10 = __values(_this.sdFilterDefs), _11 = _10.next(); !_11.done; _11 = _10.next()) {
|
|
1252
|
+
var filterDef = _11.value;
|
|
1253
1253
|
_this.filterDefs.push(filterDef);
|
|
1254
1254
|
}
|
|
1255
1255
|
}
|
|
1256
1256
|
catch (e_2_1) { e_2 = { error: e_2_1 }; }
|
|
1257
1257
|
finally {
|
|
1258
1258
|
try {
|
|
1259
|
-
if (
|
|
1259
|
+
if (_11 && !_11.done && (_9 = _10.return)) _9.call(_10);
|
|
1260
1260
|
}
|
|
1261
1261
|
finally { if (e_2) throw e_2.error; }
|
|
1262
1262
|
}
|
|
1263
1263
|
});
|
|
1264
1264
|
_initFooterDef.set(this, function () {
|
|
1265
|
-
var e_3,
|
|
1265
|
+
var e_3, _9;
|
|
1266
1266
|
_this.footerDef = {};
|
|
1267
1267
|
_this.hasFooter = false;
|
|
1268
1268
|
try {
|
|
1269
|
-
for (var
|
|
1270
|
-
var footerDef =
|
|
1269
|
+
for (var _10 = __values(_this.sdFooterDefs), _11 = _10.next(); !_11.done; _11 = _10.next()) {
|
|
1270
|
+
var footerDef = _11.value;
|
|
1271
1271
|
if (footerDef.sdTableFooterDef) {
|
|
1272
1272
|
_this.hasFooter = true;
|
|
1273
1273
|
_this.footerDef[footerDef.sdTableFooterDef] = footerDef;
|
|
@@ -1277,14 +1277,14 @@
|
|
|
1277
1277
|
catch (e_3_1) { e_3 = { error: e_3_1 }; }
|
|
1278
1278
|
finally {
|
|
1279
1279
|
try {
|
|
1280
|
-
if (
|
|
1280
|
+
if (_11 && !_11.done && (_9 = _10.return)) _9.call(_10);
|
|
1281
1281
|
}
|
|
1282
1282
|
finally { if (e_3) throw e_3.error; }
|
|
1283
1283
|
}
|
|
1284
1284
|
});
|
|
1285
1285
|
_filterExportInfo.set(this, function (pageNumber, pageSize) {
|
|
1286
1286
|
var _a, _b;
|
|
1287
|
-
var
|
|
1287
|
+
var _9 = _this.filterRegister.value.get(), columnOperator = _9.columnOperator, columnFilter = _9.columnFilter, externalFilter = _9.externalFilter, filterDef = _9.filterDef;
|
|
1288
1288
|
return {
|
|
1289
1289
|
columnOperator: columnOperator || {},
|
|
1290
1290
|
rawColumnFilter: columnFilter || {},
|
|
@@ -1298,7 +1298,7 @@
|
|
|
1298
1298
|
};
|
|
1299
1299
|
});
|
|
1300
1300
|
_initConfiguration$1.set(this, function (option) {
|
|
1301
|
-
var e_4,
|
|
1301
|
+
var e_4, _9;
|
|
1302
1302
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7;
|
|
1303
1303
|
// Init pagination
|
|
1304
1304
|
option.paginate = {
|
|
@@ -1308,8 +1308,8 @@
|
|
|
1308
1308
|
showFirstLastButtons: (_q = (_p = option === null || option === void 0 ? void 0 : option.paginate) === null || _p === void 0 ? void 0 : _p.showFirstLastButtons) !== null && _q !== void 0 ? _q : false,
|
|
1309
1309
|
};
|
|
1310
1310
|
try {
|
|
1311
|
-
for (var
|
|
1312
|
-
var column =
|
|
1311
|
+
for (var _10 = __values(option.columns || []), _11 = _10.next(); !_11.done; _11 = _10.next()) {
|
|
1312
|
+
var column = _11.value;
|
|
1313
1313
|
if (((_s = (_r = column.filter) === null || _r === void 0 ? void 0 : _r.operator) === null || _s === void 0 ? void 0 : _s.enable) && !((_v = (_u = (_t = column.filter) === null || _t === void 0 ? void 0 : _t.operator) === null || _u === void 0 ? void 0 : _u.list) === null || _v === void 0 ? void 0 : _v.length)) {
|
|
1314
1314
|
if (column.type === 'string') {
|
|
1315
1315
|
column.filter.operator.list = ((_y = (_x = (_w = _this.tableConfiguration) === null || _w === void 0 ? void 0 : _w.filter) === null || _x === void 0 ? void 0 : _x.operator) === null || _y === void 0 ? void 0 : _y.defaultListString) || [];
|
|
@@ -1329,7 +1329,7 @@
|
|
|
1329
1329
|
catch (e_4_1) { e_4 = { error: e_4_1 }; }
|
|
1330
1330
|
finally {
|
|
1331
1331
|
try {
|
|
1332
|
-
if (
|
|
1332
|
+
if (_11 && !_11.done && (_9 = _10.return)) _9.call(_10);
|
|
1333
1333
|
}
|
|
1334
1334
|
finally { if (e_4) throw e_4.error; }
|
|
1335
1335
|
}
|
|
@@ -1368,7 +1368,7 @@
|
|
|
1368
1368
|
var columns = _this.gridOption.columns;
|
|
1369
1369
|
var rawColumnFilter = filterInfo.rawColumnFilter, orderBy = filterInfo.orderBy, orderDirection = filterInfo.orderDirection, pageSize = filterInfo.pageSize, pageNumber = filterInfo.pageNumber;
|
|
1370
1370
|
var items = localItems.filter(function (tableItem) {
|
|
1371
|
-
var e_5,
|
|
1371
|
+
var e_5, _9;
|
|
1372
1372
|
var _a, _b, _c, _d;
|
|
1373
1373
|
var item = tableItem.data;
|
|
1374
1374
|
try {
|
|
@@ -1449,7 +1449,7 @@
|
|
|
1449
1449
|
catch (e_5_1) { e_5 = { error: e_5_1 }; }
|
|
1450
1450
|
finally {
|
|
1451
1451
|
try {
|
|
1452
|
-
if (columns_1_1 && !columns_1_1.done && (
|
|
1452
|
+
if (columns_1_1 && !columns_1_1.done && (_9 = columns_1.return)) _9.call(columns_1);
|
|
1453
1453
|
}
|
|
1454
1454
|
finally { if (e_5) throw e_5.error; }
|
|
1455
1455
|
}
|
|
@@ -1495,7 +1495,7 @@
|
|
|
1495
1495
|
});
|
|
1496
1496
|
_getFilter.set(this, function () {
|
|
1497
1497
|
var _a, _b, _c, _d, _e, _f;
|
|
1498
|
-
var
|
|
1498
|
+
var _9 = _this.filterRegister.value.get(), columnOperator = _9.columnOperator, columnFilter = _9.columnFilter, externalFilter = _9.externalFilter, filterDef = _9.filterDef;
|
|
1499
1499
|
return {
|
|
1500
1500
|
columnOperator: columnOperator || {},
|
|
1501
1501
|
rawColumnFilter: columnFilter || {},
|
|
@@ -1510,10 +1510,10 @@
|
|
|
1510
1510
|
_load.set(this, function (filterReq, force) {
|
|
1511
1511
|
if (force === void 0) { force = true; }
|
|
1512
1512
|
return __awaiter(_this, void 0, void 0, function () {
|
|
1513
|
-
var items, data,
|
|
1513
|
+
var items, data, _9, items, results, data, _10, _11;
|
|
1514
1514
|
var _this = this;
|
|
1515
|
-
return __generator(this, function (
|
|
1516
|
-
switch (
|
|
1515
|
+
return __generator(this, function (_12) {
|
|
1516
|
+
switch (_12.label) {
|
|
1517
1517
|
case 0:
|
|
1518
1518
|
this.isLoading = true;
|
|
1519
1519
|
if (!(this.gridOption.type === 'server')) return [3 /*break*/, 3];
|
|
@@ -1527,13 +1527,13 @@
|
|
|
1527
1527
|
};
|
|
1528
1528
|
})];
|
|
1529
1529
|
case 1:
|
|
1530
|
-
data =
|
|
1530
|
+
data = _12.sent();
|
|
1531
1531
|
this.isLoading = false;
|
|
1532
|
-
|
|
1532
|
+
_9 = {};
|
|
1533
1533
|
return [4 /*yield*/, __classPrivateFieldGet(this, _format).call(this, data === null || data === void 0 ? void 0 : data.items, this.gridOption.columns)];
|
|
1534
|
-
case 2: return [2 /*return*/, (
|
|
1535
|
-
|
|
1536
|
-
|
|
1534
|
+
case 2: return [2 /*return*/, (_9.items = _12.sent(),
|
|
1535
|
+
_9.total = (data === null || data === void 0 ? void 0 : data.total) || 0,
|
|
1536
|
+
_9)];
|
|
1537
1537
|
case 3:
|
|
1538
1538
|
if (!force) return [3 /*break*/, 8];
|
|
1539
1539
|
items = this.gridOption.items;
|
|
@@ -1546,22 +1546,22 @@
|
|
|
1546
1546
|
return [];
|
|
1547
1547
|
})];
|
|
1548
1548
|
case 4:
|
|
1549
|
-
data =
|
|
1549
|
+
data = _12.sent();
|
|
1550
1550
|
return [3 /*break*/, 6];
|
|
1551
1551
|
case 5:
|
|
1552
1552
|
data = results;
|
|
1553
|
-
|
|
1553
|
+
_12.label = 6;
|
|
1554
1554
|
case 6:
|
|
1555
1555
|
if (!Array.isArray(data)) {
|
|
1556
1556
|
this.notifyService.notify.warning('Dữ liệu không phải là một mảng');
|
|
1557
1557
|
data = [];
|
|
1558
1558
|
}
|
|
1559
|
-
|
|
1560
|
-
|
|
1559
|
+
_10 = __classPrivateFieldSet;
|
|
1560
|
+
_11 = [this, _localItems];
|
|
1561
1561
|
return [4 /*yield*/, __classPrivateFieldGet(this, _format).call(this, data, this.gridOption.columns)];
|
|
1562
1562
|
case 7:
|
|
1563
|
-
|
|
1564
|
-
|
|
1563
|
+
_10.apply(void 0, _11.concat([_12.sent()]));
|
|
1564
|
+
_12.label = 8;
|
|
1565
1565
|
case 8:
|
|
1566
1566
|
this.isLoading = false;
|
|
1567
1567
|
return [2 /*return*/, __classPrivateFieldGet(this, _filterLocal).call(this, __classPrivateFieldGet(this, _localItems), filterReq)];
|
|
@@ -1571,15 +1571,15 @@
|
|
|
1571
1571
|
});
|
|
1572
1572
|
_render.set(this, function (args) { return __awaiter(_this, void 0, void 0, function () {
|
|
1573
1573
|
var _a, _b, _c, _d;
|
|
1574
|
-
return __generator(this, function (
|
|
1575
|
-
switch (
|
|
1574
|
+
return __generator(this, function (_9) {
|
|
1575
|
+
switch (_9.label) {
|
|
1576
1576
|
case 0:
|
|
1577
1577
|
(_a = this.sdScroll) === null || _a === void 0 ? void 0 : _a.scrollTop();
|
|
1578
1578
|
this.items = (args === null || args === void 0 ? void 0 : args.items) || [];
|
|
1579
1579
|
this.total = (args === null || args === void 0 ? void 0 : args.total) || 0;
|
|
1580
1580
|
return [4 /*yield*/, ((_d = (_c = (_b = this.gridOption) === null || _b === void 0 ? void 0 : _b.reload) === null || _c === void 0 ? void 0 : _c.onReload) === null || _d === void 0 ? void 0 : _d.call(_c, this.items))];
|
|
1581
1581
|
case 1:
|
|
1582
|
-
|
|
1582
|
+
_9.sent();
|
|
1583
1583
|
this.isSelectAll = this.items.every(function (e) { return e.meta.selector.isSelected; });
|
|
1584
1584
|
__classPrivateFieldGet(this, _updateSelectedItems).call(this);
|
|
1585
1585
|
return [2 /*return*/];
|
|
@@ -1590,13 +1590,13 @@
|
|
|
1590
1590
|
if (force === void 0) { force = true; }
|
|
1591
1591
|
return __awaiter(_this, void 0, void 0, function () {
|
|
1592
1592
|
var _e, _f, data;
|
|
1593
|
-
return __generator(this, function (
|
|
1594
|
-
switch (
|
|
1593
|
+
return __generator(this, function (_9) {
|
|
1594
|
+
switch (_9.label) {
|
|
1595
1595
|
case 0:
|
|
1596
1596
|
(_f = (_e = this.tableFilter) === null || _e === void 0 ? void 0 : _e.updateFilter) === null || _f === void 0 ? void 0 : _f.call(_e);
|
|
1597
1597
|
return [4 /*yield*/, __classPrivateFieldGet(this, _load).call(this, __classPrivateFieldGet(this, _getFilter).call(this), force)];
|
|
1598
1598
|
case 1:
|
|
1599
|
-
data =
|
|
1599
|
+
data = _9.sent();
|
|
1600
1600
|
__classPrivateFieldGet(this, _render).call(this, data);
|
|
1601
1601
|
return [2 /*return*/];
|
|
1602
1602
|
}
|
|
@@ -1608,8 +1608,8 @@
|
|
|
1608
1608
|
if (pageSize === void 0) { pageSize = 10000; }
|
|
1609
1609
|
return __awaiter(_this, void 0, void 0, function () {
|
|
1610
1610
|
var _g, _h, result, filterInfo, result, exportedItems, results;
|
|
1611
|
-
return __generator(this, function (
|
|
1612
|
-
switch (
|
|
1611
|
+
return __generator(this, function (_9) {
|
|
1612
|
+
switch (_9.label) {
|
|
1613
1613
|
case 0:
|
|
1614
1614
|
if (!((_g = this.gridOption.export) === null || _g === void 0 ? void 0 : _g.items)) return [3 /*break*/, 2];
|
|
1615
1615
|
result = (_h = this.gridOption.export) === null || _h === void 0 ? void 0 : _h.items(__classPrivateFieldGet(this, _filterExportInfo).call(this, pageNumber, pageSize));
|
|
@@ -1623,13 +1623,13 @@
|
|
|
1623
1623
|
result = result.toPromise();
|
|
1624
1624
|
}
|
|
1625
1625
|
return [4 /*yield*/, result];
|
|
1626
|
-
case 1: return [2 /*return*/,
|
|
1626
|
+
case 1: return [2 /*return*/, _9.sent()];
|
|
1627
1627
|
case 2:
|
|
1628
1628
|
filterInfo = __classPrivateFieldGet(this, _filterExportInfo).call(this, pageNumber, pageSize);
|
|
1629
1629
|
if (!(this.gridOption.type === 'server')) return [3 /*break*/, 4];
|
|
1630
1630
|
result = this.gridOption.items(filterInfo);
|
|
1631
1631
|
return [4 /*yield*/, result];
|
|
1632
|
-
case 3: return [2 /*return*/,
|
|
1632
|
+
case 3: return [2 /*return*/, _9.sent()];
|
|
1633
1633
|
case 4:
|
|
1634
1634
|
exportedItems = [];
|
|
1635
1635
|
if (!(typeof this.gridOption.items === 'function')) return [3 /*break*/, 8];
|
|
@@ -1637,15 +1637,15 @@
|
|
|
1637
1637
|
if (!(results instanceof Promise)) return [3 /*break*/, 6];
|
|
1638
1638
|
return [4 /*yield*/, results];
|
|
1639
1639
|
case 5:
|
|
1640
|
-
exportedItems =
|
|
1640
|
+
exportedItems = _9.sent();
|
|
1641
1641
|
return [3 /*break*/, 7];
|
|
1642
1642
|
case 6:
|
|
1643
1643
|
exportedItems = results;
|
|
1644
|
-
|
|
1644
|
+
_9.label = 7;
|
|
1645
1645
|
case 7: return [3 /*break*/, 9];
|
|
1646
1646
|
case 8:
|
|
1647
1647
|
exportedItems = this.gridOption.items;
|
|
1648
|
-
|
|
1648
|
+
_9.label = 9;
|
|
1649
1649
|
case 9: return [2 /*return*/, __classPrivateFieldGet(this, _filterLocal).call(this, exportedItems, filterInfo)];
|
|
1650
1650
|
}
|
|
1651
1651
|
});
|
|
@@ -1672,13 +1672,13 @@
|
|
|
1672
1672
|
return ((_b = (_a = _this.gridOption.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); })) || [];
|
|
1673
1673
|
});
|
|
1674
1674
|
_onExport.set(this, function (isCSV) { return __awaiter(_this, void 0, void 0, function () {
|
|
1675
|
-
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,
|
|
1676
|
-
var e_6,
|
|
1675
|
+
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, _9, _10, sheet, _11, _12, _13, e_6_1;
|
|
1676
|
+
var e_6, _14;
|
|
1677
1677
|
var _this = this;
|
|
1678
|
-
return __generator(this, function (
|
|
1679
|
-
switch (
|
|
1678
|
+
return __generator(this, function (_15) {
|
|
1679
|
+
switch (_15.label) {
|
|
1680
1680
|
case 0:
|
|
1681
|
-
|
|
1681
|
+
_15.trys.push([0, , 18, 19]);
|
|
1682
1682
|
columns_2 = __classPrivateFieldGet(this, _getExportColumns).call(this);
|
|
1683
1683
|
pageSize_1 = ((_k = (_j = this.gridOption) === null || _j === void 0 ? void 0 : _j.export) === null || _k === void 0 ? void 0 : _k.maxItemsPerRequest) || 1000;
|
|
1684
1684
|
batch = ((_m = (_l = this.gridOption) === null || _l === void 0 ? void 0 : _l.export) === null || _m === void 0 ? void 0 : _m.batch) || 1;
|
|
@@ -1690,13 +1690,13 @@
|
|
|
1690
1690
|
promises_1 = [];
|
|
1691
1691
|
handleData = function () { return __awaiter(_this, void 0, void 0, function () {
|
|
1692
1692
|
var _u, results, results_1, results_1_1, result, results_2, totalPage, percent, allColumns, allExportedColumns, _loop_1, exportItems_2, exportItems_2_1, item, e_7_1;
|
|
1693
|
-
var e_8,
|
|
1693
|
+
var e_8, _9, e_7, _10;
|
|
1694
1694
|
var _this = this;
|
|
1695
|
-
return __generator(this, function (
|
|
1696
|
-
switch (
|
|
1695
|
+
return __generator(this, function (_11) {
|
|
1696
|
+
switch (_11.label) {
|
|
1697
1697
|
case 0: return [4 /*yield*/, Promise.all(promises_1)];
|
|
1698
1698
|
case 1:
|
|
1699
|
-
results =
|
|
1699
|
+
results = _11.sent();
|
|
1700
1700
|
promises_1 = [];
|
|
1701
1701
|
exportItems_1 = [];
|
|
1702
1702
|
try {
|
|
@@ -1714,7 +1714,7 @@
|
|
|
1714
1714
|
catch (e_8_1) { e_8 = { error: e_8_1 }; }
|
|
1715
1715
|
finally {
|
|
1716
1716
|
try {
|
|
1717
|
-
if (results_1_1 && !results_1_1.done && (
|
|
1717
|
+
if (results_1_1 && !results_1_1.done && (_9 = results_1.return)) _9.call(results_1);
|
|
1718
1718
|
}
|
|
1719
1719
|
finally { if (e_8) throw e_8.error; }
|
|
1720
1720
|
}
|
|
@@ -1723,11 +1723,11 @@
|
|
|
1723
1723
|
if (!(results_2 instanceof Promise)) return [3 /*break*/, 3];
|
|
1724
1724
|
return [4 /*yield*/, results_2];
|
|
1725
1725
|
case 2:
|
|
1726
|
-
exportItems_1 =
|
|
1726
|
+
exportItems_1 = _11.sent();
|
|
1727
1727
|
return [3 /*break*/, 4];
|
|
1728
1728
|
case 3:
|
|
1729
1729
|
exportItems_1 = results_2;
|
|
1730
|
-
|
|
1730
|
+
_11.label = 4;
|
|
1731
1731
|
case 4:
|
|
1732
1732
|
totalPage = total_1 / pageSize_1;
|
|
1733
1733
|
percent = Math.round(((pageNumber_1 - 1) * 100.0) / totalPage);
|
|
@@ -1736,15 +1736,15 @@
|
|
|
1736
1736
|
allExportedColumns = __classPrivateFieldGet(this, _allExportedColumns).call(this);
|
|
1737
1737
|
_loop_1 = function (item) {
|
|
1738
1738
|
var obj, handle, columns_3, columns_3_1, exportColumn, e_9_1;
|
|
1739
|
-
var e_9,
|
|
1740
|
-
return __generator(this, function (
|
|
1741
|
-
switch (
|
|
1739
|
+
var e_9, _9;
|
|
1740
|
+
return __generator(this, function (_10) {
|
|
1741
|
+
switch (_10.label) {
|
|
1742
1742
|
case 0:
|
|
1743
1743
|
obj = {};
|
|
1744
1744
|
handle = function (exportColumn) { return __awaiter(_this, void 0, void 0, function () {
|
|
1745
|
-
var _v, _w, _x, _y, column, exportedColumn, transform,
|
|
1746
|
-
return __generator(this, function (
|
|
1747
|
-
switch (
|
|
1745
|
+
var _v, _w, _x, _y, column, exportedColumn, transform, _9, _10, date, date, date;
|
|
1746
|
+
return __generator(this, function (_11) {
|
|
1747
|
+
switch (_11.label) {
|
|
1748
1748
|
case 0:
|
|
1749
1749
|
obj[exportColumn.field] = item[exportColumn.field];
|
|
1750
1750
|
column = allColumns.find(function (e) { return e.field === exportColumn.field; });
|
|
@@ -1768,15 +1768,15 @@
|
|
|
1768
1768
|
isExport: true,
|
|
1769
1769
|
});
|
|
1770
1770
|
if (!(transform instanceof Promise)) return [3 /*break*/, 2];
|
|
1771
|
-
|
|
1772
|
-
|
|
1771
|
+
_9 = obj;
|
|
1772
|
+
_10 = column.field;
|
|
1773
1773
|
return [4 /*yield*/, transform];
|
|
1774
1774
|
case 1:
|
|
1775
|
-
|
|
1775
|
+
_9[_10] = _11.sent();
|
|
1776
1776
|
return [3 /*break*/, 3];
|
|
1777
1777
|
case 2:
|
|
1778
1778
|
obj[column.field] = transform;
|
|
1779
|
-
|
|
1779
|
+
_11.label = 3;
|
|
1780
1780
|
case 3:
|
|
1781
1781
|
obj[column.field] = (_v = obj[column.field]) !== null && _v !== void 0 ? _v : '';
|
|
1782
1782
|
return [3 /*break*/, 5];
|
|
@@ -1819,34 +1819,34 @@
|
|
|
1819
1819
|
else {
|
|
1820
1820
|
obj[column.field] = item[column.field];
|
|
1821
1821
|
}
|
|
1822
|
-
|
|
1822
|
+
_11.label = 5;
|
|
1823
1823
|
case 5: return [2 /*return*/];
|
|
1824
1824
|
}
|
|
1825
1825
|
});
|
|
1826
1826
|
}); };
|
|
1827
|
-
|
|
1827
|
+
_10.label = 1;
|
|
1828
1828
|
case 1:
|
|
1829
|
-
|
|
1829
|
+
_10.trys.push([1, 6, 7, 8]);
|
|
1830
1830
|
columns_3 = (e_9 = void 0, __values(columns_2)), columns_3_1 = columns_3.next();
|
|
1831
|
-
|
|
1831
|
+
_10.label = 2;
|
|
1832
1832
|
case 2:
|
|
1833
1833
|
if (!!columns_3_1.done) return [3 /*break*/, 5];
|
|
1834
1834
|
exportColumn = columns_3_1.value;
|
|
1835
1835
|
return [4 /*yield*/, handle(exportColumn)];
|
|
1836
1836
|
case 3:
|
|
1837
|
-
|
|
1838
|
-
|
|
1837
|
+
_10.sent();
|
|
1838
|
+
_10.label = 4;
|
|
1839
1839
|
case 4:
|
|
1840
1840
|
columns_3_1 = columns_3.next();
|
|
1841
1841
|
return [3 /*break*/, 2];
|
|
1842
1842
|
case 5: return [3 /*break*/, 8];
|
|
1843
1843
|
case 6:
|
|
1844
|
-
e_9_1 =
|
|
1844
|
+
e_9_1 = _10.sent();
|
|
1845
1845
|
e_9 = { error: e_9_1 };
|
|
1846
1846
|
return [3 /*break*/, 8];
|
|
1847
1847
|
case 7:
|
|
1848
1848
|
try {
|
|
1849
|
-
if (columns_3_1 && !columns_3_1.done && (
|
|
1849
|
+
if (columns_3_1 && !columns_3_1.done && (_9 = columns_3.return)) _9.call(columns_3);
|
|
1850
1850
|
}
|
|
1851
1851
|
finally { if (e_9) throw e_9.error; }
|
|
1852
1852
|
return [7 /*endfinally*/];
|
|
@@ -1856,29 +1856,29 @@
|
|
|
1856
1856
|
}
|
|
1857
1857
|
});
|
|
1858
1858
|
};
|
|
1859
|
-
|
|
1859
|
+
_11.label = 5;
|
|
1860
1860
|
case 5:
|
|
1861
|
-
|
|
1861
|
+
_11.trys.push([5, 10, 11, 12]);
|
|
1862
1862
|
exportItems_2 = __values(exportItems_1), exportItems_2_1 = exportItems_2.next();
|
|
1863
|
-
|
|
1863
|
+
_11.label = 6;
|
|
1864
1864
|
case 6:
|
|
1865
1865
|
if (!!exportItems_2_1.done) return [3 /*break*/, 9];
|
|
1866
1866
|
item = exportItems_2_1.value;
|
|
1867
1867
|
return [5 /*yield**/, _loop_1(item)];
|
|
1868
1868
|
case 7:
|
|
1869
|
-
|
|
1870
|
-
|
|
1869
|
+
_11.sent();
|
|
1870
|
+
_11.label = 8;
|
|
1871
1871
|
case 8:
|
|
1872
1872
|
exportItems_2_1 = exportItems_2.next();
|
|
1873
1873
|
return [3 /*break*/, 6];
|
|
1874
1874
|
case 9: return [3 /*break*/, 12];
|
|
1875
1875
|
case 10:
|
|
1876
|
-
e_7_1 =
|
|
1876
|
+
e_7_1 = _11.sent();
|
|
1877
1877
|
e_7 = { error: e_7_1 };
|
|
1878
1878
|
return [3 /*break*/, 12];
|
|
1879
1879
|
case 11:
|
|
1880
1880
|
try {
|
|
1881
|
-
if (exportItems_2_1 && !exportItems_2_1.done && (
|
|
1881
|
+
if (exportItems_2_1 && !exportItems_2_1.done && (_10 = exportItems_2.return)) _10.call(exportItems_2);
|
|
1882
1882
|
}
|
|
1883
1883
|
finally { if (e_7) throw e_7.error; }
|
|
1884
1884
|
return [7 /*endfinally*/];
|
|
@@ -1886,7 +1886,7 @@
|
|
|
1886
1886
|
}
|
|
1887
1887
|
});
|
|
1888
1888
|
}); };
|
|
1889
|
-
|
|
1889
|
+
_15.label = 1;
|
|
1890
1890
|
case 1:
|
|
1891
1891
|
if (!(pageNumber_1 * pageSize_1 < total_1)) return [3 /*break*/, 3];
|
|
1892
1892
|
promises_1.push(__classPrivateFieldGet(this, _exportedItems).call(this, pageNumber_1, pageSize_1));
|
|
@@ -1896,14 +1896,14 @@
|
|
|
1896
1896
|
}
|
|
1897
1897
|
return [4 /*yield*/, handleData()];
|
|
1898
1898
|
case 2:
|
|
1899
|
-
|
|
1899
|
+
_15.sent();
|
|
1900
1900
|
return [3 /*break*/, 1];
|
|
1901
1901
|
case 3:
|
|
1902
1902
|
if (!(promises_1.length > 0)) return [3 /*break*/, 5];
|
|
1903
1903
|
return [4 /*yield*/, handleData()];
|
|
1904
1904
|
case 4:
|
|
1905
|
-
|
|
1906
|
-
|
|
1905
|
+
_15.sent();
|
|
1906
|
+
_15.label = 5;
|
|
1907
1907
|
case 5:
|
|
1908
1908
|
if (!isCSV) return [3 /*break*/, 7];
|
|
1909
1909
|
return [4 /*yield*/, this.exportService.exportCSV({
|
|
@@ -1912,19 +1912,19 @@
|
|
|
1912
1912
|
fileName: (_p = (_o = this.gridOption) === null || _o === void 0 ? void 0 : _o.export) === null || _p === void 0 ? void 0 : _p.fileName,
|
|
1913
1913
|
})];
|
|
1914
1914
|
case 6:
|
|
1915
|
-
|
|
1915
|
+
_15.sent();
|
|
1916
1916
|
return [2 /*return*/];
|
|
1917
1917
|
case 7:
|
|
1918
1918
|
sheets = [];
|
|
1919
1919
|
if (!Array.isArray((_r = (_q = this.gridOption) === null || _q === void 0 ? void 0 : _q.export) === null || _r === void 0 ? void 0 : _r.sheets)) return [3 /*break*/, 16];
|
|
1920
|
-
|
|
1920
|
+
_15.label = 8;
|
|
1921
1921
|
case 8:
|
|
1922
|
-
|
|
1923
|
-
|
|
1924
|
-
|
|
1922
|
+
_15.trys.push([8, 14, 15, 16]);
|
|
1923
|
+
_9 = __values(this.gridOption.export.sheets), _10 = _9.next();
|
|
1924
|
+
_15.label = 9;
|
|
1925
1925
|
case 9:
|
|
1926
|
-
if (!!
|
|
1927
|
-
sheet =
|
|
1926
|
+
if (!!_10.done) return [3 /*break*/, 13];
|
|
1927
|
+
sheet = _10.value;
|
|
1928
1928
|
if (!(sheet.name && sheet.items && sheet.fields)) return [3 /*break*/, 12];
|
|
1929
1929
|
if (!Array.isArray(sheet.items)) return [3 /*break*/, 10];
|
|
1930
1930
|
sheets.push({
|
|
@@ -1934,27 +1934,27 @@
|
|
|
1934
1934
|
});
|
|
1935
1935
|
return [3 /*break*/, 12];
|
|
1936
1936
|
case 10:
|
|
1937
|
-
|
|
1938
|
-
|
|
1937
|
+
_12 = (_11 = sheets).push;
|
|
1938
|
+
_13 = {
|
|
1939
1939
|
name: sheet.name
|
|
1940
1940
|
};
|
|
1941
1941
|
return [4 /*yield*/, sheet.items()];
|
|
1942
1942
|
case 11:
|
|
1943
|
-
|
|
1944
|
-
|
|
1945
|
-
|
|
1946
|
-
|
|
1943
|
+
_12.apply(_11, [(_13.items = _15.sent(),
|
|
1944
|
+
_13.fields = sheet.fields,
|
|
1945
|
+
_13)]);
|
|
1946
|
+
_15.label = 12;
|
|
1947
1947
|
case 12:
|
|
1948
|
-
|
|
1948
|
+
_10 = _9.next();
|
|
1949
1949
|
return [3 /*break*/, 9];
|
|
1950
1950
|
case 13: return [3 /*break*/, 16];
|
|
1951
1951
|
case 14:
|
|
1952
|
-
e_6_1 =
|
|
1952
|
+
e_6_1 = _15.sent();
|
|
1953
1953
|
e_6 = { error: e_6_1 };
|
|
1954
1954
|
return [3 /*break*/, 16];
|
|
1955
1955
|
case 15:
|
|
1956
1956
|
try {
|
|
1957
|
-
if (
|
|
1957
|
+
if (_10 && !_10.done && (_14 = _9.return)) _14.call(_9);
|
|
1958
1958
|
}
|
|
1959
1959
|
finally { if (e_6) throw e_6.error; }
|
|
1960
1960
|
return [7 /*endfinally*/];
|
|
@@ -1965,7 +1965,7 @@
|
|
|
1965
1965
|
sheets: sheets,
|
|
1966
1966
|
})];
|
|
1967
1967
|
case 17:
|
|
1968
|
-
|
|
1968
|
+
_15.sent();
|
|
1969
1969
|
return [2 /*return*/];
|
|
1970
1970
|
case 18:
|
|
1971
1971
|
this.isExporting = false;
|
|
@@ -1997,7 +1997,7 @@
|
|
|
1997
1997
|
};
|
|
1998
1998
|
this.onExpand = function (rowData) { return __awaiter(_this, void 0, void 0, function () {
|
|
1999
1999
|
var _z, _0, _1, _2, _3, data;
|
|
2000
|
-
return __generator(this, function (
|
|
2000
|
+
return __generator(this, function (_9) {
|
|
2001
2001
|
if ((_z = this.gridOption.expand) === null || _z === void 0 ? void 0 : _z.always) {
|
|
2002
2002
|
return [2 /*return*/];
|
|
2003
2003
|
}
|
|
@@ -2072,7 +2072,7 @@
|
|
|
2072
2072
|
_this.filterRegister.value.remove();
|
|
2073
2073
|
};
|
|
2074
2074
|
this.setFilter = function (args) {
|
|
2075
|
-
var
|
|
2075
|
+
var _9 = args || {}, columnFilter = _9.columnFilter, externalFilter = _9.externalFilter, filterDef = _9.filterDef;
|
|
2076
2076
|
if (columnFilter) {
|
|
2077
2077
|
_this.columnFilter = columnFilter;
|
|
2078
2078
|
}
|
|
@@ -2085,9 +2085,9 @@
|
|
|
2085
2085
|
this.detectChanges = function () { return _this.ref.detectChanges(); };
|
|
2086
2086
|
_loadValues.set(this, function (columns) { return __awaiter(_this, void 0, void 0, function () {
|
|
2087
2087
|
var promises, _loop_2, this_1, columns_4, columns_4_1, column, results, _loop_3, this_2, results_3, results_3_1, result;
|
|
2088
|
-
var e_10,
|
|
2089
|
-
return __generator(this, function (
|
|
2090
|
-
switch (
|
|
2088
|
+
var e_10, _9, e_11, _10;
|
|
2089
|
+
return __generator(this, function (_11) {
|
|
2090
|
+
switch (_11.label) {
|
|
2091
2091
|
case 0:
|
|
2092
2092
|
promises = [];
|
|
2093
2093
|
_loop_2 = function (column) {
|
|
@@ -2113,11 +2113,11 @@
|
|
|
2113
2113
|
}
|
|
2114
2114
|
else {
|
|
2115
2115
|
this_1.cacheValues[column.field] = column.option.items.map(function (e) {
|
|
2116
|
-
var
|
|
2117
|
-
return (
|
|
2118
|
-
|
|
2119
|
-
|
|
2120
|
-
|
|
2116
|
+
var _9;
|
|
2117
|
+
return (_9 = {},
|
|
2118
|
+
_9[column.option.valueField] = e === null || e === void 0 ? void 0 : e[column.option.valueField],
|
|
2119
|
+
_9[column.option.displayField] = e === null || e === void 0 ? void 0 : e[column.option.displayField],
|
|
2120
|
+
_9);
|
|
2121
2121
|
});
|
|
2122
2122
|
__classPrivateFieldGet(this_1, _cacheObjValues)[column.field] = Array.toObject(this_1.cacheValues[column.field], column.option.valueField);
|
|
2123
2123
|
}
|
|
@@ -2133,21 +2133,21 @@
|
|
|
2133
2133
|
catch (e_10_1) { e_10 = { error: e_10_1 }; }
|
|
2134
2134
|
finally {
|
|
2135
2135
|
try {
|
|
2136
|
-
if (columns_4_1 && !columns_4_1.done && (
|
|
2136
|
+
if (columns_4_1 && !columns_4_1.done && (_9 = columns_4.return)) _9.call(columns_4);
|
|
2137
2137
|
}
|
|
2138
2138
|
finally { if (e_10) throw e_10.error; }
|
|
2139
2139
|
}
|
|
2140
2140
|
if (!promises.length) return [3 /*break*/, 2];
|
|
2141
2141
|
return [4 /*yield*/, Promise.all(promises)];
|
|
2142
2142
|
case 1:
|
|
2143
|
-
results =
|
|
2143
|
+
results = _11.sent();
|
|
2144
2144
|
_loop_3 = function (result) {
|
|
2145
2145
|
this_2.cacheValues[result.key] = result.data.map(function (e) {
|
|
2146
|
-
var
|
|
2147
|
-
return (
|
|
2148
|
-
|
|
2149
|
-
|
|
2150
|
-
|
|
2146
|
+
var _9;
|
|
2147
|
+
return (_9 = {},
|
|
2148
|
+
_9[result.valueField] = e === null || e === void 0 ? void 0 : e[result.valueField],
|
|
2149
|
+
_9[result.displayField] = e === null || e === void 0 ? void 0 : e[result.displayField],
|
|
2150
|
+
_9);
|
|
2151
2151
|
});
|
|
2152
2152
|
__classPrivateFieldGet(this_2, _cacheObjValues)[result.key] = Array.toObject(this_2.cacheValues[result.key], result.valueField);
|
|
2153
2153
|
};
|
|
@@ -2161,59 +2161,65 @@
|
|
|
2161
2161
|
catch (e_11_1) { e_11 = { error: e_11_1 }; }
|
|
2162
2162
|
finally {
|
|
2163
2163
|
try {
|
|
2164
|
-
if (results_3_1 && !results_3_1.done && (
|
|
2164
|
+
if (results_3_1 && !results_3_1.done && (_10 = results_3.return)) _10.call(results_3);
|
|
2165
2165
|
}
|
|
2166
2166
|
finally { if (e_11) throw e_11.error; }
|
|
2167
2167
|
}
|
|
2168
|
-
|
|
2168
|
+
_11.label = 2;
|
|
2169
2169
|
case 2: return [2 /*return*/];
|
|
2170
2170
|
}
|
|
2171
2171
|
});
|
|
2172
2172
|
}); });
|
|
2173
2173
|
_format.set(this, function (rawItems, columns) { return __awaiter(_this, void 0, void 0, function () {
|
|
2174
|
-
var _4, _5, _6, items, _loop_4, this_3, columns_5, columns_5_1, column, e_12_1;
|
|
2175
|
-
var e_12,
|
|
2174
|
+
var _4, _5, _6, _7, _8, items, _loop_4, this_3, columns_5, columns_5_1, column, e_12_1;
|
|
2175
|
+
var e_12, _9;
|
|
2176
2176
|
var _this = this;
|
|
2177
|
-
return __generator(this, function (
|
|
2178
|
-
switch (
|
|
2177
|
+
return __generator(this, function (_10) {
|
|
2178
|
+
switch (_10.label) {
|
|
2179
2179
|
case 0:
|
|
2180
2180
|
items = rawItems.map(MapToSdTableItem);
|
|
2181
2181
|
_loop_4 = function (column) {
|
|
2182
|
-
var field, cellStyle, click, tooltip, htmlTemplate, transform,
|
|
2183
|
-
var e_13,
|
|
2184
|
-
return __generator(this, function (
|
|
2185
|
-
switch (
|
|
2182
|
+
var field, cellStyle, click, tooltip, htmlTemplate, transform, _9, views, mapValue_1, values_1, lazyItems, _loop_5, items_2, items_2_1, item, e_13_1;
|
|
2183
|
+
var e_13, _10;
|
|
2184
|
+
return __generator(this, function (_11) {
|
|
2185
|
+
switch (_11.label) {
|
|
2186
2186
|
case 0:
|
|
2187
2187
|
field = column.field, cellStyle = column.cellStyle, click = column.click, tooltip = column.tooltip, htmlTemplate = column.htmlTemplate, transform = column.transform;
|
|
2188
|
-
if (!(column.type === 'lazy-values')) return [3 /*break*/, 2];
|
|
2188
|
+
if (!(!transform && !htmlTemplate && column.type === 'lazy-values' && typeof column.option.views === 'function')) return [3 /*break*/, 2];
|
|
2189
|
+
_9 = column.option, views = _9.views, mapValue_1 = _9.mapValue;
|
|
2189
2190
|
__classPrivateFieldGet(this_3, _cacheObjValues)[field] = __classPrivateFieldGet(this_3, _cacheObjValues)[field] || {};
|
|
2190
2191
|
values_1 = items
|
|
2191
|
-
.map(function (item) {
|
|
2192
|
+
.map(function (item) {
|
|
2193
|
+
var _a, _b;
|
|
2194
|
+
if (typeof mapValue_1 === 'function') {
|
|
2195
|
+
return mapValue_1((_a = item.data) === null || _a === void 0 ? void 0 : _a[field], item.data);
|
|
2196
|
+
}
|
|
2197
|
+
return (_b = item.data) === null || _b === void 0 ? void 0 : _b[field];
|
|
2198
|
+
})
|
|
2192
2199
|
.filter(function (val) { return (!!val || val === 0) && !Object.keys(__classPrivateFieldGet(_this, _cacheObjValues)[field]).includes(val); })
|
|
2193
2200
|
.union();
|
|
2194
|
-
|
|
2195
|
-
if (!(views && values_1.length)) return [3 /*break*/, 2];
|
|
2201
|
+
if (!values_1.length) return [3 /*break*/, 2];
|
|
2196
2202
|
return [4 /*yield*/, views(values_1).catch(function (err) {
|
|
2197
2203
|
console.error(err);
|
|
2198
2204
|
return [];
|
|
2199
2205
|
})];
|
|
2200
2206
|
case 1:
|
|
2201
|
-
lazyItems = (
|
|
2207
|
+
lazyItems = (_11.sent())
|
|
2202
2208
|
.filter(function (item) { return values_1.includes(item === null || item === void 0 ? void 0 : item[column.option.valueField]); })
|
|
2203
2209
|
.map(function (e) {
|
|
2204
|
-
var
|
|
2205
|
-
return (
|
|
2206
|
-
|
|
2207
|
-
|
|
2208
|
-
|
|
2210
|
+
var _9;
|
|
2211
|
+
return (_9 = {},
|
|
2212
|
+
_9[column.option.valueField] = e === null || e === void 0 ? void 0 : e[column.option.valueField],
|
|
2213
|
+
_9[column.option.displayField] = e === null || e === void 0 ? void 0 : e[column.option.displayField],
|
|
2214
|
+
_9);
|
|
2209
2215
|
});
|
|
2210
2216
|
Object.assign(__classPrivateFieldGet(this_3, _cacheObjValues)[field], Array.toObject(lazyItems, column.option.valueField) || {});
|
|
2211
|
-
|
|
2217
|
+
_11.label = 2;
|
|
2212
2218
|
case 2:
|
|
2213
2219
|
_loop_5 = function (item) {
|
|
2214
|
-
var rowData, value, display, newValue,
|
|
2215
|
-
return __generator(this, function (
|
|
2216
|
-
switch (
|
|
2220
|
+
var rowData, value, display, newValue, _9, date, time, option;
|
|
2221
|
+
return __generator(this, function (_10) {
|
|
2222
|
+
switch (_10.label) {
|
|
2217
2223
|
case 0:
|
|
2218
2224
|
rowData = item.data;
|
|
2219
2225
|
value = rowData === null || rowData === void 0 ? void 0 : rowData[field];
|
|
@@ -2234,14 +2240,14 @@
|
|
|
2234
2240
|
if (!(typeof transform === 'function')) return [3 /*break*/, 5];
|
|
2235
2241
|
newValue = transform(value, rowData);
|
|
2236
2242
|
if (!(newValue instanceof Promise)) return [3 /*break*/, 3];
|
|
2237
|
-
|
|
2243
|
+
_9 = display;
|
|
2238
2244
|
return [4 /*yield*/, newValue];
|
|
2239
2245
|
case 2:
|
|
2240
|
-
|
|
2246
|
+
_9.data = _10.sent();
|
|
2241
2247
|
return [3 /*break*/, 4];
|
|
2242
2248
|
case 3:
|
|
2243
2249
|
display.data = newValue;
|
|
2244
|
-
|
|
2250
|
+
_10.label = 4;
|
|
2245
2251
|
case 4: return [3 /*break*/, 6];
|
|
2246
2252
|
case 5:
|
|
2247
2253
|
if (column.type === 'date' || column.type === 'datetime' || column.type === 'time') {
|
|
@@ -2264,7 +2270,12 @@
|
|
|
2264
2270
|
}
|
|
2265
2271
|
}
|
|
2266
2272
|
if (column.type === 'values' || column.type === 'lazy-values') {
|
|
2267
|
-
|
|
2273
|
+
if (column.type === 'lazy-values' && typeof column.option.mapValue === 'function') {
|
|
2274
|
+
display.data = ((_5 = (_4 = __classPrivateFieldGet(this_3, _cacheObjValues)[field]) === null || _4 === void 0 ? void 0 : _4[column.option.mapValue(value, rowData)]) === null || _5 === void 0 ? void 0 : _5[column.option.displayField]) || value;
|
|
2275
|
+
}
|
|
2276
|
+
else {
|
|
2277
|
+
display.data = ((_7 = (_6 = __classPrivateFieldGet(this_3, _cacheObjValues)[field]) === null || _6 === void 0 ? void 0 : _6[value]) === null || _7 === void 0 ? void 0 : _7[column.option.displayField]) || value;
|
|
2278
|
+
}
|
|
2268
2279
|
}
|
|
2269
2280
|
if (column.type === 'number' && Number.isNumber(value)) {
|
|
2270
2281
|
display.data = Number.toVNCurrency(value);
|
|
@@ -2283,7 +2294,7 @@
|
|
|
2283
2294
|
display.badge = {
|
|
2284
2295
|
type: !(column === null || column === void 0 ? void 0 : column.badgeType) ? 'icon' : column.badgeType,
|
|
2285
2296
|
color: column.badge(value, rowData),
|
|
2286
|
-
icon: (
|
|
2297
|
+
icon: (_8 = column.badgeIcon) === null || _8 === void 0 ? void 0 : _8.call(column, value, rowData),
|
|
2287
2298
|
};
|
|
2288
2299
|
}
|
|
2289
2300
|
else if (column.type === 'bool') {
|
|
@@ -2293,34 +2304,34 @@
|
|
|
2293
2304
|
icon: null,
|
|
2294
2305
|
};
|
|
2295
2306
|
}
|
|
2296
|
-
|
|
2307
|
+
_10.label = 6;
|
|
2297
2308
|
case 6: return [2 /*return*/];
|
|
2298
2309
|
}
|
|
2299
2310
|
});
|
|
2300
2311
|
};
|
|
2301
|
-
|
|
2312
|
+
_11.label = 3;
|
|
2302
2313
|
case 3:
|
|
2303
|
-
|
|
2314
|
+
_11.trys.push([3, 8, 9, 10]);
|
|
2304
2315
|
items_2 = (e_13 = void 0, __values(items)), items_2_1 = items_2.next();
|
|
2305
|
-
|
|
2316
|
+
_11.label = 4;
|
|
2306
2317
|
case 4:
|
|
2307
2318
|
if (!!items_2_1.done) return [3 /*break*/, 7];
|
|
2308
2319
|
item = items_2_1.value;
|
|
2309
2320
|
return [5 /*yield**/, _loop_5(item)];
|
|
2310
2321
|
case 5:
|
|
2311
|
-
|
|
2312
|
-
|
|
2322
|
+
_11.sent();
|
|
2323
|
+
_11.label = 6;
|
|
2313
2324
|
case 6:
|
|
2314
2325
|
items_2_1 = items_2.next();
|
|
2315
2326
|
return [3 /*break*/, 4];
|
|
2316
2327
|
case 7: return [3 /*break*/, 10];
|
|
2317
2328
|
case 8:
|
|
2318
|
-
e_13_1 =
|
|
2329
|
+
e_13_1 = _11.sent();
|
|
2319
2330
|
e_13 = { error: e_13_1 };
|
|
2320
2331
|
return [3 /*break*/, 10];
|
|
2321
2332
|
case 9:
|
|
2322
2333
|
try {
|
|
2323
|
-
if (items_2_1 && !items_2_1.done && (
|
|
2334
|
+
if (items_2_1 && !items_2_1.done && (_10 = items_2.return)) _10.call(items_2);
|
|
2324
2335
|
}
|
|
2325
2336
|
finally { if (e_13) throw e_13.error; }
|
|
2326
2337
|
return [7 /*endfinally*/];
|
|
@@ -2329,29 +2340,29 @@
|
|
|
2329
2340
|
});
|
|
2330
2341
|
};
|
|
2331
2342
|
this_3 = this;
|
|
2332
|
-
|
|
2343
|
+
_10.label = 1;
|
|
2333
2344
|
case 1:
|
|
2334
|
-
|
|
2345
|
+
_10.trys.push([1, 6, 7, 8]);
|
|
2335
2346
|
columns_5 = __values(columns), columns_5_1 = columns_5.next();
|
|
2336
|
-
|
|
2347
|
+
_10.label = 2;
|
|
2337
2348
|
case 2:
|
|
2338
2349
|
if (!!columns_5_1.done) return [3 /*break*/, 5];
|
|
2339
2350
|
column = columns_5_1.value;
|
|
2340
2351
|
return [5 /*yield**/, _loop_4(column)];
|
|
2341
2352
|
case 3:
|
|
2342
|
-
|
|
2343
|
-
|
|
2353
|
+
_10.sent();
|
|
2354
|
+
_10.label = 4;
|
|
2344
2355
|
case 4:
|
|
2345
2356
|
columns_5_1 = columns_5.next();
|
|
2346
2357
|
return [3 /*break*/, 2];
|
|
2347
2358
|
case 5: return [3 /*break*/, 8];
|
|
2348
2359
|
case 6:
|
|
2349
|
-
e_12_1 =
|
|
2360
|
+
e_12_1 = _10.sent();
|
|
2350
2361
|
e_12 = { error: e_12_1 };
|
|
2351
2362
|
return [3 /*break*/, 8];
|
|
2352
2363
|
case 7:
|
|
2353
2364
|
try {
|
|
2354
|
-
if (columns_5_1 && !columns_5_1.done && (
|
|
2365
|
+
if (columns_5_1 && !columns_5_1.done && (_9 = columns_5.return)) _9.call(columns_5);
|
|
2355
2366
|
}
|
|
2356
2367
|
finally { if (e_12) throw e_12.error; }
|
|
2357
2368
|
return [7 /*endfinally*/];
|
|
@@ -2371,22 +2382,26 @@
|
|
|
2371
2382
|
this.gridOption = option;
|
|
2372
2383
|
__classPrivateFieldSet(this, _loadCompleted, false);
|
|
2373
2384
|
var setting = this.gridConfigurationService.init(this.gridOption);
|
|
2374
|
-
|
|
2375
|
-
|
|
2376
|
-
|
|
2377
|
-
|
|
2378
|
-
|
|
2379
|
-
|
|
2380
|
-
|
|
2381
|
-
|
|
2382
|
-
|
|
2383
|
-
|
|
2384
|
-
|
|
2385
|
-
|
|
2386
|
-
|
|
2387
|
-
|
|
2385
|
+
console.log(setting);
|
|
2386
|
+
if (setting) {
|
|
2387
|
+
__classPrivateFieldGet(this, _subscription$1).add(setting.observer.pipe(operators.startWith(setting.subject.getValue())).subscribe(function (configuration) {
|
|
2388
|
+
var configurationResult = _this.gridConfigurationService.loadConfigurationResult(_this.gridOption, configuration);
|
|
2389
|
+
var displayColumns = configurationResult.displayedColumns || [];
|
|
2390
|
+
__classPrivateFieldGet(_this, _loadValues).call(_this, _this.gridOption.columns.filter(function (column) { return displayColumns.includes(column.field); })).then(function () {
|
|
2391
|
+
_this.configuration = configurationResult;
|
|
2392
|
+
__classPrivateFieldGet(_this, _optionChanges).next(_this.gridOption);
|
|
2393
|
+
});
|
|
2394
|
+
}));
|
|
2395
|
+
}
|
|
2396
|
+
else {
|
|
2397
|
+
var configuration = this.gridConfigurationService.loadConfiguration(this.gridOption);
|
|
2398
|
+
var configurationResult_1 = this.gridConfigurationService.loadConfigurationResult(this.gridOption, configuration);
|
|
2399
|
+
var displayColumns_1 = configurationResult_1.displayedColumns || [];
|
|
2400
|
+
__classPrivateFieldGet(this, _loadValues).call(this, this.gridOption.columns.filter(function (column) { return displayColumns_1.includes(column.field); })).then(function () {
|
|
2401
|
+
_this.configuration = configurationResult_1;
|
|
2402
|
+
__classPrivateFieldGet(_this, _optionChanges).next(_this.gridOption);
|
|
2388
2403
|
});
|
|
2389
|
-
}
|
|
2404
|
+
}
|
|
2390
2405
|
}
|
|
2391
2406
|
},
|
|
2392
2407
|
enumerable: false,
|
|
@@ -2433,13 +2448,13 @@
|
|
|
2433
2448
|
var _this = this;
|
|
2434
2449
|
__classPrivateFieldGet(this, _subscription$1).add(__classPrivateFieldGet(this, _reload).pipe(operators.debounceTime(200), operators.switchMap(function (data) { return __awaiter(_this, void 0, void 0, function () {
|
|
2435
2450
|
var filterInfo, result;
|
|
2436
|
-
return __generator(this, function (
|
|
2437
|
-
switch (
|
|
2451
|
+
return __generator(this, function (_9) {
|
|
2452
|
+
switch (_9.label) {
|
|
2438
2453
|
case 0:
|
|
2439
2454
|
filterInfo = __classPrivateFieldGet(this, _getFilter).call(this);
|
|
2440
2455
|
return [4 /*yield*/, __classPrivateFieldGet(this, _load).call(this, filterInfo, !__classPrivateFieldGet(this, _loadCompleted) || data.force)];
|
|
2441
2456
|
case 1:
|
|
2442
|
-
result =
|
|
2457
|
+
result = _9.sent();
|
|
2443
2458
|
__classPrivateFieldSet(this, _loadCompleted, true);
|
|
2444
2459
|
return [2 /*return*/, result];
|
|
2445
2460
|
}
|
|
@@ -2480,7 +2495,7 @@
|
|
|
2480
2495
|
SdTable.decorators = [
|
|
2481
2496
|
{ type: core.Component, args: [{
|
|
2482
2497
|
selector: 'sd-table',
|
|
2483
|
-
template: "<ng-container *ngIf=\"configuration\">\r\n <sd-table-filter\r\n *ngIf=\"!gridOption.filter?.disabled && filterRegister\"\r\n [filterRegister]=\"filterRegister\"\r\n [filter]=\"gridOption?.filter\"\r\n [columns]=\"configuration.firstColumns\"\r\n [externalFilters]=\"gridOption?.filter?.externalFilters\"\r\n [filterDefs]=\"filterDefs\">\r\n </sd-table-filter>\r\n <ng-container *ngIf=\"items | sdGroup : gridOption; $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': gridOption?.style?.maxHeight,\r\n 'min-height': gridOption?.style?.minHeight\r\n }\">\r\n <table mat-table [dataSource]=\"groupedItems\" [trackBy]=\"trackBy\" matSort [matSortDisabled]=\"!gridOption.sort?.enable\" 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=\"gridOption?.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 && !gridOption?.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\r\n class=\"text-center px-15\"\r\n mat-header-cell\r\n *matHeaderCellDef\r\n style=\"min-width: 50px; max-width: 50px\"\r\n [attr.rowspan]=\"configuration.multipleHeader ? 2 : 1\">\r\n <ng-container *ngIf=\"items | selectionVisibleSelectAll : gridOption?.selector | async\">\r\n <mat-checkbox\r\n *ngIf=\"!gridOption.selector?.single\"\r\n class=\"c-selection\"\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 px-15\" mat-cell *matCellDef=\"let item\" style=\"min-width: 50px; max-width: 50px\">\r\n <ng-container *ngIf=\"item | selectionVisible : gridOption?.selector\">\r\n <mat-checkbox\r\n class=\"c-selection\"\r\n color=\"primary\"\r\n [(ngModel)]=\"item.isSelected\"\r\n (change)=\"onSelect(item)\"\r\n [disabled]=\"selectedItems | selectionDisable : item : gridOption?.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\">\r\n <th\r\n class=\"px-8 py-8\"\r\n mat-header-cell\r\n *matHeaderCellDef\r\n style=\"width: 50px\"\r\n [attr.rowspan]=\"configuration.multipleHeader ? 2 : 1\"></th>\r\n <td class=\"px-8\" mat-cell *matCellDef=\"let item\">\r\n <sd-desktop-command [commands]=\"gridOption.commands\" [item]=\"item\"></sd-desktop-command>\r\n </td>\r\n <td mat-footer-cell *matFooterCellDef></td>\r\n </ng-container>\r\n <ng-container 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=\"!gridOption.filter?.disabled && columnOperator\"\r\n [value]=\"columnFilter[column.field]\"\r\n [(inlineOperator)]=\"columnOperator[column.field]\"\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 [sdId]=\"item.meta.id\"\r\n [key]=\"key\"\r\n [value]=\"item[column.field]\"\r\n [column]=\"column\"\r\n [item]=\"item\"\r\n [cellDef]=\"cellDef\"\r\n [gridOption]=\"gridOption\">\r\n </sd-desktop-cell>\r\n </td>\r\n <td mat-footer-cell *matFooterCellDef>\r\n <ng-container *ngIf=\"footerDef[column.field]\">\r\n <ng-container *ngTemplateOutlet=\"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=\"!gridOption.filter?.disabled && columnOperator\"\r\n [value]=\"columnFilter[column.field]\"\r\n [(inlineOperator)]=\"columnOperator[column.field]\"\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 [sdId]=\"item.meta.id\"\r\n [key]=\"key\"\r\n [value]=\"item[column.field]\"\r\n [column]=\"column\"\r\n [item]=\"item\"\r\n [cellDef]=\"cellDef\"\r\n [gridOption]=\"gridOption\">\r\n </sd-desktop-cell>\r\n </td>\r\n <td mat-footer-cell *matFooterCellDef>\r\n <ng-container *ngIf=\"footerDef[column.field]\">\r\n <ng-container *ngTemplateOutlet=\"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.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 <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 <sd-button\r\n *ngIf=\"gridOption.reload?.visible\"\r\n class=\"mr-8\"\r\n [title]=\"'Reload' | sdTranslate\"\r\n icon=\"refresh\"\r\n size=\"sm\"\r\n (action)=\"reload()\"\r\n [disabled]=\"!items?.length\"\r\n type=\"link\">\r\n </sd-button>\r\n <ng-container *ngIf=\"gridOption.export?.visible && items?.length\">\r\n <ng-container *ngIf=\"isExporting; else unExporting\">\r\n <sd-button class=\"mr-10\" [loading]=\"isExporting\" [title]=\"exportTitle | sdTranslate\" icon=\"get_app\" size=\"sm\" type=\"link\">\r\n </sd-button>\r\n </ng-container>\r\n <ng-template #unExporting>\r\n <sd-button class=\"mr-10\" [title]=\"exportTitle | sdTranslate\" icon=\"get_app\" size=\"sm\" [matMenuTriggerFor]=\"menu\" type=\"link\">\r\n </sd-button>\r\n </ng-template>\r\n\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 <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 </div>\r\n <mat-paginator\r\n [class.d-none]=\"gridOption.paginate?.hidden\"\r\n [length]=\"total\"\r\n [pageSize]=\"gridOption.paginate?.pageSize\"\r\n [pageSizeOptions]=\"gridOption.paginate?.pages\"\r\n [showFirstLastButtons]=\"gridOption.paginate?.showFirstLastButtons\"></mat-paginator>\r\n </div>\r\n </div>\r\n <sd-table-quick-action [gridOption]=\"gridOption\" [selectedItems]=\"selectedItems\" (clear)=\"onClearSelection(groupedItems)\">\r\n </sd-table-quick-action>\r\n <sd-popup-configuration *ngIf=\"gridOption?.key && gridOption.config?.visible\" [gridOption]=\"gridOption\"> </sd-popup-configuration>\r\n </ng-container>\r\n</ng-container>\r\n",
|
|
2498
|
+
template: "<ng-container *ngIf=\"configuration\">\r\n <sd-table-filter\r\n *ngIf=\"!gridOption.filter?.disabled && filterRegister\"\r\n [filterRegister]=\"filterRegister\"\r\n [filter]=\"gridOption?.filter\"\r\n [columns]=\"configuration.firstColumns\"\r\n [externalFilters]=\"gridOption?.filter?.externalFilters\"\r\n [filterDefs]=\"filterDefs\">\r\n </sd-table-filter>\r\n <ng-container *ngIf=\"items | sdGroup : gridOption; $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': gridOption?.style?.maxHeight,\r\n 'min-height': gridOption?.style?.minHeight\r\n }\">\r\n <table mat-table [dataSource]=\"groupedItems\" [trackBy]=\"trackBy\" matSort [matSortDisabled]=\"!gridOption.sort?.enable\" 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=\"gridOption?.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 && !gridOption?.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\r\n class=\"text-center px-15\"\r\n mat-header-cell\r\n *matHeaderCellDef\r\n style=\"min-width: 50px; max-width: 50px\"\r\n [attr.rowspan]=\"configuration.multipleHeader ? 2 : 1\">\r\n <ng-container *ngIf=\"items | selectionVisibleSelectAll : gridOption?.selector | async\">\r\n <mat-checkbox\r\n *ngIf=\"!gridOption.selector?.single\"\r\n class=\"c-selection\"\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 px-15\" mat-cell *matCellDef=\"let item\" style=\"min-width: 50px; max-width: 50px\">\r\n <ng-container *ngIf=\"item | selectionVisible : gridOption?.selector\">\r\n <mat-checkbox\r\n class=\"c-selection\"\r\n color=\"primary\"\r\n [(ngModel)]=\"item.isSelected\"\r\n (change)=\"onSelect(item)\"\r\n [disabled]=\"selectedItems | selectionDisable : item : gridOption?.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\">\r\n <th\r\n class=\"px-8 py-8\"\r\n mat-header-cell\r\n *matHeaderCellDef\r\n style=\"width: 50px\"\r\n [attr.rowspan]=\"configuration.multipleHeader ? 2 : 1\"></th>\r\n <td class=\"px-8\" mat-cell *matCellDef=\"let item\">\r\n <sd-desktop-command [commands]=\"gridOption.commands\" [item]=\"item\"></sd-desktop-command>\r\n </td>\r\n <td mat-footer-cell *matFooterCellDef></td>\r\n </ng-container>\r\n <ng-container 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=\"!gridOption.filter?.disabled && columnOperator\"\r\n [value]=\"columnFilter[column.field]\"\r\n [(inlineOperator)]=\"columnOperator[column.field]\"\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 [gridOption]=\"gridOption\">\r\n </sd-desktop-cell>\r\n </td>\r\n <td mat-footer-cell *matFooterCellDef>\r\n <ng-container *ngIf=\"footerDef[column.field]\">\r\n <ng-container *ngTemplateOutlet=\"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=\"!gridOption.filter?.disabled && columnOperator\"\r\n [value]=\"columnFilter[column.field]\"\r\n [(inlineOperator)]=\"columnOperator[column.field]\"\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 [value]=\"item[column.field]\"\r\n [column]=\"column\"\r\n [item]=\"item\"\r\n [cellDef]=\"cellDef\"\r\n [gridOption]=\"gridOption\">\r\n </sd-desktop-cell>\r\n </td>\r\n <td mat-footer-cell *matFooterCellDef>\r\n <ng-container *ngIf=\"footerDef[column.field]\">\r\n <ng-container *ngTemplateOutlet=\"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.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 <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 <sd-button\r\n *ngIf=\"gridOption.reload?.visible\"\r\n class=\"mr-8\"\r\n [title]=\"'Reload' | sdTranslate\"\r\n icon=\"refresh\"\r\n size=\"sm\"\r\n (action)=\"reload()\"\r\n [disabled]=\"!items?.length\"\r\n type=\"link\">\r\n </sd-button>\r\n <ng-container *ngIf=\"gridOption.export?.visible && items?.length\">\r\n <ng-container *ngIf=\"isExporting; else unExporting\">\r\n <sd-button class=\"mr-10\" [loading]=\"isExporting\" [title]=\"exportTitle | sdTranslate\" icon=\"get_app\" size=\"sm\" type=\"link\">\r\n </sd-button>\r\n </ng-container>\r\n <ng-template #unExporting>\r\n <sd-button class=\"mr-10\" [title]=\"exportTitle | sdTranslate\" icon=\"get_app\" size=\"sm\" [matMenuTriggerFor]=\"menu\" type=\"link\">\r\n </sd-button>\r\n </ng-template>\r\n\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 <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 </div>\r\n <mat-paginator\r\n [class.d-none]=\"gridOption.paginate?.hidden\"\r\n [length]=\"total\"\r\n [pageSize]=\"gridOption.paginate?.pageSize\"\r\n [pageSizeOptions]=\"gridOption.paginate?.pages\"\r\n [showFirstLastButtons]=\"gridOption.paginate?.showFirstLastButtons\"></mat-paginator>\r\n </div>\r\n </div>\r\n <sd-table-quick-action [gridOption]=\"gridOption\" [selectedItems]=\"selectedItems\" (clear)=\"onClearSelection(groupedItems)\">\r\n </sd-table-quick-action>\r\n <sd-popup-configuration *ngIf=\"gridOption?.key && gridOption.config?.visible\" [gridOption]=\"gridOption\"> </sd-popup-configuration>\r\n </ng-container>\r\n</ng-container>\r\n",
|
|
2484
2499
|
changeDetection: core.ChangeDetectionStrategy.OnPush,
|
|
2485
2500
|
animations: [
|
|
2486
2501
|
animations.trigger('detailExpand', [
|
|
@@ -2721,8 +2736,6 @@
|
|
|
2721
2736
|
];
|
|
2722
2737
|
SdDesktopCellView.ctorParameters = function () { return []; };
|
|
2723
2738
|
SdDesktopCellView.propDecorators = {
|
|
2724
|
-
sdId: [{ type: core.Input }],
|
|
2725
|
-
key: [{ type: core.Input }],
|
|
2726
2739
|
column: [{ type: core.Input }],
|
|
2727
2740
|
item: [{ type: core.Input }],
|
|
2728
2741
|
gridOption: [{ type: core.Input }]
|
|
@@ -3108,15 +3121,13 @@
|
|
|
3108
3121
|
SdDesktopCell.decorators = [
|
|
3109
3122
|
{ type: core.Component, args: [{
|
|
3110
3123
|
selector: 'sd-desktop-cell',
|
|
3111
|
-
template: "<ng-container *ngIf=\"cellDef[column.field]\">\r\n <ng-container *ngTemplateOutlet=\"cellDef[column.field].templateRef; context: { item: item.data, column: column }\"> </ng-container>\r\n</ng-container>\r\n<sd-desktop-cell-view\r\n *ngIf=\"!cellDef[column.field]\"\r\n [
|
|
3124
|
+
template: "<ng-container *ngIf=\"cellDef[column.field]\">\r\n <ng-container *ngTemplateOutlet=\"cellDef[column.field].templateRef; context: { item: item.data, column: column }\"> </ng-container>\r\n</ng-container>\r\n<sd-desktop-cell-view\r\n *ngIf=\"!cellDef[column.field]\"\r\n [column]=\"column\"\r\n [gridOption]=\"gridOption\"\r\n [item]=\"item\">\r\n</sd-desktop-cell-view>\r\n",
|
|
3112
3125
|
changeDetection: core.ChangeDetectionStrategy.OnPush
|
|
3113
3126
|
},] }
|
|
3114
3127
|
];
|
|
3115
3128
|
SdDesktopCell.ctorParameters = function () { return []; };
|
|
3116
3129
|
SdDesktopCell.propDecorators = {
|
|
3117
|
-
sdId: [{ type: core.Input }],
|
|
3118
3130
|
value: [{ type: core.Input }],
|
|
3119
|
-
key: [{ type: core.Input }],
|
|
3120
3131
|
column: [{ type: core.Input }],
|
|
3121
3132
|
item: [{ type: core.Input }],
|
|
3122
3133
|
gridOption: [{ type: core.Input }],
|