igniteui-react-grids
Version:
Ignite UI React grid components.
108 lines (107 loc) • 4.85 kB
JavaScript
/*
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 { GridCompoundConditionalStyle } from "./GridCompoundConditionalStyle";
import { TextIconSetBuiltInTypes_$type } from "./TextIconSetBuiltInTypes";
import { GridConditionalStyle } from "./GridConditionalStyle";
import { BrushUtil } from "igniteui-react-core";
import { Convert } from "igniteui-react-core";
import { enumGetBox, markType } from "igniteui-react-core";
import { GridConditionalStyleCollection } from "./GridConditionalStyleCollection";
import { GridConditionalStyleProperty } from "./GridConditionalStyleProperty";
import { GridStyleRepository } from "./GridStyleRepository";
import { intDivide } from "igniteui-react-core";
/**
* @hidden
*/
var TextIconSetConditionalStyle = /** @class */ /*@__PURE__*/ (function (_super) {
__extends(TextIconSetConditionalStyle, _super);
function TextIconSetConditionalStyle() {
var _this = _super !== null && _super.apply(this, arguments) || this;
_this.au = 0;
_this.at = null;
return _this;
}
Object.defineProperty(TextIconSetConditionalStyle.prototype, "av", {
get: function () {
return this.au;
},
set: function (a) {
var b = this.au;
this.au = a;
if (b != a) {
this.ao("IconType", enumGetBox(TextIconSetBuiltInTypes_$type, b), enumGetBox(TextIconSetBuiltInTypes_$type, a));
}
},
enumerable: false,
configurable: true
});
TextIconSetConditionalStyle.prototype.as = function (a) {
switch (a) {
case 3: return [this.aw("F09F9880"), this.aw("F09F9890"), this.aw("F09F989E")];
case 2: return [this.aw("E296A0"), this.aw("E296A0"), this.aw("E296A0")];
case 0: return [this.aw("E2AC86"), this.aw("E2AC85"), this.aw("E2AC87")];
case 1: return [this.aw("E29C94EFB88F"), this.aw("E29E96"), this.aw("E29D8C")];
}
return [this.aw("E2AC86"), this.aw("E2AC85"), this.aw("E2AC87")];
};
TextIconSetConditionalStyle.prototype.ar = function (a) {
switch (a) {
case 3:
case 2:
case 1:
case 0: return [BrushUtil.h(255, 26, 199, 32), BrushUtil.h(255, 252, 171, 20), BrushUtil.h(255, 217, 76, 48)];
}
return [BrushUtil.h(255, 26, 199, 32), BrushUtil.h(255, 252, 171, 20), BrushUtil.h(255, 217, 76, 48)];
};
TextIconSetConditionalStyle.prototype.aw = function (a) {
var b = new Array(intDivide(a.length, 2));
for (var c = 0; c < b.length; c++) {
var d = Convert.toByte2(a.substr(c * 2, 2), 16);
b[c] = d;
}
return (new TextDecoder('utf-8').decode(new Uint8Array(b)));
};
TextIconSetConditionalStyle.prototype.aq = function () {
if (this.at == null) {
var a = new GridConditionalStyleCollection();
var b = this.as(this.av);
var c = this.ar(this.av);
for (var d = 0; d < b.length; d++) {
var e = (b.length - d) / b.length;
var f = ((b.length - d) - 1) / b.length;
var g = "env('columnValuePercentage') le " + e + " and env('columnValuePercentage') gt " + f;
var h = new GridConditionalStyle();
h.ak = this.ak + ":::" + d.toString();
h.ae = g;
h.t = true;
h.u = true;
var i = new GridConditionalStyleProperty();
i.aj = 0;
i.b9 = "TextValue";
i.bc = b[d];
h.properties.add(i);
i = new GridConditionalStyleProperty();
i.aj = 0;
i.b9 = "TextColor";
i.bc = c[d];
h.properties.add(i);
i = new GridConditionalStyleProperty();
i.aj = 0;
i.b9 = "FontInfo";
i.bc = GridStyleRepository.i;
h.properties.add(i);
a.add(h);
}
this.at = a;
}
return this.at;
};
TextIconSetConditionalStyle.$t = markType(TextIconSetConditionalStyle, 'TextIconSetConditionalStyle', GridCompoundConditionalStyle.$);
return TextIconSetConditionalStyle;
}(GridCompoundConditionalStyle));
export { TextIconSetConditionalStyle };