uikit 3.13.7 → 3.13.8-dev.2fb6bed58
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/CHANGELOG.md +10 -0
- package/dist/css/uikit-core-rtl.css +1 -1
- package/dist/css/uikit-core-rtl.min.css +1 -1
- package/dist/css/uikit-core.css +1 -1
- package/dist/css/uikit-core.min.css +1 -1
- package/dist/css/uikit-rtl.css +1 -1
- package/dist/css/uikit-rtl.min.css +1 -1
- package/dist/css/uikit.css +1 -1
- 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 +59 -21
- 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 +180 -143
- 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 +182 -145
- package/dist/js/uikit.min.js +1 -1
- package/package.json +1 -1
- package/src/js/core/drop.js +4 -1
- package/src/js/mixin/position.js +56 -19
- package/src/js/util/position.js +125 -129
- package/tests/drop.html +0 -6
- package/tests/dropdown.html +2 -8
- package/tests/position.html +38 -39
package/dist/js/uikit.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! UIkit 3.13.
|
|
1
|
+
/*! UIkit 3.13.8-dev.2fb6bed58 | 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() :
|
|
@@ -1933,157 +1933,153 @@
|
|
|
1933
1933
|
return document.scrollingElement || document.documentElement;
|
|
1934
1934
|
}
|
|
1935
1935
|
|
|
1936
|
-
const dirs =
|
|
1937
|
-
|
|
1938
|
-
|
|
1936
|
+
const dirs = [
|
|
1937
|
+
['width', 'x', 'left', 'right'],
|
|
1938
|
+
['height', 'y', 'top', 'bottom']];
|
|
1939
1939
|
|
|
1940
1940
|
|
|
1941
|
-
function positionAt(
|
|
1942
|
-
|
|
1943
|
-
|
|
1944
|
-
|
|
1945
|
-
|
|
1946
|
-
|
|
1947
|
-
targetOffset,
|
|
1948
|
-
flip,
|
|
1949
|
-
boundary)
|
|
1950
|
-
{
|
|
1951
|
-
elAttach = getPos(elAttach);
|
|
1952
|
-
targetAttach = getPos(targetAttach);
|
|
1941
|
+
function positionAt(element, target, options) {
|
|
1942
|
+
options = {
|
|
1943
|
+
attach: {
|
|
1944
|
+
element: ['left', 'top'],
|
|
1945
|
+
target: ['left', 'top'],
|
|
1946
|
+
...options.attach },
|
|
1953
1947
|
|
|
1954
|
-
|
|
1948
|
+
offset: [0, 0],
|
|
1949
|
+
...options };
|
|
1955
1950
|
|
|
1956
|
-
if (!element || !target) {
|
|
1957
|
-
return flipped;
|
|
1958
|
-
}
|
|
1959
1951
|
|
|
1960
|
-
const dim =
|
|
1961
|
-
|
|
1962
|
-
|
|
1952
|
+
const dim = options.flip ?
|
|
1953
|
+
attachToWithFlip(element, target, options) :
|
|
1954
|
+
attachTo(element, target, options);
|
|
1963
1955
|
|
|
1964
|
-
|
|
1965
|
-
|
|
1956
|
+
offset(element, dim);
|
|
1957
|
+
}
|
|
1966
1958
|
|
|
1967
|
-
|
|
1968
|
-
|
|
1959
|
+
function attachTo(element, target, options) {
|
|
1960
|
+
let { attach, offset: offsetBy } = {
|
|
1961
|
+
attach: {
|
|
1962
|
+
element: ['left', 'top'],
|
|
1963
|
+
target: ['left', 'top'],
|
|
1964
|
+
...options.attach },
|
|
1969
1965
|
|
|
1970
|
-
|
|
1971
|
-
|
|
1966
|
+
offset: [0, 0],
|
|
1967
|
+
...options };
|
|
1972
1968
|
|
|
1973
|
-
position.left += elOffset['x'];
|
|
1974
|
-
position.top += elOffset['y'];
|
|
1975
1969
|
|
|
1976
|
-
|
|
1977
|
-
|
|
1970
|
+
const position = offset(element);
|
|
1971
|
+
const targetOffset = offset(target);
|
|
1972
|
+
for (const i in dirs) {
|
|
1973
|
+
const [prop, dir, start, end] = dirs[i];
|
|
1974
|
+
position[start] = position[dir] =
|
|
1975
|
+
targetOffset[start] +
|
|
1976
|
+
moveBy(attach.target[i], end, targetOffset[prop]) -
|
|
1977
|
+
moveBy(attach.element[i], end, position[prop]) +
|
|
1978
|
+
+offsetBy[i];
|
|
1979
|
+
position[end] = position[start] + position[prop];
|
|
1980
|
+
}
|
|
1981
|
+
return position;
|
|
1982
|
+
}
|
|
1978
1983
|
|
|
1979
|
-
|
|
1980
|
-
|
|
1981
|
-
|
|
1984
|
+
function attachToWithFlip(element, target, options) {
|
|
1985
|
+
const position = attachTo(element, target, options);
|
|
1986
|
+
const targetDim = offset(target);
|
|
1987
|
+
const viewports = scrollParents(element).map(getViewport$1);
|
|
1982
1988
|
|
|
1983
|
-
|
|
1989
|
+
let {
|
|
1990
|
+
flip,
|
|
1991
|
+
attach: { element: elAttach, target: targetAttach },
|
|
1992
|
+
offset: elOffset,
|
|
1993
|
+
boundary,
|
|
1994
|
+
viewport } =
|
|
1995
|
+
options;
|
|
1984
1996
|
|
|
1985
|
-
|
|
1986
|
-
if (!(flip === true || includes(flip, dir))) {
|
|
1987
|
-
return;
|
|
1988
|
-
}
|
|
1997
|
+
viewports.push(viewport);
|
|
1989
1998
|
|
|
1990
|
-
|
|
1991
|
-
|
|
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;
|
|
1999
|
+
for (const i in dirs) {
|
|
2000
|
+
const [prop, dir, start, end] = dirs[i];
|
|
2004
2001
|
|
|
2005
|
-
|
|
2006
|
-
|
|
2007
|
-
|
|
2008
|
-
{
|
|
2009
|
-
const centerOffset = dim[prop] / 2;
|
|
2010
|
-
const centerTargetOffset =
|
|
2011
|
-
targetAttach[dir] === 'center' ? -targetDim[prop] / 2 : 0;
|
|
2002
|
+
if (flip !== true && !includes(flip, dir)) {
|
|
2003
|
+
continue;
|
|
2004
|
+
}
|
|
2012
2005
|
|
|
2013
|
-
|
|
2014
|
-
|
|
2015
|
-
apply(centerOffset, centerTargetOffset) ||
|
|
2016
|
-
apply(-centerOffset, -centerTargetOffset)) ||
|
|
2017
|
-
apply(elemOffset, targetOffset));
|
|
2006
|
+
const willFlip =
|
|
2007
|
+
!intersectLine(position, targetDim, i) && intersectLine(position, targetDim, 1 - i);
|
|
2018
2008
|
|
|
2019
|
-
|
|
2009
|
+
viewport = getIntersectionArea(...viewports, willFlip ? null : boundary);
|
|
2010
|
+
const isInStartBoundary = position[start] >= viewport[start];
|
|
2011
|
+
const isInEndBoundary = position[end] <= viewport[end];
|
|
2020
2012
|
|
|
2021
|
-
|
|
2022
|
-
|
|
2023
|
-
|
|
2013
|
+
if (isInStartBoundary && isInEndBoundary) {
|
|
2014
|
+
continue;
|
|
2015
|
+
}
|
|
2024
2016
|
|
|
2017
|
+
let offsetBy;
|
|
2025
2018
|
|
|
2026
|
-
|
|
2027
|
-
|
|
2019
|
+
// Flip
|
|
2020
|
+
if (willFlip) {
|
|
2021
|
+
if (
|
|
2022
|
+
elAttach[i] === end && isInStartBoundary ||
|
|
2023
|
+
elAttach[i] === start && isInEndBoundary)
|
|
2024
|
+
{
|
|
2025
|
+
continue;
|
|
2026
|
+
}
|
|
2028
2027
|
|
|
2029
|
-
|
|
2030
|
-
|
|
2031
|
-
|
|
2032
|
-
|
|
2033
|
-
|
|
2034
|
-
|
|
2035
|
-
|
|
2036
|
-
|
|
2028
|
+
offsetBy =
|
|
2029
|
+
(elAttach[i] === start ?
|
|
2030
|
+
-position[prop] :
|
|
2031
|
+
elAttach[i] === end ?
|
|
2032
|
+
position[prop] :
|
|
2033
|
+
0) + (
|
|
2034
|
+
targetAttach[i] === start ?
|
|
2035
|
+
targetDim[prop] :
|
|
2036
|
+
targetAttach[i] === end ?
|
|
2037
|
+
-targetDim[prop] :
|
|
2038
|
+
0) -
|
|
2039
|
+
elOffset[i] * 2;
|
|
2040
|
+
|
|
2041
|
+
// Move
|
|
2042
|
+
} else {
|
|
2043
|
+
offsetBy =
|
|
2044
|
+
clamp(
|
|
2045
|
+
clamp(position[start], viewport[start], viewport[end] - position[prop]),
|
|
2046
|
+
targetDim[start] - position[prop] + elOffset[i],
|
|
2047
|
+
targetDim[end] - elOffset[i]) -
|
|
2048
|
+
position[start];
|
|
2049
|
+
}
|
|
2037
2050
|
|
|
2038
|
-
|
|
2039
|
-
|
|
2040
|
-
}
|
|
2041
|
-
});
|
|
2042
|
-
});
|
|
2051
|
+
position[start] = position[dir] = position[start] + offsetBy;
|
|
2052
|
+
position[end] += offsetBy;
|
|
2043
2053
|
}
|
|
2044
2054
|
|
|
2045
|
-
|
|
2046
|
-
|
|
2047
|
-
return flipped;
|
|
2055
|
+
return position;
|
|
2048
2056
|
}
|
|
2049
2057
|
|
|
2050
|
-
function
|
|
2051
|
-
|
|
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
|
-
});
|
|
2058
|
+
function moveBy(start, end, dim) {
|
|
2059
|
+
return start === 'center' ? dim / 2 : start === end ? dim : 0;
|
|
2058
2060
|
}
|
|
2059
2061
|
|
|
2060
|
-
function
|
|
2061
|
-
|
|
2062
|
-
const
|
|
2063
|
-
|
|
2064
|
-
|
|
2065
|
-
|
|
2066
|
-
|
|
2067
|
-
|
|
2068
|
-
|
|
2069
|
-
|
|
2070
|
-
|
|
2071
|
-
['
|
|
2062
|
+
function getIntersectionArea() {
|
|
2063
|
+
let intersection;for (var _len = arguments.length, elements = new Array(_len), _key = 0; _key < _len; _key++) {elements[_key] = arguments[_key];}
|
|
2064
|
+
for (const el of elements.filter(Boolean)) {
|
|
2065
|
+
const rect = offset(el);
|
|
2066
|
+
if (!intersection) {
|
|
2067
|
+
intersection = rect;
|
|
2068
|
+
continue;
|
|
2069
|
+
}
|
|
2070
|
+
for (const prop of ['left', 'top']) {
|
|
2071
|
+
intersection[prop] = Math.max(rect[prop], intersection[prop]);
|
|
2072
|
+
}
|
|
2073
|
+
for (const prop of ['right', 'bottom']) {
|
|
2074
|
+
intersection[prop] = Math.min(rect[prop], intersection[prop]);
|
|
2075
|
+
}
|
|
2072
2076
|
}
|
|
2073
|
-
|
|
2074
|
-
return {
|
|
2075
|
-
x: x.test(pos[0]) ? pos[0] : 'center',
|
|
2076
|
-
y: y.test(pos[1]) ? pos[1] : 'center' };
|
|
2077
|
-
|
|
2077
|
+
return intersection;
|
|
2078
2078
|
}
|
|
2079
2079
|
|
|
2080
|
-
function
|
|
2081
|
-
const [
|
|
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 };
|
|
2086
|
-
|
|
2080
|
+
function intersectLine(dimA, dimB, dir) {
|
|
2081
|
+
const [,, start, end] = dirs[dir];
|
|
2082
|
+
return dimA[end] > dimB[start] && dimB[end] > dimA[start];
|
|
2087
2083
|
}
|
|
2088
2084
|
|
|
2089
2085
|
var util = /*#__PURE__*/Object.freeze({
|
|
@@ -2892,7 +2888,7 @@
|
|
|
2892
2888
|
UIkit.data = '__uikit__';
|
|
2893
2889
|
UIkit.prefix = 'uk-';
|
|
2894
2890
|
UIkit.options = {};
|
|
2895
|
-
UIkit.version = '3.13.
|
|
2891
|
+
UIkit.version = '3.13.8-dev.2fb6bed58';
|
|
2896
2892
|
|
|
2897
2893
|
globalAPI(UIkit);
|
|
2898
2894
|
hooksAPI(UIkit);
|
|
@@ -3512,9 +3508,8 @@
|
|
|
3512
3508
|
|
|
3513
3509
|
methods: {
|
|
3514
3510
|
positionAt(element, target, boundary) {
|
|
3515
|
-
const
|
|
3516
|
-
const
|
|
3517
|
-
const align = this.pos[1];
|
|
3511
|
+
const [dir, align] = this.pos;
|
|
3512
|
+
const axis = this.getAxis(dir);
|
|
3518
3513
|
|
|
3519
3514
|
let { offset: offset$1 } = this;
|
|
3520
3515
|
if (!isNumeric(offset$1)) {
|
|
@@ -3525,28 +3520,67 @@
|
|
|
3525
3520
|
0;
|
|
3526
3521
|
}
|
|
3527
3522
|
offset$1 = toPx(offset$1) + toPx(getCssVar('position-offset', element));
|
|
3523
|
+
offset$1 = [includes(['left', 'top'], dir) ? -offset$1 : +offset$1, 0];
|
|
3528
3524
|
|
|
3529
|
-
const
|
|
3530
|
-
|
|
3531
|
-
|
|
3532
|
-
|
|
3533
|
-
|
|
3534
|
-
axis === '
|
|
3535
|
-
|
|
3536
|
-
|
|
3537
|
-
|
|
3538
|
-
|
|
3539
|
-
|
|
3540
|
-
|
|
3541
|
-
|
|
3542
|
-
|
|
3543
|
-
|
|
3544
|
-
|
|
3545
|
-
|
|
3546
|
-
|
|
3547
|
-
|
|
3525
|
+
const attach = {
|
|
3526
|
+
element: [flipPosition(dir), align],
|
|
3527
|
+
target: [dir, align] };
|
|
3528
|
+
|
|
3529
|
+
|
|
3530
|
+
if (axis === 'y') {
|
|
3531
|
+
for (const prop in attach) {
|
|
3532
|
+
attach[prop] = attach[prop].reverse();
|
|
3533
|
+
}
|
|
3534
|
+
offset$1 = offset$1.reverse();
|
|
3535
|
+
}
|
|
3536
|
+
|
|
3537
|
+
positionAt(element, target, {
|
|
3538
|
+
attach,
|
|
3539
|
+
offset: offset$1,
|
|
3540
|
+
boundary,
|
|
3541
|
+
flip: this.flip });
|
|
3542
|
+
|
|
3543
|
+
|
|
3544
|
+
[this.dir, this.align] = getAlignment(element, target, this.pos);
|
|
3545
|
+
},
|
|
3546
|
+
|
|
3547
|
+
getAxis(dir) {if (dir === void 0) {dir = this.dir;}
|
|
3548
|
+
return includes(['top', 'bottom'], dir) ? 'y' : 'x';
|
|
3548
3549
|
} } };
|
|
3549
3550
|
|
|
3551
|
+
|
|
3552
|
+
|
|
3553
|
+
function getAlignment(el, target, _ref) {let [dir, align] = _ref;
|
|
3554
|
+
const elOffset = offset(el);
|
|
3555
|
+
const targetOffset = offset(target);
|
|
3556
|
+
const properties = [
|
|
3557
|
+
['left', 'right'],
|
|
3558
|
+
['top', 'bottom']];
|
|
3559
|
+
|
|
3560
|
+
|
|
3561
|
+
for (const props of properties) {
|
|
3562
|
+
if (elOffset[props[0]] >= targetOffset[props[1]]) {
|
|
3563
|
+
dir = props[1];
|
|
3564
|
+
break;
|
|
3565
|
+
}
|
|
3566
|
+
if (elOffset[props[1]] <= targetOffset[props[0]]) {
|
|
3567
|
+
dir = props[0];
|
|
3568
|
+
break;
|
|
3569
|
+
}
|
|
3570
|
+
}
|
|
3571
|
+
|
|
3572
|
+
const props = includes(properties[0], dir) ? properties[1] : properties[0];
|
|
3573
|
+
if (elOffset[props[0]] === targetOffset[props[0]]) {
|
|
3574
|
+
align = props[0];
|
|
3575
|
+
} else if (elOffset[props[1]] === targetOffset[props[1]]) {
|
|
3576
|
+
align = props[1];
|
|
3577
|
+
} else {
|
|
3578
|
+
align = 'center';
|
|
3579
|
+
}
|
|
3580
|
+
|
|
3581
|
+
return [dir, align];
|
|
3582
|
+
}
|
|
3583
|
+
|
|
3550
3584
|
let active$1;
|
|
3551
3585
|
|
|
3552
3586
|
var drop = {
|
|
@@ -3581,8 +3615,11 @@
|
|
|
3581
3615
|
this.tracker = new MouseTracker();
|
|
3582
3616
|
},
|
|
3583
3617
|
|
|
3584
|
-
|
|
3618
|
+
beforeConnect() {
|
|
3585
3619
|
this.clsDrop = this.$props.clsDrop || "uk-" + this.$options.name;
|
|
3620
|
+
},
|
|
3621
|
+
|
|
3622
|
+
connected() {
|
|
3586
3623
|
addClass(this.$el, this.clsDrop);
|
|
3587
3624
|
|
|
3588
3625
|
if (this.toggle && !this.target) {
|