uikit 3.9.5-dev.13c625552 → 3.9.5-dev.4be822584

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 +13 -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 +53 -120
  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 +53 -120
  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 +40 -99
  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 +31 -6
  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 +23 -6
  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/src/scss/variables-theme.scss +3 -0
  61. package/src/scss/variables.scss +3 -0
  62. package/tests/image.html +14 -40
  63. package/tests/search.html +1 -1
package/dist/js/uikit.js CHANGED
@@ -1,4 +1,4 @@
1
- /*! UIkit 3.9.5-dev.13c625552 | https://www.getuikit.com | (c) 2014 - 2021 YOOtheme | MIT License */
1
+ /*! UIkit 3.9.5-dev.4be822584 | 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.13c625552';
3468
+ UIkit.version = '3.9.5-dev.4be822584';
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) {
5846
+ if (!this.observer || isImg(this.$el)) {
5885
5847
  return false;
5886
5848
  }
5887
5849
 
5888
- if (!image && document.readyState === 'complete') {
5889
- this.load(this.observer.takeRecords());
5890
- }
5891
-
5892
- if (isImg(this.$el)) {
5893
- return false;
5894
- }
5895
-
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 || this.dataSrc);
5937
5889
 
5938
5890
  this.observer.disconnect();
5939
5891
  },
@@ -5950,18 +5902,15 @@
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
+
5909
+ var parentNode = parent(el);
5910
+ var elements = isPicture(parentNode) ? children(parentNode) : [el];
5911
+ elements.forEach(function (el) { return setSourceProps(el, el); });
5912
+ src && attr(el, 'src', src);
5913
+
5965
5914
  } else if (src) {
5966
5915
 
5967
5916
  var change = !includes(el.style.backgroundImage, src);
@@ -5974,18 +5923,26 @@
5974
5923
 
5975
5924
  }
5976
5925
 
5977
- function getPlaceholderImage(el) {
5978
- var assign;
5926
+ var srcProps = ['data-src', 'data-srcset', 'sizes'];
5927
+ function setSourceProps(sourceEl, targetEl) {
5928
+ srcProps.forEach(function (prop) {
5929
+ var value = data(sourceEl, prop);
5930
+ if (value) {
5931
+ attr(targetEl, prop.replace(/^(data-)+/, ''), value);
5932
+ }
5933
+ });
5934
+ }
5979
5935
 
5980
- var sizes = data(el, 'sizes');
5981
- var width = data(el, 'width');
5982
- var height = data(el, 'height');
5936
+ function getImageFromElement(el, src) {
5983
5937
 
5984
- if (sizes) {
5985
- ((assign = Dimensions.ratio({width: width, height: height}, 'width', toPx(sizesToPixel(sizes))), width = assign.width, height = assign.height));
5938
+ if (!src) {
5939
+ return false;
5986
5940
  }
5987
5941
 
5988
- return ("data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"" + width + "\" height=\"" + height + "\"></svg>");
5942
+ var img = new Image();
5943
+ setSourceProps(el, img);
5944
+ attr(img, 'src', src);
5945
+ return img;
5989
5946
  }
5990
5947
 
5991
5948
  var sizesRe = /\s*(.*?)\s*(\w+|calc\(.*?\))\s*(?:,|$)/g;
@@ -6004,19 +5961,6 @@
6004
5961
  return matches || '100vw';
6005
5962
  }
6006
5963
 
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
5964
  var sizeRe = /\d+(?:\w+|%)/g;
6021
5965
  var additionRe = /[+-]?(\d+)/g;
6022
5966
  function evaluateSize(size) {
@@ -6050,22 +5994,6 @@
6050
5994
  return el && el.tagName === tagName;
6051
5995
  }
6052
5996
 
6053
- function currentSrc(el) {
6054
- return el.currentSrc || el.src;
6055
- }
6056
-
6057
- var key = '__test__';
6058
- var storage;
6059
-
6060
- // workaround for Safari's private browsing mode and accessing sessionStorage in Blink
6061
- try {
6062
- storage = window.sessionStorage || {};
6063
- storage[key] = 1;
6064
- delete storage[key];
6065
- } catch (e) {
6066
- storage = {};
6067
- }
6068
-
6069
5997
  var Media = {
6070
5998
 
6071
5999
  props: {
@@ -7829,7 +7757,7 @@
7829
7757
  {
7830
7758
 
7831
7759
  read: function(ref, types) {
7832
- var height = ref.height;
7760
+ var height$1 = ref.height;
7833
7761
 
7834
7762
 
7835
7763
  this.inactive = !this.matchMedia || !isVisible(this.$el);
@@ -7840,15 +7768,20 @@
7840
7768
 
7841
7769
  if (this.isActive && types.has('resize')) {
7842
7770
  this.hide();
7843
- height = this.$el.offsetHeight;
7771
+ height$1 = this.$el.offsetHeight;
7844
7772
  this.show();
7845
7773
  }
7846
7774
 
7847
- height = !this.isActive ? this.$el.offsetHeight : height;
7775
+ height$1 = !this.isActive ? this.$el.offsetHeight : height$1;
7776
+
7777
+ if (height$1 + this.offset > height(window)) {
7778
+ this.inactive = true;
7779
+ return false;
7780
+ }
7848
7781
 
7849
7782
  var referenceElement = this.isFixed ? this.placeholder : this.$el;
7850
7783
  this.topOffset = offset(referenceElement).top;
7851
- this.bottomOffset = this.topOffset + height;
7784
+ this.bottomOffset = this.topOffset + height$1;
7852
7785
  this.offsetParentTop = offset(referenceElement.offsetParent).top;
7853
7786
 
7854
7787
  var bottom = parseProp('bottom', this);
@@ -7858,7 +7791,7 @@
7858
7791
  this.width = dimensions(isVisible(this.widthElement) ? this.widthElement : this.$el).width;
7859
7792
 
7860
7793
  return {
7861
- height: height,
7794
+ height: height$1,
7862
7795
  top: offsetPosition(this.placeholder)[0],
7863
7796
  margins: css(this.$el, ['marginTop', 'marginBottom', 'marginLeft', 'marginRight'])
7864
7797
  };