UNPKG

@ark-ui/vue

Version:

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

28 lines (25 loc) 1.01 kB
import { defineComponent, createBlock, openBlock, unref, mergeProps, withCtx, renderSlot } from 'vue'; import { useForwardExpose } from '../../utils/use-forward-expose.js'; import { ark } from '../factory.js'; import { useTreeViewContext } from './use-tree-view-context.js'; import { useTreeViewNodePropsContext } from './use-tree-view-node-props-context.js'; const _sfc_main = /* @__PURE__ */ defineComponent({ __name: "tree-view-branch-trigger", props: { asChild: { type: Boolean } }, setup(__props) { const treeView = useTreeViewContext(); const nodeProps = useTreeViewNodePropsContext(); useForwardExpose(); return (_ctx, _cache) => { return openBlock(), createBlock(unref(ark).div, mergeProps(unref(treeView).getBranchTriggerProps(unref(nodeProps)), { "as-child": __props.asChild }), { default: withCtx(() => [ renderSlot(_ctx.$slots, "default") ]), _: 3 }, 16, ["as-child"]); }; } }); export { _sfc_main as default };