UNPKG

igniteui-react-grids

Version:

Ignite UI React grid components.

215 lines (214 loc) 7.49 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 { 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 */ export let GridColumnGroupOptionsView = /*@__PURE__*/ (() => { class GridColumnGroupOptionsView extends GridColumnOptionsViewBase { constructor() { super(...arguments); this.s = null; this.p = null; this.r = null; this.o = null; this.t = null; this.q = false; } get n() { return this.b; } x() { if (null == this.p) { return; } this.q = true; try { let a = this.n.b5; if (a) { this.p.svgPath = GridColumnGroupOptionsView.v; } else { this.p.svgPath = GridColumnGroupOptionsView.u; } } finally { this.q = false; } } k() { super.k(); if (null == this.g || null == this.e) { return; } let a = this.e; let b = this.n; let c = this.g; this.r = ((() => { let 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; })()); let d = this.o; d.clicked = delegateCombine(d.clicked, runOn(this, this.w)); c.append(this.r); } m() { super.m(); this.x(); let a = this.n; if (null != this.s) { this.s.setRawText(this.n.by); let 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); } w(a, b) { if (this.q) { return; } let c = this.n.b5; this.n.b5 = !c; } } GridColumnGroupOptionsView.$t = /*@__PURE__*/ 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; })(); /** * @hidden */ export let GridColumnGroupOptions = /*@__PURE__*/ (() => { class GridColumnGroupOptions extends GridColumnOptionsSimpleSectionBase { constructor() { super(); } f() { return new GridColumnGroupOptionsView(); } get_b0() { return "Group Column"; } get b0() { return this.get_b0(); } bs() { if (null == this.column) { return false; } if (null == this.c) { return false; } return this.column.jc; } bj(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)); } } be(a, b, c) { super.be(a, b, c); } get b5() { let a; let b = this.b3(a); a = b.p0; return a != -1; } set b5(a) { if (a) { this.b7(); } else { this.b8(); } } get b4() { return this.e; } b3(a) { let b = this.column; return { ret: ((() => { let c = GridColumnGroupOptions.b2(b, a); a = c.p1; return c.ret; })()), p0: a }; } static b2(a, b) { if (null != a) { let c = a.grid; if (null != c) { let d = a.lo; let e = c.groupDescriptions.j; for (let f = 0; f < e.count; f++) { let g = e.item(f); let h = g.f; if (0 == StringComparer.b.compare(d, h)) { b = f; return { ret: g, p1: b }; } } } } b = -1; return { ret: null, p1: b }; } b7() { let a = this.c; let b = this.column; if (null != a && null != b) { let c = new ColumnGroupDescription(1, b.lo); let d = b.hr; let e = d != 0 ? GridColumnOptionsUtilities.c(d) : 0; c.c = e; a.groupDescriptions.g(c); b.hr = 0; b.mz("Grouped"); } } b8() { let a = this.c; let b = this.column; if (null != a && null != b) { let c; let d = ((() => { let e = this.b3(c); c = e.p0; return e.ret; })()); if (c != -1) { a.groupDescriptions.d(c); b.mz("Grouped"); } } } b6(a, b) { this.b4.m(); } } GridColumnGroupOptions.$t = /*@__PURE__*/ markType(GridColumnGroupOptions, 'GridColumnGroupOptions', GridColumnOptionsSimpleSectionBase.$); return GridColumnGroupOptions; })();