diff --git a/dist/vue-tabs.common.js b/dist/vue-tabs.common.js index e30f010..4c60b37 100644 --- a/dist/vue-tabs.common.js +++ b/dist/vue-tabs.common.js @@ -1,5 +1,5 @@ /*! - * vue-nav-tabs v0.5.6 + * vue-nav-tabs v0.5.7 * (c) 2018-present cristij * Released under the MIT License. */ @@ -83,7 +83,7 @@ var VueTabs = { this.$emit('input', tab.title); }, changeTab: function changeTab(oldIndex, newIndex, route) { - var oldTab = this.tabs[oldIndex]; + var oldTab = this.tabs[oldIndex] || {}; var newTab = this.tabs[newIndex]; if (newTab.disabled) return; this.activeTabIndex = newIndex; diff --git a/dist/vue-tabs.common.min.js b/dist/vue-tabs.common.min.js index 4e622d8..6cc5a41 100644 --- a/dist/vue-tabs.common.min.js +++ b/dist/vue-tabs.common.min.js @@ -1,7 +1,7 @@ /*! - * vue-nav-tabs v0.5.6 + * vue-nav-tabs v0.5.7 * (c) 2018-present cristij * Released under the MIT License. */ -"use strict";function _interopDefault(t){return t&&"object"==typeof t&&"default"in t?t.default:t}Object.defineProperty(exports,"__esModule",{value:!0});var _mergeJSXProps=_interopDefault(require("babel-helper-vue-jsx-merge-props")),VueTabs={name:"vue-tabs",props:{activeTabColor:String,activeTextColor:String,disabledColor:String,disabledTextColor:String,textPosition:{type:String,default:"center"},type:{type:String,default:"tabs"},direction:{type:String,default:"horizontal"},centered:Boolean,value:[String,Number,Object]},data:function(){return{activeTabIndex:0,tabs:[]}},computed:{isTabShape:function(){return"tabs"===this.type},isStacked:function(){return"vertical"===this.direction},classList:function(){return"nav "+(this.isTabShape?"nav-tabs":"nav-pills")+" "+(this.centered?"nav-justified":"")+" "+(this.isStacked?"nav-stacked":"")},stackedClass:function(){return this.isStacked?"stacked":""},activeTabStyle:function(){return{backgroundColor:this.activeTabColor,color:this.activeTextColor}}},methods:{navigateToTab:function(t,e){this.changeTab(this.activeTabIndex,t,e)},activateTab:function(t){this.activeTabIndex=t;var e=this.tabs[t];e.active=!0,this.$emit("input",e.title)},changeTab:function(t,e,i){var a=this.tabs[t],n=this.tabs[e];n.disabled||(this.activeTabIndex=e,a.active=!1,n.active=!0,this.$emit("input",this.tabs[e].title),this.$emit("tab-change",e,n,a),this.tryChangeRoute(i))},tryChangeRoute:function(t){this.$router&&t&&this.$router.push(t)},addTab:function(t){var e=this.$slots.default.indexOf(t.$vnode);this.tabs.splice(e,0,t)},removeTab:function(t){var e=this.tabs,i=e.indexOf(t);-1-1&&e.splice(i,1)},getTabs:function(){return this.$slots.default?this.$slots.default.filter(function(t){return t.componentOptions}):[]},findTabAndActivate:function(t){var e=this.tabs.findIndex(function(e,i){return e.title===t||i===t});e!==this.activeTabIndex&&(-1!==e?this.changeTab(this.activeTabIndex,e):this.changeTab(this.activeTabIndex,0))},renderTabTitle:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"top",i=this.$createElement;if(0!==this.tabs.length){var a=this.tabs[t],n=a.active,s=a.title,r={color:this.activeTabColor};"center"===e&&(r.color=this.activeTextColor);var o=i("span",{class:"title title_"+e,style:n?r:{}},["center"===e&&this.renderIcon(t),s]);return a.$slots.title?a.$slots.title:a.$scopedSlots.title?a.$scopedSlots.title({active:n,title:s,position:e,icon:a.icon,data:a.tabData}):o}},renderIcon:function(t){var e=this.$createElement;if(0!==this.tabs.length){var i=this.tabs[t],a=i.icon,n=e("i",{class:a},[" "]);return!i.$slots.title&&a?n:void 0}},tabStyles:function(t){return t.disabled?{backgroundColor:this.disabledColor,color:this.disabledTextColor}:{}},renderTabs:function(){var t=this,e=this.$createElement;return this.tabs.map(function(i,a){if(i){var n=i.route,s=(i.id,i.title),r=(i.icon,i.tabId),o=t.activeTabIndex===a;return e("li",_mergeJSXProps([{attrs:{name:"tab",id:"t-"+r,"aria-selected":o,"aria-controls":"p-"+r,role:"tab"},class:["tab",{active:o},{disabled:i.disabled}],key:s},{on:{click:function(e){for(var s=arguments.length,r=Array(s>1?s-1:0),o=1;o1?e-1:0),a=1;a0&&!this.value&&(t.length<=this.activeTabIndex?this.activateTab(this.activeTabIndex-1):this.activateTab(this.activeTabIndex)),t.length>0&&this.value&&this.findTabAndActivate(this.value)},value:function(t){this.findTabAndActivate(t)}}},VTab={name:"v-tab",props:{title:{type:String,default:""},icon:{type:String,default:""},tabData:{default:null},beforeChange:{type:Function},id:String,route:{type:[String,Object]},disabled:Boolean,transitionName:String,transitionMode:String},computed:{isValidParent:function(){return"vue-tabs"===this.$parent.$options.name},hash:function(){return"#"+this.id},tabId:function(){return this.id?this.id:this.title}},data:function(){return{active:!1,validationError:null}},mounted:function(){this.$parent.addTab(this)},destroyed:function(){this.$el&&this.$el.parentNode&&this.$el.parentNode.removeChild(this.$el),this.$parent.removeTab(this)},render:function(){return(0,arguments[0])("section",{class:"tab-container",attrs:{id:"p-"+this.tabId,"aria-labelledby":"t-"+this.tabId,role:"tabpanel"},directives:[{name:"show",value:this.active}]},[this.$slots.default])}},VueTabsPlugin={install:function(t){t.component("vue-tabs",VueTabs),t.component("v-tab",VTab)}};"undefined"!=typeof window&&window.Vue&&(window.Vue.use(VueTabsPlugin),window.VueTabs=VueTabsPlugin),exports.default=VueTabsPlugin,exports.VueTabs=VueTabs,exports.VTab=VTab; //# sourceMappingURL=vue-tabs.common.min.js.map diff --git a/dist/vue-tabs.common.min.js.map b/dist/vue-tabs.common.min.js.map index 6b94e21..fc5702d 100644 --- a/dist/vue-tabs.common.min.js.map +++ b/dist/vue-tabs.common.min.js.map @@ -1 +1 @@ -{"version":3,"file":"vue-tabs.common.min.js","sources":["../src/components/VueTabs.js","../src/components/VTab.js","../src/index.js"],"sourcesContent":["export default {\n name: 'vue-tabs',\n props: {\n activeTabColor: String,\n activeTextColor: String,\n disabledColor: String,\n disabledTextColor: String,\n /**\n * Tab title position: center | bottom | top\n */\n textPosition: {\n type: String,\n default: 'center'\n },\n /**\n * Tab type: tabs | pills\n */\n type: {\n type: String,\n default: 'tabs'\n },\n direction: {\n type: String,\n default: 'horizontal'\n },\n /**\n * Centers the tabs and makes the container div full width\n */\n centered: Boolean,\n value: [String, Number, Object]\n },\n data () {\n return {\n activeTabIndex: 0,\n tabs: []\n }\n },\n computed: {\n isTabShape () {\n return this.type === 'tabs'\n },\n isStacked () {\n return this.direction === 'vertical'\n },\n classList () {\n let navType = this.isTabShape ? 'nav-tabs' : 'nav-pills'\n let centerClass = this.centered ? 'nav-justified' : ''\n let isStacked = this.isStacked ? 'nav-stacked' : ''\n return `nav ${navType} ${centerClass} ${isStacked}`\n },\n stackedClass () {\n return this.isStacked ? 'stacked' : ''\n },\n activeTabStyle () {\n return {\n backgroundColor: this.activeTabColor,\n color: this.activeTextColor\n }\n }\n },\n methods: {\n navigateToTab (index, route) {\n this.changeTab(this.activeTabIndex, index, route)\n },\n activateTab (index) {\n this.activeTabIndex = index\n let tab = this.tabs[index]\n tab.active = true\n this.$emit('input', tab.title)\n },\n changeTab (oldIndex, newIndex, route) {\n let oldTab = this.tabs[oldIndex]\n let newTab = this.tabs[newIndex]\n if (newTab.disabled) return;\n this.activeTabIndex = newIndex\n oldTab.active = false\n newTab.active = true\n this.$emit('input', this.tabs[newIndex].title)\n this.$emit('tab-change', newIndex, newTab, oldTab)\n this.tryChangeRoute(route)\n },\n tryChangeRoute (route) {\n if (this.$router && route) {\n this.$router.push(route)\n }\n },\n addTab (item) {\n const index = this.$slots.default.indexOf(item.$vnode);\n this.tabs.splice(index, 0, item);\n },\n removeTab (item) {\n const tabs = this.tabs;\n const index = tabs.indexOf(item);\n if (index > -1) {\n tabs.splice(index, 1);\n }\n },\n getTabs () {\n if (this.$slots.default) {\n return this.$slots.default.filter(comp => comp.componentOptions)\n }\n return []\n },\n findTabAndActivate (tabNameOrIndex) {\n let indexToActivate = this.tabs.findIndex((tab, index) => tab.title === tabNameOrIndex || index === tabNameOrIndex)\n if (indexToActivate === this.activeTabIndex) return\n if (indexToActivate !== -1) {\n this.changeTab(this.activeTabIndex, indexToActivate)\n } else {\n this.changeTab(this.activeTabIndex, 0)\n }\n },\n renderTabTitle (index, position = 'top') {\n if (this.tabs.length === 0) return\n let tab = this.tabs[index]\n let {active, title} = tab\n let titleStyles = {color: this.activeTabColor}\n if (position === 'center') titleStyles.color = this.activeTextColor\n let simpleTitle = ({position === 'center' && this.renderIcon(index)}{title})\n\n if (tab.$slots.title) return tab.$slots.title\n if (tab.$scopedSlots.title) return tab.$scopedSlots.title({\n active: active,\n title: title,\n position: position,\n icon: tab.icon,\n data: tab.tabData\n });\n return simpleTitle\n },\n renderIcon (index) {\n if (this.tabs.length === 0) return\n let tab = this.tabs[index]\n let {icon} = tab\n let simpleIcon =  \n if (!tab.$slots.title && icon) return simpleIcon\n },\n tabStyles (tab) {\n if (tab.disabled) {\n return {\n backgroundColor: this.disabledColor,\n color: this.disabledTextColor\n }\n }\n return {}\n },\n renderTabs () {\n return this.tabs.map((tab, index) => {\n if (!tab) return\n let {route, id, title, icon, tabId} = tab\n let active = this.activeTabIndex === index\n return (\n
  • !tab.disabled && this.navigateToTab(index, route)}\n class={['tab', {active: active}, {disabled: tab.disabled}]}\n key={title}\n id={`t-${tabId}`}\n aria-selected={active}\n aria-controls={`p-${tabId}`}\n role=\"tab\">\n {this.textPosition === 'top' &&\n this.renderTabTitle(index, this.textPosition)\n }\n {\n e.preventDefault();\n return false;\n }}\n style={active ? this.activeTabStyle : this.tabStyles(tab)}\n class={[{'active_tab': active}, 'tabs__link']}\n role=\"tab\">\n {this.textPosition !== 'center' && !tab.$slots.title && this.renderIcon(index)}\n {this.textPosition === 'center' &&\n this.renderTabTitle(index, this.textPosition)\n }\n \n {this.textPosition === 'bottom' &&\n this.renderTabTitle(index, this.textPosition)\n }\n
  • \n )\n })\n }\n },\n render () {\n const tabList = this.renderTabs()\n return (\n
    \n
    \n
    \n
      \n {tabList}\n
    \n
    \n
    \n
    \n {this.$slots.default}\n
    \n
    )\n },\n watch: {\n tabs (newList) {\n if (newList.length > 0 && !this.value) {\n if (newList.length <= this.activeTabIndex) {\n this.activateTab(this.activeTabIndex - 1);\n } else {\n this.activateTab(this.activeTabIndex);\n }\n }\n if (newList.length > 0 && this.value) {\n this.findTabAndActivate(this.value)\n }\n },\n value (newVal) {\n this.findTabAndActivate(newVal)\n }\n }\n}\n","export default {\n name: 'v-tab',\n props: {\n title: {\n type: String,\n default: ''\n },\n icon: {\n type: String,\n default: ''\n },\n tabData: {\n default: null\n },\n /***\n * Function to execute before tab switch. Return value must be boolean\n * If the return result is false, tab switch is restricted\n */\n beforeChange: {\n type: Function\n },\n id: String,\n route: {\n type: [String, Object]\n },\n disabled: Boolean,\n transitionName: String,\n transitionMode: String\n },\n computed: {\n isValidParent () {\n return this.$parent.$options.name === 'vue-tabs'\n },\n hash () {\n return `#${this.id}`\n },\n tabId () {\n return this.id ? this.id : this.title\n }\n },\n data () {\n return {\n active: false,\n validationError: null\n }\n },\n mounted () {\n this.$parent.addTab(this)\n },\n destroyed () {\n if (this.$el && this.$el.parentNode) {\n this.$el.parentNode.removeChild(this.$el);\n }\n this.$parent.removeTab(this);\n },\n render () {\n return (\n
    \n {this.$slots.default}\n
    )\n }\n}\n","import VueTabs from './components/VueTabs.js'\nimport VTab from './components/VTab.js'\nconst VueTabsPlugin = {\n install(Vue) {\n Vue.component('vue-tabs', VueTabs)\n Vue.component('v-tab', VTab)\n }\n}\n// Automatic installation if Vue has been added to the global scope.\nif (typeof window !== 'undefined' && window.Vue) {\n window.Vue.use(VueTabsPlugin)\n window.VueTabs = VueTabsPlugin\n}\nexport default VueTabsPlugin\nexport {\n VueTabs,\n VTab\n}"],"names":["String","Boolean","Number","Object","this","type","direction","isTabShape","centered","isStacked","activeTabColor","activeTextColor","index","route","changeTab","activeTabIndex","tab","tabs","active","$emit","title","oldIndex","newIndex","oldTab","newTab","disabled","tryChangeRoute","$router","push","item","$slots","default","indexOf","$vnode","splice","filter","comp","componentOptions","tabNameOrIndex","indexToActivate","findIndex","position","length","titleStyles","color","simpleTitle","h","class","style","renderIcon","$scopedSlots","icon","tabData","simpleIcon","disabledColor","disabledTextColor","map","id","tabId","_this","name","navigateToTab","textPosition","renderTabTitle","href","activeTabStyle","tabStyles","active_tab","e","preventDefault","tabList","renderTabs","stackedClass","nav-tabs-navigation","left-vertical-tabs","classList","role","right-text-tabs","newList","value","activateTab","findTabAndActivate","newVal","Function","$parent","$options","addTab","$el","parentNode","removeChild","removeTab","VueTabsPlugin","Vue","component","VueTabs","VTab","window","use"],"mappings":";;;;;sPACU,iCAEcA,uBACCA,qBACFA,yBACIA,0BAKTA,eACG,qBAMHA,eACG,wBAGHA,eACG,uBAKHC,eACFD,OAAQE,OAAQC,+CAIJ,kDAMK,SAAdC,KAAKC,iCAGc,aAAnBD,KAAKE,8CAGEF,KAAKG,WAAa,WAAa,kBAC3BH,KAAKI,SAAW,gBAAkB,SACpCJ,KAAKK,UAAY,cAAgB,oCAI1CL,KAAKK,UAAY,UAAY,qDAIfL,KAAKM,qBACfN,KAAKO,mDAKLC,EAAOC,QACbC,UAAUV,KAAKW,eAAgBH,EAAOC,yBAElCD,QACJG,eAAiBH,MAClBI,EAAMZ,KAAKa,KAAKL,KAChBM,QAAS,OACRC,MAAM,QAASH,EAAII,2BAEjBC,EAAUC,EAAUT,OACvBU,EAASnB,KAAKa,KAAKI,GACnBG,EAASpB,KAAKa,KAAKK,GACnBE,EAAOC,gBACNV,eAAiBO,IACfJ,QAAS,IACTA,QAAS,OACXC,MAAM,QAASf,KAAKa,KAAKK,GAAUF,YACnCD,MAAM,aAAcG,EAAUE,EAAQD,QACtCG,eAAeb,6BAERA,GACRT,KAAKuB,SAAWd,QACXc,QAAQC,KAAKf,oBAGlBgB,OACEjB,EAAQR,KAAK0B,OAAOC,QAAQC,QAAQH,EAAKI,aAC1ChB,KAAKiB,OAAOtB,EAAO,EAAGiB,uBAEpBA,OACDZ,EAAOb,KAAKa,KACZL,EAAQK,EAAKe,QAAQH,IACd,EAATjB,KACKsB,OAAOtB,EAAO,8BAInBR,KAAK0B,OAAOC,QACL3B,KAAK0B,OAAOC,QAAQI,OAAO,mBAAQC,EAAKC,mDAIn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F,KAAKmF,UAEpCH,QAAQM,UAAUtF,gCAInB0C,2BAASC,MAAM,uBACNU,QAASrD,KAAKsD,6BACQtD,KAAKsD,WACtB,2CAAmBtD,KAAKc,WACjCd,KAAK0B,OAAOC,YC3DvB4D,gCACIC,KACFC,UAAU,WAAYC,WACtBD,UAAU,QAASE,QAIL,oBAAXC,QAA0BA,OAAOJ,aACnCA,IAAIK,IAAIN,sBACRG,QAAUH"} \ No newline at end of file +{"version":3,"file":"vue-tabs.common.min.js","sources":["../src/components/VueTabs.js","../src/components/VTab.js","../src/index.js"],"sourcesContent":["export default {\n name: 'vue-tabs',\n props: {\n activeTabColor: String,\n activeTextColor: String,\n disabledColor: String,\n disabledTextColor: String,\n /**\n * Tab title position: center | bottom | top\n */\n textPosition: {\n type: String,\n default: 'center'\n },\n /**\n * Tab type: tabs | pills\n */\n type: {\n type: String,\n default: 'tabs'\n },\n direction: {\n type: String,\n default: 'horizontal'\n },\n /**\n * Centers the tabs and makes the container div full width\n */\n centered: Boolean,\n value: [String, Number, Object]\n },\n data () {\n return {\n activeTabIndex: 0,\n tabs: []\n }\n },\n computed: {\n isTabShape () {\n return this.type === 'tabs'\n },\n isStacked () {\n return this.direction === 'vertical'\n },\n classList () {\n let navType = this.isTabShape ? 'nav-tabs' : 'nav-pills'\n let centerClass = this.centered ? 'nav-justified' : ''\n let isStacked = this.isStacked ? 'nav-stacked' : ''\n return `nav ${navType} ${centerClass} ${isStacked}`\n },\n stackedClass () {\n return this.isStacked ? 'stacked' : ''\n },\n activeTabStyle () {\n return {\n backgroundColor: this.activeTabColor,\n color: this.activeTextColor\n }\n }\n },\n methods: {\n navigateToTab (index, route) {\n this.changeTab(this.activeTabIndex, index, route)\n },\n activateTab (index) {\n this.activeTabIndex = index\n let tab = this.tabs[index]\n tab.active = true\n this.$emit('input', tab.title)\n },\n changeTab (oldIndex, newIndex, route) {\n let oldTab = this.tabs[oldIndex] || {}\n let newTab = this.tabs[newIndex]\n if (newTab.disabled) return;\n this.activeTabIndex = newIndex\n oldTab.active = false\n newTab.active = true\n this.$emit('input', this.tabs[newIndex].title)\n this.$emit('tab-change', newIndex, newTab, oldTab)\n this.tryChangeRoute(route)\n },\n tryChangeRoute (route) {\n if (this.$router && route) {\n this.$router.push(route)\n }\n },\n addTab (item) {\n const index = this.$slots.default.indexOf(item.$vnode);\n this.tabs.splice(index, 0, item);\n },\n removeTab (item) {\n const tabs = this.tabs;\n const index = tabs.indexOf(item);\n if (index > -1) {\n tabs.splice(index, 1);\n }\n },\n getTabs () {\n if (this.$slots.default) {\n return this.$slots.default.filter(comp => comp.componentOptions)\n }\n return []\n },\n findTabAndActivate (tabNameOrIndex) {\n let indexToActivate = this.tabs.findIndex((tab, index) => tab.title === tabNameOrIndex || index === tabNameOrIndex)\n if (indexToActivate === this.activeTabIndex) return\n if (indexToActivate !== -1) {\n this.changeTab(this.activeTabIndex, indexToActivate)\n } else {\n this.changeTab(this.activeTabIndex, 0)\n }\n },\n renderTabTitle (index, position = 'top') {\n if (this.tabs.length === 0) return\n let tab = this.tabs[index]\n let {active, title} = tab\n let titleStyles = {color: this.activeTabColor}\n if (position === 'center') titleStyles.color = this.activeTextColor\n let simpleTitle = ({position === 'center' && this.renderIcon(index)}{title})\n\n if (tab.$slots.title) return tab.$slots.title\n if (tab.$scopedSlots.title) return tab.$scopedSlots.title({\n active: active,\n title: title,\n position: position,\n icon: tab.icon,\n data: tab.tabData\n });\n return simpleTitle\n },\n renderIcon (index) {\n if (this.tabs.length === 0) return\n let tab = this.tabs[index]\n let {icon} = tab\n let simpleIcon =  \n if (!tab.$slots.title && icon) return simpleIcon\n },\n tabStyles (tab) {\n if (tab.disabled) {\n return {\n backgroundColor: this.disabledColor,\n color: this.disabledTextColor\n }\n }\n return {}\n },\n renderTabs () {\n return this.tabs.map((tab, index) => {\n if (!tab) return\n let {route, id, title, icon, tabId} = tab\n let active = this.activeTabIndex === index\n return (\n
  • !tab.disabled && this.navigateToTab(index, route)}\n class={['tab', {active: active}, {disabled: tab.disabled}]}\n key={title}\n id={`t-${tabId}`}\n aria-selected={active}\n aria-controls={`p-${tabId}`}\n role=\"tab\">\n {this.textPosition === 'top' &&\n this.renderTabTitle(index, this.textPosition)\n }\n {\n e.preventDefault();\n return false;\n }}\n style={active ? this.activeTabStyle : this.tabStyles(tab)}\n class={[{'active_tab': active}, 'tabs__link']}\n role=\"tab\">\n {this.textPosition !== 'center' && !tab.$slots.title && this.renderIcon(index)}\n {this.textPosition === 'center' &&\n this.renderTabTitle(index, this.textPosition)\n }\n \n {this.textPosition === 'bottom' &&\n this.renderTabTitle(index, this.textPosition)\n }\n
  • \n )\n })\n }\n },\n render () {\n const tabList = this.renderTabs()\n return (\n
    \n
    \n
    \n
      \n {tabList}\n
    \n
    \n
    \n
    \n {this.$slots.default}\n
    \n
    )\n },\n watch: {\n tabs (newList) {\n if (newList.length > 0 && !this.value) {\n if (newList.length <= this.activeTabIndex) {\n this.activateTab(this.activeTabIndex - 1);\n } else {\n this.activateTab(this.activeTabIndex);\n }\n }\n if (newList.length > 0 && this.value) {\n this.findTabAndActivate(this.value)\n }\n },\n value (newVal) {\n this.findTabAndActivate(newVal)\n }\n }\n}\n","export default {\n name: 'v-tab',\n props: {\n title: {\n type: String,\n default: ''\n },\n icon: {\n type: String,\n default: ''\n },\n tabData: {\n default: null\n },\n /***\n * Function to execute before tab switch. Return value must be boolean\n * If the return result is false, tab switch is restricted\n */\n beforeChange: {\n type: Function\n },\n id: String,\n route: {\n type: [String, Object]\n },\n disabled: Boolean,\n transitionName: String,\n transitionMode: String\n },\n computed: {\n isValidParent () {\n return this.$parent.$options.name === 'vue-tabs'\n },\n hash () {\n return `#${this.id}`\n },\n tabId () {\n return this.id ? this.id : this.title\n }\n },\n data () {\n return {\n active: false,\n validationError: null\n }\n },\n mounted () {\n this.$parent.addTab(this)\n },\n destroyed () {\n if (this.$el && this.$el.parentNode) {\n this.$el.parentNode.removeChild(this.$el);\n }\n this.$parent.removeTab(this);\n },\n render () {\n return (\n
    \n {this.$slots.default}\n
    )\n }\n}\n","import VueTabs from './components/VueTabs.js'\nimport VTab from './components/VTab.js'\nconst VueTabsPlugin = {\n install(Vue) {\n Vue.component('vue-tabs', VueTabs)\n Vue.component('v-tab', VTab)\n }\n}\n// Automatic installation if Vue has been added to the global scope.\nif (typeof window !== 'undefined' && window.Vue) {\n window.Vue.use(VueTabsPlugin)\n window.VueTabs = VueTabsPlugin\n}\nexport default VueTabsPlugin\nexport {\n VueTabs,\n VTab\n}"],"names":["String","Boolean","Number","Object","this","type","direction","isTabShape","centered","isStacked","activeTabColor","activeTextColor","index","route","changeTab","activeTabIndex","tab","tabs","active","$emit","title","oldIndex","newIndex","oldTab","newTab","disabled","tryChangeRoute","$router","push","item","$slots","default","indexOf","$vnode","splice","filter","comp","componentOptions","tabNameOrIndex","indexToActivate","findIndex","position","length","titleStyles","color","simpleTitle","h","class","style","renderIcon","$scopedSlots","icon","tabData","simpleIcon","disabledColor","disabledTextColor","map","id","tabId","_this","name","navigateToTab","textPosition","renderTabTitle","href","activeTabStyle","tabStyles","active_tab","e","preventDefault","tabList","renderTabs","stackedClass","nav-tabs-navigation","left-vertical-tabs","classList","role","right-text-tabs","newList","value","activateTab","findTabAndActivate","newVal","Function","$parent","$options","addTab","$el","parentNode","removeChild","removeTab","VueTabsPlugin","Vue","component","VueTabs","VTab","window","use"],"mappings":";;;;;sPACU,iCAEcA,uBACCA,qBACFA,yBACIA,0BAKTA,eACG,qBAMHA,eACG,wBAGHA,eACG,uBAKHC,eACFD,OAAQE,OAAQC,+CAIJ,kDAMK,SAAdC,KAAKC,iCAGc,aAAnBD,KAAKE,8CAGEF,KAAKG,WAAa,WAAa,kBAC3BH,KAAKI,SAAW,gBAAkB,SACpCJ,KAAKK,UAAY,cAAgB,oCAI1CL,KAAKK,UAAY,UAAY,qDAIfL,KAAKM,qBACfN,KAAKO,mDAKLC,EAAOC,QACbC,UAAUV,KAAKW,eAAgBH,EAAOC,yBAElCD,QACJG,eAAiBH,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,QAIbxB,SAAKC,OAAQ,eAAgB8B,kBAAmBzE,KAAKK,cAChDL,KAAK0B,OAAOC,kCAKnB+C,GACEA,EAAQpC,OAAS,IAAMtC,KAAK2E,QACxBD,EAAQpC,QAAUtC,KAAKW,oBAClBiE,YAAY5E,KAAKW,eAAiB,QAElCiE,YAAY5E,KAAKW,iBAG1B+D,EAAQpC,OAAS,GAAKtC,KAAK2E,YACtBE,mBAAmB7E,KAAK2E,uBAG9BG,QACED,mBAAmBC,iBCpN1B,2BAGQlF,eACG,eAGHA,eACG,qBAGA,yBAOHmF,aAENnF,oBAEOA,OAAQG,kBAETF,uBACMD,sBACAA,iDAI0B,aAA/BI,KAAKgF,QAAQC,SAASzB,gCAGlBxD,KAAKqD,4BAGTrD,KAAKqD,GAAKrD,KAAKqD,GAAKrD,KAAKgB,uCAKxB,kBACS,+BAIhBgE,QAAQE,OAAOlF,4BAGhBA,KAAKmF,KAAOnF,KAAKmF,IAAIC,iBAChBD,IAAIC,WAAWC,YAAYrF,KAAKmF,UAEpCH,QAAQM,UAAUtF,gCAInB0C,2BAASC,MAAM,uBACNU,QAASrD,KAAKsD,6BACQtD,KAAKsD,WACtB,2CAAmBtD,KAAKc,WACjCd,KAAK0B,OAAOC,YC3DvB4D,gCACIC,KACFC,UAAU,WAAYC,WACtBD,UAAU,QAASE,QAIL,oBAAXC,QAA0BA,OAAOJ,aACnCA,IAAIK,IAAIN,sBACRG,QAAUH"} \ No newline at end of file diff --git a/dist/vue-tabs.js b/dist/vue-tabs.js index b238ce2..a1c1d27 100644 --- a/dist/vue-tabs.js +++ b/dist/vue-tabs.js @@ -1,5 +1,5 @@ /*! - * vue-nav-tabs v0.5.6 + * vue-nav-tabs v0.5.7 * (c) 2018-present cristij * Released under the MIT License. */ @@ -55,8 +55,8 @@ var babelHelperVueJsxMergeProps = function mergeJSXProps(objs) { function mergeFn(a, b) { return function () { - a && a.apply(this, arguments); - b && b.apply(this, arguments); + a.apply(this, arguments); + b.apply(this, arguments); }; } @@ -132,7 +132,7 @@ var VueTabs = { this.$emit('input', tab.title); }, changeTab: function changeTab(oldIndex, newIndex, route) { - var oldTab = this.tabs[oldIndex]; + var oldTab = this.tabs[oldIndex] || {}; var newTab = this.tabs[newIndex]; if (newTab.disabled) return; this.activeTabIndex = newIndex; diff --git a/dist/vue-tabs.min.js b/dist/vue-tabs.min.js index 0724cac..8c81bec 100644 --- a/dist/vue-tabs.min.js +++ b/dist/vue-tabs.min.js @@ -1,7 +1,7 @@ /*! - * vue-nav-tabs v0.5.6 + * vue-nav-tabs v0.5.7 * (c) 2018-present cristij * Released under the MIT License. */ -!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e(t.vueTabs={})}(this,function(t){"use strict";var r=/^(attrs|props|on|nativeOn|class|style|hook)$/,c=function(t){return t.reduce(function(t,e){var i,a,n,s,o;for(n in e)if(i=t[n],a=e[n],i&&r.test(n))if("class"===n&&("string"==typeof i&&(o=i,t[n]=i={},i[o]=!0),"string"==typeof a&&(o=a,e[n]=a={},a[o]=!0)),"on"===n||"nativeOn"===n||"hook"===n)for(s in a)i[s]=l(i[s],a[s]);else if(Array.isArray(i))t[n]=i.concat(a);else if(Array.isArray(a))t[n]=[i].concat(a);else for(s in a)i[s]=a[s];else t[n]=e[n];return t},{})};function l(t,e){return function(){t&&t.apply(this,arguments),e&&e.apply(this,arguments)}}var e={name:"vue-tabs",props:{activeTabColor:String,activeTextColor:String,disabledColor:String,disabledTextColor:String,textPosition:{type:String,default:"center"},type:{type:String,default:"tabs"},direction:{type:String,default:"horizontal"},centered:Boolean,value:[String,Number,Object]},data:function(){return{activeTabIndex:0,tabs:[]}},computed:{isTabShape:function(){return"tabs"===this.type},isStacked:function(){return"vertical"===this.direction},classList:function(){return"nav "+(this.isTabShape?"nav-tabs":"nav-pills")+" "+(this.centered?"nav-justified":"")+" "+(this.isStacked?"nav-stacked":"")},stackedClass:function(){return this.isStacked?"stacked":""},activeTabStyle:function(){return{backgroundColor:this.activeTabColor,color:this.activeTextColor}}},methods:{navigateToTab:function(t,e){this.changeTab(this.activeTabIndex,t,e)},activateTab:function(t){this.activeTabIndex=t;var e=this.tabs[t];e.active=!0,this.$emit("input",e.title)},changeTab:function(t,e,i){var a=this.tabs[t],n=this.tabs[e];n.disabled||(this.activeTabIndex=e,a.active=!1,n.active=!0,this.$emit("input",this.tabs[e].title),this.$emit("tab-change",e,n,a),this.tryChangeRoute(i))},tryChangeRoute:function(t){this.$router&&t&&this.$router.push(t)},addTab:function(t){var e=this.$slots.default.indexOf(t.$vnode);this.tabs.splice(e,0,t)},removeTab:function(t){var e=this.tabs,i=e.indexOf(t);-1-1&&e.splice(i,1)},getTabs:function(){return this.$slots.default?this.$slots.default.filter(function(t){return t.componentOptions}):[]},findTabAndActivate:function(t){var e=this.tabs.findIndex(function(e,i){return e.title===t||i===t});e!==this.activeTabIndex&&(-1!==e?this.changeTab(this.activeTabIndex,e):this.changeTab(this.activeTabIndex,0))},renderTabTitle:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"top",i=this.$createElement;if(0!==this.tabs.length){var a=this.tabs[t],n=a.active,s=a.title,o={color:this.activeTabColor};"center"===e&&(o.color=this.activeTextColor);var r=i("span",{class:"title title_"+e,style:n?o:{}},["center"===e&&this.renderIcon(t),s]);return a.$slots.title?a.$slots.title:a.$scopedSlots.title?a.$scopedSlots.title({active:n,title:s,position:e,icon:a.icon,data:a.tabData}):r}},renderIcon:function(t){var e=this.$createElement;if(0!==this.tabs.length){var i=this.tabs[t],a=i.icon,n=e("i",{class:a},[" "]);return!i.$slots.title&&a?n:void 0}},tabStyles:function(t){return t.disabled?{backgroundColor:this.disabledColor,color:this.disabledTextColor}:{}},renderTabs:function(){var t=this,e=this.$createElement;return this.tabs.map(function(a,n){if(a){var s=a.route,o=(a.id,a.title),r=(a.icon,a.tabId),c=t.activeTabIndex===n;return e("li",i([{attrs:{name:"tab",id:"t-"+r,"aria-selected":c,"aria-controls":"p-"+r,role:"tab"},class:["tab",{active:c},{disabled:a.disabled}],key:o},{on:{click:function(e){for(var i=arguments.length,o=Array(i>1?i-1:0),r=1;r1?e-1:0),a=1;a0&&!this.value&&(t.length<=this.activeTabIndex?this.activateTab(this.activeTabIndex-1):this.activateTab(this.activeTabIndex)),t.length>0&&this.value&&this.findTabAndActivate(this.value)},value:function(t){this.findTabAndActivate(t)}}},n={name:"v-tab",props:{title:{type:String,default:""},icon:{type:String,default:""},tabData:{default:null},beforeChange:{type:Function},id:String,route:{type:[String,Object]},disabled:Boolean,transitionName:String,transitionMode:String},computed:{isValidParent:function(){return"vue-tabs"===this.$parent.$options.name},hash:function(){return"#"+this.id},tabId:function(){return this.id?this.id:this.title}},data:function(){return{active:!1,validationError:null}},mounted:function(){this.$parent.addTab(this)},destroyed:function(){this.$el&&this.$el.parentNode&&this.$el.parentNode.removeChild(this.$el),this.$parent.removeTab(this)},render:function(){return(0,arguments[0])("section",{class:"tab-container",attrs:{id:"p-"+this.tabId,"aria-labelledby":"t-"+this.tabId,role:"tabpanel"},directives:[{name:"show",value:this.active}]},[this.$slots.default])}},s={install:function(t){t.component("vue-tabs",a),t.component("v-tab",n)}};"undefined"!=typeof window&&window.Vue&&(window.Vue.use(s),window.VueTabs=s),t.default=s,t.VueTabs=a,t.VTab=n,Object.defineProperty(t,"__esModule",{value:!0})}); //# sourceMappingURL=vue-tabs.min.js.map diff --git a/dist/vue-tabs.min.js.map b/dist/vue-tabs.min.js.map index a71c5dc..489318e 100644 --- a/dist/vue-tabs.min.js.map +++ b/dist/vue-tabs.min.js.map @@ -1 +1 @@ -{"version":3,"file":"vue-tabs.min.js","sources":["../node_modules/babel-helper-vue-jsx-merge-props/index.js","../src/components/VueTabs.js","../src/components/VTab.js","../src/index.js"],"sourcesContent":["var nestRE = /^(attrs|props|on|nativeOn|class|style|hook)$/\n\nmodule.exports = function mergeJSXProps (objs) {\n return objs.reduce(function (a, b) {\n var aa, bb, key, nestedKey, temp\n for (key in b) {\n aa = a[key]\n bb = b[key]\n if (aa && nestRE.test(key)) {\n // normalize class\n if (key === 'class') {\n if (typeof aa === 'string') {\n temp = aa\n a[key] = aa = {}\n aa[temp] = true\n }\n if (typeof bb === 'string') {\n temp = bb\n b[key] = bb = {}\n bb[temp] = true\n }\n }\n if (key === 'on' || key === 'nativeOn' || key === 'hook') {\n // merge functions\n for (nestedKey in bb) {\n aa[nestedKey] = mergeFn(aa[nestedKey], bb[nestedKey])\n }\n } else if (Array.isArray(aa)) {\n a[key] = aa.concat(bb)\n } else if (Array.isArray(bb)) {\n a[key] = [aa].concat(bb)\n } else {\n for (nestedKey in bb) {\n aa[nestedKey] = bb[nestedKey]\n }\n }\n } else {\n a[key] = b[key]\n }\n }\n return a\n }, {})\n}\n\nfunction mergeFn (a, b) {\n return function () {\n a && a.apply(this, arguments)\n b && b.apply(this, arguments)\n }\n}\n","export default {\n name: 'vue-tabs',\n props: {\n activeTabColor: String,\n activeTextColor: String,\n disabledColor: String,\n disabledTextColor: String,\n /**\n * Tab title position: center | bottom | top\n */\n textPosition: {\n type: String,\n default: 'center'\n },\n /**\n * Tab type: tabs | pills\n */\n type: {\n type: String,\n default: 'tabs'\n },\n direction: {\n type: String,\n default: 'horizontal'\n },\n /**\n * Centers the tabs and makes the container div full width\n */\n centered: Boolean,\n value: [String, Number, Object]\n },\n data () {\n return {\n activeTabIndex: 0,\n tabs: []\n }\n },\n computed: {\n isTabShape () {\n return this.type === 'tabs'\n },\n isStacked () {\n return this.direction === 'vertical'\n },\n classList () {\n let navType = this.isTabShape ? 'nav-tabs' : 'nav-pills'\n let centerClass = this.centered ? 'nav-justified' : ''\n let isStacked = this.isStacked ? 'nav-stacked' : ''\n return `nav ${navType} ${centerClass} ${isStacked}`\n },\n stackedClass () {\n return this.isStacked ? 'stacked' : ''\n },\n activeTabStyle () {\n return {\n backgroundColor: this.activeTabColor,\n color: this.activeTextColor\n }\n }\n },\n methods: {\n navigateToTab (index, route) {\n this.changeTab(this.activeTabIndex, index, route)\n },\n activateTab (index) {\n this.activeTabIndex = index\n let tab = this.tabs[index]\n tab.active = true\n this.$emit('input', tab.title)\n },\n changeTab (oldIndex, newIndex, route) {\n let oldTab = this.tabs[oldIndex]\n let newTab = this.tabs[newIndex]\n if (newTab.disabled) return;\n this.activeTabIndex = newIndex\n oldTab.active = false\n newTab.active = true\n this.$emit('input', this.tabs[newIndex].title)\n this.$emit('tab-change', newIndex, newTab, oldTab)\n this.tryChangeRoute(route)\n },\n tryChangeRoute (route) {\n if (this.$router && route) {\n this.$router.push(route)\n }\n },\n addTab (item) {\n const index = this.$slots.default.indexOf(item.$vnode);\n this.tabs.splice(index, 0, item);\n },\n removeTab (item) {\n const tabs = this.tabs;\n const index = tabs.indexOf(item);\n if (index > -1) {\n tabs.splice(index, 1);\n }\n },\n getTabs () {\n if (this.$slots.default) {\n return this.$slots.default.filter(comp => comp.componentOptions)\n }\n return []\n },\n findTabAndActivate (tabNameOrIndex) {\n let indexToActivate = this.tabs.findIndex((tab, index) => tab.title === tabNameOrIndex || index === tabNameOrIndex)\n if (indexToActivate === this.activeTabIndex) return\n if (indexToActivate !== -1) {\n this.changeTab(this.activeTabIndex, indexToActivate)\n } else {\n this.changeTab(this.activeTabIndex, 0)\n }\n },\n renderTabTitle (index, position = 'top') {\n if (this.tabs.length === 0) return\n let tab = this.tabs[index]\n let {active, title} = tab\n let titleStyles = {color: this.activeTabColor}\n if (position === 'center') titleStyles.color = this.activeTextColor\n let simpleTitle = ({position === 'center' && this.renderIcon(index)}{title})\n\n if (tab.$slots.title) return tab.$slots.title\n if (tab.$scopedSlots.title) return tab.$scopedSlots.title({\n active: active,\n title: title,\n position: position,\n icon: tab.icon,\n data: tab.tabData\n });\n return simpleTitle\n },\n renderIcon (index) {\n if (this.tabs.length === 0) return\n let tab = this.tabs[index]\n let {icon} = tab\n let simpleIcon =  \n if (!tab.$slots.title && icon) return simpleIcon\n },\n tabStyles (tab) {\n if (tab.disabled) {\n return {\n backgroundColor: this.disabledColor,\n color: this.disabledTextColor\n }\n }\n return {}\n },\n renderTabs () {\n return this.tabs.map((tab, index) => {\n if (!tab) return\n let {route, id, title, icon, tabId} = tab\n let active = this.activeTabIndex === index\n return (\n
  • !tab.disabled && this.navigateToTab(index, route)}\n class={['tab', {active: active}, {disabled: tab.disabled}]}\n key={title}\n id={`t-${tabId}`}\n aria-selected={active}\n aria-controls={`p-${tabId}`}\n role=\"tab\">\n {this.textPosition === 'top' &&\n this.renderTabTitle(index, this.textPosition)\n }\n {\n e.preventDefault();\n return false;\n }}\n style={active ? this.activeTabStyle : this.tabStyles(tab)}\n class={[{'active_tab': active}, 'tabs__link']}\n role=\"tab\">\n {this.textPosition !== 'center' && !tab.$slots.title && this.renderIcon(index)}\n {this.textPosition === 'center' &&\n this.renderTabTitle(index, this.textPosition)\n }\n \n {this.textPosition === 'bottom' &&\n this.renderTabTitle(index, this.textPosition)\n }\n
  • \n )\n })\n }\n },\n render () {\n const tabList = this.renderTabs()\n return (\n
    \n
    \n
    \n
      \n {tabList}\n
    \n
    \n
    \n
    \n {this.$slots.default}\n
    \n
    )\n },\n watch: {\n tabs (newList) {\n if (newList.length > 0 && !this.value) {\n if (newList.length <= this.activeTabIndex) {\n this.activateTab(this.activeTabIndex - 1);\n } else {\n this.activateTab(this.activeTabIndex);\n }\n }\n if (newList.length > 0 && this.value) {\n this.findTabAndActivate(this.value)\n }\n },\n value (newVal) {\n this.findTabAndActivate(newVal)\n }\n }\n}\n","export default {\n name: 'v-tab',\n props: {\n title: {\n type: String,\n default: ''\n },\n icon: {\n type: String,\n default: ''\n },\n tabData: {\n default: null\n },\n /***\n * Function to execute before tab switch. Return value must be boolean\n * If the return result is false, tab switch is restricted\n */\n beforeChange: {\n type: Function\n },\n id: String,\n route: {\n type: [String, Object]\n },\n disabled: Boolean,\n transitionName: String,\n transitionMode: String\n },\n computed: {\n isValidParent () {\n return this.$parent.$options.name === 'vue-tabs'\n },\n hash () {\n return `#${this.id}`\n },\n tabId () {\n return this.id ? this.id : this.title\n }\n },\n data () {\n return {\n active: false,\n validationError: null\n }\n },\n mounted () {\n this.$parent.addTab(this)\n },\n destroyed () {\n if (this.$el && this.$el.parentNode) {\n this.$el.parentNode.removeChild(this.$el);\n }\n this.$parent.removeTab(this);\n },\n render () {\n return (\n
    \n {this.$slots.default}\n
    )\n }\n}\n","import VueTabs from './components/VueTabs.js'\nimport VTab from './components/VTab.js'\nconst VueTabsPlugin = {\n install(Vue) {\n Vue.component('vue-tabs', VueTabs)\n Vue.component('v-tab', VTab)\n }\n}\n// Automatic installation if Vue has been added to the global scope.\nif (typeof window !== 'undefined' && window.Vue) {\n window.Vue.use(VueTabsPlugin)\n window.VueTabs = VueTabsPlugin\n}\nexport default VueTabsPlugin\nexport {\n VueTabs,\n VTab\n}"],"names":["nestRE","objs","reduce","a","b","aa","bb","key","nestedKey","temp","test","mergeFn","Array","isArray","concat","apply","this","arguments","String","Boolean","Number","Object","type","direction","isTabShape","centered","isStacked","activeTabColor","activeTextColor","index","route","changeTab","activeTabIndex","tab","tabs","active","$emit","title","oldIndex","newIndex","oldTab","newTab","disabled","tryChangeRoute","$router","push","item","$slots","default","indexOf","$vnode","splice","filter","comp","componentOptions","tabNameOrIndex","indexToActivate","findIndex","position","length","titleStyles","color","simpleTitle","h","class","style","renderIcon","$scopedSlots","icon","tabData","simpleIcon","disabledColor","disabledTextColor","map","id","tabId","_this","name","navigateToTab","textPosition","renderTabTitle","href","activeTabStyle","tabStyles","active_tab","e","preventDefault","tabList","renderTabs","stackedClass","nav-tabs-navigation","left-vertical-tabs","classList","role","right-text-tabs","newList","value","activateTab","findTabAndActivate","newVal","Function","$parent","$options","addTab","$el","parentNode","removeChild","removeTab","VueTabsPlugin","Vue","component","VueTabs","VTab","window","use"],"mappings":";;;;;0LAAA,IAAIA,EAAS,iDAEI,SAAwBC,UAChCA,EAAKC,OAAO,SAAUC,EAAGC,OAC1BC,EAAIC,EAAIC,EAAKC,EAAWC,MACvBF,KAAOH,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mBC,cCpN1B,2BAGQjF,eACG,eAGHA,eACG,qBAGA,yBAOHkF,aAENlF,oBAEOA,OAAQG,kBAETF,uBACMD,sBACAA,iDAI0B,aAA/BF,KAAKqF,QAAQC,SAASzB,gCAGlB7D,KAAK0D,4BAGT1D,KAAK0D,GAAK1D,KAAK0D,GAAK1D,KAAKqB,uCAKxB,kBACS,+BAIhBgE,QAAQE,OAAOvF,4BAGhBA,KAAKwF,KAAOxF,KAAKwF,IAAIC,iBAChBD,IAAIC,WAAWC,YAAY1F,KAAKwF,UAEpCH,QAAQM,UAAU3F,gCAInB+C,2BAASC,MAAM,uBACNU,QAAS1D,KAAK2D,6BACQ3D,KAAK2D,WACtB,2CAAmB3D,KAAKmB,WACjCnB,KAAK+B,OAAOC,YC3DvB4D,oBACIC,KACFC,UAAU,WAAYC,KACtBD,UAAU,QAASE,KAIL,oBAAXC,QAA0BA,OAAOJ,aACnCA,IAAIK,IAAIN,UACRG,QAAUH"} \ No newline at end of file +{"version":3,"file":"vue-tabs.min.js","sources":["../node_modules/babel-helper-vue-jsx-merge-props/index.js","../src/components/VueTabs.js","../src/components/VTab.js","../src/index.js"],"sourcesContent":["var nestRE = /^(attrs|props|on|nativeOn|class|style|hook)$/\n\nmodule.exports = function mergeJSXProps (objs) {\n return objs.reduce(function (a, b) {\n var aa, bb, key, nestedKey, temp\n for (key in b) {\n aa = a[key]\n bb = b[key]\n if (aa && nestRE.test(key)) {\n // normalize class\n if (key === 'class') {\n if (typeof aa === 'string') {\n temp = aa\n a[key] = aa = {}\n aa[temp] = true\n }\n if (typeof bb === 'string') {\n temp = bb\n b[key] = bb = {}\n bb[temp] = true\n }\n }\n if (key === 'on' || key === 'nativeOn' || key === 'hook') {\n // merge functions\n for (nestedKey in bb) {\n aa[nestedKey] = mergeFn(aa[nestedKey], bb[nestedKey])\n }\n } else if (Array.isArray(aa)) {\n a[key] = aa.concat(bb)\n } else if (Array.isArray(bb)) {\n a[key] = [aa].concat(bb)\n } else {\n for (nestedKey in bb) {\n aa[nestedKey] = bb[nestedKey]\n }\n }\n } else {\n a[key] = b[key]\n }\n }\n return a\n }, {})\n}\n\nfunction mergeFn (a, b) {\n return function () {\n a.apply(this, arguments)\n b.apply(this, arguments)\n }\n}\n","export default {\n name: 'vue-tabs',\n props: {\n activeTabColor: String,\n activeTextColor: String,\n disabledColor: String,\n disabledTextColor: String,\n /**\n * Tab title position: center | bottom | top\n */\n textPosition: {\n type: String,\n default: 'center'\n },\n /**\n * Tab type: tabs | pills\n */\n type: {\n type: String,\n default: 'tabs'\n },\n direction: {\n type: String,\n default: 'horizontal'\n },\n /**\n * Centers the tabs and makes the container div full width\n */\n centered: Boolean,\n value: [String, Number, Object]\n },\n data () {\n return {\n activeTabIndex: 0,\n tabs: []\n }\n },\n computed: {\n isTabShape () {\n return this.type === 'tabs'\n },\n isStacked () {\n return this.direction === 'vertical'\n },\n classList () {\n let navType = this.isTabShape ? 'nav-tabs' : 'nav-pills'\n let centerClass = this.centered ? 'nav-justified' : ''\n let isStacked = this.isStacked ? 'nav-stacked' : ''\n return `nav ${navType} ${centerClass} ${isStacked}`\n },\n stackedClass () {\n return this.isStacked ? 'stacked' : ''\n },\n activeTabStyle () {\n return {\n backgroundColor: this.activeTabColor,\n color: this.activeTextColor\n }\n }\n },\n methods: {\n navigateToTab (index, route) {\n this.changeTab(this.activeTabIndex, index, route)\n },\n activateTab (index) {\n this.activeTabIndex = index\n let tab = this.tabs[index]\n tab.active = true\n this.$emit('input', tab.title)\n },\n changeTab (oldIndex, newIndex, route) {\n let oldTab = this.tabs[oldIndex] || {}\n let newTab = this.tabs[newIndex]\n if (newTab.disabled) return;\n this.activeTabIndex = newIndex\n oldTab.active = false\n newTab.active = true\n this.$emit('input', this.tabs[newIndex].title)\n this.$emit('tab-change', newIndex, newTab, oldTab)\n this.tryChangeRoute(route)\n },\n tryChangeRoute (route) {\n if (this.$router && route) {\n this.$router.push(route)\n }\n },\n addTab (item) {\n const index = this.$slots.default.indexOf(item.$vnode);\n this.tabs.splice(index, 0, item);\n },\n removeTab (item) {\n const tabs = this.tabs;\n const index = tabs.indexOf(item);\n if (index > -1) {\n tabs.splice(index, 1);\n }\n },\n getTabs () {\n if (this.$slots.default) {\n return this.$slots.default.filter(comp => comp.componentOptions)\n }\n return []\n },\n findTabAndActivate (tabNameOrIndex) {\n let indexToActivate = this.tabs.findIndex((tab, index) => tab.title === tabNameOrIndex || index === tabNameOrIndex)\n if (indexToActivate === this.activeTabIndex) return\n if (indexToActivate !== -1) {\n this.changeTab(this.activeTabIndex, indexToActivate)\n } else {\n this.changeTab(this.activeTabIndex, 0)\n }\n },\n renderTabTitle (index, position = 'top') {\n if (this.tabs.length === 0) return\n let tab = this.tabs[index]\n let {active, title} = tab\n let titleStyles = {color: this.activeTabColor}\n if (position === 'center') titleStyles.color = this.activeTextColor\n let simpleTitle = ({position === 'center' && this.renderIcon(index)}{title})\n\n if (tab.$slots.title) return tab.$slots.title\n if (tab.$scopedSlots.title) return tab.$scopedSlots.title({\n active: active,\n title: title,\n position: position,\n icon: tab.icon,\n data: tab.tabData\n });\n return simpleTitle\n },\n renderIcon (index) {\n if (this.tabs.length === 0) return\n let tab = this.tabs[index]\n let {icon} = tab\n let simpleIcon =  \n if (!tab.$slots.title && icon) return simpleIcon\n },\n tabStyles (tab) {\n if (tab.disabled) {\n return {\n backgroundColor: this.disabledColor,\n color: this.disabledTextColor\n }\n }\n return {}\n },\n renderTabs () {\n return this.tabs.map((tab, index) => {\n if (!tab) return\n let {route, id, title, icon, tabId} = tab\n let active = this.activeTabIndex === index\n return (\n
  • !tab.disabled && this.navigateToTab(index, route)}\n class={['tab', {active: active}, {disabled: tab.disabled}]}\n key={title}\n id={`t-${tabId}`}\n aria-selected={active}\n aria-controls={`p-${tabId}`}\n role=\"tab\">\n {this.textPosition === 'top' &&\n this.renderTabTitle(index, this.textPosition)\n }\n {\n e.preventDefault();\n return false;\n }}\n style={active ? this.activeTabStyle : this.tabStyles(tab)}\n class={[{'active_tab': active}, 'tabs__link']}\n role=\"tab\">\n {this.textPosition !== 'center' && !tab.$slots.title && this.renderIcon(index)}\n {this.textPosition === 'center' &&\n this.renderTabTitle(index, this.textPosition)\n }\n \n {this.textPosition === 'bottom' &&\n this.renderTabTitle(index, this.textPosition)\n }\n
  • \n )\n })\n }\n },\n render () {\n const tabList = this.renderTabs()\n return (\n
    \n
    \n
    \n
      \n {tabList}\n
    \n
    \n
    \n
    \n {this.$slots.default}\n
    \n
    )\n },\n watch: {\n tabs (newList) {\n if (newList.length > 0 && !this.value) {\n if (newList.length <= this.activeTabIndex) {\n this.activateTab(this.activeTabIndex - 1);\n } else {\n this.activateTab(this.activeTabIndex);\n }\n }\n if (newList.length > 0 && this.value) {\n this.findTabAndActivate(this.value)\n }\n },\n value (newVal) {\n this.findTabAndActivate(newVal)\n }\n }\n}\n","export default {\n name: 'v-tab',\n props: {\n title: {\n type: String,\n default: ''\n },\n icon: {\n type: String,\n default: ''\n },\n tabData: {\n default: null\n },\n /***\n * Function to execute before tab switch. Return value must be boolean\n * If the return result is false, tab switch is restricted\n */\n beforeChange: {\n type: Function\n },\n id: String,\n route: {\n type: [String, Object]\n },\n disabled: Boolean,\n transitionName: String,\n transitionMode: String\n },\n computed: {\n isValidParent () {\n return this.$parent.$options.name === 'vue-tabs'\n },\n hash () {\n return `#${this.id}`\n },\n tabId () {\n return this.id ? this.id : this.title\n }\n },\n data () {\n return {\n active: false,\n validationError: null\n }\n },\n mounted () {\n this.$parent.addTab(this)\n },\n destroyed () {\n if (this.$el && this.$el.parentNode) {\n this.$el.parentNode.removeChild(this.$el);\n }\n this.$parent.removeTab(this);\n },\n render () {\n return (\n
    \n {this.$slots.default}\n
    )\n }\n}\n","import VueTabs from './components/VueTabs.js'\nimport VTab from './components/VTab.js'\nconst VueTabsPlugin = {\n install(Vue) {\n Vue.component('vue-tabs', VueTabs)\n Vue.component('v-tab', VTab)\n }\n}\n// Automatic installation if Vue has been added to the global scope.\nif (typeof window !== 'undefined' && window.Vue) {\n window.Vue.use(VueTabsPlugin)\n window.VueTabs = VueTabsPlugin\n}\nexport default VueTabsPlugin\nexport {\n VueTabs,\n VTab\n}"],"names":["nestRE","objs","reduce","a","b","aa","bb","key","nestedKey","temp","test","apply","this","arguments","mergeFn","Array","isArray","concat","String","Boolean","Number","Object","type","direction","isTabShape","centered","isStacked","activeTabColor","activeTextColor","index","route","changeTab","activeTabIndex","tab","tabs","active","$emit","title","oldIndex","newIndex","oldTab","newTab","disabled","tryChangeRoute","$router","push","item","$slots","default","indexOf","$vnode","splice","filter","comp","componentOptions","tabNameOrIndex","indexToActivate","findIndex","position","length","titleStyles","color","simpleTitle","h","class","style","renderIcon","$scopedSlots","icon","tabData","simpleIcon","disabledColor","disabledTextColor","map","id","tabId","_this","name","navigateToTab","textPosition","renderTabTitle","href","activeTabStyle","tabStyles","active_tab","e","preventDefault","tabList","renderTabs","stackedClass","nav-tabs-navigation","left-vertical-tabs","classList","role","right-text-tabs","newList","value","activateTab","findTabAndActivate","newVal","Function","$parent","$options","addTab","$el","parentNode","removeChild","removeTab","VueTabsPlugin","Vue","component","VueTabs","VTab","window","use"],"mappings":";;;;;0LAAA,IAAIA,EAAS,iDAEI,SAAwBC,UAChCA,EAAKC,OAAO,SAAUC,EAAGC,OAC1BC,EAAIC,EAAIC,EAAKC,EAAWC,MACvBF,KAAOH,OACLD,EAAEI,KACFH,EAAEG,GACHF,GAAML,EAAOU,KAAKH,MAER,UAARA,IACgB,iBAAPF,MACFA,IACLE,GAAOF,OACNI,IAAQ,GAEK,iBAAPH,MACFA,IACLC,GAAOD,OACNG,IAAQ,IAGH,OAARF,GAAwB,aAARA,GAA8B,SAARA,MAEnCC,KAAaF,IACbE,GAmBf,SAAkBL,EAAGC,UACZ,aACHO,MAAMC,KAAMC,aACZF,MAAMC,KAAMC,YAtBUC,CAAQT,EAAGG,GAAYF,EAAGE,SAEvC,GAAIO,MAAMC,QAAQX,KACrBE,GAAOF,EAAGY,OAAOX,QACd,GAAIS,M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