import * as tslib_1 from "tslib";
import { Component, Renderer2, ElementRef, forwardRef, NgZone, ChangeDetectionStrategy } from '@angular/core';
import { IgxLegendBaseComponent, LegendBaseStyles } from './igx-legend-base-component';
import { ItemLegend } from "./ItemLegend";
import { AngularRenderer } from "igniteui-angular-core/ES5/angular-renderer";
import { DataChartStylingDefaults } from './DataChartStylingDefaults';
export var IgxItemLegendComponent_PROVIDERS = [{ provide: IgxLegendBaseComponent, useExisting: forwardRef(function () { return IgxItemLegendComponent; }) }];
/**
 * Represents a legend that displays an item for each point in the series.
*
* You can use the `IgxItemLegendComponent` to display a legend item for each data member bound to the `IgxBubbleSeriesComponent`
*/
var IgxItemLegendComponent = /** @class */ (function (_super) {
    tslib_1.__extends(IgxItemLegendComponent, _super);
    function IgxItemLegendComponent(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;
    }
    IgxItemLegendComponent_1 = IgxItemLegendComponent;
    IgxItemLegendComponent.prototype.ngOnDestroy = function () {
        this._wrapper.destroy();
    };
    IgxItemLegendComponent.prototype.createImplementation = function () {
        return new ItemLegend();
    };
    Object.defineProperty(IgxItemLegendComponent.prototype, "i", {
        get: function () {
            return this._implementation;
        },
        enumerable: true,
        configurable: true
    });
    IgxItemLegendComponent.prototype.createItemwiseLegendItems = function (legendItems, series) {
        this.i.createItemwiseLegendItems(legendItems, series);
    };
    IgxItemLegendComponent.prototype.exportVisualData = function () {
        return this.i.exportVisualData();
    };
    IgxItemLegendComponent.prototype.exportSerializedVisualData = function () {
        return this.i.exportSerializedVisualData();
    };
    Object.defineProperty(IgxItemLegendComponent.prototype, "isItemwise", {
        /**
     * Gets whether or not this legend supports itemwise visuals
    */
        get: function () {
            return this.i.isItemwise;
        },
        enumerable: true,
        configurable: true
    });
    var IgxItemLegendComponent_1;
    IgxItemLegendComponent = IgxItemLegendComponent_1 = tslib_1.__decorate([
        Component({
            selector: 'igx-item-legend',
            template: "",
            host: { 'class': 'ig-item-legend igx-item-legend' },
            providers: [{ provide: IgxLegendBaseComponent, useExisting: forwardRef(function () { return IgxItemLegendComponent_1; }) }],
            changeDetection: ChangeDetectionStrategy.OnPush,
            styles: LegendBaseStyles
        }),
        tslib_1.__metadata("design:paramtypes", [Renderer2,
            ElementRef,
            NgZone])
    ], IgxItemLegendComponent);
    return IgxItemLegendComponent;
}(IgxLegendBaseComponent));
export { IgxItemLegendComponent };
//# sourceMappingURL=igx-item-legend-component.js.map