@sd-angular/core 1.3.103 → 1.3.104
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundles/sd-angular-core-grid-material.umd.js +400 -198
- 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/esm2015/grid-material/src/lib/grid-material.component.js +217 -170
- package/esm2015/grid-material/src/lib/services/grid-filter/grid-filter.service.js +140 -56
- package/fesm2015/sd-angular-core-grid-material.js +328 -198
- 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/grid-material.component.d.ts +25 -25
- package/grid-material/src/lib/services/grid-filter/grid-filter.service.d.ts +4 -4
- package/package.json +1 -1
- package/{sd-angular-core-1.3.103.tgz → sd-angular-core-1.3.104.tgz} +0 -0
|
@@ -1639,8 +1639,8 @@
|
|
|
1639
1639
|
function SdGridFilterService(settingService) {
|
|
1640
1640
|
var _this = this;
|
|
1641
1641
|
this.settingService = settingService;
|
|
1642
|
-
_filterConfiguration.set(this,
|
|
1643
|
-
_filterValue.set(this,
|
|
1642
|
+
_filterConfiguration.set(this, "GRID-FILTER-CONFIGURATION");
|
|
1643
|
+
_filterValue.set(this, "GRID-FILTER-VALUE");
|
|
1644
1644
|
_cache$2.set(this, {});
|
|
1645
1645
|
this.register = function (key, args) {
|
|
1646
1646
|
var cacheSession = false;
|
|
@@ -1648,37 +1648,168 @@
|
|
|
1648
1648
|
var columns = args.columns, externalFilters = args.externalFilters;
|
|
1649
1649
|
key = hash__default['default']({
|
|
1650
1650
|
columns: columns,
|
|
1651
|
-
externalFilters: externalFilters
|
|
1651
|
+
externalFilters: externalFilters,
|
|
1652
1652
|
});
|
|
1653
1653
|
cacheSession = true; // Nếu không có key thì chỉ lưu theo session
|
|
1654
1654
|
}
|
|
1655
1655
|
if (!__classPrivateFieldGet(_this, _cache$2)[key]) {
|
|
1656
|
+
var t1 = _this.settingService.create({
|
|
1657
|
+
prefix: __classPrivateFieldGet(_this, _filterConfiguration),
|
|
1658
|
+
key: key,
|
|
1659
|
+
}, {
|
|
1660
|
+
type: cacheSession ? "session" : undefined,
|
|
1661
|
+
});
|
|
1662
|
+
var defaultConfiguration = __classPrivateFieldGet(_this, _loadDefaultConfiguration).call(_this, args, t1.get());
|
|
1663
|
+
var t2 = _this.settingService.create({
|
|
1664
|
+
prefix: __classPrivateFieldGet(_this, _filterValue),
|
|
1665
|
+
key: key,
|
|
1666
|
+
}, {
|
|
1667
|
+
type: cacheSession ? "session" : undefined,
|
|
1668
|
+
});
|
|
1669
|
+
var defaultValue = __classPrivateFieldGet(_this, _loadDefaultValue).call(_this, args, t2.get());
|
|
1656
1670
|
var filterConfiguration_1 = _this.settingService.create({
|
|
1657
1671
|
prefix: __classPrivateFieldGet(_this, _filterConfiguration),
|
|
1658
|
-
key: key
|
|
1672
|
+
key: key,
|
|
1659
1673
|
}, {
|
|
1660
|
-
default:
|
|
1661
|
-
type: cacheSession ?
|
|
1674
|
+
default: defaultConfiguration,
|
|
1675
|
+
type: cacheSession ? "session" : undefined,
|
|
1662
1676
|
});
|
|
1663
1677
|
var filterValue_1 = _this.settingService.create({
|
|
1664
1678
|
prefix: __classPrivateFieldGet(_this, _filterValue),
|
|
1665
|
-
key: key
|
|
1679
|
+
key: key,
|
|
1666
1680
|
}, {
|
|
1667
|
-
default:
|
|
1668
|
-
type: cacheSession ?
|
|
1681
|
+
default: defaultValue,
|
|
1682
|
+
type: cacheSession ? "session" : undefined,
|
|
1669
1683
|
});
|
|
1684
|
+
var configurationGet_1 = function (configuration) {
|
|
1685
|
+
var e_1, _r, e_2, _s, e_3, _t;
|
|
1686
|
+
var _a, _b, _c;
|
|
1687
|
+
var columns = args.columns, externalFilters = args.externalFilters, filterDefs = args.filterDefs;
|
|
1688
|
+
var inlineColumn = {};
|
|
1689
|
+
var inlineExternal = {};
|
|
1690
|
+
var inlineFilterDef = {};
|
|
1691
|
+
try {
|
|
1692
|
+
// Filter column
|
|
1693
|
+
for (var _u = __values(columns || []), _v = _u.next(); !_v.done; _v = _u.next()) {
|
|
1694
|
+
var item = _v.value;
|
|
1695
|
+
inlineColumn[item.field] = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.inlineColumn) === null || _a === void 0 ? void 0 : _a[item.field];
|
|
1696
|
+
}
|
|
1697
|
+
}
|
|
1698
|
+
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
1699
|
+
finally {
|
|
1700
|
+
try {
|
|
1701
|
+
if (_v && !_v.done && (_r = _u.return)) _r.call(_u);
|
|
1702
|
+
}
|
|
1703
|
+
finally { if (e_1) throw e_1.error; }
|
|
1704
|
+
}
|
|
1705
|
+
try {
|
|
1706
|
+
// Filter external
|
|
1707
|
+
for (var _w = __values(externalFilters || []), _x = _w.next(); !_x.done; _x = _w.next()) {
|
|
1708
|
+
var item = _x.value;
|
|
1709
|
+
inlineExternal[item.field] = (_b = configuration === null || configuration === void 0 ? void 0 : configuration.inlineExternal) === null || _b === void 0 ? void 0 : _b[item.field];
|
|
1710
|
+
}
|
|
1711
|
+
}
|
|
1712
|
+
catch (e_2_1) { e_2 = { error: e_2_1 }; }
|
|
1713
|
+
finally {
|
|
1714
|
+
try {
|
|
1715
|
+
if (_x && !_x.done && (_s = _w.return)) _s.call(_w);
|
|
1716
|
+
}
|
|
1717
|
+
finally { if (e_2) throw e_2.error; }
|
|
1718
|
+
}
|
|
1719
|
+
try {
|
|
1720
|
+
// Filter def
|
|
1721
|
+
for (var _y = __values(filterDefs || []), _z = _y.next(); !_z.done; _z = _y.next()) {
|
|
1722
|
+
var item = _z.value;
|
|
1723
|
+
inlineFilterDef[item.sdMaterialFilterDef] = (_c = configuration === null || configuration === void 0 ? void 0 : configuration.inlineFilterDef) === null || _c === void 0 ? void 0 : _c[item.sdMaterialFilterDef];
|
|
1724
|
+
}
|
|
1725
|
+
}
|
|
1726
|
+
catch (e_3_1) { e_3 = { error: e_3_1 }; }
|
|
1727
|
+
finally {
|
|
1728
|
+
try {
|
|
1729
|
+
if (_z && !_z.done && (_t = _y.return)) _t.call(_y);
|
|
1730
|
+
}
|
|
1731
|
+
finally { if (e_3) throw e_3.error; }
|
|
1732
|
+
}
|
|
1733
|
+
return {
|
|
1734
|
+
// Filter column
|
|
1735
|
+
inlineColumn: inlineColumn,
|
|
1736
|
+
// Filter external
|
|
1737
|
+
inlineExternal: inlineExternal,
|
|
1738
|
+
// Filter def
|
|
1739
|
+
inlineFilterDef: inlineFilterDef,
|
|
1740
|
+
};
|
|
1741
|
+
};
|
|
1742
|
+
var valueGet_1 = function (value) {
|
|
1743
|
+
var e_4, _r, e_5, _s, e_6, _t;
|
|
1744
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
1745
|
+
var columnFilter = {};
|
|
1746
|
+
var externalFilter = {};
|
|
1747
|
+
var filterDef = {};
|
|
1748
|
+
var columns = args.columns, externalFilters = args.externalFilters, filterDefs = args.filterDefs;
|
|
1749
|
+
try {
|
|
1750
|
+
// Filter column
|
|
1751
|
+
for (var _u = __values(columns || []), _v = _u.next(); !_v.done; _v = _u.next()) {
|
|
1752
|
+
var item = _v.value;
|
|
1753
|
+
columnFilter[item.field] = (_a = value === null || value === void 0 ? void 0 : value.columnFilter) === null || _a === void 0 ? void 0 : _a[item.field];
|
|
1754
|
+
}
|
|
1755
|
+
}
|
|
1756
|
+
catch (e_4_1) { e_4 = { error: e_4_1 }; }
|
|
1757
|
+
finally {
|
|
1758
|
+
try {
|
|
1759
|
+
if (_v && !_v.done && (_r = _u.return)) _r.call(_u);
|
|
1760
|
+
}
|
|
1761
|
+
finally { if (e_4) throw e_4.error; }
|
|
1762
|
+
}
|
|
1763
|
+
try {
|
|
1764
|
+
// Filter external
|
|
1765
|
+
for (var _w = __values(externalFilters || []), _x = _w.next(); !_x.done; _x = _w.next()) {
|
|
1766
|
+
var item = _x.value;
|
|
1767
|
+
if (item.type === "daterange") {
|
|
1768
|
+
externalFilter[item.field] = {
|
|
1769
|
+
from: (_c = (_b = value === null || value === void 0 ? void 0 : value.externalFilter) === null || _b === void 0 ? void 0 : _b[item.field]) === null || _c === void 0 ? void 0 : _c.from,
|
|
1770
|
+
to: (_e = (_d = value === null || value === void 0 ? void 0 : value.externalFilter) === null || _d === void 0 ? void 0 : _d[item.field]) === null || _e === void 0 ? void 0 : _e.to,
|
|
1771
|
+
};
|
|
1772
|
+
}
|
|
1773
|
+
else {
|
|
1774
|
+
externalFilter[item.field] = (_f = value === null || value === void 0 ? void 0 : value.externalFilter) === null || _f === void 0 ? void 0 : _f[item.field];
|
|
1775
|
+
}
|
|
1776
|
+
}
|
|
1777
|
+
}
|
|
1778
|
+
catch (e_5_1) { e_5 = { error: e_5_1 }; }
|
|
1779
|
+
finally {
|
|
1780
|
+
try {
|
|
1781
|
+
if (_x && !_x.done && (_s = _w.return)) _s.call(_w);
|
|
1782
|
+
}
|
|
1783
|
+
finally { if (e_5) throw e_5.error; }
|
|
1784
|
+
}
|
|
1785
|
+
try {
|
|
1786
|
+
// Filter def
|
|
1787
|
+
for (var _y = __values(filterDefs || []), _z = _y.next(); !_z.done; _z = _y.next()) {
|
|
1788
|
+
var item = _z.value;
|
|
1789
|
+
filterDef[item.sdMaterialFilterDef] = (_g = value === null || value === void 0 ? void 0 : value.filterDef) === null || _g === void 0 ? void 0 : _g[item.sdMaterialFilterDef];
|
|
1790
|
+
}
|
|
1791
|
+
}
|
|
1792
|
+
catch (e_6_1) { e_6 = { error: e_6_1 }; }
|
|
1793
|
+
finally {
|
|
1794
|
+
try {
|
|
1795
|
+
if (_z && !_z.done && (_t = _y.return)) _t.call(_y);
|
|
1796
|
+
}
|
|
1797
|
+
finally { if (e_6) throw e_6.error; }
|
|
1798
|
+
}
|
|
1799
|
+
return {
|
|
1800
|
+
// Filter column
|
|
1801
|
+
columnFilter: columnFilter,
|
|
1802
|
+
// Filter external
|
|
1803
|
+
externalFilter: externalFilter,
|
|
1804
|
+
// Filter def
|
|
1805
|
+
filterDef: filterDef,
|
|
1806
|
+
};
|
|
1807
|
+
};
|
|
1670
1808
|
__classPrivateFieldGet(_this, _cache$2)[key] = {
|
|
1671
1809
|
configuration: {
|
|
1672
1810
|
get: function () {
|
|
1673
1811
|
var configuration = filterConfiguration_1.get();
|
|
1674
|
-
return
|
|
1675
|
-
// Filter column
|
|
1676
|
-
inlineColumn: (configuration === null || configuration === void 0 ? void 0 : configuration.inlineColumn) || {},
|
|
1677
|
-
// Filter external
|
|
1678
|
-
inlineExternal: (configuration === null || configuration === void 0 ? void 0 : configuration.inlineExternal) || {},
|
|
1679
|
-
// Filter def
|
|
1680
|
-
inlineFilterDef: (configuration === null || configuration === void 0 ? void 0 : configuration.inlineFilterDef) || {},
|
|
1681
|
-
};
|
|
1812
|
+
return configurationGet_1(configuration);
|
|
1682
1813
|
},
|
|
1683
1814
|
set: function (configuration) {
|
|
1684
1815
|
var keys = Object.keys(configuration || {});
|
|
@@ -1686,11 +1817,17 @@
|
|
|
1686
1817
|
var inlineColumn = current.inlineColumn, inlineExternal = current.inlineExternal, inlineFilterDef = current.inlineFilterDef;
|
|
1687
1818
|
var updatedConfiguration = {
|
|
1688
1819
|
// Filter column
|
|
1689
|
-
inlineColumn: keys.includes(
|
|
1820
|
+
inlineColumn: keys.includes("inlineColumn")
|
|
1821
|
+
? (configuration === null || configuration === void 0 ? void 0 : configuration.inlineColumn) || {}
|
|
1822
|
+
: inlineColumn,
|
|
1690
1823
|
// Filter external
|
|
1691
|
-
inlineExternal: keys.includes(
|
|
1824
|
+
inlineExternal: keys.includes("inlineExternal")
|
|
1825
|
+
? (configuration === null || configuration === void 0 ? void 0 : configuration.inlineExternal) || {}
|
|
1826
|
+
: inlineExternal,
|
|
1692
1827
|
// Filter def
|
|
1693
|
-
inlineFilterDef: keys.includes(
|
|
1828
|
+
inlineFilterDef: keys.includes("inlineFilterDef")
|
|
1829
|
+
? (configuration === null || configuration === void 0 ? void 0 : configuration.inlineFilterDef) || {}
|
|
1830
|
+
: inlineFilterDef,
|
|
1694
1831
|
};
|
|
1695
1832
|
filterConfiguration_1.set(updatedConfiguration);
|
|
1696
1833
|
return updatedConfiguration;
|
|
@@ -1698,19 +1835,12 @@
|
|
|
1698
1835
|
remove: function () {
|
|
1699
1836
|
filterConfiguration_1.remove();
|
|
1700
1837
|
},
|
|
1701
|
-
observer: filterConfiguration_1.observer
|
|
1838
|
+
observer: filterConfiguration_1.observer.pipe(operators.map(configurationGet_1)),
|
|
1702
1839
|
},
|
|
1703
1840
|
value: {
|
|
1704
1841
|
get: function () {
|
|
1705
1842
|
var configuration = filterValue_1.get();
|
|
1706
|
-
return
|
|
1707
|
-
// Filter column
|
|
1708
|
-
columnFilter: (configuration === null || configuration === void 0 ? void 0 : configuration.columnFilter) || {},
|
|
1709
|
-
// Filter external
|
|
1710
|
-
externalFilter: (configuration === null || configuration === void 0 ? void 0 : configuration.externalFilter) || {},
|
|
1711
|
-
// Filter def
|
|
1712
|
-
filterDef: (configuration === null || configuration === void 0 ? void 0 : configuration.filterDef) || {}
|
|
1713
|
-
};
|
|
1843
|
+
return valueGet_1(configuration);
|
|
1714
1844
|
},
|
|
1715
1845
|
set: function (configuration) {
|
|
1716
1846
|
var keys = Object.keys(configuration || {});
|
|
@@ -1718,11 +1848,17 @@
|
|
|
1718
1848
|
var columnFilter = current.columnFilter, externalFilter = current.externalFilter, filterDef = current.filterDef;
|
|
1719
1849
|
var updatedConfiguration = {
|
|
1720
1850
|
// Filter column
|
|
1721
|
-
columnFilter: keys.includes(
|
|
1851
|
+
columnFilter: keys.includes("columnFilter")
|
|
1852
|
+
? (configuration === null || configuration === void 0 ? void 0 : configuration.columnFilter) || {}
|
|
1853
|
+
: columnFilter,
|
|
1722
1854
|
// Filter external
|
|
1723
|
-
externalFilter: keys.includes(
|
|
1855
|
+
externalFilter: keys.includes("externalFilter")
|
|
1856
|
+
? (configuration === null || configuration === void 0 ? void 0 : configuration.externalFilter) || {}
|
|
1857
|
+
: externalFilter,
|
|
1724
1858
|
// Filter def
|
|
1725
|
-
filterDef: keys.includes(
|
|
1859
|
+
filterDef: keys.includes("filterDef")
|
|
1860
|
+
? (configuration === null || configuration === void 0 ? void 0 : configuration.filterDef) || {}
|
|
1861
|
+
: filterDef,
|
|
1726
1862
|
};
|
|
1727
1863
|
filterValue_1.set(updatedConfiguration);
|
|
1728
1864
|
return updatedConfiguration;
|
|
@@ -1730,114 +1866,133 @@
|
|
|
1730
1866
|
remove: function () {
|
|
1731
1867
|
filterValue_1.remove();
|
|
1732
1868
|
},
|
|
1733
|
-
observer: filterValue_1.observer
|
|
1734
|
-
}
|
|
1869
|
+
observer: filterValue_1.observer.pipe(operators.map(valueGet_1)),
|
|
1870
|
+
},
|
|
1735
1871
|
};
|
|
1736
1872
|
}
|
|
1737
1873
|
return __classPrivateFieldGet(_this, _cache$2)[key];
|
|
1738
1874
|
};
|
|
1739
|
-
_loadDefaultConfiguration.set(this, function (args) {
|
|
1740
|
-
var
|
|
1741
|
-
var _a, _b, _c, _d;
|
|
1875
|
+
_loadDefaultConfiguration.set(this, function (args, configuration) {
|
|
1876
|
+
var e_7, _r, e_8, _s, e_9, _t;
|
|
1877
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
1742
1878
|
var columns = args.columns, externalFilters = args.externalFilters, filterDefs = args.filterDefs;
|
|
1743
1879
|
var inlineColumn = {};
|
|
1744
1880
|
var inlineExternal = {};
|
|
1745
1881
|
var inlineFilterDef = {};
|
|
1746
1882
|
try {
|
|
1747
1883
|
// Filter column
|
|
1748
|
-
for (var
|
|
1749
|
-
var item =
|
|
1750
|
-
inlineColumn[item.field] = (_a = inlineColumn[item.field]) !== null &&
|
|
1884
|
+
for (var _u = __values(columns || []), _v = _u.next(); !_v.done; _v = _u.next()) {
|
|
1885
|
+
var item = _v.value;
|
|
1886
|
+
inlineColumn[item.field] = (_b = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.inlineColumn) === null || _a === void 0 ? void 0 : _a[item.field]) !== null && _b !== void 0 ? _b : (_c = item === null || item === void 0 ? void 0 : item.filter) === null || _c === void 0 ? void 0 : _c.defaultShowing;
|
|
1751
1887
|
}
|
|
1752
1888
|
}
|
|
1753
|
-
catch (
|
|
1889
|
+
catch (e_7_1) { e_7 = { error: e_7_1 }; }
|
|
1754
1890
|
finally {
|
|
1755
1891
|
try {
|
|
1756
|
-
if (
|
|
1892
|
+
if (_v && !_v.done && (_r = _u.return)) _r.call(_u);
|
|
1757
1893
|
}
|
|
1758
|
-
finally { if (
|
|
1894
|
+
finally { if (e_7) throw e_7.error; }
|
|
1759
1895
|
}
|
|
1760
1896
|
try {
|
|
1761
1897
|
// Filter external
|
|
1762
|
-
for (var
|
|
1763
|
-
var item =
|
|
1764
|
-
inlineExternal[item.field] = (
|
|
1898
|
+
for (var _w = __values(externalFilters || []), _x = _w.next(); !_x.done; _x = _w.next()) {
|
|
1899
|
+
var item = _x.value;
|
|
1900
|
+
inlineExternal[item.field] = (_e = (_d = configuration === null || configuration === void 0 ? void 0 : configuration.inlineExternal) === null || _d === void 0 ? void 0 : _d[item.field]) !== null && _e !== void 0 ? _e : item === null || item === void 0 ? void 0 : item.defaultShowing;
|
|
1765
1901
|
}
|
|
1766
1902
|
}
|
|
1767
|
-
catch (
|
|
1903
|
+
catch (e_8_1) { e_8 = { error: e_8_1 }; }
|
|
1768
1904
|
finally {
|
|
1769
1905
|
try {
|
|
1770
|
-
if (
|
|
1906
|
+
if (_x && !_x.done && (_s = _w.return)) _s.call(_w);
|
|
1771
1907
|
}
|
|
1772
|
-
finally { if (
|
|
1908
|
+
finally { if (e_8) throw e_8.error; }
|
|
1773
1909
|
}
|
|
1774
1910
|
try {
|
|
1775
1911
|
// Filter def
|
|
1776
|
-
for (var
|
|
1777
|
-
var item =
|
|
1778
|
-
inlineFilterDef[item.sdMaterialFilterDef] = (
|
|
1912
|
+
for (var _y = __values(filterDefs || []), _z = _y.next(); !_z.done; _z = _y.next()) {
|
|
1913
|
+
var item = _z.value;
|
|
1914
|
+
inlineFilterDef[item.sdMaterialFilterDef] = (_g = (_f = configuration === null || configuration === void 0 ? void 0 : configuration.inlineFilterDef) === null || _f === void 0 ? void 0 : _f[item.sdMaterialFilterDef]) !== null && _g !== void 0 ? _g : item === null || item === void 0 ? void 0 : item.defaultShowing;
|
|
1779
1915
|
}
|
|
1780
1916
|
}
|
|
1781
|
-
catch (
|
|
1917
|
+
catch (e_9_1) { e_9 = { error: e_9_1 }; }
|
|
1782
1918
|
finally {
|
|
1783
1919
|
try {
|
|
1784
|
-
if (
|
|
1920
|
+
if (_z && !_z.done && (_t = _y.return)) _t.call(_y);
|
|
1785
1921
|
}
|
|
1786
|
-
finally { if (
|
|
1922
|
+
finally { if (e_9) throw e_9.error; }
|
|
1787
1923
|
}
|
|
1788
1924
|
return {
|
|
1925
|
+
// Filter column
|
|
1789
1926
|
inlineColumn: inlineColumn,
|
|
1927
|
+
// Filter external
|
|
1790
1928
|
inlineExternal: inlineExternal,
|
|
1929
|
+
// Filter def
|
|
1791
1930
|
inlineFilterDef: inlineFilterDef,
|
|
1792
1931
|
};
|
|
1793
1932
|
});
|
|
1794
|
-
_loadDefaultValue.set(this, function (args) {
|
|
1795
|
-
var
|
|
1796
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
1797
|
-
var columns = args.columns, externalFilters = args.externalFilters, filterDefs = args.filterDefs;
|
|
1933
|
+
_loadDefaultValue.set(this, function (args, value) {
|
|
1934
|
+
var e_10, _r, e_11, _s, e_12, _t;
|
|
1935
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
|
|
1798
1936
|
var columnFilter = {};
|
|
1799
1937
|
var externalFilter = {};
|
|
1800
1938
|
var filterDef = {};
|
|
1939
|
+
var columns = args.columns, externalFilters = args.externalFilters, filterDefs = args.filterDefs;
|
|
1801
1940
|
try {
|
|
1802
1941
|
// Filter column
|
|
1803
|
-
for (var
|
|
1804
|
-
var item =
|
|
1805
|
-
columnFilter[item.field] = (_a = columnFilter[item.field]) !== null &&
|
|
1942
|
+
for (var _u = __values(columns || []), _v = _u.next(); !_v.done; _v = _u.next()) {
|
|
1943
|
+
var item = _v.value;
|
|
1944
|
+
columnFilter[item.field] = (_b = (_a = value === null || value === void 0 ? void 0 : value.columnFilter) === null || _a === void 0 ? void 0 : _a[item.field]) !== null && _b !== void 0 ? _b : (_c = item === null || item === void 0 ? void 0 : item.filter) === null || _c === void 0 ? void 0 : _c.default;
|
|
1806
1945
|
}
|
|
1807
1946
|
}
|
|
1808
|
-
catch (
|
|
1947
|
+
catch (e_10_1) { e_10 = { error: e_10_1 }; }
|
|
1809
1948
|
finally {
|
|
1810
1949
|
try {
|
|
1811
|
-
if (
|
|
1950
|
+
if (_v && !_v.done && (_r = _u.return)) _r.call(_u);
|
|
1812
1951
|
}
|
|
1813
|
-
finally { if (
|
|
1952
|
+
finally { if (e_10) throw e_10.error; }
|
|
1814
1953
|
}
|
|
1815
1954
|
try {
|
|
1816
1955
|
// Filter external
|
|
1817
|
-
for (var
|
|
1818
|
-
var item =
|
|
1819
|
-
if (item.type ===
|
|
1956
|
+
for (var _w = __values(externalFilters || []), _x = _w.next(); !_x.done; _x = _w.next()) {
|
|
1957
|
+
var item = _x.value;
|
|
1958
|
+
if (item.type === "daterange") {
|
|
1820
1959
|
externalFilter[item.field] = {
|
|
1821
|
-
from: (_f = (
|
|
1822
|
-
to: (_k = (
|
|
1960
|
+
from: (_f = (_e = (_d = value === null || value === void 0 ? void 0 : value.externalFilter) === null || _d === void 0 ? void 0 : _d[item.field]) === null || _e === void 0 ? void 0 : _e.from) !== null && _f !== void 0 ? _f : (_g = item.default) === null || _g === void 0 ? void 0 : _g.from,
|
|
1961
|
+
to: (_k = (_j = (_h = value === null || value === void 0 ? void 0 : value.externalFilter) === null || _h === void 0 ? void 0 : _h[item.field]) === null || _j === void 0 ? void 0 : _j.to) !== null && _k !== void 0 ? _k : (_l = item.default) === null || _l === void 0 ? void 0 : _l.to,
|
|
1823
1962
|
};
|
|
1824
1963
|
}
|
|
1825
1964
|
else {
|
|
1826
|
-
externalFilter[item.field] = (
|
|
1965
|
+
externalFilter[item.field] = (_o = (_m = value === null || value === void 0 ? void 0 : value.externalFilter) === null || _m === void 0 ? void 0 : _m[item.field]) !== null && _o !== void 0 ? _o : item === null || item === void 0 ? void 0 : item.default;
|
|
1827
1966
|
}
|
|
1828
1967
|
}
|
|
1829
1968
|
}
|
|
1830
|
-
catch (
|
|
1969
|
+
catch (e_11_1) { e_11 = { error: e_11_1 }; }
|
|
1970
|
+
finally {
|
|
1971
|
+
try {
|
|
1972
|
+
if (_x && !_x.done && (_s = _w.return)) _s.call(_w);
|
|
1973
|
+
}
|
|
1974
|
+
finally { if (e_11) throw e_11.error; }
|
|
1975
|
+
}
|
|
1976
|
+
try {
|
|
1977
|
+
// Filter def
|
|
1978
|
+
for (var _y = __values(filterDefs || []), _z = _y.next(); !_z.done; _z = _y.next()) {
|
|
1979
|
+
var item = _z.value;
|
|
1980
|
+
filterDef[item.sdMaterialFilterDef] = (_q = (_p = value === null || value === void 0 ? void 0 : value.filterDef) === null || _p === void 0 ? void 0 : _p[item.sdMaterialFilterDef]) !== null && _q !== void 0 ? _q : undefined;
|
|
1981
|
+
}
|
|
1982
|
+
}
|
|
1983
|
+
catch (e_12_1) { e_12 = { error: e_12_1 }; }
|
|
1831
1984
|
finally {
|
|
1832
1985
|
try {
|
|
1833
|
-
if (
|
|
1986
|
+
if (_z && !_z.done && (_t = _y.return)) _t.call(_y);
|
|
1834
1987
|
}
|
|
1835
|
-
finally { if (
|
|
1988
|
+
finally { if (e_12) throw e_12.error; }
|
|
1836
1989
|
}
|
|
1837
|
-
// Filter def
|
|
1838
1990
|
return {
|
|
1991
|
+
// Filter column
|
|
1839
1992
|
columnFilter: columnFilter,
|
|
1993
|
+
// Filter external
|
|
1840
1994
|
externalFilter: externalFilter,
|
|
1995
|
+
// Filter def
|
|
1841
1996
|
filterDef: filterDef,
|
|
1842
1997
|
};
|
|
1843
1998
|
});
|
|
@@ -1893,7 +2048,7 @@
|
|
|
1893
2048
|
_reload.set(this, new rxjs.Subject());
|
|
1894
2049
|
this.isExporting = false;
|
|
1895
2050
|
this.isSelectAll = false;
|
|
1896
|
-
this.exportTitle =
|
|
2051
|
+
this.exportTitle = "Export";
|
|
1897
2052
|
_loadCompleted.set(this, false);
|
|
1898
2053
|
_initCellDef.set(this, function () {
|
|
1899
2054
|
var e_1, _3;
|
|
@@ -1962,11 +2117,11 @@
|
|
|
1962
2117
|
rawColumnFilter: columnFilter || {},
|
|
1963
2118
|
rawExternalFilter: externalFilter || {},
|
|
1964
2119
|
rawFilterDef: filterDef || {},
|
|
1965
|
-
orderBy: ((_a = __classPrivateFieldGet(_this, _sort)) === null || _a === void 0 ? void 0 : _a.active) ||
|
|
1966
|
-
orderDirection: ((_b = __classPrivateFieldGet(_this, _sort)) === null || _b === void 0 ? void 0 : _b.direction) ||
|
|
2120
|
+
orderBy: ((_a = __classPrivateFieldGet(_this, _sort)) === null || _a === void 0 ? void 0 : _a.active) || "",
|
|
2121
|
+
orderDirection: ((_b = __classPrivateFieldGet(_this, _sort)) === null || _b === void 0 ? void 0 : _b.direction) || "",
|
|
1967
2122
|
pageNumber: pageNumber,
|
|
1968
2123
|
pageSize: pageSize,
|
|
1969
|
-
isExported: true
|
|
2124
|
+
isExported: true,
|
|
1970
2125
|
};
|
|
1971
2126
|
});
|
|
1972
2127
|
_initConfiguration.set(this, function (option) {
|
|
@@ -1976,7 +2131,7 @@
|
|
|
1976
2131
|
hidden: (_a = option === null || option === void 0 ? void 0 : option.paginate) === null || _a === void 0 ? void 0 : _a.hidden,
|
|
1977
2132
|
pageSize: (_f = (_c = (_b = option === null || option === void 0 ? void 0 : option.paginate) === null || _b === void 0 ? void 0 : _b.pageSize) !== null && _c !== void 0 ? _c : (_e = (_d = _this.configuration) === null || _d === void 0 ? void 0 : _d.paginate) === null || _e === void 0 ? void 0 : _e.pageSize) !== null && _f !== void 0 ? _f : (_g = DEFAULT_GRID_MATERIAL_CONFIG.paginate) === null || _g === void 0 ? void 0 : _g.pageSize,
|
|
1978
2133
|
pages: (_m = (_j = (_h = option === null || option === void 0 ? void 0 : option.paginate) === null || _h === void 0 ? void 0 : _h.pages) !== null && _j !== void 0 ? _j : (_l = (_k = _this.configuration) === null || _k === void 0 ? void 0 : _k.paginate) === null || _l === void 0 ? void 0 : _l.pages) !== null && _m !== void 0 ? _m : (_o = DEFAULT_GRID_MATERIAL_CONFIG.paginate) === null || _o === void 0 ? void 0 : _o.pages,
|
|
1979
|
-
showFirstLastButtons: (_q = (_p = option === null || option === void 0 ? void 0 : option.paginate) === null || _p === void 0 ? void 0 : _p.showFirstLastButtons) !== null && _q !== void 0 ? _q : false
|
|
2134
|
+
showFirstLastButtons: (_q = (_p = option === null || option === void 0 ? void 0 : option.paginate) === null || _p === void 0 ? void 0 : _p.showFirstLastButtons) !== null && _q !== void 0 ? _q : false,
|
|
1980
2135
|
};
|
|
1981
2136
|
return option;
|
|
1982
2137
|
});
|
|
@@ -1988,16 +2143,23 @@
|
|
|
1988
2143
|
_this.filterRegister = _this.gridFilterService.register((_b = (_a = _this.gridOption) === null || _a === void 0 ? void 0 : _a.filter) === null || _b === void 0 ? void 0 : _b.key, {
|
|
1989
2144
|
columns: (_c = _this.gridOption) === null || _c === void 0 ? void 0 : _c.columns,
|
|
1990
2145
|
externalFilters: (_e = (_d = _this.gridOption) === null || _d === void 0 ? void 0 : _d.filter) === null || _e === void 0 ? void 0 : _e.externalFilters,
|
|
1991
|
-
filterDefs: _this.filterDefs
|
|
2146
|
+
filterDefs: _this.filterDefs,
|
|
1992
2147
|
});
|
|
1993
2148
|
if (!hasRegister) {
|
|
1994
|
-
__classPrivateFieldGet(_this, _subscription$2).add(_this.filterRegister.value.observer
|
|
2149
|
+
__classPrivateFieldGet(_this, _subscription$2).add(_this.filterRegister.value.observer
|
|
2150
|
+
.pipe(operators.debounceTime(500), operators.map(function (filterValue) {
|
|
1995
2151
|
_this.columnFilter = filterValue.columnFilter;
|
|
1996
2152
|
__classPrivateFieldGet(_this, _paginator).pageIndex = 0;
|
|
1997
2153
|
__classPrivateFieldGet(_this, _reload).next({
|
|
1998
2154
|
force: false,
|
|
1999
2155
|
});
|
|
2000
|
-
}))
|
|
2156
|
+
}))
|
|
2157
|
+
.subscribe());
|
|
2158
|
+
}
|
|
2159
|
+
else {
|
|
2160
|
+
__classPrivateFieldGet(_this, _reload).next({
|
|
2161
|
+
force: true,
|
|
2162
|
+
});
|
|
2001
2163
|
}
|
|
2002
2164
|
}
|
|
2003
2165
|
});
|
|
@@ -2011,39 +2173,52 @@
|
|
|
2011
2173
|
for (var columns_1 = __values(columns), columns_1_1 = columns_1.next(); !columns_1_1.done; columns_1_1 = columns_1.next()) {
|
|
2012
2174
|
var column = columns_1_1.value;
|
|
2013
2175
|
var field = column.field, type = column.type;
|
|
2014
|
-
var filterValue = (rawColumnFilter[field] ||
|
|
2015
|
-
|
|
2176
|
+
var filterValue = (rawColumnFilter[field] || "")
|
|
2177
|
+
.toString()
|
|
2178
|
+
.trim()
|
|
2179
|
+
.toLowerCase();
|
|
2180
|
+
var columnValue = (item[field] || "")
|
|
2181
|
+
.toString()
|
|
2182
|
+
.trim()
|
|
2183
|
+
.toLowerCase();
|
|
2016
2184
|
if (filterValue) {
|
|
2017
|
-
if (!columnValue &&
|
|
2185
|
+
if (!columnValue &&
|
|
2186
|
+
type !== "datetime" &&
|
|
2187
|
+
type !== "date" &&
|
|
2188
|
+
type !== "time") {
|
|
2018
2189
|
return false;
|
|
2019
2190
|
}
|
|
2020
|
-
if (type ===
|
|
2191
|
+
if (type === "string") {
|
|
2021
2192
|
if (columnValue.indexOf(filterValue) === -1) {
|
|
2022
2193
|
return false;
|
|
2023
2194
|
}
|
|
2024
2195
|
}
|
|
2025
|
-
else if (type ===
|
|
2196
|
+
else if (type === "values") {
|
|
2026
2197
|
if (columnValue !== filterValue) {
|
|
2027
2198
|
return false;
|
|
2028
2199
|
}
|
|
2029
2200
|
}
|
|
2030
|
-
else if (type ===
|
|
2031
|
-
var fValue = +filterValue
|
|
2201
|
+
else if (type === "number") {
|
|
2202
|
+
var fValue = +filterValue
|
|
2203
|
+
.replace(">=", "")
|
|
2204
|
+
.replace("<=", "")
|
|
2205
|
+
.replace(">", "")
|
|
2206
|
+
.replace("<", "");
|
|
2032
2207
|
var cValue = +columnValue;
|
|
2033
2208
|
if (fValue || fValue === 0) {
|
|
2034
2209
|
if (!cValue && cValue !== 0) {
|
|
2035
2210
|
return false;
|
|
2036
2211
|
}
|
|
2037
|
-
if (filterValue.indexOf(
|
|
2212
|
+
if (filterValue.indexOf(">=") > -1 && cValue < fValue) {
|
|
2038
2213
|
return false;
|
|
2039
2214
|
}
|
|
2040
|
-
else if (filterValue.indexOf(
|
|
2215
|
+
else if (filterValue.indexOf("<=") > -1 && cValue > fValue) {
|
|
2041
2216
|
return false;
|
|
2042
2217
|
}
|
|
2043
|
-
else if (filterValue.indexOf(
|
|
2218
|
+
else if (filterValue.indexOf("<") > -1 && cValue >= fValue) {
|
|
2044
2219
|
return false;
|
|
2045
2220
|
}
|
|
2046
|
-
else if (filterValue.indexOf(
|
|
2221
|
+
else if (filterValue.indexOf(">") > -1 && cValue <= fValue) {
|
|
2047
2222
|
return false;
|
|
2048
2223
|
}
|
|
2049
2224
|
else if (cValue !== fValue) {
|
|
@@ -2051,15 +2226,21 @@
|
|
|
2051
2226
|
}
|
|
2052
2227
|
}
|
|
2053
2228
|
}
|
|
2054
|
-
else if (type ===
|
|
2055
|
-
if (filterValue ===
|
|
2229
|
+
else if (type === "bool") {
|
|
2230
|
+
if (filterValue === "1" &&
|
|
2231
|
+
columnValue !== "1" &&
|
|
2232
|
+
columnValue !== "true") {
|
|
2056
2233
|
return false;
|
|
2057
2234
|
}
|
|
2058
|
-
else if (filterValue ===
|
|
2235
|
+
else if (filterValue === "0" &&
|
|
2236
|
+
columnValue !== "0" &&
|
|
2237
|
+
columnValue !== "false") {
|
|
2059
2238
|
return false;
|
|
2060
2239
|
}
|
|
2061
2240
|
}
|
|
2062
|
-
else if (type ===
|
|
2241
|
+
else if (type === "datetime" ||
|
|
2242
|
+
type === "date" ||
|
|
2243
|
+
type === "time") {
|
|
2063
2244
|
var from = (_b = (_a = rawColumnFilter[field]) === null || _a === void 0 ? void 0 : _a.from) !== null && _b !== void 0 ? _b : rawColumnFilter[field];
|
|
2064
2245
|
var to = (_d = (_c = rawColumnFilter[field]) === null || _c === void 0 ? void 0 : _c.to) !== null && _d !== void 0 ? _d : rawColumnFilter[field];
|
|
2065
2246
|
var fromDate = Date.begin(from);
|
|
@@ -2097,16 +2278,16 @@
|
|
|
2097
2278
|
if (column) {
|
|
2098
2279
|
var type_1 = column.type, field_1 = column.field;
|
|
2099
2280
|
items.sort(function (current, next) {
|
|
2100
|
-
if (type_1 ===
|
|
2281
|
+
if (type_1 === "number") {
|
|
2101
2282
|
return (current[field_1] || 0) - (next[field_1] || 0);
|
|
2102
2283
|
}
|
|
2103
|
-
if (type_1 ===
|
|
2104
|
-
var d1 = new Date(current[field_1] ||
|
|
2105
|
-
var d2 = new Date(current[field_1] ||
|
|
2284
|
+
if (type_1 === "date" || type_1 === "datetime" || type_1 === "time") {
|
|
2285
|
+
var d1 = new Date(current[field_1] || "").getTime();
|
|
2286
|
+
var d2 = new Date(current[field_1] || "").getTime();
|
|
2106
2287
|
return d1 - d2;
|
|
2107
2288
|
}
|
|
2108
|
-
var s1 = (current[field_1] ||
|
|
2109
|
-
var s2 = (next[field_1] ||
|
|
2289
|
+
var s1 = (current[field_1] || "").toString();
|
|
2290
|
+
var s2 = (next[field_1] || "").toString();
|
|
2110
2291
|
if (s1 > s2) {
|
|
2111
2292
|
return 1;
|
|
2112
2293
|
}
|
|
@@ -2115,17 +2296,16 @@
|
|
|
2115
2296
|
}
|
|
2116
2297
|
return 0;
|
|
2117
2298
|
});
|
|
2118
|
-
if (orderDirection ===
|
|
2299
|
+
if (orderDirection === "desc") {
|
|
2119
2300
|
items.reverse();
|
|
2120
2301
|
}
|
|
2121
2302
|
}
|
|
2122
2303
|
}
|
|
2123
2304
|
return {
|
|
2124
2305
|
items: items.filter(function (item, index) {
|
|
2125
|
-
return index >= pageNumber * pageSize
|
|
2126
|
-
&& index < (pageNumber + 1) * pageSize;
|
|
2306
|
+
return (index >= pageNumber * pageSize && index < (pageNumber + 1) * pageSize);
|
|
2127
2307
|
}),
|
|
2128
|
-
total: items.length
|
|
2308
|
+
total: items.length,
|
|
2129
2309
|
};
|
|
2130
2310
|
});
|
|
2131
2311
|
_getFilter.set(this, function () {
|
|
@@ -2135,10 +2315,10 @@
|
|
|
2135
2315
|
rawColumnFilter: columnFilter || {},
|
|
2136
2316
|
rawExternalFilter: externalFilter || {},
|
|
2137
2317
|
rawFilterDef: filterDef || {},
|
|
2138
|
-
orderBy: ((_a = __classPrivateFieldGet(_this, _sort)) === null || _a === void 0 ? void 0 : _a.active) ||
|
|
2139
|
-
orderDirection: ((_b = __classPrivateFieldGet(_this, _sort)) === null || _b === void 0 ? void 0 : _b.direction) ||
|
|
2318
|
+
orderBy: ((_a = __classPrivateFieldGet(_this, _sort)) === null || _a === void 0 ? void 0 : _a.active) || "",
|
|
2319
|
+
orderDirection: ((_b = __classPrivateFieldGet(_this, _sort)) === null || _b === void 0 ? void 0 : _b.direction) || "",
|
|
2140
2320
|
pageNumber: ((_c = __classPrivateFieldGet(_this, _paginator)) === null || _c === void 0 ? void 0 : _c.pageIndex) || 0,
|
|
2141
|
-
pageSize: ((_d = __classPrivateFieldGet(_this, _paginator)) === null || _d === void 0 ? void 0 : _d.pageSize) || ((_f = (_e = _this.gridOption) === null || _e === void 0 ? void 0 : _e.paginate) === null || _f === void 0 ? void 0 : _f.pageSize) || 50
|
|
2321
|
+
pageSize: ((_d = __classPrivateFieldGet(_this, _paginator)) === null || _d === void 0 ? void 0 : _d.pageSize) || ((_f = (_e = _this.gridOption) === null || _e === void 0 ? void 0 : _e.paginate) === null || _f === void 0 ? void 0 : _f.pageSize) || 50,
|
|
2142
2322
|
};
|
|
2143
2323
|
});
|
|
2144
2324
|
_load$1.set(this, function (filterReq, force) {
|
|
@@ -2149,7 +2329,7 @@
|
|
|
2149
2329
|
switch (_5.label) {
|
|
2150
2330
|
case 0:
|
|
2151
2331
|
this.isLoading = true;
|
|
2152
|
-
if (!(this.gridOption.type ===
|
|
2332
|
+
if (!(this.gridOption.type === "server")) return [3 /*break*/, 6];
|
|
2153
2333
|
_5.label = 1;
|
|
2154
2334
|
case 1:
|
|
2155
2335
|
_5.trys.push([1, 3, 4, 5]);
|
|
@@ -2162,15 +2342,15 @@
|
|
|
2162
2342
|
data = _5.sent();
|
|
2163
2343
|
return [2 /*return*/, {
|
|
2164
2344
|
items: (data === null || data === void 0 ? void 0 : data.items) || [],
|
|
2165
|
-
total: (data === null || data === void 0 ? void 0 : data.total) || 0
|
|
2345
|
+
total: (data === null || data === void 0 ? void 0 : data.total) || 0,
|
|
2166
2346
|
}];
|
|
2167
2347
|
case 3:
|
|
2168
2348
|
error_1 = _5.sent();
|
|
2169
2349
|
console.error(error_1);
|
|
2170
|
-
this.notifyService.notify.warning(
|
|
2350
|
+
this.notifyService.notify.warning("Có lỗi xảy ra");
|
|
2171
2351
|
return [2 /*return*/, {
|
|
2172
2352
|
items: [],
|
|
2173
|
-
total: 0
|
|
2353
|
+
total: 0,
|
|
2174
2354
|
}];
|
|
2175
2355
|
case 4:
|
|
2176
2356
|
this.isLoading = false;
|
|
@@ -2195,14 +2375,14 @@
|
|
|
2195
2375
|
_5.label = 10;
|
|
2196
2376
|
case 10:
|
|
2197
2377
|
if (!Array.isArray(__classPrivateFieldGet(this, _localItems))) {
|
|
2198
|
-
this.notifyService.notify.warning(
|
|
2378
|
+
this.notifyService.notify.warning("Dữ liệu không phải là một mảng");
|
|
2199
2379
|
__classPrivateFieldSet(this, _localItems, []);
|
|
2200
2380
|
}
|
|
2201
2381
|
return [3 /*break*/, 13];
|
|
2202
2382
|
case 11:
|
|
2203
2383
|
error_2 = _5.sent();
|
|
2204
2384
|
console.error(error_2);
|
|
2205
|
-
this.notifyService.notify.warning(
|
|
2385
|
+
this.notifyService.notify.warning("Có lỗi xảy ra");
|
|
2206
2386
|
__classPrivateFieldSet(this, _localItems, []);
|
|
2207
2387
|
return [3 /*break*/, 13];
|
|
2208
2388
|
case 12:
|
|
@@ -2277,7 +2457,7 @@
|
|
|
2277
2457
|
case 1: return [2 /*return*/, _3.sent()];
|
|
2278
2458
|
case 2:
|
|
2279
2459
|
filterInfo = __classPrivateFieldGet(this, _filterExportInfo).call(this, pageNumber, pageSize);
|
|
2280
|
-
if (!(this.gridOption.type ===
|
|
2460
|
+
if (!(this.gridOption.type === "server")) return [3 /*break*/, 4];
|
|
2281
2461
|
result = this.gridOption.items(filterInfo);
|
|
2282
2462
|
if (rxjs.isObservable(result)) {
|
|
2283
2463
|
result = result.toPromise();
|
|
@@ -2286,7 +2466,7 @@
|
|
|
2286
2466
|
case 3: return [2 /*return*/, _3.sent()];
|
|
2287
2467
|
case 4:
|
|
2288
2468
|
exportedItems = [];
|
|
2289
|
-
if (!(typeof
|
|
2469
|
+
if (!(typeof this.gridOption.items === "function")) return [3 /*break*/, 8];
|
|
2290
2470
|
results = this.gridOption.items();
|
|
2291
2471
|
if (!(results instanceof Promise)) return [3 /*break*/, 6];
|
|
2292
2472
|
return [4 /*yield*/, results];
|
|
@@ -2307,23 +2487,25 @@
|
|
|
2307
2487
|
});
|
|
2308
2488
|
_allColumns.set(this, function () {
|
|
2309
2489
|
var columns = [];
|
|
2310
|
-
_this.gridOption.columns
|
|
2490
|
+
_this.gridOption.columns
|
|
2491
|
+
.filter(function (e) { var _a; return !((_a = e.export) === null || _a === void 0 ? void 0 : _a.disabled); })
|
|
2492
|
+
.forEach(function (column) {
|
|
2311
2493
|
var _a, _b;
|
|
2312
|
-
if (column.type ===
|
|
2494
|
+
if (column.type === "image") {
|
|
2313
2495
|
return;
|
|
2314
2496
|
}
|
|
2315
|
-
if (column.type ===
|
|
2497
|
+
if (column.type === "children") {
|
|
2316
2498
|
(_a = column.children) === null || _a === void 0 ? void 0 : _a.filter(function (e) { var _a; return !((_a = e.export) === null || _a === void 0 ? void 0 : _a.disabled); }).forEach(function (childColumn) {
|
|
2317
|
-
if (childColumn.type ===
|
|
2499
|
+
if (childColumn.type === "image") {
|
|
2318
2500
|
return;
|
|
2319
2501
|
}
|
|
2320
2502
|
columns.push(childColumn);
|
|
2321
2503
|
});
|
|
2322
2504
|
return;
|
|
2323
2505
|
}
|
|
2324
|
-
if (column.type ===
|
|
2506
|
+
if (column.type === "children-col") {
|
|
2325
2507
|
(_b = column.children) === null || _b === void 0 ? void 0 : _b.filter(function (e) { var _a; return !((_a = e.export) === null || _a === void 0 ? void 0 : _a.disabled); }).forEach(function (childColumn) {
|
|
2326
|
-
if (childColumn.type ===
|
|
2508
|
+
if (childColumn.type === "image") {
|
|
2327
2509
|
return;
|
|
2328
2510
|
}
|
|
2329
2511
|
columns.push(childColumn);
|
|
@@ -2336,7 +2518,7 @@
|
|
|
2336
2518
|
});
|
|
2337
2519
|
_allExportedColumns.set(this, function () {
|
|
2338
2520
|
var _a, _b;
|
|
2339
|
-
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); })) || [];
|
|
2521
|
+
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); })) || []);
|
|
2340
2522
|
});
|
|
2341
2523
|
_onExport.set(this, function (args) { return __awaiter(_this, void 0, void 0, function () {
|
|
2342
2524
|
var _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, file, isCSV, columns_2, pageSize_1, batch, total_1, pageNumber_1, exportItems_1, items_1, promises_1, handleData, sheets, _3, _4, sheet, _5, _6, _7, e_5_1;
|
|
@@ -2370,7 +2552,7 @@
|
|
|
2370
2552
|
try {
|
|
2371
2553
|
for (results_1 = __values(results), results_1_1 = results_1.next(); !results_1_1.done; results_1_1 = results_1.next()) {
|
|
2372
2554
|
result = results_1_1.value;
|
|
2373
|
-
if (
|
|
2555
|
+
if ("items" in result) {
|
|
2374
2556
|
exportItems_1 = __spread(exportItems_1, result.items);
|
|
2375
2557
|
total_1 = result.total;
|
|
2376
2558
|
}
|
|
@@ -2398,7 +2580,7 @@
|
|
|
2398
2580
|
_5.label = 4;
|
|
2399
2581
|
case 4:
|
|
2400
2582
|
totalPage = total_1 / pageSize_1;
|
|
2401
|
-
percent = Math.round((pageNumber_1 - 1) * 100.0 / totalPage);
|
|
2583
|
+
percent = Math.round(((pageNumber_1 - 1) * 100.0) / totalPage);
|
|
2402
2584
|
this.exportTitle = "Exporting..." + percent + "%";
|
|
2403
2585
|
allColumns = __classPrivateFieldGet(this, _allColumns).call(this);
|
|
2404
2586
|
allExportedColumns = __classPrivateFieldGet(this, _allExportedColumns).call(this);
|
|
@@ -2424,7 +2606,7 @@
|
|
|
2424
2606
|
if (!column) {
|
|
2425
2607
|
return [2 /*return*/];
|
|
2426
2608
|
}
|
|
2427
|
-
if (column.type ===
|
|
2609
|
+
if (column.type === "children" || column.type === "children-col") {
|
|
2428
2610
|
column === null || column === void 0 ? void 0 : column.children.forEach(function (childColumn) { return handle(childColumn); });
|
|
2429
2611
|
return [2 /*return*/];
|
|
2430
2612
|
}
|
|
@@ -2433,7 +2615,7 @@
|
|
|
2433
2615
|
}
|
|
2434
2616
|
if (!column.transform) return [3 /*break*/, 4];
|
|
2435
2617
|
transform = column.transform(item[column.field], item, {
|
|
2436
|
-
isExport: true
|
|
2618
|
+
isExport: true,
|
|
2437
2619
|
});
|
|
2438
2620
|
if (!(transform instanceof Promise)) return [3 /*break*/, 2];
|
|
2439
2621
|
_3 = obj;
|
|
@@ -2446,59 +2628,62 @@
|
|
|
2446
2628
|
obj[column.field] = transform;
|
|
2447
2629
|
_7.label = 3;
|
|
2448
2630
|
case 3:
|
|
2449
|
-
obj[column.field] = (_t = obj[column.field]) !== null && _t !== void 0 ? _t :
|
|
2631
|
+
obj[column.field] = (_t = obj[column.field]) !== null && _t !== void 0 ? _t : "";
|
|
2450
2632
|
return [3 /*break*/, 13];
|
|
2451
2633
|
case 4:
|
|
2452
|
-
if (!(item[column.field] === undefined ||
|
|
2453
|
-
|
|
2634
|
+
if (!(item[column.field] === undefined ||
|
|
2635
|
+
item[column.field] === null ||
|
|
2636
|
+
item[column.field] === "")) return [3 /*break*/, 5];
|
|
2637
|
+
obj[column.field] = "";
|
|
2454
2638
|
return [3 /*break*/, 13];
|
|
2455
2639
|
case 5:
|
|
2456
|
-
if (!(column.type ===
|
|
2640
|
+
if (!(column.type === "string" || column.type === "number")) return [3 /*break*/, 6];
|
|
2457
2641
|
// Nếu cell là string hoặc number thì gán bằng chính nó
|
|
2458
2642
|
obj[column.field] = item[column.field];
|
|
2459
2643
|
return [3 /*break*/, 13];
|
|
2460
2644
|
case 6:
|
|
2461
|
-
if (!(column.type ===
|
|
2645
|
+
if (!(column.type === "bool")) return [3 /*break*/, 7];
|
|
2462
2646
|
// Nếu là bool thì gán bằng giá trị trueValue và falseValue (nếu có), mặc định là TRUE/FALSE
|
|
2463
2647
|
if (item[column.field]) {
|
|
2464
|
-
obj[column.field] = ((_u = column.option) === null || _u === void 0 ? void 0 : _u.displayOnTrue) ||
|
|
2648
|
+
obj[column.field] = ((_u = column.option) === null || _u === void 0 ? void 0 : _u.displayOnTrue) || "True";
|
|
2465
2649
|
}
|
|
2466
|
-
else if (obj[column.field] !== undefined &&
|
|
2467
|
-
obj[column.field]
|
|
2650
|
+
else if (obj[column.field] !== undefined &&
|
|
2651
|
+
obj[column.field] !== null) {
|
|
2652
|
+
obj[column.field] = ((_v = column.option) === null || _v === void 0 ? void 0 : _v.displayOnFalse) || "False";
|
|
2468
2653
|
}
|
|
2469
2654
|
return [3 /*break*/, 13];
|
|
2470
2655
|
case 7:
|
|
2471
|
-
if (!(column.type ===
|
|
2656
|
+
if (!(column.type === "date")) return [3 /*break*/, 8];
|
|
2472
2657
|
date = item[column.field];
|
|
2473
2658
|
transformDate = column.transformDate;
|
|
2474
2659
|
if (transformDate) {
|
|
2475
2660
|
date = transformDate(date, item);
|
|
2476
2661
|
}
|
|
2477
2662
|
// Nếu là date thì convert theo đúng format
|
|
2478
|
-
obj[column.field] = Date.toFormat(date,
|
|
2663
|
+
obj[column.field] = Date.toFormat(date, "dd/MM/yyyy");
|
|
2479
2664
|
return [3 /*break*/, 13];
|
|
2480
2665
|
case 8:
|
|
2481
|
-
if (!(column.type ===
|
|
2666
|
+
if (!(column.type === "datetime")) return [3 /*break*/, 9];
|
|
2482
2667
|
date = item[column.field];
|
|
2483
2668
|
transformDate = column.transformDate;
|
|
2484
2669
|
if (transformDate) {
|
|
2485
2670
|
date = transformDate(date, item);
|
|
2486
2671
|
}
|
|
2487
2672
|
// Nếu là datetime thì convert theo đúng format
|
|
2488
|
-
obj[column.field] = Date.toFormat(date,
|
|
2673
|
+
obj[column.field] = Date.toFormat(date, "dd/MM/yyyy HH:mm");
|
|
2489
2674
|
return [3 /*break*/, 13];
|
|
2490
2675
|
case 9:
|
|
2491
|
-
if (!(column.type ===
|
|
2676
|
+
if (!(column.type === "time")) return [3 /*break*/, 10];
|
|
2492
2677
|
date = item[column.field];
|
|
2493
2678
|
transformDate = column.transformDate;
|
|
2494
2679
|
if (transformDate) {
|
|
2495
2680
|
date = transformDate(date, item);
|
|
2496
2681
|
}
|
|
2497
2682
|
// Nếu là time thì convert theo đúng format
|
|
2498
|
-
obj[column.field] = Date.toFormat(date,
|
|
2683
|
+
obj[column.field] = Date.toFormat(date, "HH:mm");
|
|
2499
2684
|
return [3 /*break*/, 13];
|
|
2500
2685
|
case 10:
|
|
2501
|
-
if (!(column.type ===
|
|
2686
|
+
if (!(column.type === "values")) return [3 /*break*/, 12];
|
|
2502
2687
|
// Nếu là values thì lấy giá trị của value được chọn
|
|
2503
2688
|
_5 = obj;
|
|
2504
2689
|
_6 = column.field;
|
|
@@ -2600,7 +2785,7 @@
|
|
|
2600
2785
|
return [4 /*yield*/, this.exportService.exportCSV({
|
|
2601
2786
|
columns: columns_2,
|
|
2602
2787
|
items: items_1,
|
|
2603
|
-
fileName: (_m = (_l = this.gridOption) === null || _l === void 0 ? void 0 : _l.export) === null || _m === void 0 ? void 0 : _m.fileName
|
|
2788
|
+
fileName: (_m = (_l = this.gridOption) === null || _l === void 0 ? void 0 : _l.export) === null || _m === void 0 ? void 0 : _m.fileName,
|
|
2604
2789
|
})];
|
|
2605
2790
|
case 6:
|
|
2606
2791
|
_9.sent();
|
|
@@ -2621,7 +2806,7 @@
|
|
|
2621
2806
|
sheets.push({
|
|
2622
2807
|
name: sheet.name,
|
|
2623
2808
|
items: sheet.items,
|
|
2624
|
-
fields: sheet.fields
|
|
2809
|
+
fields: sheet.fields,
|
|
2625
2810
|
});
|
|
2626
2811
|
return [3 /*break*/, 12];
|
|
2627
2812
|
case 10:
|
|
@@ -2653,7 +2838,7 @@
|
|
|
2653
2838
|
columns: columns_2,
|
|
2654
2839
|
items: items_1,
|
|
2655
2840
|
fileName: (_r = (_q = this.gridOption) === null || _q === void 0 ? void 0 : _q.export) === null || _r === void 0 ? void 0 : _r.fileName,
|
|
2656
|
-
sheets: sheets
|
|
2841
|
+
sheets: sheets,
|
|
2657
2842
|
})];
|
|
2658
2843
|
case 17:
|
|
2659
2844
|
_9.sent();
|
|
@@ -2662,7 +2847,7 @@
|
|
|
2662
2847
|
filePath: file.filePath,
|
|
2663
2848
|
fileName: file.fileName,
|
|
2664
2849
|
columns: columns_2,
|
|
2665
|
-
items: items_1
|
|
2850
|
+
items: items_1,
|
|
2666
2851
|
})];
|
|
2667
2852
|
case 19:
|
|
2668
2853
|
_9.sent();
|
|
@@ -2701,14 +2886,16 @@
|
|
|
2701
2886
|
}
|
|
2702
2887
|
data = (_z = (_y = (_x = this.gridOption) === null || _x === void 0 ? void 0 : _x.subInformation) === null || _y === void 0 ? void 0 : _y.onExpand) === null || _z === void 0 ? void 0 : _z.call(_y, rowData);
|
|
2703
2888
|
if (!((_0 = this.gridOption.subInformation) === null || _0 === void 0 ? void 0 : _0.multiple)) {
|
|
2704
|
-
this.items.forEach(function (item) { return item.isExpanding = item.isExpanded = false; });
|
|
2889
|
+
this.items.forEach(function (item) { return (item.isExpanding = item.isExpanded = false); });
|
|
2705
2890
|
}
|
|
2706
2891
|
if (data instanceof Promise) {
|
|
2707
2892
|
rowData.isExpanding = true;
|
|
2708
|
-
data
|
|
2893
|
+
data
|
|
2894
|
+
.then(function (res) {
|
|
2709
2895
|
rowData.expandDetail = res;
|
|
2710
2896
|
rowData.isExpanded = true;
|
|
2711
|
-
})
|
|
2897
|
+
})
|
|
2898
|
+
.finally(function () { return (rowData.isExpanding = false); });
|
|
2712
2899
|
}
|
|
2713
2900
|
else {
|
|
2714
2901
|
rowData.expandDetail = data;
|
|
@@ -2720,14 +2907,16 @@
|
|
|
2720
2907
|
this.onSelect = function (rowData) {
|
|
2721
2908
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
2722
2909
|
if ((_b = (_a = rowData === null || rowData === void 0 ? void 0 : rowData.sdGroup) === null || _a === void 0 ? void 0 : _a.items) === null || _b === void 0 ? void 0 : _b.length) {
|
|
2723
|
-
(_c = rowData === null || rowData === void 0 ? void 0 : rowData.sdGroup) === null || _c === void 0 ? void 0 : _c.items.forEach(function (e) { return e.isSelected = rowData.isSelected; });
|
|
2910
|
+
(_c = rowData === null || rowData === void 0 ? void 0 : rowData.sdGroup) === null || _c === void 0 ? void 0 : _c.items.forEach(function (e) { return (e.isSelected = rowData.isSelected); });
|
|
2724
2911
|
(_e = (_d = _this.gridOption.selection) === null || _d === void 0 ? void 0 : _d.onSelect) === null || _e === void 0 ? void 0 : _e.call(_d, rowData, _this.items.filter(function (e) { return e.isSelected; }));
|
|
2725
2912
|
_this.isSelectAll = _this.items.every(function (e) { return e.isSelected; });
|
|
2726
2913
|
__classPrivateFieldGet(_this, _updateSelectedItems).call(_this);
|
|
2727
2914
|
}
|
|
2728
2915
|
else {
|
|
2729
2916
|
if ((_f = _this.gridOption.selection) === null || _f === void 0 ? void 0 : _f.single) {
|
|
2730
|
-
_this.items
|
|
2917
|
+
_this.items
|
|
2918
|
+
.filter(function (e) { return e !== rowData; })
|
|
2919
|
+
.forEach(function (e) { return (e.isSelected = false); });
|
|
2731
2920
|
__classPrivateFieldGet(_this, _updateSelectedItems).call(_this);
|
|
2732
2921
|
return;
|
|
2733
2922
|
}
|
|
@@ -2740,7 +2929,8 @@
|
|
|
2740
2929
|
var _a, _b, _c;
|
|
2741
2930
|
(_a = _this.items) === null || _a === void 0 ? void 0 : _a.forEach(function (e) {
|
|
2742
2931
|
var _a, _b, _c, _d;
|
|
2743
|
-
if (e.selectable &&
|
|
2932
|
+
if (e.selectable &&
|
|
2933
|
+
(!((_c = (_b = (_a = _this.gridOption) === null || _a === void 0 ? void 0 : _a.selection) === null || _b === void 0 ? void 0 : _b.actions) === null || _c === void 0 ? void 0 : _c.length) || ((_d = e.actions) === null || _d === void 0 ? void 0 : _d.length))) {
|
|
2744
2934
|
e.isSelected = _this.isSelectAll;
|
|
2745
2935
|
}
|
|
2746
2936
|
});
|
|
@@ -2750,11 +2940,12 @@
|
|
|
2750
2940
|
this.onClearSelection = function (items) {
|
|
2751
2941
|
items = items || _this.items;
|
|
2752
2942
|
_this.isSelectAll = false;
|
|
2753
|
-
items === null || items === void 0 ? void 0 : items.forEach(function (e) { return e.isSelected = false; });
|
|
2943
|
+
items === null || items === void 0 ? void 0 : items.forEach(function (e) { return (e.isSelected = false); });
|
|
2754
2944
|
__classPrivateFieldGet(_this, _updateSelectedItems).call(_this);
|
|
2755
2945
|
};
|
|
2756
2946
|
_updateSelectedItems.set(this, function () {
|
|
2757
|
-
_this.selectedItems = _this.items
|
|
2947
|
+
_this.selectedItems = _this.items
|
|
2948
|
+
.filter(function (item) { return item.isSelected; })
|
|
2758
2949
|
.map(function (item) {
|
|
2759
2950
|
var isSelected = item.isSelected, isExpanded = item.isExpanded, isExpanding = item.isExpanding, expandDetail = item.expandDetail, editorErrorMessage = item.editorErrorMessage, editorHandlerColumn = item.editorHandlerColumn, editorHandlerRow = item.editorHandlerRow, editorStatus = item.editorStatus, originItem = item.originItem, sdId = item.sdId, sdVersion = item.sdVersion,
|
|
2760
2951
|
// Giữ lại các trường thông tin cho selectable (action, groupedAction, sdGroup, selectable)
|
|
@@ -2771,7 +2962,7 @@
|
|
|
2771
2962
|
_this.filterRegister.value.set({
|
|
2772
2963
|
columnFilter: columnFilter,
|
|
2773
2964
|
externalFilter: externalFilter,
|
|
2774
|
-
filterDef: filterDef
|
|
2965
|
+
filterDef: filterDef,
|
|
2775
2966
|
});
|
|
2776
2967
|
// if (this.gridOption?.filter?.inlineColumn && args?.columnFilter) {
|
|
2777
2968
|
// this.columnFilter = args.columnFilter;
|
|
@@ -2787,48 +2978,48 @@
|
|
|
2787
2978
|
var item = {};
|
|
2788
2979
|
// Gán giá trị mặc định
|
|
2789
2980
|
columns.forEach(function (column) {
|
|
2790
|
-
if (column.type ===
|
|
2791
|
-
item[column.field] =
|
|
2981
|
+
if (column.type === "values") {
|
|
2982
|
+
item[column.field] = "";
|
|
2792
2983
|
}
|
|
2793
|
-
else if (column.type ===
|
|
2984
|
+
else if (column.type === "bool") {
|
|
2794
2985
|
item[column.field] = true;
|
|
2795
2986
|
}
|
|
2796
|
-
else if (column.type ===
|
|
2987
|
+
else if (column.type === "number") {
|
|
2797
2988
|
item[column.field] = null;
|
|
2798
2989
|
}
|
|
2799
2990
|
});
|
|
2800
|
-
if (type ===
|
|
2991
|
+
if (type === "local") {
|
|
2801
2992
|
(_a = editor.onAdd) === null || _a === void 0 ? void 0 : _a.call(editor, item, __classPrivateFieldGet(_this, _localItems));
|
|
2802
2993
|
}
|
|
2803
2994
|
else {
|
|
2804
2995
|
(_b = editor.onAdd) === null || _b === void 0 ? void 0 : _b.call(editor, item, _this.items);
|
|
2805
2996
|
}
|
|
2806
2997
|
// Đưa item lên dòng đầu tiên nếu type khác popup
|
|
2807
|
-
if (editor.type !==
|
|
2998
|
+
if (editor.type !== "popup") {
|
|
2808
2999
|
if (editor.addToLast) {
|
|
2809
|
-
if (type ===
|
|
3000
|
+
if (type === "local") {
|
|
2810
3001
|
__classPrivateFieldSet(_this, _localItems, __spread(__classPrivateFieldGet(_this, _localItems), [item]));
|
|
2811
3002
|
}
|
|
2812
3003
|
_this.items = __spread(_this.items, [item]);
|
|
2813
3004
|
}
|
|
2814
3005
|
else {
|
|
2815
|
-
if (type ===
|
|
3006
|
+
if (type === "local") {
|
|
2816
3007
|
__classPrivateFieldSet(_this, _localItems, __spread([item], __classPrivateFieldGet(_this, _localItems)));
|
|
2817
3008
|
}
|
|
2818
3009
|
_this.items = __spread([item], _this.items);
|
|
2819
3010
|
}
|
|
2820
3011
|
}
|
|
2821
|
-
item.editorStatus =
|
|
3012
|
+
item.editorStatus = "create";
|
|
2822
3013
|
item.editorHandlerRow = {
|
|
2823
|
-
temporary: Object.assign({}, item)
|
|
3014
|
+
temporary: Object.assign({}, item),
|
|
2824
3015
|
};
|
|
2825
3016
|
};
|
|
2826
3017
|
this.onUpdate = function (item) {
|
|
2827
3018
|
var editor = _this.gridOption.editor;
|
|
2828
|
-
item.editorStatus =
|
|
3019
|
+
item.editorStatus = "update";
|
|
2829
3020
|
item.editorHandlerRow = Object.assign(Object.assign({}, item.editorHandlerRow), { temporary: Object.assign({}, item) });
|
|
2830
3021
|
// this.generateEditorHanlder(item);
|
|
2831
|
-
if (editor.type ===
|
|
3022
|
+
if (editor.type === "popup") {
|
|
2832
3023
|
// Xử lý case popup
|
|
2833
3024
|
// this.sdGridPopupEditor.open(item, columns, isModified);
|
|
2834
3025
|
}
|
|
@@ -2871,8 +3062,8 @@
|
|
|
2871
3062
|
_3.sent();
|
|
2872
3063
|
_3.label = 6;
|
|
2873
3064
|
case 6:
|
|
2874
|
-
if (item.editorStatus ===
|
|
2875
|
-
if (this.gridOption.type ===
|
|
3065
|
+
if (item.editorStatus === "create" && editor.type === "popup") {
|
|
3066
|
+
if (this.gridOption.type === "local") {
|
|
2876
3067
|
this.items.splice(0, 0, item);
|
|
2877
3068
|
}
|
|
2878
3069
|
// this.viewItems.splice(0, 0, item);
|
|
@@ -2894,8 +3085,8 @@
|
|
|
2894
3085
|
this.onCancel = function (item) {
|
|
2895
3086
|
var _a, _b;
|
|
2896
3087
|
var editor = _this.gridOption.editor;
|
|
2897
|
-
if (editor.type ===
|
|
2898
|
-
if (_this.gridOption.type ===
|
|
3088
|
+
if (editor.type === "inline") {
|
|
3089
|
+
if (_this.gridOption.type === "local") {
|
|
2899
3090
|
var idx2 = __classPrivateFieldGet(_this, _localItems).indexOf(item);
|
|
2900
3091
|
__classPrivateFieldGet(_this, _localItems).splice(idx2, 1);
|
|
2901
3092
|
__classPrivateFieldSet(_this, _localItems, __spread(__classPrivateFieldGet(_this, _localItems)));
|
|
@@ -2903,7 +3094,7 @@
|
|
|
2903
3094
|
var idx1 = _this.items.indexOf(item);
|
|
2904
3095
|
_this.items.splice(idx1, 1);
|
|
2905
3096
|
_this.items = __spread(_this.items);
|
|
2906
|
-
if (_this.gridOption.type ===
|
|
3097
|
+
if (_this.gridOption.type === "local") {
|
|
2907
3098
|
(_a = editor === null || editor === void 0 ? void 0 : editor.onCancel) === null || _a === void 0 ? void 0 : _a.call(editor, item, __classPrivateFieldGet(_this, _localItems));
|
|
2908
3099
|
}
|
|
2909
3100
|
else {
|
|
@@ -2912,9 +3103,9 @@
|
|
|
2912
3103
|
_this.ref.detectChanges();
|
|
2913
3104
|
return;
|
|
2914
3105
|
}
|
|
2915
|
-
if (editor.type ===
|
|
2916
|
-
if (item.editorStatus ===
|
|
2917
|
-
if (_this.gridOption.type ===
|
|
3106
|
+
if (editor.type === "focus") {
|
|
3107
|
+
if (item.editorStatus === "create") {
|
|
3108
|
+
if (_this.gridOption.type === "local") {
|
|
2918
3109
|
var idx2 = __classPrivateFieldGet(_this, _localItems).indexOf(item);
|
|
2919
3110
|
__classPrivateFieldGet(_this, _localItems).splice(idx2, 1);
|
|
2920
3111
|
__classPrivateFieldSet(_this, _localItems, __spread(__classPrivateFieldGet(_this, _localItems)));
|
|
@@ -2952,8 +3143,8 @@
|
|
|
2952
3143
|
}
|
|
2953
3144
|
_3.label = 3;
|
|
2954
3145
|
case 3:
|
|
2955
|
-
if (editor.type ===
|
|
2956
|
-
if (this.gridOption.type ===
|
|
3146
|
+
if (editor.type === "inline") {
|
|
3147
|
+
if (this.gridOption.type === "local") {
|
|
2957
3148
|
idx2 = __classPrivateFieldGet(this, _localItems).indexOf(item);
|
|
2958
3149
|
__classPrivateFieldGet(this, _localItems).splice(idx2, 1);
|
|
2959
3150
|
__classPrivateFieldSet(this, _localItems, __spread(__classPrivateFieldGet(this, _localItems)));
|
|
@@ -2961,7 +3152,7 @@
|
|
|
2961
3152
|
idx1 = this.items.indexOf(item);
|
|
2962
3153
|
this.items.splice(idx1, 1);
|
|
2963
3154
|
this.items = __spread(this.items);
|
|
2964
|
-
if (this.gridOption.type ===
|
|
3155
|
+
if (this.gridOption.type === "local") {
|
|
2965
3156
|
(_1 = editor === null || editor === void 0 ? void 0 : editor.onRemove) === null || _1 === void 0 ? void 0 : _1.call(editor, item, __classPrivateFieldGet(this, _localItems));
|
|
2966
3157
|
}
|
|
2967
3158
|
else {
|
|
@@ -3045,11 +3236,13 @@
|
|
|
3045
3236
|
var _this = this;
|
|
3046
3237
|
if (paginator && __classPrivateFieldGet(this, _paginator) !== paginator) {
|
|
3047
3238
|
__classPrivateFieldSet(this, _paginator, paginator);
|
|
3048
|
-
__classPrivateFieldGet(this, _subscription$2).add(paginator.page
|
|
3239
|
+
__classPrivateFieldGet(this, _subscription$2).add(paginator.page
|
|
3240
|
+
.pipe(operators.map(function () {
|
|
3049
3241
|
__classPrivateFieldGet(_this, _reload).next({
|
|
3050
|
-
force: false
|
|
3242
|
+
force: false,
|
|
3051
3243
|
});
|
|
3052
|
-
}))
|
|
3244
|
+
}))
|
|
3245
|
+
.subscribe());
|
|
3053
3246
|
}
|
|
3054
3247
|
},
|
|
3055
3248
|
enumerable: false,
|
|
@@ -3060,11 +3253,13 @@
|
|
|
3060
3253
|
var _this = this;
|
|
3061
3254
|
if (sort && __classPrivateFieldGet(this, _sort) !== sort) {
|
|
3062
3255
|
__classPrivateFieldSet(this, _sort, sort);
|
|
3063
|
-
__classPrivateFieldGet(this, _subscription$2).add(sort.sortChange
|
|
3256
|
+
__classPrivateFieldGet(this, _subscription$2).add(sort.sortChange
|
|
3257
|
+
.pipe(operators.map(function () {
|
|
3064
3258
|
__classPrivateFieldGet(_this, _reload).next({
|
|
3065
|
-
force: false
|
|
3259
|
+
force: false,
|
|
3066
3260
|
});
|
|
3067
|
-
}))
|
|
3261
|
+
}))
|
|
3262
|
+
.subscribe());
|
|
3068
3263
|
}
|
|
3069
3264
|
},
|
|
3070
3265
|
enumerable: false,
|
|
@@ -3088,13 +3283,18 @@
|
|
|
3088
3283
|
return [2 /*return*/, result];
|
|
3089
3284
|
}
|
|
3090
3285
|
});
|
|
3091
|
-
}); }))
|
|
3286
|
+
}); }))
|
|
3287
|
+
.subscribe(__classPrivateFieldGet(this, _render)));
|
|
3092
3288
|
__classPrivateFieldGet(this, _subscription$2).add(this.sdCellDefs.changes.pipe(operators.startWith([])).subscribe(__classPrivateFieldGet(this, _initCellDef)));
|
|
3093
|
-
__classPrivateFieldGet(this, _subscription$2).add(this.sdFooterDefs.changes
|
|
3094
|
-
|
|
3289
|
+
__classPrivateFieldGet(this, _subscription$2).add(this.sdFooterDefs.changes
|
|
3290
|
+
.pipe(operators.startWith([]))
|
|
3291
|
+
.subscribe(__classPrivateFieldGet(this, _initFooterDef)));
|
|
3292
|
+
__classPrivateFieldGet(this, _subscription$2).add(this.sdFilterDefs.changes
|
|
3293
|
+
.pipe(operators.startWith([]))
|
|
3294
|
+
.subscribe(__classPrivateFieldGet(this, _initFilterDef)));
|
|
3095
3295
|
__classPrivateFieldGet(this, _subscription$2).add(rxjs.combineLatest([
|
|
3096
3296
|
__classPrivateFieldGet(this, _optionChanges).pipe(operators.startWith(this.gridOption)),
|
|
3097
|
-
this.sdFilterDefs.changes.pipe(operators.startWith(this.filterDefs))
|
|
3297
|
+
this.sdFilterDefs.changes.pipe(operators.startWith(this.filterDefs)),
|
|
3098
3298
|
]).subscribe(function (a) {
|
|
3099
3299
|
__classPrivateFieldGet(_this, _loadFilterRegister).call(_this);
|
|
3100
3300
|
}));
|
|
@@ -3108,7 +3308,8 @@
|
|
|
3108
3308
|
};
|
|
3109
3309
|
Object.defineProperty(SdGridMaterial.prototype, "editedItems", {
|
|
3110
3310
|
get: function () {
|
|
3111
|
-
return this.items
|
|
3311
|
+
return this.items
|
|
3312
|
+
.filter(function (item) {
|
|
3112
3313
|
if (!item.originItem) {
|
|
3113
3314
|
return true;
|
|
3114
3315
|
}
|
|
@@ -3116,7 +3317,8 @@
|
|
|
3116
3317
|
return true;
|
|
3117
3318
|
}
|
|
3118
3319
|
return false;
|
|
3119
|
-
})
|
|
3320
|
+
})
|
|
3321
|
+
.map(function (item) {
|
|
3120
3322
|
var editorStatus = item.editorStatus, editorHandlerRow = item.editorHandlerRow, editorHandlerColumn = item.editorHandlerColumn, editorErrorMessage = item.editorErrorMessage, expandDetail = item.expandDetail, isExpanded = item.isExpanded, isExpanding = item.isExpanding, isSelected = item.isSelected, originItem = item.originItem, sdId = item.sdId, sdVersion = item.sdVersion, selectable = item.selectable, actions = item.actions, groupedActions = item.groupedActions, sdGroup = item.sdGroup, temporary = item.temporary, result = __rest(item, ["editorStatus", "editorHandlerRow", "editorHandlerColumn", "editorErrorMessage", "expandDetail", "isExpanded", "isExpanding", "isSelected", "originItem", "sdId", "sdVersion", "selectable", "actions", "groupedActions", "sdGroup", "temporary"]);
|
|
3121
3323
|
return Object.assign(Object.assign({}, result), { editorErrorMessage: editorErrorMessage });
|
|
3122
3324
|
});
|
|
@@ -3163,13 +3365,13 @@
|
|
|
3163
3365
|
_optionChanges = new WeakMap(), _localItems = new WeakMap(), _paginator = new WeakMap(), _sort = new WeakMap(), _subscription$2 = new WeakMap(), _reload = new WeakMap(), _loadCompleted = new WeakMap(), _initCellDef = new WeakMap(), _initFilterDef = new WeakMap(), _initFooterDef = new WeakMap(), _filterExportInfo = new WeakMap(), _initConfiguration = new WeakMap(), _loadFilterRegister = 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();
|
|
3164
3366
|
SdGridMaterial.decorators = [
|
|
3165
3367
|
{ type: core.Component, args: [{
|
|
3166
|
-
selector:
|
|
3368
|
+
selector: "sd-grid-material",
|
|
3167
3369
|
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 <sd-grid-filter *ngIf=\"!gridOption.filter?.disabled && filterRegister\" [filterRegister]=\"filterRegister\" [filter]=\"gridOption?.filter\"\r\n [columns]=\"configuration.firstColumns\" [externalFilters]=\"gridOption?.filter?.externalFilters\" [filterDefs]=\"filterDefs\" #gridFilter>\r\n </sd-grid-filter>\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=\"gridFilter && !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.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\"\r\n (export)=\"onExport($event)\" #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>",
|
|
3168
3370
|
animations: [
|
|
3169
|
-
animations.trigger(
|
|
3170
|
-
animations.state(
|
|
3171
|
-
animations.state(
|
|
3172
|
-
animations.transition(
|
|
3371
|
+
animations.trigger("detailExpand", [
|
|
3372
|
+
animations.state("collapsed", animations.style({ height: "0", minHeight: "0", visibility: "hidden" })),
|
|
3373
|
+
animations.state("expanded", animations.style({ height: "*", visibility: "visible" })),
|
|
3374
|
+
animations.transition("expanded <=> collapsed", animations.animate("225ms cubic-bezier(0.4, 0.0, 0.2, 1)")),
|
|
3173
3375
|
]),
|
|
3174
3376
|
],
|
|
3175
3377
|
styles: [".text-black400{color:#757575}:host{display:flex;flex-direction:column;height:100%;overflow:auto}:host .c-container{display:flex;flex:1;flex-direction:column;min-height:200px;position:relative}:host .c-container .c-table{flex:1;min-height:300px;position:relative}:host .c-container .c-table table{border-collapse:separate;width:100%}:host .c-container .c-table table tr.c-first-header.mat-header-row,:host .c-container .c-table table tr.c-second-header.mat-header-row{height:40px}:host .c-container .c-table table tr.c-detail-row{height:0}:host .c-container .c-table table tr.c-row.activated{background-color:#e5ecff}:host .c-container .c-table table tr.c-row.selected{background-color:#eef2ff}:host .c-container .c-table table tr.c-row:not(.selected):not(.activated):hover{background-color:#f5f5f5}:host .c-container .c-table table tr.c-row td{border-bottom-width:0}:host .c-container .c-table table tr.c-row.c-expandable{cursor:pointer}:host .c-container .c-table table tr.c-row.c-expandable:hover{background:#f5f5f5}:host .c-container .c-table table th.mat-header-cell{background-color:#f2f3f4;border-bottom:0!important}:host .c-container .c-table table td.mat-cell,:host .c-container .c-table table td.mat-footer-cell,:host .c-container .c-table table th.mat-header-cell{border-bottom-color:#f2f2f2!important}:host .c-container .c-table .c-th{color:#212121;font-size:14px;font-weight:500;line-height:20px;vertical-align:middle}:host .c-container .c-table .c-td:first{padding-left:10px}:host .c-container .c-loading{align-items:center;background:rgba(0,0,0,.15);bottom:56px;display:flex;justify-content:center;left:0;position:absolute;right:0;top:0;z-index:2}:host .c-container .c-paginator{align-items:center;background-color:#fff;display:flex;flex-direction:row;justify-content:space-between}:host .c-container .c-paginator .c-action{padding:5px}:host .c-container .c-empty{background-color:#fff;border:none!important;text-align:center}:host .c-container .c-empty mat-icon{font-size:150px;height:auto;margin-bottom:30px;margin-top:30px;opacity:.2;width:auto}:host button.c-btn-add{background-color:#fff;box-shadow:0 2px 4px rgba(47,49,54,.16)}:host mat-icon.c-icon{color:rgba(0,0,0,.54)!important}:host mat-icon.c-icon-add{color:#2962ff!important}:host .lds-ring{display:inline-block;height:40px;position:relative;width:40px}:host .lds-ring div{-webkit-animation:lds-ring 1.2s cubic-bezier(.5,0,.5,1) infinite;animation:lds-ring 1.2s cubic-bezier(.5,0,.5,1) infinite;border:4px solid transparent;border-radius:50%;border-top-color:#cef;box-sizing:border-box;display:block;height:32px;margin:4px;position:absolute;width:32px}:host .lds-ring div:first-child{-webkit-animation-delay:-.45s;animation-delay:-.45s}:host .lds-ring div:nth-child(2){-webkit-animation-delay:-.3s;animation-delay:-.3s}:host .lds-ring div:nth-child(3){-webkit-animation-delay:-.15s;animation-delay:-.15s}:host .style1 .mat-table{border:1px solid #dde0e5}:host .style1 .mat-table tr.mat-header-row{background:#f2f3f4}:host .style1 .mat-table th.mat-header-cell{padding:10px 0}:host .style1 .c-paginator{border:1px solid #dde0e5;border-top:none!important}:host .style1 .mat-form-field-wrapper{background:#fff;padding:0}@-webkit-keyframes lds-ring{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}@keyframes lds-ring{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}:host ::ng-deep .mat-sort-header-content{display:block;text-align:left;width:100%}:host ::ng-deep .mat-select-arrow{color:#a6a6a6}:host ::ng-deep .mat-sort-header-disabled{background-image:none!important;cursor:default!important;padding-right:0!important}:host ::ng-deep .mat-sort-header-container{align-items:start!important}:host ::ng-deep .mat-sort-header-arrow{margin-top:4px!important}:host ::ng-deep .mat-sort-header{cursor:pointer}:host ::ng-deep .mat-sort-header[aria-sort]{background-position:center right 0;background-repeat:no-repeat;background-size:16px 16px;cursor:pointer;padding-right:24px}:host ::ng-deep .mat-sort-header[aria-sort=none]{background-image:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24px' viewBox='0 0 24 24' width='24px' fill='%23000000'%3E%3Cpath d='M0 0h24v24H0V0z' fill='none'/%3E%3Cpath fill='%237A7A7A' d='M12 5.83L15.17 9l1.41-1.41L12 3 7.41 7.59 8.83 9 12 5.83zm0 12.34L8.83 15l-1.41 1.41L12 21l4.59-4.59L15.17 15 12 18.17z'/%3E%3C/svg%3E\")}:host ::ng-deep .mat-sort-header[aria-sort=ascending]{background-image:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24px' viewBox='0 0 24 24' width='24px' fill='%23000000'%3E%3Cpath d='M0 0h24v24H0V0z' fill='none'/%3E%3Cpath fill='%237A7A7A' d='M4 12l1.41 1.41L11 7.83V20h2V7.83l5.58 5.59L20 12l-8-8-8 8z'/%3E%3C/svg%3E\")}:host ::ng-deep .mat-sort-header[aria-sort=descending]{background-image:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24px' viewBox='0 0 24 24' width='24px' fill='%23000000'%3E%3Cpath d='M0 0h24v24H0V0z' fill='none'/%3E%3Cpath fill='%237A7A7A' d='M20 12l-1.41-1.41L13 16.17V4h-2v12.17l-5.58-5.59L4 12l8 8 8-8z'/%3E%3C/svg%3E\")}"]
|