uikit 3.9.5-dev.605a9ce7d → 3.9.5-dev.ce77459c6

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 (60) hide show
  1. package/CHANGELOG.md +12 -1
  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 +51 -117
  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 +51 -117
  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 -96
  47. package/src/js/core/sticky.js +6 -1
  48. package/src/less/components/cover.less +1 -2
  49. package/src/less/components/link.less +6 -3
  50. package/src/less/components/search.less +22 -0
  51. package/src/less/components/utility.less +6 -0
  52. package/src/less/theme/search.less +6 -0
  53. package/src/scss/components/cover.scss +1 -2
  54. package/src/scss/components/link.scss +6 -3
  55. package/src/scss/components/search.scss +14 -0
  56. package/src/scss/components/utility.scss +6 -0
  57. package/src/scss/mixins-theme.scss +12 -0
  58. package/src/scss/mixins.scss +12 -0
  59. package/src/scss/theme/search.scss +6 -0
  60. package/tests/image.html +14 -40
package/dist/js/uikit.js CHANGED
@@ -1,4 +1,4 @@
1
- /*! UIkit 3.9.5-dev.605a9ce7d | https://www.getuikit.com | (c) 2014 - 2021 YOOtheme | MIT License */
1
+ /*! UIkit 3.9.5-dev.ce77459c6 | 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.5-dev.605a9ce7d';
3468
+ UIkit.version = '3.9.5-dev.ce77459c6';
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
  },
@@ -5785,17 +5786,17 @@
5785
5786
 
5786
5787
  var img = {
5787
5788
 
5789
+ args: 'dataSrc',
5790
+
5788
5791
  props: {
5789
- width: Number,
5790
- height: Number,
5792
+ dataSrc: String,
5791
5793
  offsetTop: String,
5792
5794
  offsetLeft: String,
5793
5795
  target: String
5794
5796
  },
5795
5797
 
5796
5798
  data: {
5797
- width: false,
5798
- height: false,
5799
+ dataSrc: '',
5799
5800
  offsetTop: '50vh',
5800
5801
  offsetLeft: '50vw',
5801
5802
  target: false
@@ -5803,24 +5804,6 @@
5803
5804
 
5804
5805
  computed: {
5805
5806
 
5806
- cacheKey: function() {
5807
- return ((this.$name) + "." + (data(this.$el, 'data-src')));
5808
- },
5809
-
5810
- width: function(ref) {
5811
- var width = ref.width;
5812
- var dataWidth = ref.dataWidth;
5813
-
5814
- return width || dataWidth;
5815
- },
5816
-
5817
- height: function(ref) {
5818
- var height = ref.height;
5819
- var dataHeight = ref.dataHeight;
5820
-
5821
- return height || dataHeight;
5822
- },
5823
-
5824
5807
  target: {
5825
5808
 
5826
5809
  get: function(ref) {
@@ -5833,18 +5816,6 @@
5833
5816
  this.observe();
5834
5817
  }
5835
5818
 
5836
- },
5837
-
5838
- offsetTop: function(ref) {
5839
- var offsetTop = ref.offsetTop;
5840
-
5841
- return toPx(offsetTop, 'height');
5842
- },
5843
-
5844
- offsetLeft: function(ref) {
5845
- var offsetLeft = ref.offsetLeft;
5846
-
5847
- return toPx(offsetLeft, 'width');
5848
5819
  }
5849
5820
 
5850
5821
  },
@@ -5852,21 +5823,13 @@
5852
5823
  connected: function() {
5853
5824
 
5854
5825
  if (!window.IntersectionObserver) {
5855
- setSrcAttrs(this.$el);
5826
+ setSrcAttrs(this.$el, this.dataSrc);
5856
5827
  return;
5857
5828
  }
5858
5829
 
5859
- 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));
5863
- }
5864
-
5865
- this.observer = new IntersectionObserver(this.load, {
5866
- rootMargin: ((this.offsetTop) + "px " + (this.offsetLeft) + "px")
5867
- });
5868
-
5869
- 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();
5870
5833
 
5871
5834
  },
5872
5835
 
@@ -5877,23 +5840,14 @@
5877
5840
  update: {
5878
5841
 
5879
5842
  read: function(ref) {
5880
- var this$1$1 = this;
5881
5843
  var image = ref.image;
5882
5844
 
5883
5845
 
5884
- if (!this.observer) {
5885
- return false;
5886
- }
5887
-
5888
- if (!image && document.readyState === 'complete') {
5889
- this.load(this.observer.takeRecords());
5890
- }
5891
-
5892
- if (isImg(this.$el)) {
5846
+ if (!this.observer || isImg(this.$el)) {
5893
5847
  return false;
5894
5848
  }
5895
5849
 
5896
- image && image.then(function (img) { return img && img.currentSrc !== '' && setSrcAttrs(this$1$1.$el, currentSrc(img)); });
5850
+ setSrcAttrs(this.$el, image && image.currentSrc);
5897
5851
 
5898
5852
  },
5899
5853
 
@@ -5919,21 +5873,19 @@
5919
5873
  methods: {
5920
5874
 
5921
5875
  load: function(entries) {
5922
- var this$1$1 = this;
5923
-
5924
5876
 
5925
5877
  // Old chromium based browsers (UC Browser) did not implement `isIntersecting`
5926
5878
  if (!entries.some(function (entry) { return isUndefined(entry.isIntersecting) || entry.isIntersecting; })) {
5927
5879
  return;
5928
5880
  }
5929
5881
 
5930
- this._data.image = getImageFromElement(this.$el).then(function (img) {
5931
-
5932
- setSrcAttrs(this$1$1.$el, currentSrc(img));
5933
- storage[this$1$1.cacheKey] = currentSrc(img);
5934
- return img;
5882
+ if (this._data.image) {
5883
+ return this._data.image;
5884
+ }
5935
5885
 
5936
- }, function (e) { return trigger(this$1$1.$el, new e.constructor(e.type, e)); });
5886
+ var image = isImg(this.$el) ? this.$el : getImageFromElement(this.$el, this.dataSrc);
5887
+ this._data.image = image;
5888
+ setSrcAttrs(this.$el, image.currentSrc);
5937
5889
 
5938
5890
  this.observer.disconnect();
5939
5891
  },
@@ -5950,18 +5902,13 @@
5950
5902
 
5951
5903
  };
5952
5904
 
5953
- var srcProps = ['data-src', 'data-srcset', 'sizes'];
5954
5905
  function setSrcAttrs(el, src) {
5955
5906
 
5956
- var parentNode = parent(el);
5957
5907
  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
- );
5908
+ var parentNode = parent(el);
5909
+ var elements = isPicture(parentNode) ? children(parentNode) : [el];
5910
+ elements.forEach(setSourceProps);
5911
+ src && attr(el, 'src', src);
5965
5912
  } else if (src) {
5966
5913
 
5967
5914
  var change = !includes(el.style.backgroundImage, src);
@@ -5974,15 +5921,26 @@
5974
5921
 
5975
5922
  }
5976
5923
 
5977
- function getPlaceholderImage(width, height, sizes) {
5978
- var assign;
5924
+ var srcProps = ['data-src', 'data-srcset', 'sizes'];
5925
+ function setSourceProps(sourceEl, targetEl) {
5926
+ srcProps.forEach(function (prop) {
5927
+ var value = data(sourceEl, prop);
5928
+ if (value) {
5929
+ attr(targetEl || sourceEl, prop.replace(/^(data-)+/, ''), value);
5930
+ }
5931
+ });
5932
+ }
5979
5933
 
5934
+ function getImageFromElement(el, src) {
5980
5935
 
5981
- if (sizes) {
5982
- ((assign = Dimensions.ratio({width: width, height: height}, 'width', toPx(sizesToPixel(sizes))), width = assign.width, height = assign.height));
5936
+ if (!src) {
5937
+ return false;
5983
5938
  }
5984
5939
 
5985
- return ("data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"" + width + "\" height=\"" + height + "\"></svg>");
5940
+ var img = new Image();
5941
+ setSourceProps(el, img);
5942
+ attr(img, 'src', src);
5943
+ return img;
5986
5944
  }
5987
5945
 
5988
5946
  var sizesRe = /\s*(.*?)\s*(\w+|calc\(.*?\))\s*(?:,|$)/g;
@@ -6001,19 +5959,6 @@
6001
5959
  return matches || '100vw';
6002
5960
  }
6003
5961
 
6004
- function getImageFromElement(el) {
6005
- var parentNode = parent(el);
6006
- if (!isPicture(parentNode)) {
6007
- return getImage.apply(void 0, srcProps.map(function (prop) { return data(el, prop); }));
6008
- }
6009
-
6010
- return new Promise(function (resolve, reject) {
6011
- var picture = parentNode.cloneNode(true);
6012
- once(picture, 'load error', function (e) { return e.type === 'error' ? reject(e) : resolve(e.target); }, true);
6013
- setSrcAttrs(el);
6014
- });
6015
- }
6016
-
6017
5962
  var sizeRe = /\d+(?:\w+|%)/g;
6018
5963
  var additionRe = /[+-]?(\d+)/g;
6019
5964
  function evaluateSize(size) {
@@ -6047,22 +5992,6 @@
6047
5992
  return el && el.tagName === tagName;
6048
5993
  }
6049
5994
 
6050
- function currentSrc(el) {
6051
- return el.currentSrc || el.src;
6052
- }
6053
-
6054
- var key = '__test__';
6055
- var storage;
6056
-
6057
- // workaround for Safari's private browsing mode and accessing sessionStorage in Blink
6058
- try {
6059
- storage = window.sessionStorage || {};
6060
- storage[key] = 1;
6061
- delete storage[key];
6062
- } catch (e) {
6063
- storage = {};
6064
- }
6065
-
6066
5995
  var Media = {
6067
5996
 
6068
5997
  props: {
@@ -7826,7 +7755,7 @@
7826
7755
  {
7827
7756
 
7828
7757
  read: function(ref, types) {
7829
- var height = ref.height;
7758
+ var height$1 = ref.height;
7830
7759
 
7831
7760
 
7832
7761
  this.inactive = !this.matchMedia || !isVisible(this.$el);
@@ -7837,15 +7766,20 @@
7837
7766
 
7838
7767
  if (this.isActive && types.has('resize')) {
7839
7768
  this.hide();
7840
- height = this.$el.offsetHeight;
7769
+ height$1 = this.$el.offsetHeight;
7841
7770
  this.show();
7842
7771
  }
7843
7772
 
7844
- height = !this.isActive ? this.$el.offsetHeight : height;
7773
+ height$1 = !this.isActive ? this.$el.offsetHeight : height$1;
7774
+
7775
+ if (height$1 + this.offset > height(window)) {
7776
+ this.inactive = true;
7777
+ return false;
7778
+ }
7845
7779
 
7846
7780
  var referenceElement = this.isFixed ? this.placeholder : this.$el;
7847
7781
  this.topOffset = offset(referenceElement).top;
7848
- this.bottomOffset = this.topOffset + height;
7782
+ this.bottomOffset = this.topOffset + height$1;
7849
7783
  this.offsetParentTop = offset(referenceElement.offsetParent).top;
7850
7784
 
7851
7785
  var bottom = parseProp('bottom', this);
@@ -7855,7 +7789,7 @@
7855
7789
  this.width = dimensions(isVisible(this.widthElement) ? this.widthElement : this.$el).width;
7856
7790
 
7857
7791
  return {
7858
- height: height,
7792
+ height: height$1,
7859
7793
  top: offsetPosition(this.placeholder)[0],
7860
7794
  margins: css(this.$el, ['marginTop', 'marginBottom', 'marginLeft', 'marginRight'])
7861
7795
  };