@egjs/flicking 4.10.8-beta.1 → 4.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/declaration/Flicking.d.ts +5 -1
- package/declaration/index.cjs.d.ts +3 -0
- package/dist/flicking.cjs.js +8149 -0
- package/dist/flicking.cjs.js.map +1 -0
- package/dist/flicking.esm.js +51 -26
- package/dist/flicking.esm.js.map +1 -1
- package/dist/flicking.js +51 -26
- package/dist/flicking.js.map +1 -1
- package/dist/flicking.min.js +2 -2
- package/dist/flicking.min.js.map +1 -1
- package/dist/flicking.pkgd.js +909 -1392
- package/dist/flicking.pkgd.js.map +1 -1
- package/dist/flicking.pkgd.min.js +2 -2
- package/dist/flicking.pkgd.min.js.map +1 -1
- package/package.json +3 -3
- package/rollup.config.js +6 -0
- package/src/Flicking.ts +21 -0
- package/src/control/AxesController.ts +1 -0
- package/src/index.cjs.ts +14 -0
package/dist/flicking.pkgd.js
CHANGED
|
@@ -4,7 +4,7 @@ name: @egjs/flicking
|
|
|
4
4
|
license: MIT
|
|
5
5
|
author: NAVER Corp.
|
|
6
6
|
repository: https://github.com/naver/egjs-flicking
|
|
7
|
-
version: 4.
|
|
7
|
+
version: 4.11.0
|
|
8
8
|
*/
|
|
9
9
|
(function (global, factory) {
|
|
10
10
|
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
|
|
@@ -2641,7 +2641,7 @@ version: 4.10.8-beta.1
|
|
|
2641
2641
|
license: MIT
|
|
2642
2642
|
author: NAVER Corp.
|
|
2643
2643
|
repository: https://github.com/naver/egjs-axes
|
|
2644
|
-
version: 3.
|
|
2644
|
+
version: 3.9.0
|
|
2645
2645
|
*/
|
|
2646
2646
|
|
|
2647
2647
|
/*! *****************************************************************************
|
|
@@ -2658,8 +2658,8 @@ version: 4.10.8-beta.1
|
|
|
2658
2658
|
See the Apache Version 2.0 License for specific language governing permissions
|
|
2659
2659
|
and limitations under the License.
|
|
2660
2660
|
***************************************************************************** */
|
|
2661
|
-
|
|
2662
2661
|
/* global Reflect, Promise */
|
|
2662
|
+
|
|
2663
2663
|
var extendStatics$1 = function (d, b) {
|
|
2664
2664
|
extendStatics$1 = Object.setPrototypeOf || {
|
|
2665
2665
|
__proto__: []
|
|
@@ -2668,48 +2668,39 @@ version: 4.10.8-beta.1
|
|
|
2668
2668
|
} || function (d, b) {
|
|
2669
2669
|
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
|
|
2670
2670
|
};
|
|
2671
|
-
|
|
2672
2671
|
return extendStatics$1(d, b);
|
|
2673
2672
|
};
|
|
2674
|
-
|
|
2675
2673
|
function __extends$1(d, b) {
|
|
2676
2674
|
extendStatics$1(d, b);
|
|
2677
|
-
|
|
2678
2675
|
function __() {
|
|
2679
2676
|
this.constructor = d;
|
|
2680
2677
|
}
|
|
2681
|
-
|
|
2682
2678
|
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
2683
2679
|
}
|
|
2684
2680
|
var __assign$1 = function () {
|
|
2685
2681
|
__assign$1 = Object.assign || function __assign(t) {
|
|
2686
2682
|
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
2687
2683
|
s = arguments[i];
|
|
2688
|
-
|
|
2689
2684
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
2690
2685
|
}
|
|
2691
|
-
|
|
2692
2686
|
return t;
|
|
2693
2687
|
};
|
|
2694
|
-
|
|
2695
2688
|
return __assign$1.apply(this, arguments);
|
|
2696
2689
|
};
|
|
2697
2690
|
function __decorate(decorators, target, key, desc) {
|
|
2698
2691
|
var c = arguments.length,
|
|
2699
|
-
|
|
2700
|
-
|
|
2692
|
+
r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc,
|
|
2693
|
+
d;
|
|
2701
2694
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
2702
2695
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
2703
2696
|
}
|
|
2704
2697
|
|
|
2705
|
-
/*
|
|
2706
|
-
* Copyright (c) 2015 NAVER Corp.
|
|
2707
|
-
* egjs projects are licensed under the MIT license
|
|
2698
|
+
/*
|
|
2699
|
+
* Copyright (c) 2015 NAVER Corp.
|
|
2700
|
+
* egjs projects are licensed under the MIT license
|
|
2708
2701
|
*/
|
|
2709
|
-
|
|
2710
2702
|
/* eslint-disable no-new-func, no-nested-ternary */
|
|
2711
2703
|
var win;
|
|
2712
|
-
|
|
2713
2704
|
if (typeof window === "undefined") {
|
|
2714
2705
|
// window is undefined in node.js
|
|
2715
2706
|
win = {
|
|
@@ -2721,9 +2712,9 @@ version: 4.10.8-beta.1
|
|
|
2721
2712
|
win = window;
|
|
2722
2713
|
}
|
|
2723
2714
|
|
|
2724
|
-
/*
|
|
2725
|
-
* Copyright (c) 2015 NAVER Corp.
|
|
2726
|
-
* egjs projects are licensed under the MIT license
|
|
2715
|
+
/*
|
|
2716
|
+
* Copyright (c) 2015 NAVER Corp.
|
|
2717
|
+
* egjs projects are licensed under the MIT license
|
|
2727
2718
|
*/
|
|
2728
2719
|
var DIRECTION_NONE = 1;
|
|
2729
2720
|
var DIRECTION_LEFT = 2;
|
|
@@ -2754,16 +2745,13 @@ version: 4.10.8-beta.1
|
|
|
2754
2745
|
if (typeof document === "undefined") {
|
|
2755
2746
|
return "";
|
|
2756
2747
|
}
|
|
2757
|
-
|
|
2758
2748
|
var bodyStyle = (document.head || document.getElementsByTagName("head")[0]).style;
|
|
2759
2749
|
var target = ["transform", "webkitTransform", "msTransform", "mozTransform"];
|
|
2760
|
-
|
|
2761
2750
|
for (var i = 0, len = target.length; i < len; i++) {
|
|
2762
2751
|
if (target[i] in bodyStyle) {
|
|
2763
2752
|
return target[i];
|
|
2764
2753
|
}
|
|
2765
2754
|
}
|
|
2766
|
-
|
|
2767
2755
|
return "";
|
|
2768
2756
|
}();
|
|
2769
2757
|
var PREVENT_DRAG_CSSPROPS = {
|
|
@@ -2778,25 +2766,21 @@ version: 4.10.8-beta.1
|
|
|
2778
2766
|
// const el = Array.prototype.slice.call(nodes);
|
|
2779
2767
|
// for IE8
|
|
2780
2768
|
var el = [];
|
|
2781
|
-
|
|
2782
2769
|
for (var i = 0, len = nodes.length; i < len; i++) {
|
|
2783
2770
|
el.push(nodes[i]);
|
|
2784
2771
|
}
|
|
2785
|
-
|
|
2786
2772
|
return el;
|
|
2787
2773
|
};
|
|
2788
2774
|
var $ = function (param, multi) {
|
|
2789
2775
|
if (multi === void 0) {
|
|
2790
2776
|
multi = false;
|
|
2791
2777
|
}
|
|
2792
|
-
|
|
2793
2778
|
var el;
|
|
2794
|
-
|
|
2795
2779
|
if (typeof param === "string") {
|
|
2796
2780
|
// String (HTML, Selector)
|
|
2797
2781
|
// check if string is HTML tag format
|
|
2798
|
-
var match = param.match(/^<([a-z]+)\s*([^>]*)>/);
|
|
2799
|
-
|
|
2782
|
+
var match = param.match(/^<([a-z]+)\s*([^>]*)>/);
|
|
2783
|
+
// creating element
|
|
2800
2784
|
if (match) {
|
|
2801
2785
|
// HTML
|
|
2802
2786
|
var dummy = document.createElement("div");
|
|
@@ -2806,7 +2790,6 @@ version: 4.10.8-beta.1
|
|
|
2806
2790
|
// Selector
|
|
2807
2791
|
el = toArray$1(document.querySelectorAll(param));
|
|
2808
2792
|
}
|
|
2809
|
-
|
|
2810
2793
|
if (!multi) {
|
|
2811
2794
|
el = el.length >= 1 ? el[0] : undefined;
|
|
2812
2795
|
}
|
|
@@ -2825,33 +2808,27 @@ version: 4.10.8-beta.1
|
|
|
2825
2808
|
el = param.map(function (v) {
|
|
2826
2809
|
return $(v);
|
|
2827
2810
|
});
|
|
2828
|
-
|
|
2829
2811
|
if (!multi) {
|
|
2830
2812
|
el = el.length >= 1 ? el[0] : undefined;
|
|
2831
2813
|
}
|
|
2832
2814
|
}
|
|
2833
|
-
|
|
2834
2815
|
return el;
|
|
2835
2816
|
};
|
|
2836
2817
|
var raf = win.requestAnimationFrame || win.webkitRequestAnimationFrame;
|
|
2837
2818
|
var caf = win.cancelAnimationFrame || win.webkitCancelAnimationFrame;
|
|
2838
|
-
|
|
2839
2819
|
if (raf && !caf) {
|
|
2840
2820
|
var keyInfo_1 = {};
|
|
2841
2821
|
var oldraf_1 = raf;
|
|
2842
|
-
|
|
2843
2822
|
raf = function (callback) {
|
|
2844
2823
|
var wrapCallback = function (timestamp) {
|
|
2845
2824
|
if (keyInfo_1[key]) {
|
|
2846
2825
|
callback(timestamp);
|
|
2847
2826
|
}
|
|
2848
2827
|
};
|
|
2849
|
-
|
|
2850
2828
|
var key = oldraf_1(wrapCallback);
|
|
2851
2829
|
keyInfo_1[key] = true;
|
|
2852
2830
|
return key;
|
|
2853
2831
|
};
|
|
2854
|
-
|
|
2855
2832
|
caf = function (key) {
|
|
2856
2833
|
delete keyInfo_1[key];
|
|
2857
2834
|
};
|
|
@@ -2861,49 +2838,41 @@ version: 4.10.8-beta.1
|
|
|
2861
2838
|
callback(win.performance && win.performance.now && win.performance.now() || new Date().getTime());
|
|
2862
2839
|
}, 16);
|
|
2863
2840
|
};
|
|
2864
|
-
|
|
2865
2841
|
caf = win.clearTimeout;
|
|
2866
2842
|
}
|
|
2867
|
-
/**
|
|
2868
|
-
* A polyfill for the window.requestAnimationFrame() method.
|
|
2869
|
-
* @see https://developer.mozilla.org/en-US/docs/Web/API/window/requestAnimationFrame
|
|
2870
|
-
* @private
|
|
2843
|
+
/**
|
|
2844
|
+
* A polyfill for the window.requestAnimationFrame() method.
|
|
2845
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/API/window/requestAnimationFrame
|
|
2846
|
+
* @private
|
|
2871
2847
|
*/
|
|
2872
|
-
|
|
2873
|
-
|
|
2874
2848
|
var requestAnimationFrame = function (fp) {
|
|
2875
2849
|
return raf(fp);
|
|
2876
2850
|
};
|
|
2877
|
-
/**
|
|
2878
|
-
* A polyfill for the window.cancelAnimationFrame() method. It cancels an animation executed through a call to the requestAnimationFrame() method.
|
|
2879
|
-
* @param {Number} key − The ID value returned through a call to the requestAnimationFrame() method. <ko>requestAnimationFrame() 메서드가 반환한 아이디 값</ko>
|
|
2880
|
-
* @see https://developer.mozilla.org/en-US/docs/Web/API/Window/cancelAnimationFrame
|
|
2881
|
-
* @private
|
|
2851
|
+
/**
|
|
2852
|
+
* A polyfill for the window.cancelAnimationFrame() method. It cancels an animation executed through a call to the requestAnimationFrame() method.
|
|
2853
|
+
* @param {Number} key − The ID value returned through a call to the requestAnimationFrame() method. <ko>requestAnimationFrame() 메서드가 반환한 아이디 값</ko>
|
|
2854
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/API/Window/cancelAnimationFrame
|
|
2855
|
+
* @private
|
|
2882
2856
|
*/
|
|
2883
|
-
|
|
2884
2857
|
var cancelAnimationFrame = function (key) {
|
|
2885
2858
|
caf(key);
|
|
2886
2859
|
};
|
|
2887
2860
|
var map = function (obj, callback) {
|
|
2888
2861
|
var tranformed = {};
|
|
2889
|
-
|
|
2890
2862
|
for (var k in obj) {
|
|
2891
2863
|
if (k) {
|
|
2892
2864
|
tranformed[k] = callback(obj[k], k);
|
|
2893
2865
|
}
|
|
2894
2866
|
}
|
|
2895
|
-
|
|
2896
2867
|
return tranformed;
|
|
2897
2868
|
};
|
|
2898
2869
|
var filter = function (obj, callback) {
|
|
2899
2870
|
var filtered = {};
|
|
2900
|
-
|
|
2901
2871
|
for (var k in obj) {
|
|
2902
2872
|
if (k && callback(obj[k], k)) {
|
|
2903
2873
|
filtered[k] = obj[k];
|
|
2904
2874
|
}
|
|
2905
2875
|
}
|
|
2906
|
-
|
|
2907
2876
|
return filtered;
|
|
2908
2877
|
};
|
|
2909
2878
|
var every = function (obj, callback) {
|
|
@@ -2912,7 +2881,6 @@ version: 4.10.8-beta.1
|
|
|
2912
2881
|
return false;
|
|
2913
2882
|
}
|
|
2914
2883
|
}
|
|
2915
|
-
|
|
2916
2884
|
return true;
|
|
2917
2885
|
};
|
|
2918
2886
|
var equal = function (target, base) {
|
|
@@ -2926,14 +2894,12 @@ version: 4.10.8-beta.1
|
|
|
2926
2894
|
if (!roundNumFunc[roundUnit]) {
|
|
2927
2895
|
roundNumFunc[roundUnit] = getRoundFunc(roundUnit);
|
|
2928
2896
|
}
|
|
2929
|
-
|
|
2930
2897
|
return roundNumFunc[roundUnit](num);
|
|
2931
2898
|
};
|
|
2932
2899
|
var roundNumbers = function (num, roundUnit) {
|
|
2933
2900
|
if (!num || !roundUnit) {
|
|
2934
2901
|
return num;
|
|
2935
2902
|
}
|
|
2936
|
-
|
|
2937
2903
|
return map(num, function (value, key) {
|
|
2938
2904
|
return roundNumber(value, typeof roundUnit === "number" ? roundUnit : roundUnit[key]);
|
|
2939
2905
|
});
|
|
@@ -2942,25 +2908,20 @@ version: 4.10.8-beta.1
|
|
|
2942
2908
|
if (!isFinite(val)) {
|
|
2943
2909
|
return 0;
|
|
2944
2910
|
}
|
|
2945
|
-
|
|
2946
2911
|
var v = "".concat(val);
|
|
2947
|
-
|
|
2948
2912
|
if (v.indexOf("e") >= 0) {
|
|
2949
2913
|
// Exponential Format
|
|
2950
2914
|
// 1e-10, 1e-12
|
|
2951
2915
|
var p = 0;
|
|
2952
2916
|
var e = 1;
|
|
2953
|
-
|
|
2954
2917
|
while (Math.round(val * e) / e !== val) {
|
|
2955
2918
|
e *= 10;
|
|
2956
2919
|
p++;
|
|
2957
2920
|
}
|
|
2958
|
-
|
|
2959
2921
|
return p;
|
|
2960
|
-
}
|
|
2922
|
+
}
|
|
2923
|
+
// In general, following has performance benefit.
|
|
2961
2924
|
// https://jsperf.com/precision-calculation
|
|
2962
|
-
|
|
2963
|
-
|
|
2964
2925
|
return v.indexOf(".") >= 0 ? v.length - v.indexOf(".") - 1 : 0;
|
|
2965
2926
|
};
|
|
2966
2927
|
var inversePow = function (n) {
|
|
@@ -2974,7 +2935,6 @@ version: 4.10.8-beta.1
|
|
|
2974
2935
|
if (v === 0) {
|
|
2975
2936
|
return 0;
|
|
2976
2937
|
}
|
|
2977
|
-
|
|
2978
2938
|
return Math.round(Math.round(n / v) * v * p) / p;
|
|
2979
2939
|
};
|
|
2980
2940
|
};
|
|
@@ -3010,23 +2970,18 @@ version: 4.10.8-beta.1
|
|
|
3010
2970
|
};
|
|
3011
2971
|
var setCssProps = function (element, option, direction) {
|
|
3012
2972
|
var _a;
|
|
3013
|
-
|
|
3014
2973
|
var touchActionMap = (_a = {}, _a[DIRECTION_NONE] = "auto", _a[DIRECTION_ALL] = "none", _a[DIRECTION_VERTICAL] = "pan-x", _a[DIRECTION_HORIZONTAL] = "pan-y", _a);
|
|
3015
2974
|
var oldCssProps = {};
|
|
3016
|
-
|
|
3017
2975
|
if (element && element.style) {
|
|
3018
2976
|
var touchAction = option.touchAction ? option.touchAction : touchActionMap[direction];
|
|
3019
|
-
|
|
3020
2977
|
var newCssProps_1 = __assign$1(__assign$1({}, PREVENT_DRAG_CSSPROPS), {
|
|
3021
2978
|
"touch-action": element.style["touch-action"] === "none" ? "none" : touchAction
|
|
3022
2979
|
});
|
|
3023
|
-
|
|
3024
2980
|
Object.keys(newCssProps_1).forEach(function (prop) {
|
|
3025
2981
|
oldCssProps[prop] = element.style[prop];
|
|
3026
2982
|
element.style[prop] = newCssProps_1[prop];
|
|
3027
2983
|
});
|
|
3028
2984
|
}
|
|
3029
|
-
|
|
3030
2985
|
return oldCssProps;
|
|
3031
2986
|
};
|
|
3032
2987
|
var revertCssProps = function (element, originalCssProps) {
|
|
@@ -3035,51 +2990,44 @@ version: 4.10.8-beta.1
|
|
|
3035
2990
|
element.style[prop] = originalCssProps[prop];
|
|
3036
2991
|
});
|
|
3037
2992
|
}
|
|
3038
|
-
|
|
3039
2993
|
return;
|
|
3040
2994
|
};
|
|
3041
2995
|
|
|
3042
|
-
var EventManager =
|
|
3043
|
-
/*#__PURE__*/
|
|
3044
|
-
function () {
|
|
2996
|
+
var EventManager = /*#__PURE__*/function () {
|
|
3045
2997
|
function EventManager(_axes) {
|
|
3046
2998
|
this._axes = _axes;
|
|
3047
2999
|
this.holdingCount = 0;
|
|
3048
3000
|
}
|
|
3049
|
-
/**
|
|
3050
|
-
* This event is fired when a user holds an element on the screen of the device.
|
|
3051
|
-
* @ko 사용자가 기기의 화면에 손을 대고 있을 때 발생하는 이벤트
|
|
3052
|
-
* @event Axes#hold
|
|
3053
|
-
* @type {object}
|
|
3054
|
-
* @property {Object.<string, number>} pos coordinate <ko>좌표 정보</ko>
|
|
3055
|
-
* @property {Object} input The instance of inputType where the event occurred<ko>이벤트가 발생한 inputType 인스턴스</ko>
|
|
3056
|
-
* @property {Object} inputEvent The event object received from inputType <ko>inputType으로 부터 받은 이벤트 객체</ko>
|
|
3057
|
-
* @property {Boolean} isTrusted Returns true if an event was generated by the user action, or false if it was caused by a script or API call <ko>사용자의 액션에 의해 이벤트가 발생하였으면 true, 스크립트나 API호출에 의해 발생하였을 경우에는 false를 반환한다.</ko>
|
|
3058
|
-
*
|
|
3059
|
-
* @example
|
|
3060
|
-
* ```js
|
|
3061
|
-
* const axes = new eg.Axes({
|
|
3062
|
-
* "x": {
|
|
3063
|
-
* range: [0, 100]
|
|
3064
|
-
* },
|
|
3065
|
-
* "zoom": {
|
|
3066
|
-
* range: [50, 30]
|
|
3067
|
-
* }
|
|
3068
|
-
* }).on("hold", function(event) {
|
|
3069
|
-
* // event.pos
|
|
3070
|
-
* // event.input
|
|
3071
|
-
* // event.inputEvent
|
|
3072
|
-
* // isTrusted
|
|
3073
|
-
* });
|
|
3074
|
-
* ```
|
|
3001
|
+
/**
|
|
3002
|
+
* This event is fired when a user holds an element on the screen of the device.
|
|
3003
|
+
* @ko 사용자가 기기의 화면에 손을 대고 있을 때 발생하는 이벤트
|
|
3004
|
+
* @event Axes#hold
|
|
3005
|
+
* @type {object}
|
|
3006
|
+
* @property {Object.<string, number>} pos coordinate <ko>좌표 정보</ko>
|
|
3007
|
+
* @property {Object} input The instance of inputType where the event occurred<ko>이벤트가 발생한 inputType 인스턴스</ko>
|
|
3008
|
+
* @property {Object} inputEvent The event object received from inputType <ko>inputType으로 부터 받은 이벤트 객체</ko>
|
|
3009
|
+
* @property {Boolean} isTrusted Returns true if an event was generated by the user action, or false if it was caused by a script or API call <ko>사용자의 액션에 의해 이벤트가 발생하였으면 true, 스크립트나 API호출에 의해 발생하였을 경우에는 false를 반환한다.</ko>
|
|
3010
|
+
*
|
|
3011
|
+
* @example
|
|
3012
|
+
* ```js
|
|
3013
|
+
* const axes = new eg.Axes({
|
|
3014
|
+
* "x": {
|
|
3015
|
+
* range: [0, 100]
|
|
3016
|
+
* },
|
|
3017
|
+
* "zoom": {
|
|
3018
|
+
* range: [50, 30]
|
|
3019
|
+
* }
|
|
3020
|
+
* }).on("hold", function(event) {
|
|
3021
|
+
* // event.pos
|
|
3022
|
+
* // event.input
|
|
3023
|
+
* // event.inputEvent
|
|
3024
|
+
* // isTrusted
|
|
3025
|
+
* });
|
|
3026
|
+
* ```
|
|
3075
3027
|
*/
|
|
3076
|
-
|
|
3077
|
-
|
|
3078
3028
|
var __proto = EventManager.prototype;
|
|
3079
|
-
|
|
3080
3029
|
__proto.hold = function (pos, option) {
|
|
3081
3030
|
var roundPos = this._getRoundPos(pos).roundPos;
|
|
3082
|
-
|
|
3083
3031
|
this._axes.trigger(new ComponentEvent$1("hold", {
|
|
3084
3032
|
pos: roundPos,
|
|
3085
3033
|
input: option.input || null,
|
|
@@ -3087,151 +3035,139 @@ version: 4.10.8-beta.1
|
|
|
3087
3035
|
isTrusted: true
|
|
3088
3036
|
}));
|
|
3089
3037
|
};
|
|
3090
|
-
/**
|
|
3091
|
-
* Specifies the coordinates to move after the 'change' event. It works when the holding value of the change event is true.
|
|
3092
|
-
* @ko 'change' 이벤트 이후 이동할 좌표를 지정한다. change이벤트의 holding 값이 true일 경우에 동작한다
|
|
3093
|
-
* @param {Object.<string, number>} pos The coordinate to move to <ko>이동할 좌표</ko>
|
|
3094
|
-
* @example
|
|
3095
|
-
* ```js
|
|
3096
|
-
* const axes = new eg.Axes({
|
|
3097
|
-
* "x": {
|
|
3098
|
-
* range: [0, 100]
|
|
3099
|
-
* },
|
|
3100
|
-
* "zoom": {
|
|
3101
|
-
* range: [50, 30]
|
|
3102
|
-
* }
|
|
3103
|
-
* }).on("change", function(event) {
|
|
3104
|
-
* event.holding && event.set({x: 10});
|
|
3105
|
-
* });
|
|
3106
|
-
* ```
|
|
3038
|
+
/**
|
|
3039
|
+
* Specifies the coordinates to move after the 'change' event. It works when the holding value of the change event is true.
|
|
3040
|
+
* @ko 'change' 이벤트 이후 이동할 좌표를 지정한다. change이벤트의 holding 값이 true일 경우에 동작한다
|
|
3041
|
+
* @param {Object.<string, number>} pos The coordinate to move to <ko>이동할 좌표</ko>
|
|
3042
|
+
* @example
|
|
3043
|
+
* ```js
|
|
3044
|
+
* const axes = new eg.Axes({
|
|
3045
|
+
* "x": {
|
|
3046
|
+
* range: [0, 100]
|
|
3047
|
+
* },
|
|
3048
|
+
* "zoom": {
|
|
3049
|
+
* range: [50, 30]
|
|
3050
|
+
* }
|
|
3051
|
+
* }).on("change", function(event) {
|
|
3052
|
+
* event.holding && event.set({x: 10});
|
|
3053
|
+
* });
|
|
3054
|
+
* ```
|
|
3107
3055
|
*/
|
|
3108
|
-
|
|
3109
|
-
|
|
3110
|
-
* @
|
|
3111
|
-
* @param {
|
|
3112
|
-
* @
|
|
3113
|
-
*
|
|
3114
|
-
*
|
|
3115
|
-
*
|
|
3116
|
-
*
|
|
3117
|
-
*
|
|
3118
|
-
*
|
|
3119
|
-
*
|
|
3120
|
-
*
|
|
3121
|
-
*
|
|
3122
|
-
* }
|
|
3123
|
-
*
|
|
3124
|
-
*
|
|
3125
|
-
* ```
|
|
3056
|
+
/** Specifies the animation coordinates to move after the 'release' or 'animationStart' events.
|
|
3057
|
+
* @ko 'release' 또는 'animationStart' 이벤트 이후 이동할 좌표를 지정한다.
|
|
3058
|
+
* @param {Object.<string, number>} pos The coordinate to move to <ko>이동할 좌표</ko>
|
|
3059
|
+
* @param {Number} [duration=0] Duration of the animation (unit: ms) <ko>애니메이션 진행 시간(단위: ms)</ko>
|
|
3060
|
+
* @example
|
|
3061
|
+
* ```js
|
|
3062
|
+
* const axes = new eg.Axes({
|
|
3063
|
+
* "x": {
|
|
3064
|
+
* range: [0, 100]
|
|
3065
|
+
* },
|
|
3066
|
+
* "zoom": {
|
|
3067
|
+
* range: [50, 30]
|
|
3068
|
+
* }
|
|
3069
|
+
* }).on("animationStart", function(event) {
|
|
3070
|
+
* event.setTo({x: 10}, 2000);
|
|
3071
|
+
* });
|
|
3072
|
+
* ```
|
|
3126
3073
|
*/
|
|
3127
|
-
|
|
3128
|
-
|
|
3129
|
-
*
|
|
3130
|
-
* @
|
|
3131
|
-
* @
|
|
3132
|
-
* @
|
|
3133
|
-
* @property {Object.<string, number>}
|
|
3134
|
-
* @property {Object.<string, number>}
|
|
3135
|
-
* @property {Object.<string, number>}
|
|
3136
|
-
* @property {Object
|
|
3137
|
-
* @property {Object}
|
|
3138
|
-
* @property {
|
|
3139
|
-
* @property {
|
|
3140
|
-
*
|
|
3141
|
-
*
|
|
3142
|
-
*
|
|
3143
|
-
*
|
|
3144
|
-
*
|
|
3145
|
-
*
|
|
3146
|
-
*
|
|
3147
|
-
*
|
|
3148
|
-
*
|
|
3149
|
-
*
|
|
3150
|
-
*
|
|
3151
|
-
*
|
|
3152
|
-
* // event.
|
|
3153
|
-
* // event.
|
|
3154
|
-
* // event.
|
|
3155
|
-
* // event.
|
|
3156
|
-
* // event.
|
|
3157
|
-
* // event.
|
|
3158
|
-
*
|
|
3159
|
-
*
|
|
3160
|
-
*
|
|
3161
|
-
*
|
|
3162
|
-
*
|
|
3163
|
-
* ```
|
|
3074
|
+
/**
|
|
3075
|
+
* This event is fired when a user release an element on the screen of the device.
|
|
3076
|
+
* @ko 사용자가 기기의 화면에서 손을 뗐을 때 발생하는 이벤트
|
|
3077
|
+
* @event Axes#release
|
|
3078
|
+
* @type {object}
|
|
3079
|
+
* @property {Object.<string, number>} depaPos The coordinates when releasing an element<ko>손을 뗐을 때의 좌표 </ko>
|
|
3080
|
+
* @property {Object.<string, number>} destPos The coordinates to move to after releasing an element<ko>손을 뗀 뒤에 이동할 좌표</ko>
|
|
3081
|
+
* @property {Object.<string, number>} delta The movement variation of coordinate <ko>좌표의 변화량</ko>
|
|
3082
|
+
* @property {Object.<string, number>} bounceRatio If the coordinates at the time of release are in the bounce area, the current bounce value divided by the maximum bounce value <ko>손을 뗐을 때의 좌표가 bounce 영역에 있는 경우 현재 bounce된 값을 최대 bounce 값으로 나눈 수치.</ko>
|
|
3083
|
+
* @property {Object} inputEvent The event object received from inputType <ko>inputType으로 부터 받은 이벤트 객체</ko>
|
|
3084
|
+
* @property {Object} input The instance of inputType where the event occurred<ko>이벤트가 발생한 inputType 인스턴스</ko>
|
|
3085
|
+
* @property {setTo} setTo Specifies the animation coordinates to move after the event <ko>이벤트 이후 이동할 애니메이션 좌표를 지정한다</ko>
|
|
3086
|
+
* @property {Boolean} isTrusted Returns true if an event was generated by the user action, or false if it was caused by a script or API call <ko>사용자의 액션에 의해 이벤트가 발생하였으면 true, 스크립트나 API호출에 의해 발생하였을 경우에는 false를 반환한다.</ko>
|
|
3087
|
+
*
|
|
3088
|
+
* @example
|
|
3089
|
+
* ```js
|
|
3090
|
+
* const axes = new eg.Axes({
|
|
3091
|
+
* "x": {
|
|
3092
|
+
* range: [0, 100]
|
|
3093
|
+
* },
|
|
3094
|
+
* "zoom": {
|
|
3095
|
+
* range: [50, 30]
|
|
3096
|
+
* }
|
|
3097
|
+
* }).on("release", function(event) {
|
|
3098
|
+
* // event.depaPos
|
|
3099
|
+
* // event.destPos
|
|
3100
|
+
* // event.delta
|
|
3101
|
+
* // event.input
|
|
3102
|
+
* // event.inputEvent
|
|
3103
|
+
* // event.setTo
|
|
3104
|
+
* // event.isTrusted
|
|
3105
|
+
*
|
|
3106
|
+
* // if you want to change the animation coordinates to move after the 'release' event.
|
|
3107
|
+
* event.setTo({x: 10}, 2000);
|
|
3108
|
+
* });
|
|
3109
|
+
* ```
|
|
3164
3110
|
*/
|
|
3165
|
-
|
|
3166
|
-
|
|
3167
3111
|
__proto.triggerRelease = function (param) {
|
|
3168
3112
|
var _a = this._getRoundPos(param.destPos, param.depaPos),
|
|
3169
|
-
|
|
3170
|
-
|
|
3171
|
-
|
|
3113
|
+
roundPos = _a.roundPos,
|
|
3114
|
+
roundDepa = _a.roundDepa;
|
|
3172
3115
|
param.destPos = roundPos;
|
|
3173
3116
|
param.depaPos = roundDepa;
|
|
3174
3117
|
param.setTo = this._createUserControll(param.destPos, param.duration);
|
|
3175
|
-
|
|
3176
3118
|
this._axes.trigger(new ComponentEvent$1("release", __assign$1(__assign$1({}, param), {
|
|
3177
3119
|
bounceRatio: this._getBounceRatio(roundPos)
|
|
3178
3120
|
})));
|
|
3179
3121
|
};
|
|
3180
|
-
/**
|
|
3181
|
-
* This event is fired when coordinate changes.
|
|
3182
|
-
* @ko 좌표가 변경됐을 때 발생하는 이벤트
|
|
3183
|
-
* @event Axes#change
|
|
3184
|
-
* @type {object}
|
|
3185
|
-
* @property {Object.<string, number>} pos The coordinate <ko>좌표</ko>
|
|
3186
|
-
* @property {Object.<string, number>} delta The movement variation of coordinate <ko>좌표의 변화량</ko>
|
|
3187
|
-
* @property {Object.<string, number>} bounceRatio If the current coordinates are in the bounce area, the current bounce value divided by the maximum bounce value <ko>현재 좌표가 bounce 영역에 있는 경우 현재 bounce된 값을 최대 bounce 값으로 나눈 수치.</ko>
|
|
3188
|
-
* @property {Boolean} holding Indicates whether a user holds an element on the screen of the device.<ko>사용자가 기기의 화면을 누르고 있는지 여부</ko>
|
|
3189
|
-
* @property {Object} input The instance of inputType where the event occurred. If the value is changed by animation, it returns 'null'.<ko>이벤트가 발생한 inputType 인스턴스. 애니메이션에 의해 값이 변경될 경우에는 'null'을 반환한다.</ko>
|
|
3190
|
-
* @property {Object} inputEvent The event object received from inputType. If the value is changed by animation, it returns 'null'.<ko>inputType으로 부터 받은 이벤트 객체. 애니메이션에 의해 값이 변경될 경우에는 'null'을 반환한다.</ko>
|
|
3191
|
-
* @property {set} set Specifies the coordinates to move after the event. It works when the holding value is true <ko>이벤트 이후 이동할 좌표를 지정한다. holding 값이 true일 경우에 동작한다.</ko>
|
|
3192
|
-
* @property {Boolean} isTrusted Returns true if an event was generated by the user action, or false if it was caused by a script or API call <ko>사용자의 액션에 의해 이벤트가 발생하였으면 true, 스크립트나 API호출에 의해 발생하였을 경우에는 false를 반환한다.</ko>
|
|
3193
|
-
*
|
|
3194
|
-
* @example
|
|
3195
|
-
* ```js
|
|
3196
|
-
* const axes = new eg.Axes({
|
|
3197
|
-
* "x": {
|
|
3198
|
-
* range: [0, 100]
|
|
3199
|
-
* },
|
|
3200
|
-
* "zoom": {
|
|
3201
|
-
* range: [50, 30]
|
|
3202
|
-
* }
|
|
3203
|
-
* }).on("change", function(event) {
|
|
3204
|
-
* // event.pos
|
|
3205
|
-
* // event.delta
|
|
3206
|
-
* // event.input
|
|
3207
|
-
* // event.inputEvent
|
|
3208
|
-
* // event.holding
|
|
3209
|
-
* // event.set
|
|
3210
|
-
* // event.isTrusted
|
|
3211
|
-
*
|
|
3212
|
-
* // if you want to change the coordinates to move after the 'change' event.
|
|
3213
|
-
* // it works when the holding value of the change event is true.
|
|
3214
|
-
* event.holding && event.set({x: 10});
|
|
3215
|
-
* });
|
|
3216
|
-
* ```
|
|
3122
|
+
/**
|
|
3123
|
+
* This event is fired when coordinate changes.
|
|
3124
|
+
* @ko 좌표가 변경됐을 때 발생하는 이벤트
|
|
3125
|
+
* @event Axes#change
|
|
3126
|
+
* @type {object}
|
|
3127
|
+
* @property {Object.<string, number>} pos The coordinate <ko>좌표</ko>
|
|
3128
|
+
* @property {Object.<string, number>} delta The movement variation of coordinate <ko>좌표의 변화량</ko>
|
|
3129
|
+
* @property {Object.<string, number>} bounceRatio If the current coordinates are in the bounce area, the current bounce value divided by the maximum bounce value <ko>현재 좌표가 bounce 영역에 있는 경우 현재 bounce된 값을 최대 bounce 값으로 나눈 수치.</ko>
|
|
3130
|
+
* @property {Boolean} holding Indicates whether a user holds an element on the screen of the device.<ko>사용자가 기기의 화면을 누르고 있는지 여부</ko>
|
|
3131
|
+
* @property {Object} input The instance of inputType where the event occurred. If the value is changed by animation, it returns 'null'.<ko>이벤트가 발생한 inputType 인스턴스. 애니메이션에 의해 값이 변경될 경우에는 'null'을 반환한다.</ko>
|
|
3132
|
+
* @property {Object} inputEvent The event object received from inputType. If the value is changed by animation, it returns 'null'.<ko>inputType으로 부터 받은 이벤트 객체. 애니메이션에 의해 값이 변경될 경우에는 'null'을 반환한다.</ko>
|
|
3133
|
+
* @property {set} set Specifies the coordinates to move after the event. It works when the holding value is true <ko>이벤트 이후 이동할 좌표를 지정한다. holding 값이 true일 경우에 동작한다.</ko>
|
|
3134
|
+
* @property {Boolean} isTrusted Returns true if an event was generated by the user action, or false if it was caused by a script or API call <ko>사용자의 액션에 의해 이벤트가 발생하였으면 true, 스크립트나 API호출에 의해 발생하였을 경우에는 false를 반환한다.</ko>
|
|
3135
|
+
*
|
|
3136
|
+
* @example
|
|
3137
|
+
* ```js
|
|
3138
|
+
* const axes = new eg.Axes({
|
|
3139
|
+
* "x": {
|
|
3140
|
+
* range: [0, 100]
|
|
3141
|
+
* },
|
|
3142
|
+
* "zoom": {
|
|
3143
|
+
* range: [50, 30]
|
|
3144
|
+
* }
|
|
3145
|
+
* }).on("change", function(event) {
|
|
3146
|
+
* // event.pos
|
|
3147
|
+
* // event.delta
|
|
3148
|
+
* // event.input
|
|
3149
|
+
* // event.inputEvent
|
|
3150
|
+
* // event.holding
|
|
3151
|
+
* // event.set
|
|
3152
|
+
* // event.isTrusted
|
|
3153
|
+
*
|
|
3154
|
+
* // if you want to change the coordinates to move after the 'change' event.
|
|
3155
|
+
* // it works when the holding value of the change event is true.
|
|
3156
|
+
* event.holding && event.set({x: 10});
|
|
3157
|
+
* });
|
|
3158
|
+
* ```
|
|
3217
3159
|
*/
|
|
3218
|
-
|
|
3219
|
-
|
|
3220
3160
|
__proto.triggerChange = function (pos, depaPos, option, holding) {
|
|
3221
3161
|
var _this = this;
|
|
3222
|
-
|
|
3223
3162
|
if (holding === void 0) {
|
|
3224
3163
|
holding = false;
|
|
3225
3164
|
}
|
|
3226
|
-
|
|
3227
3165
|
var animationManager = this.animationManager;
|
|
3228
3166
|
var axisManager = animationManager.axisManager;
|
|
3229
3167
|
var eventInfo = animationManager.getEventInfo();
|
|
3230
|
-
|
|
3231
3168
|
var _a = this._getRoundPos(pos, depaPos),
|
|
3232
|
-
|
|
3233
|
-
|
|
3234
|
-
|
|
3169
|
+
roundPos = _a.roundPos,
|
|
3170
|
+
roundDepa = _a.roundDepa;
|
|
3235
3171
|
var moveTo = axisManager.moveTo(roundPos, roundDepa);
|
|
3236
3172
|
var inputEvent = (option === null || option === void 0 ? void 0 : option.event) || (eventInfo === null || eventInfo === void 0 ? void 0 : eventInfo.event) || null;
|
|
3237
3173
|
var param = {
|
|
@@ -3243,155 +3179,136 @@ version: 4.10.8-beta.1
|
|
|
3243
3179
|
isTrusted: !!inputEvent,
|
|
3244
3180
|
input: (option === null || option === void 0 ? void 0 : option.input) || (eventInfo === null || eventInfo === void 0 ? void 0 : eventInfo.input) || null,
|
|
3245
3181
|
set: inputEvent ? this._createUserControll(moveTo.pos) : function () {} // eslint-disable-line @typescript-eslint/no-empty-function
|
|
3246
|
-
|
|
3247
3182
|
};
|
|
3248
|
-
var event = new ComponentEvent$1("change", param);
|
|
3249
3183
|
|
|
3184
|
+
var event = new ComponentEvent$1("change", param);
|
|
3250
3185
|
this._axes.trigger(event);
|
|
3251
|
-
|
|
3252
3186
|
Object.keys(moveTo.pos).forEach(function (axis) {
|
|
3253
3187
|
var p = moveTo.pos[axis];
|
|
3254
3188
|
getObserver(_this._axes, axis, p).current = p;
|
|
3255
3189
|
});
|
|
3256
|
-
|
|
3257
3190
|
if (inputEvent) {
|
|
3258
3191
|
axisManager.set(param.set().destPos);
|
|
3259
3192
|
}
|
|
3260
|
-
|
|
3261
3193
|
return !event.isCanceled();
|
|
3262
3194
|
};
|
|
3263
|
-
/**
|
|
3264
|
-
* This event is fired when animation starts.
|
|
3265
|
-
* @ko 에니메이션이 시작할 때 발생한다.
|
|
3266
|
-
* @event Axes#animationStart
|
|
3267
|
-
* @type {object}
|
|
3268
|
-
* @property {Object.<string, number>} depaPos The coordinates when animation starts<ko>애니메이션이 시작 되었을 때의 좌표 </ko>
|
|
3269
|
-
* @property {Object.<string, number>} destPos The coordinates to move to. If you change this value, you can run the animation<ko>이동할 좌표. 이값을 변경하여 애니메이션을 동작시킬수 있다</ko>
|
|
3270
|
-
* @property {Object.<string, number>} delta The movement variation of coordinate <ko>좌표의 변화량</ko>
|
|
3271
|
-
* @property {Number} duration Duration of the animation (unit: ms). If you change this value, you can control the animation duration time.<ko>애니메이션 진행 시간(단위: ms). 이값을 변경하여 애니메이션의 이동시간을 조절할 수 있다.</ko>
|
|
3272
|
-
* @property {Object} input The instance of inputType where the event occurred. If the value is changed by animation, it returns 'null'.<ko>이벤트가 발생한 inputType 인스턴스. 애니메이션에 의해 값이 변경될 경우에는 'null'을 반환한다.</ko>
|
|
3273
|
-
* @property {Object} inputEvent The event object received from inputType <ko>inputType으로 부터 받은 이벤트 객체</ko>
|
|
3274
|
-
* @property {setTo} setTo Specifies the animation coordinates to move after the event <ko>이벤트 이후 이동할 애니메이션 좌표를 지정한다</ko>
|
|
3275
|
-
* @property {Boolean} isTrusted Returns true if an event was generated by the user action, or false if it was caused by a script or API call <ko>사용자의 액션에 의해 이벤트가 발생하였으면 true, 스크립트나 API호출에 의해 발생하였을 경우에는 false를 반환한다.</ko>
|
|
3276
|
-
*
|
|
3277
|
-
* @example
|
|
3278
|
-
* ```js
|
|
3279
|
-
* const axes = new eg.Axes({
|
|
3280
|
-
* "x": {
|
|
3281
|
-
* range: [0, 100]
|
|
3282
|
-
* },
|
|
3283
|
-
* "zoom": {
|
|
3284
|
-
* range: [50, 30]
|
|
3285
|
-
* }
|
|
3286
|
-
* }).on("release", function(event) {
|
|
3287
|
-
* // event.depaPos
|
|
3288
|
-
* // event.destPos
|
|
3289
|
-
* // event.delta
|
|
3290
|
-
* // event.input
|
|
3291
|
-
* // event.inputEvent
|
|
3292
|
-
* // event.setTo
|
|
3293
|
-
* // event.isTrusted
|
|
3294
|
-
*
|
|
3295
|
-
* // if you want to change the animation coordinates to move after the 'animationStart' event.
|
|
3296
|
-
* event.setTo({x: 10}, 2000);
|
|
3297
|
-
* });
|
|
3298
|
-
* ```
|
|
3195
|
+
/**
|
|
3196
|
+
* This event is fired when animation starts.
|
|
3197
|
+
* @ko 에니메이션이 시작할 때 발생한다.
|
|
3198
|
+
* @event Axes#animationStart
|
|
3199
|
+
* @type {object}
|
|
3200
|
+
* @property {Object.<string, number>} depaPos The coordinates when animation starts<ko>애니메이션이 시작 되었을 때의 좌표 </ko>
|
|
3201
|
+
* @property {Object.<string, number>} destPos The coordinates to move to. If you change this value, you can run the animation<ko>이동할 좌표. 이값을 변경하여 애니메이션을 동작시킬수 있다</ko>
|
|
3202
|
+
* @property {Object.<string, number>} delta The movement variation of coordinate <ko>좌표의 변화량</ko>
|
|
3203
|
+
* @property {Number} duration Duration of the animation (unit: ms). If you change this value, you can control the animation duration time.<ko>애니메이션 진행 시간(단위: ms). 이값을 변경하여 애니메이션의 이동시간을 조절할 수 있다.</ko>
|
|
3204
|
+
* @property {Object} input The instance of inputType where the event occurred. If the value is changed by animation, it returns 'null'.<ko>이벤트가 발생한 inputType 인스턴스. 애니메이션에 의해 값이 변경될 경우에는 'null'을 반환한다.</ko>
|
|
3205
|
+
* @property {Object} inputEvent The event object received from inputType <ko>inputType으로 부터 받은 이벤트 객체</ko>
|
|
3206
|
+
* @property {setTo} setTo Specifies the animation coordinates to move after the event <ko>이벤트 이후 이동할 애니메이션 좌표를 지정한다</ko>
|
|
3207
|
+
* @property {Boolean} isTrusted Returns true if an event was generated by the user action, or false if it was caused by a script or API call <ko>사용자의 액션에 의해 이벤트가 발생하였으면 true, 스크립트나 API호출에 의해 발생하였을 경우에는 false를 반환한다.</ko>
|
|
3208
|
+
*
|
|
3209
|
+
* @example
|
|
3210
|
+
* ```js
|
|
3211
|
+
* const axes = new eg.Axes({
|
|
3212
|
+
* "x": {
|
|
3213
|
+
* range: [0, 100]
|
|
3214
|
+
* },
|
|
3215
|
+
* "zoom": {
|
|
3216
|
+
* range: [50, 30]
|
|
3217
|
+
* }
|
|
3218
|
+
* }).on("release", function(event) {
|
|
3219
|
+
* // event.depaPos
|
|
3220
|
+
* // event.destPos
|
|
3221
|
+
* // event.delta
|
|
3222
|
+
* // event.input
|
|
3223
|
+
* // event.inputEvent
|
|
3224
|
+
* // event.setTo
|
|
3225
|
+
* // event.isTrusted
|
|
3226
|
+
*
|
|
3227
|
+
* // if you want to change the animation coordinates to move after the 'animationStart' event.
|
|
3228
|
+
* event.setTo({x: 10}, 2000);
|
|
3229
|
+
* });
|
|
3230
|
+
* ```
|
|
3299
3231
|
*/
|
|
3300
|
-
|
|
3301
|
-
|
|
3302
3232
|
__proto.triggerAnimationStart = function (param) {
|
|
3303
3233
|
var _a = this._getRoundPos(param.destPos, param.depaPos),
|
|
3304
|
-
|
|
3305
|
-
|
|
3306
|
-
|
|
3234
|
+
roundPos = _a.roundPos,
|
|
3235
|
+
roundDepa = _a.roundDepa;
|
|
3307
3236
|
param.destPos = roundPos;
|
|
3308
3237
|
param.depaPos = roundDepa;
|
|
3309
3238
|
param.setTo = this._createUserControll(param.destPos, param.duration);
|
|
3310
3239
|
var event = new ComponentEvent$1("animationStart", param);
|
|
3311
|
-
|
|
3312
3240
|
this._axes.trigger(event);
|
|
3313
|
-
|
|
3314
3241
|
return !event.isCanceled();
|
|
3315
3242
|
};
|
|
3316
|
-
/**
|
|
3317
|
-
* This event is fired when animation ends.
|
|
3318
|
-
* @ko 에니메이션이 끝났을 때 발생한다.
|
|
3319
|
-
* @event Axes#animationEnd
|
|
3320
|
-
* @type {object}
|
|
3321
|
-
* @property {Boolean} isTrusted Returns true if an event was generated by the user action, or false if it was caused by a script or API call <ko>사용자의 액션에 의해 이벤트가 발생하였으면 true, 스크립트나 API호출에 의해 발생하였을 경우에는 false를 반환한다.</ko>
|
|
3322
|
-
*
|
|
3323
|
-
* @example
|
|
3324
|
-
* ```js
|
|
3325
|
-
* const axes = new eg.Axes({
|
|
3326
|
-
* "x": {
|
|
3327
|
-
* range: [0, 100]
|
|
3328
|
-
* },
|
|
3329
|
-
* "zoom": {
|
|
3330
|
-
* range: [50, 30]
|
|
3331
|
-
* }
|
|
3332
|
-
* }).on("animationEnd", function(event) {
|
|
3333
|
-
* // event.isTrusted
|
|
3334
|
-
* });
|
|
3335
|
-
* ```
|
|
3243
|
+
/**
|
|
3244
|
+
* This event is fired when animation ends.
|
|
3245
|
+
* @ko 에니메이션이 끝났을 때 발생한다.
|
|
3246
|
+
* @event Axes#animationEnd
|
|
3247
|
+
* @type {object}
|
|
3248
|
+
* @property {Boolean} isTrusted Returns true if an event was generated by the user action, or false if it was caused by a script or API call <ko>사용자의 액션에 의해 이벤트가 발생하였으면 true, 스크립트나 API호출에 의해 발생하였을 경우에는 false를 반환한다.</ko>
|
|
3249
|
+
*
|
|
3250
|
+
* @example
|
|
3251
|
+
* ```js
|
|
3252
|
+
* const axes = new eg.Axes({
|
|
3253
|
+
* "x": {
|
|
3254
|
+
* range: [0, 100]
|
|
3255
|
+
* },
|
|
3256
|
+
* "zoom": {
|
|
3257
|
+
* range: [50, 30]
|
|
3258
|
+
* }
|
|
3259
|
+
* }).on("animationEnd", function(event) {
|
|
3260
|
+
* // event.isTrusted
|
|
3261
|
+
* });
|
|
3262
|
+
* ```
|
|
3336
3263
|
*/
|
|
3337
|
-
|
|
3338
|
-
|
|
3339
3264
|
__proto.triggerAnimationEnd = function (isTrusted) {
|
|
3340
3265
|
if (isTrusted === void 0) {
|
|
3341
3266
|
isTrusted = false;
|
|
3342
3267
|
}
|
|
3343
|
-
|
|
3344
3268
|
this._axes.trigger(new ComponentEvent$1("animationEnd", {
|
|
3345
3269
|
isTrusted: isTrusted
|
|
3346
3270
|
}));
|
|
3347
3271
|
};
|
|
3348
|
-
/**
|
|
3349
|
-
* This event is fired when all actions have been completed.
|
|
3350
|
-
* @ko 에니메이션이 끝났을 때 발생한다.
|
|
3351
|
-
* @event Axes#finish
|
|
3352
|
-
* @type {object}
|
|
3353
|
-
* @property {Boolean} isTrusted Returns true if an event was generated by the user action, or false if it was caused by a script or API call <ko>사용자의 액션에 의해 이벤트가 발생하였으면 true, 스크립트나 API호출에 의해 발생하였을 경우에는 false를 반환한다.</ko>
|
|
3354
|
-
*
|
|
3355
|
-
* @example
|
|
3356
|
-
* ```js
|
|
3357
|
-
* const axes = new eg.Axes({
|
|
3358
|
-
* "x": {
|
|
3359
|
-
* range: [0, 100]
|
|
3360
|
-
* },
|
|
3361
|
-
* "zoom": {
|
|
3362
|
-
* range: [50, 30]
|
|
3363
|
-
* }
|
|
3364
|
-
* }).on("finish", function(event) {
|
|
3365
|
-
* // event.isTrusted
|
|
3366
|
-
* });
|
|
3367
|
-
* ```
|
|
3272
|
+
/**
|
|
3273
|
+
* This event is fired when all actions have been completed.
|
|
3274
|
+
* @ko 에니메이션이 끝났을 때 발생한다.
|
|
3275
|
+
* @event Axes#finish
|
|
3276
|
+
* @type {object}
|
|
3277
|
+
* @property {Boolean} isTrusted Returns true if an event was generated by the user action, or false if it was caused by a script or API call <ko>사용자의 액션에 의해 이벤트가 발생하였으면 true, 스크립트나 API호출에 의해 발생하였을 경우에는 false를 반환한다.</ko>
|
|
3278
|
+
*
|
|
3279
|
+
* @example
|
|
3280
|
+
* ```js
|
|
3281
|
+
* const axes = new eg.Axes({
|
|
3282
|
+
* "x": {
|
|
3283
|
+
* range: [0, 100]
|
|
3284
|
+
* },
|
|
3285
|
+
* "zoom": {
|
|
3286
|
+
* range: [50, 30]
|
|
3287
|
+
* }
|
|
3288
|
+
* }).on("finish", function(event) {
|
|
3289
|
+
* // event.isTrusted
|
|
3290
|
+
* });
|
|
3291
|
+
* ```
|
|
3368
3292
|
*/
|
|
3369
|
-
|
|
3370
|
-
|
|
3371
3293
|
__proto.triggerFinish = function (isTrusted) {
|
|
3372
3294
|
if (isTrusted === void 0) {
|
|
3373
3295
|
isTrusted = false;
|
|
3374
3296
|
}
|
|
3375
|
-
|
|
3376
3297
|
this._axes.trigger(new ComponentEvent$1("finish", {
|
|
3377
3298
|
isTrusted: isTrusted
|
|
3378
3299
|
}));
|
|
3379
3300
|
};
|
|
3380
|
-
|
|
3381
3301
|
__proto.setAnimationManager = function (animationManager) {
|
|
3382
3302
|
this.animationManager = animationManager;
|
|
3383
3303
|
};
|
|
3384
|
-
|
|
3385
3304
|
__proto.destroy = function () {
|
|
3386
3305
|
this._axes.off();
|
|
3387
3306
|
};
|
|
3388
|
-
|
|
3389
3307
|
__proto._createUserControll = function (pos, duration) {
|
|
3390
3308
|
if (duration === void 0) {
|
|
3391
3309
|
duration = 0;
|
|
3392
|
-
}
|
|
3393
|
-
|
|
3394
|
-
|
|
3310
|
+
}
|
|
3311
|
+
// to controll
|
|
3395
3312
|
var userControl = {
|
|
3396
3313
|
destPos: __assign$1({}, pos),
|
|
3397
3314
|
duration: duration
|
|
@@ -3400,27 +3317,23 @@ version: 4.10.8-beta.1
|
|
|
3400
3317
|
if (toPos) {
|
|
3401
3318
|
userControl.destPos = __assign$1({}, toPos);
|
|
3402
3319
|
}
|
|
3403
|
-
|
|
3404
3320
|
if (userDuration !== undefined) {
|
|
3405
3321
|
userControl.duration = userDuration;
|
|
3406
3322
|
}
|
|
3407
|
-
|
|
3408
3323
|
return userControl;
|
|
3409
3324
|
};
|
|
3410
3325
|
};
|
|
3411
|
-
|
|
3412
3326
|
__proto._getRoundPos = function (pos, depaPos) {
|
|
3413
3327
|
// round value if round exist
|
|
3414
|
-
var roundUnit = this._axes.options.round;
|
|
3328
|
+
var roundUnit = this._axes.options.round;
|
|
3329
|
+
// if (round == null) {
|
|
3415
3330
|
// return {pos, depaPos}; // undefined, undefined
|
|
3416
3331
|
// }
|
|
3417
|
-
|
|
3418
3332
|
return {
|
|
3419
3333
|
roundPos: roundNumbers(pos, roundUnit),
|
|
3420
3334
|
roundDepa: roundNumbers(depaPos, roundUnit)
|
|
3421
3335
|
};
|
|
3422
3336
|
};
|
|
3423
|
-
|
|
3424
3337
|
__proto._getBounceRatio = function (pos) {
|
|
3425
3338
|
return this._axes.axisManager.map(pos, function (v, opt) {
|
|
3426
3339
|
if (v < opt.range[0] && opt.bounce[0] !== 0) {
|
|
@@ -3432,43 +3345,34 @@ version: 4.10.8-beta.1
|
|
|
3432
3345
|
}
|
|
3433
3346
|
});
|
|
3434
3347
|
};
|
|
3435
|
-
|
|
3436
3348
|
__decorate([Observe], EventManager.prototype, "holdingCount", void 0);
|
|
3437
|
-
|
|
3438
3349
|
return EventManager;
|
|
3439
3350
|
}();
|
|
3440
3351
|
|
|
3441
|
-
var InterruptManager =
|
|
3442
|
-
/*#__PURE__*/
|
|
3443
|
-
function () {
|
|
3352
|
+
var InterruptManager = /*#__PURE__*/function () {
|
|
3444
3353
|
function InterruptManager(_options) {
|
|
3445
3354
|
this._options = _options;
|
|
3446
3355
|
this._prevented = false; // check whether the animation event was prevented
|
|
3447
3356
|
}
|
|
3448
|
-
|
|
3449
3357
|
var __proto = InterruptManager.prototype;
|
|
3450
|
-
|
|
3451
3358
|
__proto.isInterrupting = function () {
|
|
3452
3359
|
// when interruptable is 'true', return value is always 'true'.
|
|
3453
3360
|
return this._options.interruptable || this._prevented;
|
|
3454
3361
|
};
|
|
3455
|
-
|
|
3456
3362
|
__proto.isInterrupted = function () {
|
|
3457
3363
|
return !this._options.interruptable && this._prevented;
|
|
3458
3364
|
};
|
|
3459
|
-
|
|
3460
3365
|
__proto.setInterrupt = function (prevented) {
|
|
3461
3366
|
if (!this._options.interruptable) {
|
|
3462
3367
|
this._prevented = prevented;
|
|
3463
3368
|
}
|
|
3464
3369
|
};
|
|
3465
|
-
|
|
3466
3370
|
return InterruptManager;
|
|
3467
3371
|
}();
|
|
3468
3372
|
|
|
3469
|
-
/*
|
|
3470
|
-
* Copyright (c) 2015 NAVER Corp.
|
|
3471
|
-
* egjs projects are licensed under the MIT license
|
|
3373
|
+
/*
|
|
3374
|
+
* Copyright (c) 2015 NAVER Corp.
|
|
3375
|
+
* egjs projects are licensed under the MIT license
|
|
3472
3376
|
*/
|
|
3473
3377
|
var getInsidePosition = function (destPos, range, circular, bounce) {
|
|
3474
3378
|
var toDestPos = destPos;
|
|
@@ -3476,18 +3380,18 @@ version: 4.10.8-beta.1
|
|
|
3476
3380
|
toDestPos = Math.max(targetRange[0], toDestPos);
|
|
3477
3381
|
toDestPos = Math.min(targetRange[1], toDestPos);
|
|
3478
3382
|
return toDestPos;
|
|
3479
|
-
};
|
|
3480
|
-
|
|
3383
|
+
};
|
|
3384
|
+
// determine outside
|
|
3481
3385
|
var isOutside = function (pos, range) {
|
|
3482
3386
|
return pos < range[0] || pos > range[1];
|
|
3483
|
-
};
|
|
3484
|
-
|
|
3387
|
+
};
|
|
3388
|
+
// determine whether position has reached the maximum moveable area
|
|
3485
3389
|
var isEndofBounce = function (pos, range, bounce, circular) {
|
|
3486
3390
|
return !circular[0] && pos === range[0] - bounce[0] || !circular[1] && pos === range[1] + bounce[1];
|
|
3487
3391
|
};
|
|
3488
3392
|
var getDuration = function (distance, deceleration) {
|
|
3489
|
-
var duration = Math.sqrt(distance / deceleration * 2);
|
|
3490
|
-
|
|
3393
|
+
var duration = Math.sqrt(distance / deceleration * 2);
|
|
3394
|
+
// when duration is under 100, then value is zero
|
|
3491
3395
|
return duration < 100 ? 0 : duration;
|
|
3492
3396
|
};
|
|
3493
3397
|
var isCircularable = function (destPos, range, circular) {
|
|
@@ -3498,66 +3402,51 @@ version: 4.10.8-beta.1
|
|
|
3498
3402
|
var min = range[0];
|
|
3499
3403
|
var max = range[1];
|
|
3500
3404
|
var length = max - min;
|
|
3501
|
-
|
|
3502
3405
|
if (circular[1] && pos > max) {
|
|
3503
3406
|
// right
|
|
3504
3407
|
toPos = (toPos - max) % length + min;
|
|
3505
3408
|
}
|
|
3506
|
-
|
|
3507
3409
|
if (circular[0] && pos < min) {
|
|
3508
3410
|
// left
|
|
3509
3411
|
toPos = (toPos - min) % length + max;
|
|
3510
3412
|
}
|
|
3511
|
-
|
|
3512
3413
|
return toPos;
|
|
3513
3414
|
};
|
|
3514
3415
|
|
|
3515
|
-
var AxisManager =
|
|
3516
|
-
/*#__PURE__*/
|
|
3517
|
-
function () {
|
|
3416
|
+
var AxisManager = /*#__PURE__*/function () {
|
|
3518
3417
|
function AxisManager(_axis) {
|
|
3519
3418
|
var _this = this;
|
|
3520
|
-
|
|
3521
3419
|
this._axis = _axis;
|
|
3522
|
-
|
|
3523
3420
|
this._complementOptions();
|
|
3524
|
-
|
|
3525
3421
|
this._pos = Object.keys(this._axis).reduce(function (pos, v) {
|
|
3526
3422
|
pos[v] = _this._axis[v].startPos;
|
|
3527
3423
|
return pos;
|
|
3528
3424
|
}, {});
|
|
3529
3425
|
}
|
|
3530
|
-
|
|
3531
3426
|
var __proto = AxisManager.prototype;
|
|
3532
|
-
|
|
3533
3427
|
__proto.getDelta = function (depaPos, destPos) {
|
|
3534
3428
|
var fullDepaPos = this.get(depaPos);
|
|
3535
3429
|
return map(this.get(destPos), function (v, k) {
|
|
3536
3430
|
return v - fullDepaPos[k];
|
|
3537
3431
|
});
|
|
3538
3432
|
};
|
|
3539
|
-
|
|
3540
3433
|
__proto.get = function (axes) {
|
|
3541
3434
|
var _this = this;
|
|
3542
|
-
|
|
3543
3435
|
if (axes && Array.isArray(axes)) {
|
|
3544
3436
|
return axes.reduce(function (acc, v) {
|
|
3545
3437
|
if (v && v in _this._pos) {
|
|
3546
3438
|
acc[v] = _this._pos[v];
|
|
3547
3439
|
}
|
|
3548
|
-
|
|
3549
3440
|
return acc;
|
|
3550
3441
|
}, {});
|
|
3551
3442
|
} else {
|
|
3552
3443
|
return __assign$1(__assign$1({}, this._pos), axes || {});
|
|
3553
3444
|
}
|
|
3554
3445
|
};
|
|
3555
|
-
|
|
3556
3446
|
__proto.moveTo = function (pos, depaPos) {
|
|
3557
3447
|
if (depaPos === void 0) {
|
|
3558
3448
|
depaPos = this._pos;
|
|
3559
3449
|
}
|
|
3560
|
-
|
|
3561
3450
|
var delta = map(this._pos, function (v, key) {
|
|
3562
3451
|
return key in pos && key in depaPos ? pos[key] - depaPos[key] : 0;
|
|
3563
3452
|
});
|
|
@@ -3569,7 +3458,6 @@ version: 4.10.8-beta.1
|
|
|
3569
3458
|
delta: delta
|
|
3570
3459
|
};
|
|
3571
3460
|
};
|
|
3572
|
-
|
|
3573
3461
|
__proto.set = function (pos) {
|
|
3574
3462
|
for (var k in pos) {
|
|
3575
3463
|
if (k && k in this._pos) {
|
|
@@ -3577,60 +3465,48 @@ version: 4.10.8-beta.1
|
|
|
3577
3465
|
}
|
|
3578
3466
|
}
|
|
3579
3467
|
};
|
|
3580
|
-
|
|
3581
3468
|
__proto.every = function (pos, callback) {
|
|
3582
3469
|
var axisOptions = this._axis;
|
|
3583
3470
|
return every(pos, function (value, key) {
|
|
3584
3471
|
return callback(value, axisOptions[key], key);
|
|
3585
3472
|
});
|
|
3586
3473
|
};
|
|
3587
|
-
|
|
3588
3474
|
__proto.filter = function (pos, callback) {
|
|
3589
3475
|
var axisOptions = this._axis;
|
|
3590
3476
|
return filter(pos, function (value, key) {
|
|
3591
3477
|
return callback(value, axisOptions[key], key);
|
|
3592
3478
|
});
|
|
3593
3479
|
};
|
|
3594
|
-
|
|
3595
3480
|
__proto.map = function (pos, callback) {
|
|
3596
3481
|
var axisOptions = this._axis;
|
|
3597
3482
|
return map(pos, function (value, key) {
|
|
3598
3483
|
return callback(value, axisOptions[key], key);
|
|
3599
3484
|
});
|
|
3600
3485
|
};
|
|
3601
|
-
|
|
3602
3486
|
__proto.isOutside = function (axes) {
|
|
3603
3487
|
return !this.every(axes ? this.get(axes) : this._pos, function (v, opt) {
|
|
3604
3488
|
return !isOutside(v, opt.range);
|
|
3605
3489
|
});
|
|
3606
3490
|
};
|
|
3607
|
-
|
|
3608
3491
|
__proto.getAxisOptions = function (key) {
|
|
3609
3492
|
return this._axis[key];
|
|
3610
3493
|
};
|
|
3611
|
-
|
|
3612
3494
|
__proto.setAxis = function (axis) {
|
|
3613
3495
|
var _this = this;
|
|
3614
|
-
|
|
3615
3496
|
Object.keys(axis).forEach(function (key) {
|
|
3616
3497
|
if (!_this._axis[key]) {
|
|
3617
3498
|
throw new Error("Axis ".concat(key, " does not exist in Axes instance"));
|
|
3618
3499
|
}
|
|
3619
|
-
|
|
3620
3500
|
_this._axis[key] = __assign$1(__assign$1({}, _this._axis[key]), axis[key]);
|
|
3621
3501
|
});
|
|
3622
|
-
|
|
3623
3502
|
this._complementOptions();
|
|
3624
3503
|
};
|
|
3625
|
-
/**
|
|
3626
|
-
* set up 'css' expression
|
|
3627
|
-
* @private
|
|
3504
|
+
/**
|
|
3505
|
+
* set up 'css' expression
|
|
3506
|
+
* @private
|
|
3628
3507
|
*/
|
|
3629
|
-
|
|
3630
|
-
|
|
3631
3508
|
__proto._complementOptions = function () {
|
|
3632
3509
|
var _this = this;
|
|
3633
|
-
|
|
3634
3510
|
Object.keys(this._axis).forEach(function (axis) {
|
|
3635
3511
|
_this._axis[axis] = __assign$1({
|
|
3636
3512
|
range: [0, 100],
|
|
@@ -3641,14 +3517,12 @@ version: 4.10.8-beta.1
|
|
|
3641
3517
|
["bounce", "circular"].forEach(function (v) {
|
|
3642
3518
|
var axisOption = _this._axis;
|
|
3643
3519
|
var key = axisOption[axis][v];
|
|
3644
|
-
|
|
3645
3520
|
if (/string|number|boolean/.test(typeof key)) {
|
|
3646
3521
|
axisOption[axis][v] = [key, key];
|
|
3647
3522
|
}
|
|
3648
3523
|
});
|
|
3649
3524
|
});
|
|
3650
3525
|
};
|
|
3651
|
-
|
|
3652
3526
|
return AxisManager;
|
|
3653
3527
|
}();
|
|
3654
3528
|
|
|
@@ -3660,31 +3534,21 @@ version: 4.10.8-beta.1
|
|
|
3660
3534
|
if (!inputKey || inputKey.indexOf(ANY) > -1 || inputKey.indexOf(NONE) > -1 && !event.shiftKey && !event.ctrlKey && !event.altKey && !event.metaKey || inputKey.indexOf(SHIFT) > -1 && event.shiftKey || inputKey.indexOf(CTRL) > -1 && event.ctrlKey || inputKey.indexOf(ALT) > -1 && event.altKey || inputKey.indexOf(META) > -1 && event.metaKey) {
|
|
3661
3535
|
return true;
|
|
3662
3536
|
}
|
|
3663
|
-
|
|
3664
3537
|
return false;
|
|
3665
3538
|
};
|
|
3666
|
-
|
|
3667
|
-
var EventInput =
|
|
3668
|
-
/*#__PURE__*/
|
|
3669
|
-
function () {
|
|
3539
|
+
var EventInput = /*#__PURE__*/function () {
|
|
3670
3540
|
function EventInput() {
|
|
3671
3541
|
var _this = this;
|
|
3672
|
-
|
|
3673
3542
|
this._stopContextMenu = function (event) {
|
|
3674
3543
|
event.preventDefault();
|
|
3675
3544
|
win.removeEventListener("contextmenu", _this._stopContextMenu);
|
|
3676
3545
|
};
|
|
3677
3546
|
}
|
|
3678
|
-
|
|
3679
3547
|
var __proto = EventInput.prototype;
|
|
3680
|
-
|
|
3681
3548
|
__proto.extendEvent = function (event) {
|
|
3682
3549
|
var _a;
|
|
3683
|
-
|
|
3684
3550
|
var prevEvent = this.prevEvent;
|
|
3685
|
-
|
|
3686
3551
|
var center = this._getCenter(event);
|
|
3687
|
-
|
|
3688
3552
|
var movement = prevEvent ? this._getMovement(event) : {
|
|
3689
3553
|
x: 0,
|
|
3690
3554
|
y: 0
|
|
@@ -3700,19 +3564,16 @@ version: 4.10.8-beta.1
|
|
|
3700
3564
|
var deltaTime = latestInterval ? timeStamp - latestInterval.timestamp : 0;
|
|
3701
3565
|
var velocityX = prevEvent ? prevEvent.velocityX : 0;
|
|
3702
3566
|
var velocityY = prevEvent ? prevEvent.velocityY : 0;
|
|
3703
|
-
|
|
3704
3567
|
if (!latestInterval || deltaTime >= VELOCITY_INTERVAL) {
|
|
3705
3568
|
if (latestInterval) {
|
|
3706
3569
|
_a = [(deltaX - latestInterval.deltaX) / deltaTime, (deltaY - latestInterval.deltaY) / deltaTime], velocityX = _a[0], velocityY = _a[1];
|
|
3707
3570
|
}
|
|
3708
|
-
|
|
3709
3571
|
this._latestInterval = {
|
|
3710
3572
|
timestamp: timeStamp,
|
|
3711
3573
|
deltaX: deltaX,
|
|
3712
3574
|
deltaY: deltaY
|
|
3713
3575
|
};
|
|
3714
3576
|
}
|
|
3715
|
-
|
|
3716
3577
|
return {
|
|
3717
3578
|
srcEvent: event,
|
|
3718
3579
|
scale: scale,
|
|
@@ -3727,13 +3588,11 @@ version: 4.10.8-beta.1
|
|
|
3727
3588
|
preventSystemEvent: true
|
|
3728
3589
|
};
|
|
3729
3590
|
};
|
|
3730
|
-
|
|
3731
3591
|
__proto._getDistance = function (start, end) {
|
|
3732
3592
|
var x = end.clientX - start.clientX;
|
|
3733
3593
|
var y = end.clientY - start.clientY;
|
|
3734
3594
|
return Math.sqrt(x * x + y * y);
|
|
3735
3595
|
};
|
|
3736
|
-
|
|
3737
3596
|
__proto._getButton = function (event) {
|
|
3738
3597
|
var buttonCodeMap = {
|
|
3739
3598
|
1: MOUSE_LEFT,
|
|
@@ -3743,19 +3602,15 @@ version: 4.10.8-beta.1
|
|
|
3743
3602
|
var button = this._isTouchEvent(event) ? MOUSE_LEFT : buttonCodeMap[event.buttons];
|
|
3744
3603
|
return button ? button : null;
|
|
3745
3604
|
};
|
|
3746
|
-
|
|
3747
3605
|
__proto._isTouchEvent = function (event) {
|
|
3748
3606
|
return event.type && event.type.indexOf("touch") > -1;
|
|
3749
3607
|
};
|
|
3750
|
-
|
|
3751
3608
|
__proto._isValidButton = function (button, inputButton) {
|
|
3752
3609
|
return inputButton.indexOf(button) > -1;
|
|
3753
3610
|
};
|
|
3754
|
-
|
|
3755
3611
|
__proto._isValidEvent = function (event, inputKey, inputButton) {
|
|
3756
3612
|
return (!inputKey || isValidKey(event, inputKey)) && (!inputButton || this._isValidButton(this._getButton(event), inputButton));
|
|
3757
3613
|
};
|
|
3758
|
-
|
|
3759
3614
|
__proto._preventMouseButton = function (event, button) {
|
|
3760
3615
|
if (button === MOUSE_RIGHT) {
|
|
3761
3616
|
win.addEventListener("contextmenu", this._stopContextMenu);
|
|
@@ -3763,74 +3618,55 @@ version: 4.10.8-beta.1
|
|
|
3763
3618
|
event.preventDefault();
|
|
3764
3619
|
}
|
|
3765
3620
|
};
|
|
3766
|
-
|
|
3767
3621
|
return EventInput;
|
|
3768
3622
|
}();
|
|
3769
3623
|
|
|
3770
|
-
var MouseEventInput =
|
|
3771
|
-
/*#__PURE__*/
|
|
3772
|
-
function (_super) {
|
|
3624
|
+
var MouseEventInput = /*#__PURE__*/function (_super) {
|
|
3773
3625
|
__extends$1(MouseEventInput, _super);
|
|
3774
|
-
|
|
3775
3626
|
function MouseEventInput() {
|
|
3776
3627
|
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
3777
|
-
|
|
3778
3628
|
_this.start = ["mousedown"];
|
|
3779
3629
|
_this.move = ["mousemove"];
|
|
3780
3630
|
_this.end = ["mouseup"];
|
|
3781
3631
|
return _this;
|
|
3782
3632
|
}
|
|
3783
|
-
|
|
3784
3633
|
var __proto = MouseEventInput.prototype;
|
|
3785
|
-
|
|
3786
3634
|
__proto.onEventStart = function (event, inputKey, inputButton) {
|
|
3787
3635
|
var button = this._getButton(event);
|
|
3788
|
-
|
|
3789
3636
|
if (!this._isValidEvent(event, inputKey, inputButton)) {
|
|
3790
3637
|
return null;
|
|
3791
3638
|
}
|
|
3792
|
-
|
|
3793
3639
|
this._preventMouseButton(event, button);
|
|
3794
|
-
|
|
3795
3640
|
return this.extendEvent(event);
|
|
3796
3641
|
};
|
|
3797
|
-
|
|
3798
3642
|
__proto.onEventMove = function (event, inputKey, inputButton) {
|
|
3799
3643
|
if (!this._isValidEvent(event, inputKey, inputButton)) {
|
|
3800
3644
|
return null;
|
|
3801
3645
|
}
|
|
3802
|
-
|
|
3803
3646
|
return this.extendEvent(event);
|
|
3804
3647
|
};
|
|
3805
|
-
|
|
3806
3648
|
__proto.onEventEnd = function () {
|
|
3807
3649
|
return;
|
|
3808
3650
|
};
|
|
3809
|
-
|
|
3810
3651
|
__proto.onRelease = function () {
|
|
3811
3652
|
this.prevEvent = null;
|
|
3812
3653
|
return;
|
|
3813
3654
|
};
|
|
3814
|
-
|
|
3815
3655
|
__proto.getTouches = function (event, inputButton) {
|
|
3816
3656
|
if (inputButton) {
|
|
3817
3657
|
return this._isValidButton(MOUSE_BUTTON_CODE_MAP[event.which], inputButton) && this.end.indexOf(event.type) === -1 ? 1 : 0;
|
|
3818
3658
|
}
|
|
3819
|
-
|
|
3820
3659
|
return 0;
|
|
3821
3660
|
};
|
|
3822
|
-
|
|
3823
3661
|
__proto._getScale = function () {
|
|
3824
3662
|
return 1;
|
|
3825
3663
|
};
|
|
3826
|
-
|
|
3827
3664
|
__proto._getCenter = function (event) {
|
|
3828
3665
|
return {
|
|
3829
3666
|
x: event.clientX,
|
|
3830
3667
|
y: event.clientY
|
|
3831
3668
|
};
|
|
3832
3669
|
};
|
|
3833
|
-
|
|
3834
3670
|
__proto._getMovement = function (event) {
|
|
3835
3671
|
var prev = this.prevEvent.srcEvent;
|
|
3836
3672
|
return {
|
|
@@ -3838,59 +3674,44 @@ version: 4.10.8-beta.1
|
|
|
3838
3674
|
y: event.clientY - prev.clientY
|
|
3839
3675
|
};
|
|
3840
3676
|
};
|
|
3841
|
-
|
|
3842
3677
|
return MouseEventInput;
|
|
3843
3678
|
}(EventInput);
|
|
3844
3679
|
|
|
3845
|
-
var TouchEventInput =
|
|
3846
|
-
/*#__PURE__*/
|
|
3847
|
-
function (_super) {
|
|
3680
|
+
var TouchEventInput = /*#__PURE__*/function (_super) {
|
|
3848
3681
|
__extends$1(TouchEventInput, _super);
|
|
3849
|
-
|
|
3850
3682
|
function TouchEventInput() {
|
|
3851
3683
|
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
3852
|
-
|
|
3853
3684
|
_this.start = ["touchstart"];
|
|
3854
3685
|
_this.move = ["touchmove"];
|
|
3855
3686
|
_this.end = ["touchend", "touchcancel"];
|
|
3856
3687
|
return _this;
|
|
3857
3688
|
}
|
|
3858
|
-
|
|
3859
3689
|
var __proto = TouchEventInput.prototype;
|
|
3860
|
-
|
|
3861
3690
|
__proto.onEventStart = function (event, inputKey) {
|
|
3862
3691
|
this._baseTouches = event.touches;
|
|
3863
|
-
|
|
3864
3692
|
if (!this._isValidEvent(event, inputKey)) {
|
|
3865
3693
|
return null;
|
|
3866
3694
|
}
|
|
3867
|
-
|
|
3868
3695
|
return this.extendEvent(event);
|
|
3869
3696
|
};
|
|
3870
|
-
|
|
3871
3697
|
__proto.onEventMove = function (event, inputKey) {
|
|
3872
3698
|
if (!this._isValidEvent(event, inputKey)) {
|
|
3873
3699
|
return null;
|
|
3874
3700
|
}
|
|
3875
|
-
|
|
3876
3701
|
return this.extendEvent(event);
|
|
3877
3702
|
};
|
|
3878
|
-
|
|
3879
3703
|
__proto.onEventEnd = function (event) {
|
|
3880
3704
|
this._baseTouches = event.touches;
|
|
3881
3705
|
return;
|
|
3882
3706
|
};
|
|
3883
|
-
|
|
3884
3707
|
__proto.onRelease = function () {
|
|
3885
3708
|
this.prevEvent = null;
|
|
3886
3709
|
this._baseTouches = null;
|
|
3887
3710
|
return;
|
|
3888
3711
|
};
|
|
3889
|
-
|
|
3890
3712
|
__proto.getTouches = function (event) {
|
|
3891
3713
|
return event.touches.length;
|
|
3892
3714
|
};
|
|
3893
|
-
|
|
3894
3715
|
__proto._getScale = function (event) {
|
|
3895
3716
|
if (event.touches.length !== 2 || this._baseTouches.length < 2) {
|
|
3896
3717
|
return null; // TODO: consider calculating non-pinch gesture scale
|
|
@@ -3898,91 +3719,69 @@ version: 4.10.8-beta.1
|
|
|
3898
3719
|
|
|
3899
3720
|
return this._getDistance(event.touches[0], event.touches[1]) / this._getDistance(this._baseTouches[0], this._baseTouches[1]);
|
|
3900
3721
|
};
|
|
3901
|
-
|
|
3902
3722
|
__proto._getCenter = function (event) {
|
|
3903
3723
|
return {
|
|
3904
3724
|
x: event.touches[0].clientX,
|
|
3905
3725
|
y: event.touches[0].clientY
|
|
3906
3726
|
};
|
|
3907
3727
|
};
|
|
3908
|
-
|
|
3909
3728
|
__proto._getMovement = function (event) {
|
|
3910
3729
|
var prev = this.prevEvent.srcEvent;
|
|
3911
|
-
|
|
3912
3730
|
if (event.touches[0].identifier !== prev.touches[0].identifier) {
|
|
3913
3731
|
return {
|
|
3914
3732
|
x: 0,
|
|
3915
3733
|
y: 0
|
|
3916
3734
|
};
|
|
3917
3735
|
}
|
|
3918
|
-
|
|
3919
3736
|
return {
|
|
3920
3737
|
x: event.touches[0].clientX - prev.touches[0].clientX,
|
|
3921
3738
|
y: event.touches[0].clientY - prev.touches[0].clientY
|
|
3922
3739
|
};
|
|
3923
3740
|
};
|
|
3924
|
-
|
|
3925
3741
|
return TouchEventInput;
|
|
3926
3742
|
}(EventInput);
|
|
3927
3743
|
|
|
3928
|
-
var PointerEventInput =
|
|
3929
|
-
/*#__PURE__*/
|
|
3930
|
-
function (_super) {
|
|
3744
|
+
var PointerEventInput = /*#__PURE__*/function (_super) {
|
|
3931
3745
|
__extends$1(PointerEventInput, _super);
|
|
3932
|
-
|
|
3933
3746
|
function PointerEventInput() {
|
|
3934
3747
|
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
3935
|
-
|
|
3936
3748
|
_this.start = SUPPORT_POINTER ? ["pointerdown"] : ["MSPointerDown"];
|
|
3937
3749
|
_this.move = SUPPORT_POINTER ? ["pointermove"] : ["MSPointerMove"];
|
|
3938
|
-
_this.end = SUPPORT_POINTER ? ["pointerup", "pointercancel"] : ["MSPointerUp", "MSPointerCancel"];
|
|
3939
|
-
|
|
3750
|
+
_this.end = SUPPORT_POINTER ? ["pointerup", "pointercancel"] : ["MSPointerUp", "MSPointerCancel"];
|
|
3751
|
+
// store first, recent inputs for each event id
|
|
3940
3752
|
_this._firstInputs = [];
|
|
3941
3753
|
_this._recentInputs = [];
|
|
3942
3754
|
return _this;
|
|
3943
3755
|
}
|
|
3944
|
-
|
|
3945
3756
|
var __proto = PointerEventInput.prototype;
|
|
3946
|
-
|
|
3947
3757
|
__proto.onEventStart = function (event, inputKey, inputButton) {
|
|
3948
3758
|
var button = this._getButton(event);
|
|
3949
|
-
|
|
3950
3759
|
if (!this._isValidEvent(event, inputKey, inputButton)) {
|
|
3951
3760
|
return null;
|
|
3952
3761
|
}
|
|
3953
|
-
|
|
3954
3762
|
this._preventMouseButton(event, button);
|
|
3955
|
-
|
|
3956
3763
|
this._updatePointerEvent(event);
|
|
3957
|
-
|
|
3958
3764
|
return this.extendEvent(event);
|
|
3959
3765
|
};
|
|
3960
|
-
|
|
3961
3766
|
__proto.onEventMove = function (event, inputKey, inputButton) {
|
|
3962
3767
|
if (!this._isValidEvent(event, inputKey, inputButton)) {
|
|
3963
3768
|
return null;
|
|
3964
3769
|
}
|
|
3965
|
-
|
|
3966
3770
|
this._updatePointerEvent(event);
|
|
3967
|
-
|
|
3968
3771
|
return this.extendEvent(event);
|
|
3969
3772
|
};
|
|
3970
|
-
|
|
3971
3773
|
__proto.onEventEnd = function (event) {
|
|
3972
3774
|
this._removePointerEvent(event);
|
|
3973
3775
|
};
|
|
3974
|
-
|
|
3975
3776
|
__proto.onRelease = function () {
|
|
3976
3777
|
this.prevEvent = null;
|
|
3977
3778
|
this._firstInputs = [];
|
|
3978
3779
|
this._recentInputs = [];
|
|
3979
3780
|
return;
|
|
3980
3781
|
};
|
|
3981
|
-
|
|
3982
3782
|
__proto.getTouches = function () {
|
|
3983
3783
|
return this._recentInputs.length;
|
|
3984
3784
|
};
|
|
3985
|
-
|
|
3986
3785
|
__proto._getScale = function () {
|
|
3987
3786
|
if (this._recentInputs.length !== 2) {
|
|
3988
3787
|
return null; // TODO: consider calculating non-pinch gesture scale
|
|
@@ -3990,49 +3789,39 @@ version: 4.10.8-beta.1
|
|
|
3990
3789
|
|
|
3991
3790
|
return this._getDistance(this._recentInputs[0], this._recentInputs[1]) / this._getDistance(this._firstInputs[0], this._firstInputs[1]);
|
|
3992
3791
|
};
|
|
3993
|
-
|
|
3994
3792
|
__proto._getCenter = function (event) {
|
|
3995
3793
|
return {
|
|
3996
3794
|
x: event.clientX,
|
|
3997
3795
|
y: event.clientY
|
|
3998
3796
|
};
|
|
3999
3797
|
};
|
|
4000
|
-
|
|
4001
3798
|
__proto._getMovement = function (event) {
|
|
4002
3799
|
var prev = this.prevEvent.srcEvent;
|
|
4003
|
-
|
|
4004
3800
|
if (event.pointerId !== prev.pointerId) {
|
|
4005
3801
|
return {
|
|
4006
3802
|
x: 0,
|
|
4007
3803
|
y: 0
|
|
4008
3804
|
};
|
|
4009
3805
|
}
|
|
4010
|
-
|
|
4011
3806
|
return {
|
|
4012
3807
|
x: event.clientX - prev.clientX,
|
|
4013
3808
|
y: event.clientY - prev.clientY
|
|
4014
3809
|
};
|
|
4015
3810
|
};
|
|
4016
|
-
|
|
4017
3811
|
__proto._updatePointerEvent = function (event) {
|
|
4018
3812
|
var _this = this;
|
|
4019
|
-
|
|
4020
3813
|
var addFlag = false;
|
|
4021
|
-
|
|
4022
3814
|
this._recentInputs.forEach(function (e, i) {
|
|
4023
3815
|
if (e.pointerId === event.pointerId) {
|
|
4024
3816
|
addFlag = true;
|
|
4025
3817
|
_this._recentInputs[i] = event;
|
|
4026
3818
|
}
|
|
4027
3819
|
});
|
|
4028
|
-
|
|
4029
3820
|
if (!addFlag) {
|
|
4030
3821
|
this._firstInputs.push(event);
|
|
4031
|
-
|
|
4032
3822
|
this._recentInputs.push(event);
|
|
4033
3823
|
}
|
|
4034
3824
|
};
|
|
4035
|
-
|
|
4036
3825
|
__proto._removePointerEvent = function (event) {
|
|
4037
3826
|
this._firstInputs = this._firstInputs.filter(function (x) {
|
|
4038
3827
|
return x.pointerId !== event.pointerId;
|
|
@@ -4041,64 +3830,47 @@ version: 4.10.8-beta.1
|
|
|
4041
3830
|
return x.pointerId !== event.pointerId;
|
|
4042
3831
|
});
|
|
4043
3832
|
};
|
|
4044
|
-
|
|
4045
3833
|
return PointerEventInput;
|
|
4046
3834
|
}(EventInput);
|
|
4047
3835
|
|
|
4048
|
-
var TouchMouseEventInput =
|
|
4049
|
-
/*#__PURE__*/
|
|
4050
|
-
function (_super) {
|
|
3836
|
+
var TouchMouseEventInput = /*#__PURE__*/function (_super) {
|
|
4051
3837
|
__extends$1(TouchMouseEventInput, _super);
|
|
4052
|
-
|
|
4053
3838
|
function TouchMouseEventInput() {
|
|
4054
3839
|
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
4055
|
-
|
|
4056
3840
|
_this.start = ["mousedown", "touchstart"];
|
|
4057
3841
|
_this.move = ["mousemove", "touchmove"];
|
|
4058
3842
|
_this.end = ["mouseup", "touchend", "touchcancel"];
|
|
4059
3843
|
return _this;
|
|
4060
3844
|
}
|
|
4061
|
-
|
|
4062
3845
|
var __proto = TouchMouseEventInput.prototype;
|
|
4063
|
-
|
|
4064
3846
|
__proto.onEventStart = function (event, inputKey, inputButton) {
|
|
4065
3847
|
var button = this._getButton(event);
|
|
4066
|
-
|
|
4067
3848
|
if (this._isTouchEvent(event)) {
|
|
4068
3849
|
this._baseTouches = event.touches;
|
|
4069
3850
|
}
|
|
4070
|
-
|
|
4071
3851
|
if (!this._isValidEvent(event, inputKey, inputButton)) {
|
|
4072
3852
|
return null;
|
|
4073
3853
|
}
|
|
4074
|
-
|
|
4075
3854
|
this._preventMouseButton(event, button);
|
|
4076
|
-
|
|
4077
3855
|
return this.extendEvent(event);
|
|
4078
3856
|
};
|
|
4079
|
-
|
|
4080
3857
|
__proto.onEventMove = function (event, inputKey, inputButton) {
|
|
4081
3858
|
if (!this._isValidEvent(event, inputKey, inputButton)) {
|
|
4082
3859
|
return null;
|
|
4083
3860
|
}
|
|
4084
|
-
|
|
4085
3861
|
return this.extendEvent(event);
|
|
4086
3862
|
};
|
|
4087
|
-
|
|
4088
3863
|
__proto.onEventEnd = function (event) {
|
|
4089
3864
|
if (this._isTouchEvent(event)) {
|
|
4090
3865
|
this._baseTouches = event.touches;
|
|
4091
3866
|
}
|
|
4092
|
-
|
|
4093
3867
|
return;
|
|
4094
3868
|
};
|
|
4095
|
-
|
|
4096
3869
|
__proto.onRelease = function () {
|
|
4097
3870
|
this.prevEvent = null;
|
|
4098
3871
|
this._baseTouches = null;
|
|
4099
3872
|
return;
|
|
4100
3873
|
};
|
|
4101
|
-
|
|
4102
3874
|
__proto.getTouches = function (event, inputButton) {
|
|
4103
3875
|
if (this._isTouchEvent(event)) {
|
|
4104
3876
|
return event.touches.length;
|
|
@@ -4106,7 +3878,6 @@ version: 4.10.8-beta.1
|
|
|
4106
3878
|
return this._isValidButton(MOUSE_BUTTON_CODE_MAP[event.which], inputButton) && this.end.indexOf(event.type) === -1 ? 1 : 0;
|
|
4107
3879
|
}
|
|
4108
3880
|
};
|
|
4109
|
-
|
|
4110
3881
|
__proto._getScale = function (event) {
|
|
4111
3882
|
if (this._isTouchEvent(event)) {
|
|
4112
3883
|
if (event.touches.length !== 2 || this._baseTouches.length < 2) {
|
|
@@ -4115,10 +3886,8 @@ version: 4.10.8-beta.1
|
|
|
4115
3886
|
|
|
4116
3887
|
return this._getDistance(event.touches[0], event.touches[1]) / this._getDistance(this._baseTouches[0], this._baseTouches[1]);
|
|
4117
3888
|
}
|
|
4118
|
-
|
|
4119
3889
|
return this.prevEvent.scale;
|
|
4120
3890
|
};
|
|
4121
|
-
|
|
4122
3891
|
__proto._getCenter = function (event) {
|
|
4123
3892
|
if (this._isTouchEvent(event)) {
|
|
4124
3893
|
return {
|
|
@@ -4126,36 +3895,30 @@ version: 4.10.8-beta.1
|
|
|
4126
3895
|
y: event.touches[0].clientY
|
|
4127
3896
|
};
|
|
4128
3897
|
}
|
|
4129
|
-
|
|
4130
3898
|
return {
|
|
4131
3899
|
x: event.clientX,
|
|
4132
3900
|
y: event.clientY
|
|
4133
3901
|
};
|
|
4134
3902
|
};
|
|
4135
|
-
|
|
4136
3903
|
__proto._getMovement = function (event) {
|
|
4137
3904
|
var _this = this;
|
|
4138
|
-
|
|
4139
3905
|
var prev = this.prevEvent.srcEvent;
|
|
4140
|
-
|
|
4141
3906
|
var _a = [event, prev].map(function (e) {
|
|
4142
|
-
|
|
3907
|
+
if (_this._isTouchEvent(e)) {
|
|
3908
|
+
return {
|
|
3909
|
+
id: e.touches[0].identifier,
|
|
3910
|
+
x: e.touches[0].clientX,
|
|
3911
|
+
y: e.touches[0].clientY
|
|
3912
|
+
};
|
|
3913
|
+
}
|
|
4143
3914
|
return {
|
|
4144
|
-
id:
|
|
4145
|
-
x: e.
|
|
4146
|
-
y: e.
|
|
3915
|
+
id: null,
|
|
3916
|
+
x: e.clientX,
|
|
3917
|
+
y: e.clientY
|
|
4147
3918
|
};
|
|
4148
|
-
}
|
|
4149
|
-
|
|
4150
|
-
|
|
4151
|
-
id: null,
|
|
4152
|
-
x: e.clientX,
|
|
4153
|
-
y: e.clientY
|
|
4154
|
-
};
|
|
4155
|
-
}),
|
|
4156
|
-
nextSpot = _a[0],
|
|
4157
|
-
prevSpot = _a[1];
|
|
4158
|
-
|
|
3919
|
+
}),
|
|
3920
|
+
nextSpot = _a[0],
|
|
3921
|
+
prevSpot = _a[1];
|
|
4159
3922
|
return nextSpot.id === prevSpot.id ? {
|
|
4160
3923
|
x: nextSpot.x - prevSpot.x,
|
|
4161
3924
|
y: nextSpot.y - prevSpot.y
|
|
@@ -4164,7 +3927,6 @@ version: 4.10.8-beta.1
|
|
|
4164
3927
|
y: 0
|
|
4165
3928
|
};
|
|
4166
3929
|
};
|
|
4167
|
-
|
|
4168
3930
|
return TouchMouseEventInput;
|
|
4169
3931
|
}(EventInput);
|
|
4170
3932
|
|
|
@@ -4173,7 +3935,6 @@ version: 4.10.8-beta.1
|
|
|
4173
3935
|
if (source[i]) {
|
|
4174
3936
|
acc[source[i]] = v;
|
|
4175
3937
|
}
|
|
4176
|
-
|
|
4177
3938
|
return acc;
|
|
4178
3939
|
}, {});
|
|
4179
3940
|
};
|
|
@@ -4181,7 +3942,6 @@ version: 4.10.8-beta.1
|
|
|
4181
3942
|
if (inputType === void 0) {
|
|
4182
3943
|
inputType = [];
|
|
4183
3944
|
}
|
|
4184
|
-
|
|
4185
3945
|
var hasTouch = false;
|
|
4186
3946
|
var hasMouse = false;
|
|
4187
3947
|
var hasPointer = false;
|
|
@@ -4190,11 +3950,9 @@ version: 4.10.8-beta.1
|
|
|
4190
3950
|
case "mouse":
|
|
4191
3951
|
hasMouse = true;
|
|
4192
3952
|
break;
|
|
4193
|
-
|
|
4194
3953
|
case "touch":
|
|
4195
3954
|
hasTouch = SUPPORT_TOUCH;
|
|
4196
3955
|
break;
|
|
4197
|
-
|
|
4198
3956
|
case "pointer":
|
|
4199
3957
|
hasPointer = SUPPORT_POINTER_EVENTS;
|
|
4200
3958
|
// no default
|
|
@@ -4210,7 +3968,6 @@ version: 4.10.8-beta.1
|
|
|
4210
3968
|
} else if (hasMouse) {
|
|
4211
3969
|
return new MouseEventInput();
|
|
4212
3970
|
}
|
|
4213
|
-
|
|
4214
3971
|
return null;
|
|
4215
3972
|
};
|
|
4216
3973
|
function getAddEventOptions(eventName) {
|
|
@@ -4221,15 +3978,13 @@ version: 4.10.8-beta.1
|
|
|
4221
3978
|
} : false;
|
|
4222
3979
|
}
|
|
4223
3980
|
|
|
4224
|
-
var InputObserver =
|
|
4225
|
-
/*#__PURE__*/
|
|
4226
|
-
function () {
|
|
3981
|
+
var InputObserver = /*#__PURE__*/function () {
|
|
4227
3982
|
function InputObserver(_a) {
|
|
4228
3983
|
var options = _a.options,
|
|
4229
|
-
|
|
4230
|
-
|
|
4231
|
-
|
|
4232
|
-
|
|
3984
|
+
interruptManager = _a.interruptManager,
|
|
3985
|
+
eventManager = _a.eventManager,
|
|
3986
|
+
axisManager = _a.axisManager,
|
|
3987
|
+
animationManager = _a.animationManager;
|
|
4233
3988
|
this._isOutside = false;
|
|
4234
3989
|
this._moveDistance = null;
|
|
4235
3990
|
this._isStopped = false;
|
|
@@ -4239,123 +3994,92 @@ version: 4.10.8-beta.1
|
|
|
4239
3994
|
this._axisManager = axisManager;
|
|
4240
3995
|
this._animationManager = animationManager;
|
|
4241
3996
|
}
|
|
4242
|
-
|
|
4243
3997
|
var __proto = InputObserver.prototype;
|
|
4244
|
-
|
|
4245
3998
|
__proto.get = function (input) {
|
|
4246
3999
|
return this._axisManager.get(input.axes);
|
|
4247
4000
|
};
|
|
4248
|
-
|
|
4249
4001
|
__proto.hold = function (input, event) {
|
|
4250
4002
|
if (this._interruptManager.isInterrupted() || !input.axes.length) {
|
|
4251
4003
|
return;
|
|
4252
4004
|
}
|
|
4253
|
-
|
|
4254
4005
|
var changeOption = {
|
|
4255
4006
|
input: input,
|
|
4256
4007
|
event: event
|
|
4257
4008
|
};
|
|
4258
4009
|
this._isStopped = false;
|
|
4259
|
-
|
|
4260
4010
|
this._interruptManager.setInterrupt(true);
|
|
4261
|
-
|
|
4262
4011
|
this._animationManager.stopAnimation(changeOption);
|
|
4263
|
-
|
|
4264
4012
|
++this._eventManager.holdingCount;
|
|
4265
|
-
|
|
4266
4013
|
if (!this._moveDistance) {
|
|
4267
4014
|
this._eventManager.hold(this._axisManager.get(), changeOption);
|
|
4268
4015
|
}
|
|
4269
|
-
|
|
4270
4016
|
this._isOutside = this._axisManager.isOutside(input.axes);
|
|
4271
4017
|
this._moveDistance = this._axisManager.get(input.axes);
|
|
4272
4018
|
};
|
|
4273
|
-
|
|
4274
4019
|
__proto.change = function (input, event, offset, useAnimation) {
|
|
4275
4020
|
if (this._isStopped || !this._interruptManager.isInterrupting() || this._axisManager.every(offset, function (v) {
|
|
4276
4021
|
return v === 0;
|
|
4277
4022
|
})) {
|
|
4278
4023
|
return;
|
|
4279
4024
|
}
|
|
4280
|
-
|
|
4281
4025
|
var nativeEvent = event.srcEvent ? event.srcEvent : event;
|
|
4282
|
-
|
|
4283
4026
|
if (nativeEvent.__childrenAxesAlreadyChanged) {
|
|
4284
4027
|
return;
|
|
4285
4028
|
}
|
|
4286
|
-
|
|
4287
4029
|
var depaPos = this._moveDistance || this._axisManager.get(input.axes);
|
|
4288
|
-
|
|
4289
|
-
|
|
4290
|
-
|
|
4030
|
+
var destPos;
|
|
4031
|
+
// for outside logic
|
|
4291
4032
|
destPos = map(depaPos, function (v, k) {
|
|
4292
4033
|
return v + (offset[k] || 0);
|
|
4293
4034
|
});
|
|
4294
|
-
|
|
4295
4035
|
if (this._moveDistance) {
|
|
4296
4036
|
this._moveDistance = this._axisManager.map(destPos, function (v, _a) {
|
|
4297
4037
|
var circular = _a.circular,
|
|
4298
|
-
|
|
4038
|
+
range = _a.range;
|
|
4299
4039
|
return circular && (circular[0] || circular[1]) ? getCirculatedPos(v, range, circular) : v;
|
|
4300
4040
|
});
|
|
4301
|
-
}
|
|
4302
|
-
|
|
4303
|
-
|
|
4041
|
+
}
|
|
4042
|
+
// from outside to inside
|
|
4304
4043
|
if (this._isOutside && this._axisManager.every(depaPos, function (v, opt) {
|
|
4305
4044
|
return !isOutside(v, opt.range);
|
|
4306
4045
|
})) {
|
|
4307
4046
|
this._isOutside = false;
|
|
4308
4047
|
}
|
|
4309
|
-
|
|
4310
4048
|
depaPos = this._atOutside(depaPos);
|
|
4311
4049
|
destPos = this._atOutside(destPos);
|
|
4312
|
-
|
|
4313
4050
|
if (!this.options.nested || !this._isEndofAxis(offset, depaPos, destPos)) {
|
|
4314
4051
|
nativeEvent.__childrenAxesAlreadyChanged = true;
|
|
4315
4052
|
}
|
|
4316
|
-
|
|
4317
4053
|
var changeOption = {
|
|
4318
4054
|
input: input,
|
|
4319
4055
|
event: event
|
|
4320
4056
|
};
|
|
4321
|
-
|
|
4322
4057
|
if (useAnimation) {
|
|
4323
4058
|
var duration = this._animationManager.getDuration(destPos, depaPos);
|
|
4324
|
-
|
|
4325
4059
|
this._animationManager.animateTo(destPos, duration, changeOption);
|
|
4326
4060
|
} else {
|
|
4327
4061
|
var isCanceled = !this._eventManager.triggerChange(destPos, depaPos, changeOption, true);
|
|
4328
|
-
|
|
4329
4062
|
if (isCanceled) {
|
|
4330
4063
|
this._isStopped = true;
|
|
4331
4064
|
this._moveDistance = null;
|
|
4332
|
-
|
|
4333
4065
|
this._animationManager.finish(false);
|
|
4334
4066
|
}
|
|
4335
4067
|
}
|
|
4336
4068
|
};
|
|
4337
|
-
|
|
4338
4069
|
__proto.release = function (input, event, velocity, inputDuration) {
|
|
4339
4070
|
if (this._isStopped || !this._interruptManager.isInterrupting() || !this._moveDistance) {
|
|
4340
4071
|
return;
|
|
4341
4072
|
}
|
|
4342
|
-
|
|
4343
4073
|
var nativeEvent = event.srcEvent ? event.srcEvent : event;
|
|
4344
|
-
|
|
4345
4074
|
if (nativeEvent.__childrenAxesAlreadyReleased) {
|
|
4346
4075
|
velocity = velocity.map(function () {
|
|
4347
4076
|
return 0;
|
|
4348
4077
|
});
|
|
4349
4078
|
}
|
|
4350
|
-
|
|
4351
4079
|
var pos = this._axisManager.get(input.axes);
|
|
4352
|
-
|
|
4353
4080
|
var depaPos = this._axisManager.get();
|
|
4354
|
-
|
|
4355
4081
|
var displacement = this._animationManager.getDisplacement(velocity);
|
|
4356
|
-
|
|
4357
4082
|
var offset = toAxis(input.axes, displacement);
|
|
4358
|
-
|
|
4359
4083
|
var destPos = this._axisManager.get(this._axisManager.map(offset, function (v, opt, k) {
|
|
4360
4084
|
if (opt.circular && (opt.circular[0] || opt.circular[1])) {
|
|
4361
4085
|
return pos[k] + v;
|
|
@@ -4363,16 +4087,12 @@ version: 4.10.8-beta.1
|
|
|
4363
4087
|
return getInsidePosition(pos[k] + v, opt.range, opt.circular, opt.bounce);
|
|
4364
4088
|
}
|
|
4365
4089
|
}));
|
|
4366
|
-
|
|
4367
4090
|
nativeEvent.__childrenAxesAlreadyReleased = true;
|
|
4368
|
-
|
|
4369
4091
|
var duration = this._animationManager.getDuration(destPos, pos, inputDuration);
|
|
4370
|
-
|
|
4371
4092
|
if (duration === 0) {
|
|
4372
4093
|
destPos = __assign$1({}, depaPos);
|
|
4373
|
-
}
|
|
4374
|
-
|
|
4375
|
-
|
|
4094
|
+
}
|
|
4095
|
+
// prepare params
|
|
4376
4096
|
var param = {
|
|
4377
4097
|
depaPos: depaPos,
|
|
4378
4098
|
destPos: destPos,
|
|
@@ -4383,29 +4103,22 @@ version: 4.10.8-beta.1
|
|
|
4383
4103
|
isTrusted: true
|
|
4384
4104
|
};
|
|
4385
4105
|
--this._eventManager.holdingCount;
|
|
4386
|
-
|
|
4387
4106
|
this._eventManager.triggerRelease(param);
|
|
4388
|
-
|
|
4389
4107
|
if (this._eventManager.holdingCount === 0) {
|
|
4390
4108
|
this._moveDistance = null;
|
|
4391
|
-
}
|
|
4392
|
-
|
|
4393
|
-
|
|
4109
|
+
}
|
|
4110
|
+
// to contol
|
|
4394
4111
|
var userWish = this._animationManager.getUserControl(param);
|
|
4395
|
-
|
|
4396
4112
|
var isEqual = equal(userWish.destPos, depaPos);
|
|
4397
4113
|
var changeOption = {
|
|
4398
4114
|
input: input,
|
|
4399
4115
|
event: event
|
|
4400
4116
|
};
|
|
4401
|
-
|
|
4402
4117
|
if (isEqual || userWish.duration === 0) {
|
|
4403
4118
|
if (!isEqual) {
|
|
4404
4119
|
this._eventManager.triggerChange(userWish.destPos, depaPos, changeOption, true);
|
|
4405
4120
|
}
|
|
4406
|
-
|
|
4407
4121
|
this._interruptManager.setInterrupt(false);
|
|
4408
|
-
|
|
4409
4122
|
if (this._axisManager.isOutside()) {
|
|
4410
4123
|
this._animationManager.restore(changeOption);
|
|
4411
4124
|
} else {
|
|
@@ -4414,12 +4127,10 @@ version: 4.10.8-beta.1
|
|
|
4414
4127
|
} else {
|
|
4415
4128
|
this._animationManager.animateTo(userWish.destPos, userWish.duration, changeOption);
|
|
4416
4129
|
}
|
|
4417
|
-
};
|
|
4418
|
-
|
|
4419
|
-
|
|
4130
|
+
};
|
|
4131
|
+
// when move pointer is held in outside
|
|
4420
4132
|
__proto._atOutside = function (pos) {
|
|
4421
4133
|
var _this = this;
|
|
4422
|
-
|
|
4423
4134
|
if (this._isOutside) {
|
|
4424
4135
|
return this._axisManager.map(pos, function (v, opt) {
|
|
4425
4136
|
var tn = opt.range[0] - opt.bounce[0];
|
|
@@ -4432,7 +4143,6 @@ version: 4.10.8-beta.1
|
|
|
4432
4143
|
var max = opt.range[1];
|
|
4433
4144
|
var out = opt.bounce;
|
|
4434
4145
|
var circular = opt.circular;
|
|
4435
|
-
|
|
4436
4146
|
if (circular[0] && v < min || circular[1] && v > max) {
|
|
4437
4147
|
return v;
|
|
4438
4148
|
} else if (v < min) {
|
|
@@ -4442,47 +4152,37 @@ version: 4.10.8-beta.1
|
|
|
4442
4152
|
// right
|
|
4443
4153
|
return max + _this._animationManager.interpolate(v - max, out[1]);
|
|
4444
4154
|
}
|
|
4445
|
-
|
|
4446
4155
|
return v;
|
|
4447
4156
|
});
|
|
4448
4157
|
}
|
|
4449
4158
|
};
|
|
4450
|
-
|
|
4451
4159
|
__proto._isEndofAxis = function (offset, depaPos, destPos) {
|
|
4452
4160
|
return this._axisManager.every(depaPos, function (value, option, key) {
|
|
4453
4161
|
return offset[key] === 0 || depaPos[key] === destPos[key] && isEndofBounce(value, option.range, option.bounce, option.circular);
|
|
4454
4162
|
});
|
|
4455
4163
|
};
|
|
4456
|
-
|
|
4457
4164
|
return InputObserver;
|
|
4458
4165
|
}();
|
|
4459
4166
|
|
|
4460
4167
|
var clamp = function (value, min, max) {
|
|
4461
4168
|
return Math.max(Math.min(value, max), min);
|
|
4462
4169
|
};
|
|
4463
|
-
|
|
4464
|
-
var AnimationManager =
|
|
4465
|
-
/*#__PURE__*/
|
|
4466
|
-
function () {
|
|
4170
|
+
var AnimationManager = /*#__PURE__*/function () {
|
|
4467
4171
|
function AnimationManager(_a) {
|
|
4468
4172
|
var options = _a.options,
|
|
4469
|
-
|
|
4470
|
-
|
|
4471
|
-
|
|
4173
|
+
interruptManager = _a.interruptManager,
|
|
4174
|
+
eventManager = _a.eventManager,
|
|
4175
|
+
axisManager = _a.axisManager;
|
|
4472
4176
|
this._options = options;
|
|
4473
4177
|
this.interruptManager = interruptManager;
|
|
4474
4178
|
this.eventManager = eventManager;
|
|
4475
4179
|
this.axisManager = axisManager;
|
|
4476
4180
|
this.animationEnd = this.animationEnd.bind(this);
|
|
4477
4181
|
}
|
|
4478
|
-
|
|
4479
4182
|
var __proto = AnimationManager.prototype;
|
|
4480
|
-
|
|
4481
4183
|
__proto.getDuration = function (depaPos, destPos, wishDuration) {
|
|
4482
4184
|
var _this = this;
|
|
4483
|
-
|
|
4484
4185
|
var duration;
|
|
4485
|
-
|
|
4486
4186
|
if (typeof wishDuration !== "undefined") {
|
|
4487
4187
|
duration = wishDuration;
|
|
4488
4188
|
} else {
|
|
@@ -4493,10 +4193,8 @@ version: 4.10.8-beta.1
|
|
|
4493
4193
|
return Math.max(max, durations_1[v]);
|
|
4494
4194
|
}, -Infinity);
|
|
4495
4195
|
}
|
|
4496
|
-
|
|
4497
4196
|
return clamp(duration, this._options.minimumDuration, this._options.maximumDuration);
|
|
4498
4197
|
};
|
|
4499
|
-
|
|
4500
4198
|
__proto.getDisplacement = function (velocity) {
|
|
4501
4199
|
var totalVelocity = Math.pow(velocity.reduce(function (total, v) {
|
|
4502
4200
|
return total + v * v;
|
|
@@ -4506,31 +4204,25 @@ version: 4.10.8-beta.1
|
|
|
4506
4204
|
return v / 2 * duration;
|
|
4507
4205
|
});
|
|
4508
4206
|
};
|
|
4509
|
-
|
|
4510
4207
|
__proto.stopAnimation = function (option) {
|
|
4511
4208
|
if (this._animateParam) {
|
|
4512
4209
|
var orgPos_1 = this.axisManager.get();
|
|
4513
4210
|
var pos = this.axisManager.map(orgPos_1, function (v, opt) {
|
|
4514
4211
|
return getCirculatedPos(v, opt.range, opt.circular);
|
|
4515
4212
|
});
|
|
4516
|
-
|
|
4517
4213
|
if (!every(pos, function (v, k) {
|
|
4518
4214
|
return orgPos_1[k] === v;
|
|
4519
4215
|
})) {
|
|
4520
4216
|
this.eventManager.triggerChange(pos, orgPos_1, option, !!option);
|
|
4521
4217
|
}
|
|
4522
|
-
|
|
4523
4218
|
this._animateParam = null;
|
|
4524
|
-
|
|
4525
4219
|
if (this._raf) {
|
|
4526
4220
|
cancelAnimationFrame(this._raf);
|
|
4527
4221
|
}
|
|
4528
|
-
|
|
4529
4222
|
this._raf = null;
|
|
4530
4223
|
this.eventManager.triggerAnimationEnd(!!(option === null || option === void 0 ? void 0 : option.event));
|
|
4531
4224
|
}
|
|
4532
4225
|
};
|
|
4533
|
-
|
|
4534
4226
|
__proto.getEventInfo = function () {
|
|
4535
4227
|
if (this._animateParam && this._animateParam.input && this._animateParam.inputEvent) {
|
|
4536
4228
|
return {
|
|
@@ -4541,7 +4233,6 @@ version: 4.10.8-beta.1
|
|
|
4541
4233
|
return null;
|
|
4542
4234
|
}
|
|
4543
4235
|
};
|
|
4544
|
-
|
|
4545
4236
|
__proto.restore = function (option) {
|
|
4546
4237
|
var pos = this.axisManager.get();
|
|
4547
4238
|
var destPos = this.axisManager.map(pos, function (v, opt) {
|
|
@@ -4550,66 +4241,53 @@ version: 4.10.8-beta.1
|
|
|
4550
4241
|
this.stopAnimation();
|
|
4551
4242
|
this.animateTo(destPos, this.getDuration(pos, destPos), option);
|
|
4552
4243
|
};
|
|
4553
|
-
|
|
4554
4244
|
__proto.animationEnd = function () {
|
|
4555
4245
|
var beforeParam = this.getEventInfo();
|
|
4556
|
-
this._animateParam = null;
|
|
4557
|
-
|
|
4246
|
+
this._animateParam = null;
|
|
4247
|
+
// for Circular
|
|
4558
4248
|
var circularTargets = this.axisManager.filter(this.axisManager.get(), function (v, opt) {
|
|
4559
4249
|
return isCircularable(v, opt.range, opt.circular);
|
|
4560
4250
|
});
|
|
4561
|
-
|
|
4562
4251
|
if (Object.keys(circularTargets).length > 0) {
|
|
4563
4252
|
this.setTo(this.axisManager.map(circularTargets, function (v, opt) {
|
|
4564
4253
|
return getCirculatedPos(v, opt.range, opt.circular);
|
|
4565
4254
|
}));
|
|
4566
4255
|
}
|
|
4567
|
-
|
|
4568
4256
|
this.interruptManager.setInterrupt(false);
|
|
4569
4257
|
this.eventManager.triggerAnimationEnd(!!beforeParam);
|
|
4570
|
-
|
|
4571
4258
|
if (this.axisManager.isOutside()) {
|
|
4572
4259
|
this.restore(beforeParam);
|
|
4573
4260
|
} else {
|
|
4574
4261
|
this.finish(!!beforeParam);
|
|
4575
4262
|
}
|
|
4576
4263
|
};
|
|
4577
|
-
|
|
4578
4264
|
__proto.finish = function (isTrusted) {
|
|
4579
4265
|
this._animateParam = null;
|
|
4580
4266
|
this.interruptManager.setInterrupt(false);
|
|
4581
4267
|
this.eventManager.triggerFinish(isTrusted);
|
|
4582
4268
|
};
|
|
4583
|
-
|
|
4584
4269
|
__proto.getUserControl = function (param) {
|
|
4585
4270
|
var userWish = param.setTo();
|
|
4586
4271
|
userWish.destPos = this.axisManager.get(userWish.destPos);
|
|
4587
4272
|
userWish.duration = clamp(userWish.duration, this._options.minimumDuration, this._options.maximumDuration);
|
|
4588
4273
|
return userWish;
|
|
4589
4274
|
};
|
|
4590
|
-
|
|
4591
4275
|
__proto.animateTo = function (destPos, duration, option) {
|
|
4592
4276
|
var _this = this;
|
|
4593
|
-
|
|
4594
4277
|
this.stopAnimation();
|
|
4595
|
-
|
|
4596
4278
|
var param = this._createAnimationParam(destPos, duration, option);
|
|
4597
|
-
|
|
4598
4279
|
var depaPos = __assign$1({}, param.depaPos);
|
|
4599
|
-
|
|
4600
|
-
|
|
4601
|
-
|
|
4602
|
-
|
|
4603
|
-
|
|
4280
|
+
var retTrigger = this.eventManager.triggerAnimationStart(param);
|
|
4281
|
+
// to control
|
|
4282
|
+
var userWish = this.getUserControl(param);
|
|
4283
|
+
// You can't stop the 'animationStart' event when 'circular' is true.
|
|
4604
4284
|
if (!retTrigger && this.axisManager.every(userWish.destPos, function (v, opt) {
|
|
4605
4285
|
return isCircularable(v, opt.range, opt.circular);
|
|
4606
4286
|
})) {
|
|
4607
4287
|
console.warn("You can't stop the 'animation' event when 'circular' is true.");
|
|
4608
4288
|
}
|
|
4609
|
-
|
|
4610
4289
|
if (retTrigger && !equal(userWish.destPos, depaPos)) {
|
|
4611
4290
|
var inputEvent = (option === null || option === void 0 ? void 0 : option.event) || null;
|
|
4612
|
-
|
|
4613
4291
|
this._animateLoop({
|
|
4614
4292
|
depaPos: depaPos,
|
|
4615
4293
|
destPos: userWish.destPos,
|
|
@@ -4623,43 +4301,34 @@ version: 4.10.8-beta.1
|
|
|
4623
4301
|
});
|
|
4624
4302
|
}
|
|
4625
4303
|
};
|
|
4626
|
-
|
|
4627
4304
|
__proto.setTo = function (pos, duration) {
|
|
4628
4305
|
if (duration === void 0) {
|
|
4629
4306
|
duration = 0;
|
|
4630
4307
|
}
|
|
4631
|
-
|
|
4632
4308
|
var axes = Object.keys(pos);
|
|
4633
4309
|
var orgPos = this.axisManager.get(axes);
|
|
4634
|
-
|
|
4635
4310
|
if (equal(pos, orgPos)) {
|
|
4636
4311
|
return this;
|
|
4637
4312
|
}
|
|
4638
|
-
|
|
4639
4313
|
this.interruptManager.setInterrupt(true);
|
|
4640
4314
|
var movedPos = filter(pos, function (v, k) {
|
|
4641
4315
|
return orgPos[k] !== v;
|
|
4642
4316
|
});
|
|
4643
|
-
|
|
4644
4317
|
if (!Object.keys(movedPos).length) {
|
|
4645
4318
|
return this;
|
|
4646
4319
|
}
|
|
4647
|
-
|
|
4648
4320
|
movedPos = this.axisManager.map(movedPos, function (v, opt) {
|
|
4649
4321
|
var range = opt.range,
|
|
4650
|
-
|
|
4651
|
-
|
|
4322
|
+
circular = opt.circular;
|
|
4652
4323
|
if (circular && (circular[0] || circular[1])) {
|
|
4653
4324
|
return v;
|
|
4654
4325
|
} else {
|
|
4655
4326
|
return getInsidePosition(v, range, circular);
|
|
4656
4327
|
}
|
|
4657
4328
|
});
|
|
4658
|
-
|
|
4659
4329
|
if (equal(movedPos, orgPos)) {
|
|
4660
4330
|
return this;
|
|
4661
4331
|
}
|
|
4662
|
-
|
|
4663
4332
|
if (duration > 0) {
|
|
4664
4333
|
this.animateTo(movedPos, duration);
|
|
4665
4334
|
} else {
|
|
@@ -4667,20 +4336,19 @@ version: 4.10.8-beta.1
|
|
|
4667
4336
|
this.eventManager.triggerChange(movedPos);
|
|
4668
4337
|
this.finish(false);
|
|
4669
4338
|
}
|
|
4670
|
-
|
|
4671
4339
|
return this;
|
|
4672
4340
|
};
|
|
4673
|
-
|
|
4674
4341
|
__proto.setBy = function (pos, duration) {
|
|
4675
4342
|
if (duration === void 0) {
|
|
4676
4343
|
duration = 0;
|
|
4677
4344
|
}
|
|
4678
|
-
|
|
4679
4345
|
return this.setTo(map(this.axisManager.get(Object.keys(pos)), function (v, k) {
|
|
4680
4346
|
return v + pos[k];
|
|
4681
4347
|
}), duration);
|
|
4682
4348
|
};
|
|
4683
|
-
|
|
4349
|
+
__proto.setOptions = function (options) {
|
|
4350
|
+
this._options = __assign$1(__assign$1({}, this._options), options);
|
|
4351
|
+
};
|
|
4684
4352
|
__proto._createAnimationParam = function (pos, duration, option) {
|
|
4685
4353
|
var depaPos = this.axisManager.get();
|
|
4686
4354
|
var destPos = pos;
|
|
@@ -4696,10 +4364,8 @@ version: 4.10.8-beta.1
|
|
|
4696
4364
|
done: this.animationEnd
|
|
4697
4365
|
};
|
|
4698
4366
|
};
|
|
4699
|
-
|
|
4700
4367
|
__proto._animateLoop = function (param, complete) {
|
|
4701
4368
|
var _this = this;
|
|
4702
|
-
|
|
4703
4369
|
if (param.duration) {
|
|
4704
4370
|
this._animateParam = __assign$1(__assign$1({}, param), {
|
|
4705
4371
|
startTime: new Date().getTime()
|
|
@@ -4707,25 +4373,18 @@ version: 4.10.8-beta.1
|
|
|
4707
4373
|
var originalIntendedPos_1 = map(param.destPos, function (v) {
|
|
4708
4374
|
return v;
|
|
4709
4375
|
});
|
|
4710
|
-
|
|
4711
4376
|
var state_1 = this._initState(this._animateParam);
|
|
4712
|
-
|
|
4713
4377
|
var loop_1 = function () {
|
|
4714
4378
|
_this._raf = null;
|
|
4715
4379
|
var animateParam = _this._animateParam;
|
|
4716
|
-
|
|
4717
4380
|
var nextState = _this._getNextState(state_1);
|
|
4718
|
-
|
|
4719
4381
|
var isCanceled = !_this.eventManager.triggerChange(nextState.pos, state_1.pos);
|
|
4720
4382
|
state_1 = nextState;
|
|
4721
|
-
|
|
4722
4383
|
if (nextState.finished) {
|
|
4723
4384
|
animateParam.destPos = _this._getFinalPos(animateParam.destPos, originalIntendedPos_1);
|
|
4724
|
-
|
|
4725
4385
|
if (!equal(animateParam.destPos, _this.axisManager.get(Object.keys(animateParam.destPos)))) {
|
|
4726
4386
|
_this.eventManager.triggerChange(animateParam.destPos, nextState.pos);
|
|
4727
4387
|
}
|
|
4728
|
-
|
|
4729
4388
|
complete();
|
|
4730
4389
|
return;
|
|
4731
4390
|
} else if (isCanceled) {
|
|
@@ -4734,30 +4393,26 @@ version: 4.10.8-beta.1
|
|
|
4734
4393
|
_this._raf = requestAnimationFrame(loop_1);
|
|
4735
4394
|
}
|
|
4736
4395
|
};
|
|
4737
|
-
|
|
4738
4396
|
loop_1();
|
|
4739
4397
|
} else {
|
|
4740
4398
|
this.eventManager.triggerChange(param.destPos);
|
|
4741
4399
|
complete();
|
|
4742
4400
|
}
|
|
4743
4401
|
};
|
|
4744
|
-
/**
|
|
4745
|
-
* Get estimated final value.
|
|
4746
|
-
*
|
|
4747
|
-
* If destPos is within the 'error range' of the original intended position, the initial intended position is returned.
|
|
4748
|
-
* - eg. original intended pos: 100, destPos: 100.0000000004 ==> return 100;
|
|
4749
|
-
* If dest Pos is outside the 'range of error' compared to the originally intended pos, it is returned rounded based on the originally intended pos.
|
|
4750
|
-
* - eg. original intended pos: 100.123 destPos: 50.12345 => return 50.123
|
|
4751
|
-
* @param originalIntendedPos
|
|
4752
|
-
* @param destPos
|
|
4402
|
+
/**
|
|
4403
|
+
* Get estimated final value.
|
|
4404
|
+
*
|
|
4405
|
+
* If destPos is within the 'error range' of the original intended position, the initial intended position is returned.
|
|
4406
|
+
* - eg. original intended pos: 100, destPos: 100.0000000004 ==> return 100;
|
|
4407
|
+
* If dest Pos is outside the 'range of error' compared to the originally intended pos, it is returned rounded based on the originally intended pos.
|
|
4408
|
+
* - eg. original intended pos: 100.123 destPos: 50.12345 => return 50.123
|
|
4409
|
+
* @param originalIntendedPos
|
|
4410
|
+
* @param destPos
|
|
4753
4411
|
*/
|
|
4754
|
-
|
|
4755
|
-
|
|
4756
4412
|
__proto._getFinalPos = function (destPos, originalIntendedPos) {
|
|
4757
|
-
var _this = this;
|
|
4413
|
+
var _this = this;
|
|
4414
|
+
// compare destPos and originalIntendedPos
|
|
4758
4415
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
4759
|
-
|
|
4760
|
-
|
|
4761
4416
|
var ERROR_LIMIT = 0.000001;
|
|
4762
4417
|
var finalPos = map(destPos, function (value, key) {
|
|
4763
4418
|
if (value >= originalIntendedPos[key] - ERROR_LIMIT && value <= originalIntendedPos[key] + ERROR_LIMIT) {
|
|
@@ -4766,90 +4421,70 @@ version: 4.10.8-beta.1
|
|
|
4766
4421
|
} else {
|
|
4767
4422
|
// Out of error range, return rounded pos.
|
|
4768
4423
|
var roundUnit = _this._getRoundUnit(value, key);
|
|
4769
|
-
|
|
4770
4424
|
var result = roundNumber(value, roundUnit);
|
|
4771
4425
|
return result;
|
|
4772
4426
|
}
|
|
4773
4427
|
});
|
|
4774
4428
|
return finalPos;
|
|
4775
4429
|
};
|
|
4776
|
-
|
|
4777
4430
|
__proto._getRoundUnit = function (val, key) {
|
|
4778
4431
|
var roundUnit = this._options.round; // manual mode
|
|
4779
|
-
|
|
4780
4432
|
var minRoundUnit = null; // auto mode
|
|
4781
4433
|
// auto mode
|
|
4782
|
-
|
|
4783
4434
|
if (!roundUnit) {
|
|
4784
4435
|
// Get minimum round unit
|
|
4785
4436
|
var options = this.axisManager.getAxisOptions(key);
|
|
4786
4437
|
minRoundUnit = inversePow(Math.max(getDecimalPlace(options.range[0]), getDecimalPlace(options.range[1]), getDecimalPlace(val)));
|
|
4787
4438
|
}
|
|
4788
|
-
|
|
4789
4439
|
return minRoundUnit || roundUnit;
|
|
4790
4440
|
};
|
|
4791
|
-
|
|
4792
4441
|
return AnimationManager;
|
|
4793
4442
|
}();
|
|
4794
4443
|
|
|
4795
|
-
var EasingManager =
|
|
4796
|
-
/*#__PURE__*/
|
|
4797
|
-
function (_super) {
|
|
4444
|
+
var EasingManager = /*#__PURE__*/function (_super) {
|
|
4798
4445
|
__extends$1(EasingManager, _super);
|
|
4799
|
-
|
|
4800
4446
|
function EasingManager() {
|
|
4801
4447
|
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
4802
|
-
|
|
4803
4448
|
_this._useDuration = true;
|
|
4804
4449
|
return _this;
|
|
4805
4450
|
}
|
|
4806
|
-
|
|
4807
4451
|
var __proto = EasingManager.prototype;
|
|
4808
|
-
|
|
4809
4452
|
__proto.interpolate = function (displacement, threshold) {
|
|
4810
4453
|
var initSlope = this._easing(0.00001) / 0.00001;
|
|
4811
4454
|
return this._easing(displacement / (threshold * initSlope)) * threshold;
|
|
4812
4455
|
};
|
|
4813
|
-
|
|
4814
4456
|
__proto.updateAnimation = function (options) {
|
|
4815
4457
|
var _a;
|
|
4816
|
-
|
|
4817
4458
|
var animateParam = this._animateParam;
|
|
4818
|
-
|
|
4819
4459
|
if (!animateParam) {
|
|
4820
4460
|
return;
|
|
4821
4461
|
}
|
|
4822
|
-
|
|
4823
4462
|
var diffTime = new Date().getTime() - animateParam.startTime;
|
|
4824
4463
|
var pos = (options === null || options === void 0 ? void 0 : options.destPos) || animateParam.destPos;
|
|
4825
4464
|
var duration = (_a = options === null || options === void 0 ? void 0 : options.duration) !== null && _a !== void 0 ? _a : animateParam.duration;
|
|
4826
|
-
|
|
4827
4465
|
if ((options === null || options === void 0 ? void 0 : options.restart) || duration <= diffTime) {
|
|
4828
4466
|
this.setTo(pos, duration - diffTime);
|
|
4829
4467
|
return;
|
|
4830
4468
|
}
|
|
4831
|
-
|
|
4832
4469
|
if (options === null || options === void 0 ? void 0 : options.destPos) {
|
|
4833
|
-
var currentPos = this.axisManager.get();
|
|
4470
|
+
var currentPos = this.axisManager.get();
|
|
4471
|
+
// When destination is changed, new delta should be calculated as remaining percent.
|
|
4834
4472
|
// For example, moving x:0, y:0 to x:200, y:200 and it has current easing percent of 92%. coordinate is x:184 and y:184
|
|
4835
4473
|
// If destination changes to x:300, y:300. xdelta:200, ydelta:200 changes to xdelta:116, ydelta:116 and use remaining easingPer as 100%, not 8% as previous.
|
|
4836
4474
|
// Therefore, original easingPer by time is kept. And divided by (1 - self._initialEasingPer) which means new total easing percent. Like calculating 8% as 100%.
|
|
4837
|
-
|
|
4838
4475
|
this._initialEasingPer = this._prevEasingPer;
|
|
4839
4476
|
animateParam.delta = this.axisManager.getDelta(currentPos, pos);
|
|
4840
4477
|
animateParam.destPos = pos;
|
|
4841
4478
|
}
|
|
4842
|
-
|
|
4843
4479
|
if (options === null || options === void 0 ? void 0 : options.duration) {
|
|
4844
|
-
var ratio = (diffTime + this._durationOffset) / animateParam.duration;
|
|
4480
|
+
var ratio = (diffTime + this._durationOffset) / animateParam.duration;
|
|
4481
|
+
// Use durationOffset for keeping animation ratio after duration is changed.
|
|
4845
4482
|
// newRatio = (diffTime + newDurationOffset) / newDuration = oldRatio
|
|
4846
4483
|
// newDurationOffset = oldRatio * newDuration - diffTime
|
|
4847
|
-
|
|
4848
4484
|
this._durationOffset = ratio * duration - diffTime;
|
|
4849
4485
|
animateParam.duration = duration;
|
|
4850
4486
|
}
|
|
4851
4487
|
};
|
|
4852
|
-
|
|
4853
4488
|
__proto._initState = function (info) {
|
|
4854
4489
|
this._initialEasingPer = 0;
|
|
4855
4490
|
this._prevEasingPer = 0;
|
|
@@ -4860,10 +4495,8 @@ version: 4.10.8-beta.1
|
|
|
4860
4495
|
finished: false
|
|
4861
4496
|
};
|
|
4862
4497
|
};
|
|
4863
|
-
|
|
4864
4498
|
__proto._getNextState = function (prevState) {
|
|
4865
4499
|
var _this = this;
|
|
4866
|
-
|
|
4867
4500
|
var animateParam = this._animateParam;
|
|
4868
4501
|
var prevPos = prevState.pos;
|
|
4869
4502
|
var destPos = animateParam.destPos;
|
|
@@ -4872,23 +4505,19 @@ version: 4.10.8-beta.1
|
|
|
4872
4505
|
});
|
|
4873
4506
|
var diffTime = new Date().getTime() - animateParam.startTime;
|
|
4874
4507
|
var ratio = (diffTime + this._durationOffset) / animateParam.duration;
|
|
4875
|
-
|
|
4876
4508
|
var easingPer = this._easing(ratio);
|
|
4877
|
-
|
|
4878
4509
|
var toPos = this.axisManager.map(prevPos, function (pos, options, key) {
|
|
4879
|
-
var nextPos = ratio >= 1 ? destPos[key] : pos + animateParam.delta[key] * (easingPer - _this._prevEasingPer) / (1 - _this._initialEasingPer);
|
|
4510
|
+
var nextPos = ratio >= 1 ? destPos[key] : pos + animateParam.delta[key] * (easingPer - _this._prevEasingPer) / (1 - _this._initialEasingPer);
|
|
4511
|
+
// Subtract distance from distance already moved.
|
|
4880
4512
|
// Recalculate the remaining distance.
|
|
4881
4513
|
// Fix the bouncing phenomenon by changing the range.
|
|
4882
|
-
|
|
4883
4514
|
var circulatedPos = getCirculatedPos(nextPos, options.range, options.circular);
|
|
4884
|
-
|
|
4885
4515
|
if (nextPos !== circulatedPos) {
|
|
4886
4516
|
// circular
|
|
4887
4517
|
var rangeOffset = directions[key] * (options.range[1] - options.range[0]);
|
|
4888
4518
|
destPos[key] -= rangeOffset;
|
|
4889
4519
|
prevPos[key] -= rangeOffset;
|
|
4890
4520
|
}
|
|
4891
|
-
|
|
4892
4521
|
return circulatedPos;
|
|
4893
4522
|
});
|
|
4894
4523
|
this._prevEasingPer = easingPer;
|
|
@@ -4898,142 +4527,129 @@ version: 4.10.8-beta.1
|
|
|
4898
4527
|
finished: easingPer >= 1
|
|
4899
4528
|
};
|
|
4900
4529
|
};
|
|
4901
|
-
|
|
4902
4530
|
__proto._easing = function (p) {
|
|
4903
4531
|
return p > 1 ? 1 : this._options.easing(p);
|
|
4904
4532
|
};
|
|
4905
|
-
|
|
4906
4533
|
return EasingManager;
|
|
4907
4534
|
}(AnimationManager);
|
|
4908
4535
|
|
|
4909
|
-
/**
|
|
4910
|
-
* @typedef {Object} AxisOption The Axis information. The key of the axis specifies the name to use as the logical virtual coordinate system.
|
|
4911
|
-
* @ko 축 정보. 축의 키는 논리적인 가상 좌표계로 사용할 이름을 지정한다.
|
|
4912
|
-
* @param {Number[]} [range] The range of coordinate <ko>좌표 범위</ko>
|
|
4913
|
-
* @param {Number} [range[0]=0] The coordinate of the minimum <ko>최소 좌표</ko>
|
|
4914
|
-
* @param {Number} [range[1]=0] The coordinate of the maximum <ko>최대 좌표</ko>
|
|
4915
|
-
* @param {Number} [startPos=range[0]] The coordinates to be moved when creating an instance <ko>인스턴스 생성시 이동할 좌표</ko>
|
|
4916
|
-
* @param {Number[]} [bounce] The size of bouncing area. The coordinates can exceed the coordinate area as much as the bouncing area based on user action. If the coordinates does not exceed the bouncing area when an element is dragged, the coordinates where bouncing effects are applied are retuned back into the coordinate area<ko>바운스 영역의 크기. 사용자의 동작에 따라 좌표가 좌표 영역을 넘어 바운스 영역의 크기만큼 더 이동할 수 있다. 사용자가 끌어다 놓는 동작을 했을 때 좌표가 바운스 영역에 있으면, 바운스 효과가 적용된 좌표가 다시 좌표 영역 안으로 들어온다</ko>
|
|
4917
|
-
* @param {Number} [bounce[0]=0] The size of coordinate of the minimum area <ko>최소 좌표 바운스 영역의 크기</ko>
|
|
4918
|
-
* @param {Number} [bounce[1]=0] The size of coordinate of the maximum area <ko>최대 좌표 바운스 영역의 크기</ko>
|
|
4919
|
-
* @param {Boolean[]} [circular] Indicates whether a circular element is available. If it is set to "true" and an element is dragged outside the coordinate area, the element will appear on the other side.<ko>순환 여부. 'true'로 설정한 방향의 좌표 영역 밖으로 엘리먼트가 이동하면 반대 방향에서 엘리먼트가 나타난다</ko>
|
|
4920
|
-
* @param {Boolean} [circular[0]=false] Indicates whether to circulate to the coordinate of the minimum <ko>최소 좌표 방향의 순환 여부</ko>
|
|
4921
|
-
* @param {Boolean} [circular[1]=false] Indicates whether to circulate to the coordinate of the maximum <ko>최대 좌표 방향의 순환 여부</ko>
|
|
4536
|
+
/**
|
|
4537
|
+
* @typedef {Object} AxisOption The Axis information. The key of the axis specifies the name to use as the logical virtual coordinate system.
|
|
4538
|
+
* @ko 축 정보. 축의 키는 논리적인 가상 좌표계로 사용할 이름을 지정한다.
|
|
4539
|
+
* @param {Number[]} [range] The range of coordinate <ko>좌표 범위</ko>
|
|
4540
|
+
* @param {Number} [range[0]=0] The coordinate of the minimum <ko>최소 좌표</ko>
|
|
4541
|
+
* @param {Number} [range[1]=0] The coordinate of the maximum <ko>최대 좌표</ko>
|
|
4542
|
+
* @param {Number} [startPos=range[0]] The coordinates to be moved when creating an instance <ko>인스턴스 생성시 이동할 좌표</ko>
|
|
4543
|
+
* @param {Number[]} [bounce] The size of bouncing area. The coordinates can exceed the coordinate area as much as the bouncing area based on user action. If the coordinates does not exceed the bouncing area when an element is dragged, the coordinates where bouncing effects are applied are retuned back into the coordinate area<ko>바운스 영역의 크기. 사용자의 동작에 따라 좌표가 좌표 영역을 넘어 바운스 영역의 크기만큼 더 이동할 수 있다. 사용자가 끌어다 놓는 동작을 했을 때 좌표가 바운스 영역에 있으면, 바운스 효과가 적용된 좌표가 다시 좌표 영역 안으로 들어온다</ko>
|
|
4544
|
+
* @param {Number} [bounce[0]=0] The size of coordinate of the minimum area <ko>최소 좌표 바운스 영역의 크기</ko>
|
|
4545
|
+
* @param {Number} [bounce[1]=0] The size of coordinate of the maximum area <ko>최대 좌표 바운스 영역의 크기</ko>
|
|
4546
|
+
* @param {Boolean[]} [circular] Indicates whether a circular element is available. If it is set to "true" and an element is dragged outside the coordinate area, the element will appear on the other side.<ko>순환 여부. 'true'로 설정한 방향의 좌표 영역 밖으로 엘리먼트가 이동하면 반대 방향에서 엘리먼트가 나타난다</ko>
|
|
4547
|
+
* @param {Boolean} [circular[0]=false] Indicates whether to circulate to the coordinate of the minimum <ko>최소 좌표 방향의 순환 여부</ko>
|
|
4548
|
+
* @param {Boolean} [circular[1]=false] Indicates whether to circulate to the coordinate of the maximum <ko>최대 좌표 방향의 순환 여부</ko>
|
|
4922
4549
|
**/
|
|
4923
|
-
|
|
4924
|
-
|
|
4925
|
-
* @
|
|
4926
|
-
* @
|
|
4927
|
-
* @param {
|
|
4928
|
-
* @param {Number} [
|
|
4929
|
-
* @param {Number} [
|
|
4930
|
-
* @param {
|
|
4931
|
-
*
|
|
4932
|
-
* -
|
|
4933
|
-
*
|
|
4934
|
-
*
|
|
4935
|
-
* -
|
|
4936
|
-
*
|
|
4937
|
-
*
|
|
4938
|
-
* [
|
|
4939
|
-
* [
|
|
4940
|
-
* @param {Boolean} [nested=false] Whether the event propagates to other instances when the coordinates reach the end of the movable area <ko>좌표가 이동 가능한 영역의 끝까지 도달했을 때 다른 인스턴스들로의 이벤트 전파 여부</ko>
|
|
4550
|
+
/**
|
|
4551
|
+
* @typedef {Object} AxesOption The option object of the eg.Axes module
|
|
4552
|
+
* @ko eg.Axes 모듈의 옵션 객체
|
|
4553
|
+
* @param {Function} [easing=easing.easeOutCubic] The easing function to apply to an animation <ko>애니메이션에 적용할 easing 함수</ko>
|
|
4554
|
+
* @param {Number} [maximumDuration=Infinity] Maximum duration of the animation <ko>가속도에 의해 애니메이션이 동작할 때의 최대 좌표 이동 시간</ko>
|
|
4555
|
+
* @param {Number} [minimumDuration=0] Minimum duration of the animation <ko>가속도에 의해 애니메이션이 동작할 때의 최소 좌표 이동 시간</ko>
|
|
4556
|
+
* @param {Number} [deceleration=0.0006] Deceleration of the animation where acceleration is manually enabled by user. A higher value indicates shorter running time. <ko>사용자의 동작으로 가속도가 적용된 애니메이션의 감속도. 값이 높을수록 애니메이션 실행 시간이 짧아진다</ko>
|
|
4557
|
+
* @param {Boolean} [interruptable=true] Indicates whether an animation is interruptible.
|
|
4558
|
+
* - true: It can be paused or stopped by user action or the API.
|
|
4559
|
+
* - false: It cannot be paused or stopped by user action or the API while it is running.
|
|
4560
|
+
* <ko>진행 중인 애니메이션 중지 가능 여부.
|
|
4561
|
+
* - true: 사용자의 동작이나 API로 애니메이션을 중지할 수 있다.
|
|
4562
|
+
* - false: 애니메이션이 진행 중일 때는 사용자의 동작이나 API가 적용되지 않는다</ko>
|
|
4563
|
+
* @param {Number} [round=null] Rounding unit. For example, 0.1 rounds to 0.1 decimal point(6.1234 => 6.1), 5 rounds to 5 (93 => 95)
|
|
4564
|
+
* [Details](https://github.com/naver/egjs-axes/wiki/round-option)<ko>반올림 단위. 예를 들어 0.1 은 소숫점 0.1 까지 반올림(6.1234 => 6.1), 5 는 5 단위로 반올림(93 => 95).
|
|
4565
|
+
* [상세내용](https://github.com/naver/egjs-axes/wiki/round-option)</ko>
|
|
4566
|
+
* @param {Boolean} [nested=false] Whether the event propagates to other instances when the coordinates reach the end of the movable area <ko>좌표가 이동 가능한 영역의 끝까지 도달했을 때 다른 인스턴스들로의 이벤트 전파 여부</ko>
|
|
4941
4567
|
**/
|
|
4942
|
-
|
|
4943
|
-
|
|
4944
|
-
*
|
|
4945
|
-
* @
|
|
4946
|
-
*
|
|
4947
|
-
*
|
|
4948
|
-
* @param {
|
|
4949
|
-
* @param {
|
|
4950
|
-
*
|
|
4951
|
-
*
|
|
4952
|
-
* @
|
|
4953
|
-
*
|
|
4954
|
-
*
|
|
4955
|
-
*
|
|
4956
|
-
*
|
|
4957
|
-
*
|
|
4958
|
-
*
|
|
4959
|
-
*
|
|
4960
|
-
*
|
|
4961
|
-
*
|
|
4962
|
-
*
|
|
4963
|
-
*
|
|
4964
|
-
*
|
|
4965
|
-
*
|
|
4966
|
-
*
|
|
4967
|
-
*
|
|
4968
|
-
*
|
|
4969
|
-
*
|
|
4970
|
-
*
|
|
4971
|
-
*
|
|
4972
|
-
*
|
|
4973
|
-
*
|
|
4974
|
-
*
|
|
4975
|
-
*
|
|
4976
|
-
*
|
|
4977
|
-
*
|
|
4978
|
-
*
|
|
4979
|
-
*
|
|
4980
|
-
*
|
|
4981
|
-
*
|
|
4982
|
-
*
|
|
4983
|
-
*
|
|
4984
|
-
*
|
|
4985
|
-
*
|
|
4986
|
-
*
|
|
4987
|
-
*
|
|
4988
|
-
*
|
|
4989
|
-
*
|
|
4990
|
-
* const
|
|
4991
|
-
* const
|
|
4992
|
-
*
|
|
4993
|
-
*
|
|
4994
|
-
*
|
|
4995
|
-
*
|
|
4996
|
-
* //
|
|
4997
|
-
* //
|
|
4998
|
-
* //
|
|
4999
|
-
*
|
|
5000
|
-
*
|
|
5001
|
-
*
|
|
5002
|
-
*
|
|
5003
|
-
*
|
|
5004
|
-
*
|
|
5005
|
-
*
|
|
5006
|
-
*
|
|
5007
|
-
*
|
|
5008
|
-
*
|
|
5009
|
-
*
|
|
5010
|
-
* ```
|
|
4568
|
+
/**
|
|
4569
|
+
* A module used to change the information of user action entered by various input devices such as touch screen or mouse into the logical virtual coordinates. You can easily create a UI that responds to user actions.
|
|
4570
|
+
* @ko 터치 입력 장치나 마우스와 같은 다양한 입력 장치를 통해 전달 받은 사용자의 동작을 논리적인 가상 좌표로 변경하는 모듈이다. 사용자 동작에 반응하는 UI를 손쉽게 만들수 있다.
|
|
4571
|
+
* @extends eg.Component
|
|
4572
|
+
*
|
|
4573
|
+
* @param {Object.<string, AxisOption>} axis Axis information managed by eg.Axes. The key of the axis specifies the name to use as the logical virtual coordinate system. <ko>eg.Axes가 관리하는 축 정보. 축의 키는 논리적인 가상 좌표계로 사용할 이름을 지정한다.</ko>
|
|
4574
|
+
* @param {AxesOption} [options={}] The option object of the eg.Axes module<ko>eg.Axes 모듈의 옵션 객체</ko>
|
|
4575
|
+
* @param {Object.<string, number>} [startPos={}] The coordinates to be moved when creating an instance. It is applied with higher priority than startPos of axisOption.<ko>인스턴스 생성시 이동할 좌표, axisOption의 startPos보다 높은 우선순위로 적용된다.</ko>
|
|
4576
|
+
*
|
|
4577
|
+
* @support {"ie": "10+", "ch" : "latest", "ff" : "latest", "sf" : "latest", "edge" : "latest", "ios" : "7+", "an" : "2.3+ (except 3.x)"}
|
|
4578
|
+
* @example
|
|
4579
|
+
* ```js
|
|
4580
|
+
* // 1. Initialize eg.Axes
|
|
4581
|
+
* const axes = new eg.Axes({
|
|
4582
|
+
* something1: {
|
|
4583
|
+
* range: [0, 150],
|
|
4584
|
+
* bounce: 50
|
|
4585
|
+
* },
|
|
4586
|
+
* something2: {
|
|
4587
|
+
* range: [0, 200],
|
|
4588
|
+
* bounce: 100
|
|
4589
|
+
* },
|
|
4590
|
+
* somethingN: {
|
|
4591
|
+
* range: [1, 10],
|
|
4592
|
+
* }
|
|
4593
|
+
* }, {
|
|
4594
|
+
* deceleration : 0.0024
|
|
4595
|
+
* });
|
|
4596
|
+
*
|
|
4597
|
+
* // 2. attach event handler
|
|
4598
|
+
* axes.on({
|
|
4599
|
+
* "hold" : function(evt) {
|
|
4600
|
+
* },
|
|
4601
|
+
* "release" : function(evt) {
|
|
4602
|
+
* },
|
|
4603
|
+
* "animationStart" : function(evt) {
|
|
4604
|
+
* },
|
|
4605
|
+
* "animationEnd" : function(evt) {
|
|
4606
|
+
* },
|
|
4607
|
+
* "change" : function(evt) {
|
|
4608
|
+
* }
|
|
4609
|
+
* });
|
|
4610
|
+
*
|
|
4611
|
+
* // 3. Initialize inputTypes
|
|
4612
|
+
* const panInputArea = new eg.Axes.PanInput("#area", {
|
|
4613
|
+
* scale: [0.5, 1]
|
|
4614
|
+
* });
|
|
4615
|
+
* const panInputHmove = new eg.Axes.PanInput("#hmove");
|
|
4616
|
+
* const panInputVmove = new eg.Axes.PanInput("#vmove");
|
|
4617
|
+
* const pinchInputArea = new eg.Axes.PinchInput("#area", {
|
|
4618
|
+
* scale: 1.5
|
|
4619
|
+
* });
|
|
4620
|
+
*
|
|
4621
|
+
* // 4. Connect eg.Axes and InputTypes
|
|
4622
|
+
* // [PanInput] When the mouse or touchscreen is down and moved.
|
|
4623
|
+
* // Connect the 'something2' axis to the mouse or touchscreen x position and
|
|
4624
|
+
* // connect the 'somethingN' axis to the mouse or touchscreen y position.
|
|
4625
|
+
* axes.connect(["something2", "somethingN"], panInputArea); // or axes.connect("something2 somethingN", panInputArea);
|
|
4626
|
+
*
|
|
4627
|
+
* // Connect only one 'something1' axis to the mouse or touchscreen x position.
|
|
4628
|
+
* axes.connect(["something1"], panInputHmove); // or axes.connect("something1", panInputHmove);
|
|
4629
|
+
*
|
|
4630
|
+
* // Connect only one 'something2' axis to the mouse or touchscreen y position.
|
|
4631
|
+
* axes.connect(["", "something2"], panInputVmove); // or axes.connect(" something2", panInputVmove);
|
|
4632
|
+
*
|
|
4633
|
+
* // [PinchInput] Connect 'something2' axis when two pointers are moving toward (zoom-in) or away from each other (zoom-out).
|
|
4634
|
+
* axes.connect("something2", pinchInputArea);
|
|
4635
|
+
* ```
|
|
5011
4636
|
*/
|
|
5012
|
-
|
|
5013
|
-
var Axes =
|
|
5014
|
-
/*#__PURE__*/
|
|
5015
|
-
function (_super) {
|
|
4637
|
+
var Axes = /*#__PURE__*/function (_super) {
|
|
5016
4638
|
__extends$1(Axes, _super);
|
|
5017
|
-
/**
|
|
5018
|
-
*
|
|
4639
|
+
/**
|
|
4640
|
+
*
|
|
5019
4641
|
*/
|
|
5020
|
-
|
|
5021
|
-
|
|
5022
4642
|
function Axes(axis, options, startPos) {
|
|
5023
4643
|
if (axis === void 0) {
|
|
5024
4644
|
axis = {};
|
|
5025
4645
|
}
|
|
5026
|
-
|
|
5027
4646
|
if (options === void 0) {
|
|
5028
4647
|
options = {};
|
|
5029
4648
|
}
|
|
5030
|
-
|
|
5031
4649
|
if (startPos === void 0) {
|
|
5032
4650
|
startPos = {};
|
|
5033
4651
|
}
|
|
5034
|
-
|
|
5035
4652
|
var _this = _super.call(this) || this;
|
|
5036
|
-
|
|
5037
4653
|
_this.axis = axis;
|
|
5038
4654
|
_this._inputs = [];
|
|
5039
4655
|
_this.options = __assign$1({
|
|
@@ -5055,33 +4671,29 @@ version: 4.10.8-beta.1
|
|
|
5055
4671
|
_this.eventManager = new EventManager(_this);
|
|
5056
4672
|
_this.animationManager = new EasingManager(_this);
|
|
5057
4673
|
_this.inputObserver = new InputObserver(_this);
|
|
5058
|
-
|
|
5059
4674
|
_this.eventManager.setAnimationManager(_this.animationManager);
|
|
5060
|
-
|
|
5061
4675
|
_this.eventManager.triggerChange(_this.axisManager.get());
|
|
5062
|
-
|
|
5063
4676
|
return _this;
|
|
5064
4677
|
}
|
|
5065
|
-
|
|
5066
4678
|
var __proto = Axes.prototype;
|
|
5067
4679
|
Object.defineProperty(__proto, "holding", {
|
|
5068
|
-
/**
|
|
5069
|
-
* @name Axes#holding
|
|
5070
|
-
* @desc Returns true if at least one input is in progress.
|
|
5071
|
-
* @ko 입력이 하나 이상 진행 중인지 여부를 반환한다.
|
|
5072
|
-
*
|
|
5073
|
-
* @readonly
|
|
5074
|
-
* @type {boolean}
|
|
5075
|
-
* @example
|
|
5076
|
-
* ```js
|
|
5077
|
-
* const axes = new eg.Axes({
|
|
5078
|
-
* x: {
|
|
5079
|
-
* range: [0, 100],
|
|
5080
|
-
* },
|
|
5081
|
-
* });
|
|
5082
|
-
*
|
|
5083
|
-
* axes.holding
|
|
5084
|
-
* ```
|
|
4680
|
+
/**
|
|
4681
|
+
* @name Axes#holding
|
|
4682
|
+
* @desc Returns true if at least one input is in progress.
|
|
4683
|
+
* @ko 입력이 하나 이상 진행 중인지 여부를 반환한다.
|
|
4684
|
+
*
|
|
4685
|
+
* @readonly
|
|
4686
|
+
* @type {boolean}
|
|
4687
|
+
* @example
|
|
4688
|
+
* ```js
|
|
4689
|
+
* const axes = new eg.Axes({
|
|
4690
|
+
* x: {
|
|
4691
|
+
* range: [0, 100],
|
|
4692
|
+
* },
|
|
4693
|
+
* });
|
|
4694
|
+
*
|
|
4695
|
+
* axes.holding
|
|
4696
|
+
* ```
|
|
5085
4697
|
*/
|
|
5086
4698
|
get: function () {
|
|
5087
4699
|
return this.eventManager.holdingCount > 0;
|
|
@@ -5089,551 +4701,501 @@ version: 4.10.8-beta.1
|
|
|
5089
4701
|
enumerable: false,
|
|
5090
4702
|
configurable: true
|
|
5091
4703
|
});
|
|
5092
|
-
/**
|
|
5093
|
-
* Connect the axis of eg.Axes to the inputType.
|
|
5094
|
-
* @ko eg.Axes의 축과 inputType을 연결한다
|
|
5095
|
-
* @param {(String[]|String)} axes The name of the axis to associate with inputType <ko>inputType과 연결할 축의 이름</ko>
|
|
5096
|
-
* @param {Object} inputType The inputType instance to associate with the axis of eg.Axes <ko>eg.Axes의 축과 연결할 inputType 인스턴스</ko>
|
|
5097
|
-
* @return {eg.Axes} An instance of a module itself <ko>모듈 자신의 인스턴스</ko>
|
|
5098
|
-
* @example
|
|
5099
|
-
* ```js
|
|
5100
|
-
* const axes = new eg.Axes({
|
|
5101
|
-
* "x": {
|
|
5102
|
-
* range: [0, 100]
|
|
5103
|
-
* },
|
|
5104
|
-
* "xOther": {
|
|
5105
|
-
* range: [-100, 100]
|
|
5106
|
-
* }
|
|
5107
|
-
* });
|
|
5108
|
-
*
|
|
5109
|
-
* axes.connect("x", new eg.Axes.PanInput("#area1"))
|
|
5110
|
-
* .connect("x xOther", new eg.Axes.PanInput("#area2"))
|
|
5111
|
-
* .connect(" xOther", new eg.Axes.PanInput("#area3"))
|
|
5112
|
-
* .connect(["x"], new eg.Axes.PanInput("#area4"))
|
|
5113
|
-
* .connect(["xOther", "x"], new eg.Axes.PanInput("#area5"))
|
|
5114
|
-
* .connect(["", "xOther"], new eg.Axes.PanInput("#area6"));
|
|
5115
|
-
* ```
|
|
4704
|
+
/**
|
|
4705
|
+
* Connect the axis of eg.Axes to the inputType.
|
|
4706
|
+
* @ko eg.Axes의 축과 inputType을 연결한다
|
|
4707
|
+
* @param {(String[]|String)} axes The name of the axis to associate with inputType <ko>inputType과 연결할 축의 이름</ko>
|
|
4708
|
+
* @param {Object} inputType The inputType instance to associate with the axis of eg.Axes <ko>eg.Axes의 축과 연결할 inputType 인스턴스</ko>
|
|
4709
|
+
* @return {eg.Axes} An instance of a module itself <ko>모듈 자신의 인스턴스</ko>
|
|
4710
|
+
* @example
|
|
4711
|
+
* ```js
|
|
4712
|
+
* const axes = new eg.Axes({
|
|
4713
|
+
* "x": {
|
|
4714
|
+
* range: [0, 100]
|
|
4715
|
+
* },
|
|
4716
|
+
* "xOther": {
|
|
4717
|
+
* range: [-100, 100]
|
|
4718
|
+
* }
|
|
4719
|
+
* });
|
|
4720
|
+
*
|
|
4721
|
+
* axes.connect("x", new eg.Axes.PanInput("#area1"))
|
|
4722
|
+
* .connect("x xOther", new eg.Axes.PanInput("#area2"))
|
|
4723
|
+
* .connect(" xOther", new eg.Axes.PanInput("#area3"))
|
|
4724
|
+
* .connect(["x"], new eg.Axes.PanInput("#area4"))
|
|
4725
|
+
* .connect(["xOther", "x"], new eg.Axes.PanInput("#area5"))
|
|
4726
|
+
* .connect(["", "xOther"], new eg.Axes.PanInput("#area6"));
|
|
4727
|
+
* ```
|
|
5116
4728
|
*/
|
|
5117
|
-
|
|
5118
4729
|
__proto.connect = function (axes, inputType) {
|
|
5119
4730
|
var mapped;
|
|
5120
|
-
|
|
5121
4731
|
if (typeof axes === "string") {
|
|
5122
4732
|
mapped = axes.split(" ");
|
|
5123
4733
|
} else {
|
|
5124
4734
|
mapped = axes.concat();
|
|
5125
|
-
}
|
|
5126
|
-
|
|
5127
|
-
|
|
4735
|
+
}
|
|
4736
|
+
// check same instance
|
|
5128
4737
|
if (~this._inputs.indexOf(inputType)) {
|
|
5129
4738
|
this.disconnect(inputType);
|
|
5130
4739
|
}
|
|
5131
|
-
|
|
5132
4740
|
inputType.mapAxes(mapped);
|
|
5133
4741
|
inputType.connect(this.inputObserver);
|
|
5134
|
-
|
|
5135
4742
|
this._inputs.push(inputType);
|
|
5136
|
-
|
|
5137
4743
|
return this;
|
|
5138
4744
|
};
|
|
5139
|
-
/**
|
|
5140
|
-
* Disconnect the axis of eg.Axes from the inputType.
|
|
5141
|
-
* @ko eg.Axes의 축과 inputType의 연결을 끊는다.
|
|
5142
|
-
* @param {Object} [inputType] An inputType instance associated with the axis of eg.Axes <ko>eg.Axes의 축과 연결한 inputType 인스턴스</ko>
|
|
5143
|
-
* @return {eg.Axes} An instance of a module itself <ko>모듈 자신의 인스턴스</ko>
|
|
5144
|
-
* @example
|
|
5145
|
-
* ```js
|
|
5146
|
-
* const axes = new eg.Axes({
|
|
5147
|
-
* "x": {
|
|
5148
|
-
* range: [0, 100]
|
|
5149
|
-
* },
|
|
5150
|
-
* "xOther": {
|
|
5151
|
-
* range: [-100, 100]
|
|
5152
|
-
* }
|
|
5153
|
-
* });
|
|
5154
|
-
*
|
|
5155
|
-
* const input1 = new eg.Axes.PanInput("#area1");
|
|
5156
|
-
* const input2 = new eg.Axes.PanInput("#area2");
|
|
5157
|
-
* const input3 = new eg.Axes.PanInput("#area3");
|
|
5158
|
-
*
|
|
5159
|
-
* axes.connect("x", input1);
|
|
5160
|
-
* .connect("x xOther", input2)
|
|
5161
|
-
* .connect(["xOther", "x"], input3);
|
|
5162
|
-
*
|
|
5163
|
-
* axes.disconnect(input1); // disconnects input1
|
|
5164
|
-
* axes.disconnect(); // disconnects all of them
|
|
5165
|
-
* ```
|
|
4745
|
+
/**
|
|
4746
|
+
* Disconnect the axis of eg.Axes from the inputType.
|
|
4747
|
+
* @ko eg.Axes의 축과 inputType의 연결을 끊는다.
|
|
4748
|
+
* @param {Object} [inputType] An inputType instance associated with the axis of eg.Axes <ko>eg.Axes의 축과 연결한 inputType 인스턴스</ko>
|
|
4749
|
+
* @return {eg.Axes} An instance of a module itself <ko>모듈 자신의 인스턴스</ko>
|
|
4750
|
+
* @example
|
|
4751
|
+
* ```js
|
|
4752
|
+
* const axes = new eg.Axes({
|
|
4753
|
+
* "x": {
|
|
4754
|
+
* range: [0, 100]
|
|
4755
|
+
* },
|
|
4756
|
+
* "xOther": {
|
|
4757
|
+
* range: [-100, 100]
|
|
4758
|
+
* }
|
|
4759
|
+
* });
|
|
4760
|
+
*
|
|
4761
|
+
* const input1 = new eg.Axes.PanInput("#area1");
|
|
4762
|
+
* const input2 = new eg.Axes.PanInput("#area2");
|
|
4763
|
+
* const input3 = new eg.Axes.PanInput("#area3");
|
|
4764
|
+
*
|
|
4765
|
+
* axes.connect("x", input1);
|
|
4766
|
+
* .connect("x xOther", input2)
|
|
4767
|
+
* .connect(["xOther", "x"], input3);
|
|
4768
|
+
*
|
|
4769
|
+
* axes.disconnect(input1); // disconnects input1
|
|
4770
|
+
* axes.disconnect(); // disconnects all of them
|
|
4771
|
+
* ```
|
|
5166
4772
|
*/
|
|
5167
|
-
|
|
5168
|
-
|
|
5169
4773
|
__proto.disconnect = function (inputType) {
|
|
5170
4774
|
if (inputType) {
|
|
5171
4775
|
var index = this._inputs.indexOf(inputType);
|
|
5172
|
-
|
|
5173
4776
|
if (index >= 0) {
|
|
5174
4777
|
this._inputs[index].disconnect();
|
|
5175
|
-
|
|
5176
4778
|
this._inputs.splice(index, 1);
|
|
5177
4779
|
}
|
|
5178
4780
|
} else {
|
|
5179
4781
|
this._inputs.forEach(function (v) {
|
|
5180
4782
|
return v.disconnect();
|
|
5181
4783
|
});
|
|
5182
|
-
|
|
5183
4784
|
this._inputs = [];
|
|
5184
4785
|
}
|
|
5185
|
-
|
|
5186
4786
|
return this;
|
|
5187
4787
|
};
|
|
5188
|
-
/**
|
|
5189
|
-
* Returns the current position of the coordinates.
|
|
5190
|
-
* @ko 좌표의 현재 위치를 반환한다
|
|
5191
|
-
* @param {Object} [axes] The names of the axis <ko>축 이름들</ko>
|
|
5192
|
-
* @return {Object.<string, number>} Axis coordinate information <ko>축 좌표 정보</ko>
|
|
5193
|
-
* @example
|
|
5194
|
-
* ```js
|
|
5195
|
-
* const axes = new eg.Axes({
|
|
5196
|
-
* "x": {
|
|
5197
|
-
* range: [0, 100]
|
|
5198
|
-
* },
|
|
5199
|
-
* "xOther": {
|
|
5200
|
-
* range: [-100, 100]
|
|
5201
|
-
* },
|
|
5202
|
-
* "zoom": {
|
|
5203
|
-
* range: [50, 30]
|
|
5204
|
-
* }
|
|
5205
|
-
* });
|
|
5206
|
-
*
|
|
5207
|
-
* axes.get(); // {"x": 0, "xOther": -100, "zoom": 50}
|
|
5208
|
-
* axes.get(["x", "zoom"]); // {"x": 0, "zoom": 50}
|
|
5209
|
-
* ```
|
|
4788
|
+
/**
|
|
4789
|
+
* Returns the current position of the coordinates.
|
|
4790
|
+
* @ko 좌표의 현재 위치를 반환한다
|
|
4791
|
+
* @param {Object} [axes] The names of the axis <ko>축 이름들</ko>
|
|
4792
|
+
* @return {Object.<string, number>} Axis coordinate information <ko>축 좌표 정보</ko>
|
|
4793
|
+
* @example
|
|
4794
|
+
* ```js
|
|
4795
|
+
* const axes = new eg.Axes({
|
|
4796
|
+
* "x": {
|
|
4797
|
+
* range: [0, 100]
|
|
4798
|
+
* },
|
|
4799
|
+
* "xOther": {
|
|
4800
|
+
* range: [-100, 100]
|
|
4801
|
+
* },
|
|
4802
|
+
* "zoom": {
|
|
4803
|
+
* range: [50, 30]
|
|
4804
|
+
* }
|
|
4805
|
+
* });
|
|
4806
|
+
*
|
|
4807
|
+
* axes.get(); // {"x": 0, "xOther": -100, "zoom": 50}
|
|
4808
|
+
* axes.get(["x", "zoom"]); // {"x": 0, "zoom": 50}
|
|
4809
|
+
* ```
|
|
5210
4810
|
*/
|
|
5211
|
-
|
|
5212
|
-
|
|
5213
4811
|
__proto.get = function (axes) {
|
|
5214
4812
|
return this.axisManager.get(axes);
|
|
5215
4813
|
};
|
|
5216
|
-
/**
|
|
5217
|
-
* Moves an axis to specific coordinates.
|
|
5218
|
-
* @ko 좌표를 이동한다.
|
|
5219
|
-
* @param {Object.<string, number>} pos The coordinate to move to <ko>이동할 좌표</ko>
|
|
5220
|
-
* @param {Number} [duration=0] Duration of the animation (unit: ms) <ko>애니메이션 진행 시간(단위: ms)</ko>
|
|
5221
|
-
* @return {eg.Axes} An instance of a module itself <ko>모듈 자신의 인스턴스</ko>
|
|
5222
|
-
* @example
|
|
5223
|
-
* ```js
|
|
5224
|
-
* const axes = new eg.Axes({
|
|
5225
|
-
* "x": {
|
|
5226
|
-
* range: [0, 100]
|
|
5227
|
-
* },
|
|
5228
|
-
* "xOther": {
|
|
5229
|
-
* range: [-100, 100]
|
|
5230
|
-
* },
|
|
5231
|
-
* "zoom": {
|
|
5232
|
-
* range: [50, 30]
|
|
5233
|
-
* }
|
|
5234
|
-
* });
|
|
5235
|
-
*
|
|
5236
|
-
* axes.setTo({"x": 30, "zoom": 60});
|
|
5237
|
-
* axes.get(); // {"x": 30, "xOther": -100, "zoom": 60}
|
|
5238
|
-
*
|
|
5239
|
-
* axes.setTo({"x": 100, "xOther": 60}, 1000); // animatation
|
|
5240
|
-
*
|
|
5241
|
-
* // after 1000 ms
|
|
5242
|
-
* axes.get(); // {"x": 100, "xOther": 60, "zoom": 60}
|
|
5243
|
-
* ```
|
|
4814
|
+
/**
|
|
4815
|
+
* Moves an axis to specific coordinates.
|
|
4816
|
+
* @ko 좌표를 이동한다.
|
|
4817
|
+
* @param {Object.<string, number>} pos The coordinate to move to <ko>이동할 좌표</ko>
|
|
4818
|
+
* @param {Number} [duration=0] Duration of the animation (unit: ms) <ko>애니메이션 진행 시간(단위: ms)</ko>
|
|
4819
|
+
* @return {eg.Axes} An instance of a module itself <ko>모듈 자신의 인스턴스</ko>
|
|
4820
|
+
* @example
|
|
4821
|
+
* ```js
|
|
4822
|
+
* const axes = new eg.Axes({
|
|
4823
|
+
* "x": {
|
|
4824
|
+
* range: [0, 100]
|
|
4825
|
+
* },
|
|
4826
|
+
* "xOther": {
|
|
4827
|
+
* range: [-100, 100]
|
|
4828
|
+
* },
|
|
4829
|
+
* "zoom": {
|
|
4830
|
+
* range: [50, 30]
|
|
4831
|
+
* }
|
|
4832
|
+
* });
|
|
4833
|
+
*
|
|
4834
|
+
* axes.setTo({"x": 30, "zoom": 60});
|
|
4835
|
+
* axes.get(); // {"x": 30, "xOther": -100, "zoom": 60}
|
|
4836
|
+
*
|
|
4837
|
+
* axes.setTo({"x": 100, "xOther": 60}, 1000); // animatation
|
|
4838
|
+
*
|
|
4839
|
+
* // after 1000 ms
|
|
4840
|
+
* axes.get(); // {"x": 100, "xOther": 60, "zoom": 60}
|
|
4841
|
+
* ```
|
|
5244
4842
|
*/
|
|
5245
|
-
|
|
5246
|
-
|
|
5247
4843
|
__proto.setTo = function (pos, duration) {
|
|
5248
4844
|
if (duration === void 0) {
|
|
5249
4845
|
duration = 0;
|
|
5250
4846
|
}
|
|
5251
|
-
|
|
5252
4847
|
this.animationManager.setTo(pos, duration);
|
|
5253
4848
|
return this;
|
|
5254
4849
|
};
|
|
5255
|
-
/**
|
|
5256
|
-
* Moves an axis from the current coordinates to specific coordinates.
|
|
5257
|
-
* @ko 현재 좌표를 기준으로 좌표를 이동한다.
|
|
5258
|
-
* @param {Object.<string, number>} pos The coordinate to move to <ko>이동할 좌표</ko>
|
|
5259
|
-
* @param {Number} [duration=0] Duration of the animation (unit: ms) <ko>애니메이션 진행 시간(단위: ms)</ko>
|
|
5260
|
-
* @return {eg.Axes} An instance of a module itself <ko>모듈 자신의 인스턴스</ko>
|
|
5261
|
-
* @example
|
|
5262
|
-
* ```js
|
|
5263
|
-
* const axes = new eg.Axes({
|
|
5264
|
-
* "x": {
|
|
5265
|
-
* range: [0, 100]
|
|
5266
|
-
* },
|
|
5267
|
-
* "xOther": {
|
|
5268
|
-
* range: [-100, 100]
|
|
5269
|
-
* },
|
|
5270
|
-
* "zoom": {
|
|
5271
|
-
* range: [50, 30]
|
|
5272
|
-
* }
|
|
5273
|
-
* });
|
|
5274
|
-
*
|
|
5275
|
-
* axes.setBy({"x": 30, "zoom": 10});
|
|
5276
|
-
* axes.get(); // {"x": 30, "xOther": -100, "zoom": 60}
|
|
5277
|
-
*
|
|
5278
|
-
* axes.setBy({"x": 70, "xOther": 60}, 1000); // animatation
|
|
5279
|
-
*
|
|
5280
|
-
* // after 1000 ms
|
|
5281
|
-
* axes.get(); // {"x": 100, "xOther": -40, "zoom": 60}
|
|
5282
|
-
* ```
|
|
4850
|
+
/**
|
|
4851
|
+
* Moves an axis from the current coordinates to specific coordinates.
|
|
4852
|
+
* @ko 현재 좌표를 기준으로 좌표를 이동한다.
|
|
4853
|
+
* @param {Object.<string, number>} pos The coordinate to move to <ko>이동할 좌표</ko>
|
|
4854
|
+
* @param {Number} [duration=0] Duration of the animation (unit: ms) <ko>애니메이션 진행 시간(단위: ms)</ko>
|
|
4855
|
+
* @return {eg.Axes} An instance of a module itself <ko>모듈 자신의 인스턴스</ko>
|
|
4856
|
+
* @example
|
|
4857
|
+
* ```js
|
|
4858
|
+
* const axes = new eg.Axes({
|
|
4859
|
+
* "x": {
|
|
4860
|
+
* range: [0, 100]
|
|
4861
|
+
* },
|
|
4862
|
+
* "xOther": {
|
|
4863
|
+
* range: [-100, 100]
|
|
4864
|
+
* },
|
|
4865
|
+
* "zoom": {
|
|
4866
|
+
* range: [50, 30]
|
|
4867
|
+
* }
|
|
4868
|
+
* });
|
|
4869
|
+
*
|
|
4870
|
+
* axes.setBy({"x": 30, "zoom": 10});
|
|
4871
|
+
* axes.get(); // {"x": 30, "xOther": -100, "zoom": 60}
|
|
4872
|
+
*
|
|
4873
|
+
* axes.setBy({"x": 70, "xOther": 60}, 1000); // animatation
|
|
4874
|
+
*
|
|
4875
|
+
* // after 1000 ms
|
|
4876
|
+
* axes.get(); // {"x": 100, "xOther": -40, "zoom": 60}
|
|
4877
|
+
* ```
|
|
5283
4878
|
*/
|
|
5284
|
-
|
|
5285
|
-
|
|
5286
4879
|
__proto.setBy = function (pos, duration) {
|
|
5287
4880
|
if (duration === void 0) {
|
|
5288
4881
|
duration = 0;
|
|
5289
4882
|
}
|
|
5290
|
-
|
|
5291
4883
|
this.animationManager.setBy(pos, duration);
|
|
5292
4884
|
return this;
|
|
5293
4885
|
};
|
|
5294
|
-
/**
|
|
5295
|
-
* Change the options of Axes instance.
|
|
5296
|
-
* @ko 인스턴스의 옵션을 변경한다.
|
|
5297
|
-
* @param {AxesOption} options Axes options to change <ko>변경할 옵션 목록</ko>
|
|
5298
|
-
* @return {eg.Axes} An instance of a module itself <ko>모듈 자신의 인스턴스</ko>
|
|
5299
|
-
* @example
|
|
5300
|
-
* ```js
|
|
5301
|
-
* const axes = new eg.Axes({
|
|
5302
|
-
* "x": {
|
|
5303
|
-
* range: [0, 100]
|
|
5304
|
-
* },
|
|
5305
|
-
* }, {
|
|
5306
|
-
* round: 10,
|
|
5307
|
-
* });
|
|
5308
|
-
*
|
|
5309
|
-
* axes.setTo({"x": 48});
|
|
5310
|
-
* axes.get(); // {"x": 50}
|
|
5311
|
-
*
|
|
5312
|
-
* axes.setOptions({
|
|
5313
|
-
* round: 1,
|
|
5314
|
-
* });
|
|
5315
|
-
*
|
|
5316
|
-
* axes.setTo({"x": 48});
|
|
5317
|
-
* axes.get(); // {"x": 48}
|
|
5318
|
-
* ```
|
|
4886
|
+
/**
|
|
4887
|
+
* Change the options of Axes instance.
|
|
4888
|
+
* @ko 인스턴스의 옵션을 변경한다.
|
|
4889
|
+
* @param {AxesOption} options Axes options to change <ko>변경할 옵션 목록</ko>
|
|
4890
|
+
* @return {eg.Axes} An instance of a module itself <ko>모듈 자신의 인스턴스</ko>
|
|
4891
|
+
* @example
|
|
4892
|
+
* ```js
|
|
4893
|
+
* const axes = new eg.Axes({
|
|
4894
|
+
* "x": {
|
|
4895
|
+
* range: [0, 100]
|
|
4896
|
+
* },
|
|
4897
|
+
* }, {
|
|
4898
|
+
* round: 10,
|
|
4899
|
+
* });
|
|
4900
|
+
*
|
|
4901
|
+
* axes.setTo({"x": 48});
|
|
4902
|
+
* axes.get(); // {"x": 50}
|
|
4903
|
+
*
|
|
4904
|
+
* axes.setOptions({
|
|
4905
|
+
* round: 1,
|
|
4906
|
+
* });
|
|
4907
|
+
*
|
|
4908
|
+
* axes.setTo({"x": 48});
|
|
4909
|
+
* axes.get(); // {"x": 48}
|
|
4910
|
+
* ```
|
|
5319
4911
|
*/
|
|
5320
|
-
|
|
5321
|
-
|
|
5322
4912
|
__proto.setOptions = function (options) {
|
|
5323
4913
|
this.options = __assign$1(__assign$1({}, this.options), options);
|
|
4914
|
+
this.animationManager.setOptions(options);
|
|
5324
4915
|
return this;
|
|
5325
4916
|
};
|
|
5326
|
-
/**
|
|
5327
|
-
* Change the information of an existing axis.
|
|
5328
|
-
* @ko 존재하는 축의 정보를 변경한다.
|
|
5329
|
-
* @param {Object.<string, AxisOption>} axis Axis options to change <ko>변경할 축의 정보</ko>
|
|
5330
|
-
* @return {eg.Axes} An instance of a module itself <ko>모듈 자신의 인스턴스</ko>
|
|
5331
|
-
* @example
|
|
5332
|
-
* ```js
|
|
5333
|
-
* const axes = new eg.Axes({
|
|
5334
|
-
* "x": {
|
|
5335
|
-
* range: [0, 100]
|
|
5336
|
-
* },
|
|
5337
|
-
* });
|
|
5338
|
-
*
|
|
5339
|
-
* axes.setTo({"x": 150});
|
|
5340
|
-
* axes.get(); // {"x": 100}
|
|
5341
|
-
*
|
|
5342
|
-
* axes.setAxis({
|
|
5343
|
-
* "x": {
|
|
5344
|
-
* range: [0, 200]
|
|
5345
|
-
* },
|
|
5346
|
-
* });
|
|
5347
|
-
*
|
|
5348
|
-
* axes.setTo({"x": 150});
|
|
5349
|
-
* axes.get(); // {"x": 150}
|
|
5350
|
-
* ```
|
|
4917
|
+
/**
|
|
4918
|
+
* Change the information of an existing axis.
|
|
4919
|
+
* @ko 존재하는 축의 정보를 변경한다.
|
|
4920
|
+
* @param {Object.<string, AxisOption>} axis Axis options to change <ko>변경할 축의 정보</ko>
|
|
4921
|
+
* @return {eg.Axes} An instance of a module itself <ko>모듈 자신의 인스턴스</ko>
|
|
4922
|
+
* @example
|
|
4923
|
+
* ```js
|
|
4924
|
+
* const axes = new eg.Axes({
|
|
4925
|
+
* "x": {
|
|
4926
|
+
* range: [0, 100]
|
|
4927
|
+
* },
|
|
4928
|
+
* });
|
|
4929
|
+
*
|
|
4930
|
+
* axes.setTo({"x": 150});
|
|
4931
|
+
* axes.get(); // {"x": 100}
|
|
4932
|
+
*
|
|
4933
|
+
* axes.setAxis({
|
|
4934
|
+
* "x": {
|
|
4935
|
+
* range: [0, 200]
|
|
4936
|
+
* },
|
|
4937
|
+
* });
|
|
4938
|
+
*
|
|
4939
|
+
* axes.setTo({"x": 150});
|
|
4940
|
+
* axes.get(); // {"x": 150}
|
|
4941
|
+
* ```
|
|
5351
4942
|
*/
|
|
5352
|
-
|
|
5353
|
-
|
|
5354
4943
|
__proto.setAxis = function (axis) {
|
|
5355
4944
|
this.axisManager.setAxis(axis);
|
|
5356
4945
|
return this;
|
|
5357
4946
|
};
|
|
5358
|
-
/**
|
|
5359
|
-
* Stop an animation in progress.
|
|
5360
|
-
* @ko 재생 중인 애니메이션을 정지한다.
|
|
5361
|
-
* @return {eg.Axes} An instance of a module itself <ko>모듈 자신의 인스턴스</ko>
|
|
5362
|
-
* @example
|
|
5363
|
-
* ```js
|
|
5364
|
-
* const axes = new eg.Axes({
|
|
5365
|
-
* "x": {
|
|
5366
|
-
* range: [0, 100]
|
|
5367
|
-
* },
|
|
5368
|
-
* });
|
|
5369
|
-
*
|
|
5370
|
-
* axes.setTo({"x": 10}, 1000); // start animatation
|
|
5371
|
-
*
|
|
5372
|
-
* // after 500 ms
|
|
5373
|
-
* axes.stopAnimation(); // stop animation during movement.
|
|
5374
|
-
* ```
|
|
4947
|
+
/**
|
|
4948
|
+
* Stop an animation in progress.
|
|
4949
|
+
* @ko 재생 중인 애니메이션을 정지한다.
|
|
4950
|
+
* @return {eg.Axes} An instance of a module itself <ko>모듈 자신의 인스턴스</ko>
|
|
4951
|
+
* @example
|
|
4952
|
+
* ```js
|
|
4953
|
+
* const axes = new eg.Axes({
|
|
4954
|
+
* "x": {
|
|
4955
|
+
* range: [0, 100]
|
|
4956
|
+
* },
|
|
4957
|
+
* });
|
|
4958
|
+
*
|
|
4959
|
+
* axes.setTo({"x": 10}, 1000); // start animatation
|
|
4960
|
+
*
|
|
4961
|
+
* // after 500 ms
|
|
4962
|
+
* axes.stopAnimation(); // stop animation during movement.
|
|
4963
|
+
* ```
|
|
5375
4964
|
*/
|
|
5376
|
-
|
|
5377
|
-
|
|
5378
4965
|
__proto.stopAnimation = function () {
|
|
5379
4966
|
this.animationManager.stopAnimation();
|
|
5380
4967
|
this.animationManager.finish(false);
|
|
5381
4968
|
return this;
|
|
5382
4969
|
};
|
|
5383
|
-
/**
|
|
5384
|
-
* Change the destination of an animation in progress.
|
|
5385
|
-
* @ko 재생 중인 애니메이션의 목적지와 진행 시간을 변경한다.
|
|
5386
|
-
* @param {UpdateAnimationOption} pos The coordinate to move to <ko>이동할 좌표</ko>
|
|
5387
|
-
* @return {eg.Axes} An instance of a module itself <ko>모듈 자신의 인스턴스</ko>
|
|
5388
|
-
* @example
|
|
5389
|
-
* ```js
|
|
5390
|
-
* const axes = new eg.Axes({
|
|
5391
|
-
* "x": {
|
|
5392
|
-
* range: [0, 200]
|
|
5393
|
-
* },
|
|
5394
|
-
* "y": {
|
|
5395
|
-
* range: [0, 200]
|
|
5396
|
-
* }
|
|
5397
|
-
* });
|
|
5398
|
-
*
|
|
5399
|
-
* axes.setTo({"x": 50, "y": 50}, 1000); // trigger animation by setTo
|
|
5400
|
-
*
|
|
5401
|
-
* // after 500 ms
|
|
5402
|
-
* axes.updateAnimation({destPos: {"x": 100, "y": 100}}); // animation will end after 500 ms, at {"x": 100, "y": 100}
|
|
5403
|
-
*
|
|
5404
|
-
* // after 500 ms
|
|
5405
|
-
* axes.setTo({"x": 50, "y": 50}, 1000); // trigger animation by setTo
|
|
5406
|
-
*
|
|
5407
|
-
* // after 700 ms
|
|
5408
|
-
* axes.updateAnimation({destPos: {"x": 100, "y": 100}, duration: 1500, restart: true}); // this works same as axes.setTo({"x": 100, "y": 100}, 800) since restart is true.
|
|
5409
|
-
* ```
|
|
4970
|
+
/**
|
|
4971
|
+
* Change the destination of an animation in progress.
|
|
4972
|
+
* @ko 재생 중인 애니메이션의 목적지와 진행 시간을 변경한다.
|
|
4973
|
+
* @param {UpdateAnimationOption} pos The coordinate to move to <ko>이동할 좌표</ko>
|
|
4974
|
+
* @return {eg.Axes} An instance of a module itself <ko>모듈 자신의 인스턴스</ko>
|
|
4975
|
+
* @example
|
|
4976
|
+
* ```js
|
|
4977
|
+
* const axes = new eg.Axes({
|
|
4978
|
+
* "x": {
|
|
4979
|
+
* range: [0, 200]
|
|
4980
|
+
* },
|
|
4981
|
+
* "y": {
|
|
4982
|
+
* range: [0, 200]
|
|
4983
|
+
* }
|
|
4984
|
+
* });
|
|
4985
|
+
*
|
|
4986
|
+
* axes.setTo({"x": 50, "y": 50}, 1000); // trigger animation by setTo
|
|
4987
|
+
*
|
|
4988
|
+
* // after 500 ms
|
|
4989
|
+
* axes.updateAnimation({destPos: {"x": 100, "y": 100}}); // animation will end after 500 ms, at {"x": 100, "y": 100}
|
|
4990
|
+
*
|
|
4991
|
+
* // after 500 ms
|
|
4992
|
+
* axes.setTo({"x": 50, "y": 50}, 1000); // trigger animation by setTo
|
|
4993
|
+
*
|
|
4994
|
+
* // after 700 ms
|
|
4995
|
+
* axes.updateAnimation({destPos: {"x": 100, "y": 100}, duration: 1500, restart: true}); // this works same as axes.setTo({"x": 100, "y": 100}, 800) since restart is true.
|
|
4996
|
+
* ```
|
|
5410
4997
|
*/
|
|
5411
|
-
|
|
5412
|
-
|
|
5413
4998
|
__proto.updateAnimation = function (options) {
|
|
5414
4999
|
this.animationManager.updateAnimation(options);
|
|
5415
5000
|
return this;
|
|
5416
5001
|
};
|
|
5417
|
-
/**
|
|
5418
|
-
* Returns whether there is a coordinate in the bounce area of the target axis.
|
|
5419
|
-
* @ko 대상 축 중 bounce영역에 좌표가 존재하는지를 반환한다
|
|
5420
|
-
* @param {Object} [axes] The names of the axis <ko>축 이름들</ko>
|
|
5421
|
-
* @return {Boolen} Whether the bounce area exists. <ko>bounce 영역 존재 여부</ko>
|
|
5422
|
-
* @example
|
|
5423
|
-
* ```js
|
|
5424
|
-
* const axes = new eg.Axes({
|
|
5425
|
-
* "x": {
|
|
5426
|
-
* range: [0, 100]
|
|
5427
|
-
* },
|
|
5428
|
-
* "xOther": {
|
|
5429
|
-
* range: [-100, 100]
|
|
5430
|
-
* },
|
|
5431
|
-
* "zoom": {
|
|
5432
|
-
* range: [50, 30]
|
|
5433
|
-
* }
|
|
5434
|
-
* });
|
|
5435
|
-
*
|
|
5436
|
-
* axes.isBounceArea(["x"]);
|
|
5437
|
-
* axes.isBounceArea(["x", "zoom"]);
|
|
5438
|
-
* axes.isBounceArea();
|
|
5439
|
-
* ```
|
|
5002
|
+
/**
|
|
5003
|
+
* Returns whether there is a coordinate in the bounce area of the target axis.
|
|
5004
|
+
* @ko 대상 축 중 bounce영역에 좌표가 존재하는지를 반환한다
|
|
5005
|
+
* @param {Object} [axes] The names of the axis <ko>축 이름들</ko>
|
|
5006
|
+
* @return {Boolen} Whether the bounce area exists. <ko>bounce 영역 존재 여부</ko>
|
|
5007
|
+
* @example
|
|
5008
|
+
* ```js
|
|
5009
|
+
* const axes = new eg.Axes({
|
|
5010
|
+
* "x": {
|
|
5011
|
+
* range: [0, 100]
|
|
5012
|
+
* },
|
|
5013
|
+
* "xOther": {
|
|
5014
|
+
* range: [-100, 100]
|
|
5015
|
+
* },
|
|
5016
|
+
* "zoom": {
|
|
5017
|
+
* range: [50, 30]
|
|
5018
|
+
* }
|
|
5019
|
+
* });
|
|
5020
|
+
*
|
|
5021
|
+
* axes.isBounceArea(["x"]);
|
|
5022
|
+
* axes.isBounceArea(["x", "zoom"]);
|
|
5023
|
+
* axes.isBounceArea();
|
|
5024
|
+
* ```
|
|
5440
5025
|
*/
|
|
5441
|
-
|
|
5442
|
-
|
|
5443
5026
|
__proto.isBounceArea = function (axes) {
|
|
5444
5027
|
return this.axisManager.isOutside(axes);
|
|
5445
5028
|
};
|
|
5446
|
-
/**
|
|
5447
|
-
* Destroys properties, and events used in a module and disconnect all connections to inputTypes.
|
|
5448
|
-
* @ko 모듈에 사용한 속성, 이벤트를 해제한다. 모든 inputType과의 연결을 끊는다.
|
|
5029
|
+
/**
|
|
5030
|
+
* Destroys properties, and events used in a module and disconnect all connections to inputTypes.
|
|
5031
|
+
* @ko 모듈에 사용한 속성, 이벤트를 해제한다. 모든 inputType과의 연결을 끊는다.
|
|
5449
5032
|
*/
|
|
5450
|
-
|
|
5451
|
-
|
|
5452
5033
|
__proto.destroy = function () {
|
|
5453
5034
|
this.disconnect();
|
|
5454
5035
|
this.eventManager.destroy();
|
|
5455
5036
|
};
|
|
5456
|
-
/**
|
|
5457
|
-
* @name VERSION
|
|
5458
|
-
* @desc Version info string
|
|
5459
|
-
* @ko 버전정보 문자열
|
|
5460
|
-
*
|
|
5461
|
-
* @constant
|
|
5462
|
-
* @type {String}
|
|
5463
|
-
* @example
|
|
5464
|
-
* ```js
|
|
5465
|
-
* eg.Axes.VERSION; // ex) 3.3.3
|
|
5466
|
-
* ```
|
|
5037
|
+
/**
|
|
5038
|
+
* @name VERSION
|
|
5039
|
+
* @desc Version info string
|
|
5040
|
+
* @ko 버전정보 문자열
|
|
5041
|
+
*
|
|
5042
|
+
* @constant
|
|
5043
|
+
* @type {String}
|
|
5044
|
+
* @example
|
|
5045
|
+
* ```js
|
|
5046
|
+
* eg.Axes.VERSION; // ex) 3.3.3
|
|
5047
|
+
* ```
|
|
5467
5048
|
*/
|
|
5468
|
-
|
|
5469
|
-
|
|
5470
|
-
Axes.VERSION = "3.8.4";
|
|
5049
|
+
Axes.VERSION = "3.9.0";
|
|
5471
5050
|
/* eslint-enable */
|
|
5472
|
-
|
|
5473
|
-
|
|
5474
|
-
* @
|
|
5475
|
-
* @
|
|
5476
|
-
*
|
|
5477
|
-
*
|
|
5478
|
-
* @
|
|
5479
|
-
* @
|
|
5480
|
-
*
|
|
5481
|
-
*
|
|
5482
|
-
*
|
|
5483
|
-
* ```
|
|
5051
|
+
/**
|
|
5052
|
+
* @name TRANSFORM
|
|
5053
|
+
* @desc Returns the transform attribute with CSS vendor prefixes.
|
|
5054
|
+
* @ko CSS vendor prefixes를 붙인 transform 속성을 반환한다.
|
|
5055
|
+
*
|
|
5056
|
+
* @constant
|
|
5057
|
+
* @type {String}
|
|
5058
|
+
* @example
|
|
5059
|
+
* ```js
|
|
5060
|
+
* eg.Axes.TRANSFORM; // "transform" or "webkitTransform"
|
|
5061
|
+
* ```
|
|
5484
5062
|
*/
|
|
5485
|
-
|
|
5486
5063
|
Axes.TRANSFORM = TRANSFORM;
|
|
5487
|
-
/**
|
|
5488
|
-
* @name DIRECTION_NONE
|
|
5489
|
-
* @constant
|
|
5490
|
-
* @type {Number}
|
|
5064
|
+
/**
|
|
5065
|
+
* @name DIRECTION_NONE
|
|
5066
|
+
* @constant
|
|
5067
|
+
* @type {Number}
|
|
5491
5068
|
*/
|
|
5492
|
-
|
|
5493
5069
|
Axes.DIRECTION_NONE = DIRECTION_NONE;
|
|
5494
|
-
/**
|
|
5495
|
-
* @name DIRECTION_LEFT
|
|
5496
|
-
* @constant
|
|
5497
|
-
* @type {Number}
|
|
5070
|
+
/**
|
|
5071
|
+
* @name DIRECTION_LEFT
|
|
5072
|
+
* @constant
|
|
5073
|
+
* @type {Number}
|
|
5498
5074
|
*/
|
|
5499
|
-
|
|
5500
5075
|
Axes.DIRECTION_LEFT = DIRECTION_LEFT;
|
|
5501
|
-
/**
|
|
5502
|
-
* @name DIRECTION_RIGHT
|
|
5503
|
-
* @constant
|
|
5504
|
-
* @type {Number}
|
|
5076
|
+
/**
|
|
5077
|
+
* @name DIRECTION_RIGHT
|
|
5078
|
+
* @constant
|
|
5079
|
+
* @type {Number}
|
|
5505
5080
|
*/
|
|
5506
|
-
|
|
5507
5081
|
Axes.DIRECTION_RIGHT = DIRECTION_RIGHT;
|
|
5508
|
-
/**
|
|
5509
|
-
* @name DIRECTION_UP
|
|
5510
|
-
* @constant
|
|
5511
|
-
* @type {Number}
|
|
5082
|
+
/**
|
|
5083
|
+
* @name DIRECTION_UP
|
|
5084
|
+
* @constant
|
|
5085
|
+
* @type {Number}
|
|
5512
5086
|
*/
|
|
5513
|
-
|
|
5514
5087
|
Axes.DIRECTION_UP = DIRECTION_UP;
|
|
5515
|
-
/**
|
|
5516
|
-
* @name DIRECTION_DOWN
|
|
5517
|
-
* @constant
|
|
5518
|
-
* @type {Number}
|
|
5088
|
+
/**
|
|
5089
|
+
* @name DIRECTION_DOWN
|
|
5090
|
+
* @constant
|
|
5091
|
+
* @type {Number}
|
|
5519
5092
|
*/
|
|
5520
|
-
|
|
5521
5093
|
Axes.DIRECTION_DOWN = DIRECTION_DOWN;
|
|
5522
|
-
/**
|
|
5523
|
-
* @name DIRECTION_HORIZONTAL
|
|
5524
|
-
* @constant
|
|
5525
|
-
* @type {Number}
|
|
5094
|
+
/**
|
|
5095
|
+
* @name DIRECTION_HORIZONTAL
|
|
5096
|
+
* @constant
|
|
5097
|
+
* @type {Number}
|
|
5526
5098
|
*/
|
|
5527
|
-
|
|
5528
5099
|
Axes.DIRECTION_HORIZONTAL = DIRECTION_HORIZONTAL;
|
|
5529
|
-
/**
|
|
5530
|
-
* @name DIRECTION_VERTICAL
|
|
5531
|
-
* @constant
|
|
5532
|
-
* @type {Number}
|
|
5100
|
+
/**
|
|
5101
|
+
* @name DIRECTION_VERTICAL
|
|
5102
|
+
* @constant
|
|
5103
|
+
* @type {Number}
|
|
5533
5104
|
*/
|
|
5534
|
-
|
|
5535
5105
|
Axes.DIRECTION_VERTICAL = DIRECTION_VERTICAL;
|
|
5536
|
-
/**
|
|
5537
|
-
* @name DIRECTION_ALL
|
|
5538
|
-
* @constant
|
|
5539
|
-
* @type {Number}
|
|
5106
|
+
/**
|
|
5107
|
+
* @name DIRECTION_ALL
|
|
5108
|
+
* @constant
|
|
5109
|
+
* @type {Number}
|
|
5540
5110
|
*/
|
|
5541
|
-
|
|
5542
5111
|
Axes.DIRECTION_ALL = DIRECTION_ALL;
|
|
5543
|
-
|
|
5544
5112
|
__decorate([Computed], Axes.prototype, "holding", null);
|
|
5545
|
-
|
|
5546
5113
|
Axes = __decorate([ReactiveSubscribe], Axes);
|
|
5547
5114
|
return Axes;
|
|
5548
5115
|
}(Component);
|
|
5549
5116
|
|
|
5550
|
-
/*
|
|
5551
|
-
* Copyright (c) 2015 NAVER Corp.
|
|
5552
|
-
* egjs projects are licensed under the MIT license
|
|
5117
|
+
/*
|
|
5118
|
+
* Copyright (c) 2015 NAVER Corp.
|
|
5119
|
+
* egjs projects are licensed under the MIT license
|
|
5553
5120
|
*/
|
|
5554
|
-
|
|
5121
|
+
// get user's direction
|
|
5555
5122
|
var getDirectionByAngle = function (angle, thresholdAngle) {
|
|
5556
5123
|
if (thresholdAngle < 0 || thresholdAngle > 90) {
|
|
5557
5124
|
return DIRECTION_NONE;
|
|
5558
5125
|
}
|
|
5559
|
-
|
|
5560
5126
|
var toAngle = Math.abs(angle);
|
|
5561
5127
|
return toAngle > thresholdAngle && toAngle < 180 - thresholdAngle ? DIRECTION_VERTICAL : DIRECTION_HORIZONTAL;
|
|
5562
5128
|
};
|
|
5563
|
-
/**
|
|
5564
|
-
* @typedef {Object} PanInputOption The option object of the eg.Axes.PanInput module.
|
|
5565
|
-
* @ko eg.Axes.PanInput 모듈의 옵션 객체
|
|
5566
|
-
* @param {String[]} [inputType=["touch", "mouse", "pointer"]] Types of input devices
|
|
5567
|
-
* - touch: Touch screen
|
|
5568
|
-
* - mouse: Mouse
|
|
5569
|
-
* - pointer: Mouse and touch <ko>입력 장치 종류
|
|
5570
|
-
* - touch: 터치 입력 장치
|
|
5571
|
-
* - mouse: 마우스
|
|
5572
|
-
* - pointer: 마우스 및 터치</ko>
|
|
5573
|
-
* @param {String[]} [inputKey=["any"]] List of key combinations to allow input
|
|
5574
|
-
* - any: any key
|
|
5575
|
-
* - shift: shift key
|
|
5576
|
-
* - ctrl: ctrl key and pinch gesture on the trackpad
|
|
5577
|
-
* - alt: alt key
|
|
5578
|
-
* - meta: meta key
|
|
5579
|
-
* - none: none of these keys are pressed <ko>입력을 허용할 키 조합 목록
|
|
5580
|
-
* - any: 아무 키
|
|
5581
|
-
* - shift: shift 키
|
|
5582
|
-
* - ctrl: ctrl 키 및 트랙패드의 pinch 제스쳐
|
|
5583
|
-
* - alt: alt 키
|
|
5584
|
-
* - meta: meta 키
|
|
5585
|
-
* - none: 아무 키도 눌리지 않은 상태 </ko>
|
|
5586
|
-
* @param {String[]} [inputButton=["left"]] List of buttons to allow input
|
|
5587
|
-
* - left: Left mouse button and normal touch
|
|
5588
|
-
* - middle: Mouse wheel press
|
|
5589
|
-
* - right: Right mouse button <ko>입력을 허용할 버튼 목록
|
|
5590
|
-
* - left: 마우스 왼쪽 버튼
|
|
5591
|
-
* - middle: 마우스 휠 눌림
|
|
5592
|
-
* - right: 마우스 오른쪽 버튼 </ko>
|
|
5593
|
-
* @param {Number[]} [scale] Coordinate scale that a user can move<ko>사용자의 동작으로 이동하는 좌표의 배율</ko>
|
|
5594
|
-
* @param {Number} [scale[0]=1] horizontal axis scale <ko>수평축 배율</ko>
|
|
5595
|
-
* @param {Number} [scale[1]=1] vertical axis scale <ko>수직축 배율</ko>
|
|
5596
|
-
* @param {Number} [thresholdAngle=45] The threshold value that determines whether user action is horizontal or vertical (0~90) <ko>사용자의 동작이 가로 방향인지 세로 방향인지 판단하는 기준 각도(0~90)</ko>
|
|
5597
|
-
* @param {Number} [threshold=0] Minimal pan distance required before recognizing <ko>사용자의 Pan 동작을 인식하기 위해산 최소한의 거리</ko>
|
|
5598
|
-
* @param {Boolean} [preventClickOnDrag=false] Whether to cancel the {@link https://developer.mozilla.org/en/docs/Web/API/Element/click_event click} event when the user finishes dragging more than 1 pixel <ko>사용자가 1픽셀 이상 드래그를 마쳤을 때 {@link https://developer.mozilla.org/ko/docs/Web/API/Element/click_event click} 이벤트 취소 여부</ko>
|
|
5599
|
-
* @param {
|
|
5600
|
-
* @param {
|
|
5129
|
+
/**
|
|
5130
|
+
* @typedef {Object} PanInputOption The option object of the eg.Axes.PanInput module.
|
|
5131
|
+
* @ko eg.Axes.PanInput 모듈의 옵션 객체
|
|
5132
|
+
* @param {String[]} [inputType=["touch", "mouse", "pointer"]] Types of input devices
|
|
5133
|
+
* - touch: Touch screen
|
|
5134
|
+
* - mouse: Mouse
|
|
5135
|
+
* - pointer: Mouse and touch <ko>입력 장치 종류
|
|
5136
|
+
* - touch: 터치 입력 장치
|
|
5137
|
+
* - mouse: 마우스
|
|
5138
|
+
* - pointer: 마우스 및 터치</ko>
|
|
5139
|
+
* @param {String[]} [inputKey=["any"]] List of key combinations to allow input
|
|
5140
|
+
* - any: any key
|
|
5141
|
+
* - shift: shift key
|
|
5142
|
+
* - ctrl: ctrl key and pinch gesture on the trackpad
|
|
5143
|
+
* - alt: alt key
|
|
5144
|
+
* - meta: meta key
|
|
5145
|
+
* - none: none of these keys are pressed <ko>입력을 허용할 키 조합 목록
|
|
5146
|
+
* - any: 아무 키
|
|
5147
|
+
* - shift: shift 키
|
|
5148
|
+
* - ctrl: ctrl 키 및 트랙패드의 pinch 제스쳐
|
|
5149
|
+
* - alt: alt 키
|
|
5150
|
+
* - meta: meta 키
|
|
5151
|
+
* - none: 아무 키도 눌리지 않은 상태 </ko>
|
|
5152
|
+
* @param {String[]} [inputButton=["left"]] List of buttons to allow input
|
|
5153
|
+
* - left: Left mouse button and normal touch
|
|
5154
|
+
* - middle: Mouse wheel press
|
|
5155
|
+
* - right: Right mouse button <ko>입력을 허용할 버튼 목록
|
|
5156
|
+
* - left: 마우스 왼쪽 버튼
|
|
5157
|
+
* - middle: 마우스 휠 눌림
|
|
5158
|
+
* - right: 마우스 오른쪽 버튼 </ko>
|
|
5159
|
+
* @param {Number[]} [scale] Coordinate scale that a user can move<ko>사용자의 동작으로 이동하는 좌표의 배율</ko>
|
|
5160
|
+
* @param {Number} [scale[0]=1] horizontal axis scale <ko>수평축 배율</ko>
|
|
5161
|
+
* @param {Number} [scale[1]=1] vertical axis scale <ko>수직축 배율</ko>
|
|
5162
|
+
* @param {Number} [thresholdAngle=45] The threshold value that determines whether user action is horizontal or vertical (0~90) <ko>사용자의 동작이 가로 방향인지 세로 방향인지 판단하는 기준 각도(0~90)</ko>
|
|
5163
|
+
* @param {Number} [threshold=0] Minimal pan distance required before recognizing <ko>사용자의 Pan 동작을 인식하기 위해산 최소한의 거리</ko>
|
|
5164
|
+
* @param {Boolean} [preventClickOnDrag=false] Whether to cancel the {@link https://developer.mozilla.org/en/docs/Web/API/Element/click_event click} event when the user finishes dragging more than 1 pixel <ko>사용자가 1픽셀 이상 드래그를 마쳤을 때 {@link https://developer.mozilla.org/ko/docs/Web/API/Element/click_event click} 이벤트 취소 여부</ko>
|
|
5165
|
+
* @param {Boolean} [preventDefaultOnDrag=false] Whether to use the {@link https://developer.mozilla.org/ko/docs/Web/API/Event/preventDefault preventDefault} when the user starts dragging <ko>사용자가 드래그를 시작할 때 {@link https://developer.mozilla.org/ko/docs/Web/API/Event/preventDefault preventDefault} 실행 여부</ko>
|
|
5166
|
+
* @param {Number} [iOSEdgeSwipeThreshold=30] Area (px) that can go to the next page when swiping the right edge in iOS safari <ko>iOS Safari에서 오른쪽 엣지를 스와이프 하는 경우 다음 페이지로 넘어갈 수 있는 영역(px)</ko>
|
|
5167
|
+
* @param {String} [touchAction=null] Value that overrides the element's "touch-action" css property. If set to null, it is automatically set to prevent scrolling in the direction of the connected axis. <ko>엘리먼트의 "touch-action" CSS 속성을 덮어쓰는 값. 만약 null로 설정된 경우, 연결된 축 방향으로의 스크롤을 방지하게끔 자동으로 설정된다.</ko>
|
|
5601
5168
|
**/
|
|
5602
|
-
|
|
5603
|
-
|
|
5604
|
-
*
|
|
5605
|
-
*
|
|
5606
|
-
*
|
|
5607
|
-
*
|
|
5608
|
-
*
|
|
5609
|
-
*
|
|
5610
|
-
*
|
|
5611
|
-
*
|
|
5612
|
-
*
|
|
5613
|
-
*
|
|
5614
|
-
* // Connect the '
|
|
5615
|
-
*
|
|
5616
|
-
*
|
|
5617
|
-
*
|
|
5618
|
-
*
|
|
5619
|
-
*
|
|
5620
|
-
*
|
|
5621
|
-
*
|
|
5622
|
-
*
|
|
5623
|
-
*
|
|
5624
|
-
* @param {
|
|
5625
|
-
* @param {PanInputOption} [options={}] The option object of the eg.Axes.PanInput module<ko>eg.Axes.PanInput 모듈의 옵션 객체</ko>
|
|
5169
|
+
/**
|
|
5170
|
+
* A module that passes the amount of change to eg.Axes when the mouse or touchscreen is down and moved. use less than two axes.
|
|
5171
|
+
* @ko 마우스나 터치 스크린을 누르고 움직일때의 변화량을 eg.Axes에 전달하는 모듈. 두개 이하의 축을 사용한다.
|
|
5172
|
+
*
|
|
5173
|
+
* @example
|
|
5174
|
+
* ```js
|
|
5175
|
+
* const pan = new eg.Axes.PanInput("#area", {
|
|
5176
|
+
* inputType: ["touch"],
|
|
5177
|
+
* scale: [1, 1.3],
|
|
5178
|
+
* });
|
|
5179
|
+
*
|
|
5180
|
+
* // Connect the 'something2' axis to the mouse or touchscreen x position when the mouse or touchscreen is down and moved.
|
|
5181
|
+
* // Connect the 'somethingN' axis to the mouse or touchscreen y position when the mouse or touchscreen is down and moved.
|
|
5182
|
+
* axes.connect(["something2", "somethingN"], pan); // or axes.connect("something2 somethingN", pan);
|
|
5183
|
+
*
|
|
5184
|
+
* // Connect only one 'something1' axis to the mouse or touchscreen x position when the mouse or touchscreen is down and moved.
|
|
5185
|
+
* axes.connect(["something1"], pan); // or axes.connect("something1", pan);
|
|
5186
|
+
*
|
|
5187
|
+
* // Connect only one 'something2' axis to the mouse or touchscreen y position when the mouse or touchscreen is down and moved.
|
|
5188
|
+
* axes.connect(["", "something2"], pan); // or axes.connect(" something2", pan);
|
|
5189
|
+
* ```
|
|
5190
|
+
* @param {String|HTMLElement|Ref<HTMLElement>|jQuery} element An element to use the eg.Axes.PanInput module <ko>eg.Axes.PanInput 모듈을 사용할 엘리먼트</ko>
|
|
5191
|
+
* @param {PanInputOption} [options={}] The option object of the eg.Axes.PanInput module<ko>eg.Axes.PanInput 모듈의 옵션 객체</ko>
|
|
5626
5192
|
*/
|
|
5627
|
-
|
|
5628
|
-
|
|
5629
|
-
|
|
5630
|
-
function () {
|
|
5631
|
-
/**
|
|
5632
|
-
*
|
|
5193
|
+
var PanInput = /*#__PURE__*/function () {
|
|
5194
|
+
/**
|
|
5195
|
+
*
|
|
5633
5196
|
*/
|
|
5634
5197
|
function PanInput(el, options) {
|
|
5635
5198
|
var _this = this;
|
|
5636
|
-
|
|
5637
5199
|
this.axes = [];
|
|
5638
5200
|
this.element = null;
|
|
5639
5201
|
this._enabled = false;
|
|
@@ -5642,18 +5204,14 @@ version: 4.10.8-beta.1
|
|
|
5642
5204
|
this._rightEdgeTimer = 0;
|
|
5643
5205
|
this._dragged = false;
|
|
5644
5206
|
this._isOverThreshold = false;
|
|
5645
|
-
|
|
5646
5207
|
this._preventClickWhenDragged = function (e) {
|
|
5647
5208
|
if (_this._dragged) {
|
|
5648
5209
|
e.preventDefault();
|
|
5649
5210
|
e.stopPropagation();
|
|
5650
5211
|
}
|
|
5651
|
-
|
|
5652
5212
|
_this._dragged = false;
|
|
5653
5213
|
};
|
|
5654
|
-
|
|
5655
5214
|
this._voidFunction = function () {};
|
|
5656
|
-
|
|
5657
5215
|
this.element = $(el);
|
|
5658
5216
|
this.options = __assign$1({
|
|
5659
5217
|
inputType: ["touch", "mouse", "pointer"],
|
|
@@ -5663,6 +5221,7 @@ version: 4.10.8-beta.1
|
|
|
5663
5221
|
thresholdAngle: 45,
|
|
5664
5222
|
threshold: 0,
|
|
5665
5223
|
preventClickOnDrag: false,
|
|
5224
|
+
preventDefaultOnDrag: false,
|
|
5666
5225
|
iOSEdgeSwipeThreshold: IOS_EDGE_THRESHOLD,
|
|
5667
5226
|
releaseOnScroll: false,
|
|
5668
5227
|
touchAction: null
|
|
@@ -5671,167 +5230,130 @@ version: 4.10.8-beta.1
|
|
|
5671
5230
|
this._onPanmove = this._onPanmove.bind(this);
|
|
5672
5231
|
this._onPanend = this._onPanend.bind(this);
|
|
5673
5232
|
}
|
|
5674
|
-
|
|
5675
5233
|
var __proto = PanInput.prototype;
|
|
5676
|
-
|
|
5677
5234
|
__proto.mapAxes = function (axes) {
|
|
5678
5235
|
this._direction = getDirection(!!axes[0], !!axes[1]);
|
|
5679
5236
|
this.axes = axes;
|
|
5680
5237
|
};
|
|
5681
|
-
|
|
5682
5238
|
__proto.connect = function (observer) {
|
|
5683
5239
|
if (this._activeEvent) {
|
|
5684
5240
|
this._detachElementEvent();
|
|
5685
|
-
|
|
5686
5241
|
this._detachWindowEvent(this._activeEvent);
|
|
5687
5242
|
}
|
|
5688
|
-
|
|
5689
5243
|
this._attachElementEvent(observer);
|
|
5690
|
-
|
|
5691
5244
|
this._originalCssProps = setCssProps(this.element, this.options, this._direction);
|
|
5692
5245
|
return this;
|
|
5693
5246
|
};
|
|
5694
|
-
|
|
5695
5247
|
__proto.disconnect = function () {
|
|
5696
5248
|
this._detachElementEvent();
|
|
5697
|
-
|
|
5698
5249
|
this._detachWindowEvent(this._activeEvent);
|
|
5699
|
-
|
|
5700
5250
|
if (!isCssPropsFromAxes(this._originalCssProps)) {
|
|
5701
5251
|
revertCssProps(this.element, this._originalCssProps);
|
|
5702
5252
|
}
|
|
5703
|
-
|
|
5704
5253
|
this._direction = DIRECTION_NONE;
|
|
5705
5254
|
return this;
|
|
5706
5255
|
};
|
|
5707
|
-
/**
|
|
5708
|
-
* Destroys elements, properties, and events used in a module.
|
|
5709
|
-
* @ko 모듈에 사용한 엘리먼트와 속성, 이벤트를 해제한다.
|
|
5256
|
+
/**
|
|
5257
|
+
* Destroys elements, properties, and events used in a module.
|
|
5258
|
+
* @ko 모듈에 사용한 엘리먼트와 속성, 이벤트를 해제한다.
|
|
5710
5259
|
*/
|
|
5711
|
-
|
|
5712
|
-
|
|
5713
5260
|
__proto.destroy = function () {
|
|
5714
5261
|
this.disconnect();
|
|
5715
5262
|
this.element = null;
|
|
5716
5263
|
};
|
|
5717
|
-
/**
|
|
5718
|
-
* Enables input devices
|
|
5719
|
-
* @ko 입력 장치를 사용할 수 있게 한다
|
|
5720
|
-
* @return {PanInput} An instance of a module itself <ko>모듈 자신의 인스턴스</ko>
|
|
5264
|
+
/**
|
|
5265
|
+
* Enables input devices
|
|
5266
|
+
* @ko 입력 장치를 사용할 수 있게 한다
|
|
5267
|
+
* @return {PanInput} An instance of a module itself <ko>모듈 자신의 인스턴스</ko>
|
|
5721
5268
|
*/
|
|
5722
|
-
|
|
5723
|
-
|
|
5724
5269
|
__proto.enable = function () {
|
|
5725
5270
|
this._enabled = true;
|
|
5726
5271
|
return this;
|
|
5727
5272
|
};
|
|
5728
|
-
/**
|
|
5729
|
-
* Disables input devices
|
|
5730
|
-
* @ko 입력 장치를 사용할 수 없게 한다.
|
|
5731
|
-
* @return {PanInput} An instance of a module itself <ko>모듈 자신의 인스턴스</ko>
|
|
5273
|
+
/**
|
|
5274
|
+
* Disables input devices
|
|
5275
|
+
* @ko 입력 장치를 사용할 수 없게 한다.
|
|
5276
|
+
* @return {PanInput} An instance of a module itself <ko>모듈 자신의 인스턴스</ko>
|
|
5732
5277
|
*/
|
|
5733
|
-
|
|
5734
|
-
|
|
5735
5278
|
__proto.disable = function () {
|
|
5736
5279
|
this._enabled = false;
|
|
5737
5280
|
return this;
|
|
5738
5281
|
};
|
|
5739
|
-
/**
|
|
5740
|
-
* Returns whether to use an input device
|
|
5741
|
-
* @ko 입력 장치 사용 여부를 반환한다.
|
|
5742
|
-
* @return {Boolean} Whether to use an input device <ko>입력장치 사용여부</ko>
|
|
5282
|
+
/**
|
|
5283
|
+
* Returns whether to use an input device
|
|
5284
|
+
* @ko 입력 장치 사용 여부를 반환한다.
|
|
5285
|
+
* @return {Boolean} Whether to use an input device <ko>입력장치 사용여부</ko>
|
|
5743
5286
|
*/
|
|
5744
|
-
|
|
5745
|
-
|
|
5746
5287
|
__proto.isEnabled = function () {
|
|
5747
5288
|
return this._enabled;
|
|
5748
5289
|
};
|
|
5749
|
-
/**
|
|
5750
|
-
* Releases current user input.
|
|
5751
|
-
* @ko 사용자의 입력을 강제로 중단시킨다.
|
|
5752
|
-
* @return {PanInput} An instance of a module itself <ko>모듈 자신의 인스턴스</ko>
|
|
5290
|
+
/**
|
|
5291
|
+
* Releases current user input.
|
|
5292
|
+
* @ko 사용자의 입력을 강제로 중단시킨다.
|
|
5293
|
+
* @return {PanInput} An instance of a module itself <ko>모듈 자신의 인스턴스</ko>
|
|
5753
5294
|
*/
|
|
5754
|
-
|
|
5755
|
-
|
|
5756
5295
|
__proto.release = function () {
|
|
5757
5296
|
var activeEvent = this._activeEvent;
|
|
5758
5297
|
var prevEvent = activeEvent.prevEvent;
|
|
5759
5298
|
activeEvent.onRelease();
|
|
5760
|
-
|
|
5761
5299
|
this._observer.release(this, prevEvent, [0, 0]);
|
|
5762
|
-
|
|
5763
5300
|
this._detachWindowEvent(activeEvent);
|
|
5764
|
-
|
|
5765
5301
|
return this;
|
|
5766
5302
|
};
|
|
5767
|
-
|
|
5768
5303
|
__proto._onPanstart = function (event) {
|
|
5769
5304
|
var _a = this.options,
|
|
5770
|
-
|
|
5771
|
-
|
|
5305
|
+
inputKey = _a.inputKey,
|
|
5306
|
+
inputButton = _a.inputButton,
|
|
5307
|
+
preventDefaultOnDrag = _a.preventDefaultOnDrag;
|
|
5772
5308
|
var activeEvent = this._activeEvent;
|
|
5773
5309
|
var panEvent = activeEvent.onEventStart(event, inputKey, inputButton);
|
|
5774
|
-
|
|
5775
5310
|
if (!panEvent || !this._enabled || activeEvent.getTouches(event, inputButton) > 1) {
|
|
5776
5311
|
return;
|
|
5777
5312
|
}
|
|
5778
|
-
|
|
5779
5313
|
if (panEvent.srcEvent.cancelable !== false) {
|
|
5780
5314
|
var edgeThreshold = this.options.iOSEdgeSwipeThreshold;
|
|
5781
5315
|
this._dragged = false;
|
|
5782
5316
|
this._isOverThreshold = false;
|
|
5783
|
-
|
|
5784
5317
|
this._observer.hold(this, panEvent);
|
|
5785
|
-
|
|
5786
5318
|
this._atRightEdge = IS_IOS_SAFARI && panEvent.center.x > window.innerWidth - edgeThreshold;
|
|
5787
|
-
|
|
5788
5319
|
this._attachWindowEvent(activeEvent);
|
|
5789
|
-
|
|
5320
|
+
preventDefaultOnDrag && panEvent.srcEvent.type !== "touchstart" && panEvent.srcEvent.preventDefault();
|
|
5790
5321
|
activeEvent.prevEvent = panEvent;
|
|
5791
5322
|
}
|
|
5792
5323
|
};
|
|
5793
|
-
|
|
5794
5324
|
__proto._onPanmove = function (event) {
|
|
5795
5325
|
var _this = this;
|
|
5796
|
-
|
|
5797
5326
|
var _a = this.options,
|
|
5798
|
-
|
|
5799
|
-
|
|
5800
|
-
|
|
5801
|
-
|
|
5802
|
-
|
|
5803
|
-
|
|
5804
|
-
|
|
5327
|
+
iOSEdgeSwipeThreshold = _a.iOSEdgeSwipeThreshold,
|
|
5328
|
+
preventClickOnDrag = _a.preventClickOnDrag,
|
|
5329
|
+
releaseOnScroll = _a.releaseOnScroll,
|
|
5330
|
+
inputKey = _a.inputKey,
|
|
5331
|
+
inputButton = _a.inputButton,
|
|
5332
|
+
threshold = _a.threshold,
|
|
5333
|
+
thresholdAngle = _a.thresholdAngle;
|
|
5805
5334
|
var activeEvent = this._activeEvent;
|
|
5806
5335
|
var panEvent = activeEvent.onEventMove(event, inputKey, inputButton);
|
|
5807
5336
|
var touches = activeEvent.getTouches(event, inputButton);
|
|
5808
|
-
|
|
5809
5337
|
if (touches === 0 || releaseOnScroll && panEvent && !panEvent.srcEvent.cancelable) {
|
|
5810
5338
|
this._onPanend(event);
|
|
5811
|
-
|
|
5812
5339
|
return;
|
|
5813
5340
|
}
|
|
5814
|
-
|
|
5815
5341
|
if (!panEvent || !this._enabled || touches > 1) {
|
|
5816
5342
|
return;
|
|
5817
5343
|
}
|
|
5818
|
-
|
|
5819
5344
|
var userDirection = getDirectionByAngle(panEvent.angle, thresholdAngle);
|
|
5820
5345
|
var useHorizontal = useDirection(DIRECTION_HORIZONTAL, this._direction, userDirection);
|
|
5821
5346
|
var useVertical = useDirection(DIRECTION_VERTICAL, this._direction, userDirection);
|
|
5822
|
-
|
|
5823
5347
|
if (activeEvent.prevEvent && IS_IOS_SAFARI) {
|
|
5824
5348
|
var swipeLeftToRight = panEvent.center.x < 0;
|
|
5825
|
-
|
|
5826
5349
|
if (swipeLeftToRight) {
|
|
5827
5350
|
// iOS swipe left => right
|
|
5828
5351
|
this.release();
|
|
5829
5352
|
return;
|
|
5830
5353
|
} else if (this._atRightEdge) {
|
|
5831
|
-
clearTimeout(this._rightEdgeTimer);
|
|
5832
|
-
|
|
5354
|
+
clearTimeout(this._rightEdgeTimer);
|
|
5355
|
+
// - is right to left
|
|
5833
5356
|
var swipeRightToLeft = panEvent.deltaX < -iOSEdgeSwipeThreshold;
|
|
5834
|
-
|
|
5835
5357
|
if (swipeRightToLeft) {
|
|
5836
5358
|
this._atRightEdge = false;
|
|
5837
5359
|
} else {
|
|
@@ -5842,57 +5364,41 @@ version: 4.10.8-beta.1
|
|
|
5842
5364
|
}
|
|
5843
5365
|
}
|
|
5844
5366
|
}
|
|
5845
|
-
|
|
5846
5367
|
var distance = this._getDistance([panEvent.deltaX, panEvent.deltaY], [useHorizontal, useVertical]);
|
|
5847
|
-
|
|
5848
5368
|
var offset = this._getOffset([panEvent.offsetX, panEvent.offsetY], [useHorizontal, useVertical]);
|
|
5849
|
-
|
|
5850
5369
|
var prevent = offset.some(function (v) {
|
|
5851
5370
|
return v !== 0;
|
|
5852
5371
|
});
|
|
5853
|
-
|
|
5854
5372
|
if (prevent) {
|
|
5855
5373
|
if (panEvent.srcEvent.cancelable !== false) {
|
|
5856
5374
|
panEvent.srcEvent.preventDefault();
|
|
5857
5375
|
}
|
|
5858
|
-
|
|
5859
5376
|
panEvent.srcEvent.stopPropagation();
|
|
5860
5377
|
}
|
|
5861
|
-
|
|
5862
5378
|
panEvent.preventSystemEvent = prevent;
|
|
5863
|
-
|
|
5864
5379
|
if (prevent && (this._isOverThreshold || distance >= threshold)) {
|
|
5865
5380
|
this._dragged = preventClickOnDrag;
|
|
5866
5381
|
this._isOverThreshold = true;
|
|
5867
|
-
|
|
5868
5382
|
this._observer.change(this, panEvent, toAxis(this.axes, offset));
|
|
5869
5383
|
}
|
|
5870
|
-
|
|
5871
5384
|
activeEvent.prevEvent = panEvent;
|
|
5872
5385
|
};
|
|
5873
|
-
|
|
5874
5386
|
__proto._onPanend = function (event) {
|
|
5875
5387
|
var inputButton = this.options.inputButton;
|
|
5876
5388
|
var activeEvent = this._activeEvent;
|
|
5877
5389
|
activeEvent.onEventEnd(event);
|
|
5878
|
-
|
|
5879
5390
|
if (!this._enabled || activeEvent.getTouches(event, inputButton) !== 0) {
|
|
5880
5391
|
return;
|
|
5881
5392
|
}
|
|
5882
|
-
|
|
5883
5393
|
this._detachWindowEvent(activeEvent);
|
|
5884
|
-
|
|
5885
5394
|
clearTimeout(this._rightEdgeTimer);
|
|
5886
5395
|
var prevEvent = activeEvent.prevEvent;
|
|
5887
5396
|
var velocity = this._isOverThreshold ? this._getOffset([Math.abs(prevEvent.velocityX) * (prevEvent.offsetX < 0 ? -1 : 1), Math.abs(prevEvent.velocityY) * (prevEvent.offsetY < 0 ? -1 : 1)], [useDirection(DIRECTION_HORIZONTAL, this._direction), useDirection(DIRECTION_VERTICAL, this._direction)]) : [0, 0];
|
|
5888
5397
|
activeEvent.onRelease();
|
|
5889
|
-
|
|
5890
5398
|
this._observer.release(this, prevEvent, velocity);
|
|
5891
5399
|
};
|
|
5892
|
-
|
|
5893
5400
|
__proto._attachWindowEvent = function (activeEvent) {
|
|
5894
5401
|
var _this = this;
|
|
5895
|
-
|
|
5896
5402
|
activeEvent === null || activeEvent === void 0 ? void 0 : activeEvent.move.forEach(function (event) {
|
|
5897
5403
|
window.addEventListener(event, _this._onPanmove, getAddEventOptions(event));
|
|
5898
5404
|
});
|
|
@@ -5900,10 +5406,8 @@ version: 4.10.8-beta.1
|
|
|
5900
5406
|
window.addEventListener(event, _this._onPanend, getAddEventOptions(event));
|
|
5901
5407
|
});
|
|
5902
5408
|
};
|
|
5903
|
-
|
|
5904
5409
|
__proto._detachWindowEvent = function (activeEvent) {
|
|
5905
5410
|
var _this = this;
|
|
5906
|
-
|
|
5907
5411
|
activeEvent === null || activeEvent === void 0 ? void 0 : activeEvent.move.forEach(function (event) {
|
|
5908
5412
|
window.removeEventListener(event, _this._onPanmove);
|
|
5909
5413
|
});
|
|
@@ -5911,49 +5415,39 @@ version: 4.10.8-beta.1
|
|
|
5911
5415
|
window.removeEventListener(event, _this._onPanend);
|
|
5912
5416
|
});
|
|
5913
5417
|
};
|
|
5914
|
-
|
|
5915
5418
|
__proto._getOffset = function (properties, direction) {
|
|
5916
5419
|
var scale = this.options.scale;
|
|
5917
5420
|
return [direction[0] ? properties[0] * scale[0] : 0, direction[1] ? properties[1] * scale[1] : 0];
|
|
5918
5421
|
};
|
|
5919
|
-
|
|
5920
5422
|
__proto._getDistance = function (delta, direction) {
|
|
5921
5423
|
return Math.sqrt(Number(direction[0]) * Math.pow(delta[0], 2) + Number(direction[1]) * Math.pow(delta[1], 2));
|
|
5922
5424
|
};
|
|
5923
|
-
|
|
5924
5425
|
__proto._attachElementEvent = function (observer) {
|
|
5925
5426
|
var _this = this;
|
|
5926
|
-
|
|
5927
5427
|
var activeEvent = convertInputType(this.options.inputType);
|
|
5928
5428
|
var element = this.element;
|
|
5929
|
-
|
|
5930
5429
|
if (!activeEvent) {
|
|
5931
5430
|
return;
|
|
5932
5431
|
}
|
|
5933
|
-
|
|
5934
5432
|
if (!element) {
|
|
5935
5433
|
throw new Error("Element to connect input does not exist.");
|
|
5936
5434
|
}
|
|
5937
|
-
|
|
5938
5435
|
this._observer = observer;
|
|
5939
5436
|
this._enabled = true;
|
|
5940
5437
|
this._activeEvent = activeEvent;
|
|
5941
5438
|
element.addEventListener("click", this._preventClickWhenDragged, true);
|
|
5942
5439
|
activeEvent.start.forEach(function (event) {
|
|
5943
5440
|
element.addEventListener(event, _this._onPanstart);
|
|
5944
|
-
});
|
|
5945
|
-
|
|
5441
|
+
});
|
|
5442
|
+
// adding event listener to element prevents invalid behavior in iOS Safari
|
|
5946
5443
|
activeEvent.move.forEach(function (event) {
|
|
5947
5444
|
element.addEventListener(event, _this._voidFunction);
|
|
5948
5445
|
});
|
|
5949
5446
|
};
|
|
5950
|
-
|
|
5951
5447
|
__proto._detachElementEvent = function () {
|
|
5952
5448
|
var _this = this;
|
|
5953
|
-
|
|
5954
5449
|
var activeEvent = this._activeEvent;
|
|
5955
5450
|
var element = this.element;
|
|
5956
|
-
|
|
5957
5451
|
if (element) {
|
|
5958
5452
|
element.removeEventListener("click", this._preventClickWhenDragged, true);
|
|
5959
5453
|
activeEvent === null || activeEvent === void 0 ? void 0 : activeEvent.start.forEach(function (event) {
|
|
@@ -5963,17 +5457,15 @@ version: 4.10.8-beta.1
|
|
|
5963
5457
|
element.removeEventListener(event, _this._voidFunction);
|
|
5964
5458
|
});
|
|
5965
5459
|
}
|
|
5966
|
-
|
|
5967
5460
|
this._enabled = false;
|
|
5968
5461
|
this._observer = null;
|
|
5969
5462
|
};
|
|
5970
|
-
|
|
5971
5463
|
return PanInput;
|
|
5972
5464
|
}();
|
|
5973
5465
|
|
|
5974
|
-
/*
|
|
5975
|
-
* Copyright (c) 2015 NAVER Corp.
|
|
5976
|
-
* egjs projects are licensed under the MIT license
|
|
5466
|
+
/*
|
|
5467
|
+
* Copyright (c) 2015 NAVER Corp.
|
|
5468
|
+
* egjs projects are licensed under the MIT license
|
|
5977
5469
|
*/
|
|
5978
5470
|
|
|
5979
5471
|
var Axes$1 = Axes;
|
|
@@ -6797,6 +6289,7 @@ version: 4.10.8-beta.1
|
|
|
6797
6289
|
inputType: flicking.inputType,
|
|
6798
6290
|
threshold: 1,
|
|
6799
6291
|
iOSEdgeSwipeThreshold: flicking.iOSEdgeSwipeThreshold,
|
|
6292
|
+
preventDefaultOnDrag: flicking.preventDefaultOnDrag,
|
|
6800
6293
|
scale: flicking.horizontal ? [-1, 0] : [0, -1],
|
|
6801
6294
|
releaseOnScroll: true
|
|
6802
6295
|
});
|
|
@@ -11593,30 +11086,32 @@ version: 4.10.8-beta.1
|
|
|
11593
11086
|
iOSEdgeSwipeThreshold = _z === void 0 ? 30 : _z,
|
|
11594
11087
|
_0 = _b.preventClickOnDrag,
|
|
11595
11088
|
preventClickOnDrag = _0 === void 0 ? true : _0,
|
|
11596
|
-
_1 = _b.
|
|
11597
|
-
|
|
11598
|
-
_2 = _b.
|
|
11599
|
-
|
|
11600
|
-
_3 = _b.
|
|
11601
|
-
|
|
11602
|
-
_4 = _b.
|
|
11603
|
-
|
|
11604
|
-
_5 = _b.
|
|
11605
|
-
|
|
11606
|
-
_6 = _b.
|
|
11607
|
-
|
|
11608
|
-
_7 = _b.
|
|
11609
|
-
|
|
11610
|
-
_8 = _b.
|
|
11611
|
-
|
|
11612
|
-
_9 = _b.
|
|
11613
|
-
|
|
11614
|
-
_10 = _b.
|
|
11615
|
-
|
|
11616
|
-
_11 = _b.
|
|
11617
|
-
|
|
11618
|
-
_12 = _b.
|
|
11619
|
-
|
|
11089
|
+
_1 = _b.preventDefaultOnDrag,
|
|
11090
|
+
preventDefaultOnDrag = _1 === void 0 ? false : _1,
|
|
11091
|
+
_2 = _b.disableOnInit,
|
|
11092
|
+
disableOnInit = _2 === void 0 ? false : _2,
|
|
11093
|
+
_3 = _b.changeOnHold,
|
|
11094
|
+
changeOnHold = _3 === void 0 ? false : _3,
|
|
11095
|
+
_4 = _b.renderOnlyVisible,
|
|
11096
|
+
renderOnlyVisible = _4 === void 0 ? false : _4,
|
|
11097
|
+
_5 = _b.virtual,
|
|
11098
|
+
virtual = _5 === void 0 ? null : _5,
|
|
11099
|
+
_6 = _b.autoInit,
|
|
11100
|
+
autoInit = _6 === void 0 ? true : _6,
|
|
11101
|
+
_7 = _b.autoResize,
|
|
11102
|
+
autoResize = _7 === void 0 ? true : _7,
|
|
11103
|
+
_8 = _b.useResizeObserver,
|
|
11104
|
+
useResizeObserver = _8 === void 0 ? true : _8,
|
|
11105
|
+
_9 = _b.resizeDebounce,
|
|
11106
|
+
resizeDebounce = _9 === void 0 ? 0 : _9,
|
|
11107
|
+
_10 = _b.maxResizeDebounce,
|
|
11108
|
+
maxResizeDebounce = _10 === void 0 ? 100 : _10,
|
|
11109
|
+
_11 = _b.useFractionalSize,
|
|
11110
|
+
useFractionalSize = _11 === void 0 ? false : _11,
|
|
11111
|
+
_12 = _b.externalRenderer,
|
|
11112
|
+
externalRenderer = _12 === void 0 ? null : _12,
|
|
11113
|
+
_13 = _b.renderExternal,
|
|
11114
|
+
renderExternal = _13 === void 0 ? null : _13;
|
|
11620
11115
|
var _this = _super.call(this) || this;
|
|
11621
11116
|
// Internal states
|
|
11622
11117
|
_this._initialized = false;
|
|
@@ -11646,6 +11141,7 @@ version: 4.10.8-beta.1
|
|
|
11646
11141
|
_this._bounce = bounce;
|
|
11647
11142
|
_this._iOSEdgeSwipeThreshold = iOSEdgeSwipeThreshold;
|
|
11648
11143
|
_this._preventClickOnDrag = preventClickOnDrag;
|
|
11144
|
+
_this._preventDefaultOnDrag = preventDefaultOnDrag;
|
|
11649
11145
|
_this._disableOnInit = disableOnInit;
|
|
11650
11146
|
_this._changeOnHold = changeOnHold;
|
|
11651
11147
|
_this._renderOnlyVisible = renderOnlyVisible;
|
|
@@ -12444,6 +11940,27 @@ version: 4.10.8-beta.1
|
|
|
12444
11940
|
enumerable: false,
|
|
12445
11941
|
configurable: true
|
|
12446
11942
|
});
|
|
11943
|
+
Object.defineProperty(__proto, "preventDefaultOnDrag", {
|
|
11944
|
+
/**
|
|
11945
|
+
* Whether to use the {@link https://developer.mozilla.org/ko/docs/Web/API/Event/preventDefault preventDefault} when the user starts dragging
|
|
11946
|
+
* @ko 사용자가 드래그를 시작할 때 {@link https://developer.mozilla.org/ko/docs/Web/API/Event/preventDefault preventDefault} 실행 여부
|
|
11947
|
+
* @type {boolean}
|
|
11948
|
+
* @default false
|
|
11949
|
+
* @see {@link https://naver.github.io/egjs-flicking/Options#preventDefaultOnDrag preventDefaultOnDrag ( Options )}
|
|
11950
|
+
*/
|
|
11951
|
+
get: function () {
|
|
11952
|
+
return this._preventDefaultOnDrag;
|
|
11953
|
+
},
|
|
11954
|
+
set: function (val) {
|
|
11955
|
+
this._preventDefaultOnDrag = val;
|
|
11956
|
+
var panInput = this._control.controller.panInput;
|
|
11957
|
+
if (panInput) {
|
|
11958
|
+
panInput.options.preventDefaultOnDrag = val;
|
|
11959
|
+
}
|
|
11960
|
+
},
|
|
11961
|
+
enumerable: false,
|
|
11962
|
+
configurable: true
|
|
11963
|
+
});
|
|
12447
11964
|
Object.defineProperty(__proto, "disableOnInit", {
|
|
12448
11965
|
/**
|
|
12449
11966
|
* Automatically call {@link Flicking#disableInput disableInput()} on initialization
|
|
@@ -13378,7 +12895,7 @@ version: 4.10.8-beta.1
|
|
|
13378
12895
|
* Flicking.VERSION; // ex) 4.0.0
|
|
13379
12896
|
* ```
|
|
13380
12897
|
*/
|
|
13381
|
-
Flicking.VERSION = "4.
|
|
12898
|
+
Flicking.VERSION = "4.11.0";
|
|
13382
12899
|
return Flicking;
|
|
13383
12900
|
}(Component);
|
|
13384
12901
|
|