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