@wishbone-media/spark 0.23.1 → 0.25.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/dist/index.css +1 -1
- package/dist/index.js +924 -900
- package/formkit.config.js +4 -2
- package/formkit.theme.mjs +101 -97
- package/package.json +1 -1
- package/src/assets/css/spark-table.css +8 -0
- package/src/components/SparkButton.vue +5 -5
- package/src/components/SparkCard.vue +1 -1
- package/src/components/SparkTable.vue +16 -2
- package/src/components/plugins/SparkTableFilterButtons.vue +1 -0
- package/src/components/plugins/SparkTableReset.vue +1 -0
- package/src/plugins/fontawesome.js +2 -0
package/package.json
CHANGED
|
@@ -9,6 +9,14 @@
|
|
|
9
9
|
--ht-header-highlighted-background-color: transparent;
|
|
10
10
|
}
|
|
11
11
|
|
|
12
|
+
.spark-table .handsontable td.current:not(.spark-table-cell-actions) {
|
|
13
|
+
@apply relative;
|
|
14
|
+
|
|
15
|
+
&::before {
|
|
16
|
+
@apply absolute opacity-[0.14] content-[''] inset-0 bg-[var(--ht-cell-selection-background-color,#1a42e8)] pointer-events-none;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
12
20
|
.spark-table .handsontable tr.ht__row_odd:hover td,
|
|
13
21
|
.spark-table .handsontable tr.ht__row_even:hover td {
|
|
14
22
|
@apply !bg-gray-100;
|
|
@@ -93,23 +93,23 @@ const computedButtonClass = computed(() => {
|
|
|
93
93
|
|
|
94
94
|
switch (props.size) {
|
|
95
95
|
case 'xs':
|
|
96
|
-
classes += ' px-
|
|
96
|
+
classes += ' px-4 py-1 text-xs'
|
|
97
97
|
roundingSize = 'sm'
|
|
98
98
|
break
|
|
99
99
|
case 'sm':
|
|
100
|
-
classes += ' px-
|
|
100
|
+
classes += ' px-4 py-1 text-sm'
|
|
101
101
|
roundingSize = 'sm'
|
|
102
102
|
break
|
|
103
103
|
case 'md':
|
|
104
|
-
classes += ' px-
|
|
104
|
+
classes += ' px-5 py-1.5 text-sm'
|
|
105
105
|
roundingSize = 'md'
|
|
106
106
|
break
|
|
107
107
|
case 'lg':
|
|
108
|
-
classes += ' px-
|
|
108
|
+
classes += ' px-6 py-2 text-sm'
|
|
109
109
|
roundingSize = 'md'
|
|
110
110
|
break
|
|
111
111
|
case 'xl':
|
|
112
|
-
classes += ' px-
|
|
112
|
+
classes += ' px-7 py-2.5 min-h-[42px] text-sm'
|
|
113
113
|
roundingSize = 'md'
|
|
114
114
|
break
|
|
115
115
|
}
|
|
@@ -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,
|