@sd-angular/core 1.1.11 → 1.1.14
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-grid-material.umd.js +109 -109
- package/bundles/sd-angular-core-grid-material.umd.js.map +1 -1
- package/bundles/sd-angular-core-grid-material.umd.min.js +1 -1
- package/bundles/sd-angular-core-grid-material.umd.min.js.map +1 -1
- package/esm2015/grid-material/src/lib/grid-material.component.js +6 -6
- package/fesm2015/sd-angular-core-grid-material.js +5 -5
- package/fesm2015/sd-angular-core-grid-material.js.map +1 -1
- package/grid-material/sd-angular-core-grid-material.metadata.json +1 -1
- package/package.json +1 -1
- package/{sd-angular-core-1.1.11.tgz → sd-angular-core-1.1.14.tgz} +0 -0
|
@@ -1744,11 +1744,11 @@
|
|
|
1744
1744
|
this.isSelectAll = false;
|
|
1745
1745
|
this.exportTitle = 'Export';
|
|
1746
1746
|
_initCellDef.set(this, function () {
|
|
1747
|
-
var e_1,
|
|
1747
|
+
var e_1, _x;
|
|
1748
1748
|
_this.cellDef = {};
|
|
1749
1749
|
try {
|
|
1750
|
-
for (var
|
|
1751
|
-
var cellDef =
|
|
1750
|
+
for (var _y = __values(_this.sdCellDefs), _z = _y.next(); !_z.done; _z = _y.next()) {
|
|
1751
|
+
var cellDef = _z.value;
|
|
1752
1752
|
if (cellDef.sdMaterialCellDef) {
|
|
1753
1753
|
_this.cellDef[cellDef.sdMaterialCellDef] = cellDef;
|
|
1754
1754
|
}
|
|
@@ -1757,35 +1757,35 @@
|
|
|
1757
1757
|
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
1758
1758
|
finally {
|
|
1759
1759
|
try {
|
|
1760
|
-
if (
|
|
1760
|
+
if (_z && !_z.done && (_x = _y.return)) _x.call(_y);
|
|
1761
1761
|
}
|
|
1762
1762
|
finally { if (e_1) throw e_1.error; }
|
|
1763
1763
|
}
|
|
1764
1764
|
});
|
|
1765
1765
|
_initFilterDef.set(this, function () {
|
|
1766
|
-
var e_2,
|
|
1766
|
+
var e_2, _x;
|
|
1767
1767
|
_this.filterDefs = [];
|
|
1768
1768
|
try {
|
|
1769
|
-
for (var
|
|
1770
|
-
var filterDef =
|
|
1769
|
+
for (var _y = __values(_this.sdFilterDefs), _z = _y.next(); !_z.done; _z = _y.next()) {
|
|
1770
|
+
var filterDef = _z.value;
|
|
1771
1771
|
_this.filterDefs.push(filterDef);
|
|
1772
1772
|
}
|
|
1773
1773
|
}
|
|
1774
1774
|
catch (e_2_1) { e_2 = { error: e_2_1 }; }
|
|
1775
1775
|
finally {
|
|
1776
1776
|
try {
|
|
1777
|
-
if (
|
|
1777
|
+
if (_z && !_z.done && (_x = _y.return)) _x.call(_y);
|
|
1778
1778
|
}
|
|
1779
1779
|
finally { if (e_2) throw e_2.error; }
|
|
1780
1780
|
}
|
|
1781
1781
|
});
|
|
1782
1782
|
_initFooterDef.set(this, function () {
|
|
1783
|
-
var e_3,
|
|
1783
|
+
var e_3, _x;
|
|
1784
1784
|
_this.footerDef = {};
|
|
1785
1785
|
_this.hasFooter = false;
|
|
1786
1786
|
try {
|
|
1787
|
-
for (var
|
|
1788
|
-
var footerDef =
|
|
1787
|
+
for (var _y = __values(_this.sdFooterDefs), _z = _y.next(); !_z.done; _z = _y.next()) {
|
|
1788
|
+
var footerDef = _z.value;
|
|
1789
1789
|
if (footerDef.sdMaterialFooterDef) {
|
|
1790
1790
|
_this.hasFooter = true;
|
|
1791
1791
|
_this.footerDef[footerDef.sdMaterialFooterDef] = footerDef;
|
|
@@ -1795,7 +1795,7 @@
|
|
|
1795
1795
|
catch (e_3_1) { e_3 = { error: e_3_1 }; }
|
|
1796
1796
|
finally {
|
|
1797
1797
|
try {
|
|
1798
|
-
if (
|
|
1798
|
+
if (_z && !_z.done && (_x = _y.return)) _x.call(_y);
|
|
1799
1799
|
}
|
|
1800
1800
|
finally { if (e_3) throw e_3.error; }
|
|
1801
1801
|
}
|
|
@@ -1827,7 +1827,7 @@
|
|
|
1827
1827
|
var columns = _this.gridOption.columns;
|
|
1828
1828
|
var rawColumnFilter = filterInfo.rawColumnFilter, orderBy = filterInfo.orderBy, orderDirection = filterInfo.orderDirection, pageSize = filterInfo.pageSize, pageNumber = filterInfo.pageNumber;
|
|
1829
1829
|
var items = localItems.filter(function (item) {
|
|
1830
|
-
var e_4,
|
|
1830
|
+
var e_4, _x;
|
|
1831
1831
|
var _a, _b, _c, _d;
|
|
1832
1832
|
try {
|
|
1833
1833
|
for (var columns_1 = __values(columns), columns_1_1 = columns_1.next(); !columns_1_1.done; columns_1_1 = columns_1.next()) {
|
|
@@ -1901,7 +1901,7 @@
|
|
|
1901
1901
|
catch (e_4_1) { e_4 = { error: e_4_1 }; }
|
|
1902
1902
|
finally {
|
|
1903
1903
|
try {
|
|
1904
|
-
if (columns_1_1 && !columns_1_1.done && (
|
|
1904
|
+
if (columns_1_1 && !columns_1_1.done && (_x = columns_1.return)) _x.call(columns_1);
|
|
1905
1905
|
}
|
|
1906
1906
|
finally { if (e_4) throw e_4.error; }
|
|
1907
1907
|
}
|
|
@@ -1959,37 +1959,37 @@
|
|
|
1959
1959
|
_load$1.set(this, function (filterReq, force) {
|
|
1960
1960
|
if (force === void 0) { force = true; }
|
|
1961
1961
|
return __awaiter(_this, void 0, void 0, function () {
|
|
1962
|
-
var result, results,
|
|
1963
|
-
return __generator(this, function (
|
|
1964
|
-
switch (
|
|
1962
|
+
var result, results, _x, error_1;
|
|
1963
|
+
return __generator(this, function (_y) {
|
|
1964
|
+
switch (_y.label) {
|
|
1965
1965
|
case 0:
|
|
1966
1966
|
this.isLoading = true;
|
|
1967
|
-
|
|
1967
|
+
_y.label = 1;
|
|
1968
1968
|
case 1:
|
|
1969
|
-
|
|
1969
|
+
_y.trys.push([1, 8, 9, 10]);
|
|
1970
1970
|
if (!(this.gridOption.type === 'server')) return [3 /*break*/, 3];
|
|
1971
1971
|
result = this.gridOption.items(filterReq);
|
|
1972
1972
|
if (rxjs.isObservable(result)) {
|
|
1973
1973
|
result = result.toPromise();
|
|
1974
1974
|
}
|
|
1975
1975
|
return [4 /*yield*/, result];
|
|
1976
|
-
case 2: return [2 /*return*/,
|
|
1976
|
+
case 2: return [2 /*return*/, _y.sent()];
|
|
1977
1977
|
case 3:
|
|
1978
1978
|
if (!force) return [3 /*break*/, 6];
|
|
1979
1979
|
results = this.gridOption.items();
|
|
1980
1980
|
if (!(results instanceof Promise)) return [3 /*break*/, 5];
|
|
1981
|
-
|
|
1981
|
+
_x = this;
|
|
1982
1982
|
return [4 /*yield*/, results];
|
|
1983
1983
|
case 4:
|
|
1984
|
-
|
|
1984
|
+
_x.localItems = _y.sent();
|
|
1985
1985
|
return [3 /*break*/, 6];
|
|
1986
1986
|
case 5:
|
|
1987
1987
|
this.localItems = results;
|
|
1988
|
-
|
|
1988
|
+
_y.label = 6;
|
|
1989
1989
|
case 6: return [2 /*return*/, __classPrivateFieldGet(this, _filterLocal).call(this, this.localItems, filterReq)];
|
|
1990
1990
|
case 7: return [3 /*break*/, 10];
|
|
1991
1991
|
case 8:
|
|
1992
|
-
error_1 =
|
|
1992
|
+
error_1 = _y.sent();
|
|
1993
1993
|
this.notifyService.handle.error(error_1);
|
|
1994
1994
|
return [3 /*break*/, 10];
|
|
1995
1995
|
case 9:
|
|
@@ -2003,8 +2003,8 @@
|
|
|
2003
2003
|
});
|
|
2004
2004
|
_render.set(this, function (args) { return __awaiter(_this, void 0, void 0, function () {
|
|
2005
2005
|
var _a, _b, _c;
|
|
2006
|
-
return __generator(this, function (
|
|
2007
|
-
switch (
|
|
2006
|
+
return __generator(this, function (_x) {
|
|
2007
|
+
switch (_x.label) {
|
|
2008
2008
|
case 0:
|
|
2009
2009
|
this.items = (args === null || args === void 0 ? void 0 : args.items) || [];
|
|
2010
2010
|
this.total = (args === null || args === void 0 ? void 0 : args.total) || 0;
|
|
@@ -2014,7 +2014,7 @@
|
|
|
2014
2014
|
});
|
|
2015
2015
|
return [4 /*yield*/, ((_c = (_b = (_a = this.gridOption) === null || _a === void 0 ? void 0 : _a.reload) === null || _b === void 0 ? void 0 : _b.onReload) === null || _c === void 0 ? void 0 : _c.call(_b, this.items))];
|
|
2016
2016
|
case 1:
|
|
2017
|
-
|
|
2017
|
+
_x.sent();
|
|
2018
2018
|
this.isSelectAll = this.items.every(function (e) { return e.isSelected; });
|
|
2019
2019
|
__classPrivateFieldGet(this, _updateSelectedItems).call(this);
|
|
2020
2020
|
return [2 /*return*/];
|
|
@@ -2025,11 +2025,11 @@
|
|
|
2025
2025
|
if (force === void 0) { force = true; }
|
|
2026
2026
|
return __awaiter(_this, void 0, void 0, function () {
|
|
2027
2027
|
var data;
|
|
2028
|
-
return __generator(this, function (
|
|
2029
|
-
switch (
|
|
2028
|
+
return __generator(this, function (_x) {
|
|
2029
|
+
switch (_x.label) {
|
|
2030
2030
|
case 0: return [4 /*yield*/, __classPrivateFieldGet(this, _load$1).call(this, __classPrivateFieldGet(this, _getFilter).call(this), force)];
|
|
2031
2031
|
case 1:
|
|
2032
|
-
data =
|
|
2032
|
+
data = _x.sent();
|
|
2033
2033
|
__classPrivateFieldGet(this, _render).call(this, data);
|
|
2034
2034
|
return [2 /*return*/];
|
|
2035
2035
|
}
|
|
@@ -2041,8 +2041,8 @@
|
|
|
2041
2041
|
if (pageSize === void 0) { pageSize = 10000; }
|
|
2042
2042
|
return __awaiter(_this, void 0, void 0, function () {
|
|
2043
2043
|
var _d, _e, result, filterInfo, result, exportedItems, results;
|
|
2044
|
-
return __generator(this, function (
|
|
2045
|
-
switch (
|
|
2044
|
+
return __generator(this, function (_x) {
|
|
2045
|
+
switch (_x.label) {
|
|
2046
2046
|
case 0:
|
|
2047
2047
|
if (!((_d = this.gridOption.export) === null || _d === void 0 ? void 0 : _d.items)) return [3 /*break*/, 2];
|
|
2048
2048
|
result = (_e = this.gridOption.export) === null || _e === void 0 ? void 0 : _e.items(__classPrivateFieldGet(this, _filterExportInfo).call(this, pageNumber, pageSize));
|
|
@@ -2056,7 +2056,7 @@
|
|
|
2056
2056
|
result = result.toPromise();
|
|
2057
2057
|
}
|
|
2058
2058
|
return [4 /*yield*/, result];
|
|
2059
|
-
case 1: return [2 /*return*/,
|
|
2059
|
+
case 1: return [2 /*return*/, _x.sent()];
|
|
2060
2060
|
case 2:
|
|
2061
2061
|
filterInfo = __classPrivateFieldGet(this, _filterExportInfo).call(this, pageNumber, pageSize);
|
|
2062
2062
|
if (!(this.gridOption.type === 'server')) return [3 /*break*/, 4];
|
|
@@ -2065,7 +2065,7 @@
|
|
|
2065
2065
|
result = result.toPromise();
|
|
2066
2066
|
}
|
|
2067
2067
|
return [4 /*yield*/, result];
|
|
2068
|
-
case 3: return [2 /*return*/,
|
|
2068
|
+
case 3: return [2 /*return*/, _x.sent()];
|
|
2069
2069
|
case 4:
|
|
2070
2070
|
exportedItems = [];
|
|
2071
2071
|
if (!(typeof (this.gridOption.items) === 'function')) return [3 /*break*/, 8];
|
|
@@ -2073,15 +2073,15 @@
|
|
|
2073
2073
|
if (!(results instanceof Promise)) return [3 /*break*/, 6];
|
|
2074
2074
|
return [4 /*yield*/, results];
|
|
2075
2075
|
case 5:
|
|
2076
|
-
exportedItems =
|
|
2076
|
+
exportedItems = _x.sent();
|
|
2077
2077
|
return [3 /*break*/, 7];
|
|
2078
2078
|
case 6:
|
|
2079
2079
|
exportedItems = results;
|
|
2080
|
-
|
|
2080
|
+
_x.label = 7;
|
|
2081
2081
|
case 7: return [3 /*break*/, 9];
|
|
2082
2082
|
case 8:
|
|
2083
2083
|
exportedItems = this.gridOption.items;
|
|
2084
|
-
|
|
2084
|
+
_x.label = 9;
|
|
2085
2085
|
case 9: return [2 /*return*/, __classPrivateFieldGet(this, _filterLocal).call(this, exportedItems, filterInfo)];
|
|
2086
2086
|
}
|
|
2087
2087
|
});
|
|
@@ -2121,13 +2121,13 @@
|
|
|
2121
2121
|
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); })) || [];
|
|
2122
2122
|
});
|
|
2123
2123
|
_onExport.set(this, function (args) { return __awaiter(_this, void 0, void 0, function () {
|
|
2124
|
-
var _f, _g, _h, _j, _k, _l, _m, _o, _p, file, columns_2, isCSV, pageSize, total, pageNumber, exportItems, items, _loop_1, this_1, sheets,
|
|
2125
|
-
var e_5,
|
|
2124
|
+
var _f, _g, _h, _j, _k, _l, _m, _o, _p, file, columns_2, isCSV, pageSize, total, pageNumber, exportItems, items, _loop_1, this_1, sheets, _x, _y, sheet, _z, _0, _1, e_5_1;
|
|
2125
|
+
var e_5, _2;
|
|
2126
2126
|
var _this = this;
|
|
2127
|
-
return __generator(this, function (
|
|
2128
|
-
switch (
|
|
2127
|
+
return __generator(this, function (_3) {
|
|
2128
|
+
switch (_3.label) {
|
|
2129
2129
|
case 0:
|
|
2130
|
-
|
|
2130
|
+
_3.trys.push([0, , 18, 19]);
|
|
2131
2131
|
file = args.file, columns_2 = args.columns, isCSV = args.isCSV;
|
|
2132
2132
|
pageSize = ((_g = (_f = this.gridOption) === null || _f === void 0 ? void 0 : _f.export) === null || _g === void 0 ? void 0 : _g.maxItemsPerRequest) || 1000;
|
|
2133
2133
|
total = this.total;
|
|
@@ -2137,12 +2137,12 @@
|
|
|
2137
2137
|
items = [];
|
|
2138
2138
|
_loop_1 = function () {
|
|
2139
2139
|
var res, results, totalPage, percent, allColumns, allExportedColumns, _loop_2, exportItems_1, exportItems_1_1, item, e_6_1;
|
|
2140
|
-
var e_6,
|
|
2141
|
-
return __generator(this, function (
|
|
2142
|
-
switch (
|
|
2140
|
+
var e_6, _x;
|
|
2141
|
+
return __generator(this, function (_y) {
|
|
2142
|
+
switch (_y.label) {
|
|
2143
2143
|
case 0: return [4 /*yield*/, __classPrivateFieldGet(this_1, _exportedItems).call(this_1, pageNumber, pageSize)];
|
|
2144
2144
|
case 1:
|
|
2145
|
-
res =
|
|
2145
|
+
res = _y.sent();
|
|
2146
2146
|
if ('items' in res) {
|
|
2147
2147
|
exportItems = res.items;
|
|
2148
2148
|
total = res.total;
|
|
@@ -2156,11 +2156,11 @@
|
|
|
2156
2156
|
if (!(results instanceof Promise)) return [3 /*break*/, 3];
|
|
2157
2157
|
return [4 /*yield*/, results];
|
|
2158
2158
|
case 2:
|
|
2159
|
-
exportItems =
|
|
2159
|
+
exportItems = _y.sent();
|
|
2160
2160
|
return [3 /*break*/, 4];
|
|
2161
2161
|
case 3:
|
|
2162
2162
|
exportItems = results;
|
|
2163
|
-
|
|
2163
|
+
_y.label = 4;
|
|
2164
2164
|
case 4:
|
|
2165
2165
|
totalPage = total / pageSize;
|
|
2166
2166
|
percent = Math.round(pageNumber * 100.0 / totalPage);
|
|
@@ -2169,15 +2169,15 @@
|
|
|
2169
2169
|
allExportedColumns = __classPrivateFieldGet(this_1, _allExportedColumns).call(this_1);
|
|
2170
2170
|
_loop_2 = function (item) {
|
|
2171
2171
|
var obj, handle, columns_3, columns_3_1, exportColumn, e_7_1;
|
|
2172
|
-
var e_7,
|
|
2173
|
-
return __generator(this, function (
|
|
2174
|
-
switch (
|
|
2172
|
+
var e_7, _x;
|
|
2173
|
+
return __generator(this, function (_y) {
|
|
2174
|
+
switch (_y.label) {
|
|
2175
2175
|
case 0:
|
|
2176
2176
|
obj = {};
|
|
2177
2177
|
handle = function (exportColumn) { return __awaiter(_this, void 0, void 0, function () {
|
|
2178
|
-
var _q, _r, column, exportedColumn, date, transformDate, date, transformDate, date, transformDate,
|
|
2179
|
-
return __generator(this, function (
|
|
2180
|
-
switch (
|
|
2178
|
+
var _q, _r, column, exportedColumn, date, transformDate, date, transformDate, date, transformDate, _x, _y;
|
|
2179
|
+
return __generator(this, function (_z) {
|
|
2180
|
+
switch (_z.label) {
|
|
2181
2181
|
case 0:
|
|
2182
2182
|
obj[exportColumn.field] = item[exportColumn.field];
|
|
2183
2183
|
column = allColumns.find(function (e) { return e.field === exportColumn.field; });
|
|
@@ -2251,43 +2251,43 @@
|
|
|
2251
2251
|
case 7:
|
|
2252
2252
|
if (!(column.type === 'values')) return [3 /*break*/, 9];
|
|
2253
2253
|
// Nếu là values thì lấy giá trị của value được chọn
|
|
2254
|
-
|
|
2255
|
-
|
|
2254
|
+
_x = obj;
|
|
2255
|
+
_y = column.field;
|
|
2256
2256
|
return [4 /*yield*/, this.columnValuesPipe.transform(item[column.field], column)];
|
|
2257
2257
|
case 8:
|
|
2258
2258
|
// Nếu là values thì lấy giá trị của value được chọn
|
|
2259
|
-
|
|
2259
|
+
_x[_y] = _z.sent();
|
|
2260
2260
|
return [3 /*break*/, 10];
|
|
2261
2261
|
case 9:
|
|
2262
2262
|
obj[column.field] = item[column.field];
|
|
2263
|
-
|
|
2263
|
+
_z.label = 10;
|
|
2264
2264
|
case 10: return [2 /*return*/];
|
|
2265
2265
|
}
|
|
2266
2266
|
});
|
|
2267
2267
|
}); };
|
|
2268
|
-
|
|
2268
|
+
_y.label = 1;
|
|
2269
2269
|
case 1:
|
|
2270
|
-
|
|
2270
|
+
_y.trys.push([1, 6, 7, 8]);
|
|
2271
2271
|
columns_3 = (e_7 = void 0, __values(columns_2)), columns_3_1 = columns_3.next();
|
|
2272
|
-
|
|
2272
|
+
_y.label = 2;
|
|
2273
2273
|
case 2:
|
|
2274
2274
|
if (!!columns_3_1.done) return [3 /*break*/, 5];
|
|
2275
2275
|
exportColumn = columns_3_1.value;
|
|
2276
2276
|
return [4 /*yield*/, handle(exportColumn)];
|
|
2277
2277
|
case 3:
|
|
2278
|
-
|
|
2279
|
-
|
|
2278
|
+
_y.sent();
|
|
2279
|
+
_y.label = 4;
|
|
2280
2280
|
case 4:
|
|
2281
2281
|
columns_3_1 = columns_3.next();
|
|
2282
2282
|
return [3 /*break*/, 2];
|
|
2283
2283
|
case 5: return [3 /*break*/, 8];
|
|
2284
2284
|
case 6:
|
|
2285
|
-
e_7_1 =
|
|
2285
|
+
e_7_1 = _y.sent();
|
|
2286
2286
|
e_7 = { error: e_7_1 };
|
|
2287
2287
|
return [3 /*break*/, 8];
|
|
2288
2288
|
case 7:
|
|
2289
2289
|
try {
|
|
2290
|
-
if (columns_3_1 && !columns_3_1.done && (
|
|
2290
|
+
if (columns_3_1 && !columns_3_1.done && (_x = columns_3.return)) _x.call(columns_3);
|
|
2291
2291
|
}
|
|
2292
2292
|
finally { if (e_7) throw e_7.error; }
|
|
2293
2293
|
return [7 /*endfinally*/];
|
|
@@ -2297,29 +2297,29 @@
|
|
|
2297
2297
|
}
|
|
2298
2298
|
});
|
|
2299
2299
|
};
|
|
2300
|
-
|
|
2300
|
+
_y.label = 5;
|
|
2301
2301
|
case 5:
|
|
2302
|
-
|
|
2302
|
+
_y.trys.push([5, 10, 11, 12]);
|
|
2303
2303
|
exportItems_1 = (e_6 = void 0, __values(exportItems)), exportItems_1_1 = exportItems_1.next();
|
|
2304
|
-
|
|
2304
|
+
_y.label = 6;
|
|
2305
2305
|
case 6:
|
|
2306
2306
|
if (!!exportItems_1_1.done) return [3 /*break*/, 9];
|
|
2307
2307
|
item = exportItems_1_1.value;
|
|
2308
2308
|
return [5 /*yield**/, _loop_2(item)];
|
|
2309
2309
|
case 7:
|
|
2310
|
-
|
|
2311
|
-
|
|
2310
|
+
_y.sent();
|
|
2311
|
+
_y.label = 8;
|
|
2312
2312
|
case 8:
|
|
2313
2313
|
exportItems_1_1 = exportItems_1.next();
|
|
2314
2314
|
return [3 /*break*/, 6];
|
|
2315
2315
|
case 9: return [3 /*break*/, 12];
|
|
2316
2316
|
case 10:
|
|
2317
|
-
e_6_1 =
|
|
2317
|
+
e_6_1 = _y.sent();
|
|
2318
2318
|
e_6 = { error: e_6_1 };
|
|
2319
2319
|
return [3 /*break*/, 12];
|
|
2320
2320
|
case 11:
|
|
2321
2321
|
try {
|
|
2322
|
-
if (exportItems_1_1 && !exportItems_1_1.done && (
|
|
2322
|
+
if (exportItems_1_1 && !exportItems_1_1.done && (_x = exportItems_1.return)) _x.call(exportItems_1);
|
|
2323
2323
|
}
|
|
2324
2324
|
finally { if (e_6) throw e_6.error; }
|
|
2325
2325
|
return [7 /*endfinally*/];
|
|
@@ -2330,12 +2330,12 @@
|
|
|
2330
2330
|
});
|
|
2331
2331
|
};
|
|
2332
2332
|
this_1 = this;
|
|
2333
|
-
|
|
2333
|
+
_3.label = 1;
|
|
2334
2334
|
case 1:
|
|
2335
2335
|
if (!(pageNumber * pageSize < total)) return [3 /*break*/, 3];
|
|
2336
2336
|
return [5 /*yield**/, _loop_1()];
|
|
2337
2337
|
case 2:
|
|
2338
|
-
|
|
2338
|
+
_3.sent();
|
|
2339
2339
|
return [3 /*break*/, 1];
|
|
2340
2340
|
case 3:
|
|
2341
2341
|
if (!!(file === null || file === void 0 ? void 0 : file.filePath)) return [3 /*break*/, 16];
|
|
@@ -2346,19 +2346,19 @@
|
|
|
2346
2346
|
fileName: (_k = (_j = this.gridOption) === null || _j === void 0 ? void 0 : _j.export) === null || _k === void 0 ? void 0 : _k.fileName
|
|
2347
2347
|
})];
|
|
2348
2348
|
case 4:
|
|
2349
|
-
|
|
2349
|
+
_3.sent();
|
|
2350
2350
|
return [2 /*return*/];
|
|
2351
2351
|
case 5:
|
|
2352
2352
|
sheets = [];
|
|
2353
2353
|
if (!Array.isArray((_m = (_l = this.gridOption) === null || _l === void 0 ? void 0 : _l.export) === null || _m === void 0 ? void 0 : _m.sheets)) return [3 /*break*/, 14];
|
|
2354
|
-
|
|
2354
|
+
_3.label = 6;
|
|
2355
2355
|
case 6:
|
|
2356
|
-
|
|
2357
|
-
|
|
2358
|
-
|
|
2356
|
+
_3.trys.push([6, 12, 13, 14]);
|
|
2357
|
+
_x = __values(this.gridOption.export.sheets), _y = _x.next();
|
|
2358
|
+
_3.label = 7;
|
|
2359
2359
|
case 7:
|
|
2360
|
-
if (!!
|
|
2361
|
-
sheet =
|
|
2360
|
+
if (!!_y.done) return [3 /*break*/, 11];
|
|
2361
|
+
sheet = _y.value;
|
|
2362
2362
|
if (!(sheet.name && sheet.items && sheet.fields)) return [3 /*break*/, 10];
|
|
2363
2363
|
if (!Array.isArray(sheet.items)) return [3 /*break*/, 8];
|
|
2364
2364
|
sheets.push({
|
|
@@ -2368,27 +2368,27 @@
|
|
|
2368
2368
|
});
|
|
2369
2369
|
return [3 /*break*/, 10];
|
|
2370
2370
|
case 8:
|
|
2371
|
-
|
|
2372
|
-
|
|
2371
|
+
_0 = (_z = sheets).push;
|
|
2372
|
+
_1 = {
|
|
2373
2373
|
name: sheet.name
|
|
2374
2374
|
};
|
|
2375
2375
|
return [4 /*yield*/, sheet.items()];
|
|
2376
2376
|
case 9:
|
|
2377
|
-
|
|
2378
|
-
|
|
2379
|
-
|
|
2380
|
-
|
|
2377
|
+
_0.apply(_z, [(_1.items = _3.sent(),
|
|
2378
|
+
_1.fields = sheet.fields,
|
|
2379
|
+
_1)]);
|
|
2380
|
+
_3.label = 10;
|
|
2381
2381
|
case 10:
|
|
2382
|
-
|
|
2382
|
+
_y = _x.next();
|
|
2383
2383
|
return [3 /*break*/, 7];
|
|
2384
2384
|
case 11: return [3 /*break*/, 14];
|
|
2385
2385
|
case 12:
|
|
2386
|
-
e_5_1 =
|
|
2386
|
+
e_5_1 = _3.sent();
|
|
2387
2387
|
e_5 = { error: e_5_1 };
|
|
2388
2388
|
return [3 /*break*/, 14];
|
|
2389
2389
|
case 13:
|
|
2390
2390
|
try {
|
|
2391
|
-
if (
|
|
2391
|
+
if (_y && !_y.done && (_2 = _x.return)) _2.call(_x);
|
|
2392
2392
|
}
|
|
2393
2393
|
finally { if (e_5) throw e_5.error; }
|
|
2394
2394
|
return [7 /*endfinally*/];
|
|
@@ -2399,7 +2399,7 @@
|
|
|
2399
2399
|
sheets: sheets
|
|
2400
2400
|
})];
|
|
2401
2401
|
case 15:
|
|
2402
|
-
|
|
2402
|
+
_3.sent();
|
|
2403
2403
|
return [2 /*return*/];
|
|
2404
2404
|
case 16: return [4 /*yield*/, this.exportService.exportByTemplate({
|
|
2405
2405
|
filePath: file.filePath,
|
|
@@ -2408,7 +2408,7 @@
|
|
|
2408
2408
|
items: items
|
|
2409
2409
|
})];
|
|
2410
2410
|
case 17:
|
|
2411
|
-
|
|
2411
|
+
_3.sent();
|
|
2412
2412
|
return [3 /*break*/, 19];
|
|
2413
2413
|
case 18:
|
|
2414
2414
|
this.isExporting = false;
|
|
@@ -2422,7 +2422,7 @@
|
|
|
2422
2422
|
this.onExport = function (args) { return __awaiter(_this, void 0, void 0, function () {
|
|
2423
2423
|
var translate;
|
|
2424
2424
|
var _this = this;
|
|
2425
|
-
return __generator(this, function (
|
|
2425
|
+
return __generator(this, function (_x) {
|
|
2426
2426
|
translate = this.translateService.translate;
|
|
2427
2427
|
if (!args.isCSV && this.gridOption.export.max && this.total > this.gridOption.export.max) {
|
|
2428
2428
|
this.notifyService.confirm(translate("Total rows reach limit, do you want to export CSV")).then(function () {
|
|
@@ -2440,9 +2440,9 @@
|
|
|
2440
2440
|
_this.reload(false);
|
|
2441
2441
|
};
|
|
2442
2442
|
this.onExpand = function (rowData) { return __awaiter(_this, void 0, void 0, function () {
|
|
2443
|
-
var _s, _t, _u, _v, data;
|
|
2444
|
-
return __generator(this, function (
|
|
2445
|
-
if ((_s = this.
|
|
2443
|
+
var _s, _t, _u, _v, _w, data;
|
|
2444
|
+
return __generator(this, function (_x) {
|
|
2445
|
+
if ((_s = this.gridOption.subInformation) === null || _s === void 0 ? void 0 : _s.always) {
|
|
2446
2446
|
return [2 /*return*/];
|
|
2447
2447
|
}
|
|
2448
2448
|
if (rowData.isExpanding) {
|
|
@@ -2452,8 +2452,8 @@
|
|
|
2452
2452
|
rowData.isExpanded = false;
|
|
2453
2453
|
return [2 /*return*/];
|
|
2454
2454
|
}
|
|
2455
|
-
data = (_u = (_t = this.gridOption) === null || _t === void 0 ? void 0 : _t.subInformation) === null || _u === void 0 ? void 0 : _u.onExpand(rowData);
|
|
2456
|
-
if (!((
|
|
2455
|
+
data = (_v = (_u = (_t = this.gridOption) === null || _t === void 0 ? void 0 : _t.subInformation) === null || _u === void 0 ? void 0 : _u.onExpand) === null || _v === void 0 ? void 0 : _v.call(_u, rowData);
|
|
2456
|
+
if (!((_w = this.gridOption.subInformation) === null || _w === void 0 ? void 0 : _w.multiple)) {
|
|
2457
2457
|
this.items.forEach(function (item) { return item.isExpanding = item.isExpanded = false; });
|
|
2458
2458
|
}
|
|
2459
2459
|
if (data instanceof Promise) {
|
|
@@ -2523,7 +2523,7 @@
|
|
|
2523
2523
|
};
|
|
2524
2524
|
this.onCreate = function () {
|
|
2525
2525
|
var _a, _b;
|
|
2526
|
-
var
|
|
2526
|
+
var _x = _this.gridOption, type = _x.type, editor = _x.editor, columns = _x.columns;
|
|
2527
2527
|
if (!(editor === null || editor === void 0 ? void 0 : editor.addable)) {
|
|
2528
2528
|
return;
|
|
2529
2529
|
}
|
|
@@ -2579,23 +2579,23 @@
|
|
|
2579
2579
|
};
|
|
2580
2580
|
this.onSave = function (item) { return __awaiter(_this, void 0, void 0, function () {
|
|
2581
2581
|
var editor, result, message, result, err_1;
|
|
2582
|
-
return __generator(this, function (
|
|
2583
|
-
switch (
|
|
2582
|
+
return __generator(this, function (_x) {
|
|
2583
|
+
switch (_x.label) {
|
|
2584
2584
|
case 0:
|
|
2585
2585
|
if (item.editorHandlerRow.saving) {
|
|
2586
2586
|
return [2 /*return*/];
|
|
2587
2587
|
}
|
|
2588
2588
|
editor = this.gridOption.editor;
|
|
2589
|
-
|
|
2589
|
+
_x.label = 1;
|
|
2590
2590
|
case 1:
|
|
2591
|
-
|
|
2591
|
+
_x.trys.push([1, 7, 8, 9]);
|
|
2592
2592
|
item.editorHandlerRow.saving = true;
|
|
2593
2593
|
if (!editor.validate) return [3 /*break*/, 4];
|
|
2594
2594
|
result = editor.validate(item, this.items.indexOf(item));
|
|
2595
2595
|
if (!(result instanceof Promise)) return [3 /*break*/, 3];
|
|
2596
2596
|
return [4 /*yield*/, result];
|
|
2597
2597
|
case 2:
|
|
2598
|
-
message =
|
|
2598
|
+
message = _x.sent();
|
|
2599
2599
|
if (message) {
|
|
2600
2600
|
throw message;
|
|
2601
2601
|
}
|
|
@@ -2604,15 +2604,15 @@
|
|
|
2604
2604
|
if (result) {
|
|
2605
2605
|
throw result;
|
|
2606
2606
|
}
|
|
2607
|
-
|
|
2607
|
+
_x.label = 4;
|
|
2608
2608
|
case 4:
|
|
2609
2609
|
if (!editor.onSave) return [3 /*break*/, 6];
|
|
2610
2610
|
result = editor.onSave(item);
|
|
2611
2611
|
if (!(result instanceof Promise)) return [3 /*break*/, 6];
|
|
2612
2612
|
return [4 /*yield*/, result];
|
|
2613
2613
|
case 5:
|
|
2614
|
-
|
|
2615
|
-
|
|
2614
|
+
_x.sent();
|
|
2615
|
+
_x.label = 6;
|
|
2616
2616
|
case 6:
|
|
2617
2617
|
if (item.editorStatus === 'create' && editor.type === 'popup') {
|
|
2618
2618
|
if (this.gridOption.type === 'local') {
|
|
@@ -2623,7 +2623,7 @@
|
|
|
2623
2623
|
item.editorStatus = undefined;
|
|
2624
2624
|
return [3 /*break*/, 9];
|
|
2625
2625
|
case 7:
|
|
2626
|
-
err_1 =
|
|
2626
|
+
err_1 = _x.sent();
|
|
2627
2627
|
this.notifyService.notify.warning(err_1);
|
|
2628
2628
|
return [3 /*break*/, 9];
|
|
2629
2629
|
case 8:
|
|
@@ -2828,7 +2828,7 @@
|
|
|
2828
2828
|
SdGridMaterial.decorators = [
|
|
2829
2829
|
{ type: core.Component, args: [{
|
|
2830
2830
|
selector: 'sd-grid-material',
|
|
2831
|
-
template: "<ng-container *ngIf=\"gridConfigurationObserver | async as gridConfiguration\">\r\n <ng-container *ngIf=\"\r\n gridConfiguration\r\n | sdGridConfigurationResult\r\n : gridOption\r\n : sdSubInformation as configuration\r\n \">\r\n <ng-container *ngIf=\"!gridOption.filter?.disabled\">\r\n <sd-grid-filter [filter]=\"gridOption?.filter\" [columns]=\"configuration.firstColumns\" [filterDefs]=\"filterDefs\">\r\n </sd-grid-filter>\r\n </ng-container>\r\n <ng-container *ngIf=\"items | sdGroup:gridOption; $implicit as groupedItems\">\r\n <div class=\"c-container {{ gridOption?.style?.grid }}\" [ngClass]=\"{ 'mat-elevation-z2': gridOption?.shadow }\">\r\n <div class=\"c-loading\" *ngIf=\"isLoading\">\r\n <mat-spinner *ngIf=\"isLoading\"></mat-spinner>\r\n </div>\r\n <ng-container>\r\n <div class=\"c-table\" sdScroll [ngStyle]=\"{\r\n 'max-height': gridOption?.maxHeight,\r\n 'min-height': gridOption?.minHeight\r\n }\">\r\n <table *ngIf=\"items?.length; else elseEmpty\" mat-table [dataSource]=\"groupedItems\" matSort\r\n [matSortDisabled]=\"!gridOption.sortable\" cdkDropList cdkDropListOrientation=\"horizontal\"\r\n [cdkDropListDisabled]=\"!gridOption.dropDragColumnEnable\"\r\n (cdkDropListDropped)=\"drop($event, configuration.displayedColumns)\" multiTemplateDataRows>\r\n\r\n <ng-container matColumnDef=\"sdSubInformation\" sticky>\r\n <td class=\"p-0\" mat-cell *matCellDef=\"let item\" [attr.colspan]=\"configuration.displayedColumns.length\">\r\n <div *ngIf=\"sdSubInformation?.templateRef\"\r\n [@detailExpand]=\"item.isExpanded || option?.subInformation?.always ? 'expanded' : 'collapsed'\">\r\n <ng-container *ngIf=\"item.isExpanded || option?.subInformation?.always\">\r\n <ng-container *ngTemplateOutlet=\"\r\n sdSubInformation.templateRef;\r\n context: { item: item }\r\n \">\r\n </ng-container>\r\n </ng-container>\r\n </div>\r\n </td>\r\n <td mat-footer-cell *matFooterCellDef></td>\r\n </ng-container>\r\n <ng-container matColumnDef=\"sdSubInformationAction\" stickyEnd>\r\n <th class=\"p-0\" mat-header-cell *matHeaderCellDef style=\"width: 1px\"\r\n [attr.rowspan]=\"configuration.multipleHeader ? 2 : 1\"></th>\r\n <td mat-cell *matCellDef=\"let element\">\r\n <button *ngIf=\"!element.isExpanding && !option?.subInformation?.always\" mat-icon-button aria-label=\"Expand & Collapse\"\r\n (click)=\"onExpand(element)\">\r\n <mat-icon *ngIf=\"!element.isExpanded\">expand_more</mat-icon>\r\n <mat-icon *ngIf=\"element.isExpanded\">expand_less</mat-icon>\r\n </button>\r\n <div *ngIf=\"element.isExpanding\" class=\"lds-ring\">\r\n <div></div>\r\n <div></div>\r\n <div></div>\r\n <div></div>\r\n </div>\r\n </td>\r\n </ng-container>\r\n <ng-container matColumnDef=\"sdSelection\" sticky>\r\n <th class=\"text-center px-15\" mat-header-cell *matHeaderCellDef style=\"min-width: 50px; max-width: 50px\"\r\n [attr.rowspan]=\"configuration.multipleHeader ? 2 : 1\">\r\n <ng-container *ngIf=\"items | selectionVisibleSelectAll: gridOption?.selection | async\">\r\n <mat-checkbox *ngIf=\"!gridOption.selection?.single\" class=\"c-selection\" color=\"primary\"\r\n [(ngModel)]=\"isSelectAll\" (change)=\"onSelectAll()\">\r\n </mat-checkbox>\r\n </ng-container>\r\n\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?.selection\">\r\n <mat-checkbox class=\"c-selection\" color=\"primary\" [(ngModel)]=\"item.isSelected\"\r\n (change)=\"onSelect(item)\" [disabled]=\"\r\n selectedItems | selectionDisable: item:gridOption?.selection\r\n \">\r\n </mat-checkbox>\r\n </ng-container>\r\n\r\n </td>\r\n <td mat-footer-cell *matFooterCellDef></td>\r\n </ng-container>\r\n <ng-container matColumnDef=\"sdEditorValidation\">\r\n <th class=\"p-0\" mat-header-cell *matHeaderCellDef style=\"width: 2px\"\r\n [attr.rowspan]=\"configuration.multipleHeader ? 2 : 1\">\r\n </th>\r\n <td class=\"p-0 position-relative\" mat-cell *matCellDef=\"let item; index as idx\">\r\n <sd-desktop-editor-validation [sdId]=\"item.sdId\" [item]=\"item\" [items]=\"items\"\r\n [gridOption]=\"gridOption\">\r\n </sd-desktop-editor-validation>\r\n </td>\r\n <td mat-footer-cell *matFooterCellDef></td>\r\n </ng-container>\r\n <ng-container matColumnDef=\"sdEditor\">\r\n <th class=\"px-8 py-8\" mat-header-cell *matHeaderCellDef style=\"width: 50px\"\r\n [attr.rowspan]=\"configuration.multipleHeader ? 2 : 1\">\r\n <button class=\"c-btn-add\"\r\n *ngIf=\"gridOption.editor?.addable && (!gridOption.editor.limit || gridOption.editor.limit > items.length)\"\r\n (click)=\"onCreate()\" aria-hidden=\"true\" mat-icon-button>\r\n <mat-icon class=\"c-icon-add\">add</mat-icon>\r\n </button>\r\n </th>\r\n <td class=\"px-8\" mat-cell *matCellDef=\"let item; index as idx\">\r\n <ng-container *sdLet=\"item.editorStatus | sdEditorHandlerRow:item:gridOption as editorHandler\">\r\n <div *ngIf=\"editorHandler\" class=\"d-flex align-items-center justify-content-center\">\r\n <button *ngIf=\"editorHandler.editable\" class=\"mx-2\" (click)=\"onUpdate(item)\" aria-hidden=\"true\"\r\n mat-icon-button>\r\n <mat-icon class=\"c-icon\">edit</mat-icon>\r\n </button>\r\n <button *ngIf=\"editorHandler.removable\" class=\"mx-2\" (click)=\"onRemove(item)\" aria-hidden=\"true\"\r\n mat-icon-button>\r\n <mat-icon class=\"c-icon\">delete</mat-icon>\r\n </button>\r\n <button *ngIf=\"editorHandler.savable\" class=\"mx-2\" (click)=\"onSave(item)\" aria-hidden=\"true\"\r\n mat-icon-button>\r\n <mat-icon class=\"c-icon\">save</mat-icon>\r\n </button>\r\n <button *ngIf=\"editorHandler.cancelable\" class=\"mx-2\" (click)=\"onCancel(item)\" aria-hidden=\"true\"\r\n mat-icon-button>\r\n <mat-icon class=\"c-icon\">close</mat-icon>\r\n </button>\r\n </div>\r\n </ng-container>\r\n </td>\r\n <td mat-footer-cell *matFooterCellDef></td>\r\n </ng-container>\r\n <ng-container matColumnDef=\"sdCommand\">\r\n <th class=\"px-8 py-8\" mat-header-cell *matHeaderCellDef style=\"width: 50px\"\r\n [attr.rowspan]=\"configuration.multipleHeader ? 2 : 1\"></th>\r\n <td class=\"px-8\" mat-cell *matCellDef=\"let item\">\r\n <sd-desktop-command [commands]=\"gridOption.commands\" [item]=\"item\"></sd-desktop-command>\r\n </td>\r\n <td mat-footer-cell *matFooterCellDef></td>\r\n </ng-container>\r\n <ng-container matColumnDef=\"sdGroup\">\r\n <th mat-header-cell *matHeaderCellDef class=\"px-8 py-8\"\r\n [attr.rowspan]=\"configuration.multipleHeader ? 2 : 1\">\r\n </th>\r\n <td class=\"p-0\" mat-cell *matCellDef=\"let item\"\r\n [attr.colspan]=\"!item?.sdGroup ? 1 : configuration.displayedColumns.length\">\r\n <div [innerHtml]=\"item?.sdGroup?.htmlTemplate | safeHtml\">\r\n </div>\r\n </td>\r\n <td mat-footer-cell *matFooterCellDef></td>\r\n </ng-container>\r\n <ng-container *ngFor=\"let column of configuration.firstColumns; let i = index\"\r\n [matColumnDef]=\"column.field\" [sticky]=\"configuration.fixedColumn[column.field]\">\r\n <th mat-header-cell *matHeaderCellDef cdkDrag class=\"px-8 py-8 c-th\"\r\n [ngStyle]=\"{ 'min-width': configuration.firstColumns[i].width }\" [attr.rowspan]=\"\r\n configuration.multipleHeader && column.type !== 'children-col'\r\n ? 2\r\n : 1\r\n \" [attr.colspan]=\"\r\n column.type === 'children-col' ? column.children?.length : 1\r\n \">\r\n <div>\r\n <div aria-hidden=\"false\" role=\"presentation\" mat-sort-header [disabled]=\"\r\n !column.sortable || column.type === 'children-col'\r\n \" [class.text-right]=\"column.align === 'right' || (!column.align && column.type === 'number')\"\r\n [class.text-center]=\"column.align === 'center'\"\r\n [innerHTML]=\"configuration.firstColumns[i].titleHtml || configuration.firstColumns[i].title\">\r\n </div>\r\n <sd-column-inline-filter *ngIf=\"gridOption.filter?.inlineColumn\"\r\n [value]=\"columnFilter[column.field]\" [columnFilter]=\"columnFilter\" [column]=\"column\"\r\n (filterChange)=\"onFilterChange()\">\r\n </sd-column-inline-filter>\r\n </div>\r\n </th>\r\n <td class=\"c-td\" mat-cell *matCellDef=\"let item\">\r\n <sd-desktop-cell class=\"d-block px-8\" *ngIf=\"!item?.sdGroup\" [sdId]=\"item.sdId\" [key]=\"key\"\r\n [value]=\"item[column.field]\" [column]=\"column\" [item]=\"item\" [idx]=\"i\" [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=\"\r\n footerDef[column.field].templateRef;\r\n context: { items: items, column: column }\r\n \">\r\n </ng-container>\r\n </ng-container>\r\n </td>\r\n </ng-container>\r\n <ng-container *ngFor=\"let column of configuration.secondColumns; let i = index\"\r\n [matColumnDef]=\"column.field\">\r\n <th mat-header-cell *matHeaderCellDef mat-sort-header class=\"c-th px-8\"\r\n [ngStyle]=\"{ 'min-width': column.width }\">\r\n <div>\r\n <div [class.text-right]=\"column.align === 'right' || (!column.align && column.type === 'number')\"\r\n [class.text-center]=\"column.align === 'center'\" [innerHTML]=\"column.titleHtml || column.title\">\r\n </div>\r\n <sd-column-inline-filter *ngIf=\"gridOption.filter?.inlineColumn\"\r\n [value]=\"columnFilter[column.field]\" [columnFilter]=\"columnFilter\" [column]=\"column\"\r\n (filterChange)=\"onFilterChange()\">\r\n </sd-column-inline-filter>\r\n </div>\r\n </th>\r\n <td class=\"c-td\" mat-cell *matCellDef=\"let item\">\r\n <sd-desktop-cell class=\"d-block px-8\" [sdId]=\"item.sdId\" [key]=\"key\" [value]=\"item[column.field]\"\r\n [column]=\"column\" [item]=\"item\" [idx]=\"i\" [cellDef]=\"cellDef\" [gridOption]=\"gridOption\">\r\n </sd-desktop-cell>\r\n </td>\r\n <td mat-footer-cell *matFooterCellDef>\r\n <ng-container *ngIf=\"footerDef[column.field]\">\r\n <ng-container *ngTemplateOutlet=\"\r\n footerDef[column.field].templateRef;\r\n context: { items: items, column: column }\r\n \">\r\n </ng-container>\r\n </ng-container>\r\n </td>\r\n </ng-container>\r\n <tr class=\"c-first-header\" mat-header-row *matHeaderRowDef=\"configuration.firstHeaders; sticky: true\">\r\n </tr>\r\n <ng-container *ngIf=\"configuration.secondHeaders?.length\">\r\n <tr class=\"c-second-header\" mat-header-row *matHeaderRowDef=\"configuration.secondHeaders; sticky: true\">\r\n </tr>\r\n </ng-container>\r\n <tr mat-row *matRowDef=\"let row; columns: configuration.displayedColumns\" matRipple class=\"c-row\"\r\n [class.selected]=\"row.isSelected\" [style]=\"row | sdStyleRowCss:gridOption\"></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 <ng-template #elseEmpty>\r\n <table mat-table [dataSource]=\"[{}]\">\r\n <ng-container matColumnDef=\"sdSelection\" sticky>\r\n <th class=\"px-15\" mat-header-cell *matHeaderCellDef style=\"min-width: 50px; max-width: 50px\"\r\n [attr.rowspan]=\"configuration.multipleHeader ? 2 : 1\"></th>\r\n </ng-container>\r\n <ng-container matColumnDef=\"sdEditorValidation\">\r\n <th class=\"p-0\" mat-header-cell *matHeaderCellDef style=\"width: 4px\"\r\n [attr.rowspan]=\"configuration.multipleHeader ? 2 : 1\">\r\n </th>\r\n <td class=\"p-0\" mat-cell *matCellDef=\"let item\">\r\n </td>\r\n <td mat-footer-cell *matFooterCellDef></td>\r\n </ng-container>\r\n <ng-container matColumnDef=\"sdEditor\">\r\n <th class=\"px-8 py-8\" mat-header-cell *matHeaderCellDef style=\"min-width: 50px; max-width: 50px\"\r\n [attr.rowspan]=\"configuration.multipleHeader ? 2 : 1\">\r\n <button class=\"c-btn-add\"\r\n *ngIf=\"gridOption.editor?.addable && (!gridOption.editor.limit || gridOption.editor.limit > items.length)\"\r\n (click)=\"onCreate()\" aria-hidden=\"true\" mat-icon-button>\r\n <mat-icon class=\"c-icon-add\">add</mat-icon>\r\n </button>\r\n </th>\r\n </ng-container>\r\n <ng-container matColumnDef=\"sdCommand\">\r\n <th class=\"px-8\" mat-header-cell *matHeaderCellDef style=\"min-width: 50px; max-width: 50px\"\r\n [attr.rowspan]=\"configuration.multipleHeader ? 2 : 1\"></th>\r\n </ng-container>\r\n <ng-container matColumnDef=\"sdSubInformationAction\">\r\n <th class=\"p-0\" mat-header-cell *matHeaderCellDef style=\"width: 1px\"\r\n [attr.rowspan]=\"configuration.multipleHeader ? 2 : 1\"></th>\r\n </ng-container>\r\n <ng-container matColumnDef=\"sdEmpty\">\r\n <td class=\"c-empty\" mat-cell *matCellDef=\"let item\"\r\n [attr.colspan]=\"configuration.displayedColumns.length\">\r\n <ng-container *ngIf=\"sdEmptyData?.templateRef; else sdEmptyDataNoRef\">\r\n <ng-container *ngTemplateOutlet=\"\r\n sdEmptyData.templateRef;\r\n context: { item: item }\r\n \">\r\n </ng-container>\r\n </ng-container>\r\n <ng-template #sdEmptyDataNoRef>\r\n <mat-icon fontSet=\"material-icons-outlined\">leaderboard</mat-icon>\r\n </ng-template>\r\n </td>\r\n </ng-container>\r\n <ng-container matColumnDef=\"sdGroup\">\r\n <th mat-header-cell *matHeaderCellDef class=\"px-8 py-8\"\r\n [attr.rowspan]=\"configuration.multipleHeader ? 2 : 1\">\r\n </th>\r\n <td class=\"p-0\" mat-cell *matCellDef=\"let item\">\r\n </td>\r\n <td mat-footer-cell *matFooterCellDef></td>\r\n </ng-container>\r\n <ng-container *ngFor=\"let column of configuration.columns\" [matColumnDef]=\"column.field\"\r\n [sticky]=\"configuration.fixedColumn[column.field]\">\r\n <th mat-header-cell *matHeaderCellDef class=\"c-th px-8 py-8\"\r\n [ngStyle]=\"{ 'min-width': column.width }\">\r\n <div [class.text-right]=\"column.align === 'right' || (!column.align && column.type === 'number')\"\r\n [class.text-center]=\"column.align === 'center'\" [innerHTML]=\"column.titleHtml || column.title\">\r\n </div>\r\n </th>\r\n </ng-container>\r\n <ng-container *ngFor=\"let column of configuration.firstColumns; let i = index\"\r\n [matColumnDef]=\"column.field\" [sticky]=\"configuration.fixedColumn[column.field]\">\r\n <th mat-header-cell *matHeaderCellDef class=\"c-th px-8 py-8\"\r\n [ngStyle]=\"{ 'min-width': configuration.firstColumns[i].width }\" [attr.rowspan]=\"\r\n configuration.multipleHeader &&\r\n column.type !== 'children-col'\r\n ? 2\r\n : 1\r\n \" [attr.colspan]=\"\r\n column.type === 'children-col' ? column.children?.length : 1\r\n \">\r\n <div>\r\n <div [class.text-right]=\"column.align === 'right' || (!column.align && column.type === 'number')\"\r\n [class.text-center]=\"column.align === 'center'\"\r\n [innerHTML]=\"configuration.firstColumns[i].titleHtml || configuration.firstColumns[i].title\">\r\n </div>\r\n <sd-column-inline-filter *ngIf=\"gridOption.filter?.inlineColumn\"\r\n [value]=\"columnFilter[column.field]\" [columnFilter]=\"columnFilter\" [column]=\"column\"\r\n (filterChange)=\"onFilterChange()\"></sd-column-inline-filter>\r\n </div>\r\n </th>\r\n </ng-container>\r\n <ng-container *ngFor=\"let column of configuration.secondColumns\" [matColumnDef]=\"column.field\">\r\n <th mat-header-cell *matHeaderCellDef class=\"c-th px-8 py-8\"\r\n [ngStyle]=\"{ 'min-width': column.width }\">\r\n <div>\r\n <div [class.text-right]=\"column.align === 'right' || (!column.align && column.type === 'number')\"\r\n [class.text-center]=\"column.align === 'center'\" [innerHTML]=\"column.titleHtml || column.title\">\r\n </div>\r\n <sd-column-inline-filter *ngIf=\"gridOption.filter?.inlineColumn\"\r\n [value]=\"columnFilter[column.field]\" [columnFilter]=\"columnFilter\" [column]=\"column\"\r\n (filterChange)=\"onFilterChange()\"></sd-column-inline-filter>\r\n </div>\r\n </th>\r\n </ng-container>\r\n <tr class=\"c-first-header\" mat-header-row *matHeaderRowDef=\"configuration.firstHeaders; sticky: true\">\r\n </tr>\r\n <tr class=\"c-second-header\" mat-header-row *matHeaderRowDef=\"configuration.secondHeaders; sticky: true\">\r\n </tr>\r\n <tr mat-row *matRowDef=\"let row; columns: ['sdEmpty']\"></tr>\r\n </table>\r\n </ng-template>\r\n </div>\r\n </ng-container>\r\n <div class=\"c-paginator\">\r\n <div class=\"c-action\">\r\n <sd-button *ngIf=\"\r\n !gridOption.filter?.disabled && !gridOption.filter?.inlineColumn\r\n \" class=\"mr-10\" [title]=\"'Filter' | sdTranslate\" icon=\"filter_alt\" size=\"sm\" (action)=\"gridFilter.open()\"\r\n type=\"link\">\r\n </sd-button>\r\n <sd-button *ngIf=\"gridOption.reload?.visible\" class=\"mr-10\" [title]=\"'Reload' | sdTranslate\" icon=\"refresh\"\r\n size=\"sm\" (action)=\"reload()\" [disabled]=\"!items?.length\" type=\"link\">\r\n </sd-button>\r\n <ng-container *ngIf=\"gridOption.export?.visible && items?.length\">\r\n <ng-container *ngIf=\"isExporting; else unExporting\">\r\n <sd-button class=\"mr-10\" [loading]=\"isExporting\" [title]=\"exportTitle | sdTranslate\" icon=\"get_app\"\r\n size=\"sm\" type=\"link\">\r\n </sd-button>\r\n </ng-container>\r\n <ng-template #unExporting>\r\n <sd-button class=\"mr-10\" [title]=\"exportTitle | sdTranslate\" icon=\"get_app\" size=\"sm\"\r\n [matMenuTriggerFor]=\"menu\" type=\"link\">\r\n </sd-button>\r\n </ng-template>\r\n\r\n <mat-menu #menu=\"matMenu\">\r\n <button *ngIf=\"gridOption.export?.visibleExcel !== false\" mat-menu-item\r\n (click)=\"sdPopupExport.exportDefault()\" type=\"button\">\r\n <mat-icon fontSet=\"material-icons-outlined\">file_download</mat-icon>\r\n <span> {{ \"Export excel\" | sdTranslate }}</span>\r\n </button>\r\n <button *ngIf=\"gridOption.export?.visibleCSV !== false\" mat-menu-item\r\n (click)=\"sdPopupExport.exportDefault(true)\" type=\"button\">\r\n <mat-icon fontSet=\"material-icons-outlined\">file_download</mat-icon>\r\n <span> {{ \"Export CSV\" | sdTranslate }}</span>\r\n </button>\r\n <button *ngIf=\"gridOption.export?.key\" mat-menu-item (click)=\"sdPopupExport.open()\" type=\"button\">\r\n <mat-icon fontSet=\"material-icons-outlined\">settings</mat-icon>\r\n <span> {{ \"Configure\" | sdTranslate }}</span>\r\n </button>\r\n </mat-menu>\r\n </ng-container>\r\n <sd-button *ngIf=\"gridOption.config?.visible\" class=\"mr-10\" [title]=\"'Configure' | sdTranslate\"\r\n icon=\"settings\" size=\"sm\" (action)=\"popupGridConfiguration.open()\" type=\"link\">\r\n </sd-button>\r\n </div>\r\n <mat-paginator [class.d-none]=\"gridOption.paginate?.hidden\" [length]=\"total\"\r\n [pageSize]=\"gridOption.paginate?.pageSize\" [pageSizeOptions]=\"gridOption.paginate?.pages\"\r\n [showFirstLastButtons]=\"gridOption.paginate?.showFirstLastButtons\"></mat-paginator>\r\n </div>\r\n </div>\r\n <sd-grid-quick-action [gridOption]=\"gridOption\" [selectedItems]=\"selectedItems\"\r\n (clear)=\"onClearSelection(groupedItems)\">\r\n </sd-grid-quick-action>\r\n <sd-popup-export *ngIf=\"gridOption.export?.visible\" [gridOption]=\"gridOption\" (export)=\"onExport($event)\"\r\n #sdPopupExport>\r\n </sd-popup-export>\r\n <sd-popup-grid-configuration [gridOption]=\"gridOption\" [key]=\"key\" #popupGridConfiguration>\r\n </sd-popup-grid-configuration>\r\n </ng-container>\r\n </ng-container>\r\n</ng-container>",
|
|
2831
|
+
template: "<ng-container *ngIf=\"gridConfigurationObserver | async as gridConfiguration\">\r\n <ng-container *ngIf=\"\r\n gridConfiguration\r\n | sdGridConfigurationResult\r\n : gridOption\r\n : sdSubInformation as configuration\r\n \">\r\n <ng-container *ngIf=\"!gridOption.filter?.disabled\">\r\n <sd-grid-filter [filter]=\"gridOption?.filter\" [columns]=\"configuration.firstColumns\" [filterDefs]=\"filterDefs\">\r\n </sd-grid-filter>\r\n </ng-container>\r\n <ng-container *ngIf=\"items | sdGroup:gridOption; $implicit as groupedItems\">\r\n <div class=\"c-container {{ gridOption?.style?.grid }}\" [ngClass]=\"{ 'mat-elevation-z2': gridOption?.shadow }\">\r\n <div class=\"c-loading\" *ngIf=\"isLoading\">\r\n <mat-spinner *ngIf=\"isLoading\"></mat-spinner>\r\n </div>\r\n <ng-container>\r\n <div class=\"c-table\" sdScroll [ngStyle]=\"{\r\n 'max-height': gridOption?.maxHeight,\r\n 'min-height': gridOption?.minHeight\r\n }\">\r\n <table *ngIf=\"items?.length; else elseEmpty\" mat-table [dataSource]=\"groupedItems\" matSort\r\n [matSortDisabled]=\"!gridOption.sortable\" cdkDropList cdkDropListOrientation=\"horizontal\"\r\n [cdkDropListDisabled]=\"!gridOption.dropDragColumnEnable\"\r\n (cdkDropListDropped)=\"drop($event, configuration.displayedColumns)\" multiTemplateDataRows>\r\n\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?.subInformation?.always;else useExpandCollapse\">\r\n <ng-container *ngTemplateOutlet=\"\r\n sdSubInformation.templateRef;\r\n context: { item: item }\r\n \">\r\n </ng-container>\r\n </ng-container>\r\n <ng-template #useExpandCollapse>\r\n <div [@detailExpand]=\"item.isExpanded ? 'expanded' : 'collapsed'\">\r\n <ng-container *ngIf=\"item.isExpanded\">\r\n <ng-container *ngTemplateOutlet=\"\r\n sdSubInformation.templateRef;\r\n context: { item: item }\r\n \">\r\n </ng-container>\r\n </ng-container>\r\n </div>\r\n </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 class=\"p-0\" mat-header-cell *matHeaderCellDef style=\"width: 1px\"\r\n [attr.rowspan]=\"configuration.multipleHeader ? 2 : 1\"></th>\r\n <td mat-cell *matCellDef=\"let element\">\r\n <button *ngIf=\"!element.isExpanding && !gridOption?.subInformation?.always\" mat-icon-button\r\n aria-label=\"Expand & Collapse\" (click)=\"onExpand(element)\">\r\n <mat-icon *ngIf=\"!element.isExpanded\">expand_more</mat-icon>\r\n <mat-icon *ngIf=\"element.isExpanded\">expand_less</mat-icon>\r\n </button>\r\n <div *ngIf=\"element.isExpanding\" class=\"lds-ring\">\r\n <div></div>\r\n <div></div>\r\n <div></div>\r\n <div></div>\r\n </div>\r\n </td>\r\n </ng-container>\r\n <ng-container matColumnDef=\"sdSelection\" sticky>\r\n <th class=\"text-center px-15\" mat-header-cell *matHeaderCellDef style=\"min-width: 50px; max-width: 50px\"\r\n [attr.rowspan]=\"configuration.multipleHeader ? 2 : 1\">\r\n <ng-container *ngIf=\"items | selectionVisibleSelectAll: gridOption?.selection | async\">\r\n <mat-checkbox *ngIf=\"!gridOption.selection?.single\" class=\"c-selection\" color=\"primary\"\r\n [(ngModel)]=\"isSelectAll\" (change)=\"onSelectAll()\">\r\n </mat-checkbox>\r\n </ng-container>\r\n\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?.selection\">\r\n <mat-checkbox class=\"c-selection\" color=\"primary\" [(ngModel)]=\"item.isSelected\"\r\n (change)=\"onSelect(item)\" [disabled]=\"\r\n selectedItems | selectionDisable: item:gridOption?.selection\r\n \">\r\n </mat-checkbox>\r\n </ng-container>\r\n\r\n </td>\r\n <td mat-footer-cell *matFooterCellDef></td>\r\n </ng-container>\r\n <ng-container matColumnDef=\"sdEditorValidation\">\r\n <th class=\"p-0\" mat-header-cell *matHeaderCellDef style=\"width: 2px\"\r\n [attr.rowspan]=\"configuration.multipleHeader ? 2 : 1\">\r\n </th>\r\n <td class=\"p-0 position-relative\" mat-cell *matCellDef=\"let item; index as idx\">\r\n <sd-desktop-editor-validation [sdId]=\"item.sdId\" [item]=\"item\" [items]=\"items\"\r\n [gridOption]=\"gridOption\">\r\n </sd-desktop-editor-validation>\r\n </td>\r\n <td mat-footer-cell *matFooterCellDef></td>\r\n </ng-container>\r\n <ng-container matColumnDef=\"sdEditor\">\r\n <th class=\"px-8 py-8\" mat-header-cell *matHeaderCellDef style=\"width: 50px\"\r\n [attr.rowspan]=\"configuration.multipleHeader ? 2 : 1\">\r\n <button class=\"c-btn-add\"\r\n *ngIf=\"gridOption.editor?.addable && (!gridOption.editor.limit || gridOption.editor.limit > items.length)\"\r\n (click)=\"onCreate()\" aria-hidden=\"true\" mat-icon-button>\r\n <mat-icon class=\"c-icon-add\">add</mat-icon>\r\n </button>\r\n </th>\r\n <td class=\"px-8\" mat-cell *matCellDef=\"let item; index as idx\">\r\n <ng-container *sdLet=\"item.editorStatus | sdEditorHandlerRow:item:gridOption as editorHandler\">\r\n <div *ngIf=\"editorHandler\" class=\"d-flex align-items-center justify-content-center\">\r\n <button *ngIf=\"editorHandler.editable\" class=\"mx-2\" (click)=\"onUpdate(item)\" aria-hidden=\"true\"\r\n mat-icon-button>\r\n <mat-icon class=\"c-icon\">edit</mat-icon>\r\n </button>\r\n <button *ngIf=\"editorHandler.removable\" class=\"mx-2\" (click)=\"onRemove(item)\" aria-hidden=\"true\"\r\n mat-icon-button>\r\n <mat-icon class=\"c-icon\">delete</mat-icon>\r\n </button>\r\n <button *ngIf=\"editorHandler.savable\" class=\"mx-2\" (click)=\"onSave(item)\" aria-hidden=\"true\"\r\n mat-icon-button>\r\n <mat-icon class=\"c-icon\">save</mat-icon>\r\n </button>\r\n <button *ngIf=\"editorHandler.cancelable\" class=\"mx-2\" (click)=\"onCancel(item)\" aria-hidden=\"true\"\r\n mat-icon-button>\r\n <mat-icon class=\"c-icon\">close</mat-icon>\r\n </button>\r\n </div>\r\n </ng-container>\r\n </td>\r\n <td mat-footer-cell *matFooterCellDef></td>\r\n </ng-container>\r\n <ng-container matColumnDef=\"sdCommand\">\r\n <th class=\"px-8 py-8\" mat-header-cell *matHeaderCellDef style=\"width: 50px\"\r\n [attr.rowspan]=\"configuration.multipleHeader ? 2 : 1\"></th>\r\n <td class=\"px-8\" mat-cell *matCellDef=\"let item\">\r\n <sd-desktop-command [commands]=\"gridOption.commands\" [item]=\"item\"></sd-desktop-command>\r\n </td>\r\n <td mat-footer-cell *matFooterCellDef></td>\r\n </ng-container>\r\n <ng-container matColumnDef=\"sdGroup\">\r\n <th mat-header-cell *matHeaderCellDef class=\"px-8 py-8\"\r\n [attr.rowspan]=\"configuration.multipleHeader ? 2 : 1\">\r\n </th>\r\n <td class=\"p-0\" mat-cell *matCellDef=\"let item\"\r\n [attr.colspan]=\"!item?.sdGroup ? 1 : configuration.displayedColumns.length\">\r\n <div [innerHtml]=\"item?.sdGroup?.htmlTemplate | safeHtml\">\r\n </div>\r\n </td>\r\n <td mat-footer-cell *matFooterCellDef></td>\r\n </ng-container>\r\n <ng-container *ngFor=\"let column of configuration.firstColumns; let i = index\"\r\n [matColumnDef]=\"column.field\" [sticky]=\"configuration.fixedColumn[column.field]\">\r\n <th mat-header-cell *matHeaderCellDef cdkDrag class=\"px-8 py-8 c-th\"\r\n [ngStyle]=\"{ 'min-width': configuration.firstColumns[i].width }\" [attr.rowspan]=\"\r\n configuration.multipleHeader && column.type !== 'children-col'\r\n ? 2\r\n : 1\r\n \" [attr.colspan]=\"\r\n column.type === 'children-col' ? column.children?.length : 1\r\n \">\r\n <div>\r\n <div aria-hidden=\"false\" role=\"presentation\" mat-sort-header [disabled]=\"\r\n !column.sortable || column.type === 'children-col'\r\n \" [class.text-right]=\"column.align === 'right' || (!column.align && column.type === 'number')\"\r\n [class.text-center]=\"column.align === 'center'\"\r\n [innerHTML]=\"configuration.firstColumns[i].titleHtml || configuration.firstColumns[i].title\">\r\n </div>\r\n <sd-column-inline-filter *ngIf=\"gridOption.filter?.inlineColumn\"\r\n [value]=\"columnFilter[column.field]\" [columnFilter]=\"columnFilter\" [column]=\"column\"\r\n (filterChange)=\"onFilterChange()\">\r\n </sd-column-inline-filter>\r\n </div>\r\n </th>\r\n <td class=\"c-td\" mat-cell *matCellDef=\"let item\">\r\n <sd-desktop-cell class=\"d-block px-8\" *ngIf=\"!item?.sdGroup\" [sdId]=\"item.sdId\" [key]=\"key\"\r\n [value]=\"item[column.field]\" [column]=\"column\" [item]=\"item\" [idx]=\"i\" [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=\"\r\n footerDef[column.field].templateRef;\r\n context: { items: items, column: column }\r\n \">\r\n </ng-container>\r\n </ng-container>\r\n </td>\r\n </ng-container>\r\n <ng-container *ngFor=\"let column of configuration.secondColumns; let i = index\"\r\n [matColumnDef]=\"column.field\">\r\n <th mat-header-cell *matHeaderCellDef mat-sort-header class=\"c-th px-8\"\r\n [ngStyle]=\"{ 'min-width': column.width }\">\r\n <div>\r\n <div [class.text-right]=\"column.align === 'right' || (!column.align && column.type === 'number')\"\r\n [class.text-center]=\"column.align === 'center'\" [innerHTML]=\"column.titleHtml || column.title\">\r\n </div>\r\n <sd-column-inline-filter *ngIf=\"gridOption.filter?.inlineColumn\"\r\n [value]=\"columnFilter[column.field]\" [columnFilter]=\"columnFilter\" [column]=\"column\"\r\n (filterChange)=\"onFilterChange()\">\r\n </sd-column-inline-filter>\r\n </div>\r\n </th>\r\n <td class=\"c-td\" mat-cell *matCellDef=\"let item\">\r\n <sd-desktop-cell class=\"d-block px-8\" [sdId]=\"item.sdId\" [key]=\"key\" [value]=\"item[column.field]\"\r\n [column]=\"column\" [item]=\"item\" [idx]=\"i\" [cellDef]=\"cellDef\" [gridOption]=\"gridOption\">\r\n </sd-desktop-cell>\r\n </td>\r\n <td mat-footer-cell *matFooterCellDef>\r\n <ng-container *ngIf=\"footerDef[column.field]\">\r\n <ng-container *ngTemplateOutlet=\"\r\n footerDef[column.field].templateRef;\r\n context: { items: items, column: column }\r\n \">\r\n </ng-container>\r\n </ng-container>\r\n </td>\r\n </ng-container>\r\n <tr class=\"c-first-header\" mat-header-row *matHeaderRowDef=\"configuration.firstHeaders; sticky: true\">\r\n </tr>\r\n <ng-container *ngIf=\"configuration.secondHeaders?.length\">\r\n <tr class=\"c-second-header\" mat-header-row *matHeaderRowDef=\"configuration.secondHeaders; sticky: true\">\r\n </tr>\r\n </ng-container>\r\n <tr mat-row *matRowDef=\"let row; columns: configuration.displayedColumns\" matRipple class=\"c-row\"\r\n [class.selected]=\"row.isSelected\" [style]=\"row | sdStyleRowCss:gridOption\"></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 <ng-template #elseEmpty>\r\n <table mat-table [dataSource]=\"[{}]\">\r\n <ng-container matColumnDef=\"sdSelection\" sticky>\r\n <th class=\"px-15\" mat-header-cell *matHeaderCellDef style=\"min-width: 50px; max-width: 50px\"\r\n [attr.rowspan]=\"configuration.multipleHeader ? 2 : 1\"></th>\r\n </ng-container>\r\n <ng-container matColumnDef=\"sdEditorValidation\">\r\n <th class=\"p-0\" mat-header-cell *matHeaderCellDef style=\"width: 4px\"\r\n [attr.rowspan]=\"configuration.multipleHeader ? 2 : 1\">\r\n </th>\r\n <td class=\"p-0\" mat-cell *matCellDef=\"let item\">\r\n </td>\r\n <td mat-footer-cell *matFooterCellDef></td>\r\n </ng-container>\r\n <ng-container matColumnDef=\"sdEditor\">\r\n <th class=\"px-8 py-8\" mat-header-cell *matHeaderCellDef style=\"min-width: 50px; max-width: 50px\"\r\n [attr.rowspan]=\"configuration.multipleHeader ? 2 : 1\">\r\n <button class=\"c-btn-add\"\r\n *ngIf=\"gridOption.editor?.addable && (!gridOption.editor.limit || gridOption.editor.limit > items.length)\"\r\n (click)=\"onCreate()\" aria-hidden=\"true\" mat-icon-button>\r\n <mat-icon class=\"c-icon-add\">add</mat-icon>\r\n </button>\r\n </th>\r\n </ng-container>\r\n <ng-container matColumnDef=\"sdCommand\">\r\n <th class=\"px-8\" mat-header-cell *matHeaderCellDef style=\"min-width: 50px; max-width: 50px\"\r\n [attr.rowspan]=\"configuration.multipleHeader ? 2 : 1\"></th>\r\n </ng-container>\r\n <ng-container matColumnDef=\"sdSubInformationAction\">\r\n <th class=\"p-0\" mat-header-cell *matHeaderCellDef style=\"width: 1px\"\r\n [attr.rowspan]=\"configuration.multipleHeader ? 2 : 1\"></th>\r\n </ng-container>\r\n <ng-container matColumnDef=\"sdEmpty\">\r\n <td class=\"c-empty\" mat-cell *matCellDef=\"let item\"\r\n [attr.colspan]=\"configuration.displayedColumns.length\">\r\n <ng-container *ngIf=\"sdEmptyData?.templateRef; else sdEmptyDataNoRef\">\r\n <ng-container *ngTemplateOutlet=\"\r\n sdEmptyData.templateRef;\r\n context: { item: item }\r\n \">\r\n </ng-container>\r\n </ng-container>\r\n <ng-template #sdEmptyDataNoRef>\r\n <mat-icon fontSet=\"material-icons-outlined\">leaderboard</mat-icon>\r\n </ng-template>\r\n </td>\r\n </ng-container>\r\n <ng-container matColumnDef=\"sdGroup\">\r\n <th mat-header-cell *matHeaderCellDef class=\"px-8 py-8\"\r\n [attr.rowspan]=\"configuration.multipleHeader ? 2 : 1\">\r\n </th>\r\n <td class=\"p-0\" mat-cell *matCellDef=\"let item\">\r\n </td>\r\n <td mat-footer-cell *matFooterCellDef></td>\r\n </ng-container>\r\n <ng-container *ngFor=\"let column of configuration.columns\" [matColumnDef]=\"column.field\"\r\n [sticky]=\"configuration.fixedColumn[column.field]\">\r\n <th mat-header-cell *matHeaderCellDef class=\"c-th px-8 py-8\"\r\n [ngStyle]=\"{ 'min-width': column.width }\">\r\n <div [class.text-right]=\"column.align === 'right' || (!column.align && column.type === 'number')\"\r\n [class.text-center]=\"column.align === 'center'\" [innerHTML]=\"column.titleHtml || column.title\">\r\n </div>\r\n </th>\r\n </ng-container>\r\n <ng-container *ngFor=\"let column of configuration.firstColumns; let i = index\"\r\n [matColumnDef]=\"column.field\" [sticky]=\"configuration.fixedColumn[column.field]\">\r\n <th mat-header-cell *matHeaderCellDef class=\"c-th px-8 py-8\"\r\n [ngStyle]=\"{ 'min-width': configuration.firstColumns[i].width }\" [attr.rowspan]=\"\r\n configuration.multipleHeader &&\r\n column.type !== 'children-col'\r\n ? 2\r\n : 1\r\n \" [attr.colspan]=\"\r\n column.type === 'children-col' ? column.children?.length : 1\r\n \">\r\n <div>\r\n <div [class.text-right]=\"column.align === 'right' || (!column.align && column.type === 'number')\"\r\n [class.text-center]=\"column.align === 'center'\"\r\n [innerHTML]=\"configuration.firstColumns[i].titleHtml || configuration.firstColumns[i].title\">\r\n </div>\r\n <sd-column-inline-filter *ngIf=\"gridOption.filter?.inlineColumn\"\r\n [value]=\"columnFilter[column.field]\" [columnFilter]=\"columnFilter\" [column]=\"column\"\r\n (filterChange)=\"onFilterChange()\"></sd-column-inline-filter>\r\n </div>\r\n </th>\r\n </ng-container>\r\n <ng-container *ngFor=\"let column of configuration.secondColumns\" [matColumnDef]=\"column.field\">\r\n <th mat-header-cell *matHeaderCellDef class=\"c-th px-8 py-8\"\r\n [ngStyle]=\"{ 'min-width': column.width }\">\r\n <div>\r\n <div [class.text-right]=\"column.align === 'right' || (!column.align && column.type === 'number')\"\r\n [class.text-center]=\"column.align === 'center'\" [innerHTML]=\"column.titleHtml || column.title\">\r\n </div>\r\n <sd-column-inline-filter *ngIf=\"gridOption.filter?.inlineColumn\"\r\n [value]=\"columnFilter[column.field]\" [columnFilter]=\"columnFilter\" [column]=\"column\"\r\n (filterChange)=\"onFilterChange()\"></sd-column-inline-filter>\r\n </div>\r\n </th>\r\n </ng-container>\r\n <tr class=\"c-first-header\" mat-header-row *matHeaderRowDef=\"configuration.firstHeaders; sticky: true\">\r\n </tr>\r\n <tr class=\"c-second-header\" mat-header-row *matHeaderRowDef=\"configuration.secondHeaders; sticky: true\">\r\n </tr>\r\n <tr mat-row *matRowDef=\"let row; columns: ['sdEmpty']\"></tr>\r\n </table>\r\n </ng-template>\r\n </div>\r\n </ng-container>\r\n <div class=\"c-paginator\">\r\n <div class=\"c-action\">\r\n <sd-button *ngIf=\"\r\n !gridOption.filter?.disabled && !gridOption.filter?.inlineColumn\r\n \" class=\"mr-10\" [title]=\"'Filter' | sdTranslate\" icon=\"filter_alt\" size=\"sm\" (action)=\"gridFilter.open()\"\r\n type=\"link\">\r\n </sd-button>\r\n <sd-button *ngIf=\"gridOption.reload?.visible\" class=\"mr-10\" [title]=\"'Reload' | sdTranslate\" icon=\"refresh\"\r\n size=\"sm\" (action)=\"reload()\" [disabled]=\"!items?.length\" type=\"link\">\r\n </sd-button>\r\n <ng-container *ngIf=\"gridOption.export?.visible && items?.length\">\r\n <ng-container *ngIf=\"isExporting; else unExporting\">\r\n <sd-button class=\"mr-10\" [loading]=\"isExporting\" [title]=\"exportTitle | sdTranslate\" icon=\"get_app\"\r\n size=\"sm\" type=\"link\">\r\n </sd-button>\r\n </ng-container>\r\n <ng-template #unExporting>\r\n <sd-button class=\"mr-10\" [title]=\"exportTitle | sdTranslate\" icon=\"get_app\" size=\"sm\"\r\n [matMenuTriggerFor]=\"menu\" type=\"link\">\r\n </sd-button>\r\n </ng-template>\r\n\r\n <mat-menu #menu=\"matMenu\">\r\n <button *ngIf=\"gridOption.export?.visibleExcel !== false\" mat-menu-item\r\n (click)=\"sdPopupExport.exportDefault()\" type=\"button\">\r\n <mat-icon fontSet=\"material-icons-outlined\">file_download</mat-icon>\r\n <span> {{ \"Export excel\" | sdTranslate }}</span>\r\n </button>\r\n <button *ngIf=\"gridOption.export?.visibleCSV !== false\" mat-menu-item\r\n (click)=\"sdPopupExport.exportDefault(true)\" type=\"button\">\r\n <mat-icon fontSet=\"material-icons-outlined\">file_download</mat-icon>\r\n <span> {{ \"Export CSV\" | sdTranslate }}</span>\r\n </button>\r\n <button *ngIf=\"gridOption.export?.key\" mat-menu-item (click)=\"sdPopupExport.open()\" type=\"button\">\r\n <mat-icon fontSet=\"material-icons-outlined\">settings</mat-icon>\r\n <span> {{ \"Configure\" | sdTranslate }}</span>\r\n </button>\r\n </mat-menu>\r\n </ng-container>\r\n <sd-button *ngIf=\"gridOption.config?.visible\" class=\"mr-10\" [title]=\"'Configure' | sdTranslate\"\r\n icon=\"settings\" size=\"sm\" (action)=\"popupGridConfiguration.open()\" type=\"link\">\r\n </sd-button>\r\n </div>\r\n <mat-paginator [class.d-none]=\"gridOption.paginate?.hidden\" [length]=\"total\"\r\n [pageSize]=\"gridOption.paginate?.pageSize\" [pageSizeOptions]=\"gridOption.paginate?.pages\"\r\n [showFirstLastButtons]=\"gridOption.paginate?.showFirstLastButtons\"></mat-paginator>\r\n </div>\r\n </div>\r\n <sd-grid-quick-action [gridOption]=\"gridOption\" [selectedItems]=\"selectedItems\"\r\n (clear)=\"onClearSelection(groupedItems)\">\r\n </sd-grid-quick-action>\r\n <sd-popup-export *ngIf=\"gridOption.export?.visible\" [gridOption]=\"gridOption\" (export)=\"onExport($event)\"\r\n #sdPopupExport>\r\n </sd-popup-export>\r\n <sd-popup-grid-configuration [gridOption]=\"gridOption\" [key]=\"key\" #popupGridConfiguration>\r\n </sd-popup-grid-configuration>\r\n </ng-container>\r\n </ng-container>\r\n</ng-container>",
|
|
2832
2832
|
animations: [
|
|
2833
2833
|
animations.trigger('detailExpand', [
|
|
2834
2834
|
animations.state('collapsed', animations.style({ height: '0', minHeight: '0', visibility: 'hidden' })),
|