@egjs/flicking 4.12.1-beta.5 → 4.13.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/core-packages-link.js +8 -7
- package/declaration/Flicking.d.ts +10 -2
- package/declaration/core/AutoResizer.d.ts +5 -0
- package/dist/flicking.cjs.js +160 -43
- package/dist/flicking.cjs.js.map +1 -1
- package/dist/flicking.esm.js +160 -43
- package/dist/flicking.esm.js.map +1 -1
- package/dist/flicking.js +160 -43
- 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 +160 -43
- 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 +1 -1
- package/src/Flicking.ts +191 -83
- package/src/core/AutoResizer.ts +75 -22
- package/src/renderer/Renderer.ts +13 -0
- package/src/utils.ts +6 -1
- package/panel-demo.html +0 -323
- package/panel-visual.md +0 -328
- package/scratch/dist/flicking.css +0 -11
- package/scratch/dist/flicking.js +0 -9059
- package/scratch/dist/flicking.js.map +0 -1
package/core-packages-link.js
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
프레임워크 컴포넌트를 디버깅할 때 코어 바닐라 로직을 수정하면서 확인할 필요가 있을 때,
|
|
4
|
-
이 스크립트를 이용하면 바닐라 로직 수정사항이 프레임워크 컴포넌트 로컬 데모환경에도 반영된다.
|
|
1
|
+
/* eslint-disable */
|
|
5
2
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
3
|
+
/**
|
|
4
|
+
* 프레임워크 컴포넌트를 디버깅할 때 코어 바닐라 로직을 수정하면서 확인할 필요가 있을 때,
|
|
5
|
+
* 이 스크립트를 이용하면 바닐라 로직 수정사항이 프레임워크 컴포넌트 로컬 데모환경에도 반영된다.
|
|
6
|
+
*
|
|
7
|
+
* 인자로 프레임워크 컴포넌트 패키지의 루트 디렉토리를 제공하면 된다.
|
|
8
|
+
*
|
|
9
|
+
* 사용 예시: node core-package-link.js react-flicking
|
|
9
10
|
*/
|
|
10
11
|
|
|
11
12
|
const { execSync } = require("child_process");
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import Component from "@egjs/component";
|
|
2
2
|
import Viewport from "./core/Viewport";
|
|
3
|
+
import AutoResizer from "./core/AutoResizer";
|
|
3
4
|
import { Panel } from "./core/panel";
|
|
4
5
|
import VirtualManager, { VirtualOptions } from "./core/VirtualManager";
|
|
5
6
|
import { Control } from "./control";
|
|
@@ -65,6 +66,7 @@ export interface FlickingOptions {
|
|
|
65
66
|
autoResize: boolean;
|
|
66
67
|
useResizeObserver: boolean;
|
|
67
68
|
resizeDebounce: number;
|
|
69
|
+
observePanelResize: boolean;
|
|
68
70
|
maxResizeDebounce: number;
|
|
69
71
|
useFractionalSize: boolean;
|
|
70
72
|
externalRenderer: ExternalRenderer | null;
|
|
@@ -115,6 +117,7 @@ declare class Flicking extends Component<FlickingEvents> {
|
|
|
115
117
|
private _autoResize;
|
|
116
118
|
private _useResizeObserver;
|
|
117
119
|
private _resizeDebounce;
|
|
120
|
+
private _observePanelResize;
|
|
118
121
|
private _maxResizeDebounce;
|
|
119
122
|
private _useFractionalSize;
|
|
120
123
|
private _externalRenderer;
|
|
@@ -127,6 +130,7 @@ declare class Flicking extends Component<FlickingEvents> {
|
|
|
127
130
|
get camera(): Camera;
|
|
128
131
|
get renderer(): Renderer;
|
|
129
132
|
get viewport(): Viewport;
|
|
133
|
+
get autoResizer(): AutoResizer;
|
|
130
134
|
get initialized(): boolean;
|
|
131
135
|
get circularEnabled(): boolean;
|
|
132
136
|
get virtualEnabled(): boolean;
|
|
@@ -174,6 +178,7 @@ declare class Flicking extends Component<FlickingEvents> {
|
|
|
174
178
|
get autoInit(): boolean;
|
|
175
179
|
get autoResize(): FlickingOptions["autoResize"];
|
|
176
180
|
get useResizeObserver(): FlickingOptions["useResizeObserver"];
|
|
181
|
+
get observePanelResize(): FlickingOptions["observePanelResize"];
|
|
177
182
|
get resizeDebounce(): number;
|
|
178
183
|
get maxResizeDebounce(): number;
|
|
179
184
|
get useFractionalSize(): boolean;
|
|
@@ -182,6 +187,7 @@ declare class Flicking extends Component<FlickingEvents> {
|
|
|
182
187
|
renderer: new (options: RendererOptions) => ExternalRenderer;
|
|
183
188
|
rendererOptions: RendererOptions;
|
|
184
189
|
};
|
|
190
|
+
get optimizeSizeUpdate(): FlickingOptions["optimizeSizeUpdate"];
|
|
185
191
|
set align(val: FlickingOptions["align"]);
|
|
186
192
|
set defaultIndex(val: FlickingOptions["defaultIndex"]);
|
|
187
193
|
set horizontal(val: FlickingOptions["horizontal"]);
|
|
@@ -211,7 +217,9 @@ declare class Flicking extends Component<FlickingEvents> {
|
|
|
211
217
|
set renderOnlyVisible(val: FlickingOptions["renderOnlyVisible"]);
|
|
212
218
|
set autoResize(val: FlickingOptions["autoResize"]);
|
|
213
219
|
set useResizeObserver(val: FlickingOptions["useResizeObserver"]);
|
|
214
|
-
|
|
220
|
+
set observePanelResize(val: FlickingOptions["observePanelResize"]);
|
|
221
|
+
set optimizeSizeUpdate(val: FlickingOptions["optimizeSizeUpdate"]);
|
|
222
|
+
constructor(root: HTMLElement | string, { align, defaultIndex, horizontal, circular, circularFallback, bound, adaptive, panelsPerView, noPanelStyleOverride, resizeOnContentsReady, nested, needPanelThreshold, preventEventsBeforeInit, deceleration, duration, easing, inputType, moveType, threshold, dragThreshold, interruptable, bounce, iOSEdgeSwipeThreshold, preventClickOnDrag, preventDefaultOnDrag, disableOnInit, changeOnHold, renderOnlyVisible, virtual, autoInit, autoResize, useResizeObserver, resizeDebounce, observePanelResize, maxResizeDebounce, useFractionalSize, externalRenderer, renderExternal, optimizeSizeUpdate }?: Partial<FlickingOptions>);
|
|
215
223
|
init(): Promise<void>;
|
|
216
224
|
destroy(): void;
|
|
217
225
|
prev(duration?: number): Promise<void>;
|
|
@@ -222,7 +230,7 @@ declare class Flicking extends Component<FlickingEvents> {
|
|
|
222
230
|
getPanel(index: number): Panel | null;
|
|
223
231
|
enableInput(): this;
|
|
224
232
|
disableInput(): this;
|
|
225
|
-
getStatus({ index, position, includePanelHTML, visiblePanelsOnly
|
|
233
|
+
getStatus({ index, position, includePanelHTML, visiblePanelsOnly }?: Partial<{
|
|
226
234
|
index: boolean;
|
|
227
235
|
position: boolean;
|
|
228
236
|
includePanelHTML: boolean;
|
|
@@ -8,7 +8,12 @@ declare class AutoResizer {
|
|
|
8
8
|
get enabled(): boolean;
|
|
9
9
|
constructor(flicking: Flicking);
|
|
10
10
|
enable(): this;
|
|
11
|
+
observePanels(): this;
|
|
12
|
+
unobservePanels(): this;
|
|
13
|
+
observe(element: HTMLElement): this;
|
|
14
|
+
unobserve(element: HTMLElement): this;
|
|
11
15
|
disable(): this;
|
|
16
|
+
private _onResizeWrapper;
|
|
12
17
|
private _onResize;
|
|
13
18
|
private _doScheduledResize;
|
|
14
19
|
private _skipFirstResize;
|
package/dist/flicking.cjs.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.
|
|
7
|
+
version: 4.13.0
|
|
8
8
|
*/
|
|
9
9
|
'use strict';
|
|
10
10
|
|
|
@@ -674,6 +674,9 @@ var getProgress = function (pos, prev, next) {
|
|
|
674
674
|
};
|
|
675
675
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
|
676
676
|
var getStyle = function (el) {
|
|
677
|
+
if (!el) {
|
|
678
|
+
return {};
|
|
679
|
+
}
|
|
677
680
|
return window.getComputedStyle(el) || el.currentStyle;
|
|
678
681
|
};
|
|
679
682
|
var setSize = function (el, _a) {
|
|
@@ -950,41 +953,53 @@ var Viewport = /*#__PURE__*/function () {
|
|
|
950
953
|
* Copyright (c) 2015 NAVER Corp.
|
|
951
954
|
* egjs projects are licensed under the MIT license
|
|
952
955
|
*/
|
|
956
|
+
/**
|
|
957
|
+
* A component that detects size change and trigger resize method when the autoResize option is used
|
|
958
|
+
* @ko autoResize 옵션을 사용할 때 크기 변화를 감지하고 Flicking의 resize를 호출하는 컴포넌트
|
|
959
|
+
*/
|
|
953
960
|
var AutoResizer = /*#__PURE__*/function () {
|
|
961
|
+
/** */
|
|
954
962
|
function AutoResizer(flicking) {
|
|
955
963
|
var _this = this;
|
|
964
|
+
this._onResizeWrapper = function () {
|
|
965
|
+
_this._onResize([]);
|
|
966
|
+
};
|
|
956
967
|
this._onResize = function (entries) {
|
|
957
968
|
var flicking = _this._flicking;
|
|
958
969
|
var resizeDebounce = flicking.resizeDebounce;
|
|
959
970
|
var maxResizeDebounce = flicking.maxResizeDebounce;
|
|
960
|
-
|
|
961
|
-
|
|
971
|
+
var resizedViewportElement = flicking.element;
|
|
972
|
+
// 현재 구현에서 리사이즈 옵저빙 대상은 패널과 뷰포트 2개만 존재.
|
|
973
|
+
// 아래는 뷰포트만 변경되었을 때 동작해야하는 로직이 있으므로 아래와 같이 조건문을 건다.
|
|
974
|
+
// 패널 쪽에서는 리사이즈 감지에 resizeObserver를 사용하지 않는 경우가 없으므로 이 조건은 곧 뷰포트만 리사이즈가 된 경우를 의미한다.
|
|
975
|
+
var isResizedViewportOnly = entries.find(function (e) {
|
|
976
|
+
return e.target === flicking.element;
|
|
977
|
+
}) && entries.length === 1;
|
|
978
|
+
// 참고: resizeObserver를 사용하지 않은 경우에는 entries.length가 0으로 오는데 이 경우에는 그냥 항상 리사이즈가 진행되도록 한다.
|
|
979
|
+
// (vw, vh 등을 사용하는 경우 이상 동작이 발생할 여지가 있기 때문이다)
|
|
980
|
+
if (isResizedViewportOnly) {
|
|
981
|
+
// resize 이벤트가 발생했으나 이전과 width, height의 변화가 없다면 이후 로직을 진행하지 않는다.
|
|
962
982
|
var beforeSize = {
|
|
963
983
|
width: flicking.viewport.width,
|
|
964
984
|
height: flicking.viewport.height
|
|
965
985
|
};
|
|
966
|
-
|
|
967
|
-
width: resizeEntryInfo.width,
|
|
968
|
-
height: resizeEntryInfo.height
|
|
969
|
-
});
|
|
970
|
-
var new_afterSize = {
|
|
986
|
+
var afterSize = {
|
|
971
987
|
width: getElementSize({
|
|
972
|
-
el:
|
|
988
|
+
el: resizedViewportElement,
|
|
973
989
|
horizontal: true,
|
|
974
990
|
useFractionalSize: _this._flicking.useFractionalSize,
|
|
975
991
|
useOffset: false,
|
|
976
|
-
style: getStyle(
|
|
992
|
+
style: getStyle(resizedViewportElement)
|
|
977
993
|
}),
|
|
978
994
|
height: getElementSize({
|
|
979
|
-
el:
|
|
995
|
+
el: resizedViewportElement,
|
|
980
996
|
horizontal: false,
|
|
981
997
|
useFractionalSize: _this._flicking.useFractionalSize,
|
|
982
998
|
useOffset: false,
|
|
983
|
-
style: getStyle(
|
|
999
|
+
style: getStyle(resizedViewportElement)
|
|
984
1000
|
})
|
|
985
1001
|
};
|
|
986
|
-
|
|
987
|
-
if (beforeSize.height === new_afterSize.height && beforeSize.width === new_afterSize.width) {
|
|
1002
|
+
if (beforeSize.height === afterSize.height && beforeSize.width === afterSize.width) {
|
|
988
1003
|
return;
|
|
989
1004
|
}
|
|
990
1005
|
}
|
|
@@ -1036,7 +1051,6 @@ var AutoResizer = /*#__PURE__*/function () {
|
|
|
1036
1051
|
configurable: true
|
|
1037
1052
|
});
|
|
1038
1053
|
__proto.enable = function () {
|
|
1039
|
-
var _this = this;
|
|
1040
1054
|
var flicking = this._flicking;
|
|
1041
1055
|
var viewport = flicking.viewport;
|
|
1042
1056
|
if (this._enabled) {
|
|
@@ -1044,32 +1058,55 @@ var AutoResizer = /*#__PURE__*/function () {
|
|
|
1044
1058
|
}
|
|
1045
1059
|
if (flicking.useResizeObserver && !!window.ResizeObserver) {
|
|
1046
1060
|
var viewportSizeNot0 = viewport.width !== 0 || viewport.height !== 0;
|
|
1047
|
-
var resizeObserver = viewportSizeNot0 ? new ResizeObserver(
|
|
1048
|
-
return _this._skipFirstResize(entries);
|
|
1049
|
-
}) : new ResizeObserver(function (entries) {
|
|
1050
|
-
return _this._onResize(entries);
|
|
1051
|
-
});
|
|
1052
|
-
resizeObserver.observe(flicking.viewport.element);
|
|
1061
|
+
var resizeObserver = viewportSizeNot0 ? new ResizeObserver(this._skipFirstResize) : new ResizeObserver(this._onResize);
|
|
1053
1062
|
this._resizeObserver = resizeObserver;
|
|
1063
|
+
this.observe(flicking.viewport.element);
|
|
1064
|
+
if (flicking.observePanelResize) {
|
|
1065
|
+
this.observePanels();
|
|
1066
|
+
}
|
|
1054
1067
|
} else {
|
|
1055
|
-
window.addEventListener("resize",
|
|
1056
|
-
return _this._onResize([]);
|
|
1057
|
-
});
|
|
1068
|
+
window.addEventListener("resize", this._onResizeWrapper);
|
|
1058
1069
|
}
|
|
1059
1070
|
this._enabled = true;
|
|
1060
1071
|
return this;
|
|
1061
1072
|
};
|
|
1062
|
-
__proto.
|
|
1073
|
+
__proto.observePanels = function () {
|
|
1074
|
+
var _this = this;
|
|
1075
|
+
this._flicking.panels.forEach(function (panel) {
|
|
1076
|
+
_this.observe(panel.element);
|
|
1077
|
+
});
|
|
1078
|
+
return this;
|
|
1079
|
+
};
|
|
1080
|
+
__proto.unobservePanels = function () {
|
|
1063
1081
|
var _this = this;
|
|
1082
|
+
this._flicking.panels.forEach(function (panel) {
|
|
1083
|
+
_this.unobserve(panel.element);
|
|
1084
|
+
});
|
|
1085
|
+
return this;
|
|
1086
|
+
};
|
|
1087
|
+
__proto.observe = function (element) {
|
|
1088
|
+
var resizeObserver = this._resizeObserver;
|
|
1089
|
+
if (!resizeObserver) return this;
|
|
1090
|
+
resizeObserver.observe(element);
|
|
1091
|
+
return this;
|
|
1092
|
+
};
|
|
1093
|
+
__proto.unobserve = function (element) {
|
|
1094
|
+
var resizeObserver = this._resizeObserver;
|
|
1095
|
+
if (!resizeObserver) return this;
|
|
1096
|
+
resizeObserver.unobserve(element);
|
|
1097
|
+
if (this._flicking.observePanelResize) {
|
|
1098
|
+
this.unobservePanels();
|
|
1099
|
+
}
|
|
1100
|
+
return this;
|
|
1101
|
+
};
|
|
1102
|
+
__proto.disable = function () {
|
|
1064
1103
|
if (!this._enabled) return this;
|
|
1065
1104
|
var resizeObserver = this._resizeObserver;
|
|
1066
1105
|
if (resizeObserver) {
|
|
1067
1106
|
resizeObserver.disconnect();
|
|
1068
1107
|
this._resizeObserver = null;
|
|
1069
1108
|
} else {
|
|
1070
|
-
window.removeEventListener("resize",
|
|
1071
|
-
return _this._onResize([]);
|
|
1072
|
-
});
|
|
1109
|
+
window.removeEventListener("resize", this._onResizeWrapper);
|
|
1073
1110
|
}
|
|
1074
1111
|
this._enabled = false;
|
|
1075
1112
|
return this;
|
|
@@ -4867,6 +4904,18 @@ var Renderer = /*#__PURE__*/function () {
|
|
|
4867
4904
|
var activePanel = control.activePanel;
|
|
4868
4905
|
// Update camera & control
|
|
4869
4906
|
this._updateCameraAndControl();
|
|
4907
|
+
if (flicking.autoResize && flicking.useResizeObserver) {
|
|
4908
|
+
panelsAdded.forEach(function (panel) {
|
|
4909
|
+
if (panel.element) {
|
|
4910
|
+
flicking.autoResizer.observe(panel.element);
|
|
4911
|
+
}
|
|
4912
|
+
});
|
|
4913
|
+
panelsRemoved.forEach(function (panel) {
|
|
4914
|
+
if (panel.element) {
|
|
4915
|
+
flicking.autoResizer.unobserve(panel.element);
|
|
4916
|
+
}
|
|
4917
|
+
});
|
|
4918
|
+
}
|
|
4870
4919
|
void this.render();
|
|
4871
4920
|
if (!flicking.animating) {
|
|
4872
4921
|
if (!activePanel || activePanel.removed) {
|
|
@@ -6144,16 +6193,18 @@ var Flicking = /*#__PURE__*/function (_super) {
|
|
|
6144
6193
|
useResizeObserver = _9 === void 0 ? true : _9,
|
|
6145
6194
|
_10 = _b.resizeDebounce,
|
|
6146
6195
|
resizeDebounce = _10 === void 0 ? 0 : _10,
|
|
6147
|
-
_11 = _b.
|
|
6148
|
-
|
|
6149
|
-
_12 = _b.
|
|
6150
|
-
|
|
6151
|
-
_13 = _b.
|
|
6152
|
-
|
|
6153
|
-
_14 = _b.
|
|
6154
|
-
|
|
6155
|
-
_15 = _b.
|
|
6156
|
-
|
|
6196
|
+
_11 = _b.observePanelResize,
|
|
6197
|
+
observePanelResize = _11 === void 0 ? false : _11,
|
|
6198
|
+
_12 = _b.maxResizeDebounce,
|
|
6199
|
+
maxResizeDebounce = _12 === void 0 ? 100 : _12,
|
|
6200
|
+
_13 = _b.useFractionalSize,
|
|
6201
|
+
useFractionalSize = _13 === void 0 ? false : _13,
|
|
6202
|
+
_14 = _b.externalRenderer,
|
|
6203
|
+
externalRenderer = _14 === void 0 ? null : _14,
|
|
6204
|
+
_15 = _b.renderExternal,
|
|
6205
|
+
renderExternal = _15 === void 0 ? null : _15,
|
|
6206
|
+
_16 = _b.optimizeSizeUpdate,
|
|
6207
|
+
optimizeSizeUpdate = _16 === void 0 ? false : _16;
|
|
6157
6208
|
var _this = _super.call(this) || this;
|
|
6158
6209
|
// Internal states
|
|
6159
6210
|
_this._initialized = false;
|
|
@@ -6194,6 +6245,7 @@ var Flicking = /*#__PURE__*/function (_super) {
|
|
|
6194
6245
|
_this._useResizeObserver = useResizeObserver;
|
|
6195
6246
|
_this._resizeDebounce = resizeDebounce;
|
|
6196
6247
|
_this._maxResizeDebounce = maxResizeDebounce;
|
|
6248
|
+
_this._observePanelResize = observePanelResize;
|
|
6197
6249
|
_this._useFractionalSize = useFractionalSize;
|
|
6198
6250
|
_this._externalRenderer = externalRenderer;
|
|
6199
6251
|
_this._renderExternal = renderExternal;
|
|
@@ -6278,6 +6330,19 @@ var Flicking = /*#__PURE__*/function (_super) {
|
|
|
6278
6330
|
enumerable: false,
|
|
6279
6331
|
configurable: true
|
|
6280
6332
|
});
|
|
6333
|
+
Object.defineProperty(__proto, "autoResizer", {
|
|
6334
|
+
/**
|
|
6335
|
+
* {@link AutoResizer} instance of the Flicking
|
|
6336
|
+
* @ko 현재 Flicking에 활성화된 {@link AutoResizer} 인스턴스
|
|
6337
|
+
* @internal
|
|
6338
|
+
* @readonly
|
|
6339
|
+
*/
|
|
6340
|
+
get: function () {
|
|
6341
|
+
return this._autoResizer;
|
|
6342
|
+
},
|
|
6343
|
+
enumerable: false,
|
|
6344
|
+
configurable: true
|
|
6345
|
+
});
|
|
6281
6346
|
Object.defineProperty(__proto, "initialized", {
|
|
6282
6347
|
// Internal States
|
|
6283
6348
|
/**
|
|
@@ -7151,6 +7216,9 @@ var Flicking = /*#__PURE__*/function (_super) {
|
|
|
7151
7216
|
// OTHERS
|
|
7152
7217
|
set: function (val) {
|
|
7153
7218
|
this._autoResize = val;
|
|
7219
|
+
if (!this._initialized) {
|
|
7220
|
+
return;
|
|
7221
|
+
}
|
|
7154
7222
|
if (val) {
|
|
7155
7223
|
this._autoResizer.enable();
|
|
7156
7224
|
} else {
|
|
@@ -7173,13 +7241,38 @@ var Flicking = /*#__PURE__*/function (_super) {
|
|
|
7173
7241
|
},
|
|
7174
7242
|
set: function (val) {
|
|
7175
7243
|
this._useResizeObserver = val;
|
|
7176
|
-
if (this._autoResize) {
|
|
7244
|
+
if (this._initialized && this._autoResize) {
|
|
7177
7245
|
this._autoResizer.enable();
|
|
7178
7246
|
}
|
|
7179
7247
|
},
|
|
7180
7248
|
enumerable: false,
|
|
7181
7249
|
configurable: true
|
|
7182
7250
|
});
|
|
7251
|
+
Object.defineProperty(__proto, "observePanelResize", {
|
|
7252
|
+
/**
|
|
7253
|
+
* Whether to use {@link https://developer.mozilla.org/en-US/docs/Web/API/ResizeObserver ResizeObserver} to observe the size of the panel element
|
|
7254
|
+
* This is only available when `useResizeObserver` is enabled.
|
|
7255
|
+
* This option garantees that the resize event is triggered when the size of the panel element is changed.
|
|
7256
|
+
* @ko 이 옵션을 활성화할 경우, {@link https://developer.mozilla.org/en-US/docs/Web/API/ResizeObserver ResizeObserver}를 사용하여 패널 엘리먼트의 크기를 추적합니다.
|
|
7257
|
+
* 이 옵션은 `useResizeObserver` 옵션이 활성화된 경우에만 사용할 수 있습니다.
|
|
7258
|
+
* 이 옵션은 패널 엘리먼트의 크기가 변경될 경우 resize 이벤트가 발생하도록 보장합니다.
|
|
7259
|
+
*/
|
|
7260
|
+
get: function () {
|
|
7261
|
+
return this._observePanelResize;
|
|
7262
|
+
},
|
|
7263
|
+
set: function (val) {
|
|
7264
|
+
this._observePanelResize = val;
|
|
7265
|
+
if (this._initialized && this._autoResize) {
|
|
7266
|
+
if (val) {
|
|
7267
|
+
this._autoResizer.observePanels();
|
|
7268
|
+
} else {
|
|
7269
|
+
this._autoResizer.unobservePanels();
|
|
7270
|
+
}
|
|
7271
|
+
}
|
|
7272
|
+
},
|
|
7273
|
+
enumerable: false,
|
|
7274
|
+
configurable: true
|
|
7275
|
+
});
|
|
7183
7276
|
Object.defineProperty(__proto, "resizeDebounce", {
|
|
7184
7277
|
/**
|
|
7185
7278
|
* Delays size recalculation from `autoResize` by the given time in milisecond.
|
|
@@ -7261,6 +7354,30 @@ var Flicking = /*#__PURE__*/function (_super) {
|
|
|
7261
7354
|
enumerable: false,
|
|
7262
7355
|
configurable: true
|
|
7263
7356
|
});
|
|
7357
|
+
Object.defineProperty(__proto, "optimizeSizeUpdate", {
|
|
7358
|
+
/**
|
|
7359
|
+
* This option works only when autoResize is set to true.
|
|
7360
|
+
* By default, autoResize listens to changes in both the viewport's width and height, updating all panel sizes accordingly.
|
|
7361
|
+
* When optimizeSizeUpdate is enabled, the update behavior is optimized based on the flicking direction:
|
|
7362
|
+
* If direction is "horizontal", only changes in width will trigger panel size updates.
|
|
7363
|
+
* If direction is "vertical", only changes in height will do so.
|
|
7364
|
+
* This option is useful when panel heights vary and unwanted flickering occurs due to frequent size recalculations during flicking. Enabling optimizeSizeUpdate prevents unnecessary updates and helps maintain visual stability.
|
|
7365
|
+
* @ko optimizeSizeUpdate는 autoResize가 true일 때만 동작합니다.
|
|
7366
|
+
* 기본적으로 autoResize는 뷰포트의 width와 height 변화를 모두 감지하여 패널들의 사이즈를 업데이트합니다.
|
|
7367
|
+
* 이 옵션을 활성화하면 플리킹 방향에 따라 필요한 차원(horizontal → width, vertical → height)에 대해서만 사이즈를 업데이트합니다.
|
|
7368
|
+
* 내부 패널의 높이가 서로 다를 때, 플리킹 중 과도한 리사이징으로 인한 깜빡임 현상을 줄이는 데 유용합니다.
|
|
7369
|
+
* @type {boolean}
|
|
7370
|
+
* @default false
|
|
7371
|
+
*/
|
|
7372
|
+
get: function () {
|
|
7373
|
+
return this._optimizeSizeUpdate;
|
|
7374
|
+
},
|
|
7375
|
+
set: function (val) {
|
|
7376
|
+
this._optimizeSizeUpdate = val;
|
|
7377
|
+
},
|
|
7378
|
+
enumerable: false,
|
|
7379
|
+
configurable: true
|
|
7380
|
+
});
|
|
7264
7381
|
/**
|
|
7265
7382
|
* Initialize Flicking and move to the default index
|
|
7266
7383
|
* This is automatically called on Flicking's constructor when `autoInit` is true(default)
|
|
@@ -7719,7 +7836,7 @@ var Flicking = /*#__PURE__*/function (_super) {
|
|
|
7719
7836
|
if (!(this.horizontal && viewport.width !== prevWidth || !this.horizontal && viewport.height !== prevHeight)) return [3 /*break*/, 2];
|
|
7720
7837
|
return [4 /*yield*/, renderer.forceRenderAllPanels()];
|
|
7721
7838
|
case 1:
|
|
7722
|
-
_a.sent();
|
|
7839
|
+
_a.sent();
|
|
7723
7840
|
_a.label = 2;
|
|
7724
7841
|
case 2:
|
|
7725
7842
|
return [3 /*break*/, 5];
|
|
@@ -7892,7 +8009,7 @@ var Flicking = /*#__PURE__*/function (_super) {
|
|
|
7892
8009
|
__proto._createCamera = function () {
|
|
7893
8010
|
if (this._circular && this._bound) {
|
|
7894
8011
|
// eslint-disable-next-line no-console
|
|
7895
|
-
console.warn(
|
|
8012
|
+
console.warn("\"circular\" and \"bound\" option cannot be used together, ignoring bound.");
|
|
7896
8013
|
}
|
|
7897
8014
|
return new Camera(this, {
|
|
7898
8015
|
align: this._align
|
|
@@ -7902,7 +8019,7 @@ var Flicking = /*#__PURE__*/function (_super) {
|
|
|
7902
8019
|
var externalRenderer = this._externalRenderer;
|
|
7903
8020
|
if (this._virtual && this._panelsPerView <= 0) {
|
|
7904
8021
|
// eslint-disable-next-line no-console
|
|
7905
|
-
console.warn(
|
|
8022
|
+
console.warn("\"virtual\" and \"panelsPerView\" option should be used together, ignoring virtual.");
|
|
7906
8023
|
}
|
|
7907
8024
|
return externalRenderer ? externalRenderer : this._renderExternal ? this._createExternalRenderer() : this._createVanillaRenderer();
|
|
7908
8025
|
};
|
|
@@ -7984,7 +8101,7 @@ var Flicking = /*#__PURE__*/function (_super) {
|
|
|
7984
8101
|
* Flicking.VERSION; // ex) 4.0.0
|
|
7985
8102
|
* ```
|
|
7986
8103
|
*/
|
|
7987
|
-
Flicking.VERSION = "4.
|
|
8104
|
+
Flicking.VERSION = "4.13.0";
|
|
7988
8105
|
return Flicking;
|
|
7989
8106
|
}(Component);
|
|
7990
8107
|
|