@sd-angular/core 1.0.0 → 1.0.4
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/sd-core.scss +0 -2
- package/bundles/sd-angular-core-grid-material.umd.js +76 -66
- package/bundles/sd-angular-core-grid-material.umd.js.map +1 -1
- package/bundles/sd-angular-core-grid-material.umd.min.js +1 -1
- package/bundles/sd-angular-core-grid-material.umd.min.js.map +1 -1
- package/bundles/sd-angular-core-grid.umd.js +4 -123
- package/bundles/sd-angular-core-grid.umd.js.map +1 -1
- package/bundles/sd-angular-core-grid.umd.min.js +1 -1
- package/bundles/sd-angular-core-grid.umd.min.js.map +1 -1
- package/esm2015/grid/src/lib/grid.module.js +1 -3
- package/esm2015/grid/src/public-api.js +1 -2
- package/esm2015/grid-material/src/lib/grid-material.component.js +27 -25
- package/fesm2015/sd-angular-core-grid-material.js +26 -24
- package/fesm2015/sd-angular-core-grid-material.js.map +1 -1
- package/fesm2015/sd-angular-core-grid.js +1 -113
- package/fesm2015/sd-angular-core-grid.js.map +1 -1
- package/grid/sd-angular-core-grid.metadata.json +1 -1
- package/grid/src/public-api.d.ts +0 -1
- package/grid-material/src/lib/grid-material.component.d.ts +1 -1
- package/package.json +16 -15
- package/{sd-angular-core-1.0.0.tgz → sd-angular-core-1.0.4.tgz} +0 -0
- package/esm2015/grid/src/lib/components/grid-date-picker-control/grid-date-picker-control.component.js +0 -114
- package/grid/src/lib/components/grid-date-picker-control/grid-date-picker-control.component.d.ts +0 -23
package/assets/scss/sd-core.scss
CHANGED
|
@@ -14,9 +14,7 @@
|
|
|
14
14
|
@import "./bootstrap/bootstrap.scss";
|
|
15
15
|
@import "./core/toastr.scss";
|
|
16
16
|
@import "~font-awesome/css/font-awesome.min.css";
|
|
17
|
-
@import "~jquery-datetimepicker/build/jquery.datetimepicker.min.css";
|
|
18
17
|
@import "~material-icons/iconfont/material-icons.scss";
|
|
19
|
-
// @import "~material-design-icons/iconfont/material-icons.css";
|
|
20
18
|
@import "~quill/dist/quill.core.css";
|
|
21
19
|
@import "~quill/dist/quill.bubble.css";
|
|
22
20
|
@import "~quill/dist/quill.snow.css";
|
|
@@ -1834,14 +1834,16 @@
|
|
|
1834
1834
|
});
|
|
1835
1835
|
_filterLocal.set(this, function (localItems, filterInfo) {
|
|
1836
1836
|
var columns = _this.gridOption.columns;
|
|
1837
|
+
var rawColumnFilter = filterInfo.rawColumnFilter, orderBy = filterInfo.orderBy, orderDirection = filterInfo.orderDirection, pageSize = filterInfo.pageSize, pageNumber = filterInfo.pageNumber;
|
|
1837
1838
|
var items = localItems.filter(function (item) {
|
|
1838
1839
|
var e_4, _t;
|
|
1839
1840
|
var _a, _b;
|
|
1840
1841
|
try {
|
|
1841
1842
|
for (var columns_1 = __values(columns), columns_1_1 = columns_1.next(); !columns_1_1.done; columns_1_1 = columns_1.next()) {
|
|
1842
1843
|
var column = columns_1_1.value;
|
|
1843
|
-
var
|
|
1844
|
-
var
|
|
1844
|
+
var field = column.field;
|
|
1845
|
+
var filterValue = (rawColumnFilter[field] || '').toString().trim().toLowerCase();
|
|
1846
|
+
var columnValue = (item[field] || '').toString().trim().toLowerCase();
|
|
1845
1847
|
if (filterValue) {
|
|
1846
1848
|
if (!columnValue) {
|
|
1847
1849
|
return false;
|
|
@@ -1912,8 +1914,8 @@
|
|
|
1912
1914
|
return true;
|
|
1913
1915
|
});
|
|
1914
1916
|
// Sort
|
|
1915
|
-
if (
|
|
1916
|
-
var column = columns.find(function (e) { return e.field ===
|
|
1917
|
+
if (orderBy && orderDirection) {
|
|
1918
|
+
var column = columns.find(function (e) { return e.field === orderBy; });
|
|
1917
1919
|
if (column) {
|
|
1918
1920
|
var type_1 = column.type, field_1 = column.field;
|
|
1919
1921
|
items.sort(function (current, next) {
|
|
@@ -1935,18 +1937,16 @@
|
|
|
1935
1937
|
}
|
|
1936
1938
|
return 0;
|
|
1937
1939
|
});
|
|
1938
|
-
if (
|
|
1940
|
+
if (orderDirection === 'desc') {
|
|
1939
1941
|
items.reverse();
|
|
1940
1942
|
}
|
|
1941
1943
|
}
|
|
1942
1944
|
}
|
|
1945
|
+
console.log(localItems, items, rawColumnFilter);
|
|
1943
1946
|
return {
|
|
1944
1947
|
items: items.filter(function (item, index) {
|
|
1945
|
-
|
|
1946
|
-
|
|
1947
|
-
var pageSize = ((_b = __classPrivateFieldGet(_this, _paginator)) === null || _b === void 0 ? void 0 : _b.pageSize) || ((_d = (_c = _this.gridOption) === null || _c === void 0 ? void 0 : _c.paginate) === null || _d === void 0 ? void 0 : _d.pageSize) || 50;
|
|
1948
|
-
return index >= pageIndex * pageSize
|
|
1949
|
-
&& index < (pageIndex + 1) * pageSize;
|
|
1948
|
+
return index >= pageNumber * pageSize
|
|
1949
|
+
&& index < (pageNumber + 1) * pageSize;
|
|
1950
1950
|
}),
|
|
1951
1951
|
total: items.length
|
|
1952
1952
|
};
|
|
@@ -1963,47 +1963,51 @@
|
|
|
1963
1963
|
pageSize: ((_j = __classPrivateFieldGet(_this, _paginator)) === null || _j === void 0 ? void 0 : _j.pageSize) || ((_l = (_k = _this.gridOption) === null || _k === void 0 ? void 0 : _k.paginate) === null || _l === void 0 ? void 0 : _l.pageSize) || 50
|
|
1964
1964
|
});
|
|
1965
1965
|
});
|
|
1966
|
-
_load$1.set(this, function (filterReq
|
|
1967
|
-
|
|
1968
|
-
return
|
|
1969
|
-
|
|
1970
|
-
|
|
1971
|
-
|
|
1972
|
-
|
|
1973
|
-
|
|
1974
|
-
|
|
1975
|
-
|
|
1976
|
-
|
|
1977
|
-
|
|
1978
|
-
result =
|
|
1979
|
-
|
|
1980
|
-
|
|
1981
|
-
|
|
1982
|
-
|
|
1983
|
-
|
|
1984
|
-
|
|
1985
|
-
|
|
1986
|
-
|
|
1987
|
-
|
|
1988
|
-
|
|
1989
|
-
|
|
1990
|
-
|
|
1991
|
-
|
|
1992
|
-
|
|
1993
|
-
|
|
1994
|
-
|
|
1995
|
-
|
|
1996
|
-
|
|
1997
|
-
|
|
1998
|
-
|
|
1999
|
-
|
|
2000
|
-
|
|
2001
|
-
|
|
2002
|
-
|
|
2003
|
-
|
|
2004
|
-
|
|
1966
|
+
_load$1.set(this, function (filterReq, force) {
|
|
1967
|
+
if (force === void 0) { force = true; }
|
|
1968
|
+
return __awaiter(_this, void 0, void 0, function () {
|
|
1969
|
+
var result, results, _t, error_1;
|
|
1970
|
+
return __generator(this, function (_u) {
|
|
1971
|
+
switch (_u.label) {
|
|
1972
|
+
case 0:
|
|
1973
|
+
this.isLoading = true;
|
|
1974
|
+
_u.label = 1;
|
|
1975
|
+
case 1:
|
|
1976
|
+
_u.trys.push([1, 8, 9, 10]);
|
|
1977
|
+
if (!(this.gridOption.type === 'server')) return [3 /*break*/, 3];
|
|
1978
|
+
result = this.gridOption.items(filterReq);
|
|
1979
|
+
if (rxjs.isObservable(result)) {
|
|
1980
|
+
result = result.toPromise();
|
|
1981
|
+
}
|
|
1982
|
+
return [4 /*yield*/, result];
|
|
1983
|
+
case 2: return [2 /*return*/, _u.sent()];
|
|
1984
|
+
case 3:
|
|
1985
|
+
if (!force) return [3 /*break*/, 6];
|
|
1986
|
+
results = this.gridOption.items();
|
|
1987
|
+
if (!(results instanceof Promise)) return [3 /*break*/, 5];
|
|
1988
|
+
_t = this;
|
|
1989
|
+
return [4 /*yield*/, results];
|
|
1990
|
+
case 4:
|
|
1991
|
+
_t.localItems = _u.sent();
|
|
1992
|
+
return [3 /*break*/, 6];
|
|
1993
|
+
case 5:
|
|
1994
|
+
this.localItems = results;
|
|
1995
|
+
_u.label = 6;
|
|
1996
|
+
case 6: return [2 /*return*/, __classPrivateFieldGet(this, _filterLocal).call(this, this.localItems, filterReq)];
|
|
1997
|
+
case 7: return [3 /*break*/, 10];
|
|
1998
|
+
case 8:
|
|
1999
|
+
error_1 = _u.sent();
|
|
2000
|
+
this.notifyService.handle.error(error_1);
|
|
2001
|
+
return [3 /*break*/, 10];
|
|
2002
|
+
case 9:
|
|
2003
|
+
this.isLoading = false;
|
|
2004
|
+
this.ref.detectChanges();
|
|
2005
|
+
return [7 /*endfinally*/];
|
|
2006
|
+
case 10: return [2 /*return*/];
|
|
2007
|
+
}
|
|
2008
|
+
});
|
|
2005
2009
|
});
|
|
2006
|
-
});
|
|
2010
|
+
});
|
|
2007
2011
|
_render.set(this, function (args) { return __awaiter(_this, void 0, void 0, function () {
|
|
2008
2012
|
var _a, _b, _c;
|
|
2009
2013
|
return __generator(this, function (_t) {
|
|
@@ -2024,18 +2028,21 @@
|
|
|
2024
2028
|
}
|
|
2025
2029
|
});
|
|
2026
2030
|
}); });
|
|
2027
|
-
this.reload = function () {
|
|
2028
|
-
|
|
2029
|
-
return
|
|
2030
|
-
|
|
2031
|
-
|
|
2032
|
-
|
|
2033
|
-
|
|
2034
|
-
|
|
2035
|
-
|
|
2036
|
-
|
|
2031
|
+
this.reload = function (force) {
|
|
2032
|
+
if (force === void 0) { force = true; }
|
|
2033
|
+
return __awaiter(_this, void 0, void 0, function () {
|
|
2034
|
+
var data;
|
|
2035
|
+
return __generator(this, function (_t) {
|
|
2036
|
+
switch (_t.label) {
|
|
2037
|
+
case 0: return [4 /*yield*/, __classPrivateFieldGet(this, _load$1).call(this, __classPrivateFieldGet(this, _getFilter).call(this), force)];
|
|
2038
|
+
case 1:
|
|
2039
|
+
data = _t.sent();
|
|
2040
|
+
__classPrivateFieldGet(this, _render).call(this, data);
|
|
2041
|
+
return [2 /*return*/];
|
|
2042
|
+
}
|
|
2043
|
+
});
|
|
2037
2044
|
});
|
|
2038
|
-
}
|
|
2045
|
+
};
|
|
2039
2046
|
_exportedItems.set(this, function (pageNumber, pageSize) {
|
|
2040
2047
|
if (pageNumber === void 0) { pageNumber = 0; }
|
|
2041
2048
|
if (pageSize === void 0) { pageSize = 10000; }
|
|
@@ -2366,7 +2373,7 @@
|
|
|
2366
2373
|
}); };
|
|
2367
2374
|
this.onFilterChange = function () {
|
|
2368
2375
|
__classPrivateFieldGet(_this, _paginator).pageIndex = 0;
|
|
2369
|
-
_this.reload();
|
|
2376
|
+
_this.reload(false);
|
|
2370
2377
|
};
|
|
2371
2378
|
this.onExpand = function (rowData) { return __awaiter(_this, void 0, void 0, function () {
|
|
2372
2379
|
var _q, _r, _s, data;
|
|
@@ -2630,7 +2637,7 @@
|
|
|
2630
2637
|
__classPrivateFieldGet(this, _subscription$1).add(gridFilter.filterChange.pipe(operators.debounceTime(200), operators.map(function () {
|
|
2631
2638
|
__classPrivateFieldGet(_this, _paginator).pageIndex = 0;
|
|
2632
2639
|
return __classPrivateFieldGet(_this, _getFilter).call(_this);
|
|
2633
|
-
}), operators.switchMap(__classPrivateFieldGet(
|
|
2640
|
+
}), operators.switchMap(function (filterInfo) { return __classPrivateFieldGet(_this, _load$1).call(_this, filterInfo, false); })).subscribe(__classPrivateFieldGet(this, _render)));
|
|
2634
2641
|
}
|
|
2635
2642
|
},
|
|
2636
2643
|
enumerable: false,
|
|
@@ -2660,9 +2667,10 @@
|
|
|
2660
2667
|
});
|
|
2661
2668
|
Object.defineProperty(SdGridMaterial.prototype, "paginator", {
|
|
2662
2669
|
set: function (paginator) {
|
|
2670
|
+
var _this = this;
|
|
2663
2671
|
if (paginator && __classPrivateFieldGet(this, _paginator) !== paginator) {
|
|
2664
2672
|
__classPrivateFieldSet(this, _paginator, paginator);
|
|
2665
|
-
__classPrivateFieldGet(this, _subscription$1).add(paginator.page.pipe(operators.debounceTime(200), operators.map(__classPrivateFieldGet(this, _getFilter)), operators.switchMap(__classPrivateFieldGet(
|
|
2673
|
+
__classPrivateFieldGet(this, _subscription$1).add(paginator.page.pipe(operators.debounceTime(200), operators.map(__classPrivateFieldGet(this, _getFilter)), operators.switchMap(function (filterInfo) { return __classPrivateFieldGet(_this, _load$1).call(_this, filterInfo, false); })).subscribe(__classPrivateFieldGet(this, _render)));
|
|
2666
2674
|
}
|
|
2667
2675
|
},
|
|
2668
2676
|
enumerable: false,
|
|
@@ -2670,9 +2678,10 @@
|
|
|
2670
2678
|
});
|
|
2671
2679
|
Object.defineProperty(SdGridMaterial.prototype, "sort", {
|
|
2672
2680
|
set: function (sort) {
|
|
2681
|
+
var _this = this;
|
|
2673
2682
|
if (sort && __classPrivateFieldGet(this, _sort) !== sort) {
|
|
2674
2683
|
__classPrivateFieldSet(this, _sort, sort);
|
|
2675
|
-
__classPrivateFieldGet(this, _subscription$1).add(sort.sortChange.pipe(operators.debounceTime(200), operators.map(__classPrivateFieldGet(this, _getFilter)), operators.switchMap(__classPrivateFieldGet(
|
|
2684
|
+
__classPrivateFieldGet(this, _subscription$1).add(sort.sortChange.pipe(operators.debounceTime(200), operators.map(__classPrivateFieldGet(this, _getFilter)), operators.switchMap(function (filterInfo) { return __classPrivateFieldGet(_this, _load$1).call(_this, filterInfo, false); })).subscribe(__classPrivateFieldGet(this, _render)));
|
|
2676
2685
|
}
|
|
2677
2686
|
},
|
|
2678
2687
|
enumerable: false,
|
|
@@ -2682,10 +2691,11 @@
|
|
|
2682
2691
|
__classPrivateFieldGet(this, _initCellDef).call(this);
|
|
2683
2692
|
};
|
|
2684
2693
|
SdGridMaterial.prototype.ngAfterViewInit = function () {
|
|
2694
|
+
var _this = this;
|
|
2685
2695
|
__classPrivateFieldGet(this, _subscription$1).add(this.sdCellDefs.changes.pipe(operators.startWith([])).subscribe(__classPrivateFieldGet(this, _initCellDef)));
|
|
2686
2696
|
__classPrivateFieldGet(this, _subscription$1).add(this.sdFooterDefs.changes.pipe(operators.startWith([])).subscribe(__classPrivateFieldGet(this, _initFooterDef)));
|
|
2687
2697
|
__classPrivateFieldGet(this, _subscription$1).add(this.sdFilterDefs.changes.pipe(operators.startWith([])).subscribe(__classPrivateFieldGet(this, _initFilterDef)));
|
|
2688
|
-
__classPrivateFieldGet(this, _subscription$1).add(__classPrivateFieldGet(this, _optionChanges).pipe(operators.startWith({}), operators.debounceTime(200), operators.map(__classPrivateFieldGet(this, _getFilter)), operators.switchMap(__classPrivateFieldGet(
|
|
2698
|
+
__classPrivateFieldGet(this, _subscription$1).add(__classPrivateFieldGet(this, _optionChanges).pipe(operators.startWith({}), operators.debounceTime(200), operators.map(__classPrivateFieldGet(this, _getFilter)), operators.switchMap(function (filterInfo) { return __classPrivateFieldGet(_this, _load$1).call(_this, filterInfo, true); })).subscribe(__classPrivateFieldGet(this, _render)));
|
|
2689
2699
|
this.ref.detectChanges();
|
|
2690
2700
|
};
|
|
2691
2701
|
SdGridMaterial.prototype.ngOnDestroy = function () {
|