UNPKG

@ark-ui/vue

Version:

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

30 lines (27 loc) 1.2 kB
import { defineComponent, computed, createBlock, createCommentVNode, unref, openBlock, mergeProps as mergeProps$1, withCtx, renderSlot } from 'vue'; import { ark } from '../factory.js'; import { useSelectContext } from './use-select-context.js'; import { useForwardExpose } from '../../utils/use-forward-expose.js'; import { mergeProps } from '@zag-js/vue'; import { usePresenceContext } from '../presence/use-presence-context.js'; const _sfc_main = /* @__PURE__ */ defineComponent({ __name: "select-content", props: { asChild: { type: Boolean } }, setup(__props) { const select = useSelectContext(); const presence = usePresenceContext(); const mergedProps = computed(() => mergeProps(select.value.getContentProps(), presence.value.presenceProps)); useForwardExpose(); return (_ctx, _cache) => { return !unref(presence).unmounted ? (openBlock(), createBlock(unref(ark).div, mergeProps$1({ key: 0 }, mergedProps.value, { "as-child": _ctx.asChild }), { default: withCtx(() => [ renderSlot(_ctx.$slots, "default") ]), _: 3 }, 16, ["as-child"])) : createCommentVNode("", true); }; } }); export { _sfc_main as default };