import * as tslib_1 from "tslib";
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";
var IgcGridColumnOptionsComponent = /** @class */ /*@__PURE__*/ (function (_super) {
    tslib_1.__extends(IgcGridColumnOptionsComponent, _super);
    function IgcGridColumnOptionsComponent() {
        var _this = _super.call(this) || this;
        _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(function () {
            _this.i.notifySizeChanged();
        });
        return _this;
    }
    Object.defineProperty(IgcGridColumnOptionsComponent.prototype, "height", {
        get: function () {
            return this._height;
        },
        set: function (value) {
            this._height = value;
            this.style.height = value;
            this.i.notifySizeChanged();
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgcGridColumnOptionsComponent.prototype, "width", {
        get: function () {
            return this._width;
        },
        set: function (value) {
            this._width = value;
            this.style.width = value;
            this.i.notifySizeChanged();
        },
        enumerable: true,
        configurable: true
    });
    // supports angular themes or custom properties set in CSS
    IgcGridColumnOptionsComponent.prototype.updateStyle = function () {
        this._styling(this, this);
    };
    IgcGridColumnOptionsComponent.prototype.destroy = function () {
        this._implementation.destroy();
        this._webComponentRenderer.destroy();
    };
    IgcGridColumnOptionsComponent.prototype.createImplementation = function () {
        return new GridColumnOptions();
    };
    Object.defineProperty(IgcGridColumnOptionsComponent.prototype, "i", {
        get: function () {
            return this._implementation;
        },
        enumerable: true,
        configurable: true
    });
    IgcGridColumnOptionsComponent.prototype.disconnectedCallback = function () {
        this._disconnected = true;
    };
    IgcGridColumnOptionsComponent.prototype.connectedCallback = function () {
        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();
    };
    IgcGridColumnOptionsComponent.prototype.afterContentInit = function () {
        this.i.notifySizeChanged();
    };
    Object.defineProperty(IgcGridColumnOptionsComponent, "observedAttributes", {
        get: function () {
            if (IgcGridColumnOptionsComponent._observedAttributesIgcGridColumnOptionsComponent == null) {
                var names = getAllPropertyNames(IgcGridColumnOptionsComponent);
                for (var i = 0; i < names.length; i++) {
                    names[i] = toSpinal(names[i]);
                }
                IgcGridColumnOptionsComponent._observedAttributesIgcGridColumnOptionsComponent = names;
            }
            return IgcGridColumnOptionsComponent._observedAttributesIgcGridColumnOptionsComponent;
        },
        enumerable: true,
        configurable: true
    });
    IgcGridColumnOptionsComponent.register = function () {
        if (!IgcGridColumnOptionsComponent._isElementRegistered) {
            IgcGridColumnOptionsComponent._isElementRegistered = true;
            RegisterElementHelper.registerElement(IgcGridColumnOptionsComponent.htmlTagName, IgcGridColumnOptionsComponent);
        }
    };
    Object.defineProperty(IgcGridColumnOptionsComponent.prototype, "headerOptionsVisibleResolved", {
        get: function () {
            return this.i.cm;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgcGridColumnOptionsComponent.prototype, "sortOptionsVisibleResolved", {
        get: function () {
            return this.i.c0;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgcGridColumnOptionsComponent.prototype, "moveOptionsVisibleResolved", {
        get: function () {
            return this.i.cu;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgcGridColumnOptionsComponent.prototype, "pinOptionsVisibleResolved", {
        get: function () {
            return this.i.cx;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgcGridColumnOptionsComponent.prototype, "hideOptionsVisibleResolved", {
        get: function () {
            return this.i.cr;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgcGridColumnOptionsComponent.prototype, "groupOptionsVisibleResolved", {
        get: function () {
            return this.i.cl;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgcGridColumnOptionsComponent.prototype, "filterOptionsVisibleResolved", {
        get: function () {
            return this.i.ci;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgcGridColumnOptionsComponent.prototype, "summaryOptionsVisibleResolved", {
        get: function () {
            return this.i.c3;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgcGridColumnOptionsComponent.prototype, "columnNameTextStyle", {
        /**
         * Gets or sets the font to use for columnNames.
        */
        get: function () {
            if (this.i.cd == null) {
                return null;
            }
            return this.i.cd.fontString;
        },
        set: function (v) {
            var fi = new FontInfo();
            fi.fontString = v;
            this.i.cd = fi;
            this._a("columnNameTextStyle", this.i.cd != null ? this.i.cd.fontString : "");
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgcGridColumnOptionsComponent.prototype, "paddingLeft", {
        /**
         * Gets or sets the amount of left padding to use for the left edge of the component.
        */
        get: function () {
            return this.i.de;
        },
        set: function (v) {
            this.i.de = +v;
            this._a("paddingLeft", this.i.de);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgcGridColumnOptionsComponent.prototype, "paddingTop", {
        /**
         * Gets or sets the amount of left padding to use for the top edge of the component.
        */
        get: function () {
            return this.i.dg;
        },
        set: function (v) {
            this.i.dg = +v;
            this._a("paddingTop", this.i.dg);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgcGridColumnOptionsComponent.prototype, "paddingRight", {
        /**
         * Gets or sets the amount of left padding to use for the right edge of the component.
        */
        get: function () {
            return this.i.df;
        },
        set: function (v) {
            this.i.df = +v;
            this._a("paddingRight", this.i.df);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgcGridColumnOptionsComponent.prototype, "paddingBottom", {
        /**
         * Gets or sets the amount of left padding to use for the bottom edge of the component.
        */
        get: function () {
            return this.i.dd;
        },
        set: function (v) {
            this.i.dd = +v;
            this._a("paddingBottom", this.i.dd);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgcGridColumnOptionsComponent.prototype, "headerVisible", {
        get: function () {
            return this.i.co;
        },
        set: function (v) {
            this.i.co = ensureBool(v);
            this._a("headerVisible", this.i.co);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgcGridColumnOptionsComponent.prototype, "sortOptionsVisible", {
        get: function () {
            return this.i.cz;
        },
        set: function (v) {
            this.i.cz = ensureBool(v);
            this._a("sortOptionsVisible", this.i.cz);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgcGridColumnOptionsComponent.prototype, "moveOptionsVisible", {
        get: function () {
            return this.i.ct;
        },
        set: function (v) {
            this.i.ct = ensureBool(v);
            this._a("moveOptionsVisible", this.i.ct);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgcGridColumnOptionsComponent.prototype, "pinOptionsVisible", {
        get: function () {
            return this.i.cw;
        },
        set: function (v) {
            this.i.cw = ensureBool(v);
            this._a("pinOptionsVisible", this.i.cw);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgcGridColumnOptionsComponent.prototype, "hideOptionsVisible", {
        get: function () {
            return this.i.cq;
        },
        set: function (v) {
            this.i.cq = ensureBool(v);
            this._a("hideOptionsVisible", this.i.cq);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgcGridColumnOptionsComponent.prototype, "groupOptionsVisible", {
        get: function () {
            return this.i.ck;
        },
        set: function (v) {
            this.i.ck = ensureBool(v);
            this._a("groupOptionsVisible", this.i.ck);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgcGridColumnOptionsComponent.prototype, "filterOptionsVisible", {
        get: function () {
            return this.i.ch;
        },
        set: function (v) {
            this.i.ch = ensureBool(v);
            this._a("filterOptionsVisible", this.i.ch);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgcGridColumnOptionsComponent.prototype, "summaryOptionsVisible", {
        get: function () {
            return this.i.c2;
        },
        set: function (v) {
            this.i.c2 = ensureBool(v);
            this._a("summaryOptionsVisible", this.i.c2);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgcGridColumnOptionsComponent.prototype, "sortHeaderCaption", {
        get: function () {
            return this.i.e1;
        },
        set: function (v) {
            this.i.e1 = v;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgcGridColumnOptionsComponent.prototype, "sortAscendingCaption", {
        get: function () {
            return this.i.ev;
        },
        set: function (v) {
            this.i.ev = v;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgcGridColumnOptionsComponent.prototype, "sortDescendingCaption", {
        get: function () {
            return this.i.ey;
        },
        set: function (v) {
            this.i.ey = v;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgcGridColumnOptionsComponent.prototype, "moveHeaderCaption", {
        get: function () {
            return this.i.d7;
        },
        set: function (v) {
            this.i.d7 = v;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgcGridColumnOptionsComponent.prototype, "moveLeftCaption", {
        get: function () {
            return this.i.ea;
        },
        set: function (v) {
            this.i.ea = v;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgcGridColumnOptionsComponent.prototype, "moveRightCaption", {
        get: function () {
            return this.i.ee;
        },
        set: function (v) {
            this.i.ee = v;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgcGridColumnOptionsComponent.prototype, "pinHeaderCaption", {
        get: function () {
            return this.i.el;
        },
        set: function (v) {
            this.i.el = v;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgcGridColumnOptionsComponent.prototype, "pinLeftCaption", {
        get: function () {
            return this.i.eo;
        },
        set: function (v) {
            this.i.eo = v;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgcGridColumnOptionsComponent.prototype, "pinRightCaption", {
        get: function () {
            return this.i.es;
        },
        set: function (v) {
            this.i.es = v;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgcGridColumnOptionsComponent.prototype, "applyFiltersButtonCaption", {
        get: function () {
            return this.i.dl;
        },
        set: function (v) {
            this.i.dl = v;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgcGridColumnOptionsComponent.prototype, "cancelFiltersButtonCaption", {
        get: function () {
            return this.i.dp;
        },
        set: function (v) {
            this.i.dp = v;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgcGridColumnOptionsComponent.prototype, "clearColumnFiltersCaption", {
        get: function () {
            return this.i.ds;
        },
        set: function (v) {
            this.i.ds = v;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgcGridColumnOptionsComponent.prototype, "summaryListDensity", {
        /**
         * Gets or sets the display density to use for the summary list menu.
        */
        get: function () {
            return this.i.summaryListDensity;
        },
        set: function (v) {
            this.i.summaryListDensity = ensureEnum(ControlDisplayDensity_$type, v);
            this._a("summaryListDensity", enumToString(ControlDisplayDensity_$type, this.i.summaryListDensity));
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgcGridColumnOptionsComponent.prototype, "actualSummaryListDensity", {
        /**
         * Gets the actual display density used for the summary list menu.
        */
        get: function () {
            return this.i.b5;
        },
        set: function (v) {
            this.i.b5 = ensureEnum(ControlDisplayDensity_$type, v);
            this._a("actualSummaryListDensity", enumToString(ControlDisplayDensity_$type, this.i.b5));
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgcGridColumnOptionsComponent.prototype, "filterListDensity", {
        /**
         * Gets or sets the display Density to use for the buttons in the component.
        */
        get: function () {
            return this.i.filterListDensity;
        },
        set: function (v) {
            this.i.filterListDensity = ensureEnum(ControlDisplayDensity_$type, v);
            this._a("filterListDensity", enumToString(ControlDisplayDensity_$type, this.i.filterListDensity));
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgcGridColumnOptionsComponent.prototype, "actualFilterListDensity", {
        /**
         * Gets the actual display filterListDensity to use for the component.
        */
        get: function () {
            return this.i.b4;
        },
        set: function (v) {
            this.i.b4 = ensureEnum(ControlDisplayDensity_$type, v);
            this._a("actualFilterListDensity", enumToString(ControlDisplayDensity_$type, this.i.b4));
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgcGridColumnOptionsComponent.prototype, "filterListPlaceholderText", {
        get: function () {
            return this.i.dy;
        },
        set: function (v) {
            this.i.dy = v;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgcGridColumnOptionsComponent.prototype, "filterApplyButtonClick", {
        get: function () {
            return this._filterApplyButtonClick;
        },
        set: function (ev) {
            var _this = this;
            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 = function (o, e) {
                var 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);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgcGridColumnOptionsComponent.prototype, "filterCancelButtonClick", {
        get: function () {
            return this._filterCancelButtonClick;
        },
        set: function (ev) {
            var _this = this;
            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 = function (o, e) {
                var 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);
        },
        enumerable: true,
        configurable: true
    });
    IgcGridColumnOptionsComponent._observedAttributesIgcGridColumnOptionsComponent = null;
    IgcGridColumnOptionsComponent.htmlTagName = "igc-grid-column-options";
    IgcGridColumnOptionsComponent._isElementRegistered = false;
    return IgcGridColumnOptionsComponent;
}(IgcGridColumnOptionsBaseComponent));
export { IgcGridColumnOptionsComponent };
//# sourceMappingURL=igc-grid-column-options-component.js.map
