wave-ui 1.66.0 → 1.66.1
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/wave-ui.cjs.js +1 -1
- package/dist/wave-ui.es.js +17 -12
- package/dist/wave-ui.umd.js +1 -1
- package/package.json +1 -1
- package/src/wave-ui/components/w-tabs/index.vue +36 -33
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "wave-ui",
|
|
3
|
-
"version": "1.66.
|
|
3
|
+
"version": "1.66.1",
|
|
4
4
|
"description": "An emerging UI framework for Vue.js (2 & 3) with only the bright side. :sunny:",
|
|
5
5
|
"author": "Antoni Andre <antoniandre.web@gmail.com>",
|
|
6
6
|
"homepage": "https://antoniandre.github.io/wave-ui",
|
|
@@ -28,28 +28,28 @@
|
|
|
28
28
|
slot(name="tabs-bar-extra")
|
|
29
29
|
.w-tabs__slider(v-if="!noSlider && !card" :class="sliderColor" :style="sliderStyles")
|
|
30
30
|
|
|
31
|
-
.w-tabs__content-wrap(v-if="
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
transition(
|
|
31
|
+
transition-group.w-tabs__content-wrap(v-if="keepInDom" :name="transitionName" tag="div")
|
|
32
|
+
tab-content(
|
|
33
|
+
v-for="(tab, i) in tabs"
|
|
34
|
+
:key="tab._uid"
|
|
35
|
+
:item="tab"
|
|
36
|
+
v-show="tab._uid === activeTab._uid"
|
|
37
|
+
:class="contentClass")
|
|
38
|
+
slot(
|
|
39
|
+
v-if="$scopedSlots[`item-content.${tab._index + 1}`]"
|
|
40
|
+
:name="`item-content.${tab._index + 1}`"
|
|
41
|
+
:item="getOriginalItem(tab)"
|
|
42
|
+
:index="tab._index + 1"
|
|
43
|
+
:active="tab._index === activeTab._index")
|
|
44
|
+
slot(
|
|
45
|
+
v-else
|
|
46
|
+
name="item-content"
|
|
47
|
+
:item="getOriginalItem(tab)"
|
|
48
|
+
:index="tab._index + 1"
|
|
49
|
+
:active="tab._index === activeTab._index")
|
|
50
|
+
div(v-if="tab[itemContentKey]" v-html="tab[itemContentKey]")
|
|
51
|
+
.w-tabs__content-wrap(v-else)
|
|
52
|
+
transition(:name="transitionName" :mode="transitionMode")
|
|
53
53
|
keep-alive(:exclude="keepAlive ? '' : 'tab-content'")
|
|
54
54
|
//- Keep-alive only works with components, not with DOM nodes.
|
|
55
55
|
tab-content(:key="activeTabUid" :item="activeTab" :class="contentClass")
|
|
@@ -268,16 +268,19 @@ export default {
|
|
|
268
268
|
if (typeof index === 'string') index = ~~index
|
|
269
269
|
else if (isNaN(index) || index < 0) index = 0
|
|
270
270
|
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
this
|
|
277
|
-
|
|
278
|
-
this.activeTabEl
|
|
279
|
-
|
|
280
|
-
|
|
271
|
+
// Only open the tab if it is found.
|
|
272
|
+
if (this.tabs[index]?._uid) {
|
|
273
|
+
this.openTab(this.tabs[index]?._uid)
|
|
274
|
+
|
|
275
|
+
// Scroll the new active tab item title into view if needed.
|
|
276
|
+
this.$nextTick(() => {
|
|
277
|
+
const ref = this.$refs['tabs-bar']
|
|
278
|
+
this.activeTabEl = ref && ref.querySelector(`.w-tabs__bar-item:nth-child(${index + 1})`)
|
|
279
|
+
if (this.activeTabEl) {
|
|
280
|
+
this.activeTabEl.scrollIntoView({ behavior: 'smooth', block: 'nearest', inline: 'nearest' })
|
|
281
|
+
}
|
|
282
|
+
})
|
|
283
|
+
}
|
|
281
284
|
},
|
|
282
285
|
|
|
283
286
|
// Return the original item (so there is no `_index`, etc.).
|
|
@@ -291,7 +294,7 @@ export default {
|
|
|
291
294
|
const items = typeof this.items === 'number' ? Array(this.items).fill().map(Object) : this.items
|
|
292
295
|
items.forEach(this.addTab)
|
|
293
296
|
|
|
294
|
-
this.updateActiveTab(this.value)
|
|
297
|
+
if (this.value ?? false) this.updateActiveTab(this.value)
|
|
295
298
|
|
|
296
299
|
this.$nextTick(() => {
|
|
297
300
|
this.updateSlider()
|