igniteui-angular-core
Version:
Ignite UI Angular Core logic used in multiple UI components.
72 lines (71 loc) • 2.8 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 { UIElementPropertyAccessor } from "./UIElementPropertyAccessor";
import { markType } from "./type";
import { Thickness } from "./Thickness";
import { stringReplace } from "./string";
import { isNaN_ } from "./number";
/**
* @hidden
*/
export let CssThicknessPropertyAccessor = /*@__PURE__*/ (() => {
class CssThicknessPropertyAccessor extends UIElementPropertyAccessor {
constructor(a) {
super();
this.e = null;
this.g = null;
this.f = null;
this.d = null;
this.h = null;
this.h = a;
if (this.h == "border-width") {
this.e = "border-left-width";
this.g = "border-top-width";
this.f = "border-right-width";
this.d = "border-bottom-width";
}
else {
this.e = this.h + "-left";
this.g = this.h + "-top";
this.f = this.h + "-right";
this.d = this.h + "-bottom";
}
}
b(a) {
let b = a;
let c = b.getStyleProperty(this.e);
let d = b.getStyleProperty(this.g);
let e = b.getStyleProperty(this.f);
let f = b.getStyleProperty(this.d);
let g = parseFloat(stringReplace(c, "px", ""));
let h = parseFloat(stringReplace(c, "px", ""));
let i = parseFloat(stringReplace(c, "px", ""));
let j = parseFloat(stringReplace(c, "px", ""));
if (isNaN_(g)) {
g = 0;
}
if (isNaN_(h)) {
h = 0;
}
if (isNaN_(i)) {
i = 0;
}
if (isNaN_(j)) {
j = 0;
}
return new Thickness(1, g, h, i, j);
}
c(a, b) {
let c = a;
let d = b;
let e = d.top + "px " + d.right + "px " + d.bottom + "px " + d.left + "px";
c.setStyleProperty(this.h, e);
}
}
CssThicknessPropertyAccessor.$t = markType(CssThicknessPropertyAccessor, 'CssThicknessPropertyAccessor', UIElementPropertyAccessor.$);
return CssThicknessPropertyAccessor;
})();