reka-ui
Version:
Vue port for Radix UI Primitives.
1 lines • 1.41 kB
Source Map (JSON)
{"version":3,"file":"PaginationLast.cjs","sources":["../../src/Pagination/PaginationLast.vue"],"sourcesContent":["<script lang=\"ts\">\nimport type { PrimitiveProps } from '@/Primitive'\nimport { useForwardExpose } from '@/shared'\n\nexport interface PaginationLastProps extends PrimitiveProps {}\n</script>\n\n<script setup lang=\"ts\">\nimport { computed } from 'vue'\nimport { Primitive } from '@/Primitive'\nimport { injectPaginationRootContext } from './PaginationRoot.vue'\n\nconst props = withDefaults(defineProps<PaginationLastProps>(), { as: 'button' })\n\nconst rootContext = injectPaginationRootContext()\nuseForwardExpose()\n\nconst disabled = computed((): boolean => rootContext.page.value === rootContext.pageCount.value || rootContext.disabled.value)\n</script>\n\n<template>\n <Primitive\n v-bind=\"props\"\n aria-label=\"Last Page\"\n :type=\"as === 'button' ? 'button' : undefined\"\n :disabled\n @click=\"!disabled && rootContext.onPageChange(rootContext.pageCount.value)\"\n >\n <slot>Last page</slot>\n </Primitive>\n</template>\n"],"names":["injectPaginationRootContext","useForwardExpose","computed"],"mappings":";;;;;;;;;;;;;;AAYA,IAAA,MAAM,KAAQ,GAAA,OAAA;AAEd,IAAA,MAAM,cAAcA,qDAA4B,EAAA;AAChD,IAAiBC,wCAAA,EAAA;AAEjB,IAAM,MAAA,QAAA,GAAWC,YAAS,CAAA,MAAe,WAAY,CAAA,IAAA,CAAK,KAAU,KAAA,WAAA,CAAY,SAAU,CAAA,KAAA,IAAS,WAAY,CAAA,QAAA,CAAS,KAAK,CAAA;;;;;;;;;;;;;;;;;;;;;"}