UNPKG

igniteui-react-core

Version:
159 lines (158 loc) 5.23 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 { Base, fromEnum, markType } from "./type"; import { CSSColorUtil } from "./CSSColorUtil"; import { JsonDictionaryObject } from "./JsonDictionaryObject"; import { JsonDictionaryValue } from "./JsonDictionaryValue"; import { CultureInfo } from "./culture"; import { timeSpanTotalMilliseconds } from "./timespan"; import { numberToString } from "./numberExtended"; /** * @hidden */ export let ComponentRendererSerializationHelper = /*@__PURE__*/ (() => { class ComponentRendererSerializationHelper extends Base { static serializeBrush(a) { if (a == null) { return null; } let b = a; return CSSColorUtil.c(b); } static serializeColor(a) { if (a == null) { return null; } return CSSColorUtil.d(a); } static serializeBrushCollection(a) { if (a == null) { return null; } let b = ""; let c = a; let d = true; for (let e of fromEnum(c)) { if (d) { d = false; } else { b += ", "; } b += ComponentRendererSerializationHelper.serializeBrush(e); } return b; } static serializePoint(a) { let b = a; let c = new JsonDictionaryObject(); c.item("x", ((() => { let $ret = new JsonDictionaryValue(); $ret.e = 0; $ret.value = b.x; return $ret; })())); c.item("y", ((() => { let $ret = new JsonDictionaryValue(); $ret.e = 0; $ret.value = b.y; return $ret; })())); return c; } static serializeSize(a) { let b = a; let c = new JsonDictionaryObject(); c.item("width", ((() => { let $ret = new JsonDictionaryValue(); $ret.e = 0; $ret.value = b.width; return $ret; })())); c.item("height", ((() => { let $ret = new JsonDictionaryValue(); $ret.e = 0; $ret.value = b.height; return $ret; })())); return c; } static serializeRect(a) { let b = a; let c = new JsonDictionaryObject(); c.item("left", ((() => { let $ret = new JsonDictionaryValue(); $ret.e = 0; $ret.value = b.left; return $ret; })())); c.item("top", ((() => { let $ret = new JsonDictionaryValue(); $ret.e = 0; $ret.value = b.top; return $ret; })())); c.item("width", ((() => { let $ret = new JsonDictionaryValue(); $ret.e = 0; $ret.value = b.width; return $ret; })())); c.item("height", ((() => { let $ret = new JsonDictionaryValue(); $ret.e = 0; $ret.value = b.height; return $ret; })())); return c; } static serializeColorCollection(a) { if (a == null) { return null; } let b = ""; let c = a; let d = true; for (let e of fromEnum(c)) { if (d) { d = false; } else { b += ", "; } b += CSSColorUtil.d(e); } return b; } static serializeTimespan(a) { if (a == null) { return null; } return timeSpanTotalMilliseconds(a); } static serializeDoubleCollection(a) { if (a == null) { return null; } let b = ""; let c = a; let d = true; for (let e of fromEnum(c)) { if (d) { d = false; } else { b += ", "; } b += numberToString(e, CultureInfo.invariantCulture); } return b; } } ComponentRendererSerializationHelper.$t = /*@__PURE__*/ markType(ComponentRendererSerializationHelper, 'ComponentRendererSerializationHelper'); return ComponentRendererSerializationHelper; })();