@sd-angular/core 0.0.901 → 0.0.905
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 +219 -61
- 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-select.umd.js +10 -2
- package/bundles/sd-angular-core-select.umd.js.map +1 -1
- package/bundles/sd-angular-core-select.umd.min.js +1 -1
- package/bundles/sd-angular-core-select.umd.min.js.map +1 -1
- package/bundles/sd-angular-core-setting.umd.js +2 -2
- 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/bundles/sd-angular-core-tab-router.umd.js +11 -8
- package/bundles/sd-angular-core-tab-router.umd.js.map +1 -1
- package/bundles/sd-angular-core-tab-router.umd.min.js +1 -1
- package/bundles/sd-angular-core-tab-router.umd.min.js.map +1 -1
- package/esm2015/grid-material/sd-angular-core-grid-material.js +20 -18
- package/esm2015/grid-material/src/lib/components/desktop-cell-view/desktop-cell-view.component.js +2 -2
- package/esm2015/grid-material/src/lib/components/dynamic-column/dynamic-column.component.js +98 -0
- package/esm2015/grid-material/src/lib/components/popup-grid-configuration/popup-grid-configuration.component.js +23 -5
- package/esm2015/grid-material/src/lib/grid-material.component.js +1 -2
- package/esm2015/grid-material/src/lib/grid-material.module.js +8 -2
- package/esm2015/grid-material/src/lib/models/grid-column.model.js +1 -1
- package/esm2015/grid-material/src/lib/models/grid-config.model.js +1 -1
- package/esm2015/grid-material/src/lib/pipes/column-badge.pipe.js +4 -1
- package/esm2015/grid-material/src/lib/pipes/column-transform.pipe.js +5 -1
- package/esm2015/grid-material/src/lib/services/generated-column/generated-column.model.js +2 -0
- package/esm2015/grid-material/src/lib/services/generated-column/generated-column.service.js +57 -0
- package/esm2015/grid-material/src/lib/services/grid-configuration.service.js +13 -18
- package/esm2015/select/src/lib/select.component.js +11 -3
- package/esm2015/setting/src/lib/setting.model.js +1 -1
- package/esm2015/setting/src/lib/setting.service.js +5 -5
- package/esm2015/tab-router/src/lib/components/tab-router-outlet/tab-router-outlet.component.js +21 -18
- package/fesm2015/sd-angular-core-grid-material.js +196 -34
- package/fesm2015/sd-angular-core-grid-material.js.map +1 -1
- package/fesm2015/sd-angular-core-select.js +10 -2
- package/fesm2015/sd-angular-core-select.js.map +1 -1
- package/fesm2015/sd-angular-core-setting.js +4 -4
- package/fesm2015/sd-angular-core-setting.js.map +1 -1
- package/fesm2015/sd-angular-core-tab-router.js +11 -8
- package/fesm2015/sd-angular-core-tab-router.js.map +1 -1
- package/grid-material/sd-angular-core-grid-material.d.ts +19 -17
- package/grid-material/sd-angular-core-grid-material.metadata.json +1 -1
- package/grid-material/src/lib/components/dynamic-column/dynamic-column.component.d.ts +32 -0
- package/grid-material/src/lib/components/popup-grid-configuration/popup-grid-configuration.component.d.ts +9 -0
- package/grid-material/src/lib/models/grid-column.model.d.ts +2 -0
- package/grid-material/src/lib/models/grid-config.model.d.ts +11 -1
- package/grid-material/src/lib/services/generated-column/generated-column.model.d.ts +8 -0
- package/grid-material/src/lib/services/generated-column/generated-column.service.d.ts +10 -0
- package/package.json +1 -1
- package/{sd-angular-core-0.0.901.tgz → sd-angular-core-0.0.905.tgz} +0 -0
- package/setting/src/lib/setting.model.d.ts +2 -2
- package/tab-router/src/lib/components/tab-router-outlet/tab-router-outlet.component.d.ts +7 -7
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Directive, TemplateRef, Input, InjectionToken, EventEmitter, Component, ViewChild, Output, Injectable, ChangeDetectorRef, Inject, Optional, QueryList, ContentChild, ContentChildren, Pipe, ViewContainerRef, NgModule } from '@angular/core';
|
|
1
|
+
import { Directive, TemplateRef, Input, InjectionToken, EventEmitter, Component, ViewChild, Output, Injectable, ChangeDetectorRef, Inject, Optional, QueryList, ContentChild, ContentChildren, Pipe, ViewContainerRef, HostListener, ChangeDetectionStrategy, NgModule } from '@angular/core';
|
|
2
2
|
import { __awaiter, __classPrivateFieldGet, __rest, __classPrivateFieldSet } from 'tslib';
|
|
3
3
|
import { MatPaginator, MatPaginatorIntl, MatPaginatorModule } from '@angular/material/paginator';
|
|
4
4
|
import { MatSort, MatSortModule } from '@angular/material/sort';
|
|
@@ -8,7 +8,7 @@ import { v4 } from 'uuid';
|
|
|
8
8
|
import { Subject, Subscription, isObservable } from 'rxjs';
|
|
9
9
|
import { SdNotifyService } from '@sd-angular/core/notify';
|
|
10
10
|
import { moveItemInArray, DragDropModule } from '@angular/cdk/drag-drop';
|
|
11
|
-
import { startWith, debounceTime, map
|
|
11
|
+
import { startWith, switchMap, debounceTime, map } from 'rxjs/operators';
|
|
12
12
|
import hash from 'object-hash';
|
|
13
13
|
import { SdSettingService } from '@sd-angular/core/setting';
|
|
14
14
|
import { DeviceDetectorService } from 'ngx-device-detector';
|
|
@@ -27,6 +27,7 @@ import { MatTableModule } from '@angular/material/table';
|
|
|
27
27
|
import { MatProgressSpinnerModule } from '@angular/material/progress-spinner';
|
|
28
28
|
import { CdkTableModule, CdkColumnDef } from '@angular/cdk/table';
|
|
29
29
|
import { MatMenuModule } from '@angular/material/menu';
|
|
30
|
+
import { MatSliderModule } from '@angular/material/slider';
|
|
30
31
|
import { MatButtonModule } from '@angular/material/button';
|
|
31
32
|
import { SdServiceModule } from '@sd-angular/core/service';
|
|
32
33
|
import { MatTooltipModule } from '@angular/material/tooltip';
|
|
@@ -37,6 +38,7 @@ import { SdFormModule } from '@sd-angular/core/form';
|
|
|
37
38
|
import { MatCheckboxModule } from '@angular/material/checkbox';
|
|
38
39
|
import { MatListModule } from '@angular/material/list';
|
|
39
40
|
import { MatDividerModule } from '@angular/material/divider';
|
|
41
|
+
import { SdSideDrawer } from '@sd-angular/core/side-drawer';
|
|
40
42
|
|
|
41
43
|
class SdMaterialCellDefDirective {
|
|
42
44
|
constructor(templateRef) {
|
|
@@ -721,7 +723,7 @@ SdPopupExport.propDecorators = {
|
|
|
721
723
|
_gridOption: [{ type: Input, args: ['gridOption',] }]
|
|
722
724
|
};
|
|
723
725
|
|
|
724
|
-
var _COLUMNS, _cache, _getKey, _default,
|
|
726
|
+
var _COLUMNS, _cache, _getKey, _default, _get, _set, _remove;
|
|
725
727
|
class SdGridConfigurationService {
|
|
726
728
|
constructor(settingService, gridMaterialConfiguration) {
|
|
727
729
|
this.settingService = settingService;
|
|
@@ -735,19 +737,20 @@ class SdGridConfigurationService {
|
|
|
735
737
|
this.init = (key, gridOption) => {
|
|
736
738
|
if (!__classPrivateFieldGet(this, _cache)[key]) {
|
|
737
739
|
const subject = new Subject();
|
|
740
|
+
const get = __classPrivateFieldGet(this, _get).call(this, gridOption);
|
|
741
|
+
const set = (configuration) => {
|
|
742
|
+
configuration = __classPrivateFieldGet(this, _set).call(this, gridOption, configuration);
|
|
743
|
+
subject.next(Object.assign({}, configuration));
|
|
744
|
+
return configuration;
|
|
745
|
+
};
|
|
738
746
|
__classPrivateFieldGet(this, _cache)[key] = {
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
set: (configuration) => {
|
|
742
|
-
configuration = __classPrivateFieldGet(this, _set).call(this, gridOption, configuration);
|
|
743
|
-
subject.next(Object.assign({}, configuration));
|
|
744
|
-
return configuration;
|
|
745
|
-
},
|
|
747
|
+
get,
|
|
748
|
+
set,
|
|
746
749
|
remove: () => {
|
|
747
750
|
__classPrivateFieldGet(this, _remove).call(this, gridOption);
|
|
748
751
|
subject.next(__classPrivateFieldGet(this, _default).call(this, gridOption));
|
|
749
752
|
},
|
|
750
|
-
observer: subject
|
|
753
|
+
observer: subject.pipe(switchMap(__classPrivateFieldGet(this, _get).call(this, gridOption)))
|
|
751
754
|
};
|
|
752
755
|
}
|
|
753
756
|
return __classPrivateFieldGet(this, _cache)[key];
|
|
@@ -779,13 +782,6 @@ class SdGridConfigurationService {
|
|
|
779
782
|
columns
|
|
780
783
|
};
|
|
781
784
|
});
|
|
782
|
-
_load.set(this, (gridOption, subject) => {
|
|
783
|
-
return () => __awaiter(this, void 0, void 0, function* () {
|
|
784
|
-
const get = __classPrivateFieldGet(this, _get).call(this, gridOption);
|
|
785
|
-
const configuration = yield get();
|
|
786
|
-
subject.next(Object.assign({}, configuration));
|
|
787
|
-
});
|
|
788
|
-
});
|
|
789
785
|
_get.set(this, (gridOption) => {
|
|
790
786
|
return () => __awaiter(this, void 0, void 0, function* () {
|
|
791
787
|
const key = __classPrivateFieldGet(this, _getKey).call(this, gridOption);
|
|
@@ -1045,7 +1041,7 @@ class SdGridConfigurationService {
|
|
|
1045
1041
|
};
|
|
1046
1042
|
}
|
|
1047
1043
|
}
|
|
1048
|
-
_COLUMNS = new WeakMap(), _cache = new WeakMap(), _getKey = new WeakMap(), _default = new WeakMap(),
|
|
1044
|
+
_COLUMNS = new WeakMap(), _cache = new WeakMap(), _getKey = new WeakMap(), _default = new WeakMap(), _get = new WeakMap(), _set = new WeakMap(), _remove = new WeakMap();
|
|
1049
1045
|
SdGridConfigurationService.decorators = [
|
|
1050
1046
|
{ type: Injectable }
|
|
1051
1047
|
];
|
|
@@ -1109,7 +1105,7 @@ SdGridService.ctorParameters = () => [
|
|
|
1109
1105
|
{ type: SdUtilityService }
|
|
1110
1106
|
];
|
|
1111
1107
|
|
|
1112
|
-
var _paginator, _sort, _subscription$1, _optionChanges, _initCellDef, _initFilterDef, _initFooterDef, _filterExportInfo, _initConfiguration, _filterLocal, _getFilter, _load
|
|
1108
|
+
var _paginator, _sort, _subscription$1, _optionChanges, _initCellDef, _initFilterDef, _initFooterDef, _filterExportInfo, _initConfiguration, _filterLocal, _getFilter, _load, _render, _exportedItems, _allColumns, _allExportedColumns, _onExport, _updateSelectedItems;
|
|
1113
1109
|
class SdGridMaterial {
|
|
1114
1110
|
constructor(ref, configuration, gridConfigurationService, exportService, notifyService, translateService, gridService) {
|
|
1115
1111
|
this.ref = ref;
|
|
@@ -1307,7 +1303,7 @@ class SdGridMaterial {
|
|
|
1307
1303
|
pageSize: ((_j = __classPrivateFieldGet(this, _paginator)) === null || _j === void 0 ? void 0 : _j.pageSize) || ((_l = (_k = this.gridOption) === null || _k === void 0 ? void 0 : _k.paginate) === null || _l === void 0 ? void 0 : _l.pageSize) || 50
|
|
1308
1304
|
});
|
|
1309
1305
|
});
|
|
1310
|
-
_load
|
|
1306
|
+
_load.set(this, (filterReq) => __awaiter(this, void 0, void 0, function* () {
|
|
1311
1307
|
this.isLoading = true;
|
|
1312
1308
|
try {
|
|
1313
1309
|
if (this.gridOption.type === 'server') {
|
|
@@ -1347,7 +1343,7 @@ class SdGridMaterial {
|
|
|
1347
1343
|
__classPrivateFieldGet(this, _updateSelectedItems).call(this);
|
|
1348
1344
|
}));
|
|
1349
1345
|
this.reload = () => __awaiter(this, void 0, void 0, function* () {
|
|
1350
|
-
const data = yield __classPrivateFieldGet(this, _load
|
|
1346
|
+
const data = yield __classPrivateFieldGet(this, _load).call(this, __classPrivateFieldGet(this, _getFilter).call(this));
|
|
1351
1347
|
__classPrivateFieldGet(this, _render).call(this, data);
|
|
1352
1348
|
});
|
|
1353
1349
|
_exportedItems.set(this, (pageNumber = 0, pageSize = 10000) => __awaiter(this, void 0, void 0, function* () {
|
|
@@ -1671,7 +1667,7 @@ class SdGridMaterial {
|
|
|
1671
1667
|
__classPrivateFieldGet(this, _subscription$1).add(gridFilter.filterChange.pipe(debounceTime(200), map(() => {
|
|
1672
1668
|
__classPrivateFieldGet(this, _paginator).pageIndex = 0;
|
|
1673
1669
|
return __classPrivateFieldGet(this, _getFilter).call(this);
|
|
1674
|
-
}), switchMap(__classPrivateFieldGet(this, _load
|
|
1670
|
+
}), switchMap(__classPrivateFieldGet(this, _load))).subscribe(__classPrivateFieldGet(this, _render)));
|
|
1675
1671
|
}
|
|
1676
1672
|
}
|
|
1677
1673
|
set option(option) {
|
|
@@ -1688,19 +1684,18 @@ class SdGridMaterial {
|
|
|
1688
1684
|
});
|
|
1689
1685
|
const configuration = this.gridConfigurationService.init(this.key, this.gridOption);
|
|
1690
1686
|
this.gridConfigurationObserver = configuration.observer;
|
|
1691
|
-
configuration.load();
|
|
1692
1687
|
}
|
|
1693
1688
|
}
|
|
1694
1689
|
set paginator(paginator) {
|
|
1695
1690
|
if (paginator && __classPrivateFieldGet(this, _paginator) !== paginator) {
|
|
1696
1691
|
__classPrivateFieldSet(this, _paginator, paginator);
|
|
1697
|
-
__classPrivateFieldGet(this, _subscription$1).add(paginator.page.pipe(debounceTime(200), map(__classPrivateFieldGet(this, _getFilter)), switchMap(__classPrivateFieldGet(this, _load
|
|
1692
|
+
__classPrivateFieldGet(this, _subscription$1).add(paginator.page.pipe(debounceTime(200), map(__classPrivateFieldGet(this, _getFilter)), switchMap(__classPrivateFieldGet(this, _load))).subscribe(__classPrivateFieldGet(this, _render)));
|
|
1698
1693
|
}
|
|
1699
1694
|
}
|
|
1700
1695
|
set sort(sort) {
|
|
1701
1696
|
if (sort && __classPrivateFieldGet(this, _sort) !== sort) {
|
|
1702
1697
|
__classPrivateFieldSet(this, _sort, sort);
|
|
1703
|
-
__classPrivateFieldGet(this, _subscription$1).add(sort.sortChange.pipe(debounceTime(200), map(__classPrivateFieldGet(this, _getFilter)), switchMap(__classPrivateFieldGet(this, _load
|
|
1698
|
+
__classPrivateFieldGet(this, _subscription$1).add(sort.sortChange.pipe(debounceTime(200), map(__classPrivateFieldGet(this, _getFilter)), switchMap(__classPrivateFieldGet(this, _load))).subscribe(__classPrivateFieldGet(this, _render)));
|
|
1704
1699
|
}
|
|
1705
1700
|
}
|
|
1706
1701
|
ngOnInit() {
|
|
@@ -1710,7 +1705,7 @@ class SdGridMaterial {
|
|
|
1710
1705
|
__classPrivateFieldGet(this, _subscription$1).add(this.sdCellDefs.changes.pipe(startWith([])).subscribe(__classPrivateFieldGet(this, _initCellDef)));
|
|
1711
1706
|
__classPrivateFieldGet(this, _subscription$1).add(this.sdFooterDefs.changes.pipe(startWith([])).subscribe(__classPrivateFieldGet(this, _initFooterDef)));
|
|
1712
1707
|
__classPrivateFieldGet(this, _subscription$1).add(this.sdFilterDefs.changes.pipe(startWith([])).subscribe(__classPrivateFieldGet(this, _initFilterDef)));
|
|
1713
|
-
__classPrivateFieldGet(this, _subscription$1).add(__classPrivateFieldGet(this, _optionChanges).pipe(startWith({}), debounceTime(200), map(__classPrivateFieldGet(this, _getFilter)), switchMap(__classPrivateFieldGet(this, _load
|
|
1708
|
+
__classPrivateFieldGet(this, _subscription$1).add(__classPrivateFieldGet(this, _optionChanges).pipe(startWith({}), debounceTime(200), map(__classPrivateFieldGet(this, _getFilter)), switchMap(__classPrivateFieldGet(this, _load))).subscribe(__classPrivateFieldGet(this, _render)));
|
|
1714
1709
|
this.ref.detectChanges();
|
|
1715
1710
|
}
|
|
1716
1711
|
ngOnDestroy() {
|
|
@@ -1720,7 +1715,7 @@ class SdGridMaterial {
|
|
|
1720
1715
|
moveItemInArray(columns, event.previousIndex, event.currentIndex);
|
|
1721
1716
|
}
|
|
1722
1717
|
}
|
|
1723
|
-
_paginator = new WeakMap(), _sort = new WeakMap(), _subscription$1 = new WeakMap(), _optionChanges = new WeakMap(), _initCellDef = new WeakMap(), _initFilterDef = new WeakMap(), _initFooterDef = new WeakMap(), _filterExportInfo = new WeakMap(), _initConfiguration = new WeakMap(), _filterLocal = new WeakMap(), _getFilter = new WeakMap(), _load
|
|
1718
|
+
_paginator = new WeakMap(), _sort = new WeakMap(), _subscription$1 = new WeakMap(), _optionChanges = new WeakMap(), _initCellDef = new WeakMap(), _initFilterDef = new WeakMap(), _initFooterDef = new WeakMap(), _filterExportInfo = new WeakMap(), _initConfiguration = new WeakMap(), _filterLocal = new WeakMap(), _getFilter = new WeakMap(), _load = new WeakMap(), _render = new WeakMap(), _exportedItems = new WeakMap(), _allColumns = new WeakMap(), _allExportedColumns = new WeakMap(), _onExport = new WeakMap(), _updateSelectedItems = new WeakMap();
|
|
1724
1719
|
SdGridMaterial.decorators = [
|
|
1725
1720
|
{ type: Component, args: [{
|
|
1726
1721
|
selector: 'sd-grid-material',
|
|
@@ -1932,7 +1927,7 @@ class SdDesktopCellView {
|
|
|
1932
1927
|
SdDesktopCellView.decorators = [
|
|
1933
1928
|
{ type: Component, args: [{
|
|
1934
1929
|
selector: 'sd-desktop-cell-view',
|
|
1935
|
-
template: "<ng-container *ngIf=\"column && item\">\r\n <ng-container *ngIf=\"column.htmlTemplate;else useDefaultView\">\r\n <div (click)=\"column.click && column.click(item[column.field], item)\" style=\"overflow-wrap: break-word;\"\r\n [ngClass]=\"{'cursor-pointer':column.click}\"\r\n [innerHTML]=\"(item[column.field] | columnHtmlTemplate:item:column) | safeHtml\">\r\n </div>\r\n </ng-container>\r\n <ng-template #useDefaultView>\r\n <ng-container *sdLet=\"item[column.field] | columnBadge:item:column as badge\">\r\n <ng-container *ngIf=\"column.type === 'string'\">\r\n <ng-container *ngIf=\"!!badge\">\r\n <div *ngIf=\"!column.badgeType\" class=\"c-badge\" style=\"overflow-wrap: break-word;\" matTooltipPosition=\"above\"\r\n [matTooltip]=\"item[column.field] | columnTooltip:item:column\"\r\n [class]=\"{'c-secondary': badge === 'normal', 'c-info': badge === 'info', 'c-success': badge === 'success', 'c-danger': badge === 'danger', 'c-warning': badge === 'warning'}\">\r\n <span *ngIf=\"column.click\" class=\"pointer\"\r\n (click)=\"column.click(item[column.field], item)\">{{item[column.field] |\r\n columnTransform:item:column}}</span>\r\n <ng-container *ngIf=\"!column.click\">{{item[column.field] | columnTransform:item:column}}</ng-container>\r\n </div>\r\n <div *ngIf=\"column.badgeType === 'circle'\" style=\"min-width: 150px\"\r\n class=\"c-badge-circle d-flex align-items-center\"\r\n [class]=\"{'c-unknown': !badge, 'c-secondary': badge === 'normal', 'c-info': badge === 'info', 'c-success': badge === 'success', 'c-danger': badge === 'danger', 'c-warning': badge === 'warning'}\">\r\n <span *ngIf=\"badge\" class=\"material-icons-round c-material-icon mr-4\">\r\n fiber_manual_record\r\n </span>\r\n <span *ngIf=\"!badge\" class=\"material-icons-outlined c-material-icon mr-4\">\r\n fiber_manual_record\r\n </span>\r\n {{item[column.field] | columnTransform:item:column}}\r\n </div>\r\n </ng-container>\r\n <ng-container *ngIf=\"!badge\">\r\n <div style=\"overflow-wrap: break-word;\" [matTooltip]=\"item[column.field] | columnTooltip:item:column\">\r\n <a *ngIf=\"column.click\" href=\"javascript:;\"\r\n (click)=\"column.click(item[column.field], item)\">{{item[column.field] | columnTransform:item:column}}</a>\r\n <ng-container *ngIf=\"!column.click\">{{item[column.field] | columnTransform:item:column}}</ng-container>\r\n </div>\r\n </ng-container>\r\n </ng-container>\r\n
|
|
1930
|
+
template: "<ng-container *ngIf=\"column && item\">\r\n <ng-container *ngIf=\"column.htmlTemplate;else useDefaultView\">\r\n <div (click)=\"column.click && column.click(item[column.field], item)\" style=\"overflow-wrap: break-word;\"\r\n [ngClass]=\"{'cursor-pointer':column.click}\"\r\n [innerHTML]=\"(item[column.field] | columnHtmlTemplate:item:column) | safeHtml\">\r\n </div>\r\n </ng-container>\r\n <ng-template #useDefaultView>\r\n <ng-container *sdLet=\"item[column.field] | columnBadge:item:column as badge\">\r\n <ng-container *ngIf=\"column.type === 'string'\">\r\n <ng-container *ngIf=\"!!badge\">\r\n <div *ngIf=\"!column.badgeType\" class=\"c-badge\" style=\"overflow-wrap: break-word;\" matTooltipPosition=\"above\"\r\n [matTooltip]=\"item[column.field] | columnTooltip:item:column\"\r\n [class]=\"{'c-secondary': badge === 'normal', 'c-info': badge === 'info', 'c-success': badge === 'success', 'c-danger': badge === 'danger', 'c-warning': badge === 'warning'}\">\r\n <span *ngIf=\"column.click\" class=\"pointer\"\r\n (click)=\"column.click(item[column.field], item)\">{{item[column.field] |\r\n columnTransform:item:column}}</span>\r\n <ng-container *ngIf=\"!column.click\">{{item[column.field] | columnTransform:item:column}}</ng-container>\r\n </div>\r\n <div *ngIf=\"column.badgeType === 'circle'\" style=\"min-width: 150px\"\r\n class=\"c-badge-circle d-flex align-items-center\"\r\n [class]=\"{'c-unknown': !badge, 'c-secondary': badge === 'normal', 'c-info': badge === 'info', 'c-success': badge === 'success', 'c-danger': badge === 'danger', 'c-warning': badge === 'warning'}\">\r\n <span *ngIf=\"badge\" class=\"material-icons-round c-material-icon mr-4\">\r\n fiber_manual_record\r\n </span>\r\n <span *ngIf=\"!badge\" class=\"material-icons-outlined c-material-icon mr-4\">\r\n fiber_manual_record\r\n </span>\r\n {{item[column.field] | columnTransform:item:column}}\r\n </div>\r\n </ng-container>\r\n <ng-container *ngIf=\"!badge\">\r\n <div style=\"overflow-wrap: break-word;\" [matTooltip]=\"item[column.field] | columnTooltip:item:column\">\r\n <a *ngIf=\"column.click\" href=\"javascript:;\"\r\n (click)=\"column.click(item[column.field], item)\">{{item[column.field] | columnTransform:item:column}}</a>\r\n <ng-container *ngIf=\"!column.click\">{{item[column.field] | columnTransform:item:column}}</ng-container>\r\n </div>\r\n </ng-container>\r\n </ng-container>\r\n <div *ngIf=\"column.type === 'number'\">\r\n <a *ngIf=\"column.click\" href=\"javascript:;\"\r\n (click)=\"column.click(item[column.field], item)\">{{item[column.field] | columnTransform:item:column}}</a>\r\n <ng-container *ngIf=\"!column.click\">\r\n {{item[column.field] | columnTransform:item:column}}</ng-container>\r\n </div>\r\n <div *ngIf=\"column.type === 'date'\" matTooltipPosition=\"above\"\r\n [matTooltip]=\"item[column.field] | date:'dd/MM/yyyy'\">\r\n {{item[column.field] | sdTimeDifferent:'dd/MM/yyyy':column.option?.timeDifferent | async}}\r\n </div>\r\n <div *ngIf=\"column.type === 'datetime'\" matTooltipPosition=\"above\"\r\n [matTooltip]=\"item[column.field] | date:'dd/MM/yyyy HH:mm'\">\r\n {{item[column.field] | sdTimeDifferent:'dd/MM/yyyy HH:mm':column.option?.timeDifferent | async}}\r\n </div>\r\n <div *ngIf=\"column.type === 'time'\">\r\n {{item[column.field] | date:'HH:mm'}}\r\n </div>\r\n <div *ngIf=\"column.type === 'bool'\" class=\"align-middle text-center\">\r\n <ng-container *ngIf=\"!!badge\">\r\n <div *ngIf=\"!column.badgeType\" class=\"c-badge\" style=\"overflow-wrap: break-word;\" matTooltipPosition=\"above\"\r\n [matTooltip]=\"item[column.field] | columnTooltip:item:column\"\r\n [class]=\"{'c-secondary': badge === 'normal', 'c-info': badge === 'info', 'c-success': badge === 'success', 'c-danger': badge === 'danger', 'c-warning': badge === 'warning'}\">\r\n <span *ngIf=\"column.click\" class=\"pointer\"\r\n (click)=\"column.click(item[column.field], item)\">{{item[column.field] | columnTransform:item:column}}</span>\r\n <ng-container *ngIf=\"!column.click\">{{item[column.field] | columnTransform:item:column}}</ng-container>\r\n </div>\r\n <div *ngIf=\"column.badgeType === 'circle'\" style=\"min-width: 150px\"\r\n class=\"c-badge-circle d-flex align-items-center\"\r\n [class]=\"{'c-unknown': !badge, 'c-secondary': badge === 'normal', 'c-info': badge === 'info', 'c-success': badge === 'success', 'c-danger': badge === 'danger', 'c-warning': badge === 'warning'}\">\r\n <span *ngIf=\"badge\" class=\"material-icons-round c-material-icon mr-4\">\r\n fiber_manual_record\r\n </span>\r\n <span *ngIf=\"!badge\" class=\"material-icons-outlined c-material-icon mr-4\">\r\n fiber_manual_record\r\n </span>\r\n {{item[column.field] | columnTransform:item:column}}\r\n </div>\r\n </ng-container>\r\n <ng-container *ngIf=\"!badge\">\r\n <span *ngIf=\"item[column.field]\" class=\"font-weight-bold c-color-success\">{{item[column.field] | columnTransform:item:column}}</span>\r\n <span *ngIf=\"!item[column.field]\" class=\"font-weight-bold c-color-danger\">{{item[column.field] | columnTransform:item:column}}</span>\r\n </ng-container>\r\n </div>\r\n <div *ngIf=\"column.type === 'values'\">\r\n <ng-container *ngIf=\"item[column.field] | columnValues:column:key | async; $implicit as valueData\">\r\n <div\r\n *ngIf=\"valueData[column.option?.colorField] || valueData[column.option?.backgroundColorField]; else elseNoStatus\"\r\n class=\"c-badge\"\r\n [ngStyle]=\"{'color':valueData[column.option?.colorField], 'background-color': valueData[column.option?.backgroundColorField]}\">\r\n {{valueData[column.option?.displayField]}}\r\n </div>\r\n <ng-template #elseNoStatus>\r\n <div class=\"text-left\">\r\n {{valueData[column.option?.displayField]}}\r\n </div>\r\n </ng-template>\r\n </ng-container>\r\n </div>\r\n <div *ngIf=\"column.type === 'image'\" class=\"align-middle text-center\">\r\n <img *ngIf=\"item[column.field]\" [src]=\"item[column.field] | columnTransform:item:column\"\r\n [width]=\"column.option?.width\" [height]=\"column.option?.height\" style=\"margin: 5px 0;object-fit: contain;\"\r\n (click)=\"column.click && column.click(item[column.field], item)\" [ngClass]=\"{'pointer':column.click}\">\r\n <mat-icon *ngIf=\"!item[column.field]\" class=\"c-img\" [ngClass]=\"{'pointer':column.click}\"\r\n (click)=\"column.click && column.click(item[column.field], item)\">image</mat-icon>\r\n </div>\r\n </ng-container>\r\n <sd-desktop-cell-children-view *ngIf=\"column.type === 'children'\" [key]=\"key\" [item]=\"item\" [column]=\"column\">\r\n </sd-desktop-cell-children-view>\r\n </ng-template>\r\n</ng-container>",
|
|
1936
1931
|
styles: [".c-color-success{color:#4caf50}.c-color-danger{color:#f82c13}.c-img{font-size:30px;opacity:.5}.c-img.pointer:hover{opacity:.9}.c-badge{border-radius:20px;display:inline-block;margin-bottom:4px;padding:2px 12px;text-align:center}.c-badge.c-warning{background:#fff3e0;color:#ff9600}.c-badge.c-info{background:#e7e9ff;color:#2962ff}.c-badge.c-success{background:#e8f5e9;color:#4caf50}.c-badge.c-danger{background:#fee8e7;color:#f82c13}.c-badge.c-normal{background:rgba(0,0,0,.12);color:#000}.wes-status .c-material-icon{font-size:12px;height:12px;width:12px}.wes-status.text-secondary .c-material-icon{color:rgba(0,0,0,.5)}.c-badge-circle .c-material-icon{font-size:12px;height:12px;width:12px}.c-badge-circle.c-unknown{color:#212121}.c-badge-circle.c-unknown .c-material-icon{color:rgba(0,0,0,.5)}.c-badge-circle.c-secondary{color:#212121}.c-badge-circle.c-info{color:#2962ff}.c-badge-circle.c-success{color:#4caf50}.c-badge-circle.c-danger{color:#f82c13}.c-badge-circle.c-warning{color:#ff9600}"]
|
|
1937
1932
|
},] }
|
|
1938
1933
|
];
|
|
@@ -1948,12 +1943,16 @@ class SdColumnTransformPipe {
|
|
|
1948
1943
|
this.decimalPipe = decimalPipe;
|
|
1949
1944
|
}
|
|
1950
1945
|
transform(value, rowData, column) {
|
|
1946
|
+
var _a, _b;
|
|
1951
1947
|
if (column === null || column === void 0 ? void 0 : column.transform) {
|
|
1952
1948
|
return column.transform(value, rowData);
|
|
1953
1949
|
}
|
|
1954
1950
|
if (column.type === 'number' && Number.isNumber(value)) {
|
|
1955
1951
|
return Number.toVNCurrency(value); // this.decimalPipe.transform(value, '1.0-2');
|
|
1956
1952
|
}
|
|
1953
|
+
if (column.type === 'bool') {
|
|
1954
|
+
return value === true ? (((_a = column.option) === null || _a === void 0 ? void 0 : _a.displayOnTrue) || 'True') : (((_b = column.option) === null || _b === void 0 ? void 0 : _b.displayOnTrue) || 'False');
|
|
1955
|
+
}
|
|
1957
1956
|
return value;
|
|
1958
1957
|
}
|
|
1959
1958
|
}
|
|
@@ -2106,6 +2105,9 @@ class SdColumnBadgePipe {
|
|
|
2106
2105
|
if (column.type === 'string' && (column === null || column === void 0 ? void 0 : column.badge)) {
|
|
2107
2106
|
return column.badge(value, rowData);
|
|
2108
2107
|
}
|
|
2108
|
+
if (column.type === 'bool' && (column === null || column === void 0 ? void 0 : column.badge)) {
|
|
2109
|
+
return column.badge(value, rowData);
|
|
2110
|
+
}
|
|
2109
2111
|
return null;
|
|
2110
2112
|
}
|
|
2111
2113
|
}
|
|
@@ -2172,6 +2174,7 @@ class SdPopupGridConfiguration {
|
|
|
2172
2174
|
_cache$2.set(this, void 0);
|
|
2173
2175
|
this.isCreatingColumn = false;
|
|
2174
2176
|
this.selected = {};
|
|
2177
|
+
this.disabledDrag = true;
|
|
2175
2178
|
this.open = () => __awaiter(this, void 0, void 0, function* () {
|
|
2176
2179
|
__classPrivateFieldSet(this, _cache$2, this.gridConfigurationService.init(this.key, this.gridOption));
|
|
2177
2180
|
this.configuration = yield __classPrivateFieldGet(this, _cache$2).get();
|
|
@@ -2215,13 +2218,26 @@ class SdPopupGridConfiguration {
|
|
|
2215
2218
|
}
|
|
2216
2219
|
ngOnInit() {
|
|
2217
2220
|
}
|
|
2221
|
+
mouseUp(event) {
|
|
2222
|
+
this.disabledDrag = true;
|
|
2223
|
+
}
|
|
2224
|
+
dropTable(event) {
|
|
2225
|
+
moveItemInArray(this.configuration.columns, event.previousIndex, event.currentIndex);
|
|
2226
|
+
this.table.renderRows();
|
|
2227
|
+
}
|
|
2228
|
+
handleMouseDown() {
|
|
2229
|
+
this.disabledDrag = false;
|
|
2230
|
+
}
|
|
2231
|
+
handleMouseUp() {
|
|
2232
|
+
this.disabledDrag = true;
|
|
2233
|
+
}
|
|
2218
2234
|
}
|
|
2219
2235
|
_cache$2 = new WeakMap();
|
|
2220
2236
|
SdPopupGridConfiguration.decorators = [
|
|
2221
2237
|
{ type: Component, args: [{
|
|
2222
2238
|
selector: 'sd-popup-grid-configuration',
|
|
2223
|
-
template: "<sd-modal width=\"sm\" [title]=\"'Configuration' | sdTranslate\" #modal>\r\n <sd-modal-body *ngIf=\"configuration\">\r\n <div *ngIf=\"!isCreatingColumn\" class=\"c-container\">\r\n <div class=\"c-table\" style=\"max-height:70vh\">\r\n <table mat-table [dataSource]=\"configuration.columns\">\r\n <ng-container matColumnDef=\"stt\">\r\n <th mat-header-cell class=\"c-th text-center px-5\" *matHeaderCellDef style=\"width:50px\">#\r\n </th>\r\n <td class=\"text-center px-5\" mat-cell *matCellDef=\"let item; let idx = index\">\r\n <
|
|
2224
|
-
styles: [".c-table{overflow:auto;position:relative}.c-table table{width:100%}.c-table .c-th{color:#000;font-size:14px;font-weight:500;line-height:20px}.c-container{min-height:200px;position:relative}"]
|
|
2239
|
+
template: "<sd-modal width=\"sm\" [title]=\"'Configuration' | sdTranslate\" #modal>\r\n <sd-modal-body *ngIf=\"configuration\">\r\n <div *ngIf=\"!isCreatingColumn\" class=\"c-container\">\r\n <div class=\"c-table\" style=\"max-height:70vh\">\r\n <table #table mat-table [dataSource]=\"configuration.columns\"\r\n cdkDropList\r\n [cdkDropListData]=\"configuration.columns\"\r\n (cdkDropListDropped)=\"dropTable($event)\">\r\n >\r\n <ng-container matColumnDef=\"stt\">\r\n <th mat-header-cell class=\"c-th text-center px-5\" *matHeaderCellDef style=\"width:50px\">#\r\n </th>\r\n <td class=\"text-center px-5\" mat-cell *matCellDef=\"let item; let idx = index\">\r\n <div class=\"c-handle\" (mousedown) = \"handleMouseDown()\" (mouseup)=\"handleMouseUp()\">\r\n <svg width=\"24px\" fill=\"currentColor\" viewBox=\"0 0 24 24\">\r\n <path d=\"M10 9h4V6h3l-5-5-5 5h3v3zm-1 1H6V7l-5 5 5 5v-3h3v-4zm14 2l-5-5v3h-3v4h3v3l5-5zm-9 3h-4v3H7l5 5 5-5h-3v-3z\"></path>\r\n <path d=\"M0 0h24v24H0z\" fill=\"none\"></path>\r\n </svg>\r\n </div>\r\n\r\n </td>\r\n </ng-container>\r\n <ng-container matColumnDef=\"title\">\r\n <th mat-header-cell class=\"c-th px-5\" *matHeaderCellDef>{{'Title' | sdTranslate}}\r\n </th>\r\n <td class=\"px-5\" mat-cell *matCellDef=\"let item;\">\r\n <sd-input [placeholder]=\"item?.origin?.title\" [(model)]=\"item.title\" disableErrorMessage></sd-input>\r\n </td>\r\n </ng-container>\r\n <ng-container matColumnDef=\"width\">\r\n <th mat-header-cell class=\"c-th px-5\" *matHeaderCellDef style=\"width:80px\">{{'Width' | sdTranslate}}\r\n </th>\r\n <td class=\"px-5\" mat-cell *matCellDef=\"let item;\">\r\n <!-- <span>{{item.width}}</span>\r\n <mat-slider\r\n step=\"1\"\r\n min=\"0\"\r\n [max]=\"+item?.origin?.width*3\"\r\n [(ngModel)]=\"+item.width\"\r\n aria-label=\"units\">\r\n </mat-slider> -->\r\n <sd-input [placeholder]=\"item?.origin?.width\" [(model)]=\"item.width\" disableErrorMessage></sd-input>\r\n </td>\r\n </ng-container>\r\n <ng-container matColumnDef=\"invisible\">\r\n <th mat-header-cell class=\"c-th text-center px-5\" *matHeaderCellDef style=\"width:80px\">{{'Hidden' |\r\n sdTranslate}}\r\n </th>\r\n <td class=\"text-center px-5\" mat-cell *matCellDef=\"let item;\">\r\n <mat-slide-toggle [(ngModel)]=\"item.invisible\" color=\"primary\">\r\n </mat-slide-toggle>\r\n </td>\r\n </ng-container>\r\n <ng-container matColumnDef=\"fixed\">\r\n <th mat-header-cell class=\"c-th text-center px-5\" *matHeaderCellDef style=\"width:80px\">{{'Freeze' |\r\n sdTranslate}}\r\n </th>\r\n <td class=\"text-center px-5\" mat-cell *matCellDef=\"let item;\">\r\n <mat-slide-toggle [(ngModel)]=\"item.fixed\" color=\"primary\"></mat-slide-toggle>\r\n </td>\r\n </ng-container>\r\n <tr mat-header-row *matHeaderRowDef=\"['stt', 'title', 'width', 'invisible', 'fixed']; sticky: true\"></tr>\r\n <tr mat-row *matRowDef=\"let row; columns: ['stt', 'title', 'width', 'invisible', 'fixed'];\" cdkDrag [cdkDragData]=\"row\" cdkDragLockAxis=\"y\" [cdkDragDisabled] = \"disabledDrag\"></tr>\r\n </table>\r\n </div>\r\n </div>\r\n <div *ngIf=\"isCreatingColumn\">\r\n <div class=\"c-table\" style=\"max-height:50vh\">\r\n <table mat-table [dataSource]=\"configuration.columns\">\r\n <ng-container matColumnDef=\"stt\">\r\n <th mat-header-cell class=\"c-th text-center px-5\" *matHeaderCellDef style=\"width:50px\">#\r\n </th>\r\n <td class=\"text-center px-5\" mat-cell *matCellDef=\"let item; let idx = index\">\r\n <sd-checkbox *ngIf=\"isCreatingColumn\" [(model)]=\"selected[item.origin?.field]\"></sd-checkbox>\r\n </td>\r\n </ng-container>\r\n <ng-container matColumnDef=\"title\">\r\n <th mat-header-cell class=\"c-th px-5\" *matHeaderCellDef>{{'Title' | sdTranslate}}\r\n </th>\r\n <td class=\"px-5\" mat-cell *matCellDef=\"let item;\">\r\n <span *ngIf=\"isCreatingColumn\">{{item.title || item?.origin?.title}}</span>\r\n </td>\r\n </ng-container>\r\n <tr mat-header-row *matHeaderRowDef=\"['stt', 'title']; sticky: true\"></tr>\r\n <tr mat-row *matRowDef=\"let row; columns: ['stt', 'title'];\"></tr>\r\n </table>\r\n </div>\r\n </div>\r\n </sd-modal-body>\r\n <sd-modal-footer>\r\n <ng-container *ngIf=\"!isCreatingColumn\">\r\n <!-- <sd-button class=\"mr-auto\" (action)=\"createColumn()\" [title]=\"'Create column' | sdTranslate\" color=\"info\"\r\n size=\"sm\">\r\n </sd-button> -->\r\n <sd-button class=\"mr-5\" (action)=\"onReset()\" [title]=\"'Default' | sdTranslate\" color=\"info\" size=\"sm\">\r\n </sd-button>\r\n <sd-button (action)=\"onSave()\" [title]=\"'Save' | sdTranslate\" type=\"fill\" color=\"info\" size=\"sm\">\r\n </sd-button>\r\n </ng-container>\r\n <ng-container *ngIf=\"isCreatingColumn\">\r\n <sd-button class=\"mr-auto\" (action)=\"isCreatingColumn = false\" [title]=\"'Cancel' | sdTranslate\" color=\"info\"\r\n size=\"sm\">\r\n </sd-button>\r\n <sd-button (action)=\"confirm()\" [title]=\"'Confirm' | sdTranslate\" type=\"fill\" color=\"info\" size=\"sm\">\r\n </sd-button>\r\n </ng-container>\r\n </sd-modal-footer>\r\n</sd-modal>",
|
|
2240
|
+
styles: [".c-table{overflow:auto;position:relative}.c-table table{width:100%}.c-table .c-th{color:#000;font-size:14px;font-weight:500;line-height:20px}.c-container{min-height:200px;position:relative}.c-handle{color:#ccc;cursor:move}"]
|
|
2225
2241
|
},] }
|
|
2226
2242
|
];
|
|
2227
2243
|
SdPopupGridConfiguration.ctorParameters = () => [
|
|
@@ -2233,7 +2249,9 @@ SdPopupGridConfiguration.ctorParameters = () => [
|
|
|
2233
2249
|
SdPopupGridConfiguration.propDecorators = {
|
|
2234
2250
|
gridOption: [{ type: Input }],
|
|
2235
2251
|
key: [{ type: Input }],
|
|
2236
|
-
modal: [{ type: ViewChild, args: ['modal',] }]
|
|
2252
|
+
modal: [{ type: ViewChild, args: ['modal',] }],
|
|
2253
|
+
table: [{ type: ViewChild, args: ['table',] }],
|
|
2254
|
+
mouseUp: [{ type: HostListener, args: ['window:mouseup', ['$event'],] }]
|
|
2237
2255
|
};
|
|
2238
2256
|
|
|
2239
2257
|
class SdColumnTooltipPipe {
|
|
@@ -2385,6 +2403,147 @@ SdSelectionDisableSelectAllPipe.decorators = [
|
|
|
2385
2403
|
},] }
|
|
2386
2404
|
];
|
|
2387
2405
|
|
|
2406
|
+
var _cache$3;
|
|
2407
|
+
class SdGeneratedColumnService {
|
|
2408
|
+
constructor(settingService) {
|
|
2409
|
+
this.settingService = settingService;
|
|
2410
|
+
_cache$3.set(this, {});
|
|
2411
|
+
this.load = (configuration) => {
|
|
2412
|
+
if (!(configuration === null || configuration === void 0 ? void 0 : configuration.key)) {
|
|
2413
|
+
return null;
|
|
2414
|
+
}
|
|
2415
|
+
const key = hash({
|
|
2416
|
+
prefix: '260f5e94-5865-4425-8ced-b9c083c390dd',
|
|
2417
|
+
key: configuration.key
|
|
2418
|
+
});
|
|
2419
|
+
if (!__classPrivateFieldGet(this, _cache$3)[key]) {
|
|
2420
|
+
__classPrivateFieldGet(this, _cache$3)[key] = this.settingService.create(key, {
|
|
2421
|
+
type: configuration === null || configuration === void 0 ? void 0 : configuration.storage,
|
|
2422
|
+
args: configuration === null || configuration === void 0 ? void 0 : configuration.args,
|
|
2423
|
+
default: []
|
|
2424
|
+
});
|
|
2425
|
+
}
|
|
2426
|
+
return __classPrivateFieldGet(this, _cache$3)[key];
|
|
2427
|
+
};
|
|
2428
|
+
this.loadSystem = (configuration) => {
|
|
2429
|
+
var _a;
|
|
2430
|
+
if (!(configuration === null || configuration === void 0 ? void 0 : configuration.key)) {
|
|
2431
|
+
return null;
|
|
2432
|
+
}
|
|
2433
|
+
if (!(configuration === null || configuration === void 0 ? void 0 : configuration.systemColumn)) {
|
|
2434
|
+
return null;
|
|
2435
|
+
}
|
|
2436
|
+
const key = hash({
|
|
2437
|
+
prefix: '8b8050ca-1f44-4860-bad3-20e646c0d68f',
|
|
2438
|
+
key: configuration.key
|
|
2439
|
+
});
|
|
2440
|
+
if (!__classPrivateFieldGet(this, _cache$3)[key]) {
|
|
2441
|
+
__classPrivateFieldGet(this, _cache$3)[key] = this.settingService.create(key, {
|
|
2442
|
+
type: 'server',
|
|
2443
|
+
args: (_a = configuration === null || configuration === void 0 ? void 0 : configuration.systemColumn) === null || _a === void 0 ? void 0 : _a.args,
|
|
2444
|
+
default: []
|
|
2445
|
+
});
|
|
2446
|
+
}
|
|
2447
|
+
return __classPrivateFieldGet(this, _cache$3)[key];
|
|
2448
|
+
};
|
|
2449
|
+
}
|
|
2450
|
+
}
|
|
2451
|
+
_cache$3 = new WeakMap();
|
|
2452
|
+
SdGeneratedColumnService.decorators = [
|
|
2453
|
+
{ type: Injectable }
|
|
2454
|
+
];
|
|
2455
|
+
SdGeneratedColumnService.ctorParameters = () => [
|
|
2456
|
+
{ type: SdSettingService }
|
|
2457
|
+
];
|
|
2458
|
+
|
|
2459
|
+
var _subscription$2;
|
|
2460
|
+
class SdDynamicColumn {
|
|
2461
|
+
constructor(ref, generatedColumnService, notifyService, translateService, gridConfigurationService) {
|
|
2462
|
+
this.ref = ref;
|
|
2463
|
+
this.generatedColumnService = generatedColumnService;
|
|
2464
|
+
this.notifyService = notifyService;
|
|
2465
|
+
this.translateService = translateService;
|
|
2466
|
+
this.gridConfigurationService = gridConfigurationService;
|
|
2467
|
+
_subscription$2.set(this, new Subscription());
|
|
2468
|
+
this.columnTypes = ['string', 'number', 'bool', 'date', 'datetime', 'time', 'values', 'children', 'children-col'];
|
|
2469
|
+
this.form = new FormGroup({});
|
|
2470
|
+
this.isDetail = false;
|
|
2471
|
+
this.originColumns = [];
|
|
2472
|
+
this.onDetail = (column) => {
|
|
2473
|
+
this.detail = column || {
|
|
2474
|
+
field: v4(),
|
|
2475
|
+
title: '',
|
|
2476
|
+
type: 'string',
|
|
2477
|
+
isSystem: false,
|
|
2478
|
+
useTemplate: false
|
|
2479
|
+
};
|
|
2480
|
+
this.form.markAsUntouched();
|
|
2481
|
+
this.form.markAsPristine();
|
|
2482
|
+
this.isDetail = true;
|
|
2483
|
+
};
|
|
2484
|
+
this.onSave = () => {
|
|
2485
|
+
var _a;
|
|
2486
|
+
const systemSetting = this.generatedColumnService.loadSystem(this.gridOption.config);
|
|
2487
|
+
const setting = this.generatedColumnService.load((_a = this.gridOption) === null || _a === void 0 ? void 0 : _a.config);
|
|
2488
|
+
if (this.detail.isSystem) {
|
|
2489
|
+
if (!this.detail.id) {
|
|
2490
|
+
systemSetting.set([...this.systemColumns, Object.assign(Object.assign({}, this.detail), { id: v4() })]);
|
|
2491
|
+
}
|
|
2492
|
+
else {
|
|
2493
|
+
systemSetting.set([...this.systemColumns]);
|
|
2494
|
+
}
|
|
2495
|
+
}
|
|
2496
|
+
else {
|
|
2497
|
+
if (!this.detail.id) {
|
|
2498
|
+
setting.set([...this.columns, Object.assign(Object.assign({}, this.detail), { id: v4() })]);
|
|
2499
|
+
}
|
|
2500
|
+
else {
|
|
2501
|
+
setting.set([...this.columns]);
|
|
2502
|
+
}
|
|
2503
|
+
}
|
|
2504
|
+
};
|
|
2505
|
+
}
|
|
2506
|
+
ngOnInit() {
|
|
2507
|
+
var _a, _b, _c;
|
|
2508
|
+
const systemSetting = this.generatedColumnService.loadSystem(this.gridOption.config);
|
|
2509
|
+
const setting = this.generatedColumnService.load((_a = this.gridOption) === null || _a === void 0 ? void 0 : _a.config);
|
|
2510
|
+
if (systemSetting) {
|
|
2511
|
+
(_b = __classPrivateFieldGet(this, _subscription$2)) === null || _b === void 0 ? void 0 : _b.add(systemSetting.observer.subscribe(columns => {
|
|
2512
|
+
this.systemColumns = columns;
|
|
2513
|
+
}));
|
|
2514
|
+
}
|
|
2515
|
+
if (setting) {
|
|
2516
|
+
(_c = __classPrivateFieldGet(this, _subscription$2)) === null || _c === void 0 ? void 0 : _c.add(setting.observer.subscribe(columns => {
|
|
2517
|
+
this.columns = columns;
|
|
2518
|
+
}));
|
|
2519
|
+
}
|
|
2520
|
+
this.originColumns = this.gridOption.columns.filter(e => e.type !== 'children' && e.type !== 'children-col');
|
|
2521
|
+
}
|
|
2522
|
+
ngOnDestroy() {
|
|
2523
|
+
__classPrivateFieldGet(this, _subscription$2).unsubscribe();
|
|
2524
|
+
}
|
|
2525
|
+
}
|
|
2526
|
+
_subscription$2 = new WeakMap();
|
|
2527
|
+
SdDynamicColumn.decorators = [
|
|
2528
|
+
{ type: Component, args: [{
|
|
2529
|
+
selector: 'sd-dynamic-column',
|
|
2530
|
+
template: "<sd-side-drawer width=\"400px\">\r\n <div sdTitle>{{'Manage dynamic column' | sdTranslate}}</div>\r\n <ng-container sdBody>\r\n <ng-container *ngIf=\"!isDetail\">\r\n <ng-container *ngIf=\"systemColumns\">\r\n <div *ngFor=\"let column of systemColumns\" (click)=\"onDetail(column)\">\r\n {{column.title}}\r\n </div>\r\n </ng-container>\r\n <ng-container *ngIf=\"columns\">\r\n <div *ngFor=\"let column of columns\" (click)=\"onDetail(column)\">\r\n {{column.title}}\r\n </div>\r\n </ng-container>\r\n </ng-container>\r\n <ng-container *ngIf=\"isDetail\">\r\n <sd-select [form]=\"form\" [label]=\"'Apply for' | sdTranslate\" [(model)]=\"detail.isSystem\"\r\n [items]=\"[{code: true, name: 'All users'},{code: false, name: 'Only me'}]\" [disabled]=\"!!detail.id\" required></sd-select>\r\n <sd-input [form]=\"form\" [label]=\"'Column field' | sdTranslate\" [(model)]=\"detail.field\" [disabled]=\"!!detail.id\"\r\n required></sd-input>\r\n <sd-input [form]=\"form\" [label]=\"'Column title' | sdTranslate\" [(model)]=\"detail.title\" required></sd-input>\r\n <sd-input [form]=\"form\" [label]=\"'Column width' | sdTranslate\" [(model)]=\"detail.width\" type=\"number\" required>\r\n <ng-template sdInputSuffix>px</ng-template>\r\n </sd-input>\r\n <sd-select [form]=\"form\" [label]=\"'Column type' | sdTranslate\" [(model)]=\"detail.type\" [items]=\"columnTypes\"\r\n [disabled]=\"!!detail.id\" required></sd-select>\r\n <sd-select *ngIf=\"detail.type === 'children' || detail.type === 'children-col'\" [form]=\"form\"\r\n [label]=\"'Column fields' | sdTranslate\" [(model)]=\"detail.fields\" [items]=\"originColumns\" valueField=\"field\"\r\n displayField=\"title\" multiple></sd-select>\r\n <sd-select [form]=\"form\" [label]=\"'Use template' | sdTranslate\" [(model)]=\"detail.useTemplate\"\r\n [items]=\"[{code: true, name: 'Yes'},{code: false, name: 'No'}]\" required></sd-select>\r\n <sd-editor *ngIf=\"detail.useTemplate\" [form]=\"form\" [label]=\"'Html template' | sdTranslate\" [(model)]=\"detail.template\">\r\n </sd-editor>\r\n </ng-container>\r\n </ng-container>\r\n <div class=\"d-flex align-items-center justify-content-end\" sdFooter>\r\n <sd-button [title]=\"'Close' | sdTranslate\" (action)=\"sideDrawer.close()\"> </sd-button>\r\n <sd-button *ngIf=\"!isDetail\" [title]=\"'Create column' | sdTranslate\" color=\"primary\" class=\"mx-8\"\r\n (action)=\"onDetail()\">\r\n </sd-button>\r\n <sd-button *ngIf=\"isDetail\" [title]=\"'Save' | sdTranslate\" color=\"success\" class=\"mx-8\" (action)=\"onSave()\">\r\n </sd-button>\r\n </div>\r\n</sd-side-drawer>",
|
|
2531
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
2532
|
+
styles: [".c-table{overflow:auto;position:relative}.c-table table{width:100%}.c-table .c-th{color:#000;font-size:14px;font-weight:500;line-height:20px}.c-container{min-height:200px;position:relative}.c-handle{color:#ccc;cursor:move}"]
|
|
2533
|
+
},] }
|
|
2534
|
+
];
|
|
2535
|
+
SdDynamicColumn.ctorParameters = () => [
|
|
2536
|
+
{ type: ChangeDetectorRef },
|
|
2537
|
+
{ type: SdGeneratedColumnService },
|
|
2538
|
+
{ type: SdNotifyService },
|
|
2539
|
+
{ type: SdTranslateService },
|
|
2540
|
+
{ type: SdGridConfigurationService }
|
|
2541
|
+
];
|
|
2542
|
+
SdDynamicColumn.propDecorators = {
|
|
2543
|
+
sideDrawer: [{ type: ViewChild, args: [SdSideDrawer,] }],
|
|
2544
|
+
gridOption: [{ type: Input }]
|
|
2545
|
+
};
|
|
2546
|
+
|
|
2388
2547
|
class MatPaginatorIntlCro extends MatPaginatorIntl {
|
|
2389
2548
|
constructor() {
|
|
2390
2549
|
super(...arguments);
|
|
@@ -2433,7 +2592,8 @@ SdGridMaterialModule.decorators = [
|
|
|
2433
2592
|
CdkTableModule,
|
|
2434
2593
|
DragDropModule,
|
|
2435
2594
|
SdFormModule,
|
|
2436
|
-
SdServiceModule
|
|
2595
|
+
SdServiceModule,
|
|
2596
|
+
MatSliderModule
|
|
2437
2597
|
],
|
|
2438
2598
|
declarations: [
|
|
2439
2599
|
SdDesktopCellView,
|
|
@@ -2450,6 +2610,7 @@ SdGridMaterialModule.decorators = [
|
|
|
2450
2610
|
SdPopupGridConfiguration,
|
|
2451
2611
|
SdGridFilter,
|
|
2452
2612
|
SdPopupFilter,
|
|
2613
|
+
SdDynamicColumn,
|
|
2453
2614
|
// Pipes
|
|
2454
2615
|
SdGridConfigurationResultPipe,
|
|
2455
2616
|
SdColumnChildrenFilterPipe,
|
|
@@ -2484,6 +2645,7 @@ SdGridMaterialModule.decorators = [
|
|
|
2484
2645
|
SdGridService,
|
|
2485
2646
|
SdGridFilterService,
|
|
2486
2647
|
SdGridConfigurationService,
|
|
2648
|
+
SdGeneratedColumnService,
|
|
2487
2649
|
{
|
|
2488
2650
|
provide: MatPaginatorIntl, useClass: MatPaginatorIntlCro
|
|
2489
2651
|
}
|
|
@@ -2499,5 +2661,5 @@ SdGridMaterialModule.decorators = [
|
|
|
2499
2661
|
* Generated bundle index. Do not edit.
|
|
2500
2662
|
*/
|
|
2501
2663
|
|
|
2502
|
-
export { SdGridMaterial, SdGridMaterialModule, SdMaterialCellDefDirective, SdMaterialEmptyDataDefDirective, SdMaterialFilterDefDirective, SdMaterialFooterDefDirective, SdMaterialSubInformationDefDirective, MatPaginatorIntlCro as ɵa, SdGridFilter as ɵb,
|
|
2664
|
+
export { SdGridMaterial, SdGridMaterialModule, SdMaterialCellDefDirective, SdMaterialEmptyDataDefDirective, SdMaterialFilterDefDirective, SdMaterialFooterDefDirective, SdMaterialSubInformationDefDirective, MatPaginatorIntlCro as ɵa, SdGridFilter as ɵb, SdColumnTooltipPipe as ɵba, SdColumnBadgePipe as ɵbb, SdFilterColumnPipe as ɵbc, SdFilterExternalPipe as ɵbd, SdSelectionActionFilterPipe as ɵbe, SdSelectionDisablePipe as ɵbf, SdSelectionDisableSelectAllPipe as ɵbg, SdPopupFilter as ɵc, SdGridFilterService as ɵd, SdPopupExport as ɵe, GRID_MATERIAL_CONFIG as ɵg, SdGridConfigurationService as ɵh, SdGridService as ɵi, SdDesktopCellView as ɵj, SdDesktopCellChildrenView as ɵk, SdDesktopCommand as ɵl, SdLetDirective as ɵm, SdPopupGridConfiguration as ɵn, SdDynamicColumn as ɵo, SdGeneratedColumnService as ɵp, SdGridConfigurationResultPipe as ɵq, SdColumnChildrenFilterPipe as ɵr, SdColumnTitlePipe as ɵs, SdCommandFilterPipe as ɵt, SdCommandDisablePipe as ɵu, SdCommandIconPipe as ɵv, SdCommandTitlePipe as ɵw, SdColumnValuesPipe as ɵx, SdColumnHtmlTemplatePipe as ɵy, SdColumnTransformPipe as ɵz };
|
|
2503
2665
|
//# sourceMappingURL=sd-angular-core-grid-material.js.map
|