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