uikit 3.14.2-dev.abf300d01 → 3.14.2-dev.c7c85455d
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 +8 -1
- package/dist/css/uikit-core-rtl.css +47 -2
- package/dist/css/uikit-core-rtl.min.css +1 -1
- package/dist/css/uikit-core.css +47 -2
- package/dist/css/uikit-core.min.css +1 -1
- package/dist/css/uikit-rtl.css +51 -2
- package/dist/css/uikit-rtl.min.css +1 -1
- package/dist/css/uikit.css +51 -2
- 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 +70 -35
- package/dist/js/components/parallax.min.js +1 -1
- package/dist/js/components/slider-parallax.js +55 -35
- 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 +55 -35
- 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 -44
- 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 +214 -94
- 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 +283 -128
- package/dist/js/uikit.min.js +1 -1
- package/package.json +1 -1
- package/src/js/components/parallax.js +15 -0
- 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/scrollspy.js +4 -0
- package/src/js/core/toggle.js +5 -8
- package/src/js/mixin/parallax.js +54 -34
- package/src/js/mixin/position.js +44 -23
- 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 +17 -4
- package/src/less/components/dropdown.less +19 -4
- package/src/less/components/margin.less +13 -14
- package/src/less/components/nav.less +1 -1
- package/src/less/components/navbar.less +32 -11
- package/src/less/components/position.less +1 -1
- package/src/less/components/sticky.less +7 -0
- package/src/less/components/utility.less +0 -1
- package/src/less/theme/dropdown.less +11 -0
- package/src/less/theme/navbar.less +7 -0
- package/src/scss/components/drop.scss +17 -4
- package/src/scss/components/dropdown.scss +19 -4
- package/src/scss/components/margin.scss +13 -14
- package/src/scss/components/nav.scss +1 -1
- package/src/scss/components/navbar.scss +21 -0
- package/src/scss/components/position.scss +1 -1
- package/src/scss/components/sticky.scss +7 -0
- package/src/scss/components/utility.scss +0 -1
- package/src/scss/mixins-theme.scss +8 -0
- package/src/scss/mixins.scss +2 -0
- package/src/scss/theme/dropdown.scss +8 -0
- package/src/scss/theme/navbar.scss +4 -0
- package/src/scss/variables-theme.scss +3 -0
- package/src/scss/variables.scss +1 -0
- 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/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.c7c85455d | 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();
|
|
@@ -2949,7 +2950,7 @@
|
|
|
2949
2950
|
UIkit.data = '__uikit__';
|
|
2950
2951
|
UIkit.prefix = 'uk-';
|
|
2951
2952
|
UIkit.options = {};
|
|
2952
|
-
UIkit.version = '3.14.2-dev.
|
|
2953
|
+
UIkit.version = '3.14.2-dev.c7c85455d';
|
|
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,7 +3169,25 @@
|
|
|
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
|
+
}
|
|
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
|
+
}
|
|
3189
|
+
|
|
3190
|
+
function slide$1(_ref4)
|
|
3177
3191
|
|
|
3178
3192
|
|
|
3179
3193
|
|
|
@@ -3181,14 +3195,17 @@
|
|
|
3181
3195
|
|
|
3182
3196
|
|
|
3183
3197
|
|
|
3184
|
-
{let { isToggled, duration, velocity, initProps, hideProps, transition, _toggle } =
|
|
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,33 +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
|
-
const mainAxisOffset =
|
|
3598
|
-
toPx(
|
|
3599
|
-
this.offset === false ? getCssVar('position-offset', element) : this.offset,
|
|
3600
|
-
this.axis === 'x' ? 'width' : 'height',
|
|
3601
|
-
element) * (
|
|
3602
|
-
includes(['left', 'top'], dir) ? -1 : 1);
|
|
3603
|
-
|
|
3604
|
-
const crossAxisOffset = includes(['center', 'justify'], align) ?
|
|
3605
|
-
0 :
|
|
3606
|
-
toPx(
|
|
3607
|
-
getCssVar('position-shift-offset', element),
|
|
3608
|
-
this.axis === 'y' ? 'width' : 'height',
|
|
3609
|
-
element) * (
|
|
3610
|
-
includes(['left', 'top'], align) ? 1 : -1);
|
|
3611
|
-
|
|
3612
|
-
let offset = [mainAxisOffset, crossAxisOffset];
|
|
3676
|
+
let offset = [this.getPositionOffset(element), this.getShiftOffset(element)];
|
|
3613
3677
|
|
|
3614
3678
|
const attach = {
|
|
3615
|
-
element: [flipPosition(dir), align],
|
|
3616
|
-
target: [dir, align] };
|
|
3679
|
+
element: [flipPosition(this.dir), this.align],
|
|
3680
|
+
target: [this.dir, this.align] };
|
|
3617
3681
|
|
|
3618
3682
|
|
|
3619
3683
|
if (this.axis === 'y') {
|
|
@@ -3623,13 +3687,41 @@
|
|
|
3623
3687
|
offset = offset.reverse();
|
|
3624
3688
|
}
|
|
3625
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
|
+
|
|
3626
3694
|
positionAt(element, target, {
|
|
3627
3695
|
attach,
|
|
3628
3696
|
offset,
|
|
3629
3697
|
boundary,
|
|
3630
3698
|
flip: this.flip,
|
|
3631
|
-
viewportOffset:
|
|
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
|
+
},
|
|
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
|
+
},
|
|
3632
3722
|
|
|
3723
|
+
getViewportOffset(element) {
|
|
3724
|
+
return toPx(getCssVar('position-viewport-offset', element));
|
|
3633
3725
|
} } };
|
|
3634
3726
|
|
|
3635
3727
|
let active$1;
|
|
@@ -3647,7 +3739,8 @@
|
|
|
3647
3739
|
delayShow: Number,
|
|
3648
3740
|
delayHide: Number,
|
|
3649
3741
|
display: String,
|
|
3650
|
-
clsDrop: String
|
|
3742
|
+
clsDrop: String,
|
|
3743
|
+
animateOut: Boolean },
|
|
3651
3744
|
|
|
3652
3745
|
|
|
3653
3746
|
data: {
|
|
@@ -3661,7 +3754,8 @@
|
|
|
3661
3754
|
clsDrop: false,
|
|
3662
3755
|
animation: ['uk-animation-fade'],
|
|
3663
3756
|
cls: 'uk-open',
|
|
3664
|
-
container: false
|
|
3757
|
+
container: false,
|
|
3758
|
+
animateOut: false },
|
|
3665
3759
|
|
|
3666
3760
|
|
|
3667
3761
|
created() {
|
|
@@ -3849,7 +3943,7 @@
|
|
|
3849
3943
|
}
|
|
3850
3944
|
}),
|
|
3851
3945
|
|
|
3852
|
-
...(this.display === 'static' ?
|
|
3946
|
+
...(this.display === 'static' && this.align !== 'stretch' ?
|
|
3853
3947
|
[] :
|
|
3854
3948
|
(() => {
|
|
3855
3949
|
const handler = () => this.$emit();
|
|
@@ -3910,7 +4004,7 @@
|
|
|
3910
4004
|
methods: {
|
|
3911
4005
|
show(target, delay) {if (target === void 0) {target = this.target;}if (delay === void 0) {delay = true;}
|
|
3912
4006
|
if (this.isToggled() && target && this.target && target !== this.target) {
|
|
3913
|
-
this.hide(false);
|
|
4007
|
+
this.hide(false, false);
|
|
3914
4008
|
}
|
|
3915
4009
|
|
|
3916
4010
|
this.target = target;
|
|
@@ -3930,7 +4024,7 @@
|
|
|
3930
4024
|
let prev;
|
|
3931
4025
|
while (active$1 && prev !== active$1 && !within(this.$el, active$1.$el)) {
|
|
3932
4026
|
prev = active$1;
|
|
3933
|
-
active$1.hide(false);
|
|
4027
|
+
active$1.hide(false, false);
|
|
3934
4028
|
}
|
|
3935
4029
|
}
|
|
3936
4030
|
|
|
@@ -3944,8 +4038,8 @@
|
|
|
3944
4038
|
|
|
3945
4039
|
},
|
|
3946
4040
|
|
|
3947
|
-
hide(delay) {if (delay === void 0) {delay = true;}
|
|
3948
|
-
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);
|
|
3949
4043
|
|
|
3950
4044
|
this.clearTimers();
|
|
3951
4045
|
|
|
@@ -3977,28 +4071,51 @@
|
|
|
3977
4071
|
position() {
|
|
3978
4072
|
removeClass(this.$el, this.clsDrop + "-stack");
|
|
3979
4073
|
toggleClass(this.$el, this.clsDrop + "-boundary", this.boundaryAlign);
|
|
4074
|
+
toggleClass(this.$el, this.clsDrop + "-stretch", this.align === 'stretch');
|
|
3980
4075
|
|
|
3981
4076
|
const boundary = query(this.boundary, this.$el);
|
|
3982
|
-
const
|
|
3983
|
-
|
|
4077
|
+
const target = boundary && this.boundaryAlign ? boundary : this.target;
|
|
4078
|
+
const [scrollParent] = scrollParents(
|
|
4079
|
+
boundary && this.boundaryAlign ? boundary : this.$el);
|
|
3984
4080
|
|
|
4081
|
+
const scrollParentOffset = offset(scrollParent);
|
|
3985
4082
|
const boundaryOffset = boundary ? offset(boundary) : scrollParentOffset;
|
|
4083
|
+
const viewportOffset = this.getViewportOffset(this.$el);
|
|
3986
4084
|
|
|
3987
4085
|
css(this.$el, 'maxWidth', '');
|
|
3988
|
-
const maxWidth =
|
|
3989
|
-
scrollParentOffset.width -
|
|
3990
|
-
2 * toPx(getCssVar('position-viewport-offset', this.$el));
|
|
4086
|
+
const maxWidth = scrollParentOffset.width - 2 * viewportOffset;
|
|
3991
4087
|
|
|
3992
|
-
if (this.
|
|
4088
|
+
if (this.align === 'justify') {
|
|
3993
4089
|
const prop = this.axis === 'y' ? 'width' : 'height';
|
|
3994
4090
|
css(
|
|
3995
4091
|
this.$el,
|
|
3996
4092
|
prop,
|
|
3997
4093
|
Math.min(
|
|
3998
4094
|
(boundary ? boundaryOffset : offset(this.target))[prop],
|
|
3999
|
-
scrollParentOffset[prop] -
|
|
4000
|
-
|
|
4001
|
-
|
|
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 });
|
|
4002
4119
|
|
|
4003
4120
|
} else if (this.$el.offsetWidth > maxWidth) {
|
|
4004
4121
|
addClass(this.$el, this.clsDrop + "-stack");
|
|
@@ -4006,11 +4123,7 @@
|
|
|
4006
4123
|
|
|
4007
4124
|
css(this.$el, 'maxWidth', maxWidth);
|
|
4008
4125
|
|
|
4009
|
-
this.positionAt(
|
|
4010
|
-
this.$el,
|
|
4011
|
-
boundary && this.boundaryAlign ? boundary : this.target,
|
|
4012
|
-
boundary);
|
|
4013
|
-
|
|
4126
|
+
this.positionAt(this.$el, target, boundary);
|
|
4014
4127
|
} } };
|
|
4015
4128
|
|
|
4016
4129
|
|
|
@@ -4495,7 +4608,7 @@
|
|
|
4495
4608
|
|
|
4496
4609
|
resizeTargets() {
|
|
4497
4610
|
// check for offsetTop change
|
|
4498
|
-
return [this.$el,
|
|
4611
|
+
return [this.$el, ...scrollParents(this.$el, /auto|scroll/)];
|
|
4499
4612
|
},
|
|
4500
4613
|
|
|
4501
4614
|
update: {
|
|
@@ -4507,21 +4620,25 @@
|
|
|
4507
4620
|
let minHeight = '';
|
|
4508
4621
|
const box = boxModelAdjust(this.$el, 'height', 'content-box');
|
|
4509
4622
|
|
|
4623
|
+
const [scrollElement] = scrollParents(this.$el, /auto|scroll/);
|
|
4624
|
+
const { height: viewportHeight } = offsetViewport(scrollElement);
|
|
4625
|
+
|
|
4510
4626
|
if (this.expand) {
|
|
4511
4627
|
minHeight = Math.max(
|
|
4512
|
-
|
|
4513
|
-
dimensions$1(
|
|
4514
|
-
dimensions$1(this.$el).height) -
|
|
4628
|
+
viewportHeight - (
|
|
4629
|
+
dimensions$1(scrollElement).height - dimensions$1(this.$el).height) -
|
|
4515
4630
|
box,
|
|
4516
4631
|
0);
|
|
4517
4632
|
|
|
4518
4633
|
} else {
|
|
4519
4634
|
// on mobile devices (iOS and Android) window.innerHeight !== 100vh
|
|
4520
|
-
minHeight =
|
|
4635
|
+
minHeight = "calc(" + (
|
|
4636
|
+
document.scrollingElement === scrollElement ? '100vh' : viewportHeight + "px");
|
|
4637
|
+
|
|
4521
4638
|
|
|
4522
4639
|
if (this.offsetTop) {
|
|
4523
|
-
const
|
|
4524
|
-
minHeight += top > 0 && top <
|
|
4640
|
+
const top = offsetPosition(this.$el)[0] - offsetPosition(scrollElement)[0];
|
|
4641
|
+
minHeight += top > 0 && top < viewportHeight / 2 ? " - " + top + "px" : '';
|
|
4525
4642
|
}
|
|
4526
4643
|
|
|
4527
4644
|
if (this.offsetBottom === true) {
|
|
@@ -5855,8 +5972,8 @@
|
|
|
5855
5972
|
return this.dropbar;
|
|
5856
5973
|
},
|
|
5857
5974
|
|
|
5858
|
-
handler(_, _ref9) {let { $el } = _ref9;
|
|
5859
|
-
if (!hasClass($el, this.clsDrop)) {
|
|
5975
|
+
handler(_, _ref9) {let { $el, align } = _ref9;
|
|
5976
|
+
if (!hasClass($el, this.clsDrop) || align === 'stretch') {
|
|
5860
5977
|
return;
|
|
5861
5978
|
}
|
|
5862
5979
|
|
|
@@ -5879,8 +5996,8 @@
|
|
|
5879
5996
|
return this.dropbar;
|
|
5880
5997
|
},
|
|
5881
5998
|
|
|
5882
|
-
handler(_, _ref10) {let { $el } = _ref10;
|
|
5883
|
-
if (!hasClass($el, this.clsDrop)) {
|
|
5999
|
+
handler(_, _ref10) {let { $el, align } = _ref10;
|
|
6000
|
+
if (!hasClass($el, this.clsDrop) || align === 'stretch') {
|
|
5884
6001
|
return;
|
|
5885
6002
|
}
|
|
5886
6003
|
|
|
@@ -5930,8 +6047,8 @@
|
|
|
5930
6047
|
return this.dropbar;
|
|
5931
6048
|
},
|
|
5932
6049
|
|
|
5933
|
-
handler(_, _ref12) {let { $el } = _ref12;
|
|
5934
|
-
if (!hasClass($el, this.clsDrop)) {
|
|
6050
|
+
handler(_, _ref12) {let { $el, align } = _ref12;
|
|
6051
|
+
if (!hasClass($el, this.clsDrop) || align === 'stretch') {
|
|
5935
6052
|
return;
|
|
5936
6053
|
}
|
|
5937
6054
|
|
|
@@ -5957,7 +6074,7 @@
|
|
|
5957
6074
|
|
|
5958
6075
|
el = oldHeight < newHeight && el;
|
|
5959
6076
|
|
|
5960
|
-
css(el, '
|
|
6077
|
+
css(el, 'clipPath', "polygon(0 0,100% 0,100% " + oldHeight + "px,0 " + oldHeight + "px)");
|
|
5961
6078
|
|
|
5962
6079
|
height(dropbar, oldHeight);
|
|
5963
6080
|
|
|
@@ -5966,12 +6083,14 @@
|
|
|
5966
6083
|
Transition.start(dropbar, { height: newHeight }, this.duration),
|
|
5967
6084
|
Transition.start(
|
|
5968
6085
|
el,
|
|
5969
|
-
{
|
|
6086
|
+
{
|
|
6087
|
+
clipPath: "polygon(0 0,100% 0,100% " + newHeight + "px,0 " + newHeight + "px)" },
|
|
6088
|
+
|
|
5970
6089
|
this.duration)]).
|
|
5971
6090
|
|
|
5972
6091
|
|
|
5973
6092
|
catch(noop).
|
|
5974
|
-
then(() => css(el, {
|
|
6093
|
+
then(() => css(el, { clipPath: '' }));
|
|
5975
6094
|
},
|
|
5976
6095
|
|
|
5977
6096
|
getDropdown(el) {
|
|
@@ -6537,6 +6656,10 @@
|
|
|
6537
6656
|
toggle(el, inview) {
|
|
6538
6657
|
const state = this._data.elements.get(el);
|
|
6539
6658
|
|
|
6659
|
+
if (!state) {
|
|
6660
|
+
return;
|
|
6661
|
+
}
|
|
6662
|
+
|
|
6540
6663
|
state.off == null ? void 0 : state.off();
|
|
6541
6664
|
|
|
6542
6665
|
css(el, 'visibility', !inview && this.hidden ? 'hidden' : '');
|
|
@@ -7272,6 +7395,8 @@
|
|
|
7272
7395
|
},
|
|
7273
7396
|
|
|
7274
7397
|
handler(e) {
|
|
7398
|
+
this._preventClick = null;
|
|
7399
|
+
|
|
7275
7400
|
if (!isTouch(e) || this._showState) {
|
|
7276
7401
|
return;
|
|
7277
7402
|
}
|
|
@@ -7358,6 +7483,7 @@
|
|
|
7358
7483
|
handler(e) {
|
|
7359
7484
|
let link;
|
|
7360
7485
|
if (
|
|
7486
|
+
this._preventClick ||
|
|
7361
7487
|
closest(e.target, 'a[href="#"], a[href=""]') ||
|
|
7362
7488
|
(link = closest(e.target, 'a[href]')) && (
|
|
7363
7489
|
attr(this.$el, 'aria-expanded') !== 'true' ||
|
|
@@ -7366,15 +7492,9 @@
|
|
|
7366
7492
|
e.preventDefault();
|
|
7367
7493
|
}
|
|
7368
7494
|
|
|
7369
|
-
if (this._preventClick) {
|
|
7370
|
-
|
|
7371
|
-
}
|
|
7372
|
-
|
|
7373
|
-
if (!includes(this.mode, 'click')) {
|
|
7374
|
-
return;
|
|
7495
|
+
if (!this._preventClick && includes(this.mode, 'click')) {
|
|
7496
|
+
this.toggle();
|
|
7375
7497
|
}
|
|
7376
|
-
|
|
7377
|
-
this.toggle();
|
|
7378
7498
|
} },
|
|
7379
7499
|
|
|
7380
7500
|
|
|
@@ -9362,12 +9482,17 @@
|
|
|
9362
9482
|
|
|
9363
9483
|
computed: {
|
|
9364
9484
|
props(properties, $el) {
|
|
9365
|
-
|
|
9366
|
-
|
|
9367
|
-
|
|
9485
|
+
const stops = {};
|
|
9486
|
+
for (const prop in properties) {
|
|
9487
|
+
if (prop in props && !isUndefined(properties[prop])) {
|
|
9488
|
+
stops[prop] = properties[prop].slice();
|
|
9368
9489
|
}
|
|
9369
|
-
|
|
9370
|
-
|
|
9490
|
+
}
|
|
9491
|
+
const result = {};
|
|
9492
|
+
for (const prop in stops) {
|
|
9493
|
+
result[prop] = props[prop](prop, $el, stops[prop], stops);
|
|
9494
|
+
}
|
|
9495
|
+
return result;
|
|
9371
9496
|
} },
|
|
9372
9497
|
|
|
9373
9498
|
|
|
@@ -9496,58 +9621,66 @@
|
|
|
9496
9621
|
};
|
|
9497
9622
|
}
|
|
9498
9623
|
|
|
9499
|
-
function backgroundFn(prop, el, stops) {
|
|
9624
|
+
function backgroundFn(prop, el, stops, props) {
|
|
9500
9625
|
if (stops.length === 1) {
|
|
9501
9626
|
stops.unshift(0);
|
|
9502
9627
|
}
|
|
9503
9628
|
|
|
9504
|
-
|
|
9505
|
-
|
|
9506
|
-
|
|
9629
|
+
const attr = prop === 'bgy' ? 'height' : 'width';
|
|
9630
|
+
props[prop] = parseStops(stops, (stop) => toPx(stop, attr, el));
|
|
9631
|
+
|
|
9632
|
+
const bgProps = ['bgx', 'bgy'].filter((prop) => prop in props);
|
|
9633
|
+
if (bgProps.length === 2 && prop === 'bgx') {
|
|
9634
|
+
return noop;
|
|
9635
|
+
}
|
|
9636
|
+
|
|
9637
|
+
if (getCssValue(el, 'backgroundSize', '') === 'cover') {
|
|
9638
|
+
return backgroundCoverFn(prop, el, stops, props);
|
|
9639
|
+
}
|
|
9507
9640
|
|
|
9508
|
-
const
|
|
9641
|
+
const positions = {};
|
|
9642
|
+
for (const prop of bgProps) {
|
|
9643
|
+
positions[prop] = getBackgroundPos(el, prop);
|
|
9644
|
+
}
|
|
9509
9645
|
|
|
9510
|
-
return
|
|
9511
|
-
backgroundCoverFn(prop, el, stops, bgPos, attr) :
|
|
9512
|
-
setBackgroundPosFn(prop, stops, bgPos);
|
|
9646
|
+
return setBackgroundPosFn(bgProps, props, positions);
|
|
9513
9647
|
}
|
|
9514
9648
|
|
|
9515
|
-
function backgroundCoverFn(prop, el, stops,
|
|
9649
|
+
function backgroundCoverFn(prop, el, stops, props) {
|
|
9516
9650
|
const dimImage = getBackgroundImageDimensions(el);
|
|
9517
9651
|
|
|
9518
9652
|
if (!dimImage.width) {
|
|
9519
9653
|
return noop;
|
|
9520
9654
|
}
|
|
9521
9655
|
|
|
9522
|
-
const values = stops.map((_ref2) => {let [value] = _ref2;return value;});
|
|
9523
|
-
const min = Math.min(...values);
|
|
9524
|
-
const max = Math.max(...values);
|
|
9525
|
-
const down = values.indexOf(min) < values.indexOf(max);
|
|
9526
|
-
|
|
9527
|
-
const diff = max - min;
|
|
9528
|
-
let pos = (down ? -diff : 0) - (down ? min : max);
|
|
9529
|
-
|
|
9530
9656
|
const dimEl = {
|
|
9531
9657
|
width: el.offsetWidth,
|
|
9532
9658
|
height: el.offsetHeight };
|
|
9533
9659
|
|
|
9534
9660
|
|
|
9535
|
-
const
|
|
9536
|
-
const span = baseDim[attr] - dimEl[attr];
|
|
9661
|
+
const bgProps = ['bgx', 'bgy'].filter((prop) => prop in props);
|
|
9537
9662
|
|
|
9538
|
-
|
|
9539
|
-
|
|
9540
|
-
|
|
9541
|
-
const
|
|
9663
|
+
const positions = {};
|
|
9664
|
+
for (const prop of bgProps) {
|
|
9665
|
+
const values = props[prop].map((_ref2) => {let [value] = _ref2;return value;});
|
|
9666
|
+
const min = Math.min(...values);
|
|
9667
|
+
const max = Math.max(...values);
|
|
9668
|
+
const down = values.indexOf(min) < values.indexOf(max);
|
|
9669
|
+
const diff = max - min;
|
|
9542
9670
|
|
|
9543
|
-
|
|
9544
|
-
|
|
9545
|
-
}
|
|
9671
|
+
positions[prop] = (down ? -diff : 0) - (down ? min : max) + "px";
|
|
9672
|
+
dimEl[prop === 'bgy' ? 'height' : 'width'] += diff;
|
|
9546
9673
|
}
|
|
9547
9674
|
|
|
9548
9675
|
const dim = Dimensions.cover(dimImage, dimEl);
|
|
9549
9676
|
|
|
9550
|
-
const
|
|
9677
|
+
for (const prop of bgProps) {
|
|
9678
|
+
const attr = prop === 'bgy' ? 'height' : 'width';
|
|
9679
|
+
const overflow = dim[attr] - dimEl[attr];
|
|
9680
|
+
positions[prop] = "max(" + getBackgroundPos(el, prop) + ",-" + overflow + "px) + " + positions[prop];
|
|
9681
|
+
}
|
|
9682
|
+
|
|
9683
|
+
const fn = setBackgroundPosFn(bgProps, positions, props);
|
|
9551
9684
|
return (css, percent) => {
|
|
9552
9685
|
fn(css, percent);
|
|
9553
9686
|
css.backgroundSize = dim.width + "px " + dim.height + "px";
|
|
@@ -9555,9 +9688,16 @@
|
|
|
9555
9688
|
};
|
|
9556
9689
|
}
|
|
9557
9690
|
|
|
9558
|
-
function
|
|
9691
|
+
function getBackgroundPos(el, prop) {
|
|
9692
|
+
return getCssValue(el, "background-position-" + prop.substr(-1), '');
|
|
9693
|
+
}
|
|
9694
|
+
|
|
9695
|
+
function setBackgroundPosFn(bgProps, positions, props) {
|
|
9559
9696
|
return function (css, percent) {
|
|
9560
|
-
|
|
9697
|
+
for (const prop of bgProps) {
|
|
9698
|
+
const value = getValue(props[prop], percent);
|
|
9699
|
+
css["background-position-" + prop.substr(-1)] = "calc(" + positions[prop] + " + " + value + "px)";
|
|
9700
|
+
}
|
|
9561
9701
|
};
|
|
9562
9702
|
}
|
|
9563
9703
|
|
|
@@ -9743,6 +9883,21 @@
|
|
|
9743
9883
|
|
|
9744
9884
|
|
|
9745
9885
|
|
|
9886
|
+
/*
|
|
9887
|
+
* Inspired by https://gist.github.com/gre/1650294?permalink_comment_id=3477425#gistcomment-3477425
|
|
9888
|
+
*
|
|
9889
|
+
* linear: 0
|
|
9890
|
+
* easeInSine: 0.5
|
|
9891
|
+
* easeOutSine: -0.5
|
|
9892
|
+
* easeInQuad: 1
|
|
9893
|
+
* easeOutQuad: -1
|
|
9894
|
+
* easeInCubic: 2
|
|
9895
|
+
* easeOutCubic: -2
|
|
9896
|
+
* easeInQuart: 3
|
|
9897
|
+
* easeOutQuart: -3
|
|
9898
|
+
* easeInQuint: 4
|
|
9899
|
+
* easeOutQuint: -4
|
|
9900
|
+
*/
|
|
9746
9901
|
function ease(percent, easing) {
|
|
9747
9902
|
return easing >= 0 ? Math.pow(percent, easing + 1) : 1 - Math.pow(1 - percent, 1 - easing);
|
|
9748
9903
|
}
|