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/dist/wave-ui.es.js
CHANGED
|
@@ -5536,16 +5536,16 @@ var render$f = function() {
|
|
|
5536
5536
|
} } }, [_vm.$scopedSlots["item-title." + (tab.id || i + 1)] ? _vm._t("item-title." + (tab.id || i + 1), null, { "item": _vm.getOriginalItem(tab), "index": i + 1, "active": tab._uid === _vm.activeTabUid }) : _vm._t("item-title", function() {
|
|
5537
5537
|
return [_c("div", { domProps: { "innerHTML": _vm._s(tab[_vm.itemTitleKey]) } })];
|
|
5538
5538
|
}, { "item": _vm.getOriginalItem(tab), "index": i + 1, "active": tab._uid === _vm.activeTabUid })], 2);
|
|
5539
|
-
}), _vm.$scopedSlots["tabs-bar-extra"] ? _c("div", { staticClass: "w-tabs__bar-extra" }, [_vm._t("tabs-bar-extra")], 2) : _vm._e(), !_vm.noSlider && !_vm.card ? _c("div", { staticClass: "w-tabs__slider", class: _vm.sliderColor, style: _vm.sliderStyles }) : _vm._e()], 2), _vm.
|
|
5539
|
+
}), _vm.$scopedSlots["tabs-bar-extra"] ? _c("div", { staticClass: "w-tabs__bar-extra" }, [_vm._t("tabs-bar-extra")], 2) : _vm._e(), !_vm.noSlider && !_vm.card ? _c("div", { staticClass: "w-tabs__slider", class: _vm.sliderColor, style: _vm.sliderStyles }) : _vm._e()], 2), _vm.keepInDom ? _c("transition-group", { staticClass: "w-tabs__content-wrap", attrs: { "name": _vm.transitionName, "tag": "div" } }, _vm._l(_vm.tabs, function(tab, i) {
|
|
5540
5540
|
return _c("tab-content", { directives: [{ name: "show", rawName: "v-show", value: tab._uid === _vm.activeTab._uid, expression: "tab._uid === activeTab._uid" }], key: tab._uid, class: _vm.contentClass, attrs: { "item": tab } }, [_vm.$scopedSlots["item-content." + (tab._index + 1)] ? _vm._t("item-content." + (tab._index + 1), null, { "item": _vm.getOriginalItem(tab), "index": tab._index + 1, "active": tab._index === _vm.activeTab._index }) : _vm._t("item-content", function() {
|
|
5541
5541
|
return [tab[_vm.itemContentKey] ? _c("div", { domProps: { "innerHTML": _vm._s(tab[_vm.itemContentKey]) } }) : _vm._e()];
|
|
5542
5542
|
}, { "item": _vm.getOriginalItem(tab), "index": tab._index + 1, "active": tab._index === _vm.activeTab._index })], 2);
|
|
5543
|
-
}), 1) : _c("transition", { attrs: { "name": _vm.transitionName, "mode": _vm.transitionMode } }, [_c("keep-alive", { attrs: { "exclude": _vm.keepAlive ? "" : "tab-content" } }, [_c("tab-content", { key: _vm.activeTabUid, class: _vm.contentClass, attrs: { "item": _vm.activeTab }, scopedSlots: _vm._u([{ key: "default", fn: function(ref) {
|
|
5543
|
+
}), 1) : _c("div", { staticClass: "w-tabs__content-wrap" }, [_c("transition", { attrs: { "name": _vm.transitionName, "mode": _vm.transitionMode } }, [_c("keep-alive", { attrs: { "exclude": _vm.keepAlive ? "" : "tab-content" } }, [_c("tab-content", { key: _vm.activeTabUid, class: _vm.contentClass, attrs: { "item": _vm.activeTab }, scopedSlots: _vm._u([{ key: "default", fn: function(ref) {
|
|
5544
5544
|
var item = ref.item;
|
|
5545
5545
|
return [item ? [_vm.$scopedSlots["item-content." + (item._index + 1)] ? _vm._t("item-content." + (item._index + 1), null, { "item": _vm.getOriginalItem(item), "index": item._index + 1, "active": item._uid === _vm.activeTabUid }) : _vm._t("item-content", function() {
|
|
5546
5546
|
return [item[_vm.itemContentKey] ? _c("div", { domProps: { "innerHTML": _vm._s(item[_vm.itemContentKey]) } }) : _vm._e()];
|
|
5547
5547
|
}, { "item": _vm.getOriginalItem(item), "index": item._index + 1, "active": item._uid === _vm.activeTabUid })] : _vm._e()];
|
|
5548
|
-
} }], null, true) })], 1)], 1)], 1)
|
|
5548
|
+
} }], null, true) })], 1)], 1)], 1)], 1);
|
|
5549
5549
|
};
|
|
5550
5550
|
var staticRenderFns$f = [];
|
|
5551
5551
|
var index_vue_vue_type_style_index_0_lang = "";
|
|
@@ -5709,28 +5709,33 @@ const __vue2_script$f = {
|
|
|
5709
5709
|
}
|
|
5710
5710
|
},
|
|
5711
5711
|
updateActiveTab(index2) {
|
|
5712
|
+
var _a, _b;
|
|
5712
5713
|
if (typeof index2 === "string")
|
|
5713
5714
|
index2 = ~~index2;
|
|
5714
5715
|
else if (isNaN(index2) || index2 < 0)
|
|
5715
5716
|
index2 = 0;
|
|
5716
|
-
|
|
5717
|
-
|
|
5718
|
-
|
|
5719
|
-
|
|
5720
|
-
|
|
5721
|
-
this.activeTabEl
|
|
5722
|
-
|
|
5723
|
-
|
|
5717
|
+
if ((_a = this.tabs[index2]) == null ? void 0 : _a._uid) {
|
|
5718
|
+
this.openTab((_b = this.tabs[index2]) == null ? void 0 : _b._uid);
|
|
5719
|
+
this.$nextTick(() => {
|
|
5720
|
+
const ref = this.$refs["tabs-bar"];
|
|
5721
|
+
this.activeTabEl = ref && ref.querySelector(`.w-tabs__bar-item:nth-child(${index2 + 1})`);
|
|
5722
|
+
if (this.activeTabEl) {
|
|
5723
|
+
this.activeTabEl.scrollIntoView({ behavior: "smooth", block: "nearest", inline: "nearest" });
|
|
5724
|
+
}
|
|
5725
|
+
});
|
|
5726
|
+
}
|
|
5724
5727
|
},
|
|
5725
5728
|
getOriginalItem(item) {
|
|
5726
5729
|
return this.items[item._index] || {};
|
|
5727
5730
|
}
|
|
5728
5731
|
},
|
|
5729
5732
|
beforeMount() {
|
|
5733
|
+
var _a;
|
|
5730
5734
|
this.tabs = [];
|
|
5731
5735
|
const items = typeof this.items === "number" ? Array(this.items).fill().map(Object) : this.items;
|
|
5732
5736
|
items.forEach(this.addTab);
|
|
5733
|
-
|
|
5737
|
+
if ((_a = this.value) != null ? _a : false)
|
|
5738
|
+
this.updateActiveTab(this.value);
|
|
5734
5739
|
this.$nextTick(() => {
|
|
5735
5740
|
this.updateSlider();
|
|
5736
5741
|
setTimeout(() => this.init = false, 0);
|