selection with shift-click

This commit is contained in:
Gauthier Roebroeck 2026-01-30 18:10:12 +08:00
parent a274f31029
commit 86061ad25f
7 changed files with 16 additions and 12 deletions

View file

@ -12,7 +12,7 @@
:menu-icon="menuIcon"
:menu-props="menuProps"
v-bind="props"
@selection="(val) => emit('selection', val)"
@selection="(val, event) => emit('selection', val, event)"
@click-quick-action="showEditMetadataDialog()"
@card-long-press="bottomSheet = true"
/>

View file

@ -8,7 +8,9 @@
v-bind="props"
:elevation="isHovering ? 3 : 1"
:class="isPreSelect || selected ? 'cursor-pointer' : 'cursor-default'"
@click="isPreSelect || selected ? emit('selection', !selected) : {}"
@click="
(event: Event) => (isPreSelect || selected ? emit('selection', !selected, event) : {})
"
>
<v-card-text>
<div class="d-flex flex-row ga-4">
@ -25,7 +27,7 @@
:variant="selected ? 'text' : 'flat'"
class="position-absolute top-0 left-0"
style="z-index: 2"
@click.stop="emit('selection', !selected)"
@click.stop="(event: Event) => emit('selection', !selected, event)"
/>
</v-fade-transition>

View file

@ -11,7 +11,9 @@
<div
:class="['position-relative', { 'cursor-pointer': isPreSelect || selected }]"
v-bind="props"
@click="isPreSelect || selected ? emit('selection', !selected) : {}"
@click="
(event: Event) => (isPreSelect || selected ? emit('selection', !selected, event) : {})
"
>
<v-img
:cover="stretchPoster"
@ -76,7 +78,7 @@
:variant="selected || preSelect ? 'text' : 'plain'"
:color="selected ? 'primary' : 'white'"
class="top-0 left-0 position-absolute"
@click.stop="emit('selection', !selected)"
@click.stop="(event: Event) => emit('selection', !selected, event)"
/>
<!-- Center FAB -->

View file

@ -10,7 +10,7 @@
:menu-icon="menuIcon"
:menu-props="menuProps"
v-bind="props"
@selection="(val) => emit('selection', val)"
@selection="(val, event) => emit('selection', val, event)"
@click-quick-action="showEditMetadataDialog()"
@card-long-press="bottomSheet = true"
/>

View file

@ -12,7 +12,7 @@
:menu-icon="menuIcon"
:menu-props="menuProps"
v-bind="props"
@selection="(val) => emit('selection', val)"
@selection="(val, event) => emit('selection', val, event)"
@click-quick-action="showEditMetadataDialog()"
@card-long-press="bottomSheet = true"
/>

View file

@ -54,7 +54,7 @@
>
<v-row>
<v-col
v-for="item in items"
v-for="(item, idx) in items"
:key="item.raw.id"
cols="auto"
>
@ -64,7 +64,7 @@
:selected="isSelected(item)"
:pre-select="preSelect"
:width="display.xs.value ? undefined : appStore.gridCardWidth"
@selection="toggleSelect(item)"
@selection="(_val, event) => toggleSelect(item, idx, event as MouseEvent)"
/>
</v-col>
</v-row>
@ -75,7 +75,7 @@
fluid
>
<v-row
v-for="item in items"
v-for="(item, idx) in items"
:key="item.raw.id"
>
<v-col>
@ -85,7 +85,7 @@
:selected="isSelected(item)"
:pre-select="preSelect"
:width="appStore.gridCardWidth"
@selection="toggleSelect(item)"
@selection="(_val, event) => toggleSelect(item, idx, event as MouseEvent)"
/>
</v-col>
</v-row>

View file

@ -26,7 +26,7 @@ export type ItemCardProps = {
}
export type ItemCardEmits = {
selection: [selected: boolean]
selection: [selected: boolean, event: Event]
}
export type ItemCardTitle = {