import { __decorate } from "tslib";
import { Component, Input, Output, EventEmitter } from '@angular/core';
let GridMobileItemViewComponent = class GridMobileItemViewComponent {
    constructor() {
        this.check = new EventEmitter();
        this.onCheck = (item) => {
            this.check.emit(item);
        };
    }
};
__decorate([
    Input()
], GridMobileItemViewComponent.prototype, "gridOption", void 0);
__decorate([
    Input()
], GridMobileItemViewComponent.prototype, "item", void 0);
__decorate([
    Output()
], GridMobileItemViewComponent.prototype, "check", void 0);
GridMobileItemViewComponent = __decorate([
    Component({
        selector: 'sd-grid-mobile-item-view',
        template: "<ng-container *ngIf=\"gridOption && item\">\r\n  <ng-container *ngIf=\"gridOption?.mobileOrTablet?.htmlTemplate\">\r\n    <div [innerHTML]=\"(item | mobileViewHtmlTempate:gridOption.columns:gridOption?.mobileOrTablet?.htmlTemplate) | safeHtml\" (click)=\"onCheck(item)\">\r\n    </div>\r\n  </ng-container>\r\n  <ng-container *ngIf=\"!gridOption?.mobileOrTablet?.htmlTemplate\">\r\n    <ng-container *ngFor=\"let column of gridOption.columns | filterMobile:item\">\r\n      <div *ngIf=\"column.type !== 'children'\" class=\"row c-row\" (click)=\"onCheck(item)\">\r\n        <div class=\"col-5\">\r\n          <span class=\"c-title\">\r\n            {{item | columnTitle:column.title:column.dynamicTitle | async}}:\r\n          </span>\r\n        </div>\r\n        <div class=\"col-7\">\r\n          <ng-container *ngIf=\"column.type === 'string'\">\r\n            <span *ngIf=\"!column.htmlTemplate; else elseUseTemplate\"\r\n              [className]=\"item[column.field] | cellMobileClassName:item:column\">\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\">\r\n                {{item[column.field]}}</ng-container>\r\n            </span>\r\n            <ng-template #elseUseTemplate>\r\n              <span class=\"c-value\"\r\n                [innerHTML]=\"(item[column.field] | columnHtmlTemplate:item:column.htmlTemplate) | safeHtml\"></span>\r\n            </ng-template>\r\n            <ng-container\r\n              *ngIf=\"column.commands | columnCommandFilter:item | async; $implicit as filteredColumnCommands\">\r\n              <button *ngFor=\"let columnCommand of filteredColumnCommands\" (click)=\"columnCommand.click(item)\"\r\n                type=\"button\" class=\"c-btn-icon\" [matTooltip]=\"columnCommand.title | commandTitle:item\">\r\n                <i class=\"{{columnCommand.icon | commandIcon:item}}\" aria-hidden=\"true\" style=\"font-size: 14px;\"></i>\r\n              </button>\r\n            </ng-container>\r\n          </ng-container>\r\n          <span *ngIf=\"column.type === 'number'\" [className]=\"item[column.field] | cellMobileClassName:item:column\">\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          <span *ngIf=\"column.type === 'datetime'\" [className]=\"item[column.field] | cellMobileClassName:item:column\">\r\n            <a *ngIf=\"column.click\" href=\"javascript:;\"\r\n              (click)=\"column.click(item[column.field], item)\">{{item[column.field] | date:'dd/MM/yyyy HH:mm'}}</a>\r\n            <ng-container *ngIf=\"!column.click\">\r\n              {{item[column.field] | date:'dd/MM/yyyy HH:mm'}}</ng-container>\r\n          </span>\r\n          <span *ngIf=\"column.type === 'date'\" [className]=\"item[column.field] | cellMobileClassName:item:column\">\r\n            <a *ngIf=\"column.click\" href=\"javascript:;\"\r\n              (click)=\"column.click(item[column.field], item)\">{{item[column.field] | date:'dd/MM/yyyy'}}</a>\r\n            <ng-container *ngIf=\"!column.click\">\r\n              {{item[column.field] | date:'dd/MM/yyyy'}}</ng-container>\r\n          </span>\r\n          <span *ngIf=\"column.type === 'time'\" [className]=\"item[column.field] | cellMobileClassName:item:column\">\r\n            <a *ngIf=\"column.click\" href=\"javascript:;\"\r\n              (click)=\"column.click(item[column.field], item)\">{{item[column.field] | date:'HH:mm'}}</a>\r\n            <ng-container *ngIf=\"!column.click\">\r\n              {{item[column.field] | date:'HH:mm'}}</ng-container>\r\n          </span>\r\n          <span *ngIf=\"column.type === 'bool'\" [className]=\"item[column.field] | cellMobileClassName:item:column\"\r\n            (click)=\"column.click && column.click(item[column.field], item)\">\r\n            <span *ngIf=\"item[column.field]\" class=\"status status-success c-status\">{{column.trueValue || 'True'}}</span>\r\n            <span *ngIf=\"!item[column.field]\" class=\"status status-danger c-status\">{{column.falseValue || 'False'}}</span>\r\n          </span>\r\n          <span *ngIf=\"column.type === 'color'\" class=\"c-value\"><input disabled=\"true\" type=\"color\"\r\n              class=\"form-control form-control-sm\" [(ngModel)]=\"item[column.field]\"></span>\r\n          <ng-container *ngIf=\"column.type === 'values'\">\r\n            <ng-container *ngIf=\"column?.dictionary[item[column.field]] as dic; else elseNotInDic\">\r\n              <span *ngIf=\"dic.color || dic.backgroundColor; else elseNoStatus\" class=\"status c-status\"\r\n                [ngStyle]=\"{'color':dic.color, 'background-color': dic.backgroundColor}\">\r\n                {{dic.text}}\r\n              </span>\r\n              <ng-template #elseNoStatus>\r\n                <span class=\"c-value\">\r\n                  {{dic.text}}\r\n                </span>\r\n              </ng-template>\r\n            </ng-container>\r\n            <ng-template #elseNotInDic>\r\n              <span class=\"c-value\">\r\n                {{item[column.field]}}\r\n              </span>\r\n            </ng-template>\r\n          </ng-container>\r\n          <span *ngIf=\"column.type === 'radio'\" class=\"c-value\">{{item[column.field]}}</span>\r\n          <img *ngIf=\"column.type === 'image'\" [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)\">\r\n        </div>\r\n      </div>\r\n      <ng-container *ngIf=\"column.type === 'children' && column.children?.length\">\r\n        <div class=\"row c-row\" *ngFor=\"let childColumn of column.children | filterMobile:item\"\r\n          (click)=\"onCheck(item)\">\r\n          <div class=\"col-5\">\r\n            <span class=\"c-title\">\r\n              {{childColumn.title}}:\r\n            </span>\r\n          </div>\r\n          <div class=\"col-7\">\r\n            <ng-container *ngIf=\"childColumn.type === 'string'\">\r\n              <span *ngIf=\"!childColumn.htmlTemplate; else elseUseTemplate\"\r\n                [className]=\"item[childColumn.field] | cellMobileClassName:item:childColumn\"><a *ngIf=\"childColumn.click\"\r\n                  href=\"javascript:;\"\r\n                  (click)=\"childColumn.click(item[childColumn.field], item)\">{{item[childColumn.field]}}</a>\r\n                <ng-container *ngIf=\"!childColumn.click\">\r\n                  {{item[childColumn.field]}}</ng-container>\r\n              </span>\r\n              <ng-template #elseUseTemplate>\r\n                <span class=\"c-value\"\r\n                  [innerHTML]=\"(item[childColumn.field] | columnHtmlTemplate:item:childColumn.htmlTemplate) | safeHtml\"></span>\r\n              </ng-template>\r\n            </ng-container>\r\n            <span *ngIf=\"childColumn.type === 'number'\"\r\n              [className]=\"item[childColumn.field] | cellMobileClassName:item:childColumn\">\r\n              <a *ngIf=\"childColumn.click\" href=\"javascript:;\"\r\n                (click)=\"childColumn.click(item[childColumn.field], item)\">{{(item[childColumn.field] | valueTransform:item:childColumn) | number : '1.0-2'}}</a>\r\n              <ng-container *ngIf=\"!childColumn.click\">\r\n                {{(item[childColumn.field] | valueTransform:item:childColumn) | number : '1.0-2'}}</ng-container>\r\n            </span>\r\n            <span *ngIf=\"childColumn.type === 'datetime'\"\r\n              [className]=\"item[childColumn.field] | cellMobileClassName:item:childColumn\">\r\n              <a *ngIf=\"childColumn.click\" href=\"javascript:;\"\r\n                (click)=\"childColumn.click(item[childColumn.field], item)\">{{item[childColumn.field] | date:'dd/MM/yyyy HH:mm'}}</a>\r\n              <ng-container *ngIf=\"!childColumn.click\">\r\n                {{item[childColumn.field] | date:'dd/MM/yyyy HH:mm'}}</ng-container>\r\n            </span>\r\n            <span *ngIf=\"childColumn.type === 'date'\"\r\n              [className]=\"item[childColumn.field] | cellMobileClassName:item:childColumn\">\r\n              <a *ngIf=\"childColumn.click\" href=\"javascript:;\"\r\n                (click)=\"childColumn.click(item[childColumn.field], item)\">{{item[childColumn.field] | date:'dd/MM/yyyy'}}</a>\r\n              <ng-container *ngIf=\"!childColumn.click\">\r\n                {{item[childColumn.field] | date:'dd/MM/yyyy'}}</ng-container>\r\n            </span>\r\n            <span *ngIf=\"childColumn.type === 'time'\"\r\n              [className]=\"item[childColumn.field] | cellMobileClassName:item:childColumn\">\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'}}</ng-container>\r\n            </span>\r\n            <span *ngIf=\"childColumn.type === 'bool'\"\r\n              [className]=\"item[childColumn.field] | cellMobileClassName:item:childColumn\"\r\n              (click)=\"childColumn.click && childColumn.click(item[childColumn.field], item)\">\r\n              <span *ngIf=\"item[childColumn.field]\"\r\n                class=\"status status-success c-status\">{{childColumn.trueValue || 'True'}}</span>\r\n              <span *ngIf=\"!item[childColumn.field]\"\r\n                class=\"status status-danger c-status\">{{childColumn.falseValue || 'False'}}</span>\r\n            </span>\r\n            <span *ngIf=\"childColumn.type === 'color'\"\r\n              [className]=\"item[childColumn.field] | cellMobileClassName:item:childColumn\"\r\n              (click)=\"childColumn.click && childColumn.click(item[childColumn.field], item)\"><input disabled=\"true\"\r\n                type=\"color\" class=\"form-control form-control-sm\" [(ngModel)]=\"item[childColumn.field]\"></span>\r\n            <ng-container *ngIf=\"childColumn.type === 'values'\">\r\n              <ng-container *ngIf=\"childColumn?.dictionary[item[childColumn.field]] as dic; else elseNotInDic\">\r\n                <span *ngIf=\"dic.color || dic.backgroundColor; else elseNoStatus\" class=\"status c-status\"\r\n                  [ngStyle]=\"{'color':dic.color, 'background-color': dic.backgroundColor}\">\r\n                  {{dic.text}}\r\n                </span>\r\n                <ng-template #elseNoStatus>\r\n                  <span class=\"c-value\">\r\n                    {{dic.text}}\r\n                  </span>\r\n                </ng-template>\r\n              </ng-container>\r\n              <ng-template #elseNotInDic>\r\n                <span class=\"c-value\">\r\n                  {{item[childColumn.field]}}\r\n                </span>\r\n              </ng-template>\r\n            </ng-container>\r\n            <span *ngIf=\"childColumn.type === 'radio'\" class=\"c-value\">{{item[childColumn.field]}}</span>\r\n            <img *ngIf=\"childColumn.type === 'image'\" [src]=\"item[childColumn.field]\"\r\n              [width]=\"childColumn.display?.width\" [height]=\"childColumn.display?.height\" style=\"margin: 5px 0\"\r\n              (click)=\"column.click && column.click(item[column.field], item)\">\r\n          </div>\r\n        </div>\r\n      </ng-container>\r\n    </ng-container>\r\n  </ng-container>\r\n</ng-container>",
        styles: [".c-status.status{font-weight:500;padding:4px 8px;border-radius:1.5rem;display:inline-block;text-align:center;text-transform:uppercase}.c-row{margin:0 -8px 3px}.c-title{font-size:14px;margin-right:3px;font-weight:700;color:#212529}.c-value{font-size:14px;overflow-wrap:break-word;color:#212529}.c-badge{padding:5px!important;font-weight:500;font-size:14px}"]
    })
], GridMobileItemViewComponent);
export { GridMobileItemViewComponent };
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZ3JpZC1tb2JpbGUtaXRlbS12aWV3LmNvbXBvbmVudC5qcyIsInNvdXJjZVJvb3QiOiJuZzovL3N1cGVyZGV2LWFuZ3VsYXItY29yZS8iLCJzb3VyY2VzIjpbImxpYi9jb250cm9scy9ncmlkLWNvbnRyb2wvY29tcG9uZW50cy9ncmlkLW1vYmlsZS1pdGVtLXZpZXcvZ3JpZC1tb2JpbGUtaXRlbS12aWV3LmNvbXBvbmVudC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiO0FBQUEsT0FBTyxFQUFFLFNBQVMsRUFBRSxLQUFLLEVBQUUsTUFBTSxFQUFFLFlBQVksRUFBRSxNQUFNLGVBQWUsQ0FBQztBQVN2RSxJQUFhLDJCQUEyQixHQUF4QyxNQUFhLDJCQUEyQjtJQUl0QztRQURVLFVBQUssR0FBRyxJQU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