UNPKG

reka-ui

Version:

Vue port for Radix UI Primitives.

1 lines 1.8 kB
{"version":3,"file":"CalendarNext.cjs","sources":["../../src/Calendar/CalendarNext.vue"],"sourcesContent":["<script lang=\"ts\">\nimport type { PrimitiveProps } from '@/Primitive'\nimport type { DateValue } from '@internationalized/date'\n\nexport interface CalendarNextProps extends PrimitiveProps {\n /** The function to be used for the next page. Overwrites the `nextPage` function set on the `CalendarRoot`. */\n nextPage?: (placeholder: DateValue) => DateValue\n}\n\nexport interface CalendarNextSlot {\n default: (props: {\n /** Current disable state */\n disabled: boolean\n }) => any\n}\n</script>\n\n<script setup lang=\"ts\">\nimport { computed } from 'vue'\nimport { Primitive } from '@/Primitive'\nimport { injectCalendarRootContext } from './CalendarRoot.vue'\n\nconst props = withDefaults(defineProps<CalendarNextProps>(), { as: 'button', step: 'month' })\ndefineSlots<CalendarNextSlot>()\n\nconst disabled = computed(() => rootContext.disabled.value || rootContext.isNextButtonDisabled(props.nextPage))\n\nconst rootContext = injectCalendarRootContext()\n</script>\n\n<template>\n <Primitive\n :as=\"props.as\"\n :as-child=\"props.asChild\"\n aria-label=\"Next page\"\n :type=\"as === 'button' ? 'button' : undefined\"\n :aria-disabled=\"disabled || undefined\"\n :data-disabled=\"disabled || undefined\"\n :disabled=\"disabled\"\n @click=\"rootContext.nextPage(props.nextPage)\"\n >\n <slot :disabled>\n Next page\n </slot>\n </Primitive>\n</template>\n"],"names":["computed","injectCalendarRootContext"],"mappings":";;;;;;;;;;;;;;AAsBA,IAAA,MAAM,KAAQ,GAAA,OAAA;AAGd,IAAM,MAAA,QAAA,GAAWA,YAAS,CAAA,MAAM,WAAY,CAAA,QAAA,CAAS,SAAS,WAAY,CAAA,oBAAA,CAAqB,KAAM,CAAA,QAAQ,CAAC,CAAA;AAE9G,IAAA,MAAM,cAAcC,+CAA0B,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;"}