@unsource/ui 2.7.2 → 2.7.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 +1 -1
- package/dist/runtime/components/UnTable.d.vue.ts +13 -12
- package/dist/runtime/components/UnTable.vue +9 -3
- package/dist/runtime/components/UnTable.vue.d.ts +13 -12
- package/dist/runtime/components/UnTableRow.d.vue.ts +2 -1
- package/dist/runtime/components/UnTableRow.vue +1 -1
- package/dist/runtime/components/UnTableRow.vue.d.ts +2 -1
- package/package.json +1 -1
package/dist/module.json
CHANGED
|
@@ -1,16 +1,17 @@
|
|
|
1
|
+
export type TableCol = {
|
|
2
|
+
title: string;
|
|
3
|
+
handler: () => string;
|
|
4
|
+
name: string;
|
|
5
|
+
disabled?: boolean;
|
|
6
|
+
key?: string | string[];
|
|
7
|
+
subKey?: string | string[];
|
|
8
|
+
class?: string;
|
|
9
|
+
dir?: string;
|
|
10
|
+
isDesktop?: boolean;
|
|
11
|
+
isMobile?: boolean;
|
|
12
|
+
};
|
|
1
13
|
type __VLS_Props = {
|
|
2
|
-
cols?:
|
|
3
|
-
title: string;
|
|
4
|
-
handler: string;
|
|
5
|
-
name: string;
|
|
6
|
-
disabled?: boolean;
|
|
7
|
-
key?: string | string[];
|
|
8
|
-
subKey?: string | string[];
|
|
9
|
-
class?: string;
|
|
10
|
-
dir?: string;
|
|
11
|
-
isDesktop?: boolean;
|
|
12
|
-
isMobile?: boolean;
|
|
13
|
-
}[];
|
|
14
|
+
cols?: TableCol[];
|
|
14
15
|
items?: Record<string, unknown>[];
|
|
15
16
|
thClass?: string;
|
|
16
17
|
tdClass?: string;
|
|
@@ -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,7 +59,10 @@
|
|
|
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>
|
|
@@ -87,7 +93,7 @@
|
|
|
87
93
|
</template>
|
|
88
94
|
|
|
89
95
|
<script setup>
|
|
90
|
-
import { _at
|
|
96
|
+
import { _at } from "#imports";
|
|
91
97
|
const { 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 },
|
|
@@ -1,16 +1,17 @@
|
|
|
1
|
+
export type TableCol = {
|
|
2
|
+
title: string;
|
|
3
|
+
handler: () => string;
|
|
4
|
+
name: string;
|
|
5
|
+
disabled?: boolean;
|
|
6
|
+
key?: string | string[];
|
|
7
|
+
subKey?: string | string[];
|
|
8
|
+
class?: string;
|
|
9
|
+
dir?: string;
|
|
10
|
+
isDesktop?: boolean;
|
|
11
|
+
isMobile?: boolean;
|
|
12
|
+
};
|
|
1
13
|
type __VLS_Props = {
|
|
2
|
-
cols?:
|
|
3
|
-
title: string;
|
|
4
|
-
handler: string;
|
|
5
|
-
name: string;
|
|
6
|
-
disabled?: boolean;
|
|
7
|
-
key?: string | string[];
|
|
8
|
-
subKey?: string | string[];
|
|
9
|
-
class?: string;
|
|
10
|
-
dir?: string;
|
|
11
|
-
isDesktop?: boolean;
|
|
12
|
-
isMobile?: boolean;
|
|
13
|
-
}[];
|
|
14
|
+
cols?: TableCol[];
|
|
14
15
|
items?: Record<string, unknown>[];
|
|
15
16
|
thClass?: string;
|
|
16
17
|
tdClass?: string;
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
>
|
|
34
34
|
<div class="flex flex-col gap-0.5">
|
|
35
35
|
<p :class="textClass">
|
|
36
|
-
{{
|
|
36
|
+
{{ col.handler ? col.handler(_at(item, col.key), item, col, items, cols) : _at(item, col.key).join(" ") }}
|
|
37
37
|
</p>
|
|
38
38
|
<small
|
|
39
39
|
v-if="col.subKey?.length"
|