UNPKG

devextreme

Version:

HTML5 JavaScript Component Suite for Responsive Web Development

39 lines (38 loc) 1.5 kB
/** * DevExtreme (esm/__internal/grids/tree_list/module_keyboard_navigation.js) * Version: 22.1.9 * Build date: Tue Apr 18 2023 * * Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED * Read about DevExtreme licensing here: https://js.devexpress.com/Licensing/ */ import { extend } from "../../../core/utils/extend"; import { keyboardNavigationModule } from "../../../ui/grid_core/ui.grid_core.keyboard_navigation"; import core from "./module_core"; core.registerModule("keyboardNavigation", extend(true, {}, keyboardNavigationModule, { extenders: { controllers: { keyboardNavigation: { _leftRightKeysHandler(eventArgs, isEditing) { const rowIndex = this.getVisibleRowIndex(); const dataController = this._dataController; if (eventArgs.ctrl) { const directionCode = this._getDirectionCodeByKey(eventArgs.keyName); const key = dataController.getKeyByRowIndex(rowIndex); if ("nextInRow" === directionCode) { dataController.expandRow(key) } else { dataController.collapseRow(key) } } else { return this.callBase.apply(this, arguments) } } } } } }));