@progress/kendo-vue-grid
Version:
87 lines (86 loc) • 2.06 kB
JavaScript
/**
* @license
*-------------------------------------------------------------------------------------------
* Copyright © 2025 Progress Software Corporation. All rights reserved.
* Licensed under commercial license. See LICENSE.md in the package root for more information
*-------------------------------------------------------------------------------------------
*/
import { defineComponent as o, createVNode as n } from "vue";
import { noop as e, getDefaultSlots as a } from "@progress/kendo-vue-common";
const d = /* @__PURE__ */ o({
name: "KendoGridNav",
props: {
currentData: Array
},
inject: {
onNavKeyDown: {
default: e
},
onNavFocus: {
default: e
},
onNavMount: {
default: e
},
handleDispatchFocus: {
default: e
},
kbContext: {
default: null
},
navigation: {
default: null
}
},
mounted() {
this.onNavMount({
scope: this.$el || void 0
});
},
updated() {
this.onNavMount({
scope: this.$el || void 0
});
},
methods: {
onKeyDown(t) {
this.onNavKeyDown(t, {
navigation: this.navigation,
kbContext: this.kbContext,
onNavigationAction: this.onNavigationAction
}), this.$emit("keydown", {
dataItems: this.getLeafDataItems(),
// mode,
// cell,
componentId: this._gridId,
selectedField: this.$props.selectedField,
event: t
});
},
onFocus(t) {
this.onNavFocus(t, {
kbContext: this.kbContext
});
},
onNavigationAction(t) {
this.$emit("navigationaction", {
focusElement: t.focusElement,
event: t.event
});
},
getLeafDataItems() {
return this.$props.currentData.filter((t) => t.rowType === "data").map((t) => t.dataItem);
}
},
render() {
const t = a(this);
return n("div", {
onKeydown: this.onKeyDown,
onFocusin: this.onFocus,
"data-keyboardnavscope": !0
}, [t]);
}
});
export {
d as GridNav
};