igniteui-react-core
Version:
Ignite UI React Core.
197 lines (196 loc) • 5.65 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 { Base, toNullable, Point_$type, markType, PointUtil } from "./type";
import { Brush } from "./Brush";
import { BrushCollectionUtil } from "./BrushCollectionUtil";
import { Color } from "./Color";
import { Size } from "./Size";
import { Rect } from "./Rect";
import { DoubleCollection } from "./DoubleCollection";
/**
* @hidden
*/
var PlatformAPIHelper = /** @class */ /*@__PURE__*/ (function (_super) {
__extends(PlatformAPIHelper, _super);
function PlatformAPIHelper() {
return _super !== null && _super.apply(this, arguments) || this;
}
PlatformAPIHelper.b = function (a) {
if (a == null) {
return null;
}
return a._fill;
};
PlatformAPIHelper.a = function (a) {
if (a == null) {
return null;
}
return BrushCollectionUtil.a(a);
};
PlatformAPIHelper.c = function (a) {
if (Color.c(toNullable(Color.$, a), toNullable(Color.$, null))) {
return null;
}
return a.colorString;
};
PlatformAPIHelper.e = function (a) {
if (PointUtil.equals(a, null)) {
return null;
}
var b = {};
var c = b;
c["x"] = a.x;
c["y"] = a.y;
return c;
};
PlatformAPIHelper.h = function (a) {
if (Size.l_op_Equality_Lifted(toNullable(Size.$, a), toNullable(Size.$, null))) {
return null;
}
var b = {};
var c = b;
c["width"] = a.width;
c["height"] = a.height;
return c;
};
PlatformAPIHelper.g = function (a) {
if (Rect.l_op_Equality(a, null)) {
return null;
}
var b = {};
var c = b;
c["left"] = a.left;
c["top"] = a.top;
c["width"] = a.width;
c["height"] = a.height;
return c;
};
PlatformAPIHelper.d = function (a) {
if (a == null) {
return null;
}
return a.toArray();
};
PlatformAPIHelper.j = function (a) {
if (a == null) {
return null;
}
return Brush.create(a);
};
PlatformAPIHelper.k = function (a) {
if (a == null) {
return null;
}
return Brush.create(a).color;
};
PlatformAPIHelper.i = function (a) {
if (a == null) {
return null;
}
return BrushCollectionUtil.c(a);
};
PlatformAPIHelper.m = function (a) {
if (a == null) {
return null;
}
var b = a;
return { $type: Point_$type, x: b["x"], y: b["y"] };
};
PlatformAPIHelper.p = function (a) {
if (a == null) {
return null;
}
var b = a;
return new Size(1, b["width"], b["height"]);
};
PlatformAPIHelper.o = function (a) {
if (a == null) {
return null;
}
var b = a;
return new Rect(0, b["left"], b["top"], b["width"], b["height"]);
};
PlatformAPIHelper.l = function (a) {
if (a == null) {
return null;
}
var b = a;
var c = new DoubleCollection();
for (var d = 0; d < b.length; d++) {
c.add(b[d]);
}
return c;
};
PlatformAPIHelper.f = function (a, b) {
if (a == Brush.$) {
return PlatformAPIHelper.b(b);
}
if (a == Color.$) {
return PlatformAPIHelper.c(b);
}
if (a == Point_$type) {
return PlatformAPIHelper.e(b);
}
if (a == Size.$) {
return PlatformAPIHelper.h(b);
}
if (a == Rect.$) {
return PlatformAPIHelper.g(b);
}
if (a == DoubleCollection.$) {
return PlatformAPIHelper.d(b);
}
return b;
};
PlatformAPIHelper.n = function (a, b) {
if (a == Brush.$) {
return PlatformAPIHelper.j(b);
}
if (a == Color.$) {
var c = PlatformAPIHelper.j(b);
if (c == null) {
return null;
}
return c._fill;
}
if (a == Point_$type) {
return PlatformAPIHelper.m(b);
}
if (a == Size.$) {
return PlatformAPIHelper.p(b);
}
if (a == Rect.$) {
return PlatformAPIHelper.o(b);
}
if (a == DoubleCollection.$) {
return PlatformAPIHelper.l(b);
}
return b;
};
PlatformAPIHelper.q = function (a) {
if (a == null) {
return null;
}
if (a.length == 1) {
return a.toLowerCase();
}
return a.substr(0, 1).toLowerCase() + a.substr(1);
};
PlatformAPIHelper.r = function (a) {
if (a == null) {
return null;
}
if (a.length == 1) {
return a.toUpperCase();
}
return a.substr(0, 1).toUpperCase() + a.substr(1);
};
PlatformAPIHelper.$t = markType(PlatformAPIHelper, 'PlatformAPIHelper');
return PlatformAPIHelper;
}(Base));
export { PlatformAPIHelper };