@sd-angular/core 1.3.92 → 1.3.94

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.
Files changed (33) hide show
  1. package/bundles/sd-angular-core-grid-material.umd.js +424 -362
  2. package/bundles/sd-angular-core-grid-material.umd.js.map +1 -1
  3. package/bundles/sd-angular-core-grid-material.umd.min.js +2 -2
  4. package/bundles/sd-angular-core-grid-material.umd.min.js.map +1 -1
  5. package/esm2015/grid-material/sd-angular-core-grid-material.js +6 -6
  6. package/esm2015/grid-material/src/lib/components/grid-filter/grid-filter.component.js +67 -136
  7. package/esm2015/grid-material/src/lib/components/popup-filter/popup-filter.component.js +58 -23
  8. package/esm2015/grid-material/src/lib/grid-material.component.js +76 -65
  9. package/esm2015/grid-material/src/lib/grid-material.module.js +2 -2
  10. package/esm2015/grid-material/src/lib/models/grid-export.model.js +1 -1
  11. package/esm2015/grid-material/src/lib/models/grid-option.model.js +1 -1
  12. package/esm2015/grid-material/src/lib/pipes/filter-external.pipe.js +1 -1
  13. package/esm2015/grid-material/src/lib/services/grid-filter/grid-filter.model.js +3 -0
  14. package/esm2015/grid-material/src/lib/services/grid-filter/grid-filter.service.js +166 -0
  15. package/esm2015/grid-material/src/public-api.js +1 -1
  16. package/fesm2015/sd-angular-core-grid-material.js +381 -304
  17. package/fesm2015/sd-angular-core-grid-material.js.map +1 -1
  18. package/grid-material/sd-angular-core-grid-material.d.ts +5 -5
  19. package/grid-material/sd-angular-core-grid-material.metadata.json +1 -1
  20. package/grid-material/src/lib/components/grid-filter/grid-filter.component.d.ts +5 -25
  21. package/grid-material/src/lib/components/popup-filter/popup-filter.component.d.ts +7 -31
  22. package/grid-material/src/lib/grid-material.component.d.ts +6 -6
  23. package/grid-material/src/lib/models/grid-export.model.d.ts +1 -1
  24. package/grid-material/src/lib/models/grid-option.model.d.ts +1 -1
  25. package/grid-material/src/lib/pipes/filter-external.pipe.d.ts +1 -1
  26. package/grid-material/src/lib/{models → services/grid-filter}/grid-filter.model.d.ts +14 -9
  27. package/grid-material/src/lib/services/grid-filter/grid-filter.service.d.ts +16 -0
  28. package/grid-material/src/public-api.d.ts +1 -1
  29. package/package.json +1 -1
  30. package/{sd-angular-core-1.3.92.tgz → sd-angular-core-1.3.94.tgz} +0 -0
  31. package/esm2015/grid-material/src/lib/models/grid-filter.model.js +0 -3
  32. package/esm2015/grid-material/src/lib/services/grid-filter.service.js +0 -65
  33. package/grid-material/src/lib/services/grid-filter.service.d.ts +0 -9
@@ -1,8 +1,8 @@
1
1
  (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@sd-angular/core/common'), require('@angular/core'), require('@angular/material/paginator'), require('@angular/material/sort'), require('@angular/animations'), require('uuid'), require('rxjs'), require('@sd-angular/core/notify'), require('@angular/cdk/drag-drop'), require('rxjs/operators'), require('object-hash'), require('@sd-angular/core/setting'), require('ngx-device-detector'), require('@sd-angular/core/loading'), require('@sd-angular/core/translate'), require('@sd-angular/core/export'), require('@angular/forms'), require('@sd-angular/core/quick-action'), require('@angular/common'), require('@angular/material/form-field'), require('@angular/material/icon'), require('@angular/material/input'), require('@angular/material/table'), require('@angular/material/progress-spinner'), require('@angular/cdk/table'), require('@angular/cdk/scrolling'), require('@angular/material/menu'), require('@angular/material/slider'), require('@angular/material/button'), require('@sd-angular/core/service'), require('@angular/material/tooltip'), require('@angular/material/chips'), require('@angular/material/radio'), require('@angular/material/slide-toggle'), require('@sd-angular/core/form'), require('@angular/material/checkbox'), require('@angular/material/list'), require('@angular/material/divider'), require('@sd-angular/core/side-drawer'), require('@sd-angular/core/utility'), require('@sd-angular/core/group')) :
3
- typeof define === 'function' && define.amd ? define('@sd-angular/core/grid-material', ['exports', '@sd-angular/core/common', '@angular/core', '@angular/material/paginator', '@angular/material/sort', '@angular/animations', 'uuid', 'rxjs', '@sd-angular/core/notify', '@angular/cdk/drag-drop', 'rxjs/operators', 'object-hash', '@sd-angular/core/setting', 'ngx-device-detector', '@sd-angular/core/loading', '@sd-angular/core/translate', '@sd-angular/core/export', '@angular/forms', '@sd-angular/core/quick-action', '@angular/common', '@angular/material/form-field', '@angular/material/icon', '@angular/material/input', '@angular/material/table', '@angular/material/progress-spinner', '@angular/cdk/table', '@angular/cdk/scrolling', '@angular/material/menu', '@angular/material/slider', '@angular/material/button', '@sd-angular/core/service', '@angular/material/tooltip', '@angular/material/chips', '@angular/material/radio', '@angular/material/slide-toggle', '@sd-angular/core/form', '@angular/material/checkbox', '@angular/material/list', '@angular/material/divider', '@sd-angular/core/side-drawer', '@sd-angular/core/utility', '@sd-angular/core/group'], factory) :
4
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global['sd-angular'] = global['sd-angular'] || {}, global['sd-angular'].core = global['sd-angular'].core || {}, global['sd-angular'].core['grid-material'] = {}), global['sd-angular'].core.common, global.ng.core, global.ng.material.paginator, global.ng.material.sort, global.ng.animations, global.uuid, global.rxjs, global['sd-angular'].core.notify, global.ng.cdk.dragDrop, global.rxjs.operators, global['object-hash'], global['sd-angular'].core.setting, global['ngx-device-detector'], global['sd-angular'].core.loading, global['sd-angular'].core.translate, global['sd-angular'].core.export, global.ng.forms, global['sd-angular'].core['quick-action'], global.ng.common, global.ng.material.formField, global.ng.material.icon, global.ng.material.input, global.ng.material.table, global.ng.material.progressSpinner, global.ng.cdk.table, global.ng.cdk.scrolling, global.ng.material.menu, global.ng.material.slider, global.ng.material.button, global['sd-angular'].core.service, global.ng.material.tooltip, global.ng.material.chips, global.ng.material.radio, global.ng.material.slideToggle, global['sd-angular'].core.form, global.ng.material.checkbox, global.ng.material.list, global.ng.material.divider, global['sd-angular'].core['side-drawer'], global['sd-angular'].core.utility, global['sd-angular'].core.group));
5
- }(this, (function (exports, common, core, paginator, sort, animations, uuid, rxjs, notify, dragDrop, operators, hash, setting, ngxDeviceDetector, loading, translate, _export, forms, quickAction, common$1, formField, icon, input, table, progressSpinner, table$1, scrolling, menu, slider, button, service, tooltip, chips, radio, slideToggle, form, checkbox, list, divider, sideDrawer, utility, group) { 'use strict';
2
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@sd-angular/core/common'), require('@angular/core'), require('@angular/material/paginator'), require('@angular/material/sort'), require('@angular/animations'), require('uuid'), require('rxjs'), require('@sd-angular/core/notify'), require('@angular/cdk/drag-drop'), require('rxjs/operators'), require('ngx-device-detector'), require('@sd-angular/core/loading'), require('@sd-angular/core/translate'), require('object-hash'), require('@sd-angular/core/export'), require('@angular/forms'), require('@sd-angular/core/setting'), require('@sd-angular/core/quick-action'), require('@angular/common'), require('@angular/material/form-field'), require('@angular/material/icon'), require('@angular/material/input'), require('@angular/material/table'), require('@angular/material/progress-spinner'), require('@angular/cdk/table'), require('@angular/cdk/scrolling'), require('@angular/material/menu'), require('@angular/material/slider'), require('@angular/material/button'), require('@sd-angular/core/service'), require('@angular/material/tooltip'), require('@angular/material/chips'), require('@angular/material/radio'), require('@angular/material/slide-toggle'), require('@sd-angular/core/form'), require('@angular/material/checkbox'), require('@angular/material/list'), require('@angular/material/divider'), require('@sd-angular/core/side-drawer'), require('@sd-angular/core/utility'), require('@sd-angular/core/group')) :
3
+ typeof define === 'function' && define.amd ? define('@sd-angular/core/grid-material', ['exports', '@sd-angular/core/common', '@angular/core', '@angular/material/paginator', '@angular/material/sort', '@angular/animations', 'uuid', 'rxjs', '@sd-angular/core/notify', '@angular/cdk/drag-drop', 'rxjs/operators', 'ngx-device-detector', '@sd-angular/core/loading', '@sd-angular/core/translate', 'object-hash', '@sd-angular/core/export', '@angular/forms', '@sd-angular/core/setting', '@sd-angular/core/quick-action', '@angular/common', '@angular/material/form-field', '@angular/material/icon', '@angular/material/input', '@angular/material/table', '@angular/material/progress-spinner', '@angular/cdk/table', '@angular/cdk/scrolling', '@angular/material/menu', '@angular/material/slider', '@angular/material/button', '@sd-angular/core/service', '@angular/material/tooltip', '@angular/material/chips', '@angular/material/radio', '@angular/material/slide-toggle', '@sd-angular/core/form', '@angular/material/checkbox', '@angular/material/list', '@angular/material/divider', '@sd-angular/core/side-drawer', '@sd-angular/core/utility', '@sd-angular/core/group'], factory) :
4
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global['sd-angular'] = global['sd-angular'] || {}, global['sd-angular'].core = global['sd-angular'].core || {}, global['sd-angular'].core['grid-material'] = {}), global['sd-angular'].core.common, global.ng.core, global.ng.material.paginator, global.ng.material.sort, global.ng.animations, global.uuid, global.rxjs, global['sd-angular'].core.notify, global.ng.cdk.dragDrop, global.rxjs.operators, global['ngx-device-detector'], global['sd-angular'].core.loading, global['sd-angular'].core.translate, global['object-hash'], global['sd-angular'].core.export, global.ng.forms, global['sd-angular'].core.setting, global['sd-angular'].core['quick-action'], global.ng.common, global.ng.material.formField, global.ng.material.icon, global.ng.material.input, global.ng.material.table, global.ng.material.progressSpinner, global.ng.cdk.table, global.ng.cdk.scrolling, global.ng.material.menu, global.ng.material.slider, global.ng.material.button, global['sd-angular'].core.service, global.ng.material.tooltip, global.ng.material.chips, global.ng.material.radio, global.ng.material.slideToggle, global['sd-angular'].core.form, global.ng.material.checkbox, global.ng.material.list, global.ng.material.divider, global['sd-angular'].core['side-drawer'], global['sd-angular'].core.utility, global['sd-angular'].core.group));
5
+ }(this, (function (exports, common, core, paginator, sort, animations, uuid, rxjs, notify, dragDrop, operators, ngxDeviceDetector, loading, translate, hash, _export, forms, setting, quickAction, common$1, formField, icon, input, table, progressSpinner, table$1, scrolling, menu, slider, button, service, tooltip, chips, radio, slideToggle, form, checkbox, list, divider, sideDrawer, utility, group) { 'use strict';
6
6
 
7
7
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
8
8
 
@@ -426,10 +426,12 @@
426
426
  };
427
427
  var GRID_MATERIAL_CONFIG = new core.InjectionToken('sd-grid-material.configuration');
428
428
 
429
+ var _filterRegister, _subscription;
429
430
  var SdPopupFilter = /** @class */ (function () {
430
431
  function SdPopupFilter(cdRef) {
431
432
  var _this = this;
432
433
  this.cdRef = cdRef;
434
+ _filterRegister.set(this, void 0);
433
435
  this.externalFilters = [];
434
436
  this.externalFilter = {};
435
437
  this.inlineExternal = {};
@@ -439,16 +441,8 @@
439
441
  this.filterDefs = [];
440
442
  this.filterDef = {};
441
443
  this.inlineFilterDef = {};
442
- this.changeFilter = new core.EventEmitter();
443
- this.clearFilter = new core.EventEmitter();
444
- this.open = function (args) {
445
- var inlineColumn = args.inlineColumn, columnFilter = args.columnFilter, inlineExternal = args.inlineExternal, externalFilter = args.externalFilter, inlineFilterDef = args.inlineFilterDef, filterDef = args.filterDef;
446
- _this.inlineColumn = JSON.parse(JSON.stringify(inlineColumn || {}));
447
- _this.columnFilter = JSON.parse(JSON.stringify(columnFilter || {}));
448
- _this.inlineExternal = JSON.parse(JSON.stringify(inlineExternal || {}));
449
- _this.externalFilter = JSON.parse(JSON.stringify(externalFilter || {}));
450
- _this.inlineFilterDef = JSON.parse(JSON.stringify(inlineFilterDef || {}));
451
- _this.filterDef = JSON.parse(JSON.stringify(filterDef || {}));
444
+ _subscription.set(this, new rxjs.Subscription());
445
+ this.open = function () {
452
446
  _this.modal.open();
453
447
  _this.cdRef.markForCheck();
454
448
  };
@@ -457,25 +451,70 @@
457
451
  _this.cdRef.markForCheck();
458
452
  };
459
453
  this.onApply = function () {
460
- _this.changeFilter.emit({
461
- inlineColumn: _this.inlineColumn || {},
462
- columnFilter: _this.columnFilter || {},
463
- inlineExternal: _this.inlineExternal || {},
464
- externalFilter: _this.externalFilter || {},
465
- inlineFilterDef: _this.inlineFilterDef || {},
466
- filterDef: _this.filterDef || {}
454
+ _this.filterRegister.set({
455
+ inlineColumn: _this.inlineColumn,
456
+ columnFilter: _this.columnFilter,
457
+ inlineExternal: _this.inlineExternal,
458
+ externalFilter: _this.externalFilter,
459
+ inlineFilterDef: _this.inlineFilterDef,
460
+ filterDef: _this.filterDef
467
461
  });
462
+ // this.changeFilter.emit({
463
+ // inlineColumn: this.inlineColumn || {},
464
+ // columnFilter: this.columnFilter || {},
465
+ // inlineExternal: this.inlineExternal || {},
466
+ // externalFilter: this.externalFilter || {},
467
+ // inlineFilterDef: this.inlineFilterDef || {},
468
+ // filterDef: this.filterDef || {}
469
+ // });
468
470
  _this.modal.close();
469
471
  _this.cdRef.markForCheck();
470
472
  };
471
473
  }
474
+ Object.defineProperty(SdPopupFilter.prototype, "filterRegister", {
475
+ set: function (value) {
476
+ __classPrivateFieldSet(this, _filterRegister, value);
477
+ },
478
+ enumerable: false,
479
+ configurable: true
480
+ });
481
+ ;
482
+ SdPopupFilter.prototype.ngAfterViewInit = function () {
483
+ var _this = this;
484
+ // this.#subscription.add(this.#filterOptionChanges.pipe(startWith(this.filter)).subscribe(() => {
485
+ // if (this.filter?.disabled) {
486
+ // this.filterChange.next(true);
487
+ // return;
488
+ // }
489
+ // this.externalFilters = this.filter?.externalFilters || [];
490
+ // const configuration = this.gridFilterService.get(this.filter?.key);
491
+ // this.inlineColumn = configuration.inlineColumn;
492
+ // this.inlineExternal = configuration.inlineExternal;
493
+ // this.inlineFilterDef = configuration.inlineFilterDef;
494
+ // this.#loadDefault();
495
+ // this.filterChange.next(true);
496
+ // this.ref.markForCheck();
497
+ // }));
498
+ __classPrivateFieldGet(this, _subscription).add(__classPrivateFieldGet(this, _filterRegister).observer.subscribe(function (configuration) {
499
+ _this.inlineColumn = JSON.parse(JSON.stringify(configuration.inlineColumn));
500
+ _this.columnFilter = JSON.parse(JSON.stringify(configuration.columnFilter));
501
+ _this.inlineExternal = JSON.parse(JSON.stringify(configuration.inlineExternal));
502
+ _this.externalFilter = JSON.parse(JSON.stringify(configuration.externalFilter));
503
+ _this.inlineFilterDef = JSON.parse(JSON.stringify(configuration.inlineFilterDef));
504
+ _this.filterDef = JSON.parse(JSON.stringify(configuration.filterDef));
505
+ }));
506
+ };
507
+ SdPopupFilter.prototype.ngOnDestroy = function () {
508
+ __classPrivateFieldGet(this, _subscription).unsubscribe();
509
+ };
472
510
  SdPopupFilter.prototype.onClear = function () {
473
- this.clearFilter.emit();
511
+ this.filterRegister.remove();
474
512
  this.modal.close();
475
513
  this.cdRef.markForCheck();
476
514
  };
477
515
  return SdPopupFilter;
478
516
  }());
517
+ _filterRegister = new WeakMap(), _subscription = new WeakMap();
479
518
  SdPopupFilter.decorators = [
480
519
  { type: core.Component, args: [{
481
520
  selector: 'sd-popup-filter',
@@ -489,87 +528,22 @@
489
528
  ]; };
490
529
  SdPopupFilter.propDecorators = {
491
530
  modal: [{ type: core.ViewChild, args: ['modal',] }],
531
+ filterRegister: [{ type: core.Input }],
492
532
  externalFilters: [{ type: core.Input }],
493
533
  columns: [{ type: core.Input }],
494
- filterDefs: [{ type: core.Input }],
495
- changeFilter: [{ type: core.Output }],
496
- clearFilter: [{ type: core.Output }]
534
+ filterDefs: [{ type: core.Input }]
497
535
  };
498
536
 
499
- var _prefix;
500
- var SdGridFilterService = /** @class */ (function () {
501
- function SdGridFilterService(settingService) {
502
- var _this = this;
503
- this.settingService = settingService;
504
- _prefix.set(this, '61d22e8e-eee8-4aad-8e1c-044a532fea91');
505
- this.get = function (key) {
506
- var _a;
507
- if (!key) {
508
- return {
509
- selectedQuickFilter: null,
510
- quickFilters: [],
511
- inlineExternal: {},
512
- inlineColumn: {},
513
- inlineFilterDef: {}
514
- };
515
- }
516
- var get = _this.settingService.create({
517
- prefix: __classPrivateFieldGet(_this, _prefix),
518
- key: key
519
- }).get;
520
- var configuration = get();
521
- return {
522
- selectedQuickFilter: (_a = configuration === null || configuration === void 0 ? void 0 : configuration.selectedQuickFilter) !== null && _a !== void 0 ? _a : null,
523
- quickFilters: (configuration === null || configuration === void 0 ? void 0 : configuration.quickFilters) || [],
524
- inlineExternal: (configuration === null || configuration === void 0 ? void 0 : configuration.inlineExternal) || {},
525
- inlineColumn: (configuration === null || configuration === void 0 ? void 0 : configuration.inlineColumn) || {},
526
- inlineFilterDef: (configuration === null || configuration === void 0 ? void 0 : configuration.inlineFilterDef) || {},
527
- };
528
- };
529
- this.set = function (key, configuration) {
530
- configuration = {
531
- selectedQuickFilter: (configuration === null || configuration === void 0 ? void 0 : configuration.selectedQuickFilter) || null,
532
- quickFilters: (configuration === null || configuration === void 0 ? void 0 : configuration.quickFilters) || [],
533
- inlineExternal: configuration.inlineExternal || {},
534
- inlineColumn: configuration.inlineColumn || {},
535
- inlineFilterDef: configuration.inlineFilterDef || {}
536
- };
537
- if (!key) {
538
- return configuration;
539
- }
540
- var set = _this.settingService.create({
541
- prefix: __classPrivateFieldGet(_this, _prefix),
542
- key: key
543
- }).set;
544
- key = hash__default['default']({
545
- prefix: __classPrivateFieldGet(_this, _prefix),
546
- key: key
547
- });
548
- set(configuration);
549
- return configuration;
550
- };
551
- }
552
- return SdGridFilterService;
553
- }());
554
- _prefix = new WeakMap();
555
- SdGridFilterService.decorators = [
556
- { type: core.Injectable }
557
- ];
558
- SdGridFilterService.ctorParameters = function () { return [
559
- { type: setting.SdSettingService }
560
- ]; };
561
-
562
- var _filterOptionChanges, _subscription, _loadDefault, _clearFilter;
537
+ var _filterOptionChanges, _subscription$1;
563
538
  var SdGridFilter = /** @class */ (function () {
564
- function SdGridFilter(ref, deviceService, gridFilterService) {
539
+ function SdGridFilter(ref, deviceService) {
565
540
  var _this = this;
566
541
  this.ref = ref;
567
542
  this.deviceService = deviceService;
568
- this.gridFilterService = gridFilterService;
569
543
  _filterOptionChanges.set(this, new rxjs.Subject());
570
544
  this.columns = [];
571
545
  this.filterDefs = [];
572
- this.filterChange = new rxjs.BehaviorSubject(false);
546
+ this.filterRegisterChange = new rxjs.BehaviorSubject(null);
573
547
  this.filterDef = {};
574
548
  this.inlineFilterDef = {};
575
549
  this.columnFilter = {};
@@ -577,178 +551,20 @@
577
551
  this.externalFilters = [];
578
552
  this.externalFilter = {};
579
553
  this.inlineExternal = {};
580
- _subscription.set(this, new rxjs.Subscription());
581
- _loadDefault.set(this, function () {
582
- var e_1, _r, e_2, _s, e_3, _t;
583
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
584
- try {
585
- for (var _u = __values(_this.columns), _v = _u.next(); !_v.done; _v = _u.next()) {
586
- var column = _v.value;
587
- _this.inlineColumn[column.field] = (_a = _this.inlineColumn[column.field]) !== null && _a !== void 0 ? _a : (_b = column === null || column === void 0 ? void 0 : column.filter) === null || _b === void 0 ? void 0 : _b.defaultShowing;
588
- _this.columnFilter[column.field] = (_c = _this.columnFilter[column.field]) !== null && _c !== void 0 ? _c : (_d = column === null || column === void 0 ? void 0 : column.filter) === null || _d === void 0 ? void 0 : _d.default;
589
- }
590
- }
591
- catch (e_1_1) { e_1 = { error: e_1_1 }; }
592
- finally {
593
- try {
594
- if (_v && !_v.done && (_r = _u.return)) _r.call(_u);
595
- }
596
- finally { if (e_1) throw e_1.error; }
597
- }
598
- try {
599
- for (var _w = __values(_this.externalFilters), _x = _w.next(); !_x.done; _x = _w.next()) {
600
- var externalFilter = _x.value;
601
- _this.inlineExternal[externalFilter.field] = (_e = _this.inlineExternal[externalFilter.field]) !== null && _e !== void 0 ? _e : externalFilter === null || externalFilter === void 0 ? void 0 : externalFilter.defaultShowing;
602
- if (externalFilter.type === 'daterange') {
603
- _this.externalFilter[externalFilter.field] = {
604
- from: (_j = (_g = (_f = _this.externalFilter[externalFilter.field]) === null || _f === void 0 ? void 0 : _f.from) !== null && _g !== void 0 ? _g : (_h = externalFilter.default) === null || _h === void 0 ? void 0 : _h.from) !== null && _j !== void 0 ? _j : undefined,
605
- to: (_o = (_l = (_k = _this.externalFilter[externalFilter.field]) === null || _k === void 0 ? void 0 : _k.to) !== null && _l !== void 0 ? _l : (_m = externalFilter.default) === null || _m === void 0 ? void 0 : _m.to) !== null && _o !== void 0 ? _o : undefined
606
- };
607
- }
608
- else {
609
- _this.externalFilter[externalFilter.field] = (_p = _this.externalFilter[externalFilter.field]) !== null && _p !== void 0 ? _p : externalFilter.default;
610
- }
611
- }
612
- }
613
- catch (e_2_1) { e_2 = { error: e_2_1 }; }
614
- finally {
615
- try {
616
- if (_x && !_x.done && (_s = _w.return)) _s.call(_w);
617
- }
618
- finally { if (e_2) throw e_2.error; }
619
- }
620
- try {
621
- for (var _y = __values(_this.filterDefs), _z = _y.next(); !_z.done; _z = _y.next()) {
622
- var filterDef = _z.value;
623
- _this.inlineFilterDef[filterDef.sdMaterialFilterDef] = (_q = _this.inlineFilterDef[filterDef.sdMaterialFilterDef]) !== null && _q !== void 0 ? _q : filterDef === null || filterDef === void 0 ? void 0 : filterDef.defaultShowing;
624
- }
625
- }
626
- catch (e_3_1) { e_3 = { error: e_3_1 }; }
627
- finally {
628
- try {
629
- if (_z && !_z.done && (_t = _y.return)) _t.call(_y);
630
- }
631
- finally { if (e_3) throw e_3.error; }
632
- }
633
- });
634
- _clearFilter.set(this, function () {
635
- var e_4, _r;
636
- _this.columnFilter = {};
637
- _this.externalFilter = {};
638
- _this.filterDef = {};
639
- try {
640
- for (var _s = __values(_this.externalFilters), _t = _s.next(); !_t.done; _t = _s.next()) {
641
- var externalFilter = _t.value;
642
- if (externalFilter.type === 'daterange') {
643
- _this.externalFilter[externalFilter.field] = {
644
- from: undefined,
645
- to: undefined
646
- };
647
- }
648
- }
649
- }
650
- catch (e_4_1) { e_4 = { error: e_4_1 }; }
651
- finally {
652
- try {
653
- if (_t && !_t.done && (_r = _s.return)) _r.call(_s);
654
- }
655
- finally { if (e_4) throw e_4.error; }
656
- }
657
- _this.ref.markForCheck();
658
- });
554
+ _subscription$1.set(this, new rxjs.Subscription());
659
555
  this.onFilter = function (item) {
660
- _this.filterChange.next(true);
661
- };
662
- this.open = function () {
663
- _this.popupFilter.open({
556
+ _this.filterRegister.set({
664
557
  columnFilter: _this.columnFilter,
665
558
  externalFilter: _this.externalFilter,
666
- filterDef: _this.filterDef,
667
- inlineColumn: _this.inlineColumn,
668
- inlineExternal: _this.inlineExternal,
669
- inlineFilterDef: _this.inlineFilterDef
559
+ filterDef: _this.filterDef
670
560
  });
561
+ // this.filterChange.next(true);
671
562
  };
672
- this.onChangeFilter = function (args) {
673
- var _a;
674
- var inlineColumn = args.inlineColumn, columnFilter = args.columnFilter, inlineExternal = args.inlineExternal, externalFilter = args.externalFilter, inlineFilterDef = args.inlineFilterDef, filterDef = args.filterDef;
675
- _this.inlineColumn = inlineColumn;
676
- _this.columnFilter = columnFilter;
677
- _this.inlineExternal = inlineExternal;
678
- _this.externalFilter = externalFilter;
679
- _this.inlineFilterDef = inlineFilterDef;
680
- _this.filterDef = filterDef;
681
- _this.gridFilterService.set((_a = _this.filter) === null || _a === void 0 ? void 0 : _a.key, {
682
- inlineColumn: inlineColumn,
683
- inlineExternal: inlineExternal,
684
- quickFilters: [],
685
- inlineFilterDef: inlineFilterDef,
686
- selectedQuickFilter: null
687
- });
688
- _this.filterChange.next(true);
563
+ this.open = function () {
564
+ _this.popupFilter.open();
689
565
  };
690
566
  this.onReset = function () {
691
- var _a;
692
- _this.inlineColumn = {};
693
- _this.columnFilter = {};
694
- _this.inlineExternal = {};
695
- _this.externalFilter = {};
696
- _this.inlineFilterDef = {};
697
- _this.filterDef = {};
698
- __classPrivateFieldGet(_this, _loadDefault).call(_this);
699
- _this.gridFilterService.set((_a = _this.filter) === null || _a === void 0 ? void 0 : _a.key, {
700
- inlineColumn: _this.inlineColumn,
701
- inlineExternal: _this.columnFilter,
702
- inlineFilterDef: _this.inlineFilterDef,
703
- quickFilters: [],
704
- selectedQuickFilter: null
705
- });
706
- _this.filterChange.next(true);
707
- _this.ref.markForCheck();
708
- };
709
- this.onClearFilter = function () {
710
- var _a;
711
- __classPrivateFieldGet(_this, _clearFilter).call(_this);
712
- _this.gridFilterService.set((_a = _this.filter) === null || _a === void 0 ? void 0 : _a.key, {
713
- inlineColumn: _this.inlineColumn,
714
- inlineExternal: _this.columnFilter,
715
- inlineFilterDef: _this.inlineFilterDef,
716
- quickFilters: [],
717
- selectedQuickFilter: null
718
- });
719
- _this.filterChange.next(true);
720
- };
721
- this.setFilter = function (args) {
722
- var e_5, _r;
723
- var _a, _b, _c, _d;
724
- var columnFilter = args.columnFilter, externalFilter = args.externalFilter, filterDef = args.filterDef;
725
- if (columnFilter) {
726
- _this.columnFilter = columnFilter;
727
- }
728
- if (externalFilter) {
729
- _this.externalFilter = externalFilter;
730
- }
731
- if (filterDef) {
732
- _this.filterDef = filterDef;
733
- }
734
- try {
735
- for (var _s = __values(_this.externalFilters), _t = _s.next(); !_t.done; _t = _s.next()) {
736
- var exFilter = _t.value;
737
- if (exFilter.type === 'daterange') {
738
- _this.externalFilter[exFilter.field] = {
739
- from: (_b = (_a = _this.externalFilter[exFilter.field]) === null || _a === void 0 ? void 0 : _a.from) !== null && _b !== void 0 ? _b : undefined,
740
- to: (_d = (_c = _this.externalFilter[exFilter.field]) === null || _c === void 0 ? void 0 : _c.to) !== null && _d !== void 0 ? _d : undefined
741
- };
742
- }
743
- }
744
- }
745
- catch (e_5_1) { e_5 = { error: e_5_1 }; }
746
- finally {
747
- try {
748
- if (_t && !_t.done && (_r = _s.return)) _r.call(_s);
749
- }
750
- finally { if (e_5) throw e_5.error; }
751
- }
567
+ _this.filterRegister.remove();
752
568
  _this.ref.markForCheck();
753
569
  };
754
570
  this.isMobileOrTablet = !this.deviceService.isDesktop();
@@ -762,48 +578,91 @@
762
578
  enumerable: false,
763
579
  configurable: true
764
580
  });
581
+ Object.defineProperty(SdGridFilter.prototype, "_filterRegister", {
582
+ set: function (value) {
583
+ this.filterRegister = value;
584
+ this.filterRegisterChange.next(this.filterRegister);
585
+ },
586
+ enumerable: false,
587
+ configurable: true
588
+ });
589
+ ;
765
590
  SdGridFilter.prototype.ngAfterViewInit = function () {
766
591
  var _this = this;
767
- __classPrivateFieldGet(this, _subscription).add(__classPrivateFieldGet(this, _filterOptionChanges).pipe(operators.startWith(this.filter)).subscribe(function () {
768
- var _a, _b, _c;
769
- if ((_a = _this.filter) === null || _a === void 0 ? void 0 : _a.disabled) {
770
- _this.filterChange.next(true);
771
- return;
592
+ // this.#subscription.add(this.#filterOptionChanges.pipe(startWith(this.filter)).subscribe(() => {
593
+ // if (this.filter?.disabled) {
594
+ // this.filterChange.next(true);
595
+ // return;
596
+ // }
597
+ // this.externalFilters = this.filter?.externalFilters || [];
598
+ // const configuration = this.gridFilterService.get(this.filter?.key);
599
+ // this.inlineColumn = configuration.inlineColumn;
600
+ // this.inlineExternal = configuration.inlineExternal;
601
+ // this.inlineFilterDef = configuration.inlineFilterDef;
602
+ // this.#loadDefault();
603
+ // this.filterChange.next(true);
604
+ // this.ref.markForCheck();
605
+ // }));
606
+ __classPrivateFieldGet(this, _subscription$1).add(this.filterRegisterChange.subscribe(function () {
607
+ if (_this.filterRegister) {
608
+ __classPrivateFieldGet(_this, _subscription$1).add(_this.filterRegister.observer.subscribe(function (configuration) {
609
+ _this.inlineColumn = configuration.inlineColumn;
610
+ _this.columnFilter = configuration.columnFilter;
611
+ _this.inlineExternal = configuration.inlineExternal;
612
+ _this.externalFilter = configuration.externalFilter;
613
+ _this.inlineFilterDef = configuration.inlineFilterDef;
614
+ _this.filterDef = configuration.filterDef;
615
+ }));
616
+ _this.ref.markForCheck();
772
617
  }
773
- _this.externalFilters = ((_b = _this.filter) === null || _b === void 0 ? void 0 : _b.externalFilters) || [];
774
- var configuration = _this.gridFilterService.get((_c = _this.filter) === null || _c === void 0 ? void 0 : _c.key);
775
- _this.inlineColumn = configuration.inlineColumn;
776
- _this.inlineExternal = configuration.inlineExternal;
777
- _this.inlineFilterDef = configuration.inlineFilterDef;
778
- __classPrivateFieldGet(_this, _loadDefault).call(_this);
779
- _this.filterChange.next(true);
780
- _this.ref.markForCheck();
618
+ ;
781
619
  }));
782
620
  };
621
+ // #loadDefault = () => {
622
+ // for (const column of this.columns) {
623
+ // this.inlineColumn[column.field] = this.inlineColumn[column.field] ?? column?.filter?.defaultShowing;
624
+ // this.columnFilter[column.field] = this.columnFilter[column.field] ?? column?.filter?.default;
625
+ // }
626
+ // for (const externalFilter of this.externalFilters) {
627
+ // this.inlineExternal[externalFilter.field] = this.inlineExternal[externalFilter.field] ?? externalFilter?.defaultShowing;
628
+ // if (externalFilter.type === 'daterange') {
629
+ // this.externalFilter[externalFilter.field] = {
630
+ // from: this.externalFilter[externalFilter.field]?.from ?? externalFilter.default?.from ?? undefined,
631
+ // to: this.externalFilter[externalFilter.field]?.to ?? externalFilter.default?.to ?? undefined
632
+ // };
633
+ // } else {
634
+ // this.externalFilter[externalFilter.field] = this.externalFilter[externalFilter.field] ?? externalFilter.default;
635
+ // }
636
+ // }
637
+ // for (const filterDef of this.filterDefs) {
638
+ // this.inlineFilterDef[filterDef.sdMaterialFilterDef] =
639
+ // this.inlineFilterDef[filterDef.sdMaterialFilterDef] ?? filterDef?.defaultShowing;
640
+ // }
641
+ // }
783
642
  SdGridFilter.prototype.ngOnDestroy = function () {
784
- __classPrivateFieldGet(this, _subscription).unsubscribe();
643
+ __classPrivateFieldGet(this, _subscription$1).unsubscribe();
785
644
  };
786
645
  return SdGridFilter;
787
646
  }());
788
- _filterOptionChanges = new WeakMap(), _subscription = new WeakMap(), _loadDefault = new WeakMap(), _clearFilter = new WeakMap();
647
+ _filterOptionChanges = new WeakMap(), _subscription$1 = new WeakMap();
789
648
  SdGridFilter.decorators = [
790
649
  { type: core.Component, args: [{
791
650
  selector: 'sd-grid-filter',
792
- template: "<ng-container *ngIf=\"!filter?.disabled\">\r\n <ng-container *ngIf=\"filter?.enableCollapse;else noCollapse\">\r\n <sd-group class=\"p-12\" [isExpanded]=\"false\" title=\"T\u00ECm ki\u1EBFm\" expandable>\r\n <div sdGroupBody>\r\n <ng-container *ngTemplateOutlet=\"noCollapse\"></ng-container>\r\n </div>\r\n </sd-group>\r\n </ng-container>\r\n <ng-template #noCollapse>\r\n <div\r\n *ngIf=\"!isMobileOrTablet && ((columns?.length && !filter?.inlineColumn) || externalFilters?.length || filterDefs?.length)\"\r\n class=\"row mx-0 pb-10\">\r\n <ng-container *ngIf=\"filter?.sorts?.length\">\r\n <ng-container *ngFor=\"let field of filter?.sorts\">\r\n <ng-container *ngIf=\"columns?.length && !filter?.inlineColumn\">\r\n <ng-container *ngFor=\"let item of columns | sdFilterColumn:field\">\r\n <ng-container *ngTemplateOutlet=\"filterColumn; context: {item: item}\"></ng-container>\r\n </ng-container>\r\n </ng-container>\r\n <ng-container *ngIf=\"externalFilters?.length\">\r\n <ng-container *ngFor=\"let item of externalFilters | sdFilterExternal:field\">\r\n <ng-container *ngTemplateOutlet=\"filterExternal; context: {item: item}\"></ng-container>\r\n </ng-container>\r\n </ng-container>\r\n <ng-container *ngFor=\"let item of filterDefs\">\r\n <div *ngIf=\"inlineFilterDef[item.sdMaterialFilterDef] && item.sdMaterialFilterDef === field\"\r\n class=\"col-lg-2 col-md-3 col-sm-6 px-8\">\r\n <ng-container *ngTemplateOutlet=\"item.templateRef;context:{filterDef:filterDef, isInline: true}\">\r\n </ng-container>\r\n </div>\r\n </ng-container>\r\n </ng-container>\r\n </ng-container>\r\n <ng-container *ngIf=\"!filter?.sorts?.length\">\r\n <ng-container *ngIf=\"columns?.length && !filter?.inlineColumn\">\r\n <ng-container *ngFor=\"let item of columns | sdFilterColumn\">\r\n <ng-container *ngTemplateOutlet=\"filterColumn; context: {item: item}\"></ng-container>\r\n </ng-container>\r\n </ng-container>\r\n <ng-container *ngIf=\"externalFilters?.length\">\r\n <ng-container *ngFor=\"let item of externalFilters | sdFilterExternal\">\r\n <ng-container *ngTemplateOutlet=\"filterExternal; context: {item: item}\"></ng-container>\r\n </ng-container>\r\n </ng-container>\r\n <ng-container *ngFor=\"let item of filterDefs\">\r\n <div *ngIf=\"inlineFilterDef[item.sdMaterialFilterDef]\" class=\"col-lg-2 col-md-3 col-sm-6 px-8\">\r\n <ng-container *ngTemplateOutlet=\"item.templateRef;context:{filterDef:filterDef, isInline: true}\">\r\n </ng-container>\r\n </div>\r\n </ng-container>\r\n </ng-container>\r\n </div>\r\n <ng-template #filterColumn let-item=\"item\">\r\n <div *ngIf=\"inlineColumn[item.field]\" class=\"col-lg-2 col-md-3 col-sm-6 px-8\">\r\n <sd-input [label]=\"item.title\" *ngIf=\"item.type === 'string'\" type=\"text\" [(model)]=\"columnFilter[item.field]\"\r\n (keyupEnter)=\"onFilter(item)\" appearance=\"outline\">\r\n </sd-input>\r\n <sd-input-number [label]=\"item.title\" *ngIf=\"item.type === 'number'\" [(model)]=\"columnFilter[item.field]\"\r\n (keyupEnter)=\"onFilter(item)\" appearance=\"outline\">\r\n </sd-input-number>\r\n <sd-select [label]=\"item.title\" *ngIf=\"item.type === 'bool'\" [items]=\"[{value:'1',display:item.option?.displayOnTrue || 'True' },\r\n {value:'0',display:item.option?.displayOnFalse || 'False' }]\" valueField=\"value\" displayField=\"display\"\r\n [(model)]=\"columnFilter[item.field]\" (sdChange)=\"onFilter(item)\" appearance=\"outline\">\r\n </sd-select>\r\n <sd-select *ngIf=\"item.type === 'values' && item?.option?.selection !== 'AUTOCOMPLETE'\"\r\n [items]=\"item.option?.items\" [valueField]=\"item.option?.valueField\" [displayField]=\"item.option.displayField\"\r\n [(model)]=\"columnFilter[item.field]\" (sdChange)=\"onFilter(item)\" [disabled]=\"item.filter?.disabled\"\r\n [multiple]=\"item?.option?.selection === 'MULTIPLE' || item?.item?.selection === 'MULTIPLEAUTOCOMPLETE'\"\r\n [filtered]=\"item?.option?.selection === 'MULTIPLEAUTOCOMPLETE'\" appearance=\"outline\">\r\n </sd-select>\r\n <sd-autocomplete *ngIf=\"item.type === 'values' && item?.option?.selection === 'AUTOCOMPLETE'\"\r\n [items]=\"item.option?.items\" [valueField]=\"item.option?.valueField\" [displayField]=\"item.option?.displayField\"\r\n [(model)]=\"columnFilter[item.field]\" (sdChange)=\"onFilter(item)\" [disabled]=\"item.filter?.disabled\"\r\n appearance=\"outline\">\r\n </sd-autocomplete>\r\n <sd-date-time *ngIf=\"item.type === 'date' || item.type === 'datetime' || item.type === 'time'\"\r\n [label]=\"item.title\" [(model)]=\"columnFilter[item.field]\" [type]=\"item.type\" (sdChange)=\"onFilter(item)\"\r\n appearance=\"outline\">\r\n </sd-date-time>\r\n </div>\r\n </ng-template>\r\n <ng-template #filterExternal let-item=\"item\">\r\n <div *ngIf=\"inlineExternal[item.field]\" class=\"col-lg-2 col-md-3 col-sm-6 px-8\">\r\n <sd-input [label]=\"item.title\" *ngIf=\"item.type === 'string'\" type=\"text\" [(model)]=\"externalFilter[item.field]\"\r\n (keyupEnter)=\"onFilter(item)\" appearance=\"outline\">\r\n </sd-input>\r\n <sd-input-number [label]=\"item.title\" *ngIf=\"item.type === 'number'\" [(model)]=\"externalFilter[item.field]\"\r\n (keyupEnter)=\"onFilter(item)\" appearance=\"outline\">\r\n </sd-input-number>\r\n <sd-select [label]=\"item.title\" *ngIf=\"item.type === 'bool'\" [items]=\"[{value:'1',display:item.option?.displayOnTrue || 'True' },\r\n {value:'0',display:item.option?.displayOnFalse || 'False' }]\" valueField=\"value\" displayField=\"display\"\r\n [(model)]=\"externalFilter[item.field]\" (sdChange)=\"onFilter(item)\" appearance=\"outline\">\r\n </sd-select>\r\n <ng-container *ngIf=\"item.type === 'values' && item.option\">\r\n <sd-select *ngIf=\"item.option?.selection === 'MULTIPLE'\" [label]=\"item.title\" [items]=\"item.option.items\"\r\n [valueField]=\"item.option.valueField\" [displayField]=\"item.option.displayField\"\r\n [(model)]=\"externalFilter[item.field]\" (sdChange)=\"onFilter(item)\" [selectAll]=\"item.option.selectAll\"\r\n appearance=\"outline\" multiple>\r\n </sd-select>\r\n <sd-autocomplete *ngIf=\"item.option?.selection === 'AUTOCOMPLETE'\" [label]=\"item.title\"\r\n [items]=\"item.option.items\" [valueField]=\"item.option.valueField\" [displayField]=\"item.option.displayField\"\r\n [(model)]=\"externalFilter[item.field]\" (sdChange)=\"onFilter(item)\" appearance=\"outline\">\r\n </sd-autocomplete>\r\n <sd-select *ngIf=\"item.option?.selection === 'MULTIPLEAUTOCOMPLETE'\" [label]=\"item.title\"\r\n [items]=\"item.option.items\" [valueField]=\"item.option.valueField\" [displayField]=\"item.option.displayField\"\r\n [(model)]=\"externalFilter[item.field]\" (sdChange)=\"onFilter(item)\" filtered=\"true\" appearance=\"outline\"\r\n multiple>\r\n </sd-select>\r\n <sd-select *ngIf=\"!item.option?.selection\" [label]=\"item.title\" [items]=\"item.option.items\"\r\n [valueField]=\"item.option.valueField\" [displayField]=\"item.option.displayField\"\r\n [(model)]=\"externalFilter[item.field]\" (sdChange)=\"onFilter(item)\" appearance=\"outline\">\r\n </sd-select>\r\n </ng-container>\r\n <sd-date-time [label]=\"item.title\" *ngIf=\"item.type ==='date' || item.type ==='datetime'\"\r\n [(model)]=\"externalFilter[item.field]\" [type]=\"item.type\" (sdChange)=\"onFilter(item)\" appearance=\"outline\">\r\n </sd-date-time>\r\n <sd-date-range [label]=\"item.title\" *ngIf=\"item.type ==='daterange' && externalFilter[item.field]\"\r\n [(from)]=\"externalFilter[item.field].from\" [(to)]=\"externalFilter[item.field].to\" [min]=\"item.minDate\"\r\n [max]=\"item.maxDate\" (sdChange)=\"onFilter(item)\" appearance=\"outline\">\r\n </sd-date-range>\r\n </div>\r\n </ng-template>\r\n <sd-popup-filter [columns]=\"columns\" [externalFilters]=\"externalFilters\" (changeFilter)=\"onChangeFilter($event)\"\r\n (clearFilter)=\"onReset()\" [filterDefs]=\"filterDefs\">\r\n </sd-popup-filter>\r\n </ng-template>\r\n</ng-container>",
651
+ template: "<ng-container *ngIf=\"!filter?.disabled\">\r\n <ng-container *ngIf=\"filter?.enableCollapse;else noCollapse\">\r\n <sd-group class=\"p-12\" [isExpanded]=\"false\" title=\"T\u00ECm ki\u1EBFm\" expandable>\r\n <div sdGroupBody>\r\n <ng-container *ngTemplateOutlet=\"noCollapse\"></ng-container>\r\n </div>\r\n </sd-group>\r\n </ng-container>\r\n <ng-template #noCollapse>\r\n <div\r\n *ngIf=\"!isMobileOrTablet && ((columns?.length && !filter?.inlineColumn) || externalFilters?.length || filterDefs?.length)\"\r\n class=\"row mx-0 pb-10\">\r\n <ng-container *ngIf=\"filter?.sorts?.length\">\r\n <ng-container *ngFor=\"let field of filter?.sorts\">\r\n <ng-container *ngIf=\"columns?.length && !filter?.inlineColumn\">\r\n <ng-container *ngFor=\"let item of columns | sdFilterColumn:field\">\r\n <ng-container *ngTemplateOutlet=\"filterColumn; context: {item: item}\"></ng-container>\r\n </ng-container>\r\n </ng-container>\r\n <ng-container *ngIf=\"externalFilters?.length\">\r\n <ng-container *ngFor=\"let item of externalFilters | sdFilterExternal:field\">\r\n <ng-container *ngTemplateOutlet=\"filterExternal; context: {item: item}\"></ng-container>\r\n </ng-container>\r\n </ng-container>\r\n <ng-container *ngFor=\"let item of filterDefs\">\r\n <div *ngIf=\"inlineFilterDef[item.sdMaterialFilterDef] && item.sdMaterialFilterDef === field\"\r\n class=\"col-lg-2 col-md-3 col-sm-6 px-8\">\r\n <ng-container *ngTemplateOutlet=\"item.templateRef;context:{filterDef:filterDef, isInline: true}\">\r\n </ng-container>\r\n </div>\r\n </ng-container>\r\n </ng-container>\r\n </ng-container>\r\n <ng-container *ngIf=\"!filter?.sorts?.length\">\r\n <ng-container *ngIf=\"columns?.length && !filter?.inlineColumn\">\r\n <ng-container *ngFor=\"let item of columns | sdFilterColumn\">\r\n <ng-container *ngTemplateOutlet=\"filterColumn; context: {item: item}\"></ng-container>\r\n </ng-container>\r\n </ng-container>\r\n <ng-container *ngIf=\"externalFilters?.length\">\r\n <ng-container *ngFor=\"let item of externalFilters | sdFilterExternal\">\r\n <ng-container *ngTemplateOutlet=\"filterExternal; context: {item: item}\"></ng-container>\r\n </ng-container>\r\n </ng-container>\r\n <ng-container *ngFor=\"let item of filterDefs\">\r\n <div *ngIf=\"inlineFilterDef[item.sdMaterialFilterDef]\" class=\"col-lg-2 col-md-3 col-sm-6 px-8\">\r\n <ng-container *ngTemplateOutlet=\"item.templateRef;context:{filterDef:filterDef, isInline: true}\">\r\n </ng-container>\r\n </div>\r\n </ng-container>\r\n </ng-container>\r\n </div>\r\n <ng-template #filterColumn let-item=\"item\">\r\n <div *ngIf=\"inlineColumn[item.field]\" class=\"col-lg-2 col-md-3 col-sm-6 px-8\">\r\n <sd-input [label]=\"item.title\" *ngIf=\"item.type === 'string'\" type=\"text\" [(model)]=\"columnFilter[item.field]\"\r\n (keyupEnter)=\"onFilter(item)\" appearance=\"outline\">\r\n </sd-input>\r\n <sd-input-number [label]=\"item.title\" *ngIf=\"item.type === 'number'\" [(model)]=\"columnFilter[item.field]\"\r\n (keyupEnter)=\"onFilter(item)\" appearance=\"outline\">\r\n </sd-input-number>\r\n <sd-select [label]=\"item.title\" *ngIf=\"item.type === 'bool'\" [items]=\"[{value:'1',display:item.option?.displayOnTrue || 'True' },\r\n {value:'0',display:item.option?.displayOnFalse || 'False' }]\" valueField=\"value\" displayField=\"display\"\r\n [(model)]=\"columnFilter[item.field]\" (sdChange)=\"onFilter(item)\" appearance=\"outline\">\r\n </sd-select>\r\n <sd-select *ngIf=\"item.type === 'values' && item?.option?.selection !== 'AUTOCOMPLETE'\"\r\n [items]=\"item.option?.items\" [valueField]=\"item.option?.valueField\" [displayField]=\"item.option.displayField\"\r\n [(model)]=\"columnFilter[item.field]\" (sdChange)=\"onFilter(item)\" [disabled]=\"item.filter?.disabled\"\r\n [multiple]=\"item?.option?.selection === 'MULTIPLE' || item?.item?.selection === 'MULTIPLEAUTOCOMPLETE'\"\r\n [filtered]=\"item?.option?.selection === 'MULTIPLEAUTOCOMPLETE'\" appearance=\"outline\">\r\n </sd-select>\r\n <sd-autocomplete *ngIf=\"item.type === 'values' && item?.option?.selection === 'AUTOCOMPLETE'\"\r\n [items]=\"item.option?.items\" [valueField]=\"item.option?.valueField\" [displayField]=\"item.option?.displayField\"\r\n [(model)]=\"columnFilter[item.field]\" (sdChange)=\"onFilter(item)\" [disabled]=\"item.filter?.disabled\"\r\n appearance=\"outline\">\r\n </sd-autocomplete>\r\n <sd-date-time *ngIf=\"item.type === 'date' || item.type === 'datetime' || item.type === 'time'\"\r\n [label]=\"item.title\" [(model)]=\"columnFilter[item.field]\" [type]=\"item.type\" (sdChange)=\"onFilter(item)\"\r\n appearance=\"outline\">\r\n </sd-date-time>\r\n </div>\r\n </ng-template>\r\n <ng-template #filterExternal let-item=\"item\">\r\n <div *ngIf=\"inlineExternal[item.field]\" class=\"col-lg-2 col-md-3 col-sm-6 px-8\">\r\n <sd-input [label]=\"item.title\" *ngIf=\"item.type === 'string'\" type=\"text\" [(model)]=\"externalFilter[item.field]\"\r\n (keyupEnter)=\"onFilter(item)\" appearance=\"outline\">\r\n </sd-input>\r\n <sd-input-number [label]=\"item.title\" *ngIf=\"item.type === 'number'\" [(model)]=\"externalFilter[item.field]\"\r\n (keyupEnter)=\"onFilter(item)\" appearance=\"outline\">\r\n </sd-input-number>\r\n <sd-select [label]=\"item.title\" *ngIf=\"item.type === 'bool'\" [items]=\"[{value:'1',display:item.option?.displayOnTrue || 'True' },\r\n {value:'0',display:item.option?.displayOnFalse || 'False' }]\" valueField=\"value\" displayField=\"display\"\r\n [(model)]=\"externalFilter[item.field]\" (sdChange)=\"onFilter(item)\" appearance=\"outline\">\r\n </sd-select>\r\n <ng-container *ngIf=\"item.type === 'values' && item.option\">\r\n <sd-select *ngIf=\"item.option?.selection === 'MULTIPLE'\" [label]=\"item.title\" [items]=\"item.option.items\"\r\n [valueField]=\"item.option.valueField\" [displayField]=\"item.option.displayField\"\r\n [(model)]=\"externalFilter[item.field]\" (sdChange)=\"onFilter(item)\" [selectAll]=\"item.option.selectAll\"\r\n appearance=\"outline\" multiple>\r\n </sd-select>\r\n <sd-autocomplete *ngIf=\"item.option?.selection === 'AUTOCOMPLETE'\" [label]=\"item.title\"\r\n [items]=\"item.option.items\" [valueField]=\"item.option.valueField\" [displayField]=\"item.option.displayField\"\r\n [(model)]=\"externalFilter[item.field]\" (sdChange)=\"onFilter(item)\" appearance=\"outline\">\r\n </sd-autocomplete>\r\n <sd-select *ngIf=\"item.option?.selection === 'MULTIPLEAUTOCOMPLETE'\" [label]=\"item.title\"\r\n [items]=\"item.option.items\" [valueField]=\"item.option.valueField\" [displayField]=\"item.option.displayField\"\r\n [(model)]=\"externalFilter[item.field]\" (sdChange)=\"onFilter(item)\" filtered=\"true\" appearance=\"outline\"\r\n multiple>\r\n </sd-select>\r\n <sd-select *ngIf=\"!item.option?.selection\" [label]=\"item.title\" [items]=\"item.option.items\"\r\n [valueField]=\"item.option.valueField\" [displayField]=\"item.option.displayField\"\r\n [(model)]=\"externalFilter[item.field]\" (sdChange)=\"onFilter(item)\" appearance=\"outline\">\r\n </sd-select>\r\n </ng-container>\r\n <sd-date-time [label]=\"item.title\" *ngIf=\"item.type ==='date' || item.type ==='datetime'\"\r\n [(model)]=\"externalFilter[item.field]\" [type]=\"item.type\" (sdChange)=\"onFilter(item)\" appearance=\"outline\">\r\n </sd-date-time>\r\n <sd-date-range [label]=\"item.title\" *ngIf=\"item.type ==='daterange' && externalFilter[item.field]\"\r\n [(from)]=\"externalFilter[item.field].from\" [(to)]=\"externalFilter[item.field].to\" [min]=\"item.minDate\"\r\n [max]=\"item.maxDate\" (sdChange)=\"onFilter(item)\" appearance=\"outline\">\r\n </sd-date-range>\r\n </div>\r\n </ng-template>\r\n <sd-popup-filter [filterRegister]=\"filterRegister\" [columns]=\"columns\"\r\n [externalFilters]=\"externalFilters\" [filterDefs]=\"filterDefs\">\r\n </sd-popup-filter>\r\n </ng-template>\r\n</ng-container>",
793
652
  changeDetection: core.ChangeDetectionStrategy.OnPush,
794
653
  styles: [":host{display:block;padding-left:0;padding-right:0}:host ::ng-deep .mat-form-field-wrapper{padding-bottom:0}"]
795
654
  },] }
796
655
  ];
797
656
  SdGridFilter.ctorParameters = function () { return [
798
657
  { type: core.ChangeDetectorRef },
799
- { type: ngxDeviceDetector.DeviceDetectorService },
800
- { type: SdGridFilterService }
658
+ { type: ngxDeviceDetector.DeviceDetectorService }
801
659
  ]; };
802
660
  SdGridFilter.propDecorators = {
803
661
  popupFilter: [{ type: core.ViewChild, args: [SdPopupFilter,] }],
804
662
  _filter: [{ type: core.Input, args: ['filter',] }],
805
663
  columns: [{ type: core.Input }],
806
- filterDefs: [{ type: core.Input }]
664
+ filterDefs: [{ type: core.Input }],
665
+ _filterRegister: [{ type: core.Input, args: ['filterRegister',] }]
807
666
  };
808
667
 
809
668
  var _getExportableColumns, _getExportableGroups, _getExportColumns, _initTemplate;
@@ -1678,11 +1537,11 @@
1678
1537
  { type: undefined, decorators: [{ type: core.Inject, args: [GRID_MATERIAL_CONFIG,] }, { type: core.Optional }] }
1679
1538
  ]; };
1680
1539
 
1681
- var _prefix$1, _cache$1;
1540
+ var _prefix, _cache$1;
1682
1541
  var SdColumnValuesPipe = /** @class */ (function () {
1683
1542
  function SdColumnValuesPipe() {
1684
1543
  var _this = this;
1685
- _prefix$1.set(this, 'a1e67660-8aa2-4c11-b02d-71a32188719f');
1544
+ _prefix.set(this, 'a1e67660-8aa2-4c11-b02d-71a32188719f');
1686
1545
  _cache$1.set(this, {});
1687
1546
  this.transform = function (value, column) { return __awaiter(_this, void 0, void 0, function () {
1688
1547
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, items, valueField, displayField, selection, remain, key, isMultible, values, result, result;
@@ -1694,7 +1553,7 @@
1694
1553
  }
1695
1554
  _l = column.option, items = _l.items, valueField = _l.valueField, displayField = _l.displayField, selection = _l.selection, remain = __rest(_l, ["items", "valueField", "displayField", "selection"]);
1696
1555
  key = hash__default['default']({
1697
- prefix: __classPrivateFieldGet(this, _prefix$1),
1556
+ prefix: __classPrivateFieldGet(this, _prefix),
1698
1557
  valueField: valueField,
1699
1558
  displayField: displayField,
1700
1559
  selection: selection,
@@ -1740,7 +1599,7 @@
1740
1599
  }
1741
1600
  return SdColumnValuesPipe;
1742
1601
  }());
1743
- _prefix$1 = new WeakMap(), _cache$1 = new WeakMap();
1602
+ _prefix = new WeakMap(), _cache$1 = new WeakMap();
1744
1603
  SdColumnValuesPipe.decorators = [
1745
1604
  { type: core.Pipe, args: [{
1746
1605
  name: 'columnValues'
@@ -1827,17 +1686,211 @@
1827
1686
  { type: core.NgZone }
1828
1687
  ]; };
1829
1688
 
1830
- var _localItems, _paginator, _sort, _subscription$1, _reload, _loadCompleted, _initCellDef, _initFilterDef, _initFooterDef, _filterExportInfo, _initConfiguration, _filterLocal, _getFilter, _load$1, _render, _exportedItems, _allColumns, _allExportedColumns, _onExport, _updateSelectedItems;
1689
+ var _prefix$1, _loadDefault;
1690
+ var SdGridFilterService = /** @class */ (function () {
1691
+ function SdGridFilterService(settingService) {
1692
+ var _this = this;
1693
+ this.settingService = settingService;
1694
+ _prefix$1.set(this, '61d22e8e-eee8-4aad-8e1c-044a532fea91');
1695
+ this.register = function (key, args) {
1696
+ var cacheSession = false;
1697
+ if (!key) {
1698
+ key = uuid.v4();
1699
+ cacheSession = true; // Nếu không có key thì chỉ lưu theo session
1700
+ }
1701
+ var _r = _this.settingService.create({
1702
+ prefix: __classPrivateFieldGet(_this, _prefix$1),
1703
+ key: key
1704
+ }, {
1705
+ default: __classPrivateFieldGet(_this, _loadDefault).call(_this, args),
1706
+ type: cacheSession ? 'session' : undefined
1707
+ }), get = _r.get, set = _r.set, remove = _r.remove, subject = _r.subject, observer = _r.observer;
1708
+ return {
1709
+ get: function () {
1710
+ var _a;
1711
+ var configuration = get();
1712
+ return {
1713
+ selectedQuickFilter: (_a = configuration === null || configuration === void 0 ? void 0 : configuration.selectedQuickFilter) !== null && _a !== void 0 ? _a : null,
1714
+ quickFilters: (configuration === null || configuration === void 0 ? void 0 : configuration.quickFilters) || [],
1715
+ // Filter column
1716
+ inlineColumn: (configuration === null || configuration === void 0 ? void 0 : configuration.inlineColumn) || {},
1717
+ columnFilter: (configuration === null || configuration === void 0 ? void 0 : configuration.columnFilter) || {},
1718
+ // Filter external
1719
+ inlineExternal: (configuration === null || configuration === void 0 ? void 0 : configuration.inlineExternal) || {},
1720
+ externalFilter: (configuration === null || configuration === void 0 ? void 0 : configuration.externalFilter) || {},
1721
+ // Filter def
1722
+ inlineFilterDef: (configuration === null || configuration === void 0 ? void 0 : configuration.inlineFilterDef) || {},
1723
+ filterDef: (configuration === null || configuration === void 0 ? void 0 : configuration.filterDef) || {}
1724
+ };
1725
+ },
1726
+ set: function (configuration) {
1727
+ var keys = Object.keys(configuration || {});
1728
+ var current = get();
1729
+ var selectedQuickFilter = current.selectedQuickFilter, quickFilters = current.quickFilters, inlineColumn = current.inlineColumn, columnFilter = current.columnFilter, inlineExternal = current.inlineExternal, externalFilter = current.externalFilter, inlineFilterDef = current.inlineFilterDef, filterDef = current.filterDef;
1730
+ var updatedConfiguration = {
1731
+ selectedQuickFilter: keys.includes('selectedQuickFilter') ? ((configuration === null || configuration === void 0 ? void 0 : configuration.selectedQuickFilter) || null) : selectedQuickFilter,
1732
+ quickFilters: keys.includes('quickFilters') ? ((configuration === null || configuration === void 0 ? void 0 : configuration.quickFilters) || []) : quickFilters,
1733
+ // Filter column
1734
+ inlineColumn: keys.includes('inlineColumn') ? ((configuration === null || configuration === void 0 ? void 0 : configuration.inlineColumn) || {}) : inlineColumn,
1735
+ columnFilter: keys.includes('columnFilter') ? ((configuration === null || configuration === void 0 ? void 0 : configuration.columnFilter) || {}) : columnFilter,
1736
+ // Filter external
1737
+ inlineExternal: keys.includes('inlineExternal') ? ((configuration === null || configuration === void 0 ? void 0 : configuration.inlineExternal) || {}) : inlineExternal,
1738
+ externalFilter: keys.includes('externalFilter') ? ((configuration === null || configuration === void 0 ? void 0 : configuration.externalFilter) || {}) : externalFilter,
1739
+ // Filter def
1740
+ inlineFilterDef: keys.includes('inlineFilterDef') ? ((configuration === null || configuration === void 0 ? void 0 : configuration.inlineFilterDef) || {}) : inlineFilterDef,
1741
+ filterDef: keys.includes('filterDef') ? ((configuration === null || configuration === void 0 ? void 0 : configuration.filterDef) || {}) : filterDef,
1742
+ };
1743
+ set(updatedConfiguration);
1744
+ return updatedConfiguration;
1745
+ },
1746
+ remove: function () {
1747
+ remove();
1748
+ },
1749
+ subject: subject,
1750
+ observer: observer
1751
+ };
1752
+ };
1753
+ _loadDefault.set(this, function (args) {
1754
+ var e_1, _r, e_2, _s, e_3, _t;
1755
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
1756
+ var columns = args.columns, externalFilters = args.externalFilters, filterDefs = args.filterDefs;
1757
+ var inlineColumn = {};
1758
+ var columnFilter = {};
1759
+ var inlineExternal = {};
1760
+ var externalFilter = {};
1761
+ var inlineFilterDef = {};
1762
+ var filterDef = {};
1763
+ try {
1764
+ // Filter column
1765
+ for (var _u = __values((columns || [])), _v = _u.next(); !_v.done; _v = _u.next()) {
1766
+ var item = _v.value;
1767
+ inlineColumn[item.field] = (_a = inlineColumn[item.field]) !== null && _a !== void 0 ? _a : (_b = item === null || item === void 0 ? void 0 : item.filter) === null || _b === void 0 ? void 0 : _b.defaultShowing;
1768
+ columnFilter[item.field] = (_c = columnFilter[item.field]) !== null && _c !== void 0 ? _c : (_d = item === null || item === void 0 ? void 0 : item.filter) === null || _d === void 0 ? void 0 : _d.default;
1769
+ }
1770
+ }
1771
+ catch (e_1_1) { e_1 = { error: e_1_1 }; }
1772
+ finally {
1773
+ try {
1774
+ if (_v && !_v.done && (_r = _u.return)) _r.call(_u);
1775
+ }
1776
+ finally { if (e_1) throw e_1.error; }
1777
+ }
1778
+ try {
1779
+ // Filter external
1780
+ for (var _w = __values((externalFilters || [])), _x = _w.next(); !_x.done; _x = _w.next()) {
1781
+ var item = _x.value;
1782
+ inlineExternal[item.field] = (_e = inlineExternal[item.field]) !== null && _e !== void 0 ? _e : item === null || item === void 0 ? void 0 : item.defaultShowing;
1783
+ if (item.type === 'daterange') {
1784
+ externalFilter[item.field] = {
1785
+ from: (_j = (_g = (_f = externalFilter[item.field]) === null || _f === void 0 ? void 0 : _f.from) !== null && _g !== void 0 ? _g : (_h = item.default) === null || _h === void 0 ? void 0 : _h.from) !== null && _j !== void 0 ? _j : undefined,
1786
+ to: (_o = (_l = (_k = externalFilter[item.field]) === null || _k === void 0 ? void 0 : _k.to) !== null && _l !== void 0 ? _l : (_m = item.default) === null || _m === void 0 ? void 0 : _m.to) !== null && _o !== void 0 ? _o : undefined
1787
+ };
1788
+ }
1789
+ else {
1790
+ externalFilter[item.field] = (_p = externalFilter[item.field]) !== null && _p !== void 0 ? _p : item.default;
1791
+ }
1792
+ }
1793
+ }
1794
+ catch (e_2_1) { e_2 = { error: e_2_1 }; }
1795
+ finally {
1796
+ try {
1797
+ if (_x && !_x.done && (_s = _w.return)) _s.call(_w);
1798
+ }
1799
+ finally { if (e_2) throw e_2.error; }
1800
+ }
1801
+ try {
1802
+ // Filter def
1803
+ for (var _y = __values((filterDefs || [])), _z = _y.next(); !_z.done; _z = _y.next()) {
1804
+ var item = _z.value;
1805
+ inlineFilterDef[item.sdMaterialFilterDef] = (_q = inlineFilterDef[item.sdMaterialFilterDef]) !== null && _q !== void 0 ? _q : item === null || item === void 0 ? void 0 : item.defaultShowing;
1806
+ }
1807
+ }
1808
+ catch (e_3_1) { e_3 = { error: e_3_1 }; }
1809
+ finally {
1810
+ try {
1811
+ if (_z && !_z.done && (_t = _y.return)) _t.call(_y);
1812
+ }
1813
+ finally { if (e_3) throw e_3.error; }
1814
+ }
1815
+ return {
1816
+ quickFilters: [],
1817
+ selectedQuickFilter: null,
1818
+ inlineColumn: inlineColumn,
1819
+ columnFilter: columnFilter,
1820
+ inlineExternal: inlineExternal,
1821
+ externalFilter: externalFilter,
1822
+ inlineFilterDef: inlineFilterDef,
1823
+ filterDef: filterDef,
1824
+ };
1825
+ });
1826
+ this.get = function (key) {
1827
+ var _a;
1828
+ if (!key) {
1829
+ return {
1830
+ selectedQuickFilter: null,
1831
+ quickFilters: [],
1832
+ inlineExternal: {},
1833
+ inlineColumn: {},
1834
+ inlineFilterDef: {}
1835
+ };
1836
+ }
1837
+ var get = _this.settingService.create({
1838
+ prefix: __classPrivateFieldGet(_this, _prefix$1),
1839
+ key: key
1840
+ }).get;
1841
+ var configuration = get();
1842
+ return {
1843
+ selectedQuickFilter: (_a = configuration === null || configuration === void 0 ? void 0 : configuration.selectedQuickFilter) !== null && _a !== void 0 ? _a : null,
1844
+ quickFilters: (configuration === null || configuration === void 0 ? void 0 : configuration.quickFilters) || [],
1845
+ inlineExternal: (configuration === null || configuration === void 0 ? void 0 : configuration.inlineExternal) || {},
1846
+ inlineColumn: (configuration === null || configuration === void 0 ? void 0 : configuration.inlineColumn) || {},
1847
+ inlineFilterDef: (configuration === null || configuration === void 0 ? void 0 : configuration.inlineFilterDef) || {},
1848
+ };
1849
+ };
1850
+ this.set = function (key, configuration) {
1851
+ configuration = {
1852
+ selectedQuickFilter: (configuration === null || configuration === void 0 ? void 0 : configuration.selectedQuickFilter) || null,
1853
+ quickFilters: (configuration === null || configuration === void 0 ? void 0 : configuration.quickFilters) || [],
1854
+ inlineExternal: configuration.inlineExternal || {},
1855
+ inlineColumn: configuration.inlineColumn || {},
1856
+ inlineFilterDef: configuration.inlineFilterDef || {}
1857
+ };
1858
+ if (!key) {
1859
+ return configuration;
1860
+ }
1861
+ var set = _this.settingService.create({
1862
+ prefix: __classPrivateFieldGet(_this, _prefix$1),
1863
+ key: key
1864
+ }).set;
1865
+ key = hash__default['default']({
1866
+ prefix: __classPrivateFieldGet(_this, _prefix$1),
1867
+ key: key
1868
+ });
1869
+ set(configuration);
1870
+ return configuration;
1871
+ };
1872
+ }
1873
+ return SdGridFilterService;
1874
+ }());
1875
+ _prefix$1 = new WeakMap(), _loadDefault = new WeakMap();
1876
+ SdGridFilterService.decorators = [
1877
+ { type: core.Injectable }
1878
+ ];
1879
+ SdGridFilterService.ctorParameters = function () { return [
1880
+ { type: setting.SdSettingService }
1881
+ ]; };
1882
+
1883
+ var _localItems, _paginator, _sort, _subscription$2, _reload, _loadCompleted, _initCellDef, _initFilterDef, _initFooterDef, _filterExportInfo, _initConfiguration, _loadFilterRegister, _filterLocal, _getFilter, _load$1, _render, _exportedItems, _allColumns, _allExportedColumns, _onExport, _updateSelectedItems;
1831
1884
  var SdGridMaterial = /** @class */ (function () {
1832
- function SdGridMaterial(ref, configuration, gridConfigurationService, exportService, notifyService, translateService, columnValuesPipe, editorHandlerColumnPipe) {
1885
+ function SdGridMaterial(ref, configuration, gridConfigurationService, exportService, notifyService, columnValuesPipe, gridFilterService, editorHandlerColumnPipe) {
1833
1886
  var _this = this;
1834
1887
  this.ref = ref;
1835
1888
  this.configuration = configuration;
1836
1889
  this.gridConfigurationService = gridConfigurationService;
1837
1890
  this.exportService = exportService;
1838
1891
  this.notifyService = notifyService;
1839
- this.translateService = translateService;
1840
1892
  this.columnValuesPipe = columnValuesPipe;
1893
+ this.gridFilterService = gridFilterService;
1841
1894
  this.editorHandlerColumnPipe = editorHandlerColumnPipe;
1842
1895
  this.key = uuid.v4();
1843
1896
  _localItems.set(this, []);
@@ -1863,7 +1916,7 @@
1863
1916
  // Filter
1864
1917
  this.columnFilter = {};
1865
1918
  // Subcription
1866
- _subscription$1.set(this, new rxjs.Subscription());
1919
+ _subscription$2.set(this, new rxjs.Subscription());
1867
1920
  _reload.set(this, new rxjs.BehaviorSubject({
1868
1921
  force: true
1869
1922
  }));
@@ -1906,6 +1959,7 @@
1906
1959
  }
1907
1960
  finally { if (e_2) throw e_2.error; }
1908
1961
  }
1962
+ __classPrivateFieldGet(_this, _loadFilterRegister).call(_this);
1909
1963
  });
1910
1964
  _initFooterDef.set(this, function () {
1911
1965
  var e_3, _3;
@@ -1929,13 +1983,14 @@
1929
1983
  }
1930
1984
  });
1931
1985
  _filterExportInfo.set(this, function (pageNumber, pageSize) {
1932
- var _a, _b, _c, _d, _e, _f, _g;
1986
+ var _a, _b;
1987
+ var _3 = _this.filterRegister.get(), columnFilter = _3.columnFilter, externalFilter = _3.externalFilter, filterDef = _3.filterDef;
1933
1988
  return {
1934
- rawColumnFilter: (((_b = (_a = _this.gridOption) === null || _a === void 0 ? void 0 : _a.filter) === null || _b === void 0 ? void 0 : _b.inlineColumn) ? _this.columnFilter : (_c = _this.gridFilter) === null || _c === void 0 ? void 0 : _c.columnFilter) || {},
1935
- rawExternalFilter: ((_d = _this.gridFilter) === null || _d === void 0 ? void 0 : _d.externalFilter) || {},
1936
- rawFilterDef: ((_e = _this.gridFilter) === null || _e === void 0 ? void 0 : _e.filterDef) || {},
1937
- orderBy: ((_f = __classPrivateFieldGet(_this, _sort)) === null || _f === void 0 ? void 0 : _f.active) || '',
1938
- orderDirection: ((_g = __classPrivateFieldGet(_this, _sort)) === null || _g === void 0 ? void 0 : _g.direction) || '',
1989
+ rawColumnFilter: columnFilter || {},
1990
+ rawExternalFilter: externalFilter || {},
1991
+ rawFilterDef: filterDef || {},
1992
+ orderBy: ((_a = __classPrivateFieldGet(_this, _sort)) === null || _a === void 0 ? void 0 : _a.active) || '',
1993
+ orderDirection: ((_b = __classPrivateFieldGet(_this, _sort)) === null || _b === void 0 ? void 0 : _b.direction) || '',
1939
1994
  pageNumber: pageNumber,
1940
1995
  pageSize: pageSize,
1941
1996
  isExported: true
@@ -1943,6 +1998,7 @@
1943
1998
  });
1944
1999
  _initConfiguration.set(this, function (option) {
1945
2000
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
2001
+ // Init pagination
1946
2002
  option.paginate = {
1947
2003
  hidden: (_a = option === null || option === void 0 ? void 0 : option.paginate) === null || _a === void 0 ? void 0 : _a.hidden,
1948
2004
  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,
@@ -1951,6 +2007,22 @@
1951
2007
  };
1952
2008
  return option;
1953
2009
  });
2010
+ _loadFilterRegister.set(this, function () {
2011
+ var _a, _b, _c, _d, _e;
2012
+ // Init filter
2013
+ _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, {
2014
+ columns: (_c = _this.gridOption) === null || _c === void 0 ? void 0 : _c.columns,
2015
+ externalFilters: (_e = (_d = _this.gridOption) === null || _d === void 0 ? void 0 : _d.filter) === null || _e === void 0 ? void 0 : _e.externalFilters,
2016
+ filterDefs: _this.filterDefs
2017
+ });
2018
+ __classPrivateFieldGet(_this, _subscription$2).add(_this.filterRegister.observer.pipe(operators.debounceTime(500), operators.map(function (configuration) {
2019
+ _this.columnFilter = configuration.columnFilter;
2020
+ __classPrivateFieldGet(_this, _paginator).pageIndex = 0;
2021
+ __classPrivateFieldGet(_this, _reload).next({
2022
+ force: false,
2023
+ });
2024
+ })).subscribe());
2025
+ });
1954
2026
  _filterLocal.set(this, function (localItems, filterInfo) {
1955
2027
  var columns = _this.gridOption.columns;
1956
2028
  var rawColumnFilter = filterInfo.rawColumnFilter, orderBy = filterInfo.orderBy, orderDirection = filterInfo.orderDirection, pageSize = filterInfo.pageSize, pageNumber = filterInfo.pageNumber;
@@ -2079,16 +2151,17 @@
2079
2151
  };
2080
2152
  });
2081
2153
  _getFilter.set(this, function () {
2082
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
2083
- return ({
2084
- rawColumnFilter: (((_b = (_a = _this.gridOption) === null || _a === void 0 ? void 0 : _a.filter) === null || _b === void 0 ? void 0 : _b.inlineColumn) ? _this.columnFilter : (_c = _this.gridFilter) === null || _c === void 0 ? void 0 : _c.columnFilter) || {},
2085
- rawExternalFilter: ((_d = _this.gridFilter) === null || _d === void 0 ? void 0 : _d.externalFilter) || {},
2086
- rawFilterDef: ((_e = _this.gridFilter) === null || _e === void 0 ? void 0 : _e.filterDef) || {},
2087
- orderBy: ((_f = __classPrivateFieldGet(_this, _sort)) === null || _f === void 0 ? void 0 : _f.active) || '',
2088
- orderDirection: ((_g = __classPrivateFieldGet(_this, _sort)) === null || _g === void 0 ? void 0 : _g.direction) || '',
2089
- pageNumber: ((_h = __classPrivateFieldGet(_this, _paginator)) === null || _h === void 0 ? void 0 : _h.pageIndex) || 0,
2090
- 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
2091
- });
2154
+ var _a, _b, _c, _d, _e, _f;
2155
+ var _3 = _this.filterRegister.get(), columnFilter = _3.columnFilter, externalFilter = _3.externalFilter, filterDef = _3.filterDef;
2156
+ return {
2157
+ rawColumnFilter: columnFilter || {},
2158
+ rawExternalFilter: externalFilter || {},
2159
+ rawFilterDef: filterDef || {},
2160
+ orderBy: ((_a = __classPrivateFieldGet(_this, _sort)) === null || _a === void 0 ? void 0 : _a.active) || '',
2161
+ orderDirection: ((_b = __classPrivateFieldGet(_this, _sort)) === null || _b === void 0 ? void 0 : _b.direction) || '',
2162
+ pageNumber: ((_c = __classPrivateFieldGet(_this, _paginator)) === null || _c === void 0 ? void 0 : _c.pageIndex) || 0,
2163
+ 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
2164
+ };
2092
2165
  });
2093
2166
  _load$1.set(this, function (filterReq, force) {
2094
2167
  if (force === void 0) { force = true; }
@@ -2713,18 +2786,23 @@
2713
2786
  _this.ref.detectChanges();
2714
2787
  });
2715
2788
  this.clearFilter = function () {
2716
- var _a, _b, _c;
2717
- if ((_b = (_a = _this.gridOption) === null || _a === void 0 ? void 0 : _a.filter) === null || _b === void 0 ? void 0 : _b.inlineColumn) {
2718
- _this.columnFilter = {};
2719
- }
2720
- (_c = _this.gridFilter) === null || _c === void 0 ? void 0 : _c.onClearFilter();
2789
+ _this.filterRegister.remove();
2790
+ // if (this.gridOption?.filter?.inlineColumn) {
2791
+ // this.columnFilter = {};
2792
+ // }
2793
+ // this.gridFilter?.onClearFilter();
2721
2794
  };
2722
2795
  this.setFilter = function (args) {
2723
- var _a, _b, _c;
2724
- if (((_b = (_a = _this.gridOption) === null || _a === void 0 ? void 0 : _a.filter) === null || _b === void 0 ? void 0 : _b.inlineColumn) && (args === null || args === void 0 ? void 0 : args.columnFilter)) {
2725
- _this.columnFilter = args.columnFilter;
2726
- }
2727
- (_c = _this.gridFilter) === null || _c === void 0 ? void 0 : _c.setFilter(args);
2796
+ var _3 = args || {}, columnFilter = _3.columnFilter, externalFilter = _3.externalFilter, filterDef = _3.filterDef;
2797
+ _this.filterRegister.set({
2798
+ columnFilter: columnFilter,
2799
+ externalFilter: externalFilter,
2800
+ filterDef: filterDef
2801
+ });
2802
+ // if (this.gridOption?.filter?.inlineColumn && args?.columnFilter) {
2803
+ // this.columnFilter = args.columnFilter;
2804
+ // }
2805
+ // this.gridFilter?.setFilter(args);
2728
2806
  };
2729
2807
  this.onCreate = function () {
2730
2808
  var _a, _b;
@@ -2951,16 +3029,19 @@
2951
3029
  }
2952
3030
  Object.defineProperty(SdGridMaterial.prototype, "_gridFilter", {
2953
3031
  set: function (gridFilter) {
2954
- var _this = this;
2955
3032
  if (gridFilter && this.gridFilter !== gridFilter) {
2956
3033
  this.gridFilter = gridFilter;
2957
- __classPrivateFieldGet(this, _subscription$1).add(gridFilter.filterChange.pipe(operators.filter(function (reload) { return reload; }), operators.debounceTime(500), operators.map(function () {
2958
- __classPrivateFieldGet(_this, _paginator).pageIndex = 0;
2959
- __classPrivateFieldGet(_this, _reload).next({
2960
- force: false,
2961
- source: 'FILTER'
2962
- });
2963
- })).subscribe());
3034
+ // this.#subscription.add(gridFilter.filterChange.pipe(
3035
+ // filter(reload => reload),
3036
+ // debounceTime(500),
3037
+ // map(() => {
3038
+ // this.#paginator.pageIndex = 0;
3039
+ // this.#reload.next({
3040
+ // force: false,
3041
+ // source: 'FILTER'
3042
+ // });
3043
+ // }),
3044
+ // ).subscribe());
2964
3045
  }
2965
3046
  },
2966
3047
  enumerable: false,
@@ -2968,22 +3049,14 @@
2968
3049
  });
2969
3050
  Object.defineProperty(SdGridMaterial.prototype, "option", {
2970
3051
  set: function (option) {
2971
- var _this = this;
2972
- var _a;
2973
3052
  if (option) {
2974
3053
  option = __classPrivateFieldGet(this, _initConfiguration).call(this, option);
2975
3054
  this.gridOption = option;
3055
+ __classPrivateFieldGet(this, _loadFilterRegister).call(this);
2976
3056
  __classPrivateFieldSet(this, _loadCompleted, false);
2977
- __classPrivateFieldGet(this, _reload).next({
2978
- force: true,
2979
- source: 'INITIALIZE'
2980
- });
2981
- (_a = option === null || option === void 0 ? void 0 : option.columns) === null || _a === void 0 ? void 0 : _a.forEach(function (col) {
2982
- var _a;
2983
- if ((_a = col.filter) === null || _a === void 0 ? void 0 : _a.default) {
2984
- _this.columnFilter[col.field] = col.filter.default;
2985
- }
2986
- });
3057
+ // this.#reload.next({
3058
+ // force: true,
3059
+ // });
2987
3060
  var configuration = this.gridConfigurationService.init(this.key, this.gridOption);
2988
3061
  this.gridConfigurationObserver = configuration.observer;
2989
3062
  configuration.load();
@@ -2997,7 +3070,7 @@
2997
3070
  var _this = this;
2998
3071
  if (paginator && __classPrivateFieldGet(this, _paginator) !== paginator) {
2999
3072
  __classPrivateFieldSet(this, _paginator, paginator);
3000
- __classPrivateFieldGet(this, _subscription$1).add(paginator.page.pipe(operators.map(function () {
3073
+ __classPrivateFieldGet(this, _subscription$2).add(paginator.page.pipe(operators.map(function () {
3001
3074
  __classPrivateFieldGet(_this, _reload).next({
3002
3075
  force: false
3003
3076
  });
@@ -3012,7 +3085,7 @@
3012
3085
  var _this = this;
3013
3086
  if (sort && __classPrivateFieldGet(this, _sort) !== sort) {
3014
3087
  __classPrivateFieldSet(this, _sort, sort);
3015
- __classPrivateFieldGet(this, _subscription$1).add(sort.sortChange.pipe(operators.map(function () {
3088
+ __classPrivateFieldGet(this, _subscription$2).add(sort.sortChange.pipe(operators.map(function () {
3016
3089
  __classPrivateFieldGet(_this, _reload).next({
3017
3090
  force: false
3018
3091
  });
@@ -3027,18 +3100,7 @@
3027
3100
  };
3028
3101
  SdGridMaterial.prototype.ngAfterViewInit = function () {
3029
3102
  var _this = this;
3030
- __classPrivateFieldGet(this, _subscription$1).add(__classPrivateFieldGet(this, _reload).pipe(operators.debounceTime(200),
3031
- // startWith(this.#reload.value),
3032
- operators.filter(function (data) {
3033
- var _a, _b;
3034
- if (__classPrivateFieldGet(_this, _loadCompleted)) {
3035
- return true;
3036
- }
3037
- if (!((_b = (_a = _this.gridOption) === null || _a === void 0 ? void 0 : _a.filter) === null || _b === void 0 ? void 0 : _b.disabled)) {
3038
- return data.source === 'FILTER';
3039
- }
3040
- return data.source === 'INITIALIZE';
3041
- }), operators.switchMap(function (data) { return __awaiter(_this, void 0, void 0, function () {
3103
+ __classPrivateFieldGet(this, _subscription$2).add(__classPrivateFieldGet(this, _reload).pipe(operators.debounceTime(200), operators.switchMap(function (data) { return __awaiter(_this, void 0, void 0, function () {
3042
3104
  var filterInfo, result;
3043
3105
  return __generator(this, function (_3) {
3044
3106
  switch (_3.label) {
@@ -3052,9 +3114,9 @@
3052
3114
  }
3053
3115
  });
3054
3116
  }); })).subscribe(__classPrivateFieldGet(this, _render)));
3055
- __classPrivateFieldGet(this, _subscription$1).add(this.sdCellDefs.changes.pipe(operators.startWith([])).subscribe(__classPrivateFieldGet(this, _initCellDef)));
3056
- __classPrivateFieldGet(this, _subscription$1).add(this.sdFooterDefs.changes.pipe(operators.startWith([])).subscribe(__classPrivateFieldGet(this, _initFooterDef)));
3057
- __classPrivateFieldGet(this, _subscription$1).add(this.sdFilterDefs.changes.pipe(operators.startWith([])).subscribe(__classPrivateFieldGet(this, _initFilterDef)));
3117
+ __classPrivateFieldGet(this, _subscription$2).add(this.sdCellDefs.changes.pipe(operators.startWith([])).subscribe(__classPrivateFieldGet(this, _initCellDef)));
3118
+ __classPrivateFieldGet(this, _subscription$2).add(this.sdFooterDefs.changes.pipe(operators.startWith([])).subscribe(__classPrivateFieldGet(this, _initFooterDef)));
3119
+ __classPrivateFieldGet(this, _subscription$2).add(this.sdFilterDefs.changes.pipe(operators.startWith([])).subscribe(__classPrivateFieldGet(this, _initFilterDef)));
3058
3120
  // this.#subscription.add(this.#optionChanges.pipe(
3059
3121
  // debounceTime(200),
3060
3122
  // startWith({}),
@@ -3064,7 +3126,7 @@
3064
3126
  this.ref.detectChanges();
3065
3127
  };
3066
3128
  SdGridMaterial.prototype.ngOnDestroy = function () {
3067
- __classPrivateFieldGet(this, _subscription$1).unsubscribe();
3129
+ __classPrivateFieldGet(this, _subscription$2).unsubscribe();
3068
3130
  };
3069
3131
  SdGridMaterial.prototype.drop = function (event, columns) {
3070
3132
  dragDrop.moveItemInArray(columns, event.previousIndex, event.currentIndex);
@@ -3123,11 +3185,11 @@
3123
3185
  });
3124
3186
  return SdGridMaterial;
3125
3187
  }());
3126
- _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();
3188
+ _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();
3127
3189
  SdGridMaterial.decorators = [
3128
3190
  { type: core.Component, args: [{
3129
3191
  selector: 'sd-grid-material',
3130
- 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\" [filter]=\"gridOption?.filter\"\r\n [columns]=\"configuration.firstColumns\" [filterDefs]=\"filterDefs\">\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=\"\r\n !gridOption.filter?.disabled && !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>",
3192
+ 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\" [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>",
3131
3193
  animations: [
3132
3194
  animations.trigger('detailExpand', [
3133
3195
  animations.state('collapsed', animations.style({ height: '0', minHeight: '0', visibility: 'hidden' })),
@@ -3144,8 +3206,8 @@
3144
3206
  { type: SdGridConfigurationService },
3145
3207
  { type: _export.SdExportService },
3146
3208
  { type: notify.SdNotifyService },
3147
- { type: translate.SdTranslateService },
3148
3209
  { type: SdColumnValuesPipe },
3210
+ { type: SdGridFilterService },
3149
3211
  { type: SdEditorHandlerColumnPipe }
3150
3212
  ]; };
3151
3213
  SdGridMaterial.propDecorators = {
@@ -4140,7 +4202,7 @@
4140
4202
  { type: setting.SdSettingService }
4141
4203
  ]; };
4142
4204
 
4143
- var _subscription$2;
4205
+ var _subscription$3;
4144
4206
  var SdDynamicColumn = /** @class */ (function () {
4145
4207
  function SdDynamicColumn(ref, generatedColumnService, notifyService, translateService, gridConfigurationService) {
4146
4208
  var _this = this;
@@ -4149,7 +4211,7 @@
4149
4211
  this.notifyService = notifyService;
4150
4212
  this.translateService = translateService;
4151
4213
  this.gridConfigurationService = gridConfigurationService;
4152
- _subscription$2.set(this, new rxjs.Subscription());
4214
+ _subscription$3.set(this, new rxjs.Subscription());
4153
4215
  this.columnTypes = ['string', 'number', 'bool', 'date', 'datetime', 'time', 'values', 'children', 'children-col'];
4154
4216
  this.form = new forms.FormGroup({});
4155
4217
  this.isDetail = false;
@@ -4194,23 +4256,23 @@
4194
4256
  var systemSetting = this.generatedColumnService.loadSystem(this.gridOption.config);
4195
4257
  var setting = this.generatedColumnService.load((_a = this.gridOption) === null || _a === void 0 ? void 0 : _a.config);
4196
4258
  if (systemSetting) {
4197
- (_b = __classPrivateFieldGet(this, _subscription$2)) === null || _b === void 0 ? void 0 : _b.add(systemSetting.observer.subscribe(function (columns) {
4259
+ (_b = __classPrivateFieldGet(this, _subscription$3)) === null || _b === void 0 ? void 0 : _b.add(systemSetting.observer.subscribe(function (columns) {
4198
4260
  _this.systemColumns = columns;
4199
4261
  }));
4200
4262
  }
4201
4263
  if (setting) {
4202
- (_c = __classPrivateFieldGet(this, _subscription$2)) === null || _c === void 0 ? void 0 : _c.add(setting.observer.subscribe(function (columns) {
4264
+ (_c = __classPrivateFieldGet(this, _subscription$3)) === null || _c === void 0 ? void 0 : _c.add(setting.observer.subscribe(function (columns) {
4203
4265
  _this.columns = columns;
4204
4266
  }));
4205
4267
  }
4206
4268
  this.originColumns = this.gridOption.columns.filter(function (e) { return e.type !== 'children' && e.type !== 'children-col'; });
4207
4269
  };
4208
4270
  SdDynamicColumn.prototype.ngOnDestroy = function () {
4209
- __classPrivateFieldGet(this, _subscription$2).unsubscribe();
4271
+ __classPrivateFieldGet(this, _subscription$3).unsubscribe();
4210
4272
  };
4211
4273
  return SdDynamicColumn;
4212
4274
  }());
4213
- _subscription$2 = new WeakMap();
4275
+ _subscription$3 = new WeakMap();
4214
4276
  SdDynamicColumn.decorators = [
4215
4277
  { type: core.Component, args: [{
4216
4278
  selector: 'sd-dynamic-column',
@@ -5128,11 +5190,11 @@
5128
5190
  exports.ɵbp = SdCellViewPipe;
5129
5191
  exports.ɵbq = SdGroupPipe;
5130
5192
  exports.ɵc = SdPopupFilter;
5131
- exports.ɵd = SdGridFilterService;
5132
- exports.ɵe = SdPopupExport;
5133
- exports.ɵg = GRID_MATERIAL_CONFIG;
5134
- exports.ɵh = SdGridConfigurationService;
5135
- exports.ɵi = SdColumnValuesPipe;
5193
+ exports.ɵd = SdPopupExport;
5194
+ exports.ɵf = GRID_MATERIAL_CONFIG;
5195
+ exports.ɵg = SdGridConfigurationService;
5196
+ exports.ɵh = SdColumnValuesPipe;
5197
+ exports.ɵi = SdGridFilterService;
5136
5198
  exports.ɵj = SdEditorHandlerColumnPipe;
5137
5199
  exports.ɵk = SdGridQuickAction;
5138
5200
  exports.ɵl = SdDesktopCell;