@sd-angular/core 1.3.1 → 1.3.3
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 +25 -13
- package/bundles/sd-angular-core-grid-material.umd.js.map +1 -1
- package/bundles/sd-angular-core-grid-material.umd.min.js +1 -1
- package/bundles/sd-angular-core-grid-material.umd.min.js.map +1 -1
- package/esm2015/grid-material/src/lib/grid-material.component.js +50 -40
- package/esm2015/grid-material/src/public-api.js +1 -1
- package/fesm2015/sd-angular-core-grid-material.js +50 -40
- 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/public-api.d.ts +2 -0
- package/package.json +1 -1
- package/{sd-angular-core-1.3.1.tgz → sd-angular-core-1.3.3.tgz} +0 -0
|
@@ -8,4 +8,4 @@ export { SdMaterialSubInformationDefDirective } from './lib/directives/sd-materi
|
|
|
8
8
|
// Components
|
|
9
9
|
export { SdGridMaterial } from './lib/grid-material.component';
|
|
10
10
|
export { SdGridMaterialModule } from './lib/grid-material.module';
|
|
11
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
11
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHVibGljLWFwaS5qcyIsInNvdXJjZVJvb3QiOiJDOi9Vc2Vycy9uZ2hpYXR0MTVfb25lbW91bnQvRG9jdW1lbnRzL2xpYi1jb3JlLXVpL3Byb2plY3RzL3NkLWNvcmUvZ3JpZC1tYXRlcmlhbC8iLCJzb3VyY2VzIjpbInNyYy9wdWJsaWMtYXBpLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8seUJBQXlCLENBQUM7QUFXakMsYUFBYTtBQUNiLE9BQU8sRUFBRSwwQkFBMEIsRUFBRSxNQUFNLGlEQUFpRCxDQUFDO0FBQzdGLE9BQU8sRUFBRSw0QkFBNE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WF0aW9uLWRlZi5kaXJlY3RpdmUnO1xyXG5cclxuLy8gQ29tcG9uZW50c1xyXG5leHBvcnQgeyBTZEdyaWRNYXRlcmlhbCB9IGZyb20gJy4vbGliL2dyaWQtbWF0ZXJpYWwuY29tcG9uZW50JztcclxuZXhwb3J0IHsgU2RHcmlkTWF0ZXJpYWxNb2R1bGUgfSBmcm9tICcuL2xpYi9ncmlkLW1hdGVyaWFsLm1vZHVsZSc7XHJcbiJdfQ==
|
|
@@ -5,10 +5,10 @@ import { MatPaginator, MatPaginatorIntl, MatPaginatorModule } from '@angular/mat
|
|
|
5
5
|
import { MatSort, MatSortModule } from '@angular/material/sort';
|
|
6
6
|
import { trigger, state, style, transition, animate } from '@angular/animations';
|
|
7
7
|
import { v4 } from 'uuid';
|
|
8
|
-
import { Subject, Subscription, isObservable
|
|
8
|
+
import { Subject, Subscription, isObservable } from 'rxjs';
|
|
9
9
|
import { SdNotifyService } from '@sd-angular/core/notify';
|
|
10
10
|
import { moveItemInArray, DragDropModule } from '@angular/cdk/drag-drop';
|
|
11
|
-
import { startWith,
|
|
11
|
+
import { startWith, map, debounceTime, switchMap } from 'rxjs/operators';
|
|
12
12
|
import hash from 'object-hash';
|
|
13
13
|
import { SdSettingService } from '@sd-angular/core/setting';
|
|
14
14
|
import { DeviceDetectorService } from 'ngx-device-detector';
|
|
@@ -1483,41 +1483,37 @@ class SdGridMaterial {
|
|
|
1483
1483
|
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
|
|
1484
1484
|
});
|
|
1485
1485
|
});
|
|
1486
|
-
_load$1.set(this, (filterReq, force = true) => {
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
result = result.toPromise();
|
|
1494
|
-
}
|
|
1495
|
-
return yield result;
|
|
1486
|
+
_load$1.set(this, (filterReq, force = true) => __awaiter(this, void 0, void 0, function* () {
|
|
1487
|
+
this.isLoading = true;
|
|
1488
|
+
try {
|
|
1489
|
+
if (this.gridOption.type === 'server') {
|
|
1490
|
+
let result = this.gridOption.items(filterReq);
|
|
1491
|
+
if (isObservable(result)) {
|
|
1492
|
+
result = result.toPromise();
|
|
1496
1493
|
}
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1494
|
+
return yield result;
|
|
1495
|
+
}
|
|
1496
|
+
else {
|
|
1497
|
+
if (force) {
|
|
1498
|
+
const results = this.gridOption.items();
|
|
1499
|
+
if (results instanceof Promise) {
|
|
1500
|
+
this.localItems = yield results;
|
|
1501
|
+
}
|
|
1502
|
+
else {
|
|
1503
|
+
this.localItems = results;
|
|
1506
1504
|
}
|
|
1507
|
-
return __classPrivateFieldGet(this, _filterLocal).call(this, this.localItems, filterReq);
|
|
1508
1505
|
}
|
|
1506
|
+
return __classPrivateFieldGet(this, _filterLocal).call(this, this.localItems, filterReq);
|
|
1509
1507
|
}
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
}
|
|
1518
|
-
|
|
1519
|
-
return obs.pipe(debounceTime(200));
|
|
1520
|
-
});
|
|
1508
|
+
}
|
|
1509
|
+
catch (error) {
|
|
1510
|
+
this.notifyService.handle.error(error);
|
|
1511
|
+
}
|
|
1512
|
+
finally {
|
|
1513
|
+
this.isLoading = false;
|
|
1514
|
+
this.ref.detectChanges();
|
|
1515
|
+
}
|
|
1516
|
+
}));
|
|
1521
1517
|
_render.set(this, (args) => __awaiter(this, void 0, void 0, function* () {
|
|
1522
1518
|
var _a, _b, _c, _d;
|
|
1523
1519
|
(_a = this.sdScroll) === null || _a === void 0 ? void 0 : _a.scrollTop();
|
|
@@ -1532,7 +1528,7 @@ class SdGridMaterial {
|
|
|
1532
1528
|
__classPrivateFieldGet(this, _updateSelectedItems).call(this);
|
|
1533
1529
|
}));
|
|
1534
1530
|
this.reload = (force = true) => __awaiter(this, void 0, void 0, function* () {
|
|
1535
|
-
const data = yield __classPrivateFieldGet(this, _load$1).call(this, __classPrivateFieldGet(this, _getFilter).call(this), force)
|
|
1531
|
+
const data = yield __classPrivateFieldGet(this, _load$1).call(this, __classPrivateFieldGet(this, _getFilter).call(this), force);
|
|
1536
1532
|
__classPrivateFieldGet(this, _render).call(this, data);
|
|
1537
1533
|
});
|
|
1538
1534
|
_exportedItems.set(this, (pageNumber = 0, pageSize = 10000) => __awaiter(this, void 0, void 0, function* () {
|
|
@@ -2100,10 +2096,11 @@ class SdGridMaterial {
|
|
|
2100
2096
|
set _gridFilter(gridFilter) {
|
|
2101
2097
|
if (gridFilter && this.gridFilter !== gridFilter) {
|
|
2102
2098
|
this.gridFilter = gridFilter;
|
|
2099
|
+
__classPrivateFieldGet(this, _reload).next(false);
|
|
2103
2100
|
__classPrivateFieldGet(this, _subscription$1).add(gridFilter.filterChange.pipe(map(() => {
|
|
2104
2101
|
__classPrivateFieldGet(this, _paginator).pageIndex = 0;
|
|
2105
|
-
|
|
2106
|
-
})
|
|
2102
|
+
__classPrivateFieldGet(this, _reload).next(false);
|
|
2103
|
+
})).subscribe());
|
|
2107
2104
|
}
|
|
2108
2105
|
}
|
|
2109
2106
|
set option(option) {
|
|
@@ -2111,7 +2108,7 @@ class SdGridMaterial {
|
|
|
2111
2108
|
if (option) {
|
|
2112
2109
|
option = __classPrivateFieldGet(this, _initConfiguration).call(this, option);
|
|
2113
2110
|
this.gridOption = option;
|
|
2114
|
-
__classPrivateFieldGet(this,
|
|
2111
|
+
__classPrivateFieldGet(this, _reload).next(true);
|
|
2115
2112
|
(_a = option === null || option === void 0 ? void 0 : option.columns) === null || _a === void 0 ? void 0 : _a.forEach(col => {
|
|
2116
2113
|
var _a;
|
|
2117
2114
|
if ((_a = col.filter) === null || _a === void 0 ? void 0 : _a.default) {
|
|
@@ -2126,23 +2123,36 @@ class SdGridMaterial {
|
|
|
2126
2123
|
set paginator(paginator) {
|
|
2127
2124
|
if (paginator && __classPrivateFieldGet(this, _paginator) !== paginator) {
|
|
2128
2125
|
__classPrivateFieldSet(this, _paginator, paginator);
|
|
2129
|
-
__classPrivateFieldGet(this, _subscription$1).add(paginator.page.pipe(map(
|
|
2126
|
+
__classPrivateFieldGet(this, _subscription$1).add(paginator.page.pipe(map(() => {
|
|
2127
|
+
__classPrivateFieldGet(this, _reload).next(false);
|
|
2128
|
+
})).subscribe());
|
|
2130
2129
|
}
|
|
2131
2130
|
}
|
|
2132
2131
|
set sort(sort) {
|
|
2133
2132
|
if (sort && __classPrivateFieldGet(this, _sort) !== sort) {
|
|
2134
2133
|
__classPrivateFieldSet(this, _sort, sort);
|
|
2135
|
-
__classPrivateFieldGet(this, _subscription$1).add(sort.sortChange.pipe(map(
|
|
2134
|
+
__classPrivateFieldGet(this, _subscription$1).add(sort.sortChange.pipe(map(() => {
|
|
2135
|
+
__classPrivateFieldGet(this, _reload).next(false);
|
|
2136
|
+
})).subscribe());
|
|
2136
2137
|
}
|
|
2137
2138
|
}
|
|
2138
2139
|
ngOnInit() {
|
|
2139
2140
|
__classPrivateFieldGet(this, _initCellDef).call(this);
|
|
2140
2141
|
}
|
|
2141
2142
|
ngAfterViewInit() {
|
|
2143
|
+
__classPrivateFieldGet(this, _subscription$1).add(__classPrivateFieldGet(this, _reload).pipe(startWith(true), debounceTime(200), switchMap(force => {
|
|
2144
|
+
const filterInfo = __classPrivateFieldGet(this, _getFilter).call(this);
|
|
2145
|
+
return __classPrivateFieldGet(this, _load$1).call(this, filterInfo, force);
|
|
2146
|
+
})).subscribe(__classPrivateFieldGet(this, _render)));
|
|
2142
2147
|
__classPrivateFieldGet(this, _subscription$1).add(this.sdCellDefs.changes.pipe(startWith([])).subscribe(__classPrivateFieldGet(this, _initCellDef)));
|
|
2143
2148
|
__classPrivateFieldGet(this, _subscription$1).add(this.sdFooterDefs.changes.pipe(startWith([])).subscribe(__classPrivateFieldGet(this, _initFooterDef)));
|
|
2144
2149
|
__classPrivateFieldGet(this, _subscription$1).add(this.sdFilterDefs.changes.pipe(startWith([])).subscribe(__classPrivateFieldGet(this, _initFilterDef)));
|
|
2145
|
-
|
|
2150
|
+
// this.#subscription.add(this.#optionChanges.pipe(
|
|
2151
|
+
// debounceTime(200),
|
|
2152
|
+
// startWith({}),
|
|
2153
|
+
// map(this.#getFilter),
|
|
2154
|
+
// switchMap(filterInfo => this.#load(filterInfo, true))
|
|
2155
|
+
// ).subscribe(this.#render));
|
|
2146
2156
|
this.ref.detectChanges();
|
|
2147
2157
|
}
|
|
2148
2158
|
ngOnDestroy() {
|