uikit 3.11.0 → 3.11.2-dev.0e5febb2b

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 (59) hide show
  1. package/CHANGELOG.md +25 -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 +169 -102
  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 +232 -170
  42. package/dist/js/uikit.min.js +1 -1
  43. package/package.json +1 -1
  44. package/src/js/api/component.js +1 -1
  45. package/src/js/api/state.js +20 -24
  46. package/src/js/components/parallax.js +5 -16
  47. package/src/js/components/slider.js +1 -1
  48. package/src/js/components/sortable.js +1 -2
  49. package/src/js/core/core.js +2 -2
  50. package/src/js/core/drop.js +1 -1
  51. package/src/js/core/height-viewport.js +2 -2
  52. package/src/js/core/navbar.js +6 -2
  53. package/src/js/core/sticky.js +82 -50
  54. package/src/js/mixin/parallax.js +32 -21
  55. package/src/js/util/dimensions.js +28 -12
  56. package/src/js/util/fastdom.js +2 -2
  57. package/src/js/util/viewport.js +7 -3
  58. package/tests/sticky-parallax.html +44 -41
  59. package/tests/sticky.html +56 -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.0e5febb2b | 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) {
@@ -3137,11 +3156,11 @@
3137
3156
  on(
3138
3157
  el,
3139
3158
  name,
3140
- !delegate
3141
- ? null
3142
- : isString(delegate)
3159
+ delegate
3160
+ ? isString(delegate)
3143
3161
  ? delegate
3144
- : delegate.call(component),
3162
+ : delegate.call(component)
3163
+ : null,
3145
3164
  isString(handler) ? component[handler] : handler.bind(component),
3146
3165
  {passive: passive, capture: capture, self: self}
3147
3166
  )
@@ -3177,30 +3196,26 @@
3177
3196
  }
3178
3197
 
3179
3198
  function normalizeData(ref, ref$1) {
3180
- var data = ref.data;
3181
- var args = ref$1.args;
3199
+ var data = ref.data; if ( data === void 0 ) data = {};
3200
+ var args = ref$1.args; if ( args === void 0 ) args = [];
3182
3201
  var props = ref$1.props; if ( props === void 0 ) props = {};
3183
3202
 
3184
- data = isArray(data)
3185
- ? !isEmpty(args)
3186
- ? data.slice(0, args.length).reduce(function (data, value, index) {
3187
- if (isPlainObject(value)) {
3188
- assign(data, value);
3189
- } else {
3190
- data[args[index]] = value;
3191
- }
3192
- return data;
3193
- }, {})
3194
- : undefined
3195
- : data;
3196
-
3197
- if (data) {
3198
- for (var key in data) {
3199
- if (isUndefined(data[key])) {
3200
- delete data[key];
3203
+ if (isArray(data)) {
3204
+ data = data.slice(0, args.length).reduce(function (data, value, index) {
3205
+ if (isPlainObject(value)) {
3206
+ assign(data, value);
3201
3207
  } else {
3202
- data[key] = props[key] ? coerce(props[key], data[key]) : data[key];
3208
+ data[args[index]] = value;
3203
3209
  }
3210
+ return data;
3211
+ }, {});
3212
+ }
3213
+
3214
+ for (var key in data) {
3215
+ if (isUndefined(data[key])) {
3216
+ delete data[key];
3217
+ } else if (props[key]) {
3218
+ data[key] = coerce(props[key], data[key]);
3204
3219
  }
3205
3220
  }
3206
3221
 
@@ -3382,7 +3397,7 @@
3382
3397
 
3383
3398
  return component.options.functional
3384
3399
  ? new component({data: isPlainObject(element) ? element : [].concat( argsArray )})
3385
- : !element ? init(element) : $$(element).map(init)[0];
3400
+ : element ? $$(element).map(init)[0] : init();
3386
3401
 
3387
3402
  function init(element) {
3388
3403
 
@@ -3462,7 +3477,7 @@
3462
3477
  UIkit.data = '__uikit__';
3463
3478
  UIkit.prefix = 'uk-';
3464
3479
  UIkit.options = {};
3465
- UIkit.version = '3.11.0';
3480
+ UIkit.version = '3.11.2-dev.0e5febb2b';
3466
3481
 
3467
3482
  globalAPI(UIkit);
3468
3483
  hooksAPI(UIkit);
@@ -3483,7 +3498,7 @@
3483
3498
  return;
3484
3499
  }
3485
3500
  pendingResize = true;
3486
- fastdom.write(function () { return pendingResize = false; });
3501
+ fastdom.read(function () { return pendingResize = false; });
3487
3502
  UIkit.update(null, 'resize');
3488
3503
  };
3489
3504
 
@@ -3502,7 +3517,7 @@
3502
3517
  return;
3503
3518
  }
3504
3519
  pending = true;
3505
- fastdom.write(function () { return pending = false; });
3520
+ fastdom.read(function () { return pending = false; });
3506
3521
 
3507
3522
  UIkit.update(null, e.type);
3508
3523
 
@@ -4588,7 +4603,7 @@
4588
4603
  if (active$1) {
4589
4604
 
4590
4605
  if (delay && active$1.isDelaying) {
4591
- this.showTimer = setTimeout(this.show, 10);
4606
+ this.showTimer = setTimeout(function () { return matches(target, ':hover') && this$1$1.show(); }, 10);
4592
4607
  return;
4593
4608
  }
4594
4609
 
@@ -5222,7 +5237,7 @@
5222
5237
  css(element, 'display', 'block', 'important');
5223
5238
  }
5224
5239
 
5225
- var height = dimensions(element).height - boxModelAdjust(element, 'height', 'content-box');
5240
+ var height = dimensions$1(element).height - boxModelAdjust(element, 'height', 'content-box');
5226
5241
 
5227
5242
  if (style !== false) {
5228
5243
  css(element, 'display', style);
@@ -5264,7 +5279,7 @@
5264
5279
 
5265
5280
  if (this.expand) {
5266
5281
 
5267
- minHeight = height(window) - (dimensions(document.documentElement).height - dimensions(this.$el).height) - box || '';
5282
+ minHeight = height(window) - (dimensions$1(document.documentElement).height - dimensions$1(this.$el).height) - box || '';
5268
5283
 
5269
5284
  } else {
5270
5285
 
@@ -5281,7 +5296,7 @@
5281
5296
 
5282
5297
  if (this.offsetBottom === true) {
5283
5298
 
5284
- minHeight += " - " + (dimensions(this.$el.nextElementSibling).height) + "px";
5299
+ minHeight += " - " + (dimensions$1(this.$el.nextElementSibling).height) + "px";
5285
5300
 
5286
5301
  } else if (isNumeric(this.offsetBottom)) {
5287
5302
 
@@ -5293,7 +5308,7 @@
5293
5308
 
5294
5309
  } else if (isString(this.offsetBottom)) {
5295
5310
 
5296
- minHeight += " - " + (dimensions(query(this.offsetBottom, this.$el)).height) + "px";
5311
+ minHeight += " - " + (dimensions$1(query(this.offsetBottom, this.$el)).height) + "px";
5297
5312
 
5298
5313
  }
5299
5314
 
@@ -5312,7 +5327,7 @@
5312
5327
  css(this.$el, {minHeight: minHeight});
5313
5328
 
5314
5329
  if (minHeight !== prev) {
5315
- this.$update(this.$el, 'resize');
5330
+ trigger(this.$el, 'resize');
5316
5331
  }
5317
5332
 
5318
5333
  if (this.minHeight && toFloat(css(this.$el, 'minHeight')) < this.minHeight) {
@@ -6720,7 +6735,7 @@
6720
6735
  var current = ref.current;
6721
6736
 
6722
6737
  var active = this.getActive();
6723
- if (active && includes(active.mode, 'hover') && active.target && !within(active.target, current) && !active.tracker.movesTo(active.$el)) {
6738
+ if (active && includes(active.mode, 'hover') && active.target && !within(active.target, current) && !active.isDelaying) {
6724
6739
  active.hide(false);
6725
6740
  }
6726
6741
  }
@@ -6895,7 +6910,11 @@
6895
6910
 
6896
6911
  var active = this.getActive();
6897
6912
 
6898
- if (matches(this.dropbar, ':hover') && active && active.$el === $el) {
6913
+ if (matches(this.dropbar, ':hover')
6914
+ && active
6915
+ && active.$el === $el
6916
+ && !this.toggles.some(function (el) { return active.target !== el && matches(el, ':focus'); })
6917
+ ) {
6899
6918
  e.preventDefault();
6900
6919
  }
6901
6920
  }
@@ -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
 
@@ -7687,6 +7706,7 @@
7687
7706
  mixins: [Class, Media],
7688
7707
 
7689
7708
  props: {
7709
+ position: String,
7690
7710
  top: null,
7691
7711
  bottom: Boolean,
7692
7712
  offset: String,
@@ -7702,6 +7722,7 @@
7702
7722
  },
7703
7723
 
7704
7724
  data: {
7725
+ position: 'top',
7705
7726
  top: 0,
7706
7727
  bottom: false,
7707
7728
  offset: 0,
@@ -7718,10 +7739,23 @@
7718
7739
 
7719
7740
  computed: {
7720
7741
 
7721
- offset: function(ref) {
7742
+ position: function(ref, $el) {
7743
+ var position = ref.position;
7744
+
7745
+ return position === 'auto'
7746
+ ? (this.isFixed ? this.placeholder : $el).offsetHeight > height(window)
7747
+ ? 'bottom'
7748
+ : 'top'
7749
+ : position;
7750
+ },
7751
+
7752
+ offset: function(ref, $el) {
7722
7753
  var offset = ref.offset;
7723
7754
 
7724
- return toPx(offset);
7755
+ if (this.position === 'bottom') {
7756
+ offset += '+100vh-100%';
7757
+ }
7758
+ return toPx(offset, 'height', $el);
7725
7759
  },
7726
7760
 
7727
7761
  selTarget: function(ref, $el) {
@@ -7788,7 +7822,7 @@
7788
7822
  var this$1$1 = this;
7789
7823
 
7790
7824
 
7791
- if (!(this.targetOffset !== false && location.hash && window.pageYOffset > 0)) {
7825
+ if (!(this.targetOffset !== false && location.hash && scrollTop(window) > 0)) {
7792
7826
  return;
7793
7827
  }
7794
7828
 
@@ -7821,6 +7855,7 @@
7821
7855
 
7822
7856
  read: function(ref, types) {
7823
7857
  var height$1 = ref.height;
7858
+ var margin = ref.margin;
7824
7859
 
7825
7860
 
7826
7861
  this.inactive = !this.matchMedia || !isVisible(this.$el);
@@ -7829,46 +7864,56 @@
7829
7864
  return false;
7830
7865
  }
7831
7866
 
7832
- if (this.isActive && types.has('resize')) {
7867
+ var hide = this.isActive && types.has('resize');
7868
+ if (hide) {
7833
7869
  this.hide();
7834
- height$1 = this.$el.offsetHeight;
7835
- this.show();
7836
7870
  }
7837
7871
 
7838
- height$1 = this.isActive ? height$1 : this.$el.offsetHeight;
7872
+ if (!this.isActive) {
7873
+ height$1 = this.$el.offsetHeight;
7874
+ margin = css(this.$el, 'margin');
7875
+ }
7839
7876
 
7840
- if (height$1 + this.offset > height(window)) {
7841
- this.inactive = true;
7842
- return false;
7877
+ if (hide) {
7878
+ this.show();
7843
7879
  }
7844
7880
 
7881
+ var overflow = Math.max(0, height$1 + this.offset - height(window));
7882
+
7845
7883
  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;
7884
+ var topOffset = offset(referenceElement).top;
7885
+ var offsetParentTop = offset(referenceElement.offsetParent).top;
7849
7886
 
7850
- var bottom = parseProp('bottom', this);
7887
+ var top = parseProp(this.top, this.$el, topOffset);
7888
+ var bottom = parseProp(this.bottom, this.$el, topOffset + height$1);
7851
7889
 
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;
7890
+ var start = Math.max(top, topOffset) - this.offset;
7891
+ var end = bottom
7892
+ ? bottom - this.$el.offsetHeight + overflow - this.offset
7893
+ : getScrollingElement(this.$el).scrollHeight - height(window);
7855
7894
 
7856
7895
  return {
7896
+ start: start,
7897
+ end: end,
7898
+ overflow: overflow,
7899
+ topOffset: topOffset,
7900
+ offsetParentTop: offsetParentTop,
7857
7901
  height: height$1,
7858
- top: offsetPosition(this.placeholder)[0],
7859
- margins: css(this.$el, ['marginTop', 'marginBottom', 'marginLeft', 'marginRight'])
7902
+ margin: margin,
7903
+ width: dimensions$1(isVisible(this.widthElement) ? this.widthElement : this.$el).width,
7904
+ top: offsetPosition(this.placeholder)[0]
7860
7905
  };
7861
7906
  },
7862
7907
 
7863
7908
  write: function(ref) {
7864
7909
  var height = ref.height;
7865
- var margins = ref.margins;
7910
+ var margin = ref.margin;
7866
7911
 
7867
7912
 
7868
7913
  var ref$1 = this;
7869
7914
  var placeholder = ref$1.placeholder;
7870
7915
 
7871
- css(placeholder, assign({height: height}, margins));
7916
+ css(placeholder, {height: height, margin: margin});
7872
7917
 
7873
7918
  if (!within(placeholder, document)) {
7874
7919
  after(this.$el, placeholder);
@@ -7886,14 +7931,29 @@
7886
7931
  {
7887
7932
 
7888
7933
  read: function(ref) {
7889
- var scroll = ref.scroll; if ( scroll === void 0 ) scroll = 0;
7934
+ var prevScroll = ref.scroll; if ( prevScroll === void 0 ) prevScroll = 0;
7935
+ var prevDir = ref.dir; if ( prevDir === void 0 ) prevDir = 'down';
7936
+ var overflow = ref.overflow;
7937
+ var overflowScroll = ref.overflowScroll; if ( overflowScroll === void 0 ) overflowScroll = 0;
7938
+ var start = ref.start;
7939
+ var end = ref.end;
7890
7940
 
7891
7941
 
7892
- this.scroll = window.pageYOffset;
7942
+ var scroll = scrollTop(window);
7943
+ var dir = prevScroll <= scroll ? 'down' : 'up';
7893
7944
 
7894
7945
  return {
7895
- dir: scroll <= this.scroll ? 'down' : 'up',
7896
- scroll: this.scroll
7946
+ dir: dir,
7947
+ prevDir: prevDir,
7948
+ scroll: scroll,
7949
+ prevScroll: prevScroll,
7950
+ overflowScroll: clamp(
7951
+ overflowScroll
7952
+ + clamp(scroll, start, end)
7953
+ - clamp(prevScroll, start, end),
7954
+ 0,
7955
+ overflow
7956
+ )
7897
7957
  };
7898
7958
  },
7899
7959
 
@@ -7901,35 +7961,34 @@
7901
7961
  var this$1$1 = this;
7902
7962
 
7903
7963
 
7904
- var now = Date.now();
7905
7964
  var isScrollUpdate = types.has('scroll');
7906
7965
  var initTimestamp = data.initTimestamp; if ( initTimestamp === void 0 ) initTimestamp = 0;
7907
7966
  var dir = data.dir;
7908
- var lastDir = data.lastDir;
7909
- var lastScroll = data.lastScroll;
7967
+ var prevDir = data.prevDir;
7910
7968
  var scroll = data.scroll;
7969
+ var prevScroll = data.prevScroll; if ( prevScroll === void 0 ) prevScroll = 0;
7911
7970
  var top = data.top;
7971
+ var start = data.start;
7972
+ var topOffset = data.topOffset;
7973
+ var height = data.height;
7912
7974
 
7913
- data.lastScroll = scroll;
7914
-
7915
- if (scroll < 0 || scroll === lastScroll && isScrollUpdate || this.showOnUp && !isScrollUpdate && !this.isFixed) {
7975
+ if (scroll < 0 || scroll === prevScroll && isScrollUpdate || this.showOnUp && !isScrollUpdate && !this.isFixed) {
7916
7976
  return;
7917
7977
  }
7918
7978
 
7919
- if (now - initTimestamp > 300 || dir !== lastDir) {
7979
+ var now = Date.now();
7980
+ if (now - initTimestamp > 300 || dir !== prevDir) {
7920
7981
  data.initScroll = scroll;
7921
7982
  data.initTimestamp = now;
7922
7983
  }
7923
7984
 
7924
- data.lastDir = dir;
7925
-
7926
- if (this.showOnUp && !this.isFixed && Math.abs(data.initScroll - scroll) <= 30 && Math.abs(lastScroll - scroll) <= 10) {
7985
+ if (this.showOnUp && !this.isFixed && Math.abs(data.initScroll - scroll) <= 30 && Math.abs(prevScroll - scroll) <= 10) {
7927
7986
  return;
7928
7987
  }
7929
7988
 
7930
7989
  if (this.inactive
7931
- || scroll < this.top
7932
- || this.showOnUp && (scroll <= this.top || dir === 'down' && isScrollUpdate || dir === 'up' && !this.isFixed && scroll <= this.bottomOffset)
7990
+ || scroll < start
7991
+ || this.showOnUp && (scroll <= start || dir === 'down' && isScrollUpdate || dir === 'up' && !this.isFixed && scroll <= topOffset + height)
7933
7992
  ) {
7934
7993
 
7935
7994
  if (!this.isFixed) {
@@ -7944,7 +8003,7 @@
7944
8003
 
7945
8004
  this.isFixed = false;
7946
8005
 
7947
- if (this.animation && scroll > this.topOffset) {
8006
+ if (this.animation && scroll > topOffset) {
7948
8007
  Animation.cancel(this.$el);
7949
8008
  Animation.out(this.$el, this.animation).then(function () { return this$1$1.hide(); }, noop);
7950
8009
  } else {
@@ -7994,23 +8053,37 @@
7994
8053
 
7995
8054
  update: function() {
7996
8055
 
7997
- var active = this.top !== 0 || this.scroll > this.top;
7998
- var top = Math.max(0, this.offset);
8056
+ var ref = this._data;
8057
+ var width = ref.width;
8058
+ var scroll = ref.scroll; if ( scroll === void 0 ) scroll = 0;
8059
+ var overflow = ref.overflow;
8060
+ var overflowScroll = ref.overflowScroll; if ( overflowScroll === void 0 ) overflowScroll = 0;
8061
+ var start = ref.start;
8062
+ var end = ref.end;
8063
+ var topOffset = ref.topOffset;
8064
+ var height = ref.height;
8065
+ var offsetParentTop = ref.offsetParentTop;
8066
+ var active = start !== 0 || scroll > start;
8067
+ var top = this.offset;
7999
8068
  var position = 'fixed';
8000
8069
 
8001
- if (isNumeric(this.bottom) && this.scroll > this.bottom - this.offset) {
8002
- top = this.bottom - this.offsetParentTop;
8070
+ if (scroll > end) {
8071
+ top = end + this.offset - offsetParentTop;
8003
8072
  position = 'absolute';
8004
8073
  }
8005
8074
 
8075
+ if (overflow) {
8076
+ top -= overflowScroll;
8077
+ }
8078
+
8006
8079
  css(this.$el, {
8007
8080
  position: position,
8008
8081
  top: (top + "px"),
8009
- width: this.width
8082
+ width: width
8010
8083
  });
8011
8084
 
8012
8085
  this.isActive = active;
8013
- toggleClass(this.$el, this.clsBelow, this.scroll > this.bottomOffset);
8086
+ toggleClass(this.$el, this.clsBelow, scroll > topOffset + height);
8014
8087
  addClass(this.$el, this.clsFixed);
8015
8088
 
8016
8089
  }
@@ -8019,16 +8092,10 @@
8019
8092
 
8020
8093
  };
8021
8094
 
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];
8095
+ function parseProp(value, el, propOffset) {
8029
8096
 
8030
8097
  if (!value) {
8031
- return;
8098
+ return 0;
8032
8099
  }
8033
8100
 
8034
8101
  if (isString(value) && value.match(/^-?\d/)) {
@@ -8037,7 +8104,7 @@
8037
8104
 
8038
8105
  } else {
8039
8106
 
8040
- return offset(value === true ? parent($el) : query(value, $el)).bottom;
8107
+ return offset(value === true ? parent(el) : query(value, el)).bottom;
8041
8108
 
8042
8109
  }
8043
8110
  }
@@ -10734,11 +10801,9 @@
10734
10801
  computed: {
10735
10802
 
10736
10803
  props: function(properties, $el) {
10737
- var this$1$1 = this;
10738
-
10739
10804
  return keys(props).reduce(function (result, prop) {
10740
10805
  if (!isUndefined(properties[prop])) {
10741
- result[prop] = props[prop].call(this$1$1, prop, $el, properties[prop].slice());
10806
+ result[prop] = props[prop](prop, $el, properties[prop].slice());
10742
10807
  }
10743
10808
  return result;
10744
10809
  }, {});
@@ -10746,6 +10811,12 @@
10746
10811
 
10747
10812
  },
10748
10813
 
10814
+ events: {
10815
+ bgimageload: function() {
10816
+ this.$emit();
10817
+ }
10818
+ },
10819
+
10749
10820
  methods: {
10750
10821
 
10751
10822
  reset: function() {
@@ -10893,15 +10964,15 @@
10893
10964
  var bgPos = css(el, 'backgroundPosition').split(' ')[prop === 'x' ? 0 : 1]; // IE 11 can't read background-position-[x|y]
10894
10965
 
10895
10966
  return getCssValue(el, 'backgroundSize', '') === 'cover'
10896
- ? backgroundCoverFn.call(this, prop, el, steps, bgPos, attr)
10967
+ ? backgroundCoverFn(prop, el, steps, bgPos, attr)
10897
10968
  : setBackgroundPosFn(prop, steps, bgPos);
10898
10969
  }
10899
10970
 
10900
10971
  function backgroundCoverFn(prop, el, steps, bgPos, attr) {
10901
10972
 
10902
- var image = getBackgroundImage.call(this, el);
10973
+ var dimImage = getBackgroundImageDimensions(el);
10903
10974
 
10904
- if (!image.naturalWidth) {
10975
+ if (!dimImage.width) {
10905
10976
  return noop;
10906
10977
  }
10907
10978
 
@@ -10917,11 +10988,6 @@
10917
10988
  height: el.offsetHeight
10918
10989
  };
10919
10990
 
10920
- var dimImage = {
10921
- width: image.naturalWidth,
10922
- height: image.naturalHeight
10923
- };
10924
-
10925
10991
  var baseDim = Dimensions.cover(dimImage, dimEl);
10926
10992
  var span = baseDim[attr] - dimEl[attr];
10927
10993
 
@@ -10952,26 +11018,34 @@
10952
11018
  };
10953
11019
  }
10954
11020
 
10955
- function getBackgroundImage(el) {
10956
- var this$1$1 = this;
10957
-
11021
+ var dimensions = {};
11022
+ function getBackgroundImageDimensions(el) {
10958
11023
  var src = css(el, 'backgroundImage').replace(/^none|url\(["']?(.+?)["']?\)$/, '$1');
10959
11024
 
10960
- var data = this._data;
10961
-
10962
- if (data[src]) {
10963
- return data[src];
11025
+ if (dimensions[src]) {
11026
+ return dimensions[src];
10964
11027
  }
10965
11028
 
11029
+ var image = new Image();
10966
11030
  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
- }
11031
+ image.src = src;
10972
11032
 
10973
- return data[src] = img;
11033
+ if (!image.naturalWidth) {
11034
+ image.onload = function () {
11035
+ dimensions[src] = toDimensions(image);
11036
+ trigger(el, 'bgimageload');
11037
+ };
11038
+ }
10974
11039
  }
11040
+
11041
+ return dimensions[src] = toDimensions(image);
11042
+ }
11043
+
11044
+ function toDimensions(image) {
11045
+ return {
11046
+ width: image.naturalWidth,
11047
+ height: image.naturalHeight
11048
+ };
10975
11049
  }
10976
11050
 
10977
11051
  function getStep(steps, percent) {
@@ -11042,16 +11116,18 @@
11042
11116
  start: function(ref) {
11043
11117
  var start = ref.start;
11044
11118
 
11045
- return parseCalc(start, this.target);
11119
+ return toPx(start, 'height', this.target, true);
11046
11120
  },
11047
11121
 
11048
11122
  end: function(ref) {
11049
11123
  var end = ref.end;
11050
11124
  var viewport = ref.viewport;
11051
11125
 
11052
- return parseCalc(
11126
+ return toPx(
11053
11127
  end || (viewport = (1 - viewport) * 100) && (viewport + "vh+" + viewport + "%"),
11054
- this.target
11128
+ 'height',
11129
+ this.target,
11130
+ true
11055
11131
  );
11056
11132
  }
11057
11133
 
@@ -11098,19 +11174,6 @@
11098
11174
 
11099
11175
  };
11100
11176
 
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
11177
  function ease(percent, easing) {
11115
11178
  return easing >= 0
11116
11179
  ? Math.pow(percent, easing + 1)
@@ -11160,10 +11223,10 @@
11160
11223
 
11161
11224
  var from = prev
11162
11225
  ? getLeft(prev, list, center)
11163
- : getLeft(next, list, center) + dimensions(next).width * dir;
11226
+ : getLeft(next, list, center) + dimensions$1(next).width * dir;
11164
11227
  var to = next
11165
11228
  ? getLeft(next, list, center)
11166
- : from + dimensions(prev).width * dir * (isRtl ? -1 : 1);
11229
+ : from + dimensions$1(prev).width * dir * (isRtl ? -1 : 1);
11167
11230
 
11168
11231
  return {
11169
11232
 
@@ -11212,7 +11275,7 @@
11212
11275
  css(list, 'transform', translate(clamp(
11213
11276
  -to + (distance - distance * percent),
11214
11277
  -getWidth(list),
11215
- dimensions(list).width
11278
+ dimensions$1(list).width
11216
11279
  ) * (isRtl ? -1 : 1), 'px'));
11217
11280
 
11218
11281
  var actives = this.getActives();
@@ -11285,30 +11348,30 @@
11285
11348
  }
11286
11349
 
11287
11350
  function getMax(list) {
11288
- return Math.max(0, getWidth(list) - dimensions(list).width);
11351
+ return Math.max(0, getWidth(list) - dimensions$1(list).width);
11289
11352
  }
11290
11353
 
11291
11354
  function getWidth(list) {
11292
- return children(list).reduce(function (right, el) { return dimensions(el).width + right; }, 0);
11355
+ return children(list).reduce(function (right, el) { return dimensions$1(el).width + right; }, 0);
11293
11356
  }
11294
11357
 
11295
11358
  function centerEl(el, list) {
11296
- return dimensions(list).width / 2 - dimensions(el).width / 2;
11359
+ return dimensions$1(list).width / 2 - dimensions$1(el).width / 2;
11297
11360
  }
11298
11361
 
11299
11362
  function getElLeft(el, list) {
11300
- return el && (position(el).left + (isRtl ? dimensions(el).width - dimensions(list).width : 0)) * (isRtl ? -1 : 1) || 0;
11363
+ return el && (position(el).left + (isRtl ? dimensions$1(el).width - dimensions$1(list).width : 0)) * (isRtl ? -1 : 1) || 0;
11301
11364
  }
11302
11365
 
11303
11366
  function inView(list, listLeft) {
11304
11367
 
11305
11368
  listLeft -= 1;
11306
- var listWidth = dimensions(list).width;
11369
+ var listWidth = dimensions$1(list).width;
11307
11370
  var listRight = listLeft + listWidth + 2;
11308
11371
 
11309
11372
  return children(list).filter(function (slide) {
11310
11373
  var slideLeft = getElLeft(slide, list);
11311
- var slideRight = slideLeft + Math.min(dimensions(slide).width, listWidth);
11374
+ var slideRight = slideLeft + Math.min(dimensions$1(slide).width, listWidth);
11312
11375
 
11313
11376
  return slideLeft >= listLeft && slideRight <= listRight;
11314
11377
  });
@@ -11346,7 +11409,7 @@
11346
11409
  finite: function(ref) {
11347
11410
  var finite = ref.finite;
11348
11411
 
11349
- return finite || Math.ceil(getWidth(this.list)) < dimensions(this.list).width + getMaxElWidth(this.list) + this.center;
11412
+ return finite || Math.ceil(getWidth(this.list)) < Math.floor(dimensions$1(this.list).width + getMaxElWidth(this.list) + this.center);
11350
11413
  },
11351
11414
 
11352
11415
  maxIndex: function() {
@@ -11367,7 +11430,7 @@
11367
11430
  return true;
11368
11431
  }
11369
11432
 
11370
- lft += dimensions(el).width;
11433
+ lft += dimensions$1(el).width;
11371
11434
 
11372
11435
  });
11373
11436
 
@@ -11383,7 +11446,7 @@
11383
11446
  return;
11384
11447
  }
11385
11448
 
11386
- var width = dimensions(this.list).width / (this.center ? 2 : 1);
11449
+ var width = dimensions$1(this.list).width / (this.center ? 2 : 1);
11387
11450
 
11388
11451
  var left = 0;
11389
11452
  var leftCenter = width;
@@ -11391,7 +11454,7 @@
11391
11454
 
11392
11455
  sets = sortBy$1(this.slides, 'offsetLeft').reduce(function (sets, slide, i) {
11393
11456
 
11394
- var slideWidth = dimensions(slide).width;
11457
+ var slideWidth = dimensions$1(slide).width;
11395
11458
  var slideRight = slideLeft + slideWidth;
11396
11459
 
11397
11460
  if (slideRight > left) {
@@ -11403,7 +11466,7 @@
11403
11466
  if (!includes(sets, i)) {
11404
11467
 
11405
11468
  var cmp = this$1$1.slides[i + 1];
11406
- if (this$1$1.center && cmp && slideWidth < leftCenter - dimensions(cmp).width / 2) {
11469
+ if (this$1$1.center && cmp && slideWidth < leftCenter - dimensions$1(cmp).width / 2) {
11407
11470
  leftCenter -= slideWidth;
11408
11471
  } else {
11409
11472
  leftCenter = width;
@@ -11491,7 +11554,7 @@
11491
11554
  }
11492
11555
 
11493
11556
  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);
11557
+ this.duration = speedUp(this.avgWidth / this.velocity) * (dimensions$1(this.slides[index]).width / this.avgWidth);
11495
11558
 
11496
11559
  this.reorder();
11497
11560
 
@@ -11531,7 +11594,7 @@
11531
11594
  }
11532
11595
 
11533
11596
  var next = this.slides[index];
11534
- var width = dimensions(this.list).width / 2 - dimensions(next).width / 2;
11597
+ var width = dimensions$1(this.list).width / 2 - dimensions$1(next).width / 2;
11535
11598
  var j = 0;
11536
11599
 
11537
11600
  while (width > 0) {
@@ -11539,7 +11602,7 @@
11539
11602
  var slide = this.slides[slideIndex];
11540
11603
 
11541
11604
  css(slide, 'order', slideIndex > index ? -2 : -1);
11542
- width -= dimensions(slide).width;
11605
+ width -= dimensions$1(slide).width;
11543
11606
  }
11544
11607
 
11545
11608
  },
@@ -11576,7 +11639,7 @@
11576
11639
  };
11577
11640
 
11578
11641
  function getMaxElWidth(list) {
11579
- return Math.max.apply(Math, [ 0 ].concat( children(list).map(function (el) { return dimensions(el).width; }) ));
11642
+ return Math.max.apply(Math, [ 0 ].concat( children(list).map(function (el) { return dimensions$1(el).width; }) ));
11580
11643
  }
11581
11644
 
11582
11645
  var sliderParallax = {
@@ -12090,7 +12153,6 @@
12090
12153
 
12091
12154
  off(document, pointerMove, this.move);
12092
12155
  off(document, pointerUp, this.end);
12093
- off(window, 'scroll', this.scroll);
12094
12156
 
12095
12157
  if (!this.drag) {
12096
12158
  return;
@@ -12173,7 +12235,7 @@
12173
12235
 
12174
12236
  var x = pos.x;
12175
12237
  var y = pos.y;
12176
- y += window.pageYOffset;
12238
+ y += scrollTop(window);
12177
12239
 
12178
12240
  var dist = (Date.now() - last) * .3;
12179
12241
  last = Date.now();