import * as tslib_1 from "tslib";
import { delegateCombine, delegateRemove } from "igniteui-webcomponents-core";
import { IgcGridColumnAnimationSettings } from "./igc-grid-column-animation-settings";
import { IgcColumnWidth } from "./igc-column-width";
import { IgcHeaderComponent } from "./igc-header-component";
import { ColumnSortDirection_$type } from "./ColumnSortDirection";
import { PinnedPositions_$type } from "./PinnedPositions";
import { ColumnOptionsIconAlignment_$type } from "./ColumnOptionsIconAlignment";
import { ColumnOptionsIconBehavior_$type } from "./ColumnOptionsIconBehavior";
import { IgcDefinitionBaseComponent } from "./igc-definition-base-component";
import { getAllPropertyNames, toSpinal, brushToString, stringToBrush, ensureBool, ensureEnum, enumToString } from "igniteui-webcomponents-core";
import { ColumnWidth as ColumnWidth_internal } from "./ColumnWidth";
import { FontInfo } from "igniteui-webcomponents-core";
/**
 * A column in the data grid.
*/
var IgcColumnComponent = /** @class */ /*@__PURE__*/ (function (_super) {
    tslib_1.__extends(IgcColumnComponent, _super);
    function IgcColumnComponent() {
        var _this = _super.call(this) || this;
        _this._actualHeaderTextChange = null;
        _this._actualHeaderTextChange_wrapped = null;
        return _this;
    }
    Object.defineProperty(IgcColumnComponent.prototype, "i", {
        /**
                                     * @hidden
                                     */
        get: function () {
            return this._implementation;
        },
        enumerable: true,
        configurable: true
    });
    IgcColumnComponent.prototype.connectedCallback = function () {
        if (_super.prototype["connectedCallback"]) {
            _super.prototype["connectedCallback"].call(this);
        }
        if (!this._attached) {
            this._attached = true;
            this._flushQueuedAttributes();
        }
    };
    Object.defineProperty(IgcColumnComponent, "observedAttributes", {
        get: function () {
            if (IgcColumnComponent._observedAttributesIgcColumnComponent == null) {
                var names = getAllPropertyNames(IgcColumnComponent);
                for (var i = 0; i < names.length; i++) {
                    names[i] = toSpinal(names[i]);
                }
                IgcColumnComponent._observedAttributesIgcColumnComponent = names;
            }
            return IgcColumnComponent._observedAttributesIgcColumnComponent;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgcColumnComponent.prototype, "paddingLeft", {
        /**
         * Gets or sets the amount of left padding to use for the cell content for this column.
        */
        get: function () {
            return this.i.g2;
        },
        set: function (v) {
            this.i.g2 = +v;
            this._a("paddingLeft", this.i.g2);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgcColumnComponent.prototype, "paddingTop", {
        /**
         * Gets or sets the amount of top padding to use for the cell content for this column.
        */
        get: function () {
            return this.i.g4;
        },
        set: function (v) {
            this.i.g4 = +v;
            this._a("paddingTop", this.i.g4);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgcColumnComponent.prototype, "paddingRight", {
        /**
         * Gets or sets the amount of right padding to use for the cell content of this column.
        */
        get: function () {
            return this.i.g3;
        },
        set: function (v) {
            this.i.g3 = +v;
            this._a("paddingRight", this.i.g3);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgcColumnComponent.prototype, "paddingBottom", {
        /**
         * Gets or sets the amount of bottom padding to use for the cell content of this column.
        */
        get: function () {
            return this.i.g1;
        },
        set: function (v) {
            this.i.g1 = +v;
            this._a("paddingBottom", this.i.g1);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgcColumnComponent.prototype, "name", {
        /**
         * Gets or sets an unique name of the Column
        */
        get: function () {
            return this.i.il;
        },
        set: function (v) {
            this.i.il = v;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgcColumnComponent.prototype, "field", {
        /**
         * Gets or sets the key used for the column binding
        */
        get: function () {
            return this.i.h4;
        },
        set: function (v) {
            this.i.h4 = v;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgcColumnComponent.prototype, "headerText", {
        /**
         * Gets or sets the text displayed in the header of the column
        */
        get: function () {
            return this.i.h8;
        },
        set: function (v) {
            this.i.h8 = v;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgcColumnComponent.prototype, "actualHeaderText", {
        /**
         * Gets the actual text displayed in the header of the column
        */
        get: function () {
            return this.i.hl;
        },
        set: function (v) {
            this.i.hl = v;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgcColumnComponent.prototype, "selectedBackground", {
        /**
         * Gets or sets the background color to use for the cells when they are selected
        */
        get: function () {
            return brushToString(this.i.j1);
        },
        set: function (v) {
            this.i.j1 = stringToBrush(v);
            this._a("selectedBackground", brushToString(this.i.j1));
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgcColumnComponent.prototype, "actualSelectedBackground", {
        /**
         * Gets the actual background color that is used for the cells when they are selected
        */
        get: function () {
            return brushToString(this.i.ju);
        },
        set: function (v) {
            this.i.ju = stringToBrush(v);
            this._a("actualSelectedBackground", brushToString(this.i.ju));
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgcColumnComponent.prototype, "rowHoverBackground", {
        /**
         * Gets or sets the background color to use for the cells when the row is hovered.
        */
        get: function () {
            return brushToString(this.i.jz);
        },
        set: function (v) {
            this.i.jz = stringToBrush(v);
            this._a("rowHoverBackground", brushToString(this.i.jz));
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgcColumnComponent.prototype, "actualHoverBackground", {
        /**
         * Gets the actual background color that is used for the cells when they are hovered.
        */
        get: function () {
            return brushToString(this.i.js);
        },
        set: function (v) {
            this.i.js = stringToBrush(v);
            this._a("actualHoverBackground", brushToString(this.i.js));
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgcColumnComponent.prototype, "rowHoverTextColor", {
        /**
         * Gets or sets the text color to use for the cells when the row is hovered.
        */
        get: function () {
            return brushToString(this.i.j0);
        },
        set: function (v) {
            this.i.j0 = stringToBrush(v);
            this._a("rowHoverTextColor", brushToString(this.i.j0));
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgcColumnComponent.prototype, "actualRowHoverTextColor", {
        /**
         * Gets the actual text color that is used for the cells when they are hovered.
        */
        get: function () {
            return brushToString(this.i.jt);
        },
        set: function (v) {
            this.i.jt = stringToBrush(v);
            this._a("actualRowHoverTextColor", brushToString(this.i.jt));
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgcColumnComponent.prototype, "animationSettings", {
        /**
         * Gets or sets the animation settings to use for this column.
        */
        get: function () {
            if (this.i.fe == null) {
                return null;
            }
            if (!this.i.fe.externalObject) {
                var e = new IgcGridColumnAnimationSettings();
                e._implementation = this.i.fe;
                this.i.fe.externalObject = e;
            }
            return this.i.fe.externalObject;
        },
        set: function (v) {
            v == null ? this.i.fe = null : this.i.fe = v.i;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgcColumnComponent.prototype, "width", {
        /**
         * Gets or sets the width to use for this column.
        */
        get: function () {
            if (this.i.width == null) {
                return null;
            }
            if (!this.i.width.externalObject) {
                var e = new IgcColumnWidth();
                e._implementation = this.i.width;
                this.i.width.externalObject = e;
            }
            return this.i.width.externalObject;
        },
        set: function (v) {
            if (typeof v == "string") {
                var int = ColumnWidth_internal.parse(v);
                var ext = new IgcColumnWidth();
                ext._implementation = int;
                v = ext;
            }
            v == null ? this.i.width = null : this.i.width = v.i;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgcColumnComponent.prototype, "minWidth", {
        /**
         * Gets or sets the minimum width to use for this column. Overrides the DefaultColumnMinWidth from the grid, if set.
        */
        get: function () {
            return this.i.gq;
        },
        set: function (v) {
            this.i.gq = +v;
            this._a("minWidth", this.i.gq);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgcColumnComponent.prototype, "isFromMarkup", {
        /**
         * Gets whether this column was projected from markup/templates and is constrained.
        */
        get: function () {
            return this.i.gg;
        },
        set: function (v) {
            this.i.gg = ensureBool(v);
            this._a("isFromMarkup", this.i.gg);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgcColumnComponent.prototype, "isAutoGenerated", {
        /**
         * Gets whether this column was auto generated.
        */
        get: function () {
            return this.i.gb;
        },
        set: function (v) {
            this.i.gb = ensureBool(v);
            this._a("isAutoGenerated", this.i.gb);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgcColumnComponent.prototype, "filter", {
        /**
         * Gets or sets a filter to apply on the values of this column
        */
        get: function () {
            return this.i.eo;
        },
        set: function (v) {
            this.i.eo = v;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgcColumnComponent.prototype, "header", {
        /**
         * Gets or sets the header definition for this column.
        */
        get: function () {
            if (this.i.header == null) {
                return null;
            }
            if (!this.i.header.externalObject) {
                var e = IgcHeaderComponent._createFromInternal(this.i.header);
                if (e) {
                    e._implementation = this.i.header;
                }
                this.i.header.externalObject = e;
            }
            return this.i.header.externalObject;
        },
        set: function (v) {
            if (v != null && this._stylingContainer && v._styling)
                v._styling(this._stylingContainer, this, this);
            v == null ? this.i.header = null : this.i.header = v.i;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgcColumnComponent.prototype, "isFilteringEnabled", {
        /**
         * Gets or sets whether filtering is enabled for this column.
        */
        get: function () {
            return this.i.gf;
        },
        set: function (v) {
            this.i.gf = ensureBool(v);
            this._a("isFilteringEnabled", this.i.gf);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgcColumnComponent.prototype, "isResizingEnabled", {
        /**
         * Gets or sets whether resizing is enabled for this column.
        */
        get: function () {
            return this.i.gi;
        },
        set: function (v) {
            this.i.gi = ensureBool(v);
            this._a("isResizingEnabled", this.i.gi);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgcColumnComponent.prototype, "isHidden", {
        /**
         * Gets or sets whether or not a column is hidden from the grid
        */
        get: function () {
            return this.i.gh;
        },
        set: function (v) {
            this.i.gh = ensureBool(v);
            this._a("isHidden", this.i.gh);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgcColumnComponent.prototype, "shouldRemoveWhenHidden", {
        /**
         * Gets or sets if a column should be removed from the grid when it is fully hidden
        */
        get: function () {
            return this.i.gk;
        },
        set: function (v) {
            this.i.gk = ensureBool(v);
            this._a("shouldRemoveWhenHidden", this.i.gk);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgcColumnComponent.prototype, "sortDirection", {
        /**
         * Gets the current sort direction (None, Ascending, Descending) for this column.
        */
        get: function () {
            return this.i.e6;
        },
        set: function (v) {
            this.i.e6 = ensureEnum(ColumnSortDirection_$type, v);
            this._a("sortDirection", enumToString(ColumnSortDirection_$type, this.i.e6));
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgcColumnComponent.prototype, "pinned", {
        /**
         * Gets or sets the current fixed position for this column.
        */
        get: function () {
            return this.i.fk;
        },
        set: function (v) {
            this.i.fk = ensureEnum(PinnedPositions_$type, v);
            this._a("pinned", enumToString(PinnedPositions_$type, this.i.fk));
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgcColumnComponent.prototype, "actualColumnOptionsIconAlignment", {
        /**
         * Gets the actual column options icon alignment for this column.
        */
        get: function () {
            return this.i.ex;
        },
        set: function (v) {
            this.i.ex = ensureEnum(ColumnOptionsIconAlignment_$type, v);
            this._a("actualColumnOptionsIconAlignment", enumToString(ColumnOptionsIconAlignment_$type, this.i.ex));
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgcColumnComponent.prototype, "columnOptionsIconAlignment", {
        /**
         * Gets or sets whether the column options icon is aligned opposite the header text or not.
        */
        get: function () {
            return this.i.ey;
        },
        set: function (v) {
            this.i.ey = ensureEnum(ColumnOptionsIconAlignment_$type, v);
            this._a("columnOptionsIconAlignment", enumToString(ColumnOptionsIconAlignment_$type, this.i.ey));
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgcColumnComponent.prototype, "actualColumnOptionsIconColor", {
        /**
         * Gets the actual column options icon color for this column.
        */
        get: function () {
            return brushToString(this.i.jq);
        },
        set: function (v) {
            this.i.jq = stringToBrush(v);
            this._a("actualColumnOptionsIconColor", brushToString(this.i.jq));
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgcColumnComponent.prototype, "columnOptionsIconColor", {
        /**
         * Gets or sets the column options icon color for this column.
        */
        get: function () {
            return brushToString(this.i.jv);
        },
        set: function (v) {
            this.i.jv = stringToBrush(v);
            this._a("columnOptionsIconColor", brushToString(this.i.jv));
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgcColumnComponent.prototype, "columnOptionsIconBehavior", {
        /**
         * Gets or sets how the column option icon will behave in the column header.
        */
        get: function () {
            return this.i.e2;
        },
        set: function (v) {
            this.i.e2 = ensureEnum(ColumnOptionsIconBehavior_$type, v);
            this._a("columnOptionsIconBehavior", enumToString(ColumnOptionsIconBehavior_$type, this.i.e2));
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgcColumnComponent.prototype, "actualColumnOptionsIconBehavior", {
        /**
         * Gets or sets how the column option icon will behave in the column header.
        */
        get: function () {
            return this.i.e1;
        },
        set: function (v) {
            this.i.e1 = ensureEnum(ColumnOptionsIconBehavior_$type, v);
            this._a("actualColumnOptionsIconBehavior", enumToString(ColumnOptionsIconBehavior_$type, this.i.e1));
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgcColumnComponent.prototype, "actualIsColumnOptionsEnabled", {
        /**
         * Gets the actual state of the column options for this column.
        */
        get: function () {
            return this.i.f5;
        },
        set: function (v) {
            this.i.f5 = ensureBool(v);
            this._a("actualIsColumnOptionsEnabled", this.i.f5);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgcColumnComponent.prototype, "isColumnOptionsEnabled", {
        /**
         * Gets or sets the preferred state of the column options for this column. If the feature is disabled at the grid level
         * then it will be disabled for the column regardless of what this is set to.
        */
        get: function () {
            return this.i.gc;
        },
        set: function (v) {
            this.i.gc = ensureBool(v);
            this._a("isColumnOptionsEnabled", this.i.gc);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgcColumnComponent.prototype, "actualIsColumnOptionsSummariesEnabled", {
        /**
         * Gets the actual state of the column options for this column.
        */
        get: function () {
            return this.i.f6;
        },
        set: function (v) {
            this.i.f6 = ensureBool(v);
            this._a("actualIsColumnOptionsSummariesEnabled", this.i.f6);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgcColumnComponent.prototype, "isColumnOptionsSummariesEnabled", {
        /**
         * Gets or sets whether to show the summaries option in the column options menu for this column.
        */
        get: function () {
            return this.i.gd;
        },
        set: function (v) {
            this.i.gd = ensureBool(v);
            this._a("isColumnOptionsSummariesEnabled", this.i.gd);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgcColumnComponent.prototype, "isEditable", {
        /**
         * Gets or sets if the column is editable.
        */
        get: function () {
            return this.i.ge;
        },
        set: function (v) {
            this.i.ge = ensureBool(v);
            this._a("isEditable", this.i.ge);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgcColumnComponent.prototype, "deletedTextColor", {
        /**
         * Gets or sets the text color used for deleted rows.
        */
        get: function () {
            return brushToString(this.i.jw);
        },
        set: function (v) {
            this.i.jw = stringToBrush(v);
            this._a("deletedTextColor", brushToString(this.i.jw));
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgcColumnComponent.prototype, "actualDeletedTextColor", {
        /**
         * Gets the actual text color used for deleted rows.
        */
        get: function () {
            return brushToString(this.i.jr);
        },
        set: function (v) {
            this.i.jr = stringToBrush(v);
            this._a("actualDeletedTextColor", brushToString(this.i.jr));
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgcColumnComponent.prototype, "editOpacity", {
        /**
         * Gets or sets the opacity to use for unsaved edited cell values.
        */
        get: function () {
            return this.i.gp;
        },
        set: function (v) {
            this.i.gp = +v;
            this._a("editOpacity", this.i.gp);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgcColumnComponent.prototype, "actualEditOpacity", {
        /**
         * Gets the actual opacity for unsaved edited cell values.
        */
        get: function () {
            return this.i.go;
        },
        set: function (v) {
            this.i.go = +v;
            this._a("actualEditOpacity", this.i.go);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgcColumnComponent.prototype, "textEditStyle", {
        /**
         * Gets or sets the font style to use for unsaved cell edits.
        */
        get: function () {
            if (this.i.textEditStyle == null) {
                return null;
            }
            return this.i.textEditStyle.fontString;
        },
        set: function (v) {
            var fi = new FontInfo();
            fi.fontString = v;
            this.i.textEditStyle = fi;
            this._a("textEditStyle", this.i.textEditStyle != null ? this.i.textEditStyle.fontString : "");
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgcColumnComponent.prototype, "actualEditFontInfo", {
        /**
         * Gets the actual font style used for unsaved cell edits.
        */
        get: function () {
            if (this.i.fp == null) {
                return null;
            }
            return this.i.fp.fontString;
        },
        set: function (v) {
            var fi = new FontInfo();
            fi.fontString = v;
            this.i.fp = fi;
            this._a("actualEditFontInfo", this.i.fp != null ? this.i.fp.fontString : "");
        },
        enumerable: true,
        configurable: true
    });
    IgcColumnComponent.prototype.findByName = function (name) {
        var baseResult = _super.prototype.findByName.call(this, name);
        if (baseResult) {
            return baseResult;
        }
        if (this.animationSettings && this.animationSettings.name && this.animationSettings.name == name) {
            return this.animationSettings;
        }
        if (this.width && this.width.name && this.width.name == name) {
            return this.width;
        }
        if (this.header && this.header.name && this.header.name == name) {
            return this.header;
        }
        return null;
    };
    IgcColumnComponent.prototype._styling = function (container, component, parent) {
        _super.prototype._styling.call(this, container, component, parent);
        this._inStyling = true;
        if (this.header && this.header._styling) {
            this.header._styling(container, component, this);
        }
        this._inStyling = false;
    };
    /**
     * Get the unique key used to identify this column.
    
    */
    IgcColumnComponent.prototype.getUniqueKey = function () {
        var iv = this.i.h6();
        return (iv);
    };
    IgcColumnComponent.prototype.setNamedHeaderValue = function (valueName, animationType, value) {
        this.i.i2(valueName, (animationType == null ? null : animationType), value);
    };
    /**
     * Returns if the column has named header values.
    
    */
    IgcColumnComponent.prototype.hasNamedHeaderValues = function () {
        var iv = this.i.f9();
        return (iv);
    };
    /**
     * Returns if there is a named header value with a given name.
    
    * @param valueName  * The named value to check for.
    */
    IgcColumnComponent.prototype.hasNamedHeaderValue = function (valueName) {
        var iv = this.i.f8(valueName);
        return (iv);
    };
    /**
     * Removes a named header value with the given name from the named header values for this column.
    
    * @param valueName  * The named header value to remove.
    */
    IgcColumnComponent.prototype.removeNamedHeaderValue = function (valueName) {
        this.i.i1(valueName);
    };
    /**
     * Gets the value of a named header value for this column by name.
    
    * @param valueName  * Name of the named header value to retrieve.
    */
    IgcColumnComponent.prototype.getNamedHeaderValue = function (valueName) {
        var iv = this.i.g9(valueName);
        return (iv);
    };
    Object.defineProperty(IgcColumnComponent.prototype, "actualHeaderTextChange", {
        get: function () {
            return this._actualHeaderTextChange;
        },
        set: function (ev) {
            var _this = this;
            if (this._actualHeaderTextChange_wrapped !== null) {
                this.i.propertyChanged = delegateRemove(this.i.propertyChanged, this._actualHeaderTextChange_wrapped);
                this._actualHeaderTextChange_wrapped = null;
                this._actualHeaderTextChange = null;
            }
            this._actualHeaderTextChange = ev;
            this._actualHeaderTextChange_wrapped = function (o, e) {
                var ext = _this.actualHeaderText;
                if (e.propertyName == 'Hl') {
                    if (_this.beforeActualHeaderTextChange) {
                        _this.beforeActualHeaderTextChange(_this, ext);
                    }
                    if (_this._actualHeaderTextChange) {
                        _this._actualHeaderTextChange(_this, ext);
                    }
                }
            };
            this.i.propertyChanged = delegateCombine(this.i.propertyChanged, this._actualHeaderTextChange_wrapped);
        },
        enumerable: true,
        configurable: true
    });
    IgcColumnComponent._observedAttributesIgcColumnComponent = null;
    return IgcColumnComponent;
}(IgcDefinitionBaseComponent));
export { IgcColumnComponent };
//# sourceMappingURL=igc-column-component.js.map
