@egjs/flicking 3.8.4 → 3.9.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 +2 -1
- package/declaration/components/AutoResizer.d.ts +12 -0
- package/declaration/types.d.ts +1 -0
- package/dist/flicking.esm.js +87 -18
- package/dist/flicking.esm.js.map +1 -1
- package/dist/flicking.js +87 -18
- 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 +87 -18
- 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/doc/eg.Flicking.html +102 -39
- package/doc/global.html +1 -1
- package/doc/index.html +1 -1
- package/doc/node_modules_@egjs_component_src_Component.ts.html +1 -1
- package/doc/src_Flicking.ts.html +9 -16
- package/doc/src_types.ts.html +2 -1
- package/docs/build/release/3.9.0/dist/flicking.esm.js +5124 -0
- package/docs/build/release/3.9.0/dist/flicking.esm.js.map +1 -0
- package/docs/build/release/3.9.0/dist/flicking.js +5131 -0
- package/docs/build/release/3.9.0/dist/flicking.js.map +1 -0
- package/docs/build/release/3.9.0/dist/flicking.min.js +10 -0
- package/docs/build/release/3.9.0/dist/flicking.min.js.map +1 -0
- package/docs/build/release/3.9.0/dist/flicking.pkgd.js +11460 -0
- package/docs/build/release/3.9.0/dist/flicking.pkgd.js.map +1 -0
- package/docs/build/release/3.9.0/dist/flicking.pkgd.min.js +10 -0
- package/docs/build/release/3.9.0/dist/flicking.pkgd.min.js.map +1 -0
- package/package.json +5 -2
- package/rollup.config.development.js +26 -0
- package/src/Flicking.ts +8 -15
- package/src/components/AutoResizer.ts +80 -0
- package/src/components/Viewport.ts +7 -2
- package/src/consts.ts +1 -0
- package/src/types.ts +1 -0
- package/tsconfig.test.json +1 -0
package/dist/flicking.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: 3.
|
|
7
|
+
version: 3.9.0
|
|
8
8
|
*/
|
|
9
9
|
(function (global, factory) {
|
|
10
10
|
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('@egjs/component'), require('@egjs/imready'), require('@egjs/axes')) :
|
|
@@ -115,7 +115,8 @@ version: 3.8.4
|
|
|
115
115
|
renderExternal: false,
|
|
116
116
|
resizeOnContentsReady: false,
|
|
117
117
|
iOSEdgeSwipeThreshold: 30,
|
|
118
|
-
collectStatistics: true
|
|
118
|
+
collectStatistics: true,
|
|
119
|
+
useResizeObserver: true
|
|
119
120
|
};
|
|
120
121
|
var DEFAULT_VIEWPORT_CSS = {
|
|
121
122
|
position: "relative",
|
|
@@ -2514,7 +2515,12 @@ version: 3.8.4
|
|
|
2514
2515
|
__proto.disable = function () {
|
|
2515
2516
|
if (this.panInput) {
|
|
2516
2517
|
this.panInput.destroy();
|
|
2517
|
-
this.panInput = null;
|
|
2518
|
+
this.panInput = null; // Refresh Axes instance
|
|
2519
|
+
|
|
2520
|
+
this.axes.destroy();
|
|
2521
|
+
this.setAxesInstance();
|
|
2522
|
+
this.updateScrollArea();
|
|
2523
|
+
this.updateAxesPosition(this.state.position);
|
|
2518
2524
|
this.stateMachine.transitTo(STATE_TYPE.IDLE);
|
|
2519
2525
|
}
|
|
2520
2526
|
};
|
|
@@ -3213,6 +3219,7 @@ version: 3.8.4
|
|
|
3213
3219
|
this.applyCSSValue();
|
|
3214
3220
|
this.setMoveType();
|
|
3215
3221
|
this.setAxesInstance();
|
|
3222
|
+
this.createPanInput();
|
|
3216
3223
|
this.refreshPanels();
|
|
3217
3224
|
this.setDefaultPanel();
|
|
3218
3225
|
this.resize();
|
|
@@ -3324,7 +3331,6 @@ version: 3.8.4
|
|
|
3324
3331
|
deceleration: options.deceleration,
|
|
3325
3332
|
interruptable: true
|
|
3326
3333
|
});
|
|
3327
|
-
this.createPanInput();
|
|
3328
3334
|
};
|
|
3329
3335
|
|
|
3330
3336
|
__proto.refreshPanels = function () {
|
|
@@ -4041,6 +4047,77 @@ version: 3.8.4
|
|
|
4041
4047
|
return Viewport;
|
|
4042
4048
|
}();
|
|
4043
4049
|
|
|
4050
|
+
var AutoResizer =
|
|
4051
|
+
/*#__PURE__*/
|
|
4052
|
+
function () {
|
|
4053
|
+
function AutoResizer(flicking) {
|
|
4054
|
+
var _this = this;
|
|
4055
|
+
|
|
4056
|
+
this.skipFirstResize = function () {
|
|
4057
|
+
var isFirstResize = true;
|
|
4058
|
+
return function () {
|
|
4059
|
+
if (isFirstResize) {
|
|
4060
|
+
isFirstResize = false;
|
|
4061
|
+
return;
|
|
4062
|
+
}
|
|
4063
|
+
|
|
4064
|
+
_this.onResize();
|
|
4065
|
+
};
|
|
4066
|
+
}();
|
|
4067
|
+
|
|
4068
|
+
this.onResize = function () {
|
|
4069
|
+
_this.flicking.resize();
|
|
4070
|
+
};
|
|
4071
|
+
|
|
4072
|
+
this.flicking = flicking;
|
|
4073
|
+
this.enabled = false;
|
|
4074
|
+
this.resizeObserver = null;
|
|
4075
|
+
}
|
|
4076
|
+
|
|
4077
|
+
var __proto = AutoResizer.prototype;
|
|
4078
|
+
|
|
4079
|
+
__proto.enable = function () {
|
|
4080
|
+
var flicking = this.flicking;
|
|
4081
|
+
|
|
4082
|
+
if (this.enabled) {
|
|
4083
|
+
this.disable();
|
|
4084
|
+
}
|
|
4085
|
+
|
|
4086
|
+
if (flicking.options.useResizeObserver && !!window.ResizeObserver) {
|
|
4087
|
+
var flickingEl = flicking.getElement();
|
|
4088
|
+
var viewportSizeNot0 = flickingEl.clientWidth !== 0 || flickingEl.clientHeight !== 0;
|
|
4089
|
+
var resizeObserver = viewportSizeNot0 ? new ResizeObserver(this.skipFirstResize) : new ResizeObserver(this.onResize);
|
|
4090
|
+
resizeObserver.observe(flickingEl);
|
|
4091
|
+
this.resizeObserver = resizeObserver;
|
|
4092
|
+
} else {
|
|
4093
|
+
window.addEventListener("resize", this.onResize);
|
|
4094
|
+
}
|
|
4095
|
+
|
|
4096
|
+
this.enabled = true;
|
|
4097
|
+
return this;
|
|
4098
|
+
};
|
|
4099
|
+
|
|
4100
|
+
__proto.disable = function () {
|
|
4101
|
+
if (!this.enabled) {
|
|
4102
|
+
return this;
|
|
4103
|
+
}
|
|
4104
|
+
|
|
4105
|
+
var resizeObserver = this.resizeObserver;
|
|
4106
|
+
|
|
4107
|
+
if (resizeObserver) {
|
|
4108
|
+
resizeObserver.disconnect();
|
|
4109
|
+
this.resizeObserver = null;
|
|
4110
|
+
} else {
|
|
4111
|
+
window.removeEventListener("resize", this.onResize);
|
|
4112
|
+
}
|
|
4113
|
+
|
|
4114
|
+
this.enabled = false;
|
|
4115
|
+
return this;
|
|
4116
|
+
};
|
|
4117
|
+
|
|
4118
|
+
return AutoResizer;
|
|
4119
|
+
}();
|
|
4120
|
+
|
|
4044
4121
|
/**
|
|
4045
4122
|
* Copyright (c) 2015 NAVER Corp.
|
|
4046
4123
|
* egjs projects are licensed under the MIT license
|
|
@@ -4090,6 +4167,7 @@ version: 3.8.4
|
|
|
4090
4167
|
* @param {boolean} [options.isConstantSize=false] Whether all panels have a constant size that won't be changed after resize. Enabling this option can increase performance while recalculating panel size.<ko>모든 패널의 크기가 불변인지의 여부. 이 옵션을 'true'로 설정하면 패널 크기 재설정시에 성능을 높일 수 있다.</ko>
|
|
4091
4168
|
* @param {boolean} [options.renderExternal=false] Whether to use external rendering. It will delegate DOM manipulation and can synchronize the rendered state by calling `sync()` method. You can use this option to use in frameworks like React, Vue, Angular, which has its states and rendering methods.<ko>외부 렌더링을 사용할 지의 여부. 이 옵션을 사용시 렌더링을 외부에 위임할 수 있고, `sync()`를 호출하여 그 상태를 동기화할 수 있다. 이 옵션을 사용하여, React, Vue, Angular 등 자체적인 상태와 렌더링 방법을 갖는 프레임워크에 대응할 수 있다.</ko>
|
|
4092
4169
|
* @param {boolean} [options.resizeOnContentsReady=false] Whether to resize the Flicking after the image/video elements inside viewport are ready.<br/>Use this property to prevent wrong Flicking layout caused by dynamic image / video sizes.<ko>Flicking 내부의 이미지 / 비디오 엘리먼트들이 전부 로드되었을 때 Flicking의 크기를 재계산하기 위한 옵션.<br/>이미지 / 비디오 크기가 고정 크기가 아닐 경우 사용하여 레이아웃이 잘못되는 것을 방지할 수 있다.</ko>
|
|
4170
|
+
* @param {boolean} [options.useResizeObserver=true] Whether to listen {@link https://developer.mozilla.org/en-US/docs/Web/API/ResizeObserver ResizeObserver}'s event instead of Window's {@link https://developer.mozilla.org/ko/docs/Web/API/Window/resize_event resize} event when using the `autoResize` option<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} 이벤트 대신 수신할지 여부를 설정합니다</ko>
|
|
4093
4171
|
* @param {boolean} [options.collectStatistics=true] Whether to collect statistics on how you are using `Flicking`. These statistical data do not contain any personal information and are used only as a basis for the development of a user-friendly product.<ko>어떻게 `Flicking`을 사용하고 있는지에 대한 통계 수집 여부를 나타낸다. 이 통계자료는 개인정보를 포함하고 있지 않으며 오직 사용자 친화적인 제품으로 발전시키기 위한 근거자료로서 활용한다.</ko>
|
|
4094
4172
|
*/
|
|
4095
4173
|
|
|
@@ -4257,18 +4335,13 @@ version: 3.8.4
|
|
|
4257
4335
|
|
|
4258
4336
|
|
|
4259
4337
|
_this.viewport = new Viewport(_this, _this.options, _this.triggerEvent);
|
|
4338
|
+
_this.autoResizer = new AutoResizer(_this);
|
|
4260
4339
|
|
|
4261
4340
|
_this.listenInput();
|
|
4262
4341
|
|
|
4263
4342
|
_this.listenResize();
|
|
4264
4343
|
|
|
4265
|
-
return _this;
|
|
4266
|
-
// sendEvent(
|
|
4267
|
-
// "usage",
|
|
4268
|
-
// "options",
|
|
4269
|
-
// options,
|
|
4270
|
-
// );
|
|
4271
|
-
// }
|
|
4344
|
+
return _this;
|
|
4272
4345
|
}
|
|
4273
4346
|
/**
|
|
4274
4347
|
* Move to the previous panel if it exists.
|
|
@@ -4602,11 +4675,7 @@ version: 3.8.4
|
|
|
4602
4675
|
}
|
|
4603
4676
|
|
|
4604
4677
|
this.off();
|
|
4605
|
-
|
|
4606
|
-
if (this.options.autoResize) {
|
|
4607
|
-
window.removeEventListener("resize", this.resize);
|
|
4608
|
-
}
|
|
4609
|
-
|
|
4678
|
+
this.autoResizer.disable();
|
|
4610
4679
|
this.viewport.destroy(option);
|
|
4611
4680
|
(_a = this.contentsReadyChecker) === null || _a === void 0 ? void 0 : _a.destroy(); // release resources
|
|
4612
4681
|
|
|
@@ -4978,7 +5047,7 @@ version: 3.8.4
|
|
|
4978
5047
|
var options = this.options;
|
|
4979
5048
|
|
|
4980
5049
|
if (options.autoResize) {
|
|
4981
|
-
|
|
5050
|
+
this.autoResizer.enable();
|
|
4982
5051
|
}
|
|
4983
5052
|
|
|
4984
5053
|
if (options.resizeOnContentsReady) {
|
|
@@ -5018,7 +5087,7 @@ version: 3.8.4
|
|
|
5018
5087
|
*/
|
|
5019
5088
|
|
|
5020
5089
|
|
|
5021
|
-
Flicking.VERSION = "3.
|
|
5090
|
+
Flicking.VERSION = "3.9.0";
|
|
5022
5091
|
/**
|
|
5023
5092
|
* Direction constant - "PREV" or "NEXT"
|
|
5024
5093
|
* @ko 방향 상수 - "PREV" 또는 "NEXT"
|