reka-ui
Version:
Vue port for Radix UI Primitives.
1 lines • 1.59 kB
Source Map (JSON)
{"version":3,"file":"CheckboxIndicator.cjs","sources":["../../src/Checkbox/CheckboxIndicator.vue"],"sourcesContent":["<script lang=\"ts\">\nimport type { PrimitiveProps } from '@/Primitive'\nimport { useForwardExpose } from '@/shared'\n\nexport interface CheckboxIndicatorProps extends PrimitiveProps {\n /**\n * Used to force mounting when more control is needed. Useful when\n * controlling animation with Vue animation libraries.\n */\n forceMount?: boolean\n}\n</script>\n\n<script setup lang=\"ts\">\nimport { injectCheckboxRootContext } from './CheckboxRoot.vue'\nimport { Primitive } from '@/Primitive'\nimport { Presence } from '@/Presence'\nimport { getState, isIndeterminate } from './utils'\n\nwithDefaults(defineProps<CheckboxIndicatorProps>(), {\n as: 'span',\n})\nconst { forwardRef } = useForwardExpose()\n\nconst rootContext = injectCheckboxRootContext()\n</script>\n\n<template>\n <Presence\n :present=\"forceMount || isIndeterminate(rootContext.state.value) || rootContext.state.value === true\"\n >\n <Primitive\n :ref=\"forwardRef\"\n :data-state=\"getState(rootContext.state.value)\"\n :data-disabled=\"rootContext.disabled.value ? '' : undefined\"\n :style=\"{ pointerEvents: 'none' }\"\n :as-child=\"asChild\"\n :as=\"as\"\n v-bind=\"$attrs\"\n >\n <slot />\n </Primitive>\n </Presence>\n</template>\n"],"names":["useForwardExpose","injectCheckboxRootContext"],"mappings":";;;;;;;;;;;;;;;;;AAsBA,IAAM,MAAA,EAAE,UAAW,EAAA,GAAIA,wCAAiB,EAAA;AAExC,IAAA,MAAM,cAAcC,+CAA0B,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}