import { __decorate } from "tslib";
import { Component, Input, Output, EventEmitter } from '@angular/core';
var GridDesktopInlineFilterComponent = /** @class */ (function () {
    function GridDesktopInlineFilterComponent() {
        var _this = this;
        this.columns = [];
        this.externalFilter = {};
        this.filter = {};
        this.inlineExternal = {};
        this.inlineColumn = {};
        this.sdChange = new EventEmitter();
        this.displayKey = 'SDCUSTOM';
        this.onUpdateFilter = function () {
            _this.sdChange.emit();
        };
    }
    __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, "filterOption", void 0);
    __decorate([
        Input()
    ], GridDesktopInlineFilterComponent.prototype, "inlineExternal", void 0);
    __decorate([
        Input()
    ], GridDesktopInlineFilterComponent.prototype, "inlineColumn", void 0);
    __decorate([
        Output()
    ], GridDesktopInlineFilterComponent.prototype, "sdChange", void 0);
    GridDesktopInlineFilterComponent = __decorate([
        Component({
            selector: 'sd-grid-desktop-inline-filter',
            template: "<div *ngIf=\"filterOption?.multiple !== false\" class=\"row mx-n8\">\r\n  <ng-container *ngIf=\"filterOption?.externalFilters?.length\">\r\n    <ng-container *ngFor=\"let item of filterOption.externalFilters\">\r\n      <ng-container\r\n        *ngIf=\"(inlineExternal[item.field] || inlineExternal[item.field] === undefined) && item.priority !== 'low'\">\r\n        <div *ngIf=\"item.type !=='daterange' && item.type !=='numberrange';else elseFilterRange\"\r\n          class=\"col-lg-2 col-md-3 col-sm-6 px-8\">\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            (sdFocusForceBlur)=\"item?.onClick(externalFilter, item.field, displayKey + item.field)\"\r\n            (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\"\r\n              [items]=\"item.values\" [valueField]=\"item.valueField\" [displayField]=\"item.displayField\"\r\n              [(model)]=\"externalFilter[item.field]\" (sdChange)=\"onUpdateFilter()\">\r\n            </sd-autocomplete-control>\r\n            <sd-chip-control *ngIf=\"item.selection === 'MULTIPLEAUTOCOMPLETE'\" [label]=\"item.title\"\r\n              [items]=\"item.values\" [valueField]=\"item.valueField\" [displayField]=\"item.displayField\"\r\n              [(model)]=\"externalFilter[item.field]\" (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'\"\r\n            [(model)]=\"externalFilter[item.field]\" 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\" (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 px-8\">\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 px-8\">\r\n              <sd-date-picker-control [label]=\"item.toTitle\" [(model)]=\"externalFilter[item.field].to\"\r\n                [type]=\"item.enableTime ? 'datetime' : 'date'\"\r\n                [minDate]=\"item.minDate || externalFilter[item.field].from\" [maxDate]=\"item.maxDate\"\r\n                (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 px-8\">\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 px-8\">\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    </ng-container>\r\n  </ng-container>\r\n  <ng-container *ngIf=\"columns?.length && filterOption?.columnInline === 'outside'\">\r\n    <ng-container *ngFor=\"let item of columns\">\r\n      <ng-container\r\n        *ngIf=\"item.type !== 'children' && item.type !== 'image' && !item?.filter?.disabled && item.priority !== 'low'\">\r\n        <ng-container *ngIf=\"inlineColumn[item.field] || inlineColumn[item.field] === undefined\">\r\n          <div class=\"col-lg-2 col-md-3 col-sm-6 px-8\">\r\n            <sd-input-control [label]=\"item.title\" *ngIf=\"item.type === 'string'\" type=\"text\"\r\n              [(model)]=\"filter[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)]=\"filter[item.field]\" (keyupEnter)=\"onUpdateFilter()\">\r\n            </sd-input-control>\r\n            <sd-radio-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-radio-control>\r\n            <sd-select-control [label]=\"item.title\" *ngIf=\"item.type === 'radio'\" [items]=\"item.values\"\r\n              [valueField]=\"item.valueField\" [displayField]=\"item.displayField\" [(model)]=\"filter[item.field]\"\r\n              (sdChange)=\"onUpdateFilter()\">\r\n            </sd-select-control>\r\n            <sd-select-control *ngIf=\"item.type === 'values' && !item?.editor?.autocomplete\" [label]=\"item.title\"\r\n              [items]=\"item.values\" valueField=\"value\" displayField=\"text\" [(model)]=\"filter[item.field]\"\r\n              (sdChange)=\"onUpdateFilter()\">\r\n            </sd-select-control>\r\n            <sd-autocomplete-control *ngIf=\"item.type === 'values' && item?.editor?.autocomplete\" [items]=\"item.values\"\r\n              valueField=\"value\" displayField=\"text\" [(model)]=\"filter[item.field]\" (sdChange)=\"onUpdateFilter()\">\r\n            </sd-autocomplete-control>\r\n            <sd-date-picker-control *ngIf=\"item.type === 'date' || item.type === 'datetime' || item.type === 'time'\"\r\n              [label]=\"item.title\" [(model)]=\"filter[item.field]\" type=\"date\" (sdChange)=\"onUpdateFilter()\">\r\n            </sd-date-picker-control>\r\n          </div>\r\n        </ng-container>\r\n      </ng-container>\r\n      <ng-container\r\n        *ngIf=\"item.type === 'children' && item.children?.length && !item?.filter?.disabled && item.priority !== 'low'\">\r\n        <ng-container *ngFor=\"let childColumn of item.children\">\r\n          <ng-container\r\n            *ngIf=\"inlineColumn[childColumn.field] && !childColumn?.filter?.disabled && childColumn.priority !== 'low' && childColumn.type !== 'image'\">\r\n            <div class=\"col-lg-2 col-md-3 col-sm-6 px-8\">\r\n              <sd-input-control [label]=\"childColumn.title\" *ngIf=\"childColumn.type === 'string'\" type=\"text\"\r\n                [(model)]=\"filter[childColumn.field]\" (keyupEnter)=\"onUpdateFilter()\">\r\n              </sd-input-control>\r\n              <sd-input-control [label]=\"childColumn.title\" *ngIf=\"childColumn.type === 'number'\" type=\"number\"\r\n                [(model)]=\"filter[childColumn.field]\" (keyupEnter)=\"onUpdateFilter()\">\r\n              </sd-input-control>\r\n              <sd-radio-control [label]=\"childColumn.title\" *ngIf=\"childColumn.type === 'bool'\" [items]=\"[{value:'1',display:childColumn.trueValue || 'True' },\r\n            {value:'0',display:childColumn.falseValue || 'False' }]\" valueField=\"value\" displayField=\"display\"\r\n                [(model)]=\"filter[childColumn.field]\" (sdChange)=\"onUpdateFilter()\">\r\n              </sd-radio-control>\r\n              <sd-select-control [label]=\"childColumn.title\" *ngIf=\"childColumn.type === 'radio'\"\r\n                [items]=\"childColumn.values\" [valueField]=\"childColumn.valueField\"\r\n                [displayField]=\"childColumn.displayField\" [(model)]=\"filter[childColumn.field]\"\r\n                (sdChange)=\"onUpdateFilter()\">\r\n              </sd-select-control>\r\n              <sd-select-control *ngIf=\"childColumn.type === 'values' && !item?.editor?.autocomplete\"\r\n                [label]=\"childColumn.title\" [items]=\"childColumn.values\" valueField=\"value\" displayField=\"text\"\r\n                [(model)]=\"filter[childColumn.field]\" (sdChange)=\"onUpdateFilter()\">\r\n              </sd-select-control>\r\n              <sd-autocomplete-control *ngIf=\"childColumn.type === 'values' && item?.editor?.autocomplete\"\r\n                [items]=\"childColumn.values\" valueField=\"value\" displayField=\"text\"\r\n                [(model)]=\"filter[childColumn.field]\" (sdChange)=\"onUpdateFilter()\">\r\n              </sd-autocomplete-control>\r\n              <sd-date-picker-control\r\n                *ngIf=\"childColumn.type === 'date' || childColumn.type === 'datetime' || childColumn.type === 'time'\"\r\n                [label]=\"childColumn.title\" [(model)]=\"filter[childColumn.field]\" type=\"date\"\r\n                (sdChange)=\"onUpdateFilter()\">\r\n              </sd-date-picker-control>\r\n            </div>\r\n          </ng-container>\r\n        </ng-container>\r\n      </ng-container>\r\n    </ng-container>\r\n  </ng-container>\r\n</div>",
            styles: [""]
        })
    ], GridDesktopInlineFilterComponent);
    return GridDesktopInlineFilterComponent;
}());
export { GridDesktopInlineFilterComponent };
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZ3JpZC1kZXNrdG9wLWlubGluZS1maWx0ZXIuY29tcG9uZW50LmpzIiwic291cmNlUm9vdCI6Im5nOi8vc3VwZXJkZXYtYW5ndWxhci1jb3JlLyIsInNvdXJjZXMiOlsibGliL2NvbnRyb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