/**
 * DevExtreme (esm/renovation/ui/grids/data_grid_next/scrolling/scrolling.js)
 * Version: 22.1.3 (build 22180-0310)
 * Build date: Wed Jun 29 2022
 *
 * Copyright (c) 2012 - 2022 Developer Express Inc. ALL RIGHTS RESERVED
 * Read about DevExtreme licensing here: https://js.devexpress.com/Licensing/
 */
import _extends from "@babel/runtime/helpers/esm/extends";
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
var _excluded = ["mode"];
import {
    createFragment,
    createComponentVNode
} from "inferno";
import {
    Fragment
} from "inferno";
import {
    BaseInfernoComponent
} from "@devextreme/runtime/inferno";
import {
    ValueSetter
} from "../../../../utils/plugin/value_setter";
import {
    VirtualScrolling
} from "./virtual_scrolling";
import {
    ScrollingModeValue
} from "./plugins";
export var viewFunction = _ref => {
    var {
        isVirtualScrolling: isVirtualScrolling,
        props: {
            mode: mode
        },
        virtualScrollingMode: virtualScrollingMode
    } = _ref;
    return createFragment([createComponentVNode(2, ValueSetter, {
        type: ScrollingModeValue,
        value: mode
    }), isVirtualScrolling && createComponentVNode(2, VirtualScrolling, {
        mode: virtualScrollingMode
    })], 0)
};
export var DataGridNextScrollingProps = {
    mode: "standard"
};
export class DataGridNextScrolling extends BaseInfernoComponent {
    constructor(props) {
        super(props);
        this.state = {}
    }
    get isVirtualScrolling() {
        var {
            mode: mode
        } = this.props;
        return "standard" !== mode
    }
    get virtualScrollingMode() {
        return "virtual" === this.props.mode ? "virtual" : "infinite"
    }
    get restAttributes() {
        var _this$props = this.props,
            restProps = _objectWithoutPropertiesLoose(_this$props, _excluded);
        return restProps
    }
    render() {
        var props = this.props;
        return viewFunction({
            props: _extends({}, props),
            isVirtualScrolling: this.isVirtualScrolling,
            virtualScrollingMode: this.virtualScrollingMode,
            restAttributes: this.restAttributes
        })
    }
}
DataGridNextScrolling.defaultProps = DataGridNextScrollingProps;
