99 'vsc-inline-flex vsc-bg-[#1f1f22] vsc-items-center vsc-font-bold vsc-whitespace-nowrap vsc-h-8 vsc-gap-2 vsc-text-xs last:vsc-border-r-0',
1010 props.class,
1111 ),
12- isSortable && twMerge('vsc-inline-flex vsc-items-center vsc-gap-2 vsc-cursor-pointer', props.sortableClass),
13- Boolean(column.isSortable && getSortDirection(column.field)) && props.sortingClass,
1412 ]"
15- @click =" handleClickColumnHeader(column)"
1613 >
17- <SortIcon v-if =" column.isSortable && getSortDirection(column.field)" :direction =" getSortDirection(column.field)" />
18- <slot >{{ text }}</slot >
19- <Icon v-if =" column.info" icon =" codicon:info" class =" vsc-ml-auto vsc-min-w-3 vsc-min-h-3" v-tooltip =" column.info" />
14+ <VueScreenerTableHeadRenderer
15+ :screener =" screener"
16+ :column =" column"
17+ :sortable-class =" sortableClass"
18+ :sorting-class =" sortingClass"
19+ :text =" text"
20+ />
2021 </VueScreenerTableCell >
2122</template >
2223
2324<script lang="ts" setup>
24- import { computed , HTMLAttributes } from ' vue'
25+ import { HTMLAttributes } from ' vue'
2526import type { IVueScreener , Column } from ' ../../interfaces/vue-screener'
2627import VueScreenerTableCell from ' ../table/VueScreenerTableCell.vue'
27- import SortIcon from ' ../icons/SortIcon .vue'
28+ import VueScreenerTableHeadRenderer from ' ../renderers/VueScreenerHeadRenderer .vue'
2829import { twMerge } from ' ../../utils/tailwind-merge.utils'
29- import { Icon } from ' @iconify/vue'
30- import { vTooltip } from ' floating-vue'
31- import ' floating-vue/dist/style.css'
3230
3331const props = defineProps <{
3432 screener: IVueScreener
@@ -38,25 +36,4 @@ const props = defineProps<{
3836 text? : string | number
3937 class? : HTMLAttributes [' class' ]
4038}>()
41-
42- const isSortable = computed (() => props .column .isSortable )
43-
44- const getSortDirection = (field : string | number ): ' asc' | ' desc' | null => {
45- if (props .screener .searchQuery .value .sortField === field ) {
46- return props .screener .searchQuery .value .sortDirection
47- }
48- return null
49- }
50-
51- const handleClickColumnHeader = (column : Column ) => {
52- if (column .isSortable ) {
53- props .screener .actions .sort (column .field )
54- }
55- }
5639 </script >
57-
58- <style >
59- .v-popper__popper {
60- @apply vsc-text-xs ;
61- }
62- </style >
0 commit comments