uikit 3.14.3 → 3.14.4-dev.6a00f7fe6
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 +17 -0
- package/dist/css/uikit-core-rtl.css +84 -26
- package/dist/css/uikit-core-rtl.min.css +1 -1
- package/dist/css/uikit-core.css +84 -26
- package/dist/css/uikit-core.min.css +1 -1
- package/dist/css/uikit-rtl.css +90 -41
- package/dist/css/uikit-rtl.min.css +1 -1
- package/dist/css/uikit.css +90 -41
- 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 +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 +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 +206 -77
- 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 +206 -77
- package/dist/js/uikit.min.js +1 -1
- package/package.json +1 -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 +11 -9
- package/src/js/core/switcher.js +1 -1
- 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/viewport.js +1 -1
- 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 +54 -21
- package/src/less/components/offcanvas.less +21 -21
- package/src/less/components/position.less +1 -1
- package/src/less/components/utility.less +0 -1
- 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 +43 -10
- package/src/scss/components/offcanvas.scss +21 -21
- package/src/scss/components/position.scss +1 -1
- package/src/scss/components/utility.scss +0 -1
- 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/dist/js/uikit.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! UIkit 3.14.
|
|
1
|
+
/*! UIkit 3.14.4-dev.6a00f7fe6 | 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) =>
|
|
@@ -1887,7 +1888,7 @@
|
|
|
1887
1888
|
return clamp((scrollTop - start) / (end - start));
|
|
1888
1889
|
}
|
|
1889
1890
|
|
|
1890
|
-
function scrollParents(element, overflowRe, scrollable) {if (overflowRe === void 0) {overflowRe = /auto|scroll|hidden/;}if (scrollable === void 0) {scrollable = false;}
|
|
1891
|
+
function scrollParents(element, overflowRe, scrollable) {if (overflowRe === void 0) {overflowRe = /auto|scroll|hidden|clip/;}if (scrollable === void 0) {scrollable = false;}
|
|
1891
1892
|
const scrollEl = scrollingElement(element);
|
|
1892
1893
|
|
|
1893
1894
|
let ancestors = parents(element).reverse();
|
|
@@ -2949,7 +2950,7 @@
|
|
|
2949
2950
|
UIkit.data = '__uikit__';
|
|
2950
2951
|
UIkit.prefix = 'uk-';
|
|
2951
2952
|
UIkit.options = {};
|
|
2952
|
-
UIkit.version = '3.14.
|
|
2953
|
+
UIkit.version = '3.14.4-dev.6a00f7fe6';
|
|
2953
2954
|
|
|
2954
2955
|
globalAPI(UIkit);
|
|
2955
2956
|
hooksAPI(UIkit);
|
|
@@ -3058,7 +3059,7 @@
|
|
|
3058
3059
|
|
|
3059
3060
|
initProps: {
|
|
3060
3061
|
overflow: '',
|
|
3061
|
-
|
|
3062
|
+
maxHeight: '',
|
|
3062
3063
|
paddingTop: '',
|
|
3063
3064
|
paddingBottom: '',
|
|
3064
3065
|
marginTop: '',
|
|
@@ -3068,7 +3069,7 @@
|
|
|
3068
3069
|
|
|
3069
3070
|
hideProps: {
|
|
3070
3071
|
overflow: 'hidden',
|
|
3071
|
-
|
|
3072
|
+
maxHeight: 0,
|
|
3072
3073
|
paddingTop: 0,
|
|
3073
3074
|
paddingBottom: 0,
|
|
3074
3075
|
marginTop: 0,
|
|
@@ -3083,7 +3084,7 @@
|
|
|
3083
3084
|
},
|
|
3084
3085
|
|
|
3085
3086
|
hasTransition(_ref2) {let { animation } = _ref2;
|
|
3086
|
-
return
|
|
3087
|
+
return startsWith(animation[0], 'slide');
|
|
3087
3088
|
} },
|
|
3088
3089
|
|
|
3089
3090
|
|
|
@@ -3098,18 +3099,13 @@
|
|
|
3098
3099
|
return Promise.reject();
|
|
3099
3100
|
}
|
|
3100
3101
|
|
|
3101
|
-
if (!animate) {
|
|
3102
|
-
Animation.cancel(el);
|
|
3103
|
-
Transition.cancel(el);
|
|
3104
|
-
}
|
|
3105
|
-
|
|
3106
3102
|
const promise = (
|
|
3107
3103
|
isFunction(animate) ?
|
|
3108
3104
|
animate :
|
|
3109
3105
|
animate === false || !this.hasAnimation ?
|
|
3110
|
-
this
|
|
3106
|
+
toggleInstant(this) :
|
|
3111
3107
|
this.hasTransition ?
|
|
3112
|
-
|
|
3108
|
+
toggleTransition(this) :
|
|
3113
3109
|
toggleAnimation(this))(
|
|
3114
3110
|
el, show);
|
|
3115
3111
|
|
|
@@ -3173,22 +3169,43 @@
|
|
|
3173
3169
|
|
|
3174
3170
|
|
|
3175
3171
|
|
|
3176
|
-
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
|
+
}
|
|
3177
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
|
+
}
|
|
3178
3189
|
|
|
3190
|
+
function slide$1(_ref4)
|
|
3179
3191
|
|
|
3180
3192
|
|
|
3181
3193
|
|
|
3182
3194
|
|
|
3183
3195
|
|
|
3184
|
-
|
|
3196
|
+
|
|
3197
|
+
|
|
3198
|
+
{let { isToggled, duration, velocity, initProps, hideProps, transition, _toggle } = _ref4;
|
|
3185
3199
|
return (el, show) => {
|
|
3186
3200
|
const inProgress = Transition.inProgress(el);
|
|
3187
|
-
const inner =
|
|
3201
|
+
const inner =
|
|
3202
|
+
!inProgress && el.hasChildNodes() ?
|
|
3188
3203
|
toFloat(css(el.firstElementChild, 'marginTop')) +
|
|
3189
3204
|
toFloat(css(el.lastElementChild, 'marginBottom')) :
|
|
3190
3205
|
0;
|
|
3191
|
-
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;
|
|
3192
3209
|
|
|
3193
3210
|
Transition.cancel(el);
|
|
3194
3211
|
|
|
@@ -3196,34 +3213,97 @@
|
|
|
3196
3213
|
_toggle(el, true);
|
|
3197
3214
|
}
|
|
3198
3215
|
|
|
3199
|
-
|
|
3216
|
+
css(el, 'maxHeight', '');
|
|
3200
3217
|
|
|
3201
3218
|
// Update child components first
|
|
3202
3219
|
fastdom.flush();
|
|
3203
3220
|
|
|
3204
|
-
const endHeight =
|
|
3205
|
-
duration = velocity *
|
|
3221
|
+
const endHeight = toFloat(css(el, 'height')) + inner;
|
|
3222
|
+
duration = velocity * endHeight + duration;
|
|
3206
3223
|
|
|
3207
|
-
|
|
3224
|
+
css(el, { ...props, maxHeight: currentHeight });
|
|
3208
3225
|
|
|
3209
3226
|
return (
|
|
3210
3227
|
show ?
|
|
3211
3228
|
Transition.start(
|
|
3212
3229
|
el,
|
|
3213
|
-
{ ...initProps, overflow: 'hidden',
|
|
3214
|
-
|
|
3230
|
+
{ ...initProps, overflow: 'hidden', maxHeight: endHeight },
|
|
3231
|
+
duration * (1 - currentHeight / endHeight),
|
|
3215
3232
|
transition) :
|
|
3216
3233
|
|
|
3217
3234
|
Transition.start(
|
|
3218
3235
|
el,
|
|
3219
3236
|
hideProps,
|
|
3220
|
-
|
|
3237
|
+
duration * (currentHeight / endHeight),
|
|
3221
3238
|
transition).
|
|
3222
3239
|
then(() => _toggle(el, false))).
|
|
3223
3240
|
then(() => css(el, initProps));
|
|
3224
3241
|
};
|
|
3225
3242
|
}
|
|
3226
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
|
+
|
|
3227
3307
|
function toggleAnimation(cmp) {
|
|
3228
3308
|
return (el, show) => {
|
|
3229
3309
|
Animation.cancel(el);
|
|
@@ -3257,7 +3337,7 @@
|
|
|
3257
3337
|
data: {
|
|
3258
3338
|
targets: '> *',
|
|
3259
3339
|
active: false,
|
|
3260
|
-
animation: [
|
|
3340
|
+
animation: ['slide'],
|
|
3261
3341
|
collapsible: true,
|
|
3262
3342
|
multiple: false,
|
|
3263
3343
|
clsOpen: 'uk-open',
|
|
@@ -3367,7 +3447,7 @@
|
|
|
3367
3447
|
}
|
|
3368
3448
|
|
|
3369
3449
|
hide(content, false);
|
|
3370
|
-
await
|
|
3450
|
+
await slide$1(this)(el._wrapper, show);
|
|
3371
3451
|
hide(content, !show);
|
|
3372
3452
|
|
|
3373
3453
|
delete el._wrapper;
|
|
@@ -3401,7 +3481,7 @@
|
|
|
3401
3481
|
|
|
3402
3482
|
|
|
3403
3483
|
data: {
|
|
3404
|
-
animation: [
|
|
3484
|
+
animation: ['slide'],
|
|
3405
3485
|
selClose: '.uk-alert-close',
|
|
3406
3486
|
duration: 150,
|
|
3407
3487
|
hideProps: { opacity: 0, ...Togglable.data.hideProps } },
|
|
@@ -3587,23 +3667,17 @@
|
|
|
3587
3667
|
|
|
3588
3668
|
connected() {
|
|
3589
3669
|
this.pos = this.$props.pos.split('-').concat('center').slice(0, 2);
|
|
3590
|
-
this.
|
|
3670
|
+
[this.dir, this.align] = this.pos;
|
|
3671
|
+
this.axis = includes(['top', 'bottom'], this.dir) ? 'y' : 'x';
|
|
3591
3672
|
},
|
|
3592
3673
|
|
|
3593
3674
|
methods: {
|
|
3594
3675
|
positionAt(element, target, boundary) {
|
|
3595
|
-
|
|
3596
|
-
|
|
3597
|
-
let offset = toPx(
|
|
3598
|
-
this.offset === false ? getCssVar('position-offset', element) : this.offset,
|
|
3599
|
-
this.axis === 'x' ? 'width' : 'height',
|
|
3600
|
-
element);
|
|
3601
|
-
|
|
3602
|
-
offset = [includes(['left', 'top'], dir) ? -offset : +offset, 0];
|
|
3676
|
+
let offset = [this.getPositionOffset(element), this.getShiftOffset(element)];
|
|
3603
3677
|
|
|
3604
3678
|
const attach = {
|
|
3605
|
-
element: [flipPosition(dir), align],
|
|
3606
|
-
target: [dir, align] };
|
|
3679
|
+
element: [flipPosition(this.dir), this.align],
|
|
3680
|
+
target: [this.dir, this.align] };
|
|
3607
3681
|
|
|
3608
3682
|
|
|
3609
3683
|
if (this.axis === 'y') {
|
|
@@ -3613,13 +3687,41 @@
|
|
|
3613
3687
|
offset = offset.reverse();
|
|
3614
3688
|
}
|
|
3615
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
|
+
|
|
3616
3694
|
positionAt(element, target, {
|
|
3617
3695
|
attach,
|
|
3618
3696
|
offset,
|
|
3619
3697
|
boundary,
|
|
3620
3698
|
flip: this.flip,
|
|
3621
|
-
viewportOffset:
|
|
3699
|
+
viewportOffset: this.getViewportOffset(element) });
|
|
3700
|
+
|
|
3701
|
+
},
|
|
3622
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));
|
|
3623
3725
|
} } };
|
|
3624
3726
|
|
|
3625
3727
|
let active$1;
|
|
@@ -3637,7 +3739,8 @@
|
|
|
3637
3739
|
delayShow: Number,
|
|
3638
3740
|
delayHide: Number,
|
|
3639
3741
|
display: String,
|
|
3640
|
-
clsDrop: String
|
|
3742
|
+
clsDrop: String,
|
|
3743
|
+
animateOut: Boolean },
|
|
3641
3744
|
|
|
3642
3745
|
|
|
3643
3746
|
data: {
|
|
@@ -3651,7 +3754,8 @@
|
|
|
3651
3754
|
clsDrop: false,
|
|
3652
3755
|
animation: ['uk-animation-fade'],
|
|
3653
3756
|
cls: 'uk-open',
|
|
3654
|
-
container: false
|
|
3757
|
+
container: false,
|
|
3758
|
+
animateOut: false },
|
|
3655
3759
|
|
|
3656
3760
|
|
|
3657
3761
|
created() {
|
|
@@ -3839,7 +3943,7 @@
|
|
|
3839
3943
|
}
|
|
3840
3944
|
}),
|
|
3841
3945
|
|
|
3842
|
-
...(this.display === 'static' ?
|
|
3946
|
+
...(this.display === 'static' && this.align !== 'stretch' ?
|
|
3843
3947
|
[] :
|
|
3844
3948
|
(() => {
|
|
3845
3949
|
const handler = () => this.$emit();
|
|
@@ -3900,7 +4004,7 @@
|
|
|
3900
4004
|
methods: {
|
|
3901
4005
|
show(target, delay) {if (target === void 0) {target = this.target;}if (delay === void 0) {delay = true;}
|
|
3902
4006
|
if (this.isToggled() && target && this.target && target !== this.target) {
|
|
3903
|
-
this.hide(false);
|
|
4007
|
+
this.hide(false, false);
|
|
3904
4008
|
}
|
|
3905
4009
|
|
|
3906
4010
|
this.target = target;
|
|
@@ -3920,7 +4024,7 @@
|
|
|
3920
4024
|
let prev;
|
|
3921
4025
|
while (active$1 && prev !== active$1 && !within(this.$el, active$1.$el)) {
|
|
3922
4026
|
prev = active$1;
|
|
3923
|
-
active$1.hide(false);
|
|
4027
|
+
active$1.hide(false, false);
|
|
3924
4028
|
}
|
|
3925
4029
|
}
|
|
3926
4030
|
|
|
@@ -3934,8 +4038,8 @@
|
|
|
3934
4038
|
|
|
3935
4039
|
},
|
|
3936
4040
|
|
|
3937
|
-
hide(delay) {if (delay === void 0) {delay = true;}
|
|
3938
|
-
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);
|
|
3939
4043
|
|
|
3940
4044
|
this.clearTimers();
|
|
3941
4045
|
|
|
@@ -3967,28 +4071,51 @@
|
|
|
3967
4071
|
position() {
|
|
3968
4072
|
removeClass(this.$el, this.clsDrop + "-stack");
|
|
3969
4073
|
toggleClass(this.$el, this.clsDrop + "-boundary", this.boundaryAlign);
|
|
4074
|
+
toggleClass(this.$el, this.clsDrop + "-stretch", this.align === 'stretch');
|
|
3970
4075
|
|
|
3971
4076
|
const boundary = query(this.boundary, this.$el);
|
|
3972
|
-
const
|
|
3973
|
-
|
|
4077
|
+
const target = boundary && this.boundaryAlign ? boundary : this.target;
|
|
4078
|
+
const [scrollParent] = scrollParents(
|
|
4079
|
+
boundary && this.boundaryAlign ? boundary : this.$el);
|
|
3974
4080
|
|
|
4081
|
+
const scrollParentOffset = offset(scrollParent);
|
|
3975
4082
|
const boundaryOffset = boundary ? offset(boundary) : scrollParentOffset;
|
|
4083
|
+
const viewportOffset = this.getViewportOffset(this.$el);
|
|
3976
4084
|
|
|
3977
4085
|
css(this.$el, 'maxWidth', '');
|
|
3978
|
-
const maxWidth =
|
|
3979
|
-
scrollParentOffset.width -
|
|
3980
|
-
2 * toPx(getCssVar('position-viewport-offset', this.$el));
|
|
4086
|
+
const maxWidth = scrollParentOffset.width - 2 * viewportOffset;
|
|
3981
4087
|
|
|
3982
|
-
if (this.
|
|
4088
|
+
if (this.align === 'justify') {
|
|
3983
4089
|
const prop = this.axis === 'y' ? 'width' : 'height';
|
|
3984
4090
|
css(
|
|
3985
4091
|
this.$el,
|
|
3986
4092
|
prop,
|
|
3987
4093
|
Math.min(
|
|
3988
4094
|
(boundary ? boundaryOffset : offset(this.target))[prop],
|
|
3989
|
-
scrollParentOffset[prop] -
|
|
3990
|
-
|
|
3991
|
-
|
|
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 });
|
|
3992
4119
|
|
|
3993
4120
|
} else if (this.$el.offsetWidth > maxWidth) {
|
|
3994
4121
|
addClass(this.$el, this.clsDrop + "-stack");
|
|
@@ -3996,11 +4123,7 @@
|
|
|
3996
4123
|
|
|
3997
4124
|
css(this.$el, 'maxWidth', maxWidth);
|
|
3998
4125
|
|
|
3999
|
-
this.positionAt(
|
|
4000
|
-
this.$el,
|
|
4001
|
-
boundary && this.boundaryAlign ? boundary : this.target,
|
|
4002
|
-
boundary);
|
|
4003
|
-
|
|
4126
|
+
this.positionAt(this.$el, target, boundary);
|
|
4004
4127
|
} } };
|
|
4005
4128
|
|
|
4006
4129
|
|
|
@@ -4485,7 +4608,7 @@
|
|
|
4485
4608
|
|
|
4486
4609
|
resizeTargets() {
|
|
4487
4610
|
// check for offsetTop change
|
|
4488
|
-
return [this.$el,
|
|
4611
|
+
return [this.$el, ...scrollParents(this.$el, /auto|scroll/)];
|
|
4489
4612
|
},
|
|
4490
4613
|
|
|
4491
4614
|
update: {
|
|
@@ -4497,21 +4620,25 @@
|
|
|
4497
4620
|
let minHeight = '';
|
|
4498
4621
|
const box = boxModelAdjust(this.$el, 'height', 'content-box');
|
|
4499
4622
|
|
|
4623
|
+
const [scrollElement] = scrollParents(this.$el, /auto|scroll/);
|
|
4624
|
+
const { height: viewportHeight } = offsetViewport(scrollElement);
|
|
4625
|
+
|
|
4500
4626
|
if (this.expand) {
|
|
4501
4627
|
minHeight = Math.max(
|
|
4502
|
-
|
|
4503
|
-
dimensions$1(
|
|
4504
|
-
dimensions$1(this.$el).height) -
|
|
4628
|
+
viewportHeight - (
|
|
4629
|
+
dimensions$1(scrollElement).height - dimensions$1(this.$el).height) -
|
|
4505
4630
|
box,
|
|
4506
4631
|
0);
|
|
4507
4632
|
|
|
4508
4633
|
} else {
|
|
4509
4634
|
// on mobile devices (iOS and Android) window.innerHeight !== 100vh
|
|
4510
|
-
minHeight =
|
|
4635
|
+
minHeight = "calc(" + (
|
|
4636
|
+
document.scrollingElement === scrollElement ? '100vh' : viewportHeight + "px");
|
|
4637
|
+
|
|
4511
4638
|
|
|
4512
4639
|
if (this.offsetTop) {
|
|
4513
|
-
const
|
|
4514
|
-
minHeight += top > 0 && top <
|
|
4640
|
+
const top = offsetPosition(this.$el)[0] - offsetPosition(scrollElement)[0];
|
|
4641
|
+
minHeight += top > 0 && top < viewportHeight / 2 ? " - " + top + "px" : '';
|
|
4515
4642
|
}
|
|
4516
4643
|
|
|
4517
4644
|
if (this.offsetBottom === true) {
|
|
@@ -5845,8 +5972,8 @@
|
|
|
5845
5972
|
return this.dropbar;
|
|
5846
5973
|
},
|
|
5847
5974
|
|
|
5848
|
-
handler(_, _ref9) {let { $el } = _ref9;
|
|
5849
|
-
if (!hasClass($el, this.clsDrop)) {
|
|
5975
|
+
handler(_, _ref9) {let { $el, align } = _ref9;
|
|
5976
|
+
if (!hasClass($el, this.clsDrop) || align === 'stretch') {
|
|
5850
5977
|
return;
|
|
5851
5978
|
}
|
|
5852
5979
|
|
|
@@ -5869,8 +5996,8 @@
|
|
|
5869
5996
|
return this.dropbar;
|
|
5870
5997
|
},
|
|
5871
5998
|
|
|
5872
|
-
handler(_, _ref10) {let { $el } = _ref10;
|
|
5873
|
-
if (!hasClass($el, this.clsDrop)) {
|
|
5999
|
+
handler(_, _ref10) {let { $el, align } = _ref10;
|
|
6000
|
+
if (!hasClass($el, this.clsDrop) || align === 'stretch') {
|
|
5874
6001
|
return;
|
|
5875
6002
|
}
|
|
5876
6003
|
|
|
@@ -5920,8 +6047,8 @@
|
|
|
5920
6047
|
return this.dropbar;
|
|
5921
6048
|
},
|
|
5922
6049
|
|
|
5923
|
-
handler(_, _ref12) {let { $el } = _ref12;
|
|
5924
|
-
if (!hasClass($el, this.clsDrop)) {
|
|
6050
|
+
handler(_, _ref12) {let { $el, align } = _ref12;
|
|
6051
|
+
if (!hasClass($el, this.clsDrop) || align === 'stretch') {
|
|
5925
6052
|
return;
|
|
5926
6053
|
}
|
|
5927
6054
|
|
|
@@ -5947,7 +6074,7 @@
|
|
|
5947
6074
|
|
|
5948
6075
|
el = oldHeight < newHeight && el;
|
|
5949
6076
|
|
|
5950
|
-
css(el, '
|
|
6077
|
+
css(el, 'clipPath', "polygon(0 0,100% 0,100% " + oldHeight + "px,0 " + oldHeight + "px)");
|
|
5951
6078
|
|
|
5952
6079
|
height(dropbar, oldHeight);
|
|
5953
6080
|
|
|
@@ -5956,12 +6083,14 @@
|
|
|
5956
6083
|
Transition.start(dropbar, { height: newHeight }, this.duration),
|
|
5957
6084
|
Transition.start(
|
|
5958
6085
|
el,
|
|
5959
|
-
{
|
|
6086
|
+
{
|
|
6087
|
+
clipPath: "polygon(0 0,100% 0,100% " + newHeight + "px,0 " + newHeight + "px)" },
|
|
6088
|
+
|
|
5960
6089
|
this.duration)]).
|
|
5961
6090
|
|
|
5962
6091
|
|
|
5963
6092
|
catch(noop).
|
|
5964
|
-
then(() => css(el, {
|
|
6093
|
+
then(() => css(el, { clipPath: '' }));
|
|
5965
6094
|
},
|
|
5966
6095
|
|
|
5967
6096
|
getDropdown(el) {
|
|
@@ -7066,7 +7195,7 @@
|
|
|
7066
7195
|
|
|
7067
7196
|
watch(connects) {
|
|
7068
7197
|
if (this.swiping) {
|
|
7069
|
-
css(connects, '
|
|
7198
|
+
css(connects, 'touchAction', 'pan-y pinch-zoom');
|
|
7070
7199
|
}
|
|
7071
7200
|
|
|
7072
7201
|
const index = this.index();
|