uikit 3.13.1-dev.dedbd3fce → 3.13.2-dev.696f00752
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.
- package/.eslintrc.json +9 -0
- package/CHANGELOG.md +22 -0
- package/dist/css/uikit-core-rtl.css +31 -71
- package/dist/css/uikit-core-rtl.min.css +1 -1
- package/dist/css/uikit-core.css +31 -71
- package/dist/css/uikit-core.min.css +1 -1
- package/dist/css/uikit-rtl.css +31 -71
- package/dist/css/uikit-rtl.min.css +1 -1
- package/dist/css/uikit.css +31 -71
- package/dist/css/uikit.min.css +1 -1
- package/dist/js/components/countdown.js +1 -1
- package/dist/js/components/countdown.min.js +1 -1
- package/dist/js/components/filter.js +1 -1
- package/dist/js/components/filter.min.js +1 -1
- package/dist/js/components/lightbox-panel.js +1 -1
- package/dist/js/components/lightbox-panel.min.js +1 -1
- package/dist/js/components/lightbox.js +1 -1
- package/dist/js/components/lightbox.min.js +1 -1
- package/dist/js/components/notification.js +1 -1
- package/dist/js/components/notification.min.js +1 -1
- package/dist/js/components/parallax.js +1 -1
- package/dist/js/components/parallax.min.js +1 -1
- package/dist/js/components/slider-parallax.js +1 -1
- package/dist/js/components/slider-parallax.min.js +1 -1
- package/dist/js/components/slider.js +1 -1
- package/dist/js/components/slider.min.js +1 -1
- package/dist/js/components/slideshow-parallax.js +1 -1
- package/dist/js/components/slideshow-parallax.min.js +1 -1
- package/dist/js/components/slideshow.js +1 -1
- package/dist/js/components/slideshow.min.js +1 -1
- package/dist/js/components/sortable.js +1 -1
- package/dist/js/components/sortable.min.js +1 -1
- package/dist/js/components/tooltip.js +60 -31
- package/dist/js/components/tooltip.min.js +1 -1
- package/dist/js/components/upload.js +1 -1
- package/dist/js/components/upload.min.js +1 -1
- package/dist/js/uikit-core.js +218 -208
- package/dist/js/uikit-core.min.js +1 -1
- package/dist/js/uikit-icons.js +1 -1
- package/dist/js/uikit-icons.min.js +1 -1
- package/dist/js/uikit.js +220 -211
- package/dist/js/uikit.min.js +1 -1
- package/package.json +10 -10
- package/src/js/components/tooltip.js +2 -3
- package/src/js/core/cover.js +1 -1
- package/src/js/core/drop.js +7 -10
- package/src/js/core/navbar.js +12 -13
- package/src/js/core/responsive.js +1 -1
- package/src/js/core/sticky.js +1 -1
- package/src/js/core/switcher.js +7 -13
- package/src/js/mixin/media.js +4 -4
- package/src/js/mixin/position.js +53 -24
- package/src/js/util/dimensions.js +2 -2
- package/src/js/util/position.js +125 -129
- package/src/js/util/style.js +13 -19
- package/src/less/components/drop.less +3 -11
- package/src/less/components/dropdown.less +3 -11
- package/src/less/components/navbar.less +13 -23
- package/src/less/components/offcanvas.less +19 -1
- package/src/less/components/tooltip.less +2 -11
- package/src/less/theme/navbar.less +1 -3
- package/src/scss/components/drop.scss +3 -11
- package/src/scss/components/dropdown.scss +3 -11
- package/src/scss/components/navbar.scss +13 -23
- package/src/scss/components/offcanvas.scss +19 -1
- package/src/scss/components/tooltip.scss +2 -11
- package/src/scss/mixins-theme.scss +1 -2
- package/src/scss/mixins.scss +0 -1
- package/src/scss/theme/navbar.scss +0 -2
- package/src/scss/variables-theme.scss +7 -5
- package/src/scss/variables.scss +7 -5
- package/tests/drop.html +1 -1
- package/tests/navbar.html +2 -8
- package/tests/position.html +38 -39
- package/tests/search.html +1 -1
package/dist/js/uikit-core.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! UIkit 3.13.
|
|
1
|
+
/*! UIkit 3.13.2-dev.696f00752 | 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() :
|
|
@@ -767,21 +767,22 @@
|
|
|
767
767
|
property = propName(property);
|
|
768
768
|
|
|
769
769
|
if (isUndefined(value)) {
|
|
770
|
-
return
|
|
771
|
-
} else if (!value && !isNumber(value)) {
|
|
772
|
-
element.style.removeProperty(property);
|
|
770
|
+
return getComputedStyle(element).getPropertyValue(property);
|
|
773
771
|
} else {
|
|
774
772
|
element.style.setProperty(
|
|
775
773
|
property,
|
|
776
|
-
isNumeric(value) && !cssNumber[property] ?
|
|
774
|
+
isNumeric(value) && !cssNumber[property] ?
|
|
775
|
+
value + "px" :
|
|
776
|
+
value || isNumber(value) ?
|
|
777
|
+
value :
|
|
778
|
+
'',
|
|
777
779
|
priority);
|
|
778
780
|
|
|
779
781
|
}
|
|
780
782
|
} else if (isArray(property)) {
|
|
781
|
-
const styles = getStyles(element);
|
|
782
783
|
const props = {};
|
|
783
784
|
for (const prop of property) {
|
|
784
|
-
props[prop] =
|
|
785
|
+
props[prop] = css(element, prop);
|
|
785
786
|
}
|
|
786
787
|
return props;
|
|
787
788
|
} else if (isObject(property)) {
|
|
@@ -792,19 +793,9 @@
|
|
|
792
793
|
return elements[0];
|
|
793
794
|
}
|
|
794
795
|
|
|
795
|
-
function getStyles(element, pseudoElt) {
|
|
796
|
-
return toWindow(element).getComputedStyle(element, pseudoElt);
|
|
797
|
-
}
|
|
798
|
-
|
|
799
|
-
function getStyle(element, property, pseudoElt) {
|
|
800
|
-
return getStyles(element, pseudoElt)[property];
|
|
801
|
-
}
|
|
802
|
-
|
|
803
796
|
const propertyRe = /^\s*(["'])?(.*?)\1\s*$/;
|
|
804
|
-
function getCssVar(name) {
|
|
805
|
-
return
|
|
806
|
-
getPropertyValue("--uk-" + name).
|
|
807
|
-
replace(propertyRe, '$2');
|
|
797
|
+
function getCssVar(name, element) {if (element === void 0) {element = document.documentElement;}
|
|
798
|
+
return css(element, "--uk-" + name).replace(propertyRe, '$2');
|
|
808
799
|
}
|
|
809
800
|
|
|
810
801
|
// https://drafts.csswg.org/cssom/#dom-cssstyledeclaration-setproperty
|
|
@@ -813,6 +804,10 @@
|
|
|
813
804
|
const cssPrefixes = ['webkit', 'moz'];
|
|
814
805
|
|
|
815
806
|
function vendorPropName(name) {
|
|
807
|
+
if (name[0] === '-') {
|
|
808
|
+
return name;
|
|
809
|
+
}
|
|
810
|
+
|
|
816
811
|
name = hyphenate(name);
|
|
817
812
|
|
|
818
813
|
const { style } = document.documentElement;
|
|
@@ -1019,8 +1014,8 @@
|
|
|
1019
1014
|
const offsetBy = { height: scrollY, width: scrollX };
|
|
1020
1015
|
|
|
1021
1016
|
for (const dir in dirs$1) {
|
|
1022
|
-
for (const
|
|
1023
|
-
currentOffset[
|
|
1017
|
+
for (const prop of dirs$1[dir]) {
|
|
1018
|
+
currentOffset[prop] += offsetBy[dir];
|
|
1024
1019
|
}
|
|
1025
1020
|
}
|
|
1026
1021
|
}
|
|
@@ -1935,157 +1930,153 @@
|
|
|
1935
1930
|
return document.scrollingElement || document.documentElement;
|
|
1936
1931
|
}
|
|
1937
1932
|
|
|
1938
|
-
const dirs =
|
|
1939
|
-
|
|
1940
|
-
|
|
1933
|
+
const dirs = [
|
|
1934
|
+
['width', 'x', 'left', 'right'],
|
|
1935
|
+
['height', 'y', 'top', 'bottom']];
|
|
1941
1936
|
|
|
1942
1937
|
|
|
1943
|
-
function positionAt(
|
|
1944
|
-
|
|
1945
|
-
|
|
1946
|
-
|
|
1947
|
-
|
|
1948
|
-
|
|
1949
|
-
targetOffset,
|
|
1950
|
-
flip,
|
|
1951
|
-
boundary)
|
|
1952
|
-
{
|
|
1953
|
-
elAttach = getPos(elAttach);
|
|
1954
|
-
targetAttach = getPos(targetAttach);
|
|
1938
|
+
function positionAt(element, target, options) {
|
|
1939
|
+
options = {
|
|
1940
|
+
attach: {
|
|
1941
|
+
element: ['left', 'top'],
|
|
1942
|
+
target: ['left', 'top'],
|
|
1943
|
+
...options.attach },
|
|
1955
1944
|
|
|
1956
|
-
|
|
1945
|
+
offset: [0, 0],
|
|
1946
|
+
...options };
|
|
1957
1947
|
|
|
1958
|
-
if (!element || !target) {
|
|
1959
|
-
return flipped;
|
|
1960
|
-
}
|
|
1961
1948
|
|
|
1962
|
-
const dim =
|
|
1963
|
-
|
|
1964
|
-
|
|
1949
|
+
const dim = options.flip ?
|
|
1950
|
+
attachToWithFlip(element, target, options) :
|
|
1951
|
+
attachTo(element, target, options);
|
|
1965
1952
|
|
|
1966
|
-
|
|
1967
|
-
|
|
1953
|
+
offset(element, dim);
|
|
1954
|
+
}
|
|
1968
1955
|
|
|
1969
|
-
|
|
1970
|
-
|
|
1956
|
+
function attachTo(element, target, options) {
|
|
1957
|
+
let { attach, offset: offsetBy } = {
|
|
1958
|
+
attach: {
|
|
1959
|
+
element: ['left', 'top'],
|
|
1960
|
+
target: ['left', 'top'],
|
|
1961
|
+
...options.attach },
|
|
1971
1962
|
|
|
1972
|
-
|
|
1973
|
-
|
|
1963
|
+
offset: [0, 0],
|
|
1964
|
+
...options };
|
|
1974
1965
|
|
|
1975
|
-
position.left += elOffset['x'];
|
|
1976
|
-
position.top += elOffset['y'];
|
|
1977
1966
|
|
|
1978
|
-
|
|
1979
|
-
|
|
1967
|
+
const position = offset(element);
|
|
1968
|
+
const targetOffset = offset(target);
|
|
1969
|
+
for (const i in dirs) {
|
|
1970
|
+
const [prop, dir, start, end] = dirs[i];
|
|
1971
|
+
position[start] = position[dir] =
|
|
1972
|
+
targetOffset[start] +
|
|
1973
|
+
moveBy(attach.target[i], end, targetOffset[prop]) -
|
|
1974
|
+
moveBy(attach.element[i], end, position[prop]) +
|
|
1975
|
+
+offsetBy[i];
|
|
1976
|
+
position[end] = position[start] + position[prop];
|
|
1977
|
+
}
|
|
1978
|
+
return position;
|
|
1979
|
+
}
|
|
1980
1980
|
|
|
1981
|
-
|
|
1982
|
-
|
|
1983
|
-
|
|
1981
|
+
function attachToWithFlip(element, target, options) {
|
|
1982
|
+
const position = attachTo(element, target, options);
|
|
1983
|
+
const targetDim = offset(target);
|
|
1984
|
+
const viewports = scrollParents(element).map(getViewport$1);
|
|
1984
1985
|
|
|
1985
|
-
|
|
1986
|
+
let {
|
|
1987
|
+
flip,
|
|
1988
|
+
attach: { element: elAttach, target: targetAttach },
|
|
1989
|
+
offset: elOffset,
|
|
1990
|
+
boundary,
|
|
1991
|
+
viewport } =
|
|
1992
|
+
options;
|
|
1986
1993
|
|
|
1987
|
-
|
|
1988
|
-
if (!(flip === true || includes(flip, dir))) {
|
|
1989
|
-
return;
|
|
1990
|
-
}
|
|
1994
|
+
viewports.push(viewport);
|
|
1991
1995
|
|
|
1992
|
-
|
|
1993
|
-
|
|
1994
|
-
elAttach[dir] === align ?
|
|
1995
|
-
-dim[prop] :
|
|
1996
|
-
elAttach[dir] === alignFlip ?
|
|
1997
|
-
dim[prop] :
|
|
1998
|
-
0;
|
|
1996
|
+
for (const i in dirs) {
|
|
1997
|
+
const [prop, dir, start, end] = dirs[i];
|
|
1999
1998
|
|
|
2000
|
-
|
|
2001
|
-
|
|
2002
|
-
|
|
2003
|
-
targetAttach[dir] === alignFlip ?
|
|
2004
|
-
-targetDim[prop] :
|
|
2005
|
-
0;
|
|
1999
|
+
if (flip !== true && !includes(flip, dir)) {
|
|
2000
|
+
continue;
|
|
2001
|
+
}
|
|
2006
2002
|
|
|
2007
|
-
|
|
2008
|
-
|
|
2009
|
-
position[align] + dim[prop] > boundary[alignFlip])
|
|
2010
|
-
{
|
|
2011
|
-
const centerOffset = dim[prop] / 2;
|
|
2012
|
-
const centerTargetOffset =
|
|
2013
|
-
targetAttach[dir] === 'center' ? -targetDim[prop] / 2 : 0;
|
|
2003
|
+
const willFlip =
|
|
2004
|
+
!intersectLine(position, targetDim, i) && intersectLine(position, targetDim, 1 - i);
|
|
2014
2005
|
|
|
2015
|
-
|
|
2016
|
-
|
|
2017
|
-
|
|
2018
|
-
apply(-centerOffset, -centerTargetOffset)) ||
|
|
2019
|
-
apply(elemOffset, targetOffset));
|
|
2006
|
+
viewport = getIntersectionArea(...viewports, willFlip ? null : boundary);
|
|
2007
|
+
const isInStartBoundary = position[start] >= viewport[start];
|
|
2008
|
+
const isInEndBoundary = position[end] <= viewport[end];
|
|
2020
2009
|
|
|
2021
|
-
|
|
2022
|
-
|
|
2023
|
-
|
|
2024
|
-
const newVal = toFloat(
|
|
2025
|
-
(position[align] + elemOffset + targetOffset - elOffset[dir] * 2).toFixed(4));
|
|
2010
|
+
if (isInStartBoundary && isInEndBoundary) {
|
|
2011
|
+
continue;
|
|
2012
|
+
}
|
|
2026
2013
|
|
|
2014
|
+
let offsetBy;
|
|
2027
2015
|
|
|
2028
|
-
|
|
2029
|
-
|
|
2016
|
+
// Flip
|
|
2017
|
+
if (willFlip) {
|
|
2018
|
+
if (
|
|
2019
|
+
elAttach[i] === end && isInStartBoundary ||
|
|
2020
|
+
elAttach[i] === start && isInEndBoundary)
|
|
2021
|
+
{
|
|
2022
|
+
continue;
|
|
2023
|
+
}
|
|
2030
2024
|
|
|
2031
|
-
|
|
2032
|
-
|
|
2033
|
-
|
|
2034
|
-
|
|
2035
|
-
|
|
2036
|
-
|
|
2037
|
-
|
|
2038
|
-
|
|
2025
|
+
offsetBy =
|
|
2026
|
+
(elAttach[i] === start ?
|
|
2027
|
+
-position[prop] :
|
|
2028
|
+
elAttach[i] === end ?
|
|
2029
|
+
position[prop] :
|
|
2030
|
+
0) + (
|
|
2031
|
+
targetAttach[i] === start ?
|
|
2032
|
+
targetDim[prop] :
|
|
2033
|
+
targetAttach[i] === end ?
|
|
2034
|
+
-targetDim[prop] :
|
|
2035
|
+
0) -
|
|
2036
|
+
elOffset[i] * 2;
|
|
2037
|
+
|
|
2038
|
+
// Move
|
|
2039
|
+
} else {
|
|
2040
|
+
offsetBy =
|
|
2041
|
+
clamp(
|
|
2042
|
+
clamp(position[start], viewport[start], viewport[end] - position[prop]),
|
|
2043
|
+
targetDim[start] - position[prop] + elOffset[i],
|
|
2044
|
+
targetDim[end] - elOffset[i]) -
|
|
2045
|
+
position[start];
|
|
2046
|
+
}
|
|
2039
2047
|
|
|
2040
|
-
|
|
2041
|
-
|
|
2042
|
-
}
|
|
2043
|
-
});
|
|
2044
|
-
});
|
|
2048
|
+
position[start] = position[dir] = position[start] + offsetBy;
|
|
2049
|
+
position[end] += offsetBy;
|
|
2045
2050
|
}
|
|
2046
2051
|
|
|
2047
|
-
|
|
2048
|
-
|
|
2049
|
-
return flipped;
|
|
2052
|
+
return position;
|
|
2050
2053
|
}
|
|
2051
2054
|
|
|
2052
|
-
function
|
|
2053
|
-
|
|
2054
|
-
if (attach[dir] === alignFlip) {
|
|
2055
|
-
position[align] += dim[prop] * factor;
|
|
2056
|
-
} else if (attach[dir] === 'center') {
|
|
2057
|
-
position[align] += dim[prop] * factor / 2;
|
|
2058
|
-
}
|
|
2059
|
-
});
|
|
2055
|
+
function moveBy(start, end, dim) {
|
|
2056
|
+
return start === 'center' ? dim / 2 : start === end ? dim : 0;
|
|
2060
2057
|
}
|
|
2061
2058
|
|
|
2062
|
-
function
|
|
2063
|
-
|
|
2064
|
-
const
|
|
2065
|
-
|
|
2066
|
-
|
|
2067
|
-
|
|
2068
|
-
|
|
2069
|
-
|
|
2070
|
-
|
|
2071
|
-
|
|
2072
|
-
|
|
2073
|
-
['
|
|
2059
|
+
function getIntersectionArea() {
|
|
2060
|
+
let intersection;for (var _len = arguments.length, elements = new Array(_len), _key = 0; _key < _len; _key++) {elements[_key] = arguments[_key];}
|
|
2061
|
+
for (const el of elements.filter(Boolean)) {
|
|
2062
|
+
const rect = offset(el);
|
|
2063
|
+
if (!intersection) {
|
|
2064
|
+
intersection = rect;
|
|
2065
|
+
continue;
|
|
2066
|
+
}
|
|
2067
|
+
for (const prop of ['left', 'top']) {
|
|
2068
|
+
intersection[prop] = Math.max(rect[prop], intersection[prop]);
|
|
2069
|
+
}
|
|
2070
|
+
for (const prop of ['right', 'bottom']) {
|
|
2071
|
+
intersection[prop] = Math.min(rect[prop], intersection[prop]);
|
|
2072
|
+
}
|
|
2074
2073
|
}
|
|
2075
|
-
|
|
2076
|
-
return {
|
|
2077
|
-
x: x.test(pos[0]) ? pos[0] : 'center',
|
|
2078
|
-
y: y.test(pos[1]) ? pos[1] : 'center' };
|
|
2079
|
-
|
|
2074
|
+
return intersection;
|
|
2080
2075
|
}
|
|
2081
2076
|
|
|
2082
|
-
function
|
|
2083
|
-
const [
|
|
2084
|
-
|
|
2085
|
-
return {
|
|
2086
|
-
x: x ? toFloat(x) * (endsWith(x, '%') ? width / 100 : 1) : 0,
|
|
2087
|
-
y: y ? toFloat(y) * (endsWith(y, '%') ? height / 100 : 1) : 0 };
|
|
2088
|
-
|
|
2077
|
+
function intersectLine(dimA, dimB, dir) {
|
|
2078
|
+
const [,, start, end] = dirs[dir];
|
|
2079
|
+
return dimA[end] > dimB[start] && dimB[end] > dimA[start];
|
|
2089
2080
|
}
|
|
2090
2081
|
|
|
2091
2082
|
var util = /*#__PURE__*/Object.freeze({
|
|
@@ -2894,7 +2885,7 @@
|
|
|
2894
2885
|
UIkit.data = '__uikit__';
|
|
2895
2886
|
UIkit.prefix = 'uk-';
|
|
2896
2887
|
UIkit.options = {};
|
|
2897
|
-
UIkit.version = '3.13.
|
|
2888
|
+
UIkit.version = '3.13.2-dev.696f00752';
|
|
2898
2889
|
|
|
2899
2890
|
globalAPI(UIkit);
|
|
2900
2891
|
hooksAPI(UIkit);
|
|
@@ -3431,7 +3422,7 @@
|
|
|
3431
3422
|
|
|
3432
3423
|
|
|
3433
3424
|
events: {
|
|
3434
|
-
load() {
|
|
3425
|
+
'load loadedmetadata'() {
|
|
3435
3426
|
this.$emit('resize');
|
|
3436
3427
|
} },
|
|
3437
3428
|
|
|
@@ -3497,15 +3488,13 @@
|
|
|
3497
3488
|
props: {
|
|
3498
3489
|
pos: String,
|
|
3499
3490
|
offset: null,
|
|
3500
|
-
flip: Boolean,
|
|
3501
|
-
clsPos: String },
|
|
3491
|
+
flip: Boolean },
|
|
3502
3492
|
|
|
3503
3493
|
|
|
3504
3494
|
data: {
|
|
3505
3495
|
pos: "bottom-" + (isRtl ? 'right' : 'left'),
|
|
3506
3496
|
flip: true,
|
|
3507
|
-
offset: false,
|
|
3508
|
-
clsPos: '' },
|
|
3497
|
+
offset: false },
|
|
3509
3498
|
|
|
3510
3499
|
|
|
3511
3500
|
connected() {
|
|
@@ -3516,13 +3505,11 @@
|
|
|
3516
3505
|
|
|
3517
3506
|
methods: {
|
|
3518
3507
|
positionAt(element, target, boundary) {
|
|
3519
|
-
removeClasses(element, this.clsPos + "-(top|bottom|left|right)(-[a-z]+)?");
|
|
3520
|
-
|
|
3521
|
-
let { offset: offset$1 } = this;
|
|
3522
3508
|
const axis = this.getAxis();
|
|
3523
3509
|
const dir = this.pos[0];
|
|
3524
3510
|
const align = this.pos[1];
|
|
3525
3511
|
|
|
3512
|
+
let { offset: offset$1 } = this;
|
|
3526
3513
|
if (!isNumeric(offset$1)) {
|
|
3527
3514
|
const node = $(offset$1);
|
|
3528
3515
|
offset$1 = node ?
|
|
@@ -3530,30 +3517,64 @@
|
|
|
3530
3517
|
offset(target)[axis === 'x' ? 'right' : 'bottom'] :
|
|
3531
3518
|
0;
|
|
3532
3519
|
}
|
|
3520
|
+
offset$1 += toPx(getCssVar('position-margin-offset', element));
|
|
3533
3521
|
|
|
3534
|
-
|
|
3535
|
-
|
|
3536
|
-
|
|
3537
|
-
|
|
3538
|
-
|
|
3539
|
-
|
|
3540
|
-
|
|
3541
|
-
|
|
3542
|
-
|
|
3543
|
-
|
|
3544
|
-
|
|
3545
|
-
|
|
3546
|
-
|
|
3547
|
-
this.dir =
|
|
3548
|
-
this.align
|
|
3549
|
-
|
|
3550
|
-
toggleClass(element, this.clsPos + "-" + this.dir + "-" + this.align, this.offset === false);
|
|
3522
|
+
positionAt(element, target, {
|
|
3523
|
+
boundary,
|
|
3524
|
+
flip: this.flip,
|
|
3525
|
+
attach: {
|
|
3526
|
+
element: axis === 'x' ? [flipPosition(dir), align] : [align, flipPosition(dir)],
|
|
3527
|
+
target: axis === 'x' ? [dir, align] : [align, dir] },
|
|
3528
|
+
|
|
3529
|
+
offset:
|
|
3530
|
+
axis === 'x' ?
|
|
3531
|
+
[dir === 'left' ? -offset$1 : +offset$1, 0] :
|
|
3532
|
+
[0, dir === 'top' ? -offset$1 : +offset$1] });
|
|
3533
|
+
|
|
3534
|
+
|
|
3535
|
+
[this.dir, this.align] = getAlignment(element, target);
|
|
3536
|
+
console.log(this.dir, this.align);
|
|
3551
3537
|
},
|
|
3552
3538
|
|
|
3553
3539
|
getAxis() {
|
|
3554
|
-
return
|
|
3540
|
+
return includes(['top', 'bottom'], this.dir) ? 'y' : 'x';
|
|
3555
3541
|
} } };
|
|
3556
3542
|
|
|
3543
|
+
|
|
3544
|
+
|
|
3545
|
+
function getAlignment(el, target) {
|
|
3546
|
+
const elOffset = offset(el);
|
|
3547
|
+
const targetOffset = offset(target);
|
|
3548
|
+
const properties = [
|
|
3549
|
+
['left', 'right'],
|
|
3550
|
+
['top', 'bottom']];
|
|
3551
|
+
|
|
3552
|
+
|
|
3553
|
+
let dir;
|
|
3554
|
+
for (const props of properties) {
|
|
3555
|
+
if (elOffset[props[0]] > targetOffset[props[1]]) {
|
|
3556
|
+
dir = props[1];
|
|
3557
|
+
break;
|
|
3558
|
+
}
|
|
3559
|
+
if (elOffset[props[1]] < targetOffset[props[0]]) {
|
|
3560
|
+
dir = props[0];
|
|
3561
|
+
break;
|
|
3562
|
+
}
|
|
3563
|
+
}
|
|
3564
|
+
|
|
3565
|
+
let align;
|
|
3566
|
+
const props = includes(properties[0], dir) ? properties[1] : properties[0];
|
|
3567
|
+
if (elOffset[props[0]] === targetOffset[props[0]]) {
|
|
3568
|
+
align = props[0];
|
|
3569
|
+
} else if (elOffset[props[1]] === targetOffset[props[1]]) {
|
|
3570
|
+
align = props[1];
|
|
3571
|
+
} else {
|
|
3572
|
+
align = 'center';
|
|
3573
|
+
}
|
|
3574
|
+
|
|
3575
|
+
return [dir, align];
|
|
3576
|
+
}
|
|
3577
|
+
|
|
3557
3578
|
let active$1;
|
|
3558
3579
|
|
|
3559
3580
|
var drop = {
|
|
@@ -3589,7 +3610,7 @@
|
|
|
3589
3610
|
},
|
|
3590
3611
|
|
|
3591
3612
|
connected() {
|
|
3592
|
-
this.
|
|
3613
|
+
this.clsDrop = this.$props.clsDrop || "uk-" + this.$options.name;
|
|
3593
3614
|
addClass(this.$el, this.clsDrop);
|
|
3594
3615
|
|
|
3595
3616
|
if (this.toggle && !this.target) {
|
|
@@ -3655,7 +3676,7 @@
|
|
|
3655
3676
|
if (this.isToggled()) {
|
|
3656
3677
|
this.hide(false);
|
|
3657
3678
|
} else {
|
|
3658
|
-
this.show(toggle.$el, false);
|
|
3679
|
+
this.show(toggle == null ? void 0 : toggle.$el, false);
|
|
3659
3680
|
}
|
|
3660
3681
|
} },
|
|
3661
3682
|
|
|
@@ -3667,7 +3688,7 @@
|
|
|
3667
3688
|
|
|
3668
3689
|
handler(e, toggle) {
|
|
3669
3690
|
e.preventDefault();
|
|
3670
|
-
this.show(toggle.$el);
|
|
3691
|
+
this.show(toggle == null ? void 0 : toggle.$el);
|
|
3671
3692
|
} },
|
|
3672
3693
|
|
|
3673
3694
|
|
|
@@ -3878,23 +3899,20 @@
|
|
|
3878
3899
|
},
|
|
3879
3900
|
|
|
3880
3901
|
position() {
|
|
3881
|
-
const boundary =
|
|
3902
|
+
const boundary = query(this.boundary, this.$el) || window;
|
|
3882
3903
|
removeClass(this.$el, this.clsDrop + "-stack");
|
|
3883
3904
|
toggleClass(this.$el, this.clsDrop + "-boundary", this.boundaryAlign);
|
|
3884
3905
|
|
|
3885
3906
|
const boundaryOffset = offset(boundary);
|
|
3886
|
-
const
|
|
3907
|
+
const targetOffset = offset(this.target);
|
|
3908
|
+
const alignTo = this.boundaryAlign ? boundaryOffset : targetOffset;
|
|
3887
3909
|
|
|
3888
3910
|
if (this.align === 'justify') {
|
|
3889
3911
|
const prop = this.getAxis() === 'y' ? 'width' : 'height';
|
|
3890
3912
|
css(this.$el, prop, alignTo[prop]);
|
|
3891
3913
|
} else if (
|
|
3892
|
-
boundary &&
|
|
3893
3914
|
this.$el.offsetWidth >
|
|
3894
|
-
Math.max(
|
|
3895
|
-
boundaryOffset.right - alignTo.left,
|
|
3896
|
-
alignTo.right - boundaryOffset.left))
|
|
3897
|
-
|
|
3915
|
+
Math.max(boundaryOffset.right - alignTo.left, alignTo.right - boundaryOffset.left))
|
|
3898
3916
|
{
|
|
3899
3917
|
addClass(this.$el, this.clsDrop + "-stack");
|
|
3900
3918
|
}
|
|
@@ -5556,7 +5574,6 @@
|
|
|
5556
5574
|
delayShow: Number,
|
|
5557
5575
|
delayHide: Number,
|
|
5558
5576
|
dropbar: Boolean,
|
|
5559
|
-
dropbarMode: String,
|
|
5560
5577
|
dropbarAnchor: Boolean,
|
|
5561
5578
|
duration: Number },
|
|
5562
5579
|
|
|
@@ -5573,7 +5590,6 @@
|
|
|
5573
5590
|
flip: 'x',
|
|
5574
5591
|
boundary: true,
|
|
5575
5592
|
dropbar: false,
|
|
5576
|
-
dropbarMode: 'slide',
|
|
5577
5593
|
dropbarAnchor: false,
|
|
5578
5594
|
duration: 200,
|
|
5579
5595
|
forceHeight: true,
|
|
@@ -5582,8 +5598,8 @@
|
|
|
5582
5598
|
|
|
5583
5599
|
|
|
5584
5600
|
computed: {
|
|
5585
|
-
boundary(_ref, $el) {let { boundary
|
|
5586
|
-
return boundary === true
|
|
5601
|
+
boundary(_ref, $el) {let { boundary } = _ref;
|
|
5602
|
+
return boundary === true ? $el : boundary;
|
|
5587
5603
|
},
|
|
5588
5604
|
|
|
5589
5605
|
dropbarAnchor(_ref2, $el) {let { dropbarAnchor } = _ref2;
|
|
@@ -5790,10 +5806,16 @@
|
|
|
5790
5806
|
return this.dropbar;
|
|
5791
5807
|
},
|
|
5792
5808
|
|
|
5793
|
-
handler() {
|
|
5809
|
+
handler(_, _ref9) {let { $el } = _ref9;
|
|
5810
|
+
if (!hasClass($el, this.clsDrop)) {
|
|
5811
|
+
return;
|
|
5812
|
+
}
|
|
5813
|
+
|
|
5794
5814
|
if (!parent(this.dropbar)) {
|
|
5795
5815
|
after(this.dropbarAnchor || this.$el, this.dropbar);
|
|
5796
5816
|
}
|
|
5817
|
+
|
|
5818
|
+
addClass($el, this.clsDrop + "-dropbar");
|
|
5797
5819
|
} },
|
|
5798
5820
|
|
|
5799
5821
|
|
|
@@ -5808,21 +5830,15 @@
|
|
|
5808
5830
|
return this.dropbar;
|
|
5809
5831
|
},
|
|
5810
5832
|
|
|
5811
|
-
handler(_,
|
|
5833
|
+
handler(_, _ref10) {let { $el, dir } = _ref10;
|
|
5812
5834
|
if (!hasClass($el, this.clsDrop)) {
|
|
5813
5835
|
return;
|
|
5814
5836
|
}
|
|
5815
5837
|
|
|
5816
|
-
if (this.dropbarMode === 'slide') {
|
|
5817
|
-
addClass(this.dropbar, 'uk-navbar-dropbar-slide');
|
|
5818
|
-
}
|
|
5819
|
-
|
|
5820
|
-
this.clsDrop && addClass($el, this.clsDrop + "-dropbar");
|
|
5821
|
-
|
|
5822
5838
|
if (dir === 'bottom') {
|
|
5823
5839
|
this.transitionTo(
|
|
5824
|
-
$el.
|
|
5825
|
-
|
|
5840
|
+
offset($el).bottom -
|
|
5841
|
+
offset(this.dropbar).top +
|
|
5826
5842
|
toFloat(css($el, 'marginBottom')),
|
|
5827
5843
|
$el);
|
|
5828
5844
|
|
|
@@ -5841,7 +5857,7 @@
|
|
|
5841
5857
|
return this.dropbar;
|
|
5842
5858
|
},
|
|
5843
5859
|
|
|
5844
|
-
handler(e,
|
|
5860
|
+
handler(e, _ref11) {let { $el } = _ref11;
|
|
5845
5861
|
const active = this.getActive();
|
|
5846
5862
|
|
|
5847
5863
|
if (
|
|
@@ -5865,7 +5881,7 @@
|
|
|
5865
5881
|
return this.dropbar;
|
|
5866
5882
|
},
|
|
5867
5883
|
|
|
5868
|
-
handler(_,
|
|
5884
|
+
handler(_, _ref12) {let { $el } = _ref12;
|
|
5869
5885
|
if (!hasClass($el, this.clsDrop)) {
|
|
5870
5886
|
return;
|
|
5871
5887
|
}
|
|
@@ -6289,7 +6305,7 @@
|
|
|
6289
6305
|
events: ['resize'] } };
|
|
6290
6306
|
|
|
6291
6307
|
var responsive = {
|
|
6292
|
-
|
|
6308
|
+
mixins: [Resize],
|
|
6293
6309
|
|
|
6294
6310
|
props: ['width', 'height'],
|
|
6295
6311
|
|
|
@@ -7057,27 +7073,21 @@
|
|
|
7057
7073
|
|
|
7058
7074
|
show(item) {
|
|
7059
7075
|
const prev = this.index();
|
|
7060
|
-
const next = getIndex(
|
|
7061
|
-
this.children[
|
|
7062
|
-
children(this.$el));
|
|
7063
|
-
|
|
7064
|
-
|
|
7065
|
-
if (prev === next) {
|
|
7066
|
-
return;
|
|
7067
|
-
}
|
|
7068
|
-
|
|
7076
|
+
const next = getIndex(item, this.toggles, prev);
|
|
7077
|
+
const active = getIndex(this.children[next], children(this.$el));
|
|
7069
7078
|
children(this.$el).forEach((child, i) => {
|
|
7070
|
-
toggleClass(child, this.cls,
|
|
7071
|
-
attr(this.toggles[i], 'aria-expanded',
|
|
7079
|
+
toggleClass(child, this.cls, active === i);
|
|
7080
|
+
attr(this.toggles[i], 'aria-expanded', active === i);
|
|
7072
7081
|
});
|
|
7073
7082
|
|
|
7083
|
+
const animate = prev >= 0 && prev !== next;
|
|
7074
7084
|
this.connects.forEach(async (_ref4) => {let { children } = _ref4;
|
|
7075
7085
|
await this.toggleElement(
|
|
7076
7086
|
toNodes(children).filter((child) => hasClass(child, this.cls)),
|
|
7077
7087
|
false,
|
|
7078
|
-
|
|
7088
|
+
animate);
|
|
7079
7089
|
|
|
7080
|
-
await this.toggleElement(children[
|
|
7090
|
+
await this.toggleElement(children[active], true, animate);
|
|
7081
7091
|
});
|
|
7082
7092
|
} } };
|
|
7083
7093
|
|