@kikiloaw/simple-table 1.0.6 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -0
- package/package.json +1 -1
- package/src/SimpleTable.vue +12 -2
- package/src/components/table/TableCell.vue +1 -0
package/README.md
CHANGED
|
@@ -6,6 +6,8 @@
|
|
|
6
6
|
[](https://vuejs.org/)
|
|
7
7
|
[](https://www.typescriptlang.org/)
|
|
8
8
|
|
|
9
|
+
> **🚀 Explore the Demo**: Check out the [SimpleTable Demo Repository](https://github.com/kikiloaw/simple-table-demo.git) for a complete documentation site with live server-side examples, seeding, and source code.
|
|
10
|
+
|
|
9
11
|
---
|
|
10
12
|
|
|
11
13
|
## ✨ Why SimpleTable?
|
package/package.json
CHANGED
package/src/SimpleTable.vue
CHANGED
|
@@ -67,6 +67,8 @@ const props = withDefaults(defineProps<Props>(), {
|
|
|
67
67
|
hoverColor: 'hover:bg-stone-200'
|
|
68
68
|
})
|
|
69
69
|
|
|
70
|
+
|
|
71
|
+
|
|
70
72
|
// ...
|
|
71
73
|
|
|
72
74
|
// -- Computed: Page Sizes Normalization --
|
|
@@ -163,7 +165,7 @@ const densityConfig = computed(() => {
|
|
|
163
165
|
</div>
|
|
164
166
|
*/
|
|
165
167
|
|
|
166
|
-
const emit = defineEmits(['update:search', 'update:sort', 'page-change'])
|
|
168
|
+
const emit = defineEmits(['update:search', 'update:sort', 'page-change', 'fetched'])
|
|
167
169
|
|
|
168
170
|
// -- State --
|
|
169
171
|
const searchQuery = ref('')
|
|
@@ -464,6 +466,7 @@ async function fetchData(params: any = {}) {
|
|
|
464
466
|
}
|
|
465
467
|
|
|
466
468
|
internalData.value = data
|
|
469
|
+
emit('fetched', data)
|
|
467
470
|
|
|
468
471
|
// Store in cache if enabled
|
|
469
472
|
if (props.enableCache) {
|
|
@@ -644,6 +647,8 @@ defineExpose({
|
|
|
644
647
|
clearCache // expose cache clearing method
|
|
645
648
|
})
|
|
646
649
|
|
|
650
|
+
|
|
651
|
+
|
|
647
652
|
// -- Helper Styles --
|
|
648
653
|
function getCellClass(col: any, index: number, totalCols: number, rowIndex: number = -1) {
|
|
649
654
|
let classes = col.class || ''
|
|
@@ -799,7 +804,12 @@ function getCellStyle(col: any) {
|
|
|
799
804
|
<!-- Group Header Row: Single cell spanning all columns -->
|
|
800
805
|
<template v-if="row._isGroupHeader">
|
|
801
806
|
<TableCell :colspan="columns.length" class="border-b border-gray-200">
|
|
802
|
-
<div :class="[
|
|
807
|
+
<div :class="[
|
|
808
|
+
'px-2',
|
|
809
|
+
densityConfig.groupHeaderPadding,
|
|
810
|
+
'font-semibold text-sm uppercase tracking-wide',
|
|
811
|
+
row._groupTitleClass || 'text-gray-700'
|
|
812
|
+
]">
|
|
803
813
|
{{ row._groupTitle }}
|
|
804
814
|
</div>
|
|
805
815
|
</TableCell>
|