import { delegateCombine, delegateRemove } from "igniteui-webcomponents-core";
import { IgcTemplateSectionHeaderCellUpdatingEventArgs } from "./igc-template-section-header-cell-updating-event-args";
import { IgcSectionHeaderComponent } from "./igc-section-header-component";
import { TemplateSectionHeader } from "./TemplateSectionHeader";
import { getAllPropertyNames, toSpinal } from "igniteui-webcomponents-core";
import { RegisterElementHelper } from "igniteui-webcomponents-core";
/**
 * Used to configure the appearance of the section header cells.
*/
export let IgcTemplateSectionHeaderComponent = /*@__PURE__*/ (() => {
    class IgcTemplateSectionHeaderComponent extends IgcSectionHeaderComponent {
        constructor() {
            super();
            this._cellUpdating = null;
            this._cellUpdating_wrapped = null;
        }
        createImplementation() {
            return new TemplateSectionHeader();
        }
        /**
                                     * @hidden
                                     */
        get i() {
            return this._implementation;
        }
        connectedCallback() {
            if (super["connectedCallback"]) {
                super["connectedCallback"]();
            }
            if (!this._attached) {
                this._attached = true;
                this._flushQueuedAttributes();
            }
        }
        static get observedAttributes() {
            if (IgcTemplateSectionHeaderComponent._observedAttributesIgcTemplateSectionHeaderComponent == null) {
                let names = getAllPropertyNames(IgcTemplateSectionHeaderComponent);
                for (let i = 0; i < names.length; i++) {
                    names[i] = toSpinal(names[i]);
                }
                IgcTemplateSectionHeaderComponent._observedAttributesIgcTemplateSectionHeaderComponent = names;
            }
            return IgcTemplateSectionHeaderComponent._observedAttributesIgcTemplateSectionHeaderComponent;
        }
        static register() {
            if (!IgcTemplateSectionHeaderComponent._isElementRegistered) {
                IgcTemplateSectionHeaderComponent._isElementRegistered = true;
                RegisterElementHelper.registerElement(IgcTemplateSectionHeaderComponent.htmlTagName, IgcTemplateSectionHeaderComponent);
            }
        }
        /**
         * Called when the cell content is being created or updated.
        */
        get cellUpdating() {
            return this._cellUpdating;
        }
        set cellUpdating(ev) {
            if (this._cellUpdating_wrapped !== null) {
                this.i.cellUpdating = delegateRemove(this.i.cellUpdating, this._cellUpdating_wrapped);
                this._cellUpdating_wrapped = null;
                this._cellUpdating = null;
            }
            this._cellUpdating = ev;
            this._cellUpdating_wrapped = (o, e) => {
                let outerArgs = new IgcTemplateSectionHeaderCellUpdatingEventArgs();
                outerArgs._provideImplementation(e);
                if (this.beforeCellUpdating) {
                    this.beforeCellUpdating(this, outerArgs);
                }
                if (this._cellUpdating) {
                    this._cellUpdating(this, outerArgs);
                }
            };
            this.i.cellUpdating = delegateCombine(this.i.cellUpdating, this._cellUpdating_wrapped);
        }
    }
    IgcTemplateSectionHeaderComponent._observedAttributesIgcTemplateSectionHeaderComponent = null;
    IgcTemplateSectionHeaderComponent.htmlTagName = "igc-template-section-header";
    IgcTemplateSectionHeaderComponent._isElementRegistered = false;
    return IgcTemplateSectionHeaderComponent;
})();
//# sourceMappingURL=igc-template-section-header-component.js.map
