import * as tslib_1 from "tslib";
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/ES5/angular-renderer";
import { DataChartStylingDefaults } from './DataChartStylingDefaults';
import { ensureEnum } from "igniteui-angular-core/ES5/componentUtil";
export var IgxLegendComponent_PROVIDERS = [{ provide: IgxLegendBaseComponent, useExisting: forwardRef(function () { return 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;
* ```
*/
var IgxLegendComponent = /** @class */ (function (_super) {
    tslib_1.__extends(IgxLegendComponent, _super);
    function IgxLegendComponent(renderer, elRef, ngZone) {
        var _this = _super.call(this) || this;
        _this.renderer = renderer;
        _this.elRef = elRef;
        _this.ngZone = ngZone;
        _this._zoneRunner = function (act) { return _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);
        return _this;
    }
    IgxLegendComponent_1 = IgxLegendComponent;
    IgxLegendComponent.prototype.ngOnDestroy = function () {
        this._wrapper.destroy();
        this.i.provideContainer(null);
    };
    IgxLegendComponent.prototype.createImplementation = function () {
        return new Legend();
    };
    Object.defineProperty(IgxLegendComponent.prototype, "i", {
        get: function () {
            return this._implementation;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgxLegendComponent.prototype, "orientation", {
        /**
     * Gets or sets the current Legend object's orientation.
    */
        get: function () {
            return this.i.bb;
        },
        set: function (v) {
            this.i.bb = ensureEnum(LegendOrientation_$type, v);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgxLegendComponent.prototype, "textColor", {
        /**
         * Gets or sets color of text
        */
        get: function () {
            return this.i.bh;
        },
        set: function (v) {
            this.i.bh = v;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgxLegendComponent.prototype, "textStyle", {
        /**
         * Gets or sets style of text.
        */
        get: function () {
            return this.i.bi;
        },
        set: function (v) {
            this.i.bi = v;
        },
        enumerable: true,
        configurable: true
    });
    var IgxLegendComponent_1;
    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(function () { return IgxLegendComponent_1; }) }],
            host: { 'class': 'ig-legend igx-legend' },
            changeDetection: ChangeDetectionStrategy.OnPush,
            styles: LegendBaseStyles
        }),
        tslib_1.__metadata("design:paramtypes", [Renderer2,
            ElementRef,
            NgZone])
    ], IgxLegendComponent);
    return IgxLegendComponent;
}(IgxLegendBaseComponent));
export { IgxLegendComponent };
//# sourceMappingURL=igx-legend-component.js.map