bestnihon-react-components
Advanced tools
Comparing version 2.2.20 to 2.2.21
@@ -42,3 +42,3 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } | ||
_this.slideMove = function (e) { | ||
event.preventDefault(); | ||
// event.preventDefault(); | ||
// 判断方向 | ||
@@ -45,0 +45,0 @@ var moveEndX = e.changedTouches[0].pageX; |
@@ -52,3 +52,3 @@ 'use strict'; | ||
_this.slideMove = function (e) { | ||
event.preventDefault(); | ||
// event.preventDefault(); | ||
// 判断方向 | ||
@@ -55,0 +55,0 @@ var moveEndX = e.changedTouches[0].pageX; |
{ | ||
"name": "bestnihon-react-components", | ||
"version": "2.2.20", | ||
"version": "2.2.21", | ||
"description": "bestnihon-react-components React component", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
/*! | ||
* bestnihon-react-components v2.2.20 | ||
* bestnihon-react-components v2.2.21 | ||
* MIT Licensed | ||
*/ | ||
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("react")):"function"==typeof define&&define.amd?define(["react"],e):"object"==typeof exports?exports.Y=e(require("react")):t.Y=e(t.React)}("undefined"!=typeof self?self:this,function(t){return function(t){var e={};function n(o){if(e[o])return e[o].exports;var r=e[o]={i:o,l:!1,exports:{}};return t[o].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=t,n.c=e,n.d=function(t,e,o){n.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:o})},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=2)}([function(e,n){e.exports=t},function(t,e,n){"use strict";function o(t,e){return parseFloat(window.getComputedStyle(t,null)[e])||t.getBoundingClientRect()[e]}n.d(e,"a",function(){return o})},function(t,e,n){t.exports=n(3)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(4);n.d(e,"NavBar",function(){return o.a});var r=n(6);n.d(e,"TabContainer",function(){return r.a});var i=n(8);n.d(e,"TabContainerItem",function(){return i.a});var a=n(10);n.d(e,"ScrollView",function(){return a.a});var s=n(12);n.d(e,"LozyLoad",function(){return s.a});var l=n(15);n.d(e,"AutoScrollTab",function(){return l.a});var c=n(17);n.d(e,"ListViewSlide",function(){return c.a})},function(t,e,n){"use strict";var o,r,i=n(0),a=n.n(i),s=n(1),l=n(5);n.n(l);var c=(o=function(t){function e(n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var o=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,t.call(this,n));r.call(o);var i=n.data,a=n.children,s=i?i.length:a.length;return o.state={ind:n.index||0,isAnimate:n.isAnimate||!1,onSel:n.onSel,data:n.data,length:s},o}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,t),e.prototype.componentDidMount=function(){var t=this,e=this.state.length;this.setState({itemWidth:Object(s.a)(this.wrap,"width")/e},function(){return t.setBarWidth()})},e.prototype.componentWillReceiveProps=function(t){var e=this,n=t.index,o=t.translate,r=this.state.ind;o&&this.translateBar(o),n>=0&&r!==n&&this.setState({ind:n},function(){return e.setBarWidth()})},e.prototype.render=function(){var t=this,e=this.state,n=e.ind,o=e.data,r=e.itemWidth,i=this.props,s=i.children,l=i.style;return a.a.createElement("div",{style:l,className:"NavBar-root",ref:function(e){return t.wrap=e}},a.a.createElement("div",{className:"container",ref:function(e){return t.container=e}},o?o.map(function(e,o){return a.a.createElement("span",{key:"Nav"+o,style:{width:r+"px"},className:"Nav-item "+(o===n&&"active"),onClick:function(){return t.sel(e,o)}},a.a.createElement("span",null,e.name))}):s.map(function(e,o){return a.a.createElement("span",{key:"Nav"+o,style:{width:r+"px"},className:"Nav-item "+(o===n&&"active"),onClick:function(){return t.sel(e,o)}},e)})),a.a.createElement("div",{className:"Nav-active",style:{width:r+"px",transform:"translatex("+n*r+"px)"},ref:function(e){return t.bar=e}},a.a.createElement("div",{className:"Nav-active-bar",ref:function(e){return t.flag=e}})))},e}(i.Component),r=function(){var t=this;this.translateBar=function(e){var n=t.state.length,o=e.distance,r=e.transition;t.bar.style.transition=r?"all 200ms":"none",t.bar.style.transform="translateX("+-o/n+"px)"},this.sel=function(e,n){var o=t.state,r=o.isAnimate,i=o.onSel;t.bar.style.transition=r?"all 200ms":"none",t.setState({ind:n},function(){i&&i(e,n),t.setBarWidth()})},this.setBarWidth=function(){var e=t.state.ind,n=t.container.children,o=(n[e].children.length>=1?n[e].children[0]:n[e]).getBoundingClientRect().width;t.flag.style.width=o+"px"}},o);e.a=c},function(t,e){},function(t,e,n){"use strict";var o=n(0),r=n.n(o),i=n(7);n.n(i);var a="left",s="right",l="top",c="down",u=function(t){function e(n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var o=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,t.call(this,n));return o.slideStart=function(t){o.startX=t.changedTouches[0].pageX,o.startY=t.changedTouches[0].pageY},o.slideMove=function(t){event.preventDefault();var e=t.changedTouches[0].pageX,n=t.changedTouches[0].pageY,r=e-o.startX,i=n-o.startY,u=r-o.itemWidth*o.index;if(!o.slideDirection||o.slideDirection===s||o.slideDirection===a)if(Math.abs(r)>Math.abs(i)&&r>0)0!==o.index&&o.translate(u),o.slideDirection=s;else if(Math.abs(r)>Math.abs(i)&&r<0)o.index!==o.props.children.length-1&&o.translate(u),o.slideDirection=a;else if(Math.abs(i)>Math.abs(r)&&i>0){if(o.slideDirection)return;o.slideDirection=c}else if(Math.abs(i)>Math.abs(r)&&i<0){if(o.slideDirection)return;o.slideDirection=l}},o.slideEnd=function(t){o.endX=t.changedTouches[0].pageX,o.isTranslate()},o.translate=function(t,e){var n="\n "+(e?"transition: all 200ms;":"")+"\n transform:translateX("+t+"px)\n ";o.container.style=n;var r=o.props.onTranslate;r&&r({distance:t,transition:e})},o.isTranslate=function(){if(o.slideDirection===s||o.slideDirection===a){var t=o.props.onSel,e=o.endX-o.startX,n={right:function(){0!==o.index&&o.index--},left:function(){o.index!==o.props.children.length-1&&o.index++}};Math.abs(e)>=o.interval&&(n[o.slideDirection](),console.log("上下页切换",o.index),t&&t(o.index)),o.translate(-o.index*o.itemWidth,!0)}o.slideDirection=null},o.itemWidth=window.screen.width,o.interval=n.interval||parseInt(o.itemWidth/5),o.index=n.index||0,o.oldIndex=n.index||0,o}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,t),e.prototype.componentWillReceiveProps=function(t){var e=t.index,n=this.props.onTranslate;this.index!==e&&(this.index=e,n&&n({distance:-this.index*this.itemWidth}),this.container.style.transition=null,this.container.style.transform="translateX("+-e*this.itemWidth+"px)")},e.prototype.componentDidMount=function(){this.translate(-this.index*this.itemWidth),this.root.addEventListener("touchstart",this.slideStart),this.root.addEventListener("touchmove",this.slideMove),this.root.addEventListener("touchend",this.slideEnd)},e.prototype.componentWillUnmount=function(){this.root.removeEventListener("touchstart",this.slideStart),this.root.removeEventListener("touchmove",this.slideMove),this.root.removeEventListener("touchend",this.slideEnd)},e.prototype.render=function(){var t=this;return r.a.createElement("div",{className:"tab-container-root",ref:function(e){t.root=e}},r.a.createElement("ul",{className:"tab-container",ref:function(e){t.container=e}},this.props.children))},e}(o.Component);e.a=u},function(t,e){},function(t,e,n){"use strict";var o=n(0),r=n.n(o),i=n(9),a=(n.n(i),Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t});var s=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,t.apply(this,arguments))}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,t),e.prototype.render=function(){var t=this,e=Object.assign({},this.props),n=e.style;return n?n.height||(n.height=window.screen.height+"px"):n={height:window.screen.height+"px"},r.a.createElement("li",a({className:"TabContainerItem"},e,{ref:function(e){return t.el=e}}),this.props.children)},e}(o.Component);e.a=s},function(t,e){},function(t,e,n){"use strict";var o=n(0),r=n.n(o),i=n(1),a=n(11);n.n(a);var s="top",l="bottom",c="loading",u="touch_top",h="touch_bottom",f="touch_left",d="touch_right",p=function(t){function e(n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var o=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,t.call(this,n));return o.handleTouchStart=function(t){o.startY=t.touches[0].clientY,o.startX=t.touches[0].clientX},o.handleTouchMove=function(t){var e=o.state,n=e.isPullDown,r=e.isPullUp,i=e.topDistance,a=e.bottomDistance,f=e.isPullDownStatus,d=e.isPullUpStatus,p=e.isLoadOver,m=o.wrap.scrollTop,v=t.touches[0].clientY,y=t.touches[0].clientX-o.startX,b=v-o.startY,w=void 0;o.direction=o.setDirection(y,b),n&&o.direction===h&&0===m&&f!==c&&!d?(event.preventDefault(),o.pullDownBarStartY=o.pullDownBarStartY?o.pullDownBarStartY:t.touches[0].clientY,w=(v-o.pullDownBarStartY)/o.limit,o.translate(w,!1),o.setState({isPullDownStatus:w>=i?s:l})):r&&!p&&o.direction===u&&m>=o.bottom&&d!==c&&!f&&(event.preventDefault(),o.pullUpBarStartY=o.pullUpBarStartY?o.pullUpBarStartY:t.touches[0].clientY,w=(v-o.pullUpBarStartY)/o.limit,o.translate(w,!1),o.setState({isPullUpStatus:Math.abs(w)>=a?l:s}))},o.handleTouchEnd=function(t){var e=o.state,n=e.isPullDownStatus,r=e.isPullUpStatus,i=e.topMethod,a=e.bottomMethod,s=e.animateTime;o.pullDownBarStartY=null,o.pullUpBarStartY=null;var l={top:function(){o.translate(),setTimeout(function(){o.setState({isPullUpStatus:null})},s)},bottom:function(){o.setState({isPullUpStatus:c},function(){o.translate(-o.pullUpBarHeight),a&&a()})}};n&&n!==c&&{top:function(){o.setState({isPullDownStatus:c},function(){o.translate(o.pullDownBarHeight),i&&i()})},bottom:function(){o.translate(),setTimeout(function(){o.setState({isPullDownStatus:null})},s)}}[n](),r&&l[r]()},o.setDirection=function(t,e){return Math.abs(t)>Math.abs(e)&&t>0?d:Math.abs(t)>Math.abs(e)&&t<0?f:Math.abs(e)>Math.abs(t)&&e>0?h:Math.abs(e)>Math.abs(t)&&e<0?u:void 0},o.fetchData=function(){var t=o.state,e=t.reLoad,n=t.topMethod;e&&o.setState({isPullDownStatus:c,isPullUpStatus:null},function(){o.translate(o.pullDownBarHeight,!0),n&&n()})},o.scroll=function(){var t=o.state,e=t.onLower,n=t.onUpper,r=t.onScroll,i=t.scrollX,a=t.upperThreshold,s=t.lowerThreshold,l=i?"scrollLeft":"scrollTop",c=i?o.children:o.wrap,u=c[l],h=i?parseFloat(window.getComputedStyle(c,null).width):parseFloat(window.getComputedStyle(c,null).height),f=i?c.scrollWidth-h:c.scrollHeight-h;r&&r({scroll:u}),u<=a?n&&n():u>=f-s&&e&&e()},o.fill=function(t){var e=o.state.wrapHeight,n=parseFloat(window.getComputedStyle(o.children).height);console.log("this.children height==>",n),e&&(o.wrap.style.height=e+"px"),o.setState({fillAttr:n<e&&e-n},function(){o.scrollBottom(),t&&o.setTarget()})},o.setTarget=function(){var t=o.state,e=t.itemIndex,n=t.itemKey,r=t.scrollX,i=r?o.children:o.wrap;if("number"==typeof e&&e>=0||n){var a=o.children.children,s=void 0;if(e>=0)s=e;else if(n)for(var l=0;l<o.props.children.length;l++)if(n===o.props.children[l].key){s=l;break}s>=0&&(r?i.scrollLeft=a[s].offsetLeft:i.scrollTop=a[s].offsetTop)}setTimeout(function(){i.addEventListener("scroll",o.scroll)},0)},o.translate=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=o.state,r=n.pullThreshold,i=n.animateTime;Math.abs(t)>r||(o.content.style.transition=e?"all "+i+"ms ease":"none",o.content.style.transform="translate3d(0, "+t+"px,0)")},o.scrollBottom=function(){var t=o.state.fillAttr,e=o.children.scrollHeight,n=parseFloat(window.getComputedStyle(o.wrap).height);o.bottom=t?0:e-n},o.limit=n.limit||4,o.state={reLoad:n.reLoad||!1,loadOverText:n.loadOverText||!1,isLoadOver:n.isLoadOver,requestState:n.requestState,isPullDown:n.isPullDown||!1,isPullUp:n.isPullUp||!1,topDistance:n.topDistance||50,bottomDistance:n.bottomDistance||50,isPullDownStatus:null,isPullUpStatus:null,topMethod:n.topMethod,bottomMethod:n.bottomMethod,wrapHeight:n.wrapHeight,pullThreshold:n.pullThreshold||200,scrollX:n.scrollX||!1,scrollY:n.scrollY||!1,upperThreshold:n.upperThreshold||50,lowerThreshold:n.lowerThreshold||50,onUpper:n.onUpper,onLower:n.onLower,onScroll:n.onScroll,itemIndex:n.itemIndex>=0&&n.itemIndex,itemKey:n.itemKey||!1,animateTime:n.animateTime||300},o}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,t),e.prototype.componentDidMount=function(){this.state.scrollX?this.setTarget():(this.wrap.addEventListener("touchstart",this.handleTouchStart),this.wrap.addEventListener("touchmove",this.handleTouchMove),this.wrap.addEventListener("touchend",this.handleTouchEnd),this.fetchData(),this.fill(!0))},e.prototype.componentWillReceiveProps=function(t){var e=this,n=t.requestState,o=t.isLoadOver,r=t.itemIndex,i=t.itemKey,a=t.reLoad,s=t.wrapHeight,l=this.state,c=l.isPullUpStatus,u=l.isPullDownStatus,h=l.animateTime,f=function(){0===e.wrap.scrollTop&&e.translate(),setTimeout(function(){e.setState({isPullDownStatus:null},function(){return e.fill()})},h)};n&&(c&&function(){e.translate(),setTimeout(function(){e.setState({isPullUpStatus:null},function(){e.fill()})},h)}(),u&&f()),this.setState({isLoadOver:o,reLoad:a},function(){return e.fetchData()}),r>=0?this.state.itemIndex!==r&&this.setState({itemIndex:r},function(){return e.setTarget()}):i&&this.state.itemKey!==i&&this.setState({itemKey:i},function(){return e.setTarget()}),this.setState({wrapHeight:s},function(){return e.wrap.style.height=s+"px"})},e.prototype.componentWillUnmount=function(){this.wrap.removeEventListener("touchstart",this.handleTouchStart),this.wrap.removeEventListener("touchmove",this.handleTouchMove),this.wrap.removeEventListener("touchend",this.handleTouchEnd),(this.state.scrollX?this.children:this.wrap).removeEventListener("scroll",this.scroll),clearInterval(this.timer)},e.prototype.render=function(){var t=this,e=this.state,n=e.isPullDownStatus,o=e.isPullUpStatus,a=e.fillAttr,u=e.scrollX,h=e.isLoadOver,f=e.loadOverText,d=e.reLoad,p=this.props,m=p.style,v=p.children;v=Array.isArray(v)?v:[].concat(v);var y=function(){return r.a.createElement("div",{className:"spinner"},r.a.createElement("div",{className:"bounce1"}),r.a.createElement("div",{className:"bounce2"}),r.a.createElement("div",{className:"bounce3"}))};return r.a.createElement("div",{className:"load-more-root",style:m,ref:function(e){return t.wrap=e}},r.a.createElement("div",{className:"load-more-content",ref:function(e){return t.content=e}},!u&&n&&!o&&r.a.createElement("div",{className:"pull-down-bar",ref:function(e){e&&(t.pullDownBarHeight=Object(i.a)(e,"height"))}},n===c?r.a.createElement(y,null):r.a.createElement("span",{className:"is-transition "+(n===s?"is-rotate":"")},"↓")),r.a.createElement("div",{className:"scroll-view-root "+(u?"scroll-view-x":"scroll-view-y")+" ",ref:function(e){return t.children=e}},v.map(function(t,e){return r.a.createElement("div",{key:"children"+e,className:u?"scroll-x-item":"scroll-y-item"},t)})),!d&&(h||f)&&(f?r.a.createElement("p",{className:"pull-up-tip"},f):r.a.createElement("p",{className:"pull-up-tip"},"全部加载完毕~")),a&&r.a.createElement("div",{style:{height:a+"px"}}),!u&&!h&&o&&!n&&r.a.createElement("div",{className:"pull-up-bar",ref:function(e){return e&&(t.pullUpBarHeight=parseFloat(window.getComputedStyle(e).height))}},o===c?r.a.createElement(y,null):r.a.createElement("span",{className:"is-transition "+(o===l?"is-rotate":"")+" "},"↑"))))},e}(o.Component);e.a=p},function(t,e){},function(t,e,n){"use strict";var o=n(0),r=n.n(o),i=n(13),a=n(14),s=(n.n(a),Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t});var l=function(t){function e(n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var o=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,t.call(this,n));return o.lazyLoad=o.lazyLoad.bind(o,n.src),o.state={isAnimate:!1},o}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,t),e.prototype.componentDidMount=function(){this.isScroll(),window.addEventListener("scroll",this.lazyLoad),window.addEventListener("resize",this.lazyLoad)},e.prototype.componentWillUnmount=function(){window.removeEventListener("scroll",this.lazyLoad),window.removeEventListener("resize",this.lazyLoad)},e.prototype.isScroll=function(){document.body.clientHeight<=i.a.clientHeight()&&this.lazyLoad()},e.prototype.lazyLoad=function(t){i.a.availHeight()+i.a.scrollTop()>this.img.offsetTop-100&&!this.img.src&&(this.img.src=t)},e.prototype.render=function(){var t=this,e=this.state.isAnimate,n=Object.assign({},this.props);return r.a.createElement("div",{className:e?"LazyLoadImg":"",style:{opacity:e?1:0}},r.a.createElement("img",s({},n,{alt:"",ref:function(e){t.img=e},onLoad:function(){t.setState({isAnimate:!0})}})))},e}(o.Component);e.a=l},function(t,e,n){"use strict";var o=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}return t.maxWidth=function(){return Math.min(640,this.clientWidth())},t.documentElement=function(){return document.body.clientWidth+document.body.clientHeight+document.body.scrollWidth+document.body.scrollHeight+document.body.scrollTop>document.documentElement.clientWidth+document.documentElement.clientHeight+document.documentElement.scrollWidth+document.documentElement.scrollHeight+document.documentElement.scrollTop?document.body:document.documentElement},t.rootElement=function(){return document.getElementById("root")},t.availWidth=function(){return window.screen.availWidth},t.availHeight=function(){return window.screen.availHeight},t.scrollHeight=function(){return Math.max(document.body.scrollHeight,document.documentElement.scrollHeight)},t.scrollWidth=function(){return Math.max(document.body.scrollWidth,document.documentElement.scrollWidth)},t.scrollTop=function(){return Math.max(document.body.scrollTop,document.documentElement.scrollTop)},t.scrollToTop=function(){window.scrollTo(0,0)},t.setScrollTop=function(t){document.body.scrollTop=t,document.documentElement.scrollTop=t},t.clientHeight=function(){return Math.max(document.body.clientHeight,document.documentElement.clientHeight)},t.clientWidth=function(){return Math.max(document.body.clientWidth,document.documentElement.clientWidth)},t.resetFontSize=function(){var e=t.maxWidth()/7.5;t.fontSize=e,document.documentElement.style.fontSize=e+"px",document.body.style.maxWidth=t.maxWidth()+"px"},t.setInstance=function(e){t.app=e},t.removeInstance=function(){t.app=void 0},t.alert=function(e,n){t.app.setState({alert:{message:e,onClose:function(){t.app.setState({alert:void 0},function(){n&&n()})}}})},t.confirm=function(e,n,o,r){t.app.setState({confirm:{title:e,message:n,onConfirm:function(){t.app.setState({confirm:void 0},function(){o&&o()})},onCancel:function(){t.app.setState({confirm:void 0},function(){r&&r()})}}})},t.loading=function(e,n){t.app.setState({loading:e},function(){n&&n()})},t.isHorizontal=function(){return t.clientWidth()>t.clientHeight()},t}();e.a=o},function(t,e){},function(t,e,n){"use strict";var o,r,i=n(0),a=n.n(i),s=n(1),l=n(16);n.n(l);var c="left",u="center",h=(o=function(t){function e(n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var o=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,t.call(this,n));r.call(o);var i=n.left?c:u;return o.interval=n.interval||18,o.state={index:n.index||0,left:n.left,fill:!1,child:null,direction:i},o}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,t),e.prototype.componentDidMount=function(){var t=this,e=parseFloat(window.getComputedStyle(this.container,null).width),n=e/2;this.setState({rootWidth:e,centre:n,child:this.container.children},function(){return t.checkEl()})},e.prototype.componentWillUnmount=function(){clearInterval(this.timer)},e.prototype.render=function(){var t=this,e=this.state.fill,n=this.props.children;return n=Array.isArray(n)?n:[].concat(n),a.a.createElement("ul",{className:"AutoScrollTab-root",ref:function(e){return t.container=e}},n.map(function(e,n){return a.a.createElement("li",{key:"children"+n,className:"item",onClick:function(){return t.sel(n,e)}},e)}),e&&a.a.createElement("li",{className:"item",style:{width:e+"px"}}))},e}(i.Component),r=function(){var t=this;this.checkEl=function(){for(var e=t.state,n=e.rootWidth,o=e.child,r=e.index,i=0,a=0,l=o.length;a<l;a++)i+=Object(s.a)(o[a],"width");i>n?t.fill():t.sel(r)},this.fill=function(){var e=t.state,n=e.rootWidth,o=e.direction,r=e.centre,i=e.child,a=e.index,l=Object(s.a)(i[i.length-1],"width"),c=o===u?r-l/2:n-l;t.setState({fill:c},function(){return t.sel(a)})},this.target=function(e){var n=t.state,o=n.direction,r=n.child,i=n.centre,a=r[e],l=a.offsetLeft;return o===u?l+Object(s.a)(a,"width")/2>i?l+Object(s.a)(a,"width")/2-i:0:l},this.sel=function(e,n){var o=t.target(e);console.log("target==>",o,e),o>=0&&t.animate(o,t.container)},this.animate=function(e,n){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"scrollLeft";clearInterval(t.timer),t.timer=setInterval(function(){var r=(e-n[o])/5;r=r>0?Math.ceil(r):Math.floor(r),n[o]+=r,console.log("进行中"),(Math.abs(e-n[o])<=Math.abs(r)||n.scrollWidth-n[o]===n.clientWidth)&&(clearInterval(t.timer),console.log("清除中"),n[o]=e)},t.interval)}},o);e.a=h},function(t,e){},function(t,e,n){"use strict";var o=n(0),r=n.n(o),i=n(1),a=n(18);n.n(a);var s="left",l="right",c=function(t){function e(n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var o=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,t.call(this,n));return o.setContent=function(){for(var t=o.content.children,e=0,n=0,r=t.length;n<r;n++)e+=Object(i.a)(t[n],"width");var a=Object(i.a)(t[0],"width");e-=a,o.container.style.width=a+"px",o.canMoveX=e},o.slideStart=function(t){o.startX=t.changedTouches[0].pageX,o.startY=t.changedTouches[0].pageY},o.slideMove=function(t){event.preventDefault();var e=t.changedTouches[0].pageX,n=t.changedTouches[0].pageY,r=e-o.startX,i=n-o.startY;o.direction=o.setDirection(r,i),o.direction&&o.translate(r)},o.slideEnd=function(t){if(o.direction=null,o.moveX){if(o.moveX>0)return o.reset();Math.abs(o.moveX)>=o.canMoveX/5?o.animate():o.reset(),o.moveX=null}},o.translate=function(t){Math.abs(~~t)>=~~o.canMoveX||(o.moveX=t,t>0&&o.translateX<0&&(t=o.translateX+t),t>0&&(t=0),o.content.style.transition="none",o.content.style.transform="translateX("+t+"px)")},o.animate=function(){var t=o.props.isSel;o.content.style.transition="all 200ms",o.content.style.transform="translateX("+-o.canMoveX+"px)",o.translateX=-o.canMoveX,t&&t()},o.reset=function(){if(o.content){o.content.style.transition="all 200ms",o.content.style.transform="translateX(0px)",o.translateX=0;var t=o.props.unSel;t&&t()}},o.setDirection=function(t,e){return Math.abs(t)>Math.abs(e)&&t>0?l:Math.abs(t)>Math.abs(e)&&t<0?s:!(Math.abs(e)>Math.abs(t)&&e>0)&&(!(Math.abs(e)>Math.abs(t)&&e<0)&&void 0)},o.state={isReset:n.isReset,translateX:n.translateX},o}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,t),e.getDerivedStateFromProps=function(t,e){return t},e.prototype.componentDidMount=function(){this.setContent()},e.prototype.render=function(){var t=this,e=this.props.children;return this.state.isReset&&this.reset(),r.a.createElement("div",{className:"list_view_slide_root",ref:function(e){return t.container=e},onTouchStart:function(e){return t.slideStart(e)},onTouchMove:function(e){return t.slideMove(e)},onTouchEnd:function(e){return t.slideEnd(e)}},r.a.createElement("div",{className:"slide_content",ref:function(e){return t.content=e}},e.map(function(t,e){return r.a.createElement("div",{className:"slide_item",key:e},t)})))},e}(o.Component);e.a=c},function(t,e){}]).default}); | ||
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("react")):"function"==typeof define&&define.amd?define(["react"],e):"object"==typeof exports?exports.Y=e(require("react")):t.Y=e(t.React)}("undefined"!=typeof self?self:this,function(t){return function(t){var e={};function n(o){if(e[o])return e[o].exports;var r=e[o]={i:o,l:!1,exports:{}};return t[o].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=t,n.c=e,n.d=function(t,e,o){n.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:o})},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=2)}([function(e,n){e.exports=t},function(t,e,n){"use strict";function o(t,e){return parseFloat(window.getComputedStyle(t,null)[e])||t.getBoundingClientRect()[e]}n.d(e,"a",function(){return o})},function(t,e,n){t.exports=n(3)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(4);n.d(e,"NavBar",function(){return o.a});var r=n(6);n.d(e,"TabContainer",function(){return r.a});var i=n(8);n.d(e,"TabContainerItem",function(){return i.a});var a=n(10);n.d(e,"ScrollView",function(){return a.a});var s=n(12);n.d(e,"LozyLoad",function(){return s.a});var l=n(15);n.d(e,"AutoScrollTab",function(){return l.a});var c=n(17);n.d(e,"ListViewSlide",function(){return c.a})},function(t,e,n){"use strict";var o,r,i=n(0),a=n.n(i),s=n(1),l=n(5);n.n(l);var c=(o=function(t){function e(n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var o=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,t.call(this,n));r.call(o);var i=n.data,a=n.children,s=i?i.length:a.length;return o.state={ind:n.index||0,isAnimate:n.isAnimate||!1,onSel:n.onSel,data:n.data,length:s},o}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,t),e.prototype.componentDidMount=function(){var t=this,e=this.state.length;this.setState({itemWidth:Object(s.a)(this.wrap,"width")/e},function(){return t.setBarWidth()})},e.prototype.componentWillReceiveProps=function(t){var e=this,n=t.index,o=t.translate,r=this.state.ind;o&&this.translateBar(o),n>=0&&r!==n&&this.setState({ind:n},function(){return e.setBarWidth()})},e.prototype.render=function(){var t=this,e=this.state,n=e.ind,o=e.data,r=e.itemWidth,i=this.props,s=i.children,l=i.style;return a.a.createElement("div",{style:l,className:"NavBar-root",ref:function(e){return t.wrap=e}},a.a.createElement("div",{className:"container",ref:function(e){return t.container=e}},o?o.map(function(e,o){return a.a.createElement("span",{key:"Nav"+o,style:{width:r+"px"},className:"Nav-item "+(o===n&&"active"),onClick:function(){return t.sel(e,o)}},a.a.createElement("span",null,e.name))}):s.map(function(e,o){return a.a.createElement("span",{key:"Nav"+o,style:{width:r+"px"},className:"Nav-item "+(o===n&&"active"),onClick:function(){return t.sel(e,o)}},e)})),a.a.createElement("div",{className:"Nav-active",style:{width:r+"px",transform:"translatex("+n*r+"px)"},ref:function(e){return t.bar=e}},a.a.createElement("div",{className:"Nav-active-bar",ref:function(e){return t.flag=e}})))},e}(i.Component),r=function(){var t=this;this.translateBar=function(e){var n=t.state.length,o=e.distance,r=e.transition;t.bar.style.transition=r?"all 200ms":"none",t.bar.style.transform="translateX("+-o/n+"px)"},this.sel=function(e,n){var o=t.state,r=o.isAnimate,i=o.onSel;t.bar.style.transition=r?"all 200ms":"none",t.setState({ind:n},function(){i&&i(e,n),t.setBarWidth()})},this.setBarWidth=function(){var e=t.state.ind,n=t.container.children,o=(n[e].children.length>=1?n[e].children[0]:n[e]).getBoundingClientRect().width;t.flag.style.width=o+"px"}},o);e.a=c},function(t,e){},function(t,e,n){"use strict";var o=n(0),r=n.n(o),i=n(7);n.n(i);var a="left",s="right",l="top",c="down",u=function(t){function e(n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var o=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,t.call(this,n));return o.slideStart=function(t){o.startX=t.changedTouches[0].pageX,o.startY=t.changedTouches[0].pageY},o.slideMove=function(t){event.preventDefault();var e=t.changedTouches[0].pageX,n=t.changedTouches[0].pageY,r=e-o.startX,i=n-o.startY,u=r-o.itemWidth*o.index;if(!o.slideDirection||o.slideDirection===s||o.slideDirection===a)if(Math.abs(r)>Math.abs(i)&&r>0)0!==o.index&&o.translate(u),o.slideDirection=s;else if(Math.abs(r)>Math.abs(i)&&r<0)o.index!==o.props.children.length-1&&o.translate(u),o.slideDirection=a;else if(Math.abs(i)>Math.abs(r)&&i>0){if(o.slideDirection)return;o.slideDirection=c}else if(Math.abs(i)>Math.abs(r)&&i<0){if(o.slideDirection)return;o.slideDirection=l}},o.slideEnd=function(t){o.endX=t.changedTouches[0].pageX,o.isTranslate()},o.translate=function(t,e){var n="\n "+(e?"transition: all 200ms;":"")+"\n transform:translateX("+t+"px)\n ";o.container.style=n;var r=o.props.onTranslate;r&&r({distance:t,transition:e})},o.isTranslate=function(){if(o.slideDirection===s||o.slideDirection===a){var t=o.props.onSel,e=o.endX-o.startX,n={right:function(){0!==o.index&&o.index--},left:function(){o.index!==o.props.children.length-1&&o.index++}};Math.abs(e)>=o.interval&&(n[o.slideDirection](),console.log("上下页切换",o.index),t&&t(o.index)),o.translate(-o.index*o.itemWidth,!0)}o.slideDirection=null},o.itemWidth=window.screen.width,o.interval=n.interval||parseInt(o.itemWidth/5),o.index=n.index||0,o.oldIndex=n.index||0,o}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,t),e.prototype.componentWillReceiveProps=function(t){var e=t.index,n=this.props.onTranslate;this.index!==e&&(this.index=e,n&&n({distance:-this.index*this.itemWidth}),this.container.style.transition=null,this.container.style.transform="translateX("+-e*this.itemWidth+"px)")},e.prototype.componentDidMount=function(){this.translate(-this.index*this.itemWidth),this.root.addEventListener("touchstart",this.slideStart),this.root.addEventListener("touchmove",this.slideMove),this.root.addEventListener("touchend",this.slideEnd)},e.prototype.componentWillUnmount=function(){this.root.removeEventListener("touchstart",this.slideStart),this.root.removeEventListener("touchmove",this.slideMove),this.root.removeEventListener("touchend",this.slideEnd)},e.prototype.render=function(){var t=this;return r.a.createElement("div",{className:"tab-container-root",ref:function(e){t.root=e}},r.a.createElement("ul",{className:"tab-container",ref:function(e){t.container=e}},this.props.children))},e}(o.Component);e.a=u},function(t,e){},function(t,e,n){"use strict";var o=n(0),r=n.n(o),i=n(9),a=(n.n(i),Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t});var s=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,t.apply(this,arguments))}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,t),e.prototype.render=function(){var t=this,e=Object.assign({},this.props),n=e.style;return n?n.height||(n.height=window.screen.height+"px"):n={height:window.screen.height+"px"},r.a.createElement("li",a({className:"TabContainerItem"},e,{ref:function(e){return t.el=e}}),this.props.children)},e}(o.Component);e.a=s},function(t,e){},function(t,e,n){"use strict";var o=n(0),r=n.n(o),i=n(1),a=n(11);n.n(a);var s="top",l="bottom",c="loading",u="touch_top",h="touch_bottom",f="touch_left",d="touch_right",p=function(t){function e(n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var o=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,t.call(this,n));return o.handleTouchStart=function(t){o.startY=t.touches[0].clientY,o.startX=t.touches[0].clientX},o.handleTouchMove=function(t){var e=o.state,n=e.isPullDown,r=e.isPullUp,i=e.topDistance,a=e.bottomDistance,f=e.isPullDownStatus,d=e.isPullUpStatus,p=e.isLoadOver,m=o.wrap.scrollTop,v=t.touches[0].clientY,y=t.touches[0].clientX-o.startX,b=v-o.startY,w=void 0;o.direction=o.setDirection(y,b),n&&o.direction===h&&0===m&&f!==c&&!d?(event.preventDefault(),o.pullDownBarStartY=o.pullDownBarStartY?o.pullDownBarStartY:t.touches[0].clientY,w=(v-o.pullDownBarStartY)/o.limit,o.translate(w,!1),o.setState({isPullDownStatus:w>=i?s:l})):r&&!p&&o.direction===u&&m>=o.bottom&&d!==c&&!f&&(event.preventDefault(),o.pullUpBarStartY=o.pullUpBarStartY?o.pullUpBarStartY:t.touches[0].clientY,w=(v-o.pullUpBarStartY)/o.limit,o.translate(w,!1),o.setState({isPullUpStatus:Math.abs(w)>=a?l:s}))},o.handleTouchEnd=function(t){var e=o.state,n=e.isPullDownStatus,r=e.isPullUpStatus,i=e.topMethod,a=e.bottomMethod,s=e.animateTime;o.pullDownBarStartY=null,o.pullUpBarStartY=null;var l={top:function(){o.translate(),setTimeout(function(){o.setState({isPullUpStatus:null})},s)},bottom:function(){o.setState({isPullUpStatus:c},function(){o.translate(-o.pullUpBarHeight),a&&a()})}};n&&n!==c&&{top:function(){o.setState({isPullDownStatus:c},function(){o.translate(o.pullDownBarHeight),i&&i()})},bottom:function(){o.translate(),setTimeout(function(){o.setState({isPullDownStatus:null})},s)}}[n](),r&&l[r]()},o.setDirection=function(t,e){return Math.abs(t)>Math.abs(e)&&t>0?d:Math.abs(t)>Math.abs(e)&&t<0?f:Math.abs(e)>Math.abs(t)&&e>0?h:Math.abs(e)>Math.abs(t)&&e<0?u:void 0},o.fetchData=function(){var t=o.state,e=t.reLoad,n=t.topMethod;e&&o.setState({isPullDownStatus:c,isPullUpStatus:null},function(){o.translate(o.pullDownBarHeight,!0),n&&n()})},o.scroll=function(){var t=o.state,e=t.onLower,n=t.onUpper,r=t.onScroll,i=t.scrollX,a=t.upperThreshold,s=t.lowerThreshold,l=i?"scrollLeft":"scrollTop",c=i?o.children:o.wrap,u=c[l],h=i?parseFloat(window.getComputedStyle(c,null).width):parseFloat(window.getComputedStyle(c,null).height),f=i?c.scrollWidth-h:c.scrollHeight-h;r&&r({scroll:u}),u<=a?n&&n():u>=f-s&&e&&e()},o.fill=function(t){var e=o.state.wrapHeight,n=parseFloat(window.getComputedStyle(o.children).height);console.log("this.children height==>",n),e&&(o.wrap.style.height=e+"px"),o.setState({fillAttr:n<e&&e-n},function(){o.scrollBottom(),t&&o.setTarget()})},o.setTarget=function(){var t=o.state,e=t.itemIndex,n=t.itemKey,r=t.scrollX,i=r?o.children:o.wrap;if("number"==typeof e&&e>=0||n){var a=o.children.children,s=void 0;if(e>=0)s=e;else if(n)for(var l=0;l<o.props.children.length;l++)if(n===o.props.children[l].key){s=l;break}s>=0&&(r?i.scrollLeft=a[s].offsetLeft:i.scrollTop=a[s].offsetTop)}setTimeout(function(){i.addEventListener("scroll",o.scroll)},0)},o.translate=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=o.state,r=n.pullThreshold,i=n.animateTime;Math.abs(t)>r||(o.content.style.transition=e?"all "+i+"ms ease":"none",o.content.style.transform="translate3d(0, "+t+"px,0)")},o.scrollBottom=function(){var t=o.state.fillAttr,e=o.children.scrollHeight,n=parseFloat(window.getComputedStyle(o.wrap).height);o.bottom=t?0:e-n},o.limit=n.limit||4,o.state={reLoad:n.reLoad||!1,loadOverText:n.loadOverText||!1,isLoadOver:n.isLoadOver,requestState:n.requestState,isPullDown:n.isPullDown||!1,isPullUp:n.isPullUp||!1,topDistance:n.topDistance||50,bottomDistance:n.bottomDistance||50,isPullDownStatus:null,isPullUpStatus:null,topMethod:n.topMethod,bottomMethod:n.bottomMethod,wrapHeight:n.wrapHeight,pullThreshold:n.pullThreshold||200,scrollX:n.scrollX||!1,scrollY:n.scrollY||!1,upperThreshold:n.upperThreshold||50,lowerThreshold:n.lowerThreshold||50,onUpper:n.onUpper,onLower:n.onLower,onScroll:n.onScroll,itemIndex:n.itemIndex>=0&&n.itemIndex,itemKey:n.itemKey||!1,animateTime:n.animateTime||300},o}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,t),e.prototype.componentDidMount=function(){this.state.scrollX?this.setTarget():(this.wrap.addEventListener("touchstart",this.handleTouchStart),this.wrap.addEventListener("touchmove",this.handleTouchMove),this.wrap.addEventListener("touchend",this.handleTouchEnd),this.fetchData(),this.fill(!0))},e.prototype.componentWillReceiveProps=function(t){var e=this,n=t.requestState,o=t.isLoadOver,r=t.itemIndex,i=t.itemKey,a=t.reLoad,s=t.wrapHeight,l=this.state,c=l.isPullUpStatus,u=l.isPullDownStatus,h=l.animateTime,f=function(){0===e.wrap.scrollTop&&e.translate(),setTimeout(function(){e.setState({isPullDownStatus:null},function(){return e.fill()})},h)};n&&(c&&function(){e.translate(),setTimeout(function(){e.setState({isPullUpStatus:null},function(){e.fill()})},h)}(),u&&f()),this.setState({isLoadOver:o,reLoad:a},function(){return e.fetchData()}),r>=0?this.state.itemIndex!==r&&this.setState({itemIndex:r},function(){return e.setTarget()}):i&&this.state.itemKey!==i&&this.setState({itemKey:i},function(){return e.setTarget()}),this.setState({wrapHeight:s},function(){return e.wrap.style.height=s+"px"})},e.prototype.componentWillUnmount=function(){this.wrap.removeEventListener("touchstart",this.handleTouchStart),this.wrap.removeEventListener("touchmove",this.handleTouchMove),this.wrap.removeEventListener("touchend",this.handleTouchEnd),(this.state.scrollX?this.children:this.wrap).removeEventListener("scroll",this.scroll),clearInterval(this.timer)},e.prototype.render=function(){var t=this,e=this.state,n=e.isPullDownStatus,o=e.isPullUpStatus,a=e.fillAttr,u=e.scrollX,h=e.isLoadOver,f=e.loadOverText,d=e.reLoad,p=this.props,m=p.style,v=p.children;v=Array.isArray(v)?v:[].concat(v);var y=function(){return r.a.createElement("div",{className:"spinner"},r.a.createElement("div",{className:"bounce1"}),r.a.createElement("div",{className:"bounce2"}),r.a.createElement("div",{className:"bounce3"}))};return r.a.createElement("div",{className:"load-more-root",style:m,ref:function(e){return t.wrap=e}},r.a.createElement("div",{className:"load-more-content",ref:function(e){return t.content=e}},!u&&n&&!o&&r.a.createElement("div",{className:"pull-down-bar",ref:function(e){e&&(t.pullDownBarHeight=Object(i.a)(e,"height"))}},n===c?r.a.createElement(y,null):r.a.createElement("span",{className:"is-transition "+(n===s?"is-rotate":"")},"↓")),r.a.createElement("div",{className:"scroll-view-root "+(u?"scroll-view-x":"scroll-view-y")+" ",ref:function(e){return t.children=e}},v.map(function(t,e){return r.a.createElement("div",{key:"children"+e,className:u?"scroll-x-item":"scroll-y-item"},t)})),!d&&(h||f)&&(f?r.a.createElement("p",{className:"pull-up-tip"},f):r.a.createElement("p",{className:"pull-up-tip"},"全部加载完毕~")),a&&r.a.createElement("div",{style:{height:a+"px"}}),!u&&!h&&o&&!n&&r.a.createElement("div",{className:"pull-up-bar",ref:function(e){return e&&(t.pullUpBarHeight=parseFloat(window.getComputedStyle(e).height))}},o===c?r.a.createElement(y,null):r.a.createElement("span",{className:"is-transition "+(o===l?"is-rotate":"")+" "},"↑"))))},e}(o.Component);e.a=p},function(t,e){},function(t,e,n){"use strict";var o=n(0),r=n.n(o),i=n(13),a=n(14),s=(n.n(a),Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t});var l=function(t){function e(n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var o=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,t.call(this,n));return o.lazyLoad=o.lazyLoad.bind(o,n.src),o.state={isAnimate:!1},o}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,t),e.prototype.componentDidMount=function(){this.isScroll(),window.addEventListener("scroll",this.lazyLoad),window.addEventListener("resize",this.lazyLoad)},e.prototype.componentWillUnmount=function(){window.removeEventListener("scroll",this.lazyLoad),window.removeEventListener("resize",this.lazyLoad)},e.prototype.isScroll=function(){document.body.clientHeight<=i.a.clientHeight()&&this.lazyLoad()},e.prototype.lazyLoad=function(t){i.a.availHeight()+i.a.scrollTop()>this.img.offsetTop-100&&!this.img.src&&(this.img.src=t)},e.prototype.render=function(){var t=this,e=this.state.isAnimate,n=Object.assign({},this.props);return r.a.createElement("div",{className:e?"LazyLoadImg":"",style:{opacity:e?1:0}},r.a.createElement("img",s({},n,{alt:"",ref:function(e){t.img=e},onLoad:function(){t.setState({isAnimate:!0})}})))},e}(o.Component);e.a=l},function(t,e,n){"use strict";var o=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}return t.maxWidth=function(){return Math.min(640,this.clientWidth())},t.documentElement=function(){return document.body.clientWidth+document.body.clientHeight+document.body.scrollWidth+document.body.scrollHeight+document.body.scrollTop>document.documentElement.clientWidth+document.documentElement.clientHeight+document.documentElement.scrollWidth+document.documentElement.scrollHeight+document.documentElement.scrollTop?document.body:document.documentElement},t.rootElement=function(){return document.getElementById("root")},t.availWidth=function(){return window.screen.availWidth},t.availHeight=function(){return window.screen.availHeight},t.scrollHeight=function(){return Math.max(document.body.scrollHeight,document.documentElement.scrollHeight)},t.scrollWidth=function(){return Math.max(document.body.scrollWidth,document.documentElement.scrollWidth)},t.scrollTop=function(){return Math.max(document.body.scrollTop,document.documentElement.scrollTop)},t.scrollToTop=function(){window.scrollTo(0,0)},t.setScrollTop=function(t){document.body.scrollTop=t,document.documentElement.scrollTop=t},t.clientHeight=function(){return Math.max(document.body.clientHeight,document.documentElement.clientHeight)},t.clientWidth=function(){return Math.max(document.body.clientWidth,document.documentElement.clientWidth)},t.resetFontSize=function(){var e=t.maxWidth()/7.5;t.fontSize=e,document.documentElement.style.fontSize=e+"px",document.body.style.maxWidth=t.maxWidth()+"px"},t.setInstance=function(e){t.app=e},t.removeInstance=function(){t.app=void 0},t.alert=function(e,n){t.app.setState({alert:{message:e,onClose:function(){t.app.setState({alert:void 0},function(){n&&n()})}}})},t.confirm=function(e,n,o,r){t.app.setState({confirm:{title:e,message:n,onConfirm:function(){t.app.setState({confirm:void 0},function(){o&&o()})},onCancel:function(){t.app.setState({confirm:void 0},function(){r&&r()})}}})},t.loading=function(e,n){t.app.setState({loading:e},function(){n&&n()})},t.isHorizontal=function(){return t.clientWidth()>t.clientHeight()},t}();e.a=o},function(t,e){},function(t,e,n){"use strict";var o,r,i=n(0),a=n.n(i),s=n(1),l=n(16);n.n(l);var c="left",u="center",h=(o=function(t){function e(n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var o=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,t.call(this,n));r.call(o);var i=n.left?c:u;return o.interval=n.interval||18,o.state={index:n.index||0,left:n.left,fill:!1,child:null,direction:i},o}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,t),e.prototype.componentDidMount=function(){var t=this,e=parseFloat(window.getComputedStyle(this.container,null).width),n=e/2;this.setState({rootWidth:e,centre:n,child:this.container.children},function(){return t.checkEl()})},e.prototype.componentWillUnmount=function(){clearInterval(this.timer)},e.prototype.render=function(){var t=this,e=this.state.fill,n=this.props.children;return n=Array.isArray(n)?n:[].concat(n),a.a.createElement("ul",{className:"AutoScrollTab-root",ref:function(e){return t.container=e}},n.map(function(e,n){return a.a.createElement("li",{key:"children"+n,className:"item",onClick:function(){return t.sel(n,e)}},e)}),e&&a.a.createElement("li",{className:"item",style:{width:e+"px"}}))},e}(i.Component),r=function(){var t=this;this.checkEl=function(){for(var e=t.state,n=e.rootWidth,o=e.child,r=e.index,i=0,a=0,l=o.length;a<l;a++)i+=Object(s.a)(o[a],"width");i>n?t.fill():t.sel(r)},this.fill=function(){var e=t.state,n=e.rootWidth,o=e.direction,r=e.centre,i=e.child,a=e.index,l=Object(s.a)(i[i.length-1],"width"),c=o===u?r-l/2:n-l;t.setState({fill:c},function(){return t.sel(a)})},this.target=function(e){var n=t.state,o=n.direction,r=n.child,i=n.centre,a=r[e],l=a.offsetLeft;return o===u?l+Object(s.a)(a,"width")/2>i?l+Object(s.a)(a,"width")/2-i:0:l},this.sel=function(e,n){var o=t.target(e);console.log("target==>",o,e),o>=0&&t.animate(o,t.container)},this.animate=function(e,n){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"scrollLeft";clearInterval(t.timer),t.timer=setInterval(function(){var r=(e-n[o])/5;r=r>0?Math.ceil(r):Math.floor(r),n[o]+=r,console.log("进行中"),(Math.abs(e-n[o])<=Math.abs(r)||n.scrollWidth-n[o]===n.clientWidth)&&(clearInterval(t.timer),console.log("清除中"),n[o]=e)},t.interval)}},o);e.a=h},function(t,e){},function(t,e,n){"use strict";var o=n(0),r=n.n(o),i=n(1),a=n(18);n.n(a);var s="left",l="right",c=function(t){function e(n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var o=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,t.call(this,n));return o.setContent=function(){for(var t=o.content.children,e=0,n=0,r=t.length;n<r;n++)e+=Object(i.a)(t[n],"width");var a=Object(i.a)(t[0],"width");e-=a,o.container.style.width=a+"px",o.canMoveX=e},o.slideStart=function(t){o.startX=t.changedTouches[0].pageX,o.startY=t.changedTouches[0].pageY},o.slideMove=function(t){var e=t.changedTouches[0].pageX,n=t.changedTouches[0].pageY,r=e-o.startX,i=n-o.startY;o.direction=o.setDirection(r,i),o.direction&&o.translate(r)},o.slideEnd=function(t){if(o.direction=null,o.moveX){if(o.moveX>0)return o.reset();Math.abs(o.moveX)>=o.canMoveX/5?o.animate():o.reset(),o.moveX=null}},o.translate=function(t){Math.abs(~~t)>=~~o.canMoveX||(o.moveX=t,t>0&&o.translateX<0&&(t=o.translateX+t),t>0&&(t=0),o.content.style.transition="none",o.content.style.transform="translateX("+t+"px)")},o.animate=function(){var t=o.props.isSel;o.content.style.transition="all 200ms",o.content.style.transform="translateX("+-o.canMoveX+"px)",o.translateX=-o.canMoveX,t&&t()},o.reset=function(){if(o.content){o.content.style.transition="all 200ms",o.content.style.transform="translateX(0px)",o.translateX=0;var t=o.props.unSel;t&&t()}},o.setDirection=function(t,e){return Math.abs(t)>Math.abs(e)&&t>0?l:Math.abs(t)>Math.abs(e)&&t<0?s:!(Math.abs(e)>Math.abs(t)&&e>0)&&(!(Math.abs(e)>Math.abs(t)&&e<0)&&void 0)},o.state={isReset:n.isReset,translateX:n.translateX},o}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,t),e.getDerivedStateFromProps=function(t,e){return t},e.prototype.componentDidMount=function(){this.setContent()},e.prototype.render=function(){var t=this,e=this.props.children;return this.state.isReset&&this.reset(),r.a.createElement("div",{className:"list_view_slide_root",ref:function(e){return t.container=e},onTouchStart:function(e){return t.slideStart(e)},onTouchMove:function(e){return t.slideMove(e)},onTouchEnd:function(e){return t.slideEnd(e)}},r.a.createElement("div",{className:"slide_content",ref:function(e){return t.content=e}},e.map(function(t,e){return r.a.createElement("div",{className:"slide_item",key:e},t)})))},e}(o.Component);e.a=c},function(t,e){}]).default}); | ||
//# sourceMappingURL=bestnihon-react-components.min.js.map |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
No README
QualityPackage does not have a README. This may indicate a failed publish or a low quality package.
Found 1 instance in 1 package
301032
1
262
28
4493