100 lines
3.1 KiB
JavaScript
100 lines
3.1 KiB
JavaScript
import { Dt as mergeProps, U as computed, W as createBaseVNode, ar as normalizeClass, er as toValue, et as createVNode, xt as inject } from "./vue.runtime.esm-bundler-BvoXUmaf.js";
|
|
import { it as consoleWarn, l as propsFactory, n as genericComponent, t as defineComponent } from "./defineComponent-DB6xIcDy.js";
|
|
//#region node_modules/vuetify/lib/composables/icons.js
|
|
var IconValue = [
|
|
String,
|
|
Function,
|
|
Object,
|
|
Array
|
|
];
|
|
var IconSymbol = Symbol.for("vuetify:icons");
|
|
var makeIconProps = propsFactory({
|
|
icon: { type: IconValue },
|
|
tag: {
|
|
type: [
|
|
String,
|
|
Object,
|
|
Function
|
|
],
|
|
required: true
|
|
}
|
|
}, "icon");
|
|
var VComponentIcon = genericComponent()({
|
|
name: "VComponentIcon",
|
|
props: makeIconProps(),
|
|
setup(props, { slots }) {
|
|
return () => {
|
|
const Icon = props.icon;
|
|
return createVNode(props.tag, null, { default: () => [props.icon ? createVNode(Icon, null, null) : slots.default?.()] });
|
|
};
|
|
}
|
|
});
|
|
var VSvgIcon = defineComponent({
|
|
name: "VSvgIcon",
|
|
inheritAttrs: false,
|
|
props: makeIconProps(),
|
|
setup(props, { attrs }) {
|
|
return () => {
|
|
return createVNode(props.tag, mergeProps(attrs, { "style": null }), { default: () => [createBaseVNode("svg", {
|
|
"class": "v-icon__svg",
|
|
"xmlns": "http://www.w3.org/2000/svg",
|
|
"viewBox": "0 0 24 24",
|
|
"role": "img",
|
|
"aria-hidden": "true"
|
|
}, [Array.isArray(props.icon) ? props.icon.map((path) => Array.isArray(path) ? createBaseVNode("path", {
|
|
"d": path[0],
|
|
"fill-opacity": path[1]
|
|
}, null) : createBaseVNode("path", { "d": path }, null)) : createBaseVNode("path", { "d": props.icon }, null)])] });
|
|
};
|
|
}
|
|
});
|
|
var VLigatureIcon = defineComponent({
|
|
name: "VLigatureIcon",
|
|
props: makeIconProps(),
|
|
setup(props) {
|
|
return () => {
|
|
return createVNode(props.tag, null, { default: () => [props.icon] });
|
|
};
|
|
}
|
|
});
|
|
var VClassIcon = defineComponent({
|
|
name: "VClassIcon",
|
|
props: makeIconProps(),
|
|
setup(props) {
|
|
return () => {
|
|
return createVNode(props.tag, { "class": normalizeClass(props.icon) }, null);
|
|
};
|
|
}
|
|
});
|
|
var useIcon = (props) => {
|
|
const icons = inject(IconSymbol);
|
|
if (!icons) throw new Error("Missing Vuetify Icons provide!");
|
|
return { iconData: computed(() => {
|
|
const iconAlias = toValue(props);
|
|
if (!iconAlias) return { component: VComponentIcon };
|
|
let icon = iconAlias;
|
|
if (typeof icon === "string") {
|
|
icon = icon.trim();
|
|
if (icon.startsWith("$")) icon = icons.aliases?.[icon.slice(1)];
|
|
}
|
|
if (!icon) consoleWarn(`Could not find aliased icon "${iconAlias}"`);
|
|
if (Array.isArray(icon)) return {
|
|
component: VSvgIcon,
|
|
icon
|
|
};
|
|
else if (typeof icon !== "string") return {
|
|
component: VComponentIcon,
|
|
icon
|
|
};
|
|
const iconSetName = Object.keys(icons.sets).find((setName) => typeof icon === "string" && icon.startsWith(`${setName}:`));
|
|
const iconName = iconSetName ? icon.slice(iconSetName.length + 1) : icon;
|
|
return {
|
|
component: icons.sets[iconSetName ?? icons.defaultSet].component,
|
|
icon: iconName
|
|
};
|
|
}) };
|
|
};
|
|
//#endregion
|
|
export { VLigatureIcon as a, VComponentIcon as i, IconValue as n, VSvgIcon as o, VClassIcon as r, useIcon as s, IconSymbol as t };
|
|
|
|
//# sourceMappingURL=icons-k2ZLE_i8.js.map
|