import * as tslib_1 from "tslib";
import { ensureEnum, NamePatcher, toSpinal, enumToString, getAllPropertyNames } from "igniteui-webcomponents-core";
import { WebComponentRenderer } from "igniteui-webcomponents-core";
import { delegateCombine, delegateRemove } from "igniteui-webcomponents-core";
import { DataGridStylingDefaults } from './DataGridStylingDefaults';
import { RegisterElementHelper } from "igniteui-webcomponents-core";
import { GridColumnFilterOptions } from "./GridColumnFilterOptions";
import { IgcGridColumnOptionsSectionBaseComponent } from "./igc-grid-column-options-section-base-component";
import { IgcFilterApplyButtonClickEventArgs } from './igc-filter-apply-button-click-event-args';
import { IgcFilterCancelButtonClickEventArgs } from './igc-filter-cancel-button-click-event-args';
import { ControlDisplayDensity_$type } from "igniteui-webcomponents-core";
var IgcGridColumnFilterOptionsComponent = /** @class */ /*@__PURE__*/ (function (_super) {
    tslib_1.__extends(IgcGridColumnFilterOptionsComponent, _super);
    function IgcGridColumnFilterOptionsComponent() {
        var _this = _super.call(this) || this;
        _this._disconnected = false;
        _this._applyButtonClick = null;
        _this._applyButtonClick_wrapped = null;
        _this._cancelButtonClick = null;
        _this._cancelButtonClick_wrapped = null;
        if (_this._styling) {
            NamePatcher.ensureStylablePatched(Object.getPrototypeOf(_this));
        }
        _this._webComponentRenderer = new WebComponentRenderer(_this, document, true, DataGridStylingDefaults);
        _this._webComponentWrapper = _this._webComponentRenderer.createElement("div");
        _this._webComponentRenderer.updateRoot(_this._webComponentWrapper);
        //this._webComponentRenderer.rootWrapper.append(this._webComponentWrapper);
        _this._webComponentWrapper.setStyleProperty("display", "block");
        _this._webComponentWrapper.setStyleProperty("width", "100%");
        _this._webComponentWrapper.setStyleProperty("height", "100%");
        _this.i.provideRenderer(_this._webComponentRenderer);
        return _this;
    }
    Object.defineProperty(IgcGridColumnFilterOptionsComponent.prototype, "height", {
        get: function () {
            return this._height;
        },
        set: function (value) {
            this._height = value;
            this.style.height = value;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgcGridColumnFilterOptionsComponent.prototype, "width", {
        get: function () {
            return this._width;
        },
        set: function (value) {
            this._width = value;
            this.style.width = value;
        },
        enumerable: true,
        configurable: true
    });
    // supports angular themes or custom properties set in CSS
    IgcGridColumnFilterOptionsComponent.prototype.updateStyle = function () {
        this._styling(this, this);
    };
    IgcGridColumnFilterOptionsComponent.prototype.destroy = function () {
        this._implementation.destroy();
        this._webComponentRenderer.destroy();
    };
    IgcGridColumnFilterOptionsComponent.prototype.createImplementation = function () {
        return new GridColumnFilterOptions();
    };
    Object.defineProperty(IgcGridColumnFilterOptionsComponent.prototype, "i", {
        get: function () {
            return this._implementation;
        },
        enumerable: true,
        configurable: true
    });
    IgcGridColumnFilterOptionsComponent.prototype.disconnectedCallback = function () {
        this._disconnected = true;
    };
    IgcGridColumnFilterOptionsComponent.prototype.connectedCallback = function () {
        if (this._disconnected) {
            this._disconnected = false;
            return;
        }
        this.classList.add("ig-grid-column-filter-options");
        this.classList.add("igc-grid-column-filter-options");
        var rootWrapper = this._webComponentRenderer.rootWrapper;
        var rootElement = rootWrapper.getNativeElement();
        this.appendChild(rootElement);
        this._attached = true;
        this.style.display = "block";
        this.style.height = this._height;
        this.style.width = this._width;
        var clearFiltersSection = document.createElement("div");
        clearFiltersSection.setAttribute("key", "clearFiltersSection");
        rootElement.appendChild(clearFiltersSection);
        var clearFiltersSectionWrapper = this._webComponentRenderer.getWrapper(clearFiltersSection);
        this.i.provideClearFiltersSection(clearFiltersSectionWrapper);
        var filtersSection = document.createElement("div");
        filtersSection.setAttribute("key", "filtersSection");
        rootElement.appendChild(filtersSection);
        var filtersSectionWrapper = this._webComponentRenderer.getWrapper(filtersSection);
        this.i.provideFilterSection(filtersSectionWrapper);
        var filterCheckboxListSection = this._webComponentRenderer.createElement("igc-checkbox-list");
        filterCheckboxListSection.setAttribute("key", "filterCheckboxListSection");
        filterCheckboxListSection.setAttribute("height", "195px");
        rootWrapper.append(filterCheckboxListSection);
        this.i.provideFilterCheckboxListSection(filterCheckboxListSection.getNativeElement().i);
        var filterButtonsSection = document.createElement("div");
        filterButtonsSection.setAttribute("key", "filterButtonsSection");
        rootElement.appendChild(filterButtonsSection);
        var filterButtonsSectionWrapper = this._webComponentRenderer.getWrapper(filterButtonsSection);
        this.i.provideFilterButtonSection(filterButtonsSectionWrapper);
        this._flushQueuedAttributes();
        // supports themes or custom properties set in CSS
        this._styling(this, this);
        this.afterContentInit();
    };
    IgcGridColumnFilterOptionsComponent.prototype.afterContentInit = function () {
    };
    Object.defineProperty(IgcGridColumnFilterOptionsComponent, "observedAttributes", {
        get: function () {
            if (IgcGridColumnFilterOptionsComponent._observedAttributesIgcGridColumnFilterOptionsComponent == null) {
                var names = getAllPropertyNames(IgcGridColumnFilterOptionsComponent);
                for (var i = 0; i < names.length; i++) {
                    names[i] = toSpinal(names[i]);
                }
                IgcGridColumnFilterOptionsComponent._observedAttributesIgcGridColumnFilterOptionsComponent = names;
            }
            return IgcGridColumnFilterOptionsComponent._observedAttributesIgcGridColumnFilterOptionsComponent;
        },
        enumerable: true,
        configurable: true
    });
    IgcGridColumnFilterOptionsComponent.register = function () {
        if (!IgcGridColumnFilterOptionsComponent._isElementRegistered) {
            IgcGridColumnFilterOptionsComponent._isElementRegistered = true;
            RegisterElementHelper.registerElement(IgcGridColumnFilterOptionsComponent.htmlTagName, IgcGridColumnFilterOptionsComponent);
        }
    };
    Object.defineProperty(IgcGridColumnFilterOptionsComponent.prototype, "applyButtonCaption", {
        get: function () {
            return this.i.b7;
        },
        set: function (v) {
            this.i.b7 = v;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgcGridColumnFilterOptionsComponent.prototype, "cancelButtonCaption", {
        get: function () {
            return this.i.cb;
        },
        set: function (v) {
            this.i.cb = v;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgcGridColumnFilterOptionsComponent.prototype, "clearColumnFiltersCaption", {
        get: function () {
            return this.i.cf;
        },
        set: function (v) {
            this.i.cf = v;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgcGridColumnFilterOptionsComponent.prototype, "filterListPlaceholderText", {
        get: function () {
            return this.i.ck;
        },
        set: function (v) {
            this.i.ck = v;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgcGridColumnFilterOptionsComponent.prototype, "filterListDensity", {
        /**
         * Gets or sets the display Density to use for the buttons in the component.
        */
        get: function () {
            return this.i.b1;
        },
        set: function (v) {
            this.i.b1 = ensureEnum(ControlDisplayDensity_$type, v);
            this._a("filterListDensity", enumToString(ControlDisplayDensity_$type, this.i.b1));
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgcGridColumnFilterOptionsComponent.prototype, "actualFilterListDensity", {
        /**
         * Gets the actual display filterListDensity to use for the component.
        */
        get: function () {
            return this.i.bz;
        },
        set: function (v) {
            this.i.bz = ensureEnum(ControlDisplayDensity_$type, v);
            this._a("actualFilterListDensity", enumToString(ControlDisplayDensity_$type, this.i.bz));
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgcGridColumnFilterOptionsComponent.prototype, "textFilterCaption", {
        get: function () {
            return this.i.co;
        },
        set: function (v) {
            this.i.co = v;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgcGridColumnFilterOptionsComponent.prototype, "applyButtonClick", {
        get: function () {
            return this._applyButtonClick;
        },
        set: function (ev) {
            var _this = this;
            if (this._applyButtonClick_wrapped !== null) {
                this.i.applyButtonClick = delegateRemove(this.i.applyButtonClick, this._applyButtonClick_wrapped);
                this._applyButtonClick_wrapped = null;
                this._applyButtonClick = null;
            }
            this._applyButtonClick = ev;
            this._applyButtonClick_wrapped = function (o, e) {
                var outerArgs = new IgcFilterApplyButtonClickEventArgs();
                outerArgs._provideImplementation(e);
                if (_this.beforeApplyButtonClick) {
                    _this.beforeApplyButtonClick(_this, outerArgs);
                }
                if (_this._applyButtonClick) {
                    _this._applyButtonClick(_this, outerArgs);
                }
            };
            this.i.applyButtonClick = delegateCombine(this.i.applyButtonClick, this._applyButtonClick_wrapped);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgcGridColumnFilterOptionsComponent.prototype, "cancelButtonClick", {
        get: function () {
            return this._cancelButtonClick;
        },
        set: function (ev) {
            var _this = this;
            if (this._cancelButtonClick_wrapped !== null) {
                this.i.cancelButtonClick = delegateRemove(this.i.cancelButtonClick, this._cancelButtonClick_wrapped);
                this._cancelButtonClick_wrapped = null;
                this._cancelButtonClick = null;
            }
            this._cancelButtonClick = ev;
            this._cancelButtonClick_wrapped = function (o, e) {
                var outerArgs = new IgcFilterCancelButtonClickEventArgs();
                outerArgs._provideImplementation(e);
                if (_this.beforeCancelButtonClick) {
                    _this.beforeCancelButtonClick(_this, outerArgs);
                }
                if (_this._cancelButtonClick) {
                    _this._cancelButtonClick(_this, outerArgs);
                }
            };
            this.i.cancelButtonClick = delegateCombine(this.i.cancelButtonClick, this._cancelButtonClick_wrapped);
        },
        enumerable: true,
        configurable: true
    });
    IgcGridColumnFilterOptionsComponent._observedAttributesIgcGridColumnFilterOptionsComponent = null;
    IgcGridColumnFilterOptionsComponent.htmlTagName = "igc-grid-column-filter-options";
    IgcGridColumnFilterOptionsComponent._isElementRegistered = false;
    return IgcGridColumnFilterOptionsComponent;
}(IgcGridColumnOptionsSectionBaseComponent));
export { IgcGridColumnFilterOptionsComponent };
//# sourceMappingURL=igc-grid-column-filter-options-component.js.map
