@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.
@@ -27,6 +27,7 @@ declare class AxesController {
27
27
  destroy(): void;
28
28
  enable(): this;
29
29
  disable(): this;
30
+ release(): this;
30
31
  update(controlParams: ControlParams): this;
31
32
  addPreventClickHandler(): this;
32
33
  removePreventClickHandler(): this;
@@ -19,6 +19,7 @@ declare abstract class Control {
19
19
  destroy(): void;
20
20
  enable(): this;
21
21
  disable(): this;
22
+ release(): this;
22
23
  updatePosition(progressInPanel: number): void;
23
24
  updateInput(): this;
24
25
  resetActive(): this;
@@ -60,7 +60,7 @@ declare class Panel {
60
60
  markForHide(): void;
61
61
  resize(cached?: {
62
62
  size: number;
63
- height: number;
63
+ height?: number;
64
64
  margin: {
65
65
  prev: number;
66
66
  next: number;
@@ -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
  import Component, { ComponentEvent } from '@egjs/component';
10
10
  import Axes, { PanInput } from '@egjs/axes';
@@ -2450,6 +2450,20 @@ function () {
2450
2450
  (_a = this._panInput) === null || _a === void 0 ? void 0 : _a.disable();
2451
2451
  return this;
2452
2452
  };
2453
+ /**
2454
+ * Releases ongoing user input (mouse/touch)
2455
+ * @ko 사용자의 현재 입력(마우스/터치)를 중단시킵니다
2456
+ * @chainable
2457
+ * @return {this}
2458
+ */
2459
+
2460
+
2461
+ __proto.release = function () {
2462
+ var _a;
2463
+
2464
+ (_a = this._panInput) === null || _a === void 0 ? void 0 : _a.release();
2465
+ return this;
2466
+ };
2453
2467
  /**
2454
2468
  * Update {@link https://naver.github.io/egjs-axes/ @egjs/axes}'s state
2455
2469
  * @ko {@link https://naver.github.io/egjs-axes/ @egjs/axes}의 상태를 갱신합니다
@@ -2761,6 +2775,19 @@ function () {
2761
2775
 
2762
2776
  return this;
2763
2777
  };
2778
+ /**
2779
+ * Releases ongoing user input (mouse/touch)
2780
+ * @ko 사용자의 현재 입력(마우스/터치)를 중단시킵니다
2781
+ * @chainable
2782
+ * @return {this}
2783
+ */
2784
+
2785
+
2786
+ __proto.release = function () {
2787
+ this._controller.release();
2788
+
2789
+ return this;
2790
+ };
2764
2791
  /**
2765
2792
  * Update position after resizing
2766
2793
  * @ko resize 이후에 position을 업데이트합니다
@@ -5482,11 +5509,13 @@ function () {
5482
5509
  } : {
5483
5510
  height: panelSize
5484
5511
  };
5485
- var firstPanelSizeObj = {
5512
+
5513
+ var firstPanelSizeObj = __assign({
5486
5514
  size: panelSize,
5487
- height: referencePanel.height,
5488
5515
  margin: referencePanel.margin
5489
- };
5516
+ }, !flicking.horizontal && {
5517
+ height: referencePanel.height
5518
+ });
5490
5519
 
5491
5520
  if (!flicking.noPanelStyleOverride) {
5492
5521
  this._strategy.updatePanelSizes(flicking, panelSizeObj);
@@ -6020,6 +6049,8 @@ function () {
6020
6049
 
6021
6050
 
6022
6051
  __proto.resize = function (cached) {
6052
+ var _a;
6053
+
6023
6054
  var el = this.element;
6024
6055
  var flicking = this._flicking;
6025
6056
  var horizontal = flicking.horizontal,
@@ -6028,7 +6059,13 @@ function () {
6028
6059
  if (cached) {
6029
6060
  this._size = cached.size;
6030
6061
  this._margin = __assign({}, cached.margin);
6031
- this._height = cached.height;
6062
+ this._height = (_a = cached.height) !== null && _a !== void 0 ? _a : getElementSize({
6063
+ el: el,
6064
+ horizontal: false,
6065
+ useFractionalSize: useFractionalSize,
6066
+ useOffset: true,
6067
+ style: getStyle(el)
6068
+ });
6032
6069
  } else {
6033
6070
  var elStyle = getStyle(el);
6034
6071
  this._size = getElementSize({
@@ -7990,6 +8027,10 @@ function (_super) {
7990
8027
  return Promise.reject(new FlickingError(MESSAGE.ANIMATION_ALREADY_PLAYING, CODE.ANIMATION_ALREADY_PLAYING));
7991
8028
  }
7992
8029
 
8030
+ if (this._control.holding) {
8031
+ this._control.controller.release();
8032
+ }
8033
+
7993
8034
  return this._control.moveToPanel(panel, {
7994
8035
  duration: duration,
7995
8036
  direction: direction
@@ -8474,9 +8515,10 @@ function (_super) {
8474
8515
  var renderer = this._renderer;
8475
8516
  var control = this._control;
8476
8517
  var camera = this._camera;
8477
- var initialPanel = renderer.getPanel(this._defaultIndex) || renderer.getPanel(0);
8478
- if (!initialPanel) return;
8479
- var nearestAnchor = camera.findNearestAnchor(initialPanel.position);
8518
+ var defaultPanel = renderer.getPanel(this._defaultIndex) || renderer.getPanel(0);
8519
+ if (!defaultPanel) return;
8520
+ var nearestAnchor = camera.findNearestAnchor(defaultPanel.position);
8521
+ var initialPanel = nearestAnchor && defaultPanel.index !== nearestAnchor.panel.index ? nearestAnchor.panel : defaultPanel;
8480
8522
  control.setActive(initialPanel, null, false);
8481
8523
 
8482
8524
  if (!nearestAnchor) {
@@ -8537,7 +8579,7 @@ function (_super) {
8537
8579
  */
8538
8580
 
8539
8581
 
8540
- Flicking.VERSION = "4.9.0";
8582
+ Flicking.VERSION = "4.9.3-beta.0";
8541
8583
  return Flicking;
8542
8584
  }(Component);
8543
8585