@sd-angular/core 1.0.45 → 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/bundles/sd-angular-core-grid-material.umd.js +372 -292
- package/bundles/sd-angular-core-grid-material.umd.js.map +1 -1
- package/bundles/sd-angular-core-grid-material.umd.min.js +2 -2
- package/bundles/sd-angular-core-grid-material.umd.min.js.map +1 -1
- package/esm2015/grid-material/sd-angular-core-grid-material.js +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 +17 -21
- 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/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/fesm2015/sd-angular-core-grid-material.js +150 -131
- package/fesm2015/sd-angular-core-grid-material.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 +3 -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/{sd-angular-core-1.0.45.tgz → sd-angular-core-1.0.46.tgz} +0 -0
|
@@ -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) {
|
|
@@ -2007,7 +1990,7 @@ SdGridMaterial.ctorParameters = () => [
|
|
|
2007
1990
|
{ type: SdExportService },
|
|
2008
1991
|
{ type: SdNotifyService },
|
|
2009
1992
|
{ type: SdTranslateService },
|
|
2010
|
-
{ type:
|
|
1993
|
+
{ type: SdColumnValuesPipe }
|
|
2011
1994
|
];
|
|
2012
1995
|
SdGridMaterial.propDecorators = {
|
|
2013
1996
|
quickAction: [{ type: ViewChild, args: [SdQuickAction,] }],
|
|
@@ -2151,25 +2134,6 @@ SdCommandTitlePipe.decorators = [
|
|
|
2151
2134
|
},] }
|
|
2152
2135
|
];
|
|
2153
2136
|
|
|
2154
|
-
class SdColumnValuesPipe {
|
|
2155
|
-
constructor(gridService) {
|
|
2156
|
-
this.gridService = gridService;
|
|
2157
|
-
this.transform = (value, column, key) => __awaiter(this, void 0, void 0, function* () {
|
|
2158
|
-
var _a;
|
|
2159
|
-
const data = yield this.gridService.loadValues(column, key);
|
|
2160
|
-
return (_a = data.obj[value]) !== null && _a !== void 0 ? _a : value;
|
|
2161
|
-
});
|
|
2162
|
-
}
|
|
2163
|
-
}
|
|
2164
|
-
SdColumnValuesPipe.decorators = [
|
|
2165
|
-
{ type: Pipe, args: [{
|
|
2166
|
-
name: 'columnValues'
|
|
2167
|
-
},] }
|
|
2168
|
-
];
|
|
2169
|
-
SdColumnValuesPipe.ctorParameters = () => [
|
|
2170
|
-
{ type: SdGridService }
|
|
2171
|
-
];
|
|
2172
|
-
|
|
2173
2137
|
class SdColumnHtmlTemplatePipe {
|
|
2174
2138
|
constructor(deviceService) {
|
|
2175
2139
|
this.isMobileOrTablet = false;
|
|
@@ -2211,6 +2175,61 @@ SdDesktopCellView.propDecorators = {
|
|
|
2211
2175
|
gridOption: [{ type: Input }]
|
|
2212
2176
|
};
|
|
2213
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
|
+
|
|
2214
2233
|
class SdColumnTransformPipe {
|
|
2215
2234
|
constructor(gridService) {
|
|
2216
2235
|
this.gridService = gridService;
|
|
@@ -2300,7 +2319,7 @@ class SdDesktopCellChildrenView {
|
|
|
2300
2319
|
SdDesktopCellChildrenView.decorators = [
|
|
2301
2320
|
{ type: Component, args: [{
|
|
2302
2321
|
selector: 'sd-desktop-cell-children-view',
|
|
2303
|
-
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>",
|
|
2304
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}"]
|
|
2305
2324
|
},] }
|
|
2306
2325
|
];
|
|
@@ -2437,7 +2456,7 @@ SdGridConfigurationResultPipe.ctorParameters = () => [
|
|
|
2437
2456
|
{ type: SdGridConfigurationService }
|
|
2438
2457
|
];
|
|
2439
2458
|
|
|
2440
|
-
var _cache$
|
|
2459
|
+
var _cache$3;
|
|
2441
2460
|
class SdPopupGridConfiguration {
|
|
2442
2461
|
constructor(ref, notifyService, translateService, gridConfigurationService) {
|
|
2443
2462
|
this.ref = ref;
|
|
@@ -2445,24 +2464,24 @@ class SdPopupGridConfiguration {
|
|
|
2445
2464
|
this.translateService = translateService;
|
|
2446
2465
|
this.gridConfigurationService = gridConfigurationService;
|
|
2447
2466
|
this.changes = new EventEmitter();
|
|
2448
|
-
_cache$
|
|
2467
|
+
_cache$3.set(this, void 0);
|
|
2449
2468
|
this.isCreatingColumn = false;
|
|
2450
2469
|
this.selected = {};
|
|
2451
2470
|
this.disabledDrag = true;
|
|
2452
2471
|
this.open = () => __awaiter(this, void 0, void 0, function* () {
|
|
2453
|
-
__classPrivateFieldSet(this, _cache$
|
|
2454
|
-
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();
|
|
2455
2474
|
this.modal.open();
|
|
2456
2475
|
});
|
|
2457
2476
|
this.onSave = () => {
|
|
2458
|
-
__classPrivateFieldGet(this, _cache$
|
|
2477
|
+
__classPrivateFieldGet(this, _cache$3).set(this.configuration);
|
|
2459
2478
|
this.modal.close();
|
|
2460
2479
|
this.ref.detectChanges();
|
|
2461
2480
|
};
|
|
2462
2481
|
this.onReset = () => __awaiter(this, void 0, void 0, function* () {
|
|
2463
2482
|
const { translate } = this.translateService;
|
|
2464
2483
|
this.notifyService.confirm(translate('Reset grid configuration to default')).then(() => {
|
|
2465
|
-
__classPrivateFieldGet(this, _cache$
|
|
2484
|
+
__classPrivateFieldGet(this, _cache$3).remove();
|
|
2466
2485
|
this.modal.close();
|
|
2467
2486
|
this.ref.detectChanges();
|
|
2468
2487
|
});
|
|
@@ -2486,7 +2505,7 @@ class SdPopupGridConfiguration {
|
|
|
2486
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; })
|
|
2487
2506
|
};
|
|
2488
2507
|
this.configuration.columns.push(generatedColumn);
|
|
2489
|
-
this.configuration = __classPrivateFieldGet(this, _cache$
|
|
2508
|
+
this.configuration = __classPrivateFieldGet(this, _cache$3).set(this.configuration);
|
|
2490
2509
|
this.isCreatingColumn = false;
|
|
2491
2510
|
});
|
|
2492
2511
|
}
|
|
@@ -2506,7 +2525,7 @@ class SdPopupGridConfiguration {
|
|
|
2506
2525
|
this.disabledDrag = true;
|
|
2507
2526
|
}
|
|
2508
2527
|
}
|
|
2509
|
-
_cache$
|
|
2528
|
+
_cache$3 = new WeakMap();
|
|
2510
2529
|
SdPopupGridConfiguration.decorators = [
|
|
2511
2530
|
{ type: Component, args: [{
|
|
2512
2531
|
selector: 'sd-popup-grid-configuration',
|
|
@@ -2586,7 +2605,7 @@ class SdSelectionActionFilterPipe {
|
|
|
2586
2605
|
if ('children' in action) {
|
|
2587
2606
|
const children = [];
|
|
2588
2607
|
for (const childAction of action.children) {
|
|
2589
|
-
const key =
|
|
2608
|
+
const key = hash__default(childAction);
|
|
2590
2609
|
if (selectedItems.every(e => e.actions.includes(key))) {
|
|
2591
2610
|
children.push(childAction);
|
|
2592
2611
|
}
|
|
@@ -2596,7 +2615,7 @@ class SdSelectionActionFilterPipe {
|
|
|
2596
2615
|
}
|
|
2597
2616
|
}
|
|
2598
2617
|
else {
|
|
2599
|
-
const key =
|
|
2618
|
+
const key = hash__default(action);
|
|
2600
2619
|
if (selectedItems.every(e => e.actions.includes(key))) {
|
|
2601
2620
|
results.push(action);
|
|
2602
2621
|
}
|
|
@@ -2629,7 +2648,7 @@ class SdSelectionDisablePipe {
|
|
|
2629
2648
|
const availableActions = actions.filter(action => {
|
|
2630
2649
|
if ('children' in action) {
|
|
2631
2650
|
for (const childAction of action.children) {
|
|
2632
|
-
const key =
|
|
2651
|
+
const key = hash__default(childAction);
|
|
2633
2652
|
if (selectedItems.every(e => e.actions.includes(key))) {
|
|
2634
2653
|
return true;
|
|
2635
2654
|
}
|
|
@@ -2637,7 +2656,7 @@ class SdSelectionDisablePipe {
|
|
|
2637
2656
|
return false;
|
|
2638
2657
|
}
|
|
2639
2658
|
else {
|
|
2640
|
-
const key =
|
|
2659
|
+
const key = hash__default(action);
|
|
2641
2660
|
return selectedItems.every(e => e.actions.includes(key));
|
|
2642
2661
|
}
|
|
2643
2662
|
});
|
|
@@ -2645,13 +2664,13 @@ class SdSelectionDisablePipe {
|
|
|
2645
2664
|
for (const action of availableActions) {
|
|
2646
2665
|
if ('children' in action) {
|
|
2647
2666
|
for (const childAction of action.children) {
|
|
2648
|
-
if (rowData.actions.includes(
|
|
2667
|
+
if (rowData.actions.includes(hash__default(childAction))) {
|
|
2649
2668
|
return false;
|
|
2650
2669
|
}
|
|
2651
2670
|
}
|
|
2652
2671
|
}
|
|
2653
2672
|
else {
|
|
2654
|
-
if (rowData.actions.includes(
|
|
2673
|
+
if (rowData.actions.includes(hash__default(action))) {
|
|
2655
2674
|
return false;
|
|
2656
2675
|
}
|
|
2657
2676
|
}
|
|
@@ -2693,35 +2712,35 @@ SdSelectionVisibleSelectAllPipe.decorators = [
|
|
|
2693
2712
|
},] }
|
|
2694
2713
|
];
|
|
2695
2714
|
|
|
2696
|
-
var _cache$
|
|
2715
|
+
var _cache$4;
|
|
2697
2716
|
class SdGeneratedColumnService {
|
|
2698
2717
|
constructor(settingService) {
|
|
2699
2718
|
this.settingService = settingService;
|
|
2700
|
-
_cache$
|
|
2719
|
+
_cache$4.set(this, {});
|
|
2701
2720
|
this.load = (configuration) => {
|
|
2702
2721
|
if (!(configuration === null || configuration === void 0 ? void 0 : configuration.key)) {
|
|
2703
2722
|
return null;
|
|
2704
2723
|
}
|
|
2705
|
-
const key =
|
|
2724
|
+
const key = hash__default({
|
|
2706
2725
|
prefix: '260f5e94-5865-4425-8ced-b9c083c390dd',
|
|
2707
2726
|
key: configuration.key
|
|
2708
2727
|
});
|
|
2709
|
-
if (!__classPrivateFieldGet(this, _cache$
|
|
2728
|
+
if (!__classPrivateFieldGet(this, _cache$4)[key]) {
|
|
2710
2729
|
if ((configuration === null || configuration === void 0 ? void 0 : configuration.storage) === 'server') {
|
|
2711
|
-
__classPrivateFieldGet(this, _cache$
|
|
2730
|
+
__classPrivateFieldGet(this, _cache$4)[key] = this.settingService.createServer(key, {
|
|
2712
2731
|
args: configuration === null || configuration === void 0 ? void 0 : configuration.args,
|
|
2713
2732
|
default: []
|
|
2714
2733
|
});
|
|
2715
2734
|
}
|
|
2716
2735
|
else {
|
|
2717
|
-
__classPrivateFieldGet(this, _cache$
|
|
2736
|
+
__classPrivateFieldGet(this, _cache$4)[key] = this.settingService.create(key, {
|
|
2718
2737
|
type: configuration === null || configuration === void 0 ? void 0 : configuration.storage,
|
|
2719
2738
|
args: configuration === null || configuration === void 0 ? void 0 : configuration.args,
|
|
2720
2739
|
default: []
|
|
2721
2740
|
});
|
|
2722
2741
|
}
|
|
2723
2742
|
}
|
|
2724
|
-
return __classPrivateFieldGet(this, _cache$
|
|
2743
|
+
return __classPrivateFieldGet(this, _cache$4)[key];
|
|
2725
2744
|
};
|
|
2726
2745
|
this.loadSystem = (configuration) => {
|
|
2727
2746
|
var _a, _b;
|
|
@@ -2731,30 +2750,30 @@ class SdGeneratedColumnService {
|
|
|
2731
2750
|
if (!(configuration === null || configuration === void 0 ? void 0 : configuration.systemColumn)) {
|
|
2732
2751
|
return null;
|
|
2733
2752
|
}
|
|
2734
|
-
const key =
|
|
2753
|
+
const key = hash__default({
|
|
2735
2754
|
prefix: '8b8050ca-1f44-4860-bad3-20e646c0d68f',
|
|
2736
2755
|
key: configuration.key
|
|
2737
2756
|
});
|
|
2738
|
-
if (!__classPrivateFieldGet(this, _cache$
|
|
2757
|
+
if (!__classPrivateFieldGet(this, _cache$4)[key]) {
|
|
2739
2758
|
if ((configuration === null || configuration === void 0 ? void 0 : configuration.storage) === 'server') {
|
|
2740
|
-
__classPrivateFieldGet(this, _cache$
|
|
2759
|
+
__classPrivateFieldGet(this, _cache$4)[key] = this.settingService.createServer(key, {
|
|
2741
2760
|
args: (_a = configuration === null || configuration === void 0 ? void 0 : configuration.systemColumn) === null || _a === void 0 ? void 0 : _a.args,
|
|
2742
2761
|
default: []
|
|
2743
2762
|
});
|
|
2744
2763
|
}
|
|
2745
2764
|
else {
|
|
2746
|
-
__classPrivateFieldGet(this, _cache$
|
|
2765
|
+
__classPrivateFieldGet(this, _cache$4)[key] = this.settingService.create(key, {
|
|
2747
2766
|
type: configuration === null || configuration === void 0 ? void 0 : configuration.storage,
|
|
2748
2767
|
args: (_b = configuration === null || configuration === void 0 ? void 0 : configuration.systemColumn) === null || _b === void 0 ? void 0 : _b.args,
|
|
2749
2768
|
default: []
|
|
2750
2769
|
});
|
|
2751
2770
|
}
|
|
2752
2771
|
}
|
|
2753
|
-
return __classPrivateFieldGet(this, _cache$
|
|
2772
|
+
return __classPrivateFieldGet(this, _cache$4)[key];
|
|
2754
2773
|
};
|
|
2755
2774
|
}
|
|
2756
2775
|
}
|
|
2757
|
-
_cache$
|
|
2776
|
+
_cache$4 = new WeakMap();
|
|
2758
2777
|
SdGeneratedColumnService.decorators = [
|
|
2759
2778
|
{ type: Injectable }
|
|
2760
2779
|
];
|
|
@@ -2929,7 +2948,7 @@ class SdEditorHandlerRowPipe {
|
|
|
2929
2948
|
item.editorHandlerRow = Object.assign(Object.assign({}, item.editorHandlerRow), { visible: false, editable: !status, removable: false, savable: false, cancelable: false });
|
|
2930
2949
|
}
|
|
2931
2950
|
const { sdId, editorHandlerColumn } = item, remain = __rest(item, ["sdId", "editorHandlerColumn"]);
|
|
2932
|
-
item.sdId =
|
|
2951
|
+
item.sdId = hash__default(remain);
|
|
2933
2952
|
return item.editorHandlerRow;
|
|
2934
2953
|
}
|
|
2935
2954
|
}
|
|
@@ -2967,7 +2986,7 @@ class SdEditorHandlerColumnPipe {
|
|
|
2967
2986
|
item.editorHandlerColumn[col.field] = Object.assign(Object.assign({}, item.editorHandlerColumn[col.field]), { visible: __classPrivateFieldGet(this, _visible).call(this, col, item) });
|
|
2968
2987
|
}
|
|
2969
2988
|
const { sdId, editorHandlerColumn } = item, remain = __rest(item, ["sdId", "editorHandlerColumn"]);
|
|
2970
|
-
item.sdId =
|
|
2989
|
+
item.sdId = hash__default(remain);
|
|
2971
2990
|
return true;
|
|
2972
2991
|
}
|
|
2973
2992
|
}
|
|
@@ -3106,7 +3125,7 @@ class SdSelectionVisiblePipe {
|
|
|
3106
3125
|
let flag = false;
|
|
3107
3126
|
for (const childAction of action.children) {
|
|
3108
3127
|
const { hidden } = childAction;
|
|
3109
|
-
const key =
|
|
3128
|
+
const key = hash__default(childAction);
|
|
3110
3129
|
if (typeof (hidden) === 'function') {
|
|
3111
3130
|
if (!hidden(rowData)) {
|
|
3112
3131
|
rowData.actions.push(key);
|
|
@@ -3119,12 +3138,12 @@ class SdSelectionVisiblePipe {
|
|
|
3119
3138
|
}
|
|
3120
3139
|
}
|
|
3121
3140
|
if (flag) {
|
|
3122
|
-
rowData.actions.push(
|
|
3141
|
+
rowData.actions.push(hash__default(action));
|
|
3123
3142
|
}
|
|
3124
3143
|
}
|
|
3125
3144
|
else {
|
|
3126
3145
|
const { hidden } = action;
|
|
3127
|
-
const key =
|
|
3146
|
+
const key = hash__default(action);
|
|
3128
3147
|
if (typeof (hidden) === 'function') {
|
|
3129
3148
|
if (!hidden(rowData)) {
|
|
3130
3149
|
rowData.actions.push(key);
|
|
@@ -3150,7 +3169,7 @@ class SdIdPipe {
|
|
|
3150
3169
|
transform(value, item, column) {
|
|
3151
3170
|
const { sdId, editorHandlerColumn } = item, remain = __rest(item, ["sdId", "editorHandlerColumn"]);
|
|
3152
3171
|
item.editorHandlerColumn = item.editorHandlerColumn || {};
|
|
3153
|
-
item.sdId =
|
|
3172
|
+
item.sdId = hash__default(remain);
|
|
3154
3173
|
item.editorHandlerColumn[column.field] = Object.assign({}, item.editorHandlerColumn[column.field]);
|
|
3155
3174
|
return item.sdId;
|
|
3156
3175
|
}
|
|
@@ -3186,9 +3205,9 @@ SdGridQuickAction.propDecorators = {
|
|
|
3186
3205
|
|
|
3187
3206
|
var _maxSecond, _maxMinute, _maxHour, _maxDay, _maxMonth, _isMobileOrTablet$1;
|
|
3188
3207
|
class SdCellViewPipe {
|
|
3189
|
-
constructor(deviceService, utilityService,
|
|
3208
|
+
constructor(deviceService, utilityService, columnValuesPipe) {
|
|
3190
3209
|
this.utilityService = utilityService;
|
|
3191
|
-
this.
|
|
3210
|
+
this.columnValuesPipe = columnValuesPipe;
|
|
3192
3211
|
_maxSecond.set(this, 60);
|
|
3193
3212
|
_maxMinute.set(this, __classPrivateFieldGet(this, _maxSecond) * 60);
|
|
3194
3213
|
_maxHour.set(this, __classPrivateFieldGet(this, _maxMinute) * 24);
|
|
@@ -3198,7 +3217,7 @@ class SdCellViewPipe {
|
|
|
3198
3217
|
__classPrivateFieldSet(this, _isMobileOrTablet$1, !deviceService.isDesktop());
|
|
3199
3218
|
}
|
|
3200
3219
|
transform(value, rowData, column, gridOption, key) {
|
|
3201
|
-
var _a
|
|
3220
|
+
var _a;
|
|
3202
3221
|
return __awaiter(this, void 0, void 0, function* () {
|
|
3203
3222
|
const { displayOnEmpty } = gridOption;
|
|
3204
3223
|
const { align, click, tooltip, htmlTemplate, transform } = column;
|
|
@@ -3262,8 +3281,7 @@ class SdCellViewPipe {
|
|
|
3262
3281
|
result.display.value = Date.toFormat(value, 'HH:mm');
|
|
3263
3282
|
}
|
|
3264
3283
|
if (column.type === 'values') {
|
|
3265
|
-
|
|
3266
|
-
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);
|
|
3267
3285
|
}
|
|
3268
3286
|
else if (column.type === 'number' && Number.isNumber(value)) {
|
|
3269
3287
|
result.display.value = Number.toVNCurrency(value);
|
|
@@ -3289,7 +3307,7 @@ class SdCellViewPipe {
|
|
|
3289
3307
|
result.badge = {
|
|
3290
3308
|
type: !(column === null || column === void 0 ? void 0 : column.badgeType) ? 'round' : column.badgeType,
|
|
3291
3309
|
color: column.badge(value, rowData),
|
|
3292
|
-
icon: (
|
|
3310
|
+
icon: (_a = column === null || column === void 0 ? void 0 : column.badgeIcon) === null || _a === void 0 ? void 0 : _a.call(column, value, rowData)
|
|
3293
3311
|
};
|
|
3294
3312
|
}
|
|
3295
3313
|
else if (column.type === 'bool') {
|
|
@@ -3320,7 +3338,7 @@ SdCellViewPipe.decorators = [
|
|
|
3320
3338
|
SdCellViewPipe.ctorParameters = () => [
|
|
3321
3339
|
{ type: DeviceDetectorService },
|
|
3322
3340
|
{ type: SdUtilityService },
|
|
3323
|
-
{ type:
|
|
3341
|
+
{ type: SdColumnValuesPipe }
|
|
3324
3342
|
];
|
|
3325
3343
|
|
|
3326
3344
|
class MatPaginatorIntlCro extends MatPaginatorIntl {
|
|
@@ -3439,6 +3457,7 @@ SdGridMaterialModule.decorators = [
|
|
|
3439
3457
|
SdGridFilterService,
|
|
3440
3458
|
SdGridConfigurationService,
|
|
3441
3459
|
SdGeneratedColumnService,
|
|
3460
|
+
SdColumnValuesPipe,
|
|
3442
3461
|
{
|
|
3443
3462
|
provide: MatPaginatorIntl, useClass: MatPaginatorIntlCro
|
|
3444
3463
|
}
|
|
@@ -3450,5 +3469,5 @@ SdGridMaterialModule.decorators = [
|
|
|
3450
3469
|
* Generated bundle index. Do not edit.
|
|
3451
3470
|
*/
|
|
3452
3471
|
|
|
3453
|
-
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 };
|
|
3454
3473
|
//# sourceMappingURL=sd-angular-core-grid-material.js.map
|