import { ensureEnum, NamePatcher, toSpinal, enumToString, getAllPropertyNames } from "igniteui-webcomponents-core";
import { WebComponentRenderer } from "igniteui-webcomponents-core";
import { DataGridStylingDefaults } from './DataGridStylingDefaults';
import { RegisterElementHelper } from "igniteui-webcomponents-core";
import { GridColumnSortOptions } from "./GridColumnSortOptions";
import { IgcGridColumnOptionsSimpleSectionBaseComponent } from "./igc-grid-column-options-simple-section-base-component";
import { ColumnSortDirection_$type } from "./ColumnSortDirection";
export let IgcGridColumnSortOptionsComponent = /*@__PURE__*/ (() => {
    class IgcGridColumnSortOptionsComponent extends IgcGridColumnOptionsSimpleSectionBaseComponent {
        constructor() {
            super();
            this._disconnected = false;
            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 GridColumnSortOptions();
        }
        get i() {
            return this._implementation;
        }
        disconnectedCallback() {
            this._disconnected = true;
        }
        connectedCallback() {
            if (this._disconnected) {
                this._disconnected = false;
                return;
            }
            this.classList.add("ig-grid-column-sort-options");
            this.classList.add("igc-grid-column-sort-options");
            this.appendChild(this._webComponentRenderer.rootWrapper.getNativeElement());
            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 (IgcGridColumnSortOptionsComponent._observedAttributesIgcGridColumnSortOptionsComponent == null) {
                let names = getAllPropertyNames(IgcGridColumnSortOptionsComponent);
                for (let i = 0; i < names.length; i++) {
                    names[i] = toSpinal(names[i]);
                }
                IgcGridColumnSortOptionsComponent._observedAttributesIgcGridColumnSortOptionsComponent = names;
            }
            return IgcGridColumnSortOptionsComponent._observedAttributesIgcGridColumnSortOptionsComponent;
        }
        static register() {
            if (!IgcGridColumnSortOptionsComponent._isElementRegistered) {
                IgcGridColumnSortOptionsComponent._isElementRegistered = true;
                RegisterElementHelper.registerElement(IgcGridColumnSortOptionsComponent.htmlTagName, IgcGridColumnSortOptionsComponent);
            }
        }
        get ascendingCaption() {
            return this.i.b3;
        }
        set ascendingCaption(v) {
            this.i.b3 = v;
        }
        get descendingCaption() {
            return this.i.b7;
        }
        set descendingCaption(v) {
            this.i.b7 = v;
        }
        get sortDirection() {
            return this.i.b0;
        }
        set sortDirection(v) {
            this.i.b0 = ensureEnum(ColumnSortDirection_$type, v);
            this._a("sortDirection", enumToString(ColumnSortDirection_$type, this.i.b0));
        }
    }
    IgcGridColumnSortOptionsComponent._observedAttributesIgcGridColumnSortOptionsComponent = null;
    IgcGridColumnSortOptionsComponent.htmlTagName = "igc-grid-column-sort-options";
    IgcGridColumnSortOptionsComponent._isElementRegistered = false;
    return IgcGridColumnSortOptionsComponent;
})();
//# sourceMappingURL=igc-grid-column-sort-options-component.js.map
