UNPKG

igniteui-react-grids

Version:

Ignite UI React grid components.

130 lines (129 loc) 4.54 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 { GridCellBase } from "./GridCellBase"; import { Base, runOn, markType } from "igniteui-react-core"; import { stringIsNullOrEmpty } from "igniteui-react-core"; /** * @hidden */ var ImageCell = /** @class */ /*@__PURE__*/ (function (_super) { __extends(ImageCell, _super); function ImageCell(a) { var _this = _super.call(this, a) || this; _this.cq = null; _this.ck = 1; _this.cl = 3; _this.cs = null; _this.cm = false; _this.cn = 1; _this.cp = null; _this.cq = a.createElement("img"); _this.cq.listen("load", runOn(_this, _this.cv)); _this.cp = a.createElement("div"); _this.cp.setRawStyleProperty("background-size", "contain"); _this.cp.setRawStyleProperty("background-repeat", "no-repeat"); _this.cp.setRawStyleProperty("background-position", "center"); _this.cp.setRawStyleProperty("width", "100%"); _this.cp.setRawStyleProperty("height", "100%"); _this.ah.setRawStyleProperty("text-align", "left"); _this.ah.setRawStyleProperty("vertical-align", "middle"); _this.ah.append(_this.cp); return _this; } Object.defineProperty(ImageCell.prototype, "cr", { get: function () { return this.cq; }, enumerable: false, configurable: true }); Object.defineProperty(ImageCell.prototype, "co", { get: function () { return this.cn; }, set: function (a) { this.cn = a; }, enumerable: false, configurable: true }); ImageCell.prototype.cv = function (a) { this.cm = false; if (!stringIsNullOrEmpty(this.cs)) { this.cp.setRawStyleProperty("opacity", "1"); this.cp.setRawStyleProperty("background-image", "url(" + this.cs + ")"); } }; ImageCell.prototype.cw = function (a, b) { if (a == this.cs) { return; } this.ct(); this.cp.setRawStyleProperty("opacity", "0"); if (a == null || a.length == 0) { this.cu(this.cq); return; } if (Base.equalsStatic(a, this.cs)) { return; } this.c0(a, b); var img_ = this.cq.getNativeElement(); if (img_ != null && (img_.complete)) { this.cm = false; this.cq.setRawStyleProperty("opacity", "1"); this.cp.setRawStyleProperty("background-image", "url(" + this.cs + ")"); } }; ImageCell.prototype.cu = function (a) { a.setAttribute("src", ""); this.cp.setRawStyleProperty("background-image", ""); }; ImageCell.prototype.cz = function (a) { switch (a) { case 1: this.cp.setRawStyleProperty("background-size", "100% 100%"); break; case 2: this.cp.setRawStyleProperty("background-size", "auto"); break; case 0: this.cp.setRawStyleProperty("background-size", "contain"); break; } }; ImageCell.prototype.c0 = function (a, b) { this.cm = true; this.cs = a; this.cr.setAttribute("src", a); }; ImageCell.prototype.ct = function () { if (this.cm) { this.cu(this.cq); this.cs = ""; } }; ImageCell.prototype.cx = function (a) { this.ck = a; }; ImageCell.prototype.cy = function (a) { this.cl = a; }; ImageCell.prototype.get_z = function () { return true; }; ImageCell.prototype.bs = function (a, b, c) { _super.prototype.bs.call(this, a, b, c); if (a == "Indent" || a == "IsCollapsable") { this.cp.setRawStyleProperty("margin-left", this.a3 + this.a5 + this.a4 + "px"); } }; ImageCell.$t = markType(ImageCell, 'ImageCell', GridCellBase.$); return ImageCell; }(GridCellBase)); export { ImageCell };