uikit 3.14.1-dev.eeb4cd6ae → 3.14.2-dev.35b3deec9
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 +45 -3
- package/build/util.js +8 -2
- package/dist/css/uikit-core-rtl.css +93 -21
- package/dist/css/uikit-core-rtl.min.css +1 -1
- package/dist/css/uikit-core.css +93 -21
- package/dist/css/uikit-core.min.css +1 -1
- package/dist/css/uikit-rtl.css +99 -33
- package/dist/css/uikit-rtl.min.css +1 -1
- package/dist/css/uikit.css +99 -33
- 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 +2 -2
- package/dist/js/components/filter.min.js +1 -1
- package/dist/js/components/lightbox-panel.js +111 -15
- package/dist/js/components/lightbox-panel.min.js +1 -1
- package/dist/js/components/lightbox.js +111 -15
- 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 +18 -3
- package/dist/js/components/parallax.min.js +1 -1
- package/dist/js/components/slider-parallax.js +2 -2
- 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 +2 -2
- 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 +147 -34
- 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 +280 -132
- 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 +298 -135
- package/dist/js/uikit.min.js +1 -1
- package/package.json +11 -11
- package/src/js/api/hooks.js +1 -1
- package/src/js/components/filter.js +1 -1
- package/src/js/components/parallax.js +16 -1
- package/src/js/core/accordion.js +3 -3
- package/src/js/core/alert.js +1 -1
- package/src/js/core/drop.js +47 -18
- package/src/js/core/height-viewport.js +15 -11
- package/src/js/core/margin.js +1 -1
- package/src/js/core/navbar.js +19 -18
- package/src/js/core/scrollspy.js +6 -1
- package/src/js/core/toggle.js +9 -8
- package/src/js/mixin/parallax.js +1 -1
- package/src/js/mixin/position.js +36 -20
- package/src/js/mixin/togglable.js +116 -18
- package/src/js/util/animation.js +1 -0
- package/src/js/util/position.js +24 -22
- package/src/js/util/viewport.js +7 -14
- package/src/less/components/drop.less +19 -4
- package/src/less/components/dropdown.less +21 -4
- package/src/less/components/margin.less +13 -14
- package/src/less/components/modal.less +19 -4
- package/src/less/components/nav.less +1 -1
- package/src/less/components/navbar.less +60 -19
- package/src/less/components/offcanvas.less +21 -21
- package/src/less/components/position.less +1 -1
- package/src/less/components/sticky.less +7 -0
- package/src/less/components/tooltip.less +1 -0
- package/src/less/components/utility.less +1 -2
- package/src/less/theme/dropdown.less +11 -0
- package/src/less/theme/navbar.less +10 -10
- package/src/scss/components/drop.scss +19 -4
- package/src/scss/components/dropdown.scss +21 -4
- package/src/scss/components/margin.scss +13 -14
- package/src/scss/components/modal.scss +19 -4
- package/src/scss/components/nav.scss +1 -1
- package/src/scss/components/navbar.scss +49 -8
- package/src/scss/components/offcanvas.scss +21 -21
- package/src/scss/components/position.scss +1 -1
- package/src/scss/components/sticky.scss +7 -0
- package/src/scss/components/tooltip.scss +1 -0
- package/src/scss/components/utility.scss +1 -2
- package/src/scss/mixins-theme.scss +8 -10
- package/src/scss/mixins.scss +2 -0
- package/src/scss/theme/dropdown.scss +8 -0
- package/src/scss/theme/navbar.scss +7 -0
- package/src/scss/variables-theme.scss +26 -11
- package/src/scss/variables.scss +24 -11
- package/tests/drop.html +165 -4
- package/tests/dropdown.html +234 -13
- package/tests/height-viewport.html +62 -0
- package/tests/navbar.html +333 -64
- package/tests/notification.html +1 -1
- package/tests/offcanvas.html +8 -8
- package/tests/sticky-navbar.html +132 -0
- package/tests/sticky-parallax.html +2 -1
- package/tests/sticky.html +5 -4
package/dist/js/uikit-core.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! UIkit 3.14.
|
|
1
|
+
/*! UIkit 3.14.2-dev.35b3deec9 | 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() :
|
|
@@ -868,6 +868,7 @@
|
|
|
868
868
|
}
|
|
869
869
|
|
|
870
870
|
function transition(element, props, duration, timing) {if (duration === void 0) {duration = 400;}if (timing === void 0) {timing = 'linear';}
|
|
871
|
+
duration = Math.round(duration);
|
|
871
872
|
return Promise.all(
|
|
872
873
|
toNodes(element).map(
|
|
873
874
|
(element) =>
|
|
@@ -1886,7 +1887,7 @@
|
|
|
1886
1887
|
return clamp((scrollTop - start) / (end - start));
|
|
1887
1888
|
}
|
|
1888
1889
|
|
|
1889
|
-
function scrollParents(element, overflowRe, scrollable) {if (overflowRe === void 0) {overflowRe = /auto|scroll|hidden/;}if (scrollable === void 0) {scrollable = false;}
|
|
1890
|
+
function scrollParents(element, overflowRe, scrollable) {if (overflowRe === void 0) {overflowRe = /auto|scroll|hidden|clip/;}if (scrollable === void 0) {scrollable = false;}
|
|
1890
1891
|
const scrollEl = scrollingElement(element);
|
|
1891
1892
|
|
|
1892
1893
|
let ancestors = parents(element).reverse();
|
|
@@ -1911,32 +1912,25 @@
|
|
|
1911
1912
|
function offsetViewport(scrollElement) {
|
|
1912
1913
|
let viewportElement = getViewport$1(scrollElement);
|
|
1913
1914
|
|
|
1914
|
-
// iOS 12 returns <body> as scrollingElement
|
|
1915
|
-
if (viewportElement === scrollingElement(viewportElement)) {
|
|
1916
|
-
viewportElement = document.documentElement;
|
|
1917
|
-
}
|
|
1918
|
-
|
|
1919
1915
|
let rect = offset(viewportElement);
|
|
1920
1916
|
for (let [prop, dir, start, end] of [
|
|
1921
1917
|
['width', 'x', 'left', 'right'],
|
|
1922
1918
|
['height', 'y', 'top', 'bottom']])
|
|
1923
1919
|
{
|
|
1924
|
-
if (!isWindow(
|
|
1920
|
+
if (!isWindow(viewportElement)) {
|
|
1925
1921
|
rect[start] += toFloat(css(viewportElement, "border" + ucfirst(start) + "Width"));
|
|
1922
|
+
} else {
|
|
1923
|
+
// iOS 12 returns <body> as scrollingElement
|
|
1924
|
+
viewportElement = viewportElement.document.documentElement;
|
|
1926
1925
|
}
|
|
1927
|
-
rect[prop] = rect[dir] = (
|
|
1928
|
-
isWindow(viewportElement) ? scrollingElement(viewportElement) : viewportElement)["client" +
|
|
1929
|
-
ucfirst(prop)];
|
|
1926
|
+
rect[prop] = rect[dir] = viewportElement["client" + ucfirst(prop)];
|
|
1930
1927
|
rect[end] = rect[prop] + rect[start];
|
|
1931
1928
|
}
|
|
1932
1929
|
return rect;
|
|
1933
1930
|
}
|
|
1934
1931
|
|
|
1935
1932
|
function scrollingElement(element) {
|
|
1936
|
-
|
|
1937
|
-
document: { scrollingElement } } =
|
|
1938
|
-
toWindow(element);
|
|
1939
|
-
return scrollingElement;
|
|
1933
|
+
return toWindow(element).document.scrollingElement;
|
|
1940
1934
|
}
|
|
1941
1935
|
|
|
1942
1936
|
function getViewport$1(scrollElement) {
|
|
@@ -1990,6 +1984,10 @@
|
|
|
1990
1984
|
return position;
|
|
1991
1985
|
}
|
|
1992
1986
|
|
|
1987
|
+
function moveBy(start, end, dim) {
|
|
1988
|
+
return start === 'center' ? dim / 2 : start === end ? dim : 0;
|
|
1989
|
+
}
|
|
1990
|
+
|
|
1993
1991
|
function attachToWithFlip(element, target, options) {
|
|
1994
1992
|
const position = attachTo(element, target, options);
|
|
1995
1993
|
const targetDim = offset(target);
|
|
@@ -2000,7 +1998,7 @@
|
|
|
2000
1998
|
offset: elOffset,
|
|
2001
1999
|
boundary,
|
|
2002
2000
|
viewport,
|
|
2003
|
-
|
|
2001
|
+
viewportOffset } =
|
|
2004
2002
|
options;
|
|
2005
2003
|
|
|
2006
2004
|
let viewports = scrollParents(element);
|
|
@@ -2021,9 +2019,9 @@
|
|
|
2021
2019
|
|
|
2022
2020
|
viewport = getIntersectionArea(...viewports.filter(Boolean).map(offsetViewport));
|
|
2023
2021
|
|
|
2024
|
-
if (
|
|
2025
|
-
viewport[start] +=
|
|
2026
|
-
viewport[end] -=
|
|
2022
|
+
if (viewportOffset) {
|
|
2023
|
+
viewport[start] += viewportOffset;
|
|
2024
|
+
viewport[end] -= viewportOffset;
|
|
2027
2025
|
}
|
|
2028
2026
|
|
|
2029
2027
|
if (boundary && !willFlip && position[prop] <= offset(boundary)[prop]) {
|
|
@@ -2080,19 +2078,21 @@
|
|
|
2080
2078
|
return false;
|
|
2081
2079
|
}
|
|
2082
2080
|
|
|
2083
|
-
|
|
2084
|
-
|
|
2085
|
-
|
|
2086
|
-
|
|
2087
|
-
|
|
2081
|
+
if (flip === true || includes(flip, dirs[1 - i][1])) {
|
|
2082
|
+
const newPos = attachToWithFlip(element, target, {
|
|
2083
|
+
...options,
|
|
2084
|
+
attach: {
|
|
2085
|
+
element: elAttach.map(flipDir).reverse(),
|
|
2086
|
+
target: targetAttach.map(flipDir).reverse() },
|
|
2088
2087
|
|
|
2089
|
-
|
|
2090
|
-
|
|
2091
|
-
|
|
2088
|
+
offset: elOffset.reverse(),
|
|
2089
|
+
flip: flip === true ? flip : [...flip, dirs[1 - i][1]],
|
|
2090
|
+
recursion: true });
|
|
2092
2091
|
|
|
2093
2092
|
|
|
2094
|
-
|
|
2095
|
-
|
|
2093
|
+
if (newPos && isInScrollArea(newPos, scrollElement, 1 - i)) {
|
|
2094
|
+
return newPos;
|
|
2095
|
+
}
|
|
2096
2096
|
}
|
|
2097
2097
|
}
|
|
2098
2098
|
|
|
@@ -2113,10 +2113,6 @@
|
|
|
2113
2113
|
return offsetPosition;
|
|
2114
2114
|
}
|
|
2115
2115
|
|
|
2116
|
-
function moveBy(start, end, dim) {
|
|
2117
|
-
return start === 'center' ? dim / 2 : start === end ? dim : 0;
|
|
2118
|
-
}
|
|
2119
|
-
|
|
2120
2116
|
function getIntersectionArea() {
|
|
2121
2117
|
let area = {};for (var _len = arguments.length, rects = new Array(_len), _key = 0; _key < _len; _key++) {rects[_key] = arguments[_key];}
|
|
2122
2118
|
for (const rect of rects) {
|
|
@@ -2474,7 +2470,7 @@
|
|
|
2474
2470
|
const {
|
|
2475
2471
|
$options: { computed } } =
|
|
2476
2472
|
this;
|
|
2477
|
-
const values = { ...
|
|
2473
|
+
const values = { ...this._computed };
|
|
2478
2474
|
this._computed = {};
|
|
2479
2475
|
|
|
2480
2476
|
for (const key in computed) {
|
|
@@ -2954,7 +2950,7 @@
|
|
|
2954
2950
|
UIkit.data = '__uikit__';
|
|
2955
2951
|
UIkit.prefix = 'uk-';
|
|
2956
2952
|
UIkit.options = {};
|
|
2957
|
-
UIkit.version = '3.14.
|
|
2953
|
+
UIkit.version = '3.14.2-dev.35b3deec9';
|
|
2958
2954
|
|
|
2959
2955
|
globalAPI(UIkit);
|
|
2960
2956
|
hooksAPI(UIkit);
|
|
@@ -3046,6 +3042,7 @@
|
|
|
3046
3042
|
cls: Boolean,
|
|
3047
3043
|
animation: 'list',
|
|
3048
3044
|
duration: Number,
|
|
3045
|
+
velocity: Number,
|
|
3049
3046
|
origin: String,
|
|
3050
3047
|
transition: String },
|
|
3051
3048
|
|
|
@@ -3054,6 +3051,7 @@
|
|
|
3054
3051
|
cls: false,
|
|
3055
3052
|
animation: [false],
|
|
3056
3053
|
duration: 200,
|
|
3054
|
+
velocity: 0.2,
|
|
3057
3055
|
origin: false,
|
|
3058
3056
|
transition: 'ease',
|
|
3059
3057
|
clsEnter: 'uk-togglabe-enter',
|
|
@@ -3061,7 +3059,7 @@
|
|
|
3061
3059
|
|
|
3062
3060
|
initProps: {
|
|
3063
3061
|
overflow: '',
|
|
3064
|
-
|
|
3062
|
+
maxHeight: '',
|
|
3065
3063
|
paddingTop: '',
|
|
3066
3064
|
paddingBottom: '',
|
|
3067
3065
|
marginTop: '',
|
|
@@ -3071,7 +3069,7 @@
|
|
|
3071
3069
|
|
|
3072
3070
|
hideProps: {
|
|
3073
3071
|
overflow: 'hidden',
|
|
3074
|
-
|
|
3072
|
+
maxHeight: 0,
|
|
3075
3073
|
paddingTop: 0,
|
|
3076
3074
|
paddingBottom: 0,
|
|
3077
3075
|
marginTop: 0,
|
|
@@ -3086,7 +3084,7 @@
|
|
|
3086
3084
|
},
|
|
3087
3085
|
|
|
3088
3086
|
hasTransition(_ref2) {let { animation } = _ref2;
|
|
3089
|
-
return
|
|
3087
|
+
return startsWith(animation[0], 'slide');
|
|
3090
3088
|
} },
|
|
3091
3089
|
|
|
3092
3090
|
|
|
@@ -3105,9 +3103,9 @@
|
|
|
3105
3103
|
isFunction(animate) ?
|
|
3106
3104
|
animate :
|
|
3107
3105
|
animate === false || !this.hasAnimation ?
|
|
3108
|
-
this
|
|
3106
|
+
toggleInstant(this) :
|
|
3109
3107
|
this.hasTransition ?
|
|
3110
|
-
|
|
3108
|
+
toggleTransition(this) :
|
|
3111
3109
|
toggleAnimation(this))(
|
|
3112
3110
|
el, show);
|
|
3113
3111
|
|
|
@@ -3171,14 +3169,43 @@
|
|
|
3171
3169
|
|
|
3172
3170
|
|
|
3173
3171
|
|
|
3174
|
-
function
|
|
3172
|
+
function toggleInstant(_ref3) {let { _toggle } = _ref3;
|
|
3173
|
+
return (el, show) => {
|
|
3174
|
+
Animation.cancel(el);
|
|
3175
|
+
Transition.cancel(el);
|
|
3176
|
+
return _toggle(el, show);
|
|
3177
|
+
};
|
|
3178
|
+
}
|
|
3179
|
+
|
|
3180
|
+
function toggleTransition(cmp) {
|
|
3181
|
+
switch (cmp.animation[0]) {
|
|
3182
|
+
case 'slide-left':
|
|
3183
|
+
return slideHorizontal(cmp);
|
|
3184
|
+
case 'slide-right':
|
|
3185
|
+
return slideHorizontal(cmp, true);}
|
|
3186
|
+
|
|
3187
|
+
return slide(cmp);
|
|
3188
|
+
}
|
|
3189
|
+
|
|
3190
|
+
function slide(_ref4)
|
|
3191
|
+
|
|
3192
|
+
|
|
3193
|
+
|
|
3194
|
+
|
|
3195
|
+
|
|
3196
|
+
|
|
3197
|
+
|
|
3198
|
+
{let { isToggled, duration, velocity, initProps, hideProps, transition, _toggle } = _ref4;
|
|
3175
3199
|
return (el, show) => {
|
|
3176
3200
|
const inProgress = Transition.inProgress(el);
|
|
3177
|
-
const inner =
|
|
3201
|
+
const inner =
|
|
3202
|
+
!inProgress && el.hasChildNodes() ?
|
|
3178
3203
|
toFloat(css(el.firstElementChild, 'marginTop')) +
|
|
3179
3204
|
toFloat(css(el.lastElementChild, 'marginBottom')) :
|
|
3180
3205
|
0;
|
|
3181
|
-
const currentHeight = isVisible(el) ?
|
|
3206
|
+
const currentHeight = isVisible(el) ? toFloat(css(el, 'height')) + inner : 0;
|
|
3207
|
+
|
|
3208
|
+
const props = inProgress ? css(el, Object.keys(initProps)) : show ? hideProps : initProps;
|
|
3182
3209
|
|
|
3183
3210
|
Transition.cancel(el);
|
|
3184
3211
|
|
|
@@ -3186,32 +3213,97 @@
|
|
|
3186
3213
|
_toggle(el, true);
|
|
3187
3214
|
}
|
|
3188
3215
|
|
|
3189
|
-
|
|
3216
|
+
css(el, 'maxHeight', '');
|
|
3190
3217
|
|
|
3191
3218
|
// Update child components first
|
|
3192
3219
|
fastdom.flush();
|
|
3193
3220
|
|
|
3194
|
-
const endHeight =
|
|
3195
|
-
|
|
3221
|
+
const endHeight = toFloat(css(el, 'height')) + inner;
|
|
3222
|
+
duration = velocity * endHeight + duration;
|
|
3223
|
+
|
|
3224
|
+
css(el, { ...props, maxHeight: currentHeight });
|
|
3196
3225
|
|
|
3197
3226
|
return (
|
|
3198
3227
|
show ?
|
|
3199
3228
|
Transition.start(
|
|
3200
3229
|
el,
|
|
3201
|
-
{ ...initProps, overflow: 'hidden',
|
|
3202
|
-
|
|
3230
|
+
{ ...initProps, overflow: 'hidden', maxHeight: endHeight },
|
|
3231
|
+
duration * (1 - currentHeight / endHeight),
|
|
3203
3232
|
transition) :
|
|
3204
3233
|
|
|
3205
3234
|
Transition.start(
|
|
3206
3235
|
el,
|
|
3207
3236
|
hideProps,
|
|
3208
|
-
|
|
3237
|
+
duration * (currentHeight / endHeight),
|
|
3209
3238
|
transition).
|
|
3210
3239
|
then(() => _toggle(el, false))).
|
|
3211
3240
|
then(() => css(el, initProps));
|
|
3212
3241
|
};
|
|
3213
3242
|
}
|
|
3214
3243
|
|
|
3244
|
+
function slideHorizontal(_ref5, right) {let { isToggled, duration, velocity, transition, _toggle } = _ref5;
|
|
3245
|
+
return (el, show) => {
|
|
3246
|
+
const visible = isVisible(el);
|
|
3247
|
+
const marginLeft = toFloat(css(el, 'marginLeft'));
|
|
3248
|
+
|
|
3249
|
+
Transition.cancel(el);
|
|
3250
|
+
|
|
3251
|
+
const [scrollElement] = scrollParents(el);
|
|
3252
|
+
css(scrollElement, 'overflowX', 'hidden');
|
|
3253
|
+
|
|
3254
|
+
if (!isToggled(el)) {
|
|
3255
|
+
_toggle(el, true);
|
|
3256
|
+
}
|
|
3257
|
+
|
|
3258
|
+
const width = toFloat(css(el, 'width'));
|
|
3259
|
+
duration = velocity * width + duration;
|
|
3260
|
+
|
|
3261
|
+
const percent = visible ? (width + marginLeft * (right ? -1 : 1)) / width * 100 : 0;
|
|
3262
|
+
const offsetEl = offset(el);
|
|
3263
|
+
const useClipPath = right ?
|
|
3264
|
+
offsetEl.right < scrollElement.clientWidth :
|
|
3265
|
+
Math.round(offsetEl.left) > 0;
|
|
3266
|
+
|
|
3267
|
+
css(el, {
|
|
3268
|
+
clipPath: useClipPath ?
|
|
3269
|
+
right ? "polygon(0 0," +
|
|
3270
|
+
percent + "% 0," + percent + "% 100%,0 100%)" : "polygon(" + (
|
|
3271
|
+
100 - percent) + "% 0,100% 0,100% 100%," + (100 - percent) + "% 100%)" :
|
|
3272
|
+
'',
|
|
3273
|
+
marginLeft: (100 - percent) * (right ? 1 : -1) / 100 * width });
|
|
3274
|
+
|
|
3275
|
+
|
|
3276
|
+
return (
|
|
3277
|
+
show ?
|
|
3278
|
+
Transition.start(
|
|
3279
|
+
el,
|
|
3280
|
+
{
|
|
3281
|
+
clipPath: useClipPath ? "polygon(0 0,100% 0,100% 100%,0 100%)" : '',
|
|
3282
|
+
marginLeft: 0 },
|
|
3283
|
+
|
|
3284
|
+
duration * (1 - percent / 100),
|
|
3285
|
+
transition) :
|
|
3286
|
+
|
|
3287
|
+
Transition.start(
|
|
3288
|
+
el,
|
|
3289
|
+
{
|
|
3290
|
+
clipPath: useClipPath ?
|
|
3291
|
+
right ? "polygon(0 0,0 0,0 100%,0 100%)" : "polygon(100% 0,100% 0,100% 100%,100% 100%)" :
|
|
3292
|
+
|
|
3293
|
+
|
|
3294
|
+
'',
|
|
3295
|
+
marginLeft: (right ? 1 : -1) * width },
|
|
3296
|
+
|
|
3297
|
+
duration * (percent / 100),
|
|
3298
|
+
transition).
|
|
3299
|
+
then(() => _toggle(el, false))).
|
|
3300
|
+
then(() => {
|
|
3301
|
+
css(scrollElement, 'overflowX', '');
|
|
3302
|
+
css(el, { clipPath: '', marginLeft: '' });
|
|
3303
|
+
});
|
|
3304
|
+
};
|
|
3305
|
+
}
|
|
3306
|
+
|
|
3215
3307
|
function toggleAnimation(cmp) {
|
|
3216
3308
|
return (el, show) => {
|
|
3217
3309
|
Animation.cancel(el);
|
|
@@ -3245,7 +3337,7 @@
|
|
|
3245
3337
|
data: {
|
|
3246
3338
|
targets: '> *',
|
|
3247
3339
|
active: false,
|
|
3248
|
-
animation: [
|
|
3340
|
+
animation: ['slide'],
|
|
3249
3341
|
collapsible: true,
|
|
3250
3342
|
multiple: false,
|
|
3251
3343
|
clsOpen: 'uk-open',
|
|
@@ -3355,7 +3447,7 @@
|
|
|
3355
3447
|
}
|
|
3356
3448
|
|
|
3357
3449
|
hide(content, false);
|
|
3358
|
-
await
|
|
3450
|
+
await slide(this)(el._wrapper, show);
|
|
3359
3451
|
hide(content, !show);
|
|
3360
3452
|
|
|
3361
3453
|
delete el._wrapper;
|
|
@@ -3389,7 +3481,7 @@
|
|
|
3389
3481
|
|
|
3390
3482
|
|
|
3391
3483
|
data: {
|
|
3392
|
-
animation: [
|
|
3484
|
+
animation: ['slide'],
|
|
3393
3485
|
selClose: '.uk-alert-close',
|
|
3394
3486
|
duration: 150,
|
|
3395
3487
|
hideProps: { opacity: 0, ...Togglable.data.hideProps } },
|
|
@@ -3570,49 +3662,66 @@
|
|
|
3570
3662
|
data: {
|
|
3571
3663
|
pos: "bottom-" + (isRtl ? 'right' : 'left'),
|
|
3572
3664
|
flip: true,
|
|
3573
|
-
offset: false,
|
|
3574
|
-
viewportPadding: 10 },
|
|
3665
|
+
offset: false },
|
|
3575
3666
|
|
|
3576
3667
|
|
|
3577
3668
|
connected() {
|
|
3578
3669
|
this.pos = this.$props.pos.split('-').concat('center').slice(0, 2);
|
|
3579
|
-
this.
|
|
3670
|
+
[this.dir, this.align] = this.pos;
|
|
3671
|
+
this.axis = includes(['top', 'bottom'], this.dir) ? 'y' : 'x';
|
|
3580
3672
|
},
|
|
3581
3673
|
|
|
3582
3674
|
methods: {
|
|
3583
3675
|
positionAt(element, target, boundary) {
|
|
3584
|
-
|
|
3585
|
-
|
|
3586
|
-
let { offset: offset$1 } = this;
|
|
3587
|
-
if (!isNumeric(offset$1)) {
|
|
3588
|
-
const node = $(offset$1);
|
|
3589
|
-
offset$1 = node ?
|
|
3590
|
-
offset(node)[this.axis === 'x' ? 'left' : 'top'] -
|
|
3591
|
-
offset(target)[this.axis === 'x' ? 'right' : 'bottom'] :
|
|
3592
|
-
0;
|
|
3593
|
-
}
|
|
3594
|
-
offset$1 = toPx(offset$1) + toPx(getCssVar('position-offset', element));
|
|
3595
|
-
offset$1 = [includes(['left', 'top'], dir) ? -offset$1 : +offset$1, 0];
|
|
3676
|
+
let offset = [this.getPositionOffset(element), this.getShiftOffset(element)];
|
|
3596
3677
|
|
|
3597
3678
|
const attach = {
|
|
3598
|
-
element: [flipPosition(dir), align],
|
|
3599
|
-
target: [dir, align] };
|
|
3679
|
+
element: [flipPosition(this.dir), this.align],
|
|
3680
|
+
target: [this.dir, this.align] };
|
|
3600
3681
|
|
|
3601
3682
|
|
|
3602
3683
|
if (this.axis === 'y') {
|
|
3603
3684
|
for (const prop in attach) {
|
|
3604
3685
|
attach[prop] = attach[prop].reverse();
|
|
3605
3686
|
}
|
|
3606
|
-
offset
|
|
3687
|
+
offset = offset.reverse();
|
|
3607
3688
|
}
|
|
3608
3689
|
|
|
3690
|
+
// Ensure none positioned element does not generate scrollbars
|
|
3691
|
+
const elDim = dimensions(element);
|
|
3692
|
+
css(element, { top: -elDim.height, left: -elDim.width });
|
|
3693
|
+
|
|
3609
3694
|
positionAt(element, target, {
|
|
3610
3695
|
attach,
|
|
3611
|
-
offset
|
|
3696
|
+
offset,
|
|
3612
3697
|
boundary,
|
|
3613
|
-
|
|
3614
|
-
|
|
3698
|
+
flip: this.flip,
|
|
3699
|
+
viewportOffset: this.getViewportOffset(element) });
|
|
3700
|
+
|
|
3701
|
+
},
|
|
3702
|
+
|
|
3703
|
+
getPositionOffset(element) {
|
|
3704
|
+
return (
|
|
3705
|
+
toPx(
|
|
3706
|
+
this.offset === false ? getCssVar('position-offset', element) : this.offset,
|
|
3707
|
+
this.axis === 'x' ? 'width' : 'height',
|
|
3708
|
+
element) * (
|
|
3709
|
+
includes(['left', 'top'], this.dir) ? -1 : 1));
|
|
3710
|
+
|
|
3711
|
+
},
|
|
3615
3712
|
|
|
3713
|
+
getShiftOffset(element) {
|
|
3714
|
+
return includes(['center', 'justify', 'stretch'], this.align) ?
|
|
3715
|
+
0 :
|
|
3716
|
+
toPx(
|
|
3717
|
+
getCssVar('position-shift-offset', element),
|
|
3718
|
+
this.axis === 'y' ? 'width' : 'height',
|
|
3719
|
+
element) * (
|
|
3720
|
+
includes(['left', 'top'], this.align) ? 1 : -1);
|
|
3721
|
+
},
|
|
3722
|
+
|
|
3723
|
+
getViewportOffset(element) {
|
|
3724
|
+
return toPx(getCssVar('position-viewport-offset', element));
|
|
3616
3725
|
} } };
|
|
3617
3726
|
|
|
3618
3727
|
let active$1;
|
|
@@ -3630,7 +3739,8 @@
|
|
|
3630
3739
|
delayShow: Number,
|
|
3631
3740
|
delayHide: Number,
|
|
3632
3741
|
display: String,
|
|
3633
|
-
clsDrop: String
|
|
3742
|
+
clsDrop: String,
|
|
3743
|
+
animateOut: Boolean },
|
|
3634
3744
|
|
|
3635
3745
|
|
|
3636
3746
|
data: {
|
|
@@ -3644,7 +3754,8 @@
|
|
|
3644
3754
|
clsDrop: false,
|
|
3645
3755
|
animation: ['uk-animation-fade'],
|
|
3646
3756
|
cls: 'uk-open',
|
|
3647
|
-
container: false
|
|
3757
|
+
container: false,
|
|
3758
|
+
animateOut: false },
|
|
3648
3759
|
|
|
3649
3760
|
|
|
3650
3761
|
created() {
|
|
@@ -3832,7 +3943,7 @@
|
|
|
3832
3943
|
}
|
|
3833
3944
|
}),
|
|
3834
3945
|
|
|
3835
|
-
...(this.display === 'static' ?
|
|
3946
|
+
...(this.display === 'static' && this.align !== 'stretch' ?
|
|
3836
3947
|
[] :
|
|
3837
3948
|
(() => {
|
|
3838
3949
|
const handler = () => this.$emit();
|
|
@@ -3893,7 +4004,7 @@
|
|
|
3893
4004
|
methods: {
|
|
3894
4005
|
show(target, delay) {if (target === void 0) {target = this.target;}if (delay === void 0) {delay = true;}
|
|
3895
4006
|
if (this.isToggled() && target && this.target && target !== this.target) {
|
|
3896
|
-
this.hide(false);
|
|
4007
|
+
this.hide(false, false);
|
|
3897
4008
|
}
|
|
3898
4009
|
|
|
3899
4010
|
this.target = target;
|
|
@@ -3913,7 +4024,7 @@
|
|
|
3913
4024
|
let prev;
|
|
3914
4025
|
while (active$1 && prev !== active$1 && !within(this.$el, active$1.$el)) {
|
|
3915
4026
|
prev = active$1;
|
|
3916
|
-
active$1.hide(false);
|
|
4027
|
+
active$1.hide(false, false);
|
|
3917
4028
|
}
|
|
3918
4029
|
}
|
|
3919
4030
|
|
|
@@ -3927,8 +4038,8 @@
|
|
|
3927
4038
|
|
|
3928
4039
|
},
|
|
3929
4040
|
|
|
3930
|
-
hide(delay) {if (delay === void 0) {delay = true;}
|
|
3931
|
-
const hide = () => this.toggleElement(this.$el, false,
|
|
4041
|
+
hide(delay, animate) {if (delay === void 0) {delay = true;}if (animate === void 0) {animate = true;}
|
|
4042
|
+
const hide = () => this.toggleElement(this.$el, false, this.animateOut && animate);
|
|
3932
4043
|
|
|
3933
4044
|
this.clearTimers();
|
|
3934
4045
|
|
|
@@ -3960,32 +4071,59 @@
|
|
|
3960
4071
|
position() {
|
|
3961
4072
|
removeClass(this.$el, this.clsDrop + "-stack");
|
|
3962
4073
|
toggleClass(this.$el, this.clsDrop + "-boundary", this.boundaryAlign);
|
|
4074
|
+
toggleClass(this.$el, this.clsDrop + "-stretch", this.align === 'stretch');
|
|
3963
4075
|
|
|
3964
4076
|
const boundary = query(this.boundary, this.$el);
|
|
3965
|
-
const
|
|
3966
|
-
const
|
|
4077
|
+
const target = boundary && this.boundaryAlign ? boundary : this.target;
|
|
4078
|
+
const [scrollParent] = scrollParents(
|
|
4079
|
+
boundary && this.boundaryAlign ? boundary : this.$el);
|
|
4080
|
+
|
|
4081
|
+
const scrollParentOffset = offset(scrollParent);
|
|
3967
4082
|
const boundaryOffset = boundary ? offset(boundary) : scrollParentOffset;
|
|
4083
|
+
const viewportOffset = this.getViewportOffset(this.$el);
|
|
3968
4084
|
|
|
3969
4085
|
css(this.$el, 'maxWidth', '');
|
|
3970
|
-
const maxWidth =
|
|
3971
|
-
scrollParentOffset.width - (this.boundaryAlign ? 0 : 2 * this.viewportPadding);
|
|
4086
|
+
const maxWidth = scrollParentOffset.width - 2 * viewportOffset;
|
|
3972
4087
|
|
|
3973
|
-
if (this.
|
|
4088
|
+
if (this.align === 'justify') {
|
|
3974
4089
|
const prop = this.axis === 'y' ? 'width' : 'height';
|
|
3975
|
-
|
|
3976
|
-
|
|
3977
|
-
|
|
4090
|
+
css(
|
|
4091
|
+
this.$el,
|
|
4092
|
+
prop,
|
|
4093
|
+
Math.min(
|
|
4094
|
+
(boundary ? boundaryOffset : offset(this.target))[prop],
|
|
4095
|
+
scrollParentOffset[prop] - 2 * viewportOffset));
|
|
4096
|
+
|
|
4097
|
+
|
|
4098
|
+
} else if (this.align === 'stretch') {
|
|
4099
|
+
this.flip = this.axis === 'y' ? 'x' : 'y';
|
|
4100
|
+
this.display = 'static';
|
|
4101
|
+
|
|
4102
|
+
const viewport = offsetViewport(scrollParent);
|
|
4103
|
+
const targetDim = offset(target);
|
|
4104
|
+
const elOffset = Math.abs(this.getPositionOffset(this.$el)) + viewportOffset;
|
|
4105
|
+
|
|
4106
|
+
css(this.$el, {
|
|
4107
|
+
width:
|
|
4108
|
+
this.axis === 'y' ?
|
|
4109
|
+
viewport.width :
|
|
4110
|
+
(this.dir === 'left' ?
|
|
4111
|
+
targetDim.left - viewport.left :
|
|
4112
|
+
viewport.right - targetDim.right) - elOffset,
|
|
4113
|
+
height:
|
|
4114
|
+
this.axis === 'x' ?
|
|
4115
|
+
viewport.height :
|
|
4116
|
+
(this.dir === 'top' ?
|
|
4117
|
+
targetDim.top - viewport.top :
|
|
4118
|
+
viewport.bottom - targetDim.bottom) - elOffset });
|
|
4119
|
+
|
|
3978
4120
|
} else if (this.$el.offsetWidth > maxWidth) {
|
|
3979
4121
|
addClass(this.$el, this.clsDrop + "-stack");
|
|
3980
4122
|
}
|
|
3981
4123
|
|
|
3982
4124
|
css(this.$el, 'maxWidth', maxWidth);
|
|
3983
4125
|
|
|
3984
|
-
this.positionAt(
|
|
3985
|
-
this.$el,
|
|
3986
|
-
boundary && this.boundaryAlign ? boundary : this.target,
|
|
3987
|
-
boundary);
|
|
3988
|
-
|
|
4126
|
+
this.positionAt(this.$el, target, boundary);
|
|
3989
4127
|
} } };
|
|
3990
4128
|
|
|
3991
4129
|
|
|
@@ -4108,7 +4246,7 @@
|
|
|
4108
4246
|
for (const row of rows) {
|
|
4109
4247
|
for (const column of row) {
|
|
4110
4248
|
toggleClass(column, this.margin, rows[0] !== row);
|
|
4111
|
-
toggleClass(column, this.firstColumn,
|
|
4249
|
+
toggleClass(column, this.firstColumn, columns[0].includes(column));
|
|
4112
4250
|
}
|
|
4113
4251
|
}
|
|
4114
4252
|
},
|
|
@@ -4452,7 +4590,7 @@
|
|
|
4452
4590
|
}
|
|
4453
4591
|
|
|
4454
4592
|
var heightViewport = {
|
|
4455
|
-
mixins: [
|
|
4593
|
+
mixins: [Resize],
|
|
4456
4594
|
|
|
4457
4595
|
props: {
|
|
4458
4596
|
expand: Boolean,
|
|
@@ -4470,7 +4608,7 @@
|
|
|
4470
4608
|
|
|
4471
4609
|
resizeTargets() {
|
|
4472
4610
|
// check for offsetTop change
|
|
4473
|
-
return [this.$el,
|
|
4611
|
+
return [this.$el, ...scrollParents(this.$el, /auto|scroll/)];
|
|
4474
4612
|
},
|
|
4475
4613
|
|
|
4476
4614
|
update: {
|
|
@@ -4482,21 +4620,25 @@
|
|
|
4482
4620
|
let minHeight = '';
|
|
4483
4621
|
const box = boxModelAdjust(this.$el, 'height', 'content-box');
|
|
4484
4622
|
|
|
4623
|
+
const [scrollElement] = scrollParents(this.$el, /auto|scroll/);
|
|
4624
|
+
const { height: viewportHeight } = offsetViewport(scrollElement);
|
|
4625
|
+
|
|
4485
4626
|
if (this.expand) {
|
|
4486
4627
|
minHeight = Math.max(
|
|
4487
|
-
|
|
4488
|
-
dimensions(
|
|
4489
|
-
dimensions(this.$el).height) -
|
|
4628
|
+
viewportHeight - (
|
|
4629
|
+
dimensions(scrollElement).height - dimensions(this.$el).height) -
|
|
4490
4630
|
box,
|
|
4491
4631
|
0);
|
|
4492
4632
|
|
|
4493
4633
|
} else {
|
|
4494
4634
|
// on mobile devices (iOS and Android) window.innerHeight !== 100vh
|
|
4495
|
-
minHeight =
|
|
4635
|
+
minHeight = "calc(" + (
|
|
4636
|
+
document.scrollingElement === scrollElement ? '100vh' : viewportHeight + "px");
|
|
4637
|
+
|
|
4496
4638
|
|
|
4497
4639
|
if (this.offsetTop) {
|
|
4498
|
-
const
|
|
4499
|
-
minHeight += top > 0 && top <
|
|
4640
|
+
const top = offsetPosition(this.$el)[0] - offsetPosition(scrollElement)[0];
|
|
4641
|
+
minHeight += top > 0 && top < viewportHeight / 2 ? " - " + top + "px" : '';
|
|
4500
4642
|
}
|
|
4501
4643
|
|
|
4502
4644
|
if (this.offsetBottom === true) {
|
|
@@ -5830,8 +5972,8 @@
|
|
|
5830
5972
|
return this.dropbar;
|
|
5831
5973
|
},
|
|
5832
5974
|
|
|
5833
|
-
handler(_, _ref9) {let { $el } = _ref9;
|
|
5834
|
-
if (!hasClass($el, this.clsDrop)) {
|
|
5975
|
+
handler(_, _ref9) {let { $el, align } = _ref9;
|
|
5976
|
+
if (!hasClass($el, this.clsDrop) || align === 'stretch') {
|
|
5835
5977
|
return;
|
|
5836
5978
|
}
|
|
5837
5979
|
|
|
@@ -5854,19 +5996,19 @@
|
|
|
5854
5996
|
return this.dropbar;
|
|
5855
5997
|
},
|
|
5856
5998
|
|
|
5857
|
-
handler(_, _ref10) {let { $el,
|
|
5858
|
-
if (!hasClass($el, this.clsDrop)) {
|
|
5999
|
+
handler(_, _ref10) {let { $el, align } = _ref10;
|
|
6000
|
+
if (!hasClass($el, this.clsDrop) || align === 'stretch') {
|
|
5859
6001
|
return;
|
|
5860
6002
|
}
|
|
5861
6003
|
|
|
5862
|
-
|
|
5863
|
-
|
|
5864
|
-
|
|
5865
|
-
|
|
5866
|
-
|
|
5867
|
-
|
|
6004
|
+
this._observer = observeResize($el, () =>
|
|
6005
|
+
this.transitionTo(
|
|
6006
|
+
offset($el).bottom -
|
|
6007
|
+
offset(this.dropbar).top +
|
|
6008
|
+
toFloat(css($el, 'marginBottom')),
|
|
6009
|
+
$el));
|
|
6010
|
+
|
|
5868
6011
|
|
|
5869
|
-
}
|
|
5870
6012
|
} },
|
|
5871
6013
|
|
|
5872
6014
|
|
|
@@ -5905,11 +6047,13 @@
|
|
|
5905
6047
|
return this.dropbar;
|
|
5906
6048
|
},
|
|
5907
6049
|
|
|
5908
|
-
handler(_, _ref12) {let { $el } = _ref12;
|
|
5909
|
-
if (!hasClass($el, this.clsDrop)) {
|
|
6050
|
+
handler(_, _ref12) {let { $el, align } = _ref12;
|
|
6051
|
+
if (!hasClass($el, this.clsDrop) || align === 'stretch') {
|
|
5910
6052
|
return;
|
|
5911
6053
|
}
|
|
5912
6054
|
|
|
6055
|
+
this._observer.disconnect();
|
|
6056
|
+
|
|
5913
6057
|
const active = this.getActive();
|
|
5914
6058
|
|
|
5915
6059
|
if (!active || (active == null ? void 0 : active.$el) === $el) {
|
|
@@ -5926,28 +6070,27 @@
|
|
|
5926
6070
|
|
|
5927
6071
|
transitionTo(newHeight, el) {
|
|
5928
6072
|
const { dropbar } = this;
|
|
5929
|
-
const oldHeight =
|
|
6073
|
+
const oldHeight = height(dropbar);
|
|
5930
6074
|
|
|
5931
6075
|
el = oldHeight < newHeight && el;
|
|
5932
6076
|
|
|
5933
|
-
css(el, '
|
|
6077
|
+
css(el, 'clipPath', "polygon(0 0,100% 0,100% " + oldHeight + "px,0 " + oldHeight + "px)");
|
|
5934
6078
|
|
|
5935
6079
|
height(dropbar, oldHeight);
|
|
5936
6080
|
|
|
5937
6081
|
Transition.cancel([el, dropbar]);
|
|
5938
|
-
|
|
6082
|
+
Promise.all([
|
|
5939
6083
|
Transition.start(dropbar, { height: newHeight }, this.duration),
|
|
5940
6084
|
Transition.start(
|
|
5941
6085
|
el,
|
|
5942
|
-
{
|
|
6086
|
+
{
|
|
6087
|
+
clipPath: "polygon(0 0,100% 0,100% " + newHeight + "px,0 " + newHeight + "px)" },
|
|
6088
|
+
|
|
5943
6089
|
this.duration)]).
|
|
5944
6090
|
|
|
5945
6091
|
|
|
5946
6092
|
catch(noop).
|
|
5947
|
-
then(() => {
|
|
5948
|
-
css(el, { clip: '' });
|
|
5949
|
-
this.$update(dropbar);
|
|
5950
|
-
});
|
|
6093
|
+
then(() => css(el, { clipPath: '' }));
|
|
5951
6094
|
},
|
|
5952
6095
|
|
|
5953
6096
|
getDropdown(el) {
|
|
@@ -6436,7 +6579,7 @@
|
|
|
6436
6579
|
css(filter(elements, ":not(." + this.inViewClass + ")"), 'visibility', 'hidden');
|
|
6437
6580
|
}
|
|
6438
6581
|
|
|
6439
|
-
if (prev) {
|
|
6582
|
+
if (!isEqual(elements, prev)) {
|
|
6440
6583
|
this.$reset();
|
|
6441
6584
|
}
|
|
6442
6585
|
},
|
|
@@ -6513,6 +6656,10 @@
|
|
|
6513
6656
|
toggle(el, inview) {
|
|
6514
6657
|
const state = this._data.elements.get(el);
|
|
6515
6658
|
|
|
6659
|
+
if (!state) {
|
|
6660
|
+
return;
|
|
6661
|
+
}
|
|
6662
|
+
|
|
6516
6663
|
state.off == null ? void 0 : state.off();
|
|
6517
6664
|
|
|
6518
6665
|
css(el, 'visibility', !inview && this.hidden ? 'hidden' : '');
|
|
@@ -7248,6 +7395,8 @@
|
|
|
7248
7395
|
},
|
|
7249
7396
|
|
|
7250
7397
|
handler(e) {
|
|
7398
|
+
this._preventClick = null;
|
|
7399
|
+
|
|
7251
7400
|
if (!isTouch(e) || this._showState) {
|
|
7252
7401
|
return;
|
|
7253
7402
|
}
|
|
@@ -7327,9 +7476,14 @@
|
|
|
7327
7476
|
{
|
|
7328
7477
|
name: 'click',
|
|
7329
7478
|
|
|
7479
|
+
filter() {
|
|
7480
|
+
return ['click', 'hover'].some((mode) => includes(this.mode, mode));
|
|
7481
|
+
},
|
|
7482
|
+
|
|
7330
7483
|
handler(e) {
|
|
7331
7484
|
let link;
|
|
7332
7485
|
if (
|
|
7486
|
+
this._preventClick ||
|
|
7333
7487
|
closest(e.target, 'a[href="#"], a[href=""]') ||
|
|
7334
7488
|
(link = closest(e.target, 'a[href]')) && (
|
|
7335
7489
|
attr(this.$el, 'aria-expanded') !== 'true' ||
|
|
@@ -7338,15 +7492,9 @@
|
|
|
7338
7492
|
e.preventDefault();
|
|
7339
7493
|
}
|
|
7340
7494
|
|
|
7341
|
-
if (this._preventClick) {
|
|
7342
|
-
|
|
7343
|
-
}
|
|
7344
|
-
|
|
7345
|
-
if (!includes(this.mode, 'click')) {
|
|
7346
|
-
return;
|
|
7495
|
+
if (!this._preventClick && includes(this.mode, 'click')) {
|
|
7496
|
+
this.toggle();
|
|
7347
7497
|
}
|
|
7348
|
-
|
|
7349
|
-
this.toggle();
|
|
7350
7498
|
} },
|
|
7351
7499
|
|
|
7352
7500
|
|