import { delegateCombine, delegateRemove } from "igniteui-webcomponents-core";
import { IgcResponsiveStateEnteringEventArgs } from "./igc-responsive-state-entering-event-args";
import { IgcResponsiveStateEnteredEventArgs } from "./igc-responsive-state-entered-event-args";
import { IgcResponsiveStateExitedEventArgs } from "./igc-responsive-state-exited-event-args";
import { ResponsiveState as ResponsiveState_internal } from "./ResponsiveState";
import { ensureBool } from "igniteui-webcomponents-core";
/**
 * Describes a state that the grid can enter based on a set of responsive conditions.
*/
var IgcResponsiveState = /** @class */ /*@__PURE__*/ (function () {
    function IgcResponsiveState() {
        this._stateEntering = null;
        this._stateEntering_wrapped = null;
        this._stateEntered = null;
        this._stateEntered_wrapped = null;
        this._stateExited = null;
        this._stateExited_wrapped = null;
        this._implementation = this.createImplementation();
        this._implementation.externalObject = this;
        this.onImplementationCreated();
    }
    IgcResponsiveState.prototype.createImplementation = function () {
        return new ResponsiveState_internal();
    };
    Object.defineProperty(IgcResponsiveState.prototype, "i", {
        /**
         * @hidden
         */
        get: function () {
            return this._implementation;
        },
        enumerable: true,
        configurable: true
    });
    IgcResponsiveState.prototype.onImplementationCreated = function () {
    };
    IgcResponsiveState.prototype._provideImplementation = function (i) {
        this._implementation = i;
        this._implementation.externalObject = this;
        this.onImplementationCreated();
    };
    Object.defineProperty(IgcResponsiveState.prototype, "name", {
        /**
         * The name of the responsive state
        */
        get: function () {
            return this.i.n;
        },
        set: function (v) {
            this.i.n = v;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgcResponsiveState.prototype, "minimumWidth", {
        /**
         * Gets or sets the minimum width for which this state is active.
        */
        get: function () {
            return this.i.k;
        },
        set: function (v) {
            this.i.k = +v;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgcResponsiveState.prototype, "maximumWidth", {
        /**
         * Gets or sets the maximum width for which this state is active.
        */
        get: function () {
            return this.i.j;
        },
        set: function (v) {
            this.i.j = +v;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgcResponsiveState.prototype, "isManualState", {
        /**
         * Configures this responsive state to only be manually actived
        */
        get: function () {
            return this.i.i;
        },
        set: function (v) {
            this.i.i = ensureBool(v);
        },
        enumerable: true,
        configurable: true
    });
    IgcResponsiveState.prototype.findByName = function (name) {
        return null;
    };
    /**
     * Adds a responsive phase to the state.
    
    * @param phase  * The phase to add.
    */
    IgcResponsiveState.prototype.addResponsivePhase = function (phase) {
        var iv = this.i.d((phase == null ? null : phase.i));
        return (iv == null ? null : iv.externalObject);
    };
    /**
     * Adds a responsive phase to the state and returns it.
    
    */
    IgcResponsiveState.prototype.responsivePhase = function () {
        var iv = this.i.a();
        return (iv == null ? null : iv.externalObject);
    };
    Object.defineProperty(IgcResponsiveState.prototype, "stateEntering", {
        /**
         * Called when a state is being entered.
        */
        get: function () {
            return this._stateEntering;
        },
        set: function (ev) {
            var _this = this;
            if (this._stateEntering_wrapped !== null) {
                this.i.stateEntering = delegateRemove(this.i.stateEntering, this._stateEntering_wrapped);
                this._stateEntering_wrapped = null;
                this._stateEntering = null;
            }
            this._stateEntering = ev;
            this._stateEntering_wrapped = function (o, e) {
                var outerArgs = new IgcResponsiveStateEnteringEventArgs();
                outerArgs._provideImplementation(e);
                if (_this.beforeStateEntering) {
                    _this.beforeStateEntering(_this, outerArgs);
                }
                if (_this._stateEntering) {
                    _this._stateEntering(_this, outerArgs);
                }
            };
            this.i.stateEntering = delegateCombine(this.i.stateEntering, this._stateEntering_wrapped);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgcResponsiveState.prototype, "stateEntered", {
        /**
         * Called when a state is entered.
        */
        get: function () {
            return this._stateEntered;
        },
        set: function (ev) {
            var _this = this;
            if (this._stateEntered_wrapped !== null) {
                this.i.stateEntered = delegateRemove(this.i.stateEntered, this._stateEntered_wrapped);
                this._stateEntered_wrapped = null;
                this._stateEntered = null;
            }
            this._stateEntered = ev;
            this._stateEntered_wrapped = function (o, e) {
                var outerArgs = new IgcResponsiveStateEnteredEventArgs();
                outerArgs._provideImplementation(e);
                if (_this.beforeStateEntered) {
                    _this.beforeStateEntered(_this, outerArgs);
                }
                if (_this._stateEntered) {
                    _this._stateEntered(_this, outerArgs);
                }
            };
            this.i.stateEntered = delegateCombine(this.i.stateEntered, this._stateEntered_wrapped);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgcResponsiveState.prototype, "stateExited", {
        /**
         * Called when a state is exited.
        */
        get: function () {
            return this._stateExited;
        },
        set: function (ev) {
            var _this = this;
            if (this._stateExited_wrapped !== null) {
                this.i.stateExited = delegateRemove(this.i.stateExited, this._stateExited_wrapped);
                this._stateExited_wrapped = null;
                this._stateExited = null;
            }
            this._stateExited = ev;
            this._stateExited_wrapped = function (o, e) {
                var outerArgs = new IgcResponsiveStateExitedEventArgs();
                outerArgs._provideImplementation(e);
                if (_this.beforeStateExited) {
                    _this.beforeStateExited(_this, outerArgs);
                }
                if (_this._stateExited) {
                    _this._stateExited(_this, outerArgs);
                }
            };
            this.i.stateExited = delegateCombine(this.i.stateExited, this._stateExited_wrapped);
        },
        enumerable: true,
        configurable: true
    });
    return IgcResponsiveState;
}());
export { IgcResponsiveState };
//# sourceMappingURL=igc-responsive-state.js.map
