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, 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();
    }
    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.a7);
        },
        set: function (v) {
            this.i.a7 = 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.a6);
        },
        set: function (v) {
            this.i.a6 = 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.a9);
        },
        set: function (v) {
            this.i.a9 = 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.ai;
        },
        set: function (v) {
            this.i.ai = 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.bb);
        },
        set: function (v) {
            this.i.bb = 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.a8);
        },
        set: function (v) {
            this.i.a8 = 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.p;
        },
        set: function (v) {
            this.i.p = +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.r;
        },
        set: function (v) {
            this.i.r = +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.q;
        },
        set: function (v) {
            this.i.q = +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.o;
        },
        set: function (v) {
            this.i.o = +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.t;
        },
        set: function (v) {
            this.i.t = +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.v;
        },
        set: function (v) {
            this.i.v = +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.u;
        },
        set: function (v) {
            this.i.u = +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.s;
        },
        set: function (v) {
            this.i.s = +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.n;
        },
        set: function (v) {
            this.i.n = +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.ax;
        },
        set: function (v) {
            this.i.ax = 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.bd;
        },
        set: function (v) {
            this.i.bd = 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.a5);
        },
        set: function (v) {
            this.i.a5 = 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.ba);
        },
        set: function (v) {
            this.i.ba = 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.w;
        },
        set: function (v) {
            this.i.w = +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.14", ngImport: i0, type: IgxTreemapNodeStyleComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
    IgxTreemapNodeStyleComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.14", 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" }, providers: [], ngImport: i0, template: "", isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
    return IgxTreemapNodeStyleComponent;
}());
export { IgxTreemapNodeStyleComponent };
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.14", 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
            }] } });
