uikit 3.14.1-dev.e15dd286c → 3.14.2-dev.1d34cc58b

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 (65) hide show
  1. package/CHANGELOG.md +14 -3
  2. package/build/util.js +8 -2
  3. package/dist/css/uikit-core-rtl.css +6 -1
  4. package/dist/css/uikit-core-rtl.min.css +1 -1
  5. package/dist/css/uikit-core.css +6 -1
  6. package/dist/css/uikit-core.min.css +1 -1
  7. package/dist/css/uikit-rtl.css +12 -4
  8. package/dist/css/uikit-rtl.min.css +1 -1
  9. package/dist/css/uikit.css +12 -4
  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 +6 -1
  16. package/dist/js/components/lightbox-panel.min.js +1 -1
  17. package/dist/js/components/lightbox.js +6 -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 +14 -14
  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 +56 -51
  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 +56 -51
  42. package/dist/js/uikit.min.js +1 -1
  43. package/package.json +11 -11
  44. package/src/js/api/hooks.js +1 -1
  45. package/src/js/core/drop.js +16 -7
  46. package/src/js/core/height-viewport.js +1 -2
  47. package/src/js/core/scrollspy.js +7 -9
  48. package/src/js/core/toggle.js +4 -0
  49. package/src/js/mixin/position.js +7 -22
  50. package/src/js/mixin/togglable.js +5 -0
  51. package/src/js/util/position.js +9 -9
  52. package/src/js/util/viewport.js +5 -9
  53. package/src/less/components/drop.less +1 -0
  54. package/src/less/components/dropdown.less +1 -0
  55. package/src/less/components/navbar.less +2 -0
  56. package/src/less/components/tooltip.less +1 -0
  57. package/src/less/theme/navbar.less +7 -5
  58. package/src/scss/components/drop.scss +1 -0
  59. package/src/scss/components/dropdown.scss +1 -0
  60. package/src/scss/components/navbar.scss +2 -0
  61. package/src/scss/components/tooltip.scss +1 -0
  62. package/src/scss/mixins-theme.scss +7 -5
  63. package/tests/drop.html +20 -2
  64. package/tests/dropdown.html +6 -0
  65. package/tests/navbar.html +21 -59
package/dist/js/uikit.js CHANGED
@@ -1,4 +1,4 @@
1
- /*! UIkit 3.14.1-dev.e15dd286c | https://www.getuikit.com | (c) 2014 - 2022 YOOtheme | MIT License */
1
+ /*! UIkit 3.14.2-dev.1d34cc58b | 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() :
@@ -1911,22 +1911,18 @@
1911
1911
  function offsetViewport(scrollElement) {
1912
1912
  let viewportElement = getViewport$1(scrollElement);
1913
1913
 
1914
- // iOS 12 returns <body> as scrollingElement
1915
- if (viewportElement === scrollingElement(viewportElement)) {
1916
- viewportElement = document.documentElement;
1917
- }
1918
-
1919
1914
  let rect = offset(viewportElement);
1920
1915
  for (let [prop, dir, start, end] of [
1921
1916
  ['width', 'x', 'left', 'right'],
1922
1917
  ['height', 'y', 'top', 'bottom']])
1923
1918
  {
1924
- if (!isWindow(getViewport$1(viewportElement))) {
1919
+ if (!isWindow(viewportElement)) {
1925
1920
  rect[start] += toFloat(css(viewportElement, "border" + ucfirst(start) + "Width"));
1921
+ } else {
1922
+ // iOS 12 returns <body> as scrollingElement
1923
+ viewportElement = viewportElement.document.documentElement;
1926
1924
  }
1927
- rect[prop] = rect[dir] = (
1928
- isWindow(viewportElement) ? scrollingElement(viewportElement) : viewportElement)["client" +
1929
- ucfirst(prop)];
1925
+ rect[prop] = rect[dir] = viewportElement["client" + ucfirst(prop)];
1930
1926
  rect[end] = rect[prop] + rect[start];
1931
1927
  }
1932
1928
  return rect;
@@ -1990,6 +1986,10 @@
1990
1986
  return position;
1991
1987
  }
1992
1988
 
1989
+ function moveBy(start, end, dim) {
1990
+ return start === 'center' ? dim / 2 : start === end ? dim : 0;
1991
+ }
1992
+
1993
1993
  function attachToWithFlip(element, target, options) {
1994
1994
  const position = attachTo(element, target, options);
1995
1995
  const targetDim = offset(target);
@@ -2000,7 +2000,7 @@
2000
2000
  offset: elOffset,
2001
2001
  boundary,
2002
2002
  viewport,
2003
- viewportPadding } =
2003
+ viewportOffset } =
2004
2004
  options;
2005
2005
 
2006
2006
  let viewports = scrollParents(element);
@@ -2021,9 +2021,9 @@
2021
2021
 
2022
2022
  viewport = getIntersectionArea(...viewports.filter(Boolean).map(offsetViewport));
2023
2023
 
2024
- if (viewportPadding) {
2025
- viewport[start] += viewportPadding;
2026
- viewport[end] -= viewportPadding;
2024
+ if (viewportOffset) {
2025
+ viewport[start] += viewportOffset;
2026
+ viewport[end] -= viewportOffset;
2027
2027
  }
2028
2028
 
2029
2029
  if (boundary && !willFlip && position[prop] <= offset(boundary)[prop]) {
@@ -2113,10 +2113,6 @@
2113
2113
  return offsetPosition;
2114
2114
  }
2115
2115
 
2116
- function moveBy(start, end, dim) {
2117
- return start === 'center' ? dim / 2 : start === end ? dim : 0;
2118
- }
2119
-
2120
2116
  function getIntersectionArea() {
2121
2117
  let area = {};for (var _len = arguments.length, rects = new Array(_len), _key = 0; _key < _len; _key++) {rects[_key] = arguments[_key];}
2122
2118
  for (const rect of rects) {
@@ -2474,7 +2470,7 @@
2474
2470
  const {
2475
2471
  $options: { computed } } =
2476
2472
  this;
2477
- const values = { ...(initial ? {} : this._computed) };
2473
+ const values = { ...this._computed };
2478
2474
  this._computed = {};
2479
2475
 
2480
2476
  for (const key in computed) {
@@ -2954,7 +2950,7 @@
2954
2950
  UIkit.data = '__uikit__';
2955
2951
  UIkit.prefix = 'uk-';
2956
2952
  UIkit.options = {};
2957
- UIkit.version = '3.14.1-dev.e15dd286c';
2953
+ UIkit.version = '3.14.2-dev.1d34cc58b';
2958
2954
 
2959
2955
  globalAPI(UIkit);
2960
2956
  hooksAPI(UIkit);
@@ -3103,6 +3099,11 @@
3103
3099
  return Promise.reject();
3104
3100
  }
3105
3101
 
3102
+ if (!animate) {
3103
+ Animation.cancel(el);
3104
+ Transition.cancel(el);
3105
+ }
3106
+
3106
3107
  const promise = (
3107
3108
  isFunction(animate) ?
3108
3109
  animate :
@@ -3582,8 +3583,7 @@
3582
3583
  data: {
3583
3584
  pos: "bottom-" + (isRtl ? 'right' : 'left'),
3584
3585
  flip: true,
3585
- offset: false,
3586
- viewportPadding: 10 },
3586
+ offset: false },
3587
3587
 
3588
3588
 
3589
3589
  connected() {
@@ -3595,16 +3595,12 @@
3595
3595
  positionAt(element, target, boundary) {
3596
3596
  const [dir, align] = this.pos;
3597
3597
 
3598
- let { offset: offset$1 } = this;
3599
- if (!isNumeric(offset$1)) {
3600
- const node = $(offset$1);
3601
- offset$1 = node ?
3602
- offset(node)[this.axis === 'x' ? 'left' : 'top'] -
3603
- offset(target)[this.axis === 'x' ? 'right' : 'bottom'] :
3604
- 0;
3605
- }
3606
- offset$1 = toPx(offset$1) + toPx(getCssVar('position-offset', element));
3607
- offset$1 = [includes(['left', 'top'], dir) ? -offset$1 : +offset$1, 0];
3598
+ let offset = toPx(
3599
+ this.offset === false ? getCssVar('position-offset', element) : this.offset,
3600
+ this.axis === 'x' ? 'width' : 'height',
3601
+ element);
3602
+
3603
+ offset = [includes(['left', 'top'], dir) ? -offset : +offset, 0];
3608
3604
 
3609
3605
  const attach = {
3610
3606
  element: [flipPosition(dir), align],
@@ -3615,15 +3611,15 @@
3615
3611
  for (const prop in attach) {
3616
3612
  attach[prop] = attach[prop].reverse();
3617
3613
  }
3618
- offset$1 = offset$1.reverse();
3614
+ offset = offset.reverse();
3619
3615
  }
3620
3616
 
3621
3617
  positionAt(element, target, {
3622
3618
  attach,
3623
- offset: offset$1,
3619
+ offset,
3624
3620
  boundary,
3625
- viewportPadding: this.boundaryAlign ? 0 : this.viewportPadding,
3626
- flip: this.flip });
3621
+ flip: this.flip,
3622
+ viewportOffset: toPx(getCssVar('position-viewport-offset', element)) });
3627
3623
 
3628
3624
  } } };
3629
3625
 
@@ -3974,19 +3970,27 @@
3974
3970
  toggleClass(this.$el, this.clsDrop + "-boundary", this.boundaryAlign);
3975
3971
 
3976
3972
  const boundary = query(this.boundary, this.$el);
3977
- const [scrollParent] = scrollParents(this.$el);
3978
- const scrollParentOffset = offsetViewport(scrollParent);
3973
+ const scrollParentOffset = offset(
3974
+ scrollParents(boundary && this.boundaryAlign ? boundary : this.$el)[0]);
3975
+
3979
3976
  const boundaryOffset = boundary ? offset(boundary) : scrollParentOffset;
3980
3977
 
3981
3978
  css(this.$el, 'maxWidth', '');
3982
3979
  const maxWidth =
3983
- scrollParentOffset.width - (this.boundaryAlign ? 0 : 2 * this.viewportPadding);
3980
+ scrollParentOffset.width -
3981
+ 2 * toPx(getCssVar('position-viewport-offset', this.$el));
3984
3982
 
3985
3983
  if (this.pos[1] === 'justify') {
3986
3984
  const prop = this.axis === 'y' ? 'width' : 'height';
3987
- const targetOffset = offset(this.target);
3988
- const alignTo = this.boundaryAlign ? boundaryOffset : targetOffset;
3989
- css(this.$el, prop, alignTo[prop]);
3985
+ css(
3986
+ this.$el,
3987
+ prop,
3988
+ Math.min(
3989
+ (boundary ? boundaryOffset : offset(this.target))[prop],
3990
+ scrollParentOffset[prop] -
3991
+ 2 * toPx(getCssVar('position-viewport-offset', this.$el))));
3992
+
3993
+
3990
3994
  } else if (this.$el.offsetWidth > maxWidth) {
3991
3995
  addClass(this.$el, this.clsDrop + "-stack");
3992
3996
  }
@@ -4464,7 +4468,7 @@
4464
4468
  }
4465
4469
 
4466
4470
  var heightViewport = {
4467
- mixins: [Class, Resize],
4471
+ mixins: [Resize],
4468
4472
 
4469
4473
  props: {
4470
4474
  expand: Boolean,
@@ -6443,13 +6447,13 @@
6443
6447
  return target ? $$(target, $el) : [$el];
6444
6448
  },
6445
6449
 
6446
- watch(elements) {
6450
+ watch(elements, prev) {
6447
6451
  if (this.hidden) {
6448
6452
  css(filter$1(elements, ":not(." + this.inViewClass + ")"), 'visibility', 'hidden');
6449
6453
  }
6450
6454
 
6451
- for (const element of elements) {
6452
- this._observer.observe(element);
6455
+ if (!isEqual(elements, prev)) {
6456
+ this.$reset();
6453
6457
  }
6454
6458
  },
6455
6459
 
@@ -6459,10 +6463,9 @@
6459
6463
 
6460
6464
  connected() {
6461
6465
  this._data.elements = new Map();
6462
-
6463
6466
  this.registerObserver(
6464
- this._observer = observeIntersection(
6465
- [],
6467
+ observeIntersection(
6468
+ this.elements,
6466
6469
  (records) => {
6467
6470
  const elements = this._data.elements;
6468
6471
  for (const { target: el, isIntersecting } of records) {
@@ -6496,8 +6499,6 @@
6496
6499
  for (const [el, state] of this._data.elements.entries()) {
6497
6500
  removeClass(el, this.inViewClass, (state == null ? void 0 : state.cls) || '');
6498
6501
  }
6499
-
6500
- this._observer = null;
6501
6502
  },
6502
6503
 
6503
6504
  update: [
@@ -7342,6 +7343,10 @@
7342
7343
  {
7343
7344
  name: 'click',
7344
7345
 
7346
+ filter() {
7347
+ return ['click', 'hover'].some((mode) => includes(this.mode, mode));
7348
+ },
7349
+
7345
7350
  handler(e) {
7346
7351
  let link;
7347
7352
  if (