@ark-ui/vue
Version:
A collection of unstyled, accessible UI components for Vue, utilizing state machines for seamless interaction.
51 lines (48 loc) • 1.54 kB
JavaScript
import { defineComponent, mergeDefaults, createBlock, openBlock, unref, mergeProps, withCtx, renderSlot } from 'vue';
import { ark } from '../factory.js';
import { useCarousel } from './use-carousel.js';
import { CarouselProvider } from './use-carousel-context.js';
import { useForwardExpose } from '../../utils/use-forward-expose.js';
const _sfc_main = /* @__PURE__ */ defineComponent({
__name: "carousel-root",
props: /* @__PURE__ */ mergeDefaults({
allowMouseDrag: { type: Boolean },
autoplay: { type: [Boolean, Object] },
defaultPage: {},
id: {},
ids: {},
inViewThreshold: {},
loop: { type: Boolean },
orientation: {},
padding: {},
page: {},
slideCount: {},
slidesPerMove: {},
slidesPerPage: {},
snapType: {},
spacing: {},
translations: {},
asChild: { type: Boolean }
}, {
allowMouseDrag: void 0,
loop: void 0,
autoplay: void 0
}),
emits: ["autoplayStatusChange", "dragStatusChange", "pageChange", "update:page"],
setup(__props, { emit: __emit }) {
const props = __props;
const emits = __emit;
const carousel = useCarousel(props, emits);
CarouselProvider(carousel);
useForwardExpose();
return (_ctx, _cache) => {
return openBlock(), createBlock(unref(ark).div, mergeProps(unref(carousel).getRootProps(), { "as-child": _ctx.asChild }), {
default: withCtx(() => [
renderSlot(_ctx.$slots, "default")
]),
_: 3
}, 16, ["as-child"]);
};
}
});
export { _sfc_main as default };