UNPKG

@arco-design/web-vue

Version:

Arco Design Vue 2.0: A Vue.js 3 UI Library

77 lines (76 loc) 2.87 kB
import { defineComponent, computed, openBlock, createElementBlock, normalizeClass, normalizeStyle, createStaticVNode } from "vue"; import { getPrefixCls } from "../../_utils/global-config.js"; import { isNumber } from "../../_utils/is.js"; import _export_sfc from "../../_virtual/plugin-vue_export-helper.js"; const _sfc_main = defineComponent({ name: "IconPalette", props: { size: { type: [Number, String] }, strokeWidth: { type: Number, default: 4 }, strokeLinecap: { type: String, default: "butt", validator: (value) => { return ["butt", "round", "square"].includes(value); } }, strokeLinejoin: { type: String, default: "miter", validator: (value) => { return ["arcs", "bevel", "miter", "miter-clip", "round"].includes(value); } }, rotate: Number, spin: Boolean }, emits: { click: (ev) => true }, setup(props, { emit }) { const prefixCls = getPrefixCls("icon"); const cls = computed(() => [prefixCls, `${prefixCls}-palette`, { [`${prefixCls}-spin`]: props.spin }]); const innerStyle = computed(() => { const styles = {}; if (props.size) { styles.fontSize = isNumber(props.size) ? `${props.size}px` : props.size; } if (props.rotate) { styles.transform = `rotate(${props.rotate}deg)`; } return styles; }); const onClick = (ev) => { emit("click", ev); }; return { cls, innerStyle, onClick }; } }); const _hoisted_1 = ["stroke-width", "stroke-linecap", "stroke-linejoin"]; function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) { return openBlock(), createElementBlock("svg", { viewBox: "0 0 48 48", fill: "none", xmlns: "http://www.w3.org/2000/svg", stroke: "currentColor", class: normalizeClass(_ctx.cls), style: normalizeStyle(_ctx.innerStyle), "stroke-width": _ctx.strokeWidth, "stroke-linecap": _ctx.strokeLinecap, "stroke-linejoin": _ctx.strokeLinejoin, onClick: _cache[0] || (_cache[0] = (...args) => _ctx.onClick && _ctx.onClick(...args)) }, _cache[1] || (_cache[1] = [ createStaticVNode('<path d="M31.813 12.02C29.73 10.459 27.013 10 24 10c-9.78 0-17.708 6.987-17.708 15.042 0 8.054 8.97 14.583 18.75 14.583 5.277 0 2.485-5.318 5.73-8.333 2.767-2.574 10.937-1.563 10.937-6.25 0-2.792-.521-5.209-2.605-7.617"></path><path d="M25.042 25.563 42.23 8.375"></path><circle cx="22.5" cy="17.5" r="2.5" fill="currentColor" stroke="none"></circle><circle cx="15.5" cy="20.5" r="2.5" fill="currentColor" stroke="none"></circle><circle cx="14.5" cy="28.5" r="2.5" fill="currentColor" stroke="none"></circle>', 5) ]), 14, _hoisted_1); } var _IconPalette = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]); export { _IconPalette as default };