uikit 3.11.0 → 3.11.2-dev.19d26d0f9

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.
Files changed (54) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/build/scope.js +4 -6
  3. package/dist/css/uikit-core-rtl.css +1 -1
  4. package/dist/css/uikit-core-rtl.min.css +1 -1
  5. package/dist/css/uikit-core.css +1 -1
  6. package/dist/css/uikit-core.min.css +1 -1
  7. package/dist/css/uikit-rtl.css +1 -1
  8. package/dist/css/uikit-rtl.min.css +1 -1
  9. package/dist/css/uikit.css +1 -1
  10. package/dist/css/uikit.min.css +1 -1
  11. package/dist/js/components/countdown.js +1 -1
  12. package/dist/js/components/countdown.min.js +1 -1
  13. package/dist/js/components/filter.js +1 -1
  14. package/dist/js/components/filter.min.js +1 -1
  15. package/dist/js/components/lightbox-panel.js +1 -1
  16. package/dist/js/components/lightbox-panel.min.js +1 -1
  17. package/dist/js/components/lightbox.js +1 -1
  18. package/dist/js/components/lightbox.min.js +1 -1
  19. package/dist/js/components/notification.js +1 -1
  20. package/dist/js/components/notification.min.js +1 -1
  21. package/dist/js/components/parallax.js +37 -41
  22. package/dist/js/components/parallax.min.js +1 -1
  23. package/dist/js/components/slider-parallax.js +32 -25
  24. package/dist/js/components/slider-parallax.min.js +1 -1
  25. package/dist/js/components/slider.js +2 -2
  26. package/dist/js/components/slider.min.js +1 -1
  27. package/dist/js/components/slideshow-parallax.js +32 -25
  28. package/dist/js/components/slideshow-parallax.min.js +1 -1
  29. package/dist/js/components/slideshow.js +1 -1
  30. package/dist/js/components/slideshow.min.js +1 -1
  31. package/dist/js/components/sortable.js +2 -3
  32. package/dist/js/components/sortable.min.js +1 -1
  33. package/dist/js/components/tooltip.js +1 -1
  34. package/dist/js/components/tooltip.min.js +1 -1
  35. package/dist/js/components/upload.js +1 -1
  36. package/dist/js/components/upload.min.js +1 -1
  37. package/dist/js/uikit-core.js +111 -66
  38. package/dist/js/uikit-core.min.js +1 -1
  39. package/dist/js/uikit-icons.js +1 -1
  40. package/dist/js/uikit-icons.min.js +1 -1
  41. package/dist/js/uikit.js +174 -134
  42. package/dist/js/uikit.min.js +1 -1
  43. package/package.json +1 -1
  44. package/src/js/components/parallax.js +5 -16
  45. package/src/js/components/slider.js +1 -1
  46. package/src/js/components/sortable.js +1 -2
  47. package/src/js/core/core.js +2 -2
  48. package/src/js/core/height-viewport.js +2 -2
  49. package/src/js/core/sticky.js +54 -41
  50. package/src/js/mixin/parallax.js +32 -21
  51. package/src/js/util/dimensions.js +28 -12
  52. package/src/js/util/fastdom.js +2 -2
  53. package/src/js/util/viewport.js +7 -3
  54. package/tests/sticky.html +39 -24
package/dist/js/uikit.js CHANGED
@@ -1,4 +1,4 @@
1
- /*! UIkit 3.11.0 | https://www.getuikit.com | (c) 2014 - 2022 YOOtheme | MIT License */
1
+ /*! UIkit 3.11.2-dev.19d26d0f9 | https://www.getuikit.com | (c) 2014 - 2022 YOOtheme | MIT License */
2
2
 
3
3
  (function (global, factory) {
4
4
  typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
@@ -1587,7 +1587,7 @@
1587
1587
  height: ['top', 'bottom']
1588
1588
  };
1589
1589
 
1590
- function dimensions(element) {
1590
+ function dimensions$1(element) {
1591
1591
 
1592
1592
  var rect = isElement(element)
1593
1593
  ? toNode(element).getBoundingClientRect()
@@ -1605,7 +1605,7 @@
1605
1605
 
1606
1606
  function offset(element, coordinates) {
1607
1607
 
1608
- var currentOffset = dimensions(element);
1608
+ var currentOffset = dimensions$1(element);
1609
1609
 
1610
1610
  if (element) {
1611
1611
  var ref = toWindow(element);
@@ -1750,19 +1750,35 @@
1750
1750
  if ( element === void 0 ) element = window;
1751
1751
  if ( offsetDim === void 0 ) offsetDim = false;
1752
1752
 
1753
- return isNumeric(value)
1754
- ? +value
1755
- : endsWith(value, 'vh')
1756
- ? percent(height(toWindow(element)), value)
1757
- : endsWith(value, 'vw')
1758
- ? percent(width(toWindow(element)), value)
1759
- : endsWith(value, '%')
1760
- ? percent(offsetDim
1761
- ? dimension(property)(element)
1762
- : dimensions(element)[property], value)
1763
- : toFloat(value);
1753
+
1754
+ if (!isString(value)) {
1755
+ return toFloat(value);
1756
+ }
1757
+
1758
+ return parseCalc(value).reduce(function (result, value) {
1759
+ var unit = parseUnit(value);
1760
+ if (unit) {
1761
+ value = percent(
1762
+ unit === 'vh'
1763
+ ? height(toWindow(element))
1764
+ : unit === 'vw'
1765
+ ? width(toWindow(element))
1766
+ : offsetDim
1767
+ ? element[("offset" + (ucfirst(property)))]
1768
+ : dimensions$1(element)[property],
1769
+ value
1770
+ );
1771
+ }
1772
+
1773
+ return result + toFloat(value);
1774
+ }, 0);
1764
1775
  }
1765
1776
 
1777
+ var calcRe = /-?\d+(?:\.\d+)?(?:v[wh]|%|px)?/g;
1778
+ var parseCalc = memoize(function (calc) { return calc.toString().replace(/\s/g, '').match(calcRe) || []; });
1779
+ var unitRe = /(?:v[hw]|%)$/;
1780
+ var parseUnit = memoize(function (str) { return (str.match(unitRe) || [])[0]; });
1781
+
1766
1782
  function percent(base, value) {
1767
1783
  return base * toFloat(value) / 100;
1768
1784
  }
@@ -1800,8 +1816,6 @@
1800
1816
  };
1801
1817
 
1802
1818
  function flush(recursion) {
1803
- if ( recursion === void 0 ) recursion = 1;
1804
-
1805
1819
  runTasks(fastdom.reads);
1806
1820
  runTasks(fastdom.writes.splice(0));
1807
1821
 
@@ -1823,7 +1837,7 @@
1823
1837
  if (recursion && recursion < RECURSION_LIMIT) {
1824
1838
  Promise$1.resolve().then(function () { return flush(recursion); });
1825
1839
  } else {
1826
- requestAnimationFrame(function () { return flush(); });
1840
+ requestAnimationFrame(function () { return flush(1); });
1827
1841
  }
1828
1842
 
1829
1843
  }
@@ -2241,7 +2255,11 @@
2241
2255
  element = toNode(element);
2242
2256
  }
2243
2257
 
2244
- element.scrollTop = top;
2258
+ if (isUndefined(top)) {
2259
+ return element.scrollTop;
2260
+ } else {
2261
+ element.scrollTop = top;
2262
+ }
2245
2263
  }
2246
2264
 
2247
2265
  function scrollIntoView(element, ref) {
@@ -2548,7 +2566,7 @@
2548
2566
  replaceClass: replaceClass,
2549
2567
  hasClass: hasClass,
2550
2568
  toggleClass: toggleClass,
2551
- dimensions: dimensions,
2569
+ dimensions: dimensions$1,
2552
2570
  offset: offset,
2553
2571
  position: position,
2554
2572
  offsetPosition: offsetPosition,
@@ -2673,7 +2691,8 @@
2673
2691
  scrolledOver: scrolledOver,
2674
2692
  scrollParents: scrollParents,
2675
2693
  getViewport: getViewport$1,
2676
- getViewportClientHeight: getViewportClientHeight
2694
+ getViewportClientHeight: getViewportClientHeight,
2695
+ getScrollingElement: getScrollingElement
2677
2696
  });
2678
2697
 
2679
2698
  function globalAPI (UIkit) {
@@ -3462,7 +3481,7 @@
3462
3481
  UIkit.data = '__uikit__';
3463
3482
  UIkit.prefix = 'uk-';
3464
3483
  UIkit.options = {};
3465
- UIkit.version = '3.11.0';
3484
+ UIkit.version = '3.11.2-dev.19d26d0f9';
3466
3485
 
3467
3486
  globalAPI(UIkit);
3468
3487
  hooksAPI(UIkit);
@@ -3483,7 +3502,7 @@
3483
3502
  return;
3484
3503
  }
3485
3504
  pendingResize = true;
3486
- fastdom.write(function () { return pendingResize = false; });
3505
+ fastdom.read(function () { return pendingResize = false; });
3487
3506
  UIkit.update(null, 'resize');
3488
3507
  };
3489
3508
 
@@ -3502,7 +3521,7 @@
3502
3521
  return;
3503
3522
  }
3504
3523
  pending = true;
3505
- fastdom.write(function () { return pending = false; });
3524
+ fastdom.read(function () { return pending = false; });
3506
3525
 
3507
3526
  UIkit.update(null, e.type);
3508
3527
 
@@ -5222,7 +5241,7 @@
5222
5241
  css(element, 'display', 'block', 'important');
5223
5242
  }
5224
5243
 
5225
- var height = dimensions(element).height - boxModelAdjust(element, 'height', 'content-box');
5244
+ var height = dimensions$1(element).height - boxModelAdjust(element, 'height', 'content-box');
5226
5245
 
5227
5246
  if (style !== false) {
5228
5247
  css(element, 'display', style);
@@ -5264,7 +5283,7 @@
5264
5283
 
5265
5284
  if (this.expand) {
5266
5285
 
5267
- minHeight = height(window) - (dimensions(document.documentElement).height - dimensions(this.$el).height) - box || '';
5286
+ minHeight = height(window) - (dimensions$1(document.documentElement).height - dimensions$1(this.$el).height) - box || '';
5268
5287
 
5269
5288
  } else {
5270
5289
 
@@ -5281,7 +5300,7 @@
5281
5300
 
5282
5301
  if (this.offsetBottom === true) {
5283
5302
 
5284
- minHeight += " - " + (dimensions(this.$el.nextElementSibling).height) + "px";
5303
+ minHeight += " - " + (dimensions$1(this.$el.nextElementSibling).height) + "px";
5285
5304
 
5286
5305
  } else if (isNumeric(this.offsetBottom)) {
5287
5306
 
@@ -5293,7 +5312,7 @@
5293
5312
 
5294
5313
  } else if (isString(this.offsetBottom)) {
5295
5314
 
5296
- minHeight += " - " + (dimensions(query(this.offsetBottom, this.$el)).height) + "px";
5315
+ minHeight += " - " + (dimensions$1(query(this.offsetBottom, this.$el)).height) + "px";
5297
5316
 
5298
5317
  }
5299
5318
 
@@ -5312,7 +5331,7 @@
5312
5331
  css(this.$el, {minHeight: minHeight});
5313
5332
 
5314
5333
  if (minHeight !== prev) {
5315
- this.$update(this.$el, 'resize');
5334
+ trigger(this.$el, 'resize');
5316
5335
  }
5317
5336
 
5318
5337
  if (this.minHeight && toFloat(css(this.$el, 'minHeight')) < this.minHeight) {
@@ -7325,7 +7344,7 @@
7325
7344
 
7326
7345
  return {
7327
7346
  current: toFloat(css(this.$el, 'maxHeight')),
7328
- max: Math.max(this.minHeight, height(this.container) - (dimensions(this.content).height - height(this.$el)))
7347
+ max: Math.max(this.minHeight, height(this.container) - (dimensions$1(this.content).height - height(this.$el)))
7329
7348
  };
7330
7349
  },
7331
7350
 
@@ -7718,10 +7737,10 @@
7718
7737
 
7719
7738
  computed: {
7720
7739
 
7721
- offset: function(ref) {
7740
+ offset: function(ref, $el) {
7722
7741
  var offset = ref.offset;
7723
7742
 
7724
- return toPx(offset);
7743
+ return toPx(offset, 'height', $el);
7725
7744
  },
7726
7745
 
7727
7746
  selTarget: function(ref, $el) {
@@ -7788,7 +7807,7 @@
7788
7807
  var this$1$1 = this;
7789
7808
 
7790
7809
 
7791
- if (!(this.targetOffset !== false && location.hash && window.pageYOffset > 0)) {
7810
+ if (!(this.targetOffset !== false && location.hash && scrollTop(window) > 0)) {
7792
7811
  return;
7793
7812
  }
7794
7813
 
@@ -7837,24 +7856,28 @@
7837
7856
 
7838
7857
  height$1 = this.isActive ? height$1 : this.$el.offsetHeight;
7839
7858
 
7840
- if (height$1 + this.offset > height(window)) {
7841
- this.inactive = true;
7842
- return false;
7843
- }
7859
+ var overflow = Math.max(0, height$1 + this.offset - height(window));
7844
7860
 
7845
7861
  var referenceElement = this.isFixed ? this.placeholder : this.$el;
7846
- this.topOffset = offset(referenceElement).top;
7847
- this.bottomOffset = this.topOffset + height$1;
7848
- this.offsetParentTop = offset(referenceElement.offsetParent).top;
7862
+ var topOffset = offset(referenceElement).top;
7863
+ var offsetParentTop = offset(referenceElement.offsetParent).top;
7849
7864
 
7850
- var bottom = parseProp('bottom', this);
7865
+ var top = parseProp(this.top, this.$el, topOffset);
7866
+ var bottom = parseProp(this.bottom, this.$el, topOffset + height$1);
7851
7867
 
7852
- this.top = Math.max(toFloat(parseProp('top', this)), this.topOffset) - this.offset;
7853
- this.bottom = bottom && bottom - this.$el.offsetHeight;
7854
- this.width = dimensions(isVisible(this.widthElement) ? this.widthElement : this.$el).width;
7868
+ var start = Math.max(top, topOffset) - this.offset;
7869
+ var end = bottom
7870
+ ? bottom - this.$el.offsetHeight + overflow - this.offset
7871
+ : getScrollingElement(this.$el).scrollHeight - height(window);
7855
7872
 
7856
7873
  return {
7874
+ start: start,
7875
+ end: end,
7876
+ overflow: overflow,
7877
+ topOffset: topOffset,
7878
+ offsetParentTop: offsetParentTop,
7857
7879
  height: height$1,
7880
+ width: dimensions$1(isVisible(this.widthElement) ? this.widthElement : this.$el).width,
7858
7881
  top: offsetPosition(this.placeholder)[0],
7859
7882
  margins: css(this.$el, ['marginTop', 'marginBottom', 'marginLeft', 'marginRight'])
7860
7883
  };
@@ -7886,14 +7909,29 @@
7886
7909
  {
7887
7910
 
7888
7911
  read: function(ref) {
7889
- var scroll = ref.scroll; if ( scroll === void 0 ) scroll = 0;
7912
+ var prevScroll = ref.scroll; if ( prevScroll === void 0 ) prevScroll = 0;
7913
+ var prevDir = ref.dir; if ( prevDir === void 0 ) prevDir = 'down';
7914
+ var overflow = ref.overflow;
7915
+ var overflowScroll = ref.overflowScroll; if ( overflowScroll === void 0 ) overflowScroll = 0;
7916
+ var start = ref.start;
7917
+ var end = ref.end;
7890
7918
 
7891
7919
 
7892
- this.scroll = window.pageYOffset;
7920
+ var scroll = scrollTop(window);
7921
+ var dir = prevScroll <= scroll ? 'down' : 'up';
7893
7922
 
7894
7923
  return {
7895
- dir: scroll <= this.scroll ? 'down' : 'up',
7896
- scroll: this.scroll
7924
+ dir: dir,
7925
+ prevDir: prevDir,
7926
+ scroll: scroll,
7927
+ prevScroll: prevScroll,
7928
+ overflowScroll: clamp(
7929
+ overflowScroll
7930
+ + clamp(scroll, start, end)
7931
+ - clamp(prevScroll, start, end),
7932
+ 0,
7933
+ overflow
7934
+ )
7897
7935
  };
7898
7936
  },
7899
7937
 
@@ -7901,35 +7939,34 @@
7901
7939
  var this$1$1 = this;
7902
7940
 
7903
7941
 
7904
- var now = Date.now();
7905
7942
  var isScrollUpdate = types.has('scroll');
7906
7943
  var initTimestamp = data.initTimestamp; if ( initTimestamp === void 0 ) initTimestamp = 0;
7907
7944
  var dir = data.dir;
7908
- var lastDir = data.lastDir;
7909
- var lastScroll = data.lastScroll;
7945
+ var prevDir = data.prevDir;
7910
7946
  var scroll = data.scroll;
7947
+ var prevScroll = data.prevScroll; if ( prevScroll === void 0 ) prevScroll = 0;
7911
7948
  var top = data.top;
7949
+ var start = data.start;
7950
+ var topOffset = data.topOffset;
7951
+ var height = data.height;
7912
7952
 
7913
- data.lastScroll = scroll;
7914
-
7915
- if (scroll < 0 || scroll === lastScroll && isScrollUpdate || this.showOnUp && !isScrollUpdate && !this.isFixed) {
7953
+ if (scroll < 0 || scroll === prevScroll && isScrollUpdate || this.showOnUp && !isScrollUpdate && !this.isFixed) {
7916
7954
  return;
7917
7955
  }
7918
7956
 
7919
- if (now - initTimestamp > 300 || dir !== lastDir) {
7957
+ var now = Date.now();
7958
+ if (now - initTimestamp > 300 || dir !== prevDir) {
7920
7959
  data.initScroll = scroll;
7921
7960
  data.initTimestamp = now;
7922
7961
  }
7923
7962
 
7924
- data.lastDir = dir;
7925
-
7926
- if (this.showOnUp && !this.isFixed && Math.abs(data.initScroll - scroll) <= 30 && Math.abs(lastScroll - scroll) <= 10) {
7963
+ if (this.showOnUp && !this.isFixed && Math.abs(data.initScroll - scroll) <= 30 && Math.abs(prevScroll - scroll) <= 10) {
7927
7964
  return;
7928
7965
  }
7929
7966
 
7930
7967
  if (this.inactive
7931
- || scroll < this.top
7932
- || this.showOnUp && (scroll <= this.top || dir === 'down' && isScrollUpdate || dir === 'up' && !this.isFixed && scroll <= this.bottomOffset)
7968
+ || scroll < start
7969
+ || this.showOnUp && (scroll <= start || dir === 'down' && isScrollUpdate || dir === 'up' && !this.isFixed && scroll <= topOffset + height)
7933
7970
  ) {
7934
7971
 
7935
7972
  if (!this.isFixed) {
@@ -7944,7 +7981,7 @@
7944
7981
 
7945
7982
  this.isFixed = false;
7946
7983
 
7947
- if (this.animation && scroll > this.topOffset) {
7984
+ if (this.animation && scroll > topOffset) {
7948
7985
  Animation.cancel(this.$el);
7949
7986
  Animation.out(this.$el, this.animation).then(function () { return this$1$1.hide(); }, noop);
7950
7987
  } else {
@@ -7994,23 +8031,37 @@
7994
8031
 
7995
8032
  update: function() {
7996
8033
 
7997
- var active = this.top !== 0 || this.scroll > this.top;
8034
+ var ref = this._data;
8035
+ var width = ref.width;
8036
+ var scroll = ref.scroll; if ( scroll === void 0 ) scroll = 0;
8037
+ var overflow = ref.overflow;
8038
+ var overflowScroll = ref.overflowScroll; if ( overflowScroll === void 0 ) overflowScroll = 0;
8039
+ var start = ref.start;
8040
+ var end = ref.end;
8041
+ var topOffset = ref.topOffset;
8042
+ var height = ref.height;
8043
+ var offsetParentTop = ref.offsetParentTop;
8044
+ var active = start !== 0 || scroll > start;
7998
8045
  var top = Math.max(0, this.offset);
7999
8046
  var position = 'fixed';
8000
8047
 
8001
- if (isNumeric(this.bottom) && this.scroll > this.bottom - this.offset) {
8002
- top = this.bottom - this.offsetParentTop;
8048
+ if (scroll > end) {
8049
+ top = end + this.offset - offsetParentTop;
8003
8050
  position = 'absolute';
8004
8051
  }
8005
8052
 
8053
+ if (overflow) {
8054
+ top -= overflowScroll;
8055
+ }
8056
+
8006
8057
  css(this.$el, {
8007
8058
  position: position,
8008
8059
  top: (top + "px"),
8009
- width: this.width
8060
+ width: width
8010
8061
  });
8011
8062
 
8012
8063
  this.isActive = active;
8013
- toggleClass(this.$el, this.clsBelow, this.scroll > this.bottomOffset);
8064
+ toggleClass(this.$el, this.clsBelow, scroll > topOffset + height);
8014
8065
  addClass(this.$el, this.clsFixed);
8015
8066
 
8016
8067
  }
@@ -8019,16 +8070,10 @@
8019
8070
 
8020
8071
  };
8021
8072
 
8022
- function parseProp(prop, ref) {
8023
- var $props = ref.$props;
8024
- var $el = ref.$el;
8025
- var propOffset = ref[(prop + "Offset")];
8026
-
8027
-
8028
- var value = $props[prop];
8073
+ function parseProp(value, el, propOffset) {
8029
8074
 
8030
8075
  if (!value) {
8031
- return;
8076
+ return 0;
8032
8077
  }
8033
8078
 
8034
8079
  if (isString(value) && value.match(/^-?\d/)) {
@@ -8037,7 +8082,7 @@
8037
8082
 
8038
8083
  } else {
8039
8084
 
8040
- return offset(value === true ? parent($el) : query(value, $el)).bottom;
8085
+ return offset(value === true ? parent(el) : query(value, el)).bottom;
8041
8086
 
8042
8087
  }
8043
8088
  }
@@ -10734,11 +10779,9 @@
10734
10779
  computed: {
10735
10780
 
10736
10781
  props: function(properties, $el) {
10737
- var this$1$1 = this;
10738
-
10739
10782
  return keys(props).reduce(function (result, prop) {
10740
10783
  if (!isUndefined(properties[prop])) {
10741
- result[prop] = props[prop].call(this$1$1, prop, $el, properties[prop].slice());
10784
+ result[prop] = props[prop](prop, $el, properties[prop].slice());
10742
10785
  }
10743
10786
  return result;
10744
10787
  }, {});
@@ -10746,6 +10789,12 @@
10746
10789
 
10747
10790
  },
10748
10791
 
10792
+ events: {
10793
+ bgimageload: function() {
10794
+ this.$emit();
10795
+ }
10796
+ },
10797
+
10749
10798
  methods: {
10750
10799
 
10751
10800
  reset: function() {
@@ -10893,15 +10942,15 @@
10893
10942
  var bgPos = css(el, 'backgroundPosition').split(' ')[prop === 'x' ? 0 : 1]; // IE 11 can't read background-position-[x|y]
10894
10943
 
10895
10944
  return getCssValue(el, 'backgroundSize', '') === 'cover'
10896
- ? backgroundCoverFn.call(this, prop, el, steps, bgPos, attr)
10945
+ ? backgroundCoverFn(prop, el, steps, bgPos, attr)
10897
10946
  : setBackgroundPosFn(prop, steps, bgPos);
10898
10947
  }
10899
10948
 
10900
10949
  function backgroundCoverFn(prop, el, steps, bgPos, attr) {
10901
10950
 
10902
- var image = getBackgroundImage.call(this, el);
10951
+ var dimImage = getBackgroundImageDimensions(el);
10903
10952
 
10904
- if (!image.naturalWidth) {
10953
+ if (!dimImage.width) {
10905
10954
  return noop;
10906
10955
  }
10907
10956
 
@@ -10917,11 +10966,6 @@
10917
10966
  height: el.offsetHeight
10918
10967
  };
10919
10968
 
10920
- var dimImage = {
10921
- width: image.naturalWidth,
10922
- height: image.naturalHeight
10923
- };
10924
-
10925
10969
  var baseDim = Dimensions.cover(dimImage, dimEl);
10926
10970
  var span = baseDim[attr] - dimEl[attr];
10927
10971
 
@@ -10952,26 +10996,34 @@
10952
10996
  };
10953
10997
  }
10954
10998
 
10955
- function getBackgroundImage(el) {
10956
- var this$1$1 = this;
10957
-
10999
+ var dimensions = {};
11000
+ function getBackgroundImageDimensions(el) {
10958
11001
  var src = css(el, 'backgroundImage').replace(/^none|url\(["']?(.+?)["']?\)$/, '$1');
10959
11002
 
10960
- var data = this._data;
10961
-
10962
- if (data[src]) {
10963
- return data[src];
11003
+ if (dimensions[src]) {
11004
+ return dimensions[src];
10964
11005
  }
10965
11006
 
11007
+ var image = new Image();
10966
11008
  if (src) {
10967
- var img = new Image();
10968
- img.src = src;
10969
- if (!img.naturalWidth) {
10970
- img.onload = function () { return this$1$1.$update(); };
10971
- }
11009
+ image.src = src;
10972
11010
 
10973
- return data[src] = img;
11011
+ if (!image.naturalWidth) {
11012
+ image.onload = function () {
11013
+ dimensions[src] = toDimensions(image);
11014
+ trigger(el, 'bgimageload');
11015
+ };
11016
+ }
10974
11017
  }
11018
+
11019
+ return dimensions[src] = toDimensions(image);
11020
+ }
11021
+
11022
+ function toDimensions(image) {
11023
+ return {
11024
+ width: image.naturalWidth,
11025
+ height: image.naturalHeight
11026
+ };
10975
11027
  }
10976
11028
 
10977
11029
  function getStep(steps, percent) {
@@ -11042,16 +11094,18 @@
11042
11094
  start: function(ref) {
11043
11095
  var start = ref.start;
11044
11096
 
11045
- return parseCalc(start, this.target);
11097
+ return toPx(start, 'height', this.target, true);
11046
11098
  },
11047
11099
 
11048
11100
  end: function(ref) {
11049
11101
  var end = ref.end;
11050
11102
  var viewport = ref.viewport;
11051
11103
 
11052
- return parseCalc(
11104
+ return toPx(
11053
11105
  end || (viewport = (1 - viewport) * 100) && (viewport + "vh+" + viewport + "%"),
11054
- this.target
11106
+ 'height',
11107
+ this.target,
11108
+ true
11055
11109
  );
11056
11110
  }
11057
11111
 
@@ -11098,19 +11152,6 @@
11098
11152
 
11099
11153
  };
11100
11154
 
11101
- var calcRe = /-?\d+(?:\.\d+)?(?:v[wh]|%|px)?/g;
11102
- function parseCalc(calc, el) {
11103
- var match;
11104
- var result = 0;
11105
- calc = calc.toString().replace(/\s/g, '');
11106
- calcRe.lastIndex = 0;
11107
- while ((match = calcRe.exec(calc)) !== null) {
11108
- result += toPx(match, 'height', el, true);
11109
- }
11110
-
11111
- return result;
11112
- }
11113
-
11114
11155
  function ease(percent, easing) {
11115
11156
  return easing >= 0
11116
11157
  ? Math.pow(percent, easing + 1)
@@ -11160,10 +11201,10 @@
11160
11201
 
11161
11202
  var from = prev
11162
11203
  ? getLeft(prev, list, center)
11163
- : getLeft(next, list, center) + dimensions(next).width * dir;
11204
+ : getLeft(next, list, center) + dimensions$1(next).width * dir;
11164
11205
  var to = next
11165
11206
  ? getLeft(next, list, center)
11166
- : from + dimensions(prev).width * dir * (isRtl ? -1 : 1);
11207
+ : from + dimensions$1(prev).width * dir * (isRtl ? -1 : 1);
11167
11208
 
11168
11209
  return {
11169
11210
 
@@ -11212,7 +11253,7 @@
11212
11253
  css(list, 'transform', translate(clamp(
11213
11254
  -to + (distance - distance * percent),
11214
11255
  -getWidth(list),
11215
- dimensions(list).width
11256
+ dimensions$1(list).width
11216
11257
  ) * (isRtl ? -1 : 1), 'px'));
11217
11258
 
11218
11259
  var actives = this.getActives();
@@ -11285,30 +11326,30 @@
11285
11326
  }
11286
11327
 
11287
11328
  function getMax(list) {
11288
- return Math.max(0, getWidth(list) - dimensions(list).width);
11329
+ return Math.max(0, getWidth(list) - dimensions$1(list).width);
11289
11330
  }
11290
11331
 
11291
11332
  function getWidth(list) {
11292
- return children(list).reduce(function (right, el) { return dimensions(el).width + right; }, 0);
11333
+ return children(list).reduce(function (right, el) { return dimensions$1(el).width + right; }, 0);
11293
11334
  }
11294
11335
 
11295
11336
  function centerEl(el, list) {
11296
- return dimensions(list).width / 2 - dimensions(el).width / 2;
11337
+ return dimensions$1(list).width / 2 - dimensions$1(el).width / 2;
11297
11338
  }
11298
11339
 
11299
11340
  function getElLeft(el, list) {
11300
- return el && (position(el).left + (isRtl ? dimensions(el).width - dimensions(list).width : 0)) * (isRtl ? -1 : 1) || 0;
11341
+ return el && (position(el).left + (isRtl ? dimensions$1(el).width - dimensions$1(list).width : 0)) * (isRtl ? -1 : 1) || 0;
11301
11342
  }
11302
11343
 
11303
11344
  function inView(list, listLeft) {
11304
11345
 
11305
11346
  listLeft -= 1;
11306
- var listWidth = dimensions(list).width;
11347
+ var listWidth = dimensions$1(list).width;
11307
11348
  var listRight = listLeft + listWidth + 2;
11308
11349
 
11309
11350
  return children(list).filter(function (slide) {
11310
11351
  var slideLeft = getElLeft(slide, list);
11311
- var slideRight = slideLeft + Math.min(dimensions(slide).width, listWidth);
11352
+ var slideRight = slideLeft + Math.min(dimensions$1(slide).width, listWidth);
11312
11353
 
11313
11354
  return slideLeft >= listLeft && slideRight <= listRight;
11314
11355
  });
@@ -11346,7 +11387,7 @@
11346
11387
  finite: function(ref) {
11347
11388
  var finite = ref.finite;
11348
11389
 
11349
- return finite || Math.ceil(getWidth(this.list)) < dimensions(this.list).width + getMaxElWidth(this.list) + this.center;
11390
+ return finite || Math.ceil(getWidth(this.list)) < Math.floor(dimensions$1(this.list).width + getMaxElWidth(this.list) + this.center);
11350
11391
  },
11351
11392
 
11352
11393
  maxIndex: function() {
@@ -11367,7 +11408,7 @@
11367
11408
  return true;
11368
11409
  }
11369
11410
 
11370
- lft += dimensions(el).width;
11411
+ lft += dimensions$1(el).width;
11371
11412
 
11372
11413
  });
11373
11414
 
@@ -11383,7 +11424,7 @@
11383
11424
  return;
11384
11425
  }
11385
11426
 
11386
- var width = dimensions(this.list).width / (this.center ? 2 : 1);
11427
+ var width = dimensions$1(this.list).width / (this.center ? 2 : 1);
11387
11428
 
11388
11429
  var left = 0;
11389
11430
  var leftCenter = width;
@@ -11391,7 +11432,7 @@
11391
11432
 
11392
11433
  sets = sortBy$1(this.slides, 'offsetLeft').reduce(function (sets, slide, i) {
11393
11434
 
11394
- var slideWidth = dimensions(slide).width;
11435
+ var slideWidth = dimensions$1(slide).width;
11395
11436
  var slideRight = slideLeft + slideWidth;
11396
11437
 
11397
11438
  if (slideRight > left) {
@@ -11403,7 +11444,7 @@
11403
11444
  if (!includes(sets, i)) {
11404
11445
 
11405
11446
  var cmp = this$1$1.slides[i + 1];
11406
- if (this$1$1.center && cmp && slideWidth < leftCenter - dimensions(cmp).width / 2) {
11447
+ if (this$1$1.center && cmp && slideWidth < leftCenter - dimensions$1(cmp).width / 2) {
11407
11448
  leftCenter -= slideWidth;
11408
11449
  } else {
11409
11450
  leftCenter = width;
@@ -11491,7 +11532,7 @@
11491
11532
  }
11492
11533
 
11493
11534
  var index = this.dir < 0 || !this.slides[this.prevIndex] ? this.index : this.prevIndex;
11494
- this.duration = speedUp(this.avgWidth / this.velocity) * (dimensions(this.slides[index]).width / this.avgWidth);
11535
+ this.duration = speedUp(this.avgWidth / this.velocity) * (dimensions$1(this.slides[index]).width / this.avgWidth);
11495
11536
 
11496
11537
  this.reorder();
11497
11538
 
@@ -11531,7 +11572,7 @@
11531
11572
  }
11532
11573
 
11533
11574
  var next = this.slides[index];
11534
- var width = dimensions(this.list).width / 2 - dimensions(next).width / 2;
11575
+ var width = dimensions$1(this.list).width / 2 - dimensions$1(next).width / 2;
11535
11576
  var j = 0;
11536
11577
 
11537
11578
  while (width > 0) {
@@ -11539,7 +11580,7 @@
11539
11580
  var slide = this.slides[slideIndex];
11540
11581
 
11541
11582
  css(slide, 'order', slideIndex > index ? -2 : -1);
11542
- width -= dimensions(slide).width;
11583
+ width -= dimensions$1(slide).width;
11543
11584
  }
11544
11585
 
11545
11586
  },
@@ -11576,7 +11617,7 @@
11576
11617
  };
11577
11618
 
11578
11619
  function getMaxElWidth(list) {
11579
- return Math.max.apply(Math, [ 0 ].concat( children(list).map(function (el) { return dimensions(el).width; }) ));
11620
+ return Math.max.apply(Math, [ 0 ].concat( children(list).map(function (el) { return dimensions$1(el).width; }) ));
11580
11621
  }
11581
11622
 
11582
11623
  var sliderParallax = {
@@ -12090,7 +12131,6 @@
12090
12131
 
12091
12132
  off(document, pointerMove, this.move);
12092
12133
  off(document, pointerUp, this.end);
12093
- off(window, 'scroll', this.scroll);
12094
12134
 
12095
12135
  if (!this.drag) {
12096
12136
  return;
@@ -12173,7 +12213,7 @@
12173
12213
 
12174
12214
  var x = pos.x;
12175
12215
  var y = pos.y;
12176
- y += window.pageYOffset;
12216
+ y += scrollTop(window);
12177
12217
 
12178
12218
  var dist = (Date.now() - last) * .3;
12179
12219
  last = Date.now();