@ark-ui/vue
Version:
A collection of unstyled, accessible UI components for Vue, utilizing state machines for seamless interaction.
42 lines (39 loc) • 1.29 kB
JavaScript
import { defineComponent, createBlock, openBlock, unref, mergeProps, withCtx, renderSlot } from 'vue';
import { ark } from '../factory.js';
import { usePagination } from './use-pagination.js';
import { PaginationProvider } from './use-pagination-context.js';
import { useForwardExpose } from '../../utils/use-forward-expose.js';
const _sfc_main = /* @__PURE__ */ defineComponent({
__name: "pagination-root",
props: {
count: {},
defaultPage: {},
defaultPageSize: {},
id: {},
ids: {},
page: {},
pageSize: {},
siblingCount: {},
translations: {},
type: {},
getPageUrl: { type: Function },
asChild: { type: Boolean }
},
emits: ["pageChange", "pageSizeChange", "update:page", "update:pageSize"],
setup(__props, { emit: __emit }) {
const props = __props;
const emits = __emit;
const pagination = usePagination(props, emits);
PaginationProvider(pagination);
useForwardExpose();
return (_ctx, _cache) => {
return openBlock(), createBlock(unref(ark).nav, mergeProps(unref(pagination).getRootProps(), { "as-child": __props.asChild }), {
default: withCtx(() => [
renderSlot(_ctx.$slots, "default")
]),
_: 3
}, 16, ["as-child"]);
};
}
});
export { _sfc_main as default };