uikit 3.9.5-dev.1c5ab040d → 3.9.5-dev.3bc3deb62

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 (63) hide show
  1. package/CHANGELOG.md +12 -2
  2. package/README.md +4 -4
  3. package/dist/css/uikit-core-rtl.css +17 -6
  4. package/dist/css/uikit-core-rtl.min.css +1 -1
  5. package/dist/css/uikit-core.css +17 -6
  6. package/dist/css/uikit-core.min.css +1 -1
  7. package/dist/css/uikit-rtl.css +17 -6
  8. package/dist/css/uikit-rtl.min.css +1 -1
  9. package/dist/css/uikit.css +17 -6
  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 +1 -1
  22. package/dist/js/components/parallax.min.js +1 -1
  23. package/dist/js/components/slider-parallax.js +1 -1
  24. package/dist/js/components/slider-parallax.min.js +1 -1
  25. package/dist/js/components/slider.js +1 -1
  26. package/dist/js/components/slider.min.js +1 -1
  27. package/dist/js/components/slideshow-parallax.js +1 -1
  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 +1 -1
  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 +58 -64
  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 +58 -64
  42. package/dist/js/uikit.min.js +1 -1
  43. package/package.json +1 -1
  44. package/src/js/core/cover.js +1 -2
  45. package/src/js/core/drop.js +3 -2
  46. package/src/js/core/img.js +38 -53
  47. package/src/js/core/sticky.js +6 -1
  48. package/src/js/util/dom.js +2 -5
  49. package/src/less/components/cover.less +1 -2
  50. package/src/less/components/link.less +6 -3
  51. package/src/less/components/search.less +31 -6
  52. package/src/less/components/utility.less +6 -0
  53. package/src/less/theme/search.less +6 -0
  54. package/src/scss/components/cover.scss +1 -2
  55. package/src/scss/components/link.scss +6 -3
  56. package/src/scss/components/search.scss +23 -6
  57. package/src/scss/components/utility.scss +6 -0
  58. package/src/scss/mixins-theme.scss +12 -0
  59. package/src/scss/mixins.scss +12 -0
  60. package/src/scss/theme/search.scss +6 -0
  61. package/src/scss/variables-theme.scss +3 -0
  62. package/src/scss/variables.scss +3 -0
  63. package/tests/search.html +1 -1
package/dist/js/uikit.js CHANGED
@@ -1,4 +1,4 @@
1
- /*! UIkit 3.9.5-dev.1c5ab040d | https://www.getuikit.com | (c) 2014 - 2021 YOOtheme | MIT License */
1
+ /*! UIkit 3.9.5-dev.3bc3deb62 | https://www.getuikit.com | (c) 2014 - 2021 YOOtheme | MIT License */
2
2
 
3
3
  (function (global, factory) {
4
4
  typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
@@ -1104,10 +1104,7 @@
1104
1104
  return;
1105
1105
  }
1106
1106
 
1107
- var unbind = on(document, 'DOMContentLoaded', function () {
1108
- unbind();
1109
- fn();
1110
- });
1107
+ once(document, 'DOMContentLoaded', fn);
1111
1108
  }
1112
1109
 
1113
1110
  function empty(element) {
@@ -3465,7 +3462,7 @@
3465
3462
  UIkit.data = '__uikit__';
3466
3463
  UIkit.prefix = 'uk-';
3467
3464
  UIkit.options = {};
3468
- UIkit.version = '3.9.5-dev.1c5ab040d';
3465
+ UIkit.version = '3.9.5-dev.3bc3deb62';
3469
3466
 
3470
3467
  globalAPI(UIkit);
3471
3468
  hooksAPI(UIkit);
@@ -4105,7 +4102,7 @@
4105
4102
 
4106
4103
  var cover = {
4107
4104
 
4108
- mixins: [Class, Video],
4105
+ mixins: [Video],
4109
4106
 
4110
4107
  props: {
4111
4108
  width: Number,
@@ -4327,7 +4324,8 @@
4327
4324
  this.target = this.$create('toggle', query(this.toggle, this.$el), {
4328
4325
  target: this.$el,
4329
4326
  mode: this.mode
4330
- });
4327
+ }).$el;
4328
+ attr(this.target, 'aria-haspopup', true);
4331
4329
  }
4332
4330
 
4333
4331
  },
@@ -5785,7 +5783,12 @@
5785
5783
 
5786
5784
  var img = {
5787
5785
 
5786
+ args: 'dataSrc',
5787
+
5788
5788
  props: {
5789
+ dataSrc: String,
5790
+ dataSrcset: Boolean,
5791
+ sizes: String,
5789
5792
  width: Number,
5790
5793
  height: Number,
5791
5794
  offsetTop: String,
@@ -5794,6 +5797,9 @@
5794
5797
  },
5795
5798
 
5796
5799
  data: {
5800
+ dataSrc: '',
5801
+ dataSrcset: false,
5802
+ sizes: false,
5797
5803
  width: false,
5798
5804
  height: false,
5799
5805
  offsetTop: '50vh',
@@ -5803,8 +5809,10 @@
5803
5809
 
5804
5810
  computed: {
5805
5811
 
5806
- cacheKey: function() {
5807
- return ((this.$name) + "." + (data(this.$el, 'data-src')));
5812
+ cacheKey: function(ref) {
5813
+ var dataSrc = ref.dataSrc;
5814
+
5815
+ return ((this.$name) + "." + dataSrc);
5808
5816
  },
5809
5817
 
5810
5818
  width: function(ref) {
@@ -5821,6 +5829,17 @@
5821
5829
  return height || dataHeight;
5822
5830
  },
5823
5831
 
5832
+ sizes: function(ref) {
5833
+ var sizes = ref.sizes;
5834
+ var dataSizes = ref.dataSizes;
5835
+
5836
+ return sizes || dataSizes;
5837
+ },
5838
+
5839
+ isImg: function(_, $el) {
5840
+ return isImg($el);
5841
+ },
5842
+
5824
5843
  target: {
5825
5844
 
5826
5845
  get: function(ref) {
@@ -5852,14 +5871,14 @@
5852
5871
  connected: function() {
5853
5872
 
5854
5873
  if (!window.IntersectionObserver) {
5855
- setSrcAttrs(this.$el);
5874
+ setSrcAttrs(this.$el, this.dataSrc, this.dataSrcset, this.sizes);
5856
5875
  return;
5857
5876
  }
5858
5877
 
5859
5878
  if (storage[this.cacheKey]) {
5860
- setSrcAttrs(this.$el, storage[this.cacheKey]);
5861
- } else if (isImg(this.$el) && this.width && this.height) {
5862
- attr(this.$el, 'src', getPlaceholderImage(this.$el) || null);
5879
+ setSrcAttrs(this.$el, storage[this.cacheKey], this.dataSrcset, this.sizes);
5880
+ } else if (this.isImg && this.width && this.height) {
5881
+ setSrcAttrs(this.$el, getPlaceholderImage(this.width, this.height, this.sizes));
5863
5882
  }
5864
5883
 
5865
5884
  this.observer = new IntersectionObserver(this.load, {
@@ -5889,7 +5908,7 @@
5889
5908
  this.load(this.observer.takeRecords());
5890
5909
  }
5891
5910
 
5892
- if (isImg(this.$el)) {
5911
+ if (this.isImg) {
5893
5912
  return false;
5894
5913
  }
5895
5914
 
@@ -5897,15 +5916,14 @@
5897
5916
 
5898
5917
  },
5899
5918
 
5900
- write: function(store) {
5919
+ write: function(data) {
5901
5920
 
5902
- var srcset = data(this.$el, 'data-srcset');
5903
- if (srcset && window.devicePixelRatio !== 1) {
5921
+ if (this.dataSrcset && window.devicePixelRatio !== 1) {
5904
5922
 
5905
5923
  var bgSize = css(this.$el, 'backgroundSize');
5906
- if (bgSize.match(/^(auto\s?)+$/) || toFloat(bgSize) === store.bgSize) {
5907
- store.bgSize = getSourceSize(srcset, data(this.$el, 'sizes'));
5908
- css(this.$el, 'backgroundSize', ((store.bgSize) + "px"));
5924
+ if (bgSize.match(/^(auto\s?)+$/) || toFloat(bgSize) === data.bgSize) {
5925
+ data.bgSize = getSourceSize(this.dataSrcset, this.sizes);
5926
+ css(this.$el, 'backgroundSize', ((data.bgSize) + "px"));
5909
5927
  }
5910
5928
 
5911
5929
  }
@@ -5927,9 +5945,9 @@
5927
5945
  return;
5928
5946
  }
5929
5947
 
5930
- this._data.image = getImageFromElement(this.$el).then(function (img) {
5948
+ this._data.image = getImage(this.dataSrc, this.dataSrcset, this.sizes).then(function (img) {
5931
5949
 
5932
- setSrcAttrs(this$1$1.$el, currentSrc(img));
5950
+ setSrcAttrs(this$1$1.$el, currentSrc(img), img.srcset, img.sizes);
5933
5951
  storage[this$1$1.cacheKey] = currentSrc(img);
5934
5952
  return img;
5935
5953
 
@@ -5950,18 +5968,13 @@
5950
5968
 
5951
5969
  };
5952
5970
 
5953
- var srcProps = ['data-src', 'data-srcset', 'sizes'];
5954
- function setSrcAttrs(el, src) {
5971
+ function setSrcAttrs(el, src, srcset, sizes) {
5955
5972
 
5956
- var parentNode = parent(el);
5957
5973
  if (isImg(el)) {
5958
- (isPicture(parentNode) ? children(parentNode) : [el]).forEach(function (el) { return srcProps.forEach(function (prop) {
5959
- var value = data(el, prop);
5960
- if (value) {
5961
- attr(el, prop.replace(/^(data-)+/, ''), value);
5962
- }
5963
- }); }
5964
- );
5974
+ var set = function (prop, val) { return val && val !== el[prop] && (el[prop] = val); };
5975
+ set('sizes', sizes);
5976
+ set('srcset', srcset);
5977
+ set('src', src);
5965
5978
  } else if (src) {
5966
5979
 
5967
5980
  var change = !includes(el.style.backgroundImage, src);
@@ -5974,12 +5987,9 @@
5974
5987
 
5975
5988
  }
5976
5989
 
5977
- function getPlaceholderImage(el) {
5990
+ function getPlaceholderImage(width, height, sizes) {
5978
5991
  var assign;
5979
5992
 
5980
- var sizes = data(el, 'sizes');
5981
- var width = data(el, 'width');
5982
- var height = data(el, 'height');
5983
5993
 
5984
5994
  if (sizes) {
5985
5995
  ((assign = Dimensions.ratio({width: width, height: height}, 'width', toPx(sizesToPixel(sizes))), width = assign.width, height = assign.height));
@@ -6004,19 +6014,6 @@
6004
6014
  return matches || '100vw';
6005
6015
  }
6006
6016
 
6007
- function getImageFromElement(el) {
6008
- var parentNode = parent(el);
6009
- if (!isPicture(parentNode)) {
6010
- return getImage.apply(void 0, srcProps.map(function (prop) { return data(el, prop); }));
6011
- }
6012
-
6013
- return new Promise(function (resolve, reject) {
6014
- var picture = parentNode.cloneNode(true);
6015
- once(picture, 'load error', function (e) { return e.type === 'error' ? reject(e) : resolve(e.target); }, true);
6016
- setSrcAttrs(el);
6017
- });
6018
- }
6019
-
6020
6017
  var sizeRe = /\d+(?:\w+|%)/g;
6021
6018
  var additionRe = /[+-]?(\d+)/g;
6022
6019
  function evaluateSize(size) {
@@ -6038,16 +6035,8 @@
6038
6035
  return descriptors.filter(function (size) { return size >= srcSize; })[0] || descriptors.pop() || '';
6039
6036
  }
6040
6037
 
6041
- function isPicture(el) {
6042
- return isA(el, 'PICTURE');
6043
- }
6044
-
6045
6038
  function isImg(el) {
6046
- return isA(el, 'IMG');
6047
- }
6048
-
6049
- function isA(el, tagName) {
6050
- return el && el.tagName === tagName;
6039
+ return el.tagName === 'IMG';
6051
6040
  }
6052
6041
 
6053
6042
  function currentSrc(el) {
@@ -7829,7 +7818,7 @@
7829
7818
  {
7830
7819
 
7831
7820
  read: function(ref, types) {
7832
- var height = ref.height;
7821
+ var height$1 = ref.height;
7833
7822
 
7834
7823
 
7835
7824
  this.inactive = !this.matchMedia || !isVisible(this.$el);
@@ -7840,15 +7829,20 @@
7840
7829
 
7841
7830
  if (this.isActive && types.has('resize')) {
7842
7831
  this.hide();
7843
- height = this.$el.offsetHeight;
7832
+ height$1 = this.$el.offsetHeight;
7844
7833
  this.show();
7845
7834
  }
7846
7835
 
7847
- height = !this.isActive ? this.$el.offsetHeight : height;
7836
+ height$1 = !this.isActive ? this.$el.offsetHeight : height$1;
7837
+
7838
+ if (height$1 + this.offset > height(window)) {
7839
+ this.inactive = true;
7840
+ return false;
7841
+ }
7848
7842
 
7849
7843
  var referenceElement = this.isFixed ? this.placeholder : this.$el;
7850
7844
  this.topOffset = offset(referenceElement).top;
7851
- this.bottomOffset = this.topOffset + height;
7845
+ this.bottomOffset = this.topOffset + height$1;
7852
7846
  this.offsetParentTop = offset(referenceElement.offsetParent).top;
7853
7847
 
7854
7848
  var bottom = parseProp('bottom', this);
@@ -7858,7 +7852,7 @@
7858
7852
  this.width = dimensions(isVisible(this.widthElement) ? this.widthElement : this.$el).width;
7859
7853
 
7860
7854
  return {
7861
- height: height,
7855
+ height: height$1,
7862
7856
  top: offsetPosition(this.placeholder)[0],
7863
7857
  margins: css(this.$el, ['marginTop', 'marginBottom', 'marginLeft', 'marginRight'])
7864
7858
  };