@egjs/flicking 4.10.4 → 4.10.5

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.4
7
+ version: 4.10.5
8
8
  */
9
9
  import Component, { ComponentEvent } from '@egjs/component';
10
10
  import Axes, { PanInput } from '@egjs/axes';
@@ -3319,8 +3319,8 @@ function (_super) {
3319
3319
  // Move to the adjacent panel
3320
3320
  targetAnchor = this._findAdjacentAnchor(position, posDelta, anchorAtCamera);
3321
3321
  } else {
3322
- // Restore to active panel
3323
- return this.moveToPanel(activeAnchor.panel, {
3322
+ // Fallback to nearest panel from current camera
3323
+ return this.moveToPanel(anchorAtCamera.panel, {
3324
3324
  duration: duration,
3325
3325
  axesEvent: axesEvent
3326
3326
  });
@@ -3788,9 +3788,17 @@ function (_super) {
3788
3788
  targetPanel = adjacentAnchor.panel;
3789
3789
  targetPos = adjacentAnchor.position;
3790
3790
  } else {
3791
- // Restore to active panel
3792
- targetPos = camera.clampToReachablePosition(activePanel.position);
3793
- targetPanel = activePanel;
3791
+ // Fallback to nearest panel from current camera
3792
+ var anchorAtCamera = camera.findNearestAnchor(camera.position);
3793
+
3794
+ if (!anchorAtCamera) {
3795
+ return Promise.reject(new FlickingError(MESSAGE.POSITION_NOT_REACHABLE(position), CODE.POSITION_NOT_REACHABLE));
3796
+ }
3797
+
3798
+ return this.moveToPanel(anchorAtCamera.panel, {
3799
+ duration: duration,
3800
+ axesEvent: axesEvent
3801
+ });
3794
3802
  }
3795
3803
 
3796
3804
  this._triggerIndexChangeEvent(targetPanel, position, axesEvent);
@@ -7217,6 +7225,7 @@ function (_super) {
7217
7225
  * @property {ALIGN | string | number} panel The align value for each {@link Panel}s<ko>개개의 {@link Panel}에 적용할 값</ko>
7218
7226
  * @property {ALIGN | string | number} camera The align value for {@link Camera}<ko>{@link Camera}에 적용할 값</ko>
7219
7227
  * @default "center"
7228
+ * @see {@link https://naver.github.io/egjs-flicking/Options#align align ( Options )}
7220
7229
  * @example
7221
7230
  * ```ts
7222
7231
  * const possibleOptions = [
@@ -7257,6 +7266,7 @@ function (_super) {
7257
7266
  * @ko Flicking의 {@link Flicking#init init()}이 호출될 때 이동할 디폴트 패널의 인덱스로, 0부터 시작하는 정수입니다
7258
7267
  * @type {number}
7259
7268
  * @default 0
7269
+ * @see {@link https://naver.github.io/egjs-flicking/Options#defaultindex defaultIndex ( Options )}
7260
7270
  */
7261
7271
  get: function () {
7262
7272
  return this._defaultIndex;
@@ -7273,6 +7283,7 @@ function (_super) {
7273
7283
  * @ko 패널 이동 방향 (true: 가로방향, false: 세로방향)
7274
7284
  * @type {boolean}
7275
7285
  * @default true
7286
+ * @see {@link https://naver.github.io/egjs-flicking/Options#horizontal horizontal ( Options )}
7276
7287
  */
7277
7288
  get: function () {
7278
7289
  return this._horizontal;
@@ -7293,6 +7304,7 @@ function (_super) {
7293
7304
  * @ko 순환 모드를 활성화합니다. 순환 모드에서는 양 끝의 패널이 서로 연결되어 끊김없는 스크롤이 가능합니다.
7294
7305
  * @type {boolean}
7295
7306
  * @default false
7307
+ * @see {@link https://naver.github.io/egjs-flicking/Options#circular circular ( Options )}
7296
7308
  */
7297
7309
  get: function () {
7298
7310
  return this._circular;
@@ -7315,6 +7327,7 @@ function (_super) {
7315
7327
  * @see CIRCULAR_FALLBACK
7316
7328
  * @type {string}
7317
7329
  * @default "linear"
7330
+ * @see {@link https://naver.github.io/egjs-flicking/Options#circularfallback circularFallback ( Options )}
7318
7331
  */
7319
7332
  get: function () {
7320
7333
  return this._circularFallback;
@@ -7330,6 +7343,7 @@ function (_super) {
7330
7343
  * `circular=false`인 경우에만 사용할 수 있습니다
7331
7344
  * @type {boolean}
7332
7345
  * @default false
7346
+ * @see {@link https://naver.github.io/egjs-flicking/Options#bound bound ( Options )}
7333
7347
  */
7334
7348
  get: function () {
7335
7349
  return this._bound;
@@ -7347,6 +7361,7 @@ function (_super) {
7347
7361
  * @ko 이동한 후 뷰포트 엘리먼트의 크기를 현재 패널의 높이와 동일하게 설정합니다. `horizontal=true`인 경우에만 사용할 수 있습니다.
7348
7362
  * @type {boolean}
7349
7363
  * @default false
7364
+ * @see {@link https://naver.github.io/egjs-flicking/Options#adaptive adaptive ( Options )}
7350
7365
  */
7351
7366
  get: function () {
7352
7367
  return this._adaptive;
@@ -7364,6 +7379,7 @@ function (_super) {
7364
7379
  * @ko 한 화면에 보이는 패널의 개수. 이 옵션을 활성화할 경우 패널의 크기를 강제로 재조정합니다
7365
7380
  * @type {number}
7366
7381
  * @default -1
7382
+ * @see {@link https://naver.github.io/egjs-flicking/Options#panelsperview panelsPerView ( Options )}
7367
7383
  */
7368
7384
  get: function () {
7369
7385
  return this._panelsPerView;
@@ -7402,6 +7418,7 @@ function (_super) {
7402
7418
  * 이 동작은 Flicking 내부에 로드 전/후로 크기가 변하는 콘텐츠를 포함하고 있을 때 유용하게 사용하실 수 있습니다.
7403
7419
  * @type {boolean}
7404
7420
  * @default false
7421
+ * @see {@link https://naver.github.io/egjs-flicking/Options#resizeOnContentsReady resizeOnContentsReady ( Options )}
7405
7422
  */
7406
7423
  get: function () {
7407
7424
  return this._resizeOnContentsReady;
@@ -7424,6 +7441,7 @@ function (_super) {
7424
7441
  * 만약 상위 Flicking과 하위 Flicking이 서로 다른 horizontal 옵션을 가지고 있다면 이 옵션을 설정할 필요가 없습니다.
7425
7442
  * @type {boolean}
7426
7443
  * @default false
7444
+ * @see {@link https://naver.github.io/egjs-flicking/Options#nested nested ( Options )}
7427
7445
  */
7428
7446
  get: function () {
7429
7447
  return this._nested;
@@ -7447,6 +7465,7 @@ function (_super) {
7447
7465
  * @ko `needPanel`이벤트가 발생하기 위한 뷰포트 끝으로부터의 최대 거리
7448
7466
  * @type {number}
7449
7467
  * @default 0
7468
+ * @see {@link https://naver.github.io/egjs-flicking/Options#needpanelthreshold needPanelThreshold ( Options )}
7450
7469
  */
7451
7470
  get: function () {
7452
7471
  return this._needPanelThreshold;
@@ -7464,6 +7483,7 @@ function (_super) {
7464
7483
  * @ko 활성화할 경우 초기화시 `ready` 이벤트 이전의 이벤트가 발생하지 않습니다.
7465
7484
  * @type {boolean}
7466
7485
  * @default true
7486
+ * @see {@link https://naver.github.io/egjs-flicking/Options#preventeventsbeforeinit preventEventsBeforeInit ( Options )}
7467
7487
  */
7468
7488
  get: function () {
7469
7489
  return this._preventEventsBeforeInit;
@@ -7482,6 +7502,7 @@ function (_super) {
7482
7502
  * @ko 사용자의 동작으로 가속도가 적용된 패널 이동 애니메이션의 감속도. 값이 높을수록 애니메이션 실행 시간이 짧아집니다
7483
7503
  * @type {number}
7484
7504
  * @default 0.0075
7505
+ * @see {@link https://naver.github.io/egjs-flicking/Options#deceleration deceleration ( Options )}
7485
7506
  */
7486
7507
  get: function () {
7487
7508
  return this._deceleration;
@@ -7505,6 +7526,7 @@ function (_super) {
7505
7526
  * @type {function}
7506
7527
  * @default x => 1 - Math.pow(1 - x, 3)
7507
7528
  * @see Easing Functions Cheat Sheet {@link http://easings.net/} <ko>이징 함수 Cheat Sheet {@link http://easings.net/}</ko>
7529
+ * @see {@link https://naver.github.io/egjs-flicking/Options#easing Easing ( Options )}
7508
7530
  */
7509
7531
  get: function () {
7510
7532
  return this._easing;
@@ -7526,6 +7548,7 @@ function (_super) {
7526
7548
  * @ko 디폴트 애니메이션 재생 시간 (ms)
7527
7549
  * @type {number}
7528
7550
  * @default 500
7551
+ * @see {@link https://naver.github.io/egjs-flicking/Options#duration duration ( Options )}
7529
7552
  */
7530
7553
  get: function () {
7531
7554
  return this._duration;
@@ -7544,8 +7567,9 @@ function (_super) {
7544
7567
  * @ko 활성화할 입력 장치 종류
7545
7568
  * @type {string[]}
7546
7569
  * @default ["touch", "mouse"]
7547
- * @see {@link https://naver.github.io/egjs-axes/release/latest/doc/global.html#PanInputOption Possible values (PanInputOption#inputType)}
7548
- * <ko>{@link https://naver.github.io/egjs-axes/release/latest/doc/global.html#PanInputOption 가능한 값들 (PanInputOption#inputType)}</ko>
7570
+ * @see {@link https://naver.github.io/egjs-axes/Options#paninput-options Possible values (PanInputOption#inputType)}
7571
+ * <ko>{@link https://naver.github.io/egjs-axes/Options#paninput-options 가능한 값들 (PanInputOption#inputType)}</ko>
7572
+ * @see {@link https://naver.github.io/egjs-flicking/Options#inputtype inputType ( Options )}
7549
7573
  */
7550
7574
  get: function () {
7551
7575
  return this._inputType;
@@ -7570,6 +7594,7 @@ function (_super) {
7570
7594
  * 상수 {@link MOVE_TYPE}에 정의된 값들을 이용할 수 있습니다
7571
7595
  * @type {MOVE_TYPE | Pair<string, object>}
7572
7596
  * @default "snap"
7597
+ * @see {@link https://naver.github.io/egjs-flicking/Options#movetype moveType ( Options )}
7573
7598
  * @example
7574
7599
  * |moveType|control|options|
7575
7600
  * |:---:|:---:|:---:|
@@ -7620,6 +7645,7 @@ function (_super) {
7620
7645
  * @ko 패널 변경을 위한 이동 임계값 (단위: px). 주어진 값 이상으로 스크롤해야만 패널 변경이 가능하다.
7621
7646
  * @type {number}
7622
7647
  * @default 40
7648
+ * @see {@link https://naver.github.io/egjs-flicking/Options#threshold Threshold ( Options )}
7623
7649
  */
7624
7650
  get: function () {
7625
7651
  return this._threshold;
@@ -7636,6 +7662,7 @@ function (_super) {
7636
7662
  * @ko 사용자의 클릭/터치로 인해 애니메이션을 도중에 멈출 수 있도록 설정합니다.
7637
7663
  * @type {boolean}
7638
7664
  * @default true
7665
+ * @see {@link https://naver.github.io/egjs-flicking/Options#interruptable Interruptable ( Options )}
7639
7666
  */
7640
7667
  get: function () {
7641
7668
  return this._interruptable;
@@ -7663,6 +7690,7 @@ function (_super) {
7663
7690
  * 이 값을 변경시 {@link Control#updateInput}를 호출해야 합니다.
7664
7691
  * @type {string | number | Array<string | number>}
7665
7692
  * @default "20%"
7693
+ * @see {@link https://naver.github.io/egjs-flicking/Options#bounce bounce ( Options )}
7666
7694
  * @example
7667
7695
  * ```ts
7668
7696
  * const possibleOptions = [
@@ -7700,6 +7728,7 @@ function (_super) {
7700
7728
  * @ko iOS Safari에서 swipe를 통한 뒤로가기/앞으로가기를 활성화하는 오른쪽 끝으로부터의 영역의 크기 (px)
7701
7729
  * @type {number}
7702
7730
  * @default 30
7731
+ * @see {@link https://naver.github.io/egjs-flicking/Options#iosedgeswipethreshold iOSEdgeSwipeThreshold ( Options )}
7703
7732
  */
7704
7733
  get: function () {
7705
7734
  return this._iOSEdgeSwipeThreshold;
@@ -7721,6 +7750,7 @@ function (_super) {
7721
7750
  * @ko 사용자가 뷰포트 영역을 1픽셀이라도 드래그했을 경우 자동으로 {@link https://developer.mozilla.org/ko/docs/Web/API/Element/click_event click} 이벤트를 취소합니다
7722
7751
  * @type {boolean}
7723
7752
  * @default true
7753
+ * @see {@link https://naver.github.io/egjs-flicking/Options#preventclickondrag preventClickOnDrag ( Options )}
7724
7754
  */
7725
7755
  get: function () {
7726
7756
  return this._preventClickOnDrag;
@@ -7747,6 +7777,7 @@ function (_super) {
7747
7777
  * @ko Flicking init시에 {@link Flicking#disableInput disableInput()}을 바로 호출합니다
7748
7778
  * @type {boolean}
7749
7779
  * @default false
7780
+ * @see {@link https://naver.github.io/egjs-flicking/Options#disableoninit disableOnInit ( Options )}
7750
7781
  */
7751
7782
  get: function () {
7752
7783
  return this._disableOnInit;
@@ -7765,6 +7796,7 @@ function (_super) {
7765
7796
  * `willChange`/`willRestore` 이벤트의 `index`값이 새로운 인덱스로 사용될 것입니다.
7766
7797
  * @type {boolean}
7767
7798
  * @default false
7799
+ * @see {@link https://naver.github.io/egjs-flicking/Options#changeonhold changeOnHold ( Options )}
7768
7800
  */
7769
7801
  get: function () {
7770
7802
  return this._changeOnHold;
@@ -7783,6 +7815,7 @@ function (_super) {
7783
7815
  * @ko 보이는 패널만 렌더링할지 여부를 설정합니다. 패널이 많을 경우에 퍼포먼스를 크게 향상시킬 수 있습니다
7784
7816
  * @type {boolean}
7785
7817
  * @default false
7818
+ * @see {@link https://naver.github.io/egjs-flicking/Options#renderonlyvisible renderOnlyVisible ( Options )}
7786
7819
  */
7787
7820
  get: function () {
7788
7821
  return this._renderOnlyVisible;
@@ -7808,6 +7841,7 @@ function (_super) {
7808
7841
  * @property {number} initialPanelCount Initial panel count to render<ko>최초로 렌더링할 패널의 개수</ko>
7809
7842
  * @property {boolean} [cache=false] Whether to cache rendered panel's innerHTML<ko>렌더링된 패널의 innerHTML 정보를 캐시할지 여부</ko>
7810
7843
  * @property {string} [panelClass="flicking-panel"] The class name that will be applied to rendered panel elements<ko>렌더링되는 패널 엘리먼트에 적용될 클래스 이름</ko>
7844
+ * @see {@link https://naver.github.io/egjs-flicking/Options#virtual virtual ( Options )}
7811
7845
  * @example
7812
7846
  * ```ts
7813
7847
  * import Flicking, { VirtualPanel } from "@egjs/flicking";
@@ -7841,6 +7875,7 @@ function (_super) {
7841
7875
  * @ko Flicking 인스턴스를 생성할 때 자동으로 {@link Flicking#init init()}를 호출합니다
7842
7876
  * @type {boolean}
7843
7877
  * @default true
7878
+ * @see {@link https://naver.github.io/egjs-flicking/Options#autoinit autoInit ( Options )}
7844
7879
  * @readonly
7845
7880
  */
7846
7881
  get: function () {
@@ -7878,6 +7913,7 @@ function (_super) {
7878
7913
  * @ko autoResize 옵션 사용시 {@link https://developer.mozilla.org/en-US/docs/Web/API/ResizeObserver ResizeObserver}의 이벤트를 Window객체의 {@link https://developer.mozilla.org/ko/docs/Web/API/Window/resize_event resize} 이벤트 대신 수신할지 여부를 설정합니다
7879
7914
  * @type {boolean}
7880
7915
  * @default true
7916
+ * @see {@link https://naver.github.io/egjs-flicking/Options#useresizeobserver useResizeObserver ( Options )}
7881
7917
  */
7882
7918
  get: function () {
7883
7919
  return this._useResizeObserver;
@@ -7902,6 +7938,7 @@ function (_super) {
7902
7938
  * 이를 통해 `resize`가 너무 많이 호출되는 것을 방지하여 성능을 향상시킬 수 있습니다.
7903
7939
  * @type {number}
7904
7940
  * @default 0
7941
+ * @see {@link https://naver.github.io/egjs-flicking/Options#resizedebounce resizeDebounce ( Options )}
7905
7942
  */
7906
7943
  get: function () {
7907
7944
  return this._resizeDebounce;
@@ -7917,6 +7954,7 @@ function (_super) {
7917
7954
  * 이를 통해, 적어도 (n)ms에 한번은 크기 재계산을 수행하는 것을 보장할 수 있습니다.
7918
7955
  * @type {number}
7919
7956
  * @default 100
7957
+ * @see {@link https://naver.github.io/egjs-flicking/Options#maxresizedebounce maxResizeDebounce ( Options )}
7920
7958
  */
7921
7959
  get: function () {
7922
7960
  return this._maxResizeDebounce;
@@ -7934,6 +7972,7 @@ function (_super) {
7934
7972
  * 모든 크기는 CSS {@link https://developer.mozilla.org/en-US/docs/Web/CSS/transform transform}이 엘리먼트에 적용되기 이전의 크기를 사용할 것입니다.
7935
7973
  * @type {boolean}
7936
7974
  * @default false
7975
+ * @see {@link https://naver.github.io/egjs-flicking/Options#usefractionalsize useFractionalSize ( Options )}
7937
7976
  */
7938
7977
  get: function () {
7939
7978
  return this._useFractionalSize;
@@ -8800,7 +8839,7 @@ function (_super) {
8800
8839
  */
8801
8840
 
8802
8841
 
8803
- Flicking.VERSION = "4.10.4";
8842
+ Flicking.VERSION = "4.10.5";
8804
8843
  return Flicking;
8805
8844
  }(Component);
8806
8845