Skip to content

Commit

Permalink
fix hideHeader/hideFooter?
Browse files Browse the repository at this point in the history
  • Loading branch information
francisashley committed Jan 5, 2025
1 parent 19815a2 commit dd82bc5
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 20 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "vue-screener",
"version": "0.15.19",
"version": "0.15.20",
"type": "module",
"description": "Easily search and filter data in Vue3.",
"author": "Francis Ashley",
Expand Down
44 changes: 25 additions & 19 deletions src/components/VueScreener.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<section :class="twMerge('vs-screener vsc-font-sans vsc-text-sm vsc-flex vsc-flex-col vsc-gap-2',props.class)" ref="screenerRef"> <!-- eslint-disable-line -->
<slot name="header" :screener="internalScreener">
<div class="vsc-flex vsc-justify-between vsc-items-center" v-if="includeHeader !== false">
<div class="vsc-flex vsc-justify-between vsc-items-center" v-if="includeHeader">
<h3 v-if="title" class="vsc-font-normal vsc-text-base vsc-mb-0 vsc-text-zinc-300">
{{ title }}
</h3>
Expand Down Expand Up @@ -31,7 +31,7 @@
</VueScreenerViewport>
</slot>
<slot name="footer" :screener="internalScreener">
<VueScreenerPagination :screener="internalScreener" v-if="includeFooter !== false" />
<VueScreenerPagination :screener="internalScreener" v-if="includeFooter" />
</slot>
</section>
</template>
Expand All @@ -46,23 +46,29 @@ import VueScreenerSearch from '../components/search/VueScreenerSearch.vue'
import { useVueScreener } from '../hooks/use-vue-screener'
import { twMerge } from 'tailwind-merge'
const props = defineProps<{
screener?: IVueScreener
data?: any[]
class?: string
// options
contentHeight?: string
defaultCurrentPage?: number
defaultRowsPerPage?: number
defaultSortField?: string
defaultSortDirection?: 'asc' | 'desc'
columns?: Record<PropertyKey, Partial<Column>>
disableSearchHighlight?: boolean
loading?: boolean
title?: string
includeHeader?: boolean
includeFooter?: boolean
}>()
const props = withDefaults(
defineProps<{
screener?: IVueScreener
data?: any[]
class?: string
// options
contentHeight?: string
defaultCurrentPage?: number
defaultRowsPerPage?: number
defaultSortField?: string
defaultSortDirection?: 'asc' | 'desc'
columns?: Record<PropertyKey, Partial<Column>>
disableSearchHighlight?: boolean
loading?: boolean
title?: string
includeHeader?: boolean
includeFooter?: boolean
}>(),
{
includeHeader: true,
includeFooter: true,
},
)
const internalScreener = computed(
() =>
Expand Down

0 comments on commit dd82bc5

Please sign in to comment.