@sd-angular/core 1.0.44 → 1.0.47
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/assets/scss/core/toastr.scss +1 -0
- package/bundles/sd-angular-core-grid-material.umd.js +315 -297
- package/bundles/sd-angular-core-grid-material.umd.js.map +1 -1
- package/bundles/sd-angular-core-grid-material.umd.min.js +2 -2
- package/bundles/sd-angular-core-grid-material.umd.min.js.map +1 -1
- package/bundles/sd-angular-core-notify.umd.js +15 -6
- package/bundles/sd-angular-core-notify.umd.js.map +1 -1
- package/bundles/sd-angular-core-notify.umd.min.js +2 -2
- package/bundles/sd-angular-core-notify.umd.min.js.map +1 -1
- package/bundles/sd-angular-core-popover.umd.js +704 -0
- package/bundles/sd-angular-core-popover.umd.js.map +1 -0
- package/bundles/sd-angular-core-popover.umd.min.js +16 -0
- package/bundles/sd-angular-core-popover.umd.min.js.map +1 -0
- package/bundles/sd-angular-core.umd.js +12 -4
- package/bundles/sd-angular-core.umd.js.map +1 -1
- package/bundles/sd-angular-core.umd.min.js +1 -1
- package/bundles/sd-angular-core.umd.min.js.map +1 -1
- package/esm2015/grid-material/sd-angular-core-grid-material.js +18 -19
- package/esm2015/grid-material/src/lib/components/desktop-cell-children-view/desktop-cell-children-view.component.js +2 -2
- package/esm2015/grid-material/src/lib/grid-material.component.js +20 -21
- package/esm2015/grid-material/src/lib/grid-material.module.js +2 -3
- package/esm2015/grid-material/src/lib/models/grid-column.model.js +1 -1
- package/esm2015/grid-material/src/lib/models/grid.model.js +1 -1
- package/esm2015/grid-material/src/lib/pipes/cell-view.pipe.js +8 -9
- package/esm2015/grid-material/src/lib/pipes/column-badge.pipe.js +1 -1
- package/esm2015/grid-material/src/lib/pipes/column-transform.pipe.js +8 -9
- package/esm2015/grid-material/src/lib/pipes/column-values.pipe.js +35 -12
- package/esm2015/notify/src/lib/notify.service.js +18 -9
- package/esm2015/popover/index.js +2 -0
- package/esm2015/popover/sd-angular-core-popover.js +5 -0
- package/esm2015/popover/src/lib/directives/popover-trigger.directive.js +218 -0
- package/esm2015/popover/src/lib/popover/popover.component.js +122 -0
- package/esm2015/popover/src/lib/popover.model.js +2 -0
- package/esm2015/popover/src/lib/popover.module.js +24 -0
- package/esm2015/popover/src/public-api.js +7 -0
- package/esm2015/public-api.js +2 -1
- package/fesm2015/sd-angular-core-grid-material.js +83 -117
- package/fesm2015/sd-angular-core-grid-material.js.map +1 -1
- package/fesm2015/sd-angular-core-notify.js +17 -8
- package/fesm2015/sd-angular-core-notify.js.map +1 -1
- package/fesm2015/sd-angular-core-popover.js +369 -0
- package/fesm2015/sd-angular-core-popover.js.map +1 -0
- package/fesm2015/sd-angular-core.js +1 -0
- package/fesm2015/sd-angular-core.js.map +1 -1
- package/grid-material/sd-angular-core-grid-material.d.ts +17 -18
- package/grid-material/sd-angular-core-grid-material.metadata.json +1 -1
- package/grid-material/src/lib/grid-material.component.d.ts +4 -3
- package/grid-material/src/lib/models/grid-column.model.d.ts +2 -2
- package/grid-material/src/lib/pipes/cell-view.pipe.d.ts +3 -3
- package/grid-material/src/lib/pipes/column-transform.pipe.d.ts +3 -3
- package/grid-material/src/lib/pipes/column-values.pipe.d.ts +2 -4
- package/package.json +1 -1
- package/popover/index.d.ts +1 -0
- package/popover/package.json +12 -0
- package/popover/sd-angular-core-popover.d.ts +4 -0
- package/popover/sd-angular-core-popover.metadata.json +1 -0
- package/popover/src/lib/directives/popover-trigger.directive.d.ts +25 -0
- package/popover/src/lib/popover/popover.component.d.ts +34 -0
- package/popover/src/lib/popover.model.d.ts +1 -0
- package/popover/src/lib/popover.module.d.ts +2 -0
- package/popover/src/public-api.d.ts +3 -0
- package/public-api.d.ts +1 -0
- package/{sd-angular-core-1.0.44.tgz → sd-angular-core-1.0.47.tgz} +0 -0
- package/sd-angular-core.metadata.json +1 -1
- package/esm2015/grid-material/src/lib/services/grid.service.js +0 -59
- package/grid-material/src/lib/services/grid.service.d.ts +0 -19
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
(function (global, factory) {
|
|
2
|
-
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@sd-angular/core/common'), require('@angular/core'), require('@angular/material/paginator'), require('@angular/material/sort'), require('@angular/animations'), require('uuid'), require('rxjs'), require('@sd-angular/core/notify'), require('@angular/cdk/drag-drop'), require('rxjs/operators'), require('object-hash'), require('@sd-angular/core/setting'), require('ngx-device-detector'), require('@sd-angular/core/loading'), require('@sd-angular/core/translate'), require('@sd-angular/core/export'), require('@angular/forms'), require('@sd-angular/core/
|
|
3
|
-
typeof define === 'function' && define.amd ? define('@sd-angular/core/grid-material', ['exports', '@sd-angular/core/common', '@angular/core', '@angular/material/paginator', '@angular/material/sort', '@angular/animations', 'uuid', 'rxjs', '@sd-angular/core/notify', '@angular/cdk/drag-drop', 'rxjs/operators', 'object-hash', '@sd-angular/core/setting', 'ngx-device-detector', '@sd-angular/core/loading', '@sd-angular/core/translate', '@sd-angular/core/export', '@angular/forms', '@sd-angular/core/
|
|
4
|
-
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global['sd-angular'] = global['sd-angular'] || {}, global['sd-angular'].core = global['sd-angular'].core || {}, global['sd-angular'].core['grid-material'] = {}), global['sd-angular'].core.common, global.ng.core, global.ng.material.paginator, global.ng.material.sort, global.ng.animations, global.uuid, global.rxjs, global['sd-angular'].core.notify, global.ng.cdk.dragDrop, global.rxjs.operators, global['object-hash'], global['sd-angular'].core.setting, global['ngx-device-detector'], global['sd-angular'].core.loading, global['sd-angular'].core.translate, global['sd-angular'].core.export, global.ng.forms, global['sd-angular'].core
|
|
5
|
-
}(this, (function (exports, common$1, core, paginator, sort, animations, uuid, rxjs, notify, dragDrop, operators, hash, setting, ngxDeviceDetector, loading, translate, _export, forms,
|
|
2
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@sd-angular/core/common'), require('@angular/core'), require('@angular/material/paginator'), require('@angular/material/sort'), require('@angular/animations'), require('uuid'), require('rxjs'), require('@sd-angular/core/notify'), require('@angular/cdk/drag-drop'), require('rxjs/operators'), require('object-hash'), require('@sd-angular/core/setting'), require('ngx-device-detector'), require('@sd-angular/core/loading'), require('@sd-angular/core/translate'), require('@sd-angular/core/export'), require('@angular/forms'), require('@sd-angular/core/quick-action'), require('@angular/common'), require('@angular/material/form-field'), require('@angular/material/icon'), require('@angular/material/input'), require('@angular/material/table'), require('@angular/material/progress-spinner'), require('@angular/cdk/table'), require('@angular/cdk/scrolling'), require('@angular/material/menu'), require('@angular/material/slider'), require('@angular/material/button'), require('@sd-angular/core/service'), require('@angular/material/tooltip'), require('@angular/material/chips'), require('@angular/material/radio'), require('@angular/material/slide-toggle'), require('@sd-angular/core/form'), require('@angular/material/checkbox'), require('@angular/material/list'), require('@angular/material/divider'), require('@sd-angular/core/side-drawer'), require('@sd-angular/core/utility')) :
|
|
3
|
+
typeof define === 'function' && define.amd ? define('@sd-angular/core/grid-material', ['exports', '@sd-angular/core/common', '@angular/core', '@angular/material/paginator', '@angular/material/sort', '@angular/animations', 'uuid', 'rxjs', '@sd-angular/core/notify', '@angular/cdk/drag-drop', 'rxjs/operators', 'object-hash', '@sd-angular/core/setting', 'ngx-device-detector', '@sd-angular/core/loading', '@sd-angular/core/translate', '@sd-angular/core/export', '@angular/forms', '@sd-angular/core/quick-action', '@angular/common', '@angular/material/form-field', '@angular/material/icon', '@angular/material/input', '@angular/material/table', '@angular/material/progress-spinner', '@angular/cdk/table', '@angular/cdk/scrolling', '@angular/material/menu', '@angular/material/slider', '@angular/material/button', '@sd-angular/core/service', '@angular/material/tooltip', '@angular/material/chips', '@angular/material/radio', '@angular/material/slide-toggle', '@sd-angular/core/form', '@angular/material/checkbox', '@angular/material/list', '@angular/material/divider', '@sd-angular/core/side-drawer', '@sd-angular/core/utility'], factory) :
|
|
4
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global['sd-angular'] = global['sd-angular'] || {}, global['sd-angular'].core = global['sd-angular'].core || {}, global['sd-angular'].core['grid-material'] = {}), global['sd-angular'].core.common, global.ng.core, global.ng.material.paginator, global.ng.material.sort, global.ng.animations, global.uuid, global.rxjs, global['sd-angular'].core.notify, global.ng.cdk.dragDrop, global.rxjs.operators, global['object-hash'], global['sd-angular'].core.setting, global['ngx-device-detector'], global['sd-angular'].core.loading, global['sd-angular'].core.translate, global['sd-angular'].core.export, global.ng.forms, global['sd-angular'].core['quick-action'], global.ng.common, global.ng.material.formField, global.ng.material.icon, global.ng.material.input, global.ng.material.table, global.ng.material.progressSpinner, global.ng.cdk.table, global.ng.cdk.scrolling, global.ng.material.menu, global.ng.material.slider, global.ng.material.button, global['sd-angular'].core.service, global.ng.material.tooltip, global.ng.material.chips, global.ng.material.radio, global.ng.material.slideToggle, global['sd-angular'].core.form, global.ng.material.checkbox, global.ng.material.list, global.ng.material.divider, global['sd-angular'].core['side-drawer'], global['sd-angular'].core.utility));
|
|
5
|
+
}(this, (function (exports, common$1, core, paginator, sort, animations, uuid, rxjs, notify, dragDrop, operators, hash, setting, ngxDeviceDetector, loading, translate, _export, forms, quickAction, common, formField, icon, input, table, progressSpinner, table$1, scrolling, menu, slider, button, service, tooltip, chips, radio, slideToggle, form, checkbox, list, divider, sideDrawer, utility) { 'use strict';
|
|
6
6
|
|
|
7
7
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
8
8
|
|
|
@@ -29,6 +29,7 @@
|
|
|
29
29
|
|
|
30
30
|
var uuid__namespace = /*#__PURE__*/_interopNamespace(uuid);
|
|
31
31
|
var hash__default = /*#__PURE__*/_interopDefaultLegacy(hash);
|
|
32
|
+
var hash__namespace = /*#__PURE__*/_interopNamespace(hash);
|
|
32
33
|
|
|
33
34
|
var SdMaterialCellDefDirective = /** @class */ (function () {
|
|
34
35
|
function SdMaterialCellDefDirective(templateRef) {
|
|
@@ -1648,73 +1649,58 @@
|
|
|
1648
1649
|
]; };
|
|
1649
1650
|
|
|
1650
1651
|
var _prefix$1, _cache$1;
|
|
1651
|
-
var
|
|
1652
|
-
function
|
|
1652
|
+
var SdColumnValuesPipe = /** @class */ (function () {
|
|
1653
|
+
function SdColumnValuesPipe() {
|
|
1653
1654
|
var _this = this;
|
|
1654
|
-
this.utilityService = utilityService;
|
|
1655
1655
|
_prefix$1.set(this, 'a1e67660-8aa2-4c11-b02d-71a32188719f');
|
|
1656
1656
|
_cache$1.set(this, {});
|
|
1657
|
-
this.
|
|
1658
|
-
var _a, _b, _c, _d,
|
|
1659
|
-
return __generator(this, function (
|
|
1660
|
-
switch (
|
|
1657
|
+
this.transform = function (value, column) { return __awaiter(_this, void 0, void 0, function () {
|
|
1658
|
+
var _a, _b, _c, _d, _e, _f, items, valueField, displayField, key, values;
|
|
1659
|
+
return __generator(this, function (_g) {
|
|
1660
|
+
switch (_g.label) {
|
|
1661
1661
|
case 0:
|
|
1662
1662
|
if (column.type !== 'values' || !((_a = column.option) === null || _a === void 0 ? void 0 : _a.items) || !((_b = column.option) === null || _b === void 0 ? void 0 : _b.valueField) || !((_c = column.option) === null || _c === void 0 ? void 0 : _c.displayField)) {
|
|
1663
|
-
return [2 /*return*/,
|
|
1664
|
-
values: [],
|
|
1665
|
-
obj: {}
|
|
1666
|
-
}];
|
|
1663
|
+
return [2 /*return*/, value];
|
|
1667
1664
|
}
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
|
|
1672
|
-
|
|
1673
|
-
if (!!__classPrivateFieldGet(this, _cache$1)[hashKey]) return [3 /*break*/, 4];
|
|
1674
|
-
items = [];
|
|
1675
|
-
if (!(typeof ((_d = column.option) === null || _d === void 0 ? void 0 : _d.items) === 'function')) return [3 /*break*/, 2];
|
|
1676
|
-
return [4 /*yield*/, column.option.items()];
|
|
1665
|
+
_f = column.option, items = _f.items, valueField = _f.valueField, displayField = _f.displayField;
|
|
1666
|
+
if (!(typeof (items) === 'function')) return [3 /*break*/, 3];
|
|
1667
|
+
key = hash__namespace(Object.assign(Object.assign({ prefix: __classPrivateFieldGet(this, _prefix$1) }, column), { value: value }));
|
|
1668
|
+
if (!!__classPrivateFieldGet(this, _cache$1)[key]) return [3 /*break*/, 2];
|
|
1669
|
+
return [4 /*yield*/, items(value, true)];
|
|
1677
1670
|
case 1:
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
|
|
1681
|
-
|
|
1682
|
-
_e.label = 3;
|
|
1683
|
-
case 3:
|
|
1684
|
-
__classPrivateFieldGet(this, _cache$1)[hashKey] = {
|
|
1685
|
-
values: items,
|
|
1686
|
-
obj: this.utilityService.arrayToObject(items, column.option.valueField)
|
|
1671
|
+
values = _g.sent();
|
|
1672
|
+
__classPrivateFieldGet(this, _cache$1)[key] = {
|
|
1673
|
+
items: values,
|
|
1674
|
+
obj: Array.toObject(values, valueField)
|
|
1687
1675
|
};
|
|
1688
|
-
|
|
1689
|
-
case
|
|
1676
|
+
_g.label = 2;
|
|
1677
|
+
case 2: return [3 /*break*/, 4];
|
|
1678
|
+
case 3:
|
|
1679
|
+
key = hash__namespace(Object.assign({ prefix: __classPrivateFieldGet(this, _prefix$1) }, column));
|
|
1680
|
+
if (!__classPrivateFieldGet(this, _cache$1)[key]) {
|
|
1681
|
+
__classPrivateFieldGet(this, _cache$1)[key] = {
|
|
1682
|
+
items: items || [],
|
|
1683
|
+
obj: Array.toObject(items, valueField)
|
|
1684
|
+
};
|
|
1685
|
+
}
|
|
1686
|
+
_g.label = 4;
|
|
1687
|
+
case 4: return [2 /*return*/, (_e = (_d = __classPrivateFieldGet(this, _cache$1)[key].obj[value]) === null || _d === void 0 ? void 0 : _d[displayField]) !== null && _e !== void 0 ? _e : value];
|
|
1690
1688
|
}
|
|
1691
1689
|
});
|
|
1692
1690
|
}); };
|
|
1693
|
-
this.getValues = function (column, key) {
|
|
1694
|
-
var hashKey = hash__default['default']({
|
|
1695
|
-
prefix: __classPrivateFieldGet(_this, _prefix$1),
|
|
1696
|
-
field: column.field,
|
|
1697
|
-
key: key,
|
|
1698
|
-
});
|
|
1699
|
-
return __classPrivateFieldGet(_this, _cache$1)[hashKey] || {
|
|
1700
|
-
values: [],
|
|
1701
|
-
obj: {}
|
|
1702
|
-
};
|
|
1703
|
-
};
|
|
1704
1691
|
}
|
|
1705
|
-
return
|
|
1692
|
+
return SdColumnValuesPipe;
|
|
1706
1693
|
}());
|
|
1707
1694
|
_prefix$1 = new WeakMap(), _cache$1 = new WeakMap();
|
|
1708
|
-
|
|
1709
|
-
{ type: core.
|
|
1710
|
-
|
|
1711
|
-
|
|
1712
|
-
|
|
1713
|
-
]; };
|
|
1695
|
+
SdColumnValuesPipe.decorators = [
|
|
1696
|
+
{ type: core.Pipe, args: [{
|
|
1697
|
+
name: 'columnValues'
|
|
1698
|
+
},] }
|
|
1699
|
+
];
|
|
1714
1700
|
|
|
1715
1701
|
var _paginator, _sort, _subscription$1, _optionChanges, _initCellDef, _initFilterDef, _initFooterDef, _filterExportInfo, _initConfiguration, _filterLocal, _getFilter, _load$1, _render, _exportedItems, _allColumns, _allExportedColumns, _onExport, _updateSelectedItems;
|
|
1716
1702
|
var SdGridMaterial = /** @class */ (function () {
|
|
1717
|
-
function SdGridMaterial(ref, configuration, gridConfigurationService, exportService, notifyService, translateService,
|
|
1703
|
+
function SdGridMaterial(ref, configuration, gridConfigurationService, exportService, notifyService, translateService, columnValuesPipe) {
|
|
1718
1704
|
var _this = this;
|
|
1719
1705
|
this.ref = ref;
|
|
1720
1706
|
this.configuration = configuration;
|
|
@@ -1722,7 +1708,7 @@
|
|
|
1722
1708
|
this.exportService = exportService;
|
|
1723
1709
|
this.notifyService = notifyService;
|
|
1724
1710
|
this.translateService = translateService;
|
|
1725
|
-
this.
|
|
1711
|
+
this.columnValuesPipe = columnValuesPipe;
|
|
1726
1712
|
this.key = uuid.v4();
|
|
1727
1713
|
this.localItems = [];
|
|
1728
1714
|
this.items = [];
|
|
@@ -1753,11 +1739,11 @@
|
|
|
1753
1739
|
this.isSelectAll = false;
|
|
1754
1740
|
this.exportTitle = 'Export';
|
|
1755
1741
|
_initCellDef.set(this, function () {
|
|
1756
|
-
var e_1,
|
|
1742
|
+
var e_1, _v;
|
|
1757
1743
|
_this.cellDef = {};
|
|
1758
1744
|
try {
|
|
1759
|
-
for (var
|
|
1760
|
-
var cellDef =
|
|
1745
|
+
for (var _w = __values(_this.sdCellDefs), _x = _w.next(); !_x.done; _x = _w.next()) {
|
|
1746
|
+
var cellDef = _x.value;
|
|
1761
1747
|
if (cellDef.sdMaterialCellDef) {
|
|
1762
1748
|
_this.cellDef[cellDef.sdMaterialCellDef] = cellDef;
|
|
1763
1749
|
}
|
|
@@ -1766,35 +1752,35 @@
|
|
|
1766
1752
|
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
1767
1753
|
finally {
|
|
1768
1754
|
try {
|
|
1769
|
-
if (
|
|
1755
|
+
if (_x && !_x.done && (_v = _w.return)) _v.call(_w);
|
|
1770
1756
|
}
|
|
1771
1757
|
finally { if (e_1) throw e_1.error; }
|
|
1772
1758
|
}
|
|
1773
1759
|
});
|
|
1774
1760
|
_initFilterDef.set(this, function () {
|
|
1775
|
-
var e_2,
|
|
1761
|
+
var e_2, _v;
|
|
1776
1762
|
_this.filterDefs = [];
|
|
1777
1763
|
try {
|
|
1778
|
-
for (var
|
|
1779
|
-
var filterDef =
|
|
1764
|
+
for (var _w = __values(_this.sdFilterDefs), _x = _w.next(); !_x.done; _x = _w.next()) {
|
|
1765
|
+
var filterDef = _x.value;
|
|
1780
1766
|
_this.filterDefs.push(filterDef);
|
|
1781
1767
|
}
|
|
1782
1768
|
}
|
|
1783
1769
|
catch (e_2_1) { e_2 = { error: e_2_1 }; }
|
|
1784
1770
|
finally {
|
|
1785
1771
|
try {
|
|
1786
|
-
if (
|
|
1772
|
+
if (_x && !_x.done && (_v = _w.return)) _v.call(_w);
|
|
1787
1773
|
}
|
|
1788
1774
|
finally { if (e_2) throw e_2.error; }
|
|
1789
1775
|
}
|
|
1790
1776
|
});
|
|
1791
1777
|
_initFooterDef.set(this, function () {
|
|
1792
|
-
var e_3,
|
|
1778
|
+
var e_3, _v;
|
|
1793
1779
|
_this.footerDef = {};
|
|
1794
1780
|
_this.hasFooter = false;
|
|
1795
1781
|
try {
|
|
1796
|
-
for (var
|
|
1797
|
-
var footerDef =
|
|
1782
|
+
for (var _w = __values(_this.sdFooterDefs), _x = _w.next(); !_x.done; _x = _w.next()) {
|
|
1783
|
+
var footerDef = _x.value;
|
|
1798
1784
|
if (footerDef.sdMaterialFooterDef) {
|
|
1799
1785
|
_this.hasFooter = true;
|
|
1800
1786
|
_this.footerDef[footerDef.sdMaterialFooterDef] = footerDef;
|
|
@@ -1804,7 +1790,7 @@
|
|
|
1804
1790
|
catch (e_3_1) { e_3 = { error: e_3_1 }; }
|
|
1805
1791
|
finally {
|
|
1806
1792
|
try {
|
|
1807
|
-
if (
|
|
1793
|
+
if (_x && !_x.done && (_v = _w.return)) _v.call(_w);
|
|
1808
1794
|
}
|
|
1809
1795
|
finally { if (e_3) throw e_3.error; }
|
|
1810
1796
|
}
|
|
@@ -1836,7 +1822,7 @@
|
|
|
1836
1822
|
var columns = _this.gridOption.columns;
|
|
1837
1823
|
var rawColumnFilter = filterInfo.rawColumnFilter, orderBy = filterInfo.orderBy, orderDirection = filterInfo.orderDirection, pageSize = filterInfo.pageSize, pageNumber = filterInfo.pageNumber;
|
|
1838
1824
|
var items = localItems.filter(function (item) {
|
|
1839
|
-
var e_4,
|
|
1825
|
+
var e_4, _v;
|
|
1840
1826
|
var _a, _b, _c, _d;
|
|
1841
1827
|
try {
|
|
1842
1828
|
for (var columns_1 = __values(columns), columns_1_1 = columns_1.next(); !columns_1_1.done; columns_1_1 = columns_1.next()) {
|
|
@@ -1910,7 +1896,7 @@
|
|
|
1910
1896
|
catch (e_4_1) { e_4 = { error: e_4_1 }; }
|
|
1911
1897
|
finally {
|
|
1912
1898
|
try {
|
|
1913
|
-
if (columns_1_1 && !columns_1_1.done && (
|
|
1899
|
+
if (columns_1_1 && !columns_1_1.done && (_v = columns_1.return)) _v.call(columns_1);
|
|
1914
1900
|
}
|
|
1915
1901
|
finally { if (e_4) throw e_4.error; }
|
|
1916
1902
|
}
|
|
@@ -1968,37 +1954,37 @@
|
|
|
1968
1954
|
_load$1.set(this, function (filterReq, force) {
|
|
1969
1955
|
if (force === void 0) { force = true; }
|
|
1970
1956
|
return __awaiter(_this, void 0, void 0, function () {
|
|
1971
|
-
var result, results,
|
|
1972
|
-
return __generator(this, function (
|
|
1973
|
-
switch (
|
|
1957
|
+
var result, results, _v, error_1;
|
|
1958
|
+
return __generator(this, function (_w) {
|
|
1959
|
+
switch (_w.label) {
|
|
1974
1960
|
case 0:
|
|
1975
1961
|
this.isLoading = true;
|
|
1976
|
-
|
|
1962
|
+
_w.label = 1;
|
|
1977
1963
|
case 1:
|
|
1978
|
-
|
|
1964
|
+
_w.trys.push([1, 8, 9, 10]);
|
|
1979
1965
|
if (!(this.gridOption.type === 'server')) return [3 /*break*/, 3];
|
|
1980
1966
|
result = this.gridOption.items(filterReq);
|
|
1981
1967
|
if (rxjs.isObservable(result)) {
|
|
1982
1968
|
result = result.toPromise();
|
|
1983
1969
|
}
|
|
1984
1970
|
return [4 /*yield*/, result];
|
|
1985
|
-
case 2: return [2 /*return*/,
|
|
1971
|
+
case 2: return [2 /*return*/, _w.sent()];
|
|
1986
1972
|
case 3:
|
|
1987
1973
|
if (!force) return [3 /*break*/, 6];
|
|
1988
1974
|
results = this.gridOption.items();
|
|
1989
1975
|
if (!(results instanceof Promise)) return [3 /*break*/, 5];
|
|
1990
|
-
|
|
1976
|
+
_v = this;
|
|
1991
1977
|
return [4 /*yield*/, results];
|
|
1992
1978
|
case 4:
|
|
1993
|
-
|
|
1979
|
+
_v.localItems = _w.sent();
|
|
1994
1980
|
return [3 /*break*/, 6];
|
|
1995
1981
|
case 5:
|
|
1996
1982
|
this.localItems = results;
|
|
1997
|
-
|
|
1983
|
+
_w.label = 6;
|
|
1998
1984
|
case 6: return [2 /*return*/, __classPrivateFieldGet(this, _filterLocal).call(this, this.localItems, filterReq)];
|
|
1999
1985
|
case 7: return [3 /*break*/, 10];
|
|
2000
1986
|
case 8:
|
|
2001
|
-
error_1 =
|
|
1987
|
+
error_1 = _w.sent();
|
|
2002
1988
|
this.notifyService.handle.error(error_1);
|
|
2003
1989
|
return [3 /*break*/, 10];
|
|
2004
1990
|
case 9:
|
|
@@ -2012,8 +1998,8 @@
|
|
|
2012
1998
|
});
|
|
2013
1999
|
_render.set(this, function (args) { return __awaiter(_this, void 0, void 0, function () {
|
|
2014
2000
|
var _a, _b, _c;
|
|
2015
|
-
return __generator(this, function (
|
|
2016
|
-
switch (
|
|
2001
|
+
return __generator(this, function (_v) {
|
|
2002
|
+
switch (_v.label) {
|
|
2017
2003
|
case 0:
|
|
2018
2004
|
this.items = (args === null || args === void 0 ? void 0 : args.items) || [];
|
|
2019
2005
|
this.total = (args === null || args === void 0 ? void 0 : args.total) || 0;
|
|
@@ -2023,7 +2009,7 @@
|
|
|
2023
2009
|
});
|
|
2024
2010
|
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))];
|
|
2025
2011
|
case 1:
|
|
2026
|
-
|
|
2012
|
+
_v.sent();
|
|
2027
2013
|
this.isSelectAll = this.items.every(function (e) { return e.isSelected; });
|
|
2028
2014
|
__classPrivateFieldGet(this, _updateSelectedItems).call(this);
|
|
2029
2015
|
return [2 /*return*/];
|
|
@@ -2034,11 +2020,11 @@
|
|
|
2034
2020
|
if (force === void 0) { force = true; }
|
|
2035
2021
|
return __awaiter(_this, void 0, void 0, function () {
|
|
2036
2022
|
var data;
|
|
2037
|
-
return __generator(this, function (
|
|
2038
|
-
switch (
|
|
2023
|
+
return __generator(this, function (_v) {
|
|
2024
|
+
switch (_v.label) {
|
|
2039
2025
|
case 0: return [4 /*yield*/, __classPrivateFieldGet(this, _load$1).call(this, __classPrivateFieldGet(this, _getFilter).call(this), force)];
|
|
2040
2026
|
case 1:
|
|
2041
|
-
data =
|
|
2027
|
+
data = _v.sent();
|
|
2042
2028
|
__classPrivateFieldGet(this, _render).call(this, data);
|
|
2043
2029
|
return [2 /*return*/];
|
|
2044
2030
|
}
|
|
@@ -2050,8 +2036,8 @@
|
|
|
2050
2036
|
if (pageSize === void 0) { pageSize = 10000; }
|
|
2051
2037
|
return __awaiter(_this, void 0, void 0, function () {
|
|
2052
2038
|
var _d, _e, result, filterInfo, result, exportedItems, results;
|
|
2053
|
-
return __generator(this, function (
|
|
2054
|
-
switch (
|
|
2039
|
+
return __generator(this, function (_v) {
|
|
2040
|
+
switch (_v.label) {
|
|
2055
2041
|
case 0:
|
|
2056
2042
|
if (!((_d = this.gridOption.export) === null || _d === void 0 ? void 0 : _d.items)) return [3 /*break*/, 2];
|
|
2057
2043
|
result = (_e = this.gridOption.export) === null || _e === void 0 ? void 0 : _e.items(__classPrivateFieldGet(this, _filterExportInfo).call(this, pageNumber, pageSize));
|
|
@@ -2065,7 +2051,7 @@
|
|
|
2065
2051
|
result = result.toPromise();
|
|
2066
2052
|
}
|
|
2067
2053
|
return [4 /*yield*/, result];
|
|
2068
|
-
case 1: return [2 /*return*/,
|
|
2054
|
+
case 1: return [2 /*return*/, _v.sent()];
|
|
2069
2055
|
case 2:
|
|
2070
2056
|
filterInfo = __classPrivateFieldGet(this, _filterExportInfo).call(this, pageNumber, pageSize);
|
|
2071
2057
|
if (!(this.gridOption.type === 'server')) return [3 /*break*/, 4];
|
|
@@ -2074,7 +2060,7 @@
|
|
|
2074
2060
|
result = result.toPromise();
|
|
2075
2061
|
}
|
|
2076
2062
|
return [4 /*yield*/, result];
|
|
2077
|
-
case 3: return [2 /*return*/,
|
|
2063
|
+
case 3: return [2 /*return*/, _v.sent()];
|
|
2078
2064
|
case 4:
|
|
2079
2065
|
exportedItems = [];
|
|
2080
2066
|
if (!(typeof (this.gridOption.items) === 'function')) return [3 /*break*/, 8];
|
|
@@ -2082,15 +2068,15 @@
|
|
|
2082
2068
|
if (!(results instanceof Promise)) return [3 /*break*/, 6];
|
|
2083
2069
|
return [4 /*yield*/, results];
|
|
2084
2070
|
case 5:
|
|
2085
|
-
exportedItems =
|
|
2071
|
+
exportedItems = _v.sent();
|
|
2086
2072
|
return [3 /*break*/, 7];
|
|
2087
2073
|
case 6:
|
|
2088
2074
|
exportedItems = results;
|
|
2089
|
-
|
|
2075
|
+
_v.label = 7;
|
|
2090
2076
|
case 7: return [3 /*break*/, 9];
|
|
2091
2077
|
case 8:
|
|
2092
2078
|
exportedItems = this.gridOption.items;
|
|
2093
|
-
|
|
2079
|
+
_v.label = 9;
|
|
2094
2080
|
case 9: return [2 /*return*/, __classPrivateFieldGet(this, _filterLocal).call(this, exportedItems, filterInfo)];
|
|
2095
2081
|
}
|
|
2096
2082
|
});
|
|
@@ -2130,13 +2116,13 @@
|
|
|
2130
2116
|
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); })) || [];
|
|
2131
2117
|
});
|
|
2132
2118
|
_onExport.set(this, function (args) { return __awaiter(_this, void 0, void 0, function () {
|
|
2133
|
-
var _f, _g, _h, _j, _k, _l, _m, _o, _p, file, columns_2, isCSV, pageSize, total, pageNumber, exportItems, items, _loop_1, this_1, sheets,
|
|
2134
|
-
var e_5,
|
|
2119
|
+
var _f, _g, _h, _j, _k, _l, _m, _o, _p, file, columns_2, isCSV, pageSize, total, pageNumber, exportItems, items, _loop_1, this_1, sheets, _v, _w, sheet, _x, _y, _z, e_5_1;
|
|
2120
|
+
var e_5, _0;
|
|
2135
2121
|
var _this = this;
|
|
2136
|
-
return __generator(this, function (
|
|
2137
|
-
switch (
|
|
2122
|
+
return __generator(this, function (_1) {
|
|
2123
|
+
switch (_1.label) {
|
|
2138
2124
|
case 0:
|
|
2139
|
-
|
|
2125
|
+
_1.trys.push([0, , 18, 19]);
|
|
2140
2126
|
file = args.file, columns_2 = args.columns, isCSV = args.isCSV;
|
|
2141
2127
|
pageSize = ((_g = (_f = this.gridOption) === null || _f === void 0 ? void 0 : _f.export) === null || _g === void 0 ? void 0 : _g.maxItemsPerRequest) || 1000;
|
|
2142
2128
|
total = this.total;
|
|
@@ -2145,13 +2131,13 @@
|
|
|
2145
2131
|
this.isExporting = true;
|
|
2146
2132
|
items = [];
|
|
2147
2133
|
_loop_1 = function () {
|
|
2148
|
-
var res, results, totalPage, percent, allColumns, allExportedColumns, _loop_2, exportItems_1, exportItems_1_1, item;
|
|
2149
|
-
var e_6,
|
|
2150
|
-
return __generator(this, function (
|
|
2151
|
-
switch (
|
|
2134
|
+
var res, results, totalPage, percent, allColumns, allExportedColumns, _loop_2, exportItems_1, exportItems_1_1, item, e_6_1;
|
|
2135
|
+
var e_6, _v;
|
|
2136
|
+
return __generator(this, function (_w) {
|
|
2137
|
+
switch (_w.label) {
|
|
2152
2138
|
case 0: return [4 /*yield*/, __classPrivateFieldGet(this_1, _exportedItems).call(this_1, pageNumber, pageSize)];
|
|
2153
2139
|
case 1:
|
|
2154
|
-
res =
|
|
2140
|
+
res = _w.sent();
|
|
2155
2141
|
if ('items' in res) {
|
|
2156
2142
|
exportItems = res.items;
|
|
2157
2143
|
total = res.total;
|
|
@@ -2165,11 +2151,11 @@
|
|
|
2165
2151
|
if (!(results instanceof Promise)) return [3 /*break*/, 3];
|
|
2166
2152
|
return [4 /*yield*/, results];
|
|
2167
2153
|
case 2:
|
|
2168
|
-
exportItems =
|
|
2154
|
+
exportItems = _w.sent();
|
|
2169
2155
|
return [3 /*break*/, 4];
|
|
2170
2156
|
case 3:
|
|
2171
2157
|
exportItems = results;
|
|
2172
|
-
|
|
2158
|
+
_w.label = 4;
|
|
2173
2159
|
case 4:
|
|
2174
2160
|
totalPage = total / pageSize;
|
|
2175
2161
|
percent = Math.round(pageNumber * 100.0 / totalPage);
|
|
@@ -2177,103 +2163,159 @@
|
|
|
2177
2163
|
allColumns = __classPrivateFieldGet(this_1, _allColumns).call(this_1);
|
|
2178
2164
|
allExportedColumns = __classPrivateFieldGet(this_1, _allExportedColumns).call(this_1);
|
|
2179
2165
|
_loop_2 = function (item) {
|
|
2180
|
-
var obj
|
|
2181
|
-
var
|
|
2182
|
-
|
|
2183
|
-
|
|
2184
|
-
|
|
2185
|
-
|
|
2186
|
-
|
|
2187
|
-
|
|
2188
|
-
|
|
2189
|
-
|
|
2190
|
-
|
|
2191
|
-
|
|
2192
|
-
|
|
2193
|
-
|
|
2194
|
-
|
|
2195
|
-
|
|
2196
|
-
|
|
2197
|
-
|
|
2198
|
-
|
|
2199
|
-
|
|
2200
|
-
|
|
2201
|
-
|
|
2202
|
-
|
|
2203
|
-
|
|
2204
|
-
|
|
2205
|
-
|
|
2206
|
-
|
|
2207
|
-
|
|
2208
|
-
|
|
2209
|
-
|
|
2210
|
-
|
|
2211
|
-
|
|
2212
|
-
|
|
2213
|
-
|
|
2214
|
-
|
|
2215
|
-
|
|
2216
|
-
|
|
2217
|
-
|
|
2218
|
-
|
|
2219
|
-
|
|
2220
|
-
|
|
2221
|
-
|
|
2222
|
-
|
|
2223
|
-
|
|
2224
|
-
|
|
2225
|
-
|
|
2226
|
-
|
|
2227
|
-
|
|
2166
|
+
var obj, handle, columns_3, columns_3_1, exportColumn, e_7_1;
|
|
2167
|
+
var e_7, _v;
|
|
2168
|
+
return __generator(this, function (_w) {
|
|
2169
|
+
switch (_w.label) {
|
|
2170
|
+
case 0:
|
|
2171
|
+
obj = {};
|
|
2172
|
+
handle = function (exportColumn) { return __awaiter(_this, void 0, void 0, function () {
|
|
2173
|
+
var _q, _r, column, exportedColumn, date, date, date, _v, _w;
|
|
2174
|
+
return __generator(this, function (_x) {
|
|
2175
|
+
switch (_x.label) {
|
|
2176
|
+
case 0:
|
|
2177
|
+
obj[exportColumn.field] = item[exportColumn.field];
|
|
2178
|
+
column = allColumns.find(function (e) { return e.field === exportColumn.field; });
|
|
2179
|
+
exportedColumn = allExportedColumns.find(function (e) { return e.field === exportColumn.field; });
|
|
2180
|
+
if (exportedColumn === null || exportedColumn === void 0 ? void 0 : exportedColumn.transform) {
|
|
2181
|
+
obj[exportedColumn.field] = exportedColumn.transform(item[exportedColumn.field], item);
|
|
2182
|
+
return [2 /*return*/];
|
|
2183
|
+
}
|
|
2184
|
+
if (!column) {
|
|
2185
|
+
return [2 /*return*/];
|
|
2186
|
+
}
|
|
2187
|
+
if (column.type === 'children' || column.type === 'children-col') {
|
|
2188
|
+
column === null || column === void 0 ? void 0 : column.children.forEach(function (childColumn) { return handle(childColumn); });
|
|
2189
|
+
return [2 /*return*/];
|
|
2190
|
+
}
|
|
2191
|
+
if (!columns_2.some(function (e) { return e.field === column.field; })) {
|
|
2192
|
+
return [2 /*return*/];
|
|
2193
|
+
}
|
|
2194
|
+
if (!column.transform) return [3 /*break*/, 1];
|
|
2195
|
+
obj[column.field] = column.transform(item[column.field], item);
|
|
2196
|
+
return [3 /*break*/, 10];
|
|
2197
|
+
case 1:
|
|
2198
|
+
if (!(item[column.field] === undefined || item[column.field] === null || item[column.field] === '')) return [3 /*break*/, 2];
|
|
2199
|
+
obj[column.field] = '';
|
|
2200
|
+
return [3 /*break*/, 10];
|
|
2201
|
+
case 2:
|
|
2202
|
+
if (!(column.type === 'string' || column.type === 'number')) return [3 /*break*/, 3];
|
|
2203
|
+
// Nếu cell là string hoặc number thì gán bằng chính nó
|
|
2204
|
+
obj[column.field] = item[column.field];
|
|
2205
|
+
return [3 /*break*/, 10];
|
|
2206
|
+
case 3:
|
|
2207
|
+
if (!(column.type === 'bool')) return [3 /*break*/, 4];
|
|
2208
|
+
// Nếu là bool thì gán bằng giá trị trueValue và falseValue (nếu có), mặc định là TRUE/FALSE
|
|
2209
|
+
if (item[column.field]) {
|
|
2210
|
+
obj[column.field] = ((_q = column.option) === null || _q === void 0 ? void 0 : _q.displayOnTrue) || 'True';
|
|
2211
|
+
}
|
|
2212
|
+
else {
|
|
2213
|
+
obj[column.field] = ((_r = column.option) === null || _r === void 0 ? void 0 : _r.displayOnFalse) || 'False';
|
|
2214
|
+
}
|
|
2215
|
+
return [3 /*break*/, 10];
|
|
2216
|
+
case 4:
|
|
2217
|
+
if (!(column.type === 'date')) return [3 /*break*/, 5];
|
|
2218
|
+
date = new Date(item[column.field]);
|
|
2219
|
+
obj[column.field] = Date.toFormat(date, 'dd/MM/yyyy');
|
|
2220
|
+
return [3 /*break*/, 10];
|
|
2221
|
+
case 5:
|
|
2222
|
+
if (!(column.type === 'datetime')) return [3 /*break*/, 6];
|
|
2223
|
+
date = new Date(item[column.field]);
|
|
2224
|
+
obj[column.field] = Date.toFormat(date, 'dd/MM/yyyy HH:mm:ss');
|
|
2225
|
+
return [3 /*break*/, 10];
|
|
2226
|
+
case 6:
|
|
2227
|
+
if (!(column.type === 'time')) return [3 /*break*/, 7];
|
|
2228
|
+
date = new Date(item[column.field]);
|
|
2229
|
+
obj[column.field] = Date.toFormat(date, 'HH:mm:ss');
|
|
2230
|
+
return [3 /*break*/, 10];
|
|
2231
|
+
case 7:
|
|
2232
|
+
if (!(column.type === 'values')) return [3 /*break*/, 9];
|
|
2233
|
+
// Nếu là values thì lấy giá trị của value được chọn
|
|
2234
|
+
_v = obj;
|
|
2235
|
+
_w = column.field;
|
|
2236
|
+
return [4 /*yield*/, this.columnValuesPipe.transform(item[column.field], column)];
|
|
2237
|
+
case 8:
|
|
2238
|
+
// Nếu là values thì lấy giá trị của value được chọn
|
|
2239
|
+
_v[_w] = _x.sent();
|
|
2240
|
+
return [3 /*break*/, 10];
|
|
2241
|
+
case 9:
|
|
2242
|
+
obj[column.field] = item[column.field];
|
|
2243
|
+
_x.label = 10;
|
|
2244
|
+
case 10: return [2 /*return*/];
|
|
2245
|
+
}
|
|
2246
|
+
});
|
|
2247
|
+
}); };
|
|
2248
|
+
_w.label = 1;
|
|
2249
|
+
case 1:
|
|
2250
|
+
_w.trys.push([1, 6, 7, 8]);
|
|
2251
|
+
columns_3 = (e_7 = void 0, __values(columns_2)), columns_3_1 = columns_3.next();
|
|
2252
|
+
_w.label = 2;
|
|
2253
|
+
case 2:
|
|
2254
|
+
if (!!columns_3_1.done) return [3 /*break*/, 5];
|
|
2255
|
+
exportColumn = columns_3_1.value;
|
|
2256
|
+
return [4 /*yield*/, handle(exportColumn)];
|
|
2257
|
+
case 3:
|
|
2258
|
+
_w.sent();
|
|
2259
|
+
_w.label = 4;
|
|
2260
|
+
case 4:
|
|
2261
|
+
columns_3_1 = columns_3.next();
|
|
2262
|
+
return [3 /*break*/, 2];
|
|
2263
|
+
case 5: return [3 /*break*/, 8];
|
|
2264
|
+
case 6:
|
|
2265
|
+
e_7_1 = _w.sent();
|
|
2266
|
+
e_7 = { error: e_7_1 };
|
|
2267
|
+
return [3 /*break*/, 8];
|
|
2268
|
+
case 7:
|
|
2269
|
+
try {
|
|
2270
|
+
if (columns_3_1 && !columns_3_1.done && (_v = columns_3.return)) _v.call(columns_3);
|
|
2271
|
+
}
|
|
2272
|
+
finally { if (e_7) throw e_7.error; }
|
|
2273
|
+
return [7 /*endfinally*/];
|
|
2274
|
+
case 8:
|
|
2275
|
+
items.push(obj);
|
|
2276
|
+
return [2 /*return*/];
|
|
2228
2277
|
}
|
|
2229
|
-
|
|
2230
|
-
// Nếu là time thì convert theo đúng format
|
|
2231
|
-
var date = new Date(item[column.field]);
|
|
2232
|
-
obj[column.field] = Date.toFormat(date, 'HH:mm:ss');
|
|
2233
|
-
}
|
|
2234
|
-
else if (column.type === 'values') {
|
|
2235
|
-
// Nếu là values thì lấy giá trị của value được chọn
|
|
2236
|
-
var data = _this.gridService.getValues(column, _this.key);
|
|
2237
|
-
if (data.obj[column.option.displayField] !== null && data.obj[column.option.displayField] !== undefined) {
|
|
2238
|
-
obj[column.field] = data.obj[column.option.displayField];
|
|
2239
|
-
}
|
|
2240
|
-
else {
|
|
2241
|
-
obj[column.field] = item[column.field];
|
|
2242
|
-
}
|
|
2243
|
-
}
|
|
2244
|
-
else {
|
|
2245
|
-
obj[column.field] = item[column.field];
|
|
2246
|
-
}
|
|
2247
|
-
};
|
|
2248
|
-
// this.gridOption.columns.forEach(handle);
|
|
2249
|
-
columns_2.forEach(handle);
|
|
2250
|
-
items.push(obj);
|
|
2278
|
+
});
|
|
2251
2279
|
};
|
|
2280
|
+
_w.label = 5;
|
|
2281
|
+
case 5:
|
|
2282
|
+
_w.trys.push([5, 10, 11, 12]);
|
|
2283
|
+
exportItems_1 = (e_6 = void 0, __values(exportItems)), exportItems_1_1 = exportItems_1.next();
|
|
2284
|
+
_w.label = 6;
|
|
2285
|
+
case 6:
|
|
2286
|
+
if (!!exportItems_1_1.done) return [3 /*break*/, 9];
|
|
2287
|
+
item = exportItems_1_1.value;
|
|
2288
|
+
return [5 /*yield**/, _loop_2(item)];
|
|
2289
|
+
case 7:
|
|
2290
|
+
_w.sent();
|
|
2291
|
+
_w.label = 8;
|
|
2292
|
+
case 8:
|
|
2293
|
+
exportItems_1_1 = exportItems_1.next();
|
|
2294
|
+
return [3 /*break*/, 6];
|
|
2295
|
+
case 9: return [3 /*break*/, 12];
|
|
2296
|
+
case 10:
|
|
2297
|
+
e_6_1 = _w.sent();
|
|
2298
|
+
e_6 = { error: e_6_1 };
|
|
2299
|
+
return [3 /*break*/, 12];
|
|
2300
|
+
case 11:
|
|
2252
2301
|
try {
|
|
2253
|
-
|
|
2254
|
-
item = exportItems_1_1.value;
|
|
2255
|
-
_loop_2(item);
|
|
2256
|
-
}
|
|
2257
|
-
}
|
|
2258
|
-
catch (e_6_1) { e_6 = { error: e_6_1 }; }
|
|
2259
|
-
finally {
|
|
2260
|
-
try {
|
|
2261
|
-
if (exportItems_1_1 && !exportItems_1_1.done && (_t = exportItems_1.return)) _t.call(exportItems_1);
|
|
2262
|
-
}
|
|
2263
|
-
finally { if (e_6) throw e_6.error; }
|
|
2302
|
+
if (exportItems_1_1 && !exportItems_1_1.done && (_v = exportItems_1.return)) _v.call(exportItems_1);
|
|
2264
2303
|
}
|
|
2304
|
+
finally { if (e_6) throw e_6.error; }
|
|
2305
|
+
return [7 /*endfinally*/];
|
|
2306
|
+
case 12:
|
|
2265
2307
|
pageNumber++;
|
|
2266
2308
|
return [2 /*return*/];
|
|
2267
2309
|
}
|
|
2268
2310
|
});
|
|
2269
2311
|
};
|
|
2270
2312
|
this_1 = this;
|
|
2271
|
-
|
|
2313
|
+
_1.label = 1;
|
|
2272
2314
|
case 1:
|
|
2273
2315
|
if (!(pageNumber * pageSize < total)) return [3 /*break*/, 3];
|
|
2274
2316
|
return [5 /*yield**/, _loop_1()];
|
|
2275
2317
|
case 2:
|
|
2276
|
-
|
|
2318
|
+
_1.sent();
|
|
2277
2319
|
return [3 /*break*/, 1];
|
|
2278
2320
|
case 3:
|
|
2279
2321
|
if (!!(file === null || file === void 0 ? void 0 : file.filePath)) return [3 /*break*/, 16];
|
|
@@ -2284,19 +2326,19 @@
|
|
|
2284
2326
|
fileName: (_k = (_j = this.gridOption) === null || _j === void 0 ? void 0 : _j.export) === null || _k === void 0 ? void 0 : _k.fileName
|
|
2285
2327
|
})];
|
|
2286
2328
|
case 4:
|
|
2287
|
-
|
|
2329
|
+
_1.sent();
|
|
2288
2330
|
return [2 /*return*/];
|
|
2289
2331
|
case 5:
|
|
2290
2332
|
sheets = [];
|
|
2291
2333
|
if (!Array.isArray((_m = (_l = this.gridOption) === null || _l === void 0 ? void 0 : _l.export) === null || _m === void 0 ? void 0 : _m.sheets)) return [3 /*break*/, 14];
|
|
2292
|
-
|
|
2334
|
+
_1.label = 6;
|
|
2293
2335
|
case 6:
|
|
2294
|
-
|
|
2295
|
-
|
|
2296
|
-
|
|
2336
|
+
_1.trys.push([6, 12, 13, 14]);
|
|
2337
|
+
_v = __values(this.gridOption.export.sheets), _w = _v.next();
|
|
2338
|
+
_1.label = 7;
|
|
2297
2339
|
case 7:
|
|
2298
|
-
if (!!
|
|
2299
|
-
sheet =
|
|
2340
|
+
if (!!_w.done) return [3 /*break*/, 11];
|
|
2341
|
+
sheet = _w.value;
|
|
2300
2342
|
if (!(sheet.name && sheet.items && sheet.fields)) return [3 /*break*/, 10];
|
|
2301
2343
|
if (!Array.isArray(sheet.items)) return [3 /*break*/, 8];
|
|
2302
2344
|
sheets.push({
|
|
@@ -2306,27 +2348,27 @@
|
|
|
2306
2348
|
});
|
|
2307
2349
|
return [3 /*break*/, 10];
|
|
2308
2350
|
case 8:
|
|
2309
|
-
|
|
2310
|
-
|
|
2351
|
+
_y = (_x = sheets).push;
|
|
2352
|
+
_z = {
|
|
2311
2353
|
name: sheet.name
|
|
2312
2354
|
};
|
|
2313
2355
|
return [4 /*yield*/, sheet.items()];
|
|
2314
2356
|
case 9:
|
|
2315
|
-
|
|
2316
|
-
|
|
2317
|
-
|
|
2318
|
-
|
|
2357
|
+
_y.apply(_x, [(_z.items = _1.sent(),
|
|
2358
|
+
_z.fields = sheet.fields,
|
|
2359
|
+
_z)]);
|
|
2360
|
+
_1.label = 10;
|
|
2319
2361
|
case 10:
|
|
2320
|
-
|
|
2362
|
+
_w = _v.next();
|
|
2321
2363
|
return [3 /*break*/, 7];
|
|
2322
2364
|
case 11: return [3 /*break*/, 14];
|
|
2323
2365
|
case 12:
|
|
2324
|
-
e_5_1 =
|
|
2366
|
+
e_5_1 = _1.sent();
|
|
2325
2367
|
e_5 = { error: e_5_1 };
|
|
2326
2368
|
return [3 /*break*/, 14];
|
|
2327
2369
|
case 13:
|
|
2328
2370
|
try {
|
|
2329
|
-
if (
|
|
2371
|
+
if (_w && !_w.done && (_0 = _v.return)) _0.call(_v);
|
|
2330
2372
|
}
|
|
2331
2373
|
finally { if (e_5) throw e_5.error; }
|
|
2332
2374
|
return [7 /*endfinally*/];
|
|
@@ -2337,7 +2379,7 @@
|
|
|
2337
2379
|
sheets: sheets
|
|
2338
2380
|
})];
|
|
2339
2381
|
case 15:
|
|
2340
|
-
|
|
2382
|
+
_1.sent();
|
|
2341
2383
|
return [2 /*return*/];
|
|
2342
2384
|
case 16: return [4 /*yield*/, this.exportService.exportByTemplate({
|
|
2343
2385
|
filePath: file.filePath,
|
|
@@ -2346,7 +2388,7 @@
|
|
|
2346
2388
|
items: items
|
|
2347
2389
|
})];
|
|
2348
2390
|
case 17:
|
|
2349
|
-
|
|
2391
|
+
_1.sent();
|
|
2350
2392
|
return [3 /*break*/, 19];
|
|
2351
2393
|
case 18:
|
|
2352
2394
|
this.isExporting = false;
|
|
@@ -2360,7 +2402,7 @@
|
|
|
2360
2402
|
this.onExport = function (args) { return __awaiter(_this, void 0, void 0, function () {
|
|
2361
2403
|
var translate;
|
|
2362
2404
|
var _this = this;
|
|
2363
|
-
return __generator(this, function (
|
|
2405
|
+
return __generator(this, function (_v) {
|
|
2364
2406
|
translate = this.translateService.translate;
|
|
2365
2407
|
if (!args.isCSV && this.gridOption.export.max && this.total > this.gridOption.export.max) {
|
|
2366
2408
|
this.notifyService.confirm(translate("Total rows reach limit, do you want to export CSV")).then(function () {
|
|
@@ -2378,8 +2420,8 @@
|
|
|
2378
2420
|
_this.reload(false);
|
|
2379
2421
|
};
|
|
2380
2422
|
this.onExpand = function (rowData) { return __awaiter(_this, void 0, void 0, function () {
|
|
2381
|
-
var
|
|
2382
|
-
return __generator(this, function (
|
|
2423
|
+
var _s, _t, _u, data;
|
|
2424
|
+
return __generator(this, function (_v) {
|
|
2383
2425
|
if (rowData.isExpanding) {
|
|
2384
2426
|
return [2 /*return*/];
|
|
2385
2427
|
}
|
|
@@ -2387,8 +2429,8 @@
|
|
|
2387
2429
|
rowData.isExpanded = false;
|
|
2388
2430
|
return [2 /*return*/];
|
|
2389
2431
|
}
|
|
2390
|
-
data = (
|
|
2391
|
-
if (!((
|
|
2432
|
+
data = (_t = (_s = this.gridOption) === null || _s === void 0 ? void 0 : _s.subInformation) === null || _t === void 0 ? void 0 : _t.onExpand(rowData);
|
|
2433
|
+
if (!((_u = this.gridOption.subInformation) === null || _u === void 0 ? void 0 : _u.multiple)) {
|
|
2392
2434
|
this.items.forEach(function (item) { return item.isExpanding = item.isExpanded = false; });
|
|
2393
2435
|
}
|
|
2394
2436
|
if (data instanceof Promise) {
|
|
@@ -2450,7 +2492,7 @@
|
|
|
2450
2492
|
};
|
|
2451
2493
|
this.onCreate = function () {
|
|
2452
2494
|
var _a, _b;
|
|
2453
|
-
var
|
|
2495
|
+
var _v = _this.gridOption, type = _v.type, editor = _v.editor, columns = _v.columns;
|
|
2454
2496
|
if (!(editor === null || editor === void 0 ? void 0 : editor.addable)) {
|
|
2455
2497
|
return;
|
|
2456
2498
|
}
|
|
@@ -2506,23 +2548,23 @@
|
|
|
2506
2548
|
};
|
|
2507
2549
|
this.onSave = function (item) { return __awaiter(_this, void 0, void 0, function () {
|
|
2508
2550
|
var editor, result, message, result, err_1;
|
|
2509
|
-
return __generator(this, function (
|
|
2510
|
-
switch (
|
|
2551
|
+
return __generator(this, function (_v) {
|
|
2552
|
+
switch (_v.label) {
|
|
2511
2553
|
case 0:
|
|
2512
2554
|
if (item.editorHandlerRow.saving) {
|
|
2513
2555
|
return [2 /*return*/];
|
|
2514
2556
|
}
|
|
2515
2557
|
editor = this.gridOption.editor;
|
|
2516
|
-
|
|
2558
|
+
_v.label = 1;
|
|
2517
2559
|
case 1:
|
|
2518
|
-
|
|
2560
|
+
_v.trys.push([1, 7, 8, 9]);
|
|
2519
2561
|
item.editorHandlerRow.saving = true;
|
|
2520
2562
|
if (!editor.validate) return [3 /*break*/, 4];
|
|
2521
2563
|
result = editor.validate(item, this.items.indexOf(item));
|
|
2522
2564
|
if (!(result instanceof Promise)) return [3 /*break*/, 3];
|
|
2523
2565
|
return [4 /*yield*/, result];
|
|
2524
2566
|
case 2:
|
|
2525
|
-
message =
|
|
2567
|
+
message = _v.sent();
|
|
2526
2568
|
if (message) {
|
|
2527
2569
|
throw message;
|
|
2528
2570
|
}
|
|
@@ -2531,15 +2573,15 @@
|
|
|
2531
2573
|
if (result) {
|
|
2532
2574
|
throw result;
|
|
2533
2575
|
}
|
|
2534
|
-
|
|
2576
|
+
_v.label = 4;
|
|
2535
2577
|
case 4:
|
|
2536
2578
|
if (!editor.onSave) return [3 /*break*/, 6];
|
|
2537
2579
|
result = editor.onSave(item);
|
|
2538
2580
|
if (!(result instanceof Promise)) return [3 /*break*/, 6];
|
|
2539
2581
|
return [4 /*yield*/, result];
|
|
2540
2582
|
case 5:
|
|
2541
|
-
|
|
2542
|
-
|
|
2583
|
+
_v.sent();
|
|
2584
|
+
_v.label = 6;
|
|
2543
2585
|
case 6:
|
|
2544
2586
|
if (item.editorStatus === 'create' && editor.type === 'popup') {
|
|
2545
2587
|
if (this.gridOption.type === 'local') {
|
|
@@ -2550,7 +2592,7 @@
|
|
|
2550
2592
|
item.editorStatus = undefined;
|
|
2551
2593
|
return [3 /*break*/, 9];
|
|
2552
2594
|
case 7:
|
|
2553
|
-
err_1 =
|
|
2595
|
+
err_1 = _v.sent();
|
|
2554
2596
|
this.notifyService.notify.warning(err_1);
|
|
2555
2597
|
return [3 /*break*/, 9];
|
|
2556
2598
|
case 8:
|
|
@@ -2742,6 +2784,13 @@
|
|
|
2742
2784
|
enumerable: false,
|
|
2743
2785
|
configurable: true
|
|
2744
2786
|
});
|
|
2787
|
+
Object.defineProperty(SdGridMaterial.prototype, "isEditing", {
|
|
2788
|
+
get: function () {
|
|
2789
|
+
return this.items.some(function (e) { return e.editorStatus !== undefined; });
|
|
2790
|
+
},
|
|
2791
|
+
enumerable: false,
|
|
2792
|
+
configurable: true
|
|
2793
|
+
});
|
|
2745
2794
|
return SdGridMaterial;
|
|
2746
2795
|
}());
|
|
2747
2796
|
_paginator = new WeakMap(), _sort = new WeakMap(), _subscription$1 = new WeakMap(), _optionChanges = new WeakMap(), _initCellDef = new WeakMap(), _initFilterDef = new WeakMap(), _initFooterDef = new WeakMap(), _filterExportInfo = new WeakMap(), _initConfiguration = new WeakMap(), _filterLocal = new WeakMap(), _getFilter = new WeakMap(), _load$1 = new WeakMap(), _render = new WeakMap(), _exportedItems = new WeakMap(), _allColumns = new WeakMap(), _allExportedColumns = new WeakMap(), _onExport = new WeakMap(), _updateSelectedItems = new WeakMap();
|
|
@@ -2766,7 +2815,7 @@
|
|
|
2766
2815
|
{ type: _export.SdExportService },
|
|
2767
2816
|
{ type: notify.SdNotifyService },
|
|
2768
2817
|
{ type: translate.SdTranslateService },
|
|
2769
|
-
{ type:
|
|
2818
|
+
{ type: SdColumnValuesPipe }
|
|
2770
2819
|
]; };
|
|
2771
2820
|
SdGridMaterial.propDecorators = {
|
|
2772
2821
|
quickAction: [{ type: core.ViewChild, args: [quickAction.SdQuickAction,] }],
|
|
@@ -2974,33 +3023,6 @@
|
|
|
2974
3023
|
},] }
|
|
2975
3024
|
];
|
|
2976
3025
|
|
|
2977
|
-
var SdColumnValuesPipe = /** @class */ (function () {
|
|
2978
|
-
function SdColumnValuesPipe(gridService) {
|
|
2979
|
-
var _this = this;
|
|
2980
|
-
this.gridService = gridService;
|
|
2981
|
-
this.transform = function (value, column, key) { return __awaiter(_this, void 0, void 0, function () {
|
|
2982
|
-
var _a, data;
|
|
2983
|
-
return __generator(this, function (_b) {
|
|
2984
|
-
switch (_b.label) {
|
|
2985
|
-
case 0: return [4 /*yield*/, this.gridService.loadValues(column, key)];
|
|
2986
|
-
case 1:
|
|
2987
|
-
data = _b.sent();
|
|
2988
|
-
return [2 /*return*/, (_a = data.obj[value]) !== null && _a !== void 0 ? _a : value];
|
|
2989
|
-
}
|
|
2990
|
-
});
|
|
2991
|
-
}); };
|
|
2992
|
-
}
|
|
2993
|
-
return SdColumnValuesPipe;
|
|
2994
|
-
}());
|
|
2995
|
-
SdColumnValuesPipe.decorators = [
|
|
2996
|
-
{ type: core.Pipe, args: [{
|
|
2997
|
-
name: 'columnValues'
|
|
2998
|
-
},] }
|
|
2999
|
-
];
|
|
3000
|
-
SdColumnValuesPipe.ctorParameters = function () { return [
|
|
3001
|
-
{ type: SdGridService }
|
|
3002
|
-
]; };
|
|
3003
|
-
|
|
3004
3026
|
var SdColumnHtmlTemplatePipe = /** @class */ (function () {
|
|
3005
3027
|
function SdColumnHtmlTemplatePipe(deviceService) {
|
|
3006
3028
|
this.isMobileOrTablet = false;
|
|
@@ -3046,30 +3068,27 @@
|
|
|
3046
3068
|
};
|
|
3047
3069
|
|
|
3048
3070
|
var SdColumnTransformPipe = /** @class */ (function () {
|
|
3049
|
-
function SdColumnTransformPipe(
|
|
3050
|
-
this.
|
|
3071
|
+
function SdColumnTransformPipe(columnValuesPipe) {
|
|
3072
|
+
this.columnValuesPipe = columnValuesPipe;
|
|
3051
3073
|
}
|
|
3052
3074
|
SdColumnTransformPipe.prototype.transform = function (value, rowData, column, key) {
|
|
3053
|
-
var _a, _b
|
|
3075
|
+
var _a, _b;
|
|
3054
3076
|
return __awaiter(this, void 0, void 0, function () {
|
|
3055
|
-
|
|
3056
|
-
|
|
3057
|
-
switch (_f.label) {
|
|
3077
|
+
return __generator(this, function (_c) {
|
|
3078
|
+
switch (_c.label) {
|
|
3058
3079
|
case 0:
|
|
3059
3080
|
if (column === null || column === void 0 ? void 0 : column.transform) {
|
|
3060
3081
|
return [2 /*return*/, column.transform(value, rowData)];
|
|
3061
3082
|
}
|
|
3062
3083
|
if (!(column.type === 'values')) return [3 /*break*/, 2];
|
|
3063
|
-
return [4 /*yield*/, this.
|
|
3064
|
-
case 1:
|
|
3065
|
-
data = _f.sent();
|
|
3066
|
-
return [2 /*return*/, (_c = (_a = data.obj[value]) === null || _a === void 0 ? void 0 : _a[(_b = column.option) === null || _b === void 0 ? void 0 : _b.displayField]) !== null && _c !== void 0 ? _c : value];
|
|
3084
|
+
return [4 /*yield*/, this.columnValuesPipe.transform(value, column)];
|
|
3085
|
+
case 1: return [2 /*return*/, _c.sent()];
|
|
3067
3086
|
case 2:
|
|
3068
3087
|
if (column.type === 'number' && Number.isNumber(value)) {
|
|
3069
3088
|
return [2 /*return*/, Number.toVNCurrency(value)]; // this.decimalPipe.transform(value, '1.0-2');
|
|
3070
3089
|
}
|
|
3071
3090
|
if (column.type === 'bool') {
|
|
3072
|
-
return [2 /*return*/, value === true ? (((
|
|
3091
|
+
return [2 /*return*/, value === true ? (((_a = column.option) === null || _a === void 0 ? void 0 : _a.displayOnTrue) || 'True') : (((_b = column.option) === null || _b === void 0 ? void 0 : _b.displayOnFalse) || 'False')];
|
|
3073
3092
|
}
|
|
3074
3093
|
return [2 /*return*/, value];
|
|
3075
3094
|
}
|
|
@@ -3084,7 +3103,7 @@
|
|
|
3084
3103
|
},] }
|
|
3085
3104
|
];
|
|
3086
3105
|
SdColumnTransformPipe.ctorParameters = function () { return [
|
|
3087
|
-
{ type:
|
|
3106
|
+
{ type: SdColumnValuesPipe }
|
|
3088
3107
|
]; };
|
|
3089
3108
|
|
|
3090
3109
|
var SdFilterExternalPipe = /** @class */ (function () {
|
|
@@ -3183,7 +3202,7 @@
|
|
|
3183
3202
|
SdDesktopCellChildrenView.decorators = [
|
|
3184
3203
|
{ type: core.Component, args: [{
|
|
3185
3204
|
selector: 'sd-desktop-cell-children-view',
|
|
3186
|
-
template: "<ng-container *ngIf=\"column.children?.length\">\r\n <div class=\"row mx-0\">\r\n <div *ngFor=\"let childColumn of column.children | columnChildrenFilter:item\" class=\"px-2\"\r\n [ngClass]=\"{'col-6': childColumn?.colSpan === 1, 'col-12': !childColumn?.colSpan || childColumn?.colSpan === 2}\">\r\n <span class=\"c-title\">\r\n {{item | columnTitle:childColumn | async}}:\r\n </span>\r\n <ng-container *ngIf=\"childColumn.htmlTemplate;else useDefaultView\">\r\n <div (click)=\"childColumn.click && childColumn.click(item[childColumn.field], item)\"\r\n style=\"display:inline-block ;overflow-wrap: break-word;\" [ngClass]=\"{'cursor-pointer':childColumn.click}\"\r\n [innerHTML]=\"(item[childColumn.field] | columnHtmlTemplate:item:childColumn) | safeHtml\">\r\n </div>\r\n </ng-container>\r\n <ng-template #useDefaultView>\r\n <span *ngIf=\"childColumn.type === 'string'\">\r\n <a *ngIf=\"childColumn.click\" href=\"javascript:;\"\r\n (click)=\"childColumn.click(item[childColumn.field], item)\">{{item[childColumn.field] |\r\n columnTransform:item:childColumn | async}}</a>\r\n <ng-container *ngIf=\"!childColumn.click\">\r\n {{item[childColumn.field] | columnTransform:item:childColumn | async}}</ng-container>\r\n </span>\r\n <span *ngIf=\"childColumn.type === 'number'\">\r\n <a *ngIf=\"childColumn.click\" href=\"javascript:;\"\r\n (click)=\"childColumn.click(item[childColumn.field], item)\">{{item[childColumn.field] |\r\n columnTransform:item:childColumn | async}}</a>\r\n <ng-container *ngIf=\"!childColumn.click\">\r\n {{item[childColumn.field] | columnTransform:item:childColumn | async}}\r\n </ng-container>\r\n </span>\r\n <span *ngIf=\"childColumn.type === 'datetime'\">\r\n <a *ngIf=\"childColumn.click\" href=\"javascript:;\"\r\n (click)=\"childColumn.click(item[childColumn.field], item)\">{{item[childColumn.field] |\r\n sdTimeDifferent:'dd/MM/yyyy HH:mm':childColumn.option?.timeDifferent | async}}</a>\r\n <ng-container *ngIf=\"!childColumn.click\">\r\n <span matTooltipPosition=\"above\"\r\n [matTooltip]=\"item[childColumn.field] | date:'dd/MM/yyyy HH:mm'\">{{item[childColumn.field] |\r\n sdTimeDifferent:'dd/MM/yyyy HH:mm':childColumn.option?.timeDifferent | async}}</span>\r\n </ng-container>\r\n </span>\r\n <span *ngIf=\"childColumn.type === 'date'\">\r\n <a *ngIf=\"childColumn.click\" href=\"javascript:;\"\r\n (click)=\"childColumn.click(item[childColumn.field], item)\">{{item[childColumn.field] |\r\n sdTimeDifferent:'dd/MM/yyyy':childColumn.option?.timeDifferent | async}}</a>\r\n <ng-container *ngIf=\"!childColumn.click\">\r\n <span matTooltipPosition=\"above\"\r\n [matTooltip]=\"item[childColumn.field] | date:'dd/MM/yyyy'\">{{item[childColumn.field] |\r\n sdTimeDifferent:'dd/MM/yyyy':childColumn.option?.timeDifferent | async}}</span>\r\n </ng-container>\r\n </span>\r\n <span *ngIf=\"childColumn.type === 'time'\">\r\n <a *ngIf=\"childColumn.click\" href=\"javascript:;\"\r\n (click)=\"childColumn.click(item[childColumn.field], item)\">{{item[childColumn.field] | date:'HH:mm'}}</a>\r\n <ng-container *ngIf=\"!childColumn.click\">\r\n {{item[childColumn.field] | date:'HH:mm'}}\r\n </ng-container>\r\n </span>\r\n <span *ngIf=\"childColumn.type === 'bool'\"\r\n (click)=\"childColumn.click && childColumn.click(item[childColumn.field], item)\">\r\n <strong *ngIf=\"item[childColumn.field]\" class=\"text-success\">{{childColumn.option?.displayOnTrue ||\r\n 'True'}}</strong>\r\n <strong *ngIf=\"!item[childColumn.field]\" class=\"text-danger\">{{childColumn.option?.displayOnFalse ||\r\n 'False'}}</strong>\r\n </span>\r\n <ng-container *ngIf=\"childColumn.type === 'values'\">\r\n <ng-container *ngIf=\"childColumn.transform\">{{item[childColumn.field] | columnTransform:item:childColumn | async}}</ng-container>\r\n <ng-container *ngIf=\"!childColumn.transform\">\r\n <ng-container *ngIf=\"item[childColumn.field] | columnValues:childColumn
|
|
3205
|
+
template: "<ng-container *ngIf=\"column.children?.length\">\r\n <div class=\"row mx-0\">\r\n <div *ngFor=\"let childColumn of column.children | columnChildrenFilter:item\" class=\"px-2\"\r\n [ngClass]=\"{'col-6': childColumn?.colSpan === 1, 'col-12': !childColumn?.colSpan || childColumn?.colSpan === 2}\">\r\n <span class=\"c-title\">\r\n {{item | columnTitle:childColumn | async}}:\r\n </span>\r\n <ng-container *ngIf=\"childColumn.htmlTemplate;else useDefaultView\">\r\n <div (click)=\"childColumn.click && childColumn.click(item[childColumn.field], item)\"\r\n style=\"display:inline-block ;overflow-wrap: break-word;\" [ngClass]=\"{'cursor-pointer':childColumn.click}\"\r\n [innerHTML]=\"(item[childColumn.field] | columnHtmlTemplate:item:childColumn) | safeHtml\">\r\n </div>\r\n </ng-container>\r\n <ng-template #useDefaultView>\r\n <span *ngIf=\"childColumn.type === 'string'\">\r\n <a *ngIf=\"childColumn.click\" href=\"javascript:;\"\r\n (click)=\"childColumn.click(item[childColumn.field], item)\">{{item[childColumn.field] |\r\n columnTransform:item:childColumn | async}}</a>\r\n <ng-container *ngIf=\"!childColumn.click\">\r\n {{item[childColumn.field] | columnTransform:item:childColumn | async}}</ng-container>\r\n </span>\r\n <span *ngIf=\"childColumn.type === 'number'\">\r\n <a *ngIf=\"childColumn.click\" href=\"javascript:;\"\r\n (click)=\"childColumn.click(item[childColumn.field], item)\">{{item[childColumn.field] |\r\n columnTransform:item:childColumn | async}}</a>\r\n <ng-container *ngIf=\"!childColumn.click\">\r\n {{item[childColumn.field] | columnTransform:item:childColumn | async}}\r\n </ng-container>\r\n </span>\r\n <span *ngIf=\"childColumn.type === 'datetime'\">\r\n <a *ngIf=\"childColumn.click\" href=\"javascript:;\"\r\n (click)=\"childColumn.click(item[childColumn.field], item)\">{{item[childColumn.field] |\r\n sdTimeDifferent:'dd/MM/yyyy HH:mm':childColumn.option?.timeDifferent | async}}</a>\r\n <ng-container *ngIf=\"!childColumn.click\">\r\n <span matTooltipPosition=\"above\"\r\n [matTooltip]=\"item[childColumn.field] | date:'dd/MM/yyyy HH:mm'\">{{item[childColumn.field] |\r\n sdTimeDifferent:'dd/MM/yyyy HH:mm':childColumn.option?.timeDifferent | async}}</span>\r\n </ng-container>\r\n </span>\r\n <span *ngIf=\"childColumn.type === 'date'\">\r\n <a *ngIf=\"childColumn.click\" href=\"javascript:;\"\r\n (click)=\"childColumn.click(item[childColumn.field], item)\">{{item[childColumn.field] |\r\n sdTimeDifferent:'dd/MM/yyyy':childColumn.option?.timeDifferent | async}}</a>\r\n <ng-container *ngIf=\"!childColumn.click\">\r\n <span matTooltipPosition=\"above\"\r\n [matTooltip]=\"item[childColumn.field] | date:'dd/MM/yyyy'\">{{item[childColumn.field] |\r\n sdTimeDifferent:'dd/MM/yyyy':childColumn.option?.timeDifferent | async}}</span>\r\n </ng-container>\r\n </span>\r\n <span *ngIf=\"childColumn.type === 'time'\">\r\n <a *ngIf=\"childColumn.click\" href=\"javascript:;\"\r\n (click)=\"childColumn.click(item[childColumn.field], item)\">{{item[childColumn.field] | date:'HH:mm'}}</a>\r\n <ng-container *ngIf=\"!childColumn.click\">\r\n {{item[childColumn.field] | date:'HH:mm'}}\r\n </ng-container>\r\n </span>\r\n <span *ngIf=\"childColumn.type === 'bool'\"\r\n (click)=\"childColumn.click && childColumn.click(item[childColumn.field], item)\">\r\n <strong *ngIf=\"item[childColumn.field]\" class=\"text-success\">{{childColumn.option?.displayOnTrue ||\r\n 'True'}}</strong>\r\n <strong *ngIf=\"!item[childColumn.field]\" class=\"text-danger\">{{childColumn.option?.displayOnFalse ||\r\n 'False'}}</strong>\r\n </span>\r\n <ng-container *ngIf=\"childColumn.type === 'values'\">\r\n <ng-container *ngIf=\"childColumn.transform\">{{item[childColumn.field] | columnTransform:item:childColumn | async}}</ng-container>\r\n <ng-container *ngIf=\"!childColumn.transform\">\r\n {{item[childColumn.field] | columnValues:childColumn | async}}\r\n <!-- <ng-container *ngIf=\"item[childColumn.field] | columnValues:childColumn | async; $implicit as valueData\">\r\n <div\r\n *ngIf=\"valueData[childColumn.option?.colorField] || valueData[childColumn.option?.backgroundColorField]; else elseNoStatus\"\r\n [ngStyle]=\"{'color':valueData[childColumn.option?.colorField], 'background-color': valueData[childColumn.option?.backgroundColorField]}\">\r\n {{valueData[childColumn.option?.displayField]}}\r\n </div>\r\n <ng-template #elseNoStatus>\r\n {{valueData[childColumn.option?.displayField]}}\r\n </ng-template>\r\n </ng-container> -->\r\n </ng-container>\r\n \r\n </ng-container>\r\n <img *ngIf=\"childColumn.type === 'image'\" [src]=\"item[childColumn.field] | columnTransform:item:childColumn | async\" [width]=\"childColumn.display?.width\"\r\n [height]=\"childColumn.display?.height\" style=\"margin: 5px 0\"\r\n (click)=\"childColumn.click && childColumn.click(item[childColumn.field], item)\">\r\n </ng-template>\r\n </div>\r\n </div>\r\n</ng-container>",
|
|
3187
3206
|
styles: [".c-title{color:#212529;font-size:13px;font-weight:700;line-height:1.7;margin-right:3px}.c-children{color:#212529;font-size:14px;overflow-wrap:break-word}"]
|
|
3188
3207
|
},] }
|
|
3189
3208
|
];
|
|
@@ -4273,9 +4292,9 @@
|
|
|
4273
4292
|
|
|
4274
4293
|
var _maxSecond, _maxMinute, _maxHour, _maxDay, _maxMonth, _isMobileOrTablet$1;
|
|
4275
4294
|
var SdCellViewPipe = /** @class */ (function () {
|
|
4276
|
-
function SdCellViewPipe(deviceService, utilityService,
|
|
4295
|
+
function SdCellViewPipe(deviceService, utilityService, columnValuesPipe) {
|
|
4277
4296
|
this.utilityService = utilityService;
|
|
4278
|
-
this.
|
|
4297
|
+
this.columnValuesPipe = columnValuesPipe;
|
|
4279
4298
|
_maxSecond.set(this, 60);
|
|
4280
4299
|
_maxMinute.set(this, __classPrivateFieldGet(this, _maxSecond) * 60);
|
|
4281
4300
|
_maxHour.set(this, __classPrivateFieldGet(this, _maxMinute) * 24);
|
|
@@ -4285,11 +4304,11 @@
|
|
|
4285
4304
|
__classPrivateFieldSet(this, _isMobileOrTablet$1, !deviceService.isDesktop());
|
|
4286
4305
|
}
|
|
4287
4306
|
SdCellViewPipe.prototype.transform = function (value, rowData, column, gridOption, key) {
|
|
4288
|
-
var _a
|
|
4307
|
+
var _a;
|
|
4289
4308
|
return __awaiter(this, void 0, void 0, function () {
|
|
4290
|
-
var displayOnEmpty, align, click, tooltip, htmlTemplate, transform, result, val,
|
|
4291
|
-
return __generator(this, function (
|
|
4292
|
-
switch (
|
|
4309
|
+
var displayOnEmpty, align, click, tooltip, htmlTemplate, transform, result, val, _b, option, seconds, _c, option;
|
|
4310
|
+
return __generator(this, function (_d) {
|
|
4311
|
+
switch (_d.label) {
|
|
4293
4312
|
case 0:
|
|
4294
4313
|
displayOnEmpty = gridOption.displayOnEmpty;
|
|
4295
4314
|
align = column.align, click = column.click, tooltip = column.tooltip, htmlTemplate = column.htmlTemplate, transform = column.transform;
|
|
@@ -4310,14 +4329,14 @@
|
|
|
4310
4329
|
if (!(typeof (transform) === 'function')) return [3 /*break*/, 5];
|
|
4311
4330
|
val = transform(value, rowData);
|
|
4312
4331
|
if (!(val instanceof Promise)) return [3 /*break*/, 3];
|
|
4313
|
-
|
|
4332
|
+
_b = result.display;
|
|
4314
4333
|
return [4 /*yield*/, val];
|
|
4315
4334
|
case 2:
|
|
4316
|
-
|
|
4335
|
+
_b.value = _d.sent();
|
|
4317
4336
|
return [3 /*break*/, 4];
|
|
4318
4337
|
case 3:
|
|
4319
4338
|
result.display.value = val;
|
|
4320
|
-
|
|
4339
|
+
_d.label = 4;
|
|
4321
4340
|
case 4: return [3 /*break*/, 9];
|
|
4322
4341
|
case 5:
|
|
4323
4342
|
if (column.type === 'date' || column.type === 'datetime') {
|
|
@@ -4355,22 +4374,22 @@
|
|
|
4355
4374
|
result.display.value = Date.toFormat(value, 'HH:mm');
|
|
4356
4375
|
}
|
|
4357
4376
|
if (!(column.type === 'values')) return [3 /*break*/, 7];
|
|
4358
|
-
|
|
4377
|
+
_c = result.display;
|
|
4378
|
+
return [4 /*yield*/, this.columnValuesPipe.transform(value, column)];
|
|
4359
4379
|
case 6:
|
|
4360
|
-
|
|
4361
|
-
result.display.value = (_c = (_a = data.obj[value]) === null || _a === void 0 ? void 0 : _a[(_b = column.option) === null || _b === void 0 ? void 0 : _b.displayField]) !== null && _c !== void 0 ? _c : value;
|
|
4380
|
+
_c.value = _d.sent();
|
|
4362
4381
|
return [3 /*break*/, 8];
|
|
4363
4382
|
case 7:
|
|
4364
4383
|
if (column.type === 'number' && Number.isNumber(value)) {
|
|
4365
4384
|
result.display.value = Number.toVNCurrency(value);
|
|
4366
4385
|
}
|
|
4367
|
-
|
|
4386
|
+
_d.label = 8;
|
|
4368
4387
|
case 8:
|
|
4369
4388
|
if (column.type === 'bool') {
|
|
4370
4389
|
option = column.option;
|
|
4371
4390
|
result.display.value = value === true ? ((option === null || option === void 0 ? void 0 : option.displayOnTrue) || 'True') : ((option === null || option === void 0 ? void 0 : option.displayOnFalse) || 'False');
|
|
4372
4391
|
}
|
|
4373
|
-
|
|
4392
|
+
_d.label = 9;
|
|
4374
4393
|
case 9:
|
|
4375
4394
|
if (displayOnEmpty && (result.display.value === null || result.display.value === undefined || result.display.value === '')) {
|
|
4376
4395
|
if (typeof (displayOnEmpty) === 'function') {
|
|
@@ -4382,14 +4401,14 @@
|
|
|
4382
4401
|
result.display.html = "<div class=\"T16R text-black400\">--</div>";
|
|
4383
4402
|
}
|
|
4384
4403
|
}
|
|
4385
|
-
|
|
4404
|
+
_d.label = 10;
|
|
4386
4405
|
case 10:
|
|
4387
4406
|
// Badge
|
|
4388
4407
|
if ((column.type === 'string' || column.type === 'number' || column.type === 'values') && column.badge) {
|
|
4389
4408
|
result.badge = {
|
|
4390
4409
|
type: !(column === null || column === void 0 ? void 0 : column.badgeType) ? 'round' : column.badgeType,
|
|
4391
4410
|
color: column.badge(value, rowData),
|
|
4392
|
-
icon: (
|
|
4411
|
+
icon: (_a = column === null || column === void 0 ? void 0 : column.badgeIcon) === null || _a === void 0 ? void 0 : _a.call(column, value, rowData)
|
|
4393
4412
|
};
|
|
4394
4413
|
}
|
|
4395
4414
|
else if (column.type === 'bool') {
|
|
@@ -4423,7 +4442,7 @@
|
|
|
4423
4442
|
SdCellViewPipe.ctorParameters = function () { return [
|
|
4424
4443
|
{ type: ngxDeviceDetector.DeviceDetectorService },
|
|
4425
4444
|
{ type: utility.SdUtilityService },
|
|
4426
|
-
{ type:
|
|
4445
|
+
{ type: SdColumnValuesPipe }
|
|
4427
4446
|
]; };
|
|
4428
4447
|
|
|
4429
4448
|
var MatPaginatorIntlCro = /** @class */ (function (_super) {
|
|
@@ -4544,10 +4563,10 @@
|
|
|
4544
4563
|
common.DecimalPipe,
|
|
4545
4564
|
SdIdPipe,
|
|
4546
4565
|
table$1.CdkColumnDef,
|
|
4547
|
-
SdGridService,
|
|
4548
4566
|
SdGridFilterService,
|
|
4549
4567
|
SdGridConfigurationService,
|
|
4550
4568
|
SdGeneratedColumnService,
|
|
4569
|
+
SdColumnValuesPipe,
|
|
4551
4570
|
{
|
|
4552
4571
|
provide: paginator.MatPaginatorIntl, useClass: MatPaginatorIntlCro
|
|
4553
4572
|
}
|
|
@@ -4569,29 +4588,28 @@
|
|
|
4569
4588
|
exports.ɵa = MatPaginatorIntlCro;
|
|
4570
4589
|
exports.ɵb = SdGridFilter;
|
|
4571
4590
|
exports.ɵba = SdCommandTitlePipe;
|
|
4572
|
-
exports.ɵbb =
|
|
4573
|
-
exports.ɵbc =
|
|
4574
|
-
exports.ɵbd =
|
|
4575
|
-
exports.ɵbe =
|
|
4576
|
-
exports.ɵbf =
|
|
4577
|
-
exports.ɵbg =
|
|
4578
|
-
exports.ɵbh =
|
|
4579
|
-
exports.ɵbi =
|
|
4580
|
-
exports.ɵbj =
|
|
4581
|
-
exports.ɵbk =
|
|
4582
|
-
exports.ɵbl =
|
|
4583
|
-
exports.ɵbm =
|
|
4584
|
-
exports.ɵbn =
|
|
4585
|
-
exports.ɵbo =
|
|
4586
|
-
exports.ɵbp =
|
|
4587
|
-
exports.ɵbq =
|
|
4588
|
-
exports.ɵbr = SdCellViewPipe;
|
|
4591
|
+
exports.ɵbb = SdColumnHtmlTemplatePipe;
|
|
4592
|
+
exports.ɵbc = SdColumnTransformPipe;
|
|
4593
|
+
exports.ɵbd = SdColumnTooltipPipe;
|
|
4594
|
+
exports.ɵbe = SdColumnBadgePipe;
|
|
4595
|
+
exports.ɵbf = SdFilterColumnPipe;
|
|
4596
|
+
exports.ɵbg = SdFilterExternalPipe;
|
|
4597
|
+
exports.ɵbh = SdSelectionActionFilterPipe;
|
|
4598
|
+
exports.ɵbi = SdSelectionVisiblePipe;
|
|
4599
|
+
exports.ɵbj = SdSelectionDisablePipe;
|
|
4600
|
+
exports.ɵbk = SdSelectionVisibleSelectAllPipe;
|
|
4601
|
+
exports.ɵbl = SdEditorHandlerRowPipe;
|
|
4602
|
+
exports.ɵbm = SdEditorHandlerColumnPipe;
|
|
4603
|
+
exports.ɵbn = SdEditorValidatePipe;
|
|
4604
|
+
exports.ɵbo = SdIdPipe;
|
|
4605
|
+
exports.ɵbp = SdStyleRowCss;
|
|
4606
|
+
exports.ɵbq = SdCellViewPipe;
|
|
4589
4607
|
exports.ɵc = SdPopupFilter;
|
|
4590
4608
|
exports.ɵd = SdGridFilterService;
|
|
4591
4609
|
exports.ɵe = SdPopupExport;
|
|
4592
4610
|
exports.ɵg = GRID_MATERIAL_CONFIG;
|
|
4593
4611
|
exports.ɵh = SdGridConfigurationService;
|
|
4594
|
-
exports.ɵi =
|
|
4612
|
+
exports.ɵi = SdColumnValuesPipe;
|
|
4595
4613
|
exports.ɵj = SdGridQuickAction;
|
|
4596
4614
|
exports.ɵk = SdDesktopCell;
|
|
4597
4615
|
exports.ɵl = SdDesktopCellEditor;
|