import * as tslib_1 from "tslib";
import { IgrNumericXAxis } from "./igr-numeric-x-axis";
import { IgrCategoryYAxis } from "./igr-category-y-axis";
import { IgrColumnFragment } from "./igr-column-fragment";
import { BarFragment } from "./BarFragment";
import { toPoint, fromRect } from "igniteui-react-core/ES5/componentUtil";
/**
 * Represents one part of a StackedBarSeries.
*/
var IgrBarFragment = /** @class */ (function (_super) {
    tslib_1.__extends(IgrBarFragment, _super);
    function IgrBarFragment(props) {
        return _super.call(this, props) || this;
    }
    IgrBarFragment.prototype.createImplementation = function () {
        return new BarFragment();
    };
    Object.defineProperty(IgrBarFragment.prototype, "i", {
        get: function () {
            return this._implementation;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrBarFragment.prototype, "barFragmentXAxis", {
        /**
         * The X-Axis for this BarFragment.
        */
        get: function () {
            if (this.i.barFragmentXAxis == null) {
                return null;
            }
            if (!this.i.barFragmentXAxis.externalObject) {
                var e = new IgrNumericXAxis(null);
                e._implementation = this.i.barFragmentXAxis;
                this.i.barFragmentXAxis.externalObject = e;
            }
            return this.i.barFragmentXAxis.externalObject;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrBarFragment.prototype, "barFragmentYAxis", {
        /**
         * The Y-Axis for this BarFragment.
        */
        get: function () {
            if (this.i.barFragmentYAxis == null) {
                return null;
            }
            if (!this.i.barFragmentYAxis.externalObject) {
                var e = new IgrCategoryYAxis(null);
                e._implementation = this.i.barFragmentYAxis;
                this.i.barFragmentYAxis.externalObject = e;
            }
            return this.i.barFragmentYAxis.externalObject;
        },
        enumerable: true,
        configurable: true
    });
    /**
     * 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.
    */
    IgrBarFragment.prototype.getExactItemIndex = function (world) {
        var iv = this.i.d8(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
    */
    IgrBarFragment.prototype.getSeriesValueBoundingBox = function (world) {
        var iv = this.i.ln(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.
    */
    IgrBarFragment.prototype.getItem = function (world) {
        var iv = this.i.fm(toPoint(world));
        return (iv);
    };
    return IgrBarFragment;
}(IgrColumnFragment));
export { IgrBarFragment };
