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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wave-ui",
3
- "version": "1.66.0",
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="tabs.length")
32
- transition-group(v-if="keepInDom" :name="transitionName")
33
- tab-content(
34
- v-for="(tab, i) in tabs"
35
- :key="tab._uid"
36
- :item="tab"
37
- v-show="tab._uid === activeTab._uid"
38
- :class="contentClass")
39
- slot(
40
- v-if="$scopedSlots[`item-content.${tab._index + 1}`]"
41
- :name="`item-content.${tab._index + 1}`"
42
- :item="getOriginalItem(tab)"
43
- :index="tab._index + 1"
44
- :active="tab._index === activeTab._index")
45
- slot(
46
- v-else
47
- name="item-content"
48
- :item="getOriginalItem(tab)"
49
- :index="tab._index + 1"
50
- :active="tab._index === activeTab._index")
51
- div(v-if="tab[itemContentKey]" v-html="tab[itemContentKey]")
52
- transition(v-else :name="transitionName" :mode="transitionMode")
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
- this.openTab(this.tabs[index]._uid)
272
-
273
- // Scroll the new active tab item title into view if needed.
274
- this.$nextTick(() => {
275
- const ref = this.$refs['tabs-bar']
276
- this.activeTabEl = ref && ref.querySelector(`.w-tabs__bar-item:nth-child(${index + 1})`)
277
- if (this.activeTabEl) {
278
- this.activeTabEl.scrollIntoView({ behavior: 'smooth', block: 'nearest', inline: 'nearest' })
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()