primevue-mirror/apps/labs/plex/rating/index.vue

28 lines
982 B
Vue
Raw Normal View History

2025-03-03 11:00:23 +00:00
<template>
2025-03-03 11:33:44 +00:00
<Rating
unstyled
:pt="theme"
:ptOptions="{
mergeProps: ptViewMerge
}"
>
2025-03-03 11:00:23 +00:00
<template v-for="(_, slotName) in $slots" v-slot:[slotName]="slotProps">
<slot :name="slotName" v-bind="slotProps ?? {}" />
</template>
</Rating>
</template>
<script setup>
2025-03-03 11:33:44 +00:00
import Rating from 'primevue/rating';
2025-03-03 11:00:23 +00:00
import { ref } from 'vue';
2025-03-03 11:33:44 +00:00
import { ptViewMerge } from '../utils';
2025-03-03 11:00:23 +00:00
const theme = ref({
root: `relative flex items-center gap-1 p-disabled:opacity-60 p-disabled:pointer-events-none p-readonly:pointer-events-none`,
option: `inline-flex items-center cursor-pointer rounded-full
p-focus-visible:outline p-focus-visible:outline-1 p-focus-visible:outline-offset-2 p-focus-visible:outline-primary`,
onIcon: `text-base w-4 h-4 transition-colors duration-200 text-primary`,
offIcon: `text-surface-500 dark:text-surface-400 text-base w-4 h-4 transition-colors duration-200`
});
</script>