UNPKG

igniteui-react-grids

Version:

Ignite UI React grid components.

164 lines (163 loc) 5.9 kB
import { __extends } from "tslib"; import { delegateCombine, delegateRemove } from "igniteui-react-core"; import { IgrFormatGroupTextEventArgs } from "./igr-format-group-text-event-args"; import { IgrColumnSortDescription } from "./igr-column-sort-description"; import { ColumnGroupDescription as ColumnGroupDescription_internal } from "./ColumnGroupDescription"; import { arrayFindByName } from "igniteui-react-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 IgrColumnGroupDescription = /** @class */ /*@__PURE__*/ (function (_super) { __extends(IgrColumnGroupDescription, _super); function IgrColumnGroupDescription() { var _this = _super.call(this) || this; _this._formatText = null; _this._formatText_wrapped = null; return _this; } IgrColumnGroupDescription.prototype.createImplementation = function () { return new ColumnGroupDescription_internal(0); }; Object.defineProperty(IgrColumnGroupDescription.prototype, "i", { /** * @hidden */ get: function () { return this._implementation; }, enumerable: false, configurable: true }); Object.defineProperty(IgrColumnGroupDescription.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: false, configurable: true }); Object.defineProperty(IgrColumnGroupDescription.prototype, "valueFormatSpecifiers", { /** * Gets or sets the format specifiers to use with the ValueFormat string. */ get: function () { return this.i.j; }, set: function (v) { if (v && !Array.isArray(v) && typeof (v) == "string") { var re = /\s*(?:,|\s|$)\s*/gm; v = v.split(re); } this.i.j = v; }, enumerable: false, configurable: true }); Object.defineProperty(IgrColumnGroupDescription.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: false, configurable: true }); Object.defineProperty(IgrColumnGroupDescription.prototype, "displayFormatSpecifiers", { /** * Gets or sets the format specifiers to use with the DisplayFormat string. */ get: function () { return this.i.i; }, set: function (v) { if (v && !Array.isArray(v) && typeof (v) == "string") { var re = /\s*(?:,|\s|$)\s*/gm; v = v.split(re); } this.i.i = v; }, enumerable: false, configurable: true }); Object.defineProperty(IgrColumnGroupDescription.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: false, configurable: true }); Object.defineProperty(IgrColumnGroupDescription.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: false, configurable: true }); IgrColumnGroupDescription.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(IgrColumnGroupDescription.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 IgrFormatGroupTextEventArgs(); 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: false, configurable: true }); return IgrColumnGroupDescription; }(IgrColumnSortDescription)); export { IgrColumnGroupDescription };