UNPKG

nimble-ui

Version:
1 lines 7.83 kB
module.exports=function(t){var e={};function n(i){if(e[i])return e[i].exports;var o=e[i]={i:i,l:!1,exports:{}};return t[i].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=t,n.c=e,n.d=function(t,e,i){n.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:i})},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="/",n(n.s="n4ML")}({"/Ot8":function(t,e,n){"use strict";var i,o,s,r,a={trident:(i=navigator.userAgent).indexOf("Trident")>-1,presto:i.indexOf("Presto")>-1,webKit:i.indexOf("AppleWebKit")>-1,gecko:i.indexOf("Gecko")>-1&&-1===i.indexOf("KHTML"),mobile:!!i.match(/AppleWebKit.*Mobile.*/),ios:!!i.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/),android:i.indexOf("Android")>-1||i.indexOf("Adr")>-1,iPhone:i.indexOf("iPhone")>-1,iPad:i.indexOf("iPad")>-1,symbian:i.indexOf("SymbianOS")>-1,windowPhone:i.indexOf("Windows Phone")>-1,iPod:i.indexOf("iPod")>-1,weixin:/MicroMessenger/i.test(i),browserVersion:(i.match(/version\/(.+?)\s/i)||[])[1],appVersion:"",kernel:/tencenttraveler|qqbrowse/i.test(i)?"x5":"",qqnews:/qqnews/i.test(i),isMiniProgram:"miniprogram"===window.__wxjs_environment||/miniProgram/i.test(i)},l=(o=window.screen||{},r={mobile:!1,pc:!1,ios:(s=a).ios||s.iPhone||s.iPad||!1,weixin:s.weixin||!1,isWeixin:s.weixin||!1,iPad:s.iPad||!1,isApp:!1,appVersion:s.appVersion,browserVersion:s.browserVersion,isLightApp:!1,kernel:s.kernel,isIphoneX:s.iPhone&&812===o.height&&375===o.width,android:s.android,isQqnews:s.qqnews,isMiniProgram:s.isMiniProgram},s.mobile||s.ios||s.android||s.iPhone||s.iPad||s.symbian||s.windowPhone||s.iPod||r.isApp?r.mobile=!0:r.pc=!0,r);e.a=l},"4qRk":function(t,e,n){"use strict";e.a=function(t){t&&!t.install&&(t.install=function(e){var n=t.name||"",i=e.component(n);i||e.component(n,t)});return t}},ApHY:function(t,e){},"B/FW":function(t,e){},EGiU:function(t,e,n){"use strict";var i={extends:n("Lv3q").a},o=n("VU/8")(i,null,!1,null,null,null);e.a=o.exports},Lv3q:function(t,e,n){"use strict";n("B/FW");var i=n("VU/8")({methods:{_onClick:function(t){this.$emit("click",t)},_onTap:function(t){this.$emit("tap",t)},_onClickItem:function(t){this.$emit("clickItem",t)}}},null,!1,null,null,null);e.a=i.exports},MEnT:function(t,e,n){"use strict";e.a=function(t){if("undefined"==typeof HTMLElement||!(t instanceof HTMLElement))return window;var e=t;for(;e&&e!==document.body&&e!==document.documentElement;){if(e!==t){if(e._isScroll)return e;if(!e.parentNode)break;if(!1!==e._isScroll){if(/(scroll|auto)/.test(o(e)))return e._isScroll=!0,e;e._isScroll=!1}}e=e.parentNode}return window};var i=n("fk+x");function o(t){return Object(i.a)(t,"overflow")+Object(i.a)(t,"overflow-y")+Object(i.a)(t,"overflow-x")}},"Mq/+":function(t,e){},RPOG:function(t,e){},SmQy:function(t,e){},VGJd:function(t,e,n){"use strict";var i=n("/Ot8");e.a=i.a},"VU/8":function(t,e){t.exports=function(t,e,n,i,o,s){var r,a=t=t||{},l=typeof t.default;"object"!==l&&"function"!==l||(r=t,a=t.default);var u,c="function"==typeof a?a.options:a;if(e&&(c.render=e.render,c.staticRenderFns=e.staticRenderFns,c._compiled=!0),n&&(c.functional=!0),o&&(c._scopeId=o),s?(u=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__),i&&i.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(s)},c._ssrRegister=u):i&&(u=i),u){var d=c.functional,f=d?c.render:c.beforeCreate;d?(c._injectStyles=u,c.render=function(t,e){return u.call(e),f(t,e)}):c.beforeCreate=f?[].concat(f,u):[u]}return{esModule:r,exports:a,options:c}}},"fk+x":function(t,e,n){"use strict";e.a=function(t,e){return("undefined"!=typeof getComputedStyle?getComputedStyle(t,null).getPropertyValue(e):t.style[e])||""}},n4ML:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n("VGJd"),o=n("EGiU"),s={render:function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"nus_layout-header"},[e("div",{staticClass:"nu_layout-header"},[this._t("default")],2)])},staticRenderFns:[]};var r=n("VU/8")({},s,!1,function(t){n("Mq/+")},null,null).exports,a=n("sL/4"),l={mounted:function(){var t=this;t._initCom(),t.$nextTick(function(){t._timer=setTimeout(function(){t._initCom(),t._timer=setTimeout(function(){t._timer=void 0,t._initCom()},200)},0)})},beforeDestroy:function(){this._clearEvent()},updated:function(){this._initCom()},methods:{_initCom:function(t){var e=void 0;this.scrollEl?t&&(this._clearEvent(),e=this.getScrollEl(t)):(this._clearEvent(),e=this.getScrollEl(t)),e&&e.addEventListener("scroll",this._scroll)},_clearEvent:function(){var t=this.scrollEl;t&&t.removeEventListener("scroll",this._scroll),t&&void 0!==this._timer&&clearTimeout(this._timer)},_scroll:function(t){this.$emit("scroll",t)},getScrollEl:function(t){var e=this.$refs&&this.$refs.hook_main;return this.scrollEl=!t&&this.scrollEl||e&&Object(a.a)(e),this.scrollEl}}},u={render:function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"nus_layout-main"},[e("div",{ref:"hook_main",staticClass:"nu_layout-main"},[this._t("default")],2)])},staticRenderFns:[]};var c=n("VU/8")(l,u,!1,function(t){n("RPOG")},null,null).exports,d={render:function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"nus_layout-footer"},[e("div",{staticClass:"nu_layout-footer"},[this._t("default")],2)])},staticRenderFns:[]};var f=n("VU/8")({},d,!1,function(t){n("SmQy")},null,null).exports,m={extends:o.a,name:"NuLayout",props:{fit:{type:Boolean,default:!1},layout:{default:"default"},bdClassName:{default:""},hdClassName:{default:""},isFooter:{type:Boolean,default:!0},isHeader:{type:Boolean,default:!0}},computed:{layoutClass:function(){var t="";switch(this.layout){case"fixed":t="fixed";break;case"absolute":t="absolute";break;case"default":t="default"}return t&&"nu_loyouttcd-"+t||null},isRadius:function(){var t=navigator.userAgent;return/VCE-AL00|VCE-TL00|PCT-AL10|PCT-TL10|GNA-AL00/i.test(t)&&"nu_huawei-radius"},myIsHeader:function(){var t=!1,e=this.$slots.hook_hd;return this.isHeader&&e&&e.length>0&&(t=!0),t},myIsFooter:function(){var t=!1,e=this.$slots.hook_ft;return this.isFooter&&e&&e.length>0&&(t=!0),t},myBdClassName:function(){var t=this.bdClassName,e=void 0;return t instanceof Array?(e=t.slice(),this.myIsFooter&&e.push("nu_foot-active")):t instanceof Object?(e=Object.assign({},t),this.myIsFooter&&(e["nu_foot-active"]=!0)):"string"==typeof t&&(e=[t],this.myIsFooter&&e.push("nu_foot-active")),e}},components:{NuLayoutHeader:r,NuLayoutMain:c,NuLayoutFooter:f},created:function(){this._setHtmlClassName()},methods:{_scroll:function(t){this.$emit("scroll",t)},_setHtmlClassName:function(){var t=document.documentElement;i.a.android&&t.classList.add("nu-android"),i.a.ios&&t.classList.add("nu-ios"),i.a.isApp&&location.href.includes("navHidden=1")&&t.classList.add("nu-nav-hidden")}}},h={render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"nus_layouttcd",class:[t.isRadius,t.fit&&"nu_iphonex",t.layoutClass]},[t.myIsHeader?n("nu-layout-header",{class:t.hdClassName},[t._t("hook_hd")],2):t._e(),t._v(" "),n("nu-layout-main",{class:t.myBdClassName,on:{scroll:t._scroll}},[t._t("default")],2),t._v(" "),t.myIsFooter?n("nu-layout-footer",[t._t("hook_ft")],2):t._e()],1)},staticRenderFns:[]};var _=n("VU/8")(m,h,!1,function(t){n("ApHY")},null,null).exports,p=n("4qRk");e.default=Object(p.a)(_)},"sL/4":function(t,e,n){"use strict";var i=n("MEnT");e.a=function t(e){var n=e;n&&n.scrollHeight-n.offsetHeight<50&&(n=n!==window?t(Object(i.a)(n)):null),n===window&&(document.body.scrollHeight||document.documentElement.scrollHeight)-window.innerHeight<30&&(n=null);return n}}});