uikit 3.14.2-dev.e270e98f7 → 3.14.2-dev.f917389f5

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 (72) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/build/util.js +8 -2
  3. package/dist/css/uikit-core-rtl.css +46 -19
  4. package/dist/css/uikit-core-rtl.min.css +1 -1
  5. package/dist/css/uikit-core.css +46 -19
  6. package/dist/css/uikit-core.min.css +1 -1
  7. package/dist/css/uikit-rtl.css +48 -31
  8. package/dist/css/uikit-rtl.min.css +1 -1
  9. package/dist/css/uikit.css +48 -31
  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 +2 -2
  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 +25 -15
  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 +73 -50
  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 +74 -51
  42. package/dist/js/uikit.min.js +1 -1
  43. package/package.json +11 -11
  44. package/src/js/components/parallax.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/toggle.js +4 -0
  48. package/src/js/mixin/position.js +18 -23
  49. package/src/js/mixin/togglable.js +5 -0
  50. package/src/js/util/position.js +24 -22
  51. package/src/js/util/viewport.js +6 -7
  52. package/src/less/components/drop.less +2 -0
  53. package/src/less/components/dropdown.less +2 -0
  54. package/src/less/components/modal.less +19 -4
  55. package/src/less/components/navbar.less +28 -8
  56. package/src/less/components/offcanvas.less +21 -21
  57. package/src/less/components/tooltip.less +1 -0
  58. package/src/less/theme/navbar.less +3 -10
  59. package/src/scss/components/drop.scss +2 -0
  60. package/src/scss/components/dropdown.scss +2 -0
  61. package/src/scss/components/modal.scss +19 -4
  62. package/src/scss/components/navbar.scss +28 -8
  63. package/src/scss/components/offcanvas.scss +21 -21
  64. package/src/scss/components/tooltip.scss +1 -0
  65. package/src/scss/mixins-theme.scss +0 -10
  66. package/src/scss/theme/navbar.scss +3 -0
  67. package/src/scss/variables-theme.scss +23 -11
  68. package/src/scss/variables.scss +23 -11
  69. package/tests/drop.html +20 -2
  70. package/tests/dropdown.html +6 -0
  71. package/tests/navbar.html +21 -59
  72. package/tests/offcanvas.html +8 -8
package/dist/js/uikit.js CHANGED
@@ -1,4 +1,4 @@
1
- /*! UIkit 3.14.2-dev.e270e98f7 | https://www.getuikit.com | (c) 2014 - 2022 YOOtheme | MIT License */
1
+ /*! UIkit 3.14.2-dev.f917389f5 | 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() :
@@ -1916,21 +1916,20 @@
1916
1916
  ['width', 'x', 'left', 'right'],
1917
1917
  ['height', 'y', 'top', 'bottom']])
1918
1918
  {
1919
- if (!isWindow(getViewport$1(viewportElement))) {
1919
+ if (!isWindow(viewportElement)) {
1920
1920
  rect[start] += toFloat(css(viewportElement, "border" + ucfirst(start) + "Width"));
1921
+ } else {
1922
+ // iOS 12 returns <body> as scrollingElement
1923
+ viewportElement = viewportElement.document.documentElement;
1921
1924
  }
1922
- rect[prop] = rect[dir] =
1923
- viewportElement[(isWindow(viewportElement) ? 'inner' : 'client') + ucfirst(prop)];
1925
+ rect[prop] = rect[dir] = viewportElement["client" + ucfirst(prop)];
1924
1926
  rect[end] = rect[prop] + rect[start];
1925
1927
  }
1926
1928
  return rect;
1927
1929
  }
1928
1930
 
1929
1931
  function scrollingElement(element) {
1930
- const {
1931
- document: { scrollingElement } } =
1932
- toWindow(element);
1933
- return scrollingElement;
1932
+ return toWindow(element).document.scrollingElement;
1934
1933
  }
1935
1934
 
1936
1935
  function getViewport$1(scrollElement) {
@@ -1984,6 +1983,10 @@
1984
1983
  return position;
1985
1984
  }
1986
1985
 
1986
+ function moveBy(start, end, dim) {
1987
+ return start === 'center' ? dim / 2 : start === end ? dim : 0;
1988
+ }
1989
+
1987
1990
  function attachToWithFlip(element, target, options) {
1988
1991
  const position = attachTo(element, target, options);
1989
1992
  const targetDim = offset(target);
@@ -1994,7 +1997,7 @@
1994
1997
  offset: elOffset,
1995
1998
  boundary,
1996
1999
  viewport,
1997
- viewportPadding } =
2000
+ viewportOffset } =
1998
2001
  options;
1999
2002
 
2000
2003
  let viewports = scrollParents(element);
@@ -2015,9 +2018,9 @@
2015
2018
 
2016
2019
  viewport = getIntersectionArea(...viewports.filter(Boolean).map(offsetViewport));
2017
2020
 
2018
- if (viewportPadding) {
2019
- viewport[start] += viewportPadding;
2020
- viewport[end] -= viewportPadding;
2021
+ if (viewportOffset) {
2022
+ viewport[start] += viewportOffset;
2023
+ viewport[end] -= viewportOffset;
2021
2024
  }
2022
2025
 
2023
2026
  if (boundary && !willFlip && position[prop] <= offset(boundary)[prop]) {
@@ -2074,19 +2077,21 @@
2074
2077
  return false;
2075
2078
  }
2076
2079
 
2077
- const newPos = attachToWithFlip(element, target, {
2078
- ...options,
2079
- attach: {
2080
- element: elAttach.map(flipDir).reverse(),
2081
- target: targetAttach.map(flipDir).reverse() },
2080
+ if (flip === true || includes(flip, dirs[1 - i][1])) {
2081
+ const newPos = attachToWithFlip(element, target, {
2082
+ ...options,
2083
+ attach: {
2084
+ element: elAttach.map(flipDir).reverse(),
2085
+ target: targetAttach.map(flipDir).reverse() },
2082
2086
 
2083
- offset: elOffset.reverse(),
2084
- flip: flip === true ? flip : [...flip, dirs[1 - i][1]],
2085
- recursion: true });
2087
+ offset: elOffset.reverse(),
2088
+ flip: flip === true ? flip : [...flip, dirs[1 - i][1]],
2089
+ recursion: true });
2086
2090
 
2087
2091
 
2088
- if (newPos && isInScrollArea(newPos, scrollElement, 1 - i)) {
2089
- return newPos;
2092
+ if (newPos && isInScrollArea(newPos, scrollElement, 1 - i)) {
2093
+ return newPos;
2094
+ }
2090
2095
  }
2091
2096
  }
2092
2097
 
@@ -2107,10 +2112,6 @@
2107
2112
  return offsetPosition;
2108
2113
  }
2109
2114
 
2110
- function moveBy(start, end, dim) {
2111
- return start === 'center' ? dim / 2 : start === end ? dim : 0;
2112
- }
2113
-
2114
2115
  function getIntersectionArea() {
2115
2116
  let area = {};for (var _len = arguments.length, rects = new Array(_len), _key = 0; _key < _len; _key++) {rects[_key] = arguments[_key];}
2116
2117
  for (const rect of rects) {
@@ -2948,7 +2949,7 @@
2948
2949
  UIkit.data = '__uikit__';
2949
2950
  UIkit.prefix = 'uk-';
2950
2951
  UIkit.options = {};
2951
- UIkit.version = '3.14.2-dev.e270e98f7';
2952
+ UIkit.version = '3.14.2-dev.f917389f5';
2952
2953
 
2953
2954
  globalAPI(UIkit);
2954
2955
  hooksAPI(UIkit);
@@ -3097,6 +3098,11 @@
3097
3098
  return Promise.reject();
3098
3099
  }
3099
3100
 
3101
+ if (!animate) {
3102
+ Animation.cancel(el);
3103
+ Transition.cancel(el);
3104
+ }
3105
+
3100
3106
  const promise = (
3101
3107
  isFunction(animate) ?
3102
3108
  animate :
@@ -3576,8 +3582,7 @@
3576
3582
  data: {
3577
3583
  pos: "bottom-" + (isRtl ? 'right' : 'left'),
3578
3584
  flip: true,
3579
- offset: false,
3580
- viewportPadding: 10 },
3585
+ offset: false },
3581
3586
 
3582
3587
 
3583
3588
  connected() {
@@ -3589,16 +3594,22 @@
3589
3594
  positionAt(element, target, boundary) {
3590
3595
  const [dir, align] = this.pos;
3591
3596
 
3592
- let { offset: offset$1 } = this;
3593
- if (!isNumeric(offset$1)) {
3594
- const node = $(offset$1);
3595
- offset$1 = node ?
3596
- offset(node)[this.axis === 'x' ? 'left' : 'top'] -
3597
- offset(target)[this.axis === 'x' ? 'right' : 'bottom'] :
3598
- 0;
3599
- }
3600
- offset$1 = toPx(offset$1) + toPx(getCssVar('position-offset', element));
3601
- offset$1 = [includes(['left', 'top'], dir) ? -offset$1 : +offset$1, 0];
3597
+ const mainAxisOffset =
3598
+ toPx(
3599
+ this.offset === false ? getCssVar('position-offset', element) : this.offset,
3600
+ this.axis === 'x' ? 'width' : 'height',
3601
+ element) * (
3602
+ includes(['left', 'top'], dir) ? -1 : 1);
3603
+
3604
+ const crossAxisOffset = includes(['center', 'justify'], align) ?
3605
+ 0 :
3606
+ toPx(
3607
+ getCssVar('position-shift-offset', element),
3608
+ this.axis === 'y' ? 'width' : 'height',
3609
+ element) * (
3610
+ includes(['left', 'top'], align) ? 1 : -1);
3611
+
3612
+ let offset = [mainAxisOffset, crossAxisOffset];
3602
3613
 
3603
3614
  const attach = {
3604
3615
  element: [flipPosition(dir), align],
@@ -3609,15 +3620,15 @@
3609
3620
  for (const prop in attach) {
3610
3621
  attach[prop] = attach[prop].reverse();
3611
3622
  }
3612
- offset$1 = offset$1.reverse();
3623
+ offset = offset.reverse();
3613
3624
  }
3614
3625
 
3615
3626
  positionAt(element, target, {
3616
3627
  attach,
3617
- offset: offset$1,
3628
+ offset,
3618
3629
  boundary,
3619
- viewportPadding: this.boundaryAlign ? 0 : this.viewportPadding,
3620
- flip: this.flip });
3630
+ flip: this.flip,
3631
+ viewportOffset: toPx(getCssVar('position-viewport-offset', element)) });
3621
3632
 
3622
3633
  } } };
3623
3634
 
@@ -3968,19 +3979,27 @@
3968
3979
  toggleClass(this.$el, this.clsDrop + "-boundary", this.boundaryAlign);
3969
3980
 
3970
3981
  const boundary = query(this.boundary, this.$el);
3971
- const [scrollParent] = scrollParents(this.$el);
3972
- const scrollParentOffset = offsetViewport(scrollParent);
3982
+ const scrollParentOffset = offset(
3983
+ scrollParents(boundary && this.boundaryAlign ? boundary : this.$el)[0]);
3984
+
3973
3985
  const boundaryOffset = boundary ? offset(boundary) : scrollParentOffset;
3974
3986
 
3975
3987
  css(this.$el, 'maxWidth', '');
3976
3988
  const maxWidth =
3977
- scrollParentOffset.width - (this.boundaryAlign ? 0 : 2 * this.viewportPadding);
3989
+ scrollParentOffset.width -
3990
+ 2 * toPx(getCssVar('position-viewport-offset', this.$el));
3978
3991
 
3979
3992
  if (this.pos[1] === 'justify') {
3980
3993
  const prop = this.axis === 'y' ? 'width' : 'height';
3981
- const targetOffset = offset(this.target);
3982
- const alignTo = this.boundaryAlign ? boundaryOffset : targetOffset;
3983
- css(this.$el, prop, alignTo[prop]);
3994
+ css(
3995
+ this.$el,
3996
+ prop,
3997
+ Math.min(
3998
+ (boundary ? boundaryOffset : offset(this.target))[prop],
3999
+ scrollParentOffset[prop] -
4000
+ 2 * toPx(getCssVar('position-viewport-offset', this.$el))));
4001
+
4002
+
3984
4003
  } else if (this.$el.offsetWidth > maxWidth) {
3985
4004
  addClass(this.$el, this.clsDrop + "-stack");
3986
4005
  }
@@ -4458,7 +4477,7 @@
4458
4477
  }
4459
4478
 
4460
4479
  var heightViewport = {
4461
- mixins: [Class, Resize],
4480
+ mixins: [Resize],
4462
4481
 
4463
4482
  props: {
4464
4483
  expand: Boolean,
@@ -7333,6 +7352,10 @@
7333
7352
  {
7334
7353
  name: 'click',
7335
7354
 
7355
+ filter() {
7356
+ return ['click', 'hover'].some((mode) => includes(this.mode, mode));
7357
+ },
7358
+
7336
7359
  handler(e) {
7337
7360
  let link;
7338
7361
  if (
@@ -9722,7 +9745,7 @@
9722
9745
 
9723
9746
 
9724
9747
  function ease(percent, easing) {
9725
- return easing >= 0 ? Math.pow(percent, easing + 1) : 1 - Math.pow(1 - percent, -easing + 1);
9748
+ return easing >= 0 ? Math.pow(percent, easing + 1) : 1 - Math.pow(1 - percent, 1 - easing);
9726
9749
  }
9727
9750
 
9728
9751
  // SVG elements do not inherit from HTMLElement