@wishbone-media/spark 0.23.0 → 0.24.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wishbone-media/spark",
3
- "version": "0.23.0",
3
+ "version": "0.24.0",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",
@@ -13,7 +13,7 @@
13
13
  @apply relative;
14
14
 
15
15
  &::before {
16
- @apply absolute opacity-[0.14] content-[''] inset-0 bg-[var(--ht-cell-selection-background-color,#1a42e8)];
16
+ @apply absolute opacity-[0.14] content-[''] inset-0 bg-[var(--ht-cell-selection-background-color,#1a42e8)] pointer-events-none;
17
17
  }
18
18
  }
19
19
 
@@ -15,15 +15,23 @@
15
15
  <div v-else class="pt-5"></div>
16
16
 
17
17
  <!-- Table Grid -->
18
- <HotTable theme-name="ht-theme-classic" ref="table" :settings="sparkTable.tableSettings" />
18
+ <HotTable v-show="!isEmpty" theme-name="ht-theme-classic" ref="table" :settings="sparkTable.tableSettings" />
19
+
20
+ <!-- Empty State -->
21
+ <div v-if="isEmpty" class="flex flex-col items-center justify-center py-16 text-gray-500 rounded-md border border-gray-300 bg-white">
22
+ <font-awesome-icon :icon="Icons.farInbox" class="size-12 mb-4 text-gray-300" />
23
+ <p class="text-sm">No records found</p>
24
+ </div>
19
25
 
20
26
  <!-- Footer Toolbar: Pagination always on the right -->
21
27
  <spark-table-toolbar v-if="sparkTable.computed.ready" position="footer">
22
28
  <spark-table-pagination-details
29
+ v-if="!isEmpty"
23
30
  :spark-table="sparkTable"
24
31
  />
25
- <div class="flex items-center gap-x-3">
32
+ <div class="flex items-center gap-x-3 ml-auto">
26
33
  <spark-table-pagination-paging
34
+ v-if="!isEmpty"
27
35
  :spark-table="sparkTable"
28
36
  @paginate="sparkTable.methods.applyParams"
29
37
  />
@@ -85,6 +93,7 @@ import SparkTablePaginationPaging from './SparkTablePaginationPaging.vue'
85
93
  import SparkTablePaginationPerPage from './SparkTablePaginationPerPage.vue'
86
94
  import SparkTableToolbar from './SparkTableToolbar.vue'
87
95
  import { SparkTableSearch, SparkTableFilterSelect, SparkTableFilterButtons, SparkTableDatePicker, SparkTableReset } from './plugins'
96
+ import { Icons } from '@/plugins/fontawesome.js'
88
97
 
89
98
  const props = defineProps({
90
99
  url: {
@@ -383,6 +392,11 @@ const sparkTable = reactive({
383
392
  })),
384
393
  })
385
394
 
395
+ // Empty state detection - true when data has loaded but contains no records
396
+ const isEmpty = computed(() =>
397
+ sparkTable.computed.ready && sparkTable.response.data?.length === 0
398
+ )
399
+
386
400
  /**
387
401
  * Get the param key for a plugin based on its type and configuration
388
402
  */
@@ -42,6 +42,7 @@ import {
42
42
  faUndo,
43
43
  faBolt,
44
44
  faCloudDownload,
45
+ faInbox,
45
46
  } from '@fortawesome/pro-regular-svg-icons'
46
47
 
47
48
  import {
@@ -91,6 +92,7 @@ export const Icons = {
91
92
  farUndo: faUndo,
92
93
  farBolt: faBolt,
93
94
  farCloudDownload: faCloudDownload,
95
+ farInbox: faInbox,
94
96
 
95
97
  fadSort: faSortDuotone,
96
98
  fadSortDown: faSortDownDuotone,