@sd-angular/core 1.3.103 → 1.3.105
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 +296 -149
- 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/bundles/sd-angular-core-setting.umd.js +21 -25
- package/bundles/sd-angular-core-setting.umd.js.map +1 -1
- package/bundles/sd-angular-core-setting.umd.min.js +1 -1
- package/bundles/sd-angular-core-setting.umd.min.js.map +1 -1
- package/esm2015/grid-material/src/lib/components/grid-filter/grid-filter.component.js +20 -19
- package/esm2015/grid-material/src/lib/grid-material.component.js +73 -56
- package/esm2015/grid-material/src/lib/services/grid-filter/grid-filter.service.js +126 -68
- package/esm2015/setting/src/lib/setting.service.js +22 -26
- package/fesm2015/sd-angular-core-grid-material.js +212 -137
- package/fesm2015/sd-angular-core-grid-material.js.map +1 -1
- package/fesm2015/sd-angular-core-setting.js +21 -25
- package/fesm2015/sd-angular-core-setting.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 +7 -7
- package/grid-material/src/lib/grid-material.component.d.ts +3 -3
- package/grid-material/src/lib/services/grid-filter/grid-filter.service.d.ts +4 -4
- package/package.json +1 -1
- package/{sd-angular-core-1.3.103.tgz → sd-angular-core-1.3.105.tgz} +0 -0
- package/setting/sd-angular-core-setting.metadata.json +1 -1
|
@@ -539,7 +539,7 @@
|
|
|
539
539
|
_this.filterRegister.value.set({
|
|
540
540
|
columnFilter: _this.columnFilter,
|
|
541
541
|
externalFilter: _this.externalFilter,
|
|
542
|
-
filterDef: _this.filterDef
|
|
542
|
+
filterDef: _this.filterDef,
|
|
543
543
|
});
|
|
544
544
|
};
|
|
545
545
|
this.open = function () {
|
|
@@ -570,19 +570,20 @@
|
|
|
570
570
|
enumerable: false,
|
|
571
571
|
configurable: true
|
|
572
572
|
});
|
|
573
|
-
;
|
|
574
573
|
SdGridFilter.prototype.ngAfterViewInit = function () {
|
|
575
574
|
var _this = this;
|
|
576
575
|
__classPrivateFieldGet(this, _subscription$1).add(this.filterRegister.configuration.observer.subscribe(function (configuration) {
|
|
577
|
-
|
|
578
|
-
_this.
|
|
579
|
-
_this.
|
|
576
|
+
var inlineColumn = configuration.inlineColumn, inlineExternal = configuration.inlineExternal, inlineFilterDef = configuration.inlineFilterDef;
|
|
577
|
+
_this.inlineColumn = inlineColumn;
|
|
578
|
+
_this.inlineExternal = inlineExternal;
|
|
579
|
+
_this.inlineFilterDef = inlineFilterDef;
|
|
580
580
|
_this.ref.markForCheck();
|
|
581
581
|
}));
|
|
582
582
|
__classPrivateFieldGet(this, _subscription$1).add(this.filterRegister.value.observer.subscribe(function (value) {
|
|
583
|
-
|
|
584
|
-
_this.
|
|
585
|
-
_this.
|
|
583
|
+
var columnFilter = value.columnFilter, externalFilter = value.externalFilter, filterDef = value.filterDef;
|
|
584
|
+
_this.columnFilter = columnFilter;
|
|
585
|
+
_this.externalFilter = externalFilter;
|
|
586
|
+
_this.filterDef = filterDef;
|
|
586
587
|
_this.ref.markForCheck();
|
|
587
588
|
}));
|
|
588
589
|
};
|
|
@@ -594,7 +595,7 @@
|
|
|
594
595
|
_subscription$1 = new WeakMap();
|
|
595
596
|
SdGridFilter.decorators = [
|
|
596
597
|
{ type: core.Component, args: [{
|
|
597
|
-
selector:
|
|
598
|
+
selector: "sd-grid-filter",
|
|
598
599
|
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\">\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>",
|
|
599
600
|
changeDetection: core.ChangeDetectionStrategy.OnPush,
|
|
600
601
|
styles: [":host{display:block;padding-bottom:10px;padding-left:0;padding-right:0}:host ::ng-deep .mat-form-field-wrapper{padding-bottom:0}"]
|
|
@@ -606,11 +607,11 @@
|
|
|
606
607
|
]; };
|
|
607
608
|
SdGridFilter.propDecorators = {
|
|
608
609
|
popupFilter: [{ type: core.ViewChild, args: [SdPopupFilter,] }],
|
|
609
|
-
_filter: [{ type: core.Input, args: [
|
|
610
|
+
_filter: [{ type: core.Input, args: ["filter",] }],
|
|
610
611
|
columns: [{ type: core.Input }],
|
|
611
|
-
_externalFilters: [{ type: core.Input, args: [
|
|
612
|
+
_externalFilters: [{ type: core.Input, args: ["externalFilters",] }],
|
|
612
613
|
filterDefs: [{ type: core.Input }],
|
|
613
|
-
_filterRegister: [{ type: core.Input, args: [
|
|
614
|
+
_filterRegister: [{ type: core.Input, args: ["filterRegister",] }]
|
|
614
615
|
};
|
|
615
616
|
|
|
616
617
|
var _getExportableColumns, _getExportableGroups, _getExportColumns, _initTemplate;
|
|
@@ -1634,13 +1635,13 @@
|
|
|
1634
1635
|
{ type: core.NgZone }
|
|
1635
1636
|
]; };
|
|
1636
1637
|
|
|
1637
|
-
var _filterConfiguration, _filterValue, _cache$2,
|
|
1638
|
+
var _filterConfiguration, _filterValue, _cache$2, _defaultConfiguration, _defaultValue, _initConfiguration, _initValue;
|
|
1638
1639
|
var SdGridFilterService = /** @class */ (function () {
|
|
1639
1640
|
function SdGridFilterService(settingService) {
|
|
1640
1641
|
var _this = this;
|
|
1641
1642
|
this.settingService = settingService;
|
|
1642
|
-
_filterConfiguration.set(this,
|
|
1643
|
-
_filterValue.set(this,
|
|
1643
|
+
_filterConfiguration.set(this, "GRID-FILTER-CONFIGURATION");
|
|
1644
|
+
_filterValue.set(this, "GRID-FILTER-VALUE");
|
|
1644
1645
|
_cache$2.set(this, {});
|
|
1645
1646
|
this.register = function (key, args) {
|
|
1646
1647
|
var cacheSession = false;
|
|
@@ -1648,69 +1649,57 @@
|
|
|
1648
1649
|
var columns = args.columns, externalFilters = args.externalFilters;
|
|
1649
1650
|
key = hash__default['default']({
|
|
1650
1651
|
columns: columns,
|
|
1651
|
-
externalFilters: externalFilters
|
|
1652
|
+
externalFilters: externalFilters,
|
|
1652
1653
|
});
|
|
1653
1654
|
cacheSession = true; // Nếu không có key thì chỉ lưu theo session
|
|
1654
1655
|
}
|
|
1655
1656
|
if (!__classPrivateFieldGet(_this, _cache$2)[key]) {
|
|
1657
|
+
// Setting của filter configuration
|
|
1656
1658
|
var filterConfiguration_1 = _this.settingService.create({
|
|
1657
1659
|
prefix: __classPrivateFieldGet(_this, _filterConfiguration),
|
|
1658
|
-
key: key
|
|
1660
|
+
key: key,
|
|
1659
1661
|
}, {
|
|
1660
|
-
default: __classPrivateFieldGet(_this,
|
|
1661
|
-
type: cacheSession ?
|
|
1662
|
+
default: __classPrivateFieldGet(_this, _defaultConfiguration).call(_this, args),
|
|
1663
|
+
type: cacheSession ? "session" : undefined,
|
|
1662
1664
|
});
|
|
1665
|
+
// Lấy giá trị configuration merge với giá trị defaultShowing của args nếu như args có thay đổi
|
|
1666
|
+
filterConfiguration_1.set(__classPrivateFieldGet(_this, _initConfiguration).call(_this, args, filterConfiguration_1.get()));
|
|
1667
|
+
// Setting của filter value
|
|
1663
1668
|
var filterValue_1 = _this.settingService.create({
|
|
1664
1669
|
prefix: __classPrivateFieldGet(_this, _filterValue),
|
|
1665
|
-
key: key
|
|
1670
|
+
key: key,
|
|
1666
1671
|
}, {
|
|
1667
|
-
default: __classPrivateFieldGet(_this,
|
|
1668
|
-
type: cacheSession ?
|
|
1672
|
+
default: __classPrivateFieldGet(_this, _defaultValue).call(_this, args),
|
|
1673
|
+
type: cacheSession ? "session" : undefined,
|
|
1669
1674
|
});
|
|
1675
|
+
// Lấy giá trị value merge với giá trị default của args nếu như args có thay đổi
|
|
1676
|
+
filterValue_1.set(__classPrivateFieldGet(_this, _initValue).call(_this, args, filterValue_1.get()));
|
|
1670
1677
|
__classPrivateFieldGet(_this, _cache$2)[key] = {
|
|
1671
1678
|
configuration: {
|
|
1672
1679
|
get: function () {
|
|
1673
|
-
|
|
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
|
-
};
|
|
1680
|
+
return filterConfiguration_1.get();
|
|
1682
1681
|
},
|
|
1683
1682
|
set: function (configuration) {
|
|
1684
|
-
var
|
|
1685
|
-
|
|
1686
|
-
|
|
1687
|
-
|
|
1688
|
-
|
|
1689
|
-
|
|
1690
|
-
|
|
1691
|
-
|
|
1692
|
-
|
|
1693
|
-
inlineFilterDef:
|
|
1683
|
+
var inlineColumn = configuration.inlineColumn, inlineExternal = configuration.inlineExternal, inlineFilterDef = configuration.inlineFilterDef;
|
|
1684
|
+
filterConfiguration_1.set({
|
|
1685
|
+
inlineColumn: inlineColumn,
|
|
1686
|
+
inlineExternal: inlineExternal,
|
|
1687
|
+
inlineFilterDef: inlineFilterDef,
|
|
1688
|
+
});
|
|
1689
|
+
return {
|
|
1690
|
+
inlineColumn: inlineColumn,
|
|
1691
|
+
inlineExternal: inlineExternal,
|
|
1692
|
+
inlineFilterDef: inlineFilterDef,
|
|
1694
1693
|
};
|
|
1695
|
-
filterConfiguration_1.set(updatedConfiguration);
|
|
1696
|
-
return updatedConfiguration;
|
|
1697
1694
|
},
|
|
1698
1695
|
remove: function () {
|
|
1699
1696
|
filterConfiguration_1.remove();
|
|
1700
1697
|
},
|
|
1701
|
-
observer: filterConfiguration_1.observer
|
|
1698
|
+
observer: filterConfiguration_1.observer.pipe(operators.startWith(filterConfiguration_1.get())),
|
|
1702
1699
|
},
|
|
1703
1700
|
value: {
|
|
1704
1701
|
get: function () {
|
|
1705
|
-
|
|
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
|
-
};
|
|
1702
|
+
return filterValue_1.get();
|
|
1714
1703
|
},
|
|
1715
1704
|
set: function (configuration) {
|
|
1716
1705
|
var keys = Object.keys(configuration || {});
|
|
@@ -1718,11 +1707,17 @@
|
|
|
1718
1707
|
var columnFilter = current.columnFilter, externalFilter = current.externalFilter, filterDef = current.filterDef;
|
|
1719
1708
|
var updatedConfiguration = {
|
|
1720
1709
|
// Filter column
|
|
1721
|
-
columnFilter: keys.includes(
|
|
1710
|
+
columnFilter: keys.includes("columnFilter")
|
|
1711
|
+
? (configuration === null || configuration === void 0 ? void 0 : configuration.columnFilter) || {}
|
|
1712
|
+
: columnFilter,
|
|
1722
1713
|
// Filter external
|
|
1723
|
-
externalFilter: keys.includes(
|
|
1714
|
+
externalFilter: keys.includes("externalFilter")
|
|
1715
|
+
? (configuration === null || configuration === void 0 ? void 0 : configuration.externalFilter) || {}
|
|
1716
|
+
: externalFilter,
|
|
1724
1717
|
// Filter def
|
|
1725
|
-
filterDef: keys.includes(
|
|
1718
|
+
filterDef: keys.includes("filterDef")
|
|
1719
|
+
? (configuration === null || configuration === void 0 ? void 0 : configuration.filterDef) || {}
|
|
1720
|
+
: filterDef,
|
|
1726
1721
|
};
|
|
1727
1722
|
filterValue_1.set(updatedConfiguration);
|
|
1728
1723
|
return updatedConfiguration;
|
|
@@ -1730,121 +1725,256 @@
|
|
|
1730
1725
|
remove: function () {
|
|
1731
1726
|
filterValue_1.remove();
|
|
1732
1727
|
},
|
|
1733
|
-
observer: filterValue_1.observer
|
|
1734
|
-
}
|
|
1728
|
+
observer: filterValue_1.observer.pipe(operators.startWith(filterValue_1.get())),
|
|
1729
|
+
},
|
|
1735
1730
|
};
|
|
1736
1731
|
}
|
|
1737
1732
|
return __classPrivateFieldGet(_this, _cache$2)[key];
|
|
1738
1733
|
};
|
|
1739
|
-
|
|
1740
|
-
var e_1,
|
|
1741
|
-
var _a
|
|
1734
|
+
_defaultConfiguration.set(this, function (args) {
|
|
1735
|
+
var e_1, _r, e_2, _s, e_3, _t;
|
|
1736
|
+
var _a;
|
|
1742
1737
|
var columns = args.columns, externalFilters = args.externalFilters, filterDefs = args.filterDefs;
|
|
1743
1738
|
var inlineColumn = {};
|
|
1744
1739
|
var inlineExternal = {};
|
|
1745
1740
|
var inlineFilterDef = {};
|
|
1746
1741
|
try {
|
|
1747
1742
|
// Filter column
|
|
1748
|
-
for (var
|
|
1749
|
-
var item =
|
|
1750
|
-
inlineColumn[item.field] = (_a =
|
|
1743
|
+
for (var _u = __values(columns || []), _v = _u.next(); !_v.done; _v = _u.next()) {
|
|
1744
|
+
var item = _v.value;
|
|
1745
|
+
inlineColumn[item.field] = (_a = item === null || item === void 0 ? void 0 : item.filter) === null || _a === void 0 ? void 0 : _a.defaultShowing;
|
|
1751
1746
|
}
|
|
1752
1747
|
}
|
|
1753
1748
|
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
1754
1749
|
finally {
|
|
1755
1750
|
try {
|
|
1756
|
-
if (
|
|
1751
|
+
if (_v && !_v.done && (_r = _u.return)) _r.call(_u);
|
|
1757
1752
|
}
|
|
1758
1753
|
finally { if (e_1) throw e_1.error; }
|
|
1759
1754
|
}
|
|
1760
1755
|
try {
|
|
1761
1756
|
// Filter external
|
|
1762
|
-
for (var
|
|
1763
|
-
var item =
|
|
1764
|
-
inlineExternal[item.field] =
|
|
1757
|
+
for (var _w = __values(externalFilters || []), _x = _w.next(); !_x.done; _x = _w.next()) {
|
|
1758
|
+
var item = _x.value;
|
|
1759
|
+
inlineExternal[item.field] = item === null || item === void 0 ? void 0 : item.defaultShowing;
|
|
1765
1760
|
}
|
|
1766
1761
|
}
|
|
1767
1762
|
catch (e_2_1) { e_2 = { error: e_2_1 }; }
|
|
1768
1763
|
finally {
|
|
1769
1764
|
try {
|
|
1770
|
-
if (
|
|
1765
|
+
if (_x && !_x.done && (_s = _w.return)) _s.call(_w);
|
|
1771
1766
|
}
|
|
1772
1767
|
finally { if (e_2) throw e_2.error; }
|
|
1773
1768
|
}
|
|
1774
1769
|
try {
|
|
1775
1770
|
// Filter def
|
|
1776
|
-
for (var
|
|
1777
|
-
var item =
|
|
1778
|
-
inlineFilterDef[item.sdMaterialFilterDef] =
|
|
1771
|
+
for (var _y = __values(filterDefs || []), _z = _y.next(); !_z.done; _z = _y.next()) {
|
|
1772
|
+
var item = _z.value;
|
|
1773
|
+
inlineFilterDef[item.sdMaterialFilterDef] = item === null || item === void 0 ? void 0 : item.defaultShowing;
|
|
1779
1774
|
}
|
|
1780
1775
|
}
|
|
1781
1776
|
catch (e_3_1) { e_3 = { error: e_3_1 }; }
|
|
1782
1777
|
finally {
|
|
1783
1778
|
try {
|
|
1784
|
-
if (
|
|
1779
|
+
if (_z && !_z.done && (_t = _y.return)) _t.call(_y);
|
|
1785
1780
|
}
|
|
1786
1781
|
finally { if (e_3) throw e_3.error; }
|
|
1787
1782
|
}
|
|
1788
1783
|
return {
|
|
1784
|
+
// Filter column
|
|
1789
1785
|
inlineColumn: inlineColumn,
|
|
1786
|
+
// Filter external
|
|
1790
1787
|
inlineExternal: inlineExternal,
|
|
1788
|
+
// Filter def
|
|
1791
1789
|
inlineFilterDef: inlineFilterDef,
|
|
1792
1790
|
};
|
|
1793
1791
|
});
|
|
1794
|
-
|
|
1795
|
-
var e_4,
|
|
1796
|
-
var _a
|
|
1797
|
-
var columns = args.columns, externalFilters = args.externalFilters, filterDefs = args.filterDefs;
|
|
1792
|
+
_defaultValue.set(this, function (args) {
|
|
1793
|
+
var e_4, _r, e_5, _s, e_6, _t;
|
|
1794
|
+
var _a;
|
|
1798
1795
|
var columnFilter = {};
|
|
1799
1796
|
var externalFilter = {};
|
|
1800
1797
|
var filterDef = {};
|
|
1798
|
+
var columns = args.columns, externalFilters = args.externalFilters, filterDefs = args.filterDefs;
|
|
1801
1799
|
try {
|
|
1802
1800
|
// Filter column
|
|
1803
|
-
for (var
|
|
1804
|
-
var item =
|
|
1805
|
-
columnFilter[item.field] = (_a =
|
|
1801
|
+
for (var _u = __values(columns || []), _v = _u.next(); !_v.done; _v = _u.next()) {
|
|
1802
|
+
var item = _v.value;
|
|
1803
|
+
columnFilter[item.field] = (_a = item === null || item === void 0 ? void 0 : item.filter) === null || _a === void 0 ? void 0 : _a.default;
|
|
1806
1804
|
}
|
|
1807
1805
|
}
|
|
1808
1806
|
catch (e_4_1) { e_4 = { error: e_4_1 }; }
|
|
1809
1807
|
finally {
|
|
1810
1808
|
try {
|
|
1811
|
-
if (
|
|
1809
|
+
if (_v && !_v.done && (_r = _u.return)) _r.call(_u);
|
|
1812
1810
|
}
|
|
1813
1811
|
finally { if (e_4) throw e_4.error; }
|
|
1814
1812
|
}
|
|
1815
1813
|
try {
|
|
1816
1814
|
// Filter external
|
|
1817
|
-
for (var
|
|
1818
|
-
var item =
|
|
1819
|
-
|
|
1815
|
+
for (var _w = __values(externalFilters || []), _x = _w.next(); !_x.done; _x = _w.next()) {
|
|
1816
|
+
var item = _x.value;
|
|
1817
|
+
externalFilter[item.field] = item === null || item === void 0 ? void 0 : item.default;
|
|
1818
|
+
}
|
|
1819
|
+
}
|
|
1820
|
+
catch (e_5_1) { e_5 = { error: e_5_1 }; }
|
|
1821
|
+
finally {
|
|
1822
|
+
try {
|
|
1823
|
+
if (_x && !_x.done && (_s = _w.return)) _s.call(_w);
|
|
1824
|
+
}
|
|
1825
|
+
finally { if (e_5) throw e_5.error; }
|
|
1826
|
+
}
|
|
1827
|
+
try {
|
|
1828
|
+
// Filter def
|
|
1829
|
+
for (var _y = __values(filterDefs || []), _z = _y.next(); !_z.done; _z = _y.next()) {
|
|
1830
|
+
var item = _z.value;
|
|
1831
|
+
filterDef[item.sdMaterialFilterDef] = undefined;
|
|
1832
|
+
}
|
|
1833
|
+
}
|
|
1834
|
+
catch (e_6_1) { e_6 = { error: e_6_1 }; }
|
|
1835
|
+
finally {
|
|
1836
|
+
try {
|
|
1837
|
+
if (_z && !_z.done && (_t = _y.return)) _t.call(_y);
|
|
1838
|
+
}
|
|
1839
|
+
finally { if (e_6) throw e_6.error; }
|
|
1840
|
+
}
|
|
1841
|
+
return {
|
|
1842
|
+
// Filter column
|
|
1843
|
+
columnFilter: columnFilter,
|
|
1844
|
+
// Filter external
|
|
1845
|
+
externalFilter: externalFilter,
|
|
1846
|
+
// Filter def
|
|
1847
|
+
filterDef: filterDef,
|
|
1848
|
+
};
|
|
1849
|
+
});
|
|
1850
|
+
_initConfiguration.set(this, function (args, configuration) {
|
|
1851
|
+
var e_7, _r, e_8, _s, e_9, _t;
|
|
1852
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
1853
|
+
var columns = args.columns, externalFilters = args.externalFilters, filterDefs = args.filterDefs;
|
|
1854
|
+
var inlineColumn = {};
|
|
1855
|
+
var inlineExternal = {};
|
|
1856
|
+
var inlineFilterDef = {};
|
|
1857
|
+
try {
|
|
1858
|
+
// Filter column
|
|
1859
|
+
for (var _u = __values(columns || []), _v = _u.next(); !_v.done; _v = _u.next()) {
|
|
1860
|
+
var item = _v.value;
|
|
1861
|
+
inlineColumn[item.field] = (_b = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.inlineColumn) === null || _a === void 0 ? void 0 : _a[item.field]) !== null && _b !== void 0 ? _b : (_c = item === null || item === void 0 ? void 0 : item.filter) === null || _c === void 0 ? void 0 : _c.defaultShowing;
|
|
1862
|
+
}
|
|
1863
|
+
}
|
|
1864
|
+
catch (e_7_1) { e_7 = { error: e_7_1 }; }
|
|
1865
|
+
finally {
|
|
1866
|
+
try {
|
|
1867
|
+
if (_v && !_v.done && (_r = _u.return)) _r.call(_u);
|
|
1868
|
+
}
|
|
1869
|
+
finally { if (e_7) throw e_7.error; }
|
|
1870
|
+
}
|
|
1871
|
+
try {
|
|
1872
|
+
// Filter external
|
|
1873
|
+
for (var _w = __values(externalFilters || []), _x = _w.next(); !_x.done; _x = _w.next()) {
|
|
1874
|
+
var item = _x.value;
|
|
1875
|
+
inlineExternal[item.field] = (_e = (_d = configuration === null || configuration === void 0 ? void 0 : configuration.inlineExternal) === null || _d === void 0 ? void 0 : _d[item.field]) !== null && _e !== void 0 ? _e : item === null || item === void 0 ? void 0 : item.defaultShowing;
|
|
1876
|
+
}
|
|
1877
|
+
}
|
|
1878
|
+
catch (e_8_1) { e_8 = { error: e_8_1 }; }
|
|
1879
|
+
finally {
|
|
1880
|
+
try {
|
|
1881
|
+
if (_x && !_x.done && (_s = _w.return)) _s.call(_w);
|
|
1882
|
+
}
|
|
1883
|
+
finally { if (e_8) throw e_8.error; }
|
|
1884
|
+
}
|
|
1885
|
+
try {
|
|
1886
|
+
// Filter def
|
|
1887
|
+
for (var _y = __values(filterDefs || []), _z = _y.next(); !_z.done; _z = _y.next()) {
|
|
1888
|
+
var item = _z.value;
|
|
1889
|
+
inlineFilterDef[item.sdMaterialFilterDef] = (_g = (_f = configuration === null || configuration === void 0 ? void 0 : configuration.inlineFilterDef) === null || _f === void 0 ? void 0 : _f[item.sdMaterialFilterDef]) !== null && _g !== void 0 ? _g : item === null || item === void 0 ? void 0 : item.defaultShowing;
|
|
1890
|
+
}
|
|
1891
|
+
}
|
|
1892
|
+
catch (e_9_1) { e_9 = { error: e_9_1 }; }
|
|
1893
|
+
finally {
|
|
1894
|
+
try {
|
|
1895
|
+
if (_z && !_z.done && (_t = _y.return)) _t.call(_y);
|
|
1896
|
+
}
|
|
1897
|
+
finally { if (e_9) throw e_9.error; }
|
|
1898
|
+
}
|
|
1899
|
+
return {
|
|
1900
|
+
// Filter column
|
|
1901
|
+
inlineColumn: inlineColumn,
|
|
1902
|
+
// Filter external
|
|
1903
|
+
inlineExternal: inlineExternal,
|
|
1904
|
+
// Filter def
|
|
1905
|
+
inlineFilterDef: inlineFilterDef,
|
|
1906
|
+
};
|
|
1907
|
+
});
|
|
1908
|
+
_initValue.set(this, function (args, value) {
|
|
1909
|
+
var e_10, _r, e_11, _s, e_12, _t;
|
|
1910
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
|
|
1911
|
+
var columnFilter = {};
|
|
1912
|
+
var externalFilter = {};
|
|
1913
|
+
var filterDef = {};
|
|
1914
|
+
var columns = args.columns, externalFilters = args.externalFilters, filterDefs = args.filterDefs;
|
|
1915
|
+
try {
|
|
1916
|
+
// Filter column
|
|
1917
|
+
for (var _u = __values(columns || []), _v = _u.next(); !_v.done; _v = _u.next()) {
|
|
1918
|
+
var item = _v.value;
|
|
1919
|
+
columnFilter[item.field] = (_b = (_a = value === null || value === void 0 ? void 0 : value.columnFilter) === null || _a === void 0 ? void 0 : _a[item.field]) !== null && _b !== void 0 ? _b : (_c = item === null || item === void 0 ? void 0 : item.filter) === null || _c === void 0 ? void 0 : _c.default;
|
|
1920
|
+
}
|
|
1921
|
+
}
|
|
1922
|
+
catch (e_10_1) { e_10 = { error: e_10_1 }; }
|
|
1923
|
+
finally {
|
|
1924
|
+
try {
|
|
1925
|
+
if (_v && !_v.done && (_r = _u.return)) _r.call(_u);
|
|
1926
|
+
}
|
|
1927
|
+
finally { if (e_10) throw e_10.error; }
|
|
1928
|
+
}
|
|
1929
|
+
try {
|
|
1930
|
+
// Filter external
|
|
1931
|
+
for (var _w = __values(externalFilters || []), _x = _w.next(); !_x.done; _x = _w.next()) {
|
|
1932
|
+
var item = _x.value;
|
|
1933
|
+
if (item.type === "daterange") {
|
|
1820
1934
|
externalFilter[item.field] = {
|
|
1821
|
-
from: (_f = (
|
|
1822
|
-
to: (_k = (
|
|
1935
|
+
from: (_f = (_e = (_d = value === null || value === void 0 ? void 0 : value.externalFilter) === null || _d === void 0 ? void 0 : _d[item.field]) === null || _e === void 0 ? void 0 : _e.from) !== null && _f !== void 0 ? _f : (_g = item.default) === null || _g === void 0 ? void 0 : _g.from,
|
|
1936
|
+
to: (_k = (_j = (_h = value === null || value === void 0 ? void 0 : value.externalFilter) === null || _h === void 0 ? void 0 : _h[item.field]) === null || _j === void 0 ? void 0 : _j.to) !== null && _k !== void 0 ? _k : (_l = item.default) === null || _l === void 0 ? void 0 : _l.to,
|
|
1823
1937
|
};
|
|
1824
1938
|
}
|
|
1825
1939
|
else {
|
|
1826
|
-
externalFilter[item.field] = (
|
|
1940
|
+
externalFilter[item.field] = (_o = (_m = value === null || value === void 0 ? void 0 : value.externalFilter) === null || _m === void 0 ? void 0 : _m[item.field]) !== null && _o !== void 0 ? _o : item === null || item === void 0 ? void 0 : item.default;
|
|
1827
1941
|
}
|
|
1828
1942
|
}
|
|
1829
1943
|
}
|
|
1830
|
-
catch (
|
|
1944
|
+
catch (e_11_1) { e_11 = { error: e_11_1 }; }
|
|
1831
1945
|
finally {
|
|
1832
1946
|
try {
|
|
1833
|
-
if (
|
|
1947
|
+
if (_x && !_x.done && (_s = _w.return)) _s.call(_w);
|
|
1834
1948
|
}
|
|
1835
|
-
finally { if (
|
|
1949
|
+
finally { if (e_11) throw e_11.error; }
|
|
1950
|
+
}
|
|
1951
|
+
try {
|
|
1952
|
+
// Filter def
|
|
1953
|
+
for (var _y = __values(filterDefs || []), _z = _y.next(); !_z.done; _z = _y.next()) {
|
|
1954
|
+
var item = _z.value;
|
|
1955
|
+
filterDef[item.sdMaterialFilterDef] = (_q = (_p = value === null || value === void 0 ? void 0 : value.filterDef) === null || _p === void 0 ? void 0 : _p[item.sdMaterialFilterDef]) !== null && _q !== void 0 ? _q : undefined;
|
|
1956
|
+
}
|
|
1957
|
+
}
|
|
1958
|
+
catch (e_12_1) { e_12 = { error: e_12_1 }; }
|
|
1959
|
+
finally {
|
|
1960
|
+
try {
|
|
1961
|
+
if (_z && !_z.done && (_t = _y.return)) _t.call(_y);
|
|
1962
|
+
}
|
|
1963
|
+
finally { if (e_12) throw e_12.error; }
|
|
1836
1964
|
}
|
|
1837
|
-
// Filter def
|
|
1838
1965
|
return {
|
|
1966
|
+
// Filter column
|
|
1839
1967
|
columnFilter: columnFilter,
|
|
1968
|
+
// Filter external
|
|
1840
1969
|
externalFilter: externalFilter,
|
|
1970
|
+
// Filter def
|
|
1841
1971
|
filterDef: filterDef,
|
|
1842
1972
|
};
|
|
1843
1973
|
});
|
|
1844
1974
|
}
|
|
1845
1975
|
return SdGridFilterService;
|
|
1846
1976
|
}());
|
|
1847
|
-
_filterConfiguration = new WeakMap(), _filterValue = new WeakMap(), _cache$2 = new WeakMap(),
|
|
1977
|
+
_filterConfiguration = new WeakMap(), _filterValue = new WeakMap(), _cache$2 = new WeakMap(), _defaultConfiguration = new WeakMap(), _defaultValue = new WeakMap(), _initConfiguration = new WeakMap(), _initValue = new WeakMap();
|
|
1848
1978
|
SdGridFilterService.decorators = [
|
|
1849
1979
|
{ type: core.Injectable }
|
|
1850
1980
|
];
|
|
@@ -1852,7 +1982,7 @@
|
|
|
1852
1982
|
{ type: setting.SdSettingService }
|
|
1853
1983
|
]; };
|
|
1854
1984
|
|
|
1855
|
-
var _optionChanges, _localItems, _paginator, _sort, _subscription$2, _reload, _loadCompleted, _initCellDef, _initFilterDef, _initFooterDef, _filterExportInfo, _initConfiguration, _loadFilterRegister, _filterLocal, _getFilter, _load$1, _render, _exportedItems, _allColumns, _allExportedColumns, _onExport, _updateSelectedItems;
|
|
1985
|
+
var _optionChanges, _localItems, _paginator, _sort, _subscription$2, _reload, _loadCompleted, _initCellDef, _initFilterDef, _initFooterDef, _filterExportInfo, _initConfiguration$1, _loadFilterRegister, _filterLocal, _getFilter, _load$1, _render, _exportedItems, _allColumns, _allExportedColumns, _onExport, _updateSelectedItems;
|
|
1856
1986
|
var SdGridMaterial = /** @class */ (function () {
|
|
1857
1987
|
function SdGridMaterial(ref, configuration, gridConfigurationService, exportService, notifyService, columnValuesPipe, gridFilterService, editorHandlerColumnPipe) {
|
|
1858
1988
|
var _this = this;
|
|
@@ -1930,9 +2060,6 @@
|
|
|
1930
2060
|
}
|
|
1931
2061
|
finally { if (e_2) throw e_2.error; }
|
|
1932
2062
|
}
|
|
1933
|
-
// if (this.filterDefs?.length) {
|
|
1934
|
-
// this.#loadFilterRegister();
|
|
1935
|
-
// }
|
|
1936
2063
|
});
|
|
1937
2064
|
_initFooterDef.set(this, function () {
|
|
1938
2065
|
var e_3, _3;
|
|
@@ -1966,17 +2093,17 @@
|
|
|
1966
2093
|
orderDirection: ((_b = __classPrivateFieldGet(_this, _sort)) === null || _b === void 0 ? void 0 : _b.direction) || '',
|
|
1967
2094
|
pageNumber: pageNumber,
|
|
1968
2095
|
pageSize: pageSize,
|
|
1969
|
-
isExported: true
|
|
2096
|
+
isExported: true,
|
|
1970
2097
|
};
|
|
1971
2098
|
});
|
|
1972
|
-
_initConfiguration.set(this, function (option) {
|
|
2099
|
+
_initConfiguration$1.set(this, function (option) {
|
|
1973
2100
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
|
|
1974
2101
|
// Init pagination
|
|
1975
2102
|
option.paginate = {
|
|
1976
2103
|
hidden: (_a = option === null || option === void 0 ? void 0 : option.paginate) === null || _a === void 0 ? void 0 : _a.hidden,
|
|
1977
2104
|
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,
|
|
1978
2105
|
pages: (_m = (_j = (_h = option === null || option === void 0 ? void 0 : option.paginate) === null || _h === void 0 ? void 0 : _h.pages) !== null && _j !== void 0 ? _j : (_l = (_k = _this.configuration) === null || _k === void 0 ? void 0 : _k.paginate) === null || _l === void 0 ? void 0 : _l.pages) !== null && _m !== void 0 ? _m : (_o = DEFAULT_GRID_MATERIAL_CONFIG.paginate) === null || _o === void 0 ? void 0 : _o.pages,
|
|
1979
|
-
showFirstLastButtons: (_q = (_p = option === null || option === void 0 ? void 0 : option.paginate) === null || _p === void 0 ? void 0 : _p.showFirstLastButtons) !== null && _q !== void 0 ? _q : false
|
|
2106
|
+
showFirstLastButtons: (_q = (_p = option === null || option === void 0 ? void 0 : option.paginate) === null || _p === void 0 ? void 0 : _p.showFirstLastButtons) !== null && _q !== void 0 ? _q : false,
|
|
1980
2107
|
};
|
|
1981
2108
|
return option;
|
|
1982
2109
|
});
|
|
@@ -1988,16 +2115,24 @@
|
|
|
1988
2115
|
_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, {
|
|
1989
2116
|
columns: (_c = _this.gridOption) === null || _c === void 0 ? void 0 : _c.columns,
|
|
1990
2117
|
externalFilters: (_e = (_d = _this.gridOption) === null || _d === void 0 ? void 0 : _d.filter) === null || _e === void 0 ? void 0 : _e.externalFilters,
|
|
1991
|
-
filterDefs: _this.filterDefs
|
|
2118
|
+
filterDefs: _this.filterDefs,
|
|
1992
2119
|
});
|
|
1993
2120
|
if (!hasRegister) {
|
|
1994
|
-
__classPrivateFieldGet(_this, _subscription$2).add(_this.filterRegister.value.observer
|
|
1995
|
-
|
|
2121
|
+
__classPrivateFieldGet(_this, _subscription$2).add(_this.filterRegister.value.observer
|
|
2122
|
+
.pipe(operators.debounceTime(500), operators.map(function (filterValue) {
|
|
2123
|
+
var columnFilter = filterValue.columnFilter;
|
|
2124
|
+
_this.columnFilter = columnFilter;
|
|
1996
2125
|
__classPrivateFieldGet(_this, _paginator).pageIndex = 0;
|
|
1997
2126
|
__classPrivateFieldGet(_this, _reload).next({
|
|
1998
2127
|
force: false,
|
|
1999
2128
|
});
|
|
2000
|
-
}))
|
|
2129
|
+
}))
|
|
2130
|
+
.subscribe());
|
|
2131
|
+
}
|
|
2132
|
+
else {
|
|
2133
|
+
__classPrivateFieldGet(_this, _reload).next({
|
|
2134
|
+
force: true,
|
|
2135
|
+
});
|
|
2001
2136
|
}
|
|
2002
2137
|
}
|
|
2003
2138
|
});
|
|
@@ -2122,10 +2257,9 @@
|
|
|
2122
2257
|
}
|
|
2123
2258
|
return {
|
|
2124
2259
|
items: items.filter(function (item, index) {
|
|
2125
|
-
return index >= pageNumber * pageSize
|
|
2126
|
-
&& index < (pageNumber + 1) * pageSize;
|
|
2260
|
+
return index >= pageNumber * pageSize && index < (pageNumber + 1) * pageSize;
|
|
2127
2261
|
}),
|
|
2128
|
-
total: items.length
|
|
2262
|
+
total: items.length,
|
|
2129
2263
|
};
|
|
2130
2264
|
});
|
|
2131
2265
|
_getFilter.set(this, function () {
|
|
@@ -2138,7 +2272,7 @@
|
|
|
2138
2272
|
orderBy: ((_a = __classPrivateFieldGet(_this, _sort)) === null || _a === void 0 ? void 0 : _a.active) || '',
|
|
2139
2273
|
orderDirection: ((_b = __classPrivateFieldGet(_this, _sort)) === null || _b === void 0 ? void 0 : _b.direction) || '',
|
|
2140
2274
|
pageNumber: ((_c = __classPrivateFieldGet(_this, _paginator)) === null || _c === void 0 ? void 0 : _c.pageIndex) || 0,
|
|
2141
|
-
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
|
|
2275
|
+
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,
|
|
2142
2276
|
};
|
|
2143
2277
|
});
|
|
2144
2278
|
_load$1.set(this, function (filterReq, force) {
|
|
@@ -2162,7 +2296,7 @@
|
|
|
2162
2296
|
data = _5.sent();
|
|
2163
2297
|
return [2 /*return*/, {
|
|
2164
2298
|
items: (data === null || data === void 0 ? void 0 : data.items) || [],
|
|
2165
|
-
total: (data === null || data === void 0 ? void 0 : data.total) || 0
|
|
2299
|
+
total: (data === null || data === void 0 ? void 0 : data.total) || 0,
|
|
2166
2300
|
}];
|
|
2167
2301
|
case 3:
|
|
2168
2302
|
error_1 = _5.sent();
|
|
@@ -2170,7 +2304,7 @@
|
|
|
2170
2304
|
this.notifyService.notify.warning('Có lỗi xảy ra');
|
|
2171
2305
|
return [2 /*return*/, {
|
|
2172
2306
|
items: [],
|
|
2173
|
-
total: 0
|
|
2307
|
+
total: 0,
|
|
2174
2308
|
}];
|
|
2175
2309
|
case 4:
|
|
2176
2310
|
this.isLoading = false;
|
|
@@ -2286,7 +2420,7 @@
|
|
|
2286
2420
|
case 3: return [2 /*return*/, _3.sent()];
|
|
2287
2421
|
case 4:
|
|
2288
2422
|
exportedItems = [];
|
|
2289
|
-
if (!(typeof
|
|
2423
|
+
if (!(typeof this.gridOption.items === 'function')) return [3 /*break*/, 8];
|
|
2290
2424
|
results = this.gridOption.items();
|
|
2291
2425
|
if (!(results instanceof Promise)) return [3 /*break*/, 6];
|
|
2292
2426
|
return [4 /*yield*/, results];
|
|
@@ -2307,7 +2441,9 @@
|
|
|
2307
2441
|
});
|
|
2308
2442
|
_allColumns.set(this, function () {
|
|
2309
2443
|
var columns = [];
|
|
2310
|
-
_this.gridOption.columns
|
|
2444
|
+
_this.gridOption.columns
|
|
2445
|
+
.filter(function (e) { var _a; return !((_a = e.export) === null || _a === void 0 ? void 0 : _a.disabled); })
|
|
2446
|
+
.forEach(function (column) {
|
|
2311
2447
|
var _a, _b;
|
|
2312
2448
|
if (column.type === 'image') {
|
|
2313
2449
|
return;
|
|
@@ -2398,7 +2534,7 @@
|
|
|
2398
2534
|
_5.label = 4;
|
|
2399
2535
|
case 4:
|
|
2400
2536
|
totalPage = total_1 / pageSize_1;
|
|
2401
|
-
percent = Math.round((pageNumber_1 - 1) * 100.0 / totalPage);
|
|
2537
|
+
percent = Math.round(((pageNumber_1 - 1) * 100.0) / totalPage);
|
|
2402
2538
|
this.exportTitle = "Exporting..." + percent + "%";
|
|
2403
2539
|
allColumns = __classPrivateFieldGet(this, _allColumns).call(this);
|
|
2404
2540
|
allExportedColumns = __classPrivateFieldGet(this, _allExportedColumns).call(this);
|
|
@@ -2433,7 +2569,7 @@
|
|
|
2433
2569
|
}
|
|
2434
2570
|
if (!column.transform) return [3 /*break*/, 4];
|
|
2435
2571
|
transform = column.transform(item[column.field], item, {
|
|
2436
|
-
isExport: true
|
|
2572
|
+
isExport: true,
|
|
2437
2573
|
});
|
|
2438
2574
|
if (!(transform instanceof Promise)) return [3 /*break*/, 2];
|
|
2439
2575
|
_3 = obj;
|
|
@@ -2600,7 +2736,7 @@
|
|
|
2600
2736
|
return [4 /*yield*/, this.exportService.exportCSV({
|
|
2601
2737
|
columns: columns_2,
|
|
2602
2738
|
items: items_1,
|
|
2603
|
-
fileName: (_m = (_l = this.gridOption) === null || _l === void 0 ? void 0 : _l.export) === null || _m === void 0 ? void 0 : _m.fileName
|
|
2739
|
+
fileName: (_m = (_l = this.gridOption) === null || _l === void 0 ? void 0 : _l.export) === null || _m === void 0 ? void 0 : _m.fileName,
|
|
2604
2740
|
})];
|
|
2605
2741
|
case 6:
|
|
2606
2742
|
_9.sent();
|
|
@@ -2621,7 +2757,7 @@
|
|
|
2621
2757
|
sheets.push({
|
|
2622
2758
|
name: sheet.name,
|
|
2623
2759
|
items: sheet.items,
|
|
2624
|
-
fields: sheet.fields
|
|
2760
|
+
fields: sheet.fields,
|
|
2625
2761
|
});
|
|
2626
2762
|
return [3 /*break*/, 12];
|
|
2627
2763
|
case 10:
|
|
@@ -2653,7 +2789,7 @@
|
|
|
2653
2789
|
columns: columns_2,
|
|
2654
2790
|
items: items_1,
|
|
2655
2791
|
fileName: (_r = (_q = this.gridOption) === null || _q === void 0 ? void 0 : _q.export) === null || _r === void 0 ? void 0 : _r.fileName,
|
|
2656
|
-
sheets: sheets
|
|
2792
|
+
sheets: sheets,
|
|
2657
2793
|
})];
|
|
2658
2794
|
case 17:
|
|
2659
2795
|
_9.sent();
|
|
@@ -2662,7 +2798,7 @@
|
|
|
2662
2798
|
filePath: file.filePath,
|
|
2663
2799
|
fileName: file.fileName,
|
|
2664
2800
|
columns: columns_2,
|
|
2665
|
-
items: items_1
|
|
2801
|
+
items: items_1,
|
|
2666
2802
|
})];
|
|
2667
2803
|
case 19:
|
|
2668
2804
|
_9.sent();
|
|
@@ -2683,8 +2819,17 @@
|
|
|
2683
2819
|
});
|
|
2684
2820
|
}); };
|
|
2685
2821
|
this.onFilterChange = function () {
|
|
2686
|
-
|
|
2687
|
-
|
|
2822
|
+
var _a, _b;
|
|
2823
|
+
// this.#paginator.pageIndex = 0;
|
|
2824
|
+
// this.reload(false);
|
|
2825
|
+
if ((_b = (_a = _this.gridOption) === null || _a === void 0 ? void 0 : _a.filter) === null || _b === void 0 ? void 0 : _b.inlineColumn) {
|
|
2826
|
+
_this.filterRegister.value.set({
|
|
2827
|
+
columnFilter: _this.columnFilter,
|
|
2828
|
+
});
|
|
2829
|
+
}
|
|
2830
|
+
else {
|
|
2831
|
+
_this.filterRegister.value.set({});
|
|
2832
|
+
}
|
|
2688
2833
|
};
|
|
2689
2834
|
this.onExpand = function (rowData) { return __awaiter(_this, void 0, void 0, function () {
|
|
2690
2835
|
var _w, _x, _y, _z, _0, data;
|
|
@@ -2701,14 +2846,16 @@
|
|
|
2701
2846
|
}
|
|
2702
2847
|
data = (_z = (_y = (_x = this.gridOption) === null || _x === void 0 ? void 0 : _x.subInformation) === null || _y === void 0 ? void 0 : _y.onExpand) === null || _z === void 0 ? void 0 : _z.call(_y, rowData);
|
|
2703
2848
|
if (!((_0 = this.gridOption.subInformation) === null || _0 === void 0 ? void 0 : _0.multiple)) {
|
|
2704
|
-
this.items.forEach(function (item) { return item.isExpanding = item.isExpanded = false; });
|
|
2849
|
+
this.items.forEach(function (item) { return (item.isExpanding = item.isExpanded = false); });
|
|
2705
2850
|
}
|
|
2706
2851
|
if (data instanceof Promise) {
|
|
2707
2852
|
rowData.isExpanding = true;
|
|
2708
|
-
data
|
|
2853
|
+
data
|
|
2854
|
+
.then(function (res) {
|
|
2709
2855
|
rowData.expandDetail = res;
|
|
2710
2856
|
rowData.isExpanded = true;
|
|
2711
|
-
})
|
|
2857
|
+
})
|
|
2858
|
+
.finally(function () { return (rowData.isExpanding = false); });
|
|
2712
2859
|
}
|
|
2713
2860
|
else {
|
|
2714
2861
|
rowData.expandDetail = data;
|
|
@@ -2720,14 +2867,14 @@
|
|
|
2720
2867
|
this.onSelect = function (rowData) {
|
|
2721
2868
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
2722
2869
|
if ((_b = (_a = rowData === null || rowData === void 0 ? void 0 : rowData.sdGroup) === null || _a === void 0 ? void 0 : _a.items) === null || _b === void 0 ? void 0 : _b.length) {
|
|
2723
|
-
(_c = rowData === null || rowData === void 0 ? void 0 : rowData.sdGroup) === null || _c === void 0 ? void 0 : _c.items.forEach(function (e) { return e.isSelected = rowData.isSelected; });
|
|
2870
|
+
(_c = rowData === null || rowData === void 0 ? void 0 : rowData.sdGroup) === null || _c === void 0 ? void 0 : _c.items.forEach(function (e) { return (e.isSelected = rowData.isSelected); });
|
|
2724
2871
|
(_e = (_d = _this.gridOption.selection) === null || _d === void 0 ? void 0 : _d.onSelect) === null || _e === void 0 ? void 0 : _e.call(_d, rowData, _this.items.filter(function (e) { return e.isSelected; }));
|
|
2725
2872
|
_this.isSelectAll = _this.items.every(function (e) { return e.isSelected; });
|
|
2726
2873
|
__classPrivateFieldGet(_this, _updateSelectedItems).call(_this);
|
|
2727
2874
|
}
|
|
2728
2875
|
else {
|
|
2729
2876
|
if ((_f = _this.gridOption.selection) === null || _f === void 0 ? void 0 : _f.single) {
|
|
2730
|
-
_this.items.filter(function (e) { return e !== rowData; }).forEach(function (e) { return e.isSelected = false; });
|
|
2877
|
+
_this.items.filter(function (e) { return e !== rowData; }).forEach(function (e) { return (e.isSelected = false); });
|
|
2731
2878
|
__classPrivateFieldGet(_this, _updateSelectedItems).call(_this);
|
|
2732
2879
|
return;
|
|
2733
2880
|
}
|
|
@@ -2750,11 +2897,12 @@
|
|
|
2750
2897
|
this.onClearSelection = function (items) {
|
|
2751
2898
|
items = items || _this.items;
|
|
2752
2899
|
_this.isSelectAll = false;
|
|
2753
|
-
items === null || items === void 0 ? void 0 : items.forEach(function (e) { return e.isSelected = false; });
|
|
2900
|
+
items === null || items === void 0 ? void 0 : items.forEach(function (e) { return (e.isSelected = false); });
|
|
2754
2901
|
__classPrivateFieldGet(_this, _updateSelectedItems).call(_this);
|
|
2755
2902
|
};
|
|
2756
2903
|
_updateSelectedItems.set(this, function () {
|
|
2757
|
-
_this.selectedItems = _this.items
|
|
2904
|
+
_this.selectedItems = _this.items
|
|
2905
|
+
.filter(function (item) { return item.isSelected; })
|
|
2758
2906
|
.map(function (item) {
|
|
2759
2907
|
var isSelected = item.isSelected, isExpanded = item.isExpanded, isExpanding = item.isExpanding, expandDetail = item.expandDetail, editorErrorMessage = item.editorErrorMessage, editorHandlerColumn = item.editorHandlerColumn, editorHandlerRow = item.editorHandlerRow, editorStatus = item.editorStatus, originItem = item.originItem, sdId = item.sdId, sdVersion = item.sdVersion,
|
|
2760
2908
|
// Giữ lại các trường thông tin cho selectable (action, groupedAction, sdGroup, selectable)
|
|
@@ -2771,12 +2919,8 @@
|
|
|
2771
2919
|
_this.filterRegister.value.set({
|
|
2772
2920
|
columnFilter: columnFilter,
|
|
2773
2921
|
externalFilter: externalFilter,
|
|
2774
|
-
filterDef: filterDef
|
|
2922
|
+
filterDef: filterDef,
|
|
2775
2923
|
});
|
|
2776
|
-
// if (this.gridOption?.filter?.inlineColumn && args?.columnFilter) {
|
|
2777
|
-
// this.columnFilter = args.columnFilter;
|
|
2778
|
-
// }
|
|
2779
|
-
// this.gridFilter?.setFilter(args);
|
|
2780
2924
|
};
|
|
2781
2925
|
this.onCreate = function () {
|
|
2782
2926
|
var _a, _b;
|
|
@@ -2820,7 +2964,7 @@
|
|
|
2820
2964
|
}
|
|
2821
2965
|
item.editorStatus = 'create';
|
|
2822
2966
|
item.editorHandlerRow = {
|
|
2823
|
-
temporary: Object.assign({}, item)
|
|
2967
|
+
temporary: Object.assign({}, item),
|
|
2824
2968
|
};
|
|
2825
2969
|
};
|
|
2826
2970
|
this.onUpdate = function (item) {
|
|
@@ -3024,13 +3168,9 @@
|
|
|
3024
3168
|
Object.defineProperty(SdGridMaterial.prototype, "option", {
|
|
3025
3169
|
set: function (option) {
|
|
3026
3170
|
if (option) {
|
|
3027
|
-
option = __classPrivateFieldGet(this, _initConfiguration).call(this, option);
|
|
3171
|
+
option = __classPrivateFieldGet(this, _initConfiguration$1).call(this, option);
|
|
3028
3172
|
this.gridOption = option;
|
|
3029
|
-
// this.#loadFilterRegister();
|
|
3030
3173
|
__classPrivateFieldSet(this, _loadCompleted, false);
|
|
3031
|
-
// this.#reload.next({
|
|
3032
|
-
// force: true,
|
|
3033
|
-
// });
|
|
3034
3174
|
var configuration = this.gridConfigurationService.init(this.key, this.gridOption);
|
|
3035
3175
|
this.gridConfigurationObserver = configuration.observer;
|
|
3036
3176
|
configuration.load();
|
|
@@ -3045,11 +3185,13 @@
|
|
|
3045
3185
|
var _this = this;
|
|
3046
3186
|
if (paginator && __classPrivateFieldGet(this, _paginator) !== paginator) {
|
|
3047
3187
|
__classPrivateFieldSet(this, _paginator, paginator);
|
|
3048
|
-
__classPrivateFieldGet(this, _subscription$2).add(paginator.page
|
|
3188
|
+
__classPrivateFieldGet(this, _subscription$2).add(paginator.page
|
|
3189
|
+
.pipe(operators.map(function () {
|
|
3049
3190
|
__classPrivateFieldGet(_this, _reload).next({
|
|
3050
|
-
force: false
|
|
3191
|
+
force: false,
|
|
3051
3192
|
});
|
|
3052
|
-
}))
|
|
3193
|
+
}))
|
|
3194
|
+
.subscribe());
|
|
3053
3195
|
}
|
|
3054
3196
|
},
|
|
3055
3197
|
enumerable: false,
|
|
@@ -3060,11 +3202,13 @@
|
|
|
3060
3202
|
var _this = this;
|
|
3061
3203
|
if (sort && __classPrivateFieldGet(this, _sort) !== sort) {
|
|
3062
3204
|
__classPrivateFieldSet(this, _sort, sort);
|
|
3063
|
-
__classPrivateFieldGet(this, _subscription$2).add(sort.sortChange
|
|
3205
|
+
__classPrivateFieldGet(this, _subscription$2).add(sort.sortChange
|
|
3206
|
+
.pipe(operators.map(function () {
|
|
3064
3207
|
__classPrivateFieldGet(_this, _reload).next({
|
|
3065
|
-
force: false
|
|
3208
|
+
force: false,
|
|
3066
3209
|
});
|
|
3067
|
-
}))
|
|
3210
|
+
}))
|
|
3211
|
+
.subscribe());
|
|
3068
3212
|
}
|
|
3069
3213
|
},
|
|
3070
3214
|
enumerable: false,
|
|
@@ -3088,14 +3232,15 @@
|
|
|
3088
3232
|
return [2 /*return*/, result];
|
|
3089
3233
|
}
|
|
3090
3234
|
});
|
|
3091
|
-
}); }))
|
|
3235
|
+
}); }))
|
|
3236
|
+
.subscribe(__classPrivateFieldGet(this, _render)));
|
|
3092
3237
|
__classPrivateFieldGet(this, _subscription$2).add(this.sdCellDefs.changes.pipe(operators.startWith([])).subscribe(__classPrivateFieldGet(this, _initCellDef)));
|
|
3093
3238
|
__classPrivateFieldGet(this, _subscription$2).add(this.sdFooterDefs.changes.pipe(operators.startWith([])).subscribe(__classPrivateFieldGet(this, _initFooterDef)));
|
|
3094
3239
|
__classPrivateFieldGet(this, _subscription$2).add(this.sdFilterDefs.changes.pipe(operators.startWith([])).subscribe(__classPrivateFieldGet(this, _initFilterDef)));
|
|
3095
3240
|
__classPrivateFieldGet(this, _subscription$2).add(rxjs.combineLatest([
|
|
3096
3241
|
__classPrivateFieldGet(this, _optionChanges).pipe(operators.startWith(this.gridOption)),
|
|
3097
|
-
this.sdFilterDefs.changes.pipe(operators.startWith(this.filterDefs))
|
|
3098
|
-
]).subscribe(function (
|
|
3242
|
+
this.sdFilterDefs.changes.pipe(operators.startWith(this.filterDefs)),
|
|
3243
|
+
]).subscribe(function () {
|
|
3099
3244
|
__classPrivateFieldGet(_this, _loadFilterRegister).call(_this);
|
|
3100
3245
|
}));
|
|
3101
3246
|
this.ref.detectChanges();
|
|
@@ -3108,7 +3253,8 @@
|
|
|
3108
3253
|
};
|
|
3109
3254
|
Object.defineProperty(SdGridMaterial.prototype, "editedItems", {
|
|
3110
3255
|
get: function () {
|
|
3111
|
-
return this.items
|
|
3256
|
+
return this.items
|
|
3257
|
+
.filter(function (item) {
|
|
3112
3258
|
if (!item.originItem) {
|
|
3113
3259
|
return true;
|
|
3114
3260
|
}
|
|
@@ -3116,7 +3262,8 @@
|
|
|
3116
3262
|
return true;
|
|
3117
3263
|
}
|
|
3118
3264
|
return false;
|
|
3119
|
-
})
|
|
3265
|
+
})
|
|
3266
|
+
.map(function (item) {
|
|
3120
3267
|
var editorStatus = item.editorStatus, editorHandlerRow = item.editorHandlerRow, editorHandlerColumn = item.editorHandlerColumn, editorErrorMessage = item.editorErrorMessage, expandDetail = item.expandDetail, isExpanded = item.isExpanded, isExpanding = item.isExpanding, isSelected = item.isSelected, originItem = item.originItem, sdId = item.sdId, sdVersion = item.sdVersion, selectable = item.selectable, actions = item.actions, groupedActions = item.groupedActions, sdGroup = item.sdGroup, temporary = item.temporary, result = __rest(item, ["editorStatus", "editorHandlerRow", "editorHandlerColumn", "editorErrorMessage", "expandDetail", "isExpanded", "isExpanding", "isSelected", "originItem", "sdId", "sdVersion", "selectable", "actions", "groupedActions", "sdGroup", "temporary"]);
|
|
3121
3268
|
return Object.assign(Object.assign({}, result), { editorErrorMessage: editorErrorMessage });
|
|
3122
3269
|
});
|
|
@@ -3160,7 +3307,7 @@
|
|
|
3160
3307
|
});
|
|
3161
3308
|
return SdGridMaterial;
|
|
3162
3309
|
}());
|
|
3163
|
-
_optionChanges = new WeakMap(), _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();
|
|
3310
|
+
_optionChanges = new WeakMap(), _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$1 = 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();
|
|
3164
3311
|
SdGridMaterial.decorators = [
|
|
3165
3312
|
{ type: core.Component, args: [{
|
|
3166
3313
|
selector: 'sd-grid-material',
|