igniteui-angular-charts
Version:
Ignite UI Angular charting components for building rich data visualizations for modern web apps.
485 lines (484 loc) • 17.1 kB
JavaScript
import { Component, Input, ChangeDetectionStrategy } from '@angular/core';
import { HorizontalAlignment_$type } from "igniteui-angular-core";
import { VerticalAlignment_$type } from "igniteui-angular-core";
import { TreemapNodeStyle } from "./TreemapNodeStyle";
import { TypeRegistrar } from "igniteui-angular-core";
import { NamePatcher, brushToString, stringToBrush, ensureEnum, ensureBool, toSpinal, initializePropertiesFromCss } from "igniteui-angular-core";
import * as i0 from "@angular/core";
/**
* Represents a style to apply to a treemap node.
*/
var IgxTreemapNodeStyleComponent = /** @class */ /*@__PURE__*/ (function () {
function IgxTreemapNodeStyleComponent() {
this.__p = null;
this._hasUserValues = new Set();
this._stylingContainer = null;
this._stylingParent = null;
this._inStyling = false;
if (this._styling) {
NamePatcher.ensureStylablePatched(Object.getPrototypeOf(this));
}
this._implementation = this.createImplementation();
this._implementation.externalObject = this;
this.onImplementationCreated();
if (this._initializeAdapters) {
this._initializeAdapters();
}
}
IgxTreemapNodeStyleComponent.prototype.createImplementation = function () {
return new TreemapNodeStyle();
};
IgxTreemapNodeStyleComponent.prototype.ngOnInit = function () {
};
Object.defineProperty(IgxTreemapNodeStyleComponent.prototype, "i", {
/**
* @hidden
*/
get: function () {
return this._implementation;
} /**
* @hidden
*/,
enumerable: false,
configurable: true
});
IgxTreemapNodeStyleComponent._createFromInternal = function (internal) {
if (!internal) {
return null;
}
if (!internal.$type) {
return null;
}
var name = internal.$type.name;
var externalName = "Igx" + name + "Component";
if (!TypeRegistrar.isRegistered(externalName)) {
return null;
}
return TypeRegistrar.create(externalName);
};
IgxTreemapNodeStyleComponent.prototype.onImplementationCreated = function () {
};
Object.defineProperty(IgxTreemapNodeStyleComponent.prototype, "headerHoverBackground", {
/**
* Gets or sets the background to use for the header when it is hovered.
*/
get: function () {
return brushToString(this.i.bg);
},
set: function (v) {
this.i.bg = stringToBrush(v);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgxTreemapNodeStyleComponent.prototype, "headerBackground", {
/**
* Gets or sets the background to use for the header.
*/
get: function () {
return brushToString(this.i.bf);
},
set: function (v) {
this.i.bf = stringToBrush(v);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgxTreemapNodeStyleComponent.prototype, "headerTextColor", {
/**
* Gets or sets the text color to use for the header.
*/
get: function () {
return brushToString(this.i.bi);
},
set: function (v) {
this.i.bi = stringToBrush(v);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgxTreemapNodeStyleComponent.prototype, "label", {
/**
* Gets or sets the label to use for the node.
*/
get: function () {
return this.i.aq;
},
set: function (v) {
this.i.aq = v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgxTreemapNodeStyleComponent.prototype, "textColor", {
/**
* Gets or sets the text color to use for the nodes.
*/
get: function () {
return brushToString(this.i.bk);
},
set: function (v) {
this.i.bk = stringToBrush(v);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgxTreemapNodeStyleComponent.prototype, "headerHoverTextColor", {
/**
* Gets or sets the text color to use for the header.
*/
get: function () {
return brushToString(this.i.bh);
},
set: function (v) {
this.i.bh = stringToBrush(v);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgxTreemapNodeStyleComponent.prototype, "headerLabelLeftMargin", {
/**
* Gets or sets the left margin to use for the header.
*/
get: function () {
return this.i.u;
},
set: function (v) {
this.i.u = +v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgxTreemapNodeStyleComponent.prototype, "headerLabelTopMargin", {
/**
* Gets or sets the top margin to use for the header.
*/
get: function () {
return this.i.w;
},
set: function (v) {
this.i.w = +v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgxTreemapNodeStyleComponent.prototype, "headerLabelRightMargin", {
/**
* Gets or sets the right margin to use for the header.
*/
get: function () {
return this.i.v;
},
set: function (v) {
this.i.v = +v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgxTreemapNodeStyleComponent.prototype, "headerLabelBottomMargin", {
/**
* Gets or sets the bottom margin to use for the labels.
*/
get: function () {
return this.i.t;
},
set: function (v) {
this.i.t = +v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgxTreemapNodeStyleComponent.prototype, "labelLeftMargin", {
/**
* Gets or sets the left margin to use for the labels.
*/
get: function () {
return this.i.y;
},
set: function (v) {
this.i.y = +v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgxTreemapNodeStyleComponent.prototype, "labelTopMargin", {
/**
* Gets or sets the top margin to use for the labels.
*/
get: function () {
return this.i.aa;
},
set: function (v) {
this.i.aa = +v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgxTreemapNodeStyleComponent.prototype, "labelRightMargin", {
/**
* Gets or sets the right margin to use for the labels.
*/
get: function () {
return this.i.z;
},
set: function (v) {
this.i.z = +v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgxTreemapNodeStyleComponent.prototype, "labelBottomMargin", {
/**
* Gets or sets the bottom margin to use for the labels.
*/
get: function () {
return this.i.x;
},
set: function (v) {
this.i.x = +v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgxTreemapNodeStyleComponent.prototype, "headerHeight", {
/**
* Gets or sets the height to use for the header.
*/
get: function () {
return this.i.s;
},
set: function (v) {
this.i.s = +v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgxTreemapNodeStyleComponent.prototype, "labelHorizontalAlignment", {
/**
* Gets or sets the horizontal alignment to use for the node labels.
*/
get: function () {
return this.i.a6;
},
set: function (v) {
this.i.a6 = ensureEnum(HorizontalAlignment_$type, v);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgxTreemapNodeStyleComponent.prototype, "labelVerticalAlignment", {
/**
* Gets or sets the vertical alignment to use for the node labels.
*/
get: function () {
return this.i.bm;
},
set: function (v) {
this.i.bm = ensureEnum(VerticalAlignment_$type, v);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgxTreemapNodeStyleComponent.prototype, "fill", {
/**
* Gets or sets the fill color to use for the nodes.
*/
get: function () {
return brushToString(this.i.be);
},
set: function (v) {
this.i.be = stringToBrush(v);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgxTreemapNodeStyleComponent.prototype, "outline", {
/**
* Gets or sets the outline to use for the nodes.
*/
get: function () {
return brushToString(this.i.bj);
},
set: function (v) {
this.i.bj = stringToBrush(v);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgxTreemapNodeStyleComponent.prototype, "strokeThickness", {
/**
* Gets or sets the stroke thickness to use for the node outline.
*/
get: function () {
return this.i.ac;
},
set: function (v) {
this.i.ac = +v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgxTreemapNodeStyleComponent.prototype, "opacity", {
/**
* Gets or sets the opacity to use for the node.
*/
get: function () {
return this.i.ab;
},
set: function (v) {
this.i.ab = +v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgxTreemapNodeStyleComponent.prototype, "fadeOpacity", {
/**
* Gets or sets the fade opacity that should be used when highlighting.
*/
get: function () {
return this.i.r;
},
set: function (v) {
this.i.r = +v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgxTreemapNodeStyleComponent.prototype, "highlightingHandled", {
/**
* Gets or sets if highlighting was handled, and whether internal highlighting logic should be skipped.
*/
get: function () {
return this.i.c;
},
set: function (v) {
this.i.c = ensureBool(v);
},
enumerable: false,
configurable: true
});
IgxTreemapNodeStyleComponent.prototype.findByName = function (name) {
if (this.findEphemera) {
if (name && name.indexOf("@@e:") == 0) {
return this.findEphemera(name);
}
}
return null;
};
Object.defineProperty(IgxTreemapNodeStyleComponent.prototype, "hasUserValues", {
get: function () {
return this._hasUserValues;
},
enumerable: false,
configurable: true
});
IgxTreemapNodeStyleComponent.prototype.__m = function (propertyName) {
if (!this._inStyling) {
this._hasUserValues.add(propertyName);
}
};
IgxTreemapNodeStyleComponent.prototype._styling = function (container, component, parent) {
if (this._inStyling) {
return;
}
this._inStyling = true;
this._stylingContainer = container;
this._stylingParent = component;
var genericPrefix = "";
var typeName = this.i.$type.name;
if (typeName.indexOf("Xam") === 0) {
typeName = typeName.substring(3);
}
genericPrefix = toSpinal("TreemapNodeStyleComponent");
var additionalPrefixes = [];
var prefix = toSpinal(typeName);
additionalPrefixes.push(prefix + "-");
var 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);
}
var basePrefix = toSpinal(typeName);
additionalPrefixes.push(basePrefix + "-");
b = b.baseType;
}
if (parent) {
var parentTypeName = parent.i.$type.name;
if (parentTypeName.indexOf("Xam") === 0) {
parentTypeName = parentTypeName.substring(3);
}
var 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;
};
IgxTreemapNodeStyleComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: IgxTreemapNodeStyleComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
IgxTreemapNodeStyleComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: IgxTreemapNodeStyleComponent, selector: "igx-treemap-node-style", inputs: { headerHoverBackground: "headerHoverBackground", headerBackground: "headerBackground", headerTextColor: "headerTextColor", label: "label", textColor: "textColor", headerHoverTextColor: "headerHoverTextColor", headerLabelLeftMargin: "headerLabelLeftMargin", headerLabelTopMargin: "headerLabelTopMargin", headerLabelRightMargin: "headerLabelRightMargin", headerLabelBottomMargin: "headerLabelBottomMargin", labelLeftMargin: "labelLeftMargin", labelTopMargin: "labelTopMargin", labelRightMargin: "labelRightMargin", labelBottomMargin: "labelBottomMargin", headerHeight: "headerHeight", labelHorizontalAlignment: "labelHorizontalAlignment", labelVerticalAlignment: "labelVerticalAlignment", fill: "fill", outline: "outline", strokeThickness: "strokeThickness", opacity: "opacity", fadeOpacity: "fadeOpacity", highlightingHandled: "highlightingHandled" }, providers: [], ngImport: i0, template: "", isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
return IgxTreemapNodeStyleComponent;
}());
export { IgxTreemapNodeStyleComponent };
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: IgxTreemapNodeStyleComponent, decorators: [{
type: Component,
args: [{
selector: 'igx-treemap-node-style',
template: "",
providers: [],
changeDetection: ChangeDetectionStrategy.OnPush
}]
}], ctorParameters: function () { return []; }, propDecorators: { headerHoverBackground: [{
type: Input
}], headerBackground: [{
type: Input
}], headerTextColor: [{
type: Input
}], label: [{
type: Input
}], textColor: [{
type: Input
}], headerHoverTextColor: [{
type: Input
}], headerLabelLeftMargin: [{
type: Input
}], headerLabelTopMargin: [{
type: Input
}], headerLabelRightMargin: [{
type: Input
}], headerLabelBottomMargin: [{
type: Input
}], labelLeftMargin: [{
type: Input
}], labelTopMargin: [{
type: Input
}], labelRightMargin: [{
type: Input
}], labelBottomMargin: [{
type: Input
}], headerHeight: [{
type: Input
}], labelHorizontalAlignment: [{
type: Input
}], labelVerticalAlignment: [{
type: Input
}], fill: [{
type: Input
}], outline: [{
type: Input
}], strokeThickness: [{
type: Input
}], opacity: [{
type: Input
}], fadeOpacity: [{
type: Input
}], highlightingHandled: [{
type: Input
}] } });