@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
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "unsource-ui",
3
3
  "configKey": "unsourceUi",
4
- "version": "2.7.3",
4
+ "version": "2.7.5",
5
5
  "builder": {
6
6
  "@nuxt/module-builder": "1.0.2",
7
7
  "unbuild": "3.6.1"
@@ -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 v-if="parentKey" />
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 v-if="parentKey" />
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 || !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>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unsource/ui",
3
- "version": "2.7.3",
3
+ "version": "2.7.5",
4
4
  "private": false,
5
5
  "description": "nuxt ui kit for unsource env",
6
6
  "repository": "https://github.com/alisa2142/unsource-ui",