import { toSpinal, initializePropertiesFromCss, NamePatcher } from "igniteui-angular-core/ES2015/componentUtil";
export const LegendBaseStyles = [`
:host {
    display: block;
}
.ig-legend {
  border: none;
  border: var(--legend-border, none);
}
.ig-chart-legend-item-text {
  font: 12px Verdana, Arial, sans-serif;
  font: var(--legend-item-font, 12px Verdana, Arial, sans-serif);
}
.ig-chart-legend-items-list
{
    padding: 0px;
    padding: var(--legend-item-padding, 0px);
    margin: 5px;
    margin: var(--legend-item-margin, 5px);
}
.ig-chart-legend-item-text
{
    vertical-align: middle;
    vertical-align: var(--legend-item-vertical-align, middle);
}
.ig-legend
{
    overflow: auto;
    overflow: var(--legend-item-overflow, auto);
}
.ig-chart-legend-item-badge, .ui-chart-legend-item-badge canvas
{
    vertical-align: middle;
    vertical-align: var(--legend-item-badge-vertical-align, middle);
}
`];
/**
 * Represents the base class for a legend in IgxDataChartComponent.
*/
export class IgxLegendBaseComponent {
    constructor() {
        this._zoneRunner = null;
        this.__p = null;
        this._hasUserValues = new Set();
        this._stylingContainer = null;
        this._stylingParent = null;
        this._inStyling = false;
        this._implementation = this.createImplementation();
        this._implementation.externalObject = this;
        this.onImplementationCreated();
        if (this._styling) {
            NamePatcher.ensureStylablePatched(Object.getPrototypeOf(this));
        }
    }
    get i() {
        return this._implementation;
    }
    onImplementationCreated() {
    }
    /**
 * Gets if the legend is item-wise.
*/
    get isItemwise() {
        return this.i.isItemwise;
    }
    /**
     * Gets if the legend is a financial legend.
    */
    get isFinancial() {
        return this.i.isFinancial;
    }
    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("LegendBaseComponent");
        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;
    }
}
//# sourceMappingURL=igx-legend-base-component.js.map