uikit 3.14.4-dev.6a00f7fe6 → 3.14.4-dev.6c2d7a6e5

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 (138) hide show
  1. package/CHANGELOG.md +45 -11
  2. package/build/util.js +1 -0
  3. package/dist/css/uikit-core-rtl.css +385 -110
  4. package/dist/css/uikit-core-rtl.min.css +1 -1
  5. package/dist/css/uikit-core.css +385 -110
  6. package/dist/css/uikit-core.min.css +1 -1
  7. package/dist/css/uikit-rtl.css +402 -115
  8. package/dist/css/uikit-rtl.min.css +1 -1
  9. package/dist/css/uikit.css +402 -115
  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 +185 -137
  16. package/dist/js/components/lightbox-panel.min.js +1 -1
  17. package/dist/js/components/lightbox.js +185 -137
  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 +97 -135
  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 +1819 -1716
  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 +1058 -938
  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 +95 -61
  54. package/src/js/core/height-viewport.js +14 -6
  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 +42 -30
  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/toggle.js +3 -5
  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 +26 -11
  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 +80 -133
  69. package/src/js/util/animation.js +4 -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 +108 -107
  73. package/src/js/util/style.js +4 -13
  74. package/src/js/util/viewport.js +20 -36
  75. package/src/less/components/_import.less +1 -0
  76. package/src/less/components/drop.less +1 -18
  77. package/src/less/components/dropbar.less +115 -0
  78. package/src/less/components/dropdown.less +16 -16
  79. package/src/less/components/leader.less +1 -1
  80. package/src/less/components/nav.less +240 -63
  81. package/src/less/components/navbar.less +81 -38
  82. package/src/less/components/utility.less +21 -4
  83. package/src/less/theme/_import.less +1 -0
  84. package/src/less/theme/dropbar.less +44 -0
  85. package/src/less/theme/dropdown.less +0 -11
  86. package/src/less/theme/nav.less +43 -9
  87. package/src/less/theme/navbar.less +7 -11
  88. package/src/scss/components/_import.scss +1 -0
  89. package/src/scss/components/drop.scss +1 -18
  90. package/src/scss/components/dropbar.scss +115 -0
  91. package/src/scss/components/dropdown.scss +16 -16
  92. package/src/scss/components/leader.scss +1 -1
  93. package/src/scss/components/nav.scss +189 -51
  94. package/src/scss/components/navbar.scss +69 -38
  95. package/src/scss/components/utility.scss +19 -3
  96. package/src/scss/mixins-theme.scss +93 -25
  97. package/src/scss/mixins.scss +89 -17
  98. package/src/scss/theme/_import.scss +1 -0
  99. package/src/scss/theme/dropbar.scss +44 -0
  100. package/src/scss/theme/dropdown.scss +0 -8
  101. package/src/scss/theme/nav.scss +41 -9
  102. package/src/scss/theme/navbar.scss +7 -8
  103. package/src/scss/variables-theme.scss +71 -18
  104. package/src/scss/variables.scss +60 -14
  105. package/tests/accordion.html +2 -2
  106. package/tests/alert.html +2 -2
  107. package/tests/countdown.html +1 -1
  108. package/tests/drop.html +457 -371
  109. package/tests/dropbar.html +456 -0
  110. package/tests/dropdown.html +26 -401
  111. package/tests/filter.html +9 -12
  112. package/tests/form.html +1 -1
  113. package/tests/index.html +126 -107
  114. package/tests/js/index.js +1 -4
  115. package/tests/lightbox.html +5 -5
  116. package/tests/list.html +8 -8
  117. package/tests/modal.html +13 -13
  118. package/tests/nav.html +117 -75
  119. package/tests/navbar.html +1998 -1139
  120. package/tests/offcanvas.html +17 -21
  121. package/tests/parallax.html +1 -1
  122. package/tests/position.html +18 -16
  123. package/tests/progress.html +9 -9
  124. package/tests/scroll.html +7 -10
  125. package/tests/search.html +5 -5
  126. package/tests/slider.html +6 -5
  127. package/tests/slideshow.html +8 -8
  128. package/tests/sortable.html +6 -8
  129. package/tests/sticky-navbar.html +6 -6
  130. package/tests/sticky.html +8 -8
  131. package/tests/switcher.html +1 -1
  132. package/tests/tab.html +1 -1
  133. package/tests/table.html +7 -7
  134. package/tests/toggle.html +2 -2
  135. package/tests/tooltip.html +1 -1
  136. package/tests/upload.html +11 -11
  137. package/tests/utility.html +19 -0
  138. package/src/images/backgrounds/nav-parent-close.svg +0 -3
@@ -1,4 +1,4 @@
1
- /*! UIkit 3.14.4-dev.6a00f7fe6 | https://www.getuikit.com | (c) 2014 - 2022 YOOtheme | MIT License */
1
+ /*! UIkit 3.14.4-dev.6c2d7a6e5 | 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
  }
@@ -913,13 +899,14 @@
913
899
  const Transition = {
914
900
  start: transition,
915
901
 
916
- stop(element) {
902
+ async stop(element) {
917
903
  trigger(element, 'transitionend');
918
- return Promise.resolve();
904
+ await Promise.resolve();
919
905
  },
920
906
 
921
- cancel(element) {
907
+ async cancel(element) {
922
908
  trigger(element, 'transitioncanceled');
909
+ await Promise.resolve();
923
910
  },
924
911
 
925
912
  inProgress(element) {
@@ -929,7 +916,7 @@
929
916
 
930
917
  const animationPrefix = 'uk-animation-';
931
918
 
932
- 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;}
933
920
  return Promise.all(
934
921
  toNodes(element).map(
935
922
  (element) =>
@@ -965,10 +952,10 @@
965
952
 
966
953
  const inProgress = new RegExp(animationPrefix + "(enter|leave)");
967
954
  const Animation = {
968
- in: animate$1,
955
+ in: animate$2,
969
956
 
970
957
  out(element, animation, duration, origin) {
971
- return animate$1(element, animation, duration, origin, true);
958
+ return animate$2(element, animation, duration, origin, true);
972
959
  },
973
960
 
974
961
  inProgress(element) {
@@ -1060,13 +1047,13 @@
1060
1047
  }
1061
1048
 
1062
1049
  function offsetPosition(element) {
1063
- const offset = [0, 0];
1064
-
1065
1050
  element = toNode(element);
1066
1051
 
1067
- do {
1068
- offset[0] += element.offsetTop;
1069
- 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"));
1070
1057
 
1071
1058
  if (css(element, 'position') === 'fixed') {
1072
1059
  const win = toWindow(element);
@@ -1074,7 +1061,7 @@
1074
1061
  offset[1] += win.scrollX;
1075
1062
  return offset;
1076
1063
  }
1077
- } while (element = element.offsetParent);
1064
+ }
1078
1065
 
1079
1066
  return offset;
1080
1067
  }
@@ -1795,20 +1782,6 @@
1795
1782
 
1796
1783
  }
1797
1784
 
1798
- function scrollTop(element, top) {
1799
- if (isWindow(element) || isDocument(element)) {
1800
- element = scrollingElement(element);
1801
- } else {
1802
- element = toNode(element);
1803
- }
1804
-
1805
- if (isUndefined(top)) {
1806
- return element.scrollTop;
1807
- } else {
1808
- element.scrollTop = top;
1809
- }
1810
- }
1811
-
1812
1785
  function scrollIntoView(element, _temp) {let { offset: offsetBy = 0 } = _temp === void 0 ? {} : _temp;
1813
1786
  const parents = isVisible(element) ? scrollParents(element) : [];
1814
1787
  return parents.reduce(
@@ -1850,7 +1823,7 @@
1850
1823
  (function step() {
1851
1824
  const percent = ease(clamp((Date.now() - start) / duration));
1852
1825
 
1853
- scrollTop(element, scroll + top * percent);
1826
+ element.scrollTop = scroll + top * percent;
1854
1827
 
1855
1828
  // scroll more if we have not reached our destination
1856
1829
  if (percent === 1) {
@@ -1911,18 +1884,31 @@
1911
1884
  }
1912
1885
 
1913
1886
  function offsetViewport(scrollElement) {
1914
- 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
+ }
1915
1901
 
1916
1902
  let rect = offset(viewportElement);
1917
1903
  for (let [prop, dir, start, end] of [
1918
1904
  ['width', 'x', 'left', 'right'],
1919
1905
  ['height', 'y', 'top', 'bottom']])
1920
1906
  {
1921
- if (!isWindow(viewportElement)) {
1922
- rect[start] += toFloat(css(viewportElement, "border" + ucfirst(start) + "Width"));
1923
- } else {
1907
+ if (isWindow(viewportElement)) {
1924
1908
  // iOS 12 returns <body> as scrollingElement
1925
- viewportElement = viewportElement.document.documentElement;
1909
+ viewportElement = documentElement;
1910
+ } else {
1911
+ rect[start] += toFloat(css(viewportElement, "border-" + start + "-width"));
1926
1912
  }
1927
1913
  rect[prop] = rect[dir] = viewportElement["client" + ucfirst(prop)];
1928
1914
  rect[end] = rect[prop] + rect[start];
@@ -1934,10 +1920,6 @@
1934
1920
  return toWindow(element).document.scrollingElement;
1935
1921
  }
1936
1922
 
1937
- function getViewport$1(scrollElement) {
1938
- return scrollElement === scrollingElement(scrollElement) ? window : scrollElement;
1939
- }
1940
-
1941
1923
  const dirs = [
1942
1924
  ['width', 'x', 'left', 'right'],
1943
1925
  ['height', 'y', 'top', 'bottom']];
@@ -1951,126 +1933,65 @@
1951
1933
  ...options.attach },
1952
1934
 
1953
1935
  offset: [0, 0],
1936
+ placement: [],
1954
1937
  ...options };
1955
1938
 
1956
1939
 
1957
- const dim = options.flip ?
1958
- attachToWithFlip(element, target, options) :
1959
- attachTo(element, target, options);
1960
-
1961
- offset(element, dim);
1962
- }
1963
-
1964
- function attachTo(element, target, options) {
1965
- let { attach, offset: offsetBy } = {
1966
- attach: {
1967
- element: ['left', 'top'],
1968
- target: ['left', 'top'],
1969
- ...options.attach },
1970
-
1971
- offset: [0, 0],
1972
- ...options };
1973
-
1974
-
1975
- const position = offset(element);
1976
- const targetOffset = offset(target);
1977
- for (const [i, [prop, dir, start, end]] of Object.entries(dirs)) {
1978
- position[start] = position[dir] =
1979
- targetOffset[start] +
1980
- moveBy(attach.target[i], end, targetOffset[prop]) -
1981
- moveBy(attach.element[i], end, position[prop]) +
1982
- +offsetBy[i];
1983
- position[end] = position[start] + position[prop];
1940
+ if (!isArray(target)) {
1941
+ target = [target, target];
1984
1942
  }
1985
- return position;
1986
- }
1987
1943
 
1988
- function moveBy(start, end, dim) {
1989
- return start === 'center' ? dim / 2 : start === end ? dim : 0;
1944
+ offset(element, getPosition(element, target, options));
1990
1945
  }
1991
1946
 
1992
- function attachToWithFlip(element, target, options) {
1947
+ function getPosition(element, target, options) {
1993
1948
  const position = attachTo(element, target, options);
1994
- const targetDim = offset(target);
1995
1949
 
1996
1950
  let {
1997
- flip,
1998
1951
  attach: { element: elAttach, target: targetAttach },
1999
1952
  offset: elOffset,
2000
1953
  boundary,
2001
- viewport,
2002
- viewportOffset } =
1954
+ viewportOffset,
1955
+ placement } =
2003
1956
  options;
2004
1957
 
2005
- let viewports = scrollParents(element);
2006
- if (boundary === target) {
2007
- viewports = viewports.filter((viewport) => viewport !== boundary);
2008
- }
2009
- const [scrollElement] = viewports;
2010
- viewports.push(viewport);
2011
-
2012
- const offsetPosition = { ...position };
2013
- for (const [i, [prop, dir, start, end]] of Object.entries(dirs)) {
2014
- if (flip !== true && !includes(flip, dir)) {
2015
- continue;
2016
- }
1958
+ let offsetPosition = position;
1959
+ for (const [i, [prop,, start, end]] of Object.entries(dirs)) {
1960
+ let viewports = scrollParents(target[i]);
1961
+ const [scrollElement] = viewports;
2017
1962
 
2018
- const willFlip =
2019
- !intersectLine(position, targetDim, i) && intersectLine(position, targetDim, 1 - i);
2020
-
2021
- viewport = getIntersectionArea(...viewports.filter(Boolean).map(offsetViewport));
1963
+ let viewport = getIntersectionArea(...viewports.map(offsetViewport));
2022
1964
 
2023
1965
  if (viewportOffset) {
2024
1966
  viewport[start] += viewportOffset;
2025
1967
  viewport[end] -= viewportOffset;
2026
1968
  }
2027
1969
 
2028
- if (boundary && !willFlip && position[prop] <= offset(boundary)[prop]) {
2029
- viewport = getIntersectionArea(viewport, offset(boundary));
1970
+ if (boundary) {
1971
+ viewport = getIntersectionArea(viewport, offsetViewport(boundary));
2030
1972
  }
2031
1973
 
2032
- const isInStartBoundary = position[start] >= viewport[start];
2033
- const isInEndBoundary = position[end] <= viewport[end];
1974
+ const isInStartViewport = position[start] >= viewport[start];
1975
+ const isInEndViewport = position[end] <= viewport[end];
2034
1976
 
2035
- if (isInStartBoundary && isInEndBoundary) {
1977
+ if (isInStartViewport && isInEndViewport) {
2036
1978
  continue;
2037
1979
  }
2038
1980
 
2039
- let offsetBy;
1981
+ let offsetBy = 0;
2040
1982
 
2041
1983
  // Flip
2042
- if (willFlip) {
1984
+ if (placement[i] === 'flip') {
2043
1985
  if (
2044
- elAttach[i] === end && isInStartBoundary ||
2045
- elAttach[i] === start && isInEndBoundary)
1986
+ targetAttach[i] === end && isInEndViewport ||
1987
+ targetAttach[i] === start && isInStartViewport)
2046
1988
  {
2047
1989
  continue;
2048
1990
  }
2049
1991
 
2050
- offsetBy =
2051
- (elAttach[i] === start ?
2052
- -position[prop] :
2053
- elAttach[i] === end ?
2054
- position[prop] :
2055
- 0) + (
2056
- targetAttach[i] === start ?
2057
- targetDim[prop] :
2058
- targetAttach[i] === end ?
2059
- -targetDim[prop] :
2060
- 0) -
2061
- elOffset[i] * 2;
2062
-
2063
- if (
2064
- !isInScrollArea(
2065
- {
2066
- ...position,
2067
- [start]: position[start] + offsetBy,
2068
- [end]: position[end] + offsetBy },
2069
-
2070
- scrollElement,
2071
- i))
1992
+ offsetBy = flip(element, target, options, i)[start] - position[start];
2072
1993
 
2073
- {
1994
+ if (!isInScrollArea(applyOffset(position, offsetBy, i), scrollElement, i)) {
2074
1995
  if (isInScrollArea(position, scrollElement, i)) {
2075
1996
  continue;
2076
1997
  }
@@ -2079,26 +2000,27 @@
2079
2000
  return false;
2080
2001
  }
2081
2002
 
2082
- if (flip === true || includes(flip, dirs[1 - i][1])) {
2083
- const newPos = attachToWithFlip(element, target, {
2084
- ...options,
2085
- attach: {
2086
- element: elAttach.map(flipDir).reverse(),
2087
- target: targetAttach.map(flipDir).reverse() },
2003
+ const newPos = getPosition(element, target, {
2004
+ ...options,
2005
+ attach: {
2006
+ element: elAttach.map(flipAxis).reverse(),
2007
+ target: targetAttach.map(flipAxis).reverse() },
2088
2008
 
2089
- offset: elOffset.reverse(),
2090
- flip: flip === true ? flip : [...flip, dirs[1 - i][1]],
2091
- recursion: true });
2009
+ offset: elOffset.reverse(),
2010
+ placement: placement.reverse(),
2011
+ recursion: true });
2092
2012
 
2093
2013
 
2094
- if (newPos && isInScrollArea(newPos, scrollElement, 1 - i)) {
2095
- return newPos;
2096
- }
2014
+ if (newPos && isInScrollArea(newPos, scrollElement, 1 - i)) {
2015
+ return newPos;
2097
2016
  }
2017
+
2018
+ continue;
2098
2019
  }
2099
2020
 
2100
- // Move
2101
- } else {
2021
+ // Shift
2022
+ } else if (placement[i] === 'shift') {
2023
+ const targetDim = offset(target[i]);
2102
2024
  offsetBy =
2103
2025
  clamp(
2104
2026
  clamp(position[start], viewport[start], viewport[end] - position[prop]),
@@ -2107,13 +2029,54 @@
2107
2029
  position[start];
2108
2030
  }
2109
2031
 
2110
- offsetPosition[start] = position[dir] = position[start] + offsetBy;
2111
- offsetPosition[end] += offsetBy;
2032
+ offsetPosition = applyOffset(offsetPosition, offsetBy, i);
2112
2033
  }
2113
2034
 
2114
2035
  return offsetPosition;
2115
2036
  }
2116
2037
 
2038
+ function attachTo(element, target, options) {
2039
+ let { attach, offset: offsetBy } = {
2040
+ attach: {
2041
+ element: ['left', 'top'],
2042
+ target: ['left', 'top'],
2043
+ ...options.attach },
2044
+
2045
+ offset: [0, 0],
2046
+ ...options };
2047
+
2048
+
2049
+ let elOffset = offset(element);
2050
+
2051
+ for (const [i, [prop,, start, end]] of Object.entries(dirs)) {
2052
+ const targetOffset =
2053
+ attach.target[i] === attach.element[i] ? offsetViewport(target[i]) : offset(target[i]);
2054
+
2055
+ elOffset = applyOffset(
2056
+ elOffset,
2057
+ targetOffset[start] -
2058
+ elOffset[start] +
2059
+ moveBy(attach.target[i], end, targetOffset[prop]) -
2060
+ moveBy(attach.element[i], end, elOffset[prop]) +
2061
+ +offsetBy[i],
2062
+ i);
2063
+
2064
+ }
2065
+ return elOffset;
2066
+ }
2067
+
2068
+ function applyOffset(position, offset, i) {
2069
+ const [, dir, start, end] = dirs[i];
2070
+ const newPos = { ...position };
2071
+ newPos[start] = position[dir] = position[start] + offset;
2072
+ newPos[end] += offset;
2073
+ return newPos;
2074
+ }
2075
+
2076
+ function moveBy(attach, end, dim) {
2077
+ return attach === 'center' ? dim / 2 : attach === end ? dim : 0;
2078
+ }
2079
+
2117
2080
  function getIntersectionArea() {
2118
2081
  let area = {};for (var _len = arguments.length, rects = new Array(_len), _key = 0; _key < _len; _key++) {rects[_key] = arguments[_key];}
2119
2082
  for (const rect of rects) {
@@ -2134,12 +2097,32 @@
2134
2097
  return position[start] >= viewport[start] && position[end] <= viewport[end];
2135
2098
  }
2136
2099
 
2137
- function intersectLine(dimA, dimB, dir) {
2138
- const [,, start, end] = dirs[dir];
2139
- return dimA[end] > dimB[start] && dimB[end] > dimA[start];
2100
+ function flip(element, target, _ref, i) {let { offset, attach } = _ref;
2101
+ return attachTo(element, target, {
2102
+ attach: {
2103
+ element: flipAttach(attach.element, i),
2104
+ target: flipAttach(attach.target, i) },
2105
+
2106
+ offset: flipOffset(offset, i) });
2107
+
2108
+ }
2109
+
2110
+ function flipAttach(attach, i) {
2111
+ const newAttach = [...attach];
2112
+ const index = dirs[i].indexOf(attach[i]);
2113
+ if (~index) {
2114
+ newAttach[i] = dirs[i][1 - index % 2 + 2];
2115
+ }
2116
+ return newAttach;
2117
+ }
2118
+
2119
+ function flipOffset(offset, i) {
2120
+ offset = [...offset];
2121
+ offset[i] *= -1;
2122
+ return offset;
2140
2123
  }
2141
2124
 
2142
- function flipDir(prop) {
2125
+ function flipAxis(prop) {
2143
2126
  for (let i = 0; i < dirs.length; i++) {
2144
2127
  const index = dirs[i].indexOf(prop);
2145
2128
  if (~index) {
@@ -2154,7 +2137,7 @@
2154
2137
  getImage: getImage,
2155
2138
  transition: transition,
2156
2139
  Transition: Transition,
2157
- animate: animate$1,
2140
+ animate: animate$2,
2158
2141
  Animation: Animation,
2159
2142
  attr: attr,
2160
2143
  hasAttr: hasAttr,
@@ -2284,10 +2267,8 @@
2284
2267
  findAll: findAll,
2285
2268
  escape: escape,
2286
2269
  css: css,
2287
- getCssVar: getCssVar,
2288
2270
  propName: propName,
2289
2271
  isInView: isInView,
2290
- scrollTop: scrollTop,
2291
2272
  scrollIntoView: scrollIntoView,
2292
2273
  scrolledOver: scrolledOver,
2293
2274
  scrollParents: scrollParents,
@@ -2610,7 +2591,7 @@
2610
2591
 
2611
2592
  value = props[key] === Boolean && value === '' ? true : coerce$1(props[key], value);
2612
2593
 
2613
- if (prop === 'target' && (!value || startsWith(value, '_'))) {
2594
+ if (prop === 'target' && startsWith(value, '_')) {
2614
2595
  continue;
2615
2596
  }
2616
2597
 
@@ -2621,7 +2602,7 @@
2621
2602
 
2622
2603
  for (const key in options) {
2623
2604
  const prop = camelize(key);
2624
- if (props[prop] !== undefined) {
2605
+ if (!isUndefined(props[prop])) {
2625
2606
  data$1[prop] = coerce$1(props[prop], options[key]);
2626
2607
  }
2627
2608
  }
@@ -2950,7 +2931,7 @@
2950
2931
  UIkit.data = '__uikit__';
2951
2932
  UIkit.prefix = 'uk-';
2952
2933
  UIkit.options = {};
2953
- UIkit.version = '3.14.4-dev.6a00f7fe6';
2934
+ UIkit.version = '3.14.4-dev.6c2d7a6e5';
2954
2935
 
2955
2936
  globalAPI(UIkit);
2956
2937
  hooksAPI(UIkit);
@@ -3055,27 +3036,7 @@
3055
3036
  origin: false,
3056
3037
  transition: 'ease',
3057
3038
  clsEnter: 'uk-togglabe-enter',
3058
- clsLeave: 'uk-togglabe-leave',
3059
-
3060
- initProps: {
3061
- overflow: '',
3062
- maxHeight: '',
3063
- paddingTop: '',
3064
- paddingBottom: '',
3065
- marginTop: '',
3066
- marginBottom: '',
3067
- boxShadow: '' },
3068
-
3069
-
3070
- hideProps: {
3071
- overflow: 'hidden',
3072
- maxHeight: 0,
3073
- paddingTop: 0,
3074
- paddingBottom: 0,
3075
- marginTop: 0,
3076
- marginBottom: 0,
3077
- boxShadow: 'none' } },
3078
-
3039
+ clsLeave: 'uk-togglabe-leave' },
3079
3040
 
3080
3041
 
3081
3042
  computed: {
@@ -3084,7 +3045,7 @@
3084
3045
  },
3085
3046
 
3086
3047
  hasTransition(_ref2) {let { animation } = _ref2;
3087
- return startsWith(animation[0], 'slide');
3048
+ return ['slide', 'reveal'].some((transition) => startsWith(animation[0], transition));
3088
3049
  } },
3089
3050
 
3090
3051
 
@@ -3177,130 +3138,97 @@
3177
3138
  };
3178
3139
  }
3179
3140
 
3180
- function toggleTransition(cmp) {
3181
- switch (cmp.animation[0]) {
3182
- case 'slide-left':
3183
- return slideHorizontal(cmp);
3184
- case 'slide-right':
3185
- return slideHorizontal(cmp, true);}
3186
-
3187
- return slide(cmp);
3188
- }
3189
-
3190
- function slide(_ref4)
3191
-
3192
-
3141
+ function toggleTransition(cmp) {var _cmp$animation$;
3142
+ const [mode = 'reveal', startProp = 'top'] = ((_cmp$animation$ = cmp.animation[0]) == null ? void 0 : _cmp$animation$.split('-')) || [];
3193
3143
 
3144
+ const dirs = [
3145
+ ['left', 'right'],
3146
+ ['top', 'bottom']];
3194
3147
 
3148
+ const dir = dirs[includes(dirs[0], startProp) ? 0 : 1];
3149
+ const end = dir[1] === startProp;
3150
+ const props = ['width', 'height'];
3151
+ const dimProp = props[dirs.indexOf(dir)];
3152
+ const marginProp = "margin-" + dir[0];
3153
+ const marginStartProp = "margin-" + startProp;
3195
3154
 
3155
+ return async (el, show) => {
3156
+ let { duration, velocity, transition, _toggle } = cmp;
3196
3157
 
3158
+ let currentDim = dimensions(el)[dimProp];
3197
3159
 
3198
- {let { isToggled, duration, velocity, initProps, hideProps, transition, _toggle } = _ref4;
3199
- return (el, show) => {
3200
3160
  const inProgress = Transition.inProgress(el);
3201
- const inner =
3202
- !inProgress && el.hasChildNodes() ?
3203
- toFloat(css(el.firstElementChild, 'marginTop')) +
3204
- toFloat(css(el.lastElementChild, 'marginBottom')) :
3205
- 0;
3206
- const currentHeight = isVisible(el) ? toFloat(css(el, 'height')) + inner : 0;
3207
-
3208
- const props = inProgress ? css(el, Object.keys(initProps)) : show ? hideProps : initProps;
3209
-
3210
- Transition.cancel(el);
3161
+ await Transition.cancel(el);
3211
3162
 
3212
- if (!isToggled(el)) {
3163
+ if (show) {
3213
3164
  _toggle(el, true);
3214
3165
  }
3215
3166
 
3216
- css(el, 'maxHeight', '');
3217
-
3218
- // Update child components first
3219
- fastdom.flush();
3220
-
3221
- const endHeight = toFloat(css(el, 'height')) + inner;
3222
- duration = velocity * endHeight + duration;
3223
-
3224
- css(el, { ...props, maxHeight: currentHeight });
3225
-
3226
- return (
3227
- show ?
3228
- Transition.start(
3229
- el,
3230
- { ...initProps, overflow: 'hidden', maxHeight: endHeight },
3231
- duration * (1 - currentHeight / endHeight),
3232
- transition) :
3233
-
3234
- Transition.start(
3235
- el,
3236
- hideProps,
3237
- duration * (currentHeight / endHeight),
3238
- transition).
3239
- then(() => _toggle(el, false))).
3240
- then(() => css(el, initProps));
3241
- };
3242
- }
3167
+ const prevProps = Object.fromEntries(
3168
+ ['padding', 'border', 'width', 'height', 'overflow', marginProp, marginStartProp].map(
3169
+ (key) => [key, el.style[key]]));
3243
3170
 
3244
- function slideHorizontal(_ref5, right) {let { isToggled, duration, velocity, transition, _toggle } = _ref5;
3245
- return (el, show) => {
3246
- const visible = isVisible(el);
3247
- const marginLeft = toFloat(css(el, 'marginLeft'));
3248
3171
 
3249
- Transition.cancel(el);
3250
3172
 
3251
- const [scrollElement] = scrollParents(el);
3252
- css(scrollElement, 'overflowX', 'hidden');
3173
+ const dim = dimensions(el);
3174
+ const currentMargin = toFloat(css(el, marginProp));
3175
+ const marginStart = toFloat(css(el, marginStartProp));
3176
+ const endDim = dim[dimProp] + marginStart;
3253
3177
 
3254
- if (!isToggled(el)) {
3255
- _toggle(el, true);
3178
+ if (!inProgress && !show) {
3179
+ currentDim += marginStart;
3256
3180
  }
3257
3181
 
3258
- const width = toFloat(css(el, 'width'));
3259
- duration = velocity * width + duration;
3182
+ const [wrapper] = wrapInner(el, '<div>');
3183
+ css(wrapper, {
3184
+ boxSizing: 'border-box',
3185
+ height: dim.height,
3186
+ width: dim.width,
3187
+ ...css(el, [
3188
+ 'padding',
3189
+ 'borderTop',
3190
+ 'borderRight',
3191
+ 'borderBottom',
3192
+ 'borderLeft',
3193
+ 'borderImage',
3194
+ marginStartProp]) });
3260
3195
 
3261
- const percent = visible ? (width + marginLeft * (right ? -1 : 1)) / width * 100 : 0;
3262
- const offsetEl = offset(el);
3263
- const useClipPath = right ?
3264
- offsetEl.right < scrollElement.clientWidth :
3265
- Math.round(offsetEl.left) > 0;
3266
3196
 
3267
- css(el, {
3268
- clipPath: useClipPath ?
3269
- right ? "polygon(0 0," +
3270
- percent + "% 0," + percent + "% 100%,0 100%)" : "polygon(" + (
3271
- 100 - percent) + "% 0,100% 0,100% 100%," + (100 - percent) + "% 100%)" :
3272
- '',
3273
- marginLeft: (100 - percent) * (right ? 1 : -1) / 100 * width });
3274
3197
 
3198
+ css(el, {
3199
+ padding: 0,
3200
+ border: 0,
3201
+ [marginStartProp]: 0,
3202
+ width: dim.width,
3203
+ height: dim.height,
3204
+ overflow: 'hidden',
3205
+ [dimProp]: currentDim });
3275
3206
 
3276
- return (
3277
- show ?
3278
- Transition.start(
3279
- el,
3280
- {
3281
- clipPath: useClipPath ? "polygon(0 0,100% 0,100% 100%,0 100%)" : '',
3282
- marginLeft: 0 },
3283
3207
 
3284
- duration * (1 - percent / 100),
3285
- transition) :
3208
+ const percent = currentDim / endDim;
3209
+ duration = (velocity * endDim + duration) * (show ? 1 - percent : percent);
3210
+ const endProps = { [dimProp]: show ? endDim : 0 };
3286
3211
 
3287
- Transition.start(
3288
- el,
3289
- {
3290
- clipPath: useClipPath ?
3291
- right ? "polygon(0 0,0 0,0 100%,0 100%)" : "polygon(100% 0,100% 0,100% 100%,100% 100%)" :
3212
+ if (end) {
3213
+ css(el, marginProp, endDim - currentDim + currentMargin);
3214
+ endProps[marginProp] = show ? currentMargin : endDim + currentMargin;
3215
+ }
3292
3216
 
3217
+ if (!end ^ mode === 'reveal') {
3218
+ css(wrapper, marginProp, -endDim + currentDim);
3219
+ Transition.start(wrapper, { [marginProp]: show ? 0 : -endDim }, duration, transition);
3220
+ }
3293
3221
 
3294
- '',
3295
- marginLeft: (right ? 1 : -1) * width },
3222
+ try {
3223
+ await Transition.start(el, endProps, duration, transition);
3224
+ } finally {
3225
+ css(el, prevProps);
3226
+ unwrap(wrapper.firstChild);
3296
3227
 
3297
- duration * (percent / 100),
3298
- transition).
3299
- then(() => _toggle(el, false))).
3300
- then(() => {
3301
- css(scrollElement, 'overflowX', '');
3302
- css(el, { clipPath: '', marginLeft: '' });
3303
- });
3228
+ if (!show) {
3229
+ _toggle(el, false);
3230
+ }
3231
+ }
3304
3232
  };
3305
3233
  }
3306
3234
 
@@ -3325,6 +3253,7 @@
3325
3253
  mixins: [Class, Lazyload, Togglable],
3326
3254
 
3327
3255
  props: {
3256
+ animation: Boolean,
3328
3257
  targets: String,
3329
3258
  active: null,
3330
3259
  collapsible: Boolean,
@@ -3337,7 +3266,7 @@
3337
3266
  data: {
3338
3267
  targets: '> *',
3339
3268
  active: false,
3340
- animation: ['slide'],
3269
+ animation: true,
3341
3270
  collapsible: true,
3342
3271
  multiple: false,
3343
3272
  clsOpen: 'uk-open',
@@ -3383,7 +3312,7 @@
3383
3312
  hide(
3384
3313
  el,
3385
3314
  !hasClass(
3386
- this.items.find((item) => item.contains(el)),
3315
+ this.items.find((item) => within(el, item)),
3387
3316
  this.clsOpen));
3388
3317
 
3389
3318
 
@@ -3435,23 +3364,15 @@
3435
3364
  toggleClass(el, this.clsOpen, show);
3436
3365
  attr($(this.$props.toggle, el), 'aria-expanded', show);
3437
3366
 
3438
- const content = $("" + (el._wrapper ? '> * ' : '') + this.content, el);
3367
+ const content = $(this.content, el);
3439
3368
 
3440
- if (animate === false || !this.hasTransition) {
3369
+ if (animate === false || !this.animation) {
3370
+ content.hidden = !show;
3441
3371
  hide(content, !show);
3442
3372
  return;
3443
3373
  }
3444
3374
 
3445
- if (!el._wrapper) {
3446
- el._wrapper = wrapAll(content, "<div" + (show ? ' hidden' : '') + ">");
3447
- }
3448
-
3449
- hide(content, false);
3450
- await slide(this)(el._wrapper, show);
3451
- hide(content, !show);
3452
-
3453
- delete el._wrapper;
3454
- unwrap(content);
3375
+ await toggleTransition(this)(content, show);
3455
3376
 
3456
3377
  if (show) {
3457
3378
  const toggle = $(this.$props.toggle, el);
@@ -3477,18 +3398,17 @@
3477
3398
  args: 'animation',
3478
3399
 
3479
3400
  props: {
3401
+ animation: Boolean,
3480
3402
  close: String },
3481
3403
 
3482
3404
 
3483
3405
  data: {
3484
- animation: ['slide'],
3406
+ animation: true,
3485
3407
  selClose: '.uk-alert-close',
3486
- duration: 150,
3487
- hideProps: { opacity: 0, ...Togglable.data.hideProps } },
3408
+ duration: 150 },
3488
3409
 
3489
3410
 
3490
- events: [
3491
- {
3411
+ events: {
3492
3412
  name: 'click',
3493
3413
 
3494
3414
  delegate() {
@@ -3498,16 +3418,39 @@
3498
3418
  handler(e) {
3499
3419
  e.preventDefault();
3500
3420
  this.close();
3501
- } }],
3502
-
3421
+ } },
3503
3422
 
3504
3423
 
3505
3424
  methods: {
3506
3425
  async close() {
3507
- await this.toggleElement(this.$el);
3426
+ await this.toggleElement(this.$el, false, animate$1(this));
3508
3427
  this.$destroy(true);
3509
3428
  } } };
3510
3429
 
3430
+
3431
+
3432
+ function animate$1(_ref) {let { duration, transition, velocity } = _ref;
3433
+ return (el) => {
3434
+ const height = toFloat(css(el, 'height'));
3435
+ css(el, 'height', height);
3436
+ return Transition.start(
3437
+ el,
3438
+ {
3439
+ height: 0,
3440
+ marginTop: 0,
3441
+ marginBottom: 0,
3442
+ paddingTop: 0,
3443
+ paddingBottom: 0,
3444
+ borderTop: 0,
3445
+ borderBottom: 0,
3446
+ opacity: 0 },
3447
+
3448
+ velocity * height + duration,
3449
+ transition);
3450
+
3451
+ };
3452
+ }
3453
+
3511
3454
  var Video = {
3512
3455
  args: 'autoplay',
3513
3456
 
@@ -3656,13 +3599,17 @@
3656
3599
  props: {
3657
3600
  pos: String,
3658
3601
  offset: null,
3659
- flip: Boolean },
3602
+ flip: Boolean,
3603
+ shift: Boolean,
3604
+ inset: Boolean },
3660
3605
 
3661
3606
 
3662
3607
  data: {
3663
3608
  pos: "bottom-" + (isRtl ? 'right' : 'left'),
3609
+ offset: false,
3664
3610
  flip: true,
3665
- offset: false },
3611
+ shift: true,
3612
+ inset: false },
3666
3613
 
3667
3614
 
3668
3615
  connected() {
@@ -3674,19 +3621,24 @@
3674
3621
  methods: {
3675
3622
  positionAt(element, target, boundary) {
3676
3623
  let offset = [this.getPositionOffset(element), this.getShiftOffset(element)];
3624
+ const placement = [this.flip, this.shift];
3677
3625
 
3678
3626
  const attach = {
3679
- element: [flipPosition(this.dir), this.align],
3627
+ element: [this.inset ? this.dir : flipPosition(this.dir), this.align],
3680
3628
  target: [this.dir, this.align] };
3681
3629
 
3682
3630
 
3683
3631
  if (this.axis === 'y') {
3684
3632
  for (const prop in attach) {
3685
- attach[prop] = attach[prop].reverse();
3633
+ attach[prop].reverse();
3686
3634
  }
3687
- offset = offset.reverse();
3635
+ offset.reverse();
3636
+ placement.reverse();
3688
3637
  }
3689
3638
 
3639
+ const [scrollElement] = scrollParents(element, /auto|scroll/);
3640
+ const { scrollTop, scrollLeft } = scrollElement;
3641
+
3690
3642
  // Ensure none positioned element does not generate scrollbars
3691
3643
  const elDim = dimensions(element);
3692
3644
  css(element, { top: -elDim.height, left: -elDim.width });
@@ -3695,93 +3647,88 @@
3695
3647
  attach,
3696
3648
  offset,
3697
3649
  boundary,
3698
- flip: this.flip,
3650
+ placement,
3699
3651
  viewportOffset: this.getViewportOffset(element) });
3700
3652
 
3653
+
3654
+ // Restore scroll position
3655
+ scrollElement.scrollTop = scrollTop;
3656
+ scrollElement.scrollLeft = scrollLeft;
3701
3657
  },
3702
3658
 
3703
3659
  getPositionOffset(element) {
3704
3660
  return (
3705
3661
  toPx(
3706
- this.offset === false ? getCssVar('position-offset', element) : this.offset,
3662
+ this.offset === false ? css(element, '--uk-position-offset') : this.offset,
3707
3663
  this.axis === 'x' ? 'width' : 'height',
3708
3664
  element) * (
3709
- includes(['left', 'top'], this.dir) ? -1 : 1));
3665
+
3666
+ includes(['left', 'top'], this.dir) ? -1 : 1) * (
3667
+ this.inset ? -1 : 1));
3710
3668
 
3711
3669
  },
3712
3670
 
3713
3671
  getShiftOffset(element) {
3714
- return includes(['center', 'justify', 'stretch'], this.align) ?
3672
+ return this.align === 'center' ?
3715
3673
  0 :
3716
3674
  toPx(
3717
- getCssVar('position-shift-offset', element),
3675
+ css(element, '--uk-position-shift-offset'),
3718
3676
  this.axis === 'y' ? 'width' : 'height',
3719
3677
  element) * (
3720
3678
  includes(['left', 'top'], this.align) ? 1 : -1);
3721
3679
  },
3722
3680
 
3723
3681
  getViewportOffset(element) {
3724
- return toPx(getCssVar('position-viewport-offset', element));
3682
+ return toPx(css(element, '--uk-position-viewport-offset'));
3725
3683
  } } };
3726
3684
 
3727
- let active$1;
3685
+ var Style = {
3686
+ beforeConnect() {
3687
+ this._style = attr(this.$el, 'style');
3688
+ },
3689
+
3690
+ disconnected() {
3691
+ attr(this.$el, 'style', this._style);
3692
+ } };
3728
3693
 
3729
- var drop = {
3730
- mixins: [Container, Lazyload, Position, Togglable],
3694
+ const active$1 = [];
3731
3695
 
3732
- args: 'pos',
3696
+ var Modal = {
3697
+ mixins: [Class, Container, Togglable],
3733
3698
 
3734
3699
  props: {
3735
- mode: 'list',
3736
- toggle: Boolean,
3737
- boundary: Boolean,
3738
- boundaryAlign: Boolean,
3739
- delayShow: Number,
3740
- delayHide: Number,
3741
- display: String,
3742
- clsDrop: String,
3743
- animateOut: Boolean },
3700
+ selPanel: String,
3701
+ selClose: String,
3702
+ escClose: Boolean,
3703
+ bgClose: Boolean,
3704
+ stack: Boolean },
3744
3705
 
3745
3706
 
3746
3707
  data: {
3747
- mode: ['click', 'hover'],
3748
- toggle: '- *',
3749
- boundary: true,
3750
- boundaryAlign: false,
3751
- delayShow: 0,
3752
- delayHide: 800,
3753
- display: null,
3754
- clsDrop: false,
3755
- animation: ['uk-animation-fade'],
3756
3708
  cls: 'uk-open',
3757
- container: false,
3758
- animateOut: false },
3709
+ escClose: true,
3710
+ bgClose: true,
3711
+ overlay: true,
3712
+ stack: false },
3759
3713
 
3760
3714
 
3761
- created() {
3762
- this.tracker = new MouseTracker();
3763
- },
3715
+ computed: {
3716
+ panel(_ref, $el) {let { selPanel } = _ref;
3717
+ return $(selPanel, $el);
3718
+ },
3764
3719
 
3765
- beforeConnect() {
3766
- this.clsDrop = this.$props.clsDrop || "uk-" + this.$options.name;
3767
- },
3720
+ transitionElement() {
3721
+ return this.panel;
3722
+ },
3768
3723
 
3769
- connected() {
3770
- addClass(this.$el, this.clsDrop);
3724
+ bgClose(_ref2) {let { bgClose } = _ref2;
3725
+ return bgClose && this.panel;
3726
+ } },
3771
3727
 
3772
- if (this.toggle && !this.target) {
3773
- this.target = this.$create('toggle', query(this.toggle, this.$el), {
3774
- target: this.$el,
3775
- mode: this.mode }).
3776
- $el;
3777
- attr(this.target, 'aria-haspopup', true);
3778
- this.lazyload(this.target);
3779
- }
3780
- },
3781
3728
 
3782
- disconnected() {
3783
- if (this.isActive()) {
3784
- active$1 = null;
3729
+ beforeDisconnect() {
3730
+ if (includes(active$1, this)) {
3731
+ this.toggleElement(this.$el, false, false);
3785
3732
  }
3786
3733
  },
3787
3734
 
@@ -3790,1776 +3737,1940 @@
3790
3737
  name: 'click',
3791
3738
 
3792
3739
  delegate() {
3793
- return "." + this.clsDrop + "-close";
3740
+ return this.selClose;
3794
3741
  },
3795
3742
 
3796
3743
  handler(e) {
3797
3744
  e.preventDefault();
3798
- this.hide(false);
3745
+ this.hide();
3799
3746
  } },
3800
3747
 
3801
3748
 
3802
3749
  {
3803
- name: 'click',
3750
+ name: 'toggle',
3804
3751
 
3805
- delegate() {
3806
- return 'a[href^="#"]';
3807
- },
3752
+ self: true,
3808
3753
 
3809
- handler(_ref) {let { defaultPrevented, current: { hash } } = _ref;
3810
- if (!defaultPrevented && hash && !within(hash, this.$el)) {
3811
- this.hide(false);
3754
+ handler(e) {
3755
+ if (e.defaultPrevented) {
3756
+ return;
3812
3757
  }
3813
- } },
3814
3758
 
3759
+ e.preventDefault();
3815
3760
 
3816
- {
3817
- name: 'beforescroll',
3818
-
3819
- handler() {
3820
- this.hide(false);
3761
+ if (this.isToggled() === includes(active$1, this)) {
3762
+ this.toggle();
3763
+ }
3821
3764
  } },
3822
3765
 
3823
3766
 
3824
3767
  {
3825
- name: 'toggle',
3768
+ name: 'beforeshow',
3826
3769
 
3827
3770
  self: true,
3828
3771
 
3829
- handler(e, toggle) {
3830
- e.preventDefault();
3772
+ handler(e) {
3773
+ if (includes(active$1, this)) {
3774
+ return false;
3775
+ }
3831
3776
 
3832
- if (this.isToggled()) {
3833
- this.hide(false);
3777
+ if (!this.stack && active$1.length) {
3778
+ Promise.all(active$1.map((modal) => modal.hide())).then(this.show);
3779
+ e.preventDefault();
3834
3780
  } else {
3835
- this.show(toggle == null ? void 0 : toggle.$el, false);
3781
+ active$1.push(this);
3836
3782
  }
3837
3783
  } },
3838
3784
 
3839
3785
 
3840
3786
  {
3841
- name: 'toggleshow',
3787
+ name: 'show',
3842
3788
 
3843
3789
  self: true,
3844
3790
 
3845
- handler(e, toggle) {
3846
- e.preventDefault();
3847
- this.show(toggle == null ? void 0 : toggle.$el);
3848
- } },
3849
-
3850
-
3851
- {
3852
- name: 'togglehide',
3853
-
3854
- self: true,
3855
-
3856
- handler(e) {
3857
- e.preventDefault();
3858
- if (!matches(this.$el, ':focus,:hover')) {
3859
- this.hide();
3860
- }
3861
- } },
3862
-
3863
-
3864
- {
3865
- name: pointerEnter + " focusin",
3866
-
3867
- filter() {
3868
- return includes(this.mode, 'hover');
3869
- },
3870
-
3871
- handler(e) {
3872
- if (!isTouch(e)) {
3873
- this.clearTimers();
3874
- }
3875
- } },
3876
-
3877
-
3878
- {
3879
- name: pointerLeave + " focusout",
3791
+ handler() {
3792
+ once(
3793
+ this.$el,
3794
+ 'hide',
3795
+ on(document, 'focusin', (e) => {
3796
+ if (last(active$1) === this && !within(e.target, this.$el)) {
3797
+ this.$el.focus();
3798
+ }
3799
+ }));
3880
3800
 
3881
- filter() {
3882
- return includes(this.mode, 'hover');
3883
- },
3884
3801
 
3885
- handler(e) {
3886
- if (!isTouch(e) && e.relatedTarget) {
3887
- this.hide();
3802
+ if (this.overlay) {
3803
+ once(this.$el, 'hidden', preventOverscroll(this.$el));
3804
+ once(this.$el, 'hidden', preventBackgroundScroll());
3888
3805
  }
3889
- } },
3890
-
3891
-
3892
- {
3893
- name: 'toggled',
3894
-
3895
- self: true,
3896
3806
 
3897
- handler(e, toggled) {
3898
- if (!toggled) {
3899
- return;
3807
+ if (this.stack) {
3808
+ css(this.$el, 'zIndex', toFloat(css(this.$el, 'zIndex')) + active$1.length);
3900
3809
  }
3901
3810
 
3902
- this.clearTimers();
3903
- this.position();
3904
- } },
3905
-
3906
-
3907
- {
3908
- name: 'show',
3909
-
3910
- self: true,
3911
-
3912
- handler() {
3913
- active$1 = this;
3811
+ addClass(document.documentElement, this.clsPage);
3914
3812
 
3915
- this.tracker.init();
3813
+ if (this.bgClose) {
3814
+ once(
3815
+ this.$el,
3816
+ 'hide',
3817
+ on(document, pointerDown, (_ref3) => {let { target } = _ref3;
3818
+ if (
3819
+ last(active$1) !== this ||
3820
+ this.overlay && !within(target, this.$el) ||
3821
+ within(target, this.panel))
3822
+ {
3823
+ return;
3824
+ }
3916
3825
 
3917
- for (const handler of [
3918
- on(
3919
- document,
3920
- pointerDown,
3921
- (_ref2) => {let { target } = _ref2;return (
3922
- !within(target, this.$el) &&
3923
3826
  once(
3924
3827
  document,
3925
3828
  pointerUp + " " + pointerCancel + " scroll",
3926
- (_ref3) => {let { defaultPrevented, type, target: newTarget } = _ref3;
3829
+ (_ref4) => {let { defaultPrevented, type, target: newTarget } = _ref4;
3927
3830
  if (
3928
3831
  !defaultPrevented &&
3929
3832
  type === pointerUp &&
3930
- target === newTarget &&
3931
- !(this.target && within(target, this.target)))
3833
+ target === newTarget)
3932
3834
  {
3933
- this.hide(false);
3835
+ this.hide();
3934
3836
  }
3935
3837
  },
3936
- true));}),
3937
-
3938
-
3838
+ true);
3939
3839
 
3940
- on(document, 'keydown', (e) => {
3941
- if (e.keyCode === 27) {
3942
- this.hide(false);
3943
- }
3944
- }),
3840
+ }),
3841
+ { self: true });
3945
3842
 
3946
- ...(this.display === 'static' && this.align !== 'stretch' ?
3947
- [] :
3948
- (() => {
3949
- const handler = () => this.$emit();
3950
- return [
3951
- on(window, 'resize', handler),
3952
- on(document, 'scroll', handler, true),
3953
- (() => {
3954
- const observer = observeResize(
3955
- scrollParents(this.$el),
3956
- handler);
3843
+ }
3957
3844
 
3958
- return () => observer.disconnect();
3959
- })()];
3845
+ if (this.escClose) {
3846
+ once(
3847
+ this.$el,
3848
+ 'hide',
3849
+ on(document, 'keydown', (e) => {
3850
+ if (e.keyCode === 27 && last(active$1) === this) {
3851
+ this.hide();
3852
+ }
3853
+ }),
3854
+ { self: true });
3960
3855
 
3961
- })())])
3962
- {
3963
- once(this.$el, 'hide', handler, { self: true });
3964
3856
  }
3965
3857
  } },
3966
3858
 
3967
3859
 
3968
3860
  {
3969
- name: 'beforehide',
3861
+ name: 'shown',
3970
3862
 
3971
3863
  self: true,
3972
3864
 
3973
3865
  handler() {
3974
- this.clearTimers();
3975
- } },
3976
-
3977
-
3978
- {
3979
- name: 'hide',
3866
+ if (!isFocusable(this.$el)) {
3867
+ attr(this.$el, 'tabindex', '-1');
3868
+ }
3980
3869
 
3981
- handler(_ref4) {let { target } = _ref4;
3982
- if (this.$el !== target) {
3983
- active$1 =
3984
- active$1 === null && within(target, this.$el) && this.isToggled() ?
3985
- this :
3986
- active$1;
3987
- return;
3870
+ if (!$(':focus', this.$el)) {
3871
+ this.$el.focus();
3988
3872
  }
3873
+ } },
3989
3874
 
3990
- active$1 = this.isActive() ? null : active$1;
3991
- this.tracker.cancel();
3992
- } }],
3993
3875
 
3876
+ {
3877
+ name: 'hidden',
3994
3878
 
3879
+ self: true,
3995
3880
 
3996
- update: {
3997
- write() {
3998
- if (this.isToggled() && !hasClass(this.$el, this.clsEnter)) {
3999
- this.position();
3881
+ handler() {
3882
+ if (includes(active$1, this)) {
3883
+ active$1.splice(active$1.indexOf(this), 1);
4000
3884
  }
4001
- } },
4002
3885
 
3886
+ css(this.$el, 'zIndex', '');
4003
3887
 
4004
- methods: {
4005
- show(target, delay) {if (target === void 0) {target = this.target;}if (delay === void 0) {delay = true;}
4006
- if (this.isToggled() && target && this.target && target !== this.target) {
4007
- this.hide(false, false);
3888
+ if (!active$1.some((modal) => modal.clsPage === this.clsPage)) {
3889
+ removeClass(document.documentElement, this.clsPage);
4008
3890
  }
3891
+ } }],
4009
3892
 
4010
- this.target = target;
4011
-
4012
- this.clearTimers();
4013
-
4014
- if (this.isActive()) {
4015
- return;
4016
- }
4017
3893
 
4018
- if (active$1) {
4019
- if (delay && active$1.isDelaying) {
4020
- this.showTimer = setTimeout(() => matches(target, ':hover') && this.show(), 10);
4021
- return;
4022
- }
4023
3894
 
4024
- let prev;
4025
- while (active$1 && prev !== active$1 && !within(this.$el, active$1.$el)) {
4026
- prev = active$1;
4027
- active$1.hide(false, false);
4028
- }
4029
- }
3895
+ methods: {
3896
+ toggle() {
3897
+ return this.isToggled() ? this.hide() : this.show();
3898
+ },
4030
3899
 
3900
+ show() {
4031
3901
  if (this.container && parent(this.$el) !== this.container) {
4032
3902
  append(this.container, this.$el);
4033
- }
3903
+ return new Promise((resolve) =>
3904
+ requestAnimationFrame(() => this.show().then(resolve)));
4034
3905
 
4035
- this.showTimer = setTimeout(
4036
- () => this.toggleElement(this.$el, true),
4037
- delay && this.delayShow || 0);
3906
+ }
4038
3907
 
3908
+ return this.toggleElement(this.$el, true, animate(this));
4039
3909
  },
4040
3910
 
4041
- hide(delay, animate) {if (delay === void 0) {delay = true;}if (animate === void 0) {animate = true;}
4042
- const hide = () => this.toggleElement(this.$el, false, this.animateOut && animate);
3911
+ hide() {
3912
+ return this.toggleElement(this.$el, false, animate(this));
3913
+ } } };
4043
3914
 
4044
- this.clearTimers();
4045
3915
 
4046
- this.isDelaying = getPositionedElements(this.$el).some((el) =>
4047
- this.tracker.movesTo(el));
4048
3916
 
3917
+ function animate(_ref5) {let { transitionElement, _toggle } = _ref5;
3918
+ return (el, show) =>
3919
+ new Promise((resolve, reject) =>
3920
+ once(el, 'show hide', () => {
3921
+ el._reject == null ? void 0 : el._reject();
3922
+ el._reject = reject;
4049
3923
 
4050
- if (delay && this.isDelaying) {
4051
- this.hideTimer = setTimeout(this.hide, 50);
4052
- } else if (delay && this.delayHide) {
4053
- this.hideTimer = setTimeout(hide, this.delayHide);
4054
- } else {
4055
- hide();
4056
- }
4057
- },
3924
+ _toggle(el, show);
4058
3925
 
4059
- clearTimers() {
4060
- clearTimeout(this.showTimer);
4061
- clearTimeout(this.hideTimer);
4062
- this.showTimer = null;
4063
- this.hideTimer = null;
4064
- this.isDelaying = false;
4065
- },
3926
+ const off = once(
3927
+ transitionElement,
3928
+ 'transitionstart',
3929
+ () => {
3930
+ once(transitionElement, 'transitionend transitioncancel', resolve, {
3931
+ self: true });
4066
3932
 
4067
- isActive() {
4068
- return active$1 === this;
3933
+ clearTimeout(timer);
4069
3934
  },
3935
+ { self: true });
4070
3936
 
4071
- position() {
4072
- removeClass(this.$el, this.clsDrop + "-stack");
4073
- toggleClass(this.$el, this.clsDrop + "-boundary", this.boundaryAlign);
4074
- toggleClass(this.$el, this.clsDrop + "-stretch", this.align === 'stretch');
4075
3937
 
4076
- const boundary = query(this.boundary, this.$el);
4077
- const target = boundary && this.boundaryAlign ? boundary : this.target;
4078
- const [scrollParent] = scrollParents(
4079
- boundary && this.boundaryAlign ? boundary : this.$el);
3938
+ const timer = setTimeout(() => {
3939
+ off();
3940
+ resolve();
3941
+ }, toMs(css(transitionElement, 'transitionDuration')));
3942
+ })).
3943
+ then(() => delete el._reject);
3944
+ }
4080
3945
 
4081
- const scrollParentOffset = offset(scrollParent);
4082
- const boundaryOffset = boundary ? offset(boundary) : scrollParentOffset;
4083
- const viewportOffset = this.getViewportOffset(this.$el);
3946
+ function toMs(time) {
3947
+ return time ? endsWith(time, 'ms') ? toFloat(time) : toFloat(time) * 1000 : 0;
3948
+ }
4084
3949
 
4085
- css(this.$el, 'maxWidth', '');
4086
- const maxWidth = scrollParentOffset.width - 2 * viewportOffset;
3950
+ function preventOverscroll(el) {
3951
+ if (CSS.supports('overscroll-behavior', 'contain')) {
3952
+ const elements = filterChildren(el, (child) => /auto|scroll/.test(css(child, 'overflow')));
3953
+ css(elements, 'overscrollBehavior', 'contain');
3954
+ return () => css(elements, 'overscrollBehavior', '');
3955
+ }
4087
3956
 
4088
- if (this.align === 'justify') {
4089
- const prop = this.axis === 'y' ? 'width' : 'height';
4090
- css(
4091
- this.$el,
4092
- prop,
4093
- Math.min(
4094
- (boundary ? boundaryOffset : offset(this.target))[prop],
4095
- scrollParentOffset[prop] - 2 * viewportOffset));
4096
-
4097
-
4098
- } else if (this.align === 'stretch') {
4099
- this.flip = this.axis === 'y' ? 'x' : 'y';
4100
- this.display = 'static';
4101
-
4102
- const viewport = offsetViewport(scrollParent);
4103
- const targetDim = offset(target);
4104
- const elOffset = Math.abs(this.getPositionOffset(this.$el)) + viewportOffset;
4105
-
4106
- css(this.$el, {
4107
- width:
4108
- this.axis === 'y' ?
4109
- viewport.width :
4110
- (this.dir === 'left' ?
4111
- targetDim.left - viewport.left :
4112
- viewport.right - targetDim.right) - elOffset,
4113
- height:
4114
- this.axis === 'x' ?
4115
- viewport.height :
4116
- (this.dir === 'top' ?
4117
- targetDim.top - viewport.top :
4118
- viewport.bottom - targetDim.bottom) - elOffset });
4119
-
4120
- } else if (this.$el.offsetWidth > maxWidth) {
4121
- addClass(this.$el, this.clsDrop + "-stack");
4122
- }
3957
+ let startClientY;
4123
3958
 
4124
- css(this.$el, 'maxWidth', maxWidth);
3959
+ const events = [
3960
+ on(
3961
+ el,
3962
+ 'touchstart',
3963
+ (_ref6) => {let { targetTouches } = _ref6;
3964
+ if (targetTouches.length === 1) {
3965
+ startClientY = targetTouches[0].clientY;
3966
+ }
3967
+ },
3968
+ { passive: true }),
4125
3969
 
4126
- this.positionAt(this.$el, target, boundary);
4127
- } } };
4128
3970
 
3971
+ on(
3972
+ el,
3973
+ 'touchmove',
3974
+ (e) => {
3975
+ if (e.targetTouches.length !== 1) {
3976
+ return;
3977
+ }
4129
3978
 
3979
+ let [scrollParent] = scrollParents(e.target, /auto|scroll/);
3980
+ if (!within(scrollParent, el)) {
3981
+ scrollParent = el;
3982
+ }
4130
3983
 
4131
- function getPositionedElements(el) {
4132
- const result = [];
4133
- apply(el, (el) => css(el, 'position') !== 'static' && result.push(el));
4134
- return result;
4135
- }
3984
+ const clientY = e.targetTouches[0].clientY - startClientY;
3985
+ const { scrollTop, scrollHeight, clientHeight } = scrollParent;
4136
3986
 
4137
- var formCustom = {
4138
- mixins: [Class],
3987
+ if (
3988
+ clientHeight >= scrollHeight ||
3989
+ scrollTop === 0 && clientY > 0 ||
3990
+ scrollHeight - scrollTop <= clientHeight && clientY < 0)
3991
+ {
3992
+ e.cancelable && e.preventDefault();
3993
+ }
3994
+ },
3995
+ { passive: false })];
4139
3996
 
4140
- args: 'target',
3997
+
3998
+
3999
+ return () => events.forEach((fn) => fn());
4000
+ }
4001
+
4002
+ let prevented;
4003
+ function preventBackgroundScroll() {
4004
+ if (prevented) {
4005
+ return noop;
4006
+ }
4007
+ prevented = true;
4008
+ const { body, documentElement } = document;
4009
+ css(body, {
4010
+ overflowY: width(window) > documentElement.clientWidth ? 'scroll' : '',
4011
+ touchAction: 'none' });
4012
+
4013
+ css(documentElement, 'overflowY', 'hidden');
4014
+ return () => {
4015
+ prevented = false;
4016
+ css(documentElement, 'overflowY', '');
4017
+ css(body, { overflowY: '', touchAction: '' });
4018
+ };
4019
+ }
4020
+
4021
+ function filterChildren(el, fn) {
4022
+ const children = [];
4023
+ apply(el, (node) => {
4024
+ if (fn(node)) {
4025
+ children.push(node);
4026
+ }
4027
+ });
4028
+ return children;
4029
+ }
4030
+
4031
+ let active;
4032
+
4033
+ var drop = {
4034
+ mixins: [Container, Lazyload, Position, Style, Togglable],
4035
+
4036
+ args: 'pos',
4141
4037
 
4142
4038
  props: {
4143
- target: Boolean },
4039
+ mode: 'list',
4040
+ toggle: Boolean,
4041
+ boundary: Boolean,
4042
+ target: Boolean,
4043
+ targetX: Boolean,
4044
+ targetY: Boolean,
4045
+ stretch: Boolean,
4046
+ delayShow: Number,
4047
+ delayHide: Number,
4048
+ display: String,
4049
+ clsDrop: String,
4050
+ animateOut: Boolean,
4051
+ bgScroll: Boolean },
4144
4052
 
4145
4053
 
4146
4054
  data: {
4147
- target: false },
4055
+ mode: ['click', 'hover'],
4056
+ toggle: '- *',
4057
+ boundary: false,
4058
+ target: false,
4059
+ targetX: false,
4060
+ targetY: false,
4061
+ stretch: false,
4062
+ delayShow: 0,
4063
+ delayHide: 800,
4064
+ display: null,
4065
+ clsDrop: false,
4066
+ animateOut: false,
4067
+ bgScroll: true,
4068
+ animation: ['uk-animation-fade'],
4069
+ cls: 'uk-open',
4070
+ container: false },
4148
4071
 
4149
4072
 
4150
4073
  computed: {
4151
- input(_, $el) {
4152
- return $(selInput, $el);
4153
- },
4154
-
4155
- state() {
4156
- return this.input.nextElementSibling;
4157
- },
4074
+ target(_ref, $el) {let { target, targetX, targetY } = _ref;
4075
+ targetX = targetX || target || this.targetEl;
4076
+ targetY = targetY || target || this.targetEl;
4158
4077
 
4159
- target(_ref, $el) {let { target } = _ref;
4160
- return (
4161
- target && (
4162
- target === true && parent(this.input) === $el && this.input.nextElementSibling ||
4163
- $(target, $el)));
4078
+ return [
4079
+ targetX === true ? window : query(targetX, $el),
4080
+ targetY === true ? window : query(targetY, $el)];
4164
4081
 
4165
4082
  } },
4166
4083
 
4167
4084
 
4168
- update() {var _input$files;
4169
- const { target, input } = this;
4085
+ created() {
4086
+ this.tracker = new MouseTracker();
4087
+ },
4170
4088
 
4171
- if (!target) {
4172
- return;
4173
- }
4089
+ beforeConnect() {
4090
+ this.clsDrop = this.$props.clsDrop || "uk-" + this.$options.name;
4091
+ },
4174
4092
 
4175
- let option;
4176
- const prop = isInput(target) ? 'value' : 'textContent';
4177
- const prev = target[prop];
4178
- const value = (_input$files = input.files) != null && _input$files[0] ?
4179
- input.files[0].name :
4180
- matches(input, 'select') && (
4181
- option = $$('option', input).filter((el) => el.selected)[0]) // eslint-disable-line prefer-destructuring
4182
- ? option.textContent :
4183
- input.value;
4093
+ connected() {
4094
+ addClass(this.$el, this.clsDrop);
4184
4095
 
4185
- if (prev !== value) {
4186
- target[prop] = value;
4096
+ if (this.toggle && !this.targetEl) {
4097
+ this.targetEl = this.$create('toggle', query(this.toggle, this.$el), {
4098
+ target: this.$el,
4099
+ mode: this.mode }).
4100
+ $el;
4101
+ attr(this.targetEl, 'aria-haspopup', true);
4102
+ this.lazyload(this.targetEl);
4103
+ }
4104
+ },
4105
+
4106
+ disconnected() {
4107
+ if (this.isActive()) {
4108
+ active = null;
4187
4109
  }
4188
4110
  },
4189
4111
 
4190
4112
  events: [
4191
4113
  {
4192
- name: 'change',
4114
+ name: 'click',
4193
4115
 
4194
- handler() {
4195
- this.$emit();
4116
+ delegate() {
4117
+ return "." + this.clsDrop + "-close";
4118
+ },
4119
+
4120
+ handler(e) {
4121
+ e.preventDefault();
4122
+ this.hide(false);
4196
4123
  } },
4197
4124
 
4198
4125
 
4199
4126
  {
4200
- name: 'reset',
4127
+ name: 'click',
4201
4128
 
4202
- el() {
4203
- return closest(this.$el, 'form');
4129
+ delegate() {
4130
+ return 'a[href^="#"]';
4204
4131
  },
4205
4132
 
4133
+ handler(_ref2) {let { defaultPrevented, current: { hash } } = _ref2;
4134
+ if (!defaultPrevented && hash && !within(hash, this.$el)) {
4135
+ this.hide(false);
4136
+ }
4137
+ } },
4138
+
4139
+
4140
+ {
4141
+ name: 'beforescroll',
4142
+
4206
4143
  handler() {
4207
- this.$emit();
4208
- } }] };
4144
+ this.hide(false);
4145
+ } },
4209
4146
 
4210
- var Margin = {
4211
- mixins: [Resize],
4212
4147
 
4213
- props: {
4214
- margin: String,
4215
- firstColumn: Boolean },
4148
+ {
4149
+ name: 'toggle',
4216
4150
 
4151
+ self: true,
4217
4152
 
4218
- data: {
4219
- margin: 'uk-margin-small-top',
4220
- firstColumn: 'uk-first-column' },
4153
+ handler(e, toggle) {
4154
+ e.preventDefault();
4221
4155
 
4156
+ if (this.isToggled()) {
4157
+ this.hide(false);
4158
+ } else {
4159
+ this.show(toggle == null ? void 0 : toggle.$el, false);
4160
+ }
4161
+ } },
4222
4162
 
4223
- resizeTargets() {
4224
- return [this.$el, ...toArray(this.$el.children)];
4225
- },
4226
4163
 
4227
- connected() {
4228
- this.registerObserver(
4229
- observeMutation(this.$el, () => this.$reset(), {
4230
- childList: true }));
4164
+ {
4165
+ name: 'toggleshow',
4231
4166
 
4167
+ self: true,
4232
4168
 
4233
- },
4169
+ handler(e, toggle) {
4170
+ e.preventDefault();
4171
+ this.show(toggle == null ? void 0 : toggle.$el);
4172
+ } },
4234
4173
 
4235
- update: {
4236
- read() {
4237
- const rows = getRows(this.$el.children);
4238
4174
 
4239
- return {
4240
- rows,
4241
- columns: getColumns(rows) };
4175
+ {
4176
+ name: 'togglehide',
4242
4177
 
4243
- },
4178
+ self: true,
4244
4179
 
4245
- write(_ref) {let { columns, rows } = _ref;
4246
- for (const row of rows) {
4247
- for (const column of row) {
4248
- toggleClass(column, this.margin, rows[0] !== row);
4249
- toggleClass(column, this.firstColumn, columns[0].includes(column));
4250
- }
4180
+ handler(e) {
4181
+ e.preventDefault();
4182
+ if (!matches(this.$el, ':focus,:hover')) {
4183
+ this.hide();
4251
4184
  }
4252
- },
4185
+ } },
4253
4186
 
4254
- events: ['resize'] } };
4255
4187
 
4188
+ {
4189
+ name: pointerEnter + " focusin",
4256
4190
 
4191
+ filter() {
4192
+ return includes(this.mode, 'hover');
4193
+ },
4257
4194
 
4258
- function getRows(items) {
4259
- return sortBy(items, 'top', 'bottom');
4260
- }
4195
+ handler(e) {
4196
+ if (!isTouch(e)) {
4197
+ this.clearTimers();
4198
+ }
4199
+ } },
4261
4200
 
4262
- function getColumns(rows) {
4263
- const columns = [];
4264
4201
 
4265
- for (const row of rows) {
4266
- const sorted = sortBy(row, 'left', 'right');
4267
- for (let j = 0; j < sorted.length; j++) {
4268
- columns[j] = columns[j] ? columns[j].concat(sorted[j]) : sorted[j];
4269
- }
4270
- }
4202
+ {
4203
+ name: pointerLeave + " focusout",
4271
4204
 
4272
- return isRtl ? columns.reverse() : columns;
4273
- }
4205
+ filter() {
4206
+ return includes(this.mode, 'hover');
4207
+ },
4274
4208
 
4275
- function sortBy(items, startProp, endProp) {
4276
- const sorted = [[]];
4209
+ handler(e) {
4210
+ if (!isTouch(e) && e.relatedTarget) {
4211
+ this.hide();
4212
+ }
4213
+ } },
4277
4214
 
4278
- for (const el of items) {
4279
- if (!isVisible(el)) {
4280
- continue;
4281
- }
4282
4215
 
4283
- let dim = getOffset(el);
4216
+ {
4217
+ name: 'toggled',
4284
4218
 
4285
- for (let i = sorted.length - 1; i >= 0; i--) {
4286
- const current = sorted[i];
4219
+ self: true,
4287
4220
 
4288
- if (!current[0]) {
4289
- current.push(el);
4290
- break;
4221
+ handler(e, toggled) {
4222
+ if (!toggled) {
4223
+ return;
4291
4224
  }
4292
4225
 
4293
- let startDim;
4294
- if (current[0].offsetParent === el.offsetParent) {
4295
- startDim = getOffset(current[0]);
4296
- } else {
4297
- dim = getOffset(el, true);
4298
- startDim = getOffset(current[0], true);
4299
- }
4226
+ this.clearTimers();
4227
+ this.position();
4228
+ } },
4300
4229
 
4301
- if (dim[startProp] >= startDim[endProp] - 1 && dim[startProp] !== startDim[startProp]) {
4302
- sorted.push([el]);
4303
- break;
4304
- }
4305
4230
 
4306
- if (dim[endProp] - 1 > startDim[startProp] || dim[startProp] === startDim[startProp]) {
4307
- current.push(el);
4308
- break;
4309
- }
4231
+ {
4232
+ name: 'show',
4310
4233
 
4311
- if (i === 0) {
4312
- sorted.unshift([el]);
4313
- break;
4314
- }
4315
- }
4316
- }
4234
+ self: true,
4317
4235
 
4318
- return sorted;
4319
- }
4236
+ handler() {
4237
+ active = this;
4320
4238
 
4321
- function getOffset(element, offset) {if (offset === void 0) {offset = false;}
4322
- let { offsetTop, offsetLeft, offsetHeight, offsetWidth } = element;
4323
-
4324
- if (offset) {
4325
- [offsetTop, offsetLeft] = offsetPosition(element);
4326
- }
4327
-
4328
- return {
4329
- top: offsetTop,
4330
- left: offsetLeft,
4331
- bottom: offsetTop + offsetHeight,
4332
- right: offsetLeft + offsetWidth };
4239
+ this.tracker.init();
4333
4240
 
4334
- }
4241
+ for (const handler of [
4242
+ on(
4243
+ document,
4244
+ pointerDown,
4245
+ (_ref3) => {let { target } = _ref3;return (
4246
+ !within(target, this.$el) &&
4247
+ once(
4248
+ document,
4249
+ pointerUp + " " + pointerCancel + " scroll",
4250
+ (_ref4) => {let { defaultPrevented, type, target: newTarget } = _ref4;
4251
+ if (
4252
+ !defaultPrevented &&
4253
+ type === pointerUp &&
4254
+ target === newTarget &&
4255
+ !(this.targetEl && within(target, this.targetEl)))
4256
+ {
4257
+ this.hide(false);
4258
+ }
4259
+ },
4260
+ true));}),
4335
4261
 
4336
- var Scroll = {
4337
- connected() {
4338
- registerScrollListener(this._uid, () => this.$emit('scroll'));
4339
- },
4340
4262
 
4341
- disconnected() {
4342
- unregisterScrollListener(this._uid);
4343
- } };
4344
4263
 
4264
+ on(document, 'keydown', (e) => {
4265
+ if (e.keyCode === 27) {
4266
+ this.hide(false);
4267
+ }
4268
+ }),
4345
4269
 
4346
- const scrollListeners = new Map();
4347
- let unbindScrollListener;
4348
- function registerScrollListener(id, listener) {
4349
- unbindScrollListener =
4350
- unbindScrollListener ||
4351
- on(window, 'scroll', () => scrollListeners.forEach((listener) => listener()), {
4352
- passive: true,
4353
- capture: true });
4270
+ ...(this.bgScroll ?
4271
+ [] :
4272
+ [preventOverscroll(this.$el), preventBackgroundScroll()]),
4354
4273
 
4274
+ ...(this.display === 'static' ?
4275
+ [] :
4276
+ (() => {
4277
+ const handler = () => this.$emit();
4278
+ return [
4279
+ on(window, 'resize', handler),
4280
+ on([document, scrollParents(this.$el)], 'scroll', handler),
4281
+ (() => {
4282
+ const observer = observeResize(
4283
+ scrollParents(this.$el),
4284
+ handler);
4355
4285
 
4356
- scrollListeners.set(id, listener);
4357
- }
4286
+ return () => observer.disconnect();
4287
+ })()];
4358
4288
 
4359
- function unregisterScrollListener(id) {
4360
- scrollListeners.delete(id);
4361
- if (unbindScrollListener && !scrollListeners.size) {
4362
- unbindScrollListener();
4363
- unbindScrollListener = null;
4364
- }
4365
- }
4289
+ })())])
4290
+ {
4291
+ once(this.$el, 'hide', handler, { self: true });
4292
+ }
4293
+ } },
4366
4294
 
4367
- var grid = {
4368
- extends: Margin,
4369
4295
 
4370
- mixins: [Class, Scroll],
4296
+ {
4297
+ name: 'beforehide',
4371
4298
 
4372
- name: 'grid',
4299
+ self: true,
4373
4300
 
4374
- props: {
4375
- masonry: Boolean,
4376
- parallax: Number },
4301
+ handler() {
4302
+ this.clearTimers();
4303
+ } },
4377
4304
 
4378
4305
 
4379
- data: {
4380
- margin: 'uk-grid-margin',
4381
- clsStack: 'uk-grid-stack',
4382
- masonry: false,
4383
- parallax: 0 },
4306
+ {
4307
+ name: 'hide',
4384
4308
 
4309
+ handler(_ref5) {let { target } = _ref5;
4310
+ if (this.$el !== target) {
4311
+ active =
4312
+ active === null && within(target, this.$el) && this.isToggled() ?
4313
+ this :
4314
+ active;
4315
+ return;
4316
+ }
4385
4317
 
4386
- connected() {
4387
- this.masonry && addClass(this.$el, 'uk-flex-top uk-flex-wrap-top');
4388
- },
4318
+ active = this.isActive() ? null : active;
4319
+ this.tracker.cancel();
4320
+ } }],
4389
4321
 
4390
- update: [
4391
- {
4392
- write(_ref) {let { columns } = _ref;
4393
- toggleClass(this.$el, this.clsStack, columns.length < 2);
4394
- },
4395
4322
 
4396
- events: ['resize'] },
4397
4323
 
4324
+ update: {
4325
+ write() {
4326
+ if (this.isToggled() && !hasClass(this.$el, this.clsEnter)) {
4327
+ this.position();
4328
+ }
4329
+ } },
4398
4330
 
4399
- {
4400
- read(data) {
4401
- let { columns, rows } = data;
4402
4331
 
4403
- // Filter component makes elements positioned absolute
4404
- if (
4405
- !columns.length ||
4406
- !this.masonry && !this.parallax ||
4407
- positionedAbsolute(this.$el))
4408
- {
4409
- data.translates = false;
4410
- return false;
4332
+ methods: {
4333
+ show(target, delay) {if (target === void 0) {target = this.targetEl;}if (delay === void 0) {delay = true;}
4334
+ if (this.isToggled() && target && this.targetEl && target !== this.targetEl) {
4335
+ this.hide(false, false);
4411
4336
  }
4412
4337
 
4413
- let translates = false;
4338
+ this.targetEl = target;
4414
4339
 
4415
- const nodes = children(this.$el);
4416
- const columnHeights = getColumnHeights(columns);
4417
- const margin = getMarginTop(nodes, this.margin) * (rows.length - 1);
4418
- const elHeight = Math.max(...columnHeights) + margin;
4340
+ this.clearTimers();
4419
4341
 
4420
- if (this.masonry) {
4421
- columns = columns.map((column) => sortBy$1(column, 'offsetTop'));
4422
- translates = getTranslates(rows, columns);
4342
+ if (this.isActive()) {
4343
+ return;
4423
4344
  }
4424
4345
 
4425
- let padding = Math.abs(this.parallax);
4426
- if (padding) {
4427
- padding = columnHeights.reduce(
4428
- (newPadding, hgt, i) =>
4429
- Math.max(
4430
- newPadding,
4431
- hgt + margin + (i % 2 ? padding : padding / 8) - elHeight),
4346
+ if (active) {
4347
+ if (delay && active.isDelaying) {
4348
+ this.showTimer = setTimeout(() => matches(target, ':hover') && this.show(), 10);
4349
+ return;
4350
+ }
4432
4351
 
4433
- 0);
4352
+ let prev;
4353
+ while (active && prev !== active && !within(this.$el, active.$el)) {
4354
+ prev = active;
4355
+ active.hide(false, false);
4356
+ }
4357
+ }
4434
4358
 
4359
+ if (this.container && parent(this.$el) !== this.container) {
4360
+ append(this.container, this.$el);
4435
4361
  }
4436
4362
 
4437
- return { padding, columns, translates, height: translates ? elHeight : '' };
4438
- },
4363
+ this.showTimer = setTimeout(
4364
+ () => this.toggleElement(this.$el, true),
4365
+ delay && this.delayShow || 0);
4439
4366
 
4440
- write(_ref2) {let { height, padding } = _ref2;
4441
- css(this.$el, 'paddingBottom', padding || '');
4442
- height !== false && css(this.$el, 'height', height);
4443
4367
  },
4444
4368
 
4445
- events: ['resize'] },
4369
+ hide(delay, animate) {if (delay === void 0) {delay = true;}if (animate === void 0) {animate = true;}
4370
+ const hide = () => this.toggleElement(this.$el, false, this.animateOut && animate);
4446
4371
 
4372
+ this.clearTimers();
4447
4373
 
4448
- {
4449
- read() {
4450
- if (this.parallax && positionedAbsolute(this.$el)) {
4451
- return false;
4374
+ this.isDelaying = getPositionedElements(this.$el).some((el) =>
4375
+ this.tracker.movesTo(el));
4376
+
4377
+
4378
+ if (delay && this.isDelaying) {
4379
+ this.hideTimer = setTimeout(this.hide, 50);
4380
+ } else if (delay && this.delayHide) {
4381
+ this.hideTimer = setTimeout(hide, this.delayHide);
4382
+ } else {
4383
+ hide();
4452
4384
  }
4385
+ },
4453
4386
 
4454
- return {
4455
- scrolled: this.parallax ?
4456
- scrolledOver(this.$el) * Math.abs(this.parallax) :
4457
- false };
4387
+ clearTimers() {
4388
+ clearTimeout(this.showTimer);
4389
+ clearTimeout(this.hideTimer);
4390
+ this.showTimer = null;
4391
+ this.hideTimer = null;
4392
+ this.isDelaying = false;
4393
+ },
4458
4394
 
4395
+ isActive() {
4396
+ return active === this;
4459
4397
  },
4460
4398
 
4461
- write(_ref3) {let { columns, scrolled, translates } = _ref3;
4462
- if (scrolled === false && !translates) {
4463
- return;
4464
- }
4399
+ position() {
4400
+ removeClass(this.$el, this.clsDrop + "-stack");
4401
+ attr(this.$el, 'style', this._style);
4465
4402
 
4466
- columns.forEach((column, i) =>
4467
- column.forEach((el, j) =>
4468
- css(
4469
- el,
4470
- 'transform',
4471
- !scrolled && !translates ?
4472
- '' : "translateY(" + (
4403
+ // Ensure none positioned element does not generate scrollbars
4404
+ this.$el.hidden = true;
4473
4405
 
4474
- (translates && -translates[i][j]) + (
4475
- scrolled ? i % 2 ? scrolled : scrolled / 8 : 0)) + "px)")));
4406
+ const boundary = query(this.boundary, this.$el);
4407
+ const boundaryOffset = offsetViewport(boundary || window);
4408
+ const viewports = this.target.map((target) => offsetViewport(scrollParents(target)[0]));
4409
+ const viewportOffset = this.getViewportOffset(this.$el);
4476
4410
 
4411
+ const dirs = [
4412
+ [0, ['x', 'width', 'left', 'right']],
4413
+ [1, ['y', 'height', 'top', 'bottom']]];
4477
4414
 
4478
4415
 
4416
+ for (const [i, [axis, prop]] of dirs) {
4417
+ if (this.axis !== axis && includes([axis, true], this.stretch)) {
4418
+ css(this.$el, {
4419
+ [prop]: Math.min(
4420
+ boundaryOffset[prop],
4421
+ viewports[i][prop] - 2 * viewportOffset),
4479
4422
 
4480
- },
4423
+ ["overflow-" + axis]: 'auto' });
4481
4424
 
4482
- events: ['scroll', 'resize'] }] };
4425
+ }
4426
+ }
4427
+
4428
+ const maxWidth = viewports[0].width - 2 * viewportOffset;
4429
+
4430
+ if (this.$el.offsetWidth > maxWidth) {
4431
+ addClass(this.$el, this.clsDrop + "-stack");
4432
+ }
4483
4433
 
4434
+ css(this.$el, 'maxWidth', maxWidth);
4484
4435
 
4436
+ this.$el.hidden = false;
4485
4437
 
4438
+ this.positionAt(this.$el, this.target, boundary);
4486
4439
 
4487
- function positionedAbsolute(el) {
4488
- return children(el).some((el) => css(el, 'position') === 'absolute');
4489
- }
4440
+ for (const [i, [axis, prop, start, end]] of dirs) {
4441
+ if (this.axis === axis && includes([axis, true], this.stretch)) {
4442
+ const positionOffset = Math.abs(this.getPositionOffset(this.$el));
4443
+ const targetOffset = offset(this.target[i]);
4444
+ const elOffset = offset(this.$el);
4490
4445
 
4491
- function getTranslates(rows, columns) {
4492
- const rowHeights = rows.map((row) => Math.max(...row.map((el) => el.offsetHeight)));
4446
+ css(this.$el, {
4447
+ [prop]:
4448
+ (targetOffset[start] > elOffset[start] ?
4449
+ targetOffset[start] -
4450
+ Math.max(
4451
+ boundaryOffset[start],
4452
+ viewports[i][start] + viewportOffset) :
4493
4453
 
4494
- return columns.map((elements) => {
4495
- let prev = 0;
4496
- return elements.map(
4497
- (element, row) =>
4498
- prev += row ? rowHeights[row - 1] - elements[row - 1].offsetHeight : 0);
4454
+ Math.min(
4455
+ boundaryOffset[end],
4456
+ viewports[i][end] - viewportOffset) -
4457
+ targetOffset[end]) - positionOffset,
4458
+ ["overflow-" + axis]: 'auto' });
4499
4459
 
4500
- });
4501
- }
4502
4460
 
4503
- function getMarginTop(nodes, cls) {
4504
- const [node] = nodes.filter((el) => hasClass(el, cls));
4461
+ this.positionAt(this.$el, this.target, boundary);
4462
+ }
4463
+ }
4464
+ } } };
4505
4465
 
4506
- return toFloat(node ? css(node, 'marginTop') : css(nodes[0], 'paddingLeft'));
4507
- }
4508
4466
 
4509
- function getColumnHeights(columns) {
4510
- return columns.map((column) => column.reduce((sum, el) => sum + el.offsetHeight, 0));
4467
+
4468
+ function getPositionedElements(el) {
4469
+ const result = [];
4470
+ apply(el, (el) => css(el, 'position') !== 'static' && result.push(el));
4471
+ return result;
4511
4472
  }
4512
4473
 
4513
- var heightMatch = {
4514
- mixins: [Resize],
4474
+ var formCustom = {
4475
+ mixins: [Class],
4515
4476
 
4516
4477
  args: 'target',
4517
4478
 
4518
4479
  props: {
4519
- target: String,
4520
- row: Boolean },
4480
+ target: Boolean },
4521
4481
 
4522
4482
 
4523
4483
  data: {
4524
- target: '> *',
4525
- row: true },
4484
+ target: false },
4526
4485
 
4527
4486
 
4528
4487
  computed: {
4529
- elements: {
4530
- get(_ref, $el) {let { target } = _ref;
4531
- return $$(target, $el);
4532
- },
4533
-
4534
- watch() {
4535
- this.$reset();
4536
- } } },
4537
-
4538
-
4539
-
4540
- resizeTargets() {
4541
- return [this.$el, ...this.elements];
4542
- },
4543
-
4544
- update: {
4545
- read() {
4546
- return {
4547
- rows: (this.row ? getRows(this.elements) : [this.elements]).map(match) };
4548
-
4488
+ input(_, $el) {
4489
+ return $(selInput, $el);
4549
4490
  },
4550
4491
 
4551
- write(_ref2) {let { rows } = _ref2;
4552
- for (const { heights, elements } of rows) {
4553
- elements.forEach((el, i) => css(el, 'minHeight', heights[i]));
4554
- }
4492
+ state() {
4493
+ return this.input.nextElementSibling;
4555
4494
  },
4556
4495
 
4557
- events: ['resize'] } };
4496
+ target(_ref, $el) {let { target } = _ref;
4497
+ return (
4498
+ target && (
4499
+ target === true && parent(this.input) === $el && this.input.nextElementSibling ||
4500
+ $(target, $el)));
4558
4501
 
4502
+ } },
4559
4503
 
4560
4504
 
4561
- function match(elements) {
4562
- if (elements.length < 2) {
4563
- return { heights: [''], elements };
4564
- }
4505
+ update() {var _input$files;
4506
+ const { target, input } = this;
4565
4507
 
4566
- css(elements, 'minHeight', '');
4567
- let heights = elements.map(getHeight);
4568
- const max = Math.max(...heights);
4508
+ if (!target) {
4509
+ return;
4510
+ }
4569
4511
 
4570
- return {
4571
- heights: elements.map((el, i) => heights[i].toFixed(2) === max.toFixed(2) ? '' : max),
4572
- elements };
4512
+ let option;
4513
+ const prop = isInput(target) ? 'value' : 'textContent';
4514
+ const prev = target[prop];
4515
+ const value = (_input$files = input.files) != null && _input$files[0] ?
4516
+ input.files[0].name :
4517
+ matches(input, 'select') && (
4518
+ option = $$('option', input).filter((el) => el.selected)[0]) // eslint-disable-line prefer-destructuring
4519
+ ? option.textContent :
4520
+ input.value;
4573
4521
 
4574
- }
4522
+ if (prev !== value) {
4523
+ target[prop] = value;
4524
+ }
4525
+ },
4575
4526
 
4576
- function getHeight(element) {
4577
- let style = false;
4578
- if (!isVisible(element)) {
4579
- style = element.style.display;
4580
- css(element, 'display', 'block', 'important');
4581
- }
4527
+ events: [
4528
+ {
4529
+ name: 'change',
4582
4530
 
4583
- const height = dimensions(element).height - boxModelAdjust(element, 'height', 'content-box');
4531
+ handler() {
4532
+ this.$emit();
4533
+ } },
4584
4534
 
4585
- if (style !== false) {
4586
- css(element, 'display', style);
4587
- }
4588
4535
 
4589
- return height;
4590
- }
4536
+ {
4537
+ name: 'reset',
4591
4538
 
4592
- var heightViewport = {
4539
+ el() {
4540
+ return closest(this.$el, 'form');
4541
+ },
4542
+
4543
+ handler() {
4544
+ this.$emit();
4545
+ } }] };
4546
+
4547
+ var Margin = {
4593
4548
  mixins: [Resize],
4594
4549
 
4595
4550
  props: {
4596
- expand: Boolean,
4597
- offsetTop: Boolean,
4598
- offsetBottom: Boolean,
4599
- minHeight: Number },
4551
+ margin: String,
4552
+ firstColumn: Boolean },
4600
4553
 
4601
4554
 
4602
4555
  data: {
4603
- expand: false,
4604
- offsetTop: false,
4605
- offsetBottom: false,
4606
- minHeight: 0 },
4556
+ margin: 'uk-margin-small-top',
4557
+ firstColumn: 'uk-first-column' },
4607
4558
 
4608
4559
 
4609
4560
  resizeTargets() {
4610
- // check for offsetTop change
4611
- return [this.$el, ...scrollParents(this.$el, /auto|scroll/)];
4561
+ return [this.$el, ...toArray(this.$el.children)];
4612
4562
  },
4613
4563
 
4614
- update: {
4615
- read(_ref) {let { minHeight: prev } = _ref;
4616
- if (!isVisible(this.$el)) {
4617
- return false;
4618
- }
4619
-
4620
- let minHeight = '';
4621
- const box = boxModelAdjust(this.$el, 'height', 'content-box');
4622
-
4623
- const [scrollElement] = scrollParents(this.$el, /auto|scroll/);
4624
- const { height: viewportHeight } = offsetViewport(scrollElement);
4625
-
4626
- if (this.expand) {
4627
- minHeight = Math.max(
4628
- viewportHeight - (
4629
- dimensions(scrollElement).height - dimensions(this.$el).height) -
4630
- box,
4631
- 0);
4632
-
4633
- } else {
4634
- // on mobile devices (iOS and Android) window.innerHeight !== 100vh
4635
- minHeight = "calc(" + (
4636
- document.scrollingElement === scrollElement ? '100vh' : viewportHeight + "px");
4564
+ connected() {
4565
+ this.registerObserver(
4566
+ observeMutation(this.$el, () => this.$reset(), {
4567
+ childList: true }));
4637
4568
 
4638
4569
 
4639
- if (this.offsetTop) {
4640
- const top = offsetPosition(this.$el)[0] - offsetPosition(scrollElement)[0];
4641
- minHeight += top > 0 && top < viewportHeight / 2 ? " - " + top + "px" : '';
4642
- }
4570
+ },
4643
4571
 
4644
- if (this.offsetBottom === true) {
4645
- minHeight += " - " + dimensions(this.$el.nextElementSibling).height + "px";
4646
- } else if (isNumeric(this.offsetBottom)) {
4647
- minHeight += " - " + this.offsetBottom + "vh";
4648
- } else if (this.offsetBottom && endsWith(this.offsetBottom, 'px')) {
4649
- minHeight += " - " + toFloat(this.offsetBottom) + "px";
4650
- } else if (isString(this.offsetBottom)) {
4651
- minHeight += " - " + dimensions(query(this.offsetBottom, this.$el)).height + "px";
4652
- }
4572
+ update: {
4573
+ read() {
4574
+ const rows = getRows(this.$el.children);
4653
4575
 
4654
- minHeight += (box ? " - " + box + "px" : '') + ")";
4655
- }
4576
+ return {
4577
+ rows,
4578
+ columns: getColumns(rows) };
4656
4579
 
4657
- return { minHeight, prev };
4658
4580
  },
4659
4581
 
4660
- write(_ref2) {let { minHeight } = _ref2;
4661
- css(this.$el, { minHeight });
4662
-
4663
- if (this.minHeight && toFloat(css(this.$el, 'minHeight')) < this.minHeight) {
4664
- css(this.$el, 'minHeight', this.minHeight);
4582
+ write(_ref) {let { columns, rows } = _ref;
4583
+ for (const row of rows) {
4584
+ for (const column of row) {
4585
+ toggleClass(column, this.margin, rows[0] !== row);
4586
+ toggleClass(column, this.firstColumn, columns[0].includes(column));
4587
+ }
4665
4588
  }
4666
4589
  },
4667
4590
 
4668
4591
  events: ['resize'] } };
4669
4592
 
4670
- var SVG = {
4671
- args: 'src',
4672
-
4673
- props: {
4674
- id: Boolean,
4675
- icon: String,
4676
- src: String,
4677
- style: String,
4678
- width: Number,
4679
- height: Number,
4680
- ratio: Number,
4681
- class: String,
4682
- strokeAnimation: Boolean,
4683
- focusable: Boolean, // IE 11
4684
- attributes: 'list' },
4685
-
4686
4593
 
4687
- data: {
4688
- ratio: 1,
4689
- include: ['style', 'class', 'focusable'],
4690
- class: '',
4691
- strokeAnimation: false },
4692
4594
 
4595
+ function getRows(items) {
4596
+ return sortBy(items, 'top', 'bottom');
4597
+ }
4693
4598
 
4694
- beforeConnect() {
4695
- this.class += ' uk-svg';
4696
- },
4599
+ function getColumns(rows) {
4600
+ const columns = [];
4697
4601
 
4698
- connected() {
4699
- if (!this.icon && includes(this.src, '#')) {
4700
- [this.src, this.icon] = this.src.split('#');
4602
+ for (const row of rows) {
4603
+ const sorted = sortBy(row, 'left', 'right');
4604
+ for (let j = 0; j < sorted.length; j++) {
4605
+ columns[j] = columns[j] ? columns[j].concat(sorted[j]) : sorted[j];
4701
4606
  }
4607
+ }
4702
4608
 
4703
- this.svg = this.getSvg().then((el) => {
4704
- if (this._connected) {
4705
- const svg = insertSVG(el, this.$el);
4609
+ return isRtl ? columns.reverse() : columns;
4610
+ }
4706
4611
 
4707
- if (this.svgEl && svg !== this.svgEl) {
4708
- remove$1(this.svgEl);
4709
- }
4612
+ function sortBy(items, startProp, endProp) {
4613
+ const sorted = [[]];
4710
4614
 
4711
- this.applyAttributes(svg, el);
4615
+ for (const el of items) {
4616
+ if (!isVisible(el)) {
4617
+ continue;
4618
+ }
4712
4619
 
4713
- return this.svgEl = svg;
4714
- }
4715
- }, noop);
4620
+ let dim = getOffset(el);
4716
4621
 
4717
- if (this.strokeAnimation) {
4718
- this.svg.then((el) => {
4719
- if (this._connected) {
4720
- applyAnimation(el);
4721
- this.registerObserver(
4722
- observeIntersection(el, (records, observer) => {
4723
- applyAnimation(el);
4724
- observer.disconnect();
4725
- }));
4622
+ for (let i = sorted.length - 1; i >= 0; i--) {
4623
+ const current = sorted[i];
4726
4624
 
4727
- }
4728
- });
4729
- }
4730
- },
4625
+ if (!current[0]) {
4626
+ current.push(el);
4627
+ break;
4628
+ }
4731
4629
 
4732
- disconnected() {
4733
- this.svg.then((svg) => {
4734
- if (this._connected) {
4735
- return;
4630
+ let startDim;
4631
+ if (current[0].offsetParent === el.offsetParent) {
4632
+ startDim = getOffset(current[0]);
4633
+ } else {
4634
+ dim = getOffset(el, true);
4635
+ startDim = getOffset(current[0], true);
4736
4636
  }
4737
4637
 
4738
- if (isVoidElement(this.$el)) {
4739
- this.$el.hidden = false;
4638
+ if (dim[startProp] >= startDim[endProp] - 1 && dim[startProp] !== startDim[startProp]) {
4639
+ sorted.push([el]);
4640
+ break;
4740
4641
  }
4741
4642
 
4742
- remove$1(svg);
4743
- this.svgEl = null;
4744
- });
4745
-
4746
- this.svg = null;
4747
- },
4748
-
4749
- methods: {
4750
- async getSvg() {
4751
- if (isTag(this.$el, 'img') && !this.$el.complete && this.$el.loading === 'lazy') {
4752
- return new Promise((resolve) =>
4753
- once(this.$el, 'load', () => resolve(this.getSvg())));
4643
+ if (dim[endProp] - 1 > startDim[startProp] || dim[startProp] === startDim[startProp]) {
4644
+ current.push(el);
4645
+ break;
4646
+ }
4754
4647
 
4648
+ if (i === 0) {
4649
+ sorted.unshift([el]);
4650
+ break;
4755
4651
  }
4652
+ }
4653
+ }
4756
4654
 
4757
- return parseSVG(await loadSVG(this.src), this.icon) || Promise.reject('SVG not found.');
4758
- },
4655
+ return sorted;
4656
+ }
4759
4657
 
4760
- applyAttributes(el, ref) {
4761
- for (const prop in this.$options.props) {
4762
- if (includes(this.include, prop) && prop in this) {
4763
- attr(el, prop, this[prop]);
4764
- }
4765
- }
4658
+ function getOffset(element, offset) {if (offset === void 0) {offset = false;}
4659
+ let { offsetTop, offsetLeft, offsetHeight, offsetWidth } = element;
4766
4660
 
4767
- for (const attribute in this.attributes) {
4768
- const [prop, value] = this.attributes[attribute].split(':', 2);
4769
- attr(el, prop, value);
4770
- }
4661
+ if (offset) {
4662
+ [offsetTop, offsetLeft] = offsetPosition(element);
4663
+ }
4771
4664
 
4772
- if (!this.id) {
4773
- removeAttr(el, 'id');
4774
- }
4665
+ return {
4666
+ top: offsetTop,
4667
+ left: offsetLeft,
4668
+ bottom: offsetTop + offsetHeight,
4669
+ right: offsetLeft + offsetWidth };
4775
4670
 
4776
- const props = ['width', 'height'];
4777
- let dimensions = props.map((prop) => this[prop]);
4671
+ }
4778
4672
 
4779
- if (!dimensions.some((val) => val)) {
4780
- dimensions = props.map((prop) => attr(ref, prop));
4781
- }
4673
+ var Scroll = {
4674
+ connected() {
4675
+ registerScrollListener(this._uid, () => this.$emit('scroll'));
4676
+ },
4782
4677
 
4783
- const viewBox = attr(ref, 'viewBox');
4784
- if (viewBox && !dimensions.some((val) => val)) {
4785
- dimensions = viewBox.split(' ').slice(2);
4786
- }
4678
+ disconnected() {
4679
+ unregisterScrollListener(this._uid);
4680
+ } };
4787
4681
 
4788
- dimensions.forEach((val, i) => attr(el, props[i], toFloat(val) * this.ratio || null));
4789
- } } };
4790
4682
 
4683
+ const scrollListeners = new Map();
4684
+ let unbindScrollListener;
4685
+ function registerScrollListener(id, listener) {
4686
+ unbindScrollListener =
4687
+ unbindScrollListener ||
4688
+ on(window, 'scroll', () => scrollListeners.forEach((listener) => listener()), {
4689
+ passive: true,
4690
+ capture: true });
4791
4691
 
4792
4692
 
4793
- const loadSVG = memoize(async (src) => {
4794
- if (src) {
4795
- if (startsWith(src, 'data:')) {
4796
- return decodeURIComponent(src.split(',')[1]);
4797
- } else {
4798
- return (await fetch(src)).text();
4799
- }
4800
- } else {
4801
- return Promise.reject();
4802
- }
4803
- });
4693
+ scrollListeners.set(id, listener);
4694
+ }
4804
4695
 
4805
- function parseSVG(svg, icon) {var _svg;
4806
- if (icon && includes(svg, '<symbol')) {
4807
- svg = parseSymbols(svg, icon) || svg;
4696
+ function unregisterScrollListener(id) {
4697
+ scrollListeners.delete(id);
4698
+ if (unbindScrollListener && !scrollListeners.size) {
4699
+ unbindScrollListener();
4700
+ unbindScrollListener = null;
4808
4701
  }
4809
-
4810
- svg = $(svg.substr(svg.indexOf('<svg')));
4811
- return ((_svg = svg) == null ? void 0 : _svg.hasChildNodes()) && svg;
4812
4702
  }
4813
4703
 
4814
- const symbolRe = /<symbol([^]*?id=(['"])(.+?)\2[^]*?<\/)symbol>/g;
4815
- const symbols = {};
4704
+ var grid = {
4705
+ extends: Margin,
4816
4706
 
4817
- function parseSymbols(svg, icon) {
4818
- if (!symbols[svg]) {
4819
- symbols[svg] = {};
4707
+ mixins: [Class, Scroll],
4820
4708
 
4821
- symbolRe.lastIndex = 0;
4709
+ name: 'grid',
4822
4710
 
4823
- let match;
4824
- while (match = symbolRe.exec(svg)) {
4825
- symbols[svg][match[3]] = "<svg xmlns=\"http://www.w3.org/2000/svg\"" + match[1] + "svg>";
4826
- }
4827
- }
4711
+ props: {
4712
+ masonry: Boolean,
4713
+ parallax: Number },
4828
4714
 
4829
- return symbols[svg][icon];
4830
- }
4831
4715
 
4832
- function applyAnimation(el) {
4833
- const length = getMaxPathLength(el);
4716
+ data: {
4717
+ margin: 'uk-grid-margin',
4718
+ clsStack: 'uk-grid-stack',
4719
+ masonry: false,
4720
+ parallax: 0 },
4834
4721
 
4835
- if (length) {
4836
- el.style.setProperty('--uk-animation-stroke', length);
4837
- }
4838
- }
4839
4722
 
4840
- function getMaxPathLength(el) {
4841
- return Math.ceil(
4842
- Math.max(
4843
- 0,
4844
- ...$$('[stroke]', el).map((stroke) => {
4845
- try {
4846
- return stroke.getTotalLength();
4847
- } catch (e) {
4848
- return 0;
4849
- }
4850
- })));
4723
+ connected() {
4724
+ this.masonry && addClass(this.$el, 'uk-flex-top uk-flex-wrap-top');
4725
+ },
4851
4726
 
4727
+ update: [
4728
+ {
4729
+ write(_ref) {let { columns } = _ref;
4730
+ toggleClass(this.$el, this.clsStack, columns.length < 2);
4731
+ },
4852
4732
 
4853
- }
4733
+ events: ['resize'] },
4854
4734
 
4855
- function insertSVG(el, root) {
4856
- if (isVoidElement(root) || isTag(root, 'canvas')) {
4857
- root.hidden = true;
4858
4735
 
4859
- const next = root.nextElementSibling;
4860
- return equals(el, next) ? next : after(root, el);
4861
- }
4736
+ {
4737
+ read(data) {
4738
+ let { columns, rows } = data;
4862
4739
 
4863
- const last = root.lastElementChild;
4864
- return equals(el, last) ? last : append(root, el);
4865
- }
4740
+ // Filter component makes elements positioned absolute
4741
+ if (
4742
+ !columns.length ||
4743
+ !this.masonry && !this.parallax ||
4744
+ positionedAbsolute(this.$el))
4745
+ {
4746
+ data.translates = false;
4747
+ return false;
4748
+ }
4866
4749
 
4867
- function equals(el, other) {
4868
- return isTag(el, 'svg') && isTag(other, 'svg') && innerHTML(el) === innerHTML(other);
4869
- }
4750
+ let translates = false;
4870
4751
 
4871
- function innerHTML(el) {
4872
- return (
4873
- el.innerHTML ||
4874
- new XMLSerializer().serializeToString(el).replace(/<svg.*?>(.*?)<\/svg>/g, '$1')).
4875
- replace(/\s/g, '');
4876
- }
4752
+ const nodes = children(this.$el);
4753
+ const columnHeights = getColumnHeights(columns);
4754
+ const margin = getMarginTop(nodes, this.margin) * (rows.length - 1);
4755
+ const elHeight = Math.max(...columnHeights) + margin;
4877
4756
 
4878
- 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>";
4757
+ if (this.masonry) {
4758
+ columns = columns.map((column) => sortBy$1(column, 'offsetTop'));
4759
+ translates = getTranslates(rows, columns);
4760
+ }
4879
4761
 
4880
- 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>";
4762
+ let padding = Math.abs(this.parallax);
4763
+ if (padding) {
4764
+ padding = columnHeights.reduce(
4765
+ (newPadding, hgt, i) =>
4766
+ Math.max(
4767
+ newPadding,
4768
+ hgt + margin + (i % 2 ? padding : padding / 8) - elHeight),
4881
4769
 
4882
- 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>";
4770
+ 0);
4883
4771
 
4884
- 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>";
4772
+ }
4885
4773
 
4886
- 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>";
4774
+ return { padding, columns, translates, height: translates ? elHeight : '' };
4775
+ },
4887
4776
 
4888
- 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>";
4777
+ write(_ref2) {let { height, padding } = _ref2;
4778
+ css(this.$el, 'paddingBottom', padding || '');
4779
+ height !== false && css(this.$el, 'height', height);
4780
+ },
4889
4781
 
4890
- 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>";
4782
+ events: ['resize'] },
4891
4783
 
4892
- 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>";
4893
4784
 
4894
- 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>";
4785
+ {
4786
+ read() {
4787
+ if (this.parallax && positionedAbsolute(this.$el)) {
4788
+ return false;
4789
+ }
4895
4790
 
4896
- 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>";
4791
+ return {
4792
+ scrolled: this.parallax ?
4793
+ scrolledOver(this.$el) * Math.abs(this.parallax) :
4794
+ false };
4897
4795
 
4898
- 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>";
4796
+ },
4899
4797
 
4900
- 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>";
4798
+ write(_ref3) {let { columns, scrolled, translates } = _ref3;
4799
+ if (scrolled === false && !translates) {
4800
+ return;
4801
+ }
4901
4802
 
4902
- 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>";
4803
+ columns.forEach((column, i) =>
4804
+ column.forEach((el, j) =>
4805
+ css(
4806
+ el,
4807
+ 'transform',
4808
+ !scrolled && !translates ?
4809
+ '' : "translateY(" + (
4903
4810
 
4904
- 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>";
4811
+ (translates && -translates[i][j]) + (
4812
+ scrolled ? i % 2 ? scrolled : scrolled / 8 : 0)) + "px)")));
4905
4813
 
4906
- 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>";
4907
4814
 
4908
- 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>";
4909
4815
 
4910
- const icons = {
4911
- spinner,
4912
- totop,
4913
- marker,
4914
- 'close-icon': closeIcon,
4915
- 'close-large': closeLarge,
4916
- 'navbar-toggle-icon': navbarToggleIcon,
4917
- 'overlay-icon': overlayIcon,
4918
- 'pagination-next': paginationNext,
4919
- 'pagination-previous': paginationPrevious,
4920
- 'search-icon': searchIcon,
4921
- 'search-large': searchLarge,
4922
- 'search-navbar': searchNavbar,
4923
- 'slidenav-next': slidenavNext,
4924
- 'slidenav-next-large': slidenavNextLarge,
4925
- 'slidenav-previous': slidenavPrevious,
4926
- 'slidenav-previous-large': slidenavPreviousLarge };
4927
-
4928
-
4929
- const Icon = {
4930
- install: install$1,
4931
-
4932
- extends: SVG,
4933
4816
 
4934
- args: 'icon',
4935
-
4936
- props: ['icon'],
4817
+ },
4937
4818
 
4938
- data: {
4939
- include: ['focusable'] },
4819
+ events: ['scroll', 'resize'] }] };
4940
4820
 
4941
4821
 
4942
- isIcon: true,
4943
4822
 
4944
- beforeConnect() {
4945
- addClass(this.$el, 'uk-icon');
4946
- },
4947
4823
 
4948
- methods: {
4949
- async getSvg() {
4950
- const icon = getIcon(this.icon);
4824
+ function positionedAbsolute(el) {
4825
+ return children(el).some((el) => css(el, 'position') === 'absolute');
4826
+ }
4951
4827
 
4952
- if (!icon) {
4953
- throw 'Icon not found.';
4954
- }
4828
+ function getTranslates(rows, columns) {
4829
+ const rowHeights = rows.map((row) => Math.max(...row.map((el) => el.offsetHeight)));
4955
4830
 
4956
- return icon;
4957
- } } };
4831
+ return columns.map((elements) => {
4832
+ let prev = 0;
4833
+ return elements.map(
4834
+ (element, row) =>
4835
+ prev += row ? rowHeights[row - 1] - elements[row - 1].offsetHeight : 0);
4958
4836
 
4959
- const IconComponent = {
4960
- args: false,
4837
+ });
4838
+ }
4961
4839
 
4962
- extends: Icon,
4840
+ function getMarginTop(nodes, cls) {
4841
+ const [node] = nodes.filter((el) => hasClass(el, cls));
4963
4842
 
4964
- data: (vm) => ({
4965
- icon: hyphenate(vm.constructor.options.name) }),
4843
+ return toFloat(node ? css(node, 'marginTop') : css(nodes[0], 'paddingLeft'));
4844
+ }
4966
4845
 
4846
+ function getColumnHeights(columns) {
4847
+ return columns.map((column) => column.reduce((sum, el) => sum + el.offsetHeight, 0));
4848
+ }
4967
4849
 
4968
- beforeConnect() {
4969
- addClass(this.$el, this.$name);
4970
- } };
4850
+ var heightMatch = {
4851
+ mixins: [Resize],
4971
4852
 
4853
+ args: 'target',
4972
4854
 
4973
- const Slidenav = {
4974
- extends: IconComponent,
4855
+ props: {
4856
+ target: String,
4857
+ row: Boolean },
4975
4858
 
4976
- beforeConnect() {
4977
- addClass(this.$el, 'uk-slidenav');
4978
- const icon = this.$props.icon;
4979
- this.icon = hasClass(this.$el, 'uk-slidenav-large') ? icon + "-large" : icon;
4980
- } };
4981
4859
 
4860
+ data: {
4861
+ target: '> *',
4862
+ row: true },
4982
4863
 
4983
- const Search = {
4984
- extends: IconComponent,
4985
4864
 
4986
- beforeConnect() {
4987
- this.icon =
4988
- hasClass(this.$el, 'uk-search-icon') && parents(this.$el, '.uk-search-large').length ?
4989
- 'search-large' :
4990
- parents(this.$el, '.uk-search-navbar').length ?
4991
- 'search-navbar' :
4992
- this.$props.icon;
4993
- } };
4865
+ computed: {
4866
+ elements: {
4867
+ get(_ref, $el) {let { target } = _ref;
4868
+ return $$(target, $el);
4869
+ },
4994
4870
 
4871
+ watch() {
4872
+ this.$reset();
4873
+ } } },
4995
4874
 
4996
- const Close = {
4997
- extends: IconComponent,
4998
4875
 
4999
- beforeConnect() {
5000
- this.icon = "close-" + (hasClass(this.$el, 'uk-close-large') ? 'large' : 'icon');
5001
- } };
5002
4876
 
4877
+ resizeTargets() {
4878
+ return [this.$el, ...this.elements];
4879
+ },
5003
4880
 
5004
- const Spinner = {
5005
- extends: IconComponent,
4881
+ update: {
4882
+ read() {
4883
+ return {
4884
+ rows: (this.row ? getRows(this.elements) : [this.elements]).map(match) };
5006
4885
 
5007
- methods: {
5008
- async getSvg() {
5009
- const icon = await Icon.methods.getSvg.call(this);
4886
+ },
5010
4887
 
5011
- if (this.ratio !== 1) {
5012
- css($('circle', icon), 'strokeWidth', 1 / this.ratio);
4888
+ write(_ref2) {let { rows } = _ref2;
4889
+ for (const { heights, elements } of rows) {
4890
+ elements.forEach((el, i) => css(el, 'minHeight', heights[i]));
5013
4891
  }
4892
+ },
5014
4893
 
5015
- return icon;
5016
- } } };
4894
+ events: ['resize'] } };
5017
4895
 
5018
4896
 
5019
4897
 
5020
- const parsed = {};
5021
- function install$1(UIkit) {
5022
- UIkit.icon.add = (name, svg) => {
5023
- const added = isString(name) ? { [name]: svg } : name;
5024
- each(added, (svg, name) => {
5025
- icons[name] = svg;
5026
- delete parsed[name];
5027
- });
4898
+ function match(elements) {
4899
+ if (elements.length < 2) {
4900
+ return { heights: [''], elements };
4901
+ }
5028
4902
 
5029
- if (UIkit._initialized) {
5030
- apply(document.body, (el) =>
5031
- each(UIkit.getComponents(el), (cmp) => {
5032
- cmp.$options.isIcon && cmp.icon in added && cmp.$reset();
5033
- }));
4903
+ css(elements, 'minHeight', '');
4904
+ let heights = elements.map(getHeight);
4905
+ const max = Math.max(...heights);
4906
+
4907
+ return {
4908
+ heights: elements.map((el, i) => heights[i].toFixed(2) === max.toFixed(2) ? '' : max),
4909
+ elements };
5034
4910
 
5035
- }
5036
- };
5037
4911
  }
5038
4912
 
5039
- function getIcon(icon) {
5040
- if (!icons[icon]) {
5041
- return null;
4913
+ function getHeight(element) {
4914
+ let style = false;
4915
+ if (!isVisible(element)) {
4916
+ style = element.style.display;
4917
+ css(element, 'display', 'block', 'important');
5042
4918
  }
5043
4919
 
5044
- if (!parsed[icon]) {
5045
- parsed[icon] = $((icons[applyRtl(icon)] || icons[icon]).trim());
5046
- }
4920
+ const height = dimensions(element).height - boxModelAdjust(element, 'height', 'content-box');
5047
4921
 
5048
- return parsed[icon].cloneNode(true);
5049
- }
4922
+ if (style !== false) {
4923
+ css(element, 'display', style);
4924
+ }
5050
4925
 
5051
- function applyRtl(icon) {
5052
- return isRtl ? swap(swap(icon, 'left', 'right'), 'previous', 'next') : icon;
4926
+ return height;
5053
4927
  }
5054
4928
 
5055
- const nativeLazyLoad = inBrowser && 'loading' in HTMLImageElement.prototype;
5056
-
5057
- var img = {
5058
- args: 'dataSrc',
4929
+ var heightViewport = {
4930
+ mixins: [Resize],
5059
4931
 
5060
4932
  props: {
5061
- dataSrc: String,
5062
- sources: String,
5063
- offsetTop: String,
5064
- offsetLeft: String,
5065
- target: String,
5066
- loading: String },
4933
+ expand: Boolean,
4934
+ offsetTop: Boolean,
4935
+ offsetBottom: Boolean,
4936
+ minHeight: Number },
5067
4937
 
5068
4938
 
5069
4939
  data: {
5070
- dataSrc: '',
5071
- sources: false,
5072
- offsetTop: '50vh',
5073
- offsetLeft: '50vw',
5074
- target: false,
5075
- loading: 'lazy' },
5076
-
5077
-
5078
- connected() {
5079
- if (this.loading !== 'lazy') {
5080
- this.load();
5081
- return;
5082
- }
4940
+ expand: false,
4941
+ offsetTop: false,
4942
+ offsetBottom: false,
4943
+ minHeight: 0 },
5083
4944
 
5084
- const target = [this.$el, ...queryAll(this.$props.target, this.$el)];
5085
4945
 
5086
- if (nativeLazyLoad && isImg(this.$el)) {
5087
- this.$el.loading = 'lazy';
5088
- setSrcAttrs(this.$el);
4946
+ resizeTargets() {
4947
+ // check for offsetTop change
4948
+ return [this.$el, ...scrollParents(this.$el, /auto|scroll/)];
4949
+ },
5089
4950
 
5090
- if (target.length === 1) {
5091
- return;
4951
+ update: {
4952
+ read(_ref) {let { minHeight: prev } = _ref;
4953
+ if (!isVisible(this.$el)) {
4954
+ return false;
5092
4955
  }
5093
- }
5094
-
5095
- ensureSrcAttribute(this.$el);
5096
4956
 
5097
- this.registerObserver(
5098
- observeIntersection(
5099
- target,
5100
- (entries, observer) => {
5101
- this.load();
5102
- observer.disconnect();
5103
- },
5104
- {
5105
- rootMargin: toPx(this.offsetTop, 'height') + "px " + toPx(
5106
- this.offsetLeft,
5107
- 'width') + "px" }));
4957
+ let minHeight = '';
4958
+ const box = boxModelAdjust(this.$el, 'height', 'content-box');
5108
4959
 
4960
+ const { body, scrollingElement } = document;
4961
+ const [scrollElement] = scrollParents(this.$el, /auto|scroll/);
4962
+ const { height: viewportHeight } = offsetViewport(
4963
+ scrollElement === body ? scrollingElement : scrollElement);
5109
4964
 
5110
4965
 
4966
+ if (this.expand) {
4967
+ minHeight = Math.max(
4968
+ viewportHeight - (
4969
+ dimensions(scrollElement).height - dimensions(this.$el).height) -
4970
+ box,
4971
+ 0);
5111
4972
 
5112
- },
4973
+ } else {
4974
+ const isScrollingElement =
4975
+ scrollingElement === scrollElement || body === scrollElement;
5113
4976
 
5114
- disconnected() {
5115
- if (this._data.image) {
5116
- this._data.image.onload = '';
5117
- }
5118
- },
4977
+ // on mobile devices (iOS and Android) window.innerHeight !== 100vh
4978
+ minHeight = "calc(" + (isScrollingElement ? '100vh' : viewportHeight + "px");
5119
4979
 
5120
- methods: {
5121
- load() {
5122
- if (this._data.image) {
5123
- return this._data.image;
5124
- }
4980
+ if (this.offsetTop) {
4981
+ if (isScrollingElement) {
4982
+ const top = offsetPosition(this.$el)[0] - offsetPosition(scrollElement)[0];
4983
+ minHeight += top > 0 && top < viewportHeight / 2 ? " - " + top + "px" : '';
4984
+ } else {
4985
+ minHeight += " - " + css(scrollElement, 'paddingTop');
4986
+ }
4987
+ }
5125
4988
 
5126
- const image = isImg(this.$el) ?
5127
- this.$el :
5128
- getImageFromElement(this.$el, this.dataSrc, this.sources);
4989
+ if (this.offsetBottom === true) {
4990
+ minHeight += " - " + dimensions(this.$el.nextElementSibling).height + "px";
4991
+ } else if (isNumeric(this.offsetBottom)) {
4992
+ minHeight += " - " + this.offsetBottom + "vh";
4993
+ } else if (this.offsetBottom && endsWith(this.offsetBottom, 'px')) {
4994
+ minHeight += " - " + toFloat(this.offsetBottom) + "px";
4995
+ } else if (isString(this.offsetBottom)) {
4996
+ minHeight += " - " + dimensions(query(this.offsetBottom, this.$el)).height + "px";
4997
+ }
5129
4998
 
5130
- removeAttr(image, 'loading');
5131
- setSrcAttrs(this.$el, image.currentSrc);
5132
- return this._data.image = image;
4999
+ minHeight += (box ? " - " + box + "px" : '') + ")";
5000
+ }
5001
+
5002
+ return { minHeight, prev };
5003
+ },
5004
+
5005
+ write(_ref2) {let { minHeight } = _ref2;
5006
+ css(this.$el, { minHeight });
5007
+
5008
+ if (this.minHeight && toFloat(css(this.$el, 'minHeight')) < this.minHeight) {
5009
+ css(this.$el, 'minHeight', this.minHeight);
5010
+ }
5011
+ },
5012
+
5013
+ events: ['resize'] } };
5014
+
5015
+ var SVG = {
5016
+ args: 'src',
5017
+
5018
+ props: {
5019
+ id: Boolean,
5020
+ icon: String,
5021
+ src: String,
5022
+ style: String,
5023
+ width: Number,
5024
+ height: Number,
5025
+ ratio: Number,
5026
+ class: String,
5027
+ strokeAnimation: Boolean,
5028
+ focusable: Boolean, // IE 11
5029
+ attributes: 'list' },
5030
+
5031
+
5032
+ data: {
5033
+ ratio: 1,
5034
+ include: ['style', 'class', 'focusable'],
5035
+ class: '',
5036
+ strokeAnimation: false },
5037
+
5038
+
5039
+ beforeConnect() {
5040
+ this.class += ' uk-svg';
5041
+ },
5042
+
5043
+ connected() {
5044
+ if (!this.icon && includes(this.src, '#')) {
5045
+ [this.src, this.icon] = this.src.split('#');
5046
+ }
5047
+
5048
+ this.svg = this.getSvg().then((el) => {
5049
+ if (this._connected) {
5050
+ const svg = insertSVG(el, this.$el);
5051
+
5052
+ if (this.svgEl && svg !== this.svgEl) {
5053
+ remove$1(this.svgEl);
5054
+ }
5055
+
5056
+ this.applyAttributes(svg, el);
5057
+
5058
+ return this.svgEl = svg;
5059
+ }
5060
+ }, noop);
5061
+
5062
+ if (this.strokeAnimation) {
5063
+ this.svg.then((el) => {
5064
+ if (this._connected) {
5065
+ applyAnimation(el);
5066
+ this.registerObserver(
5067
+ observeIntersection(el, (records, observer) => {
5068
+ applyAnimation(el);
5069
+ observer.disconnect();
5070
+ }));
5071
+
5072
+ }
5073
+ });
5074
+ }
5075
+ },
5076
+
5077
+ disconnected() {
5078
+ this.svg.then((svg) => {
5079
+ if (this._connected) {
5080
+ return;
5081
+ }
5082
+
5083
+ if (isVoidElement(this.$el)) {
5084
+ this.$el.hidden = false;
5085
+ }
5086
+
5087
+ remove$1(svg);
5088
+ this.svgEl = null;
5089
+ });
5090
+
5091
+ this.svg = null;
5092
+ },
5093
+
5094
+ methods: {
5095
+ async getSvg() {
5096
+ if (isTag(this.$el, 'img') && !this.$el.complete && this.$el.loading === 'lazy') {
5097
+ return new Promise((resolve) =>
5098
+ once(this.$el, 'load', () => resolve(this.getSvg())));
5099
+
5100
+ }
5101
+
5102
+ return parseSVG(await loadSVG(this.src), this.icon) || Promise.reject('SVG not found.');
5103
+ },
5104
+
5105
+ applyAttributes(el, ref) {
5106
+ for (const prop in this.$options.props) {
5107
+ if (includes(this.include, prop) && prop in this) {
5108
+ attr(el, prop, this[prop]);
5109
+ }
5110
+ }
5111
+
5112
+ for (const attribute in this.attributes) {
5113
+ const [prop, value] = this.attributes[attribute].split(':', 2);
5114
+ attr(el, prop, value);
5115
+ }
5116
+
5117
+ if (!this.id) {
5118
+ removeAttr(el, 'id');
5119
+ }
5120
+
5121
+ const props = ['width', 'height'];
5122
+ let dimensions = props.map((prop) => this[prop]);
5123
+
5124
+ if (!dimensions.some((val) => val)) {
5125
+ dimensions = props.map((prop) => attr(ref, prop));
5126
+ }
5127
+
5128
+ const viewBox = attr(ref, 'viewBox');
5129
+ if (viewBox && !dimensions.some((val) => val)) {
5130
+ dimensions = viewBox.split(' ').slice(2);
5131
+ }
5132
+
5133
+ dimensions.forEach((val, i) => attr(el, props[i], toFloat(val) * this.ratio || null));
5133
5134
  } } };
5134
5135
 
5135
5136
 
5136
5137
 
5137
- function setSrcAttrs(el, src) {
5138
- if (isImg(el)) {
5139
- const parentNode = parent(el);
5140
- const elements = isPicture(parentNode) ? children(parentNode) : [el];
5141
- elements.forEach((el) => setSourceProps(el, el));
5142
- } else if (src) {
5143
- const change = !includes(el.style.backgroundImage, src);
5144
- if (change) {
5145
- css(el, 'backgroundImage', "url(" + escape(src) + ")");
5146
- trigger(el, createEvent('load', false));
5138
+ const loadSVG = memoize(async (src) => {
5139
+ if (src) {
5140
+ if (startsWith(src, 'data:')) {
5141
+ return decodeURIComponent(src.split(',')[1]);
5142
+ } else {
5143
+ return (await fetch(src)).text();
5147
5144
  }
5145
+ } else {
5146
+ return Promise.reject();
5148
5147
  }
5149
- }
5148
+ });
5150
5149
 
5151
- const srcProps = ['data-src', 'data-srcset', 'sizes'];
5152
- function setSourceProps(sourceEl, targetEl) {
5153
- srcProps.forEach((prop) => {
5154
- const value = data(sourceEl, prop);
5155
- if (value) {
5156
- attr(targetEl, prop.replace(/^(data-)+/, ''), value);
5157
- }
5158
- });
5150
+ function parseSVG(svg, icon) {var _svg;
5151
+ if (icon && includes(svg, '<symbol')) {
5152
+ svg = parseSymbols(svg, icon) || svg;
5153
+ }
5154
+
5155
+ svg = $(svg.substr(svg.indexOf('<svg')));
5156
+ return ((_svg = svg) == null ? void 0 : _svg.hasChildNodes()) && svg;
5159
5157
  }
5160
5158
 
5161
- function getImageFromElement(el, src, sources) {
5162
- const img = new Image();
5159
+ const symbolRe = /<symbol([^]*?id=(['"])(.+?)\2[^]*?<\/)symbol>/g;
5160
+ const symbols = {};
5163
5161
 
5164
- wrapInPicture(img, sources);
5165
- setSourceProps(el, img);
5166
- img.onload = () => {
5167
- setSrcAttrs(el, img.currentSrc);
5168
- };
5169
- attr(img, 'src', src);
5170
- return img;
5171
- }
5162
+ function parseSymbols(svg, icon) {
5163
+ if (!symbols[svg]) {
5164
+ symbols[svg] = {};
5172
5165
 
5173
- function wrapInPicture(img, sources) {
5174
- sources = parseSources(sources);
5166
+ symbolRe.lastIndex = 0;
5175
5167
 
5176
- if (sources.length) {
5177
- const picture = fragment('<picture>');
5178
- for (const attrs of sources) {
5179
- const source = fragment('<source>');
5180
- attr(source, attrs);
5181
- append(picture, source);
5168
+ let match;
5169
+ while (match = symbolRe.exec(svg)) {
5170
+ symbols[svg][match[3]] = "<svg xmlns=\"http://www.w3.org/2000/svg\"" + match[1] + "svg>";
5182
5171
  }
5183
- append(picture, img);
5184
5172
  }
5173
+
5174
+ return symbols[svg][icon];
5185
5175
  }
5186
5176
 
5187
- function parseSources(sources) {
5188
- if (!sources) {
5189
- return [];
5177
+ function applyAnimation(el) {
5178
+ const length = getMaxPathLength(el);
5179
+
5180
+ if (length) {
5181
+ el.style.setProperty('--uk-animation-stroke', length);
5190
5182
  }
5183
+ }
5191
5184
 
5192
- if (startsWith(sources, '[')) {
5185
+ function getMaxPathLength(el) {
5186
+ return Math.ceil(
5187
+ Math.max(
5188
+ 0,
5189
+ ...$$('[stroke]', el).map((stroke) => {
5193
5190
  try {
5194
- sources = JSON.parse(sources);
5191
+ return stroke.getTotalLength();
5195
5192
  } catch (e) {
5196
- sources = [];
5193
+ return 0;
5197
5194
  }
5198
- } else {
5199
- sources = parseOptions(sources);
5200
- }
5195
+ })));
5201
5196
 
5202
- if (!isArray(sources)) {
5203
- sources = [sources];
5204
- }
5205
5197
 
5206
- return sources.filter((source) => !isEmpty(source));
5207
5198
  }
5208
5199
 
5209
- function ensureSrcAttribute(el) {
5210
- if (isImg(el) && !hasAttr(el, 'src')) {
5211
- attr(el, 'src', 'data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg"></svg>');
5200
+ function insertSVG(el, root) {
5201
+ if (isVoidElement(root) || isTag(root, 'canvas')) {
5202
+ root.hidden = true;
5203
+
5204
+ const next = root.nextElementSibling;
5205
+ return equals(el, next) ? next : after(root, el);
5212
5206
  }
5207
+
5208
+ const last = root.lastElementChild;
5209
+ return equals(el, last) ? last : append(root, el);
5213
5210
  }
5214
5211
 
5215
- function isPicture(el) {
5216
- return isTag(el, 'picture');
5212
+ function equals(el, other) {
5213
+ return isTag(el, 'svg') && isTag(other, 'svg') && innerHTML(el) === innerHTML(other);
5217
5214
  }
5218
5215
 
5219
- function isImg(el) {
5220
- return isTag(el, 'img');
5216
+ function innerHTML(el) {
5217
+ return (
5218
+ el.innerHTML ||
5219
+ new XMLSerializer().serializeToString(el).replace(/<svg.*?>(.*?)<\/svg>/g, '$1')).
5220
+ replace(/\s/g, '');
5221
5221
  }
5222
5222
 
5223
- var Media = {
5224
- props: {
5225
- media: Boolean },
5223
+ 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>";
5224
+
5225
+ 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>";
5226
+
5227
+ 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>";
5228
+
5229
+ 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>";
5230
+
5231
+ 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>";
5232
+
5233
+ 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>";
5234
+
5235
+ 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>";
5236
+
5237
+ 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>";
5238
+
5239
+ 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>";
5240
+
5241
+ 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>";
5242
+
5243
+ 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>";
5244
+
5245
+ 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>";
5246
+
5247
+ 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>";
5248
+
5249
+ 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>";
5250
+
5251
+ 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>";
5252
+
5253
+ 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>";
5226
5254
 
5255
+ 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>";
5256
+
5257
+ 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>";
5258
+
5259
+ 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>";
5260
+
5261
+ const icons = {
5262
+ spinner,
5263
+ totop,
5264
+ marker,
5265
+ 'close-icon': closeIcon,
5266
+ 'close-large': closeLarge,
5267
+ 'nav-parent-icon': navParentIcon,
5268
+ 'nav-parent-icon-large': navParentIconLarge,
5269
+ 'navbar-parent-icon': navbarParentIcon,
5270
+ 'navbar-toggle-icon': navbarToggleIcon,
5271
+ 'overlay-icon': overlayIcon,
5272
+ 'pagination-next': paginationNext,
5273
+ 'pagination-previous': paginationPrevious,
5274
+ 'search-icon': searchIcon,
5275
+ 'search-large': searchLarge,
5276
+ 'search-navbar': searchNavbar,
5277
+ 'slidenav-next': slidenavNext,
5278
+ 'slidenav-next-large': slidenavNextLarge,
5279
+ 'slidenav-previous': slidenavPrevious,
5280
+ 'slidenav-previous-large': slidenavPreviousLarge };
5281
+
5282
+
5283
+ const Icon = {
5284
+ install: install$1,
5285
+
5286
+ extends: SVG,
5287
+
5288
+ args: 'icon',
5289
+
5290
+ props: ['icon'],
5227
5291
 
5228
5292
  data: {
5229
- media: false },
5293
+ include: ['focusable'] },
5230
5294
 
5231
5295
 
5232
- connected() {
5233
- const media = toMedia(this.media);
5234
- this.matchMedia = true;
5235
- if (media) {
5236
- this.mediaObj = window.matchMedia(media);
5237
- const handler = () => {
5238
- this.matchMedia = this.mediaObj.matches;
5239
- trigger(this.$el, createEvent('mediachange', false, true, [this.mediaObj]));
5240
- };
5241
- this.offMediaObj = on(this.mediaObj, 'change', () => {
5242
- handler();
5243
- this.$emit('resize');
5244
- });
5245
- handler();
5246
- }
5296
+ isIcon: true,
5297
+
5298
+ beforeConnect() {
5299
+ addClass(this.$el, 'uk-icon');
5247
5300
  },
5248
5301
 
5249
- disconnected() {var _this$offMediaObj;
5250
- (_this$offMediaObj = this.offMediaObj) == null ? void 0 : _this$offMediaObj.call(this);
5302
+ methods: {
5303
+ async getSvg() {
5304
+ const icon = getIcon(this.icon);
5305
+
5306
+ if (!icon) {
5307
+ throw 'Icon not found.';
5308
+ }
5309
+
5310
+ return icon;
5311
+ } } };
5312
+
5313
+ const IconComponent = {
5314
+ args: false,
5315
+
5316
+ extends: Icon,
5317
+
5318
+ data: (vm) => ({
5319
+ icon: hyphenate(vm.constructor.options.name) }),
5320
+
5321
+
5322
+ beforeConnect() {
5323
+ addClass(this.$el, this.$name);
5251
5324
  } };
5252
5325
 
5253
5326
 
5254
- function toMedia(value) {
5255
- if (isString(value)) {
5256
- if (startsWith(value, '@')) {
5257
- const name = "breakpoint-" + value.substr(1);
5258
- value = toFloat(getCssVar(name));
5259
- } else if (isNaN(value)) {
5260
- return value;
5261
- }
5262
- }
5327
+ const NavParentIcon = {
5328
+ extends: IconComponent,
5263
5329
 
5264
- return value && isNumeric(value) ? "(min-width: " + value + "px)" : '';
5265
- }
5330
+ beforeConnect() {
5331
+ const icon = this.$props.icon;
5332
+ this.icon = closest(this.$el, '.uk-nav-primary') ? icon + "-large" : icon;
5333
+ } };
5266
5334
 
5267
- var leader = {
5268
- mixins: [Class, Media, Resize],
5269
5335
 
5270
- props: {
5271
- fill: String },
5336
+ const Slidenav = {
5337
+ extends: IconComponent,
5338
+
5339
+ beforeConnect() {
5340
+ addClass(this.$el, 'uk-slidenav');
5341
+ const icon = this.$props.icon;
5342
+ this.icon = hasClass(this.$el, 'uk-slidenav-large') ? icon + "-large" : icon;
5343
+ } };
5272
5344
 
5273
5345
 
5274
- data: {
5275
- fill: '',
5276
- clsWrapper: 'uk-leader-fill',
5277
- clsHide: 'uk-leader-hide',
5278
- attrFill: 'data-fill' },
5346
+ const Search = {
5347
+ extends: IconComponent,
5279
5348
 
5349
+ beforeConnect() {
5350
+ this.icon =
5351
+ hasClass(this.$el, 'uk-search-icon') && parents(this.$el, '.uk-search-large').length ?
5352
+ 'search-large' :
5353
+ parents(this.$el, '.uk-search-navbar').length ?
5354
+ 'search-navbar' :
5355
+ this.$props.icon;
5356
+ } };
5280
5357
 
5281
- computed: {
5282
- fill(_ref) {let { fill } = _ref;
5283
- return fill || getCssVar('leader-fill-content');
5284
- } },
5285
5358
 
5359
+ const Close = {
5360
+ extends: IconComponent,
5286
5361
 
5287
- connected() {
5288
- [this.wrapper] = wrapInner(this.$el, "<span class=\"" + this.clsWrapper + "\">");
5289
- },
5362
+ beforeConnect() {
5363
+ this.icon = "close-" + (hasClass(this.$el, 'uk-close-large') ? 'large' : 'icon');
5364
+ } };
5290
5365
 
5291
- disconnected() {
5292
- unwrap(this.wrapper.childNodes);
5293
- },
5294
5366
 
5295
- update: {
5296
- read() {
5297
- const width = Math.trunc(this.$el.offsetWidth / 2);
5367
+ const Spinner = {
5368
+ extends: IconComponent,
5298
5369
 
5299
- return {
5300
- width,
5301
- fill: this.fill,
5302
- hide: !this.matchMedia };
5370
+ methods: {
5371
+ async getSvg() {
5372
+ const icon = await Icon.methods.getSvg.call(this);
5303
5373
 
5304
- },
5374
+ if (this.ratio !== 1) {
5375
+ css($('circle', icon), 'strokeWidth', 1 / this.ratio);
5376
+ }
5305
5377
 
5306
- write(_ref2) {let { width, fill, hide } = _ref2;
5307
- toggleClass(this.wrapper, this.clsHide, hide);
5308
- attr(this.wrapper, this.attrFill, new Array(width).join(fill));
5309
- },
5378
+ return icon;
5379
+ } } };
5310
5380
 
5311
- events: ['resize'] } };
5312
5381
 
5313
- const active = [];
5314
5382
 
5315
- var Modal = {
5316
- mixins: [Class, Container, Togglable],
5383
+ const parsed = {};
5384
+ function install$1(UIkit) {
5385
+ UIkit.icon.add = (name, svg) => {
5386
+ const added = isString(name) ? { [name]: svg } : name;
5387
+ each(added, (svg, name) => {
5388
+ icons[name] = svg;
5389
+ delete parsed[name];
5390
+ });
5317
5391
 
5318
- props: {
5319
- selPanel: String,
5320
- selClose: String,
5321
- escClose: Boolean,
5322
- bgClose: Boolean,
5323
- stack: Boolean },
5392
+ if (UIkit._initialized) {
5393
+ apply(document.body, (el) =>
5394
+ each(UIkit.getComponents(el), (cmp) => {
5395
+ cmp.$options.isIcon && cmp.icon in added && cmp.$reset();
5396
+ }));
5324
5397
 
5398
+ }
5399
+ };
5400
+ }
5325
5401
 
5326
- data: {
5327
- cls: 'uk-open',
5328
- escClose: true,
5329
- bgClose: true,
5330
- overlay: true,
5331
- stack: false },
5402
+ function getIcon(icon) {
5403
+ if (!icons[icon]) {
5404
+ return null;
5405
+ }
5332
5406
 
5407
+ if (!parsed[icon]) {
5408
+ parsed[icon] = $((icons[applyRtl(icon)] || icons[icon]).trim());
5409
+ }
5333
5410
 
5334
- computed: {
5335
- panel(_ref, $el) {let { selPanel } = _ref;
5336
- return $(selPanel, $el);
5337
- },
5411
+ return parsed[icon].cloneNode(true);
5412
+ }
5338
5413
 
5339
- transitionElement() {
5340
- return this.panel;
5341
- },
5414
+ function applyRtl(icon) {
5415
+ return isRtl ? swap(swap(icon, 'left', 'right'), 'previous', 'next') : icon;
5416
+ }
5342
5417
 
5343
- bgClose(_ref2) {let { bgClose } = _ref2;
5344
- return bgClose && this.panel;
5345
- } },
5418
+ const nativeLazyLoad = inBrowser && 'loading' in HTMLImageElement.prototype;
5346
5419
 
5420
+ var img = {
5421
+ args: 'dataSrc',
5347
5422
 
5348
- beforeDisconnect() {
5349
- if (includes(active, this)) {
5350
- this.toggleElement(this.$el, false, false);
5351
- }
5352
- },
5423
+ props: {
5424
+ dataSrc: String,
5425
+ sources: String,
5426
+ offsetTop: String,
5427
+ offsetLeft: String,
5428
+ target: String,
5429
+ loading: String },
5353
5430
 
5354
- events: [
5355
- {
5356
- name: 'click',
5357
5431
 
5358
- delegate() {
5359
- return this.selClose;
5360
- },
5432
+ data: {
5433
+ dataSrc: '',
5434
+ sources: false,
5435
+ offsetTop: '50vh',
5436
+ offsetLeft: '50vw',
5437
+ target: false,
5438
+ loading: 'lazy' },
5361
5439
 
5362
- handler(e) {
5363
- e.preventDefault();
5364
- this.hide();
5365
- } },
5366
5440
 
5441
+ connected() {
5442
+ if (this.loading !== 'lazy') {
5443
+ this.load();
5444
+ return;
5445
+ }
5367
5446
 
5368
- {
5369
- name: 'toggle',
5447
+ const target = [this.$el, ...queryAll(this.$props.target, this.$el)];
5370
5448
 
5371
- self: true,
5449
+ if (nativeLazyLoad && isImg(this.$el)) {
5450
+ this.$el.loading = 'lazy';
5451
+ setSrcAttrs(this.$el);
5372
5452
 
5373
- handler(e) {
5374
- if (e.defaultPrevented) {
5453
+ if (target.length === 1) {
5375
5454
  return;
5376
5455
  }
5456
+ }
5377
5457
 
5378
- e.preventDefault();
5458
+ ensureSrcAttribute(this.$el);
5379
5459
 
5380
- if (this.isToggled() === includes(active, this)) {
5381
- this.toggle();
5382
- }
5383
- } },
5460
+ this.registerObserver(
5461
+ observeIntersection(
5462
+ target,
5463
+ (entries, observer) => {
5464
+ this.load();
5465
+ observer.disconnect();
5466
+ },
5467
+ {
5468
+ rootMargin: toPx(this.offsetTop, 'height') + "px " + toPx(
5469
+ this.offsetLeft,
5470
+ 'width') + "px" }));
5384
5471
 
5385
5472
 
5386
- {
5387
- name: 'beforeshow',
5388
5473
 
5389
- self: true,
5390
5474
 
5391
- handler(e) {
5392
- if (includes(active, this)) {
5393
- return false;
5394
- }
5475
+ },
5395
5476
 
5396
- if (!this.stack && active.length) {
5397
- Promise.all(active.map((modal) => modal.hide())).then(this.show);
5398
- e.preventDefault();
5399
- } else {
5400
- active.push(this);
5401
- }
5402
- } },
5477
+ disconnected() {
5478
+ if (this._data.image) {
5479
+ this._data.image.onload = '';
5480
+ }
5481
+ },
5403
5482
 
5483
+ methods: {
5484
+ load() {
5485
+ if (this._data.image) {
5486
+ return this._data.image;
5487
+ }
5404
5488
 
5405
- {
5406
- name: 'show',
5489
+ const image = isImg(this.$el) ?
5490
+ this.$el :
5491
+ getImageFromElement(this.$el, this.dataSrc, this.sources);
5407
5492
 
5408
- self: true,
5493
+ removeAttr(image, 'loading');
5494
+ setSrcAttrs(this.$el, image.currentSrc);
5495
+ return this._data.image = image;
5496
+ } } };
5409
5497
 
5410
- handler() {
5411
- const docEl = document.documentElement;
5412
5498
 
5413
- if (width(window) > docEl.clientWidth && this.overlay) {
5414
- css(document.body, 'overflowY', 'scroll');
5415
- }
5416
5499
 
5417
- if (this.stack) {
5418
- css(this.$el, 'zIndex', toFloat(css(this.$el, 'zIndex')) + active.length);
5419
- }
5500
+ function setSrcAttrs(el, src) {
5501
+ if (isImg(el)) {
5502
+ const parentNode = parent(el);
5503
+ const elements = isPicture(parentNode) ? children(parentNode) : [el];
5504
+ elements.forEach((el) => setSourceProps(el, el));
5505
+ } else if (src) {
5506
+ const change = !includes(el.style.backgroundImage, src);
5507
+ if (change) {
5508
+ css(el, 'backgroundImage', "url(" + escape(src) + ")");
5509
+ trigger(el, createEvent('load', false));
5510
+ }
5511
+ }
5512
+ }
5420
5513
 
5421
- addClass(docEl, this.clsPage);
5514
+ const srcProps = ['data-src', 'data-srcset', 'sizes'];
5515
+ function setSourceProps(sourceEl, targetEl) {
5516
+ srcProps.forEach((prop) => {
5517
+ const value = data(sourceEl, prop);
5518
+ if (value) {
5519
+ attr(targetEl, prop.replace(/^(data-)+/, ''), value);
5520
+ }
5521
+ });
5522
+ }
5422
5523
 
5423
- if (this.bgClose) {
5424
- once(
5425
- this.$el,
5426
- 'hide',
5427
- on(document, pointerDown, (_ref3) => {let { target } = _ref3;
5428
- if (
5429
- last(active) !== this ||
5430
- this.overlay && !within(target, this.$el) ||
5431
- within(target, this.panel))
5432
- {
5433
- return;
5434
- }
5524
+ function getImageFromElement(el, src, sources) {
5525
+ const img = new Image();
5435
5526
 
5436
- once(
5437
- document,
5438
- pointerUp + " " + pointerCancel + " scroll",
5439
- (_ref4) => {let { defaultPrevented, type, target: newTarget } = _ref4;
5440
- if (
5441
- !defaultPrevented &&
5442
- type === pointerUp &&
5443
- target === newTarget)
5444
- {
5445
- this.hide();
5446
- }
5447
- },
5448
- true);
5527
+ wrapInPicture(img, sources);
5528
+ setSourceProps(el, img);
5529
+ img.onload = () => {
5530
+ setSrcAttrs(el, img.currentSrc);
5531
+ };
5532
+ attr(img, 'src', src);
5533
+ return img;
5534
+ }
5449
5535
 
5450
- }),
5451
- { self: true });
5536
+ function wrapInPicture(img, sources) {
5537
+ sources = parseSources(sources);
5452
5538
 
5453
- }
5539
+ if (sources.length) {
5540
+ const picture = fragment('<picture>');
5541
+ for (const attrs of sources) {
5542
+ const source = fragment('<source>');
5543
+ attr(source, attrs);
5544
+ append(picture, source);
5545
+ }
5546
+ append(picture, img);
5547
+ }
5548
+ }
5454
5549
 
5455
- if (this.escClose) {
5456
- once(
5457
- this.$el,
5458
- 'hide',
5459
- on(document, 'keydown', (e) => {
5460
- if (e.keyCode === 27 && last(active) === this) {
5461
- this.hide();
5462
- }
5463
- }),
5464
- { self: true });
5550
+ function parseSources(sources) {
5551
+ if (!sources) {
5552
+ return [];
5553
+ }
5465
5554
 
5466
- }
5467
- } },
5555
+ if (startsWith(sources, '[')) {
5556
+ try {
5557
+ sources = JSON.parse(sources);
5558
+ } catch (e) {
5559
+ sources = [];
5560
+ }
5561
+ } else {
5562
+ sources = parseOptions(sources);
5563
+ }
5468
5564
 
5565
+ if (!isArray(sources)) {
5566
+ sources = [sources];
5567
+ }
5469
5568
 
5470
- {
5471
- name: 'shown',
5569
+ return sources.filter((source) => !isEmpty(source));
5570
+ }
5472
5571
 
5473
- self: true,
5572
+ function ensureSrcAttribute(el) {
5573
+ if (isImg(el) && !hasAttr(el, 'src')) {
5574
+ attr(el, 'src', 'data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg"></svg>');
5575
+ }
5576
+ }
5474
5577
 
5475
- handler() {
5476
- if (!isFocusable(this.$el)) {
5477
- attr(this.$el, 'tabindex', '-1');
5478
- }
5578
+ function isPicture(el) {
5579
+ return isTag(el, 'picture');
5580
+ }
5479
5581
 
5480
- if (!$(':focus', this.$el)) {
5481
- this.$el.focus();
5482
- }
5483
- } },
5582
+ function isImg(el) {
5583
+ return isTag(el, 'img');
5584
+ }
5484
5585
 
5586
+ var Media = {
5587
+ props: {
5588
+ media: Boolean },
5485
5589
 
5486
- {
5487
- name: 'hidden',
5488
5590
 
5489
- self: true,
5591
+ data: {
5592
+ media: false },
5490
5593
 
5491
- handler() {
5492
- if (includes(active, this)) {
5493
- active.splice(active.indexOf(this), 1);
5494
- }
5495
5594
 
5496
- if (!active.length) {
5497
- css(document.body, 'overflowY', '');
5498
- }
5595
+ connected() {
5596
+ const media = toMedia(this.media, this.$el);
5597
+ this.matchMedia = true;
5598
+ if (media) {
5599
+ this.mediaObj = window.matchMedia(media);
5600
+ const handler = () => {
5601
+ this.matchMedia = this.mediaObj.matches;
5602
+ trigger(this.$el, createEvent('mediachange', false, true, [this.mediaObj]));
5603
+ };
5604
+ this.offMediaObj = on(this.mediaObj, 'change', () => {
5605
+ handler();
5606
+ this.$emit('resize');
5607
+ });
5608
+ handler();
5609
+ }
5610
+ },
5499
5611
 
5500
- css(this.$el, 'zIndex', '');
5612
+ disconnected() {var _this$offMediaObj;
5613
+ (_this$offMediaObj = this.offMediaObj) == null ? void 0 : _this$offMediaObj.call(this);
5614
+ } };
5501
5615
 
5502
- if (!active.some((modal) => modal.clsPage === this.clsPage)) {
5503
- removeClass(document.documentElement, this.clsPage);
5504
- }
5505
- } }],
5506
5616
 
5617
+ function toMedia(value, element) {
5618
+ if (isString(value)) {
5619
+ if (startsWith(value, '@')) {
5620
+ value = toFloat(css(element, "--uk-breakpoint-" + value.substr(1)));
5621
+ } else if (isNaN(value)) {
5622
+ return value;
5623
+ }
5624
+ }
5507
5625
 
5626
+ return value && isNumeric(value) ? "(min-width: " + value + "px)" : '';
5627
+ }
5508
5628
 
5509
- methods: {
5510
- toggle() {
5511
- return this.isToggled() ? this.hide() : this.show();
5512
- },
5629
+ var leader = {
5630
+ mixins: [Class, Media, Resize],
5513
5631
 
5514
- show() {
5515
- if (this.container && parent(this.$el) !== this.container) {
5516
- append(this.container, this.$el);
5517
- return new Promise((resolve) =>
5518
- requestAnimationFrame(() => this.show().then(resolve)));
5632
+ props: {
5633
+ fill: String },
5519
5634
 
5520
- }
5521
5635
 
5522
- return this.toggleElement(this.$el, true, animate(this));
5523
- },
5636
+ data: {
5637
+ fill: '',
5638
+ clsWrapper: 'uk-leader-fill',
5639
+ clsHide: 'uk-leader-hide',
5640
+ attrFill: 'data-fill' },
5524
5641
 
5525
- hide() {
5526
- return this.toggleElement(this.$el, false, animate(this));
5527
- } } };
5528
5642
 
5643
+ computed: {
5644
+ fill(_ref) {let { fill } = _ref;
5645
+ return fill || css(this.$el, '--uk-leader-fill-content');
5646
+ } },
5529
5647
 
5530
5648
 
5531
- function animate(_ref5) {let { transitionElement, _toggle } = _ref5;
5532
- return (el, show) =>
5533
- new Promise((resolve, reject) =>
5534
- once(el, 'show hide', () => {
5535
- el._reject == null ? void 0 : el._reject();
5536
- el._reject = reject;
5649
+ connected() {
5650
+ [this.wrapper] = wrapInner(this.$el, "<span class=\"" + this.clsWrapper + "\">");
5651
+ },
5537
5652
 
5538
- _toggle(el, show);
5653
+ disconnected() {
5654
+ unwrap(this.wrapper.childNodes);
5655
+ },
5539
5656
 
5540
- const off = once(
5541
- transitionElement,
5542
- 'transitionstart',
5543
- () => {
5544
- once(transitionElement, 'transitionend transitioncancel', resolve, {
5545
- self: true });
5657
+ update: {
5658
+ read() {
5659
+ const width = Math.trunc(this.$el.offsetWidth / 2);
5546
5660
 
5547
- clearTimeout(timer);
5548
- },
5549
- { self: true });
5661
+ return {
5662
+ width,
5663
+ fill: this.fill,
5664
+ hide: !this.matchMedia };
5550
5665
 
5666
+ },
5551
5667
 
5552
- const timer = setTimeout(() => {
5553
- off();
5554
- resolve();
5555
- }, toMs(css(transitionElement, 'transitionDuration')));
5556
- })).
5557
- then(() => delete el._reject);
5558
- }
5668
+ write(_ref2) {let { width, fill, hide } = _ref2;
5669
+ toggleClass(this.wrapper, this.clsHide, hide);
5670
+ attr(this.wrapper, this.attrFill, new Array(width).join(fill));
5671
+ },
5559
5672
 
5560
- function toMs(time) {
5561
- return time ? endsWith(time, 'ms') ? toFloat(time) : toFloat(time) * 1000 : 0;
5562
- }
5673
+ events: ['resize'] } };
5563
5674
 
5564
5675
  var modal = {
5565
5676
  install,
@@ -5723,7 +5834,7 @@
5723
5834
  align: String,
5724
5835
  offset: Number,
5725
5836
  boundary: Boolean,
5726
- boundaryAlign: Boolean,
5837
+ target: Boolean,
5727
5838
  clsDrop: String,
5728
5839
  delayShow: Number,
5729
5840
  delayHide: Number,
@@ -5740,9 +5851,12 @@
5740
5851
  offset: undefined,
5741
5852
  delayShow: undefined,
5742
5853
  delayHide: undefined,
5743
- boundaryAlign: undefined,
5744
- flip: 'x',
5854
+ flip: false,
5855
+ shift: true,
5745
5856
  boundary: true,
5857
+ target: false,
5858
+ targetX: false,
5859
+ targetY: false,
5746
5860
  dropbar: false,
5747
5861
  dropbarAnchor: false,
5748
5862
  duration: 200,
@@ -5777,7 +5891,7 @@
5777
5891
  },
5778
5892
 
5779
5893
  watch(dropbar) {
5780
- addClass(dropbar, 'uk-navbar-dropbar');
5894
+ addClass(dropbar, 'uk-dropbar', 'uk-dropbar-top', 'uk-navbar-dropbar');
5781
5895
  },
5782
5896
 
5783
5897
  immediate: true },
@@ -5793,7 +5907,7 @@
5793
5907
 
5794
5908
  if (this.dropContainer !== $el) {
5795
5909
  for (const el of $$("." + clsDrop, this.dropContainer)) {var _this$getDropdown;
5796
- const target = (_this$getDropdown = this.getDropdown(el)) == null ? void 0 : _this$getDropdown.target;
5910
+ const target = (_this$getDropdown = this.getDropdown(el)) == null ? void 0 : _this$getDropdown.targetEl;
5797
5911
  if (!includes(dropdowns, el) && target && within(target, this.$el)) {
5798
5912
  dropdowns.push(el);
5799
5913
  }
@@ -5810,8 +5924,7 @@
5810
5924
  {
5811
5925
  ...this.$props,
5812
5926
  boundary: this.boundary,
5813
- pos: this.pos,
5814
- offset: this.dropbar || this.offset });
5927
+ pos: this.pos });
5815
5928
 
5816
5929
 
5817
5930
  },
@@ -5856,8 +5969,8 @@
5856
5969
  if (
5857
5970
  active &&
5858
5971
  includes(active.mode, 'hover') &&
5859
- active.target &&
5860
- !within(active.target, current) &&
5972
+ active.targetEl &&
5973
+ !within(active.targetEl, current) &&
5861
5974
  !active.isDelaying)
5862
5975
  {
5863
5976
  active.hide(false);
@@ -5879,7 +5992,7 @@
5879
5992
  if (keyCode === keyMap.DOWN && hasAttr(current, 'aria-expanded')) {
5880
5993
  e.preventDefault();
5881
5994
 
5882
- if (!active || active.target !== current) {
5995
+ if (!active || active.targetEl !== current) {
5883
5996
  current.click();
5884
5997
  once(this.dropContainer, 'show', (_ref8) => {let { target } = _ref8;return (
5885
5998
  focusFirstFocusableElement(target));});
@@ -5929,8 +6042,8 @@
5929
6042
  }
5930
6043
  }
5931
6044
 
5932
- if (keyCode === keyMap.ESC) {var _active$target;
5933
- active == null ? void 0 : (_active$target = active.target) == null ? void 0 : _active$target.focus();
6045
+ if (keyCode === keyMap.ESC) {var _active$targetEl;
6046
+ active == null ? void 0 : (_active$targetEl = active.targetEl) == null ? void 0 : _active$targetEl.focus();
5934
6047
  }
5935
6048
 
5936
6049
  handleNavItemNavigation(e, this.toggles, active);
@@ -5972,8 +6085,8 @@
5972
6085
  return this.dropbar;
5973
6086
  },
5974
6087
 
5975
- handler(_, _ref9) {let { $el, align } = _ref9;
5976
- if (!hasClass($el, this.clsDrop) || align === 'stretch') {
6088
+ handler(_ref9) {let { target } = _ref9;
6089
+ if (!this.isDropbarDrop(target)) {
5977
6090
  return;
5978
6091
  }
5979
6092
 
@@ -5981,7 +6094,7 @@
5981
6094
  after(this.dropbarAnchor || this.$el, this.dropbar);
5982
6095
  }
5983
6096
 
5984
- addClass($el, this.clsDrop + "-dropbar");
6097
+ addClass(target, this.clsDrop + "-dropbar");
5985
6098
  } },
5986
6099
 
5987
6100
 
@@ -5996,19 +6109,24 @@
5996
6109
  return this.dropbar;
5997
6110
  },
5998
6111
 
5999
- handler(_, _ref10) {let { $el, align } = _ref10;
6000
- if (!hasClass($el, this.clsDrop) || align === 'stretch') {
6112
+ handler(_ref10) {let { target } = _ref10;
6113
+ if (!this.isDropbarDrop(target)) {
6001
6114
  return;
6002
6115
  }
6003
6116
 
6004
- this._observer = observeResize($el, () =>
6005
- this.transitionTo(
6006
- offset($el).bottom -
6007
- offset(this.dropbar).top +
6008
- toFloat(css($el, 'marginBottom')),
6009
- $el));
6010
-
6117
+ this._observer = observeResize(target, () => {
6118
+ const targetOffsets = parents(target, "." + this.clsDrop).
6119
+ concat(target).
6120
+ map((el) => offset(el));
6121
+ const minTop = Math.min(...targetOffsets.map((_ref11) => {let { top } = _ref11;return top;}));
6122
+ const maxBottom = Math.max(...targetOffsets.map((_ref12) => {let { bottom } = _ref12;return bottom;}));
6123
+ const dropbarOffset = offset(this.dropbar);
6124
+ css(this.dropbar, 'top', this.dropbar.offsetTop - (dropbarOffset.top - minTop));
6125
+ this.transitionTo(
6126
+ maxBottom - minTop + toFloat(css(target, 'marginBottom')),
6127
+ target);
6011
6128
 
6129
+ });
6012
6130
  } },
6013
6131
 
6014
6132
 
@@ -6023,13 +6141,13 @@
6023
6141
  return this.dropbar;
6024
6142
  },
6025
6143
 
6026
- handler(e, _ref11) {let { $el } = _ref11;
6144
+ handler(e) {
6027
6145
  const active = this.getActive();
6028
6146
 
6029
6147
  if (
6030
6148
  matches(this.dropbar, ':hover') &&
6031
- (active == null ? void 0 : active.$el) === $el &&
6032
- !this.toggles.some((el) => active.target !== el && matches(el, ':focus')))
6149
+ (active == null ? void 0 : active.$el) === e.target &&
6150
+ !this.toggles.some((el) => active.targetEl !== el && matches(el, ':focus')))
6033
6151
  {
6034
6152
  e.preventDefault();
6035
6153
  }
@@ -6047,8 +6165,8 @@
6047
6165
  return this.dropbar;
6048
6166
  },
6049
6167
 
6050
- handler(_, _ref12) {let { $el, align } = _ref12;
6051
- if (!hasClass($el, this.clsDrop) || align === 'stretch') {
6168
+ handler(_ref13) {let { target } = _ref13;
6169
+ if (!this.isDropbarDrop(target)) {
6052
6170
  return;
6053
6171
  }
6054
6172
 
@@ -6056,7 +6174,7 @@
6056
6174
 
6057
6175
  const active = this.getActive();
6058
6176
 
6059
- if (!active || (active == null ? void 0 : active.$el) === $el) {
6177
+ if (!active || (active == null ? void 0 : active.$el) === target) {
6060
6178
  this.transitionTo(0);
6061
6179
  }
6062
6180
  } }],
@@ -6065,7 +6183,7 @@
6065
6183
 
6066
6184
  methods: {
6067
6185
  getActive() {
6068
- return active$1 && within(active$1.target, this.$el) && active$1;
6186
+ return active && within(active.targetEl, this.$el) && active;
6069
6187
  },
6070
6188
 
6071
6189
  transitionTo(newHeight, el) {
@@ -6095,13 +6213,17 @@
6095
6213
 
6096
6214
  getDropdown(el) {
6097
6215
  return this.$getComponent(el, 'drop') || this.$getComponent(el, 'dropdown');
6216
+ },
6217
+
6218
+ isDropbarDrop(el) {
6219
+ return this.getDropdown(el) && hasClass(el, this.clsDrop);
6098
6220
  } } };
6099
6221
 
6100
6222
 
6101
6223
 
6102
6224
  function handleNavItemNavigation(e, toggles, active) {
6103
6225
  const { current, keyCode } = e;
6104
- const target = (active == null ? void 0 : active.target) || current;
6226
+ const target = (active == null ? void 0 : active.targetEl) || current;
6105
6227
  const i = toggles.indexOf(target);
6106
6228
 
6107
6229
  // Left
@@ -6275,22 +6397,6 @@
6275
6397
  } },
6276
6398
 
6277
6399
 
6278
- {
6279
- name: 'touchstart',
6280
-
6281
- passive: true,
6282
-
6283
- el() {
6284
- return this.panel;
6285
- },
6286
-
6287
- handler(_ref8) {let { targetTouches } = _ref8;
6288
- if (targetTouches.length === 1) {
6289
- this.clientY = targetTouches[0].clientY;
6290
- }
6291
- } },
6292
-
6293
-
6294
6400
  {
6295
6401
  name: 'touchmove',
6296
6402
 
@@ -6306,33 +6412,6 @@
6306
6412
  } },
6307
6413
 
6308
6414
 
6309
- {
6310
- name: 'touchmove',
6311
-
6312
- passive: false,
6313
-
6314
- el() {
6315
- return this.panel;
6316
- },
6317
-
6318
- handler(e) {
6319
- if (e.targetTouches.length !== 1) {
6320
- return;
6321
- }
6322
-
6323
- const clientY = e.targetTouches[0].clientY - this.clientY;
6324
- const { scrollTop, scrollHeight, clientHeight } = this.panel;
6325
-
6326
- if (
6327
- clientHeight >= scrollHeight ||
6328
- scrollTop === 0 && clientY > 0 ||
6329
- scrollHeight - scrollTop <= clientHeight && clientY < 0)
6330
- {
6331
- e.cancelable && e.preventDefault();
6332
- }
6333
- } },
6334
-
6335
-
6336
6415
  {
6337
6416
  name: 'show',
6338
6417
 
@@ -6344,7 +6423,6 @@
6344
6423
  addClass(parent(this.panel), this.clsMode);
6345
6424
  }
6346
6425
 
6347
- css(document.documentElement, 'overflowY', this.overlay ? 'hidden' : '');
6348
6426
  addClass(document.body, this.clsContainer, this.clsFlip);
6349
6427
  css(document.body, 'touch-action', 'pan-y pinch-zoom');
6350
6428
  css(this.$el, 'display', 'block');
@@ -6352,7 +6430,7 @@
6352
6430
  addClass(
6353
6431
  this.panel,
6354
6432
  this.clsSidebarAnimation,
6355
- this.mode !== 'reveal' ? this.clsMode : '');
6433
+ this.mode === 'reveal' ? '' : this.clsMode);
6356
6434
 
6357
6435
 
6358
6436
  height(document.body); // force reflow
@@ -6389,8 +6467,6 @@
6389
6467
  removeClass(this.$el, this.clsOverlay);
6390
6468
  css(this.$el, 'display', '');
6391
6469
  removeClass(document.body, this.clsContainer, this.clsFlip);
6392
-
6393
- css(document.documentElement, 'overflowY', '');
6394
6470
  } },
6395
6471
 
6396
6472
 
@@ -6515,6 +6591,14 @@
6515
6591
  offset: 0 },
6516
6592
 
6517
6593
 
6594
+ connected() {
6595
+ registerClick(this);
6596
+ },
6597
+
6598
+ disconnected() {
6599
+ unregisterClick(this);
6600
+ },
6601
+
6518
6602
  methods: {
6519
6603
  async scrollTo(el) {
6520
6604
  el = el && $(el) || document.body;
@@ -6523,20 +6607,39 @@
6523
6607
  await scrollIntoView(el, { offset: this.offset });
6524
6608
  trigger(this.$el, 'scrolled', [this, el]);
6525
6609
  }
6526
- } },
6610
+ } } };
6527
6611
 
6528
6612
 
6529
- events: {
6530
- click(e) {
6531
- if (e.defaultPrevented) {
6532
- return;
6533
- }
6534
6613
 
6535
- e.preventDefault();
6536
- this.scrollTo(getTargetElement(this.$el));
6537
- } } };
6614
+ const components$1 = new Set();
6615
+ function registerClick(cmp) {
6616
+ if (!components$1.size) {
6617
+ on(document, 'click', clickHandler);
6618
+ }
6619
+
6620
+ components$1.add(cmp);
6621
+ }
6622
+
6623
+ function unregisterClick(cmp) {
6624
+ components$1.delete(cmp);
6625
+
6626
+ if (!components$1.length) {
6627
+ off(document, 'click', clickHandler);
6628
+ }
6629
+ }
6538
6630
 
6631
+ function clickHandler(e) {
6632
+ if (e.defaultPrevented) {
6633
+ return;
6634
+ }
6539
6635
 
6636
+ for (const component of components$1) {
6637
+ if (within(e.target, component.$el)) {
6638
+ e.preventDefault();
6639
+ component.scrollTo(getTargetElement(component.$el));
6640
+ }
6641
+ }
6642
+ }
6540
6643
 
6541
6644
  function getTargetElement(el) {
6542
6645
  return document.getElementById(decodeURIComponent(el.hash).substring(1));
@@ -6866,7 +6969,9 @@
6866
6969
  },
6867
6970
 
6868
6971
  handler() {
6869
- if (!location.hash || scrollTop(window) === 0) {
6972
+ const { scrollingElement } = document;
6973
+
6974
+ if (!location.hash || scrollingElement.scrollTop === 0) {
6870
6975
  return;
6871
6976
  }
6872
6977
 
@@ -6875,13 +6980,11 @@
6875
6980
  const elOffset = offset(this.$el);
6876
6981
 
6877
6982
  if (this.isFixed && intersectRect(targetOffset, elOffset)) {
6878
- scrollTop(
6879
- window,
6983
+ scrollingElement.scrollTop =
6880
6984
  targetOffset.top -
6881
6985
  elOffset.height -
6882
6986
  toPx(this.targetOffset, 'height', this.placeholder) -
6883
- toPx(this.offset, 'height', this.placeholder));
6884
-
6987
+ toPx(this.offset, 'height', this.placeholder);
6885
6988
  }
6886
6989
  });
6887
6990
  } }],
@@ -6979,7 +7082,7 @@
6979
7082
 
6980
7083
 
6981
7084
  {let { scroll: prevScroll = 0, dir: prevDir = 'down', overflow, overflowScroll = 0, start, end } = _ref4;
6982
- const scroll = scrollTop(window);
7085
+ const scroll = document.scrollingElement.scrollTop;
6983
7086
  const dir = prevScroll <= scroll ? 'down' : 'up';
6984
7087
 
6985
7088
  return {
@@ -7499,7 +7602,7 @@
7499
7602
 
7500
7603
 
7501
7604
  {
7502
- name: 'toggled',
7605
+ name: 'hide show',
7503
7606
 
7504
7607
  self: true,
7505
7608
 
@@ -7507,10 +7610,8 @@
7507
7610
  return this.target;
7508
7611
  },
7509
7612
 
7510
- handler(e, toggled) {
7511
- if (e.target === this.target[0]) {
7512
- this.updateAria(toggled);
7513
- }
7613
+ handler(_ref2) {let { type } = _ref2;
7614
+ this.updateAria(type === 'show');
7514
7615
  } },
7515
7616
 
7516
7617
 
@@ -7605,10 +7706,12 @@
7605
7706
  Video: Video,
7606
7707
  Close: Close,
7607
7708
  Spinner: Spinner,
7709
+ NavParentIcon: NavParentIcon,
7608
7710
  SlidenavNext: Slidenav,
7609
7711
  SlidenavPrevious: Slidenav,
7610
7712
  SearchIcon: Search,
7611
7713
  Marker: IconComponent,
7714
+ NavbarParentIcon: IconComponent,
7612
7715
  NavbarToggleIcon: IconComponent,
7613
7716
  OverlayIcon: IconComponent,
7614
7717
  PaginationNext: IconComponent,