vue-material-tabs
Advanced tools
Comparing version 0.1.8 to 0.1.9
@@ -49,9 +49,25 @@ function calc(e) { | ||
function inserted(el, binding) { | ||
const callback = binding === null || binding === void 0 ? void 0 : binding.value; | ||
if (callback) window.addEventListener("resize", callback); | ||
el._onResize = callback; | ||
var _binding$value2, _binding$modifiers2; | ||
let timeoutId = 0; | ||
const onResize = callback => () => { | ||
var _binding$value; | ||
clearTimeout(timeoutId); | ||
timeoutId = setTimeout(callback, Number((_binding$value = binding.value) === null || _binding$value === void 0 ? void 0 : _binding$value.delay) || 400); | ||
}; | ||
if (typeof binding.value === "function") { | ||
var _binding$modifiers; | ||
el._onResize = (_binding$modifiers = binding.modifiers) !== null && _binding$modifiers !== void 0 && _binding$modifiers.debounce ? onResize(binding.value) : binding.value; | ||
} else if (typeof ((_binding$value2 = binding.value) === null || _binding$value2 === void 0 ? void 0 : _binding$value2.cb) === "function" && (_binding$modifiers2 = binding.modifiers) !== null && _binding$modifiers2 !== void 0 && _binding$modifiers2.debounce) { | ||
el._onResize = onResize(binding.value.cb); | ||
} | ||
window.addEventListener("resize", el._onResize); | ||
} | ||
function unbind(el) { | ||
if (!el._onResize) return; | ||
window.removeEventListener("resize", el._onResize); | ||
@@ -660,5 +676,8 @@ delete el._onResize; | ||
name: "resize", | ||
rawName: "v-resize", | ||
rawName: "v-resize.debounce", | ||
value: _vm.resizable, | ||
expression: "resizable" | ||
expression: "resizable", | ||
modifiers: { | ||
"debounce": true | ||
} | ||
}], | ||
@@ -741,7 +760,7 @@ class: _vm.classes | ||
if (!inject) return; | ||
inject("data-v-dae60788_0", { | ||
source: ".tab__pagination[data-v-dae60788]{display:flex;justify-content:space-between;align-items:center;vertical-align:middle;max-width:100%;flex:0 1 auto;position:relative;contain:content}.tab__pagination .tab__pagination__prev[data-v-dae60788],.tab__pagination__next[data-v-dae60788]{flex:1 40px;min-width:40px}.tab__pagination__next[data-v-dae60788] .vmt__btn svg{transform:rotate(180deg)}.tab__nav[data-v-dae60788]{position:relative;display:flex;overflow:hidden;flex:1 100%}.tab__nav__items[data-v-dae60788]{display:flex;margin:0;padding:0;flex:1 auto;transition:.3s cubic-bezier(.25,.8,.5,1);height:100%}.tab__nav__items .tab__nav__item[data-v-dae60788]{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}.tab__nav__items .tab__nav__item[data-v-dae60788]:hover:not(.disabled,.active){background:hsla(0,0%,100%,.09)}.tab__nav__items .active[data-v-dae60788]:hover{background:hsla(0,0%,100%,.18)}.tab__nav__items .disabled[data-v-dae60788]{background:#6969694f}.tab__slider[data-v-dae60788]{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)}.tab__pagination--vertical[data-v-dae60788]{flex-direction:column}.tab__pagination--vertical .tab__nav__items[data-v-dae60788]{flex-direction:column;flex:1 auto;position:relative}.tab__pagination--vertical .tab__nav__item *[data-v-dae60788]{padding:0;margin:0}.tab__pagination--vertical[data-v-dae60788] .tab__pagination__prev svg{transform:rotate(90deg)}.tab__pagination--vertical[data-v-dae60788] .tab__pagination__next svg{transform:rotate(270deg)}.tab__pagination--vertical .tab__nav__item[data-v-dae60788]{justify-content:left;padding-top:1.6rem;padding-bottom:1.6rem}.tab__pagination--auto .tab__nav__item[data-v-dae60788]{flex:1 auto}", | ||
inject("data-v-2bb13c69_0", { | ||
source: ".tab__pagination[data-v-2bb13c69]{display:flex;justify-content:space-between;align-items:center;vertical-align:middle;max-width:100%;flex:0 1 auto;position:relative;contain:content}.tab__pagination .tab__pagination__prev[data-v-2bb13c69],.tab__pagination__next[data-v-2bb13c69]{flex:1 40px;min-width:40px}.tab__pagination__next[data-v-2bb13c69] .vmt__btn svg{transform:rotate(180deg)}.tab__nav[data-v-2bb13c69]{position:relative;display:flex;overflow:hidden;flex:1 100%}.tab__nav__items[data-v-2bb13c69]{display:flex;margin:0;padding:0;flex:1 auto;transition:.3s cubic-bezier(.25,.8,.5,1);height:100%}.tab__nav__items .tab__nav__item[data-v-2bb13c69]{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}.tab__nav__items .tab__nav__item[data-v-2bb13c69]:hover:not(.disabled,.active){background:hsla(0,0%,100%,.09)}.tab__nav__items .active[data-v-2bb13c69]:hover{background:hsla(0,0%,100%,.18)}.tab__nav__items .disabled[data-v-2bb13c69]{background:#6969694f}.tab__slider[data-v-2bb13c69]{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)}.tab__pagination--vertical[data-v-2bb13c69]{flex-direction:column}.tab__pagination--vertical .tab__nav__items[data-v-2bb13c69]{flex-direction:column;flex:1 auto;position:relative}.tab__pagination--vertical .tab__nav__item *[data-v-2bb13c69]{padding:0;margin:0}.tab__pagination--vertical[data-v-2bb13c69] .tab__pagination__prev svg{transform:rotate(90deg)}.tab__pagination--vertical[data-v-2bb13c69] .tab__pagination__next svg{transform:rotate(270deg)}.tab__pagination--vertical .tab__nav__item[data-v-2bb13c69]{justify-content:left;padding-top:1.6rem;padding-bottom:1.6rem}.tab__pagination--auto .tab__nav__item[data-v-2bb13c69]{flex:1 auto}", | ||
map: undefined, | ||
media: undefined | ||
}), inject("data-v-dae60788_1", { | ||
}), inject("data-v-2bb13c69_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}}", | ||
@@ -755,3 +774,3 @@ map: undefined, | ||
const __vue_scope_id__$2 = "data-v-dae60788"; | ||
const __vue_scope_id__$2 = "data-v-2bb13c69"; | ||
/* module identifier */ | ||
@@ -1086,16 +1105,12 @@ | ||
mounted() { | ||
this.tabs.register(this); | ||
this.$parent.register(this); | ||
}, | ||
beforeDestroy() { | ||
this.tabs.unRegister(this); | ||
this.$parent.unRegister(this); | ||
}, | ||
computed: { | ||
tabs() { | ||
return this.$parent; | ||
}, | ||
transition() { | ||
return this.tabs.transition; | ||
return this.$parent.transition || 200; | ||
}, | ||
@@ -1124,3 +1139,5 @@ | ||
ownNavItemIndex() { | ||
return this.tabs.navItems.findIndex(navItem => navItem.model === this.model); | ||
var _this$$parent; | ||
return (_this$$parent = this.$parent) === null || _this$$parent === void 0 ? void 0 : _this$$parent.navItems.findIndex(navItem => navItem.model === this.model); | ||
} | ||
@@ -1131,6 +1148,6 @@ | ||
disabled(payload) { | ||
var _this$tabs; | ||
var _this$$parent2; | ||
payload && ((_this$tabs = this.tabs) === null || _this$tabs === void 0 ? void 0 : _this$tabs.disableTabItem(this.ownNavItemIndex)); | ||
this.tabs.navItems[this.ownNavItemIndex].disabled = payload; | ||
payload && ((_this$$parent2 = this.$parent) === null || _this$$parent2 === void 0 ? void 0 : _this$$parent2.disableTabItem(this.ownNavItemIndex)); | ||
this.$parent.navItems[this.ownNavItemIndex].disabled = payload; | ||
} | ||
@@ -1140,8 +1157,8 @@ | ||
methods: { | ||
beforeEnter(el) { | ||
el.style.position = "relative"; | ||
beforeEnterHandle(element) { | ||
element.style.position = "relative"; | ||
}, | ||
leave(el) { | ||
el.style.position = "absolute"; | ||
leaveHandle(element) { | ||
element.style.position = "absolute"; | ||
} | ||
@@ -1168,4 +1185,4 @@ | ||
on: { | ||
"beforeEnter": _vm.beforeEnter, | ||
"leave": _vm.leave | ||
"beforeEnter": _vm.beforeEnterHandle, | ||
"leave": _vm.leaveHandle | ||
} | ||
@@ -1179,3 +1196,3 @@ }, [_c('div', { | ||
}], | ||
staticClass: "tab-item", | ||
staticClass: "vmt__tab-item", | ||
style: { | ||
@@ -1192,4 +1209,4 @@ 'transition-duration': _vm.transition.duration + "ms" | ||
if (!inject) return; | ||
inject("data-v-460da628_0", { | ||
source: ".tab-item[data-v-460da628]{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-460da628],.slide-right-leave-to[data-v-460da628]{transform:translateX(-100%)}.slide-left-leave-to[data-v-460da628],.slide-right-enter[data-v-460da628]{transform:translateX(100%)}.slide-bottom-leave-to[data-v-460da628],.slide-top-enter[data-v-460da628]{transform:translateY(-100%)}.slide-bottom-enter[data-v-460da628],.slide-top-leave-to[data-v-460da628]{transform:translateY(100%)}", | ||
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%)}", | ||
map: undefined, | ||
@@ -1202,3 +1219,3 @@ media: undefined | ||
const __vue_scope_id__ = "data-v-460da628"; | ||
const __vue_scope_id__ = "data-v-90aaa762"; | ||
/* module identifier */ | ||
@@ -1205,0 +1222,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,r,o){try{var s=t[r](o),l=s.value}catch(t){return void n(t)}s.done?e(l):Promise.resolve(l).then(i,a)}function n(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,r=[],o=!0,s=!1;try{for(n=n.call(t);!(o=(i=n.next()).done)&&(r.push(i.value),!e||r.length!==e);o=!0);}catch(t){s=!0,a=t}finally{try{o||null==n.return||n.return()}finally{if(s)throw a}}return r}(t,e)||a(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 i(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)||a(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 a(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 o(t){var e=t.currentTarget,n=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{x:"".concat(n-a,"px"),y:"".concat(i-a,"px"),size:"".concat(2*a,"px")}}(t),i=n.size,a=n.y,r=n.x,o=document.createElement("span");o.classList.add("ripple"),o.style.width=o.style.height=i,o.style.top=a,o.style.left=r,e.appendChild(o),setTimeout((function(){return o.remove()}),1e3)}function s(t,e){null==t||t[e?"addEventListener":"removeEventListener"]("click",o)}var l={bind:function(t,e){return s(t,e.value)},update:function(t,e){return s(t,e.value)},unbind:function(t){return s(t,!1)}};var d={inserted:function(t,e){var n=null==e?void 0:e.value;n&&window.addEventListener("resize",n),t._onResize=n},unbind:function(t){t._onResize&&(window.removeEventListener("resize",t._onResize),delete t._onResize)}},c={touchstartX:0,isSwiping:!1};function v(t){c.isSwiping=!0,c.touchstartX=t.touches[0].clientX}function u(t){if(c.isSwiping){var e=t.currentTarget,n=t.changedTouches[0].clientX,i=c.touchstartX-n,a=Math.abs(.1*e.offsetWidth);i>a?(c.isSwiping=!1,e._callback("next")):i<-a&&(c.isSwiping=!1,e._callback("prev"))}}var f={bind:function(t,e){var n=e.value;n&&t&&(t._callback=n,function(t){t.addEventListener("touchstart",v),t.addEventListener("touchmove",u)}(t))},unbind:function(t){!function(t){t.removeEventListener("touchstart",v),t.removeEventListener("touchmove",u)}(t),t._callback&&delete t._callback}};function m(t,e,n,i,a,r,o,s,l,d){"boolean"!=typeof o&&(l=s,s=o,o=!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),r?(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,l(t)),t&&t._registeredComponents&&t._registeredComponents.add(r)},c._ssrRegister=v):e&&(v=o?function(t){e.call(this,d(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 h="undefined"!=typeof navigator&&/msie [6-9]\\b/.test(navigator.userAgent.toLowerCase());function p(t){return(t,e)=>function(t,e){const n=h?e.media||"default":t,i=_[n]||(_[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===b&&(b=document.head||document.getElementsByTagName("head")[0]),b.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 b;const _={};var g=m({render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{directives:[{name:"resize",rawName:"v-resize",value:t.resizable,expression:"resizable"}],class:t.classes},[n("div",{staticClass:"tab__pagination__prev"},[t.pagination.has?n("Btn",{attrs:{disabled:!t.paginateIndicator.prev},on:{click:function(e){return t.onPagination("prev")}}}):t._e()],1),t._v(" "),n("nav",{directives:[{name:"touch",rawName:"v-touch",value:t.onPagination,expression:"onPagination"}],ref:"nav",staticClass:"tab__nav"},[n("ul",{ref:"navItems",staticClass:"tab__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:"tab__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:"tab__slider"}):t._e()],2)]),t._v(" "),n("div",{staticClass:"tab__pagination__next"},[t.pagination.has?n("Btn",{attrs:{disabled:!t.paginateIndicator.next},on:{click:function(e){return t.onPagination("next")}}}):t._e()],1)])},staticRenderFns:[]},(function(t){t&&(t("data-v-dae60788_0",{source:".tab__pagination[data-v-dae60788]{display:flex;justify-content:space-between;align-items:center;vertical-align:middle;max-width:100%;flex:0 1 auto;position:relative;contain:content}.tab__pagination .tab__pagination__prev[data-v-dae60788],.tab__pagination__next[data-v-dae60788]{flex:1 40px;min-width:40px}.tab__pagination__next[data-v-dae60788] .vmt__btn svg{transform:rotate(180deg)}.tab__nav[data-v-dae60788]{position:relative;display:flex;overflow:hidden;flex:1 100%}.tab__nav__items[data-v-dae60788]{display:flex;margin:0;padding:0;flex:1 auto;transition:.3s cubic-bezier(.25,.8,.5,1);height:100%}.tab__nav__items .tab__nav__item[data-v-dae60788]{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}.tab__nav__items .tab__nav__item[data-v-dae60788]:hover:not(.disabled,.active){background:hsla(0,0%,100%,.09)}.tab__nav__items .active[data-v-dae60788]:hover{background:hsla(0,0%,100%,.18)}.tab__nav__items .disabled[data-v-dae60788]{background:#6969694f}.tab__slider[data-v-dae60788]{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)}.tab__pagination--vertical[data-v-dae60788]{flex-direction:column}.tab__pagination--vertical .tab__nav__items[data-v-dae60788]{flex-direction:column;flex:1 auto;position:relative}.tab__pagination--vertical .tab__nav__item *[data-v-dae60788]{padding:0;margin:0}.tab__pagination--vertical[data-v-dae60788] .tab__pagination__prev svg{transform:rotate(90deg)}.tab__pagination--vertical[data-v-dae60788] .tab__pagination__next svg{transform:rotate(270deg)}.tab__pagination--vertical .tab__nav__item[data-v-dae60788]{justify-content:left;padding-top:1.6rem;padding-bottom:1.6rem}.tab__pagination--auto .tab__nav__item[data-v-dae60788]{flex:1 auto}",map:void 0,media:void 0}),t("data-v-dae60788_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:m({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,p,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:d,touch:f},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{tab__pagination:!0,"tab__pagination--vertical":this.vertical,"tab__pagination--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"},slider: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(){this.sliderHandler(),this.pagination.has&&this.paginationCollapse()}},mounted:function(){this.setTheme()},methods:{select:function(t){this.$emit("select",t)},sliderHandler:function(){var t,n=this;return(t=regeneratorRuntime.mark((function t(){var e,i,a,r,o,s,l,d,c,v,u,f,m,h;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(null===(e=n.tabItemActive)||void 0===e||!e.model){t.next=7;break}return t.next=3,n.$nextTick();case 3:o=null===(i=n.$refs)||void 0===i?void 0:i.navItems,s=n.getElementRect({el:o,prefix:"navItems"}),l=s.navItemsLeft,d=s.navItemsTop,c=n.getElementRect({el:null===(a=n.$refs)||void 0===a||null===(r=a[n.tabItemActive.model])||void 0===r?void 0:r[0],prefix:"navActive"}),v=c.navActiveWidth,u=c.navActiveHeight,f=c.navActiveLeft,m=c.navActiveTop,n.slider&&Object.assign(null===(h=n.slider)||void 0===h?void 0:h.style,{portrait:{height:"".concat(u,"px"),top:"".concat(m-d,"px"),width:"",left:""},landscape:{width:"".concat(v,"px"),left:"".concat(f-l,"px"),height:"",top:""}}[n.orientation]);case 7:case"end":return t.stop()}}),t)})),function(){var n=this,i=arguments;return new Promise((function(a,r){var o=t.apply(n,i);function s(t){e(o,a,r,s,l,"next",t)}function l(t){e(o,a,r,s,l,"throw",t)}s(void 0)}))})()},setPagination:function(){var t;if(null!==(t=this.tabItemActive)&&void 0!==t&&t.model){var e,a,r=null===(e=this.$refs)||void 0===e?void 0:e.navItems,o=this.getElementRect({el:r,prefix:"navItems"}).navItemsWidth,s=this.getElementRect({el:null===(a=this.$refs)||void 0===a?void 0:a.nav,prefix:"nav"}),l=s.navWidth,d=s.navHeight,c=i(null==r?void 0:r.children).slice(0,-1).map((function(t){return t.offsetHeight})).reduce((function(t,e){return Math.abs(t+e)}),0),v=function(t,e,i){var a=Object.entries({has:t,maxOffset:e,minOffset:i,offset:i}).map((function(t){var e=n(t,2),i=e[0],a=e[1];return[i,Math.abs(a)]}));return Object.fromEntries(a)};Object.assign(this.pagination,{portrait:v(c>d,c-d,d),landscape:v(o>l,o-l,l)}[this.orientation]),0===this.pagination.maxOffset&&(this.pagination.translate=0)}},onPagination:function(t){var e=this.pagination,n=e.maxOffset,i=e.offset,a=e.translate,r=e.minOffset;if("prev"===t&&this.paginateIndicator.prev){if(i<=r&&(this.pagination.offset=r),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)},paginationCollapse:function(){var t,e,n,i=this.getElementRect({el:null===(t=this.$refs)||void 0===t||null===(e=t[this.tabItemActive.model])||void 0===e?void 0:e[0],prefix:"navActive"}),a=i.navActiveRight,r=i.navActiveLeft,o=i.navActiveTop,s=i.navActiveBottom,l=i.navActiveWidth,d=i.navActiveHeight,c=this.getElementRect({el:null===(n=this.$refs)||void 0===n?void 0:n.nav,prefix:"nav"}),v=c.navRight,u=c.navLeft,f=c.navTop,m=c.navBottom,h=this.pagination,p=h.translate,b=h.maxOffset,_=p;this.vertical&&s>m&&(_+=d),this.vertical&&o<f&&(_=d>_?0:_-d),!this.vertical&&a>v&&(_+=l),!this.vertical&&r<u&&(_=l>_?0:_-l),_>b&&(_+=b-_),this.pagination.translate=Math.abs(_)},resizable:function(){var t=this;this.$nextTick((function(){t.setPagination(),t.sliderHandler()}))},getElementRect:function(t){var e=t.el,i=t.prefix;if(e){var a=JSON.parse,r=JSON.stringify,o=Object.entries(a(r(e.getBoundingClientRect()))).map((function(t){var e=n(t,2),a=e[0],r=e[1];return[i+a.charAt(0).toUpperCase()+a.slice(1),r]}));return Object.fromEntries(o)}},setTheme: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.slider&&(this.slider.style.background=i)},getActiveColor:function(t){if(t.model===this.tabItemActive.model)return{color:this.theme.navActiveItem}}}},"data-v-dae60788",false,undefined,!1,p,void 0,void 0),I=function(t,e,n,i,a){return{nav:t,navItem:e,navActiveItem:n,slider:i,arrow:a}},x={default:I("#fff","#000000","#1867c0","#1867c0","#616161"),purple:I("#4A148C","#BDBDBD","#fff","#CE93D8","#f3f3f3"),red:I("#F44336","#f3f3f3","#fff","#EF9A9A","#f3f3f3"),pink:I("#E91E63","#F8BBD0","#fff","#F8BBD0","#f3f3f3"),cyan:I("#00BCD4","#B2EBF2","#fff","#80DEEA","#f3f3f3"),green:I("#4CAF50","#C8E6C9","#fff","#A5D6A7","#f3f3f3")},y=m({render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{class:t.classes},[t._t("nav",[n("NavTab",t._b({on:{select:t.activeTabItem}},"NavTab",{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.onTouchSlide,expression:"onTouchSlide"}],staticClass:"tabs__content"},[t._t("default")],2)],2)},staticRenderFns:[]},(function(t){t&&t("data-v-70c2cf86_0",{source:".tabs[data-v-70c2cf86]{background:#fff;display:flex;flex-direction:column;border-radius:.23rem;height:100%;width:100%}.tabs__content[data-v-70c2cf86]{display:flex;position:relative;justify-content:center;align-items:center;overflow:hidden}.tabs--vertical[data-v-70c2cf86]{flex-direction:row}",map:void 0,media:void 0})}),{name:"Tabs",components:{NavTab:g},directives:{touch:f},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?x[this.theme]||x.default:"object"===t(this.theme)&&this.theme?this.theme:x.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(t){var e=this;this.$nextTick((function(){var n=e.navItems[t];n&&e.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,r=t.$slots;this.navItems.push({model:n,name:i,disabled:a,nameSlot:null===(e=r.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"},onTouchSlide:function(t){if(!this.noTouch){var e,n=this.tabItemIndexes,i=n.current,a=n.last;"next"===t&&i<a?e=this.navItems[i+1]:"prev"===t&&i>0&&(e=this.navItems[i-1]),e&&this.activeTabItem(e)}},findIndexTab:function(t){return this.tabItems.findIndex((function(e){return e.model==t.model}))}}},"data-v-70c2cf86",false,undefined,!1,p,void 0,void 0),T=m({render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("transition",{attrs:{name:t.slideDirection},on:{beforeEnter:t.beforeEnter,leave:t.leave}},[n("div",{directives:[{name:"show",rawName:"v-show",value:t.isActived,expression:"isActived"}],staticClass:"tab-item",style:{"transition-duration":t.transition.duration+"ms"}},[t._t("default")],2)])},staticRenderFns:[]},(function(t){t&&t("data-v-460da628_0",{source:".tab-item[data-v-460da628]{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-460da628],.slide-right-leave-to[data-v-460da628]{transform:translateX(-100%)}.slide-left-leave-to[data-v-460da628],.slide-right-enter[data-v-460da628]{transform:translateX(100%)}.slide-bottom-leave-to[data-v-460da628],.slide-top-enter[data-v-460da628]{transform:translateY(-100%)}.slide-bottom-enter[data-v-460da628],.slide-top-leave-to[data-v-460da628]{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.tabs.register(this)},beforeDestroy:function(){this.tabs.unRegister(this)},computed:{tabs:function(){return this.$parent},transition:function(){return this.tabs.transition},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=this;return this.tabs.navItems.findIndex((function(e){return e.model===t.model}))}},watch:{disabled:function(t){var e;t&&(null===(e=this.tabs)||void 0===e||e.disableTabItem(this.ownNavItemIndex)),this.tabs.navItems[this.ownNavItemIndex].disabled=t}},methods:{beforeEnter:function(t){t.style.position="relative"},leave:function(t){t.style.position="absolute"}}},"data-v-460da628",false,undefined,!1,p,void 0,void 0),w=Object.freeze({__proto__:null,Tabs:y,TabItem:T}),A=function(t){Object.entries(w).forEach((function(e){var i=n(e,2),a=i[0],r=i[1];t.component(a,r)}))},S=Object.freeze({__proto__:null,default:A,Tabs:y,TabItem:T});return Object.entries(S).forEach((function(t){var e=n(t,2),i=e[0],a=e[1];"default"!==i&&(A[i]=a)})),A}(); | ||
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,r,o){try{var s=t[r](o),l=s.value}catch(t){return void n(t)}s.done?e(l):Promise.resolve(l).then(i,a)}function n(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,r=[],o=!0,s=!1;try{for(n=n.call(t);!(o=(i=n.next()).done)&&(r.push(i.value),!e||r.length!==e);o=!0);}catch(t){s=!0,a=t}finally{try{o||null==n.return||n.return()}finally{if(s)throw a}}return r}(t,e)||a(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 i(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)||a(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 a(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 o(t){var e=t.currentTarget,n=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{x:"".concat(n-a,"px"),y:"".concat(i-a,"px"),size:"".concat(2*a,"px")}}(t),i=n.size,a=n.y,r=n.x,o=document.createElement("span");o.classList.add("ripple"),o.style.width=o.style.height=i,o.style.top=a,o.style.left=r,e.appendChild(o),setTimeout((function(){return o.remove()}),1e3)}function s(t,e){null==t||t[e?"addEventListener":"removeEventListener"]("click",o)}var l={bind:function(t,e){return s(t,e.value)},update:function(t,e){return s(t,e.value)},unbind:function(t){return s(t,!1)}};var c={inserted:function(t,e){var n,i,a,r=0,o=function(t){return function(){var n;clearTimeout(r),r=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?o(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=o(e.value.cb)),window.addEventListener("resize",t._onResize)},unbind:function(t){window.removeEventListener("resize",t._onResize),delete t._onResize}},d={touchstartX:0,isSwiping:!1};function v(t){d.isSwiping=!0,d.touchstartX=t.touches[0].clientX}function u(t){if(d.isSwiping){var e=t.currentTarget,n=t.changedTouches[0].clientX,i=d.touchstartX-n,a=Math.abs(.1*e.offsetWidth);i>a?(d.isSwiping=!1,e._callback("next")):i<-a&&(d.isSwiping=!1,e._callback("prev"))}}var f={bind:function(t,e){var n=e.value;n&&t&&(t._callback=n,function(t){t.addEventListener("touchstart",v),t.addEventListener("touchmove",u)}(t))},unbind:function(t){!function(t){t.removeEventListener("touchstart",v),t.removeEventListener("touchmove",u)}(t),t._callback&&delete t._callback}};function m(t,e,n,i,a,r,o,s,l,c){"boolean"!=typeof o&&(l=s,s=o,o=!1);const d="function"==typeof n?n.options:n;let v;if(t&&t.render&&(d.render=t.render,d.staticRenderFns=t.staticRenderFns,d._compiled=!0,a&&(d.functional=!0)),i&&(d._scopeId=i),r?(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,l(t)),t&&t._registeredComponents&&t._registeredComponents.add(r)},d._ssrRegister=v):e&&(v=o?function(t){e.call(this,c(t,this.$root.$options.shadowRoot))}:function(t){e.call(this,s(t))}),v)if(d.functional){const t=d.render;d.render=function(e,n){return v.call(n),t(e,n)}}else{const t=d.beforeCreate;d.beforeCreate=t?[].concat(t,v):[v]}return n}const h="undefined"!=typeof navigator&&/msie [6-9]\\b/.test(navigator.userAgent.toLowerCase());function p(t){return(t,e)=>function(t,e){const n=h?e.media||"default":t,i=_[n]||(_[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===b&&(b=document.head||document.getElementsByTagName("head")[0]),b.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 b;const _={};var g=m({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:"tab__pagination__prev"},[t.pagination.has?n("Btn",{attrs:{disabled:!t.paginateIndicator.prev},on:{click:function(e){return t.onPagination("prev")}}}):t._e()],1),t._v(" "),n("nav",{directives:[{name:"touch",rawName:"v-touch",value:t.onPagination,expression:"onPagination"}],ref:"nav",staticClass:"tab__nav"},[n("ul",{ref:"navItems",staticClass:"tab__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:"tab__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:"tab__slider"}):t._e()],2)]),t._v(" "),n("div",{staticClass:"tab__pagination__next"},[t.pagination.has?n("Btn",{attrs:{disabled:!t.paginateIndicator.next},on:{click:function(e){return t.onPagination("next")}}}):t._e()],1)])},staticRenderFns:[]},(function(t){t&&(t("data-v-2bb13c69_0",{source:".tab__pagination[data-v-2bb13c69]{display:flex;justify-content:space-between;align-items:center;vertical-align:middle;max-width:100%;flex:0 1 auto;position:relative;contain:content}.tab__pagination .tab__pagination__prev[data-v-2bb13c69],.tab__pagination__next[data-v-2bb13c69]{flex:1 40px;min-width:40px}.tab__pagination__next[data-v-2bb13c69] .vmt__btn svg{transform:rotate(180deg)}.tab__nav[data-v-2bb13c69]{position:relative;display:flex;overflow:hidden;flex:1 100%}.tab__nav__items[data-v-2bb13c69]{display:flex;margin:0;padding:0;flex:1 auto;transition:.3s cubic-bezier(.25,.8,.5,1);height:100%}.tab__nav__items .tab__nav__item[data-v-2bb13c69]{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}.tab__nav__items .tab__nav__item[data-v-2bb13c69]:hover:not(.disabled,.active){background:hsla(0,0%,100%,.09)}.tab__nav__items .active[data-v-2bb13c69]:hover{background:hsla(0,0%,100%,.18)}.tab__nav__items .disabled[data-v-2bb13c69]{background:#6969694f}.tab__slider[data-v-2bb13c69]{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)}.tab__pagination--vertical[data-v-2bb13c69]{flex-direction:column}.tab__pagination--vertical .tab__nav__items[data-v-2bb13c69]{flex-direction:column;flex:1 auto;position:relative}.tab__pagination--vertical .tab__nav__item *[data-v-2bb13c69]{padding:0;margin:0}.tab__pagination--vertical[data-v-2bb13c69] .tab__pagination__prev svg{transform:rotate(90deg)}.tab__pagination--vertical[data-v-2bb13c69] .tab__pagination__next svg{transform:rotate(270deg)}.tab__pagination--vertical .tab__nav__item[data-v-2bb13c69]{justify-content:left;padding-top:1.6rem;padding-bottom:1.6rem}.tab__pagination--auto .tab__nav__item[data-v-2bb13c69]{flex:1 auto}",map:void 0,media:void 0}),t("data-v-2bb13c69_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:m({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,p,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:f},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{tab__pagination:!0,"tab__pagination--vertical":this.vertical,"tab__pagination--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"},slider: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(){this.sliderHandler(),this.pagination.has&&this.paginationCollapse()}},mounted:function(){this.setTheme()},methods:{select:function(t){this.$emit("select",t)},sliderHandler:function(){var t,n=this;return(t=regeneratorRuntime.mark((function t(){var e,i,a,r,o,s,l,c,d,v,u,f,m,h;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(null===(e=n.tabItemActive)||void 0===e||!e.model){t.next=7;break}return t.next=3,n.$nextTick();case 3:o=null===(i=n.$refs)||void 0===i?void 0:i.navItems,s=n.getElementRect({el:o,prefix:"navItems"}),l=s.navItemsLeft,c=s.navItemsTop,d=n.getElementRect({el:null===(a=n.$refs)||void 0===a||null===(r=a[n.tabItemActive.model])||void 0===r?void 0:r[0],prefix:"navActive"}),v=d.navActiveWidth,u=d.navActiveHeight,f=d.navActiveLeft,m=d.navActiveTop,n.slider&&Object.assign(null===(h=n.slider)||void 0===h?void 0:h.style,{portrait:{height:"".concat(u,"px"),top:"".concat(m-c,"px"),width:"",left:""},landscape:{width:"".concat(v,"px"),left:"".concat(f-l,"px"),height:"",top:""}}[n.orientation]);case 7:case"end":return t.stop()}}),t)})),function(){var n=this,i=arguments;return new Promise((function(a,r){var o=t.apply(n,i);function s(t){e(o,a,r,s,l,"next",t)}function l(t){e(o,a,r,s,l,"throw",t)}s(void 0)}))})()},setPagination:function(){var t;if(null!==(t=this.tabItemActive)&&void 0!==t&&t.model){var e,a,r=null===(e=this.$refs)||void 0===e?void 0:e.navItems,o=this.getElementRect({el:r,prefix:"navItems"}).navItemsWidth,s=this.getElementRect({el:null===(a=this.$refs)||void 0===a?void 0:a.nav,prefix:"nav"}),l=s.navWidth,c=s.navHeight,d=i(null==r?void 0:r.children).slice(0,-1).map((function(t){return t.offsetHeight})).reduce((function(t,e){return Math.abs(t+e)}),0),v=function(t,e,i){var a=Object.entries({has:t,maxOffset:e,minOffset:i,offset:i}).map((function(t){var e=n(t,2),i=e[0],a=e[1];return[i,Math.abs(a)]}));return Object.fromEntries(a)};Object.assign(this.pagination,{portrait:v(d>c,d-c,c),landscape:v(o>l,o-l,l)}[this.orientation]),0===this.pagination.maxOffset&&(this.pagination.translate=0)}},onPagination:function(t){var e=this.pagination,n=e.maxOffset,i=e.offset,a=e.translate,r=e.minOffset;if("prev"===t&&this.paginateIndicator.prev){if(i<=r&&(this.pagination.offset=r),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)},paginationCollapse:function(){var t,e,n,i=this.getElementRect({el:null===(t=this.$refs)||void 0===t||null===(e=t[this.tabItemActive.model])||void 0===e?void 0:e[0],prefix:"navActive"}),a=i.navActiveRight,r=i.navActiveLeft,o=i.navActiveTop,s=i.navActiveBottom,l=i.navActiveWidth,c=i.navActiveHeight,d=this.getElementRect({el:null===(n=this.$refs)||void 0===n?void 0:n.nav,prefix:"nav"}),v=d.navRight,u=d.navLeft,f=d.navTop,m=d.navBottom,h=this.pagination,p=h.translate,b=h.maxOffset,_=p;this.vertical&&s>m&&(_+=c),this.vertical&&o<f&&(_=c>_?0:_-c),!this.vertical&&a>v&&(_+=l),!this.vertical&&r<u&&(_=l>_?0:_-l),_>b&&(_+=b-_),this.pagination.translate=Math.abs(_)},resizable:function(){var t=this;this.$nextTick((function(){t.setPagination(),t.sliderHandler()}))},getElementRect:function(t){var e=t.el,i=t.prefix;if(e){var a=JSON.parse,r=JSON.stringify,o=Object.entries(a(r(e.getBoundingClientRect()))).map((function(t){var e=n(t,2),a=e[0],r=e[1];return[i+a.charAt(0).toUpperCase()+a.slice(1),r]}));return Object.fromEntries(o)}},setTheme: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.slider&&(this.slider.style.background=i)},getActiveColor:function(t){if(t.model===this.tabItemActive.model)return{color:this.theme.navActiveItem}}}},"data-v-2bb13c69",false,undefined,!1,p,void 0,void 0),I=function(t,e,n,i,a){return{nav:t,navItem:e,navActiveItem:n,slider:i,arrow:a}},x={default:I("#fff","#000000","#1867c0","#1867c0","#616161"),purple:I("#4A148C","#BDBDBD","#fff","#CE93D8","#f3f3f3"),red:I("#F44336","#f3f3f3","#fff","#EF9A9A","#f3f3f3"),pink:I("#E91E63","#F8BBD0","#fff","#F8BBD0","#f3f3f3"),cyan:I("#00BCD4","#B2EBF2","#fff","#80DEEA","#f3f3f3"),green:I("#4CAF50","#C8E6C9","#fff","#A5D6A7","#f3f3f3")},y=m({render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{class:t.classes},[t._t("nav",[n("NavTab",t._b({on:{select:t.activeTabItem}},"NavTab",{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.onTouchSlide,expression:"onTouchSlide"}],staticClass:"tabs__content"},[t._t("default")],2)],2)},staticRenderFns:[]},(function(t){t&&t("data-v-70c2cf86_0",{source:".tabs[data-v-70c2cf86]{background:#fff;display:flex;flex-direction:column;border-radius:.23rem;height:100%;width:100%}.tabs__content[data-v-70c2cf86]{display:flex;position:relative;justify-content:center;align-items:center;overflow:hidden}.tabs--vertical[data-v-70c2cf86]{flex-direction:row}",map:void 0,media:void 0})}),{name:"Tabs",components:{NavTab:g},directives:{touch:f},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?x[this.theme]||x.default:"object"===t(this.theme)&&this.theme?this.theme:x.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(t){var e=this;this.$nextTick((function(){var n=e.navItems[t];n&&e.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,r=t.$slots;this.navItems.push({model:n,name:i,disabled:a,nameSlot:null===(e=r.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"},onTouchSlide:function(t){if(!this.noTouch){var e,n=this.tabItemIndexes,i=n.current,a=n.last;"next"===t&&i<a?e=this.navItems[i+1]:"prev"===t&&i>0&&(e=this.navItems[i-1]),e&&this.activeTabItem(e)}},findIndexTab:function(t){return this.tabItems.findIndex((function(e){return e.model==t.model}))}}},"data-v-70c2cf86",false,undefined,!1,p,void 0,void 0),T=m({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,p,void 0,void 0),w=Object.freeze({__proto__:null,Tabs:y,TabItem:T}),A=function(t){Object.entries(w).forEach((function(e){var i=n(e,2),a=i[0],r=i[1];t.component(a,r)}))},S=Object.freeze({__proto__:null,default:A,Tabs:y,TabItem:T});return Object.entries(S).forEach((function(t){var e=n(t,2),i=e[0],a=e[1];"default"!==i&&(A[i]=a)})),A}(); |
@@ -177,9 +177,27 @@ 'use strict';function _typeof(obj) { | ||
};function inserted(el, binding) { | ||
var callback = binding === null || binding === void 0 ? void 0 : binding.value; | ||
if (callback) window.addEventListener("resize", callback); | ||
el._onResize = callback; | ||
var _binding$value2, _binding$modifiers2; | ||
var timeoutId = 0; | ||
var onResize = function onResize(callback) { | ||
return function () { | ||
var _binding$value; | ||
clearTimeout(timeoutId); | ||
timeoutId = setTimeout(callback, Number((_binding$value = binding.value) === null || _binding$value === void 0 ? void 0 : _binding$value.delay) || 400); | ||
}; | ||
}; | ||
if (typeof binding.value === "function") { | ||
var _binding$modifiers; | ||
el._onResize = (_binding$modifiers = binding.modifiers) !== null && _binding$modifiers !== void 0 && _binding$modifiers.debounce ? onResize(binding.value) : binding.value; | ||
} else if (typeof ((_binding$value2 = binding.value) === null || _binding$value2 === void 0 ? void 0 : _binding$value2.cb) === "function" && (_binding$modifiers2 = binding.modifiers) !== null && _binding$modifiers2 !== void 0 && _binding$modifiers2.debounce) { | ||
el._onResize = onResize(binding.value.cb); | ||
} | ||
window.addEventListener("resize", el._onResize); | ||
} | ||
function unbind(el) { | ||
if (!el._onResize) return; | ||
window.removeEventListener("resize", el._onResize); | ||
@@ -752,8 +770,11 @@ delete el._onResize; | ||
name: "resize", | ||
rawName: "v-resize", | ||
rawName: "v-resize.debounce", | ||
value: _vm.resizable, | ||
expression: "resizable" | ||
expression: "resizable", | ||
modifiers: { | ||
"debounce": true | ||
} | ||
}], | ||
class: _vm.classes | ||
}, [_vm._ssrNode("<div class=\"tab__pagination__prev\" data-v-dae60788>", "</div>", [_vm.pagination.has ? _c('Btn', { | ||
}, [_vm._ssrNode("<div class=\"tab__pagination__prev\" data-v-2bb13c69>", "</div>", [_vm.pagination.has ? _c('Btn', { | ||
attrs: { | ||
@@ -776,3 +797,3 @@ "disabled": !_vm.paginateIndicator.prev | ||
staticClass: "tab__nav" | ||
}, [_vm._ssrNode("<ul class=\"tab__nav__items\"" + _vm._ssrStyle(null, _vm.transform, null) + " data-v-dae60788>", "</ul>", [_vm._l(_vm.navItems, function (navItem) { | ||
}, [_vm._ssrNode("<ul class=\"tab__nav__items\"" + _vm._ssrStyle(null, _vm.transform, null) + " data-v-2bb13c69>", "</ul>", [_vm._l(_vm.navItems, function (navItem) { | ||
return _c('li', { | ||
@@ -806,3 +827,3 @@ directives: [{ | ||
})], 1); | ||
}), _vm._ssrNode(" " + (_vm.navSlider ? "<hr class=\"tab__slider\" data-v-dae60788>" : "<!---->"))], 2)]), _vm._ssrNode(" "), _vm._ssrNode("<div class=\"tab__pagination__next\" data-v-dae60788>", "</div>", [_vm.pagination.has ? _c('Btn', { | ||
}), _vm._ssrNode(" " + (_vm.navSlider ? "<hr class=\"tab__slider\" data-v-2bb13c69>" : "<!---->"))], 2)]), _vm._ssrNode(" "), _vm._ssrNode("<div class=\"tab__pagination__next\" data-v-2bb13c69>", "</div>", [_vm.pagination.has ? _c('Btn', { | ||
attrs: { | ||
@@ -824,7 +845,7 @@ "disabled": !_vm.paginateIndicator.next | ||
if (!inject) return; | ||
inject("data-v-dae60788_0", { | ||
source: ".tab__pagination[data-v-dae60788]{display:flex;justify-content:space-between;align-items:center;vertical-align:middle;max-width:100%;flex:0 1 auto;position:relative;contain:content}.tab__pagination .tab__pagination__prev[data-v-dae60788],.tab__pagination__next[data-v-dae60788]{flex:1 40px;min-width:40px}.tab__pagination__next[data-v-dae60788] .vmt__btn svg{transform:rotate(180deg)}.tab__nav[data-v-dae60788]{position:relative;display:flex;overflow:hidden;flex:1 100%}.tab__nav__items[data-v-dae60788]{display:flex;margin:0;padding:0;flex:1 auto;transition:.3s cubic-bezier(.25,.8,.5,1);height:100%}.tab__nav__items .tab__nav__item[data-v-dae60788]{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}.tab__nav__items .tab__nav__item[data-v-dae60788]:hover:not(.disabled,.active){background:hsla(0,0%,100%,.09)}.tab__nav__items .active[data-v-dae60788]:hover{background:hsla(0,0%,100%,.18)}.tab__nav__items .disabled[data-v-dae60788]{background:#6969694f}.tab__slider[data-v-dae60788]{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)}.tab__pagination--vertical[data-v-dae60788]{flex-direction:column}.tab__pagination--vertical .tab__nav__items[data-v-dae60788]{flex-direction:column;flex:1 auto;position:relative}.tab__pagination--vertical .tab__nav__item *[data-v-dae60788]{padding:0;margin:0}.tab__pagination--vertical[data-v-dae60788] .tab__pagination__prev svg{transform:rotate(90deg)}.tab__pagination--vertical[data-v-dae60788] .tab__pagination__next svg{transform:rotate(270deg)}.tab__pagination--vertical .tab__nav__item[data-v-dae60788]{justify-content:left;padding-top:1.6rem;padding-bottom:1.6rem}.tab__pagination--auto .tab__nav__item[data-v-dae60788]{flex:1 auto}", | ||
inject("data-v-2bb13c69_0", { | ||
source: ".tab__pagination[data-v-2bb13c69]{display:flex;justify-content:space-between;align-items:center;vertical-align:middle;max-width:100%;flex:0 1 auto;position:relative;contain:content}.tab__pagination .tab__pagination__prev[data-v-2bb13c69],.tab__pagination__next[data-v-2bb13c69]{flex:1 40px;min-width:40px}.tab__pagination__next[data-v-2bb13c69] .vmt__btn svg{transform:rotate(180deg)}.tab__nav[data-v-2bb13c69]{position:relative;display:flex;overflow:hidden;flex:1 100%}.tab__nav__items[data-v-2bb13c69]{display:flex;margin:0;padding:0;flex:1 auto;transition:.3s cubic-bezier(.25,.8,.5,1);height:100%}.tab__nav__items .tab__nav__item[data-v-2bb13c69]{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}.tab__nav__items .tab__nav__item[data-v-2bb13c69]:hover:not(.disabled,.active){background:hsla(0,0%,100%,.09)}.tab__nav__items .active[data-v-2bb13c69]:hover{background:hsla(0,0%,100%,.18)}.tab__nav__items .disabled[data-v-2bb13c69]{background:#6969694f}.tab__slider[data-v-2bb13c69]{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)}.tab__pagination--vertical[data-v-2bb13c69]{flex-direction:column}.tab__pagination--vertical .tab__nav__items[data-v-2bb13c69]{flex-direction:column;flex:1 auto;position:relative}.tab__pagination--vertical .tab__nav__item *[data-v-2bb13c69]{padding:0;margin:0}.tab__pagination--vertical[data-v-2bb13c69] .tab__pagination__prev svg{transform:rotate(90deg)}.tab__pagination--vertical[data-v-2bb13c69] .tab__pagination__next svg{transform:rotate(270deg)}.tab__pagination--vertical .tab__nav__item[data-v-2bb13c69]{justify-content:left;padding-top:1.6rem;padding-bottom:1.6rem}.tab__pagination--auto .tab__nav__item[data-v-2bb13c69]{flex:1 auto}", | ||
map: undefined, | ||
media: undefined | ||
}), inject("data-v-dae60788_1", { | ||
}), inject("data-v-2bb13c69_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}}", | ||
@@ -838,6 +859,6 @@ map: undefined, | ||
var __vue_scope_id__$2 = "data-v-dae60788"; | ||
var __vue_scope_id__$2 = "data-v-2bb13c69"; | ||
/* module identifier */ | ||
var __vue_module_identifier__$2 = "data-v-dae60788"; | ||
var __vue_module_identifier__$2 = "data-v-2bb13c69"; | ||
/* functional template */ | ||
@@ -1143,13 +1164,10 @@ | ||
mounted: function mounted() { | ||
this.tabs.register(this); | ||
this.$parent.register(this); | ||
}, | ||
beforeDestroy: function beforeDestroy() { | ||
this.tabs.unRegister(this); | ||
this.$parent.unRegister(this); | ||
}, | ||
computed: { | ||
tabs: function tabs() { | ||
return this.$parent; | ||
}, | ||
transition: function transition() { | ||
return this.tabs.transition; | ||
return this.$parent.transition || 200; | ||
}, | ||
@@ -1175,5 +1193,6 @@ isActived: function isActived() { | ||
ownNavItemIndex: function ownNavItemIndex() { | ||
var _this = this; | ||
var _this$$parent, | ||
_this = this; | ||
return this.tabs.navItems.findIndex(function (navItem) { | ||
return (_this$$parent = this.$parent) === null || _this$$parent === void 0 ? void 0 : _this$$parent.navItems.findIndex(function (navItem) { | ||
return navItem.model === _this.model; | ||
@@ -1185,14 +1204,14 @@ }); | ||
disabled: function disabled(payload) { | ||
var _this$tabs; | ||
var _this$$parent2; | ||
payload && ((_this$tabs = this.tabs) === null || _this$tabs === void 0 ? void 0 : _this$tabs.disableTabItem(this.ownNavItemIndex)); | ||
this.tabs.navItems[this.ownNavItemIndex].disabled = payload; | ||
payload && ((_this$$parent2 = this.$parent) === null || _this$$parent2 === void 0 ? void 0 : _this$$parent2.disableTabItem(this.ownNavItemIndex)); | ||
this.$parent.navItems[this.ownNavItemIndex].disabled = payload; | ||
} | ||
}, | ||
methods: { | ||
beforeEnter: function beforeEnter(el) { | ||
el.style.position = "relative"; | ||
beforeEnterHandle: function beforeEnterHandle(element) { | ||
element.style.position = "relative"; | ||
}, | ||
leave: function leave(el) { | ||
el.style.position = "absolute"; | ||
leaveHandle: function leaveHandle(element) { | ||
element.style.position = "absolute"; | ||
} | ||
@@ -1216,4 +1235,4 @@ } | ||
on: { | ||
"beforeEnter": _vm.beforeEnter, | ||
"leave": _vm.leave | ||
"beforeEnter": _vm.beforeEnterHandle, | ||
"leave": _vm.leaveHandle | ||
} | ||
@@ -1227,3 +1246,3 @@ }, [_c('div', { | ||
}], | ||
staticClass: "tab-item", | ||
staticClass: "vmt__tab-item", | ||
style: { | ||
@@ -1240,4 +1259,4 @@ 'transition-duration': _vm.transition.duration + "ms" | ||
if (!inject) return; | ||
inject("data-v-460da628_0", { | ||
source: ".tab-item[data-v-460da628]{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-460da628],.slide-right-leave-to[data-v-460da628]{transform:translateX(-100%)}.slide-left-leave-to[data-v-460da628],.slide-right-enter[data-v-460da628]{transform:translateX(100%)}.slide-bottom-leave-to[data-v-460da628],.slide-top-enter[data-v-460da628]{transform:translateY(-100%)}.slide-bottom-enter[data-v-460da628],.slide-top-leave-to[data-v-460da628]{transform:translateY(100%)}", | ||
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%)}", | ||
map: undefined, | ||
@@ -1250,6 +1269,6 @@ media: undefined | ||
var __vue_scope_id__ = "data-v-460da628"; | ||
var __vue_scope_id__ = "data-v-90aaa762"; | ||
/* module identifier */ | ||
var __vue_module_identifier__ = "data-v-460da628"; | ||
var __vue_module_identifier__ = "data-v-90aaa762"; | ||
/* functional template */ | ||
@@ -1256,0 +1275,0 @@ |
{ | ||
"name": "vue-material-tabs", | ||
"version": "0.1.8", | ||
"version": "0.1.9", | ||
"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
127234
2241