UNPKG

@ark-ui/vue

Version:

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

54 lines (51 loc) 1.71 kB
import { defineComponent, mergeDefaults, createBlock, openBlock, unref, mergeProps, withCtx, renderSlot } from 'vue'; import { useForwardExpose } from '../../utils/use-forward-expose.js'; import { ark } from '../factory.js'; import { useListbox } from './use-listbox.js'; import { ListboxProvider } from './use-listbox-context.js'; const _sfc_main = /* @__PURE__ */ defineComponent({ __name: "listbox-root", props: /* @__PURE__ */ mergeDefaults({ collection: {}, defaultHighlightedValue: {}, defaultValue: {}, deselectable: { type: Boolean }, disabled: { type: Boolean }, disallowSelectAll: { type: Boolean }, highlightedValue: {}, id: {}, ids: {}, loopFocus: { type: Boolean }, modelValue: {}, orientation: {}, scrollToIndexFn: { type: Function }, selectOnHighlight: { type: Boolean }, selectionMode: {}, typeahead: { type: Boolean }, asChild: { type: Boolean } }, { deselectable: void 0, disabled: void 0, disallowSelectAll: void 0, loopFocus: void 0, selectOnHighlight: void 0, typeahead: void 0 }), emits: ["highlightChange", "select", "valueChange", "update:modelValue"], setup(__props, { emit: __emit }) { const props = __props; const emits = __emit; const listbox = useListbox(props, emits); ListboxProvider(listbox); useForwardExpose(); return (_ctx, _cache) => { return openBlock(), createBlock(unref(ark).div, mergeProps(unref(listbox).getRootProps(), { "as-child": _ctx.asChild }), { default: withCtx(() => [ renderSlot(_ctx.$slots, "default") ]), _: 3 }, 16, ["as-child"]); }; } }); export { _sfc_main as default };