@sd-angular/core 1.0.5 → 1.0.9

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.
Files changed (25) hide show
  1. package/bundles/sd-angular-core-grid-material.umd.js +149 -7
  2. package/bundles/sd-angular-core-grid-material.umd.js.map +1 -1
  3. package/bundles/sd-angular-core-grid-material.umd.min.js +2 -2
  4. package/bundles/sd-angular-core-grid-material.umd.min.js.map +1 -1
  5. package/esm2015/grid-material/sd-angular-core-grid-material.js +2 -1
  6. package/esm2015/grid-material/src/lib/components/desktop-cell/desktop-cell.component.js +2 -2
  7. package/esm2015/grid-material/src/lib/components/desktop-cell-editor/desktop-cell-editor.component.js +2 -2
  8. package/esm2015/grid-material/src/lib/components/desktop-cell-view/desktop-cell-view.component.js +5 -4
  9. package/esm2015/grid-material/src/lib/components/grid-filter/grid-filter.component.js +2 -2
  10. package/esm2015/grid-material/src/lib/grid-material.module.js +4 -2
  11. package/esm2015/grid-material/src/lib/models/grid-cell.model.js +2 -0
  12. package/esm2015/grid-material/src/lib/models/grid-column.model.js +1 -1
  13. package/esm2015/grid-material/src/lib/models/grid-option.model.js +1 -1
  14. package/esm2015/grid-material/src/lib/pipes/cell-view.pipe.js +131 -0
  15. package/fesm2015/sd-angular-core-grid-material.js +136 -8
  16. package/fesm2015/sd-angular-core-grid-material.js.map +1 -1
  17. package/grid-material/sd-angular-core-grid-material.d.ts +1 -0
  18. package/grid-material/sd-angular-core-grid-material.metadata.json +1 -1
  19. package/grid-material/src/lib/components/desktop-cell-view/desktop-cell-view.component.d.ts +2 -0
  20. package/grid-material/src/lib/models/grid-cell.model.d.ts +15 -0
  21. package/grid-material/src/lib/models/grid-column.model.d.ts +1 -0
  22. package/grid-material/src/lib/models/grid-option.model.d.ts +1 -0
  23. package/grid-material/src/lib/pipes/cell-view.pipe.d.ts +14 -0
  24. package/package.json +1 -1
  25. package/{sd-angular-core-1.0.5.tgz → sd-angular-core-1.0.9.tgz} +0 -0
@@ -0,0 +1,131 @@
1
+ var _maxSecond, _maxMinute, _maxHour, _maxDay, _maxMonth, _isMobileOrTablet;
2
+ import { __awaiter, __classPrivateFieldGet, __classPrivateFieldSet } from "tslib";
3
+ import { Pipe } from '@angular/core';
4
+ import { SdUtilityService } from '@sd-angular/core/utility';
5
+ import { DeviceDetectorService } from 'ngx-device-detector';
6
+ import { SdGridService } from '../services/grid.service';
7
+ export class SdCellViewPipe {
8
+ constructor(deviceService, utilityService, gridService) {
9
+ this.utilityService = utilityService;
10
+ this.gridService = gridService;
11
+ _maxSecond.set(this, 60);
12
+ _maxMinute.set(this, __classPrivateFieldGet(this, _maxSecond) * 60);
13
+ _maxHour.set(this, __classPrivateFieldGet(this, _maxMinute) * 24);
14
+ _maxDay.set(this, __classPrivateFieldGet(this, _maxHour) * 30);
15
+ _maxMonth.set(this, __classPrivateFieldGet(this, _maxHour) * 365);
16
+ _isMobileOrTablet.set(this, false);
17
+ __classPrivateFieldSet(this, _isMobileOrTablet, !deviceService.isDesktop());
18
+ }
19
+ transform(value, rowData, column, gridOption, key) {
20
+ var _a, _b, _c, _d;
21
+ return __awaiter(this, void 0, void 0, function* () {
22
+ const { displayOnEmpty } = gridOption;
23
+ const { align, click, tooltip, htmlTemplate, transform } = column;
24
+ const result = {
25
+ badge: null,
26
+ tooltip: null,
27
+ display: {
28
+ align: align || (column.type === 'number' ? 'right' : 'left'),
29
+ value
30
+ },
31
+ click: null
32
+ };
33
+ // Display
34
+ if (typeof (htmlTemplate) === 'function') {
35
+ result.display.html = htmlTemplate(value, rowData, __classPrivateFieldGet(this, _isMobileOrTablet));
36
+ }
37
+ else {
38
+ if (transform) {
39
+ result.display.value = transform(value, rowData);
40
+ }
41
+ else {
42
+ if (column.type === 'date' || column.type === 'datetime') {
43
+ const { option } = column;
44
+ const seconds = Math.round((new Date().getTime() - new Date(value).getTime()) / 1000);
45
+ if ((option === null || option === void 0 ? void 0 : option.timeDifferent) === 'month' && seconds < __classPrivateFieldGet(this, _maxMonth)) {
46
+ result.display.value = this.utilityService.timeDifference(value);
47
+ result.tooltip = Date.toFormat(value, column.type === 'date' ? 'dd/MM/yyyy' : 'dd/MM/yyyy HH:mm');
48
+ }
49
+ else if ((option === null || option === void 0 ? void 0 : option.timeDifferent) === 'day' && seconds < __classPrivateFieldGet(this, _maxDay)) {
50
+ result.display.value = this.utilityService.timeDifference(value);
51
+ result.tooltip = Date.toFormat(value, column.type === 'date' ? 'dd/MM/yyyy' : 'dd/MM/yyyy HH:mm');
52
+ }
53
+ else if ((option === null || option === void 0 ? void 0 : option.timeDifferent) === 'hour' && seconds < __classPrivateFieldGet(this, _maxHour)) {
54
+ result.display.value = this.utilityService.timeDifference(value);
55
+ result.tooltip = Date.toFormat(value, column.type === 'date' ? 'dd/MM/yyyy' : 'dd/MM/yyyy HH:mm');
56
+ }
57
+ else if ((option === null || option === void 0 ? void 0 : option.timeDifferent) === 'minute' && seconds < __classPrivateFieldGet(this, _maxMinute)) {
58
+ result.display.value = this.utilityService.timeDifference(value);
59
+ result.tooltip = Date.toFormat(value, column.type === 'date' ? 'dd/MM/yyyy' : 'dd/MM/yyyy HH:mm');
60
+ }
61
+ else if ((option === null || option === void 0 ? void 0 : option.timeDifferent) === 'second' && seconds < __classPrivateFieldGet(this, _maxSecond)) {
62
+ result.display.value = this.utilityService.timeDifference(value);
63
+ result.tooltip = Date.toFormat(value, column.type === 'date' ? 'dd/MM/yyyy' : 'dd/MM/yyyy HH:mm');
64
+ }
65
+ else {
66
+ result.display.value = Date.toFormat(value, column.type === 'date' ? 'dd/MM/yyyy' : 'dd/MM/yyyy HH:mm');
67
+ }
68
+ }
69
+ if (column.type === 'time') {
70
+ result.display.value = Date.toFormat(value, 'HH:mm');
71
+ }
72
+ if (column.type === 'values') {
73
+ const data = yield this.gridService.loadValues(column, key);
74
+ 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;
75
+ }
76
+ else if (column.type === 'number' && Number.isNumber(value)) {
77
+ result.display.value = Number.toVNCurrency(value);
78
+ }
79
+ if (column.type === 'bool') {
80
+ const { option } = column;
81
+ result.display.value = value === true ? ((option === null || option === void 0 ? void 0 : option.displayOnTrue) || 'True') : ((option === null || option === void 0 ? void 0 : option.displayOnFalse) || 'False');
82
+ }
83
+ }
84
+ if (displayOnEmpty && (result.display.value === null || result.display.value === undefined || result.display.value === '')) {
85
+ if (typeof (displayOnEmpty) === 'function') {
86
+ result.display.html = displayOnEmpty(rowData, column);
87
+ }
88
+ else {
89
+ result.display.html = `<div class="T16R">--</div>`;
90
+ }
91
+ }
92
+ }
93
+ // Badge
94
+ if ((column.type === 'string' || column.type === 'number' || column.type === 'values') && column.badge) {
95
+ result.badge = {
96
+ type: !(column === null || column === void 0 ? void 0 : column.badgeType) ? 'round' : column.badgeType,
97
+ color: column.badge(value, rowData),
98
+ icon: (_d = column === null || column === void 0 ? void 0 : column.badgeIcon) === null || _d === void 0 ? void 0 : _d.call(column, value, rowData)
99
+ };
100
+ }
101
+ else if (column.type === 'bool') {
102
+ result.badge = {
103
+ type: !(column === null || column === void 0 ? void 0 : column.badgeType) ? 'round' : column.badgeType,
104
+ color: !!value ? 'success' : 'danger',
105
+ icon: null
106
+ };
107
+ }
108
+ // Tooltip
109
+ if (typeof (tooltip) === 'function') {
110
+ result.tooltip = tooltip(value, rowData);
111
+ }
112
+ // Clickable
113
+ if (typeof (click) === 'function') {
114
+ result.click = () => click(value, rowData);
115
+ }
116
+ return result;
117
+ });
118
+ }
119
+ }
120
+ _maxSecond = new WeakMap(), _maxMinute = new WeakMap(), _maxHour = new WeakMap(), _maxDay = new WeakMap(), _maxMonth = new WeakMap(), _isMobileOrTablet = new WeakMap();
121
+ SdCellViewPipe.decorators = [
122
+ { type: Pipe, args: [{
123
+ name: 'cellView'
124
+ },] }
125
+ ];
126
+ SdCellViewPipe.ctorParameters = () => [
127
+ { type: DeviceDetectorService },
128
+ { type: SdUtilityService },
129
+ { type: SdGridService }
130
+ ];
131
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY2VsbC12aWV3LnBpcGUuanMiLCJzb3VyY2VSb290IjoiQzovVXNlcnMvbmdoaWF0dDE1L0Rlc2t0b3AvV29ya2luZy8xTUcvbGliLWNvcmUtdWkvcHJvamVjdHMvc2QtY29yZS9ncmlkLW1hdGVyaWFsLyIsInNvdXJjZXMiOlsic3JjL2xpYi9waXBlcy9jZWxsLXZpZXcucGlwZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOztBQUNBLE9BQU8sRUFBRSxJQUFJLEVBQWlCLE1BQU0sZUFBZSxDQUFDO0FBQ3BELE9BQU8sRUFBRSxnQkFBZ0IsRUFBRSxNQUFNLDBCQUEwQixDQUFDO0FBQzVELE9BQU8sRUFBRSxxQkFBcUIsRUFBRSxNQUFNLHFCQUFxQixDQUFDO0FBSTVELE9BQU8sRUFBRSxhQUFhLEVBQUUsTUFBTSwwQkFBMEIsQ0FBQztBQUl6RCxNQUFNLE9BQU8sY0FBYztJQU96QixZQUNFLGFBQW9DLEVBQzVCLGNBQWdDLEVBQ2hDLFdBQTBCO1FBRDFCLG1CQUFjLEdBQWQsY0FBYyxDQUFrQjtRQUNoQyxnQkFBVyxHQUFYLFdBQVcsQ0FBZTtRQVRwQyxxQkFBYSxFQUFFLEVBQUM7UUFDaEIscUJBQWEsMkNBQWtCLEVBQUUsRUFBQztRQUNsQyxtQkFBVywyQ0FBa0IsRUFBRSxFQUFDO1FBQ2hDLGtCQUFVLHlDQUFnQixFQUFFLEVBQUM7UUFDN0Isb0JBQVkseUNBQWdCLEdBQUcsRUFBQztRQUNoQyw0QkFBb0IsS0FBSyxFQUFDO1FBS3hCLHVCQUFBLElBQUkscUJBQXFCLENBQUMsYUFBYSxDQUFDLFNBQVMsRUFBRSxFQUFDO0lBQ3RELENBQUM7SUFDSyxTQUFTLENBQUM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wgY29sdW1uLnR5cGUgPT09ICdkYXRlJyA/ICdkZC9NTS95eXl5JyA6ICdkZC9NTS95eXl5IEhIOm1tJyk7XHJcbiAgICAgICAgICB9IGVsc2UgaWYgKG9wdGlvbj8udGltZURpZmZlcmVudCA9PT0gJ2RheScgJiYgc2Vjb25kcyA8IHRoaXMuI21heERheSkge1xyXG4gICAgICAgICAgICByZXN1bHQuZGlzcGxheS52YWx1ZSA9IHRoaXMudXRpbGl0eVNlcnZpY2UudGltZURpZmZlcmVuY2UodmFsdWUpO1xyXG4gICAgICAgICAgICByZXN1bHQudG9vbHRpcCA9IERhdGUudG9Gb3JtYXQodmFsdWUsIGNvbHVtbi50eXBlID09PSAnZGF0ZScgPyAnZGQvTU0veXl5eScgOiAnZGQvTU0veXl5eSBISDptbScpO1xyXG4gICAgICAgICAgfSBlbHNlIGlmIChvcHRpb24/LnRpbWVEaWZmZXJlbnQgPT09ICdob3VyJyAmJiBzZWNvbmRzIDwgdGhpcy4jbWF4SG91cikge1xyXG4gICAgICAgICAgICByZXN1bHQuZGlzcGxheS52YWx1ZSA9IHRoaXMudXRpbGl0eVNlcnZpY2UudGltZURpZmZlcmVuY2UodmFsdWUpO1xyXG4gICAgICAgICAgICByZXN1bHQudG9vbHRpcCA9IERhdGUudG9Gb3JtYXQodmFsdWUsIGNvbHVtbi50eXBlID09PSAnZGF0ZScgPyAnZGQvTU0veXl5eScgOiAnZGQvTU0veXl5eSBISDptbScpO1xyXG4gICAgICAgICAgfSBlbHNlIGlmIChvcHRpb24/LnRpbWVEaWZmZXJlbnQgPT09ICdtaW51dGUnICYmIHNlY29uZHMgPCB0aGlzLiNtYXhNaW51dGUpIHtcclxuICAgICAgICAgICAgcmVzdWx0LmRpc3BsYXkudmFsdWUgPSB0aGlzLnV0aWxpdHlTZXJ2aWNlLnRpbWVEaWZmZXJlbmNlKHZhbHVlKTtcclxuICAgICAgICAgICAgcmVzdWx0LnRvb2x0aXAgPSBEYXRlLnRvRm9ybWF0KHZhb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WeakMap(), _subscription = new WeakMap(), _loadDefaul
420
420
  SdGridFilter.decorators = [
421
421
  { type: Component, args: [{
422
422
  selector: 'sd-grid-filter',
423
- template: "<ng-container *ngIf=\"isVisible\">\r\n <div *ngIf=\"!isMobileOrTablet && (columns?.length || externalFilters?.length || filterDefs?.length)\"\r\n class=\"row mx-0 pb-10\">\r\n <ng-container *ngIf=\"filter?.sorts?.length\">\r\n <ng-container *ngFor=\"let field of filter?.sorts\">\r\n <ng-container *ngIf=\"columns?.length && !filter?.inlineColumn\">\r\n <ng-container *ngFor=\"let item of columns | sdFilterColumn:field\">\r\n <ng-container *ngTemplateOutlet=\"filterColumn; context: {item: item}\"></ng-container>\r\n </ng-container>\r\n </ng-container>\r\n <ng-container *ngIf=\"externalFilters?.length\">\r\n <ng-container *ngFor=\"let item of externalFilters | sdFilterExternal:field\">\r\n <ng-container *ngTemplateOutlet=\"filterExternal; context: {item: item}\"></ng-container>\r\n </ng-container>\r\n </ng-container>\r\n <ng-container *ngFor=\"let item of filterDefs\">\r\n <div *ngIf=\"inlineFilterDef[item.sdMaterialFilterDef] && item.sdMaterialFilterDef === field\"\r\n class=\"col-lg-2 col-md-3 col-sm-6 px-8\">\r\n <ng-container *ngTemplateOutlet=\"item.templateRef;context:{filterDef:filterDef, isInline: true}\">\r\n </ng-container>\r\n </div>\r\n </ng-container>\r\n </ng-container>\r\n </ng-container>\r\n <ng-container *ngIf=\"!filter?.sorts?.length\">\r\n <ng-container *ngIf=\"columns?.length && !filter?.inlineColumn\">\r\n <ng-container *ngFor=\"let item of columns | sdFilterColumn\">\r\n <ng-container *ngTemplateOutlet=\"filterColumn; context: {item: item}\"></ng-container>\r\n </ng-container>\r\n </ng-container>\r\n <ng-container *ngIf=\"externalFilters?.length\">\r\n <ng-container *ngFor=\"let item of externalFilters | sdFilterExternal\">\r\n <ng-container *ngTemplateOutlet=\"filterExternal; context: {item: item}\"></ng-container>\r\n </ng-container>\r\n </ng-container>\r\n <ng-container *ngFor=\"let item of filterDefs\">\r\n <div *ngIf=\"inlineFilterDef[item.sdMaterialFilterDef]\" class=\"col-lg-2 col-md-3 col-sm-6 px-8\">\r\n <ng-container *ngTemplateOutlet=\"item.templateRef;context:{filterDef:filterDef, isInline: true}\">\r\n </ng-container>\r\n </div>\r\n </ng-container>\r\n </ng-container>\r\n </div>\r\n <ng-template #filterColumn let-item=\"item\">\r\n <div *ngIf=\"inlineColumn[item.field]\" class=\"col-lg-2 col-md-3 col-sm-6 px-8\">\r\n <sd-input [label]=\"item.title\" *ngIf=\"item.type === 'string'\" type=\"text\" [(model)]=\"columnFilter[item.field]\"\r\n (keyupEnter)=\"onFilter(item)\">\r\n </sd-input>\r\n <sd-input [label]=\"item.title\" *ngIf=\"item.type === 'number'\" type=\"number\" [(model)]=\"columnFilter[item.field]\"\r\n (keyupEnter)=\"onFilter(item)\">\r\n </sd-input>\r\n <sd-select [label]=\"item.title\" *ngIf=\"item.type === 'bool'\" [items]=\"[{value:'1',display:item.option?.displayOnTrue || 'True' },\r\n {value:'0',display:item.option?.displayOnFalse || 'False' }]\" valueField=\"value\" displayField=\"display\"\r\n [(model)]=\"columnFilter[item.field]\" (sdChange)=\"onFilter(item)\">\r\n </sd-select>\r\n <sd-select *ngIf=\"item.type === 'values' && item?.option?.selection !== 'AUTOCOMPLETE'\"\r\n [items]=\"item.option?.items\" [valueField]=\"item.option?.valueField\"\r\n [displayField]=\"item.option.displayField\" [(model)]=\"columnFilter[item.field]\" (sdChange)=\"onFilter(item)\"\r\n [disabled]=\"item.filter?.disabled\"\r\n [multiple]=\"item?.option?.selection === 'MULTIPLE' || item?.item?.selection === 'MULTIPLEAUTOCOMPLETE'\"\r\n [filtered]=\"item?.option?.selection === 'MULTIPLEAUTOCOMPLETE'\">\r\n </sd-select>\r\n <sd-autocomplete *ngIf=\"item.type === 'values' && item?.option?.selection === 'AUTOCOMPLETE'\"\r\n [items]=\"item.option?.items\" [valueField]=\"item.option?.valueField\"\r\n [displayField]=\"item.option?.displayField\" [(model)]=\"columnFilter[item.field]\" (sdChange)=\"onFilter(item)\"\r\n [disabled]=\"item.filter?.disabled\">\r\n </sd-autocomplete>\r\n <sd-date-time *ngIf=\"item.type === 'date' || item.type === 'datetime' || item.type === 'time'\"\r\n [label]=\"item.title\" [(model)]=\"columnFilter[item.field]\" [type]=\"item.type\" (sdChange)=\"onFilter(item)\">\r\n </sd-date-time>\r\n </div>\r\n </ng-template>\r\n <ng-template #filterExternal let-item=\"item\">\r\n <div *ngIf=\"inlineExternal[item.field]\" class=\"col-lg-2 col-md-3 col-sm-6 px-8\">\r\n <sd-input [label]=\"item.title\" *ngIf=\"item.type === 'string'\" type=\"text\" [(model)]=\"externalFilter[item.field]\"\r\n (keyupEnter)=\"onFilter(item)\">\r\n </sd-input>\r\n <sd-input [label]=\"item.title\" *ngIf=\"item.type === 'number'\" type=\"number\" [(model)]=\"externalFilter[item.field]\"\r\n (keyupEnter)=\"onFilter(item)\">\r\n </sd-input>\r\n <sd-select [label]=\"item.title\" *ngIf=\"item.type === 'bool'\" [items]=\"[{value:'1',display:item.option?.displayOnTrue || 'True' },\r\n {value:'0',display:item.option?.displayOnFalse || 'False' }]\" valueField=\"value\" displayField=\"display\"\r\n [(model)]=\"externalFilter[item.field]\" (sdChange)=\"onFilter(item)\">\r\n </sd-select>\r\n <ng-container *ngIf=\"item.type === 'values' && item.option\">\r\n <sd-select *ngIf=\"item.option?.selection === 'MULTIPLE'\" [label]=\"item.title\" [items]=\"item.option.items\"\r\n [valueField]=\"item.option.valueField\" [displayField]=\"item.option.displayField\"\r\n [(model)]=\"externalFilter[item.field]\" (sdChange)=\"onFilter(item)\" [selectAll]=\"item.option.selectAll\" multiple=\"true\">\r\n </sd-select>\r\n <sd-autocomplete *ngIf=\"item.option?.selection === 'AUTOCOMPLETE'\" [label]=\"item.title\"\r\n [items]=\"item.option.items\" [valueField]=\"item.option.valueField\" [displayField]=\"item.option.displayField\"\r\n [(model)]=\"externalFilter[item.field]\" (sdChange)=\"onFilter(item)\">\r\n </sd-autocomplete>\r\n <sd-select *ngIf=\"item.option?.selection === 'MULTIPLEAUTOCOMPLETE'\" [label]=\"item.title\"\r\n [items]=\"item.option.items\" [valueField]=\"item.option.valueField\" [displayField]=\"item.option.displayField\"\r\n [(model)]=\"externalFilter[item.field]\" (sdChange)=\"onFilter(item)\" filtered=\"true\" multiple>\r\n </sd-select>\r\n <sd-select *ngIf=\"!item.option?.selection\" [label]=\"item.title\" [items]=\"item.option.items\"\r\n [valueField]=\"item.option.valueField\" [displayField]=\"item.option.displayField\"\r\n [(model)]=\"externalFilter[item.field]\" (sdChange)=\"onFilter(item)\">\r\n </sd-select>\r\n </ng-container>\r\n <sd-date-time [label]=\"item.title\" *ngIf=\"item.type ==='date' || item.type ==='datetime'\"\r\n [(model)]=\"externalFilter[item.field]\" [type]=\"item.type\" (sdChange)=\"onFilter(item)\">\r\n </sd-date-time>\r\n <sd-date-range [label]=\"item.title\" *ngIf=\"item.type ==='daterange' && externalFilter[item.field]\"\r\n [(from)]=\"externalFilter[item.field].from\" [(to)]=\"externalFilter[item.field].to\" [min]=\"item.minDate\"\r\n [max]=\"item.maxDate\" (sdChange)=\"onFilter(item)\">\r\n </sd-date-range>\r\n </div>\r\n </ng-template>\r\n <sd-popup-filter [columns]=\"columns\" [externalFilters]=\"externalFilters\" (changeFilter)=\"onChangeFilter($event)\"\r\n (clearFilter)=\"onReset()\" [filterDefs]=\"filterDefs\">\r\n </sd-popup-filter>\r\n</ng-container>",
423
+ template: "<ng-container *ngIf=\"isVisible\">\r\n <div *ngIf=\"!isMobileOrTablet && ((columns?.length && !filter?.inlineColumn) || externalFilters?.length || filterDefs?.length)\"\r\n class=\"row mx-0 pb-10\">\r\n <ng-container *ngIf=\"filter?.sorts?.length\">\r\n <ng-container *ngFor=\"let field of filter?.sorts\">\r\n <ng-container *ngIf=\"columns?.length && !filter?.inlineColumn\">\r\n <ng-container *ngFor=\"let item of columns | sdFilterColumn:field\">\r\n <ng-container *ngTemplateOutlet=\"filterColumn; context: {item: item}\"></ng-container>\r\n </ng-container>\r\n </ng-container>\r\n <ng-container *ngIf=\"externalFilters?.length\">\r\n <ng-container *ngFor=\"let item of externalFilters | sdFilterExternal:field\">\r\n <ng-container *ngTemplateOutlet=\"filterExternal; context: {item: item}\"></ng-container>\r\n </ng-container>\r\n </ng-container>\r\n <ng-container *ngFor=\"let item of filterDefs\">\r\n <div *ngIf=\"inlineFilterDef[item.sdMaterialFilterDef] && item.sdMaterialFilterDef === field\"\r\n class=\"col-lg-2 col-md-3 col-sm-6 px-8\">\r\n <ng-container *ngTemplateOutlet=\"item.templateRef;context:{filterDef:filterDef, isInline: true}\">\r\n </ng-container>\r\n </div>\r\n </ng-container>\r\n </ng-container>\r\n </ng-container>\r\n <ng-container *ngIf=\"!filter?.sorts?.length\">\r\n <ng-container *ngIf=\"columns?.length && !filter?.inlineColumn\">\r\n <ng-container *ngFor=\"let item of columns | sdFilterColumn\">\r\n <ng-container *ngTemplateOutlet=\"filterColumn; context: {item: item}\"></ng-container>\r\n </ng-container>\r\n </ng-container>\r\n <ng-container *ngIf=\"externalFilters?.length\">\r\n <ng-container *ngFor=\"let item of externalFilters | sdFilterExternal\">\r\n <ng-container *ngTemplateOutlet=\"filterExternal; context: {item: item}\"></ng-container>\r\n </ng-container>\r\n </ng-container>\r\n <ng-container *ngFor=\"let item of filterDefs\">\r\n <div *ngIf=\"inlineFilterDef[item.sdMaterialFilterDef]\" class=\"col-lg-2 col-md-3 col-sm-6 px-8\">\r\n <ng-container *ngTemplateOutlet=\"item.templateRef;context:{filterDef:filterDef, isInline: true}\">\r\n </ng-container>\r\n </div>\r\n </ng-container>\r\n </ng-container>\r\n </div>\r\n <ng-template #filterColumn let-item=\"item\">\r\n <div *ngIf=\"inlineColumn[item.field]\" class=\"col-lg-2 col-md-3 col-sm-6 px-8\">\r\n <sd-input [label]=\"item.title\" *ngIf=\"item.type === 'string'\" type=\"text\" [(model)]=\"columnFilter[item.field]\"\r\n (keyupEnter)=\"onFilter(item)\">\r\n </sd-input>\r\n <sd-input [label]=\"item.title\" *ngIf=\"item.type === 'number'\" type=\"number\" [(model)]=\"columnFilter[item.field]\"\r\n (keyupEnter)=\"onFilter(item)\">\r\n </sd-input>\r\n <sd-select [label]=\"item.title\" *ngIf=\"item.type === 'bool'\" [items]=\"[{value:'1',display:item.option?.displayOnTrue || 'True' },\r\n {value:'0',display:item.option?.displayOnFalse || 'False' }]\" valueField=\"value\" displayField=\"display\"\r\n [(model)]=\"columnFilter[item.field]\" (sdChange)=\"onFilter(item)\">\r\n </sd-select>\r\n <sd-select *ngIf=\"item.type === 'values' && item?.option?.selection !== 'AUTOCOMPLETE'\"\r\n [items]=\"item.option?.items\" [valueField]=\"item.option?.valueField\"\r\n [displayField]=\"item.option.displayField\" [(model)]=\"columnFilter[item.field]\" (sdChange)=\"onFilter(item)\"\r\n [disabled]=\"item.filter?.disabled\"\r\n [multiple]=\"item?.option?.selection === 'MULTIPLE' || item?.item?.selection === 'MULTIPLEAUTOCOMPLETE'\"\r\n [filtered]=\"item?.option?.selection === 'MULTIPLEAUTOCOMPLETE'\">\r\n </sd-select>\r\n <sd-autocomplete *ngIf=\"item.type === 'values' && item?.option?.selection === 'AUTOCOMPLETE'\"\r\n [items]=\"item.option?.items\" [valueField]=\"item.option?.valueField\"\r\n [displayField]=\"item.option?.displayField\" [(model)]=\"columnFilter[item.field]\" (sdChange)=\"onFilter(item)\"\r\n [disabled]=\"item.filter?.disabled\">\r\n </sd-autocomplete>\r\n <sd-date-time *ngIf=\"item.type === 'date' || item.type === 'datetime' || item.type === 'time'\"\r\n [label]=\"item.title\" [(model)]=\"columnFilter[item.field]\" [type]=\"item.type\" (sdChange)=\"onFilter(item)\">\r\n </sd-date-time>\r\n </div>\r\n </ng-template>\r\n <ng-template #filterExternal let-item=\"item\">\r\n <div *ngIf=\"inlineExternal[item.field]\" class=\"col-lg-2 col-md-3 col-sm-6 px-8\">\r\n <sd-input [label]=\"item.title\" *ngIf=\"item.type === 'string'\" type=\"text\" [(model)]=\"externalFilter[item.field]\"\r\n (keyupEnter)=\"onFilter(item)\">\r\n </sd-input>\r\n <sd-input [label]=\"item.title\" *ngIf=\"item.type === 'number'\" type=\"number\" [(model)]=\"externalFilter[item.field]\"\r\n (keyupEnter)=\"onFilter(item)\">\r\n </sd-input>\r\n <sd-select [label]=\"item.title\" *ngIf=\"item.type === 'bool'\" [items]=\"[{value:'1',display:item.option?.displayOnTrue || 'True' },\r\n {value:'0',display:item.option?.displayOnFalse || 'False' }]\" valueField=\"value\" displayField=\"display\"\r\n [(model)]=\"externalFilter[item.field]\" (sdChange)=\"onFilter(item)\">\r\n </sd-select>\r\n <ng-container *ngIf=\"item.type === 'values' && item.option\">\r\n <sd-select *ngIf=\"item.option?.selection === 'MULTIPLE'\" [label]=\"item.title\" [items]=\"item.option.items\"\r\n [valueField]=\"item.option.valueField\" [displayField]=\"item.option.displayField\"\r\n [(model)]=\"externalFilter[item.field]\" (sdChange)=\"onFilter(item)\" [selectAll]=\"item.option.selectAll\" multiple=\"true\">\r\n </sd-select>\r\n <sd-autocomplete *ngIf=\"item.option?.selection === 'AUTOCOMPLETE'\" [label]=\"item.title\"\r\n [items]=\"item.option.items\" [valueField]=\"item.option.valueField\" [displayField]=\"item.option.displayField\"\r\n [(model)]=\"externalFilter[item.field]\" (sdChange)=\"onFilter(item)\">\r\n </sd-autocomplete>\r\n <sd-select *ngIf=\"item.option?.selection === 'MULTIPLEAUTOCOMPLETE'\" [label]=\"item.title\"\r\n [items]=\"item.option.items\" [valueField]=\"item.option.valueField\" [displayField]=\"item.option.displayField\"\r\n [(model)]=\"externalFilter[item.field]\" (sdChange)=\"onFilter(item)\" filtered=\"true\" multiple>\r\n </sd-select>\r\n <sd-select *ngIf=\"!item.option?.selection\" [label]=\"item.title\" [items]=\"item.option.items\"\r\n [valueField]=\"item.option.valueField\" [displayField]=\"item.option.displayField\"\r\n [(model)]=\"externalFilter[item.field]\" (sdChange)=\"onFilter(item)\">\r\n </sd-select>\r\n </ng-container>\r\n <sd-date-time [label]=\"item.title\" *ngIf=\"item.type ==='date' || item.type ==='datetime'\"\r\n [(model)]=\"externalFilter[item.field]\" [type]=\"item.type\" (sdChange)=\"onFilter(item)\">\r\n </sd-date-time>\r\n <sd-date-range [label]=\"item.title\" *ngIf=\"item.type ==='daterange' && externalFilter[item.field]\"\r\n [(from)]=\"externalFilter[item.field].from\" [(to)]=\"externalFilter[item.field].to\" [min]=\"item.minDate\"\r\n [max]=\"item.maxDate\" (sdChange)=\"onFilter(item)\">\r\n </sd-date-range>\r\n </div>\r\n </ng-template>\r\n <sd-popup-filter [columns]=\"columns\" [externalFilters]=\"externalFilters\" (changeFilter)=\"onChangeFilter($event)\"\r\n (clearFilter)=\"onReset()\" [filterDefs]=\"filterDefs\">\r\n </sd-popup-filter>\r\n</ng-container>",
424
424
  styles: [":host{display:block;padding-left:0;padding-right:0}:host ::ng-deep .mat-form-field-wrapper{padding-bottom:0}"]
425
425
  },] }
426
426
  ];
@@ -2186,9 +2186,9 @@ class SdDesktopCellView {
2186
2186
  SdDesktopCellView.decorators = [
2187
2187
  { type: Component, args: [{
2188
2188
  selector: 'sd-desktop-cell-view',
2189
- template: "<ng-container *ngIf=\"column.htmlTemplate;else useDefaultView\">\r\n <div (click)=\"column.click && column.click(item[column.field], item)\" style=\"overflow-wrap: break-word;\"\r\n [ngClass]=\"{'cursor-pointer':column.click}\"\r\n [innerHTML]=\"(item[column.field] | columnHtmlTemplate:item:column) | safeHtml\">\r\n </div>\r\n</ng-container>\r\n<ng-template #useDefaultView>\r\n <ng-container *sdLet=\"item[column.field] | columnBadge:item:column as badge\">\r\n <ng-container *sdLet=\"item[column.field] | columnTooltip:item:column as tooltip\">\r\n <ng-container *sdLet=\"item[column.field] | columnTransform:item:column:key | async as val\">\r\n <ng-container\r\n *ngIf=\"column.type === 'string' || column.type === 'number' || column.type === 'bool' || column.type === 'values'\">\r\n <ng-container *ngIf=\"!!badge\">\r\n <sd-badge [type]=\"badge.type\" [title]=\"val\" [color]=\"badge.color\" [icon]=\"badge.icon\" [tooltip]=\"tooltip\"\r\n (sdClick)=\"column.click(item[column.field], item)\"></sd-badge>\r\n </ng-container>\r\n <ng-container *ngIf=\"!badge\">\r\n <div class=\"text-break\" [matTooltip]=\"tooltip\">\r\n <a *ngIf=\"column.click\" href=\"javascript:;\" (click)=\"column.click(item[column.field], item)\">{{val}}</a>\r\n <ng-container *ngIf=\"!column.click\">{{val}}\r\n </ng-container>\r\n </div>\r\n </ng-container>\r\n </ng-container>\r\n <div *ngIf=\"column.type === 'date'\" matTooltipPosition=\"above\"\r\n [matTooltip]=\"item[column.field] | date:'dd/MM/yyyy'\">\r\n {{val | sdTimeDifferent:'dd/MM/yyyy':column.option?.timeDifferent | async}}\r\n </div>\r\n <div *ngIf=\"column.type === 'datetime'\" matTooltipPosition=\"above\"\r\n [matTooltip]=\"item[column.field] | date:'dd/MM/yyyy HH:mm'\">\r\n {{val | sdTimeDifferent:'dd/MM/yyyy HH:mm':column.option?.timeDifferent | async}}\r\n </div>\r\n <div *ngIf=\"column.type === 'time'\">\r\n {{val | date:'HH:mm'}}\r\n </div>\r\n <div *ngIf=\"column.type === 'image'\" class=\"align-middle text-center\">\r\n <img *ngIf=\"val\" [src]=\"val\" [width]=\"column.option?.width\" [height]=\"column.option?.height\"\r\n style=\"margin: 5px 0;object-fit: contain;\" (click)=\"column.click && column.click(item[column.field], item)\"\r\n [ngClass]=\"{'pointer':column.click}\">\r\n <mat-icon *ngIf=\"!val\" class=\"c-img\" [ngClass]=\"{'pointer':column.click}\"\r\n (click)=\"column.click && column.click(item[column.field], item)\">image</mat-icon>\r\n </div>\r\n </ng-container>\r\n </ng-container>\r\n </ng-container>\r\n <sd-desktop-cell-children-view *ngIf=\"column.type === 'children'\" [key]=\"key\" [item]=\"item\" [column]=\"column\">\r\n </sd-desktop-cell-children-view>\r\n</ng-template>",
2189
+ template: "<ng-container *sdLet=\"item[column.field] | cellView:item:column:gridOption:key | async as view\">\r\n <div *ngIf=\"!!view.display.html;else useValue\" (click)=\"!!view.click && view.click()\" class=\"text-break\"\r\n [class.cursor-pointer]=\"!!view.click\" [matTooltip]=\"view.tooltip\" [innerHTML]=\"view.display.html | safeHtml\">\r\n </div>\r\n <ng-template #useValue>\r\n <ng-container *ngIf=\"!!view.badge; else noBadge\">\r\n <sd-badge [type]=\"view.badge.type\" [title]=\"view.display.value\" [color]=\"view.badge.color\"\r\n [icon]=\"view.badge.icon\" [tooltip]=\"view.tooltip\" (sdClick)=\"column.click(item[column.field], item)\"></sd-badge>\r\n </ng-container>\r\n <ng-template #noBadge>\r\n <ng-container *ngIf=\"column.type !== 'children'; else childrenView\">\r\n <div *ngIf=\"column.type !== 'image'\" class=\"text-break\"\r\n [class.text-center]=\"view.display.align === 'center'\" [class.text-right]=\"view.display.align === 'right'\"\r\n [matTooltip]=\"view.tooltip\">\r\n <a *ngIf=\"!!view.click\" href=\"javascript:;\" (click)=\"view.click()\">{{view.display.value}}</a>\r\n <ng-container *ngIf=\"!view.click\">{{view.display.value}}\r\n </ng-container>\r\n </div>\r\n <div *ngIf=\"column.type === 'image'\" class=\"align-middle text-center\">\r\n <img *ngIf=\"view.display.value\" [src]=\"view.display.value\" [width]=\"column.option?.width\"\r\n [height]=\"column.option?.height\" class=\"c-image\" (click)=\"!!view.click && view.click()\"\r\n [class.cursor-pointer]=\"!!view.click\">\r\n <mat-icon *ngIf=\"!view.display.value\" class=\"c-img\" [class.cursor-pointer]=\"!!view.click\"\r\n (click)=\"!!view.click && view.click()\">\r\n image</mat-icon>\r\n </div>\r\n </ng-container>\r\n <ng-template #childrenView>\r\n <sd-desktop-cell-children-view [key]=\"key\" [item]=\"item\" [column]=\"column\">\r\n </sd-desktop-cell-children-view>\r\n </ng-template>\r\n </ng-template>\r\n </ng-template>\r\n</ng-container>",
2190
2190
  changeDetection: ChangeDetectionStrategy.OnPush,
2191
- styles: [".c-color-success{color:#4caf50}.c-color-danger{color:#f82c13}.c-img{font-size:30px;opacity:.5}.c-img.pointer:hover{opacity:.9}"]
2191
+ styles: [".c-color-success{color:#4caf50}.c-color-danger{color:#f82c13}.c-image{-o-object-fit:contain;margin:5px 0;object-fit:contain}.c-img{font-size:30px;opacity:.5}.c-img.pointer:hover{opacity:.9}"]
2192
2192
  },] }
2193
2193
  ];
2194
2194
  SdDesktopCellView.ctorParameters = () => [];
@@ -2196,7 +2196,8 @@ SdDesktopCellView.propDecorators = {
2196
2196
  sdId: [{ type: Input }],
2197
2197
  key: [{ type: Input }],
2198
2198
  column: [{ type: Input }],
2199
- item: [{ type: Input }]
2199
+ item: [{ type: Input }],
2200
+ gridOption: [{ type: Input }]
2200
2201
  };
2201
2202
 
2202
2203
  class SdColumnTransformPipe {
@@ -2846,7 +2847,7 @@ class SdDesktopCell {
2846
2847
  SdDesktopCell.decorators = [
2847
2848
  { type: Component, args: [{
2848
2849
  selector: 'sd-desktop-cell',
2849
- template: "<ng-container *ngIf=\"column && item\">\r\n <ng-container *ngIf=\"item.editorHandlerRow?.visible;else useView\">\r\n <!-- <ng-container *sdLet=\"item[column.field] | sdId:item:column\"> -->\r\n <ng-container *sdLet=\"item[column.field] | sdEditorHandlerColumn:item:column:gridOption\">\r\n <ng-container *ngIf=\"item.editorHandlerColumn[column.field]?.visible;else useView\">\r\n <ng-container *ngIf=\"cellDef[column.field]\">\r\n <ng-container *ngTemplateOutlet=\"\r\n cellDef[column.field].templateRef;\r\n context: { item: item, column: column, idx: idx, isEdited: true }\r\n \">\r\n </ng-container>\r\n </ng-container>\r\n <sd-desktop-cell-editor *ngIf=\"!cellDef[column.field]\" [sdId]=\"item.sdId\" [column]=\"column\" [item]=\"item\">\r\n </sd-desktop-cell-editor>\r\n </ng-container>\r\n </ng-container>\r\n <!-- </ng-container> -->\r\n </ng-container>\r\n <ng-template #useView>\r\n <ng-container *ngIf=\"cellDef[column.field]\">\r\n <ng-container *ngTemplateOutlet=\"\r\n cellDef[column.field].templateRef;\r\n context: { item: item, column: column, idx: idx }\r\n \">\r\n </ng-container>\r\n </ng-container>\r\n <sd-desktop-cell-view *ngIf=\"!cellDef[column.field]\" [sdId]=\"item.sdId\" [key]=\"key\" [column]=\"column\" [item]=\"item\">\r\n </sd-desktop-cell-view>\r\n </ng-template>\r\n</ng-container>",
2850
+ template: "<ng-container *ngIf=\"column && item\">\r\n <ng-container *ngIf=\"item.editorHandlerRow?.visible;else useView\">\r\n <!-- <ng-container *sdLet=\"item[column.field] | sdId:item:column\"> -->\r\n <ng-container *sdLet=\"item[column.field] | sdEditorHandlerColumn:item:column:gridOption\">\r\n <ng-container *ngIf=\"item.editorHandlerColumn[column.field]?.visible;else useView\">\r\n <ng-container *ngIf=\"cellDef[column.field]\">\r\n <ng-container *ngTemplateOutlet=\"\r\n cellDef[column.field].templateRef;\r\n context: { item: item, column: column, idx: idx, isEdited: true }\r\n \">\r\n </ng-container>\r\n </ng-container>\r\n <sd-desktop-cell-editor *ngIf=\"!cellDef[column.field]\" [sdId]=\"item.sdId\" [column]=\"column\" [item]=\"item\">\r\n </sd-desktop-cell-editor>\r\n </ng-container>\r\n </ng-container>\r\n <!-- </ng-container> -->\r\n </ng-container>\r\n <ng-template #useView>\r\n <ng-container *ngIf=\"cellDef[column.field]\">\r\n <ng-container *ngTemplateOutlet=\"\r\n cellDef[column.field].templateRef;\r\n context: { item: item, column: column, idx: idx }\r\n \">\r\n </ng-container>\r\n </ng-container>\r\n <sd-desktop-cell-view *ngIf=\"!cellDef[column.field]\" [sdId]=\"item.sdId\" [key]=\"key\" [column]=\"column\" [gridOption]=\"gridOption\" [item]=\"item\">\r\n </sd-desktop-cell-view>\r\n </ng-template>\r\n</ng-container>",
2850
2851
  changeDetection: ChangeDetectionStrategy.OnPush
2851
2852
  },] }
2852
2853
  ];
@@ -2876,7 +2877,7 @@ class SdDesktopCellEditor {
2876
2877
  SdDesktopCellEditor.decorators = [
2877
2878
  { type: Component, args: [{
2878
2879
  selector: 'sd-desktop-cell-editor',
2879
- template: "<sd-input *ngIf=\"column.type === 'string'\" size=\"sm\" type=\"text\" [(model)]=\"item[column.field]\" (sdChange)=\"onChange()\" disableErrorMessage>\r\n</sd-input>\r\n<sd-input *ngIf=\"column.type === 'number'\" size=\"sm\" type=\"number\" [(model)]=\"item[column.field]\"\r\n (sdChange)=\"onChange()\" disableErrorMessage>\r\n</sd-input>\r\n<sd-select *ngIf=\"column.type === 'bool'\" size=\"sm\" [items]=\"[\r\n { value: true, display: column.option?.displayOnTrue || 'True' },\r\n { value: false, display: column.option?.displayOnFalse || 'False' }\r\n ]\" valueField=\"value\" displayField=\"display\" [(model)]=\"item[column.field]\" (sdChange)=\"onChange()\" disableErrorMessage>\r\n</sd-select>\r\n<sd-select *ngIf=\"\r\n column.type === 'values' && column?.option?.selection !== 'AUTOCOMPLETE'\r\n \" size=\"sm\" [items]=\"column.option.items\" [valueField]=\"column.option.valueField\"\r\n [displayField]=\"column.option.displayField\" [(model)]=\"item[column.field]\" (sdChange)=\"onChange()\" [multiple]=\"\r\n column?.option?.selection === 'MULTIPLE' ||\r\n column?.option?.selection === 'MULTIPLEAUTOCOMPLETE'\r\n \" [filtered]=\"column?.option?.selection === 'MULTIPLEAUTOCOMPLETE'\" disableErrorMessage>\r\n</sd-select>\r\n<sd-autocomplete *ngIf=\"\r\n column.type === 'values' && column?.option?.selection === 'AUTOCOMPLETE'\r\n \" size=\"sm\" [items]=\"column.option.items\" [valueField]=\"column.option.valueField\"\r\n [displayField]=\"column.option.displayField\" [(model)]=\"item[column.field]\" (sdChange)=\"onChange()\" disableErrorMessage>\r\n</sd-autocomplete>\r\n<sd-date-time *ngIf=\"\r\n column.type === 'date' ||\r\n column.type === 'datetime' ||\r\n column.type === 'time'\r\n \" size=\"sm\" [(model)]=\"item[column.field]\" [type]=\"column.type\" (sdChange)=\"onChange()\" disableErrorMessage>\r\n</sd-date-time>",
2880
+ template: "<sd-input *ngIf=\"column.type === 'string'\" size=\"sm\" type=\"text\" [(model)]=\"item[column.field]\" (sdChange)=\"onChange()\" disableErrorMessage>\r\n</sd-input>\r\n<sd-input-currency *ngIf=\"column.type === 'number'\" size=\"sm\" type=\"number\" [(model)]=\"item[column.field]\"\r\n (sdChange)=\"onChange()\" disableErrorMessage>\r\n</sd-input-currency>\r\n<sd-select *ngIf=\"column.type === 'bool'\" size=\"sm\" [items]=\"[\r\n { value: true, display: column.option?.displayOnTrue || 'True' },\r\n { value: false, display: column.option?.displayOnFalse || 'False' }\r\n ]\" valueField=\"value\" displayField=\"display\" [(model)]=\"item[column.field]\" (sdChange)=\"onChange()\" disableErrorMessage>\r\n</sd-select>\r\n<sd-select *ngIf=\"\r\n column.type === 'values' && column?.option?.selection !== 'AUTOCOMPLETE'\r\n \" size=\"sm\" [items]=\"column.option.items\" [valueField]=\"column.option.valueField\"\r\n [displayField]=\"column.option.displayField\" [(model)]=\"item[column.field]\" (sdChange)=\"onChange()\" [multiple]=\"\r\n column?.option?.selection === 'MULTIPLE' ||\r\n column?.option?.selection === 'MULTIPLEAUTOCOMPLETE'\r\n \" [filtered]=\"column?.option?.selection === 'MULTIPLEAUTOCOMPLETE'\" disableErrorMessage>\r\n</sd-select>\r\n<sd-autocomplete *ngIf=\"\r\n column.type === 'values' && column?.option?.selection === 'AUTOCOMPLETE'\r\n \" size=\"sm\" [items]=\"column.option.items\" [valueField]=\"column.option.valueField\"\r\n [displayField]=\"column.option.displayField\" [(model)]=\"item[column.field]\" (sdChange)=\"onChange()\" disableErrorMessage>\r\n</sd-autocomplete>\r\n<sd-date-time *ngIf=\"\r\n column.type === 'date' ||\r\n column.type === 'datetime' ||\r\n column.type === 'time'\r\n \" size=\"sm\" [(model)]=\"item[column.field]\" [type]=\"column.type\" (sdChange)=\"onChange()\" disableErrorMessage>\r\n</sd-date-time>",
2880
2881
  changeDetection: ChangeDetectionStrategy.OnPush
2881
2882
  },] }
2882
2883
  ];
@@ -3172,6 +3173,132 @@ SdGridQuickAction.propDecorators = {
3172
3173
  clear: [{ type: Output }]
3173
3174
  };
3174
3175
 
3176
+ var _maxSecond, _maxMinute, _maxHour, _maxDay, _maxMonth, _isMobileOrTablet$1;
3177
+ class SdCellViewPipe {
3178
+ constructor(deviceService, utilityService, gridService) {
3179
+ this.utilityService = utilityService;
3180
+ this.gridService = gridService;
3181
+ _maxSecond.set(this, 60);
3182
+ _maxMinute.set(this, __classPrivateFieldGet(this, _maxSecond) * 60);
3183
+ _maxHour.set(this, __classPrivateFieldGet(this, _maxMinute) * 24);
3184
+ _maxDay.set(this, __classPrivateFieldGet(this, _maxHour) * 30);
3185
+ _maxMonth.set(this, __classPrivateFieldGet(this, _maxHour) * 365);
3186
+ _isMobileOrTablet$1.set(this, false);
3187
+ __classPrivateFieldSet(this, _isMobileOrTablet$1, !deviceService.isDesktop());
3188
+ }
3189
+ transform(value, rowData, column, gridOption, key) {
3190
+ var _a, _b, _c, _d;
3191
+ return __awaiter(this, void 0, void 0, function* () {
3192
+ const { displayOnEmpty } = gridOption;
3193
+ const { align, click, tooltip, htmlTemplate, transform } = column;
3194
+ const result = {
3195
+ badge: null,
3196
+ tooltip: null,
3197
+ display: {
3198
+ align: align || (column.type === 'number' ? 'right' : 'left'),
3199
+ value
3200
+ },
3201
+ click: null
3202
+ };
3203
+ // Display
3204
+ if (typeof (htmlTemplate) === 'function') {
3205
+ result.display.html = htmlTemplate(value, rowData, __classPrivateFieldGet(this, _isMobileOrTablet$1));
3206
+ }
3207
+ else {
3208
+ if (transform) {
3209
+ result.display.value = transform(value, rowData);
3210
+ }
3211
+ else {
3212
+ if (column.type === 'date' || column.type === 'datetime') {
3213
+ const { option } = column;
3214
+ const seconds = Math.round((new Date().getTime() - new Date(value).getTime()) / 1000);
3215
+ if ((option === null || option === void 0 ? void 0 : option.timeDifferent) === 'month' && seconds < __classPrivateFieldGet(this, _maxMonth)) {
3216
+ result.display.value = this.utilityService.timeDifference(value);
3217
+ result.tooltip = Date.toFormat(value, column.type === 'date' ? 'dd/MM/yyyy' : 'dd/MM/yyyy HH:mm');
3218
+ }
3219
+ else if ((option === null || option === void 0 ? void 0 : option.timeDifferent) === 'day' && seconds < __classPrivateFieldGet(this, _maxDay)) {
3220
+ result.display.value = this.utilityService.timeDifference(value);
3221
+ result.tooltip = Date.toFormat(value, column.type === 'date' ? 'dd/MM/yyyy' : 'dd/MM/yyyy HH:mm');
3222
+ }
3223
+ else if ((option === null || option === void 0 ? void 0 : option.timeDifferent) === 'hour' && seconds < __classPrivateFieldGet(this, _maxHour)) {
3224
+ result.display.value = this.utilityService.timeDifference(value);
3225
+ result.tooltip = Date.toFormat(value, column.type === 'date' ? 'dd/MM/yyyy' : 'dd/MM/yyyy HH:mm');
3226
+ }
3227
+ else if ((option === null || option === void 0 ? void 0 : option.timeDifferent) === 'minute' && seconds < __classPrivateFieldGet(this, _maxMinute)) {
3228
+ result.display.value = this.utilityService.timeDifference(value);
3229
+ result.tooltip = Date.toFormat(value, column.type === 'date' ? 'dd/MM/yyyy' : 'dd/MM/yyyy HH:mm');
3230
+ }
3231
+ else if ((option === null || option === void 0 ? void 0 : option.timeDifferent) === 'second' && seconds < __classPrivateFieldGet(this, _maxSecond)) {
3232
+ result.display.value = this.utilityService.timeDifference(value);
3233
+ result.tooltip = Date.toFormat(value, column.type === 'date' ? 'dd/MM/yyyy' : 'dd/MM/yyyy HH:mm');
3234
+ }
3235
+ else {
3236
+ result.display.value = Date.toFormat(value, column.type === 'date' ? 'dd/MM/yyyy' : 'dd/MM/yyyy HH:mm');
3237
+ }
3238
+ }
3239
+ if (column.type === 'time') {
3240
+ result.display.value = Date.toFormat(value, 'HH:mm');
3241
+ }
3242
+ if (column.type === 'values') {
3243
+ const data = yield this.gridService.loadValues(column, key);
3244
+ 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;
3245
+ }
3246
+ else if (column.type === 'number' && Number.isNumber(value)) {
3247
+ result.display.value = Number.toVNCurrency(value);
3248
+ }
3249
+ if (column.type === 'bool') {
3250
+ const { option } = column;
3251
+ result.display.value = value === true ? ((option === null || option === void 0 ? void 0 : option.displayOnTrue) || 'True') : ((option === null || option === void 0 ? void 0 : option.displayOnFalse) || 'False');
3252
+ }
3253
+ }
3254
+ if (displayOnEmpty && (result.display.value === null || result.display.value === undefined || result.display.value === '')) {
3255
+ if (typeof (displayOnEmpty) === 'function') {
3256
+ result.display.html = displayOnEmpty(rowData, column);
3257
+ }
3258
+ else {
3259
+ result.display.html = `<div class="T16R">--</div>`;
3260
+ }
3261
+ }
3262
+ }
3263
+ // Badge
3264
+ if ((column.type === 'string' || column.type === 'number' || column.type === 'values') && column.badge) {
3265
+ result.badge = {
3266
+ type: !(column === null || column === void 0 ? void 0 : column.badgeType) ? 'round' : column.badgeType,
3267
+ color: column.badge(value, rowData),
3268
+ icon: (_d = column === null || column === void 0 ? void 0 : column.badgeIcon) === null || _d === void 0 ? void 0 : _d.call(column, value, rowData)
3269
+ };
3270
+ }
3271
+ else if (column.type === 'bool') {
3272
+ result.badge = {
3273
+ type: !(column === null || column === void 0 ? void 0 : column.badgeType) ? 'round' : column.badgeType,
3274
+ color: !!value ? 'success' : 'danger',
3275
+ icon: null
3276
+ };
3277
+ }
3278
+ // Tooltip
3279
+ if (typeof (tooltip) === 'function') {
3280
+ result.tooltip = tooltip(value, rowData);
3281
+ }
3282
+ // Clickable
3283
+ if (typeof (click) === 'function') {
3284
+ result.click = () => click(value, rowData);
3285
+ }
3286
+ return result;
3287
+ });
3288
+ }
3289
+ }
3290
+ _maxSecond = new WeakMap(), _maxMinute = new WeakMap(), _maxHour = new WeakMap(), _maxDay = new WeakMap(), _maxMonth = new WeakMap(), _isMobileOrTablet$1 = new WeakMap();
3291
+ SdCellViewPipe.decorators = [
3292
+ { type: Pipe, args: [{
3293
+ name: 'cellView'
3294
+ },] }
3295
+ ];
3296
+ SdCellViewPipe.ctorParameters = () => [
3297
+ { type: DeviceDetectorService },
3298
+ { type: SdUtilityService },
3299
+ { type: SdGridService }
3300
+ ];
3301
+
3175
3302
  class MatPaginatorIntlCro extends MatPaginatorIntl {
3176
3303
  constructor() {
3177
3304
  super(...arguments);
@@ -3268,7 +3395,8 @@ SdGridMaterialModule.decorators = [
3268
3395
  SdEditorHandlerColumnPipe,
3269
3396
  SdEditorValidatePipe,
3270
3397
  SdIdPipe,
3271
- SdStyleRowCss
3398
+ SdStyleRowCss,
3399
+ SdCellViewPipe
3272
3400
  ],
3273
3401
  exports: [
3274
3402
  SdGridMaterial,
@@ -3298,5 +3426,5 @@ SdGridMaterialModule.decorators = [
3298
3426
  * Generated bundle index. Do not edit.
3299
3427
  */
3300
3428
 
3301
- export { SdGridMaterial, SdGridMaterialModule, SdMaterialCellDefDirective, SdMaterialEmptyDataDefDirective, SdMaterialFilterDefDirective, SdMaterialFooterDefDirective, SdMaterialSubInformationDefDirective, MatPaginatorIntlCro as ɵa, SdGridFilter as ɵb, SdCommandTitlePipe as ɵba, SdColumnValuesPipe as ɵbb, SdColumnHtmlTemplatePipe as ɵbc, SdColumnTransformPipe 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, SdPopupFilter as ɵc, SdGridFilterService as ɵd, SdPopupExport as ɵe, GRID_MATERIAL_CONFIG as ɵg, SdGridConfigurationService as ɵh, SdGridService 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 };
3429
+ export { SdGridMaterial, SdGridMaterialModule, SdMaterialCellDefDirective, SdMaterialEmptyDataDefDirective, SdMaterialFilterDefDirective, SdMaterialFooterDefDirective, SdMaterialSubInformationDefDirective, MatPaginatorIntlCro as ɵa, SdGridFilter as ɵb, SdCommandTitlePipe as ɵba, SdColumnValuesPipe as ɵbb, SdColumnHtmlTemplatePipe as ɵbc, SdColumnTransformPipe 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, SdGridService 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 };
3302
3430
  //# sourceMappingURL=sd-angular-core-grid-material.js.map