import * as tslib_1 from "tslib";
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.
*/
var IgcTemplateHeaderComponent = /** @class */ /*@__PURE__*/ (function (_super) {
    tslib_1.__extends(IgcTemplateHeaderComponent, _super);
    function IgcTemplateHeaderComponent() {
        var _this = _super.call(this) || this;
        _this._cellUpdating = null;
        _this._cellUpdating_wrapped = null;
        return _this;
    }
    IgcTemplateHeaderComponent.prototype.createImplementation = function () {
        return new TemplateHeader();
    };
    Object.defineProperty(IgcTemplateHeaderComponent.prototype, "i", {
        /**
                                     * @hidden
                                     */
        get: function () {
            return this._implementation;
        },
        enumerable: true,
        configurable: true
    });
    IgcTemplateHeaderComponent.prototype.connectedCallback = function () {
        if (_super.prototype["connectedCallback"]) {
            _super.prototype["connectedCallback"].call(this);
        }
        if (!this._attached) {
            this._attached = true;
            this._flushQueuedAttributes();
        }
    };
    Object.defineProperty(IgcTemplateHeaderComponent, "observedAttributes", {
        get: function () {
            if (IgcTemplateHeaderComponent._observedAttributesIgcTemplateHeaderComponent == null) {
                var names = getAllPropertyNames(IgcTemplateHeaderComponent);
                for (var i = 0; i < names.length; i++) {
                    names[i] = toSpinal(names[i]);
                }
                IgcTemplateHeaderComponent._observedAttributesIgcTemplateHeaderComponent = names;
            }
            return IgcTemplateHeaderComponent._observedAttributesIgcTemplateHeaderComponent;
        },
        enumerable: true,
        configurable: true
    });
    IgcTemplateHeaderComponent.register = function () {
        if (!IgcTemplateHeaderComponent._isElementRegistered) {
            IgcTemplateHeaderComponent._isElementRegistered = true;
            RegisterElementHelper.registerElement(IgcTemplateHeaderComponent.htmlTagName, IgcTemplateHeaderComponent);
        }
    };
    Object.defineProperty(IgcTemplateHeaderComponent.prototype, "cellUpdating", {
        /**
         * Called when the header cell content is being created or updated.
        */
        get: function () {
            return this._cellUpdating;
        },
        set: function (ev) {
            var _this = this;
            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 = function (o, e) {
                var 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);
        },
        enumerable: true,
        configurable: true
    });
    IgcTemplateHeaderComponent._observedAttributesIgcTemplateHeaderComponent = null;
    IgcTemplateHeaderComponent.htmlTagName = "igc-template-header";
    IgcTemplateHeaderComponent._isElementRegistered = false;
    return IgcTemplateHeaderComponent;
}(IgcHeaderComponent));
export { IgcTemplateHeaderComponent };
//# sourceMappingURL=igc-template-header-component.js.map
