UNPKG

@progress/kendo-vue-common

Version:

Kendo UI for Vue Common Utilities package

93 lines (92 loc) 2.14 kB
/** * @license *------------------------------------------------------------------------------------------- * Copyright © 2026 Progress Software Corporation. All rights reserved. * Licensed under commercial license. See LICENSE.md in the package root for more information *------------------------------------------------------------------------------------------- */ import { defineComponent as u, h as s } from "vue"; import { FontIcon as b } from "./FontIcon.mjs"; import { SvgIcon as y } from "./SvgIcon.mjs"; const j = /* @__PURE__ */ u({ name: "KendoIcon", emits: { click: null }, inject: { kendoIcons: { default: { type: "svg", icons: {} } } }, props: { name: String, icon: Object, title: String, themeColor: { type: String }, size: { type: String }, flip: { type: String }, id: String, ariaLabel: String, viewBox: { type: String, default: "0 0 24 24" }, tabIndex: Number, role: String, variant: String }, render() { const { name: n, icon: e, themeColor: c, size: r, flip: d, id: l, viewBox: a, tabIndex: m, title: h, ariaLabel: p, role: I, variant: k } = this.$props, o = n && this.kendoIcons && this.kendoIcons.icons && this.kendoIcons.icons[n] || e, g = this.kendoIcons && this.kendoIcons.type === "svg" && o !== void 0, f = this.kendoIcons && this.kendoIcons.size ? this.kendoIcons.size : r, S = this.kendoIcons && this.kendoIcons.flip ? this.kendoIcons.flip : d, i = n || (e && e.name ? e.name : void 0), t = { themeColor: c, size: f, flip: S, id: l, tabIndex: m, title: h, ariaLabel: p, role: I }, v = s(b, { ...t, name: i, onClick: this.handleClick }), C = s(y, { ...t, icon: o, viewBox: a, name: i, variant: k, onClick: this.handleClick }); return g ? C : v; }, methods: { handleClick(n) { this.$emit("click", n); } } }); export { j as Icon };