UNPKG

@ark-ui/vue

Version:

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

31 lines (28 loc) 1.1 kB
import { defineComponent, useSlots, createBlock, openBlock, unref, mergeProps, withCtx, renderSlot, createTextVNode, toDisplayString } from 'vue'; import { ark } from '../factory.js'; import { useListboxContext } from './use-listbox-context.js'; import { useForwardExpose } from '../../utils/use-forward-expose.js'; const _sfc_main = /* @__PURE__ */ defineComponent({ __name: "listbox-value-text", props: { placeholder: {}, asChild: { type: Boolean } }, setup(__props) { const props = __props; const listbox = useListboxContext(); const slots = useSlots(); useForwardExpose(); return (_ctx, _cache) => { return openBlock(), createBlock(unref(ark).span, mergeProps(unref(listbox).getValueTextProps(), { "as-child": _ctx.asChild }), { default: withCtx(() => [ renderSlot(_ctx.$slots, "default", {}, () => [ createTextVNode(toDisplayString(slots.default?.() || unref(listbox).valueAsString || props.placeholder), 1) ]) ]), _: 3 }, 16, ["as-child"]); }; } }); export { _sfc_main as default };