@veritree/ui 0.16.6 → 0.17.0
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/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
<template>
|
|
2
|
+
<!-- :href="href" -->
|
|
2
3
|
<component
|
|
3
4
|
:is="tag"
|
|
4
5
|
:to="to"
|
|
5
|
-
:href="href"
|
|
6
6
|
:type="type"
|
|
7
7
|
:disabled="isDisabled"
|
|
8
8
|
:class="[
|
|
@@ -72,10 +72,6 @@ export default {
|
|
|
72
72
|
type: [String, Object],
|
|
73
73
|
default: null,
|
|
74
74
|
},
|
|
75
|
-
href: {
|
|
76
|
-
type: [String],
|
|
77
|
-
default: null,
|
|
78
|
-
},
|
|
79
75
|
headless: {
|
|
80
76
|
type: Boolean,
|
|
81
77
|
default: false,
|
|
@@ -120,7 +116,7 @@ export default {
|
|
|
120
116
|
},
|
|
121
117
|
|
|
122
118
|
tag() {
|
|
123
|
-
return this.
|
|
119
|
+
return this.$attrs.href ? 'a' : this.to ? 'NuxtLink' : 'button';
|
|
124
120
|
},
|
|
125
121
|
|
|
126
122
|
type() {
|
|
@@ -3,6 +3,19 @@
|
|
|
3
3
|
:id="id"
|
|
4
4
|
:aria-selected="selected"
|
|
5
5
|
:aria-controls="`tabpanel-${index}`"
|
|
6
|
+
:class="[
|
|
7
|
+
headless
|
|
8
|
+
? 'tab-list__button'
|
|
9
|
+
: 'flex items-center rounded-none border-0 border-b-2 border-solid bg-none px-0 py-2 font-semibold',
|
|
10
|
+
selected
|
|
11
|
+
? headless
|
|
12
|
+
? 'tab-list__button--selected'
|
|
13
|
+
: 'border-secondary-400 text-secondary-400'
|
|
14
|
+
: // not selected
|
|
15
|
+
headless
|
|
16
|
+
? null
|
|
17
|
+
: 'border-transparent text-gray-500',
|
|
18
|
+
]"
|
|
6
19
|
role="tab"
|
|
7
20
|
type="button"
|
|
8
21
|
@click.stop="onClick"
|
|
@@ -14,12 +27,19 @@
|
|
|
14
27
|
</template>
|
|
15
28
|
|
|
16
29
|
<script>
|
|
17
|
-
import { keys } from
|
|
30
|
+
import { keys } from '../../utils/keyboard';
|
|
18
31
|
|
|
19
32
|
export default {
|
|
20
|
-
name:
|
|
33
|
+
name: 'VTTabItem',
|
|
21
34
|
|
|
22
|
-
inject: [
|
|
35
|
+
inject: ['api'],
|
|
36
|
+
|
|
37
|
+
props: {
|
|
38
|
+
headless: {
|
|
39
|
+
type: Boolean,
|
|
40
|
+
default: false,
|
|
41
|
+
},
|
|
42
|
+
},
|
|
23
43
|
|
|
24
44
|
data() {
|
|
25
45
|
return {
|
|
@@ -85,7 +105,7 @@ export default {
|
|
|
85
105
|
|
|
86
106
|
onClick() {
|
|
87
107
|
this.api.selectTab(this.index);
|
|
88
|
-
this.$emit(
|
|
108
|
+
this.$emit('change');
|
|
89
109
|
},
|
|
90
110
|
|
|
91
111
|
onKeyDown(event) {
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div
|
|
2
|
+
<div
|
|
3
|
+
role="tablist"
|
|
4
|
+
:class="[headless ? 'tab-list' : 'flex items-center gap-4']"
|
|
5
|
+
>
|
|
3
6
|
<slot></slot>
|
|
4
7
|
</div>
|
|
5
8
|
</template>
|
|
@@ -7,5 +10,12 @@
|
|
|
7
10
|
<script>
|
|
8
11
|
export default {
|
|
9
12
|
name: 'VTTabList',
|
|
13
|
+
|
|
14
|
+
props: {
|
|
15
|
+
headless: {
|
|
16
|
+
type: Boolean,
|
|
17
|
+
default: false,
|
|
18
|
+
},
|
|
19
|
+
},
|
|
10
20
|
};
|
|
11
21
|
</script>
|