@egjs/flicking 4.8.1 → 4.9.2

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.
@@ -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.8.1
7
+ version: 4.9.2
8
8
  */
9
9
  (function (global, factory) {
10
10
  typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
@@ -1087,7 +1087,7 @@ version: 4.8.1
1087
1087
  var parsePanelAlign = function (align) {
1088
1088
  return typeof align === "object" ? align.panel : align;
1089
1089
  };
1090
- var getDirection = function (start, end) {
1090
+ var getDirection$1 = function (start, end) {
1091
1091
  if (start === end) return DIRECTION.NONE;
1092
1092
  return start < end ? DIRECTION.NEXT : DIRECTION.PREV;
1093
1093
  };
@@ -1248,6 +1248,29 @@ version: 4.8.1
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;
@@ -1267,7 +1290,7 @@ version: 4.8.1
1267
1290
  parseArithmeticExpression: parseArithmeticExpression,
1268
1291
  parseCSSSizeValue: parseCSSSizeValue,
1269
1292
  parsePanelAlign: parsePanelAlign,
1270
- getDirection: getDirection,
1293
+ getDirection: getDirection$1,
1271
1294
  parseElement: parseElement,
1272
1295
  getMinusCompensatedIndex: getMinusCompensatedIndex,
1273
1296
  includes: includes,
@@ -1282,6 +1305,7 @@ version: 4.8.1
1282
1305
  isBetween: isBetween,
1283
1306
  circulateIndex: circulateIndex,
1284
1307
  range: range,
1308
+ getElementSize: getElementSize,
1285
1309
  setPrototypeOf: setPrototypeOf
1286
1310
  };
1287
1311
 
@@ -1330,10 +1354,6 @@ version: 4.8.1
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.8.1
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.8.1
1461
1482
  __proto.resize = function () {
1462
1483
  var el = this._el;
1463
1484
  var elStyle = getStyle(el);
1464
- this._width = el.clientWidth;
1465
- this._height = el.clientHeight;
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.8.1
1916
1950
  license: MIT
1917
1951
  author: NAVER Corp.
1918
1952
  repository: git+https://github.com/naver/agent.git
1919
- version: 2.3.0
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.8.1
1940
1974
 
1941
1975
  return null;
1942
1976
  }
1943
- function getUserAgent(agent) {
1977
+ function getUserAgentString(agent) {
1944
1978
  var userAgent = agent;
1945
1979
 
1946
1980
  if (typeof userAgent === "undefined") {
@@ -2106,15 +2140,18 @@ version: 4.8.1
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.8.1
2124
2161
  id: "webos"
2125
2162
  }];
2126
2163
 
2127
- function parseUserAgentData(osData) {
2128
- var userAgentData = navigator.userAgentData;
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
- function parseUserAgent(userAgent) {
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: !!findPreset(WEBVIEW_PRESETS, nextAgent).preset,
2174
+ webview: isWebView(nextAgent),
2206
2175
  chromium: false,
2207
2176
  chromiumVersion: "-1",
2208
2177
  webkit: false,
@@ -2240,7 +2209,7 @@ version: 4.8.1
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.8.1
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,19 +2312,121 @@ version: 4.8.1
2269
2312
 
2270
2313
  function agent(userAgent) {
2271
2314
  if (typeof userAgent === "undefined" && hasUserAgentData()) {
2272
- return parseUserAgentData();
2315
+ return getClientHintsAgent();
2273
2316
  } else {
2274
- return parseUserAgent(userAgent);
2317
+ return getLegacyAgent(userAgent);
2275
2318
  }
2276
2319
  }
2277
2320
 
2278
2321
  /*
2279
- Copyright (c) 2015 NAVER Corp.
2322
+ Copyright (c) NAVER Crop.
2323
+ name: @cfcs/core
2324
+ license: MIT
2325
+ author: NAVER Crop.
2326
+ repository: https://github.com/naver/cfcs
2327
+ version: 0.0.4
2328
+ */
2329
+
2330
+ /**
2331
+ * cfcs
2332
+ * Copyright (c) 2022-present NAVER Corp.
2333
+ * MIT license
2334
+ */
2335
+ function keys(obj) {
2336
+ return Object.keys(obj);
2337
+ }
2338
+
2339
+ var OBSERVERS_PATH = "__observers__";
2340
+
2341
+ var Observer =
2342
+ /*#__PURE__*/
2343
+ function () {
2344
+ function Observer(value) {
2345
+ this._emitter = new Component();
2346
+ this._current = value;
2347
+ }
2348
+
2349
+ var __proto = Observer.prototype;
2350
+ Object.defineProperty(__proto, "current", {
2351
+ get: function () {
2352
+ return this._current;
2353
+ },
2354
+ set: function (value) {
2355
+ var isUpdate = value !== this._current;
2356
+ this._current = value;
2357
+
2358
+ if (isUpdate) {
2359
+ this._emitter.trigger("update", value);
2360
+ }
2361
+ },
2362
+ enumerable: false,
2363
+ configurable: true
2364
+ });
2365
+
2366
+ __proto.subscribe = function (callback) {
2367
+ this._emitter.on("update", callback);
2368
+ };
2369
+
2370
+ __proto.unsubscribe = function (callback) {
2371
+ this._emitter.off("update", callback);
2372
+ };
2373
+
2374
+ return Observer;
2375
+ }();
2376
+ function observe(defaultValue) {
2377
+ return new Observer(defaultValue);
2378
+ }
2379
+ function getObservers(instance) {
2380
+ if (!instance[OBSERVERS_PATH]) {
2381
+ instance[OBSERVERS_PATH] = {};
2382
+ }
2383
+
2384
+ return instance[OBSERVERS_PATH];
2385
+ }
2386
+ function getObserver(instance, name, defaultValue) {
2387
+ var observers = getObservers(instance);
2388
+
2389
+ if (!observers[name]) {
2390
+ observers[name] = observe(defaultValue);
2391
+ }
2392
+
2393
+ return observers[name];
2394
+ }
2395
+
2396
+ function injectReactiveSubscribe(object) {
2397
+ object["subscribe"] = function (name, callback) {
2398
+ getObserver(this, name).subscribe(callback);
2399
+ };
2400
+
2401
+ object["unsubscribe"] = function (name, callback) {
2402
+ var _this = this;
2403
+
2404
+ if (!name) {
2405
+ keys(getObservers(this)).forEach(function (observerName) {
2406
+ _this.unsubscribe(observerName);
2407
+ });
2408
+ return;
2409
+ }
2410
+
2411
+ if (!(name in this)) {
2412
+ return;
2413
+ }
2414
+
2415
+ getObserver(this, name).unsubscribe(callback);
2416
+ };
2417
+ }
2418
+ function ReactiveSubscribe(Constructor) {
2419
+ var prototype = Constructor.prototype;
2420
+ injectReactiveSubscribe(prototype);
2421
+ }
2422
+
2423
+ /*
2424
+ Copyright (c) NAVER Corp.
2280
2425
  name: @egjs/axes
2281
2426
  license: MIT
2282
2427
  author: NAVER Corp.
2283
2428
  repository: https://github.com/naver/egjs-axes
2284
- version: 3.2.2
2429
+ version: 3.6.0
2285
2430
  */
2286
2431
 
2287
2432
  /*! *****************************************************************************
@@ -2334,6 +2479,18 @@ version: 4.8.1
2334
2479
 
2335
2480
  return __assign$1.apply(this, arguments);
2336
2481
  };
2482
+ function __decorate(decorators, target, key, desc) {
2483
+ var c = arguments.length,
2484
+ r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc,
2485
+ d;
2486
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
2487
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
2488
+ }
2489
+
2490
+ /*
2491
+ * Copyright (c) 2015 NAVER Corp.
2492
+ * egjs projects are licensed under the MIT license
2493
+ */
2337
2494
 
2338
2495
  /* eslint-disable no-new-func, no-nested-ternary */
2339
2496
  var win;
@@ -2349,6 +2506,10 @@ version: 4.8.1
2349
2506
  win = window;
2350
2507
  }
2351
2508
 
2509
+ /*
2510
+ * Copyright (c) 2015 NAVER Corp.
2511
+ * egjs projects are licensed under the MIT license
2512
+ */
2352
2513
  var DIRECTION_NONE = 1;
2353
2514
  var DIRECTION_LEFT = 2;
2354
2515
  var DIRECTION_RIGHT = 4;
@@ -2423,6 +2584,8 @@ version: 4.8.1
2423
2584
  } else if (param === win) {
2424
2585
  // window
2425
2586
  el = param;
2587
+ } else if ("value" in param || "current" in param) {
2588
+ el = param.value || param.current;
2426
2589
  } else if (param.nodeName && (param.nodeType === 1 || param.nodeType === 9)) {
2427
2590
  // HTMLElement, Document
2428
2591
  el = param;
@@ -2484,7 +2647,7 @@ version: 4.8.1
2484
2647
  };
2485
2648
  /**
2486
2649
  * A polyfill for the window.cancelAnimationFrame() method. It cancels an animation executed through a call to the requestAnimationFrame() method.
2487
- * @param {Number} key − The ID value returned through a call to the requestAnimationFrame() method. <ko>requestAnimationFrame() 메서드가 반환한 아이디 값</ko>
2650
+ * @param {Number} key − The ID value returned through a call to the requestAnimationFrame() method. <ko>requestAnimationFrame() 메서드가 반환한 아이디 값</ko>
2488
2651
  * @see https://developer.mozilla.org/en-US/docs/Web/API/Window/cancelAnimationFrame
2489
2652
  * @private
2490
2653
  */
@@ -2551,7 +2714,7 @@ version: 4.8.1
2551
2714
  return 0;
2552
2715
  }
2553
2716
 
2554
- var v = "" + val;
2717
+ var v = "".concat(val);
2555
2718
 
2556
2719
  if (v.indexOf("e") >= 0) {
2557
2720
  // Exponential Format
@@ -2598,6 +2761,33 @@ version: 4.8.1
2598
2761
  });
2599
2762
  return same;
2600
2763
  };
2764
+ var getDirection = function (useHorizontal, useVertical) {
2765
+ if (useHorizontal && useVertical) {
2766
+ return DIRECTION_ALL;
2767
+ } else if (useHorizontal) {
2768
+ return DIRECTION_HORIZONTAL;
2769
+ } else if (useVertical) {
2770
+ return DIRECTION_VERTICAL;
2771
+ } else {
2772
+ return DIRECTION_NONE;
2773
+ }
2774
+ };
2775
+ var getInitialPos = function (axis, startPos) {
2776
+ return __assign$1(__assign$1({}, Object.keys(axis).reduce(function (result, key) {
2777
+ var _a;
2778
+
2779
+ var _b, _c;
2780
+
2781
+ return Object.assign(result, (_a = {}, _a[key] = (_c = (_b = axis[key].startPos) !== null && _b !== void 0 ? _b : axis[key].range[0]) !== null && _c !== void 0 ? _c : 0, _a));
2782
+ }, {})), startPos);
2783
+ };
2784
+ var useDirection = function (checkType, direction, userDirection) {
2785
+ if (userDirection) {
2786
+ return !!(direction === DIRECTION_ALL || direction & checkType && userDirection & checkType);
2787
+ } else {
2788
+ return !!(direction & checkType);
2789
+ }
2790
+ };
2601
2791
  var setCssProps = function (element, option, direction) {
2602
2792
  var _a;
2603
2793
 
@@ -2807,6 +2997,8 @@ version: 4.8.1
2807
2997
 
2808
2998
 
2809
2999
  __proto.triggerChange = function (pos, depaPos, option, holding) {
3000
+ var _this = this;
3001
+
2810
3002
  if (holding === void 0) {
2811
3003
  holding = false;
2812
3004
  }
@@ -2829,12 +3021,18 @@ version: 4.8.1
2829
3021
  inputEvent: inputEvent,
2830
3022
  isTrusted: !!inputEvent,
2831
3023
  input: (option === null || option === void 0 ? void 0 : option.input) || (eventInfo === null || eventInfo === void 0 ? void 0 : eventInfo.input) || null,
2832
- set: inputEvent ? this._createUserControll(moveTo.pos) : function () {}
3024
+ set: inputEvent ? this._createUserControll(moveTo.pos) : function () {} // eslint-disable-line @typescript-eslint/no-empty-function
3025
+
2833
3026
  };
2834
3027
  var event = new ComponentEvent$1("change", param);
2835
3028
 
2836
3029
  this._axes.trigger(event);
2837
3030
 
3031
+ Object.keys(moveTo.pos).forEach(function (axis) {
3032
+ var p = moveTo.pos[axis];
3033
+ getObserver(_this._axes, axis, p).current = p;
3034
+ });
3035
+
2838
3036
  if (inputEvent) {
2839
3037
  axisManager.set(param.set().destPos);
2840
3038
  }
@@ -2993,7 +3191,7 @@ version: 4.8.1
2993
3191
  __proto._getRoundPos = function (pos, depaPos) {
2994
3192
  // round value if round exist
2995
3193
  var roundUnit = this._axes.options.round; // if (round == null) {
2996
- // return {pos, depaPos}; // undefined, undefined
3194
+ // return {pos, depaPos}; // undefined, undefined
2997
3195
  // }
2998
3196
 
2999
3197
  return {
@@ -3045,6 +3243,10 @@ version: 4.8.1
3045
3243
  return InterruptManager;
3046
3244
  }();
3047
3245
 
3246
+ /*
3247
+ * Copyright (c) 2015 NAVER Corp.
3248
+ * egjs projects are licensed under the MIT license
3249
+ */
3048
3250
  var getInsidePosition = function (destPos, range, circular, bounce) {
3049
3251
  var toDestPos = destPos;
3050
3252
  var targetRange = [circular[0] ? range[0] : bounce ? range[0] - bounce[0] : range[0], circular[1] ? range[1] : bounce ? range[1] + bounce[1] : range[1]];
@@ -3195,6 +3397,7 @@ version: 4.8.1
3195
3397
  Object.keys(this._axis).forEach(function (axis) {
3196
3398
  _this._axis[axis] = __assign$1({
3197
3399
  range: [0, 100],
3400
+ startPos: _this._axis[axis].range[0],
3198
3401
  bounce: [0, 0],
3199
3402
  circular: [false, false]
3200
3403
  }, _this._axis[axis]);
@@ -3794,7 +3997,7 @@ version: 4.8.1
3794
3997
  this._moveDistance = this._axisManager.get(input.axes);
3795
3998
  };
3796
3999
 
3797
- __proto.change = function (input, event, offset, useDuration) {
4000
+ __proto.change = function (input, event, offset, useAnimation) {
3798
4001
  if (this._isStopped || !this._interruptManager.isInterrupting() || this._axisManager.every(offset, function (v) {
3799
4002
  return v === 0;
3800
4003
  })) {
@@ -3842,7 +4045,7 @@ version: 4.8.1
3842
4045
  event: event
3843
4046
  };
3844
4047
 
3845
- if (useDuration) {
4048
+ if (useAnimation) {
3846
4049
  var duration = this._animationManager.getDuration(destPos, depaPos);
3847
4050
 
3848
4051
  this._animationManager.animateTo(destPos, duration, changeOption);
@@ -4429,6 +4632,7 @@ version: 4.8.1
4429
4632
  * @param {Number[]} [range] The coordinate of range <ko>좌표 범위</ko>
4430
4633
  * @param {Number} [range[0]=0] The coordinate of the minimum <ko>최소 좌표</ko>
4431
4634
  * @param {Number} [range[1]=0] The coordinate of the maximum <ko>최대 좌표</ko>
4635
+ * @param {Number} [startPos=range[0]] The coordinates to be moved when creating an instance <ko>인스턴스 생성시 이동할 좌표</ko>
4432
4636
  * @param {Number[]} [bounce] The size of bouncing area. The coordinates can exceed the coordinate area as much as the bouncing area based on user action. If the coordinates does not exceed the bouncing area when an element is dragged, the coordinates where bouncing effects are applied are retuned back into the coordinate area<ko>바운스 영역의 크기. 사용자의 동작에 따라 좌표가 좌표 영역을 넘어 바운스 영역의 크기만큼 더 이동할 수 있다. 사용자가 끌어다 놓는 동작을 했을 때 좌표가 바운스 영역에 있으면, 바운스 효과가 적용된 좌표가 다시 좌표 영역 안으로 들어온다</ko>
4433
4637
  * @param {Number} [bounce[0]=0] The size of coordinate of the minimum area <ko>최소 좌표 바운스 영역의 크기</ko>
4434
4638
  * @param {Number} [bounce[1]=0] The size of coordinate of the maximum area <ko>최대 좌표 바운스 영역의 크기</ko>
@@ -4463,50 +4667,50 @@ version: 4.8.1
4463
4667
  *
4464
4668
  * @param {Object.<string, AxisOption>} axis Axis information managed by eg.Axes. The key of the axis specifies the name to use as the logical virtual coordinate system. <ko>eg.Axes가 관리하는 축 정보. 축의 키는 논리적인 가상 좌표계로 사용할 이름을 지정한다.</ko>
4465
4669
  * @param {AxesOption} [options={}] The option object of the eg.Axes module<ko>eg.Axes 모듈의 옵션 객체</ko>
4466
- * @param {Object.<string, number>} [startPos=null] The coordinates to be moved when creating an instance. not triggering change event.<ko>인스턴스 생성시 이동할 좌표, change 이벤트는 발생하지 않음.</ko>
4670
+ * @param {Object.<string, number>} [startPos=null] The coordinates to be moved when creating an instance. It is applied with higher priority than startPos of axisOption.<ko>인스턴스 생성시 이동할 좌표, axisOption의 startPos보다 높은 우선순위로 적용된다.</ko>
4467
4671
  *
4468
4672
  * @support {"ie": "10+", "ch" : "latest", "ff" : "latest", "sf" : "latest", "edge" : "latest", "ios" : "7+", "an" : "2.3+ (except 3.x)"}
4469
4673
  * @example
4470
4674
  * ```js
4471
4675
  * // 1. Initialize eg.Axes
4472
4676
  * const axes = new eg.Axes({
4473
- * something1: {
4474
- * range: [0, 150],
4475
- * bounce: 50
4476
- * },
4477
- * something2: {
4478
- * range: [0, 200],
4479
- * bounce: 100
4480
- * },
4481
- * somethingN: {
4482
- * range: [1, 10],
4483
- * }
4677
+ * something1: {
4678
+ * range: [0, 150],
4679
+ * bounce: 50
4680
+ * },
4681
+ * something2: {
4682
+ * range: [0, 200],
4683
+ * bounce: 100
4684
+ * },
4685
+ * somethingN: {
4686
+ * range: [1, 10],
4687
+ * }
4484
4688
  * }, {
4485
4689
  * deceleration : 0.0024
4486
4690
  * });
4487
4691
  *
4488
4692
  * // 2. attach event handler
4489
4693
  * axes.on({
4490
- * "hold" : function(evt) {
4491
- * },
4492
- * "release" : function(evt) {
4493
- * },
4494
- * "animationStart" : function(evt) {
4495
- * },
4496
- * "animationEnd" : function(evt) {
4497
- * },
4498
- * "change" : function(evt) {
4499
- * }
4694
+ * "hold" : function(evt) {
4695
+ * },
4696
+ * "release" : function(evt) {
4697
+ * },
4698
+ * "animationStart" : function(evt) {
4699
+ * },
4700
+ * "animationEnd" : function(evt) {
4701
+ * },
4702
+ * "change" : function(evt) {
4703
+ * }
4500
4704
  * });
4501
4705
  *
4502
4706
  * // 3. Initialize inputTypes
4503
4707
  * const panInputArea = new eg.Axes.PanInput("#area", {
4504
- * scale: [0.5, 1]
4708
+ * scale: [0.5, 1]
4505
4709
  * });
4506
4710
  * const panInputHmove = new eg.Axes.PanInput("#hmove");
4507
4711
  * const panInputVmove = new eg.Axes.PanInput("#vmove");
4508
4712
  * const pinchInputArea = new eg.Axes.PinchInput("#area", {
4509
- * scale: 1.5
4713
+ * scale: 1.5
4510
4714
  * });
4511
4715
  *
4512
4716
  * // 4. Connect eg.Axes and InputTypes
@@ -4571,9 +4775,7 @@ version: 4.8.1
4571
4775
 
4572
4776
  _this.eventManager.setAnimationManager(_this.animationManager);
4573
4777
 
4574
- if (startPos) {
4575
- _this.eventManager.triggerChange(startPos);
4576
- }
4778
+ _this.eventManager.triggerChange(getInitialPos(axis, startPos));
4577
4779
 
4578
4780
  return _this;
4579
4781
  }
@@ -4690,7 +4892,7 @@ version: 4.8.1
4690
4892
  * "xOther": {
4691
4893
  * range: [-100, 100]
4692
4894
  * },
4693
- * "zoom": {
4895
+ * "zoom": {
4694
4896
  * range: [50, 30]
4695
4897
  * }
4696
4898
  * });
@@ -4719,7 +4921,7 @@ version: 4.8.1
4719
4921
  * "xOther": {
4720
4922
  * range: [-100, 100]
4721
4923
  * },
4722
- * "zoom": {
4924
+ * "zoom": {
4723
4925
  * range: [50, 30]
4724
4926
  * }
4725
4927
  * });
@@ -4758,7 +4960,7 @@ version: 4.8.1
4758
4960
  * "xOther": {
4759
4961
  * range: [-100, 100]
4760
4962
  * },
4761
- * "zoom": {
4963
+ * "zoom": {
4762
4964
  * range: [50, 30]
4763
4965
  * }
4764
4966
  * });
@@ -4854,7 +5056,7 @@ version: 4.8.1
4854
5056
  * "xOther": {
4855
5057
  * range: [-100, 100]
4856
5058
  * },
4857
- * "zoom": {
5059
+ * "zoom": {
4858
5060
  * range: [50, 30]
4859
5061
  * }
4860
5062
  * });
@@ -4893,7 +5095,7 @@ version: 4.8.1
4893
5095
  */
4894
5096
 
4895
5097
 
4896
- Axes.VERSION = "3.2.2";
5098
+ Axes.VERSION = "3.6.0";
4897
5099
  /* eslint-enable */
4898
5100
 
4899
5101
  /**
@@ -4966,10 +5168,14 @@ version: 4.8.1
4966
5168
  */
4967
5169
 
4968
5170
  Axes.DIRECTION_ALL = DIRECTION_ALL;
5171
+ Axes = __decorate([ReactiveSubscribe], Axes);
4969
5172
  return Axes;
4970
5173
  }(Component);
4971
5174
 
4972
- /* eslint-disable @typescript-eslint/no-empty-function */
5175
+ /*
5176
+ * Copyright (c) 2015 NAVER Corp.
5177
+ * egjs projects are licensed under the MIT license
5178
+ */
4973
5179
 
4974
5180
  var getDirectionByAngle = function (angle, thresholdAngle) {
4975
5181
  if (thresholdAngle < 0 || thresholdAngle > 90) {
@@ -4979,13 +5185,6 @@ version: 4.8.1
4979
5185
  var toAngle = Math.abs(angle);
4980
5186
  return toAngle > thresholdAngle && toAngle < 180 - thresholdAngle ? DIRECTION_VERTICAL : DIRECTION_HORIZONTAL;
4981
5187
  };
4982
- var useDirection = function (checkType, direction, userDirection) {
4983
- if (userDirection) {
4984
- return !!(direction === DIRECTION_ALL || direction & checkType && userDirection & checkType);
4985
- } else {
4986
- return !!(direction & checkType);
4987
- }
4988
- };
4989
5188
  /**
4990
5189
  * @typedef {Object} PanInputOption The option object of the eg.Axes.PanInput module.
4991
5190
  * @ko eg.Axes.PanInput 모듈의 옵션 객체
@@ -5019,8 +5218,8 @@ version: 4.8.1
5019
5218
  * @example
5020
5219
  * ```js
5021
5220
  * const pan = new eg.Axes.PanInput("#area", {
5022
- * inputType: ["touch"],
5023
- * scale: [1, 1.3],
5221
+ * inputType: ["touch"],
5222
+ * scale: [1, 1.3],
5024
5223
  * });
5025
5224
  *
5026
5225
  * // Connect the 'something2' axis to the mouse or touchscreen x position when the mouse or touchscreen is down and moved.
@@ -5033,7 +5232,7 @@ version: 4.8.1
5033
5232
  * // Connect only one 'something2' axis to the mouse or touchscreen y position when the mouse or touchscreen is down and moved.
5034
5233
  * axes.connect(["", "something2"], pan); // or axes.connect(" something2", pan);
5035
5234
  * ```
5036
- * @param {HTMLElement|String|jQuery} element An element to use the eg.Axes.PanInput module <ko>eg.Axes.PanInput 모듈을 사용할 엘리먼트</ko>
5235
+ * @param {String|HTMLElement|Ref<HTMLElement>|jQuery} element An element to use the eg.Axes.PanInput module <ko>eg.Axes.PanInput 모듈을 사용할 엘리먼트</ko>
5037
5236
  * @param {PanInputOption} [options={}] The option object of the eg.Axes.PanInput module<ko>eg.Axes.PanInput 모듈의 옵션 객체</ko>
5038
5237
  */
5039
5238
 
@@ -5044,8 +5243,6 @@ version: 4.8.1
5044
5243
  *
5045
5244
  */
5046
5245
  function PanInput(el, options) {
5047
- var _this = this;
5048
-
5049
5246
  this.axes = [];
5050
5247
  this.element = null;
5051
5248
  this._enabled = false;
@@ -5053,16 +5250,7 @@ version: 4.8.1
5053
5250
  this._atRightEdge = false;
5054
5251
  this._rightEdgeTimer = 0;
5055
5252
 
5056
- this._forceRelease = function () {
5057
- var activeEvent = _this._activeEvent;
5058
- var prevEvent = activeEvent.prevEvent;
5059
-
5060
- _this._detachWindowEvent(activeEvent);
5061
-
5062
- activeEvent.onRelease();
5063
-
5064
- _this._observer.release(_this, prevEvent, [0, 0]);
5065
- };
5253
+ this._voidFunction = function () {};
5066
5254
 
5067
5255
  this.element = $(el);
5068
5256
  this.options = __assign$1({
@@ -5083,19 +5271,7 @@ version: 4.8.1
5083
5271
  var __proto = PanInput.prototype;
5084
5272
 
5085
5273
  __proto.mapAxes = function (axes) {
5086
- var useHorizontal = !!axes[0];
5087
- var useVertical = !!axes[1];
5088
-
5089
- if (useHorizontal && useVertical) {
5090
- this._direction = DIRECTION_ALL;
5091
- } else if (useHorizontal) {
5092
- this._direction = DIRECTION_HORIZONTAL;
5093
- } else if (useVertical) {
5094
- this._direction = DIRECTION_VERTICAL;
5095
- } else {
5096
- this._direction = DIRECTION_NONE;
5097
- }
5098
-
5274
+ this._direction = getDirection(!!axes[0], !!axes[1]);
5099
5275
  this.axes = axes;
5100
5276
  };
5101
5277
 
@@ -5158,7 +5334,7 @@ version: 4.8.1
5158
5334
  };
5159
5335
  /**
5160
5336
  * Returns whether to use an input device
5161
- * @ko 입력 장치를 사용 여부를 반환한다.
5337
+ * @ko 입력 장치 사용 여부를 반환한다.
5162
5338
  * @return {Boolean} Whether to use an input device <ko>입력장치 사용여부</ko>
5163
5339
  */
5164
5340
 
@@ -5166,6 +5342,24 @@ version: 4.8.1
5166
5342
  __proto.isEnabled = function () {
5167
5343
  return this._enabled;
5168
5344
  };
5345
+ /**
5346
+ * Releases current user input.
5347
+ * @ko 사용자의 입력을 강제로 중단시킨다.
5348
+ * @return {PanInput} An instance of a module itself <ko>모듈 자신의 인스턴스</ko>
5349
+ */
5350
+
5351
+
5352
+ __proto.release = function () {
5353
+ var activeEvent = this._activeEvent;
5354
+ var prevEvent = activeEvent.prevEvent;
5355
+ activeEvent.onRelease();
5356
+
5357
+ this._observer.release(this, prevEvent, [0, 0]);
5358
+
5359
+ this._detachWindowEvent(activeEvent);
5360
+
5361
+ return this;
5362
+ };
5169
5363
 
5170
5364
  __proto._onPanstart = function (event) {
5171
5365
  var activeEvent = this._activeEvent;
@@ -5214,8 +5408,7 @@ version: 4.8.1
5214
5408
 
5215
5409
  if (swipeLeftToRight) {
5216
5410
  // iOS swipe left => right
5217
- this._forceRelease();
5218
-
5411
+ this.release();
5219
5412
  return;
5220
5413
  } else if (this._atRightEdge) {
5221
5414
  clearTimeout(this._rightEdgeTimer); // - is right to left
@@ -5227,13 +5420,13 @@ version: 4.8.1
5227
5420
  } else {
5228
5421
  // iOS swipe right => left
5229
5422
  this._rightEdgeTimer = window.setTimeout(function () {
5230
- return _this._forceRelease();
5423
+ return _this.release();
5231
5424
  }, 100);
5232
5425
  }
5233
5426
  }
5234
5427
  }
5235
5428
 
5236
- var offset = this._applyScale([panEvent.offsetX, panEvent.offsetY], [useDirection(DIRECTION_HORIZONTAL, this._direction, userDirection), useDirection(DIRECTION_VERTICAL, this._direction, userDirection)]);
5429
+ var offset = this._getOffset([panEvent.offsetX, panEvent.offsetY], [useDirection(DIRECTION_HORIZONTAL, this._direction, userDirection), useDirection(DIRECTION_VERTICAL, this._direction, userDirection)]);
5237
5430
 
5238
5431
  var prevent = offset.some(function (v) {
5239
5432
  return v !== 0;
@@ -5269,7 +5462,7 @@ version: 4.8.1
5269
5462
  clearTimeout(this._rightEdgeTimer);
5270
5463
  var prevEvent = activeEvent.prevEvent;
5271
5464
 
5272
- var velocity = this._applyScale([Math.abs(prevEvent.velocityX) * (prevEvent.offsetX < 0 ? -1 : 1), Math.abs(prevEvent.velocityY) * (prevEvent.offsetY < 0 ? -1 : 1)], [useDirection(DIRECTION_HORIZONTAL, this._direction), useDirection(DIRECTION_VERTICAL, this._direction)]);
5465
+ var velocity = this._getOffset([Math.abs(prevEvent.velocityX) * (prevEvent.offsetX < 0 ? -1 : 1), Math.abs(prevEvent.velocityY) * (prevEvent.offsetY < 0 ? -1 : 1)], [useDirection(DIRECTION_HORIZONTAL, this._direction), useDirection(DIRECTION_VERTICAL, this._direction)]);
5273
5466
 
5274
5467
  activeEvent.onRelease();
5275
5468
 
@@ -5302,6 +5495,11 @@ version: 4.8.1
5302
5495
  });
5303
5496
  };
5304
5497
 
5498
+ __proto._getOffset = function (properties, direction) {
5499
+ var scale = this.options.scale;
5500
+ return [direction[0] ? properties[0] * scale[0] : 0, direction[1] ? properties[1] * scale[1] : 0];
5501
+ };
5502
+
5305
5503
  __proto._attachElementEvent = function (observer) {
5306
5504
  var _this = this;
5307
5505
 
@@ -5323,7 +5521,7 @@ version: 4.8.1
5323
5521
  activeEvent.move.forEach(function (event) {
5324
5522
  var _a;
5325
5523
 
5326
- (_a = _this.element) === null || _a === void 0 ? void 0 : _a.addEventListener(event, function () {});
5524
+ (_a = _this.element) === null || _a === void 0 ? void 0 : _a.addEventListener(event, _this._voidFunction);
5327
5525
  });
5328
5526
  };
5329
5527
 
@@ -5339,30 +5537,20 @@ version: 4.8.1
5339
5537
  activeEvent === null || activeEvent === void 0 ? void 0 : activeEvent.move.forEach(function (event) {
5340
5538
  var _a;
5341
5539
 
5342
- (_a = _this.element) === null || _a === void 0 ? void 0 : _a.removeEventListener(event, function () {});
5540
+ (_a = _this.element) === null || _a === void 0 ? void 0 : _a.removeEventListener(event, _this._voidFunction);
5343
5541
  });
5344
5542
  this._enabled = false;
5345
5543
  this._observer = null;
5346
5544
  };
5347
5545
 
5348
- __proto._applyScale = function (properties, direction) {
5349
- var offset = [0, 0];
5350
- var scale = this.options.scale;
5351
-
5352
- if (direction[0]) {
5353
- offset[0] = properties[0] * scale[0];
5354
- }
5355
-
5356
- if (direction[1]) {
5357
- offset[1] = properties[1] * scale[1];
5358
- }
5359
-
5360
- return offset;
5361
- };
5362
-
5363
5546
  return PanInput;
5364
5547
  }();
5365
5548
 
5549
+ /*
5550
+ * Copyright (c) 2015 NAVER Corp.
5551
+ * egjs projects are licensed under the MIT license
5552
+ */
5553
+
5366
5554
  var Axes$1 = Axes;
5367
5555
 
5368
5556
  /**
@@ -5537,7 +5725,7 @@ version: 4.8.1
5537
5725
  var moveEvent = new ComponentEvent$1(EVENTS.MOVE, {
5538
5726
  isTrusted: axesEvent.isTrusted,
5539
5727
  holding: this.holding,
5540
- direction: getDirection(0, axesEvent.delta[POSITION_KEY]),
5728
+ direction: getDirection$1(0, axesEvent.delta[POSITION_KEY]),
5541
5729
  axesEvent: axesEvent
5542
5730
  });
5543
5731
  flicking.trigger(moveEvent);
@@ -5625,7 +5813,7 @@ version: 4.8.1
5625
5813
  var moveStartEvent = new ComponentEvent$1(EVENTS.MOVE_START, {
5626
5814
  isTrusted: axesEvent.isTrusted,
5627
5815
  holding: this.holding,
5628
- direction: getDirection(animatingContext.start, animatingContext.end),
5816
+ direction: getDirection$1(animatingContext.start, animatingContext.end),
5629
5817
  axesEvent: axesEvent
5630
5818
  });
5631
5819
  flicking.trigger(moveStartEvent);
@@ -5686,7 +5874,7 @@ version: 4.8.1
5686
5874
  var moveStartEvent = new ComponentEvent$1(EVENTS.MOVE_START, {
5687
5875
  isTrusted: axesEvent.isTrusted,
5688
5876
  holding: this.holding,
5689
- direction: getDirection(0, -offset),
5877
+ direction: getDirection$1(0, -offset),
5690
5878
  axesEvent: axesEvent
5691
5879
  });
5692
5880
  flicking.trigger(moveStartEvent);
@@ -5788,7 +5976,7 @@ version: 4.8.1
5788
5976
  index: clickedPanel.index,
5789
5977
  panel: clickedPanel,
5790
5978
  // Direction to the clicked panel
5791
- direction: getDirection(cameraPosition, clickedPanelPosition)
5979
+ direction: getDirection$1(cameraPosition, clickedPanelPosition)
5792
5980
  }));
5793
5981
  }
5794
5982
  };
@@ -5943,7 +6131,7 @@ version: 4.8.1
5943
6131
  transitTo(STATE_TYPE.IDLE);
5944
6132
  flicking.trigger(new ComponentEvent$1(EVENTS.MOVE_END, {
5945
6133
  isTrusted: axesEvent.isTrusted,
5946
- direction: getDirection(animatingContext.start, animatingContext.end),
6134
+ direction: getDirection$1(animatingContext.start, animatingContext.end),
5947
6135
  axesEvent: axesEvent
5948
6136
  }));
5949
6137
  var targetPanel = this._targetPanel;
@@ -6385,6 +6573,20 @@ version: 4.8.1
6385
6573
  (_a = this._panInput) === null || _a === void 0 ? void 0 : _a.disable();
6386
6574
  return this;
6387
6575
  };
6576
+ /**
6577
+ * Releases ongoing user input (mouse/touch)
6578
+ * @ko 사용자의 현재 입력(마우스/터치)를 중단시킵니다
6579
+ * @chainable
6580
+ * @return {this}
6581
+ */
6582
+
6583
+
6584
+ __proto.release = function () {
6585
+ var _a;
6586
+
6587
+ (_a = this._panInput) === null || _a === void 0 ? void 0 : _a.release();
6588
+ return this;
6589
+ };
6388
6590
  /**
6389
6591
  * Update {@link https://naver.github.io/egjs-axes/ @egjs/axes}'s state
6390
6592
  * @ko {@link https://naver.github.io/egjs-axes/ @egjs/axes}의 상태를 갱신합니다
@@ -6696,6 +6898,19 @@ version: 4.8.1
6696
6898
 
6697
6899
  return this;
6698
6900
  };
6901
+ /**
6902
+ * Releases ongoing user input (mouse/touch)
6903
+ * @ko 사용자의 현재 입력(마우스/터치)를 중단시킵니다
6904
+ * @chainable
6905
+ * @return {this}
6906
+ */
6907
+
6908
+
6909
+ __proto.release = function () {
6910
+ this._controller.release();
6911
+
6912
+ return this;
6913
+ };
6699
6914
  /**
6700
6915
  * Update position after resizing
6701
6916
  * @ko resize 이후에 position을 업데이트합니다
@@ -6856,7 +7071,7 @@ version: 4.8.1
6856
7071
  prevIndex: (_a = prevActivePanel === null || prevActivePanel === void 0 ? void 0 : prevActivePanel.index) !== null && _a !== void 0 ? _a : -1,
6857
7072
  prevPanel: prevActivePanel,
6858
7073
  isTrusted: isTrusted,
6859
- direction: prevActivePanel ? getDirection(prevActivePanel.position, newActivePanel.position) : DIRECTION.NONE
7074
+ direction: prevActivePanel ? getDirection$1(prevActivePanel.position, newActivePanel.position) : DIRECTION.NONE
6860
7075
  }));
6861
7076
  } else {
6862
7077
  flicking.trigger(new ComponentEvent$1(EVENTS.RESTORED, {
@@ -6876,7 +7091,7 @@ version: 4.8.1
6876
7091
  index: panel.index,
6877
7092
  panel: panel,
6878
7093
  isTrusted: (axesEvent === null || axesEvent === void 0 ? void 0 : axesEvent.isTrusted) || false,
6879
- direction: getDirection((_a = activePanel === null || activePanel === void 0 ? void 0 : activePanel.position) !== null && _a !== void 0 ? _a : camera.position, position)
7094
+ direction: getDirection$1((_a = activePanel === null || activePanel === void 0 ? void 0 : activePanel.position) !== null && _a !== void 0 ? _a : camera.position, position)
6880
7095
  });
6881
7096
  flicking.trigger(event);
6882
7097
 
@@ -8952,7 +9167,7 @@ version: 4.8.1
8952
9167
  license: MIT
8953
9168
  author: NAVER Corp.
8954
9169
  repository: https://github.com/naver/egjs-imready
8955
- version: 1.2.0
9170
+ version: 1.3.0
8956
9171
  */
8957
9172
 
8958
9173
  /*! *****************************************************************************
@@ -9039,8 +9254,12 @@ version: 4.8.1
9039
9254
 
9040
9255
  return !!target.getAttribute(prefix + "width");
9041
9256
  }
9042
- function hasLoadingAttribute(target) {
9043
- return "loading" in target && target.getAttribute("loading") === "lazy";
9257
+ function hasLoadingAttribute(target, prefix) {
9258
+ if (prefix === void 0) {
9259
+ prefix = "data-";
9260
+ }
9261
+
9262
+ return "loading" in target && target.getAttribute("loading") === "lazy" || !!target.getAttribute(prefix + "lazy");
9044
9263
  }
9045
9264
  function hasSkipAttribute(target, prefix) {
9046
9265
  if (prefix === void 0) {
@@ -9165,6 +9384,11 @@ version: 4.8.1
9165
9384
 
9166
9385
  if (e && e.type === "error") {
9167
9386
  _this.onError(_this.element);
9387
+ }
9388
+
9389
+ if (_this.hasLoading && _this.checkElement()) {
9390
+ // I'm not ready
9391
+ return;
9168
9392
  } // I'm pre-ready and ready!
9169
9393
 
9170
9394
 
@@ -9180,7 +9404,7 @@ version: 4.8.1
9180
9404
  var prefix = _this.options.prefix;
9181
9405
  _this.hasDataSize = hasSizeAttribute(element, prefix);
9182
9406
  _this.isSkip = hasSkipAttribute(element, prefix);
9183
- _this.hasLoading = hasLoadingAttribute(element);
9407
+ _this.hasLoading = hasLoadingAttribute(element, prefix);
9184
9408
  return _this;
9185
9409
  }
9186
9410
 
@@ -9566,6 +9790,7 @@ version: 4.8.1
9566
9790
 
9567
9791
  var tagName = element.tagName.toLowerCase();
9568
9792
  var loaders = this.options.loaders;
9793
+ var prefix = options.prefix;
9569
9794
  var tags = Object.keys(loaders);
9570
9795
 
9571
9796
  if (loaders[tagName]) {
@@ -9575,7 +9800,7 @@ version: 4.8.1
9575
9800
  var loader = new ElementLoader(element, options);
9576
9801
  var children = toArray(element.querySelectorAll(tags.join(", ")));
9577
9802
  loader.setHasLoading(children.some(function (el) {
9578
- return hasLoadingAttribute(el);
9803
+ return hasLoadingAttribute(el, prefix);
9579
9804
  }));
9580
9805
  var withPreReady = false;
9581
9806
  var childrenImReady = this.clone().on("error", function (e) {
@@ -9660,13 +9885,13 @@ version: 4.8.1
9660
9885
  * ```
9661
9886
  */
9662
9887
 
9663
- this.trigger("error", {
9888
+ this.trigger(new ComponentEvent$1("error", {
9664
9889
  element: info.element,
9665
9890
  index: index,
9666
9891
  target: target,
9667
9892
  errorCount: this.getErrorCount(),
9668
9893
  totalErrorCount: ++this.totalErrorCount
9669
- });
9894
+ }));
9670
9895
  };
9671
9896
 
9672
9897
  __proto.onPreReadyElement = function (index) {
@@ -9700,7 +9925,7 @@ version: 4.8.1
9700
9925
  * ```
9701
9926
  */
9702
9927
 
9703
- this.trigger("preReadyElement", {
9928
+ this.trigger(new ComponentEvent$1("preReadyElement", {
9704
9929
  element: info.element,
9705
9930
  index: index,
9706
9931
  preReadyCount: this.preReadyCount,
@@ -9710,7 +9935,7 @@ version: 4.8.1
9710
9935
  isReady: this.isReady(),
9711
9936
  hasLoading: info.hasLoading,
9712
9937
  isSkip: info.isSkip
9713
- });
9938
+ }));
9714
9939
  };
9715
9940
 
9716
9941
  __proto.onPreReady = function () {
@@ -9742,12 +9967,12 @@ version: 4.8.1
9742
9967
  * ```
9743
9968
  */
9744
9969
 
9745
- this.trigger("preReady", {
9970
+ this.trigger(new ComponentEvent$1("preReady", {
9746
9971
  readyCount: this.readyCount,
9747
9972
  totalCount: this.totalCount,
9748
9973
  isReady: this.isReady(),
9749
9974
  hasLoading: this.hasLoading()
9750
- });
9975
+ }));
9751
9976
  };
9752
9977
 
9753
9978
  __proto.onReadyElement = function (index) {
@@ -9781,7 +10006,7 @@ version: 4.8.1
9781
10006
  * ```
9782
10007
  */
9783
10008
 
9784
- this.trigger("readyElement", {
10009
+ this.trigger(new ComponentEvent$1("readyElement", {
9785
10010
  index: index,
9786
10011
  element: info.element,
9787
10012
  hasError: info.hasError,
@@ -9795,7 +10020,7 @@ version: 4.8.1
9795
10020
  hasLoading: info.hasLoading,
9796
10021
  isPreReadyOver: this.isPreReadyOver,
9797
10022
  isSkip: info.isSkip
9798
- });
10023
+ }));
9799
10024
  };
9800
10025
 
9801
10026
  __proto.onReady = function () {
@@ -9829,11 +10054,11 @@ version: 4.8.1
9829
10054
  * });
9830
10055
  * ```
9831
10056
  */
9832
- this.trigger("ready", {
10057
+ this.trigger(new ComponentEvent$1("ready", {
9833
10058
  errorCount: this.getErrorCount(),
9834
10059
  totalErrorCount: this.totalErrorCount,
9835
10060
  totalCount: this.totalCount
9836
- });
10061
+ }));
9837
10062
  };
9838
10063
 
9839
10064
  __proto.getErrorCount = function () {
@@ -10458,11 +10683,13 @@ version: 4.8.1
10458
10683
  } : {
10459
10684
  height: panelSize
10460
10685
  };
10461
- var firstPanelSizeObj = {
10686
+
10687
+ var firstPanelSizeObj = __assign$2({
10462
10688
  size: panelSize,
10463
- height: referencePanel.height,
10464
10689
  margin: referencePanel.margin
10465
- };
10690
+ }, !flicking.horizontal && {
10691
+ height: referencePanel.height
10692
+ });
10466
10693
 
10467
10694
  if (!flicking.noPanelStyleOverride) {
10468
10695
  this._strategy.updatePanelSizes(flicking, panelSizeObj);
@@ -10996,17 +11223,32 @@ version: 4.8.1
10996
11223
 
10997
11224
 
10998
11225
  __proto.resize = function (cached) {
11226
+ var _a;
11227
+
10999
11228
  var el = this.element;
11000
11229
  var flicking = this._flicking;
11001
- var horizontal = flicking.horizontal;
11230
+ var horizontal = flicking.horizontal,
11231
+ useFractionalSize = flicking.useFractionalSize;
11002
11232
 
11003
11233
  if (cached) {
11004
11234
  this._size = cached.size;
11005
11235
  this._margin = __assign$2({}, cached.margin);
11006
- this._height = cached.height;
11236
+ this._height = (_a = cached.height) !== null && _a !== void 0 ? _a : getElementSize({
11237
+ el: el,
11238
+ horizontal: false,
11239
+ useFractionalSize: useFractionalSize,
11240
+ useOffset: true,
11241
+ style: getStyle(el)
11242
+ });
11007
11243
  } else {
11008
11244
  var elStyle = getStyle(el);
11009
- this._size = horizontal ? el.offsetWidth : el.offsetHeight;
11245
+ this._size = getElementSize({
11246
+ el: el,
11247
+ horizontal: horizontal,
11248
+ useFractionalSize: useFractionalSize,
11249
+ useOffset: true,
11250
+ style: elStyle
11251
+ });
11010
11252
  this._margin = horizontal ? {
11011
11253
  prev: parseFloat(elStyle.marginLeft || "0"),
11012
11254
  next: parseFloat(elStyle.marginRight || "0")
@@ -11014,7 +11256,13 @@ version: 4.8.1
11014
11256
  prev: parseFloat(elStyle.marginTop || "0"),
11015
11257
  next: parseFloat(elStyle.marginBottom || "0")
11016
11258
  };
11017
- this._height = horizontal ? el.offsetHeight : this._size;
11259
+ this._height = horizontal ? getElementSize({
11260
+ el: el,
11261
+ horizontal: false,
11262
+ useFractionalSize: useFractionalSize,
11263
+ useOffset: true,
11264
+ style: elStyle
11265
+ }) : this._size;
11018
11266
  }
11019
11267
 
11020
11268
  this.updatePosition();
@@ -11724,10 +11972,12 @@ version: 4.8.1
11724
11972
  resizeDebounce = _8 === void 0 ? 0 : _8,
11725
11973
  _9 = _b.maxResizeDebounce,
11726
11974
  maxResizeDebounce = _9 === void 0 ? 100 : _9,
11727
- _10 = _b.externalRenderer,
11728
- externalRenderer = _10 === void 0 ? null : _10,
11729
- _11 = _b.renderExternal,
11730
- renderExternal = _11 === void 0 ? null : _11;
11975
+ _10 = _b.useFractionalSize,
11976
+ useFractionalSize = _10 === void 0 ? false : _10,
11977
+ _11 = _b.externalRenderer,
11978
+ externalRenderer = _11 === void 0 ? null : _11,
11979
+ _12 = _b.renderExternal,
11980
+ renderExternal = _12 === void 0 ? null : _12;
11731
11981
 
11732
11982
  var _this = _super.call(this) || this; // Internal states
11733
11983
 
@@ -11767,10 +12017,11 @@ version: 4.8.1
11767
12017
  _this._useResizeObserver = useResizeObserver;
11768
12018
  _this._resizeDebounce = resizeDebounce;
11769
12019
  _this._maxResizeDebounce = maxResizeDebounce;
12020
+ _this._useFractionalSize = useFractionalSize;
11770
12021
  _this._externalRenderer = externalRenderer;
11771
12022
  _this._renderExternal = renderExternal; // Create core components
11772
12023
 
11773
- _this._viewport = new Viewport(getElement(root));
12024
+ _this._viewport = new Viewport(_this, getElement(root));
11774
12025
  _this._autoResizer = new AutoResizer(_this);
11775
12026
  _this._renderer = _this._createRenderer();
11776
12027
  _this._camera = _this._createCamera();
@@ -12683,6 +12934,23 @@ version: 4.8.1
12683
12934
  enumerable: false,
12684
12935
  configurable: true
12685
12936
  });
12937
+ Object.defineProperty(__proto, "useFractionalSize", {
12938
+ /**
12939
+ * By enabling this, Flicking will calculate all internal size with CSS width computed with getComputedStyle.
12940
+ * This can prevent 1px offset issue in some cases where panel size has the fractional part.
12941
+ * 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.
12942
+ * @ko 이 옵션을 활성화할 경우, Flicking은 내부의 모든 크기를 {@link https://developer.mozilla.org/en-US/docs/Web/API/Element/getBoundingClientRect getBoundingClientRect}를 이용하여 계산합니다.
12943
+ * 이를 통해, 패널 크기에 소수점을 포함할 경우에 발생할 수 있는 일부 1px 오프셋 이슈를 해결 가능합니다.
12944
+ * 모든 크기는 CSS {@link https://developer.mozilla.org/en-US/docs/Web/CSS/transform transform}이 엘리먼트에 적용되기 이전의 크기를 사용할 것입니다.
12945
+ * @type {boolean}
12946
+ * @default false
12947
+ */
12948
+ get: function () {
12949
+ return this._useFractionalSize;
12950
+ },
12951
+ enumerable: false,
12952
+ configurable: true
12953
+ });
12686
12954
  Object.defineProperty(__proto, "externalRenderer", {
12687
12955
  /**
12688
12956
  * This is an option for the frameworks(React, Vue, Angular, ...). Don't set it as it's automatically managed by Flicking.
@@ -12947,6 +13215,10 @@ version: 4.8.1
12947
13215
  return Promise.reject(new FlickingError(MESSAGE.ANIMATION_ALREADY_PLAYING, CODE.ANIMATION_ALREADY_PLAYING));
12948
13216
  }
12949
13217
 
13218
+ if (this._control.holding) {
13219
+ this._control.controller.release();
13220
+ }
13221
+
12950
13222
  return this._control.moveToPanel(panel, {
12951
13223
  duration: duration,
12952
13224
  direction: direction
@@ -13431,9 +13703,10 @@ version: 4.8.1
13431
13703
  var renderer = this._renderer;
13432
13704
  var control = this._control;
13433
13705
  var camera = this._camera;
13434
- var initialPanel = renderer.getPanel(this._defaultIndex) || renderer.getPanel(0);
13435
- if (!initialPanel) return;
13436
- var nearestAnchor = camera.findNearestAnchor(initialPanel.position);
13706
+ var defaultPanel = renderer.getPanel(this._defaultIndex) || renderer.getPanel(0);
13707
+ if (!defaultPanel) return;
13708
+ var nearestAnchor = camera.findNearestAnchor(defaultPanel.position);
13709
+ var initialPanel = nearestAnchor && defaultPanel.index !== nearestAnchor.panel.index ? nearestAnchor.panel : defaultPanel;
13437
13710
  control.setActive(initialPanel, null, false);
13438
13711
 
13439
13712
  if (!nearestAnchor) {
@@ -13494,7 +13767,7 @@ version: 4.8.1
13494
13767
  */
13495
13768
 
13496
13769
 
13497
- Flicking.VERSION = "4.8.1";
13770
+ Flicking.VERSION = "4.9.2";
13498
13771
  return Flicking;
13499
13772
  }(Component);
13500
13773