UNPKG

@ark-ui/vue

Version:

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

36 lines (31 loc) 1.25 kB
'use strict'; Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: 'Module' } }); const vue = require('vue'); const factory = require('../factory.cjs'); const listbox_anatomy = require('./listbox.anatomy.cjs'); const useListboxContext = require('./use-listbox-context.cjs'); const useForwardExpose = require('../../utils/use-forward-expose.cjs'); const _sfc_main = /* @__PURE__ */ vue.defineComponent({ __name: "listbox-empty", props: { asChild: { type: Boolean } }, setup(__props) { const parts = listbox_anatomy.listboxAnatomy.build(); const listbox = useListboxContext.useListboxContext(); const isEmpty = vue.computed(() => listbox.value.collection.size === 0); useForwardExpose.useForwardExpose(); return (_ctx, _cache) => { return isEmpty.value ? (vue.openBlock(), vue.createBlock(vue.unref(factory.ark).div, vue.mergeProps({ key: 0 }, vue.unref(parts).empty.attrs, { role: "presentation", "as-child": __props.asChild }), { default: vue.withCtx(() => [ vue.renderSlot(_ctx.$slots, "default") ]), _: 3 }, 16, ["as-child"])) : vue.createCommentVNode("", true); }; } }); exports.default = _sfc_main;