@ark-ui/vue
Version:
A collection of unstyled, accessible UI components for Vue, utilizing state machines for seamless interaction.
58 lines (53 loc) • 1.85 kB
JavaScript
'use strict';
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: 'Module' } });
const vue = require('vue');
const useForwardExpose = require('../../utils/use-forward-expose.cjs');
const factory = require('../factory.cjs');
const useListbox = require('./use-listbox.cjs');
const useListboxContext = require('./use-listbox-context.cjs');
const _sfc_main = /* @__PURE__ */ vue.defineComponent({
__name: "listbox-root",
props: /* @__PURE__ */ vue.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.useListbox(props, emits);
useListboxContext.ListboxProvider(listbox);
useForwardExpose.useForwardExpose();
return (_ctx, _cache) => {
return vue.openBlock(), vue.createBlock(vue.unref(factory.ark).div, vue.mergeProps(vue.unref(listbox).getRootProps(), { "as-child": _ctx.asChild }), {
default: vue.withCtx(() => [
vue.renderSlot(_ctx.$slots, "default")
]),
_: 3
}, 16, ["as-child"]);
};
}
});
exports.default = _sfc_main;