@egjs/flicking 4.8.0 → 4.9.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.
@@ -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.0
7
+ version: 4.9.1
8
8
  */
9
9
  (function (global, factory) {
10
10
  typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
@@ -1248,6 +1248,29 @@ version: 4.8.0
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.8.0
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.0
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.0
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.0
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.0
1916
1950
  license: MIT
1917
1951
  author: NAVER Corp.
1918
1952
  repository: git+https://github.com/naver/agent.git
1919
- version: 2.4.2
1953
+ version: 2.3.0
1920
1954
  */
1921
1955
  function some(arr, callback) {
1922
1956
  var length = arr.length;
@@ -1940,7 +1974,7 @@ version: 4.8.0
1940
1974
 
1941
1975
  return null;
1942
1976
  }
1943
- function getUserAgentString(agent) {
1977
+ function getUserAgent(agent) {
1944
1978
  var userAgent = agent;
1945
1979
 
1946
1980
  if (typeof userAgent === "undefined") {
@@ -2106,18 +2140,15 @@ version: 4.8.0
2106
2140
  }, {
2107
2141
  test: "windows nt",
2108
2142
  id: "window"
2109
- }, {
2110
- test: "win32|windows",
2111
- id: "window"
2112
2143
  }, {
2113
2144
  test: "iphone|ipad|ipod",
2114
2145
  id: "ios",
2115
2146
  versionTest: "iphone os|cpu os"
2116
2147
  }, {
2117
- test: "macos|macintel|mac os x",
2148
+ test: "mac os x",
2118
2149
  id: "mac"
2119
2150
  }, {
2120
- test: "android|linux armv81",
2151
+ test: "android",
2121
2152
  id: "android"
2122
2153
  }, {
2123
2154
  test: "tizen",
@@ -2127,17 +2158,85 @@ version: 4.8.0
2127
2158
  id: "webos"
2128
2159
  }];
2129
2160
 
2130
- function isWebView(userAgent) {
2131
- return !!findPreset(WEBVIEW_PRESETS, userAgent).preset;
2161
+ function parseUserAgentData(osData) {
2162
+ var userAgentData = navigator.userAgentData;
2163
+ var brands = (userAgentData.uaList || userAgentData.brands).slice();
2164
+ var isMobile = userAgentData.mobile || false;
2165
+ var firstBrand = brands[0];
2166
+ var browser = {
2167
+ name: firstBrand.brand,
2168
+ version: firstBrand.version,
2169
+ majorVersion: -1,
2170
+ webkit: false,
2171
+ webkitVersion: "-1",
2172
+ chromium: false,
2173
+ chromiumVersion: "-1",
2174
+ webview: !!findPresetBrand(WEBVIEW_PRESETS, brands).brand
2175
+ };
2176
+ var os = {
2177
+ name: "unknown",
2178
+ version: "-1",
2179
+ majorVersion: -1
2180
+ };
2181
+ browser.webkit = !browser.chromium && some(WEBKIT_PRESETS, function (preset) {
2182
+ return findBrand(brands, preset);
2183
+ });
2184
+ var chromiumBrand = findPresetBrand(CHROMIUM_PRESETS, brands);
2185
+ browser.chromium = !!chromiumBrand.brand;
2186
+ browser.chromiumVersion = chromiumBrand.version;
2187
+
2188
+ if (!browser.chromium) {
2189
+ var webkitBrand = findPresetBrand(WEBKIT_PRESETS, brands);
2190
+ browser.webkit = !!webkitBrand.brand;
2191
+ browser.webkitVersion = webkitBrand.version;
2192
+ }
2193
+
2194
+ if (osData) {
2195
+ var platform_1 = osData.platform.toLowerCase();
2196
+ var result = find(OS_PRESETS, function (preset) {
2197
+ return new RegExp("" + preset.test, "g").exec(platform_1);
2198
+ });
2199
+ os.name = result ? result.id : platform_1;
2200
+ os.version = osData.platformVersion;
2201
+ }
2202
+
2203
+ var browserBrand = findPresetBrand(BROWSER_PRESETS, brands);
2204
+
2205
+ if (browserBrand.brand) {
2206
+ browser.name = browserBrand.brand;
2207
+ browser.version = osData ? osData.uaFullVersion : browserBrand.version;
2208
+ }
2209
+
2210
+ if (navigator.platform === "Linux armv8l") {
2211
+ os.name = "android";
2212
+ } else if (browser.webkit) {
2213
+ os.name = isMobile ? "ios" : "mac";
2214
+ }
2215
+
2216
+ if (os.name === "ios" && browser.webview) {
2217
+ browser.version = "-1";
2218
+ }
2219
+
2220
+ os.version = convertVersion(os.version);
2221
+ browser.version = convertVersion(browser.version);
2222
+ os.majorVersion = parseInt(os.version, 10);
2223
+ browser.majorVersion = parseInt(browser.version, 10);
2224
+ return {
2225
+ browser: browser,
2226
+ os: os,
2227
+ isMobile: isMobile,
2228
+ isHints: true
2229
+ };
2132
2230
  }
2133
- function getLegacyAgent(userAgent) {
2134
- var nextAgent = getUserAgentString(userAgent);
2231
+
2232
+ function parseUserAgent(userAgent) {
2233
+ var nextAgent = getUserAgent(userAgent);
2135
2234
  var isMobile = !!/mobi/g.exec(nextAgent);
2136
2235
  var browser = {
2137
2236
  name: "unknown",
2138
2237
  version: "-1",
2139
2238
  majorVersion: -1,
2140
- webview: isWebView(nextAgent),
2239
+ webview: !!findPreset(WEBVIEW_PRESETS, nextAgent).preset,
2141
2240
  chromium: false,
2142
2241
  chromiumVersion: "-1",
2143
2242
  webkit: false,
@@ -2175,7 +2274,7 @@ version: 4.8.0
2175
2274
 
2176
2275
  if (browserPreset) {
2177
2276
  browser.name = browserPreset.id;
2178
- browser.version = browserVersion; // Early whale bugs
2277
+ browser.version = browserVersion;
2179
2278
 
2180
2279
  if (browser.webview && os.name === "ios" && browser.name !== "safari") {
2181
2280
  browser.webview = false;
@@ -2190,80 +2289,6 @@ version: 4.8.0
2190
2289
  isHints: false
2191
2290
  };
2192
2291
  }
2193
-
2194
- function getClientHintsAgent(osData) {
2195
- var userAgentData = navigator.userAgentData;
2196
- var brands = (userAgentData.uaList || userAgentData.brands).slice();
2197
- var fullVersionList = osData && osData.fullVersionList;
2198
- var isMobile = userAgentData.mobile || false;
2199
- var firstBrand = brands[0];
2200
- var platform = (osData && osData.platform || userAgentData.platform || navigator.platform).toLowerCase();
2201
- var browser = {
2202
- name: firstBrand.brand,
2203
- version: firstBrand.version,
2204
- majorVersion: -1,
2205
- webkit: false,
2206
- webkitVersion: "-1",
2207
- chromium: false,
2208
- chromiumVersion: "-1",
2209
- webview: !!findPresetBrand(WEBVIEW_PRESETS, brands).brand || isWebView(getUserAgentString())
2210
- };
2211
- var os = {
2212
- name: "unknown",
2213
- version: "-1",
2214
- majorVersion: -1
2215
- };
2216
- browser.webkit = !browser.chromium && some(WEBKIT_PRESETS, function (preset) {
2217
- return findBrand(brands, preset);
2218
- });
2219
- var chromiumBrand = findPresetBrand(CHROMIUM_PRESETS, brands);
2220
- browser.chromium = !!chromiumBrand.brand;
2221
- browser.chromiumVersion = chromiumBrand.version;
2222
-
2223
- if (!browser.chromium) {
2224
- var webkitBrand = findPresetBrand(WEBKIT_PRESETS, brands);
2225
- browser.webkit = !!webkitBrand.brand;
2226
- browser.webkitVersion = webkitBrand.version;
2227
- }
2228
-
2229
- var platfomResult = find(OS_PRESETS, function (preset) {
2230
- return new RegExp("" + preset.test, "g").exec(platform);
2231
- });
2232
- os.name = platfomResult ? platfomResult.id : "";
2233
-
2234
- if (osData) {
2235
- os.version = osData.platformVersion;
2236
- }
2237
-
2238
- if (fullVersionList && fullVersionList.length) {
2239
- var browserBrandByFullVersionList = findPresetBrand(BROWSER_PRESETS, fullVersionList);
2240
- browser.name = browserBrandByFullVersionList.brand || browser.name;
2241
- browser.version = browserBrandByFullVersionList.version || browser.version;
2242
- } else {
2243
- var browserBrand = findPresetBrand(BROWSER_PRESETS, brands);
2244
- browser.name = browserBrand.brand || browser.name;
2245
- browser.version = browserBrand.brand && osData ? osData.uaFullVersion : browserBrand.version;
2246
- }
2247
-
2248
- if (browser.webkit) {
2249
- os.name = isMobile ? "ios" : "mac";
2250
- }
2251
-
2252
- if (os.name === "ios" && browser.webview) {
2253
- browser.version = "-1";
2254
- }
2255
-
2256
- os.version = convertVersion(os.version);
2257
- browser.version = convertVersion(browser.version);
2258
- os.majorVersion = parseInt(os.version, 10);
2259
- browser.majorVersion = parseInt(browser.version, 10);
2260
- return {
2261
- browser: browser,
2262
- os: os,
2263
- isMobile: isMobile,
2264
- isHints: true
2265
- };
2266
- }
2267
2292
  /**
2268
2293
  * Extracts browser and operating system information from the user agent string.
2269
2294
  * @ko 유저 에이전트 문자열에서 브라우저와 운영체제 정보를 추출한다.
@@ -2278,9 +2303,9 @@ version: 4.8.0
2278
2303
 
2279
2304
  function agent(userAgent) {
2280
2305
  if (typeof userAgent === "undefined" && hasUserAgentData()) {
2281
- return getClientHintsAgent();
2306
+ return parseUserAgentData();
2282
2307
  } else {
2283
- return getLegacyAgent(userAgent);
2308
+ return parseUserAgent(userAgent);
2284
2309
  }
2285
2310
  }
2286
2311
 
@@ -6132,7 +6157,9 @@ version: 4.8.0
6132
6157
  };
6133
6158
 
6134
6159
  this._onAxesChange = function () {
6135
- _this._dragged = true;
6160
+ var _a;
6161
+
6162
+ _this._dragged = !!((_a = _this._panInput) === null || _a === void 0 ? void 0 : _a.isEnabled());
6136
6163
  };
6137
6164
 
6138
6165
  this._preventClickWhenDragged = function (e) {
@@ -7113,10 +7140,13 @@ version: 4.8.0
7113
7140
  targetAnchor = this._findSnappedAnchor(position, anchorAtCamera);
7114
7141
  } else if (absPosDelta >= flicking.threshold && absPosDelta > 0) {
7115
7142
  // Move to the adjacent panel
7116
- targetAnchor = this._findAdjacentAnchor(posDelta, anchorAtCamera);
7143
+ targetAnchor = this._findAdjacentAnchor(position, posDelta, anchorAtCamera);
7117
7144
  } else {
7118
7145
  // Restore to active panel
7119
- targetAnchor = anchorAtCamera;
7146
+ return this.moveToPanel(activeAnchor.panel, {
7147
+ duration: duration,
7148
+ axesEvent: axesEvent
7149
+ });
7120
7150
  }
7121
7151
 
7122
7152
  this._triggerIndexChangeEvent(targetAnchor.panel, position, axesEvent);
@@ -7187,11 +7217,20 @@ version: 4.8.0
7187
7217
  }
7188
7218
  };
7189
7219
 
7190
- __proto._findAdjacentAnchor = function (posDelta, anchorAtCamera) {
7220
+ __proto._findAdjacentAnchor = function (position, posDelta, anchorAtCamera) {
7191
7221
  var _a;
7192
7222
 
7193
7223
  var flicking = getFlickingAttached(this._flicking);
7194
7224
  var camera = flicking.camera;
7225
+
7226
+ if (camera.circularEnabled) {
7227
+ var anchorIncludePosition = camera.findAnchorIncludePosition(position);
7228
+
7229
+ if (anchorIncludePosition && anchorIncludePosition.position !== anchorAtCamera.position) {
7230
+ return anchorIncludePosition;
7231
+ }
7232
+ }
7233
+
7195
7234
  var adjacentAnchor = (_a = posDelta > 0 ? camera.getNextAnchor(anchorAtCamera) : camera.getPrevAnchor(anchorAtCamera)) !== null && _a !== void 0 ? _a : anchorAtCamera;
7196
7235
  return adjacentAnchor;
7197
7236
  };
@@ -8947,7 +8986,7 @@ version: 4.8.0
8947
8986
  license: MIT
8948
8987
  author: NAVER Corp.
8949
8988
  repository: https://github.com/naver/egjs-imready
8950
- version: 1.3.0
8989
+ version: 1.2.0
8951
8990
  */
8952
8991
 
8953
8992
  /*! *****************************************************************************
@@ -9034,12 +9073,8 @@ version: 4.8.0
9034
9073
 
9035
9074
  return !!target.getAttribute(prefix + "width");
9036
9075
  }
9037
- function hasLoadingAttribute(target, prefix) {
9038
- if (prefix === void 0) {
9039
- prefix = "data-";
9040
- }
9041
-
9042
- return "loading" in target && target.getAttribute("loading") === "lazy" || !!target.getAttribute(prefix + "lazy");
9076
+ function hasLoadingAttribute(target) {
9077
+ return "loading" in target && target.getAttribute("loading") === "lazy";
9043
9078
  }
9044
9079
  function hasSkipAttribute(target, prefix) {
9045
9080
  if (prefix === void 0) {
@@ -9164,11 +9199,6 @@ version: 4.8.0
9164
9199
 
9165
9200
  if (e && e.type === "error") {
9166
9201
  _this.onError(_this.element);
9167
- }
9168
-
9169
- if (_this.hasLoading && _this.checkElement()) {
9170
- // I'm not ready
9171
- return;
9172
9202
  } // I'm pre-ready and ready!
9173
9203
 
9174
9204
 
@@ -9184,7 +9214,7 @@ version: 4.8.0
9184
9214
  var prefix = _this.options.prefix;
9185
9215
  _this.hasDataSize = hasSizeAttribute(element, prefix);
9186
9216
  _this.isSkip = hasSkipAttribute(element, prefix);
9187
- _this.hasLoading = hasLoadingAttribute(element, prefix);
9217
+ _this.hasLoading = hasLoadingAttribute(element);
9188
9218
  return _this;
9189
9219
  }
9190
9220
 
@@ -9570,7 +9600,6 @@ version: 4.8.0
9570
9600
 
9571
9601
  var tagName = element.tagName.toLowerCase();
9572
9602
  var loaders = this.options.loaders;
9573
- var prefix = options.prefix;
9574
9603
  var tags = Object.keys(loaders);
9575
9604
 
9576
9605
  if (loaders[tagName]) {
@@ -9580,7 +9609,7 @@ version: 4.8.0
9580
9609
  var loader = new ElementLoader(element, options);
9581
9610
  var children = toArray(element.querySelectorAll(tags.join(", ")));
9582
9611
  loader.setHasLoading(children.some(function (el) {
9583
- return hasLoadingAttribute(el, prefix);
9612
+ return hasLoadingAttribute(el);
9584
9613
  }));
9585
9614
  var withPreReady = false;
9586
9615
  var childrenImReady = this.clone().on("error", function (e) {
@@ -9665,13 +9694,13 @@ version: 4.8.0
9665
9694
  * ```
9666
9695
  */
9667
9696
 
9668
- this.trigger(new ComponentEvent$1("error", {
9697
+ this.trigger("error", {
9669
9698
  element: info.element,
9670
9699
  index: index,
9671
9700
  target: target,
9672
9701
  errorCount: this.getErrorCount(),
9673
9702
  totalErrorCount: ++this.totalErrorCount
9674
- }));
9703
+ });
9675
9704
  };
9676
9705
 
9677
9706
  __proto.onPreReadyElement = function (index) {
@@ -9705,7 +9734,7 @@ version: 4.8.0
9705
9734
  * ```
9706
9735
  */
9707
9736
 
9708
- this.trigger(new ComponentEvent$1("preReadyElement", {
9737
+ this.trigger("preReadyElement", {
9709
9738
  element: info.element,
9710
9739
  index: index,
9711
9740
  preReadyCount: this.preReadyCount,
@@ -9715,7 +9744,7 @@ version: 4.8.0
9715
9744
  isReady: this.isReady(),
9716
9745
  hasLoading: info.hasLoading,
9717
9746
  isSkip: info.isSkip
9718
- }));
9747
+ });
9719
9748
  };
9720
9749
 
9721
9750
  __proto.onPreReady = function () {
@@ -9747,12 +9776,12 @@ version: 4.8.0
9747
9776
  * ```
9748
9777
  */
9749
9778
 
9750
- this.trigger(new ComponentEvent$1("preReady", {
9779
+ this.trigger("preReady", {
9751
9780
  readyCount: this.readyCount,
9752
9781
  totalCount: this.totalCount,
9753
9782
  isReady: this.isReady(),
9754
9783
  hasLoading: this.hasLoading()
9755
- }));
9784
+ });
9756
9785
  };
9757
9786
 
9758
9787
  __proto.onReadyElement = function (index) {
@@ -9786,7 +9815,7 @@ version: 4.8.0
9786
9815
  * ```
9787
9816
  */
9788
9817
 
9789
- this.trigger(new ComponentEvent$1("readyElement", {
9818
+ this.trigger("readyElement", {
9790
9819
  index: index,
9791
9820
  element: info.element,
9792
9821
  hasError: info.hasError,
@@ -9800,7 +9829,7 @@ version: 4.8.0
9800
9829
  hasLoading: info.hasLoading,
9801
9830
  isPreReadyOver: this.isPreReadyOver,
9802
9831
  isSkip: info.isSkip
9803
- }));
9832
+ });
9804
9833
  };
9805
9834
 
9806
9835
  __proto.onReady = function () {
@@ -9834,11 +9863,11 @@ version: 4.8.0
9834
9863
  * });
9835
9864
  * ```
9836
9865
  */
9837
- this.trigger(new ComponentEvent$1("ready", {
9866
+ this.trigger("ready", {
9838
9867
  errorCount: this.getErrorCount(),
9839
9868
  totalErrorCount: this.totalErrorCount,
9840
9869
  totalCount: this.totalCount
9841
- }));
9870
+ });
9842
9871
  };
9843
9872
 
9844
9873
  __proto.getErrorCount = function () {
@@ -10463,11 +10492,13 @@ version: 4.8.0
10463
10492
  } : {
10464
10493
  height: panelSize
10465
10494
  };
10466
- var firstPanelSizeObj = {
10495
+
10496
+ var firstPanelSizeObj = __assign$2({
10467
10497
  size: panelSize,
10468
- height: referencePanel.height,
10469
10498
  margin: referencePanel.margin
10470
- };
10499
+ }, !flicking.horizontal && {
10500
+ height: referencePanel.height
10501
+ });
10471
10502
 
10472
10503
  if (!flicking.noPanelStyleOverride) {
10473
10504
  this._strategy.updatePanelSizes(flicking, panelSizeObj);
@@ -11001,17 +11032,32 @@ version: 4.8.0
11001
11032
 
11002
11033
 
11003
11034
  __proto.resize = function (cached) {
11035
+ var _a;
11036
+
11004
11037
  var el = this.element;
11005
11038
  var flicking = this._flicking;
11006
- var horizontal = flicking.horizontal;
11039
+ var horizontal = flicking.horizontal,
11040
+ useFractionalSize = flicking.useFractionalSize;
11007
11041
 
11008
11042
  if (cached) {
11009
11043
  this._size = cached.size;
11010
11044
  this._margin = __assign$2({}, cached.margin);
11011
- this._height = cached.height;
11045
+ this._height = (_a = cached.height) !== null && _a !== void 0 ? _a : getElementSize({
11046
+ el: el,
11047
+ horizontal: false,
11048
+ useFractionalSize: useFractionalSize,
11049
+ useOffset: true,
11050
+ style: getStyle(el)
11051
+ });
11012
11052
  } else {
11013
11053
  var elStyle = getStyle(el);
11014
- this._size = horizontal ? el.offsetWidth : el.offsetHeight;
11054
+ this._size = getElementSize({
11055
+ el: el,
11056
+ horizontal: horizontal,
11057
+ useFractionalSize: useFractionalSize,
11058
+ useOffset: true,
11059
+ style: elStyle
11060
+ });
11015
11061
  this._margin = horizontal ? {
11016
11062
  prev: parseFloat(elStyle.marginLeft || "0"),
11017
11063
  next: parseFloat(elStyle.marginRight || "0")
@@ -11019,7 +11065,13 @@ version: 4.8.0
11019
11065
  prev: parseFloat(elStyle.marginTop || "0"),
11020
11066
  next: parseFloat(elStyle.marginBottom || "0")
11021
11067
  };
11022
- this._height = horizontal ? el.offsetHeight : this._size;
11068
+ this._height = horizontal ? getElementSize({
11069
+ el: el,
11070
+ horizontal: false,
11071
+ useFractionalSize: useFractionalSize,
11072
+ useOffset: true,
11073
+ style: elStyle
11074
+ }) : this._size;
11023
11075
  }
11024
11076
 
11025
11077
  this.updatePosition();
@@ -11729,10 +11781,12 @@ version: 4.8.0
11729
11781
  resizeDebounce = _8 === void 0 ? 0 : _8,
11730
11782
  _9 = _b.maxResizeDebounce,
11731
11783
  maxResizeDebounce = _9 === void 0 ? 100 : _9,
11732
- _10 = _b.externalRenderer,
11733
- externalRenderer = _10 === void 0 ? null : _10,
11734
- _11 = _b.renderExternal,
11735
- renderExternal = _11 === void 0 ? null : _11;
11784
+ _10 = _b.useFractionalSize,
11785
+ useFractionalSize = _10 === void 0 ? false : _10,
11786
+ _11 = _b.externalRenderer,
11787
+ externalRenderer = _11 === void 0 ? null : _11,
11788
+ _12 = _b.renderExternal,
11789
+ renderExternal = _12 === void 0 ? null : _12;
11736
11790
 
11737
11791
  var _this = _super.call(this) || this; // Internal states
11738
11792
 
@@ -11772,10 +11826,11 @@ version: 4.8.0
11772
11826
  _this._useResizeObserver = useResizeObserver;
11773
11827
  _this._resizeDebounce = resizeDebounce;
11774
11828
  _this._maxResizeDebounce = maxResizeDebounce;
11829
+ _this._useFractionalSize = useFractionalSize;
11775
11830
  _this._externalRenderer = externalRenderer;
11776
11831
  _this._renderExternal = renderExternal; // Create core components
11777
11832
 
11778
- _this._viewport = new Viewport(getElement(root));
11833
+ _this._viewport = new Viewport(_this, getElement(root));
11779
11834
  _this._autoResizer = new AutoResizer(_this);
11780
11835
  _this._renderer = _this._createRenderer();
11781
11836
  _this._camera = _this._createCamera();
@@ -12688,6 +12743,23 @@ version: 4.8.0
12688
12743
  enumerable: false,
12689
12744
  configurable: true
12690
12745
  });
12746
+ Object.defineProperty(__proto, "useFractionalSize", {
12747
+ /**
12748
+ * By enabling this, Flicking will calculate all internal size with CSS width computed with getComputedStyle.
12749
+ * This can prevent 1px offset issue in some cases where panel size has the fractional part.
12750
+ * 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.
12751
+ * @ko 이 옵션을 활성화할 경우, Flicking은 내부의 모든 크기를 {@link https://developer.mozilla.org/en-US/docs/Web/API/Element/getBoundingClientRect getBoundingClientRect}를 이용하여 계산합니다.
12752
+ * 이를 통해, 패널 크기에 소수점을 포함할 경우에 발생할 수 있는 일부 1px 오프셋 이슈를 해결 가능합니다.
12753
+ * 모든 크기는 CSS {@link https://developer.mozilla.org/en-US/docs/Web/CSS/transform transform}이 엘리먼트에 적용되기 이전의 크기를 사용할 것입니다.
12754
+ * @type {boolean}
12755
+ * @default false
12756
+ */
12757
+ get: function () {
12758
+ return this._useFractionalSize;
12759
+ },
12760
+ enumerable: false,
12761
+ configurable: true
12762
+ });
12691
12763
  Object.defineProperty(__proto, "externalRenderer", {
12692
12764
  /**
12693
12765
  * This is an option for the frameworks(React, Vue, Angular, ...). Don't set it as it's automatically managed by Flicking.
@@ -13436,9 +13508,10 @@ version: 4.8.0
13436
13508
  var renderer = this._renderer;
13437
13509
  var control = this._control;
13438
13510
  var camera = this._camera;
13439
- var initialPanel = renderer.getPanel(this._defaultIndex) || renderer.getPanel(0);
13440
- if (!initialPanel) return;
13441
- var nearestAnchor = camera.findNearestAnchor(initialPanel.position);
13511
+ var defaultPanel = renderer.getPanel(this._defaultIndex) || renderer.getPanel(0);
13512
+ if (!defaultPanel) return;
13513
+ var nearestAnchor = camera.findNearestAnchor(defaultPanel.position);
13514
+ var initialPanel = nearestAnchor && defaultPanel.index !== nearestAnchor.panel.index ? nearestAnchor.panel : defaultPanel;
13442
13515
  control.setActive(initialPanel, null, false);
13443
13516
 
13444
13517
  if (!nearestAnchor) {
@@ -13499,7 +13572,7 @@ version: 4.8.0
13499
13572
  */
13500
13573
 
13501
13574
 
13502
- Flicking.VERSION = "4.8.0";
13575
+ Flicking.VERSION = "4.9.1";
13503
13576
  return Flicking;
13504
13577
  }(Component);
13505
13578