Browse Source

feat(gui-v2): sort layout

Signed-off-by: Pranav C <pranavxc@gmail.com>
pull/2819/head
Pranav C 2 years ago
parent
commit
26b8edbb62
  1. 28
      packages/nc-gui-v2/components/smartsheet-toolbar/SortListMenu.vue

28
packages/nc-gui-v2/components/smartsheet-toolbar/SortListMenu.vue

@ -6,6 +6,7 @@ import useViewSorts from '~/composables/useViewSorts'
import MdiMenuDownIcon from '~icons/mdi/menu-down' import MdiMenuDownIcon from '~icons/mdi/menu-down'
import MdiSortIcon from '~icons/mdi/sort' import MdiSortIcon from '~icons/mdi/sort'
import MdiDeleteIcon from '~icons/mdi/close-box' import MdiDeleteIcon from '~icons/mdi/close-box'
import MdiAddIcon from '~icons/mdi/plus'
const meta = inject(MetaInj) const meta = inject(MetaInj)
const view = inject(ActiveViewInj) const view = inject(ActiveViewInj)
@ -26,8 +27,7 @@ watch(
</script> </script>
<template> <template>
<v-menu offset-y transition="slide-y-transition"> <a-dropdown offset-y class="" :trigger="['click']">
<template #activator="{ props }">
<v-badge :value="sorts && sorts.length" color="primary" dot overlap> <v-badge :value="sorts && sorts.length" color="primary" dot overlap>
<a-button <a-button
v-t="['c:sort']" v-t="['c:sort']"
@ -49,8 +49,8 @@ watch(
</div> </div>
</a-button> </a-button>
</v-badge> </v-badge>
</template> <template #overlay>
<div class="backgroundColor pa-2 menu-filter-dropdown bg-background min-w-[400px]"> <div class="bg-white shadow p-2 menu-filter-dropdown min-w-[400px]">
<div class="sort-grid" @click.stop> <div class="sort-grid" @click.stop>
<template v-for="(sort, i) in sorts || []" :key="i"> <template v-for="(sort, i) in sorts || []" :key="i">
<!-- <v-icon :key="`${i}icon`" class="nc-sort-item-remove-btn" small @click.stop="deleteSort(sort)"> mdi-close-box </v-icon> --> <!-- <v-icon :key="`${i}icon`" class="nc-sort-item-remove-btn" small @click.stop="deleteSort(sort)"> mdi-close-box </v-icon> -->
@ -66,10 +66,13 @@ watch(
@click.stop @click.stop
@update:model-value="saveOrUpdate(sort, i)" @update:model-value="saveOrUpdate(sort, i)"
/> />
<v-select <a-select
v-model="sort.direction" v-model:value="sort.direction"
class="flex-shrink-1 flex-grow-0 caption nc-sort-dir-select" class="flex-shrink-1 flex-grow-0 caption nc-sort-dir-select"
:items="['asc', 'desc']" :items="[
{ text: 'asc', value: 'asc' },
{ text: 'desc', value: 'desc' },
]"
:label="$t('labels.operation')" :label="$t('labels.operation')"
density="compact" density="compact"
variant="solo" variant="solo"
@ -83,13 +86,16 @@ watch(
<!-- </v-select> --> <!-- </v-select> -->
</template> </template>
</div> </div>
<v-btn small class="elevation-0 text-grey text-capitalize text-sm my-3" @click.stop="addSort"> <a-button size="small" class="text-grey text-capitalize text-sm my-3" @click.stop="addSort">
<!-- todo: <v-icon small color="grey"> mdi-plus </v-icon> --> <div class="flex gap-1 align-center">
<MdiAddIcon />
<!-- Add Sort Option --> <!-- Add Sort Option -->
{{ $t('activity.addSort') }} {{ $t('activity.addSort') }}
</v-btn>
</div> </div>
</v-menu> </a-button>
</div>
</template>
</a-dropdown>
</template> </template>
<style scoped> <style scoped>

Loading…
Cancel
Save