@egjs/flicking 4.10.2 → 4.10.4

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.
@@ -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.10.2
7
+ version: 4.10.4
8
8
  */
9
9
  (function (global, factory) {
10
10
  typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
@@ -2426,7 +2426,7 @@ version: 4.10.2
2426
2426
  license: MIT
2427
2427
  author: NAVER Corp.
2428
2428
  repository: https://github.com/naver/egjs-axes
2429
- version: 3.8.1
2429
+ version: 3.8.3
2430
2430
  */
2431
2431
 
2432
2432
  /*! *****************************************************************************
@@ -2521,6 +2521,12 @@ version: 4.10.2
2521
2521
  var MOUSE_LEFT = "left";
2522
2522
  var MOUSE_RIGHT = "right";
2523
2523
  var MOUSE_MIDDLE = "middle";
2524
+ var ANY = "any";
2525
+ var NONE = "none";
2526
+ var SHIFT = "shift";
2527
+ var CTRL = "ctrl";
2528
+ var ALT = "alt";
2529
+ var META = "meta";
2524
2530
  var VELOCITY_INTERVAL = 16;
2525
2531
  var IOS_EDGE_THRESHOLD = 30;
2526
2532
  var IS_IOS_SAFARI = "ontouchstart" in win && agent().browser.name === "safari";
@@ -3424,6 +3430,13 @@ version: 4.10.2
3424
3430
  var SUPPORT_POINTER = ("PointerEvent" in win);
3425
3431
  var SUPPORT_MSPOINTER = ("MSPointerEvent" in win);
3426
3432
  var SUPPORT_POINTER_EVENTS = SUPPORT_POINTER || SUPPORT_MSPOINTER;
3433
+ var isValidKey = function (event, inputKey) {
3434
+ 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) {
3435
+ return true;
3436
+ }
3437
+
3438
+ return false;
3439
+ };
3427
3440
 
3428
3441
  var EventInput =
3429
3442
  /*#__PURE__*/
@@ -3506,13 +3519,17 @@ version: 4.10.2
3506
3519
  };
3507
3520
 
3508
3521
  __proto._isTouchEvent = function (event) {
3509
- return event.type.indexOf("touch") > -1;
3522
+ return event.type && event.type.indexOf("touch") > -1;
3510
3523
  };
3511
3524
 
3512
3525
  __proto._isValidButton = function (button, inputButton) {
3513
3526
  return inputButton.indexOf(button) > -1;
3514
3527
  };
3515
3528
 
3529
+ __proto._isValidEvent = function (event, inputKey, inputButton) {
3530
+ return (!inputKey || isValidKey(event, inputKey)) && (!inputButton || this._isValidButton(this._getButton(event), inputButton));
3531
+ };
3532
+
3516
3533
  __proto._preventMouseButton = function (event, button) {
3517
3534
  if (button === MOUSE_RIGHT) {
3518
3535
  win.addEventListener("contextmenu", this._stopContextMenu);
@@ -3540,10 +3557,10 @@ version: 4.10.2
3540
3557
 
3541
3558
  var __proto = MouseEventInput.prototype;
3542
3559
 
3543
- __proto.onEventStart = function (event, inputButton) {
3560
+ __proto.onEventStart = function (event, inputKey, inputButton) {
3544
3561
  var button = this._getButton(event);
3545
3562
 
3546
- if (inputButton && !this._isValidButton(button, inputButton)) {
3563
+ if (!this._isValidEvent(event, inputKey, inputButton)) {
3547
3564
  return null;
3548
3565
  }
3549
3566
 
@@ -3552,8 +3569,8 @@ version: 4.10.2
3552
3569
  return this.extendEvent(event);
3553
3570
  };
3554
3571
 
3555
- __proto.onEventMove = function (event, inputButton) {
3556
- if (inputButton && !this._isValidButton(this._getButton(event), inputButton)) {
3572
+ __proto.onEventMove = function (event, inputKey, inputButton) {
3573
+ if (!this._isValidEvent(event, inputKey, inputButton)) {
3557
3574
  return null;
3558
3575
  }
3559
3576
 
@@ -3620,12 +3637,21 @@ version: 4.10.2
3620
3637
 
3621
3638
  var __proto = TouchEventInput.prototype;
3622
3639
 
3623
- __proto.onEventStart = function (event) {
3640
+ __proto.onEventStart = function (event, inputKey) {
3624
3641
  this._baseTouches = event.touches;
3642
+
3643
+ if (!this._isValidEvent(event, inputKey)) {
3644
+ return null;
3645
+ }
3646
+
3625
3647
  return this.extendEvent(event);
3626
3648
  };
3627
3649
 
3628
- __proto.onEventMove = function (event) {
3650
+ __proto.onEventMove = function (event, inputKey) {
3651
+ if (!this._isValidEvent(event, inputKey)) {
3652
+ return null;
3653
+ }
3654
+
3629
3655
  return this.extendEvent(event);
3630
3656
  };
3631
3657
 
@@ -3697,10 +3723,10 @@ version: 4.10.2
3697
3723
 
3698
3724
  var __proto = PointerEventInput.prototype;
3699
3725
 
3700
- __proto.onEventStart = function (event, inputButton) {
3726
+ __proto.onEventStart = function (event, inputKey, inputButton) {
3701
3727
  var button = this._getButton(event);
3702
3728
 
3703
- if (inputButton && !this._isValidButton(button, inputButton)) {
3729
+ if (!this._isValidEvent(event, inputKey, inputButton)) {
3704
3730
  return null;
3705
3731
  }
3706
3732
 
@@ -3711,8 +3737,8 @@ version: 4.10.2
3711
3737
  return this.extendEvent(event);
3712
3738
  };
3713
3739
 
3714
- __proto.onEventMove = function (event, inputButton) {
3715
- if (inputButton && !this._isValidButton(this._getButton(event), inputButton)) {
3740
+ __proto.onEventMove = function (event, inputKey, inputButton) {
3741
+ if (!this._isValidEvent(event, inputKey, inputButton)) {
3716
3742
  return null;
3717
3743
  }
3718
3744
 
@@ -3814,14 +3840,14 @@ version: 4.10.2
3814
3840
 
3815
3841
  var __proto = TouchMouseEventInput.prototype;
3816
3842
 
3817
- __proto.onEventStart = function (event, inputButton) {
3843
+ __proto.onEventStart = function (event, inputKey, inputButton) {
3818
3844
  var button = this._getButton(event);
3819
3845
 
3820
3846
  if (this._isTouchEvent(event)) {
3821
3847
  this._baseTouches = event.touches;
3822
3848
  }
3823
3849
 
3824
- if (inputButton && !this._isValidButton(button, inputButton)) {
3850
+ if (!this._isValidEvent(event, inputKey, inputButton)) {
3825
3851
  return null;
3826
3852
  }
3827
3853
 
@@ -3830,8 +3856,8 @@ version: 4.10.2
3830
3856
  return this.extendEvent(event);
3831
3857
  };
3832
3858
 
3833
- __proto.onEventMove = function (event, inputButton) {
3834
- if (inputButton && !this._isValidButton(this._getButton(event), inputButton)) {
3859
+ __proto.onEventMove = function (event, inputKey, inputButton) {
3860
+ if (!this._isValidEvent(event, inputKey, inputButton)) {
3835
3861
  return null;
3836
3862
  }
3837
3863
 
@@ -3962,6 +3988,13 @@ version: 4.10.2
3962
3988
 
3963
3989
  return null;
3964
3990
  };
3991
+ function getAddEventOptions(eventName) {
3992
+ // The passive default value of the touch event is true.
3993
+ // If not a touch event, return false to support ie11
3994
+ return eventName.indexOf("touch") > -1 ? {
3995
+ passive: false
3996
+ } : false;
3997
+ }
3965
3998
 
3966
3999
  var InputObserver =
3967
4000
  /*#__PURE__*/
@@ -4169,7 +4202,7 @@ version: 4.10.2
4169
4202
  var out = opt.bounce;
4170
4203
  var circular = opt.circular;
4171
4204
 
4172
- if (circular && (circular[0] || circular[1])) {
4205
+ if (circular[0] && v < min || circular[1] && v > max) {
4173
4206
  return v;
4174
4207
  } else if (v < min) {
4175
4208
  // left
@@ -5179,7 +5212,7 @@ version: 4.10.2
5179
5212
  */
5180
5213
 
5181
5214
 
5182
- Axes.VERSION = "3.8.1";
5215
+ Axes.VERSION = "3.8.3";
5183
5216
  /* eslint-enable */
5184
5217
 
5185
5218
  /**
@@ -5279,6 +5312,19 @@ version: 4.10.2
5279
5312
  * - touch: 터치 입력 장치
5280
5313
  * - mouse: 마우스
5281
5314
  * - pointer: 마우스 및 터치</ko>
5315
+ * @param {String[]} [inputKey=["any"]] List of key combinations to allow input
5316
+ * - any: any key
5317
+ * - shift: shift key
5318
+ * - ctrl: ctrl key and pinch gesture on the trackpad
5319
+ * - alt: alt key
5320
+ * - meta: meta key
5321
+ * - none: none of these keys are pressed <ko>입력을 허용할 키 조합 목록
5322
+ * - any: 아무 키
5323
+ * - shift: shift 키
5324
+ * - ctrl: ctrl 키 및 트랙패드의 pinch 제스쳐
5325
+ * - alt: alt 키
5326
+ * - meta: meta 키
5327
+ * - none: 아무 키도 눌리지 않은 상태 </ko>
5282
5328
  * @param {String[]} [inputButton=["left"]] List of buttons to allow input
5283
5329
  * - left: Left mouse button and normal touch
5284
5330
  * - middle: Mouse wheel press
@@ -5353,6 +5399,7 @@ version: 4.10.2
5353
5399
  this.element = $(el);
5354
5400
  this.options = __assign$1({
5355
5401
  inputType: ["touch", "mouse", "pointer"],
5402
+ inputKey: [ANY],
5356
5403
  inputButton: [MOUSE_LEFT],
5357
5404
  scale: [1, 1],
5358
5405
  thresholdAngle: 45,
@@ -5461,9 +5508,11 @@ version: 4.10.2
5461
5508
  };
5462
5509
 
5463
5510
  __proto._onPanstart = function (event) {
5464
- var inputButton = this.options.inputButton;
5511
+ var _a = this.options,
5512
+ inputKey = _a.inputKey,
5513
+ inputButton = _a.inputButton;
5465
5514
  var activeEvent = this._activeEvent;
5466
- var panEvent = activeEvent.onEventStart(event, inputButton);
5515
+ var panEvent = activeEvent.onEventStart(event, inputKey, inputButton);
5467
5516
 
5468
5517
  if (!panEvent || !this._enabled || activeEvent.getTouches(event, inputButton) > 1) {
5469
5518
  return;
@@ -5489,12 +5538,14 @@ version: 4.10.2
5489
5538
 
5490
5539
  var _a = this.options,
5491
5540
  iOSEdgeSwipeThreshold = _a.iOSEdgeSwipeThreshold,
5541
+ preventClickOnDrag = _a.preventClickOnDrag,
5492
5542
  releaseOnScroll = _a.releaseOnScroll,
5543
+ inputKey = _a.inputKey,
5493
5544
  inputButton = _a.inputButton,
5494
5545
  threshold = _a.threshold,
5495
5546
  thresholdAngle = _a.thresholdAngle;
5496
5547
  var activeEvent = this._activeEvent;
5497
- var panEvent = activeEvent.onEventMove(event, inputButton);
5548
+ var panEvent = activeEvent.onEventMove(event, inputKey, inputButton);
5498
5549
  var touches = activeEvent.getTouches(event, inputButton);
5499
5550
 
5500
5551
  if (touches === 0 || releaseOnScroll && panEvent && !panEvent.srcEvent.cancelable) {
@@ -5553,7 +5604,7 @@ version: 4.10.2
5553
5604
  panEvent.preventSystemEvent = prevent;
5554
5605
 
5555
5606
  if (prevent && (this._isOverThreshold || distance >= threshold)) {
5556
- this._dragged = true;
5607
+ this._dragged = preventClickOnDrag;
5557
5608
  this._isOverThreshold = true;
5558
5609
 
5559
5610
  this._observer.change(this, panEvent, toAxis(this.axes, offset));
@@ -5585,14 +5636,10 @@ version: 4.10.2
5585
5636
  var _this = this;
5586
5637
 
5587
5638
  activeEvent === null || activeEvent === void 0 ? void 0 : activeEvent.move.forEach(function (event) {
5588
- window.addEventListener(event, _this._onPanmove, {
5589
- passive: false
5590
- });
5639
+ window.addEventListener(event, _this._onPanmove, getAddEventOptions(event));
5591
5640
  });
5592
5641
  activeEvent === null || activeEvent === void 0 ? void 0 : activeEvent.end.forEach(function (event) {
5593
- window.addEventListener(event, _this._onPanend, {
5594
- passive: false
5595
- });
5642
+ window.addEventListener(event, _this._onPanend, getAddEventOptions(event));
5596
5643
  });
5597
5644
  };
5598
5645
 
@@ -5633,11 +5680,7 @@ version: 4.10.2
5633
5680
  this._observer = observer;
5634
5681
  this._enabled = true;
5635
5682
  this._activeEvent = activeEvent;
5636
-
5637
- if (this.options.preventClickOnDrag) {
5638
- element.addEventListener("click", this._preventClickWhenDragged, true);
5639
- }
5640
-
5683
+ element.addEventListener("click", this._preventClickWhenDragged, true);
5641
5684
  activeEvent.start.forEach(function (event) {
5642
5685
  element.addEventListener(event, _this._onPanstart);
5643
5686
  }); // adding event listener to element prevents invalid behavior in iOS Safari
@@ -5654,10 +5697,7 @@ version: 4.10.2
5654
5697
  var element = this.element;
5655
5698
 
5656
5699
  if (element) {
5657
- if (this.options.preventClickOnDrag) {
5658
- element.removeEventListener("click", this._preventClickWhenDragged, true);
5659
- }
5660
-
5700
+ element.removeEventListener("click", this._preventClickWhenDragged, true);
5661
5701
  activeEvent === null || activeEvent === void 0 ? void 0 : activeEvent.start.forEach(function (event) {
5662
5702
  element.removeEventListener(event, _this._onPanstart);
5663
5703
  });
@@ -9410,7 +9450,7 @@ version: 4.10.2
9410
9450
  license: MIT
9411
9451
  author: NAVER Corp.
9412
9452
  repository: https://github.com/naver/egjs-imready
9413
- version: 1.3.0
9453
+ version: 1.3.1
9414
9454
  */
9415
9455
 
9416
9456
  /*! *****************************************************************************
@@ -10011,7 +10051,7 @@ version: 4.10.2
10011
10051
  this.readyCount = 0;
10012
10052
  this.totalErrorCount = 0;
10013
10053
  this.elementInfos.forEach(function (info) {
10014
- if (!info.isReady && info.loader) {
10054
+ if (info.loader) {
10015
10055
  info.loader.destroy();
10016
10056
  }
10017
10057
  });
@@ -14115,7 +14155,7 @@ version: 4.10.2
14115
14155
  */
14116
14156
 
14117
14157
 
14118
- Flicking.VERSION = "4.10.2";
14158
+ Flicking.VERSION = "4.10.4";
14119
14159
  return Flicking;
14120
14160
  }(Component);
14121
14161