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";
export let IgcGridColumnFilterOptionsComponent = /*@__PURE__*/ (() => {
    class IgcGridColumnFilterOptionsComponent extends IgcGridColumnOptionsSectionBaseComponent {
        constructor() {
            super();
            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);
        }
        set height(value) {
            this._height = value;
            this.style.height = value;
        }
        get height() {
            return this._height;
        }
        set width(value) {
            this._width = value;
            this.style.width = value;
        }
        get width() {
            return this._width;
        }
        // supports angular themes or custom properties set in CSS
        updateStyle() {
            this._styling(this, this);
        }
        destroy() {
            this._implementation.destroy();
            this._webComponentRenderer.destroy();
        }
        createImplementation() {
            return new GridColumnFilterOptions();
        }
        get i() {
            return this._implementation;
        }
        disconnectedCallback() {
            this._disconnected = true;
        }
        connectedCallback() {
            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();
        }
        afterContentInit() {
        }
        static get observedAttributes() {
            if (IgcGridColumnFilterOptionsComponent._observedAttributesIgcGridColumnFilterOptionsComponent == null) {
                let names = getAllPropertyNames(IgcGridColumnFilterOptionsComponent);
                for (let i = 0; i < names.length; i++) {
                    names[i] = toSpinal(names[i]);
                }
                IgcGridColumnFilterOptionsComponent._observedAttributesIgcGridColumnFilterOptionsComponent = names;
            }
            return IgcGridColumnFilterOptionsComponent._observedAttributesIgcGridColumnFilterOptionsComponent;
        }
        static register() {
            if (!IgcGridColumnFilterOptionsComponent._isElementRegistered) {
                IgcGridColumnFilterOptionsComponent._isElementRegistered = true;
                RegisterElementHelper.registerElement(IgcGridColumnFilterOptionsComponent.htmlTagName, IgcGridColumnFilterOptionsComponent);
            }
        }
        get applyButtonCaption() {
            return this.i.b7;
        }
        set applyButtonCaption(v) {
            this.i.b7 = v;
        }
        get cancelButtonCaption() {
            return this.i.cb;
        }
        set cancelButtonCaption(v) {
            this.i.cb = v;
        }
        get clearColumnFiltersCaption() {
            return this.i.cf;
        }
        set clearColumnFiltersCaption(v) {
            this.i.cf = v;
        }
        get filterListPlaceholderText() {
            return this.i.ck;
        }
        set filterListPlaceholderText(v) {
            this.i.ck = v;
        }
        /**
         * Gets or sets the display Density to use for the buttons in the component.
        */
        get filterListDensity() {
            return this.i.b1;
        }
        set filterListDensity(v) {
            this.i.b1 = ensureEnum(ControlDisplayDensity_$type, v);
            this._a("filterListDensity", enumToString(ControlDisplayDensity_$type, this.i.b1));
        }
        /**
         * Gets the actual display filterListDensity to use for the component.
        */
        get actualFilterListDensity() {
            return this.i.bz;
        }
        set actualFilterListDensity(v) {
            this.i.bz = ensureEnum(ControlDisplayDensity_$type, v);
            this._a("actualFilterListDensity", enumToString(ControlDisplayDensity_$type, this.i.bz));
        }
        get textFilterCaption() {
            return this.i.co;
        }
        set textFilterCaption(v) {
            this.i.co = v;
        }
        get applyButtonClick() {
            return this._applyButtonClick;
        }
        set applyButtonClick(ev) {
            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 = (o, e) => {
                let 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);
        }
        get cancelButtonClick() {
            return this._cancelButtonClick;
        }
        set cancelButtonClick(ev) {
            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 = (o, e) => {
                let 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);
        }
    }
    IgcGridColumnFilterOptionsComponent._observedAttributesIgcGridColumnFilterOptionsComponent = null;
    IgcGridColumnFilterOptionsComponent.htmlTagName = "igc-grid-column-filter-options";
    IgcGridColumnFilterOptionsComponent._isElementRegistered = false;
    return IgcGridColumnFilterOptionsComponent;
})();
//# sourceMappingURL=igc-grid-column-filter-options-component.js.map
