UNPKG

@ark-ui/vue

Version:

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

63 lines (60 loc) 2.22 kB
import { defineComponent, mergeDefaults, computed, createBlock, openBlock, unref, mergeProps, withCtx, renderSlot } from 'vue'; import { ark } from '../factory.js'; import { useColorPicker } from './use-color-picker.js'; import { ColorPickerProvider } from './use-color-picker-context.js'; import { RenderStrategyPropsProvider } from '../../utils/use-render-strategy.js'; import { useForwardExpose } from '../../utils/use-forward-expose.js'; const _sfc_main = /* @__PURE__ */ defineComponent({ __name: "color-picker-root", props: /* @__PURE__ */ mergeDefaults({ closeOnSelect: { type: Boolean }, defaultFormat: {}, defaultOpen: { type: Boolean }, defaultValue: {}, disabled: { type: Boolean }, format: {}, id: {}, ids: {}, initialFocusEl: { type: Function }, invalid: { type: Boolean }, modelValue: {}, name: {}, open: { type: Boolean }, openAutoFocus: { type: Boolean }, positioning: {}, readOnly: { type: Boolean }, required: { type: Boolean }, inline: { type: Boolean }, lazyMount: { type: Boolean }, unmountOnExit: { type: Boolean }, asChild: { type: Boolean } }, { closeOnSelect: void 0, defaultOpen: void 0, disabled: void 0, invalid: void 0, open: void 0, openAutoFocus: void 0, readOnly: void 0, required: void 0, inline: void 0 }), emits: ["focusOutside", "formatChange", "interactOutside", "openChange", "pointerDownOutside", "valueChange", "valueChangeEnd", "update:modelValue", "update:open", "update:format"], setup(__props, { emit: __emit }) { const props = __props; const emits = __emit; const colorPicker = useColorPicker(props, emits); ColorPickerProvider(colorPicker); RenderStrategyPropsProvider(computed(() => ({ lazyMount: props.lazyMount, unmountOnExit: props.unmountOnExit }))); useForwardExpose(); return (_ctx, _cache) => { return openBlock(), createBlock(unref(ark).div, mergeProps(unref(colorPicker).getRootProps(), { "as-child": _ctx.asChild }), { default: withCtx(() => [ renderSlot(_ctx.$slots, "default") ]), _: 3 }, 16, ["as-child"]); }; } }); export { _sfc_main as default };