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
@@ -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
  }
@@ -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
- }
2016
-
2017
- const willFlip =
2018
- !intersectLine(position, targetDim, i) && intersectLine(position, targetDim, 1 - i);
1995
+ let viewports = scrollParents(target[i]);
1996
+ const [scrollElement] = viewports;
2019
1997
 
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,
@@ -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(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;
3192
-
3193
- Transition.cancel(el);
3156
+ await Transition.cancel(el);
3194
3157
 
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(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(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) * (
3659
+
3660
+ includes(['left', 'top'], this.dir) ? -1 : 1) * (
3661
+ this.inset ? -1 : 1));
3662
+
3663
+ },
3622
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,1753 +3731,1940 @@
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
-
3711
3752
 
3712
- {
3713
- name: 'beforescroll',
3753
+ e.preventDefault();
3714
3754
 
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
3804
 
3805
+ addClass(document.documentElement, this.clsPage);
3773
3806
 
3774
- {
3775
- name: pointerLeave + " focusout",
3807
+ if (this.bgClose) {
3808
+ once(
3809
+ this.$el,
3810
+ 'hide',
3811
+ on(document, pointerDown, (_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
+ }
3776
3819
 
3777
- filter() {
3778
- return includes(this.mode, 'hover');
3779
- },
3780
-
3781
- handler(e) {
3782
- if (!isTouch(e) && e.relatedTarget) {
3783
- this.hide();
3784
- }
3785
- } },
3786
-
3787
-
3788
- {
3789
- name: 'toggled',
3790
-
3791
- self: true,
3792
-
3793
- handler(e, toggled) {
3794
- if (!toggled) {
3795
- return;
3796
- }
3797
-
3798
- this.clearTimers();
3799
- this.position();
3800
- } },
3801
-
3802
-
3803
- {
3804
- name: 'show',
3805
-
3806
- self: true,
3807
-
3808
- handler() {
3809
- active$1 = this;
3810
-
3811
- this.tracker.init();
3812
-
3813
- for (const handler of [
3814
- on(
3815
- document,
3816
- pointerDown,
3817
- (_ref2) => {let { target } = _ref2;return (
3818
- !within(target, this.$el) &&
3819
3820
  once(
3820
3821
  document,
3821
3822
  pointerUp + " " + pointerCancel + " scroll",
3822
- (_ref3) => {let { defaultPrevented, type, target: newTarget } = _ref3;
3823
+ (_ref4) => {let { defaultPrevented, type, target: newTarget } = _ref4;
3823
3824
  if (
3824
3825
  !defaultPrevented &&
3825
3826
  type === pointerUp &&
3826
- target === newTarget &&
3827
- !(this.target && within(target, this.target)))
3827
+ target === newTarget)
3828
3828
  {
3829
- this.hide(false);
3829
+ this.hide();
3830
3830
  }
3831
3831
  },
3832
- true));}),
3833
-
3834
-
3832
+ true);
3835
3833
 
3836
- on(document, 'keydown', (e) => {
3837
- if (e.keyCode === 27) {
3838
- this.hide(false);
3839
- }
3840
- }),
3834
+ }),
3835
+ { self: true });
3841
3836
 
3842
- ...(this.display === 'static' ?
3843
- [] :
3844
- (() => {
3845
- const handler = () => this.$emit();
3846
- return [
3847
- on(window, 'resize', handler),
3848
- on(document, 'scroll', handler, true),
3849
- (() => {
3850
- const observer = observeResize(
3851
- scrollParents(this.$el),
3852
- handler);
3837
+ }
3853
3838
 
3854
- return () => observer.disconnect();
3855
- })()];
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 });
3856
3849
 
3857
- })())])
3858
- {
3859
- once(this.$el, 'hide', handler, { self: true });
3860
3850
  }
3861
3851
  } },
3862
3852
 
3863
3853
 
3864
3854
  {
3865
- name: 'beforehide',
3855
+ name: 'shown',
3866
3856
 
3867
3857
  self: true,
3868
3858
 
3869
3859
  handler() {
3870
- this.clearTimers();
3871
- } },
3872
-
3873
-
3874
- {
3875
- name: 'hide',
3860
+ if (!isFocusable(this.$el)) {
3861
+ attr(this.$el, 'tabindex', '-1');
3862
+ }
3876
3863
 
3877
- handler(_ref4) {let { target } = _ref4;
3878
- if (this.$el !== target) {
3879
- active$1 =
3880
- active$1 === null && within(target, this.$el) && this.isToggled() ?
3881
- this :
3882
- active$1;
3883
- return;
3864
+ if (!$(':focus', this.$el)) {
3865
+ this.$el.focus();
3884
3866
  }
3867
+ } },
3885
3868
 
3886
- active$1 = this.isActive() ? null : active$1;
3887
- this.tracker.cancel();
3888
- } }],
3889
3869
 
3870
+ {
3871
+ name: 'hidden',
3890
3872
 
3873
+ self: true,
3891
3874
 
3892
- update: {
3893
- write() {
3894
- if (this.isToggled() && !hasClass(this.$el, this.clsEnter)) {
3895
- this.position();
3875
+ handler() {
3876
+ if (includes(active$1, this)) {
3877
+ active$1.splice(active$1.indexOf(this), 1);
3896
3878
  }
3897
- } },
3898
3879
 
3880
+ css(this.$el, 'zIndex', '');
3899
3881
 
3900
- 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);
3882
+ if (!active$1.some((modal) => modal.clsPage === this.clsPage)) {
3883
+ removeClass(document.documentElement, this.clsPage);
3904
3884
  }
3885
+ } }],
3905
3886
 
3906
- this.target = target;
3907
-
3908
- this.clearTimers();
3909
-
3910
- if (this.isActive()) {
3911
- return;
3912
- }
3913
3887
 
3914
- if (active$1) {
3915
- if (delay && active$1.isDelaying) {
3916
- this.showTimer = setTimeout(() => matches(target, ':hover') && this.show(), 10);
3917
- return;
3918
- }
3919
3888
 
3920
- let prev;
3921
- while (active$1 && prev !== active$1 && !within(this.$el, active$1.$el)) {
3922
- prev = active$1;
3923
- active$1.hide(false);
3924
- }
3925
- }
3889
+ methods: {
3890
+ toggle() {
3891
+ return this.isToggled() ? this.hide() : this.show();
3892
+ },
3926
3893
 
3894
+ show() {
3927
3895
  if (this.container && parent(this.$el) !== this.container) {
3928
3896
  append(this.container, this.$el);
3929
- }
3897
+ return new Promise((resolve) =>
3898
+ requestAnimationFrame(() => this.show().then(resolve)));
3930
3899
 
3931
- this.showTimer = setTimeout(
3932
- () => this.toggleElement(this.$el, true),
3933
- delay && this.delayShow || 0);
3900
+ }
3934
3901
 
3902
+ return this.toggleElement(this.$el, true, animate(this));
3935
3903
  },
3936
3904
 
3937
- hide(delay) {if (delay === void 0) {delay = true;}
3938
- const hide = () => this.toggleElement(this.$el, false, false);
3905
+ hide() {
3906
+ return this.toggleElement(this.$el, false, animate(this));
3907
+ } } };
3939
3908
 
3940
- this.clearTimers();
3941
3909
 
3942
- this.isDelaying = getPositionedElements(this.$el).some((el) =>
3943
- this.tracker.movesTo(el));
3944
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;
3945
3917
 
3946
- if (delay && this.isDelaying) {
3947
- this.hideTimer = setTimeout(this.hide, 50);
3948
- } else if (delay && this.delayHide) {
3949
- this.hideTimer = setTimeout(hide, this.delayHide);
3950
- } else {
3951
- hide();
3952
- }
3953
- },
3918
+ _toggle(el, show);
3954
3919
 
3955
- clearTimers() {
3956
- clearTimeout(this.showTimer);
3957
- clearTimeout(this.hideTimer);
3958
- this.showTimer = null;
3959
- this.hideTimer = null;
3960
- this.isDelaying = false;
3961
- },
3920
+ const off = once(
3921
+ transitionElement,
3922
+ 'transitionstart',
3923
+ () => {
3924
+ once(transitionElement, 'transitionend transitioncancel', resolve, {
3925
+ self: true });
3962
3926
 
3963
- isActive() {
3964
- return active$1 === this;
3927
+ clearTimeout(timer);
3965
3928
  },
3929
+ { self: true });
3966
3930
 
3967
- position() {
3968
- removeClass(this.$el, this.clsDrop + "-stack");
3969
- toggleClass(this.$el, this.clsDrop + "-boundary", this.boundaryAlign);
3970
3931
 
3971
- const boundary = query(this.boundary, this.$el);
3972
- const scrollParentOffset = offset(
3973
- scrollParents(boundary && this.boundaryAlign ? boundary : this.$el)[0]);
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
+ }
3974
3943
 
3975
- const boundaryOffset = boundary ? offset(boundary) : scrollParentOffset;
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
+ }
3976
3950
 
3977
- css(this.$el, 'maxWidth', '');
3978
- const maxWidth =
3979
- scrollParentOffset.width -
3980
- 2 * toPx(getCssVar('position-viewport-offset', this.$el));
3951
+ let startClientY;
3981
3952
 
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))));
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 }),
3991
3963
 
3992
3964
 
3993
- } else if (this.$el.offsetWidth > maxWidth) {
3994
- addClass(this.$el, this.clsDrop + "-stack");
3995
- }
3965
+ on(
3966
+ el,
3967
+ 'touchmove',
3968
+ (e) => {
3969
+ if (e.targetTouches.length !== 1) {
3970
+ return;
3971
+ }
3996
3972
 
3997
- css(this.$el, 'maxWidth', maxWidth);
3973
+ let [scrollParent] = scrollParents(e.target, /auto|scroll/);
3974
+ if (!within(scrollParent, el)) {
3975
+ scrollParent = el;
3976
+ }
3998
3977
 
3999
- this.positionAt(
4000
- this.$el,
4001
- boundary && this.boundaryAlign ? boundary : this.target,
4002
- boundary);
3978
+ const clientY = e.targetTouches[0].clientY - startClientY;
3979
+ const { scrollTop, scrollHeight, clientHeight } = scrollParent;
4003
3980
 
4004
- } } };
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 })];
4005
3990
 
4006
3991
 
4007
3992
 
4008
- function getPositionedElements(el) {
4009
- const result = [];
4010
- apply(el, (el) => css(el, 'position') !== 'static' && result.push(el));
4011
- return result;
3993
+ return () => events.forEach((fn) => fn());
4012
3994
  }
4013
3995
 
4014
- var formCustom = {
4015
- mixins: [Class],
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' });
4016
4006
 
4017
- args: 'target',
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',
4018
4031
 
4019
4032
  props: {
4020
- target: Boolean },
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 },
4021
4046
 
4022
4047
 
4023
4048
  data: {
4024
- target: false },
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 },
4025
4065
 
4026
4066
 
4027
4067
  computed: {
4028
- input(_, $el) {
4029
- return $(selInput, $el);
4030
- },
4068
+ target(_ref, $el) {let { target, targetX, targetY } = _ref;
4069
+ targetX = targetX || target || this.targetEl;
4070
+ targetY = targetY || target || this.targetEl;
4031
4071
 
4032
- state() {
4033
- return this.input.nextElementSibling;
4034
- },
4035
-
4036
- target(_ref, $el) {let { target } = _ref;
4037
- return (
4038
- target && (
4039
- target === true && parent(this.input) === $el && this.input.nextElementSibling ||
4040
- $(target, $el)));
4072
+ return [
4073
+ targetX === true ? window : query(targetX, $el),
4074
+ targetY === true ? window : query(targetY, $el)];
4041
4075
 
4042
4076
  } },
4043
4077
 
4044
4078
 
4045
- update() {var _input$files;
4046
- const { target, input } = this;
4079
+ created() {
4080
+ this.tracker = new MouseTracker();
4081
+ },
4047
4082
 
4048
- if (!target) {
4049
- return;
4050
- }
4083
+ beforeConnect() {
4084
+ this.clsDrop = this.$props.clsDrop || "uk-" + this.$options.name;
4085
+ },
4051
4086
 
4052
- let option;
4053
- const prop = isInput(target) ? 'value' : 'textContent';
4054
- const prev = target[prop];
4055
- const value = (_input$files = input.files) != null && _input$files[0] ?
4056
- input.files[0].name :
4057
- matches(input, 'select') && (
4058
- option = $$('option', input).filter((el) => el.selected)[0]) // eslint-disable-line prefer-destructuring
4059
- ? option.textContent :
4060
- input.value;
4087
+ connected() {
4088
+ addClass(this.$el, this.clsDrop);
4061
4089
 
4062
- if (prev !== value) {
4063
- target[prop] = value;
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;
4064
4103
  }
4065
4104
  },
4066
4105
 
4067
4106
  events: [
4068
4107
  {
4069
- name: 'change',
4108
+ name: 'click',
4070
4109
 
4071
- handler() {
4072
- this.$emit();
4110
+ delegate() {
4111
+ return "." + this.clsDrop + "-close";
4112
+ },
4113
+
4114
+ handler(e) {
4115
+ e.preventDefault();
4116
+ this.hide(false);
4073
4117
  } },
4074
4118
 
4075
4119
 
4076
4120
  {
4077
- name: 'reset',
4121
+ name: 'click',
4078
4122
 
4079
- el() {
4080
- return closest(this.$el, 'form');
4123
+ delegate() {
4124
+ return 'a[href^="#"]';
4081
4125
  },
4082
4126
 
4083
- handler() {
4084
- this.$emit();
4085
- } }] };
4086
-
4087
- var Margin = {
4088
- mixins: [Resize],
4127
+ handler(_ref2) {let { defaultPrevented, current: { hash } } = _ref2;
4128
+ if (!defaultPrevented && hash && !within(hash, this.$el)) {
4129
+ this.hide(false);
4130
+ }
4131
+ } },
4089
4132
 
4090
- props: {
4091
- margin: String,
4092
- firstColumn: Boolean },
4093
4133
 
4134
+ {
4135
+ name: 'beforescroll',
4094
4136
 
4095
- data: {
4096
- margin: 'uk-margin-small-top',
4097
- firstColumn: 'uk-first-column' },
4137
+ handler() {
4138
+ this.hide(false);
4139
+ } },
4098
4140
 
4099
4141
 
4100
- resizeTargets() {
4101
- return [this.$el, ...toArray(this.$el.children)];
4102
- },
4142
+ {
4143
+ name: 'toggle',
4103
4144
 
4104
- connected() {
4105
- this.registerObserver(
4106
- observeMutation(this.$el, () => this.$reset(), {
4107
- childList: true }));
4145
+ self: true,
4108
4146
 
4147
+ handler(e, toggle) {
4148
+ e.preventDefault();
4109
4149
 
4110
- },
4150
+ if (this.isToggled()) {
4151
+ this.hide(false);
4152
+ } else {
4153
+ this.show(toggle == null ? void 0 : toggle.$el, false);
4154
+ }
4155
+ } },
4111
4156
 
4112
- update: {
4113
- read() {
4114
- const rows = getRows(this.$el.children);
4115
4157
 
4116
- return {
4117
- rows,
4118
- columns: getColumns(rows) };
4158
+ {
4159
+ name: 'toggleshow',
4119
4160
 
4120
- },
4161
+ self: true,
4121
4162
 
4122
- write(_ref) {let { columns, rows } = _ref;
4123
- for (const row of rows) {
4124
- for (const column of row) {
4125
- toggleClass(column, this.margin, rows[0] !== row);
4126
- toggleClass(column, this.firstColumn, columns[0].includes(column));
4127
- }
4128
- }
4129
- },
4163
+ handler(e, toggle) {
4164
+ e.preventDefault();
4165
+ this.show(toggle == null ? void 0 : toggle.$el);
4166
+ } },
4130
4167
 
4131
- events: ['resize'] } };
4132
4168
 
4169
+ {
4170
+ name: 'togglehide',
4133
4171
 
4172
+ self: true,
4134
4173
 
4135
- function getRows(items) {
4136
- return sortBy(items, 'top', 'bottom');
4137
- }
4174
+ handler(e) {
4175
+ e.preventDefault();
4176
+ if (!matches(this.$el, ':focus,:hover')) {
4177
+ this.hide();
4178
+ }
4179
+ } },
4138
4180
 
4139
- function getColumns(rows) {
4140
- const columns = [];
4141
4181
 
4142
- for (const row of rows) {
4143
- const sorted = sortBy(row, 'left', 'right');
4144
- for (let j = 0; j < sorted.length; j++) {
4145
- columns[j] = columns[j] ? columns[j].concat(sorted[j]) : sorted[j];
4146
- }
4147
- }
4182
+ {
4183
+ name: pointerEnter + " focusin",
4148
4184
 
4149
- return isRtl ? columns.reverse() : columns;
4150
- }
4185
+ filter() {
4186
+ return includes(this.mode, 'hover');
4187
+ },
4151
4188
 
4152
- function sortBy(items, startProp, endProp) {
4153
- const sorted = [[]];
4189
+ handler(e) {
4190
+ if (!isTouch(e)) {
4191
+ this.clearTimers();
4192
+ }
4193
+ } },
4154
4194
 
4155
- for (const el of items) {
4156
- if (!isVisible(el)) {
4157
- continue;
4158
- }
4159
4195
 
4160
- let dim = getOffset(el);
4196
+ {
4197
+ name: pointerLeave + " focusout",
4161
4198
 
4162
- for (let i = sorted.length - 1; i >= 0; i--) {
4163
- const current = sorted[i];
4199
+ filter() {
4200
+ return includes(this.mode, 'hover');
4201
+ },
4164
4202
 
4165
- if (!current[0]) {
4166
- current.push(el);
4167
- break;
4203
+ handler(e) {
4204
+ if (!isTouch(e) && e.relatedTarget) {
4205
+ this.hide();
4168
4206
  }
4207
+ } },
4169
4208
 
4170
- let startDim;
4171
- if (current[0].offsetParent === el.offsetParent) {
4172
- startDim = getOffset(current[0]);
4173
- } else {
4174
- dim = getOffset(el, true);
4175
- startDim = getOffset(current[0], true);
4176
- }
4177
4209
 
4178
- if (dim[startProp] >= startDim[endProp] - 1 && dim[startProp] !== startDim[startProp]) {
4179
- sorted.push([el]);
4180
- break;
4181
- }
4210
+ {
4211
+ name: 'toggled',
4182
4212
 
4183
- if (dim[endProp] - 1 > startDim[startProp] || dim[startProp] === startDim[startProp]) {
4184
- current.push(el);
4185
- break;
4186
- }
4213
+ self: true,
4187
4214
 
4188
- if (i === 0) {
4189
- sorted.unshift([el]);
4190
- break;
4215
+ handler(e, toggled) {
4216
+ if (!toggled) {
4217
+ return;
4191
4218
  }
4192
- }
4193
- }
4194
4219
 
4195
- return sorted;
4196
- }
4220
+ this.clearTimers();
4221
+ this.position();
4222
+ } },
4197
4223
 
4198
- function getOffset(element, offset) {if (offset === void 0) {offset = false;}
4199
- let { offsetTop, offsetLeft, offsetHeight, offsetWidth } = element;
4200
4224
 
4201
- if (offset) {
4202
- [offsetTop, offsetLeft] = offsetPosition(element);
4203
- }
4225
+ {
4226
+ name: 'show',
4204
4227
 
4205
- return {
4206
- top: offsetTop,
4207
- left: offsetLeft,
4208
- bottom: offsetTop + offsetHeight,
4209
- right: offsetLeft + offsetWidth };
4228
+ self: true,
4210
4229
 
4211
- }
4230
+ handler() {
4231
+ active = this;
4212
4232
 
4213
- var Scroll = {
4214
- connected() {
4215
- registerScrollListener(this._uid, () => this.$emit('scroll'));
4216
- },
4233
+ this.tracker.init();
4217
4234
 
4218
- disconnected() {
4219
- unregisterScrollListener(this._uid);
4220
- } };
4235
+ for (const handler of [
4236
+ on(
4237
+ document,
4238
+ pointerDown,
4239
+ (_ref3) => {let { target } = _ref3;return (
4240
+ !within(target, this.$el) &&
4241
+ once(
4242
+ document,
4243
+ pointerUp + " " + pointerCancel + " scroll",
4244
+ (_ref4) => {let { defaultPrevented, type, target: newTarget } = _ref4;
4245
+ if (
4246
+ !defaultPrevented &&
4247
+ type === pointerUp &&
4248
+ target === newTarget &&
4249
+ !(this.targetEl && within(target, this.targetEl)))
4250
+ {
4251
+ this.hide(false);
4252
+ }
4253
+ },
4254
+ true));}),
4221
4255
 
4222
4256
 
4223
- const scrollListeners = new Map();
4224
- let unbindScrollListener;
4225
- function registerScrollListener(id, listener) {
4226
- unbindScrollListener =
4227
- unbindScrollListener ||
4228
- on(window, 'scroll', () => scrollListeners.forEach((listener) => listener()), {
4229
- passive: true,
4230
- capture: true });
4231
4257
 
4258
+ on(document, 'keydown', (e) => {
4259
+ if (e.keyCode === 27) {
4260
+ this.hide(false);
4261
+ }
4262
+ }),
4232
4263
 
4233
- scrollListeners.set(id, listener);
4234
- }
4264
+ ...(this.bgScroll ?
4265
+ [] :
4266
+ [preventOverscroll(this.$el), preventBackgroundScroll()]),
4235
4267
 
4236
- function unregisterScrollListener(id) {
4237
- scrollListeners.delete(id);
4238
- if (unbindScrollListener && !scrollListeners.size) {
4239
- unbindScrollListener();
4240
- unbindScrollListener = null;
4241
- }
4242
- }
4243
-
4244
- var grid = {
4245
- extends: Margin,
4268
+ ...(this.display === 'static' ?
4269
+ [] :
4270
+ (() => {
4271
+ const handler = () => this.$emit();
4272
+ return [
4273
+ on(window, 'resize', handler),
4274
+ on([document, scrollParents(this.$el)], 'scroll', handler),
4275
+ (() => {
4276
+ const observer = observeResize(
4277
+ scrollParents(this.$el),
4278
+ handler);
4246
4279
 
4247
- mixins: [Class, Scroll],
4280
+ return () => observer.disconnect();
4281
+ })()];
4248
4282
 
4249
- name: 'grid',
4283
+ })())])
4284
+ {
4285
+ once(this.$el, 'hide', handler, { self: true });
4286
+ }
4287
+ } },
4250
4288
 
4251
- props: {
4252
- masonry: Boolean,
4253
- parallax: Number },
4254
4289
 
4290
+ {
4291
+ name: 'beforehide',
4255
4292
 
4256
- data: {
4257
- margin: 'uk-grid-margin',
4258
- clsStack: 'uk-grid-stack',
4259
- masonry: false,
4260
- parallax: 0 },
4293
+ self: true,
4261
4294
 
4295
+ handler() {
4296
+ this.clearTimers();
4297
+ } },
4262
4298
 
4263
- connected() {
4264
- this.masonry && addClass(this.$el, 'uk-flex-top uk-flex-wrap-top');
4265
- },
4266
4299
 
4267
- update: [
4268
4300
  {
4269
- write(_ref) {let { columns } = _ref;
4270
- toggleClass(this.$el, this.clsStack, columns.length < 2);
4271
- },
4301
+ name: 'hide',
4272
4302
 
4273
- events: ['resize'] },
4303
+ handler(_ref5) {let { target } = _ref5;
4304
+ if (this.$el !== target) {
4305
+ active =
4306
+ active === null && within(target, this.$el) && this.isToggled() ?
4307
+ this :
4308
+ active;
4309
+ return;
4310
+ }
4274
4311
 
4312
+ active = this.isActive() ? null : active;
4313
+ this.tracker.cancel();
4314
+ } }],
4275
4315
 
4276
- {
4277
- read(data) {
4278
- let { columns, rows } = data;
4279
4316
 
4280
- // Filter component makes elements positioned absolute
4281
- if (
4282
- !columns.length ||
4283
- !this.masonry && !this.parallax ||
4284
- positionedAbsolute(this.$el))
4285
- {
4286
- data.translates = false;
4287
- return false;
4317
+
4318
+ update: {
4319
+ write() {
4320
+ if (this.isToggled() && !hasClass(this.$el, this.clsEnter)) {
4321
+ this.position();
4288
4322
  }
4323
+ } },
4289
4324
 
4290
- let translates = false;
4291
4325
 
4292
- const nodes = children(this.$el);
4293
- const columnHeights = getColumnHeights(columns);
4294
- const margin = getMarginTop(nodes, this.margin) * (rows.length - 1);
4295
- const elHeight = Math.max(...columnHeights) + margin;
4326
+ methods: {
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);
4330
+ }
4296
4331
 
4297
- if (this.masonry) {
4298
- columns = columns.map((column) => sortBy$1(column, 'offsetTop'));
4299
- translates = getTranslates(rows, columns);
4332
+ this.targetEl = target;
4333
+
4334
+ this.clearTimers();
4335
+
4336
+ if (this.isActive()) {
4337
+ return;
4300
4338
  }
4301
4339
 
4302
- let padding = Math.abs(this.parallax);
4303
- if (padding) {
4304
- padding = columnHeights.reduce(
4305
- (newPadding, hgt, i) =>
4306
- Math.max(
4307
- newPadding,
4308
- hgt + margin + (i % 2 ? padding : padding / 8) - elHeight),
4340
+ if (active) {
4341
+ if (delay && active.isDelaying) {
4342
+ this.showTimer = setTimeout(() => matches(target, ':hover') && this.show(), 10);
4343
+ return;
4344
+ }
4309
4345
 
4310
- 0);
4346
+ let prev;
4347
+ while (active && prev !== active && !within(this.$el, active.$el)) {
4348
+ prev = active;
4349
+ active.hide(false, false);
4350
+ }
4351
+ }
4311
4352
 
4353
+ if (this.container && parent(this.$el) !== this.container) {
4354
+ append(this.container, this.$el);
4312
4355
  }
4313
4356
 
4314
- return { padding, columns, translates, height: translates ? elHeight : '' };
4315
- },
4357
+ this.showTimer = setTimeout(
4358
+ () => this.toggleElement(this.$el, true),
4359
+ delay && this.delayShow || 0);
4316
4360
 
4317
- write(_ref2) {let { height, padding } = _ref2;
4318
- css(this.$el, 'paddingBottom', padding || '');
4319
- height !== false && css(this.$el, 'height', height);
4320
4361
  },
4321
4362
 
4322
- events: ['resize'] },
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);
4323
4365
 
4366
+ this.clearTimers();
4324
4367
 
4325
- {
4326
- read() {
4327
- if (this.parallax && positionedAbsolute(this.$el)) {
4328
- return false;
4368
+ this.isDelaying = getPositionedElements(this.$el).some((el) =>
4369
+ this.tracker.movesTo(el));
4370
+
4371
+
4372
+ if (delay && this.isDelaying) {
4373
+ this.hideTimer = setTimeout(this.hide, 50);
4374
+ } else if (delay && this.delayHide) {
4375
+ this.hideTimer = setTimeout(hide, this.delayHide);
4376
+ } else {
4377
+ hide();
4329
4378
  }
4379
+ },
4330
4380
 
4331
- return {
4332
- scrolled: this.parallax ?
4333
- scrolledOver(this.$el) * Math.abs(this.parallax) :
4334
- false };
4381
+ clearTimers() {
4382
+ clearTimeout(this.showTimer);
4383
+ clearTimeout(this.hideTimer);
4384
+ this.showTimer = null;
4385
+ this.hideTimer = null;
4386
+ this.isDelaying = false;
4387
+ },
4335
4388
 
4389
+ isActive() {
4390
+ return active === this;
4336
4391
  },
4337
4392
 
4338
- write(_ref3) {let { columns, scrolled, translates } = _ref3;
4339
- if (scrolled === false && !translates) {
4340
- return;
4341
- }
4393
+ position() {
4394
+ removeClass(this.$el, this.clsDrop + "-stack");
4395
+ attr(this.$el, 'style', this._style);
4342
4396
 
4343
- columns.forEach((column, i) =>
4344
- column.forEach((el, j) =>
4345
- css(
4346
- el,
4347
- 'transform',
4348
- !scrolled && !translates ?
4349
- '' : "translateY(" + (
4397
+ // Ensure none positioned element does not generate scrollbars
4398
+ this.$el.hidden = true;
4350
4399
 
4351
- (translates && -translates[i][j]) + (
4352
- scrolled ? i % 2 ? scrolled : scrolled / 8 : 0)) + "px)")));
4400
+ const boundary = query(this.boundary, this.$el);
4401
+ const boundaryOffset = offsetViewport(boundary || window);
4402
+ const viewports = this.target.map((target) => offsetViewport(scrollParents(target)[0]));
4403
+ const viewportOffset = this.getViewportOffset(this.$el);
4353
4404
 
4405
+ const dirs = [
4406
+ [0, ['x', 'width', 'left', 'right']],
4407
+ [1, ['y', 'height', 'top', 'bottom']]];
4354
4408
 
4355
4409
 
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),
4356
4416
 
4357
- },
4417
+ ["overflow-" + axis]: 'auto' });
4358
4418
 
4359
- events: ['scroll', 'resize'] }] };
4419
+ }
4420
+ }
4360
4421
 
4422
+ const maxWidth = viewports[0].width - 2 * viewportOffset;
4361
4423
 
4424
+ if (this.$el.offsetWidth > maxWidth) {
4425
+ addClass(this.$el, this.clsDrop + "-stack");
4426
+ }
4362
4427
 
4428
+ css(this.$el, 'maxWidth', maxWidth);
4363
4429
 
4364
- function positionedAbsolute(el) {
4365
- return children(el).some((el) => css(el, 'position') === 'absolute');
4366
- }
4430
+ this.$el.hidden = false;
4367
4431
 
4368
- function getTranslates(rows, columns) {
4369
- const rowHeights = rows.map((row) => Math.max(...row.map((el) => el.offsetHeight)));
4432
+ this.positionAt(this.$el, this.target, boundary);
4370
4433
 
4371
- return columns.map((elements) => {
4372
- let prev = 0;
4373
- return elements.map(
4374
- (element, row) =>
4375
- prev += row ? rowHeights[row - 1] - elements[row - 1].offsetHeight : 0);
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);
4376
4439
 
4377
- });
4378
- }
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) :
4379
4447
 
4380
- function getMarginTop(nodes, cls) {
4381
- const [node] = nodes.filter((el) => hasClass(el, cls));
4448
+ Math.min(
4449
+ boundaryOffset[end],
4450
+ viewports[i][end] - viewportOffset) -
4451
+ targetOffset[end]) - positionOffset,
4452
+ ["overflow-" + axis]: 'auto' });
4382
4453
 
4383
- return toFloat(node ? css(node, 'marginTop') : css(nodes[0], 'paddingLeft'));
4384
- }
4385
4454
 
4386
- function getColumnHeights(columns) {
4387
- return columns.map((column) => column.reduce((sum, el) => sum + el.offsetHeight, 0));
4455
+ this.positionAt(this.$el, this.target, boundary);
4456
+ }
4457
+ }
4458
+ } } };
4459
+
4460
+
4461
+
4462
+ function getPositionedElements(el) {
4463
+ const result = [];
4464
+ apply(el, (el) => css(el, 'position') !== 'static' && result.push(el));
4465
+ return result;
4388
4466
  }
4389
4467
 
4390
- var heightMatch = {
4391
- mixins: [Resize],
4468
+ var formCustom = {
4469
+ mixins: [Class],
4392
4470
 
4393
4471
  args: 'target',
4394
4472
 
4395
4473
  props: {
4396
- target: String,
4397
- row: Boolean },
4474
+ target: Boolean },
4398
4475
 
4399
4476
 
4400
4477
  data: {
4401
- target: '> *',
4402
- row: true },
4478
+ target: false },
4403
4479
 
4404
4480
 
4405
4481
  computed: {
4406
- elements: {
4407
- get(_ref, $el) {let { target } = _ref;
4408
- return $$(target, $el);
4409
- },
4410
-
4411
- watch() {
4412
- this.$reset();
4413
- } } },
4414
-
4415
-
4416
-
4417
- resizeTargets() {
4418
- return [this.$el, ...this.elements];
4419
- },
4420
-
4421
- update: {
4422
- read() {
4423
- return {
4424
- rows: (this.row ? getRows(this.elements) : [this.elements]).map(match) };
4425
-
4482
+ input(_, $el) {
4483
+ return $(selInput, $el);
4426
4484
  },
4427
4485
 
4428
- write(_ref2) {let { rows } = _ref2;
4429
- for (const { heights, elements } of rows) {
4430
- elements.forEach((el, i) => css(el, 'minHeight', heights[i]));
4431
- }
4486
+ state() {
4487
+ return this.input.nextElementSibling;
4432
4488
  },
4433
4489
 
4434
- events: ['resize'] } };
4435
-
4490
+ target(_ref, $el) {let { target } = _ref;
4491
+ return (
4492
+ target && (
4493
+ target === true && parent(this.input) === $el && this.input.nextElementSibling ||
4494
+ $(target, $el)));
4436
4495
 
4496
+ } },
4437
4497
 
4438
- function match(elements) {
4439
- if (elements.length < 2) {
4440
- return { heights: [''], elements };
4441
- }
4442
4498
 
4443
- css(elements, 'minHeight', '');
4444
- let heights = elements.map(getHeight);
4445
- const max = Math.max(...heights);
4499
+ update() {var _input$files;
4500
+ const { target, input } = this;
4446
4501
 
4447
- return {
4448
- heights: elements.map((el, i) => heights[i].toFixed(2) === max.toFixed(2) ? '' : max),
4449
- elements };
4502
+ if (!target) {
4503
+ return;
4504
+ }
4450
4505
 
4451
- }
4506
+ let option;
4507
+ const prop = isInput(target) ? 'value' : 'textContent';
4508
+ const prev = target[prop];
4509
+ const value = (_input$files = input.files) != null && _input$files[0] ?
4510
+ input.files[0].name :
4511
+ matches(input, 'select') && (
4512
+ option = $$('option', input).filter((el) => el.selected)[0]) // eslint-disable-line prefer-destructuring
4513
+ ? option.textContent :
4514
+ input.value;
4452
4515
 
4453
- function getHeight(element) {
4454
- let style = false;
4455
- if (!isVisible(element)) {
4456
- style = element.style.display;
4457
- css(element, 'display', 'block', 'important');
4458
- }
4516
+ if (prev !== value) {
4517
+ target[prop] = value;
4518
+ }
4519
+ },
4459
4520
 
4460
- const height = dimensions(element).height - boxModelAdjust(element, 'height', 'content-box');
4521
+ events: [
4522
+ {
4523
+ name: 'change',
4461
4524
 
4462
- if (style !== false) {
4463
- css(element, 'display', style);
4464
- }
4525
+ handler() {
4526
+ this.$emit();
4527
+ } },
4465
4528
 
4466
- return height;
4467
- }
4468
4529
 
4469
- var heightViewport = {
4530
+ {
4531
+ name: 'reset',
4532
+
4533
+ el() {
4534
+ return closest(this.$el, 'form');
4535
+ },
4536
+
4537
+ handler() {
4538
+ this.$emit();
4539
+ } }] };
4540
+
4541
+ var Margin = {
4470
4542
  mixins: [Resize],
4471
4543
 
4472
4544
  props: {
4473
- expand: Boolean,
4474
- offsetTop: Boolean,
4475
- offsetBottom: Boolean,
4476
- minHeight: Number },
4545
+ margin: String,
4546
+ firstColumn: Boolean },
4477
4547
 
4478
4548
 
4479
4549
  data: {
4480
- expand: false,
4481
- offsetTop: false,
4482
- offsetBottom: false,
4483
- minHeight: 0 },
4550
+ margin: 'uk-margin-small-top',
4551
+ firstColumn: 'uk-first-column' },
4484
4552
 
4485
4553
 
4486
4554
  resizeTargets() {
4487
- // check for offsetTop change
4488
- return [this.$el, document.documentElement];
4555
+ return [this.$el, ...toArray(this.$el.children)];
4489
4556
  },
4490
4557
 
4491
- update: {
4492
- read(_ref) {let { minHeight: prev } = _ref;
4493
- if (!isVisible(this.$el)) {
4494
- return false;
4495
- }
4496
-
4497
- let minHeight = '';
4498
- const box = boxModelAdjust(this.$el, 'height', 'content-box');
4499
-
4500
- if (this.expand) {
4501
- minHeight = Math.max(
4502
- height(window) - (
4503
- dimensions(document.documentElement).height -
4504
- dimensions(this.$el).height) -
4505
- box,
4506
- 0);
4558
+ connected() {
4559
+ this.registerObserver(
4560
+ observeMutation(this.$el, () => this.$reset(), {
4561
+ childList: true }));
4507
4562
 
4508
- } else {
4509
- // on mobile devices (iOS and Android) window.innerHeight !== 100vh
4510
- minHeight = 'calc(100vh';
4511
4563
 
4512
- if (this.offsetTop) {
4513
- const { top } = offset(this.$el);
4514
- minHeight += top > 0 && top < height(window) / 2 ? " - " + top + "px" : '';
4515
- }
4564
+ },
4516
4565
 
4517
- if (this.offsetBottom === true) {
4518
- minHeight += " - " + dimensions(this.$el.nextElementSibling).height + "px";
4519
- } else if (isNumeric(this.offsetBottom)) {
4520
- minHeight += " - " + this.offsetBottom + "vh";
4521
- } else if (this.offsetBottom && endsWith(this.offsetBottom, 'px')) {
4522
- minHeight += " - " + toFloat(this.offsetBottom) + "px";
4523
- } else if (isString(this.offsetBottom)) {
4524
- minHeight += " - " + dimensions(query(this.offsetBottom, this.$el)).height + "px";
4525
- }
4566
+ update: {
4567
+ read() {
4568
+ const rows = getRows(this.$el.children);
4526
4569
 
4527
- minHeight += (box ? " - " + box + "px" : '') + ")";
4528
- }
4570
+ return {
4571
+ rows,
4572
+ columns: getColumns(rows) };
4529
4573
 
4530
- return { minHeight, prev };
4531
4574
  },
4532
4575
 
4533
- write(_ref2) {let { minHeight } = _ref2;
4534
- css(this.$el, { minHeight });
4535
-
4536
- if (this.minHeight && toFloat(css(this.$el, 'minHeight')) < this.minHeight) {
4537
- css(this.$el, 'minHeight', this.minHeight);
4576
+ write(_ref) {let { columns, rows } = _ref;
4577
+ for (const row of rows) {
4578
+ for (const column of row) {
4579
+ toggleClass(column, this.margin, rows[0] !== row);
4580
+ toggleClass(column, this.firstColumn, columns[0].includes(column));
4581
+ }
4538
4582
  }
4539
4583
  },
4540
4584
 
4541
4585
  events: ['resize'] } };
4542
4586
 
4543
- var SVG = {
4544
- args: 'src',
4545
4587
 
4546
- props: {
4547
- id: Boolean,
4548
- icon: String,
4549
- src: String,
4550
- style: String,
4551
- width: Number,
4552
- height: Number,
4553
- ratio: Number,
4554
- class: String,
4555
- strokeAnimation: Boolean,
4556
- focusable: Boolean, // IE 11
4557
- attributes: 'list' },
4558
4588
 
4589
+ function getRows(items) {
4590
+ return sortBy(items, 'top', 'bottom');
4591
+ }
4559
4592
 
4560
- data: {
4561
- ratio: 1,
4562
- include: ['style', 'class', 'focusable'],
4563
- class: '',
4564
- strokeAnimation: false },
4593
+ function getColumns(rows) {
4594
+ const columns = [];
4565
4595
 
4596
+ for (const row of rows) {
4597
+ const sorted = sortBy(row, 'left', 'right');
4598
+ for (let j = 0; j < sorted.length; j++) {
4599
+ columns[j] = columns[j] ? columns[j].concat(sorted[j]) : sorted[j];
4600
+ }
4601
+ }
4566
4602
 
4567
- beforeConnect() {
4568
- this.class += ' uk-svg';
4569
- },
4603
+ return isRtl ? columns.reverse() : columns;
4604
+ }
4570
4605
 
4571
- connected() {
4572
- if (!this.icon && includes(this.src, '#')) {
4573
- [this.src, this.icon] = this.src.split('#');
4574
- }
4606
+ function sortBy(items, startProp, endProp) {
4607
+ const sorted = [[]];
4575
4608
 
4576
- this.svg = this.getSvg().then((el) => {
4577
- if (this._connected) {
4578
- const svg = insertSVG(el, this.$el);
4609
+ for (const el of items) {
4610
+ if (!isVisible(el)) {
4611
+ continue;
4612
+ }
4579
4613
 
4580
- if (this.svgEl && svg !== this.svgEl) {
4581
- remove$1(this.svgEl);
4582
- }
4614
+ let dim = getOffset(el);
4583
4615
 
4584
- this.applyAttributes(svg, el);
4616
+ for (let i = sorted.length - 1; i >= 0; i--) {
4617
+ const current = sorted[i];
4585
4618
 
4586
- return this.svgEl = svg;
4619
+ if (!current[0]) {
4620
+ current.push(el);
4621
+ break;
4587
4622
  }
4588
- }, noop);
4589
4623
 
4590
- if (this.strokeAnimation) {
4591
- this.svg.then((el) => {
4592
- if (this._connected) {
4593
- applyAnimation(el);
4594
- this.registerObserver(
4595
- observeIntersection(el, (records, observer) => {
4596
- applyAnimation(el);
4597
- observer.disconnect();
4598
- }));
4624
+ let startDim;
4625
+ if (current[0].offsetParent === el.offsetParent) {
4626
+ startDim = getOffset(current[0]);
4627
+ } else {
4628
+ dim = getOffset(el, true);
4629
+ startDim = getOffset(current[0], true);
4630
+ }
4599
4631
 
4600
- }
4601
- });
4602
- }
4603
- },
4632
+ if (dim[startProp] >= startDim[endProp] - 1 && dim[startProp] !== startDim[startProp]) {
4633
+ sorted.push([el]);
4634
+ break;
4635
+ }
4604
4636
 
4605
- disconnected() {
4606
- this.svg.then((svg) => {
4607
- if (this._connected) {
4608
- return;
4637
+ if (dim[endProp] - 1 > startDim[startProp] || dim[startProp] === startDim[startProp]) {
4638
+ current.push(el);
4639
+ break;
4609
4640
  }
4610
4641
 
4611
- if (isVoidElement(this.$el)) {
4612
- this.$el.hidden = false;
4642
+ if (i === 0) {
4643
+ sorted.unshift([el]);
4644
+ break;
4613
4645
  }
4646
+ }
4647
+ }
4614
4648
 
4615
- remove$1(svg);
4616
- this.svgEl = null;
4617
- });
4649
+ return sorted;
4650
+ }
4618
4651
 
4619
- this.svg = null;
4620
- },
4652
+ function getOffset(element, offset) {if (offset === void 0) {offset = false;}
4653
+ let { offsetTop, offsetLeft, offsetHeight, offsetWidth } = element;
4621
4654
 
4622
- methods: {
4623
- async getSvg() {
4624
- if (isTag(this.$el, 'img') && !this.$el.complete && this.$el.loading === 'lazy') {
4625
- return new Promise((resolve) =>
4626
- once(this.$el, 'load', () => resolve(this.getSvg())));
4655
+ if (offset) {
4656
+ [offsetTop, offsetLeft] = offsetPosition(element);
4657
+ }
4627
4658
 
4628
- }
4659
+ return {
4660
+ top: offsetTop,
4661
+ left: offsetLeft,
4662
+ bottom: offsetTop + offsetHeight,
4663
+ right: offsetLeft + offsetWidth };
4629
4664
 
4630
- return parseSVG(await loadSVG(this.src), this.icon) || Promise.reject('SVG not found.');
4631
- },
4665
+ }
4632
4666
 
4633
- applyAttributes(el, ref) {
4634
- for (const prop in this.$options.props) {
4635
- if (includes(this.include, prop) && prop in this) {
4636
- attr(el, prop, this[prop]);
4637
- }
4638
- }
4667
+ var Scroll = {
4668
+ connected() {
4669
+ registerScrollListener(this._uid, () => this.$emit('scroll'));
4670
+ },
4639
4671
 
4640
- for (const attribute in this.attributes) {
4641
- const [prop, value] = this.attributes[attribute].split(':', 2);
4642
- attr(el, prop, value);
4643
- }
4672
+ disconnected() {
4673
+ unregisterScrollListener(this._uid);
4674
+ } };
4644
4675
 
4645
- if (!this.id) {
4646
- removeAttr(el, 'id');
4647
- }
4648
4676
 
4649
- const props = ['width', 'height'];
4650
- let dimensions = props.map((prop) => this[prop]);
4651
-
4652
- if (!dimensions.some((val) => val)) {
4653
- dimensions = props.map((prop) => attr(ref, prop));
4654
- }
4655
-
4656
- const viewBox = attr(ref, 'viewBox');
4657
- if (viewBox && !dimensions.some((val) => val)) {
4658
- dimensions = viewBox.split(' ').slice(2);
4659
- }
4660
-
4661
- dimensions.forEach((val, i) => attr(el, props[i], toFloat(val) * this.ratio || null));
4662
- } } };
4677
+ const scrollListeners = new Map();
4678
+ let unbindScrollListener;
4679
+ function registerScrollListener(id, listener) {
4680
+ unbindScrollListener =
4681
+ unbindScrollListener ||
4682
+ on(window, 'scroll', () => scrollListeners.forEach((listener) => listener()), {
4683
+ passive: true,
4684
+ capture: true });
4663
4685
 
4664
4686
 
4687
+ scrollListeners.set(id, listener);
4688
+ }
4665
4689
 
4666
- const loadSVG = memoize(async (src) => {
4667
- if (src) {
4668
- if (startsWith(src, 'data:')) {
4669
- return decodeURIComponent(src.split(',')[1]);
4670
- } else {
4671
- return (await fetch(src)).text();
4672
- }
4673
- } else {
4674
- return Promise.reject();
4690
+ function unregisterScrollListener(id) {
4691
+ scrollListeners.delete(id);
4692
+ if (unbindScrollListener && !scrollListeners.size) {
4693
+ unbindScrollListener();
4694
+ unbindScrollListener = null;
4675
4695
  }
4676
- });
4696
+ }
4677
4697
 
4678
- function parseSVG(svg, icon) {var _svg;
4679
- if (icon && includes(svg, '<symbol')) {
4680
- svg = parseSymbols(svg, icon) || svg;
4681
- }
4698
+ var grid = {
4699
+ extends: Margin,
4682
4700
 
4683
- svg = $(svg.substr(svg.indexOf('<svg')));
4684
- return ((_svg = svg) == null ? void 0 : _svg.hasChildNodes()) && svg;
4685
- }
4701
+ mixins: [Class, Scroll],
4686
4702
 
4687
- const symbolRe = /<symbol([^]*?id=(['"])(.+?)\2[^]*?<\/)symbol>/g;
4688
- const symbols = {};
4703
+ name: 'grid',
4689
4704
 
4690
- function parseSymbols(svg, icon) {
4691
- if (!symbols[svg]) {
4692
- symbols[svg] = {};
4705
+ props: {
4706
+ masonry: Boolean,
4707
+ parallax: Number },
4693
4708
 
4694
- symbolRe.lastIndex = 0;
4695
4709
 
4696
- let match;
4697
- while (match = symbolRe.exec(svg)) {
4698
- symbols[svg][match[3]] = "<svg xmlns=\"http://www.w3.org/2000/svg\"" + match[1] + "svg>";
4699
- }
4700
- }
4710
+ data: {
4711
+ margin: 'uk-grid-margin',
4712
+ clsStack: 'uk-grid-stack',
4713
+ masonry: false,
4714
+ parallax: 0 },
4701
4715
 
4702
- return symbols[svg][icon];
4703
- }
4704
4716
 
4705
- function applyAnimation(el) {
4706
- const length = getMaxPathLength(el);
4717
+ connected() {
4718
+ this.masonry && addClass(this.$el, 'uk-flex-top uk-flex-wrap-top');
4719
+ },
4707
4720
 
4708
- if (length) {
4709
- el.style.setProperty('--uk-animation-stroke', length);
4710
- }
4711
- }
4721
+ update: [
4722
+ {
4723
+ write(_ref) {let { columns } = _ref;
4724
+ toggleClass(this.$el, this.clsStack, columns.length < 2);
4725
+ },
4712
4726
 
4713
- function getMaxPathLength(el) {
4714
- return Math.ceil(
4715
- Math.max(
4716
- 0,
4717
- ...$$('[stroke]', el).map((stroke) => {
4718
- try {
4719
- return stroke.getTotalLength();
4720
- } catch (e) {
4721
- return 0;
4722
- }
4723
- })));
4727
+ events: ['resize'] },
4724
4728
 
4725
4729
 
4726
- }
4730
+ {
4731
+ read(data) {
4732
+ let { columns, rows } = data;
4727
4733
 
4728
- function insertSVG(el, root) {
4729
- if (isVoidElement(root) || isTag(root, 'canvas')) {
4730
- root.hidden = true;
4734
+ // Filter component makes elements positioned absolute
4735
+ if (
4736
+ !columns.length ||
4737
+ !this.masonry && !this.parallax ||
4738
+ positionedAbsolute(this.$el))
4739
+ {
4740
+ data.translates = false;
4741
+ return false;
4742
+ }
4731
4743
 
4732
- const next = root.nextElementSibling;
4733
- return equals(el, next) ? next : after(root, el);
4734
- }
4744
+ let translates = false;
4735
4745
 
4736
- const last = root.lastElementChild;
4737
- return equals(el, last) ? last : append(root, el);
4738
- }
4746
+ const nodes = children(this.$el);
4747
+ const columnHeights = getColumnHeights(columns);
4748
+ const margin = getMarginTop(nodes, this.margin) * (rows.length - 1);
4749
+ const elHeight = Math.max(...columnHeights) + margin;
4739
4750
 
4740
- function equals(el, other) {
4741
- return isTag(el, 'svg') && isTag(other, 'svg') && innerHTML(el) === innerHTML(other);
4742
- }
4751
+ if (this.masonry) {
4752
+ columns = columns.map((column) => sortBy$1(column, 'offsetTop'));
4753
+ translates = getTranslates(rows, columns);
4754
+ }
4743
4755
 
4744
- function innerHTML(el) {
4745
- return (
4746
- el.innerHTML ||
4747
- new XMLSerializer().serializeToString(el).replace(/<svg.*?>(.*?)<\/svg>/g, '$1')).
4748
- replace(/\s/g, '');
4749
- }
4756
+ let padding = Math.abs(this.parallax);
4757
+ if (padding) {
4758
+ padding = columnHeights.reduce(
4759
+ (newPadding, hgt, i) =>
4760
+ Math.max(
4761
+ newPadding,
4762
+ hgt + margin + (i % 2 ? padding : padding / 8) - elHeight),
4750
4763
 
4751
- var closeIcon = "<svg width=\"14\" height=\"14\" viewBox=\"0 0 14 14\" xmlns=\"http://www.w3.org/2000/svg\"><line fill=\"none\" stroke=\"#000\" stroke-width=\"1.1\" x1=\"1\" y1=\"1\" x2=\"13\" y2=\"13\"/><line fill=\"none\" stroke=\"#000\" stroke-width=\"1.1\" x1=\"13\" y1=\"1\" x2=\"1\" y2=\"13\"/></svg>";
4764
+ 0);
4752
4765
 
4753
- var closeLarge = "<svg width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><line fill=\"none\" stroke=\"#000\" stroke-width=\"1.4\" x1=\"1\" y1=\"1\" x2=\"19\" y2=\"19\"/><line fill=\"none\" stroke=\"#000\" stroke-width=\"1.4\" x1=\"19\" y1=\"1\" x2=\"1\" y2=\"19\"/></svg>";
4766
+ }
4754
4767
 
4755
- 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>";
4768
+ return { padding, columns, translates, height: translates ? elHeight : '' };
4769
+ },
4756
4770
 
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>";
4771
+ write(_ref2) {let { height, padding } = _ref2;
4772
+ css(this.$el, 'paddingBottom', padding || '');
4773
+ height !== false && css(this.$el, 'height', height);
4774
+ },
4758
4775
 
4759
- 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>";
4776
+ events: ['resize'] },
4760
4777
 
4761
- var paginationNext = "<svg width=\"7\" height=\"12\" viewBox=\"0 0 7 12\" xmlns=\"http://www.w3.org/2000/svg\"><polyline fill=\"none\" stroke=\"#000\" stroke-width=\"1.2\" points=\"1 1 6 6 1 11\"/></svg>";
4762
4778
 
4763
- var paginationPrevious = "<svg width=\"7\" height=\"12\" viewBox=\"0 0 7 12\" xmlns=\"http://www.w3.org/2000/svg\"><polyline fill=\"none\" stroke=\"#000\" stroke-width=\"1.2\" points=\"6 1 1 6 6 11\"/></svg>";
4779
+ {
4780
+ read() {
4781
+ if (this.parallax && positionedAbsolute(this.$el)) {
4782
+ return false;
4783
+ }
4764
4784
 
4765
- var searchIcon = "<svg width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><circle fill=\"none\" stroke=\"#000\" stroke-width=\"1.1\" cx=\"9\" cy=\"9\" r=\"7\"/><path fill=\"none\" stroke=\"#000\" stroke-width=\"1.1\" d=\"M14,14 L18,18 L14,14 Z\"/></svg>";
4785
+ return {
4786
+ scrolled: this.parallax ?
4787
+ scrolledOver(this.$el) * Math.abs(this.parallax) :
4788
+ false };
4766
4789
 
4767
- var searchLarge = "<svg width=\"40\" height=\"40\" viewBox=\"0 0 40 40\" xmlns=\"http://www.w3.org/2000/svg\"><circle fill=\"none\" stroke=\"#000\" stroke-width=\"1.8\" cx=\"17.5\" cy=\"17.5\" r=\"16.5\"/><line fill=\"none\" stroke=\"#000\" stroke-width=\"1.8\" x1=\"38\" y1=\"39\" x2=\"29\" y2=\"30\"/></svg>";
4790
+ },
4768
4791
 
4769
- var searchNavbar = "<svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" xmlns=\"http://www.w3.org/2000/svg\"><circle fill=\"none\" stroke=\"#000\" stroke-width=\"1.1\" cx=\"10.5\" cy=\"10.5\" r=\"9.5\"/><line fill=\"none\" stroke=\"#000\" stroke-width=\"1.1\" x1=\"23\" y1=\"23\" x2=\"17\" y2=\"17\"/></svg>";
4792
+ write(_ref3) {let { columns, scrolled, translates } = _ref3;
4793
+ if (scrolled === false && !translates) {
4794
+ return;
4795
+ }
4770
4796
 
4771
- var slidenavNext = "<svg width=\"14\" height=\"24\" viewBox=\"0 0 14 24\" xmlns=\"http://www.w3.org/2000/svg\"><polyline fill=\"none\" stroke=\"#000\" stroke-width=\"1.4\" points=\"1.225,23 12.775,12 1.225,1 \"/></svg>";
4797
+ columns.forEach((column, i) =>
4798
+ column.forEach((el, j) =>
4799
+ css(
4800
+ el,
4801
+ 'transform',
4802
+ !scrolled && !translates ?
4803
+ '' : "translateY(" + (
4772
4804
 
4773
- var slidenavNextLarge = "<svg width=\"25\" height=\"40\" viewBox=\"0 0 25 40\" xmlns=\"http://www.w3.org/2000/svg\"><polyline fill=\"none\" stroke=\"#000\" stroke-width=\"2\" points=\"4.002,38.547 22.527,20.024 4,1.5 \"/></svg>";
4805
+ (translates && -translates[i][j]) + (
4806
+ scrolled ? i % 2 ? scrolled : scrolled / 8 : 0)) + "px)")));
4774
4807
 
4775
- var slidenavPrevious = "<svg width=\"14\" height=\"24\" viewBox=\"0 0 14 24\" xmlns=\"http://www.w3.org/2000/svg\"><polyline fill=\"none\" stroke=\"#000\" stroke-width=\"1.4\" points=\"12.775,1 1.225,12 12.775,23 \"/></svg>";
4776
4808
 
4777
- var slidenavPreviousLarge = "<svg width=\"25\" height=\"40\" viewBox=\"0 0 25 40\" xmlns=\"http://www.w3.org/2000/svg\"><polyline fill=\"none\" stroke=\"#000\" stroke-width=\"2\" points=\"20.527,1.5 2,20.024 20.525,38.547 \"/></svg>";
4778
4809
 
4779
- var spinner = "<svg width=\"30\" height=\"30\" viewBox=\"0 0 30 30\" xmlns=\"http://www.w3.org/2000/svg\"><circle fill=\"none\" stroke=\"#000\" cx=\"15\" cy=\"15\" r=\"14\"/></svg>";
4780
4810
 
4781
- var totop = "<svg width=\"18\" height=\"10\" viewBox=\"0 0 18 10\" xmlns=\"http://www.w3.org/2000/svg\"><polyline fill=\"none\" stroke=\"#000\" stroke-width=\"1.2\" points=\"1 9 9 1 17 9 \"/></svg>";
4811
+ },
4782
4812
 
4783
- const icons = {
4784
- spinner,
4785
- totop,
4786
- marker,
4787
- 'close-icon': closeIcon,
4788
- 'close-large': closeLarge,
4789
- 'navbar-toggle-icon': navbarToggleIcon,
4790
- 'overlay-icon': overlayIcon,
4791
- 'pagination-next': paginationNext,
4792
- 'pagination-previous': paginationPrevious,
4793
- 'search-icon': searchIcon,
4794
- 'search-large': searchLarge,
4795
- 'search-navbar': searchNavbar,
4796
- 'slidenav-next': slidenavNext,
4797
- 'slidenav-next-large': slidenavNextLarge,
4798
- 'slidenav-previous': slidenavPrevious,
4799
- 'slidenav-previous-large': slidenavPreviousLarge };
4813
+ events: ['scroll', 'resize'] }] };
4800
4814
 
4801
4815
 
4802
- const Icon = {
4803
- install: install$1,
4804
4816
 
4805
- extends: SVG,
4806
4817
 
4807
- args: 'icon',
4818
+ function positionedAbsolute(el) {
4819
+ return children(el).some((el) => css(el, 'position') === 'absolute');
4820
+ }
4808
4821
 
4809
- props: ['icon'],
4822
+ function getTranslates(rows, columns) {
4823
+ const rowHeights = rows.map((row) => Math.max(...row.map((el) => el.offsetHeight)));
4810
4824
 
4811
- data: {
4812
- include: ['focusable'] },
4825
+ return columns.map((elements) => {
4826
+ let prev = 0;
4827
+ return elements.map(
4828
+ (element, row) =>
4829
+ prev += row ? rowHeights[row - 1] - elements[row - 1].offsetHeight : 0);
4813
4830
 
4831
+ });
4832
+ }
4814
4833
 
4815
- isIcon: true,
4834
+ function getMarginTop(nodes, cls) {
4835
+ const [node] = nodes.filter((el) => hasClass(el, cls));
4816
4836
 
4817
- beforeConnect() {
4818
- addClass(this.$el, 'uk-icon');
4819
- },
4837
+ return toFloat(node ? css(node, 'marginTop') : css(nodes[0], 'paddingLeft'));
4838
+ }
4820
4839
 
4821
- methods: {
4822
- async getSvg() {
4823
- const icon = getIcon(this.icon);
4840
+ function getColumnHeights(columns) {
4841
+ return columns.map((column) => column.reduce((sum, el) => sum + el.offsetHeight, 0));
4842
+ }
4824
4843
 
4825
- if (!icon) {
4826
- throw 'Icon not found.';
4827
- }
4844
+ var heightMatch = {
4845
+ mixins: [Resize],
4828
4846
 
4829
- return icon;
4830
- } } };
4847
+ args: 'target',
4831
4848
 
4832
- const IconComponent = {
4833
- args: false,
4849
+ props: {
4850
+ target: String,
4851
+ row: Boolean },
4834
4852
 
4835
- extends: Icon,
4836
-
4837
- data: (vm) => ({
4838
- icon: hyphenate(vm.constructor.options.name) }),
4839
4853
 
4854
+ data: {
4855
+ target: '> *',
4856
+ row: true },
4840
4857
 
4841
- beforeConnect() {
4842
- addClass(this.$el, this.$name);
4843
- } };
4844
4858
 
4859
+ computed: {
4860
+ elements: {
4861
+ get(_ref, $el) {let { target } = _ref;
4862
+ return $$(target, $el);
4863
+ },
4845
4864
 
4846
- const Slidenav = {
4847
- extends: IconComponent,
4865
+ watch() {
4866
+ this.$reset();
4867
+ } } },
4848
4868
 
4849
- beforeConnect() {
4850
- addClass(this.$el, 'uk-slidenav');
4851
- const icon = this.$props.icon;
4852
- this.icon = hasClass(this.$el, 'uk-slidenav-large') ? icon + "-large" : icon;
4853
- } };
4854
4869
 
4855
4870
 
4856
- const Search = {
4857
- extends: IconComponent,
4871
+ resizeTargets() {
4872
+ return [this.$el, ...this.elements];
4873
+ },
4858
4874
 
4859
- beforeConnect() {
4860
- this.icon =
4861
- hasClass(this.$el, 'uk-search-icon') && parents(this.$el, '.uk-search-large').length ?
4862
- 'search-large' :
4863
- parents(this.$el, '.uk-search-navbar').length ?
4864
- 'search-navbar' :
4865
- this.$props.icon;
4866
- } };
4875
+ update: {
4876
+ read() {
4877
+ return {
4878
+ rows: (this.row ? getRows(this.elements) : [this.elements]).map(match) };
4867
4879
 
4880
+ },
4868
4881
 
4869
- const Close = {
4870
- extends: IconComponent,
4882
+ write(_ref2) {let { rows } = _ref2;
4883
+ for (const { heights, elements } of rows) {
4884
+ elements.forEach((el, i) => css(el, 'minHeight', heights[i]));
4885
+ }
4886
+ },
4871
4887
 
4872
- beforeConnect() {
4873
- this.icon = "close-" + (hasClass(this.$el, 'uk-close-large') ? 'large' : 'icon');
4874
- } };
4888
+ events: ['resize'] } };
4875
4889
 
4876
4890
 
4877
- const Spinner = {
4878
- extends: IconComponent,
4879
4891
 
4880
- methods: {
4881
- async getSvg() {
4882
- const icon = await Icon.methods.getSvg.call(this);
4892
+ function match(elements) {
4893
+ if (elements.length < 2) {
4894
+ return { heights: [''], elements };
4895
+ }
4883
4896
 
4884
- if (this.ratio !== 1) {
4885
- css($('circle', icon), 'strokeWidth', 1 / this.ratio);
4886
- }
4897
+ css(elements, 'minHeight', '');
4898
+ let heights = elements.map(getHeight);
4899
+ const max = Math.max(...heights);
4887
4900
 
4888
- return icon;
4889
- } } };
4901
+ return {
4902
+ heights: elements.map((el, i) => heights[i].toFixed(2) === max.toFixed(2) ? '' : max),
4903
+ elements };
4890
4904
 
4905
+ }
4891
4906
 
4907
+ function getHeight(element) {
4908
+ let style = false;
4909
+ if (!isVisible(element)) {
4910
+ style = element.style.display;
4911
+ css(element, 'display', 'block', 'important');
4912
+ }
4892
4913
 
4893
- const parsed = {};
4894
- function install$1(UIkit) {
4895
- UIkit.icon.add = (name, svg) => {
4896
- const added = isString(name) ? { [name]: svg } : name;
4897
- each(added, (svg, name) => {
4898
- icons[name] = svg;
4899
- delete parsed[name];
4900
- });
4914
+ const height = dimensions(element).height - boxModelAdjust(element, 'height', 'content-box');
4901
4915
 
4902
- if (UIkit._initialized) {
4903
- apply(document.body, (el) =>
4904
- each(UIkit.getComponents(el), (cmp) => {
4905
- cmp.$options.isIcon && cmp.icon in added && cmp.$reset();
4906
- }));
4916
+ if (style !== false) {
4917
+ css(element, 'display', style);
4918
+ }
4907
4919
 
4908
- }
4909
- };
4920
+ return height;
4910
4921
  }
4911
4922
 
4912
- function getIcon(icon) {
4913
- if (!icons[icon]) {
4914
- return null;
4915
- }
4923
+ var heightViewport = {
4924
+ mixins: [Resize],
4916
4925
 
4917
- if (!parsed[icon]) {
4918
- parsed[icon] = $((icons[applyRtl(icon)] || icons[icon]).trim());
4919
- }
4926
+ props: {
4927
+ expand: Boolean,
4928
+ offsetTop: Boolean,
4929
+ offsetBottom: Boolean,
4930
+ minHeight: Number },
4920
4931
 
4921
- return parsed[icon].cloneNode(true);
4922
- }
4923
4932
 
4924
- function applyRtl(icon) {
4925
- return isRtl ? swap(swap(icon, 'left', 'right'), 'previous', 'next') : icon;
4926
- }
4933
+ data: {
4934
+ expand: false,
4935
+ offsetTop: false,
4936
+ offsetBottom: false,
4937
+ minHeight: 0 },
4927
4938
 
4928
- const nativeLazyLoad = inBrowser && 'loading' in HTMLImageElement.prototype;
4929
4939
 
4930
- var img = {
4931
- args: 'dataSrc',
4940
+ resizeTargets() {
4941
+ // check for offsetTop change
4942
+ return [this.$el, ...scrollParents(this.$el, /auto|scroll/)];
4943
+ },
4932
4944
 
4933
- props: {
4934
- dataSrc: String,
4935
- sources: String,
4936
- offsetTop: String,
4937
- offsetLeft: String,
4938
- target: String,
4939
- loading: String },
4945
+ update: {
4946
+ read(_ref) {let { minHeight: prev } = _ref;
4947
+ if (!isVisible(this.$el)) {
4948
+ return false;
4949
+ }
4940
4950
 
4951
+ let minHeight = '';
4952
+ const box = boxModelAdjust(this.$el, 'height', 'content-box');
4941
4953
 
4942
- data: {
4943
- dataSrc: '',
4944
- sources: false,
4945
- offsetTop: '50vh',
4946
- offsetLeft: '50vw',
4947
- target: false,
4948
- loading: 'lazy' },
4954
+ const { body, scrollingElement } = document;
4955
+ const [scrollElement] = scrollParents(this.$el, /auto|scroll/);
4956
+ const { height: viewportHeight } = offsetViewport(
4957
+ scrollElement === body ? scrollingElement : scrollElement);
4949
4958
 
4950
4959
 
4951
- connected() {
4952
- if (this.loading !== 'lazy') {
4953
- this.load();
4954
- return;
4955
- }
4960
+ if (this.expand) {
4961
+ minHeight = Math.max(
4962
+ viewportHeight - (
4963
+ dimensions(scrollElement).height - dimensions(this.$el).height) -
4964
+ box,
4965
+ 0);
4956
4966
 
4957
- const target = [this.$el, ...queryAll(this.$props.target, this.$el)];
4967
+ } else {
4968
+ const isScrollingElement =
4969
+ scrollingElement === scrollElement || body === scrollElement;
4958
4970
 
4959
- if (nativeLazyLoad && isImg(this.$el)) {
4960
- this.$el.loading = 'lazy';
4961
- setSrcAttrs(this.$el);
4971
+ // on mobile devices (iOS and Android) window.innerHeight !== 100vh
4972
+ minHeight = "calc(" + (isScrollingElement ? '100vh' : viewportHeight + "px");
4962
4973
 
4963
- if (target.length === 1) {
4964
- return;
4974
+ if (this.offsetTop) {
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
+ }
4981
+ }
4982
+
4983
+ if (this.offsetBottom === true) {
4984
+ minHeight += " - " + dimensions(this.$el.nextElementSibling).height + "px";
4985
+ } else if (isNumeric(this.offsetBottom)) {
4986
+ minHeight += " - " + this.offsetBottom + "vh";
4987
+ } else if (this.offsetBottom && endsWith(this.offsetBottom, 'px')) {
4988
+ minHeight += " - " + toFloat(this.offsetBottom) + "px";
4989
+ } else if (isString(this.offsetBottom)) {
4990
+ minHeight += " - " + dimensions(query(this.offsetBottom, this.$el)).height + "px";
4991
+ }
4992
+
4993
+ minHeight += (box ? " - " + box + "px" : '') + ")";
4965
4994
  }
4966
- }
4967
4995
 
4968
- ensureSrcAttribute(this.$el);
4996
+ return { minHeight, prev };
4997
+ },
4969
4998
 
4970
- this.registerObserver(
4971
- observeIntersection(
4972
- target,
4973
- (entries, observer) => {
4974
- this.load();
4975
- observer.disconnect();
4999
+ write(_ref2) {let { minHeight } = _ref2;
5000
+ css(this.$el, { minHeight });
5001
+
5002
+ if (this.minHeight && toFloat(css(this.$el, 'minHeight')) < this.minHeight) {
5003
+ css(this.$el, 'minHeight', this.minHeight);
5004
+ }
4976
5005
  },
4977
- {
4978
- rootMargin: toPx(this.offsetTop, 'height') + "px " + toPx(
4979
- this.offsetLeft,
4980
- 'width') + "px" }));
4981
5006
 
5007
+ events: ['resize'] } };
4982
5008
 
5009
+ var SVG = {
5010
+ args: 'src',
4983
5011
 
5012
+ props: {
5013
+ id: Boolean,
5014
+ icon: String,
5015
+ src: String,
5016
+ style: String,
5017
+ width: Number,
5018
+ height: Number,
5019
+ ratio: Number,
5020
+ class: String,
5021
+ strokeAnimation: Boolean,
5022
+ focusable: Boolean, // IE 11
5023
+ attributes: 'list' },
4984
5024
 
4985
- },
4986
5025
 
4987
- disconnected() {
4988
- if (this._data.image) {
4989
- this._data.image.onload = '';
4990
- }
4991
- },
5026
+ data: {
5027
+ ratio: 1,
5028
+ include: ['style', 'class', 'focusable'],
5029
+ class: '',
5030
+ strokeAnimation: false },
4992
5031
 
4993
- methods: {
4994
- load() {
4995
- if (this._data.image) {
4996
- return this._data.image;
4997
- }
4998
5032
 
4999
- const image = isImg(this.$el) ?
5000
- this.$el :
5001
- getImageFromElement(this.$el, this.dataSrc, this.sources);
5033
+ beforeConnect() {
5034
+ this.class += ' uk-svg';
5035
+ },
5002
5036
 
5003
- removeAttr(image, 'loading');
5004
- setSrcAttrs(this.$el, image.currentSrc);
5005
- return this._data.image = image;
5006
- } } };
5037
+ connected() {
5038
+ if (!this.icon && includes(this.src, '#')) {
5039
+ [this.src, this.icon] = this.src.split('#');
5040
+ }
5007
5041
 
5042
+ this.svg = this.getSvg().then((el) => {
5043
+ if (this._connected) {
5044
+ const svg = insertSVG(el, this.$el);
5008
5045
 
5046
+ if (this.svgEl && svg !== this.svgEl) {
5047
+ remove$1(this.svgEl);
5048
+ }
5009
5049
 
5010
- function setSrcAttrs(el, src) {
5011
- if (isImg(el)) {
5012
- const parentNode = parent(el);
5013
- const elements = isPicture(parentNode) ? children(parentNode) : [el];
5014
- elements.forEach((el) => setSourceProps(el, el));
5015
- } else if (src) {
5016
- const change = !includes(el.style.backgroundImage, src);
5017
- if (change) {
5018
- css(el, 'backgroundImage', "url(" + escape(src) + ")");
5019
- trigger(el, createEvent('load', false));
5050
+ this.applyAttributes(svg, el);
5051
+
5052
+ return this.svgEl = svg;
5053
+ }
5054
+ }, noop);
5055
+
5056
+ if (this.strokeAnimation) {
5057
+ this.svg.then((el) => {
5058
+ if (this._connected) {
5059
+ applyAnimation(el);
5060
+ this.registerObserver(
5061
+ observeIntersection(el, (records, observer) => {
5062
+ applyAnimation(el);
5063
+ observer.disconnect();
5064
+ }));
5065
+
5066
+ }
5067
+ });
5020
5068
  }
5021
- }
5022
- }
5069
+ },
5023
5070
 
5024
- const srcProps = ['data-src', 'data-srcset', 'sizes'];
5025
- function setSourceProps(sourceEl, targetEl) {
5026
- srcProps.forEach((prop) => {
5027
- const value = data(sourceEl, prop);
5028
- if (value) {
5029
- attr(targetEl, prop.replace(/^(data-)+/, ''), value);
5071
+ disconnected() {
5072
+ this.svg.then((svg) => {
5073
+ if (this._connected) {
5074
+ return;
5075
+ }
5076
+
5077
+ if (isVoidElement(this.$el)) {
5078
+ this.$el.hidden = false;
5079
+ }
5080
+
5081
+ remove$1(svg);
5082
+ this.svgEl = null;
5083
+ });
5084
+
5085
+ this.svg = null;
5086
+ },
5087
+
5088
+ methods: {
5089
+ async getSvg() {
5090
+ if (isTag(this.$el, 'img') && !this.$el.complete && this.$el.loading === 'lazy') {
5091
+ return new Promise((resolve) =>
5092
+ once(this.$el, 'load', () => resolve(this.getSvg())));
5093
+
5094
+ }
5095
+
5096
+ return parseSVG(await loadSVG(this.src), this.icon) || Promise.reject('SVG not found.');
5097
+ },
5098
+
5099
+ applyAttributes(el, ref) {
5100
+ for (const prop in this.$options.props) {
5101
+ if (includes(this.include, prop) && prop in this) {
5102
+ attr(el, prop, this[prop]);
5103
+ }
5104
+ }
5105
+
5106
+ for (const attribute in this.attributes) {
5107
+ const [prop, value] = this.attributes[attribute].split(':', 2);
5108
+ attr(el, prop, value);
5109
+ }
5110
+
5111
+ if (!this.id) {
5112
+ removeAttr(el, 'id');
5113
+ }
5114
+
5115
+ const props = ['width', 'height'];
5116
+ let dimensions = props.map((prop) => this[prop]);
5117
+
5118
+ if (!dimensions.some((val) => val)) {
5119
+ dimensions = props.map((prop) => attr(ref, prop));
5120
+ }
5121
+
5122
+ const viewBox = attr(ref, 'viewBox');
5123
+ if (viewBox && !dimensions.some((val) => val)) {
5124
+ dimensions = viewBox.split(' ').slice(2);
5125
+ }
5126
+
5127
+ dimensions.forEach((val, i) => attr(el, props[i], toFloat(val) * this.ratio || null));
5128
+ } } };
5129
+
5130
+
5131
+
5132
+ const loadSVG = memoize(async (src) => {
5133
+ if (src) {
5134
+ if (startsWith(src, 'data:')) {
5135
+ return decodeURIComponent(src.split(',')[1]);
5136
+ } else {
5137
+ return (await fetch(src)).text();
5030
5138
  }
5031
- });
5032
- }
5139
+ } else {
5140
+ return Promise.reject();
5141
+ }
5142
+ });
5033
5143
 
5034
- function getImageFromElement(el, src, sources) {
5035
- const img = new Image();
5144
+ function parseSVG(svg, icon) {var _svg;
5145
+ if (icon && includes(svg, '<symbol')) {
5146
+ svg = parseSymbols(svg, icon) || svg;
5147
+ }
5036
5148
 
5037
- wrapInPicture(img, sources);
5038
- setSourceProps(el, img);
5039
- img.onload = () => {
5040
- setSrcAttrs(el, img.currentSrc);
5041
- };
5042
- attr(img, 'src', src);
5043
- return img;
5149
+ svg = $(svg.substr(svg.indexOf('<svg')));
5150
+ return ((_svg = svg) == null ? void 0 : _svg.hasChildNodes()) && svg;
5044
5151
  }
5045
5152
 
5046
- function wrapInPicture(img, sources) {
5047
- sources = parseSources(sources);
5153
+ const symbolRe = /<symbol([^]*?id=(['"])(.+?)\2[^]*?<\/)symbol>/g;
5154
+ const symbols = {};
5048
5155
 
5049
- if (sources.length) {
5050
- const picture = fragment('<picture>');
5051
- for (const attrs of sources) {
5052
- const source = fragment('<source>');
5053
- attr(source, attrs);
5054
- append(picture, source);
5156
+ function parseSymbols(svg, icon) {
5157
+ if (!symbols[svg]) {
5158
+ symbols[svg] = {};
5159
+
5160
+ symbolRe.lastIndex = 0;
5161
+
5162
+ let match;
5163
+ while (match = symbolRe.exec(svg)) {
5164
+ symbols[svg][match[3]] = "<svg xmlns=\"http://www.w3.org/2000/svg\"" + match[1] + "svg>";
5055
5165
  }
5056
- append(picture, img);
5057
5166
  }
5167
+
5168
+ return symbols[svg][icon];
5058
5169
  }
5059
5170
 
5060
- function parseSources(sources) {
5061
- if (!sources) {
5062
- return [];
5171
+ function applyAnimation(el) {
5172
+ const length = getMaxPathLength(el);
5173
+
5174
+ if (length) {
5175
+ el.style.setProperty('--uk-animation-stroke', length);
5063
5176
  }
5177
+ }
5064
5178
 
5065
- if (startsWith(sources, '[')) {
5179
+ function getMaxPathLength(el) {
5180
+ return Math.ceil(
5181
+ Math.max(
5182
+ 0,
5183
+ ...$$('[stroke]', el).map((stroke) => {
5066
5184
  try {
5067
- sources = JSON.parse(sources);
5185
+ return stroke.getTotalLength();
5068
5186
  } catch (e) {
5069
- sources = [];
5187
+ return 0;
5070
5188
  }
5071
- } else {
5072
- sources = parseOptions(sources);
5073
- }
5189
+ })));
5074
5190
 
5075
- if (!isArray(sources)) {
5076
- sources = [sources];
5077
- }
5078
5191
 
5079
- return sources.filter((source) => !isEmpty(source));
5080
5192
  }
5081
5193
 
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>');
5194
+ function insertSVG(el, root) {
5195
+ if (isVoidElement(root) || isTag(root, 'canvas')) {
5196
+ root.hidden = true;
5197
+
5198
+ const next = root.nextElementSibling;
5199
+ return equals(el, next) ? next : after(root, el);
5085
5200
  }
5201
+
5202
+ const last = root.lastElementChild;
5203
+ return equals(el, last) ? last : append(root, el);
5086
5204
  }
5087
5205
 
5088
- function isPicture(el) {
5089
- return isTag(el, 'picture');
5206
+ function equals(el, other) {
5207
+ return isTag(el, 'svg') && isTag(other, 'svg') && innerHTML(el) === innerHTML(other);
5090
5208
  }
5091
5209
 
5092
- function isImg(el) {
5093
- return isTag(el, 'img');
5210
+ function innerHTML(el) {
5211
+ return (
5212
+ el.innerHTML ||
5213
+ new XMLSerializer().serializeToString(el).replace(/<svg.*?>(.*?)<\/svg>/g, '$1')).
5214
+ replace(/\s/g, '');
5094
5215
  }
5095
5216
 
5096
- var Media = {
5097
- props: {
5098
- media: Boolean },
5217
+ var closeIcon = "<svg width=\"14\" height=\"14\" viewBox=\"0 0 14 14\" xmlns=\"http://www.w3.org/2000/svg\"><line fill=\"none\" stroke=\"#000\" stroke-width=\"1.1\" x1=\"1\" y1=\"1\" x2=\"13\" y2=\"13\"/><line fill=\"none\" stroke=\"#000\" stroke-width=\"1.1\" x1=\"13\" y1=\"1\" x2=\"1\" y2=\"13\"/></svg>";
5218
+
5219
+ var closeLarge = "<svg width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><line fill=\"none\" stroke=\"#000\" stroke-width=\"1.4\" x1=\"1\" y1=\"1\" x2=\"19\" y2=\"19\"/><line fill=\"none\" stroke=\"#000\" stroke-width=\"1.4\" x1=\"19\" y1=\"1\" x2=\"1\" y2=\"19\"/></svg>";
5220
+
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>";
5222
+
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>";
5230
+
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>";
5232
+
5233
+ var paginationNext = "<svg width=\"7\" height=\"12\" viewBox=\"0 0 7 12\" xmlns=\"http://www.w3.org/2000/svg\"><polyline fill=\"none\" stroke=\"#000\" stroke-width=\"1.2\" points=\"1 1 6 6 1 11\"/></svg>";
5234
+
5235
+ var paginationPrevious = "<svg width=\"7\" height=\"12\" viewBox=\"0 0 7 12\" xmlns=\"http://www.w3.org/2000/svg\"><polyline fill=\"none\" stroke=\"#000\" stroke-width=\"1.2\" points=\"6 1 1 6 6 11\"/></svg>";
5236
+
5237
+ var searchIcon = "<svg width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><circle fill=\"none\" stroke=\"#000\" stroke-width=\"1.1\" cx=\"9\" cy=\"9\" r=\"7\"/><path fill=\"none\" stroke=\"#000\" stroke-width=\"1.1\" d=\"M14,14 L18,18 L14,14 Z\"/></svg>";
5238
+
5239
+ var searchLarge = "<svg width=\"40\" height=\"40\" viewBox=\"0 0 40 40\" xmlns=\"http://www.w3.org/2000/svg\"><circle fill=\"none\" stroke=\"#000\" stroke-width=\"1.8\" cx=\"17.5\" cy=\"17.5\" r=\"16.5\"/><line fill=\"none\" stroke=\"#000\" stroke-width=\"1.8\" x1=\"38\" y1=\"39\" x2=\"29\" y2=\"30\"/></svg>";
5240
+
5241
+ var searchNavbar = "<svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" xmlns=\"http://www.w3.org/2000/svg\"><circle fill=\"none\" stroke=\"#000\" stroke-width=\"1.1\" cx=\"10.5\" cy=\"10.5\" r=\"9.5\"/><line fill=\"none\" stroke=\"#000\" stroke-width=\"1.1\" x1=\"23\" y1=\"23\" x2=\"17\" y2=\"17\"/></svg>";
5242
+
5243
+ var slidenavNext = "<svg width=\"14\" height=\"24\" viewBox=\"0 0 14 24\" xmlns=\"http://www.w3.org/2000/svg\"><polyline fill=\"none\" stroke=\"#000\" stroke-width=\"1.4\" points=\"1.225,23 12.775,12 1.225,1 \"/></svg>";
5244
+
5245
+ var slidenavNextLarge = "<svg width=\"25\" height=\"40\" viewBox=\"0 0 25 40\" xmlns=\"http://www.w3.org/2000/svg\"><polyline fill=\"none\" stroke=\"#000\" stroke-width=\"2\" points=\"4.002,38.547 22.527,20.024 4,1.5 \"/></svg>";
5246
+
5247
+ var slidenavPrevious = "<svg width=\"14\" height=\"24\" viewBox=\"0 0 14 24\" xmlns=\"http://www.w3.org/2000/svg\"><polyline fill=\"none\" stroke=\"#000\" stroke-width=\"1.4\" points=\"12.775,1 1.225,12 12.775,23 \"/></svg>";
5248
+
5249
+ var slidenavPreviousLarge = "<svg width=\"25\" height=\"40\" viewBox=\"0 0 25 40\" xmlns=\"http://www.w3.org/2000/svg\"><polyline fill=\"none\" stroke=\"#000\" stroke-width=\"2\" points=\"20.527,1.5 2,20.024 20.525,38.547 \"/></svg>";
5250
+
5251
+ var spinner = "<svg width=\"30\" height=\"30\" viewBox=\"0 0 30 30\" xmlns=\"http://www.w3.org/2000/svg\"><circle fill=\"none\" stroke=\"#000\" cx=\"15\" cy=\"15\" r=\"14\"/></svg>";
5252
+
5253
+ var totop = "<svg width=\"18\" height=\"10\" viewBox=\"0 0 18 10\" xmlns=\"http://www.w3.org/2000/svg\"><polyline fill=\"none\" stroke=\"#000\" stroke-width=\"1.2\" points=\"1 9 9 1 17 9 \"/></svg>";
5254
+
5255
+ const icons = {
5256
+ spinner,
5257
+ totop,
5258
+ marker,
5259
+ 'close-icon': closeIcon,
5260
+ 'close-large': closeLarge,
5261
+ 'nav-parent-icon': navParentIcon,
5262
+ 'nav-parent-icon-large': navParentIconLarge,
5263
+ 'navbar-parent-icon': navbarParentIcon,
5264
+ 'navbar-toggle-icon': navbarToggleIcon,
5265
+ 'overlay-icon': overlayIcon,
5266
+ 'pagination-next': paginationNext,
5267
+ 'pagination-previous': paginationPrevious,
5268
+ 'search-icon': searchIcon,
5269
+ 'search-large': searchLarge,
5270
+ 'search-navbar': searchNavbar,
5271
+ 'slidenav-next': slidenavNext,
5272
+ 'slidenav-next-large': slidenavNextLarge,
5273
+ 'slidenav-previous': slidenavPrevious,
5274
+ 'slidenav-previous-large': slidenavPreviousLarge };
5099
5275
 
5100
5276
 
5277
+ const Icon = {
5278
+ install: install$1,
5279
+
5280
+ extends: SVG,
5281
+
5282
+ args: 'icon',
5283
+
5284
+ props: ['icon'],
5285
+
5101
5286
  data: {
5102
- media: false },
5287
+ include: ['focusable'] },
5103
5288
 
5104
5289
 
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
- }
5290
+ isIcon: true,
5291
+
5292
+ beforeConnect() {
5293
+ addClass(this.$el, 'uk-icon');
5120
5294
  },
5121
5295
 
5122
- disconnected() {var _this$offMediaObj;
5123
- (_this$offMediaObj = this.offMediaObj) == null ? void 0 : _this$offMediaObj.call(this);
5296
+ methods: {
5297
+ async getSvg() {
5298
+ const icon = getIcon(this.icon);
5299
+
5300
+ if (!icon) {
5301
+ throw 'Icon not found.';
5302
+ }
5303
+
5304
+ return icon;
5305
+ } } };
5306
+
5307
+ const IconComponent = {
5308
+ args: false,
5309
+
5310
+ extends: Icon,
5311
+
5312
+ data: (vm) => ({
5313
+ icon: hyphenate(vm.constructor.options.name) }),
5314
+
5315
+
5316
+ beforeConnect() {
5317
+ addClass(this.$el, this.$name);
5318
+ } };
5319
+
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
+
5330
+ const Slidenav = {
5331
+ extends: IconComponent,
5332
+
5333
+ beforeConnect() {
5334
+ addClass(this.$el, 'uk-slidenav');
5335
+ const icon = this.$props.icon;
5336
+ this.icon = hasClass(this.$el, 'uk-slidenav-large') ? icon + "-large" : icon;
5337
+ } };
5338
+
5339
+
5340
+ const Search = {
5341
+ extends: IconComponent,
5342
+
5343
+ beforeConnect() {
5344
+ this.icon =
5345
+ hasClass(this.$el, 'uk-search-icon') && parents(this.$el, '.uk-search-large').length ?
5346
+ 'search-large' :
5347
+ parents(this.$el, '.uk-search-navbar').length ?
5348
+ 'search-navbar' :
5349
+ this.$props.icon;
5124
5350
  } };
5125
5351
 
5126
5352
 
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
- }
5353
+ const Close = {
5354
+ extends: IconComponent,
5136
5355
 
5137
- return value && isNumeric(value) ? "(min-width: " + value + "px)" : '';
5138
- }
5356
+ beforeConnect() {
5357
+ this.icon = "close-" + (hasClass(this.$el, 'uk-close-large') ? 'large' : 'icon');
5358
+ } };
5139
5359
 
5140
- var leader = {
5141
- mixins: [Class, Media, Resize],
5142
5360
 
5143
- props: {
5144
- fill: String },
5361
+ const Spinner = {
5362
+ extends: IconComponent,
5145
5363
 
5364
+ methods: {
5365
+ async getSvg() {
5366
+ const icon = await Icon.methods.getSvg.call(this);
5146
5367
 
5147
- data: {
5148
- fill: '',
5149
- clsWrapper: 'uk-leader-fill',
5150
- clsHide: 'uk-leader-hide',
5151
- attrFill: 'data-fill' },
5368
+ if (this.ratio !== 1) {
5369
+ css($('circle', icon), 'strokeWidth', 1 / this.ratio);
5370
+ }
5152
5371
 
5372
+ return icon;
5373
+ } } };
5153
5374
 
5154
- computed: {
5155
- fill(_ref) {let { fill } = _ref;
5156
- return fill || getCssVar('leader-fill-content');
5157
- } },
5158
5375
 
5159
5376
 
5160
- connected() {
5161
- [this.wrapper] = wrapInner(this.$el, "<span class=\"" + this.clsWrapper + "\">");
5162
- },
5377
+ const parsed = {};
5378
+ function install$1(UIkit) {
5379
+ UIkit.icon.add = (name, svg) => {
5380
+ const added = isString(name) ? { [name]: svg } : name;
5381
+ each(added, (svg, name) => {
5382
+ icons[name] = svg;
5383
+ delete parsed[name];
5384
+ });
5163
5385
 
5164
- disconnected() {
5165
- unwrap(this.wrapper.childNodes);
5166
- },
5386
+ if (UIkit._initialized) {
5387
+ apply(document.body, (el) =>
5388
+ each(UIkit.getComponents(el), (cmp) => {
5389
+ cmp.$options.isIcon && cmp.icon in added && cmp.$reset();
5390
+ }));
5167
5391
 
5168
- update: {
5169
- read() {
5170
- const width = Math.trunc(this.$el.offsetWidth / 2);
5392
+ }
5393
+ };
5394
+ }
5171
5395
 
5172
- return {
5173
- width,
5174
- fill: this.fill,
5175
- hide: !this.matchMedia };
5396
+ function getIcon(icon) {
5397
+ if (!icons[icon]) {
5398
+ return null;
5399
+ }
5176
5400
 
5177
- },
5401
+ if (!parsed[icon]) {
5402
+ parsed[icon] = $((icons[applyRtl(icon)] || icons[icon]).trim());
5403
+ }
5178
5404
 
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
- },
5405
+ return parsed[icon].cloneNode(true);
5406
+ }
5183
5407
 
5184
- events: ['resize'] } };
5408
+ function applyRtl(icon) {
5409
+ return isRtl ? swap(swap(icon, 'left', 'right'), 'previous', 'next') : icon;
5410
+ }
5185
5411
 
5186
- const active = [];
5412
+ const nativeLazyLoad = inBrowser && 'loading' in HTMLImageElement.prototype;
5187
5413
 
5188
- var Modal = {
5189
- mixins: [Class, Container, Togglable],
5414
+ var img = {
5415
+ args: 'dataSrc',
5190
5416
 
5191
5417
  props: {
5192
- selPanel: String,
5193
- selClose: String,
5194
- escClose: Boolean,
5195
- bgClose: Boolean,
5196
- stack: Boolean },
5418
+ dataSrc: String,
5419
+ sources: String,
5420
+ offsetTop: String,
5421
+ offsetLeft: String,
5422
+ target: String,
5423
+ loading: String },
5197
5424
 
5198
5425
 
5199
5426
  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
- } },
5427
+ dataSrc: '',
5428
+ sources: false,
5429
+ offsetTop: '50vh',
5430
+ offsetLeft: '50vw',
5431
+ target: false,
5432
+ loading: 'lazy' },
5219
5433
 
5220
5434
 
5221
- beforeDisconnect() {
5222
- if (includes(active, this)) {
5223
- this.toggleElement(this.$el, false, false);
5435
+ connected() {
5436
+ if (this.loading !== 'lazy') {
5437
+ this.load();
5438
+ return;
5224
5439
  }
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
5440
 
5241
- {
5242
- name: 'toggle',
5441
+ const target = [this.$el, ...queryAll(this.$props.target, this.$el)];
5243
5442
 
5244
- self: true,
5443
+ if (nativeLazyLoad && isImg(this.$el)) {
5444
+ this.$el.loading = 'lazy';
5445
+ setSrcAttrs(this.$el);
5245
5446
 
5246
- handler(e) {
5247
- if (e.defaultPrevented) {
5447
+ if (target.length === 1) {
5248
5448
  return;
5249
5449
  }
5450
+ }
5250
5451
 
5251
- e.preventDefault();
5452
+ ensureSrcAttribute(this.$el);
5252
5453
 
5253
- if (this.isToggled() === includes(active, this)) {
5254
- this.toggle();
5255
- }
5256
- } },
5454
+ this.registerObserver(
5455
+ observeIntersection(
5456
+ target,
5457
+ (entries, observer) => {
5458
+ this.load();
5459
+ observer.disconnect();
5460
+ },
5461
+ {
5462
+ rootMargin: toPx(this.offsetTop, 'height') + "px " + toPx(
5463
+ this.offsetLeft,
5464
+ 'width') + "px" }));
5257
5465
 
5258
5466
 
5259
- {
5260
- name: 'beforeshow',
5261
5467
 
5262
- self: true,
5263
5468
 
5264
- handler(e) {
5265
- if (includes(active, this)) {
5266
- return false;
5267
- }
5469
+ },
5268
5470
 
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
- } },
5471
+ disconnected() {
5472
+ if (this._data.image) {
5473
+ this._data.image.onload = '';
5474
+ }
5475
+ },
5276
5476
 
5477
+ methods: {
5478
+ load() {
5479
+ if (this._data.image) {
5480
+ return this._data.image;
5481
+ }
5277
5482
 
5278
- {
5279
- name: 'show',
5483
+ const image = isImg(this.$el) ?
5484
+ this.$el :
5485
+ getImageFromElement(this.$el, this.dataSrc, this.sources);
5280
5486
 
5281
- self: true,
5487
+ removeAttr(image, 'loading');
5488
+ setSrcAttrs(this.$el, image.currentSrc);
5489
+ return this._data.image = image;
5490
+ } } };
5282
5491
 
5283
- handler() {
5284
- const docEl = document.documentElement;
5285
5492
 
5286
- if (width(window) > docEl.clientWidth && this.overlay) {
5287
- css(document.body, 'overflowY', 'scroll');
5288
- }
5289
5493
 
5290
- if (this.stack) {
5291
- css(this.$el, 'zIndex', toFloat(css(this.$el, 'zIndex')) + active.length);
5292
- }
5494
+ function setSrcAttrs(el, src) {
5495
+ if (isImg(el)) {
5496
+ const parentNode = parent(el);
5497
+ const elements = isPicture(parentNode) ? children(parentNode) : [el];
5498
+ elements.forEach((el) => setSourceProps(el, el));
5499
+ } else if (src) {
5500
+ const change = !includes(el.style.backgroundImage, src);
5501
+ if (change) {
5502
+ css(el, 'backgroundImage', "url(" + escape(src) + ")");
5503
+ trigger(el, createEvent('load', false));
5504
+ }
5505
+ }
5506
+ }
5293
5507
 
5294
- addClass(docEl, this.clsPage);
5508
+ const srcProps = ['data-src', 'data-srcset', 'sizes'];
5509
+ function setSourceProps(sourceEl, targetEl) {
5510
+ srcProps.forEach((prop) => {
5511
+ const value = data(sourceEl, prop);
5512
+ if (value) {
5513
+ attr(targetEl, prop.replace(/^(data-)+/, ''), value);
5514
+ }
5515
+ });
5516
+ }
5295
5517
 
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
- }
5518
+ function getImageFromElement(el, src, sources) {
5519
+ const img = new Image();
5308
5520
 
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);
5521
+ wrapInPicture(img, sources);
5522
+ setSourceProps(el, img);
5523
+ img.onload = () => {
5524
+ setSrcAttrs(el, img.currentSrc);
5525
+ };
5526
+ attr(img, 'src', src);
5527
+ return img;
5528
+ }
5322
5529
 
5323
- }),
5324
- { self: true });
5530
+ function wrapInPicture(img, sources) {
5531
+ sources = parseSources(sources);
5325
5532
 
5326
- }
5533
+ if (sources.length) {
5534
+ const picture = fragment('<picture>');
5535
+ for (const attrs of sources) {
5536
+ const source = fragment('<source>');
5537
+ attr(source, attrs);
5538
+ append(picture, source);
5539
+ }
5540
+ append(picture, img);
5541
+ }
5542
+ }
5327
5543
 
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 });
5544
+ function parseSources(sources) {
5545
+ if (!sources) {
5546
+ return [];
5547
+ }
5338
5548
 
5339
- }
5340
- } },
5549
+ if (startsWith(sources, '[')) {
5550
+ try {
5551
+ sources = JSON.parse(sources);
5552
+ } catch (e) {
5553
+ sources = [];
5554
+ }
5555
+ } else {
5556
+ sources = parseOptions(sources);
5557
+ }
5341
5558
 
5559
+ if (!isArray(sources)) {
5560
+ sources = [sources];
5561
+ }
5342
5562
 
5343
- {
5344
- name: 'shown',
5563
+ return sources.filter((source) => !isEmpty(source));
5564
+ }
5345
5565
 
5346
- self: true,
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
+ }
5347
5571
 
5348
- handler() {
5349
- if (!isFocusable(this.$el)) {
5350
- attr(this.$el, 'tabindex', '-1');
5351
- }
5572
+ function isPicture(el) {
5573
+ return isTag(el, 'picture');
5574
+ }
5352
5575
 
5353
- if (!$(':focus', this.$el)) {
5354
- this.$el.focus();
5355
- }
5356
- } },
5576
+ function isImg(el) {
5577
+ return isTag(el, 'img');
5578
+ }
5357
5579
 
5580
+ var Media = {
5581
+ props: {
5582
+ media: Boolean },
5358
5583
 
5359
- {
5360
- name: 'hidden',
5361
5584
 
5362
- self: true,
5585
+ data: {
5586
+ media: false },
5363
5587
 
5364
- handler() {
5365
- if (includes(active, this)) {
5366
- active.splice(active.indexOf(this), 1);
5367
- }
5368
5588
 
5369
- if (!active.length) {
5370
- css(document.body, 'overflowY', '');
5371
- }
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
+ },
5372
5605
 
5373
- css(this.$el, 'zIndex', '');
5606
+ disconnected() {var _this$offMediaObj;
5607
+ (_this$offMediaObj = this.offMediaObj) == null ? void 0 : _this$offMediaObj.call(this);
5608
+ } };
5374
5609
 
5375
- if (!active.some((modal) => modal.clsPage === this.clsPage)) {
5376
- removeClass(document.documentElement, this.clsPage);
5377
- }
5378
- } }],
5379
5610
 
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
+ }
5380
5619
 
5620
+ return value && isNumeric(value) ? "(min-width: " + value + "px)" : '';
5621
+ }
5381
5622
 
5382
- methods: {
5383
- toggle() {
5384
- return this.isToggled() ? this.hide() : this.show();
5385
- },
5623
+ var leader = {
5624
+ mixins: [Class, Media, Resize],
5386
5625
 
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)));
5626
+ props: {
5627
+ fill: String },
5392
5628
 
5393
- }
5394
5629
 
5395
- return this.toggleElement(this.$el, true, animate(this));
5396
- },
5630
+ data: {
5631
+ fill: '',
5632
+ clsWrapper: 'uk-leader-fill',
5633
+ clsHide: 'uk-leader-hide',
5634
+ attrFill: 'data-fill' },
5397
5635
 
5398
- hide() {
5399
- return this.toggleElement(this.$el, false, animate(this));
5400
- } } };
5401
5636
 
5637
+ computed: {
5638
+ fill(_ref) {let { fill } = _ref;
5639
+ return fill || css(this.$el, '--uk-leader-fill-content');
5640
+ } },
5402
5641
 
5403
5642
 
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;
5643
+ connected() {
5644
+ [this.wrapper] = wrapInner(this.$el, "<span class=\"" + this.clsWrapper + "\">");
5645
+ },
5410
5646
 
5411
- _toggle(el, show);
5647
+ disconnected() {
5648
+ unwrap(this.wrapper.childNodes);
5649
+ },
5412
5650
 
5413
- const off = once(
5414
- transitionElement,
5415
- 'transitionstart',
5416
- () => {
5417
- once(transitionElement, 'transitionend transitioncancel', resolve, {
5418
- self: true });
5651
+ update: {
5652
+ read() {
5653
+ const width = Math.trunc(this.$el.offsetWidth / 2);
5419
5654
 
5420
- clearTimeout(timer);
5421
- },
5422
- { self: true });
5655
+ return {
5656
+ width,
5657
+ fill: this.fill,
5658
+ hide: !this.matchMedia };
5423
5659
 
5660
+ },
5424
5661
 
5425
- const timer = setTimeout(() => {
5426
- off();
5427
- resolve();
5428
- }, toMs(css(transitionElement, 'transitionDuration')));
5429
- })).
5430
- then(() => delete el._reject);
5431
- }
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
+ },
5432
5666
 
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,
@@ -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
@@ -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$1 = new Set();
6609
+ function registerClick(cmp) {
6610
+ if (!components$1.size) {
6611
+ on(document, 'click', clickHandler);
6612
+ }
6613
+
6614
+ components$1.add(cmp);
6615
+ }
6616
+
6617
+ function unregisterClick(cmp) {
6618
+ components$1.delete(cmp);
6619
+
6620
+ if (!components$1.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$1) {
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();
@@ -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,