import * as tslib_1 from "tslib";
import { Component, forwardRef, ChangeDetectionStrategy } from '@angular/core';
import { IgxNumericXAxisComponent } from "./igx-numeric-x-axis-component";
import { IgxCategoryYAxisComponent } from "./igx-category-y-axis-component";
import { IgxColumnFragmentComponent } from "./igx-column-fragment-component";
import { IgxFragmentBaseComponent } from "./igx-fragment-base-component";
import { IgxHorizontalAnchoredCategorySeriesComponent } from "./igx-horizontal-anchored-category-series-component";
import { IgxAnchoredCategorySeriesComponent } from "./igx-anchored-category-series-component";
import { IgxCategorySeriesComponent } from "./igx-category-series-component";
import { IgxMarkerSeriesComponent } from "./igx-marker-series-component";
import { IgxSeriesComponent } from "./igx-series-component";
import { BarFragment } from "./BarFragment";
import { toPoint, fromRect } from "igniteui-angular-core";
/**
 * Represents one part of a StackedBarSeries.
*/
export var IgxBarFragmentComponent_PROVIDERS = [{ provide: IgxColumnFragmentComponent, useExisting: forwardRef(function () { return IgxBarFragmentComponent; }) }, { provide: IgxFragmentBaseComponent, useExisting: forwardRef(function () { return IgxBarFragmentComponent; }) }, { provide: IgxHorizontalAnchoredCategorySeriesComponent, useExisting: forwardRef(function () { return IgxBarFragmentComponent; }) }, { provide: IgxAnchoredCategorySeriesComponent, useExisting: forwardRef(function () { return IgxBarFragmentComponent; }) }, { provide: IgxCategorySeriesComponent, useExisting: forwardRef(function () { return IgxBarFragmentComponent; }) }, { provide: IgxMarkerSeriesComponent, useExisting: forwardRef(function () { return IgxBarFragmentComponent; }) }, { provide: IgxSeriesComponent, useExisting: forwardRef(function () { return IgxBarFragmentComponent; }) }];
var IgxBarFragmentComponent = /** @class */ (function (_super) {
    tslib_1.__extends(IgxBarFragmentComponent, _super);
    function IgxBarFragmentComponent() {
        return _super.call(this) || this;
    }
    IgxBarFragmentComponent_1 = IgxBarFragmentComponent;
    IgxBarFragmentComponent.prototype.createImplementation = function () {
        return new BarFragment();
    };
    Object.defineProperty(IgxBarFragmentComponent.prototype, "i", {
        /**
                                     * @hidden
                                     */
        get: function () {
            return this._implementation;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgxBarFragmentComponent.prototype, "barFragmentXAxis", {
        /**
         * The X-Axis for this BarFragment.
        */
        get: function () {
            if (this.i.barFragmentXAxis == null) {
                return null;
            }
            if (!this.i.barFragmentXAxis.externalObject) {
                var e = IgxNumericXAxisComponent._createFromInternal(this.i.barFragmentXAxis);
                if (e) {
                    e._implementation = this.i.barFragmentXAxis;
                }
                this.i.barFragmentXAxis.externalObject = e;
            }
            return this.i.barFragmentXAxis.externalObject;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgxBarFragmentComponent.prototype, "barFragmentYAxis", {
        /**
         * The Y-Axis for this BarFragment.
        */
        get: function () {
            if (this.i.barFragmentYAxis == null) {
                return null;
            }
            if (!this.i.barFragmentYAxis.externalObject) {
                var e = IgxCategoryYAxisComponent._createFromInternal(this.i.barFragmentYAxis);
                if (e) {
                    e._implementation = this.i.barFragmentYAxis;
                }
                this.i.barFragmentYAxis.externalObject = e;
            }
            return this.i.barFragmentYAxis.externalObject;
        },
        enumerable: true,
        configurable: true
    });
    IgxBarFragmentComponent.prototype._styling = function (container, component, parent) {
        _super.prototype._styling.call(this, container, component, parent);
        this._inStyling = true;
        if (this.barFragmentXAxis && this.barFragmentXAxis._styling) {
            this.barFragmentXAxis._styling(container, component, this);
        }
        if (this.barFragmentYAxis && this.barFragmentYAxis._styling) {
            this.barFragmentYAxis._styling(container, component, this);
        }
        this._inStyling = false;
    };
    /**
     * Gets the precise item index, if possible, based on the closeness to the previous or next whole integer. If the series cannot provide this information, GetExactItemIndex will return the same integer value as GetItemIndex.
    
    * @param world  * The world position for which to return the index.
    */
    IgxBarFragmentComponent.prototype.getExactItemIndex = function (world) {
        var iv = this.i.eb(toPoint(world));
        return (iv);
    };
    /**
     * If possible, will return the best available value bounding box within the series that has the best value match for the world position provided.
    
    * @param world  * The world coordinate for which to get a value bounding box for
    */
    IgxBarFragmentComponent.prototype.getSeriesValueBoundingBox = function (world) {
        var iv = this.i.lu(toPoint(world));
        return fromRect(iv);
    };
    /**
     * Gets the item that is the best match for the specified world coordinates.
    
    * @param world  * The world coordinates to use.
    */
    IgxBarFragmentComponent.prototype.getItem = function (world) {
        var iv = this.i.fp(toPoint(world));
        return (iv);
    };
    var IgxBarFragmentComponent_1;
    IgxBarFragmentComponent = IgxBarFragmentComponent_1 = tslib_1.__decorate([
        Component({
            selector: 'igx-bar-fragment',
            template: "",
            providers: [{ provide: IgxColumnFragmentComponent, useExisting: forwardRef(function () { return IgxBarFragmentComponent_1; }) }, { provide: IgxFragmentBaseComponent, useExisting: forwardRef(function () { return IgxBarFragmentComponent_1; }) }, { provide: IgxHorizontalAnchoredCategorySeriesComponent, useExisting: forwardRef(function () { return IgxBarFragmentComponent_1; }) }, { provide: IgxAnchoredCategorySeriesComponent, useExisting: forwardRef(function () { return IgxBarFragmentComponent_1; }) }, { provide: IgxCategorySeriesComponent, useExisting: forwardRef(function () { return IgxBarFragmentComponent_1; }) }, { provide: IgxMarkerSeriesComponent, useExisting: forwardRef(function () { return IgxBarFragmentComponent_1; }) }, { provide: IgxSeriesComponent, useExisting: forwardRef(function () { return IgxBarFragmentComponent_1; }) }],
            changeDetection: ChangeDetectionStrategy.OnPush
        }),
        tslib_1.__metadata("design:paramtypes", [])
    ], IgxBarFragmentComponent);
    return IgxBarFragmentComponent;
}(IgxColumnFragmentComponent));
export { IgxBarFragmentComponent };
//# sourceMappingURL=igx-bar-fragment-component.js.map