igniteui-react-grids
Version:
Ignite UI React grid components.
102 lines (101 loc) • 4.58 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 { 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
*/
export let TextIconSetConditionalStyle = /*@__PURE__*/ (() => {
class TextIconSetConditionalStyle extends GridCompoundConditionalStyle {
constructor() {
super(...arguments);
this.au = 0;
this.at = null;
}
get av() {
return this.au;
}
set av(a) {
let b = this.au;
this.au = a;
if (b != a) {
this.ao("IconType", enumGetBox(TextIconSetBuiltInTypes_$type, b), enumGetBox(TextIconSetBuiltInTypes_$type, a));
}
}
as(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")];
}
ar(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)];
}
aw(a) {
let b = new Array(intDivide(a.length, 2));
for (let c = 0; c < b.length; c++) {
let d = Convert.toByte2(a.substr(c * 2, 2), 16);
b[c] = d;
}
return (new TextDecoder('utf-8').decode(new Uint8Array(b)));
}
aq() {
if (this.at == null) {
let a = new GridConditionalStyleCollection();
let b = this.as(this.av);
let c = this.ar(this.av);
for (let d = 0; d < b.length; d++) {
let e = (b.length - d) / b.length;
let f = ((b.length - d) - 1) / b.length;
let g = "env('columnValuePercentage') le " + e + " and env('columnValuePercentage') gt " + f;
let h = new GridConditionalStyle();
h.ak = this.ak + ":::" + d.toString();
h.ae = g;
h.t = true;
h.u = true;
let 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 = /*@__PURE__*/ markType(TextIconSetConditionalStyle, 'TextIconSetConditionalStyle', GridCompoundConditionalStyle.$);
return TextIconSetConditionalStyle;
})();