import { ensureEnum, ensureBool, NamePatcher, toSpinal, enumToString, getAllPropertyNames } from "igniteui-webcomponents-core";
import { FontInfo } 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 { GridColumnOptions } from "./GridColumnOptions";
import { IgcGridColumnOptionsBaseComponent } from "./igc-grid-column-options-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 IgcGridColumnOptionsComponent = /*@__PURE__*/ (() => {
    class IgcGridColumnOptionsComponent extends IgcGridColumnOptionsBaseComponent {
        constructor() {
            super();
            this._disconnected = false;
            this._filterApplyButtonClick = null;
            this._filterApplyButtonClick_wrapped = null;
            this._filterCancelButtonClick = null;
            this._filterCancelButtonClick_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._webComponentWrapper.setStyleProperty("display", "block");
            this._webComponentWrapper.setStyleProperty("width", "100%");
            this._webComponentWrapper.setStyleProperty("height", "100%");
            this.i.provideRenderer(this._webComponentRenderer);
            this.i.notifySizeChanged();
            this._webComponentRenderer.addSizeWatcher(() => {
                this.i.notifySizeChanged();
            });
        }
        set height(value) {
            this._height = value;
            this.style.height = value;
            this.i.notifySizeChanged();
        }
        get height() {
            return this._height;
        }
        set width(value) {
            this._width = value;
            this.style.width = value;
            this.i.notifySizeChanged();
        }
        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 GridColumnOptions();
        }
        get i() {
            return this._implementation;
        }
        disconnectedCallback() {
            this._disconnected = true;
        }
        connectedCallback() {
            if (this._disconnected) {
                this._disconnected = false;
                return;
            }
            this.classList.add("ig-grid-column-options");
            this.classList.add("igc-grid-column-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 headerSection = document.createElement("div");
            headerSection.setAttribute("key", "headerSection");
            rootElement.appendChild(headerSection);
            var headerSectionWrapper = this._webComponentRenderer.getWrapper(headerSection);
            // Sub-section of the header
            var headerColumnNameSection = document.createElement("div");
            headerColumnNameSection.setAttribute("key", "headerColumnNameSection");
            headerSection.appendChild(headerColumnNameSection);
            var headerColumnNameSectionWrapper = this._webComponentRenderer.getWrapper(headerColumnNameSection);
            // Sub-section of the header
            var headerButtonsSection = document.createElement("div");
            headerButtonsSection.setAttribute("key", "headerButtonsSection");
            headerSection.appendChild(headerButtonsSection);
            var headerButtonsSectionWrapper = this._webComponentRenderer.getWrapper(headerButtonsSection);
            // Sub-section of the header
            var groupSection = document.createElement("div");
            groupSection.setAttribute("key", "groupSection");
            var groupSectionWrapper = this._webComponentRenderer.getWrapper(groupSection);
            headerButtonsSection.appendChild(groupSection);
            // Sub-section of the header
            var hideSection = document.createElement("div");
            hideSection.setAttribute("key", "hideSection");
            var hideSectionWrapper = this._webComponentRenderer.getWrapper(hideSection);
            headerButtonsSection.appendChild(hideSection);
            var sortSection = document.createElement("div");
            sortSection.setAttribute("key", "sortSection");
            var sortSectionWrapper = this._webComponentRenderer.getWrapper(sortSection);
            rootElement.appendChild(sortSection);
            var sortOptions = this._webComponentRenderer.createElement("igc-grid-column-sort-options");
            sortOptions.setAttribute("key", "sortOptions");
            sortSectionWrapper.append(sortOptions);
            var moveSection = document.createElement("div");
            moveSection.setAttribute("key", "moveSection");
            var moveSectionWrapper = this._webComponentRenderer.getWrapper(moveSection);
            rootElement.appendChild(moveSection);
            var moveOptions = this._webComponentRenderer.createElement("igc-grid-column-move-options");
            moveOptions.setAttribute("key", "moveOptions");
            moveSectionWrapper.append(moveOptions);
            var pinSection = document.createElement("div");
            pinSection.setAttribute("key", "pinSection");
            var pinSectionWrapper = this._webComponentRenderer.getWrapper(pinSection);
            rootElement.appendChild(pinSection);
            var pinOptions = this._webComponentRenderer.createElement("igc-grid-column-pin-options");
            pinOptions.setAttribute("key", "pinOptions");
            pinSectionWrapper.append(pinOptions);
            var hideOptions = this._webComponentRenderer.createElement("igc-grid-column-hide-options");
            hideOptions.setAttribute("key", "hideOptions");
            hideSectionWrapper.append(hideOptions);
            var groupOptions = this._webComponentRenderer.createElement("igc-grid-column-group-options");
            groupOptions.setAttribute("key", "groupOptions");
            groupSectionWrapper.append(groupOptions);
            // Summary Section
            var summarySection = document.createElement("div");
            summarySection.setAttribute("key", "summarySection");
            var summarySectionWrapper = this._webComponentRenderer.getWrapper(summarySection);
            rootElement.appendChild(summarySection);
            var summaryOptions = this._webComponentRenderer.createElement("igc-grid-column-summary-options");
            summaryOptions.setAttribute("key", "summaryOptions");
            summarySectionWrapper.append(summaryOptions);
            ///////////////////
            var filterSection = document.createElement("div");
            filterSection.setAttribute("key", "filterSection");
            var filterSectionWrapper = this._webComponentRenderer.getWrapper(filterSection);
            rootElement.appendChild(filterSection);
            var filterOptions = this._webComponentRenderer.createElement("igc-grid-column-filter-options");
            filterOptions.setAttribute("key", "filterOptions");
            filterSectionWrapper.append(filterOptions);
            this.i.provideContent(headerSectionWrapper, sortSectionWrapper, moveSectionWrapper, pinSectionWrapper, filterSectionWrapper, summarySectionWrapper, headerColumnNameSectionWrapper, headerButtonsSectionWrapper, hideSectionWrapper, groupSectionWrapper, sortOptions.getNativeElement().i, moveOptions.getNativeElement().i, pinOptions.getNativeElement().i, hideOptions.getNativeElement().i, groupOptions.getNativeElement().i, filterOptions.getNativeElement().i, summaryOptions.getNativeElement().i);
            this._flushQueuedAttributes();
            // supports themes or custom properties set in CSS
            this._styling(this, this);
            this.afterContentInit();
        }
        afterContentInit() {
            this.i.notifySizeChanged();
        }
        static get observedAttributes() {
            if (IgcGridColumnOptionsComponent._observedAttributesIgcGridColumnOptionsComponent == null) {
                let names = getAllPropertyNames(IgcGridColumnOptionsComponent);
                for (let i = 0; i < names.length; i++) {
                    names[i] = toSpinal(names[i]);
                }
                IgcGridColumnOptionsComponent._observedAttributesIgcGridColumnOptionsComponent = names;
            }
            return IgcGridColumnOptionsComponent._observedAttributesIgcGridColumnOptionsComponent;
        }
        static register() {
            if (!IgcGridColumnOptionsComponent._isElementRegistered) {
                IgcGridColumnOptionsComponent._isElementRegistered = true;
                RegisterElementHelper.registerElement(IgcGridColumnOptionsComponent.htmlTagName, IgcGridColumnOptionsComponent);
            }
        }
        get headerOptionsVisibleResolved() {
            return this.i.cm;
        }
        get sortOptionsVisibleResolved() {
            return this.i.c0;
        }
        get moveOptionsVisibleResolved() {
            return this.i.cu;
        }
        get pinOptionsVisibleResolved() {
            return this.i.cx;
        }
        get hideOptionsVisibleResolved() {
            return this.i.cr;
        }
        get groupOptionsVisibleResolved() {
            return this.i.cl;
        }
        get filterOptionsVisibleResolved() {
            return this.i.ci;
        }
        get summaryOptionsVisibleResolved() {
            return this.i.c3;
        }
        /**
         * Gets or sets the font to use for columnNames.
        */
        get columnNameTextStyle() {
            if (this.i.cd == null) {
                return null;
            }
            return this.i.cd.fontString;
        }
        set columnNameTextStyle(v) {
            let fi = new FontInfo();
            fi.fontString = v;
            this.i.cd = fi;
            this._a("columnNameTextStyle", this.i.cd != null ? this.i.cd.fontString : "");
        }
        /**
         * Gets or sets the amount of left padding to use for the left edge of the component.
        */
        get paddingLeft() {
            return this.i.de;
        }
        set paddingLeft(v) {
            this.i.de = +v;
            this._a("paddingLeft", this.i.de);
        }
        /**
         * Gets or sets the amount of left padding to use for the top edge of the component.
        */
        get paddingTop() {
            return this.i.dg;
        }
        set paddingTop(v) {
            this.i.dg = +v;
            this._a("paddingTop", this.i.dg);
        }
        /**
         * Gets or sets the amount of left padding to use for the right edge of the component.
        */
        get paddingRight() {
            return this.i.df;
        }
        set paddingRight(v) {
            this.i.df = +v;
            this._a("paddingRight", this.i.df);
        }
        /**
         * Gets or sets the amount of left padding to use for the bottom edge of the component.
        */
        get paddingBottom() {
            return this.i.dd;
        }
        set paddingBottom(v) {
            this.i.dd = +v;
            this._a("paddingBottom", this.i.dd);
        }
        get headerVisible() {
            return this.i.co;
        }
        set headerVisible(v) {
            this.i.co = ensureBool(v);
            this._a("headerVisible", this.i.co);
        }
        get sortOptionsVisible() {
            return this.i.cz;
        }
        set sortOptionsVisible(v) {
            this.i.cz = ensureBool(v);
            this._a("sortOptionsVisible", this.i.cz);
        }
        get moveOptionsVisible() {
            return this.i.ct;
        }
        set moveOptionsVisible(v) {
            this.i.ct = ensureBool(v);
            this._a("moveOptionsVisible", this.i.ct);
        }
        get pinOptionsVisible() {
            return this.i.cw;
        }
        set pinOptionsVisible(v) {
            this.i.cw = ensureBool(v);
            this._a("pinOptionsVisible", this.i.cw);
        }
        get hideOptionsVisible() {
            return this.i.cq;
        }
        set hideOptionsVisible(v) {
            this.i.cq = ensureBool(v);
            this._a("hideOptionsVisible", this.i.cq);
        }
        get groupOptionsVisible() {
            return this.i.ck;
        }
        set groupOptionsVisible(v) {
            this.i.ck = ensureBool(v);
            this._a("groupOptionsVisible", this.i.ck);
        }
        get filterOptionsVisible() {
            return this.i.ch;
        }
        set filterOptionsVisible(v) {
            this.i.ch = ensureBool(v);
            this._a("filterOptionsVisible", this.i.ch);
        }
        get summaryOptionsVisible() {
            return this.i.c2;
        }
        set summaryOptionsVisible(v) {
            this.i.c2 = ensureBool(v);
            this._a("summaryOptionsVisible", this.i.c2);
        }
        get sortHeaderCaption() {
            return this.i.e1;
        }
        set sortHeaderCaption(v) {
            this.i.e1 = v;
        }
        get sortAscendingCaption() {
            return this.i.ev;
        }
        set sortAscendingCaption(v) {
            this.i.ev = v;
        }
        get sortDescendingCaption() {
            return this.i.ey;
        }
        set sortDescendingCaption(v) {
            this.i.ey = v;
        }
        get moveHeaderCaption() {
            return this.i.d7;
        }
        set moveHeaderCaption(v) {
            this.i.d7 = v;
        }
        get moveLeftCaption() {
            return this.i.ea;
        }
        set moveLeftCaption(v) {
            this.i.ea = v;
        }
        get moveRightCaption() {
            return this.i.ee;
        }
        set moveRightCaption(v) {
            this.i.ee = v;
        }
        get pinHeaderCaption() {
            return this.i.el;
        }
        set pinHeaderCaption(v) {
            this.i.el = v;
        }
        get pinLeftCaption() {
            return this.i.eo;
        }
        set pinLeftCaption(v) {
            this.i.eo = v;
        }
        get pinRightCaption() {
            return this.i.es;
        }
        set pinRightCaption(v) {
            this.i.es = v;
        }
        get applyFiltersButtonCaption() {
            return this.i.dl;
        }
        set applyFiltersButtonCaption(v) {
            this.i.dl = v;
        }
        get cancelFiltersButtonCaption() {
            return this.i.dp;
        }
        set cancelFiltersButtonCaption(v) {
            this.i.dp = v;
        }
        get clearColumnFiltersCaption() {
            return this.i.ds;
        }
        set clearColumnFiltersCaption(v) {
            this.i.ds = v;
        }
        /**
         * Gets or sets the display density to use for the summary list menu.
        */
        get summaryListDensity() {
            return this.i.summaryListDensity;
        }
        set summaryListDensity(v) {
            this.i.summaryListDensity = ensureEnum(ControlDisplayDensity_$type, v);
            this._a("summaryListDensity", enumToString(ControlDisplayDensity_$type, this.i.summaryListDensity));
        }
        /**
         * Gets the actual display density used for the summary list menu.
        */
        get actualSummaryListDensity() {
            return this.i.b5;
        }
        set actualSummaryListDensity(v) {
            this.i.b5 = ensureEnum(ControlDisplayDensity_$type, v);
            this._a("actualSummaryListDensity", enumToString(ControlDisplayDensity_$type, this.i.b5));
        }
        /**
         * Gets or sets the display Density to use for the buttons in the component.
        */
        get filterListDensity() {
            return this.i.filterListDensity;
        }
        set filterListDensity(v) {
            this.i.filterListDensity = ensureEnum(ControlDisplayDensity_$type, v);
            this._a("filterListDensity", enumToString(ControlDisplayDensity_$type, this.i.filterListDensity));
        }
        /**
         * Gets the actual display filterListDensity to use for the component.
        */
        get actualFilterListDensity() {
            return this.i.b4;
        }
        set actualFilterListDensity(v) {
            this.i.b4 = ensureEnum(ControlDisplayDensity_$type, v);
            this._a("actualFilterListDensity", enumToString(ControlDisplayDensity_$type, this.i.b4));
        }
        get filterListPlaceholderText() {
            return this.i.dy;
        }
        set filterListPlaceholderText(v) {
            this.i.dy = v;
        }
        get filterApplyButtonClick() {
            return this._filterApplyButtonClick;
        }
        set filterApplyButtonClick(ev) {
            if (this._filterApplyButtonClick_wrapped !== null) {
                this.i.filterApplyButtonClick = delegateRemove(this.i.filterApplyButtonClick, this._filterApplyButtonClick_wrapped);
                this._filterApplyButtonClick_wrapped = null;
                this._filterApplyButtonClick = null;
            }
            this._filterApplyButtonClick = ev;
            this._filterApplyButtonClick_wrapped = (o, e) => {
                let outerArgs = new IgcFilterApplyButtonClickEventArgs();
                outerArgs._provideImplementation(e);
                if (this.beforeFilterApplyButtonClick) {
                    this.beforeFilterApplyButtonClick(this, outerArgs);
                }
                if (this._filterApplyButtonClick) {
                    this._filterApplyButtonClick(this, outerArgs);
                }
            };
            this.i.filterApplyButtonClick = delegateCombine(this.i.filterApplyButtonClick, this._filterApplyButtonClick_wrapped);
        }
        get filterCancelButtonClick() {
            return this._filterCancelButtonClick;
        }
        set filterCancelButtonClick(ev) {
            if (this._filterCancelButtonClick_wrapped !== null) {
                this.i.filterCancelButtonClick = delegateRemove(this.i.filterCancelButtonClick, this._filterCancelButtonClick_wrapped);
                this._filterCancelButtonClick_wrapped = null;
                this._filterCancelButtonClick = null;
            }
            this._filterCancelButtonClick = ev;
            this._filterCancelButtonClick_wrapped = (o, e) => {
                let outerArgs = new IgcFilterCancelButtonClickEventArgs();
                outerArgs._provideImplementation(e);
                if (this.beforeFilterCancelButtonClick) {
                    this.beforeFilterCancelButtonClick(this, outerArgs);
                }
                if (this._filterCancelButtonClick) {
                    this._filterCancelButtonClick(this, outerArgs);
                }
            };
            this.i.filterCancelButtonClick = delegateCombine(this.i.filterCancelButtonClick, this._filterCancelButtonClick_wrapped);
        }
    }
    IgcGridColumnOptionsComponent._observedAttributesIgcGridColumnOptionsComponent = null;
    IgcGridColumnOptionsComponent.htmlTagName = "igc-grid-column-options";
    IgcGridColumnOptionsComponent._isElementRegistered = false;
    return IgcGridColumnOptionsComponent;
})();
//# sourceMappingURL=igc-grid-column-options-component.js.map
