UNPKG

igniteui-react-grids

Version:

Ignite UI React grid components.

134 lines (133 loc) 5.13 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 { Base, markType } from "igniteui-react-core"; import { Color } from "igniteui-react-core"; import { CellModel } from "./CellModel"; import { FontUtil } from "igniteui-react-core"; /** * @hidden */ var ContentCellModelHelper = /** @class */ /*@__PURE__*/ (function (_super) { __extends(ContentCellModelHelper, _super); function ContentCellModelHelper() { return _super !== null && _super.apply(this, arguments) || this; } ContentCellModelHelper.g = function (a) { if (a == null) { return ContentCellModelHelper.f; } return a.color; }; ContentCellModelHelper.c = function (a, b, c) { switch (c) { case 0: a.setRawStyleProperty("text-align", "left"); break; case 1: a.setRawStyleProperty("text-align", "center"); break; case 2: a.setRawStyleProperty("text-align", "right"); break; case 3: a.setRawStyleProperty("text-align", "center"); break; } }; ContentCellModelHelper.e = function (a, b, c) { switch (c) { case 0: b.setRawStyleProperty("vertical-align", "top"); break; case 1: b.setRawStyleProperty("vertical-align", "center"); break; case 2: b.setRawStyleProperty("vertical-align", "bottom"); break; case 3: b.setRawStyleProperty("vertical-align", "center"); break; } }; ContentCellModelHelper.a = function (a, b, c, d, e) { if (b.a3) { if (b.a8(CellModel.fa) || b.a8(CellModel.eg) || b.a8(CellModel.hc) || b.a7("IsRowPinned") || b.a7("IsRowSticky") || b.a7("PinnedRowOpacity")) { var f = Math.min(1, Math.max(0, b.ct)); var g = b.cg * (1 - f); d.setRawStyleProperty("opacity", g.toString()); if (b.bi) { e.ci(b.cg * f); } } if (b.a8(CellModel.er)) { ContentCellModelHelper.d(d, b.lw); if (b.bi) { e.cf(b.lw); } } if (b.a8(CellModel.gg)) { switch (b.aa) { case 0: d.setRawStyleProperty("white-space", "nowrap"); d.setRawStyleProperty("text-overflow", "ellipsis"); break; case 3: case 2: d.setRawStyleProperty("white-space", "pre-wrap"); d.setRawStyleProperty("text-overflow", "ellipsis"); break; case 1: d.setRawStyleProperty("white-space", "nowrap"); d.setRawStyleProperty("text-overflow", "clip"); break; } } if (b.a8(CellModel.fw) || b.a8(CellModel.hb)) { var h = b.g; var i = b.i; ContentCellModelHelper.c(c, d, h); e.bq(c, d, h); ContentCellModelHelper.e(c, d, i); if (b.bi) { e.ce(h, i); } } if (b.a7("ActualFontInfo")) { ContentCellModelHelper.b(a, d, b.ae); } if (b.a7("IsEdited") || b.a7("IsDeleted")) { if (b.a9 || b.a6) { if (b.a6) { d.setRawStyleProperty("text-decoration", "line-through"); } else { d.setRawStyleProperty("text-decoration", "none"); } } else { d.setRawStyleProperty("text-decoration", "none"); } } } }; ContentCellModelHelper.b = function (a, b, c) { if (c == null) { c = FontUtil.getDefaultFont(a); } b.setRawStyleProperty("font", c.fontString); }; ContentCellModelHelper.d = function (a, b) { var c = ContentCellModelHelper.g(b); a.setRawStyleProperty("color", c.colorString); }; ContentCellModelHelper.$t = markType(ContentCellModelHelper, 'ContentCellModelHelper'); ContentCellModelHelper.f = Color.u(0, 0, 0, 0); return ContentCellModelHelper; }(Base)); export { ContentCellModelHelper };