UNPKG

@ark-ui/vue

Version:

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

64 lines (61 loc) 1.94 kB
import { defineComponent, mergeDefaults, createBlock, openBlock, unref, mergeProps, withCtx, renderSlot } from 'vue'; import { ark } from '../factory.js'; import { useNumberInput } from './use-number-input.js'; import { NumberInputProvider } from './use-number-input-context.js'; import { useForwardExpose } from '../../utils/use-forward-expose.js'; const _sfc_main = /* @__PURE__ */ defineComponent({ __name: "number-input-root", props: /* @__PURE__ */ mergeDefaults({ allowMouseWheel: { type: Boolean }, allowOverflow: { type: Boolean }, clampValueOnBlur: { type: Boolean }, defaultValue: {}, disabled: { type: Boolean }, focusInputOnChange: { type: Boolean }, form: {}, formatOptions: {}, id: {}, ids: {}, inputMode: {}, invalid: { type: Boolean }, locale: {}, max: {}, min: {}, modelValue: {}, name: {}, pattern: {}, readOnly: { type: Boolean }, required: { type: Boolean }, spinOnPress: { type: Boolean }, step: {}, translations: {}, asChild: { type: Boolean } }, { allowMouseWheel: void 0, allowOverflow: void 0, clampValueOnBlur: void 0, disabled: void 0, focusInputOnChange: void 0, invalid: void 0, readOnly: void 0, required: void 0, spinOnPress: void 0 }), emits: ["focusChange", "valueChange", "valueInvalid", "update:modelValue"], setup(__props, { emit: __emit }) { const props = __props; const emits = __emit; const numberInput = useNumberInput(props, emits); NumberInputProvider(numberInput); useForwardExpose(); return (_ctx, _cache) => { return openBlock(), createBlock(unref(ark).div, mergeProps(unref(numberInput).getRootProps(), { "as-child": _ctx.asChild }), { default: withCtx(() => [ renderSlot(_ctx.$slots, "default") ]), _: 3 }, 16, ["as-child"]); }; } }); export { _sfc_main as default };