uikit 3.14.2-dev.1d34cc58b → 3.14.2-dev.447aa311a
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 +28 -0
- package/dist/css/uikit-core-rtl.css +92 -25
- package/dist/css/uikit-core-rtl.min.css +1 -1
- package/dist/css/uikit-core.css +92 -25
- package/dist/css/uikit-core.min.css +1 -1
- package/dist/css/uikit-rtl.css +98 -40
- package/dist/css/uikit-rtl.min.css +1 -1
- package/dist/css/uikit.css +98 -40
- 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 +101 -22
- package/dist/js/components/lightbox-panel.min.js +1 -1
- package/dist/js/components/lightbox.js +101 -22
- 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 +17 -2
- 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 +135 -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 +234 -110
- 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 +250 -111
- package/dist/js/uikit.min.js +1 -1
- package/package.json +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 +40 -20
- package/src/js/core/height-viewport.js +14 -9
- package/src/js/core/navbar.js +19 -18
- package/src/js/core/toggle.js +5 -8
- package/src/js/mixin/position.js +44 -13
- package/src/js/mixin/togglable.js +105 -24
- package/src/js/util/animation.js +1 -0
- package/src/js/util/position.js +15 -13
- package/src/js/util/viewport.js +2 -5
- package/src/less/components/drop.less +19 -5
- package/src/less/components/dropdown.less +21 -5
- 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 -21
- 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/utility.less +1 -2
- package/src/less/theme/dropdown.less +11 -0
- package/src/less/theme/navbar.less +10 -12
- package/src/scss/components/drop.scss +19 -5
- package/src/scss/components/dropdown.scss +21 -5
- 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 -10
- 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/utility.scss +1 -2
- package/src/scss/mixins-theme.scss +8 -12
- 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 +145 -2
- package/tests/dropdown.html +228 -13
- package/tests/height-viewport.html +62 -0
- package/tests/navbar.html +321 -14
- 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.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! UIkit 3.14.2-dev.
|
|
1
|
+
/*! UIkit 3.14.2-dev.447aa311a | 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();
|
|
@@ -1929,10 +1930,7 @@
|
|
|
1929
1930
|
}
|
|
1930
1931
|
|
|
1931
1932
|
function scrollingElement(element) {
|
|
1932
|
-
|
|
1933
|
-
document: { scrollingElement } } =
|
|
1934
|
-
toWindow(element);
|
|
1935
|
-
return scrollingElement;
|
|
1933
|
+
return toWindow(element).document.scrollingElement;
|
|
1936
1934
|
}
|
|
1937
1935
|
|
|
1938
1936
|
function getViewport$1(scrollElement) {
|
|
@@ -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
|
|
|
@@ -2950,7 +2950,7 @@
|
|
|
2950
2950
|
UIkit.data = '__uikit__';
|
|
2951
2951
|
UIkit.prefix = 'uk-';
|
|
2952
2952
|
UIkit.options = {};
|
|
2953
|
-
UIkit.version = '3.14.2-dev.
|
|
2953
|
+
UIkit.version = '3.14.2-dev.447aa311a';
|
|
2954
2954
|
|
|
2955
2955
|
globalAPI(UIkit);
|
|
2956
2956
|
hooksAPI(UIkit);
|
|
@@ -3059,7 +3059,7 @@
|
|
|
3059
3059
|
|
|
3060
3060
|
initProps: {
|
|
3061
3061
|
overflow: '',
|
|
3062
|
-
|
|
3062
|
+
maxHeight: '',
|
|
3063
3063
|
paddingTop: '',
|
|
3064
3064
|
paddingBottom: '',
|
|
3065
3065
|
marginTop: '',
|
|
@@ -3069,7 +3069,7 @@
|
|
|
3069
3069
|
|
|
3070
3070
|
hideProps: {
|
|
3071
3071
|
overflow: 'hidden',
|
|
3072
|
-
|
|
3072
|
+
maxHeight: 0,
|
|
3073
3073
|
paddingTop: 0,
|
|
3074
3074
|
paddingBottom: 0,
|
|
3075
3075
|
marginTop: 0,
|
|
@@ -3084,7 +3084,7 @@
|
|
|
3084
3084
|
},
|
|
3085
3085
|
|
|
3086
3086
|
hasTransition(_ref2) {let { animation } = _ref2;
|
|
3087
|
-
return
|
|
3087
|
+
return startsWith(animation[0], 'slide');
|
|
3088
3088
|
} },
|
|
3089
3089
|
|
|
3090
3090
|
|
|
@@ -3099,18 +3099,13 @@
|
|
|
3099
3099
|
return Promise.reject();
|
|
3100
3100
|
}
|
|
3101
3101
|
|
|
3102
|
-
if (!animate) {
|
|
3103
|
-
Animation.cancel(el);
|
|
3104
|
-
Transition.cancel(el);
|
|
3105
|
-
}
|
|
3106
|
-
|
|
3107
3102
|
const promise = (
|
|
3108
3103
|
isFunction(animate) ?
|
|
3109
3104
|
animate :
|
|
3110
3105
|
animate === false || !this.hasAnimation ?
|
|
3111
|
-
this
|
|
3106
|
+
toggleInstant(this) :
|
|
3112
3107
|
this.hasTransition ?
|
|
3113
|
-
|
|
3108
|
+
toggleTransition(this) :
|
|
3114
3109
|
toggleAnimation(this))(
|
|
3115
3110
|
el, show);
|
|
3116
3111
|
|
|
@@ -3174,22 +3169,43 @@
|
|
|
3174
3169
|
|
|
3175
3170
|
|
|
3176
3171
|
|
|
3177
|
-
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
|
+
}
|
|
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$1(cmp);
|
|
3188
|
+
}
|
|
3179
3189
|
|
|
3190
|
+
function slide$1(_ref4)
|
|
3180
3191
|
|
|
3181
3192
|
|
|
3182
3193
|
|
|
3183
3194
|
|
|
3184
3195
|
|
|
3185
|
-
|
|
3196
|
+
|
|
3197
|
+
|
|
3198
|
+
{let { isToggled, duration, velocity, initProps, hideProps, transition, _toggle } = _ref4;
|
|
3186
3199
|
return (el, show) => {
|
|
3187
3200
|
const inProgress = Transition.inProgress(el);
|
|
3188
|
-
const inner =
|
|
3201
|
+
const inner =
|
|
3202
|
+
!inProgress && el.hasChildNodes() ?
|
|
3189
3203
|
toFloat(css(el.firstElementChild, 'marginTop')) +
|
|
3190
3204
|
toFloat(css(el.lastElementChild, 'marginBottom')) :
|
|
3191
3205
|
0;
|
|
3192
|
-
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;
|
|
3193
3209
|
|
|
3194
3210
|
Transition.cancel(el);
|
|
3195
3211
|
|
|
@@ -3197,34 +3213,97 @@
|
|
|
3197
3213
|
_toggle(el, true);
|
|
3198
3214
|
}
|
|
3199
3215
|
|
|
3200
|
-
|
|
3216
|
+
css(el, 'maxHeight', '');
|
|
3201
3217
|
|
|
3202
3218
|
// Update child components first
|
|
3203
3219
|
fastdom.flush();
|
|
3204
3220
|
|
|
3205
|
-
const endHeight =
|
|
3206
|
-
duration = velocity *
|
|
3221
|
+
const endHeight = toFloat(css(el, 'height')) + inner;
|
|
3222
|
+
duration = velocity * endHeight + duration;
|
|
3207
3223
|
|
|
3208
|
-
|
|
3224
|
+
css(el, { ...props, maxHeight: currentHeight });
|
|
3209
3225
|
|
|
3210
3226
|
return (
|
|
3211
3227
|
show ?
|
|
3212
3228
|
Transition.start(
|
|
3213
3229
|
el,
|
|
3214
|
-
{ ...initProps, overflow: 'hidden',
|
|
3215
|
-
|
|
3230
|
+
{ ...initProps, overflow: 'hidden', maxHeight: endHeight },
|
|
3231
|
+
duration * (1 - currentHeight / endHeight),
|
|
3216
3232
|
transition) :
|
|
3217
3233
|
|
|
3218
3234
|
Transition.start(
|
|
3219
3235
|
el,
|
|
3220
3236
|
hideProps,
|
|
3221
|
-
|
|
3237
|
+
duration * (currentHeight / endHeight),
|
|
3222
3238
|
transition).
|
|
3223
3239
|
then(() => _toggle(el, false))).
|
|
3224
3240
|
then(() => css(el, initProps));
|
|
3225
3241
|
};
|
|
3226
3242
|
}
|
|
3227
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
|
+
|
|
3228
3307
|
function toggleAnimation(cmp) {
|
|
3229
3308
|
return (el, show) => {
|
|
3230
3309
|
Animation.cancel(el);
|
|
@@ -3258,7 +3337,7 @@
|
|
|
3258
3337
|
data: {
|
|
3259
3338
|
targets: '> *',
|
|
3260
3339
|
active: false,
|
|
3261
|
-
animation: [
|
|
3340
|
+
animation: ['slide'],
|
|
3262
3341
|
collapsible: true,
|
|
3263
3342
|
multiple: false,
|
|
3264
3343
|
clsOpen: 'uk-open',
|
|
@@ -3368,7 +3447,7 @@
|
|
|
3368
3447
|
}
|
|
3369
3448
|
|
|
3370
3449
|
hide(content, false);
|
|
3371
|
-
await
|
|
3450
|
+
await slide$1(this)(el._wrapper, show);
|
|
3372
3451
|
hide(content, !show);
|
|
3373
3452
|
|
|
3374
3453
|
delete el._wrapper;
|
|
@@ -3402,7 +3481,7 @@
|
|
|
3402
3481
|
|
|
3403
3482
|
|
|
3404
3483
|
data: {
|
|
3405
|
-
animation: [
|
|
3484
|
+
animation: ['slide'],
|
|
3406
3485
|
selClose: '.uk-alert-close',
|
|
3407
3486
|
duration: 150,
|
|
3408
3487
|
hideProps: { opacity: 0, ...Togglable.data.hideProps } },
|
|
@@ -3588,23 +3667,17 @@
|
|
|
3588
3667
|
|
|
3589
3668
|
connected() {
|
|
3590
3669
|
this.pos = this.$props.pos.split('-').concat('center').slice(0, 2);
|
|
3591
|
-
this.
|
|
3670
|
+
[this.dir, this.align] = this.pos;
|
|
3671
|
+
this.axis = includes(['top', 'bottom'], this.dir) ? 'y' : 'x';
|
|
3592
3672
|
},
|
|
3593
3673
|
|
|
3594
3674
|
methods: {
|
|
3595
3675
|
positionAt(element, target, boundary) {
|
|
3596
|
-
|
|
3597
|
-
|
|
3598
|
-
let offset = toPx(
|
|
3599
|
-
this.offset === false ? getCssVar('position-offset', element) : this.offset,
|
|
3600
|
-
this.axis === 'x' ? 'width' : 'height',
|
|
3601
|
-
element);
|
|
3602
|
-
|
|
3603
|
-
offset = [includes(['left', 'top'], dir) ? -offset : +offset, 0];
|
|
3676
|
+
let offset = [this.getPositionOffset(element), this.getShiftOffset(element)];
|
|
3604
3677
|
|
|
3605
3678
|
const attach = {
|
|
3606
|
-
element: [flipPosition(dir), align],
|
|
3607
|
-
target: [dir, align] };
|
|
3679
|
+
element: [flipPosition(this.dir), this.align],
|
|
3680
|
+
target: [this.dir, this.align] };
|
|
3608
3681
|
|
|
3609
3682
|
|
|
3610
3683
|
if (this.axis === 'y') {
|
|
@@ -3614,13 +3687,41 @@
|
|
|
3614
3687
|
offset = offset.reverse();
|
|
3615
3688
|
}
|
|
3616
3689
|
|
|
3690
|
+
// Ensure none positioned element does not generate scrollbars
|
|
3691
|
+
const elDim = dimensions$1(element);
|
|
3692
|
+
css(element, { top: -elDim.height, left: -elDim.width });
|
|
3693
|
+
|
|
3617
3694
|
positionAt(element, target, {
|
|
3618
3695
|
attach,
|
|
3619
3696
|
offset,
|
|
3620
3697
|
boundary,
|
|
3621
3698
|
flip: this.flip,
|
|
3622
|
-
viewportOffset:
|
|
3699
|
+
viewportOffset: this.getViewportOffset(element) });
|
|
3700
|
+
|
|
3701
|
+
},
|
|
3623
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
|
+
},
|
|
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));
|
|
3624
3725
|
} } };
|
|
3625
3726
|
|
|
3626
3727
|
let active$1;
|
|
@@ -3638,7 +3739,8 @@
|
|
|
3638
3739
|
delayShow: Number,
|
|
3639
3740
|
delayHide: Number,
|
|
3640
3741
|
display: String,
|
|
3641
|
-
clsDrop: String
|
|
3742
|
+
clsDrop: String,
|
|
3743
|
+
animateOut: Boolean },
|
|
3642
3744
|
|
|
3643
3745
|
|
|
3644
3746
|
data: {
|
|
@@ -3652,7 +3754,8 @@
|
|
|
3652
3754
|
clsDrop: false,
|
|
3653
3755
|
animation: ['uk-animation-fade'],
|
|
3654
3756
|
cls: 'uk-open',
|
|
3655
|
-
container: false
|
|
3757
|
+
container: false,
|
|
3758
|
+
animateOut: false },
|
|
3656
3759
|
|
|
3657
3760
|
|
|
3658
3761
|
created() {
|
|
@@ -3840,7 +3943,7 @@
|
|
|
3840
3943
|
}
|
|
3841
3944
|
}),
|
|
3842
3945
|
|
|
3843
|
-
...(this.display === 'static' ?
|
|
3946
|
+
...(this.display === 'static' && this.align !== 'stretch' ?
|
|
3844
3947
|
[] :
|
|
3845
3948
|
(() => {
|
|
3846
3949
|
const handler = () => this.$emit();
|
|
@@ -3901,7 +4004,7 @@
|
|
|
3901
4004
|
methods: {
|
|
3902
4005
|
show(target, delay) {if (target === void 0) {target = this.target;}if (delay === void 0) {delay = true;}
|
|
3903
4006
|
if (this.isToggled() && target && this.target && target !== this.target) {
|
|
3904
|
-
this.hide(false);
|
|
4007
|
+
this.hide(false, false);
|
|
3905
4008
|
}
|
|
3906
4009
|
|
|
3907
4010
|
this.target = target;
|
|
@@ -3921,7 +4024,7 @@
|
|
|
3921
4024
|
let prev;
|
|
3922
4025
|
while (active$1 && prev !== active$1 && !within(this.$el, active$1.$el)) {
|
|
3923
4026
|
prev = active$1;
|
|
3924
|
-
active$1.hide(false);
|
|
4027
|
+
active$1.hide(false, false);
|
|
3925
4028
|
}
|
|
3926
4029
|
}
|
|
3927
4030
|
|
|
@@ -3935,8 +4038,8 @@
|
|
|
3935
4038
|
|
|
3936
4039
|
},
|
|
3937
4040
|
|
|
3938
|
-
hide(delay) {if (delay === void 0) {delay = true;}
|
|
3939
|
-
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);
|
|
3940
4043
|
|
|
3941
4044
|
this.clearTimers();
|
|
3942
4045
|
|
|
@@ -3968,28 +4071,51 @@
|
|
|
3968
4071
|
position() {
|
|
3969
4072
|
removeClass(this.$el, this.clsDrop + "-stack");
|
|
3970
4073
|
toggleClass(this.$el, this.clsDrop + "-boundary", this.boundaryAlign);
|
|
4074
|
+
toggleClass(this.$el, this.clsDrop + "-stretch", this.align === 'stretch');
|
|
3971
4075
|
|
|
3972
4076
|
const boundary = query(this.boundary, this.$el);
|
|
3973
|
-
const
|
|
3974
|
-
|
|
4077
|
+
const target = boundary && this.boundaryAlign ? boundary : this.target;
|
|
4078
|
+
const [scrollParent] = scrollParents(
|
|
4079
|
+
boundary && this.boundaryAlign ? boundary : this.$el);
|
|
3975
4080
|
|
|
4081
|
+
const scrollParentOffset = offset(scrollParent);
|
|
3976
4082
|
const boundaryOffset = boundary ? offset(boundary) : scrollParentOffset;
|
|
4083
|
+
const viewportOffset = this.getViewportOffset(this.$el);
|
|
3977
4084
|
|
|
3978
4085
|
css(this.$el, 'maxWidth', '');
|
|
3979
|
-
const maxWidth =
|
|
3980
|
-
scrollParentOffset.width -
|
|
3981
|
-
2 * toPx(getCssVar('position-viewport-offset', this.$el));
|
|
4086
|
+
const maxWidth = scrollParentOffset.width - 2 * viewportOffset;
|
|
3982
4087
|
|
|
3983
|
-
if (this.
|
|
4088
|
+
if (this.align === 'justify') {
|
|
3984
4089
|
const prop = this.axis === 'y' ? 'width' : 'height';
|
|
3985
4090
|
css(
|
|
3986
4091
|
this.$el,
|
|
3987
4092
|
prop,
|
|
3988
4093
|
Math.min(
|
|
3989
4094
|
(boundary ? boundaryOffset : offset(this.target))[prop],
|
|
3990
|
-
scrollParentOffset[prop] -
|
|
3991
|
-
|
|
3992
|
-
|
|
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 });
|
|
3993
4119
|
|
|
3994
4120
|
} else if (this.$el.offsetWidth > maxWidth) {
|
|
3995
4121
|
addClass(this.$el, this.clsDrop + "-stack");
|
|
@@ -3997,11 +4123,7 @@
|
|
|
3997
4123
|
|
|
3998
4124
|
css(this.$el, 'maxWidth', maxWidth);
|
|
3999
4125
|
|
|
4000
|
-
this.positionAt(
|
|
4001
|
-
this.$el,
|
|
4002
|
-
boundary && this.boundaryAlign ? boundary : this.target,
|
|
4003
|
-
boundary);
|
|
4004
|
-
|
|
4126
|
+
this.positionAt(this.$el, target, boundary);
|
|
4005
4127
|
} } };
|
|
4006
4128
|
|
|
4007
4129
|
|
|
@@ -4486,7 +4608,7 @@
|
|
|
4486
4608
|
|
|
4487
4609
|
resizeTargets() {
|
|
4488
4610
|
// check for offsetTop change
|
|
4489
|
-
return [this.$el,
|
|
4611
|
+
return [this.$el, ...scrollParents(this.$el, /auto|scroll/)];
|
|
4490
4612
|
},
|
|
4491
4613
|
|
|
4492
4614
|
update: {
|
|
@@ -4498,21 +4620,25 @@
|
|
|
4498
4620
|
let minHeight = '';
|
|
4499
4621
|
const box = boxModelAdjust(this.$el, 'height', 'content-box');
|
|
4500
4622
|
|
|
4623
|
+
const [scrollElement] = scrollParents(this.$el, /auto|scroll/);
|
|
4624
|
+
const { height: viewportHeight } = offsetViewport(scrollElement);
|
|
4625
|
+
|
|
4501
4626
|
if (this.expand) {
|
|
4502
4627
|
minHeight = Math.max(
|
|
4503
|
-
|
|
4504
|
-
dimensions$1(
|
|
4505
|
-
dimensions$1(this.$el).height) -
|
|
4628
|
+
viewportHeight - (
|
|
4629
|
+
dimensions$1(scrollElement).height - dimensions$1(this.$el).height) -
|
|
4506
4630
|
box,
|
|
4507
4631
|
0);
|
|
4508
4632
|
|
|
4509
4633
|
} else {
|
|
4510
4634
|
// on mobile devices (iOS and Android) window.innerHeight !== 100vh
|
|
4511
|
-
minHeight =
|
|
4635
|
+
minHeight = "calc(" + (
|
|
4636
|
+
document.scrollingElement === scrollElement ? '100vh' : viewportHeight + "px");
|
|
4637
|
+
|
|
4512
4638
|
|
|
4513
4639
|
if (this.offsetTop) {
|
|
4514
|
-
const
|
|
4515
|
-
minHeight += top > 0 && top <
|
|
4640
|
+
const top = offsetPosition(this.$el)[0] - offsetPosition(scrollElement)[0];
|
|
4641
|
+
minHeight += top > 0 && top < viewportHeight / 2 ? " - " + top + "px" : '';
|
|
4516
4642
|
}
|
|
4517
4643
|
|
|
4518
4644
|
if (this.offsetBottom === true) {
|
|
@@ -5846,8 +5972,8 @@
|
|
|
5846
5972
|
return this.dropbar;
|
|
5847
5973
|
},
|
|
5848
5974
|
|
|
5849
|
-
handler(_, _ref9) {let { $el } = _ref9;
|
|
5850
|
-
if (!hasClass($el, this.clsDrop)) {
|
|
5975
|
+
handler(_, _ref9) {let { $el, align } = _ref9;
|
|
5976
|
+
if (!hasClass($el, this.clsDrop) || align === 'stretch') {
|
|
5851
5977
|
return;
|
|
5852
5978
|
}
|
|
5853
5979
|
|
|
@@ -5870,19 +5996,19 @@
|
|
|
5870
5996
|
return this.dropbar;
|
|
5871
5997
|
},
|
|
5872
5998
|
|
|
5873
|
-
handler(_, _ref10) {let { $el,
|
|
5874
|
-
if (!hasClass($el, this.clsDrop)) {
|
|
5999
|
+
handler(_, _ref10) {let { $el, align } = _ref10;
|
|
6000
|
+
if (!hasClass($el, this.clsDrop) || align === 'stretch') {
|
|
5875
6001
|
return;
|
|
5876
6002
|
}
|
|
5877
6003
|
|
|
5878
|
-
|
|
5879
|
-
|
|
5880
|
-
|
|
5881
|
-
|
|
5882
|
-
|
|
5883
|
-
|
|
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
|
+
|
|
5884
6011
|
|
|
5885
|
-
}
|
|
5886
6012
|
} },
|
|
5887
6013
|
|
|
5888
6014
|
|
|
@@ -5921,11 +6047,13 @@
|
|
|
5921
6047
|
return this.dropbar;
|
|
5922
6048
|
},
|
|
5923
6049
|
|
|
5924
|
-
handler(_, _ref12) {let { $el } = _ref12;
|
|
5925
|
-
if (!hasClass($el, this.clsDrop)) {
|
|
6050
|
+
handler(_, _ref12) {let { $el, align } = _ref12;
|
|
6051
|
+
if (!hasClass($el, this.clsDrop) || align === 'stretch') {
|
|
5926
6052
|
return;
|
|
5927
6053
|
}
|
|
5928
6054
|
|
|
6055
|
+
this._observer.disconnect();
|
|
6056
|
+
|
|
5929
6057
|
const active = this.getActive();
|
|
5930
6058
|
|
|
5931
6059
|
if (!active || (active == null ? void 0 : active.$el) === $el) {
|
|
@@ -5942,28 +6070,27 @@
|
|
|
5942
6070
|
|
|
5943
6071
|
transitionTo(newHeight, el) {
|
|
5944
6072
|
const { dropbar } = this;
|
|
5945
|
-
const oldHeight =
|
|
6073
|
+
const oldHeight = height(dropbar);
|
|
5946
6074
|
|
|
5947
6075
|
el = oldHeight < newHeight && el;
|
|
5948
6076
|
|
|
5949
|
-
css(el, '
|
|
6077
|
+
css(el, 'clipPath', "polygon(0 0,100% 0,100% " + oldHeight + "px,0 " + oldHeight + "px)");
|
|
5950
6078
|
|
|
5951
6079
|
height(dropbar, oldHeight);
|
|
5952
6080
|
|
|
5953
6081
|
Transition.cancel([el, dropbar]);
|
|
5954
|
-
|
|
6082
|
+
Promise.all([
|
|
5955
6083
|
Transition.start(dropbar, { height: newHeight }, this.duration),
|
|
5956
6084
|
Transition.start(
|
|
5957
6085
|
el,
|
|
5958
|
-
{
|
|
6086
|
+
{
|
|
6087
|
+
clipPath: "polygon(0 0,100% 0,100% " + newHeight + "px,0 " + newHeight + "px)" },
|
|
6088
|
+
|
|
5959
6089
|
this.duration)]).
|
|
5960
6090
|
|
|
5961
6091
|
|
|
5962
6092
|
catch(noop).
|
|
5963
|
-
then(() => {
|
|
5964
|
-
css(el, { clip: '' });
|
|
5965
|
-
this.$update(dropbar);
|
|
5966
|
-
});
|
|
6093
|
+
then(() => css(el, { clipPath: '' }));
|
|
5967
6094
|
},
|
|
5968
6095
|
|
|
5969
6096
|
getDropdown(el) {
|
|
@@ -7264,6 +7391,8 @@
|
|
|
7264
7391
|
},
|
|
7265
7392
|
|
|
7266
7393
|
handler(e) {
|
|
7394
|
+
this._preventClick = null;
|
|
7395
|
+
|
|
7267
7396
|
if (!isTouch(e) || this._showState) {
|
|
7268
7397
|
return;
|
|
7269
7398
|
}
|
|
@@ -7350,6 +7479,7 @@
|
|
|
7350
7479
|
handler(e) {
|
|
7351
7480
|
let link;
|
|
7352
7481
|
if (
|
|
7482
|
+
this._preventClick ||
|
|
7353
7483
|
closest(e.target, 'a[href="#"], a[href=""]') ||
|
|
7354
7484
|
(link = closest(e.target, 'a[href]')) && (
|
|
7355
7485
|
attr(this.$el, 'aria-expanded') !== 'true' ||
|
|
@@ -7358,15 +7488,9 @@
|
|
|
7358
7488
|
e.preventDefault();
|
|
7359
7489
|
}
|
|
7360
7490
|
|
|
7361
|
-
if (this._preventClick) {
|
|
7362
|
-
|
|
7363
|
-
}
|
|
7364
|
-
|
|
7365
|
-
if (!includes(this.mode, 'click')) {
|
|
7366
|
-
return;
|
|
7491
|
+
if (!this._preventClick && includes(this.mode, 'click')) {
|
|
7492
|
+
this.toggle();
|
|
7367
7493
|
}
|
|
7368
|
-
|
|
7369
|
-
this.toggle();
|
|
7370
7494
|
} },
|
|
7371
7495
|
|
|
7372
7496
|
|
|
@@ -9735,8 +9859,23 @@
|
|
|
9735
9859
|
|
|
9736
9860
|
|
|
9737
9861
|
|
|
9862
|
+
/*
|
|
9863
|
+
* Inspired by https://gist.github.com/gre/1650294?permalink_comment_id=3477425#gistcomment-3477425
|
|
9864
|
+
*
|
|
9865
|
+
* linear: 0
|
|
9866
|
+
* easeInSine: 0.5
|
|
9867
|
+
* easeOutSine: -0.5
|
|
9868
|
+
* easeInQuad: 1
|
|
9869
|
+
* easeOutQuad: -1
|
|
9870
|
+
* easeInCubic: 2
|
|
9871
|
+
* easeOutCubic: -2
|
|
9872
|
+
* easeInQuart: 3
|
|
9873
|
+
* easeOutQuart: -3
|
|
9874
|
+
* easeInQuint: 4
|
|
9875
|
+
* easeOutQuint: -4
|
|
9876
|
+
*/
|
|
9738
9877
|
function ease(percent, easing) {
|
|
9739
|
-
return easing >= 0 ? Math.pow(percent, easing + 1) : 1 - Math.pow(1 - percent, -easing
|
|
9878
|
+
return easing >= 0 ? Math.pow(percent, easing + 1) : 1 - Math.pow(1 - percent, 1 - easing);
|
|
9740
9879
|
}
|
|
9741
9880
|
|
|
9742
9881
|
// SVG elements do not inherit from HTMLElement
|