File size: 1,344 Bytes
0070fce
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
<script setup lang="ts">
import { useGlobalStore } from '@/store/useGlobalStore'
defineProps<{
  show: boolean
}>()
const emit = defineEmits<{
  selectAll: [],
  reverseSelect: [],
  clearAllSelected: []
}>()
const g = useGlobalStore()

const onExit = () => {
  emit('clearAllSelected')
  g.keepMultiSelect = false
}

const onKeepClick = () => {
  g.keepMultiSelect = true
}


</script>
<template>
  <div class="float-panel" v-if="show">
    <div v-if="g.keepMultiSelect" class="select-actions">
      <a-button size="small" @click="emit('selectAll')">{{ $t('select-all') }}</a-button>
      <a-button size="small" @click="emit('reverseSelect')">{{ $t('rerverse-select') }}</a-button>
      <a-button size="small" @click="emit('clearAllSelected')">{{ $t('clear-all-selected') }}</a-button>
      <a-button size="small" @click="onExit">{{ $t('exit') }}</a-button>
    </div>
    <div v-else>
      <a-button size="small" type="primary" @click="onKeepClick">{{ $t('keep-multi-selected') }}</a-button>
    </div>
  </div>
</template>
<style lang="scss" scoped>
.select-actions > :not(:last-child)  {
  margin-right: 4px;
}
.float-panel {
  position: absolute;
  bottom: 32px;
  right: 32px;
  background: var(--zp-primary-background);
  border-radius: 4px;
  z-index: 1000;
  padding: 8px;
  box-shadow: 0px 0px 4px var(--zp-secondary);
}
</style>