@sd-angular/core 1.0.43 → 1.0.46
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/assets/scss/core/toastr.scss +1 -0
- package/bundles/sd-angular-core-autocomplete.umd.js +2 -0
- package/bundles/sd-angular-core-autocomplete.umd.js.map +1 -1
- package/bundles/sd-angular-core-autocomplete.umd.min.js.map +1 -1
- package/bundles/sd-angular-core-grid-material.umd.js +380 -293
- 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-notify.umd.js +15 -6
- package/bundles/sd-angular-core-notify.umd.js.map +1 -1
- package/bundles/sd-angular-core-notify.umd.min.js +2 -2
- package/bundles/sd-angular-core-notify.umd.min.js.map +1 -1
- package/bundles/sd-angular-core-popover.umd.js +704 -0
- package/bundles/sd-angular-core-popover.umd.js.map +1 -0
- package/bundles/sd-angular-core-popover.umd.min.js +16 -0
- package/bundles/sd-angular-core-popover.umd.min.js.map +1 -0
- package/bundles/sd-angular-core.umd.js +12 -4
- package/bundles/sd-angular-core.umd.js.map +1 -1
- package/bundles/sd-angular-core.umd.min.js +1 -1
- package/bundles/sd-angular-core.umd.min.js.map +1 -1
- package/esm2015/autocomplete/src/lib/autocomplete.component.js +3 -1
- package/esm2015/grid-material/sd-angular-core-grid-material.js +5 -5
- package/esm2015/grid-material/src/lib/components/desktop-cell-children-view/desktop-cell-children-view.component.js +2 -2
- package/esm2015/grid-material/src/lib/grid-material.component.js +21 -22
- package/esm2015/grid-material/src/lib/grid-material.module.js +2 -1
- package/esm2015/grid-material/src/lib/models/grid-column.model.js +1 -1
- package/esm2015/grid-material/src/lib/models/grid.model.js +1 -1
- package/esm2015/grid-material/src/lib/pipes/cell-view.pipe.js +8 -9
- package/esm2015/grid-material/src/lib/pipes/column-badge.pipe.js +1 -1
- package/esm2015/grid-material/src/lib/pipes/column-values.pipe.js +34 -12
- package/esm2015/grid-material/src/lib/services/grid.service.js +2 -2
- package/esm2015/notify/src/lib/notify.service.js +18 -9
- package/esm2015/popover/index.js +2 -0
- package/esm2015/popover/sd-angular-core-popover.js +5 -0
- package/esm2015/popover/src/lib/directives/popover-trigger.directive.js +218 -0
- package/esm2015/popover/src/lib/popover/popover.component.js +122 -0
- package/esm2015/popover/src/lib/popover.model.js +2 -0
- package/esm2015/popover/src/lib/popover.module.js +24 -0
- package/esm2015/popover/src/public-api.js +7 -0
- package/esm2015/public-api.js +2 -1
- package/fesm2015/sd-angular-core-autocomplete.js +2 -0
- package/fesm2015/sd-angular-core-autocomplete.js.map +1 -1
- package/fesm2015/sd-angular-core-grid-material.js +154 -132
- package/fesm2015/sd-angular-core-grid-material.js.map +1 -1
- package/fesm2015/sd-angular-core-notify.js +17 -8
- package/fesm2015/sd-angular-core-notify.js.map +1 -1
- package/fesm2015/sd-angular-core-popover.js +369 -0
- package/fesm2015/sd-angular-core-popover.js.map +1 -0
- package/fesm2015/sd-angular-core.js +1 -0
- package/fesm2015/sd-angular-core.js.map +1 -1
- package/grid-material/sd-angular-core-grid-material.d.ts +4 -4
- package/grid-material/sd-angular-core-grid-material.metadata.json +1 -1
- package/grid-material/src/lib/grid-material.component.d.ts +4 -3
- package/grid-material/src/lib/models/grid-column.model.d.ts +2 -2
- package/grid-material/src/lib/pipes/cell-view.pipe.d.ts +3 -3
- package/grid-material/src/lib/pipes/column-values.pipe.d.ts +2 -4
- package/package.json +1 -1
- package/popover/index.d.ts +1 -0
- package/popover/package.json +12 -0
- package/popover/sd-angular-core-popover.d.ts +4 -0
- package/popover/sd-angular-core-popover.metadata.json +1 -0
- package/popover/src/lib/directives/popover-trigger.directive.d.ts +25 -0
- package/popover/src/lib/popover/popover.component.d.ts +34 -0
- package/popover/src/lib/popover.model.d.ts +1 -0
- package/popover/src/lib/popover.module.d.ts +2 -0
- package/popover/src/public-api.d.ts +3 -0
- package/public-api.d.ts +1 -0
- package/{sd-angular-core-1.0.43.tgz → sd-angular-core-1.0.46.tgz} +0 -0
- package/sd-angular-core.metadata.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { SdCommonModule } from '@sd-angular/core/common';
|
|
2
|
-
import { Directive, TemplateRef, Input, InjectionToken, EventEmitter, Component, ViewChild, Output, Injectable, ChangeDetectorRef, Inject, Optional, QueryList, ContentChild, ContentChildren,
|
|
2
|
+
import { Directive, TemplateRef, Input, InjectionToken, EventEmitter, Component, ViewChild, Output, Injectable, ChangeDetectorRef, Inject, Optional, Pipe, QueryList, ContentChild, ContentChildren, ChangeDetectionStrategy, HostListener, NgModule } from '@angular/core';
|
|
3
3
|
import { __awaiter, __classPrivateFieldGet, __rest, __classPrivateFieldSet } from 'tslib';
|
|
4
4
|
import { MatPaginator, MatPaginatorIntl, MatPaginatorModule } from '@angular/material/paginator';
|
|
5
5
|
import { MatSort, MatSortModule } from '@angular/material/sort';
|
|
@@ -10,14 +10,14 @@ import { Subject, Subscription, isObservable } from 'rxjs';
|
|
|
10
10
|
import { SdNotifyService } from '@sd-angular/core/notify';
|
|
11
11
|
import { moveItemInArray, DragDropModule } from '@angular/cdk/drag-drop';
|
|
12
12
|
import { startWith, debounceTime, map, switchMap } from 'rxjs/operators';
|
|
13
|
-
import hash from 'object-hash';
|
|
13
|
+
import * as hash from 'object-hash';
|
|
14
|
+
import hash__default from 'object-hash';
|
|
14
15
|
import { SdSettingService } from '@sd-angular/core/setting';
|
|
15
16
|
import { DeviceDetectorService } from 'ngx-device-detector';
|
|
16
17
|
import { SdLoadingService } from '@sd-angular/core/loading';
|
|
17
18
|
import { SdTranslateService } from '@sd-angular/core/translate';
|
|
18
19
|
import { SdExportService } from '@sd-angular/core/export';
|
|
19
20
|
import { FormGroup, FormsModule, ReactiveFormsModule } from '@angular/forms';
|
|
20
|
-
import { SdUtilityService } from '@sd-angular/core/utility';
|
|
21
21
|
import { SdQuickAction } from '@sd-angular/core/quick-action';
|
|
22
22
|
import { CommonModule, DatePipe, DecimalPipe } from '@angular/common';
|
|
23
23
|
import { MatFormFieldModule } from '@angular/material/form-field';
|
|
@@ -30,6 +30,7 @@ import { ScrollingModule } from '@angular/cdk/scrolling';
|
|
|
30
30
|
import { MatMenuModule } from '@angular/material/menu';
|
|
31
31
|
import { MatSliderModule } from '@angular/material/slider';
|
|
32
32
|
import { MatButtonModule } from '@angular/material/button';
|
|
33
|
+
import { SdUtilityService } from '@sd-angular/core/utility';
|
|
33
34
|
import { SdServiceModule } from '@sd-angular/core/service';
|
|
34
35
|
import { MatTooltipModule } from '@angular/material/tooltip';
|
|
35
36
|
import { MatChipsModule } from '@angular/material/chips';
|
|
@@ -236,7 +237,7 @@ class SdGridFilterService {
|
|
|
236
237
|
prefix: __classPrivateFieldGet(this, _prefix),
|
|
237
238
|
key
|
|
238
239
|
});
|
|
239
|
-
key =
|
|
240
|
+
key = hash__default({
|
|
240
241
|
prefix: __classPrivateFieldGet(this, _prefix),
|
|
241
242
|
key
|
|
242
243
|
});
|
|
@@ -692,7 +693,7 @@ class SdPopupExport {
|
|
|
692
693
|
if (!((_b = (_a = this.gridOption) === null || _a === void 0 ? void 0 : _a.export) === null || _b === void 0 ? void 0 : _b.key)) {
|
|
693
694
|
return null;
|
|
694
695
|
}
|
|
695
|
-
return
|
|
696
|
+
return hash__default({
|
|
696
697
|
prefix,
|
|
697
698
|
key: (_d = (_c = this.gridOption) === null || _c === void 0 ? void 0 : _c.export) === null || _d === void 0 ? void 0 : _d.key
|
|
698
699
|
});
|
|
@@ -763,7 +764,7 @@ class SdGridConfigurationService {
|
|
|
763
764
|
if (!((_a = gridOption === null || gridOption === void 0 ? void 0 : gridOption.config) === null || _a === void 0 ? void 0 : _a.key) && !(gridOption === null || gridOption === void 0 ? void 0 : gridOption.key)) {
|
|
764
765
|
return null;
|
|
765
766
|
}
|
|
766
|
-
return
|
|
767
|
+
return hash__default({
|
|
767
768
|
prefix,
|
|
768
769
|
key: ((_b = gridOption === null || gridOption === void 0 ? void 0 : gridOption.config) === null || _b === void 0 ? void 0 : _b.key) || !(gridOption === null || gridOption === void 0 ? void 0 : gridOption.key)
|
|
769
770
|
});
|
|
@@ -1100,71 +1101,57 @@ SdGridConfigurationService.ctorParameters = () => [
|
|
|
1100
1101
|
{ type: undefined, decorators: [{ type: Inject, args: [GRID_MATERIAL_CONFIG,] }, { type: Optional }] }
|
|
1101
1102
|
];
|
|
1102
1103
|
|
|
1103
|
-
var
|
|
1104
|
-
class
|
|
1105
|
-
constructor(
|
|
1106
|
-
this.utilityService = utilityService;
|
|
1107
|
-
_prefix$1.set(this, 'a1e67660-8aa2-4c11-b02d-71a32188719f');
|
|
1104
|
+
var _cache$1;
|
|
1105
|
+
class SdColumnValuesPipe {
|
|
1106
|
+
constructor() {
|
|
1108
1107
|
_cache$1.set(this, {});
|
|
1109
|
-
this.
|
|
1110
|
-
var _a, _b, _c, _d;
|
|
1108
|
+
this.transform = (value, column) => __awaiter(this, void 0, void 0, function* () {
|
|
1109
|
+
var _a, _b, _c, _d, _e;
|
|
1111
1110
|
if (column.type !== 'values' || !((_a = column.option) === null || _a === void 0 ? void 0 : _a.items) || !((_b = column.option) === null || _b === void 0 ? void 0 : _b.valueField) || !((_c = column.option) === null || _c === void 0 ? void 0 : _c.displayField)) {
|
|
1112
|
-
return
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
if (typeof ((_d = column.option) === null || _d === void 0 ? void 0 : _d.items) === 'function') {
|
|
1125
|
-
items = yield column.option.items();
|
|
1111
|
+
return value;
|
|
1112
|
+
}
|
|
1113
|
+
const { items, valueField, displayField } = column.option;
|
|
1114
|
+
let key;
|
|
1115
|
+
if (typeof (items) === 'function') {
|
|
1116
|
+
key = hash(Object.assign(Object.assign({}, column), { value }));
|
|
1117
|
+
if (!__classPrivateFieldGet(this, _cache$1)[key]) {
|
|
1118
|
+
const values = yield items(value, true);
|
|
1119
|
+
__classPrivateFieldGet(this, _cache$1)[key] = {
|
|
1120
|
+
items: values,
|
|
1121
|
+
obj: Array.toObject(values, valueField)
|
|
1122
|
+
};
|
|
1126
1123
|
}
|
|
1127
|
-
|
|
1128
|
-
|
|
1124
|
+
}
|
|
1125
|
+
else {
|
|
1126
|
+
key = hash(Object.assign({}, column));
|
|
1127
|
+
if (!__classPrivateFieldGet(this, _cache$1)[key]) {
|
|
1128
|
+
__classPrivateFieldGet(this, _cache$1)[key] = {
|
|
1129
|
+
items: items || [],
|
|
1130
|
+
obj: Array.toObject(items, valueField)
|
|
1131
|
+
};
|
|
1129
1132
|
}
|
|
1130
|
-
__classPrivateFieldGet(this, _cache$1)[hashKey] = {
|
|
1131
|
-
values: items,
|
|
1132
|
-
obj: this.utilityService.arrayToObject(items, column.option.valueField)
|
|
1133
|
-
};
|
|
1134
1133
|
}
|
|
1135
|
-
return __classPrivateFieldGet(this, _cache$1)[
|
|
1134
|
+
return (_e = (_d = __classPrivateFieldGet(this, _cache$1)[key].obj[valueField]) === null || _d === void 0 ? void 0 : _d[displayField]) !== null && _e !== void 0 ? _e : value;
|
|
1136
1135
|
});
|
|
1137
|
-
this.getValues = (column, key) => {
|
|
1138
|
-
const hashKey = hash({
|
|
1139
|
-
prefix: __classPrivateFieldGet(this, _prefix$1),
|
|
1140
|
-
field: column.field,
|
|
1141
|
-
key,
|
|
1142
|
-
});
|
|
1143
|
-
return __classPrivateFieldGet(this, _cache$1)[hashKey] || {
|
|
1144
|
-
values: [],
|
|
1145
|
-
obj: {}
|
|
1146
|
-
};
|
|
1147
|
-
};
|
|
1148
1136
|
}
|
|
1149
1137
|
}
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
{ type:
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
{ type: SdUtilityService }
|
|
1138
|
+
_cache$1 = new WeakMap();
|
|
1139
|
+
SdColumnValuesPipe.decorators = [
|
|
1140
|
+
{ type: Pipe, args: [{
|
|
1141
|
+
name: 'columnValues'
|
|
1142
|
+
},] }
|
|
1156
1143
|
];
|
|
1157
1144
|
|
|
1158
1145
|
var _paginator, _sort, _subscription$1, _optionChanges, _initCellDef, _initFilterDef, _initFooterDef, _filterExportInfo, _initConfiguration, _filterLocal, _getFilter, _load$1, _render, _exportedItems, _allColumns, _allExportedColumns, _onExport, _updateSelectedItems;
|
|
1159
1146
|
class SdGridMaterial {
|
|
1160
|
-
constructor(ref, configuration, gridConfigurationService, exportService, notifyService, translateService,
|
|
1147
|
+
constructor(ref, configuration, gridConfigurationService, exportService, notifyService, translateService, columnValuesPipe) {
|
|
1161
1148
|
this.ref = ref;
|
|
1162
1149
|
this.configuration = configuration;
|
|
1163
1150
|
this.gridConfigurationService = gridConfigurationService;
|
|
1164
1151
|
this.exportService = exportService;
|
|
1165
1152
|
this.notifyService = notifyService;
|
|
1166
1153
|
this.translateService = translateService;
|
|
1167
|
-
this.
|
|
1154
|
+
this.columnValuesPipe = columnValuesPipe;
|
|
1168
1155
|
this.key = v4();
|
|
1169
1156
|
this.localItems = [];
|
|
1170
1157
|
this.items = [];
|
|
@@ -1522,8 +1509,8 @@ class SdGridMaterial {
|
|
|
1522
1509
|
const allExportedColumns = __classPrivateFieldGet(this, _allExportedColumns).call(this);
|
|
1523
1510
|
for (const item of exportItems) {
|
|
1524
1511
|
const obj = {};
|
|
1525
|
-
const handle = (exportColumn) => {
|
|
1526
|
-
var
|
|
1512
|
+
const handle = (exportColumn) => __awaiter(this, void 0, void 0, function* () {
|
|
1513
|
+
var _q, _r;
|
|
1527
1514
|
obj[exportColumn.field] = item[exportColumn.field];
|
|
1528
1515
|
const column = allColumns.find(e => e.field === exportColumn.field);
|
|
1529
1516
|
const exportedColumn = allExportedColumns.find(e => e.field === exportColumn.field);
|
|
@@ -1554,10 +1541,10 @@ class SdGridMaterial {
|
|
|
1554
1541
|
else if (column.type === 'bool') {
|
|
1555
1542
|
// Nếu là bool thì gán bằng giá trị trueValue và falseValue (nếu có), mặc định là TRUE/FALSE
|
|
1556
1543
|
if (item[column.field]) {
|
|
1557
|
-
obj[column.field] = ((
|
|
1544
|
+
obj[column.field] = ((_q = column.option) === null || _q === void 0 ? void 0 : _q.displayOnTrue) || 'True';
|
|
1558
1545
|
}
|
|
1559
1546
|
else {
|
|
1560
|
-
obj[column.field] = ((
|
|
1547
|
+
obj[column.field] = ((_r = column.option) === null || _r === void 0 ? void 0 : _r.displayOnFalse) || 'False';
|
|
1561
1548
|
}
|
|
1562
1549
|
}
|
|
1563
1550
|
else if (column.type === 'date') {
|
|
@@ -1577,20 +1564,16 @@ class SdGridMaterial {
|
|
|
1577
1564
|
}
|
|
1578
1565
|
else if (column.type === 'values') {
|
|
1579
1566
|
// Nếu là values thì lấy giá trị của value được chọn
|
|
1580
|
-
|
|
1581
|
-
if (data.obj[column.option.displayField] !== null && data.obj[column.option.displayField] !== undefined) {
|
|
1582
|
-
obj[column.field] = data.obj[column.option.displayField];
|
|
1583
|
-
}
|
|
1584
|
-
else {
|
|
1585
|
-
obj[column.field] = item[column.field];
|
|
1586
|
-
}
|
|
1567
|
+
obj[column.field] = yield this.columnValuesPipe.transform(item[column.field], column);
|
|
1587
1568
|
}
|
|
1588
1569
|
else {
|
|
1589
1570
|
obj[column.field] = item[column.field];
|
|
1590
1571
|
}
|
|
1591
|
-
};
|
|
1572
|
+
});
|
|
1592
1573
|
// this.gridOption.columns.forEach(handle);
|
|
1593
|
-
columns
|
|
1574
|
+
for (const exportColumn of columns) {
|
|
1575
|
+
yield handle(exportColumn);
|
|
1576
|
+
}
|
|
1594
1577
|
items.push(obj);
|
|
1595
1578
|
}
|
|
1596
1579
|
pageNumber++;
|
|
@@ -1662,7 +1645,7 @@ class SdGridMaterial {
|
|
|
1662
1645
|
this.reload(false);
|
|
1663
1646
|
};
|
|
1664
1647
|
this.onExpand = (rowData) => __awaiter(this, void 0, void 0, function* () {
|
|
1665
|
-
var
|
|
1648
|
+
var _s, _t, _u;
|
|
1666
1649
|
if (rowData.isExpanding) {
|
|
1667
1650
|
return;
|
|
1668
1651
|
}
|
|
@@ -1670,8 +1653,8 @@ class SdGridMaterial {
|
|
|
1670
1653
|
rowData.isExpanded = false;
|
|
1671
1654
|
return;
|
|
1672
1655
|
}
|
|
1673
|
-
const data = (
|
|
1674
|
-
if (!((
|
|
1656
|
+
const data = (_t = (_s = this.gridOption) === null || _s === void 0 ? void 0 : _s.subInformation) === null || _t === void 0 ? void 0 : _t.onExpand(rowData);
|
|
1657
|
+
if (!((_u = this.gridOption.subInformation) === null || _u === void 0 ? void 0 : _u.multiple)) {
|
|
1675
1658
|
this.items.forEach(item => item.isExpanding = item.isExpanded = false);
|
|
1676
1659
|
}
|
|
1677
1660
|
if (data instanceof Promise) {
|
|
@@ -1981,12 +1964,15 @@ class SdGridMaterial {
|
|
|
1981
1964
|
return result;
|
|
1982
1965
|
});
|
|
1983
1966
|
}
|
|
1967
|
+
get isEditing() {
|
|
1968
|
+
return this.items.some(e => e.editorStatus !== undefined);
|
|
1969
|
+
}
|
|
1984
1970
|
}
|
|
1985
1971
|
_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$1 = new WeakMap(), _render = new WeakMap(), _exportedItems = new WeakMap(), _allColumns = new WeakMap(), _allExportedColumns = new WeakMap(), _onExport = new WeakMap(), _updateSelectedItems = new WeakMap();
|
|
1986
1972
|
SdGridMaterial.decorators = [
|
|
1987
1973
|
{ type: Component, args: [{
|
|
1988
1974
|
selector: 'sd-grid-material',
|
|
1989
|
-
template: "<ng-container *ngIf=\"gridConfigurationObserver | async as gridConfiguration\">\r\n <ng-container *ngIf=\"\r\n gridConfiguration\r\n | sdGridConfigurationResult\r\n : gridOption\r\n : sdSubInformation as configuration\r\n \">\r\n <ng-container *ngIf=\"!gridOption.filter?.disabled\">\r\n <sd-grid-filter [filter]=\"gridOption?.filter\" [columns]=\"configuration.firstColumns\" [filterDefs]=\"filterDefs\">\r\n </sd-grid-filter>\r\n </ng-container>\r\n <div class=\"c-container {{ gridOption?.style?.grid }}\" [ngClass]=\"{ 'mat-elevation-z2': gridOption?.shadow }\">\r\n <div class=\"c-loading\" *ngIf=\"isLoading\">\r\n <mat-spinner *ngIf=\"isLoading\"></mat-spinner>\r\n </div>\r\n <ng-container>\r\n <div class=\"c-table\" sdScroll [ngStyle]=\"{\r\n 'max-height': gridOption?.maxHeight,\r\n 'min-height': gridOption?.minHeight\r\n }\">\r\n <table *ngIf=\"items?.length; else elseEmpty\" mat-table [dataSource]=\"items\" matSort\r\n [matSortDisabled]=\"!gridOption.sortable\" cdkDropList cdkDropListOrientation=\"horizontal\"\r\n [cdkDropListDisabled]=\"!gridOption.dropDragColumnEnable\"\r\n (cdkDropListDropped)=\"drop($event, configuration.displayedColumns)\" multiTemplateDataRows>\r\n <ng-container matColumnDef=\"sdSubInformation\" sticky>\r\n <td class=\"p-0\" mat-cell *matCellDef=\"let item\" [attr.colspan]=\"configuration.displayedColumns.length\">\r\n <div *ngIf=\"sdSubInformation?.templateRef\" [@detailExpand]=\"item.isExpanded ? 'expanded' : 'collapsed'\">\r\n <ng-container *ngIf=\"item.isExpanded\">\r\n <ng-container *ngTemplateOutlet=\"\r\n sdSubInformation.templateRef;\r\n context: { item: item }\r\n \">\r\n </ng-container>\r\n </ng-container>\r\n </div>\r\n </td>\r\n <td mat-footer-cell *matFooterCellDef></td>\r\n </ng-container>\r\n <ng-container matColumnDef=\"sdSubInformationAction\" stickyEnd>\r\n <th class=\"p-0\" mat-header-cell *matHeaderCellDef style=\"width: 1px\"\r\n [attr.rowspan]=\"configuration.multipleHeader ? 2 : 1\"></th>\r\n <td mat-cell *matCellDef=\"let element\">\r\n <button *ngIf=\"!element.isExpanding\" mat-icon-button aria-label=\"Expand & Collapse\"\r\n (click)=\"onExpand(element)\">\r\n <mat-icon *ngIf=\"!element.isExpanded\">expand_more</mat-icon>\r\n <mat-icon *ngIf=\"element.isExpanded\">expand_less</mat-icon>\r\n </button>\r\n <div *ngIf=\"element.isExpanding\" class=\"lds-ring\">\r\n <div></div>\r\n <div></div>\r\n <div></div>\r\n <div></div>\r\n </div>\r\n </td>\r\n </ng-container>\r\n <ng-container matColumnDef=\"sdSelection\" sticky>\r\n <th class=\"text-center px-15\" mat-header-cell *matHeaderCellDef style=\"min-width: 50px; max-width: 50px\"\r\n [attr.rowspan]=\"configuration.multipleHeader ? 2 : 1\">\r\n <ng-container *ngIf=\"items | selectionVisibleSelectAll: gridOption?.selection | async\">\r\n <mat-checkbox *ngIf=\"!gridOption.selection?.single\" class=\"c-selection\" color=\"primary\"\r\n [(ngModel)]=\"isSelectAll\" (change)=\"onSelectAll()\">\r\n </mat-checkbox>\r\n </ng-container>\r\n\r\n </th>\r\n <td class=\"text-center px-15\" mat-cell *matCellDef=\"let item\" style=\"min-width: 50px; max-width: 50px\">\r\n <ng-container *ngIf=\"item | selectionVisible:gridOption?.selection\">\r\n <mat-checkbox class=\"c-selection\" color=\"primary\" [(ngModel)]=\"item.isSelected\"\r\n (change)=\"onSelect(item)\" [disabled]=\"\r\n selectedItems | selectionDisable: item:gridOption?.selection\r\n \">\r\n </mat-checkbox>\r\n </ng-container>\r\n\r\n </td>\r\n <td mat-footer-cell *matFooterCellDef></td>\r\n </ng-container>\r\n <ng-container matColumnDef=\"sdEditorValidation\">\r\n <th class=\"p-0\" mat-header-cell *matHeaderCellDef style=\"width: 2px\"\r\n [attr.rowspan]=\"configuration.multipleHeader ? 2 : 1\">\r\n </th>\r\n <td class=\"p-0 position-relative\" mat-cell *matCellDef=\"let item; index as idx\">\r\n <sd-desktop-editor-validation [sdId]=\"item.sdId\" [item]=\"item\" [items]=\"items\" [gridOption]=\"gridOption\">\r\n </sd-desktop-editor-validation>\r\n </td>\r\n <td mat-footer-cell *matFooterCellDef></td>\r\n </ng-container>\r\n <ng-container matColumnDef=\"sdEditor\">\r\n <th class=\"px-8 py-8\" mat-header-cell *matHeaderCellDef style=\"width: 50px\"\r\n [attr.rowspan]=\"configuration.multipleHeader ? 2 : 1\">\r\n <button class=\"c-btn-add\"\r\n *ngIf=\"gridOption.editor?.addable && (!gridOption.editor.limit || gridOption.editor.limit > items.length)\"\r\n (click)=\"onCreate()\" aria-hidden=\"true\" mat-icon-button>\r\n <mat-icon class=\"c-icon-add\">add</mat-icon>\r\n </button>\r\n </th>\r\n <td class=\"px-8\" mat-cell *matCellDef=\"let item; index as idx\">\r\n <ng-container *sdLet=\"item.editorStatus | sdEditorHandlerRow:item:gridOption as editorHandler\">\r\n <div *ngIf=\"editorHandler\" class=\"d-flex align-items-center justify-content-center\">\r\n <button *ngIf=\"editorHandler.editable\" class=\"mx-2\" (click)=\"onUpdate(item)\" aria-hidden=\"true\"\r\n mat-icon-button>\r\n <mat-icon class=\"c-icon\">edit</mat-icon>\r\n </button>\r\n <button *ngIf=\"editorHandler.removable\" class=\"mx-2\" (click)=\"onRemove(item)\" aria-hidden=\"true\"\r\n mat-icon-button>\r\n <mat-icon class=\"c-icon\">delete</mat-icon>\r\n </button>\r\n <button *ngIf=\"editorHandler.savable\" class=\"mx-2\" (click)=\"onSave(item)\" aria-hidden=\"true\"\r\n mat-icon-button>\r\n <mat-icon class=\"c-icon\">save</mat-icon>\r\n </button>\r\n <button *ngIf=\"editorHandler.cancelable\" class=\"mx-2\" (click)=\"onCancel(item)\" aria-hidden=\"true\"\r\n mat-icon-button>\r\n <mat-icon class=\"c-icon\">close</mat-icon>\r\n </button>\r\n </div>\r\n </ng-container>\r\n </td>\r\n <td mat-footer-cell *matFooterCellDef></td>\r\n </ng-container>\r\n <ng-container matColumnDef=\"sdCommand\">\r\n <th class=\"px-8 py-8\" mat-header-cell *matHeaderCellDef style=\"width: 50px\"\r\n [attr.rowspan]=\"configuration.multipleHeader ? 2 : 1\"></th>\r\n <td class=\"px-8\" mat-cell *matCellDef=\"let item\">\r\n <sd-desktop-command [commands]=\"gridOption.commands\" [item]=\"item\"></sd-desktop-command>\r\n </td>\r\n <td mat-footer-cell *matFooterCellDef></td>\r\n </ng-container>\r\n <ng-container *ngFor=\"let column of configuration.firstColumns; let i = index\" [matColumnDef]=\"column.field\"\r\n [sticky]=\"configuration.fixedColumn[column.field]\">\r\n <th mat-header-cell *matHeaderCellDef cdkDrag class=\"px-8 py-8 c-th\"\r\n [ngStyle]=\"{ 'min-width': configuration.firstColumns[i].width }\" [attr.rowspan]=\"\r\n configuration.multipleHeader && column.type !== 'children-col'\r\n ? 2\r\n : 1\r\n \" [attr.colspan]=\"\r\n column.type === 'children-col' ? column.children?.length : 1\r\n \">\r\n <div>\r\n <div aria-hidden=\"false\" role=\"presentation\" mat-sort-header [disabled]=\"\r\n !column.sortable || column.type === 'children-col'\r\n \" [innerHTML]=\"configuration.firstColumns[i].titleHtml || configuration.firstColumns[i].title\">\r\n </div>\r\n <sd-column-inline-filter *ngIf=\"gridOption.filter?.inlineColumn\" [value]=\"columnFilter[column.field]\"\r\n [columnFilter]=\"columnFilter\" [column]=\"column\" (filterChange)=\"onFilterChange()\">\r\n </sd-column-inline-filter>\r\n </div>\r\n </th>\r\n <td class=\"c-td px-8\" mat-cell *matCellDef=\"let item\">\r\n <sd-desktop-cell [sdId]=\"item.sdId\" [key]=\"key\" [value]=\"item[column.field]\" [column]=\"column\"\r\n [item]=\"item\" [idx]=\"i\" [cellDef]=\"cellDef\" [gridOption]=\"gridOption\">\r\n </sd-desktop-cell>\r\n </td>\r\n <td mat-footer-cell *matFooterCellDef>\r\n <ng-container *ngIf=\"footerDef[column.field]\">\r\n <ng-container *ngTemplateOutlet=\"\r\n footerDef[column.field].templateRef;\r\n context: { items: items, column: column }\r\n \">\r\n </ng-container>\r\n </ng-container>\r\n </td>\r\n </ng-container>\r\n <ng-container *ngFor=\"let column of configuration.secondColumns; let i = index\"\r\n [matColumnDef]=\"column.field\">\r\n <th mat-header-cell *matHeaderCellDef mat-sort-header class=\"c-th px-8\"\r\n [ngStyle]=\"{ 'min-width': column.width }\">\r\n <div>\r\n <div [innerHTML]=\"column.titleHtml || column.title\"></div>\r\n <sd-column-inline-filter *ngIf=\"gridOption.filter?.inlineColumn\" [value]=\"columnFilter[column.field]\"\r\n [columnFilter]=\"columnFilter\" [column]=\"column\" (filterChange)=\"onFilterChange()\">\r\n </sd-column-inline-filter>\r\n </div>\r\n </th>\r\n <td class=\"c-td px-8\" mat-cell *matCellDef=\"let item\">\r\n <sd-desktop-cell [sdId]=\"item.sdId\" [key]=\"key\" [value]=\"item[column.field]\" [column]=\"column\"\r\n [item]=\"item\" [idx]=\"i\" [cellDef]=\"cellDef\" [gridOption]=\"gridOption\">\r\n </sd-desktop-cell>\r\n </td>\r\n <td mat-footer-cell *matFooterCellDef>\r\n <ng-container *ngIf=\"footerDef[column.field]\">\r\n <ng-container *ngTemplateOutlet=\"\r\n footerDef[column.field].templateRef;\r\n context: { items: items, column: column }\r\n \">\r\n </ng-container>\r\n </ng-container>\r\n </td>\r\n </ng-container>\r\n <tr class=\"c-first-header\" mat-header-row *matHeaderRowDef=\"configuration.firstHeaders; sticky: true\"></tr>\r\n <ng-container *ngIf=\"configuration.secondHeaders?.length\">\r\n <tr class=\"c-second-header\" mat-header-row *matHeaderRowDef=\"configuration.secondHeaders; sticky: true\">\r\n </tr>\r\n </ng-container>\r\n <tr mat-row *matRowDef=\"let row; columns: configuration.displayedColumns\" matRipple class=\"c-row\"\r\n [class.selected]=\"row.isSelected\" [style]=\"row | sdStyleRowCss:gridOption\"></tr>\r\n <tr mat-row *matRowDef=\"let row; columns: ['sdSubInformation']\" class=\"c-detail-row\"></tr>\r\n <ng-container *ngIf=\"hasFooter && configuration.displayedFooters?.length\">\r\n <tr mat-footer-row *matFooterRowDef=\"configuration.displayedFooters; sticky: true\"></tr>\r\n </ng-container>\r\n </table>\r\n <ng-template #elseEmpty>\r\n <table mat-table [dataSource]=\"[{}]\">\r\n <ng-container matColumnDef=\"sdSelection\" sticky>\r\n <th class=\"px-15\" mat-header-cell *matHeaderCellDef style=\"min-width: 50px; max-width: 50px\"\r\n [attr.rowspan]=\"configuration.multipleHeader ? 2 : 1\"></th>\r\n </ng-container>\r\n <ng-container matColumnDef=\"sdEditorValidation\">\r\n <th class=\"p-0\" mat-header-cell *matHeaderCellDef style=\"width: 4px\"\r\n [attr.rowspan]=\"configuration.multipleHeader ? 2 : 1\">\r\n </th>\r\n <td class=\"p-0\" mat-cell *matCellDef=\"let item\">\r\n </td>\r\n <td mat-footer-cell *matFooterCellDef></td>\r\n </ng-container>\r\n <ng-container matColumnDef=\"sdEditor\">\r\n <th class=\"px-8 py-8\" mat-header-cell *matHeaderCellDef style=\"min-width: 50px; max-width: 50px\"\r\n [attr.rowspan]=\"configuration.multipleHeader ? 2 : 1\">\r\n <button class=\"c-btn-add\"\r\n *ngIf=\"gridOption.editor?.addable && (!gridOption.editor.limit || gridOption.editor.limit > items.length)\"\r\n (click)=\"onCreate()\" aria-hidden=\"true\" mat-icon-button>\r\n <mat-icon class=\"c-icon-add\">add</mat-icon>\r\n </button>\r\n </th>\r\n </ng-container>\r\n <ng-container matColumnDef=\"sdCommand\">\r\n <th class=\"px-8\" mat-header-cell *matHeaderCellDef style=\"min-width: 50px; max-width: 50px\"\r\n [attr.rowspan]=\"configuration.multipleHeader ? 2 : 1\"></th>\r\n </ng-container>\r\n <ng-container matColumnDef=\"sdSubInformationAction\">\r\n <th class=\"p-0\" mat-header-cell *matHeaderCellDef style=\"width: 1px\"\r\n [attr.rowspan]=\"configuration.multipleHeader ? 2 : 1\"></th>\r\n </ng-container>\r\n <ng-container matColumnDef=\"sdEmpty\">\r\n <td class=\"c-empty\" mat-cell *matCellDef=\"let item\"\r\n [attr.colspan]=\"configuration.displayedColumns.length\">\r\n <ng-container *ngIf=\"sdEmptyData?.templateRef; else sdEmptyDataNoRef\">\r\n <ng-container *ngTemplateOutlet=\"\r\n sdEmptyData.templateRef;\r\n context: { item: item }\r\n \">\r\n </ng-container>\r\n </ng-container>\r\n <ng-template #sdEmptyDataNoRef>\r\n <mat-icon fontSet=\"material-icons-outlined\">leaderboard</mat-icon>\r\n </ng-template>\r\n </td>\r\n </ng-container>\r\n <ng-container *ngFor=\"let column of configuration.columns\" [matColumnDef]=\"column.field\"\r\n [sticky]=\"configuration.fixedColumn[column.field]\">\r\n <th mat-header-cell *matHeaderCellDef class=\"c-th px-8 py-8\" [ngStyle]=\"{ 'min-width': column.width }\">\r\n <div [innerHTML]=\"column.titleHtml || column.title\"></div>\r\n </th>\r\n </ng-container>\r\n <ng-container *ngFor=\"let column of configuration.firstColumns; let i = index\"\r\n [matColumnDef]=\"column.field\" [sticky]=\"configuration.fixedColumn[column.field]\">\r\n <th mat-header-cell *matHeaderCellDef class=\"c-th px-8 py-8\"\r\n [ngStyle]=\"{ 'min-width': configuration.firstColumns[i].width }\" [attr.rowspan]=\"\r\n configuration.multipleHeader &&\r\n column.type !== 'children-col'\r\n ? 2\r\n : 1\r\n \" [attr.colspan]=\"\r\n column.type === 'children-col' ? column.children?.length : 1\r\n \">\r\n <div>\r\n <div [innerHTML]=\"configuration.firstColumns[i].titleHtml || configuration.firstColumns[i].title\">\r\n </div>\r\n <sd-column-inline-filter *ngIf=\"gridOption.filter?.inlineColumn\"\r\n [value]=\"columnFilter[column.field]\" [columnFilter]=\"columnFilter\" [column]=\"column\"\r\n (filterChange)=\"onFilterChange()\"></sd-column-inline-filter>\r\n </div>\r\n </th>\r\n </ng-container>\r\n <ng-container *ngFor=\"let column of configuration.secondColumns\" [matColumnDef]=\"column.field\">\r\n <th mat-header-cell *matHeaderCellDef class=\"c-th px-8 py-8\" [ngStyle]=\"{ 'min-width': column.width }\">\r\n <div>\r\n <div [innerHTML]=\"column.titleHtml || column.title\"></div>\r\n <sd-column-inline-filter *ngIf=\"gridOption.filter?.inlineColumn\"\r\n [value]=\"columnFilter[column.field]\" [columnFilter]=\"columnFilter\" [column]=\"column\"\r\n (filterChange)=\"onFilterChange()\"></sd-column-inline-filter>\r\n </div>\r\n </th>\r\n </ng-container>\r\n <tr class=\"c-first-header\" mat-header-row *matHeaderRowDef=\"configuration.firstHeaders; sticky: true\">\r\n </tr>\r\n <tr class=\"c-second-header\" mat-header-row *matHeaderRowDef=\"configuration.secondHeaders; sticky: true\">\r\n </tr>\r\n <tr mat-row *matRowDef=\"let row; columns: ['sdEmpty']\"></tr>\r\n </table>\r\n </ng-template>\r\n </div>\r\n </ng-container>\r\n <div class=\"c-paginator\">\r\n <div class=\"c-action\">\r\n <sd-button *ngIf=\"\r\n !gridOption.filter?.disabled && !gridOption.filter?.inlineColumn\r\n \" class=\"mr-10\" [title]=\"'Filter' | sdTranslate\" icon=\"filter_alt\" size=\"sm\" (action)=\"gridFilter.open()\"\r\n type=\"link\">\r\n </sd-button>\r\n <sd-button *ngIf=\"gridOption.reload?.visible\" class=\"mr-10\" [title]=\"'Reload' | sdTranslate\" icon=\"refresh\"\r\n size=\"sm\" (action)=\"reload()\" [disabled]=\"!items?.length\" type=\"link\">\r\n </sd-button>\r\n <ng-container *ngIf=\"gridOption.export?.visible && items?.length\">\r\n <ng-container *ngIf=\"isExporting; else unExporting\">\r\n <sd-button class=\"mr-10\" [loading]=\"isExporting\" [title]=\"exportTitle | sdTranslate\" icon=\"get_app\"\r\n size=\"sm\" type=\"link\">\r\n </sd-button>\r\n </ng-container>\r\n <ng-template #unExporting>\r\n <sd-button class=\"mr-10\" [title]=\"exportTitle | sdTranslate\" icon=\"get_app\" size=\"sm\"\r\n [matMenuTriggerFor]=\"menu\" type=\"link\">\r\n </sd-button>\r\n </ng-template>\r\n\r\n <mat-menu #menu=\"matMenu\">\r\n <button *ngIf=\"gridOption.export?.visibleExcel !== false\" mat-menu-item\r\n (click)=\"sdPopupExport.exportDefault()\" type=\"button\">\r\n <mat-icon fontSet=\"material-icons-outlined\">file_download</mat-icon>\r\n <span> {{ \"Export excel\" | sdTranslate }}</span>\r\n </button>\r\n <button *ngIf=\"gridOption.export?.visibleCSV !== false\" mat-menu-item\r\n (click)=\"sdPopupExport.exportDefault(true)\" type=\"button\">\r\n <mat-icon fontSet=\"material-icons-outlined\">file_download</mat-icon>\r\n <span> {{ \"Export CSV\" | sdTranslate }}</span>\r\n </button>\r\n <button *ngIf=\"gridOption.export?.key\" mat-menu-item (click)=\"sdPopupExport.open()\" type=\"button\">\r\n <mat-icon fontSet=\"material-icons-outlined\">settings</mat-icon>\r\n <span> {{ \"Configure\" | sdTranslate }}</span>\r\n </button>\r\n </mat-menu>\r\n </ng-container>\r\n <sd-button *ngIf=\"gridOption.config?.visible\" class=\"mr-10\" [title]=\"'Configure' | sdTranslate\"\r\n icon=\"settings\" size=\"sm\" (action)=\"popupGridConfiguration.open()\" type=\"link\">\r\n </sd-button>\r\n </div>\r\n <mat-paginator [class.d-none]=\"gridOption.paginate?.hidden\" [length]=\"total\"\r\n [pageSize]=\"gridOption.paginate?.pageSize\" [pageSizeOptions]=\"gridOption.paginate?.pages\"\r\n [showFirstLastButtons]=\"gridOption.paginate?.showFirstLastButtons\"></mat-paginator>\r\n </div>\r\n </div>\r\n <sd-popup-export *ngIf=\"gridOption.export?.visible\" [gridOption]=\"gridOption\" (export)=\"onExport($event)\"\r\n #sdPopupExport>\r\n </sd-popup-export>\r\n <sd-popup-grid-configuration [gridOption]=\"gridOption\" [key]=\"key\" #popupGridConfiguration>\r\n </sd-popup-grid-configuration>\r\n </ng-container>\r\n</ng-container>\r\n<sd-grid-quick-action [gridOption]=\"gridOption\" [selectedItems]=\"selectedItems\" (clear)=\"onClearSelection()\">\r\n</sd-grid-quick-action>",
|
|
1975
|
+
template: "<ng-container *ngIf=\"gridConfigurationObserver | async as gridConfiguration\">\r\n <ng-container *ngIf=\"\r\n gridConfiguration\r\n | sdGridConfigurationResult\r\n : gridOption\r\n : sdSubInformation as configuration\r\n \">\r\n <ng-container *ngIf=\"!gridOption.filter?.disabled\">\r\n <sd-grid-filter [filter]=\"gridOption?.filter\" [columns]=\"configuration.firstColumns\" [filterDefs]=\"filterDefs\">\r\n </sd-grid-filter>\r\n </ng-container>\r\n <div class=\"c-container {{ gridOption?.style?.grid }}\" [ngClass]=\"{ 'mat-elevation-z2': gridOption?.shadow }\">\r\n <div class=\"c-loading\" *ngIf=\"isLoading\">\r\n <mat-spinner *ngIf=\"isLoading\"></mat-spinner>\r\n </div>\r\n <ng-container>\r\n <div class=\"c-table\" sdScroll [ngStyle]=\"{\r\n 'max-height': gridOption?.maxHeight,\r\n 'min-height': gridOption?.minHeight\r\n }\">\r\n <table *ngIf=\"items?.length; else elseEmpty\" mat-table [dataSource]=\"items\" matSort\r\n [matSortDisabled]=\"!gridOption.sortable\" cdkDropList cdkDropListOrientation=\"horizontal\"\r\n [cdkDropListDisabled]=\"!gridOption.dropDragColumnEnable\"\r\n (cdkDropListDropped)=\"drop($event, configuration.displayedColumns)\" multiTemplateDataRows>\r\n <ng-container matColumnDef=\"sdSubInformation\" sticky>\r\n <td class=\"p-0\" mat-cell *matCellDef=\"let item\" [attr.colspan]=\"configuration.displayedColumns.length\">\r\n <div *ngIf=\"sdSubInformation?.templateRef\" [@detailExpand]=\"item.isExpanded ? 'expanded' : 'collapsed'\">\r\n <ng-container *ngIf=\"item.isExpanded\">\r\n <ng-container *ngTemplateOutlet=\"\r\n sdSubInformation.templateRef;\r\n context: { item: item }\r\n \">\r\n </ng-container>\r\n </ng-container>\r\n </div>\r\n </td>\r\n <td mat-footer-cell *matFooterCellDef></td>\r\n </ng-container>\r\n <ng-container matColumnDef=\"sdSubInformationAction\" stickyEnd>\r\n <th class=\"p-0\" mat-header-cell *matHeaderCellDef style=\"width: 1px\"\r\n [attr.rowspan]=\"configuration.multipleHeader ? 2 : 1\"></th>\r\n <td mat-cell *matCellDef=\"let element\">\r\n <button *ngIf=\"!element.isExpanding\" mat-icon-button aria-label=\"Expand & Collapse\"\r\n (click)=\"onExpand(element)\">\r\n <mat-icon *ngIf=\"!element.isExpanded\">expand_more</mat-icon>\r\n <mat-icon *ngIf=\"element.isExpanded\">expand_less</mat-icon>\r\n </button>\r\n <div *ngIf=\"element.isExpanding\" class=\"lds-ring\">\r\n <div></div>\r\n <div></div>\r\n <div></div>\r\n <div></div>\r\n </div>\r\n </td>\r\n </ng-container>\r\n <ng-container matColumnDef=\"sdSelection\" sticky>\r\n <th class=\"text-center px-15\" mat-header-cell *matHeaderCellDef style=\"min-width: 50px; max-width: 50px\"\r\n [attr.rowspan]=\"configuration.multipleHeader ? 2 : 1\">\r\n <ng-container *ngIf=\"items | selectionVisibleSelectAll: gridOption?.selection | async\">\r\n <mat-checkbox *ngIf=\"!gridOption.selection?.single\" class=\"c-selection\" color=\"primary\"\r\n [(ngModel)]=\"isSelectAll\" (change)=\"onSelectAll()\">\r\n </mat-checkbox>\r\n </ng-container>\r\n\r\n </th>\r\n <td class=\"text-center px-15\" mat-cell *matCellDef=\"let item\" style=\"min-width: 50px; max-width: 50px\">\r\n <ng-container *ngIf=\"item | selectionVisible:gridOption?.selection\">\r\n <mat-checkbox class=\"c-selection\" color=\"primary\" [(ngModel)]=\"item.isSelected\"\r\n (change)=\"onSelect(item)\" [disabled]=\"\r\n selectedItems | selectionDisable: item:gridOption?.selection\r\n \">\r\n </mat-checkbox>\r\n </ng-container>\r\n\r\n </td>\r\n <td mat-footer-cell *matFooterCellDef></td>\r\n </ng-container>\r\n <ng-container matColumnDef=\"sdEditorValidation\">\r\n <th class=\"p-0\" mat-header-cell *matHeaderCellDef style=\"width: 2px\"\r\n [attr.rowspan]=\"configuration.multipleHeader ? 2 : 1\">\r\n </th>\r\n <td class=\"p-0 position-relative\" mat-cell *matCellDef=\"let item; index as idx\">\r\n <sd-desktop-editor-validation [sdId]=\"item.sdId\" [item]=\"item\" [items]=\"items\"\r\n [gridOption]=\"gridOption\">\r\n </sd-desktop-editor-validation>\r\n </td>\r\n <td mat-footer-cell *matFooterCellDef></td>\r\n </ng-container>\r\n <ng-container matColumnDef=\"sdEditor\">\r\n <th class=\"px-8 py-8\" mat-header-cell *matHeaderCellDef style=\"width: 50px\"\r\n [attr.rowspan]=\"configuration.multipleHeader ? 2 : 1\">\r\n <button class=\"c-btn-add\"\r\n *ngIf=\"gridOption.editor?.addable && (!gridOption.editor.limit || gridOption.editor.limit > items.length)\"\r\n (click)=\"onCreate()\" aria-hidden=\"true\" mat-icon-button>\r\n <mat-icon class=\"c-icon-add\">add</mat-icon>\r\n </button>\r\n </th>\r\n <td class=\"px-8\" mat-cell *matCellDef=\"let item; index as idx\">\r\n <ng-container *sdLet=\"item.editorStatus | sdEditorHandlerRow:item:gridOption as editorHandler\">\r\n <div *ngIf=\"editorHandler\" class=\"d-flex align-items-center justify-content-center\">\r\n <button *ngIf=\"editorHandler.editable\" class=\"mx-2\" (click)=\"onUpdate(item)\" aria-hidden=\"true\"\r\n mat-icon-button>\r\n <mat-icon class=\"c-icon\">edit</mat-icon>\r\n </button>\r\n <button *ngIf=\"editorHandler.removable\" class=\"mx-2\" (click)=\"onRemove(item)\" aria-hidden=\"true\"\r\n mat-icon-button>\r\n <mat-icon class=\"c-icon\">delete</mat-icon>\r\n </button>\r\n <button *ngIf=\"editorHandler.savable\" class=\"mx-2\" (click)=\"onSave(item)\" aria-hidden=\"true\"\r\n mat-icon-button>\r\n <mat-icon class=\"c-icon\">save</mat-icon>\r\n </button>\r\n <button *ngIf=\"editorHandler.cancelable\" class=\"mx-2\" (click)=\"onCancel(item)\" aria-hidden=\"true\"\r\n mat-icon-button>\r\n <mat-icon class=\"c-icon\">close</mat-icon>\r\n </button>\r\n </div>\r\n </ng-container>\r\n </td>\r\n <td mat-footer-cell *matFooterCellDef></td>\r\n </ng-container>\r\n <ng-container matColumnDef=\"sdCommand\">\r\n <th class=\"px-8 py-8\" mat-header-cell *matHeaderCellDef style=\"width: 50px\"\r\n [attr.rowspan]=\"configuration.multipleHeader ? 2 : 1\"></th>\r\n <td class=\"px-8\" mat-cell *matCellDef=\"let item\">\r\n <sd-desktop-command [commands]=\"gridOption.commands\" [item]=\"item\"></sd-desktop-command>\r\n </td>\r\n <td mat-footer-cell *matFooterCellDef></td>\r\n </ng-container>\r\n <ng-container *ngFor=\"let column of configuration.firstColumns; let i = index\" [matColumnDef]=\"column.field\"\r\n [sticky]=\"configuration.fixedColumn[column.field]\">\r\n <th mat-header-cell *matHeaderCellDef cdkDrag class=\"px-8 py-8 c-th\"\r\n [ngStyle]=\"{ 'min-width': configuration.firstColumns[i].width }\" [attr.rowspan]=\"\r\n configuration.multipleHeader && column.type !== 'children-col'\r\n ? 2\r\n : 1\r\n \" [attr.colspan]=\"\r\n column.type === 'children-col' ? column.children?.length : 1\r\n \">\r\n <div>\r\n <div aria-hidden=\"false\" role=\"presentation\" mat-sort-header [disabled]=\"\r\n !column.sortable || column.type === 'children-col'\r\n \" [innerHTML]=\"configuration.firstColumns[i].titleHtml || configuration.firstColumns[i].title\">\r\n </div>\r\n <sd-column-inline-filter *ngIf=\"gridOption.filter?.inlineColumn\" [value]=\"columnFilter[column.field]\"\r\n [columnFilter]=\"columnFilter\" [column]=\"column\" (filterChange)=\"onFilterChange()\">\r\n </sd-column-inline-filter>\r\n </div>\r\n </th>\r\n <td class=\"c-td px-8\" mat-cell *matCellDef=\"let item\">\r\n <sd-desktop-cell [sdId]=\"item.sdId\" [key]=\"key\" [value]=\"item[column.field]\" [column]=\"column\"\r\n [item]=\"item\" [idx]=\"i\" [cellDef]=\"cellDef\" [gridOption]=\"gridOption\">\r\n </sd-desktop-cell>\r\n </td>\r\n <td mat-footer-cell *matFooterCellDef>\r\n <ng-container *ngIf=\"footerDef[column.field]\">\r\n <ng-container *ngTemplateOutlet=\"\r\n footerDef[column.field].templateRef;\r\n context: { items: items, column: column }\r\n \">\r\n </ng-container>\r\n </ng-container>\r\n </td>\r\n </ng-container>\r\n <ng-container *ngFor=\"let column of configuration.secondColumns; let i = index\"\r\n [matColumnDef]=\"column.field\">\r\n <th mat-header-cell *matHeaderCellDef mat-sort-header class=\"c-th px-8\"\r\n [ngStyle]=\"{ 'min-width': column.width }\">\r\n <div>\r\n <div [class.text-right]=\"column.align === 'right'\" [class.text-center]=\"column.align === 'center'\"\r\n [innerHTML]=\"column.titleHtml || column.title\"></div>\r\n <sd-column-inline-filter *ngIf=\"gridOption.filter?.inlineColumn\" [value]=\"columnFilter[column.field]\"\r\n [columnFilter]=\"columnFilter\" [column]=\"column\" (filterChange)=\"onFilterChange()\">\r\n </sd-column-inline-filter>\r\n </div>\r\n </th>\r\n <td class=\"c-td px-8\" mat-cell *matCellDef=\"let item\">\r\n <sd-desktop-cell [sdId]=\"item.sdId\" [key]=\"key\" [value]=\"item[column.field]\" [column]=\"column\"\r\n [item]=\"item\" [idx]=\"i\" [cellDef]=\"cellDef\" [gridOption]=\"gridOption\">\r\n </sd-desktop-cell>\r\n </td>\r\n <td mat-footer-cell *matFooterCellDef>\r\n <ng-container *ngIf=\"footerDef[column.field]\">\r\n <ng-container *ngTemplateOutlet=\"\r\n footerDef[column.field].templateRef;\r\n context: { items: items, column: column }\r\n \">\r\n </ng-container>\r\n </ng-container>\r\n </td>\r\n </ng-container>\r\n <tr class=\"c-first-header\" mat-header-row *matHeaderRowDef=\"configuration.firstHeaders; sticky: true\"></tr>\r\n <ng-container *ngIf=\"configuration.secondHeaders?.length\">\r\n <tr class=\"c-second-header\" mat-header-row *matHeaderRowDef=\"configuration.secondHeaders; sticky: true\">\r\n </tr>\r\n </ng-container>\r\n <tr mat-row *matRowDef=\"let row; columns: configuration.displayedColumns\" matRipple class=\"c-row\"\r\n [class.selected]=\"row.isSelected\" [style]=\"row | sdStyleRowCss:gridOption\"></tr>\r\n <tr mat-row *matRowDef=\"let row; columns: ['sdSubInformation']\" class=\"c-detail-row\"></tr>\r\n <ng-container *ngIf=\"hasFooter && configuration.displayedFooters?.length\">\r\n <tr mat-footer-row *matFooterRowDef=\"configuration.displayedFooters; sticky: true\"></tr>\r\n </ng-container>\r\n </table>\r\n <ng-template #elseEmpty>\r\n <table mat-table [dataSource]=\"[{}]\">\r\n <ng-container matColumnDef=\"sdSelection\" sticky>\r\n <th class=\"px-15\" mat-header-cell *matHeaderCellDef style=\"min-width: 50px; max-width: 50px\"\r\n [attr.rowspan]=\"configuration.multipleHeader ? 2 : 1\"></th>\r\n </ng-container>\r\n <ng-container matColumnDef=\"sdEditorValidation\">\r\n <th class=\"p-0\" mat-header-cell *matHeaderCellDef style=\"width: 4px\"\r\n [attr.rowspan]=\"configuration.multipleHeader ? 2 : 1\">\r\n </th>\r\n <td class=\"p-0\" mat-cell *matCellDef=\"let item\">\r\n </td>\r\n <td mat-footer-cell *matFooterCellDef></td>\r\n </ng-container>\r\n <ng-container matColumnDef=\"sdEditor\">\r\n <th class=\"px-8 py-8\" mat-header-cell *matHeaderCellDef style=\"min-width: 50px; max-width: 50px\"\r\n [attr.rowspan]=\"configuration.multipleHeader ? 2 : 1\">\r\n <button class=\"c-btn-add\"\r\n *ngIf=\"gridOption.editor?.addable && (!gridOption.editor.limit || gridOption.editor.limit > items.length)\"\r\n (click)=\"onCreate()\" aria-hidden=\"true\" mat-icon-button>\r\n <mat-icon class=\"c-icon-add\">add</mat-icon>\r\n </button>\r\n </th>\r\n </ng-container>\r\n <ng-container matColumnDef=\"sdCommand\">\r\n <th class=\"px-8\" mat-header-cell *matHeaderCellDef style=\"min-width: 50px; max-width: 50px\"\r\n [attr.rowspan]=\"configuration.multipleHeader ? 2 : 1\"></th>\r\n </ng-container>\r\n <ng-container matColumnDef=\"sdSubInformationAction\">\r\n <th class=\"p-0\" mat-header-cell *matHeaderCellDef style=\"width: 1px\"\r\n [attr.rowspan]=\"configuration.multipleHeader ? 2 : 1\"></th>\r\n </ng-container>\r\n <ng-container matColumnDef=\"sdEmpty\">\r\n <td class=\"c-empty\" mat-cell *matCellDef=\"let item\"\r\n [attr.colspan]=\"configuration.displayedColumns.length\">\r\n <ng-container *ngIf=\"sdEmptyData?.templateRef; else sdEmptyDataNoRef\">\r\n <ng-container *ngTemplateOutlet=\"\r\n sdEmptyData.templateRef;\r\n context: { item: item }\r\n \">\r\n </ng-container>\r\n </ng-container>\r\n <ng-template #sdEmptyDataNoRef>\r\n <mat-icon fontSet=\"material-icons-outlined\">leaderboard</mat-icon>\r\n </ng-template>\r\n </td>\r\n </ng-container>\r\n <ng-container *ngFor=\"let column of configuration.columns\" [matColumnDef]=\"column.field\"\r\n [sticky]=\"configuration.fixedColumn[column.field]\">\r\n <th mat-header-cell *matHeaderCellDef class=\"c-th px-8 py-8\" [ngStyle]=\"{ 'min-width': column.width }\">\r\n <div [class.text-right]=\"column.align === 'right'\" [class.text-center]=\"column.align === 'center'\"\r\n [innerHTML]=\"column.titleHtml || column.title\"></div>\r\n </th>\r\n </ng-container>\r\n <ng-container *ngFor=\"let column of configuration.firstColumns; let i = index\"\r\n [matColumnDef]=\"column.field\" [sticky]=\"configuration.fixedColumn[column.field]\">\r\n <th mat-header-cell *matHeaderCellDef class=\"c-th px-8 py-8\"\r\n [ngStyle]=\"{ 'min-width': configuration.firstColumns[i].width }\" [attr.rowspan]=\"\r\n configuration.multipleHeader &&\r\n column.type !== 'children-col'\r\n ? 2\r\n : 1\r\n \" [attr.colspan]=\"\r\n column.type === 'children-col' ? column.children?.length : 1\r\n \">\r\n <div>\r\n <div [innerHTML]=\"configuration.firstColumns[i].titleHtml || configuration.firstColumns[i].title\">\r\n </div>\r\n <sd-column-inline-filter *ngIf=\"gridOption.filter?.inlineColumn\"\r\n [value]=\"columnFilter[column.field]\" [columnFilter]=\"columnFilter\" [column]=\"column\"\r\n (filterChange)=\"onFilterChange()\"></sd-column-inline-filter>\r\n </div>\r\n </th>\r\n </ng-container>\r\n <ng-container *ngFor=\"let column of configuration.secondColumns\" [matColumnDef]=\"column.field\">\r\n <th mat-header-cell *matHeaderCellDef class=\"c-th px-8 py-8\" [ngStyle]=\"{ 'min-width': column.width }\">\r\n <div>\r\n <div [class.text-right]=\"column.align === 'right'\" [class.text-center]=\"column.align === 'center'\"\r\n [innerHTML]=\"column.titleHtml || column.title\"></div>\r\n <sd-column-inline-filter *ngIf=\"gridOption.filter?.inlineColumn\"\r\n [value]=\"columnFilter[column.field]\" [columnFilter]=\"columnFilter\" [column]=\"column\"\r\n (filterChange)=\"onFilterChange()\"></sd-column-inline-filter>\r\n </div>\r\n </th>\r\n </ng-container>\r\n <tr class=\"c-first-header\" mat-header-row *matHeaderRowDef=\"configuration.firstHeaders; sticky: true\">\r\n </tr>\r\n <tr class=\"c-second-header\" mat-header-row *matHeaderRowDef=\"configuration.secondHeaders; sticky: true\">\r\n </tr>\r\n <tr mat-row *matRowDef=\"let row; columns: ['sdEmpty']\"></tr>\r\n </table>\r\n </ng-template>\r\n </div>\r\n </ng-container>\r\n <div class=\"c-paginator\">\r\n <div class=\"c-action\">\r\n <sd-button *ngIf=\"\r\n !gridOption.filter?.disabled && !gridOption.filter?.inlineColumn\r\n \" class=\"mr-10\" [title]=\"'Filter' | sdTranslate\" icon=\"filter_alt\" size=\"sm\" (action)=\"gridFilter.open()\"\r\n type=\"link\">\r\n </sd-button>\r\n <sd-button *ngIf=\"gridOption.reload?.visible\" class=\"mr-10\" [title]=\"'Reload' | sdTranslate\" icon=\"refresh\"\r\n size=\"sm\" (action)=\"reload()\" [disabled]=\"!items?.length\" type=\"link\">\r\n </sd-button>\r\n <ng-container *ngIf=\"gridOption.export?.visible && items?.length\">\r\n <ng-container *ngIf=\"isExporting; else unExporting\">\r\n <sd-button class=\"mr-10\" [loading]=\"isExporting\" [title]=\"exportTitle | sdTranslate\" icon=\"get_app\"\r\n size=\"sm\" type=\"link\">\r\n </sd-button>\r\n </ng-container>\r\n <ng-template #unExporting>\r\n <sd-button class=\"mr-10\" [title]=\"exportTitle | sdTranslate\" icon=\"get_app\" size=\"sm\"\r\n [matMenuTriggerFor]=\"menu\" type=\"link\">\r\n </sd-button>\r\n </ng-template>\r\n\r\n <mat-menu #menu=\"matMenu\">\r\n <button *ngIf=\"gridOption.export?.visibleExcel !== false\" mat-menu-item\r\n (click)=\"sdPopupExport.exportDefault()\" type=\"button\">\r\n <mat-icon fontSet=\"material-icons-outlined\">file_download</mat-icon>\r\n <span> {{ \"Export excel\" | sdTranslate }}</span>\r\n </button>\r\n <button *ngIf=\"gridOption.export?.visibleCSV !== false\" mat-menu-item\r\n (click)=\"sdPopupExport.exportDefault(true)\" type=\"button\">\r\n <mat-icon fontSet=\"material-icons-outlined\">file_download</mat-icon>\r\n <span> {{ \"Export CSV\" | sdTranslate }}</span>\r\n </button>\r\n <button *ngIf=\"gridOption.export?.key\" mat-menu-item (click)=\"sdPopupExport.open()\" type=\"button\">\r\n <mat-icon fontSet=\"material-icons-outlined\">settings</mat-icon>\r\n <span> {{ \"Configure\" | sdTranslate }}</span>\r\n </button>\r\n </mat-menu>\r\n </ng-container>\r\n <sd-button *ngIf=\"gridOption.config?.visible\" class=\"mr-10\" [title]=\"'Configure' | sdTranslate\"\r\n icon=\"settings\" size=\"sm\" (action)=\"popupGridConfiguration.open()\" type=\"link\">\r\n </sd-button>\r\n </div>\r\n <mat-paginator [class.d-none]=\"gridOption.paginate?.hidden\" [length]=\"total\"\r\n [pageSize]=\"gridOption.paginate?.pageSize\" [pageSizeOptions]=\"gridOption.paginate?.pages\"\r\n [showFirstLastButtons]=\"gridOption.paginate?.showFirstLastButtons\"></mat-paginator>\r\n </div>\r\n </div>\r\n <sd-popup-export *ngIf=\"gridOption.export?.visible\" [gridOption]=\"gridOption\" (export)=\"onExport($event)\"\r\n #sdPopupExport>\r\n </sd-popup-export>\r\n <sd-popup-grid-configuration [gridOption]=\"gridOption\" [key]=\"key\" #popupGridConfiguration>\r\n </sd-popup-grid-configuration>\r\n </ng-container>\r\n</ng-container>\r\n<sd-grid-quick-action [gridOption]=\"gridOption\" [selectedItems]=\"selectedItems\" (clear)=\"onClearSelection()\">\r\n</sd-grid-quick-action>",
|
|
1990
1976
|
animations: [
|
|
1991
1977
|
trigger('detailExpand', [
|
|
1992
1978
|
state('collapsed', style({ height: '0', minHeight: '0', visibility: 'hidden' })),
|
|
@@ -2004,7 +1990,7 @@ SdGridMaterial.ctorParameters = () => [
|
|
|
2004
1990
|
{ type: SdExportService },
|
|
2005
1991
|
{ type: SdNotifyService },
|
|
2006
1992
|
{ type: SdTranslateService },
|
|
2007
|
-
{ type:
|
|
1993
|
+
{ type: SdColumnValuesPipe }
|
|
2008
1994
|
];
|
|
2009
1995
|
SdGridMaterial.propDecorators = {
|
|
2010
1996
|
quickAction: [{ type: ViewChild, args: [SdQuickAction,] }],
|
|
@@ -2148,25 +2134,6 @@ SdCommandTitlePipe.decorators = [
|
|
|
2148
2134
|
},] }
|
|
2149
2135
|
];
|
|
2150
2136
|
|
|
2151
|
-
class SdColumnValuesPipe {
|
|
2152
|
-
constructor(gridService) {
|
|
2153
|
-
this.gridService = gridService;
|
|
2154
|
-
this.transform = (value, column, key) => __awaiter(this, void 0, void 0, function* () {
|
|
2155
|
-
var _a;
|
|
2156
|
-
const data = yield this.gridService.loadValues(column, key);
|
|
2157
|
-
return (_a = data.obj[value]) !== null && _a !== void 0 ? _a : value;
|
|
2158
|
-
});
|
|
2159
|
-
}
|
|
2160
|
-
}
|
|
2161
|
-
SdColumnValuesPipe.decorators = [
|
|
2162
|
-
{ type: Pipe, args: [{
|
|
2163
|
-
name: 'columnValues'
|
|
2164
|
-
},] }
|
|
2165
|
-
];
|
|
2166
|
-
SdColumnValuesPipe.ctorParameters = () => [
|
|
2167
|
-
{ type: SdGridService }
|
|
2168
|
-
];
|
|
2169
|
-
|
|
2170
2137
|
class SdColumnHtmlTemplatePipe {
|
|
2171
2138
|
constructor(deviceService) {
|
|
2172
2139
|
this.isMobileOrTablet = false;
|
|
@@ -2208,6 +2175,61 @@ SdDesktopCellView.propDecorators = {
|
|
|
2208
2175
|
gridOption: [{ type: Input }]
|
|
2209
2176
|
};
|
|
2210
2177
|
|
|
2178
|
+
var _prefix$1, _cache$2;
|
|
2179
|
+
class SdGridService {
|
|
2180
|
+
constructor(utilityService) {
|
|
2181
|
+
this.utilityService = utilityService;
|
|
2182
|
+
_prefix$1.set(this, 'a1e67660-8aa2-4c11-b02d-71a32188719f');
|
|
2183
|
+
_cache$2.set(this, {});
|
|
2184
|
+
this.loadValues = (column, key) => __awaiter(this, void 0, void 0, function* () {
|
|
2185
|
+
var _a, _b, _c, _d;
|
|
2186
|
+
if (column.type !== 'values' || !((_a = column.option) === null || _a === void 0 ? void 0 : _a.items) || !((_b = column.option) === null || _b === void 0 ? void 0 : _b.valueField) || !((_c = column.option) === null || _c === void 0 ? void 0 : _c.displayField)) {
|
|
2187
|
+
return {
|
|
2188
|
+
values: [],
|
|
2189
|
+
obj: {}
|
|
2190
|
+
};
|
|
2191
|
+
}
|
|
2192
|
+
const hashKey = hash__default({
|
|
2193
|
+
prefix: __classPrivateFieldGet(this, _prefix$1),
|
|
2194
|
+
field: column.field,
|
|
2195
|
+
key,
|
|
2196
|
+
});
|
|
2197
|
+
if (!__classPrivateFieldGet(this, _cache$2)[hashKey]) {
|
|
2198
|
+
let items = [];
|
|
2199
|
+
if (typeof ((_d = column.option) === null || _d === void 0 ? void 0 : _d.items) === 'function') {
|
|
2200
|
+
items = yield column.option.items();
|
|
2201
|
+
}
|
|
2202
|
+
else {
|
|
2203
|
+
items = column.option.items;
|
|
2204
|
+
}
|
|
2205
|
+
__classPrivateFieldGet(this, _cache$2)[hashKey] = {
|
|
2206
|
+
values: items,
|
|
2207
|
+
obj: Array.toObject(items, column.option.valueField)
|
|
2208
|
+
};
|
|
2209
|
+
}
|
|
2210
|
+
return __classPrivateFieldGet(this, _cache$2)[hashKey];
|
|
2211
|
+
});
|
|
2212
|
+
this.getValues = (column, key) => {
|
|
2213
|
+
const hashKey = hash__default({
|
|
2214
|
+
prefix: __classPrivateFieldGet(this, _prefix$1),
|
|
2215
|
+
field: column.field,
|
|
2216
|
+
key,
|
|
2217
|
+
});
|
|
2218
|
+
return __classPrivateFieldGet(this, _cache$2)[hashKey] || {
|
|
2219
|
+
values: [],
|
|
2220
|
+
obj: {}
|
|
2221
|
+
};
|
|
2222
|
+
};
|
|
2223
|
+
}
|
|
2224
|
+
}
|
|
2225
|
+
_prefix$1 = new WeakMap(), _cache$2 = new WeakMap();
|
|
2226
|
+
SdGridService.decorators = [
|
|
2227
|
+
{ type: Injectable }
|
|
2228
|
+
];
|
|
2229
|
+
SdGridService.ctorParameters = () => [
|
|
2230
|
+
{ type: SdUtilityService }
|
|
2231
|
+
];
|
|
2232
|
+
|
|
2211
2233
|
class SdColumnTransformPipe {
|
|
2212
2234
|
constructor(gridService) {
|
|
2213
2235
|
this.gridService = gridService;
|
|
@@ -2297,7 +2319,7 @@ class SdDesktopCellChildrenView {
|
|
|
2297
2319
|
SdDesktopCellChildrenView.decorators = [
|
|
2298
2320
|
{ type: Component, args: [{
|
|
2299
2321
|
selector: 'sd-desktop-cell-children-view',
|
|
2300
|
-
template: "<ng-container *ngIf=\"column.children?.length\">\r\n <div class=\"row mx-0\">\r\n <div *ngFor=\"let childColumn of column.children | columnChildrenFilter:item\" class=\"px-2\"\r\n [ngClass]=\"{'col-6': childColumn?.colSpan === 1, 'col-12': !childColumn?.colSpan || childColumn?.colSpan === 2}\">\r\n <span class=\"c-title\">\r\n {{item | columnTitle:childColumn | async}}:\r\n </span>\r\n <ng-container *ngIf=\"childColumn.htmlTemplate;else useDefaultView\">\r\n <div (click)=\"childColumn.click && childColumn.click(item[childColumn.field], item)\"\r\n style=\"display:inline-block ;overflow-wrap: break-word;\" [ngClass]=\"{'cursor-pointer':childColumn.click}\"\r\n [innerHTML]=\"(item[childColumn.field] | columnHtmlTemplate:item:childColumn) | safeHtml\">\r\n </div>\r\n </ng-container>\r\n <ng-template #useDefaultView>\r\n <span *ngIf=\"childColumn.type === 'string'\">\r\n <a *ngIf=\"childColumn.click\" href=\"javascript:;\"\r\n (click)=\"childColumn.click(item[childColumn.field], item)\">{{item[childColumn.field] |\r\n columnTransform:item:childColumn | async}}</a>\r\n <ng-container *ngIf=\"!childColumn.click\">\r\n {{item[childColumn.field] | columnTransform:item:childColumn | async}}</ng-container>\r\n </span>\r\n <span *ngIf=\"childColumn.type === 'number'\">\r\n <a *ngIf=\"childColumn.click\" href=\"javascript:;\"\r\n (click)=\"childColumn.click(item[childColumn.field], item)\">{{item[childColumn.field] |\r\n columnTransform:item:childColumn | async}}</a>\r\n <ng-container *ngIf=\"!childColumn.click\">\r\n {{item[childColumn.field] | columnTransform:item:childColumn | async}}\r\n </ng-container>\r\n </span>\r\n <span *ngIf=\"childColumn.type === 'datetime'\">\r\n <a *ngIf=\"childColumn.click\" href=\"javascript:;\"\r\n (click)=\"childColumn.click(item[childColumn.field], item)\">{{item[childColumn.field] |\r\n sdTimeDifferent:'dd/MM/yyyy HH:mm':childColumn.option?.timeDifferent | async}}</a>\r\n <ng-container *ngIf=\"!childColumn.click\">\r\n <span matTooltipPosition=\"above\"\r\n [matTooltip]=\"item[childColumn.field] | date:'dd/MM/yyyy HH:mm'\">{{item[childColumn.field] |\r\n sdTimeDifferent:'dd/MM/yyyy HH:mm':childColumn.option?.timeDifferent | async}}</span>\r\n </ng-container>\r\n </span>\r\n <span *ngIf=\"childColumn.type === 'date'\">\r\n <a *ngIf=\"childColumn.click\" href=\"javascript:;\"\r\n (click)=\"childColumn.click(item[childColumn.field], item)\">{{item[childColumn.field] |\r\n sdTimeDifferent:'dd/MM/yyyy':childColumn.option?.timeDifferent | async}}</a>\r\n <ng-container *ngIf=\"!childColumn.click\">\r\n <span matTooltipPosition=\"above\"\r\n [matTooltip]=\"item[childColumn.field] | date:'dd/MM/yyyy'\">{{item[childColumn.field] |\r\n sdTimeDifferent:'dd/MM/yyyy':childColumn.option?.timeDifferent | async}}</span>\r\n </ng-container>\r\n </span>\r\n <span *ngIf=\"childColumn.type === 'time'\">\r\n <a *ngIf=\"childColumn.click\" href=\"javascript:;\"\r\n (click)=\"childColumn.click(item[childColumn.field], item)\">{{item[childColumn.field] | date:'HH:mm'}}</a>\r\n <ng-container *ngIf=\"!childColumn.click\">\r\n {{item[childColumn.field] | date:'HH:mm'}}\r\n </ng-container>\r\n </span>\r\n <span *ngIf=\"childColumn.type === 'bool'\"\r\n (click)=\"childColumn.click && childColumn.click(item[childColumn.field], item)\">\r\n <strong *ngIf=\"item[childColumn.field]\" class=\"text-success\">{{childColumn.option?.displayOnTrue ||\r\n 'True'}}</strong>\r\n <strong *ngIf=\"!item[childColumn.field]\" class=\"text-danger\">{{childColumn.option?.displayOnFalse ||\r\n 'False'}}</strong>\r\n </span>\r\n <ng-container *ngIf=\"childColumn.type === 'values'\">\r\n <ng-container *ngIf=\"childColumn.transform\">{{item[childColumn.field] | columnTransform:item:childColumn | async}}</ng-container>\r\n <ng-container *ngIf=\"!childColumn.transform\">\r\n <ng-container *ngIf=\"item[childColumn.field] | columnValues:childColumn
|
|
2322
|
+
template: "<ng-container *ngIf=\"column.children?.length\">\r\n <div class=\"row mx-0\">\r\n <div *ngFor=\"let childColumn of column.children | columnChildrenFilter:item\" class=\"px-2\"\r\n [ngClass]=\"{'col-6': childColumn?.colSpan === 1, 'col-12': !childColumn?.colSpan || childColumn?.colSpan === 2}\">\r\n <span class=\"c-title\">\r\n {{item | columnTitle:childColumn | async}}:\r\n </span>\r\n <ng-container *ngIf=\"childColumn.htmlTemplate;else useDefaultView\">\r\n <div (click)=\"childColumn.click && childColumn.click(item[childColumn.field], item)\"\r\n style=\"display:inline-block ;overflow-wrap: break-word;\" [ngClass]=\"{'cursor-pointer':childColumn.click}\"\r\n [innerHTML]=\"(item[childColumn.field] | columnHtmlTemplate:item:childColumn) | safeHtml\">\r\n </div>\r\n </ng-container>\r\n <ng-template #useDefaultView>\r\n <span *ngIf=\"childColumn.type === 'string'\">\r\n <a *ngIf=\"childColumn.click\" href=\"javascript:;\"\r\n (click)=\"childColumn.click(item[childColumn.field], item)\">{{item[childColumn.field] |\r\n columnTransform:item:childColumn | async}}</a>\r\n <ng-container *ngIf=\"!childColumn.click\">\r\n {{item[childColumn.field] | columnTransform:item:childColumn | async}}</ng-container>\r\n </span>\r\n <span *ngIf=\"childColumn.type === 'number'\">\r\n <a *ngIf=\"childColumn.click\" href=\"javascript:;\"\r\n (click)=\"childColumn.click(item[childColumn.field], item)\">{{item[childColumn.field] |\r\n columnTransform:item:childColumn | async}}</a>\r\n <ng-container *ngIf=\"!childColumn.click\">\r\n {{item[childColumn.field] | columnTransform:item:childColumn | async}}\r\n </ng-container>\r\n </span>\r\n <span *ngIf=\"childColumn.type === 'datetime'\">\r\n <a *ngIf=\"childColumn.click\" href=\"javascript:;\"\r\n (click)=\"childColumn.click(item[childColumn.field], item)\">{{item[childColumn.field] |\r\n sdTimeDifferent:'dd/MM/yyyy HH:mm':childColumn.option?.timeDifferent | async}}</a>\r\n <ng-container *ngIf=\"!childColumn.click\">\r\n <span matTooltipPosition=\"above\"\r\n [matTooltip]=\"item[childColumn.field] | date:'dd/MM/yyyy HH:mm'\">{{item[childColumn.field] |\r\n sdTimeDifferent:'dd/MM/yyyy HH:mm':childColumn.option?.timeDifferent | async}}</span>\r\n </ng-container>\r\n </span>\r\n <span *ngIf=\"childColumn.type === 'date'\">\r\n <a *ngIf=\"childColumn.click\" href=\"javascript:;\"\r\n (click)=\"childColumn.click(item[childColumn.field], item)\">{{item[childColumn.field] |\r\n sdTimeDifferent:'dd/MM/yyyy':childColumn.option?.timeDifferent | async}}</a>\r\n <ng-container *ngIf=\"!childColumn.click\">\r\n <span matTooltipPosition=\"above\"\r\n [matTooltip]=\"item[childColumn.field] | date:'dd/MM/yyyy'\">{{item[childColumn.field] |\r\n sdTimeDifferent:'dd/MM/yyyy':childColumn.option?.timeDifferent | async}}</span>\r\n </ng-container>\r\n </span>\r\n <span *ngIf=\"childColumn.type === 'time'\">\r\n <a *ngIf=\"childColumn.click\" href=\"javascript:;\"\r\n (click)=\"childColumn.click(item[childColumn.field], item)\">{{item[childColumn.field] | date:'HH:mm'}}</a>\r\n <ng-container *ngIf=\"!childColumn.click\">\r\n {{item[childColumn.field] | date:'HH:mm'}}\r\n </ng-container>\r\n </span>\r\n <span *ngIf=\"childColumn.type === 'bool'\"\r\n (click)=\"childColumn.click && childColumn.click(item[childColumn.field], item)\">\r\n <strong *ngIf=\"item[childColumn.field]\" class=\"text-success\">{{childColumn.option?.displayOnTrue ||\r\n 'True'}}</strong>\r\n <strong *ngIf=\"!item[childColumn.field]\" class=\"text-danger\">{{childColumn.option?.displayOnFalse ||\r\n 'False'}}</strong>\r\n </span>\r\n <ng-container *ngIf=\"childColumn.type === 'values'\">\r\n <ng-container *ngIf=\"childColumn.transform\">{{item[childColumn.field] | columnTransform:item:childColumn | async}}</ng-container>\r\n <ng-container *ngIf=\"!childColumn.transform\">\r\n {{item[childColumn.field] | columnValues:childColumn | async}}\r\n <!-- <ng-container *ngIf=\"item[childColumn.field] | columnValues:childColumn | async; $implicit as valueData\">\r\n <div\r\n *ngIf=\"valueData[childColumn.option?.colorField] || valueData[childColumn.option?.backgroundColorField]; else elseNoStatus\"\r\n [ngStyle]=\"{'color':valueData[childColumn.option?.colorField], 'background-color': valueData[childColumn.option?.backgroundColorField]}\">\r\n {{valueData[childColumn.option?.displayField]}}\r\n </div>\r\n <ng-template #elseNoStatus>\r\n {{valueData[childColumn.option?.displayField]}}\r\n </ng-template>\r\n </ng-container> -->\r\n </ng-container>\r\n \r\n </ng-container>\r\n <img *ngIf=\"childColumn.type === 'image'\" [src]=\"item[childColumn.field] | columnTransform:item:childColumn | async\" [width]=\"childColumn.display?.width\"\r\n [height]=\"childColumn.display?.height\" style=\"margin: 5px 0\"\r\n (click)=\"childColumn.click && childColumn.click(item[childColumn.field], item)\">\r\n </ng-template>\r\n </div>\r\n </div>\r\n</ng-container>",
|
|
2301
2323
|
styles: [".c-title{color:#212529;font-size:13px;font-weight:700;line-height:1.7;margin-right:3px}.c-children{color:#212529;font-size:14px;overflow-wrap:break-word}"]
|
|
2302
2324
|
},] }
|
|
2303
2325
|
];
|
|
@@ -2434,7 +2456,7 @@ SdGridConfigurationResultPipe.ctorParameters = () => [
|
|
|
2434
2456
|
{ type: SdGridConfigurationService }
|
|
2435
2457
|
];
|
|
2436
2458
|
|
|
2437
|
-
var _cache$
|
|
2459
|
+
var _cache$3;
|
|
2438
2460
|
class SdPopupGridConfiguration {
|
|
2439
2461
|
constructor(ref, notifyService, translateService, gridConfigurationService) {
|
|
2440
2462
|
this.ref = ref;
|
|
@@ -2442,24 +2464,24 @@ class SdPopupGridConfiguration {
|
|
|
2442
2464
|
this.translateService = translateService;
|
|
2443
2465
|
this.gridConfigurationService = gridConfigurationService;
|
|
2444
2466
|
this.changes = new EventEmitter();
|
|
2445
|
-
_cache$
|
|
2467
|
+
_cache$3.set(this, void 0);
|
|
2446
2468
|
this.isCreatingColumn = false;
|
|
2447
2469
|
this.selected = {};
|
|
2448
2470
|
this.disabledDrag = true;
|
|
2449
2471
|
this.open = () => __awaiter(this, void 0, void 0, function* () {
|
|
2450
|
-
__classPrivateFieldSet(this, _cache$
|
|
2451
|
-
this.configuration = yield __classPrivateFieldGet(this, _cache$
|
|
2472
|
+
__classPrivateFieldSet(this, _cache$3, this.gridConfigurationService.init(this.key, this.gridOption));
|
|
2473
|
+
this.configuration = yield __classPrivateFieldGet(this, _cache$3).get();
|
|
2452
2474
|
this.modal.open();
|
|
2453
2475
|
});
|
|
2454
2476
|
this.onSave = () => {
|
|
2455
|
-
__classPrivateFieldGet(this, _cache$
|
|
2477
|
+
__classPrivateFieldGet(this, _cache$3).set(this.configuration);
|
|
2456
2478
|
this.modal.close();
|
|
2457
2479
|
this.ref.detectChanges();
|
|
2458
2480
|
};
|
|
2459
2481
|
this.onReset = () => __awaiter(this, void 0, void 0, function* () {
|
|
2460
2482
|
const { translate } = this.translateService;
|
|
2461
2483
|
this.notifyService.confirm(translate('Reset grid configuration to default')).then(() => {
|
|
2462
|
-
__classPrivateFieldGet(this, _cache$
|
|
2484
|
+
__classPrivateFieldGet(this, _cache$3).remove();
|
|
2463
2485
|
this.modal.close();
|
|
2464
2486
|
this.ref.detectChanges();
|
|
2465
2487
|
});
|
|
@@ -2483,7 +2505,7 @@ class SdPopupGridConfiguration {
|
|
|
2483
2505
|
generatedColumns: this.configuration.columns.filter(e => { var _a; return this.selected[(_a = e.origin) === null || _a === void 0 ? void 0 : _a.field]; }).map(e => { var _a; return (_a = e.origin) === null || _a === void 0 ? void 0 : _a.field; })
|
|
2484
2506
|
};
|
|
2485
2507
|
this.configuration.columns.push(generatedColumn);
|
|
2486
|
-
this.configuration = __classPrivateFieldGet(this, _cache$
|
|
2508
|
+
this.configuration = __classPrivateFieldGet(this, _cache$3).set(this.configuration);
|
|
2487
2509
|
this.isCreatingColumn = false;
|
|
2488
2510
|
});
|
|
2489
2511
|
}
|
|
@@ -2503,7 +2525,7 @@ class SdPopupGridConfiguration {
|
|
|
2503
2525
|
this.disabledDrag = true;
|
|
2504
2526
|
}
|
|
2505
2527
|
}
|
|
2506
|
-
_cache$
|
|
2528
|
+
_cache$3 = new WeakMap();
|
|
2507
2529
|
SdPopupGridConfiguration.decorators = [
|
|
2508
2530
|
{ type: Component, args: [{
|
|
2509
2531
|
selector: 'sd-popup-grid-configuration',
|
|
@@ -2583,7 +2605,7 @@ class SdSelectionActionFilterPipe {
|
|
|
2583
2605
|
if ('children' in action) {
|
|
2584
2606
|
const children = [];
|
|
2585
2607
|
for (const childAction of action.children) {
|
|
2586
|
-
const key =
|
|
2608
|
+
const key = hash__default(childAction);
|
|
2587
2609
|
if (selectedItems.every(e => e.actions.includes(key))) {
|
|
2588
2610
|
children.push(childAction);
|
|
2589
2611
|
}
|
|
@@ -2593,7 +2615,7 @@ class SdSelectionActionFilterPipe {
|
|
|
2593
2615
|
}
|
|
2594
2616
|
}
|
|
2595
2617
|
else {
|
|
2596
|
-
const key =
|
|
2618
|
+
const key = hash__default(action);
|
|
2597
2619
|
if (selectedItems.every(e => e.actions.includes(key))) {
|
|
2598
2620
|
results.push(action);
|
|
2599
2621
|
}
|
|
@@ -2626,7 +2648,7 @@ class SdSelectionDisablePipe {
|
|
|
2626
2648
|
const availableActions = actions.filter(action => {
|
|
2627
2649
|
if ('children' in action) {
|
|
2628
2650
|
for (const childAction of action.children) {
|
|
2629
|
-
const key =
|
|
2651
|
+
const key = hash__default(childAction);
|
|
2630
2652
|
if (selectedItems.every(e => e.actions.includes(key))) {
|
|
2631
2653
|
return true;
|
|
2632
2654
|
}
|
|
@@ -2634,7 +2656,7 @@ class SdSelectionDisablePipe {
|
|
|
2634
2656
|
return false;
|
|
2635
2657
|
}
|
|
2636
2658
|
else {
|
|
2637
|
-
const key =
|
|
2659
|
+
const key = hash__default(action);
|
|
2638
2660
|
return selectedItems.every(e => e.actions.includes(key));
|
|
2639
2661
|
}
|
|
2640
2662
|
});
|
|
@@ -2642,13 +2664,13 @@ class SdSelectionDisablePipe {
|
|
|
2642
2664
|
for (const action of availableActions) {
|
|
2643
2665
|
if ('children' in action) {
|
|
2644
2666
|
for (const childAction of action.children) {
|
|
2645
|
-
if (rowData.actions.includes(
|
|
2667
|
+
if (rowData.actions.includes(hash__default(childAction))) {
|
|
2646
2668
|
return false;
|
|
2647
2669
|
}
|
|
2648
2670
|
}
|
|
2649
2671
|
}
|
|
2650
2672
|
else {
|
|
2651
|
-
if (rowData.actions.includes(
|
|
2673
|
+
if (rowData.actions.includes(hash__default(action))) {
|
|
2652
2674
|
return false;
|
|
2653
2675
|
}
|
|
2654
2676
|
}
|
|
@@ -2690,35 +2712,35 @@ SdSelectionVisibleSelectAllPipe.decorators = [
|
|
|
2690
2712
|
},] }
|
|
2691
2713
|
];
|
|
2692
2714
|
|
|
2693
|
-
var _cache$
|
|
2715
|
+
var _cache$4;
|
|
2694
2716
|
class SdGeneratedColumnService {
|
|
2695
2717
|
constructor(settingService) {
|
|
2696
2718
|
this.settingService = settingService;
|
|
2697
|
-
_cache$
|
|
2719
|
+
_cache$4.set(this, {});
|
|
2698
2720
|
this.load = (configuration) => {
|
|
2699
2721
|
if (!(configuration === null || configuration === void 0 ? void 0 : configuration.key)) {
|
|
2700
2722
|
return null;
|
|
2701
2723
|
}
|
|
2702
|
-
const key =
|
|
2724
|
+
const key = hash__default({
|
|
2703
2725
|
prefix: '260f5e94-5865-4425-8ced-b9c083c390dd',
|
|
2704
2726
|
key: configuration.key
|
|
2705
2727
|
});
|
|
2706
|
-
if (!__classPrivateFieldGet(this, _cache$
|
|
2728
|
+
if (!__classPrivateFieldGet(this, _cache$4)[key]) {
|
|
2707
2729
|
if ((configuration === null || configuration === void 0 ? void 0 : configuration.storage) === 'server') {
|
|
2708
|
-
__classPrivateFieldGet(this, _cache$
|
|
2730
|
+
__classPrivateFieldGet(this, _cache$4)[key] = this.settingService.createServer(key, {
|
|
2709
2731
|
args: configuration === null || configuration === void 0 ? void 0 : configuration.args,
|
|
2710
2732
|
default: []
|
|
2711
2733
|
});
|
|
2712
2734
|
}
|
|
2713
2735
|
else {
|
|
2714
|
-
__classPrivateFieldGet(this, _cache$
|
|
2736
|
+
__classPrivateFieldGet(this, _cache$4)[key] = this.settingService.create(key, {
|
|
2715
2737
|
type: configuration === null || configuration === void 0 ? void 0 : configuration.storage,
|
|
2716
2738
|
args: configuration === null || configuration === void 0 ? void 0 : configuration.args,
|
|
2717
2739
|
default: []
|
|
2718
2740
|
});
|
|
2719
2741
|
}
|
|
2720
2742
|
}
|
|
2721
|
-
return __classPrivateFieldGet(this, _cache$
|
|
2743
|
+
return __classPrivateFieldGet(this, _cache$4)[key];
|
|
2722
2744
|
};
|
|
2723
2745
|
this.loadSystem = (configuration) => {
|
|
2724
2746
|
var _a, _b;
|
|
@@ -2728,30 +2750,30 @@ class SdGeneratedColumnService {
|
|
|
2728
2750
|
if (!(configuration === null || configuration === void 0 ? void 0 : configuration.systemColumn)) {
|
|
2729
2751
|
return null;
|
|
2730
2752
|
}
|
|
2731
|
-
const key =
|
|
2753
|
+
const key = hash__default({
|
|
2732
2754
|
prefix: '8b8050ca-1f44-4860-bad3-20e646c0d68f',
|
|
2733
2755
|
key: configuration.key
|
|
2734
2756
|
});
|
|
2735
|
-
if (!__classPrivateFieldGet(this, _cache$
|
|
2757
|
+
if (!__classPrivateFieldGet(this, _cache$4)[key]) {
|
|
2736
2758
|
if ((configuration === null || configuration === void 0 ? void 0 : configuration.storage) === 'server') {
|
|
2737
|
-
__classPrivateFieldGet(this, _cache$
|
|
2759
|
+
__classPrivateFieldGet(this, _cache$4)[key] = this.settingService.createServer(key, {
|
|
2738
2760
|
args: (_a = configuration === null || configuration === void 0 ? void 0 : configuration.systemColumn) === null || _a === void 0 ? void 0 : _a.args,
|
|
2739
2761
|
default: []
|
|
2740
2762
|
});
|
|
2741
2763
|
}
|
|
2742
2764
|
else {
|
|
2743
|
-
__classPrivateFieldGet(this, _cache$
|
|
2765
|
+
__classPrivateFieldGet(this, _cache$4)[key] = this.settingService.create(key, {
|
|
2744
2766
|
type: configuration === null || configuration === void 0 ? void 0 : configuration.storage,
|
|
2745
2767
|
args: (_b = configuration === null || configuration === void 0 ? void 0 : configuration.systemColumn) === null || _b === void 0 ? void 0 : _b.args,
|
|
2746
2768
|
default: []
|
|
2747
2769
|
});
|
|
2748
2770
|
}
|
|
2749
2771
|
}
|
|
2750
|
-
return __classPrivateFieldGet(this, _cache$
|
|
2772
|
+
return __classPrivateFieldGet(this, _cache$4)[key];
|
|
2751
2773
|
};
|
|
2752
2774
|
}
|
|
2753
2775
|
}
|
|
2754
|
-
_cache$
|
|
2776
|
+
_cache$4 = new WeakMap();
|
|
2755
2777
|
SdGeneratedColumnService.decorators = [
|
|
2756
2778
|
{ type: Injectable }
|
|
2757
2779
|
];
|
|
@@ -2926,7 +2948,7 @@ class SdEditorHandlerRowPipe {
|
|
|
2926
2948
|
item.editorHandlerRow = Object.assign(Object.assign({}, item.editorHandlerRow), { visible: false, editable: !status, removable: false, savable: false, cancelable: false });
|
|
2927
2949
|
}
|
|
2928
2950
|
const { sdId, editorHandlerColumn } = item, remain = __rest(item, ["sdId", "editorHandlerColumn"]);
|
|
2929
|
-
item.sdId =
|
|
2951
|
+
item.sdId = hash__default(remain);
|
|
2930
2952
|
return item.editorHandlerRow;
|
|
2931
2953
|
}
|
|
2932
2954
|
}
|
|
@@ -2964,7 +2986,7 @@ class SdEditorHandlerColumnPipe {
|
|
|
2964
2986
|
item.editorHandlerColumn[col.field] = Object.assign(Object.assign({}, item.editorHandlerColumn[col.field]), { visible: __classPrivateFieldGet(this, _visible).call(this, col, item) });
|
|
2965
2987
|
}
|
|
2966
2988
|
const { sdId, editorHandlerColumn } = item, remain = __rest(item, ["sdId", "editorHandlerColumn"]);
|
|
2967
|
-
item.sdId =
|
|
2989
|
+
item.sdId = hash__default(remain);
|
|
2968
2990
|
return true;
|
|
2969
2991
|
}
|
|
2970
2992
|
}
|
|
@@ -3103,7 +3125,7 @@ class SdSelectionVisiblePipe {
|
|
|
3103
3125
|
let flag = false;
|
|
3104
3126
|
for (const childAction of action.children) {
|
|
3105
3127
|
const { hidden } = childAction;
|
|
3106
|
-
const key =
|
|
3128
|
+
const key = hash__default(childAction);
|
|
3107
3129
|
if (typeof (hidden) === 'function') {
|
|
3108
3130
|
if (!hidden(rowData)) {
|
|
3109
3131
|
rowData.actions.push(key);
|
|
@@ -3116,12 +3138,12 @@ class SdSelectionVisiblePipe {
|
|
|
3116
3138
|
}
|
|
3117
3139
|
}
|
|
3118
3140
|
if (flag) {
|
|
3119
|
-
rowData.actions.push(
|
|
3141
|
+
rowData.actions.push(hash__default(action));
|
|
3120
3142
|
}
|
|
3121
3143
|
}
|
|
3122
3144
|
else {
|
|
3123
3145
|
const { hidden } = action;
|
|
3124
|
-
const key =
|
|
3146
|
+
const key = hash__default(action);
|
|
3125
3147
|
if (typeof (hidden) === 'function') {
|
|
3126
3148
|
if (!hidden(rowData)) {
|
|
3127
3149
|
rowData.actions.push(key);
|
|
@@ -3147,7 +3169,7 @@ class SdIdPipe {
|
|
|
3147
3169
|
transform(value, item, column) {
|
|
3148
3170
|
const { sdId, editorHandlerColumn } = item, remain = __rest(item, ["sdId", "editorHandlerColumn"]);
|
|
3149
3171
|
item.editorHandlerColumn = item.editorHandlerColumn || {};
|
|
3150
|
-
item.sdId =
|
|
3172
|
+
item.sdId = hash__default(remain);
|
|
3151
3173
|
item.editorHandlerColumn[column.field] = Object.assign({}, item.editorHandlerColumn[column.field]);
|
|
3152
3174
|
return item.sdId;
|
|
3153
3175
|
}
|
|
@@ -3183,9 +3205,9 @@ SdGridQuickAction.propDecorators = {
|
|
|
3183
3205
|
|
|
3184
3206
|
var _maxSecond, _maxMinute, _maxHour, _maxDay, _maxMonth, _isMobileOrTablet$1;
|
|
3185
3207
|
class SdCellViewPipe {
|
|
3186
|
-
constructor(deviceService, utilityService,
|
|
3208
|
+
constructor(deviceService, utilityService, columnValuesPipe) {
|
|
3187
3209
|
this.utilityService = utilityService;
|
|
3188
|
-
this.
|
|
3210
|
+
this.columnValuesPipe = columnValuesPipe;
|
|
3189
3211
|
_maxSecond.set(this, 60);
|
|
3190
3212
|
_maxMinute.set(this, __classPrivateFieldGet(this, _maxSecond) * 60);
|
|
3191
3213
|
_maxHour.set(this, __classPrivateFieldGet(this, _maxMinute) * 24);
|
|
@@ -3195,7 +3217,7 @@ class SdCellViewPipe {
|
|
|
3195
3217
|
__classPrivateFieldSet(this, _isMobileOrTablet$1, !deviceService.isDesktop());
|
|
3196
3218
|
}
|
|
3197
3219
|
transform(value, rowData, column, gridOption, key) {
|
|
3198
|
-
var _a
|
|
3220
|
+
var _a;
|
|
3199
3221
|
return __awaiter(this, void 0, void 0, function* () {
|
|
3200
3222
|
const { displayOnEmpty } = gridOption;
|
|
3201
3223
|
const { align, click, tooltip, htmlTemplate, transform } = column;
|
|
@@ -3259,8 +3281,7 @@ class SdCellViewPipe {
|
|
|
3259
3281
|
result.display.value = Date.toFormat(value, 'HH:mm');
|
|
3260
3282
|
}
|
|
3261
3283
|
if (column.type === 'values') {
|
|
3262
|
-
|
|
3263
|
-
result.display.value = (_c = (_a = data.obj[value]) === null || _a === void 0 ? void 0 : _a[(_b = column.option) === null || _b === void 0 ? void 0 : _b.displayField]) !== null && _c !== void 0 ? _c : value;
|
|
3284
|
+
result.display.value = yield this.columnValuesPipe.transform(value, column);
|
|
3264
3285
|
}
|
|
3265
3286
|
else if (column.type === 'number' && Number.isNumber(value)) {
|
|
3266
3287
|
result.display.value = Number.toVNCurrency(value);
|
|
@@ -3286,7 +3307,7 @@ class SdCellViewPipe {
|
|
|
3286
3307
|
result.badge = {
|
|
3287
3308
|
type: !(column === null || column === void 0 ? void 0 : column.badgeType) ? 'round' : column.badgeType,
|
|
3288
3309
|
color: column.badge(value, rowData),
|
|
3289
|
-
icon: (
|
|
3310
|
+
icon: (_a = column === null || column === void 0 ? void 0 : column.badgeIcon) === null || _a === void 0 ? void 0 : _a.call(column, value, rowData)
|
|
3290
3311
|
};
|
|
3291
3312
|
}
|
|
3292
3313
|
else if (column.type === 'bool') {
|
|
@@ -3317,7 +3338,7 @@ SdCellViewPipe.decorators = [
|
|
|
3317
3338
|
SdCellViewPipe.ctorParameters = () => [
|
|
3318
3339
|
{ type: DeviceDetectorService },
|
|
3319
3340
|
{ type: SdUtilityService },
|
|
3320
|
-
{ type:
|
|
3341
|
+
{ type: SdColumnValuesPipe }
|
|
3321
3342
|
];
|
|
3322
3343
|
|
|
3323
3344
|
class MatPaginatorIntlCro extends MatPaginatorIntl {
|
|
@@ -3436,6 +3457,7 @@ SdGridMaterialModule.decorators = [
|
|
|
3436
3457
|
SdGridFilterService,
|
|
3437
3458
|
SdGridConfigurationService,
|
|
3438
3459
|
SdGeneratedColumnService,
|
|
3460
|
+
SdColumnValuesPipe,
|
|
3439
3461
|
{
|
|
3440
3462
|
provide: MatPaginatorIntl, useClass: MatPaginatorIntlCro
|
|
3441
3463
|
}
|
|
@@ -3447,5 +3469,5 @@ SdGridMaterialModule.decorators = [
|
|
|
3447
3469
|
* Generated bundle index. Do not edit.
|
|
3448
3470
|
*/
|
|
3449
3471
|
|
|
3450
|
-
export { SdGridMaterial, SdGridMaterialModule, SdMaterialCellDefDirective, SdMaterialEmptyDataDefDirective, SdMaterialFilterDefDirective, SdMaterialFooterDefDirective, SdMaterialSubInformationDefDirective, MatPaginatorIntlCro as ɵa, SdGridFilter as ɵb, SdCommandTitlePipe as ɵba,
|
|
3472
|
+
export { SdGridMaterial, SdGridMaterialModule, SdMaterialCellDefDirective, SdMaterialEmptyDataDefDirective, SdMaterialFilterDefDirective, SdMaterialFooterDefDirective, SdMaterialSubInformationDefDirective, MatPaginatorIntlCro as ɵa, SdGridFilter as ɵb, SdCommandTitlePipe as ɵba, SdColumnHtmlTemplatePipe as ɵbb, SdColumnTransformPipe as ɵbc, SdGridService as ɵbd, SdColumnTooltipPipe as ɵbe, SdColumnBadgePipe as ɵbf, SdFilterColumnPipe as ɵbg, SdFilterExternalPipe as ɵbh, SdSelectionActionFilterPipe as ɵbi, SdSelectionVisiblePipe as ɵbj, SdSelectionDisablePipe as ɵbk, SdSelectionVisibleSelectAllPipe as ɵbl, SdEditorHandlerRowPipe as ɵbm, SdEditorHandlerColumnPipe as ɵbn, SdEditorValidatePipe as ɵbo, SdIdPipe as ɵbp, SdStyleRowCss as ɵbq, SdCellViewPipe as ɵbr, SdPopupFilter as ɵc, SdGridFilterService as ɵd, SdPopupExport as ɵe, GRID_MATERIAL_CONFIG as ɵg, SdGridConfigurationService as ɵh, SdColumnValuesPipe as ɵi, SdGridQuickAction as ɵj, SdDesktopCell as ɵk, SdDesktopCellEditor as ɵl, SdDesktopEditorValidation as ɵm, SdDesktopCellView as ɵn, SdDesktopCellChildrenView as ɵo, SdDesktopCommand as ɵp, SdColumnInlineFilter as ɵq, SdPopupGridConfiguration as ɵr, SdDynamicColumn as ɵs, SdGeneratedColumnService as ɵt, SdGridConfigurationResultPipe as ɵu, SdColumnChildrenFilterPipe as ɵv, SdColumnTitlePipe as ɵw, SdCommandFilterPipe as ɵx, SdCommandDisablePipe as ɵy, SdCommandIconPipe as ɵz };
|
|
3451
3473
|
//# sourceMappingURL=sd-angular-core-grid-material.js.map
|