|
|
@ -1,5 +1,5 @@ |
|
|
|
<script setup lang="ts"> |
|
|
|
<script setup lang="ts"> |
|
|
|
import { ActiveCellInj, ColumnInj, EditModeInj, computed, inject, useSelectedCellKeyupListener } from '#imports' |
|
|
|
import { ActiveCellInj, ColumnInj, computed, inject, useSelectedCellKeyupListener } from '#imports' |
|
|
|
|
|
|
|
|
|
|
|
interface Props { |
|
|
|
interface Props { |
|
|
|
modelValue?: number | null | undefined |
|
|
|
modelValue?: number | null | undefined |
|
|
@ -11,8 +11,6 @@ const emits = defineEmits(['update:modelValue']) |
|
|
|
|
|
|
|
|
|
|
|
const column = inject(ColumnInj)! |
|
|
|
const column = inject(ColumnInj)! |
|
|
|
|
|
|
|
|
|
|
|
const editEnabled = inject(EditModeInj) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const ratingMeta = computed(() => { |
|
|
|
const ratingMeta = computed(() => { |
|
|
|
return { |
|
|
|
return { |
|
|
|
icon: { |
|
|
|
icon: { |
|
|
@ -43,8 +41,6 @@ useSelectedCellKeyupListener(inject(ActiveCellInj, ref(false)), (e: KeyboardEven |
|
|
|
v-model:value="vModel" |
|
|
|
v-model:value="vModel" |
|
|
|
:count="ratingMeta.max" |
|
|
|
:count="ratingMeta.max" |
|
|
|
:style="`color: ${ratingMeta.color}; padding: 0px 5px`" |
|
|
|
:style="`color: ${ratingMeta.color}; padding: 0px 5px`" |
|
|
|
:class="{ '!ml-[-8px]': !editEnabled }" |
|
|
|
|
|
|
|
:disabled="!editEnabled" |
|
|
|
|
|
|
|
> |
|
|
|
> |
|
|
|
<template #character> |
|
|
|
<template #character> |
|
|
|
<MdiStar v-if="ratingMeta.icon.full === 'mdi-star'" class="text-sm" /> |
|
|
|
<MdiStar v-if="ratingMeta.icon.full === 'mdi-star'" class="text-sm" /> |
|
|
|