uikit 3.13.11-dev.98491b3f4 → 3.13.11-dev.9f2f619d7

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 (62) hide show
  1. package/CHANGELOG.md +6 -1
  2. package/dist/css/uikit-core-rtl.css +9 -3
  3. package/dist/css/uikit-core-rtl.min.css +1 -1
  4. package/dist/css/uikit-core.css +9 -3
  5. package/dist/css/uikit-core.min.css +1 -1
  6. package/dist/css/uikit-rtl.css +9 -3
  7. package/dist/css/uikit-rtl.min.css +1 -1
  8. package/dist/css/uikit.css +9 -3
  9. package/dist/css/uikit.min.css +1 -1
  10. package/dist/js/components/countdown.js +1 -1
  11. package/dist/js/components/countdown.min.js +1 -1
  12. package/dist/js/components/filter.js +1 -1
  13. package/dist/js/components/filter.min.js +1 -1
  14. package/dist/js/components/lightbox-panel.js +1 -1
  15. package/dist/js/components/lightbox-panel.min.js +1 -1
  16. package/dist/js/components/lightbox.js +1 -1
  17. package/dist/js/components/lightbox.min.js +1 -1
  18. package/dist/js/components/notification.js +1 -1
  19. package/dist/js/components/notification.min.js +1 -1
  20. package/dist/js/components/parallax.js +4 -2
  21. package/dist/js/components/parallax.min.js +1 -1
  22. package/dist/js/components/slider-parallax.js +4 -2
  23. package/dist/js/components/slider-parallax.min.js +1 -1
  24. package/dist/js/components/slider.js +2 -2
  25. package/dist/js/components/slider.min.js +1 -1
  26. package/dist/js/components/slideshow-parallax.js +4 -2
  27. package/dist/js/components/slideshow-parallax.min.js +1 -1
  28. package/dist/js/components/slideshow.js +1 -1
  29. package/dist/js/components/slideshow.min.js +1 -1
  30. package/dist/js/components/sortable.js +1 -1
  31. package/dist/js/components/sortable.min.js +1 -1
  32. package/dist/js/components/tooltip.js +1 -1
  33. package/dist/js/components/tooltip.min.js +1 -1
  34. package/dist/js/components/upload.js +1 -1
  35. package/dist/js/components/upload.min.js +1 -1
  36. package/dist/js/uikit-core.js +98 -68
  37. package/dist/js/uikit-core.min.js +1 -1
  38. package/dist/js/uikit-icons.js +1 -1
  39. package/dist/js/uikit-icons.min.js +1 -1
  40. package/dist/js/uikit.js +102 -70
  41. package/dist/js/uikit.min.js +1 -1
  42. package/package.json +1 -1
  43. package/src/js/components/slider.js +1 -1
  44. package/src/js/core/cover.js +27 -14
  45. package/src/js/core/scrollspy-nav.js +2 -2
  46. package/src/js/core/sticky.js +36 -12
  47. package/src/js/mixin/parallax.js +3 -2
  48. package/src/js/util/lang.js +34 -38
  49. package/src/js/util/position.js +4 -7
  50. package/src/less/components/nav.less +1 -0
  51. package/src/less/components/sticky.less +8 -3
  52. package/src/less/components/utility.less +1 -0
  53. package/src/scss/components/nav.scss +1 -0
  54. package/src/scss/components/sticky.scss +8 -3
  55. package/src/scss/components/utility.scss +1 -0
  56. package/tests/alert.html +1 -1
  57. package/tests/drop.html +129 -80
  58. package/tests/navbar.html +1 -1
  59. package/tests/parallax.html +5 -5
  60. package/tests/sticky-navbar.html +6 -6
  61. package/tests/sticky-parallax.html +163 -158
  62. package/tests/sticky.html +149 -74
package/dist/js/uikit.js CHANGED
@@ -1,4 +1,4 @@
1
- /*! UIkit 3.13.11-dev.98491b3f4 | https://www.getuikit.com | (c) 2014 - 2022 YOOtheme | MIT License */
1
+ /*! UIkit 3.13.11-dev.9f2f619d7 | https://www.getuikit.com | (c) 2014 - 2022 YOOtheme | MIT License */
2
2
 
3
3
  (function (global, factory) {
4
4
  typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
@@ -208,48 +208,44 @@
208
208
 
209
209
  }
210
210
 
211
- const Dimensions = {
212
- ratio(dimensions, prop, value) {
213
- const aProp = prop === 'width' ? 'height' : 'width';
211
+ function ratio(dimensions, prop, value) {
212
+ const aProp = prop === 'width' ? 'height' : 'width';
214
213
 
215
- return {
216
- [aProp]: dimensions[prop] ?
217
- Math.round(value * dimensions[aProp] / dimensions[prop]) :
218
- dimensions[aProp],
219
- [prop]: value };
214
+ return {
215
+ [aProp]: dimensions[prop] ?
216
+ Math.round(value * dimensions[aProp] / dimensions[prop]) :
217
+ dimensions[aProp],
218
+ [prop]: value };
220
219
 
221
- },
220
+ }
222
221
 
223
- contain(dimensions, maxDimensions) {
224
- dimensions = { ...dimensions };
222
+ function contain(dimensions, maxDimensions) {
223
+ dimensions = { ...dimensions };
225
224
 
226
- each(
227
- dimensions,
228
- (_, prop) =>
225
+ for (const prop in dimensions) {
229
226
  dimensions =
230
227
  dimensions[prop] > maxDimensions[prop] ?
231
- this.ratio(dimensions, prop, maxDimensions[prop]) :
232
- dimensions);
233
-
228
+ ratio(dimensions, prop, maxDimensions[prop]) :
229
+ dimensions;
230
+ }
234
231
 
235
- return dimensions;
236
- },
232
+ return dimensions;
233
+ }
237
234
 
238
- cover(dimensions, maxDimensions) {
239
- dimensions = this.contain(dimensions, maxDimensions);
235
+ function cover$1(dimensions, maxDimensions) {
236
+ dimensions = contain(dimensions, maxDimensions);
240
237
 
241
- each(
242
- dimensions,
243
- (_, prop) =>
238
+ for (const prop in dimensions) {
244
239
  dimensions =
245
240
  dimensions[prop] < maxDimensions[prop] ?
246
- this.ratio(dimensions, prop, maxDimensions[prop]) :
247
- dimensions);
248
-
241
+ ratio(dimensions, prop, maxDimensions[prop]) :
242
+ dimensions;
243
+ }
249
244
 
250
- return dimensions;
251
- } };
245
+ return dimensions;
246
+ }
252
247
 
248
+ const Dimensions = { ratio, contain, cover: cover$1 };
253
249
 
254
250
  function getIndex(i, elements, current, finite) {if (current === void 0) {current = 0;}if (finite === void 0) {finite = false;}
255
251
  elements = toNodes(elements);
@@ -1983,8 +1979,7 @@
1983
1979
 
1984
1980
  const position = offset(element);
1985
1981
  const targetOffset = offset(target);
1986
- for (const i in dirs) {
1987
- const [prop, dir, start, end] = dirs[i];
1982
+ for (const [i, [prop, dir, start, end]] of Object.entries(dirs)) {
1988
1983
  position[start] = position[dir] =
1989
1984
  targetOffset[start] +
1990
1985
  moveBy(attach.target[i], end, targetOffset[prop]) -
@@ -1998,7 +1993,7 @@
1998
1993
  function attachToWithFlip(element, target, options) {
1999
1994
  const position = attachTo(element, target, options);
2000
1995
  const targetDim = offset(target);
2001
- const viewports = scrollParents(element, /auto|scroll/);
1996
+ const viewports = scrollParents(element);
2002
1997
  const [scrollElement] = viewports;
2003
1998
 
2004
1999
  let {
@@ -2013,9 +2008,7 @@
2013
2008
  viewports.push(viewport);
2014
2009
 
2015
2010
  const offsetPosition = { ...position };
2016
- for (const i in dirs) {
2017
- const [prop, dir, start, end] = dirs[i];
2018
-
2011
+ for (const [i, [prop, dir, start, end]] of Object.entries(dirs)) {
2019
2012
  if (flip !== true && !includes(flip, dir)) {
2020
2013
  continue;
2021
2014
  }
@@ -2147,7 +2140,7 @@
2147
2140
  }
2148
2141
 
2149
2142
  function flipDir(prop) {
2150
- for (const i in dirs) {
2143
+ for (let i = 0; i < dirs.length; i++) {
2151
2144
  const index = dirs[i].indexOf(prop);
2152
2145
  if (~index) {
2153
2146
  return dirs[1 - i][index % 2 + 2];
@@ -2616,7 +2609,7 @@
2616
2609
  continue;
2617
2610
  }
2618
2611
 
2619
- value = props[key] === Boolean && value === '' ? true : coerce(props[key], value);
2612
+ value = props[key] === Boolean && value === '' ? true : coerce$1(props[key], value);
2620
2613
 
2621
2614
  if (prop === 'target' && (!value || startsWith(value, '_'))) {
2622
2615
  continue;
@@ -2630,7 +2623,7 @@
2630
2623
  for (const key in options) {
2631
2624
  const prop = camelize(key);
2632
2625
  if (props[prop] !== undefined) {
2633
- data$1[prop] = coerce(props[prop], options[key]);
2626
+ data$1[prop] = coerce$1(props[prop], options[key]);
2634
2627
  }
2635
2628
  }
2636
2629
 
@@ -2695,7 +2688,7 @@
2695
2688
  return options.every((arr) => !arr || !hasOwn(arr, key));
2696
2689
  }
2697
2690
 
2698
- function coerce(type, value) {
2691
+ function coerce$1(type, value) {
2699
2692
  if (type === Boolean) {
2700
2693
  return toBoolean(value);
2701
2694
  } else if (type === Number) {
@@ -2733,7 +2726,7 @@
2733
2726
  if (isUndefined(data[key])) {
2734
2727
  delete data[key];
2735
2728
  } else if (props[key]) {
2736
- data[key] = coerce(props[key], data[key]);
2729
+ data[key] = coerce$1(props[key], data[key]);
2737
2730
  }
2738
2731
  }
2739
2732
 
@@ -2958,7 +2951,7 @@
2958
2951
  UIkit.data = '__uikit__';
2959
2952
  UIkit.prefix = 'uk-';
2960
2953
  UIkit.options = {};
2961
- UIkit.version = '3.13.11-dev.98491b3f4';
2954
+ UIkit.version = '3.13.11-dev.9f2f619d7';
2962
2955
 
2963
2956
  globalAPI(UIkit);
2964
2957
  hooksAPI(UIkit);
@@ -3482,25 +3475,38 @@
3482
3475
 
3483
3476
  update: {
3484
3477
  read() {
3485
- const el = this.$el;
3486
- const { offsetHeight: height, offsetWidth: width } =
3487
- getPositionedParent(el) || parent(el);
3488
- const dim = Dimensions.cover(
3489
- {
3490
- width: this.width || el.naturalWidth || el.videoWidth || el.clientWidth,
3491
- height: this.height || el.naturalHeight || el.videoHeight || el.clientHeight },
3478
+ const { ratio, cover } = Dimensions;
3479
+ const { $el, width, height } = this;
3492
3480
 
3493
- {
3494
- width: width + (width % 2 ? 1 : 0),
3495
- height: height + (height % 2 ? 1 : 0) });
3481
+ let dim = { width, height };
3496
3482
 
3483
+ if (!dim.width || !dim.height) {
3484
+ const intrinsic = {
3485
+ width: $el.naturalWidth || $el.videoWidth || $el.clientWidth,
3486
+ height: $el.naturalHeight || $el.videoHeight || $el.clientHeight };
3497
3487
 
3498
3488
 
3499
- if (!dim.width || !dim.height) {
3489
+ if (dim.width) {
3490
+ dim = ratio(intrinsic, 'width', dim.width);
3491
+ } else if (height) {
3492
+ dim = ratio(intrinsic, 'height', dim.height);
3493
+ } else {
3494
+ dim = intrinsic;
3495
+ }
3496
+ }
3497
+
3498
+ const { offsetHeight: coverHeight, offsetWidth: coverWidth } =
3499
+ getPositionedParent($el) || parent($el);
3500
+ const coverDim = cover(dim, {
3501
+ width: coverWidth + (coverWidth % 2 ? 1 : 0),
3502
+ height: coverHeight + (coverHeight % 2 ? 1 : 0) });
3503
+
3504
+
3505
+ if (!coverDim.width || !coverDim.height) {
3500
3506
  return false;
3501
3507
  }
3502
3508
 
3503
- return dim;
3509
+ return coverDim;
3504
3510
  },
3505
3511
 
3506
3512
  write(_ref) {let { height, width } = _ref;
@@ -6549,7 +6555,7 @@
6549
6555
  if (scrollTop === max) {
6550
6556
  active = length - 1;
6551
6557
  } else {
6552
- for (const i in targets) {
6558
+ for (let i = 0; i < targets.length; i++) {
6553
6559
  if (offset(targets[i]).top - viewport.top - this.offset > 0) {
6554
6560
  break;
6555
6561
  }
@@ -6568,7 +6574,7 @@
6568
6574
  const changed = active !== false && !hasClass(this.elements[active], this.cls);
6569
6575
 
6570
6576
  this.links.forEach((el) => el.blur());
6571
- for (const i in this.elements) {
6577
+ for (let i = 0; i < this.elements.length; i++) {
6572
6578
  toggleClass(this.elements[i], this.cls, +i === active);
6573
6579
  }
6574
6580
 
@@ -6584,11 +6590,12 @@
6584
6590
 
6585
6591
  props: {
6586
6592
  position: String,
6587
- top: Boolean,
6588
- bottom: Boolean,
6589
- start: Boolean,
6590
- end: Boolean,
6593
+ top: null,
6594
+ bottom: null,
6595
+ start: null,
6596
+ end: null,
6591
6597
  offset: String,
6598
+ overflowFlip: Boolean,
6592
6599
  animation: String,
6593
6600
  clsActive: String,
6594
6601
  clsInactive: String,
@@ -6606,6 +6613,7 @@
6606
6613
  start: false,
6607
6614
  end: false,
6608
6615
  offset: 0,
6616
+ overflowFlip: false,
6609
6617
  animation: '',
6610
6618
  clsActive: 'uk-active',
6611
6619
  clsInactive: '',
@@ -6627,8 +6635,8 @@
6627
6635
  },
6628
6636
 
6629
6637
  connected() {
6630
- this.start = this.start || this.top;
6631
- this.end = this.end || this.bottom;
6638
+ this.start = coerce(this.start || this.top);
6639
+ this.end = coerce(this.end || this.bottom);
6632
6640
 
6633
6641
  this.placeholder =
6634
6642
  $('+ .uk-sticky-placeholder', this.$el) ||
@@ -6648,6 +6656,17 @@
6648
6656
  },
6649
6657
 
6650
6658
  events: [
6659
+ {
6660
+ name: 'resize',
6661
+
6662
+ el() {
6663
+ return window;
6664
+ },
6665
+
6666
+ handler() {
6667
+ this.$emit('resize');
6668
+ } },
6669
+
6651
6670
  {
6652
6671
  name: 'load hashchange popstate',
6653
6672
 
@@ -6673,8 +6692,8 @@
6673
6692
  window,
6674
6693
  targetOffset.top -
6675
6694
  elOffset.height -
6676
- toPx(this.targetOffset, 'height') -
6677
- toPx(this.offset, 'height'));
6695
+ toPx(this.targetOffset, 'height', this.placeholder) -
6696
+ toPx(this.offset, 'height', this.placeholder));
6678
6697
 
6679
6698
  }
6680
6699
  });
@@ -6711,16 +6730,18 @@
6711
6730
  const windowHeight = height(window);
6712
6731
 
6713
6732
  let position = this.position;
6714
- if (position === 'auto' && height$1 > windowHeight) {
6715
- position = 'bottom';
6733
+ if (this.overflowFlip && height$1 > windowHeight) {
6734
+ position = position === 'top' ? 'bottom' : 'top';
6716
6735
  }
6717
6736
 
6718
6737
  let offset$1 = toPx(this.offset, 'height', referenceElement);
6719
- if (position === 'bottom') {
6738
+ if (position === 'bottom' && (height$1 < windowHeight || this.overflowFlip)) {
6720
6739
  offset$1 += windowHeight - height$1;
6721
6740
  }
6722
6741
 
6723
- const overflow = Math.max(0, height$1 + offset$1 - windowHeight);
6742
+ const overflow = this.overflowFlip ?
6743
+ 0 :
6744
+ Math.max(0, height$1 + offset$1 - windowHeight);
6724
6745
  const topOffset = offset(referenceElement).top;
6725
6746
 
6726
6747
  const start =
@@ -6949,6 +6970,15 @@
6949
6970
  }
6950
6971
  }
6951
6972
 
6973
+ function coerce(value) {
6974
+ if (value === 'true') {
6975
+ return true;
6976
+ } else if (value === 'false') {
6977
+ return false;
6978
+ }
6979
+ return value;
6980
+ }
6981
+
6952
6982
  var Switcher = {
6953
6983
  mixins: [Lazyload, Swipe, Togglable],
6954
6984
 
@@ -9281,7 +9311,9 @@
9281
9311
 
9282
9312
  methods: {
9283
9313
  reset() {
9284
- each(this.getCss(0), (_, prop) => css(this.$el, prop, ''));
9314
+ for (const prop in this.getCss(0)) {
9315
+ css(this.$el, prop, '');
9316
+ }
9285
9317
  },
9286
9318
 
9287
9319
  getCss(percent) {
@@ -9901,7 +9933,7 @@
9901
9933
  let left = 0;
9902
9934
  const sets = [];
9903
9935
  const width = dimensions$1(this.list).width;
9904
- for (let i in this.slides) {
9936
+ for (let i = 0; i < this.slides.length; i++) {
9905
9937
  const slideWidth = dimensions$1(this.slides[i]).width;
9906
9938
 
9907
9939
  if (left + slideWidth > width) {