uikit 3.9.4 → 3.9.5-dev.4839a0a03

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 (61) hide show
  1. package/CHANGELOG.md +18 -1
  2. package/README.md +4 -4
  3. package/build/util.js +4 -1
  4. package/dist/css/uikit-core-rtl.css +17 -6
  5. package/dist/css/uikit-core-rtl.min.css +1 -1
  6. package/dist/css/uikit-core.css +17 -6
  7. package/dist/css/uikit-core.min.css +1 -1
  8. package/dist/css/uikit-rtl.css +17 -6
  9. package/dist/css/uikit-rtl.min.css +1 -1
  10. package/dist/css/uikit.css +17 -6
  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 +64 -115
  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 +64 -115
  43. package/dist/js/uikit.min.js +1 -1
  44. package/package.json +1 -1
  45. package/src/js/core/cover.js +1 -2
  46. package/src/js/core/drop.js +3 -2
  47. package/src/js/core/img.js +51 -88
  48. package/src/js/core/sticky.js +6 -1
  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 +22 -0
  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 +14 -0
  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/tests/image.html +14 -40
package/dist/js/uikit.js CHANGED
@@ -1,4 +1,4 @@
1
- /*! UIkit 3.9.4 | https://www.getuikit.com | (c) 2014 - 2021 YOOtheme | MIT License */
1
+ /*! UIkit 3.9.5-dev.4839a0a03 | 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.4';
3468
+ UIkit.version = '3.9.5-dev.4839a0a03';
3469
3469
 
3470
3470
  globalAPI(UIkit);
3471
3471
  hooksAPI(UIkit);
@@ -4105,7 +4105,7 @@
4105
4105
 
4106
4106
  var cover = {
4107
4107
 
4108
- mixins: [Class, Video],
4108
+ mixins: [Video],
4109
4109
 
4110
4110
  props: {
4111
4111
  width: Number,
@@ -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,10 +5790,6 @@
5789
5790
 
5790
5791
  props: {
5791
5792
  dataSrc: String,
5792
- dataSrcset: Boolean,
5793
- sizes: String,
5794
- width: Number,
5795
- height: Number,
5796
5793
  offsetTop: String,
5797
5794
  offsetLeft: String,
5798
5795
  target: String
@@ -5800,10 +5797,6 @@
5800
5797
 
5801
5798
  data: {
5802
5799
  dataSrc: '',
5803
- dataSrcset: false,
5804
- sizes: false,
5805
- width: false,
5806
- height: false,
5807
5800
  offsetTop: '50vh',
5808
5801
  offsetLeft: '50vw',
5809
5802
  target: false
@@ -5811,37 +5804,6 @@
5811
5804
 
5812
5805
  computed: {
5813
5806
 
5814
- cacheKey: function(ref) {
5815
- var dataSrc = ref.dataSrc;
5816
-
5817
- return ((this.$name) + "." + dataSrc);
5818
- },
5819
-
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
5807
  target: {
5846
5808
 
5847
5809
  get: function(ref) {
@@ -5854,18 +5816,6 @@
5854
5816
  this.observe();
5855
5817
  }
5856
5818
 
5857
- },
5858
-
5859
- offsetTop: function(ref) {
5860
- var offsetTop = ref.offsetTop;
5861
-
5862
- return toPx(offsetTop, 'height');
5863
- },
5864
-
5865
- offsetLeft: function(ref) {
5866
- var offsetLeft = ref.offsetLeft;
5867
-
5868
- return toPx(offsetLeft, 'width');
5869
5819
  }
5870
5820
 
5871
5821
  },
@@ -5873,21 +5823,13 @@
5873
5823
  connected: function() {
5874
5824
 
5875
5825
  if (!window.IntersectionObserver) {
5876
- setSrcAttrs(this.$el, this.dataSrc, this.dataSrcset, this.sizes);
5826
+ setSrcAttrs(this.$el, this.dataSrc);
5877
5827
  return;
5878
5828
  }
5879
5829
 
5880
- 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));
5884
- }
5885
-
5886
- this.observer = new IntersectionObserver(this.load, {
5887
- rootMargin: ((this.offsetTop) + "px " + (this.offsetLeft) + "px")
5888
- });
5889
-
5890
- requestAnimationFrame(this.observe);
5830
+ var rootMargin = (toPx(this.offsetTop, 'height')) + "px " + (toPx(this.offsetLeft, 'width')) + "px";
5831
+ this.observer = new IntersectionObserver(this.load, {rootMargin: rootMargin});
5832
+ this.observe();
5891
5833
 
5892
5834
  },
5893
5835
 
@@ -5898,7 +5840,6 @@
5898
5840
  update: {
5899
5841
 
5900
5842
  read: function(ref) {
5901
- var this$1$1 = this;
5902
5843
  var image = ref.image;
5903
5844
 
5904
5845
 
@@ -5906,26 +5847,25 @@
5906
5847
  return false;
5907
5848
  }
5908
5849
 
5909
- if (!image && document.readyState === 'complete') {
5910
- this.load(this.observer.takeRecords());
5911
- }
5912
-
5913
- if (this.isImg) {
5850
+ if (isImg(this.$el)) {
5914
5851
  return false;
5915
5852
  }
5916
5853
 
5917
- image && image.then(function (img) { return img && img.currentSrc !== '' && setSrcAttrs(this$1$1.$el, currentSrc(img)); });
5854
+ if (image && image.currentSrc !== '') {
5855
+ setSrcAttrs(this.$el, currentSrc(image));
5856
+ }
5918
5857
 
5919
5858
  },
5920
5859
 
5921
- write: function(data) {
5860
+ write: function(store) {
5922
5861
 
5923
- if (this.dataSrcset && window.devicePixelRatio !== 1) {
5862
+ var srcset = data(this.$el, 'data-srcset');
5863
+ if (srcset && window.devicePixelRatio !== 1) {
5924
5864
 
5925
5865
  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"));
5866
+ if (bgSize.match(/^(auto\s?)+$/) || toFloat(bgSize) === store.bgSize) {
5867
+ store.bgSize = getSourceSize(srcset, data(this.$el, 'sizes'));
5868
+ css(this.$el, 'backgroundSize', ((store.bgSize) + "px"));
5929
5869
  }
5930
5870
 
5931
5871
  }
@@ -5939,21 +5879,18 @@
5939
5879
  methods: {
5940
5880
 
5941
5881
  load: function(entries) {
5942
- var this$1$1 = this;
5943
-
5944
5882
 
5945
5883
  // Old chromium based browsers (UC Browser) did not implement `isIntersecting`
5946
5884
  if (!entries.some(function (entry) { return isUndefined(entry.isIntersecting) || entry.isIntersecting; })) {
5947
5885
  return;
5948
5886
  }
5949
5887
 
5950
- this._data.image = getImage(this.dataSrc, this.dataSrcset, this.sizes).then(function (img) {
5951
-
5952
- setSrcAttrs(this$1$1.$el, currentSrc(img), img.srcset, img.sizes);
5953
- storage[this$1$1.cacheKey] = currentSrc(img);
5954
- return img;
5888
+ if (this._data.image) {
5889
+ return this._data.image;
5890
+ }
5955
5891
 
5956
- }, function (e) { return trigger(this$1$1.$el, new e.constructor(e.type, e)); });
5892
+ this._data.image = isImg(this.$el) ? this.$el : getImageFromElement(this.$el, this.dataSrc);
5893
+ setSrcAttrs(this.$el, currentSrc(this._data.image));
5957
5894
 
5958
5895
  this.observer.disconnect();
5959
5896
  },
@@ -5970,13 +5907,13 @@
5970
5907
 
5971
5908
  };
5972
5909
 
5973
- function setSrcAttrs(el, src, srcset, sizes) {
5910
+ function setSrcAttrs(el, src) {
5974
5911
 
5975
5912
  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);
5913
+ var parentNode = parent(el);
5914
+ var elements = isPicture(parentNode) ? children(parentNode) : [el];
5915
+ elements.forEach(setSourceProps);
5916
+ src && attr(el, 'src', src);
5980
5917
  } else if (src) {
5981
5918
 
5982
5919
  var change = !includes(el.style.backgroundImage, src);
@@ -5989,15 +5926,26 @@
5989
5926
 
5990
5927
  }
5991
5928
 
5992
- function getPlaceholderImage(width, height, sizes) {
5993
- var assign;
5929
+ var srcProps = ['data-src', 'data-srcset', 'sizes'];
5930
+ function setSourceProps(sourceEl, targetEl) {
5931
+ srcProps.forEach(function (prop) {
5932
+ var value = data(sourceEl, prop);
5933
+ if (value) {
5934
+ attr(targetEl || sourceEl, prop.replace(/^(data-)+/, ''), value);
5935
+ }
5936
+ });
5937
+ }
5994
5938
 
5939
+ function getImageFromElement(el, src) {
5995
5940
 
5996
- if (sizes) {
5997
- ((assign = Dimensions.ratio({width: width, height: height}, 'width', toPx(sizesToPixel(sizes))), width = assign.width, height = assign.height));
5941
+ if (!src) {
5942
+ return false;
5998
5943
  }
5999
5944
 
6000
- return ("data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"" + width + "\" height=\"" + height + "\"></svg>");
5945
+ var img = new Image();
5946
+ setSourceProps(el, img);
5947
+ attr(img, 'src', src);
5948
+ return img;
6001
5949
  }
6002
5950
 
6003
5951
  var sizesRe = /\s*(.*?)\s*(\w+|calc\(.*?\))\s*(?:,|$)/g;
@@ -6037,24 +5985,20 @@
6037
5985
  return descriptors.filter(function (size) { return size >= srcSize; })[0] || descriptors.pop() || '';
6038
5986
  }
6039
5987
 
6040
- function isImg(el) {
6041
- return el.tagName === 'IMG';
5988
+ function isPicture(el) {
5989
+ return isA(el, 'PICTURE');
6042
5990
  }
6043
5991
 
6044
- function currentSrc(el) {
6045
- return el.currentSrc || el.src;
5992
+ function isImg(el) {
5993
+ return isA(el, 'IMG');
6046
5994
  }
6047
5995
 
6048
- var key = '__test__';
6049
- var storage;
5996
+ function isA(el, tagName) {
5997
+ return el && el.tagName === tagName;
5998
+ }
6050
5999
 
6051
- // workaround for Safari's private browsing mode and accessing sessionStorage in Blink
6052
- try {
6053
- storage = window.sessionStorage || {};
6054
- storage[key] = 1;
6055
- delete storage[key];
6056
- } catch (e) {
6057
- storage = {};
6000
+ function currentSrc(el) {
6001
+ return el.currentSrc || el.src;
6058
6002
  }
6059
6003
 
6060
6004
  var Media = {
@@ -7820,7 +7764,7 @@
7820
7764
  {
7821
7765
 
7822
7766
  read: function(ref, types) {
7823
- var height = ref.height;
7767
+ var height$1 = ref.height;
7824
7768
 
7825
7769
 
7826
7770
  this.inactive = !this.matchMedia || !isVisible(this.$el);
@@ -7831,15 +7775,20 @@
7831
7775
 
7832
7776
  if (this.isActive && types.has('resize')) {
7833
7777
  this.hide();
7834
- height = this.$el.offsetHeight;
7778
+ height$1 = this.$el.offsetHeight;
7835
7779
  this.show();
7836
7780
  }
7837
7781
 
7838
- height = !this.isActive ? this.$el.offsetHeight : height;
7782
+ height$1 = !this.isActive ? this.$el.offsetHeight : height$1;
7783
+
7784
+ if (height$1 + this.offset > height(window)) {
7785
+ this.inactive = true;
7786
+ return false;
7787
+ }
7839
7788
 
7840
7789
  var referenceElement = this.isFixed ? this.placeholder : this.$el;
7841
7790
  this.topOffset = offset(referenceElement).top;
7842
- this.bottomOffset = this.topOffset + height;
7791
+ this.bottomOffset = this.topOffset + height$1;
7843
7792
  this.offsetParentTop = offset(referenceElement.offsetParent).top;
7844
7793
 
7845
7794
  var bottom = parseProp('bottom', this);
@@ -7849,7 +7798,7 @@
7849
7798
  this.width = dimensions(isVisible(this.widthElement) ? this.widthElement : this.$el).width;
7850
7799
 
7851
7800
  return {
7852
- height: height,
7801
+ height: height$1,
7853
7802
  top: offsetPosition(this.placeholder)[0],
7854
7803
  margins: css(this.$el, ['marginTop', 'marginBottom', 'marginLeft', 'marginRight'])
7855
7804
  };