From 2fc5170cfeb0e3f556591e33f7bf29458b2e2b4d Mon Sep 17 00:00:00 2001 From: Jongmoon Yoon Date: Wed, 22 Nov 2017 15:00:49 +0900 Subject: [PATCH] chore(release): Release 2.3.2 --- dist/axes.js | 2 +- dist/axes.min.js | 2 +- dist/axes.pkgd.js | 2 +- dist/axes.pkgd.min.js | 2 +- package.json | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/dist/axes.js b/dist/axes.js index 712efe76..bcb65fbc 100644 --- a/dist/axes.js +++ b/dist/axes.js @@ -5,7 +5,7 @@ * @egjs/axes JavaScript library * https://github.com/naver/egjs-axes * - * @version 2.3.2-rc + * @version 2.3.2 */ (function webpackUniversalModuleDefinition(root, factory) { if(typeof exports === 'object' && typeof module === 'object') diff --git a/dist/axes.min.js b/dist/axes.min.js index 5dab8c51..4310e9e2 100644 --- a/dist/axes.min.js +++ b/dist/axes.min.js @@ -5,7 +5,7 @@ * @egjs/axes JavaScript library * https://github.com/naver/egjs-axes * - * @version 2.3.2-rc + * @version 2.3.2 */ !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("hammerjs"),require("@egjs/component")):"function"==typeof define&&define.amd?define(["hammerjs","@egjs/component"],e):"object"==typeof exports?exports.Axes=e(require("hammerjs"),require("@egjs/component")):(t.eg=t.eg||{},t.eg.Axes=e(t.Hammer,t.eg.Component))}(this,function(t,e){return function(t){function __webpack_require__(n){if(e[n])return e[n].exports;var i=e[n]={i:n,l:!1,exports:{}};return t[n].call(i.exports,i,i.exports,__webpack_require__),i.l=!0,i.exports}var e={};return __webpack_require__.m=t,__webpack_require__.c=e,__webpack_require__.d=function(t,e,n){__webpack_require__.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:n})},__webpack_require__.n=function(t){var e=t&&t.__esModule?function(){return t["default"]}:function(){return t};return __webpack_require__.d(e,"a",e),e},__webpack_require__.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},__webpack_require__.p="",__webpack_require__(__webpack_require__.s=6)}([function(t,e,n){"use strict";function toArray(t){for(var e=[],n=0,i=t.length;n]*)>/)){var i=document.createElement("div");i.innerHTML=t,n=toArray(i.childNodes)}else n=toArray(document.querySelectorAll(t));e||(n=n.length>=1?n[0]:undefined)}else t===window?n=t:!t.nodeName||1!==t.nodeType&&9!==t.nodeType?"jQuery"in window&&t instanceof jQuery||t.constructor.prototype.jquery?n=e?t.toArray():t.get(0):Array.isArray(t)&&(n=t.map(function(t){return $(t)}),e||(n=n.length>=1?n[0]:undefined)):n=t;return n}function requestAnimationFrame(t){return i(t)}function cancelAnimationFrame(t){r(t)}e.__esModule=!0,e.toArray=toArray,e.$=$;var i=window.requestAnimationFrame||window.webkitRequestAnimationFrame,r=window.cancelAnimationFrame||window.webkitCancelAnimationFrame;if(i&&!r){var s={},o=i;i=function(t){function wrapCallback(n){s[e]&&t(n)}var e=o(wrapCallback);return s[e]=!0,e},r=function(t){delete s[t]}}else i&&r||(i=function(t){return window.setTimeout(function(){t(window.performance&&window.performance.now&&window.performance.now()||(new Date).getTime())},16)},r=window.clearTimeout);e.requestAnimationFrame=requestAnimationFrame,e.cancelAnimationFrame=cancelAnimationFrame},function(t,e,n){"use strict";function toAxis(t,e){return e.reduce(function(e,n,i){return t[i]&&(e[t[i]]=n),e},{})}function createHammer(t,e,n){try{var r={recognizers:[e],cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",userDrag:"none"}};return n&&(r.inputClass=n),new i.Manager(t,r)}catch(s){return null}}function convertInputType(t){void 0===t&&(t=[]);var n=!1,r=!1;return t.forEach(function(t){switch(t){case"mouse":r=!0;break;case"touch":n=e.SUPPORT_TOUCH}}),n&&i.TouchInput||r&&i.MouseInput||null}e.__esModule=!0;var i=n(4);e.SUPPORT_TOUCH="ontouchstart"in window,e.UNIQUEKEY="_EGJS_AXES_INPUTTYPE_",e.toAxis=toAxis,e.createHammer=createHammer,e.convertInputType=convertInputType},function(t,e,n){"use strict";e.__esModule=!0;var i={getInsidePosition:function(t,e,n,i){var r=t,s=[n[0]?e[0]:i?e[0]-i[0]:e[0],n[1]?e[1]:i?e[1]+i[1]:e[1]];return r=Math.max(s[0],r),r=Math.min(s[1],r),+r.toFixed(5)},isOutside:function(t,e){return te[1]},getDuration:function(t,e){var n=Math.sqrt(t/e*2);return n<100?0:n},isCircularable:function(t,e,n){return n[1]&&t>e[1]||n[0]&&ts&&(i=(i-s)%o+r),n[0]&&t=0&&(this._inputs[e].disconnect(),this._inputs.splice(e,1))}else this._inputs.forEach(function(t){return t.disconnect()}),this._inputs=[];return this},Axes.prototype.get=function(t){return this.axm.get(t)},Axes.prototype.setTo=function(t,e){return void 0===e&&(e=0),this.am.setTo(t,e),this},Axes.prototype.setBy=function(t,e){return void 0===e&&(e=0),this.am.setBy(t,e),this},Axes.prototype.isBounceArea=function(t){return this.axm.isOutside(t)},Axes.prototype.destroy=function(){this.disconnect(),this.em.destroy()},Axes.VERSION="#__VERSION__#",Axes.PanInput=p.PanInput,Axes.PinchInput=m.PinchInput,Axes.WheelInput=l.WheelInput,Axes.MoveKeyInput=f.MoveKeyInput,Axes.TRANSFORM=d.TRANSFORM,Axes.DIRECTION_NONE=d.DIRECTION.DIRECTION_NONE,Axes.DIRECTION_LEFT=d.DIRECTION.DIRECTION_LEFT,Axes.DIRECTION_RIGHT=d.DIRECTION.DIRECTION_RIGHT,Axes.DIRECTION_UP=d.DIRECTION.DIRECTION_UP,Axes.DIRECTION_DOWN=d.DIRECTION.DIRECTION_DOWN,Axes.DIRECTION_HORIZONTAL=d.DIRECTION.DIRECTION_HORIZONTAL,Axes.DIRECTION_VERTICAL=d.DIRECTION.DIRECTION_VERTICAL,Axes.DIRECTION_ALL=d.DIRECTION.DIRECTION_ALL,Axes}(s);e["default"]=g},function(t,n){t.exports=e},function(t,e,n){"use strict";var i=this&&this.__assign||Object.assign||function(t){for(var e,n=1,i=arguments.length;n0&&this.setTo(this.axm.map(e,function(t,e,n){return r["default"].getCirculatedPos(t,n.range,n.circular)})),this.itm.setInterrupt(!1),this.em.triggerAnimationEnd(!!t),this.axm.isOutside()?this.restore(t):this.em.triggerFinish(!!t)},AnimationManager.prototype.animateLoop=function(t,e){if(this._animateParam=i({},t),this._animateParam.startTime=(new Date).getTime(),t.duration){var n=this._animateParam,r=this;!function loop(){if(r._raf=null,r.frame(n)>=1)return s.AxisManager.equal(t.destPos,r.axm.get(Object.keys(t.destPos)))||r.em.triggerChange(t.destPos),void e();r._raf=o.requestAnimationFrame(loop)}()}else this.em.triggerChange(t.destPos),e()},AnimationManager.prototype.getUserControll=function(t){var e=t.setTo();return e.destPos=this.axm.get(e.destPos),e.duration=AnimationManager.getDuration(e.duration,this.options.minimumDuration,this.options.maximumDuration),e},AnimationManager.prototype.animateTo=function(t,e,n){var o=this,a=this.createAnimationParam(t,e,n),u=i({},a.depaPos),h=this.em.triggerAnimationStart(a),c=this.getUserControll(a);if(!h&&this.axm.every(c.destPos,function(t,e,n){return r["default"].isCircularable(t,n.range,n.circular)})&&console.warn("You can't stop the 'animation' event when 'circular' is true."),h&&!s.AxisManager.equal(c.destPos,u)){var p=n&&n.event||null;this.animateLoop({depaPos:u,destPos:c.destPos,duration:c.duration,delta:this.axm.getDelta(u,c.destPos),isTrusted:!!p,inputEvent:p,input:n&&n.input||null},function(){return o.animationEnd()})}},AnimationManager.prototype.frame=function(t){var e=(new Date).getTime()-t.startTime,n=this.easing(e/t.duration),i=t.depaPos;return i=this.axm.map(i,function(e,i,s){return e+=t.delta[i]*n,r["default"].getCirculatedPos(e,s.range,s.circular)}),this.em.triggerChange(i),n},AnimationManager.prototype.easing=function(t){return t>1?1:this.options.easing(t)},AnimationManager.prototype.setTo=function(t,e){void 0===e&&(e=0);var n=Object.keys(t);this.grab(n);var i=this.axm.get(n);if(s.AxisManager.equal(t,i))return this;this.itm.setInterrupt(!0);var o=this.axm.filter(t,function(t,e){return i[e]!==t});return Object.keys(o).length?(o=this.axm.map(o,function(t,n,i){return i.circular&&(i.circular[0]||i.circular[1])?e>0?t:r["default"].getCirculatedPos(t,i.range,i.circular):r["default"].getInsidePosition(t,i.range,i.circular)}),s.AxisManager.equal(o,i)?this:(e>0?this.animateTo(o,e):(this.em.triggerChange(o),this.itm.setInterrupt(!1)),this)):this},AnimationManager.prototype.setBy=function(t,e){return void 0===e&&(e=0),this.setTo(this.axm.map(this.axm.get(Object.keys(t)),function(e,n){return e+t[n]}),e)},AnimationManager}();e.AnimationManager=a},function(t,e,n){"use strict";var i=this&&this.__assign||Object.assign||function(t){for(var e,n=1,i=arguments.length;nr?r:to?o+e.am.easing((t-o)/(a[1]*n))*a[1]:t})},InputObserver.prototype.get=function(t){return this.axm.get(t.axes)},InputObserver.prototype.hold=function(t,e){if(!this.itm.isInterrupted()&&t.axes.length){var n={input:t,event:e};this.itm.setInterrupt(!0),this.am.grab(t.axes,n),!this.moveDistance&&this.em.triggerHold(this.axm.get(),n),this.isOutside=this.axm.isOutside(t.axes),this.moveDistance=this.axm.get(t.axes)}},InputObserver.prototype.change=function(t,e,n){if(this.itm.isInterrupting()&&!this.axm.every(n,function(t){return 0===t})){var i,r=this.axm.get(t.axes);i=this.axm.map(this.moveDistance||r,function(t,e){return t+(n[e]||0)}),this.moveDistance&&(this.moveDistance=i),i=this.axm.map(i,function(t,e,n){return s["default"].getCirculatedPos(t,n.range,n.circular)}),this.isOutside&&this.axm.every(r,function(t,e,n){return!s["default"].isOutside(t,n.range)})&&(this.isOutside=!1),i=this.atOutside(i),this.em.triggerChange(i,{input:t,event:e},!0)}},InputObserver.prototype.release=function(t,e,n,o){if(this.itm.isInterrupting()&&this.moveDistance){var a=this.axm.get(t.axes),u=this.axm.get(),h=this.axm.get(this.axm.map(n,function(t,e,n){return n.circular&&(n.circular[0]||n.circular[1])?a[e]+t:s["default"].getInsidePosition(a[e]+t,n.range,n.circular,n.bounce)})),c=this.am.getDuration(h,a,o);0===c&&(h=i({},u));var p={depaPos:u,destPos:h,duration:c,delta:this.axm.getDelta(u,h),inputEvent:e,input:t,isTrusted:!0};this.em.triggerRelease(p),this.moveDistance=null;var m=this.am.getUserControll(p),l=r.AxisManager.equal(m.destPos,u),f={input:t,event:e};l||0===m.duration?(!l&&this.em.triggerChange(m.destPos,f,!0),this.itm.setInterrupt(!1),this.axm.isOutside()?this.am.restore(f):this.em.triggerFinish(!0)):this.am.animateTo(m.destPos,m.duration,f)}},InputObserver}();e.InputObserver=o},function(t,e,n){"use strict";var i=this&&this.__assign||Object.assign||function(t){for(var e,n=1,i=arguments.length;n90)return s.DIRECTION.DIRECTION_NONE;var n=Math.abs(t);return n>e&&n<180-e?s.DIRECTION.DIRECTION_VERTICAL:s.DIRECTION.DIRECTION_HORIZONTAL},PanInput.getNextOffset=function(t,e){var n=Math.sqrt(t[0]*t[0]+t[1]*t[1]),i=Math.abs(n/-e);return[t[0]/2*i,t[1]/2*i]},PanInput.useDirection=function(t,e,n){return n?!!(e===s.DIRECTION.DIRECTION_ALL||e&t&&n&t):!!(e&t)},PanInput.prototype.mapAxes=function(t){var e=!!t[0],n=!!t[1];this._direction=e&&n?s.DIRECTION.DIRECTION_ALL:e?s.DIRECTION.DIRECTION_HORIZONTAL:n?s.DIRECTION.DIRECTION_VERTICAL:s.DIRECTION.DIRECTION_NONE,this.axes=t},PanInput.prototype.connect=function(t){var e={direction:this._direction,threshold:this.options.threshold};if(this.hammer)this.dettachEvent(),this.hammer.add(new r.Pan(e));else{var n=this.element[a.UNIQUEKEY];n?this.hammer.destroy():n=String(Math.round(Math.random()*(new Date).getTime()));var i=a.convertInputType(this.options.inputType);if(!i)throw new Error("Wrong inputType parameter!");this.hammer=a.createHammer(this.element,[r.Pan,e],i),this.element[a.UNIQUEKEY]=n}return this.attachEvent(t),this},PanInput.prototype.disconnect=function(){return this.hammer&&this.dettachEvent(),this._direction=s.DIRECTION.DIRECTION_NONE,this},PanInput.prototype.destroy=function(){this.disconnect(),this.hammer&&this.hammer.destroy(),delete this.element[a.UNIQUEKEY],this.element=null,this.hammer=null},PanInput.prototype.enable=function(){return this.hammer&&(this.hammer.get("pan").options.enable=!0),this},PanInput.prototype.disable=function(){return this.hammer&&(this.hammer.get("pan").options.enable=!1),this},PanInput.prototype.isEnable=function(){return!(!this.hammer||!this.hammer.get("pan").options.enable)},PanInput.prototype.onHammerInput=function(t){this.isEnable()&&(t.isFirst?this.observer.hold(this,t):t.isFinal&&this.onPanend(t))},PanInput.prototype.onPanmove=function(t){var e=PanInput.getDirectionByAngle(t.angle,this.options.thresholdAngle),n=this.hammer.session.prevInput;n?(t.offsetX=t.deltaX-n.deltaX,t.offsetY=t.deltaY-n.deltaY):(t.offsetX=0,t.offsetY=0);var i=this.getOffset([t.offsetX,t.offsetY],[PanInput.useDirection(s.DIRECTION.DIRECTION_HORIZONTAL,this._direction,e),PanInput.useDirection(s.DIRECTION.DIRECTION_VERTICAL,this._direction,e)]),r=i.some(function(t){return 0!==t});r&&(t.srcEvent.preventDefault(),t.srcEvent.stopPropagation()),t.preventSystemEvent=r,r&&this.observer.change(this,t,a.toAxis(this.axes,i))},PanInput.prototype.onPanend=function(t){var e=this.getOffset([Math.abs(t.velocityX)*(t.deltaX<0?-1:1),Math.abs(t.velocityY)*(t.deltaY<0?-1:1)],[PanInput.useDirection(s.DIRECTION.DIRECTION_HORIZONTAL,this._direction),PanInput.useDirection(s.DIRECTION.DIRECTION_VERTICAL,this._direction)]);e=PanInput.getNextOffset(e,this.observer.options.deceleration),this.observer.release(this,t,a.toAxis(this.axes,e))},PanInput.prototype.attachEvent=function(t){this.observer=t,this.hammer.on("hammer.input",this.onHammerInput).on("panstart panmove",this.onPanmove)},PanInput.prototype.dettachEvent=function(){this.hammer.off("hammer.input",this.onHammerInput).off("panstart panmove",this.onPanmove),this.observer=null},PanInput.prototype.getOffset=function(t,e){var n=[0,0],i=this.options.scale;return e[0]&&(n[0]=t[0]*i[0]),e[1]&&(n[1]=t[1]*i[1]),n},PanInput}();e.PanInput=u},function(t,e,n){"use strict";var i=this&&this.__assign||Object.assign||function(t){for(var e,n=1,i=arguments.length;n0?-1:1)*this.options.scale;this.observer.change(this,t,s.toAxis(this.axes,[n])),clearTimeout(this._timer),this._timer=setTimeout(function(){e._isHolded&&(e.observer.release(e,t,s.toAxis(e.axes,[0])),e._isHolded=!1)},50)}},WheelInput.prototype.attachEvent=function(t){this.observer=t,this.element.addEventListener("wheel",this.onWheel),this._isEnabled=!0},WheelInput.prototype.dettachEvent=function(){this.element.removeEventListener("wheel",this.onWheel),this._isEnabled=!1,this.observer=null},WheelInput.prototype.enable=function(){return this._isEnabled=!0,this},WheelInput.prototype.disable=function(){return this._isEnabled=!1,this},WheelInput.prototype.isEnable=function(){return this._isEnabled},WheelInput}();e.WheelInput=o},function(t,e,n){"use strict";var i=this&&this.__assign||Object.assign||function(t){for(var e,n=1,i=arguments.length;n