UNPKG

@ark-ui/vue

Version:

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

61 lines (58 loc) 1.8 kB
import { defineComponent, mergeDefaults, createBlock, openBlock, unref, mergeProps, withCtx, renderSlot } from 'vue'; import { ark } from '../factory.js'; import { usePinInput } from './use-pin-input.js'; import { PinInputProvider } from './use-pin-input-context.js'; import { useForwardExpose } from '../../utils/use-forward-expose.js'; const _sfc_main = /* @__PURE__ */ defineComponent({ __name: "pin-input-root", props: /* @__PURE__ */ mergeDefaults({ autoFocus: { type: Boolean }, blurOnComplete: { type: Boolean }, count: {}, defaultValue: {}, disabled: { type: Boolean }, form: {}, id: {}, ids: {}, invalid: { type: Boolean }, mask: { type: Boolean }, modelValue: {}, name: {}, otp: { type: Boolean }, pattern: {}, placeholder: {}, readOnly: { type: Boolean }, required: { type: Boolean }, selectOnFocus: { type: Boolean }, translations: {}, type: {}, asChild: { type: Boolean } }, { autoFocus: void 0, blurOnComplete: void 0, disabled: void 0, invalid: void 0, mask: void 0, otp: void 0, readOnly: void 0, required: void 0, selectOnFocus: void 0 }), emits: ["valueChange", "valueComplete", "valueInvalid", "update:modelValue"], setup(__props, { emit: __emit }) { const props = __props; const emits = __emit; const pinInput = usePinInput(props, emits); PinInputProvider(pinInput); useForwardExpose(); return (_ctx, _cache) => { return openBlock(), createBlock(unref(ark).div, mergeProps(unref(pinInput).getRootProps(), { "as-child": _ctx.asChild }), { default: withCtx(() => [ renderSlot(_ctx.$slots, "default") ]), _: 3 }, 16, ["as-child"]); }; } }); export { _sfc_main as default };