"use strict";
Object.defineProperty(exports, "__esModule", {
    value: true
});
Object.defineProperty(exports, "createMenuNavigator", {
    enumerable: true,
    get: function() {
        return createMenuNavigator;
    }
});
const _paginator = require("../../../utils/paginator");
const _utils = require("./utils");
function createMenuNavigator(hotMenu) {
    return (0, _paginator.createPaginator)({
        size: ()=>hotMenu.countRows(),
        onItemSelect (currentItem, directItemChange) {
            const cell = hotMenu.getCell(currentItem, 0);
            if (!cell || (0, _utils.isSeparator)(cell) || (0, _utils.isDisabled)(cell) || (0, _utils.isSelectionDisabled)(cell)) {
                return false;
            }
            hotMenu.selectCell(currentItem, 0, ...directItemChange ? [
                currentItem,
                0,
                false,
                false
            ] : []);
        },
        onClear () {
            hotMenu.deselectCell();
        }
    });
}
