UNPKG

igniteui-react-grids

Version:

Ignite UI React grid components.

836 lines (835 loc) 27.1 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 { FontInfo } from "igniteui-react-core"; import { GridColumnOptionsUtilities } from "./GridColumnOptionsUtilities"; import { markType, enumGetBox, runOn, delegateCombine, typeCast } from "igniteui-react-core"; import { GridColumnOptionsBase } from "./GridColumnOptionsBase"; import { StringComparer } from "igniteui-react-core"; import { GridColumnOptionsSimpleSectionBase } from "./GridColumnOptionsSimpleSectionBase"; import { ControlDisplayDensity_$type } from "igniteui-react-core"; import { DeviceUtils } from "igniteui-react-core"; import { BrushUtil } from "igniteui-react-core"; import { truncate } from "igniteui-react-core"; import { stringIsNullOrWhiteSpace } from "igniteui-react-core"; import { stringFormat1 } from "igniteui-react-core"; /** * @hidden */ export let GridColumnOptionsView = /*@__PURE__*/ (() => { class GridColumnOptionsView extends GridColumnOptionsViewBase { constructor() { super(...arguments); this.v = null; this.z = null; this.x = null; this.y = null; this.q = null; this.aa = null; this.o = null; this.t = null; this.s = null; this.w = null; this.r = null; this.u = null; } get n() { return this.b; } p() { let a = this.e; let b = a.createElement("div"); let c = a.createElement("header"); b.append(c); let d = a.createElement("h4"); c.append(d); c.setRawText(this.n.dx); return b; } ad() { if (null != this.u) { let a = this.n; let b = a.dx; this.u.setRawText(b); if (null != a.cf) { this.u.setStyleProperty("font", a.cf.fontString); } } } j() { super.j(); this.m(); } m() { super.m(); if (null != this.g) { this.g.setStyleProperty("padding", this.n.d5()); this.g.setStyleProperty("box-sizing", "border-box"); } this.ad(); let a; let b; if (null != this.v) { a = this.v; b = this.n.cp; GridColumnOptionsUtilities.j(a, b, "flex"); } if (null != this.z) { a = this.z; b = this.n.c3; GridColumnOptionsUtilities.j(a, b); } if (null != this.x) { a = this.x; b = this.n.cx; GridColumnOptionsUtilities.j(a, b); } if (null != this.y) { a = this.y; b = this.n.c0; GridColumnOptionsUtilities.j(a, b); } if (null != this.w) { a = this.w; b = this.n.cu; GridColumnOptionsUtilities.j(a, b); } if (null != this.r) { a = this.r; b = this.n.co; GridColumnOptionsUtilities.j(a, b); } if (null != this.q) { a = this.q; b = this.n.cl; GridColumnOptionsUtilities.j(a, b); } if (null != this.aa) { a = this.aa; b = this.n.c6; GridColumnOptionsUtilities.j(a, b); } if (null != this.o) { a = this.o; GridColumnOptionsUtilities.j(a, true); } } ab() { let a = this.e; let b = a.createElement("header"); this.v.append(b); let c = a.createElement("h4"); c.setStyleProperty("margin-top", "0"); c.setStyleProperty("margin-bottom", "0"); b.append(c); this.u = c; this.t.append(b); this.ad(); } ac(a, b, c, d, e, f, g, h, i, j, k) { this.v = a; this.z = b; this.x = c; this.y = d; this.q = e; this.aa = f; this.o = g; this.t = h; this.s = i; this.w = j; this.r = k; this.s.setStyleProperty("display", "flex"); this.s.setStyleProperty("flex-direction", "row"); this.s.setStyleProperty("flex-wrap", "no-wrap"); this.s.setStyleProperty("align-items", "center"); this.s.setStyleProperty("justify-content", "space-between"); this.v.setStyleProperty("display", "flex"); this.v.setStyleProperty("flex-direction", "row"); this.v.setStyleProperty("flex-wrap", "no-wrap"); this.v.setStyleProperty("align-items", "center"); this.v.setStyleProperty("justify-content", "space-between"); this.v.setStyleProperty("margin-bottom", "5px"); this.ab(); this.z.setStyleProperty("margin-bottom", "8px"); this.x.setStyleProperty("margin-bottom", "8px"); this.y.setStyleProperty("margin-bottom", "8px"); } } GridColumnOptionsView.$t = /*@__PURE__*/ markType(GridColumnOptionsView, 'GridColumnOptionsView', GridColumnOptionsViewBase.$); return GridColumnOptionsView; })(); /** * @hidden */ export let GridColumnOptions = /*@__PURE__*/ (() => { class GridColumnOptions extends GridColumnOptionsBase { constructor() { super(); this.b1 = null; this.by = null; this.b0 = null; this.bx = null; this.bw = null; this.bv = null; this.b2 = null; this.bu = null; this.ch = null; this.ce = null; this.cd = null; this.c9 = truncate(DeviceUtils.g(8)); this.db = truncate(DeviceUtils.g(4)); this.da = truncate(DeviceUtils.g(8)); this.c8 = truncate(DeviceUtils.g(8)); this.cq = true; this.c1 = true; this.cv = true; this.cy = true; this.cs = true; this.cm = true; this.cj = true; this.c4 = true; this.e3 = null; this.ex = null; this.e0 = null; this.d9 = null; this.ec = null; this.eg = null; this.en = null; this.eq = null; this.eu = null; this.dn = null; this.dr = null; this.du = null; this.b6 = 0; this.b4 = 0; this.b5 = 0; this.b3 = 0; this.d0 = null; this.fk = BrushUtil.h(255, 24, 29, 31); this.fj = BrushUtil.h(255, 248, 248, 248); this.applyButtonClick = null; this.cancelButtonClick = null; } f() { return new GridColumnOptionsView(); } a6() { super.a6(); let a = this.column; if (null != this.b1) { this.b1.column = a; } if (null != this.by) { this.by.column = a; } if (null != this.b0) { this.b0.column = a; } if (null != this.bx) { this.bx.column = a; } if (null != this.bw) { this.bw.column = a; } if (null != this.bv) { this.bv.column = a; } if (null != this.b2) { this.b2.column = a; } this.fi(); } bb(a, b) { super.bb(a, b); switch (b.propertyName) { case "HeaderClickAction": case "ColumnMovingMode": this.fi(); break; } } be(a, b, c) { super.be(a, b, c); switch (a) { case "HeaderVisible": case "SortOptionsVisible": case "MoveOptionsVisible": case "PinOptionsVisible": case "HideOptionsVisible": case "FilterOptionsVisible": case "PaddingTop": case "PaddingRight": case "PaddingBottom": case "PaddingLeft": this.fi(); break; case "ActualLabelTextStyle": case "ActualBaseTheme": case "ActualButtonDensity": case "ActualButtonTextStyle": case "ActualDensity": case "ActualFilterListDensity": case "ActualSummaryListDensity": case "BackgroundColor": case "TextColor": this.fg(); break; case "ColumnNameTextStyle": this.fh(); break; case "ActualColumnNameTextStyle": this.fi(); break; case "FilterListDensity": this.b7 = this.filterListDensity == 0 ? this.q : this.filterListDensity; break; case "SummaryListDensity": this.b8 = this.summaryListDensity == 0 ? this.q : this.summaryListDensity; break; } } fi() { this.bz.m(); } get dx() { let a = this.column; return (null != a) ? a.k3 : "(No column selected)"; } get ci() { if (null == this.ch) { this.ch = new FontInfo(); this.ch.q = "Verdana"; this.ch.f = 16; } return this.ch; } get cp() { return this.cr; } get c3() { return this.c2 && this.b1.bs(); } get cx() { return this.cw && this.by.bs(); } get c0() { return this.cz && this.b0.bs(); } get cu() { return this.ct && this.bx.bs(); } get co() { return this.cn && this.bw.bs(); } get cl() { return this.ck && this.bv.bs(); } get c6() { return this.c5 && this.b2.bs(); } get bz() { return this.e; } get cg() { return this.ce; } set cg(a) { let b = this.ce; this.ce = a; if (b != this.ce) { this.bc("ColumnNameTextStyle", b, this.ce); } } get cf() { return this.cd; } set cf(a) { let b = this.cd; this.cd = a; if (this.cd != b) { this.bc("ActualColumnNameTextStyle", b, this.cd); } } get dh() { return this.c9; } set dh(a) { let b = this.c9; this.c9 = a; if (this.c9 != b) { this.bc("PaddingLeft", b, this.c9); } } get dj() { return this.db; } set dj(a) { let b = this.db; this.db = a; if (this.db != b) { this.bc("PaddingTop", b, this.db); } } get di() { return this.da; } set di(a) { let b = this.da; this.da = a; if (this.da != b) { this.bc("PaddingRight", b, this.da); } } get dg() { return this.c8; } set dg(a) { let b = this.c8; this.c8 = a; if (this.c8 != b) { this.bc("PaddingBottom", b, this.c8); } } get cr() { return this.cq; } set cr(a) { if (a == this.cq) { return; } let b = this.cq; this.cq = a; this.bc("HeaderVisible", b, this.cq); } get c2() { return this.c1; } set c2(a) { if (a == this.c1) { return; } let b = this.c1; this.c1 = a; this.bc("SortOptionsVisible", b, this.c1); } get cw() { return this.cv; } set cw(a) { if (a == this.cv) { return; } let b = this.cv; this.cv = a; this.bc("MoveOptionsVisible", b, this.cv); } get cz() { return this.cy; } set cz(a) { if (a == this.cy) { return; } let b = this.cy; this.cy = a; this.bc("PinOptionsVisible", b, this.cy); } get ct() { return this.cs; } set ct(a) { if (a == this.cs) { return; } let b = this.cs; this.cs = a; this.bc("HideOptionsVisible", b, this.cs); } get cn() { return this.cm; } set cn(a) { if (a == this.cm) { return; } let b = this.cm; this.cm = a; this.bc("GroupOptionsVisible", b, this.cm); } get ck() { return this.cj; } set ck(a) { if (a == this.cj) { return; } let b = this.cj; this.cj = a; this.bc("FilterOptionsVisible", b, this.cj); } get c5() { return this.c4; } set c5(a) { if (a == this.c4) { return; } let b = this.c4; this.c4 = a; this.bc("SummaryOptionsVisible", b, this.c4); } get e4() { return this.e3 != null ? this.e3 : !stringIsNullOrWhiteSpace(this.ai.b1("Column_Sort")) ? this.ai.b1("Column_Sort") : "Sort"; } set e4(a) { let b = this.e4; if (0 == StringComparer.b.compare(a, b)) { return; } this.e3 = a; if (null != this.b1) { this.b1.by = a; } this.bc("SortHeaderCaption", b, this.e3); } get ey() { return this.ex != null ? this.ex : !stringIsNullOrWhiteSpace(this.ai.b1("Column_Sort_Ascending")) ? this.ai.b1("Column_Sort_Ascending") : "Asc"; } set ey(a) { let b = this.ey; if (0 == StringComparer.b.compare(a, b)) { return; } this.ex = a; if (null != this.b1) { this.b1.b5 = a; } this.bc("SortAscendingCaption", b, this.ex); } get e1() { return this.e0 != null ? this.e0 : !stringIsNullOrWhiteSpace(this.ai.b1("Column_Sort_Descending")) ? this.ai.b1("Column_Sort_Descending") : "Desc"; } set e1(a) { let b = this.e1; if (0 == StringComparer.b.compare(a, b)) { return; } this.e0 = a; if (null != this.b1) { this.b1.b9 = a; } this.bc("SortDescendingCaption", b, this.e0); } get ea() { return this.d9 != null ? this.d9 : !stringIsNullOrWhiteSpace(this.ai.b1("Column_Move")) ? this.ai.b1("Column_Move") : "Move"; } set ea(a) { let b = this.ea; if (0 == StringComparer.b.compare(a, b)) { return; } this.d9 = a; if (null != this.by) { this.by.by = a; } this.bc("MoveHeaderCaption", b, this.d9); } get ed() { return this.ec != null ? this.ec : !stringIsNullOrWhiteSpace(this.ai.b1("Column_Move_Left")) ? this.ai.b1("Column_Move_Left") : "Left"; } set ed(a) { let b = this.ed; if (0 == StringComparer.b.compare(a, b)) { return; } this.ec = a; if (null != this.by) { this.by.b8 = a; } this.bc("MoveLeftCaption", b, this.ec); } get eh() { return this.eg != null ? this.eg : !stringIsNullOrWhiteSpace(this.ai.b1("Column_Move_Right")) ? this.ai.b1("Column_Move_Right") : "Right"; } set eh(a) { let b = this.eh; if (0 == StringComparer.b.compare(a, b)) { return; } this.eg = a; if (null != this.by) { this.by.cc = a; } this.bc("MoveRightCaption", b, this.eg); } get eo() { return this.en != null ? this.en : !stringIsNullOrWhiteSpace(this.ai.b1("Column_Pin")) ? this.ai.b1("Column_Pin") : "Pin"; } set eo(a) { let b = this.eo; if (0 == StringComparer.b.compare(a, b)) { return; } this.en = a; if (null != this.b0) { this.b0.by = a; } this.bc("PinHeaderCaption", b, this.en); } get er() { return this.eq != null ? this.eq : !stringIsNullOrWhiteSpace(this.ai.b1("Column_Pin_Left")) ? this.ai.b1("Column_Pin_Left") : "Left"; } set er(a) { let b = this.er; if (0 == StringComparer.b.compare(a, b)) { return; } this.eq = a; if (null != this.b0) { this.b0.b6 = a; } this.bc("PinLeftCaption", b, this.eq); } get ev() { return this.eu != null ? this.eu : !stringIsNullOrWhiteSpace(this.ai.b1("Column_Pin_Right")) ? this.ai.b1("Column_Pin_Right") : "Right"; } set ev(a) { let b = this.ev; if (0 == StringComparer.b.compare(a, b)) { return; } this.eu = a; if (null != this.b0) { this.b0.ca = a; } this.bc("PinRightCaption", b, this.eu); } get dp() { return this.dn != null ? this.dn : !stringIsNullOrWhiteSpace(this.ai.b1("Apply")) ? this.ai.b1("Apply") : "Apply"; } set dp(a) { let b = this.dp; if (0 == StringComparer.b.compare(a, b)) { return; } this.dn = a; if (null != this.bu) { this.bu.bz = a; } this.bc("ApplyFiltersButtonCaption", b, this.dn); } get ds() { return this.dr != null ? this.dr : !stringIsNullOrWhiteSpace(this.ai.b1("Cancel")) ? this.ai.b1("Cancel") : "Cancel"; } set ds(a) { let b = this.ds; if (0 == StringComparer.b.compare(a, b)) { return; } this.dr = a; if (null != this.bu) { this.bu.b3 = a; } this.bc("CancelFiltersButtonCaption", b, this.dr); } get dv() { return this.du != null ? this.du : !stringIsNullOrWhiteSpace(this.ai.b1("Clear_Column_Filter")) ? this.ai.b1("Clear_Column_Filter") : "Clear column filters"; } set dv(a) { let b = this.dv; if (0 == StringComparer.b.compare(a, b)) { return; } this.du = a; if (null != this.bv) { this.bv.b7 = a; } this.bc("ClearColumnFiltersCaption", b, this.du); } get summaryListDensity() { return this.b6; } set summaryListDensity(a) { let b = this.b6; this.b6 = a; if (b != this.b6) { this.bc("SummaryListDensity", enumGetBox(ControlDisplayDensity_$type, b), enumGetBox(ControlDisplayDensity_$type, this.b6)); } } get b8() { return this.b4; } set b8(a) { let b = this.b4; this.b4 = a; if (b != this.b4) { this.bc("ActualSummaryListDensity", enumGetBox(ControlDisplayDensity_$type, b), enumGetBox(ControlDisplayDensity_$type, this.b4)); } } get filterListDensity() { return this.b5; } set filterListDensity(a) { let b = this.b5; this.b5 = a; if (b != this.b5) { this.bc("FilterListDensity", enumGetBox(ControlDisplayDensity_$type, b), enumGetBox(ControlDisplayDensity_$type, a)); } } get b7() { return this.b3; } set b7(a) { let b = this.b3; this.b3 = a; if (b != this.b3) { this.bc("ActualFilterListDensity", enumGetBox(ControlDisplayDensity_$type, b), enumGetBox(ControlDisplayDensity_$type, a)); } } get d1() { return this.d0 != null ? this.d0 : !stringIsNullOrWhiteSpace(this.ai.b1("Search")) ? this.ai.b1("Search") : "Search"; } set d1(a) { if (0 == StringComparer.b.compare(a, this.d0)) { return; } let b = this.d0; this.d0 = a; if (null != this.bv) { this.bv.cc = a; } this.bc("FilterListPlaceholderText", b, this.d0); } get fm() { return this.fk; } set fm(a) { let b = this.fk; this.fk = a; if (b != this.fk) { this.bc("SummaryListTextColor", b, this.fk); } } get fl() { return this.fj; } set fl(a) { let b = this.fj; this.fj = a; if (b != this.fj) { this.bc("SummaryListBackground", b, this.fj); } } notifySizeChanged() { this.e.j(); } provideContent(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s) { this.bz.ac(a, b, c, d, e, f, g, h, i, j, k); this.b1 = l; this.b1.by = this.e4; this.b1.b5 = this.ey; this.b1.b9 = this.e1; this.by = m; this.by.by = this.ea; this.by.b8 = this.ed; this.by.cc = this.eh; this.b0 = n; this.b0.by = this.eo; this.b0.b6 = this.er; this.b0.ca = this.ev; this.bx = o; this.bx.bw = false; this.bw = p; this.bw.bw = false; this.bv = q; this.bv.b7 = this.dv; this.bv.cc = this.d1; let t = this.b1; t.propertyChanged = delegateCombine(t.propertyChanged, runOn(this, this.fb)); let u = this.by; u.propertyChanged = delegateCombine(u.propertyChanged, runOn(this, this.fb)); let v = this.b0; v.propertyChanged = delegateCombine(v.propertyChanged, runOn(this, this.fb)); let w = this.bx; w.propertyChanged = delegateCombine(w.propertyChanged, runOn(this, this.fb)); let x = this.bw; x.propertyChanged = delegateCombine(x.propertyChanged, runOn(this, this.fb)); let y = this.bv; y.propertyChanged = delegateCombine(y.propertyChanged, runOn(this, this.fb)); this.b2 = r; this.bu = s; this.bu.bz = this.dp; this.bu.b3 = this.ds; let z = this.bu; z.applyButtonClick = delegateCombine(z.applyButtonClick, runOn(this, this.fd)); let aa = this.bu; aa.cancelButtonClick = delegateCombine(aa.cancelButtonClick, runOn(this, this.fe)); this.fh(); this.bl(); this.bi(); this.fg(); } d5() { return stringFormat1("{0}px {1}px {2}px {3}px", this.dj.toString(), this.di.toString(), this.dg.toString(), this.dh.toString()); } fh() { this.cf = (null == this.cg) ? this.ci : this.cg; } fg() { let a = [this.b1, this.by, this.b0, this.bx, this.bw, this.bv, this.b2, this.bu]; for (let c = 0; c < a.length; c++) { let b = a[c]; if (null != b) { b.bo = this.bo; b.br = this.br; b.density = this.q; b.buttonDensity = this.p; b.j = this.i; } let d = typeCast(GridColumnOptionsSimpleSectionBase.$, b); if (null != d) { d.ag = this.aa; d.ab = this.z; } } if (null != this.bv) { this.bv.b2 = this.b7; } if (null != this.b2) { this.b2.b5 = this.b8; this.b2.cv = this.fm; this.b2.cu = this.fl; } } fd(a, b) { let c = [this.b1, this.by, this.b0, this.bx, this.bw, this.bv, this.b2]; for (let e = 0; e < c.length; e++) { let d = c[e]; d.bt(); } if (null != this.applyButtonClick) { this.applyButtonClick(this, b); } } fe(a, b) { let c = [this.b1, this.by, this.b0, this.bx, this.bw, this.bv, this.b2]; for (let e = 0; e < c.length; e++) { let d = c[e]; d.bu(); } if (null != this.cancelButtonClick) { this.cancelButtonClick(this, b); } } fb(a, b) { switch (b.propertyName) { } } } GridColumnOptions.$t = /*@__PURE__*/ markType(GridColumnOptions, 'GridColumnOptions', GridColumnOptionsBase.$); return GridColumnOptions; })();