UNPKG

@ark-ui/vue

Version:

A collection of unstyled, accessible UI components for Vue, utilizing state machines for seamless interaction.

31 lines (28 loc) 1.56 kB
import { defineComponent, createBlock, openBlock, unref, mergeProps, withCtx, createElementVNode, createElementBlock, createCommentVNode, Fragment, renderList, normalizeProps } from 'vue'; import { ark } from '../factory.js'; import { useSignaturePadContext } from './use-signature-pad-context.js'; import { useForwardExpose } from '../../utils/use-forward-expose.js'; const _sfc_main = /* @__PURE__ */ defineComponent({ __name: "signature-pad-segment", props: { asChild: { type: Boolean } }, setup(__props) { const signaturePad = useSignaturePadContext(); useForwardExpose(); return (_ctx, _cache) => { return openBlock(), createBlock(unref(ark).svg, mergeProps(unref(signaturePad).getSegmentProps(), { "as-child": _ctx.asChild }), { default: withCtx(() => [ _cache[0] || (_cache[0] = createElementVNode("title", null, "Signature", -1)), (openBlock(true), createElementBlock(Fragment, null, renderList(unref(signaturePad).paths, (path, i) => { return openBlock(), createElementBlock("path", mergeProps({ key: i }, { ref_for: true }, unref(signaturePad).getSegmentPathProps({ path })), null, 16); }), 128)), unref(signaturePad).currentPath ? (openBlock(), createElementBlock("path", normalizeProps(mergeProps({ key: 0 }, unref(signaturePad).getSegmentPathProps({ path: unref(signaturePad).currentPath }))), null, 16)) : createCommentVNode("", true) ]), _: 1, __: [0] }, 16, ["as-child"]); }; } }); export { _sfc_main as default };