import { __decorate } from "tslib";
import { Component, Input, Output, EventEmitter } from '@angular/core';
import { DeviceDetectorService } from 'ngx-device-detector';
let GridDesktopInlineFilterComponent = class GridDesktopInlineFilterComponent {
    constructor(deviceService) {
        this.deviceService = deviceService;
        this.externalFilters = [];
        this.columns = [];
        this.externalFilter = {};
        this.filter = {};
        this.showInlineFilter = false;
        this.showColumnInlineFilter = false;
        this.sdChange = new EventEmitter();
        this.displayKey = 'SDCUSTOM';
        this.onUpdateFilter = () => {
            this.sdChange.emit();
        };
        this.isDesktop = this.deviceService.isDesktop();
    }
};
GridDesktopInlineFilterComponent.ctorParameters = () => [
    { type: DeviceDetectorService }
];
__decorate([
    Input()
], GridDesktopInlineFilterComponent.prototype, "externalFilters", void 0);
__decorate([
    Input()
], GridDesktopInlineFilterComponent.prototype, "columns", void 0);
__decorate([
    Input()
], GridDesktopInlineFilterComponent.prototype, "externalFilter", void 0);
__decorate([
    Input()
], GridDesktopInlineFilterComponent.prototype, "filter", void 0);
__decorate([
    Input()
], GridDesktopInlineFilterComponent.prototype, "showInlineFilter", void 0);
__decorate([
    Input()
], GridDesktopInlineFilterComponent.prototype, "showColumnInlineFilter", void 0);
__decorate([
    Output()
], GridDesktopInlineFilterComponent.prototype, "sdChange", void 0);
GridDesktopInlineFilterComponent = __decorate([
    Component({
        selector: 'sd-grid-desktop-inline-filter',
        template: "<ng-container *ngIf=\"isDesktop && showInlineFilter\">\r\n  <div *ngIf=\"externalFilters?.length\" class=\"row\">\r\n    <ng-container *ngFor=\"let item of externalFilters\">\r\n      <div *ngIf=\"item.type !=='daterange' && item.type !=='numberrange';else elseFilterRange\"\r\n        class=\"col-lg-2 col-md-3 col-sm-6\">\r\n        <sd-input-control [label]=\"item.title\" *ngIf=\"item.type === 'string'\" type=\"text\"\r\n          [(model)]=\"externalFilter[item.field]\" (keyupEnter)=\"onUpdateFilter()\">\r\n        </sd-input-control>\r\n        <sd-input-control [label]=\"item.title\" *ngIf=\"item.type === 'number'\" type=\"number\"\r\n          [(model)]=\"externalFilter[item.field]\" (keyupEnter)=\"onUpdateFilter()\">\r\n        </sd-input-control>\r\n        <sd-select-control [label]=\"item.title\" *ngIf=\"item.type === 'bool'\" [items]=\"[{value:'1',display:item.trueValue || 'True' },\r\n          {value:'0',display:item.falseValue || 'False' }]\" valueField=\"value\" displayField=\"display\"\r\n          [(model)]=\"externalFilter[item.field]\" (sdChange)=\"onUpdateFilter()\">\r\n        </sd-select-control>\r\n        <sd-radio-control [label]=\"item.title\" *ngIf=\"item.type === 'radio'\" [items]=\"item.values\"\r\n          [valueField]=\"item.valueField\" [displayField]=\"item.displayField\" [(model)]=\"externalFilter[item.field]\"\r\n          (sdChange)=\"onUpdateFilter()\">\r\n        </sd-radio-control>\r\n        <sd-input-control [label]=\"item.title\" *ngIf=\"item.type === 'custom'\"\r\n          [(model)]=\"externalFilter[displayKey + item.field]\"\r\n          (sdClick)=\"item?.onClick(externalFilter, item.field, displayKey + item.field)\" (sdChange)=\"onUpdateFilter()\">\r\n        </sd-input-control>\r\n        <ng-container *ngIf=\"item.type === 'values'\">\r\n          <sd-select-control *ngIf=\"item.selection === 'MULTIPLE'\" [label]=\"item.title\" [items]=\"item.values\"\r\n            [valueField]=\"item.valueField\" [displayField]=\"item.displayField\" [(model)]=\"externalFilter[item.field]\"\r\n            (sdChange)=\"onUpdateFilter()\" multiple=\"true\">\r\n          </sd-select-control>\r\n          <sd-autocomplete-control *ngIf=\"item.selection === 'AUTOCOMPLETE'\" [label]=\"item.title\" [items]=\"item.values\"\r\n            [valueField]=\"item.valueField\" [displayField]=\"item.displayField\" [(model)]=\"externalFilter[item.field]\"\r\n            (sdChange)=\"onUpdateFilter()\">\r\n          </sd-autocomplete-control>\r\n          <sd-chip-control *ngIf=\"item.selection === 'MULTIPLEAUTOCOMPLETE'\" [label]=\"item.title\" [items]=\"item.values\"\r\n            [valueField]=\"item.valueField\" [displayField]=\"item.displayField\" [(model)]=\"externalFilter[item.field]\"\r\n            (sdChange)=\"onUpdateFilter()\">\r\n          </sd-chip-control>\r\n          <sd-select-control *ngIf=\"!item.selection\" [label]=\"item.title\" [items]=\"item.values\"\r\n            [valueField]=\"item.valueField\" [displayField]=\"item.displayField\" [(model)]=\"externalFilter[item.field]\"\r\n            (sdChange)=\"onUpdateFilter()\">\r\n          </sd-select-control>\r\n        </ng-container>\r\n        <sd-date-picker-control [label]=\"item.title\" *ngIf=\"item.type ==='date'\" [(model)]=\"externalFilter[item.field]\"\r\n          type=\"date\" (sdChange)=\"onUpdateFilter()\">\r\n        </sd-date-picker-control>\r\n        <sd-date-range-picker-control [label]=\"item.title\" *ngIf=\"item.type ==='daterangefull'\"\r\n          [(fromDate)]=\"externalFilter[item.field].from\" [(toDate)]=\"externalFilter[item.field].to\"\r\n          [minDate]=\"item.minDate\" [maxDate]=\"item.maxDate\" type=\"date\"\r\n          (sdChange)=\"onUpdateFilter()\">\r\n        </sd-date-range-picker-control>\r\n      </div>\r\n      <ng-template #elseFilterRange>\r\n        <ng-container *ngIf=\"item.type ==='daterange' && externalFilter[item.field]\">\r\n          <div class=\"col-lg-2 col-md-3 col-sm-6\">\r\n            <sd-date-picker-control [label]=\"item.fromTitle\" [(model)]=\"externalFilter[item.field].from\"\r\n              [type]=\"item.enableTime ? 'datetime' : 'date'\" [minDate]=\"item.minDate\"\r\n              [maxDate]=\"externalFilter[item.field].to || item.maxDate\" (sdChange)=\"onUpdateFilter()\">\r\n            </sd-date-picker-control>\r\n          </div>\r\n          <div class=\"col-lg-2 col-md-3 col-sm-6\">\r\n            <sd-date-picker-control [label]=\"item.toTitle\" [(model)]=\"externalFilter[item.field].to\"\r\n              [type]=\"item.enableTime ? 'datetime' : 'date'\" [minDate]=\"item.minDate || externalFilter[item.field].from\"\r\n              [maxDate]=\"item.maxDate\" (sdChange)=\"onUpdateFilter()\">\r\n            </sd-date-picker-control>\r\n          </div>\r\n        </ng-container>\r\n        <ng-container *ngIf=\"item.type ==='numberrange' && externalFilter[item.field]\">\r\n          <div class=\"col-lg-2 col-md-3 col-sm-6\">\r\n            <sd-input-control [label]=\"item.fromTitle\" type=\" number\" [(model)]=\"externalFilter[item.field].from\"\r\n              (sdChange)=\"onUpdateFilter()\">\r\n            </sd-input-control>\r\n          </div>\r\n          <div class=\"col-lg-2 col-md-3 col-sm-6\">\r\n            <sd-input-control [label]=\"item.toTitle\" type=\" number\" [(model)]=\"externalFilter[item.field].to\"\r\n              (sdChange)=\"onUpdateFilter()\">\r\n            </sd-input-control>\r\n          </div>\r\n        </ng-container>\r\n      </ng-template>\r\n    </ng-container>\r\n  </div>\r\n\r\n  <div *ngIf=\"columns?.length && showColumnInlineFilter\" class=\"row\">\r\n    <ng-container *ngFor=\"let item of columns\">\r\n      <div class=\"col-lg-2 col-md-3 col-sm-6\">\r\n        <sd-input-control [label]=\"item.title\" *ngIf=\"item.type === 'string'\" type=\"text\" [(model)]=\"filter[item.field]\"\r\n          (keyupEnter)=\"onUpdateFilter()\">\r\n        </sd-input-control>\r\n        <sd-input-control [label]=\"item.title\" *ngIf=\"item.type === 'number'\" type=\"number\"\r\n          [(model)]=\"filter[item.field]\" (keyupEnter)=\"onUpdateFilter()\">\r\n        </sd-input-control>\r\n        <sd-select-control [label]=\"item.title\" *ngIf=\"item.type === 'bool'\" [items]=\"[{value:'1',display:item.trueValue || 'True' },\r\n          {value:'0',display:item.falseValue || 'False' }]\" valueField=\"value\" displayField=\"display\"\r\n          [(model)]=\"filter[item.field]\" (sdChange)=\"onUpdateFilter()\">\r\n        </sd-select-control>\r\n        <sd-radio-control [label]=\"item.title\" *ngIf=\"item.type === 'radio'\" [items]=\"item.values\"\r\n          [valueField]=\"item.valueField\" [displayField]=\"item.displayField\" [(model)]=\"externalFilter[item.field]\"\r\n          (sdChange)=\"onUpdateFilter()\">\r\n        </sd-radio-control>\r\n        <sd-select-control *ngIf=\"item.type === 'values'\" [label]=\"item.title\" [items]=\"item.values\"\r\n          [valueField]=\"item.valueField\" [displayField]=\"item.displayField\" [(model)]=\"externalFilter[item.field]\"\r\n          (sdChange)=\"onUpdateFilter()\">\r\n        </sd-select-control>\r\n        <sd-date-picker-control [label]=\"item.title\" *ngIf=\"item.type ==='date'\" [(model)]=\"externalFilter[item.field]\"\r\n          type=\"date\" (sdChange)=\"onUpdateFilter()\">\r\n        </sd-date-picker-control>\r\n      </div>\r\n    </ng-container>\r\n  </div>\r\n</ng-container>",
        styles: [""]
    })
], GridDesktopInlineFilterComponent);
export { GridDesktopInlineFilterComponent };
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZ3JpZC1kZXNrdG9wLWlubGluZS1maWx0ZXIuY29tcG9uZW50LmpzIiwic291cmNlUm9vdCI6Im5nOi8vc3VwZXJkZXYtYW5ndWxhci1jb3JlLyIsInNvdXJjZXMiOlsibGliL2NvbnRyb2xzL2dyaWQtY29udHJvbC9jb21wb25lbnRzL2dyaWQtZGVza3RvcC1pbmxpbmUtZmlsdGVyL2dyaWQtZGVza3RvcC1pbmxpbmUtZmlsdGVyLmNvbXBvbmVudC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiO0FBQUEsT0FBTyxFQUFFLFNBQVMsRUFBRSxLQUFLLEVBQUUsTUFBTSxFQUFFLFlBQVksRUFBRSxNQUFNLGVBQWUsQ0FBQztBQUd2RSxPQUFPLEVBQUUscUJBQXFCLEVBQUUsTUFBTSxxQkFBcUIsQ0FBQztBQU81RCxJQUFhLGdDQUFnQyxHQUE3QyxNQUFhLGdDQUFnQztJQVUzQyxZQUNVLGFBQW9DO1FBQXBDLGtCQUFhLEdBQWIsYUFBYSxDQUF1QjtRQVZyQyxvQkFBZSxHQUF5QixFQUFFLENBQUM7UUFDM0MsWUFBTyxHQUFpQixFQUFFLENBQUM7UUFDM0IsbUJBQWMsR0FBUSxFQUFFLENBQUM7UUFDekIsV0FBTSxHQUFRLEVBQUUsQ0FBQztRQUNqQixxQkFBZ0IsR0FBRyxLQUFLLENBQUM7UUFDekIsMkJBQXNCLEdB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