import { ensureEnum, NamePatcher, toSpinal, enumToString, getAllPropertyNames } from "igniteui-webcomponents-core";
import { WebComponentRenderer, PortalManager } from "igniteui-webcomponents-core";
import { DataGridStylingDefaults } from './DataGridStylingDefaults';
import { RegisterElementHelper } from "igniteui-webcomponents-core";
import { GridColumnSummaryOptions } from "./GridColumnSummaryOptions";
import { IgcGridColumnOptionsSectionBaseComponent } from "./igc-grid-column-options-section-base-component";
import { ControlDisplayDensity_$type } from "igniteui-webcomponents-core";
export let IgcGridColumnSummaryOptionsComponent = /*@__PURE__*/ (() => {
    class IgcGridColumnSummaryOptionsComponent extends IgcGridColumnOptionsSectionBaseComponent {
        constructor() {
            super();
            this._disconnected = false;
            if (this._styling) {
                NamePatcher.ensureStylablePatched(Object.getPrototypeOf(this));
            }
            this._portalManager = new PortalManager("summarySubMenu");
            this._webComponentRenderer = new WebComponentRenderer(this, document, true, DataGridStylingDefaults, this._portalManager);
            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 GridColumnSummaryOptions();
        }
        get i() {
            return this._implementation;
        }
        disconnectedCallback() {
            this._disconnected = true;
        }
        connectedCallback() {
            if (this._disconnected) {
                this._disconnected = false;
                return;
            }
            this.classList.add("ig-grid-column-summary-options");
            this.classList.add("igc-grid-column-summary-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;
            this._flushQueuedAttributes();
            // supports themes or custom properties set in CSS
            this._styling(this, this);
            this.afterContentInit();
        }
        afterContentInit() {
        }
        static get observedAttributes() {
            if (IgcGridColumnSummaryOptionsComponent._observedAttributesIgcGridColumnSummaryOptionsComponent == null) {
                let names = getAllPropertyNames(IgcGridColumnSummaryOptionsComponent);
                for (let i = 0; i < names.length; i++) {
                    names[i] = toSpinal(names[i]);
                }
                IgcGridColumnSummaryOptionsComponent._observedAttributesIgcGridColumnSummaryOptionsComponent = names;
            }
            return IgcGridColumnSummaryOptionsComponent._observedAttributesIgcGridColumnSummaryOptionsComponent;
        }
        static register() {
            if (!IgcGridColumnSummaryOptionsComponent._isElementRegistered) {
                IgcGridColumnSummaryOptionsComponent._isElementRegistered = true;
                RegisterElementHelper.registerElement(IgcGridColumnSummaryOptionsComponent.htmlTagName, IgcGridColumnSummaryOptionsComponent);
            }
        }
        /**
     * Gets or sets the text inside the summary button.
    */
        get summaryCaption() {
            return this.i.cb;
        }
        set summaryCaption(v) {
            this.i.cb = v;
        }
        /**
         * Gets or sets the display density used for the summary list.
        */
        get summaryListDensity() {
            return this.i.b0;
        }
        set summaryListDensity(v) {
            this.i.b0 = ensureEnum(ControlDisplayDensity_$type, v);
            this._a("summaryListDensity", enumToString(ControlDisplayDensity_$type, this.i.b0));
        }
        /**
         * Gets the actual display density used for the summary list.
        */
        get actualSummaryListDensity() {
            return this.i.by;
        }
        set actualSummaryListDensity(v) {
            this.i.by = ensureEnum(ControlDisplayDensity_$type, v);
            this._a("actualSummaryListDensity", enumToString(ControlDisplayDensity_$type, this.i.by));
        }
        get activeCount() {
            return this.i.b5;
        }
        set activeCount(v) {
            this.i.b5 = +v;
            this._a("activeCount", this.i.b5);
        }
        onApply() {
            this.i.br();
        }
        onCancel() {
            this.i.bs();
        }
        closeMenu() {
            this.i.cf();
        }
    }
    IgcGridColumnSummaryOptionsComponent._observedAttributesIgcGridColumnSummaryOptionsComponent = null;
    IgcGridColumnSummaryOptionsComponent.htmlTagName = "igc-grid-column-summary-options";
    IgcGridColumnSummaryOptionsComponent._isElementRegistered = false;
    return IgcGridColumnSummaryOptionsComponent;
})();
//# sourceMappingURL=igc-grid-column-summary-options-component.js.map
