@webitel/ui-sdk 2.1.26 → 2.1.28
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/ui-sdk.common.js +8 -8
- package/dist/ui-sdk.common.js.map +1 -1
- package/dist/ui-sdk.css +1 -1
- package/dist/ui-sdk.umd.js +8 -8
- package/dist/ui-sdk.umd.js.map +1 -1
- package/dist/ui-sdk.umd.min.js +1 -1
- package/dist/ui-sdk.umd.min.js.map +1 -1
- package/package.json +1 -1
- package/src/components/molecules/wt-tabs/wt-tabs.vue +74 -72
- package/src/css/components/molecules/wt-tabs/_variables.scss +2 -2
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<nav class="wt-tabs">
|
|
3
3
|
<button
|
|
4
|
-
|
|
4
|
+
v-for="(tab) in tabs"
|
|
5
|
+
:key="tab.value"
|
|
5
6
|
:class="{
|
|
6
7
|
'wt-tab--highlight': tab.value === current.value
|
|
7
8
|
}"
|
|
8
|
-
v-for="(tab) in tabs"
|
|
9
9
|
:value="tab.text"
|
|
10
|
-
|
|
10
|
+
class="wt-tab"
|
|
11
11
|
type="button"
|
|
12
12
|
@click="open(tab)"
|
|
13
13
|
>
|
|
@@ -18,98 +18,100 @@
|
|
|
18
18
|
|
|
19
19
|
<div class="wt-tabs__underline">
|
|
20
20
|
<div
|
|
21
|
-
class="wt-tab__underline--highlight"
|
|
22
21
|
:style="{
|
|
23
22
|
width: `${activeLineWidth}px`,
|
|
24
23
|
transform: `translateX(${activeLineOffset}px)`
|
|
25
24
|
}"
|
|
25
|
+
class="wt-tab__underline--highlight"
|
|
26
26
|
></div>
|
|
27
27
|
</div>
|
|
28
28
|
</nav>
|
|
29
29
|
</template>
|
|
30
30
|
|
|
31
31
|
<script>
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
},
|
|
39
|
-
tabs: {
|
|
40
|
-
type: Array,
|
|
41
|
-
default: () => [],
|
|
42
|
-
},
|
|
32
|
+
export default {
|
|
33
|
+
name: 'wt-tabs',
|
|
34
|
+
props: {
|
|
35
|
+
current: {
|
|
36
|
+
type: Object,
|
|
37
|
+
default: () => ({}),
|
|
43
38
|
},
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
event: 'change',
|
|
39
|
+
tabs: {
|
|
40
|
+
type: Array,
|
|
41
|
+
default: () => [],
|
|
48
42
|
},
|
|
43
|
+
},
|
|
49
44
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
45
|
+
model: {
|
|
46
|
+
prop: 'current',
|
|
47
|
+
event: 'change',
|
|
48
|
+
},
|
|
54
49
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
50
|
+
data: () => ({
|
|
51
|
+
activeLineWidth: 0,
|
|
52
|
+
activeLineOffset: 0,
|
|
53
|
+
}),
|
|
54
|
+
|
|
55
|
+
methods: {
|
|
56
|
+
open(value) {
|
|
57
|
+
this.$emit('change', value);
|
|
58
|
+
this.moveActiveLine(value);
|
|
59
|
+
},
|
|
60
60
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
},
|
|
61
|
+
moveActiveLine(newValue) {
|
|
62
|
+
if (!this.current) return;
|
|
63
|
+
if (!this.$refs || !this.$refs[newValue] || !this.$refs[newValue][0]) return;
|
|
64
|
+
const element = this.$refs[newValue][0];
|
|
65
|
+
this.activeLineWidth = element.clientWidth;
|
|
66
|
+
this.activeLineOffset = element.offsetLeft;
|
|
68
67
|
},
|
|
69
|
-
}
|
|
68
|
+
},
|
|
69
|
+
};
|
|
70
70
|
</script>
|
|
71
71
|
|
|
72
72
|
<style lang="scss" scoped>
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
73
|
+
.wt-tabs {
|
|
74
|
+
position: relative;
|
|
75
|
+
display: flex;
|
|
76
|
+
flex-wrap: nowrap;
|
|
77
|
+
gap: var(--tab-gap);
|
|
78
|
+
}
|
|
76
79
|
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
outline: none;
|
|
80
|
+
.wt-tab {
|
|
81
|
+
@extend %typo-body-1;
|
|
82
|
+
position: relative;
|
|
83
|
+
z-index: var(--tab-z-index);
|
|
84
|
+
display: inline-block;
|
|
85
|
+
padding-bottom: var(--tab-padding);
|
|
86
|
+
cursor: pointer;
|
|
87
|
+
transition: var(--transition);
|
|
88
|
+
color: var(--tab-color);
|
|
89
|
+
border: none;
|
|
90
|
+
border-bottom: var(--tab-border);
|
|
91
|
+
border-bottom-color: transparent;
|
|
92
|
+
outline: none;
|
|
93
|
+
background: transparent;
|
|
92
94
|
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
95
|
+
&:hover,
|
|
96
|
+
&:focus, {
|
|
97
|
+
color: var(--tab--hover-color);
|
|
98
|
+
border-bottom-color: var(--tab--active-border-color);
|
|
99
|
+
}
|
|
98
100
|
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
101
|
+
&.wt-tab--highlight {
|
|
102
|
+
color: var(--tab--active-color);
|
|
103
|
+
border-bottom-color: var(--tab--active-border-color);
|
|
104
|
+
}
|
|
103
105
|
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
}
|
|
106
|
+
//// disables bold font resize on hover
|
|
107
|
+
&:after {
|
|
108
|
+
display: block;
|
|
109
|
+
visibility: hidden;
|
|
110
|
+
overflow: hidden;
|
|
111
|
+
height: 0;
|
|
112
|
+
content: attr(value);
|
|
113
|
+
font-weight: bold;
|
|
113
114
|
}
|
|
115
|
+
}
|
|
114
116
|
|
|
115
117
|
</style>
|
|
@@ -4,11 +4,11 @@
|
|
|
4
4
|
--tabs-underiline-color: transparent;
|
|
5
5
|
|
|
6
6
|
--tab-padding: var(--spacing-2xs);
|
|
7
|
-
--tab-
|
|
7
|
+
--tab-gap: var(--spacing-2xs);
|
|
8
8
|
--tab-color: var(--text-outline-color);
|
|
9
9
|
--tab--hover-color: var(--text-primary-color);
|
|
10
10
|
--tab--active-color: var(--text-primary-color);
|
|
11
11
|
--tab-border: 4px solid;
|
|
12
12
|
--tab--active-border-color: var(--accent-color);
|
|
13
13
|
--tab-z-index: 1;
|
|
14
|
-
}
|
|
14
|
+
}
|