uikit 3.14.2 → 3.14.3-dev.5325d42a0
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 +24 -3
- package/dist/css/uikit-core-rtl.css +84 -24
- 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 +90 -39
- package/dist/css/uikit-rtl.min.css +1 -1
- package/dist/css/uikit.css +90 -39
- 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 +1 -1
- 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 +6 -6
- 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 +209 -75
- 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/mixin/position.js +44 -13
- package/src/js/mixin/togglable.js +105 -19
- package/src/js/util/animation.js +1 -0
- package/src/js/util/dom.js +4 -3
- 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 +60 -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 +49 -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.3-dev.5325d42a0 | 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) =>
|
|
@@ -1182,14 +1183,15 @@
|
|
|
1182
1183
|
}
|
|
1183
1184
|
|
|
1184
1185
|
function empty(element) {
|
|
1185
|
-
|
|
1186
|
+
element = $(element);
|
|
1187
|
+
element.innerHTML = '';
|
|
1188
|
+
return element;
|
|
1186
1189
|
}
|
|
1187
1190
|
|
|
1188
1191
|
function html(parent, html) {
|
|
1189
|
-
return isUndefined(html) ? $(parent).innerHTML :
|
|
1192
|
+
return isUndefined(html) ? $(parent).innerHTML : append(empty(parent), html);
|
|
1190
1193
|
}
|
|
1191
1194
|
|
|
1192
|
-
const replaceChildren = applyFn('replaceChildren');
|
|
1193
1195
|
const prepend = applyFn('prepend');
|
|
1194
1196
|
const append = applyFn('append');
|
|
1195
1197
|
const before = applyFn('before');
|
|
@@ -1886,7 +1888,7 @@
|
|
|
1886
1888
|
return clamp((scrollTop - start) / (end - start));
|
|
1887
1889
|
}
|
|
1888
1890
|
|
|
1889
|
-
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;}
|
|
1890
1892
|
const scrollEl = scrollingElement(element);
|
|
1891
1893
|
|
|
1892
1894
|
let ancestors = parents(element).reverse();
|
|
@@ -2177,7 +2179,6 @@
|
|
|
2177
2179
|
isTag: isTag,
|
|
2178
2180
|
empty: empty,
|
|
2179
2181
|
html: html,
|
|
2180
|
-
replaceChildren: replaceChildren,
|
|
2181
2182
|
prepend: prepend,
|
|
2182
2183
|
append: append,
|
|
2183
2184
|
before: before,
|
|
@@ -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.3-dev.5325d42a0';
|
|
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
|
|
|
@@ -3107,9 +3108,9 @@
|
|
|
3107
3108
|
isFunction(animate) ?
|
|
3108
3109
|
animate :
|
|
3109
3110
|
animate === false || !this.hasAnimation ?
|
|
3110
|
-
this
|
|
3111
|
+
toggleInstant(this) :
|
|
3111
3112
|
this.hasTransition ?
|
|
3112
|
-
|
|
3113
|
+
toggleTransition(this) :
|
|
3113
3114
|
toggleAnimation(this))(
|
|
3114
3115
|
el, show);
|
|
3115
3116
|
|
|
@@ -3173,7 +3174,25 @@
|
|
|
3173
3174
|
|
|
3174
3175
|
|
|
3175
3176
|
|
|
3176
|
-
function
|
|
3177
|
+
function toggleInstant(_ref3) {let { _toggle } = _ref3;
|
|
3178
|
+
return (el, show) => {
|
|
3179
|
+
Animation.cancel(el);
|
|
3180
|
+
Transition.cancel(el);
|
|
3181
|
+
return _toggle(el, show);
|
|
3182
|
+
};
|
|
3183
|
+
}
|
|
3184
|
+
|
|
3185
|
+
function toggleTransition(cmp) {
|
|
3186
|
+
switch (cmp.animation[0]) {
|
|
3187
|
+
case 'slide-left':
|
|
3188
|
+
return slideHorizontal(cmp);
|
|
3189
|
+
case 'slide-right':
|
|
3190
|
+
return slideHorizontal(cmp, true);}
|
|
3191
|
+
|
|
3192
|
+
return slide$1(cmp);
|
|
3193
|
+
}
|
|
3194
|
+
|
|
3195
|
+
function slide$1(_ref4)
|
|
3177
3196
|
|
|
3178
3197
|
|
|
3179
3198
|
|
|
@@ -3181,14 +3200,17 @@
|
|
|
3181
3200
|
|
|
3182
3201
|
|
|
3183
3202
|
|
|
3184
|
-
{let { isToggled, duration, velocity, initProps, hideProps, transition, _toggle } =
|
|
3203
|
+
{let { isToggled, duration, velocity, initProps, hideProps, transition, _toggle } = _ref4;
|
|
3185
3204
|
return (el, show) => {
|
|
3186
3205
|
const inProgress = Transition.inProgress(el);
|
|
3187
|
-
const inner =
|
|
3206
|
+
const inner =
|
|
3207
|
+
!inProgress && el.hasChildNodes() ?
|
|
3188
3208
|
toFloat(css(el.firstElementChild, 'marginTop')) +
|
|
3189
3209
|
toFloat(css(el.lastElementChild, 'marginBottom')) :
|
|
3190
3210
|
0;
|
|
3191
|
-
const currentHeight = isVisible(el) ?
|
|
3211
|
+
const currentHeight = isVisible(el) ? toFloat(css(el, 'height')) + inner : 0;
|
|
3212
|
+
|
|
3213
|
+
const props = inProgress ? css(el, Object.keys(initProps)) : show ? hideProps : initProps;
|
|
3192
3214
|
|
|
3193
3215
|
Transition.cancel(el);
|
|
3194
3216
|
|
|
@@ -3196,34 +3218,97 @@
|
|
|
3196
3218
|
_toggle(el, true);
|
|
3197
3219
|
}
|
|
3198
3220
|
|
|
3199
|
-
|
|
3221
|
+
css(el, 'maxHeight', '');
|
|
3200
3222
|
|
|
3201
3223
|
// Update child components first
|
|
3202
3224
|
fastdom.flush();
|
|
3203
3225
|
|
|
3204
|
-
const endHeight =
|
|
3205
|
-
duration = velocity *
|
|
3226
|
+
const endHeight = toFloat(css(el, 'height')) + inner;
|
|
3227
|
+
duration = velocity * endHeight + duration;
|
|
3206
3228
|
|
|
3207
|
-
|
|
3229
|
+
css(el, { ...props, maxHeight: currentHeight });
|
|
3208
3230
|
|
|
3209
3231
|
return (
|
|
3210
3232
|
show ?
|
|
3211
3233
|
Transition.start(
|
|
3212
3234
|
el,
|
|
3213
|
-
{ ...initProps, overflow: 'hidden',
|
|
3214
|
-
|
|
3235
|
+
{ ...initProps, overflow: 'hidden', maxHeight: endHeight },
|
|
3236
|
+
duration * (1 - currentHeight / endHeight),
|
|
3215
3237
|
transition) :
|
|
3216
3238
|
|
|
3217
3239
|
Transition.start(
|
|
3218
3240
|
el,
|
|
3219
3241
|
hideProps,
|
|
3220
|
-
|
|
3242
|
+
duration * (currentHeight / endHeight),
|
|
3221
3243
|
transition).
|
|
3222
3244
|
then(() => _toggle(el, false))).
|
|
3223
3245
|
then(() => css(el, initProps));
|
|
3224
3246
|
};
|
|
3225
3247
|
}
|
|
3226
3248
|
|
|
3249
|
+
function slideHorizontal(_ref5, right) {let { isToggled, duration, velocity, transition, _toggle } = _ref5;
|
|
3250
|
+
return (el, show) => {
|
|
3251
|
+
const visible = isVisible(el);
|
|
3252
|
+
const marginLeft = toFloat(css(el, 'marginLeft'));
|
|
3253
|
+
|
|
3254
|
+
Transition.cancel(el);
|
|
3255
|
+
|
|
3256
|
+
const [scrollElement] = scrollParents(el);
|
|
3257
|
+
css(scrollElement, 'overflowX', 'hidden');
|
|
3258
|
+
|
|
3259
|
+
if (!isToggled(el)) {
|
|
3260
|
+
_toggle(el, true);
|
|
3261
|
+
}
|
|
3262
|
+
|
|
3263
|
+
const width = toFloat(css(el, 'width'));
|
|
3264
|
+
duration = velocity * width + duration;
|
|
3265
|
+
|
|
3266
|
+
const percent = visible ? (width + marginLeft * (right ? -1 : 1)) / width * 100 : 0;
|
|
3267
|
+
const offsetEl = offset(el);
|
|
3268
|
+
const useClipPath = right ?
|
|
3269
|
+
offsetEl.right < scrollElement.clientWidth :
|
|
3270
|
+
Math.round(offsetEl.left) > 0;
|
|
3271
|
+
|
|
3272
|
+
css(el, {
|
|
3273
|
+
clipPath: useClipPath ?
|
|
3274
|
+
right ? "polygon(0 0," +
|
|
3275
|
+
percent + "% 0," + percent + "% 100%,0 100%)" : "polygon(" + (
|
|
3276
|
+
100 - percent) + "% 0,100% 0,100% 100%," + (100 - percent) + "% 100%)" :
|
|
3277
|
+
'',
|
|
3278
|
+
marginLeft: (100 - percent) * (right ? 1 : -1) / 100 * width });
|
|
3279
|
+
|
|
3280
|
+
|
|
3281
|
+
return (
|
|
3282
|
+
show ?
|
|
3283
|
+
Transition.start(
|
|
3284
|
+
el,
|
|
3285
|
+
{
|
|
3286
|
+
clipPath: useClipPath ? "polygon(0 0,100% 0,100% 100%,0 100%)" : '',
|
|
3287
|
+
marginLeft: 0 },
|
|
3288
|
+
|
|
3289
|
+
duration * (1 - percent / 100),
|
|
3290
|
+
transition) :
|
|
3291
|
+
|
|
3292
|
+
Transition.start(
|
|
3293
|
+
el,
|
|
3294
|
+
{
|
|
3295
|
+
clipPath: useClipPath ?
|
|
3296
|
+
right ? "polygon(0 0,0 0,0 100%,0 100%)" : "polygon(100% 0,100% 0,100% 100%,100% 100%)" :
|
|
3297
|
+
|
|
3298
|
+
|
|
3299
|
+
'',
|
|
3300
|
+
marginLeft: (right ? 1 : -1) * width },
|
|
3301
|
+
|
|
3302
|
+
duration * (percent / 100),
|
|
3303
|
+
transition).
|
|
3304
|
+
then(() => _toggle(el, false))).
|
|
3305
|
+
then(() => {
|
|
3306
|
+
css(scrollElement, 'overflowX', '');
|
|
3307
|
+
css(el, { clipPath: '', marginLeft: '' });
|
|
3308
|
+
});
|
|
3309
|
+
};
|
|
3310
|
+
}
|
|
3311
|
+
|
|
3227
3312
|
function toggleAnimation(cmp) {
|
|
3228
3313
|
return (el, show) => {
|
|
3229
3314
|
Animation.cancel(el);
|
|
@@ -3257,7 +3342,7 @@
|
|
|
3257
3342
|
data: {
|
|
3258
3343
|
targets: '> *',
|
|
3259
3344
|
active: false,
|
|
3260
|
-
animation: [
|
|
3345
|
+
animation: ['slide'],
|
|
3261
3346
|
collapsible: true,
|
|
3262
3347
|
multiple: false,
|
|
3263
3348
|
clsOpen: 'uk-open',
|
|
@@ -3367,7 +3452,7 @@
|
|
|
3367
3452
|
}
|
|
3368
3453
|
|
|
3369
3454
|
hide(content, false);
|
|
3370
|
-
await
|
|
3455
|
+
await slide$1(this)(el._wrapper, show);
|
|
3371
3456
|
hide(content, !show);
|
|
3372
3457
|
|
|
3373
3458
|
delete el._wrapper;
|
|
@@ -3401,7 +3486,7 @@
|
|
|
3401
3486
|
|
|
3402
3487
|
|
|
3403
3488
|
data: {
|
|
3404
|
-
animation: [
|
|
3489
|
+
animation: ['slide'],
|
|
3405
3490
|
selClose: '.uk-alert-close',
|
|
3406
3491
|
duration: 150,
|
|
3407
3492
|
hideProps: { opacity: 0, ...Togglable.data.hideProps } },
|
|
@@ -3587,23 +3672,17 @@
|
|
|
3587
3672
|
|
|
3588
3673
|
connected() {
|
|
3589
3674
|
this.pos = this.$props.pos.split('-').concat('center').slice(0, 2);
|
|
3590
|
-
this.
|
|
3675
|
+
[this.dir, this.align] = this.pos;
|
|
3676
|
+
this.axis = includes(['top', 'bottom'], this.dir) ? 'y' : 'x';
|
|
3591
3677
|
},
|
|
3592
3678
|
|
|
3593
3679
|
methods: {
|
|
3594
3680
|
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];
|
|
3681
|
+
let offset = [this.getPositionOffset(element), this.getShiftOffset(element)];
|
|
3603
3682
|
|
|
3604
3683
|
const attach = {
|
|
3605
|
-
element: [flipPosition(dir), align],
|
|
3606
|
-
target: [dir, align] };
|
|
3684
|
+
element: [flipPosition(this.dir), this.align],
|
|
3685
|
+
target: [this.dir, this.align] };
|
|
3607
3686
|
|
|
3608
3687
|
|
|
3609
3688
|
if (this.axis === 'y') {
|
|
@@ -3613,13 +3692,41 @@
|
|
|
3613
3692
|
offset = offset.reverse();
|
|
3614
3693
|
}
|
|
3615
3694
|
|
|
3695
|
+
// Ensure none positioned element does not generate scrollbars
|
|
3696
|
+
const elDim = dimensions$1(element);
|
|
3697
|
+
css(element, { top: -elDim.height, left: -elDim.width });
|
|
3698
|
+
|
|
3616
3699
|
positionAt(element, target, {
|
|
3617
3700
|
attach,
|
|
3618
3701
|
offset,
|
|
3619
3702
|
boundary,
|
|
3620
3703
|
flip: this.flip,
|
|
3621
|
-
viewportOffset:
|
|
3704
|
+
viewportOffset: this.getViewportOffset(element) });
|
|
3705
|
+
|
|
3706
|
+
},
|
|
3707
|
+
|
|
3708
|
+
getPositionOffset(element) {
|
|
3709
|
+
return (
|
|
3710
|
+
toPx(
|
|
3711
|
+
this.offset === false ? getCssVar('position-offset', element) : this.offset,
|
|
3712
|
+
this.axis === 'x' ? 'width' : 'height',
|
|
3713
|
+
element) * (
|
|
3714
|
+
includes(['left', 'top'], this.dir) ? -1 : 1));
|
|
3715
|
+
|
|
3716
|
+
},
|
|
3717
|
+
|
|
3718
|
+
getShiftOffset(element) {
|
|
3719
|
+
return includes(['center', 'justify', 'stretch'], this.align) ?
|
|
3720
|
+
0 :
|
|
3721
|
+
toPx(
|
|
3722
|
+
getCssVar('position-shift-offset', element),
|
|
3723
|
+
this.axis === 'y' ? 'width' : 'height',
|
|
3724
|
+
element) * (
|
|
3725
|
+
includes(['left', 'top'], this.align) ? 1 : -1);
|
|
3726
|
+
},
|
|
3622
3727
|
|
|
3728
|
+
getViewportOffset(element) {
|
|
3729
|
+
return toPx(getCssVar('position-viewport-offset', element));
|
|
3623
3730
|
} } };
|
|
3624
3731
|
|
|
3625
3732
|
let active$1;
|
|
@@ -3637,7 +3744,8 @@
|
|
|
3637
3744
|
delayShow: Number,
|
|
3638
3745
|
delayHide: Number,
|
|
3639
3746
|
display: String,
|
|
3640
|
-
clsDrop: String
|
|
3747
|
+
clsDrop: String,
|
|
3748
|
+
animateOut: Boolean },
|
|
3641
3749
|
|
|
3642
3750
|
|
|
3643
3751
|
data: {
|
|
@@ -3651,7 +3759,8 @@
|
|
|
3651
3759
|
clsDrop: false,
|
|
3652
3760
|
animation: ['uk-animation-fade'],
|
|
3653
3761
|
cls: 'uk-open',
|
|
3654
|
-
container: false
|
|
3762
|
+
container: false,
|
|
3763
|
+
animateOut: false },
|
|
3655
3764
|
|
|
3656
3765
|
|
|
3657
3766
|
created() {
|
|
@@ -3839,7 +3948,7 @@
|
|
|
3839
3948
|
}
|
|
3840
3949
|
}),
|
|
3841
3950
|
|
|
3842
|
-
...(this.display === 'static' ?
|
|
3951
|
+
...(this.display === 'static' && this.align !== 'stretch' ?
|
|
3843
3952
|
[] :
|
|
3844
3953
|
(() => {
|
|
3845
3954
|
const handler = () => this.$emit();
|
|
@@ -3900,7 +4009,7 @@
|
|
|
3900
4009
|
methods: {
|
|
3901
4010
|
show(target, delay) {if (target === void 0) {target = this.target;}if (delay === void 0) {delay = true;}
|
|
3902
4011
|
if (this.isToggled() && target && this.target && target !== this.target) {
|
|
3903
|
-
this.hide(false);
|
|
4012
|
+
this.hide(false, false);
|
|
3904
4013
|
}
|
|
3905
4014
|
|
|
3906
4015
|
this.target = target;
|
|
@@ -3920,7 +4029,7 @@
|
|
|
3920
4029
|
let prev;
|
|
3921
4030
|
while (active$1 && prev !== active$1 && !within(this.$el, active$1.$el)) {
|
|
3922
4031
|
prev = active$1;
|
|
3923
|
-
active$1.hide(false);
|
|
4032
|
+
active$1.hide(false, false);
|
|
3924
4033
|
}
|
|
3925
4034
|
}
|
|
3926
4035
|
|
|
@@ -3934,8 +4043,8 @@
|
|
|
3934
4043
|
|
|
3935
4044
|
},
|
|
3936
4045
|
|
|
3937
|
-
hide(delay) {if (delay === void 0) {delay = true;}
|
|
3938
|
-
const hide = () => this.toggleElement(this.$el, false,
|
|
4046
|
+
hide(delay, animate) {if (delay === void 0) {delay = true;}if (animate === void 0) {animate = true;}
|
|
4047
|
+
const hide = () => this.toggleElement(this.$el, false, this.animateOut && animate);
|
|
3939
4048
|
|
|
3940
4049
|
this.clearTimers();
|
|
3941
4050
|
|
|
@@ -3967,28 +4076,51 @@
|
|
|
3967
4076
|
position() {
|
|
3968
4077
|
removeClass(this.$el, this.clsDrop + "-stack");
|
|
3969
4078
|
toggleClass(this.$el, this.clsDrop + "-boundary", this.boundaryAlign);
|
|
4079
|
+
toggleClass(this.$el, this.clsDrop + "-stretch", this.align === 'stretch');
|
|
3970
4080
|
|
|
3971
4081
|
const boundary = query(this.boundary, this.$el);
|
|
3972
|
-
const
|
|
3973
|
-
|
|
4082
|
+
const target = boundary && this.boundaryAlign ? boundary : this.target;
|
|
4083
|
+
const [scrollParent] = scrollParents(
|
|
4084
|
+
boundary && this.boundaryAlign ? boundary : this.$el);
|
|
3974
4085
|
|
|
4086
|
+
const scrollParentOffset = offset(scrollParent);
|
|
3975
4087
|
const boundaryOffset = boundary ? offset(boundary) : scrollParentOffset;
|
|
4088
|
+
const viewportOffset = this.getViewportOffset(this.$el);
|
|
3976
4089
|
|
|
3977
4090
|
css(this.$el, 'maxWidth', '');
|
|
3978
|
-
const maxWidth =
|
|
3979
|
-
scrollParentOffset.width -
|
|
3980
|
-
2 * toPx(getCssVar('position-viewport-offset', this.$el));
|
|
4091
|
+
const maxWidth = scrollParentOffset.width - 2 * viewportOffset;
|
|
3981
4092
|
|
|
3982
|
-
if (this.
|
|
4093
|
+
if (this.align === 'justify') {
|
|
3983
4094
|
const prop = this.axis === 'y' ? 'width' : 'height';
|
|
3984
4095
|
css(
|
|
3985
4096
|
this.$el,
|
|
3986
4097
|
prop,
|
|
3987
4098
|
Math.min(
|
|
3988
4099
|
(boundary ? boundaryOffset : offset(this.target))[prop],
|
|
3989
|
-
scrollParentOffset[prop] -
|
|
3990
|
-
|
|
3991
|
-
|
|
4100
|
+
scrollParentOffset[prop] - 2 * viewportOffset));
|
|
4101
|
+
|
|
4102
|
+
|
|
4103
|
+
} else if (this.align === 'stretch') {
|
|
4104
|
+
this.flip = this.axis === 'y' ? 'x' : 'y';
|
|
4105
|
+
this.display = 'static';
|
|
4106
|
+
|
|
4107
|
+
const viewport = offsetViewport(scrollParent);
|
|
4108
|
+
const targetDim = offset(target);
|
|
4109
|
+
const elOffset = Math.abs(this.getPositionOffset(this.$el)) + viewportOffset;
|
|
4110
|
+
|
|
4111
|
+
css(this.$el, {
|
|
4112
|
+
width:
|
|
4113
|
+
this.axis === 'y' ?
|
|
4114
|
+
viewport.width :
|
|
4115
|
+
(this.dir === 'left' ?
|
|
4116
|
+
targetDim.left - viewport.left :
|
|
4117
|
+
viewport.right - targetDim.right) - elOffset,
|
|
4118
|
+
height:
|
|
4119
|
+
this.axis === 'x' ?
|
|
4120
|
+
viewport.height :
|
|
4121
|
+
(this.dir === 'top' ?
|
|
4122
|
+
targetDim.top - viewport.top :
|
|
4123
|
+
viewport.bottom - targetDim.bottom) - elOffset });
|
|
3992
4124
|
|
|
3993
4125
|
} else if (this.$el.offsetWidth > maxWidth) {
|
|
3994
4126
|
addClass(this.$el, this.clsDrop + "-stack");
|
|
@@ -3996,11 +4128,7 @@
|
|
|
3996
4128
|
|
|
3997
4129
|
css(this.$el, 'maxWidth', maxWidth);
|
|
3998
4130
|
|
|
3999
|
-
this.positionAt(
|
|
4000
|
-
this.$el,
|
|
4001
|
-
boundary && this.boundaryAlign ? boundary : this.target,
|
|
4002
|
-
boundary);
|
|
4003
|
-
|
|
4131
|
+
this.positionAt(this.$el, target, boundary);
|
|
4004
4132
|
} } };
|
|
4005
4133
|
|
|
4006
4134
|
|
|
@@ -4485,7 +4613,7 @@
|
|
|
4485
4613
|
|
|
4486
4614
|
resizeTargets() {
|
|
4487
4615
|
// check for offsetTop change
|
|
4488
|
-
return [this.$el,
|
|
4616
|
+
return [this.$el, ...scrollParents(this.$el, /auto|scroll/)];
|
|
4489
4617
|
},
|
|
4490
4618
|
|
|
4491
4619
|
update: {
|
|
@@ -4497,21 +4625,25 @@
|
|
|
4497
4625
|
let minHeight = '';
|
|
4498
4626
|
const box = boxModelAdjust(this.$el, 'height', 'content-box');
|
|
4499
4627
|
|
|
4628
|
+
const [scrollElement] = scrollParents(this.$el, /auto|scroll/);
|
|
4629
|
+
const { height: viewportHeight } = offsetViewport(scrollElement);
|
|
4630
|
+
|
|
4500
4631
|
if (this.expand) {
|
|
4501
4632
|
minHeight = Math.max(
|
|
4502
|
-
|
|
4503
|
-
dimensions$1(
|
|
4504
|
-
dimensions$1(this.$el).height) -
|
|
4633
|
+
viewportHeight - (
|
|
4634
|
+
dimensions$1(scrollElement).height - dimensions$1(this.$el).height) -
|
|
4505
4635
|
box,
|
|
4506
4636
|
0);
|
|
4507
4637
|
|
|
4508
4638
|
} else {
|
|
4509
4639
|
// on mobile devices (iOS and Android) window.innerHeight !== 100vh
|
|
4510
|
-
minHeight =
|
|
4640
|
+
minHeight = "calc(" + (
|
|
4641
|
+
document.scrollingElement === scrollElement ? '100vh' : viewportHeight + "px");
|
|
4642
|
+
|
|
4511
4643
|
|
|
4512
4644
|
if (this.offsetTop) {
|
|
4513
|
-
const
|
|
4514
|
-
minHeight += top > 0 && top <
|
|
4645
|
+
const top = offsetPosition(this.$el)[0] - offsetPosition(scrollElement)[0];
|
|
4646
|
+
minHeight += top > 0 && top < viewportHeight / 2 ? " - " + top + "px" : '';
|
|
4515
4647
|
}
|
|
4516
4648
|
|
|
4517
4649
|
if (this.offsetBottom === true) {
|
|
@@ -5845,8 +5977,8 @@
|
|
|
5845
5977
|
return this.dropbar;
|
|
5846
5978
|
},
|
|
5847
5979
|
|
|
5848
|
-
handler(_, _ref9) {let { $el } = _ref9;
|
|
5849
|
-
if (!hasClass($el, this.clsDrop)) {
|
|
5980
|
+
handler(_, _ref9) {let { $el, align } = _ref9;
|
|
5981
|
+
if (!hasClass($el, this.clsDrop) || align === 'stretch') {
|
|
5850
5982
|
return;
|
|
5851
5983
|
}
|
|
5852
5984
|
|
|
@@ -5869,8 +6001,8 @@
|
|
|
5869
6001
|
return this.dropbar;
|
|
5870
6002
|
},
|
|
5871
6003
|
|
|
5872
|
-
handler(_, _ref10) {let { $el } = _ref10;
|
|
5873
|
-
if (!hasClass($el, this.clsDrop)) {
|
|
6004
|
+
handler(_, _ref10) {let { $el, align } = _ref10;
|
|
6005
|
+
if (!hasClass($el, this.clsDrop) || align === 'stretch') {
|
|
5874
6006
|
return;
|
|
5875
6007
|
}
|
|
5876
6008
|
|
|
@@ -5920,8 +6052,8 @@
|
|
|
5920
6052
|
return this.dropbar;
|
|
5921
6053
|
},
|
|
5922
6054
|
|
|
5923
|
-
handler(_, _ref12) {let { $el } = _ref12;
|
|
5924
|
-
if (!hasClass($el, this.clsDrop)) {
|
|
6055
|
+
handler(_, _ref12) {let { $el, align } = _ref12;
|
|
6056
|
+
if (!hasClass($el, this.clsDrop) || align === 'stretch') {
|
|
5925
6057
|
return;
|
|
5926
6058
|
}
|
|
5927
6059
|
|
|
@@ -5947,7 +6079,7 @@
|
|
|
5947
6079
|
|
|
5948
6080
|
el = oldHeight < newHeight && el;
|
|
5949
6081
|
|
|
5950
|
-
css(el, '
|
|
6082
|
+
css(el, 'clipPath', "polygon(0 0,100% 0,100% " + oldHeight + "px,0 " + oldHeight + "px)");
|
|
5951
6083
|
|
|
5952
6084
|
height(dropbar, oldHeight);
|
|
5953
6085
|
|
|
@@ -5956,12 +6088,14 @@
|
|
|
5956
6088
|
Transition.start(dropbar, { height: newHeight }, this.duration),
|
|
5957
6089
|
Transition.start(
|
|
5958
6090
|
el,
|
|
5959
|
-
{
|
|
6091
|
+
{
|
|
6092
|
+
clipPath: "polygon(0 0,100% 0,100% " + newHeight + "px,0 " + newHeight + "px)" },
|
|
6093
|
+
|
|
5960
6094
|
this.duration)]).
|
|
5961
6095
|
|
|
5962
6096
|
|
|
5963
6097
|
catch(noop).
|
|
5964
|
-
then(() => css(el, {
|
|
6098
|
+
then(() => css(el, { clipPath: '' }));
|
|
5965
6099
|
},
|
|
5966
6100
|
|
|
5967
6101
|
getDropdown(el) {
|