import * as tslib_1 from "tslib";
var IgxLegendComponent_1;
import { Component, Renderer2, ElementRef, forwardRef, Input, NgZone, ChangeDetectionStrategy } from '@angular/core';
import { IgxLegendBaseComponent, LegendBaseStyles } from './igx-legend-base-component';
import { Legend } from "./Legend";
import { LegendOrientation, LegendOrientation_$type } from './LegendOrientation';
import { AngularRenderer } from "igniteui-angular-core/ES2015/angular-renderer";
import { DataChartStylingDefaults } from './DataChartStylingDefaults';
import { ensureEnum } from "igniteui-angular-core/ES2015/componentUtil";
export const IgxLegendComponent_PROVIDERS = [{ provide: IgxLegendBaseComponent, useExisting: forwardRef(() => IgxLegendComponent) }];
/**
 * Represents a legend in a IgxDataChartComponent control.
*
* The `IgxLegendComponent` helps end-user identify visuals of chart series with contextual information related to the data plotted in the chart control.
*
* ```html
*  <igx-data-chart
*     [dataSource]="data"
* 	 [legend]="legend">
*     <igx-category-x-axis
*         label="label"
*         #xAxis>
*     </igx-category-x-axis>
*     <igx-numeric-y-axis
*         #yAxis>
*     </igx-numeric-y-axis>
*     <igx-line-series
*         [xAxis]="xAxis"
*         [yAxis]="yAxis"
*         valueMemberPath="value">
*     </igx-line-series>
* </igx-data-chart>
*  <igx-legend #legend></igx-legend>
* ```
*
* ```ts
* public legend : IgxLegendComponent;
* ```
*/
let IgxLegendComponent = IgxLegendComponent_1 = class IgxLegendComponent extends IgxLegendBaseComponent {
    constructor(renderer, elRef, ngZone) {
        super();
        this.renderer = renderer;
        this.elRef = elRef;
        this.ngZone = ngZone;
        this._zoneRunner = (act) => this.ngZone.run(act);
        this.container = renderer.createElement("div");
        renderer.appendChild(elRef.nativeElement, this.container);
        var root;
        root = this.container;
        if (this.container != null) {
            root = this.container;
        }
        var ren = new AngularRenderer(root, this.renderer, window.document, this.ngZone, true, DataChartStylingDefaults);
        this._wrapper = ren;
        this.i.provideContainer(ren);
    }
    ngOnDestroy() {
        this._wrapper.destroy();
        this.i.provideContainer(null);
    }
    createImplementation() {
        return new Legend();
    }
    get i() {
        return this._implementation;
    }
    /**
 * Gets or sets the current Legend object's orientation.
*/
    get orientation() {
        return this.i.bb;
    }
    set orientation(v) {
        this.i.bb = ensureEnum(LegendOrientation_$type, v);
    }
    /**
     * Gets or sets color of text
    */
    get textColor() {
        return this.i.bh;
    }
    set textColor(v) {
        this.i.bh = v;
    }
    /**
     * Gets or sets style of text.
    */
    get textStyle() {
        return this.i.bi;
    }
    set textStyle(v) {
        this.i.bi = v;
    }
};
tslib_1.__decorate([
    Input(),
    tslib_1.__metadata("design:type", Number),
    tslib_1.__metadata("design:paramtypes", [Number])
], IgxLegendComponent.prototype, "orientation", null);
tslib_1.__decorate([
    Input(),
    tslib_1.__metadata("design:type", String),
    tslib_1.__metadata("design:paramtypes", [String])
], IgxLegendComponent.prototype, "textColor", null);
tslib_1.__decorate([
    Input(),
    tslib_1.__metadata("design:type", String),
    tslib_1.__metadata("design:paramtypes", [String])
], IgxLegendComponent.prototype, "textStyle", null);
IgxLegendComponent = IgxLegendComponent_1 = tslib_1.__decorate([
    Component({
        selector: 'igx-legend',
        template: ``,
        providers: [{ provide: IgxLegendBaseComponent, useExisting: forwardRef(() => IgxLegendComponent_1) }],
        host: { 'class': 'ig-legend igx-legend' },
        changeDetection: ChangeDetectionStrategy.OnPush,
        styles: LegendBaseStyles
    }),
    tslib_1.__metadata("design:paramtypes", [Renderer2,
        ElementRef,
        NgZone])
], IgxLegendComponent);
export { IgxLegendComponent };
//# sourceMappingURL=igx-legend-component.js.map