UNPKG

igniteui-angular-charts

Version:

Ignite UI Angular charting components for building rich data visualizations for modern web apps.

386 lines (385 loc) 13.6 kB
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. */ export let IgxTreemapNodeStyleComponent = /*@__PURE__*/ (() => { class IgxTreemapNodeStyleComponent { constructor() { 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(); } } createImplementation() { return new TreemapNodeStyle(); } ngOnInit() { } /** * @hidden */ get i() { return this._implementation; } /** * @hidden */ 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); } onImplementationCreated() { } /** * Gets or sets the background to use for the header when it is hovered. */ get headerHoverBackground() { return brushToString(this.i.bg); } set headerHoverBackground(v) { this.i.bg = stringToBrush(v); } /** * Gets or sets the background to use for the header. */ get headerBackground() { return brushToString(this.i.bf); } set headerBackground(v) { this.i.bf = stringToBrush(v); } /** * Gets or sets the text color to use for the header. */ get headerTextColor() { return brushToString(this.i.bi); } set headerTextColor(v) { this.i.bi = stringToBrush(v); } /** * Gets or sets the label to use for the node. */ get label() { return this.i.aq; } set label(v) { this.i.aq = v; } /** * Gets or sets the text color to use for the nodes. */ get textColor() { return brushToString(this.i.bk); } set textColor(v) { this.i.bk = stringToBrush(v); } /** * Gets or sets the text color to use for the header. */ get headerHoverTextColor() { return brushToString(this.i.bh); } set headerHoverTextColor(v) { this.i.bh = stringToBrush(v); } /** * Gets or sets the left margin to use for the header. */ get headerLabelLeftMargin() { return this.i.u; } set headerLabelLeftMargin(v) { this.i.u = +v; } /** * Gets or sets the top margin to use for the header. */ get headerLabelTopMargin() { return this.i.w; } set headerLabelTopMargin(v) { this.i.w = +v; } /** * Gets or sets the right margin to use for the header. */ get headerLabelRightMargin() { return this.i.v; } set headerLabelRightMargin(v) { this.i.v = +v; } /** * Gets or sets the bottom margin to use for the labels. */ get headerLabelBottomMargin() { return this.i.t; } set headerLabelBottomMargin(v) { this.i.t = +v; } /** * Gets or sets the left margin to use for the labels. */ get labelLeftMargin() { return this.i.y; } set labelLeftMargin(v) { this.i.y = +v; } /** * Gets or sets the top margin to use for the labels. */ get labelTopMargin() { return this.i.aa; } set labelTopMargin(v) { this.i.aa = +v; } /** * Gets or sets the right margin to use for the labels. */ get labelRightMargin() { return this.i.z; } set labelRightMargin(v) { this.i.z = +v; } /** * Gets or sets the bottom margin to use for the labels. */ get labelBottomMargin() { return this.i.x; } set labelBottomMargin(v) { this.i.x = +v; } /** * Gets or sets the height to use for the header. */ get headerHeight() { return this.i.s; } set headerHeight(v) { this.i.s = +v; } /** * Gets or sets the horizontal alignment to use for the node labels. */ get labelHorizontalAlignment() { return this.i.a6; } set labelHorizontalAlignment(v) { this.i.a6 = ensureEnum(HorizontalAlignment_$type, v); } /** * Gets or sets the vertical alignment to use for the node labels. */ get labelVerticalAlignment() { return this.i.bm; } set labelVerticalAlignment(v) { this.i.bm = ensureEnum(VerticalAlignment_$type, v); } /** * Gets or sets the fill color to use for the nodes. */ get fill() { return brushToString(this.i.be); } set fill(v) { this.i.be = stringToBrush(v); } /** * Gets or sets the outline to use for the nodes. */ get outline() { return brushToString(this.i.bj); } set outline(v) { this.i.bj = stringToBrush(v); } /** * Gets or sets the stroke thickness to use for the node outline. */ get strokeThickness() { return this.i.ac; } set strokeThickness(v) { this.i.ac = +v; } /** * Gets or sets the opacity to use for the node. */ get opacity() { return this.i.ab; } set opacity(v) { this.i.ab = +v; } /** * Gets or sets the fade opacity that should be used when highlighting. */ get fadeOpacity() { return this.i.r; } set fadeOpacity(v) { this.i.r = +v; } /** * Gets or sets if highlighting was handled, and whether internal highlighting logic should be skipped. */ get highlightingHandled() { return this.i.c; } set highlightingHandled(v) { this.i.c = ensureBool(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("TreemapNodeStyleComponent"); 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; } } 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; })(); 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 }] } });