uikit 3.13.10 → 3.13.11-dev.d3de726ee

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 (93) hide show
  1. package/CHANGELOG.md +29 -1
  2. package/dist/css/uikit-core-rtl.css +46 -8
  3. package/dist/css/uikit-core-rtl.min.css +1 -1
  4. package/dist/css/uikit-core.css +46 -8
  5. package/dist/css/uikit-core.min.css +1 -1
  6. package/dist/css/uikit-rtl.css +46 -6
  7. package/dist/css/uikit-rtl.min.css +1 -1
  8. package/dist/css/uikit.css +46 -6
  9. package/dist/css/uikit.min.css +1 -1
  10. package/dist/js/components/countdown.js +1 -1
  11. package/dist/js/components/countdown.min.js +1 -1
  12. package/dist/js/components/filter.js +1 -1
  13. package/dist/js/components/filter.min.js +1 -1
  14. package/dist/js/components/lightbox-panel.js +7 -3
  15. package/dist/js/components/lightbox-panel.min.js +1 -1
  16. package/dist/js/components/lightbox.js +7 -3
  17. package/dist/js/components/lightbox.min.js +1 -1
  18. package/dist/js/components/notification.js +1 -1
  19. package/dist/js/components/notification.min.js +1 -1
  20. package/dist/js/components/parallax.js +18 -11
  21. package/dist/js/components/parallax.min.js +1 -1
  22. package/dist/js/components/slider-parallax.js +18 -11
  23. package/dist/js/components/slider-parallax.min.js +1 -1
  24. package/dist/js/components/slider.js +2 -2
  25. package/dist/js/components/slider.min.js +1 -1
  26. package/dist/js/components/slideshow-parallax.js +18 -11
  27. package/dist/js/components/slideshow-parallax.min.js +1 -1
  28. package/dist/js/components/slideshow.js +1 -1
  29. package/dist/js/components/slideshow.min.js +1 -1
  30. package/dist/js/components/sortable.js +2 -2
  31. package/dist/js/components/sortable.min.js +1 -1
  32. package/dist/js/components/tooltip.js +62 -30
  33. package/dist/js/components/tooltip.min.js +1 -1
  34. package/dist/js/components/upload.js +1 -1
  35. package/dist/js/components/upload.min.js +1 -1
  36. package/dist/js/uikit-core.js +348 -255
  37. package/dist/js/uikit-core.min.js +1 -1
  38. package/dist/js/uikit-icons.js +1 -1
  39. package/dist/js/uikit-icons.min.js +1 -1
  40. package/dist/js/uikit.js +392 -262
  41. package/dist/js/uikit.min.js +1 -1
  42. package/package.json +1 -1
  43. package/src/js/components/slider.js +1 -1
  44. package/src/js/components/sortable.js +2 -3
  45. package/src/js/components/tooltip.js +38 -3
  46. package/src/js/core/drop.js +20 -10
  47. package/src/js/core/navbar.js +18 -6
  48. package/src/js/core/scrollspy-nav.js +6 -11
  49. package/src/js/core/sticky.js +55 -21
  50. package/src/js/mixin/media.js +12 -9
  51. package/src/js/mixin/modal.js +6 -2
  52. package/src/js/mixin/parallax.js +5 -1
  53. package/src/js/mixin/position.js +24 -24
  54. package/src/js/uikit-core.js +0 -4
  55. package/src/js/util/lang.js +0 -4
  56. package/src/js/util/position.js +177 -125
  57. package/src/js/util/viewport.js +42 -22
  58. package/src/less/components/drop.less +0 -1
  59. package/src/less/components/dropdown.less +11 -1
  60. package/src/less/components/icon.less +3 -0
  61. package/src/less/components/nav.less +22 -0
  62. package/src/less/components/navbar.less +26 -2
  63. package/src/less/components/search.less +2 -0
  64. package/src/less/components/sticky.less +8 -3
  65. package/src/less/theme/dropdown.less +4 -0
  66. package/src/less/theme/nav.less +6 -0
  67. package/src/less/theme/navbar.less +4 -0
  68. package/src/less/theme/search.less +6 -0
  69. package/src/scss/components/drop.scss +0 -1
  70. package/src/scss/components/dropdown.scss +11 -1
  71. package/src/scss/components/icon.scss +3 -0
  72. package/src/scss/components/nav.scss +22 -0
  73. package/src/scss/components/navbar.scss +26 -2
  74. package/src/scss/components/search.scss +2 -0
  75. package/src/scss/components/sticky.scss +8 -3
  76. package/src/scss/mixins-theme.scss +5 -0
  77. package/src/scss/mixins.scss +5 -0
  78. package/src/scss/theme/dropdown.scss +4 -0
  79. package/src/scss/theme/nav.scss +6 -0
  80. package/src/scss/theme/navbar.scss +4 -0
  81. package/src/scss/theme/search.scss +6 -0
  82. package/src/scss/variables-theme.scss +5 -1
  83. package/src/scss/variables.scss +5 -1
  84. package/tests/animation.html +216 -214
  85. package/tests/dropdown.html +16 -2
  86. package/tests/nav.html +27 -0
  87. package/tests/navbar.html +55 -4
  88. package/tests/parallax.html +4 -4
  89. package/tests/position.html +38 -39
  90. package/tests/sticky-navbar.html +6 -6
  91. package/tests/sticky-parallax.html +23 -7
  92. package/tests/sticky.html +300 -49
  93. package/src/js/core/core.js +0 -25
@@ -1,4 +1,4 @@
1
- /*! UIkit 3.13.10 | https://www.getuikit.com | (c) 2014 - 2022 YOOtheme | MIT License */
1
+ /*! UIkit 3.13.11-dev.d3de726ee | 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 ||
@@ -1788,7 +1784,7 @@
1788
1784
  return intersectRect(
1789
1785
  ...scrollParents(element).
1790
1786
  map((parent) => {
1791
- const { top, left, bottom, right } = offset(getViewport$1(parent));
1787
+ const { top, left, bottom, right } = offsetViewport(parent);
1792
1788
 
1793
1789
  return {
1794
1790
  top: top - offsetTop,
@@ -1803,7 +1799,7 @@
1803
1799
 
1804
1800
  function scrollTop(element, top) {
1805
1801
  if (isWindow(element) || isDocument(element)) {
1806
- element = getScrollingElement(element);
1802
+ element = scrollingElement(element);
1807
1803
  } else {
1808
1804
  element = toNode(element);
1809
1805
  }
@@ -1820,12 +1816,13 @@
1820
1816
  return parents.reduce(
1821
1817
  (fn, scrollElement, i) => {
1822
1818
  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);
1819
+ const viewport = offsetViewport(scrollElement);
1820
+ const maxScroll = scrollHeight - viewport.height;
1821
+ const { height: elHeight, top: elTop } = parents[i - 1] ?
1822
+ offsetViewport(parents[i - 1]) :
1823
+ offset(element);
1828
1824
 
1825
+ let top = Math.ceil(elTop - viewport.top - offsetBy + scrollTop);
1829
1826
 
1830
1827
  if (offsetBy > 0 && offsetHeight < elHeight + offsetBy) {
1831
1828
  top += offsetBy;
@@ -1883,7 +1880,7 @@
1883
1880
 
1884
1881
  const [scrollElement] = scrollParents(element, /auto|scroll/, true);
1885
1882
  const { scrollHeight, scrollTop } = scrollElement;
1886
- const viewportHeight = getViewportClientHeight(scrollElement);
1883
+ const { height: viewportHeight } = offsetViewport(scrollElement);
1887
1884
  const maxScroll = scrollHeight - viewportHeight;
1888
1885
  const elementOffsetTop = offsetPosition(element)[0] - offsetPosition(scrollElement)[0];
1889
1886
 
@@ -1894,7 +1891,7 @@
1894
1891
  }
1895
1892
 
1896
1893
  function scrollParents(element, overflowRe, scrollable) {if (overflowRe === void 0) {overflowRe = /auto|scroll|hidden/;}if (scrollable === void 0) {scrollable = false;}
1897
- const scrollEl = getScrollingElement(element);
1894
+ const scrollEl = scrollingElement(element);
1898
1895
 
1899
1896
  let ancestors = parents(element).reverse();
1900
1897
  ancestors = ancestors.slice(ancestors.indexOf(scrollEl) + 1);
@@ -1909,181 +1906,250 @@
1909
1906
  ancestors.filter(
1910
1907
  (parent) =>
1911
1908
  overflowRe.test(css(parent, 'overflow')) && (
1912
- !scrollable || parent.scrollHeight > getViewportClientHeight(parent)))).
1909
+ !scrollable || parent.scrollHeight > offsetViewport(parent).height))).
1913
1910
 
1914
1911
 
1915
1912
  reverse();
1916
1913
  }
1917
1914
 
1918
- function getViewport$1(scrollElement) {
1919
- return scrollElement === getScrollingElement(scrollElement) ? window : scrollElement;
1915
+ function offsetViewport(scrollElement) {
1916
+ let viewportElement = getViewport$1(scrollElement);
1917
+
1918
+ // iOS 12 returns <body> as scrollingElement
1919
+ if (viewportElement === scrollingElement(viewportElement)) {
1920
+ viewportElement = document.documentElement;
1921
+ }
1922
+
1923
+ let rect = offset(viewportElement);
1924
+ for (let [prop, dir, start, end] of [
1925
+ ['width', 'x', 'left', 'right'],
1926
+ ['height', 'y', 'top', 'bottom']])
1927
+ {
1928
+ if (!isWindow(getViewport$1(viewportElement))) {
1929
+ rect[start] += toFloat(css(viewportElement, "border" + ucfirst(start) + "Width"));
1930
+ }
1931
+ rect[prop] = rect[dir] = (
1932
+ isWindow(viewportElement) ? scrollingElement(viewportElement) : viewportElement)["client" +
1933
+ ucfirst(prop)];
1934
+ rect[end] = rect[prop] + rect[start];
1935
+ }
1936
+ return rect;
1920
1937
  }
1921
1938
 
1922
- // iOS 12 returns <body> as scrollingElement
1923
- function getViewportClientHeight(scrollElement) {
1924
- return (
1925
- scrollElement === getScrollingElement(scrollElement) ?
1926
- document.documentElement :
1927
- scrollElement).
1928
- clientHeight;
1939
+ function scrollingElement(element) {
1940
+ const {
1941
+ document: { scrollingElement } } =
1942
+ toWindow(element);
1943
+ return scrollingElement;
1929
1944
  }
1930
1945
 
1931
- function getScrollingElement(element) {
1932
- const { document } = toWindow(element);
1933
- return document.scrollingElement || document.documentElement;
1946
+ function getViewport$1(scrollElement) {
1947
+ return scrollElement === scrollingElement(scrollElement) ? window : scrollElement;
1934
1948
  }
1935
1949
 
1936
- const dirs = {
1937
- width: ['x', 'left', 'right'],
1938
- height: ['y', 'top', 'bottom'] };
1950
+ const dirs = [
1951
+ ['width', 'x', 'left', 'right'],
1952
+ ['height', 'y', 'top', 'bottom']];
1939
1953
 
1940
1954
 
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);
1955
+ function positionAt(element, target, options) {
1956
+ options = {
1957
+ attach: {
1958
+ element: ['left', 'top'],
1959
+ target: ['left', 'top'],
1960
+ ...options.attach },
1961
+
1962
+ offset: [0, 0],
1963
+ ...options };
1953
1964
 
1954
- const flipped = { element: elAttach, target: targetAttach };
1955
1965
 
1956
- if (!element || !target) {
1957
- return flipped;
1966
+ const dim = options.flip ?
1967
+ attachToWithFlip(element, target, options) :
1968
+ attachTo(element, target, options);
1969
+
1970
+ offset(element, dim);
1971
+ }
1972
+
1973
+ function attachTo(element, target, options) {
1974
+ let { attach, offset: offsetBy } = {
1975
+ attach: {
1976
+ element: ['left', 'top'],
1977
+ target: ['left', 'top'],
1978
+ ...options.attach },
1979
+
1980
+ offset: [0, 0],
1981
+ ...options };
1982
+
1983
+
1984
+ const position = offset(element);
1985
+ const targetOffset = offset(target);
1986
+ for (const [i, [prop, dir, start, end]] of Object.entries(dirs)) {
1987
+ position[start] = position[dir] =
1988
+ targetOffset[start] +
1989
+ moveBy(attach.target[i], end, targetOffset[prop]) -
1990
+ moveBy(attach.element[i], end, position[prop]) +
1991
+ +offsetBy[i];
1992
+ position[end] = position[start] + position[prop];
1958
1993
  }
1994
+ return position;
1995
+ }
1959
1996
 
1960
- const dim = offset(element);
1997
+ function attachToWithFlip(element, target, options) {
1998
+ const position = attachTo(element, target, options);
1961
1999
  const targetDim = offset(target);
1962
- const position = targetDim;
2000
+ const viewports = scrollParents(element, /auto|scroll/);
2001
+ const [scrollElement] = viewports;
2002
+
2003
+ let {
2004
+ flip,
2005
+ attach: { element: elAttach, target: targetAttach },
2006
+ offset: elOffset,
2007
+ boundary,
2008
+ viewport,
2009
+ viewportPadding } =
2010
+ options;
2011
+
2012
+ viewports.push(viewport);
2013
+
2014
+ const offsetPosition = { ...position };
2015
+ for (const [i, [prop, dir, start, end]] of Object.entries(dirs)) {
2016
+ if (flip !== true && !includes(flip, dir)) {
2017
+ continue;
2018
+ }
1963
2019
 
1964
- moveTo(position, elAttach, dim, -1);
1965
- moveTo(position, targetAttach, targetDim, 1);
2020
+ const willFlip =
2021
+ !intersectLine(position, targetDim, i) && intersectLine(position, targetDim, 1 - i);
1966
2022
 
1967
- elOffset = getOffsets(elOffset, dim.width, dim.height);
1968
- targetOffset = getOffsets(targetOffset, targetDim.width, targetDim.height);
2023
+ viewport = getIntersectionArea(...viewports.filter(Boolean).map(offsetViewport));
1969
2024
 
1970
- elOffset['x'] += targetOffset['x'];
1971
- elOffset['y'] += targetOffset['y'];
2025
+ if (viewportPadding) {
2026
+ viewport[start] += viewportPadding;
2027
+ viewport[end] -= viewportPadding;
2028
+ }
1972
2029
 
1973
- position.left += elOffset['x'];
1974
- position.top += elOffset['y'];
2030
+ if (boundary && !(willFlip || position[prop] > offset(boundary)[prop])) {
2031
+ viewport = getIntersectionArea(viewport, offset(boundary));
2032
+ }
1975
2033
 
1976
- if (flip) {
1977
- let boundaries = scrollParents(element).map(getViewport$1);
2034
+ const isInStartBoundary = position[start] >= viewport[start];
2035
+ const isInEndBoundary = position[end] <= viewport[end];
1978
2036
 
1979
- if (boundary && !includes(boundaries, boundary)) {
1980
- boundaries.unshift(boundary);
2037
+ if (isInStartBoundary && isInEndBoundary) {
2038
+ continue;
1981
2039
  }
1982
2040
 
1983
- boundaries = boundaries.map((el) => offset(el));
2041
+ let offsetBy;
1984
2042
 
1985
- each(dirs, (_ref, prop) => {let [dir, align, alignFlip] = _ref;
1986
- if (!(flip === true || includes(flip, dir))) {
1987
- return;
2043
+ // Flip
2044
+ if (willFlip) {
2045
+ if (
2046
+ elAttach[i] === end && isInStartBoundary ||
2047
+ elAttach[i] === start && isInEndBoundary)
2048
+ {
2049
+ continue;
1988
2050
  }
1989
2051
 
1990
- boundaries.some((boundary) => {
1991
- const elemOffset =
1992
- elAttach[dir] === align ?
1993
- -dim[prop] :
1994
- elAttach[dir] === alignFlip ?
1995
- dim[prop] :
1996
- 0;
2052
+ offsetBy =
2053
+ (elAttach[i] === start ?
2054
+ -position[prop] :
2055
+ elAttach[i] === end ?
2056
+ position[prop] :
2057
+ 0) + (
2058
+ targetAttach[i] === start ?
2059
+ targetDim[prop] :
2060
+ targetAttach[i] === end ?
2061
+ -targetDim[prop] :
2062
+ 0) -
2063
+ elOffset[i] * 2;
1997
2064
 
1998
- const targetOffset =
1999
- targetAttach[dir] === align ?
2000
- targetDim[prop] :
2001
- targetAttach[dir] === alignFlip ?
2002
- -targetDim[prop] :
2003
- 0;
2004
-
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;
2065
+ if (
2066
+ !isInScrollArea(
2067
+ {
2068
+ ...position,
2069
+ [start]: position[start] + offsetBy,
2070
+ [end]: position[end] + offsetBy },
2012
2071
 
2013
- return (
2014
- elAttach[dir] === 'center' && (
2015
- apply(centerOffset, centerTargetOffset) ||
2016
- apply(-centerOffset, -centerTargetOffset)) ||
2017
- apply(elemOffset, targetOffset));
2072
+ scrollElement,
2073
+ i))
2018
2074
 
2075
+ {
2076
+ if (isInScrollArea(position, scrollElement, i)) {
2077
+ continue;
2019
2078
  }
2020
2079
 
2021
- function apply(elemOffset, targetOffset) {
2022
- const newVal = toFloat(
2023
- (position[align] + elemOffset + targetOffset - elOffset[dir] * 2).toFixed(4));
2080
+ if (options.recursion) {
2081
+ return false;
2082
+ }
2024
2083
 
2084
+ const newPos = attachToWithFlip(element, target, {
2085
+ ...options,
2086
+ attach: {
2087
+ element: elAttach.map(flipDir).reverse(),
2088
+ target: targetAttach.map(flipDir).reverse() },
2025
2089
 
2026
- if (newVal >= boundary[align] && newVal + dim[prop] <= boundary[alignFlip]) {
2027
- position[align] = newVal;
2090
+ offset: elOffset.reverse(),
2091
+ flip: flip === true ? flip : [...flip, dirs[1 - i][1]],
2092
+ recursion: true });
2028
2093
 
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
2094
 
2038
- return true;
2039
- }
2095
+ if (newPos && isInScrollArea(newPos, scrollElement, 1 - i)) {
2096
+ return newPos;
2040
2097
  }
2041
- });
2042
- });
2043
- }
2098
+ }
2044
2099
 
2045
- offset(element, position);
2100
+ // Move
2101
+ } else {
2102
+ offsetBy =
2103
+ clamp(
2104
+ clamp(position[start], viewport[start], viewport[end] - position[prop]),
2105
+ targetDim[start] - position[prop] + elOffset[i],
2106
+ targetDim[end] - elOffset[i]) -
2107
+ position[start];
2108
+ }
2046
2109
 
2047
- return flipped;
2048
- }
2110
+ offsetPosition[start] = position[dir] = position[start] + offsetBy;
2111
+ offsetPosition[end] += offsetBy;
2112
+ }
2049
2113
 
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
- });
2114
+ return offsetPosition;
2058
2115
  }
2059
2116
 
2060
- function getPos(pos) {
2061
- const x = /left|center|right/;
2062
- const y = /top|center|bottom/;
2063
-
2064
- pos = (pos || '').split(' ');
2117
+ function moveBy(start, end, dim) {
2118
+ return start === 'center' ? dim / 2 : start === end ? dim : 0;
2119
+ }
2065
2120
 
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'];
2121
+ function getIntersectionArea() {
2122
+ let area = {};for (var _len = arguments.length, rects = new Array(_len), _key = 0; _key < _len; _key++) {rects[_key] = arguments[_key];}
2123
+ for (const rect of rects) {
2124
+ for (const [,, start, end] of dirs) {
2125
+ area[start] = Math.max(area[start] || 0, rect[start]);
2126
+ area[end] = Math.min(...[area[end], rect[end]].filter(Boolean));
2127
+ }
2072
2128
  }
2129
+ return area;
2130
+ }
2073
2131
 
2074
- return {
2075
- x: x.test(pos[0]) ? pos[0] : 'center',
2076
- y: y.test(pos[1]) ? pos[1] : 'center' };
2132
+ function isInScrollArea(position, scrollElement, dir) {
2133
+ const viewport = offsetViewport(scrollElement);
2134
+ const [prop,, start, end] = dirs[dir];
2135
+ viewport[start] -= scrollElement["scroll" + ucfirst(start)];
2136
+ viewport[end] = viewport[start] + scrollElement["scroll" + ucfirst(prop)];
2077
2137
 
2138
+ return position[start] >= viewport[start] && position[end] <= viewport[end];
2078
2139
  }
2079
2140
 
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 };
2141
+ function intersectLine(dimA, dimB, dir) {
2142
+ const [,, start, end] = dirs[dir];
2143
+ return dimA[end] > dimB[start] && dimB[end] > dimA[start];
2144
+ }
2086
2145
 
2146
+ function flipDir(prop) {
2147
+ for (let i = 0; i < dirs.length; i++) {
2148
+ const index = dirs[i].indexOf(prop);
2149
+ if (~index) {
2150
+ return dirs[1 - i][index % 2 + 2];
2151
+ }
2152
+ }
2087
2153
  }
2088
2154
 
2089
2155
  var util = /*#__PURE__*/Object.freeze({
@@ -2192,7 +2258,6 @@
2192
2258
  toNode: toNode,
2193
2259
  toNodes: toNodes,
2194
2260
  toWindow: toWindow,
2195
- toMs: toMs,
2196
2261
  isEqual: isEqual,
2197
2262
  swap: swap,
2198
2263
  last: last,
@@ -2231,9 +2296,7 @@
2231
2296
  scrollIntoView: scrollIntoView,
2232
2297
  scrolledOver: scrolledOver,
2233
2298
  scrollParents: scrollParents,
2234
- getViewport: getViewport$1,
2235
- getViewportClientHeight: getViewportClientHeight,
2236
- getScrollingElement: getScrollingElement
2299
+ offsetViewport: offsetViewport
2237
2300
  });
2238
2301
 
2239
2302
  function globalAPI (UIkit) {
@@ -2550,7 +2613,7 @@
2550
2613
  continue;
2551
2614
  }
2552
2615
 
2553
- value = props[key] === Boolean && value === '' ? true : coerce(props[key], value);
2616
+ value = props[key] === Boolean && value === '' ? true : coerce$1(props[key], value);
2554
2617
 
2555
2618
  if (prop === 'target' && (!value || startsWith(value, '_'))) {
2556
2619
  continue;
@@ -2564,7 +2627,7 @@
2564
2627
  for (const key in options) {
2565
2628
  const prop = camelize(key);
2566
2629
  if (props[prop] !== undefined) {
2567
- data$1[prop] = coerce(props[prop], options[key]);
2630
+ data$1[prop] = coerce$1(props[prop], options[key]);
2568
2631
  }
2569
2632
  }
2570
2633
 
@@ -2629,7 +2692,7 @@
2629
2692
  return options.every((arr) => !arr || !hasOwn(arr, key));
2630
2693
  }
2631
2694
 
2632
- function coerce(type, value) {
2695
+ function coerce$1(type, value) {
2633
2696
  if (type === Boolean) {
2634
2697
  return toBoolean(value);
2635
2698
  } else if (type === Number) {
@@ -2667,7 +2730,7 @@
2667
2730
  if (isUndefined(data[key])) {
2668
2731
  delete data[key];
2669
2732
  } else if (props[key]) {
2670
- data[key] = coerce(props[key], data[key]);
2733
+ data[key] = coerce$1(props[key], data[key]);
2671
2734
  }
2672
2735
  }
2673
2736
 
@@ -2892,7 +2955,7 @@
2892
2955
  UIkit.data = '__uikit__';
2893
2956
  UIkit.prefix = 'uk-';
2894
2957
  UIkit.options = {};
2895
- UIkit.version = '3.13.10';
2958
+ UIkit.version = '3.13.11-dev.d3de726ee';
2896
2959
 
2897
2960
  globalAPI(UIkit);
2898
2961
  hooksAPI(UIkit);
@@ -2900,30 +2963,6 @@
2900
2963
  componentAPI(UIkit);
2901
2964
  instanceAPI(UIkit);
2902
2965
 
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
2966
  function boot (UIkit) {
2928
2967
  const { connect, disconnect } = UIkit;
2929
2968
 
@@ -3501,50 +3540,49 @@
3501
3540
  data: {
3502
3541
  pos: "bottom-" + (isRtl ? 'right' : 'left'),
3503
3542
  flip: true,
3504
- offset: false },
3543
+ offset: false,
3544
+ viewportPadding: 10 },
3505
3545
 
3506
3546
 
3507
3547
  connected() {
3508
3548
  this.pos = this.$props.pos.split('-').concat('center').slice(0, 2);
3509
- this.dir = this.pos[0];
3510
- this.align = this.pos[1];
3549
+ this.axis = includes(['top', 'bottom'], this.pos[0]) ? 'y' : 'x';
3511
3550
  },
3512
3551
 
3513
3552
  methods: {
3514
3553
  positionAt(element, target, boundary) {
3515
- const axis = this.getAxis();
3516
- const dir = this.pos[0];
3517
- const align = this.pos[1];
3554
+ const [dir, align] = this.pos;
3518
3555
 
3519
3556
  let { offset: offset$1 } = this;
3520
3557
  if (!isNumeric(offset$1)) {
3521
3558
  const node = $(offset$1);
3522
3559
  offset$1 = node ?
3523
- offset(node)[axis === 'x' ? 'left' : 'top'] -
3524
- offset(target)[axis === 'x' ? 'right' : 'bottom'] :
3560
+ offset(node)[this.axis === 'x' ? 'left' : 'top'] -
3561
+ offset(target)[this.axis === 'x' ? 'right' : 'bottom'] :
3525
3562
  0;
3526
3563
  }
3527
3564
  offset$1 = toPx(offset$1) + toPx(getCssVar('position-offset', element));
3565
+ offset$1 = [includes(['left', 'top'], dir) ? -offset$1 : +offset$1, 0];
3528
3566
 
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
- },
3567
+ const attach = {
3568
+ element: [flipPosition(dir), align],
3569
+ target: [dir, align] };
3570
+
3571
+
3572
+ if (this.axis === 'y') {
3573
+ for (const prop in attach) {
3574
+ attach[prop] = attach[prop].reverse();
3575
+ }
3576
+ offset$1 = offset$1.reverse();
3577
+ }
3578
+
3579
+ positionAt(element, target, {
3580
+ attach,
3581
+ offset: offset$1,
3582
+ boundary,
3583
+ viewportPadding: this.viewportPadding,
3584
+ flip: this.flip });
3545
3585
 
3546
- getAxis() {
3547
- return this.dir === 'top' || this.dir === 'bottom' ? 'y' : 'x';
3548
3586
  } } };
3549
3587
 
3550
3588
  let active$1;
@@ -3872,25 +3910,33 @@
3872
3910
  },
3873
3911
 
3874
3912
  position() {
3875
- const boundary = query(this.boundary, this.$el) || window;
3876
3913
  removeClass(this.$el, this.clsDrop + "-stack");
3877
3914
  toggleClass(this.$el, this.clsDrop + "-boundary", this.boundaryAlign);
3878
3915
 
3879
- const boundaryOffset = offset(boundary);
3880
- const targetOffset = offset(this.target);
3881
- const alignTo = this.boundaryAlign ? boundaryOffset : targetOffset;
3916
+ const boundary = query(this.boundary, this.$el);
3917
+ const [scrollParent] = scrollParents(this.$el);
3918
+ const scrollParentOffset = offsetViewport(scrollParent);
3919
+ const boundaryOffset = boundary ? offset(boundary) : scrollParentOffset;
3920
+
3921
+ css(this.$el, 'maxWidth', '');
3922
+ const maxWidth = scrollParentOffset.width - (boundary ? 0 : 2 * this.viewportPadding);
3882
3923
 
3883
3924
  if (this.pos[1] === 'justify') {
3884
- const prop = this.getAxis() === 'y' ? 'width' : 'height';
3925
+ const prop = this.axis === 'y' ? 'width' : 'height';
3926
+ const targetOffset = offset(this.target);
3927
+ const alignTo = this.boundaryAlign ? boundaryOffset : targetOffset;
3885
3928
  css(this.$el, prop, alignTo[prop]);
3886
- } else if (
3887
- this.$el.offsetWidth >
3888
- Math.max(boundaryOffset.right - alignTo.left, alignTo.right - boundaryOffset.left))
3889
- {
3929
+ } else if (this.$el.offsetWidth > maxWidth) {
3890
3930
  addClass(this.$el, this.clsDrop + "-stack");
3891
3931
  }
3892
3932
 
3893
- this.positionAt(this.$el, this.boundaryAlign ? boundary : this.target, boundary);
3933
+ css(this.$el, 'maxWidth', maxWidth);
3934
+
3935
+ this.positionAt(
3936
+ this.$el,
3937
+ boundary && this.boundaryAlign ? boundary : this.target,
3938
+ boundary);
3939
+
3894
3940
  } } };
3895
3941
 
3896
3942
 
@@ -4994,16 +5040,19 @@
4994
5040
 
4995
5041
  connected() {
4996
5042
  const media = toMedia(this.media);
4997
- this.mediaObj = window.matchMedia(media);
4998
- const handler = () => {
4999
- this.matchMedia = this.mediaObj.matches;
5000
- trigger(this.$el, createEvent('mediachange', false, true, [this.mediaObj]));
5001
- };
5002
- this.offMediaObj = on(this.mediaObj, 'change', () => {
5043
+ this.matchMedia = true;
5044
+ if (media) {
5045
+ this.mediaObj = window.matchMedia(media);
5046
+ const handler = () => {
5047
+ this.matchMedia = this.mediaObj.matches;
5048
+ trigger(this.$el, createEvent('mediachange', false, true, [this.mediaObj]));
5049
+ };
5050
+ this.offMediaObj = on(this.mediaObj, 'change', () => {
5051
+ handler();
5052
+ this.$emit('resize');
5053
+ });
5003
5054
  handler();
5004
- this.$emit('resize');
5005
- });
5006
- handler();
5055
+ }
5007
5056
  },
5008
5057
 
5009
5058
  disconnected() {var _this$offMediaObj;
@@ -5292,7 +5341,7 @@
5292
5341
  return (el, show) =>
5293
5342
  new Promise((resolve, reject) =>
5294
5343
  once(el, 'show hide', () => {
5295
- el._reject && el._reject();
5344
+ el._reject == null ? void 0 : el._reject();
5296
5345
  el._reject = reject;
5297
5346
 
5298
5347
  _toggle(el, show);
@@ -5317,6 +5366,10 @@
5317
5366
  then(() => delete el._reject);
5318
5367
  }
5319
5368
 
5369
+ function toMs(time) {
5370
+ return time ? endsWith(time, 'ms') ? toFloat(time) : toFloat(time) * 1000 : 0;
5371
+ }
5372
+
5320
5373
  var modal = {
5321
5374
  install,
5322
5375
 
@@ -5470,8 +5523,6 @@
5470
5523
  toggle: '> a',
5471
5524
  content: '> ul' } };
5472
5525
 
5473
- const navItem = '.uk-navbar-nav > li > a, .uk-navbar-item, .uk-navbar-toggle';
5474
-
5475
5526
  var navbar = {
5476
5527
  mixins: [Class, Container],
5477
5528
 
@@ -5491,7 +5542,7 @@
5491
5542
 
5492
5543
 
5493
5544
  data: {
5494
- dropdown: navItem,
5545
+ dropdown: '.uk-navbar-nav > li > a, .uk-navbar-item, .uk-navbar-toggle',
5495
5546
  align: isRtl ? 'right' : 'left',
5496
5547
  clsDrop: 'uk-navbar-dropdown',
5497
5548
  mode: undefined,
@@ -5577,9 +5628,23 @@
5577
5628
  immediate: true },
5578
5629
 
5579
5630
 
5580
- toggles(_ref6, $el) {let { dropdown } = _ref6;
5581
- return $$(dropdown, $el);
5582
- } },
5631
+ toggles: {
5632
+ get(_ref6, $el) {let { dropdown } = _ref6;
5633
+ return $$(dropdown, $el);
5634
+ },
5635
+
5636
+ watch() {
5637
+ const justify = hasClass(this.$el, 'uk-navbar-justify');
5638
+ for (const container of $$(
5639
+ '.uk-navbar-nav, .uk-navbar-left, .uk-navbar-right',
5640
+ this.$el))
5641
+ {
5642
+ css(container, 'flexGrow', justify ? $$(this.dropdown, container).length : '');
5643
+ }
5644
+ },
5645
+
5646
+ immediate: true } },
5647
+
5583
5648
 
5584
5649
 
5585
5650
  disconnected() {
@@ -5740,7 +5805,7 @@
5740
5805
  return this.dropbar;
5741
5806
  },
5742
5807
 
5743
- handler(_, _ref10) {let { $el, dir } = _ref10;
5808
+ handler(_, _ref10) {let { $el, pos: [dir] = [] } = _ref10;
5744
5809
  if (!hasClass($el, this.clsDrop)) {
5745
5810
  return;
5746
5811
  }
@@ -6474,19 +6539,15 @@
6474
6539
 
6475
6540
  const [scrollElement] = scrollParents(targets, /auto|scroll/, true);
6476
6541
  const { scrollTop, scrollHeight } = scrollElement;
6477
- const max = scrollHeight - getViewportClientHeight(scrollElement);
6542
+ const viewport = offsetViewport(scrollElement);
6543
+ const max = scrollHeight - viewport.height;
6478
6544
  let active = false;
6479
6545
 
6480
6546
  if (scrollTop === max) {
6481
6547
  active = length - 1;
6482
6548
  } else {
6483
- for (const i in targets) {
6484
- if (
6485
- offset(targets[i]).top -
6486
- offset(getViewport$1(scrollElement)).top -
6487
- this.offset >
6488
- 0)
6489
- {
6549
+ for (let i = 0; i < targets.length; i++) {
6550
+ if (offset(targets[i]).top - viewport.top - this.offset > 0) {
6490
6551
  break;
6491
6552
  }
6492
6553
  active = +i;
@@ -6504,7 +6565,7 @@
6504
6565
  const changed = active !== false && !hasClass(this.elements[active], this.cls);
6505
6566
 
6506
6567
  this.links.forEach((el) => el.blur());
6507
- for (const i in this.elements) {
6568
+ for (let i = 0; i < this.elements.length; i++) {
6508
6569
  toggleClass(this.elements[i], this.cls, +i === active);
6509
6570
  }
6510
6571
 
@@ -6521,8 +6582,11 @@
6521
6582
  props: {
6522
6583
  position: String,
6523
6584
  top: null,
6524
- bottom: Boolean,
6585
+ bottom: null,
6586
+ start: null,
6587
+ end: null,
6525
6588
  offset: String,
6589
+ overflowFlip: Boolean,
6526
6590
  animation: String,
6527
6591
  clsActive: String,
6528
6592
  clsInactive: String,
@@ -6535,9 +6599,12 @@
6535
6599
 
6536
6600
  data: {
6537
6601
  position: 'top',
6538
- top: 0,
6602
+ top: false,
6539
6603
  bottom: false,
6604
+ start: false,
6605
+ end: false,
6540
6606
  offset: 0,
6607
+ overflowFlip: false,
6541
6608
  animation: '',
6542
6609
  clsActive: 'uk-active',
6543
6610
  clsInactive: '',
@@ -6559,6 +6626,9 @@
6559
6626
  },
6560
6627
 
6561
6628
  connected() {
6629
+ this.start = coerce(this.start || this.top);
6630
+ this.end = coerce(this.end || this.bottom);
6631
+
6562
6632
  this.placeholder =
6563
6633
  $('+ .uk-sticky-placeholder', this.$el) ||
6564
6634
  $('<div class="uk-sticky-placeholder"></div>');
@@ -6577,6 +6647,17 @@
6577
6647
  },
6578
6648
 
6579
6649
  events: [
6650
+ {
6651
+ name: 'resize',
6652
+
6653
+ el() {
6654
+ return window;
6655
+ },
6656
+
6657
+ handler() {
6658
+ this.$emit('resize');
6659
+ } },
6660
+
6580
6661
  {
6581
6662
  name: 'load hashchange popstate',
6582
6663
 
@@ -6593,7 +6674,7 @@
6593
6674
  return;
6594
6675
  }
6595
6676
 
6596
- fastdom.read(() => {
6677
+ setTimeout(() => {
6597
6678
  const targetOffset = offset($(location.hash));
6598
6679
  const elOffset = offset(this.$el);
6599
6680
 
@@ -6602,8 +6683,8 @@
6602
6683
  window,
6603
6684
  targetOffset.top -
6604
6685
  elOffset.height -
6605
- toPx(this.targetOffset, 'height') -
6606
- toPx(this.offset, 'height'));
6686
+ toPx(this.targetOffset, 'height', this.placeholder) -
6687
+ toPx(this.offset, 'height', this.placeholder));
6607
6688
 
6608
6689
  }
6609
6690
  });
@@ -6633,32 +6714,38 @@
6633
6714
 
6634
6715
  if (hide) {
6635
6716
  this.show();
6636
- fastdom.write(() => css(this.selTarget, 'transition', ''));
6717
+ requestAnimationFrame(() => css(this.selTarget, 'transition', ''));
6637
6718
  }
6638
6719
 
6639
6720
  const referenceElement = this.isFixed ? this.placeholder : this.$el;
6640
6721
  const windowHeight = height(window);
6641
6722
 
6642
6723
  let position = this.position;
6643
- if (position === 'auto' && height$1 > windowHeight) {
6644
- position = 'bottom';
6724
+ if (this.overflowFlip && height$1 > windowHeight) {
6725
+ position = position === 'top' ? 'bottom' : 'top';
6645
6726
  }
6646
6727
 
6647
6728
  let offset$1 = toPx(this.offset, 'height', referenceElement);
6648
- if (position === 'bottom') {
6729
+ if (position === 'bottom' && (height$1 < windowHeight || this.overflowFlip)) {
6649
6730
  offset$1 += windowHeight - height$1;
6650
6731
  }
6651
6732
 
6652
- const overflow = Math.max(0, height$1 + offset$1 - windowHeight);
6733
+ const overflow = this.overflowFlip ?
6734
+ 0 :
6735
+ Math.max(0, height$1 + offset$1 - windowHeight);
6653
6736
  const topOffset = offset(referenceElement).top;
6654
6737
 
6655
- const top = parseProp(this.top, this.$el, topOffset);
6656
- const bottom = parseProp(this.bottom, this.$el, topOffset + height$1, true);
6657
-
6658
- const start = Math.max(top, topOffset) - offset$1;
6659
- const end = bottom ?
6660
- bottom - offset(this.$el).height + overflow - offset$1 :
6661
- getScrollingElement(this.$el).scrollHeight - windowHeight;
6738
+ const start =
6739
+ (this.start === false ?
6740
+ topOffset :
6741
+ parseProp(this.start, this.$el, topOffset)) - offset$1;
6742
+ const end =
6743
+ this.end === false ?
6744
+ document.scrollingElement.scrollHeight - windowHeight :
6745
+ parseProp(this.end, this.$el, topOffset + height$1, true) -
6746
+ offset(this.$el).height +
6747
+ overflow -
6748
+ offset$1;
6662
6749
 
6663
6750
  return {
6664
6751
  start,
@@ -6861,8 +6948,8 @@
6861
6948
  return 0;
6862
6949
  }
6863
6950
 
6864
- if (isString(value) && value.match(/^-?\d/)) {
6865
- return propOffset + toPx(value);
6951
+ if (isNumeric(value) || isString(value) && value.match(/^-?\d/)) {
6952
+ return propOffset + toPx(value, 'height', el, true);
6866
6953
  } else {
6867
6954
  const refElement = value === true ? parent(el) : query(value, el);
6868
6955
  return (
@@ -6874,6 +6961,15 @@
6874
6961
  }
6875
6962
  }
6876
6963
 
6964
+ function coerce(value) {
6965
+ if (value === 'true') {
6966
+ return true;
6967
+ } else if (value === 'false') {
6968
+ return false;
6969
+ }
6970
+ return value;
6971
+ }
6972
+
6877
6973
  var Switcher = {
6878
6974
  mixins: [Lazyload, Swipe, Togglable],
6879
6975
 
@@ -7326,9 +7422,6 @@
7326
7422
  // register components
7327
7423
  each(components, (component, name) => UIkit.component(name, component));
7328
7424
 
7329
- // core functionality
7330
- UIkit.use(Core);
7331
-
7332
7425
  boot(UIkit);
7333
7426
 
7334
7427
  return UIkit;