@ark-ui/vue
Version:
A collection of unstyled, accessible UI components for Vue, utilizing state machines for seamless interaction.
36 lines (33 loc) • 1.36 kB
JavaScript
import { defineComponent, useAttrs, createElementBlock, openBlock, Fragment, renderList, unref, createBlock, mergeProps, withCtx, renderSlot } from 'vue';
import { ark } from '../factory.js';
import { useForwardExpose } from '../../utils/use-forward-expose.js';
import { useScopeId } from '../../utils/use-scope-id.js';
import { useMarqueeContext } from './use-marquee-context.js';
const _sfc_main = /* @__PURE__ */ defineComponent({
...{ inheritAttrs: false },
__name: "marquee-content",
props: {
asChild: { type: Boolean }
},
setup(__props) {
const marquee = useMarqueeContext();
const attrs = useAttrs();
const scopeId = useScopeId();
useForwardExpose();
return (_ctx, _cache) => {
return openBlock(true), createElementBlock(Fragment, null, renderList(Array.from({ length: unref(marquee).contentCount }), (_, index) => {
return openBlock(), createBlock(unref(ark).div, mergeProps({ key: index }, { ref_for: true }, {
...unref(attrs),
...unref(scopeId) ? { [unref(scopeId)]: "" } : {},
...unref(marquee).getContentProps({ index })
}, { "as-child": __props.asChild }), {
default: withCtx(() => [
renderSlot(_ctx.$slots, "default")
]),
_: 3
}, 16, ["as-child"]);
}), 128);
};
}
});
export { _sfc_main as default };