|
|
@@ -163,9 +181,12 @@ const props = defineProps({
sortOrder: { type: String, default: '' },
tableClass: {
type: String,
- default: 'min-w-full divide-y divide-gray-200',
+ default: 'min-w-full divide-y divide-gray-200 dark:divide-gray-600',
+ },
+ theadClass: {
+ type: String,
+ default: 'bg-gray-50 dark:bg-gray-800 dark:text-white',
},
- theadClass: { type: String, default: 'bg-gray-50' },
tbodyClass: { type: String, default: '' },
noResultsMessage: {
type: String,
@@ -186,6 +207,10 @@ const props = defineProps({
type: Number,
default: 3,
},
+ darkHighlight: {
+ type: Boolean,
+ default: false,
+ },
})
let rows = reactive([])
@@ -236,7 +261,7 @@ function getColumn(columnName) {
function getThClass(column) {
let classes =
- 'whitespace-nowrap px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider'
+ 'whitespace-nowrap px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider dark:text-white'
if (column.defaultThClass) {
classes = column.defaultThClass
@@ -256,7 +281,8 @@ function getThClass(column) {
}
function getTdClass(column) {
- let classes = 'px-6 py-4 text-sm text-gray-500 whitespace-nowrap'
+ let classes =
+ 'px-6 py-4 text-sm text-gray-500 whitespace-nowrap dark:text-gray-300'
if (column.defaultTdClass) {
classes = column.defaultTdClass
@@ -309,6 +335,7 @@ function changeSorting(column) {
}
if (!usesLocalData.value) {
+ if (pagination.value) pagination.value.currentPage = 1
mapDataToRows()
}
}
@@ -326,7 +353,9 @@ async function pageChange(page) {
await mapDataToRows()
}
-async function refresh() {
+async function refresh(isPreservePage = false) {
+ if (pagination.value && !isPreservePage) pagination.value.currentPage = 1
+
await mapDataToRows()
}
|