Skip to content

Commit caf9055

Browse files
authored
Merge pull request #262 from devforth/AdminForth/713
feat: Add unique selector to the afcl table
2 parents e8d7679 + 6ad6ff5 commit caf9055

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

adminforth/spa/src/afcl/Table.vue

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<template>
22

3-
<div class="relative overflow-x-auto shadow-md sm:rounded-lg">
4-
<table class="w-full text-sm text-left rtl:text-right text-gray-500 dark:text-gray-400">
5-
<thead class="text-xs text-gray-700 uppercase bg-gray-50 dark:bg-gray-700 dark:text-gray-400">
3+
<div class="afcl-table-container relative overflow-x-auto shadow-md sm:rounded-lg">
4+
<table class="afcl-table w-full text-sm text-left rtl:text-right text-gray-500 dark:text-gray-400">
5+
<thead class="afcl-table-thread text-xs text-gray-700 uppercase bg-gray-50 dark:bg-gray-700 dark:text-gray-400">
66
<tr>
77
<th scope="col" class="px-6 py-3"
88
v-for="column in columns"
@@ -19,7 +19,7 @@
1919
<tr
2020
v-for="(item, index) in dataPage"
2121
:class="{
22-
'odd:bg-white odd:dark:bg-gray-900 even:bg-gray-50 even:dark:bg-gray-800': evenHighlights,
22+
'afcl-table-body odd:bg-white odd:dark:bg-gray-900 even:bg-gray-50 even:dark:bg-gray-800': evenHighlights,
2323
'border-b dark:border-gray-700': index !== dataPage.length - 1 || totalPages > 1,
2424
}"
2525
>
@@ -38,24 +38,24 @@
3838
</tr>
3939
</tbody>
4040
</table>
41-
<nav class="flex items-center flex-column flex-wrap md:flex-row justify-between p-4"
41+
<nav class="afcl-table-pagination-container flex items-center flex-column flex-wrap md:flex-row justify-between p-4"
4242
v-if="totalPages > 1"
4343
:aria-label="$t('Table navigation')">
4444
<i18n-t
45-
keypath="Showing {from} to {to} of {total}" tag="span" class="text-sm font-normal text-gray-500 dark:text-gray-400 mb-4 md:mb-0 block w-full md:inline md:w-auto"
45+
keypath="Showing {from} to {to} of {total}" tag="span" class="afcl-table-pagination-text text-sm font-normal text-gray-500 dark:text-gray-400 mb-4 md:mb-0 block w-full md:inline md:w-auto"
4646
>
4747
<template #from><span class="font-semibold text-gray-900 dark:text-white">{{ Math.min((currentPage - 1) * props.pageSize + 1, props.data.length) }}</span></template>
4848
<template #to><span class="font-semibold text-gray-900 dark:text-white">{{ Math.min(currentPage * props.pageSize, props.data.length) }}</span></template>
4949
<template #total><span class="font-semibold text-gray-900 dark:text-white">{{ props.data.length }}</span></template>
5050
</i18n-t>
5151

52-
<ul class="inline-flex -space-x-px rtl:space-x-reverse text-sm h-8">
52+
<ul class="afcl-table-pagination-list inline-flex -space-x-px rtl:space-x-reverse text-sm h-8">
5353
<li v-for="page in totalPages" :key="page">
5454
<a href="#"
5555
@click.prevent="switchPage(page)"
5656
:aria-current="page === page ? 'page' : undefined"
5757
:class='{
58-
"text-blue-600 bg-lightPrimary text-lightPrimaryContrast dark:bg-darkPrimary dark:text-darkPrimaryContrast hover:opacity-90": page === currentPage,
58+
"afcl-table-pagination-button text-blue-600 bg-lightPrimary text-lightPrimaryContrast dark:bg-darkPrimary dark:text-darkPrimaryContrast hover:opacity-90": page === currentPage,
5959
"text-gray-500 border bg-white border-gray-300 hover:bg-gray-100 hover:text-gray-700 dark:bg-gray-800 dark:border-gray-700 dark:text-gray-400 dark:hover:bg-gray-700 dark:hover:text-white": page !== currentPage,
6060
"rounded-s-lg ms-0": page === 1,
6161
"rounded-e-lg": page === totalPages,

0 commit comments

Comments
 (0)