UNPKG

@progress/kendo-vue-layout

Version:
102 lines (101 loc) 2.42 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 h, h as p, createVNode as i } from "vue"; import { packageMetadata as b } from "../package-metadata.mjs"; import { getTemplate as u, Icon as x, validatePackage as k } from "@progress/kendo-vue-common"; const y = /* @__PURE__ */ h({ name: "KendoBottomNavigationItem", emits: { keydown: null, select: null }, props: { id: String, disabled: Boolean, selected: Boolean, icon: String, item: [String, Object, Function], text: String, dataItem: Object, index: Number, tabIndex: { type: Number, default: 0 } }, created() { k(b); }, computed: { itemClasses() { const { selected: e, disabled: t } = this.$props; return { "k-bottom-nav-item": !0, "k-selected": e, "k-disabled": t }; } }, render() { const { selected: e, disabled: t, item: d, dataItem: n, id: l, index: m, tabIndex: c } = this.$props, { icon: o, text: a, svgIcon: s } = n, r = u.call(this, { h: p, template: d, defaultRendering: null, additionalProps: { itemIndex: m, item: n } }); return i("span", { class: this.itemClasses, role: "link", id: l, tabindex: c, onClick: this.handleClick, onKeydown: this.handleKeyDown, "aria-current": e, "aria-disabled": t }, [this.$props.item ? r : [(s || o) && i(x, { name: o, icon: s, size: "xlarge", class: "k-bottom-nav-item-icon" }, null), a && i("span", { class: "k-bottom-nav-item-text", style: { userSelect: "none" } }, [a])]]); }, methods: { handleClick(e) { this.index !== void 0 && !this.disabled && this.$emit("select", e, this.index); }, handleKeyDown(e) { this.index !== void 0 && !this.disabled && this.$emit("keydown", e, this.index); } } }); export { y as BottomNavigationItem };