@sd-angular/core 1.3.92 → 1.3.93
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundles/sd-angular-core-grid-material.umd.js +425 -362
- package/bundles/sd-angular-core-grid-material.umd.js.map +1 -1
- package/bundles/sd-angular-core-grid-material.umd.min.js +2 -2
- package/bundles/sd-angular-core-grid-material.umd.min.js.map +1 -1
- package/esm2015/grid-material/sd-angular-core-grid-material.js +6 -6
- package/esm2015/grid-material/src/lib/components/grid-filter/grid-filter.component.js +69 -137
- package/esm2015/grid-material/src/lib/components/popup-filter/popup-filter.component.js +58 -23
- package/esm2015/grid-material/src/lib/grid-material.component.js +76 -65
- package/esm2015/grid-material/src/lib/grid-material.module.js +2 -2
- package/esm2015/grid-material/src/lib/models/grid-export.model.js +1 -1
- package/esm2015/grid-material/src/lib/models/grid-option.model.js +1 -1
- package/esm2015/grid-material/src/lib/pipes/filter-external.pipe.js +1 -1
- package/esm2015/grid-material/src/lib/services/grid-filter/grid-filter.model.js +3 -0
- package/esm2015/grid-material/src/lib/services/grid-filter/grid-filter.service.js +166 -0
- package/esm2015/grid-material/src/public-api.js +1 -1
- package/fesm2015/sd-angular-core-grid-material.js +382 -304
- package/fesm2015/sd-angular-core-grid-material.js.map +1 -1
- package/grid-material/sd-angular-core-grid-material.d.ts +5 -5
- package/grid-material/sd-angular-core-grid-material.metadata.json +1 -1
- package/grid-material/src/lib/components/grid-filter/grid-filter.component.d.ts +4 -25
- package/grid-material/src/lib/components/popup-filter/popup-filter.component.d.ts +7 -31
- package/grid-material/src/lib/grid-material.component.d.ts +6 -6
- package/grid-material/src/lib/models/grid-export.model.d.ts +1 -1
- package/grid-material/src/lib/models/grid-option.model.d.ts +1 -1
- package/grid-material/src/lib/pipes/filter-external.pipe.d.ts +1 -1
- package/grid-material/src/lib/{models → services/grid-filter}/grid-filter.model.d.ts +14 -9
- package/grid-material/src/lib/services/grid-filter/grid-filter.service.d.ts +16 -0
- package/grid-material/src/public-api.d.ts +1 -1
- package/package.json +1 -1
- package/{sd-angular-core-1.3.92.tgz → sd-angular-core-1.3.93.tgz} +0 -0
- package/esm2015/grid-material/src/lib/models/grid-filter.model.js +0 -3
- package/esm2015/grid-material/src/lib/services/grid-filter.service.js +0 -65
- 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('
|
|
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', '
|
|
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['
|
|
5
|
-
}(this, (function (exports, common, core, paginator, sort, animations, uuid, rxjs, notify, dragDrop, operators,
|
|
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
|
|
443
|
-
this.
|
|
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.
|
|
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.
|
|
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,23 @@
|
|
|
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
|
|
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, _filterRegister$1, _subscription$1;
|
|
563
538
|
var SdGridFilter = /** @class */ (function () {
|
|
564
|
-
function SdGridFilter(ref, deviceService
|
|
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
|
|
546
|
+
_filterRegister$1.set(this, void 0);
|
|
547
|
+
this.filterRegisterChange = new rxjs.BehaviorSubject(null);
|
|
573
548
|
this.filterDef = {};
|
|
574
549
|
this.inlineFilterDef = {};
|
|
575
550
|
this.columnFilter = {};
|
|
@@ -577,178 +552,20 @@
|
|
|
577
552
|
this.externalFilters = [];
|
|
578
553
|
this.externalFilter = {};
|
|
579
554
|
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
|
-
});
|
|
555
|
+
_subscription$1.set(this, new rxjs.Subscription());
|
|
659
556
|
this.onFilter = function (item) {
|
|
660
|
-
_this.
|
|
661
|
-
};
|
|
662
|
-
this.open = function () {
|
|
663
|
-
_this.popupFilter.open({
|
|
557
|
+
__classPrivateFieldGet(_this, _filterRegister$1).set({
|
|
664
558
|
columnFilter: _this.columnFilter,
|
|
665
559
|
externalFilter: _this.externalFilter,
|
|
666
|
-
filterDef: _this.filterDef
|
|
667
|
-
inlineColumn: _this.inlineColumn,
|
|
668
|
-
inlineExternal: _this.inlineExternal,
|
|
669
|
-
inlineFilterDef: _this.inlineFilterDef
|
|
560
|
+
filterDef: _this.filterDef
|
|
670
561
|
});
|
|
562
|
+
// this.filterChange.next(true);
|
|
671
563
|
};
|
|
672
|
-
this.
|
|
673
|
-
|
|
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);
|
|
564
|
+
this.open = function () {
|
|
565
|
+
_this.popupFilter.open();
|
|
689
566
|
};
|
|
690
567
|
this.onReset = function () {
|
|
691
|
-
|
|
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
|
-
}
|
|
568
|
+
__classPrivateFieldGet(_this, _filterRegister$1).remove();
|
|
752
569
|
_this.ref.markForCheck();
|
|
753
570
|
};
|
|
754
571
|
this.isMobileOrTablet = !this.deviceService.isDesktop();
|
|
@@ -762,48 +579,91 @@
|
|
|
762
579
|
enumerable: false,
|
|
763
580
|
configurable: true
|
|
764
581
|
});
|
|
582
|
+
Object.defineProperty(SdGridFilter.prototype, "filterRegister", {
|
|
583
|
+
set: function (value) {
|
|
584
|
+
__classPrivateFieldSet(this, _filterRegister$1, value);
|
|
585
|
+
this.filterRegisterChange.next(__classPrivateFieldGet(this, _filterRegister$1));
|
|
586
|
+
},
|
|
587
|
+
enumerable: false,
|
|
588
|
+
configurable: true
|
|
589
|
+
});
|
|
590
|
+
;
|
|
765
591
|
SdGridFilter.prototype.ngAfterViewInit = function () {
|
|
766
592
|
var _this = this;
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
593
|
+
// this.#subscription.add(this.#filterOptionChanges.pipe(startWith(this.filter)).subscribe(() => {
|
|
594
|
+
// if (this.filter?.disabled) {
|
|
595
|
+
// this.filterChange.next(true);
|
|
596
|
+
// return;
|
|
597
|
+
// }
|
|
598
|
+
// this.externalFilters = this.filter?.externalFilters || [];
|
|
599
|
+
// const configuration = this.gridFilterService.get(this.filter?.key);
|
|
600
|
+
// this.inlineColumn = configuration.inlineColumn;
|
|
601
|
+
// this.inlineExternal = configuration.inlineExternal;
|
|
602
|
+
// this.inlineFilterDef = configuration.inlineFilterDef;
|
|
603
|
+
// this.#loadDefault();
|
|
604
|
+
// this.filterChange.next(true);
|
|
605
|
+
// this.ref.markForCheck();
|
|
606
|
+
// }));
|
|
607
|
+
__classPrivateFieldGet(this, _subscription$1).add(this.filterRegisterChange.subscribe(function () {
|
|
608
|
+
if (__classPrivateFieldGet(_this, _filterRegister$1)) {
|
|
609
|
+
__classPrivateFieldGet(_this, _subscription$1).add(__classPrivateFieldGet(_this, _filterRegister$1).observer.subscribe(function (configuration) {
|
|
610
|
+
_this.inlineColumn = configuration.inlineColumn;
|
|
611
|
+
_this.columnFilter = configuration.columnFilter;
|
|
612
|
+
_this.inlineExternal = configuration.inlineExternal;
|
|
613
|
+
_this.externalFilter = configuration.externalFilter;
|
|
614
|
+
_this.inlineFilterDef = configuration.inlineFilterDef;
|
|
615
|
+
_this.filterDef = configuration.filterDef;
|
|
616
|
+
}));
|
|
617
|
+
_this.ref.markForCheck();
|
|
772
618
|
}
|
|
773
|
-
|
|
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();
|
|
619
|
+
;
|
|
781
620
|
}));
|
|
782
621
|
};
|
|
622
|
+
// #loadDefault = () => {
|
|
623
|
+
// for (const column of this.columns) {
|
|
624
|
+
// this.inlineColumn[column.field] = this.inlineColumn[column.field] ?? column?.filter?.defaultShowing;
|
|
625
|
+
// this.columnFilter[column.field] = this.columnFilter[column.field] ?? column?.filter?.default;
|
|
626
|
+
// }
|
|
627
|
+
// for (const externalFilter of this.externalFilters) {
|
|
628
|
+
// this.inlineExternal[externalFilter.field] = this.inlineExternal[externalFilter.field] ?? externalFilter?.defaultShowing;
|
|
629
|
+
// if (externalFilter.type === 'daterange') {
|
|
630
|
+
// this.externalFilter[externalFilter.field] = {
|
|
631
|
+
// from: this.externalFilter[externalFilter.field]?.from ?? externalFilter.default?.from ?? undefined,
|
|
632
|
+
// to: this.externalFilter[externalFilter.field]?.to ?? externalFilter.default?.to ?? undefined
|
|
633
|
+
// };
|
|
634
|
+
// } else {
|
|
635
|
+
// this.externalFilter[externalFilter.field] = this.externalFilter[externalFilter.field] ?? externalFilter.default;
|
|
636
|
+
// }
|
|
637
|
+
// }
|
|
638
|
+
// for (const filterDef of this.filterDefs) {
|
|
639
|
+
// this.inlineFilterDef[filterDef.sdMaterialFilterDef] =
|
|
640
|
+
// this.inlineFilterDef[filterDef.sdMaterialFilterDef] ?? filterDef?.defaultShowing;
|
|
641
|
+
// }
|
|
642
|
+
// }
|
|
783
643
|
SdGridFilter.prototype.ngOnDestroy = function () {
|
|
784
|
-
__classPrivateFieldGet(this, _subscription).unsubscribe();
|
|
644
|
+
__classPrivateFieldGet(this, _subscription$1).unsubscribe();
|
|
785
645
|
};
|
|
786
646
|
return SdGridFilter;
|
|
787
647
|
}());
|
|
788
|
-
_filterOptionChanges = new WeakMap(),
|
|
648
|
+
_filterOptionChanges = new WeakMap(), _filterRegister$1 = new WeakMap(), _subscription$1 = new WeakMap();
|
|
789
649
|
SdGridFilter.decorators = [
|
|
790
650
|
{ type: core.Component, args: [{
|
|
791
651
|
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 [
|
|
652
|
+
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
653
|
changeDetection: core.ChangeDetectionStrategy.OnPush,
|
|
794
654
|
styles: [":host{display:block;padding-left:0;padding-right:0}:host ::ng-deep .mat-form-field-wrapper{padding-bottom:0}"]
|
|
795
655
|
},] }
|
|
796
656
|
];
|
|
797
657
|
SdGridFilter.ctorParameters = function () { return [
|
|
798
658
|
{ type: core.ChangeDetectorRef },
|
|
799
|
-
{ type: ngxDeviceDetector.DeviceDetectorService }
|
|
800
|
-
{ type: SdGridFilterService }
|
|
659
|
+
{ type: ngxDeviceDetector.DeviceDetectorService }
|
|
801
660
|
]; };
|
|
802
661
|
SdGridFilter.propDecorators = {
|
|
803
662
|
popupFilter: [{ type: core.ViewChild, args: [SdPopupFilter,] }],
|
|
804
663
|
_filter: [{ type: core.Input, args: ['filter',] }],
|
|
805
664
|
columns: [{ type: core.Input }],
|
|
806
|
-
filterDefs: [{ type: core.Input }]
|
|
665
|
+
filterDefs: [{ type: core.Input }],
|
|
666
|
+
filterRegister: [{ type: core.Input }]
|
|
807
667
|
};
|
|
808
668
|
|
|
809
669
|
var _getExportableColumns, _getExportableGroups, _getExportColumns, _initTemplate;
|
|
@@ -1678,11 +1538,11 @@
|
|
|
1678
1538
|
{ type: undefined, decorators: [{ type: core.Inject, args: [GRID_MATERIAL_CONFIG,] }, { type: core.Optional }] }
|
|
1679
1539
|
]; };
|
|
1680
1540
|
|
|
1681
|
-
var _prefix
|
|
1541
|
+
var _prefix, _cache$1;
|
|
1682
1542
|
var SdColumnValuesPipe = /** @class */ (function () {
|
|
1683
1543
|
function SdColumnValuesPipe() {
|
|
1684
1544
|
var _this = this;
|
|
1685
|
-
_prefix
|
|
1545
|
+
_prefix.set(this, 'a1e67660-8aa2-4c11-b02d-71a32188719f');
|
|
1686
1546
|
_cache$1.set(this, {});
|
|
1687
1547
|
this.transform = function (value, column) { return __awaiter(_this, void 0, void 0, function () {
|
|
1688
1548
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, items, valueField, displayField, selection, remain, key, isMultible, values, result, result;
|
|
@@ -1694,7 +1554,7 @@
|
|
|
1694
1554
|
}
|
|
1695
1555
|
_l = column.option, items = _l.items, valueField = _l.valueField, displayField = _l.displayField, selection = _l.selection, remain = __rest(_l, ["items", "valueField", "displayField", "selection"]);
|
|
1696
1556
|
key = hash__default['default']({
|
|
1697
|
-
prefix: __classPrivateFieldGet(this, _prefix
|
|
1557
|
+
prefix: __classPrivateFieldGet(this, _prefix),
|
|
1698
1558
|
valueField: valueField,
|
|
1699
1559
|
displayField: displayField,
|
|
1700
1560
|
selection: selection,
|
|
@@ -1740,7 +1600,7 @@
|
|
|
1740
1600
|
}
|
|
1741
1601
|
return SdColumnValuesPipe;
|
|
1742
1602
|
}());
|
|
1743
|
-
_prefix
|
|
1603
|
+
_prefix = new WeakMap(), _cache$1 = new WeakMap();
|
|
1744
1604
|
SdColumnValuesPipe.decorators = [
|
|
1745
1605
|
{ type: core.Pipe, args: [{
|
|
1746
1606
|
name: 'columnValues'
|
|
@@ -1827,17 +1687,211 @@
|
|
|
1827
1687
|
{ type: core.NgZone }
|
|
1828
1688
|
]; };
|
|
1829
1689
|
|
|
1830
|
-
var
|
|
1690
|
+
var _prefix$1, _loadDefault;
|
|
1691
|
+
var SdGridFilterService = /** @class */ (function () {
|
|
1692
|
+
function SdGridFilterService(settingService) {
|
|
1693
|
+
var _this = this;
|
|
1694
|
+
this.settingService = settingService;
|
|
1695
|
+
_prefix$1.set(this, '61d22e8e-eee8-4aad-8e1c-044a532fea91');
|
|
1696
|
+
this.register = function (key, args) {
|
|
1697
|
+
var cacheSession = false;
|
|
1698
|
+
if (!key) {
|
|
1699
|
+
key = uuid.v4();
|
|
1700
|
+
cacheSession = true; // Nếu không có key thì chỉ lưu theo session
|
|
1701
|
+
}
|
|
1702
|
+
var _r = _this.settingService.create({
|
|
1703
|
+
prefix: __classPrivateFieldGet(_this, _prefix$1),
|
|
1704
|
+
key: key
|
|
1705
|
+
}, {
|
|
1706
|
+
default: __classPrivateFieldGet(_this, _loadDefault).call(_this, args),
|
|
1707
|
+
type: cacheSession ? 'session' : undefined
|
|
1708
|
+
}), get = _r.get, set = _r.set, remove = _r.remove, subject = _r.subject, observer = _r.observer;
|
|
1709
|
+
return {
|
|
1710
|
+
get: function () {
|
|
1711
|
+
var _a;
|
|
1712
|
+
var configuration = get();
|
|
1713
|
+
return {
|
|
1714
|
+
selectedQuickFilter: (_a = configuration === null || configuration === void 0 ? void 0 : configuration.selectedQuickFilter) !== null && _a !== void 0 ? _a : null,
|
|
1715
|
+
quickFilters: (configuration === null || configuration === void 0 ? void 0 : configuration.quickFilters) || [],
|
|
1716
|
+
// Filter column
|
|
1717
|
+
inlineColumn: (configuration === null || configuration === void 0 ? void 0 : configuration.inlineColumn) || {},
|
|
1718
|
+
columnFilter: (configuration === null || configuration === void 0 ? void 0 : configuration.columnFilter) || {},
|
|
1719
|
+
// Filter external
|
|
1720
|
+
inlineExternal: (configuration === null || configuration === void 0 ? void 0 : configuration.inlineExternal) || {},
|
|
1721
|
+
externalFilter: (configuration === null || configuration === void 0 ? void 0 : configuration.externalFilter) || {},
|
|
1722
|
+
// Filter def
|
|
1723
|
+
inlineFilterDef: (configuration === null || configuration === void 0 ? void 0 : configuration.inlineFilterDef) || {},
|
|
1724
|
+
filterDef: (configuration === null || configuration === void 0 ? void 0 : configuration.filterDef) || {}
|
|
1725
|
+
};
|
|
1726
|
+
},
|
|
1727
|
+
set: function (configuration) {
|
|
1728
|
+
var keys = Object.keys(configuration || {});
|
|
1729
|
+
var current = get();
|
|
1730
|
+
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;
|
|
1731
|
+
var updatedConfiguration = {
|
|
1732
|
+
selectedQuickFilter: keys.includes('selectedQuickFilter') ? ((configuration === null || configuration === void 0 ? void 0 : configuration.selectedQuickFilter) || null) : selectedQuickFilter,
|
|
1733
|
+
quickFilters: keys.includes('quickFilters') ? ((configuration === null || configuration === void 0 ? void 0 : configuration.quickFilters) || []) : quickFilters,
|
|
1734
|
+
// Filter column
|
|
1735
|
+
inlineColumn: keys.includes('inlineColumn') ? ((configuration === null || configuration === void 0 ? void 0 : configuration.inlineColumn) || {}) : inlineColumn,
|
|
1736
|
+
columnFilter: keys.includes('columnFilter') ? ((configuration === null || configuration === void 0 ? void 0 : configuration.columnFilter) || {}) : columnFilter,
|
|
1737
|
+
// Filter external
|
|
1738
|
+
inlineExternal: keys.includes('inlineExternal') ? ((configuration === null || configuration === void 0 ? void 0 : configuration.inlineExternal) || {}) : inlineExternal,
|
|
1739
|
+
externalFilter: keys.includes('externalFilter') ? ((configuration === null || configuration === void 0 ? void 0 : configuration.externalFilter) || {}) : externalFilter,
|
|
1740
|
+
// Filter def
|
|
1741
|
+
inlineFilterDef: keys.includes('inlineFilterDef') ? ((configuration === null || configuration === void 0 ? void 0 : configuration.inlineFilterDef) || {}) : inlineFilterDef,
|
|
1742
|
+
filterDef: keys.includes('filterDef') ? ((configuration === null || configuration === void 0 ? void 0 : configuration.filterDef) || {}) : filterDef,
|
|
1743
|
+
};
|
|
1744
|
+
set(updatedConfiguration);
|
|
1745
|
+
return updatedConfiguration;
|
|
1746
|
+
},
|
|
1747
|
+
remove: function () {
|
|
1748
|
+
remove();
|
|
1749
|
+
},
|
|
1750
|
+
subject: subject,
|
|
1751
|
+
observer: observer
|
|
1752
|
+
};
|
|
1753
|
+
};
|
|
1754
|
+
_loadDefault.set(this, function (args) {
|
|
1755
|
+
var e_1, _r, e_2, _s, e_3, _t;
|
|
1756
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
|
|
1757
|
+
var columns = args.columns, externalFilters = args.externalFilters, filterDefs = args.filterDefs;
|
|
1758
|
+
var inlineColumn = {};
|
|
1759
|
+
var columnFilter = {};
|
|
1760
|
+
var inlineExternal = {};
|
|
1761
|
+
var externalFilter = {};
|
|
1762
|
+
var inlineFilterDef = {};
|
|
1763
|
+
var filterDef = {};
|
|
1764
|
+
try {
|
|
1765
|
+
// Filter column
|
|
1766
|
+
for (var _u = __values((columns || [])), _v = _u.next(); !_v.done; _v = _u.next()) {
|
|
1767
|
+
var item = _v.value;
|
|
1768
|
+
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;
|
|
1769
|
+
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;
|
|
1770
|
+
}
|
|
1771
|
+
}
|
|
1772
|
+
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
1773
|
+
finally {
|
|
1774
|
+
try {
|
|
1775
|
+
if (_v && !_v.done && (_r = _u.return)) _r.call(_u);
|
|
1776
|
+
}
|
|
1777
|
+
finally { if (e_1) throw e_1.error; }
|
|
1778
|
+
}
|
|
1779
|
+
try {
|
|
1780
|
+
// Filter external
|
|
1781
|
+
for (var _w = __values((externalFilters || [])), _x = _w.next(); !_x.done; _x = _w.next()) {
|
|
1782
|
+
var item = _x.value;
|
|
1783
|
+
inlineExternal[item.field] = (_e = inlineExternal[item.field]) !== null && _e !== void 0 ? _e : item === null || item === void 0 ? void 0 : item.defaultShowing;
|
|
1784
|
+
if (item.type === 'daterange') {
|
|
1785
|
+
externalFilter[item.field] = {
|
|
1786
|
+
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,
|
|
1787
|
+
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
|
|
1788
|
+
};
|
|
1789
|
+
}
|
|
1790
|
+
else {
|
|
1791
|
+
externalFilter[item.field] = (_p = externalFilter[item.field]) !== null && _p !== void 0 ? _p : item.default;
|
|
1792
|
+
}
|
|
1793
|
+
}
|
|
1794
|
+
}
|
|
1795
|
+
catch (e_2_1) { e_2 = { error: e_2_1 }; }
|
|
1796
|
+
finally {
|
|
1797
|
+
try {
|
|
1798
|
+
if (_x && !_x.done && (_s = _w.return)) _s.call(_w);
|
|
1799
|
+
}
|
|
1800
|
+
finally { if (e_2) throw e_2.error; }
|
|
1801
|
+
}
|
|
1802
|
+
try {
|
|
1803
|
+
// Filter def
|
|
1804
|
+
for (var _y = __values((filterDefs || [])), _z = _y.next(); !_z.done; _z = _y.next()) {
|
|
1805
|
+
var item = _z.value;
|
|
1806
|
+
inlineFilterDef[item.sdMaterialFilterDef] = (_q = inlineFilterDef[item.sdMaterialFilterDef]) !== null && _q !== void 0 ? _q : item === null || item === void 0 ? void 0 : item.defaultShowing;
|
|
1807
|
+
}
|
|
1808
|
+
}
|
|
1809
|
+
catch (e_3_1) { e_3 = { error: e_3_1 }; }
|
|
1810
|
+
finally {
|
|
1811
|
+
try {
|
|
1812
|
+
if (_z && !_z.done && (_t = _y.return)) _t.call(_y);
|
|
1813
|
+
}
|
|
1814
|
+
finally { if (e_3) throw e_3.error; }
|
|
1815
|
+
}
|
|
1816
|
+
return {
|
|
1817
|
+
quickFilters: [],
|
|
1818
|
+
selectedQuickFilter: null,
|
|
1819
|
+
inlineColumn: inlineColumn,
|
|
1820
|
+
columnFilter: columnFilter,
|
|
1821
|
+
inlineExternal: inlineExternal,
|
|
1822
|
+
externalFilter: externalFilter,
|
|
1823
|
+
inlineFilterDef: inlineFilterDef,
|
|
1824
|
+
filterDef: filterDef,
|
|
1825
|
+
};
|
|
1826
|
+
});
|
|
1827
|
+
this.get = function (key) {
|
|
1828
|
+
var _a;
|
|
1829
|
+
if (!key) {
|
|
1830
|
+
return {
|
|
1831
|
+
selectedQuickFilter: null,
|
|
1832
|
+
quickFilters: [],
|
|
1833
|
+
inlineExternal: {},
|
|
1834
|
+
inlineColumn: {},
|
|
1835
|
+
inlineFilterDef: {}
|
|
1836
|
+
};
|
|
1837
|
+
}
|
|
1838
|
+
var get = _this.settingService.create({
|
|
1839
|
+
prefix: __classPrivateFieldGet(_this, _prefix$1),
|
|
1840
|
+
key: key
|
|
1841
|
+
}).get;
|
|
1842
|
+
var configuration = get();
|
|
1843
|
+
return {
|
|
1844
|
+
selectedQuickFilter: (_a = configuration === null || configuration === void 0 ? void 0 : configuration.selectedQuickFilter) !== null && _a !== void 0 ? _a : null,
|
|
1845
|
+
quickFilters: (configuration === null || configuration === void 0 ? void 0 : configuration.quickFilters) || [],
|
|
1846
|
+
inlineExternal: (configuration === null || configuration === void 0 ? void 0 : configuration.inlineExternal) || {},
|
|
1847
|
+
inlineColumn: (configuration === null || configuration === void 0 ? void 0 : configuration.inlineColumn) || {},
|
|
1848
|
+
inlineFilterDef: (configuration === null || configuration === void 0 ? void 0 : configuration.inlineFilterDef) || {},
|
|
1849
|
+
};
|
|
1850
|
+
};
|
|
1851
|
+
this.set = function (key, configuration) {
|
|
1852
|
+
configuration = {
|
|
1853
|
+
selectedQuickFilter: (configuration === null || configuration === void 0 ? void 0 : configuration.selectedQuickFilter) || null,
|
|
1854
|
+
quickFilters: (configuration === null || configuration === void 0 ? void 0 : configuration.quickFilters) || [],
|
|
1855
|
+
inlineExternal: configuration.inlineExternal || {},
|
|
1856
|
+
inlineColumn: configuration.inlineColumn || {},
|
|
1857
|
+
inlineFilterDef: configuration.inlineFilterDef || {}
|
|
1858
|
+
};
|
|
1859
|
+
if (!key) {
|
|
1860
|
+
return configuration;
|
|
1861
|
+
}
|
|
1862
|
+
var set = _this.settingService.create({
|
|
1863
|
+
prefix: __classPrivateFieldGet(_this, _prefix$1),
|
|
1864
|
+
key: key
|
|
1865
|
+
}).set;
|
|
1866
|
+
key = hash__default['default']({
|
|
1867
|
+
prefix: __classPrivateFieldGet(_this, _prefix$1),
|
|
1868
|
+
key: key
|
|
1869
|
+
});
|
|
1870
|
+
set(configuration);
|
|
1871
|
+
return configuration;
|
|
1872
|
+
};
|
|
1873
|
+
}
|
|
1874
|
+
return SdGridFilterService;
|
|
1875
|
+
}());
|
|
1876
|
+
_prefix$1 = new WeakMap(), _loadDefault = new WeakMap();
|
|
1877
|
+
SdGridFilterService.decorators = [
|
|
1878
|
+
{ type: core.Injectable }
|
|
1879
|
+
];
|
|
1880
|
+
SdGridFilterService.ctorParameters = function () { return [
|
|
1881
|
+
{ type: setting.SdSettingService }
|
|
1882
|
+
]; };
|
|
1883
|
+
|
|
1884
|
+
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
1885
|
var SdGridMaterial = /** @class */ (function () {
|
|
1832
|
-
function SdGridMaterial(ref, configuration, gridConfigurationService, exportService, notifyService,
|
|
1886
|
+
function SdGridMaterial(ref, configuration, gridConfigurationService, exportService, notifyService, columnValuesPipe, gridFilterService, editorHandlerColumnPipe) {
|
|
1833
1887
|
var _this = this;
|
|
1834
1888
|
this.ref = ref;
|
|
1835
1889
|
this.configuration = configuration;
|
|
1836
1890
|
this.gridConfigurationService = gridConfigurationService;
|
|
1837
1891
|
this.exportService = exportService;
|
|
1838
1892
|
this.notifyService = notifyService;
|
|
1839
|
-
this.translateService = translateService;
|
|
1840
1893
|
this.columnValuesPipe = columnValuesPipe;
|
|
1894
|
+
this.gridFilterService = gridFilterService;
|
|
1841
1895
|
this.editorHandlerColumnPipe = editorHandlerColumnPipe;
|
|
1842
1896
|
this.key = uuid.v4();
|
|
1843
1897
|
_localItems.set(this, []);
|
|
@@ -1863,7 +1917,7 @@
|
|
|
1863
1917
|
// Filter
|
|
1864
1918
|
this.columnFilter = {};
|
|
1865
1919
|
// Subcription
|
|
1866
|
-
_subscription$
|
|
1920
|
+
_subscription$2.set(this, new rxjs.Subscription());
|
|
1867
1921
|
_reload.set(this, new rxjs.BehaviorSubject({
|
|
1868
1922
|
force: true
|
|
1869
1923
|
}));
|
|
@@ -1906,6 +1960,7 @@
|
|
|
1906
1960
|
}
|
|
1907
1961
|
finally { if (e_2) throw e_2.error; }
|
|
1908
1962
|
}
|
|
1963
|
+
__classPrivateFieldGet(_this, _loadFilterRegister).call(_this);
|
|
1909
1964
|
});
|
|
1910
1965
|
_initFooterDef.set(this, function () {
|
|
1911
1966
|
var e_3, _3;
|
|
@@ -1929,13 +1984,14 @@
|
|
|
1929
1984
|
}
|
|
1930
1985
|
});
|
|
1931
1986
|
_filterExportInfo.set(this, function (pageNumber, pageSize) {
|
|
1932
|
-
var _a, _b
|
|
1987
|
+
var _a, _b;
|
|
1988
|
+
var _3 = _this.filterRegister.get(), columnFilter = _3.columnFilter, externalFilter = _3.externalFilter, filterDef = _3.filterDef;
|
|
1933
1989
|
return {
|
|
1934
|
-
rawColumnFilter:
|
|
1935
|
-
rawExternalFilter:
|
|
1936
|
-
rawFilterDef:
|
|
1937
|
-
orderBy: ((
|
|
1938
|
-
orderDirection: ((
|
|
1990
|
+
rawColumnFilter: columnFilter || {},
|
|
1991
|
+
rawExternalFilter: externalFilter || {},
|
|
1992
|
+
rawFilterDef: filterDef || {},
|
|
1993
|
+
orderBy: ((_a = __classPrivateFieldGet(_this, _sort)) === null || _a === void 0 ? void 0 : _a.active) || '',
|
|
1994
|
+
orderDirection: ((_b = __classPrivateFieldGet(_this, _sort)) === null || _b === void 0 ? void 0 : _b.direction) || '',
|
|
1939
1995
|
pageNumber: pageNumber,
|
|
1940
1996
|
pageSize: pageSize,
|
|
1941
1997
|
isExported: true
|
|
@@ -1943,6 +1999,7 @@
|
|
|
1943
1999
|
});
|
|
1944
2000
|
_initConfiguration.set(this, function (option) {
|
|
1945
2001
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
|
|
2002
|
+
// Init pagination
|
|
1946
2003
|
option.paginate = {
|
|
1947
2004
|
hidden: (_a = option === null || option === void 0 ? void 0 : option.paginate) === null || _a === void 0 ? void 0 : _a.hidden,
|
|
1948
2005
|
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 +2008,22 @@
|
|
|
1951
2008
|
};
|
|
1952
2009
|
return option;
|
|
1953
2010
|
});
|
|
2011
|
+
_loadFilterRegister.set(this, function () {
|
|
2012
|
+
var _a, _b, _c, _d, _e;
|
|
2013
|
+
// Init filter
|
|
2014
|
+
_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, {
|
|
2015
|
+
columns: (_c = _this.gridOption) === null || _c === void 0 ? void 0 : _c.columns,
|
|
2016
|
+
externalFilters: (_e = (_d = _this.gridOption) === null || _d === void 0 ? void 0 : _d.filter) === null || _e === void 0 ? void 0 : _e.externalFilters,
|
|
2017
|
+
filterDefs: _this.filterDefs
|
|
2018
|
+
});
|
|
2019
|
+
__classPrivateFieldGet(_this, _subscription$2).add(_this.filterRegister.observer.pipe(operators.debounceTime(500), operators.map(function (configuration) {
|
|
2020
|
+
_this.columnFilter = configuration.columnFilter;
|
|
2021
|
+
__classPrivateFieldGet(_this, _paginator).pageIndex = 0;
|
|
2022
|
+
__classPrivateFieldGet(_this, _reload).next({
|
|
2023
|
+
force: false,
|
|
2024
|
+
});
|
|
2025
|
+
})).subscribe());
|
|
2026
|
+
});
|
|
1954
2027
|
_filterLocal.set(this, function (localItems, filterInfo) {
|
|
1955
2028
|
var columns = _this.gridOption.columns;
|
|
1956
2029
|
var rawColumnFilter = filterInfo.rawColumnFilter, orderBy = filterInfo.orderBy, orderDirection = filterInfo.orderDirection, pageSize = filterInfo.pageSize, pageNumber = filterInfo.pageNumber;
|
|
@@ -2079,16 +2152,17 @@
|
|
|
2079
2152
|
};
|
|
2080
2153
|
});
|
|
2081
2154
|
_getFilter.set(this, function () {
|
|
2082
|
-
var _a, _b, _c, _d, _e, _f
|
|
2083
|
-
|
|
2084
|
-
|
|
2085
|
-
|
|
2086
|
-
|
|
2087
|
-
|
|
2088
|
-
|
|
2089
|
-
|
|
2090
|
-
|
|
2091
|
-
|
|
2155
|
+
var _a, _b, _c, _d, _e, _f;
|
|
2156
|
+
var _3 = _this.filterRegister.get(), columnFilter = _3.columnFilter, externalFilter = _3.externalFilter, filterDef = _3.filterDef;
|
|
2157
|
+
return {
|
|
2158
|
+
rawColumnFilter: columnFilter || {},
|
|
2159
|
+
rawExternalFilter: externalFilter || {},
|
|
2160
|
+
rawFilterDef: filterDef || {},
|
|
2161
|
+
orderBy: ((_a = __classPrivateFieldGet(_this, _sort)) === null || _a === void 0 ? void 0 : _a.active) || '',
|
|
2162
|
+
orderDirection: ((_b = __classPrivateFieldGet(_this, _sort)) === null || _b === void 0 ? void 0 : _b.direction) || '',
|
|
2163
|
+
pageNumber: ((_c = __classPrivateFieldGet(_this, _paginator)) === null || _c === void 0 ? void 0 : _c.pageIndex) || 0,
|
|
2164
|
+
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
|
|
2165
|
+
};
|
|
2092
2166
|
});
|
|
2093
2167
|
_load$1.set(this, function (filterReq, force) {
|
|
2094
2168
|
if (force === void 0) { force = true; }
|
|
@@ -2713,18 +2787,23 @@
|
|
|
2713
2787
|
_this.ref.detectChanges();
|
|
2714
2788
|
});
|
|
2715
2789
|
this.clearFilter = function () {
|
|
2716
|
-
|
|
2717
|
-
if (
|
|
2718
|
-
|
|
2719
|
-
}
|
|
2720
|
-
|
|
2790
|
+
_this.filterRegister.remove();
|
|
2791
|
+
// if (this.gridOption?.filter?.inlineColumn) {
|
|
2792
|
+
// this.columnFilter = {};
|
|
2793
|
+
// }
|
|
2794
|
+
// this.gridFilter?.onClearFilter();
|
|
2721
2795
|
};
|
|
2722
2796
|
this.setFilter = function (args) {
|
|
2723
|
-
var
|
|
2724
|
-
|
|
2725
|
-
|
|
2726
|
-
|
|
2727
|
-
|
|
2797
|
+
var _3 = args || {}, columnFilter = _3.columnFilter, externalFilter = _3.externalFilter, filterDef = _3.filterDef;
|
|
2798
|
+
_this.filterRegister.set({
|
|
2799
|
+
columnFilter: columnFilter,
|
|
2800
|
+
externalFilter: externalFilter,
|
|
2801
|
+
filterDef: filterDef
|
|
2802
|
+
});
|
|
2803
|
+
// if (this.gridOption?.filter?.inlineColumn && args?.columnFilter) {
|
|
2804
|
+
// this.columnFilter = args.columnFilter;
|
|
2805
|
+
// }
|
|
2806
|
+
// this.gridFilter?.setFilter(args);
|
|
2728
2807
|
};
|
|
2729
2808
|
this.onCreate = function () {
|
|
2730
2809
|
var _a, _b;
|
|
@@ -2951,16 +3030,19 @@
|
|
|
2951
3030
|
}
|
|
2952
3031
|
Object.defineProperty(SdGridMaterial.prototype, "_gridFilter", {
|
|
2953
3032
|
set: function (gridFilter) {
|
|
2954
|
-
var _this = this;
|
|
2955
3033
|
if (gridFilter && this.gridFilter !== gridFilter) {
|
|
2956
3034
|
this.gridFilter = gridFilter;
|
|
2957
|
-
|
|
2958
|
-
|
|
2959
|
-
|
|
2960
|
-
|
|
2961
|
-
|
|
2962
|
-
|
|
2963
|
-
|
|
3035
|
+
// this.#subscription.add(gridFilter.filterChange.pipe(
|
|
3036
|
+
// filter(reload => reload),
|
|
3037
|
+
// debounceTime(500),
|
|
3038
|
+
// map(() => {
|
|
3039
|
+
// this.#paginator.pageIndex = 0;
|
|
3040
|
+
// this.#reload.next({
|
|
3041
|
+
// force: false,
|
|
3042
|
+
// source: 'FILTER'
|
|
3043
|
+
// });
|
|
3044
|
+
// }),
|
|
3045
|
+
// ).subscribe());
|
|
2964
3046
|
}
|
|
2965
3047
|
},
|
|
2966
3048
|
enumerable: false,
|
|
@@ -2968,22 +3050,14 @@
|
|
|
2968
3050
|
});
|
|
2969
3051
|
Object.defineProperty(SdGridMaterial.prototype, "option", {
|
|
2970
3052
|
set: function (option) {
|
|
2971
|
-
var _this = this;
|
|
2972
|
-
var _a;
|
|
2973
3053
|
if (option) {
|
|
2974
3054
|
option = __classPrivateFieldGet(this, _initConfiguration).call(this, option);
|
|
2975
3055
|
this.gridOption = option;
|
|
3056
|
+
__classPrivateFieldGet(this, _loadFilterRegister).call(this);
|
|
2976
3057
|
__classPrivateFieldSet(this, _loadCompleted, false);
|
|
2977
|
-
|
|
2978
|
-
|
|
2979
|
-
|
|
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
|
-
});
|
|
3058
|
+
// this.#reload.next({
|
|
3059
|
+
// force: true,
|
|
3060
|
+
// });
|
|
2987
3061
|
var configuration = this.gridConfigurationService.init(this.key, this.gridOption);
|
|
2988
3062
|
this.gridConfigurationObserver = configuration.observer;
|
|
2989
3063
|
configuration.load();
|
|
@@ -2997,7 +3071,7 @@
|
|
|
2997
3071
|
var _this = this;
|
|
2998
3072
|
if (paginator && __classPrivateFieldGet(this, _paginator) !== paginator) {
|
|
2999
3073
|
__classPrivateFieldSet(this, _paginator, paginator);
|
|
3000
|
-
__classPrivateFieldGet(this, _subscription$
|
|
3074
|
+
__classPrivateFieldGet(this, _subscription$2).add(paginator.page.pipe(operators.map(function () {
|
|
3001
3075
|
__classPrivateFieldGet(_this, _reload).next({
|
|
3002
3076
|
force: false
|
|
3003
3077
|
});
|
|
@@ -3012,7 +3086,7 @@
|
|
|
3012
3086
|
var _this = this;
|
|
3013
3087
|
if (sort && __classPrivateFieldGet(this, _sort) !== sort) {
|
|
3014
3088
|
__classPrivateFieldSet(this, _sort, sort);
|
|
3015
|
-
__classPrivateFieldGet(this, _subscription$
|
|
3089
|
+
__classPrivateFieldGet(this, _subscription$2).add(sort.sortChange.pipe(operators.map(function () {
|
|
3016
3090
|
__classPrivateFieldGet(_this, _reload).next({
|
|
3017
3091
|
force: false
|
|
3018
3092
|
});
|
|
@@ -3027,18 +3101,7 @@
|
|
|
3027
3101
|
};
|
|
3028
3102
|
SdGridMaterial.prototype.ngAfterViewInit = function () {
|
|
3029
3103
|
var _this = this;
|
|
3030
|
-
__classPrivateFieldGet(this, _subscription$
|
|
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 () {
|
|
3104
|
+
__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
3105
|
var filterInfo, result;
|
|
3043
3106
|
return __generator(this, function (_3) {
|
|
3044
3107
|
switch (_3.label) {
|
|
@@ -3052,9 +3115,9 @@
|
|
|
3052
3115
|
}
|
|
3053
3116
|
});
|
|
3054
3117
|
}); })).subscribe(__classPrivateFieldGet(this, _render)));
|
|
3055
|
-
__classPrivateFieldGet(this, _subscription$
|
|
3056
|
-
__classPrivateFieldGet(this, _subscription$
|
|
3057
|
-
__classPrivateFieldGet(this, _subscription$
|
|
3118
|
+
__classPrivateFieldGet(this, _subscription$2).add(this.sdCellDefs.changes.pipe(operators.startWith([])).subscribe(__classPrivateFieldGet(this, _initCellDef)));
|
|
3119
|
+
__classPrivateFieldGet(this, _subscription$2).add(this.sdFooterDefs.changes.pipe(operators.startWith([])).subscribe(__classPrivateFieldGet(this, _initFooterDef)));
|
|
3120
|
+
__classPrivateFieldGet(this, _subscription$2).add(this.sdFilterDefs.changes.pipe(operators.startWith([])).subscribe(__classPrivateFieldGet(this, _initFilterDef)));
|
|
3058
3121
|
// this.#subscription.add(this.#optionChanges.pipe(
|
|
3059
3122
|
// debounceTime(200),
|
|
3060
3123
|
// startWith({}),
|
|
@@ -3064,7 +3127,7 @@
|
|
|
3064
3127
|
this.ref.detectChanges();
|
|
3065
3128
|
};
|
|
3066
3129
|
SdGridMaterial.prototype.ngOnDestroy = function () {
|
|
3067
|
-
__classPrivateFieldGet(this, _subscription$
|
|
3130
|
+
__classPrivateFieldGet(this, _subscription$2).unsubscribe();
|
|
3068
3131
|
};
|
|
3069
3132
|
SdGridMaterial.prototype.drop = function (event, columns) {
|
|
3070
3133
|
dragDrop.moveItemInArray(columns, event.previousIndex, event.currentIndex);
|
|
@@ -3123,11 +3186,11 @@
|
|
|
3123
3186
|
});
|
|
3124
3187
|
return SdGridMaterial;
|
|
3125
3188
|
}());
|
|
3126
|
-
_localItems = new WeakMap(), _paginator = new WeakMap(), _sort = new WeakMap(), _subscription$
|
|
3189
|
+
_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
3190
|
SdGridMaterial.decorators = [
|
|
3128
3191
|
{ type: core.Component, args: [{
|
|
3129
3192
|
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>",
|
|
3193
|
+
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
3194
|
animations: [
|
|
3132
3195
|
animations.trigger('detailExpand', [
|
|
3133
3196
|
animations.state('collapsed', animations.style({ height: '0', minHeight: '0', visibility: 'hidden' })),
|
|
@@ -3144,8 +3207,8 @@
|
|
|
3144
3207
|
{ type: SdGridConfigurationService },
|
|
3145
3208
|
{ type: _export.SdExportService },
|
|
3146
3209
|
{ type: notify.SdNotifyService },
|
|
3147
|
-
{ type: translate.SdTranslateService },
|
|
3148
3210
|
{ type: SdColumnValuesPipe },
|
|
3211
|
+
{ type: SdGridFilterService },
|
|
3149
3212
|
{ type: SdEditorHandlerColumnPipe }
|
|
3150
3213
|
]; };
|
|
3151
3214
|
SdGridMaterial.propDecorators = {
|
|
@@ -4140,7 +4203,7 @@
|
|
|
4140
4203
|
{ type: setting.SdSettingService }
|
|
4141
4204
|
]; };
|
|
4142
4205
|
|
|
4143
|
-
var _subscription$
|
|
4206
|
+
var _subscription$3;
|
|
4144
4207
|
var SdDynamicColumn = /** @class */ (function () {
|
|
4145
4208
|
function SdDynamicColumn(ref, generatedColumnService, notifyService, translateService, gridConfigurationService) {
|
|
4146
4209
|
var _this = this;
|
|
@@ -4149,7 +4212,7 @@
|
|
|
4149
4212
|
this.notifyService = notifyService;
|
|
4150
4213
|
this.translateService = translateService;
|
|
4151
4214
|
this.gridConfigurationService = gridConfigurationService;
|
|
4152
|
-
_subscription$
|
|
4215
|
+
_subscription$3.set(this, new rxjs.Subscription());
|
|
4153
4216
|
this.columnTypes = ['string', 'number', 'bool', 'date', 'datetime', 'time', 'values', 'children', 'children-col'];
|
|
4154
4217
|
this.form = new forms.FormGroup({});
|
|
4155
4218
|
this.isDetail = false;
|
|
@@ -4194,23 +4257,23 @@
|
|
|
4194
4257
|
var systemSetting = this.generatedColumnService.loadSystem(this.gridOption.config);
|
|
4195
4258
|
var setting = this.generatedColumnService.load((_a = this.gridOption) === null || _a === void 0 ? void 0 : _a.config);
|
|
4196
4259
|
if (systemSetting) {
|
|
4197
|
-
(_b = __classPrivateFieldGet(this, _subscription$
|
|
4260
|
+
(_b = __classPrivateFieldGet(this, _subscription$3)) === null || _b === void 0 ? void 0 : _b.add(systemSetting.observer.subscribe(function (columns) {
|
|
4198
4261
|
_this.systemColumns = columns;
|
|
4199
4262
|
}));
|
|
4200
4263
|
}
|
|
4201
4264
|
if (setting) {
|
|
4202
|
-
(_c = __classPrivateFieldGet(this, _subscription$
|
|
4265
|
+
(_c = __classPrivateFieldGet(this, _subscription$3)) === null || _c === void 0 ? void 0 : _c.add(setting.observer.subscribe(function (columns) {
|
|
4203
4266
|
_this.columns = columns;
|
|
4204
4267
|
}));
|
|
4205
4268
|
}
|
|
4206
4269
|
this.originColumns = this.gridOption.columns.filter(function (e) { return e.type !== 'children' && e.type !== 'children-col'; });
|
|
4207
4270
|
};
|
|
4208
4271
|
SdDynamicColumn.prototype.ngOnDestroy = function () {
|
|
4209
|
-
__classPrivateFieldGet(this, _subscription$
|
|
4272
|
+
__classPrivateFieldGet(this, _subscription$3).unsubscribe();
|
|
4210
4273
|
};
|
|
4211
4274
|
return SdDynamicColumn;
|
|
4212
4275
|
}());
|
|
4213
|
-
_subscription$
|
|
4276
|
+
_subscription$3 = new WeakMap();
|
|
4214
4277
|
SdDynamicColumn.decorators = [
|
|
4215
4278
|
{ type: core.Component, args: [{
|
|
4216
4279
|
selector: 'sd-dynamic-column',
|
|
@@ -5128,11 +5191,11 @@
|
|
|
5128
5191
|
exports.ɵbp = SdCellViewPipe;
|
|
5129
5192
|
exports.ɵbq = SdGroupPipe;
|
|
5130
5193
|
exports.ɵc = SdPopupFilter;
|
|
5131
|
-
exports.ɵd =
|
|
5132
|
-
exports.ɵ
|
|
5133
|
-
exports.ɵg =
|
|
5134
|
-
exports.ɵh =
|
|
5135
|
-
exports.ɵi =
|
|
5194
|
+
exports.ɵd = SdPopupExport;
|
|
5195
|
+
exports.ɵf = GRID_MATERIAL_CONFIG;
|
|
5196
|
+
exports.ɵg = SdGridConfigurationService;
|
|
5197
|
+
exports.ɵh = SdColumnValuesPipe;
|
|
5198
|
+
exports.ɵi = SdGridFilterService;
|
|
5136
5199
|
exports.ɵj = SdEditorHandlerColumnPipe;
|
|
5137
5200
|
exports.ɵk = SdGridQuickAction;
|
|
5138
5201
|
exports.ɵl = SdDesktopCell;
|