uikit 3.11.2-dev.f2970ffaa → 3.11.2-dev.fb043abc2

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 (47) hide show
  1. package/CHANGELOG.md +5 -0
  2. package/dist/css/uikit-core-rtl.css +1 -1
  3. package/dist/css/uikit-core-rtl.min.css +1 -1
  4. package/dist/css/uikit-core.css +1 -1
  5. package/dist/css/uikit-core.min.css +1 -1
  6. package/dist/css/uikit-rtl.css +1 -1
  7. package/dist/css/uikit-rtl.min.css +1 -1
  8. package/dist/css/uikit.css +1 -1
  9. package/dist/css/uikit.min.css +1 -1
  10. package/dist/js/components/countdown.js +1 -1
  11. package/dist/js/components/countdown.min.js +1 -1
  12. package/dist/js/components/filter.js +1 -1
  13. package/dist/js/components/filter.min.js +1 -1
  14. package/dist/js/components/lightbox-panel.js +1 -1
  15. package/dist/js/components/lightbox-panel.min.js +1 -1
  16. package/dist/js/components/lightbox.js +1 -1
  17. package/dist/js/components/lightbox.min.js +1 -1
  18. package/dist/js/components/notification.js +1 -1
  19. package/dist/js/components/notification.min.js +1 -1
  20. package/dist/js/components/parallax.js +6 -17
  21. package/dist/js/components/parallax.min.js +1 -1
  22. package/dist/js/components/slider-parallax.js +1 -1
  23. package/dist/js/components/slider-parallax.min.js +1 -1
  24. package/dist/js/components/slider.js +1 -1
  25. package/dist/js/components/slider.min.js +1 -1
  26. package/dist/js/components/slideshow-parallax.js +1 -1
  27. package/dist/js/components/slideshow-parallax.min.js +1 -1
  28. package/dist/js/components/slideshow.js +1 -1
  29. package/dist/js/components/slideshow.min.js +1 -1
  30. package/dist/js/components/sortable.js +1 -1
  31. package/dist/js/components/sortable.min.js +1 -1
  32. package/dist/js/components/tooltip.js +1 -1
  33. package/dist/js/components/tooltip.min.js +1 -1
  34. package/dist/js/components/upload.js +1 -1
  35. package/dist/js/components/upload.min.js +1 -1
  36. package/dist/js/uikit-core.js +68 -34
  37. package/dist/js/uikit-core.min.js +1 -1
  38. package/dist/js/uikit-icons.js +1 -1
  39. package/dist/js/uikit-icons.min.js +1 -1
  40. package/dist/js/uikit.js +73 -50
  41. package/dist/js/uikit.min.js +1 -1
  42. package/package.json +1 -1
  43. package/src/js/components/parallax.js +5 -16
  44. package/src/js/core/sticky.js +38 -19
  45. package/src/js/util/dimensions.js +28 -12
  46. package/tests/sticky-parallax.html +43 -40
  47. package/tests/sticky.html +45 -24
package/dist/js/uikit.js CHANGED
@@ -1,4 +1,4 @@
1
- /*! UIkit 3.11.2-dev.f2970ffaa | https://www.getuikit.com | (c) 2014 - 2022 YOOtheme | MIT License */
1
+ /*! UIkit 3.11.2-dev.fb043abc2 | 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() :
@@ -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
- ? element[("offset" + (ucfirst(property)))]
1762
- : dimensions$1(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
  }
@@ -3465,7 +3481,7 @@
3465
3481
  UIkit.data = '__uikit__';
3466
3482
  UIkit.prefix = 'uk-';
3467
3483
  UIkit.options = {};
3468
- UIkit.version = '3.11.2-dev.f2970ffaa';
3484
+ UIkit.version = '3.11.2-dev.fb043abc2';
3469
3485
 
3470
3486
  globalAPI(UIkit);
3471
3487
  hooksAPI(UIkit);
@@ -7690,6 +7706,7 @@
7690
7706
  mixins: [Class, Media],
7691
7707
 
7692
7708
  props: {
7709
+ position: String,
7693
7710
  top: null,
7694
7711
  bottom: Boolean,
7695
7712
  offset: String,
@@ -7705,6 +7722,7 @@
7705
7722
  },
7706
7723
 
7707
7724
  data: {
7725
+ position: 'top',
7708
7726
  top: 0,
7709
7727
  bottom: false,
7710
7728
  offset: 0,
@@ -7721,10 +7739,23 @@
7721
7739
 
7722
7740
  computed: {
7723
7741
 
7724
- 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) {
7725
7753
  var offset = ref.offset;
7726
7754
 
7727
- return toPx(offset);
7755
+ if (this.position === 'bottom') {
7756
+ offset += '+100vh-100%';
7757
+ }
7758
+ return toPx(offset, 'height', $el);
7728
7759
  },
7729
7760
 
7730
7761
  selTarget: function(ref, $el) {
@@ -7824,6 +7855,7 @@
7824
7855
 
7825
7856
  read: function(ref, types) {
7826
7857
  var height$1 = ref.height;
7858
+ var margin = ref.margin;
7827
7859
 
7828
7860
 
7829
7861
  this.inactive = !this.matchMedia || !isVisible(this.$el);
@@ -7832,13 +7864,19 @@
7832
7864
  return false;
7833
7865
  }
7834
7866
 
7835
- if (this.isActive && types.has('resize')) {
7867
+ var hide = this.isActive && types.has('resize');
7868
+ if (hide) {
7836
7869
  this.hide();
7870
+ }
7871
+
7872
+ if (!this.isActive) {
7837
7873
  height$1 = this.$el.offsetHeight;
7838
- this.show();
7874
+ margin = css(this.$el, 'margin');
7839
7875
  }
7840
7876
 
7841
- height$1 = this.isActive ? height$1 : this.$el.offsetHeight;
7877
+ if (hide) {
7878
+ this.show();
7879
+ }
7842
7880
 
7843
7881
  var overflow = Math.max(0, height$1 + this.offset - height(window));
7844
7882
 
@@ -7846,8 +7884,10 @@
7846
7884
  var topOffset = offset(referenceElement).top;
7847
7885
  var offsetParentTop = offset(referenceElement.offsetParent).top;
7848
7886
 
7849
- var bottom = parseProp('bottom', this);
7850
- var start = Math.max(toFloat(parseProp('top', this)), topOffset) - this.offset;
7887
+ var top = parseProp(this.top, this.$el, topOffset);
7888
+ var bottom = parseProp(this.bottom, this.$el, topOffset + height$1);
7889
+
7890
+ var start = Math.max(top, topOffset) - this.offset;
7851
7891
  var end = bottom
7852
7892
  ? bottom - this.$el.offsetHeight + overflow - this.offset
7853
7893
  : getScrollingElement(this.$el).scrollHeight - height(window);
@@ -7859,21 +7899,21 @@
7859
7899
  topOffset: topOffset,
7860
7900
  offsetParentTop: offsetParentTop,
7861
7901
  height: height$1,
7902
+ margin: margin,
7862
7903
  width: dimensions$1(isVisible(this.widthElement) ? this.widthElement : this.$el).width,
7863
- top: offsetPosition(this.placeholder)[0],
7864
- margins: css(this.$el, ['marginTop', 'marginBottom', 'marginLeft', 'marginRight'])
7904
+ top: offsetPosition(this.placeholder)[0]
7865
7905
  };
7866
7906
  },
7867
7907
 
7868
7908
  write: function(ref) {
7869
7909
  var height = ref.height;
7870
- var margins = ref.margins;
7910
+ var margin = ref.margin;
7871
7911
 
7872
7912
 
7873
7913
  var ref$1 = this;
7874
7914
  var placeholder = ref$1.placeholder;
7875
7915
 
7876
- css(placeholder, assign({height: height}, margins));
7916
+ css(placeholder, {height: height, margin: margin});
7877
7917
 
7878
7918
  if (!within(placeholder, document)) {
7879
7919
  after(this.$el, placeholder);
@@ -8024,7 +8064,7 @@
8024
8064
  var height = ref.height;
8025
8065
  var offsetParentTop = ref.offsetParentTop;
8026
8066
  var active = start !== 0 || scroll > start;
8027
- var top = Math.max(0, this.offset);
8067
+ var top = this.offset;
8028
8068
  var position = 'fixed';
8029
8069
 
8030
8070
  if (scroll > end) {
@@ -8052,16 +8092,10 @@
8052
8092
 
8053
8093
  };
8054
8094
 
8055
- function parseProp(prop, ref) {
8056
- var $props = ref.$props;
8057
- var $el = ref.$el;
8058
- var propOffset = ref[(prop + "Offset")];
8059
-
8060
-
8061
- var value = $props[prop];
8095
+ function parseProp(value, el, propOffset) {
8062
8096
 
8063
8097
  if (!value) {
8064
- return;
8098
+ return 0;
8065
8099
  }
8066
8100
 
8067
8101
  if (isString(value) && value.match(/^-?\d/)) {
@@ -8070,7 +8104,7 @@
8070
8104
 
8071
8105
  } else {
8072
8106
 
8073
- return offset(value === true ? parent($el) : query(value, $el)).bottom;
8107
+ return offset(value === true ? parent(el) : query(value, el)).bottom;
8074
8108
 
8075
8109
  }
8076
8110
  }
@@ -11082,16 +11116,18 @@
11082
11116
  start: function(ref) {
11083
11117
  var start = ref.start;
11084
11118
 
11085
- return parseCalc(start, this.target);
11119
+ return toPx(start, 'height', this.target, true);
11086
11120
  },
11087
11121
 
11088
11122
  end: function(ref) {
11089
11123
  var end = ref.end;
11090
11124
  var viewport = ref.viewport;
11091
11125
 
11092
- return parseCalc(
11126
+ return toPx(
11093
11127
  end || (viewport = (1 - viewport) * 100) && (viewport + "vh+" + viewport + "%"),
11094
- this.target
11128
+ 'height',
11129
+ this.target,
11130
+ true
11095
11131
  );
11096
11132
  }
11097
11133
 
@@ -11138,19 +11174,6 @@
11138
11174
 
11139
11175
  };
11140
11176
 
11141
- var calcRe = /-?\d+(?:\.\d+)?(?:v[wh]|%|px)?/g;
11142
- function parseCalc(calc, el) {
11143
- var match;
11144
- var result = 0;
11145
- calc = calc.toString().replace(/\s/g, '');
11146
- calcRe.lastIndex = 0;
11147
- while ((match = calcRe.exec(calc)) !== null) {
11148
- result += toPx(match[0], 'height', el, true);
11149
- }
11150
-
11151
- return result;
11152
- }
11153
-
11154
11177
  function ease(percent, easing) {
11155
11178
  return easing >= 0
11156
11179
  ? Math.pow(percent, easing + 1)