@egjs/flicking 4.4.1 → 4.5.1
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/README.md +0 -1
- package/declaration/Flicking.d.ts +8 -2
- package/declaration/camera/Camera.d.ts +26 -24
- package/declaration/camera/index.d.ts +2 -4
- package/declaration/camera/mode/BoundCameraMode.d.ts +13 -0
- package/declaration/camera/mode/CameraMode.d.ts +19 -0
- package/declaration/camera/mode/CircularCameraMode.d.ts +18 -0
- package/declaration/camera/mode/LinearCameraMode.d.ts +9 -0
- package/declaration/camera/mode/index.d.ts +6 -0
- package/declaration/const/external.d.ts +4 -0
- package/declaration/control/StrictControl.d.ts +1 -0
- package/declaration/type/external.d.ts +1 -3
- package/dist/flicking.esm.js +1205 -1093
- package/dist/flicking.esm.js.map +1 -1
- package/dist/flicking.js +1208 -1095
- 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 +1208 -1095
- 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 +5 -4
- package/src/Flicking.ts +26 -15
- package/src/camera/Camera.ts +156 -71
- package/src/camera/index.ts +3 -7
- package/src/camera/{BoundCamera.ts → mode/BoundCameraMode.ts} +46 -43
- package/src/camera/mode/CameraMode.ts +77 -0
- package/src/camera/mode/CircularCameraMode.ts +171 -0
- package/src/camera/mode/LinearCameraMode.ts +23 -0
- package/src/camera/mode/index.ts +14 -0
- package/src/cfc/sync.ts +9 -4
- package/src/cfc/withFlickingMethods.ts +2 -1
- package/src/const/external.ts +12 -0
- package/src/control/StrictControl.ts +10 -0
- package/declaration/camera/BoundCamera.d.ts +0 -9
- package/declaration/camera/CircularCamera.d.ts +0 -37
- package/declaration/camera/LinearCamera.d.ts +0 -5
- package/src/camera/CircularCamera.ts +0 -268
- package/src/camera/LinearCamera.ts +0 -35
package/dist/flicking.pkgd.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.5.1
|
|
8
8
|
*/
|
|
9
9
|
(function (global, factory) {
|
|
10
10
|
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
|
|
@@ -242,10 +242,12 @@ version: 4.4.1
|
|
|
242
242
|
|
|
243
243
|
return ar;
|
|
244
244
|
}
|
|
245
|
-
|
|
246
|
-
for (var i = 0, il = from.length, j = to.length; i < il; i++, j++) to[j] = from[i];
|
|
245
|
+
/** @deprecated */
|
|
247
246
|
|
|
248
|
-
|
|
247
|
+
function __spread$1() {
|
|
248
|
+
for (var ar = [], i = 0; i < arguments.length; i++) ar = ar.concat(__read$1(arguments[i]));
|
|
249
|
+
|
|
250
|
+
return ar;
|
|
249
251
|
}
|
|
250
252
|
|
|
251
253
|
/*
|
|
@@ -893,6 +895,18 @@ version: 4.4.1
|
|
|
893
895
|
HIDDEN: "flicking-hidden",
|
|
894
896
|
DEFAULT_VIRTUAL: "flicking-panel"
|
|
895
897
|
};
|
|
898
|
+
/**
|
|
899
|
+
* An object with all possible {@link Flicking#circularFallback circularFallback}s
|
|
900
|
+
* @ko Flicking의 {@link Flicking#circularFallback circularFallback}에 설정 가능한 값들을 담고 있는 객체
|
|
901
|
+
* @type {object}
|
|
902
|
+
* @property {string} LINEAR "linear"
|
|
903
|
+
* @property {string} BOUND "bound"
|
|
904
|
+
*/
|
|
905
|
+
|
|
906
|
+
var CIRCULAR_FALLBACK = {
|
|
907
|
+
LINEAR: "linear",
|
|
908
|
+
BOUND: "bound"
|
|
909
|
+
};
|
|
896
910
|
|
|
897
911
|
var Constants = {
|
|
898
912
|
__proto__: null,
|
|
@@ -901,6 +915,7 @@ version: 4.4.1
|
|
|
901
915
|
DIRECTION: DIRECTION,
|
|
902
916
|
MOVE_TYPE: MOVE_TYPE,
|
|
903
917
|
CLASS: CLASS,
|
|
918
|
+
CIRCULAR_FALLBACK: CIRCULAR_FALLBACK,
|
|
904
919
|
ERROR_CODE: CODE
|
|
905
920
|
};
|
|
906
921
|
|
|
@@ -1086,7 +1101,7 @@ version: 4.4.1
|
|
|
1086
1101
|
if (isString(el)) {
|
|
1087
1102
|
var tempDiv = document.createElement("div");
|
|
1088
1103
|
tempDiv.innerHTML = el;
|
|
1089
|
-
elements.push.apply(elements,
|
|
1104
|
+
elements.push.apply(elements, __spread$1(toArray$3(tempDiv.children)));
|
|
1090
1105
|
|
|
1091
1106
|
while (tempDiv.firstChild) {
|
|
1092
1107
|
tempDiv.removeChild(tempDiv.firstChild);
|
|
@@ -9443,9 +9458,8 @@ version: 4.4.1
|
|
|
9443
9458
|
|
|
9444
9459
|
|
|
9445
9460
|
function SnapControl(_a) {
|
|
9446
|
-
var _b = _a === void 0 ? {} : _a,
|
|
9447
|
-
|
|
9448
|
-
count = _c === void 0 ? Infinity : _c;
|
|
9461
|
+
var _b = (_a === void 0 ? {} : _a).count,
|
|
9462
|
+
count = _b === void 0 ? Infinity : _b;
|
|
9449
9463
|
|
|
9450
9464
|
var _this = _super.call(this) || this;
|
|
9451
9465
|
|
|
@@ -9651,9 +9665,8 @@ version: 4.4.1
|
|
|
9651
9665
|
|
|
9652
9666
|
|
|
9653
9667
|
function FreeControl(_a) {
|
|
9654
|
-
var _b = _a === void 0 ? {} : _a,
|
|
9655
|
-
|
|
9656
|
-
stopAtEdge = _c === void 0 ? true : _c;
|
|
9668
|
+
var _b = (_a === void 0 ? {} : _a).stopAtEdge,
|
|
9669
|
+
stopAtEdge = _b === void 0 ? true : _b;
|
|
9657
9670
|
|
|
9658
9671
|
var _this = _super.call(this) || this;
|
|
9659
9672
|
|
|
@@ -9787,9 +9800,8 @@ version: 4.4.1
|
|
|
9787
9800
|
|
|
9788
9801
|
|
|
9789
9802
|
function StrictControl(_a) {
|
|
9790
|
-
var _b = _a === void 0 ? {} : _a,
|
|
9791
|
-
|
|
9792
|
-
count = _c === void 0 ? 1 : _c;
|
|
9803
|
+
var _b = (_a === void 0 ? {} : _a).count,
|
|
9804
|
+
count = _b === void 0 ? 1 : _b;
|
|
9793
9805
|
|
|
9794
9806
|
var _this = _super.call(this) || this;
|
|
9795
9807
|
|
|
@@ -9912,6 +9924,21 @@ version: 4.4.1
|
|
|
9912
9924
|
};
|
|
9913
9925
|
return this;
|
|
9914
9926
|
};
|
|
9927
|
+
|
|
9928
|
+
__proto.moveToPanel = function (panel, options) {
|
|
9929
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
9930
|
+
var flicking, camera, controller;
|
|
9931
|
+
return __generator(this, function (_a) {
|
|
9932
|
+
flicking = getFlickingAttached(this._flicking);
|
|
9933
|
+
camera = flicking.camera;
|
|
9934
|
+
controller = this._controller;
|
|
9935
|
+
controller.update(camera.controlParams);
|
|
9936
|
+
return [2
|
|
9937
|
+
/*return*/
|
|
9938
|
+
, _super.prototype.moveToPanel.call(this, panel, options)];
|
|
9939
|
+
});
|
|
9940
|
+
});
|
|
9941
|
+
};
|
|
9915
9942
|
/**
|
|
9916
9943
|
* Move {@link Camera} to the given position
|
|
9917
9944
|
* @ko {@link Camera}를 주어진 좌표로 이동합니다
|
|
@@ -10042,761 +10069,826 @@ version: 4.4.1
|
|
|
10042
10069
|
};
|
|
10043
10070
|
|
|
10044
10071
|
/**
|
|
10045
|
-
* A
|
|
10046
|
-
* @ko 뷰포트 내에서의 실제 움직임을 담당하는 컴포넌트
|
|
10072
|
+
* A mode of camera
|
|
10047
10073
|
*/
|
|
10048
10074
|
|
|
10049
|
-
var
|
|
10075
|
+
var CameraMode =
|
|
10050
10076
|
/*#__PURE__*/
|
|
10051
10077
|
function () {
|
|
10052
10078
|
/** */
|
|
10053
|
-
function
|
|
10054
|
-
|
|
10079
|
+
function CameraMode(flicking) {
|
|
10080
|
+
this._flicking = flicking;
|
|
10081
|
+
}
|
|
10055
10082
|
|
|
10056
|
-
|
|
10057
|
-
_c = _b.align,
|
|
10058
|
-
align = _c === void 0 ? ALIGN.CENTER : _c;
|
|
10083
|
+
var __proto = CameraMode.prototype;
|
|
10059
10084
|
|
|
10060
|
-
|
|
10061
|
-
|
|
10085
|
+
__proto.getAnchors = function () {
|
|
10086
|
+
var panels = this._flicking.renderer.panels;
|
|
10087
|
+
return panels.map(function (panel, index) {
|
|
10088
|
+
return new AnchorPoint({
|
|
10089
|
+
index: index,
|
|
10090
|
+
position: panel.position,
|
|
10091
|
+
panel: panel
|
|
10092
|
+
});
|
|
10093
|
+
});
|
|
10094
|
+
};
|
|
10062
10095
|
|
|
10063
|
-
|
|
10064
|
-
|
|
10065
|
-
|
|
10096
|
+
__proto.findAnchorIncludePosition = function (position) {
|
|
10097
|
+
var anchors = this._flicking.camera.anchorPoints;
|
|
10098
|
+
var anchorsIncludingPosition = anchors.filter(function (anchor) {
|
|
10099
|
+
return anchor.panel.includePosition(position, true);
|
|
10100
|
+
});
|
|
10101
|
+
return anchorsIncludingPosition.reduce(function (nearest, anchor) {
|
|
10102
|
+
if (!nearest) return anchor;
|
|
10103
|
+
return Math.abs(nearest.position - position) < Math.abs(anchor.position - position) ? nearest : anchor;
|
|
10104
|
+
}, null);
|
|
10105
|
+
};
|
|
10066
10106
|
|
|
10067
|
-
|
|
10068
|
-
|
|
10069
|
-
|
|
10107
|
+
__proto.clampToReachablePosition = function (position) {
|
|
10108
|
+
var camera = this._flicking.camera;
|
|
10109
|
+
var range = camera.range;
|
|
10110
|
+
return clamp(position, range.min, range.max);
|
|
10111
|
+
};
|
|
10070
10112
|
|
|
10071
|
-
|
|
10072
|
-
|
|
10073
|
-
|
|
10074
|
-
}
|
|
10075
|
-
} catch (e_1_1) {
|
|
10076
|
-
e_1 = {
|
|
10077
|
-
error: e_1_1
|
|
10078
|
-
};
|
|
10079
|
-
} finally {
|
|
10080
|
-
try {
|
|
10081
|
-
if (transforms_1_1 && !transforms_1_1.done && (_a = transforms_1.return)) _a.call(transforms_1);
|
|
10082
|
-
} finally {
|
|
10083
|
-
if (e_1) throw e_1.error;
|
|
10084
|
-
}
|
|
10085
|
-
}
|
|
10113
|
+
__proto.getCircularOffset = function () {
|
|
10114
|
+
return 0;
|
|
10115
|
+
};
|
|
10086
10116
|
|
|
10087
|
-
|
|
10088
|
-
|
|
10089
|
-
|
|
10117
|
+
__proto.canReach = function (panel) {
|
|
10118
|
+
var camera = this._flicking.camera;
|
|
10119
|
+
var range = camera.range;
|
|
10120
|
+
if (panel.removed) return false;
|
|
10121
|
+
var panelPos = panel.position;
|
|
10122
|
+
return panelPos >= range.min && panelPos <= range.max;
|
|
10123
|
+
};
|
|
10090
10124
|
|
|
10091
|
-
|
|
10125
|
+
__proto.canSee = function (panel) {
|
|
10126
|
+
var camera = this._flicking.camera;
|
|
10127
|
+
var visibleRange = camera.visibleRange; // Should not include margin, as we don't declare what the margin is visible as what the panel is visible.
|
|
10128
|
+
|
|
10129
|
+
return panel.isVisibleOnRange(visibleRange.min, visibleRange.max);
|
|
10130
|
+
};
|
|
10131
|
+
|
|
10132
|
+
return CameraMode;
|
|
10133
|
+
}();
|
|
10134
|
+
|
|
10135
|
+
var LinearCameraMode =
|
|
10136
|
+
/*#__PURE__*/
|
|
10137
|
+
function (_super) {
|
|
10138
|
+
__extends$2(LinearCameraMode, _super);
|
|
10139
|
+
|
|
10140
|
+
function LinearCameraMode() {
|
|
10141
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
10142
|
+
}
|
|
10143
|
+
|
|
10144
|
+
var __proto = LinearCameraMode.prototype;
|
|
10145
|
+
|
|
10146
|
+
__proto.checkAvailability = function () {
|
|
10147
|
+
// It's always available
|
|
10148
|
+
return true;
|
|
10149
|
+
};
|
|
10150
|
+
|
|
10151
|
+
__proto.getRange = function () {
|
|
10152
|
+
var _a, _b;
|
|
10153
|
+
|
|
10154
|
+
var renderer = this._flicking.renderer;
|
|
10155
|
+
var firstPanel = renderer.getPanel(0);
|
|
10156
|
+
var lastPanel = renderer.getPanel(renderer.panelCount - 1);
|
|
10157
|
+
return {
|
|
10158
|
+
min: (_a = firstPanel === null || firstPanel === void 0 ? void 0 : firstPanel.position) !== null && _a !== void 0 ? _a : 0,
|
|
10159
|
+
max: (_b = lastPanel === null || lastPanel === void 0 ? void 0 : lastPanel.position) !== null && _b !== void 0 ? _b : 0
|
|
10092
10160
|
};
|
|
10161
|
+
};
|
|
10093
10162
|
|
|
10094
|
-
|
|
10163
|
+
return LinearCameraMode;
|
|
10164
|
+
}(CameraMode);
|
|
10095
10165
|
|
|
10096
|
-
|
|
10166
|
+
/**
|
|
10167
|
+
* A {@link Camera} mode that connects the last panel and the first panel, enabling continuous loop
|
|
10168
|
+
* @ko 첫번째 패널과 마지막 패널이 이어진 상태로, 무한히 회전할 수 있는 종류의 {@link Camera} 모드
|
|
10169
|
+
*/
|
|
10097
10170
|
|
|
10171
|
+
var CircularCameraMode =
|
|
10172
|
+
/*#__PURE__*/
|
|
10173
|
+
function (_super) {
|
|
10174
|
+
__extends$2(CircularCameraMode, _super);
|
|
10098
10175
|
|
|
10099
|
-
|
|
10176
|
+
function CircularCameraMode() {
|
|
10177
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
10100
10178
|
}
|
|
10101
10179
|
|
|
10102
|
-
var __proto =
|
|
10103
|
-
Object.defineProperty(__proto, "element", {
|
|
10104
|
-
// Internal states getter
|
|
10180
|
+
var __proto = CircularCameraMode.prototype;
|
|
10105
10181
|
|
|
10106
|
-
|
|
10107
|
-
|
|
10108
|
-
|
|
10109
|
-
|
|
10110
|
-
|
|
10111
|
-
|
|
10112
|
-
|
|
10113
|
-
|
|
10114
|
-
|
|
10115
|
-
|
|
10116
|
-
|
|
10117
|
-
|
|
10118
|
-
|
|
10119
|
-
|
|
10120
|
-
|
|
10121
|
-
|
|
10122
|
-
|
|
10123
|
-
|
|
10124
|
-
|
|
10125
|
-
|
|
10126
|
-
|
|
10127
|
-
|
|
10128
|
-
|
|
10129
|
-
|
|
10130
|
-
|
|
10131
|
-
|
|
10132
|
-
/**
|
|
10133
|
-
* Current position of the camera
|
|
10134
|
-
* @ko Camera의 현재 좌표
|
|
10135
|
-
* @type {number}
|
|
10136
|
-
* @readonly
|
|
10137
|
-
*/
|
|
10138
|
-
get: function () {
|
|
10139
|
-
return this._position;
|
|
10140
|
-
},
|
|
10141
|
-
enumerable: false,
|
|
10142
|
-
configurable: true
|
|
10143
|
-
});
|
|
10144
|
-
Object.defineProperty(__proto, "alignPosition", {
|
|
10145
|
-
/**
|
|
10146
|
-
* Align position inside the viewport where {@link Panel}'s {@link Panel#alignPosition alignPosition} should be located at
|
|
10147
|
-
* @ko 패널의 정렬 기준 위치. 뷰포트 내에서 {@link Panel}의 {@link Panel#alignPosition alignPosition}이 위치해야 하는 곳입니다
|
|
10148
|
-
* @type {number}
|
|
10149
|
-
* @readonly
|
|
10150
|
-
*/
|
|
10151
|
-
get: function () {
|
|
10152
|
-
return this._alignPos;
|
|
10153
|
-
},
|
|
10154
|
-
enumerable: false,
|
|
10155
|
-
configurable: true
|
|
10156
|
-
});
|
|
10157
|
-
Object.defineProperty(__proto, "offset", {
|
|
10158
|
-
/**
|
|
10159
|
-
* Position offset, used for the {@link Flicking#renderOnlyVisible renderOnlyVisible} option
|
|
10160
|
-
* @ko Camera의 좌표 오프셋. {@link Flicking#renderOnlyVisible renderOnlyVisible} 옵션을 위해 사용됩니다.
|
|
10161
|
-
* @type {number}
|
|
10162
|
-
* @default 0
|
|
10163
|
-
* @readonly
|
|
10164
|
-
*/
|
|
10165
|
-
get: function () {
|
|
10166
|
-
return this._offset;
|
|
10167
|
-
},
|
|
10168
|
-
enumerable: false,
|
|
10169
|
-
configurable: true
|
|
10170
|
-
});
|
|
10171
|
-
Object.defineProperty(__proto, "range", {
|
|
10172
|
-
/**
|
|
10173
|
-
* A range that Camera's {@link Camera#position position} can reach
|
|
10174
|
-
* @ko Camera의 {@link Camera#position position}이 도달 가능한 범위
|
|
10175
|
-
* @type {object}
|
|
10176
|
-
* @property {number} min A minimum position<ko>최소 위치</ko>
|
|
10177
|
-
* @property {number} min A maximum position<ko>최대 위치</ko>
|
|
10178
|
-
* @readonly
|
|
10179
|
-
*/
|
|
10180
|
-
get: function () {
|
|
10181
|
-
return this._range;
|
|
10182
|
-
},
|
|
10183
|
-
enumerable: false,
|
|
10184
|
-
configurable: true
|
|
10185
|
-
});
|
|
10186
|
-
Object.defineProperty(__proto, "rangeDiff", {
|
|
10187
|
-
/**
|
|
10188
|
-
* A difference between Camera's minimum and maximum position that can reach
|
|
10189
|
-
* @ko Camera가 도달 가능한 최소/최대 좌표의 차이
|
|
10190
|
-
* @type {number}
|
|
10191
|
-
* @readonly
|
|
10192
|
-
*/
|
|
10193
|
-
get: function () {
|
|
10194
|
-
return this._range.max - this._range.min;
|
|
10195
|
-
},
|
|
10196
|
-
enumerable: false,
|
|
10197
|
-
configurable: true
|
|
10198
|
-
});
|
|
10199
|
-
Object.defineProperty(__proto, "visiblePanels", {
|
|
10200
|
-
/**
|
|
10201
|
-
* An array of visible panels from the current position
|
|
10202
|
-
* @ko 현재 보이는 패널들의 배열
|
|
10203
|
-
* @type {Panel[]}
|
|
10204
|
-
* @readonly
|
|
10205
|
-
*/
|
|
10206
|
-
get: function () {
|
|
10207
|
-
return this._visiblePanels;
|
|
10208
|
-
},
|
|
10209
|
-
enumerable: false,
|
|
10210
|
-
configurable: true
|
|
10211
|
-
});
|
|
10212
|
-
Object.defineProperty(__proto, "visibleRange", {
|
|
10213
|
-
/**
|
|
10214
|
-
* A range of the visible area from the current position
|
|
10215
|
-
* @ko 현재 위치에서 보이는 범위
|
|
10216
|
-
* @type {object}
|
|
10217
|
-
* @property {number} min A minimum position<ko>최소 위치</ko>
|
|
10218
|
-
* @property {number} min A maximum position<ko>최대 위치</ko>
|
|
10219
|
-
* @readonly
|
|
10220
|
-
*/
|
|
10221
|
-
get: function () {
|
|
10182
|
+
__proto.checkAvailability = function () {
|
|
10183
|
+
var flicking = this._flicking;
|
|
10184
|
+
var renderer = flicking.renderer;
|
|
10185
|
+
var panels = renderer.panels;
|
|
10186
|
+
|
|
10187
|
+
if (panels.length <= 0) {
|
|
10188
|
+
return false;
|
|
10189
|
+
}
|
|
10190
|
+
|
|
10191
|
+
var firstPanel = panels[0];
|
|
10192
|
+
var lastPanel = panels[panels.length - 1];
|
|
10193
|
+
var firstPanelPrev = firstPanel.range.min - firstPanel.margin.prev;
|
|
10194
|
+
var lastPanelNext = lastPanel.range.max + lastPanel.margin.next;
|
|
10195
|
+
var visibleSize = flicking.camera.size;
|
|
10196
|
+
var panelSizeSum = lastPanelNext - firstPanelPrev;
|
|
10197
|
+
var canSetCircularMode = panels.every(function (panel) {
|
|
10198
|
+
return panelSizeSum - panel.size >= visibleSize;
|
|
10199
|
+
});
|
|
10200
|
+
return canSetCircularMode;
|
|
10201
|
+
};
|
|
10202
|
+
|
|
10203
|
+
__proto.getRange = function () {
|
|
10204
|
+
var flicking = this._flicking;
|
|
10205
|
+
var panels = flicking.renderer.panels;
|
|
10206
|
+
|
|
10207
|
+
if (panels.length <= 0) {
|
|
10222
10208
|
return {
|
|
10223
|
-
min:
|
|
10224
|
-
max:
|
|
10225
|
-
};
|
|
10226
|
-
},
|
|
10227
|
-
enumerable: false,
|
|
10228
|
-
configurable: true
|
|
10229
|
-
});
|
|
10230
|
-
Object.defineProperty(__proto, "anchorPoints", {
|
|
10231
|
-
/**
|
|
10232
|
-
* An array of {@link AnchorPoint}s that Camera can be stopped at
|
|
10233
|
-
* @ko 카메라가 도달 가능한 {@link AnchorPoint}의 목록
|
|
10234
|
-
* @type {AnchorPoint[]}
|
|
10235
|
-
* @readonly
|
|
10236
|
-
*/
|
|
10237
|
-
get: function () {
|
|
10238
|
-
return this._anchors;
|
|
10239
|
-
},
|
|
10240
|
-
enumerable: false,
|
|
10241
|
-
configurable: true
|
|
10242
|
-
});
|
|
10243
|
-
Object.defineProperty(__proto, "controlParams", {
|
|
10244
|
-
/**
|
|
10245
|
-
* A current parameters of the Camera for updating {@link AxesController}
|
|
10246
|
-
* @ko {@link AxesController}를 업데이트하기 위한 현재 Camera 패러미터들
|
|
10247
|
-
* @type {ControlParams}
|
|
10248
|
-
* @readonly
|
|
10249
|
-
*/
|
|
10250
|
-
get: function () {
|
|
10251
|
-
return {
|
|
10252
|
-
range: this._range,
|
|
10253
|
-
position: this._position,
|
|
10254
|
-
circular: false
|
|
10209
|
+
min: 0,
|
|
10210
|
+
max: 0
|
|
10255
10211
|
};
|
|
10256
|
-
}
|
|
10257
|
-
enumerable: false,
|
|
10258
|
-
configurable: true
|
|
10259
|
-
});
|
|
10260
|
-
Object.defineProperty(__proto, "atEdge", {
|
|
10261
|
-
/**
|
|
10262
|
-
* A Boolean value indicating whether Camera's over the minimum or maximum position reachable
|
|
10263
|
-
* @ko 현재 카메라가 도달 가능한 범위의 최소 혹은 최대점을 넘어섰는지를 나타냅니다
|
|
10264
|
-
* @type {boolean}
|
|
10265
|
-
* @readonly
|
|
10266
|
-
*/
|
|
10267
|
-
get: function () {
|
|
10268
|
-
return this._position <= this._range.min || this._position >= this._range.max;
|
|
10269
|
-
},
|
|
10270
|
-
enumerable: false,
|
|
10271
|
-
configurable: true
|
|
10272
|
-
});
|
|
10273
|
-
Object.defineProperty(__proto, "size", {
|
|
10274
|
-
/**
|
|
10275
|
-
* Return the size of the viewport
|
|
10276
|
-
* @ko 뷰포트 크기를 반환합니다
|
|
10277
|
-
* @type {number}
|
|
10278
|
-
* @readonly
|
|
10279
|
-
*/
|
|
10280
|
-
get: function () {
|
|
10281
|
-
var flicking = this._flicking;
|
|
10282
|
-
return flicking ? flicking.horizontal ? flicking.viewport.width : flicking.viewport.height : 0;
|
|
10283
|
-
},
|
|
10284
|
-
enumerable: false,
|
|
10285
|
-
configurable: true
|
|
10286
|
-
});
|
|
10287
|
-
Object.defineProperty(__proto, "progress", {
|
|
10288
|
-
/**
|
|
10289
|
-
* Return the camera's position progress from the first panel to last panel
|
|
10290
|
-
* Range is from 0 to last panel's index
|
|
10291
|
-
* @ko 첫번째 패널로부터 마지막 패널까지의 카메라 위치의 진행도를 반환합니다
|
|
10292
|
-
* 범위는 0부터 마지막 패널의 인덱스까지입니다
|
|
10293
|
-
* @type {number}
|
|
10294
|
-
* @readonly
|
|
10295
|
-
*/
|
|
10296
|
-
get: function () {
|
|
10297
|
-
var flicking = this._flicking;
|
|
10298
|
-
var position = this._position + this._offset;
|
|
10299
|
-
var nearestAnchor = this.findNearestAnchor(this._position);
|
|
10212
|
+
}
|
|
10300
10213
|
|
|
10301
|
-
|
|
10302
|
-
|
|
10303
|
-
|
|
10214
|
+
var firstPanel = panels[0];
|
|
10215
|
+
var lastPanel = panels[panels.length - 1];
|
|
10216
|
+
var firstPanelPrev = firstPanel.range.min - firstPanel.margin.prev;
|
|
10217
|
+
var lastPanelNext = lastPanel.range.max + lastPanel.margin.next;
|
|
10218
|
+
return {
|
|
10219
|
+
min: firstPanelPrev,
|
|
10220
|
+
max: lastPanelNext
|
|
10221
|
+
};
|
|
10222
|
+
};
|
|
10304
10223
|
|
|
10305
|
-
|
|
10306
|
-
|
|
10307
|
-
|
|
10308
|
-
|
|
10309
|
-
|
|
10310
|
-
|
|
10311
|
-
|
|
10224
|
+
__proto.getAnchors = function () {
|
|
10225
|
+
var flicking = this._flicking;
|
|
10226
|
+
var panels = flicking.renderer.panels;
|
|
10227
|
+
return panels.map(function (panel, index) {
|
|
10228
|
+
return new AnchorPoint({
|
|
10229
|
+
index: index,
|
|
10230
|
+
position: panel.position,
|
|
10231
|
+
panel: panel
|
|
10232
|
+
});
|
|
10233
|
+
});
|
|
10234
|
+
};
|
|
10312
10235
|
|
|
10313
|
-
|
|
10314
|
-
|
|
10315
|
-
|
|
10236
|
+
__proto.findAnchorIncludePosition = function (position) {
|
|
10237
|
+
var camera = this._flicking.camera;
|
|
10238
|
+
var range = camera.range;
|
|
10239
|
+
var anchors = camera.anchorPoints;
|
|
10240
|
+
var rangeDiff = camera.rangeDiff;
|
|
10241
|
+
var anchorCount = anchors.length;
|
|
10242
|
+
var positionInRange = circulatePosition(position, range.min, range.max);
|
|
10316
10243
|
|
|
10317
|
-
|
|
10318
|
-
var prevPanel = nearestPanel.prev();
|
|
10319
|
-
var prevPosition = prevPanel ? prevPanel.position + prevPanel.offset : prevRange - bounceSize[0]; // Looped
|
|
10244
|
+
var anchorInRange = _super.prototype.findAnchorIncludePosition.call(this, positionInRange);
|
|
10320
10245
|
|
|
10321
|
-
|
|
10322
|
-
|
|
10323
|
-
|
|
10246
|
+
if (anchorCount > 0 && (position === range.min || position === range.max)) {
|
|
10247
|
+
var possibleAnchors = [anchorInRange, new AnchorPoint({
|
|
10248
|
+
index: 0,
|
|
10249
|
+
position: anchors[0].position + rangeDiff,
|
|
10250
|
+
panel: anchors[0].panel
|
|
10251
|
+
}), new AnchorPoint({
|
|
10252
|
+
index: anchorCount - 1,
|
|
10253
|
+
position: anchors[anchorCount - 1].position - rangeDiff,
|
|
10254
|
+
panel: anchors[anchorCount - 1].panel
|
|
10255
|
+
})].filter(function (anchor) {
|
|
10256
|
+
return !!anchor;
|
|
10257
|
+
});
|
|
10258
|
+
anchorInRange = possibleAnchors.reduce(function (nearest, anchor) {
|
|
10259
|
+
if (!nearest) return anchor;
|
|
10260
|
+
return Math.abs(nearest.position - position) < Math.abs(anchor.position - position) ? nearest : anchor;
|
|
10261
|
+
}, null);
|
|
10262
|
+
}
|
|
10324
10263
|
|
|
10325
|
-
|
|
10326
|
-
} else {
|
|
10327
|
-
var nextPanel = nearestPanel.next();
|
|
10328
|
-
var nextPosition = nextPanel ? nextPanel.position + nextPanel.offset : nextRange + bounceSize[1]; // Looped
|
|
10264
|
+
if (!anchorInRange) return null;
|
|
10329
10265
|
|
|
10330
|
-
|
|
10331
|
-
|
|
10332
|
-
|
|
10266
|
+
if (position < range.min) {
|
|
10267
|
+
var loopCount = -Math.floor((range.min - position) / rangeDiff) - 1;
|
|
10268
|
+
return new AnchorPoint({
|
|
10269
|
+
index: anchorInRange.index,
|
|
10270
|
+
position: anchorInRange.position + rangeDiff * loopCount,
|
|
10271
|
+
panel: anchorInRange.panel
|
|
10272
|
+
});
|
|
10273
|
+
} else if (position > range.max) {
|
|
10274
|
+
var loopCount = Math.floor((position - range.max) / rangeDiff) + 1;
|
|
10275
|
+
return new AnchorPoint({
|
|
10276
|
+
index: anchorInRange.index,
|
|
10277
|
+
position: anchorInRange.position + rangeDiff * loopCount,
|
|
10278
|
+
panel: anchorInRange.panel
|
|
10279
|
+
});
|
|
10280
|
+
}
|
|
10333
10281
|
|
|
10334
|
-
|
|
10335
|
-
|
|
10336
|
-
},
|
|
10337
|
-
enumerable: false,
|
|
10338
|
-
configurable: true
|
|
10339
|
-
});
|
|
10340
|
-
Object.defineProperty(__proto, "align", {
|
|
10341
|
-
// Options Getter
|
|
10282
|
+
return anchorInRange;
|
|
10283
|
+
};
|
|
10342
10284
|
|
|
10343
|
-
|
|
10344
|
-
|
|
10345
|
-
|
|
10346
|
-
|
|
10347
|
-
|
|
10348
|
-
|
|
10349
|
-
|
|
10350
|
-
|
|
10351
|
-
|
|
10352
|
-
|
|
10353
|
-
|
|
10354
|
-
|
|
10355
|
-
|
|
10356
|
-
|
|
10357
|
-
}
|
|
10358
|
-
/**
|
|
10359
|
-
* Initialize Camera
|
|
10360
|
-
* @ko Camera를 초기화합니다
|
|
10361
|
-
* @param {Flicking} flicking An instance of {@link Flicking}<ko>Flicking의 인스턴스</ko>
|
|
10362
|
-
* @chainable
|
|
10363
|
-
* @throws {FlickingError}
|
|
10364
|
-
* {@link ERROR_CODE VAL_MUST_NOT_NULL} If the camera element(`.flicking-camera`) does not exist inside viewport element
|
|
10365
|
-
* <ko>{@link ERROR_CODE VAL_MUST_NOT_NULL} 뷰포트 엘리먼트 내부에 카메라 엘리먼트(`.flicking-camera`)가 존재하지 않을 경우</ko>
|
|
10366
|
-
* @return {this}
|
|
10367
|
-
*/
|
|
10285
|
+
__proto.getCircularOffset = function () {
|
|
10286
|
+
var flicking = this._flicking;
|
|
10287
|
+
var camera = flicking.camera;
|
|
10288
|
+
if (!camera.circularEnabled) return 0;
|
|
10289
|
+
var toggled = flicking.panels.filter(function (panel) {
|
|
10290
|
+
return panel.toggled;
|
|
10291
|
+
});
|
|
10292
|
+
var toggledPrev = toggled.filter(function (panel) {
|
|
10293
|
+
return panel.toggleDirection === DIRECTION.PREV;
|
|
10294
|
+
});
|
|
10295
|
+
var toggledNext = toggled.filter(function (panel) {
|
|
10296
|
+
return panel.toggleDirection === DIRECTION.NEXT;
|
|
10297
|
+
});
|
|
10298
|
+
return this._calcPanelAreaSum(toggledPrev) - this._calcPanelAreaSum(toggledNext);
|
|
10299
|
+
};
|
|
10368
10300
|
|
|
10369
|
-
__proto.
|
|
10370
|
-
|
|
10371
|
-
|
|
10372
|
-
|
|
10373
|
-
this._el = viewportEl.firstElementChild;
|
|
10301
|
+
__proto.clampToReachablePosition = function (position) {
|
|
10302
|
+
// Basically all position is reachable for circular camera
|
|
10303
|
+
return position;
|
|
10304
|
+
};
|
|
10374
10305
|
|
|
10375
|
-
|
|
10306
|
+
__proto.canReach = function (panel) {
|
|
10307
|
+
if (panel.removed) return false; // Always reachable on circular mode
|
|
10376
10308
|
|
|
10377
|
-
return
|
|
10309
|
+
return true;
|
|
10378
10310
|
};
|
|
10379
|
-
/**
|
|
10380
|
-
* Destroy Camera and return to initial state
|
|
10381
|
-
* @ko Camera를 초기 상태로 되돌립니다
|
|
10382
|
-
* @return {void}
|
|
10383
|
-
*/
|
|
10384
10311
|
|
|
10312
|
+
__proto.canSee = function (panel) {
|
|
10313
|
+
var camera = this._flicking.camera;
|
|
10314
|
+
var range = camera.range;
|
|
10315
|
+
var rangeDiff = camera.rangeDiff;
|
|
10316
|
+
var visibleRange = camera.visibleRange;
|
|
10385
10317
|
|
|
10386
|
-
|
|
10387
|
-
this._flicking = null;
|
|
10318
|
+
var visibleInCurrentRange = _super.prototype.canSee.call(this, panel); // Check looped visible area for circular case
|
|
10388
10319
|
|
|
10389
|
-
this._resetInternalValues();
|
|
10390
10320
|
|
|
10391
|
-
|
|
10321
|
+
if (visibleRange.min < range.min) {
|
|
10322
|
+
return visibleInCurrentRange || panel.isVisibleOnRange(visibleRange.min + rangeDiff, visibleRange.max + rangeDiff);
|
|
10323
|
+
} else if (visibleRange.max > range.max) {
|
|
10324
|
+
return visibleInCurrentRange || panel.isVisibleOnRange(visibleRange.min - rangeDiff, visibleRange.max - rangeDiff);
|
|
10325
|
+
}
|
|
10326
|
+
|
|
10327
|
+
return visibleInCurrentRange;
|
|
10392
10328
|
};
|
|
10393
|
-
/**
|
|
10394
|
-
* Move to the given position and apply CSS transform
|
|
10395
|
-
* @ko 해당 좌표로 이동하고, CSS transform을 적용합니다
|
|
10396
|
-
* @param {number} pos A new position<ko>움직일 위치</ko>
|
|
10397
|
-
* @throws {FlickingError}
|
|
10398
|
-
* {@link ERROR_CODE NOT_ATTACHED_TO_FLICKING} When {@link Camera#init init} is not called before
|
|
10399
|
-
* <ko>{@link ERROR_CODE NOT_ATTACHED_TO_FLICKING} {@link Camera#init init}이 이전에 호출되지 않은 경우</ko>
|
|
10400
|
-
* @return {this}
|
|
10401
|
-
*/
|
|
10402
10329
|
|
|
10330
|
+
__proto._calcPanelAreaSum = function (panels) {
|
|
10331
|
+
return panels.reduce(function (sum, panel) {
|
|
10332
|
+
return sum + panel.sizeIncludingMargin;
|
|
10333
|
+
}, 0);
|
|
10334
|
+
};
|
|
10403
10335
|
|
|
10404
|
-
|
|
10405
|
-
|
|
10406
|
-
this._position = pos;
|
|
10336
|
+
return CircularCameraMode;
|
|
10337
|
+
}(CameraMode);
|
|
10407
10338
|
|
|
10408
|
-
|
|
10339
|
+
var BoundCameraMode =
|
|
10340
|
+
/*#__PURE__*/
|
|
10341
|
+
function (_super) {
|
|
10342
|
+
__extends$2(BoundCameraMode, _super);
|
|
10409
10343
|
|
|
10410
|
-
|
|
10344
|
+
function BoundCameraMode() {
|
|
10345
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
10346
|
+
}
|
|
10411
10347
|
|
|
10412
|
-
|
|
10348
|
+
var __proto = BoundCameraMode.prototype;
|
|
10413
10349
|
|
|
10414
|
-
|
|
10415
|
-
|
|
10416
|
-
|
|
10417
|
-
|
|
10418
|
-
|
|
10419
|
-
* @ko 주어진 {@link AnchorPoint}의 이전 {@link AnchorPoint}를 반환합니다
|
|
10420
|
-
* 존재하지 않을 경우 `null`을 반환합니다
|
|
10421
|
-
* @param {AnchorPoint} anchor A reference {@link AnchorPoint}<ko>기준 {@link AnchorPoint}</ko>
|
|
10422
|
-
* @return {AnchorPoint | null} The previous {@link AnchorPoint}<ko>이전 {@link AnchorPoint}</ko>
|
|
10423
|
-
*/
|
|
10350
|
+
__proto.checkAvailability = function () {
|
|
10351
|
+
var flicking = this._flicking;
|
|
10352
|
+
var renderer = flicking.renderer;
|
|
10353
|
+
var firstPanel = renderer.getPanel(0);
|
|
10354
|
+
var lastPanel = renderer.getPanel(renderer.panelCount - 1);
|
|
10424
10355
|
|
|
10356
|
+
if (!firstPanel || !lastPanel) {
|
|
10357
|
+
return false;
|
|
10358
|
+
}
|
|
10425
10359
|
|
|
10426
|
-
|
|
10427
|
-
|
|
10360
|
+
var viewportSize = flicking.camera.size;
|
|
10361
|
+
var firstPanelPrev = firstPanel.range.min;
|
|
10362
|
+
var lastPanelNext = lastPanel.range.max;
|
|
10363
|
+
var panelAreaSize = lastPanelNext - firstPanelPrev;
|
|
10364
|
+
var isBiggerThanViewport = viewportSize < panelAreaSize;
|
|
10365
|
+
return isBiggerThanViewport;
|
|
10428
10366
|
};
|
|
10429
|
-
/**
|
|
10430
|
-
* Return a next {@link AnchorPoint} of given {@link AnchorPoint}
|
|
10431
|
-
* If it does not exist, return `null` instead
|
|
10432
|
-
* @ko 주어진 {@link AnchorPoint}의 다음 {@link AnchorPoint}를 반환합니다
|
|
10433
|
-
* 존재하지 않을 경우 `null`을 반환합니다
|
|
10434
|
-
* @param {AnchorPoint} anchor A reference {@link AnchorPoint}<ko>기준 {@link AnchorPoint}</ko>
|
|
10435
|
-
* @return {AnchorPoint | null} The next {@link AnchorPoint}<ko>다음 {@link AnchorPoint}</ko>
|
|
10436
|
-
*/
|
|
10437
10367
|
|
|
10368
|
+
__proto.getRange = function () {
|
|
10369
|
+
var flicking = this._flicking;
|
|
10370
|
+
var renderer = flicking.renderer;
|
|
10371
|
+
var alignPos = flicking.camera.alignPosition;
|
|
10372
|
+
var firstPanel = renderer.getPanel(0);
|
|
10373
|
+
var lastPanel = renderer.getPanel(renderer.panelCount - 1);
|
|
10438
10374
|
|
|
10439
|
-
|
|
10440
|
-
|
|
10441
|
-
|
|
10442
|
-
|
|
10443
|
-
|
|
10444
|
-
|
|
10445
|
-
* Value can be lower than 0 or bigger than 1 when it's in the margin area
|
|
10446
|
-
* @ko 현재 카메라 아래 패널에서의 위치 진행도를 반환합니다
|
|
10447
|
-
* 반환값은 카메라가 패널 내부에 있을 경우 0부터 1까지의 값을 갖습니다
|
|
10448
|
-
* 패널의 margin 영역에 있을 경우 0보다 작거나 1보다 큰 값을 반환할 수 있습니다
|
|
10449
|
-
*/
|
|
10375
|
+
if (!firstPanel || !lastPanel) {
|
|
10376
|
+
return {
|
|
10377
|
+
min: 0,
|
|
10378
|
+
max: 0
|
|
10379
|
+
};
|
|
10380
|
+
}
|
|
10450
10381
|
|
|
10382
|
+
var viewportSize = flicking.camera.size;
|
|
10383
|
+
var firstPanelPrev = firstPanel.range.min;
|
|
10384
|
+
var lastPanelNext = lastPanel.range.max;
|
|
10385
|
+
var panelAreaSize = lastPanelNext - firstPanelPrev;
|
|
10386
|
+
var isBiggerThanViewport = viewportSize < panelAreaSize;
|
|
10387
|
+
var firstPos = firstPanelPrev + alignPos;
|
|
10388
|
+
var lastPos = lastPanelNext - viewportSize + alignPos;
|
|
10451
10389
|
|
|
10452
|
-
|
|
10453
|
-
|
|
10454
|
-
|
|
10390
|
+
if (isBiggerThanViewport) {
|
|
10391
|
+
return {
|
|
10392
|
+
min: firstPos,
|
|
10393
|
+
max: lastPos
|
|
10394
|
+
};
|
|
10395
|
+
} else {
|
|
10396
|
+
var align = flicking.camera.align;
|
|
10397
|
+
var alignVal = typeof align === "object" ? align.camera : align;
|
|
10398
|
+
var pos = firstPos + parseAlign$1(alignVal, lastPos - firstPos);
|
|
10399
|
+
return {
|
|
10400
|
+
min: pos,
|
|
10401
|
+
max: pos
|
|
10402
|
+
};
|
|
10403
|
+
}
|
|
10455
10404
|
};
|
|
10456
|
-
/**
|
|
10457
|
-
* Return {@link AnchorPoint} that includes given position
|
|
10458
|
-
* If there's no {@link AnchorPoint} that includes the given position, return `null` instead
|
|
10459
|
-
* @ko 주어진 좌표를 포함하는 {@link AnchorPoint}를 반환합니다
|
|
10460
|
-
* 주어진 좌표를 포함하는 {@link AnchorPoint}가 없을 경우 `null`을 반환합니다
|
|
10461
|
-
* @param {number} position A position to check<ko>확인할 좌표</ko>
|
|
10462
|
-
* @return {AnchorPoint | null} The {@link AnchorPoint} that includes the given position<ko>해당 좌표를 포함하는 {@link AnchorPoint}</ko>
|
|
10463
|
-
*/
|
|
10464
10405
|
|
|
10406
|
+
__proto.getAnchors = function () {
|
|
10407
|
+
var flicking = this._flicking;
|
|
10408
|
+
var camera = flicking.camera;
|
|
10409
|
+
var panels = flicking.renderer.panels;
|
|
10465
10410
|
|
|
10466
|
-
|
|
10467
|
-
|
|
10468
|
-
|
|
10469
|
-
|
|
10411
|
+
if (panels.length <= 0) {
|
|
10412
|
+
return [];
|
|
10413
|
+
}
|
|
10414
|
+
|
|
10415
|
+
var range = flicking.camera.range;
|
|
10416
|
+
var reachablePanels = panels.filter(function (panel) {
|
|
10417
|
+
return camera.canReach(panel);
|
|
10470
10418
|
});
|
|
10471
|
-
return anchorsIncludingPosition.reduce(function (nearest, anchor) {
|
|
10472
|
-
if (!nearest) return anchor;
|
|
10473
|
-
return Math.abs(nearest.position - position) < Math.abs(anchor.position - position) ? nearest : anchor;
|
|
10474
|
-
}, null);
|
|
10475
|
-
};
|
|
10476
|
-
/**
|
|
10477
|
-
* Return {@link AnchorPoint} nearest to given position
|
|
10478
|
-
* If there're no {@link AnchorPoint}s, return `null` instead
|
|
10479
|
-
* @ko 해당 좌표에서 가장 가까운 {@link AnchorPoint}를 반환합니다
|
|
10480
|
-
* {@link AnchorPoint}가 하나도 없을 경우 `null`을 반환합니다
|
|
10481
|
-
* @param {number} position A position to check<ko>확인할 좌표</ko>
|
|
10482
|
-
* @return {AnchorPoint | null} The {@link AnchorPoint} nearest to the given position<ko>해당 좌표에 가장 인접한 {@link AnchorPoint}</ko>
|
|
10483
|
-
*/
|
|
10484
10419
|
|
|
10420
|
+
if (reachablePanels.length > 0) {
|
|
10421
|
+
var shouldPrependBoundAnchor = reachablePanels[0].position !== range.min;
|
|
10422
|
+
var shouldAppendBoundAnchor = reachablePanels[reachablePanels.length - 1].position !== range.max;
|
|
10423
|
+
var indexOffset_1 = shouldPrependBoundAnchor ? 1 : 0;
|
|
10424
|
+
var newAnchors = reachablePanels.map(function (panel, idx) {
|
|
10425
|
+
return new AnchorPoint({
|
|
10426
|
+
index: idx + indexOffset_1,
|
|
10427
|
+
position: panel.position,
|
|
10428
|
+
panel: panel
|
|
10429
|
+
});
|
|
10430
|
+
});
|
|
10431
|
+
|
|
10432
|
+
if (shouldPrependBoundAnchor) {
|
|
10433
|
+
newAnchors.splice(0, 0, new AnchorPoint({
|
|
10434
|
+
index: 0,
|
|
10435
|
+
position: range.min,
|
|
10436
|
+
panel: panels[reachablePanels[0].index - 1]
|
|
10437
|
+
}));
|
|
10438
|
+
}
|
|
10485
10439
|
|
|
10486
|
-
|
|
10487
|
-
|
|
10440
|
+
if (shouldAppendBoundAnchor) {
|
|
10441
|
+
newAnchors.push(new AnchorPoint({
|
|
10442
|
+
index: newAnchors.length,
|
|
10443
|
+
position: range.max,
|
|
10444
|
+
panel: panels[reachablePanels[reachablePanels.length - 1].index + 1]
|
|
10445
|
+
}));
|
|
10446
|
+
}
|
|
10447
|
+
|
|
10448
|
+
return newAnchors;
|
|
10449
|
+
} else if (range.min !== range.max) {
|
|
10450
|
+
// There're more than 2 panels
|
|
10451
|
+
var nearestPanelAtMin = this._findNearestPanel(range.min, panels);
|
|
10452
|
+
|
|
10453
|
+
var panelAtMin = nearestPanelAtMin.index === panels.length - 1 ? nearestPanelAtMin.prev() : nearestPanelAtMin;
|
|
10454
|
+
var panelAtMax = panelAtMin.next();
|
|
10455
|
+
return [new AnchorPoint({
|
|
10456
|
+
index: 0,
|
|
10457
|
+
position: range.min,
|
|
10458
|
+
panel: panelAtMin
|
|
10459
|
+
}), new AnchorPoint({
|
|
10460
|
+
index: 1,
|
|
10461
|
+
position: range.max,
|
|
10462
|
+
panel: panelAtMax
|
|
10463
|
+
})];
|
|
10464
|
+
} else {
|
|
10465
|
+
return [new AnchorPoint({
|
|
10466
|
+
index: 0,
|
|
10467
|
+
position: range.min,
|
|
10468
|
+
panel: this._findNearestPanel(range.min, panels)
|
|
10469
|
+
})];
|
|
10470
|
+
}
|
|
10471
|
+
};
|
|
10472
|
+
|
|
10473
|
+
__proto.findAnchorIncludePosition = function (position) {
|
|
10474
|
+
var camera = this._flicking.camera;
|
|
10475
|
+
var range = camera.range;
|
|
10476
|
+
var anchors = camera.anchorPoints;
|
|
10488
10477
|
if (anchors.length <= 0) return null;
|
|
10478
|
+
|
|
10479
|
+
if (position <= range.min) {
|
|
10480
|
+
return anchors[0];
|
|
10481
|
+
} else if (position >= range.max) {
|
|
10482
|
+
return anchors[anchors.length - 1];
|
|
10483
|
+
} else {
|
|
10484
|
+
return _super.prototype.findAnchorIncludePosition.call(this, position);
|
|
10485
|
+
}
|
|
10486
|
+
};
|
|
10487
|
+
|
|
10488
|
+
__proto._findNearestPanel = function (pos, panels) {
|
|
10489
10489
|
var prevDist = Infinity;
|
|
10490
10490
|
|
|
10491
|
-
for (var
|
|
10492
|
-
var
|
|
10493
|
-
var dist = Math.abs(
|
|
10491
|
+
for (var panelIdx = 0; panelIdx < panels.length; panelIdx++) {
|
|
10492
|
+
var panel = panels[panelIdx];
|
|
10493
|
+
var dist = Math.abs(panel.position - pos);
|
|
10494
10494
|
|
|
10495
10495
|
if (dist > prevDist) {
|
|
10496
10496
|
// Return previous anchor
|
|
10497
|
-
return
|
|
10497
|
+
return panels[panelIdx - 1];
|
|
10498
10498
|
}
|
|
10499
10499
|
|
|
10500
10500
|
prevDist = dist;
|
|
10501
10501
|
} // Return last anchor
|
|
10502
10502
|
|
|
10503
10503
|
|
|
10504
|
-
return
|
|
10504
|
+
return panels[panels.length - 1];
|
|
10505
10505
|
};
|
|
10506
|
-
/**
|
|
10507
|
-
* Return {@link AnchorPoint} that matches {@link Flicking#currentPanel}
|
|
10508
|
-
* @ko 현재 {@link Flicking#currentPanel}에 해당하는 {@link AnchorPoint}를 반환합니다
|
|
10509
|
-
* @return {AnchorPoint | null}
|
|
10510
|
-
*/
|
|
10511
10506
|
|
|
10507
|
+
return BoundCameraMode;
|
|
10508
|
+
}(CameraMode);
|
|
10512
10509
|
|
|
10513
|
-
|
|
10514
|
-
|
|
10515
|
-
|
|
10516
|
-
|
|
10517
|
-
return anchor.panel.index === activeIndex;
|
|
10518
|
-
});
|
|
10519
|
-
};
|
|
10520
|
-
/**
|
|
10521
|
-
* Clamp the given position between camera's range
|
|
10522
|
-
* @ko 주어진 좌표를 Camera가 도달 가능한 범위 사이의 값으로 만듭니다
|
|
10523
|
-
* @param {number} position A position to clamp<ko>범위를 제한할 좌표</ko>
|
|
10524
|
-
* @return {number} A clamped position<ko>범위 제한된 좌표</ko>
|
|
10525
|
-
*/
|
|
10510
|
+
/**
|
|
10511
|
+
* A component that manages actual movement inside the viewport
|
|
10512
|
+
* @ko 뷰포트 내에서의 실제 움직임을 담당하는 컴포넌트
|
|
10513
|
+
*/
|
|
10526
10514
|
|
|
10515
|
+
var Camera$1 =
|
|
10516
|
+
/*#__PURE__*/
|
|
10517
|
+
function () {
|
|
10518
|
+
/** */
|
|
10519
|
+
function Camera(_a) {
|
|
10520
|
+
var _this = this;
|
|
10527
10521
|
|
|
10528
|
-
|
|
10529
|
-
|
|
10530
|
-
return clamp(position, range.min, range.max);
|
|
10531
|
-
};
|
|
10532
|
-
/**
|
|
10533
|
-
* Check whether the given panel is inside of the Camera's range
|
|
10534
|
-
* @ko 해당 {@link Panel}이 Camera가 도달 가능한 범위 내에 있는지를 반환합니다
|
|
10535
|
-
* @param panel An instance of {@link Panel} to check<ko>확인할 {@link Panel}의 인스턴스</ko>
|
|
10536
|
-
* @return {boolean} Whether the panel's inside Camera's range<ko>도달 가능한 범위 내에 해당 패널이 존재하는지 여부</ko>
|
|
10537
|
-
*/
|
|
10522
|
+
var _b = (_a === void 0 ? {} : _a).align,
|
|
10523
|
+
align = _b === void 0 ? ALIGN.CENTER : _b;
|
|
10538
10524
|
|
|
10525
|
+
this._checkTranslateSupport = function () {
|
|
10526
|
+
var e_1, _a;
|
|
10539
10527
|
|
|
10540
|
-
|
|
10541
|
-
|
|
10542
|
-
|
|
10543
|
-
var panelPos = panel.position;
|
|
10544
|
-
return panelPos >= range.min && panelPos <= range.max;
|
|
10545
|
-
};
|
|
10546
|
-
/**
|
|
10547
|
-
* Check whether the given panel element is visible at the current position
|
|
10548
|
-
* @ko 현재 좌표에서 해당 패널 엘리먼트를 볼 수 있는지 여부를 반환합니다
|
|
10549
|
-
* @param panel An instance of {@link Panel} to check<ko>확인할 {@link Panel}의 인스턴스</ko>
|
|
10550
|
-
* @return Whether the panel element is visible at the current position<ko>현재 위치에서 해당 패널 엘리먼트가 보이는지 여부</ko>
|
|
10551
|
-
*/
|
|
10528
|
+
var transforms = ["webkitTransform", "msTransform", "MozTransform", "OTransform", "transform"];
|
|
10529
|
+
var supportedStyle = document.documentElement.style;
|
|
10530
|
+
var transformName = "";
|
|
10552
10531
|
|
|
10532
|
+
try {
|
|
10533
|
+
for (var transforms_1 = __values$2(transforms), transforms_1_1 = transforms_1.next(); !transforms_1_1.done; transforms_1_1 = transforms_1.next()) {
|
|
10534
|
+
var prefixedTransform = transforms_1_1.value;
|
|
10553
10535
|
|
|
10554
|
-
|
|
10555
|
-
|
|
10556
|
-
|
|
10557
|
-
|
|
10558
|
-
|
|
10559
|
-
|
|
10560
|
-
|
|
10561
|
-
|
|
10562
|
-
|
|
10563
|
-
|
|
10564
|
-
|
|
10565
|
-
|
|
10566
|
-
|
|
10567
|
-
|
|
10568
|
-
|
|
10569
|
-
var alignVal = typeof align === "object" ? align.camera : align;
|
|
10570
|
-
this._alignPos = parseAlign$1(alignVal, this.size);
|
|
10571
|
-
return this;
|
|
10572
|
-
};
|
|
10573
|
-
/**
|
|
10574
|
-
* Update Camera's {@link Camera#anchorPoints anchorPoints}
|
|
10575
|
-
* @ko Camera의 {@link Camera#anchorPoints anchorPoints}를 업데이트합니다
|
|
10576
|
-
* @throws {FlickingError}
|
|
10577
|
-
* {@link ERROR_CODE NOT_ATTACHED_TO_FLICKING} When {@link Camera#init init} is not called before
|
|
10578
|
-
* <ko>{@link ERROR_CODE NOT_ATTACHED_TO_FLICKING} {@link Camera#init init}이 이전에 호출되지 않은 경우</ko>
|
|
10579
|
-
* @chainable
|
|
10580
|
-
* @return {this}
|
|
10581
|
-
*/
|
|
10582
|
-
|
|
10583
|
-
|
|
10584
|
-
__proto.updateAnchors = function () {
|
|
10585
|
-
var flicking = getFlickingAttached(this._flicking);
|
|
10586
|
-
var panels = flicking.renderer.panels;
|
|
10587
|
-
this._anchors = panels.map(function (panel, index) {
|
|
10588
|
-
return new AnchorPoint({
|
|
10589
|
-
index: index,
|
|
10590
|
-
position: panel.position,
|
|
10591
|
-
panel: panel
|
|
10592
|
-
});
|
|
10593
|
-
});
|
|
10594
|
-
return this;
|
|
10595
|
-
};
|
|
10596
|
-
/**
|
|
10597
|
-
* Update Viewport's height to active panel's height
|
|
10598
|
-
* @ko 현재 선택된 패널의 높이와 동일하도록 뷰포트의 높이를 업데이트합니다
|
|
10599
|
-
* @throws {FlickingError}
|
|
10600
|
-
* {@link ERROR_CODE NOT_ATTACHED_TO_FLICKING} When {@link Camera#init init} is not called before
|
|
10601
|
-
* <ko>{@link ERROR_CODE NOT_ATTACHED_TO_FLICKING} {@link Camera#init init}이 이전에 호출되지 않은 경우</ko>
|
|
10602
|
-
* @chainable
|
|
10603
|
-
* @return {this}
|
|
10604
|
-
*/
|
|
10605
|
-
|
|
10606
|
-
|
|
10607
|
-
__proto.updateAdaptiveHeight = function () {
|
|
10608
|
-
var flicking = getFlickingAttached(this._flicking);
|
|
10609
|
-
var activePanel = flicking.control.activePanel;
|
|
10610
|
-
if (!flicking.horizontal || !flicking.adaptive || !activePanel) return;
|
|
10611
|
-
flicking.viewport.setSize({
|
|
10612
|
-
height: activePanel.height
|
|
10613
|
-
});
|
|
10614
|
-
};
|
|
10615
|
-
/**
|
|
10616
|
-
* Update current offset of the camera
|
|
10617
|
-
* @ko 현재 카메라의 오프셋을 업데이트합니다
|
|
10618
|
-
* @chainable
|
|
10619
|
-
* @return {this}
|
|
10620
|
-
*/
|
|
10621
|
-
|
|
10622
|
-
|
|
10623
|
-
__proto.updateOffset = function () {
|
|
10624
|
-
var flicking = getFlickingAttached(this._flicking);
|
|
10625
|
-
var position = this._position;
|
|
10626
|
-
var unRenderedPanels = flicking.panels.filter(function (panel) {
|
|
10627
|
-
return !panel.rendered;
|
|
10628
|
-
});
|
|
10629
|
-
this._offset = unRenderedPanels.filter(function (panel) {
|
|
10630
|
-
return panel.position + panel.offset < position;
|
|
10631
|
-
}).reduce(function (offset, panel) {
|
|
10632
|
-
return offset + panel.sizeIncludingMargin;
|
|
10633
|
-
}, 0);
|
|
10634
|
-
this.applyTransform();
|
|
10635
|
-
return this;
|
|
10636
|
-
};
|
|
10637
|
-
/**
|
|
10638
|
-
* Reset the history of {@link Flicking#event:needPanel needPanel} events so it can be triggered again
|
|
10639
|
-
* @ko 발생한 {@link Flicking#event:needPanel needPanel} 이벤트들을 초기화하여 다시 발생할 수 있도록 합니다
|
|
10640
|
-
* @chainable
|
|
10641
|
-
* @return {this}
|
|
10642
|
-
*/
|
|
10536
|
+
if (prefixedTransform in supportedStyle) {
|
|
10537
|
+
transformName = prefixedTransform;
|
|
10538
|
+
}
|
|
10539
|
+
}
|
|
10540
|
+
} catch (e_1_1) {
|
|
10541
|
+
e_1 = {
|
|
10542
|
+
error: e_1_1
|
|
10543
|
+
};
|
|
10544
|
+
} finally {
|
|
10545
|
+
try {
|
|
10546
|
+
if (transforms_1_1 && !transforms_1_1.done && (_a = transforms_1.return)) _a.call(transforms_1);
|
|
10547
|
+
} finally {
|
|
10548
|
+
if (e_1) throw e_1.error;
|
|
10549
|
+
}
|
|
10550
|
+
}
|
|
10643
10551
|
|
|
10552
|
+
if (!transformName) {
|
|
10553
|
+
throw new FlickingError(MESSAGE.TRANSFORM_NOT_SUPPORTED, CODE.TRANSFORM_NOT_SUPPORTED);
|
|
10554
|
+
}
|
|
10644
10555
|
|
|
10645
|
-
|
|
10646
|
-
this._needPanelTriggered = {
|
|
10647
|
-
prev: false,
|
|
10648
|
-
next: false
|
|
10556
|
+
_this._transform = transformName;
|
|
10649
10557
|
};
|
|
10650
|
-
return this;
|
|
10651
|
-
};
|
|
10652
|
-
/**
|
|
10653
|
-
* Apply "transform" style with the current position to camera element
|
|
10654
|
-
* @ko 현재 위치를 기준으로한 transform 스타일을 카메라 엘리먼트에 적용합니다.
|
|
10655
|
-
* @chainable
|
|
10656
|
-
* @return {this}
|
|
10657
|
-
*/
|
|
10658
10558
|
|
|
10559
|
+
this._flicking = null;
|
|
10659
10560
|
|
|
10660
|
-
|
|
10661
|
-
var el = this._el;
|
|
10662
|
-
var flicking = getFlickingAttached(this._flicking);
|
|
10663
|
-
var actualPosition = this._position - this._alignPos - this._offset;
|
|
10664
|
-
el.style[this._transform] = flicking.horizontal ? "translate(" + -actualPosition + "px)" : "translate(0, " + -actualPosition + "px)";
|
|
10665
|
-
return this;
|
|
10666
|
-
};
|
|
10561
|
+
this._resetInternalValues(); // Options
|
|
10667
10562
|
|
|
10668
|
-
__proto._resetInternalValues = function () {
|
|
10669
|
-
this._position = 0;
|
|
10670
|
-
this._alignPos = 0;
|
|
10671
|
-
this._offset = 0;
|
|
10672
|
-
this._range = {
|
|
10673
|
-
min: 0,
|
|
10674
|
-
max: 0
|
|
10675
|
-
};
|
|
10676
|
-
this._visiblePanels = [];
|
|
10677
|
-
this._anchors = [];
|
|
10678
|
-
this._needPanelTriggered = {
|
|
10679
|
-
prev: false,
|
|
10680
|
-
next: false
|
|
10681
|
-
};
|
|
10682
|
-
};
|
|
10683
10563
|
|
|
10684
|
-
|
|
10685
|
-
|
|
10564
|
+
this._align = align;
|
|
10565
|
+
}
|
|
10686
10566
|
|
|
10687
|
-
|
|
10688
|
-
|
|
10689
|
-
|
|
10690
|
-
|
|
10691
|
-
|
|
10692
|
-
|
|
10693
|
-
|
|
10694
|
-
|
|
10695
|
-
|
|
10696
|
-
|
|
10697
|
-
|
|
10698
|
-
return
|
|
10699
|
-
}
|
|
10567
|
+
var __proto = Camera.prototype;
|
|
10568
|
+
Object.defineProperty(__proto, "element", {
|
|
10569
|
+
// Internal states getter
|
|
10570
|
+
|
|
10571
|
+
/**
|
|
10572
|
+
* The camera element(`.flicking-camera`)
|
|
10573
|
+
* @ko 카메라 엘리먼트(`.flicking-camera`)
|
|
10574
|
+
* @type {HTMLElement}
|
|
10575
|
+
* @readonly
|
|
10576
|
+
*/
|
|
10577
|
+
get: function () {
|
|
10578
|
+
return this._el;
|
|
10579
|
+
},
|
|
10580
|
+
enumerable: false,
|
|
10581
|
+
configurable: true
|
|
10582
|
+
});
|
|
10583
|
+
Object.defineProperty(__proto, "children", {
|
|
10584
|
+
/**
|
|
10585
|
+
* An array of the child elements of the camera element(`.flicking-camera`)
|
|
10586
|
+
* @ko 카메라 엘리먼트(`.flicking-camera`)의 자식 엘리먼트 배열
|
|
10587
|
+
* @type {HTMLElement[]}
|
|
10588
|
+
* @readonly
|
|
10589
|
+
*/
|
|
10590
|
+
get: function () {
|
|
10591
|
+
return toArray$3(this._el.children);
|
|
10592
|
+
},
|
|
10593
|
+
enumerable: false,
|
|
10594
|
+
configurable: true
|
|
10595
|
+
});
|
|
10596
|
+
Object.defineProperty(__proto, "position", {
|
|
10597
|
+
/**
|
|
10598
|
+
* Current position of the camera
|
|
10599
|
+
* @ko Camera의 현재 좌표
|
|
10600
|
+
* @type {number}
|
|
10601
|
+
* @readonly
|
|
10602
|
+
*/
|
|
10603
|
+
get: function () {
|
|
10604
|
+
return this._position;
|
|
10605
|
+
},
|
|
10606
|
+
enumerable: false,
|
|
10607
|
+
configurable: true
|
|
10608
|
+
});
|
|
10609
|
+
Object.defineProperty(__proto, "alignPosition", {
|
|
10610
|
+
/**
|
|
10611
|
+
* Align position inside the viewport where {@link Panel}'s {@link Panel#alignPosition alignPosition} should be located at
|
|
10612
|
+
* @ko 패널의 정렬 기준 위치. 뷰포트 내에서 {@link Panel}의 {@link Panel#alignPosition alignPosition}이 위치해야 하는 곳입니다
|
|
10613
|
+
* @type {number}
|
|
10614
|
+
* @readonly
|
|
10615
|
+
*/
|
|
10616
|
+
get: function () {
|
|
10617
|
+
return this._alignPos;
|
|
10618
|
+
},
|
|
10619
|
+
enumerable: false,
|
|
10620
|
+
configurable: true
|
|
10621
|
+
});
|
|
10622
|
+
Object.defineProperty(__proto, "offset", {
|
|
10623
|
+
/**
|
|
10624
|
+
* Position offset, used for the {@link Flicking#renderOnlyVisible renderOnlyVisible} option
|
|
10625
|
+
* @ko Camera의 좌표 오프셋. {@link Flicking#renderOnlyVisible renderOnlyVisible} 옵션을 위해 사용됩니다.
|
|
10626
|
+
* @type {number}
|
|
10627
|
+
* @default 0
|
|
10628
|
+
* @readonly
|
|
10629
|
+
*/
|
|
10630
|
+
get: function () {
|
|
10631
|
+
return this._offset - this._circularOffset;
|
|
10632
|
+
},
|
|
10633
|
+
enumerable: false,
|
|
10634
|
+
configurable: true
|
|
10635
|
+
});
|
|
10636
|
+
Object.defineProperty(__proto, "circularEnabled", {
|
|
10637
|
+
/**
|
|
10638
|
+
* Whether the `circular` option is enabled.
|
|
10639
|
+
* The {@link Flicking#circular circular} option can't be enabled when sum of the panel sizes are too small.
|
|
10640
|
+
* @ko {@link Flicking#circular circular} 옵션이 활성화되었는지 여부를 나타내는 멤버 변수.
|
|
10641
|
+
* {@link Flicking#circular circular} 옵션은 패널의 크기의 합이 충분하지 않을 경우 비활성화됩니다.
|
|
10642
|
+
* @type {boolean}
|
|
10643
|
+
* @default false
|
|
10644
|
+
* @readonly
|
|
10645
|
+
*/
|
|
10646
|
+
get: function () {
|
|
10647
|
+
return this._circularEnabled;
|
|
10648
|
+
},
|
|
10649
|
+
enumerable: false,
|
|
10650
|
+
configurable: true
|
|
10651
|
+
});
|
|
10652
|
+
Object.defineProperty(__proto, "mode", {
|
|
10653
|
+
/**
|
|
10654
|
+
* A current camera mode
|
|
10655
|
+
* @type {CameraMode}
|
|
10656
|
+
* @readonly
|
|
10657
|
+
*/
|
|
10658
|
+
get: function () {
|
|
10659
|
+
return this._mode;
|
|
10660
|
+
},
|
|
10661
|
+
enumerable: false,
|
|
10662
|
+
configurable: true
|
|
10663
|
+
});
|
|
10664
|
+
Object.defineProperty(__proto, "range", {
|
|
10665
|
+
/**
|
|
10666
|
+
* A range that Camera's {@link Camera#position position} can reach
|
|
10667
|
+
* @ko Camera의 {@link Camera#position position}이 도달 가능한 범위
|
|
10668
|
+
* @type {object}
|
|
10669
|
+
* @property {number} min A minimum position<ko>최소 위치</ko>
|
|
10670
|
+
* @property {number} max A maximum position<ko>최대 위치</ko>
|
|
10671
|
+
* @readonly
|
|
10672
|
+
*/
|
|
10673
|
+
get: function () {
|
|
10674
|
+
return this._range;
|
|
10675
|
+
},
|
|
10676
|
+
enumerable: false,
|
|
10677
|
+
configurable: true
|
|
10678
|
+
});
|
|
10679
|
+
Object.defineProperty(__proto, "rangeDiff", {
|
|
10680
|
+
/**
|
|
10681
|
+
* A difference between Camera's minimum and maximum position that can reach
|
|
10682
|
+
* @ko Camera가 도달 가능한 최소/최대 좌표의 차이
|
|
10683
|
+
* @type {number}
|
|
10684
|
+
* @readonly
|
|
10685
|
+
*/
|
|
10686
|
+
get: function () {
|
|
10687
|
+
return this._range.max - this._range.min;
|
|
10688
|
+
},
|
|
10689
|
+
enumerable: false,
|
|
10690
|
+
configurable: true
|
|
10691
|
+
});
|
|
10692
|
+
Object.defineProperty(__proto, "visiblePanels", {
|
|
10693
|
+
/**
|
|
10694
|
+
* An array of visible panels from the current position
|
|
10695
|
+
* @ko 현재 보이는 패널들의 배열
|
|
10696
|
+
* @type {Panel[]}
|
|
10697
|
+
* @readonly
|
|
10698
|
+
*/
|
|
10699
|
+
get: function () {
|
|
10700
|
+
return this._visiblePanels;
|
|
10701
|
+
},
|
|
10702
|
+
enumerable: false,
|
|
10703
|
+
configurable: true
|
|
10704
|
+
});
|
|
10705
|
+
Object.defineProperty(__proto, "visibleRange", {
|
|
10706
|
+
/**
|
|
10707
|
+
* A range of the visible area from the current position
|
|
10708
|
+
* @ko 현재 위치에서 보이는 범위
|
|
10709
|
+
* @type {object}
|
|
10710
|
+
* @property {number} min A minimum position<ko>최소 위치</ko>
|
|
10711
|
+
* @property {number} min A maximum position<ko>최대 위치</ko>
|
|
10712
|
+
* @readonly
|
|
10713
|
+
*/
|
|
10714
|
+
get: function () {
|
|
10715
|
+
return {
|
|
10716
|
+
min: this._position - this._alignPos,
|
|
10717
|
+
max: this._position - this._alignPos + this.size
|
|
10718
|
+
};
|
|
10719
|
+
},
|
|
10720
|
+
enumerable: false,
|
|
10721
|
+
configurable: true
|
|
10722
|
+
});
|
|
10723
|
+
Object.defineProperty(__proto, "anchorPoints", {
|
|
10724
|
+
/**
|
|
10725
|
+
* An array of {@link AnchorPoint}s that Camera can be stopped at
|
|
10726
|
+
* @ko 카메라가 도달 가능한 {@link AnchorPoint}의 목록
|
|
10727
|
+
* @type {AnchorPoint[]}
|
|
10728
|
+
* @readonly
|
|
10729
|
+
*/
|
|
10730
|
+
get: function () {
|
|
10731
|
+
return this._anchors;
|
|
10732
|
+
},
|
|
10733
|
+
enumerable: false,
|
|
10734
|
+
configurable: true
|
|
10735
|
+
});
|
|
10736
|
+
Object.defineProperty(__proto, "controlParams", {
|
|
10737
|
+
/**
|
|
10738
|
+
* A current parameters of the Camera for updating {@link AxesController}
|
|
10739
|
+
* @ko {@link AxesController}를 업데이트하기 위한 현재 Camera 패러미터들
|
|
10740
|
+
* @type {ControlParams}
|
|
10741
|
+
* @readonly
|
|
10742
|
+
*/
|
|
10743
|
+
get: function () {
|
|
10744
|
+
return {
|
|
10745
|
+
range: this._range,
|
|
10746
|
+
position: this._position,
|
|
10747
|
+
circular: this._circularEnabled
|
|
10748
|
+
};
|
|
10749
|
+
},
|
|
10750
|
+
enumerable: false,
|
|
10751
|
+
configurable: true
|
|
10752
|
+
});
|
|
10753
|
+
Object.defineProperty(__proto, "atEdge", {
|
|
10754
|
+
/**
|
|
10755
|
+
* A Boolean value indicating whether Camera's over the minimum or maximum position reachable
|
|
10756
|
+
* @ko 현재 카메라가 도달 가능한 범위의 최소 혹은 최대점을 넘어섰는지를 나타냅니다
|
|
10757
|
+
* @type {boolean}
|
|
10758
|
+
* @readonly
|
|
10759
|
+
*/
|
|
10760
|
+
get: function () {
|
|
10761
|
+
return this._position <= this._range.min || this._position >= this._range.max;
|
|
10762
|
+
},
|
|
10763
|
+
enumerable: false,
|
|
10764
|
+
configurable: true
|
|
10765
|
+
});
|
|
10766
|
+
Object.defineProperty(__proto, "size", {
|
|
10767
|
+
/**
|
|
10768
|
+
* Return the size of the viewport
|
|
10769
|
+
* @ko 뷰포트 크기를 반환합니다
|
|
10770
|
+
* @type {number}
|
|
10771
|
+
* @readonly
|
|
10772
|
+
*/
|
|
10773
|
+
get: function () {
|
|
10774
|
+
var flicking = this._flicking;
|
|
10775
|
+
return flicking ? flicking.horizontal ? flicking.viewport.width : flicking.viewport.height : 0;
|
|
10776
|
+
},
|
|
10777
|
+
enumerable: false,
|
|
10778
|
+
configurable: true
|
|
10779
|
+
});
|
|
10780
|
+
Object.defineProperty(__proto, "progress", {
|
|
10781
|
+
/**
|
|
10782
|
+
* Return the camera's position progress from the first panel to last panel
|
|
10783
|
+
* Range is from 0 to last panel's index
|
|
10784
|
+
* @ko 첫번째 패널로부터 마지막 패널까지의 카메라 위치의 진행도를 반환합니다
|
|
10785
|
+
* 범위는 0부터 마지막 패널의 인덱스까지입니다
|
|
10786
|
+
* @type {number}
|
|
10787
|
+
* @readonly
|
|
10788
|
+
*/
|
|
10789
|
+
get: function () {
|
|
10790
|
+
var flicking = this._flicking;
|
|
10791
|
+
var position = this._position + this._offset;
|
|
10792
|
+
var nearestAnchor = this.findNearestAnchor(this._position);
|
|
10700
10793
|
|
|
10701
|
-
|
|
10702
|
-
|
|
10703
|
-
|
|
10704
|
-
added: added,
|
|
10705
|
-
removed: removed,
|
|
10706
|
-
visiblePanels: newVisiblePanels
|
|
10707
|
-
}));
|
|
10708
|
-
});
|
|
10709
|
-
}
|
|
10710
|
-
};
|
|
10794
|
+
if (!flicking || !nearestAnchor) {
|
|
10795
|
+
return NaN;
|
|
10796
|
+
}
|
|
10711
10797
|
|
|
10712
|
-
|
|
10713
|
-
|
|
10714
|
-
|
|
10715
|
-
|
|
10716
|
-
|
|
10798
|
+
var nearestPanel = nearestAnchor.panel;
|
|
10799
|
+
var panelPos = nearestPanel.position + nearestPanel.offset;
|
|
10800
|
+
var bounceSize = flicking.control.controller.bounce;
|
|
10801
|
+
var _a = this.range,
|
|
10802
|
+
prevRange = _a.min,
|
|
10803
|
+
nextRange = _a.max;
|
|
10804
|
+
var rangeDiff = this.rangeDiff;
|
|
10717
10805
|
|
|
10718
|
-
|
|
10719
|
-
|
|
10720
|
-
flicking.trigger(new ComponentEvent$1(EVENTS.NEED_PANEL, {
|
|
10721
|
-
direction: DIRECTION.PREV
|
|
10722
|
-
}));
|
|
10723
|
-
needPanelTriggered.prev = true;
|
|
10806
|
+
if (position === panelPos) {
|
|
10807
|
+
return nearestPanel.index;
|
|
10724
10808
|
}
|
|
10725
10809
|
|
|
10726
|
-
if (
|
|
10727
|
-
|
|
10728
|
-
|
|
10729
|
-
}));
|
|
10730
|
-
needPanelTriggered.next = true;
|
|
10731
|
-
}
|
|
10810
|
+
if (position < panelPos) {
|
|
10811
|
+
var prevPanel = nearestPanel.prev();
|
|
10812
|
+
var prevPosition = prevPanel ? prevPanel.position + prevPanel.offset : prevRange - bounceSize[0]; // Looped
|
|
10732
10813
|
|
|
10733
|
-
|
|
10734
|
-
|
|
10814
|
+
if (prevPosition > panelPos) {
|
|
10815
|
+
prevPosition -= rangeDiff;
|
|
10816
|
+
}
|
|
10735
10817
|
|
|
10736
|
-
|
|
10737
|
-
|
|
10738
|
-
|
|
10739
|
-
|
|
10740
|
-
var cameraPrev = cameraPosition - this._alignPos;
|
|
10741
|
-
var cameraNext = cameraPrev + cameraSize;
|
|
10742
|
-
var firstPanel = panels[0];
|
|
10743
|
-
var lastPanel = panels[panels.length - 1];
|
|
10818
|
+
return nearestPanel.index - 1 + getProgress(position, prevPosition, panelPos);
|
|
10819
|
+
} else {
|
|
10820
|
+
var nextPanel = nearestPanel.next();
|
|
10821
|
+
var nextPosition = nextPanel ? nextPanel.position + nextPanel.offset : nextRange + bounceSize[1]; // Looped
|
|
10744
10822
|
|
|
10745
|
-
|
|
10746
|
-
|
|
10823
|
+
if (nextPosition < panelPos) {
|
|
10824
|
+
nextPosition += rangeDiff;
|
|
10825
|
+
}
|
|
10747
10826
|
|
|
10748
|
-
|
|
10749
|
-
flicking.trigger(new ComponentEvent$1(EVENTS.NEED_PANEL, {
|
|
10750
|
-
direction: DIRECTION.PREV
|
|
10751
|
-
}));
|
|
10752
|
-
needPanelTriggered.prev = true;
|
|
10827
|
+
return nearestPanel.index + getProgress(position, panelPos, nextPosition);
|
|
10753
10828
|
}
|
|
10754
|
-
}
|
|
10829
|
+
},
|
|
10830
|
+
enumerable: false,
|
|
10831
|
+
configurable: true
|
|
10832
|
+
});
|
|
10833
|
+
Object.defineProperty(__proto, "align", {
|
|
10834
|
+
// Options Getter
|
|
10755
10835
|
|
|
10756
|
-
|
|
10757
|
-
|
|
10836
|
+
/**
|
|
10837
|
+
* A value indicating where the {@link Camera#alignPosition alignPosition} should be located at inside the viewport element
|
|
10838
|
+
* @ko {@link Camera#alignPosition alignPosition}이 뷰포트 엘리먼트 내의 어디에 위치해야 하는지를 나타내는 값
|
|
10839
|
+
* @type {ALIGN | string | number}
|
|
10840
|
+
*/
|
|
10841
|
+
get: function () {
|
|
10842
|
+
return this._align;
|
|
10843
|
+
},
|
|
10844
|
+
// Options Setter
|
|
10845
|
+
set: function (val) {
|
|
10846
|
+
this._align = val;
|
|
10847
|
+
},
|
|
10848
|
+
enumerable: false,
|
|
10849
|
+
configurable: true
|
|
10850
|
+
});
|
|
10851
|
+
/**
|
|
10852
|
+
* Initialize Camera
|
|
10853
|
+
* @ko Camera를 초기화합니다
|
|
10854
|
+
* @param {Flicking} flicking An instance of {@link Flicking}<ko>Flicking의 인스턴스</ko>
|
|
10855
|
+
* @chainable
|
|
10856
|
+
* @throws {FlickingError}
|
|
10857
|
+
* {@link ERROR_CODE VAL_MUST_NOT_NULL} If the camera element(`.flicking-camera`) does not exist inside viewport element
|
|
10858
|
+
* <ko>{@link ERROR_CODE VAL_MUST_NOT_NULL} 뷰포트 엘리먼트 내부에 카메라 엘리먼트(`.flicking-camera`)가 존재하지 않을 경우</ko>
|
|
10859
|
+
* @return {this}
|
|
10860
|
+
*/
|
|
10758
10861
|
|
|
10759
|
-
|
|
10760
|
-
|
|
10761
|
-
|
|
10762
|
-
|
|
10763
|
-
|
|
10764
|
-
}
|
|
10765
|
-
}
|
|
10766
|
-
};
|
|
10862
|
+
__proto.init = function (flicking) {
|
|
10863
|
+
this._flicking = flicking;
|
|
10864
|
+
var viewportEl = flicking.viewport.element;
|
|
10865
|
+
checkExistence(viewportEl.firstElementChild, "First element child of the viewport element");
|
|
10866
|
+
this._el = viewportEl.firstElementChild;
|
|
10767
10867
|
|
|
10768
|
-
|
|
10769
|
-
|
|
10770
|
-
|
|
10771
|
-
|
|
10772
|
-
|
|
10773
|
-
if (!wasBetweenRange || isBetweenRange) return;
|
|
10774
|
-
var direction = newPos <= range.min ? DIRECTION.PREV : DIRECTION.NEXT;
|
|
10775
|
-
flicking.trigger(new ComponentEvent$1(EVENTS.REACH_EDGE, {
|
|
10776
|
-
direction: direction
|
|
10777
|
-
}));
|
|
10868
|
+
this._checkTranslateSupport();
|
|
10869
|
+
|
|
10870
|
+
this._updateMode();
|
|
10871
|
+
|
|
10872
|
+
return this;
|
|
10778
10873
|
};
|
|
10874
|
+
/**
|
|
10875
|
+
* Destroy Camera and return to initial state
|
|
10876
|
+
* @ko Camera를 초기 상태로 되돌립니다
|
|
10877
|
+
* @return {void}
|
|
10878
|
+
*/
|
|
10779
10879
|
|
|
10780
|
-
return Camera;
|
|
10781
|
-
}();
|
|
10782
10880
|
|
|
10783
|
-
|
|
10784
|
-
|
|
10785
|
-
* @ko 첫번째 패널의 좌표로부터 마지막 패널의 좌표로까지 이동할 수 있는 종류의 {@link Camera}
|
|
10786
|
-
*/
|
|
10881
|
+
__proto.destroy = function () {
|
|
10882
|
+
this._flicking = null;
|
|
10787
10883
|
|
|
10788
|
-
|
|
10789
|
-
/*#__PURE__*/
|
|
10790
|
-
function (_super) {
|
|
10791
|
-
__extends$2(LinearCamera, _super);
|
|
10884
|
+
this._resetInternalValues();
|
|
10792
10885
|
|
|
10793
|
-
|
|
10794
|
-
|
|
10795
|
-
}
|
|
10886
|
+
return this;
|
|
10887
|
+
};
|
|
10796
10888
|
/**
|
|
10797
|
-
*
|
|
10798
|
-
* @ko
|
|
10799
|
-
* @
|
|
10889
|
+
* Move to the given position and apply CSS transform
|
|
10890
|
+
* @ko 해당 좌표로 이동하고, CSS transform을 적용합니다
|
|
10891
|
+
* @param {number} pos A new position<ko>움직일 위치</ko>
|
|
10800
10892
|
* @throws {FlickingError}
|
|
10801
10893
|
* {@link ERROR_CODE NOT_ATTACHED_TO_FLICKING} When {@link Camera#init init} is not called before
|
|
10802
10894
|
* <ko>{@link ERROR_CODE NOT_ATTACHED_TO_FLICKING} {@link Camera#init init}이 이전에 호출되지 않은 경우</ko>
|
|
@@ -10804,170 +10896,190 @@ version: 4.4.1
|
|
|
10804
10896
|
*/
|
|
10805
10897
|
|
|
10806
10898
|
|
|
10807
|
-
|
|
10808
|
-
|
|
10809
|
-
__proto.updateRange = function () {
|
|
10810
|
-
var _a, _b;
|
|
10899
|
+
__proto.lookAt = function (pos) {
|
|
10900
|
+
var _this = this;
|
|
10811
10901
|
|
|
10812
10902
|
var flicking = getFlickingAttached(this._flicking);
|
|
10813
|
-
var
|
|
10814
|
-
|
|
10815
|
-
var lastPanel = renderer.getPanel(renderer.panelCount - 1);
|
|
10816
|
-
this._range = {
|
|
10817
|
-
min: (_a = firstPanel === null || firstPanel === void 0 ? void 0 : firstPanel.position) !== null && _a !== void 0 ? _a : 0,
|
|
10818
|
-
max: (_b = lastPanel === null || lastPanel === void 0 ? void 0 : lastPanel.position) !== null && _b !== void 0 ? _b : 0
|
|
10819
|
-
};
|
|
10820
|
-
return this;
|
|
10821
|
-
};
|
|
10903
|
+
var prevPos = this._position;
|
|
10904
|
+
this._position = pos;
|
|
10822
10905
|
|
|
10823
|
-
|
|
10824
|
-
}(Camera$1);
|
|
10906
|
+
var toggled = this._togglePanels(prevPos, pos);
|
|
10825
10907
|
|
|
10826
|
-
|
|
10827
|
-
* A {@link Camera} that connects the last panel and the first panel, enabling continuous loop
|
|
10828
|
-
* @ko 첫번째 패널과 마지막 패널이 이어진 상태로, 무한히 회전할 수 있는 종류의 {@link Camera}
|
|
10829
|
-
*/
|
|
10908
|
+
this._refreshVisiblePanels();
|
|
10830
10909
|
|
|
10831
|
-
|
|
10832
|
-
/*#__PURE__*/
|
|
10833
|
-
function (_super) {
|
|
10834
|
-
__extends$2(CircularCamera, _super);
|
|
10910
|
+
this._checkNeedPanel();
|
|
10835
10911
|
|
|
10836
|
-
|
|
10837
|
-
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
10912
|
+
this._checkReachEnd(prevPos, pos);
|
|
10838
10913
|
|
|
10839
|
-
|
|
10840
|
-
|
|
10841
|
-
|
|
10842
|
-
|
|
10914
|
+
this.applyTransform();
|
|
10915
|
+
|
|
10916
|
+
if (toggled) {
|
|
10917
|
+
void flicking.renderer.render().then(function () {
|
|
10918
|
+
_this.updateOffset();
|
|
10919
|
+
});
|
|
10920
|
+
}
|
|
10921
|
+
};
|
|
10922
|
+
/**
|
|
10923
|
+
* Return a previous {@link AnchorPoint} of given {@link AnchorPoint}
|
|
10924
|
+
* If it does not exist, return `null` instead
|
|
10925
|
+
* @ko 주어진 {@link AnchorPoint}의 이전 {@link AnchorPoint}를 반환합니다
|
|
10926
|
+
* 존재하지 않을 경우 `null`을 반환합니다
|
|
10927
|
+
* @param {AnchorPoint} anchor A reference {@link AnchorPoint}<ko>기준 {@link AnchorPoint}</ko>
|
|
10928
|
+
* @return {AnchorPoint | null} The previous {@link AnchorPoint}<ko>이전 {@link AnchorPoint}</ko>
|
|
10929
|
+
*/
|
|
10843
10930
|
|
|
10844
|
-
var __proto = CircularCamera.prototype;
|
|
10845
|
-
Object.defineProperty(__proto, "offset", {
|
|
10846
|
-
get: function () {
|
|
10847
|
-
return this._offset - this._circularOffset;
|
|
10848
|
-
},
|
|
10849
|
-
enumerable: false,
|
|
10850
|
-
configurable: true
|
|
10851
|
-
});
|
|
10852
|
-
Object.defineProperty(__proto, "controlParams", {
|
|
10853
|
-
get: function () {
|
|
10854
|
-
return {
|
|
10855
|
-
range: this._range,
|
|
10856
|
-
position: this._position,
|
|
10857
|
-
circular: this._circularEnabled
|
|
10858
|
-
};
|
|
10859
|
-
},
|
|
10860
|
-
enumerable: false,
|
|
10861
|
-
configurable: true
|
|
10862
|
-
});
|
|
10863
10931
|
|
|
10864
10932
|
__proto.getPrevAnchor = function (anchor) {
|
|
10865
|
-
if (!this._circularEnabled || anchor.index !== 0)
|
|
10933
|
+
if (!this._circularEnabled || anchor.index !== 0) {
|
|
10934
|
+
return this._anchors[anchor.index - 1] || null;
|
|
10935
|
+
} else {
|
|
10936
|
+
var anchors = this._anchors;
|
|
10937
|
+
var rangeDiff = this.rangeDiff;
|
|
10938
|
+
var lastAnchor = anchors[anchors.length - 1];
|
|
10939
|
+
return new AnchorPoint({
|
|
10940
|
+
index: lastAnchor.index,
|
|
10941
|
+
position: lastAnchor.position - rangeDiff,
|
|
10942
|
+
panel: lastAnchor.panel
|
|
10943
|
+
});
|
|
10944
|
+
}
|
|
10945
|
+
};
|
|
10946
|
+
/**
|
|
10947
|
+
* Return a next {@link AnchorPoint} of given {@link AnchorPoint}
|
|
10948
|
+
* If it does not exist, return `null` instead
|
|
10949
|
+
* @ko 주어진 {@link AnchorPoint}의 다음 {@link AnchorPoint}를 반환합니다
|
|
10950
|
+
* 존재하지 않을 경우 `null`을 반환합니다
|
|
10951
|
+
* @param {AnchorPoint} anchor A reference {@link AnchorPoint}<ko>기준 {@link AnchorPoint}</ko>
|
|
10952
|
+
* @return {AnchorPoint | null} The next {@link AnchorPoint}<ko>다음 {@link AnchorPoint}</ko>
|
|
10953
|
+
*/
|
|
10954
|
+
|
|
10955
|
+
|
|
10956
|
+
__proto.getNextAnchor = function (anchor) {
|
|
10866
10957
|
var anchors = this._anchors;
|
|
10867
|
-
|
|
10868
|
-
|
|
10869
|
-
|
|
10870
|
-
|
|
10871
|
-
|
|
10872
|
-
|
|
10873
|
-
|
|
10958
|
+
|
|
10959
|
+
if (!this._circularEnabled || anchor.index !== anchors.length - 1) {
|
|
10960
|
+
return anchors[anchor.index + 1] || null;
|
|
10961
|
+
} else {
|
|
10962
|
+
var rangeDiff = this.rangeDiff;
|
|
10963
|
+
var firstAnchor = anchors[0];
|
|
10964
|
+
return new AnchorPoint({
|
|
10965
|
+
index: firstAnchor.index,
|
|
10966
|
+
position: firstAnchor.position + rangeDiff,
|
|
10967
|
+
panel: firstAnchor.panel
|
|
10968
|
+
});
|
|
10969
|
+
}
|
|
10874
10970
|
};
|
|
10971
|
+
/**
|
|
10972
|
+
* Return the camera's position progress in the panel below
|
|
10973
|
+
* Value is from 0 to 1 when the camera's inside panel
|
|
10974
|
+
* Value can be lower than 0 or bigger than 1 when it's in the margin area
|
|
10975
|
+
* @ko 현재 카메라 아래 패널에서의 위치 진행도를 반환합니다
|
|
10976
|
+
* 반환값은 카메라가 패널 내부에 있을 경우 0부터 1까지의 값을 갖습니다
|
|
10977
|
+
* 패널의 margin 영역에 있을 경우 0보다 작거나 1보다 큰 값을 반환할 수 있습니다
|
|
10978
|
+
*/
|
|
10875
10979
|
|
|
10876
|
-
|
|
10877
|
-
|
|
10878
|
-
|
|
10879
|
-
|
|
10880
|
-
var firstAnchor = anchors[0];
|
|
10881
|
-
return new AnchorPoint({
|
|
10882
|
-
index: firstAnchor.index,
|
|
10883
|
-
position: firstAnchor.position + rangeDiff,
|
|
10884
|
-
panel: firstAnchor.panel
|
|
10885
|
-
});
|
|
10980
|
+
|
|
10981
|
+
__proto.getProgressInPanel = function (panel) {
|
|
10982
|
+
var panelRange = panel.range;
|
|
10983
|
+
return (this._position - panelRange.min) / (panelRange.max - panelRange.min);
|
|
10886
10984
|
};
|
|
10985
|
+
/**
|
|
10986
|
+
* Return {@link AnchorPoint} that includes given position
|
|
10987
|
+
* If there's no {@link AnchorPoint} that includes the given position, return `null` instead
|
|
10988
|
+
* @ko 주어진 좌표를 포함하는 {@link AnchorPoint}를 반환합니다
|
|
10989
|
+
* 주어진 좌표를 포함하는 {@link AnchorPoint}가 없을 경우 `null`을 반환합니다
|
|
10990
|
+
* @param {number} position A position to check<ko>확인할 좌표</ko>
|
|
10991
|
+
* @return {AnchorPoint | null} The {@link AnchorPoint} that includes the given position<ko>해당 좌표를 포함하는 {@link AnchorPoint}</ko>
|
|
10992
|
+
*/
|
|
10993
|
+
|
|
10887
10994
|
|
|
10888
10995
|
__proto.findAnchorIncludePosition = function (position) {
|
|
10889
|
-
|
|
10890
|
-
|
|
10996
|
+
return this._mode.findAnchorIncludePosition(position);
|
|
10997
|
+
};
|
|
10998
|
+
/**
|
|
10999
|
+
* Return {@link AnchorPoint} nearest to given position
|
|
11000
|
+
* If there're no {@link AnchorPoint}s, return `null` instead
|
|
11001
|
+
* @ko 해당 좌표에서 가장 가까운 {@link AnchorPoint}를 반환합니다
|
|
11002
|
+
* {@link AnchorPoint}가 하나도 없을 경우 `null`을 반환합니다
|
|
11003
|
+
* @param {number} position A position to check<ko>확인할 좌표</ko>
|
|
11004
|
+
* @return {AnchorPoint | null} The {@link AnchorPoint} nearest to the given position<ko>해당 좌표에 가장 인접한 {@link AnchorPoint}</ko>
|
|
11005
|
+
*/
|
|
11006
|
+
|
|
11007
|
+
|
|
11008
|
+
__proto.findNearestAnchor = function (position) {
|
|
10891
11009
|
var anchors = this._anchors;
|
|
10892
|
-
|
|
10893
|
-
var
|
|
10894
|
-
var positionInRange = circulatePosition(position, range.min, range.max);
|
|
11010
|
+
if (anchors.length <= 0) return null;
|
|
11011
|
+
var prevDist = Infinity;
|
|
10895
11012
|
|
|
10896
|
-
var
|
|
11013
|
+
for (var anchorIdx = 0; anchorIdx < anchors.length; anchorIdx++) {
|
|
11014
|
+
var anchor = anchors[anchorIdx];
|
|
11015
|
+
var dist = Math.abs(anchor.position - position);
|
|
10897
11016
|
|
|
10898
|
-
|
|
10899
|
-
|
|
10900
|
-
|
|
10901
|
-
|
|
10902
|
-
panel: anchors[0].panel
|
|
10903
|
-
}), new AnchorPoint({
|
|
10904
|
-
index: anchorCount - 1,
|
|
10905
|
-
position: anchors[anchorCount - 1].position - rangeDiff,
|
|
10906
|
-
panel: anchors[anchorCount - 1].panel
|
|
10907
|
-
})].filter(function (anchor) {
|
|
10908
|
-
return !!anchor;
|
|
10909
|
-
});
|
|
10910
|
-
anchorInRange = possibleAnchors.reduce(function (nearest, anchor) {
|
|
10911
|
-
if (!nearest) return anchor;
|
|
10912
|
-
return Math.abs(nearest.position - position) < Math.abs(anchor.position - position) ? nearest : anchor;
|
|
10913
|
-
}, null);
|
|
10914
|
-
}
|
|
11017
|
+
if (dist > prevDist) {
|
|
11018
|
+
// Return previous anchor
|
|
11019
|
+
return anchors[anchorIdx - 1];
|
|
11020
|
+
}
|
|
10915
11021
|
|
|
10916
|
-
|
|
11022
|
+
prevDist = dist;
|
|
11023
|
+
} // Return last anchor
|
|
10917
11024
|
|
|
10918
|
-
if (position < range.min) {
|
|
10919
|
-
var loopCount = -Math.floor((range.min - position) / rangeDiff) - 1;
|
|
10920
|
-
return new AnchorPoint({
|
|
10921
|
-
index: anchorInRange.index,
|
|
10922
|
-
position: anchorInRange.position + rangeDiff * loopCount,
|
|
10923
|
-
panel: anchorInRange.panel
|
|
10924
|
-
});
|
|
10925
|
-
} else if (position > range.max) {
|
|
10926
|
-
var loopCount = Math.floor((position - range.max) / rangeDiff) + 1;
|
|
10927
|
-
return new AnchorPoint({
|
|
10928
|
-
index: anchorInRange.index,
|
|
10929
|
-
position: anchorInRange.position + rangeDiff * loopCount,
|
|
10930
|
-
panel: anchorInRange.panel
|
|
10931
|
-
});
|
|
10932
|
-
}
|
|
10933
11025
|
|
|
10934
|
-
return
|
|
11026
|
+
return anchors[anchors.length - 1];
|
|
10935
11027
|
};
|
|
11028
|
+
/**
|
|
11029
|
+
* Return {@link AnchorPoint} that matches {@link Flicking#currentPanel}
|
|
11030
|
+
* @ko 현재 {@link Flicking#currentPanel}에 해당하는 {@link AnchorPoint}를 반환합니다
|
|
11031
|
+
* @return {AnchorPoint | null}
|
|
11032
|
+
*/
|
|
10936
11033
|
|
|
10937
|
-
__proto.clampToReachablePosition = function (position) {
|
|
10938
|
-
// Basically all position is reachable for circular camera
|
|
10939
|
-
return this._circularEnabled ? position : _super.prototype.clampToReachablePosition.call(this, position);
|
|
10940
|
-
};
|
|
10941
11034
|
|
|
10942
|
-
__proto.
|
|
10943
|
-
|
|
10944
|
-
|
|
10945
|
-
|
|
11035
|
+
__proto.findActiveAnchor = function () {
|
|
11036
|
+
var flicking = getFlickingAttached(this._flicking);
|
|
11037
|
+
var activeIndex = flicking.control.activeIndex;
|
|
11038
|
+
return find$1(this._anchors, function (anchor) {
|
|
11039
|
+
return anchor.panel.index === activeIndex;
|
|
11040
|
+
});
|
|
10946
11041
|
};
|
|
11042
|
+
/**
|
|
11043
|
+
* Clamp the given position between camera's range
|
|
11044
|
+
* @ko 주어진 좌표를 Camera가 도달 가능한 범위 사이의 값으로 만듭니다
|
|
11045
|
+
* @param {number} position A position to clamp<ko>범위를 제한할 좌표</ko>
|
|
11046
|
+
* @return {number} A clamped position<ko>범위 제한된 좌표</ko>
|
|
11047
|
+
*/
|
|
10947
11048
|
|
|
10948
|
-
__proto.canSee = function (panel) {
|
|
10949
|
-
var range = this._range;
|
|
10950
|
-
var rangeDiff = this.rangeDiff;
|
|
10951
|
-
var visibleRange = this.visibleRange;
|
|
10952
11049
|
|
|
10953
|
-
|
|
11050
|
+
__proto.clampToReachablePosition = function (position) {
|
|
11051
|
+
return this._mode.clampToReachablePosition(position);
|
|
11052
|
+
};
|
|
11053
|
+
/**
|
|
11054
|
+
* Check whether the given panel is inside of the Camera's range
|
|
11055
|
+
* @ko 해당 {@link Panel}이 Camera가 도달 가능한 범위 내에 있는지를 반환합니다
|
|
11056
|
+
* @param panel An instance of {@link Panel} to check<ko>확인할 {@link Panel}의 인스턴스</ko>
|
|
11057
|
+
* @return {boolean} Whether the panel's inside Camera's range<ko>도달 가능한 범위 내에 해당 패널이 존재하는지 여부</ko>
|
|
11058
|
+
*/
|
|
10954
11059
|
|
|
10955
|
-
if (!this._circularEnabled) {
|
|
10956
|
-
return visibleInCurrentRange;
|
|
10957
|
-
} // Check looped visible area for circular case
|
|
10958
11060
|
|
|
11061
|
+
__proto.canReach = function (panel) {
|
|
11062
|
+
return this._mode.canReach(panel);
|
|
11063
|
+
};
|
|
11064
|
+
/**
|
|
11065
|
+
* Check whether the given panel element is visible at the current position
|
|
11066
|
+
* @ko 현재 좌표에서 해당 패널 엘리먼트를 볼 수 있는지 여부를 반환합니다
|
|
11067
|
+
* @param panel An instance of {@link Panel} to check<ko>확인할 {@link Panel}의 인스턴스</ko>
|
|
11068
|
+
* @return Whether the panel element is visible at the current position<ko>현재 위치에서 해당 패널 엘리먼트가 보이는지 여부</ko>
|
|
11069
|
+
*/
|
|
10959
11070
|
|
|
10960
|
-
if (visibleRange.min < range.min) {
|
|
10961
|
-
return visibleInCurrentRange || panel.isVisibleOnRange(visibleRange.min + rangeDiff, visibleRange.max + rangeDiff);
|
|
10962
|
-
} else if (visibleRange.max > range.max) {
|
|
10963
|
-
return visibleInCurrentRange || panel.isVisibleOnRange(visibleRange.min - rangeDiff, visibleRange.max - rangeDiff);
|
|
10964
|
-
}
|
|
10965
11071
|
|
|
10966
|
-
|
|
11072
|
+
__proto.canSee = function (panel) {
|
|
11073
|
+
return this._mode.canSee(panel);
|
|
10967
11074
|
};
|
|
10968
11075
|
/**
|
|
10969
11076
|
* Update {@link Camera#range range} of Camera
|
|
10970
11077
|
* @ko Camera의 {@link Camera#range range}를 업데이트합니다
|
|
11078
|
+
* @method
|
|
11079
|
+
* @abstract
|
|
11080
|
+
* @memberof Camera
|
|
11081
|
+
* @instance
|
|
11082
|
+
* @name updateRange
|
|
10971
11083
|
* @chainable
|
|
10972
11084
|
* @throws {FlickingError}
|
|
10973
11085
|
* {@link ERROR_CODE NOT_ATTACHED_TO_FLICKING} When {@link Camera#init init} is not called before
|
|
@@ -10981,287 +11093,269 @@ version: 4.4.1
|
|
|
10981
11093
|
var renderer = flicking.renderer;
|
|
10982
11094
|
var panels = renderer.panels;
|
|
10983
11095
|
|
|
10984
|
-
|
|
10985
|
-
this._resetInternalValues();
|
|
10986
|
-
|
|
10987
|
-
return this;
|
|
10988
|
-
}
|
|
11096
|
+
this._updateMode();
|
|
10989
11097
|
|
|
10990
|
-
|
|
10991
|
-
var lastPanel = panels[panels.length - 1];
|
|
10992
|
-
var firstPanelPrev = firstPanel.range.min - firstPanel.margin.prev;
|
|
10993
|
-
var lastPanelNext = lastPanel.range.max + lastPanel.margin.next;
|
|
10994
|
-
var visibleSize = this.size;
|
|
10995
|
-
var panelSizeSum = lastPanelNext - firstPanelPrev;
|
|
10996
|
-
var canSetCircularMode = panels.every(function (panel) {
|
|
10997
|
-
return panelSizeSum - panel.size >= visibleSize;
|
|
10998
|
-
});
|
|
10999
|
-
this._circularEnabled = canSetCircularMode;
|
|
11098
|
+
this._range = this._mode.getRange();
|
|
11000
11099
|
|
|
11001
|
-
if (
|
|
11002
|
-
this._range = {
|
|
11003
|
-
min: firstPanelPrev,
|
|
11004
|
-
max: lastPanelNext
|
|
11005
|
-
};
|
|
11100
|
+
if (this._circularEnabled) {
|
|
11006
11101
|
panels.forEach(function (panel) {
|
|
11007
11102
|
return panel.updateCircularToggleDirection();
|
|
11008
11103
|
});
|
|
11009
|
-
} else {
|
|
11010
|
-
this._range = {
|
|
11011
|
-
min: firstPanel.position,
|
|
11012
|
-
max: lastPanel.position
|
|
11013
|
-
};
|
|
11014
11104
|
}
|
|
11015
11105
|
|
|
11016
11106
|
this.updateOffset();
|
|
11017
11107
|
return this;
|
|
11018
11108
|
};
|
|
11109
|
+
/**
|
|
11110
|
+
* Update Camera's {@link Camera#alignPosition alignPosition}
|
|
11111
|
+
* @ko Camera의 {@link Camera#alignPosition alignPosition}을 업데이트합니다
|
|
11112
|
+
* @chainable
|
|
11113
|
+
* @return {this}
|
|
11114
|
+
*/
|
|
11019
11115
|
|
|
11020
|
-
__proto.updateOffset = function () {
|
|
11021
|
-
this._updateCircularOffset();
|
|
11022
11116
|
|
|
11023
|
-
|
|
11117
|
+
__proto.updateAlignPos = function () {
|
|
11118
|
+
var align = this._align;
|
|
11119
|
+
var alignVal = typeof align === "object" ? align.camera : align;
|
|
11120
|
+
this._alignPos = parseAlign$1(alignVal, this.size);
|
|
11121
|
+
return this;
|
|
11024
11122
|
};
|
|
11123
|
+
/**
|
|
11124
|
+
* Update Camera's {@link Camera#anchorPoints anchorPoints}
|
|
11125
|
+
* @ko Camera의 {@link Camera#anchorPoints anchorPoints}를 업데이트합니다
|
|
11126
|
+
* @throws {FlickingError}
|
|
11127
|
+
* {@link ERROR_CODE NOT_ATTACHED_TO_FLICKING} When {@link Camera#init init} is not called before
|
|
11128
|
+
* <ko>{@link ERROR_CODE NOT_ATTACHED_TO_FLICKING} {@link Camera#init init}이 이전에 호출되지 않은 경우</ko>
|
|
11129
|
+
* @chainable
|
|
11130
|
+
* @return {this}
|
|
11131
|
+
*/
|
|
11025
11132
|
|
|
11026
|
-
__proto.lookAt = function (pos) {
|
|
11027
|
-
var _this = this;
|
|
11028
|
-
|
|
11029
|
-
var flicking = getFlickingAttached(this._flicking);
|
|
11030
|
-
var prevPos = this._position;
|
|
11031
|
-
if (pos === prevPos) return _super.prototype.lookAt.call(this, pos);
|
|
11032
|
-
var panels = flicking.renderer.panels;
|
|
11033
|
-
var toggled = panels.map(function (panel) {
|
|
11034
|
-
return panel.toggle(prevPos, pos);
|
|
11035
|
-
});
|
|
11036
|
-
this._position = pos;
|
|
11037
|
-
|
|
11038
|
-
_super.prototype.lookAt.call(this, pos);
|
|
11039
|
-
|
|
11040
|
-
if (toggled.some(function (isToggled) {
|
|
11041
|
-
return isToggled;
|
|
11042
|
-
})) {
|
|
11043
|
-
void flicking.renderer.render().then(function () {
|
|
11044
|
-
_this.updateOffset();
|
|
11045
|
-
});
|
|
11046
|
-
}
|
|
11047
|
-
};
|
|
11048
11133
|
|
|
11049
|
-
__proto.
|
|
11050
|
-
|
|
11051
|
-
var flicking = getFlickingAttached(this._flicking);
|
|
11052
|
-
var actualPosition = this._position - this._alignPos - this._offset + this._circularOffset;
|
|
11053
|
-
el.style[this._transform] = flicking.horizontal ? "translate(" + -actualPosition + "px)" : "translate(0, " + -actualPosition + "px)";
|
|
11134
|
+
__proto.updateAnchors = function () {
|
|
11135
|
+
this._anchors = this._mode.getAnchors();
|
|
11054
11136
|
return this;
|
|
11055
11137
|
};
|
|
11138
|
+
/**
|
|
11139
|
+
* Update Viewport's height to active panel's height
|
|
11140
|
+
* @ko 현재 선택된 패널의 높이와 동일하도록 뷰포트의 높이를 업데이트합니다
|
|
11141
|
+
* @throws {FlickingError}
|
|
11142
|
+
* {@link ERROR_CODE NOT_ATTACHED_TO_FLICKING} When {@link Camera#init init} is not called before
|
|
11143
|
+
* <ko>{@link ERROR_CODE NOT_ATTACHED_TO_FLICKING} {@link Camera#init init}이 이전에 호출되지 않은 경우</ko>
|
|
11144
|
+
* @chainable
|
|
11145
|
+
* @return {this}
|
|
11146
|
+
*/
|
|
11056
11147
|
|
|
11057
|
-
__proto._resetInternalValues = function () {
|
|
11058
|
-
_super.prototype._resetInternalValues.call(this);
|
|
11059
|
-
|
|
11060
|
-
this._circularOffset = 0;
|
|
11061
|
-
this._circularEnabled = false;
|
|
11062
|
-
};
|
|
11063
11148
|
|
|
11064
|
-
__proto.
|
|
11065
|
-
|
|
11066
|
-
|
|
11067
|
-
|
|
11149
|
+
__proto.updateAdaptiveHeight = function () {
|
|
11150
|
+
var flicking = getFlickingAttached(this._flicking);
|
|
11151
|
+
var activePanel = flicking.control.activePanel;
|
|
11152
|
+
if (!flicking.horizontal || !flicking.adaptive || !activePanel) return;
|
|
11153
|
+
flicking.viewport.setSize({
|
|
11154
|
+
height: activePanel.height
|
|
11155
|
+
});
|
|
11068
11156
|
};
|
|
11157
|
+
/**
|
|
11158
|
+
* Update current offset of the camera
|
|
11159
|
+
* @ko 현재 카메라의 오프셋을 업데이트합니다
|
|
11160
|
+
* @chainable
|
|
11161
|
+
* @return {this}
|
|
11162
|
+
*/
|
|
11069
11163
|
|
|
11070
|
-
__proto._updateCircularOffset = function () {
|
|
11071
|
-
if (!this._circularEnabled) {
|
|
11072
|
-
this._circularOffset = 0;
|
|
11073
|
-
return;
|
|
11074
|
-
}
|
|
11075
11164
|
|
|
11165
|
+
__proto.updateOffset = function () {
|
|
11076
11166
|
var flicking = getFlickingAttached(this._flicking);
|
|
11077
|
-
var
|
|
11078
|
-
|
|
11079
|
-
|
|
11080
|
-
var toggledPrev = toggled.filter(function (panel) {
|
|
11081
|
-
return panel.toggleDirection === DIRECTION.PREV;
|
|
11082
|
-
});
|
|
11083
|
-
var toggledNext = toggled.filter(function (panel) {
|
|
11084
|
-
return panel.toggleDirection === DIRECTION.NEXT;
|
|
11167
|
+
var position = this._position;
|
|
11168
|
+
var unRenderedPanels = flicking.panels.filter(function (panel) {
|
|
11169
|
+
return !panel.rendered;
|
|
11085
11170
|
});
|
|
11086
|
-
this.
|
|
11171
|
+
this._offset = unRenderedPanels.filter(function (panel) {
|
|
11172
|
+
return panel.position + panel.offset < position;
|
|
11173
|
+
}).reduce(function (offset, panel) {
|
|
11174
|
+
return offset + panel.sizeIncludingMargin;
|
|
11175
|
+
}, 0);
|
|
11176
|
+
this._circularOffset = this._mode.getCircularOffset();
|
|
11177
|
+
this.applyTransform();
|
|
11178
|
+
return this;
|
|
11087
11179
|
};
|
|
11180
|
+
/**
|
|
11181
|
+
* Reset the history of {@link Flicking#event:needPanel needPanel} events so it can be triggered again
|
|
11182
|
+
* @ko 발생한 {@link Flicking#event:needPanel needPanel} 이벤트들을 초기화하여 다시 발생할 수 있도록 합니다
|
|
11183
|
+
* @chainable
|
|
11184
|
+
* @return {this}
|
|
11185
|
+
*/
|
|
11088
11186
|
|
|
11089
|
-
return CircularCamera;
|
|
11090
|
-
}(Camera$1);
|
|
11091
|
-
|
|
11092
|
-
/**
|
|
11093
|
-
* A {@link Camera} that set range not to go out of the first/last panel, so it won't show empty spaces before/after the first/last panel
|
|
11094
|
-
* @ko 첫번째와 마지막 패널 밖으로 넘어가지 못하도록 범위를 설정하여, 첫번째/마지막 패널 전/후의 빈 공간을 보이지 않도록 하는 종류의 {@link Camera}
|
|
11095
|
-
*/
|
|
11096
|
-
|
|
11097
|
-
var BoundCamera =
|
|
11098
|
-
/*#__PURE__*/
|
|
11099
|
-
function (_super) {
|
|
11100
|
-
__extends$2(BoundCamera, _super);
|
|
11101
11187
|
|
|
11102
|
-
function
|
|
11103
|
-
|
|
11104
|
-
|
|
11188
|
+
__proto.resetNeedPanelHistory = function () {
|
|
11189
|
+
this._needPanelTriggered = {
|
|
11190
|
+
prev: false,
|
|
11191
|
+
next: false
|
|
11192
|
+
};
|
|
11193
|
+
return this;
|
|
11194
|
+
};
|
|
11105
11195
|
/**
|
|
11106
|
-
*
|
|
11107
|
-
* @ko
|
|
11196
|
+
* Apply "transform" style with the current position to camera element
|
|
11197
|
+
* @ko 현재 위치를 기준으로한 transform 스타일을 카메라 엘리먼트에 적용합니다.
|
|
11108
11198
|
* @chainable
|
|
11109
|
-
* @throws {FlickingError}
|
|
11110
|
-
* {@link ERROR_CODE NOT_ATTACHED_TO_FLICKING} When {@link Camera#init init} is not called before
|
|
11111
|
-
* <ko>{@link ERROR_CODE NOT_ATTACHED_TO_FLICKING} {@link Camera#init init}이 이전에 호출되지 않은 경우</ko>
|
|
11112
11199
|
* @return {this}
|
|
11113
11200
|
*/
|
|
11114
11201
|
|
|
11115
11202
|
|
|
11116
|
-
|
|
11117
|
-
|
|
11118
|
-
__proto.updateRange = function () {
|
|
11203
|
+
__proto.applyTransform = function () {
|
|
11204
|
+
var el = this._el;
|
|
11119
11205
|
var flicking = getFlickingAttached(this._flicking);
|
|
11120
|
-
var
|
|
11121
|
-
|
|
11122
|
-
var firstPanel = renderer.getPanel(0);
|
|
11123
|
-
var lastPanel = renderer.getPanel(renderer.panelCount - 1);
|
|
11124
|
-
|
|
11125
|
-
if (!firstPanel || !lastPanel) {
|
|
11126
|
-
this._range = {
|
|
11127
|
-
min: 0,
|
|
11128
|
-
max: 0
|
|
11129
|
-
};
|
|
11130
|
-
return this;
|
|
11131
|
-
}
|
|
11132
|
-
|
|
11133
|
-
var viewportSize = this.size;
|
|
11134
|
-
var firstPanelPrev = firstPanel.range.min;
|
|
11135
|
-
var lastPanelNext = lastPanel.range.max;
|
|
11136
|
-
var panelAreaSize = lastPanelNext - firstPanelPrev;
|
|
11137
|
-
var isBiggerThanViewport = viewportSize < panelAreaSize;
|
|
11138
|
-
var firstPos = firstPanelPrev + alignPos;
|
|
11139
|
-
var lastPos = lastPanelNext - viewportSize + alignPos;
|
|
11140
|
-
|
|
11141
|
-
if (isBiggerThanViewport) {
|
|
11142
|
-
this._range = {
|
|
11143
|
-
min: firstPos,
|
|
11144
|
-
max: lastPos
|
|
11145
|
-
};
|
|
11146
|
-
} else {
|
|
11147
|
-
var align = this._align;
|
|
11148
|
-
var alignVal = typeof align === "object" ? align.camera : align;
|
|
11149
|
-
var pos = firstPos + parseAlign$1(alignVal, lastPos - firstPos);
|
|
11150
|
-
this._range = {
|
|
11151
|
-
min: pos,
|
|
11152
|
-
max: pos
|
|
11153
|
-
};
|
|
11154
|
-
}
|
|
11155
|
-
|
|
11206
|
+
var actualPosition = this._position - this._alignPos - this._offset + this._circularOffset;
|
|
11207
|
+
el.style[this._transform] = flicking.horizontal ? "translate(" + -actualPosition + "px)" : "translate(0, " + -actualPosition + "px)";
|
|
11156
11208
|
return this;
|
|
11157
11209
|
};
|
|
11158
11210
|
|
|
11159
|
-
__proto.
|
|
11211
|
+
__proto._resetInternalValues = function () {
|
|
11212
|
+
this._position = 0;
|
|
11213
|
+
this._alignPos = 0;
|
|
11214
|
+
this._offset = 0;
|
|
11215
|
+
this._circularOffset = 0;
|
|
11216
|
+
this._circularEnabled = false;
|
|
11217
|
+
this._range = {
|
|
11218
|
+
min: 0,
|
|
11219
|
+
max: 0
|
|
11220
|
+
};
|
|
11221
|
+
this._visiblePanels = [];
|
|
11222
|
+
this._anchors = [];
|
|
11223
|
+
this._needPanelTriggered = {
|
|
11224
|
+
prev: false,
|
|
11225
|
+
next: false
|
|
11226
|
+
};
|
|
11227
|
+
};
|
|
11228
|
+
|
|
11229
|
+
__proto._refreshVisiblePanels = function () {
|
|
11160
11230
|
var _this = this;
|
|
11161
11231
|
|
|
11162
11232
|
var flicking = getFlickingAttached(this._flicking);
|
|
11163
11233
|
var panels = flicking.renderer.panels;
|
|
11164
|
-
|
|
11165
|
-
|
|
11166
|
-
|
|
11167
|
-
|
|
11168
|
-
|
|
11169
|
-
|
|
11170
|
-
|
|
11171
|
-
|
|
11172
|
-
|
|
11234
|
+
var newVisiblePanels = panels.filter(function (panel) {
|
|
11235
|
+
return _this.canSee(panel);
|
|
11236
|
+
});
|
|
11237
|
+
var prevVisiblePanels = this._visiblePanels;
|
|
11238
|
+
this._visiblePanels = newVisiblePanels;
|
|
11239
|
+
var added = newVisiblePanels.filter(function (panel) {
|
|
11240
|
+
return !includes(prevVisiblePanels, panel);
|
|
11241
|
+
});
|
|
11242
|
+
var removed = prevVisiblePanels.filter(function (panel) {
|
|
11243
|
+
return !includes(newVisiblePanels, panel);
|
|
11173
11244
|
});
|
|
11174
11245
|
|
|
11175
|
-
if (
|
|
11176
|
-
|
|
11177
|
-
|
|
11178
|
-
|
|
11179
|
-
|
|
11180
|
-
|
|
11181
|
-
|
|
11182
|
-
position: panel.position,
|
|
11183
|
-
panel: panel
|
|
11184
|
-
});
|
|
11246
|
+
if (added.length > 0 || removed.length > 0) {
|
|
11247
|
+
void flicking.renderer.render().then(function () {
|
|
11248
|
+
flicking.trigger(new ComponentEvent$1(EVENTS.VISIBLE_CHANGE, {
|
|
11249
|
+
added: added,
|
|
11250
|
+
removed: removed,
|
|
11251
|
+
visiblePanels: newVisiblePanels
|
|
11252
|
+
}));
|
|
11185
11253
|
});
|
|
11254
|
+
}
|
|
11255
|
+
};
|
|
11186
11256
|
|
|
11187
|
-
|
|
11188
|
-
|
|
11189
|
-
|
|
11190
|
-
|
|
11191
|
-
|
|
11257
|
+
__proto._checkNeedPanel = function () {
|
|
11258
|
+
var needPanelTriggered = this._needPanelTriggered;
|
|
11259
|
+
if (needPanelTriggered.prev && needPanelTriggered.next) return;
|
|
11260
|
+
var flicking = getFlickingAttached(this._flicking);
|
|
11261
|
+
var panels = flicking.renderer.panels;
|
|
11262
|
+
|
|
11263
|
+
if (panels.length <= 0) {
|
|
11264
|
+
if (!needPanelTriggered.prev) {
|
|
11265
|
+
flicking.trigger(new ComponentEvent$1(EVENTS.NEED_PANEL, {
|
|
11266
|
+
direction: DIRECTION.PREV
|
|
11192
11267
|
}));
|
|
11268
|
+
needPanelTriggered.prev = true;
|
|
11193
11269
|
}
|
|
11194
11270
|
|
|
11195
|
-
if (
|
|
11196
|
-
|
|
11197
|
-
|
|
11198
|
-
position: range.max,
|
|
11199
|
-
panel: panels[reachablePanels[reachablePanels.length - 1].index + 1]
|
|
11271
|
+
if (!needPanelTriggered.next) {
|
|
11272
|
+
flicking.trigger(new ComponentEvent$1(EVENTS.NEED_PANEL, {
|
|
11273
|
+
direction: DIRECTION.NEXT
|
|
11200
11274
|
}));
|
|
11275
|
+
needPanelTriggered.next = true;
|
|
11201
11276
|
}
|
|
11202
11277
|
|
|
11203
|
-
|
|
11204
|
-
}
|
|
11205
|
-
// There're more than 2 panels
|
|
11206
|
-
var nearestPanelAtMin = this._findNearestPanel(range.min, panels);
|
|
11278
|
+
return;
|
|
11279
|
+
}
|
|
11207
11280
|
|
|
11208
|
-
|
|
11209
|
-
|
|
11210
|
-
|
|
11211
|
-
|
|
11212
|
-
|
|
11213
|
-
|
|
11214
|
-
|
|
11215
|
-
|
|
11216
|
-
|
|
11217
|
-
|
|
11218
|
-
|
|
11219
|
-
|
|
11220
|
-
|
|
11221
|
-
|
|
11222
|
-
|
|
11223
|
-
|
|
11224
|
-
|
|
11281
|
+
var cameraPosition = this._position;
|
|
11282
|
+
var cameraSize = this.size;
|
|
11283
|
+
var cameraRange = this._range;
|
|
11284
|
+
var needPanelThreshold = flicking.needPanelThreshold;
|
|
11285
|
+
var cameraPrev = cameraPosition - this._alignPos;
|
|
11286
|
+
var cameraNext = cameraPrev + cameraSize;
|
|
11287
|
+
var firstPanel = panels[0];
|
|
11288
|
+
var lastPanel = panels[panels.length - 1];
|
|
11289
|
+
|
|
11290
|
+
if (!needPanelTriggered.prev) {
|
|
11291
|
+
var firstPanelPrev = firstPanel.range.min;
|
|
11292
|
+
|
|
11293
|
+
if (cameraPrev <= firstPanelPrev + needPanelThreshold || cameraPosition <= cameraRange.min + needPanelThreshold) {
|
|
11294
|
+
flicking.trigger(new ComponentEvent$1(EVENTS.NEED_PANEL, {
|
|
11295
|
+
direction: DIRECTION.PREV
|
|
11296
|
+
}));
|
|
11297
|
+
needPanelTriggered.prev = true;
|
|
11298
|
+
}
|
|
11225
11299
|
}
|
|
11226
11300
|
|
|
11227
|
-
|
|
11301
|
+
if (!needPanelTriggered.next) {
|
|
11302
|
+
var lastPanelNext = lastPanel.range.max;
|
|
11303
|
+
|
|
11304
|
+
if (cameraNext >= lastPanelNext - needPanelThreshold || cameraPosition >= cameraRange.max - needPanelThreshold) {
|
|
11305
|
+
flicking.trigger(new ComponentEvent$1(EVENTS.NEED_PANEL, {
|
|
11306
|
+
direction: DIRECTION.NEXT
|
|
11307
|
+
}));
|
|
11308
|
+
needPanelTriggered.next = true;
|
|
11309
|
+
}
|
|
11310
|
+
}
|
|
11228
11311
|
};
|
|
11229
11312
|
|
|
11230
|
-
__proto.
|
|
11313
|
+
__proto._checkReachEnd = function (prevPos, newPos) {
|
|
11314
|
+
var flicking = getFlickingAttached(this._flicking);
|
|
11231
11315
|
var range = this._range;
|
|
11232
|
-
var
|
|
11233
|
-
|
|
11234
|
-
|
|
11235
|
-
|
|
11236
|
-
|
|
11237
|
-
|
|
11238
|
-
|
|
11239
|
-
} else {
|
|
11240
|
-
return _super.prototype.findAnchorIncludePosition.call(this, position);
|
|
11241
|
-
}
|
|
11316
|
+
var wasBetweenRange = prevPos > range.min && prevPos < range.max;
|
|
11317
|
+
var isBetweenRange = newPos > range.min && newPos < range.max;
|
|
11318
|
+
if (!wasBetweenRange || isBetweenRange) return;
|
|
11319
|
+
var direction = newPos <= range.min ? DIRECTION.PREV : DIRECTION.NEXT;
|
|
11320
|
+
flicking.trigger(new ComponentEvent$1(EVENTS.REACH_EDGE, {
|
|
11321
|
+
direction: direction
|
|
11322
|
+
}));
|
|
11242
11323
|
};
|
|
11243
11324
|
|
|
11244
|
-
__proto.
|
|
11245
|
-
var
|
|
11325
|
+
__proto._updateMode = function () {
|
|
11326
|
+
var flicking = getFlickingAttached(this._flicking);
|
|
11246
11327
|
|
|
11247
|
-
|
|
11248
|
-
var
|
|
11249
|
-
var
|
|
11328
|
+
if (flicking.circular) {
|
|
11329
|
+
var circularMode = new CircularCameraMode(flicking);
|
|
11330
|
+
var canSetCircularMode = circularMode.checkAvailability();
|
|
11250
11331
|
|
|
11251
|
-
if (
|
|
11252
|
-
|
|
11253
|
-
|
|
11332
|
+
if (canSetCircularMode) {
|
|
11333
|
+
this._mode = circularMode;
|
|
11334
|
+
} else {
|
|
11335
|
+
var fallbackMode = flicking.circularFallback;
|
|
11336
|
+
this._mode = fallbackMode === CIRCULAR_FALLBACK.BOUND ? new BoundCameraMode(flicking) : new LinearCameraMode(flicking);
|
|
11254
11337
|
}
|
|
11255
11338
|
|
|
11256
|
-
|
|
11257
|
-
}
|
|
11258
|
-
|
|
11339
|
+
this._circularEnabled = canSetCircularMode;
|
|
11340
|
+
} else {
|
|
11341
|
+
this._mode = flicking.bound ? new BoundCameraMode(flicking) : new LinearCameraMode(flicking);
|
|
11342
|
+
}
|
|
11343
|
+
};
|
|
11259
11344
|
|
|
11260
|
-
|
|
11345
|
+
__proto._togglePanels = function (prevPos, pos) {
|
|
11346
|
+
if (pos === prevPos) return false;
|
|
11347
|
+
var flicking = getFlickingAttached(this._flicking);
|
|
11348
|
+
var panels = flicking.renderer.panels;
|
|
11349
|
+
var toggled = panels.map(function (panel) {
|
|
11350
|
+
return panel.toggle(prevPos, pos);
|
|
11351
|
+
});
|
|
11352
|
+
return toggled.some(function (isToggled) {
|
|
11353
|
+
return isToggled;
|
|
11354
|
+
});
|
|
11261
11355
|
};
|
|
11262
11356
|
|
|
11263
|
-
return
|
|
11264
|
-
}(
|
|
11357
|
+
return Camera;
|
|
11358
|
+
}();
|
|
11265
11359
|
|
|
11266
11360
|
/*
|
|
11267
11361
|
* Copyright (c) 2015 NAVER Corp.
|
|
@@ -11271,9 +11365,9 @@ version: 4.4.1
|
|
|
11271
11365
|
var Camera = {
|
|
11272
11366
|
__proto__: null,
|
|
11273
11367
|
Camera: Camera$1,
|
|
11274
|
-
|
|
11275
|
-
|
|
11276
|
-
|
|
11368
|
+
LinearCameraMode: LinearCameraMode,
|
|
11369
|
+
CircularCameraMode: CircularCameraMode,
|
|
11370
|
+
BoundCameraMode: BoundCameraMode
|
|
11277
11371
|
};
|
|
11278
11372
|
|
|
11279
11373
|
/*
|
|
@@ -12480,7 +12574,7 @@ version: 4.4.1
|
|
|
12480
12574
|
flicking: flicking
|
|
12481
12575
|
});
|
|
12482
12576
|
});
|
|
12483
|
-
panels.splice.apply(panels,
|
|
12577
|
+
panels.splice.apply(panels, __spread$1([insertingIdx, 0], panelsInserted));
|
|
12484
12578
|
|
|
12485
12579
|
if (item.hasDOMInElements) {
|
|
12486
12580
|
// Insert the actual elements as camera element's children
|
|
@@ -12503,7 +12597,7 @@ version: 4.4.1
|
|
|
12503
12597
|
panel.increaseIndex(panelsInserted.length);
|
|
12504
12598
|
panel.updatePosition();
|
|
12505
12599
|
});
|
|
12506
|
-
return
|
|
12600
|
+
return __spread$1(addedPanels, panelsInserted);
|
|
12507
12601
|
}, []);
|
|
12508
12602
|
if (allPanelsInserted.length <= 0) return []; // Update camera & control
|
|
12509
12603
|
|
|
@@ -12582,7 +12676,7 @@ version: 4.4.1
|
|
|
12582
12676
|
control.resetActive();
|
|
12583
12677
|
}
|
|
12584
12678
|
|
|
12585
|
-
return
|
|
12679
|
+
return __spread$1(removed, panelsRemoved);
|
|
12586
12680
|
}, []); // Update camera & control
|
|
12587
12681
|
|
|
12588
12682
|
this._updateCameraAndControl();
|
|
@@ -13581,7 +13675,7 @@ version: 4.4.1
|
|
|
13581
13675
|
var notToggled = renderedPanels.filter(function (panel) {
|
|
13582
13676
|
return !panel.toggled;
|
|
13583
13677
|
});
|
|
13584
|
-
return
|
|
13678
|
+
return __spread$1(toggledPrev, notToggled, toggledNext).map(function (panel) {
|
|
13585
13679
|
return panel.index;
|
|
13586
13680
|
});
|
|
13587
13681
|
};
|
|
@@ -13791,7 +13885,7 @@ version: 4.4.1
|
|
|
13791
13885
|
__proto.getRenderingIndexesByOrder = function (flicking) {
|
|
13792
13886
|
var virtualManager = flicking.virtual;
|
|
13793
13887
|
|
|
13794
|
-
var visiblePanels =
|
|
13888
|
+
var visiblePanels = __spread$1(flicking.visiblePanels).filter(function (panel) {
|
|
13795
13889
|
return panel.rendered;
|
|
13796
13890
|
}).sort(function (panel1, panel2) {
|
|
13797
13891
|
return panel1.position + panel1.offset - (panel2.position + panel2.offset);
|
|
@@ -13812,7 +13906,7 @@ version: 4.4.1
|
|
|
13812
13906
|
}).map(function (el) {
|
|
13813
13907
|
return el.idx;
|
|
13814
13908
|
});
|
|
13815
|
-
return
|
|
13909
|
+
return __spread$1(visibleIndexes, invisibleIndexes);
|
|
13816
13910
|
};
|
|
13817
13911
|
|
|
13818
13912
|
__proto.getRenderingElementsByOrder = function (flicking) {
|
|
@@ -13935,58 +14029,60 @@ version: 4.4.1
|
|
|
13935
14029
|
horizontal = _e === void 0 ? true : _e,
|
|
13936
14030
|
_f = _b.circular,
|
|
13937
14031
|
circular = _f === void 0 ? false : _f,
|
|
13938
|
-
_g = _b.
|
|
13939
|
-
|
|
13940
|
-
_h = _b.
|
|
13941
|
-
|
|
13942
|
-
_j = _b.
|
|
13943
|
-
|
|
13944
|
-
_k = _b.
|
|
13945
|
-
|
|
13946
|
-
_l = _b.
|
|
13947
|
-
|
|
13948
|
-
_m = _b.
|
|
13949
|
-
|
|
13950
|
-
_o = _b.
|
|
13951
|
-
|
|
13952
|
-
_p = _b.
|
|
13953
|
-
|
|
13954
|
-
_q = _b.
|
|
13955
|
-
|
|
13956
|
-
_r = _b.
|
|
13957
|
-
|
|
14032
|
+
_g = _b.circularFallback,
|
|
14033
|
+
circularFallback = _g === void 0 ? CIRCULAR_FALLBACK.LINEAR : _g,
|
|
14034
|
+
_h = _b.bound,
|
|
14035
|
+
bound = _h === void 0 ? false : _h,
|
|
14036
|
+
_j = _b.adaptive,
|
|
14037
|
+
adaptive = _j === void 0 ? false : _j,
|
|
14038
|
+
_k = _b.panelsPerView,
|
|
14039
|
+
panelsPerView = _k === void 0 ? -1 : _k,
|
|
14040
|
+
_l = _b.noPanelStyleOverride,
|
|
14041
|
+
noPanelStyleOverride = _l === void 0 ? false : _l,
|
|
14042
|
+
_m = _b.resizeOnContentsReady,
|
|
14043
|
+
resizeOnContentsReady = _m === void 0 ? false : _m,
|
|
14044
|
+
_o = _b.needPanelThreshold,
|
|
14045
|
+
needPanelThreshold = _o === void 0 ? 0 : _o,
|
|
14046
|
+
_p = _b.preventEventsBeforeInit,
|
|
14047
|
+
preventEventsBeforeInit = _p === void 0 ? true : _p,
|
|
14048
|
+
_q = _b.deceleration,
|
|
14049
|
+
deceleration = _q === void 0 ? 0.0075 : _q,
|
|
14050
|
+
_r = _b.duration,
|
|
14051
|
+
duration = _r === void 0 ? 500 : _r,
|
|
14052
|
+
_s = _b.easing,
|
|
14053
|
+
easing = _s === void 0 ? function (x) {
|
|
13958
14054
|
return 1 - Math.pow(1 - x, 3);
|
|
13959
|
-
} :
|
|
13960
|
-
|
|
13961
|
-
inputType =
|
|
13962
|
-
|
|
13963
|
-
moveType =
|
|
13964
|
-
|
|
13965
|
-
threshold =
|
|
13966
|
-
|
|
13967
|
-
interruptable =
|
|
13968
|
-
|
|
13969
|
-
bounce =
|
|
13970
|
-
|
|
13971
|
-
iOSEdgeSwipeThreshold =
|
|
13972
|
-
|
|
13973
|
-
preventClickOnDrag =
|
|
13974
|
-
|
|
13975
|
-
disableOnInit =
|
|
13976
|
-
|
|
13977
|
-
renderOnlyVisible =
|
|
13978
|
-
|
|
13979
|
-
virtual =
|
|
13980
|
-
|
|
13981
|
-
autoInit =
|
|
13982
|
-
|
|
13983
|
-
autoResize =
|
|
13984
|
-
|
|
13985
|
-
useResizeObserver =
|
|
13986
|
-
|
|
13987
|
-
externalRenderer =
|
|
13988
|
-
|
|
13989
|
-
renderExternal =
|
|
14055
|
+
} : _s,
|
|
14056
|
+
_t = _b.inputType,
|
|
14057
|
+
inputType = _t === void 0 ? ["mouse", "touch"] : _t,
|
|
14058
|
+
_u = _b.moveType,
|
|
14059
|
+
moveType = _u === void 0 ? "snap" : _u,
|
|
14060
|
+
_v = _b.threshold,
|
|
14061
|
+
threshold = _v === void 0 ? 40 : _v,
|
|
14062
|
+
_w = _b.interruptable,
|
|
14063
|
+
interruptable = _w === void 0 ? true : _w,
|
|
14064
|
+
_x = _b.bounce,
|
|
14065
|
+
bounce = _x === void 0 ? "20%" : _x,
|
|
14066
|
+
_y = _b.iOSEdgeSwipeThreshold,
|
|
14067
|
+
iOSEdgeSwipeThreshold = _y === void 0 ? 30 : _y,
|
|
14068
|
+
_z = _b.preventClickOnDrag,
|
|
14069
|
+
preventClickOnDrag = _z === void 0 ? true : _z,
|
|
14070
|
+
_0 = _b.disableOnInit,
|
|
14071
|
+
disableOnInit = _0 === void 0 ? false : _0,
|
|
14072
|
+
_1 = _b.renderOnlyVisible,
|
|
14073
|
+
renderOnlyVisible = _1 === void 0 ? false : _1,
|
|
14074
|
+
_2 = _b.virtual,
|
|
14075
|
+
virtual = _2 === void 0 ? null : _2,
|
|
14076
|
+
_3 = _b.autoInit,
|
|
14077
|
+
autoInit = _3 === void 0 ? true : _3,
|
|
14078
|
+
_4 = _b.autoResize,
|
|
14079
|
+
autoResize = _4 === void 0 ? true : _4,
|
|
14080
|
+
_5 = _b.useResizeObserver,
|
|
14081
|
+
useResizeObserver = _5 === void 0 ? true : _5,
|
|
14082
|
+
_6 = _b.externalRenderer,
|
|
14083
|
+
externalRenderer = _6 === void 0 ? null : _6,
|
|
14084
|
+
_7 = _b.renderExternal,
|
|
14085
|
+
renderExternal = _7 === void 0 ? null : _7;
|
|
13990
14086
|
|
|
13991
14087
|
var _this = _super.call(this) || this; // Internal states
|
|
13992
14088
|
|
|
@@ -13998,6 +14094,7 @@ version: 4.4.1
|
|
|
13998
14094
|
_this._defaultIndex = defaultIndex;
|
|
13999
14095
|
_this._horizontal = horizontal;
|
|
14000
14096
|
_this._circular = circular;
|
|
14097
|
+
_this._circularFallback = circularFallback;
|
|
14001
14098
|
_this._bound = bound;
|
|
14002
14099
|
_this._adaptive = adaptive;
|
|
14003
14100
|
_this._panelsPerView = panelsPerView;
|
|
@@ -14136,7 +14233,7 @@ version: 4.4.1
|
|
|
14136
14233
|
* @readonly
|
|
14137
14234
|
*/
|
|
14138
14235
|
get: function () {
|
|
14139
|
-
return this._camera.
|
|
14236
|
+
return this._camera.circularEnabled;
|
|
14140
14237
|
},
|
|
14141
14238
|
enumerable: false,
|
|
14142
14239
|
configurable: true
|
|
@@ -14370,6 +14467,24 @@ version: 4.4.1
|
|
|
14370
14467
|
enumerable: false,
|
|
14371
14468
|
configurable: true
|
|
14372
14469
|
});
|
|
14470
|
+
Object.defineProperty(__proto, "circularFallback", {
|
|
14471
|
+
/**
|
|
14472
|
+
* Set panel control mode for the case when circular cannot be enabled.
|
|
14473
|
+
* "linear" will set the view's range from the top of the first panel to the top of the last panel.
|
|
14474
|
+
* "bound" will prevent the view from going out of the first/last panel, so it won't show empty spaces before/after the first/last panel.
|
|
14475
|
+
* @ko 순환 모드 사용 불가능시 사용할 패널 조작 범위 설정 방식을 변경합니다.
|
|
14476
|
+
* "linear" 사용시 시점이 첫번째 엘리먼트 위에서부터 마지막 엘리먼트 위까지 움직일 수 있도록 설정합니다.
|
|
14477
|
+
* "bound" 사용시 시점이 첫번째 엘리먼트와 마지막 엘리먼트의 끝과 끝 사이에서 움직일 수 있도록 설정합니다.
|
|
14478
|
+
* @see CIRCULAR_FALLBACK
|
|
14479
|
+
* @type {string}
|
|
14480
|
+
* @default "linear"
|
|
14481
|
+
*/
|
|
14482
|
+
get: function () {
|
|
14483
|
+
return this._circularFallback;
|
|
14484
|
+
},
|
|
14485
|
+
enumerable: false,
|
|
14486
|
+
configurable: true
|
|
14487
|
+
});
|
|
14373
14488
|
Object.defineProperty(__proto, "bound", {
|
|
14374
14489
|
/**
|
|
14375
14490
|
* Prevent the view(camera element) from going out of the first/last panel, so it won't show empty spaces before/after the first/last panel
|
|
@@ -15330,7 +15445,7 @@ version: 4.4.1
|
|
|
15330
15445
|
});
|
|
15331
15446
|
}
|
|
15332
15447
|
|
|
15333
|
-
(_a = this._plugins).push.apply(_a,
|
|
15448
|
+
(_a = this._plugins).push.apply(_a, __spread$1(plugins));
|
|
15334
15449
|
|
|
15335
15450
|
return this;
|
|
15336
15451
|
};
|
|
@@ -15577,22 +15692,14 @@ version: 4.4.1
|
|
|
15577
15692
|
};
|
|
15578
15693
|
|
|
15579
15694
|
__proto._createCamera = function () {
|
|
15580
|
-
|
|
15581
|
-
|
|
15582
|
-
|
|
15583
|
-
|
|
15584
|
-
if (this._circular) {
|
|
15585
|
-
if (this._bound) {
|
|
15586
|
-
// eslint-disable-next-line no-console
|
|
15587
|
-
console.warn("\"circular\" and \"bound\" option cannot be used together, ignoring bound.");
|
|
15588
|
-
}
|
|
15589
|
-
|
|
15590
|
-
return new CircularCamera(cameraOption);
|
|
15591
|
-
} else if (this._bound) {
|
|
15592
|
-
return new BoundCamera(cameraOption);
|
|
15593
|
-
} else {
|
|
15594
|
-
return new LinearCamera(cameraOption);
|
|
15695
|
+
if (this._circular && this._bound) {
|
|
15696
|
+
// eslint-disable-next-line no-console
|
|
15697
|
+
console.warn("\"circular\" and \"bound\" option cannot be used together, ignoring bound.");
|
|
15595
15698
|
}
|
|
15699
|
+
|
|
15700
|
+
return new Camera$1({
|
|
15701
|
+
align: this._align
|
|
15702
|
+
});
|
|
15596
15703
|
};
|
|
15597
15704
|
|
|
15598
15705
|
__proto._createRenderer = function () {
|
|
@@ -15656,7 +15763,7 @@ version: 4.4.1
|
|
|
15656
15763
|
*/
|
|
15657
15764
|
|
|
15658
15765
|
|
|
15659
|
-
Flicking.VERSION = "4.
|
|
15766
|
+
Flicking.VERSION = "4.5.1";
|
|
15660
15767
|
return Flicking;
|
|
15661
15768
|
}(Component$1);
|
|
15662
15769
|
|
|
@@ -15712,7 +15819,7 @@ version: 4.4.1
|
|
|
15712
15819
|
args[_i] = arguments[_i];
|
|
15713
15820
|
}
|
|
15714
15821
|
|
|
15715
|
-
return (_a = descriptor.value).call.apply(_a,
|
|
15822
|
+
return (_a = descriptor.value).call.apply(_a, __spread$1([this[flickingName]], args));
|
|
15716
15823
|
}
|
|
15717
15824
|
});
|
|
15718
15825
|
} else {
|
|
@@ -15722,7 +15829,8 @@ version: 4.4.1
|
|
|
15722
15829
|
getterDescriptor.get = function () {
|
|
15723
15830
|
var _a;
|
|
15724
15831
|
|
|
15725
|
-
|
|
15832
|
+
var flicking = this[flickingName];
|
|
15833
|
+
return flicking && ((_a = descriptor.get) === null || _a === void 0 ? void 0 : _a.call(flicking));
|
|
15726
15834
|
};
|
|
15727
15835
|
}
|
|
15728
15836
|
|
|
@@ -15736,7 +15844,7 @@ version: 4.4.1
|
|
|
15736
15844
|
args[_i] = arguments[_i];
|
|
15737
15845
|
}
|
|
15738
15846
|
|
|
15739
|
-
return (_a = descriptor.set) === null || _a === void 0 ? void 0 : _a.call.apply(_a,
|
|
15847
|
+
return (_a = descriptor.set) === null || _a === void 0 ? void 0 : _a.call.apply(_a, __spread$1([this[flickingName]], args));
|
|
15740
15848
|
};
|
|
15741
15849
|
}
|
|
15742
15850
|
|
|
@@ -15750,6 +15858,8 @@ version: 4.4.1
|
|
|
15750
15858
|
var renderer = flicking.renderer;
|
|
15751
15859
|
var panels = renderer.panels;
|
|
15752
15860
|
|
|
15861
|
+
var prevList = __spread$1(diffResult.prevList);
|
|
15862
|
+
|
|
15753
15863
|
if (diffResult.removed.length > 0) {
|
|
15754
15864
|
var endIdx_1 = -1;
|
|
15755
15865
|
var prevIdx_1 = -1;
|
|
@@ -15765,6 +15875,8 @@ version: 4.4.1
|
|
|
15765
15875
|
} else {
|
|
15766
15876
|
prevIdx_1 = removedIdx;
|
|
15767
15877
|
}
|
|
15878
|
+
|
|
15879
|
+
prevList.splice(removedIdx, 1);
|
|
15768
15880
|
});
|
|
15769
15881
|
batchRemove(renderer, prevIdx_1, endIdx_1 + 1);
|
|
15770
15882
|
}
|
|
@@ -15804,13 +15916,14 @@ version: 4.4.1
|
|
|
15804
15916
|
if (diffResult.added.length > 0) {
|
|
15805
15917
|
var startIdx_1 = -1;
|
|
15806
15918
|
var prevIdx_2 = -1;
|
|
15919
|
+
var addedElements_1 = rendered.slice(prevList.length);
|
|
15807
15920
|
diffResult.added.forEach(function (addedIdx, idx) {
|
|
15808
15921
|
if (startIdx_1 < 0) {
|
|
15809
15922
|
startIdx_1 = idx;
|
|
15810
15923
|
}
|
|
15811
15924
|
|
|
15812
15925
|
if (prevIdx_2 >= 0 && addedIdx !== prevIdx_2 + 1) {
|
|
15813
|
-
batchInsert(renderer, diffResult,
|
|
15926
|
+
batchInsert(renderer, diffResult, addedElements_1, startIdx_1, idx + 1);
|
|
15814
15927
|
startIdx_1 = -1;
|
|
15815
15928
|
prevIdx_2 = -1;
|
|
15816
15929
|
} else {
|
|
@@ -15819,19 +15932,19 @@ version: 4.4.1
|
|
|
15819
15932
|
});
|
|
15820
15933
|
|
|
15821
15934
|
if (startIdx_1 >= 0) {
|
|
15822
|
-
batchInsert(renderer, diffResult,
|
|
15935
|
+
batchInsert(renderer, diffResult, addedElements_1, startIdx_1);
|
|
15823
15936
|
}
|
|
15824
15937
|
}
|
|
15825
15938
|
});
|
|
15826
15939
|
|
|
15827
|
-
var batchInsert = function (renderer, diffResult,
|
|
15828
|
-
renderer.batchInsert.apply(renderer,
|
|
15940
|
+
var batchInsert = function (renderer, diffResult, addedElements, startIdx, endIdx) {
|
|
15941
|
+
renderer.batchInsert.apply(renderer, __spread$1(diffResult.added.slice(startIdx, endIdx).map(function (index, elIdx) {
|
|
15829
15942
|
return {
|
|
15830
15943
|
index: index,
|
|
15831
|
-
elements: [
|
|
15944
|
+
elements: [addedElements[elIdx]],
|
|
15832
15945
|
hasDOMInElements: false
|
|
15833
15946
|
};
|
|
15834
|
-
})))
|
|
15947
|
+
})));
|
|
15835
15948
|
};
|
|
15836
15949
|
|
|
15837
15950
|
var batchRemove = function (renderer, startIdx, endIdx) {
|
|
@@ -15856,16 +15969,16 @@ version: 4.4.1
|
|
|
15856
15969
|
map[prev] = current;
|
|
15857
15970
|
return map;
|
|
15858
15971
|
}, {});
|
|
15859
|
-
return
|
|
15972
|
+
return __spread$1(flicking.panels.filter(function (panel) {
|
|
15860
15973
|
return !removedPanels[panel.index];
|
|
15861
15974
|
}) // Sort panels by position
|
|
15862
15975
|
.sort(function (panel1, panel2) {
|
|
15863
15976
|
return panel1.position + panel1.offset - (panel2.position + panel2.offset);
|
|
15864
15977
|
}).map(function (panel) {
|
|
15865
15978
|
return diffResult.list[maintainedMap[panel.index]];
|
|
15866
|
-
})
|
|
15979
|
+
}), diffResult.added.map(function (idx) {
|
|
15867
15980
|
return diffResult.list[idx];
|
|
15868
|
-
}))
|
|
15981
|
+
}));
|
|
15869
15982
|
});
|
|
15870
15983
|
|
|
15871
15984
|
var getDefaultCameraTransform = (function (align, horizontal, firstPanelSize) {
|