@unsource/ui 2.7.4 → 2.7.6

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.4",
4
+ "version": "2.7.6",
5
5
  "builder": {
6
6
  "@nuxt/module-builder": "1.0.2",
7
7
  "unbuild": "3.6.1"
@@ -8,6 +8,7 @@ type __VLS_Props = {
8
8
  collapsible?: boolean;
9
9
  collapsibleIcon?: string;
10
10
  noRotate?: boolean;
11
+ to?: (a: CardItem) => string;
11
12
  };
12
13
  type __VLS_ModelProps = {
13
14
  'show'?: boolean;
@@ -22,6 +22,7 @@
22
22
  :class="customClass.items"
23
23
  :custom-class="customClass.item"
24
24
  :item="item"
25
+ :to="to?.(item)"
25
26
  />
26
27
  </div>
27
28
  </template>
@@ -33,7 +34,8 @@ const { customClass = {}, collapsible = false } = defineProps({
33
34
  customClass: { type: Object, required: false },
34
35
  collapsible: { type: Boolean, required: false },
35
36
  collapsibleIcon: { type: String, required: false },
36
- noRotate: { type: Boolean, required: false }
37
+ noRotate: { type: Boolean, required: false },
38
+ to: { type: Function, required: false }
37
39
  });
38
40
  const show = defineModel("show", { type: Boolean });
39
41
  show.value ||= !collapsible;
@@ -8,6 +8,7 @@ type __VLS_Props = {
8
8
  collapsible?: boolean;
9
9
  collapsibleIcon?: string;
10
10
  noRotate?: boolean;
11
+ to?: (a: CardItem) => string;
11
12
  };
12
13
  type __VLS_ModelProps = {
13
14
  'show'?: boolean;
@@ -67,7 +67,7 @@
67
67
  </thead>
68
68
  <tbody>
69
69
  <UnTableRow
70
- v-for="(item, index) in items?.filter((e) => !parentKey || !e[parentKey])"
70
+ v-for="(item, index) in items?.filter((e) => !parentKey || parentNotExist(e))"
71
71
  :key="index"
72
72
  v-model="selected"
73
73
  :item="item"
@@ -94,7 +94,7 @@
94
94
 
95
95
  <script setup>
96
96
  import { _at } from "#imports";
97
- 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({
98
98
  cols: { type: Array, required: false },
99
99
  items: { type: Array, required: false },
100
100
  thClass: { type: String, required: false },
@@ -106,4 +106,5 @@ const { cols = [], items = [], thClass = "bg-gray-100 border-gray-100", tdClass
106
106
  selectable: { type: Boolean, required: false }
107
107
  });
108
108
  const selected = defineModel();
109
+ const parentNotExist = (item) => !item[parentKey] || !items.find((e) => e[idKey || "id"] === item[parentKey]);
109
110
  </script>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unsource/ui",
3
- "version": "2.7.4",
3
+ "version": "2.7.6",
4
4
  "private": false,
5
5
  "description": "nuxt ui kit for unsource env",
6
6
  "repository": "https://github.com/alisa2142/unsource-ui",