UNPKG

@xysfe/actui

Version:

A fantastic mobile ui lib implement by Vue

1 lines 15 kB
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("@xysfe/actui/es/assets/utils/create/index.js"),require("@xysfe/actui/es/assets/mixins/visible.js"),require("@xysfe/actui/es/assets/common/scroll.js")):"function"==typeof define&&define.amd?define(["@xysfe/actui/es/assets/utils/create/index.js","@xysfe/actui/es/assets/mixins/visible.js","@xysfe/actui/es/assets/common/scroll.js"],e):"object"==typeof exports?exports.Tab=e(require("@xysfe/actui/es/assets/utils/create/index.js"),require("@xysfe/actui/es/assets/mixins/visible.js"),require("@xysfe/actui/es/assets/common/scroll.js")):t.Tab=e(t["@xysfe/actui/es/assets/utils/create/index.js"],t["@xysfe/actui/es/assets/mixins/visible.js"],t["@xysfe/actui/es/assets/common/scroll.js"])}("undefined"!=typeof self?self:this,function(t,e,n){return function(t){function e(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,e),o.l=!0,o.exports}var n={};return e.m=t,e.c=n,e.d=function(t,n,r){e.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:r})},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="../es",e(e.s=1870)}({0:function(t,e){var n=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=n)},1:function(t,e,n){var r=n(31)("wks"),o=n(24),i=n(0).Symbol,c="function"==typeof i;(t.exports=function(t){return r[t]||(r[t]=c&&i[t]||(c?i:o)("Symbol."+t))}).store=r},10:function(t,e,n){var r=n(4),o=n(41),i=n(38),c=Object.defineProperty;e.f=n(3)?Object.defineProperty:function(t,e,n){if(r(t),e=i(e,!0),r(n),o)try{return c(t,e,n)}catch(t){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(t[e]=n.value),t}},11:function(t,e){t.exports={}},1184:function(t,e,n){"use strict";var r=n(797),o=n.n(r),i=n(40),c=n.n(i),u=n(129),s=n.n(u);e.a={name:"ActTab",mixins:[c.a],data:function(){return{listElements:null,scroll:null,barWidth:22}},components:{scroll:s.a},props:{activeIndex:{type:Number,default:0},list:{type:Array,default:function(){return[]}},brandColor:{type:String,default:"#8c7fee"}},computed:{len:function(){return this.list.length||0},belowFive:function(){return this.len&&this.len<=4},width:function(){return document.body.clientWidth},perWidth:function(){return this.belowFive?this.width/this.len:this.width/4.5},left:function(){return(this.perWidth-this.barWidth)/2},activeBarLeft:function(){return this.activeIndex<this.list.length?this.activeIndex*this.perWidth+this.left:this.left}},mounted:function(){this.listElements=o()(this.$refs.actTab.querySelectorAll(".act-gold-tab-item"))},methods:{isSelected:function(t){return t===this.activeIndex},changeTab:function(t){this.$emit("change",t)},scrollSuc:function(t){this.scroll=t,this.activeIndex>=4&&this.scrollTo(this.activeIndex)},scrollTo:function(t){var e=0;e=Number(t)<=2?0:Number(t)>=Number(this.len)-2?this.len-4:Number(t)-2,this.scroll.scrollToElement(this.listElements[e],100)}},watch:{activeIndex:function(t,e){if(this.belowFive)return!1;this.listElements||(this.listElements=o()(this.$refs.actTab.querySelectorAll(".act-gold-tab-item"))),this.scrollTo(t)}}}},12:function(t,e){t.exports=function(t){try{return!!t()}catch(t){return!0}}},129:function(t,e){t.exports=n},13:function(t,e,n){var r=n(34),o=n(15);t.exports=function(t){return r(o(t))}},14:function(t,e){var n={}.toString;t.exports=function(t){return n.call(t).slice(8,-1)}},15:function(t,e){t.exports=function(t){if(void 0==t)throw TypeError("Can't call method on "+t);return t}},16:function(t,e){var n=Math.ceil,r=Math.floor;t.exports=function(t){return isNaN(t=+t)?0:(t>0?r:n)(t)}},17:function(t,e,n){var r=n(19);t.exports=function(t,e,n){if(r(t),void 0===e)return t;switch(n){case 1:return function(n){return t.call(e,n)};case 2:return function(n,r){return t.call(e,n,r)};case 3:return function(n,r,o){return t.call(e,n,r,o)}}return function(){return t.apply(e,arguments)}}},18:function(t,e){t.exports=!0},1870:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(26),o=n.n(r),i=n(1871);i.a.install=function(t){t.component(i.a.name,i.a),t.prototype.$createTab=o()(i.a,t)},e.default=i.a},1871:function(t,e,n){"use strict";function r(t){u||n(1872)}var o=n(1184),i=n(1873),c=n(7),u=!1,s=r,a=Object(c.a)(o.a,i.a,i.b,!1,s,"data-v-6ed2fc1a",null);a.options.__file="src\\components\\Tab\\src\\index.vue",e.a=a.exports},1872:function(t,e){},1873:function(t,e,n){"use strict";n.d(e,"a",function(){return r}),n.d(e,"b",function(){return o});var r=function(){var t=this,e=t.$createElement,n=t._self._c||e;return t.list&&t.list.length?n("div",{ref:"actTab",staticClass:"act-gold-tab"},[n("scroll",{ref:"scroll",staticClass:"act-tab-scroll",attrs:{direction:"horizontal",click:!0,listenScrollInit:!0},on:{scrollSuc:t.scrollSuc}},[t._l(t.list,function(e,r){return n("div",{key:r,staticClass:"act-gold-tab-item",class:{active:t.isSelected(r)},style:"width:"+(t.belowFive?t.width/t.list.length:t.perWidth)+"px",on:{click:function(e){return e.stopPropagation(),t.changeTab(r)}}},[t._v("\n "+t._s(e.name)+"\n ")])}),t._v(" "),n("i",{staticClass:"active_bar",style:"left:"+t.activeBarLeft+"px; backgroundColor:"+t.brandColor})],2),t._v(" "),n("i",{directives:[{name:"show",rawName:"v-show",value:Number(t.activeIndex)<=Number(t.len-3),expression:"Number(activeIndex) <= Number(len - 3)"}],staticClass:"cover_layer right"})],1):t._e()},o=[];r._withStripped=!0},19:function(t,e){t.exports=function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t}},2:function(t,e){var n=t.exports={version:"2.6.12"};"number"==typeof __e&&(__e=n)},20:function(t,e,n){var r=n(31)("keys"),o=n(24);t.exports=function(t){return r[t]||(r[t]=o(t))}},22:function(t,e,n){var r=n(6),o=n(0).document,i=r(o)&&r(o.createElement);t.exports=function(t){return i?o.createElement(t):{}}},23:function(t,e){t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},24:function(t,e){var n=0,r=Math.random();t.exports=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++n+r).toString(36))}},26:function(e,n){e.exports=t},27:function(t,e,n){var r=n(10).f,o=n(8),i=n(1)("toStringTag");t.exports=function(t,e,n){t&&!o(t=n?t:t.prototype,i)&&r(t,i,{configurable:!0,value:e})}},28:function(t,e,n){var r=n(42),o=n(32);t.exports=Object.keys||function(t){return r(t,o)}},3:function(t,e,n){t.exports=!n(12)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},31:function(t,e,n){var r=n(2),o=n(0),i=o["__core-js_shared__"]||(o["__core-js_shared__"]={});(t.exports=function(t,e){return i[t]||(i[t]=void 0!==e?e:{})})("versions",[]).push({version:r.version,mode:n(18)?"pure":"global",copyright:"© 2020 Denis Pushkarev (zloirock.ru)"})},32:function(t,e){t.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},33:function(t,e,n){var r=n(15);t.exports=function(t){return Object(r(t))}},34:function(t,e,n){var r=n(14);t.exports=Object("z").propertyIsEnumerable(0)?Object:function(t){return"String"==r(t)?t.split(""):Object(t)}},35:function(t,e,n){var r=n(16),o=Math.min;t.exports=function(t){return t>0?o(r(t),9007199254740991):0}},36:function(t,e,n){"use strict";var r=n(18),o=n(9),i=n(54),c=n(5),u=n(11),s=n(60),a=n(27),f=n(62),l=n(1)("iterator"),p=!([].keys&&"next"in[].keys()),v=function(){return this};t.exports=function(t,e,n,d,h,y,x){s(n,e,d);var b,m,_,g=function(t){if(!p&&t in S)return S[t];switch(t){case"keys":case"values":return function(){return new n(this,t)}}return function(){return new n(this,t)}},w=e+" Iterator",j="values"==h,O=!1,S=t.prototype,T=S[l]||S["@@iterator"]||h&&S[h],E=T||g(h),C=h?j?g("entries"):E:void 0,P="Array"==e?S.entries||T:T;if(P&&(_=f(P.call(new t)))!==Object.prototype&&_.next&&(a(_,w,!0),r||"function"==typeof _[l]||c(_,l,v)),j&&T&&"values"!==T.name&&(O=!0,E=function(){return T.call(this)}),r&&!x||!p&&!O&&S[l]||c(S,l,E),u[e]=E,u[w]=v,h)if(b={values:j?E:g("values"),keys:y?E:g("keys"),entries:C},x)for(m in b)m in S||i(S,m,b[m]);else o(o.P+o.F*(p||O),e,b);return b}},38:function(t,e,n){var r=n(6);t.exports=function(t,e){if(!r(t))return t;var n,o;if(e&&"function"==typeof(n=t.toString)&&!r(o=n.call(t)))return o;if("function"==typeof(n=t.valueOf)&&!r(o=n.call(t)))return o;if(!e&&"function"==typeof(n=t.toString)&&!r(o=n.call(t)))return o;throw TypeError("Can't convert object to primitive value")}},4:function(t,e,n){var r=n(6);t.exports=function(t){if(!r(t))throw TypeError(t+" is not an object!");return t}},40:function(t,n){t.exports=e},41:function(t,e,n){t.exports=!n(3)&&!n(12)(function(){return 7!=Object.defineProperty(n(22)("div"),"a",{get:function(){return 7}}).a})},42:function(t,e,n){var r=n(8),o=n(13),i=n(46)(!1),c=n(20)("IE_PROTO");t.exports=function(t,e){var n,u=o(t),s=0,a=[];for(n in u)n!=c&&r(u,n)&&a.push(n);for(;e.length>s;)r(u,n=e[s++])&&(~i(a,n)||a.push(n));return a}},43:function(t,e,n){var r=n(0).document;t.exports=r&&r.documentElement},45:function(t,e,n){var r=n(14),o=n(1)("toStringTag"),i="Arguments"==r(function(){return arguments}()),c=function(t,e){try{return t[e]}catch(t){}};t.exports=function(t){var e,n,u;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(n=c(e=Object(t),o))?n:i?r(e):"Object"==(u=r(e))&&"function"==typeof e.callee?"Arguments":u}},46:function(t,e,n){var r=n(13),o=n(35),i=n(47);t.exports=function(t){return function(e,n,c){var u,s=r(e),a=o(s.length),f=i(c,a);if(t&&n!=n){for(;a>f;)if((u=s[f++])!=u)return!0}else for(;a>f;f++)if((t||f in s)&&s[f]===n)return t||f||0;return!t&&-1}}},47:function(t,e,n){var r=n(16),o=Math.max,i=Math.min;t.exports=function(t,e){return t=r(t),t<0?o(t+e,0):i(t,e)}},48:function(t,e,n){"use strict";var r=n(59)(!0);n(36)(String,"String",function(t){this._t=String(t),this._i=0},function(){var t,e=this._t,n=this._i;return n>=e.length?{value:void 0,done:!0}:(t=r(e,n),this._i+=t.length,{value:t,done:!1})})},5:function(t,e,n){var r=n(10),o=n(23);t.exports=n(3)?function(t,e,n){return r.f(t,e,o(1,n))}:function(t,e,n){return t[e]=n,t}},52:function(t,e,n){var r=n(4),o=n(61),i=n(32),c=n(20)("IE_PROTO"),u=function(){},s=function(){var t,e=n(22)("iframe"),r=i.length;for(e.style.display="none",n(43).appendChild(e),e.src="javascript:",t=e.contentWindow.document,t.open(),t.write("<script>document.F=Object<\/script>"),t.close(),s=t.F;r--;)delete s.prototype[i[r]];return s()};t.exports=Object.create||function(t,e){var n;return null!==t?(u.prototype=r(t),n=new u,u.prototype=null,n[c]=t):n=s(),void 0===e?n:o(n,e)}},54:function(t,e,n){t.exports=n(5)},56:function(t,e,n){var r=n(45),o=n(1)("iterator"),i=n(11);t.exports=n(2).getIteratorMethod=function(t){if(void 0!=t)return t[o]||t["@@iterator"]||i[r(t)]}},59:function(t,e,n){var r=n(16),o=n(15);t.exports=function(t){return function(e,n){var i,c,u=String(o(e)),s=r(n),a=u.length;return s<0||s>=a?t?"":void 0:(i=u.charCodeAt(s),i<55296||i>56319||s+1===a||(c=u.charCodeAt(s+1))<56320||c>57343?t?u.charAt(s):i:t?u.slice(s,s+2):c-56320+(i-55296<<10)+65536)}}},6:function(t,e){t.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},60:function(t,e,n){"use strict";var r=n(52),o=n(23),i=n(27),c={};n(5)(c,n(1)("iterator"),function(){return this}),t.exports=function(t,e,n){t.prototype=r(c,{next:o(1,n)}),i(t,e+" Iterator")}},61:function(t,e,n){var r=n(10),o=n(4),i=n(28);t.exports=n(3)?Object.defineProperties:function(t,e){o(t);for(var n,c=i(e),u=c.length,s=0;u>s;)r.f(t,n=c[s++],e[n]);return t}},62:function(t,e,n){var r=n(8),o=n(33),i=n(20)("IE_PROTO"),c=Object.prototype;t.exports=Object.getPrototypeOf||function(t){return t=o(t),r(t,i)?t[i]:"function"==typeof t.constructor&&t instanceof t.constructor?t.constructor.prototype:t instanceof Object?c:null}},7:function(t,e,n){"use strict";function r(t,e,n,r,o,i,c,u){t=t||{};var s=typeof t.default;"object"!==s&&"function"!==s||(t=t.default);var a="function"==typeof t?t.options:t;e&&(a.render=e,a.staticRenderFns=n,a._compiled=!0),r&&(a.functional=!0),i&&(a._scopeId=i);var f;if(c?(f=function(t){t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,t||"undefined"==typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),o&&o.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(c)},a._ssrRegister=f):o&&(f=u?function(){o.call(this,this.$root.$options.shadowRoot)}:o),f)if(a.functional){a._injectStyles=f;var l=a.render;a.render=function(t,e){return f.call(e),l(t,e)}}else{var p=a.beforeCreate;a.beforeCreate=p?[].concat(p,f):[f]}return{exports:t,options:a}}e.a=r},797:function(t,e,n){t.exports={default:n(798),__esModule:!0}},798:function(t,e,n){n(48),n(799),t.exports=n(2).Array.from},799:function(t,e,n){"use strict";var r=n(17),o=n(9),i=n(33),c=n(83),u=n(84),s=n(35),a=n(800),f=n(56);o(o.S+o.F*!n(87)(function(t){Array.from(t)}),"Array",{from:function(t){var e,n,o,l,p=i(t),v="function"==typeof this?this:Array,d=arguments.length,h=d>1?arguments[1]:void 0,y=void 0!==h,x=0,b=f(p);if(y&&(h=r(h,d>2?arguments[2]:void 0,2)),void 0==b||v==Array&&u(b))for(e=s(p.length),n=new v(e);e>x;x++)a(n,x,y?h(p[x],x):p[x]);else for(l=b.call(p),n=new v;!(o=l.next()).done;x++)a(n,x,y?c(l,h,[o.value,x],!0):o.value);return n.length=x,n}})},8:function(t,e){var n={}.hasOwnProperty;t.exports=function(t,e){return n.call(t,e)}},800:function(t,e,n){"use strict";var r=n(10),o=n(23);t.exports=function(t,e,n){e in t?r.f(t,e,o(0,n)):t[e]=n}},83:function(t,e,n){var r=n(4);t.exports=function(t,e,n,o){try{return o?e(r(n)[0],n[1]):e(n)}catch(e){var i=t.return;throw void 0!==i&&r(i.call(t)),e}}},84:function(t,e,n){var r=n(11),o=n(1)("iterator"),i=Array.prototype;t.exports=function(t){return void 0!==t&&(r.Array===t||i[o]===t)}},87:function(t,e,n){var r=n(1)("iterator"),o=!1;try{var i=[7][r]();i.return=function(){o=!0},Array.from(i,function(){throw 2})}catch(t){}t.exports=function(t,e){if(!e&&!o)return!1;var n=!1;try{var i=[7],c=i[r]();c.next=function(){return{done:n=!0}},i[r]=function(){return c},t(i)}catch(t){}return n}},9:function(t,e,n){var r=n(0),o=n(2),i=n(17),c=n(5),u=n(8),s=function(t,e,n){var a,f,l,p=t&s.F,v=t&s.G,d=t&s.S,h=t&s.P,y=t&s.B,x=t&s.W,b=v?o:o[e]||(o[e]={}),m=b.prototype,_=v?r:d?r[e]:(r[e]||{}).prototype;v&&(n=e);for(a in n)(f=!p&&_&&void 0!==_[a])&&u(b,a)||(l=f?_[a]:n[a],b[a]=v&&"function"!=typeof _[a]?n[a]:y&&f?i(l,r):x&&_[a]==l?function(t){var e=function(e,n,r){if(this instanceof t){switch(arguments.length){case 0:return new t;case 1:return new t(e);case 2:return new t(e,n)}return new t(e,n,r)}return t.apply(this,arguments)};return e.prototype=t.prototype,e}(l):h&&"function"==typeof l?i(Function.call,l):l,h&&((b.virtual||(b.virtual={}))[a]=l,t&s.R&&m&&!m[a]&&c(m,a,l)))};s.F=1,s.G=2,s.S=4,s.P=8,s.B=16,s.W=32,s.U=64,s.R=128,t.exports=s}})});