Skip to content

Commit d1e565b

Browse files
authored
Merge pull request #19 from BitTheCat/feat/table-paginator-size
removed size prop for css style
2 parents b8c3b29 + 5fe22f9 commit d1e565b

File tree

4 files changed

+20
-19
lines changed

4 files changed

+20
-19
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@bitthecat/tailwind-vue-data-table",
3-
"version": "0.2.7",
3+
"version": "0.2.8",
44
"keywords": [
55
"tailwindcss",
66
"customisable",

src/components/TVPagination.vue

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
viewBox="0 0 24 24"
88
stroke-width="1.5"
99
stroke="currentColor"
10-
:class="size === 'sm' ? 'w-3 h-3' : 'w-4 h-4'"
10+
class="tv-paginator-size"
1111
@click="changePage(1)"
1212
>
1313
<path stroke-linecap="round" stroke-linejoin="round" d="M18.75 19.5l-7.5-7.5 7.5-7.5m-6 15L5.25 12l7.5-7.5" />
@@ -20,7 +20,7 @@
2020
viewBox="0 0 24 24"
2121
stroke-width="1.5"
2222
stroke="currentColor"
23-
:class="size === 'sm' ? 'w-3 h-3' : 'w-4 h-4'"
23+
class="tv-paginator-size"
2424
@click="changePage(undefined, true)"
2525
>
2626
<path stroke-linecap="round" stroke-linejoin="round" d="M15.75 19.5L8.25 12l7.5-7.5" />
@@ -30,7 +30,7 @@
3030
<template v-for="page of pages" :key="`page_${page}`">
3131
<p
3232
class="font-medium leading-none cursor-pointer link px-2"
33-
:class="`${paginationClass(page)} ${size === 'sm' ? 'text-xs' : 'text-md'}`"
33+
:class="`${paginationClass(page)} tv-paginator-text`"
3434
@click="changePage(page)"
3535
>
3636
{{ page }}
@@ -44,7 +44,7 @@
4444
viewBox="0 0 24 24"
4545
stroke-width="1.5"
4646
stroke="currentColor"
47-
:class="size === 'sm' ? 'w-3 h-3' : 'w-4 h-4'"
47+
class="tv-paginator-size"
4848
@click="changePage(undefined)"
4949
>
5050
<path stroke-linecap="round" stroke-linejoin="round" d="M8.25 4.5l7.5 7.5-7.5 7.5" />
@@ -57,7 +57,7 @@
5757
viewBox="0 0 24 24"
5858
stroke-width="1.5"
5959
stroke="currentColor"
60-
:class="size === 'sm' ? 'w-3 h-3' : 'w-4 h-4'"
60+
class="tv-paginator-size"
6161
@click="changePage(totPages)"
6262
>
6363
<path stroke-linecap="round" stroke-linejoin="round" d="M11.25 4.5l7.5 7.5-7.5 7.5m-6-15l7.5 7.5-7.5 7.5" />
@@ -87,11 +87,6 @@ const props = defineProps({
8787
type: Number,
8888
default: 1
8989
},
90-
size: {
91-
type: String,
92-
default: 'md',
93-
validator: (value) => ['sm', 'md'].includes(value)
94-
}
9590
})
9691
const emit = defineEmits(['update:currentPage'])
9792

src/components/TVTable.vue

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<template>
22
<div v-if="!hidePagination && totalRows != 0 && !hideSummary && !busy" class="flex items-center justify-end mr-2 mb-2 text-body">
3-
<span :class="size === 'sm' ? 'text-xs' : 'text-md'">{{ getSummary() }}</span>
3+
<span class="tv-summary-size">{{ getSummary() }}</span>
44
</div>
55

66
<div class="overflow-auto">
@@ -144,7 +144,6 @@
144144
v-model:currentPage="localCurrentPage"
145145
:total-rows="localTotalRows"
146146
:per-page="perPage"
147-
:size="size"
148147
/>
149148
</template>
150149

@@ -208,11 +207,6 @@ const props = defineProps({
208207
type: String,
209208
default: 'Displaying _STR_FROM_ to _STR_TO_ of _STR_TOTAL_ items'
210209
},
211-
size: {
212-
type: String,
213-
default: 'md',
214-
validator: (value) => ['sm', 'md'].includes(value)
215-
}
216210
})
217211
218212
const emit = defineEmits([

src/css/app.css

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,21 @@
1919
}
2020

2121
.tv-td {
22-
@apply px-2 py-1.5 align-top table-cell last:border-b-0
22+
@apply px-2 py-3.5 align-top table-cell last:border-b-0 text-2xl md:text-sm
2323
}
2424

2525
.tv-tfoot {
2626
@apply text-xs bg-gray-300 border divide-x divide-y
27+
}
28+
29+
.tv-summary-size {
30+
@apply text-lg md:text-sm
31+
}
32+
33+
.tv-paginator-size {
34+
@apply w-6 h-6 md:w-4 md:h-4
35+
}
36+
37+
.tv-paginator-text {
38+
@apply text-lg md:text-sm
2739
}

0 commit comments

Comments
 (0)