import { __extends } 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";
/**
 * Represents one part of a StackedBarSeries.
*/
var IgrBarFragment = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(IgrBarFragment, _super);
    function IgrBarFragment(props) {
        return _super.call(this, props) || this;
    }
    IgrBarFragment.prototype.createImplementation = function () {
        return new BarFragment();
    };
    Object.defineProperty(IgrBarFragment.prototype, "i", {
        /**
                                     * @hidden
                                     */
        get: function () {
            return this._implementation;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrBarFragment.prototype, "isBar", {
        /**
         * Gets whether the current series shows a bar shape.
        */
        get: function () {
            return this.i.ex;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrBarFragment.prototype, "isMarkerlessDisplayPreferred", {
        /**
         * Overridden by derived series classes to indicate when marker-less display is preferred or not.
        */
        get: function () {
            return this.i.fl;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrBarFragment.prototype, "isColumn", {
        /**
         * Gets whether the current series shows a column shape.
        */
        get: function () {
            return this.i.ez;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrBarFragment.prototype, "barFragmentXAxis", {
        /**
         * The X-Axis for this BarFragment.
        */
        get: function () {
            var r = this.i.barFragmentXAxis;
            if (r == null) {
                return null;
            }
            if (!r.externalObject) {
                var e = IgrNumericXAxis._createFromInternal(r);
                if (e) {
                    e._implementation = r;
                }
                r.externalObject = e;
            }
            return r.externalObject;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrBarFragment.prototype, "barFragmentYAxis", {
        /**
         * The Y-Axis for this BarFragment.
        */
        get: function () {
            var r = this.i.barFragmentYAxis;
            if (r == null) {
                return null;
            }
            if (!r.externalObject) {
                var e = IgrCategoryYAxis._createFromInternal(r);
                if (e) {
                    e._implementation = r;
                }
                r.externalObject = e;
            }
            return r.externalObject;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrBarFragment.prototype, "isVertical", {
        get: function () {
            return this.i.isVertical;
        },
        enumerable: false,
        configurable: true
    });
    IgrBarFragment.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.
    */
    IgrBarFragment.prototype.getExactItemIndex = function (world) {
        var iv = this.i.ir(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.wl(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.kn(toPoint(world));
        return (iv);
    };
    return IgrBarFragment;
}(IgrColumnFragment));
export { IgrBarFragment };
