UNPKG

@progress/kendo-vue-common

Version:

Kendo UI for Vue Common Utilities package

90 lines (89 loc) 2.08 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 C, h as s } from "vue"; import { FontIcon as u } from "./FontIcon.mjs"; import { SvgIcon as b } from "./SvgIcon.mjs"; const w = /* @__PURE__ */ C({ 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 }, render() { const { name: n, icon: e, themeColor: c, size: r, flip: d, id: l, viewBox: m, tabIndex: h, title: p, ariaLabel: a, role: I } = this.$props, o = n && this.kendoIcons && this.kendoIcons.icons && this.kendoIcons.icons[n] || e, k = this.kendoIcons && this.kendoIcons.type === "svg" && o !== void 0, f = this.kendoIcons && this.kendoIcons.size ? this.kendoIcons.size : r, g = this.kendoIcons && this.kendoIcons.flip ? this.kendoIcons.flip : d, i = n || (e && e.name ? e.name : void 0), t = { themeColor: c, size: f, flip: g, id: l, tabIndex: h, title: p, ariaLabel: a, role: I }, S = s(u, { ...t, name: i, onClick: this.handleClick }), v = s(b, { ...t, icon: o, viewBox: m, name: i, onClick: this.handleClick }); return k ? v : S; }, methods: { handleClick(n) { this.$emit("click", n); } } }); export { w as Icon };