uikit 3.14.3 → 3.14.4-dev.07daf8fb8

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 (145) hide show
  1. package/CHANGELOG.md +54 -3
  2. package/build/util.js +1 -0
  3. package/dist/css/uikit-core-rtl.css +428 -95
  4. package/dist/css/uikit-core-rtl.min.css +1 -1
  5. package/dist/css/uikit-core.css +428 -95
  6. package/dist/css/uikit-core.min.css +1 -1
  7. package/dist/css/uikit-rtl.css +444 -108
  8. package/dist/css/uikit-rtl.min.css +1 -1
  9. package/dist/css/uikit.css +444 -108
  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 +7 -5
  14. package/dist/js/components/filter.min.js +1 -1
  15. package/dist/js/components/lightbox-panel.js +203 -76
  16. package/dist/js/components/lightbox-panel.min.js +1 -1
  17. package/dist/js/components/lightbox.js +203 -76
  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 +4 -5
  22. package/dist/js/components/parallax.min.js +1 -1
  23. package/dist/js/components/slider-parallax.js +4 -5
  24. package/dist/js/components/slider-parallax.min.js +1 -1
  25. package/dist/js/components/slider.js +22 -7
  26. package/dist/js/components/slider.min.js +1 -1
  27. package/dist/js/components/slideshow-parallax.js +4 -5
  28. package/dist/js/components/slideshow-parallax.min.js +1 -1
  29. package/dist/js/components/slideshow.js +22 -7
  30. package/dist/js/components/slideshow.min.js +1 -1
  31. package/dist/js/components/sortable.js +3 -3
  32. package/dist/js/components/sortable.min.js +1 -1
  33. package/dist/js/components/tooltip.js +138 -76
  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 +1801 -1573
  38. package/dist/js/uikit-core.min.js +14 -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 +1081 -836
  42. package/dist/js/uikit.min.js +14 -1
  43. package/package.json +1 -1
  44. package/src/images/{backgrounds/nav-parent-open.svg → components/nav-parent-icon-large.svg} +0 -0
  45. package/src/images/components/nav-parent-icon.svg +3 -0
  46. package/src/images/components/navbar-parent-icon.svg +3 -0
  47. package/src/images/components/navbar-toggle-icon.svg +22 -3
  48. package/src/js/api/state.js +2 -2
  49. package/src/js/components/filter.js +5 -3
  50. package/src/js/components/sortable.js +2 -3
  51. package/src/js/core/accordion.js +9 -17
  52. package/src/js/core/alert.js +35 -14
  53. package/src/js/core/drop.js +102 -48
  54. package/src/js/core/height-viewport.js +22 -9
  55. package/src/js/core/icon.js +16 -0
  56. package/src/js/core/index.js +2 -0
  57. package/src/js/core/leader.js +2 -2
  58. package/src/js/core/navbar.js +47 -33
  59. package/src/js/core/offcanvas.js +1 -47
  60. package/src/js/core/scroll.js +37 -10
  61. package/src/js/core/sticky.js +8 -9
  62. package/src/js/core/switcher.js +1 -1
  63. package/src/js/mixin/media.js +4 -5
  64. package/src/js/mixin/modal.js +97 -8
  65. package/src/js/mixin/position.js +59 -14
  66. package/src/js/mixin/slider-drag.js +20 -8
  67. package/src/js/mixin/style.js +11 -0
  68. package/src/js/mixin/togglable.js +100 -72
  69. package/src/js/util/animation.js +5 -3
  70. package/src/js/util/dimensions.js +6 -6
  71. package/src/js/util/filter.js +3 -7
  72. package/src/js/util/position.js +43 -47
  73. package/src/js/util/style.js +4 -13
  74. package/src/js/util/viewport.js +21 -37
  75. package/src/less/components/_import.less +1 -0
  76. package/src/less/components/drop.less +3 -6
  77. package/src/less/components/dropbar.less +115 -0
  78. package/src/less/components/dropdown.less +22 -6
  79. package/src/less/components/leader.less +1 -1
  80. package/src/less/components/margin.less +13 -14
  81. package/src/less/components/modal.less +19 -4
  82. package/src/less/components/nav.less +241 -64
  83. package/src/less/components/navbar.less +111 -35
  84. package/src/less/components/offcanvas.less +21 -21
  85. package/src/less/components/position.less +1 -1
  86. package/src/less/components/utility.less +21 -5
  87. package/src/less/theme/_import.less +1 -0
  88. package/src/less/theme/dropbar.less +44 -0
  89. package/src/less/theme/nav.less +43 -9
  90. package/src/less/theme/navbar.less +9 -15
  91. package/src/scss/components/_import.scss +1 -0
  92. package/src/scss/components/drop.scss +3 -6
  93. package/src/scss/components/dropbar.scss +115 -0
  94. package/src/scss/components/dropdown.scss +22 -6
  95. package/src/scss/components/leader.scss +1 -1
  96. package/src/scss/components/margin.scss +13 -14
  97. package/src/scss/components/modal.scss +19 -4
  98. package/src/scss/components/nav.scss +190 -52
  99. package/src/scss/components/navbar.scss +88 -24
  100. package/src/scss/components/offcanvas.scss +21 -21
  101. package/src/scss/components/position.scss +1 -1
  102. package/src/scss/components/utility.scss +19 -4
  103. package/src/scss/mixins-theme.scss +93 -29
  104. package/src/scss/mixins.scss +89 -15
  105. package/src/scss/theme/_import.scss +1 -0
  106. package/src/scss/theme/dropbar.scss +44 -0
  107. package/src/scss/theme/nav.scss +41 -9
  108. package/src/scss/theme/navbar.scss +9 -3
  109. package/src/scss/variables-theme.scss +93 -25
  110. package/src/scss/variables.scss +82 -23
  111. package/tests/accordion.html +2 -2
  112. package/tests/alert.html +2 -2
  113. package/tests/countdown.html +1 -1
  114. package/tests/drop.html +484 -255
  115. package/tests/dropbar.html +456 -0
  116. package/tests/dropdown.html +29 -189
  117. package/tests/filter.html +9 -12
  118. package/tests/form.html +1 -1
  119. package/tests/height-viewport.html +62 -0
  120. package/tests/index.html +126 -107
  121. package/tests/js/index.js +1 -4
  122. package/tests/lightbox.html +5 -5
  123. package/tests/list.html +8 -8
  124. package/tests/modal.html +13 -13
  125. package/tests/nav.html +117 -75
  126. package/tests/navbar.html +2270 -1104
  127. package/tests/offcanvas.html +25 -29
  128. package/tests/parallax.html +1 -1
  129. package/tests/position.html +13 -24
  130. package/tests/progress.html +9 -9
  131. package/tests/scroll.html +7 -10
  132. package/tests/search.html +5 -5
  133. package/tests/slider.html +6 -5
  134. package/tests/slideshow.html +8 -8
  135. package/tests/sortable.html +6 -8
  136. package/tests/sticky-navbar.html +132 -0
  137. package/tests/sticky.html +8 -8
  138. package/tests/switcher.html +1 -1
  139. package/tests/tab.html +1 -1
  140. package/tests/table.html +7 -7
  141. package/tests/toggle.html +2 -2
  142. package/tests/tooltip.html +1 -1
  143. package/tests/upload.html +11 -11
  144. package/tests/utility.html +19 -0
  145. package/src/images/backgrounds/nav-parent-close.svg +0 -3
package/dist/js/uikit.js CHANGED
@@ -1,4 +1,4 @@
1
- /*! UIkit 3.14.3 | https://www.getuikit.com | (c) 2014 - 2022 YOOtheme | MIT License */
1
+ /*! UIkit 3.14.4-dev.07daf8fb8 | 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() :
@@ -383,12 +383,8 @@
383
383
  }
384
384
 
385
385
  function closest(element, selector) {
386
- if (startsWith(selector, '>')) {
387
- selector = selector.slice(1);
388
- }
389
-
390
386
  return isElement(element) ?
391
- element.closest(selector) :
387
+ element.closest(startsWith(selector, '>') ? selector.slice(1) : selector) :
392
388
  toNodes(element).
393
389
  map((element) => closest(element, selector)).
394
390
  filter(Boolean);
@@ -396,8 +392,8 @@
396
392
 
397
393
  function within(element, selector) {
398
394
  return isString(selector) ?
399
- matches(element, selector) || !!closest(element, selector) :
400
- element === selector || toNode(selector).contains(toNode(element));
395
+ !!closest(element, selector) :
396
+ toNode(selector).contains(toNode(element));
401
397
  }
402
398
 
403
399
  function parents(element, selector) {
@@ -785,18 +781,11 @@
785
781
  return elements[0];
786
782
  }
787
783
 
788
- const propertyRe = /^\s*(["'])?(.*?)\1\s*$/;
789
- function getCssVar(name, element) {if (element === void 0) {element = document.documentElement;}
790
- return css(element, "--uk-" + name).replace(propertyRe, '$2');
791
- }
792
-
793
784
  // https://drafts.csswg.org/cssom/#dom-cssstyledeclaration-setproperty
794
785
  const propName = memoize((name) => vendorPropName(name));
795
786
 
796
- const cssPrefixes = ['webkit', 'moz'];
797
-
798
787
  function vendorPropName(name) {
799
- if (name[0] === '-') {
788
+ if (startsWith(name, '--')) {
800
789
  return name;
801
790
  }
802
791
 
@@ -808,11 +797,8 @@
808
797
  return name;
809
798
  }
810
799
 
811
- let i = cssPrefixes.length,
812
- prefixedName;
813
-
814
- while (i--) {
815
- prefixedName = "-" + cssPrefixes[i] + "-" + name;
800
+ for (const prefix of ['webkit', 'moz']) {
801
+ const prefixedName = "-" + prefix + "-" + name;
816
802
  if (prefixedName in style) {
817
803
  return prefixedName;
818
804
  }
@@ -868,6 +854,7 @@
868
854
  }
869
855
 
870
856
  function transition(element, props, duration, timing) {if (duration === void 0) {duration = 400;}if (timing === void 0) {timing = 'linear';}
857
+ duration = Math.round(duration);
871
858
  return Promise.all(
872
859
  toNodes(element).map(
873
860
  (element) =>
@@ -912,13 +899,14 @@
912
899
  const Transition = {
913
900
  start: transition,
914
901
 
915
- stop(element) {
902
+ async stop(element) {
916
903
  trigger(element, 'transitionend');
917
- return Promise.resolve();
904
+ await Promise.resolve();
918
905
  },
919
906
 
920
- cancel(element) {
907
+ async cancel(element) {
921
908
  trigger(element, 'transitioncanceled');
909
+ await Promise.resolve();
922
910
  },
923
911
 
924
912
  inProgress(element) {
@@ -928,7 +916,7 @@
928
916
 
929
917
  const animationPrefix = 'uk-animation-';
930
918
 
931
- function animate$1(element, animation, duration, origin, out) {if (duration === void 0) {duration = 200;}
919
+ function animate$2(element, animation, duration, origin, out) {if (duration === void 0) {duration = 200;}
932
920
  return Promise.all(
933
921
  toNodes(element).map(
934
922
  (element) =>
@@ -964,10 +952,10 @@
964
952
 
965
953
  const inProgress = new RegExp(animationPrefix + "(enter|leave)");
966
954
  const Animation = {
967
- in: animate$1,
955
+ in: animate$2,
968
956
 
969
957
  out(element, animation, duration, origin) {
970
- return animate$1(element, animation, duration, origin, true);
958
+ return animate$2(element, animation, duration, origin, true);
971
959
  },
972
960
 
973
961
  inProgress(element) {
@@ -1059,13 +1047,13 @@
1059
1047
  }
1060
1048
 
1061
1049
  function offsetPosition(element) {
1062
- const offset = [0, 0];
1063
-
1064
1050
  element = toNode(element);
1065
1051
 
1066
- do {
1067
- offset[0] += element.offsetTop;
1068
- offset[1] += element.offsetLeft;
1052
+ const offset = [element.offsetTop, element.offsetLeft];
1053
+
1054
+ while (element = element.offsetParent) {
1055
+ offset[0] += element.offsetTop + toFloat(css(element, "borderTopWidth"));
1056
+ offset[1] += element.offsetLeft + toFloat(css(element, "borderLeftWidth"));
1069
1057
 
1070
1058
  if (css(element, 'position') === 'fixed') {
1071
1059
  const win = toWindow(element);
@@ -1073,7 +1061,7 @@
1073
1061
  offset[1] += win.scrollX;
1074
1062
  return offset;
1075
1063
  }
1076
- } while (element = element.offsetParent);
1064
+ }
1077
1065
 
1078
1066
  return offset;
1079
1067
  }
@@ -1292,9 +1280,9 @@
1292
1280
  const hasTouch = inBrowser && 'ontouchstart' in window;
1293
1281
  const hasPointerEvents = inBrowser && window.PointerEvent;
1294
1282
 
1295
- const pointerDown = hasPointerEvents ? 'pointerdown' : hasTouch ? 'touchstart' : 'mousedown';
1296
- const pointerMove = hasPointerEvents ? 'pointermove' : hasTouch ? 'touchmove' : 'mousemove';
1297
- const pointerUp = hasPointerEvents ? 'pointerup' : hasTouch ? 'touchend' : 'mouseup';
1283
+ const pointerDown$1 = hasPointerEvents ? 'pointerdown' : hasTouch ? 'touchstart' : 'mousedown';
1284
+ const pointerMove$1 = hasPointerEvents ? 'pointermove' : hasTouch ? 'touchmove' : 'mousemove';
1285
+ const pointerUp$1 = hasPointerEvents ? 'pointerup' : hasTouch ? 'touchend' : 'mouseup';
1298
1286
  const pointerEnter = hasPointerEvents ? 'pointerenter' : hasTouch ? '' : 'mouseenter';
1299
1287
  const pointerLeave = hasPointerEvents ? 'pointerleave' : hasTouch ? '' : 'mouseleave';
1300
1288
  const pointerCancel = hasPointerEvents ? 'pointercancel' : 'touchcancel';
@@ -1794,20 +1782,6 @@
1794
1782
 
1795
1783
  }
1796
1784
 
1797
- function scrollTop(element, top) {
1798
- if (isWindow(element) || isDocument(element)) {
1799
- element = scrollingElement(element);
1800
- } else {
1801
- element = toNode(element);
1802
- }
1803
-
1804
- if (isUndefined(top)) {
1805
- return element.scrollTop;
1806
- } else {
1807
- element.scrollTop = top;
1808
- }
1809
- }
1810
-
1811
1785
  function scrollIntoView(element, _temp) {let { offset: offsetBy = 0 } = _temp === void 0 ? {} : _temp;
1812
1786
  const parents = isVisible(element) ? scrollParents(element) : [];
1813
1787
  return parents.reduce(
@@ -1849,7 +1823,7 @@
1849
1823
  (function step() {
1850
1824
  const percent = ease(clamp((Date.now() - start) / duration));
1851
1825
 
1852
- scrollTop(element, scroll + top * percent);
1826
+ element.scrollTop = scroll + top * percent;
1853
1827
 
1854
1828
  // scroll more if we have not reached our destination
1855
1829
  if (percent === 1) {
@@ -1887,7 +1861,7 @@
1887
1861
  return clamp((scrollTop - start) / (end - start));
1888
1862
  }
1889
1863
 
1890
- function scrollParents(element, overflowRe, scrollable) {if (overflowRe === void 0) {overflowRe = /auto|scroll|hidden/;}if (scrollable === void 0) {scrollable = false;}
1864
+ function scrollParents(element, overflowRe, scrollable) {if (overflowRe === void 0) {overflowRe = /auto|scroll|hidden|clip/;}if (scrollable === void 0) {scrollable = false;}
1891
1865
  const scrollEl = scrollingElement(element);
1892
1866
 
1893
1867
  let ancestors = parents(element).reverse();
@@ -1910,18 +1884,31 @@
1910
1884
  }
1911
1885
 
1912
1886
  function offsetViewport(scrollElement) {
1913
- let viewportElement = getViewport$1(scrollElement);
1887
+ const window = toWindow(scrollElement);
1888
+ const {
1889
+ document: { documentElement } } =
1890
+ window;
1891
+ let viewportElement =
1892
+ scrollElement === scrollingElement(scrollElement) ? window : scrollElement;
1893
+
1894
+ const { visualViewport } = window;
1895
+ if (isWindow(viewportElement) && visualViewport) {
1896
+ let { height, width, scale, pageTop: top, pageLeft: left } = visualViewport;
1897
+ height = Math.round(height * scale);
1898
+ width = Math.round(width * scale);
1899
+ return { height, width, top, left, bottom: top + height, right: left + width };
1900
+ }
1914
1901
 
1915
1902
  let rect = offset(viewportElement);
1916
1903
  for (let [prop, dir, start, end] of [
1917
1904
  ['width', 'x', 'left', 'right'],
1918
1905
  ['height', 'y', 'top', 'bottom']])
1919
1906
  {
1920
- if (!isWindow(viewportElement)) {
1921
- rect[start] += toFloat(css(viewportElement, "border" + ucfirst(start) + "Width"));
1922
- } else {
1907
+ if (isWindow(viewportElement)) {
1923
1908
  // iOS 12 returns <body> as scrollingElement
1924
- viewportElement = viewportElement.document.documentElement;
1909
+ viewportElement = documentElement;
1910
+ } else {
1911
+ rect[start] += toFloat(css(viewportElement, "border-" + start + "-width"));
1925
1912
  }
1926
1913
  rect[prop] = rect[dir] = viewportElement["client" + ucfirst(prop)];
1927
1914
  rect[end] = rect[prop] + rect[start];
@@ -1933,10 +1920,6 @@
1933
1920
  return toWindow(element).document.scrollingElement;
1934
1921
  }
1935
1922
 
1936
- function getViewport$1(scrollElement) {
1937
- return scrollElement === scrollingElement(scrollElement) ? window : scrollElement;
1938
- }
1939
-
1940
1923
  const dirs = [
1941
1924
  ['width', 'x', 'left', 'right'],
1942
1925
  ['height', 'y', 'top', 'bottom']];
@@ -1953,11 +1936,11 @@
1953
1936
  ...options };
1954
1937
 
1955
1938
 
1956
- const dim = options.flip ?
1957
- attachToWithFlip(element, target, options) :
1958
- attachTo(element, target, options);
1939
+ if (!isArray(target)) {
1940
+ target = [target, target];
1941
+ }
1959
1942
 
1960
- offset(element, dim);
1943
+ offset(element, getPosition(element, target, options));
1961
1944
  }
1962
1945
 
1963
1946
  function attachTo(element, target, options) {
@@ -1972,8 +1955,11 @@
1972
1955
 
1973
1956
 
1974
1957
  const position = offset(element);
1975
- const targetOffset = offset(target);
1958
+
1976
1959
  for (const [i, [prop, dir, start, end]] of Object.entries(dirs)) {
1960
+ const targetOffset =
1961
+ attach.target[i] === attach.element[i] ? offsetViewport(target[i]) : offset(target[i]);
1962
+
1977
1963
  position[start] = position[dir] =
1978
1964
  targetOffset[start] +
1979
1965
  moveBy(attach.target[i], end, targetOffset[prop]) -
@@ -1988,60 +1974,54 @@
1988
1974
  return start === 'center' ? dim / 2 : start === end ? dim : 0;
1989
1975
  }
1990
1976
 
1991
- function attachToWithFlip(element, target, options) {
1977
+ function getPosition(element, target, options) {
1992
1978
  const position = attachTo(element, target, options);
1993
- const targetDim = offset(target);
1994
1979
 
1995
1980
  let {
1996
1981
  flip,
1982
+ shift,
1997
1983
  attach: { element: elAttach, target: targetAttach },
1998
1984
  offset: elOffset,
1999
1985
  boundary,
2000
- viewport,
2001
1986
  viewportOffset } =
2002
1987
  options;
2003
1988
 
2004
- let viewports = scrollParents(element);
2005
- if (boundary === target) {
2006
- viewports = viewports.filter((viewport) => viewport !== boundary);
1989
+ if (!flip && !shift) {
1990
+ return position;
2007
1991
  }
2008
- const [scrollElement] = viewports;
2009
- viewports.push(viewport);
2010
1992
 
2011
1993
  const offsetPosition = { ...position };
2012
1994
  for (const [i, [prop, dir, start, end]] of Object.entries(dirs)) {
2013
- if (flip !== true && !includes(flip, dir)) {
2014
- continue;
2015
- }
1995
+ let viewports = scrollParents(target[i]);
1996
+ const [scrollElement] = viewports;
2016
1997
 
2017
- const willFlip =
2018
- !intersectLine(position, targetDim, i) && intersectLine(position, targetDim, 1 - i);
2019
-
2020
- viewport = getIntersectionArea(...viewports.filter(Boolean).map(offsetViewport));
1998
+ let viewport = getIntersectionArea(...viewports.map(offsetViewport));
2021
1999
 
2022
2000
  if (viewportOffset) {
2023
2001
  viewport[start] += viewportOffset;
2024
2002
  viewport[end] -= viewportOffset;
2025
2003
  }
2026
2004
 
2027
- if (boundary && !willFlip && position[prop] <= offset(boundary)[prop]) {
2028
- viewport = getIntersectionArea(viewport, offset(boundary));
2005
+ if (boundary) {
2006
+ viewport = getIntersectionArea(viewport, offsetViewport(boundary));
2029
2007
  }
2030
2008
 
2031
- const isInStartBoundary = position[start] >= viewport[start];
2032
- const isInEndBoundary = position[end] <= viewport[end];
2009
+ const isInStartViewport = position[start] >= viewport[start];
2010
+ const isInEndViewport = position[end] <= viewport[end];
2033
2011
 
2034
- if (isInStartBoundary && isInEndBoundary) {
2012
+ if (isInStartViewport && isInEndViewport) {
2035
2013
  continue;
2036
2014
  }
2037
2015
 
2038
- let offsetBy;
2016
+ let offsetBy = 0;
2017
+ const targetDim = offset(target[i]);
2039
2018
 
2040
2019
  // Flip
2041
- if (willFlip) {
2020
+ if (!intersectLine(position, targetDim, i) && intersectLine(position, targetDim, 1 - i)) {
2042
2021
  if (
2043
- elAttach[i] === end && isInStartBoundary ||
2044
- elAttach[i] === start && isInEndBoundary)
2022
+ !flip ||
2023
+ elAttach[i] === end && isInStartViewport ||
2024
+ elAttach[i] === start && isInEndViewport)
2045
2025
  {
2046
2026
  continue;
2047
2027
  }
@@ -2078,26 +2058,25 @@
2078
2058
  return false;
2079
2059
  }
2080
2060
 
2081
- if (flip === true || includes(flip, dirs[1 - i][1])) {
2082
- const newPos = attachToWithFlip(element, target, {
2083
- ...options,
2084
- attach: {
2085
- element: elAttach.map(flipDir).reverse(),
2086
- target: targetAttach.map(flipDir).reverse() },
2061
+ const newPos = getPosition(element, target, {
2062
+ ...options,
2063
+ attach: {
2064
+ element: elAttach.map(flipDir).reverse(),
2065
+ target: targetAttach.map(flipDir).reverse() },
2087
2066
 
2088
- offset: elOffset.reverse(),
2089
- flip: flip === true ? flip : [...flip, dirs[1 - i][1]],
2090
- recursion: true });
2067
+ offset: elOffset.reverse(),
2068
+ recursion: true });
2091
2069
 
2092
2070
 
2093
- if (newPos && isInScrollArea(newPos, scrollElement, 1 - i)) {
2094
- return newPos;
2095
- }
2071
+ if (newPos && isInScrollArea(newPos, scrollElement, 1 - i)) {
2072
+ return newPos;
2096
2073
  }
2074
+
2075
+ continue;
2097
2076
  }
2098
2077
 
2099
- // Move
2100
- } else {
2078
+ // Shift
2079
+ } else if (shift) {
2101
2080
  offsetBy =
2102
2081
  clamp(
2103
2082
  clamp(position[start], viewport[start], viewport[end] - position[prop]),
@@ -2153,7 +2132,7 @@
2153
2132
  getImage: getImage,
2154
2133
  transition: transition,
2155
2134
  Transition: Transition,
2156
- animate: animate$1,
2135
+ animate: animate$2,
2157
2136
  Animation: Animation,
2158
2137
  attr: attr,
2159
2138
  hasAttr: hasAttr,
@@ -2193,9 +2172,9 @@
2193
2172
  inBrowser: inBrowser,
2194
2173
  isRtl: isRtl,
2195
2174
  hasTouch: hasTouch,
2196
- pointerDown: pointerDown,
2197
- pointerMove: pointerMove,
2198
- pointerUp: pointerUp,
2175
+ pointerDown: pointerDown$1,
2176
+ pointerMove: pointerMove$1,
2177
+ pointerUp: pointerUp$1,
2199
2178
  pointerEnter: pointerEnter,
2200
2179
  pointerLeave: pointerLeave,
2201
2180
  pointerCancel: pointerCancel,
@@ -2283,10 +2262,8 @@
2283
2262
  findAll: findAll,
2284
2263
  escape: escape,
2285
2264
  css: css,
2286
- getCssVar: getCssVar,
2287
2265
  propName: propName,
2288
2266
  isInView: isInView,
2289
- scrollTop: scrollTop,
2290
2267
  scrollIntoView: scrollIntoView,
2291
2268
  scrolledOver: scrolledOver,
2292
2269
  scrollParents: scrollParents,
@@ -2609,7 +2586,7 @@
2609
2586
 
2610
2587
  value = props[key] === Boolean && value === '' ? true : coerce$1(props[key], value);
2611
2588
 
2612
- if (prop === 'target' && (!value || startsWith(value, '_'))) {
2589
+ if (prop === 'target' && startsWith(value, '_')) {
2613
2590
  continue;
2614
2591
  }
2615
2592
 
@@ -2620,7 +2597,7 @@
2620
2597
 
2621
2598
  for (const key in options) {
2622
2599
  const prop = camelize(key);
2623
- if (props[prop] !== undefined) {
2600
+ if (!isUndefined(props[prop])) {
2624
2601
  data$1[prop] = coerce$1(props[prop], options[key]);
2625
2602
  }
2626
2603
  }
@@ -2949,7 +2926,7 @@
2949
2926
  UIkit.data = '__uikit__';
2950
2927
  UIkit.prefix = 'uk-';
2951
2928
  UIkit.options = {};
2952
- UIkit.version = '3.14.3';
2929
+ UIkit.version = '3.14.4-dev.07daf8fb8';
2953
2930
 
2954
2931
  globalAPI(UIkit);
2955
2932
  hooksAPI(UIkit);
@@ -3054,27 +3031,7 @@
3054
3031
  origin: false,
3055
3032
  transition: 'ease',
3056
3033
  clsEnter: 'uk-togglabe-enter',
3057
- clsLeave: 'uk-togglabe-leave',
3058
-
3059
- initProps: {
3060
- overflow: '',
3061
- height: '',
3062
- paddingTop: '',
3063
- paddingBottom: '',
3064
- marginTop: '',
3065
- marginBottom: '',
3066
- boxShadow: '' },
3067
-
3068
-
3069
- hideProps: {
3070
- overflow: 'hidden',
3071
- height: 0,
3072
- paddingTop: 0,
3073
- paddingBottom: 0,
3074
- marginTop: 0,
3075
- marginBottom: 0,
3076
- boxShadow: 'none' } },
3077
-
3034
+ clsLeave: 'uk-togglabe-leave' },
3078
3035
 
3079
3036
 
3080
3037
  computed: {
@@ -3083,7 +3040,7 @@
3083
3040
  },
3084
3041
 
3085
3042
  hasTransition(_ref2) {let { animation } = _ref2;
3086
- return this.hasAnimation && animation[0] === true;
3043
+ return ['slide', 'reveal'].some((transition) => startsWith(animation[0], transition));
3087
3044
  } },
3088
3045
 
3089
3046
 
@@ -3098,18 +3055,13 @@
3098
3055
  return Promise.reject();
3099
3056
  }
3100
3057
 
3101
- if (!animate) {
3102
- Animation.cancel(el);
3103
- Transition.cancel(el);
3104
- }
3105
-
3106
3058
  const promise = (
3107
3059
  isFunction(animate) ?
3108
3060
  animate :
3109
3061
  animate === false || !this.hasAnimation ?
3110
- this._toggle :
3062
+ toggleInstant(this) :
3111
3063
  this.hasTransition ?
3112
- toggleHeight(this) :
3064
+ toggleTransition(this) :
3113
3065
  toggleAnimation(this))(
3114
3066
  el, show);
3115
3067
 
@@ -3173,54 +3125,105 @@
3173
3125
 
3174
3126
 
3175
3127
 
3176
- function toggleHeight(_ref3)
3177
-
3128
+ function toggleInstant(_ref3) {let { _toggle } = _ref3;
3129
+ return (el, show) => {
3130
+ Animation.cancel(el);
3131
+ Transition.cancel(el);
3132
+ return _toggle(el, show);
3133
+ };
3134
+ }
3178
3135
 
3136
+ function toggleTransition(cmp) {var _cmp$animation$;
3137
+ const [mode = 'reveal', startProp = 'top'] = ((_cmp$animation$ = cmp.animation[0]) == null ? void 0 : _cmp$animation$.split('-')) || [];
3179
3138
 
3139
+ const dirs = [
3140
+ ['left', 'right'],
3141
+ ['top', 'bottom']];
3180
3142
 
3143
+ const dir = dirs[includes(dirs[0], startProp) ? 0 : 1];
3144
+ const end = dir[1] === startProp;
3145
+ const props = ['width', 'height'];
3146
+ const dimProp = props[dirs.indexOf(dir)];
3147
+ const marginProp = "margin-" + dir[0];
3148
+ const marginStartProp = "margin-" + startProp;
3181
3149
 
3150
+ return async (el, show) => {
3151
+ let { duration, velocity, transition, _toggle } = cmp;
3182
3152
 
3153
+ let currentDim = dimensions$1(el)[dimProp];
3183
3154
 
3184
- {let { isToggled, duration, velocity, initProps, hideProps, transition, _toggle } = _ref3;
3185
- return (el, show) => {
3186
3155
  const inProgress = Transition.inProgress(el);
3187
- const inner = el.hasChildNodes() ?
3188
- toFloat(css(el.firstElementChild, 'marginTop')) +
3189
- toFloat(css(el.lastElementChild, 'marginBottom')) :
3190
- 0;
3191
- const currentHeight = isVisible(el) ? height(el) + (inProgress ? 0 : inner) : 0;
3156
+ await Transition.cancel(el);
3192
3157
 
3193
- Transition.cancel(el);
3194
-
3195
- if (!isToggled(el)) {
3158
+ if (show) {
3196
3159
  _toggle(el, true);
3197
3160
  }
3198
3161
 
3199
- height(el, '');
3162
+ const prevProps = Object.fromEntries(
3163
+ ['padding', 'border', 'width', 'height', 'overflow', marginProp, marginStartProp].map(
3164
+ (key) => [key, el.style[key]]));
3200
3165
 
3201
- // Update child components first
3202
- fastdom.flush();
3203
3166
 
3204
- const endHeight = height(el) + (inProgress ? 0 : inner);
3205
- duration = velocity * el.offsetHeight + duration;
3206
3167
 
3207
- height(el, currentHeight);
3168
+ const dim = dimensions$1(el);
3169
+ const currentMargin = toFloat(css(el, marginProp));
3170
+ const marginStart = toFloat(css(el, marginStartProp));
3171
+ const endDim = dim[dimProp] + marginStart;
3208
3172
 
3209
- return (
3210
- show ?
3211
- Transition.start(
3212
- el,
3213
- { ...initProps, overflow: 'hidden', height: endHeight },
3214
- Math.round(duration * (1 - currentHeight / endHeight)),
3215
- transition) :
3173
+ if (!inProgress && !show) {
3174
+ currentDim += marginStart;
3175
+ }
3216
3176
 
3217
- Transition.start(
3218
- el,
3219
- hideProps,
3220
- Math.round(duration * (currentHeight / endHeight)),
3221
- transition).
3222
- then(() => _toggle(el, false))).
3223
- then(() => css(el, initProps));
3177
+ const [wrapper] = wrapInner(el, '<div>');
3178
+ css(wrapper, {
3179
+ boxSizing: 'border-box',
3180
+ height: dim.height,
3181
+ width: dim.width,
3182
+ ...css(el, [
3183
+ 'padding',
3184
+ 'borderTop',
3185
+ 'borderRight',
3186
+ 'borderBottom',
3187
+ 'borderLeft',
3188
+ 'borderImage',
3189
+ marginStartProp]) });
3190
+
3191
+
3192
+
3193
+ css(el, {
3194
+ padding: 0,
3195
+ border: 0,
3196
+ [marginStartProp]: 0,
3197
+ width: dim.width,
3198
+ height: dim.height,
3199
+ overflow: 'hidden',
3200
+ [dimProp]: currentDim });
3201
+
3202
+
3203
+ const percent = currentDim / endDim;
3204
+ duration = (velocity * endDim + duration) * (show ? 1 - percent : percent);
3205
+ const endProps = { [dimProp]: show ? endDim : 0 };
3206
+
3207
+ if (end) {
3208
+ css(el, marginProp, endDim - currentDim + currentMargin);
3209
+ endProps[marginProp] = show ? currentMargin : endDim + currentMargin;
3210
+ }
3211
+
3212
+ if (!end ^ mode === 'reveal') {
3213
+ css(wrapper, marginProp, -endDim + currentDim);
3214
+ Transition.start(wrapper, { [marginProp]: show ? 0 : -endDim }, duration, transition);
3215
+ }
3216
+
3217
+ try {
3218
+ await Transition.start(el, endProps, duration, transition);
3219
+ } finally {
3220
+ css(el, prevProps);
3221
+ unwrap(wrapper.firstChild);
3222
+
3223
+ if (!show) {
3224
+ _toggle(el, false);
3225
+ }
3226
+ }
3224
3227
  };
3225
3228
  }
3226
3229
 
@@ -3245,6 +3248,7 @@
3245
3248
  mixins: [Class, Lazyload, Togglable],
3246
3249
 
3247
3250
  props: {
3251
+ animation: Boolean,
3248
3252
  targets: String,
3249
3253
  active: null,
3250
3254
  collapsible: Boolean,
@@ -3257,7 +3261,7 @@
3257
3261
  data: {
3258
3262
  targets: '> *',
3259
3263
  active: false,
3260
- animation: [true],
3264
+ animation: true,
3261
3265
  collapsible: true,
3262
3266
  multiple: false,
3263
3267
  clsOpen: 'uk-open',
@@ -3303,7 +3307,7 @@
3303
3307
  hide(
3304
3308
  el,
3305
3309
  !hasClass(
3306
- this.items.find((item) => item.contains(el)),
3310
+ this.items.find((item) => within(el, item)),
3307
3311
  this.clsOpen));
3308
3312
 
3309
3313
 
@@ -3355,23 +3359,15 @@
3355
3359
  toggleClass(el, this.clsOpen, show);
3356
3360
  attr($(this.$props.toggle, el), 'aria-expanded', show);
3357
3361
 
3358
- const content = $("" + (el._wrapper ? '> * ' : '') + this.content, el);
3362
+ const content = $(this.content, el);
3359
3363
 
3360
- if (animate === false || !this.hasTransition) {
3364
+ if (animate === false || !this.animation) {
3365
+ content.hidden = !show;
3361
3366
  hide(content, !show);
3362
3367
  return;
3363
3368
  }
3364
3369
 
3365
- if (!el._wrapper) {
3366
- el._wrapper = wrapAll(content, "<div" + (show ? ' hidden' : '') + ">");
3367
- }
3368
-
3369
- hide(content, false);
3370
- await toggleHeight(this)(el._wrapper, show);
3371
- hide(content, !show);
3372
-
3373
- delete el._wrapper;
3374
- unwrap(content);
3370
+ await toggleTransition(this)(content, show);
3375
3371
 
3376
3372
  if (show) {
3377
3373
  const toggle = $(this.$props.toggle, el);
@@ -3397,18 +3393,17 @@
3397
3393
  args: 'animation',
3398
3394
 
3399
3395
  props: {
3396
+ animation: Boolean,
3400
3397
  close: String },
3401
3398
 
3402
3399
 
3403
3400
  data: {
3404
- animation: [true],
3401
+ animation: true,
3405
3402
  selClose: '.uk-alert-close',
3406
- duration: 150,
3407
- hideProps: { opacity: 0, ...Togglable.data.hideProps } },
3403
+ duration: 150 },
3408
3404
 
3409
3405
 
3410
- events: [
3411
- {
3406
+ events: {
3412
3407
  name: 'click',
3413
3408
 
3414
3409
  delegate() {
@@ -3418,16 +3413,39 @@
3418
3413
  handler(e) {
3419
3414
  e.preventDefault();
3420
3415
  this.close();
3421
- } }],
3422
-
3416
+ } },
3423
3417
 
3424
3418
 
3425
3419
  methods: {
3426
3420
  async close() {
3427
- await this.toggleElement(this.$el);
3421
+ await this.toggleElement(this.$el, false, animate$1(this));
3428
3422
  this.$destroy(true);
3429
3423
  } } };
3430
3424
 
3425
+
3426
+
3427
+ function animate$1(_ref) {let { duration, transition, velocity } = _ref;
3428
+ return (el) => {
3429
+ const height = toFloat(css(el, 'height'));
3430
+ css(el, 'height', height);
3431
+ return Transition.start(
3432
+ el,
3433
+ {
3434
+ height: 0,
3435
+ marginTop: 0,
3436
+ marginBottom: 0,
3437
+ paddingTop: 0,
3438
+ paddingBottom: 0,
3439
+ borderTop: 0,
3440
+ borderBottom: 0,
3441
+ opacity: 0 },
3442
+
3443
+ velocity * height + duration,
3444
+ transition);
3445
+
3446
+ };
3447
+ }
3448
+
3431
3449
  var Video = {
3432
3450
  args: 'autoplay',
3433
3451
 
@@ -3576,34 +3594,32 @@
3576
3594
  props: {
3577
3595
  pos: String,
3578
3596
  offset: null,
3579
- flip: Boolean },
3597
+ flip: Boolean,
3598
+ shift: Boolean,
3599
+ inset: Boolean },
3580
3600
 
3581
3601
 
3582
3602
  data: {
3583
3603
  pos: "bottom-" + (isRtl ? 'right' : 'left'),
3604
+ offset: false,
3584
3605
  flip: true,
3585
- offset: false },
3606
+ shift: true,
3607
+ inset: false },
3586
3608
 
3587
3609
 
3588
3610
  connected() {
3589
3611
  this.pos = this.$props.pos.split('-').concat('center').slice(0, 2);
3590
- this.axis = includes(['top', 'bottom'], this.pos[0]) ? 'y' : 'x';
3612
+ [this.dir, this.align] = this.pos;
3613
+ this.axis = includes(['top', 'bottom'], this.dir) ? 'y' : 'x';
3591
3614
  },
3592
3615
 
3593
3616
  methods: {
3594
3617
  positionAt(element, target, boundary) {
3595
- const [dir, align] = this.pos;
3596
-
3597
- let offset = toPx(
3598
- this.offset === false ? getCssVar('position-offset', element) : this.offset,
3599
- this.axis === 'x' ? 'width' : 'height',
3600
- element);
3601
-
3602
- offset = [includes(['left', 'top'], dir) ? -offset : +offset, 0];
3618
+ let offset = [this.getPositionOffset(element), this.getShiftOffset(element)];
3603
3619
 
3604
3620
  const attach = {
3605
- element: [flipPosition(dir), align],
3606
- target: [dir, align] };
3621
+ element: [this.inset ? this.dir : flipPosition(this.dir), this.align],
3622
+ target: [this.dir, this.align] };
3607
3623
 
3608
3624
 
3609
3625
  if (this.axis === 'y') {
@@ -3613,71 +3629,100 @@
3613
3629
  offset = offset.reverse();
3614
3630
  }
3615
3631
 
3632
+ const [scrollElement] = scrollParents(element, /auto|scroll/);
3633
+ const { scrollTop, scrollLeft } = scrollElement;
3634
+
3635
+ // Ensure none positioned element does not generate scrollbars
3636
+ const elDim = dimensions$1(element);
3637
+ css(element, { top: -elDim.height, left: -elDim.width });
3638
+
3616
3639
  positionAt(element, target, {
3617
3640
  attach,
3618
3641
  offset,
3619
3642
  boundary,
3620
3643
  flip: this.flip,
3621
- viewportOffset: toPx(getCssVar('position-viewport-offset', element)) });
3644
+ shift: this.shift,
3645
+ viewportOffset: this.getViewportOffset(element) });
3646
+
3647
+
3648
+ // Restore scroll position
3649
+ scrollElement.scrollTop = scrollTop;
3650
+ scrollElement.scrollLeft = scrollLeft;
3651
+ },
3652
+
3653
+ getPositionOffset(element) {
3654
+ return (
3655
+ toPx(
3656
+ this.offset === false ? css(element, '--uk-position-offset') : this.offset,
3657
+ this.axis === 'x' ? 'width' : 'height',
3658
+ element) * (
3622
3659
 
3660
+ includes(['left', 'top'], this.dir) ? -1 : 1) * (
3661
+ this.inset ? -1 : 1));
3662
+
3663
+ },
3664
+
3665
+ getShiftOffset(element) {
3666
+ return this.align === 'center' ?
3667
+ 0 :
3668
+ toPx(
3669
+ css(element, '--uk-position-shift-offset'),
3670
+ this.axis === 'y' ? 'width' : 'height',
3671
+ element) * (
3672
+ includes(['left', 'top'], this.align) ? 1 : -1);
3673
+ },
3674
+
3675
+ getViewportOffset(element) {
3676
+ return toPx(css(element, '--uk-position-viewport-offset'));
3623
3677
  } } };
3624
3678
 
3625
- let active$1;
3679
+ var Style = {
3680
+ beforeConnect() {
3681
+ this._style = attr(this.$el, 'style');
3682
+ },
3683
+
3684
+ disconnected() {
3685
+ attr(this.$el, 'style', this._style);
3686
+ } };
3626
3687
 
3627
- var drop = {
3628
- mixins: [Container, Lazyload, Position, Togglable],
3688
+ const active$1 = [];
3629
3689
 
3630
- args: 'pos',
3690
+ var Modal = {
3691
+ mixins: [Class, Container, Togglable],
3631
3692
 
3632
3693
  props: {
3633
- mode: 'list',
3634
- toggle: Boolean,
3635
- boundary: Boolean,
3636
- boundaryAlign: Boolean,
3637
- delayShow: Number,
3638
- delayHide: Number,
3639
- display: String,
3640
- clsDrop: String },
3694
+ selPanel: String,
3695
+ selClose: String,
3696
+ escClose: Boolean,
3697
+ bgClose: Boolean,
3698
+ stack: Boolean },
3641
3699
 
3642
3700
 
3643
3701
  data: {
3644
- mode: ['click', 'hover'],
3645
- toggle: '- *',
3646
- boundary: true,
3647
- boundaryAlign: false,
3648
- delayShow: 0,
3649
- delayHide: 800,
3650
- display: null,
3651
- clsDrop: false,
3652
- animation: ['uk-animation-fade'],
3653
3702
  cls: 'uk-open',
3654
- container: false },
3703
+ escClose: true,
3704
+ bgClose: true,
3705
+ overlay: true,
3706
+ stack: false },
3655
3707
 
3656
3708
 
3657
- created() {
3658
- this.tracker = new MouseTracker();
3659
- },
3709
+ computed: {
3710
+ panel(_ref, $el) {let { selPanel } = _ref;
3711
+ return $(selPanel, $el);
3712
+ },
3660
3713
 
3661
- beforeConnect() {
3662
- this.clsDrop = this.$props.clsDrop || "uk-" + this.$options.name;
3663
- },
3714
+ transitionElement() {
3715
+ return this.panel;
3716
+ },
3664
3717
 
3665
- connected() {
3666
- addClass(this.$el, this.clsDrop);
3718
+ bgClose(_ref2) {let { bgClose } = _ref2;
3719
+ return bgClose && this.panel;
3720
+ } },
3667
3721
 
3668
- if (this.toggle && !this.target) {
3669
- this.target = this.$create('toggle', query(this.toggle, this.$el), {
3670
- target: this.$el,
3671
- mode: this.mode }).
3672
- $el;
3673
- attr(this.target, 'aria-haspopup', true);
3674
- this.lazyload(this.target);
3675
- }
3676
- },
3677
3722
 
3678
- disconnected() {
3679
- if (this.isActive()) {
3680
- active$1 = null;
3723
+ beforeDisconnect() {
3724
+ if (includes(active$1, this)) {
3725
+ this.toggleElement(this.$el, false, false);
3681
3726
  }
3682
3727
  },
3683
3728
 
@@ -3686,100 +3731,477 @@
3686
3731
  name: 'click',
3687
3732
 
3688
3733
  delegate() {
3689
- return "." + this.clsDrop + "-close";
3734
+ return this.selClose;
3690
3735
  },
3691
3736
 
3692
3737
  handler(e) {
3693
3738
  e.preventDefault();
3694
- this.hide(false);
3739
+ this.hide();
3695
3740
  } },
3696
3741
 
3697
3742
 
3698
3743
  {
3699
- name: 'click',
3744
+ name: 'toggle',
3700
3745
 
3701
- delegate() {
3702
- return 'a[href^="#"]';
3703
- },
3746
+ self: true,
3704
3747
 
3705
- handler(_ref) {let { defaultPrevented, current: { hash } } = _ref;
3706
- if (!defaultPrevented && hash && !within(hash, this.$el)) {
3707
- this.hide(false);
3748
+ handler(e) {
3749
+ if (e.defaultPrevented) {
3750
+ return;
3708
3751
  }
3709
- } },
3710
3752
 
3753
+ e.preventDefault();
3711
3754
 
3712
- {
3713
- name: 'beforescroll',
3714
-
3715
- handler() {
3716
- this.hide(false);
3755
+ if (this.isToggled() === includes(active$1, this)) {
3756
+ this.toggle();
3757
+ }
3717
3758
  } },
3718
3759
 
3719
3760
 
3720
3761
  {
3721
- name: 'toggle',
3762
+ name: 'beforeshow',
3722
3763
 
3723
3764
  self: true,
3724
3765
 
3725
- handler(e, toggle) {
3726
- e.preventDefault();
3766
+ handler(e) {
3767
+ if (includes(active$1, this)) {
3768
+ return false;
3769
+ }
3727
3770
 
3728
- if (this.isToggled()) {
3729
- this.hide(false);
3771
+ if (!this.stack && active$1.length) {
3772
+ Promise.all(active$1.map((modal) => modal.hide())).then(this.show);
3773
+ e.preventDefault();
3730
3774
  } else {
3731
- this.show(toggle == null ? void 0 : toggle.$el, false);
3775
+ active$1.push(this);
3732
3776
  }
3733
3777
  } },
3734
3778
 
3735
3779
 
3736
3780
  {
3737
- name: 'toggleshow',
3781
+ name: 'show',
3738
3782
 
3739
3783
  self: true,
3740
3784
 
3741
- handler(e, toggle) {
3742
- e.preventDefault();
3743
- this.show(toggle == null ? void 0 : toggle.$el);
3744
- } },
3745
-
3746
-
3747
- {
3748
- name: 'togglehide',
3785
+ handler() {
3786
+ once(
3787
+ this.$el,
3788
+ 'hide',
3789
+ on(document, 'focusin', (e) => {
3790
+ if (last(active$1) === this && !within(e.target, this.$el)) {
3791
+ this.$el.focus();
3792
+ }
3793
+ }));
3749
3794
 
3750
- self: true,
3751
3795
 
3752
- handler(e) {
3753
- e.preventDefault();
3754
- if (!matches(this.$el, ':focus,:hover')) {
3755
- this.hide();
3796
+ if (this.overlay) {
3797
+ once(this.$el, 'hidden', preventOverscroll(this.$el));
3798
+ once(this.$el, 'hidden', preventBackgroundScroll());
3756
3799
  }
3757
- } },
3758
-
3759
-
3760
- {
3761
- name: pointerEnter + " focusin",
3762
-
3763
- filter() {
3764
- return includes(this.mode, 'hover');
3765
- },
3766
3800
 
3767
- handler(e) {
3768
- if (!isTouch(e)) {
3769
- this.clearTimers();
3801
+ if (this.stack) {
3802
+ css(this.$el, 'zIndex', toFloat(css(this.$el, 'zIndex')) + active$1.length);
3770
3803
  }
3771
- } },
3772
-
3773
3804
 
3774
- {
3775
- name: pointerLeave + " focusout",
3776
-
3777
- filter() {
3778
- return includes(this.mode, 'hover');
3779
- },
3805
+ addClass(document.documentElement, this.clsPage);
3780
3806
 
3781
- handler(e) {
3782
- if (!isTouch(e) && e.relatedTarget) {
3807
+ if (this.bgClose) {
3808
+ once(
3809
+ this.$el,
3810
+ 'hide',
3811
+ on(document, pointerDown$1, (_ref3) => {let { target } = _ref3;
3812
+ if (
3813
+ last(active$1) !== this ||
3814
+ this.overlay && !within(target, this.$el) ||
3815
+ within(target, this.panel))
3816
+ {
3817
+ return;
3818
+ }
3819
+
3820
+ once(
3821
+ document,
3822
+ pointerUp$1 + " " + pointerCancel + " scroll",
3823
+ (_ref4) => {let { defaultPrevented, type, target: newTarget } = _ref4;
3824
+ if (
3825
+ !defaultPrevented &&
3826
+ type === pointerUp$1 &&
3827
+ target === newTarget)
3828
+ {
3829
+ this.hide();
3830
+ }
3831
+ },
3832
+ true);
3833
+
3834
+ }),
3835
+ { self: true });
3836
+
3837
+ }
3838
+
3839
+ if (this.escClose) {
3840
+ once(
3841
+ this.$el,
3842
+ 'hide',
3843
+ on(document, 'keydown', (e) => {
3844
+ if (e.keyCode === 27 && last(active$1) === this) {
3845
+ this.hide();
3846
+ }
3847
+ }),
3848
+ { self: true });
3849
+
3850
+ }
3851
+ } },
3852
+
3853
+
3854
+ {
3855
+ name: 'shown',
3856
+
3857
+ self: true,
3858
+
3859
+ handler() {
3860
+ if (!isFocusable(this.$el)) {
3861
+ attr(this.$el, 'tabindex', '-1');
3862
+ }
3863
+
3864
+ if (!$(':focus', this.$el)) {
3865
+ this.$el.focus();
3866
+ }
3867
+ } },
3868
+
3869
+
3870
+ {
3871
+ name: 'hidden',
3872
+
3873
+ self: true,
3874
+
3875
+ handler() {
3876
+ if (includes(active$1, this)) {
3877
+ active$1.splice(active$1.indexOf(this), 1);
3878
+ }
3879
+
3880
+ css(this.$el, 'zIndex', '');
3881
+
3882
+ if (!active$1.some((modal) => modal.clsPage === this.clsPage)) {
3883
+ removeClass(document.documentElement, this.clsPage);
3884
+ }
3885
+ } }],
3886
+
3887
+
3888
+
3889
+ methods: {
3890
+ toggle() {
3891
+ return this.isToggled() ? this.hide() : this.show();
3892
+ },
3893
+
3894
+ show() {
3895
+ if (this.container && parent(this.$el) !== this.container) {
3896
+ append(this.container, this.$el);
3897
+ return new Promise((resolve) =>
3898
+ requestAnimationFrame(() => this.show().then(resolve)));
3899
+
3900
+ }
3901
+
3902
+ return this.toggleElement(this.$el, true, animate(this));
3903
+ },
3904
+
3905
+ hide() {
3906
+ return this.toggleElement(this.$el, false, animate(this));
3907
+ } } };
3908
+
3909
+
3910
+
3911
+ function animate(_ref5) {let { transitionElement, _toggle } = _ref5;
3912
+ return (el, show) =>
3913
+ new Promise((resolve, reject) =>
3914
+ once(el, 'show hide', () => {
3915
+ el._reject == null ? void 0 : el._reject();
3916
+ el._reject = reject;
3917
+
3918
+ _toggle(el, show);
3919
+
3920
+ const off = once(
3921
+ transitionElement,
3922
+ 'transitionstart',
3923
+ () => {
3924
+ once(transitionElement, 'transitionend transitioncancel', resolve, {
3925
+ self: true });
3926
+
3927
+ clearTimeout(timer);
3928
+ },
3929
+ { self: true });
3930
+
3931
+
3932
+ const timer = setTimeout(() => {
3933
+ off();
3934
+ resolve();
3935
+ }, toMs(css(transitionElement, 'transitionDuration')));
3936
+ })).
3937
+ then(() => delete el._reject);
3938
+ }
3939
+
3940
+ function toMs(time) {
3941
+ return time ? endsWith(time, 'ms') ? toFloat(time) : toFloat(time) * 1000 : 0;
3942
+ }
3943
+
3944
+ function preventOverscroll(el) {
3945
+ if (CSS.supports('overscroll-behavior', 'contain')) {
3946
+ const elements = filterChildren(el, (child) => /auto|scroll/.test(css(child, 'overflow')));
3947
+ css(elements, 'overscrollBehavior', 'contain');
3948
+ return () => css(elements, 'overscrollBehavior', '');
3949
+ }
3950
+
3951
+ let startClientY;
3952
+
3953
+ const events = [
3954
+ on(
3955
+ el,
3956
+ 'touchstart',
3957
+ (_ref6) => {let { targetTouches } = _ref6;
3958
+ if (targetTouches.length === 1) {
3959
+ startClientY = targetTouches[0].clientY;
3960
+ }
3961
+ },
3962
+ { passive: true }),
3963
+
3964
+
3965
+ on(
3966
+ el,
3967
+ 'touchmove',
3968
+ (e) => {
3969
+ if (e.targetTouches.length !== 1) {
3970
+ return;
3971
+ }
3972
+
3973
+ let [scrollParent] = scrollParents(e.target, /auto|scroll/);
3974
+ if (!within(scrollParent, el)) {
3975
+ scrollParent = el;
3976
+ }
3977
+
3978
+ const clientY = e.targetTouches[0].clientY - startClientY;
3979
+ const { scrollTop, scrollHeight, clientHeight } = scrollParent;
3980
+
3981
+ if (
3982
+ clientHeight >= scrollHeight ||
3983
+ scrollTop === 0 && clientY > 0 ||
3984
+ scrollHeight - scrollTop <= clientHeight && clientY < 0)
3985
+ {
3986
+ e.cancelable && e.preventDefault();
3987
+ }
3988
+ },
3989
+ { passive: false })];
3990
+
3991
+
3992
+
3993
+ return () => events.forEach((fn) => fn());
3994
+ }
3995
+
3996
+ let prevented;
3997
+ function preventBackgroundScroll() {
3998
+ if (prevented) {
3999
+ return noop;
4000
+ }
4001
+ prevented = true;
4002
+ const { body, documentElement } = document;
4003
+ css(body, {
4004
+ overflowY: width(window) > documentElement.clientWidth ? 'scroll' : '',
4005
+ touchAction: 'none' });
4006
+
4007
+ css(documentElement, 'overflowY', 'hidden');
4008
+ return () => {
4009
+ prevented = false;
4010
+ css(documentElement, 'overflowY', '');
4011
+ css(body, { overflowY: '', touchAction: '' });
4012
+ };
4013
+ }
4014
+
4015
+ function filterChildren(el, fn) {
4016
+ const children = [];
4017
+ apply(el, (node) => {
4018
+ if (fn(node)) {
4019
+ children.push(node);
4020
+ }
4021
+ });
4022
+ return children;
4023
+ }
4024
+
4025
+ let active;
4026
+
4027
+ var drop = {
4028
+ mixins: [Container, Lazyload, Position, Style, Togglable],
4029
+
4030
+ args: 'pos',
4031
+
4032
+ props: {
4033
+ mode: 'list',
4034
+ toggle: Boolean,
4035
+ boundary: Boolean,
4036
+ target: Boolean,
4037
+ targetX: Boolean,
4038
+ targetY: Boolean,
4039
+ stretch: Boolean,
4040
+ delayShow: Number,
4041
+ delayHide: Number,
4042
+ display: String,
4043
+ clsDrop: String,
4044
+ animateOut: Boolean,
4045
+ bgScroll: Boolean },
4046
+
4047
+
4048
+ data: {
4049
+ mode: ['click', 'hover'],
4050
+ toggle: '- *',
4051
+ boundary: false,
4052
+ target: false,
4053
+ targetX: false,
4054
+ targetY: false,
4055
+ stretch: false,
4056
+ delayShow: 0,
4057
+ delayHide: 800,
4058
+ display: null,
4059
+ clsDrop: false,
4060
+ animateOut: false,
4061
+ bgScroll: true,
4062
+ animation: ['uk-animation-fade'],
4063
+ cls: 'uk-open',
4064
+ container: false },
4065
+
4066
+
4067
+ computed: {
4068
+ target(_ref, $el) {let { target, targetX, targetY } = _ref;
4069
+ targetX = targetX || target || this.targetEl;
4070
+ targetY = targetY || target || this.targetEl;
4071
+
4072
+ return [
4073
+ targetX === true ? window : query(targetX, $el),
4074
+ targetY === true ? window : query(targetY, $el)];
4075
+
4076
+ } },
4077
+
4078
+
4079
+ created() {
4080
+ this.tracker = new MouseTracker();
4081
+ },
4082
+
4083
+ beforeConnect() {
4084
+ this.clsDrop = this.$props.clsDrop || "uk-" + this.$options.name;
4085
+ },
4086
+
4087
+ connected() {
4088
+ addClass(this.$el, this.clsDrop);
4089
+
4090
+ if (this.toggle && !this.targetEl) {
4091
+ this.targetEl = this.$create('toggle', query(this.toggle, this.$el), {
4092
+ target: this.$el,
4093
+ mode: this.mode }).
4094
+ $el;
4095
+ attr(this.targetEl, 'aria-haspopup', true);
4096
+ this.lazyload(this.targetEl);
4097
+ }
4098
+ },
4099
+
4100
+ disconnected() {
4101
+ if (this.isActive()) {
4102
+ active = null;
4103
+ }
4104
+ },
4105
+
4106
+ events: [
4107
+ {
4108
+ name: 'click',
4109
+
4110
+ delegate() {
4111
+ return "." + this.clsDrop + "-close";
4112
+ },
4113
+
4114
+ handler(e) {
4115
+ e.preventDefault();
4116
+ this.hide(false);
4117
+ } },
4118
+
4119
+
4120
+ {
4121
+ name: 'click',
4122
+
4123
+ delegate() {
4124
+ return 'a[href^="#"]';
4125
+ },
4126
+
4127
+ handler(_ref2) {let { defaultPrevented, current: { hash } } = _ref2;
4128
+ if (!defaultPrevented && hash && !within(hash, this.$el)) {
4129
+ this.hide(false);
4130
+ }
4131
+ } },
4132
+
4133
+
4134
+ {
4135
+ name: 'beforescroll',
4136
+
4137
+ handler() {
4138
+ this.hide(false);
4139
+ } },
4140
+
4141
+
4142
+ {
4143
+ name: 'toggle',
4144
+
4145
+ self: true,
4146
+
4147
+ handler(e, toggle) {
4148
+ e.preventDefault();
4149
+
4150
+ if (this.isToggled()) {
4151
+ this.hide(false);
4152
+ } else {
4153
+ this.show(toggle == null ? void 0 : toggle.$el, false);
4154
+ }
4155
+ } },
4156
+
4157
+
4158
+ {
4159
+ name: 'toggleshow',
4160
+
4161
+ self: true,
4162
+
4163
+ handler(e, toggle) {
4164
+ e.preventDefault();
4165
+ this.show(toggle == null ? void 0 : toggle.$el);
4166
+ } },
4167
+
4168
+
4169
+ {
4170
+ name: 'togglehide',
4171
+
4172
+ self: true,
4173
+
4174
+ handler(e) {
4175
+ e.preventDefault();
4176
+ if (!matches(this.$el, ':focus,:hover')) {
4177
+ this.hide();
4178
+ }
4179
+ } },
4180
+
4181
+
4182
+ {
4183
+ name: pointerEnter + " focusin",
4184
+
4185
+ filter() {
4186
+ return includes(this.mode, 'hover');
4187
+ },
4188
+
4189
+ handler(e) {
4190
+ if (!isTouch(e)) {
4191
+ this.clearTimers();
4192
+ }
4193
+ } },
4194
+
4195
+
4196
+ {
4197
+ name: pointerLeave + " focusout",
4198
+
4199
+ filter() {
4200
+ return includes(this.mode, 'hover');
4201
+ },
4202
+
4203
+ handler(e) {
4204
+ if (!isTouch(e) && e.relatedTarget) {
3783
4205
  this.hide();
3784
4206
  }
3785
4207
  } },
@@ -3806,25 +4228,25 @@
3806
4228
  self: true,
3807
4229
 
3808
4230
  handler() {
3809
- active$1 = this;
4231
+ active = this;
3810
4232
 
3811
4233
  this.tracker.init();
3812
4234
 
3813
4235
  for (const handler of [
3814
4236
  on(
3815
4237
  document,
3816
- pointerDown,
3817
- (_ref2) => {let { target } = _ref2;return (
4238
+ pointerDown$1,
4239
+ (_ref3) => {let { target } = _ref3;return (
3818
4240
  !within(target, this.$el) &&
3819
4241
  once(
3820
4242
  document,
3821
- pointerUp + " " + pointerCancel + " scroll",
3822
- (_ref3) => {let { defaultPrevented, type, target: newTarget } = _ref3;
4243
+ pointerUp$1 + " " + pointerCancel + " scroll",
4244
+ (_ref4) => {let { defaultPrevented, type, target: newTarget } = _ref4;
3823
4245
  if (
3824
4246
  !defaultPrevented &&
3825
- type === pointerUp &&
4247
+ type === pointerUp$1 &&
3826
4248
  target === newTarget &&
3827
- !(this.target && within(target, this.target)))
4249
+ !(this.targetEl && within(target, this.targetEl)))
3828
4250
  {
3829
4251
  this.hide(false);
3830
4252
  }
@@ -3839,13 +4261,17 @@
3839
4261
  }
3840
4262
  }),
3841
4263
 
4264
+ ...(this.bgScroll ?
4265
+ [] :
4266
+ [preventOverscroll(this.$el), preventBackgroundScroll()]),
4267
+
3842
4268
  ...(this.display === 'static' ?
3843
4269
  [] :
3844
4270
  (() => {
3845
4271
  const handler = () => this.$emit();
3846
4272
  return [
3847
4273
  on(window, 'resize', handler),
3848
- on(document, 'scroll', handler, true),
4274
+ on([document, scrollParents(this.$el)], 'scroll', handler),
3849
4275
  (() => {
3850
4276
  const observer = observeResize(
3851
4277
  scrollParents(this.$el),
@@ -3874,16 +4300,16 @@
3874
4300
  {
3875
4301
  name: 'hide',
3876
4302
 
3877
- handler(_ref4) {let { target } = _ref4;
4303
+ handler(_ref5) {let { target } = _ref5;
3878
4304
  if (this.$el !== target) {
3879
- active$1 =
3880
- active$1 === null && within(target, this.$el) && this.isToggled() ?
4305
+ active =
4306
+ active === null && within(target, this.$el) && this.isToggled() ?
3881
4307
  this :
3882
- active$1;
4308
+ active;
3883
4309
  return;
3884
4310
  }
3885
4311
 
3886
- active$1 = this.isActive() ? null : active$1;
4312
+ active = this.isActive() ? null : active;
3887
4313
  this.tracker.cancel();
3888
4314
  } }],
3889
4315
 
@@ -3898,12 +4324,12 @@
3898
4324
 
3899
4325
 
3900
4326
  methods: {
3901
- show(target, delay) {if (target === void 0) {target = this.target;}if (delay === void 0) {delay = true;}
3902
- if (this.isToggled() && target && this.target && target !== this.target) {
3903
- this.hide(false);
4327
+ show(target, delay) {if (target === void 0) {target = this.targetEl;}if (delay === void 0) {delay = true;}
4328
+ if (this.isToggled() && target && this.targetEl && target !== this.targetEl) {
4329
+ this.hide(false, false);
3904
4330
  }
3905
4331
 
3906
- this.target = target;
4332
+ this.targetEl = target;
3907
4333
 
3908
4334
  this.clearTimers();
3909
4335
 
@@ -3911,16 +4337,16 @@
3911
4337
  return;
3912
4338
  }
3913
4339
 
3914
- if (active$1) {
3915
- if (delay && active$1.isDelaying) {
4340
+ if (active) {
4341
+ if (delay && active.isDelaying) {
3916
4342
  this.showTimer = setTimeout(() => matches(target, ':hover') && this.show(), 10);
3917
4343
  return;
3918
4344
  }
3919
4345
 
3920
4346
  let prev;
3921
- while (active$1 && prev !== active$1 && !within(this.$el, active$1.$el)) {
3922
- prev = active$1;
3923
- active$1.hide(false);
4347
+ while (active && prev !== active && !within(this.$el, active.$el)) {
4348
+ prev = active;
4349
+ active.hide(false, false);
3924
4350
  }
3925
4351
  }
3926
4352
 
@@ -3934,8 +4360,8 @@
3934
4360
 
3935
4361
  },
3936
4362
 
3937
- hide(delay) {if (delay === void 0) {delay = true;}
3938
- const hide = () => this.toggleElement(this.$el, false, false);
4363
+ hide(delay, animate) {if (delay === void 0) {delay = true;}if (animate === void 0) {animate = true;}
4364
+ const hide = () => this.toggleElement(this.$el, false, this.animateOut && animate);
3939
4365
 
3940
4366
  this.clearTimers();
3941
4367
 
@@ -3961,46 +4387,74 @@
3961
4387
  },
3962
4388
 
3963
4389
  isActive() {
3964
- return active$1 === this;
4390
+ return active === this;
3965
4391
  },
3966
4392
 
3967
4393
  position() {
3968
4394
  removeClass(this.$el, this.clsDrop + "-stack");
3969
- toggleClass(this.$el, this.clsDrop + "-boundary", this.boundaryAlign);
4395
+ attr(this.$el, 'style', this._style);
4396
+
4397
+ // Ensure none positioned element does not generate scrollbars
4398
+ this.$el.hidden = true;
3970
4399
 
3971
4400
  const boundary = query(this.boundary, this.$el);
3972
- const scrollParentOffset = offset(
3973
- scrollParents(boundary && this.boundaryAlign ? boundary : this.$el)[0]);
4401
+ const boundaryOffset = offsetViewport(boundary || window);
4402
+ const viewports = this.target.map((target) => offsetViewport(scrollParents(target)[0]));
4403
+ const viewportOffset = this.getViewportOffset(this.$el);
3974
4404
 
3975
- const boundaryOffset = boundary ? offset(boundary) : scrollParentOffset;
4405
+ const dirs = [
4406
+ [0, ['x', 'width', 'left', 'right']],
4407
+ [1, ['y', 'height', 'top', 'bottom']]];
3976
4408
 
3977
- css(this.$el, 'maxWidth', '');
3978
- const maxWidth =
3979
- scrollParentOffset.width -
3980
- 2 * toPx(getCssVar('position-viewport-offset', this.$el));
3981
4409
 
3982
- if (this.pos[1] === 'justify') {
3983
- const prop = this.axis === 'y' ? 'width' : 'height';
3984
- css(
3985
- this.$el,
3986
- prop,
3987
- Math.min(
3988
- (boundary ? boundaryOffset : offset(this.target))[prop],
3989
- scrollParentOffset[prop] -
3990
- 2 * toPx(getCssVar('position-viewport-offset', this.$el))));
4410
+ for (const [i, [axis, prop]] of dirs) {
4411
+ if (this.axis !== axis && includes([axis, true], this.stretch)) {
4412
+ css(this.$el, {
4413
+ [prop]: Math.min(
4414
+ boundaryOffset[prop],
4415
+ viewports[i][prop] - 2 * viewportOffset),
4416
+
4417
+ ["overflow-" + axis]: 'auto' });
4418
+
4419
+ }
4420
+ }
3991
4421
 
4422
+ const maxWidth = viewports[0].width - 2 * viewportOffset;
3992
4423
 
3993
- } else if (this.$el.offsetWidth > maxWidth) {
4424
+ if (this.$el.offsetWidth > maxWidth) {
3994
4425
  addClass(this.$el, this.clsDrop + "-stack");
3995
4426
  }
3996
4427
 
3997
4428
  css(this.$el, 'maxWidth', maxWidth);
3998
4429
 
3999
- this.positionAt(
4000
- this.$el,
4001
- boundary && this.boundaryAlign ? boundary : this.target,
4002
- boundary);
4430
+ this.$el.hidden = false;
4431
+
4432
+ this.positionAt(this.$el, this.target, boundary);
4433
+
4434
+ for (const [i, [axis, prop, start, end]] of dirs) {
4435
+ if (this.axis === axis && includes([axis, true], this.stretch)) {
4436
+ const positionOffset = Math.abs(this.getPositionOffset(this.$el));
4437
+ const targetOffset = offset(this.target[i]);
4438
+ const elOffset = offset(this.$el);
4439
+
4440
+ css(this.$el, {
4441
+ [prop]:
4442
+ (targetOffset[start] > elOffset[start] ?
4443
+ targetOffset[start] -
4444
+ Math.max(
4445
+ boundaryOffset[start],
4446
+ viewports[i][start] + viewportOffset) :
4447
+
4448
+ Math.min(
4449
+ boundaryOffset[end],
4450
+ viewports[i][end] - viewportOffset) -
4451
+ targetOffset[end]) - positionOffset,
4452
+ ["overflow-" + axis]: 'auto' });
4453
+
4003
4454
 
4455
+ this.positionAt(this.$el, this.target, boundary);
4456
+ }
4457
+ }
4004
4458
  } } };
4005
4459
 
4006
4460
 
@@ -4485,7 +4939,7 @@
4485
4939
 
4486
4940
  resizeTargets() {
4487
4941
  // check for offsetTop change
4488
- return [this.$el, document.documentElement];
4942
+ return [this.$el, ...scrollParents(this.$el, /auto|scroll/)];
4489
4943
  },
4490
4944
 
4491
4945
  update: {
@@ -4497,21 +4951,33 @@
4497
4951
  let minHeight = '';
4498
4952
  const box = boxModelAdjust(this.$el, 'height', 'content-box');
4499
4953
 
4954
+ const { body, scrollingElement } = document;
4955
+ const [scrollElement] = scrollParents(this.$el, /auto|scroll/);
4956
+ const { height: viewportHeight } = offsetViewport(
4957
+ scrollElement === body ? scrollingElement : scrollElement);
4958
+
4959
+
4500
4960
  if (this.expand) {
4501
4961
  minHeight = Math.max(
4502
- height(window) - (
4503
- dimensions$1(document.documentElement).height -
4504
- dimensions$1(this.$el).height) -
4962
+ viewportHeight - (
4963
+ dimensions$1(scrollElement).height - dimensions$1(this.$el).height) -
4505
4964
  box,
4506
4965
  0);
4507
4966
 
4508
4967
  } else {
4968
+ const isScrollingElement =
4969
+ scrollingElement === scrollElement || body === scrollElement;
4970
+
4509
4971
  // on mobile devices (iOS and Android) window.innerHeight !== 100vh
4510
- minHeight = 'calc(100vh';
4972
+ minHeight = "calc(" + (isScrollingElement ? '100vh' : viewportHeight + "px");
4511
4973
 
4512
4974
  if (this.offsetTop) {
4513
- const { top } = offset(this.$el);
4514
- minHeight += top > 0 && top < height(window) / 2 ? " - " + top + "px" : '';
4975
+ if (isScrollingElement) {
4976
+ const top = offsetPosition(this.$el)[0] - offsetPosition(scrollElement)[0];
4977
+ minHeight += top > 0 && top < viewportHeight / 2 ? " - " + top + "px" : '';
4978
+ } else {
4979
+ minHeight += " - " + css(scrollElement, 'paddingTop');
4980
+ }
4515
4981
  }
4516
4982
 
4517
4983
  if (this.offsetBottom === true) {
@@ -4754,7 +5220,13 @@
4754
5220
 
4755
5221
  var marker = "<svg width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><rect x=\"9\" y=\"4\" width=\"1\" height=\"11\"/><rect x=\"4\" y=\"9\" width=\"11\" height=\"1\"/></svg>";
4756
5222
 
4757
- var navbarToggleIcon = "<svg width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><rect y=\"9\" width=\"20\" height=\"2\"/><rect y=\"3\" width=\"20\" height=\"2\"/><rect y=\"15\" width=\"20\" height=\"2\"/></svg>";
5223
+ var navParentIcon = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"12\" height=\"12\" viewBox=\"0 0 12 12\"><polyline fill=\"none\" stroke=\"#000\" stroke-width=\"1.1\" points=\"1 3.5 6 8.5 11 3.5\"/></svg>";
5224
+
5225
+ var navParentIconLarge = "<svg width=\"14\" height=\"14\" viewBox=\"0 0 14 14\" xmlns=\"http://www.w3.org/2000/svg\"><polyline fill=\"none\" stroke=\"#000\" stroke-width=\"1.1\" points=\"1 4 7 10 13 4\"/></svg>";
5226
+
5227
+ var navbarParentIcon = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"12\" height=\"12\" viewBox=\"0 0 12 12\"><polyline fill=\"none\" stroke=\"#000\" stroke-width=\"1.1\" points=\"1 3.5 6 8.5 11 3.5\"/></svg>";
5228
+
5229
+ var navbarToggleIcon = "<svg width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><style>.uk-navbar-toggle svg > [class*='line-'] {\n transition: 0.2s ease-in-out;\n transition-property: transform, opacity,;\n transform-origin: center;\n opacity: 1;\n }\n\n .uk-navbar-toggle[aria-expanded=\"true\"] svg > .line-2 { transform: rotate(45deg); }\n .uk-navbar-toggle[aria-expanded=\"true\"] svg > .line-3 { transform: rotate(-45deg); }\n\n .uk-navbar-toggle[aria-expanded=\"true\"] svg > .line-1,\n .uk-navbar-toggle[aria-expanded=\"true\"] svg > .line-4 { opacity: 0; }\n .uk-navbar-toggle[aria-expanded=\"true\"] svg > .line-1 { transform: translateY(6px) scaleX(0); }\n .uk-navbar-toggle[aria-expanded=\"true\"] svg > .line-4 { transform: translateY(-6px) scaleX(0); }</style><rect class=\"line-1\" y=\"3\" width=\"20\" height=\"2\"/><rect class=\"line-2\" y=\"9\" width=\"20\" height=\"2\"/><rect class=\"line-3\" y=\"9\" width=\"20\" height=\"2\"/><rect class=\"line-4\" y=\"15\" width=\"20\" height=\"2\"/></svg>";
4758
5230
 
4759
5231
  var overlayIcon = "<svg width=\"40\" height=\"40\" viewBox=\"0 0 40 40\" xmlns=\"http://www.w3.org/2000/svg\"><rect x=\"19\" y=\"0\" width=\"1\" height=\"40\"/><rect x=\"0\" y=\"19\" width=\"40\" height=\"1\"/></svg>";
4760
5232
 
@@ -4786,6 +5258,9 @@
4786
5258
  marker,
4787
5259
  'close-icon': closeIcon,
4788
5260
  'close-large': closeLarge,
5261
+ 'nav-parent-icon': navParentIcon,
5262
+ 'nav-parent-icon-large': navParentIconLarge,
5263
+ 'navbar-parent-icon': navbarParentIcon,
4789
5264
  'navbar-toggle-icon': navbarToggleIcon,
4790
5265
  'overlay-icon': overlayIcon,
4791
5266
  'pagination-next': paginationNext,
@@ -4843,6 +5318,15 @@
4843
5318
  } };
4844
5319
 
4845
5320
 
5321
+ const NavParentIcon = {
5322
+ extends: IconComponent,
5323
+
5324
+ beforeConnect() {
5325
+ const icon = this.$props.icon;
5326
+ this.icon = closest(this.$el, '.uk-nav-primary') ? icon + "-large" : icon;
5327
+ } };
5328
+
5329
+
4846
5330
  const Slidenav = {
4847
5331
  extends: IconComponent,
4848
5332
 
@@ -5052,387 +5536,135 @@
5052
5536
  const source = fragment('<source>');
5053
5537
  attr(source, attrs);
5054
5538
  append(picture, source);
5055
- }
5056
- append(picture, img);
5057
- }
5058
- }
5059
-
5060
- function parseSources(sources) {
5061
- if (!sources) {
5062
- return [];
5063
- }
5064
-
5065
- if (startsWith(sources, '[')) {
5066
- try {
5067
- sources = JSON.parse(sources);
5068
- } catch (e) {
5069
- sources = [];
5070
- }
5071
- } else {
5072
- sources = parseOptions(sources);
5073
- }
5074
-
5075
- if (!isArray(sources)) {
5076
- sources = [sources];
5077
- }
5078
-
5079
- return sources.filter((source) => !isEmpty(source));
5080
- }
5081
-
5082
- function ensureSrcAttribute(el) {
5083
- if (isImg(el) && !hasAttr(el, 'src')) {
5084
- attr(el, 'src', 'data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg"></svg>');
5085
- }
5086
- }
5087
-
5088
- function isPicture(el) {
5089
- return isTag(el, 'picture');
5090
- }
5091
-
5092
- function isImg(el) {
5093
- return isTag(el, 'img');
5094
- }
5095
-
5096
- var Media = {
5097
- props: {
5098
- media: Boolean },
5099
-
5100
-
5101
- data: {
5102
- media: false },
5103
-
5104
-
5105
- connected() {
5106
- const media = toMedia(this.media);
5107
- this.matchMedia = true;
5108
- if (media) {
5109
- this.mediaObj = window.matchMedia(media);
5110
- const handler = () => {
5111
- this.matchMedia = this.mediaObj.matches;
5112
- trigger(this.$el, createEvent('mediachange', false, true, [this.mediaObj]));
5113
- };
5114
- this.offMediaObj = on(this.mediaObj, 'change', () => {
5115
- handler();
5116
- this.$emit('resize');
5117
- });
5118
- handler();
5119
- }
5120
- },
5121
-
5122
- disconnected() {var _this$offMediaObj;
5123
- (_this$offMediaObj = this.offMediaObj) == null ? void 0 : _this$offMediaObj.call(this);
5124
- } };
5125
-
5126
-
5127
- function toMedia(value) {
5128
- if (isString(value)) {
5129
- if (startsWith(value, '@')) {
5130
- const name = "breakpoint-" + value.substr(1);
5131
- value = toFloat(getCssVar(name));
5132
- } else if (isNaN(value)) {
5133
- return value;
5134
- }
5135
- }
5136
-
5137
- return value && isNumeric(value) ? "(min-width: " + value + "px)" : '';
5138
- }
5139
-
5140
- var leader = {
5141
- mixins: [Class, Media, Resize],
5142
-
5143
- props: {
5144
- fill: String },
5145
-
5146
-
5147
- data: {
5148
- fill: '',
5149
- clsWrapper: 'uk-leader-fill',
5150
- clsHide: 'uk-leader-hide',
5151
- attrFill: 'data-fill' },
5152
-
5153
-
5154
- computed: {
5155
- fill(_ref) {let { fill } = _ref;
5156
- return fill || getCssVar('leader-fill-content');
5157
- } },
5158
-
5159
-
5160
- connected() {
5161
- [this.wrapper] = wrapInner(this.$el, "<span class=\"" + this.clsWrapper + "\">");
5162
- },
5163
-
5164
- disconnected() {
5165
- unwrap(this.wrapper.childNodes);
5166
- },
5167
-
5168
- update: {
5169
- read() {
5170
- const width = Math.trunc(this.$el.offsetWidth / 2);
5171
-
5172
- return {
5173
- width,
5174
- fill: this.fill,
5175
- hide: !this.matchMedia };
5176
-
5177
- },
5178
-
5179
- write(_ref2) {let { width, fill, hide } = _ref2;
5180
- toggleClass(this.wrapper, this.clsHide, hide);
5181
- attr(this.wrapper, this.attrFill, new Array(width).join(fill));
5182
- },
5183
-
5184
- events: ['resize'] } };
5185
-
5186
- const active = [];
5187
-
5188
- var Modal = {
5189
- mixins: [Class, Container, Togglable],
5190
-
5191
- props: {
5192
- selPanel: String,
5193
- selClose: String,
5194
- escClose: Boolean,
5195
- bgClose: Boolean,
5196
- stack: Boolean },
5197
-
5198
-
5199
- data: {
5200
- cls: 'uk-open',
5201
- escClose: true,
5202
- bgClose: true,
5203
- overlay: true,
5204
- stack: false },
5205
-
5206
-
5207
- computed: {
5208
- panel(_ref, $el) {let { selPanel } = _ref;
5209
- return $(selPanel, $el);
5210
- },
5211
-
5212
- transitionElement() {
5213
- return this.panel;
5214
- },
5215
-
5216
- bgClose(_ref2) {let { bgClose } = _ref2;
5217
- return bgClose && this.panel;
5218
- } },
5219
-
5220
-
5221
- beforeDisconnect() {
5222
- if (includes(active, this)) {
5223
- this.toggleElement(this.$el, false, false);
5224
- }
5225
- },
5226
-
5227
- events: [
5228
- {
5229
- name: 'click',
5230
-
5231
- delegate() {
5232
- return this.selClose;
5233
- },
5234
-
5235
- handler(e) {
5236
- e.preventDefault();
5237
- this.hide();
5238
- } },
5239
-
5240
-
5241
- {
5242
- name: 'toggle',
5243
-
5244
- self: true,
5245
-
5246
- handler(e) {
5247
- if (e.defaultPrevented) {
5248
- return;
5249
- }
5250
-
5251
- e.preventDefault();
5252
-
5253
- if (this.isToggled() === includes(active, this)) {
5254
- this.toggle();
5255
- }
5256
- } },
5257
-
5258
-
5259
- {
5260
- name: 'beforeshow',
5261
-
5262
- self: true,
5263
-
5264
- handler(e) {
5265
- if (includes(active, this)) {
5266
- return false;
5267
- }
5268
-
5269
- if (!this.stack && active.length) {
5270
- Promise.all(active.map((modal) => modal.hide())).then(this.show);
5271
- e.preventDefault();
5272
- } else {
5273
- active.push(this);
5274
- }
5275
- } },
5276
-
5277
-
5278
- {
5279
- name: 'show',
5280
-
5281
- self: true,
5282
-
5283
- handler() {
5284
- const docEl = document.documentElement;
5285
-
5286
- if (width(window) > docEl.clientWidth && this.overlay) {
5287
- css(document.body, 'overflowY', 'scroll');
5288
- }
5289
-
5290
- if (this.stack) {
5291
- css(this.$el, 'zIndex', toFloat(css(this.$el, 'zIndex')) + active.length);
5292
- }
5293
-
5294
- addClass(docEl, this.clsPage);
5295
-
5296
- if (this.bgClose) {
5297
- once(
5298
- this.$el,
5299
- 'hide',
5300
- on(document, pointerDown, (_ref3) => {let { target } = _ref3;
5301
- if (
5302
- last(active) !== this ||
5303
- this.overlay && !within(target, this.$el) ||
5304
- within(target, this.panel))
5305
- {
5306
- return;
5307
- }
5308
-
5309
- once(
5310
- document,
5311
- pointerUp + " " + pointerCancel + " scroll",
5312
- (_ref4) => {let { defaultPrevented, type, target: newTarget } = _ref4;
5313
- if (
5314
- !defaultPrevented &&
5315
- type === pointerUp &&
5316
- target === newTarget)
5317
- {
5318
- this.hide();
5319
- }
5320
- },
5321
- true);
5322
-
5323
- }),
5324
- { self: true });
5539
+ }
5540
+ append(picture, img);
5541
+ }
5542
+ }
5325
5543
 
5326
- }
5544
+ function parseSources(sources) {
5545
+ if (!sources) {
5546
+ return [];
5547
+ }
5327
5548
 
5328
- if (this.escClose) {
5329
- once(
5330
- this.$el,
5331
- 'hide',
5332
- on(document, 'keydown', (e) => {
5333
- if (e.keyCode === 27 && last(active) === this) {
5334
- this.hide();
5335
- }
5336
- }),
5337
- { self: true });
5549
+ if (startsWith(sources, '[')) {
5550
+ try {
5551
+ sources = JSON.parse(sources);
5552
+ } catch (e) {
5553
+ sources = [];
5554
+ }
5555
+ } else {
5556
+ sources = parseOptions(sources);
5557
+ }
5338
5558
 
5339
- }
5340
- } },
5559
+ if (!isArray(sources)) {
5560
+ sources = [sources];
5561
+ }
5341
5562
 
5563
+ return sources.filter((source) => !isEmpty(source));
5564
+ }
5342
5565
 
5343
- {
5344
- name: 'shown',
5566
+ function ensureSrcAttribute(el) {
5567
+ if (isImg(el) && !hasAttr(el, 'src')) {
5568
+ attr(el, 'src', 'data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg"></svg>');
5569
+ }
5570
+ }
5345
5571
 
5346
- self: true,
5572
+ function isPicture(el) {
5573
+ return isTag(el, 'picture');
5574
+ }
5347
5575
 
5348
- handler() {
5349
- if (!isFocusable(this.$el)) {
5350
- attr(this.$el, 'tabindex', '-1');
5351
- }
5576
+ function isImg(el) {
5577
+ return isTag(el, 'img');
5578
+ }
5352
5579
 
5353
- if (!$(':focus', this.$el)) {
5354
- this.$el.focus();
5355
- }
5356
- } },
5580
+ var Media = {
5581
+ props: {
5582
+ media: Boolean },
5357
5583
 
5358
5584
 
5359
- {
5360
- name: 'hidden',
5585
+ data: {
5586
+ media: false },
5361
5587
 
5362
- self: true,
5363
5588
 
5364
- handler() {
5365
- if (includes(active, this)) {
5366
- active.splice(active.indexOf(this), 1);
5367
- }
5589
+ connected() {
5590
+ const media = toMedia(this.media, this.$el);
5591
+ this.matchMedia = true;
5592
+ if (media) {
5593
+ this.mediaObj = window.matchMedia(media);
5594
+ const handler = () => {
5595
+ this.matchMedia = this.mediaObj.matches;
5596
+ trigger(this.$el, createEvent('mediachange', false, true, [this.mediaObj]));
5597
+ };
5598
+ this.offMediaObj = on(this.mediaObj, 'change', () => {
5599
+ handler();
5600
+ this.$emit('resize');
5601
+ });
5602
+ handler();
5603
+ }
5604
+ },
5368
5605
 
5369
- if (!active.length) {
5370
- css(document.body, 'overflowY', '');
5371
- }
5606
+ disconnected() {var _this$offMediaObj;
5607
+ (_this$offMediaObj = this.offMediaObj) == null ? void 0 : _this$offMediaObj.call(this);
5608
+ } };
5372
5609
 
5373
- css(this.$el, 'zIndex', '');
5374
5610
 
5375
- if (!active.some((modal) => modal.clsPage === this.clsPage)) {
5376
- removeClass(document.documentElement, this.clsPage);
5377
- }
5378
- } }],
5611
+ function toMedia(value, element) {
5612
+ if (isString(value)) {
5613
+ if (startsWith(value, '@')) {
5614
+ value = toFloat(css(element, "--uk-breakpoint-" + value.substr(1)));
5615
+ } else if (isNaN(value)) {
5616
+ return value;
5617
+ }
5618
+ }
5379
5619
 
5620
+ return value && isNumeric(value) ? "(min-width: " + value + "px)" : '';
5621
+ }
5380
5622
 
5623
+ var leader = {
5624
+ mixins: [Class, Media, Resize],
5381
5625
 
5382
- methods: {
5383
- toggle() {
5384
- return this.isToggled() ? this.hide() : this.show();
5385
- },
5626
+ props: {
5627
+ fill: String },
5386
5628
 
5387
- show() {
5388
- if (this.container && parent(this.$el) !== this.container) {
5389
- append(this.container, this.$el);
5390
- return new Promise((resolve) =>
5391
- requestAnimationFrame(() => this.show().then(resolve)));
5392
5629
 
5393
- }
5630
+ data: {
5631
+ fill: '',
5632
+ clsWrapper: 'uk-leader-fill',
5633
+ clsHide: 'uk-leader-hide',
5634
+ attrFill: 'data-fill' },
5394
5635
 
5395
- return this.toggleElement(this.$el, true, animate(this));
5396
- },
5397
5636
 
5398
- hide() {
5399
- return this.toggleElement(this.$el, false, animate(this));
5400
- } } };
5637
+ computed: {
5638
+ fill(_ref) {let { fill } = _ref;
5639
+ return fill || css(this.$el, '--uk-leader-fill-content');
5640
+ } },
5401
5641
 
5402
5642
 
5643
+ connected() {
5644
+ [this.wrapper] = wrapInner(this.$el, "<span class=\"" + this.clsWrapper + "\">");
5645
+ },
5403
5646
 
5404
- function animate(_ref5) {let { transitionElement, _toggle } = _ref5;
5405
- return (el, show) =>
5406
- new Promise((resolve, reject) =>
5407
- once(el, 'show hide', () => {
5408
- el._reject == null ? void 0 : el._reject();
5409
- el._reject = reject;
5647
+ disconnected() {
5648
+ unwrap(this.wrapper.childNodes);
5649
+ },
5410
5650
 
5411
- _toggle(el, show);
5651
+ update: {
5652
+ read() {
5653
+ const width = Math.trunc(this.$el.offsetWidth / 2);
5412
5654
 
5413
- const off = once(
5414
- transitionElement,
5415
- 'transitionstart',
5416
- () => {
5417
- once(transitionElement, 'transitionend transitioncancel', resolve, {
5418
- self: true });
5655
+ return {
5656
+ width,
5657
+ fill: this.fill,
5658
+ hide: !this.matchMedia };
5419
5659
 
5420
- clearTimeout(timer);
5421
5660
  },
5422
- { self: true });
5423
5661
 
5662
+ write(_ref2) {let { width, fill, hide } = _ref2;
5663
+ toggleClass(this.wrapper, this.clsHide, hide);
5664
+ attr(this.wrapper, this.attrFill, new Array(width).join(fill));
5665
+ },
5424
5666
 
5425
- const timer = setTimeout(() => {
5426
- off();
5427
- resolve();
5428
- }, toMs(css(transitionElement, 'transitionDuration')));
5429
- })).
5430
- then(() => delete el._reject);
5431
- }
5432
-
5433
- function toMs(time) {
5434
- return time ? endsWith(time, 'ms') ? toFloat(time) : toFloat(time) * 1000 : 0;
5435
- }
5667
+ events: ['resize'] } };
5436
5668
 
5437
5669
  var modal = {
5438
5670
  install: install$2,
@@ -5596,7 +5828,7 @@
5596
5828
  align: String,
5597
5829
  offset: Number,
5598
5830
  boundary: Boolean,
5599
- boundaryAlign: Boolean,
5831
+ target: Boolean,
5600
5832
  clsDrop: String,
5601
5833
  delayShow: Number,
5602
5834
  delayHide: Number,
@@ -5613,9 +5845,12 @@
5613
5845
  offset: undefined,
5614
5846
  delayShow: undefined,
5615
5847
  delayHide: undefined,
5616
- boundaryAlign: undefined,
5617
- flip: 'x',
5848
+ flip: false,
5849
+ shift: true,
5618
5850
  boundary: true,
5851
+ target: false,
5852
+ targetX: false,
5853
+ targetY: false,
5619
5854
  dropbar: false,
5620
5855
  dropbarAnchor: false,
5621
5856
  duration: 200,
@@ -5650,7 +5885,7 @@
5650
5885
  },
5651
5886
 
5652
5887
  watch(dropbar) {
5653
- addClass(dropbar, 'uk-navbar-dropbar');
5888
+ addClass(dropbar, 'uk-dropbar', 'uk-dropbar-top', 'uk-navbar-dropbar');
5654
5889
  },
5655
5890
 
5656
5891
  immediate: true },
@@ -5666,7 +5901,7 @@
5666
5901
 
5667
5902
  if (this.dropContainer !== $el) {
5668
5903
  for (const el of $$("." + clsDrop, this.dropContainer)) {var _this$getDropdown;
5669
- const target = (_this$getDropdown = this.getDropdown(el)) == null ? void 0 : _this$getDropdown.target;
5904
+ const target = (_this$getDropdown = this.getDropdown(el)) == null ? void 0 : _this$getDropdown.targetEl;
5670
5905
  if (!includes(dropdowns, el) && target && within(target, this.$el)) {
5671
5906
  dropdowns.push(el);
5672
5907
  }
@@ -5683,8 +5918,7 @@
5683
5918
  {
5684
5919
  ...this.$props,
5685
5920
  boundary: this.boundary,
5686
- pos: this.pos,
5687
- offset: this.dropbar || this.offset });
5921
+ pos: this.pos });
5688
5922
 
5689
5923
 
5690
5924
  },
@@ -5729,8 +5963,8 @@
5729
5963
  if (
5730
5964
  active &&
5731
5965
  includes(active.mode, 'hover') &&
5732
- active.target &&
5733
- !within(active.target, current) &&
5966
+ active.targetEl &&
5967
+ !within(active.targetEl, current) &&
5734
5968
  !active.isDelaying)
5735
5969
  {
5736
5970
  active.hide(false);
@@ -5752,7 +5986,7 @@
5752
5986
  if (keyCode === keyMap.DOWN && hasAttr(current, 'aria-expanded')) {
5753
5987
  e.preventDefault();
5754
5988
 
5755
- if (!active || active.target !== current) {
5989
+ if (!active || active.targetEl !== current) {
5756
5990
  current.click();
5757
5991
  once(this.dropContainer, 'show', (_ref8) => {let { target } = _ref8;return (
5758
5992
  focusFirstFocusableElement(target));});
@@ -5802,8 +6036,8 @@
5802
6036
  }
5803
6037
  }
5804
6038
 
5805
- if (keyCode === keyMap.ESC) {var _active$target;
5806
- active == null ? void 0 : (_active$target = active.target) == null ? void 0 : _active$target.focus();
6039
+ if (keyCode === keyMap.ESC) {var _active$targetEl;
6040
+ active == null ? void 0 : (_active$targetEl = active.targetEl) == null ? void 0 : _active$targetEl.focus();
5807
6041
  }
5808
6042
 
5809
6043
  handleNavItemNavigation(e, this.toggles, active);
@@ -5845,8 +6079,8 @@
5845
6079
  return this.dropbar;
5846
6080
  },
5847
6081
 
5848
- handler(_, _ref9) {let { $el } = _ref9;
5849
- if (!hasClass($el, this.clsDrop)) {
6082
+ handler(_ref9) {let { target } = _ref9;
6083
+ if (!this.isDropbarDrop(target)) {
5850
6084
  return;
5851
6085
  }
5852
6086
 
@@ -5854,7 +6088,7 @@
5854
6088
  after(this.dropbarAnchor || this.$el, this.dropbar);
5855
6089
  }
5856
6090
 
5857
- addClass($el, this.clsDrop + "-dropbar");
6091
+ addClass(target, this.clsDrop + "-dropbar");
5858
6092
  } },
5859
6093
 
5860
6094
 
@@ -5869,19 +6103,24 @@
5869
6103
  return this.dropbar;
5870
6104
  },
5871
6105
 
5872
- handler(_, _ref10) {let { $el } = _ref10;
5873
- if (!hasClass($el, this.clsDrop)) {
6106
+ handler(_ref10) {let { target } = _ref10;
6107
+ if (!this.isDropbarDrop(target)) {
5874
6108
  return;
5875
6109
  }
5876
6110
 
5877
- this._observer = observeResize($el, () =>
5878
- this.transitionTo(
5879
- offset($el).bottom -
5880
- offset(this.dropbar).top +
5881
- toFloat(css($el, 'marginBottom')),
5882
- $el));
5883
-
6111
+ this._observer = observeResize(target, () => {
6112
+ const targetOffsets = parents(target, "." + this.clsDrop).
6113
+ concat(target).
6114
+ map((el) => offset(el));
6115
+ const minTop = Math.min(...targetOffsets.map((_ref11) => {let { top } = _ref11;return top;}));
6116
+ const maxBottom = Math.max(...targetOffsets.map((_ref12) => {let { bottom } = _ref12;return bottom;}));
6117
+ const dropbarOffset = offset(this.dropbar);
6118
+ css(this.dropbar, 'top', this.dropbar.offsetTop - (dropbarOffset.top - minTop));
6119
+ this.transitionTo(
6120
+ maxBottom - minTop + toFloat(css(target, 'marginBottom')),
6121
+ target);
5884
6122
 
6123
+ });
5885
6124
  } },
5886
6125
 
5887
6126
 
@@ -5896,13 +6135,13 @@
5896
6135
  return this.dropbar;
5897
6136
  },
5898
6137
 
5899
- handler(e, _ref11) {let { $el } = _ref11;
6138
+ handler(e) {
5900
6139
  const active = this.getActive();
5901
6140
 
5902
6141
  if (
5903
6142
  matches(this.dropbar, ':hover') &&
5904
- (active == null ? void 0 : active.$el) === $el &&
5905
- !this.toggles.some((el) => active.target !== el && matches(el, ':focus')))
6143
+ (active == null ? void 0 : active.$el) === e.target &&
6144
+ !this.toggles.some((el) => active.targetEl !== el && matches(el, ':focus')))
5906
6145
  {
5907
6146
  e.preventDefault();
5908
6147
  }
@@ -5920,8 +6159,8 @@
5920
6159
  return this.dropbar;
5921
6160
  },
5922
6161
 
5923
- handler(_, _ref12) {let { $el } = _ref12;
5924
- if (!hasClass($el, this.clsDrop)) {
6162
+ handler(_ref13) {let { target } = _ref13;
6163
+ if (!this.isDropbarDrop(target)) {
5925
6164
  return;
5926
6165
  }
5927
6166
 
@@ -5929,7 +6168,7 @@
5929
6168
 
5930
6169
  const active = this.getActive();
5931
6170
 
5932
- if (!active || (active == null ? void 0 : active.$el) === $el) {
6171
+ if (!active || (active == null ? void 0 : active.$el) === target) {
5933
6172
  this.transitionTo(0);
5934
6173
  }
5935
6174
  } }],
@@ -5938,7 +6177,7 @@
5938
6177
 
5939
6178
  methods: {
5940
6179
  getActive() {
5941
- return active$1 && within(active$1.target, this.$el) && active$1;
6180
+ return active && within(active.targetEl, this.$el) && active;
5942
6181
  },
5943
6182
 
5944
6183
  transitionTo(newHeight, el) {
@@ -5947,7 +6186,7 @@
5947
6186
 
5948
6187
  el = oldHeight < newHeight && el;
5949
6188
 
5950
- css(el, 'clip', "rect(0," + el.offsetWidth + "px," + oldHeight + "px,0)");
6189
+ css(el, 'clipPath', "polygon(0 0,100% 0,100% " + oldHeight + "px,0 " + oldHeight + "px)");
5951
6190
 
5952
6191
  height(dropbar, oldHeight);
5953
6192
 
@@ -5956,23 +6195,29 @@
5956
6195
  Transition.start(dropbar, { height: newHeight }, this.duration),
5957
6196
  Transition.start(
5958
6197
  el,
5959
- { clip: "rect(0," + el.offsetWidth + "px," + newHeight + "px,0)" },
6198
+ {
6199
+ clipPath: "polygon(0 0,100% 0,100% " + newHeight + "px,0 " + newHeight + "px)" },
6200
+
5960
6201
  this.duration)]).
5961
6202
 
5962
6203
 
5963
6204
  catch(noop).
5964
- then(() => css(el, { clip: '' }));
6205
+ then(() => css(el, { clipPath: '' }));
5965
6206
  },
5966
6207
 
5967
6208
  getDropdown(el) {
5968
6209
  return this.$getComponent(el, 'drop') || this.$getComponent(el, 'dropdown');
6210
+ },
6211
+
6212
+ isDropbarDrop(el) {
6213
+ return this.getDropdown(el) && hasClass(el, this.clsDrop);
5969
6214
  } } };
5970
6215
 
5971
6216
 
5972
6217
 
5973
6218
  function handleNavItemNavigation(e, toggles, active) {
5974
6219
  const { current, keyCode } = e;
5975
- const target = (active == null ? void 0 : active.target) || current;
6220
+ const target = (active == null ? void 0 : active.targetEl) || current;
5976
6221
  const i = toggles.indexOf(target);
5977
6222
 
5978
6223
  // Left
@@ -6029,7 +6274,7 @@
6029
6274
 
6030
6275
  registerEvent(this, {
6031
6276
  el: this.swipeTarget,
6032
- name: pointerDown,
6277
+ name: pointerDown$1,
6033
6278
  passive: true,
6034
6279
  handler(e) {
6035
6280
  if (!isTouch(e)) {
@@ -6039,7 +6284,7 @@
6039
6284
  // Handle Swipe Gesture
6040
6285
  const pos = getEventPos(e);
6041
6286
  const target = 'tagName' in e.target ? e.target : parent(e.target);
6042
- once(document, pointerUp + " " + pointerCancel + " scroll", (e) => {
6287
+ once(document, pointerUp$1 + " " + pointerCancel + " scroll", (e) => {
6043
6288
  const { x, y } = getEventPos(e);
6044
6289
 
6045
6290
  // swipe
@@ -6146,22 +6391,6 @@
6146
6391
  } },
6147
6392
 
6148
6393
 
6149
- {
6150
- name: 'touchstart',
6151
-
6152
- passive: true,
6153
-
6154
- el() {
6155
- return this.panel;
6156
- },
6157
-
6158
- handler(_ref8) {let { targetTouches } = _ref8;
6159
- if (targetTouches.length === 1) {
6160
- this.clientY = targetTouches[0].clientY;
6161
- }
6162
- } },
6163
-
6164
-
6165
6394
  {
6166
6395
  name: 'touchmove',
6167
6396
 
@@ -6177,33 +6406,6 @@
6177
6406
  } },
6178
6407
 
6179
6408
 
6180
- {
6181
- name: 'touchmove',
6182
-
6183
- passive: false,
6184
-
6185
- el() {
6186
- return this.panel;
6187
- },
6188
-
6189
- handler(e) {
6190
- if (e.targetTouches.length !== 1) {
6191
- return;
6192
- }
6193
-
6194
- const clientY = e.targetTouches[0].clientY - this.clientY;
6195
- const { scrollTop, scrollHeight, clientHeight } = this.panel;
6196
-
6197
- if (
6198
- clientHeight >= scrollHeight ||
6199
- scrollTop === 0 && clientY > 0 ||
6200
- scrollHeight - scrollTop <= clientHeight && clientY < 0)
6201
- {
6202
- e.cancelable && e.preventDefault();
6203
- }
6204
- } },
6205
-
6206
-
6207
6409
  {
6208
6410
  name: 'show',
6209
6411
 
@@ -6215,7 +6417,6 @@
6215
6417
  addClass(parent(this.panel), this.clsMode);
6216
6418
  }
6217
6419
 
6218
- css(document.documentElement, 'overflowY', this.overlay ? 'hidden' : '');
6219
6420
  addClass(document.body, this.clsContainer, this.clsFlip);
6220
6421
  css(document.body, 'touch-action', 'pan-y pinch-zoom');
6221
6422
  css(this.$el, 'display', 'block');
@@ -6223,7 +6424,7 @@
6223
6424
  addClass(
6224
6425
  this.panel,
6225
6426
  this.clsSidebarAnimation,
6226
- this.mode !== 'reveal' ? this.clsMode : '');
6427
+ this.mode === 'reveal' ? '' : this.clsMode);
6227
6428
 
6228
6429
 
6229
6430
  height(document.body); // force reflow
@@ -6260,8 +6461,6 @@
6260
6461
  removeClass(this.$el, this.clsOverlay);
6261
6462
  css(this.$el, 'display', '');
6262
6463
  removeClass(document.body, this.clsContainer, this.clsFlip);
6263
-
6264
- css(document.documentElement, 'overflowY', '');
6265
6464
  } },
6266
6465
 
6267
6466
 
@@ -6386,6 +6585,14 @@
6386
6585
  offset: 0 },
6387
6586
 
6388
6587
 
6588
+ connected() {
6589
+ registerClick(this);
6590
+ },
6591
+
6592
+ disconnected() {
6593
+ unregisterClick(this);
6594
+ },
6595
+
6389
6596
  methods: {
6390
6597
  async scrollTo(el) {
6391
6598
  el = el && $(el) || document.body;
@@ -6394,20 +6601,39 @@
6394
6601
  await scrollIntoView(el, { offset: this.offset });
6395
6602
  trigger(this.$el, 'scrolled', [this, el]);
6396
6603
  }
6397
- } },
6604
+ } } };
6398
6605
 
6399
6606
 
6400
- events: {
6401
- click(e) {
6402
- if (e.defaultPrevented) {
6403
- return;
6404
- }
6405
6607
 
6406
- e.preventDefault();
6407
- this.scrollTo(getTargetElement(this.$el));
6408
- } } };
6608
+ const components$2 = new Set();
6609
+ function registerClick(cmp) {
6610
+ if (!components$2.size) {
6611
+ on(document, 'click', clickHandler);
6612
+ }
6613
+
6614
+ components$2.add(cmp);
6615
+ }
6616
+
6617
+ function unregisterClick(cmp) {
6618
+ components$2.delete(cmp);
6619
+
6620
+ if (!components$2.length) {
6621
+ off(document, 'click', clickHandler);
6622
+ }
6623
+ }
6409
6624
 
6625
+ function clickHandler(e) {
6626
+ if (e.defaultPrevented) {
6627
+ return;
6628
+ }
6410
6629
 
6630
+ for (const component of components$2) {
6631
+ if (within(e.target, component.$el)) {
6632
+ e.preventDefault();
6633
+ component.scrollTo(getTargetElement(component.$el));
6634
+ }
6635
+ }
6636
+ }
6411
6637
 
6412
6638
  function getTargetElement(el) {
6413
6639
  return document.getElementById(decodeURIComponent(el.hash).substring(1));
@@ -6737,7 +6963,9 @@
6737
6963
  },
6738
6964
 
6739
6965
  handler() {
6740
- if (!location.hash || scrollTop(window) === 0) {
6966
+ const { scrollingElement } = document;
6967
+
6968
+ if (!location.hash || scrollingElement.scrollTop === 0) {
6741
6969
  return;
6742
6970
  }
6743
6971
 
@@ -6746,13 +6974,11 @@
6746
6974
  const elOffset = offset(this.$el);
6747
6975
 
6748
6976
  if (this.isFixed && intersectRect(targetOffset, elOffset)) {
6749
- scrollTop(
6750
- window,
6977
+ scrollingElement.scrollTop =
6751
6978
  targetOffset.top -
6752
6979
  elOffset.height -
6753
6980
  toPx(this.targetOffset, 'height', this.placeholder) -
6754
- toPx(this.offset, 'height', this.placeholder));
6755
-
6981
+ toPx(this.offset, 'height', this.placeholder);
6756
6982
  }
6757
6983
  });
6758
6984
  } }],
@@ -6850,7 +7076,7 @@
6850
7076
 
6851
7077
 
6852
7078
  {let { scroll: prevScroll = 0, dir: prevDir = 'down', overflow, overflowScroll = 0, start, end } = _ref4;
6853
- const scroll = scrollTop(window);
7079
+ const scroll = document.scrollingElement.scrollTop;
6854
7080
  const dir = prevScroll <= scroll ? 'down' : 'up';
6855
7081
 
6856
7082
  return {
@@ -7066,7 +7292,7 @@
7066
7292
 
7067
7293
  watch(connects) {
7068
7294
  if (this.swiping) {
7069
- css(connects, 'touch-action', 'pan-y pinch-zoom');
7295
+ css(connects, 'touchAction', 'pan-y pinch-zoom');
7070
7296
  }
7071
7297
 
7072
7298
  const index = this.index();
@@ -7259,7 +7485,7 @@
7259
7485
 
7260
7486
  events: [
7261
7487
  {
7262
- name: pointerDown,
7488
+ name: pointerDown$1,
7263
7489
 
7264
7490
  filter() {
7265
7491
  return includes(this.mode, 'hover');
@@ -7277,7 +7503,7 @@
7277
7503
  trigger(this.$el, 'focus');
7278
7504
  once(
7279
7505
  document,
7280
- pointerDown,
7506
+ pointerDown$1,
7281
7507
  () => trigger(this.$el, 'blur'),
7282
7508
  true,
7283
7509
  (e) => !within(e.target, this.$el));
@@ -7476,10 +7702,12 @@
7476
7702
  Video: Video,
7477
7703
  Close: Close,
7478
7704
  Spinner: Spinner,
7705
+ NavParentIcon: NavParentIcon,
7479
7706
  SlidenavNext: Slidenav,
7480
7707
  SlidenavPrevious: Slidenav,
7481
7708
  SearchIcon: Search,
7482
7709
  Marker: IconComponent,
7710
+ NavbarParentIcon: IconComponent,
7483
7711
  NavbarToggleIcon: IconComponent,
7484
7712
  OverlayIcon: IconComponent,
7485
7713
  PaginationNext: IconComponent,
@@ -7969,7 +8197,7 @@
7969
8197
 
7970
8198
  },
7971
8199
 
7972
- setState(state, animate) {if (animate === void 0) {animate = true;}
8200
+ async setState(state, animate) {if (animate === void 0) {animate = true;}
7973
8201
  state = { filter: { '': '' }, sort: [], ...state };
7974
8202
 
7975
8203
  trigger(this.$el, 'beforeFilter', [this, state]);
@@ -7978,15 +8206,17 @@
7978
8206
  toggleClass(el, this.cls, !!matchFilter(el, this.attrItem, state)));
7979
8207
 
7980
8208
 
7981
- Promise.all(
8209
+ await Promise.all(
7982
8210
  $$(this.target, this.$el).map((target) => {
7983
8211
  const filterFn = () => {
7984
8212
  applyState(state, target, children(target));
7985
8213
  this.$update(this.$el);
7986
8214
  };
7987
8215
  return animate ? this.animate(filterFn, target) : filterFn();
7988
- })).
7989
- then(() => trigger(this.$el, 'afterFilter', [this]));
8216
+ }));
8217
+
8218
+
8219
+ trigger(this.$el, 'afterFilter', [this]);
7990
8220
  },
7991
8221
 
7992
8222
  updateState() {
@@ -8276,6 +8506,11 @@
8276
8506
  this.interval && clearInterval(this.interval);
8277
8507
  } } };
8278
8508
 
8509
+ const pointerOptions = { passive: false, capture: true };
8510
+ const pointerDown = 'touchstart mousedown';
8511
+ const pointerMove = 'touchmove mousemove';
8512
+ const pointerUp = 'touchend touchcancel mouseup click input';
8513
+
8279
8514
  var SliderDrag = {
8280
8515
  props: {
8281
8516
  draggable: Boolean },
@@ -8328,7 +8563,17 @@
8328
8563
 
8329
8564
  handler(e) {
8330
8565
  e.preventDefault();
8331
- } }],
8566
+ } },
8567
+
8568
+
8569
+ {
8570
+ // iOS workaround for slider stopping if swiping fast
8571
+ name: pointerMove + " " + pointerUp,
8572
+ el() {
8573
+ return this.list;
8574
+ },
8575
+ handler: noop,
8576
+ ...pointerOptions }],
8332
8577
 
8333
8578
 
8334
8579
 
@@ -8350,10 +8595,10 @@
8350
8595
  this.prevIndex = this.index;
8351
8596
  }
8352
8597
 
8353
- on(document, pointerMove, this.move, { passive: false });
8598
+ on(document, pointerMove, this.move, pointerOptions);
8354
8599
 
8355
8600
  // 'input' event is triggered by video controls
8356
- on(document, pointerUp + " " + pointerCancel + " input", this.end, true);
8601
+ on(document, pointerUp, this.end, pointerOptions);
8357
8602
 
8358
8603
  css(this.list, 'userSelect', 'none');
8359
8604
  },
@@ -8433,8 +8678,8 @@
8433
8678
  },
8434
8679
 
8435
8680
  end() {
8436
- off(document, pointerMove, this.move, { passive: false });
8437
- off(document, pointerUp + " " + pointerCancel + " input", this.end, true);
8681
+ off(document, pointerMove, this.move, pointerOptions);
8682
+ off(document, pointerUp, this.end, pointerOptions);
8438
8683
 
8439
8684
  if (this.dragging) {
8440
8685
  this.dragging = null;
@@ -8842,7 +9087,7 @@
8842
9087
 
8843
9088
  events: [
8844
9089
  {
8845
- name: pointerMove + " " + pointerDown + " keydown",
9090
+ name: pointerMove$1 + " " + pointerDown$1 + " keydown",
8846
9091
 
8847
9092
  handler: 'showControls' },
8848
9093
 
@@ -10497,7 +10742,7 @@
10497
10742
  },
10498
10743
 
10499
10744
  events: {
10500
- name: pointerDown,
10745
+ name: pointerDown$1,
10501
10746
  passive: false,
10502
10747
  handler: 'init' },
10503
10748
 
@@ -10627,8 +10872,8 @@
10627
10872
  this.placeholder = placeholder;
10628
10873
  this.origin = { target, index: index(placeholder), ...this.pos };
10629
10874
 
10630
- on(document, pointerMove, this.move);
10631
- on(document, pointerUp, this.end);
10875
+ on(document, pointerMove$1, this.move);
10876
+ on(document, pointerUp$1, this.end);
10632
10877
 
10633
10878
  if (!this.threshold) {
10634
10879
  this.start(e);
@@ -10664,8 +10909,8 @@
10664
10909
  },
10665
10910
 
10666
10911
  end() {
10667
- off(document, pointerMove, this.move);
10668
- off(document, pointerUp, this.end);
10912
+ off(document, pointerMove$1, this.move);
10913
+ off(document, pointerUp$1, this.end);
10669
10914
 
10670
10915
  if (!this.drag) {
10671
10916
  return;
@@ -10734,7 +10979,7 @@
10734
10979
  let last = Date.now();
10735
10980
  trackTimer = setInterval(() => {
10736
10981
  let { x, y } = pos;
10737
- y += scrollTop(window);
10982
+ y += document.scrollingElement.scrollTop;
10738
10983
 
10739
10984
  const dist = (Date.now() - last) * 0.3;
10740
10985
  last = Date.now();
@@ -10755,7 +11000,7 @@
10755
11000
  }
10756
11001
 
10757
11002
  if (scroll > 0 && scroll < scrollHeight - height) {
10758
- scrollTop(scrollEl, scroll);
11003
+ scrollEl.scrollTop = scroll;
10759
11004
  return true;
10760
11005
  }
10761
11006
  });
@@ -10900,11 +11145,11 @@
10900
11145
 
10901
11146
  this._unbind = once(
10902
11147
  document, "show keydown " +
10903
- pointerDown,
11148
+ pointerDown$1,
10904
11149
  this.hide,
10905
11150
  false,
10906
11151
  (e) =>
10907
- e.type === pointerDown && !within(e.target, this.$el) ||
11152
+ e.type === pointerDown$1 && !within(e.target, this.$el) ||
10908
11153
  e.type === 'keydown' && e.keyCode === 27 ||
10909
11154
  e.type === 'show' && e.detail[0] !== this && e.detail[0].$name === this.$name);
10910
11155
 
@@ -10975,7 +11220,7 @@
10975
11220
 
10976
11221
  // Clicking a button does not give it focus on all browsers and platforms
10977
11222
  // https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#clicking_and_focus
10978
- [pointerDown](e) {
11223
+ [pointerDown$1](e) {
10979
11224
  if (isTouch(e)) {
10980
11225
  this.show();
10981
11226
  }