@progress/kendo-vue-common
Version:
Kendo UI for Vue Common Utilities package
98 lines (97 loc) • 2.2 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 g, h as m, createVNode as h } from "vue";
import { SIZE_CLASSES as S } from "./constants.mjs";
import { getDefaultSlots as v } from "../defaultSlots.mjs";
const k = /* @__PURE__ */ g({
name: "KendoSvgIcon",
emits: {
click: null
},
props: {
name: String,
icon: Object,
themeColor: {
type: String
},
size: {
type: String
},
flip: {
type: String
},
id: String,
ariaLabel: String,
title: String,
viewBox: {
type: String,
default: "0 0 24 24"
},
tabIndex: Number,
svgClassName: String,
svgStyle: Object
},
computed: {
wrapperClass() {
const {
name: e,
flip: i,
size: t,
themeColor: n
} = this.$props;
return {
"k-icon": !0,
"k-svg-icon": !0,
["k-color-" + n]: n,
["k-svg-i-" + e]: e,
"k-flip-h": i === "horizontal" || i === "both",
"k-flip-v": i === "vertical" || i === "both",
[S[t]]: t
};
}
},
render() {
const e = v(this), {
svgClassName: i,
icon: t,
id: n,
tabIndex: o,
svgStyle: r,
viewBox: s,
title: a,
ariaLabel: l
} = this.$props, c = t ? t.content : void 0, p = {
id: n,
title: a,
"aria-hidden": !0,
tabIndex: o,
ariaLabel: l,
focusable: "false",
xmlns: "http://www.w3.org/2000/svg",
viewBox: t ? t.viewBox : s
}, d = m("svg", {
...p,
innerHTML: c,
class: i,
style: r
}, t ? [] : [e]);
return h("span", {
class: this.wrapperClass,
onClick: this.handleClick,
"aria-hidden": !0
}, [d]);
},
methods: {
handleClick(e) {
this.$emit("click", e);
}
}
});
export {
k as SvgIcon
};