11<template >
22  <BSSelectable  v-slot =" { selectable }" :focused =" props.focused" 
3-     <div  :class =" [selectable, $style.cell]" :title =" props.cell.src" :style =" style" @click =" () => emit('select')" 
4-       <BSIcon  v-for =" (icon, index) in props.cell.icons" :key =" index" :class =" $style.icon" :icon =" icon" 
5-         @ratio =" (ratio: number) => updateRatio(index, ratio)" 
6-     </div >
3+     <BSPopover  v-model:show =" popoverShown" :cell =" props.cell" :ratio =" ratio" 
4+       @select =" (offset, length) => emit('select', offset, length)" 
5+       <div  :class =" [selectable, $style.cell]" :style =" style" @click =" () => emit('select', 0, props.cell.length)" 
6+         @click.right.prevent =" handleRightClick" 
7+         <BSIcon  v-for =" (icon, index) in props.cell.icons" :key =" index" :class =" $style.icon" :icon =" icon" 
8+           @ratio =" (ratio: number) => updateRatio(index, ratio)" 
9+       </div >
10+     </BSPopover >
711  </BSSelectable >
812</template >
913
@@ -14,6 +18,7 @@ import type { RDTCell } from '@/ast';
1418import  styleFromParams  from  ' @/utils/styleFromParams' 
1519
1620import  BSSelectable  from  ' ./BSSelectable.vue' 
21+ import  BSPopover  from  ' ./BSPopover.vue' 
1722import  BSIcon  from  ' ./BSIcon.vue' 
1823
1924const =  defineProps <{
@@ -22,7 +27,7 @@ const props = defineProps<{
2227}>(); 
2328
2429const =  defineEmits <{
25-   (e :  ' select' :  void ; 
30+   (e :  ' select' ,  offset :   number ,  length :   number ):  void ; 
2631}>(); 
2732
2833const =  ref (1 );
@@ -32,6 +37,13 @@ const style = computed(() => ({
3237  ' --bs-map-cell-ratio' ratio .value  ==  1  ?  undefined  :  ratio .value ), 
3338}) as  CSSProperties ); 
3439
40+ const =  ref (false );
41+ 
42+ function  handleRightClick():  void  {
43+   popoverShown .value  =  true ; 
44+   emit (' select' 0 , props .cell .length ); 
45+ } 
46+ 
3547function  updateRatio(layer :  number , newRatio :  number ):  void  {
3648  if  (layer  ==  0 ) { 
3749    //  Only ratio of the first icon affects the cell 
0 commit comments