import * as tslib_1 from "tslib";
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";
var IgcGridColumnSummaryOptionsComponent = /** @class */ /*@__PURE__*/ (function (_super) {
    tslib_1.__extends(IgcGridColumnSummaryOptionsComponent, _super);
    function IgcGridColumnSummaryOptionsComponent() {
        var _this = _super.call(this) || this;
        _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);
        return _this;
    }
    Object.defineProperty(IgcGridColumnSummaryOptionsComponent.prototype, "height", {
        get: function () {
            return this._height;
        },
        set: function (value) {
            this._height = value;
            this.style.height = value;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgcGridColumnSummaryOptionsComponent.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
    IgcGridColumnSummaryOptionsComponent.prototype.updateStyle = function () {
        this._styling(this, this);
    };
    IgcGridColumnSummaryOptionsComponent.prototype.destroy = function () {
        this._implementation.destroy();
        this._webComponentRenderer.destroy();
    };
    IgcGridColumnSummaryOptionsComponent.prototype.createImplementation = function () {
        return new GridColumnSummaryOptions();
    };
    Object.defineProperty(IgcGridColumnSummaryOptionsComponent.prototype, "i", {
        get: function () {
            return this._implementation;
        },
        enumerable: true,
        configurable: true
    });
    IgcGridColumnSummaryOptionsComponent.prototype.disconnectedCallback = function () {
        this._disconnected = true;
    };
    IgcGridColumnSummaryOptionsComponent.prototype.connectedCallback = function () {
        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();
    };
    IgcGridColumnSummaryOptionsComponent.prototype.afterContentInit = function () {
    };
    Object.defineProperty(IgcGridColumnSummaryOptionsComponent, "observedAttributes", {
        get: function () {
            if (IgcGridColumnSummaryOptionsComponent._observedAttributesIgcGridColumnSummaryOptionsComponent == null) {
                var names = getAllPropertyNames(IgcGridColumnSummaryOptionsComponent);
                for (var i = 0; i < names.length; i++) {
                    names[i] = toSpinal(names[i]);
                }
                IgcGridColumnSummaryOptionsComponent._observedAttributesIgcGridColumnSummaryOptionsComponent = names;
            }
            return IgcGridColumnSummaryOptionsComponent._observedAttributesIgcGridColumnSummaryOptionsComponent;
        },
        enumerable: true,
        configurable: true
    });
    IgcGridColumnSummaryOptionsComponent.register = function () {
        if (!IgcGridColumnSummaryOptionsComponent._isElementRegistered) {
            IgcGridColumnSummaryOptionsComponent._isElementRegistered = true;
            RegisterElementHelper.registerElement(IgcGridColumnSummaryOptionsComponent.htmlTagName, IgcGridColumnSummaryOptionsComponent);
        }
    };
    Object.defineProperty(IgcGridColumnSummaryOptionsComponent.prototype, "summaryCaption", {
        /**
     * Gets or sets the text inside the summary button.
    */
        get: function () {
            return this.i.cb;
        },
        set: function (v) {
            this.i.cb = v;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgcGridColumnSummaryOptionsComponent.prototype, "summaryListDensity", {
        /**
         * Gets or sets the display density used for the summary list.
        */
        get: function () {
            return this.i.b0;
        },
        set: function (v) {
            this.i.b0 = ensureEnum(ControlDisplayDensity_$type, v);
            this._a("summaryListDensity", enumToString(ControlDisplayDensity_$type, this.i.b0));
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgcGridColumnSummaryOptionsComponent.prototype, "actualSummaryListDensity", {
        /**
         * Gets the actual display density used for the summary list.
        */
        get: function () {
            return this.i.by;
        },
        set: function (v) {
            this.i.by = ensureEnum(ControlDisplayDensity_$type, v);
            this._a("actualSummaryListDensity", enumToString(ControlDisplayDensity_$type, this.i.by));
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgcGridColumnSummaryOptionsComponent.prototype, "activeCount", {
        get: function () {
            return this.i.b5;
        },
        set: function (v) {
            this.i.b5 = +v;
            this._a("activeCount", this.i.b5);
        },
        enumerable: true,
        configurable: true
    });
    IgcGridColumnSummaryOptionsComponent.prototype.onApply = function () {
        this.i.br();
    };
    IgcGridColumnSummaryOptionsComponent.prototype.onCancel = function () {
        this.i.bs();
    };
    IgcGridColumnSummaryOptionsComponent.prototype.closeMenu = function () {
        this.i.cf();
    };
    IgcGridColumnSummaryOptionsComponent._observedAttributesIgcGridColumnSummaryOptionsComponent = null;
    IgcGridColumnSummaryOptionsComponent.htmlTagName = "igc-grid-column-summary-options";
    IgcGridColumnSummaryOptionsComponent._isElementRegistered = false;
    return IgcGridColumnSummaryOptionsComponent;
}(IgcGridColumnOptionsSectionBaseComponent));
export { IgcGridColumnSummaryOptionsComponent };
//# sourceMappingURL=igc-grid-column-summary-options-component.js.map
