import * as tslib_1 from "tslib";
import { delegateCombine, delegateRemove } from "igniteui-webcomponents-core";
import { IgcFormatGroupTextEventArgs } from "./igc-format-group-text-event-args";
import { IgcColumnSortDescription } from "./igc-column-sort-description";
import { ColumnGroupDescription as ColumnGroupDescription_internal } from "./ColumnGroupDescription";
import { arrayFindByName } from "igniteui-webcomponents-core";
/**
 * Represents an element in the current grouping applied to a data source or provider. Changes to this object are not observed or expected after it is initially assigned to a collection.
*/
var IgcColumnGroupDescription = /** @class */ /*@__PURE__*/ (function (_super) {
    tslib_1.__extends(IgcColumnGroupDescription, _super);
    function IgcColumnGroupDescription() {
        var _this = _super.call(this) || this;
        _this._formatText = null;
        _this._formatText_wrapped = null;
        return _this;
    }
    IgcColumnGroupDescription.prototype.createImplementation = function () {
        return new ColumnGroupDescription_internal(0);
    };
    Object.defineProperty(IgcColumnGroupDescription.prototype, "i", {
        /**
                                     * @hidden
                                     */
        get: function () {
            return this._implementation;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgcColumnGroupDescription.prototype, "valueFormat", {
        /**
         * Gets or sets the format string for the group value.
        */
        get: function () {
            return this.i.x;
        },
        set: function (v) {
            this.i.x = v;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgcColumnGroupDescription.prototype, "valueFormatSpecifiers", {
        /**
         * Gets or sets the format specifiers to use with the ValueFormat string.
        */
        get: function () {
            return this.i.j;
        },
        set: function (v) {
            this.i.j = v;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgcColumnGroupDescription.prototype, "displayFormat", {
        /**
         * Gets or sets the display format for the group text in the group header.
        */
        get: function () {
            return this.i.u;
        },
        set: function (v) {
            this.i.u = v;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgcColumnGroupDescription.prototype, "displayFormatSpecifiers", {
        /**
         * Gets or sets the format specifiers to use with the DisplayFormat string.
        */
        get: function () {
            return this.i.i;
        },
        set: function (v) {
            this.i.i = v;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgcColumnGroupDescription.prototype, "formatOverride", {
        /**
         * Gets or sets an INTL.DateTimeFormat or INTL.NumericFormat to use to format the value.
        */
        get: function () {
            return this.i.q;
        },
        set: function (v) {
            this.i.q = v;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgcColumnGroupDescription.prototype, "displayName", {
        /**
         * Gets or sets the display text for the group name.
        */
        get: function () {
            return this.i.v;
        },
        set: function (v) {
            this.i.v = v;
        },
        enumerable: true,
        configurable: true
    });
    IgcColumnGroupDescription.prototype.findByName = function (name) {
        var baseResult = _super.prototype.findByName.call(this, name);
        if (baseResult) {
            return baseResult;
        }
        if (this.valueFormatSpecifiers != null && arrayFindByName(this.valueFormatSpecifiers, name)) {
            return arrayFindByName(this.valueFormatSpecifiers, name);
        }
        if (this.displayFormatSpecifiers != null && arrayFindByName(this.displayFormatSpecifiers, name)) {
            return arrayFindByName(this.displayFormatSpecifiers, name);
        }
        return null;
    };
    Object.defineProperty(IgcColumnGroupDescription.prototype, "formatText", {
        /**
         * Called when the value is being formatted.
        */
        get: function () {
            return this._formatText;
        },
        set: function (ev) {
            var _this = this;
            if (this._formatText_wrapped !== null) {
                this.i.formatText = delegateRemove(this.i.formatText, this._formatText_wrapped);
                this._formatText_wrapped = null;
                this._formatText = null;
            }
            this._formatText = ev;
            this._formatText_wrapped = function (o, e) {
                var outerArgs = new IgcFormatGroupTextEventArgs();
                outerArgs._provideImplementation(e);
                if (_this.beforeFormatText) {
                    _this.beforeFormatText(_this, outerArgs);
                }
                if (_this._formatText) {
                    _this._formatText(_this, outerArgs);
                }
            };
            this.i.formatText = delegateCombine(this.i.formatText, this._formatText_wrapped);
        },
        enumerable: true,
        configurable: true
    });
    return IgcColumnGroupDescription;
}(IgcColumnSortDescription));
export { IgcColumnGroupDescription };
//# sourceMappingURL=igc-column-group-description.js.map
