vue-material-tabs
Advanced tools
Comparing version 1.1.0 to 1.1.1
@@ -820,7 +820,8 @@ function calc(e) { | ||
tabItemActive(newTabItem, oldTabItem) { | ||
this.tabItemIndexes.previous = this.findIndexTab(oldTabItem); | ||
this.tabItemIndexes.current = this.findIndexTab(newTabItem); | ||
this.tabItems[this.tabItemIndexes.current].activeModel = newTabItem.model; | ||
this.tabItemIndexes.previous = this.finTabIndex(oldTabItem); | ||
this.tabItemIndexes.current = this.finTabIndex(newTabItem); | ||
if (!(newTabItem !== null && newTabItem !== void 0 && newTabItem.model)) return; | ||
this.tabItems[this.tabItemIndexes.current].activeModel = newTabItem.model; // eslint-disable-next-line no-extra-boolean-cast | ||
if (this.tabItemIndexes.previous > -1) { | ||
if (Boolean(~this.tabItemIndexes.previous)) { | ||
this.setTabItemTransitionSide(); | ||
@@ -836,3 +837,5 @@ this.tabItems[this.tabItemIndexes.previous].activeModel = newTabItem.model; | ||
this.$nextTick(() => { | ||
const navItem = this.navItems[value]; | ||
var _this$navItems; | ||
const navItem = (_this$navItems = this.navItems) === null || _this$navItems === void 0 ? void 0 : _this$navItems[value]; | ||
navItem && this.activeTabItem(navItem); | ||
@@ -855,3 +858,3 @@ }); | ||
this.disableTabItem(tabItemInstance.ownNavItemIndex); | ||
this.tabItems.splice(this.findIndexTab(tabItemInstance), 1); | ||
this.tabItems.splice(this.finTabIndex(tabItemInstance), 1); | ||
this.navItems.splice(tabItemInstance.ownNavItemIndex, 1); | ||
@@ -888,3 +891,3 @@ this.tabItemIndexes.last = this.navItems.length - 1; | ||
this.tabItemActive = tabItem; | ||
this.$emit("input", this.findIndexTab(tabItem)); | ||
this.$emit("input", this.finTabIndex(tabItem)); | ||
} | ||
@@ -921,5 +924,5 @@ }, | ||
const switchTab = count => { | ||
var _this$navItems; | ||
var _this$navItems2; | ||
const tabItem = (_this$navItems = this.navItems) === null || _this$navItems === void 0 ? void 0 : _this$navItems[current + count]; | ||
const tabItem = (_this$navItems2 = this.navItems) === null || _this$navItems2 === void 0 ? void 0 : _this$navItems2[current + count]; | ||
tabItem && this.activeTabItem(tabItem); | ||
@@ -933,4 +936,4 @@ }; | ||
findIndexTab(tab) { | ||
return this.tabItems.findIndex(el => el.model == tab.model); | ||
finTabIndex(tab) { | ||
return this.tabItems.findIndex(el => el.model === (tab === null || tab === void 0 ? void 0 : tab.model)); | ||
} | ||
@@ -984,4 +987,4 @@ | ||
if (!inject) return; | ||
inject("data-v-63b9393a_0", { | ||
source: ".tabs[data-v-63b9393a]{background:#fff;display:flex;flex-direction:column;border-radius:.23rem;height:100%;width:100%}.tabs__content[data-v-63b9393a]{display:flex;position:relative;justify-content:center;align-items:center;overflow:hidden}.tabs--vertical[data-v-63b9393a]{flex-direction:row}", | ||
inject("data-v-1d334e66_0", { | ||
source: ".tabs[data-v-1d334e66]{background:#fff;display:flex;flex-direction:column;border-radius:.23rem;height:100%;width:100%}.tabs__content[data-v-1d334e66]{display:flex;position:relative;justify-content:center;align-items:center;overflow:hidden}.tabs--vertical[data-v-1d334e66]{flex-direction:row}", | ||
map: undefined, | ||
@@ -994,3 +997,3 @@ media: undefined | ||
const __vue_scope_id__$1 = "data-v-63b9393a"; | ||
const __vue_scope_id__$1 = "data-v-1d334e66"; | ||
/* module identifier */ | ||
@@ -1019,6 +1022,2 @@ | ||
// | ||
// | ||
// | ||
// | ||
// | ||
var script = { | ||
@@ -1051,3 +1050,3 @@ name: "TabItem", | ||
isActived() { | ||
isActive() { | ||
return this.activeModel === this.model && !this.disabled; | ||
@@ -1123,4 +1122,4 @@ }, | ||
rawName: "v-show", | ||
value: _vm.isActived, | ||
expression: "isActived" | ||
value: _vm.isActive, | ||
expression: "isActive" | ||
}], | ||
@@ -1139,4 +1138,4 @@ staticClass: "vmt__tab-item", | ||
if (!inject) return; | ||
inject("data-v-90aaa762_0", { | ||
source: ".vmt__tab-item[data-v-90aaa762]{top:0;left:0;z-index:1;width:100%;height:inherit;background:#fff;transition:transform cubic-bezier(.25,.8,.5,1)}.slide-left-enter[data-v-90aaa762],.slide-right-leave-to[data-v-90aaa762]{transform:translateX(-100%)}.slide-left-leave-to[data-v-90aaa762],.slide-right-enter[data-v-90aaa762]{transform:translateX(100%)}.slide-bottom-leave-to[data-v-90aaa762],.slide-top-enter[data-v-90aaa762]{transform:translateY(-100%)}.slide-bottom-enter[data-v-90aaa762],.slide-top-leave-to[data-v-90aaa762]{transform:translateY(100%)}", | ||
inject("data-v-5683d9d1_0", { | ||
source: ".vmt__tab-item[data-v-5683d9d1]{top:0;left:0;z-index:1;width:100%;height:inherit;background:#fff;transition:transform cubic-bezier(.25,.8,.5,1)}.slide-left-enter[data-v-5683d9d1],.slide-right-leave-to[data-v-5683d9d1]{transform:translateX(-100%)}.slide-left-leave-to[data-v-5683d9d1],.slide-right-enter[data-v-5683d9d1]{transform:translateX(100%)}.slide-bottom-leave-to[data-v-5683d9d1],.slide-top-enter[data-v-5683d9d1]{transform:translateY(-100%)}.slide-bottom-enter[data-v-5683d9d1],.slide-top-leave-to[data-v-5683d9d1]{transform:translateY(100%)}", | ||
map: undefined, | ||
@@ -1149,3 +1148,3 @@ media: undefined | ||
const __vue_scope_id__ = "data-v-90aaa762"; | ||
const __vue_scope_id__ = "data-v-5683d9d1"; | ||
/* module identifier */ | ||
@@ -1152,0 +1151,0 @@ |
@@ -1,1 +0,1 @@ | ||
var VueMaterialTabs=function(){"use strict";function t(e){return(t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(e)}function e(t,e,n,i,a,o,r){try{var s=t[o](r),d=s.value}catch(t){return void n(t)}s.done?e(d):Promise.resolve(d).then(i,a)}function n(t){return function(){var n=this,i=arguments;return new Promise((function(a,o){var r=t.apply(n,i);function s(t){e(r,a,o,s,d,"next",t)}function d(t){e(r,a,o,s,d,"throw",t)}s(void 0)}))}}function i(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=t&&("undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"]);if(null==n)return;var i,a,o=[],r=!0,s=!1;try{for(n=n.call(t);!(r=(i=n.next()).done)&&(o.push(i.value),!e||o.length!==e);r=!0);}catch(t){s=!0,a=t}finally{try{r||null==n.return||n.return()}finally{if(s)throw a}}return o}(t,e)||o(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function a(t){return function(t){if(Array.isArray(t))return r(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||o(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function o(t,e){if(t){if("string"==typeof t)return r(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(t,e):void 0}}function r(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=new Array(e);n<e;n++)i[n]=t[n];return i}function s(t){var e=function(t){var e=t.currentTarget.getBoundingClientRect(),n=t.clientX-e.left,i=t.clientY-e.top,a=Math.sqrt(Math.pow(t.currentTarget.clientWidth,2)+Math.pow(t.currentTarget.clientHeight,2))/2;return{left:"".concat(n-a,"px"),top:"".concat(i-a,"px"),size:"".concat(2*a,"px")}}(t),n=e.size,i=e.left,a=e.top,o=document.createElement("span");o.classList.add("ripple"),Object.assign(o.style,{height:n,width:n,top:a,left:i}),t.currentTarget.appendChild(o),setTimeout((function(){return o.remove()}),1e3)}function d(t,e){e.value?t.addEventListener("click",s):t.removeEventListener("click",s)}var l={bind:d,update:d,unbind:function(t){t.removeEventListener("click",s)}};var c={inserted:function(t,e){var n,i,a,o=0,r=function(t){return function(){var n;clearTimeout(o),o=setTimeout(t,Number(null===(n=e.value)||void 0===n?void 0:n.delay)||400)}};"function"==typeof e.value?t._onResize=null!==(a=e.modifiers)&&void 0!==a&&a.debounce?r(e.value):e.value:"function"==typeof(null===(n=e.value)||void 0===n?void 0:n.cb)&&null!==(i=e.modifiers)&&void 0!==i&&i.debounce&&(t._onResize=r(e.value.cb)),window.addEventListener("resize",t._onResize)},unbind:function(t){window.removeEventListener("resize",t._onResize),delete t._onResize}};var v={bind:function(t,e){"function"==typeof e.value&&(t._onTouch={callback:e.value,isSwiping:!1,touchstartX:0,onTouchStart:function(t){this._onTouch.isSwiping=!0,this._onTouch.touchstartX=t.touches[0].clientX},onTouchMove:function(e){return function(t,e){if(e._onTouch.isSwiping){var n=t.changedTouches[0].clientX,i=Math.abs(.1*e.offsetWidth),a=e._onTouch.touchstartX-n,o=function(t){e._onTouch.isSwiping=!1,e._onTouch.callback(t)};a>i&&o("next"),a<-i&&o("prev")}}(e,t)}},t.addEventListener("touchstart",t._onTouch.onTouchStart),t.addEventListener("touchmove",t._onTouch.onTouchMove))},unbind:function(t){t._onTouch&&(t.removeEventListener("touchstart",t._onTouch.onTouchStart),t.removeEventListener("touchmove",t._onTouch.onTouchMove),delete t._onTouch)}};function u(t,e,n,i,a,o,r,s,d,l){"boolean"!=typeof r&&(d=s,s=r,r=!1);const c="function"==typeof n?n.options:n;let v;if(t&&t.render&&(c.render=t.render,c.staticRenderFns=t.staticRenderFns,c._compiled=!0,a&&(c.functional=!0)),i&&(c._scopeId=i),o?(v=function(t){(t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),e&&e.call(this,d(t)),t&&t._registeredComponents&&t._registeredComponents.add(o)},c._ssrRegister=v):e&&(v=r?function(t){e.call(this,l(t,this.$root.$options.shadowRoot))}:function(t){e.call(this,s(t))}),v)if(c.functional){const t=c.render;c.render=function(e,n){return v.call(n),t(e,n)}}else{const t=c.beforeCreate;c.beforeCreate=t?[].concat(t,v):[v]}return n}const f="undefined"!=typeof navigator&&/msie [6-9]\\b/.test(navigator.userAgent.toLowerCase());function m(t){return(t,e)=>function(t,e){const n=f?e.media||"default":t,i=p[n]||(p[n]={ids:new Set,styles:[]});if(!i.ids.has(t)){i.ids.add(t);let n=e.source;if(e.map&&(n+="\n/*# sourceURL="+e.map.sources[0]+" */",n+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(e.map))))+" */"),i.element||(i.element=document.createElement("style"),i.element.type="text/css",e.media&&i.element.setAttribute("media",e.media),void 0===h&&(h=document.head||document.getElementsByTagName("head")[0]),h.appendChild(i.element)),"styleSheet"in i.element)i.styles.push(n),i.element.styleSheet.cssText=i.styles.filter(Boolean).join("\n");else{const t=i.ids.size-1,e=document.createTextNode(n),a=i.element.childNodes;a[t]&&i.element.removeChild(a[t]),a.length?i.element.insertBefore(e,a[t]):i.element.appendChild(e)}}}(t,e)}let h;const p={};var b=u({render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{directives:[{name:"resize",rawName:"v-resize.debounce",value:t.resizable,expression:"resizable",modifiers:{debounce:!0}}],class:t.classes},[n("div",{staticClass:"vmt__nav__prev"},[t.pagination.has?n("Btn",{attrs:{disabled:!t.paginateIndicator.prev},on:{click:function(e){return t.paginationTo("prev")}}}):t._e()],1),t._v(" "),n("nav",{directives:[{name:"touch",rawName:"v-touch",value:t.paginationTo,expression:"paginationTo"}],ref:"nav",staticClass:"tab__nav"},[n("ul",{ref:"navItems",staticClass:"vmt__nav__items",style:t.transform},[t._l(t.navItems,(function(e){return n("li",{directives:[{name:"ripple",rawName:"v-ripple",value:t.ripple&&!e.disabled,expression:"ripple && !navItem.disabled"}],key:e.model,ref:e.model,refInFor:!0,staticClass:"vmt__nav__item",class:{active:e.model===t.tabItemActive.model,disabled:e.disabled},style:t.getActiveColor(e),on:{click:function(n){return n.preventDefault(),t.select(e)}}},[n("VNode",{attrs:{node:e.nameSlot,name:e.name}})],1)})),t._v(" "),t.navSlider?n("hr",{ref:"slider",staticClass:"vmt__tab__slider"}):t._e()],2)]),t._v(" "),n("div",{staticClass:"vmt__nav__next"},[t.pagination.has?n("Btn",{attrs:{disabled:!t.paginateIndicator.next},on:{click:function(e){return t.paginationTo("next")}}}):t._e()],1)])},staticRenderFns:[]},(function(t){t&&(t("data-v-7d287132_0",{source:".vmt__nav[data-v-7d287132]{display:flex;justify-content:space-between;align-items:center;vertical-align:middle;max-width:100%;flex:0 1 auto;position:relative;contain:content}.vmt__nav .vmt__nav__prev[data-v-7d287132],.vmt__nav__next[data-v-7d287132]{flex:1 40px;min-width:40px}.vmt__nav__next[data-v-7d287132] .vmt__btn svg{transform:rotate(180deg)}.vmt__nav nav[data-v-7d287132]{position:relative;display:flex;overflow:hidden;flex:1 100%}.vmt__nav__items[data-v-7d287132]{position:relative;display:flex;margin:0;padding:0;flex:1 auto;transition:.3s cubic-bezier(.25,.8,.5,1);height:100%}.vmt__nav__items .vmt__nav__item[data-v-7d287132]{list-style:none;text-align:center;cursor:pointer;padding:.9rem 1rem;letter-spacing:.0892857143em;display:flex;justify-content:center;align-items:center;text-align:center;text-transform:uppercase;font-size:.875rem;font-weight:500;white-space:normal;transition:background .1s ease;position:relative;overflow:hidden;min-width:90px;max-width:360px;user-select:none}.vmt__nav__items .vmt__nav__item[data-v-7d287132]:hover:not(.disabled,.active){background:hsla(0,0%,100%,.09)}.vmt__nav__items .active[data-v-7d287132]:hover{background:hsla(0,0%,100%,.18)}.vmt__nav__items .disabled[data-v-7d287132]{background:#6969694f}.vmt__tab__slider[data-v-7d287132]{height:2px;width:2px;border:none;margin:0;padding:0;bottom:0;position:absolute;transition:left .3s cubic-bezier(.25,.8,.5,1),top .3s cubic-bezier(.25,.8,.5,1)}.vmt__nav--vertical[data-v-7d287132]{flex-direction:column}.vmt__nav--vertical .vmt__nav__items[data-v-7d287132]{flex-direction:column;flex:1 auto;position:relative}.vmt__nav--vertical .vmt__nav__item *[data-v-7d287132]{padding:0;margin:0}.vmt__nav--vertical[data-v-7d287132] .vmt__nav__prev svg{transform:rotate(90deg)}.vmt__nav--vertical[data-v-7d287132] .vmt__nav__next svg{transform:rotate(270deg)}.vmt__nav--vertical .vmt__nav__item[data-v-7d287132]{justify-content:left;padding-top:1.6rem;padding-bottom:1.6rem}.vmt__nav--auto .vmt__nav__item[data-v-7d287132]{flex:1 auto}",map:void 0,media:void 0}),t("data-v-7d287132_1",{source:".ripple{z-index:2;background-color:hsla(0,0%,100%,.23);border-radius:50%;position:absolute;transform:scale(0);animation:ripple .6s linear}@keyframes ripple{to{transform:scale(2.5);opacity:0}}",map:void 0,media:void 0}))}),{inject:["theme"],components:{Btn:u({render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("button",{staticClass:"vmt__btn",on:{click:function(e){return t.$emit("click")}}},[n("svg",{style:{fill:t.theme.arrow},attrs:{viewBox:"0 0 24 24",role:"img","aria-hidden":"true"}},[n("path",{attrs:{d:"M15.41,16.58L10.83,12L15.41,7.41L14,6L8,12L14,18L15.41,16.58Z"}})])])},staticRenderFns:[]},(function(t){t&&t("data-v-c67981d6_0",{source:".vmt__btn[data-v-c67981d6]{outline:0;border:none;background:0 0;cursor:pointer}.vmt__btn svg[data-v-c67981d6]{height:24px;width:24px;fill:rgba(214,213,213,.925)}.vmt__btn:disabled svg[data-v-c67981d6]{fill:#d6d6d652!important;cursor:default}",map:void 0,media:void 0})}),{name:"Btn",inject:["theme"]},"data-v-c67981d6",false,undefined,!1,m,void 0,void 0),VNode:{functional:!0,render:function(t,e){var n=e.props;return n.node?n.node:t("span",n.name)}}},directives:{ripple:l,resize:c,touch:v},props:{vertical:Boolean,navSlider:Boolean,ripple:Boolean,navAuto:Boolean,navItems:{type:Array,required:!0},tabItemActive:{type:Object,default:function(){}}},data:function(){return{pagination:{has:!1,maxOffset:0,minOffset:0,translate:0,offset:0}}},computed:{classes:function(){return{vmt__nav:!0,"vmt__nav--vertical":this.vertical,"vmt__nav--auto":this.navAuto&&!this.vertical}},transform:function(){return"transform: translate".concat(this.vertical?"Y":"X","(-").concat(this.pagination.translate,"px)")},paginateIndicator:function(){var t=this.pagination,e=t.translate;return{next:e<t.maxOffset,prev:e>0}},orientation:function(){return this.vertical?"portrait":"landscape"},sliderElement:function(){var t;return null===(t=this.$refs)||void 0===t?void 0:t.slider}},watch:{navItems:"resizable",vertical:function(){Object.assign(this.$data,this.$options.data()),this.resizable()},tabItemActive:function(t){if(this.setSliderPosition(),this.pagination.has&&null!=t&&t.model){var e,n,i=this.$refs[t.model][0],a=this.$refs.nav,o=null==i||null===(e=i.getClientRects())||void 0===e?void 0:e[0],r=null==a||null===(n=a.getClientRects())||void 0===n?void 0:n[0];if(!o||!r)return;var s=this.pagination,d=s.translate,l=s.maxOffset,c=d;"portrait"===this.orientation&&(o.bottom>r.bottom&&(c+=o.height),o.top<r.top&&(c=o.height>c?0:c-o.height)),"landscape"===this.orientation&&(o.right>r.right&&(c+=o.width),o.left<r.left&&(c=o.width>c?0:c-o.width),c>l&&(c+=l-c)),this.pagination.translate=Math.abs(c)}}},mounted:function(){var t=this.theme,e=t.nav,n=t.navItem,i=t.slider;this.$el.style.background=e,this.$refs.navItems.style.color=n,this.sliderElement&&(this.sliderElement.style.background=i)},methods:{select:function(t){this.$emit("select",t)},setSliderPosition:function(){var t=this;return n(regeneratorRuntime.mark((function e(){var n,i,a,o,r,s,d,l,c;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.$nextTick();case 2:if(s=null===(n=t.tabItemActive)||void 0===n?void 0:n.model){e.next=5;break}return e.abrupt("return");case 5:d=null===(i=t.$refs.navItems)||void 0===i||null===(a=i.getClientRects())||void 0===a?void 0:a[0],l=null===(o=t.$refs[s][0])||void 0===o||null===(r=o.getClientRects())||void 0===r?void 0:r[0],t.sliderElement&&Object.assign(null===(c=t.sliderElement)||void 0===c?void 0:c.style,{portrait:{height:l.height+"px",top:l.top-d.top+"px",width:"",left:""},landscape:{width:l.width+"px",left:l.left-d.left+"px",height:"",top:""}}[t.orientation]);case 8:case"end":return e.stop()}}),e)})))()},setPaginationSettings:function(){var t,e=function(t,e,n){return{has:t,maxOffset:e,minOffset:n,offset:n}},n=this.$refs.nav,i=null==n?void 0:n.offsetWidth,o=null==n?void 0:n.offsetHeight,r=null===(t=this.$refs)||void 0===t?void 0:t.navItems,s=null==r?void 0:r.offsetWidth,d=a(null==r?void 0:r.children).slice(0,-1).reduce((function(t,e){return t+e.offsetHeight}),0);Object.assign(this.pagination,{portrait:e(d>o,d-o,o),landscape:e(s>i,s-i,i)}[this.orientation]),0===this.pagination.maxOffset&&(this.pagination.translate=0)},paginationTo:function(t){var e=this.pagination,n=e.maxOffset,i=e.offset,a=e.translate,o=e.minOffset;if("prev"===t&&this.paginateIndicator.prev){if(i<=o&&(this.pagination.offset=o),a-i<i)return void(this.pagination.translate=0);this.pagination.translate=a-i}"next"===t&&this.paginateIndicator.next&&(a+i>n&&(this.pagination.offset=n-a),this.pagination.translate=a+this.pagination.offset)},resizable:function(){var t=this;return n(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.$nextTick();case 2:t.setPaginationSettings(),t.setSliderPosition();case 4:case"end":return e.stop()}}),e)})))()},getActiveColor:function(t){if(t.model===this.tabItemActive.model)return{color:this.theme.navActiveItem}}}},"data-v-7d287132",false,undefined,!1,m,void 0,void 0),_=function(t,e,n,i,a){return{nav:t,navItem:e,navActiveItem:n,slider:i,arrow:a}},g={default:_("#fff","#000000","#1867c0","#1867c0","#616161"),purple:_("#4A148C","#BDBDBD","#fff","#CE93D8","#f3f3f3"),red:_("#F44336","#f3f3f3","#fff","#EF9A9A","#f3f3f3"),pink:_("#E91E63","#F8BBD0","#fff","#F8BBD0","#f3f3f3"),cyan:_("#00BCD4","#B2EBF2","#fff","#80DEEA","#f3f3f3"),green:_("#4CAF50","#C8E6C9","#fff","#A5D6A7","#f3f3f3")},I=u({render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{class:t.classes},[t._t("nav",[n("TabNav",t._b({on:{select:t.activeTabItem}},"TabNav",{ripple:t.ripple,navAuto:t.navAuto,navItems:t.navItems,vertical:t.vertical,navSlider:t.navSlider,tabItemActive:t.tabItemActive},!1))],{items:t.navItems,active:t.tabItemActive}),t._v(" "),n("div",{directives:[{name:"touch",rawName:"v-touch",value:t.switchTabItem,expression:"switchTabItem"}],staticClass:"tabs__content"},[t._t("default")],2)],2)},staticRenderFns:[]},(function(t){t&&t("data-v-63b9393a_0",{source:".tabs[data-v-63b9393a]{background:#fff;display:flex;flex-direction:column;border-radius:.23rem;height:100%;width:100%}.tabs__content[data-v-63b9393a]{display:flex;position:relative;justify-content:center;align-items:center;overflow:hidden}.tabs--vertical[data-v-63b9393a]{flex-direction:row}",map:void 0,media:void 0})}),{name:"Tabs",components:{TabNav:b},directives:{touch:v},provide:function(){return{theme:this.getTheme}},props:{value:[Number,String],theme:{type:[Object,String],default:"default"},vertical:Boolean,ripple:{type:Boolean,default:!0},slideDuration:{type:[String,Number],default:200},slideVertical:Boolean,slide:{type:Boolean,default:!0},navAuto:Boolean,navSlider:{type:Boolean,default:!0},noTouch:Boolean},data:function(){return{slideSide:"",navItems:[],tabItemActive:{model:"",name:"",disabled:!1},tabItemIndexes:{current:0,last:0,previous:0},tabItems:[]}},computed:{classes:function(){return{tabs:!0,"tabs--vertical":this.vertical}},transition:function(){return{slide:this.slide,duration:this.slide?this.slideDuration:0,vertical:this.slideVertical,side:this.slideSide}},getTheme:function(){return"string"==typeof this.theme?g[this.theme]||g.default:"object"===t(this.theme)&&this.theme?this.theme:g.default}},watch:{tabItemActive:function(t,e){this.tabItemIndexes.previous=this.findIndexTab(e),this.tabItemIndexes.current=this.findIndexTab(t),this.tabItems[this.tabItemIndexes.current].activeModel=t.model,this.tabItemIndexes.previous>-1&&(this.setTabItemTransitionSide(),this.tabItems[this.tabItemIndexes.previous].activeModel=t.model)},value:{immediate:!0,handler:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;this.$nextTick((function(){var n=t.navItems[e];n&&t.activeTabItem(n)}))}}},methods:{register:function(t){this.isTabItemComponent(t)&&(this.tabItems.push(t),this.setNavItem(t))},unRegister:function(t){this.isTabItemComponent(t)&&(this.disableTabItem(t.ownNavItemIndex),this.tabItems.splice(this.findIndexTab(t),1),this.navItems.splice(t.ownNavItemIndex,1),this.tabItemIndexes.last=this.navItems.length-1)},isTabItemComponent:function(t){var e=t.$options;return"TabItem"===(null==e?void 0:e.name)},setNavItem:function(t){var e,n=t.model,i=t.name,a=t.disabled,o=t.$slots;this.navItems.push({model:n,name:i,disabled:a,nameSlot:null===(e=o.name)||void 0===e?void 0:e[0]}),this.tabItemIndexes.last=this.navItems.length-1},activeTabItem:function(t){null!=t&&t.disabled||(this.tabItemActive=t,this.$emit("input",this.findIndexTab(t)))},disableTabItem:function(t){var e=this.tabItemIndexes,n=e.current,i=e.last;if(t===n){var a=n===i?n-1:n+1;this.activeTabItem(this.navItems[a])}},setTabItemTransitionSide:function(){var t=this.tabItemIndexes,e=t.current,n=t.previous;this.slideSide=e>n?"right":"left"},switchTabItem:function(t){var e=this;if(!this.noTouch){var n=this.tabItemIndexes,i=n.current,a=n.last,o=function(t){var n,a=null===(n=e.navItems)||void 0===n?void 0:n[i+t];a&&e.activeTabItem(a)};"next"===t&&i<a&&o(1),"prev"===t&&i>0&&o(-1)}},findIndexTab:function(t){return this.tabItems.findIndex((function(e){return e.model==t.model}))}}},"data-v-63b9393a",false,undefined,!1,m,void 0,void 0),x=u({render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("transition",{attrs:{name:t.slideDirection},on:{beforeEnter:t.beforeEnterHandle,leave:t.leaveHandle}},[n("div",{directives:[{name:"show",rawName:"v-show",value:t.isActived,expression:"isActived"}],staticClass:"vmt__tab-item",style:{"transition-duration":t.transition.duration+"ms"}},[t._t("default")],2)])},staticRenderFns:[]},(function(t){t&&t("data-v-90aaa762_0",{source:".vmt__tab-item[data-v-90aaa762]{top:0;left:0;z-index:1;width:100%;height:inherit;background:#fff;transition:transform cubic-bezier(.25,.8,.5,1)}.slide-left-enter[data-v-90aaa762],.slide-right-leave-to[data-v-90aaa762]{transform:translateX(-100%)}.slide-left-leave-to[data-v-90aaa762],.slide-right-enter[data-v-90aaa762]{transform:translateX(100%)}.slide-bottom-leave-to[data-v-90aaa762],.slide-top-enter[data-v-90aaa762]{transform:translateY(-100%)}.slide-bottom-enter[data-v-90aaa762],.slide-top-leave-to[data-v-90aaa762]{transform:translateY(100%)}",map:void 0,media:void 0})}),{name:"TabItem",props:{name:{type:String,default:"Tab Item"},disabled:Boolean},data:function(){return{activeModel:"",model:Math.random().toString("16").substring("2")}},mounted:function(){this.$parent.register(this)},beforeDestroy:function(){this.$parent.unRegister(this)},computed:{transition:function(){return this.$parent.transition||200},isActived:function(){return this.activeModel===this.model&&!this.disabled},slideDirection:function(){return this.transition.slide?this.transition.vertical?{left:"slide-top",right:"slide-bottom"}[this.transition.side]:{left:"slide-left",right:"slide-right"}[this.transition.side]:""},ownNavItemIndex:function(){var t,e=this;return null===(t=this.$parent)||void 0===t?void 0:t.navItems.findIndex((function(t){return t.model===e.model}))}},watch:{disabled:function(t){var e;t&&(null===(e=this.$parent)||void 0===e||e.disableTabItem(this.ownNavItemIndex)),this.$parent.navItems[this.ownNavItemIndex].disabled=t}},methods:{beforeEnterHandle:function(t){t.style.position="relative"},leaveHandle:function(t){t.style.position="absolute"}}},"data-v-90aaa762",false,undefined,!1,m,void 0,void 0),y=Object.freeze({__proto__:null,Tabs:I,TabItem:x}),T=function(t){Object.entries(y).forEach((function(e){var n=i(e,2),a=n[0],o=n[1];t.component(a,o)}))},w=Object.freeze({__proto__:null,default:T,Tabs:I,TabItem:x});return Object.entries(w).forEach((function(t){var e=i(t,2),n=e[0],a=e[1];"default"!==n&&(T[n]=a)})),T}(); | ||
var VueMaterialTabs=function(){"use strict";function t(e){return(t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(e)}function e(t,e,n,i,a,o,r){try{var s=t[o](r),d=s.value}catch(t){return void n(t)}s.done?e(d):Promise.resolve(d).then(i,a)}function n(t){return function(){var n=this,i=arguments;return new Promise((function(a,o){var r=t.apply(n,i);function s(t){e(r,a,o,s,d,"next",t)}function d(t){e(r,a,o,s,d,"throw",t)}s(void 0)}))}}function i(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=t&&("undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"]);if(null==n)return;var i,a,o=[],r=!0,s=!1;try{for(n=n.call(t);!(r=(i=n.next()).done)&&(o.push(i.value),!e||o.length!==e);r=!0);}catch(t){s=!0,a=t}finally{try{r||null==n.return||n.return()}finally{if(s)throw a}}return o}(t,e)||o(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function a(t){return function(t){if(Array.isArray(t))return r(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||o(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function o(t,e){if(t){if("string"==typeof t)return r(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(t,e):void 0}}function r(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=new Array(e);n<e;n++)i[n]=t[n];return i}function s(t){var e=function(t){var e=t.currentTarget.getBoundingClientRect(),n=t.clientX-e.left,i=t.clientY-e.top,a=Math.sqrt(Math.pow(t.currentTarget.clientWidth,2)+Math.pow(t.currentTarget.clientHeight,2))/2;return{left:"".concat(n-a,"px"),top:"".concat(i-a,"px"),size:"".concat(2*a,"px")}}(t),n=e.size,i=e.left,a=e.top,o=document.createElement("span");o.classList.add("ripple"),Object.assign(o.style,{height:n,width:n,top:a,left:i}),t.currentTarget.appendChild(o),setTimeout((function(){return o.remove()}),1e3)}function d(t,e){e.value?t.addEventListener("click",s):t.removeEventListener("click",s)}var l={bind:d,update:d,unbind:function(t){t.removeEventListener("click",s)}};var c={inserted:function(t,e){var n,i,a,o=0,r=function(t){return function(){var n;clearTimeout(o),o=setTimeout(t,Number(null===(n=e.value)||void 0===n?void 0:n.delay)||400)}};"function"==typeof e.value?t._onResize=null!==(a=e.modifiers)&&void 0!==a&&a.debounce?r(e.value):e.value:"function"==typeof(null===(n=e.value)||void 0===n?void 0:n.cb)&&null!==(i=e.modifiers)&&void 0!==i&&i.debounce&&(t._onResize=r(e.value.cb)),window.addEventListener("resize",t._onResize)},unbind:function(t){window.removeEventListener("resize",t._onResize),delete t._onResize}};var v={bind:function(t,e){"function"==typeof e.value&&(t._onTouch={callback:e.value,isSwiping:!1,touchstartX:0,onTouchStart:function(t){this._onTouch.isSwiping=!0,this._onTouch.touchstartX=t.touches[0].clientX},onTouchMove:function(e){return function(t,e){if(e._onTouch.isSwiping){var n=t.changedTouches[0].clientX,i=Math.abs(.1*e.offsetWidth),a=e._onTouch.touchstartX-n,o=function(t){e._onTouch.isSwiping=!1,e._onTouch.callback(t)};a>i&&o("next"),a<-i&&o("prev")}}(e,t)}},t.addEventListener("touchstart",t._onTouch.onTouchStart),t.addEventListener("touchmove",t._onTouch.onTouchMove))},unbind:function(t){t._onTouch&&(t.removeEventListener("touchstart",t._onTouch.onTouchStart),t.removeEventListener("touchmove",t._onTouch.onTouchMove),delete t._onTouch)}};function u(t,e,n,i,a,o,r,s,d,l){"boolean"!=typeof r&&(d=s,s=r,r=!1);const c="function"==typeof n?n.options:n;let v;if(t&&t.render&&(c.render=t.render,c.staticRenderFns=t.staticRenderFns,c._compiled=!0,a&&(c.functional=!0)),i&&(c._scopeId=i),o?(v=function(t){(t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),e&&e.call(this,d(t)),t&&t._registeredComponents&&t._registeredComponents.add(o)},c._ssrRegister=v):e&&(v=r?function(t){e.call(this,l(t,this.$root.$options.shadowRoot))}:function(t){e.call(this,s(t))}),v)if(c.functional){const t=c.render;c.render=function(e,n){return v.call(n),t(e,n)}}else{const t=c.beforeCreate;c.beforeCreate=t?[].concat(t,v):[v]}return n}const f="undefined"!=typeof navigator&&/msie [6-9]\\b/.test(navigator.userAgent.toLowerCase());function m(t){return(t,e)=>function(t,e){const n=f?e.media||"default":t,i=p[n]||(p[n]={ids:new Set,styles:[]});if(!i.ids.has(t)){i.ids.add(t);let n=e.source;if(e.map&&(n+="\n/*# sourceURL="+e.map.sources[0]+" */",n+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(e.map))))+" */"),i.element||(i.element=document.createElement("style"),i.element.type="text/css",e.media&&i.element.setAttribute("media",e.media),void 0===h&&(h=document.head||document.getElementsByTagName("head")[0]),h.appendChild(i.element)),"styleSheet"in i.element)i.styles.push(n),i.element.styleSheet.cssText=i.styles.filter(Boolean).join("\n");else{const t=i.ids.size-1,e=document.createTextNode(n),a=i.element.childNodes;a[t]&&i.element.removeChild(a[t]),a.length?i.element.insertBefore(e,a[t]):i.element.appendChild(e)}}}(t,e)}let h;const p={};var b=u({render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{directives:[{name:"resize",rawName:"v-resize.debounce",value:t.resizable,expression:"resizable",modifiers:{debounce:!0}}],class:t.classes},[n("div",{staticClass:"vmt__nav__prev"},[t.pagination.has?n("Btn",{attrs:{disabled:!t.paginateIndicator.prev},on:{click:function(e){return t.paginationTo("prev")}}}):t._e()],1),t._v(" "),n("nav",{directives:[{name:"touch",rawName:"v-touch",value:t.paginationTo,expression:"paginationTo"}],ref:"nav",staticClass:"tab__nav"},[n("ul",{ref:"navItems",staticClass:"vmt__nav__items",style:t.transform},[t._l(t.navItems,(function(e){return n("li",{directives:[{name:"ripple",rawName:"v-ripple",value:t.ripple&&!e.disabled,expression:"ripple && !navItem.disabled"}],key:e.model,ref:e.model,refInFor:!0,staticClass:"vmt__nav__item",class:{active:e.model===t.tabItemActive.model,disabled:e.disabled},style:t.getActiveColor(e),on:{click:function(n){return n.preventDefault(),t.select(e)}}},[n("VNode",{attrs:{node:e.nameSlot,name:e.name}})],1)})),t._v(" "),t.navSlider?n("hr",{ref:"slider",staticClass:"vmt__tab__slider"}):t._e()],2)]),t._v(" "),n("div",{staticClass:"vmt__nav__next"},[t.pagination.has?n("Btn",{attrs:{disabled:!t.paginateIndicator.next},on:{click:function(e){return t.paginationTo("next")}}}):t._e()],1)])},staticRenderFns:[]},(function(t){t&&(t("data-v-7d287132_0",{source:".vmt__nav[data-v-7d287132]{display:flex;justify-content:space-between;align-items:center;vertical-align:middle;max-width:100%;flex:0 1 auto;position:relative;contain:content}.vmt__nav .vmt__nav__prev[data-v-7d287132],.vmt__nav__next[data-v-7d287132]{flex:1 40px;min-width:40px}.vmt__nav__next[data-v-7d287132] .vmt__btn svg{transform:rotate(180deg)}.vmt__nav nav[data-v-7d287132]{position:relative;display:flex;overflow:hidden;flex:1 100%}.vmt__nav__items[data-v-7d287132]{position:relative;display:flex;margin:0;padding:0;flex:1 auto;transition:.3s cubic-bezier(.25,.8,.5,1);height:100%}.vmt__nav__items .vmt__nav__item[data-v-7d287132]{list-style:none;text-align:center;cursor:pointer;padding:.9rem 1rem;letter-spacing:.0892857143em;display:flex;justify-content:center;align-items:center;text-align:center;text-transform:uppercase;font-size:.875rem;font-weight:500;white-space:normal;transition:background .1s ease;position:relative;overflow:hidden;min-width:90px;max-width:360px;user-select:none}.vmt__nav__items .vmt__nav__item[data-v-7d287132]:hover:not(.disabled,.active){background:hsla(0,0%,100%,.09)}.vmt__nav__items .active[data-v-7d287132]:hover{background:hsla(0,0%,100%,.18)}.vmt__nav__items .disabled[data-v-7d287132]{background:#6969694f}.vmt__tab__slider[data-v-7d287132]{height:2px;width:2px;border:none;margin:0;padding:0;bottom:0;position:absolute;transition:left .3s cubic-bezier(.25,.8,.5,1),top .3s cubic-bezier(.25,.8,.5,1)}.vmt__nav--vertical[data-v-7d287132]{flex-direction:column}.vmt__nav--vertical .vmt__nav__items[data-v-7d287132]{flex-direction:column;flex:1 auto;position:relative}.vmt__nav--vertical .vmt__nav__item *[data-v-7d287132]{padding:0;margin:0}.vmt__nav--vertical[data-v-7d287132] .vmt__nav__prev svg{transform:rotate(90deg)}.vmt__nav--vertical[data-v-7d287132] .vmt__nav__next svg{transform:rotate(270deg)}.vmt__nav--vertical .vmt__nav__item[data-v-7d287132]{justify-content:left;padding-top:1.6rem;padding-bottom:1.6rem}.vmt__nav--auto .vmt__nav__item[data-v-7d287132]{flex:1 auto}",map:void 0,media:void 0}),t("data-v-7d287132_1",{source:".ripple{z-index:2;background-color:hsla(0,0%,100%,.23);border-radius:50%;position:absolute;transform:scale(0);animation:ripple .6s linear}@keyframes ripple{to{transform:scale(2.5);opacity:0}}",map:void 0,media:void 0}))}),{inject:["theme"],components:{Btn:u({render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("button",{staticClass:"vmt__btn",on:{click:function(e){return t.$emit("click")}}},[n("svg",{style:{fill:t.theme.arrow},attrs:{viewBox:"0 0 24 24",role:"img","aria-hidden":"true"}},[n("path",{attrs:{d:"M15.41,16.58L10.83,12L15.41,7.41L14,6L8,12L14,18L15.41,16.58Z"}})])])},staticRenderFns:[]},(function(t){t&&t("data-v-c67981d6_0",{source:".vmt__btn[data-v-c67981d6]{outline:0;border:none;background:0 0;cursor:pointer}.vmt__btn svg[data-v-c67981d6]{height:24px;width:24px;fill:rgba(214,213,213,.925)}.vmt__btn:disabled svg[data-v-c67981d6]{fill:#d6d6d652!important;cursor:default}",map:void 0,media:void 0})}),{name:"Btn",inject:["theme"]},"data-v-c67981d6",false,undefined,!1,m,void 0,void 0),VNode:{functional:!0,render:function(t,e){var n=e.props;return n.node?n.node:t("span",n.name)}}},directives:{ripple:l,resize:c,touch:v},props:{vertical:Boolean,navSlider:Boolean,ripple:Boolean,navAuto:Boolean,navItems:{type:Array,required:!0},tabItemActive:{type:Object,default:function(){}}},data:function(){return{pagination:{has:!1,maxOffset:0,minOffset:0,translate:0,offset:0}}},computed:{classes:function(){return{vmt__nav:!0,"vmt__nav--vertical":this.vertical,"vmt__nav--auto":this.navAuto&&!this.vertical}},transform:function(){return"transform: translate".concat(this.vertical?"Y":"X","(-").concat(this.pagination.translate,"px)")},paginateIndicator:function(){var t=this.pagination,e=t.translate;return{next:e<t.maxOffset,prev:e>0}},orientation:function(){return this.vertical?"portrait":"landscape"},sliderElement:function(){var t;return null===(t=this.$refs)||void 0===t?void 0:t.slider}},watch:{navItems:"resizable",vertical:function(){Object.assign(this.$data,this.$options.data()),this.resizable()},tabItemActive:function(t){if(this.setSliderPosition(),this.pagination.has&&null!=t&&t.model){var e,n,i=this.$refs[t.model][0],a=this.$refs.nav,o=null==i||null===(e=i.getClientRects())||void 0===e?void 0:e[0],r=null==a||null===(n=a.getClientRects())||void 0===n?void 0:n[0];if(!o||!r)return;var s=this.pagination,d=s.translate,l=s.maxOffset,c=d;"portrait"===this.orientation&&(o.bottom>r.bottom&&(c+=o.height),o.top<r.top&&(c=o.height>c?0:c-o.height)),"landscape"===this.orientation&&(o.right>r.right&&(c+=o.width),o.left<r.left&&(c=o.width>c?0:c-o.width),c>l&&(c+=l-c)),this.pagination.translate=Math.abs(c)}}},mounted:function(){var t=this.theme,e=t.nav,n=t.navItem,i=t.slider;this.$el.style.background=e,this.$refs.navItems.style.color=n,this.sliderElement&&(this.sliderElement.style.background=i)},methods:{select:function(t){this.$emit("select",t)},setSliderPosition:function(){var t=this;return n(regeneratorRuntime.mark((function e(){var n,i,a,o,r,s,d,l,c;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.$nextTick();case 2:if(s=null===(n=t.tabItemActive)||void 0===n?void 0:n.model){e.next=5;break}return e.abrupt("return");case 5:d=null===(i=t.$refs.navItems)||void 0===i||null===(a=i.getClientRects())||void 0===a?void 0:a[0],l=null===(o=t.$refs[s][0])||void 0===o||null===(r=o.getClientRects())||void 0===r?void 0:r[0],t.sliderElement&&Object.assign(null===(c=t.sliderElement)||void 0===c?void 0:c.style,{portrait:{height:l.height+"px",top:l.top-d.top+"px",width:"",left:""},landscape:{width:l.width+"px",left:l.left-d.left+"px",height:"",top:""}}[t.orientation]);case 8:case"end":return e.stop()}}),e)})))()},setPaginationSettings:function(){var t,e=function(t,e,n){return{has:t,maxOffset:e,minOffset:n,offset:n}},n=this.$refs.nav,i=null==n?void 0:n.offsetWidth,o=null==n?void 0:n.offsetHeight,r=null===(t=this.$refs)||void 0===t?void 0:t.navItems,s=null==r?void 0:r.offsetWidth,d=a(null==r?void 0:r.children).slice(0,-1).reduce((function(t,e){return t+e.offsetHeight}),0);Object.assign(this.pagination,{portrait:e(d>o,d-o,o),landscape:e(s>i,s-i,i)}[this.orientation]),0===this.pagination.maxOffset&&(this.pagination.translate=0)},paginationTo:function(t){var e=this.pagination,n=e.maxOffset,i=e.offset,a=e.translate,o=e.minOffset;if("prev"===t&&this.paginateIndicator.prev){if(i<=o&&(this.pagination.offset=o),a-i<i)return void(this.pagination.translate=0);this.pagination.translate=a-i}"next"===t&&this.paginateIndicator.next&&(a+i>n&&(this.pagination.offset=n-a),this.pagination.translate=a+this.pagination.offset)},resizable:function(){var t=this;return n(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.$nextTick();case 2:t.setPaginationSettings(),t.setSliderPosition();case 4:case"end":return e.stop()}}),e)})))()},getActiveColor:function(t){if(t.model===this.tabItemActive.model)return{color:this.theme.navActiveItem}}}},"data-v-7d287132",false,undefined,!1,m,void 0,void 0),_=function(t,e,n,i,a){return{nav:t,navItem:e,navActiveItem:n,slider:i,arrow:a}},g={default:_("#fff","#000000","#1867c0","#1867c0","#616161"),purple:_("#4A148C","#BDBDBD","#fff","#CE93D8","#f3f3f3"),red:_("#F44336","#f3f3f3","#fff","#EF9A9A","#f3f3f3"),pink:_("#E91E63","#F8BBD0","#fff","#F8BBD0","#f3f3f3"),cyan:_("#00BCD4","#B2EBF2","#fff","#80DEEA","#f3f3f3"),green:_("#4CAF50","#C8E6C9","#fff","#A5D6A7","#f3f3f3")},I=u({render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{class:t.classes},[t._t("nav",[n("TabNav",t._b({on:{select:t.activeTabItem}},"TabNav",{ripple:t.ripple,navAuto:t.navAuto,navItems:t.navItems,vertical:t.vertical,navSlider:t.navSlider,tabItemActive:t.tabItemActive},!1))],{items:t.navItems,active:t.tabItemActive}),t._v(" "),n("div",{directives:[{name:"touch",rawName:"v-touch",value:t.switchTabItem,expression:"switchTabItem"}],staticClass:"tabs__content"},[t._t("default")],2)],2)},staticRenderFns:[]},(function(t){t&&t("data-v-1d334e66_0",{source:".tabs[data-v-1d334e66]{background:#fff;display:flex;flex-direction:column;border-radius:.23rem;height:100%;width:100%}.tabs__content[data-v-1d334e66]{display:flex;position:relative;justify-content:center;align-items:center;overflow:hidden}.tabs--vertical[data-v-1d334e66]{flex-direction:row}",map:void 0,media:void 0})}),{name:"Tabs",components:{TabNav:b},directives:{touch:v},provide:function(){return{theme:this.getTheme}},props:{value:[Number,String],theme:{type:[Object,String],default:"default"},vertical:Boolean,ripple:{type:Boolean,default:!0},slideDuration:{type:[String,Number],default:200},slideVertical:Boolean,slide:{type:Boolean,default:!0},navAuto:Boolean,navSlider:{type:Boolean,default:!0},noTouch:Boolean},data:function(){return{slideSide:"",navItems:[],tabItemActive:{model:"",name:"",disabled:!1},tabItemIndexes:{current:0,last:0,previous:0},tabItems:[]}},computed:{classes:function(){return{tabs:!0,"tabs--vertical":this.vertical}},transition:function(){return{slide:this.slide,duration:this.slide?this.slideDuration:0,vertical:this.slideVertical,side:this.slideSide}},getTheme:function(){return"string"==typeof this.theme?g[this.theme]||g.default:"object"===t(this.theme)&&this.theme?this.theme:g.default}},watch:{tabItemActive:function(t,e){this.tabItemIndexes.previous=this.finTabIndex(e),this.tabItemIndexes.current=this.finTabIndex(t),null!=t&&t.model&&(this.tabItems[this.tabItemIndexes.current].activeModel=t.model,Boolean(~this.tabItemIndexes.previous)&&(this.setTabItemTransitionSide(),this.tabItems[this.tabItemIndexes.previous].activeModel=t.model))},value:{immediate:!0,handler:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;this.$nextTick((function(){var n,i=null===(n=t.navItems)||void 0===n?void 0:n[e];i&&t.activeTabItem(i)}))}}},methods:{register:function(t){this.isTabItemComponent(t)&&(this.tabItems.push(t),this.setNavItem(t))},unRegister:function(t){this.isTabItemComponent(t)&&(this.disableTabItem(t.ownNavItemIndex),this.tabItems.splice(this.finTabIndex(t),1),this.navItems.splice(t.ownNavItemIndex,1),this.tabItemIndexes.last=this.navItems.length-1)},isTabItemComponent:function(t){var e=t.$options;return"TabItem"===(null==e?void 0:e.name)},setNavItem:function(t){var e,n=t.model,i=t.name,a=t.disabled,o=t.$slots;this.navItems.push({model:n,name:i,disabled:a,nameSlot:null===(e=o.name)||void 0===e?void 0:e[0]}),this.tabItemIndexes.last=this.navItems.length-1},activeTabItem:function(t){null!=t&&t.disabled||(this.tabItemActive=t,this.$emit("input",this.finTabIndex(t)))},disableTabItem:function(t){var e=this.tabItemIndexes,n=e.current,i=e.last;if(t===n){var a=n===i?n-1:n+1;this.activeTabItem(this.navItems[a])}},setTabItemTransitionSide:function(){var t=this.tabItemIndexes,e=t.current,n=t.previous;this.slideSide=e>n?"right":"left"},switchTabItem:function(t){var e=this;if(!this.noTouch){var n=this.tabItemIndexes,i=n.current,a=n.last,o=function(t){var n,a=null===(n=e.navItems)||void 0===n?void 0:n[i+t];a&&e.activeTabItem(a)};"next"===t&&i<a&&o(1),"prev"===t&&i>0&&o(-1)}},finTabIndex:function(t){return this.tabItems.findIndex((function(e){return e.model===(null==t?void 0:t.model)}))}}},"data-v-1d334e66",false,undefined,!1,m,void 0,void 0),x=u({render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("transition",{attrs:{name:t.slideDirection},on:{beforeEnter:t.beforeEnterHandle,leave:t.leaveHandle}},[n("div",{directives:[{name:"show",rawName:"v-show",value:t.isActive,expression:"isActive"}],staticClass:"vmt__tab-item",style:{"transition-duration":t.transition.duration+"ms"}},[t._t("default")],2)])},staticRenderFns:[]},(function(t){t&&t("data-v-5683d9d1_0",{source:".vmt__tab-item[data-v-5683d9d1]{top:0;left:0;z-index:1;width:100%;height:inherit;background:#fff;transition:transform cubic-bezier(.25,.8,.5,1)}.slide-left-enter[data-v-5683d9d1],.slide-right-leave-to[data-v-5683d9d1]{transform:translateX(-100%)}.slide-left-leave-to[data-v-5683d9d1],.slide-right-enter[data-v-5683d9d1]{transform:translateX(100%)}.slide-bottom-leave-to[data-v-5683d9d1],.slide-top-enter[data-v-5683d9d1]{transform:translateY(-100%)}.slide-bottom-enter[data-v-5683d9d1],.slide-top-leave-to[data-v-5683d9d1]{transform:translateY(100%)}",map:void 0,media:void 0})}),{name:"TabItem",props:{name:{type:String,default:"Tab Item"},disabled:Boolean},data:function(){return{activeModel:"",model:Math.random().toString("16").substring("2")}},mounted:function(){this.$parent.register(this)},beforeDestroy:function(){this.$parent.unRegister(this)},computed:{transition:function(){return this.$parent.transition||200},isActive:function(){return this.activeModel===this.model&&!this.disabled},slideDirection:function(){return this.transition.slide?this.transition.vertical?{left:"slide-top",right:"slide-bottom"}[this.transition.side]:{left:"slide-left",right:"slide-right"}[this.transition.side]:""},ownNavItemIndex:function(){var t,e=this;return null===(t=this.$parent)||void 0===t?void 0:t.navItems.findIndex((function(t){return t.model===e.model}))}},watch:{disabled:function(t){var e;t&&(null===(e=this.$parent)||void 0===e||e.disableTabItem(this.ownNavItemIndex)),this.$parent.navItems[this.ownNavItemIndex].disabled=t}},methods:{beforeEnterHandle:function(t){t.style.position="relative"},leaveHandle:function(t){t.style.position="absolute"}}},"data-v-5683d9d1",false,undefined,!1,m,void 0,void 0),y=Object.freeze({__proto__:null,Tabs:I,TabItem:x}),T=function(t){Object.entries(y).forEach((function(e){var n=i(e,2),a=n[0],o=n[1];t.component(a,o)}))},w=Object.freeze({__proto__:null,default:T,Tabs:I,TabItem:x});return Object.entries(w).forEach((function(t){var e=i(t,2),n=e[0],a=e[1];"default"!==n&&(T[n]=a)})),T}(); |
@@ -918,7 +918,8 @@ 'use strict';function _typeof(obj) { | ||
tabItemActive: function tabItemActive(newTabItem, oldTabItem) { | ||
this.tabItemIndexes.previous = this.findIndexTab(oldTabItem); | ||
this.tabItemIndexes.current = this.findIndexTab(newTabItem); | ||
this.tabItems[this.tabItemIndexes.current].activeModel = newTabItem.model; | ||
this.tabItemIndexes.previous = this.finTabIndex(oldTabItem); | ||
this.tabItemIndexes.current = this.finTabIndex(newTabItem); | ||
if (!(newTabItem !== null && newTabItem !== void 0 && newTabItem.model)) return; | ||
this.tabItems[this.tabItemIndexes.current].activeModel = newTabItem.model; // eslint-disable-next-line no-extra-boolean-cast | ||
if (this.tabItemIndexes.previous > -1) { | ||
if (Boolean(~this.tabItemIndexes.previous)) { | ||
this.setTabItemTransitionSide(); | ||
@@ -935,3 +936,5 @@ this.tabItems[this.tabItemIndexes.previous].activeModel = newTabItem.model; | ||
this.$nextTick(function () { | ||
var navItem = _this.navItems[value]; | ||
var _this$navItems; | ||
var navItem = (_this$navItems = _this.navItems) === null || _this$navItems === void 0 ? void 0 : _this$navItems[value]; | ||
navItem && _this.activeTabItem(navItem); | ||
@@ -952,3 +955,3 @@ }); | ||
this.disableTabItem(tabItemInstance.ownNavItemIndex); | ||
this.tabItems.splice(this.findIndexTab(tabItemInstance), 1); | ||
this.tabItems.splice(this.finTabIndex(tabItemInstance), 1); | ||
this.navItems.splice(tabItemInstance.ownNavItemIndex, 1); | ||
@@ -980,3 +983,3 @@ this.tabItemIndexes.last = this.navItems.length - 1; | ||
this.tabItemActive = tabItem; | ||
this.$emit("input", this.findIndexTab(tabItem)); | ||
this.$emit("input", this.finTabIndex(tabItem)); | ||
} | ||
@@ -1019,5 +1022,5 @@ }, | ||
}, | ||
findIndexTab: function findIndexTab(tab) { | ||
finTabIndex: function finTabIndex(tab) { | ||
return this.tabItems.findIndex(function (el) { | ||
return el.model == tab.model; | ||
return el.model === (tab === null || tab === void 0 ? void 0 : tab.model); | ||
}); | ||
@@ -1069,4 +1072,4 @@ } | ||
if (!inject) return; | ||
inject("data-v-63b9393a_0", { | ||
source: ".tabs[data-v-63b9393a]{background:#fff;display:flex;flex-direction:column;border-radius:.23rem;height:100%;width:100%}.tabs__content[data-v-63b9393a]{display:flex;position:relative;justify-content:center;align-items:center;overflow:hidden}.tabs--vertical[data-v-63b9393a]{flex-direction:row}", | ||
inject("data-v-1d334e66_0", { | ||
source: ".tabs[data-v-1d334e66]{background:#fff;display:flex;flex-direction:column;border-radius:.23rem;height:100%;width:100%}.tabs__content[data-v-1d334e66]{display:flex;position:relative;justify-content:center;align-items:center;overflow:hidden}.tabs--vertical[data-v-1d334e66]{flex-direction:row}", | ||
map: undefined, | ||
@@ -1079,6 +1082,6 @@ media: undefined | ||
var __vue_scope_id__$1 = "data-v-63b9393a"; | ||
var __vue_scope_id__$1 = "data-v-1d334e66"; | ||
/* module identifier */ | ||
var __vue_module_identifier__$1 = "data-v-63b9393a"; | ||
var __vue_module_identifier__$1 = "data-v-1d334e66"; | ||
/* functional template */ | ||
@@ -1100,6 +1103,2 @@ | ||
// | ||
// | ||
// | ||
// | ||
// | ||
var script = { | ||
@@ -1130,3 +1129,3 @@ name: "TabItem", | ||
}, | ||
isActived: function isActived() { | ||
isActive: function isActive() { | ||
return this.activeModel === this.model && !this.disabled; | ||
@@ -1197,4 +1196,4 @@ }, | ||
rawName: "v-show", | ||
value: _vm.isActived, | ||
expression: "isActived" | ||
value: _vm.isActive, | ||
expression: "isActive" | ||
}], | ||
@@ -1213,4 +1212,4 @@ staticClass: "vmt__tab-item", | ||
if (!inject) return; | ||
inject("data-v-90aaa762_0", { | ||
source: ".vmt__tab-item[data-v-90aaa762]{top:0;left:0;z-index:1;width:100%;height:inherit;background:#fff;transition:transform cubic-bezier(.25,.8,.5,1)}.slide-left-enter[data-v-90aaa762],.slide-right-leave-to[data-v-90aaa762]{transform:translateX(-100%)}.slide-left-leave-to[data-v-90aaa762],.slide-right-enter[data-v-90aaa762]{transform:translateX(100%)}.slide-bottom-leave-to[data-v-90aaa762],.slide-top-enter[data-v-90aaa762]{transform:translateY(-100%)}.slide-bottom-enter[data-v-90aaa762],.slide-top-leave-to[data-v-90aaa762]{transform:translateY(100%)}", | ||
inject("data-v-5683d9d1_0", { | ||
source: ".vmt__tab-item[data-v-5683d9d1]{top:0;left:0;z-index:1;width:100%;height:inherit;background:#fff;transition:transform cubic-bezier(.25,.8,.5,1)}.slide-left-enter[data-v-5683d9d1],.slide-right-leave-to[data-v-5683d9d1]{transform:translateX(-100%)}.slide-left-leave-to[data-v-5683d9d1],.slide-right-enter[data-v-5683d9d1]{transform:translateX(100%)}.slide-bottom-leave-to[data-v-5683d9d1],.slide-top-enter[data-v-5683d9d1]{transform:translateY(-100%)}.slide-bottom-enter[data-v-5683d9d1],.slide-top-leave-to[data-v-5683d9d1]{transform:translateY(100%)}", | ||
map: undefined, | ||
@@ -1223,6 +1222,6 @@ media: undefined | ||
var __vue_scope_id__ = "data-v-90aaa762"; | ||
var __vue_scope_id__ = "data-v-5683d9d1"; | ||
/* module identifier */ | ||
var __vue_module_identifier__ = "data-v-90aaa762"; | ||
var __vue_module_identifier__ = "data-v-5683d9d1"; | ||
/* functional template */ | ||
@@ -1229,0 +1228,0 @@ |
{ | ||
"name": "vue-material-tabs", | ||
"version": "1.1.0", | ||
"version": "1.1.1", | ||
"description": "Vue.js tabs component based in material design", | ||
@@ -5,0 +5,0 @@ "author": "Jairo Blatt <jairoblatt@gmail.com>", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
125670
2127