@sd-angular/core 1.2.77 → 1.2.80
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-api.umd.js +1 -1
- package/bundles/sd-angular-core-api.umd.js.map +1 -1
- package/bundles/sd-angular-core-api.umd.min.js +1 -1
- package/bundles/sd-angular-core-api.umd.min.js.map +1 -1
- package/bundles/sd-angular-core-export.umd.js +20 -4
- package/bundles/sd-angular-core-export.umd.js.map +1 -1
- package/bundles/sd-angular-core-export.umd.min.js +1 -1
- package/bundles/sd-angular-core-export.umd.min.js.map +1 -1
- package/bundles/sd-angular-core-grid-material.umd.js +254 -208
- 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/api/src/lib/api.service.js +2 -2
- package/esm2015/export/src/lib/export.service.js +8 -3
- package/esm2015/grid-material/src/lib/components/popup-export/popup-export.component.js +27 -15
- package/esm2015/grid-material/src/lib/grid-material.component.js +55 -29
- package/export/src/lib/export.service.d.ts +1 -1
- package/fesm2015/sd-angular-core-api.js +1 -1
- package/fesm2015/sd-angular-core-api.js.map +1 -1
- package/fesm2015/sd-angular-core-export.js +7 -2
- package/fesm2015/sd-angular-core-export.js.map +1 -1
- package/fesm2015/sd-angular-core-grid-material.js +80 -42
- package/fesm2015/sd-angular-core-grid-material.js.map +1 -1
- package/grid-material/sd-angular-core-grid-material.metadata.json +1 -1
- package/grid-material/src/lib/components/popup-export/popup-export.component.d.ts +4 -1
- package/grid-material/src/lib/grid-material.component.d.ts +1 -0
- package/package.json +1 -1
- package/{sd-angular-core-1.2.77.tgz → sd-angular-core-1.2.80.tgz} +0 -0
|
@@ -825,7 +825,7 @@
|
|
|
825
825
|
filterChange: [{ type: core.Output }]
|
|
826
826
|
};
|
|
827
827
|
|
|
828
|
-
var _getExportableColumns, _getExportableGroups, _initTemplate;
|
|
828
|
+
var _getExportableColumns, _getExportableGroups, _getExportColumns, _initTemplate;
|
|
829
829
|
var SdPopupExport = /** @class */ (function () {
|
|
830
830
|
function SdPopupExport(ref, loadingService, exportService, notifyService, translateService) {
|
|
831
831
|
var _this = this;
|
|
@@ -905,25 +905,36 @@
|
|
|
905
905
|
return [2 /*return*/];
|
|
906
906
|
});
|
|
907
907
|
}); };
|
|
908
|
-
this
|
|
909
|
-
if (isCSV === void 0) { isCSV = false; }
|
|
908
|
+
_getExportColumns.set(this, function () {
|
|
910
909
|
if (_this.configuration) {
|
|
911
910
|
var _x = _this.configuration, firstColumns = _x.firstColumns, secondColumns = _x.secondColumns;
|
|
912
|
-
|
|
911
|
+
return __spread(firstColumns, secondColumns).map(function (e) { return (Object.assign(Object.assign({}, e), { data: _this.columns.find(function (e1) { return e1.field === e.field; }) })); }).filter(function (e) { return !!e.data; })
|
|
913
912
|
.map(function (e) { return e.data; });
|
|
914
|
-
_this.export.emit({
|
|
915
|
-
file: null,
|
|
916
|
-
columns: columns,
|
|
917
|
-
isCSV: isCSV
|
|
918
|
-
});
|
|
919
913
|
}
|
|
920
914
|
else {
|
|
921
|
-
_this.
|
|
922
|
-
file: null,
|
|
923
|
-
columns: _this.columns,
|
|
924
|
-
isCSV: isCSV
|
|
925
|
-
});
|
|
915
|
+
return _this.columns;
|
|
926
916
|
}
|
|
917
|
+
});
|
|
918
|
+
this.exportDefault = function () {
|
|
919
|
+
_this.export.emit({
|
|
920
|
+
file: null,
|
|
921
|
+
columns: __classPrivateFieldGet(_this, _getExportColumns).call(_this),
|
|
922
|
+
isCSV: false
|
|
923
|
+
});
|
|
924
|
+
};
|
|
925
|
+
this.exportCSV = function () {
|
|
926
|
+
_this.export.emit({
|
|
927
|
+
file: null,
|
|
928
|
+
columns: __classPrivateFieldGet(_this, _getExportColumns).call(_this),
|
|
929
|
+
isCSV: true
|
|
930
|
+
});
|
|
931
|
+
};
|
|
932
|
+
this.exportRaw = function () {
|
|
933
|
+
_this.export.emit({
|
|
934
|
+
file: null,
|
|
935
|
+
columns: __classPrivateFieldGet(_this, _getExportColumns).call(_this),
|
|
936
|
+
isRaw: true
|
|
937
|
+
});
|
|
927
938
|
};
|
|
928
939
|
this.loadFiles = function (group) {
|
|
929
940
|
if (group === void 0) { group = null; }
|
|
@@ -1214,7 +1225,7 @@
|
|
|
1214
1225
|
};
|
|
1215
1226
|
return SdPopupExport;
|
|
1216
1227
|
}());
|
|
1217
|
-
_getExportableColumns = new WeakMap(), _getExportableGroups = new WeakMap(), _initTemplate = new WeakMap();
|
|
1228
|
+
_getExportableColumns = new WeakMap(), _getExportableGroups = new WeakMap(), _getExportColumns = new WeakMap(), _initTemplate = new WeakMap();
|
|
1218
1229
|
SdPopupExport.decorators = [
|
|
1219
1230
|
{ type: core.Component, args: [{
|
|
1220
1231
|
selector: 'sd-popup-export',
|
|
@@ -1836,11 +1847,11 @@
|
|
|
1836
1847
|
this.isSelectAll = false;
|
|
1837
1848
|
this.exportTitle = 'Export';
|
|
1838
1849
|
_initCellDef.set(this, function () {
|
|
1839
|
-
var e_1,
|
|
1850
|
+
var e_1, _2;
|
|
1840
1851
|
_this.cellDef = {};
|
|
1841
1852
|
try {
|
|
1842
|
-
for (var
|
|
1843
|
-
var cellDef =
|
|
1853
|
+
for (var _3 = __values(_this.sdCellDefs), _4 = _3.next(); !_4.done; _4 = _3.next()) {
|
|
1854
|
+
var cellDef = _4.value;
|
|
1844
1855
|
if (cellDef.sdMaterialCellDef) {
|
|
1845
1856
|
_this.cellDef[cellDef.sdMaterialCellDef] = cellDef;
|
|
1846
1857
|
}
|
|
@@ -1849,35 +1860,35 @@
|
|
|
1849
1860
|
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
1850
1861
|
finally {
|
|
1851
1862
|
try {
|
|
1852
|
-
if (
|
|
1863
|
+
if (_4 && !_4.done && (_2 = _3.return)) _2.call(_3);
|
|
1853
1864
|
}
|
|
1854
1865
|
finally { if (e_1) throw e_1.error; }
|
|
1855
1866
|
}
|
|
1856
1867
|
});
|
|
1857
1868
|
_initFilterDef.set(this, function () {
|
|
1858
|
-
var e_2,
|
|
1869
|
+
var e_2, _2;
|
|
1859
1870
|
_this.filterDefs = [];
|
|
1860
1871
|
try {
|
|
1861
|
-
for (var
|
|
1862
|
-
var filterDef =
|
|
1872
|
+
for (var _3 = __values(_this.sdFilterDefs), _4 = _3.next(); !_4.done; _4 = _3.next()) {
|
|
1873
|
+
var filterDef = _4.value;
|
|
1863
1874
|
_this.filterDefs.push(filterDef);
|
|
1864
1875
|
}
|
|
1865
1876
|
}
|
|
1866
1877
|
catch (e_2_1) { e_2 = { error: e_2_1 }; }
|
|
1867
1878
|
finally {
|
|
1868
1879
|
try {
|
|
1869
|
-
if (
|
|
1880
|
+
if (_4 && !_4.done && (_2 = _3.return)) _2.call(_3);
|
|
1870
1881
|
}
|
|
1871
1882
|
finally { if (e_2) throw e_2.error; }
|
|
1872
1883
|
}
|
|
1873
1884
|
});
|
|
1874
1885
|
_initFooterDef.set(this, function () {
|
|
1875
|
-
var e_3,
|
|
1886
|
+
var e_3, _2;
|
|
1876
1887
|
_this.footerDef = {};
|
|
1877
1888
|
_this.hasFooter = false;
|
|
1878
1889
|
try {
|
|
1879
|
-
for (var
|
|
1880
|
-
var footerDef =
|
|
1890
|
+
for (var _3 = __values(_this.sdFooterDefs), _4 = _3.next(); !_4.done; _4 = _3.next()) {
|
|
1891
|
+
var footerDef = _4.value;
|
|
1881
1892
|
if (footerDef.sdMaterialFooterDef) {
|
|
1882
1893
|
_this.hasFooter = true;
|
|
1883
1894
|
_this.footerDef[footerDef.sdMaterialFooterDef] = footerDef;
|
|
@@ -1887,7 +1898,7 @@
|
|
|
1887
1898
|
catch (e_3_1) { e_3 = { error: e_3_1 }; }
|
|
1888
1899
|
finally {
|
|
1889
1900
|
try {
|
|
1890
|
-
if (
|
|
1901
|
+
if (_4 && !_4.done && (_2 = _3.return)) _2.call(_3);
|
|
1891
1902
|
}
|
|
1892
1903
|
finally { if (e_3) throw e_3.error; }
|
|
1893
1904
|
}
|
|
@@ -1919,7 +1930,7 @@
|
|
|
1919
1930
|
var columns = _this.gridOption.columns;
|
|
1920
1931
|
var rawColumnFilter = filterInfo.rawColumnFilter, orderBy = filterInfo.orderBy, orderDirection = filterInfo.orderDirection, pageSize = filterInfo.pageSize, pageNumber = filterInfo.pageNumber;
|
|
1921
1932
|
var items = localItems.filter(function (item) {
|
|
1922
|
-
var e_4,
|
|
1933
|
+
var e_4, _2;
|
|
1923
1934
|
var _a, _b, _c, _d;
|
|
1924
1935
|
try {
|
|
1925
1936
|
for (var columns_1 = __values(columns), columns_1_1 = columns_1.next(); !columns_1_1.done; columns_1_1 = columns_1.next()) {
|
|
@@ -1993,7 +2004,7 @@
|
|
|
1993
2004
|
catch (e_4_1) { e_4 = { error: e_4_1 }; }
|
|
1994
2005
|
finally {
|
|
1995
2006
|
try {
|
|
1996
|
-
if (columns_1_1 && !columns_1_1.done && (
|
|
2007
|
+
if (columns_1_1 && !columns_1_1.done && (_2 = columns_1.return)) _2.call(columns_1);
|
|
1997
2008
|
}
|
|
1998
2009
|
finally { if (e_4) throw e_4.error; }
|
|
1999
2010
|
}
|
|
@@ -2051,37 +2062,37 @@
|
|
|
2051
2062
|
_load$1.set(this, function (filterReq, force) {
|
|
2052
2063
|
if (force === void 0) { force = true; }
|
|
2053
2064
|
return __awaiter(_this, void 0, void 0, function () {
|
|
2054
|
-
var result, results,
|
|
2055
|
-
return __generator(this, function (
|
|
2056
|
-
switch (
|
|
2065
|
+
var result, results, _2, error_1;
|
|
2066
|
+
return __generator(this, function (_3) {
|
|
2067
|
+
switch (_3.label) {
|
|
2057
2068
|
case 0:
|
|
2058
2069
|
this.isLoading = true;
|
|
2059
|
-
|
|
2070
|
+
_3.label = 1;
|
|
2060
2071
|
case 1:
|
|
2061
|
-
|
|
2072
|
+
_3.trys.push([1, 8, 9, 10]);
|
|
2062
2073
|
if (!(this.gridOption.type === 'server')) return [3 /*break*/, 3];
|
|
2063
2074
|
result = this.gridOption.items(filterReq);
|
|
2064
2075
|
if (rxjs.isObservable(result)) {
|
|
2065
2076
|
result = result.toPromise();
|
|
2066
2077
|
}
|
|
2067
2078
|
return [4 /*yield*/, result];
|
|
2068
|
-
case 2: return [2 /*return*/,
|
|
2079
|
+
case 2: return [2 /*return*/, _3.sent()];
|
|
2069
2080
|
case 3:
|
|
2070
2081
|
if (!force) return [3 /*break*/, 6];
|
|
2071
2082
|
results = this.gridOption.items();
|
|
2072
2083
|
if (!(results instanceof Promise)) return [3 /*break*/, 5];
|
|
2073
|
-
|
|
2084
|
+
_2 = this;
|
|
2074
2085
|
return [4 /*yield*/, results];
|
|
2075
2086
|
case 4:
|
|
2076
|
-
|
|
2087
|
+
_2.localItems = _3.sent();
|
|
2077
2088
|
return [3 /*break*/, 6];
|
|
2078
2089
|
case 5:
|
|
2079
2090
|
this.localItems = results;
|
|
2080
|
-
|
|
2091
|
+
_3.label = 6;
|
|
2081
2092
|
case 6: return [2 /*return*/, __classPrivateFieldGet(this, _filterLocal).call(this, this.localItems, filterReq)];
|
|
2082
2093
|
case 7: return [3 /*break*/, 10];
|
|
2083
2094
|
case 8:
|
|
2084
|
-
error_1 =
|
|
2095
|
+
error_1 = _3.sent();
|
|
2085
2096
|
this.notifyService.handle.error(error_1);
|
|
2086
2097
|
return [3 /*break*/, 10];
|
|
2087
2098
|
case 9:
|
|
@@ -2095,8 +2106,8 @@
|
|
|
2095
2106
|
});
|
|
2096
2107
|
_render.set(this, function (args) { return __awaiter(_this, void 0, void 0, function () {
|
|
2097
2108
|
var _a, _b, _c;
|
|
2098
|
-
return __generator(this, function (
|
|
2099
|
-
switch (
|
|
2109
|
+
return __generator(this, function (_2) {
|
|
2110
|
+
switch (_2.label) {
|
|
2100
2111
|
case 0:
|
|
2101
2112
|
this.items = (args === null || args === void 0 ? void 0 : args.items) || [];
|
|
2102
2113
|
this.total = (args === null || args === void 0 ? void 0 : args.total) || 0;
|
|
@@ -2106,7 +2117,7 @@
|
|
|
2106
2117
|
});
|
|
2107
2118
|
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))];
|
|
2108
2119
|
case 1:
|
|
2109
|
-
|
|
2120
|
+
_2.sent();
|
|
2110
2121
|
this.isSelectAll = this.items.every(function (e) { return e.isSelected; });
|
|
2111
2122
|
__classPrivateFieldGet(this, _updateSelectedItems).call(this);
|
|
2112
2123
|
return [2 /*return*/];
|
|
@@ -2117,11 +2128,11 @@
|
|
|
2117
2128
|
if (force === void 0) { force = true; }
|
|
2118
2129
|
return __awaiter(_this, void 0, void 0, function () {
|
|
2119
2130
|
var _d, data;
|
|
2120
|
-
return __generator(this, function (
|
|
2121
|
-
switch (
|
|
2131
|
+
return __generator(this, function (_2) {
|
|
2132
|
+
switch (_2.label) {
|
|
2122
2133
|
case 0: return [4 /*yield*/, __classPrivateFieldGet(this, _load$1).call(this, __classPrivateFieldGet(this, _getFilter).call(this), force)];
|
|
2123
2134
|
case 1:
|
|
2124
|
-
data =
|
|
2135
|
+
data = _2.sent();
|
|
2125
2136
|
(_d = this.sdScroll) === null || _d === void 0 ? void 0 : _d.scrollTop();
|
|
2126
2137
|
__classPrivateFieldGet(this, _render).call(this, data);
|
|
2127
2138
|
return [2 /*return*/];
|
|
@@ -2134,8 +2145,8 @@
|
|
|
2134
2145
|
if (pageSize === void 0) { pageSize = 10000; }
|
|
2135
2146
|
return __awaiter(_this, void 0, void 0, function () {
|
|
2136
2147
|
var _e, _f, result, filterInfo, result, exportedItems, results;
|
|
2137
|
-
return __generator(this, function (
|
|
2138
|
-
switch (
|
|
2148
|
+
return __generator(this, function (_2) {
|
|
2149
|
+
switch (_2.label) {
|
|
2139
2150
|
case 0:
|
|
2140
2151
|
if (!((_e = this.gridOption.export) === null || _e === void 0 ? void 0 : _e.items)) return [3 /*break*/, 2];
|
|
2141
2152
|
result = (_f = this.gridOption.export) === null || _f === void 0 ? void 0 : _f.items(__classPrivateFieldGet(this, _filterExportInfo).call(this, pageNumber, pageSize));
|
|
@@ -2149,7 +2160,7 @@
|
|
|
2149
2160
|
result = result.toPromise();
|
|
2150
2161
|
}
|
|
2151
2162
|
return [4 /*yield*/, result];
|
|
2152
|
-
case 1: return [2 /*return*/,
|
|
2163
|
+
case 1: return [2 /*return*/, _2.sent()];
|
|
2153
2164
|
case 2:
|
|
2154
2165
|
filterInfo = __classPrivateFieldGet(this, _filterExportInfo).call(this, pageNumber, pageSize);
|
|
2155
2166
|
if (!(this.gridOption.type === 'server')) return [3 /*break*/, 4];
|
|
@@ -2158,7 +2169,7 @@
|
|
|
2158
2169
|
result = result.toPromise();
|
|
2159
2170
|
}
|
|
2160
2171
|
return [4 /*yield*/, result];
|
|
2161
|
-
case 3: return [2 /*return*/,
|
|
2172
|
+
case 3: return [2 /*return*/, _2.sent()];
|
|
2162
2173
|
case 4:
|
|
2163
2174
|
exportedItems = [];
|
|
2164
2175
|
if (!(typeof (this.gridOption.items) === 'function')) return [3 /*break*/, 8];
|
|
@@ -2166,15 +2177,15 @@
|
|
|
2166
2177
|
if (!(results instanceof Promise)) return [3 /*break*/, 6];
|
|
2167
2178
|
return [4 /*yield*/, results];
|
|
2168
2179
|
case 5:
|
|
2169
|
-
exportedItems =
|
|
2180
|
+
exportedItems = _2.sent();
|
|
2170
2181
|
return [3 /*break*/, 7];
|
|
2171
2182
|
case 6:
|
|
2172
2183
|
exportedItems = results;
|
|
2173
|
-
|
|
2184
|
+
_2.label = 7;
|
|
2174
2185
|
case 7: return [3 /*break*/, 9];
|
|
2175
2186
|
case 8:
|
|
2176
2187
|
exportedItems = this.gridOption.items;
|
|
2177
|
-
|
|
2188
|
+
_2.label = 9;
|
|
2178
2189
|
case 9: return [2 /*return*/, __classPrivateFieldGet(this, _filterLocal).call(this, exportedItems, filterInfo)];
|
|
2179
2190
|
}
|
|
2180
2191
|
});
|
|
@@ -2214,64 +2225,80 @@
|
|
|
2214
2225
|
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); })) || [];
|
|
2215
2226
|
});
|
|
2216
2227
|
_onExport.set(this, function (args) { return __awaiter(_this, void 0, void 0, function () {
|
|
2217
|
-
var _g, _h, _j, _k, _l, _m, _o, _p, _q, file, isCSV, columns_2,
|
|
2218
|
-
var e_5,
|
|
2228
|
+
var _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, file, isCSV, isRaw, columns_2, pageSize_1, batch, total_1, pageNumber_1, exportItems_1, items_1, promises_1, handleData, sheets, _2, _3, sheet, _4, _5, _6, e_5_1;
|
|
2229
|
+
var e_5, _7;
|
|
2219
2230
|
var _this = this;
|
|
2220
|
-
return __generator(this, function (
|
|
2221
|
-
switch (
|
|
2231
|
+
return __generator(this, function (_8) {
|
|
2232
|
+
switch (_8.label) {
|
|
2222
2233
|
case 0:
|
|
2223
|
-
|
|
2224
|
-
file = args.file, isCSV = args.isCSV;
|
|
2234
|
+
_8.trys.push([0, , 22, 23]);
|
|
2235
|
+
file = args.file, isCSV = args.isCSV, isRaw = args.isRaw;
|
|
2225
2236
|
columns_2 = args.columns;
|
|
2226
|
-
|
|
2227
|
-
|
|
2228
|
-
|
|
2229
|
-
|
|
2237
|
+
pageSize_1 = ((_h = (_g = this.gridOption) === null || _g === void 0 ? void 0 : _g.export) === null || _h === void 0 ? void 0 : _h.maxItemsPerRequest) || 1000;
|
|
2238
|
+
batch = ((_k = (_j = this.gridOption) === null || _j === void 0 ? void 0 : _j.export) === null || _k === void 0 ? void 0 : _k.batch) || 1;
|
|
2239
|
+
total_1 = this.total;
|
|
2240
|
+
pageNumber_1 = 0;
|
|
2241
|
+
exportItems_1 = [];
|
|
2230
2242
|
this.isExporting = true;
|
|
2231
|
-
|
|
2232
|
-
|
|
2233
|
-
|
|
2234
|
-
var
|
|
2235
|
-
|
|
2236
|
-
|
|
2237
|
-
|
|
2243
|
+
items_1 = [];
|
|
2244
|
+
promises_1 = [];
|
|
2245
|
+
handleData = function () { return __awaiter(_this, void 0, void 0, function () {
|
|
2246
|
+
var _u, results, results_1, results_1_1, result, results_2, totalPage, percent, allColumns, allExportedColumns, _loop_1, exportItems_2, exportItems_2_1, item, e_6_1;
|
|
2247
|
+
var e_7, _2, e_6, _3;
|
|
2248
|
+
var _this = this;
|
|
2249
|
+
return __generator(this, function (_4) {
|
|
2250
|
+
switch (_4.label) {
|
|
2251
|
+
case 0: return [4 /*yield*/, Promise.all(promises_1)];
|
|
2238
2252
|
case 1:
|
|
2239
|
-
|
|
2240
|
-
|
|
2241
|
-
|
|
2242
|
-
|
|
2253
|
+
results = _4.sent();
|
|
2254
|
+
promises_1 = [];
|
|
2255
|
+
exportItems_1 = [];
|
|
2256
|
+
try {
|
|
2257
|
+
for (results_1 = __values(results), results_1_1 = results_1.next(); !results_1_1.done; results_1_1 = results_1.next()) {
|
|
2258
|
+
result = results_1_1.value;
|
|
2259
|
+
if ('items' in result) {
|
|
2260
|
+
exportItems_1 = __spread(exportItems_1, result.items);
|
|
2261
|
+
total_1 = result.total;
|
|
2262
|
+
}
|
|
2263
|
+
else {
|
|
2264
|
+
exportItems_1 = __spread(exportItems_1, result);
|
|
2265
|
+
}
|
|
2266
|
+
}
|
|
2243
2267
|
}
|
|
2244
|
-
|
|
2245
|
-
|
|
2246
|
-
|
|
2268
|
+
catch (e_7_1) { e_7 = { error: e_7_1 }; }
|
|
2269
|
+
finally {
|
|
2270
|
+
try {
|
|
2271
|
+
if (results_1_1 && !results_1_1.done && (_2 = results_1.return)) _2.call(results_1);
|
|
2272
|
+
}
|
|
2273
|
+
finally { if (e_7) throw e_7.error; }
|
|
2247
2274
|
}
|
|
2248
|
-
if (!((
|
|
2249
|
-
|
|
2250
|
-
if (!(
|
|
2251
|
-
return [4 /*yield*/,
|
|
2275
|
+
if (!((_u = this.gridOption.export) === null || _u === void 0 ? void 0 : _u.mapping)) return [3 /*break*/, 4];
|
|
2276
|
+
results_2 = this.gridOption.export.mapping(exportItems_1);
|
|
2277
|
+
if (!(results_2 instanceof Promise)) return [3 /*break*/, 3];
|
|
2278
|
+
return [4 /*yield*/, results_2];
|
|
2252
2279
|
case 2:
|
|
2253
|
-
|
|
2280
|
+
exportItems_1 = _4.sent();
|
|
2254
2281
|
return [3 /*break*/, 4];
|
|
2255
2282
|
case 3:
|
|
2256
|
-
|
|
2257
|
-
|
|
2283
|
+
exportItems_1 = results_2;
|
|
2284
|
+
_4.label = 4;
|
|
2258
2285
|
case 4:
|
|
2259
|
-
totalPage =
|
|
2260
|
-
percent = Math.round(
|
|
2261
|
-
|
|
2262
|
-
allColumns = __classPrivateFieldGet(
|
|
2263
|
-
allExportedColumns = __classPrivateFieldGet(
|
|
2264
|
-
|
|
2265
|
-
var obj, handle, columns_3, columns_3_1, exportColumn,
|
|
2266
|
-
var
|
|
2267
|
-
return __generator(this, function (
|
|
2268
|
-
switch (
|
|
2286
|
+
totalPage = total_1 / pageSize_1;
|
|
2287
|
+
percent = Math.round((pageNumber_1 - 1) * 100.0 / totalPage);
|
|
2288
|
+
this.exportTitle = "Exporting..." + percent + "%";
|
|
2289
|
+
allColumns = __classPrivateFieldGet(this, _allColumns).call(this);
|
|
2290
|
+
allExportedColumns = __classPrivateFieldGet(this, _allExportedColumns).call(this);
|
|
2291
|
+
_loop_1 = function (item) {
|
|
2292
|
+
var obj, handle, columns_3, columns_3_1, exportColumn, e_8_1;
|
|
2293
|
+
var e_8, _2;
|
|
2294
|
+
return __generator(this, function (_3) {
|
|
2295
|
+
switch (_3.label) {
|
|
2269
2296
|
case 0:
|
|
2270
2297
|
obj = {};
|
|
2271
2298
|
handle = function (exportColumn) { return __awaiter(_this, void 0, void 0, function () {
|
|
2272
|
-
var
|
|
2273
|
-
return __generator(this, function (
|
|
2274
|
-
switch (
|
|
2299
|
+
var _v, _w, column, exportedColumn, transform, _2, _3, date, transformDate, date, transformDate, date, transformDate, _4, _5;
|
|
2300
|
+
return __generator(this, function (_6) {
|
|
2301
|
+
switch (_6.label) {
|
|
2275
2302
|
case 0:
|
|
2276
2303
|
obj[exportColumn.field] = item[exportColumn.field];
|
|
2277
2304
|
column = allColumns.find(function (e) { return e.field === exportColumn.field; });
|
|
@@ -2293,15 +2320,15 @@
|
|
|
2293
2320
|
if (!column.transform) return [3 /*break*/, 4];
|
|
2294
2321
|
transform = column.transform(item[column.field], item);
|
|
2295
2322
|
if (!(transform instanceof Promise)) return [3 /*break*/, 2];
|
|
2296
|
-
|
|
2297
|
-
|
|
2323
|
+
_2 = obj;
|
|
2324
|
+
_3 = column.field;
|
|
2298
2325
|
return [4 /*yield*/, transform];
|
|
2299
2326
|
case 1:
|
|
2300
|
-
|
|
2327
|
+
_2[_3] = _6.sent();
|
|
2301
2328
|
return [3 /*break*/, 3];
|
|
2302
2329
|
case 2:
|
|
2303
2330
|
obj[column.field] = transform;
|
|
2304
|
-
|
|
2331
|
+
_6.label = 3;
|
|
2305
2332
|
case 3: return [3 /*break*/, 13];
|
|
2306
2333
|
case 4:
|
|
2307
2334
|
if (!(item[column.field] === undefined || item[column.field] === null || item[column.field] === '')) return [3 /*break*/, 5];
|
|
@@ -2316,10 +2343,10 @@
|
|
|
2316
2343
|
if (!(column.type === 'bool')) return [3 /*break*/, 7];
|
|
2317
2344
|
// Nếu là bool thì gán bằng giá trị trueValue và falseValue (nếu có), mặc định là TRUE/FALSE
|
|
2318
2345
|
if (item[column.field]) {
|
|
2319
|
-
obj[column.field] = ((
|
|
2346
|
+
obj[column.field] = ((_v = column.option) === null || _v === void 0 ? void 0 : _v.displayOnTrue) || 'True';
|
|
2320
2347
|
}
|
|
2321
2348
|
else if (obj[column.field] !== undefined && obj[column.field] !== null) {
|
|
2322
|
-
obj[column.field] = ((
|
|
2349
|
+
obj[column.field] = ((_w = column.option) === null || _w === void 0 ? void 0 : _w.displayOnFalse) || 'False';
|
|
2323
2350
|
}
|
|
2324
2351
|
return [3 /*break*/, 13];
|
|
2325
2352
|
case 7:
|
|
@@ -2355,184 +2382,203 @@
|
|
|
2355
2382
|
case 10:
|
|
2356
2383
|
if (!(column.type === 'values')) return [3 /*break*/, 12];
|
|
2357
2384
|
// Nếu là values thì lấy giá trị của value được chọn
|
|
2358
|
-
|
|
2359
|
-
|
|
2385
|
+
_4 = obj;
|
|
2386
|
+
_5 = column.field;
|
|
2360
2387
|
return [4 /*yield*/, this.columnValuesPipe.transform(item[column.field], column)];
|
|
2361
2388
|
case 11:
|
|
2362
2389
|
// Nếu là values thì lấy giá trị của value được chọn
|
|
2363
|
-
|
|
2390
|
+
_4[_5] = _6.sent();
|
|
2364
2391
|
return [3 /*break*/, 13];
|
|
2365
2392
|
case 12:
|
|
2366
2393
|
obj[column.field] = item[column.field];
|
|
2367
|
-
|
|
2394
|
+
_6.label = 13;
|
|
2368
2395
|
case 13: return [2 /*return*/];
|
|
2369
2396
|
}
|
|
2370
2397
|
});
|
|
2371
2398
|
}); };
|
|
2372
|
-
|
|
2399
|
+
_3.label = 1;
|
|
2373
2400
|
case 1:
|
|
2374
|
-
|
|
2375
|
-
columns_3 = (
|
|
2376
|
-
|
|
2401
|
+
_3.trys.push([1, 6, 7, 8]);
|
|
2402
|
+
columns_3 = (e_8 = void 0, __values(columns_2)), columns_3_1 = columns_3.next();
|
|
2403
|
+
_3.label = 2;
|
|
2377
2404
|
case 2:
|
|
2378
2405
|
if (!!columns_3_1.done) return [3 /*break*/, 5];
|
|
2379
2406
|
exportColumn = columns_3_1.value;
|
|
2380
2407
|
return [4 /*yield*/, handle(exportColumn)];
|
|
2381
2408
|
case 3:
|
|
2382
|
-
|
|
2383
|
-
|
|
2409
|
+
_3.sent();
|
|
2410
|
+
_3.label = 4;
|
|
2384
2411
|
case 4:
|
|
2385
2412
|
columns_3_1 = columns_3.next();
|
|
2386
2413
|
return [3 /*break*/, 2];
|
|
2387
2414
|
case 5: return [3 /*break*/, 8];
|
|
2388
2415
|
case 6:
|
|
2389
|
-
|
|
2390
|
-
|
|
2416
|
+
e_8_1 = _3.sent();
|
|
2417
|
+
e_8 = { error: e_8_1 };
|
|
2391
2418
|
return [3 /*break*/, 8];
|
|
2392
2419
|
case 7:
|
|
2393
2420
|
try {
|
|
2394
|
-
if (columns_3_1 && !columns_3_1.done && (
|
|
2421
|
+
if (columns_3_1 && !columns_3_1.done && (_2 = columns_3.return)) _2.call(columns_3);
|
|
2395
2422
|
}
|
|
2396
|
-
finally { if (
|
|
2423
|
+
finally { if (e_8) throw e_8.error; }
|
|
2397
2424
|
return [7 /*endfinally*/];
|
|
2398
2425
|
case 8:
|
|
2399
|
-
|
|
2426
|
+
items_1.push(obj);
|
|
2400
2427
|
return [2 /*return*/];
|
|
2401
2428
|
}
|
|
2402
2429
|
});
|
|
2403
2430
|
};
|
|
2404
|
-
|
|
2431
|
+
_4.label = 5;
|
|
2405
2432
|
case 5:
|
|
2406
|
-
|
|
2407
|
-
|
|
2408
|
-
|
|
2433
|
+
_4.trys.push([5, 10, 11, 12]);
|
|
2434
|
+
exportItems_2 = __values(exportItems_1), exportItems_2_1 = exportItems_2.next();
|
|
2435
|
+
_4.label = 6;
|
|
2409
2436
|
case 6:
|
|
2410
|
-
if (!!
|
|
2411
|
-
item =
|
|
2412
|
-
return [5 /*yield**/,
|
|
2437
|
+
if (!!exportItems_2_1.done) return [3 /*break*/, 9];
|
|
2438
|
+
item = exportItems_2_1.value;
|
|
2439
|
+
return [5 /*yield**/, _loop_1(item)];
|
|
2413
2440
|
case 7:
|
|
2414
|
-
|
|
2415
|
-
|
|
2441
|
+
_4.sent();
|
|
2442
|
+
_4.label = 8;
|
|
2416
2443
|
case 8:
|
|
2417
|
-
|
|
2444
|
+
exportItems_2_1 = exportItems_2.next();
|
|
2418
2445
|
return [3 /*break*/, 6];
|
|
2419
2446
|
case 9: return [3 /*break*/, 12];
|
|
2420
2447
|
case 10:
|
|
2421
|
-
e_6_1 =
|
|
2448
|
+
e_6_1 = _4.sent();
|
|
2422
2449
|
e_6 = { error: e_6_1 };
|
|
2423
2450
|
return [3 /*break*/, 12];
|
|
2424
2451
|
case 11:
|
|
2425
2452
|
try {
|
|
2426
|
-
if (
|
|
2453
|
+
if (exportItems_2_1 && !exportItems_2_1.done && (_3 = exportItems_2.return)) _3.call(exportItems_2);
|
|
2427
2454
|
}
|
|
2428
2455
|
finally { if (e_6) throw e_6.error; }
|
|
2429
2456
|
return [7 /*endfinally*/];
|
|
2430
|
-
case 12:
|
|
2431
|
-
pageNumber++;
|
|
2432
|
-
return [2 /*return*/];
|
|
2457
|
+
case 12: return [2 /*return*/];
|
|
2433
2458
|
}
|
|
2434
2459
|
});
|
|
2435
|
-
};
|
|
2436
|
-
|
|
2437
|
-
_4.label = 1;
|
|
2460
|
+
}); };
|
|
2461
|
+
_8.label = 1;
|
|
2438
2462
|
case 1:
|
|
2439
|
-
if (!(
|
|
2440
|
-
|
|
2463
|
+
if (!(pageNumber_1 * pageSize_1 < total_1)) return [3 /*break*/, 3];
|
|
2464
|
+
promises_1.push(__classPrivateFieldGet(this, _exportedItems).call(this, pageNumber_1, pageSize_1));
|
|
2465
|
+
pageNumber_1++;
|
|
2466
|
+
if (promises_1.length < batch) {
|
|
2467
|
+
return [3 /*break*/, 1];
|
|
2468
|
+
}
|
|
2469
|
+
return [4 /*yield*/, handleData()];
|
|
2441
2470
|
case 2:
|
|
2442
|
-
|
|
2471
|
+
_8.sent();
|
|
2443
2472
|
return [3 /*break*/, 1];
|
|
2444
2473
|
case 3:
|
|
2445
|
-
if (
|
|
2446
|
-
|
|
2474
|
+
if (!(promises_1.length > 0)) return [3 /*break*/, 5];
|
|
2475
|
+
return [4 /*yield*/, handleData()];
|
|
2476
|
+
case 4:
|
|
2477
|
+
_8.sent();
|
|
2478
|
+
_8.label = 5;
|
|
2479
|
+
case 5:
|
|
2480
|
+
if (!!(file === null || file === void 0 ? void 0 : file.filePath)) return [3 /*break*/, 20];
|
|
2481
|
+
if (!isCSV) return [3 /*break*/, 7];
|
|
2447
2482
|
return [4 /*yield*/, this.exportService.exportCSV({
|
|
2448
2483
|
columns: columns_2,
|
|
2449
|
-
items:
|
|
2450
|
-
fileName: (
|
|
2484
|
+
items: items_1,
|
|
2485
|
+
fileName: (_m = (_l = this.gridOption) === null || _l === void 0 ? void 0 : _l.export) === null || _m === void 0 ? void 0 : _m.fileName
|
|
2451
2486
|
})];
|
|
2452
|
-
case 4:
|
|
2453
|
-
_4.sent();
|
|
2454
|
-
return [2 /*return*/];
|
|
2455
|
-
case 5:
|
|
2456
|
-
sheets = [];
|
|
2457
|
-
if (!Array.isArray((_o = (_m = this.gridOption) === null || _m === void 0 ? void 0 : _m.export) === null || _o === void 0 ? void 0 : _o.sheets)) return [3 /*break*/, 14];
|
|
2458
|
-
_4.label = 6;
|
|
2459
2487
|
case 6:
|
|
2460
|
-
|
|
2461
|
-
|
|
2462
|
-
_4.label = 7;
|
|
2488
|
+
_8.sent();
|
|
2489
|
+
return [2 /*return*/];
|
|
2463
2490
|
case 7:
|
|
2464
|
-
if (
|
|
2465
|
-
|
|
2466
|
-
|
|
2467
|
-
|
|
2491
|
+
if (!isRaw) return [3 /*break*/, 9];
|
|
2492
|
+
return [4 /*yield*/, this.exportService.exportExcelRaw({
|
|
2493
|
+
columns: columns_2,
|
|
2494
|
+
items: items_1,
|
|
2495
|
+
fileName: (_p = (_o = this.gridOption) === null || _o === void 0 ? void 0 : _o.export) === null || _p === void 0 ? void 0 : _p.fileName
|
|
2496
|
+
})];
|
|
2497
|
+
case 8:
|
|
2498
|
+
_8.sent();
|
|
2499
|
+
return [2 /*return*/];
|
|
2500
|
+
case 9:
|
|
2501
|
+
sheets = [];
|
|
2502
|
+
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*/, 18];
|
|
2503
|
+
_8.label = 10;
|
|
2504
|
+
case 10:
|
|
2505
|
+
_8.trys.push([10, 16, 17, 18]);
|
|
2506
|
+
_2 = __values(this.gridOption.export.sheets), _3 = _2.next();
|
|
2507
|
+
_8.label = 11;
|
|
2508
|
+
case 11:
|
|
2509
|
+
if (!!_3.done) return [3 /*break*/, 15];
|
|
2510
|
+
sheet = _3.value;
|
|
2511
|
+
if (!(sheet.name && sheet.items && sheet.fields)) return [3 /*break*/, 14];
|
|
2512
|
+
if (!Array.isArray(sheet.items)) return [3 /*break*/, 12];
|
|
2468
2513
|
sheets.push({
|
|
2469
2514
|
name: sheet.name,
|
|
2470
2515
|
items: sheet.items,
|
|
2471
2516
|
fields: sheet.fields
|
|
2472
2517
|
});
|
|
2473
|
-
return [3 /*break*/,
|
|
2474
|
-
case
|
|
2475
|
-
|
|
2476
|
-
|
|
2518
|
+
return [3 /*break*/, 14];
|
|
2519
|
+
case 12:
|
|
2520
|
+
_5 = (_4 = sheets).push;
|
|
2521
|
+
_6 = {
|
|
2477
2522
|
name: sheet.name
|
|
2478
2523
|
};
|
|
2479
2524
|
return [4 /*yield*/, sheet.items()];
|
|
2480
|
-
case 9:
|
|
2481
|
-
_1.apply(_0, [(_2.items = _4.sent(),
|
|
2482
|
-
_2.fields = sheet.fields,
|
|
2483
|
-
_2)]);
|
|
2484
|
-
_4.label = 10;
|
|
2485
|
-
case 10:
|
|
2486
|
-
_z = _y.next();
|
|
2487
|
-
return [3 /*break*/, 7];
|
|
2488
|
-
case 11: return [3 /*break*/, 14];
|
|
2489
|
-
case 12:
|
|
2490
|
-
e_5_1 = _4.sent();
|
|
2491
|
-
e_5 = { error: e_5_1 };
|
|
2492
|
-
return [3 /*break*/, 14];
|
|
2493
2525
|
case 13:
|
|
2526
|
+
_5.apply(_4, [(_6.items = _8.sent(),
|
|
2527
|
+
_6.fields = sheet.fields,
|
|
2528
|
+
_6)]);
|
|
2529
|
+
_8.label = 14;
|
|
2530
|
+
case 14:
|
|
2531
|
+
_3 = _2.next();
|
|
2532
|
+
return [3 /*break*/, 11];
|
|
2533
|
+
case 15: return [3 /*break*/, 18];
|
|
2534
|
+
case 16:
|
|
2535
|
+
e_5_1 = _8.sent();
|
|
2536
|
+
e_5 = { error: e_5_1 };
|
|
2537
|
+
return [3 /*break*/, 18];
|
|
2538
|
+
case 17:
|
|
2494
2539
|
try {
|
|
2495
|
-
if (
|
|
2540
|
+
if (_3 && !_3.done && (_7 = _2.return)) _7.call(_2);
|
|
2496
2541
|
}
|
|
2497
2542
|
finally { if (e_5) throw e_5.error; }
|
|
2498
2543
|
return [7 /*endfinally*/];
|
|
2499
|
-
case
|
|
2544
|
+
case 18: return [4 /*yield*/, this.exportService.export({
|
|
2500
2545
|
columns: columns_2,
|
|
2501
|
-
items:
|
|
2502
|
-
fileName: (
|
|
2546
|
+
items: items_1,
|
|
2547
|
+
fileName: (_t = (_s = this.gridOption) === null || _s === void 0 ? void 0 : _s.export) === null || _t === void 0 ? void 0 : _t.fileName,
|
|
2503
2548
|
sheets: sheets
|
|
2504
2549
|
})];
|
|
2505
|
-
case
|
|
2506
|
-
|
|
2550
|
+
case 19:
|
|
2551
|
+
_8.sent();
|
|
2507
2552
|
return [2 /*return*/];
|
|
2508
|
-
case
|
|
2553
|
+
case 20: return [4 /*yield*/, this.exportService.exportByTemplate({
|
|
2509
2554
|
filePath: file.filePath,
|
|
2510
2555
|
fileName: file.fileName,
|
|
2511
2556
|
columns: columns_2,
|
|
2512
|
-
items:
|
|
2557
|
+
items: items_1
|
|
2513
2558
|
})];
|
|
2514
|
-
case
|
|
2515
|
-
|
|
2516
|
-
return [3 /*break*/,
|
|
2517
|
-
case
|
|
2559
|
+
case 21:
|
|
2560
|
+
_8.sent();
|
|
2561
|
+
return [3 /*break*/, 23];
|
|
2562
|
+
case 22:
|
|
2518
2563
|
this.isExporting = false;
|
|
2519
2564
|
this.exportTitle = "Export";
|
|
2520
2565
|
this.ref.detectChanges();
|
|
2521
2566
|
return [7 /*endfinally*/];
|
|
2522
|
-
case
|
|
2567
|
+
case 23: return [2 /*return*/];
|
|
2523
2568
|
}
|
|
2524
2569
|
});
|
|
2525
2570
|
}); });
|
|
2526
2571
|
this.onExport = function (args) { return __awaiter(_this, void 0, void 0, function () {
|
|
2527
2572
|
var translate;
|
|
2528
|
-
|
|
2529
|
-
return __generator(this, function (_y) {
|
|
2573
|
+
return __generator(this, function (_2) {
|
|
2530
2574
|
translate = this.translateService.translate;
|
|
2531
2575
|
if (!args.isCSV && this.gridOption.export.max && this.total > this.gridOption.export.max) {
|
|
2532
|
-
|
|
2533
|
-
|
|
2534
|
-
|
|
2535
|
-
|
|
2576
|
+
args.isRaw = true;
|
|
2577
|
+
__classPrivateFieldGet(this, _onExport).call(this, args);
|
|
2578
|
+
// this.notifyService.confirm(translate(`Total rows reach limit, do you want to export CSV`)).then(() => {
|
|
2579
|
+
// args.isCSV = true;
|
|
2580
|
+
// this.#onExport(args);
|
|
2581
|
+
// });
|
|
2536
2582
|
return [2 /*return*/];
|
|
2537
2583
|
}
|
|
2538
2584
|
__classPrivateFieldGet(this, _onExport).call(this, args);
|
|
@@ -2544,9 +2590,9 @@
|
|
|
2544
2590
|
_this.reload(false);
|
|
2545
2591
|
};
|
|
2546
2592
|
this.onExpand = function (rowData) { return __awaiter(_this, void 0, void 0, function () {
|
|
2547
|
-
var
|
|
2548
|
-
return __generator(this, function (
|
|
2549
|
-
if ((
|
|
2593
|
+
var _x, _y, _z, _0, _1, data;
|
|
2594
|
+
return __generator(this, function (_2) {
|
|
2595
|
+
if ((_x = this.gridOption.subInformation) === null || _x === void 0 ? void 0 : _x.always) {
|
|
2550
2596
|
return [2 /*return*/];
|
|
2551
2597
|
}
|
|
2552
2598
|
if (rowData.isExpanding) {
|
|
@@ -2556,8 +2602,8 @@
|
|
|
2556
2602
|
rowData.isExpanded = false;
|
|
2557
2603
|
return [2 /*return*/];
|
|
2558
2604
|
}
|
|
2559
|
-
data = (
|
|
2560
|
-
if (!((
|
|
2605
|
+
data = (_0 = (_z = (_y = this.gridOption) === null || _y === void 0 ? void 0 : _y.subInformation) === null || _z === void 0 ? void 0 : _z.onExpand) === null || _0 === void 0 ? void 0 : _0.call(_z, rowData);
|
|
2606
|
+
if (!((_1 = this.gridOption.subInformation) === null || _1 === void 0 ? void 0 : _1.multiple)) {
|
|
2561
2607
|
this.items.forEach(function (item) { return item.isExpanding = item.isExpanded = false; });
|
|
2562
2608
|
}
|
|
2563
2609
|
if (data instanceof Promise) {
|
|
@@ -2630,7 +2676,7 @@
|
|
|
2630
2676
|
};
|
|
2631
2677
|
this.onCreate = function () {
|
|
2632
2678
|
var _a, _b;
|
|
2633
|
-
var
|
|
2679
|
+
var _2 = _this.gridOption, type = _2.type, editor = _2.editor, columns = _2.columns;
|
|
2634
2680
|
if (!(editor === null || editor === void 0 ? void 0 : editor.addable)) {
|
|
2635
2681
|
return;
|
|
2636
2682
|
}
|
|
@@ -2686,23 +2732,23 @@
|
|
|
2686
2732
|
};
|
|
2687
2733
|
this.onSave = function (item) { return __awaiter(_this, void 0, void 0, function () {
|
|
2688
2734
|
var editor, result, message, result, err_1;
|
|
2689
|
-
return __generator(this, function (
|
|
2690
|
-
switch (
|
|
2735
|
+
return __generator(this, function (_2) {
|
|
2736
|
+
switch (_2.label) {
|
|
2691
2737
|
case 0:
|
|
2692
2738
|
if (item.editorHandlerRow.saving) {
|
|
2693
2739
|
return [2 /*return*/];
|
|
2694
2740
|
}
|
|
2695
2741
|
editor = this.gridOption.editor;
|
|
2696
|
-
|
|
2742
|
+
_2.label = 1;
|
|
2697
2743
|
case 1:
|
|
2698
|
-
|
|
2744
|
+
_2.trys.push([1, 7, 8, 9]);
|
|
2699
2745
|
item.editorHandlerRow.saving = true;
|
|
2700
2746
|
if (!editor.validate) return [3 /*break*/, 4];
|
|
2701
2747
|
result = editor.validate(item, this.items.indexOf(item));
|
|
2702
2748
|
if (!(result instanceof Promise)) return [3 /*break*/, 3];
|
|
2703
2749
|
return [4 /*yield*/, result];
|
|
2704
2750
|
case 2:
|
|
2705
|
-
message =
|
|
2751
|
+
message = _2.sent();
|
|
2706
2752
|
if (message) {
|
|
2707
2753
|
throw message;
|
|
2708
2754
|
}
|
|
@@ -2711,15 +2757,15 @@
|
|
|
2711
2757
|
if (result) {
|
|
2712
2758
|
throw result;
|
|
2713
2759
|
}
|
|
2714
|
-
|
|
2760
|
+
_2.label = 4;
|
|
2715
2761
|
case 4:
|
|
2716
2762
|
if (!editor.onSave) return [3 /*break*/, 6];
|
|
2717
2763
|
result = editor.onSave(item);
|
|
2718
2764
|
if (!(result instanceof Promise)) return [3 /*break*/, 6];
|
|
2719
2765
|
return [4 /*yield*/, result];
|
|
2720
2766
|
case 5:
|
|
2721
|
-
|
|
2722
|
-
|
|
2767
|
+
_2.sent();
|
|
2768
|
+
_2.label = 6;
|
|
2723
2769
|
case 6:
|
|
2724
2770
|
if (item.editorStatus === 'create' && editor.type === 'popup') {
|
|
2725
2771
|
if (this.gridOption.type === 'local') {
|
|
@@ -2730,7 +2776,7 @@
|
|
|
2730
2776
|
item.editorStatus = undefined;
|
|
2731
2777
|
return [3 /*break*/, 9];
|
|
2732
2778
|
case 7:
|
|
2733
|
-
err_1 =
|
|
2779
|
+
err_1 = _2.sent();
|
|
2734
2780
|
this.notifyService.notify.warning(err_1);
|
|
2735
2781
|
return [3 /*break*/, 9];
|
|
2736
2782
|
case 8:
|
|
@@ -2945,7 +2991,7 @@
|
|
|
2945
2991
|
SdGridMaterial.decorators = [
|
|
2946
2992
|
{ type: core.Component, args: [{
|
|
2947
2993
|
selector: 'sd-grid-material',
|
|
2948
|
-
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 px-0\" 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 px-0\" 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\" [configuration]=\"configuration\" [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>",
|
|
2994
|
+
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 px-0\" 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 px-0\" 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?.visibleExcelRaw !== false\" mat-menu-item\r\n (click)=\"sdPopupExport.exportRaw()\" type=\"button\">\r\n <mat-icon fontSet=\"material-icons-outlined\">file_download</mat-icon>\r\n <span> {{ \"Export excel raw\" | sdTranslate }}</span>\r\n </button>\r\n <button *ngIf=\"gridOption.export?.visibleCSV !== false\" mat-menu-item\r\n (click)=\"sdPopupExport.exportCSV()\" 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\" [configuration]=\"configuration\" [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>",
|
|
2949
2995
|
animations: [
|
|
2950
2996
|
animations.trigger('detailExpand', [
|
|
2951
2997
|
animations.state('collapsed', animations.style({ height: '0', minHeight: '0', visibility: 'hidden' })),
|