import { __decorate } from "tslib";
import { Component, Input, Output, EventEmitter } from '@angular/core';
let GridDesktopInlineFilterComponent = class GridDesktopInlineFilterComponent {
    constructor() {
        this.columns = [];
        this.externalFilter = {};
        this.filter = {};
        this.inlineExternal = {};
        this.inlineColumn = {};
        this.sdChange = new EventEmitter();
        this.displayKey = 'SDCUSTOM';
        this.onUpdateFilter = () => {
            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-0 mt-5\">\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);
export { GridDesktopInlineFilterComponent };
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZ3JpZC1kZXNrdG9wLWlubGluZS1maWx0ZXIuY29tcG9uZW50LmpzIiwic291cmNlUm9vdCI6Im5nOi8vc3VwZXJkZXYtYW5ndWxhci1jb3JlLyIsInNvdXJjZXMiOlsibGliL2NvbnRyb2xzL2dyaWQtY29udHJvbC9jb21wb25lbnRzL2dyaWQtZGVza3RvcC1pbmxpb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