@sd-angular/core 1.3.22 → 1.3.23

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.
@@ -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, BehaviorSubject, isObservable } from 'rxjs';
8
+ import { Subject, BehaviorSubject, 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, map, debounceTime, filter, switchMap } from 'rxjs/operators';
11
+ import { startWith, filter, debounceTime, map, 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';
@@ -270,7 +270,7 @@ class SdGridFilter {
270
270
  _filterOptionChanges.set(this, new Subject());
271
271
  this.columns = [];
272
272
  this.filterDefs = [];
273
- this.filterChange = new Subject();
273
+ this.filterChange = new BehaviorSubject(false);
274
274
  this.filterDef = {};
275
275
  this.inlineFilterDef = {};
276
276
  this.columnFilter = {};
@@ -315,7 +315,7 @@ class SdGridFilter {
315
315
  }
316
316
  });
317
317
  this.onFilter = (item) => {
318
- this.filterChange.next();
318
+ this.filterChange.next(true);
319
319
  };
320
320
  this.open = () => {
321
321
  this.popupFilter.open({
@@ -343,7 +343,14 @@ class SdGridFilter {
343
343
  inlineFilterDef,
344
344
  selectedQuickFilter: null
345
345
  });
346
- this.filterChange.next();
346
+ console.log({
347
+ inlineColumn,
348
+ inlineExternal,
349
+ quickFilters: [],
350
+ inlineFilterDef,
351
+ selectedQuickFilter: null
352
+ });
353
+ this.filterChange.next(true);
347
354
  };
348
355
  this.onReset = () => {
349
356
  var _a;
@@ -361,7 +368,7 @@ class SdGridFilter {
361
368
  quickFilters: [],
362
369
  selectedQuickFilter: null
363
370
  });
364
- this.filterChange.next();
371
+ this.filterChange.next(true);
365
372
  this.ref.markForCheck();
366
373
  };
367
374
  this.onClearFilter = () => {
@@ -374,7 +381,7 @@ class SdGridFilter {
374
381
  quickFilters: [],
375
382
  selectedQuickFilter: null
376
383
  });
377
- this.filterChange.next();
384
+ this.filterChange.next(true);
378
385
  };
379
386
  this.setFilter = (args) => {
380
387
  var _a, _b, _c, _d;
@@ -408,8 +415,8 @@ class SdGridFilter {
408
415
  ngAfterViewInit() {
409
416
  __classPrivateFieldGet(this, _subscription).add(__classPrivateFieldGet(this, _filterOptionChanges).pipe(startWith(this.filter)).subscribe(() => {
410
417
  var _a, _b, _c;
411
- if (!((_a = this.filter) === null || _a === void 0 ? void 0 : _a.disabled)) {
412
- this.filterChange.next();
418
+ if ((_a = this.filter) === null || _a === void 0 ? void 0 : _a.disabled) {
419
+ this.filterChange.next(true);
413
420
  return;
414
421
  }
415
422
  this.externalFilters = ((_b = this.filter) === null || _b === void 0 ? void 0 : _b.externalFilters) || [];
@@ -418,7 +425,7 @@ class SdGridFilter {
418
425
  this.inlineExternal = configuration.inlineExternal;
419
426
  this.inlineFilterDef = configuration.inlineFilterDef;
420
427
  __classPrivateFieldGet(this, _loadDefault).call(this);
421
- this.filterChange.next();
428
+ this.filterChange.next(true);
422
429
  this.ref.markForCheck();
423
430
  }));
424
431
  }
@@ -1322,8 +1329,7 @@ class SdGridMaterial {
1322
1329
  // Subcription
1323
1330
  _subscription$1.set(this, new Subscription());
1324
1331
  _reload.set(this, new BehaviorSubject({
1325
- force: true,
1326
- source: 'INITIALIZE'
1332
+ force: true
1327
1333
  }));
1328
1334
  this.isExporting = false;
1329
1335
  this.isSelectAll = false;
@@ -2129,7 +2135,7 @@ class SdGridMaterial {
2129
2135
  set _gridFilter(gridFilter) {
2130
2136
  if (gridFilter && this.gridFilter !== gridFilter) {
2131
2137
  this.gridFilter = gridFilter;
2132
- __classPrivateFieldGet(this, _subscription$1).add(gridFilter.filterChange.pipe(map(() => {
2138
+ __classPrivateFieldGet(this, _subscription$1).add(gridFilter.filterChange.pipe(filter(reload => reload), debounceTime(500), map(() => {
2133
2139
  __classPrivateFieldGet(this, _paginator).pageIndex = 0;
2134
2140
  __classPrivateFieldGet(this, _reload).next({
2135
2141
  force: false,
@@ -2145,7 +2151,8 @@ class SdGridMaterial {
2145
2151
  this.gridOption = option;
2146
2152
  __classPrivateFieldSet(this, _loadCompleted, false);
2147
2153
  __classPrivateFieldGet(this, _reload).next({
2148
- force: true
2154
+ force: true,
2155
+ source: 'INITIALIZE'
2149
2156
  });
2150
2157
  (_a = option === null || option === void 0 ? void 0 : option.columns) === null || _a === void 0 ? void 0 : _a.forEach(col => {
2151
2158
  var _a;
@@ -2182,7 +2189,9 @@ class SdGridMaterial {
2182
2189
  __classPrivateFieldGet(this, _initCellDef).call(this);
2183
2190
  }
2184
2191
  ngAfterViewInit() {
2185
- __classPrivateFieldGet(this, _subscription$1).add(__classPrivateFieldGet(this, _reload).pipe(debounceTime(200), startWith(__classPrivateFieldGet(this, _reload).value), filter(data => {
2192
+ __classPrivateFieldGet(this, _subscription$1).add(__classPrivateFieldGet(this, _reload).pipe(debounceTime(200),
2193
+ // startWith(this.#reload.value),
2194
+ filter(data => {
2186
2195
  var _a, _b;
2187
2196
  if (__classPrivateFieldGet(this, _loadCompleted)) {
2188
2197
  return true;