@sd-angular/core 1.3.98 → 1.3.100
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 +224 -251
- 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/src/lib/components/grid-filter/grid-filter.component.js +17 -54
- package/esm2015/grid-material/src/lib/components/popup-filter/popup-filter.component.js +14 -31
- package/esm2015/grid-material/src/lib/grid-material.component.js +19 -21
- package/esm2015/grid-material/src/lib/services/grid-filter/grid-filter.model.js +1 -1
- package/esm2015/grid-material/src/lib/services/grid-filter/grid-filter.service.js +123 -121
- package/fesm2015/sd-angular-core-grid-material.js +189 -241
- package/fesm2015/sd-angular-core-grid-material.js.map +1 -1
- package/grid-material/sd-angular-core-grid-material.metadata.json +1 -1
- package/grid-material/src/lib/components/grid-filter/grid-filter.component.d.ts +1 -1
- package/grid-material/src/lib/services/grid-filter/grid-filter.model.d.ts +17 -10
- package/grid-material/src/lib/services/grid-filter/grid-filter.service.d.ts +1 -3
- package/package.json +1 -1
- package/{sd-angular-core-1.3.98.tgz → sd-angular-core-1.3.100.tgz} +0 -0
|
@@ -451,22 +451,16 @@
|
|
|
451
451
|
_this.cdRef.markForCheck();
|
|
452
452
|
};
|
|
453
453
|
this.onApply = function () {
|
|
454
|
-
__classPrivateFieldGet(_this, _filterRegister).set({
|
|
454
|
+
__classPrivateFieldGet(_this, _filterRegister).configuration.set({
|
|
455
455
|
inlineColumn: _this.inlineColumn,
|
|
456
|
-
columnFilter: _this.columnFilter,
|
|
457
456
|
inlineExternal: _this.inlineExternal,
|
|
458
|
-
externalFilter: _this.externalFilter,
|
|
459
457
|
inlineFilterDef: _this.inlineFilterDef,
|
|
458
|
+
});
|
|
459
|
+
__classPrivateFieldGet(_this, _filterRegister).value.set({
|
|
460
|
+
columnFilter: _this.columnFilter,
|
|
461
|
+
externalFilter: _this.externalFilter,
|
|
460
462
|
filterDef: _this.filterDef
|
|
461
463
|
});
|
|
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
|
-
// });
|
|
470
464
|
_this.modal.close();
|
|
471
465
|
_this.cdRef.markForCheck();
|
|
472
466
|
};
|
|
@@ -481,27 +475,16 @@
|
|
|
481
475
|
;
|
|
482
476
|
SdPopupFilter.prototype.ngAfterViewInit = function () {
|
|
483
477
|
var _this = this;
|
|
484
|
-
|
|
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) {
|
|
478
|
+
__classPrivateFieldGet(this, _subscription).add(__classPrivateFieldGet(this, _filterRegister).configuration.observer.subscribe(function (configuration) {
|
|
499
479
|
_this.inlineColumn = JSON.parse(JSON.stringify(configuration.inlineColumn));
|
|
500
|
-
_this.columnFilter = JSON.parse(JSON.stringify(configuration.columnFilter));
|
|
501
480
|
_this.inlineExternal = JSON.parse(JSON.stringify(configuration.inlineExternal));
|
|
502
|
-
_this.externalFilter = JSON.parse(JSON.stringify(configuration.externalFilter));
|
|
503
481
|
_this.inlineFilterDef = JSON.parse(JSON.stringify(configuration.inlineFilterDef));
|
|
504
|
-
_this.
|
|
482
|
+
_this.cdRef.markForCheck();
|
|
483
|
+
}));
|
|
484
|
+
__classPrivateFieldGet(this, _subscription).add(__classPrivateFieldGet(this, _filterRegister).value.observer.subscribe(function (filterValue) {
|
|
485
|
+
_this.columnFilter = JSON.parse(JSON.stringify(filterValue.columnFilter));
|
|
486
|
+
_this.externalFilter = JSON.parse(JSON.stringify(filterValue.externalFilter));
|
|
487
|
+
_this.filterDef = JSON.parse(JSON.stringify(filterValue.filterDef));
|
|
505
488
|
_this.cdRef.markForCheck();
|
|
506
489
|
}));
|
|
507
490
|
};
|
|
@@ -509,7 +492,7 @@
|
|
|
509
492
|
__classPrivateFieldGet(this, _subscription).unsubscribe();
|
|
510
493
|
};
|
|
511
494
|
SdPopupFilter.prototype.onClear = function () {
|
|
512
|
-
__classPrivateFieldGet(this, _filterRegister).remove();
|
|
495
|
+
__classPrivateFieldGet(this, _filterRegister).value.remove();
|
|
513
496
|
this.modal.close();
|
|
514
497
|
this.cdRef.markForCheck();
|
|
515
498
|
};
|
|
@@ -553,20 +536,15 @@
|
|
|
553
536
|
this.inlineExternal = {};
|
|
554
537
|
_subscription$1.set(this, new rxjs.Subscription());
|
|
555
538
|
this.onFilter = function (item) {
|
|
556
|
-
_this.filterRegister.set({
|
|
539
|
+
_this.filterRegister.value.set({
|
|
557
540
|
columnFilter: _this.columnFilter,
|
|
558
541
|
externalFilter: _this.externalFilter,
|
|
559
542
|
filterDef: _this.filterDef
|
|
560
543
|
});
|
|
561
|
-
// this.filterChange.next(true);
|
|
562
544
|
};
|
|
563
545
|
this.open = function () {
|
|
564
546
|
_this.popupFilter.open();
|
|
565
547
|
};
|
|
566
|
-
this.onReset = function () {
|
|
567
|
-
_this.filterRegister.remove();
|
|
568
|
-
_this.ref.markForCheck();
|
|
569
|
-
};
|
|
570
548
|
this.isMobileOrTablet = !this.deviceService.isDesktop();
|
|
571
549
|
this.ref.markForCheck();
|
|
572
550
|
}
|
|
@@ -577,6 +555,13 @@
|
|
|
577
555
|
enumerable: false,
|
|
578
556
|
configurable: true
|
|
579
557
|
});
|
|
558
|
+
Object.defineProperty(SdGridFilter.prototype, "_externalFilters", {
|
|
559
|
+
set: function (value) {
|
|
560
|
+
this.externalFilters = value || [];
|
|
561
|
+
},
|
|
562
|
+
enumerable: false,
|
|
563
|
+
configurable: true
|
|
564
|
+
});
|
|
580
565
|
Object.defineProperty(SdGridFilter.prototype, "_filterRegister", {
|
|
581
566
|
set: function (value) {
|
|
582
567
|
this.filterRegister = value;
|
|
@@ -588,53 +573,19 @@
|
|
|
588
573
|
;
|
|
589
574
|
SdGridFilter.prototype.ngAfterViewInit = function () {
|
|
590
575
|
var _this = this;
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
// this.filterChange.next(true);
|
|
603
|
-
// this.ref.markForCheck();
|
|
604
|
-
// }));
|
|
605
|
-
__classPrivateFieldGet(this, _subscription$1).add(this.filterRegisterChange.pipe(operators.startWith(this.filterRegister)).subscribe(function () {
|
|
606
|
-
__classPrivateFieldGet(_this, _subscription$1).add(_this.filterRegister.observer.subscribe(function (configuration) {
|
|
607
|
-
_this.inlineColumn = configuration.inlineColumn;
|
|
608
|
-
_this.columnFilter = configuration.columnFilter;
|
|
609
|
-
_this.inlineExternal = configuration.inlineExternal;
|
|
610
|
-
_this.externalFilter = configuration.externalFilter;
|
|
611
|
-
_this.inlineFilterDef = configuration.inlineFilterDef;
|
|
612
|
-
_this.filterDef = configuration.filterDef;
|
|
613
|
-
_this.ref.markForCheck();
|
|
614
|
-
}));
|
|
576
|
+
__classPrivateFieldGet(this, _subscription$1).add(this.filterRegister.configuration.observer.subscribe(function (configuration) {
|
|
577
|
+
_this.inlineColumn = configuration.inlineColumn;
|
|
578
|
+
_this.inlineExternal = configuration.inlineExternal;
|
|
579
|
+
_this.inlineFilterDef = configuration.inlineFilterDef;
|
|
580
|
+
_this.ref.markForCheck();
|
|
581
|
+
}));
|
|
582
|
+
__classPrivateFieldGet(this, _subscription$1).add(this.filterRegister.value.observer.subscribe(function (value) {
|
|
583
|
+
_this.columnFilter = value.columnFilter;
|
|
584
|
+
_this.externalFilter = value.externalFilter;
|
|
585
|
+
_this.filterDef = value.filterDef;
|
|
586
|
+
_this.ref.markForCheck();
|
|
615
587
|
}));
|
|
616
588
|
};
|
|
617
|
-
// #loadDefault = () => {
|
|
618
|
-
// for (const column of this.columns) {
|
|
619
|
-
// this.inlineColumn[column.field] = this.inlineColumn[column.field] ?? column?.filter?.defaultShowing;
|
|
620
|
-
// this.columnFilter[column.field] = this.columnFilter[column.field] ?? column?.filter?.default;
|
|
621
|
-
// }
|
|
622
|
-
// for (const externalFilter of this.externalFilters) {
|
|
623
|
-
// this.inlineExternal[externalFilter.field] = this.inlineExternal[externalFilter.field] ?? externalFilter?.defaultShowing;
|
|
624
|
-
// if (externalFilter.type === 'daterange') {
|
|
625
|
-
// this.externalFilter[externalFilter.field] = {
|
|
626
|
-
// from: this.externalFilter[externalFilter.field]?.from ?? externalFilter.default?.from ?? undefined,
|
|
627
|
-
// to: this.externalFilter[externalFilter.field]?.to ?? externalFilter.default?.to ?? undefined
|
|
628
|
-
// };
|
|
629
|
-
// } else {
|
|
630
|
-
// this.externalFilter[externalFilter.field] = this.externalFilter[externalFilter.field] ?? externalFilter.default;
|
|
631
|
-
// }
|
|
632
|
-
// }
|
|
633
|
-
// for (const filterDef of this.filterDefs) {
|
|
634
|
-
// this.inlineFilterDef[filterDef.sdMaterialFilterDef] =
|
|
635
|
-
// this.inlineFilterDef[filterDef.sdMaterialFilterDef] ?? filterDef?.defaultShowing;
|
|
636
|
-
// }
|
|
637
|
-
// }
|
|
638
589
|
SdGridFilter.prototype.ngOnDestroy = function () {
|
|
639
590
|
__classPrivateFieldGet(this, _subscription$1).unsubscribe();
|
|
640
591
|
};
|
|
@@ -657,7 +608,7 @@
|
|
|
657
608
|
popupFilter: [{ type: core.ViewChild, args: [SdPopupFilter,] }],
|
|
658
609
|
_filter: [{ type: core.Input, args: ['filter',] }],
|
|
659
610
|
columns: [{ type: core.Input }],
|
|
660
|
-
|
|
611
|
+
_externalFilters: [{ type: core.Input, args: ['externalFilters',] }],
|
|
661
612
|
filterDefs: [{ type: core.Input }],
|
|
662
613
|
_filterRegister: [{ type: core.Input, args: ['filterRegister',] }]
|
|
663
614
|
};
|
|
@@ -1683,193 +1634,217 @@
|
|
|
1683
1634
|
{ type: core.NgZone }
|
|
1684
1635
|
]; };
|
|
1685
1636
|
|
|
1686
|
-
var
|
|
1637
|
+
var _filterConfiguration, _filterValue, _cache$2, _loadDefaultConfiguration, _loadDefaultValue;
|
|
1687
1638
|
var SdGridFilterService = /** @class */ (function () {
|
|
1688
1639
|
function SdGridFilterService(settingService) {
|
|
1689
1640
|
var _this = this;
|
|
1690
1641
|
this.settingService = settingService;
|
|
1691
|
-
|
|
1642
|
+
_filterConfiguration.set(this, 'GRID-FILTER-CONFIGURATION');
|
|
1643
|
+
_filterValue.set(this, 'GRID-FILTER-VALUE');
|
|
1644
|
+
_cache$2.set(this, {});
|
|
1692
1645
|
this.register = function (key, args) {
|
|
1693
1646
|
var cacheSession = false;
|
|
1694
1647
|
if (!key) {
|
|
1695
|
-
|
|
1648
|
+
var columns = args.columns, externalFilters = args.externalFilters;
|
|
1649
|
+
key = hash__default['default']({
|
|
1650
|
+
columns: columns,
|
|
1651
|
+
externalFilters: externalFilters
|
|
1652
|
+
});
|
|
1696
1653
|
cacheSession = true; // Nếu không có key thì chỉ lưu theo session
|
|
1697
1654
|
}
|
|
1698
|
-
|
|
1699
|
-
|
|
1700
|
-
|
|
1701
|
-
|
|
1702
|
-
|
|
1703
|
-
|
|
1704
|
-
|
|
1705
|
-
|
|
1706
|
-
|
|
1707
|
-
|
|
1708
|
-
|
|
1709
|
-
|
|
1710
|
-
|
|
1711
|
-
|
|
1712
|
-
|
|
1713
|
-
|
|
1714
|
-
|
|
1715
|
-
|
|
1716
|
-
|
|
1717
|
-
|
|
1718
|
-
|
|
1719
|
-
|
|
1720
|
-
|
|
1721
|
-
|
|
1722
|
-
|
|
1723
|
-
|
|
1724
|
-
|
|
1725
|
-
|
|
1726
|
-
|
|
1727
|
-
|
|
1728
|
-
|
|
1729
|
-
|
|
1730
|
-
|
|
1731
|
-
|
|
1732
|
-
|
|
1733
|
-
|
|
1734
|
-
|
|
1735
|
-
|
|
1736
|
-
|
|
1737
|
-
|
|
1738
|
-
|
|
1739
|
-
|
|
1740
|
-
|
|
1741
|
-
|
|
1742
|
-
|
|
1743
|
-
|
|
1744
|
-
|
|
1745
|
-
|
|
1746
|
-
|
|
1747
|
-
|
|
1748
|
-
|
|
1655
|
+
if (!__classPrivateFieldGet(_this, _cache$2)[key]) {
|
|
1656
|
+
var filterConfiguration_1 = _this.settingService.create({
|
|
1657
|
+
prefix: __classPrivateFieldGet(_this, _filterConfiguration),
|
|
1658
|
+
key: key
|
|
1659
|
+
}, {
|
|
1660
|
+
default: __classPrivateFieldGet(_this, _loadDefaultConfiguration).call(_this, args),
|
|
1661
|
+
type: cacheSession ? 'session' : undefined
|
|
1662
|
+
});
|
|
1663
|
+
var filterValue_1 = _this.settingService.create({
|
|
1664
|
+
prefix: __classPrivateFieldGet(_this, _filterValue),
|
|
1665
|
+
key: key
|
|
1666
|
+
}, {
|
|
1667
|
+
default: __classPrivateFieldGet(_this, _loadDefaultValue).call(_this, args),
|
|
1668
|
+
type: cacheSession ? 'session' : undefined
|
|
1669
|
+
});
|
|
1670
|
+
__classPrivateFieldGet(_this, _cache$2)[key] = {
|
|
1671
|
+
configuration: {
|
|
1672
|
+
get: function () {
|
|
1673
|
+
var configuration = filterConfiguration_1.get();
|
|
1674
|
+
return {
|
|
1675
|
+
// Filter column
|
|
1676
|
+
inlineColumn: (configuration === null || configuration === void 0 ? void 0 : configuration.inlineColumn) || {},
|
|
1677
|
+
// Filter external
|
|
1678
|
+
inlineExternal: (configuration === null || configuration === void 0 ? void 0 : configuration.inlineExternal) || {},
|
|
1679
|
+
// Filter def
|
|
1680
|
+
inlineFilterDef: (configuration === null || configuration === void 0 ? void 0 : configuration.inlineFilterDef) || {},
|
|
1681
|
+
};
|
|
1682
|
+
},
|
|
1683
|
+
set: function (configuration) {
|
|
1684
|
+
var keys = Object.keys(configuration || {});
|
|
1685
|
+
var current = filterConfiguration_1.get();
|
|
1686
|
+
var inlineColumn = current.inlineColumn, inlineExternal = current.inlineExternal, inlineFilterDef = current.inlineFilterDef;
|
|
1687
|
+
var updatedConfiguration = {
|
|
1688
|
+
// Filter column
|
|
1689
|
+
inlineColumn: keys.includes('inlineColumn') ? ((configuration === null || configuration === void 0 ? void 0 : configuration.inlineColumn) || {}) : inlineColumn,
|
|
1690
|
+
// Filter external
|
|
1691
|
+
inlineExternal: keys.includes('inlineExternal') ? ((configuration === null || configuration === void 0 ? void 0 : configuration.inlineExternal) || {}) : inlineExternal,
|
|
1692
|
+
// Filter def
|
|
1693
|
+
inlineFilterDef: keys.includes('inlineFilterDef') ? ((configuration === null || configuration === void 0 ? void 0 : configuration.inlineFilterDef) || {}) : inlineFilterDef,
|
|
1694
|
+
};
|
|
1695
|
+
filterConfiguration_1.set(updatedConfiguration);
|
|
1696
|
+
return updatedConfiguration;
|
|
1697
|
+
},
|
|
1698
|
+
remove: function () {
|
|
1699
|
+
filterConfiguration_1.remove();
|
|
1700
|
+
},
|
|
1701
|
+
observer: filterConfiguration_1.observer
|
|
1702
|
+
},
|
|
1703
|
+
value: {
|
|
1704
|
+
get: function () {
|
|
1705
|
+
var configuration = filterValue_1.get();
|
|
1706
|
+
return {
|
|
1707
|
+
// Filter column
|
|
1708
|
+
columnFilter: (configuration === null || configuration === void 0 ? void 0 : configuration.columnFilter) || {},
|
|
1709
|
+
// Filter external
|
|
1710
|
+
externalFilter: (configuration === null || configuration === void 0 ? void 0 : configuration.externalFilter) || {},
|
|
1711
|
+
// Filter def
|
|
1712
|
+
filterDef: (configuration === null || configuration === void 0 ? void 0 : configuration.filterDef) || {}
|
|
1713
|
+
};
|
|
1714
|
+
},
|
|
1715
|
+
set: function (configuration) {
|
|
1716
|
+
var keys = Object.keys(configuration || {});
|
|
1717
|
+
var current = filterValue_1.get();
|
|
1718
|
+
var columnFilter = current.columnFilter, externalFilter = current.externalFilter, filterDef = current.filterDef;
|
|
1719
|
+
var updatedConfiguration = {
|
|
1720
|
+
// Filter column
|
|
1721
|
+
columnFilter: keys.includes('columnFilter') ? ((configuration === null || configuration === void 0 ? void 0 : configuration.columnFilter) || {}) : columnFilter,
|
|
1722
|
+
// Filter external
|
|
1723
|
+
externalFilter: keys.includes('externalFilter') ? ((configuration === null || configuration === void 0 ? void 0 : configuration.externalFilter) || {}) : externalFilter,
|
|
1724
|
+
// Filter def
|
|
1725
|
+
filterDef: keys.includes('filterDef') ? ((configuration === null || configuration === void 0 ? void 0 : configuration.filterDef) || {}) : filterDef,
|
|
1726
|
+
};
|
|
1727
|
+
filterValue_1.set(updatedConfiguration);
|
|
1728
|
+
return updatedConfiguration;
|
|
1729
|
+
},
|
|
1730
|
+
remove: function () {
|
|
1731
|
+
filterValue_1.remove();
|
|
1732
|
+
},
|
|
1733
|
+
observer: filterValue_1.observer
|
|
1734
|
+
}
|
|
1735
|
+
};
|
|
1736
|
+
}
|
|
1737
|
+
return __classPrivateFieldGet(_this, _cache$2)[key];
|
|
1749
1738
|
};
|
|
1750
|
-
|
|
1751
|
-
var e_1,
|
|
1752
|
-
var _a, _b, _c, _d
|
|
1739
|
+
_loadDefaultConfiguration.set(this, function (args) {
|
|
1740
|
+
var e_1, _m, e_2, _o, e_3, _p;
|
|
1741
|
+
var _a, _b, _c, _d;
|
|
1753
1742
|
var columns = args.columns, externalFilters = args.externalFilters, filterDefs = args.filterDefs;
|
|
1754
1743
|
var inlineColumn = {};
|
|
1755
|
-
var columnFilter = {};
|
|
1756
1744
|
var inlineExternal = {};
|
|
1757
|
-
var externalFilter = {};
|
|
1758
1745
|
var inlineFilterDef = {};
|
|
1759
|
-
var filterDef = {};
|
|
1760
1746
|
try {
|
|
1761
1747
|
// Filter column
|
|
1762
|
-
for (var
|
|
1763
|
-
var item =
|
|
1748
|
+
for (var _q = __values((columns || [])), _r = _q.next(); !_r.done; _r = _q.next()) {
|
|
1749
|
+
var item = _r.value;
|
|
1764
1750
|
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;
|
|
1765
|
-
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;
|
|
1766
1751
|
}
|
|
1767
1752
|
}
|
|
1768
1753
|
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
1769
1754
|
finally {
|
|
1770
1755
|
try {
|
|
1771
|
-
if (
|
|
1756
|
+
if (_r && !_r.done && (_m = _q.return)) _m.call(_q);
|
|
1772
1757
|
}
|
|
1773
1758
|
finally { if (e_1) throw e_1.error; }
|
|
1774
1759
|
}
|
|
1775
1760
|
try {
|
|
1776
1761
|
// Filter external
|
|
1777
|
-
for (var
|
|
1778
|
-
var item =
|
|
1779
|
-
inlineExternal[item.field] = (
|
|
1780
|
-
if (item.type === 'daterange') {
|
|
1781
|
-
externalFilter[item.field] = {
|
|
1782
|
-
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,
|
|
1783
|
-
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
|
|
1784
|
-
};
|
|
1785
|
-
}
|
|
1786
|
-
else {
|
|
1787
|
-
externalFilter[item.field] = (_p = externalFilter[item.field]) !== null && _p !== void 0 ? _p : item.default;
|
|
1788
|
-
}
|
|
1762
|
+
for (var _s = __values((externalFilters || [])), _t = _s.next(); !_t.done; _t = _s.next()) {
|
|
1763
|
+
var item = _t.value;
|
|
1764
|
+
inlineExternal[item.field] = (_c = inlineExternal[item.field]) !== null && _c !== void 0 ? _c : item === null || item === void 0 ? void 0 : item.defaultShowing;
|
|
1789
1765
|
}
|
|
1790
1766
|
}
|
|
1791
1767
|
catch (e_2_1) { e_2 = { error: e_2_1 }; }
|
|
1792
1768
|
finally {
|
|
1793
1769
|
try {
|
|
1794
|
-
if (
|
|
1770
|
+
if (_t && !_t.done && (_o = _s.return)) _o.call(_s);
|
|
1795
1771
|
}
|
|
1796
1772
|
finally { if (e_2) throw e_2.error; }
|
|
1797
1773
|
}
|
|
1798
1774
|
try {
|
|
1799
1775
|
// Filter def
|
|
1800
|
-
for (var
|
|
1801
|
-
var item =
|
|
1802
|
-
inlineFilterDef[item.sdMaterialFilterDef] = (
|
|
1776
|
+
for (var _u = __values((filterDefs || [])), _v = _u.next(); !_v.done; _v = _u.next()) {
|
|
1777
|
+
var item = _v.value;
|
|
1778
|
+
inlineFilterDef[item.sdMaterialFilterDef] = (_d = inlineFilterDef[item.sdMaterialFilterDef]) !== null && _d !== void 0 ? _d : item === null || item === void 0 ? void 0 : item.defaultShowing;
|
|
1803
1779
|
}
|
|
1804
1780
|
}
|
|
1805
1781
|
catch (e_3_1) { e_3 = { error: e_3_1 }; }
|
|
1806
1782
|
finally {
|
|
1807
1783
|
try {
|
|
1808
|
-
if (
|
|
1784
|
+
if (_v && !_v.done && (_p = _u.return)) _p.call(_u);
|
|
1809
1785
|
}
|
|
1810
1786
|
finally { if (e_3) throw e_3.error; }
|
|
1811
1787
|
}
|
|
1812
1788
|
return {
|
|
1813
|
-
quickFilters: [],
|
|
1814
|
-
selectedQuickFilter: null,
|
|
1815
1789
|
inlineColumn: inlineColumn,
|
|
1816
|
-
columnFilter: columnFilter,
|
|
1817
1790
|
inlineExternal: inlineExternal,
|
|
1818
|
-
externalFilter: externalFilter,
|
|
1819
1791
|
inlineFilterDef: inlineFilterDef,
|
|
1820
|
-
filterDef: filterDef,
|
|
1821
1792
|
};
|
|
1822
1793
|
});
|
|
1823
|
-
this
|
|
1824
|
-
var
|
|
1825
|
-
|
|
1826
|
-
|
|
1827
|
-
|
|
1828
|
-
|
|
1829
|
-
|
|
1830
|
-
|
|
1831
|
-
|
|
1832
|
-
|
|
1794
|
+
_loadDefaultValue.set(this, function (args) {
|
|
1795
|
+
var e_4, _m, e_5, _o;
|
|
1796
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
1797
|
+
var columns = args.columns, externalFilters = args.externalFilters, filterDefs = args.filterDefs;
|
|
1798
|
+
var columnFilter = {};
|
|
1799
|
+
var externalFilter = {};
|
|
1800
|
+
var filterDef = {};
|
|
1801
|
+
try {
|
|
1802
|
+
// Filter column
|
|
1803
|
+
for (var _p = __values((columns || [])), _q = _p.next(); !_q.done; _q = _p.next()) {
|
|
1804
|
+
var item = _q.value;
|
|
1805
|
+
columnFilter[item.field] = (_a = columnFilter[item.field]) !== null && _a !== void 0 ? _a : (_b = item === null || item === void 0 ? void 0 : item.filter) === null || _b === void 0 ? void 0 : _b.default;
|
|
1806
|
+
}
|
|
1807
|
+
}
|
|
1808
|
+
catch (e_4_1) { e_4 = { error: e_4_1 }; }
|
|
1809
|
+
finally {
|
|
1810
|
+
try {
|
|
1811
|
+
if (_q && !_q.done && (_m = _p.return)) _m.call(_p);
|
|
1812
|
+
}
|
|
1813
|
+
finally { if (e_4) throw e_4.error; }
|
|
1814
|
+
}
|
|
1815
|
+
try {
|
|
1816
|
+
// Filter external
|
|
1817
|
+
for (var _r = __values((externalFilters || [])), _s = _r.next(); !_s.done; _s = _r.next()) {
|
|
1818
|
+
var item = _s.value;
|
|
1819
|
+
if (item.type === 'daterange') {
|
|
1820
|
+
externalFilter[item.field] = {
|
|
1821
|
+
from: (_f = (_d = (_c = externalFilter[item.field]) === null || _c === void 0 ? void 0 : _c.from) !== null && _d !== void 0 ? _d : (_e = item.default) === null || _e === void 0 ? void 0 : _e.from) !== null && _f !== void 0 ? _f : undefined,
|
|
1822
|
+
to: (_k = (_h = (_g = externalFilter[item.field]) === null || _g === void 0 ? void 0 : _g.to) !== null && _h !== void 0 ? _h : (_j = item.default) === null || _j === void 0 ? void 0 : _j.to) !== null && _k !== void 0 ? _k : undefined
|
|
1823
|
+
};
|
|
1824
|
+
}
|
|
1825
|
+
else {
|
|
1826
|
+
externalFilter[item.field] = (_l = externalFilter[item.field]) !== null && _l !== void 0 ? _l : item.default;
|
|
1827
|
+
}
|
|
1828
|
+
}
|
|
1833
1829
|
}
|
|
1834
|
-
|
|
1835
|
-
|
|
1836
|
-
|
|
1837
|
-
|
|
1838
|
-
|
|
1830
|
+
catch (e_5_1) { e_5 = { error: e_5_1 }; }
|
|
1831
|
+
finally {
|
|
1832
|
+
try {
|
|
1833
|
+
if (_s && !_s.done && (_o = _r.return)) _o.call(_r);
|
|
1834
|
+
}
|
|
1835
|
+
finally { if (e_5) throw e_5.error; }
|
|
1836
|
+
}
|
|
1837
|
+
// Filter def
|
|
1839
1838
|
return {
|
|
1840
|
-
|
|
1841
|
-
|
|
1842
|
-
|
|
1843
|
-
inlineColumn: (configuration === null || configuration === void 0 ? void 0 : configuration.inlineColumn) || {},
|
|
1844
|
-
inlineFilterDef: (configuration === null || configuration === void 0 ? void 0 : configuration.inlineFilterDef) || {},
|
|
1845
|
-
};
|
|
1846
|
-
};
|
|
1847
|
-
this.set = function (key, configuration) {
|
|
1848
|
-
configuration = {
|
|
1849
|
-
selectedQuickFilter: (configuration === null || configuration === void 0 ? void 0 : configuration.selectedQuickFilter) || null,
|
|
1850
|
-
quickFilters: (configuration === null || configuration === void 0 ? void 0 : configuration.quickFilters) || [],
|
|
1851
|
-
inlineExternal: configuration.inlineExternal || {},
|
|
1852
|
-
inlineColumn: configuration.inlineColumn || {},
|
|
1853
|
-
inlineFilterDef: configuration.inlineFilterDef || {}
|
|
1839
|
+
columnFilter: columnFilter,
|
|
1840
|
+
externalFilter: externalFilter,
|
|
1841
|
+
filterDef: filterDef,
|
|
1854
1842
|
};
|
|
1855
|
-
|
|
1856
|
-
return configuration;
|
|
1857
|
-
}
|
|
1858
|
-
var set = _this.settingService.create({
|
|
1859
|
-
prefix: __classPrivateFieldGet(_this, _prefix$1),
|
|
1860
|
-
key: key
|
|
1861
|
-
}).set;
|
|
1862
|
-
key = hash__default['default']({
|
|
1863
|
-
prefix: __classPrivateFieldGet(_this, _prefix$1),
|
|
1864
|
-
key: key
|
|
1865
|
-
});
|
|
1866
|
-
set(configuration);
|
|
1867
|
-
return configuration;
|
|
1868
|
-
};
|
|
1843
|
+
});
|
|
1869
1844
|
}
|
|
1870
1845
|
return SdGridFilterService;
|
|
1871
1846
|
}());
|
|
1872
|
-
|
|
1847
|
+
_filterConfiguration = new WeakMap(), _filterValue = new WeakMap(), _cache$2 = new WeakMap(), _loadDefaultConfiguration = new WeakMap(), _loadDefaultValue = new WeakMap();
|
|
1873
1848
|
SdGridFilterService.decorators = [
|
|
1874
1849
|
{ type: core.Injectable }
|
|
1875
1850
|
];
|
|
@@ -1982,7 +1957,7 @@
|
|
|
1982
1957
|
});
|
|
1983
1958
|
_filterExportInfo.set(this, function (pageNumber, pageSize) {
|
|
1984
1959
|
var _a, _b;
|
|
1985
|
-
var _3 = _this.filterRegister.get(), columnFilter = _3.columnFilter, externalFilter = _3.externalFilter, filterDef = _3.filterDef;
|
|
1960
|
+
var _3 = _this.filterRegister.value.get(), columnFilter = _3.columnFilter, externalFilter = _3.externalFilter, filterDef = _3.filterDef;
|
|
1986
1961
|
return {
|
|
1987
1962
|
rawColumnFilter: columnFilter || {},
|
|
1988
1963
|
rawExternalFilter: externalFilter || {},
|
|
@@ -2008,18 +1983,20 @@
|
|
|
2008
1983
|
_loadFilterRegister.set(this, function () {
|
|
2009
1984
|
var _a, _b, _c, _d, _e;
|
|
2010
1985
|
// Init filter
|
|
2011
|
-
|
|
2012
|
-
|
|
2013
|
-
|
|
2014
|
-
|
|
2015
|
-
|
|
2016
|
-
__classPrivateFieldGet(_this, _subscription$2).add(_this.filterRegister.observer.pipe(operators.debounceTime(500), operators.map(function (configuration) {
|
|
2017
|
-
_this.columnFilter = configuration.columnFilter;
|
|
2018
|
-
__classPrivateFieldGet(_this, _paginator).pageIndex = 0;
|
|
2019
|
-
__classPrivateFieldGet(_this, _reload).next({
|
|
2020
|
-
force: false,
|
|
1986
|
+
if (_this.gridOption) {
|
|
1987
|
+
_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, {
|
|
1988
|
+
columns: (_c = _this.gridOption) === null || _c === void 0 ? void 0 : _c.columns,
|
|
1989
|
+
externalFilters: (_e = (_d = _this.gridOption) === null || _d === void 0 ? void 0 : _d.filter) === null || _e === void 0 ? void 0 : _e.externalFilters,
|
|
1990
|
+
filterDefs: _this.filterDefs
|
|
2021
1991
|
});
|
|
2022
|
-
|
|
1992
|
+
__classPrivateFieldGet(_this, _subscription$2).add(_this.filterRegister.value.observer.pipe(operators.debounceTime(500), operators.map(function (filterValue) {
|
|
1993
|
+
_this.columnFilter = filterValue.columnFilter;
|
|
1994
|
+
__classPrivateFieldGet(_this, _paginator).pageIndex = 0;
|
|
1995
|
+
__classPrivateFieldGet(_this, _reload).next({
|
|
1996
|
+
force: false,
|
|
1997
|
+
});
|
|
1998
|
+
})).subscribe());
|
|
1999
|
+
}
|
|
2023
2000
|
});
|
|
2024
2001
|
_filterLocal.set(this, function (localItems, filterInfo) {
|
|
2025
2002
|
var columns = _this.gridOption.columns;
|
|
@@ -2150,7 +2127,7 @@
|
|
|
2150
2127
|
});
|
|
2151
2128
|
_getFilter.set(this, function () {
|
|
2152
2129
|
var _a, _b, _c, _d, _e, _f;
|
|
2153
|
-
var _3 = _this.filterRegister.get(), columnFilter = _3.columnFilter, externalFilter = _3.externalFilter, filterDef = _3.filterDef;
|
|
2130
|
+
var _3 = _this.filterRegister.value.get(), columnFilter = _3.columnFilter, externalFilter = _3.externalFilter, filterDef = _3.filterDef;
|
|
2154
2131
|
return {
|
|
2155
2132
|
rawColumnFilter: columnFilter || {},
|
|
2156
2133
|
rawExternalFilter: externalFilter || {},
|
|
@@ -2784,15 +2761,11 @@
|
|
|
2784
2761
|
_this.ref.detectChanges();
|
|
2785
2762
|
});
|
|
2786
2763
|
this.clearFilter = function () {
|
|
2787
|
-
_this.filterRegister.remove();
|
|
2788
|
-
// if (this.gridOption?.filter?.inlineColumn) {
|
|
2789
|
-
// this.columnFilter = {};
|
|
2790
|
-
// }
|
|
2791
|
-
// this.gridFilter?.onClearFilter();
|
|
2764
|
+
_this.filterRegister.value.remove();
|
|
2792
2765
|
};
|
|
2793
2766
|
this.setFilter = function (args) {
|
|
2794
2767
|
var _3 = args || {}, columnFilter = _3.columnFilter, externalFilter = _3.externalFilter, filterDef = _3.filterDef;
|
|
2795
|
-
_this.filterRegister.set({
|
|
2768
|
+
_this.filterRegister.value.set({
|
|
2796
2769
|
columnFilter: columnFilter,
|
|
2797
2770
|
externalFilter: externalFilter,
|
|
2798
2771
|
filterDef: filterDef
|
|
@@ -3188,7 +3161,7 @@
|
|
|
3188
3161
|
SdGridMaterial.decorators = [
|
|
3189
3162
|
{ type: core.Component, args: [{
|
|
3190
3163
|
selector: 'sd-grid-material',
|
|
3191
|
-
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>",
|
|
3164
|
+
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\" [externalFilters]=\"gridOption?.filter?.externalFilters\" [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>",
|
|
3192
3165
|
animations: [
|
|
3193
3166
|
animations.trigger('detailExpand', [
|
|
3194
3167
|
animations.state('collapsed', animations.style({ height: '0', minHeight: '0', visibility: 'hidden' })),
|
|
@@ -3748,7 +3721,7 @@
|
|
|
3748
3721
|
{ type: SdGridConfigurationService }
|
|
3749
3722
|
]; };
|
|
3750
3723
|
|
|
3751
|
-
var _cache$
|
|
3724
|
+
var _cache$3;
|
|
3752
3725
|
var SdPopupGridConfiguration = /** @class */ (function () {
|
|
3753
3726
|
function SdPopupGridConfiguration(ref, notifyService, translateService, gridConfigurationService) {
|
|
3754
3727
|
var _this = this;
|
|
@@ -3757,7 +3730,7 @@
|
|
|
3757
3730
|
this.translateService = translateService;
|
|
3758
3731
|
this.gridConfigurationService = gridConfigurationService;
|
|
3759
3732
|
this.changes = new core.EventEmitter();
|
|
3760
|
-
_cache$
|
|
3733
|
+
_cache$3.set(this, void 0);
|
|
3761
3734
|
this.isCreatingColumn = false;
|
|
3762
3735
|
this.selected = {};
|
|
3763
3736
|
this.disabledDrag = true;
|
|
@@ -3766,9 +3739,9 @@
|
|
|
3766
3739
|
return __generator(this, function (_c) {
|
|
3767
3740
|
switch (_c.label) {
|
|
3768
3741
|
case 0:
|
|
3769
|
-
__classPrivateFieldSet(this, _cache$
|
|
3742
|
+
__classPrivateFieldSet(this, _cache$3, this.gridConfigurationService.init(this.key, this.gridOption));
|
|
3770
3743
|
_b = this;
|
|
3771
|
-
return [4 /*yield*/, __classPrivateFieldGet(this, _cache$
|
|
3744
|
+
return [4 /*yield*/, __classPrivateFieldGet(this, _cache$3).get()];
|
|
3772
3745
|
case 1:
|
|
3773
3746
|
_b.configuration = _c.sent();
|
|
3774
3747
|
this.modal.open();
|
|
@@ -3777,7 +3750,7 @@
|
|
|
3777
3750
|
});
|
|
3778
3751
|
}); };
|
|
3779
3752
|
this.onSave = function () {
|
|
3780
|
-
__classPrivateFieldGet(_this, _cache$
|
|
3753
|
+
__classPrivateFieldGet(_this, _cache$3).set(_this.configuration);
|
|
3781
3754
|
_this.modal.close();
|
|
3782
3755
|
_this.ref.detectChanges();
|
|
3783
3756
|
};
|
|
@@ -3787,7 +3760,7 @@
|
|
|
3787
3760
|
return __generator(this, function (_b) {
|
|
3788
3761
|
translate = this.translateService.translate;
|
|
3789
3762
|
this.notifyService.confirm(translate('Reset grid configuration to default')).then(function () {
|
|
3790
|
-
__classPrivateFieldGet(_this, _cache$
|
|
3763
|
+
__classPrivateFieldGet(_this, _cache$3).remove();
|
|
3791
3764
|
_this.modal.close();
|
|
3792
3765
|
_this.ref.detectChanges();
|
|
3793
3766
|
});
|
|
@@ -3819,7 +3792,7 @@
|
|
|
3819
3792
|
generatedColumns: this.configuration.columns.filter(function (e) { var _a; return _this.selected[(_a = e.origin) === null || _a === void 0 ? void 0 : _a.field]; }).map(function (e) { var _a; return (_a = e.origin) === null || _a === void 0 ? void 0 : _a.field; })
|
|
3820
3793
|
};
|
|
3821
3794
|
this.configuration.columns.push(generatedColumn);
|
|
3822
|
-
this.configuration = __classPrivateFieldGet(this, _cache$
|
|
3795
|
+
this.configuration = __classPrivateFieldGet(this, _cache$3).set(this.configuration);
|
|
3823
3796
|
this.isCreatingColumn = false;
|
|
3824
3797
|
return [2 /*return*/];
|
|
3825
3798
|
});
|
|
@@ -3842,7 +3815,7 @@
|
|
|
3842
3815
|
};
|
|
3843
3816
|
return SdPopupGridConfiguration;
|
|
3844
3817
|
}());
|
|
3845
|
-
_cache$
|
|
3818
|
+
_cache$3 = new WeakMap();
|
|
3846
3819
|
SdPopupGridConfiguration.decorators = [
|
|
3847
3820
|
{ type: core.Component, args: [{
|
|
3848
3821
|
selector: 'sd-popup-grid-configuration',
|
|
@@ -4130,12 +4103,12 @@
|
|
|
4130
4103
|
},] }
|
|
4131
4104
|
];
|
|
4132
4105
|
|
|
4133
|
-
var _cache$
|
|
4106
|
+
var _cache$4;
|
|
4134
4107
|
var SdGeneratedColumnService = /** @class */ (function () {
|
|
4135
4108
|
function SdGeneratedColumnService(settingService) {
|
|
4136
4109
|
var _this = this;
|
|
4137
4110
|
this.settingService = settingService;
|
|
4138
|
-
_cache$
|
|
4111
|
+
_cache$4.set(this, {});
|
|
4139
4112
|
this.load = function (configuration) {
|
|
4140
4113
|
if (!(configuration === null || configuration === void 0 ? void 0 : configuration.key)) {
|
|
4141
4114
|
return null;
|
|
@@ -4144,22 +4117,22 @@
|
|
|
4144
4117
|
prefix: '260f5e94-5865-4425-8ced-b9c083c390dd',
|
|
4145
4118
|
key: configuration.key
|
|
4146
4119
|
});
|
|
4147
|
-
if (!__classPrivateFieldGet(_this, _cache$
|
|
4120
|
+
if (!__classPrivateFieldGet(_this, _cache$4)[key]) {
|
|
4148
4121
|
if ((configuration === null || configuration === void 0 ? void 0 : configuration.storage) === 'server') {
|
|
4149
|
-
__classPrivateFieldGet(_this, _cache$
|
|
4122
|
+
__classPrivateFieldGet(_this, _cache$4)[key] = _this.settingService.createServer(key, {
|
|
4150
4123
|
args: configuration === null || configuration === void 0 ? void 0 : configuration.args,
|
|
4151
4124
|
default: []
|
|
4152
4125
|
});
|
|
4153
4126
|
}
|
|
4154
4127
|
else {
|
|
4155
|
-
__classPrivateFieldGet(_this, _cache$
|
|
4128
|
+
__classPrivateFieldGet(_this, _cache$4)[key] = _this.settingService.create(key, {
|
|
4156
4129
|
type: configuration === null || configuration === void 0 ? void 0 : configuration.storage,
|
|
4157
4130
|
args: configuration === null || configuration === void 0 ? void 0 : configuration.args,
|
|
4158
4131
|
default: []
|
|
4159
4132
|
});
|
|
4160
4133
|
}
|
|
4161
4134
|
}
|
|
4162
|
-
return __classPrivateFieldGet(_this, _cache$
|
|
4135
|
+
return __classPrivateFieldGet(_this, _cache$4)[key];
|
|
4163
4136
|
};
|
|
4164
4137
|
this.loadSystem = function (configuration) {
|
|
4165
4138
|
var _a, _b;
|
|
@@ -4173,27 +4146,27 @@
|
|
|
4173
4146
|
prefix: '8b8050ca-1f44-4860-bad3-20e646c0d68f',
|
|
4174
4147
|
key: configuration.key
|
|
4175
4148
|
});
|
|
4176
|
-
if (!__classPrivateFieldGet(_this, _cache$
|
|
4149
|
+
if (!__classPrivateFieldGet(_this, _cache$4)[key]) {
|
|
4177
4150
|
if ((configuration === null || configuration === void 0 ? void 0 : configuration.storage) === 'server') {
|
|
4178
|
-
__classPrivateFieldGet(_this, _cache$
|
|
4151
|
+
__classPrivateFieldGet(_this, _cache$4)[key] = _this.settingService.createServer(key, {
|
|
4179
4152
|
args: (_a = configuration === null || configuration === void 0 ? void 0 : configuration.systemColumn) === null || _a === void 0 ? void 0 : _a.args,
|
|
4180
4153
|
default: []
|
|
4181
4154
|
});
|
|
4182
4155
|
}
|
|
4183
4156
|
else {
|
|
4184
|
-
__classPrivateFieldGet(_this, _cache$
|
|
4157
|
+
__classPrivateFieldGet(_this, _cache$4)[key] = _this.settingService.create(key, {
|
|
4185
4158
|
type: configuration === null || configuration === void 0 ? void 0 : configuration.storage,
|
|
4186
4159
|
args: (_b = configuration === null || configuration === void 0 ? void 0 : configuration.systemColumn) === null || _b === void 0 ? void 0 : _b.args,
|
|
4187
4160
|
default: []
|
|
4188
4161
|
});
|
|
4189
4162
|
}
|
|
4190
4163
|
}
|
|
4191
|
-
return __classPrivateFieldGet(_this, _cache$
|
|
4164
|
+
return __classPrivateFieldGet(_this, _cache$4)[key];
|
|
4192
4165
|
};
|
|
4193
4166
|
}
|
|
4194
4167
|
return SdGeneratedColumnService;
|
|
4195
4168
|
}());
|
|
4196
|
-
_cache$
|
|
4169
|
+
_cache$4 = new WeakMap();
|
|
4197
4170
|
SdGeneratedColumnService.decorators = [
|
|
4198
4171
|
{ type: core.Injectable }
|
|
4199
4172
|
];
|