import * as tslib_1 from "tslib";
import { delegateCombine, delegateRemove } from "igniteui-webcomponents-core";
import { CellContentHorizontalAlignment_$type } from "./CellContentHorizontalAlignment";
import { CellContentVerticalAlignment_$type } from "./CellContentVerticalAlignment";
import { TextCellLineBreakMode_$type } from "./TextCellLineBreakMode";
import { IgcDataBindingEventArgs } from "./igc-data-binding-event-args";
import { IgcCellStyleRequestedEventArgs } from "./igc-cell-style-requested-event-args";
import { TypeRegistrar } from "igniteui-webcomponents-core";
import { NamePatcher, getAllPropertyNames, fromSpinal, toSpinal, brushToString, stringToBrush, ensureEnum, enumToString, initializePropertiesFromCss } from "igniteui-webcomponents-core";
import { FontInfo } from "igniteui-webcomponents-core";
import { ColumnPropertyUpdatingAnimationMode } from "./ColumnPropertyUpdatingAnimationMode";
import { IgcHTMLElement } from "igniteui-webcomponents-core";
/**
 * Base class for various definition types for the grid.
*/
var IgcDefinitionBaseComponent = /** @class */ /*@__PURE__*/ (function (_super) {
    tslib_1.__extends(IgcDefinitionBaseComponent, _super);
    function IgcDefinitionBaseComponent() {
        var _this = _super.call(this) || this;
        _this._renderer = null;
        _this.__p = null;
        _this._hasUserValues = new Set();
        _this._stylingContainer = null;
        _this._stylingParent = null;
        _this._inStyling = false;
        _this._settingAttributes = false;
        _this._attached = false;
        _this._queuedSetAttributes = [];
        _this._updatingFromAttribute = false;
        _this._dataBinding = null;
        _this._dataBinding_wrapped = null;
        _this._dataBound = null;
        _this._dataBound_wrapped = null;
        _this._cellStyleKeyRequested = null;
        _this._cellStyleKeyRequested_wrapped = null;
        if (_this._styling) {
            NamePatcher.ensureStylablePatched(Object.getPrototypeOf(_this));
        }
        _this._implementation = _this.createImplementation();
        _this._implementation.externalObject = _this;
        _this.onImplementationCreated();
        return _this;
    }
    IgcDefinitionBaseComponent.prototype.createImplementation = function () {
        return null;
    };
    Object.defineProperty(IgcDefinitionBaseComponent.prototype, "i", {
        /**
         * @hidden
         */
        get: function () {
            return this._implementation;
        } /**
                                     * @hidden
                                     */,
        enumerable: true,
        configurable: true
    });
    IgcDefinitionBaseComponent._createFromInternal = function (internal) {
        if (!internal) {
            return null;
        }
        if (!internal.$type) {
            return null;
        }
        var name = internal.$type.name;
        var externalName = "Igc" + name + "Component";
        if (!TypeRegistrar.isRegistered(externalName)) {
            return null;
        }
        return TypeRegistrar.create(externalName);
    };
    IgcDefinitionBaseComponent.prototype.onImplementationCreated = function () {
    };
    IgcDefinitionBaseComponent.prototype._provideRenderer = function (renderer) {
        this._renderer = renderer;
    };
    Object.defineProperty(IgcDefinitionBaseComponent.prototype, "hasUserValues", {
        get: function () {
            return this._hasUserValues;
        },
        enumerable: true,
        configurable: true
    });
    IgcDefinitionBaseComponent.prototype.__m = function (propertyName) {
        if (!this._inStyling) {
            this._hasUserValues.add(propertyName);
        }
    };
    IgcDefinitionBaseComponent.prototype._styling = function (container, component, parent) {
        this._stylingContainer = container;
        this._stylingParent = component;
        if (this._inStyling) {
            return;
        }
        this._inStyling = true;
        var grid = component._grid;
        var prev;
        if (grid) {
            prev = grid.columnPropertyUpdatingAnimationMode;
            grid.columnPropertyUpdatingAnimationMode = ColumnPropertyUpdatingAnimationMode.None;
        }
        var genericPrefix = "";
        var typeName = this.i.$type.name;
        var lowerTypeName = typeName.toLowerCase();
        if (lowerTypeName.indexOf("column") >= 0) {
            genericPrefix = "column";
        }
        else if (lowerTypeName.indexOf("sectionheader") >= 0) {
            genericPrefix = "section-header";
        }
        else if (lowerTypeName.indexOf("sectionfooter") >= 0) {
            genericPrefix = "section-footer";
        }
        else if (lowerTypeName.indexOf("rowseparator") >= 0) {
            genericPrefix = "row-separator";
        }
        else if (lowerTypeName.indexOf("summaryrowroot") >= 0) {
            genericPrefix = "summary-row-root";
        }
        else if (lowerTypeName.indexOf("summaryrowsection") >= 0) {
            genericPrefix = "summary-row-section";
        }
        else if (lowerTypeName.indexOf("headerseparator") >= 0) {
            genericPrefix = "header-separator";
        }
        else {
            genericPrefix = "header";
        }
        var additionalPrefixes = [];
        var prefix = toSpinal(typeName);
        additionalPrefixes.push(prefix + "-");
        if (parent) {
            var parentTypeName = parent.i.$type.name;
            if (parentTypeName == "Grid") {
                parentTypeName = "DataGrid";
            }
            var parentPrefix = toSpinal(parentTypeName);
            additionalPrefixes.push(parentPrefix + "-" + genericPrefix + "-");
            additionalPrefixes.push(parentPrefix + "-" + prefix + "-");
        }
        initializePropertiesFromCss(container, this, genericPrefix + "-", this.hasUserValues, false, additionalPrefixes);
        if (grid) {
            grid.columnPropertyUpdatingAnimationMode = prev;
        }
        this._inStyling = false;
    };
    IgcDefinitionBaseComponent.prototype._enqueueSetAttribute = function (attrName, attrValue) {
        this._queuedSetAttributes.push({ attrName: attrName, attrValue: attrValue });
    };
    IgcDefinitionBaseComponent.prototype._flushQueuedAttributes = function () {
        this._settingAttributes = true;
        for (var i = 0; i < this._queuedSetAttributes.length; i++) {
            this.setAttribute(this._queuedSetAttributes[i].attrName, this._queuedSetAttributes[i].attrValue);
        }
        this._settingAttributes = false;
        this._queuedSetAttributes.length = 0;
    };
    IgcDefinitionBaseComponent.prototype._a = function (attrName, attrValue) {
        if (this._updatingFromAttribute) {
            return;
        }
        if (attrValue) {
            attrValue = attrValue.toString();
        }
        this._settingAttributes = true;
        attrName = toSpinal(attrName);
        if (this._attached) {
            this.setAttribute(attrName, attrValue);
        }
        else {
            this._enqueueSetAttribute(attrName, attrValue);
        }
        this._settingAttributes = false;
    };
    IgcDefinitionBaseComponent.prototype.connectedCallback = function () {
        if (_super.prototype["connectedCallback"]) {
            _super.prototype["connectedCallback"].call(this);
        }
        if (!this._attached) {
            this._attached = true;
            this._flushQueuedAttributes();
        }
    };
    Object.defineProperty(IgcDefinitionBaseComponent, "observedAttributes", {
        get: function () {
            if (IgcDefinitionBaseComponent._observedAttributesIgcDefinitionBaseComponent == null) {
                var names = getAllPropertyNames(IgcDefinitionBaseComponent);
                for (var i = 0; i < names.length; i++) {
                    names[i] = toSpinal(names[i]);
                }
                IgcDefinitionBaseComponent._observedAttributesIgcDefinitionBaseComponent = names;
            }
            return IgcDefinitionBaseComponent._observedAttributesIgcDefinitionBaseComponent;
        },
        enumerable: true,
        configurable: true
    });
    IgcDefinitionBaseComponent.prototype.attributeChangedCallback = function (name, oldValue, newValue) {
        if (this._settingAttributes) {
            return;
        }
        var setName = fromSpinal(name);
        this._updatingFromAttribute = true;
        this[setName] = newValue;
        this._updatingFromAttribute = false;
    };
    Object.defineProperty(IgcDefinitionBaseComponent.prototype, "background", {
        /**
     * Gets or sets the background color to use.
    */
        get: function () {
            return brushToString(this.i.d7);
        },
        set: function (v) {
            this.i.d7 = stringToBrush(v);
            this._a("background", brushToString(this.i.d7));
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgcDefinitionBaseComponent.prototype, "border", {
        /**
         * Gets or sets the background color to use.
        */
        get: function () {
            return brushToString(this.i.d8);
        },
        set: function (v) {
            this.i.d8 = stringToBrush(v);
            this._a("border", brushToString(this.i.d8));
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgcDefinitionBaseComponent.prototype, "activationBorder", {
        /**
         * Gets or sets the background color to use.
        */
        get: function () {
            return brushToString(this.i.dy);
        },
        set: function (v) {
            this.i.dy = stringToBrush(v);
            this._a("activationBorder", brushToString(this.i.dy));
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgcDefinitionBaseComponent.prototype, "errorBorder", {
        /**
         * Gets or sets the error border color to use.
        */
        get: function () {
            return brushToString(this.i.d9);
        },
        set: function (v) {
            this.i.d9 = stringToBrush(v);
            this._a("errorBorder", brushToString(this.i.d9));
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgcDefinitionBaseComponent.prototype, "actualBorder", {
        /**
         * Gets the actual border color that will be used.
        */
        get: function () {
            return brushToString(this.i.d1);
        },
        set: function (v) {
            this.i.d1 = stringToBrush(v);
            this._a("actualBorder", brushToString(this.i.d1));
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgcDefinitionBaseComponent.prototype, "borderLeftWidth", {
        /**
         * Gets or sets the amount of left border to use for the cell content for this column.
        */
        get: function () {
            return this.i.be;
        },
        set: function (v) {
            this.i.be = +v;
            this._a("borderLeftWidth", this.i.be);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgcDefinitionBaseComponent.prototype, "borderTopWidth", {
        /**
         * Gets or sets the amount of top border to use for the cell content for this column.
        */
        get: function () {
            return this.i.bg;
        },
        set: function (v) {
            this.i.bg = +v;
            this._a("borderTopWidth", this.i.bg);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgcDefinitionBaseComponent.prototype, "borderRightWidth", {
        /**
         * Gets or sets the amount of right border to use for the cell content of this column.
        */
        get: function () {
            return this.i.bf;
        },
        set: function (v) {
            this.i.bf = +v;
            this._a("borderRightWidth", this.i.bf);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgcDefinitionBaseComponent.prototype, "borderBottomWidth", {
        /**
         * Gets or sets the amount of bottom border to use for the cell content of this column.
        */
        get: function () {
            return this.i.bd;
        },
        set: function (v) {
            this.i.bd = +v;
            this._a("borderBottomWidth", this.i.bd);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgcDefinitionBaseComponent.prototype, "activationBorderLeftWidth", {
        /**
         * Gets or sets the amount of left activation border to use for the cell content for this column.
        */
        get: function () {
            return this.i.ba;
        },
        set: function (v) {
            this.i.ba = +v;
            this._a("activationBorderLeftWidth", this.i.ba);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgcDefinitionBaseComponent.prototype, "activationBorderTopWidth", {
        /**
         * Gets or sets the amount of top activation border to use for the cell content for this column.
        */
        get: function () {
            return this.i.bc;
        },
        set: function (v) {
            this.i.bc = +v;
            this._a("activationBorderTopWidth", this.i.bc);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgcDefinitionBaseComponent.prototype, "activationBorderRightWidth", {
        /**
         * Gets or sets the amount of right activation border to use for the cell content of this column.
        */
        get: function () {
            return this.i.bb;
        },
        set: function (v) {
            this.i.bb = +v;
            this._a("activationBorderRightWidth", this.i.bb);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgcDefinitionBaseComponent.prototype, "activationBorderBottomWidth", {
        /**
         * Gets or sets the amount of bottom activation border to use for the cell content of this column.
        */
        get: function () {
            return this.i.a9;
        },
        set: function (v) {
            this.i.a9 = +v;
            this._a("activationBorderBottomWidth", this.i.a9);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgcDefinitionBaseComponent.prototype, "errorBorderLeftWidth", {
        get: function () {
            return this.i.bi;
        },
        set: function (v) {
            this.i.bi = +v;
            this._a("errorBorderLeftWidth", this.i.bi);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgcDefinitionBaseComponent.prototype, "errorBorderTopWidth", {
        get: function () {
            return this.i.bk;
        },
        set: function (v) {
            this.i.bk = +v;
            this._a("errorBorderTopWidth", this.i.bk);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgcDefinitionBaseComponent.prototype, "errorBorderRightWidth", {
        get: function () {
            return this.i.bj;
        },
        set: function (v) {
            this.i.bj = +v;
            this._a("errorBorderRightWidth", this.i.bj);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgcDefinitionBaseComponent.prototype, "errorBorderBottomWidth", {
        get: function () {
            return this.i.bh;
        },
        set: function (v) {
            this.i.bh = +v;
            this._a("errorBorderBottomWidth", this.i.bh);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgcDefinitionBaseComponent.prototype, "actualBackground", {
        /**
         * Gets the actual background color that will be used.
        */
        get: function () {
            return brushToString(this.i.d0);
        },
        set: function (v) {
            this.i.d0 = stringToBrush(v);
            this._a("actualBackground", brushToString(this.i.d0));
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgcDefinitionBaseComponent.prototype, "actualActivationBorder", {
        /**
         * Gets the actual background color that will be used.
        */
        get: function () {
            return brushToString(this.i.dz);
        },
        set: function (v) {
            this.i.dz = stringToBrush(v);
            this._a("actualActivationBorder", brushToString(this.i.dz));
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgcDefinitionBaseComponent.prototype, "actualErrorBorder", {
        /**
         * Gets the actual error border color that will be used.
        */
        get: function () {
            return brushToString(this.i.d2);
        },
        set: function (v) {
            this.i.d2 = stringToBrush(v);
            this._a("actualErrorBorder", brushToString(this.i.d2));
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgcDefinitionBaseComponent.prototype, "stickyRowBackground", {
        /**
         * Gets or sets the background color for content that sticks to the top of the grid.
        */
        get: function () {
            return brushToString(this.i.ej);
        },
        set: function (v) {
            this.i.ej = stringToBrush(v);
            this._a("stickyRowBackground", brushToString(this.i.ej));
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgcDefinitionBaseComponent.prototype, "actualStickyRowBackground", {
        /**
         * Gets the actual background color for content that sticks to the top of the grid.
        */
        get: function () {
            return brushToString(this.i.d5);
        },
        set: function (v) {
            this.i.d5 = stringToBrush(v);
            this._a("actualStickyRowBackground", brushToString(this.i.d5));
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgcDefinitionBaseComponent.prototype, "pinnedRowBackground", {
        /**
         * Gets or sets the background color for cells belonging to rows marked as pinned.
        */
        get: function () {
            return brushToString(this.i.ei);
        },
        set: function (v) {
            this.i.ei = stringToBrush(v);
            this._a("pinnedRowBackground", brushToString(this.i.ei));
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgcDefinitionBaseComponent.prototype, "actualPinnedRowBackground", {
        /**
         * Gets the actual background color for cells belonging to rows marked as pinned.
        */
        get: function () {
            return brushToString(this.i.d4);
        },
        set: function (v) {
            this.i.d4 = stringToBrush(v);
            this._a("actualPinnedRowBackground", brushToString(this.i.d4));
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgcDefinitionBaseComponent.prototype, "lastStickyRowBackground", {
        /**
         * Gets or sets the color for the last row in the sticky row area.
        */
        get: function () {
            return brushToString(this.i.eh);
        },
        set: function (v) {
            this.i.eh = stringToBrush(v);
            this._a("lastStickyRowBackground", brushToString(this.i.eh));
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgcDefinitionBaseComponent.prototype, "actualLastStickyRowBackground", {
        /**
         * Gets the actual color for the last row in the sticky row area.
        */
        get: function () {
            return brushToString(this.i.d3);
        },
        set: function (v) {
            this.i.d3 = stringToBrush(v);
            this._a("actualLastStickyRowBackground", brushToString(this.i.d3));
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgcDefinitionBaseComponent.prototype, "contentOpacity", {
        /**
         * Gets or sets the opacity of the content.
        */
        get: function () {
            return this.i.au;
        },
        set: function (v) {
            this.i.au = +v;
            this._a("contentOpacity", this.i.au);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgcDefinitionBaseComponent.prototype, "horizontalAlignment", {
        /**
         * Gets or sets the horizontal alignment to use for the cell content.
        */
        get: function () {
            return this.i.e;
        },
        set: function (v) {
            this.i.e = ensureEnum(CellContentHorizontalAlignment_$type, v);
            this._a("horizontalAlignment", enumToString(CellContentHorizontalAlignment_$type, this.i.e));
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgcDefinitionBaseComponent.prototype, "verticalAlignment", {
        /**
         * Gets or sets the vertical alignment to use for the cell content.
        */
        get: function () {
            return this.i.j;
        },
        set: function (v) {
            this.i.j = ensureEnum(CellContentVerticalAlignment_$type, v);
            this._a("verticalAlignment", enumToString(CellContentVerticalAlignment_$type, this.i.j));
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgcDefinitionBaseComponent.prototype, "lineBreakMode", {
        /**
         * Gets or sets the line breaking mode to use if text is present in the cell.
        */
        get: function () {
            return this.i.y;
        },
        set: function (v) {
            this.i.y = ensureEnum(TextCellLineBreakMode_$type, v);
            this._a("lineBreakMode", enumToString(TextCellLineBreakMode_$type, this.i.y));
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgcDefinitionBaseComponent.prototype, "actualLineBreakMode", {
        /**
         * Gets the actual line break mode which will be used if text is present in the cell.
        */
        get: function () {
            return this.i.x;
        },
        set: function (v) {
            this.i.x = ensureEnum(TextCellLineBreakMode_$type, v);
            this._a("actualLineBreakMode", enumToString(TextCellLineBreakMode_$type, this.i.x));
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgcDefinitionBaseComponent.prototype, "textColor", {
        /**
         * Gets or sets the color to use for displaying text.
        */
        get: function () {
            return brushToString(this.i.ek);
        },
        set: function (v) {
            this.i.ek = stringToBrush(v);
            this._a("textColor", brushToString(this.i.ek));
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgcDefinitionBaseComponent.prototype, "actualTextColor", {
        /**
         * Gets the actual color used for displaying text.
        */
        get: function () {
            return brushToString(this.i.d6);
        },
        set: function (v) {
            this.i.d6 = stringToBrush(v);
            this._a("actualTextColor", brushToString(this.i.d6));
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgcDefinitionBaseComponent.prototype, "pinnedRowOpacity", {
        /**
         * Gets or sets the color to use for displaying text.
        */
        get: function () {
            return this.i.aw;
        },
        set: function (v) {
            this.i.aw = +v;
            this._a("pinnedRowOpacity", this.i.aw);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgcDefinitionBaseComponent.prototype, "actualPinnedRowOpacity", {
        /**
         * Gets or sets the color to use for displaying text.
        */
        get: function () {
            return this.i.at;
        },
        set: function (v) {
            this.i.at = +v;
            this._a("actualPinnedRowOpacity", this.i.at);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgcDefinitionBaseComponent.prototype, "textStyle", {
        get: function () {
            if (this.i.textStyle == null) {
                return null;
            }
            return this.i.textStyle.fontString;
        },
        set: function (v) {
            var fi = new FontInfo();
            fi.fontString = v;
            this.i.textStyle = fi;
            this._a("textStyle", this.i.textStyle != null ? this.i.textStyle.fontString : "");
        },
        enumerable: true,
        configurable: true
    });
    IgcDefinitionBaseComponent.prototype.findByName = function (name) {
        return null;
    };
    IgcDefinitionBaseComponent.prototype.setNamedValue = function (valueName, animationType, value) {
        this.i.c6(valueName, (animationType == null ? null : animationType), value);
    };
    /**
     * Returns if this definition has named value.
    
    */
    IgcDefinitionBaseComponent.prototype.hasNamedValues = function () {
        var iv = this.i.ai();
        return (iv);
    };
    /**
     * Returns if this definition has a named value with a given name.
    
    * @param valueName  * The named value name to check for.
    */
    IgcDefinitionBaseComponent.prototype.hasNamedValue = function (valueName) {
        var iv = this.i.ah(valueName);
        return (iv);
    };
    /**
     * Removes the named value from this definition by name.
    
    * @param valueName  * The named value name to remove.
    */
    IgcDefinitionBaseComponent.prototype.removeNamedValue = function (valueName) {
        this.i.c4(valueName);
    };
    /**
     * Gets the value for a named value from this definition.
    
    * @param valueName  * The named value name to check for.
    */
    IgcDefinitionBaseComponent.prototype.getNamedValue = function (valueName) {
        var iv = this.i.bn(valueName);
        return (iv);
    };
    Object.defineProperty(IgcDefinitionBaseComponent.prototype, "dataBinding", {
        /**
         * Called when a cell is data binding.
        */
        get: function () {
            return this._dataBinding;
        },
        set: function (ev) {
            var _this = this;
            if (this._dataBinding_wrapped !== null) {
                this.i.dataBinding = delegateRemove(this.i.dataBinding, this._dataBinding_wrapped);
                this._dataBinding_wrapped = null;
                this._dataBinding = null;
            }
            this._dataBinding = ev;
            this._dataBinding_wrapped = function (o, e) {
                var outerArgs = new IgcDataBindingEventArgs();
                outerArgs._provideImplementation(e);
                if (_this.beforeDataBinding) {
                    _this.beforeDataBinding(_this, outerArgs);
                }
                if (_this._dataBinding) {
                    _this._dataBinding(_this, outerArgs);
                }
            };
            this.i.dataBinding = delegateCombine(this.i.dataBinding, this._dataBinding_wrapped);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgcDefinitionBaseComponent.prototype, "dataBound", {
        /**
         * Called when a cell has been data bound.
        */
        get: function () {
            return this._dataBound;
        },
        set: function (ev) {
            var _this = this;
            if (this._dataBound_wrapped !== null) {
                this.i.dataBound = delegateRemove(this.i.dataBound, this._dataBound_wrapped);
                this._dataBound_wrapped = null;
                this._dataBound = null;
            }
            this._dataBound = ev;
            this._dataBound_wrapped = function (o, e) {
                var outerArgs = new IgcDataBindingEventArgs();
                outerArgs._provideImplementation(e);
                if (_this.beforeDataBound) {
                    _this.beforeDataBound(_this, outerArgs);
                }
                if (_this._dataBound) {
                    _this._dataBound(_this, outerArgs);
                }
            };
            this.i.dataBound = delegateCombine(this.i.dataBound, this._dataBound_wrapped);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgcDefinitionBaseComponent.prototype, "cellStyleKeyRequested", {
        /**
         * Called when the style key for a cell is needed. Used for recycling the cell.
        */
        get: function () {
            return this._cellStyleKeyRequested;
        },
        set: function (ev) {
            var _this = this;
            if (this._cellStyleKeyRequested_wrapped !== null) {
                this.i.cellStyleKeyRequested = delegateRemove(this.i.cellStyleKeyRequested, this._cellStyleKeyRequested_wrapped);
                this._cellStyleKeyRequested_wrapped = null;
                this._cellStyleKeyRequested = null;
            }
            this._cellStyleKeyRequested = ev;
            this._cellStyleKeyRequested_wrapped = function (o, e) {
                var outerArgs = new IgcCellStyleRequestedEventArgs();
                outerArgs._provideImplementation(e);
                if (_this.beforeCellStyleKeyRequested) {
                    _this.beforeCellStyleKeyRequested(_this, outerArgs);
                }
                if (_this._cellStyleKeyRequested) {
                    _this._cellStyleKeyRequested(_this, outerArgs);
                }
            };
            this.i.cellStyleKeyRequested = delegateCombine(this.i.cellStyleKeyRequested, this._cellStyleKeyRequested_wrapped);
        },
        enumerable: true,
        configurable: true
    });
    IgcDefinitionBaseComponent._observedAttributesIgcDefinitionBaseComponent = null;
    return IgcDefinitionBaseComponent;
}(IgcHTMLElement));
export { IgcDefinitionBaseComponent };
//# sourceMappingURL=igc-definition-base-component.js.map
