import { delegateCombine, delegateRemove } from "igniteui-webcomponents-core";
import { IgcTemplateHeaderCellUpdatingEventArgs } from "./igc-template-header-cell-updating-event-args";
import { IgcHeaderComponent } from "./igc-header-component";
import { TemplateHeader } from "./TemplateHeader";
import { getAllPropertyNames, toSpinal } from "igniteui-webcomponents-core";
import { RegisterElementHelper } from "igniteui-webcomponents-core";
/**
 * A type of header with customizable content.
*/
export let IgcTemplateHeaderComponent = /*@__PURE__*/ (() => {
    class IgcTemplateHeaderComponent extends IgcHeaderComponent {
        constructor() {
            super();
            this._cellUpdating = null;
            this._cellUpdating_wrapped = null;
        }
        createImplementation() {
            return new TemplateHeader();
        }
        /**
                                     * @hidden
                                     */
        get i() {
            return this._implementation;
        }
        connectedCallback() {
            if (super["connectedCallback"]) {
                super["connectedCallback"]();
            }
            if (!this._attached) {
                this._attached = true;
                this._flushQueuedAttributes();
            }
        }
        static get observedAttributes() {
            if (IgcTemplateHeaderComponent._observedAttributesIgcTemplateHeaderComponent == null) {
                let names = getAllPropertyNames(IgcTemplateHeaderComponent);
                for (let i = 0; i < names.length; i++) {
                    names[i] = toSpinal(names[i]);
                }
                IgcTemplateHeaderComponent._observedAttributesIgcTemplateHeaderComponent = names;
            }
            return IgcTemplateHeaderComponent._observedAttributesIgcTemplateHeaderComponent;
        }
        static register() {
            if (!IgcTemplateHeaderComponent._isElementRegistered) {
                IgcTemplateHeaderComponent._isElementRegistered = true;
                RegisterElementHelper.registerElement(IgcTemplateHeaderComponent.htmlTagName, IgcTemplateHeaderComponent);
            }
        }
        /**
         * Called when the header 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 IgcTemplateHeaderCellUpdatingEventArgs();
                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);
        }
    }
    IgcTemplateHeaderComponent._observedAttributesIgcTemplateHeaderComponent = null;
    IgcTemplateHeaderComponent.htmlTagName = "igc-template-header";
    IgcTemplateHeaderComponent._isElementRegistered = false;
    return IgcTemplateHeaderComponent;
})();
//# sourceMappingURL=igc-template-header-component.js.map
