@sd-angular/core 1.3.10 → 1.3.11
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 +46 -36
- 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 +29 -28
- package/fesm2015/sd-angular-core-grid-material.js +27 -26
- 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 +0 -1
- package/package.json +1 -1
- package/{sd-angular-core-1.3.10.tgz → sd-angular-core-1.3.11.tgz} +0 -0
|
@@ -1273,7 +1273,7 @@ SdEditorHandlerColumnPipe.ctorParameters = () => [
|
|
|
1273
1273
|
{ type: NgZone }
|
|
1274
1274
|
];
|
|
1275
1275
|
|
|
1276
|
-
var _paginator, _sort, _subscription$1,
|
|
1276
|
+
var _localItems, _paginator, _sort, _subscription$1, _reload, _loadCompleted, _initCellDef, _initFilterDef, _initFooterDef, _filterExportInfo, _initConfiguration, _filterLocal, _getFilter, _load$1, _render, _exportedItems, _allColumns, _allExportedColumns, _onExport, _updateSelectedItems;
|
|
1277
1277
|
class SdGridMaterial {
|
|
1278
1278
|
constructor(ref, configuration, gridConfigurationService, exportService, notifyService, translateService, columnValuesPipe, editorHandlerColumnPipe) {
|
|
1279
1279
|
this.ref = ref;
|
|
@@ -1285,7 +1285,7 @@ class SdGridMaterial {
|
|
|
1285
1285
|
this.columnValuesPipe = columnValuesPipe;
|
|
1286
1286
|
this.editorHandlerColumnPipe = editorHandlerColumnPipe;
|
|
1287
1287
|
this.key = v4();
|
|
1288
|
-
this
|
|
1288
|
+
_localItems.set(this, []);
|
|
1289
1289
|
this.items = [];
|
|
1290
1290
|
this.selectedItems = [];
|
|
1291
1291
|
// Loading
|
|
@@ -1309,11 +1309,11 @@ class SdGridMaterial {
|
|
|
1309
1309
|
this.columnFilter = {};
|
|
1310
1310
|
// Subcription
|
|
1311
1311
|
_subscription$1.set(this, new Subscription());
|
|
1312
|
-
_optionChanges.set(this, new EventEmitter());
|
|
1313
1312
|
_reload.set(this, new Subject());
|
|
1314
1313
|
this.isExporting = false;
|
|
1315
1314
|
this.isSelectAll = false;
|
|
1316
1315
|
this.exportTitle = 'Export';
|
|
1316
|
+
_loadCompleted.set(this, false);
|
|
1317
1317
|
_initCellDef.set(this, () => {
|
|
1318
1318
|
this.cellDef = {};
|
|
1319
1319
|
for (const cellDef of this.sdCellDefs) {
|
|
@@ -1497,13 +1497,13 @@ class SdGridMaterial {
|
|
|
1497
1497
|
if (force) {
|
|
1498
1498
|
const results = this.gridOption.items();
|
|
1499
1499
|
if (results instanceof Promise) {
|
|
1500
|
-
this
|
|
1500
|
+
__classPrivateFieldSet(this, _localItems, yield results);
|
|
1501
1501
|
}
|
|
1502
1502
|
else {
|
|
1503
|
-
this
|
|
1503
|
+
__classPrivateFieldSet(this, _localItems, results);
|
|
1504
1504
|
}
|
|
1505
1505
|
}
|
|
1506
|
-
return __classPrivateFieldGet(this, _filterLocal).call(this, this
|
|
1506
|
+
return __classPrivateFieldGet(this, _filterLocal).call(this, __classPrivateFieldGet(this, _localItems), filterReq);
|
|
1507
1507
|
}
|
|
1508
1508
|
}
|
|
1509
1509
|
catch (error) {
|
|
@@ -1925,7 +1925,7 @@ class SdGridMaterial {
|
|
|
1925
1925
|
}
|
|
1926
1926
|
});
|
|
1927
1927
|
if (type === 'local') {
|
|
1928
|
-
(_a = editor.onAdd) === null || _a === void 0 ? void 0 : _a.call(editor, item, this
|
|
1928
|
+
(_a = editor.onAdd) === null || _a === void 0 ? void 0 : _a.call(editor, item, __classPrivateFieldGet(this, _localItems));
|
|
1929
1929
|
}
|
|
1930
1930
|
else {
|
|
1931
1931
|
(_b = editor.onAdd) === null || _b === void 0 ? void 0 : _b.call(editor, item, this.items);
|
|
@@ -1934,13 +1934,13 @@ class SdGridMaterial {
|
|
|
1934
1934
|
if (editor.type !== 'popup') {
|
|
1935
1935
|
if (editor.addToLast) {
|
|
1936
1936
|
if (type === 'local') {
|
|
1937
|
-
this
|
|
1937
|
+
__classPrivateFieldSet(this, _localItems, [...__classPrivateFieldGet(this, _localItems), item]);
|
|
1938
1938
|
}
|
|
1939
1939
|
this.items = [...this.items, item];
|
|
1940
1940
|
}
|
|
1941
1941
|
else {
|
|
1942
1942
|
if (type === 'local') {
|
|
1943
|
-
this
|
|
1943
|
+
__classPrivateFieldSet(this, _localItems, [item, ...__classPrivateFieldGet(this, _localItems)]);
|
|
1944
1944
|
}
|
|
1945
1945
|
this.items = [item, ...this.items];
|
|
1946
1946
|
}
|
|
@@ -2010,15 +2010,15 @@ class SdGridMaterial {
|
|
|
2010
2010
|
const { editor } = this.gridOption;
|
|
2011
2011
|
if (editor.type === 'inline') {
|
|
2012
2012
|
if (this.gridOption.type === 'local') {
|
|
2013
|
-
const idx2 = this.
|
|
2014
|
-
this.
|
|
2015
|
-
this
|
|
2013
|
+
const idx2 = __classPrivateFieldGet(this, _localItems).indexOf(item);
|
|
2014
|
+
__classPrivateFieldGet(this, _localItems).splice(idx2, 1);
|
|
2015
|
+
__classPrivateFieldSet(this, _localItems, [...__classPrivateFieldGet(this, _localItems)]);
|
|
2016
2016
|
}
|
|
2017
2017
|
const idx1 = this.items.indexOf(item);
|
|
2018
2018
|
this.items.splice(idx1, 1);
|
|
2019
2019
|
this.items = [...this.items];
|
|
2020
2020
|
if (this.gridOption.type === 'local') {
|
|
2021
|
-
(_a = editor === null || editor === void 0 ? void 0 : editor.onCancel) === null || _a === void 0 ? void 0 : _a.call(editor, item, this
|
|
2021
|
+
(_a = editor === null || editor === void 0 ? void 0 : editor.onCancel) === null || _a === void 0 ? void 0 : _a.call(editor, item, __classPrivateFieldGet(this, _localItems));
|
|
2022
2022
|
}
|
|
2023
2023
|
else {
|
|
2024
2024
|
(_b = editor === null || editor === void 0 ? void 0 : editor.onCancel) === null || _b === void 0 ? void 0 : _b.call(editor, item, this.items);
|
|
@@ -2029,9 +2029,9 @@ class SdGridMaterial {
|
|
|
2029
2029
|
if (editor.type === 'focus') {
|
|
2030
2030
|
if (item.editorStatus === 'create') {
|
|
2031
2031
|
if (this.gridOption.type === 'local') {
|
|
2032
|
-
const idx2 = this.
|
|
2033
|
-
this.
|
|
2034
|
-
this
|
|
2032
|
+
const idx2 = __classPrivateFieldGet(this, _localItems).indexOf(item);
|
|
2033
|
+
__classPrivateFieldGet(this, _localItems).splice(idx2, 1);
|
|
2034
|
+
__classPrivateFieldSet(this, _localItems, [...__classPrivateFieldGet(this, _localItems)]);
|
|
2035
2035
|
}
|
|
2036
2036
|
const idx1 = this.items.indexOf(item);
|
|
2037
2037
|
this.items.splice(idx1, 1);
|
|
@@ -2049,15 +2049,15 @@ class SdGridMaterial {
|
|
|
2049
2049
|
const { editor } = this.gridOption;
|
|
2050
2050
|
if (editor.type === 'inline') {
|
|
2051
2051
|
if (this.gridOption.type === 'local') {
|
|
2052
|
-
const idx2 = this.
|
|
2053
|
-
this.
|
|
2054
|
-
this
|
|
2052
|
+
const idx2 = __classPrivateFieldGet(this, _localItems).indexOf(item);
|
|
2053
|
+
__classPrivateFieldGet(this, _localItems).splice(idx2, 1);
|
|
2054
|
+
__classPrivateFieldSet(this, _localItems, [...__classPrivateFieldGet(this, _localItems)]);
|
|
2055
2055
|
}
|
|
2056
2056
|
const idx1 = this.items.indexOf(item);
|
|
2057
2057
|
this.items.splice(idx1, 1);
|
|
2058
2058
|
this.items = [...this.items];
|
|
2059
2059
|
if (this.gridOption.type === 'local') {
|
|
2060
|
-
(_a = editor === null || editor === void 0 ? void 0 : editor.onRemove) === null || _a === void 0 ? void 0 : _a.call(editor, item, this
|
|
2060
|
+
(_a = editor === null || editor === void 0 ? void 0 : editor.onRemove) === null || _a === void 0 ? void 0 : _a.call(editor, item, __classPrivateFieldGet(this, _localItems));
|
|
2061
2061
|
}
|
|
2062
2062
|
else {
|
|
2063
2063
|
(_b = editor === null || editor === void 0 ? void 0 : editor.onRemove) === null || _b === void 0 ? void 0 : _b.call(editor, item, this.items);
|
|
@@ -2096,7 +2096,6 @@ class SdGridMaterial {
|
|
|
2096
2096
|
set _gridFilter(gridFilter) {
|
|
2097
2097
|
if (gridFilter && this.gridFilter !== gridFilter) {
|
|
2098
2098
|
this.gridFilter = gridFilter;
|
|
2099
|
-
__classPrivateFieldGet(this, _reload).next(false);
|
|
2100
2099
|
__classPrivateFieldGet(this, _subscription$1).add(gridFilter.filterChange.pipe(map(() => {
|
|
2101
2100
|
__classPrivateFieldGet(this, _paginator).pageIndex = 0;
|
|
2102
2101
|
__classPrivateFieldGet(this, _reload).next(false);
|
|
@@ -2108,6 +2107,7 @@ class SdGridMaterial {
|
|
|
2108
2107
|
if (option) {
|
|
2109
2108
|
option = __classPrivateFieldGet(this, _initConfiguration).call(this, option);
|
|
2110
2109
|
this.gridOption = option;
|
|
2110
|
+
__classPrivateFieldSet(this, _loadCompleted, false);
|
|
2111
2111
|
__classPrivateFieldGet(this, _reload).next(true);
|
|
2112
2112
|
(_a = option === null || option === void 0 ? void 0 : option.columns) === null || _a === void 0 ? void 0 : _a.forEach(col => {
|
|
2113
2113
|
var _a;
|
|
@@ -2140,11 +2140,12 @@ class SdGridMaterial {
|
|
|
2140
2140
|
__classPrivateFieldGet(this, _initCellDef).call(this);
|
|
2141
2141
|
}
|
|
2142
2142
|
ngAfterViewInit() {
|
|
2143
|
-
__classPrivateFieldGet(this, _subscription$1).add(__classPrivateFieldGet(this, _reload).pipe(debounceTime(200), startWith(true), switchMap(force => {
|
|
2144
|
-
console.log('FORCE', force);
|
|
2143
|
+
__classPrivateFieldGet(this, _subscription$1).add(__classPrivateFieldGet(this, _reload).pipe(debounceTime(200), startWith(true), switchMap((force) => __awaiter(this, void 0, void 0, function* () {
|
|
2145
2144
|
const filterInfo = __classPrivateFieldGet(this, _getFilter).call(this);
|
|
2146
|
-
|
|
2147
|
-
|
|
2145
|
+
const result = yield __classPrivateFieldGet(this, _load$1).call(this, filterInfo, !__classPrivateFieldGet(this, _loadCompleted) || force);
|
|
2146
|
+
__classPrivateFieldSet(this, _loadCompleted, true);
|
|
2147
|
+
return result;
|
|
2148
|
+
}))).subscribe(__classPrivateFieldGet(this, _render)));
|
|
2148
2149
|
__classPrivateFieldGet(this, _subscription$1).add(this.sdCellDefs.changes.pipe(startWith([])).subscribe(__classPrivateFieldGet(this, _initCellDef)));
|
|
2149
2150
|
__classPrivateFieldGet(this, _subscription$1).add(this.sdFooterDefs.changes.pipe(startWith([])).subscribe(__classPrivateFieldGet(this, _initFooterDef)));
|
|
2150
2151
|
__classPrivateFieldGet(this, _subscription$1).add(this.sdFilterDefs.changes.pipe(startWith([])).subscribe(__classPrivateFieldGet(this, _initFilterDef)));
|
|
@@ -2186,7 +2187,7 @@ class SdGridMaterial {
|
|
|
2186
2187
|
return this.items.some(e => e.editorStatus !== undefined);
|
|
2187
2188
|
}
|
|
2188
2189
|
}
|
|
2189
|
-
_paginator = new WeakMap(), _sort = new WeakMap(), _subscription$1 = new WeakMap(),
|
|
2190
|
+
_localItems = new WeakMap(), _paginator = new WeakMap(), _sort = new WeakMap(), _subscription$1 = new WeakMap(), _reload = new WeakMap(), _loadCompleted = new WeakMap(), _initCellDef = new WeakMap(), _initFilterDef = new WeakMap(), _initFooterDef = new WeakMap(), _filterExportInfo = new WeakMap(), _initConfiguration = new WeakMap(), _filterLocal = new WeakMap(), _getFilter = new WeakMap(), _load$1 = new WeakMap(), _render = new WeakMap(), _exportedItems = new WeakMap(), _allColumns = new WeakMap(), _allExportedColumns = new WeakMap(), _onExport = new WeakMap(), _updateSelectedItems = new WeakMap();
|
|
2190
2191
|
SdGridMaterial.decorators = [
|
|
2191
2192
|
{ type: Component, args: [{
|
|
2192
2193
|
selector: 'sd-grid-material',
|