@smurfox/proxy-ui 0.4.3 → 0.4.4
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/module.json
CHANGED
|
@@ -33,12 +33,13 @@
|
|
|
33
33
|
<motion.tr
|
|
34
34
|
v-for="item in items"
|
|
35
35
|
:key="item.id"
|
|
36
|
+
:data-row-id="item.id"
|
|
36
37
|
:while-hover="props.isSelectable ? { scale: 1.01 } : {}"
|
|
37
38
|
:transition="{ type: 'spring', stiffness: 400, damping: 30 }"
|
|
38
39
|
:class="
|
|
39
40
|
props.isSelectable ? 'cursor-pointer hover:bg-gray-100 dark:hover:bg-[#1C2026]' : ''
|
|
40
41
|
"
|
|
41
|
-
@click="
|
|
42
|
+
@click="onRowClick"
|
|
42
43
|
>
|
|
43
44
|
<td
|
|
44
45
|
v-for="column in columns"
|
|
@@ -93,13 +94,14 @@
|
|
|
93
94
|
<motion.div
|
|
94
95
|
v-for="item in items"
|
|
95
96
|
:key="item.id"
|
|
97
|
+
:data-row-id="item.id"
|
|
96
98
|
:while-hover="props.isSelectable ? { y: -3 } : {}"
|
|
97
99
|
:transition="{ type: 'spring', stiffness: 400, damping: 25 }"
|
|
98
100
|
class="bg-white dark:bg-[#18181B] border border-gray-200 dark:border-white/10 rounded-lg p-4 shadow-sm"
|
|
99
101
|
:class="
|
|
100
102
|
props.isSelectable ? 'cursor-pointer hover:bg-gray-50 dark:hover:bg-white/5 hover:shadow-md' : ''
|
|
101
103
|
"
|
|
102
|
-
@click="
|
|
104
|
+
@click="onRowClick"
|
|
103
105
|
>
|
|
104
106
|
<slot
|
|
105
107
|
name="mobile-card"
|
|
@@ -242,6 +244,14 @@ const emit = defineEmits(["row-click"]);
|
|
|
242
244
|
function getCellValue(item, key) {
|
|
243
245
|
return item[key];
|
|
244
246
|
}
|
|
247
|
+
function onRowClick(event) {
|
|
248
|
+
if (!props.isSelectable) return;
|
|
249
|
+
const el = event.currentTarget;
|
|
250
|
+
const id = el?.dataset.rowId;
|
|
251
|
+
if (id == null) return;
|
|
252
|
+
const item = props.items.find((i) => String(i.id) === id);
|
|
253
|
+
if (item) emit("row-click", item);
|
|
254
|
+
}
|
|
245
255
|
</script>
|
|
246
256
|
|
|
247
257
|
<style scoped>
|