@ark-ui/vue
Version:
A collection of unstyled, accessible UI components for Vue, utilizing state machines for seamless interaction.
44 lines (41 loc) • 1.39 kB
JavaScript
import { defineComponent, mergeDefaults, createBlock, openBlock, unref, mergeProps, withCtx, renderSlot } from 'vue';
import { ark } from '../factory.js';
import { useSignaturePad } from './use-signature-pad.js';
import { SignaturePadProvider } from './use-signature-pad-context.js';
import { useForwardExpose } from '../../utils/use-forward-expose.js';
const _sfc_main = /* @__PURE__ */ defineComponent({
__name: "signature-pad-root",
props: /* @__PURE__ */ mergeDefaults({
disabled: { type: Boolean },
drawing: {},
defaultPaths: {},
id: {},
ids: {},
name: {},
readOnly: { type: Boolean },
required: { type: Boolean },
translations: {},
asChild: { type: Boolean }
}, {
readOnly: void 0,
disabled: void 0,
required: void 0
}),
emits: ["update:paths", "draw", "drawEnd"],
setup(__props, { emit: __emit }) {
const props = __props;
const emits = __emit;
const signaturepad = useSignaturePad(props, emits);
SignaturePadProvider(signaturepad);
useForwardExpose();
return (_ctx, _cache) => {
return openBlock(), createBlock(unref(ark).div, mergeProps(unref(signaturepad).getRootProps(), { "as-child": _ctx.asChild }), {
default: withCtx(() => [
renderSlot(_ctx.$slots, "default")
]),
_: 3
}, 16, ["as-child"]);
};
}
});
export { _sfc_main as default };