uikit 3.13.4 → 3.13.5-dev.a0a07b1b9
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 +4 -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 +51 -17
- 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 +170 -140
- 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 +169 -139
- package/dist/js/uikit.min.js +1 -1
- package/package.json +1 -1
- package/src/js/mixin/position.js +48 -15
- package/src/js/util/dimensions.js +2 -2
- package/src/js/util/position.js +125 -129
- package/tests/drop.html +1 -1
- package/tests/position.html +38 -39
package/dist/js/uikit-core.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! UIkit 3.13.
|
|
1
|
+
/*! UIkit 3.13.5-dev.a0a07b1b9 | 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() :
|
|
@@ -1014,8 +1014,8 @@
|
|
|
1014
1014
|
const offsetBy = { height: scrollY, width: scrollX };
|
|
1015
1015
|
|
|
1016
1016
|
for (const dir in dirs$1) {
|
|
1017
|
-
for (const
|
|
1018
|
-
currentOffset[
|
|
1017
|
+
for (const prop of dirs$1[dir]) {
|
|
1018
|
+
currentOffset[prop] += offsetBy[dir];
|
|
1019
1019
|
}
|
|
1020
1020
|
}
|
|
1021
1021
|
}
|
|
@@ -1930,157 +1930,153 @@
|
|
|
1930
1930
|
return document.scrollingElement || document.documentElement;
|
|
1931
1931
|
}
|
|
1932
1932
|
|
|
1933
|
-
const dirs =
|
|
1934
|
-
|
|
1935
|
-
|
|
1933
|
+
const dirs = [
|
|
1934
|
+
['width', 'x', 'left', 'right'],
|
|
1935
|
+
['height', 'y', 'top', 'bottom']];
|
|
1936
1936
|
|
|
1937
1937
|
|
|
1938
|
-
function positionAt(
|
|
1939
|
-
|
|
1940
|
-
|
|
1941
|
-
|
|
1942
|
-
|
|
1943
|
-
|
|
1944
|
-
targetOffset,
|
|
1945
|
-
flip,
|
|
1946
|
-
boundary)
|
|
1947
|
-
{
|
|
1948
|
-
elAttach = getPos(elAttach);
|
|
1949
|
-
targetAttach = getPos(targetAttach);
|
|
1938
|
+
function positionAt(element, target, options) {
|
|
1939
|
+
options = {
|
|
1940
|
+
attach: {
|
|
1941
|
+
element: ['left', 'top'],
|
|
1942
|
+
target: ['left', 'top'],
|
|
1943
|
+
...options.attach },
|
|
1950
1944
|
|
|
1951
|
-
|
|
1945
|
+
offset: [0, 0],
|
|
1946
|
+
...options };
|
|
1952
1947
|
|
|
1953
|
-
if (!element || !target) {
|
|
1954
|
-
return flipped;
|
|
1955
|
-
}
|
|
1956
1948
|
|
|
1957
|
-
const dim =
|
|
1958
|
-
|
|
1959
|
-
|
|
1949
|
+
const dim = options.flip ?
|
|
1950
|
+
attachToWithFlip(element, target, options) :
|
|
1951
|
+
attachTo(element, target, options);
|
|
1960
1952
|
|
|
1961
|
-
|
|
1962
|
-
|
|
1953
|
+
offset(element, dim);
|
|
1954
|
+
}
|
|
1963
1955
|
|
|
1964
|
-
|
|
1965
|
-
|
|
1956
|
+
function attachTo(element, target, options) {
|
|
1957
|
+
let { attach, offset: offsetBy } = {
|
|
1958
|
+
attach: {
|
|
1959
|
+
element: ['left', 'top'],
|
|
1960
|
+
target: ['left', 'top'],
|
|
1961
|
+
...options.attach },
|
|
1966
1962
|
|
|
1967
|
-
|
|
1968
|
-
|
|
1963
|
+
offset: [0, 0],
|
|
1964
|
+
...options };
|
|
1969
1965
|
|
|
1970
|
-
position.left += elOffset['x'];
|
|
1971
|
-
position.top += elOffset['y'];
|
|
1972
1966
|
|
|
1973
|
-
|
|
1974
|
-
|
|
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
|
+
}
|
|
1975
1980
|
|
|
1976
|
-
|
|
1977
|
-
|
|
1978
|
-
|
|
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);
|
|
1979
1985
|
|
|
1980
|
-
|
|
1986
|
+
let {
|
|
1987
|
+
flip,
|
|
1988
|
+
attach: { element: elAttach, target: targetAttach },
|
|
1989
|
+
offset: elOffset,
|
|
1990
|
+
boundary,
|
|
1991
|
+
viewport } =
|
|
1992
|
+
options;
|
|
1981
1993
|
|
|
1982
|
-
|
|
1983
|
-
if (!(flip === true || includes(flip, dir))) {
|
|
1984
|
-
return;
|
|
1985
|
-
}
|
|
1994
|
+
viewports.push(viewport);
|
|
1986
1995
|
|
|
1987
|
-
|
|
1988
|
-
|
|
1989
|
-
elAttach[dir] === align ?
|
|
1990
|
-
-dim[prop] :
|
|
1991
|
-
elAttach[dir] === alignFlip ?
|
|
1992
|
-
dim[prop] :
|
|
1993
|
-
0;
|
|
1996
|
+
for (const i in dirs) {
|
|
1997
|
+
const [prop, dir, start, end] = dirs[i];
|
|
1994
1998
|
|
|
1995
|
-
|
|
1996
|
-
|
|
1997
|
-
|
|
1998
|
-
targetAttach[dir] === alignFlip ?
|
|
1999
|
-
-targetDim[prop] :
|
|
2000
|
-
0;
|
|
1999
|
+
if (flip !== true && !includes(flip, dir)) {
|
|
2000
|
+
continue;
|
|
2001
|
+
}
|
|
2001
2002
|
|
|
2002
|
-
|
|
2003
|
-
|
|
2004
|
-
position[align] + dim[prop] > boundary[alignFlip])
|
|
2005
|
-
{
|
|
2006
|
-
const centerOffset = dim[prop] / 2;
|
|
2007
|
-
const centerTargetOffset =
|
|
2008
|
-
targetAttach[dir] === 'center' ? -targetDim[prop] / 2 : 0;
|
|
2003
|
+
const willFlip =
|
|
2004
|
+
!intersectLine(position, targetDim, i) && intersectLine(position, targetDim, 1 - i);
|
|
2009
2005
|
|
|
2010
|
-
|
|
2011
|
-
|
|
2012
|
-
|
|
2013
|
-
apply(-centerOffset, -centerTargetOffset)) ||
|
|
2014
|
-
apply(elemOffset, targetOffset));
|
|
2006
|
+
viewport = getIntersectionArea(...viewports, willFlip ? null : boundary);
|
|
2007
|
+
const isInStartBoundary = position[start] >= viewport[start];
|
|
2008
|
+
const isInEndBoundary = position[end] <= viewport[end];
|
|
2015
2009
|
|
|
2016
|
-
|
|
2017
|
-
|
|
2018
|
-
|
|
2019
|
-
const newVal = toFloat(
|
|
2020
|
-
(position[align] + elemOffset + targetOffset - elOffset[dir] * 2).toFixed(4));
|
|
2010
|
+
if (isInStartBoundary && isInEndBoundary) {
|
|
2011
|
+
continue;
|
|
2012
|
+
}
|
|
2021
2013
|
|
|
2014
|
+
let offsetBy;
|
|
2022
2015
|
|
|
2023
|
-
|
|
2024
|
-
|
|
2016
|
+
// Flip
|
|
2017
|
+
if (willFlip) {
|
|
2018
|
+
if (
|
|
2019
|
+
elAttach[i] === end && isInStartBoundary ||
|
|
2020
|
+
elAttach[i] === start && isInEndBoundary)
|
|
2021
|
+
{
|
|
2022
|
+
continue;
|
|
2023
|
+
}
|
|
2025
2024
|
|
|
2026
|
-
|
|
2027
|
-
|
|
2028
|
-
|
|
2029
|
-
|
|
2030
|
-
|
|
2031
|
-
|
|
2032
|
-
|
|
2033
|
-
|
|
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
|
+
}
|
|
2034
2047
|
|
|
2035
|
-
|
|
2036
|
-
|
|
2037
|
-
}
|
|
2038
|
-
});
|
|
2039
|
-
});
|
|
2048
|
+
position[start] = position[dir] = position[start] + offsetBy;
|
|
2049
|
+
position[end] += offsetBy;
|
|
2040
2050
|
}
|
|
2041
2051
|
|
|
2042
|
-
|
|
2043
|
-
|
|
2044
|
-
return flipped;
|
|
2052
|
+
return position;
|
|
2045
2053
|
}
|
|
2046
2054
|
|
|
2047
|
-
function
|
|
2048
|
-
|
|
2049
|
-
if (attach[dir] === alignFlip) {
|
|
2050
|
-
position[align] += dim[prop] * factor;
|
|
2051
|
-
} else if (attach[dir] === 'center') {
|
|
2052
|
-
position[align] += dim[prop] * factor / 2;
|
|
2053
|
-
}
|
|
2054
|
-
});
|
|
2055
|
+
function moveBy(start, end, dim) {
|
|
2056
|
+
return start === 'center' ? dim / 2 : start === end ? dim : 0;
|
|
2055
2057
|
}
|
|
2056
2058
|
|
|
2057
|
-
function
|
|
2058
|
-
|
|
2059
|
-
const
|
|
2060
|
-
|
|
2061
|
-
|
|
2062
|
-
|
|
2063
|
-
|
|
2064
|
-
|
|
2065
|
-
|
|
2066
|
-
|
|
2067
|
-
|
|
2068
|
-
['
|
|
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
|
+
}
|
|
2069
2073
|
}
|
|
2070
|
-
|
|
2071
|
-
return {
|
|
2072
|
-
x: x.test(pos[0]) ? pos[0] : 'center',
|
|
2073
|
-
y: y.test(pos[1]) ? pos[1] : 'center' };
|
|
2074
|
-
|
|
2074
|
+
return intersection;
|
|
2075
2075
|
}
|
|
2076
2076
|
|
|
2077
|
-
function
|
|
2078
|
-
const [
|
|
2079
|
-
|
|
2080
|
-
return {
|
|
2081
|
-
x: x ? toFloat(x) * (endsWith(x, '%') ? width / 100 : 1) : 0,
|
|
2082
|
-
y: y ? toFloat(y) * (endsWith(y, '%') ? height / 100 : 1) : 0 };
|
|
2083
|
-
|
|
2077
|
+
function intersectLine(dimA, dimB, dir) {
|
|
2078
|
+
const [,, start, end] = dirs[dir];
|
|
2079
|
+
return dimA[end] > dimB[start] && dimB[end] > dimA[start];
|
|
2084
2080
|
}
|
|
2085
2081
|
|
|
2086
2082
|
var util = /*#__PURE__*/Object.freeze({
|
|
@@ -2889,7 +2885,7 @@
|
|
|
2889
2885
|
UIkit.data = '__uikit__';
|
|
2890
2886
|
UIkit.prefix = 'uk-';
|
|
2891
2887
|
UIkit.options = {};
|
|
2892
|
-
UIkit.version = '3.13.
|
|
2888
|
+
UIkit.version = '3.13.5-dev.a0a07b1b9';
|
|
2893
2889
|
|
|
2894
2890
|
globalAPI(UIkit);
|
|
2895
2891
|
hooksAPI(UIkit);
|
|
@@ -3523,27 +3519,61 @@
|
|
|
3523
3519
|
}
|
|
3524
3520
|
offset$1 += toPx(getCssVar('position-margin-offset', element));
|
|
3525
3521
|
|
|
3526
|
-
|
|
3527
|
-
|
|
3528
|
-
|
|
3529
|
-
|
|
3530
|
-
|
|
3531
|
-
|
|
3532
|
-
|
|
3533
|
-
|
|
3534
|
-
|
|
3535
|
-
|
|
3536
|
-
|
|
3537
|
-
|
|
3538
|
-
|
|
3539
|
-
this.dir =
|
|
3540
|
-
this.align = axis === 'x' ? y : x;
|
|
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);
|
|
3541
3536
|
},
|
|
3542
3537
|
|
|
3543
3538
|
getAxis() {
|
|
3544
|
-
return
|
|
3539
|
+
return includes(['top', 'bottom'], this.dir) ? 'y' : 'x';
|
|
3545
3540
|
} } };
|
|
3546
3541
|
|
|
3542
|
+
|
|
3543
|
+
|
|
3544
|
+
function getAlignment(el, target) {
|
|
3545
|
+
const elOffset = offset(el);
|
|
3546
|
+
const targetOffset = offset(target);
|
|
3547
|
+
const properties = [
|
|
3548
|
+
['left', 'right'],
|
|
3549
|
+
['top', 'bottom']];
|
|
3550
|
+
|
|
3551
|
+
|
|
3552
|
+
let dir;
|
|
3553
|
+
for (const props of properties) {
|
|
3554
|
+
if (elOffset[props[0]] >= targetOffset[props[1]]) {
|
|
3555
|
+
dir = props[1];
|
|
3556
|
+
break;
|
|
3557
|
+
}
|
|
3558
|
+
if (elOffset[props[1]] <= targetOffset[props[0]]) {
|
|
3559
|
+
dir = props[0];
|
|
3560
|
+
break;
|
|
3561
|
+
}
|
|
3562
|
+
}
|
|
3563
|
+
|
|
3564
|
+
let align;
|
|
3565
|
+
const props = includes(properties[0], dir) ? properties[1] : properties[0];
|
|
3566
|
+
if (elOffset[props[0]] === targetOffset[props[0]]) {
|
|
3567
|
+
align = props[0];
|
|
3568
|
+
} else if (elOffset[props[1]] === targetOffset[props[1]]) {
|
|
3569
|
+
align = props[1];
|
|
3570
|
+
} else {
|
|
3571
|
+
align = 'center';
|
|
3572
|
+
}
|
|
3573
|
+
|
|
3574
|
+
return [dir, align];
|
|
3575
|
+
}
|
|
3576
|
+
|
|
3547
3577
|
let active$1;
|
|
3548
3578
|
|
|
3549
3579
|
var drop = {
|