uikit 3.9.3 → 3.9.5-dev.600ee2ba9

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 +13 -0
  2. package/build/build.js +4 -1
  3. package/build/util.js +4 -1
  4. package/dist/css/uikit-core-rtl.css +1 -1
  5. package/dist/css/uikit-core-rtl.min.css +1 -1
  6. package/dist/css/uikit-core.css +1 -1
  7. package/dist/css/uikit-core.min.css +1 -1
  8. package/dist/css/uikit-rtl.css +1 -1
  9. package/dist/css/uikit-rtl.min.css +1 -1
  10. package/dist/css/uikit.css +1 -1
  11. package/dist/css/uikit.min.css +1 -1
  12. package/dist/js/components/countdown.js +1 -1
  13. package/dist/js/components/countdown.min.js +1 -1
  14. package/dist/js/components/filter.js +1 -1
  15. package/dist/js/components/filter.min.js +1 -1
  16. package/dist/js/components/lightbox-panel.js +1 -1
  17. package/dist/js/components/lightbox-panel.min.js +1 -1
  18. package/dist/js/components/lightbox.js +1 -1
  19. package/dist/js/components/lightbox.min.js +1 -1
  20. package/dist/js/components/notification.js +1 -1
  21. package/dist/js/components/notification.min.js +1 -1
  22. package/dist/js/components/parallax.js +1 -1
  23. package/dist/js/components/parallax.min.js +1 -1
  24. package/dist/js/components/slider-parallax.js +1 -1
  25. package/dist/js/components/slider-parallax.min.js +1 -1
  26. package/dist/js/components/slider.js +1 -1
  27. package/dist/js/components/slider.min.js +1 -1
  28. package/dist/js/components/slideshow-parallax.js +1 -1
  29. package/dist/js/components/slideshow-parallax.min.js +1 -1
  30. package/dist/js/components/slideshow.js +1 -1
  31. package/dist/js/components/slideshow.min.js +1 -1
  32. package/dist/js/components/sortable.js +1 -1
  33. package/dist/js/components/sortable.min.js +1 -1
  34. package/dist/js/components/tooltip.js +1 -1
  35. package/dist/js/components/tooltip.min.js +1 -1
  36. package/dist/js/components/upload.js +1 -1
  37. package/dist/js/components/upload.min.js +1 -1
  38. package/dist/js/uikit-core.js +62 -53
  39. package/dist/js/uikit-core.min.js +1 -1
  40. package/dist/js/uikit-icons.js +1 -1
  41. package/dist/js/uikit-icons.min.js +1 -1
  42. package/dist/js/uikit.js +62 -53
  43. package/dist/js/uikit.min.js +1 -1
  44. package/package.json +2 -2
  45. package/src/js/core/drop.js +3 -2
  46. package/src/js/core/img.js +57 -40
  47. package/src/js/core/sticky.js +3 -2
package/dist/js/uikit.js CHANGED
@@ -1,4 +1,4 @@
1
- /*! UIkit 3.9.3 | https://www.getuikit.com | (c) 2014 - 2021 YOOtheme | MIT License */
1
+ /*! UIkit 3.9.5-dev.600ee2ba9 | 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() :
@@ -3465,7 +3465,7 @@
3465
3465
  UIkit.data = '__uikit__';
3466
3466
  UIkit.prefix = 'uk-';
3467
3467
  UIkit.options = {};
3468
- UIkit.version = '3.9.3';
3468
+ UIkit.version = '3.9.5-dev.600ee2ba9';
3469
3469
 
3470
3470
  globalAPI(UIkit);
3471
3471
  hooksAPI(UIkit);
@@ -4327,7 +4327,8 @@
4327
4327
  this.target = this.$create('toggle', query(this.toggle, this.$el), {
4328
4328
  target: this.$el,
4329
4329
  mode: this.mode
4330
- });
4330
+ }).$el;
4331
+ attr(this.target, 'aria-haspopup', true);
4331
4332
  }
4332
4333
 
4333
4334
  },
@@ -5789,8 +5790,6 @@
5789
5790
 
5790
5791
  props: {
5791
5792
  dataSrc: String,
5792
- dataSrcset: Boolean,
5793
- sizes: String,
5794
5793
  width: Number,
5795
5794
  height: Number,
5796
5795
  offsetTop: String,
@@ -5800,8 +5799,6 @@
5800
5799
 
5801
5800
  data: {
5802
5801
  dataSrc: '',
5803
- dataSrcset: false,
5804
- sizes: false,
5805
5802
  width: false,
5806
5803
  height: false,
5807
5804
  offsetTop: '50vh',
@@ -5817,31 +5814,6 @@
5817
5814
  return ((this.$name) + "." + dataSrc);
5818
5815
  },
5819
5816
 
5820
- width: function(ref) {
5821
- var width = ref.width;
5822
- var dataWidth = ref.dataWidth;
5823
-
5824
- return width || dataWidth;
5825
- },
5826
-
5827
- height: function(ref) {
5828
- var height = ref.height;
5829
- var dataHeight = ref.dataHeight;
5830
-
5831
- return height || dataHeight;
5832
- },
5833
-
5834
- sizes: function(ref) {
5835
- var sizes = ref.sizes;
5836
- var dataSizes = ref.dataSizes;
5837
-
5838
- return sizes || dataSizes;
5839
- },
5840
-
5841
- isImg: function(_, $el) {
5842
- return isImg($el);
5843
- },
5844
-
5845
5817
  target: {
5846
5818
 
5847
5819
  get: function(ref) {
@@ -5873,14 +5845,14 @@
5873
5845
  connected: function() {
5874
5846
 
5875
5847
  if (!window.IntersectionObserver) {
5876
- setSrcAttrs(this.$el, this.dataSrc, this.dataSrcset, this.sizes);
5848
+ setSrcAttrs(this.$el);
5877
5849
  return;
5878
5850
  }
5879
5851
 
5880
5852
  if (storage[this.cacheKey]) {
5881
- setSrcAttrs(this.$el, storage[this.cacheKey], this.dataSrcset, this.sizes);
5882
- } else if (this.isImg && this.width && this.height) {
5883
- setSrcAttrs(this.$el, getPlaceholderImage(this.width, this.height, this.sizes));
5853
+ setSrcAttrs(this.$el, storage[this.cacheKey]);
5854
+ } else if (isImg(this.$el) && this.width && this.height) {
5855
+ attr(this.$el, 'src', getPlaceholderImage(this.$el));
5884
5856
  }
5885
5857
 
5886
5858
  this.observer = new IntersectionObserver(this.load, {
@@ -5910,7 +5882,7 @@
5910
5882
  this.load(this.observer.takeRecords());
5911
5883
  }
5912
5884
 
5913
- if (this.isImg) {
5885
+ if (isImg(this.$el)) {
5914
5886
  return false;
5915
5887
  }
5916
5888
 
@@ -5918,14 +5890,15 @@
5918
5890
 
5919
5891
  },
5920
5892
 
5921
- write: function(data) {
5893
+ write: function(store) {
5922
5894
 
5923
- if (this.dataSrcset && window.devicePixelRatio !== 1) {
5895
+ var srcset = data(this.$el, 'data-srcset');
5896
+ if (srcset && window.devicePixelRatio !== 1) {
5924
5897
 
5925
5898
  var bgSize = css(this.$el, 'backgroundSize');
5926
- if (bgSize.match(/^(auto\s?)+$/) || toFloat(bgSize) === data.bgSize) {
5927
- data.bgSize = getSourceSize(this.dataSrcset, this.sizes);
5928
- css(this.$el, 'backgroundSize', ((data.bgSize) + "px"));
5899
+ if (bgSize.match(/^(auto\s?)+$/) || toFloat(bgSize) === store.bgSize) {
5900
+ store.bgSize = getSourceSize(srcset, data(this.$el, 'sizes'));
5901
+ css(this.$el, 'backgroundSize', ((store.bgSize) + "px"));
5929
5902
  }
5930
5903
 
5931
5904
  }
@@ -5947,9 +5920,9 @@
5947
5920
  return;
5948
5921
  }
5949
5922
 
5950
- this._data.image = getImage(this.dataSrc, this.dataSrcset, this.sizes).then(function (img) {
5923
+ this._data.image = getImageFromElement(this.$el, this.dataSrc).then(function (img) {
5951
5924
 
5952
- setSrcAttrs(this$1$1.$el, currentSrc(img), img.srcset, img.sizes);
5925
+ setSrcAttrs(this$1$1.$el, currentSrc(img));
5953
5926
  storage[this$1$1.cacheKey] = currentSrc(img);
5954
5927
  return img;
5955
5928
 
@@ -5970,13 +5943,19 @@
5970
5943
 
5971
5944
  };
5972
5945
 
5973
- function setSrcAttrs(el, src, srcset, sizes) {
5946
+ var srcProps = ['data-src', 'data-srcset', 'sizes'];
5947
+ function setSrcAttrs(el, src) {
5974
5948
 
5949
+ var parentNode = parent(el);
5975
5950
  if (isImg(el)) {
5976
- var set = function (prop, val) { return val && val !== el[prop] && (el[prop] = val); };
5977
- set('sizes', sizes);
5978
- set('srcset', srcset);
5979
- set('src', src);
5951
+ (isPicture(parentNode) ? children(parentNode) : [el]).forEach(function (el) { return srcProps.forEach(function (prop) {
5952
+ var value = data(el, prop);
5953
+ if (value) {
5954
+ attr(el, prop.replace(/^(data-)+/, ''), value);
5955
+ }
5956
+ }); }
5957
+ );
5958
+ attr(el, 'src', src);
5980
5959
  } else if (src) {
5981
5960
 
5982
5961
  var change = !includes(el.style.backgroundImage, src);
@@ -5989,9 +5968,12 @@
5989
5968
 
5990
5969
  }
5991
5970
 
5992
- function getPlaceholderImage(width, height, sizes) {
5971
+ function getPlaceholderImage(el) {
5993
5972
  var assign;
5994
5973
 
5974
+ var sizes = data(el, 'sizes');
5975
+ var width = data(el, 'width');
5976
+ var height = data(el, 'height');
5995
5977
 
5996
5978
  if (sizes) {
5997
5979
  ((assign = Dimensions.ratio({width: width, height: height}, 'width', toPx(sizesToPixel(sizes))), width = assign.width, height = assign.height));
@@ -6016,6 +5998,24 @@
6016
5998
  return matches || '100vw';
6017
5999
  }
6018
6000
 
6001
+ function getImageFromElement(el, src) {
6002
+ var parentNode = parent(el);
6003
+
6004
+ if (!src) {
6005
+ return Promise.reject(createEvent('error', false));
6006
+ }
6007
+
6008
+ if (!isPicture(parentNode)) {
6009
+ return getImage.apply(void 0, [ src ].concat( srcProps.slice(1).map(function (prop) { return data(el, prop); }) ));
6010
+ }
6011
+
6012
+ return new Promise(function (resolve, reject) {
6013
+ var picture = parentNode.cloneNode(true);
6014
+ once(picture, 'load error', function (e) { return e.type === 'error' ? reject(e) : resolve(e.target); }, true);
6015
+ setSrcAttrs(el);
6016
+ });
6017
+ }
6018
+
6019
6019
  var sizeRe = /\d+(?:\w+|%)/g;
6020
6020
  var additionRe = /[+-]?(\d+)/g;
6021
6021
  function evaluateSize(size) {
@@ -6037,8 +6037,16 @@
6037
6037
  return descriptors.filter(function (size) { return size >= srcSize; })[0] || descriptors.pop() || '';
6038
6038
  }
6039
6039
 
6040
+ function isPicture(el) {
6041
+ return isA(el, 'PICTURE');
6042
+ }
6043
+
6040
6044
  function isImg(el) {
6041
- return el.tagName === 'IMG';
6045
+ return isA(el, 'IMG');
6046
+ }
6047
+
6048
+ function isA(el, tagName) {
6049
+ return el && el.tagName === tagName;
6042
6050
  }
6043
6051
 
6044
6052
  function currentSrc(el) {
@@ -7837,9 +7845,10 @@
7837
7845
 
7838
7846
  height = !this.isActive ? this.$el.offsetHeight : height;
7839
7847
 
7840
- this.topOffset = offset(this.isFixed ? this.placeholder : this.$el).top;
7848
+ var referenceElement = this.isFixed ? this.placeholder : this.$el;
7849
+ this.topOffset = offset(referenceElement).top;
7841
7850
  this.bottomOffset = this.topOffset + height;
7842
- this.offsetParentTop = offset(this.$el.offsetParent).top;
7851
+ this.offsetParentTop = offset(referenceElement.offsetParent).top;
7843
7852
 
7844
7853
  var bottom = parseProp('bottom', this);
7845
7854