reka-ui
Version:
Vue port for Radix UI Primitives.
39 lines (35 loc) • 1.42 kB
JavaScript
;
const vue = require('vue');
const Pagination_PaginationRoot = require('./PaginationRoot.cjs');
const shared_useForwardExpose = require('../shared/useForwardExpose.cjs');
const Primitive_Primitive = require('../Primitive/Primitive.cjs');
const _sfc_main = /* @__PURE__ */ vue.defineComponent({
__name: "PaginationFirst",
props: {
asChild: { type: Boolean },
as: { default: "button" }
},
setup(__props) {
const props = __props;
const rootContext = Pagination_PaginationRoot.injectPaginationRootContext();
shared_useForwardExpose.useForwardExpose();
const disabled = vue.computed(() => rootContext.page.value === 1 || rootContext.disabled.value);
return (_ctx, _cache) => {
return vue.openBlock(), vue.createBlock(vue.unref(Primitive_Primitive.Primitive), vue.mergeProps(props, {
"aria-label": "First Page",
type: _ctx.as === "button" ? "button" : void 0,
disabled: disabled.value,
onClick: _cache[0] || (_cache[0] = ($event) => !disabled.value && vue.unref(rootContext).onPageChange(1))
}), {
default: vue.withCtx(() => [
vue.renderSlot(_ctx.$slots, "default", {}, () => [
_cache[1] || (_cache[1] = vue.createTextVNode("First page"))
])
]),
_: 3
}, 16, ["type", "disabled"]);
};
}
});
exports._sfc_main = _sfc_main;
//# sourceMappingURL=PaginationFirst.cjs.map