@egjs/flicking 4.7.3 → 4.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/TODO.md +3 -0
- package/declaration/Flicking.d.ts +8 -1
- package/declaration/core/Viewport.d.ts +3 -1
- package/declaration/utils.d.ts +7 -0
- package/dist/flicking.esm.js +151 -39
- package/dist/flicking.esm.js.map +1 -1
- package/dist/flicking.js +151 -38
- 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 +265 -133
- 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 +2 -2
- package/src/Flicking.ts +32 -1
- package/src/control/AxesController.ts +1 -1
- package/src/control/SnapControl.ts +16 -4
- package/src/control/StrictControl.ts +5 -1
- package/src/control/states/AnimatingState.ts +6 -0
- package/src/core/FlickingError.ts +1 -1
- package/src/core/Viewport.ts +23 -4
- package/src/core/panel/Panel.ts +23 -4
- package/src/utils.ts +42 -0
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.9.0
|
|
8
8
|
*/
|
|
9
9
|
(function (global, factory) {
|
|
10
10
|
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
|
|
@@ -1248,6 +1248,29 @@ version: 4.7.3
|
|
|
1248
1248
|
|
|
1249
1249
|
return arr;
|
|
1250
1250
|
};
|
|
1251
|
+
var getElementSize = function (_a) {
|
|
1252
|
+
var el = _a.el,
|
|
1253
|
+
horizontal = _a.horizontal,
|
|
1254
|
+
useFractionalSize = _a.useFractionalSize,
|
|
1255
|
+
useOffset = _a.useOffset,
|
|
1256
|
+
style = _a.style;
|
|
1257
|
+
|
|
1258
|
+
if (useFractionalSize) {
|
|
1259
|
+
var baseSize = parseFloat(horizontal ? style.width : style.height);
|
|
1260
|
+
var isBorderBoxSizing = style.boxSizing === "border-box";
|
|
1261
|
+
var border = horizontal ? parseFloat(style.borderLeftWidth || "0") + parseFloat(style.borderRightWidth || "0") : parseFloat(style.borderTopWidth || "0") + parseFloat(style.borderBottomWidth || "0");
|
|
1262
|
+
|
|
1263
|
+
if (isBorderBoxSizing) {
|
|
1264
|
+
return useOffset ? baseSize : baseSize - border;
|
|
1265
|
+
} else {
|
|
1266
|
+
var padding = horizontal ? parseFloat(style.paddingLeft || "0") + parseFloat(style.paddingRight || "0") : parseFloat(style.paddingTop || "0") + parseFloat(style.paddingBottom || "0");
|
|
1267
|
+
return useOffset ? baseSize + padding + border : baseSize + padding;
|
|
1268
|
+
}
|
|
1269
|
+
} else {
|
|
1270
|
+
var sizeStr = horizontal ? "Width" : "Height";
|
|
1271
|
+
return useOffset ? el["offset" + sizeStr] : el["client" + sizeStr];
|
|
1272
|
+
}
|
|
1273
|
+
};
|
|
1251
1274
|
var setPrototypeOf = Object.setPrototypeOf || function (obj, proto) {
|
|
1252
1275
|
obj.__proto__ = proto;
|
|
1253
1276
|
return obj;
|
|
@@ -1282,6 +1305,7 @@ version: 4.7.3
|
|
|
1282
1305
|
isBetween: isBetween,
|
|
1283
1306
|
circulateIndex: circulateIndex,
|
|
1284
1307
|
range: range,
|
|
1308
|
+
getElementSize: getElementSize,
|
|
1285
1309
|
setPrototypeOf: setPrototypeOf
|
|
1286
1310
|
};
|
|
1287
1311
|
|
|
@@ -1294,7 +1318,7 @@ version: 4.7.3
|
|
|
1294
1318
|
* @ko Flicking 내부에서 알려진 오류 발생시 throw되는 에러
|
|
1295
1319
|
* @property {number} code Error code<ko>에러 코드</ko>
|
|
1296
1320
|
* @property {string} message Error message<ko>에러 메시지</ko>
|
|
1297
|
-
* @see {@link
|
|
1321
|
+
* @see {@link ERROR_CODE ERROR_CODE}
|
|
1298
1322
|
* @example
|
|
1299
1323
|
* ```ts
|
|
1300
1324
|
* import Flicking, { FlickingError, ERROR_CODES } from "@egjs/flicking";
|
|
@@ -1330,10 +1354,6 @@ version: 4.7.3
|
|
|
1330
1354
|
return FlickingError;
|
|
1331
1355
|
}(Error);
|
|
1332
1356
|
|
|
1333
|
-
/*
|
|
1334
|
-
* Copyright (c) 2015 NAVER Corp.
|
|
1335
|
-
* egjs projects are licensed under the MIT license
|
|
1336
|
-
*/
|
|
1337
1357
|
/**
|
|
1338
1358
|
* A component that manages viewport size
|
|
1339
1359
|
* @ko 뷰포트 크기 정보를 담당하는 컴포넌트
|
|
@@ -1345,7 +1365,8 @@ version: 4.7.3
|
|
|
1345
1365
|
/**
|
|
1346
1366
|
* @param el A viewport element<ko>뷰포트 엘리먼트</ko>
|
|
1347
1367
|
*/
|
|
1348
|
-
function Viewport(el) {
|
|
1368
|
+
function Viewport(flicking, el) {
|
|
1369
|
+
this._flicking = flicking;
|
|
1349
1370
|
this._el = el;
|
|
1350
1371
|
this._width = 0;
|
|
1351
1372
|
this._height = 0;
|
|
@@ -1461,8 +1482,21 @@ version: 4.7.3
|
|
|
1461
1482
|
__proto.resize = function () {
|
|
1462
1483
|
var el = this._el;
|
|
1463
1484
|
var elStyle = getStyle(el);
|
|
1464
|
-
|
|
1465
|
-
this.
|
|
1485
|
+
var useFractionalSize = this._flicking.useFractionalSize;
|
|
1486
|
+
this._width = getElementSize({
|
|
1487
|
+
el: el,
|
|
1488
|
+
horizontal: true,
|
|
1489
|
+
useFractionalSize: useFractionalSize,
|
|
1490
|
+
useOffset: false,
|
|
1491
|
+
style: elStyle
|
|
1492
|
+
});
|
|
1493
|
+
this._height = getElementSize({
|
|
1494
|
+
el: el,
|
|
1495
|
+
horizontal: false,
|
|
1496
|
+
useFractionalSize: useFractionalSize,
|
|
1497
|
+
useOffset: false,
|
|
1498
|
+
style: elStyle
|
|
1499
|
+
});
|
|
1466
1500
|
this._padding = {
|
|
1467
1501
|
left: elStyle.paddingLeft ? parseFloat(elStyle.paddingLeft) : 0,
|
|
1468
1502
|
right: elStyle.paddingRight ? parseFloat(elStyle.paddingRight) : 0,
|
|
@@ -1916,7 +1950,7 @@ version: 4.7.3
|
|
|
1916
1950
|
license: MIT
|
|
1917
1951
|
author: NAVER Corp.
|
|
1918
1952
|
repository: git+https://github.com/naver/agent.git
|
|
1919
|
-
version: 2.
|
|
1953
|
+
version: 2.4.2
|
|
1920
1954
|
*/
|
|
1921
1955
|
function some(arr, callback) {
|
|
1922
1956
|
var length = arr.length;
|
|
@@ -1940,7 +1974,7 @@ version: 4.7.3
|
|
|
1940
1974
|
|
|
1941
1975
|
return null;
|
|
1942
1976
|
}
|
|
1943
|
-
function
|
|
1977
|
+
function getUserAgentString(agent) {
|
|
1944
1978
|
var userAgent = agent;
|
|
1945
1979
|
|
|
1946
1980
|
if (typeof userAgent === "undefined") {
|
|
@@ -2106,15 +2140,18 @@ version: 4.7.3
|
|
|
2106
2140
|
}, {
|
|
2107
2141
|
test: "windows nt",
|
|
2108
2142
|
id: "window"
|
|
2143
|
+
}, {
|
|
2144
|
+
test: "win32|windows",
|
|
2145
|
+
id: "window"
|
|
2109
2146
|
}, {
|
|
2110
2147
|
test: "iphone|ipad|ipod",
|
|
2111
2148
|
id: "ios",
|
|
2112
2149
|
versionTest: "iphone os|cpu os"
|
|
2113
2150
|
}, {
|
|
2114
|
-
test: "mac os x",
|
|
2151
|
+
test: "macos|macintel|mac os x",
|
|
2115
2152
|
id: "mac"
|
|
2116
2153
|
}, {
|
|
2117
|
-
test: "android",
|
|
2154
|
+
test: "android|linux armv81",
|
|
2118
2155
|
id: "android"
|
|
2119
2156
|
}, {
|
|
2120
2157
|
test: "tizen",
|
|
@@ -2124,85 +2161,17 @@ version: 4.7.3
|
|
|
2124
2161
|
id: "webos"
|
|
2125
2162
|
}];
|
|
2126
2163
|
|
|
2127
|
-
function
|
|
2128
|
-
|
|
2129
|
-
var brands = (userAgentData.uaList || userAgentData.brands).slice();
|
|
2130
|
-
var isMobile = userAgentData.mobile || false;
|
|
2131
|
-
var firstBrand = brands[0];
|
|
2132
|
-
var browser = {
|
|
2133
|
-
name: firstBrand.brand,
|
|
2134
|
-
version: firstBrand.version,
|
|
2135
|
-
majorVersion: -1,
|
|
2136
|
-
webkit: false,
|
|
2137
|
-
webkitVersion: "-1",
|
|
2138
|
-
chromium: false,
|
|
2139
|
-
chromiumVersion: "-1",
|
|
2140
|
-
webview: !!findPresetBrand(WEBVIEW_PRESETS, brands).brand
|
|
2141
|
-
};
|
|
2142
|
-
var os = {
|
|
2143
|
-
name: "unknown",
|
|
2144
|
-
version: "-1",
|
|
2145
|
-
majorVersion: -1
|
|
2146
|
-
};
|
|
2147
|
-
browser.webkit = !browser.chromium && some(WEBKIT_PRESETS, function (preset) {
|
|
2148
|
-
return findBrand(brands, preset);
|
|
2149
|
-
});
|
|
2150
|
-
var chromiumBrand = findPresetBrand(CHROMIUM_PRESETS, brands);
|
|
2151
|
-
browser.chromium = !!chromiumBrand.brand;
|
|
2152
|
-
browser.chromiumVersion = chromiumBrand.version;
|
|
2153
|
-
|
|
2154
|
-
if (!browser.chromium) {
|
|
2155
|
-
var webkitBrand = findPresetBrand(WEBKIT_PRESETS, brands);
|
|
2156
|
-
browser.webkit = !!webkitBrand.brand;
|
|
2157
|
-
browser.webkitVersion = webkitBrand.version;
|
|
2158
|
-
}
|
|
2159
|
-
|
|
2160
|
-
if (osData) {
|
|
2161
|
-
var platform_1 = osData.platform.toLowerCase();
|
|
2162
|
-
var result = find(OS_PRESETS, function (preset) {
|
|
2163
|
-
return new RegExp("" + preset.test, "g").exec(platform_1);
|
|
2164
|
-
});
|
|
2165
|
-
os.name = result ? result.id : platform_1;
|
|
2166
|
-
os.version = osData.platformVersion;
|
|
2167
|
-
}
|
|
2168
|
-
|
|
2169
|
-
var browserBrand = findPresetBrand(BROWSER_PRESETS, brands);
|
|
2170
|
-
|
|
2171
|
-
if (browserBrand.brand) {
|
|
2172
|
-
browser.name = browserBrand.brand;
|
|
2173
|
-
browser.version = osData ? osData.uaFullVersion : browserBrand.version;
|
|
2174
|
-
}
|
|
2175
|
-
|
|
2176
|
-
if (navigator.platform === "Linux armv8l") {
|
|
2177
|
-
os.name = "android";
|
|
2178
|
-
} else if (browser.webkit) {
|
|
2179
|
-
os.name = isMobile ? "ios" : "mac";
|
|
2180
|
-
}
|
|
2181
|
-
|
|
2182
|
-
if (os.name === "ios" && browser.webview) {
|
|
2183
|
-
browser.version = "-1";
|
|
2184
|
-
}
|
|
2185
|
-
|
|
2186
|
-
os.version = convertVersion(os.version);
|
|
2187
|
-
browser.version = convertVersion(browser.version);
|
|
2188
|
-
os.majorVersion = parseInt(os.version, 10);
|
|
2189
|
-
browser.majorVersion = parseInt(browser.version, 10);
|
|
2190
|
-
return {
|
|
2191
|
-
browser: browser,
|
|
2192
|
-
os: os,
|
|
2193
|
-
isMobile: isMobile,
|
|
2194
|
-
isHints: true
|
|
2195
|
-
};
|
|
2164
|
+
function isWebView(userAgent) {
|
|
2165
|
+
return !!findPreset(WEBVIEW_PRESETS, userAgent).preset;
|
|
2196
2166
|
}
|
|
2197
|
-
|
|
2198
|
-
|
|
2199
|
-
var nextAgent = getUserAgent(userAgent);
|
|
2167
|
+
function getLegacyAgent(userAgent) {
|
|
2168
|
+
var nextAgent = getUserAgentString(userAgent);
|
|
2200
2169
|
var isMobile = !!/mobi/g.exec(nextAgent);
|
|
2201
2170
|
var browser = {
|
|
2202
2171
|
name: "unknown",
|
|
2203
2172
|
version: "-1",
|
|
2204
2173
|
majorVersion: -1,
|
|
2205
|
-
webview:
|
|
2174
|
+
webview: isWebView(nextAgent),
|
|
2206
2175
|
chromium: false,
|
|
2207
2176
|
chromiumVersion: "-1",
|
|
2208
2177
|
webkit: false,
|
|
@@ -2240,7 +2209,7 @@ version: 4.7.3
|
|
|
2240
2209
|
|
|
2241
2210
|
if (browserPreset) {
|
|
2242
2211
|
browser.name = browserPreset.id;
|
|
2243
|
-
browser.version = browserVersion;
|
|
2212
|
+
browser.version = browserVersion; // Early whale bugs
|
|
2244
2213
|
|
|
2245
2214
|
if (browser.webview && os.name === "ios" && browser.name !== "safari") {
|
|
2246
2215
|
browser.webview = false;
|
|
@@ -2255,6 +2224,80 @@ version: 4.7.3
|
|
|
2255
2224
|
isHints: false
|
|
2256
2225
|
};
|
|
2257
2226
|
}
|
|
2227
|
+
|
|
2228
|
+
function getClientHintsAgent(osData) {
|
|
2229
|
+
var userAgentData = navigator.userAgentData;
|
|
2230
|
+
var brands = (userAgentData.uaList || userAgentData.brands).slice();
|
|
2231
|
+
var fullVersionList = osData && osData.fullVersionList;
|
|
2232
|
+
var isMobile = userAgentData.mobile || false;
|
|
2233
|
+
var firstBrand = brands[0];
|
|
2234
|
+
var platform = (osData && osData.platform || userAgentData.platform || navigator.platform).toLowerCase();
|
|
2235
|
+
var browser = {
|
|
2236
|
+
name: firstBrand.brand,
|
|
2237
|
+
version: firstBrand.version,
|
|
2238
|
+
majorVersion: -1,
|
|
2239
|
+
webkit: false,
|
|
2240
|
+
webkitVersion: "-1",
|
|
2241
|
+
chromium: false,
|
|
2242
|
+
chromiumVersion: "-1",
|
|
2243
|
+
webview: !!findPresetBrand(WEBVIEW_PRESETS, brands).brand || isWebView(getUserAgentString())
|
|
2244
|
+
};
|
|
2245
|
+
var os = {
|
|
2246
|
+
name: "unknown",
|
|
2247
|
+
version: "-1",
|
|
2248
|
+
majorVersion: -1
|
|
2249
|
+
};
|
|
2250
|
+
browser.webkit = !browser.chromium && some(WEBKIT_PRESETS, function (preset) {
|
|
2251
|
+
return findBrand(brands, preset);
|
|
2252
|
+
});
|
|
2253
|
+
var chromiumBrand = findPresetBrand(CHROMIUM_PRESETS, brands);
|
|
2254
|
+
browser.chromium = !!chromiumBrand.brand;
|
|
2255
|
+
browser.chromiumVersion = chromiumBrand.version;
|
|
2256
|
+
|
|
2257
|
+
if (!browser.chromium) {
|
|
2258
|
+
var webkitBrand = findPresetBrand(WEBKIT_PRESETS, brands);
|
|
2259
|
+
browser.webkit = !!webkitBrand.brand;
|
|
2260
|
+
browser.webkitVersion = webkitBrand.version;
|
|
2261
|
+
}
|
|
2262
|
+
|
|
2263
|
+
var platfomResult = find(OS_PRESETS, function (preset) {
|
|
2264
|
+
return new RegExp("" + preset.test, "g").exec(platform);
|
|
2265
|
+
});
|
|
2266
|
+
os.name = platfomResult ? platfomResult.id : "";
|
|
2267
|
+
|
|
2268
|
+
if (osData) {
|
|
2269
|
+
os.version = osData.platformVersion;
|
|
2270
|
+
}
|
|
2271
|
+
|
|
2272
|
+
if (fullVersionList && fullVersionList.length) {
|
|
2273
|
+
var browserBrandByFullVersionList = findPresetBrand(BROWSER_PRESETS, fullVersionList);
|
|
2274
|
+
browser.name = browserBrandByFullVersionList.brand || browser.name;
|
|
2275
|
+
browser.version = browserBrandByFullVersionList.version || browser.version;
|
|
2276
|
+
} else {
|
|
2277
|
+
var browserBrand = findPresetBrand(BROWSER_PRESETS, brands);
|
|
2278
|
+
browser.name = browserBrand.brand || browser.name;
|
|
2279
|
+
browser.version = browserBrand.brand && osData ? osData.uaFullVersion : browserBrand.version;
|
|
2280
|
+
}
|
|
2281
|
+
|
|
2282
|
+
if (browser.webkit) {
|
|
2283
|
+
os.name = isMobile ? "ios" : "mac";
|
|
2284
|
+
}
|
|
2285
|
+
|
|
2286
|
+
if (os.name === "ios" && browser.webview) {
|
|
2287
|
+
browser.version = "-1";
|
|
2288
|
+
}
|
|
2289
|
+
|
|
2290
|
+
os.version = convertVersion(os.version);
|
|
2291
|
+
browser.version = convertVersion(browser.version);
|
|
2292
|
+
os.majorVersion = parseInt(os.version, 10);
|
|
2293
|
+
browser.majorVersion = parseInt(browser.version, 10);
|
|
2294
|
+
return {
|
|
2295
|
+
browser: browser,
|
|
2296
|
+
os: os,
|
|
2297
|
+
isMobile: isMobile,
|
|
2298
|
+
isHints: true
|
|
2299
|
+
};
|
|
2300
|
+
}
|
|
2258
2301
|
/**
|
|
2259
2302
|
* Extracts browser and operating system information from the user agent string.
|
|
2260
2303
|
* @ko 유저 에이전트 문자열에서 브라우저와 운영체제 정보를 추출한다.
|
|
@@ -2269,9 +2312,9 @@ version: 4.7.3
|
|
|
2269
2312
|
|
|
2270
2313
|
function agent(userAgent) {
|
|
2271
2314
|
if (typeof userAgent === "undefined" && hasUserAgentData()) {
|
|
2272
|
-
return
|
|
2315
|
+
return getClientHintsAgent();
|
|
2273
2316
|
} else {
|
|
2274
|
-
return
|
|
2317
|
+
return getLegacyAgent(userAgent);
|
|
2275
2318
|
}
|
|
2276
2319
|
}
|
|
2277
2320
|
|
|
@@ -5908,8 +5951,15 @@ version: 4.7.3
|
|
|
5908
5951
|
var flicking = ctx.flicking,
|
|
5909
5952
|
axesEvent = ctx.axesEvent,
|
|
5910
5953
|
transitTo = ctx.transitTo;
|
|
5954
|
+
var targetPanel = this._targetPanel;
|
|
5955
|
+
var control = flicking.control;
|
|
5911
5956
|
this._delta = 0;
|
|
5912
5957
|
flicking.control.updateInput();
|
|
5958
|
+
|
|
5959
|
+
if (flicking.changeOnHold && targetPanel) {
|
|
5960
|
+
control.setActive(targetPanel, control.activePanel, axesEvent.isTrusted);
|
|
5961
|
+
}
|
|
5962
|
+
|
|
5913
5963
|
var holdStartEvent = new ComponentEvent$1(EVENTS.HOLD_START, {
|
|
5914
5964
|
axesEvent: axesEvent
|
|
5915
5965
|
});
|
|
@@ -6116,7 +6166,9 @@ version: 4.7.3
|
|
|
6116
6166
|
};
|
|
6117
6167
|
|
|
6118
6168
|
this._onAxesChange = function () {
|
|
6119
|
-
|
|
6169
|
+
var _a;
|
|
6170
|
+
|
|
6171
|
+
_this._dragged = !!((_a = _this._panInput) === null || _a === void 0 ? void 0 : _a.isEnabled());
|
|
6120
6172
|
};
|
|
6121
6173
|
|
|
6122
6174
|
this._preventClickWhenDragged = function (e) {
|
|
@@ -7079,7 +7131,7 @@ version: 4.7.3
|
|
|
7079
7131
|
var camera = flicking.camera;
|
|
7080
7132
|
var activeAnchor = camera.findActiveAnchor();
|
|
7081
7133
|
var anchorAtCamera = camera.findNearestAnchor(camera.position);
|
|
7082
|
-
var state =
|
|
7134
|
+
var state = this._controller.state;
|
|
7083
7135
|
|
|
7084
7136
|
if (!activeAnchor || !anchorAtCamera) {
|
|
7085
7137
|
return Promise.reject(new FlickingError(MESSAGE.POSITION_NOT_REACHABLE(position), CODE.POSITION_NOT_REACHABLE));
|
|
@@ -7097,10 +7149,13 @@ version: 4.7.3
|
|
|
7097
7149
|
targetAnchor = this._findSnappedAnchor(position, anchorAtCamera);
|
|
7098
7150
|
} else if (absPosDelta >= flicking.threshold && absPosDelta > 0) {
|
|
7099
7151
|
// Move to the adjacent panel
|
|
7100
|
-
targetAnchor = this._findAdjacentAnchor(posDelta, anchorAtCamera);
|
|
7152
|
+
targetAnchor = this._findAdjacentAnchor(position, posDelta, anchorAtCamera);
|
|
7101
7153
|
} else {
|
|
7102
7154
|
// Restore to active panel
|
|
7103
|
-
|
|
7155
|
+
return this.moveToPanel(activeAnchor.panel, {
|
|
7156
|
+
duration: duration,
|
|
7157
|
+
axesEvent: axesEvent
|
|
7158
|
+
});
|
|
7104
7159
|
}
|
|
7105
7160
|
|
|
7106
7161
|
this._triggerIndexChangeEvent(targetAnchor.panel, position, axesEvent);
|
|
@@ -7171,11 +7226,20 @@ version: 4.7.3
|
|
|
7171
7226
|
}
|
|
7172
7227
|
};
|
|
7173
7228
|
|
|
7174
|
-
__proto._findAdjacentAnchor = function (posDelta, anchorAtCamera) {
|
|
7229
|
+
__proto._findAdjacentAnchor = function (position, posDelta, anchorAtCamera) {
|
|
7175
7230
|
var _a;
|
|
7176
7231
|
|
|
7177
7232
|
var flicking = getFlickingAttached(this._flicking);
|
|
7178
7233
|
var camera = flicking.camera;
|
|
7234
|
+
|
|
7235
|
+
if (camera.circularEnabled) {
|
|
7236
|
+
var anchorIncludePosition = camera.findAnchorIncludePosition(position);
|
|
7237
|
+
|
|
7238
|
+
if (anchorIncludePosition && anchorIncludePosition.position !== anchorAtCamera.position) {
|
|
7239
|
+
return anchorIncludePosition;
|
|
7240
|
+
}
|
|
7241
|
+
}
|
|
7242
|
+
|
|
7179
7243
|
var adjacentAnchor = (_a = posDelta > 0 ? camera.getNextAnchor(anchorAtCamera) : camera.getPrevAnchor(anchorAtCamera)) !== null && _a !== void 0 ? _a : anchorAtCamera;
|
|
7180
7244
|
return adjacentAnchor;
|
|
7181
7245
|
};
|
|
@@ -7521,6 +7585,7 @@ version: 4.7.3
|
|
|
7521
7585
|
var axesRange = this._controller.range;
|
|
7522
7586
|
var indexRange = this._indexRange;
|
|
7523
7587
|
var cameraRange = camera.range;
|
|
7588
|
+
var state = this._controller.state;
|
|
7524
7589
|
var clampedPosition = clamp$1(camera.clampToReachablePosition(position), axesRange[0], axesRange[1]);
|
|
7525
7590
|
var anchorAtPosition = camera.findAnchorIncludePosition(clampedPosition);
|
|
7526
7591
|
|
|
@@ -7529,7 +7594,8 @@ version: 4.7.3
|
|
|
7529
7594
|
}
|
|
7530
7595
|
|
|
7531
7596
|
var prevPos = activePanel.position;
|
|
7532
|
-
var
|
|
7597
|
+
var posDelta = flicking.animating ? state.delta : position - camera.position;
|
|
7598
|
+
var isOverThreshold = Math.abs(posDelta) >= flicking.threshold;
|
|
7533
7599
|
var adjacentAnchor = position > prevPos ? camera.getNextAnchor(anchorAtPosition) : camera.getPrevAnchor(anchorAtPosition);
|
|
7534
7600
|
var targetPos;
|
|
7535
7601
|
var targetPanel;
|
|
@@ -8929,7 +8995,7 @@ version: 4.7.3
|
|
|
8929
8995
|
license: MIT
|
|
8930
8996
|
author: NAVER Corp.
|
|
8931
8997
|
repository: https://github.com/naver/egjs-imready
|
|
8932
|
-
version: 1.
|
|
8998
|
+
version: 1.3.0
|
|
8933
8999
|
*/
|
|
8934
9000
|
|
|
8935
9001
|
/*! *****************************************************************************
|
|
@@ -9016,8 +9082,12 @@ version: 4.7.3
|
|
|
9016
9082
|
|
|
9017
9083
|
return !!target.getAttribute(prefix + "width");
|
|
9018
9084
|
}
|
|
9019
|
-
function hasLoadingAttribute(target) {
|
|
9020
|
-
|
|
9085
|
+
function hasLoadingAttribute(target, prefix) {
|
|
9086
|
+
if (prefix === void 0) {
|
|
9087
|
+
prefix = "data-";
|
|
9088
|
+
}
|
|
9089
|
+
|
|
9090
|
+
return "loading" in target && target.getAttribute("loading") === "lazy" || !!target.getAttribute(prefix + "lazy");
|
|
9021
9091
|
}
|
|
9022
9092
|
function hasSkipAttribute(target, prefix) {
|
|
9023
9093
|
if (prefix === void 0) {
|
|
@@ -9142,6 +9212,11 @@ version: 4.7.3
|
|
|
9142
9212
|
|
|
9143
9213
|
if (e && e.type === "error") {
|
|
9144
9214
|
_this.onError(_this.element);
|
|
9215
|
+
}
|
|
9216
|
+
|
|
9217
|
+
if (_this.hasLoading && _this.checkElement()) {
|
|
9218
|
+
// I'm not ready
|
|
9219
|
+
return;
|
|
9145
9220
|
} // I'm pre-ready and ready!
|
|
9146
9221
|
|
|
9147
9222
|
|
|
@@ -9157,7 +9232,7 @@ version: 4.7.3
|
|
|
9157
9232
|
var prefix = _this.options.prefix;
|
|
9158
9233
|
_this.hasDataSize = hasSizeAttribute(element, prefix);
|
|
9159
9234
|
_this.isSkip = hasSkipAttribute(element, prefix);
|
|
9160
|
-
_this.hasLoading = hasLoadingAttribute(element);
|
|
9235
|
+
_this.hasLoading = hasLoadingAttribute(element, prefix);
|
|
9161
9236
|
return _this;
|
|
9162
9237
|
}
|
|
9163
9238
|
|
|
@@ -9543,6 +9618,7 @@ version: 4.7.3
|
|
|
9543
9618
|
|
|
9544
9619
|
var tagName = element.tagName.toLowerCase();
|
|
9545
9620
|
var loaders = this.options.loaders;
|
|
9621
|
+
var prefix = options.prefix;
|
|
9546
9622
|
var tags = Object.keys(loaders);
|
|
9547
9623
|
|
|
9548
9624
|
if (loaders[tagName]) {
|
|
@@ -9552,7 +9628,7 @@ version: 4.7.3
|
|
|
9552
9628
|
var loader = new ElementLoader(element, options);
|
|
9553
9629
|
var children = toArray(element.querySelectorAll(tags.join(", ")));
|
|
9554
9630
|
loader.setHasLoading(children.some(function (el) {
|
|
9555
|
-
return hasLoadingAttribute(el);
|
|
9631
|
+
return hasLoadingAttribute(el, prefix);
|
|
9556
9632
|
}));
|
|
9557
9633
|
var withPreReady = false;
|
|
9558
9634
|
var childrenImReady = this.clone().on("error", function (e) {
|
|
@@ -9637,13 +9713,13 @@ version: 4.7.3
|
|
|
9637
9713
|
* ```
|
|
9638
9714
|
*/
|
|
9639
9715
|
|
|
9640
|
-
this.trigger("error", {
|
|
9716
|
+
this.trigger(new ComponentEvent$1("error", {
|
|
9641
9717
|
element: info.element,
|
|
9642
9718
|
index: index,
|
|
9643
9719
|
target: target,
|
|
9644
9720
|
errorCount: this.getErrorCount(),
|
|
9645
9721
|
totalErrorCount: ++this.totalErrorCount
|
|
9646
|
-
});
|
|
9722
|
+
}));
|
|
9647
9723
|
};
|
|
9648
9724
|
|
|
9649
9725
|
__proto.onPreReadyElement = function (index) {
|
|
@@ -9677,7 +9753,7 @@ version: 4.7.3
|
|
|
9677
9753
|
* ```
|
|
9678
9754
|
*/
|
|
9679
9755
|
|
|
9680
|
-
this.trigger("preReadyElement", {
|
|
9756
|
+
this.trigger(new ComponentEvent$1("preReadyElement", {
|
|
9681
9757
|
element: info.element,
|
|
9682
9758
|
index: index,
|
|
9683
9759
|
preReadyCount: this.preReadyCount,
|
|
@@ -9687,7 +9763,7 @@ version: 4.7.3
|
|
|
9687
9763
|
isReady: this.isReady(),
|
|
9688
9764
|
hasLoading: info.hasLoading,
|
|
9689
9765
|
isSkip: info.isSkip
|
|
9690
|
-
});
|
|
9766
|
+
}));
|
|
9691
9767
|
};
|
|
9692
9768
|
|
|
9693
9769
|
__proto.onPreReady = function () {
|
|
@@ -9719,12 +9795,12 @@ version: 4.7.3
|
|
|
9719
9795
|
* ```
|
|
9720
9796
|
*/
|
|
9721
9797
|
|
|
9722
|
-
this.trigger("preReady", {
|
|
9798
|
+
this.trigger(new ComponentEvent$1("preReady", {
|
|
9723
9799
|
readyCount: this.readyCount,
|
|
9724
9800
|
totalCount: this.totalCount,
|
|
9725
9801
|
isReady: this.isReady(),
|
|
9726
9802
|
hasLoading: this.hasLoading()
|
|
9727
|
-
});
|
|
9803
|
+
}));
|
|
9728
9804
|
};
|
|
9729
9805
|
|
|
9730
9806
|
__proto.onReadyElement = function (index) {
|
|
@@ -9758,7 +9834,7 @@ version: 4.7.3
|
|
|
9758
9834
|
* ```
|
|
9759
9835
|
*/
|
|
9760
9836
|
|
|
9761
|
-
this.trigger("readyElement", {
|
|
9837
|
+
this.trigger(new ComponentEvent$1("readyElement", {
|
|
9762
9838
|
index: index,
|
|
9763
9839
|
element: info.element,
|
|
9764
9840
|
hasError: info.hasError,
|
|
@@ -9772,7 +9848,7 @@ version: 4.7.3
|
|
|
9772
9848
|
hasLoading: info.hasLoading,
|
|
9773
9849
|
isPreReadyOver: this.isPreReadyOver,
|
|
9774
9850
|
isSkip: info.isSkip
|
|
9775
|
-
});
|
|
9851
|
+
}));
|
|
9776
9852
|
};
|
|
9777
9853
|
|
|
9778
9854
|
__proto.onReady = function () {
|
|
@@ -9806,11 +9882,11 @@ version: 4.7.3
|
|
|
9806
9882
|
* });
|
|
9807
9883
|
* ```
|
|
9808
9884
|
*/
|
|
9809
|
-
this.trigger("ready", {
|
|
9885
|
+
this.trigger(new ComponentEvent$1("ready", {
|
|
9810
9886
|
errorCount: this.getErrorCount(),
|
|
9811
9887
|
totalErrorCount: this.totalErrorCount,
|
|
9812
9888
|
totalCount: this.totalCount
|
|
9813
|
-
});
|
|
9889
|
+
}));
|
|
9814
9890
|
};
|
|
9815
9891
|
|
|
9816
9892
|
__proto.getErrorCount = function () {
|
|
@@ -10975,7 +11051,8 @@ version: 4.7.3
|
|
|
10975
11051
|
__proto.resize = function (cached) {
|
|
10976
11052
|
var el = this.element;
|
|
10977
11053
|
var flicking = this._flicking;
|
|
10978
|
-
var horizontal = flicking.horizontal
|
|
11054
|
+
var horizontal = flicking.horizontal,
|
|
11055
|
+
useFractionalSize = flicking.useFractionalSize;
|
|
10979
11056
|
|
|
10980
11057
|
if (cached) {
|
|
10981
11058
|
this._size = cached.size;
|
|
@@ -10983,7 +11060,13 @@ version: 4.7.3
|
|
|
10983
11060
|
this._height = cached.height;
|
|
10984
11061
|
} else {
|
|
10985
11062
|
var elStyle = getStyle(el);
|
|
10986
|
-
this._size =
|
|
11063
|
+
this._size = getElementSize({
|
|
11064
|
+
el: el,
|
|
11065
|
+
horizontal: horizontal,
|
|
11066
|
+
useFractionalSize: useFractionalSize,
|
|
11067
|
+
useOffset: true,
|
|
11068
|
+
style: elStyle
|
|
11069
|
+
});
|
|
10987
11070
|
this._margin = horizontal ? {
|
|
10988
11071
|
prev: parseFloat(elStyle.marginLeft || "0"),
|
|
10989
11072
|
next: parseFloat(elStyle.marginRight || "0")
|
|
@@ -10991,7 +11074,13 @@ version: 4.7.3
|
|
|
10991
11074
|
prev: parseFloat(elStyle.marginTop || "0"),
|
|
10992
11075
|
next: parseFloat(elStyle.marginBottom || "0")
|
|
10993
11076
|
};
|
|
10994
|
-
this._height = horizontal ?
|
|
11077
|
+
this._height = horizontal ? getElementSize({
|
|
11078
|
+
el: el,
|
|
11079
|
+
horizontal: false,
|
|
11080
|
+
useFractionalSize: useFractionalSize,
|
|
11081
|
+
useOffset: true,
|
|
11082
|
+
style: elStyle
|
|
11083
|
+
}) : this._size;
|
|
10995
11084
|
}
|
|
10996
11085
|
|
|
10997
11086
|
this.updatePosition();
|
|
@@ -11685,24 +11774,28 @@ version: 4.7.3
|
|
|
11685
11774
|
preventClickOnDrag = _0 === void 0 ? true : _0,
|
|
11686
11775
|
_1 = _b.disableOnInit,
|
|
11687
11776
|
disableOnInit = _1 === void 0 ? false : _1,
|
|
11688
|
-
_2 = _b.
|
|
11689
|
-
|
|
11690
|
-
_3 = _b.
|
|
11691
|
-
|
|
11692
|
-
_4 = _b.
|
|
11693
|
-
|
|
11694
|
-
_5 = _b.
|
|
11695
|
-
|
|
11696
|
-
_6 = _b.
|
|
11697
|
-
|
|
11698
|
-
_7 = _b.
|
|
11699
|
-
|
|
11700
|
-
_8 = _b.
|
|
11701
|
-
|
|
11702
|
-
_9 = _b.
|
|
11703
|
-
|
|
11704
|
-
_10 = _b.
|
|
11705
|
-
|
|
11777
|
+
_2 = _b.changeOnHold,
|
|
11778
|
+
changeOnHold = _2 === void 0 ? false : _2,
|
|
11779
|
+
_3 = _b.renderOnlyVisible,
|
|
11780
|
+
renderOnlyVisible = _3 === void 0 ? false : _3,
|
|
11781
|
+
_4 = _b.virtual,
|
|
11782
|
+
virtual = _4 === void 0 ? null : _4,
|
|
11783
|
+
_5 = _b.autoInit,
|
|
11784
|
+
autoInit = _5 === void 0 ? true : _5,
|
|
11785
|
+
_6 = _b.autoResize,
|
|
11786
|
+
autoResize = _6 === void 0 ? true : _6,
|
|
11787
|
+
_7 = _b.useResizeObserver,
|
|
11788
|
+
useResizeObserver = _7 === void 0 ? true : _7,
|
|
11789
|
+
_8 = _b.resizeDebounce,
|
|
11790
|
+
resizeDebounce = _8 === void 0 ? 0 : _8,
|
|
11791
|
+
_9 = _b.maxResizeDebounce,
|
|
11792
|
+
maxResizeDebounce = _9 === void 0 ? 100 : _9,
|
|
11793
|
+
_10 = _b.useFractionalSize,
|
|
11794
|
+
useFractionalSize = _10 === void 0 ? false : _10,
|
|
11795
|
+
_11 = _b.externalRenderer,
|
|
11796
|
+
externalRenderer = _11 === void 0 ? null : _11,
|
|
11797
|
+
_12 = _b.renderExternal,
|
|
11798
|
+
renderExternal = _12 === void 0 ? null : _12;
|
|
11706
11799
|
|
|
11707
11800
|
var _this = _super.call(this) || this; // Internal states
|
|
11708
11801
|
|
|
@@ -11735,16 +11828,18 @@ version: 4.7.3
|
|
|
11735
11828
|
_this._iOSEdgeSwipeThreshold = iOSEdgeSwipeThreshold;
|
|
11736
11829
|
_this._preventClickOnDrag = preventClickOnDrag;
|
|
11737
11830
|
_this._disableOnInit = disableOnInit;
|
|
11831
|
+
_this._changeOnHold = changeOnHold;
|
|
11738
11832
|
_this._renderOnlyVisible = renderOnlyVisible;
|
|
11739
11833
|
_this._autoInit = autoInit;
|
|
11740
11834
|
_this._autoResize = autoResize;
|
|
11741
11835
|
_this._useResizeObserver = useResizeObserver;
|
|
11742
11836
|
_this._resizeDebounce = resizeDebounce;
|
|
11743
11837
|
_this._maxResizeDebounce = maxResizeDebounce;
|
|
11838
|
+
_this._useFractionalSize = useFractionalSize;
|
|
11744
11839
|
_this._externalRenderer = externalRenderer;
|
|
11745
11840
|
_this._renderExternal = renderExternal; // Create core components
|
|
11746
11841
|
|
|
11747
|
-
_this._viewport = new Viewport(getElement(root));
|
|
11842
|
+
_this._viewport = new Viewport(_this, getElement(root));
|
|
11748
11843
|
_this._autoResizer = new AutoResizer(_this);
|
|
11749
11844
|
_this._renderer = _this._createRenderer();
|
|
11750
11845
|
_this._camera = _this._createCamera();
|
|
@@ -12491,6 +12586,24 @@ version: 4.7.3
|
|
|
12491
12586
|
enumerable: false,
|
|
12492
12587
|
configurable: true
|
|
12493
12588
|
});
|
|
12589
|
+
Object.defineProperty(__proto, "changeOnHold", {
|
|
12590
|
+
/**
|
|
12591
|
+
* Change active panel index on mouse/touch hold while animating.
|
|
12592
|
+
* `index` of the `willChange`/`willRestore` event will be used as new index.
|
|
12593
|
+
* @ko 애니메이션 도중 마우스/터치 입력시 현재 활성화된 패널의 인덱스를 변경합니다.
|
|
12594
|
+
* `willChange`/`willRestore` 이벤트의 `index`값이 새로운 인덱스로 사용될 것입니다.
|
|
12595
|
+
* @type {boolean}
|
|
12596
|
+
* @default false
|
|
12597
|
+
*/
|
|
12598
|
+
get: function () {
|
|
12599
|
+
return this._changeOnHold;
|
|
12600
|
+
},
|
|
12601
|
+
set: function (val) {
|
|
12602
|
+
this._changeOnHold = val;
|
|
12603
|
+
},
|
|
12604
|
+
enumerable: false,
|
|
12605
|
+
configurable: true
|
|
12606
|
+
});
|
|
12494
12607
|
Object.defineProperty(__proto, "renderOnlyVisible", {
|
|
12495
12608
|
// PERFORMANCE
|
|
12496
12609
|
|
|
@@ -12639,6 +12752,23 @@ version: 4.7.3
|
|
|
12639
12752
|
enumerable: false,
|
|
12640
12753
|
configurable: true
|
|
12641
12754
|
});
|
|
12755
|
+
Object.defineProperty(__proto, "useFractionalSize", {
|
|
12756
|
+
/**
|
|
12757
|
+
* By enabling this, Flicking will calculate all internal size with CSS width computed with getComputedStyle.
|
|
12758
|
+
* This can prevent 1px offset issue in some cases where panel size has the fractional part.
|
|
12759
|
+
* All sizes will have the original size before CSS {@link https://developer.mozilla.org/en-US/docs/Web/CSS/transform transform} is applied on the element.
|
|
12760
|
+
* @ko 이 옵션을 활성화할 경우, Flicking은 내부의 모든 크기를 {@link https://developer.mozilla.org/en-US/docs/Web/API/Element/getBoundingClientRect getBoundingClientRect}를 이용하여 계산합니다.
|
|
12761
|
+
* 이를 통해, 패널 크기에 소수점을 포함할 경우에 발생할 수 있는 일부 1px 오프셋 이슈를 해결 가능합니다.
|
|
12762
|
+
* 모든 크기는 CSS {@link https://developer.mozilla.org/en-US/docs/Web/CSS/transform transform}이 엘리먼트에 적용되기 이전의 크기를 사용할 것입니다.
|
|
12763
|
+
* @type {boolean}
|
|
12764
|
+
* @default false
|
|
12765
|
+
*/
|
|
12766
|
+
get: function () {
|
|
12767
|
+
return this._useFractionalSize;
|
|
12768
|
+
},
|
|
12769
|
+
enumerable: false,
|
|
12770
|
+
configurable: true
|
|
12771
|
+
});
|
|
12642
12772
|
Object.defineProperty(__proto, "externalRenderer", {
|
|
12643
12773
|
/**
|
|
12644
12774
|
* This is an option for the frameworks(React, Vue, Angular, ...). Don't set it as it's automatically managed by Flicking.
|
|
@@ -13171,6 +13301,8 @@ version: 4.7.3
|
|
|
13171
13301
|
camera.updateAlignPos();
|
|
13172
13302
|
camera.updateRange();
|
|
13173
13303
|
camera.updateAnchors();
|
|
13304
|
+
camera.updateAdaptiveHeight();
|
|
13305
|
+
camera.updateOffset();
|
|
13174
13306
|
return [4
|
|
13175
13307
|
/*yield*/
|
|
13176
13308
|
, renderer.render()];
|
|
@@ -13448,7 +13580,7 @@ version: 4.7.3
|
|
|
13448
13580
|
*/
|
|
13449
13581
|
|
|
13450
13582
|
|
|
13451
|
-
Flicking.VERSION = "4.
|
|
13583
|
+
Flicking.VERSION = "4.9.0";
|
|
13452
13584
|
return Flicking;
|
|
13453
13585
|
}(Component);
|
|
13454
13586
|
|