UNPKG

@ark-ui/vue

Version:

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

39 lines (36 loc) 1.21 kB
import { defineComponent, createBlock, openBlock, unref, mergeProps, withCtx, renderSlot } from 'vue'; import { ark } from '../factory.js'; import { useSplitter } from './use-splitter.js'; import { SplitterProvider } from './use-splitter-context.js'; import { useForwardExpose } from '../../utils/use-forward-expose.js'; const _sfc_main = /* @__PURE__ */ defineComponent({ __name: "splitter-root", props: { defaultSize: {}, id: {}, ids: {}, keyboardResizeBy: {}, nonce: {}, orientation: {}, panels: {}, size: {}, asChild: { type: Boolean } }, emits: ["collapse", "expand", "resize", "resizeEnd", "resizeStart", "update:size"], setup(__props, { emit: __emit }) { const props = __props; const emits = __emit; const splitter = useSplitter(props, emits); SplitterProvider(splitter); useForwardExpose(); return (_ctx, _cache) => { return openBlock(), createBlock(unref(ark).div, mergeProps(unref(splitter).getRootProps(), { "as-child": __props.asChild }), { default: withCtx(() => [ renderSlot(_ctx.$slots, "default") ]), _: 3 }, 16, ["as-child"]); }; } }); export { _sfc_main as default };