@egjs/flicking 4.9.0 → 4.9.3-beta.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/control/AxesController.d.ts +1 -0
- package/declaration/control/Control.d.ts +1 -0
- package/declaration/core/panel/Panel.d.ts +1 -1
- package/dist/flicking.esm.js +51 -9
- package/dist/flicking.esm.js.map +1 -1
- package/dist/flicking.js +51 -9
- 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 +445 -144
- 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/src/Flicking.ts +8 -3
- package/src/control/AxesController.ts +12 -0
- package/src/control/Control.ts +12 -0
- package/src/core/panel/Panel.ts +8 -2
- package/src/renderer/Renderer.ts +2 -2
- package/TODO.md +0 -3
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.9.0
|
|
7
|
+
version: 4.9.3-beta.0
|
|
8
8
|
*/
|
|
9
9
|
(function (global, factory) {
|
|
10
10
|
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
|
|
@@ -1087,7 +1087,7 @@ version: 4.9.0
|
|
|
1087
1087
|
var parsePanelAlign = function (align) {
|
|
1088
1088
|
return typeof align === "object" ? align.panel : align;
|
|
1089
1089
|
};
|
|
1090
|
-
var getDirection = function (start, end) {
|
|
1090
|
+
var getDirection$1 = function (start, end) {
|
|
1091
1091
|
if (start === end) return DIRECTION.NONE;
|
|
1092
1092
|
return start < end ? DIRECTION.NEXT : DIRECTION.PREV;
|
|
1093
1093
|
};
|
|
@@ -1290,7 +1290,7 @@ version: 4.9.0
|
|
|
1290
1290
|
parseArithmeticExpression: parseArithmeticExpression,
|
|
1291
1291
|
parseCSSSizeValue: parseCSSSizeValue,
|
|
1292
1292
|
parsePanelAlign: parsePanelAlign,
|
|
1293
|
-
getDirection: getDirection,
|
|
1293
|
+
getDirection: getDirection$1,
|
|
1294
1294
|
parseElement: parseElement,
|
|
1295
1295
|
getMinusCompensatedIndex: getMinusCompensatedIndex,
|
|
1296
1296
|
includes: includes,
|
|
@@ -2319,12 +2319,114 @@ version: 4.9.0
|
|
|
2319
2319
|
}
|
|
2320
2320
|
|
|
2321
2321
|
/*
|
|
2322
|
-
Copyright (c)
|
|
2322
|
+
Copyright (c) NAVER Crop.
|
|
2323
|
+
name: @cfcs/core
|
|
2324
|
+
license: MIT
|
|
2325
|
+
author: NAVER Crop.
|
|
2326
|
+
repository: https://github.com/naver/cfcs
|
|
2327
|
+
version: 0.0.4
|
|
2328
|
+
*/
|
|
2329
|
+
|
|
2330
|
+
/**
|
|
2331
|
+
* cfcs
|
|
2332
|
+
* Copyright (c) 2022-present NAVER Corp.
|
|
2333
|
+
* MIT license
|
|
2334
|
+
*/
|
|
2335
|
+
function keys(obj) {
|
|
2336
|
+
return Object.keys(obj);
|
|
2337
|
+
}
|
|
2338
|
+
|
|
2339
|
+
var OBSERVERS_PATH = "__observers__";
|
|
2340
|
+
|
|
2341
|
+
var Observer =
|
|
2342
|
+
/*#__PURE__*/
|
|
2343
|
+
function () {
|
|
2344
|
+
function Observer(value) {
|
|
2345
|
+
this._emitter = new Component();
|
|
2346
|
+
this._current = value;
|
|
2347
|
+
}
|
|
2348
|
+
|
|
2349
|
+
var __proto = Observer.prototype;
|
|
2350
|
+
Object.defineProperty(__proto, "current", {
|
|
2351
|
+
get: function () {
|
|
2352
|
+
return this._current;
|
|
2353
|
+
},
|
|
2354
|
+
set: function (value) {
|
|
2355
|
+
var isUpdate = value !== this._current;
|
|
2356
|
+
this._current = value;
|
|
2357
|
+
|
|
2358
|
+
if (isUpdate) {
|
|
2359
|
+
this._emitter.trigger("update", value);
|
|
2360
|
+
}
|
|
2361
|
+
},
|
|
2362
|
+
enumerable: false,
|
|
2363
|
+
configurable: true
|
|
2364
|
+
});
|
|
2365
|
+
|
|
2366
|
+
__proto.subscribe = function (callback) {
|
|
2367
|
+
this._emitter.on("update", callback);
|
|
2368
|
+
};
|
|
2369
|
+
|
|
2370
|
+
__proto.unsubscribe = function (callback) {
|
|
2371
|
+
this._emitter.off("update", callback);
|
|
2372
|
+
};
|
|
2373
|
+
|
|
2374
|
+
return Observer;
|
|
2375
|
+
}();
|
|
2376
|
+
function observe(defaultValue) {
|
|
2377
|
+
return new Observer(defaultValue);
|
|
2378
|
+
}
|
|
2379
|
+
function getObservers(instance) {
|
|
2380
|
+
if (!instance[OBSERVERS_PATH]) {
|
|
2381
|
+
instance[OBSERVERS_PATH] = {};
|
|
2382
|
+
}
|
|
2383
|
+
|
|
2384
|
+
return instance[OBSERVERS_PATH];
|
|
2385
|
+
}
|
|
2386
|
+
function getObserver(instance, name, defaultValue) {
|
|
2387
|
+
var observers = getObservers(instance);
|
|
2388
|
+
|
|
2389
|
+
if (!observers[name]) {
|
|
2390
|
+
observers[name] = observe(defaultValue);
|
|
2391
|
+
}
|
|
2392
|
+
|
|
2393
|
+
return observers[name];
|
|
2394
|
+
}
|
|
2395
|
+
|
|
2396
|
+
function injectReactiveSubscribe(object) {
|
|
2397
|
+
object["subscribe"] = function (name, callback) {
|
|
2398
|
+
getObserver(this, name).subscribe(callback);
|
|
2399
|
+
};
|
|
2400
|
+
|
|
2401
|
+
object["unsubscribe"] = function (name, callback) {
|
|
2402
|
+
var _this = this;
|
|
2403
|
+
|
|
2404
|
+
if (!name) {
|
|
2405
|
+
keys(getObservers(this)).forEach(function (observerName) {
|
|
2406
|
+
_this.unsubscribe(observerName);
|
|
2407
|
+
});
|
|
2408
|
+
return;
|
|
2409
|
+
}
|
|
2410
|
+
|
|
2411
|
+
if (!(name in this)) {
|
|
2412
|
+
return;
|
|
2413
|
+
}
|
|
2414
|
+
|
|
2415
|
+
getObserver(this, name).unsubscribe(callback);
|
|
2416
|
+
};
|
|
2417
|
+
}
|
|
2418
|
+
function ReactiveSubscribe(Constructor) {
|
|
2419
|
+
var prototype = Constructor.prototype;
|
|
2420
|
+
injectReactiveSubscribe(prototype);
|
|
2421
|
+
}
|
|
2422
|
+
|
|
2423
|
+
/*
|
|
2424
|
+
Copyright (c) NAVER Corp.
|
|
2323
2425
|
name: @egjs/axes
|
|
2324
2426
|
license: MIT
|
|
2325
2427
|
author: NAVER Corp.
|
|
2326
2428
|
repository: https://github.com/naver/egjs-axes
|
|
2327
|
-
version: 3.
|
|
2429
|
+
version: 3.8.0
|
|
2328
2430
|
*/
|
|
2329
2431
|
|
|
2330
2432
|
/*! *****************************************************************************
|
|
@@ -2377,6 +2479,18 @@ version: 4.9.0
|
|
|
2377
2479
|
|
|
2378
2480
|
return __assign$1.apply(this, arguments);
|
|
2379
2481
|
};
|
|
2482
|
+
function __decorate(decorators, target, key, desc) {
|
|
2483
|
+
var c = arguments.length,
|
|
2484
|
+
r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc,
|
|
2485
|
+
d;
|
|
2486
|
+
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;
|
|
2487
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
2488
|
+
}
|
|
2489
|
+
|
|
2490
|
+
/*
|
|
2491
|
+
* Copyright (c) 2015 NAVER Corp.
|
|
2492
|
+
* egjs projects are licensed under the MIT license
|
|
2493
|
+
*/
|
|
2380
2494
|
|
|
2381
2495
|
/* eslint-disable no-new-func, no-nested-ternary */
|
|
2382
2496
|
var win;
|
|
@@ -2392,6 +2506,10 @@ version: 4.9.0
|
|
|
2392
2506
|
win = window;
|
|
2393
2507
|
}
|
|
2394
2508
|
|
|
2509
|
+
/*
|
|
2510
|
+
* Copyright (c) 2015 NAVER Corp.
|
|
2511
|
+
* egjs projects are licensed under the MIT license
|
|
2512
|
+
*/
|
|
2395
2513
|
var DIRECTION_NONE = 1;
|
|
2396
2514
|
var DIRECTION_LEFT = 2;
|
|
2397
2515
|
var DIRECTION_RIGHT = 4;
|
|
@@ -2466,6 +2584,8 @@ version: 4.9.0
|
|
|
2466
2584
|
} else if (param === win) {
|
|
2467
2585
|
// window
|
|
2468
2586
|
el = param;
|
|
2587
|
+
} else if ("value" in param || "current" in param) {
|
|
2588
|
+
el = param.value || param.current;
|
|
2469
2589
|
} else if (param.nodeName && (param.nodeType === 1 || param.nodeType === 9)) {
|
|
2470
2590
|
// HTMLElement, Document
|
|
2471
2591
|
el = param;
|
|
@@ -2527,7 +2647,7 @@ version: 4.9.0
|
|
|
2527
2647
|
};
|
|
2528
2648
|
/**
|
|
2529
2649
|
* A polyfill for the window.cancelAnimationFrame() method. It cancels an animation executed through a call to the requestAnimationFrame() method.
|
|
2530
|
-
* @param {Number} key −
|
|
2650
|
+
* @param {Number} key − The ID value returned through a call to the requestAnimationFrame() method. <ko>requestAnimationFrame() 메서드가 반환한 아이디 값</ko>
|
|
2531
2651
|
* @see https://developer.mozilla.org/en-US/docs/Web/API/Window/cancelAnimationFrame
|
|
2532
2652
|
* @private
|
|
2533
2653
|
*/
|
|
@@ -2594,7 +2714,7 @@ version: 4.9.0
|
|
|
2594
2714
|
return 0;
|
|
2595
2715
|
}
|
|
2596
2716
|
|
|
2597
|
-
var v = ""
|
|
2717
|
+
var v = "".concat(val);
|
|
2598
2718
|
|
|
2599
2719
|
if (v.indexOf("e") >= 0) {
|
|
2600
2720
|
// Exponential Format
|
|
@@ -2641,6 +2761,24 @@ version: 4.9.0
|
|
|
2641
2761
|
});
|
|
2642
2762
|
return same;
|
|
2643
2763
|
};
|
|
2764
|
+
var getDirection = function (useHorizontal, useVertical) {
|
|
2765
|
+
if (useHorizontal && useVertical) {
|
|
2766
|
+
return DIRECTION_ALL;
|
|
2767
|
+
} else if (useHorizontal) {
|
|
2768
|
+
return DIRECTION_HORIZONTAL;
|
|
2769
|
+
} else if (useVertical) {
|
|
2770
|
+
return DIRECTION_VERTICAL;
|
|
2771
|
+
} else {
|
|
2772
|
+
return DIRECTION_NONE;
|
|
2773
|
+
}
|
|
2774
|
+
};
|
|
2775
|
+
var useDirection = function (checkType, direction, userDirection) {
|
|
2776
|
+
if (userDirection) {
|
|
2777
|
+
return !!(direction === DIRECTION_ALL || direction & checkType && userDirection & checkType);
|
|
2778
|
+
} else {
|
|
2779
|
+
return !!(direction & checkType);
|
|
2780
|
+
}
|
|
2781
|
+
};
|
|
2644
2782
|
var setCssProps = function (element, option, direction) {
|
|
2645
2783
|
var _a;
|
|
2646
2784
|
|
|
@@ -2850,6 +2988,8 @@ version: 4.9.0
|
|
|
2850
2988
|
|
|
2851
2989
|
|
|
2852
2990
|
__proto.triggerChange = function (pos, depaPos, option, holding) {
|
|
2991
|
+
var _this = this;
|
|
2992
|
+
|
|
2853
2993
|
if (holding === void 0) {
|
|
2854
2994
|
holding = false;
|
|
2855
2995
|
}
|
|
@@ -2872,12 +3012,18 @@ version: 4.9.0
|
|
|
2872
3012
|
inputEvent: inputEvent,
|
|
2873
3013
|
isTrusted: !!inputEvent,
|
|
2874
3014
|
input: (option === null || option === void 0 ? void 0 : option.input) || (eventInfo === null || eventInfo === void 0 ? void 0 : eventInfo.input) || null,
|
|
2875
|
-
set: inputEvent ? this._createUserControll(moveTo.pos) : function () {}
|
|
3015
|
+
set: inputEvent ? this._createUserControll(moveTo.pos) : function () {} // eslint-disable-line @typescript-eslint/no-empty-function
|
|
3016
|
+
|
|
2876
3017
|
};
|
|
2877
3018
|
var event = new ComponentEvent$1("change", param);
|
|
2878
3019
|
|
|
2879
3020
|
this._axes.trigger(event);
|
|
2880
3021
|
|
|
3022
|
+
Object.keys(moveTo.pos).forEach(function (axis) {
|
|
3023
|
+
var p = moveTo.pos[axis];
|
|
3024
|
+
getObserver(_this._axes, axis, p).current = p;
|
|
3025
|
+
});
|
|
3026
|
+
|
|
2881
3027
|
if (inputEvent) {
|
|
2882
3028
|
axisManager.set(param.set().destPos);
|
|
2883
3029
|
}
|
|
@@ -3036,7 +3182,7 @@ version: 4.9.0
|
|
|
3036
3182
|
__proto._getRoundPos = function (pos, depaPos) {
|
|
3037
3183
|
// round value if round exist
|
|
3038
3184
|
var roundUnit = this._axes.options.round; // if (round == null) {
|
|
3039
|
-
//
|
|
3185
|
+
// return {pos, depaPos}; // undefined, undefined
|
|
3040
3186
|
// }
|
|
3041
3187
|
|
|
3042
3188
|
return {
|
|
@@ -3088,6 +3234,10 @@ version: 4.9.0
|
|
|
3088
3234
|
return InterruptManager;
|
|
3089
3235
|
}();
|
|
3090
3236
|
|
|
3237
|
+
/*
|
|
3238
|
+
* Copyright (c) 2015 NAVER Corp.
|
|
3239
|
+
* egjs projects are licensed under the MIT license
|
|
3240
|
+
*/
|
|
3091
3241
|
var getInsidePosition = function (destPos, range, circular, bounce) {
|
|
3092
3242
|
var toDestPos = destPos;
|
|
3093
3243
|
var targetRange = [circular[0] ? range[0] : bounce ? range[0] - bounce[0] : range[0], circular[1] ? range[1] : bounce ? range[1] + bounce[1] : range[1]];
|
|
@@ -3140,9 +3290,9 @@ version: 4.9.0
|
|
|
3140
3290
|
|
|
3141
3291
|
this._complementOptions();
|
|
3142
3292
|
|
|
3143
|
-
this._pos = Object.keys(this._axis).reduce(function (
|
|
3144
|
-
|
|
3145
|
-
return
|
|
3293
|
+
this._pos = Object.keys(this._axis).reduce(function (pos, v) {
|
|
3294
|
+
pos[v] = _this._axis[v].startPos;
|
|
3295
|
+
return pos;
|
|
3146
3296
|
}, {});
|
|
3147
3297
|
}
|
|
3148
3298
|
|
|
@@ -3226,6 +3376,20 @@ version: 4.9.0
|
|
|
3226
3376
|
__proto.getAxisOptions = function (key) {
|
|
3227
3377
|
return this._axis[key];
|
|
3228
3378
|
};
|
|
3379
|
+
|
|
3380
|
+
__proto.setAxis = function (axis) {
|
|
3381
|
+
var _this = this;
|
|
3382
|
+
|
|
3383
|
+
Object.keys(axis).forEach(function (key) {
|
|
3384
|
+
if (!_this._axis[key]) {
|
|
3385
|
+
throw new Error("Axis ".concat(key, " does not exist in Axes instance"));
|
|
3386
|
+
}
|
|
3387
|
+
|
|
3388
|
+
_this._axis[key] = __assign$1(__assign$1({}, _this._axis[key]), axis[key]);
|
|
3389
|
+
});
|
|
3390
|
+
|
|
3391
|
+
this._complementOptions();
|
|
3392
|
+
};
|
|
3229
3393
|
/**
|
|
3230
3394
|
* set up 'css' expression
|
|
3231
3395
|
* @private
|
|
@@ -3238,6 +3402,7 @@ version: 4.9.0
|
|
|
3238
3402
|
Object.keys(this._axis).forEach(function (axis) {
|
|
3239
3403
|
_this._axis[axis] = __assign$1({
|
|
3240
3404
|
range: [0, 100],
|
|
3405
|
+
startPos: _this._axis[axis].range[0],
|
|
3241
3406
|
bounce: [0, 0],
|
|
3242
3407
|
circular: [false, false]
|
|
3243
3408
|
}, _this._axis[axis]);
|
|
@@ -3404,7 +3569,16 @@ version: 4.9.0
|
|
|
3404
3569
|
return;
|
|
3405
3570
|
};
|
|
3406
3571
|
|
|
3407
|
-
__proto.getTouches = function () {
|
|
3572
|
+
__proto.getTouches = function (event, inputButton) {
|
|
3573
|
+
if (inputButton) {
|
|
3574
|
+
var buttonCodeMap = {
|
|
3575
|
+
1: MOUSE_LEFT,
|
|
3576
|
+
2: MOUSE_MIDDLE,
|
|
3577
|
+
3: MOUSE_RIGHT
|
|
3578
|
+
};
|
|
3579
|
+
return this._isValidButton(buttonCodeMap[event.which], inputButton) && this.end.indexOf(event.type) === -1 ? 1 : 0;
|
|
3580
|
+
}
|
|
3581
|
+
|
|
3408
3582
|
return 0;
|
|
3409
3583
|
};
|
|
3410
3584
|
|
|
@@ -3837,7 +4011,7 @@ version: 4.9.0
|
|
|
3837
4011
|
this._moveDistance = this._axisManager.get(input.axes);
|
|
3838
4012
|
};
|
|
3839
4013
|
|
|
3840
|
-
__proto.change = function (input, event, offset,
|
|
4014
|
+
__proto.change = function (input, event, offset, useAnimation) {
|
|
3841
4015
|
if (this._isStopped || !this._interruptManager.isInterrupting() || this._axisManager.every(offset, function (v) {
|
|
3842
4016
|
return v === 0;
|
|
3843
4017
|
})) {
|
|
@@ -3885,7 +4059,7 @@ version: 4.9.0
|
|
|
3885
4059
|
event: event
|
|
3886
4060
|
};
|
|
3887
4061
|
|
|
3888
|
-
if (
|
|
4062
|
+
if (useAnimation) {
|
|
3889
4063
|
var duration = this._animationManager.getDuration(destPos, depaPos);
|
|
3890
4064
|
|
|
3891
4065
|
this._animationManager.animateTo(destPos, duration, changeOption);
|
|
@@ -4469,9 +4643,10 @@ version: 4.9.0
|
|
|
4469
4643
|
/**
|
|
4470
4644
|
* @typedef {Object} AxisOption The Axis information. The key of the axis specifies the name to use as the logical virtual coordinate system.
|
|
4471
4645
|
* @ko 축 정보. 축의 키는 논리적인 가상 좌표계로 사용할 이름을 지정한다.
|
|
4472
|
-
* @param {Number[]} [range] The
|
|
4646
|
+
* @param {Number[]} [range] The range of coordinate <ko>좌표 범위</ko>
|
|
4473
4647
|
* @param {Number} [range[0]=0] The coordinate of the minimum <ko>최소 좌표</ko>
|
|
4474
4648
|
* @param {Number} [range[1]=0] The coordinate of the maximum <ko>최대 좌표</ko>
|
|
4649
|
+
* @param {Number} [startPos=range[0]] The coordinates to be moved when creating an instance <ko>인스턴스 생성시 이동할 좌표</ko>
|
|
4475
4650
|
* @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>
|
|
4476
4651
|
* @param {Number} [bounce[0]=0] The size of coordinate of the minimum area <ko>최소 좌표 바운스 영역의 크기</ko>
|
|
4477
4652
|
* @param {Number} [bounce[1]=0] The size of coordinate of the maximum area <ko>최대 좌표 바운스 영역의 크기</ko>
|
|
@@ -4506,50 +4681,50 @@ version: 4.9.0
|
|
|
4506
4681
|
*
|
|
4507
4682
|
* @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>
|
|
4508
4683
|
* @param {AxesOption} [options={}] The option object of the eg.Axes module<ko>eg.Axes 모듈의 옵션 객체</ko>
|
|
4509
|
-
* @param {Object.<string, number>} [startPos=
|
|
4684
|
+
* @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>
|
|
4510
4685
|
*
|
|
4511
4686
|
* @support {"ie": "10+", "ch" : "latest", "ff" : "latest", "sf" : "latest", "edge" : "latest", "ios" : "7+", "an" : "2.3+ (except 3.x)"}
|
|
4512
4687
|
* @example
|
|
4513
4688
|
* ```js
|
|
4514
4689
|
* // 1. Initialize eg.Axes
|
|
4515
4690
|
* const axes = new eg.Axes({
|
|
4516
|
-
*
|
|
4517
|
-
*
|
|
4518
|
-
*
|
|
4519
|
-
*
|
|
4520
|
-
*
|
|
4521
|
-
*
|
|
4522
|
-
*
|
|
4523
|
-
*
|
|
4524
|
-
*
|
|
4525
|
-
*
|
|
4526
|
-
*
|
|
4691
|
+
* something1: {
|
|
4692
|
+
* range: [0, 150],
|
|
4693
|
+
* bounce: 50
|
|
4694
|
+
* },
|
|
4695
|
+
* something2: {
|
|
4696
|
+
* range: [0, 200],
|
|
4697
|
+
* bounce: 100
|
|
4698
|
+
* },
|
|
4699
|
+
* somethingN: {
|
|
4700
|
+
* range: [1, 10],
|
|
4701
|
+
* }
|
|
4527
4702
|
* }, {
|
|
4528
4703
|
* deceleration : 0.0024
|
|
4529
4704
|
* });
|
|
4530
4705
|
*
|
|
4531
4706
|
* // 2. attach event handler
|
|
4532
4707
|
* axes.on({
|
|
4533
|
-
*
|
|
4534
|
-
*
|
|
4535
|
-
*
|
|
4536
|
-
*
|
|
4537
|
-
*
|
|
4538
|
-
*
|
|
4539
|
-
*
|
|
4540
|
-
*
|
|
4541
|
-
*
|
|
4542
|
-
*
|
|
4708
|
+
* "hold" : function(evt) {
|
|
4709
|
+
* },
|
|
4710
|
+
* "release" : function(evt) {
|
|
4711
|
+
* },
|
|
4712
|
+
* "animationStart" : function(evt) {
|
|
4713
|
+
* },
|
|
4714
|
+
* "animationEnd" : function(evt) {
|
|
4715
|
+
* },
|
|
4716
|
+
* "change" : function(evt) {
|
|
4717
|
+
* }
|
|
4543
4718
|
* });
|
|
4544
4719
|
*
|
|
4545
4720
|
* // 3. Initialize inputTypes
|
|
4546
4721
|
* const panInputArea = new eg.Axes.PanInput("#area", {
|
|
4547
|
-
*
|
|
4722
|
+
* scale: [0.5, 1]
|
|
4548
4723
|
* });
|
|
4549
4724
|
* const panInputHmove = new eg.Axes.PanInput("#hmove");
|
|
4550
4725
|
* const panInputVmove = new eg.Axes.PanInput("#vmove");
|
|
4551
4726
|
* const pinchInputArea = new eg.Axes.PinchInput("#area", {
|
|
4552
|
-
*
|
|
4727
|
+
* scale: 1.5
|
|
4553
4728
|
* });
|
|
4554
4729
|
*
|
|
4555
4730
|
* // 4. Connect eg.Axes and InputTypes
|
|
@@ -4588,7 +4763,7 @@ version: 4.9.0
|
|
|
4588
4763
|
}
|
|
4589
4764
|
|
|
4590
4765
|
if (startPos === void 0) {
|
|
4591
|
-
startPos =
|
|
4766
|
+
startPos = {};
|
|
4592
4767
|
}
|
|
4593
4768
|
|
|
4594
4769
|
var _this = _super.call(this) || this;
|
|
@@ -4606,6 +4781,9 @@ version: 4.9.0
|
|
|
4606
4781
|
round: null,
|
|
4607
4782
|
nested: false
|
|
4608
4783
|
}, options);
|
|
4784
|
+
Object.keys(startPos).forEach(function (key) {
|
|
4785
|
+
_this.axis[key].startPos = startPos[key];
|
|
4786
|
+
});
|
|
4609
4787
|
_this.interruptManager = new InterruptManager(_this.options);
|
|
4610
4788
|
_this.axisManager = new AxisManager(_this.axis);
|
|
4611
4789
|
_this.eventManager = new EventManager(_this);
|
|
@@ -4614,9 +4792,7 @@ version: 4.9.0
|
|
|
4614
4792
|
|
|
4615
4793
|
_this.eventManager.setAnimationManager(_this.animationManager);
|
|
4616
4794
|
|
|
4617
|
-
|
|
4618
|
-
_this.eventManager.triggerChange(startPos);
|
|
4619
|
-
}
|
|
4795
|
+
_this.eventManager.triggerChange(_this.axisManager.get());
|
|
4620
4796
|
|
|
4621
4797
|
return _this;
|
|
4622
4798
|
}
|
|
@@ -4733,7 +4909,7 @@ version: 4.9.0
|
|
|
4733
4909
|
* "xOther": {
|
|
4734
4910
|
* range: [-100, 100]
|
|
4735
4911
|
* },
|
|
4736
|
-
*
|
|
4912
|
+
* "zoom": {
|
|
4737
4913
|
* range: [50, 30]
|
|
4738
4914
|
* }
|
|
4739
4915
|
* });
|
|
@@ -4762,7 +4938,7 @@ version: 4.9.0
|
|
|
4762
4938
|
* "xOther": {
|
|
4763
4939
|
* range: [-100, 100]
|
|
4764
4940
|
* },
|
|
4765
|
-
*
|
|
4941
|
+
* "zoom": {
|
|
4766
4942
|
* range: [50, 30]
|
|
4767
4943
|
* }
|
|
4768
4944
|
* });
|
|
@@ -4801,7 +4977,7 @@ version: 4.9.0
|
|
|
4801
4977
|
* "xOther": {
|
|
4802
4978
|
* range: [-100, 100]
|
|
4803
4979
|
* },
|
|
4804
|
-
*
|
|
4980
|
+
* "zoom": {
|
|
4805
4981
|
* range: [50, 30]
|
|
4806
4982
|
* }
|
|
4807
4983
|
* });
|
|
@@ -4825,6 +5001,70 @@ version: 4.9.0
|
|
|
4825
5001
|
this.animationManager.setBy(pos, duration);
|
|
4826
5002
|
return this;
|
|
4827
5003
|
};
|
|
5004
|
+
/**
|
|
5005
|
+
* Change the options of Axes instance.
|
|
5006
|
+
* @ko 인스턴스의 옵션을 변경한다.
|
|
5007
|
+
* @param {AxesOption} options Axes options to change <ko>변경할 옵션 목록</ko>
|
|
5008
|
+
* @return {eg.Axes} An instance of a module itself <ko>모듈 자신의 인스턴스</ko>
|
|
5009
|
+
* @example
|
|
5010
|
+
* ```js
|
|
5011
|
+
* const axes = new eg.Axes({
|
|
5012
|
+
* "x": {
|
|
5013
|
+
* range: [0, 100]
|
|
5014
|
+
* },
|
|
5015
|
+
* }, {
|
|
5016
|
+
* round: 10,
|
|
5017
|
+
* });
|
|
5018
|
+
*
|
|
5019
|
+
* axes.setTo({"x": 48});
|
|
5020
|
+
* axes.get(); // {"x": 50}
|
|
5021
|
+
*
|
|
5022
|
+
* axes.setOptions({
|
|
5023
|
+
* round: 1,
|
|
5024
|
+
* });
|
|
5025
|
+
*
|
|
5026
|
+
* axes.setTo({"x": 48});
|
|
5027
|
+
* axes.get(); // {"x": 48}
|
|
5028
|
+
* ```
|
|
5029
|
+
*/
|
|
5030
|
+
|
|
5031
|
+
|
|
5032
|
+
__proto.setOptions = function (options) {
|
|
5033
|
+
this.options = __assign$1(__assign$1({}, this.options), options);
|
|
5034
|
+
return this;
|
|
5035
|
+
};
|
|
5036
|
+
/**
|
|
5037
|
+
* Change the information of an existing axis.
|
|
5038
|
+
* @ko 존재하는 축의 정보를 변경한다.
|
|
5039
|
+
* @param {Object.<string, AxisOption>} axis Axis options to change <ko>변경할 축의 정보</ko>
|
|
5040
|
+
* @return {eg.Axes} An instance of a module itself <ko>모듈 자신의 인스턴스</ko>
|
|
5041
|
+
* @example
|
|
5042
|
+
* ```js
|
|
5043
|
+
* const axes = new eg.Axes({
|
|
5044
|
+
* "x": {
|
|
5045
|
+
* range: [0, 100]
|
|
5046
|
+
* },
|
|
5047
|
+
* });
|
|
5048
|
+
*
|
|
5049
|
+
* axes.setTo({"x": 150});
|
|
5050
|
+
* axes.get(); // {"x": 100}
|
|
5051
|
+
*
|
|
5052
|
+
* axes.setAxis({
|
|
5053
|
+
* "x": {
|
|
5054
|
+
* range: [0, 200]
|
|
5055
|
+
* },
|
|
5056
|
+
* });
|
|
5057
|
+
*
|
|
5058
|
+
* axes.setTo({"x": 150});
|
|
5059
|
+
* axes.get(); // {"x": 150}
|
|
5060
|
+
* ```
|
|
5061
|
+
*/
|
|
5062
|
+
|
|
5063
|
+
|
|
5064
|
+
__proto.setAxis = function (axis) {
|
|
5065
|
+
this.axisManager.setAxis(axis);
|
|
5066
|
+
return this;
|
|
5067
|
+
};
|
|
4828
5068
|
/**
|
|
4829
5069
|
* Stop an animation in progress.
|
|
4830
5070
|
* @ko 재생 중인 애니메이션을 정지한다.
|
|
@@ -4897,7 +5137,7 @@ version: 4.9.0
|
|
|
4897
5137
|
* "xOther": {
|
|
4898
5138
|
* range: [-100, 100]
|
|
4899
5139
|
* },
|
|
4900
|
-
*
|
|
5140
|
+
* "zoom": {
|
|
4901
5141
|
* range: [50, 30]
|
|
4902
5142
|
* }
|
|
4903
5143
|
* });
|
|
@@ -4936,7 +5176,7 @@ version: 4.9.0
|
|
|
4936
5176
|
*/
|
|
4937
5177
|
|
|
4938
5178
|
|
|
4939
|
-
Axes.VERSION = "3.
|
|
5179
|
+
Axes.VERSION = "3.8.0";
|
|
4940
5180
|
/* eslint-enable */
|
|
4941
5181
|
|
|
4942
5182
|
/**
|
|
@@ -5009,10 +5249,14 @@ version: 4.9.0
|
|
|
5009
5249
|
*/
|
|
5010
5250
|
|
|
5011
5251
|
Axes.DIRECTION_ALL = DIRECTION_ALL;
|
|
5252
|
+
Axes = __decorate([ReactiveSubscribe], Axes);
|
|
5012
5253
|
return Axes;
|
|
5013
5254
|
}(Component);
|
|
5014
5255
|
|
|
5015
|
-
/*
|
|
5256
|
+
/*
|
|
5257
|
+
* Copyright (c) 2015 NAVER Corp.
|
|
5258
|
+
* egjs projects are licensed under the MIT license
|
|
5259
|
+
*/
|
|
5016
5260
|
|
|
5017
5261
|
var getDirectionByAngle = function (angle, thresholdAngle) {
|
|
5018
5262
|
if (thresholdAngle < 0 || thresholdAngle > 90) {
|
|
@@ -5022,13 +5266,6 @@ version: 4.9.0
|
|
|
5022
5266
|
var toAngle = Math.abs(angle);
|
|
5023
5267
|
return toAngle > thresholdAngle && toAngle < 180 - thresholdAngle ? DIRECTION_VERTICAL : DIRECTION_HORIZONTAL;
|
|
5024
5268
|
};
|
|
5025
|
-
var useDirection = function (checkType, direction, userDirection) {
|
|
5026
|
-
if (userDirection) {
|
|
5027
|
-
return !!(direction === DIRECTION_ALL || direction & checkType && userDirection & checkType);
|
|
5028
|
-
} else {
|
|
5029
|
-
return !!(direction & checkType);
|
|
5030
|
-
}
|
|
5031
|
-
};
|
|
5032
5269
|
/**
|
|
5033
5270
|
* @typedef {Object} PanInputOption The option object of the eg.Axes.PanInput module.
|
|
5034
5271
|
* @ko eg.Axes.PanInput 모듈의 옵션 객체
|
|
@@ -5051,6 +5288,7 @@ version: 4.9.0
|
|
|
5051
5288
|
* @param {Number} [scale[1]=1] vertical axis scale <ko>수직축 배율</ko>
|
|
5052
5289
|
* @param {Number} [thresholdAngle=45] The threshold value that determines whether user action is horizontal or vertical (0~90) <ko>사용자의 동작이 가로 방향인지 세로 방향인지 판단하는 기준 각도(0~90)</ko>
|
|
5053
5290
|
* @param {Number} [threshold=0] Minimal pan distance required before recognizing <ko>사용자의 Pan 동작을 인식하기 위해산 최소한의 거리</ko>
|
|
5291
|
+
* @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>
|
|
5054
5292
|
* @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>
|
|
5055
5293
|
* @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>
|
|
5056
5294
|
**/
|
|
@@ -5062,8 +5300,8 @@ version: 4.9.0
|
|
|
5062
5300
|
* @example
|
|
5063
5301
|
* ```js
|
|
5064
5302
|
* const pan = new eg.Axes.PanInput("#area", {
|
|
5065
|
-
*
|
|
5066
|
-
*
|
|
5303
|
+
* inputType: ["touch"],
|
|
5304
|
+
* scale: [1, 1.3],
|
|
5067
5305
|
* });
|
|
5068
5306
|
*
|
|
5069
5307
|
* // Connect the 'something2' axis to the mouse or touchscreen x position when the mouse or touchscreen is down and moved.
|
|
@@ -5076,7 +5314,7 @@ version: 4.9.0
|
|
|
5076
5314
|
* // Connect only one 'something2' axis to the mouse or touchscreen y position when the mouse or touchscreen is down and moved.
|
|
5077
5315
|
* axes.connect(["", "something2"], pan); // or axes.connect(" something2", pan);
|
|
5078
5316
|
* ```
|
|
5079
|
-
* @param {HTMLElement|
|
|
5317
|
+
* @param {String|HTMLElement|Ref<HTMLElement>|jQuery} element An element to use the eg.Axes.PanInput module <ko>eg.Axes.PanInput 모듈을 사용할 엘리먼트</ko>
|
|
5080
5318
|
* @param {PanInputOption} [options={}] The option object of the eg.Axes.PanInput module<ko>eg.Axes.PanInput 모듈의 옵션 객체</ko>
|
|
5081
5319
|
*/
|
|
5082
5320
|
|
|
@@ -5095,18 +5333,19 @@ version: 4.9.0
|
|
|
5095
5333
|
this._activeEvent = null;
|
|
5096
5334
|
this._atRightEdge = false;
|
|
5097
5335
|
this._rightEdgeTimer = 0;
|
|
5336
|
+
this._dragged = false;
|
|
5098
5337
|
|
|
5099
|
-
this.
|
|
5100
|
-
|
|
5101
|
-
|
|
5102
|
-
|
|
5103
|
-
|
|
5104
|
-
|
|
5105
|
-
activeEvent.onRelease();
|
|
5338
|
+
this._preventClickWhenDragged = function (e) {
|
|
5339
|
+
if (_this._dragged) {
|
|
5340
|
+
e.preventDefault();
|
|
5341
|
+
e.stopPropagation();
|
|
5342
|
+
}
|
|
5106
5343
|
|
|
5107
|
-
_this.
|
|
5344
|
+
_this._dragged = false;
|
|
5108
5345
|
};
|
|
5109
5346
|
|
|
5347
|
+
this._voidFunction = function () {};
|
|
5348
|
+
|
|
5110
5349
|
this.element = $(el);
|
|
5111
5350
|
this.options = __assign$1({
|
|
5112
5351
|
inputType: ["touch", "mouse", "pointer"],
|
|
@@ -5114,6 +5353,7 @@ version: 4.9.0
|
|
|
5114
5353
|
scale: [1, 1],
|
|
5115
5354
|
thresholdAngle: 45,
|
|
5116
5355
|
threshold: 0,
|
|
5356
|
+
preventClickOnDrag: false,
|
|
5117
5357
|
iOSEdgeSwipeThreshold: IOS_EDGE_THRESHOLD,
|
|
5118
5358
|
releaseOnScroll: false,
|
|
5119
5359
|
touchAction: null
|
|
@@ -5126,19 +5366,7 @@ version: 4.9.0
|
|
|
5126
5366
|
var __proto = PanInput.prototype;
|
|
5127
5367
|
|
|
5128
5368
|
__proto.mapAxes = function (axes) {
|
|
5129
|
-
|
|
5130
|
-
var useVertical = !!axes[1];
|
|
5131
|
-
|
|
5132
|
-
if (useHorizontal && useVertical) {
|
|
5133
|
-
this._direction = DIRECTION_ALL;
|
|
5134
|
-
} else if (useHorizontal) {
|
|
5135
|
-
this._direction = DIRECTION_HORIZONTAL;
|
|
5136
|
-
} else if (useVertical) {
|
|
5137
|
-
this._direction = DIRECTION_VERTICAL;
|
|
5138
|
-
} else {
|
|
5139
|
-
this._direction = DIRECTION_NONE;
|
|
5140
|
-
}
|
|
5141
|
-
|
|
5369
|
+
this._direction = getDirection(!!axes[0], !!axes[1]);
|
|
5142
5370
|
this.axes = axes;
|
|
5143
5371
|
};
|
|
5144
5372
|
|
|
@@ -5201,7 +5429,7 @@ version: 4.9.0
|
|
|
5201
5429
|
};
|
|
5202
5430
|
/**
|
|
5203
5431
|
* Returns whether to use an input device
|
|
5204
|
-
* @ko 입력
|
|
5432
|
+
* @ko 입력 장치 사용 여부를 반환한다.
|
|
5205
5433
|
* @return {Boolean} Whether to use an input device <ko>입력장치 사용여부</ko>
|
|
5206
5434
|
*/
|
|
5207
5435
|
|
|
@@ -5209,17 +5437,37 @@ version: 4.9.0
|
|
|
5209
5437
|
__proto.isEnabled = function () {
|
|
5210
5438
|
return this._enabled;
|
|
5211
5439
|
};
|
|
5440
|
+
/**
|
|
5441
|
+
* Releases current user input.
|
|
5442
|
+
* @ko 사용자의 입력을 강제로 중단시킨다.
|
|
5443
|
+
* @return {PanInput} An instance of a module itself <ko>모듈 자신의 인스턴스</ko>
|
|
5444
|
+
*/
|
|
5445
|
+
|
|
5446
|
+
|
|
5447
|
+
__proto.release = function () {
|
|
5448
|
+
var activeEvent = this._activeEvent;
|
|
5449
|
+
var prevEvent = activeEvent.prevEvent;
|
|
5450
|
+
activeEvent.onRelease();
|
|
5451
|
+
|
|
5452
|
+
this._observer.release(this, prevEvent, [0, 0]);
|
|
5453
|
+
|
|
5454
|
+
this._detachWindowEvent(activeEvent);
|
|
5455
|
+
|
|
5456
|
+
return this;
|
|
5457
|
+
};
|
|
5212
5458
|
|
|
5213
5459
|
__proto._onPanstart = function (event) {
|
|
5460
|
+
var inputButton = this.options.inputButton;
|
|
5214
5461
|
var activeEvent = this._activeEvent;
|
|
5215
|
-
var panEvent = activeEvent.onEventStart(event,
|
|
5462
|
+
var panEvent = activeEvent.onEventStart(event, inputButton);
|
|
5216
5463
|
|
|
5217
|
-
if (!panEvent || !this._enabled || activeEvent.getTouches(event) > 1) {
|
|
5464
|
+
if (!panEvent || !this._enabled || activeEvent.getTouches(event, inputButton) > 1) {
|
|
5218
5465
|
return;
|
|
5219
5466
|
}
|
|
5220
5467
|
|
|
5221
5468
|
if (panEvent.srcEvent.cancelable !== false) {
|
|
5222
5469
|
var edgeThreshold = this.options.iOSEdgeSwipeThreshold;
|
|
5470
|
+
this._dragged = false;
|
|
5223
5471
|
|
|
5224
5472
|
this._observer.hold(this, panEvent);
|
|
5225
5473
|
|
|
@@ -5234,31 +5482,33 @@ version: 4.9.0
|
|
|
5234
5482
|
__proto._onPanmove = function (event) {
|
|
5235
5483
|
var _this = this;
|
|
5236
5484
|
|
|
5237
|
-
var activeEvent = this._activeEvent;
|
|
5238
|
-
var panEvent = activeEvent.onEventMove(event, this.options.inputButton);
|
|
5239
|
-
|
|
5240
|
-
if (!panEvent || !this._enabled || activeEvent.getTouches(event) > 1) {
|
|
5241
|
-
return;
|
|
5242
|
-
}
|
|
5243
|
-
|
|
5244
5485
|
var _a = this.options,
|
|
5245
5486
|
iOSEdgeSwipeThreshold = _a.iOSEdgeSwipeThreshold,
|
|
5246
|
-
releaseOnScroll = _a.releaseOnScroll
|
|
5247
|
-
|
|
5487
|
+
releaseOnScroll = _a.releaseOnScroll,
|
|
5488
|
+
inputButton = _a.inputButton,
|
|
5489
|
+
thresholdAngle = _a.thresholdAngle;
|
|
5490
|
+
var activeEvent = this._activeEvent;
|
|
5491
|
+
var panEvent = activeEvent.onEventMove(event, inputButton);
|
|
5492
|
+
var touches = activeEvent.getTouches(event, inputButton);
|
|
5248
5493
|
|
|
5249
|
-
if (releaseOnScroll && !panEvent.srcEvent.cancelable) {
|
|
5494
|
+
if (touches === 0 || releaseOnScroll && panEvent && !panEvent.srcEvent.cancelable) {
|
|
5250
5495
|
this._onPanend(event);
|
|
5251
5496
|
|
|
5252
5497
|
return;
|
|
5253
5498
|
}
|
|
5254
5499
|
|
|
5500
|
+
if (!panEvent || !this._enabled || touches > 1) {
|
|
5501
|
+
return;
|
|
5502
|
+
}
|
|
5503
|
+
|
|
5504
|
+
var userDirection = getDirectionByAngle(panEvent.angle, thresholdAngle);
|
|
5505
|
+
|
|
5255
5506
|
if (activeEvent.prevEvent && IS_IOS_SAFARI) {
|
|
5256
5507
|
var swipeLeftToRight = panEvent.center.x < 0;
|
|
5257
5508
|
|
|
5258
5509
|
if (swipeLeftToRight) {
|
|
5259
5510
|
// iOS swipe left => right
|
|
5260
|
-
this.
|
|
5261
|
-
|
|
5511
|
+
this.release();
|
|
5262
5512
|
return;
|
|
5263
5513
|
} else if (this._atRightEdge) {
|
|
5264
5514
|
clearTimeout(this._rightEdgeTimer); // - is right to left
|
|
@@ -5270,13 +5520,13 @@ version: 4.9.0
|
|
|
5270
5520
|
} else {
|
|
5271
5521
|
// iOS swipe right => left
|
|
5272
5522
|
this._rightEdgeTimer = window.setTimeout(function () {
|
|
5273
|
-
return _this.
|
|
5523
|
+
return _this.release();
|
|
5274
5524
|
}, 100);
|
|
5275
5525
|
}
|
|
5276
5526
|
}
|
|
5277
5527
|
}
|
|
5278
5528
|
|
|
5279
|
-
var offset = this.
|
|
5529
|
+
var offset = this._getOffset([panEvent.offsetX, panEvent.offsetY], [useDirection(DIRECTION_HORIZONTAL, this._direction, userDirection), useDirection(DIRECTION_VERTICAL, this._direction, userDirection)]);
|
|
5280
5530
|
|
|
5281
5531
|
var prevent = offset.some(function (v) {
|
|
5282
5532
|
return v !== 0;
|
|
@@ -5293,6 +5543,8 @@ version: 4.9.0
|
|
|
5293
5543
|
panEvent.preventSystemEvent = prevent;
|
|
5294
5544
|
|
|
5295
5545
|
if (prevent) {
|
|
5546
|
+
this._dragged = true;
|
|
5547
|
+
|
|
5296
5548
|
this._observer.change(this, panEvent, toAxis(this.axes, offset));
|
|
5297
5549
|
}
|
|
5298
5550
|
|
|
@@ -5300,10 +5552,11 @@ version: 4.9.0
|
|
|
5300
5552
|
};
|
|
5301
5553
|
|
|
5302
5554
|
__proto._onPanend = function (event) {
|
|
5555
|
+
var inputButton = this.options.inputButton;
|
|
5303
5556
|
var activeEvent = this._activeEvent;
|
|
5304
5557
|
activeEvent.onEventEnd(event);
|
|
5305
5558
|
|
|
5306
|
-
if (!this._enabled || activeEvent.getTouches(event) !== 0) {
|
|
5559
|
+
if (!this._enabled || activeEvent.getTouches(event, inputButton) !== 0) {
|
|
5307
5560
|
return;
|
|
5308
5561
|
}
|
|
5309
5562
|
|
|
@@ -5312,7 +5565,7 @@ version: 4.9.0
|
|
|
5312
5565
|
clearTimeout(this._rightEdgeTimer);
|
|
5313
5566
|
var prevEvent = activeEvent.prevEvent;
|
|
5314
5567
|
|
|
5315
|
-
var velocity = this.
|
|
5568
|
+
var velocity = 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)]);
|
|
5316
5569
|
|
|
5317
5570
|
activeEvent.onRelease();
|
|
5318
5571
|
|
|
@@ -5345,28 +5598,39 @@ version: 4.9.0
|
|
|
5345
5598
|
});
|
|
5346
5599
|
};
|
|
5347
5600
|
|
|
5601
|
+
__proto._getOffset = function (properties, direction) {
|
|
5602
|
+
var scale = this.options.scale;
|
|
5603
|
+
return [direction[0] ? properties[0] * scale[0] : 0, direction[1] ? properties[1] * scale[1] : 0];
|
|
5604
|
+
};
|
|
5605
|
+
|
|
5348
5606
|
__proto._attachElementEvent = function (observer) {
|
|
5349
5607
|
var _this = this;
|
|
5350
5608
|
|
|
5351
5609
|
var activeEvent = convertInputType(this.options.inputType);
|
|
5610
|
+
var element = this.element;
|
|
5352
5611
|
|
|
5353
5612
|
if (!activeEvent) {
|
|
5354
5613
|
return;
|
|
5355
5614
|
}
|
|
5356
5615
|
|
|
5616
|
+
if (!element) {
|
|
5617
|
+
throw new Error("Element to connect input does not exist.");
|
|
5618
|
+
}
|
|
5619
|
+
|
|
5357
5620
|
this._observer = observer;
|
|
5358
5621
|
this._enabled = true;
|
|
5359
5622
|
this._activeEvent = activeEvent;
|
|
5360
|
-
activeEvent.start.forEach(function (event) {
|
|
5361
|
-
var _a;
|
|
5362
5623
|
|
|
5363
|
-
|
|
5624
|
+
if (this.options.preventClickOnDrag) {
|
|
5625
|
+
element.addEventListener("click", this._preventClickWhenDragged, true);
|
|
5626
|
+
}
|
|
5627
|
+
|
|
5628
|
+
activeEvent.start.forEach(function (event) {
|
|
5629
|
+
element.addEventListener(event, _this._onPanstart);
|
|
5364
5630
|
}); // adding event listener to element prevents invalid behavior in iOS Safari
|
|
5365
5631
|
|
|
5366
5632
|
activeEvent.move.forEach(function (event) {
|
|
5367
|
-
|
|
5368
|
-
|
|
5369
|
-
(_a = _this.element) === null || _a === void 0 ? void 0 : _a.addEventListener(event, function () {});
|
|
5633
|
+
element.addEventListener(event, _this._voidFunction);
|
|
5370
5634
|
});
|
|
5371
5635
|
};
|
|
5372
5636
|
|
|
@@ -5374,38 +5638,33 @@ version: 4.9.0
|
|
|
5374
5638
|
var _this = this;
|
|
5375
5639
|
|
|
5376
5640
|
var activeEvent = this._activeEvent;
|
|
5377
|
-
|
|
5378
|
-
var _a;
|
|
5379
|
-
|
|
5380
|
-
(_a = _this.element) === null || _a === void 0 ? void 0 : _a.removeEventListener(event, _this._onPanstart);
|
|
5381
|
-
});
|
|
5382
|
-
activeEvent === null || activeEvent === void 0 ? void 0 : activeEvent.move.forEach(function (event) {
|
|
5383
|
-
var _a;
|
|
5384
|
-
|
|
5385
|
-
(_a = _this.element) === null || _a === void 0 ? void 0 : _a.removeEventListener(event, function () {});
|
|
5386
|
-
});
|
|
5387
|
-
this._enabled = false;
|
|
5388
|
-
this._observer = null;
|
|
5389
|
-
};
|
|
5390
|
-
|
|
5391
|
-
__proto._applyScale = function (properties, direction) {
|
|
5392
|
-
var offset = [0, 0];
|
|
5393
|
-
var scale = this.options.scale;
|
|
5641
|
+
var element = this.element;
|
|
5394
5642
|
|
|
5395
|
-
if (
|
|
5396
|
-
|
|
5397
|
-
|
|
5643
|
+
if (element) {
|
|
5644
|
+
if (this.options.preventClickOnDrag) {
|
|
5645
|
+
element.removeEventListener("click", this._preventClickWhenDragged, true);
|
|
5646
|
+
}
|
|
5398
5647
|
|
|
5399
|
-
|
|
5400
|
-
|
|
5648
|
+
activeEvent === null || activeEvent === void 0 ? void 0 : activeEvent.start.forEach(function (event) {
|
|
5649
|
+
element.removeEventListener(event, _this._onPanstart);
|
|
5650
|
+
});
|
|
5651
|
+
activeEvent === null || activeEvent === void 0 ? void 0 : activeEvent.move.forEach(function (event) {
|
|
5652
|
+
element.removeEventListener(event, _this._voidFunction);
|
|
5653
|
+
});
|
|
5401
5654
|
}
|
|
5402
5655
|
|
|
5403
|
-
|
|
5656
|
+
this._enabled = false;
|
|
5657
|
+
this._observer = null;
|
|
5404
5658
|
};
|
|
5405
5659
|
|
|
5406
5660
|
return PanInput;
|
|
5407
5661
|
}();
|
|
5408
5662
|
|
|
5663
|
+
/*
|
|
5664
|
+
* Copyright (c) 2015 NAVER Corp.
|
|
5665
|
+
* egjs projects are licensed under the MIT license
|
|
5666
|
+
*/
|
|
5667
|
+
|
|
5409
5668
|
var Axes$1 = Axes;
|
|
5410
5669
|
|
|
5411
5670
|
/**
|
|
@@ -5580,7 +5839,7 @@ version: 4.9.0
|
|
|
5580
5839
|
var moveEvent = new ComponentEvent$1(EVENTS.MOVE, {
|
|
5581
5840
|
isTrusted: axesEvent.isTrusted,
|
|
5582
5841
|
holding: this.holding,
|
|
5583
|
-
direction: getDirection(0, axesEvent.delta[POSITION_KEY]),
|
|
5842
|
+
direction: getDirection$1(0, axesEvent.delta[POSITION_KEY]),
|
|
5584
5843
|
axesEvent: axesEvent
|
|
5585
5844
|
});
|
|
5586
5845
|
flicking.trigger(moveEvent);
|
|
@@ -5668,7 +5927,7 @@ version: 4.9.0
|
|
|
5668
5927
|
var moveStartEvent = new ComponentEvent$1(EVENTS.MOVE_START, {
|
|
5669
5928
|
isTrusted: axesEvent.isTrusted,
|
|
5670
5929
|
holding: this.holding,
|
|
5671
|
-
direction: getDirection(animatingContext.start, animatingContext.end),
|
|
5930
|
+
direction: getDirection$1(animatingContext.start, animatingContext.end),
|
|
5672
5931
|
axesEvent: axesEvent
|
|
5673
5932
|
});
|
|
5674
5933
|
flicking.trigger(moveStartEvent);
|
|
@@ -5729,7 +5988,7 @@ version: 4.9.0
|
|
|
5729
5988
|
var moveStartEvent = new ComponentEvent$1(EVENTS.MOVE_START, {
|
|
5730
5989
|
isTrusted: axesEvent.isTrusted,
|
|
5731
5990
|
holding: this.holding,
|
|
5732
|
-
direction: getDirection(0, -offset),
|
|
5991
|
+
direction: getDirection$1(0, -offset),
|
|
5733
5992
|
axesEvent: axesEvent
|
|
5734
5993
|
});
|
|
5735
5994
|
flicking.trigger(moveStartEvent);
|
|
@@ -5831,7 +6090,7 @@ version: 4.9.0
|
|
|
5831
6090
|
index: clickedPanel.index,
|
|
5832
6091
|
panel: clickedPanel,
|
|
5833
6092
|
// Direction to the clicked panel
|
|
5834
|
-
direction: getDirection(cameraPosition, clickedPanelPosition)
|
|
6093
|
+
direction: getDirection$1(cameraPosition, clickedPanelPosition)
|
|
5835
6094
|
}));
|
|
5836
6095
|
}
|
|
5837
6096
|
};
|
|
@@ -5986,7 +6245,7 @@ version: 4.9.0
|
|
|
5986
6245
|
transitTo(STATE_TYPE.IDLE);
|
|
5987
6246
|
flicking.trigger(new ComponentEvent$1(EVENTS.MOVE_END, {
|
|
5988
6247
|
isTrusted: axesEvent.isTrusted,
|
|
5989
|
-
direction: getDirection(animatingContext.start, animatingContext.end),
|
|
6248
|
+
direction: getDirection$1(animatingContext.start, animatingContext.end),
|
|
5990
6249
|
axesEvent: axesEvent
|
|
5991
6250
|
}));
|
|
5992
6251
|
var targetPanel = this._targetPanel;
|
|
@@ -6428,6 +6687,20 @@ version: 4.9.0
|
|
|
6428
6687
|
(_a = this._panInput) === null || _a === void 0 ? void 0 : _a.disable();
|
|
6429
6688
|
return this;
|
|
6430
6689
|
};
|
|
6690
|
+
/**
|
|
6691
|
+
* Releases ongoing user input (mouse/touch)
|
|
6692
|
+
* @ko 사용자의 현재 입력(마우스/터치)를 중단시킵니다
|
|
6693
|
+
* @chainable
|
|
6694
|
+
* @return {this}
|
|
6695
|
+
*/
|
|
6696
|
+
|
|
6697
|
+
|
|
6698
|
+
__proto.release = function () {
|
|
6699
|
+
var _a;
|
|
6700
|
+
|
|
6701
|
+
(_a = this._panInput) === null || _a === void 0 ? void 0 : _a.release();
|
|
6702
|
+
return this;
|
|
6703
|
+
};
|
|
6431
6704
|
/**
|
|
6432
6705
|
* Update {@link https://naver.github.io/egjs-axes/ @egjs/axes}'s state
|
|
6433
6706
|
* @ko {@link https://naver.github.io/egjs-axes/ @egjs/axes}의 상태를 갱신합니다
|
|
@@ -6739,6 +7012,19 @@ version: 4.9.0
|
|
|
6739
7012
|
|
|
6740
7013
|
return this;
|
|
6741
7014
|
};
|
|
7015
|
+
/**
|
|
7016
|
+
* Releases ongoing user input (mouse/touch)
|
|
7017
|
+
* @ko 사용자의 현재 입력(마우스/터치)를 중단시킵니다
|
|
7018
|
+
* @chainable
|
|
7019
|
+
* @return {this}
|
|
7020
|
+
*/
|
|
7021
|
+
|
|
7022
|
+
|
|
7023
|
+
__proto.release = function () {
|
|
7024
|
+
this._controller.release();
|
|
7025
|
+
|
|
7026
|
+
return this;
|
|
7027
|
+
};
|
|
6742
7028
|
/**
|
|
6743
7029
|
* Update position after resizing
|
|
6744
7030
|
* @ko resize 이후에 position을 업데이트합니다
|
|
@@ -6899,7 +7185,7 @@ version: 4.9.0
|
|
|
6899
7185
|
prevIndex: (_a = prevActivePanel === null || prevActivePanel === void 0 ? void 0 : prevActivePanel.index) !== null && _a !== void 0 ? _a : -1,
|
|
6900
7186
|
prevPanel: prevActivePanel,
|
|
6901
7187
|
isTrusted: isTrusted,
|
|
6902
|
-
direction: prevActivePanel ? getDirection(prevActivePanel.position, newActivePanel.position) : DIRECTION.NONE
|
|
7188
|
+
direction: prevActivePanel ? getDirection$1(prevActivePanel.position, newActivePanel.position) : DIRECTION.NONE
|
|
6903
7189
|
}));
|
|
6904
7190
|
} else {
|
|
6905
7191
|
flicking.trigger(new ComponentEvent$1(EVENTS.RESTORED, {
|
|
@@ -6919,7 +7205,7 @@ version: 4.9.0
|
|
|
6919
7205
|
index: panel.index,
|
|
6920
7206
|
panel: panel,
|
|
6921
7207
|
isTrusted: (axesEvent === null || axesEvent === void 0 ? void 0 : axesEvent.isTrusted) || false,
|
|
6922
|
-
direction: getDirection((_a = activePanel === null || activePanel === void 0 ? void 0 : activePanel.position) !== null && _a !== void 0 ? _a : camera.position, position)
|
|
7208
|
+
direction: getDirection$1((_a = activePanel === null || activePanel === void 0 ? void 0 : activePanel.position) !== null && _a !== void 0 ? _a : camera.position, position)
|
|
6923
7209
|
});
|
|
6924
7210
|
flicking.trigger(event);
|
|
6925
7211
|
|
|
@@ -10511,11 +10797,13 @@ version: 4.9.0
|
|
|
10511
10797
|
} : {
|
|
10512
10798
|
height: panelSize
|
|
10513
10799
|
};
|
|
10514
|
-
|
|
10800
|
+
|
|
10801
|
+
var firstPanelSizeObj = __assign$2({
|
|
10515
10802
|
size: panelSize,
|
|
10516
|
-
height: referencePanel.height,
|
|
10517
10803
|
margin: referencePanel.margin
|
|
10518
|
-
}
|
|
10804
|
+
}, !flicking.horizontal && {
|
|
10805
|
+
height: referencePanel.height
|
|
10806
|
+
});
|
|
10519
10807
|
|
|
10520
10808
|
if (!flicking.noPanelStyleOverride) {
|
|
10521
10809
|
this._strategy.updatePanelSizes(flicking, panelSizeObj);
|
|
@@ -11049,6 +11337,8 @@ version: 4.9.0
|
|
|
11049
11337
|
|
|
11050
11338
|
|
|
11051
11339
|
__proto.resize = function (cached) {
|
|
11340
|
+
var _a;
|
|
11341
|
+
|
|
11052
11342
|
var el = this.element;
|
|
11053
11343
|
var flicking = this._flicking;
|
|
11054
11344
|
var horizontal = flicking.horizontal,
|
|
@@ -11057,7 +11347,13 @@ version: 4.9.0
|
|
|
11057
11347
|
if (cached) {
|
|
11058
11348
|
this._size = cached.size;
|
|
11059
11349
|
this._margin = __assign$2({}, cached.margin);
|
|
11060
|
-
this._height = cached.height
|
|
11350
|
+
this._height = (_a = cached.height) !== null && _a !== void 0 ? _a : getElementSize({
|
|
11351
|
+
el: el,
|
|
11352
|
+
horizontal: false,
|
|
11353
|
+
useFractionalSize: useFractionalSize,
|
|
11354
|
+
useOffset: true,
|
|
11355
|
+
style: getStyle(el)
|
|
11356
|
+
});
|
|
11061
11357
|
} else {
|
|
11062
11358
|
var elStyle = getStyle(el);
|
|
11063
11359
|
this._size = getElementSize({
|
|
@@ -13033,6 +13329,10 @@ version: 4.9.0
|
|
|
13033
13329
|
return Promise.reject(new FlickingError(MESSAGE.ANIMATION_ALREADY_PLAYING, CODE.ANIMATION_ALREADY_PLAYING));
|
|
13034
13330
|
}
|
|
13035
13331
|
|
|
13332
|
+
if (this._control.holding) {
|
|
13333
|
+
this._control.controller.release();
|
|
13334
|
+
}
|
|
13335
|
+
|
|
13036
13336
|
return this._control.moveToPanel(panel, {
|
|
13037
13337
|
duration: duration,
|
|
13038
13338
|
direction: direction
|
|
@@ -13517,9 +13817,10 @@ version: 4.9.0
|
|
|
13517
13817
|
var renderer = this._renderer;
|
|
13518
13818
|
var control = this._control;
|
|
13519
13819
|
var camera = this._camera;
|
|
13520
|
-
var
|
|
13521
|
-
if (!
|
|
13522
|
-
var nearestAnchor = camera.findNearestAnchor(
|
|
13820
|
+
var defaultPanel = renderer.getPanel(this._defaultIndex) || renderer.getPanel(0);
|
|
13821
|
+
if (!defaultPanel) return;
|
|
13822
|
+
var nearestAnchor = camera.findNearestAnchor(defaultPanel.position);
|
|
13823
|
+
var initialPanel = nearestAnchor && defaultPanel.index !== nearestAnchor.panel.index ? nearestAnchor.panel : defaultPanel;
|
|
13523
13824
|
control.setActive(initialPanel, null, false);
|
|
13524
13825
|
|
|
13525
13826
|
if (!nearestAnchor) {
|
|
@@ -13580,7 +13881,7 @@ version: 4.9.0
|
|
|
13580
13881
|
*/
|
|
13581
13882
|
|
|
13582
13883
|
|
|
13583
|
-
Flicking.VERSION = "4.9.0";
|
|
13884
|
+
Flicking.VERSION = "4.9.3-beta.0";
|
|
13584
13885
|
return Flicking;
|
|
13585
13886
|
}(Component);
|
|
13586
13887
|
|