UNPKG

@progress/kendo-vue-data-tools

Version:
97 lines (96 loc) 2.36 kB
/** * @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 m, createVNode as S, inject as n } from "vue"; import { noop as b, getDefaultSlots as h } from "@progress/kendo-vue-common"; import { KEYBOARD_NAV_DATA_ID as g, KEYBOARD_NAV_DATA_LEVEL as v } from "../navigation/constants.mjs"; const N = /* @__PURE__ */ m({ name: "KendoHeaderThElement", emits: { keydown: null }, props: { ariaSort: { type: String, validator: function(e) { return ["none", "ascending", "descending"].includes(e); } }, ariaLabel: String, ariaColumnIndex: Number, ariaSelected: Boolean, ariaHaspopup: String, colSpan: Number, rowSpan: Number, role: String, columnId: String, navigatable: Boolean }, computed: { thClass() { const { className: e } = this.$props; return { "k-table-th": !0, [e]: e }; } }, inject: { getKeyboardNavigationAttributes: { default: b } }, setup() { const e = n("kendoIntlService", {}), a = n("kendoLocalizationService", {}); return { kendoIntlService: e, kendoLocalizationService: a }; }, render() { const { ariaSort: e, colSpan: a, rowSpan: o, columnId: r, navigatable: i, ariaColumnIndex: l, ariaLabel: s, ariaHaspopup: d, role: c, ariaSelected: p } = this.$props, t = this.getKeyboardNavigationAttributes(r, i), u = h(this); return S("th", { style: { top: "0px" }, "aria-sort": e, "aria-label": s, "aria-colindex": l, "aria-selected": p, "aria-haspopup": d, colspan: a, rowspan: o, class: this.thClass, onKeydown: this.onKeyDown, role: c, tabindex: t.tabIndex, "data-keyboardnavlevel": t[v], "data-keyboardnavid": t[g] }, [u]); }, methods: { onKeyDown(e) { this.$emit("keydown", e); } } }); export { N as HeaderThElement };