@unsource/ui 2.7.3 → 2.7.5
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
|
@@ -47,7 +47,10 @@
|
|
|
47
47
|
>
|
|
48
48
|
<thead>
|
|
49
49
|
<tr class="border-b-2 children:(text-center p-4) rounded-lg <md:children:p-1 ">
|
|
50
|
-
<th
|
|
50
|
+
<th
|
|
51
|
+
v-if="parentKey"
|
|
52
|
+
:class="[`w-${cols.length}`, thClass, 'sticky top-0']"
|
|
53
|
+
/>
|
|
51
54
|
<th
|
|
52
55
|
v-for="col in cols.filter((e) => !e.disabled)"
|
|
53
56
|
:key="col.name + '-th'"
|
|
@@ -56,12 +59,15 @@
|
|
|
56
59
|
>
|
|
57
60
|
{{ col.title }}
|
|
58
61
|
</th>
|
|
59
|
-
<th
|
|
62
|
+
<th
|
|
63
|
+
v-if="parentKey"
|
|
64
|
+
:class="[`w-${cols.length}`, thClass, 'sticky top-0']"
|
|
65
|
+
/>
|
|
60
66
|
</tr>
|
|
61
67
|
</thead>
|
|
62
68
|
<tbody>
|
|
63
69
|
<UnTableRow
|
|
64
|
-
v-for="(item, index) in items?.filter((e) => !parentKey ||
|
|
70
|
+
v-for="(item, index) in items?.filter((e) => !parentKey || parentNotExist(e))"
|
|
65
71
|
:key="index"
|
|
66
72
|
v-model="selected"
|
|
67
73
|
:item="item"
|
|
@@ -88,7 +94,7 @@
|
|
|
88
94
|
|
|
89
95
|
<script setup>
|
|
90
96
|
import { _at } from "#imports";
|
|
91
|
-
const { cols = [], items = [], thClass = "bg-gray-100 border-gray-100", tdClass = "bg-gray-250", textClass = "text-gray-800 font-700 text-xs" } = defineProps({
|
|
97
|
+
const { parentKey, idKey, cols = [], items = [], thClass = "bg-gray-100 border-gray-100", tdClass = "bg-gray-250", textClass = "text-gray-800 font-700 text-xs" } = defineProps({
|
|
92
98
|
cols: { type: Array, required: false },
|
|
93
99
|
items: { type: Array, required: false },
|
|
94
100
|
thClass: { type: String, required: false },
|
|
@@ -100,4 +106,5 @@ const { cols = [], items = [], thClass = "bg-gray-100 border-gray-100", tdClass
|
|
|
100
106
|
selectable: { type: Boolean, required: false }
|
|
101
107
|
});
|
|
102
108
|
const selected = defineModel();
|
|
109
|
+
const parentNotExist = (item) => !item[parentKey] || !items.find((e) => e[idKey || "id"] === item[parentKey]);
|
|
103
110
|
</script>
|