uikit 3.13.9 → 3.13.11-dev.1296bb84c

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 (102) hide show
  1. package/CHANGELOG.md +41 -1
  2. package/build/build.js +4 -1
  3. package/dist/css/uikit-core-rtl.css +49 -8
  4. package/dist/css/uikit-core-rtl.min.css +1 -1
  5. package/dist/css/uikit-core.css +49 -8
  6. package/dist/css/uikit-core.min.css +1 -1
  7. package/dist/css/uikit-rtl.css +49 -6
  8. package/dist/css/uikit-rtl.min.css +1 -1
  9. package/dist/css/uikit.css +49 -6
  10. package/dist/css/uikit.min.css +1 -1
  11. package/dist/js/components/countdown.js +1 -1
  12. package/dist/js/components/countdown.min.js +1 -1
  13. package/dist/js/components/filter.js +1 -1
  14. package/dist/js/components/filter.min.js +1 -1
  15. package/dist/js/components/lightbox-panel.js +7 -3
  16. package/dist/js/components/lightbox-panel.min.js +1 -1
  17. package/dist/js/components/lightbox.js +7 -3
  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 +21 -12
  22. package/dist/js/components/parallax.min.js +1 -1
  23. package/dist/js/components/slider-parallax.js +21 -12
  24. package/dist/js/components/slider-parallax.min.js +1 -1
  25. package/dist/js/components/slider.js +2 -2
  26. package/dist/js/components/slider.min.js +1 -1
  27. package/dist/js/components/slideshow-parallax.js +21 -12
  28. package/dist/js/components/slideshow-parallax.min.js +1 -1
  29. package/dist/js/components/slideshow.js +1 -1
  30. package/dist/js/components/slideshow.min.js +1 -1
  31. package/dist/js/components/sortable.js +2 -2
  32. package/dist/js/components/sortable.min.js +1 -1
  33. package/dist/js/components/tooltip.js +62 -30
  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 +433 -314
  38. package/dist/js/uikit-core.min.js +1 -1
  39. package/dist/js/uikit-icons.js +1 -1
  40. package/dist/js/uikit-icons.min.js +1 -1
  41. package/dist/js/uikit.js +480 -322
  42. package/dist/js/uikit.min.js +1 -1
  43. package/package.json +1 -1
  44. package/src/js/components/slider.js +1 -1
  45. package/src/js/components/sortable.js +2 -3
  46. package/src/js/components/tooltip.js +38 -3
  47. package/src/js/core/cover.js +27 -14
  48. package/src/js/core/drop.js +40 -17
  49. package/src/js/core/height-match.js +1 -1
  50. package/src/js/core/margin.js +9 -2
  51. package/src/js/core/navbar.js +18 -6
  52. package/src/js/core/scrollspy-nav.js +6 -11
  53. package/src/js/core/sticky.js +58 -22
  54. package/src/js/core/toggle.js +8 -8
  55. package/src/js/mixin/media.js +12 -9
  56. package/src/js/mixin/modal.js +6 -2
  57. package/src/js/mixin/parallax.js +8 -3
  58. package/src/js/mixin/position.js +24 -24
  59. package/src/js/uikit-core.js +0 -4
  60. package/src/js/util/lang.js +34 -42
  61. package/src/js/util/position.js +180 -125
  62. package/src/js/util/viewport.js +42 -22
  63. package/src/less/components/drop.less +0 -1
  64. package/src/less/components/dropdown.less +11 -1
  65. package/src/less/components/icon.less +3 -0
  66. package/src/less/components/nav.less +23 -0
  67. package/src/less/components/navbar.less +26 -2
  68. package/src/less/components/search.less +2 -0
  69. package/src/less/components/sticky.less +8 -3
  70. package/src/less/components/utility.less +1 -0
  71. package/src/less/theme/dropdown.less +4 -0
  72. package/src/less/theme/nav.less +6 -0
  73. package/src/less/theme/navbar.less +4 -0
  74. package/src/less/theme/search.less +6 -0
  75. package/src/scss/components/drop.scss +0 -1
  76. package/src/scss/components/dropdown.scss +11 -1
  77. package/src/scss/components/icon.scss +3 -0
  78. package/src/scss/components/nav.scss +23 -0
  79. package/src/scss/components/navbar.scss +26 -2
  80. package/src/scss/components/search.scss +2 -0
  81. package/src/scss/components/sticky.scss +8 -3
  82. package/src/scss/components/utility.scss +1 -0
  83. package/src/scss/mixins-theme.scss +5 -0
  84. package/src/scss/mixins.scss +5 -0
  85. package/src/scss/theme/dropdown.scss +4 -0
  86. package/src/scss/theme/nav.scss +6 -0
  87. package/src/scss/theme/navbar.scss +4 -0
  88. package/src/scss/theme/search.scss +6 -0
  89. package/src/scss/variables-theme.scss +5 -1
  90. package/src/scss/variables.scss +5 -1
  91. package/tests/alert.html +1 -1
  92. package/tests/animation.html +216 -214
  93. package/tests/drop.html +154 -80
  94. package/tests/dropdown.html +16 -2
  95. package/tests/nav.html +27 -0
  96. package/tests/navbar.html +56 -5
  97. package/tests/parallax.html +5 -5
  98. package/tests/position.html +38 -39
  99. package/tests/sticky-navbar.html +6 -6
  100. package/tests/sticky-parallax.html +29 -13
  101. package/tests/sticky.html +300 -49
  102. package/src/js/core/core.js +0 -25
package/dist/js/uikit.js CHANGED
@@ -1,4 +1,4 @@
1
- /*! UIkit 3.13.9 | https://www.getuikit.com | (c) 2014 - 2022 YOOtheme | MIT License */
1
+ /*! UIkit 3.13.11-dev.1296bb84c | 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() :
@@ -141,10 +141,6 @@
141
141
  return (document == null ? void 0 : document.defaultView) || window;
142
142
  }
143
143
 
144
- function toMs(time) {
145
- return time ? endsWith(time, 'ms') ? toFloat(time) : toFloat(time) * 1000 : 0;
146
- }
147
-
148
144
  function isEqual(value, other) {
149
145
  return (
150
146
  value === other ||
@@ -212,48 +208,44 @@
212
208
 
213
209
  }
214
210
 
215
- const Dimensions = {
216
- ratio(dimensions, prop, value) {
217
- const aProp = prop === 'width' ? 'height' : 'width';
211
+ function ratio(dimensions, prop, value) {
212
+ const aProp = prop === 'width' ? 'height' : 'width';
218
213
 
219
- return {
220
- [aProp]: dimensions[prop] ?
221
- Math.round(value * dimensions[aProp] / dimensions[prop]) :
222
- dimensions[aProp],
223
- [prop]: value };
214
+ return {
215
+ [aProp]: dimensions[prop] ?
216
+ Math.round(value * dimensions[aProp] / dimensions[prop]) :
217
+ dimensions[aProp],
218
+ [prop]: value };
224
219
 
225
- },
220
+ }
226
221
 
227
- contain(dimensions, maxDimensions) {
228
- dimensions = { ...dimensions };
222
+ function contain(dimensions, maxDimensions) {
223
+ dimensions = { ...dimensions };
229
224
 
230
- each(
231
- dimensions,
232
- (_, prop) =>
225
+ for (const prop in dimensions) {
233
226
  dimensions =
234
227
  dimensions[prop] > maxDimensions[prop] ?
235
- this.ratio(dimensions, prop, maxDimensions[prop]) :
236
- dimensions);
237
-
228
+ ratio(dimensions, prop, maxDimensions[prop]) :
229
+ dimensions;
230
+ }
238
231
 
239
- return dimensions;
240
- },
232
+ return dimensions;
233
+ }
241
234
 
242
- cover(dimensions, maxDimensions) {
243
- dimensions = this.contain(dimensions, maxDimensions);
235
+ function cover$1(dimensions, maxDimensions) {
236
+ dimensions = contain(dimensions, maxDimensions);
244
237
 
245
- each(
246
- dimensions,
247
- (_, prop) =>
238
+ for (const prop in dimensions) {
248
239
  dimensions =
249
240
  dimensions[prop] < maxDimensions[prop] ?
250
- this.ratio(dimensions, prop, maxDimensions[prop]) :
251
- dimensions);
252
-
241
+ ratio(dimensions, prop, maxDimensions[prop]) :
242
+ dimensions;
243
+ }
253
244
 
254
- return dimensions;
255
- } };
245
+ return dimensions;
246
+ }
256
247
 
248
+ const Dimensions = { ratio, contain, cover: cover$1 };
257
249
 
258
250
  function getIndex(i, elements, current, finite) {if (current === void 0) {current = 0;}if (finite === void 0) {finite = false;}
259
251
  elements = toNodes(elements);
@@ -1788,7 +1780,7 @@
1788
1780
  return intersectRect(
1789
1781
  ...scrollParents(element).
1790
1782
  map((parent) => {
1791
- const { top, left, bottom, right } = offset(getViewport$1(parent));
1783
+ const { top, left, bottom, right } = offsetViewport(parent);
1792
1784
 
1793
1785
  return {
1794
1786
  top: top - offsetTop,
@@ -1803,7 +1795,7 @@
1803
1795
 
1804
1796
  function scrollTop(element, top) {
1805
1797
  if (isWindow(element) || isDocument(element)) {
1806
- element = getScrollingElement(element);
1798
+ element = scrollingElement(element);
1807
1799
  } else {
1808
1800
  element = toNode(element);
1809
1801
  }
@@ -1820,12 +1812,13 @@
1820
1812
  return parents.reduce(
1821
1813
  (fn, scrollElement, i) => {
1822
1814
  const { scrollTop, scrollHeight, offsetHeight } = scrollElement;
1823
- const maxScroll = scrollHeight - getViewportClientHeight(scrollElement);
1824
- const { height: elHeight, top: elTop } = offset(parents[i - 1] || element);
1825
-
1826
- let top = Math.ceil(
1827
- elTop - offset(getViewport$1(scrollElement)).top - offsetBy + scrollTop);
1815
+ const viewport = offsetViewport(scrollElement);
1816
+ const maxScroll = scrollHeight - viewport.height;
1817
+ const { height: elHeight, top: elTop } = parents[i - 1] ?
1818
+ offsetViewport(parents[i - 1]) :
1819
+ offset(element);
1828
1820
 
1821
+ let top = Math.ceil(elTop - viewport.top - offsetBy + scrollTop);
1829
1822
 
1830
1823
  if (offsetBy > 0 && offsetHeight < elHeight + offsetBy) {
1831
1824
  top += offsetBy;
@@ -1883,7 +1876,7 @@
1883
1876
 
1884
1877
  const [scrollElement] = scrollParents(element, /auto|scroll/, true);
1885
1878
  const { scrollHeight, scrollTop } = scrollElement;
1886
- const viewportHeight = getViewportClientHeight(scrollElement);
1879
+ const { height: viewportHeight } = offsetViewport(scrollElement);
1887
1880
  const maxScroll = scrollHeight - viewportHeight;
1888
1881
  const elementOffsetTop = offsetPosition(element)[0] - offsetPosition(scrollElement)[0];
1889
1882
 
@@ -1894,7 +1887,7 @@
1894
1887
  }
1895
1888
 
1896
1889
  function scrollParents(element, overflowRe, scrollable) {if (overflowRe === void 0) {overflowRe = /auto|scroll|hidden/;}if (scrollable === void 0) {scrollable = false;}
1897
- const scrollEl = getScrollingElement(element);
1890
+ const scrollEl = scrollingElement(element);
1898
1891
 
1899
1892
  let ancestors = parents(element).reverse();
1900
1893
  ancestors = ancestors.slice(ancestors.indexOf(scrollEl) + 1);
@@ -1909,181 +1902,253 @@
1909
1902
  ancestors.filter(
1910
1903
  (parent) =>
1911
1904
  overflowRe.test(css(parent, 'overflow')) && (
1912
- !scrollable || parent.scrollHeight > getViewportClientHeight(parent)))).
1905
+ !scrollable || parent.scrollHeight > offsetViewport(parent).height))).
1913
1906
 
1914
1907
 
1915
1908
  reverse();
1916
1909
  }
1917
1910
 
1918
- function getViewport$1(scrollElement) {
1919
- return scrollElement === getScrollingElement(scrollElement) ? window : scrollElement;
1911
+ function offsetViewport(scrollElement) {
1912
+ let viewportElement = getViewport$1(scrollElement);
1913
+
1914
+ // iOS 12 returns <body> as scrollingElement
1915
+ if (viewportElement === scrollingElement(viewportElement)) {
1916
+ viewportElement = document.documentElement;
1917
+ }
1918
+
1919
+ let rect = offset(viewportElement);
1920
+ for (let [prop, dir, start, end] of [
1921
+ ['width', 'x', 'left', 'right'],
1922
+ ['height', 'y', 'top', 'bottom']])
1923
+ {
1924
+ if (!isWindow(getViewport$1(viewportElement))) {
1925
+ rect[start] += toFloat(css(viewportElement, "border" + ucfirst(start) + "Width"));
1926
+ }
1927
+ rect[prop] = rect[dir] = (
1928
+ isWindow(viewportElement) ? scrollingElement(viewportElement) : viewportElement)["client" +
1929
+ ucfirst(prop)];
1930
+ rect[end] = rect[prop] + rect[start];
1931
+ }
1932
+ return rect;
1920
1933
  }
1921
1934
 
1922
- // iOS 12 returns <body> as scrollingElement
1923
- function getViewportClientHeight(scrollElement) {
1924
- return (
1925
- scrollElement === getScrollingElement(scrollElement) ?
1926
- document.documentElement :
1927
- scrollElement).
1928
- clientHeight;
1935
+ function scrollingElement(element) {
1936
+ const {
1937
+ document: { scrollingElement } } =
1938
+ toWindow(element);
1939
+ return scrollingElement;
1929
1940
  }
1930
1941
 
1931
- function getScrollingElement(element) {
1932
- const { document } = toWindow(element);
1933
- return document.scrollingElement || document.documentElement;
1942
+ function getViewport$1(scrollElement) {
1943
+ return scrollElement === scrollingElement(scrollElement) ? window : scrollElement;
1934
1944
  }
1935
1945
 
1936
- const dirs = {
1937
- width: ['x', 'left', 'right'],
1938
- height: ['y', 'top', 'bottom'] };
1946
+ const dirs = [
1947
+ ['width', 'x', 'left', 'right'],
1948
+ ['height', 'y', 'top', 'bottom']];
1949
+
1950
+
1951
+ function positionAt(element, target, options) {
1952
+ options = {
1953
+ attach: {
1954
+ element: ['left', 'top'],
1955
+ target: ['left', 'top'],
1956
+ ...options.attach },
1957
+
1958
+ offset: [0, 0],
1959
+ ...options };
1960
+
1961
+
1962
+ const dim = options.flip ?
1963
+ attachToWithFlip(element, target, options) :
1964
+ attachTo(element, target, options);
1939
1965
 
1966
+ offset(element, dim);
1967
+ }
1968
+
1969
+ function attachTo(element, target, options) {
1970
+ let { attach, offset: offsetBy } = {
1971
+ attach: {
1972
+ element: ['left', 'top'],
1973
+ target: ['left', 'top'],
1974
+ ...options.attach },
1940
1975
 
1941
- function positionAt(
1942
- element,
1943
- target,
1944
- elAttach,
1945
- targetAttach,
1946
- elOffset,
1947
- targetOffset,
1948
- flip,
1949
- boundary)
1950
- {
1951
- elAttach = getPos(elAttach);
1952
- targetAttach = getPos(targetAttach);
1976
+ offset: [0, 0],
1977
+ ...options };
1953
1978
 
1954
- const flipped = { element: elAttach, target: targetAttach };
1955
1979
 
1956
- if (!element || !target) {
1957
- return flipped;
1980
+ const position = offset(element);
1981
+ const targetOffset = offset(target);
1982
+ for (const [i, [prop, dir, start, end]] of Object.entries(dirs)) {
1983
+ position[start] = position[dir] =
1984
+ targetOffset[start] +
1985
+ moveBy(attach.target[i], end, targetOffset[prop]) -
1986
+ moveBy(attach.element[i], end, position[prop]) +
1987
+ +offsetBy[i];
1988
+ position[end] = position[start] + position[prop];
1958
1989
  }
1990
+ return position;
1991
+ }
1959
1992
 
1960
- const dim = offset(element);
1993
+ function attachToWithFlip(element, target, options) {
1994
+ const position = attachTo(element, target, options);
1961
1995
  const targetDim = offset(target);
1962
- const position = targetDim;
1963
1996
 
1964
- moveTo(position, elAttach, dim, -1);
1965
- moveTo(position, targetAttach, targetDim, 1);
1997
+ let {
1998
+ flip,
1999
+ attach: { element: elAttach, target: targetAttach },
2000
+ offset: elOffset,
2001
+ boundary,
2002
+ viewport,
2003
+ viewportPadding } =
2004
+ options;
2005
+
2006
+ let viewports = scrollParents(element);
2007
+ if (boundary === target) {
2008
+ viewports = viewports.filter((viewport) => viewport !== boundary);
2009
+ }
2010
+ const [scrollElement] = viewports;
2011
+ viewports.push(viewport);
2012
+
2013
+ const offsetPosition = { ...position };
2014
+ for (const [i, [prop, dir, start, end]] of Object.entries(dirs)) {
2015
+ if (flip !== true && !includes(flip, dir)) {
2016
+ continue;
2017
+ }
2018
+
2019
+ const willFlip =
2020
+ !intersectLine(position, targetDim, i) && intersectLine(position, targetDim, 1 - i);
1966
2021
 
1967
- elOffset = getOffsets(elOffset, dim.width, dim.height);
1968
- targetOffset = getOffsets(targetOffset, targetDim.width, targetDim.height);
2022
+ viewport = getIntersectionArea(...viewports.filter(Boolean).map(offsetViewport));
1969
2023
 
1970
- elOffset['x'] += targetOffset['x'];
1971
- elOffset['y'] += targetOffset['y'];
2024
+ if (viewportPadding) {
2025
+ viewport[start] += viewportPadding;
2026
+ viewport[end] -= viewportPadding;
2027
+ }
1972
2028
 
1973
- position.left += elOffset['x'];
1974
- position.top += elOffset['y'];
2029
+ if (boundary && !willFlip && position[prop] <= offset(boundary)[prop]) {
2030
+ viewport = getIntersectionArea(viewport, offset(boundary));
2031
+ }
1975
2032
 
1976
- if (flip) {
1977
- let boundaries = scrollParents(element).map(getViewport$1);
2033
+ const isInStartBoundary = position[start] >= viewport[start];
2034
+ const isInEndBoundary = position[end] <= viewport[end];
1978
2035
 
1979
- if (boundary && !includes(boundaries, boundary)) {
1980
- boundaries.unshift(boundary);
2036
+ if (isInStartBoundary && isInEndBoundary) {
2037
+ continue;
1981
2038
  }
1982
2039
 
1983
- boundaries = boundaries.map((el) => offset(el));
2040
+ let offsetBy;
1984
2041
 
1985
- each(dirs, (_ref, prop) => {let [dir, align, alignFlip] = _ref;
1986
- if (!(flip === true || includes(flip, dir))) {
1987
- return;
2042
+ // Flip
2043
+ if (willFlip) {
2044
+ if (
2045
+ elAttach[i] === end && isInStartBoundary ||
2046
+ elAttach[i] === start && isInEndBoundary)
2047
+ {
2048
+ continue;
1988
2049
  }
1989
2050
 
1990
- boundaries.some((boundary) => {
1991
- const elemOffset =
1992
- elAttach[dir] === align ?
1993
- -dim[prop] :
1994
- elAttach[dir] === alignFlip ?
1995
- dim[prop] :
1996
- 0;
1997
-
1998
- const targetOffset =
1999
- targetAttach[dir] === align ?
2000
- targetDim[prop] :
2001
- targetAttach[dir] === alignFlip ?
2002
- -targetDim[prop] :
2003
- 0;
2051
+ offsetBy =
2052
+ (elAttach[i] === start ?
2053
+ -position[prop] :
2054
+ elAttach[i] === end ?
2055
+ position[prop] :
2056
+ 0) + (
2057
+ targetAttach[i] === start ?
2058
+ targetDim[prop] :
2059
+ targetAttach[i] === end ?
2060
+ -targetDim[prop] :
2061
+ 0) -
2062
+ elOffset[i] * 2;
2004
2063
 
2005
- if (
2006
- position[align] < boundary[align] ||
2007
- position[align] + dim[prop] > boundary[alignFlip])
2008
- {
2009
- const centerOffset = dim[prop] / 2;
2010
- const centerTargetOffset =
2011
- targetAttach[dir] === 'center' ? -targetDim[prop] / 2 : 0;
2064
+ if (
2065
+ !isInScrollArea(
2066
+ {
2067
+ ...position,
2068
+ [start]: position[start] + offsetBy,
2069
+ [end]: position[end] + offsetBy },
2012
2070
 
2013
- return (
2014
- elAttach[dir] === 'center' && (
2015
- apply(centerOffset, centerTargetOffset) ||
2016
- apply(-centerOffset, -centerTargetOffset)) ||
2017
- apply(elemOffset, targetOffset));
2071
+ scrollElement,
2072
+ i))
2018
2073
 
2074
+ {
2075
+ if (isInScrollArea(position, scrollElement, i)) {
2076
+ continue;
2019
2077
  }
2020
2078
 
2021
- function apply(elemOffset, targetOffset) {
2022
- const newVal = toFloat(
2023
- (position[align] + elemOffset + targetOffset - elOffset[dir] * 2).toFixed(4));
2079
+ if (options.recursion) {
2080
+ return false;
2081
+ }
2024
2082
 
2083
+ const newPos = attachToWithFlip(element, target, {
2084
+ ...options,
2085
+ attach: {
2086
+ element: elAttach.map(flipDir).reverse(),
2087
+ target: targetAttach.map(flipDir).reverse() },
2025
2088
 
2026
- if (newVal >= boundary[align] && newVal + dim[prop] <= boundary[alignFlip]) {
2027
- position[align] = newVal;
2089
+ offset: elOffset.reverse(),
2090
+ flip: flip === true ? flip : [...flip, dirs[1 - i][1]],
2091
+ recursion: true });
2028
2092
 
2029
- for (const el of ['element', 'target']) {
2030
- if (elemOffset) {
2031
- flipped[el][dir] =
2032
- flipped[el][dir] === dirs[prop][1] ?
2033
- dirs[prop][2] :
2034
- dirs[prop][1];
2035
- }
2036
- }
2037
2093
 
2038
- return true;
2039
- }
2094
+ if (newPos && isInScrollArea(newPos, scrollElement, 1 - i)) {
2095
+ return newPos;
2040
2096
  }
2041
- });
2042
- });
2043
- }
2097
+ }
2044
2098
 
2045
- offset(element, position);
2099
+ // Move
2100
+ } else {
2101
+ offsetBy =
2102
+ clamp(
2103
+ clamp(position[start], viewport[start], viewport[end] - position[prop]),
2104
+ targetDim[start] - position[prop] + elOffset[i],
2105
+ targetDim[end] - elOffset[i]) -
2106
+ position[start];
2107
+ }
2046
2108
 
2047
- return flipped;
2048
- }
2109
+ offsetPosition[start] = position[dir] = position[start] + offsetBy;
2110
+ offsetPosition[end] += offsetBy;
2111
+ }
2049
2112
 
2050
- function moveTo(position, attach, dim, factor) {
2051
- each(dirs, (_ref2, prop) => {let [dir, align, alignFlip] = _ref2;
2052
- if (attach[dir] === alignFlip) {
2053
- position[align] += dim[prop] * factor;
2054
- } else if (attach[dir] === 'center') {
2055
- position[align] += dim[prop] * factor / 2;
2056
- }
2057
- });
2113
+ return offsetPosition;
2058
2114
  }
2059
2115
 
2060
- function getPos(pos) {
2061
- const x = /left|center|right/;
2062
- const y = /top|center|bottom/;
2063
-
2064
- pos = (pos || '').split(' ');
2116
+ function moveBy(start, end, dim) {
2117
+ return start === 'center' ? dim / 2 : start === end ? dim : 0;
2118
+ }
2065
2119
 
2066
- if (pos.length === 1) {
2067
- pos = x.test(pos[0]) ?
2068
- pos.concat('center') :
2069
- y.test(pos[0]) ?
2070
- ['center'].concat(pos) :
2071
- ['center', 'center'];
2120
+ function getIntersectionArea() {
2121
+ let area = {};for (var _len = arguments.length, rects = new Array(_len), _key = 0; _key < _len; _key++) {rects[_key] = arguments[_key];}
2122
+ for (const rect of rects) {
2123
+ for (const [,, start, end] of dirs) {
2124
+ area[start] = Math.max(area[start] || 0, rect[start]);
2125
+ area[end] = Math.min(...[area[end], rect[end]].filter(Boolean));
2126
+ }
2072
2127
  }
2128
+ return area;
2129
+ }
2073
2130
 
2074
- return {
2075
- x: x.test(pos[0]) ? pos[0] : 'center',
2076
- y: y.test(pos[1]) ? pos[1] : 'center' };
2131
+ function isInScrollArea(position, scrollElement, dir) {
2132
+ const viewport = offsetViewport(scrollElement);
2133
+ const [prop,, start, end] = dirs[dir];
2134
+ viewport[start] -= scrollElement["scroll" + ucfirst(start)];
2135
+ viewport[end] = viewport[start] + scrollElement["scroll" + ucfirst(prop)];
2077
2136
 
2137
+ return position[start] >= viewport[start] && position[end] <= viewport[end];
2078
2138
  }
2079
2139
 
2080
- function getOffsets(offsets, width, height) {
2081
- const [x, y] = (offsets || '').split(' ');
2082
-
2083
- return {
2084
- x: x ? toFloat(x) * (endsWith(x, '%') ? width / 100 : 1) : 0,
2085
- y: y ? toFloat(y) * (endsWith(y, '%') ? height / 100 : 1) : 0 };
2140
+ function intersectLine(dimA, dimB, dir) {
2141
+ const [,, start, end] = dirs[dir];
2142
+ return dimA[end] > dimB[start] && dimB[end] > dimA[start];
2143
+ }
2086
2144
 
2145
+ function flipDir(prop) {
2146
+ for (let i = 0; i < dirs.length; i++) {
2147
+ const index = dirs[i].indexOf(prop);
2148
+ if (~index) {
2149
+ return dirs[1 - i][index % 2 + 2];
2150
+ }
2151
+ }
2087
2152
  }
2088
2153
 
2089
2154
  var util = /*#__PURE__*/Object.freeze({
@@ -2192,7 +2257,6 @@
2192
2257
  toNode: toNode,
2193
2258
  toNodes: toNodes,
2194
2259
  toWindow: toWindow,
2195
- toMs: toMs,
2196
2260
  isEqual: isEqual,
2197
2261
  swap: swap,
2198
2262
  last: last,
@@ -2231,9 +2295,7 @@
2231
2295
  scrollIntoView: scrollIntoView,
2232
2296
  scrolledOver: scrolledOver,
2233
2297
  scrollParents: scrollParents,
2234
- getViewport: getViewport$1,
2235
- getViewportClientHeight: getViewportClientHeight,
2236
- getScrollingElement: getScrollingElement
2298
+ offsetViewport: offsetViewport
2237
2299
  });
2238
2300
 
2239
2301
  function globalAPI (UIkit) {
@@ -2550,7 +2612,7 @@
2550
2612
  continue;
2551
2613
  }
2552
2614
 
2553
- value = props[key] === Boolean && value === '' ? true : coerce(props[key], value);
2615
+ value = props[key] === Boolean && value === '' ? true : coerce$1(props[key], value);
2554
2616
 
2555
2617
  if (prop === 'target' && (!value || startsWith(value, '_'))) {
2556
2618
  continue;
@@ -2564,7 +2626,7 @@
2564
2626
  for (const key in options) {
2565
2627
  const prop = camelize(key);
2566
2628
  if (props[prop] !== undefined) {
2567
- data$1[prop] = coerce(props[prop], options[key]);
2629
+ data$1[prop] = coerce$1(props[prop], options[key]);
2568
2630
  }
2569
2631
  }
2570
2632
 
@@ -2629,7 +2691,7 @@
2629
2691
  return options.every((arr) => !arr || !hasOwn(arr, key));
2630
2692
  }
2631
2693
 
2632
- function coerce(type, value) {
2694
+ function coerce$1(type, value) {
2633
2695
  if (type === Boolean) {
2634
2696
  return toBoolean(value);
2635
2697
  } else if (type === Number) {
@@ -2667,7 +2729,7 @@
2667
2729
  if (isUndefined(data[key])) {
2668
2730
  delete data[key];
2669
2731
  } else if (props[key]) {
2670
- data[key] = coerce(props[key], data[key]);
2732
+ data[key] = coerce$1(props[key], data[key]);
2671
2733
  }
2672
2734
  }
2673
2735
 
@@ -2892,7 +2954,7 @@
2892
2954
  UIkit.data = '__uikit__';
2893
2955
  UIkit.prefix = 'uk-';
2894
2956
  UIkit.options = {};
2895
- UIkit.version = '3.13.9';
2957
+ UIkit.version = '3.13.11-dev.1296bb84c';
2896
2958
 
2897
2959
  globalAPI(UIkit);
2898
2960
  hooksAPI(UIkit);
@@ -2900,30 +2962,6 @@
2900
2962
  componentAPI(UIkit);
2901
2963
  instanceAPI(UIkit);
2902
2964
 
2903
- function Core () {
2904
- if (!inBrowser) {
2905
- return;
2906
- }
2907
-
2908
- let started = 0;
2909
- on(
2910
- document,
2911
- 'animationstart',
2912
- (_ref) => {let { target } = _ref;
2913
- if ((css(target, 'animationName') || '').match(/^uk-.*(left|right)/)) {
2914
- started++;
2915
- css(document.documentElement, 'overflowX', 'hidden');
2916
- setTimeout(() => {
2917
- if (! --started) {
2918
- css(document.documentElement, 'overflowX', '');
2919
- }
2920
- }, toMs(css(target, 'animationDuration')) + 100);
2921
- }
2922
- },
2923
- true);
2924
-
2925
- }
2926
-
2927
2965
  function boot (UIkit) {
2928
2966
  const { connect, disconnect } = UIkit;
2929
2967
 
@@ -3440,25 +3478,38 @@
3440
3478
 
3441
3479
  update: {
3442
3480
  read() {
3443
- const el = this.$el;
3444
- const { offsetHeight: height, offsetWidth: width } =
3445
- getPositionedParent(el) || parent(el);
3446
- const dim = Dimensions.cover(
3447
- {
3448
- width: this.width || el.naturalWidth || el.videoWidth || el.clientWidth,
3449
- height: this.height || el.naturalHeight || el.videoHeight || el.clientHeight },
3481
+ const { ratio, cover } = Dimensions;
3482
+ const { $el, width, height } = this;
3450
3483
 
3451
- {
3452
- width: width + (width % 2 ? 1 : 0),
3453
- height: height + (height % 2 ? 1 : 0) });
3484
+ let dim = { width, height };
3454
3485
 
3486
+ if (!dim.width || !dim.height) {
3487
+ const intrinsic = {
3488
+ width: $el.naturalWidth || $el.videoWidth || $el.clientWidth,
3489
+ height: $el.naturalHeight || $el.videoHeight || $el.clientHeight };
3455
3490
 
3456
3491
 
3457
- if (!dim.width || !dim.height) {
3492
+ if (dim.width) {
3493
+ dim = ratio(intrinsic, 'width', dim.width);
3494
+ } else if (height) {
3495
+ dim = ratio(intrinsic, 'height', dim.height);
3496
+ } else {
3497
+ dim = intrinsic;
3498
+ }
3499
+ }
3500
+
3501
+ const { offsetHeight: coverHeight, offsetWidth: coverWidth } =
3502
+ getPositionedParent($el) || parent($el);
3503
+ const coverDim = cover(dim, {
3504
+ width: coverWidth + (coverWidth % 2 ? 1 : 0),
3505
+ height: coverHeight + (coverHeight % 2 ? 1 : 0) });
3506
+
3507
+
3508
+ if (!coverDim.width || !coverDim.height) {
3458
3509
  return false;
3459
3510
  }
3460
3511
 
3461
- return dim;
3512
+ return coverDim;
3462
3513
  },
3463
3514
 
3464
3515
  write(_ref) {let { height, width } = _ref;
@@ -3501,50 +3552,49 @@
3501
3552
  data: {
3502
3553
  pos: "bottom-" + (isRtl ? 'right' : 'left'),
3503
3554
  flip: true,
3504
- offset: false },
3555
+ offset: false,
3556
+ viewportPadding: 10 },
3505
3557
 
3506
3558
 
3507
3559
  connected() {
3508
3560
  this.pos = this.$props.pos.split('-').concat('center').slice(0, 2);
3509
- this.dir = this.pos[0];
3510
- this.align = this.pos[1];
3561
+ this.axis = includes(['top', 'bottom'], this.pos[0]) ? 'y' : 'x';
3511
3562
  },
3512
3563
 
3513
3564
  methods: {
3514
3565
  positionAt(element, target, boundary) {
3515
- const axis = this.getAxis();
3516
- const dir = this.pos[0];
3517
- const align = this.pos[1];
3566
+ const [dir, align] = this.pos;
3518
3567
 
3519
3568
  let { offset: offset$1 } = this;
3520
3569
  if (!isNumeric(offset$1)) {
3521
3570
  const node = $(offset$1);
3522
3571
  offset$1 = node ?
3523
- offset(node)[axis === 'x' ? 'left' : 'top'] -
3524
- offset(target)[axis === 'x' ? 'right' : 'bottom'] :
3572
+ offset(node)[this.axis === 'x' ? 'left' : 'top'] -
3573
+ offset(target)[this.axis === 'x' ? 'right' : 'bottom'] :
3525
3574
  0;
3526
3575
  }
3527
3576
  offset$1 = toPx(offset$1) + toPx(getCssVar('position-offset', element));
3577
+ offset$1 = [includes(['left', 'top'], dir) ? -offset$1 : +offset$1, 0];
3578
+
3579
+ const attach = {
3580
+ element: [flipPosition(dir), align],
3581
+ target: [dir, align] };
3582
+
3583
+
3584
+ if (this.axis === 'y') {
3585
+ for (const prop in attach) {
3586
+ attach[prop] = attach[prop].reverse();
3587
+ }
3588
+ offset$1 = offset$1.reverse();
3589
+ }
3590
+
3591
+ positionAt(element, target, {
3592
+ attach,
3593
+ offset: offset$1,
3594
+ boundary,
3595
+ viewportPadding: this.viewportPadding,
3596
+ flip: this.flip });
3528
3597
 
3529
- const { x, y } = positionAt(
3530
- element,
3531
- target,
3532
- axis === 'x' ? flipPosition(dir) + " " + align : align + " " + flipPosition(dir),
3533
- axis === 'x' ? dir + " " + align : align + " " + dir,
3534
- axis === 'x' ? "" + (
3535
- dir === 'left' ? -offset$1 : offset$1) : " " + (
3536
- dir === 'top' ? -offset$1 : offset$1),
3537
- null,
3538
- this.flip,
3539
- boundary).
3540
- target;
3541
-
3542
- this.dir = axis === 'x' ? x : y;
3543
- this.align = axis === 'x' ? y : x;
3544
- },
3545
-
3546
- getAxis() {
3547
- return this.dir === 'top' || this.dir === 'bottom' ? 'y' : 'x';
3548
3598
  } } };
3549
3599
 
3550
3600
  let active$1;
@@ -3561,6 +3611,7 @@
3561
3611
  boundaryAlign: Boolean,
3562
3612
  delayShow: Number,
3563
3613
  delayHide: Number,
3614
+ display: String,
3564
3615
  clsDrop: String },
3565
3616
 
3566
3617
 
@@ -3571,6 +3622,7 @@
3571
3622
  boundaryAlign: false,
3572
3623
  delayShow: 0,
3573
3624
  delayHide: 800,
3625
+ display: null,
3574
3626
  clsDrop: false,
3575
3627
  animation: ['uk-animation-fade'],
3576
3628
  cls: 'uk-open',
@@ -3761,13 +3813,23 @@
3761
3813
  this.hide(false);
3762
3814
  }
3763
3815
  }),
3764
- on(window, 'resize', () => this.$emit()),
3765
- on(
3766
- document,
3767
- 'scroll',
3768
- (_ref4) => {let { target } = _ref4;return target.contains(this.$el) && this.$emit();},
3769
- true)])
3770
3816
 
3817
+ ...(this.display === 'static' ?
3818
+ [] :
3819
+ (() => {
3820
+ const handler = () => this.$emit();
3821
+ return [
3822
+ on(window, 'resize', handler),
3823
+ on(document, 'scroll', handler, true),
3824
+ (() => {
3825
+ const observer = observeResize(
3826
+ scrollParents(this.$el),
3827
+ handler);
3828
+
3829
+ return () => observer.disconnect();
3830
+ })()];
3831
+
3832
+ })())])
3771
3833
  {
3772
3834
  once(this.$el, 'hide', handler, { self: true });
3773
3835
  }
@@ -3787,7 +3849,7 @@
3787
3849
  {
3788
3850
  name: 'hide',
3789
3851
 
3790
- handler(_ref5) {let { target } = _ref5;
3852
+ handler(_ref4) {let { target } = _ref4;
3791
3853
  if (this.$el !== target) {
3792
3854
  active$1 =
3793
3855
  active$1 === null && within(target, this.$el) && this.isToggled() ?
@@ -3878,25 +3940,33 @@
3878
3940
  },
3879
3941
 
3880
3942
  position() {
3881
- const boundary = query(this.boundary, this.$el) || window;
3882
3943
  removeClass(this.$el, this.clsDrop + "-stack");
3883
3944
  toggleClass(this.$el, this.clsDrop + "-boundary", this.boundaryAlign);
3884
3945
 
3885
- const boundaryOffset = offset(boundary);
3886
- const targetOffset = offset(this.target);
3887
- const alignTo = this.boundaryAlign ? boundaryOffset : targetOffset;
3946
+ const boundary = query(this.boundary, this.$el);
3947
+ const [scrollParent] = scrollParents(this.$el);
3948
+ const scrollParentOffset = offsetViewport(scrollParent);
3949
+ const boundaryOffset = boundary ? offset(boundary) : scrollParentOffset;
3950
+
3951
+ css(this.$el, 'maxWidth', '');
3952
+ const maxWidth = scrollParentOffset.width - (boundary ? 0 : 2 * this.viewportPadding);
3888
3953
 
3889
3954
  if (this.pos[1] === 'justify') {
3890
- const prop = this.getAxis() === 'y' ? 'width' : 'height';
3955
+ const prop = this.axis === 'y' ? 'width' : 'height';
3956
+ const targetOffset = offset(this.target);
3957
+ const alignTo = this.boundaryAlign ? boundaryOffset : targetOffset;
3891
3958
  css(this.$el, prop, alignTo[prop]);
3892
- } else if (
3893
- this.$el.offsetWidth >
3894
- Math.max(boundaryOffset.right - alignTo.left, alignTo.right - boundaryOffset.left))
3895
- {
3959
+ } else if (this.$el.offsetWidth > maxWidth) {
3896
3960
  addClass(this.$el, this.clsDrop + "-stack");
3897
3961
  }
3898
3962
 
3899
- this.positionAt(this.$el, this.boundaryAlign ? boundary : this.target, boundary);
3963
+ css(this.$el, 'maxWidth', maxWidth);
3964
+
3965
+ this.positionAt(
3966
+ this.$el,
3967
+ boundary && this.boundaryAlign ? boundary : this.target,
3968
+ boundary);
3969
+
3900
3970
  } } };
3901
3971
 
3902
3972
 
@@ -3994,7 +4064,7 @@
3994
4064
 
3995
4065
 
3996
4066
  resizeTargets() {
3997
- return [this.$el, this.$el.children];
4067
+ return [this.$el, ...toArray(this.$el.children)];
3998
4068
  },
3999
4069
 
4000
4070
  connected() {
@@ -4311,7 +4381,7 @@
4311
4381
 
4312
4382
 
4313
4383
  resizeTargets() {
4314
- return [this.$el, this.elements];
4384
+ return [this.$el, ...this.elements];
4315
4385
  },
4316
4386
 
4317
4387
  update: {
@@ -5000,16 +5070,19 @@
5000
5070
 
5001
5071
  connected() {
5002
5072
  const media = toMedia(this.media);
5003
- this.mediaObj = window.matchMedia(media);
5004
- const handler = () => {
5005
- this.matchMedia = this.mediaObj.matches;
5006
- trigger(this.$el, createEvent('mediachange', false, true, [this.mediaObj]));
5007
- };
5008
- this.offMediaObj = on(this.mediaObj, 'change', () => {
5073
+ this.matchMedia = true;
5074
+ if (media) {
5075
+ this.mediaObj = window.matchMedia(media);
5076
+ const handler = () => {
5077
+ this.matchMedia = this.mediaObj.matches;
5078
+ trigger(this.$el, createEvent('mediachange', false, true, [this.mediaObj]));
5079
+ };
5080
+ this.offMediaObj = on(this.mediaObj, 'change', () => {
5081
+ handler();
5082
+ this.$emit('resize');
5083
+ });
5009
5084
  handler();
5010
- this.$emit('resize');
5011
- });
5012
- handler();
5085
+ }
5013
5086
  },
5014
5087
 
5015
5088
  disconnected() {var _this$offMediaObj;
@@ -5298,7 +5371,7 @@
5298
5371
  return (el, show) =>
5299
5372
  new Promise((resolve, reject) =>
5300
5373
  once(el, 'show hide', () => {
5301
- el._reject && el._reject();
5374
+ el._reject == null ? void 0 : el._reject();
5302
5375
  el._reject = reject;
5303
5376
 
5304
5377
  _toggle(el, show);
@@ -5323,6 +5396,10 @@
5323
5396
  then(() => delete el._reject);
5324
5397
  }
5325
5398
 
5399
+ function toMs(time) {
5400
+ return time ? endsWith(time, 'ms') ? toFloat(time) : toFloat(time) * 1000 : 0;
5401
+ }
5402
+
5326
5403
  var modal = {
5327
5404
  install: install$2,
5328
5405
 
@@ -5476,8 +5553,6 @@
5476
5553
  toggle: '> a',
5477
5554
  content: '> ul' } };
5478
5555
 
5479
- const navItem = '.uk-navbar-nav > li > a, .uk-navbar-item, .uk-navbar-toggle';
5480
-
5481
5556
  var navbar = {
5482
5557
  mixins: [Class, Container],
5483
5558
 
@@ -5497,7 +5572,7 @@
5497
5572
 
5498
5573
 
5499
5574
  data: {
5500
- dropdown: navItem,
5575
+ dropdown: '.uk-navbar-nav > li > a, .uk-navbar-item, .uk-navbar-toggle',
5501
5576
  align: isRtl ? 'right' : 'left',
5502
5577
  clsDrop: 'uk-navbar-dropdown',
5503
5578
  mode: undefined,
@@ -5583,9 +5658,23 @@
5583
5658
  immediate: true },
5584
5659
 
5585
5660
 
5586
- toggles(_ref6, $el) {let { dropdown } = _ref6;
5587
- return $$(dropdown, $el);
5588
- } },
5661
+ toggles: {
5662
+ get(_ref6, $el) {let { dropdown } = _ref6;
5663
+ return $$(dropdown, $el);
5664
+ },
5665
+
5666
+ watch() {
5667
+ const justify = hasClass(this.$el, 'uk-navbar-justify');
5668
+ for (const container of $$(
5669
+ '.uk-navbar-nav, .uk-navbar-left, .uk-navbar-right',
5670
+ this.$el))
5671
+ {
5672
+ css(container, 'flexGrow', justify ? $$(this.dropdown, container).length : '');
5673
+ }
5674
+ },
5675
+
5676
+ immediate: true } },
5677
+
5589
5678
 
5590
5679
 
5591
5680
  disconnected() {
@@ -5746,7 +5835,7 @@
5746
5835
  return this.dropbar;
5747
5836
  },
5748
5837
 
5749
- handler(_, _ref10) {let { $el, dir } = _ref10;
5838
+ handler(_, _ref10) {let { $el, pos: [dir] = [] } = _ref10;
5750
5839
  if (!hasClass($el, this.clsDrop)) {
5751
5840
  return;
5752
5841
  }
@@ -6480,19 +6569,15 @@
6480
6569
 
6481
6570
  const [scrollElement] = scrollParents(targets, /auto|scroll/, true);
6482
6571
  const { scrollTop, scrollHeight } = scrollElement;
6483
- const max = scrollHeight - getViewportClientHeight(scrollElement);
6572
+ const viewport = offsetViewport(scrollElement);
6573
+ const max = scrollHeight - viewport.height;
6484
6574
  let active = false;
6485
6575
 
6486
6576
  if (scrollTop === max) {
6487
6577
  active = length - 1;
6488
6578
  } else {
6489
- for (const i in targets) {
6490
- if (
6491
- offset(targets[i]).top -
6492
- offset(getViewport$1(scrollElement)).top -
6493
- this.offset >
6494
- 0)
6495
- {
6579
+ for (let i = 0; i < targets.length; i++) {
6580
+ if (offset(targets[i]).top - viewport.top - this.offset > 0) {
6496
6581
  break;
6497
6582
  }
6498
6583
  active = +i;
@@ -6510,7 +6595,7 @@
6510
6595
  const changed = active !== false && !hasClass(this.elements[active], this.cls);
6511
6596
 
6512
6597
  this.links.forEach((el) => el.blur());
6513
- for (const i in this.elements) {
6598
+ for (let i = 0; i < this.elements.length; i++) {
6514
6599
  toggleClass(this.elements[i], this.cls, +i === active);
6515
6600
  }
6516
6601
 
@@ -6527,8 +6612,11 @@
6527
6612
  props: {
6528
6613
  position: String,
6529
6614
  top: null,
6530
- bottom: Boolean,
6615
+ bottom: null,
6616
+ start: null,
6617
+ end: null,
6531
6618
  offset: String,
6619
+ overflowFlip: Boolean,
6532
6620
  animation: String,
6533
6621
  clsActive: String,
6534
6622
  clsInactive: String,
@@ -6541,9 +6629,12 @@
6541
6629
 
6542
6630
  data: {
6543
6631
  position: 'top',
6544
- top: 0,
6632
+ top: false,
6545
6633
  bottom: false,
6634
+ start: false,
6635
+ end: false,
6546
6636
  offset: 0,
6637
+ overflowFlip: false,
6547
6638
  animation: '',
6548
6639
  clsActive: 'uk-active',
6549
6640
  clsInactive: '',
@@ -6565,6 +6656,9 @@
6565
6656
  },
6566
6657
 
6567
6658
  connected() {
6659
+ this.start = coerce(this.start || this.top);
6660
+ this.end = coerce(this.end || this.bottom);
6661
+
6568
6662
  this.placeholder =
6569
6663
  $('+ .uk-sticky-placeholder', this.$el) ||
6570
6664
  $('<div class="uk-sticky-placeholder"></div>');
@@ -6583,6 +6677,17 @@
6583
6677
  },
6584
6678
 
6585
6679
  events: [
6680
+ {
6681
+ name: 'resize',
6682
+
6683
+ el() {
6684
+ return window;
6685
+ },
6686
+
6687
+ handler() {
6688
+ this.$emit('resize');
6689
+ } },
6690
+
6586
6691
  {
6587
6692
  name: 'load hashchange popstate',
6588
6693
 
@@ -6599,7 +6704,7 @@
6599
6704
  return;
6600
6705
  }
6601
6706
 
6602
- fastdom.read(() => {
6707
+ setTimeout(() => {
6603
6708
  const targetOffset = offset($(location.hash));
6604
6709
  const elOffset = offset(this.$el);
6605
6710
 
@@ -6608,8 +6713,8 @@
6608
6713
  window,
6609
6714
  targetOffset.top -
6610
6715
  elOffset.height -
6611
- toPx(this.targetOffset, 'height') -
6612
- toPx(this.offset, 'height'));
6716
+ toPx(this.targetOffset, 'height', this.placeholder) -
6717
+ toPx(this.offset, 'height', this.placeholder));
6613
6718
 
6614
6719
  }
6615
6720
  });
@@ -6639,32 +6744,38 @@
6639
6744
 
6640
6745
  if (hide) {
6641
6746
  this.show();
6642
- fastdom.write(() => css(this.selTarget, 'transition', ''));
6747
+ requestAnimationFrame(() => css(this.selTarget, 'transition', ''));
6643
6748
  }
6644
6749
 
6645
6750
  const referenceElement = this.isFixed ? this.placeholder : this.$el;
6646
6751
  const windowHeight = height(window);
6647
6752
 
6648
6753
  let position = this.position;
6649
- if (position === 'auto' && height$1 > windowHeight) {
6650
- position = 'bottom';
6754
+ if (this.overflowFlip && height$1 > windowHeight) {
6755
+ position = position === 'top' ? 'bottom' : 'top';
6651
6756
  }
6652
6757
 
6653
6758
  let offset$1 = toPx(this.offset, 'height', referenceElement);
6654
- if (position === 'bottom') {
6759
+ if (position === 'bottom' && (height$1 < windowHeight || this.overflowFlip)) {
6655
6760
  offset$1 += windowHeight - height$1;
6656
6761
  }
6657
6762
 
6658
- const overflow = Math.max(0, height$1 + offset$1 - windowHeight);
6763
+ const overflow = this.overflowFlip ?
6764
+ 0 :
6765
+ Math.max(0, height$1 + offset$1 - windowHeight);
6659
6766
  const topOffset = offset(referenceElement).top;
6660
6767
 
6661
- const top = parseProp(this.top, this.$el, topOffset);
6662
- const bottom = parseProp(this.bottom, this.$el, topOffset + height$1, true);
6663
-
6664
- const start = Math.max(top, topOffset) - offset$1;
6665
- const end = bottom ?
6666
- bottom - offset(this.$el).height + overflow - offset$1 :
6667
- getScrollingElement(this.$el).scrollHeight - windowHeight;
6768
+ const start =
6769
+ (this.start === false ?
6770
+ topOffset :
6771
+ parseProp(this.start, this.$el, topOffset)) - offset$1;
6772
+ const end =
6773
+ this.end === false ?
6774
+ document.scrollingElement.scrollHeight - windowHeight :
6775
+ parseProp(this.end, this.$el, topOffset + height$1, true) -
6776
+ offset(this.$el).height +
6777
+ overflow -
6778
+ offset$1;
6668
6779
 
6669
6780
  return {
6670
6781
  start,
@@ -6710,7 +6821,9 @@
6710
6821
  prevDir,
6711
6822
  scroll,
6712
6823
  prevScroll,
6713
- offsetParentTop: offset(this.$el.offsetParent).top,
6824
+ offsetParentTop: offset(
6825
+ (this.isFixed ? this.placeholder : this.$el).offsetParent).
6826
+ top,
6714
6827
  overflowScroll: clamp(
6715
6828
  overflowScroll + clamp(scroll, start, end) - clamp(prevScroll, start, end),
6716
6829
  0,
@@ -6865,8 +6978,8 @@
6865
6978
  return 0;
6866
6979
  }
6867
6980
 
6868
- if (isString(value) && value.match(/^-?\d/)) {
6869
- return propOffset + toPx(value);
6981
+ if (isNumeric(value) || isString(value) && value.match(/^-?\d/)) {
6982
+ return propOffset + toPx(value, 'height', el, true);
6870
6983
  } else {
6871
6984
  const refElement = value === true ? parent(el) : query(value, el);
6872
6985
  return (
@@ -6878,6 +6991,15 @@
6878
6991
  }
6879
6992
  }
6880
6993
 
6994
+ function coerce(value) {
6995
+ if (value === 'true') {
6996
+ return true;
6997
+ } else if (value === 'false') {
6998
+ return false;
6999
+ }
7000
+ return value;
7001
+ }
7002
+
6881
7003
  var Switcher = {
6882
7004
  mixins: [Lazyload, Swipe, Togglable],
6883
7005
 
@@ -7186,15 +7308,7 @@
7186
7308
  {
7187
7309
  name: 'click',
7188
7310
 
7189
- filter() {
7190
- return includes(this.mode, 'click');
7191
- },
7192
-
7193
7311
  handler(e) {
7194
- if (this._preventClick) {
7195
- return this._preventClick = null;
7196
- }
7197
-
7198
7312
  let link;
7199
7313
  if (
7200
7314
  closest(e.target, 'a[href="#"], a[href=""]') ||
@@ -7205,6 +7319,14 @@
7205
7319
  e.preventDefault();
7206
7320
  }
7207
7321
 
7322
+ if (this._preventClick) {
7323
+ return this._preventClick = null;
7324
+ }
7325
+
7326
+ if (!includes(this.mode, 'click')) {
7327
+ return;
7328
+ }
7329
+
7208
7330
  this.toggle();
7209
7331
  } },
7210
7332
 
@@ -7330,9 +7452,6 @@
7330
7452
  // register components
7331
7453
  each(components$1, (component, name) => UIkit.component(name, component));
7332
7454
 
7333
- // core functionality
7334
- UIkit.use(Core);
7335
-
7336
7455
  boot(UIkit);
7337
7456
 
7338
7457
  const units = ['days', 'hours', 'minutes', 'seconds'];
@@ -9213,7 +9332,9 @@
9213
9332
 
9214
9333
  methods: {
9215
9334
  reset() {
9216
- each(this.getCss(0), (_, prop) => css(this.$el, prop, ''));
9335
+ for (const prop in this.getCss(0)) {
9336
+ css(this.$el, prop, '');
9337
+ }
9217
9338
  },
9218
9339
 
9219
9340
  getCss(percent) {
@@ -9227,12 +9348,16 @@
9227
9348
 
9228
9349
 
9229
9350
  function transformFn(prop, el, stops) {
9230
- const unit = getUnit(stops) || { x: 'px', y: 'px', rotate: 'deg' }[prop] || '';
9351
+ let unit = getUnit(stops) || { x: 'px', y: 'px', rotate: 'deg' }[prop] || '';
9231
9352
  let transformFn;
9232
9353
 
9233
9354
  if (prop === 'x' || prop === 'y') {
9234
9355
  prop = "translate" + ucfirst(prop);
9235
9356
  transformFn = (stop) => toFloat(toFloat(stop).toFixed(unit === 'px' ? 0 : 6));
9357
+ } else if (prop === 'scale') {
9358
+ unit = '';
9359
+ transformFn = (stop) =>
9360
+ getUnit([stop]) ? toPx(stop, 'width', el, true) / el.offsetWidth : stop;
9236
9361
  }
9237
9362
 
9238
9363
  if (stops.length === 1) {
@@ -9829,7 +9954,7 @@
9829
9954
  let left = 0;
9830
9955
  const sets = [];
9831
9956
  const width = dimensions$1(this.list).width;
9832
- for (let i in this.slides) {
9957
+ for (let i = 0; i < this.slides.length; i++) {
9833
9958
  const slideWidth = dimensions$1(this.slides[i]).width;
9834
9959
 
9835
9960
  if (left + slideWidth > width) {
@@ -10546,7 +10671,7 @@
10546
10671
  some((scrollEl) => {
10547
10672
  let { scrollTop: scroll, scrollHeight } = scrollEl;
10548
10673
 
10549
- const { top, bottom, height } = offset(getViewport$1(scrollEl));
10674
+ const { top, bottom, height } = offsetViewport(scrollEl);
10550
10675
 
10551
10676
  if (top < y && top + 35 > y) {
10552
10677
  scroll -= dist;
@@ -10749,10 +10874,12 @@
10749
10874
 
10750
10875
  this.positionAt(this.tooltip, this.$el);
10751
10876
 
10877
+ const [dir, align] = getAlignment(this.tooltip, this.$el, this.pos);
10878
+
10752
10879
  this.origin =
10753
- this.getAxis() === 'y' ?
10754
- flipPosition(this.dir) + "-" + this.align :
10755
- this.align + "-" + flipPosition(this.dir);
10880
+ this.axis === 'y' ?
10881
+ flipPosition(dir) + "-" + align :
10882
+ align + "-" + flipPosition(dir);
10756
10883
  });
10757
10884
 
10758
10885
  this.toggleElement(this.tooltip, true);
@@ -10789,6 +10916,37 @@
10789
10916
  }
10790
10917
  }
10791
10918
 
10919
+ function getAlignment(el, target, _ref) {let [dir, align] = _ref;
10920
+ const elOffset = offset(el);
10921
+ const targetOffset = offset(target);
10922
+ const properties = [
10923
+ ['left', 'right'],
10924
+ ['top', 'bottom']];
10925
+
10926
+
10927
+ for (const props of properties) {
10928
+ if (elOffset[props[0]] >= targetOffset[props[1]]) {
10929
+ dir = props[1];
10930
+ break;
10931
+ }
10932
+ if (elOffset[props[1]] <= targetOffset[props[0]]) {
10933
+ dir = props[0];
10934
+ break;
10935
+ }
10936
+ }
10937
+
10938
+ const props = includes(properties[0], dir) ? properties[1] : properties[0];
10939
+ if (elOffset[props[0]] === targetOffset[props[0]]) {
10940
+ align = props[0];
10941
+ } else if (elOffset[props[1]] === targetOffset[props[1]]) {
10942
+ align = props[1];
10943
+ } else {
10944
+ align = 'center';
10945
+ }
10946
+
10947
+ return [dir, align];
10948
+ }
10949
+
10792
10950
  var upload = {
10793
10951
  props: {
10794
10952
  allow: String,