igniteui-angular-gauges
Version:
Ignite UI Angular gauge components.
253 lines (252 loc) • 9.93 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 { Component, Input } from "@angular/core";
import { TypeRegistrar } from "igniteui-angular-core";
import { brushToString, stringToBrush, toSpinal, initializePropertiesFromCss } from "igniteui-angular-core";
import { XamLinearGraphRange } from "./XamLinearGraphRange";
import * as i0 from "@angular/core";
export let IgxLinearGraphRangeComponent = /*@__PURE__*/ (() => {
class IgxLinearGraphRangeComponent {
constructor() {
this._renderer = null;
this.__p = null;
this._hasUserValues = new Set();
this._stylingContainer = null;
this._stylingParent = null;
this._inStyling = false;
this._zoneRunner = null;
this._implementation = this.createImplementation();
this._implementation.externalObject = this;
this.onImplementationCreated();
}
get i() {
return this._implementation;
}
onImplementationCreated() {
}
get rangeInternal() {
return this.i;
}
createImplementation() {
return new XamLinearGraphRange();
}
ngOnInit() {
}
_provideRenderer(renderer) {
this._renderer = renderer;
this._zoneRunner = (act) => renderer._ngZone.run(act);
}
static _createFromInternal(internal) {
if (!internal) {
return null;
}
if (!internal.$type) {
return null;
}
let name = internal.$type.name;
let externalName = "Igx" + name + "Component";
if (!TypeRegistrar.isRegistered(externalName)) {
return null;
}
return TypeRegistrar.create(externalName);
}
/**
* Gets or sets the name of the range.
*/
get name() {
return this.i.u;
}
set name(v) {
this.i.u = v;
}
/**
* Gets or sets the brush to use to fill the range.
*/
get brush() {
return brushToString(this.i.an);
}
set brush(v) {
this.i.an = stringToBrush(v);
}
/**
* Gets or sets the outline to use when rendering the range.
*/
get outline() {
return brushToString(this.i.ao);
}
set outline(v) {
this.i.ao = stringToBrush(v);
}
/**
* Gets or sets the value at which the range starts along the scale.
*/
get startValue() {
return this.i.o;
}
set startValue(v) {
this.i.o = +v;
}
/**
* Gets or sets the value at which the range ends along the scale.
*/
get endValue() {
return this.i.j;
}
set endValue(v) {
this.i.j = +v;
}
/**
* Gets or sets the distance measured from the front/bottom of the bullet graph (from 0 to 1) at which to start rendering the inner edge of the range.
* Values further from zero than 1 can be used to make this extend further than the normal width/height of the bullet graph.
*/
get innerStartExtent() {
return this.i.l;
}
set innerStartExtent(v) {
this.i.l = +v;
}
/**
* Gets or sets the distance measured from the front/bottom of the bullet graph (from 0 to 1) at which to end rendering the inner edge of the range.
* Values further from zero than 1 can be used to make this extend further than the normal width/height of the bullet graph.
*/
get innerEndExtent() {
return this.i.k;
}
set innerEndExtent(v) {
this.i.k = +v;
}
/**
* Gets or sets the distance measured from the front/bottom of the bullet graph (from 0 to 1) at which to start rendering the outer edge of the range.
* Values further from zero than 1 can be used to make this extend further than the normal width/height of the bullet graph.
*/
get outerStartExtent() {
return this.i.n;
}
set outerStartExtent(v) {
this.i.n = +v;
}
/**
* Gets or sets the distance measured from the front/bottom of the bullet graph (from 0 to 1) at which to end rendering the outer edge of the range.
* Values further from zero than 1 can be used to make this extend further than the normal width/height of the bullet graph.
*/
get outerEndExtent() {
return this.i.m;
}
set outerEndExtent(v) {
this.i.m = +v;
}
/**
* Gets or sets the stroke thickness to use when rendering this range's outline.
*/
get strokeThickness() {
return this.i.p;
}
set strokeThickness(v) {
this.i.p = +v;
}
findByName(name) {
if (this.findEphemera) {
if (name && name.indexOf("@@e:") == 0) {
return this.findEphemera(name);
}
}
return null;
}
get hasUserValues() {
return this._hasUserValues;
}
__m(propertyName) {
if (!this._inStyling) {
this._hasUserValues.add(propertyName);
}
}
_styling(container, component, parent) {
if (this._inStyling) {
return;
}
this._inStyling = true;
this._stylingContainer = container;
this._stylingParent = component;
let genericPrefix = "";
let typeName = this.i.$type.name;
if (typeName.indexOf("Xam") === 0) {
typeName = typeName.substring(3);
}
genericPrefix = toSpinal("LinearGraphRangeComponent");
let additionalPrefixes = [];
let prefix = toSpinal(typeName);
additionalPrefixes.push(prefix + "-");
let b = this.i.$type.baseType;
while (b && b.name != "Object" &&
b.name != "Base" &&
b.name != "Control" &&
b.Name != "DependencyObject" &&
b.Name != "FrameworkElement") {
typeName = b.name;
if (typeName.indexOf("Xam") === 0) {
typeName = typeName.substring(3);
}
let basePrefix = toSpinal(typeName);
additionalPrefixes.push(basePrefix + "-");
b = b.baseType;
}
if (parent) {
let parentTypeName = parent.i.$type.name;
if (parentTypeName.indexOf("Xam") === 0) {
parentTypeName = parentTypeName.substring(3);
}
let parentPrefix = toSpinal(parentTypeName);
additionalPrefixes.push(parentPrefix + "-" + genericPrefix + "-");
additionalPrefixes.push(parentPrefix + "-" + prefix + "-");
}
initializePropertiesFromCss(container, this, genericPrefix + "-", this.hasUserValues, false, additionalPrefixes);
if (this._otherStyling) {
this._otherStyling(container, component, parent);
}
this._inStyling = false;
}
_runInZone(act) {
if (this._zoneRunner != null) {
this._zoneRunner(act);
}
else {
act();
}
}
}
IgxLinearGraphRangeComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: IgxLinearGraphRangeComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
IgxLinearGraphRangeComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: IgxLinearGraphRangeComponent, selector: "igx-linear-graph-range", inputs: { name: "name", brush: "brush", outline: "outline", startValue: "startValue", endValue: "endValue", innerStartExtent: "innerStartExtent", innerEndExtent: "innerEndExtent", outerStartExtent: "outerStartExtent", outerEndExtent: "outerEndExtent", strokeThickness: "strokeThickness" }, providers: [], ngImport: i0, template: ``, isInline: true });
return IgxLinearGraphRangeComponent;
})();
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: IgxLinearGraphRangeComponent, decorators: [{
type: Component,
args: [{
selector: 'igx-linear-graph-range',
template: ``,
providers: []
}]
}], ctorParameters: function () { return []; }, propDecorators: { name: [{
type: Input
}], brush: [{
type: Input
}], outline: [{
type: Input
}], startValue: [{
type: Input
}], endValue: [{
type: Input
}], innerStartExtent: [{
type: Input
}], innerEndExtent: [{
type: Input
}], outerStartExtent: [{
type: Input
}], outerEndExtent: [{
type: Input
}], strokeThickness: [{
type: Input
}] } });