import { __decorate } from "tslib";
import { Component, Input } from '@angular/core';
let GridDesktopColumnViewComponent = class GridDesktopColumnViewComponent {
    constructor() { }
};
__decorate([
    Input()
], GridDesktopColumnViewComponent.prototype, "column", void 0);
__decorate([
    Input()
], GridDesktopColumnViewComponent.prototype, "item", void 0);
GridDesktopColumnViewComponent = __decorate([
    Component({
        selector: 'sd-grid-desktop-column-view',
        template: "<ng-container *ngIf=\"column && item\">\r\n  <ng-container *ngIf=\"column.htmlTemplate;else useDefaultView\">\r\n    <div [innerHTML]=\"(item[column.field] | columnHtmlTemplate:item:column.htmlTemplate) | safeHtml\">\r\n    </div>\r\n  </ng-container>\r\n  <ng-template #useDefaultView>\r\n    <div *ngIf=\"column.type === 'string'\">\r\n      <span [className]=\"item[column.field] | cellDesktopClassName:item:column\"\r\n        [ngClass]=\"{'blinker': item.blinker && item.blinker[column.field]}\">\r\n        <a *ngIf=\"column.click\" href=\"javascript:;\"\r\n          (click)=\"column.click(item[column.field], item)\">{{item[column.field]}}</a>\r\n        <ng-container *ngIf=\"!column.click\">{{item[column.field]}}</ng-container>\r\n      </span>\r\n      <ng-container *ngIf=\"column.commands | columnCommandFilter:item | async; $implicit as filteredColumnCommands\">\r\n        <button *ngFor=\"let columnCommand of filteredColumnCommands\" (click)=\"columnCommand.click(item)\" type=\"button\"\r\n          class=\"c-btn-icon\" [matTooltip]=\"columnCommand.title | commandTitle:item\">\r\n          <i class=\"{{columnCommand.icon | commandIcon:item}}\" aria-hidden=\"true\"></i>\r\n        </button>\r\n      </ng-container>\r\n    </div>\r\n    <div *ngIf=\"column.type === 'color'\">\r\n      <input disabled=\"true\" type=\"color\" class=\"form-control c-input-xs\" [(ngModel)]=\"item[column.field]\"\r\n        (change)=\"column.editor?.change && column.editor?.change(item)\">\r\n    </div>\r\n    <div *ngIf=\"column.type === 'number'\">\r\n      <span [className]=\"item[column.field] | cellDesktopClassName:item:column\"\r\n        [ngClass]=\"{'blinker': item.blinker && item.blinker[column.field]}\">\r\n        <a *ngIf=\"column.click\" href=\"javascript:;\"\r\n          (click)=\"column.click(item[column.field], item)\">{{(item[column.field] | valueTransform:item:column) | number : '1.0-2'}}</a>\r\n        <ng-container *ngIf=\"!column.click\">\r\n          {{(item[column.field] | valueTransform:item:column) | number : '1.0-2'}}</ng-container>\r\n      </span>\r\n    </div>\r\n    <div class=\"text-center\" *ngIf=\"column.type === 'date'\">\r\n      {{item[column.field] | date:'dd/MM/yyyy'}}\r\n    </div>\r\n    <div class=\"text-center\" *ngIf=\"column.type === 'datetime'\">\r\n      {{item[column.field] | date:'dd/MM/yyyy HH:mm'}}\r\n    </div>\r\n    <div class=\"text-center\" *ngIf=\"column.type === 'time'\">\r\n      {{item[column.field] | date:'HH:mm'}}\r\n    </div>\r\n    <div class=\"align-middle text-center\" *ngIf=\"column.type === 'bool'\">\r\n      <span *ngIf=\"!item.editorHandler[column.field].visible && item[column.field]\"\r\n        class=\"status status-success\">{{column.trueValue || 'True'}}</span>\r\n      <span *ngIf=\"!item.editorHandler[column.field].visible && !item[column.field]\"\r\n        class=\"status status-danger\">{{column.falseValue || 'False'}}</span>\r\n    </div>\r\n    <div *ngIf=\"column.type === 'values'\">\r\n      <ng-container *ngIf=\"column?.dictionary[item[column.field]] as dic; else elseNotInDic\">\r\n        <div *ngIf=\"dic.color || dic.backgroundColor; else elseNoStatus\" class=\"status\"\r\n          [ngStyle]=\"{'color':dic.color, 'background-color': dic.backgroundColor}\">\r\n          {{dic.text}}\r\n        </div>\r\n        <ng-template #elseNoStatus>\r\n          <div class=\"text-left\">\r\n            {{dic.text}}\r\n          </div>\r\n        </ng-template>\r\n      </ng-container>\r\n      <ng-template #elseNotInDic>\r\n        <div class=\"text-left\">\r\n          {{item[column.field]}}\r\n        </div>\r\n      </ng-template>\r\n    </div>\r\n    <div *ngIf=\"column.type === 'radio'\">\r\n      {{item[column.field]}}\r\n    </div>\r\n    <div class=\"align-middle text-center\" *ngIf=\"column.type === 'image'\">\r\n      <img *ngIf=\"item[column.field]\" [src]=\"item[column.field]\" [width]=\"column.display?.width\"\r\n        [height]=\"column.display?.height\" style=\"margin: 5px 0\"\r\n        (click)=\"column.click && column.click(item[column.field], item)\" [ngClass]=\"{'c-clickable':column.click}\">\r\n      <i *ngIf=\"!item[column.field]\" class=\"fa fa-picture-o fa-fw c-img\"\r\n        [ngClass]=\"{'c-clickable':column.click}\" (click)=\"column.click && column.click(item[column.field], item)\"></i>\r\n    </div>\r\n  </ng-template>\r\n</ng-container>",
        styles: [".c-badge{display:block!important;border-radius:10rem;padding:.3rem!important;font-weight:500;font-size:12px;max-width:80%;margin:0 auto}.c-badge a{color:#fff}.status{font-weight:500;padding:4px 8px;border-radius:1.5rem;display:inline-block;text-align:center;text-transform:uppercase;width:100%}.status-success{color:#4caf50}.status-danger{color:#f44336}.c-btn-icon{background:0 0!important;border:none;opacity:.8;height:20px;display:inline-flex;padding:0 3px}.c-btn-icon:hover{cursor:pointer;opacity:1}.c-btn-icon:disabled{background:0 0!important;border:none;cursor:not-allowed;opacity:.3}.c-clickable{cursor:pointer}.c-img{font-size:50px;opacity:.5}.c-img.c-clickable:hover{opacity:.9}"]
    })
], GridDesktopColumnViewComponent);
export { GridDesktopColumnViewComponent };
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZ3JpZC1kZXNrdG9wLWNvbHVtbi12aWV3LmNvbXBvbmVudC5qcyIsInNvdXJjZVJvb3QiOiJuZzovL3N1cGVyZGV2LWFuZ3VsYXItY29yZS8iLCJzb3VyY2VzIjpbImxpYi9jb250cm9scy9ncmlkLWNvbnRyb2wvY29tcG9uZW50cy9ncmlkLWRlc2t0b3AtY29sdW1uLXZpZXcvZ3JpZC1kZXNrdG9wLWNvbHVtbi12aWV3LmNvbXBvbmVudC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiO0FBQUEsT0FBTyxFQUFFLFNBQVMsRUFBRSxLQUFLLEVBQUUsTUFBTSxlQUFlLENBQUM7QUFTakQsS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