UNPKG

igniteui-react-grids

Version:

Ignite UI React grid components.

235 lines (234 loc) 8.48 kB
/* THIS INFRAGISTICS ULTIMATE SOFTWARE LICENSE AGREEMENT ("AGREEMENT") LOCATED HERE: https://www.infragistics.com/legal/license/igultimate-la https://www.infragistics.com/legal/license/igultimate-eula GOVERNS THE LICENSING, INSTALLATION AND USE OF INFRAGISTICS SOFTWARE. BY DOWNLOADING AND/OR INSTALLING AND USING INFRAGISTICS SOFTWARE: you are indicating that you have read and understand this Agreement, and agree to be legally bound by it on behalf of the yourself and your company. */ import { __extends } from "tslib"; import { GridColumnOptionsViewBase } from "./GridColumnOptionsViewBase"; import { Size } from "igniteui-react-core"; import { GridColumnOptionsUtilities } from "./GridColumnOptionsUtilities"; import { runOn, delegateCombine, markType, delegateRemove } from "igniteui-react-core"; import { GridColumnOptionsSimpleSectionBase } from "./GridColumnOptionsSimpleSectionBase"; import { ColumnGroupDescription } from "./ColumnGroupDescription"; import { StringComparer } from "igniteui-react-core"; /** * @hidden */ var GridColumnGroupOptionsView = /** @class */ /*@__PURE__*/ (function (_super) { __extends(GridColumnGroupOptionsView, _super); function GridColumnGroupOptionsView() { var _this = _super !== null && _super.apply(this, arguments) || this; _this.s = null; _this.p = null; _this.r = null; _this.o = null; _this.t = null; _this.q = false; return _this; } Object.defineProperty(GridColumnGroupOptionsView.prototype, "n", { get: function () { return this.b; }, enumerable: false, configurable: true }); GridColumnGroupOptionsView.prototype.x = function () { if (null == this.p) { return; } this.q = true; try { var a = this.n.b5; if (a) { this.p.svgPath = GridColumnGroupOptionsView.v; } else { this.p.svgPath = GridColumnGroupOptionsView.u; } } finally { this.q = false; } }; GridColumnGroupOptionsView.prototype.k = function () { var _this = this; _super.prototype.k.call(this); if (null == this.g || null == this.e) { return; } var a = this.e; var b = this.n; var c = this.g; this.r = ((function () { var d = GridColumnOptionsUtilities.f(_this.n, a, GridColumnGroupOptionsView.u, 1, b.p, b.j, new Size(1, 24, 24), _this.o, _this.p, _this.s, _this.t, false, true, false); _this.o = d.p7; _this.p = d.p8; _this.s = d.p9; _this.t = d.p10; return d.ret; })()); var d = this.o; d.clicked = delegateCombine(d.clicked, runOn(this, this.w)); c.append(this.r); }; GridColumnGroupOptionsView.prototype.m = function () { _super.prototype.m.call(this); this.x(); var a = this.n; if (null != this.s) { this.s.setRawText(this.n.by); var b = this.n.bw; GridColumnOptionsUtilities.j(this.s, b, "inline-block"); if (b) { this.o.e = 1; this.o.fb = "stretch"; this.t.setStyleProperty("justify-content", "space-between"); } else { this.o.e = 4; this.o.fb = "center"; this.t.setStyleProperty("justify-content", "center"); } this.s.setStyleProperty("font", a.aa.fontString); } a.bh(this.o); }; GridColumnGroupOptionsView.prototype.w = function (a, b) { if (this.q) { return; } var c = this.n.b5; this.n.b5 = !c; }; GridColumnGroupOptionsView.$t = markType(GridColumnGroupOptionsView, 'GridColumnGroupOptionsView', GridColumnOptionsViewBase.$); GridColumnGroupOptionsView.u = "M9,19v-2h11v2H9z M9,15v-2h11v2H9z M9,11V9h11v2H9z M7,7V5h13v2H7z M4,5h2v2H4V5z"; GridColumnGroupOptionsView.v = "M16.8,18.3H9.6v-2h5.2l-2-2H9.6v-2h1.2L3.4,4.9l1.4-1.4l15.6,15.6L19,20.5L16.8,18.3z M20.6,14.3h-2.2l-2-2h4.2V14.3 L20.6,14.3z M20.6,10.3h-6.2l-2-2h8.2L20.6,10.3L20.6,10.3L20.6,10.3z M20.6,6.3H10.4l-2-2h12.2L20.6,6.3L20.6,6.3L20.6,6.3z"; return GridColumnGroupOptionsView; }(GridColumnOptionsViewBase)); export { GridColumnGroupOptionsView }; /** * @hidden */ var GridColumnGroupOptions = /** @class */ /*@__PURE__*/ (function (_super) { __extends(GridColumnGroupOptions, _super); function GridColumnGroupOptions() { return _super.call(this) || this; } GridColumnGroupOptions.prototype.f = function () { return new GridColumnGroupOptionsView(); }; GridColumnGroupOptions.prototype.get_b0 = function () { return "Group Column"; }; Object.defineProperty(GridColumnGroupOptions.prototype, "b0", { get: function () { return this.get_b0(); }, enumerable: false, configurable: true }); GridColumnGroupOptions.prototype.bs = function () { if (null == this.column) { return false; } if (null == this.c) { return false; } return this.column.jc; }; GridColumnGroupOptions.prototype.bj = function (a, b) { if (null != a) { a.groupDescriptionsChanged = delegateRemove(a.groupDescriptionsChanged, runOn(this, this.b6)); } if (null != b) { b.groupDescriptionsChanged = delegateCombine(b.groupDescriptionsChanged, runOn(this, this.b6)); } }; GridColumnGroupOptions.prototype.be = function (a, b, c) { _super.prototype.be.call(this, a, b, c); }; Object.defineProperty(GridColumnGroupOptions.prototype, "b5", { get: function () { var a; var b = this.b3(a); a = b.p0; return a != -1; }, set: function (a) { if (a) { this.b7(); } else { this.b8(); } }, enumerable: false, configurable: true }); Object.defineProperty(GridColumnGroupOptions.prototype, "b4", { get: function () { return this.e; }, enumerable: false, configurable: true }); GridColumnGroupOptions.prototype.b3 = function (a) { var b = this.column; return { ret: ((function () { var c = GridColumnGroupOptions.b2(b, a); a = c.p1; return c.ret; })()), p0: a }; }; GridColumnGroupOptions.b2 = function (a, b) { if (null != a) { var c = a.grid; if (null != c) { var d = a.lo; var e = c.groupDescriptions.j; for (var f = 0; f < e.count; f++) { var g = e.item(f); var h = g.f; if (0 == StringComparer.b.compare(d, h)) { b = f; return { ret: g, p1: b }; } } } } b = -1; return { ret: null, p1: b }; }; GridColumnGroupOptions.prototype.b7 = function () { var a = this.c; var b = this.column; if (null != a && null != b) { var c = new ColumnGroupDescription(1, b.lo); var d = b.hr; var e = d != 0 ? GridColumnOptionsUtilities.c(d) : 0; c.c = e; a.groupDescriptions.g(c); b.hr = 0; b.mz("Grouped"); } }; GridColumnGroupOptions.prototype.b8 = function () { var _this = this; var a = this.c; var b = this.column; if (null != a && null != b) { var c_1; var d = ((function () { var e = _this.b3(c_1); c_1 = e.p0; return e.ret; })()); if (c_1 != -1) { a.groupDescriptions.d(c_1); b.mz("Grouped"); } } }; GridColumnGroupOptions.prototype.b6 = function (a, b) { this.b4.m(); }; GridColumnGroupOptions.$t = markType(GridColumnGroupOptions, 'GridColumnGroupOptions', GridColumnOptionsSimpleSectionBase.$); return GridColumnGroupOptions; }(GridColumnOptionsSimpleSectionBase)); export { GridColumnGroupOptions };