uikit 3.14.4-dev.871ba3c05 → 3.14.4-dev.a014fa609

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