|
|
@ -1,14 +1,16 @@ |
|
|
|
<script lang="ts" setup> |
|
|
|
<script lang="ts" setup> |
|
|
|
import { useProvideSmartsheetStore, useSmartsheetStoreOrThrow } from '~/composables/useSmartsheetStore' |
|
|
|
import { computed, inject, ref, useArrayMap, useSmartsheetStoreOrThrow } from '#imports' |
|
|
|
import { MetaInj, ReloadViewDataHookInj } from '~/context' |
|
|
|
import { ReloadViewDataHookInj } from '~/context' |
|
|
|
import MdiSearchIcon from '~icons/mdi/magnify' |
|
|
|
|
|
|
|
import MdiMenuDownIcon from '~icons/mdi/menu-down' |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const reloadData = inject(ReloadViewDataHookInj) |
|
|
|
const reloadData = inject(ReloadViewDataHookInj)! |
|
|
|
const { search, meta } = useSmartsheetStoreOrThrow() |
|
|
|
|
|
|
|
|
|
|
|
const { search, meta } = useSmartsheetStoreOrThrow()! |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// todo: where is this value supposed to come from? it's not in the store |
|
|
|
|
|
|
|
const isDropdownOpen = ref(false) |
|
|
|
|
|
|
|
|
|
|
|
const columns = computed(() => |
|
|
|
const columns = computed(() => |
|
|
|
meta?.value?.columns?.map((c) => ({ |
|
|
|
meta.value.columns?.map((c) => ({ |
|
|
|
value: c.id, |
|
|
|
value: c.id, |
|
|
|
label: c.title, |
|
|
|
label: c.title, |
|
|
|
})), |
|
|
|
})), |
|
|
@ -21,12 +23,13 @@ const columns = computed(() => |
|
|
|
size="small" |
|
|
|
size="small" |
|
|
|
class="max-w-[200px]" |
|
|
|
class="max-w-[200px]" |
|
|
|
placeholder="Filter query" |
|
|
|
placeholder="Filter query" |
|
|
|
@press-enter="reloadData.trigger()" |
|
|
|
@press-enter="reloadData.trigger(null)" |
|
|
|
> |
|
|
|
> |
|
|
|
<template #addonBefore> |
|
|
|
<template #addonBefore> |
|
|
|
<div class="flex align-center relative" @click="isDropdownOpen = true"> |
|
|
|
<div class="flex align-center relative" @click="isDropdownOpen = true"> |
|
|
|
<MdiSearchIcon class="text-grey" /> |
|
|
|
<MdiMagnify class="text-grey" /> |
|
|
|
<MdiMenuDownIcon class="text-grey" /> |
|
|
|
<MdiMenuDown class="text-grey" /> |
|
|
|
|
|
|
|
|
|
|
|
<a-select |
|
|
|
<a-select |
|
|
|
v-model:value="search.field" |
|
|
|
v-model:value="search.field" |
|
|
|
size="small" |
|
|
|
size="small" |
|
|
@ -39,5 +42,3 @@ const columns = computed(() => |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
</a-input> |
|
|
|
</a-input> |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
|
|
|
|
|
|
|
|
<style scoped></style> |
|
|
|
|
|
|
|