UNPKG

igniteui-react-grids

Version:

Ignite UI React grid components.

283 lines (282 loc) 9.94 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 { DomWrapper_$type } from "igniteui-react-core"; import { List$1 } from "igniteui-react-core"; import { Size } from "igniteui-react-core"; import { GridColumnOptionsUtilities } from "./GridColumnOptionsUtilities"; import { runOn, delegateCombine, markType } from "igniteui-react-core"; import { GridColumnOptionsSimpleSectionBase } from "./GridColumnOptionsSimpleSectionBase"; import { StringComparer } from "igniteui-react-core"; /** * @hidden */ export let GridColumnPinOptionsView = /*@__PURE__*/ (() => { class GridColumnPinOptionsView extends GridColumnOptionsViewBase { constructor() { super(...arguments); this.y = null; this.z = null; this.q = null; this.v = null; this.u = null; this.o = null; this.p = null; this.r = null; this.s = null; this.t = false; } get n() { return this.b; } w() { let a = this.e; let b = this.n; this.u = a.createElement("div"); let c = new List$1(DomWrapper_$type, 0); let d = ((() => { let e = GridColumnOptionsUtilities.g(this.n, a, GridColumnPinOptionsView.aa, b.p, b.j, new Size(1, 18, 18), this.o, this.r, this.y, true, true); this.o = e.p6; this.r = e.p7; this.y = e.p8; return e.ret; })()); let e = ((() => { let f = GridColumnOptionsUtilities.g(this.n, a, GridColumnPinOptionsView.ab, b.p, b.j, new Size(1, 18, 18), this.p, this.s, this.z, false, true); this.p = f.p6; this.s = f.p7; this.z = f.p8; return f.ret; })()); c.add(d); c.add(e); let f = [this.o, this.p]; let g = ((() => { let h = GridColumnOptionsUtilities.h(this.n, a, f, c, b.p, b.j, this.q); this.q = h.p6; return h.ret; })()); let h = this.q; h.selectionChanged = delegateCombine(h.selectionChanged, runOn(this, this.ae)); this.u.append(g); return this.u; } x() { let a = this.e.createElement("label"); return a; } af() { if (null == this.r || null == this.s) { return; } let a = this.n.b4; let t1 = a; L0: while (true) { switch (t1) { case 0: this.r.svgPath = GridColumnPinOptionsView.aa; this.s.svgPath = GridColumnPinOptionsView.ab; break; case 1: this.r.svgPath = GridColumnPinOptionsView.ac; this.s.svgPath = GridColumnPinOptionsView.ab; break; case 2: this.r.svgPath = GridColumnPinOptionsView.aa; this.s.svgPath = GridColumnPinOptionsView.ad; break; default: t1 = 0; continue L0; } break; } } ag() { if (null == this.q) { return; } this.t = true; try { let a = this.n.b4; switch (a) { case 0: this.q.d = []; break; case 1: this.q.d = [0]; break; case 2: this.q.d = [1]; break; } } finally { this.t = false; } } k() { super.k(); if (null == this.g || null == this.e) { return; } this.v = this.x(); let a = this.w(); let b = this.e; let c = this.g; c.setStyleProperty("display", "flex"); c.setStyleProperty("flex-direction", "row"); c.setStyleProperty("flex-wrap", "no-wrap"); c.setStyleProperty("justify-content", "space-between"); c.setStyleProperty("align-items", "center"); c.append(this.v); c.append(a); } m() { super.m(); this.ag(); this.af(); let a = this.n; if (null != this.v) { this.v.setRawText(a.by); if (a.bw) { this.g.setStyleProperty("display", "flex"); this.v.setStyleProperty("display", "inline-block"); } else { this.g.setStyleProperty("display", "block"); this.v.setStyleProperty("display", "none"); } this.v.setStyleProperty("font", a.aa.fontString); } if (null != this.y) { this.y.setRawText(this.n.b6); } if (null != this.z) { this.z.setRawText(this.n.ca); } a.bh(this.o); a.bh(this.p); a.bg(this.q); } ae(a, b) { if (this.t) { return; } let c; if (null == this.q || null == this.q.d || 0 == this.q.d.length) { c = 0; } else { if (this.q.d.length > 1) { } let d = this.q.d[0]; switch (d) { case 0: c = 1; break; case 1: c = 2; break; default: c = 0; break; } } this.n.b4 = c; this.af(); } } GridColumnPinOptionsView.$t = /*@__PURE__*/ markType(GridColumnPinOptionsView, 'GridColumnPinOptionsView', GridColumnOptionsViewBase.$); GridColumnPinOptionsView.aa = "M13.2,3.8l7.1,7.1l-2.8-0.1l-3.4,3.4l0.1,4.2l-3.5-3.5l-5.4,5.4l-1.4,0l0-1.4l5.4-5.4L5.7,9.8l4.2,0.1l3.4-3.4L13.2,3.8z"; GridColumnPinOptionsView.ab = "M10.8,3.8l-7.1,7.1l2.8-0.1l3.4,3.4l-0.1,4.2l3.5-3.5l5.4,5.4l1.4,0l0-1.4l-5.4-5.4l3.5-3.5l-4.2,0.1l-3.4-3.4L10.8,3.8z"; GridColumnPinOptionsView.ac = "M3,3.4l19,17.1l-1.3,1.2L12.1,14l-4.9,4.9l-1.4-0.1l-0.1-1.4l4.8-4.8l-8.9-8L3,3.4z M14.9,2.3l7.5,7.5l-2.8-0.1L16.1,13 l0,0.3l-5.4-4.8l0.9,0L15,5.1L14.9,2.3z"; GridColumnPinOptionsView.ad = "M21,3.4L2,20.5l1.3,1.2l8.5-7.7l4.9,4.9l1.4-0.1l0.1-1.4l-4.8-4.8l8.9-8L21,3.4z M9.1,2.3L1.7,9.8l2.8-0.1L7.9,13l0,0.3 l5.4-4.8l-0.9,0L9,5.1L9.1,2.3z"; return GridColumnPinOptionsView; })(); /** * @hidden */ export let GridColumnPinOptions = /*@__PURE__*/ (() => { class GridColumnPinOptions extends GridColumnOptionsSimpleSectionBase { constructor() { super(); this.b3 = 0; this.b5 = "Left"; this.b9 = "Right"; } f() { return new GridColumnPinOptionsView(); } get_b0() { return "Pin"; } get b0() { return this.get_b0(); } bs() { if (null == this.column) { return false; } return true; } a6() { let a = this.column; this.b3 = a != null ? a.il : 0; super.a6(); } a7(a, b) { super.a7(a, b); let c = this.column; if (null == c) { return; } switch (b.propertyName) { case "Pinned": this.b3 = c != null ? c.il : 0; this.b2.m(); break; } } be(a, b, c) { super.be(a, b, c); switch (a) { case "PinLeftCaption": case "PinRightCaption": this.b2.m(); break; } } get b4() { let a = this.column; if (null != a) { return a.il; } return this.b3; } set b4(a) { this.b3 = a; let b = this.c; let c = this.column; if (null != b && null != c) { b.pinColumn(c, this.b3); c.mz("Pinned"); } } get b2() { return this.e; } get b6() { return this.b5; } set b6(a) { if (0 == StringComparer.b.compare(a, this.b5)) { return; } let b = this.b5; this.b5 = a; this.bc("PinLeftCaption", b, this.b5); } get ca() { return this.b9; } set ca(a) { if (0 == StringComparer.b.compare(a, this.b9)) { return; } let b = this.b9; this.b9 = a; this.bc("PinRightCaption", b, this.b9); } } GridColumnPinOptions.$t = /*@__PURE__*/ markType(GridColumnPinOptions, 'GridColumnPinOptions', GridColumnOptionsSimpleSectionBase.$); return GridColumnPinOptions; })();